query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
This method is called when a player sends a trade offer to another player
boolean canAcceptTrade();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void sendTradeOffer(TradeOffer offer) {\n\t\t\r\n\t}", "public void onTradeRequest(String name)\n {\n\t\tif(traded_ammount > 0)\n\t\t{\n\t\t\ttraded_ammount = 0;\n\t\t\ttime = System.currentTimeMillis();\n\t\t}\n\t\tint[] player = getPlayerByName(name);\n\t\tint player_id = getPlayerPID(player[0]);\n\t\tsendTradeRequest(player_id);\n }", "void offerTrade(int receiver, Resources resources);", "@Override\r\n\tpublic void acceptTrade(boolean willAccept) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onTrade(Trade trade) throws Exception {\n\t\t\r\n\t}", "@Override\n public void offerTrade(IResourceBank offer, int recipientPlayerIndex) throws ModelException {\n IPlayer p = GameModelFacade.instance().getLocalPlayer();\n\n if (!p.canAfford(offer) || !GameModelFacade.instance().localPlayerIsPlaying() || !offer.containsResources()) {\n throw new ModelException(\"Preconditions for action not met.\");\n }\n\n try {\n String clientModel = m_theProxy.offerTrade(p.getIndex(), offer, recipientPlayerIndex);\n new ModelInitializer().initializeClientModel(clientModel, m_theProxy.getPlayerId());\n } catch (NetworkException e) {\n throw new ModelException(e);\n }\n }", "@Override\n protected void trade(){\n // An example of a random trade proposal: offer peasants in exchange of soldiers\n // Pick the id of the potential partner (without checking if it is my neighbor)\n double pertnerID = (new Random()).nextInt(42)+1;\n trade[0] = pertnerID;\n // Choose the type of good demanded (peasants - 3)\n double demandType = 3;\n trade[1] = demandType;\n // Choose the amount of demanded goods\n double demand = Math.random();\n trade[2] = demand;\n // Choose the type of good offered in exchange (peasants - 2)\n double offerType = 2;\n trade[3] = offerType;\n // Choode the amount of goods offered in exchange (random but less than my total number of peasants)\n double offer = (new Random()).nextDouble()*myTerritory.getPeasants();\n trade[4] = offer;\n\n // This procedure updated the array trade, which contains the information\n // about trade proposals of the current lord\n }", "public boolean request() {\n\t\tif (inAnySession()) {\n\t\t\tplayer.exchangeSession.reset();\n\t\t\treturn false;\n\t\t}\n\t\t\n if (!PlayerRight.isDeveloper(player) && !PlayerRight.isDeveloper(other)) {\n if (player.playTime < 3000) {\n player.message(\"You cannot trade until you have 30 minutes of playtime. \" + Utility.getTime(3000 - player.playTime) + \" minutes remaining.\");\n return false;\n }\n if (other.playTime < 3000) {\n player.message(other.getName() + \" cannot trade until they have 30 minutes of playtime.\");\n return false;\n }\n }\n\t\t \n\t\tif (getSession(other).isPresent() && getSession(other).get().inAnySession()) {\n\t\t\tplayer.message(\"This player is currently is a \" + type.name + \" with another player.\");\n\t\t\treturn false;\n\t\t}\n\t\tif (Objects.equals(player, other)) {\n\t\t\tplayer.message(\"You cannot \" + type.name + \" with yourself.\");\n\t\t\treturn false;\n\t\t}\n if (PlayerRight.isIronman(player) && !PlayerRight.isDeveloper(other)) {\n player.message(\"You can not \" + type.name + \" as you are an iron man.\");\n return false;\n }\n if (PlayerRight.isIronman(other) && !PlayerRight.isDeveloper(player)) {\n player.message(other.getName() + \" can not be \" + type.name + \"d as they are an iron man.\");\n return false;\n }\n\t\tif (player.exchangeSession.requested_players.contains(other)) {\n\t\t\tplayer.message(\"You have already sent a request to this player.\");\n\t\t\treturn false;\n\t\t}\n\t\tif (player.locking.locked()) {\n\t\t\tplayer.message(\"You cannot send a \" + type.name + \" request right now.\");\n\t\t\treturn false;\n\t\t}\n\t\tif (other.locking.locked()) {\n\t\t\tplayer.message(other.getName() + \" is currently busy.\");\n\t\t\treturn false;\n\t\t}\n\t\tif (player.playerAssistant.busy()) {\n\t\t\tplayer.message(\"Please finish what you are doing before you do that.\");\n\t\t\treturn false;\n\t\t}\n\t\tif (other.playerAssistant.busy()) {\n\t\t\tplayer.message(other.getName() + \" is currently busy.\");\n\t\t\treturn false;\n\t\t}\n\t\tif (player.inActivity(ActivityType.DUEL_ARENA)) {\n\t\t\tplayer.message(\"You can not do that whilst in a duel!\");\n\t\t\treturn false;\n\t\t}\n\t\tif (other.inActivity(ActivityType.DUEL_ARENA)) {\n\t\t\tother.message(\"You can not do that whilst in a duel!\");\n\t\t\treturn false;\n\t\t}\n\t\tif (!onRequest()) {\n\t\t\treturn false;\n\t\t}\n\t\treturn SESSIONS.add(this);\n\t}", "private void botTrading(){\n if(game.isCardPositive(game.getHighestSharePriceStock())){\n int numShares = player.getFunds()/(game.getHighestSharePriceStock().getSharePrice()+3);\n player.getShares().set(game.getIndex(game.getHighestSharePriceStock()), player.getShares().get(game.getIndex(game.getHighestSharePriceStock())) + numShares);\n player.setFunds(-numShares*(game.getHighestSharePriceStock().getSharePrice()+3));\n }\n }", "public void logTrade(String player1, String player2) {\n\t\ttry {\n\n\t\t\tDateFormat df = new SimpleDateFormat(\"'On' MM/dd/yyyy 'at' HH:mm:ss\");\n\t\t\tDate d = new Date();\n\t\t\tBufferedWriter log = new BufferedWriter(new FileWriter(Data.TRADE_LOG, true));\n\n\t\t\ttry {\n\t\t\t\tlog.write(df.format(d) + \", \" + player1 + \" and \" + player2 + \" traded with each other.\");\n\n\t\t\t\tlog.newLine();\n\t\t\t\tlog.newLine();\n\n\t\t\t\tlog.write(player1 + \"'s offer was: \");\n\t\t\t\tfor (int i = 0; i < ClickingButtons.ids1.size(); i++) {\n\t\t\t\t\tlog.write(ClickingButtons.amounts1.get(i) + \"x \"\n\t\t\t\t\t\t\t+ c.getItems().getItemName(ClickingButtons.ids1.get(i)) + \", \");\n\t\t\t\t}\n\n\t\t\t\tlog.newLine();\n\t\t\t\tlog.newLine();\n\n\t\t\t\tlog.write(player2 + \"'s offer was: \");\n\t\t\t\tfor (int i = 0; i < ClickingButtons.ids2.size(); i++) {\n\t\t\t\t\tlog.write(ClickingButtons.amounts2.get(i) + \"x \"\n\t\t\t\t\t\t\t+ c.getItems().getItemName(ClickingButtons.ids2.get(i)) + \", \");\n\n\t\t\t\t}\n\n\t\t\t\tlog.newLine();\n\n\t\t\t} finally {\n\t\t\t\tlog.newLine();\n\t\t\t\tlog.newLine();\n\t\t\t\tlog.newLine();\n\t\t\t\tlog.close();\n\n\t\t\t\tClickingButtons.ids1.clear();\n\t\t\t\tClickingButtons.ids2.clear();\n\t\t\t\tClickingButtons.amounts1.clear();\n\t\t\t\tClickingButtons.amounts2.clear();\n\t\t\t}\n\n\t\t} catch (IOException ioe) {\n\t\t\tioe.printStackTrace();\n\t\t}\n\t}", "@Override\r\n\tpublic void setPlayerToTradeWith(int playerIndex) {\n\t\t\r\n\t}", "public void requestAccepted(String username)\n\t{\n\t\t// Player otherPlayer = TcpProtocolHandler.getPlayer(username);\n\t\tPlayer otherPlayer = ActiveConnections.getPlayer(username);\n\t\tif(otherPlayer != null)\n\t\t{\n\t\t\tif(m_requests.containsKey(username))\n\t\t\t\tswitch(m_requests.get(username))\n\t\t\t\t{\n\t\t\t\t\tcase BATTLE:\n\t\t\t\t\t\t/* First, ensure both players are on the same map */\n\t\t\t\t\t\tif(otherPlayer.getMap() != getMap())\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t/* Based on the map's pvp type, check this battle is possible If pvp is enforced, it will be started when the offer is made */\n\t\t\t\t\t\tif(getMap().getPvPType() != null)\n\t\t\t\t\t\t\tswitch(getMap().getPvPType())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcase DISABLED:\n\t\t\t\t\t\t\t\t\t/* Some maps have pvp disabled */\n\t\t\t\t\t\t\t\t\tServerMessage sendNotOther = new ServerMessage(ClientPacket.PVP_PACKETS);\n\t\t\t\t\t\t\t\t\tsendNotOther.addInt(2);\n\t\t\t\t\t\t\t\t\totherPlayer.getSession().Send(sendNotOther);\n\t\t\t\t\t\t\t\t\tServerMessage sendNot = new ServerMessage(ClientPacket.PVP_PACKETS);\n\t\t\t\t\t\t\t\t\tsendNot.addInt(2);\n\t\t\t\t\t\t\t\t\tgetSession().Send(sendNot);\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\tcase ENABLED:\n\t\t\t\t\t\t\t\t\t/* This is a valid battle, start it */\n\t\t\t\t\t\t\t\t\tensureHealthyPokemon();\n\t\t\t\t\t\t\t\t\totherPlayer.ensureHealthyPokemon();\n\t\t\t\t\t\t\t\t\tm_battleField = new PvPBattleField(DataService.getBattleMechanics(), this, otherPlayer);\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\tcase ENFORCED:\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tm_battleField = new PvPBattleField(DataService.getBattleMechanics(), this, otherPlayer);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TRADE:\n\t\t\t\t\t\tif(canTrade() && otherPlayer.canTrade())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t/* Set the player as talking so they can't move */\n\t\t\t\t\t\t\tm_isTalking = true;\n\t\t\t\t\t\t\t/* Create the trade */\n\t\t\t\t\t\t\tm_trade = new Trade(this, otherPlayer);\n\t\t\t\t\t\t\totherPlayer.setTrade(m_trade);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tServerMessage sendNotOther = new ServerMessage(ClientPacket.PVP_PACKETS);\n\t\t\t\t\t\t\tsendNotOther.addInt(4);\n\t\t\t\t\t\t\totherPlayer.getSession().Send(sendNotOther);\n\t\t\t\t\t\t\tServerMessage sendNot = new ServerMessage(ClientPacket.PVP_PACKETS);\n\t\t\t\t\t\t\tsendNot.addInt(4);\n\t\t\t\t\t\t\tgetSession().Send(sendNot);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tServerMessage sendNot = new ServerMessage(ClientPacket.PVP_PACKETS);\n\t\t\tsendNot.addInt(0);\n\t\t\tgetSession().Send(sendNot);\n\t\t}\n\t}", "public void sendJoiningPlayer() {\r\n Player p = nui.getPlayerOne();\r\n XferJoinPlayer xfer = new XferJoinPlayer(p);\r\n nui.notifyJoinConnected();\r\n networkPlayer.sendOutput(xfer);\r\n }", "private void tradeCommand(){\n out.println(\"\\r\\nShares you own:\" +\n \"\\r\\nApple: \" + player.getShares().get(0) +\n \"\\r\\nBP: \" + player.getShares().get(1) +\n \"\\r\\nCisco: \" + player.getShares().get(2) +\n \"\\r\\nDell: \" + player.getShares().get(3) +\n \"\\r\\nEricsson: \" + player.getShares().get(4) +\n \"\\r\\n\\r\\nShare prices: Apple-\" + game.apple.getSharePrice() +\n \", BP-\" + game.bp.getSharePrice() +\n \", Cisco-\" + game.cisco.getSharePrice() +\n \", Dell-\" + game.dell.getSharePrice() +\n \", Ericsson-\" + game.ericsson.getSharePrice() +\n \"\\r\\n\\r\\nFunds: £\" + player.getFunds() + \", Current value of shares: £\" + getTotalShareValue(player) + \"\\r\\n\"\n );\n\n out.println(\"Would you like to buy(b) or sell(s) shares? Enter 'X' to exit.\");\n String bsInput = in.nextLine().trim();\n if (bsInput.toUpperCase().equals(\"B\")){\n getTradeParam(1); //buy\n }else if (bsInput.toUpperCase().equals(\"S\")){\n getTradeParam(0); //sell\n }else if (bsInput.toUpperCase().equals(\"X\")){\n command();\n }else{\n out.println(\"Invalid input\");\n tradeCommand();\n }\n }", "public interface ITicketSpotBiz {\n //send ticket\n public void sendTicket(Player player);\n}", "protected boolean processPlayerOffered(int gameNum, String playerName, String offer){\n return false;\n }", "public abstract void sendConfirmationMessage(Player player);", "@ReceiveEvent\n public void onTradeResponse(TradeResponse response, EntityRef entity) {\n if (!entity.equals(localPlayer.getCharacterEntity())) {\n return;\n }\n\n tradingScreen.setMessage(response.message);\n refreshLists();\n }", "@Override\n protected void acceptTrade(Territory offerer, double demand, int typeDemand, double offer, int typeOffer){\n // An example for accepting a trade proposal: I only accept offers of peasants when I have less than 3 peasants\n // I am not checking what I am giving in exchange or how much, so you should work on that\n if (typeOffer == 3 && typeDemand == 2){\n acceptTrade = true;// no matter the amounts\n }\n else acceptTrade = false;\n }", "private void offer() {\n\t\t\t\n\t\t}", "public String offerTrade(OfferTrade offerTrade) throws Exception {\n\t\tString url = server_url + \"/moves/offerTrade\";\n\t\tURL obj = new URL(url);\n\t\tHttpURLConnection con = (HttpURLConnection) obj.openConnection();\n\n\t\t//add request header\n\t\tcon.setRequestMethod(\"POST\");\n\t\tcon.setRequestProperty(\"User-Agent\", \"Mozilla/5.0\");\n\t\tcon.setRequestProperty(\"Accept-Language\", \"en-US,en;q=0.5\");\n\t\tcon.setRequestProperty(\"Cookie\", usercookie + \"; \" + gamecookie);\n\t\t\n\t\tJsonObject info = new JsonObject();\n\t\tinfo.addProperty(\"type\",\"offerTrade\");\n\t\tinfo.addProperty(\"playerIndex\", offerTrade.playerIndex);\n\t\tinfo.addProperty(\"receiver\", offerTrade.receiverIndex);\n\t\t\n\t\tJsonObject offer = new JsonObject();\n\t\toffer.addProperty(\"wood\", offerTrade.wood);\n\t\toffer.addProperty(\"sheep\", offerTrade.sheep);\n\t\toffer.addProperty(\"ore\", offerTrade.ore);\n\t\toffer.addProperty(\"wheat\", offerTrade.wheat);\n\t\toffer.addProperty(\"brick\", offerTrade.brick);\n\t\tinfo.add(\"offer\", offer);\n\t\t\n\t\t// Send post request\n\t\tcon.setDoOutput(true);\n\t\tDataOutputStream wr = new DataOutputStream(con.getOutputStream());\n\t\twr.writeBytes(info.toString());\n\t\twr.flush();\n\t\twr.close();\n\n\t\tint responseCode = con.getResponseCode();\n\t\t//System.out.println(\"\\nSending 'POST' request to URL : \" + url);\n\t\t//System.out.println(\"Post parameters : \" + info.toString());\n\t\t//System.out.println(\"Response Code : \" + responseCode);\n\n\t\tif (responseCode == 400) {\n\t\t\tthrow new Exception();\n\t\t}\n\t\tBufferedReader in = new BufferedReader(\n\t\t new InputStreamReader(con.getInputStream()));\n\t\tString inputLine;\n\t\tStringBuffer response = new StringBuffer();\n\n\t\twhile ((inputLine = in.readLine()) != null) {\n\t\t\tresponse.append(inputLine);\n\t\t}\n\t\tin.close();\n\t\t\n\t\t//print result\n\t\t////System.out.println(response.toString());\n\t\treturn response.toString();\n\t}", "public abstract void performPurchase(Player player);", "public static String requestTransfer(Player player, Team playersTeam, double bid, Library library, TransferList existingTransfers) {\n\t\tif (playersTeam.isMax()) {\n\t\t\treturn \"You already have 30 players in your team, this is the maximum. Sell some players before trying to buy any new!\";\n\t\t} else {\n\t\tif (existingTransfers.getTransfer(player)==null) {\n\t\t\tboolean answer = TransferLogic.getAnswer(player, bid, library, existingTransfers);\n\t\t\tif (answer) {\n\t\t\t\tTeam opponentsTeam = library.getTeamForName(player.getTeam());\n\t\t\t\topponentsTeam.deleteIfInCurrentTeam(player);\n//\t\t\t\tif (opponentsTeam.getPositions().contains(player)) {\n//\t\t\t\t\t\n//\t\t\t\t\tboolean itsdone=false;\n//\t\t\t\t\tfor (int i=0;i<opponentsTeam.getTeam().size();i++) {\n//\t\t\t\t\t\tif (!itsdone) {\n//\t\t\t\t\t\t\tPlayer p = opponentsTeam.getTeam().get(i);\n//\t\t\t\t\t\t\tif (p.getPlayerType().equals(player.getPlayerType()) && !(opponentsTeam.getPositions().contains(p))) {\n//\t\t\t\t\t\t\t\topponentsTeam.replacePlayerInCurrentTeam(player, p);\n//\t\t\t\t\t\t\t\titsdone=true;\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t}\n//\t\t\t\t\t}\n//\t\t\t\t\tif (!itsdone) {\n//\t\t\t\t\t\tfor (int i=0;i<opponentsTeam.getTeam().size();i++) {\n//\t\t\t\t\t\t\tif (!itsdone) {\n//\t\t\t\t\t\t\t\tPlayer p = opponentsTeam.getTeam().get(i);\n//\t\t\t\t\t\t\t\tif (((p instanceof FieldPlayer && player instanceof FieldPlayer) || (p instanceof Goalkeeper && player instanceof Goalkeeper)) && !(opponentsTeam.getPositions().contains(p))) {\n//\t\t\t\t\t\t\t\t\topponentsTeam.replacePlayerInCurrentTeam(player, p);\n//\t\t\t\t\t\t\t\t\titsdone=true;\n//\t\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t}\n//\t\t\t\t\t}\n//\t\t\t\t\t\n//\t\t\t\t\t\n//\t\t\t\t}\n\t\t\t\t\n\t\t\t\tplayersTeam.add(player);\n\t\t\t\topponentsTeam.getTeam().remove(player);\n\t\t\t\tplayer.setTeam(playersTeam.getTeamName());\n\t\t\t\tplayersTeam.setBudget(playersTeam.getBudget()-bid);\n\t\t\t\topponentsTeam.setBudget(opponentsTeam.getBudget()+bid);\n\t\t\t\tBigDecimal bbid = new BigDecimal(bid);\n\t\t\t\t\n\t\t\t\t//price string\n\t\t\t\t\n\t\t\t\tDecimalFormat formatter = (DecimalFormat) NumberFormat.getInstance(Locale.US);\n\t\t\t\tbbid = bbid.setScale(2, BigDecimal.ROUND_DOWN);\n\t\t\t\tDecimalFormat df = new DecimalFormat();\n\t\t\t\tdf.setGroupingUsed(false);\t\t\n\t\t\t\tString priceString = formatter.format(bbid.longValue());\n\t\t\t\t\n\t\t\t\t\n\t\t\t\treturn \"Congratulations! Your bid of \" + priceString + \" got accepted and \" + player.getName() + \" is now part of your team\";\n\t\t\t} else {\n\t\t\t\tdouble percentage = bid/player.getPrice().doubleValue()*100-100;\n\t\t\t\tdouble returnedprice=0;\n\t\t\t\tdouble price = player.getPrice().doubleValue();\n\t\t\t\tif (percentage<-10) {\n\t\t\t\t\treturnedprice=0.9*price;\n\t\t\t\t} if (percentage>=-10 && percentage<0) {\n\t\t\t\t\treturnedprice=price;\n\t\t\t\t} if (percentage>=0 && percentage<5) {\n\t\t\t\t\treturnedprice=1.05*price;\n\t\t\t\t} if (percentage>=5 && percentage<10) {\n\t\t\t\t\treturnedprice=1.1*price;\n\t\t\t\t} if (percentage>=10 && percentage<15) {\n\t\t\t\t\treturnedprice=1.15*price;\n\t\t\t\t} if (percentage>=15 && percentage<20) {\n\t\t\t\t\treturnedprice=1.2*price;\n\t\t\t\t} if (percentage>=20 && percentage<25) {\n\t\t\t\t\treturnedprice=1.25*price;\n\t\t\t\t} if (percentage>=25 && percentage<30) {\n\t\t\t\t\treturnedprice=1.3*price;\n\t\t\t\t} \n\t\t\t\t\n\t\t\t\tTransferInProgress tp = new TransferInProgress(player, returnedprice, bid);\n\t\t\t\texistingTransfers.addTransfer(tp);\n\t\t\t\tBigDecimal bbid = new BigDecimal(bid);\n\t\t\t\tBigDecimal breturnedprice = new BigDecimal(returnedprice);\n\t\t\t\t//price string\n\t\t\t\t\n\t\t\t\tDecimalFormat formatter = (DecimalFormat) NumberFormat.getInstance(Locale.US);\n\t\t\t\tbbid = bbid.setScale(2, BigDecimal.ROUND_DOWN);\n\t\t\t\tbreturnedprice = breturnedprice.setScale(2, BigDecimal.ROUND_DOWN);\n\t\t\t\tDecimalFormat df = new DecimalFormat();\n\t\t\t\tdf.setGroupingUsed(false);\t\t\n\t\t\t\tString priceString = formatter.format(bbid.longValue());\n\t\t\t\tString priceString2 = formatter.format(breturnedprice.longValue());\n\t\t\t\treturn player.getTeam() + \" did not accept your offer of \" + priceString + \" for \" + player.getName() + \". They have indicated they want at least \" + priceString2 + \" for this player\";\n\t\t\t\t\n\t\t\t}\n\t\t} else {\n\t\t\tTransferInProgress tp = existingTransfers.getTransfer(player);\n\t\t\tboolean answer = TransferLogic.getAnswerForExistingTransfer(player, bid, library, existingTransfers, tp.getPriceReturned());\n\t\t\tif (answer) {\n\t\t\t\tTeam opponentsTeam = library.getTeamForName(player.getTeam());\n\t\t\t\topponentsTeam.deleteIfInCurrentTeam(player);\n//\t\t\t\tif (opponentsTeam.getPositions().contains(player)) {\n//\t\t\t\t\tboolean itsdone=false;\n//\t\t\t\t\tfor (int i=0;i<opponentsTeam.getTeam().size();i++) {\n//\t\t\t\t\t\tif (!itsdone) {\n//\t\t\t\t\t\t\tPlayer p = opponentsTeam.getTeam().get(i);\n//\t\t\t\t\t\t\tif (p.getPlayerType().equals(player.getPlayerType()) && !(opponentsTeam.getPositions().contains(p))) {\n//\t\t\t\t\t\t\t\topponentsTeam.replacePlayerInCurrentTeam(player, p);\n//\t\t\t\t\t\t\t\titsdone=true;\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t}\n//\t\t\t\t\t}\n//\t\t\t\t\tif (!itsdone) {\n//\t\t\t\t\t\tfor (int i=0;i<opponentsTeam.getTeam().size();i++) {\n//\t\t\t\t\t\t\tif (!itsdone) {\n//\t\t\t\t\t\t\t\tPlayer p = opponentsTeam.getTeam().get(i);\n//\t\t\t\t\t\t\t\tif (((p instanceof FieldPlayer && player instanceof FieldPlayer) || (p instanceof Goalkeeper && player instanceof Goalkeeper)) && !(opponentsTeam.getPositions().contains(p))) {\n//\t\t\t\t\t\t\t\t\topponentsTeam.replacePlayerInCurrentTeam(player, p);\n//\t\t\t\t\t\t\t\t\titsdone=true;\n//\t\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t}\n//\t\t\t\t\t}\n//\t\t\t\t\t\n//\t\t\t\t\t\n//\t\t\t\t}\n\t\t\t\t\n\t\t\t\tplayersTeam.add(player);\n\t\t\t\topponentsTeam.getTeam().remove(player);\n\t\t\t\tplayer.setTeam(playersTeam.getTeamName());\n\t\t\t\texistingTransfers.getTransfers().remove(tp);\n\t\t\t\tplayersTeam.setBudget(playersTeam.getBudget()-bid);\n\t\t\t\topponentsTeam.setBudget(opponentsTeam.getBudget()+bid);\n\t\t\t\tBigDecimal bbid = new BigDecimal(bid);\n\t\t\t\t//price string\n\t\t\t\t\n\t\t\t\tDecimalFormat formatter = (DecimalFormat) NumberFormat.getInstance(Locale.US);\n\t\t\t\tbbid = bbid.setScale(2, BigDecimal.ROUND_DOWN);\n\t\t\t\tDecimalFormat df = new DecimalFormat();\n\t\t\t\tdf.setGroupingUsed(false);\t\t\n\t\t\t\tString priceString = formatter.format(bbid.longValue());\n\t\t\t\treturn \"Congratulations! Your bid of \" + priceString + \" got accepted and \" + player.getName() + \" is now part of your team\";\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tdouble pricereturned = existingTransfers.getTransfer(player).getPriceReturned();\n\t\t\t\t\n\t\t\t\tif (bid>pricereturned) {\n\t\t\t\t\tdouble percentage = bid/player.getPrice().doubleValue()*100-100;\n\t\t\t\t\tdouble returnedprice=0;\n\t\t\t\t\tdouble price = player.getPrice().doubleValue();\n\t\t\t\t\tif (percentage<-10) {\n\t\t\t\t\t\treturnedprice=0.9*price;\n\t\t\t\t\t} if (percentage>=-10 && percentage<0) {\n\t\t\t\t\t\treturnedprice=price;\n\t\t\t\t\t} if (percentage>=0 && percentage<5) {\n\t\t\t\t\t\treturnedprice=1.05*price;\n\t\t\t\t\t} if (percentage>=5 && percentage<10) {\n\t\t\t\t\t\treturnedprice=1.1*price;\n\t\t\t\t\t} if (percentage>=10 && percentage<15) {\n\t\t\t\t\t\treturnedprice=1.15*price;\n\t\t\t\t\t} if (percentage>=15 && percentage<20) {\n\t\t\t\t\t\treturnedprice=1.2*price;\n\t\t\t\t\t} if (percentage>=20 && percentage<25) {\n\t\t\t\t\t\treturnedprice=1.25*price;\n\t\t\t\t\t} if (percentage>=25 && percentage<30) {\n\t\t\t\t\t\treturnedprice=1.3*price;\n\t\t\t\t\t}\n\t\t\t\t\texistingTransfers.getTransfer(player).setPriceReturned(returnedprice);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\texistingTransfers.getTransfer(player).setBid(bid);\n\t\t\t\tBigDecimal bbid = new BigDecimal (bid);\n\t\t\t\tBigDecimal bpriceReturned = new BigDecimal(existingTransfers.getTransfer(player).getPriceReturned());\n\t\t\t\t//price string\n\t\t\t\t\n\t\t\t\tDecimalFormat formatter = (DecimalFormat) NumberFormat.getInstance(Locale.US);\n\t\t\t\tbbid = bbid.setScale(2, BigDecimal.ROUND_DOWN);\n\t\t\t\tbpriceReturned = bpriceReturned.setScale(2, BigDecimal.ROUND_DOWN);\n\t\t\t\tDecimalFormat df = new DecimalFormat();\n\t\t\t\tdf.setGroupingUsed(false);\t\t\n\t\t\t\tString priceString = formatter.format(bbid.longValue());\n\t\t\t\tString priceString2 = formatter.format(bpriceReturned.longValue());\n\t\t\t\treturn player.getTeam() + \" did not accept your offer of \" + priceString + \" for \" + player.getName() + \". They have indicated they want at least \" + priceString2 + \" for this player\";\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}}", "@Override\n\tpublic void passedBy() {\n\t\tMonopolyGameController.getInstance();\n\t\tMonopolyGameController.getCurrentPlayer().increaseMoney(250);\n\t\tLogger.getInstance().notifyAll(MonopolyGameController.getCurrentPlayer().getName()+ \" gained 250 dollars by landing on Bonus Square\");\n\n\t}", "@Override\n public void sendChatMessage(EntityPlayer player) {\n }", "public void establishDealOffer() {\n DealOffer offer = new DealOffer();\n \n int moneyToOffer = (Integer)this.playersMoneyMap.get(currentPlayer).getValue();\n offer.offerCash(moneyToOffer);\n \n Map<JCheckBox, Space> thisPlayerMap = playersCheckBoxes.get(currentPlayer);\n if (thisPlayerMap != null) {\n for (JCheckBox checkBox : thisPlayerMap.keySet()) {\n if (checkBox.isSelected()) {\n offer.addPropertyToOffer(thisPlayerMap.get(checkBox));\n }\n }\n }\n \n int moneyToRequest = (Integer)this.playersMoneyMap.get(playerToOfferTo).getValue();\n offer.requestCash(moneyToRequest);\n \n Map<JCheckBox, Space> otherPlayerMap = playersCheckBoxes.get(playerToOfferTo);\n if (otherPlayerMap != null) {\n for (JCheckBox checkBox : otherPlayerMap.keySet()) {\n if (checkBox.isSelected()) {\n offer.addPropertyToRequest(otherPlayerMap.get(checkBox));\n }\n }\n }\n this.dealOffer = offer;\n \n }", "public void onTrade(Trade event) {\n tradeCount++;\n }", "public void trade(Drop myDrop, User receiver) {\n getInventory().removeDrop(myDrop);\n receiver.getInventory().addDrop(myDrop);\n }", "public void doLogicBuy() {\n\t\tif (!player.isHuman) {\n\t\t\tif (player.money > estimatedFee * 1.5) //\n\t\t\t{\n\t\t\t\tint free = (int) (player.money - estimatedFee * 1.5);\n\t\t\t\tCell c = board.getCells().get(player.position);\n\t\t\t\tif (c instanceof TradeableCell) {\n\t\t\t\t\tTradeableCell tc = (TradeableCell) c;\n\t\t\t\t\tif (tc.getOwner() == null && tc.getPrice() < free) {\n\t\t\t\t\t\ttc.buy(player);\n\t\t\t\t\t\tboard.addMessage(\"Just bought\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void examine (Player player) {\n\t\tString desc = getType().getDescription()+\" (id=\"+id+\", amount=\"+amount+\")\";\n\t\tplayer.getDispatcher().sendGameMessage(desc);\n\t\tint value = Virtue.getInstance().getExchange().lookupPrice(id);\n\t\tif (value != -1) {\n\t\t\tplayer.getDispatcher().sendGameMessage(\"This item is worth: \"+StringUtility.formatNumber(value)\n\t\t\t\t\t+\"gp on the Grand Exchange.\");\n\t\t}\n\t}", "void respondToTrade(long tradeItemId, boolean response);", "@Override\n\t\t\t\t\t public void visit(Player player) {\n\t\t\t\t\t\t\tPacketSendUtility.sendPacket(player, SM_SYSTEM_MESSAGE.STR_MSG_HF_ShugoCaravanAppear);\n\t\t\t\t\t }", "void acceptTrade(boolean accept);", "@Override\n\tpublic void playerJoining(String playerID) {\n\t}", "public void enter(FieldPlayer player){\n player.getTeam().setReceiver(player);\n \n //this player is also now the controlling player\n player.getTeam().setControllingPlayer(player);\n\n //there are two types of receive behavior. One uses arrive to direct\n //the receiver to the position sent by the passer in its telegram. The\n //other uses the pursuit behavior to pursue the ball. \n //This statement selects between them dependent on the probability\n //ChanceOfUsingArriveTypeReceiveBehavior, whether or not an opposing\n //player is close to the receiving player, and whether or not the receiving\n //player is in the opponents 'hot region' (the third of the pitch closest\n //to the opponent's goal\n double PassThreatRadius = 70.0;\n\n if (( player.isInHotRegion() ||\n RandFloat() < Params.Instance().ChanceOfUsingArriveTypeReceiveBehavior) &&\n !player.getTeam().isOpponentWithinRadius(player.getPos(), PassThreatRadius)){\n player.getSteering().arriveOn();\n }\n else{\n player.getSteering().pursuitOn();\n }\n \n //FIXME: Change animation\n// player.info.setAnim(\"Run\");\n// player.info.setDebugText(\"ReceiveBall\");\n }", "public void handleLastAcceptedOffer(String participant, long price);", "private void botBuy(Stock stock, int numShares){\n player.getShares().set(game.getIndex(stock), player.getShares().get(game.getIndex(stock)) + numShares);\n player.setFunds(-numShares*(stock.getSharePrice()+3));\n System.out.println(\"purchase made\"); //rem\n }", "@Override\n public void sendOrder(List<AbstractPlayer> playersOrderList) {\n List<Integer> orderList = new ArrayList<>();\n for (AbstractPlayer player : playersOrderList) {\n orderList.add(player.getIdPlayer());\n }\n try {\n if (getClientInterface() != null)\n getClientInterface().notifyTurnOrder(orderList);\n }\n catch (RemoteException e) {\n System.out.println(\"remote sending order error\");\n }\n }", "protected void processPlayerArrived(String name) {\n Player player = tournamentService.findPlayer(name);\n if (player == null) {\n alertManagers(\"Arriving player {0} is on my notify list, but I don''t have him in the tournament roster.\", name);\n return;\n }\n player.setState(PlayerState.WAITING);\n Game game = tournamentService.findPlayerGame(player);\n if (game == null) return;\n if (game.status.isFinished()) return;\n if (loggingIn) {\n \tcommand.sendCommand(\"observe {0}\", name);\n } else {\n tellManagers(\"{0} arrived. Reserving board {1}.\", name, game.boardNumber);\n }\n command.sendAdminCommand(\"spoof {0} tell JudgeBot nowin\", game.whitePlayer);\n command.sendAdminCommand(\"spoof {0} tell JudgeBot nowin\", game.blackPlayer);\n command.sendAdminCommand(\"set-other {0} kib 0\", game.blackPlayer);\n command.sendAdminCommand(\"set-other {0} kib 0\", game.whitePlayer);\n command.sendAdminCommand(\"reserve-game {0} {1}\", game.whitePlayer, game.boardNumber);\n command.sendAdminCommand(\"reserve-game {0} {1}\", game.blackPlayer, game.boardNumber);\n if (game.status.isAdjourned()) {\n command.sendAdminCommand(\"spoof {0} match {1}\", game.whitePlayer, game.blackPlayer);\n command.sendAdminCommand(\"spoof {0} match {1}\", game.blackPlayer, game.whitePlayer);\n }\n }", "public TradeItemsDialog(GUI gui, Player player) {\n\t\tsuper(gui, \"Trade Items\");\n\t\t\n\t\t// initialize variables and display GUI controls\n\t\tinitiator = player;\n\t\t\t\t\n\t\tloadPlayerPanel(initiator);\n\t\t\n\t\tc.gridx = 1;\n\t\tc.gridy = 1;\n\t\t// Load list of other players into a drop down box.\n\t\tLinkedList<Player> players = new LinkedList<Player>();\n\t\tplayers.addAll(GM.getPlayers());\n\t\tplayers.remove(initiator);\n\t\tfinal JComboBox playerBox = new JComboBox(players.toArray());\n\t\tplayerBox.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(Color.BLACK), \"Trade With\"));\n\t\tplayerBox.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\t// display selected player's items for trade\n\t\t\t\tloadPlayerPanel((Player)playerBox.getSelectedItem());\n\t\t\t}\t\n\t\t});\n\t\tgetContentPane().add(playerBox, c);\n\t\tplayerBox.setSelectedIndex(0);\n\t\t\n\t\tc.gridx = 1;\n\t\tc.gridy = 2;\n\t\t// allows player to request a trade of the selected items\n\t\tCustomButton tradeButton = new CustomButton(\"Trade\") {\n\t\t\tprivate static final long serialVersionUID = 1L;\n\t\t\t\n\t\t\tpublic void buttonPressed() {\n\t\t\t\tPlayer otherPlayer = (Player)playerBox.getSelectedItem();\n\t\t\t\tLinkedList<Card> initiatorCheckedItems = initiatorPanel.getCheckedCards();\n\t\t\t\tLinkedList<Card> otherPlayerCheckedItems = otherPlayerPanel.getCheckedCards();\n\t\t\t\t\n\t\t\t\tif (initiatorCheckedItems.isEmpty() && otherPlayerCheckedItems.isEmpty())\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\tif (otherPlayer.isComputer()) {\n\t\t\t\t\tif (!willComputerTrade(initiatorCheckedItems, otherPlayerCheckedItems, otherPlayer)) {\n\t\t\t\t\t\tif (!initiator.isComputer()) {\n\t\t\t\t\t\t\tString message = otherPlayer.toString();\n\t\t\t\t\t\t\tif (otherPlayer.getPlayerType() == PlayerType.COMPUTER_EASY)\n\t\t\t\t\t\t\t\tmessage += \" politely declines your offer.\";\n\t\t\t\t\t\t\telse if (otherPlayer.getPlayerType() == PlayerType.COMPUTER_MEDIUM)\n\t\t\t\t\t\t\t\tmessage += \" feels that this trade is not in his best interests.\";\n\t\t\t\t\t\t\telse if (otherPlayer.getPlayerType() == PlayerType.COMPUTER_HARD)\n\t\t\t\t\t\t\t\tmessage += \" spits on your offer and tells you to go trade for some brains.\";\n\t\t\t\t\t\t\tMessenger.display(message, \"Trade Items\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\telse if (!initiator.isComputer()) {\n\t\t\t\t\t\tString message = otherPlayer.toString();\n\t\t\t\t\t\tif (otherPlayer.getPlayerType() == PlayerType.COMPUTER_EASY)\n\t\t\t\t\t\t\tmessage += \" gladly accepts your generous offer.\";\n\t\t\t\t\t\telse if (otherPlayer.getPlayerType() == PlayerType.COMPUTER_MEDIUM)\n\t\t\t\t\t\t\tmessage += \" decides the trade is acceptable.\";\n\t\t\t\t\t\telse if (otherPlayer.getPlayerType() == PlayerType.COMPUTER_HARD)\n\t\t\t\t\t\t\tmessage += \" laughs maniacally, greedily accepts, and whispers \\\"Sucker!\\\".\";\n\t\t\t\t\t\tMessenger.display(message, \"Trade Items\");\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\t\t\t\t\n\t\t\t\t\t// Allows other player to accept or decline the trade\n\t\t\t\t\tString prompt = otherPlayer.getName() + \", do you accept this trade?\";\n\t\t\t\t\tint result = JOptionPane.showConfirmDialog(null, prompt, \"Trade Items\", JOptionPane.YES_NO_OPTION);\n\t\t\t\t\tif (result != JOptionPane.YES_OPTION)\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Takes cards from each player and gives them to the other.\n\t\t\t\tIterator<Card> itemIter = initiatorCheckedItems.iterator();\n\t\t\t\twhile (itemIter.hasNext()) {\n\t\t\t\t\tCard item = itemIter.next();\n\t\t\t\t\tif (!initiator.removeEquipmentItem(item))\n\t\t\t\t\t\tinitiator.getCarriedItems().remove(item);\t\t\t\t\t\t\n\t\t\t\t\tif (initiator.isCheatingItem(item))\n\t\t\t\t\t\tinitiator.removeCheat();\n\t\t\t\t\t\n\t\t\t\t\totherPlayer.addItem((TreasureCard)item);\n\t\t\t\t}\n\t\t\t\titemIter = otherPlayerCheckedItems.iterator();\n\t\t\t\twhile (itemIter.hasNext()) {\n\t\t\t\t\tCard item = itemIter.next();\n\t\t\t\t\tif (!otherPlayer.removeEquipmentItem(item))\n\t\t\t\t\t\totherPlayer.getCarriedItems().remove(item);\t\n\t\t\t\t\tif (otherPlayer.isCheatingItem(item))\n\t\t\t\t\t\totherPlayer.removeCheat();\n\t\t\t\t\t\n\t\t\t\t\tinitiator.addItem((TreasureCard)item);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tloadPlayerPanel(initiator);\n\t\t\t\tloadPlayerPanel(otherPlayer);\n\t\t\t}\n\t\t};\n\t\tgetContentPane().add(tradeButton, c);\n\t\t\t\t\n\t\tc.gridy = 3;\n\t\tc.gridx = 0;\n\t\tc.gridwidth = 3;\n\t\t// display warning about restrictions on Big Items\n\t\tgetContentPane().add(new JLabel(\"WARNING: If you trade for a Big Item that you cannot carry, it will be discarded!\"), c);\n\t\tc.gridwidth = 1;\n\t\t\n\t\trefresh();\n\t}", "private boolean willComputerTrade(LinkedList<Card> initiatorTradeItems, LinkedList<Card> otherPlayerTradeItems, Player otherPlayer) {\n\t\tint tradeValue = 0;\n\t\tfor (Card item : initiatorTradeItems)\n\t\t\ttradeValue += AICardEvaluator.getCardValueToPlayer(item, otherPlayer, otherPlayer.getHandCards());\n\t\tfor (Card item : otherPlayerTradeItems)\n\t\t\ttradeValue -= AICardEvaluator.getCardValueToPlayer(item, otherPlayer, otherPlayer.getHandCards());\n\t\t\n\t\t// factor in initiator rank and trade value, depending on other player's computer level\n\t\tif (otherPlayer.getPlayerType() == PlayerType.COMPUTER_MEDIUM) {\n\t\t\tint initiatorTradeValue = 0;\n\t\t\tfor (Card item : otherPlayerTradeItems)\n\t\t\t\tinitiatorTradeValue += AICardEvaluator.getCardValueToPlayer(item, initiator, null);\n\t\t\tfor (Card item : initiatorTradeItems)\n\t\t\t\tinitiatorTradeValue -= AICardEvaluator.getCardValueToPlayer(item, initiator, null);\n\t\t\ttradeValue -= initiatorTradeValue;\n\t\t}\n\t\telse if (otherPlayer.getPlayerType() == PlayerType.COMPUTER_HARD) {\n\t\t\tdouble playerFactor = GM.getPlayers().size() - AIManager.getRankedPlayers().indexOf(initiator);\n\t\t\tplayerFactor /= (double)GM.getPlayers().size();\n\t\t\tplayerFactor *= 2.0;\n\t\t\tint initiatorTradeValue = 0;\n\t\t\tfor (Card item : otherPlayerTradeItems)\n\t\t\t\tinitiatorTradeValue += AICardEvaluator.getCardValueToPlayer(item, initiator, null);\n\t\t\tfor (Card item : initiatorTradeItems)\n\t\t\t\tinitiatorTradeValue -= AICardEvaluator.getCardValueToPlayer(item, initiator, null);\n\t\t\ttradeValue -= initiatorTradeValue * playerFactor;\n\t\t}\n\t\t\n\t\treturn (tradeValue >= 0);\n\t}", "private void buyPlayer(FootballPlayer player, String playerName, int num) {\n\t\tint valid = game.addPlayer(playerName);\n\t\tif(valid==0) {\n\t\t\tplayerNameArray[num].setText(playerName);\n\t\t\timageArray[num].setIcon(MainGui.getShirt(player.getTeamName()));\n\t\t\tbuttonArray[num].setText(\"X\");\n\t\t\tlblBudgetText.setText(game.getCurrentUser().getBudget() + \" RGG\");\n\t\t\t\n\t\t} else if (valid==1) {\n\t\t\tJOptionPane.showMessageDialog(frame,\"You have already selected this player for your team\");\n\t\t} else if (valid==-1) {\n\t\t\tJOptionPane.showMessageDialog(frame,\"You don´t have enough budget too buy \" + playerName);\n\t\t}\n\t}", "@Test\n public void testMarketOrder() throws InterruptedException {\n setUp();\n testMatchingEngine.start();\n\n NewOrder nosB1 = createLimitOrder(\"BUY1\", Side.BUY, 100, 100.1, System.currentTimeMillis());\n clientSession.sendNewOrder(nosB1);\n NewOrder nosB2 = createLimitOrder(\"BUY2\", Side.BUY, 200, 99.99, System.currentTimeMillis());\n clientSession.sendNewOrder(nosB2);\n NewOrder nosB3 = createLimitOrder(\"BUY3\", Side.BUY, 300, 99.79, System.currentTimeMillis());\n clientSession.sendNewOrder(nosB3);\n\n // Sell Order with Qty=150 and Market Order\n NewOrder nosS1 = createMarketOrder(\"SELL1\", Side.SELL, 700, System.currentTimeMillis());\n clientSession.sendNewOrder(nosS1);\n\n List<Event> msg = clientSession.getMessagesInQueue();\n assertEquals(7, msg.size());\n\n Trade t = ( Trade) msg.get(0);\n assertEquals( t.getLastTradedPrice().value() , new Price(100.1).value() );\n assertEquals( t.getLastTradedQty() , 100 );\n t = ( Trade) msg.get(1);\n assertEquals( t.getLastTradedPrice().value() , new Price(100.1).value() );\n assertEquals( t.getLastTradedQty() , 100 );\n t = ( Trade) msg.get(2);\n assertEquals( t.getLastTradedPrice().value() , new Price(99.99).value() );\n assertEquals( t.getLastTradedQty() , 200 );\n t = ( Trade) msg.get(3);\n assertEquals( t.getLastTradedPrice().value() , new Price(99.99).value() );\n assertEquals( t.getLastTradedQty() , 200 );\n t = ( Trade) msg.get(4);\n assertEquals( t.getLastTradedPrice().value() , new Price(99.79).value() );\n assertEquals( t.getLastTradedQty() , 300 );\n t = ( Trade) msg.get(5);\n assertEquals( t.getLastTradedPrice().value() , new Price(99.79).value() );\n assertEquals( t.getLastTradedQty() , 300 );\n Canceled t1 = ( Canceled) msg.get(6);\n assertEquals( t1.getCanceledQty() , 100 );\n }", "@Override\n public void run() {\n if (pendingTeleports.containsKey(sender.getName())) {\n pendingTeleports.remove(sender.getName(),originalSender);\n if (senderPlayer.dimension != teleportee.dimension) {\n TeleportHelper.transferPlayerToDimension(teleportee,senderPlayer.dimension,server.getPlayerList());\n }\n teleportee.setPositionAndUpdate(senderPlayer.posX,senderPlayer.posY,senderPlayer.posZ);\n sender.addChatMessage(new TextComponentString(TextFormatting.GREEN+\"Teleport successful.\"));\n teleportee.addChatMessage(new TextComponentString(TextFormatting.GREEN+\"Teleport successful.\"));\n } //if not, the teleportee moved\n }", "@Override\n\tpublic void execute() {\n\t\t\n\t\tif (GamesHandler.test) {\n\t\t\tserverModel = ServerFacadeTest.getSingleton().getGameModel(gameID);\n\t\t} else {\n\t\t\tserverModel = ServerFacade.getSingleton().getGameModel(gameID);\n\t\t}\n\t\t\n\t\tPlayer player = serverModel.getPlayers().get(sender);\n\t\tDevCardList playerOldDevCards = player.getOldDevCards();\n\t\t\n\t\tplayerOldDevCards.setRoadBuilding(playerOldDevCards.getRoadBuilding() - 1);\n\t\t\n\t\tserverModel.getMap().addRoad(new Road(sender, spot1));\n\t\tserverModel.getMap().addRoad(new Road(sender, spot2));\n\t\t\n\t\tplayer.setRoads(player.getRoads() - 2);\n\t\t\n\t\tplayer.setPlayedDevCard(true);\n\t\t\n\t\tMessageLine line = new MessageLine();\n\t\tString username = player.getName();\n\t\tif(username.toLowerCase().equals(\"ife\") || username.toLowerCase().equals(\"ogeorge\")){\n\t\t\tline.setMessage(\"Ife built a couple of roads to try to catch up with Paul, but Daniel always wins anyway\");\n\t\t}\n\t\telse{\n\t\t\tline.setMessage(username + \" built a couple roads with a road building development card\");\n\t\t}\n//\t\tline.setMessage(username + \" built a couple roads with a road building development card\");\n\t\tline.setSource(username);\n\t\tserverModel.getLog().addLine(line);\n\t}", "@Override\n public void acceptTrade(boolean willAccept) throws ModelException {\n if (willAccept && !GameModelFacade.instance().canAcceptTrade()) {\n throw new ModelException(\"Preconditions for action not met.\");\n }\n\n IPlayer p = GameModelFacade.instance().getLocalPlayer();\n assert GameModelFacade.instance().getGame().getTradeOffer().getReceiver().equals(p);\n\n try {\n String clientModel = m_theProxy.acceptTrade(p.getIndex(), willAccept);\n new ModelInitializer().initializeClientModel(clientModel, m_theProxy.getPlayerId());\n } catch (NetworkException e) {\n throw new ModelException(e);\n }\n }", "public void handleEvent(PlayerPosition event)\r\n {\r\n if(m_active)\r\n {\r\n String name = m_botAction.getPlayerName(event.getPlayerID());\r\n\r\n if(event.isInSafe())\r\n {\r\n int ship = m_botAction.getPlayer(event.getPlayerID()).getShipType();\r\n int freq = m_botAction.getPlayer(event.getPlayerID()).getFrequency();\r\n boolean delayExceeded = true;\r\n\r\n if(delaySeconds > 0)\r\n {\r\n long currentTime = System.currentTimeMillis();\r\n\r\n if(m_entryTimes.containsKey(name))\r\n {\r\n long entryTime = m_entryTimes.get(name);\r\n int delta = (int)(currentTime - entryTime);\r\n\r\n if(!enableMS) {\r\n // Do the delay in seconds.\r\n delta /= Tools.TimeInMillis.SECOND;\r\n }\r\n\r\n if(delta < delaySeconds)\r\n {\r\n delayExceeded = false;\r\n }\r\n else\r\n {\r\n m_entryTimes.remove(name);\r\n }\r\n }\r\n else\r\n {\r\n m_entryTimes.put(name, currentTime);\r\n delayExceeded = false;\r\n }\r\n }\r\n\r\n if(delayExceeded)\r\n {\r\n if(specPlayer)\r\n {\r\n m_botAction.spec(event.getPlayerID());\r\n m_botAction.spec(event.getPlayerID());\r\n\r\n if(!speccedMsg.equalsIgnoreCase(\"none\")) {\r\n if(speccedSound != 0)\r\n m_botAction.sendArenaMessage(name + \" \" + speccedMsg, speccedSound);\r\n else\r\n m_botAction.sendArenaMessage(name + \" \" + speccedMsg);\r\n }\r\n }\r\n\r\n if(changeShip && ship != targetShip)\r\n {\r\n m_botAction.setShip(event.getPlayerID(), targetShip);\r\n\r\n if(!shipChgMsg.equalsIgnoreCase(\"none\")) {\r\n if(shipSound != 0)\r\n m_botAction.sendArenaMessage(name + \" \" + shipChgMsg, shipSound);\r\n else\r\n m_botAction.sendArenaMessage(name + \" \" + shipChgMsg);\r\n }\r\n\r\n }\r\n\r\n if(changeFreq && freq != targetFreq)\r\n {\r\n m_botAction.setFreq(event.getPlayerID(), targetFreq);\r\n\r\n if(!freqChgMsg.equalsIgnoreCase(\"none\")) {\r\n if(freqSound != 0)\r\n m_botAction.sendArenaMessage(name + \" \" + freqChgMsg, freqSound);\r\n else\r\n m_botAction.sendArenaMessage(name + \" \" + freqChgMsg);\r\n }\r\n }\r\n }\r\n }\r\n else if(delaySeconds > 0)\r\n {\r\n m_entryTimes.remove(name);\r\n }\r\n }\r\n }", "private void sendMessagetoRespectivePlayer(int num) {\n Message msg1;\n if(flag == \"player1\"){\n prevP1 = num;\n int newPositionGroup = num / 10;\n if(winningHoleGroup == newPositionGroup){\n msg1 = p1Handler.obtainMessage(3);\n }\n else if((winningHoleGroup == newPositionGroup-1) || (winningHoleGroup == newPositionGroup+1)){\n msg1 = p1Handler.obtainMessage(4);\n }\n else{\n msg1 = p1Handler.obtainMessage(5);\n }\n p1Handler.sendMessage(msg1);\n }\n else{\n prevP2 = num;\n int newPositionGroup = num / 10;\n if(winningHoleGroup == newPositionGroup){\n msg1 = p2Handler.obtainMessage(3);\n }\n else if((winningHoleGroup == newPositionGroup-1) || (winningHoleGroup == newPositionGroup+1)){\n msg1 = p2Handler.obtainMessage(4);\n }\n else{\n msg1 = p2Handler.obtainMessage(5);\n }\n p2Handler.sendMessage(msg1);\n }\n }", "public abstract void sendTraceTime(Player p);", "@Override\n public void landedOn(Player player) {}", "public void dealerTurn() {\n\t\tview.writeLog(\"All players pass, dealer's turn.\");\n\t\tdealer.send(new Package(\"MESSAGE\",\"Now is your turn.\"));\n\t\tdealer.send(new Package(\"ASK\",null));\n\t}", "void sendPacketToPlayer(Player player, Object packet);", "public void surrender() {\n playerCash += playerBet / 2;\n\n //Play dealer's turn\n dealerTurn();\n\n //End the game and change the views\n restartGame();\n }", "public void isPurchased(Player player) {\n\t}", "@Override\r\n public void dealCardToPlayer(int dealerDeckPosition, int player, \r\n int plDeckPosition) {\r\n // Get the card from the dealer\r\n Card card = this.dealer.getCard(dealerDeckPosition);\r\n \r\n // Give the card to the player\r\n this.players.get(player).addCard(plDeckPosition, card);\r\n }", "private void sendBucks() {\n\t\tconsole.printUsers(userService.getAll(currentUser.getToken()));\n\t\tSystem.out.println(\"\");\n\n\t\tBoolean validResponse = false;\n\t\tint selectedUserId = -1;\n\t\tBigDecimal transferAmount = new BigDecimal(0);\n\t\tBigDecimal zero = new BigDecimal(0);\n\t\tBigDecimal currentBalance = (accountService.getAccountBalance(currentUser.getToken()));\n\t\tTransfer transfer = new Transfer();\n\n\t\twhile (true) {\n\t\t\t// ask which user you want to send money to or exit\n\t\t\tselectedUserId = console.getUserInputInteger(\"Enter ID of user you are sending to (0 to cancel)\");\n\t\t\tif (selectedUserId == 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (selectedUserId > 0 && selectedUserId <= userService.getAll(currentUser.getToken()).length) {\n\t\t\t\t// prompt for amount to send\n\t\t\t\ttransferAmount = console.getUserInputBigDecimal(\"Enter amount\");\n\t\t\t\t// transfer money\n\n\t\t\t\tif (transferAmount.compareTo(zero) == 1 && transferAmount.compareTo(currentBalance) <= 0) {\n\n\t\t\t\t\ttransfer.setFromUserId(currentUser.getUser().getId());\n\t\t\t\t\ttransfer.setToUserId(selectedUserId);\n\t\t\t\t\ttransfer.setTransferAmount(transferAmount);\n\t\t\t\t\ttransfer.setStatusOfTransferId(2);\n\t\t\t\t\ttransfer.setTypeOfTransferId(2);\n\n\t\t\t\t\t\n\t\t\t\t\ttransferService.createTransfer(currentUser.getToken(), transfer);\n\t\t\t\t\tSystem.out.println(\"\\nTransfer Complete!\");\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tSystem.out.println(\"\\nInsufficient Funds! Please try again.\\n\");\n\n\t\t\t}\n\t\t}\n\n\t}", "@Override\n\tpublic void playerJoined(String playerID) {\n\t}", "@RequestMapping(value = \"tradeOffer\",method = RequestMethod.GET)\n public @ResponseBody BotResult tradeOffer(String steamId) throws IOException, ServiceException {\n int r = processOrderService.answer(steamId);\n switch (r){\n case 0:\n return new BotResult(true,\"发送报价成功\",null);\n case 1:\n return new BotResult(false,\"未找到您的订单\",null);\n default:\n return new BotResult(false,\"服务器未知错误,请联系客服\",null);\n }\n }", "public void trade(Player player, Type type, int[] trade) {\n \t\taddResources(type, 1);\n \t\tplayer.useResources(type, 1);\n \n \t\tfor (int i = 0; i < Hexagon.TYPES.length; i++) {\n \t\t\tif (trade[i] <= 0)\n \t\t\t\tcontinue;\n \n \t\t\tuseResources(Hexagon.TYPES[i], trade[i]);\n \t\t\tplayer.addResources(Hexagon.TYPES[i], trade[i]);\n \n \t\t\tfor (int j = 0; j < trade[i]; j++) {\n \t\t\t\tappendAction(R.string.player_traded_away, Hexagon\n \t\t\t\t\t\t.getTypeStringResource(Hexagon.TYPES[i]));\n \t\t\t}\n \t\t}\n \n \t\tappendAction(R.string.player_traded_with, player.getName());\n \t\tappendAction(R.string.player_got_resource, Hexagon\n \t\t\t\t.getTypeStringResource(type));\n \t}", "@Override\r\n\t\t\tpublic void hear(Player p, String s) {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void hear(Player p, String s) {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void hear(Player p, String s) {\n\t\t\t\t\r\n\t\t\t}", "public abstract void onContribution(int amount, Player player);", "@Override\n\tpublic void handle(WrapperWorld world, WrapperPlayer player){\n\t\tWrapperEntity builderWrapper = world.getEntity(builderID);\n\t\tif(builderWrapper != null){\n\t\t\t//Queue up the builder to send the player data back next update.\n\t\t\t((ABuilderEntityBase) builderWrapper.entity).playersRequestingData.add(player);\n\t\t}\n\t}", "@Override\n public void opponentSurrender(int id) {\n try {\n if (getClientInterface() != null)\n getClientInterface().notifyOpponentSurrender(id);\n }\n catch (RemoteException e) {\n System.out.println(\"remote sending opponent surrender error\");\n }\n }", "private void handlePlayerConnect(Player player) {\n server.runTaskLater(() -> server.getPaymentLog().checkPendingAccepts(player), 1500, TimeUnit.MILLISECONDS);\n\n if (player.hasPermission(Rank.ADMIN)) {\n server.runTaskLater(() -> server.getDataSource().getCollection(\"archon\", \"dailytop\").count((result, t) -> {\n if (result == null) {\n result = 0L;\n }\n\n List<String> msg = new ArrayList<>();\n msg.add(\"&8\" + Message.BAR);\n msg.add(\"&6[&c&lArchon&6] &aProxy \" + player.getProxy().getId() + \" &7[\" + player.getRegion().name() + \" Network]\");\n msg.add(\"\");\n msg.add(\"&e[Today]\");\n int mostOnlineToday = server.getCache().getCurrentMostOnline();\n int uniqueLoginsToday = (int) (long) result;\n int newPlayersToday = server.getCache().getCurrentNewPlayers();\n\n try (Connection conn = server.getDataSource().getConnection();\n Statement stmt = conn.createStatement()) {\n // 1-day stats\n try (ResultSet rs = stmt.executeQuery(\"SELECT most_online, unique_logins, new_players FROM dailytop WHERE date = (SELECT MAX(date) FROM dailytop)\")) {\n if (rs.next()) {\n int mostOnlineYesterday = rs.getInt(\"most_online\");\n int uniqueLoginsYesterday = rs.getInt(\"unique_logins\");\n int newPlayersYesterday = rs.getInt(\"new_players\");\n\n double mostOnlineChange = Util.getPercentageChange(mostOnlineYesterday, mostOnlineToday);\n String disp = (mostOnlineChange < 0 ? \"&7(&c\" : \"&7(&a+\") + format.format(mostOnlineChange) + \"% &7from yesterday)\";\n msg.add(\"&7* &6Most Online: &d\" + Util.addCommas(mostOnlineToday) + \" \" + disp);\n\n double uniqueLoginsChange = Util.getPercentageChange(uniqueLoginsYesterday, uniqueLoginsToday);\n disp = (uniqueLoginsChange < 0 ? \"&7(&c\" : \"&7(&a+\") + format.format(uniqueLoginsChange) + \"% &7from yesterday)\";\n msg.add(\"&7* &6Unique Logins: &d\" + Util.addCommas(uniqueLoginsToday) + \" \" + disp);\n\n double newPlayersChange = Util.getPercentageChange(newPlayersYesterday, newPlayersToday);\n disp = (newPlayersChange < 0 ? \"&7(&c\" : \"&7(&a+\") + format.format(newPlayersChange) + \"% &7from yesterday)\";\n msg.add(\"&7* &6New Players: &d\" + Util.addCommas(newPlayersToday) + \" \" + disp);\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n ZonedDateTime time = ZonedDateTime.now(ZoneId.of(\"America/Los_Angeles\"));\n msg.add(\"&e[From yesterday at this hour: \" + time.format(DateTimeFormatter.ofPattern(\"h a\")) + \" \" + time.getZone().getDisplayName(TextStyle.FULL, Locale.ENGLISH) + \"]\");\n // prev day (same hour) stats\n try (ResultSet rs = stmt.executeQuery(\"SELECT online, most_online, unique_logins, new_players FROM daily_stats WHERE DATE(time) = DATE(SUBDATE(UTC_TIMESTAMP, 1)) && HOUR(time) = HOUR(UTC_TIMESTAMP) LIMIT 1;\")) {\n if (rs.next()) {\n int onlineYesterday = rs.getInt(\"online\");\n int mostOnlineYesterday = rs.getInt(\"most_online\");\n int uniqueLoginsYesterday = rs.getInt(\"unique_logins\");\n int newPlayersYesterday = rs.getInt(\"new_players\");\n\n double currentOnlineChange = Util.getPercentageChange(onlineYesterday, server.getOnlineCount());\n String disp = (currentOnlineChange < 0 ? \"&7(&c\" : \"&7(&a+\") + format.format(currentOnlineChange) + \"% &7from yesterday at this hour)\";\n msg.add(\"&7* &3Online: &b\" + Util.addCommas(onlineYesterday) + \" \" + disp);\n\n double mostOnlineChange = Util.getPercentageChange(mostOnlineYesterday, mostOnlineToday);\n disp = (mostOnlineChange < 0 ? \"&7(&c\" : \"&7(&a+\") + format.format(mostOnlineChange) + \"% &7from yesterday at this hour)\";\n msg.add(\"&7* &3Most Online: &b\" + Util.addCommas(mostOnlineYesterday) + \" \" + disp);\n\n double uniqueLoginsChange = Util.getPercentageChange(uniqueLoginsYesterday, uniqueLoginsToday);\n disp = (uniqueLoginsChange < 0 ? \"&7(&c\" : \"&7(&a+\") + format.format(uniqueLoginsChange) + \"% &7from yesterday at this hour)\";\n msg.add(\"&7* &3Unique Logins: &b\" + Util.addCommas(uniqueLoginsYesterday) + \" \" + disp);\n\n double newPlayersChange = Util.getPercentageChange(newPlayersYesterday, newPlayersToday);\n disp = (newPlayersChange < 0 ? \"&7(&c\" : \"&7(&a+\") + format.format(newPlayersChange) + \"% &7from yesterday at this hour)\";\n msg.add(\"&7* &3New Players: &b\" + Util.addCommas(newPlayersYesterday) + \" \" + disp);\n } else {\n msg.add(\"&7&oNo data to display from this time.\");\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n msg.add(\"&8\" + Message.BAR);\n\n try (ResultSet rs = stmt.executeQuery(\"SELECT (SELECT COUNT(*) FROM votes) AS total, COUNT(*) AS today FROM votes WHERE DATE(time) = CURDATE();\")) {\n if (rs.next()) {\n msg.add(\"&aVotes Today: &7\" + Util.addCommas(rs.getInt(\"today\"))\n + \"&a, Total Votes: &7\" + Util.addCommas(rs.getInt(\"total\")) + \" (\" + Util.humanReadableNumber(rs.getInt(\"total\")) + \")\");\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n player.message(msg);\n }), 1, TimeUnit.SECONDS);\n }\n }", "final void letMerchantGo(final Player player) {\n for (Map.Entry<Integer, Integer> it : player.getBag().entrySet()) {\n int cardId = (Integer) ((Map.Entry) it).getKey();\n int freq = (Integer) ((Map.Entry) it).getValue();\n\n if (player.getShop().containsKey(cardId)) {\n player.getShop().put(cardId, player.getShop().get(cardId) + freq);\n } else {\n player.getShop().put(cardId, freq);\n }\n }\n }", "void confirmRealWorldTrade(IUserAccount user, ITransaction trans);", "public void sendToWard(){\r\n\t\t//here is some code that we do not have access to\r\n\t}", "public TransactionResponse sellToInventory() {\r\n \t\tTransactionResponse response = new TransactionResponse(hp);\r\n \t\ttry {\r\n \t\t\tDataHandler sf = hc.getDataFunctions();\r\n \t\t\tCalculation calc = hc.getCalculation();\r\n \t\t\tAccount acc = hc.getAccount();\r\n \t\t\tLog log = hc.getLog();\r\n \t\t\tLanguageFile L = hc.getLanguageFile();\r\n \t\t\tString playerecon = tradePartner.getEconomy();\r\n \t\t\tdouble price = 0.0;\r\n \t\t\tif (setPrice) {\r\n \t\t\t\tprice = money;\r\n \t\t\t} else {\r\n \t\t\t\tprice = hyperObject.getValue(amount, hp);\r\n \t\t\t}\r\n \t\t\tBoolean toomuch = false;\r\n \t\t\tif (price == 3235624645000.7) {\r\n \t\t\t\ttoomuch = true;\r\n \t\t\t}\r\n \t\t\tif (!toomuch) {\r\n \t\t\t\tim.removeItems(hyperObject.getId(), hyperObject.getData(), amount, hp.getPlayer().getInventory());\r\n \t\t\t\tim.addItems(amount, hyperObject.getId(), hyperObject.getData(), receiveInventory);\r\n \t\t\t\tacc.deposit(price, hp.getPlayer());\r\n \t\t\t\tacc.withdrawAccount(price, tradePartner.getName());\r\n \t\t\t\tresponse.addSuccess(L.f(L.get(\"SELL_CHEST_MESSAGE\"), amount, calc.twoDecimals(price), hyperObject.getName(), tradePartner.getName()), calc.twoDecimals(price), hyperObject);\r\n \t\t\t\tresponse.setSuccessful();\r\n \t\t\t\tlog.writeSQLLog(hp.getName(), \"sale\", hyperObject.getName(), (double) amount, calc.twoDecimals(price), 0.0, tradePartner.getName(), \"chestshop\");\r\n \t\t\t\ttradePartner.sendMessage(L.f(L.get(\"CHEST_SELL_NOTIFICATION\"), amount, calc.twoDecimals(price), hyperObject.getName(), hp.getPlayer()));\r\n \t\t\t} else {\r\n \t\t\t\tresponse.addFailed(L.f(L.get(\"CURRENTLY_CANT_SELL_MORE_THAN\"), sf.getHyperObject(hyperObject.getName(), playerecon).getStock(), 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 = \"Transaction sellChest() passed values name='\" + hyperObject.getName() + \"', player='\" + hp.getName() + \"', owner='\" + tradePartner.getName() + \"', amount='\" + amount + \"'\";\r\n \t\t\tnew HyperError(e, info);\r\n \t\t\treturn new TransactionResponse(hp);\r\n \t\t}\r\n \t}", "@EventHandler\r\n\tpublic void onJoin(final PlayerJoinEvent e){\n\t\tBukkit.getScheduler().runTaskLater(QuickShop.instance, new Runnable(){\r\n\t\t\t@Override\r\n\t\t\tpublic void run(){\r\n\t\t\t\tMsgUtil.flush(e.getPlayer());\r\n\t\t\t}\r\n\t\t}, 60);\r\n\t}", "public void updateMoney()\n\t\t{\n\t\t\t\n\t\t\tFPlayer p1 = this.viewer;\n\t\t\tFPlayer p2 = (p1.equals(this.t.p1)) ? this.t.p2 : this.t.p1;\n\t\t\t\n\t\t\tItemStack om = new ItemStack(Material.GREEN_WOOL,1);\n\t\t\tItemMeta it = om.getItemMeta();\n\t\t\tit.setDisplayName(ChatColor.DARK_GREEN+ChatColor.BOLD.toString()+\"Money in trade:\");\n\t\t\tit.setLore(Arrays.asList(new String[] {\"\",Util.getMoney(this.t.getMoneyTraded(p1)),\"\",\"Click to add/remove money from trade\"}));\n\t\t\tom.setItemMeta(it);\n\t\t\t\n\t\t\tif (this.canAdd()) super.contents.put(0,new ItemSwapMenu(this,om,new MenuMoney(super.viewer,this.t)));\n\t\t\telse super.contents.put(0,new ItemDummy(this,om));\n\t\t\t\n\t\t\t// Trader money in trade\n\t\t\tItemStack tm = new ItemStack(Material.GREEN_WOOL,1);\n\t\t\tit = tm.getItemMeta();\n\t\t\tit.setDisplayName(ChatColor.DARK_GREEN+ChatColor.BOLD.toString()+\"Money in trade:\");\n\t\t\tit.setLore(Arrays.asList(new String[] {\"\",Util.getMoney(this.t.getMoneyTraded(p2))}));\n\t\t\ttm.setItemMeta(it);\n\t\t\tsuper.contents.put(8,new ItemDummy(this,tm));\n\t\t\tthis.composeInv();\n\t\t}", "@EventHandler(priority = EventPriority.LOWEST)\n\tpublic void onPlayerTeleport(PlayerTeleportEvent event)\n\t{\n\t Player player = event.getPlayer();\n\t\tPlayerData playerData = this.dataStore.getPlayerData(player.getUniqueId());\n\t\t\n\t\t//FEATURE: prevent players from using ender pearls to gain access to secured claims\n\t\tTeleportCause cause = event.getCause();\n\t\tif(cause == TeleportCause.CHORUS_FRUIT || (cause == TeleportCause.ENDER_PEARL && instance.config_claims_enderPearlsRequireAccessTrust))\n\t\t{\n\t\t\tClaim toClaim = this.dataStore.getClaimAt(event.getTo(), false, playerData.lastClaim);\n\t\t\tif(toClaim != null)\n\t\t\t{\n\t\t\t\tplayerData.lastClaim = toClaim;\n\t\t\t\tString noAccessReason = toClaim.allowAccess(player);\n\t\t\t\tif(noAccessReason != null)\n\t\t\t\t{\n\t\t\t\t\tinstance.sendMessage(player, TextMode.Err, noAccessReason);\n\t\t\t\t\tevent.setCancelled(true);\n\t\t\t\t\tif(cause == TeleportCause.ENDER_PEARL)\n\t\t\t\t\t player.getInventory().addItem(new ItemStack(Material.ENDER_PEARL));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void askToAll() {\n\t\tfor(ClientThread player: players) {\n\t\t\tif(player != dealer)\n\t\t\t\tplayer.send(new Package(\"ASK\",null));\n\t\t\telse {\n\t\t\t\tdealer.send(new Package(\"MESSAGE\",\"As dealer, you'll wait for other players...\"));\n\t\t\t}\n\t\t}\n\t}", "public void buyStock(double askPrice, int shares, int tradeTime) {\n }", "private void botVoting(){\n int stockPos;\n int myStockPos = getMostShares(playerList.lastIndexOf(player));\n Collections.sort(playerList);\n if(playerList.get(0) == player){ //if i am the leader\n stockPos = getMostShares(1); //get the second players info\n }else{\n stockPos = getMostShares(0); //else get the first players info\n }\n\n //if my most shares are the same as other players most shares, don't vote.\n if(game.getStockByIndex(stockPos) != game.getStockByIndex(myStockPos)){\n //offensive play against leader\n if(game.isCardPositive(game.getStockByIndex(stockPos))){\n game.getStockByIndex(stockPos).vote(0);\n player.getVotedStocks().append(game.getStockByIndex(stockPos).getName().charAt(0));\n player.deductVotesLeft();\n System.out.println(\"bot voted NO for \" + game.getStockByIndex(stockPos).getName() );\n }else{\n game.getStockByIndex(stockPos).vote(1);\n player.getVotedStocks().append(game.getStockByIndex(stockPos).getName().charAt(0));\n player.deductVotesLeft();\n System.out.println(\"bot voted YES for \" + game.getStockByIndex(stockPos).getName());\n }\n //defensive play, votes that will benefit me\n if(game.isCardPositive(game.getStockByIndex(myStockPos))){\n game.getStockByIndex(myStockPos).vote(1);\n player.getVotedStocks().append(game.getStockByIndex(myStockPos).getName().charAt(0));\n player.deductVotesLeft();\n System.out.println(\"bot voted YES for \" + game.getStockByIndex(myStockPos).getName());\n }else{\n game.getStockByIndex(myStockPos).vote(0);\n player.getVotedStocks().append(game.getStockByIndex(myStockPos).getName().charAt(0));\n player.deductVotesLeft();\n System.out.println(\"bot voted NO for \" + game.getStockByIndex(myStockPos).getName());\n }\n }\n }", "@Override\n public void run() {\n OrderBook.getInstance().addOfferMarketQuote(order);\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tnew sell().execute(CartActivity.sendObject.toString());\n\t\t\t}", "@Override\r\n public void giveCardToPlayer(Card card, int player, int plDeckPosition) {\r\n this.players.get(player).addCard(plDeckPosition, card);\r\n }", "public Player getPlayerToOfferTo() {\n return playerToOfferTo;\n }", "protected boolean processPlayerDeclined(int gameNum, String playerName, String offer){\n return false;\n }", "@Override\n public void receiveMessage(AgentID sender, Action action)\n {\n super.receiveMessage(sender, action);\n\n // update the value of Care_Value、Reluctance、Agreement_Value every ten rounds\n if (getTimeLine() instanceof DiscreteTimeline) {\n DiscreteTimeline discreteTimeline = (DiscreteTimeline)getTimeLine();\n int cRound = discreteTimeline.getRound();\n if (cRound % 10 == 0) {\n\n // care_value increase 4% every ten rounds\n Care_Value = Care_Value * (1 + 0.04);\n if (Care_Value > 0.72) {\n Care_Value = 0.72;\n }\n\n // reluctance decrease 4% every ten rounds\n Reluctance = Reluctance * (1 - 0.06);\n if (timeline.getTime() < 7 && Reluctance < 0.9) {\n Reluctance = 0.9;\n }\n\n List<BidDetails> allBids = new ArrayList<>(feasibleBids);\n // find a common set for all opponent\n Set<BidDetails> commonBids = opponentModelInterface.queryCommonBestBidsSet(allBids, Number_of_Bids);\n List<BidDetails> commonBidsList = new ArrayList<>(commonBids);\n // sort the common set\n Collections.sort(commonBidsList);\n // AV = Utility(BidBest) * Reluctance\n Agreement_Value = (commonBidsList.get(commonBidsList.size() - 1).getMyUndiscountedUtil()) * Reluctance;\n if (Agreement_Value > 0.85) {\n Agreement_Value = 0.85;\n }\n\n if (Agreement_Value < Minimum_Offer_Threshold * (3 - Math.pow(2, timeline.getTime()))) {\n Agreement_Value = Minimum_Offer_Threshold * (3 - Math.pow(2, timeline.getTime()));\n }\n }\n }\n\n if (action instanceof Inform) {\n // receive message first time, update the number of opponent\n opponentModelInterface = new OpponentModelManager(getNumberOfParties());\n }else if (action instanceof Offer) {\n // save the last offer\n lastOffer = ((Offer) action).getBid();\n // update opponent model by new bid from opponent\n opponentModelInterface.handleBidFromSender(sender.toString(), lastOffer, getDomain());\n }\n }", "public final void give(final Player player) {\n\t\tplayer.getInventory().addItem(this.getItem());\n\t}", "@Override\n public void playWithTwoPlayers(Player player1, Player player2) {\n int[] combinationPlayer;\n int counter = config.getMaxTries();\n config.getMsgInfo().choiceGameBonus();\n config.getMsgInfo().counter(counter);\n\n // initialize a random number that both players will try to find\n IAPlayer ia = new IAPlayer(config);\n int[] defenseCombination = ia.initialiseCombination();\n if (config.isDevMode())\n config.getMsgCombination().devMode(defenseCombination);\n config.getMsgInfo().computer();\n\n // Proposition player1\n config.getMsgInfo().player1();\n combinationPlayer = player1.research(null);\n config.getMsgCombination().newAnswer(combinationPlayer);\n String[] clues = ia.clues(combinationPlayer);\n if (IsWin.winIf(clues)) {\n config.getMsgInfo().isWin();\n return;\n }\n config.getMsgCombination().cluesAre(clues);\n\n // Proposition player2\n config.getMsgInfo().player2();\n combinationPlayer = player2.research(null);\n config.getMsgCombination().newAnswer(combinationPlayer);\n String[] clews = ia.clues(combinationPlayer);\n if (IsWin.winIf(clews)) {\n config.getMsgInfo().isWin();\n return;\n }\n config.getMsgCombination().cluesAre(clews);\n\n counter--;\n config.getMsgInfo().counterLess(counter);\n\n do {\n // Proposition player1\n config.getMsgInfo().player1();\n combinationPlayer = player1.research(clues);\n config.getMsgCombination().newAnswer(combinationPlayer);\n clues = ia.clues(combinationPlayer);\n if (IsWin.winIf(clues)) {\n config.getMsgInfo().isWin();\n return;\n } else if (counter > 1) {\n config.getMsgCombination().cluesAre(clues);\n } else if (counter == 1) {\n if (!Arrays.equals(combinationPlayer, defenseCombination))\n config.getMsgInfo().notGood();\n }\n\n // Proposition player2\n config.getMsgInfo().player2();\n combinationPlayer = player2.research(clews);\n config.getMsgCombination().newAnswer(combinationPlayer);\n clews = ia.clues(combinationPlayer);\n if (IsWin.winIf(clews)) {\n config.getMsgInfo().isWin();\n return;\n } else if (counter > 1) {\n config.getMsgCombination().cluesAre(clews);\n } else if (counter == 1) {\n if (!Arrays.equals(combinationPlayer, defenseCombination))\n config.getMsgInfo().notGood();\n }\n\n counter--;\n if (counter >= 1)\n config.getMsgInfo().counterLess(counter);\n else {\n config.getMsgInfo().endGameDuel();\n config.getMsgCombination().finallyRevealSecretCombination(defenseCombination);\n break;\n }\n } while (true);\n }", "public void requestAddUserToChat(String otherUsername){\n System.out.println(\"addtochat\" + \" \" + chatID + \" \" + otherUsername);\n toServer.println(\"addtochat\" + \" \" + chatID + \" \" + otherUsername);\n toServer.flush();\n }", "@Override\n\tpublic void landedOn() {\n\t\tMonopolyGameController.getInstance();\n\t\tMonopolyGameController.getCurrentPlayer().increaseMoney(300);\n\t\tLogger.getInstance().notifyAll(MonopolyGameController.getCurrentPlayer().getName()+ \" gained 300 dollars by landing on Bonus Square\");\n\t\tMonopolyGameController.allowCurrentPlayerToEndTurn();\n\n\t}", "@Override\r\n public void handleMessage (Message inputMessage) {\n OnUpdatePlayerSubscription.OnUpdatePlayer updatePlayer = response.data().onUpdatePlayer();\r\n\r\n Log.i(TAG, \"updated user is \" + updatePlayer.toString() + \" session id is \" + sessionId);\r\n //checking if the updated player is in this session\r\n if(updatePlayer.session().id().equals(sessionId)){\r\n boolean contains = false;\r\n\r\n //checking if the updated player is in the current player list\r\n for(Player player : players){\r\n\r\n // if we have a match update players lat/long\r\n if(updatePlayer.id().equals(player.getId())){\r\n List<LatLng> bananasList = new LinkedList<>();\r\n bananasList.add(new LatLng(response.data().onUpdatePlayer().lat(),\r\n response.data().onUpdatePlayer().lon()));\r\n player.setLocations(bananasList); // sets location for the player\r\n player.setIt(updatePlayer.isIt());\r\n contains = true;\r\n }\r\n }\r\n\r\n //if the player is in the session, but not in the player list, then make a new player and add them to the players list and add a marker\r\n if(contains == false){\r\n Marker marker = mMap.addMarker(new MarkerOptions()\r\n .position(new LatLng(updatePlayer.lat(), updatePlayer.lon()))\r\n .title(updatePlayer.username()));\r\n Circle circle = mMap.addCircle(new CircleOptions()\r\n .center(new LatLng(updatePlayer.lat(), updatePlayer.lon()))\r\n .radius(tagDistance)\r\n .fillColor(Color.TRANSPARENT)\r\n .strokeWidth(3));\r\n\r\n marker.setIcon(playerpin);\r\n circle.setStrokeColor(notItColor);\r\n\r\n Player newPlayer = new Player();\r\n newPlayer.setId(updatePlayer.id());\r\n newPlayer.setIt(false);\r\n newPlayer.setMarker(marker);\r\n newPlayer.setCircle(circle);\r\n newPlayer.setUsername(updatePlayer.username());\r\n List<LatLng> potatoes = new LinkedList<>();\r\n potatoes.add(new LatLng(updatePlayer.lat(), updatePlayer.lon()));\r\n newPlayer.setLocations(potatoes);\r\n\r\n //adding player to the list of players in the game\r\n players.add(newPlayer);\r\n }\r\n }\r\n// for(Player player : players) {\r\n// if(response.data().onUpdatePlayer().id().equals(player.getId())) {\r\n// // if true (we have a match) update players lat/long\r\n// List<LatLng> bananasList = new LinkedList<>();\r\n// bananasList.add(new LatLng(response.data().onUpdatePlayer().lat(),\r\n// response.data().onUpdatePlayer().lon()));\r\n// player.setLocations(bananasList); // sets location for the player\r\n// //Might have been causing the starting point to move\r\n//// player.getCircle().setCenter(player.getLastLocation());\r\n//// player.getMarker().setPosition(player.getLastLocation());\r\n// }\r\n// }\r\n }", "public abstract void handleClientSide(T message, EntityPlayer player);", "@Override\n\tpublic void satisfyTrade(TickEvent<Trade> tradeEvent) throws TradeException {\n\n\t}", "public static void proposeTrade(League theLeague, Team theTeam, Scanner keyboard) {\r\n\t\tSystem.out.println(\"\");\r\n\t\tSystem.out.println(\"---Propose Trade---\");\r\n\t\tfor (int x = 0; x < theLeague.getNumTeams(); x++) {\r\n\t\t\tif (!theLeague.getTeam(x).equals(theTeam)) {\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t\tSystem.out.println(\"Team number: \" + (x + 1));\r\n\t\t\t\ttheLeague.getTeam(x).teamManNameToString();\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"\");\r\n\t\tSystem.out.println(\"Select a team to view:\");\r\n\t\t\r\n\t\tint otherTeamChoice;\r\n\t\tdo {\r\n\t\t\totherTeamChoice = Input.validInt(1, theLeague.getNumTeams(), keyboard) - 1;\r\n\t\t} while (otherTeamChoice == theLeague.getTeamList().indexOf(theTeam));\r\n\t\tTeam otherTeam = theLeague.getTeam(otherTeamChoice);\r\n\r\n\t\tSystem.out.println(\"\");\r\n\t\tSystem.out.println(\"---Propose Trade---\");\r\n\t\tSystem.out.println(\"\");\r\n\t\totherTeam.teamToString();\r\n\t\tSystem.out.println(\"\");\r\n\t\tSystem.out.println(\"Would you like to propose a trade to this team?\");\r\n\t\tSystem.out.println(\"1 - Yes\");\r\n\t\tSystem.out.println(\"2 - No, Return to Team Menu\");\r\n\t\t\r\n\t\tif (Input.validInt(1, 2, keyboard) == 1) {\r\n\t\t\tSystem.out.println(\"\");\r\n\t\t\tSystem.out.println(\"Enter your trade offer (max 64 characters):\");\r\n\t\t\tSystem.out.println(\"0 - Return to Team Menu\");\r\n\t\t\tString proposal = Input.validString(32, keyboard);\r\n\t\t\tif (proposal.equals(\"0\")) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\totherTeam.setProposedTrade(theTeam.getManagerName() + \": \" + proposal);\r\n\t\t\tSystem.out.println(\"\");\r\n\t\t\tSystem.out.println(\"***You have proposed a trade:***\");\r\n\t\t\tSystem.out.println(\"To \" + otherTeam.getManagerName() + \": \" + proposal);\r\n\t\t}\r\n\t}", "public void notifyCreation() {\n Player targetPlayer = this.getTarget().getPlayerReference(Player.class),\n senderPlayer = this.getToTeleport().getPlayerReference(Player.class);\n\n if (targetPlayer == null || senderPlayer == null) {\n return;\n }\n\n MainData.getIns().getMessageManager().getMessage(\"TPA_SENT\").sendTo(senderPlayer);\n\n if (this.type == TeleportType.TPA) {\n MainData.getIns().getMessageManager().getMessage(\"TPA_REQUESTED\")\n .format(\"%player%\", getToTeleport().getNameWithPrefix()).sendTo(targetPlayer);\n } else if (this.type == TeleportType.TPHERE) {\n MainData.getIns().getMessageManager().getMessage(\"TPHERE_REQUESTED\")\n .format(\"%player%\", getToTeleport().getNameWithPrefix()).sendTo(targetPlayer);\n }\n\n }", "private void secondSlot(Player player, MessageBuilder payload) {\n int interfaceId = payload.getShort(true, edgeville.net.ValueType.A, edgeville.net.ByteOrder.LITTLE);\n int itemId = payload.getShort(true, edgeville.net.ValueType.A, edgeville.net.ByteOrder.LITTLE);\n int slot = payload.getShort(true, edgeville.net.ByteOrder.LITTLE);\n if (interfaceId < 0 || slot < 0 || itemId < 0)\n return;\n switch (interfaceId) {\n\n case 5064:\n player.getBank().depositFromInventory(slot, 5);\n break;\n case 5382:\n player.getBank().withdraw(slot, 5, true);\n break;\n case 3900:\n Shop.SHOPS.get(player.getOpenShop()).purchase(player, new Item(itemId, 1));\n break;\n case 3823:\n Shop.SHOPS.get(player.getOpenShop()).sell(player, new Item(itemId, 1), slot);\n break;\n case 3322:\n player.getTradeSession().add(new Item(itemId, 5), slot);\n break;\n case 3415:\n player.getTradeSession().remove(new Item(itemId, 5));\n break;\n }\n }", "public void sendPurchaseHit() {\n\n // In production code, would need to iterate\n // over all the products in the cart\n // Here we assume that the currently selected dinner\n // is the only thing in the cart\n Product product = new Product()\n .setName(\"dinner\")\n .setPrice(5)\n .setVariant(thisDinner)\n .setId(thisDinnerId)\n .setQuantity(1);\n\n // Get a unique transaction ID\n String tID = Utility.getUniqueTransactionId(thisDinnerId);\n ProductAction productAction =\n new ProductAction(ProductAction.ACTION_PURCHASE)\n .setTransactionId(tID);\n\n Tracker tracker = ((MyApplication) getApplication()).getTracker();\n\n tracker.send(new HitBuilders.EventBuilder()\n .setCategory(\"Shopping steps\")\n .setAction(\"Purchase\")\n .setLabel(thisDinner)\n .addProduct(product)\n .setProductAction(productAction)\n .build());\n }", "@Override\n\tpublic void action(Player player) {\n\t\tfireMessageEvent(player.getPlayerId());\n\t\tplayer.setPosition(jail);\n\t\tplayer.setInJail(true);\n\t}", "public void executeJoiningPlayer(Player player) {\r\n nui.setupNetworkPlayer(player);\r\n }", "private void sendBucks() {\n\t\tint userid = userID;\n\n\t\tfor (int i = 0; i < userServices.getAllUsers().length; i++) {\n\t\t\tSystem.out.println(\n\t\t\t\t\t\"User: \" + userList.get(i).getId() + \"\\t\" + \"username: \" + userList.get(i).getUsername() + \"\\n\");\n\t\t}\n\n\t\tSystem.out.println(\"Select and ID you want to send TE Bucks to: \\n\");\n\n\t\tint sendTo = Integer.parseInt(scan.nextLine());\n\n\t\tSystem.out.println(\"How much money?\");\n\t\tBigDecimal money = (new BigDecimal(scan.nextLine()));\n\n\t\ttry {\n\t\t\tif (accountServices.getBalanceByAccountID(userid).compareTo(money) < 0) {\n\t\t\t\tSystem.out.println(\"You do not have enough funds to make transfer\");\n\t\t\t\tsendBucks();\n\n\t\t\t}\n\t\t} catch (AccountsServicesException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\n\t\tTransfers holder = sendTransfer(userid, sendTo, money);\n\t\taccountServices.sendMoney(userid, holder);\n\n\t\ttry {\n\t\t\tSystem.out.println(\"$\" + money + \" sent to \" + sendTo);\n\t\t\tSystem.out.println(\"New balance: $\" + accountServices.getBalanceByAccountID(userid));\n\t\t} catch (AccountsServicesException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public final void setSender(final Player newSender) {\n this.sender = newSender;\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t\teHp -= player.Attack();\n\t\t\t\t\tpHp -= player.Attack();\n\t\t\t\t\tif (pHp <= 0){\n\t\t\t\t\t\t\n\t\t\t\t\t\t// losing message\n\t\t\t\t\t\tContext context = getApplicationContext();\n\t\t\t\t\t\tToast toast = Toast.makeText(context, \"Aww...You Lost\", Toast.LENGTH_SHORT);\n\t\t\t\t\t\ttoast.show();\n\t\t\t\t\t\tIntent resultIntent = new Intent();\n\t\t\t\t\t\tresultIntent.putExtra(\"data1\", player);\n\t\t\t\t\t\tsetResult(RESULT_OK, resultIntent);\n\t\t\t\t\t\tfinish();\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse if (pHp > 0 && eHp < 0){\n\t\t\t\t\t\t\n\t\t\t\t\t\t// winning message\n\t\t\t\t\t\tplayer.setCandies(player.getCandies() + 500000000);\n\t\t\t\t\t\tToast toast = Toast.makeText(context, \"You have now surpassed yourself, young grasshopper take 500000000 candies!\", Toast.LENGTH_SHORT);\n\t\t\t\t\t\ttoast.show();\n\t\t\t\t\t\tIntent resultIntent = new Intent();\n\t\t\t\t\t\tresultIntent.putExtra(\"data1\", player);\n\t\t\t\t\t\tsetResult(RESULT_OK, resultIntent);\n\t\t\t\t\t\tfinish();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// update Hp\n\t\t\t\t\tplayHp.setText(\"Player Hp: \" + String.valueOf(pHp));\n\t\t\t\t\tenemyHp.setText(\"Enemy Hp: \" + String.valueOf(eHp));\n\t\t\t}", "@Override\r\n\tpublic void hear(Player spkr,String s) {\n\t\tplayerMappingService.sendString(this,s);\r\n\t}", "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}", "public void cancelTradeOffer()\n\t{\n\t\tm_trade.cancelOffer(this);\n\t}" ]
[ "0.7713557", "0.6549637", "0.65041673", "0.65005296", "0.6342156", "0.63386405", "0.6324665", "0.6261402", "0.6217509", "0.61885715", "0.61619663", "0.61352044", "0.61249435", "0.61028004", "0.60991496", "0.6096352", "0.6080009", "0.6074526", "0.6068551", "0.60147184", "0.5997226", "0.59816617", "0.5979238", "0.59731615", "0.593221", "0.59313136", "0.5930676", "0.58404386", "0.5828047", "0.58193195", "0.5811619", "0.5798189", "0.5789985", "0.578633", "0.5770184", "0.5764064", "0.5742998", "0.57422495", "0.57338196", "0.5730772", "0.5724155", "0.5717753", "0.5699037", "0.5694283", "0.56879556", "0.5685217", "0.5682986", "0.5680743", "0.5654759", "0.5652938", "0.5647524", "0.56423515", "0.5640682", "0.5637301", "0.56365633", "0.56207323", "0.5615213", "0.5612053", "0.5611374", "0.5606167", "0.5606167", "0.5606167", "0.55999553", "0.55926186", "0.5590937", "0.55876553", "0.5587126", "0.5584084", "0.5581818", "0.5579025", "0.5576729", "0.55755055", "0.55699646", "0.55657935", "0.55556947", "0.55488056", "0.55453575", "0.5537105", "0.5524007", "0.55232775", "0.5514733", "0.55016106", "0.5485064", "0.54831177", "0.5481358", "0.54795355", "0.5478629", "0.54726624", "0.5463109", "0.5453975", "0.54525375", "0.5445065", "0.5442341", "0.54420793", "0.5439681", "0.5439662", "0.5430649", "0.5427109", "0.5425207", "0.5419112", "0.54135823" ]
0.0
-1
This method is called each time the dice is rolled
boolean CanRollNumber();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void Roll() // Roll() method\n {\n // Roll the dice by setting each of the dice to be\n // \ta random number between 1 and 6.\n die1Rand = (int)(Math.random()*6) + 1;\n die2Rand = (int)(Math.random()*6) + 1;\n }", "private static void roll()\n {\n rand = (int)(((Math.random())*6)+1); // dice roll #1\n rand2 = (int)(((Math.random())*6)+1);// dice roll #2\n }", "void rollDice();", "public void Diceroll()\n\t{\n\t\tdice1 = rand.nextInt(6)+1;\n\t\tdice2 = rand.nextInt(6)+1;\n\t\ttotal = dice1+dice2;\n\t}", "public int roll() {\n int result = ThreadLocalRandom.current().nextInt(SIDES+1) + 1;// standard 1-7\n if(result == 7){ //LoadedDie 6 occurs twice as often\n return 6;\n } else{\n return result;\n }\n }", "public int rollDice() {\n\t\td1 = r.nextInt(6) + 1;\n\t\td2 = r.nextInt(6) + 1;\n\t\trepaint();\n\t\treturn d1 + d2;\n\t}", "private void rollDie() {\n if (mTimer != null) {\n mTimer.cancel();\n }\n mTimer = new CountDownTimer(1000, 100) {\n public void onTick(long millisUntilFinished) {\n die.roll();\n showDice();\n }\n public void onFinish() {\n afterRoll();\n }\n }.start();\n }", "public void roll()\r\n\t{\r\n\t\tRandom rand = new Random();\r\n\r\n\t\trollNumber = rand.nextInt(numOfSides) + 1;\r\n\t}", "@Override\r\n\tpublic int rollDice() {\n\t\treturn 0;\r\n\t}", "public void roll() {\n\t\tthis.faceValue = (int)(NUM_SIDES*Math.random()) + 1;\n\t}", "public void roll()\r\n\t{\r\n\t\tthis.value = rnd.nextInt(6) + 1;\r\n\t}", "public static int diceRoll() {\n Random roller = new Random();//Create a random number generator\r\n return roller.nextInt(6) + 1;//Generate a number between 0-5 and add 1 to it\r\n }", "private int rollDie() {\r\n final SecureRandom random = new SecureRandom();\r\n return random.nextInt(6 - 1) + 1;\r\n }", "public static void roll()\n {\n Random no = new Random();\n Integer dice = no.nextInt(7);\n System.out.println(dice);\n }", "public int rollDice() {\n\t\td1 = (int)rand.nextInt(6)+1;\n\t\td2 = (int)rand.nextInt(6)+1;\n\t\treturn d1+d2;\n\t}", "int RollDice ()\n {\n\tint roll = (int) (Math.random () * 6) + 1;\n\treturn roll;\n }", "private void otherRolls() {\n\t\t// program tells that player should select dices to re-roll.\n\t\tdisplay.printMessage(\"Select the dice you wish to re-roll and click \"\n\t\t\t\t+ '\\\"' + \"Roll Again\" + '\\\"');\n\t\t// program will wait until player clicks \"roll again\" button.\n\t\tdisplay.waitForPlayerToSelectDice();\n\t\t// we randomly get six integers, from one to six, and we do it N_DICE\n\t\t// times and every time we write our random integer in the array.\n\t\tfor (int i = 0; i < N_DICE; i++) {\n\t\t\tif (display.isDieSelected(i) == true) {\n\t\t\t\tint dice = rgen.nextInt(1, 6);\n\t\t\t\tdiceResults[i] = dice;\n\t\t\t}\n\t\t}\n\t\t// program will display dice, that depends on our randomly taken\n\t\t// integers.\n\t\tdisplay.displayDice(diceResults);\n\t}", "public void rollDice() {\n try {\n if (numOfDices != Integer.parseInt(numOfDicesText.getText().toString())) {\n init();\n }\n }\n catch (Exception e) {\n System.out.println(e);\n numOfDicesText.setText(\"1\");\n init();\n }\n int rolledNumber;\n for (int i = 0; i < numOfDices; i++) {\n rolledNumber = dices.get(i).roll();\n textViews.get(i).setText(\"Dice \" + (i+1) + \" rolled a \" + rolledNumber);\n imageViews.get(i).setImageBitmap(DiceImages.getImage(rolledNumber));\n }\n }", "public void roll(){\n Random rand = new Random();\n this.rollVal = rand.nextInt(this.faces) + 1;\n }", "@Override\n public void run() {\n n =r.nextInt(6)+1;\n rollDieFace(n);\n }", "public int rollDice();", "public void rollAllDices() {\n for(int i = 0; i < dicesList.size(); i++) {\n dicesList.get(i).roll();\n }\n }", "public void roll() {\n\t\tthis.currentValue = ThreadLocalRandom.current().nextInt(1, this.numSides + 1);\n\t}", "public int roll(int dices){\n int faces[] = new int[dices];\n int total = 0;\n Dice dice = new Dice();\n for(int i = 0; i < dices; i++){\n faces[i] = (dice.rand.nextInt(6) + 1);\n }\n for(int i = 0; i < faces.length-1; i++){\n if(faces[i] != faces[i+1]){\n this.isDouble = false;\n break;\n }\n else{\n this.isDouble = true;\n }\n }\n if(this.isDouble == true){\n this.twiceCounter++;\n }\n for(int i = 1; i < faces.length+1; i++){\n System.out.print(\"The \" + i + \". dice: \" + faces[i-1] + \" \");\n total += faces[i-1];\n }\n System.out.println(\" and the sum is \" + total);\n\n return total;\n }", "public void rollCup()\n {\n die1.rolldice();\n die2.rolldice();\n gui.setDice(die1.getFacevalue(), die2.getFacevalue());\n }", "public void rollDie(){\r\n\t\tthis.score = score + die.roll();\r\n\t}", "public String play() \r\n { \r\n \r\n theDiceTotal = dice.roll();\r\n \r\n while ( theDiceTotal != 12 )\r\n { \r\n theDiceTotal = dice.roll();\r\n System.out.println( dice.getDie1FaceValue() + \" \" + dice.getDie2FaceValue() );\r\n count++;\r\n }\r\n \r\n return ( count - 1 ) + \" dice rolled.\"; \r\n }", "public static int rollDice()\n\t{\n\t\tint roll = (int)(Math.random()*6)+1;\n\t\t\n\t\treturn roll;\n\n\t}", "public int roll() \r\n {\r\n \r\n die1FaceValue = die1.roll();\r\n die2FaceValue = die2.roll();\r\n \r\n diceTotal = die1FaceValue + die2FaceValue;\r\n \r\n return diceTotal;\r\n }", "public int rollDie() {\n\t\treturn (int) (Math.random()*6)+1;\n\t}", "public void roll(){\n currentValue = rand.nextInt(6)+1;\n }", "private int diceRoll(int sides) {\n return (int) ((Math.random() * sides) + 1);\n }", "public abstract int rollDice();", "public static int rollDice(){\n return (int)(Math.random()*6) + 1;\n // Math.random returns a double number >=0.0 and <1.0\n }", "public void throwDice() {\r\n\t\tfor( DiceGroup diceGroup:dice.values() ) {\r\n\t\t\tdiceGroup.throwDice(); //.setResult( (int) Math.random()*die.getSize() + 1);\r\n\t\t}\r\n\t}", "public void reRoll() {\n this.result = this.roll();\n this.isSix = this.result == 6;\n }", "private void firstRoll(int playerName) {\n\t\t// we randomly get six integers, from one to six, and we do it N_DICE\n\t\t// times and every time we write our random integer in the array.\n\t\tfor (int i = 0; i < N_DICE; i++) {\n\t\t\tint dice = rgen.nextInt(1, 6);\n\t\t\tdiceResults[i] = dice;\n\t\t}\n\t\t// program will tell witch players turn it is.\n\t\tdisplay.printMessage(playerNames[playerName - 1]\n\t\t\t\t+ \"'s turn! Click the \" + '\\\"' + \"Roll Dice\" + '\\\"'\n\t\t\t\t+ \" button to roll the dice.\");\n\t\t// program will wait until player clicks \"roll dice\" button.\n\t\tdisplay.waitForPlayerToClickRoll(playerName);\n\t\t// program will display dice, that depends on our randomly taken\n\t\t// integers.\n\t\tdisplay.displayDice(diceResults);\n\t}", "public int rollResult(){\r\n return rand.nextInt(6) + 1;\r\n }", "public int roll() {\n return random.nextInt(6) + 1;\n }", "private void nextTurnRoll() {\n Log.d(\"nextTurnRoll\", \"next player please roll\");\n m_currentTurn++;\n if(m_currentTurn >= m_numPlayers){\n m_currentTurn = 0;\n }\n convertTextToSpeech(players.get(m_currentTurn).getName() + \"please roll the dice\");\n }", "public int roll()\r\n\t{\r\n\t return die1.roll() + die2.roll();\r\n \t}", "public int takeTurn(Dice theDice){\n \n this.turnCounter++;\n \n return(theDice.rollDice());\n \n }", "@Test\n public void testDiceThrown() {\n testDie(game.diceThrown(), 1, 2);\n game.nextTurn();\n testDie(game.diceThrown(), 1, 2);\n game.nextTurn();\n testDie(game.diceThrown(), 3, 4);\n game.nextTurn();\n testDie(game.diceThrown(), 3, 4);\n game.nextTurn();\n testDie(game.diceThrown(), 5, 6);\n game.nextTurn();\n testDie(game.diceThrown(), 1, 2);\n game.nextTurn();\n\n }", "public void roll() { \n this.value = (int)(Math.random() * this.faces()) + 1; \n }", "public void roll() {\n int number = new Random().nextInt(MAXIMUM_FACE_NUMBER);\n FaceValue faceValue = FaceValue.values()[number];\n setFaceValue(faceValue);\n }", "public void roll ()\n {\n //sets faceValue to an int between 1 - numFaces (both inclusive)\n faceValue = (int)(Math.random() * numFaces + 1);\n }", "public int roll_the_dice() {\n Random r = new Random();\n int number = r.nextInt(6) + 1;\n\n return number;\n }", "@Override\n public void run() {\n //get random number\n int number = random.nextInt(6) + 1;\n int resource = getResources().getIdentifier(\"game_dice\"+number,\n \"drawable\",\n \"com.bawp.alienvspredator\");\n if (dices[2]%2 == 0){\n dices[0] = resource;\n game_IMAGE_p1_dice.setImageResource(dices[0]);\n }\n else{\n dices[1] = resource;\n game_IMAGE_p2_dice.setImageResource(dices[1]);\n }\n\n //create dice roll sound\n mediaPlayer =MediaPlayer.create(Activity_Game.this, R.raw.roll_dice);\n mediaPlayer.start();\n //if both dices have the same value or p2 haven't roll\n //it will make sure the animation will continue\n dices[2]++;\n if (dices[0] == dices[1] || dices[1] == 0) {\n if (dices[0] == dices[1]){\n dices[0] = 0;\n dices[1] = 0;\n }\n handlerDices.postDelayed(this, DELAY);\n }\n //it means the animation ended and one of the sides has a larger value in the dice\n //according to this whoever won the dice roll will start first\n else{\n turn = dices[0] > dices[1];\n diceRollFinish = true;\n handlerGame.postDelayed(runnableGame, DELAY);\n }\n }", "public void animateDice() {\n pos += vel*tickCounter + ACC*tickCounter*tickCounter/2;\n if(pos<(TILE_SIZE*15-DICE_SIZE)/2){\n if(this.pIndex%3==0)\n diceImg = diceAnimation[tickCounter%diceAnimation.length];\n else\n diceImg = diceAnimation[diceAnimation.length-1-(tickCounter%diceAnimation.length)];\n tickCounter++;\n vel += ACC;}\n else{\n diceImg = dice[result-1];\n pos=(TILE_SIZE*15-DICE_SIZE)/2;}\n setCoordinates(pos);\n //System.out.println(\"dice pos \"+pos);\n }", "public void throwDice() {\n\n Random r = new Random();\n\n if (color == DiceColor.NEUTRAL) {\n this.value = 0;\n } else {\n this.value = 1 + r.nextInt(6);\n }\n\n }", "public int rollDice(){\r\n\t\tString playerResponse;\r\n\t\tplayerResponse=JOptionPane.showInputDialog(name+\". \"+\"Type anything to roll\");\r\n\t\t//System.out.println(name+\"'s response: \"+playerResponse);\r\n\t\tdice1=(int)(Math.random() * ((6 - 1) + 1)) + 1;\r\n\t\tdice2=(int)(Math.random() * ((6 - 1) + 1)) + 1;\r\n\t\tdicetotal=dice1+dice2;\r\n\t\tnumTurns++;\r\n\t\treturn dicetotal;\r\n\t}", "public Dice() {\n\t\td1 = 0;\n\t\td2 = 0;\n\t}", "public static void main(String[] args) {\n CDice dice = new CDice();\n dice.init(1, 2, 3, 4, 5, 6);\n int random = dice.roll();\n System.out.println(\"dice roll side number: \"+random);\n }", "void roll(int noOfPins);", "private void rollDice(){\n int rollNumber=rng.nextInt(6)+1;\n //int rollNumber=5;\n switch(rollNumber) {\n case 1:\n dice_picture.setImageResource(R.drawable.one);\n break;\n case 2:\n dice_picture.setImageResource(R.drawable.two);\n break;\n case 3:\n dice_picture.setImageResource(R.drawable.three);\n break;\n case 4:\n dice_picture.setImageResource(R.drawable.four);\n break;\n case 5:\n dice_picture.setImageResource(R.drawable.five);\n break;\n case 6:\n dice_picture.setImageResource(R.drawable.six);\n break;\n default:\n }\n\n move(rollNumber);\n }", "public static int diceRoll() {\n\t\t\n\t\t//the outcome of the die is stored as an integer and returned\n\t\t\n\t\tint diceNumber = (int)((6 * (Math.random())) + 1);\n\t\treturn diceNumber;\n\t}", "public int roll() {\n if(!debug)\n this.result = random.nextInt(6) + 1;\n else{\n scanner = new Scanner(showInputDialog(\"Enter dice value (1-6):\"));\n try{int res = scanner.nextInt()%7;\n this.result = res!=0? res:6;\n }\n catch(NoSuchElementException ne){this.result=6;} \n }\n return this.result;\n }", "public int throwDice() {\n //create new random number between 1 and 6\n int nr = ThreadLocalRandom.current().nextInt(1, 6 + 1);\n //throw the number\n throwDice(nr);\n //return number\n return nr;\n }", "public static int diceRoll(){\n Random rd = new Random();\n int dice1, dice2;\n\n dice1 = rd.nextInt(6) + 1; //assigns random integer between 1 and 6 inclusive to dice 1\n dice2 = rd.nextInt(6) + 1; //assigns random integer between 1 and 6 inclusive to dice 2\n\n System.out.println(\"You rolled \" + dice1 + \" + \" + dice2 + \" = \" + (dice1+dice2)); //print result\n\n return dice1 + dice2; //returns sum of dice rolls\n\n }", "public static int rollDie() {\n int n = ThreadLocalRandom.current().nextInt(1, 7);\n return n;\n }", "public int roll(){\r\n myFaceValue = (int)(Math.random() * myNumSides) + 1;\r\n return myFaceValue;\r\n }", "public Dice() {\n this.random = new Random();\n this.faces = 6;\n }", "public void rollDices(Dice dice1, Dice dice2) {\n\n while (true) {\n // click to roll\n dice1.rollDice();\n dice2.rollDice();\n setSum(dice1, dice2);\n\n // if(roll == pN)\n // player and npcs that bet 1 win\n if (sum == pN) {\n player.playerWin();\n System.out.println(\"You rolled \" + sum + WINMESSAGE +\n \"\\nYou have a total of \" + player.getWins() + \" wins and \"\n + player.getLoses() + \" loses.\");\n break;\n }\n // if(roll == out7)\n else if (sum == OUT7) {\n player.playerLose();\n System.out.println(\"You hit the out 7.\" + LMESSAGE + \"\\nYou have a total of \" + player.getWins()\n + \" wins and \" + player.getLoses() + \" loses.\");\n\n break;\n } else {\n System.out.println(\"\\nYour total roll is \" + sum + \"\\nYou need to hit \" + pN +\n \" to win.\" + \"\\n\\nContinue rolling\\n\");\n }\n\n\n }\n\n }", "private void afterRoll() {\n if (die.getNumber() == 1) {\n round_score = 0;\n round_score_view.setText(String.valueOf(round_score));\n game.changeTurn();\n String label;\n if (game.isPlayer_turn()) {\n game.incrementRound();\n label = \"Round \" + game.getRound() + \" - Player's Turn\";\n }\n else {\n label = \"Round \" + game.getRound() + \" - Banker's Turn\";\n }\n round_label.setText(label);\n }\n else {\n round_score += die.getNumber();\n round_score_view.setText(String.valueOf(round_score));\n }\n if (!game.isPlayer_turn())\n doBankTurn();\n }", "public void rollStats() {\n\t\tRandom roll = new Random();\n\t\tint rolled;\n\t\tint sign;\n\t\t\n\t\t\n\t\trolled = roll.nextInt(4);\n\t\tsign = roll.nextInt(2);\n\t\tif (sign == 0) {\n\t\t\tsetMaxHealth(getMaxHealth() + rolled*(getDifficulty()+5/5));\n\t\t\tsetHealth(getMaxHealth());\n\t\t} else {\n\t\t\tsetMaxHealth(getMaxHealth() - rolled*(getDifficulty()+5/5));\n\t\t\tsetHealth(getMaxHealth());\n\t\t}\n\t\t\n\t\trolled = roll.nextInt(2);\n\t\tsign = roll.nextInt(2);\n\t\tif (sign == 0) {\n\t\t\tsetAttack(getAttack() + rolled*(getDifficulty()+5/5));\n\t\t} else {\n\t\t\tsetAttack(getAttack() - rolled*(getDifficulty()+5/5));\n\t\t}\n\t\t\n\t\trolled = roll.nextInt(2);\n\t\tsign = roll.nextInt(2);\n\t\tif (sign == 0) {\n\t\t\tsetDefense(getDefense() + rolled*(getDifficulty()+5/5));\n\t\t} else {\n\t\t\tsetDefense(getDefense() - rolled*(getDifficulty()+5/5));\n\t\t}\n\t\t\n\t\trolled = roll.nextInt(2);\n\t\tsign = roll.nextInt(2);\n\t\tif (sign == 0) {\n\t\t\tsetSpeed(getSpeed() + rolled*(getDifficulty()+5/5));\n\t\t} else {\n\t\t\tsetSpeed(getSpeed() - rolled*(getDifficulty()+5/5));\n\t\t}\n\t\t\n\t}", "private void setLoaded1() {\r\n\t\tdiceRoll1 = (int) (Math.random() * 6) + 1;\r\n\t}", "public int roll() {\n Random r;\n if (hasSeed) {\n r = new Random();\n }\n else {\n r = new Random();\n }\n prevRoll = r.nextInt(range) + 1;\n return prevRoll;\n }", "public int roll() {\n this.assuerNN_random();\n //Roll once\n int result = random.nextInt(this.sides)+1;\n //TODO Save the roll somewhere\n\n //Return the roll\n return result;\n }", "public void updateDice() {\n keepAll = true;\n for (JToggleButton die : diceButtons) { // check to see if the user wants to keep all of their dice\n if (!die.isSelected()) {\n keepAll = false;\n break;\n }\n }\n if (player.getCurrentTurn() <= player.getNumOfTurns() && !keepAll) { // reroll\n for (int i = 0; i < player.getPlayerHand().getSizeOfHand(); i++) {\n if (!diceButtons.get(i).isSelected())\n player.rollNewDie(i);\n diceButtons.get(i).setText(String.valueOf(player.getPlayerHand().getHand().get(i).getSideUp()));\n diceButtons.get(i).setSelected(false);\n diceImages.get(i).setIcon(new ImageIcon(player.getPlayerHand().getHand().get(i).getSideUp()+\"up.png\"));\n diceImages.get(i).setSelected(false);\n }\n player.setCurrentTurn(player.getCurrentTurn() + 1);\n setVisible(true);\n if (player.getNumOfTurns()+1 == player.getCurrentTurn() || player.getNumOfTurns() == 1) {\n makeScoringOptions();\n }\n }\n else {\n makeScoringOptions(); // go to scoring options frame\n }\n }", "DiceRoll modifyRoll(DiceRoll roll, Die die);", "public int roll()\n {\n int r = (int)(Math.random() * sides) + 1;\n return r;\n }", "public void onRollAgainClick(View view) {\n rollDie();\n }", "public void roll() {\n if(!frozen) {\n this.value = ((int)(Math.random() * numSides + 1));\n }\n }", "public static void main(String[] args) {\n\t\tRandom ricoDude = new Random();\r\n\t\tint x = ricoDude.nextInt(20) + 1;\r\n\t\t// the dice will have arange of 0-5 to make it 1-6 , + 1 to the end of it\r\n\t\t\r\n\t\tSystem.out.println(\"You rolled a: \" + x);\r\n\t\tint a = 1, b= 2,k;\r\n\t\tk = a + b + a++ + b++;\r\n\t\tSystem.out.println(k);\r\n\t\t\r\n\t}", "public void rollAtk() {\n rollAtk = roll();\n }", "public void roll(boolean [] which){\n for(int i = 0; i < HAND_SIZE; ++i){\n if(which[i]){\n dice[i].roll();\n }\n }\n }", "public DiceFace drawDice() {\n\n if(dicesDrawn >= Settings.MAX_DICE_PER_COLOR * GameColor.values().length) throw new IllegalStateException(this.getClass().getCanonicalName() + \": Attempting to draw one more dice, but already drawn 90\");\n\n int color = random.nextInt(GameColor.values().length);\n int number = random.nextInt(6) + 1;\n GameColor[] values = GameColor.values();\n\n while(counter.get(values[color]) >= Settings.MAX_DICE_PER_COLOR){\n color = random.nextInt(GameColor.values().length);\n }\n\n counter.put(values[color], counter.get(values[color]) + 1);\n dicesDrawn += 1;\n return new DiceFace(GameColor.values()[color], number);\n\n }", "public int rollDice()\n{\n int die1, die2, sum; \n\n // pick random die values\n die1 = 1 + ( int ) ( Math.random() * 6 );\n die2 = 1 + ( int ) ( Math.random() * 6 );\n\n sum = die1 + die2; // sum die values\n\n // display results\n die1Field.setText( Integer.toString( die1 ) );\n die2Field.setText( Integer.toString( die2 ) );\n sumField.setText( Integer.toString( sum ) );\n\n return sum; // return sum of dice\n\n\n}", "public Dice(int numberOfDice) {\r\n for (int i = 0; i < numberOfDice; i++) {\r\n dice.add(rollDie());\r\n }\r\n sortDice();\r\n }", "private static byte roll6SidedDie() {\n\t\tint test = (int)Math.floor(Math.random() * 6) + 1;\n\t\tbyte roll = (byte)test;\n\t\treturn roll;\n\t}", "int roll();", "public dice(int sides)\r\n\t{\r\n\t\tnumOfSides = sides;\r\n\t}", "private void reactToRoll(){\r\n\t\troll.setEnabled(false);\r\n\t\tsubmit.setEnabled(true);\r\n\t\tagain.setEnabled(false);\r\n\t\tnoMore.setEnabled(false);\r\n\t\tif(!didBust){\r\n\t\t\tstatusLabel.setText(\"Choose your first dice pair!\");\r\n\t\t} else {\r\n\t\t\tstatusLabel.setText(\"Oh no! Better luck next time.\");\r\n\t\t\tsubmit.setText(\"Oops! Busted!\");\r\n\t\t}\r\n\t\tupdate();\r\n\t}", "public ArrayList<Dice> rollAllDice()\n {\n ArrayList<Dice> array = getDiceArray();\n for(Dice dice : array)\n {\n if(dice.getReroll())\n {\n dice.rollDice();\n dice.setReroll(false, \"\"); //resets all reroll flags to false\n }\n }\n \n return array;\n }", "private void roll() {\n value = (int) (Math.random() * MAXVALUE) + 1;\n }", "private void allowNewRoll(){\r\n\t\tdidBust = false;\r\n\t\tgameOver = false;\r\n\t\troll.setEnabled(true);\r\n\t\tsubmit.setEnabled(false);\r\n\t\tagain.setEnabled(false);\r\n\t\tnoMore.setEnabled(false);\r\n\t\tfor(int i = 0; i < rolls.length; i++){\r\n\t\t\trolls[i] = 0;\r\n\t\t\tselectedDice[i] = false;\r\n\t\t}\r\n\t\tstatusLabel.setText(\"Roll the dice!\");\r\n\t\tupdate();\r\n\t}", "@Override\n public void initDiceRoller() {\n debug(\"initDiceRoller\");\n\n setContentView(getDiceRollerLayout());\n setDiceRollerButtons();\n }", "private void roll2(DiceModel player1, DiceModel player2) {\n\t\t\n\t\tint random;\t\n\t\t\n\t\t// enables the dice to be kept\n\t\tenableDice();\n\t\t\n\t\t// reset text if player previously failed to select a die\n\t\tif (roundChanger == 2) {\n\t\t\ttextAreaInstructions.setText(rollToBeat);\n\t\t} else {\n \ttextAreaInstructions.setText(\"Start by clicking\" + \"\\n\" + \"Roll Dice button!\");\n \t}\n\t\t\n\t\t// display round number\n\t\ttextFieldRound.setText(Integer.toString(round));\n\t\t\n\t\t// if we are on the first roller, count up rolls till they end turn\n\t\tif (roundChanger == 1) {\n\t\t\trollsTaken = rollsTaken + 1;\n\t\t}\n\t\t\n\t\t// turn should increment for both rollers\n\t\tturn = turn + 1;\n\t\t\n\t\t// if all three die are selected then end turn\n\t\tif (togglebtnD1.isSelected() == true && togglebtnD2.isSelected() == true &&\n\t\t\t\ttogglebtnD3.isSelected() == true) {\n\t\t\tendTurn();\n\t\t}\n\t\t\n\t\t// determines who has the current roll\n\t\tString currentPlayer = textFieldCurrentPlayer.getText();\n\t\tString stringPlayer1 = \"Player1\";\n\t\t\n\t\t// enforces player requirement of having at least 1 die selected per roll\n\t\tif (turn != 1 && togglebtnD1.isSelected() == false && togglebtnD2.isSelected() == false &&\n \ttogglebtnD3.isSelected() == false) {\n \t\tif (roundChanger == 1) {\n \t\tturn = turn - 1;\n \t\trollsTaken = rollsTaken - 1;\n \t\ttextAreaInstructions.setText(\"Please select at least 1 die to continue.\");\n \t\t} else if (roundChanger == 2 && turn == 0){\n \t\t\ttextAreaInstructions.setText(rollToBeat);\n \t\t}else {\n \t\tturn = turn - 1;\n \t\ttextAreaInstructions.setText(\"Please select at least 1 die to continue.\");\n \t\t}\n \t} else {\n\t\t\t// only get new values for dice that haven't been kept\t\t\n\t\t\tif (togglebtnD1.isSelected() == false) {\n\t\t\t\trandom = generateRandom();\n\t\t\t\t displayDie(random, togglebtnD1);\n\t\t\t\tif (currentPlayer.equals(stringPlayer1)) {\n\t\t\t\t\tplayer1.setDie1(random);\n\t\t\t\t} else {\n\t\t\t\t\tplayer2.setDie1(random);\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t}\n\t\t\tif (togglebtnD2.isSelected() == false) {\n\t\t\t\trandom = generateRandom();\n\t\t\t\tdisplayDie(random, togglebtnD2);\n\t\t\t\tif (currentPlayer.equals(stringPlayer1)) {\n\t\t\t\t\tplayer1.setDie2(random);\n\t\t\t\t} else {\n\t\t\t\t\tplayer2.setDie2(random);\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t}\n\t\t\tif (togglebtnD3.isSelected() == false) {\n\t\t\t\trandom = generateRandom();\n\t\t\t\tdisplayDie(random, togglebtnD3);\n\t\t\t\tif (currentPlayer.equals(stringPlayer1)) {\n\t\t\t\t\tplayer1.setDie3(random);\n\t\t\t\t} else {\n\t\t\t\t\tplayer2.setDie3(random);\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t}\n\n\t\t\t// limit second rollers turns to as many turns as first roller had\n\t\t\tif (turn == rollsTaken && roundChanger == 2) {\n\t\t\t\tendTurn();\n\t\t\t}\n\n\t\t\tif (turn == 3) { \n\t\t\t\tendTurn();\n\t\t\t}\n\t\t}\t\n\t\n\t}", "public int roll() {\n Random random = new Random();\n faceValue = random.nextInt(sides)+1;\n return faceValue;\n }", "public void setDice(Dice dice) {\n this.dice = dice;\n }", "public int tossDice(){\n\t\tRandom r = new Random();\n\t\tdiceValue = r.nextInt(6)+1;\n\t\tdiceTossed = true;\n\t\treturn diceValue;\n\t}", "public void run() {\n\t\tdice.turnos(turn, this);\n\t}", "public void rollDice(int pIndex) {\n this.pIndex = pIndex;\n this.result = this.roll();\n this.isSix = this.result == 6;\n resetCoordinates();\n this.tickCounter=0;\n this.vel=1;\n this.diceRollCount++;\n }", "public void roll(){\n roll(new boolean[]{true,true,true,true,true});\n }", "public String throwDice() {\n if (timesThrown < 3) {\n for (Die die : dice) {\n if (timesThrown == 0) {\n die.setChosen(false);\n }\n if (die.getChosen() == false) {\n int random = (int) (Math.random() * 6 + 1);\n die.setValue(random);\n }\n }\n return writeTimesThrown();\n }\n return null;\n }", "public static int rollFairDie(){\n\t\t\n\t\tdouble rand = Math.random();\n\t\tint roll = (int) (rand * 6); // [0,5] what above code does.\n\t\treturn roll + 1;\n\t}", "public boolean rollTheDice() {\n\t\tboolean result;\n\t\tint randomDiceRoll = (int)(Math.random() * 6) + 1;\n\t\tif(randomDiceRoll>=5) {\n\t\t\tresult=true;\n\t\t}\n\t\telse {\n\t\t\tresult=false;\n\t\t}\n\t\treturn result;\n\t}", "static public void showDice(List<Die> dice) {\n System.out.println(\"----Your Hand----\");\n for (var die : dice) {\n System.out.print(die.getNumberOnDie() + \" \");\n }\n System.out.println(\"\\n\");\n }", "public void rollRandom() {\n\t\tthis.strength = randomWithRange();\r\n\t\tthis.wisdom = randomWithRange();\r\n\t\tthis.dexterity = randomWithRange();\r\n\t\tthis.constitution = randomWithRange();\r\n\t\tthis.intelligence = randomWithRange();\r\n\t\tthis.charisma = randomWithRange();\r\n\t}", "public static void main(String[] args)\n {\n Die dice_1 = new Die();\n Die dice_2 = new Die();\n Scanner in = new Scanner(System.in);\n\n while (true)\n {\n System.out.println(\"Time for some Craps!\");\n\n System.out.println(\"Hit [Enter] to roll both dice:\");\n in.nextLine();\n\n int roll_1 = dice_1.roll();\n int roll_2 = dice_2.roll();\n int totalroll = roll_1 + roll_2;\n System.out.println(\"You rolled a \" + roll_1 + \" and a \" + roll_2);\n System.out.println(\"Which combine for a total roll of \" + totalroll);\n\n // time to set up if statements to determine whether the player has won, lost, or still plays.\n\n if (totalroll == 7 || totalroll == 11)\n {\n System.out.println(\"Congrats! You won! :D \");\n }\n\n else if (totalroll == 2 || totalroll == 3 || totalroll == 12)\n {\n System.out.println(\"Sorry! You lost! :( \");\n } \n\n else\n {\n // we now need a point for the player to attempt to roll for\n int point = totalroll;\n\n // boolean needed here to keep the game continuous after the first roll\n boolean keepplaying = true;\n\n while(keepplaying) \n {\n // same code from above needed for the game to continue\n System.out.println(\"Hit [Enter] to roll both dice:\");\n in.nextLine();\n\n roll_1 = dice_1.roll();\n roll_2 = dice_2.roll();\n totalroll = roll_1 + roll_2;\n System.out.println(\"You rolled a \" + roll_1 + \" and a \" + roll_2);\n System.out.println(\"Which combine for a total roll of \" + totalroll);\n\n // now we check to see if they rolled the point\n if (totalroll == point)\n {\n System.out.println(\"You matched the point. You win! :D\");\n keepplaying = false;\n }\n\n else if (totalroll == 7)\n {\n System.out.println(\"You rolled a 7. You lost! :(\");\n keepplaying = false;\n } \n }\n } \n System.out.println(\"Play again?\");\n String playAgain = in.nextLine();\n if (playAgain.equals(\"\"))\n {\n }\n if (playAgain.substring(0,1).equals(\"n\"))\n {\n break;\n } \n }\n System.out.println(\"Thanks for playing Craps!\");\n }", "static void UniversalShake() {\n if (!Sounds.getIsMute()) diceShakeSound.start();\n\n diceNum = GameFunctions.rollDice(\"Pigdice\", dice);\n\n if (diceNum == 1) {\n if (playerTurn == 1) {\n endTurn(currentScorePlayer1);\n } else {\n endTurn(currentScorePlayer2);\n }\n } else {\n if (playerTurn == 1)\n currentScorePlayer1.setText(String.valueOf(Integer.parseInt\n (currentScorePlayer1.getText().toString()) + diceNum));\n\n else\n currentScorePlayer2.setText(String.valueOf(Integer.parseInt\n (currentScorePlayer2.getText().toString()) + diceNum));\n }\n }" ]
[ "0.8097287", "0.79941094", "0.78701645", "0.77440614", "0.7687683", "0.7651825", "0.76280093", "0.76153487", "0.7601151", "0.755615", "0.7543682", "0.7520768", "0.7491037", "0.7464755", "0.74555576", "0.74460095", "0.740893", "0.739138", "0.73882544", "0.7351157", "0.7339408", "0.73020047", "0.7280308", "0.72798145", "0.7278078", "0.7262125", "0.71978426", "0.71931165", "0.7190655", "0.7185005", "0.71760416", "0.7170948", "0.71613777", "0.71449614", "0.71435165", "0.71375245", "0.7119618", "0.70934147", "0.7081663", "0.70712566", "0.706654", "0.702872", "0.69956744", "0.69633645", "0.6956549", "0.69545406", "0.69527125", "0.6947241", "0.6923271", "0.6921616", "0.69187695", "0.6917473", "0.691099", "0.6910154", "0.68936974", "0.68760073", "0.68476504", "0.68419087", "0.6827512", "0.6807981", "0.6791067", "0.67600733", "0.67469674", "0.6740915", "0.6735641", "0.67216486", "0.67124104", "0.67095697", "0.6708511", "0.6705499", "0.66878384", "0.6678514", "0.66567934", "0.66504556", "0.66451067", "0.66400695", "0.66300833", "0.66207695", "0.66134846", "0.6611314", "0.66036004", "0.6602527", "0.66024494", "0.657584", "0.6574347", "0.65718263", "0.6566216", "0.65613735", "0.6561329", "0.6560482", "0.65587926", "0.65585065", "0.6553869", "0.65410924", "0.6521589", "0.6486605", "0.6469121", "0.6461974", "0.6435298", "0.64201033", "0.64200765" ]
0.0
-1
This method is called when a player tries to build a road
boolean CanBuyRoad();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void buildRoad() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void playRoadBuildingCard() {\n\t\t\r\n\t}", "@Override\n\tpublic void execute() {\n\t\t\n\t\tif (GamesHandler.test) {\n\t\t\tserverModel = ServerFacadeTest.getSingleton().getGameModel(gameID);\n\t\t} else {\n\t\t\tserverModel = ServerFacade.getSingleton().getGameModel(gameID);\n\t\t}\n\t\t\n\t\tPlayer player = serverModel.getPlayers().get(sender);\n\t\tDevCardList playerOldDevCards = player.getOldDevCards();\n\t\t\n\t\tplayerOldDevCards.setRoadBuilding(playerOldDevCards.getRoadBuilding() - 1);\n\t\t\n\t\tserverModel.getMap().addRoad(new Road(sender, spot1));\n\t\tserverModel.getMap().addRoad(new Road(sender, spot2));\n\t\t\n\t\tplayer.setRoads(player.getRoads() - 2);\n\t\t\n\t\tplayer.setPlayedDevCard(true);\n\t\t\n\t\tMessageLine line = new MessageLine();\n\t\tString username = player.getName();\n\t\tif(username.toLowerCase().equals(\"ife\") || username.toLowerCase().equals(\"ogeorge\")){\n\t\t\tline.setMessage(\"Ife built a couple of roads to try to catch up with Paul, but Daniel always wins anyway\");\n\t\t}\n\t\telse{\n\t\t\tline.setMessage(username + \" built a couple roads with a road building development card\");\n\t\t}\n//\t\tline.setMessage(username + \" built a couple roads with a road building development card\");\n\t\tline.setSource(username);\n\t\tserverModel.getLog().addLine(line);\n\t}", "public boolean build(Edge edge) {\n \t\tif (edge == null || !canBuild(edge))\n \t\t\treturn false;\n \n \t\t// check resources\n \t\tboolean free = board.isSetupPhase() || board.isProgressPhase();\n \t\tif (!free && !affordRoad())\n \t\t\treturn false;\n \n \t\tif (!edge.build(this))\n \t\t\treturn false;\n \n \t\tif (!free) {\n \t\t\tuseResources(Type.BRICK, 1);\n \t\t\tuseResources(Type.LUMBER, 1);\n \t\t}\n \n \t\tappendAction(R.string.player_road);\n \n \t\tboolean hadLongest = (board.getLongestRoadOwner() == this);\n \t\tboard.checkLongestRoad();\n \n \t\tif (!hadLongest && board.getLongestRoadOwner() == this)\n \t\t\tappendAction(R.string.player_longest_road);\n \n \t\troads.add(edge);\n \n \t\tVertex vertex = edge.getVertex1();\n \t\tif (!reaching.contains(vertex))\n \t\t\treaching.add(vertex);\n \n \t\tvertex = edge.getVertex2();\n \t\tif (!reaching.contains(vertex))\n \t\t\treaching.add(vertex);\n \n \t\treturn true;\n \t}", "public boolean canDoBuildInitialRoad(){\n\t\t // If the player already has two roads on the board then he has already placed the initial roads\n\t\t if(playerPieces.getNumberOfRoads() < 14){\n\t\t\t return false;\n\t\t }\n\t\t return true;\n\t }", "@Override\n public void playRoadBuilding(EdgeLocation e1, EdgeLocation e2) throws ModelException {\n if (!GameModelFacade.instance().canPlayRoadBuilding(e1, e2)) {\n throw new ModelException(\"Preconditions for action not met.\");\n }\n\n try {\n String clientModel = m_theProxy.playRoadBuilding(GameModelFacade.instance().getLocalPlayer().getIndex(), e1, e2);\n new ModelInitializer().initializeClientModel(clientModel, m_theProxy.getPlayerId());\n } catch (NetworkException e) {\n throw new ModelException(e);\n }\n }", "public void makeRoads()\r\n\t{\r\n\t\tfor(int i=0; i<roads.length; i++)\r\n\t\t\troads[i] = new Road(i*SCREEN_HEIGHT/20,SCREEN_WIDTH,SCREEN_HEIGHT/20-10);\r\n\t}", "@Override\r\n\tpublic void placeRoad(EdgeLocation edgeLoc) {\n\t\t\r\n\t}", "public void buildInitialRoad(Edge edge) throws CannotBuyException, InsufficientPlayerResourcesException, AllPiecesPlayedException {\n\t\t if(canDoBuildInitialRoad() == false) {\n\t\t\t throw new CannotBuyException(\"Cannot Buy Road, possibly no edge to place a road\");\n\t\t }\n\t\t playerPieces.placeRoad(edge);\n\t }", "private void buildStreet() {\r\n\t\tbuilt = false;\r\n\t\tbuildPanelRoad.setVisible(false);\r\n\t\tMessage message = new Message(clickedRoad, true, null);\r\n\t\tsendMessage(message);\r\n\t}", "public static void checkPlayerLongestRoad(Player player, Game game1, Road road1) {\n\n\t\t//the unique id for each node visit that takes place\n\t\tid = 0;\n\t\tloop = false;\n\n\t\tBoard board1 = game1.getBoard();\n\t\t\n\t\tint currLongest = player.getLongestRoad(); //old longest road\n\t\tint longest = 0; //longest road found from this point\n\n\t\t//this is one end of the road\n\t\tIntersection intA = (Intersection) game1.getBoard()\n\t\t\t\t.getLocationFromCoordinate(road1.getCoordinateA())\n\t\t\t\t.getContains();\n\t\t\n\t\t//this is the other\n\t\tIntersection intB = (Intersection) game1.getBoard()\n\t\t\t\t.getLocationFromCoordinate(road1.getCoordinateB())\n\t\t\t\t.getContains();\n\n\t\tRoad end1A = null;\n\t\tRoad end1B = null;\n\t\tRoad end2A = null;\n\t\tRoad end2B = null;\n\t\t\n\t\t// this sets end1A to be the first new road coming out of intA that is not the road placed (i.e. that does not go to intB)\n\t\tend1A = getRoadFromInt(game1, intA, player, intB, null);\n\t\t\n\t\t// if there was such a road, this looks for another road, to see if there are two roads coming out of that same end\n\t\tif (end1A != null) {\n\t\t\tend1B = getRoadFromInt(game1, intA, player, intB, getOtherInt(board1, end1A, intA));\n\t\t}\n\t\t\n\t\t//this sets end2a to be the first new road coming out of the other end (intB) that doesnt go to intA\n\t\tend2A = getRoadFromInt(game1, intB, player, intA, null);\n\t\t\n\t\t// if there was such a road, this looks for another road, to see if there are two roads coming out of that same end\n\t\tif (end2A != null) {\n\t\t\tend2B = getRoadFromInt(game1, intB, player, intA, getOtherInt(board1, end2A, intB));\n\t\t}\n\n\t\t// connecting, i.e. if this road links to other roads together\n\t\tif ((end1A != null || end1B != null) && (end2A != null || end2B != null)) {\n\t\t\t\n\t\t\tid = 0;\n\t\t\t\n\t\t\t//this maps a point to a sector for the purpose of finding overlap\n\t\t\tHashMap<Intersection, String> sectorMap = new HashMap<Intersection, String>();\n\t\t\t\t\t\n\t\t\t//END 1\n\t\t\tint longests1 = 0;\n\t\t\t\n\t\t\tHashMap<Intersection, Integer> distancesMaps1 = new HashMap<Intersection, Integer>();\n\t\t\tHashMap<Intersection, ArrayList<Integer>> visitorsMaps1 = new HashMap<Intersection, ArrayList<Integer>>();\n\t\t\tArrayList<Integer> namesLists1 = new ArrayList<Integer>();\n\t\t\t\n\t\t\tnamesLists1.add(new Integer(0));\n\t\t\tnamesLists1.add(new Integer(-1));\n\t\t\t\n\t\t\tArrayList<Integer> idArray1s1 = new ArrayList<Integer>();\n\t\t\tArrayList<Integer> idArray2s1 = new ArrayList<Integer>();\n\t\t\t\n\t\t\tidArray1s1.add(new Integer(id));\n\t\t\tidArray2s1.add(new Integer(id - 1));\n\t\t\tvisitorsMaps1.put(intB, idArray1s1);\n\n\t\t\tlongests1 = Branch(game1, player, intA, intB, road1,\n\t\t\t\t\t(ArrayList<Integer>) namesLists1.clone(), 1,\n\t\t\t\t\tdistancesMaps1, visitorsMaps1, \"s1\", sectorMap);\n\t\t\t\t\t\t\n\t\t\t// END2\n\t\t\tint longests2 = 0;\n\t\t\t\n\t\t\tHashMap<Intersection, Integer> distancesMaps2 = new HashMap<Intersection, Integer>();\n\t\t\tHashMap<Intersection, ArrayList<Integer>> visitorsMaps2 = new HashMap<Intersection, ArrayList<Integer>>();\n\t\t\tArrayList<Integer> namesLists2 = new ArrayList<Integer>();\n\t\t\t\n\t\t\tnamesLists2.add(new Integer(id));\n\t\t\tnamesLists2.add(new Integer(id-1));\n\n\t\t\tArrayList<Integer> idArray1s2 = new ArrayList<Integer>();\n\t\t\tArrayList<Integer> idArray2s2 = new ArrayList<Integer>();\n\t\t\t\n\t\t\tidArray1s2.add(new Integer(id));\n\t\t\tidArray2s2.add(new Integer(id-1 ));\n\t\t\tvisitorsMaps2.put(intA, idArray1s2);\n\t\t\t\n\t\t\tlongests2 = Branch(game1, player, intB, intA, road1,\n\t\t\t\t\t(ArrayList<Integer>) namesLists2.clone(), 1,\n\t\t\t\t\tdistancesMaps2, visitorsMaps2, \"s2\", sectorMap);\n\n\t\t\t//deciding on what to return\n\t\t\tif (loop) {\n\t\t\t\t\n\t\t\t\tif (longests2 > longests1) {\n\t\t\t\t\tlongest = longests2;\n\t\t\t\t} \n\t\t\t\telse {\n\t\t\t\t\tlongest = longests1;\n\t\t\t\t}\n\t\t\t} \n\t\t\telse {\n\t\t\t\tlongest = -1 + longests1 + longests2;\n\t\t\t}\n\n\t\t} \n\t\t\n\t\t//this is what happens if only one end connected to anything, this works!\n\t\telse {\n\t\t\t\n\t\t\t// setup\n\t\t\tid = 0;\n\t\t\t\n\t\t\t//this hashmap will record the distances to various points, using points as keys, longest distances as values, will update with longer distances\n\t\t\tHashMap<Intersection, Integer> distancesMap = new HashMap<Intersection, Integer>();\n\t\t\t\n\t\t\t//this hashmap will map points to an arraylist of ints\n\t\t\tHashMap<Intersection, ArrayList<Integer>> visitorsMap = new HashMap<Intersection, ArrayList<Integer>>();\n\t\t\t\n\t\t\t//this arraylist will be cloned to represent all the things that have been visited by a route, all routes have visited 0 and -1 (the two start intersections)\n\t\t\tArrayList<Integer> namesList = new ArrayList<Integer>();\n\t\t\t\n\t\t\tnamesList.add(new Integer(0));\n\t\t\tnamesList.add(new Integer(-1));\n\t\t\t\n\t\t\t// end 1 is not empty, end 2 is this means we will be branching intA\n\t\t\tif ((end1A != null || end1B != null)) {\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t// this adds the ids of the starting points to the visitorsmap hashmap\n\t\t\t\t//each node gets its own arraylist, which is why we get two, of course \n\t\t\t\t//these array lists should not really be added to\n\t\t\t\tArrayList<Integer> idArray1 = new ArrayList<Integer>();\n\t\t\t\tArrayList<Integer> idArray2 = new ArrayList<Integer>();\n\t\t\t\t\n\t\t\t\tidArray1.add(new Integer(id));\n\t\t\t\tidArray2.add(new Integer(id - 1));\n\t\t\t\tvisitorsMap.put(intB, idArray1);\n\t\t\t\tvisitorsMap.put(intA, idArray2);\n\t\t\t\t\n\t\t\t\t//the starting length of the branch coming out of end1A, this includes the original road\n\t\t\t\tint toplen = 1;\n\t\t\t\t\n\t\t\t\t//the starting length of the branch coming out of end1B\n\t\t\t\tint botLen = 1;\n\t\t\t\t\n\t\t\t\t// looking at the first branch possibility\n\t\t\t\tif (end1A != null) {\n\t\t\t\t\t\n\t\t\t\t\t//branch using the road end1A fro intA to the intersection\n\t\t\t\t\t//that road end1A leads to, and moving the length to two \n\t\t\t\t\ttoplen = Branch(game1, player, getOtherInt(board1, end1A, intA), intA, end1A,\n\t\t\t\t\t\t\t(ArrayList<Integer>) namesList.clone(), toplen + 1,\n\t\t\t\t\t\t\tdistancesMap, visitorsMap, null, null);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// looking at the other branch possibility\n\t\t\t\tif (end1B != null) {\n\t\t\t\t\t\n\t\t\t\t\ttoplen = Branch(game1, player, getOtherInt(board1, end1B, intA), intA, end1B,\n\t\t\t\t\t\t\t(ArrayList<Integer>) namesList.clone(), botLen + 1,\n\t\t\t\t\t\t\tdistancesMap, visitorsMap, null, null);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// getting which one of those is better!\n\t\t\t\tif (toplen > botLen) {\n\t\t\t\t\tlongest = toplen;\n\t\t\t\t} \n\t\t\t\telse {\n\t\t\t\t\tlongest = botLen;\n\t\t\t\t}\n\t\t\t} \n\t\t\t\n\t\t\t//end 2 is empty\n\t\t\telse {\n\t\t\t\t\n\t\t\t\tid = 0;\n\t\t\t\t\n\t\t\t\t// putting the ids in a map, getting them the right way\n\t\t\t\t// around(pointless?)\n\t\t\t\tArrayList<Integer> idArray1 = new ArrayList<Integer>();\n\t\t\t\tArrayList<Integer> idArray2 = new ArrayList<Integer>();\n\t\t\t\t\n\t\t\t\tidArray1.add(new Integer(id));\n\t\t\t\tidArray2.add(new Integer(id - 1));\n\t\t\t\tvisitorsMap.put(intA, idArray1);\n\t\t\t\tvisitorsMap.put(intB, idArray2);\n\t\t\t\t\n\t\t\t\t// length of each branch+initial road\n\t\t\t\tint toplen = 1;\n\t\t\t\tint botLen = 1;\n\t\t\t\t\n\t\t\t\t// looking at the first branch possibility road end2A from intersection intB to a new int\n\t\t\t\tif (end2A != null) {\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"A\");\n\t\t\t\t\ttoplen = Branch(game1, player, getOtherInt(board1, end2A, intB), intB, end2A,\n\t\t\t\t\t\t\t(ArrayList<Integer>) namesList.clone(), toplen + 1,\n\t\t\t\t\t\t\tdistancesMap, visitorsMap, null, null);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// looking at the other branch possibility\n\t\t\t\tif (end2B != null) {\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"B\");\n\t\t\t\t\tbotLen = Branch(game1, player, getOtherInt(board1, end2B, intB), intB, end2B,\n\t\t\t\t\t\t\t(ArrayList<Integer>) namesList.clone(), botLen + 1,\n\t\t\t\t\t\t\tdistancesMap, visitorsMap, null, null);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// getting which one of those is better!\n\t\t\t\tif (toplen > botLen) {\n\t\t\t\t\tlongest = toplen;\n\t\t\t\t} \n\t\t\t\telse {\n\t\t\t\t\tlongest = botLen;\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\tif (longest > currLongest) {\n\t\t\tplayer.setLongestRoad(longest);\n\t\t}\n\t\t\n\t\tloop = false;\n\t}", "void playRoadCard(EdgeLocation spot1, EdgeLocation spot2);", "public void drawRoad(int player, int location, Graphics g){\n\t}", "@Override\n public boolean build(Match m, ClientHandler ch, Server server) {\n int wID=2;\n Player p = m.getPlayer(ch.getName());\n if(p.getWorker(0).getMoved()) wID = 0;\n if(p.getWorker(1).getMoved()) wID = 1;\n ArrayList<Coordinate> coordinates = whereCanBuild(m, ch, wID);\n server.write(ch, \"serviceMessage\", \"MSGE-Build: \\n\");\n if(coordinates.size()!=0){\n Coordinate c = null;\n server.write(ch, \"serviceMessage\", \"LIST-\"+printCoordinates(coordinates));\n server.write(ch, \"interactionServer\", \"TURN-Where you want to build?\\n\");\n int id;\n while(true){\n try{\n String msg = server.read(ch);\n if(msg == null){\n for(ClientHandler chl : server.getClientHandlers()){\n server.write(chl, \"serviceMessage\", \"WINM-Player disconnected\\n\");\n }\n ch.resetConnected();\n ch.closeConnection();\n return false;\n }else{\n id = Integer.parseInt(msg);\n }\n if(id<0 || id>=coordinates.size()){\n server.write(ch, \"serviceMessage\", \"MSGE-Invalid input\\n\");\n server.write(ch, \"interactionServer\", \"TURN-Try another index: \");\n continue;\n }\n break;\n } catch (NumberFormatException e){\n server.write(ch, \"serviceMessage\", \"MSGE-Invalid input\\n\");\n server.write(ch, \"interactionServer\", \"TURN-Try another index: \");\n }\n }\n c = coordinates.get(id);\n if(c.equals(p.getWorker(wID).getPosition()))\n server.write(ch, \"serviceMessage\", \"MSGE-You're using Zeus Power!\\n\");\n m.updateBuilding(c);\n m.getBoard()[c.getX()][c.getY()].setLevelledUp(true);\n p.getWorker(wID).changeBuilt(true);\n return true;\n }else{\n return false;\n }\n\n }", "public void tryMove() {\n if(!currentPlayer.getHasPlayed()){\n if (!currentPlayer.isEmployed()) {\n String destStr = chooseNeighbor();\n\n currentPlayer.moveTo(destStr, getBoardSet(destStr));\n if(currentPlayer.getLocation().getFlipStage() == 0){\n currentPlayer.getLocation().flipSet();\n }\n refreshPlayerPanel();\n }\n else {\n view.showPopUp(currentPlayer.isComputer(), \"Since you are employed in a role, you cannot move but you can act or rehearse if you have not already\");\n }\n }\n else{ \n view.showPopUp(currentPlayer.isComputer(), \"You've already moved, rehearsed or acted this turn. Try a different command or click `end turn` to end turn your turn.\");\n }\n view.updateSidePanel(playerArray);\n }", "void buildRoad(EdgeLocation edge, boolean free);", "public boolean canDoBuyRoad(){\n\t\t // If the player doesn't have resources for a road, or has already played all his roads, he can't buy another\n\t\t if(resourceCardHand.canDoPayForRoad() == false || playerPieces.hasAvailableRoad() == false) {\n\t\t\t return false;\n\t\t }\n\t\t if(playerPieces.getNumberOfRoads() > 13){\n\t\t\t return true;\n\t\t }\n\t\t // If the player has no legal place to put a road on the map, he shouldn't be allowed to buy one.\n\t\t if(playerPieces.canPlaceARoadOnTheMap() == false) {\n\t\t\t return false;\n\t\t }\n\t\t return true;\n\t }", "Road(boolean h, MP m){\n\t\t time = m.getLifeTime();\n\t\t horizontal = h; \n\t\t _MP = m;\n\t\t endPosition = _MP.createRandom(_MP.getRoadLengthMin(), _MP.getRoadLengthMax());\n\t }", "private boolean roadCheck(Road road) {\n\t\t\n\t\treturn false;\n\t}", "public boolean roadBlocked(Player player)\n {\n int num = 0;\n int num2 = 0;\n int num3 = 0;\n if (person_to_play == 1)\n {\n num = check4CollisionWithRed(player);\n num2 = check4CollisionWithGreen(player);\n num3 = check4CollisionWithYellow(player);\n }\n else if (person_to_play == 2)\n {\n //println(\"inside road block\");\n num = check4CollisionWithBlue(player);\n num2 = check4CollisionWithGreen(player);\n num3 = check4CollisionWithYellow(player);\n //println(\"num=\"+num);\n }\n else if (person_to_play == 3)\n {\n num = check4CollisionWithBlue(player);\n num2 = check4CollisionWithRed(player);\n num3 = check4CollisionWithYellow(player);\n }\n else if (person_to_play == 4)\n {\n num = check4CollisionWithBlue(player);\n num2 = check4CollisionWithRed(player);\n num3 = check4CollisionWithGreen(player);\n }\n if (num > 1 || num2 > 1 || num3 > 1)\n {\n return true;\n }\n return false;\n }", "public void makeMove() {\n\t\tif (CheckForVictory(this)) {\n\t\t\t// System.out.println(\"VICTORY\");\n\t\t\tInterface.goalReached = true;\n\t\t\tfor (int i = 0; i < tmpStrings.length; i++) {\n\t\t\t\tif (moveOrder[i] == 0)\n\t\t\t\t\ttmpStrings[i] = \"turn left\";\n\t\t\t\telse if (moveOrder[i] == 1)\n\t\t\t\t\ttmpStrings[i] = \"turn right\";\n\t\t\t\telse\n\t\t\t\t\ttmpStrings[i] = \"go forward\";\n\n\t\t\t\tInterface.info.setText(\"Generation: \" + Parallel.generationNo + 1 + \" and closest distance to goal: \" + 0);\n\t\t\t}\n\t\t} else {\n\t\t\tmoveOrder[this.movesMade] = moves.remove();\n\t\t\tswitch (moveOrder[this.movesMade]) {\n\t\t\tcase (0):\n\t\t\t\tthis.movesMade++;\n\t\t\t\tif (face == 0)\n\t\t\t\t\tface = 3;\n\t\t\t\telse\n\t\t\t\t\tface--;\n\t\t\t\tbreak;\n\t\t\tcase (1):\n\t\t\t\tthis.movesMade++;\n\t\t\t\tif (face == 3)\n\t\t\t\t\tface = 0;\n\t\t\t\telse\n\t\t\t\t\tface++;\n\t\t\t\tbreak;\n\t\t\tcase (2):\n\t\t\t\tthis.movesMade++;\n\t\t\t\tif (face == 0 && Y - 1 >= 0)\n\t\t\t\t\tY--;\n\t\t\t\telse if (face == 1 && X + 1 <= map[0].length - 1)\n\t\t\t\t\tX++;\n\t\t\t\telse if (face == 2 && Y + 1 <= map.length - 1)\n\t\t\t\t\tY++;\n\t\t\t\telse if (face == 3 && X - 1 >= 0)\n\t\t\t\t\tX--;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tSystem.out.println(\"Error making move :(\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public abstract void onLand(Player player);", "@Override\n\tpublic void onNextRoadClick() {\n\t\t\n\t}", "public void startOfGame() {\r\n\t\tif (enemyTracker.allEnemiesScanned() && oneTime) {\r\n\r\n\t\t\tif (myPlaceInList == 0) {\r\n\t\t\t\tif (!enemyTracker.getEnemyList().isEmpty()) {\r\n\t\t\t\t\tradarTarget = enemyTracker.getEnemyList().get(0);\r\n\r\n\t\t\t\t\ttargetTracking.add(new AllyWithTarget(allyTracker.getMrRobots().get(myPlaceInList), radarTarget));\r\n\t\t\t\t} else {\r\n\t\t\t\t\tradarTarget = enemyTracker.getTarget();\r\n\t\t\t\t\ttargetTracking.add(new AllyWithTarget(allyTracker.getMrRobots().get(myPlaceInList), radarTarget));\r\n\t\t\t\t}\r\n\t\t\t\tgotTarget = true;\r\n\t\t\t\tmrRobot.sendMessage(4, \"2\");\r\n\r\n\t\t\t}\r\n\t\t\toneTime = false;\r\n\t\t}\r\n\t}", "@Override\n public void run() {\n try {\n preparePlacedBoard();\n } catch (AllShipsPlacedSuccesfully ex) {\n placedBoard.setAsTargetBoard();\n }\n }", "public void StartGame(){\n log(\"Game started\");\n\n myTile = 74;\n opponentTile = 14;\n bombs=3;\n hp=3;\n turnNumber = 1;\n lastTurnPowerup = 1;\n powerup_confusion = false;\n powerup_godmode = false;\n bombs_location = new ArrayList<>();\n powerup_location = new ArrayList<>();\n canPlaceBomb = true;\n invulnerable = false;\n confused = false;\n\n ImageView player2 = (ImageView) findViewById(R.id.square_14);\n ImageView player1 = (ImageView) findViewById(R.id.square_74);\n player1.setScaleType(ImageView.ScaleType.FIT_CENTER);\n player2.setScaleType(ImageView.ScaleType.FIT_CENTER);\n player1.setImageDrawable(getResources().getDrawable(R.drawable.tank_blue));\n player2.setImageDrawable(getResources().getDrawable(R.drawable.tank_red));\n String playerStarterId = getIntent().getStringExtra(getResources().getString(R.string.game_player_starter));\n\n /**\n * decides who gets to start according to the algorithm in MultiplayerManager.java\n */\n// if(playerStarterId.equals(mMyId)){\n// myTurn = true;\n// showTimedAlertDialog(\"Your turn!\", \"Click on spot you want to move your brick to\", 5);\n// }else{\n// myTurn = false;\n// showTimedAlertDialog(\"Your opponent's move\", \"Wait for your opponent to make a move\", 5);\n// }\n\n /**\n * fallback incase the previous method doesnt work\n */\n try{\n if(sharedPreferences.getString(\"brick\", null).contains(\"Arafat\")){\n myTurn = true;\n ShotsCaller = true;\n showTimedAlertDialog(\"Your turn!\", \"Click on spot you want to move your brick to\", 5);\n }else{\n myTurn = false;\n ShotsCaller = false;\n showTimedAlertDialog(\"Your opponent's move\", \"Wait for your opponent to make a move\", 5);\n }\n }catch (NullPointerException e){\n myTurn = false;\n ShotsCaller = false;\n }\n }", "void toyPlacingfStuff(){\n //nu stiu daca asta ramane\n gettingBackToInitial();\n nearingTheWallBefore();\n parallelToTheWall();\n actualToyPlacing();\n }", "protected void onTick() {\n\t\tif(car.drivingInfo.pathToGet.size() == 0 && car.carData.to == null) {\n\t\t\tcar.state = Car.WAIT_PASSENGER_TO_GO_INSIDE;\n\t\t\tSystem.out.println(\"engaged with from drive\" + car.engagedWithAID.toString());\n\t\t\tcar.addBehaviour(new TakePassenger());\n\t\t\tthis.stop();\n\t\t\treturn;\n\t\t}\n\t\t\t\t\n\t\tif(car.carData.to == null) {\n\t\t\tHouseData nextHouseToGo = car.drivingInfo.pathToGet.remove(0);\n\t\t\tcar.carData.to = nextHouseToGo;\n\t\t}\n\t\t\n\t\tint distanceDone = car.carData.distance;\n\t\tint distanceToDo = (int) SmaUtils.computeDistance(car.carData.from.position, car.carData.to.position);\n\t\t\n\t\t// if the distance left is higher than the distance the car can do in one tick, we increment the distance\n\t\tif(distanceDone+Car.CAR_SPEED < distanceToDo) {\n\t\t\tcar.carData.distance += Car.CAR_SPEED;\n\t\t\treturn;\n\t\t} \n\t\t// else, we put the car on the next house\n\t\telse if(distanceDone <= distanceToDo) {\n\t\t\tcar.carData.from = car.carData.to;\n\t\t\tcar.carData.to = null;\n\t\t\tcar.carData.distance = 0;\n\t\t\treturn;\n\t\t}\n\t}", "private void startGame()\n {\n if (heroPlayer != null && antagonistPlayer != null && location != null && currentPlayerName != \"null\")\n {\n gameStarted = true;\n }\n }", "@Override\n public void placeRoad(EdgeLocation edge) throws ModelException {\n assert edge != null;\n\n if (!GameModelFacade.instance().canPlaceRoad(edge)) {\n throw new ModelException(\"Preconditions for action not met.\");\n }\n\n try {\n String clientModel = m_theProxy.buildRoad(GameModelFacade.instance().getLocalPlayer().getIndex(), edge, GameModelFacade.instance().isFreeRound());\n new ModelInitializer().initializeClientModel(clientModel, m_theProxy.getPlayerId());\n } catch (NetworkException e) {\n throw new ModelException(e);\n }\n }", "public void boardPassenger(int floor){\n _passengersOnboard +=1;\n switch(floor){\n case 1: Floor.FIRST.makeDestinationRequest();\n Floor.FIRST.addQueuedPassenger();\n break;\n case 2: Floor.SECOND.makeDestinationRequest();\n Floor.SECOND.addQueuedPassenger();\n break;\n case 3: Floor.THIRD.makeDestinationRequest();\n Floor.THIRD.addQueuedPassenger();\n break;\n case 4: Floor.FOURTH.makeDestinationRequest();\n Floor.FOURTH.addQueuedPassenger();\n break;\n case 5: Floor.FIFTH.makeDestinationRequest();\n Floor.FIFTH.addQueuedPassenger();\n break;\n case 6: Floor.SIXTH.makeDestinationRequest();\n Floor.SIXTH.addQueuedPassenger();\n break;\n case 7: Floor.SEVENTH.makeDestinationRequest();\n Floor.SEVENTH.addQueuedPassenger();\n break;\n }\n }", "public void makeMove() {\n ArrayList<Field> myFields = new ArrayList<>();\n for (Field[] fieldsRow : fields) {\n for (Field field : fieldsRow) {\n if(field != null && this.equals(field.getPlayer())) {\n myFields.add(field);\n }\n }\n }\n bestMove[0] = myFields.get(0);\n bestMove[1] = myFields.get(0);\n\n Random rand = new Random();\n for(Field destination : destinationFields) {\n if(canMove()) break;\n destinationField = destination;\n for (Field origin : myFields) {\n for(int i = 0; i < origin.getNeighbours().length; ++i) {\n Field neighbour = origin.getNeighbours()[i];\n if(neighbour != null) {\n if(neighbour.getPlayer() == null) {\n if(valueOfMove(origin, neighbour) > valueOfMove(bestMove[0], bestMove[1])) {\n bestMove[0] = origin;\n bestMove[1] = neighbour;\n } else if(valueOfMove(origin, neighbour) == valueOfMove(bestMove[0], bestMove[1])) {\n if(rand.nextBoolean()) {\n bestMove[0] = origin;\n bestMove[1] = neighbour;\n }\n }\n } else {\n Field nextField = neighbour.getNeighbours()[i];\n if(nextField != null) {\n correctJumpPaths(origin,null, origin);\n }\n }\n }\n }\n }\n }\n }", "public void startRide() {\n\t\tthis.findNearestDriver();\n\t\tint i = 0;\n\t\tthis.currentDriver = this.drivers.get(i);\n\t\twhile(currentDriver.getStatus() != Status.AVAILABLE) {\n\t\t\ti++;\n\t\t\tthis.currentDriver = this.drivers.get(i);\n\t\t}\n\t\tdouble fair = this.getFair(this.currentDriver.getDistanceFromPassenger());\n\t\tif(this.validateFair(fair)) {\n\t\t\tthis.currentDriver.setStatus(Status.ENROUTE);\n\t\t\tthis.currentDriver.setStatus(Status.ARRIVED);\n\t\t\tthis.startTransit();\n\t\t}\n\t}", "private void checkTurns(int i) {\n Random r = new Random();\n Road road = roads.get(i);\n if (road.vehiclesOffRoad.size() > 0) {\n for (int n = 0; n < road.vehiclesOffRoad.size(); n++) {\n int ref;\n int speed = road.vehiclesOffRoad.get(n).getSpeed();\n String type = road.vehiclesOffRoad.get(n).getType();\n\n if (road.connectedRoads.size() == 3) {\n int j = r.nextInt(3);\n if (isEmpty(road.connectedRoads.get(j),\n road.vehiclesOffRoad.get(n).getLength())) {\n ref = road.connectedRoads.get(j);\n addVehicle(type, speed, ref);\n road.vehicles.remove(n);\n\n } else road.vehicles.get(n).setPos(road.getRoadEnd());\n\n } else if (road.connectedRoads.size() == 2) {\n int j = r.nextInt(2);\n if (isEmpty(road.connectedRoads.get(j),\n road.vehiclesOffRoad.get(n).getLength())) {\n ref = road.connectedRoads.get(j);\n addVehicle(type, speed, ref);\n road.vehicles.remove(n);\n } else road.vehicles.get(0).setPos(road.getRoadEnd());\n\n } else if (road.connectedRoads.size() == 1) {\n if (isEmpty(road.connectedRoads.get(0),\n road.vehiclesOffRoad.get(n).getLength())) {\n\n ref = road.connectedRoads.get(n);\n addVehicle(type, speed, ref);\n road.vehicles.remove(n);\n } else road.vehicles.get(0).setPos(road.getRoadEnd());\n } else if (road.connectedRoads.size() == 0) {\n road.vehicles.remove(n);\n road.reset_offRoad();\n }\n\n\n }\n }\n road.reset_offRoad();\n\n }", "public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\r\n System.out.println(\"How many roads?\");\r\n int roadSpawns = scanner.nextInt();\r\n System.out.println(\"How many cars?\");\r\n int carSpawns = scanner.nextInt();\r\n // Store adjacent paths\r\n List<String> connectedRoad = new ArrayList<>();\r\n List<TrafficLight> lights = new ArrayList<>();\r\n\r\n //Create objects:\r\n System.out.println(\"Object Creation:\\n---------------------\");\r\n System.out.println(\"Roads:\");\r\n ArrayList<Road> roads = new ArrayList<>();\r\n for (int i = 0; i < roadSpawns; i++) {\r\n System.out.println(\"Please input parameters for road_\" + i + \"...\");\r\n System.out.print(\"Length:\");\r\n int lengthInput = scanner.nextInt();\r\n int speedLimitInput = (new Random()).nextInt(11);\r\n roads.add(new Road(Integer.toString(i), speedLimitInput, lengthInput, new int[]{0, 0}));\r\n System.out.println(\"Please input connected roads of road_\" + i + \"...(like:0,1,2...)\");\r\n String infos = scanner.next();\r\n connectedRoad.add(infos);\r\n }\r\n System.out.println(\"\\nRoads;\");\r\n for (Road road : roads) {\r\n road.printRoadInfo();\r\n }\r\n\r\n // Set up TrafficLight at road junctions\r\n for (int i = 0; i < connectedRoad.size(); i++) {\r\n TrafficLight trafficLight = null;\r\n if (roads.get(i).getLightsOnRoad().size() > 0) trafficLight = roads.get(i).getLightsOnRoad().get(0);\r\n else {\r\n long currentTime = new Date().getTime();\r\n trafficLight = new TrafficLight(String.valueOf(currentTime), roads.get(i));\r\n roads.get(i).addTrafficLight(trafficLight);\r\n lights.add(trafficLight);\r\n }\r\n for (String s : connectedRoad.get(i).split(\",\")) {\r\n roads.get(i).addConnectRoad(roads.get(Integer.parseInt(s)));\r\n if (roads.get(Integer.parseInt(s)).getLightsOnRoad().size() > 0) continue;\r\n else roads.get(Integer.parseInt(s)).addTrafficLight(trafficLight);\r\n }\r\n }\r\n\r\n System.out.println(\"\\nCars;\");\r\n ArrayList<Car> cars = new ArrayList<>();\r\n for (int i = 0; i < carSpawns; i++) {\r\n // random add bus or motorbke\r\n if ((new Random()).nextInt(10) <= 5) {\r\n cars.add(new Bus(Integer.toString(i), roads.get(0)));\r\n } else {\r\n cars.add(new Motorbike(Integer.toString(i), roads.get(0)));\r\n }\r\n cars.get(i).printCarStatus();\r\n }\r\n\r\n // Let car run\r\n int time = 0;\r\n System.out.print(\"\\nSet time scale in milliseconds:\");\r\n int maxtime = scanner.nextInt();\r\n while (true) {\r\n // change trafficlight state\r\n for (TrafficLight light : lights) {\r\n light.chageState();\r\n }\r\n for (Car car : cars) {\r\n car.move();\r\n car.printCarStatus();\r\n }\r\n time = time + 1;\r\n System.out.println(time + \" Seconds have passed.\\n\");\r\n if (time >= maxtime) {\r\n System.out.println(\"timeout\");\r\n break;\r\n }\r\n }\r\n }", "public void run() {\n \t\t\t\t\tPerformTransition.transition(am, MatchState.LOSERS, am.getResult().getLosers(), false);\n \t\t\t\t\tif (victor != null) /// everyone died at once??\n \t\t\t\t\t\tPerformTransition.transition(am, MatchState.WINNER, victor, false);\n \t\t\t\t\tarenaInterface.onComplete();\n \t\t\t\t\tnotifyListeners(new MatchCompletedEvent(am));\n \t\t\t\t\tupdateBukkitEvents(MatchState.ONCOMPLETE);\n \t\t\t\t\tdeconstruct();\t\n \t\t\t\t}", "@Override\n public void landedOn(Player player) {}", "@Override\n\tpublic Direction nextMove(State state)\n\t{\n\t\t\n\t\tthis.direction = Direction.STAY;\n\t\tthis.hero = state.hero();\n\t\tthis.position = new Point( this.hero.position.right, this.hero.position.left ); //x and y are reversed, really\n\t\t\n\t\tthis.pathMap = new PathMap( state, this.position.x, this.position.y );\n\n\t\t//find the richest hero\n\t\tHero richestHero = state.game.heroes.get(0);\n\t\tif( richestHero == this.hero ) { richestHero = state.game.heroes.get(1); } //just grab another hero if we are #0\n\t\t\n\t\tfor( Hero hero : state.game.heroes )\n\t\t{\n\t\t\tif( hero != this.hero && hero.gold > richestHero.gold )\n\t\t\t{\n\t\t\t\trichestHero = hero;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//get all interesting sites\n\t\tList<TileInfo> minesInRange = this.pathMap.getSitesInRange( TileType.FREE_MINE, 20 );\t//mines in vicinity\n\t\tList<TileInfo> takenMinesInRange = this.pathMap.getSitesInRange( TileType.TAKEN_MINE, (100-richestHero.life)/2 );\t//mines in vicinity\n\t\tList<TileInfo> pubsInRange = this.pathMap.getSitesInRange( TileType.TAVERN, (int)(Math.pow(100-this.hero.life,2)*state.game.board.size/5000) );\t\t//pubs in vicinity\n\t\t\n\t\t//first visit pubs (apparently we need it)\n\t\tif( pubsInRange.size() != 0 )\n\t\t{\n\t\t\tthis.direction = this.pathMap.getDirectionTo( pubsInRange.get(0) );\n\t\t}\n\t\t\n\t\t//then visit the mines\n\t\telse if( minesInRange.size() != 0 )\n\t\t{\n\t\t\tthis.direction = this.pathMap.getDirectionTo( minesInRange.get(0) );\n\t\t}\n\t\t\n\t\t//then visit taken mines\n\t\telse if( takenMinesInRange.size() != 0 )\n\t\t{\n\t\t\tthis.direction = this.pathMap.getDirectionTo( takenMinesInRange.get(0) );\n\t\t}\n\t\t\n\t\t//then hunt for players\n\t\telse\n\t\t{\n\t\t\t//kill the richest hero! (but first full health)\n\t\t\tif( this.hero.life > 85 )\n\t\t\t{\n\t\t\t\tthis.direction = this.pathMap.getDirectionTo( richestHero.position.right, richestHero.position.left );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//run away!!!\n\t\t\t\tthis.direction = intToDir( (int)(Math.random()*4) );\n\t\t\t}\n\t\t}\n\t\t\n\t\t//VisualPathMap.getInstance( pathMap );\n\t\t\n\t\treturn this.direction;\n\t}", "@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n if(resultCode == Activity.RESULT_OK) {\n try {\n if(requestCode == CREATE_WAYPOINT_REQUEST) {\n Bundle extras = data.getExtras();\n String descText = data.getStringExtra(\"DESC_TEXT\");\n String[] images = data.getStringArrayExtra(\"IMAGES_LIST\");\n\n Waypoint waypoint = new Waypoint(currentRoute.getId());\n waypoint.setDescription(descText);\n waypoint.setPhoto(images);\n waypoint.setTimestamp(System.currentTimeMillis());\n waypoint.setLat(this.lat);\n waypoint.setLng(this.lng);\n /*\n GPS CODE - OR getLastKnownPosition()\n */\n\n\n DatabaseHandler bhhandle = new DatabaseHandler(this.getApplicationContext());\n bhhandle.addWaypoint(waypoint);\n\n\n //Toast.makeText(this.getApplicationContext(),descText,1000);\n //STORE IN DATABASE\n //SEND TO SERVER\n //SUMMON CTHULHU\n } else if (requestCode == CREATE_WALK_REQUEST) {\n\t /*Handle the new route*/\n\t Bundle extras = data.getExtras();\n\t\n\t String shortDes = data.getStringExtra(\"SHORT_STRING\");\n\t String longDes = data.getStringExtra(\"LONG_STRING\");\n\t String title = data.getStringExtra(\"TITLE_STRING\");\n\t\n\t this.currentRoute = new Route(title,shortDes,longDes);\n\t\n\t DatabaseHandler db = new DatabaseHandler(this.getApplicationContext());\n\t currentRoute.setId(db.addRoute(currentRoute));\n\t TextView label = (TextView) findViewById(R.id.txtTourRunning);\n\t label.setText(\"Current Tour: \" + currentRoute.getTitle());\n\t\n\t if(currentRoute.getId() <= 0) {\n\t Toast.makeText(MainActivity.this,\"Database Write Failure\", Toast.LENGTH_LONG).show();\n } else {\n \t\n \t}\n \t}\n \t} catch (NullPointerException e) {\n Toast.makeText(MainActivity.this, \"Something bad happened\", Toast.LENGTH_LONG).show();\n }\n }\n }", "private void drawRoutes () {\n // Lay ngay cua tour\n Date tourDate = OnlineManager.getInstance().mTourList.get(tourOrder).getmDate();\n // Kiem tra xem ngay dien ra tour la truoc hay sau hom nay. 0: hom nay, 1: sau, -1: truoc\n int dateEqual = Tour.afterToday(tourDate);\n // Kiem tra xem tour da dien ra chua\n if (dateEqual == -1) {\n // Tour da dien ra, khong ve gi ca\n } else if (dateEqual == 1) {\n // Tour chua dien ra, khong ve gi ca\n } else {\n // Tour dang dien ra thi kiem tra gio\n /* Chang sap toi mau do, today nam trong khoang src start va src end\n Chang dang di chuyen mau xanh, today nam trong khoang src end va dst start\n Chang vua di qua mau xam, today nam trong khoang dst start va dst end */\n ArrayList<TourTimesheet> timesheets = OnlineManager.getInstance().mTourList.get(tourOrder).getmTourTimesheet();\n // Danh dau chang dang di qua\n int changDangDiQuaOrder = -1;\n // Danh dau chang sap di qua\n int changSapDiQuaOrder = -1;\n if(Tour.afterCurrentHour(timesheets.get(0).getmStartTime()) == 1){\n // Chang sap di qua mau do\n // Neu chua ve chang sap di, ve duong mau do\n if (timesheets.size() >= 2) {\n drawRoute(Color.RED, timesheets.get(0).getmBuildingLocation(), timesheets.get(1).getmBuildingLocation());\n }\n } else {\n for (int i = 0; i < timesheets.size() - 1; i++) {\n // Kiem tra xem chang hien tai la truoc hay sau gio nay. 0: gio nay, 1: gio sau, -1: gio truoc\n int srcStartEqual = Tour.afterCurrentHour(timesheets.get(i).getmStartTime());\n int srcEndEqual = Tour.afterCurrentHour(timesheets.get(i).getmEndTime());\n int dstStartEqual = Tour.afterCurrentHour(timesheets.get(i + 1).getmStartTime());\n // 2 vi tri chang\n LatLng srcLocation = timesheets.get(i).getmBuildingLocation();\n LatLng dstLocation = timesheets.get(i + 1).getmBuildingLocation();\n if (srcStartEqual == -1 && srcEndEqual == 1) {\n // Chang dang di qua mau xanh\n // Neu chua ve chang dang di, ve duong mau xanh\n drawRoute(Color.BLUE, srcLocation, dstLocation);\n // Danh dau chang dang di qua\n changDangDiQuaOrder = i;\n // Thoat khoi vong lap\n break;\n } else if (srcEndEqual == -1 && dstStartEqual == 1) {\n // Chang sap toi mau do\n // Neu chua ve chang sap toi, ve duong mau do\n drawRoute(Color.RED, srcLocation, dstLocation);\n // Danh dau chang sap di qua\n changSapDiQuaOrder = i;\n // Thoat khoi vong lap\n break;\n }\n }\n }\n // Kiem tra xem da ve duoc nhung duong nao roi\n if (changDangDiQuaOrder != - 1) {\n // Neu ve duoc chang dang di qua roi thi ve tiep 2 chang con lai\n if (changDangDiQuaOrder < timesheets.size() - 2) {\n // Neu khong phai chang ket thuc thi ve tiep chang sap di qua\n // 2 vi tri chang\n LatLng srcLocation = timesheets.get(changDangDiQuaOrder + 1).getmBuildingLocation();\n LatLng dstLocation = timesheets.get(changDangDiQuaOrder + 2).getmBuildingLocation();\n drawRoute(Color.RED, srcLocation, dstLocation);\n }\n if (changDangDiQuaOrder > 0) {\n // Neu khong phai chang bat dau thi ve tiep chang da di qua\n // 2 vi tri chang\n LatLng srcLocation = timesheets.get(changDangDiQuaOrder - 1).getmBuildingLocation();\n LatLng dstLocation = timesheets.get(changDangDiQuaOrder).getmBuildingLocation();\n drawRoute(Color.GRAY, srcLocation, dstLocation);\n }\n }\n if (changSapDiQuaOrder != - 1) {\n // Neu ve duoc chang sap di qua roi thi ve tiep 2 chang con lai\n if (changSapDiQuaOrder > 0) {\n // Neu khong phai chang bat dau thi ve tiep chang dang di qua\n // 2 vi tri chang\n LatLng srcLocation = timesheets.get(changSapDiQuaOrder - 1).getmBuildingLocation();\n LatLng dstLocation = timesheets.get(changSapDiQuaOrder).getmBuildingLocation();\n drawRoute(Color.BLUE, srcLocation, dstLocation);\n }\n if (changSapDiQuaOrder > 1) {\n // Neu khong phai chang bat dau thi ve tiep chang da di qua\n // 2 vi tri chang\n LatLng srcLocation = timesheets.get(changSapDiQuaOrder - 2).getmBuildingLocation();\n LatLng dstLocation = timesheets.get(changSapDiQuaOrder - 1).getmBuildingLocation();\n drawRoute(Color.GRAY, srcLocation, dstLocation);\n }\n }\n }\n }", "public boolean plizMovePlayerForward(Player player)\n {\n\n //check if die was rolled\n if (getValue_from_die() > 0)\n {\n int x_cord = player.getX_cordinate();\n int y_cord = player.getY_cordinate();\n int steps = player.getSteps_moved();\n\n //try to get player from color home\n if (attempt2GetPlayerFromHomeSucceds(player))\n {\n return true;\n }\n\n //if player has already reached home do nothing\n if (player.getSteps_moved() >= 58)\n {\n return false;\n }\n //if player is inside home stretch he has to play exact number to go home\n else if (player.getSteps_moved() >= 52)\n {\n if (59 - player.getSteps_moved() <= value_from_die)\n {\n return false;\n }\n }\n\n //if player isnt at home move him\n if (player.getSteps_moved() > 0)\n {\n for (int i = 1; i <= (value_from_die); i++)\n {\n player.movePlayerForward();\n if (roadBlocked(player))\n {\n road_blocked = true;\n }\n player.setHas_not_been_drawn(true);\n }\n\n //roll back changes\n if (road_blocked)\n {\n player.setX_cordinate(x_cord);\n player.setY_cordinate(y_cord);\n player.setSteps_moved(steps);\n ludo.setDrawRoadBlockedSign(true);\n //println(\"ROAD BLOCKED\");\n road_blocked = false;\n return false;\n }\n playPlayerHasMovedMusic();\n //see if player eats someone\n if (getPerson_to_play() == 1)\n {\n BlueEatsPlayer(player);\n }\n else if (getPerson_to_play() == 2)\n {\n RedEatsPlayer(player);\n }\n else if (getPerson_to_play() == 3)\n {\n GreenEatsPlayer(player);\n }\n else if (getPerson_to_play() == 4)\n {\n YellowEatsPlayer(player);\n }\n if (value_from_die == 6)\n {\n resetDieScore();\n ludo.setDrawScoreAllowed(false);\n return true;\n }\n //reset variables and change person to play\n resetDieScore();\n ludo.setDrawScoreAllowed(false);\n changePersonToPlay();\n return true;\n }\n //occurs rarely at the begining of the game\n else\n {\n //println(\"steps less than 0\");\n return false;\n }\n }\n else\n {\n //println(\"PLIZ ROLL DIE FIRST THEN MOVE BUTTON\");\n return false;\n }\n }", "@Override\r\n\tpublic void onNextRoadClick() {\n\r\n\t}", "public void play() {\n List<String> playersData = getGameInput().getPlayersData();\n for (int id = 0; id < playersData.size() / Constants.DATAENTITY; id++) {\n getHeroes().add(getHeroFactory().getHero(\n playersData.get(id * Constants.DATAENTITY),\n Integer.parseInt(\n playersData.get(\n id * Constants.DATAENTITY\n + Constants.INDEXPOSX)),\n Integer.parseInt(\n playersData.get(\n id * Constants.DATAENTITY\n + Constants.INDEXPOSY)),\n id));\n }\n // We create the angels and add them to angels list.\n List<Integer> numOfAngels = getGameInput().getNumOfAngels();\n List<String> angelsData = getGameInput().getAngelsData();\n for (int i = 0; i < angelsData.size() / Constants.DATAENTITY; i++) {\n getAngels().add(getAngelsFactory().getAngel(\n angelsData.get(i * Constants.DATAENTITY),\n Integer.parseInt(\n angelsData.get(\n i * Constants.DATAENTITY\n + Constants.INDEXPOSX)),\n Integer.parseInt(\n angelsData.get(\n i * Constants.DATAENTITY\n + Constants.INDEXPOSY))));\n }\n\n getUtl().prepareAdmins();\n\n int angelCounter = 0; // To iterate through all angels only once.\n // We start the actual game.\n for (int i = 0; i < getMovements().size(); i++) { // For every round.\n\n getUtl().printRound(i + 1); // We start printing from round 1...\n\n for (int j = 0; j < getHeroes().size(); j++) {\n /* Apply overtime ability if the case and then hero chooses\n * strategy and moves if he is not rooted. Lastly we decrease\n * the amount of rounds that a hero must be affected by. */\n if (!getHeroes().get(j).isDead()) {\n if (getHeroes().get(j).isAffectedByAoT()) {\n getUtl().applyAoT(getHeroes().get(j));\n }\n if (!getHeroes().get(j).isRooted()) {\n getHeroes().get(j).chooseStrategy();\n getHeroes().get(j).move(getMovements().get(i).get(j));\n }\n if (getHeroes().get(j).isAffectedByAoT()) {\n getHeroes().get(j).setAffectedByAoTRounds(\n getHeroes().get(j).getAffectedByAoTRounds()\n - 1);\n }\n }\n }\n\n // Check if there are any players on the same terrain.\n for (int j = 0; j < getHeroes().size(); j++) {\n for (int k = 0; k < getHeroes().size(); k++) {\n if (k == j) {\n continue; // So a hero doesn't fight himself.\n }\n if ((getHeroes().get(j).getPosX()\n == getHeroes().get(k).getPosX())\n && (getHeroes().get(j).getPosY()\n == getHeroes().get(k).getPosY())) {\n // If they are both alive, fight.\n if (!getHeroes().get(j).isDead()\n && !getHeroes().get(k).isDead()) {\n getUtl().fight(getHeroes().get(k),\n getHeroes().get(j), getMap());\n }\n }\n }\n }\n\n // Selecting the angels that appear on round i\n for (int j = 0; j < numOfAngels.get(i); j++) {\n getUtl().spawnAngel(getAngels().get(angelCounter));\n for (int k = 0; k < getHeroes().size(); k++) {\n /* Checking if the selected angel and player k are on the\n * same terrain. */\n if (getAngels().get(angelCounter).getPosX()\n == getHeroes().get(k).getPosX()\n && (getAngels().get(angelCounter).getPosY()\n == getHeroes().get(k).getPosY())) {\n getUtl().affectHeroByAngel(\n getAngels().get(angelCounter),\n getHeroes().get(k));\n }\n }\n angelCounter++;\n }\n\n // When round is complete, everyone can fight again\n for (AbstractHero hero : getHeroes()) {\n hero.setFought(false);\n }\n getUtl().getOutput().add(\"\\n\");\n }\n printResults();\n }", "@Test\n\tpublic void playBuildRoadsCardFailure() throws Exception\n\t{\n\t\t// Set up variables\n\t\tEdge e1 = n.getEdges().get(0);\n\t\tint oldResources = 0;\n\n\t\t// Set up development card\n\t\tp.grantResources(DevelopmentCardType.getCardCost(), game.getBank());\n\t\tDevelopmentCardType card = DevelopmentCardType.RoadBuilding;\n\t\tp.buyDevelopmentCard(card, game.getBank());\n\n\t\t// Reset recent dev card for player, so they can play this turn\n\t\tgame.getPlayer(game.getCurrentPlayer()).clearRecentDevCards();\n\n\t\t// Grant resources and make settlement\n\t\tp.grantResources(Settlement.getSettlementCost(), game.getBank());\n\t\tp.grantResources(Road.getRoadCost(), game.getBank());\n\t\tp.grantResources(Road.getRoadCost(), game.getBank());\n\t\tmakeSettlement(p, n);\n\n\t\t// Set up Road building card request, play the card\n\t\tRequests.Request.Builder req = Requests.Request.newBuilder();\n\t\treq.setPlayDevCard(Board.PlayableDevCard.ROAD_BUILDING);\n\t\tassertEquals(0, server.getExpectedMoves(p.getColour()).size());\n\t\tserver.addMessageToProcess(\n\t\t\t\tnew ReceivedMessage(p.getColour(), Messages.Message.newBuilder().setRequest(req).build()));\n\t\tserver.processMessage();\n\t\tassertEquals(2, server.getExpectedMoves(p.getColour()).size());\n\n\t\t// Now request to build a road\n\t\treq.clearPlayDevCard();\n\t\treq.setBuildRoad(e1.toEdgeProto());\n\t\tserver.addMessageToProcess(\n\t\t\t\tnew ReceivedMessage(p.getColour(), Messages.Message.newBuilder().setRequest(req).build()));\n\t\tserver.processMessage();\n\t\tassertEquals(1, server.getExpectedMoves(p.getColour()).size());\n\t\tassertEquals(1, p.getRoads().size());\n\t\tassertTrue(p.getRoads().get(0).getEdge().equals(e1));\n\n\t\t// ATTEMPT to build road in same location\n\t\treq.setBuildRoad(e1.toEdgeProto());\n\t\tserver.addMessageToProcess(\n\t\t\t\tnew ReceivedMessage(p.getColour(), Messages.Message.newBuilder().setRequest(req).build()));\n\t\tserver.processMessage();\n\n\t\t// Assert that server is STILL expecting a new road request, & only one\n\t\t// road was built\n\t\tassertEquals(1, server.getExpectedMoves(p.getColour()).size());\n\t\tassertTrue(server.getExpectedMoves(p.getColour()).get(0).equals(Requests.Request.BodyCase.BUILDROAD));\n\t\tassertEquals(1, p.getRoads().size());\n\t}", "@Override\n\tpublic void update() {\n\t\tcanBuild = true;\n\t\tfor (Ship s : SceneManager.sm.currSector.ships) {\n\t\t\tif (!s.isPlayer) {\n\t\t\t\tif (s.cm.distanceTo(p.cm) < 2500) {\n\t\t\t\t\tcanBuild = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (SceneManager.sm.endSector.clear && SceneManager.sm.currSector.pos.isSame(SceneManager.sm.endSector.pos)) {\n\t\t\tSystem.out.println(\"Game WON\");\n\t\t\tthis.setActive(false);\n\t\t\tSceneManager.ws.setActive(true);\n\t\t}\n\t\tif (p.destroyed) {\n\t\t\tSystem.out.println(\"Game LOST\");\n\t\t\tthis.setActive(false);\n\t\t\tSceneManager.ls.setActive(true);\n\t\t}\n\n\t\tshipYard.update();\n\t\tstarMap.update();\n\n\t\t// TODO remove before flight: to draw where mouse is - temp\n\t\t// if (InputManager.mouse[2]) {\n\t\t// System.out.println(InputManager.mPos.toString());\n\t\t// }\n\n\t\tif (InputManager.keys[81])\n\t\t\tp.cmdRotate(false);\n\t\tif (InputManager.keys[69])\n\t\t\tp.cmdRotate(true);\n\t\tif (InputManager.keys[87])\n\t\t\tp.cmdMove(0, 1);\n\t\tif (InputManager.keys[83])\n\t\t\tp.cmdMove(2, 1);\n\t\tif (InputManager.keys[65])\n\t\t\tp.cmdMove(3, 1);\n\t\tif (InputManager.keys[68])\n\t\t\tp.cmdMove(1, 1);\n\t\tif (InputManager.keys[38]) {\n\t\t\tCamera.yOff += 10 * (1 / Camera.scale);\n\t\t\tcamFocus = null;\n\t\t\teyeFocused = false;\n\t\t}\n\t\tif (InputManager.keys[40]) {\n\t\t\tCamera.yOff -= 10 * (1 / Camera.scale);\n\t\t\tcamFocus = null;\n\t\t\teyeFocused = false;\n\t\t}\n\t\tif (InputManager.keys[39]) {\n\t\t\tcamFocus = null;\n\t\t\teyeFocused = false;\n\t\t\tCamera.xOff -= 10 * (1 / Camera.scale);\n\t\t}\n\t\tif (InputManager.keys[37]) {\n\t\t\tcamFocus = null;\n\t\t\teyeFocused = false;\n\t\t\tCamera.xOff += 10 * (1 / Camera.scale);\n\t\t}\n\n\t\t// key to go to build area - b\n\t\tif (canBuild && InputManager.keysReleased[66] || shipYard.clicked) {\n\t\t\tswtichToBuild();\n\t\t}\n\t\tif (InputManager.keysReleased[77] || starMap.clicked) {\n\t\t\tswtichToStarMap();\n\t\t}\n\t\t\n\t\t// key to select a ship - no use atm\n\t\tif (InputManager.mouse[1]) {\n\t\t\t//selected = SceneManager.sm.currSector.getClickShip();\n\t\t\t// now have a ship selected\n\t\t}\n\t\t\n\t\tif(InputManager.keysReleased[32]) {\n\t\t\tcamFocus = p.cm;\n\t\t}\n\n\t\t// key to move the camera to a ship or area\n\t\tif (InputManager.mouseReleased[2]) {\n\t\t\teyeFocused = false;\n\t\t\tif(SceneManager.sm.currSector.getClickShip() != null)\n\t\t\t{\n\t\t\t\tcamFocus = SceneManager.sm.currSector.getClickShip().cm;\n\t\t\t}else if(Camera.toScreen(eyeLoc).distanceTo(InputManager.mPos) < 40){\n\t\t\t\tcamFocus = eyeLoc;\n\t\t\t\teyeFocused = true;\n\t\t\t}else {\n\t\t\t\tcamFocus = Camera.toMap(InputManager.mPos.x, InputManager.mPos.y);\n\t\t\t}\n\t\t}\n\t\tif (partTarget != null && partTarget.health <= 0)\n\t\t\tpartTarget = null;\n\n\t\tif (partTarget == null && target != null)\n\t\t\tp.shoot(target);\n\n\t\tif (partTarget == null && target == null)\n\t\t\tp.ceaseFire();\n\n\t\tif (target != null && InputManager.mouseReleased[3] && !target.destroyed) {\n\t\t\tpartTarget = SceneManager.sm.currSector.getClickShipPart(target);\n\t\t\tp.shoot(partTarget);\n\t\t}\n\n\t\tif (InputManager.mouseReleased[3]) {\n\t\t\ttarget = SceneManager.sm.currSector.getClickShip();\n\t\t\tif (target != null && partTarget == null) {\n\t\t\t\tp.shoot(target);\n\t\t\t}\n\t\t}\n\t\tif (target != null && (target.destroyed || target.isPlayer)) {\n\t\t\ttarget = null;\n\t\t\tpartTarget = null;\n\t\t\tp.ceaseFire();\n\t\t}\n\n\t\tif (camFocus != null)\n\t\t\tCamera.focus(camFocus);\n\t\t// if(selected != null) selected.vel.print();\n\n\t\tSceneManager.sm.currSector.update();\n\t}", "boolean CanUseRoadBuilder(EdgeLocation spot1, EdgeLocation spot2);", "private Road()\n\t{\n\t\t\n\t}", "static private void npcPath() {\n\n if (Time.secondsPassed % 45 == 44) {\n Random picker = new Random();\n while (true) {\n if (josephSchnitzel.getCurrentRoom().equals(mountain)) {\n String[] newRoomString = {\"south\"};\n int index = picker.nextInt(newRoomString.length);\n Room next = josephSchnitzel.getCurrentRoom().getExit(newRoomString[index]);\n josephSchnitzel.setCurrentRoom(next);\n break;\n }\n\n if (josephSchnitzel.getCurrentRoom().equals(beach)) {\n String[] newRoomString = {\"north\"};\n int indexOfNewRoomString = picker.nextInt(newRoomString.length);\n Room nextRoom = josephSchnitzel.getCurrentRoom().getExit(newRoomString[indexOfNewRoomString]);\n josephSchnitzel.setCurrentRoom(nextRoom);\n break;\n }\n\n if (josephSchnitzel.getCurrentRoom().equals(jungle)) {\n String[] newRoomString = {\"north\", \"south\"};\n int indexOfNewRoomString = picker.nextInt(newRoomString.length);\n Room nextRoom = josephSchnitzel.getCurrentRoom().getExit(newRoomString[indexOfNewRoomString]);\n josephSchnitzel.setCurrentRoom(nextRoom);\n break;\n }\n }\n }\n }", "@Override\n\t\t\t\tpublic void notifyParallelRoad(int arg0) {\n\t\t\t\t\t\n\t\t\t\t}", "private void suarez() {\n\t\ttry {\n\t\t\tThread.sleep(5000); // espera, para dar tempo de ver as mensagens iniciais\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tint xInit = -10;\n\t\tint yInit = 8;\n\t\tplayerDeafaultPosition = new Vector2D(xInit*selfPerception.getSide().value(), yInit*selfPerception.getSide().value());\n\t\twhile (commander.isActive()) {\n\t\t\t\n\t\t\tupdatePerceptions(); // deixar aqui, no começo do loop, para ler o resultado do 'move'\n\t\t\tswitch (matchPerception.getState()) {\n\t\t\tcase BEFORE_KICK_OFF:\n\t\t\t\tcommander.doMoveBlocking(xInit, yInit);\t\t\t\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase PLAY_ON:\n\t\t\t\t//state = State.FOLLOW;\n\t\t\t\texecuteStateMachine();\n\t\t\t\tbreak;\n\t\t\tcase KICK_OFF_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase KICK_OFF_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CORNER_KICK_LEFT: // escanteio time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CORNER_KICK_RIGHT: // escanteio time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase KICK_IN_LEFT: // lateral time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\tcase KICK_IN_RIGHT: // lateal time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_LEFT: // Tiro livre time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_RIGHT: // Tiro Livre time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_FAULT_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_FAULT_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase GOAL_KICK_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase GOAL_KICK_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase AFTER_GOAL_LEFT:\n\t\t\t\tcommander.doMoveBlocking(xInit, yInit);\n\t\t\t\tbreak;\n\t\t\tcase AFTER_GOAL_RIGHT:\n\t\t\t\tcommander.doMoveBlocking(xInit, yInit);\n\t\t\t\tbreak;\n\t\t\tcase INDIRECT_FREE_KICK_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase INDIRECT_FREE_KICK_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\t}", "public boolean affordRoad() {\n \t\treturn (FREE_BUILD || roads.size() < MAX_ROADS\n \t\t\t\t&& getResources(Type.BRICK) >= 1\n \t\t\t\t&& getResources(Type.LUMBER) >= 1);\n \t}", "static void archon() throws GameActionException {\n \tboolean isFirstArchon = true;\n \tMapLocation homeBase = robot.getLocation();\n\t\tSignal[] signals = robot.emptySignalQueue();\n\t\tfor (Signal signal : signals)\n\t\t\tif (signal.getTeam() == robot.getTeam())\n\t\t\t\tif (signal.getMessage()[0] == SUMMON_ARCHONS) {\n\t\t\t\t\tint x = signal.getMessage()[1] >> 16;\n\t\t\t\t\tint y = signal.getMessage()[1] & 0xFFFF;\n\t\t\t\t\tisFirstArchon = false;\n\t\t\t\t\thomeBase = new MapLocation(x, y);\n\t\t\t\t}\n\t\t\n\t\tif (isFirstArchon) {\n\t\t\tint value = (homeBase.x << 16) | homeBase.y;\n\t\t\trobot.broadcastMessageSignal(SUMMON_ARCHONS, value, 1000);\n\t\t\tfor (Direction dir : oddDirection) {\n\t\t\t\twhile (!robot.isCoreReady())\n\t\t\t\t\tClock.yield();\n\t\t\t\twhile (!robot.hasBuildRequirements(RobotType.TURRET))\n\t\t\t\t\tClock.yield();\n\t\t\t\tif (robot.canBuild(dir, RobotType.TURRET)) {\n\t\t\t\t\trobot.build(dir, RobotType.TURRET);\n\t\t\t\t\tClock.yield();\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tint attempts = 0;\n\t\t\tMapLocation current = robot.getLocation();\n\t\t\twhile (9 < current.distanceSquaredTo(homeBase) && attempts < 50) {\n\t\t\t\twhile (!robot.isCoreReady())\n\t\t\t\t\tClock.yield();\n\t\t\t\ttryMove(current.directionTo(homeBase));\n\t\t\t\tcurrent = robot.getLocation();\n\t\t\t\tClock.yield();\n\t\t\t\tattempts++;\n\t\t\t}\n\t\t\twhile (((current.x - homeBase.x) + (current.y - homeBase.y)) % 2 != 0) {\n\t\t\t\twhile (!robot.isCoreReady())\n\t\t\t\t\tClock.yield();\n\t\t\t\ttryMove(evenDirection[random.nextInt(4)]);\n\t\t\t\tcurrent = robot.getLocation();\n\t\t\t\tClock.yield();\n\t\t\t}\n\t\t}\n\t\t\n\t\twhile (true) {\n\t\t\tif (robot.isCoreReady()) {\n\t\t\t\tif (random.nextDouble() < 0.33 && robot.hasBuildRequirements(RobotType.TURRET)) {\n\t\t\t\t\tdouble rnd = random.nextDouble();\n\t\t\t\t\tDirection dir = evenDirection[random.nextInt(4)];\n\t\t\t\t\tif (rnd < 0.6) {\n\t\t\t\t\t\tif (robot.canBuild(dir, RobotType.TURRET)) {\n\t\t\t\t\t\t\trobot.build(dir, RobotType.TURRET);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (robot.canBuild(dir, RobotType.SCOUT)) {\n\t\t\t\t\t\t\trobot.build(dir, RobotType.SCOUT);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tClock.yield();\n\t\t\t\t}\n\t\t\t}\n\t\t\tClock.yield();\n\t\t}\n }", "public void doAi(){\n\t\t\tif(MathHelper.getRandom(0, Game.FRAMERATE * 5) == 5){\n\t\t\t\tsetScared(true);\n\t\t\t}\n\t\t\n\t\t//Update rectangle\n\t\tsetRectangle(getX(), getY(), getTexture().getWidth(), getTexture().getHeight());\n\t\t\n\t\trect = new Rectangle(getDestinationX(), getDestinationY(), 10, 10);\n\t\t\n\t\tif(rect.intersects(getRectangle())){\n\t\t\t\n\t\t\tif(StateManager.getState() == StateManager.STATE_BOSSTWO){\n\t\t\t\t\n\t\t\t\t\tsetDestinationX(StateGame.player.getX());\n\t\t\t\t\t\n\t\t\t\t\tsetDestinationY(StateGame.player.getY());\n\t\t\t\t\t\n\t\t\t\t\trect = new Rectangle(getDestinationX(), getDestinationY(), 10, 10);\n\t\t\t\t\treachedDestination = (true);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Check for collision with jelly\n\t\tint checkedJelly = (0);\n\t\twhile(checkedJelly < EntityJelly.JELLY.size() && EntityJelly.JELLY.get(checkedJelly) != null){\n\t\t\tif(EntityJelly.JELLY.get(checkedJelly).getDead() == false){\n\t\t\t\tif(getRectangle().intersects(EntityJelly.JELLY.get(checkedJelly).getRectangle())){\n\t\t\t\t\tsetHealth(getHealth() - 2);\n\t\t\t\t\tif(MathHelper.getRandom(1, 10) == 10){\n\t\t\t\t\tAnnouncer.addAnnouncement(\"-2\", 60, EntityJelly.JELLY.get(checkedJelly).getX(), EntityJelly.JELLY.get(checkedJelly).getY());\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t\tcheckedJelly++;\n\t\t}\n\t\t\n\t\t//If we're out of health, kill the entity\n\t\tif(getHealth() < 0){\n\t\t\tsetDead(true);\n\t\t}\n\t\t\n\t\tif(StateManager.getState() == StateManager.STATE_BOSSTWO){\n\t\t\tif(reachedDestination == true){\n\t\t\t\tif(getScared() == false){\n\t\t\t\tsetY(getY() + getSpeed());\n\t\t\t\t}else{\n\t\t\t\t\tsetY(getY() - getSpeed() * 3);\n\t\t\t\t\tsetX(getX() - getSpeed() * 3);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tif(getScared() == false){\n\t\t\t\tif(getX() < getDestinationX())\n\t\t\t\t\tsetX(getX() + getSpeed());\n\t\t\t\tif(getX() > getDestinationX())\n\t\t\t\t\tsetX(getX() - getSpeed());\n\t\t\t\tif(getY() < getDestinationY())\n\t\t\t\t\tsetY(getY() + getSpeed());\n\t\t\t\tif(getY() > getDestinationY())\n\t\t\t\t\tsetY(getY() - getSpeed());\n\t\t\t\t}else{\n\t\t\t\t\t\tsetY(getY() - getSpeed() * 3);\n\t\t\t\t\t\tsetX(getX() - getSpeed() * 3);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public synchronized void follow(Vehicle vehicle){\n \n distance = distance - (float)((float)vehicle.getCurrentSpeed()*1000f/3600f)/100f;\n \n //System.out.println(\"Distance to drive: \" + distance);\n if (distance <= 0){\n \n Settings.messageLog.AddMessage(\"Reached end of path\");\n //System.out.println(\"weg.size() == \" + weg.size());\n try{\n vehicle.setPosition(weg.get(weg.size()-1));\n }\n catch(Exception e){vehicle.setPosition(new Vector3f(10.3f, 5.5f, 156.2f));}\n vehicle.stopDriving();\n if (destinationPlatform == null && destinationParkingSpot == null){}\n else if (destinationParkingSpot == null){\n //motionpath from waypoint to platform\n //platform sign in\n vehicle.setCurrentPlatform(destinationPlatform);\n \n } //meldt aan voor platform nieuwe route\n else {\n \n //motionpath from waypoint to parkingspot\n if (destinationPlatform == null)\n {\n try\n {\n this.destinationParkingSpot.ParkVehicle(vehicle);\n vehicle.setPosition(this.destinationParkingSpot.getPosition());\n Settings.messageLog.AddMessage(\"Park vehicle\");\n }\n catch(Exception e)\n {\n \n ErrorLog.logMsg(e.getMessage());\n }\n \n }\n \n //hier kraan geparkeerd ... ga unload\n try\n {\n this.destinationParkingSpot.ParkVehicle(vehicle);\n vehicle.setPosition(this.destinationParkingSpot.getPosition());\n }\n catch(InvalidVehicleException ie)\n {\n System.out.println(ie.getMessage());\n \n }\n\n }\n \n }\n }", "public void setStartConditions() {\r\n\t\tplayer1.relocate(0, 0);\r\n\t\tgamemap.setPlayerLocation(1, 1);\r\n\t\tgamemap.setEnemyLocation(20, 10);\r\n\t\tenemy1.relocate(19*46, 9*85);\r\n\t\tportal1.relocate(9*46, 9*85);\r\n\t\tportal2.relocate(9*46, 0*85);\r\n\t\tspikes1.relocate(5*46,0*85);\r\n\t\tspikes2.relocate(5*46,1*85);\r\n\t\tspikes3.relocate(5*46,2*85);\r\n\t\tspikes4.relocate(5*46,7*85);\r\n\t\tspikes5.relocate(5*46,8*85);\r\n\t\tspikes6.relocate(5*46,9*85);\r\n\t\tspikes7.relocate(10*46,2*85);\r\n\t\tspikes8.relocate(10*46,3*85);\r\n\t\tspikes9.relocate(10*46,4*85);\r\n\t\tspikes10.relocate(10*46,5*85);\r\n\t\tspikes11.relocate(10*46,6*85);\r\n\t\tspikes12.relocate(10*46,7*85);\r\n\t\tspikes13.relocate(15*46,0*85);\r\n\t\tspikes14.relocate(15*46,1*85);\r\n\t\tspikes15.relocate(15*46,2*85);\r\n\t\tspikes16.relocate(15*46,7*85);\r\n\t\tspikes16.relocate(15*46,8*85);\r\n\t\tspikes17.relocate(15*46,9*85);\r\n\t\tRandom randomObj = new Random();\r\n\t\tint randomX = randomObj.nextInt(20);\r\n\t\tint randomY = randomObj.nextInt(10);\r\n\t\tcoins1.relocate(randomX*46, randomY*85);\r\n\t\tgamemap.setLootLocation(randomX + 1, randomY + 1);\r\n\t\t//coins1.relocate(10*46,5*85);\r\n\t\t//gamemap.setLootLocation(11, 6);\r\n\t}", "private void prepare()\n {\n addObject(player,185,196);\n player.setLocation(71,271);\n Ground ground = new Ground();\n addObject(ground,300,360);\n invent invent = new invent();\n addObject(invent,300,375);\n }", "private void startMapCreater() {\n\t\tNavigator navi = new Navigator(pilot);\n\t\tnavi.addWaypoint(0,0);\n\t\tnavi.addWaypoint(0,5000);\n\t\tBehavior forward = new Forward(navi);\n\t\tBehavior ultrasonic = new UltrasonicSensor(ultrasonicSensorAdaptor,pilot, sonicWheel,dis,dos,navi);\n\t\tBehavior stopEverything = new StopRobot(Button.ESCAPE);\n\t\tBehavior[] behaiverArray = {forward, ultrasonic, stopEverything};\n\t\tarb = new Arbitrator(behaiverArray);\n\t\t\n\t arb.go();\n\t\t\n\t}", "public void drawMap() {\n\t\tRoad[] roads = map.getRoads();\r\n\t\tfor (Road r : roads) {\r\n\t\t\tif (r.turn) {\r\n\t\t\t\tcity_squares[r.location.y][r.location.x].oneway_road = true;\r\n\t\t\t\tcity_squares[r.location.y][r.location.x].oneway_road_vert = true;\r\n\t\t\t} else if (r.direction == Direction.NORTH)\r\n\t\t\t\tcity_squares[r.location.y][r.location.x].oneway_road_north = true;\r\n\t\t\telse if (r.direction == Direction.SOUTH)\r\n\t\t\t\tcity_squares[r.location.y][r.location.x].oneway_road_south = true;\r\n\t\t\telse if (r.direction == Direction.WEST)\r\n\t\t\t\tcity_squares[r.location.y][r.location.x].oneway_road_west = true;\r\n\t\t\telse if (r.direction == Direction.EAST)\r\n\t\t\t\tcity_squares[r.location.y][r.location.x].oneway_road_east = true;\r\n\t\t\ttry {\r\n\t\t\t\tcity_squares[r.location.y][r.location.x].updateImage();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n public void ready() {\n Entity en = ce();\n\n if ((en instanceof Dropship) && !en.isAirborne()) {\n ArrayList<Coords> crushedBuildingLocs = new ArrayList<Coords>();\n ArrayList<Coords> secondaryPositions = new ArrayList<Coords>();\n secondaryPositions.add(en.getPosition());\n for (int dir = 0; dir < 6; dir++) {\n secondaryPositions.add(en.getPosition().translated(dir));\n }\n for (Coords pos : secondaryPositions) {\n Building bld = clientgui.getClient().getGame().getBoard()\n .getBuildingAt(pos);\n if (bld != null) {\n crushedBuildingLocs.add(pos);\n }\n }\n if (!crushedBuildingLocs.isEmpty()) {\n JOptionPane\n .showMessageDialog(\n clientgui,\n Messages.getString(\"DeploymentDisplay.dropshipBuildingDeploy\"), //$NON-NLS-1$\n Messages.getString(\"DeploymentDisplay.alertDialog.title\"), //$NON-NLS-1$\n JOptionPane.ERROR_MESSAGE);\n return;\n }\n }\n\n disableButtons();\n\n clientgui.getClient().deploy(cen, en.getPosition(), en.getFacing(),\n en.getElevation(), en.getLoadedUnits(), assaultDropPreference);\n en.setDeployed(true);\n\n if (ce().isWeapOrderChanged()) {\n clientgui.getClient().sendEntityWeaponOrderUpdate(ce());\n }\n endMyTurn();\n }", "private void resumeRoadView() {\n m_map.setCenter(PositioningManager.getInstance().getPosition().getCoordinate(), Map\n .Animation.BOW, m_lastZoomLevelInRoadViewMode, Map.MOVE_PRESERVE_ORIENTATION,\n 80);\n // do not start RoadView and its listener until the map movement is complete.\n m_returningToRoadViewMode = true;\n }", "@Override\n public void onLongPress(MotionEvent event) { Place a new Route Point\n //\n switch (event.getActionMasked())\n {\n case MotionEvent.ACTION_DOWN:\n {\n //Log.i(\"onLongPress\", \"This is a onLongPress (ACTION_DOWN) event...\");\n if (routeVisuals.selectedWaypoint != null) {\n movingRoutePoint = true;\n placingRoutePoint = false;\n }\n else {\n placingRoutePoint = true;\n movingRoutePoint = false;\n }\n\n super.getLocationForPoint(new PointF(event.getX(), event.getY()), new LocationReceiver() {\n @Override\n public void receiveLocation(Location location) {\n if (!movingRoutePoint) {\n Log.w(\"onLongPress\", \"lon:\" + location.longitude + \" lat:\" + location.latitude);\n Coordinate c = new Coordinate(location.longitude, location.latitude);\n WithinAirspaceCheck check = new WithinAirspaceCheck(MyMapView.this.context, c);\n check.SetOnFoundAirspace(new WithinAirspaceCheck.OnFoundAirspace() {\n @Override\n public void OnFoundAirspace(Airspace airspace) {\n Log.i(TAG, \"Found: \" + airspace.Name);\n if (onFoundAirspace != null)\n onFoundAirspace.OnFoundAirspace(airspace);\n }\n\n @Override\n public void OnFoundAllAirspaces(Airspaces airspaces) {\n Log.i(TAG, \"Total airspaces : \" + airspaces.size());\n if (onFoundAirspace != null)\n onFoundAirspace.OnFoundAllAirspaces(airspaces);\n }\n });\n\n\n check.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);\n }\n\n }\n });\n\n break;\n }\n }\n\n// super.getLocationForPoint(new PointF(event.getX(), event.getY()), new ConvertPointCallback(){\n// @Override\n// public void convertComplete(Location loc) {\n// //Log.w(\"onLongPress\", \"lon:\" + loc.longitude + \" lat:\" + loc.latitude);\n//\n// if (placingRoutePoint) {\n// String name = loc.longitude + \",\" + loc.latitude;\n// routeVisuals.AddWaypoint(name, loc);\n//\n// //placingRoutePoint = false;\n// movingRoutePoint = true;\n// // insert the new point\n//\n// }\n//\n//\n// }});\n\n super.onLongPress(event);\n }", "void scheduleNextDestination(Passenger passenger, Floor currentFloor);", "public void makeMove(Location loc)\n {\n \tLocation curLoc = getLocation();\n \tint curDirection = getDirection();\n // get 2 left locations\n\t\tLocation leftNeighborLoc = curLoc.getAdjacentLocation(curDirection + Location.LEFT);\n Location leftNextNeighborLoc = leftNeighborLoc.getAdjacentLocation(curDirection + Location.LEFT);\n // get 2 right locations\n Location rightNeighborLoc = curLoc.getAdjacentLocation(curDirection + Location.RIGHT);\n Location rightNextNeighborLoc = rightNeighborLoc.getAdjacentLocation(curDirection + Location.RIGHT);\n // initial a null\n Actor leftNeighborActor = null;\n Actor leftNextNeighborActor = null;\n Actor rightNeighborActor = null;\n Actor rightNextNeighborActor = null;\n\n boolean isLeftValid = false;\n boolean isRightValid = false;\n\n Grid<Actor> grid = getGrid();\n // if left valid\n if (grid.isValid(leftNeighborLoc) && grid.isValid(leftNextNeighborLoc))\n {\n \tleftNeighborActor = grid.get(leftNeighborLoc);\n \tleftNextNeighborActor = grid.get(leftNextNeighborLoc);\n \t\n \tif (leftNeighborActor == null && leftNextNeighborActor == null) {\n \t\tisLeftValid = true;\n }\n }\n // if right valid\n if (grid.isValid(rightNeighborLoc) && grid.isValid(rightNextNeighborLoc))\n {\n \trightNeighborActor = grid.get(rightNeighborLoc);\n \trightNextNeighborActor = grid.get(rightNextNeighborLoc);\n\n \tif (rightNeighborActor == null && leftNextNeighborActor == null) {\n \t\tisRightValid = true;\n }\n }\n // if both valid\n if (isLeftValid && isRightValid)\n {\n\t // move ramdonly\n if (Math.random() < 0.5)\n\t {\n\t \tmoveTo(leftNextNeighborLoc);\n\t \n\t }\n\t else{\n\t \tmoveTo(rightNextNeighborLoc);\n\t }\n }\n // right valid only\n else if (isRightValid && !isLeftValid)\n {\n \tmoveTo(rightNextNeighborLoc);\n }\n // left valid only\n else if (!isRightValid && isLeftValid)\n {\n \tmoveTo(leftNextNeighborLoc);\n }\n else\n {\n \tsuper.makeMove(loc);\n }\n \n }", "private void SetPlayerAndEnemy(int stage) {\n // screen size\n Point screen = GameView.GetScreenSize();\n int countMax[] = new int[2];\n // to diverge the initialization from selected stage.\n switch(stage) {\n case Play.STAGE_OFF_ROAD:\n // Player\n // loading the file\n this.mPlayer.LoadCharaImage(this.mContext,\"offroadplayer\");\n this.mPlayer.mSize.x = OffroadPlayer.PLAYER_SIZE.x;\n this.mPlayer.mSize.y = OffroadPlayer.PLAYER_SIZE.y;\n this.mPlayer.mPos.x = (screen.x-this.mPlayer.mSize.x)>>1;\n this.mPlayer.mPos.y = screen.y+100;\n this.mPlayer.mMoveX = 0.0f;\n this.mPlayer.mMoveY = PLAYER_DEFAULT_SPEED*-1;\n this.mPlayer.mExistFlag = true;\n countMax[0] = 2;\n // Enemy that is jump point\n this.mEnemy.LoadCharaImage(this.mContext,\"offroadjump\");\n this.mEnemy.mSize.x = OffroadObstacles.OBSTACLE_JUMP_POINT_SIZE.x;\n this.mEnemy.mSize.y = OffroadObstacles.OBSTACLE_JUMP_POINT_SIZE.y;\n this.mEnemy.mPos.x = screen.x+100;\n this.mEnemy.mPos.y = 600;\n this.mEnemy.mMoveX = ENEMY_DEFAULT_SPEED*-1;\n this.mEnemy.mMoveY = 0.0f;\n this.mEnemy.mType = Play.STAGE_OFF_ROAD;\n this.mEnemy.mExistFlag = true;\n countMax[1] = 0;\n break;\n case Play.STAGE_ROAD:\n // loading the file\n this.mPlayer.LoadCharaImage(this.mContext,\"roadplayer\");\n this.mPlayer.mSize.x = RoadPlayer.RUNNER_SIZE.x;\n this.mPlayer.mSize.y = RoadPlayer.RUNNER_SIZE.y;\n this.mPlayer.mPos.x = (screen.x-this.mPlayer.mSize.x)>>1;\n this.mPlayer.mPos.y = screen.y+100;\n this.mPlayer.mMoveX = 0.0f;\n this.mPlayer.mMoveY = PLAYER_DEFAULT_SPEED*-1;\n this.mPlayer.mExistFlag = true;\n countMax[0] = 4;\n // Enemy that is hurdle\n this.mEnemy.LoadCharaImage(this.mContext,\"roadhurdle\");\n this.mEnemy.mSize.x = RoadObstacles.HURDLE_SIZE.x;\n this.mEnemy.mSize.y = RoadObstacles.HURDLE_SIZE.y;\n this.mEnemy.mPos.x = screen.x+100;\n this.mEnemy.mPos.y = 600;\n this.mEnemy.mMoveX = ENEMY_DEFAULT_SPEED*-1;\n this.mEnemy.mMoveY = 0.0f;\n this.mEnemy.mType = Play.STAGE_ROAD;\n this.mEnemy.mExistFlag = true;\n countMax[1] = 0;\n break;\n case Play.STAGE_SEA:\n // loading the file\n this.mPlayer.LoadCharaImage(this.mContext,\"swimmer\");\n this.mPlayer.mSize.x = SeaPlayer.SWIMMER_SIZE.x;\n this.mPlayer.mSize.y = SeaPlayer.SWIMMER_SIZE.y;\n this.mPlayer.mPos.x = -100;\n this.mPlayer.mPos.y = PLAYER_ARRIVE_POSITION_Y;\n this.mPlayer.mMoveX = PLAYER_DEFAULT_SPEED;\n this.mPlayer.mMoveY = 0.0f;\n this.mPlayer.mExistFlag = true;\n countMax[0] = 3;\n // Enemy that is sunfish\n this.mEnemy.LoadCharaImage(this.mContext,\"sunfish\");\n this.mEnemy.mSize.x = SeaEnemyManager.SUNFISH_SIZE.x;\n this.mEnemy.mSize.y = SeaEnemyManager.SUNFISH_SIZE.y;\n this.mEnemy.mPos.x = screen.x+100;\n this.mEnemy.mPos.y = 600;\n this.mEnemy.mMoveX = ENEMY_DEFAULT_SPEED*-1;\n this.mEnemy.mMoveY = 0.0f;\n this.mEnemy.mType = Play.STAGE_SEA;\n this.mEnemy.mExistFlag = true;\n countMax[1] = SeaEnemyManager.ANIMATION_COMMON_COUNT_MAX;\n break;\n }\n // animation setting\n // player\n this.mPlayerAni.SetAnimation(\n 0,0,\n this.mPlayer.mSize.x,\n this.mPlayer.mSize.y,\n countMax[0],10,0\n );\n // except for off-road and road, enemy\n if (stage == Play.STAGE_SEA) {\n this.mEnAni.SetAnimation(\n 0, 0,\n this.mEnemy.mSize.x, this.mEnemy.mSize.y,\n countMax[1], 10, 0\n );\n }\n }", "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 hyperSpace()\n\t{\n\t\t//only return the ship if a PlayerShip is currently spawned\n\t\tif(gameObj[1].size() > 0)\n\t\t{\n\t\t\t//invoke resetShip() method from PlayerShip\n\t\t\t((PlayerShip)gameObj[1].get(0)).resetShip();\n\t\t\tSystem.out.println(\"PS location reset\");\n\t\t}\n\t\telse\n\t\t\tSystem.out.println(\"There is no playership spawned\");\n\t}", "public void placeRoad(int playerID, EdgeLocation loc) {\n\t\tedges.get(loc.getNormalizedLocation()).setPiece(new Piece(PieceType.ROAD, null, null, playerID));\n\t}", "private void busquets() {\n\t\ttry {\n\t\t\tThread.sleep(5000); // espera, para dar tempo de ver as mensagens iniciais\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tint xInit = -25;\n\t\tint yInit = -10;\n\t\tplayerDeafaultPosition = new Vector2D(xInit*selfPerception.getSide().value(), yInit *selfPerception.getSide().value());\n\t\t\n\t\twhile (commander.isActive()) {\n\t\t\tupdatePerceptions(); // deixar aqui, no começo do loop, para ler o resultado do 'move'\n\t\t\tswitch (matchPerception.getState()) {\n\t\t\tcase BEFORE_KICK_OFF:\n\t\t\t\tcommander.doMoveBlocking(xInit, yInit);\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase PLAY_ON:\n\t\t\t\tstate = State.ATTACKING;\n\t\t\t\texecuteStateMachine();\n\t\t\t\tbreak;\n\t\t\tcase KICK_OFF_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase KICK_OFF_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\t//if(closer)\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CORNER_KICK_LEFT: // escanteio time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CORNER_KICK_RIGHT: // escanteio time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase KICK_IN_LEFT: // lateral time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\tcase KICK_IN_RIGHT: // lateal time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_LEFT: // Tiro livre time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_RIGHT: // Tiro Livre time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_FAULT_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_FAULT_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase GOAL_KICK_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase GOAL_KICK_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase AFTER_GOAL_LEFT:\n\t\t\t\tcommander.doMoveBlocking(xInit, yInit);\t\n\t\t\t\tbreak;\n\t\t\tcase AFTER_GOAL_RIGHT:\n\t\t\t\tcommander.doMoveBlocking(xInit, yInit);\t\n\t\t\t\tbreak;\n\t\t\tcase INDIRECT_FREE_KICK_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase INDIRECT_FREE_KICK_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public GenGameOver() { \n prepare();\n }", "public void enter(FieldPlayer player){\n player.getTeam().setReceiver(player);\n \n //this player is also now the controlling player\n player.getTeam().setControllingPlayer(player);\n\n //there are two types of receive behavior. One uses arrive to direct\n //the receiver to the position sent by the passer in its telegram. The\n //other uses the pursuit behavior to pursue the ball. \n //This statement selects between them dependent on the probability\n //ChanceOfUsingArriveTypeReceiveBehavior, whether or not an opposing\n //player is close to the receiving player, and whether or not the receiving\n //player is in the opponents 'hot region' (the third of the pitch closest\n //to the opponent's goal\n double PassThreatRadius = 70.0;\n\n if (( player.isInHotRegion() ||\n RandFloat() < Params.Instance().ChanceOfUsingArriveTypeReceiveBehavior) &&\n !player.getTeam().isOpponentWithinRadius(player.getPos(), PassThreatRadius)){\n player.getSteering().arriveOn();\n }\n else{\n player.getSteering().pursuitOn();\n }\n \n //FIXME: Change animation\n// player.info.setAnim(\"Run\");\n// player.info.setDebugText(\"ReceiveBall\");\n }", "private void firstRound(Player player)\n {\n PowerUpCard option1 = powerUpCardDeck.getFirstCard();\n PowerUpCard option2 = powerUpCardDeck.getFirstCard();\n try\n {\n String chosenId = player.getView().chooseSpawnPoint(option1.getCardData(), option2.getCardData());\n PowerUpCard chosen = option1.getId().equals(chosenId) ? option1 : option2;\n Block spawnPoint = map.findRoomByColor(chosen.getColor()).getSpawnPoint();\n powerUpCardDeck.addCard(chosen);\n player.addPowerUpCard(chosen.equals(option1) ? option2 : option1);\n player.setBlock(spawnPoint);\n player.setFirstRoundPlayed(true);\n sendBroadcastUpdate();\n }\n catch (ConnectionErrorException | TimeOutException e)\n {\n powerUpCardDeck.addCard(option1);\n powerUpCardDeck.addCard(option2);\n throw e;\n }\n\n }", "public void explore() {\n\t\t\tif(getSpeed() < CAR_MAX_SPEED){ // Need speed to turn and progress toward the exit\n\t\t\t\tapplyForwardAcceleration(); // Tough luck if there's a wall in the way\n\t\t\t}\n\t\t\tif (isFollowingWall) {\n\t\t\t\t// if already been to this tile, stop following the wall\n\t\t\t\tif (travelled.contains(new Coordinate(getPosition()))) {\n\t\t\t\t\tisFollowingWall = false;\n\t\t\t\t} else {\n\t\t\t\t\tif(!checkFollowingWall(getOrientation(), map)) {\n\t\t\t\t\t\tturnLeft();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If wall on left and wall straight ahead, turn right\n\t\t\t\t\t\tif(checkWallAhead(getOrientation(), map)) {\n\t\t\t\t\t\t\tif (!checkWallRight(getOrientation(), map))\t{\n\t\t\t\t\t\t\t\tturnRight();\n\t\t\t\t\t\t\t\tisFollowingWall = true;\n\t\t\t\t\t\t\t} else if (!checkWallLeft(getOrientation(), map)){\n\t\t\t\t\t\t\t\tturnLeft();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tapplyReverseAcceleration();\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} else {\n\t\t\t\t// Start wall-following (with wall on left) as soon as we see a wall straight ahead\n\t\t\t\tif(checkWallAhead(getOrientation(), map)) {\n\t\t\t\t\tif (!checkWallRight(getOrientation(), map) && !checkWallLeft(getOrientation(), map)) {\n\t\t\t\t\t\t// implementing some randomness so doesn't get stuck in loop\n\t\t\t\t\t\tRandom rand = new Random();\n\t\t\t\t\t\tint n = rand.nextInt(2);\n\t\t\t\t\t\tif (n==0) {\n\t\t\t\t\t\t\tturnLeft();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tturnRight();\n\t\t\t\t\t\t\tisFollowingWall = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (!checkWallRight(getOrientation(), map))\t{\n\t\t\t\t\t\tturnRight();\n\t\t\t\t\t\tisFollowingWall = true;\n\t\t\t\t\t} else if (!checkWallLeft(getOrientation(), map)){\n\t\t\t\t\t\tturnLeft();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tapplyReverseAcceleration();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "private void cs8() {\n\t\t\t\n\t\n\t\t\tif(new Tile(3088,3092,0).matrix(ctx).reachable()){\n\t\t\t\t\n\t\t\t\tif(new Tile(3079,3084,0).distanceTo(ctx.players.local().tile())<7){\n\t\t\t\t\tMethod.interactO(9709, \"Open\", \"Door\");\n\t\t\t\t}else ctx.movement.step(new Tile(3079,3084,0));\n\t\t\t\t\n\t\t\t}else if(new Tile(3090,3092,0).distanceTo(ctx.players.local().tile())<7){\n\t\t\t\tfinal int[] bounds = {140, 108, -84, 144, -64, 136};\n\t\t\t\tGameObject gate = ctx.objects.select().id(GATEBYFISH).each(Interactive.doSetBounds(bounds)).select(Interactive.areInViewport()).nearest().poll();\n\t\t\t\tgate.interact(\"Open\",\"\");\n\t\t\t}else ctx.movement.step(new Tile(3090,3092,0));\n\t\t\t\n\t\t\t\n\t\t}", "public void gameInit() {\n lobbyRoom.sendPortToAll();\n lobbyRoom.sendPlayers(game.getCars());\n lobbyRoom.sendTrack(game.getTrack());\n lobbyRoom.sendPowerupManager(game.getManager());\n this.running = true;\n }", "private void send()\n {\n\n\tRouterPacket pkt;\n if(poisonEnabled){\n\t // Create a false distance table\n int[] tmpDistTable = new int[RouterSimulator.NUM_NODES];\n System.arraycopy(myDistTable,0,tmpDistTable,0,RouterSimulator.NUM_NODES);\n for(int i = 0;i<neighbours.length;i++){\n if(neighbours[i]){\n\t\t //Poisoned reverse\n for(int j = 0;j<route.length;j++){\n\t\t\t// All routes that goes through my node, set to infinity\n if(route[j] == i && j!=i){\n tmpDistTable[j] = RouterSimulator.INFINITY;\n }\n }\n\t\t // Send new packet\n pkt = new RouterPacket(myID,i,tmpDistTable);\n sendUpdate(pkt);\n }\n }\n } else {\n for (int i = 0; i < neighbours.length; i++) {\n if (neighbours[i]) {\n\t\t // Send new packet\n pkt = new RouterPacket(myID, i, myDistTable);\n sendUpdate(pkt);\n }\n }\n }\n\n\n }", "public void move() {\n switch (route) {\n case UP:\n moveBody();\n\n // turn snake direction to the up\n snakeParts.set(0,\n new Ellipse2D.Double(snakeParts.get(0).getMinX(), snakeParts.get(0).getMinY() - 20, SNAKE_X_SIZE, SNAKE_Y_SIZE));\n if (snakeParts.get(0).getMinY() < 0) {\n over = true;\n }\n break;\n\n case DOWN:\n moveBody();\n\n // turn snake direction to the down\n snakeParts.set(0,\n new Ellipse2D.Double(snakeParts.get(0).getMinX(), snakeParts.get(0).getMinY() + 20, SNAKE_X_SIZE, SNAKE_Y_SIZE));\n if (snakeParts.get(0).getMaxY() > gameGround.getBounds().getMaxY()) {\n over = true;\n }\n break;\n\n case LEFT:\n moveBody();\n\n // turn snake direction to the left\n snakeParts.set(0,\n new Ellipse2D.Double(snakeParts.get(0).getMinX() - 20, snakeParts.get(0).getMinY(), SNAKE_X_SIZE, SNAKE_Y_SIZE));\n if (snakeParts.get(0).getMinX() < 0) {\n over = true;\n }\n break;\n\n case RIGHT:\n moveBody();\n\n // turn snake direction to the right\n snakeParts.set(0,\n new Ellipse2D.Double(snakeParts.get(0).getMinX() + 20, snakeParts.get(0).getMinY(), SNAKE_X_SIZE, SNAKE_Y_SIZE));\n if (snakeParts.get(0).getMaxX() > gameGround.getBounds().getMaxX()) {\n over = true;\n }\n break;\n\n default:\n new Exception(\"Unexpected Direction value!\").printStackTrace();\n break;\n }\n }", "public void land() {\n Game currentGame = this.getGame();\n this.setHasBeenVisited(true);\n currentGame.setMode( Game.Mode.GAME_WON);\n\n }", "public RailRoad() {}", "public void startGame(){\n\n AgentAddress coordinatorAddressPre = getAgentWithRole(\"investment_game\", \"tout_le_monde\", \"coordinator\");\n\n if (coordinatorAddressPre==null){\n Coordinator coordinator = new Coordinator();\n\n launchAgent(coordinator);\n\n pause(1000);\n }\n\n Set<Player> players = new HashSet<Player>();\n Player primaryPlayer = null;\n\n //now launch all human player avatar agents, each of them will be initialized as agent having a GUI frame\n Iterator<GameSpecification.PlayerSpecification> playerSpecs = gameSpecification.getPlayerSpecifications().iterator();\n\n int launchedHumanPlayers = 0;\n\n while (playerSpecs.hasNext()){\n GameSpecification.PlayerSpecification spec = playerSpecs.next();\n\n if (spec instanceof GameSpecification.HumanPlayerSpecification){\n\n HumanPlayerAvatar humanPlayerAvatar = new HumanPlayerAvatar(spec.getName());\n\n launchAgent(humanPlayerAvatar,true);\n\n players.add(humanPlayerAvatar);\n\n launchedHumanPlayers++;\n\n if (null == primaryPlayer){\n primaryPlayer=humanPlayerAvatar;\n }\n\n }\n }\n\n //launch computer player agents. If no human players have been launched, the first computer player will display a GUI frame.\n playerSpecs = gameSpecification.getPlayerSpecifications().iterator();\n\n boolean first = true;\n\n while (playerSpecs.hasNext()){\n GameSpecification.PlayerSpecification spec = playerSpecs.next();\n\n if (spec instanceof GameSpecification.ComputerPlayerSpecification){\n\n ChooseAmountStrategy chooseAmountStrategy = ((GameSpecification.ComputerPlayerSpecification) spec).getChooseAmountStrategy();\n\n SelectOpponentStrategy selectOpponentStrategy = ((GameSpecification.ComputerPlayerSpecification) spec).getSelectOpponentStrategy();\n \n ComputerPlayer computerPlayer = new ComputerPlayer(spec.getName(),spec.getPictureFileName(), chooseAmountStrategy, selectOpponentStrategy);\n\n chooseAmountStrategy.setPlayer(computerPlayer);\n\n selectOpponentStrategy.setPlayer(computerPlayer);\n\n launchAgent(computerPlayer, launchedHumanPlayers == 0 && first);\n\n players.add(computerPlayer);\n\n if (null == primaryPlayer){\n primaryPlayer=computerPlayer;\n }\n\n first = false;\n\n }\n }\n\n //request new game from coordinator\n AgentAddress coordinatorAddress;\n\n while((coordinatorAddress = getAgentWithRole(\"investment_game\",\"tout_le_monde\",\"coordinator\"))==null){\n pause(750);\n }\n\n String requestGameSpec = \"<new_game> <for> \"+gameSpecification.getPlayerSpecifications().size()+\" <players> <having> \"+gameSpecification.getRounds()+\" <rounds> <invite> 0 <computer_players>\";\n\n ActMessage reply = (ActMessage)sendMessageWithRoleAndWaitForReply(coordinatorAddress,new ActMessage(\"request_game\",requestGameSpec),\"jeromes_assistant\");\n\n if (reply.getAction().equals(\"game_initialized\")){\n\n final String gameId = reply.getContent();\n\n //let players join the game\n Iterator<Player> playerIterator = players.iterator();\n\n while (playerIterator.hasNext()){\n\n final Player player = playerIterator.next();\n final boolean isPrimaryPlayer = player.equals(primaryPlayer);\n\n new Thread(){\n @Override\n public void run() {\n player.joinGame(gameId,isPrimaryPlayer,player.getPicturePath());\n }\n }.start();\n\n }\n }else{\n //TODO throw Exception\n }\n\n }", "public void playRoad(boolean isFree) throws ClientException{\n\t\t\troads--;\n//\t\tboolean firstRounds = false;\n//\t\ttry {\n//\t\t\tfirstRounds = ClientFacade.getSingleton().getContext().getState() instanceof FirstRoundState ||\n//\t\t\t\t\tClientFacade.getSingleton().getContext().getState() instanceof SecondRoundState;\n//\t\t} catch (ClientException e) {\n//\t\t\t// TODO Auto-generated catch block\n//\t\t\te.printStackTrace();\n//\t\t}\n\t\tif(!isFree) {\n\t\t\tresources.setBrick(resources.getBrick() - 1);\n\t\t\tresources.setWood(resources.getWood() - 1);\n\t\t}\n\n\n\t\t\n\t}", "private boolean buildStreetIsAllowed(Road road) {\r\n\t\tif (!client.isBeginning()\r\n\t\t\t\t&& road.isBuildable(island, client.getSettler().getID())\r\n\t\t\t\t&& road.getOwner() == Constants.NOBODY) {\r\n\t\t\treturn true;\r\n\t\t} else if (((client.isBeginning() && road.getEnd() == getLastSettlementNode()) || (client\r\n\t\t\t\t.isBeginning() && road.getStart() == getLastSettlementNode()))\r\n\t\t\t\t&& road.getOwner() == Constants.NOBODY) {\r\n\t\t\treturn true;\r\n\t\t} else\r\n\t\t\treturn false;\r\n\t}", "@Override\n\tpublic void execute(RoadMap r) {\n\t\tLogger log = Logger.getLogger(NewHighwayEvent.class.getName());\n\t\tlog.info(\"Attempting to execute NewHighwayEvent...\");\n\t\tr.addRoad(createHighway(r));\n\t\tlog.info(\"Event executed\");\n\t}", "public abstract int drive(int journeyDistance);", "public void run() {\n\n try {\n startup();\n } catch (UnknownHostException e) {\n e.printStackTrace();\n currentPosition = destination;\n }\n\n while (currentPosition.longitude != destination.longitude && currentPosition.latitude != destination.latitude) {\n try {\n while ((routePositions.size() - 1) > nextRoutePositionIndex && currentPosition.getLongitude() != this.routePositions.get(nextRoutePositionIndex).getLongitude() && currentPosition.getLatitude() != this.routePositions.get(nextRoutePositionIndex).getLatitude()) {\n Thread.sleep(TIMEOUT);\n\n //diceBraking();\n properBraking();\n accelerate();\n calculateDirection(currentPosition, this.routePositions.get(nextRoutePositionIndex));\n currentPosition = drive(\n currentPosition.getLatitude(), currentPosition.getLongitude(),\n this.routePositions.get(nextRoutePositionIndex).getLatitude(), this.routePositions.get(nextRoutePositionIndex).getLongitude()\n );\n\n\n publishPosition();\n if (currentPosition.latitude == currentPosition.latitude && currentPosition.longitude == destination.longitude) {\n break;\n }\n System.out.println(\"id: \" + id + \" Pos: \" + currentPosition.latitude + \"|\" + currentPosition.longitude);\n }\n if (nextRoutePositionIndex < routePositions.size()) {\n nextRoutePositionIndex++;\n } else {\n break;\n }\n } catch (InterruptedException | MalformedURLException exc) {\n exc.printStackTrace();\n }\n\n }\n\n for (int i = 0; i < 100; i++) {\n System.out.println(\"FINISHED \" + id);\n }\n\n try {\n publishFinished();\n } catch (MalformedURLException e) {\n e.printStackTrace();\n }\n }", "private void build() {\n resetUpdate();\n\n gameMessage.setSpace1(clientMessage.getSpace1());\n gameMessage.setLevel(clientMessage.getLevelToBuild());\n gameMessage.notify(gameMessage);\n\n if ( liteGame.getCurrWorker() == null ){\n removePlayerFromTheGame();\n }\n }", "private static void soldierCode() throws GameActionException {\n\t\tRobotInfo[] visibleEnemyArray = rc.senseHostileRobots(rc.getLocation(), 1000000);\n\t\tSignal[] incomingSignals = rc.emptySignalQueue();\n\t\tfor(Signal s:incomingSignals){\n\t\t\tint[] message = s.getMessage();\n\t\t\tif(s.getTeam()==rc.getTeam()){\n\t\t\t\tif(message!=null){\n\t\t\t\t\tif(message[0]%10==0){\n\t\t\t\t\t\tint x = message[1]/100000;\n\t\t\t\t\t\tint y = message[1]%100000;\n\t\t\t\t\t\tcenter= new MapLocation(x,y);\n\t\t\t\t\t\tint r = message[0]/10;\n\t\t\t\t\t\tradius=r;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tint dist = rc.getLocation().distanceSquaredTo(center);\n\t\tif (visibleEnemyArray.length==0) {\n\t\t\tif (goal!=null&&(rc.senseRubble(goal)<100 || rc.senseRobotAtLocation(goal)!=null)) {\n\t\t\t\tgoal = null;\n\t\t\t\trc.setIndicatorString(0, \"done clearing\");\n\t\t\t}\t\n\t\t\tif(goal==null) {\n\t\t\t\tMapLocation[] locs = MapLocation.getAllMapLocationsWithinRadiusSq(rc.getLocation(), 8);\n\t\t\t\tArrayList<MapLocation> inside = new ArrayList<MapLocation>();\n\t\t\t\tfor(MapLocation loc: locs) {\n\t\t\t\t\tif (loc.distanceSquaredTo(center)<=1.5*radius) {\n\t\t\t\t\t\tinside.add(loc);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor(MapLocation l: inside) {\n\t\t\t\t\tif (rc.senseRubble(l)>99 && rc.senseRobotAtLocation(l)==null) {\n\t\t\t\t\t\tgoal = l;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tUtility.tryToMove(goal);\n\t\t\t}\n\t\t\t\n\t\t\tif (dist>radius && dist< 4*radius) { //Explore\n\t\t\t\tMapLocation travel = soldierFind();\n\t\t\t\tUtility.tryToMove(travel);\n\t\t\t}else{ //Move back\n\t\t\t\tMapLocation loc = center.add(center.directionTo(rc.getLocation()), (int)Math.pow(radius, 0.5)+1);\n\t\t\t\tUtility.tryToMove(loc);\n\t\t\t}\n\t\t} else { //Kite\n\t\t\tkite(visibleEnemyArray);\n\t\t}\n\t}", "public void populate2()\r\n\t{\r\n\t\tRandom gen=new Random();\r\n\t\tint add=(gen.nextInt(13)+3);\r\n\t\twhile (add>0)\r\n\t\t{\r\n\t\t\tif (carNum==LIMIT)\r\n\t\t\t{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tboolean straight;\r\n\t\t\tint straightNum=gen.nextInt(2);\r\n\t\t\tif (straightNum==0)\r\n\t\t\t\tstraight=true;\r\n\t\t\telse\r\n\t\t\t\tstraight=false;\r\n\t\t\tint directionNumber=gen.nextInt(4);\r\n\t\t\tDirection direction=null;\r\n\t\t\tStreet street=null;\r\n\t\t\tswitch (directionNumber)\r\n\t\t\t{\r\n\t\t\t\tcase 0:\r\n\t\t\t\t\tdirection=Direction.N;\r\n\t\t\t\t\tstreet=Street.CHURCH;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 1:\r\n\t\t\t\t\tdirection=Direction.S;\r\n\t\t\t\t\tstreet=Street.CHURCH;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 2:\r\n\t\t\t\t\tdirection=Direction.E;\r\n\t\t\t\t\tstreet=Street.MAIN;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 3:\r\n\t\t\t\t\tdirection=Direction.W;\r\n\t\t\t\t\tstreet=Street.MAIN;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tSystem.out.println(\"There was an error with your direction. Please look into this problem.\");\r\n\t\t\t}\r\n\t\t\tVehicle car=new Vehicle(carNum, time, direction, street, straight);\r\n\t\t\tcarNum++;\r\n\t\t\tif (car.getStraight())\r\n\t\t\t{\r\n\t\t\t\tswitch (car.getDirection())\r\n\t\t\t\t{\r\n\t\t\t\t\tcase N:\r\n\t\t\t\t\t\t//System.out.println(\"I was put in North straight\");\r\n\t\t\t\t\t\t//System.out.println(car);\r\n\t\t\t\t\t\tChurchNorthStraight.enqueue(car);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase S:\r\n\t\t\t\t\t\t//System.out.println(\"I was put in South straight\");\r\n\t\t\t\t\t\t//System.out.println(car);\r\n\t\t\t\t\t\tChurchSouthStraight.enqueue(car);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase W:\r\n\t\t\t\t\t\t//System.out.println(\"I was put in West straight\");\r\n\t\t\t\t\t\t//System.out.println(car);\r\n\t\t\t\t\t\tMainWestStraight.enqueue(car);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase E:\r\n\t\t\t\t\t\t//System.out.println(\"I was put in East straight\");\r\n\t\t\t\t\t\t//System.out.println(car);\r\n\t\t\t\t\t\tMainEastStraight.enqueue(car);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tSystem.out.println(\"There wan an error enquing cars in the pre propulate method. You should look into this.\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tswitch (car.getDirection())\r\n\t\t\t\t{\r\n\t\t\t\t\tcase N:\r\n\t\t\t\t\t\t//System.out.println(\"I was put in North Right\");\r\n\t\t\t\t\t\t//System.out.println(car);\r\n\t\t\t\t\t\tChurchNorthRight.enqueue(car);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase S:\r\n\t\t\t\t\t\t//System.out.println(\"I was put in South Right\");\r\n\t\t\t\t\t\t//System.out.println(car);\r\n\t\t\t\t\t\tChurchSouthRight.enqueue(car);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase W:\r\n\t\t\t\t\t\t//System.out.println(\"I was put in West Right\");\r\n\t\t\t\t\t\t//System.out.println(car);\r\n\t\t\t\t\t\tMainWestRight.enqueue(car);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase E:\r\n\t\t\t\t\t\t//System.out.println(\"I was put in East Right\");\r\n\t\t\t\t\t\t//System.out.println(car);\r\n\t\t\t\t\t\tMainEastRight.enqueue(car);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tSystem.out.println(\"There wan an error enquing cars in the pre propulate method. You should look into this.\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tadd--;\t\r\n\t\t}\r\n\t}", "private void prePopulate()\r\n\t{\r\n\t\tRandom gen=new Random();\r\n\t\t/**How many cars to add*/\r\n\t\tint add=(gen.nextInt(6)+5);\r\n\t\twhile (add>0)\r\n\t\t{\r\n\t\t\tboolean straight;\r\n\t\t\tint straightNum=gen.nextInt(2);\r\n\t\t\t/**Right lane or straight lane*/\r\n\t\t\tif (straightNum==0)\r\n\t\t\t\tstraight=true;\r\n\t\t\telse\r\n\t\t\t\tstraight=false;\r\n\t\t\t\t/**Determines whether going east west north or south*/\r\n\t\t\tint directionNumber=gen.nextInt(4);\r\n\t\t\tDirection direction=null;\r\n\t\t\tStreet street=null;\r\n\t\t\tswitch (directionNumber)\r\n\t\t\t{\r\n\t\t\t\tcase 0:\r\n\t\t\t\t\tdirection=Direction.N;\r\n\t\t\t\t\tstreet=Street.CHURCH;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 1:\r\n\t\t\t\t\tdirection=Direction.S;\r\n\t\t\t\t\tstreet=Street.CHURCH;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 2:\r\n\t\t\t\t\tdirection=Direction.E;\r\n\t\t\t\t\tstreet=Street.MAIN;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 3:\r\n\t\t\t\t\tdirection=Direction.W;\r\n\t\t\t\t\tstreet=Street.MAIN;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tSystem.out.println(\"There was an error with your direction. Please look into this problem.\");\r\n\t\t\t}\r\n\t\t\t/**Creates a new car dependent on the information given. Finds the lane and direction and applies it to the appropriate queue*/\r\n\t\t\tVehicle car=new Vehicle(carNum, time, direction, street, straight);\r\n\t\t\tcarNum++;\r\n\t\t\tif (car.getStraight())\r\n\t\t\t{\r\n\t\t\t\tswitch (car.getDirection())\r\n\t\t\t\t{\r\n\t\t\t\t\tcase N:\r\n\t\t\t\t\t\t//System.out.println(\"I was put in North straight\");\r\n\t\t\t\t\t\t//System.out.println(car);\r\n\t\t\t\t\t\tChurchNorthStraight.enqueue(car);\r\n\t\t\t\t\t\t//System.out.println(car+\" enetred curchnorthstriahgt\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase S:\r\n\t\t\t\t\t\t//System.out.println(\"I was put in South straight\");\r\n\t\t\t\t\t\t//System.out.println(car);\r\n\t\t\t\t\t\tChurchSouthStraight.enqueue(car);\r\n\t\t\t\t\t\t//System.out.println(car+\" enetred curchsouthstraight\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase W:\r\n\t\t\t\t\t\t//System.out.println(\"I was put in West straight\");\r\n\t\t\t\t\t\t//System.out.println(car);\r\n\t\t\t\t\t\tMainWestStraight.enqueue(car);\r\n\t\t\t\t\t\t//System.out.println(car+\" enetred Mainweststraight\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase E:\r\n\t\t\t\t\t\t//System.out.println(\"I was put in East straight\");\r\n\t\t\t\t\t\t//System.out.println(car);\r\n\t\t\t\t\t\tMainEastStraight.enqueue(car);\r\n\t\t\t\t\t\t//System.out.println(car+\" enetred maineaststraight\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tSystem.out.println(\"There wan an error enquing cars in the pre propulate method. You should look into this.\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tswitch (car.getDirection())\r\n\t\t\t\t{\r\n\t\t\t\t\tcase N:\r\n\t\t\t\t\t\t//System.out.println(\"I was put in North Right\");\r\n\t\t\t\t\t\t//System.out.println(car);\r\n\t\t\t\t\t\tChurchNorthRight.enqueue(car);\r\n\t\t\t\t\t\t//System.out.println(car+\" enetred curchnorthright\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase S:\r\n\t\t\t\t\t\t//System.out.println(\"I was put in South Right\");\r\n\t\t\t\t\t\t//System.out.println(car);\r\n\t\t\t\t\t\tChurchSouthRight.enqueue(car);\r\n\t\t\t\t\t\t//System.out.println(car+\" enetred curchsouthright\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase W:\r\n\t\t\t\t\t\t//System.out.println(\"I was put in West Right\");\r\n\t\t\t\t\t\t//System.out.println(car);\r\n\t\t\t\t\t\tMainWestRight.enqueue(car);\r\n\t\t\t\t\t\t//System.out.println(car+\" enetred MainwestRight\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase E:\r\n\t\t\t\t\t\t//System.out.println(\"I was put in East Right\");\r\n\t\t\t\t\t\t//System.out.println(car);\r\n\t\t\t\t\t\tMainEastRight.enqueue(car);\r\n\t\t\t\t\t\t//System.out.println(car+\" enetred MainEastRight\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tSystem.out.println(\"There wan an error enquing cars in the pre propulate method. You should look into this.\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tadd--;\t\r\n\t\t}\r\n\t\tprint.println(\"--Simulation starting. Processing of North and South traffic will begin--\");\r\n\t\t\r\n\t}", "private static void loop() throws GameActionException {\n RobotCount.reset();\n MinerEffectiveness.reset();\n\n //Update enemy HQ ranges in mob level\n if(Clock.getRoundNum()%10 == 0) {\n enemyTowers = rc.senseEnemyTowerLocations();\n numberOfTowers = enemyTowers.length;\n if(numberOfTowers < 5 && !Map.isEnemyHQSplashRegionTurnedOff()) {\n Map.turnOffEnemyHQSplashRegion();\n }\n if(numberOfTowers < 2 && !Map.isEnemyHQBuffedRangeTurnedOff()) {\n Map.turnOffEnemyHQBuffedRange();\n }\n }\n \n // Code that runs in every robot (including buildings, excepting missiles)\n sharedLoopCode();\n \n updateEnemyInRange(52);//52 includes splashable region\n checkForEnemies();\n \n int rn = Clock.getRoundNum();\n \n // Launcher strategy\n if(rn == 80) {\n BuildOrder.add(RobotType.HELIPAD); \n } else if(rn == 220) {\n BuildOrder.add(RobotType.AEROSPACELAB);\n } else if (rn == 280) {\n BuildOrder.add(RobotType.AEROSPACELAB);\n } else if (rn == 350) {\n BuildOrder.add(RobotType.AEROSPACELAB);\n } else if (rn == 410) {\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n } else if (rn == 500) {\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n } \n if (rn > 500 && rn%200==0) {\n BuildOrder.add(RobotType.AEROSPACELAB);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n }\n //rc.setIndicatorString(1, \"Distance squared between HQs is \" + distanceBetweenHQs);\n \n \n \n if(rn > 1000 && rn%100 == 0 && rc.getTeamOre() > 700) {\n int index = BuildOrder.size()-1;\n if(BuildOrder.isUnclaimedOrExpired(index)) {\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n }\n }\n \n \n \n /**\n //Building strategy ---------------------------------------------------\n if(Clock.getRoundNum() == 140) {\n BuildOrder.add(RobotType.TECHNOLOGYINSTITUTE);\n BuildOrder.add(RobotType.TRAININGFIELD);\n }\n if(Clock.getRoundNum() == 225) {\n BuildOrder.add(RobotType.BARRACKS);\n BuildOrder.add(RobotType.TANKFACTORY);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n }\n if(Clock.getRoundNum() == 550) {\n BuildOrder.add(RobotType.TANKFACTORY);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n\n }\n if(Clock.getRoundNum() == 800) {\n BuildOrder.add(RobotType.HELIPAD);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n BuildOrder.add(RobotType.TANKFACTORY);\n BuildOrder.add(RobotType.SUPPLYDEPOT);\n\n //BuildOrder.printBuildOrder();\n }\n //---------------------------------------------------------------------\n **/\n \n //Spawn beavers\n if (hasFewBeavers()) { \n trySpawn(HQLocation.directionTo(enemyHQLocation), RobotType.BEAVER);\n }\n \n //Dispense supply\n Supply.dispense(suppliabilityMultiplier);\n \n //Debug\n //if(Clock.getRoundNum() == 700) Map.printRadio();\n //if(Clock.getRoundNum() == 1500) BuildOrder.print();\n\n }", "public void PlaceRandomBoard(){\r\n\r\n\t\tString whichShip;\r\n\t\tString coordinate;\r\n\t\t\r\n\t\t\t// Display the random board and the random board menu \r\n\t\t// DISPLAY BOARDS!!!!!\r\n\t\tint whichInput=0;\r\n\t\tShip temp = new Ship();\r\n\t\tRandom generator = new Random();\r\n\t\tint randomIndex = generator.nextInt();\r\n\t\twhile (!this.myBoard.carrier.placed || !this.myBoard.battleship.placed\r\n\t\t\t\t|| !this.myBoard.cruiser.placed || !this.myBoard.submarine.placed\r\n\t\t\t\t|| !this.myBoard.patrolboat.placed) {\r\n\r\n\t\t\twhichInput++;\r\n\r\n\t\t\twhichShip = String.valueOf(whichInput);\r\n\t\t\t\r\n\t\t\tint direction=0;\r\n\r\n\t\t\tboolean placed = false;\r\n\t\t\twhile (!placed) {\r\n\t\t\t\trandomIndex = generator.nextInt(10);\r\n\t\t\t\tcoordinate = this.indexToLetter(randomIndex);\r\n\t\t\t\tcoordinate += String.valueOf(generator.nextInt(10)+1);\r\n\t\t\t\tdirection = generator.nextInt(4) + 1;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tswitch (Integer.parseInt(whichShip)) {\r\n\t\t\t\tcase 1:\r\n\t\t\t\t\ttemp = new Carrier();\r\n\t\t\t\t\ttemp.name=\"Carrier\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 2:\r\n\t\t\t\t\ttemp = new Battleship();\r\n\t\t\t\t\ttemp.name=\"Battleship\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 3:\r\n\t\t\t\t\ttemp = new Cruiser();\r\n\t\t\t\t\ttemp.name=\"Cruiser\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 4:\r\n\t\t\t\t\ttemp = new Submarine();\r\n\t\t\t\t\ttemp.name=\"Submarine\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 5:\r\n\t\t\t\t\ttemp = new PatrolBoat();\r\n\t\t\t\t\ttemp.name=\"Patrol Boat\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} \r\n\t\t\t\t\r\n\t\t\t\tplaced = this.validateShipPlacement(temp, coordinate, direction);\r\n\r\n\t\t\t\tif (placed) {\r\n\t//\t\t\t\tSystem.out.println(\"Success\");\r\n\t\t\t\t\tthis.placeShip(temp, coordinate, direction);\r\n\t\t\t\t\t\r\n\t\t\t\t} else {\r\n\t//\t\t\t\tdisplay.scroll(\"Invalid coordinate, please enter another\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "public void move() {\n\n if (_currentFloor == Floor.FIRST) {\n _directionOfTravel = DirectionOfTravel.UP;\n }\n if (_currentFloor == Floor.SEVENTH) {\n _directionOfTravel = DirectionOfTravel.DOWN;\n }\n\n\n if (_directionOfTravel == DirectionOfTravel.UP) {\n _currentFloor = _currentFloor.nextFloorUp();\n } else if (_directionOfTravel == DirectionOfTravel.DOWN) {\n _currentFloor = _currentFloor.nextFloorDown();\n }\n\n if(_currentFloor.hasDestinationRequests()){\n stop();\n } \n\n }", "public void move()\n {\n daysSurvived+=1;\n\n energy -= energyLostPerDay;\n\n Random generator = new Random();\n\n //losowo okreslony ruch na podstawie genomu\n int turnIndex = generator.nextInt((int)Math.ceil(Genome.numberOfGenes));\n int turn = genome.getGenome().get(turnIndex);\n\n //wywolujemy metode obrotu - dodaje odpowiednio liczbe do aktualnego kierunku\n direction.turn(turn);\n\n //zmieniamy pozycje zwierzaka przez dodanie odpowiedniego wektora\n position = position.add(direction.move());\n //walidacja pozycji tak, by wychodzac za mape byc na mapie z drugiej strony\n position.validatePosition(map.getWidth(),map.getHeight());\n\n moveOnSimulation();\n\n //jesli po ruchu zwierzaczek nie ma juz energii na kolejny ruch\n if(energy < energyLostPerDay )\n {\n this.animalHungry = true;\n }\n }", "public void 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 requestRoute() {\n Intent requestIntent = new Intent(RouteService.CREATE_ROUTE);\n requestIntent.putExtra(\"startLocation\", mStartLocation);\n requestIntent.putExtra(\"category\", mRouteCategory);\n requestIntent.putExtra(\"limitType\", mLimitType); // Enums are serializable. No probs here.\n requestIntent.putExtra(\"limit\", mLimitType == LimitType.DISTANCE ? mLimit : mLimit * 60);\n\n LocalBroadcastManager.getInstance(getSherlockActivity()).sendBroadcast(requestIntent);\n\n ViewSwitcher bottomSwitcher = (ViewSwitcher) getView().findViewById(R.id.switcher_route_options);\n if (bottomSwitcher.getNextView().getId() == R.id.switcher_item_progress) {\n bottomSwitcher.showNext();\n }\n\n ViewSwitcher topSwitcher = (ViewSwitcher) getView().findViewById(R.id.switcher_route_category);\n if (topSwitcher.getNextView().getId() == R.id.route_info_container) {\n topSwitcher.showNext();\n }\n\n // Set Image\n String categoryString;\n switch (mRouteCategory) {\n case WALKING:\n categoryString = \"walking\";\n break;\n case DRINKS:\n categoryString = \"drinks\";\n break;\n case SHOPPING:\n categoryString = \"shopping\";\n break;\n default:\n categoryString = \"\";\n break;\n }\n\n setRouteInfo(mRouteCategory, \"\", \"\", String.format(\"Creating a %s route...\", categoryString));\n\n ViewGroup buttonsContainer = (ViewGroup) topSwitcher.findViewById(R.id.category_buttons_container);\n for (int i = 0; i < buttonsContainer.getChildCount(); i++) {\n if (buttonsContainer.getChildAt(i) instanceof ImageButton) {\n ImageButton button = (ImageButton) buttonsContainer.getChildAt(i);\n button.setBackgroundResource(R.drawable.abs__list_selector_holo_light);\n }\n }\n }", "public void pathwayScan() {\n ScanPathwayBasedAssocSwingWorker worker = new ScanPathwayBasedAssocSwingWorker();\n // buildTask = buildTask.create(buildingThread); //the task is not started yet\n buildTask = RP.create(worker); //the task is not started yet\n buildTask.schedule(0); //start the task\n }", "public void execute(){\n drivetrain.tankDrive(0.6 * direction, 0.6 * direction);\n // slower than full speed so that we actually bring down the bridge,\n // not just slam it and push balls the wrong way\n }", "private void DrawRoute(final DirectionsResult result){\n new Handler(Looper.getMainLooper()).post(new Runnable() {\n @Override\n public void run() {\n if(RouteArrayList.size() > 0 ){\n\n //this for loop removes all the other routes\n //so when a new route is created, all previous routes will be removed\n for(Route route : RouteArrayList){\n route.getPolyline().remove();\n }\n RouteArrayList.clear();\n RouteArrayList = new ArrayList<>();\n }\n\n\n\n for(DirectionsRoute route: result.routes){\n //get the encoded path ( get all the points along each rote)in order to build the polyline\n\n List<com.google.maps.model.LatLng> decodedPath = PolylineEncoding.decode(route.overviewPolyline.getEncodedPath());\n\n List<LatLng> newPath = new ArrayList<>();\n\n for(com.google.maps.model.LatLng latLng: decodedPath){\n newPath.add(new LatLng(latLng.lat,latLng.lng));\n }\n\n Polyline polyline = mMap.addPolyline(new PolylineOptions().addAll(newPath).color(Color.GRAY).width(10));\n\n //make it clickable show that the info about distance/duration will show\n polyline.setClickable(true);\n\n RouteArrayList.add(new Route(polyline, route.legs[0]));\n //keep track of routes.legs[0] too.., diction - key being the polyline id?\n }\n }\n });\n }", "void doMakeMove(CheckersMove move) {\n\n boardData.makeMove(move, false);\n\n /* If the move was a jump, it's possible that the player has another\n jump. Check for legal jumps starting from the square that the player\n just moved to. If there are any, the player must jump. The same\n player continues moving. */\n \n if (move.isJump()) {\n legalMoves = boardData.getLegalJumpsFrom(currentPlayer, move.toRow, move.toCol);\n if (legalMoves != null) {\n if (currentPlayer == CheckersData.RED) {\n console(\"RED: You must continue jumping.\");\n } else {\n console(\"BLACK: You must continue jumping.\");\n }\n selectedRow = move.toRow; // Since only one piece can be moved, select it.\n selectedCol = move.toCol;\n refreshBoard();\n return;\n }\n }\n\n /* The current player's turn is ended, so change to the other player.\n Get that player's legal moves. If the player has no legal moves,\n then the game ends. */\n if (currentPlayer == CheckersData.RED) {\n currentPlayer = CheckersData.BLACK;\n legalMoves = boardData.getLegalMoves(currentPlayer);\n if (legalMoves == null) {\n gameOver(\"BLACK has no moves. RED wins.\");\n } else if (legalMoves[0].isJump()) {\n console(\"BLACK: Make your move. You must jump.\");\n } else {\n console(\"BLACK: Make your move.\");\n }\n } else {\n currentPlayer = CheckersData.RED;\n legalMoves = boardData.getLegalMoves(currentPlayer);\n if (legalMoves == null) {\n gameOver(\"RED has no moves. BLACK wins.\");\n } else if (legalMoves[0].isJump()) {\n console(\"RED: Make your move. You must jump.\");\n } else {\n console(\"RED: Make your move.\");\n }\n }\n\n /* Set selectedRow = -1 to record that the player has not yet selected\n a piece to move. */\n selectedRow = -1;\n\n /* As a courtesy to the user, if all legal moves use the same piece, then\n select that piece automatically so the user won't have to click on it\n to select it. */\n if (legalMoves != null) {\n boolean sameStartSquare = true;\n for (int i = 1; i < legalMoves.length; i++) {\n if (legalMoves[i].fromRow != legalMoves[0].fromRow\n || legalMoves[i].fromCol != legalMoves[0].fromCol) {\n sameStartSquare = false;\n break;\n }\n }\n if (sameStartSquare) {\n selectedRow = legalMoves[0].fromRow;\n selectedCol = legalMoves[0].fromCol;\n }\n }\n\n /* Make sure the board is redrawn in its new state. */\n refreshBoard();\n\n }", "@Override\n public void execute() {\n if (Players.getLocal().getAnimation() == -1) {\n // Teleport to Edgeville if we aren't there, walk to the bank if we are.\n if (!Constants.TO_BANK_AREA.contains(Players.getLocal())) {\n Lodestone.EDGEVILLE.teleport();\n } else {\n if (!Constants.BANK_AREA.contains(Players.getLocal())) {\n Walking.newTilePath(Constants.TO_BANK).traverse();\n Task.sleep(1000);\n }\n }\n }\n }", "private void startGame() {\r\n\t\tthis.gameMap.startGame();\r\n\t}", "@Override\n public void buildWorldObject() {\n setPoint(new Point3d());\n\n List<Point2d> pointList = new ArrayList<Point2d>();\n\n for (int i = 0; i < way.getNodesCount(); i++) {\n Node node = way.getNode(i);\n pointList.add(perspective.calcPoint(node));\n }\n\n list = pointList;\n\n roadWidth = (float) DEFAULT_ROAD_WIDTH;\n\n roadWidth = getRoadWidth();\n\n TextureData texture = getTexture();\n\n Material m = MaterialFactory.createTextureMaterial(texture.getFile());\n\n ModelFactory modelBuilder = ModelFactory.modelBuilder();\n\n int mi = modelBuilder.addMaterial(m);\n\n MeshFactory meshWalls = modelBuilder.addMesh(\"road\");\n\n meshWalls.materialID = mi;\n meshWalls.hasTexture = true;\n\n if (list.size() > 1) {\n\n FaceFactory leftBorder = meshWalls.addFace(FaceType.QUAD_STRIP);\n FaceFactory leftPart = meshWalls.addFace(FaceType.QUAD_STRIP);\n FaceFactory rightBorder = meshWalls.addFace(FaceType.QUAD_STRIP);\n FaceFactory rightPart = meshWalls.addFace(FaceType.QUAD_STRIP);\n\n Vector3d flatSurface = new Vector3d(0, 1, 0);\n\n int flatNormalI = meshWalls.addNormal(flatSurface);\n\n Point2d beginPoint = list.get(0);\n for (int i = 1; i < list.size(); i++) {\n Point2d endPoint = list.get(i);\n\n double x = endPoint.x - beginPoint.x;\n double y = endPoint.y - beginPoint.y;\n // calc lenght of road segment\n double mod = Math.sqrt(x * x + y * y);\n\n double distance = beginPoint.distance(endPoint);\n\n // calc orthogonal for road segment\n double orthX = x * cos90 + y * sin90;\n double orthY = -x * sin90 + y * cos90;\n\n // calc vector for road width;\n double normX = roadWidth / 2 * orthX / mod;\n double normY = roadWidth / 2 * orthY / mod;\n // calc vector for border width;\n double borderX = normX + 0.2 * orthX / mod;\n double borderY = normY + 0.2 * orthY / mod;\n\n double uEnd = distance / texture.getLenght();\n\n // left border\n int tcb1 = meshWalls.addTextCoord(new TextCoord(0, 0.99999d));\n // left part of road\n int tcb2 = meshWalls.addTextCoord(new TextCoord(0, 1 - 0.10d));\n // Middle part of road\n int tcb3 = meshWalls.addTextCoord(new TextCoord(0, 0.00001d));\n // right part of road\n int tcb4 = meshWalls.addTextCoord(new TextCoord(0, 1 - 0.10d));\n // right border\n int tcb5 = meshWalls.addTextCoord(new TextCoord(0, 0.99999d));\n\n // left border\n int tce1 = meshWalls.addTextCoord(new TextCoord(uEnd, 0.99999d));\n // left part of road\n int tce2 = meshWalls.addTextCoord(new TextCoord(uEnd, 1 - 0.10d));\n // Middle part of road\n int tce3 = meshWalls.addTextCoord(new TextCoord(uEnd, 0.00001d));\n // right part of road\n int tce4 = meshWalls.addTextCoord(new TextCoord(uEnd, 1 - 0.10d));\n // right border\n int tce5 = meshWalls.addTextCoord(new TextCoord(uEnd, 0.99999d));\n\n // left border\n int wbi1 = meshWalls.addVertex(new Point3d(beginPoint.x + borderX, 0.0d, -(beginPoint.y + borderY)));\n // left part of road\n int wbi2 = meshWalls.addVertex(new Point3d(beginPoint.x + normX, 0.1d, -(beginPoint.y + normY)));\n // middle part of road\n int wbi3 = meshWalls.addVertex(new Point3d(beginPoint.x, 0.15d, -beginPoint.y));\n // right part of road\n int wbi4 = meshWalls.addVertex(new Point3d(beginPoint.x - normX, 0.1d, -(beginPoint.y - normY)));\n // right border\n int wbi5 = meshWalls.addVertex(new Point3d(beginPoint.x - borderX, 0.0d, -(beginPoint.y - borderY)));\n\n // left border\n int wei1 = meshWalls.addVertex(new Point3d(endPoint.x + borderX, 0.0d, -(endPoint.y + borderY)));\n // left part of road\n int wei2 = meshWalls.addVertex(new Point3d(endPoint.x + normX, 0.1d, -(endPoint.y + normY)));\n // middle part of road\n int wei3 = meshWalls.addVertex(new Point3d(endPoint.x, 0.15d, -endPoint.y));\n // right part of road\n int wei4 = meshWalls.addVertex(new Point3d(endPoint.x - normX, 0.1d, -(endPoint.y - normY)));\n // right border\n int wei5 = meshWalls.addVertex(new Point3d(endPoint.x - borderX, 0.0d, -(endPoint.y - borderY)));\n\n leftBorder.addVert(wbi1, tcb1, flatNormalI);\n leftBorder.addVert(wbi2, tcb2, flatNormalI);\n leftBorder.addVert(wei1, tce1, flatNormalI);\n leftBorder.addVert(wei2, tce2, flatNormalI);\n\n leftPart.addVert(wbi2, tcb2, flatNormalI);\n leftPart.addVert(wbi3, tcb3, flatNormalI);\n leftPart.addVert(wei2, tce2, flatNormalI);\n leftPart.addVert(wei3, tce3, flatNormalI);\n\n rightBorder.addVert(wbi3, tcb3, flatNormalI);\n rightBorder.addVert(wbi4, tcb4, flatNormalI);\n rightBorder.addVert(wei3, tce3, flatNormalI);\n rightBorder.addVert(wei4, tce4, flatNormalI);\n\n rightPart.addVert(wbi4, tcb4, flatNormalI);\n rightPart.addVert(wbi5, tcb5, flatNormalI);\n rightPart.addVert(wei4, tce4, flatNormalI);\n rightPart.addVert(wei5, tce5, flatNormalI);\n\n beginPoint = endPoint;\n }\n }\n\n model = modelBuilder.toModel();\n model.setUseLight(true);\n model.setUseTexture(true);\n\n buildModel = true;\n }" ]
[ "0.7142645", "0.65781045", "0.6388299", "0.63792795", "0.63259727", "0.62553763", "0.62180495", "0.6087949", "0.60822177", "0.60560316", "0.6018821", "0.5923121", "0.5911318", "0.58971167", "0.5882591", "0.5880048", "0.58739173", "0.58549887", "0.5847164", "0.5845303", "0.5835144", "0.58160263", "0.58042264", "0.5801686", "0.5792554", "0.5781621", "0.57801914", "0.5756912", "0.5756015", "0.5750727", "0.5743821", "0.57425493", "0.5740817", "0.5733008", "0.57250017", "0.5721033", "0.57035995", "0.56979793", "0.56864756", "0.56855625", "0.56852674", "0.5675387", "0.56602895", "0.56589353", "0.56563556", "0.5640894", "0.56140023", "0.5608009", "0.5605916", "0.5601248", "0.5596465", "0.5590667", "0.55885726", "0.55817676", "0.55795586", "0.5577275", "0.55768406", "0.55763805", "0.55754983", "0.55715746", "0.55632466", "0.55600905", "0.5559493", "0.5557341", "0.55524975", "0.55500025", "0.55278075", "0.5526045", "0.552421", "0.5521595", "0.5520427", "0.55167276", "0.5511112", "0.5510909", "0.55060124", "0.55003554", "0.5500118", "0.5499469", "0.5495178", "0.5491648", "0.54912066", "0.5484423", "0.548204", "0.5478578", "0.5477966", "0.547253", "0.5470083", "0.54696316", "0.54691744", "0.5468511", "0.5463645", "0.54620844", "0.5451688", "0.54479265", "0.5447682", "0.5446082", "0.54447305", "0.54427606", "0.5442192", "0.5439579", "0.54395205" ]
0.0
-1
This method is called when a player tries to build a settlement
boolean CanBuySettlement();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void buildSettlement() {\r\n\t\t// client.setCurrentPhase(Constants.PHASE_3);\r\n\t\tlastSettlementNode = clickedNode;\r\n\t\tMessage message = new Message(clickedNode, true, null);\r\n\t\tsendMessage(message);\r\n\t}", "@Override\r\n\tpublic void buildSettlement() {\n\t\t\r\n\t}", "@Override\n\tpublic void payCrew() {\n\t\tSystem.out.println(\"Crew paid!, You can start sailing now!\");\n\t\tgame.loading();\n\t}", "public boolean canDoBuySettlement(){\n\t\t if(resourceCardHand.canDoPayForSettlement() == false || playerPieces.hasAvailableSettlement() == false) {\n\t\t\t return false;\n\t\t }\n\t\t // If the player does not have a valid place to put a settlement on the map, we won't let the player buy one\n\t\t if(playerPieces.canPlaceASettlementOnTheMap() == false) {\n\t\t\t return false;\n\t\t }\n\t\t return true;\n\t }", "public void buySettlement(Vertex vertex) throws CannotBuyException, InsufficientPlayerResourcesException, AllPiecesPlayedException{\n\t\t if(canDoBuySettlement() == false) {\n\t\t\t throw new CannotBuyException(\"Cannot Buy Settlement, possibly no vertex to place a settlement\");\n\t\t }\n\t\t resourceCardHand.payForSettlement();\n\t\t playerPieces.placeSettlement(vertex);\n\t\t // increment victory points\n\t\t totalVictoryPoints++;\n\t }", "@MessageMapping(\"/setupsettlement\")\n @SendTo(\"/topic/settlement\")\n public ViewPiece setupSettlement(ViewPiece pNew, Principal caller){\n System.out.println(\"Check settlement\");\n Player checkee = gameManager.getPlayerFromString(caller.getName());\n Intersection checker = gameManager.getGame().getBoard().getIntersections().get(pNew.getId());\n boolean isValid = gameManager.checkIntersectionSetupEligibility(checker);\n if(isValid) {\n gameManager.placeSettlement(checkee, checker);\n }\n pNew.setIsValid(isValid);\n return pNew;\n }", "public void notifyCreation() {\n Player targetPlayer = this.getTarget().getPlayerReference(Player.class),\n senderPlayer = this.getToTeleport().getPlayerReference(Player.class);\n\n if (targetPlayer == null || senderPlayer == null) {\n return;\n }\n\n MainData.getIns().getMessageManager().getMessage(\"TPA_SENT\").sendTo(senderPlayer);\n\n if (this.type == TeleportType.TPA) {\n MainData.getIns().getMessageManager().getMessage(\"TPA_REQUESTED\")\n .format(\"%player%\", getToTeleport().getNameWithPrefix()).sendTo(targetPlayer);\n } else if (this.type == TeleportType.TPHERE) {\n MainData.getIns().getMessageManager().getMessage(\"TPHERE_REQUESTED\")\n .format(\"%player%\", getToTeleport().getNameWithPrefix()).sendTo(targetPlayer);\n }\n\n }", "@Override\n public void ready() {\n Entity en = ce();\n\n if ((en instanceof Dropship) && !en.isAirborne()) {\n ArrayList<Coords> crushedBuildingLocs = new ArrayList<Coords>();\n ArrayList<Coords> secondaryPositions = new ArrayList<Coords>();\n secondaryPositions.add(en.getPosition());\n for (int dir = 0; dir < 6; dir++) {\n secondaryPositions.add(en.getPosition().translated(dir));\n }\n for (Coords pos : secondaryPositions) {\n Building bld = clientgui.getClient().getGame().getBoard()\n .getBuildingAt(pos);\n if (bld != null) {\n crushedBuildingLocs.add(pos);\n }\n }\n if (!crushedBuildingLocs.isEmpty()) {\n JOptionPane\n .showMessageDialog(\n clientgui,\n Messages.getString(\"DeploymentDisplay.dropshipBuildingDeploy\"), //$NON-NLS-1$\n Messages.getString(\"DeploymentDisplay.alertDialog.title\"), //$NON-NLS-1$\n JOptionPane.ERROR_MESSAGE);\n return;\n }\n }\n\n disableButtons();\n\n clientgui.getClient().deploy(cen, en.getPosition(), en.getFacing(),\n en.getElevation(), en.getLoadedUnits(), assaultDropPreference);\n en.setDeployed(true);\n\n if (ce().isWeapOrderChanged()) {\n clientgui.getClient().sendEntityWeaponOrderUpdate(ce());\n }\n endMyTurn();\n }", "private void createNewUnit()\r\n {\r\n int currentPlayer = worldPanel.getCurrentPlayer();\r\n int currentUnit = worldPanel.getCurrentUnit();\r\n int randomNumber = (int)Math.ceil(Math.random() * 8);\r\n boolean canBuild = false;\r\n\r\n if(currentPlayer == 1)\r\n {\r\n int unitType = worldPanel.player1.units[currentUnit - 1].getUnitType();\r\n if(unitType == 1)//if unit is a settler\r\n canBuild = true;\r\n }\r\n\r\n else if(currentPlayer == 2)\r\n {\r\n int unitType = worldPanel.player2.units[currentUnit - 1].getUnitType();\r\n if(unitType == 1)//if unit is a settler\r\n canBuild = true;\r\n }\r\n\r\n //if the unit who presses build is a settler\r\n if(canBuild == true)\r\n {\r\n if(currentPlayer == 1)\r\n {\r\n int playerLoc = worldPanel.player1.units[currentUnit - 1].getPosition();\r\n worldPanel.player1.addUnit2(randomNumber);\r\n int noUnits = worldPanel.player1.getNumUnits();\r\n\t\t\t\t\t\t\t\tif(randomNumber == 7)//if unit is a ship\r\n\t\t\t\t\t\t\t\t\tworldPanel.player1.units[noUnits].setPosition(getSeaLoc(playerLoc));\r\n\t\t\t\t\t\t\t\telse\r\n \tworldPanel.player1.units[noUnits].setPosition(playerLoc);\r\n worldPanel.player1.setNumUnits(noUnits + 1);\r\n currentUnit++;\r\n worldPanel.setCurrentUnit(currentUnit);\r\n }//end if\r\n else if(currentPlayer == 2)\r\n {\r\n int playerLoc = worldPanel.player2.units[currentUnit - 1].getPosition();\r\n worldPanel.player2.addUnit2(randomNumber);\r\n int noUnits = worldPanel.player2.getNumUnits();\r\n\t\t\t\t\t\t\t\tif(randomNumber == 7)//if unit is a ship\r\n\t\t\t\t\t\t\t\t\tworldPanel.player2.units[noUnits].setPosition(getSeaLoc(playerLoc));\r\n\t\t\t\t\t\t\t\telse\r\n \tworldPanel.player2.units[noUnits].setPosition(playerLoc);\r\n worldPanel.player2.setNumUnits(noUnits + 1);\r\n currentUnit++;\r\n worldPanel.setCurrentUnit(currentUnit);\r\n }//end elseif\r\n }//end if\r\n\r\n //set new player and unit if necessary\r\n int temp = worldPanel.getNumUnits(currentPlayer);\r\n if(currentUnit > temp)\r\n {\r\n if(currentPlayer == 1)\r\n worldPanel.setCurrentPlayer(2);\r\n else\r\n worldPanel.setCurrentPlayer(1);\r\n worldPanel.setCurrentUnit(1);\r\n }//end if\r\n\r\n //set up new mapPosition if player moved\r\n if(canBuild == true)\r\n setMapPos();\r\n setInfoPanel();//set up information panel\r\n }", "private void prepareDeal(){\n\t\tdeck.shuffle();\n\t\tplayers.clear(); //Remove any possible rubbish\n\t\tfor(Player p : seatPlayers){\n\t\t\tif(p != null){\n\t\t\t\tList<BlackjackHand> hands = new ArrayList<>();\n\t\t\t\tBlackjackHand hand = new BlackjackHandPlayer();\n\t\t\t\thands.add(hand);\n\t\t\t\thistoricalActions.put(hand, new ArrayList<>());\n\t\t\t\tplayers.put(p, hands);\n\t\t\t}\n\t\t}\n\t\tdealerHand = new BlackjackHandDealer();\n\t}", "@Override\n\tpublic void execute() {\n\t\t\n\t\tif (GamesHandler.test) {\n\t\t\tserverModel = ServerFacadeTest.getSingleton().getGameModel(gameID);\n\t\t} else {\n\t\t\tserverModel = ServerFacade.getSingleton().getGameModel(gameID);\n\t\t}\n\t\t\n\t\tPlayer player = serverModel.getPlayers().get(sender);\n\t\tDevCardList playerOldDevCards = player.getOldDevCards();\n\t\t\n\t\tplayerOldDevCards.setRoadBuilding(playerOldDevCards.getRoadBuilding() - 1);\n\t\t\n\t\tserverModel.getMap().addRoad(new Road(sender, spot1));\n\t\tserverModel.getMap().addRoad(new Road(sender, spot2));\n\t\t\n\t\tplayer.setRoads(player.getRoads() - 2);\n\t\t\n\t\tplayer.setPlayedDevCard(true);\n\t\t\n\t\tMessageLine line = new MessageLine();\n\t\tString username = player.getName();\n\t\tif(username.toLowerCase().equals(\"ife\") || username.toLowerCase().equals(\"ogeorge\")){\n\t\t\tline.setMessage(\"Ife built a couple of roads to try to catch up with Paul, but Daniel always wins anyway\");\n\t\t}\n\t\telse{\n\t\t\tline.setMessage(username + \" built a couple roads with a road building development card\");\n\t\t}\n//\t\tline.setMessage(username + \" built a couple roads with a road building development card\");\n\t\tline.setSource(username);\n\t\tserverModel.getLog().addLine(line);\n\t}", "public void purchaseTower(Tower towerType){ //This method will pruchase a tower from the player class given a Attacker Object\n if(this.coins()<towerType.getPrice()){ //checks to make sure that the player has neough money, if not it returns\n return;\n }\n\n myGame.addTower(Tower towerType); //calls the addTower method from the game class. Game will be resopnsible for storing towers not the player class\n this.coins-=towerType.getPrice(); //decrement the appropriate number of coins after purchsing the tower\n }", "@Override\n\tpublic void passedBy() {\n\t\tMonopolyGameController.getInstance();\n\t\tMonopolyGameController.getCurrentPlayer().increaseMoney(250);\n\t\tLogger.getInstance().notifyAll(MonopolyGameController.getCurrentPlayer().getName()+ \" gained 250 dollars by landing on Bonus Square\");\n\n\t}", "public void tryDeal() {\n if(previousTie){\n previousTie = false;\n emptyHands();\n shuffle();\n }\n if (player.getBet() < 2) {\n errorFlag = true;\n userMessage = \"You must bet a minimum of $2\";\n return;\n } else if (player.getHand().size() > 0) {\n errorFlag = true;\n userMessage = \"You have already been dealt your initial hand\";\n return;\n } else {\n player.setHand(deal(player.getHand(), 2));\n if (player.getHand().get(0).getValue() == player.getHand().get(1).getValue()) {\n //User can split if they want to\n userMessage = \"Hit, Stand or Split\";\n splitDisabled = false;\n }else{\n userMessage = \"Hit or Stand\";\n }\n dealDisabled = true;\n againDisabled = true;\n doubleDisabled = false;\n standDisabled = false;\n hitDisabled = false;\n bettingDisabled = true;\n }\n }", "private void startUpPhase()\n\t{\n\t\tmap.distributeCountries(); /* Randomly split the countries between the players */\n\t\tArrayList<Player> remainingPlayers = new ArrayList<Player>(map.players);\n\t\t\n\t\tdo \n\t\t{\n\t\t\tIterator<Player> i = remainingPlayers.iterator();\n\t\t\t\n\t\t\twhile (i.hasNext()) \n\t\t\t{\n\t\t\t\tPlayer p = i.next();\n\t\t\t\tif(p.getArmies() == 0) \n\t\t\t\t{\n\t\t\t\t\ti.remove();\n\t\t\t\t} \n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\tp.placeOneArmy();\n\t\t\t\t}\n\t\t\t}\n\t\t}while(remainingPlayers.size() != 0);\n\t}", "public void pickUpHerd() {\n rounds.get(currentRound).currentPlayerPickUpHerd();\n }", "public void requestAccepted(String username)\n\t{\n\t\t// Player otherPlayer = TcpProtocolHandler.getPlayer(username);\n\t\tPlayer otherPlayer = ActiveConnections.getPlayer(username);\n\t\tif(otherPlayer != null)\n\t\t{\n\t\t\tif(m_requests.containsKey(username))\n\t\t\t\tswitch(m_requests.get(username))\n\t\t\t\t{\n\t\t\t\t\tcase BATTLE:\n\t\t\t\t\t\t/* First, ensure both players are on the same map */\n\t\t\t\t\t\tif(otherPlayer.getMap() != getMap())\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t/* Based on the map's pvp type, check this battle is possible If pvp is enforced, it will be started when the offer is made */\n\t\t\t\t\t\tif(getMap().getPvPType() != null)\n\t\t\t\t\t\t\tswitch(getMap().getPvPType())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcase DISABLED:\n\t\t\t\t\t\t\t\t\t/* Some maps have pvp disabled */\n\t\t\t\t\t\t\t\t\tServerMessage sendNotOther = new ServerMessage(ClientPacket.PVP_PACKETS);\n\t\t\t\t\t\t\t\t\tsendNotOther.addInt(2);\n\t\t\t\t\t\t\t\t\totherPlayer.getSession().Send(sendNotOther);\n\t\t\t\t\t\t\t\t\tServerMessage sendNot = new ServerMessage(ClientPacket.PVP_PACKETS);\n\t\t\t\t\t\t\t\t\tsendNot.addInt(2);\n\t\t\t\t\t\t\t\t\tgetSession().Send(sendNot);\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\tcase ENABLED:\n\t\t\t\t\t\t\t\t\t/* This is a valid battle, start it */\n\t\t\t\t\t\t\t\t\tensureHealthyPokemon();\n\t\t\t\t\t\t\t\t\totherPlayer.ensureHealthyPokemon();\n\t\t\t\t\t\t\t\t\tm_battleField = new PvPBattleField(DataService.getBattleMechanics(), this, otherPlayer);\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\tcase ENFORCED:\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tm_battleField = new PvPBattleField(DataService.getBattleMechanics(), this, otherPlayer);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TRADE:\n\t\t\t\t\t\tif(canTrade() && otherPlayer.canTrade())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t/* Set the player as talking so they can't move */\n\t\t\t\t\t\t\tm_isTalking = true;\n\t\t\t\t\t\t\t/* Create the trade */\n\t\t\t\t\t\t\tm_trade = new Trade(this, otherPlayer);\n\t\t\t\t\t\t\totherPlayer.setTrade(m_trade);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tServerMessage sendNotOther = new ServerMessage(ClientPacket.PVP_PACKETS);\n\t\t\t\t\t\t\tsendNotOther.addInt(4);\n\t\t\t\t\t\t\totherPlayer.getSession().Send(sendNotOther);\n\t\t\t\t\t\t\tServerMessage sendNot = new ServerMessage(ClientPacket.PVP_PACKETS);\n\t\t\t\t\t\t\tsendNot.addInt(4);\n\t\t\t\t\t\t\tgetSession().Send(sendNot);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tServerMessage sendNot = new ServerMessage(ClientPacket.PVP_PACKETS);\n\t\t\tsendNot.addInt(0);\n\t\t\tgetSession().Send(sendNot);\n\t\t}\n\t}", "@Override\n protected void trade(){\n // An example of a random trade proposal: offer peasants in exchange of soldiers\n // Pick the id of the potential partner (without checking if it is my neighbor)\n double pertnerID = (new Random()).nextInt(42)+1;\n trade[0] = pertnerID;\n // Choose the type of good demanded (peasants - 3)\n double demandType = 3;\n trade[1] = demandType;\n // Choose the amount of demanded goods\n double demand = Math.random();\n trade[2] = demand;\n // Choose the type of good offered in exchange (peasants - 2)\n double offerType = 2;\n trade[3] = offerType;\n // Choode the amount of goods offered in exchange (random but less than my total number of peasants)\n double offer = (new Random()).nextDouble()*myTerritory.getPeasants();\n trade[4] = offer;\n\n // This procedure updated the array trade, which contains the information\n // about trade proposals of the current lord\n }", "public void doLogicBuy() {\n\t\tif (!player.isHuman) {\n\t\t\tif (player.money > estimatedFee * 1.5) //\n\t\t\t{\n\t\t\t\tint free = (int) (player.money - estimatedFee * 1.5);\n\t\t\t\tCell c = board.getCells().get(player.position);\n\t\t\t\tif (c instanceof TradeableCell) {\n\t\t\t\t\tTradeableCell tc = (TradeableCell) c;\n\t\t\t\t\tif (tc.getOwner() == null && tc.getPrice() < free) {\n\t\t\t\t\t\ttc.buy(player);\n\t\t\t\t\t\tboard.addMessage(\"Just bought\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void landedOn() {\n\t\tMonopolyGameController.getInstance();\n\t\tMonopolyGameController.getCurrentPlayer().increaseMoney(300);\n\t\tLogger.getInstance().notifyAll(MonopolyGameController.getCurrentPlayer().getName()+ \" gained 300 dollars by landing on Bonus Square\");\n\t\tMonopolyGameController.allowCurrentPlayerToEndTurn();\n\n\t}", "private void busquets() {\n\t\ttry {\n\t\t\tThread.sleep(5000); // espera, para dar tempo de ver as mensagens iniciais\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tint xInit = -25;\n\t\tint yInit = -10;\n\t\tplayerDeafaultPosition = new Vector2D(xInit*selfPerception.getSide().value(), yInit *selfPerception.getSide().value());\n\t\t\n\t\twhile (commander.isActive()) {\n\t\t\tupdatePerceptions(); // deixar aqui, no começo do loop, para ler o resultado do 'move'\n\t\t\tswitch (matchPerception.getState()) {\n\t\t\tcase BEFORE_KICK_OFF:\n\t\t\t\tcommander.doMoveBlocking(xInit, yInit);\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase PLAY_ON:\n\t\t\t\tstate = State.ATTACKING;\n\t\t\t\texecuteStateMachine();\n\t\t\t\tbreak;\n\t\t\tcase KICK_OFF_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase KICK_OFF_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\t//if(closer)\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CORNER_KICK_LEFT: // escanteio time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CORNER_KICK_RIGHT: // escanteio time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase KICK_IN_LEFT: // lateral time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\tcase KICK_IN_RIGHT: // lateal time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_LEFT: // Tiro livre time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_RIGHT: // Tiro Livre time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_FAULT_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_FAULT_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase GOAL_KICK_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase GOAL_KICK_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase AFTER_GOAL_LEFT:\n\t\t\t\tcommander.doMoveBlocking(xInit, yInit);\t\n\t\t\t\tbreak;\n\t\t\tcase AFTER_GOAL_RIGHT:\n\t\t\t\tcommander.doMoveBlocking(xInit, yInit);\t\n\t\t\t\tbreak;\n\t\t\tcase INDIRECT_FREE_KICK_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase INDIRECT_FREE_KICK_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "private void buyPlayer(FootballPlayer player, String playerName, int num) {\n\t\tint valid = game.addPlayer(playerName);\n\t\tif(valid==0) {\n\t\t\tplayerNameArray[num].setText(playerName);\n\t\t\timageArray[num].setIcon(MainGui.getShirt(player.getTeamName()));\n\t\t\tbuttonArray[num].setText(\"X\");\n\t\t\tlblBudgetText.setText(game.getCurrentUser().getBudget() + \" RGG\");\n\t\t\t\n\t\t} else if (valid==1) {\n\t\t\tJOptionPane.showMessageDialog(frame,\"You have already selected this player for your team\");\n\t\t} else if (valid==-1) {\n\t\t\tJOptionPane.showMessageDialog(frame,\"You don´t have enough budget too buy \" + playerName);\n\t\t}\n\t}", "public void setStartConditions() {\r\n\t\tplayer1.relocate(0, 0);\r\n\t\tgamemap.setPlayerLocation(1, 1);\r\n\t\tgamemap.setEnemyLocation(20, 10);\r\n\t\tenemy1.relocate(19*46, 9*85);\r\n\t\tportal1.relocate(9*46, 9*85);\r\n\t\tportal2.relocate(9*46, 0*85);\r\n\t\tspikes1.relocate(5*46,0*85);\r\n\t\tspikes2.relocate(5*46,1*85);\r\n\t\tspikes3.relocate(5*46,2*85);\r\n\t\tspikes4.relocate(5*46,7*85);\r\n\t\tspikes5.relocate(5*46,8*85);\r\n\t\tspikes6.relocate(5*46,9*85);\r\n\t\tspikes7.relocate(10*46,2*85);\r\n\t\tspikes8.relocate(10*46,3*85);\r\n\t\tspikes9.relocate(10*46,4*85);\r\n\t\tspikes10.relocate(10*46,5*85);\r\n\t\tspikes11.relocate(10*46,6*85);\r\n\t\tspikes12.relocate(10*46,7*85);\r\n\t\tspikes13.relocate(15*46,0*85);\r\n\t\tspikes14.relocate(15*46,1*85);\r\n\t\tspikes15.relocate(15*46,2*85);\r\n\t\tspikes16.relocate(15*46,7*85);\r\n\t\tspikes16.relocate(15*46,8*85);\r\n\t\tspikes17.relocate(15*46,9*85);\r\n\t\tRandom randomObj = new Random();\r\n\t\tint randomX = randomObj.nextInt(20);\r\n\t\tint randomY = randomObj.nextInt(10);\r\n\t\tcoins1.relocate(randomX*46, randomY*85);\r\n\t\tgamemap.setLootLocation(randomX + 1, randomY + 1);\r\n\t\t//coins1.relocate(10*46,5*85);\r\n\t\t//gamemap.setLootLocation(11, 6);\r\n\t}", "public void beginTakingPlayers() {\n currentQuestionIndex = 0;\n setGameState(GameState.AWAITING_PLAYERS);\n }", "public void newHand() {\n if(player.getSecondHand().size() > 0){\n player.emptySecondHand(deck);\n shuffle();\n }\n player.resetBet();\n dealer.resetBet();\n errorFlag = false;\n userMessage = \"Place your Bet\";\n againDisabled = true;\n dealDisabled = false;\n hitDisabled = true;\n splitDisabled = true;\n standDisabled = true;\n doubleDisabled = true;\n bettingDisabled = false;\n emptyHands();\n }", "@Override\n public void placeSettlement(VertexLocation vertex) throws ModelException {\n assert vertex != null;\n if (!GameModelFacade.instance().canPlaceSettlement(vertex)) {\n throw new ModelException(\"Preconditions for action not met.\");\n }\n\n try {\n String clientModel = m_theProxy.buildSettlement(GameModelFacade.instance().getLocalPlayer().getIndex(), vertex, GameModelFacade.instance().isFreeRound());\n new ModelInitializer().initializeClientModel(clientModel, m_theProxy.getPlayerId());\n } catch (NetworkException e) {\n throw new ModelException(e);\n }\n }", "public void placeSettlement(Player p, Corner c){\r\n if(c.getSettlement()==Settlement.NONE){\r\n c.placeSettlement(Settlement.SMALL,p);\r\n }\r\n else{\r\n c.placeSettlement(Settlement.LARGE, p);\r\n }\r\n }", "private void constructionPhase() {\n for( final Player p : playerList ) {\n this.player = p;\n player.flipAllUp();\n ClickObserver.getInstance().setActivePlayer(this.player);\n pause();\n\n ClickObserver.getInstance().setTerrainFlag(\"\");\n ClickObserver.getInstance().setClickedTerrain(player.getHexesOwned().get(0));\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n Board.applyCovers();\n GUI.getRackGui().setOwner(player);\n GUI.getHelpText().setText(\"Construction Phase: \" + p.getName() \n + \", select one of your tiles to build a new tower, or upgrade an existing one.\");\n ClickObserver.getInstance().whenTerrainClicked();\n }\n });\n\t\t\ttry { Thread.sleep(500); } catch( Exception e ){ return; }\n ClickObserver.getInstance().setTerrainFlag(\"Construction: ConstructFort\");\n ArrayList<Terrain> ownedHexes = player.getHexesOwned();\n for (final Terrain t : ownedHexes) {\n if (t.getOwner().getName().equals(player.getName())) {\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n t.uncover();\n }\n });\n }\n }\n while( isPaused ){\n try { Thread.sleep(100); } catch( Exception e ){ return; }\n }\n player.flipAllDown();\n }\n ClickObserver.getInstance().setTerrainFlag(\"\");\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n Board.removeCovers();\n }\n });\n }", "private void prepareWorkplace() throws GameActionException {\r\n\t\tFluxDeposit[] fluxDeposits = myRC.senseNearbyFluxDeposits();\r\n\t\tfor (FluxDeposit deposit : fluxDeposits) {\r\n\t\t\tFluxDepositInfo info = myRC.senseFluxDepositInfo(deposit);\r\n\t\t\tif (fluxInfo == null)\r\n\t\t\t\tfluxInfo = info;\r\n\t\t\tif (fluxInfo.location.distanceSquaredTo(myRC.getLocation()) > info.location.distanceSquaredTo(myRC.getLocation()))\r\n\t\t\t\tfluxInfo = info;\r\n\t\t}\r\n\t}", "public void isOrderUpTrump(int playerID){\n if(turn == playerID && gameStage == 1 && dealer != 0){\n currentTrumpSuit = middleCardSuit;\n // make dealer discard a card and give them the middle card\n if(dealer == 1){\n // remove a card from the player's hand and add the middle card\n player2Hand.remove(2);\n player2Hand.add(middleCard);\n turn = 2;\n gameStage = 3;\n }\n else if(dealer == 2){\n // remove a card from the player's hand and add the middle card\n player3Hand.remove(2);\n player3Hand.add(middleCard);\n turn = 3;\n gameStage = 3;\n }\n else if(dealer == 3){\n // remove a card from the player's hand and add the middle card\n player4Hand.remove(2);\n player4Hand.add(middleCard);\n turn = 0;\n gameStage = 3;\n }\n }\n }", "private void firstRound(Player player)\n {\n PowerUpCard option1 = powerUpCardDeck.getFirstCard();\n PowerUpCard option2 = powerUpCardDeck.getFirstCard();\n try\n {\n String chosenId = player.getView().chooseSpawnPoint(option1.getCardData(), option2.getCardData());\n PowerUpCard chosen = option1.getId().equals(chosenId) ? option1 : option2;\n Block spawnPoint = map.findRoomByColor(chosen.getColor()).getSpawnPoint();\n powerUpCardDeck.addCard(chosen);\n player.addPowerUpCard(chosen.equals(option1) ? option2 : option1);\n player.setBlock(spawnPoint);\n player.setFirstRoundPlayed(true);\n sendBroadcastUpdate();\n }\n catch (ConnectionErrorException | TimeOutException e)\n {\n powerUpCardDeck.addCard(option1);\n powerUpCardDeck.addCard(option2);\n throw e;\n }\n\n }", "@Override\n public void receiveStartGame(){\n for (AbstractCard c : AbstractDungeon.player.masterDeck.group) {\n if (c instanceof AwakenedForm) {\n ((AwakenedForm) c).updateAwakenCost();\n }\n }\n }", "protected final void hit() throws InsufficientCardsException {\n hand.add(deck.deal());\n update();\n }", "@Override\r\n\tpublic void payCheck() {\n\t\t\r\n\t}", "private void setupPhase() {\n ClickObserver.getInstance().setTerrainFlag(\"Setup: SelectStartTerrain\");\n for (final Player p : playerList) {\n \t\n this.player = p;\n player.flipAllUp();\n ClickObserver.getInstance().setActivePlayer(this.player);\n pause();\n \n // Cover all terrains, uncover starting pos ones\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n GUI.getRackGui().setOwner(player);\n \tBoard.applyCovers();\n \tfor (Coord spot : startingPos) {\n \t\tif (!Board.getTerrainWithCoord(spot).isOccupied())\n \t\t\tBoard.getTerrainWithCoord(spot).uncover();\n \t}\n GUI.getHelpText().setText(\"Setup Phase: \" + p.getName() \n + \", select a valid hex to start your kingdom.\");\n }\n });\n while( isPaused ){\n int num = p.getHexesOwned().size();\n if( num == 1 ){\n unPause();\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n \tPlayerBoard.getInstance().updateGold(player);\n }\n });\n System.out.println(\"done\");\n }\n try { Thread.sleep(100); } catch( Exception e ){ return; }\n }\n player.flipAllDown();\n }\n pause();\n \n // Now that all players have selected starting spots, flip over all terrains\n // *Note: Not sure I understand the rules with regards to this, but I think this is right\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n \t Board.showTerrains();\n Board.removeBadWaters();\n }\n });\n while( isPaused ){\n try { Thread.sleep(100); } catch( Exception e ){ return; }\n }\n \n // Check if player has at least two land hexes around starting spot\n for( final Player p : playerList ) {\n this.player = p;\n\n player.flipAllUp();\n ClickObserver.getInstance().setActivePlayer(this.player);\n pause();\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n GUI.getHelpText().setText(p.getName() \n + \", select a water hex to replace with from deck\");\n Board.removeBadAdjWaters();\n }\n });\n while( isPaused ){\n try { Thread.sleep(100); } catch( Exception e ){ return; }\n }\n\n player.flipAllDown();\n }\n \n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n \t\t\tTileDeck.getInstance().slideOut();\n }\n });\n\n \n // next prompt each player to select an adjacent hex\n ClickObserver.getInstance().setTerrainFlag(\"Setup: SelectTerrain\");\n // loop 2 times so each player adds 2 more hexes\n for( int i=0; i<2; i++ ){\n for( final Player p : playerList ) {\n this.player = p;\n\n player.flipAllUp();\n ClickObserver.getInstance().setActivePlayer(this.player);\n pause();\n \n final ArrayList<Terrain> ownedHexes = player.getHexesOwned();\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n Board.applyCovers();\n }\n });\n \tfor (Terrain t1 : ownedHexes) {\n \t\tIterator<Coord> keySetIterator = Board.getTerrains().keySet().iterator();\n \twhile(keySetIterator.hasNext()) {\n \t\tCoord key = keySetIterator.next();\n \t\tfinal Terrain t2 = Board.getTerrains().get(key);\n \t\tif (t2.compareTo(t1) == 1 && !t2.isOccupied() && !t2.getType().equals(\"SEA\")) {\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n \t\t\tt2.uncover();\n }\n });\n \t\t}\n \t}\n \t}\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n GUI.getRackGui().setOwner(player);\n GUI.getHelpText().setText(\"Setup Phase: \" + p.getName() \n + \", select an adjacent hex to add to your kingdom.\");\n }\n });\n // forces the GameLoop thread to wait until unpaused\n while( isPaused ){\n try { Thread.sleep(100); } catch( Exception e ){ return; }\n }\n player.flipAllDown();\n }\n }\n // prompt each player to place their first tower\n ClickObserver.getInstance().setTerrainFlag(\"Construction: ConstructFort\");\n for( final Player p : playerList ) {\n this.player = p;\n \n player.flipAllUp();\n ClickObserver.getInstance().setActivePlayer(this.player);\n pause();\n \n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n Board.applyCovers();\n GUI.getRackGui().setOwner(player);\n GUI.getHelpText().setText(\"Setup Phase: \" + p.getName() \n + \", select one of your tiles to place a tower.\");\n }\n });\n \n // sleeps to avoid null pointer (runLater is called before player.getHexesOwned() below)\n try { Thread.sleep(50); } catch( Exception e ){ return; }\n ArrayList<Terrain> ownedHexes = player.getHexesOwned();\n \n for (final Terrain t : ownedHexes) {\n \t\n \tif (t.getOwner().getName().equals(player.getName())) { \n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n \t\tt.uncover();\n }\n });\n \t}\n }\n while( isPaused ){\n try { Thread.sleep(100); } catch( Exception e ){ return; }\n }\n player.flipAllDown();\n }\n // allow players to add some or all things to their tiles.\n ClickObserver.getInstance().setTerrainFlag(\"RecruitingThings: PlaceThings\");\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n GUI.getDoneButton().setDisable(false);\n }\n });\n for (final Player p : playerList) {\n this.player = p;\n player.flipAllUp();\n doneClicked = false;\n ClickObserver.getInstance().setClickedTerrain(p.getHexesOwned().get(2));\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n \tClickObserver.getInstance().whenTerrainClicked();\n GUI.getRackGui().setOwner(player);\n Board.applyCovers();\n GUI.getHelpText().setText(\"Setup Phase: \" + p.getName()\n + \", place some or all of your things on a tile you own.\");\n }\n });\n ClickObserver.getInstance().setActivePlayer(this.player);\n pause();\n ArrayList<Terrain> ownedHexes = player.getHexesOwned();\n for (final Terrain t : ownedHexes) {\n \tif (t.getOwner().getName().equals(player.getName())) {\n\t Platform.runLater(new Runnable() {\n\t @Override\n\t public void run() {\n\t \t\tt.uncover();\n\t }\n\t });\n \t}\n }\n \n while (isPaused) {\n try { Thread.sleep(100); } catch(Exception e) { return; }\n }\n player.flipAllDown();\n }\n ClickObserver.getInstance().setTerrainFlag(\"\");\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n Board.removeCovers();\n }\n });\n }", "public void pickupDevelopmentCardFromTower(Player player, FamilyMemberColor familyMemberColor, int servants, int indexTower, int indexCell, InformationCallback informationCallback) throws GameException{\n Tower tower = this.mainBoard.getTower(indexTower);\n TowerCell cell = tower.getTowerCell(indexCell);\n\n if(player.getPersonalBoard().getValuables().getResources().get(ResourceType.SERVANT) < servants)\n throw new GameException(GameErrorType.FAMILY_MEMBER_DICE_VALUE);\n\n int servantsValue = servants/player.getPersonalBoard().getExcommunicationValues().getNumberOfSlaves();\n\n LeaderCard leaderCardBrunelleschi = player.getPersonalBoard().getLeaderCardWithName(\"Filippo Brunelleschi\");\n\n if (cell.getPlayerNicknameInTheCell() == null || player.getPersonalBoard().getAlwaysPlaceFamilyMemberInsideActionSpace()){\n\n tower.familyMemberCanBePlaced(player, familyMemberColor);\n\n updateFamilyMemberValue(player, familyMemberColor, servantsValue);\n\n try {\n cell.familyMemberCanBePlaced(player, familyMemberColor);\n\n if (!tower.isFree() && (leaderCardBrunelleschi == null || !leaderCardBrunelleschi.getLeaderEffectActive())) {\n if(player.getPersonalBoard().getValuables().getResources().get(ResourceType.COIN) >= 3)\n player.getPersonalBoard().getValuables().decrease(ResourceType.COIN, 3);\n else\n throw new GameException(GameErrorType.TOWER_COST);\n }\n\n cell.developmentCardCanBeBought(player, informationCallback);\n\n DevelopmentCard card = cell.getDevelopmentCard();\n this.payValuablesToGetDevelopmentCard(player, card, informationCallback);\n\n player.getPersonalBoard().addCard(card);\n if(card.getImmediateEffect() != null)\n card.getImmediateEffect().runEffect(player,informationCallback);\n if(card.getColor().equals(DevelopmentCardColor.BLUE) && card.getPermanentEffect() != null)\n card.getPermanentEffect().runEffect(player, informationCallback);\n\n if(cell.getTowerCellImmediateEffect() != null && canRunTowerImmediateEffects(player, indexCell))\n cell.getTowerCellImmediateEffect().runEffect(player, informationCallback);\n\n player.getPersonalBoard().setFamilyMembersUsed(familyMemberColor);\n\n cell.setPlayerNicknameInTheCell(player.getUsername());\n } catch (GameException e){\n restoreFamilyMemberValue(player, familyMemberColor, servantsValue);\n\n if (!tower.isFree() && (leaderCardBrunelleschi == null || !leaderCardBrunelleschi.getLeaderEffectActive()) && !e.getError().equals(GameErrorType.TOWER_COST))\n player.getPersonalBoard().getValuables().increase(ResourceType.COIN, 3);\n throw e;\n }\n } else {\n throw new GameException(GameErrorType.TOWER_CELL_BUSY);\n }\n }", "private void doReserve() {\n pickParkingLot();\n pickParkingSpot();\n pickTime();\n pickDuration();\n int amount = pickedparkinglot.getPrice() * pickedduration;\n if (pickedAccount.getBalance() >= amount) {\n currentReservation = new Reservation(pickedparkingspot, pickedAccount, pickedtime, pickedduration);\n validateReservation(currentReservation);\n } else {\n System.out.println(\"Insufficient balance\");\n }\n }", "public void readyNextAttackers() {\n if(battleAlly == null && battleEnemy == null){\n //if(battleAlly == null && battleEnemy == null && !isBattleOver()){\n battleAlly = battleAllies.get(0);\n battleEnemy = battleEnemies.get(0);\n }\n }", "private void Management_Player(){\n\t\t\n\t\t// render the Player\n\t\tswitch(ThisGameRound){\n\t\tcase EndRound:\n\t\t\treturn;\t\t\t\n\t\tcase GameOver:\n\t\t\t// do nothing\n\t\t\tbreak;\n\t\tcase Running:\n\t\t\tif (PauseGame==false){\n\t\t\t\tplayerUser.PlayerMovement();\t\t\t\t\t\t\n\t\t\t}\n\t\t\telse if (PauseGame==true){\n\t\t\t\t// do not update gravity\n\t\t\t}\n\t\t\tbreak;\t\t\n\t\t}\n\t\n\t\tbatch.draw(playerUser.getframe(PauseGame), playerUser.getPosition().x , playerUser.getPosition().y,\n\t \t\tplayerUser.getBounds().width, playerUser.getBounds().height);\n\t\t\n\t\t\n\t\t\n\t\tswitch (playerUser.EquipedToolCycle)\n\t\t{\t\n\t\tcase 0:\n\t\t\tstartTimeTool = System.currentTimeMillis(); \n\t\t\tbreak;\n\t\t\t\n\t\tcase 1: \n\t\t\t\n\t\t\tif (PauseGame==true){\t\t\t\t\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// tool is grabbed\n\t\t\testimatedTimeEffect = System.currentTimeMillis() - startTimeTool;\t\t\t\t\t\t\t\t\t\t\n\t\t\t\n\t\t\tplayerUser.pe_grab.setPosition(playerUser.getPosition().x + playerUser.getBounds().width/2,\n\t\t\t\t\tplayerUser.getPosition().y + playerUser.getBounds().height/2);\t\n \t\t\n\t\t\t\tplayerUser.pe_grab.update(Gdx.graphics.getDeltaTime());\n\t\t\t\tplayerUser.pe_grab.draw(batch,Gdx.graphics.getDeltaTime()); \t\t\t\t\t\t\t\n\t\t\t\n\t\t\tif (estimatedTimeEffect >= Conf.SYSTIME_MS){\n\t\t\t\testimatedTimeEffect = 0;\n\t\t\t\tplayerUser.ToolEquiped();\n\t\t\t\tstartTimeTool = System.currentTimeMillis(); \n\t\t\t\tplayerUser.EquipedToolCycle++;\n\t\t\t}else{\n\t\t\t\t// do nothing\n\t\t\t}\n\t\t\tbreak;\n\t\t\t\t\t\n\t\tcase 2:\n\t\t\t\n\t\t\tif (PauseGame==true){\t\t\t\t\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\testimatedTimeEffect = (System.currentTimeMillis() - startTimeTool) / 1000;\t\t\t\t\n\t\t\tplayerUser.pe_equip.setPosition(playerUser.getPosition().x + playerUser.getBounds().width/2,\n\t\t\tplayerUser.getPosition().y + playerUser.getBounds().height/2);\t\n\t\t\tplayerUser.pe_equip.update(Gdx.graphics.getDeltaTime());\n\t\t\tplayerUser.pe_equip.draw(batch,Gdx.graphics.getDeltaTime()); \t\t\t\t\n\t\t\tif (estimatedTimeEffect>=Conf.TOOL_TIME_USAGE_LIMIT){\n\t\t\t\tplayerUser.EquipedToolCycle=0;\t\t\n\t\t\t\tplayerUser.color = Color.NONE;\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif (estimatedTimeEffect>=Conf.TOOL_TIME_USAGE_MUSIC_LIMIT){\n\t\t\t\tPhoneDevice.Settings.setMusicValue(true);\n\t\t\t}\n\t\t}\t\t\t\t\n\t}", "public Settlement(Game game, Player owner, String name, Tile tile) {\n super(game);\n this.owner = owner;\n this.name = name;\n this.tile = tile;\n \n setType(owner.getNationType().getSettlementType(false));\n }", "private void targetLostResponse(){\n\t\tswitch(state){\r\n\t\tcase(PURSUIT):\r\n\t\t\tstate=HUNTING;\r\n\t\t\tTile[] targetChoices=adjacentUnseenTiles(level(),targetTile);\r\n\t\t\tif(targetChoices[0]==null)\r\n\t\t\t\tstate=IDLE;\r\n\t\t\ttargetLostResponse();\r\n\t\t\tbreak;\r\n\t\tcase(HUNTING):\t//TODO: after reaching target tile, guess a new target tile, up to a point. (define what that point is) Eventually resume wandering.\r\n\t\t\tif(targetTile!=null){\r\n\t\t\t\tif(!targetTile.equalTo(monster.currentTile)){\r\n\t\t\t\t\tsaveMove();\r\n\t\t\t\t\tmonster.moveTowards(targetTile);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\t//if(!monster.currentTile.equalTo(plannedPath[0]))\r\n\t\t\t\t\t//\tmonster.moveTowards(plannedPath[0]);\r\n\t\t\t\t\tstate=IDLE;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tstate=IDLE;\r\n\t\t\t\ttargetLostResponse();\r\n\t\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase(IDLE):\r\n\t\t\twander();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}", "public void playGame(Player player) {\n super.player = player;\n\n allTumblers.add(tum1);\n allTumblers.add(tum2);\n allTumblers.add(tum3);\n\n if(!typeOfSlotsChosen) {\n int whichSlots = Display.getIntPrompt(\"Choose 5 Tumblers or 3 Tumblers: \");\n typeOfSlotsChosen = true;\n if (whichSlots == 3) {\n Slots3 slots3 = new Slots3();\n slots3.playGame(player);\n stopPlayingSlots = true;\n }\n }\n /**\n * While loop to repeat the process\n */\n while (!stopPlayingSlots) {\n resetPotandWins();\n betPlaced = false;\n while (!betPlaced) {\n double currentBet = Display.getDoublePrompt(\"How much are you betting?: \");\n if (checkAmountInPurse(player, currentBet)) {\n placeBet(player, currentBet);\n removeMoneyFromPurse(player, currentBet);\n betPlaced = true;\n\n } else {\n Display.showMessage(\"You're broke Nurudeen is escorting you to the ATM\");\n stopPlayingSlots = true;\n typeOfSlotsChosen = false;\n break;\n }\n\n shuffle();\n sendDisplayResultsAll();\n checkToSeeIfPlayerWon();\n checkNumOfPaylines();\n if (numOfPaylines > 0) {\n Display.showMessage(\"You won!! \" + winnings);\n }\n addMoneytoPurse(player, winnings);\n Display.showMessage(\"You have \"+player.getPurse()+\" dollars left in your purse\\n\");\n String choice = Display.getStringPrompt(\"Are you done playing (yes or no)?: \");\n stopPlayingSlots = stopGame(choice);\n }\n }\n }", "public void startOrder() {\n\t\tDeck tempDeck = new Deck();\n\t\tArrayList<Player> highPlayerList = new ArrayList<Player>();\n\t\tStrategy3 testPlayer = new Strategy3();\n\t\tint temp = 0;\n\t\tfor (Player p : this.playerList) {\n\t\t\ttemp++;\n\t\t\tp.hand.add(tempDeck.dealTile());\n\t\t}\n\t\t\n\t\twhile (playerList.isEmpty() == false) {\t\n\t\t\tPlayer min = playerList.get(0);\n\t\t\tfor(Player i : playerList) {\n\t\t\t\tif (i.getHandValue() > min.getHandValue()) {min = i;}\n\t\t\t}\n\t\t\thighPlayerList.add(min);\n\t\t\tplayerList.remove(min);\n\t\t}\n\t\tthis.playerList = highPlayerList;\t\n\t\ttemp = 0; \n\t\tfor(Player p : this.playerList) {\n\t\t\ttemp++;\n\t\t}\n\t\t\n\t\tfor (Player p : playerList) {\n\t\t\tp.hand.clear();\n\t\t}\t\t\n\t}", "@Override\r\n\tpublic void setUp() {\n\t\t\r\n\t\ttarget = pointEntity(caster,50);\r\n\t\tif (target == null) {\r\n\t\t\t\r\n\t\t\t\r\n\t\t\trefund = true;\r\n\t\t\tdead = true;\r\n\t\t\tif (refined)\r\n\t\t\t\tsteprange = 240;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tplaySound(Sound.BLOCK_CONDUIT_DEACTIVATE,caster.getLocation(),5,2F);\r\n\t\t\tplaySound(Sound.BLOCK_CONDUIT_ACTIVATE,caster.getLocation(),5,2F);\r\n\t\t\tParUtils.parKreisDot(Particles.END_ROD, caster.getLocation(), 0, 1, 0.3F, randVector());\r\n\t\t\tParUtils.parKreisDot(Particles.END_ROD, caster.getLocation(), 0, 1, 0.3F, randVector());\r\n\t\t\tParUtils.parKreisDot(Particles.END_ROD, caster.getLocation(), 0, 1, 0.3F, randVector());\r\n\t\t\tdist = target.getLocation().distance(caster.getLocation());\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "private void setupSettlementCost(){\n\t\tsettlementCost.put(ResourceKind.WOOL, 1);\n\t\tsettlementCost.put(ResourceKind.WOOD, 1);\n\t\tsettlementCost.put(ResourceKind.BRICK, 1);\n\t\tsettlementCost.put(ResourceKind.GRAIN, 1);\n\t}", "public void grab() {\r\n\t\tString item = mapContents[currentPlayer.getCurrentRoom()];\r\n\t\tif (item == null) return;\r\n\t\t\r\n\t\t// If artifact, make sure has room or backpack\r\n\t\tif (item.startsWith(\"Artifact\")) {\r\n\t\t\tif (currentPlayer.count(\"Artifact\") <= currentPlayer.count(\"Backpack\")) {\r\n\t\t\t\tcurrentPlayer.pickup(item);\r\n\t\t\t\tattackLevel++;\r\n\t\t\t\taddEvent(\"``\"+currentName+\"`` picked up an Artifact **\"+item.substring(8)+\"** :star:\",true);\r\n\t\t\t\taddHistory(\"ARTIFACT \"+item.substring(8));\r\n\t\t\t\tmapContents[currentPlayer.getCurrentRoom()] = null;\r\n\t\t\t}\r\n\t\t// If monkey idol, make sure didn't already pick one up this turn\r\n\t\t} else if (item.startsWith(\"MonkeyIdol\") && !currentPlayer.getAlreadyPickedUpMonkeyIdol()) {\r\n\t\t\tcurrentPlayer.pickup(item);\r\n\t\t\tcurrentPlayer.setAlreadyPickedUpMonkeyIdol(true);\r\n\t\t\tint num = Integer.parseInt(item.substring(10));\r\n\t\t\tnum--;\r\n\t\t\tif (num == 0) {\r\n\t\t\t\tmapContents[currentPlayer.getCurrentRoom()] = null;\r\n\t\t\t} else {\r\n\t\t\t\tmapContents[currentPlayer.getCurrentRoom()] = \"MonkeyIdol\"+num;\r\n\t\t\t}\r\n\t\t\taddEvent(\"``\"+currentName+\"`` picked up a Monkey Idol **5** :star:\",true);\r\n\t\t\taddHistory(\"IDOL \"+item.substring(8));\r\n\t\t}\r\n\t\tupdateReactionsInfo();\r\n\t\tupdatePlayArea(currentPlayer, false);\r\n\t\tupdateMarketAndTreasures(false);\r\n\t\ttry {\r\n\t\t\tupdateBoard();\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}\r\n\t}", "public abstract void performPurchase(Player player);", "public void establishDealOffer() {\n DealOffer offer = new DealOffer();\n \n int moneyToOffer = (Integer)this.playersMoneyMap.get(currentPlayer).getValue();\n offer.offerCash(moneyToOffer);\n \n Map<JCheckBox, Space> thisPlayerMap = playersCheckBoxes.get(currentPlayer);\n if (thisPlayerMap != null) {\n for (JCheckBox checkBox : thisPlayerMap.keySet()) {\n if (checkBox.isSelected()) {\n offer.addPropertyToOffer(thisPlayerMap.get(checkBox));\n }\n }\n }\n \n int moneyToRequest = (Integer)this.playersMoneyMap.get(playerToOfferTo).getValue();\n offer.requestCash(moneyToRequest);\n \n Map<JCheckBox, Space> otherPlayerMap = playersCheckBoxes.get(playerToOfferTo);\n if (otherPlayerMap != null) {\n for (JCheckBox checkBox : otherPlayerMap.keySet()) {\n if (checkBox.isSelected()) {\n offer.addPropertyToRequest(otherPlayerMap.get(checkBox));\n }\n }\n }\n this.dealOffer = offer;\n \n }", "private void createNewCity()\r\n {\r\n int currentPlayer = worldPanel.getCurrentPlayer();\r\n int currentUnit = worldPanel.getCurrentUnit();\r\n boolean canBuild = false;\r\n\r\n if(currentPlayer == 1)\r\n {\r\n int unitType = worldPanel.player1.units[currentUnit - 1].getUnitType();\r\n if(unitType == 1)//if unit is a settler\r\n canBuild = true;\r\n }\r\n\r\n else if(currentPlayer == 2)\r\n {\r\n int unitType = worldPanel.player1.units[currentUnit - 1].getUnitType();\r\n if(unitType == 1)//if unit is a settler\r\n canBuild = true;\r\n }\r\n\r\n //if the unit who presses build is a settler\r\n if(canBuild == true)\r\n {\r\n if(currentPlayer == 1)\r\n {\r\n int playerLoc = worldPanel.player1.units[currentUnit - 1].getPosition();\r\n worldPanel.player1.addCity(playerLoc);\r\n currentUnit++;\r\n worldPanel.setCurrentUnit(currentUnit);\r\n }//end if\r\n else if(currentPlayer == 2)\r\n {\r\n int playerLoc = worldPanel.player2.units[currentUnit - 1].getPosition();\r\n worldPanel.player2.addCity(playerLoc);\r\n currentUnit++;\r\n worldPanel.setCurrentUnit(currentUnit);\r\n }//end elseif\r\n }//end if\r\n\r\n //set new player and unit if necessary\r\n int temp = worldPanel.getNumUnits(currentPlayer);\r\n if(currentUnit > temp)\r\n {\r\n if(currentPlayer == 1)\r\n worldPanel.setCurrentPlayer(2);\r\n else\r\n worldPanel.setCurrentPlayer(1);\r\n worldPanel.setCurrentUnit(1);\r\n }//end if\r\n\r\n //set up new mapPosition if player moved\r\n if(canBuild == true)\r\n setMapPos();\r\n setInfoPanel();\r\n }", "public static String requestTransfer(Player player, Team playersTeam, double bid, Library library, TransferList existingTransfers) {\n\t\tif (playersTeam.isMax()) {\n\t\t\treturn \"You already have 30 players in your team, this is the maximum. Sell some players before trying to buy any new!\";\n\t\t} else {\n\t\tif (existingTransfers.getTransfer(player)==null) {\n\t\t\tboolean answer = TransferLogic.getAnswer(player, bid, library, existingTransfers);\n\t\t\tif (answer) {\n\t\t\t\tTeam opponentsTeam = library.getTeamForName(player.getTeam());\n\t\t\t\topponentsTeam.deleteIfInCurrentTeam(player);\n//\t\t\t\tif (opponentsTeam.getPositions().contains(player)) {\n//\t\t\t\t\t\n//\t\t\t\t\tboolean itsdone=false;\n//\t\t\t\t\tfor (int i=0;i<opponentsTeam.getTeam().size();i++) {\n//\t\t\t\t\t\tif (!itsdone) {\n//\t\t\t\t\t\t\tPlayer p = opponentsTeam.getTeam().get(i);\n//\t\t\t\t\t\t\tif (p.getPlayerType().equals(player.getPlayerType()) && !(opponentsTeam.getPositions().contains(p))) {\n//\t\t\t\t\t\t\t\topponentsTeam.replacePlayerInCurrentTeam(player, p);\n//\t\t\t\t\t\t\t\titsdone=true;\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t}\n//\t\t\t\t\t}\n//\t\t\t\t\tif (!itsdone) {\n//\t\t\t\t\t\tfor (int i=0;i<opponentsTeam.getTeam().size();i++) {\n//\t\t\t\t\t\t\tif (!itsdone) {\n//\t\t\t\t\t\t\t\tPlayer p = opponentsTeam.getTeam().get(i);\n//\t\t\t\t\t\t\t\tif (((p instanceof FieldPlayer && player instanceof FieldPlayer) || (p instanceof Goalkeeper && player instanceof Goalkeeper)) && !(opponentsTeam.getPositions().contains(p))) {\n//\t\t\t\t\t\t\t\t\topponentsTeam.replacePlayerInCurrentTeam(player, p);\n//\t\t\t\t\t\t\t\t\titsdone=true;\n//\t\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t}\n//\t\t\t\t\t}\n//\t\t\t\t\t\n//\t\t\t\t\t\n//\t\t\t\t}\n\t\t\t\t\n\t\t\t\tplayersTeam.add(player);\n\t\t\t\topponentsTeam.getTeam().remove(player);\n\t\t\t\tplayer.setTeam(playersTeam.getTeamName());\n\t\t\t\tplayersTeam.setBudget(playersTeam.getBudget()-bid);\n\t\t\t\topponentsTeam.setBudget(opponentsTeam.getBudget()+bid);\n\t\t\t\tBigDecimal bbid = new BigDecimal(bid);\n\t\t\t\t\n\t\t\t\t//price string\n\t\t\t\t\n\t\t\t\tDecimalFormat formatter = (DecimalFormat) NumberFormat.getInstance(Locale.US);\n\t\t\t\tbbid = bbid.setScale(2, BigDecimal.ROUND_DOWN);\n\t\t\t\tDecimalFormat df = new DecimalFormat();\n\t\t\t\tdf.setGroupingUsed(false);\t\t\n\t\t\t\tString priceString = formatter.format(bbid.longValue());\n\t\t\t\t\n\t\t\t\t\n\t\t\t\treturn \"Congratulations! Your bid of \" + priceString + \" got accepted and \" + player.getName() + \" is now part of your team\";\n\t\t\t} else {\n\t\t\t\tdouble percentage = bid/player.getPrice().doubleValue()*100-100;\n\t\t\t\tdouble returnedprice=0;\n\t\t\t\tdouble price = player.getPrice().doubleValue();\n\t\t\t\tif (percentage<-10) {\n\t\t\t\t\treturnedprice=0.9*price;\n\t\t\t\t} if (percentage>=-10 && percentage<0) {\n\t\t\t\t\treturnedprice=price;\n\t\t\t\t} if (percentage>=0 && percentage<5) {\n\t\t\t\t\treturnedprice=1.05*price;\n\t\t\t\t} if (percentage>=5 && percentage<10) {\n\t\t\t\t\treturnedprice=1.1*price;\n\t\t\t\t} if (percentage>=10 && percentage<15) {\n\t\t\t\t\treturnedprice=1.15*price;\n\t\t\t\t} if (percentage>=15 && percentage<20) {\n\t\t\t\t\treturnedprice=1.2*price;\n\t\t\t\t} if (percentage>=20 && percentage<25) {\n\t\t\t\t\treturnedprice=1.25*price;\n\t\t\t\t} if (percentage>=25 && percentage<30) {\n\t\t\t\t\treturnedprice=1.3*price;\n\t\t\t\t} \n\t\t\t\t\n\t\t\t\tTransferInProgress tp = new TransferInProgress(player, returnedprice, bid);\n\t\t\t\texistingTransfers.addTransfer(tp);\n\t\t\t\tBigDecimal bbid = new BigDecimal(bid);\n\t\t\t\tBigDecimal breturnedprice = new BigDecimal(returnedprice);\n\t\t\t\t//price string\n\t\t\t\t\n\t\t\t\tDecimalFormat formatter = (DecimalFormat) NumberFormat.getInstance(Locale.US);\n\t\t\t\tbbid = bbid.setScale(2, BigDecimal.ROUND_DOWN);\n\t\t\t\tbreturnedprice = breturnedprice.setScale(2, BigDecimal.ROUND_DOWN);\n\t\t\t\tDecimalFormat df = new DecimalFormat();\n\t\t\t\tdf.setGroupingUsed(false);\t\t\n\t\t\t\tString priceString = formatter.format(bbid.longValue());\n\t\t\t\tString priceString2 = formatter.format(breturnedprice.longValue());\n\t\t\t\treturn player.getTeam() + \" did not accept your offer of \" + priceString + \" for \" + player.getName() + \". They have indicated they want at least \" + priceString2 + \" for this player\";\n\t\t\t\t\n\t\t\t}\n\t\t} else {\n\t\t\tTransferInProgress tp = existingTransfers.getTransfer(player);\n\t\t\tboolean answer = TransferLogic.getAnswerForExistingTransfer(player, bid, library, existingTransfers, tp.getPriceReturned());\n\t\t\tif (answer) {\n\t\t\t\tTeam opponentsTeam = library.getTeamForName(player.getTeam());\n\t\t\t\topponentsTeam.deleteIfInCurrentTeam(player);\n//\t\t\t\tif (opponentsTeam.getPositions().contains(player)) {\n//\t\t\t\t\tboolean itsdone=false;\n//\t\t\t\t\tfor (int i=0;i<opponentsTeam.getTeam().size();i++) {\n//\t\t\t\t\t\tif (!itsdone) {\n//\t\t\t\t\t\t\tPlayer p = opponentsTeam.getTeam().get(i);\n//\t\t\t\t\t\t\tif (p.getPlayerType().equals(player.getPlayerType()) && !(opponentsTeam.getPositions().contains(p))) {\n//\t\t\t\t\t\t\t\topponentsTeam.replacePlayerInCurrentTeam(player, p);\n//\t\t\t\t\t\t\t\titsdone=true;\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t}\n//\t\t\t\t\t}\n//\t\t\t\t\tif (!itsdone) {\n//\t\t\t\t\t\tfor (int i=0;i<opponentsTeam.getTeam().size();i++) {\n//\t\t\t\t\t\t\tif (!itsdone) {\n//\t\t\t\t\t\t\t\tPlayer p = opponentsTeam.getTeam().get(i);\n//\t\t\t\t\t\t\t\tif (((p instanceof FieldPlayer && player instanceof FieldPlayer) || (p instanceof Goalkeeper && player instanceof Goalkeeper)) && !(opponentsTeam.getPositions().contains(p))) {\n//\t\t\t\t\t\t\t\t\topponentsTeam.replacePlayerInCurrentTeam(player, p);\n//\t\t\t\t\t\t\t\t\titsdone=true;\n//\t\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t}\n//\t\t\t\t\t}\n//\t\t\t\t\t\n//\t\t\t\t\t\n//\t\t\t\t}\n\t\t\t\t\n\t\t\t\tplayersTeam.add(player);\n\t\t\t\topponentsTeam.getTeam().remove(player);\n\t\t\t\tplayer.setTeam(playersTeam.getTeamName());\n\t\t\t\texistingTransfers.getTransfers().remove(tp);\n\t\t\t\tplayersTeam.setBudget(playersTeam.getBudget()-bid);\n\t\t\t\topponentsTeam.setBudget(opponentsTeam.getBudget()+bid);\n\t\t\t\tBigDecimal bbid = new BigDecimal(bid);\n\t\t\t\t//price string\n\t\t\t\t\n\t\t\t\tDecimalFormat formatter = (DecimalFormat) NumberFormat.getInstance(Locale.US);\n\t\t\t\tbbid = bbid.setScale(2, BigDecimal.ROUND_DOWN);\n\t\t\t\tDecimalFormat df = new DecimalFormat();\n\t\t\t\tdf.setGroupingUsed(false);\t\t\n\t\t\t\tString priceString = formatter.format(bbid.longValue());\n\t\t\t\treturn \"Congratulations! Your bid of \" + priceString + \" got accepted and \" + player.getName() + \" is now part of your team\";\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tdouble pricereturned = existingTransfers.getTransfer(player).getPriceReturned();\n\t\t\t\t\n\t\t\t\tif (bid>pricereturned) {\n\t\t\t\t\tdouble percentage = bid/player.getPrice().doubleValue()*100-100;\n\t\t\t\t\tdouble returnedprice=0;\n\t\t\t\t\tdouble price = player.getPrice().doubleValue();\n\t\t\t\t\tif (percentage<-10) {\n\t\t\t\t\t\treturnedprice=0.9*price;\n\t\t\t\t\t} if (percentage>=-10 && percentage<0) {\n\t\t\t\t\t\treturnedprice=price;\n\t\t\t\t\t} if (percentage>=0 && percentage<5) {\n\t\t\t\t\t\treturnedprice=1.05*price;\n\t\t\t\t\t} if (percentage>=5 && percentage<10) {\n\t\t\t\t\t\treturnedprice=1.1*price;\n\t\t\t\t\t} if (percentage>=10 && percentage<15) {\n\t\t\t\t\t\treturnedprice=1.15*price;\n\t\t\t\t\t} if (percentage>=15 && percentage<20) {\n\t\t\t\t\t\treturnedprice=1.2*price;\n\t\t\t\t\t} if (percentage>=20 && percentage<25) {\n\t\t\t\t\t\treturnedprice=1.25*price;\n\t\t\t\t\t} if (percentage>=25 && percentage<30) {\n\t\t\t\t\t\treturnedprice=1.3*price;\n\t\t\t\t\t}\n\t\t\t\t\texistingTransfers.getTransfer(player).setPriceReturned(returnedprice);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\texistingTransfers.getTransfer(player).setBid(bid);\n\t\t\t\tBigDecimal bbid = new BigDecimal (bid);\n\t\t\t\tBigDecimal bpriceReturned = new BigDecimal(existingTransfers.getTransfer(player).getPriceReturned());\n\t\t\t\t//price string\n\t\t\t\t\n\t\t\t\tDecimalFormat formatter = (DecimalFormat) NumberFormat.getInstance(Locale.US);\n\t\t\t\tbbid = bbid.setScale(2, BigDecimal.ROUND_DOWN);\n\t\t\t\tbpriceReturned = bpriceReturned.setScale(2, BigDecimal.ROUND_DOWN);\n\t\t\t\tDecimalFormat df = new DecimalFormat();\n\t\t\t\tdf.setGroupingUsed(false);\t\t\n\t\t\t\tString priceString = formatter.format(bbid.longValue());\n\t\t\t\tString priceString2 = formatter.format(bpriceReturned.longValue());\n\t\t\t\treturn player.getTeam() + \" did not accept your offer of \" + priceString + \" for \" + player.getName() + \". They have indicated they want at least \" + priceString2 + \" for this player\";\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}}", "@Override\n \tpublic void handleBettingMarketEndOFSet() {\n \n \t}", "public void playSettlement(boolean isFree) throws ClientException{\n\t\t\tsettlements--;\n//\t\tboolean firstRounds = false;\n//\t\ttry {\n//\t\t\tfirstRounds = ClientFacade.getSingleton().getContext().getState() instanceof FirstRoundState ||\n//\t\t\t\t\tClientFacade.getSingleton().getContext().getState() instanceof SecondRoundState;\n//\t\t} catch (ClientException e) {\n//\t\t\t// TODO Auto-generated catch block\n//\t\t\te.printStackTrace();\n//\t\t}\n\t\tif(!isFree) {\n\t\t\tresources.setBrick(resources.getBrick() - 1);\n\t\t\tresources.setWood(resources.getWood() - 1);\n\t\t\tresources.setWheat(resources.getWheat() - 1);\n\t\t\tresources.setSheep(resources.getSheep() - 1);\n\t\t}\n\n\t\t\n\t}", "void purchaseMade();", "private void startFreeze(Player player) {\r\n\t\tfrozenPlayers.put(player.getUniqueId(), new FrozenPlayerInfo(player.getAllowFlight(), player.isFlying()));\r\n\r\n\t\t// Tell Bukkit that this player is flying and shouldn't be effected by gravity.\r\n\t\t// The packet that is actually sent is modified in onPacketSending, and\r\n\t\t// the client won't receive these exact values.\r\n\t\t// However, changing the values also does cause the abilities packet to\r\n\t\t// be sent, meaning that it can be edited to have the info we want.\r\n\t\t// Sadly, we need to call two methods which means two packets when only\r\n\t\t// one packet really is needed, since Bukkit doesn't let one set\r\n\t\t// isFlying to true without allowing flight.\r\n\t\tplayer.setAllowFlight(true);\r\n\t\tplayer.setFlying(true);\r\n\r\n\t\tresendPosition(player);\r\n\t}", "private void makeFreezeInfos(ReplayBattle replay, Set<ReplayPlayer> players) {\n\t\tClan ownerClan = replay.getPlayer().getClanInfo().getClan();\n\t\t// battle end time: 45 seconds extra for battle loading\n\t\tInstant endTime =\n\t\t\t\treplay.getArenaCreateTime().plus(replay.getDuration())\n\t\t\t\t\t\t.plus(Duration.ofSeconds(45));\n\t\t// TODO decide which to use based on user input, freeze duration of\n\t\t// uploading player or something\n\t\tFreezeDurations freezeDurations =\n\t\t\t\tem.find(FreezeDurations.class, \"standard\");\n\t\tfor (ReplayPlayer p : players) {\n\t\t\tif (p.isSurvived() || p.getTank() == null) {\n\t\t\t\t// not interested if tank survived (not frozen), or wasn't\n\t\t\t\t// spotted in fog of war\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tQuery q =\n\t\t\t\t\tem.createNamedQuery(\"findPlayerTank\",\n\t\t\t\t\t\t\tPlayerTankInformation.class);\n\t\t\tq.setParameter(\"player\", p.getPlayer());\n\t\t\tq.setParameter(\"tank\", p.getTank());\n\t\t\tPlayerTankInformation tankInfo =\n\t\t\t\t\t(PlayerTankInformation) q.getSingleResult();\n\t\t\tTankFreezeInformation freezeInfo =\n\t\t\t\t\tnew TankFreezeInformation(tankInfo, ownerClan);\n\t\t\tInstant unfreezeTime = endTime;\n\t\t\tTank tank = p.getTank();\n\t\t\tswitch (tank.getInternalType()) {\n\t\t\tcase \"heavyTank\":\n\t\t\t\tunfreezeTime =\n\t\t\t\t\t\tunfreezeTime.plus(freezeDurations.getHeavyDurations()\n\t\t\t\t\t\t\t\t.get(tank.getTier()));\n\t\t\t\tbreak;\n\t\t\tcase \"mediumTank\":\n\t\t\t\tunfreezeTime =\n\t\t\t\t\t\tunfreezeTime.plus(freezeDurations.getMediumDurations()\n\t\t\t\t\t\t\t\t.get(tank.getTier()));\n\t\t\t\tbreak;\n\t\t\tcase \"lightTank\":\n\t\t\t\tunfreezeTime =\n\t\t\t\t\t\tunfreezeTime.plus(freezeDurations.getLightDurations()\n\t\t\t\t\t\t\t\t.get(tank.getTier()));\n\t\t\t\tbreak;\n\t\t\tcase \"AT-SPG\":\n\t\t\t\tunfreezeTime =\n\t\t\t\t\t\tunfreezeTime.plus(freezeDurations.getTdDurations().get(\n\t\t\t\t\t\t\t\ttank.getTier()));\n\t\t\t\tbreak;\n\t\t\tcase \"SPG\":\n\t\t\t\tunfreezeTime =\n\t\t\t\t\t\tunfreezeTime.plus(freezeDurations.getSpgDurations()\n\t\t\t\t\t\t\t\t.get(tank.getTier()));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (unfreezeTime.isBefore(Instant.now())) {\n\t\t\t\t// irrelevant\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfreezeInfo.setUnfreezeTime(unfreezeTime);\n\t\t\townerClan.getFreezeInfos().add(freezeInfo);\n\t\t}\n\t}", "public void setSettlement(Settlement set);", "void askLeaderCardThrowing();", "@Override\r\n\tpublic void buyCard() {\n\t\t\r\n\t}", "private void prepareCoinRacks() {\n\t\t\n\t}", "private static void decisionWhenAttacking() {\n\t\tif (isNewAttackState()) {\n\t\t\tchangeStateTo(STATE_ATTACK_PENDING);\n\n\t\t\t// We will try to define place for our army where to attack. It\n\t\t\t// probably will be center around a crucial building like Command\n\t\t\t// Center. But what we really need is the point where to go, not the\n\t\t\t// unit. As long as the point is defined we can attack the enemy.\n\n\t\t\t// If we don't have defined point where to attack it means we\n\t\t\t// haven't yet decided where to go. So it's the war's very start.\n\t\t\t// Define this assault point now. It would be reasonable to relate\n\t\t\t// it to a particular unit.\n\t\t\t// if (!isPointWhereToAttackDefined()) {\n\t\t\tStrategyManager.defineInitialAttackTarget();\n\t\t\t// }\n\t\t}\n\n\t\t// Attack is pending, it's quite \"regular\" situation.\n\t\tif (isGlobalAttackInProgress()) {\n\n\t\t\t// Now we surely have defined our point where to attack, but it can\n\t\t\t// be so, that the unit which was the target has been destroyed\n\t\t\t// (e.g. just a second ago), so we're standing in the middle of\n\t\t\t// wasteland.\n\t\t\t// In this case define next target.\n\t\t\t// if (!isSomethingToAttackDefined()) {\n\t\t\tdefineNextTarget();\n\t\t\t// }\n\n\t\t\t// Check again if continue attack or to retreat.\n\t\t\tboolean shouldAttack = decideIfWeAreReadyToAttack();\n\t\t\tif (!shouldAttack) {\n\t\t\t\tretreatsCounter++;\n\t\t\t\tchangeStateTo(STATE_RETREAT);\n\t\t\t}\n\t\t}\n\n\t\t// If we should retreat... fly you fools!\n\t\tif (isRetreatNecessary()) {\n\t\t\tretreat();\n\t\t}\n\t}", "public void prepare() {\r\n\t\tmyPreviousBet = 0;\r\n\t\tmyCurrentBet = 0;\r\n\t\tstage = 0;\r\n\t\tposition = -1;\r\n\t\tintel.reset();\r\n\t\tfor (int i = 0; i < boards.length; i++)\r\n\t\t\tboards[i] = \"UNKNOWN\";\r\n\t}", "@Override\r\n\tpublic void uniqueOnStartInteraction() {\n\t\tif (Main.clientPlayer.getNumWood() < cost) {\r\n\t\t\tMain.clientPlayer.stopInteraction();\r\n\t\t}\r\n\r\n\t}", "@SneakyThrows\n @Override\n public void prepare() {\n final String orderId = order.getId();\n final BlockingQueue<Order> queue = new LinkedBlockingDeque<>();\n if (preparedOrderMap.containsKey(orderId)) {\n throw new SimulatorException(\"Encounter repeated order id!\");\n }\n preparedOrderMap.put(orderId, queue);\n\n Thread.sleep(order.getPrepTime() * SCALE_MILLI_SECOND);\n order.setOrderPreparedTime(new Date());\n preparedOrderMap.get(orderId).put(order);\n log.info(String.format(\"Order prepared: %s\", order.getId()));\n }", "public void run() \n\t\t\t{\n\t\t\t\tif (Math.abs(player.getLocation().getX() - playerLoc.getX()) > 1\n\t\t\t\t\t\t|| Math.abs(player.getLocation().getY() - playerLoc.getY()) > 1\n\t\t\t\t\t\t|| Math.abs(player.getLocation().getZ() - playerLoc.getZ()) > 1)\n\t\t\t\t{\n\t\t\t\t\tplayer.sendMessage(ChatColor.YELLOW + \"You cannot move while bandaging!\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tString name = player.getCustomName();\n\t\t\t\tif (name == null)\n\t\t\t\t\tname = player.getName();\n\t\t\t\t\n\t\t\t\t//Check that the recipient is still in roughly the same location\n\t\t\t\t//Skip if self-heal\n\t\t\t\tif (!player.equals(recipient))\n\t\t\t\t\tif (Math.abs(recipient.getLocation().getX() - recipientLoc.getX()) > 1\n\t\t\t\t\t\t|| Math.abs(recipient.getLocation().getY() - recipientLoc.getY()) > 1\n\t\t\t\t\t\t|| Math.abs(recipient.getLocation().getZ() - recipientLoc.getZ()) > 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tplayer.sendMessage(ChatColor.YELLOW + \"You cannot bandage your patient while they are moving!\");\n\t\t\t\t\t\trecipient.sendMessage(ChatColor.YELLOW + name + \" cannot bandage you while you are moving!\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Remove item from player's inventory.\n\t \t\tplayer.getInventory().removeItem(new ItemStack(Material.getMaterial(item.toUpperCase()), 1));\n\t \t\tplayer.updateInventory();\n\t \t\t\t\n\t \t\t//Heal the other player.\n\t \t\trecipient.setHealth(recipient.getHealth() + amountToHeal);\n\n\t \t\t//Award experience.\n\t \t\tProfessionStats prof = new ProfessionStats(perms, data, config, player.getUniqueId());\n\t \t\t\n\t \t\tif (!prof.isPracticeFatigued(profession))\n\t \t\t\taddExperience(player, profession, config.getInt(\"healing.\" + item + \".exp\"));\n\t \t\t\t\n\t \t\t//Notify both parties.\n\t \t\tif (!player.equals(recipient))\n\t \t\t{\t \t\t\n\t \t\t\tplayer.sendMessage(ChatColor.YELLOW + \"You bandaged \" + recipient.getName() + \"'s wounds.\");\n\t \t\t\trecipient.sendMessage(ChatColor.YELLOW + player.getName() + \" bandaged your wounds.\");\n\t \t\t}\n\t \t\telse\n\t \t\t\tplayer.sendMessage(ChatColor.YELLOW + \"You bandaged your wounds.\");\n\t\t\t }", "@Override\r\n\tpublic void playRoadBuildingCard() {\n\t\t\r\n\t}", "private void suarez() {\n\t\ttry {\n\t\t\tThread.sleep(5000); // espera, para dar tempo de ver as mensagens iniciais\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tint xInit = -10;\n\t\tint yInit = 8;\n\t\tplayerDeafaultPosition = new Vector2D(xInit*selfPerception.getSide().value(), yInit*selfPerception.getSide().value());\n\t\twhile (commander.isActive()) {\n\t\t\t\n\t\t\tupdatePerceptions(); // deixar aqui, no começo do loop, para ler o resultado do 'move'\n\t\t\tswitch (matchPerception.getState()) {\n\t\t\tcase BEFORE_KICK_OFF:\n\t\t\t\tcommander.doMoveBlocking(xInit, yInit);\t\t\t\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase PLAY_ON:\n\t\t\t\t//state = State.FOLLOW;\n\t\t\t\texecuteStateMachine();\n\t\t\t\tbreak;\n\t\t\tcase KICK_OFF_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase KICK_OFF_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CORNER_KICK_LEFT: // escanteio time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CORNER_KICK_RIGHT: // escanteio time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase KICK_IN_LEFT: // lateral time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\tcase KICK_IN_RIGHT: // lateal time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_LEFT: // Tiro livre time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_RIGHT: // Tiro Livre time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_FAULT_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_FAULT_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase GOAL_KICK_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase GOAL_KICK_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase AFTER_GOAL_LEFT:\n\t\t\t\tcommander.doMoveBlocking(xInit, yInit);\n\t\t\t\tbreak;\n\t\t\tcase AFTER_GOAL_RIGHT:\n\t\t\t\tcommander.doMoveBlocking(xInit, yInit);\n\t\t\t\tbreak;\n\t\t\tcase INDIRECT_FREE_KICK_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase INDIRECT_FREE_KICK_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\t}", "public void run() {\r\n\t\tGameArchive ga = GameArchive.getInstance();\r\n\t\tga.newGame();\r\n\t\t_game = ga.getCurrentGame();\r\n\t\tint startRound = 1;\r\n\t\tint endRound = (int)(1.0*cardFinder.getCardsInDeck() /_playerCollection.size());\r\n\t\tint dealer = -1;\r\n\t\tint lead = 0;\r\n\t\tint inc = 1;\r\n\t\tif(go.getGameSpeed().equals(GameSpeed.QUICK_PLAY)) {\r\n\t\t\tinc = 2;\r\n\t\t\tif(_playerCollection.size() != 4) {\r\n\t\t\t\tstartRound = 2;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tList<Integer> playerIds = getPlayerId();\r\n\t\tList<String> playerNames = getPlayerNames();\r\n\t\tfor (int i = 0; i < playerIds.size(); i++) {\r\n\t\t\t_game.addPlayer(playerIds.get(i), playerNames.get(i));\r\n\t\t}\r\n\t\tgameEventNotifier.notify(new NewGameEvent(playerIds,playerNames));\r\n\t\tfor (int roundId = startRound; roundId < endRound + 1; roundId = roundId + inc) {\r\n\t\t\tdealer = (dealer + 1)% _playerCollection.size();\r\n\t\t\tlead = (dealer + 1)% _playerCollection.size();\r\n\t\t\tgameEventNotifier.notify(new NewRoundEvent(roundId));\r\n\t\t\t_game.newRound(roundId);\r\n\t\t\tRound round = _game.getCurrentRound();\r\n\t\t\tCard trump = dealCards(roundId, dealer, lead);\r\n\t\t\tgameEventNotifier.notify(new NewTrumpEvent(trump));\r\n\t\t\tround.setTrump(trump);\r\n\r\n\t\t\tif(trump != null && trump.getValue().equals(Value.WIZARD)) {\r\n\t\t\t\tPlayer trumpPicker = _playerCollection.get(dealer);\r\n\t\t\t\t//_logger.info(trumpPicker.getName() + \" gets to pick trump.\");\r\n\t\t\t\ttrump = new Card(null, trumpPicker.pickTrump(), -1);\r\n\t\t\t\tgameEventNotifier.notify(new NewTrumpEvent(trump));\r\n\t\t\t\tround.setTrump(trump);\r\n\t\t\t}\r\n\t\t\tint cardsDealt = roundId;\r\n\t\t\tBid bid = bid(trump, lead, cardsDealt, round);\r\n\t\t\tif(go.getBidType().equals(BidType.HIDDEN)) {\r\n\t\t\t\tfor(IndividualBid individualBid :bid.getBids()) {\r\n\t\t\t\t\tgameEventNotifier.notify(new PlayerBidEvent(individualBid.getPlayer().getId(), individualBid.getBid()));\r\n\t\t\t\t\tround.setBid(individualBid.getPlayer().getId(), individualBid.getBid());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tRoundSummary roundSummary = new RoundSummary();\r\n\t\t\tfor (int i = 0; i < roundId; i++) {\r\n\t\t\t\tTrickTracker trickTracker = playTrick(trump, lead, round);\r\n\t\t\t\troundSummary.addTrickTracker(trickTracker);\r\n\t\t\t\tint playerIdWhoWon = trickTracker.winningPlay().getPlayerId();\r\n\t\t\t\tlead = findPlayerIndex(playerIdWhoWon);\r\n\t\t\t}\r\n\t\t\tif(go.getBidType().equals(BidType.SECRET)) {\r\n\t\t\t\tfor(IndividualBid individualBid :bid.getBids()) {\r\n\t\t\t\t\tgameEventNotifier.notify(new PlayerBidEvent(individualBid.getPlayer().getId(), individualBid.getBid()));\r\n\t\t\t\t\tround.setBid(individualBid.getPlayer().getId(), individualBid.getBid());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tscoreRound(roundSummary, bid, _game);\r\n\t\t\tthis.overallScores.displayScore();\r\n\t\t}\r\n\t\tCollection<Integer> winningPlayerIds = calcWinningIds();\r\n\t\tCollection<String> winningPlayers = getPlayerNames(winningPlayerIds);\r\n\t\tfor(int winningIds:winningPlayerIds) {\r\n\t\t\t_game.addWinner(winningIds);\r\n\t\t}\r\n\t\tgameEventNotifier.notify(new GameOverEvent(winningPlayerIds, winningPlayers));\r\n\t}", "private void prepare()\n {\n treespawn treespawn2 = new treespawn();\n addObject(treespawn2,30,486);\n\n hantu hantu = new hantu();\n addObject(hantu,779,359);\n \n hantu hantu2 = new hantu();\n addObject(hantu2,88,84);\n \n bergerak bergerak2 = new bergerak();\n addObject(bergerak2,745,423);\n\n bergerak bergerak3 = new bergerak();\n addObject(bergerak3,266,566);\n \n bergerak bergerak4 = new bergerak();\n addObject(bergerak4,564,566);\n\n hantu hantu3 = new hantu();\n addObject(hantu3,671,490);\n \n hantu hantu4 = new hantu();\n addObject(hantu4,371,499);\n\n bergerak bergerak = new bergerak();\n addObject(bergerak,150,148);\n\n lantai lantai = new lantai();\n addObject(lantai,561,577); \n addObject(lantai,419,579); \n\n player player = new player();\n addObject(player,882,498);\n\n lantai3 lantai3 = new lantai3();\n addObject(lantai3,120,148);\n\n flyinglantai flyinglantai = new flyinglantai();\n addObject(flyinglantai,292,148);\n\n treespawn treespawn = new treespawn();\n addObject(treespawn,30,291);\n\n lantai4 lantai4 = new lantai4();\n addObject(lantai4,235,536);\n \n lantai4 lantai42 = new lantai4();\n addObject(lantai42,275,508);\n \n lantai4 lantai43 = new lantai4();\n addObject(lantai43,323,480);\n \n lantai4 lantai44 = new lantai4();\n addObject(lantai44,369,454);\n\n lantai2 lantai2 = new lantai2();\n addObject(lantai2,680,424);\n\n \n lantai3 lantai32 = new lantai3();\n addObject(lantai32,938,146);\n \n lantai4 lantai45 = new lantai4();\n addObject(lantai45,21,370);\n\n lantai4 lantai46 = new lantai4();\n addObject(lantai46,210,180);\n \n lantai4 lantai47 = new lantai4();\n addObject(lantai47,257,201);\n \n lantai4 lantai48 = new lantai4();\n addObject(lantai48,302,229);\n \n lantai4 lantai49 = new lantai4();\n addObject(lantai49,354,255);\n \n lantai4 lantai410 = new lantai4();\n addObject(lantai410,402,281);\n \n lantai4 lantai411 = new lantai4();\n addObject(lantai411,444,302);\n \n lantai4 lantai412 = new lantai4();\n addObject(lantai412,491,334);\n \n lantai4 lantai413 = new lantai4();\n addObject(lantai413,546,364);\n \n lantai4 lantai414 = new lantai4();\n addObject(lantai414,582,397);\n \n doorlv3 doorlv3 = new doorlv3();\n addObject(doorlv3,910,45);\n\n \n }", "public boolean request() {\n\t\tif (inAnySession()) {\n\t\t\tplayer.exchangeSession.reset();\n\t\t\treturn false;\n\t\t}\n\t\t\n if (!PlayerRight.isDeveloper(player) && !PlayerRight.isDeveloper(other)) {\n if (player.playTime < 3000) {\n player.message(\"You cannot trade until you have 30 minutes of playtime. \" + Utility.getTime(3000 - player.playTime) + \" minutes remaining.\");\n return false;\n }\n if (other.playTime < 3000) {\n player.message(other.getName() + \" cannot trade until they have 30 minutes of playtime.\");\n return false;\n }\n }\n\t\t \n\t\tif (getSession(other).isPresent() && getSession(other).get().inAnySession()) {\n\t\t\tplayer.message(\"This player is currently is a \" + type.name + \" with another player.\");\n\t\t\treturn false;\n\t\t}\n\t\tif (Objects.equals(player, other)) {\n\t\t\tplayer.message(\"You cannot \" + type.name + \" with yourself.\");\n\t\t\treturn false;\n\t\t}\n if (PlayerRight.isIronman(player) && !PlayerRight.isDeveloper(other)) {\n player.message(\"You can not \" + type.name + \" as you are an iron man.\");\n return false;\n }\n if (PlayerRight.isIronman(other) && !PlayerRight.isDeveloper(player)) {\n player.message(other.getName() + \" can not be \" + type.name + \"d as they are an iron man.\");\n return false;\n }\n\t\tif (player.exchangeSession.requested_players.contains(other)) {\n\t\t\tplayer.message(\"You have already sent a request to this player.\");\n\t\t\treturn false;\n\t\t}\n\t\tif (player.locking.locked()) {\n\t\t\tplayer.message(\"You cannot send a \" + type.name + \" request right now.\");\n\t\t\treturn false;\n\t\t}\n\t\tif (other.locking.locked()) {\n\t\t\tplayer.message(other.getName() + \" is currently busy.\");\n\t\t\treturn false;\n\t\t}\n\t\tif (player.playerAssistant.busy()) {\n\t\t\tplayer.message(\"Please finish what you are doing before you do that.\");\n\t\t\treturn false;\n\t\t}\n\t\tif (other.playerAssistant.busy()) {\n\t\t\tplayer.message(other.getName() + \" is currently busy.\");\n\t\t\treturn false;\n\t\t}\n\t\tif (player.inActivity(ActivityType.DUEL_ARENA)) {\n\t\t\tplayer.message(\"You can not do that whilst in a duel!\");\n\t\t\treturn false;\n\t\t}\n\t\tif (other.inActivity(ActivityType.DUEL_ARENA)) {\n\t\t\tother.message(\"You can not do that whilst in a duel!\");\n\t\t\treturn false;\n\t\t}\n\t\tif (!onRequest()) {\n\t\t\treturn false;\n\t\t}\n\t\treturn SESSIONS.add(this);\n\t}", "public void createChallenger() {\n\n Random random = new Random();\n if(currentTurn.getActivePlayers().size() != 1) {\n currentTurn.setCurrentPlayer(currentTurn.getActivePlayers().get(random.nextInt(currentTurn.getActivePlayers().size() - 1)));\n } else {\n currentTurn.setCurrentPlayer(currentTurn.getActivePlayers().get(0));\n }\n int i = onlinePlayers.indexOf(currentTurn.getCurrentPlayer());\n stateList.set(i, new Initialized(getCurrentTurn().getCurrentPlayer(), this));\n\n }", "public void deliverStone3() {\n }", "public void simulation(){\n GameInformation gi = this.engine.getGameInformation();\n Point ball = gi.getBallPosition();\n Player playerSelected;\n int xTemp;\n team = gi.getTeam(ball.x , ball.y);\n\n //Attack\n if(team == gi.activeActor){\n selectAttackerPlayer(gi.getPlayerTeam(gi.activeActor));\n doAttackMoove(playerOne.getPosition(), gi.cells[(int) playerOne.getPosition().getX()][(int) playerOne.getPosition().getY()].playerMoves);\n selectProtectPlayer(gi.getPlayerTeam(gi.activeActor));\n doProtectMoove(playerTwo.getPosition(), playerOne.getPosition() ,gi.cells[(int) playerTwo.getPosition().getX()][(int) playerTwo.getPosition().getY()].playerMoves);\n playerOne = null;\n playerTwo = null;\n this.engine.next();\n }\n else{//Defense\n selectCloserPlayer(gi.getPlayerTeam(gi.activeActor));\n doDefenseMoove(playerOne.getPosition(), this.engine.getGameInformation().getBallPosition() ,gi.cells[(int) playerOne.getPosition().getX()][(int) playerOne.getPosition().getY()].playerMoves);\n selectCloserPlayer(gi.getPlayerTeam(gi.activeActor));\n doDefenseMoove(playerOne.getPosition(), this.engine.getGameInformation().getBallPosition() ,gi.cells[(int) playerOne.getPosition().getX()][(int) playerOne.getPosition().getY()].playerMoves);\n TacklAction tackl = new TacklAction();\n tackl.setSource(playerOne.getPosition());\n VisualArea[] area;\n if ( area = tackl.getVisualArea(this.engine.getGameInformation() ) != null ){\n tackl.setDestination(area[0]);\n this.engine.performAction( tackl );\n }\n\n tackl.setSource(playerTwo.getPosition());\n\n if ( area = tackl.getVisualArea(this.engine.getGameInformation() ) != null ){\n tackl.setDestination(area[0]);\n this.engine.performAction( tackl );\n }\n playerOne = null;\n playerTwo = null;\n }\n }", "public void deliverStone4() {\n }", "public void surrender() {\n playerCash += playerBet / 2;\n\n //Play dealer's turn\n dealerTurn();\n\n //End the game and change the views\n restartGame();\n }", "public void play() {\n Player playerOne = preparePlayer(getUserName(scanner, validator, shipsGameText.getMessage(\"show.player.one\"), null));\n Player currentPlayer = playerOne;\n ShipsGameBoard playerOneGameBoard = new ShipsGameBoard(playerOne, playerOneFleet);\n ShipsGameBoard playerOneCheckBoard = new ShipsGameBoard(playerOne, playerOneFleetToCheck);\n playerOneCheckBoard.setup();\n\n TreeMap<Character, Integer> lettersAndDigits = lettersAndDigits(playerOneGameBoard.getLength());\n ShipCreator threeMastShipCreatorPlayerOne = new ShipCreator(THREE_MASTS_SHIP,\n null,\n playerOne,\n ShipGameBoardMark.THREE_MASTS,\n playerOneGameBoard,\n playerOneShipsGameLogic);\n\n playerOneGameBoard.print();\n shipsDeployment(playerOneGameBoard,\n lettersAndDigits,\n threeMastShipCreatorPlayerOne,\n playerOneShipsGameLogic,\n playerOneFleet,\n NUMBER_OF_SHIPS);\n\n// playerOneShipsGameLogic.clearConsole();\n\n Player playerTwo = preparePlayer(getUserName(scanner, validator, shipsGameText.getMessage(\"show.player.two\"), playerOne.getName()));\n ShipsGameBoard playerTwoGameBoard = new ShipsGameBoard(playerTwo, playerTwoFleet);\n ShipsGameBoard playerTwoCheckBoard = new ShipsGameBoard(playerTwo, playerTwoFleetToCheck);\n playerTwoCheckBoard.setup();\n\n ShipCreator threeMastShipCreatorPlayerTwo = new ShipCreator(THREE_MASTS_SHIP,\n null,\n playerTwo,\n ShipGameBoardMark.THREE_MASTS,\n playerTwoGameBoard,\n playerTwoShipsGameLogic);\n\n playerTwoGameBoard.print();\n shipsDeployment(playerTwoGameBoard,\n lettersAndDigits,\n threeMastShipCreatorPlayerTwo,\n playerTwoShipsGameLogic,\n playerTwoFleet,\n NUMBER_OF_SHIPS);\n\n\n boolean isAWinner = false;\n do {\n int userRow;\n int userCol;\n// playerOneGameBoard.clearConsole();\n showCurrentPlayerBoards(playerOne, currentPlayer, playerOneGameBoard, playerTwoGameBoard, playerOneCheckBoard,\n playerTwoCheckBoard, shipsGameText);\n System.out.println(shipsGameText.getMessage(\"show.witch.player.move\", currentPlayer.getName()));\n\n System.out.println(shipsGameText.getMessage(\"show.input.row\", Integer.toString(playerOneGameBoard.getLength())));\n userRow = getPlayerRowChoice(scanner, validator, playerOneGameBoard.getLength());\n\n System.out.println(shipsGameText.getMessage(\"show.input.col\",\n Character.toString(playerOneGameBoard.generateLastLetterOfColumn('A', playerOneGameBoard.getLength()))));\n userCol = convertLetterToDigit(lettersAndDigits, getPlayerColChoice(scanner, validator,\n lettersAndDigits));\n\n if (currentPlayer.equals(playerOne)) {\n if (playerTwoShipsGameLogic.checkForHit(userRow, userCol)) {\n playerOneShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n playerTwoShipsGameLogic.changeMastStatus(userRow, userCol, playerTwo, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n if (playerTwoShipsGameLogic.checkShipForStatusChange(userRow, userCol)) {\n playerTwoShipsGameLogic.changeShipStatusToSunk(userRow, userCol, playerTwo);\n playerOneShipsGameLogicToCheck.changeShipStatusToSinkOnCheckBoard(playerTwoFleet, playerOne);\n System.out.println(shipsGameText.getMessage(\"show.player.sunk.ship\"));\n System.out.println(shipsGameText.getMessage(\"show.player.checkboard\", currentPlayer.getName()));\n playerOneCheckBoard.print();\n System.out.println(shipsGameText.getMessage(\"show.player.gameboard\", playerTwo.getName()));\n playerTwoGameBoard.print();\n } else {\n System.out.println(shipsGameText.getMessage(\"show.player.hit.ship\", playerOne.getName()));\n }\n } else {\n System.out.println(shipsGameText.getMessage(\"show.player.miss\"));\n playerOneShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.MISS);\n playerTwoShipsGameLogic.changeMastStatus(userRow, userCol, playerTwo, ShipGameBoardMark.MISS);\n }\n\n// if (playerTwoShipsGameLogic.checkShipForStatusChange(userRow, userCol)) {\n// playerTwoShipsGameLogic.changeShipStatusToSunk(userRow, userCol, playerTwo);\n// playerOneShipsGameLogicToCheck.changeShipStatusToSinkOnCheckBoard(playerTwoFleet, playerOne);\n// System.out.println(shipsGameText.getMessage(\"show.player.sunk.ship\"));\n// System.out.println(shipsGameText.getMessage(\"show.player.checkboard\", currentPlayer.getName()));\n// playerOneCheckBoard.print();\n// System.out.println(shipsGameText.getMessage(\"show.player.gameboard\", playerTwo.getName()));\n// playerTwoGameBoard.print();\n// }\n\n\n if (playerTwoShipsGameLogic.isPlayerLoose()) {\n System.out.println(shipsGameText.getMessage(\"show.player.win\", playerOne.getName()));\n isAWinner = true;\n }\n\n } else {\n if (playerOneShipsGameLogic.checkForHit(userRow, userCol)) {\n playerTwoShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerTwo, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n playerOneShipsGameLogic.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n if (playerOneShipsGameLogic.checkShipForStatusChange(userRow, userCol)) {\n playerOneShipsGameLogic.changeShipStatusToSunk(userRow, userCol, playerOne);\n playerTwoShipsGameLogicToCheck.changeShipStatusToSinkOnCheckBoard(playerOneFleet, playerTwo);\n System.out.println(shipsGameText.getMessage(\"show.player.sunk.ship\"));\n System.out.println(shipsGameText.getMessage(\"show.player.checkboard\", currentPlayer.getName()));\n playerTwoCheckBoard.print();\n System.out.println(shipsGameText.getMessage(\"show.player.gameboard\", playerOne.getName()));\n playerOneGameBoard.print();\n }\n else {\n System.out.println(shipsGameText.getMessage(\"show.player.hit.ship\", playerOne.getName()));\n }\n } else {\n playerTwoShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerOne,\n ShipGameBoardMark.MISS);\n playerOneShipsGameLogic.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.MISS);\n System.out.println(shipsGameText.getMessage(\"show.player.miss\"));\n }\n if (playerOneShipsGameLogic.isPlayerLoose()) {\n System.out.println(shipsGameText.getMessage(\"show.player.win\", playerTwo.getName()));\n isAWinner = true;\n }\n }\n\n currentPlayer = swapPlayers(playerOne, currentPlayer, playerTwo);\n }\n while (!isAWinner);\n }", "private void chance(Player currentPlayer) {\n Random rand = new Random();\n int randomNum = rand.nextInt((3 - 1) + 1) + 1;\n\n if(randomNum == 1){\n convertTextToSpeech(\"Advance to Bond Street\");\n currentPlayer.setCurrentPosition(34);\n }\n if(randomNum == 2){\n convertTextToSpeech(\"Unpaid charges. Go to jail\");\n setJail(currentPlayer);\n }\n if(randomNum == 3){\n convertTextToSpeech(\"Build a rooftop swimming pool on your apartment, pay 300\");\n if(m_manageFunds) {\n currentPlayer.subtractMoney(300);\n funds.setText(String.valueOf(currentPlayer.getMoney()));\n m_freeParking += 300;\n Log.d(\"chance subtract 300\", currentPlayer.getName() +\n String.valueOf(currentPlayer.getMoney()));\n Log.d(\"chance free parking\", String.valueOf(m_freeParking));\n }\n }\n }", "private void declareWinner(){\r\n System.out.println(\"All proposals received\");\r\n AID best = proposals.get(0).getSender();\r\n for(ACLMessage proposal: proposals){\r\n String time = proposal.getContent().replaceFirst(\"bid\\\\(\", \"\");\r\n time = time.replaceFirst(\" sec\\\\)\", \"\");\r\n String bestTimeString = \r\n proposal.getContent().\r\n replaceFirst(\"bid\\\\(\", \"\").\r\n replaceFirst(\" sec\\\\)\", \"\");\r\n int bestTime = Integer.parseInt(bestTimeString);\r\n int propTime = Integer.parseInt(time);\r\n if (bestTime > propTime) {\r\n best = proposal.getSender();\r\n }\r\n }\r\n sendMessage(best, \"\", ACLMessage.ACCEPT_PROPOSAL);\r\n Object[] ob = new Object[2];\r\n ob[0] = best;\r\n ob[1] = currentPartial;\r\n expectedReturn.add(ob);\r\n System.out.println(\"Accepting proposal from \" + best.getLocalName());\r\n for(ACLMessage proposal: proposals){\r\n if(!proposal.getSender().equals(best)){\r\n sendMessage(proposal.getSender(), \"\", ACLMessage.REJECT_PROPOSAL);\r\n }\r\n }\r\n proposals.clear();\r\n solvables.remove(0);\r\n if(!solvables.isEmpty()){\r\n \r\n auctionJob(solvables.get(0));\r\n }\r\n }", "public void startGame(){\n\n AgentAddress coordinatorAddressPre = getAgentWithRole(\"investment_game\", \"tout_le_monde\", \"coordinator\");\n\n if (coordinatorAddressPre==null){\n Coordinator coordinator = new Coordinator();\n\n launchAgent(coordinator);\n\n pause(1000);\n }\n\n Set<Player> players = new HashSet<Player>();\n Player primaryPlayer = null;\n\n //now launch all human player avatar agents, each of them will be initialized as agent having a GUI frame\n Iterator<GameSpecification.PlayerSpecification> playerSpecs = gameSpecification.getPlayerSpecifications().iterator();\n\n int launchedHumanPlayers = 0;\n\n while (playerSpecs.hasNext()){\n GameSpecification.PlayerSpecification spec = playerSpecs.next();\n\n if (spec instanceof GameSpecification.HumanPlayerSpecification){\n\n HumanPlayerAvatar humanPlayerAvatar = new HumanPlayerAvatar(spec.getName());\n\n launchAgent(humanPlayerAvatar,true);\n\n players.add(humanPlayerAvatar);\n\n launchedHumanPlayers++;\n\n if (null == primaryPlayer){\n primaryPlayer=humanPlayerAvatar;\n }\n\n }\n }\n\n //launch computer player agents. If no human players have been launched, the first computer player will display a GUI frame.\n playerSpecs = gameSpecification.getPlayerSpecifications().iterator();\n\n boolean first = true;\n\n while (playerSpecs.hasNext()){\n GameSpecification.PlayerSpecification spec = playerSpecs.next();\n\n if (spec instanceof GameSpecification.ComputerPlayerSpecification){\n\n ChooseAmountStrategy chooseAmountStrategy = ((GameSpecification.ComputerPlayerSpecification) spec).getChooseAmountStrategy();\n\n SelectOpponentStrategy selectOpponentStrategy = ((GameSpecification.ComputerPlayerSpecification) spec).getSelectOpponentStrategy();\n \n ComputerPlayer computerPlayer = new ComputerPlayer(spec.getName(),spec.getPictureFileName(), chooseAmountStrategy, selectOpponentStrategy);\n\n chooseAmountStrategy.setPlayer(computerPlayer);\n\n selectOpponentStrategy.setPlayer(computerPlayer);\n\n launchAgent(computerPlayer, launchedHumanPlayers == 0 && first);\n\n players.add(computerPlayer);\n\n if (null == primaryPlayer){\n primaryPlayer=computerPlayer;\n }\n\n first = false;\n\n }\n }\n\n //request new game from coordinator\n AgentAddress coordinatorAddress;\n\n while((coordinatorAddress = getAgentWithRole(\"investment_game\",\"tout_le_monde\",\"coordinator\"))==null){\n pause(750);\n }\n\n String requestGameSpec = \"<new_game> <for> \"+gameSpecification.getPlayerSpecifications().size()+\" <players> <having> \"+gameSpecification.getRounds()+\" <rounds> <invite> 0 <computer_players>\";\n\n ActMessage reply = (ActMessage)sendMessageWithRoleAndWaitForReply(coordinatorAddress,new ActMessage(\"request_game\",requestGameSpec),\"jeromes_assistant\");\n\n if (reply.getAction().equals(\"game_initialized\")){\n\n final String gameId = reply.getContent();\n\n //let players join the game\n Iterator<Player> playerIterator = players.iterator();\n\n while (playerIterator.hasNext()){\n\n final Player player = playerIterator.next();\n final boolean isPrimaryPlayer = player.equals(primaryPlayer);\n\n new Thread(){\n @Override\n public void run() {\n player.joinGame(gameId,isPrimaryPlayer,player.getPicturePath());\n }\n }.start();\n\n }\n }else{\n //TODO throw Exception\n }\n\n }", "public void waitingForPartner();", "void giveReward(BPlayer bPlayer, int tier, int status);", "public boolean setUnit(Unit u) //this method is for creating new units or called from territories move unit method\r\n {\r\n//\t\tSystem.out.println(\"Set unit called \" + u);\r\n \tTile old = u.getTile();\r\n boolean test = false;\r\n if(u != null) //this line is mostly useless now but i'm keeping it.\r\n {\r\n \tif(!(u instanceof Capital))\r\n \t{\r\n \t\tif(!(u instanceof Castle))\r\n \t\t{\r\n\t \t\tif(u.canMove())\r\n\t \t\t{\r\n\t\t\t if(Driver.currentPlayer.equals(player))\r\n\t\t\t {\r\n\t\t\t if(hasUnit())\r\n\t\t\t {\r\n\t\t\t if(u instanceof Peasant)\r\n\t\t\t {\r\n\t\t\t \tif(!(unit instanceof Capital) && !(unit instanceof Castle))\r\n\t\t\t \t{\r\n\t\t\t\t int curProtect = unit.getStrength();\r\n\t\t\t\t switch(curProtect) //for upgrading with a peasant.\r\n\t\t\t\t {\r\n\t\t\t\t case 1: newUnitTest(old, u);\r\n\t\t\t\t unit = new Spearman(this);\r\n\t\t\t\t unit.move(false);\r\n\t\t\t\t setAdjacentProtection();\r\n\t\t\t\t test = true;\r\n\t\t\t\t break;\r\n\t\t\t\t case 2: newUnitTest(old, u);\r\n\t\t\t\t unit = new Knight(this);\r\n\t\t\t\t unit.move(false);;\r\n\t\t\t\t setAdjacentProtection();\r\n\t\t\t\t test = true;\r\n\t\t\t\t break;\r\n\t\t\t\t case 3:\t\tnewUnitTest(old, u);\r\n\t\t\t\t unit = new Baron(this);\r\n\t\t\t\t unit.move(false);\r\n\t\t\t\t setAdjacentProtection();\r\n\t\t\t\t test = true;\r\n\t\t\t\t break;\r\n\t\t\t\t default:\r\n\t\t\t\t \t//possibly put a noise or alert here\r\n\t\t\t\t// \t\tAlert a = new Alert(AlertType.WARNING);\r\n\t\t\t\t// \t\ta.setTitle(\"Warning\"); \r\n\t\t\t\t \t\ttest = false;\r\n\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\t//play a noise or something\r\n\t\t\t \t}\r\n\t\t\t\t }\r\n\t\t\t\t else\r\n\t\t\t\t {\r\n\t\t\t\t \t//possibly put a noise or sumting.\r\n\t\t\t\t }\r\n\t\t\t\t }\r\n\t\t\t\t else\r\n\t\t\t\t {\r\n\t\t\t\t \tnewUnitTest(old, u);\r\n\t\t\t\t unit = u;\r\n\t\t\t\t u.setTile(this);\r\n\t\t\t\t setAdjacentProtection();\r\n\t\t\t\t test = true;\r\n\t\t\t\t }\r\n\t\t\t }\r\n\t\t\t\t else\r\n\t\t\t\t {\r\n\t\t\t\t \t//As of now the only time that this case (setting unit to enemy tile) is used is when called by territories move unit method.\r\n\t\t\t\t \t\t//This means that when you build a new unit (in this case a peasant) you have to put them on your territory before moving them to another players tile.\r\n\t\t\t\t \t\tif(old != null)\r\n\t\t\t\t \t\t{\r\n\t\t\t\t \t\t\tunit = u;\r\n\t\t\t\t \t\t\tu.setTile(this);\r\n\t\t\t\t setAdjacentProtection();\r\n\t\t\t\t test = true;\r\n\t\t\t\t \t\t}\r\n\t\t\t\t \t\telse\r\n\t\t\t\t \t\t{\r\n\t\t\t\t \t\t\t//maybe make a noise or something\r\n\t\t\t\t \t\t}\r\n\t\t\t\t }\r\n\t \t\t}\r\n\t \t\telse\r\n\t \t\t{\r\n\t \t\t\t//maybe play a noise or something\r\n\t \t\t}\r\n \t\t}\r\n \t\telse\r\n \t\t{\r\n \t\t\tif(!hasUnit())\r\n \t\t\t{\r\n\t \t\t\tunit = u;\r\n\t u.setTile(this);\r\n\t setAdjacentProtection();\r\n\t test = true;\r\n \t\t\t}\r\n \t\t}\r\n \t}\r\n \telse\r\n \t{\r\n \t\tunit = u;\r\n u.setTile(this);\r\n setAdjacentProtection();\r\n test = true;\r\n \t}\r\n } \r\n\t return test;\r\n\t \r\n}", "public void gameFortify(){\n if (!currentPlayer.wantToFortify(this) || this.hasWinner()) return;\n //Want to fortify if made it to here\n\n Territory fortifyGiver = this.getTerritory(currentPlayer.chooseFortifyGiver(this));\n Territory fortifyReceiver = this.getTerritory(currentPlayer.chooseFortifyReceiver(this, fortifyGiver.getTerritoryName()));\n int troopsToMove = currentPlayer.getFortifyTroops(this, fortifyGiver);\n\n fortifyGiver.changeTroops(-troopsToMove);\n fortifyReceiver.changeTroops(troopsToMove);\n\n displayMessage(\"Fortify stage complete\");\n gameState = GameState.MESSAGE;\n }", "public void dealerTurn() {\n\t\tview.writeLog(\"All players pass, dealer's turn.\");\n\t\tdealer.send(new Package(\"MESSAGE\",\"Now is your turn.\"));\n\t\tdealer.send(new Package(\"ASK\",null));\n\t}", "@Override\r\n\tpublic void start() {\r\n\t\tsuper.start();\r\n\t\tresetDice();\r\n\t\tclearPlayer();\r\n\t\t// changing the state of all the players to playing.\r\n\r\n\t\tsuccessID = 0;\r\n\t\t// 输家ID\r\n\t\tfailID = 0;\r\n\r\n\t\tint taxes = hallType.getSystemTaxes();\r\n\t\tList<Player> list = getAllPlayers();\r\n\t\tfor (Player player : list) {\r\n\t\t\tplayer.setPlayerState(PlayerState.Playing);\r\n\t\t\tplayer.getPlayerDetail().addCoins(taxes * -1);\r\n\t\t\taddPlayer(player);\r\n\r\n\t\t\tplayer.resetPlayer(hallType.getGameType());\r\n\t\t}\r\n\t\tint gamePlayerCount = list.size();// 记录游戏类型的局数\r\n\t\tGameMgr.addGameTypeCount(gamePlayerCount);\r\n\t\tsendUpdatePlayerState();\r\n\r\n\t\tsortQueue();\r\n\t\tSendGameStart(taxes);\r\n\t\tgameState = GameState.Playing;\r\n\r\n\t\tWaitTime(1 * 1000);\r\n\t\t// checkState(0);\r\n\r\n\t}", "private void createTx() throws Exception {\n PublicKey recipient = Seed.getRandomAddress();\n Transaction tx = new Transaction(wallet.pb, recipient, wallet.pr);\n//\t\tSystem.out.println(\"Created a tx\");\n txPool.add(tx);\n//\t\tcache.put(tx.txId, null);\n sendTx(tx);\n }", "public void deliverStone5() {\n }", "private void notWorthy(final Player player) {\n\t\tplayer.getInterfaceManager().closeChatBoxInterface();\n\t\tplayer.lock(15);\n\t\tplayer.setNextFaceWorldTile(new WorldTile(3084, 3483, 0));\n\t\tWorldTasksManager.schedule(new WorldTask() {\n\t\t\tint phase = 0;\n\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tfinal int[] randomNPC = { 6935, 3283, 4344, 6966 };\n\t\t\t\tswitch (phase) {\n\t\t\t\tcase 0:\n\t\t\t\t\tplayer.setNextAnimation(new Animation(857));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tplayer.setNextAnimation(new Animation(915));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tplayer.setNextAnimation(new Animation(857));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tplayer.setNextGraphics(new Graphics(86));\n\t\t\t\t\tplayer.getGlobalPlayerUpdater().transformIntoNPC(randomNPC[Utils.random(randomNPC.length - 1)]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tplayer.setNextForceTalk(new ForceTalk(\".... what in Helwyr is going on..!?\"));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\tplayer.setNextGraphics(new Graphics(86));\n\t\t\t\t\tplayer.getGlobalPlayerUpdater().transformIntoNPC(-1);\n\t\t\t\t\tplayer.setNextAnimation(new Animation(10070));\n\t\t\t\t\t//player.setNextForceMovement(new ForceMovement(new WorldTile(3084, 3485, 0), 0, 2));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t\t//player.setNextWorldTile(new WorldTile(3084, 3485, 0)); TODO find out why force movement doesn't work <.>\n\t\t\t\t\tNPC guard = World.findNPC(5941);\n\t\t\t\t\tsendNPCDialogue(4405, GOOFY_LAUGH, \"Looks like Dahmaroc had a sense of humour!\");\n\t\t \t // player.faceEntity(guard);\n\t\t \t // guard.faceEntity(player);\n\t\t\t\t\tplayer.unlock();\n\t\t\t\t\tstage = 99;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tphase++;\n\t\t\t}\n\t\t}, 0, 2);\n\t}", "public void start() {\n // Bid initialized (higher the number, lower the bid rank)\n bid = 100;\n // Check if the players have token, if no token remove player from the game\n // The player remaining wins the pot\n for (int i = 0; i < numberOfPlayers; i++) {\n if (tokens.get(i) == 0) {\n players.remove(i);\n tokens.remove(i);\n cups.remove(i);\n // Add pot to the remaining player's balance\n }\n }\n numberOfPlayers = players.size();\n // Roll all five dice inside the cup for each player\n for (int i = 0; i < numberOfPlayers; i++) {\n cups.get(i).shake();\n }\n // Get the player with the highest poker dice hand\n firstPlayer = players.get(0);\n for (int i = 1; i < numberOfPlayers; i++) {\n PokerDiceHand first = cups.get(players.indexOf(firstPlayer)).getHand();\n PokerDiceHand current = cups.get(i).getHand();\n if (current.getRank() < first.getRank()) {\n firstPlayer = players.get(i);\n }\n }\n // First player's turn\n turn = firstPlayer;\n gameCup = new Cup();\n gameCup.shake();\n }", "@Override\r\n\tpublic void sendShakePrepare() {\r\n\t\tCollection<Player> list = getPlayers().values();\r\n\t\tif ((getGameState() == GameState.Created || getGameState() == GameState.Prepared) && list.size() > 1) {\r\n\t\t\t// 这里的逻辑有BUG,这个是发送给房间所有的用户是否可以摇筛子,如果用户已经摇过了就不可以再发\r\n\t\t\t// 把SendToALL改为一个个的判断发\r\n\r\n\t\t\tboolean isShaked = false;\r\n\t\t\tfor (Player player : list) {\r\n\t\t\t\tif (player.getPlayerState() == PlayerState.EndShaked) {\r\n\t\t\t\t\tisShaked = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (isShaked) {\r\n\t\t\t\tsendNotShakeUserPrepare();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tfor (Player player : list) {\r\n\t\t\t\tPacket packet = new Packet(UserCmdOutType.SHAKE_PREPARE);\r\n\t\t\t\tisShaked = false;\r\n\t\t\t\tif (player.getPlayerState() == PlayerState.EndShaked) {\r\n\t\t\t\t\tisShaked = true;\r\n\t\t\t\t}\r\n\t\t\t\tif (!isShaked) {\r\n\t\t\t\t\tpacket.putBoolean(isShaked);\r\n\t\t\t\t\tsendToPlayer(packet, player);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void pay(Tuple pos, Dice dice, Board board) {\n if (board.legal_entrances[pos.a][pos.b] == 0 \n || board.entrances[pos.a][pos.b] == null \n || board.entrances[pos.a][pos.b].getInUse() == false) return;\n \n Entrance entrance = board.entrances[pos.a][pos.b];\n \n // Check if entrance is player's entrance\n if (entrance.getPlayer().getID() == id) return;\n\n Player rival = entrance.getPlayer();\n HotelCard rival_hotel = entrance.getHotel();\n \n System.out.println(ANSI() + \"Player\" + id + \" is on an entrance of a Player\" + rival.getID()+ ANSI_RESET);\n\n // Roll Dice\n System.out.println(ANSI() + \"Player\" + id + \" rolls dice for payment.\" + ANSI_RESET);\n System.out.println(ANSI() + \"Player\" + id + \" please press any button\" + ANSI_RESET);\n Scanner s = new Scanner(System.in);\n String str = s.nextLine();\n int result = dice.roll();\n System.out.println(ANSI() + \"Dice Result: \" + result + ANSI_RESET);\n\n // Pay rival player\n int payment = rival_hotel.getCard().get(rival_hotel.getRank()).b * 6;\n\n // Deal falls through ----> bankrupt\n if (getMLS() <= payment) {\n payment -= getMLS();\n rival.setMLS(rival.getMLS() + payment);\n System.out.println(ANSI() + \"Player\" + id + \" pays to Player\" + rival.getID() + \" \" + payment + \" MLS.\" + ANSI_RESET);\n System.out.println(ANSI() + \"Player\" + id + \" bankrupts\" + ANSI_RESET);\n System.out.println(ANSI() + \"Player\" + rival.getID() + \" has now \" + rival.getMLS() + \" MLS.\" + ANSI_RESET);\n bankrupt(board, pos);\n return;\n }\n\n // Normal Payment\n rival.setMLS(rival.getMLS() + payment);\n setMLS(getMLS() - payment);\n System.out.println(ANSI() + \"Player\" + id + \" pays to Player\" + rival.getID() + \" \" + payment + \" MLS.\" + ANSI_RESET);\n System.out.println(ANSI() + \"Player\" + id + \" has now \" + mls + \" MLS.\" + ANSI_RESET);\n System.out.println(ANSI() + \"Player\" + rival.getID() + \" has now \" + rival.getMLS() + \" MLS.\" + ANSI_RESET);\n return;\n }", "public void payForOrder(){\n\t\tcurrentOrder.setDate(new Date()); // setting date to current\n\t\t\n\t\t//Checking if tendered money is enough to pay for the order.\n\t\tfor(;;){\n\t\t\tJOptionPane.showMessageDialog(this.getParent(), new CheckoutPanel(currentOrder), \"\", JOptionPane.PLAIN_MESSAGE);\n\t\t\tif(currentOrder.getTendered().compareTo(currentOrder.getSubtotal())==-1){\n\t\t\t\tJOptionPane.showMessageDialog(this.getParent(), \"Not enough money tendered\", \"Error\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\t//Setting order number.\n\t\tSimpleDateFormat df = new SimpleDateFormat(\"yyyyMMdd\");\n\t\tString str = df.format(currentOrder.getDate());\n\t\tString number = Integer.toString(till.getOrders().size()+1) +\"/\"+str;\n\t\tcurrentOrder.setNumber(number);\n\t\t\n\t\t//Setting customer name.\n\t\tcurrentOrder.setCustomerName(custNameField.getText());\n\t\t\n\t\t//Adding current order to orders list.\n\t\ttill.getOrders().add(currentOrder); \n\t\t\n\t\t//Displays the receipt.\n\t\tJOptionPane.showMessageDialog(this.getParent(), new ReceiptPanel(currentOrder), \"Receipt\", \n\t\t\t\tJOptionPane.PLAIN_MESSAGE);\n\t\t\n\t\t//Resets OrderPanel.\n\t\tthis.resetOrder();\n\t}", "private void build() {\n resetUpdate();\n\n gameMessage.setSpace1(clientMessage.getSpace1());\n gameMessage.setLevel(clientMessage.getLevelToBuild());\n gameMessage.notify(gameMessage);\n\n if ( liteGame.getCurrWorker() == null ){\n removePlayerFromTheGame();\n }\n }", "private static void mainTribrid(Player player) {\n\t\tbankInventoryAndEquipment(player);\n\t\tspawnInventory(player, TribridMain.inventorySet(player));\n\t\tspawnEquipment(player, TribridMain.equipmentSet(player));\n\t\tupdateEquipment(player);\n\t\theal(player, true, true);\n\t\tsetCombatSkills(player, \"MAIN\", false, null);\n\t\tsetPrayerAndMagicBook(player, \"ANCIENT\");\n\t\tPresets.isPresetFlagged(player, player.bankIsFullWhileUsingPreset);\n\t}", "private void makeWithdraw() {\n\t\t\r\n\t}", "private void communityChest(Player currentPlayer){\n Random rand = new Random();\n int randomNum = rand.nextInt((3 - 1) + 1) + 1;\n int nextPlayer;\n if(m_currentTurn >= m_numPlayers){\n nextPlayer = 0;\n } else {\n nextPlayer = m_currentTurn+1;\n }\n\n if(randomNum == 1){\n convertTextToSpeech(\"Your new business takes off, collect 200\");\n if(m_manageFunds) {\n Log.d(\"chance add 200\", currentPlayer.getName() +\n String.valueOf(currentPlayer.getMoney()));\n currentPlayer.addMoney(200);\n funds.setText(String.valueOf(currentPlayer.getMoney()));\n Log.d(\"chance add 200\", currentPlayer.getName() +\n String.valueOf(currentPlayer.getMoney()));\n }\n }\n if(randomNum == 2){\n convertTextToSpeech(\"Your friend hires your villa for a week, \" +\n \"collect 100 off the next player\");\n if(m_manageFunds) {\n Log.d(\"chance add 100\", currentPlayer.getName() +\n String.valueOf(currentPlayer.getMoney()));\n currentPlayer.addMoney(100);\n funds.setText(String.valueOf(currentPlayer.getMoney()));\n Log.d(\"chance add 100\", currentPlayer.getName() +\n String.valueOf(currentPlayer.getMoney()));\n\n Log.d(\"chance subtract 100\", players.get(nextPlayer).getName() +\n String.valueOf(players.get(nextPlayer).getMoney()));\n players.get(nextPlayer).subtractMoney(100);\n Log.d(\"chance subtract 100\", players.get(nextPlayer).getName() +\n String.valueOf(players.get(nextPlayer).getMoney()));\n }\n }\n if(randomNum == 3){\n convertTextToSpeech(\"You receive a tax rebate, collect 300\");\n if(m_manageFunds) {\n Log.d(\"chance add 300\", currentPlayer.getName() +\n String.valueOf(currentPlayer.getMoney()));\n currentPlayer.addMoney(300);\n funds.setText(String.valueOf(currentPlayer.getMoney()));\n Log.d(\"chance add 300\", currentPlayer.getName() +\n String.valueOf(currentPlayer.getMoney()));\n }\n }\n }", "public static void Transfer(JailPrisoner prisoner, Player player)\r\n \t{\r\n \t\tif (prisoner.getTransferDestination() == \"find nearest\") prisoner.setTransferDestination(JailZoneManager.findNearestJail(player.getLocation(), prisoner.getJail().getName()).getName());\r\n \t\t\r\n \t\tif (prisoner.getCell() != null)\r\n \t\t{\r\n \t\t\tInventory inventory = player.getInventory();\r\n \t\t\tJailCell cell = prisoner.getCell();\r\n \t\t\tcell.setPlayerName(\"\");\r\n \t\t\tfor (Sign sign : cell.getSigns())\r\n \t\t\t{\r\n \t\t\t\tsign.setLine(0, \"\");\r\n \t\t\t\tsign.setLine(1, \"\");\r\n \t\t\t\tsign.setLine(2, \"\");\r\n \t\t\t\tsign.setLine(3, \"\");\r\n \t\t\t\tsign.update();\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\tif (cell.getChest() != null) \r\n \t\t\t{\r\n \t\t\t\tfor (ItemStack i: cell.getChest().getInventory().getContents())\r\n \t\t\t\t{\r\n \t\t\t\t\tif (i == null || i.getType() == Material.AIR) continue;\r\n \t\t\t\t\tinventory.addItem(i);\r\n \t\t\t\t}\r\n \t\t\t\tcell.getChest().getInventory().clear();\r\n \t\t\t}\r\n \t\t\tif (cell.getSecondChest() != null) \r\n \t\t\t{\r\n \t\t\t\tfor (ItemStack i: cell.getSecondChest().getInventory().getContents())\r\n \t\t\t\t{\r\n \t\t\t\t\tif (i == null || i.getType() == Material.AIR) continue;\r\n \t\t\t\t\tinventory.addItem(i);\r\n \t\t\t\t}\r\n \t\t\t\tcell.getSecondChest().getInventory().clear();\r\n \t\t\t}\r\n \t\t\tprisoner.setCell(null);\r\n \t\t}\r\n \t\t\t\t\t\t\r\n \t\tprisoner.SetBeingReleased(true);\r\n \t\t\r\n \t\tString targetJail = prisoner.getTransferDestination();\r\n \t\tif (targetJail.contains(\":\"))\r\n \t\t{\r\n \t\t\tprisoner.setRequestedCell(targetJail.split(\":\")[1]);\r\n \t\t\ttargetJail = targetJail.split(\":\")[0];\t\t\t\r\n \t\t}\r\n \t\t\r\n \t\tJailZone jail = Jail.zones.get(targetJail);\r\n \t\tprisoner.setJail(jail);\r\n \t\tprisoner.setTransferDestination(\"\");\r\n \t\tprisoner.setOfflinePending(false);\r\n \t\tUtil.Message(jail.getSettings().getString(Setting.MessageTransfer), player);\r\n \t\tJail.prisoners.put(prisoner.getName(),prisoner);\r\n \r\n \t\tJailCell cell = jail.getRequestedCell(prisoner);\r\n \t\tif (cell == null || (cell.getPlayerName() != null && !cell.getPlayerName().equals(\"\") && !cell.getPlayerName().equals(prisoner.getName()))) \r\n \t\t{\r\n \t\t\tcell = null;\r\n \t\t\tcell = jail.getEmptyCell();\r\n \t\t}\r\n \t\tif (cell != null)\r\n \t\t{\r\n \t\t\tcell.setPlayerName(player.getName());\r\n \t\t\tprisoner.setCell(cell);\r\n \t\t\tplayer.teleport(prisoner.getTeleportLocation());\r\n \t\t\tprisoner.updateSign();\r\n \t\t\tif (jail.getSettings().getBoolean(Setting.StoreInventory) && cell.getChest() != null)\r\n \t\t\t{\r\n \t\t\t\tChest chest = cell.getChest();\r\n \t\t\t\tchest.getInventory().clear();\r\n \t\t\t\tfor (int i = 0;i<40;i++)\r\n \t\t\t\t{\r\n \t\t\t\t\tif (chest.getInventory().getSize() <= Util.getNumberOfOccupiedItemSlots(chest.getInventory().getContents())) break;\r\n \t\t\t\t\tif (player.getInventory().getItem(i) == null || player.getInventory().getItem(i).getType() == Material.AIR) continue;\r\n \t\t\t\t\tchest.getInventory().addItem(player.getInventory().getItem(i));\r\n \t\t\t\t\tplayer.getInventory().clear(i);\r\n \t\t\t\t}\r\n \t\t\t\t\t\t\t\t\r\n \t\t\t\tif (cell.getSecondChest() != null)\r\n \t\t\t\t{\r\n \t\t\t\t\tchest = cell.getSecondChest();\r\n \t\t\t\t\tchest.getInventory().clear();\r\n \t\t\t\t\tfor (int i = 0;i<40;i++)\r\n \t\t\t\t\t{\r\n \t\t\t\t\t\tif (chest.getInventory().getSize() <= Util.getNumberOfOccupiedItemSlots(chest.getInventory().getContents())) break;\r\n \t\t\t\t\t\tif (player.getInventory().getItem(i) == null || player.getInventory().getItem(i).getType() == Material.AIR) continue;\r\n \t\t\t\t\t\tchest.getInventory().addItem(player.getInventory().getItem(i));\r\n \t\t\t\t\t\tplayer.getInventory().clear(i);\r\n \t\t\t\t\t}\r\n \r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t\tcell.update();\r\n \t\t}\r\n \t\telse\r\n \t\t{\r\n \t\t\tplayer.teleport(prisoner.getTeleportLocation());\r\n \t\t}\r\n \t\t\r\n \t\tif (jail.getSettings().getBoolean(Setting.StoreInventory)) \r\n \t\t{\r\n \t\t\tprisoner.storeInventory(player.getInventory());\r\n \t\t\tplayer.getInventory().clear();\r\n \t\t}\r\n \t\t\r\n \t\tprisoner.SetBeingReleased(false);\r\n \t\tInputOutput.UpdatePrisoner(prisoner);\r\n \t}", "private void askPlayer() {\n System.out.println(\"Dealers last card is \" + Dealer.showLast());\n System.out.println(\"Your hand is \" + p1.getHand());\n System.out.println(\"Your Hand total is \" + p1.getTotal() + \". Would you like to hit or stand?\");\n\n String s = scan.nextLine();\n System.out.println();\n\n if (s.equalsIgnoreCase(\"hit\")) {\n p1.addToHand(dealCard());\n p1.calcTotal();\n if (p1.getTotal() > 31) {\n System.out.println(\"Your hand is \" + p1.getHand());\n System.out.println(\"Your hand total is \" + p1.getTotal());\n System.out.println(\"You bust, Dealer wins\");\n\n totalWinnings -= betNum;\n p1.subPointCount(betNum);\n bust = true;\n\n System.out.println(\"Total Winnings: \" + totalWinnings + \"\\n\");\n\n } else {\n askPlayer();\n }\n } else {\n System.out.println(\"You stand at \" + p1.getTotal());\n\n while (Dealer.calcTotal() < 26) {\n Dealer.addToHand(dealCard());\n\n }\n System.out.println(\"Dealer's hand is \" + Dealer.getHand());\n System.out.println(\"Dealer's hand total is \" + Dealer.getTotal());\n\n }\n }", "public void letSmartComputerSetup() {\n //generates a random spot for the flag\n int randomRow = (int)(Math.random() * 2);\n int randomCol = (int)(Math.random() * 10);\n\n //adjusts the flag for the proper team\n if(state.getCurrentTeamsTurn().getTEAMNUMBER() == 0) {\n randomRow += 8;\n }\n\n //adds the flag to the board\n state.setLastTappedPieceButton(Rank.FLAG);\n state.tapOnSquare(randomRow, randomCol);\n state.tapOnSquare(randomRow, randomCol);\n\n //places bombs around the flag if possible\n state.setLastTappedPieceButton(Rank.BOMB);\n if(randomRow != 0) {\n state.tapOnSquare(randomRow - 1, randomCol);\n state.tapOnSquare(randomRow - 1, randomCol);\n }\n if(randomRow != 9) {\n state.tapOnSquare(randomRow + 1, randomCol);\n state.tapOnSquare(randomRow + 1, randomCol);\n }\n if(randomCol != 0) {\n state.tapOnSquare(randomRow, randomCol -1);\n state.tapOnSquare(randomRow, randomCol -1);\n }\n if(randomCol != 9) {\n state.tapOnSquare(randomRow, randomCol + 1);\n state.tapOnSquare(randomRow, randomCol + 1);\n }\n\n //transitions the player to play phase\n state.transitionPhases();\n }", "@Override\n public void detectAndSendChanges()\n {\n super.detectAndSendChanges();\n TileEntitySmeltingFurnace.Result result = te.getResult(inventoryPlayer.player.getUniqueID());\n if(this.progress != result.progress)\n {\n this.progress = result.progress;\n for (Object crafter : this.crafters)\n {\n ((ICrafting) crafter).sendProgressBarUpdate(this, 0, this.progress);\n }\n }\n if(result.recipe != this.recipe)\n {\n this.recipe = result.recipe;\n if(result.recipe != null)\n {\n this.time = result.recipe.getTime();\n for (Object crafter : this.crafters)\n {\n if (crafter instanceof EntityPlayerMP)\n {\n ((EntityPlayerMP) crafter).isChangingQuantityOnly = false;\n }\n ((ICrafting) crafter).sendProgressBarUpdate(this, 1, this.time);\n ((ICrafting) crafter).sendSlotContents(this, inventorySlots.size(), recipe.getResult());\n }\n }\n else\n {\n for (Object crafter : this.crafters)\n {\n if (crafter instanceof EntityPlayerMP)\n {\n ((EntityPlayerMP) crafter).isChangingQuantityOnly = false;\n }\n ((ICrafting) crafter).sendSlotContents(this, inventorySlots.size(), null);\n }\n }\n }\n }", "private void startingSetup(boolean shelter) {\r\n\t\tArrayList<Card> startDeck = new ArrayList<Card>();\r\n\t\twhile(startDeck.size() < 7) {\r\n\t\t\tstartDeck.add(new Copper());\r\n\t\t}\r\n\t\tif(shelter) {\r\n\t\t\tstartDeck.add(new OvergrownEstate());\r\n\t\t\tstartDeck.add(new Hovel());\r\n\t\t\tstartDeck.add(new Necropolis());\r\n\t\t}\r\n\t\telse {\r\n\t\t\twhile(startDeck.size() < 10) {\r\n\t\t\t\tstartDeck.add(new Estate());\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\tdeck = new Deck(access.random, startDeck, access, this);\r\n\t\tdeck.cleanUp();\r\n\t\tactions = 1;\r\n\t\tbuys = 1;\r\n\t\ttreasure = 0;\r\n\t\tpotion = 0;\r\n\t}", "public void buy(int num) {\r\n\t\t// Make sure there is one in stock and enough gold and in market rooms\r\n\t\tif (marketItemCount[num-1] > 0 && currentPlayer.getGold() >= 7 && (currentPlayer.getCurrentRoom() == 18 || currentPlayer.getCurrentRoom() == 19 || currentPlayer.getCurrentRoom() == 24 || currentPlayer.getCurrentRoom() == 25)) {\r\n\t\t\t// Adjust item index based on how many left\r\n\t\t\tint itemIndex = 0;\r\n\t\t\tif (num == 2) itemIndex = 2;\r\n\t\t\tif (num == 3) itemIndex = 4;\r\n\t\t\twhile (market[itemIndex] == null) {\r\n\t\t\t\titemIndex++;\r\n\t\t\t}\r\n\t\t\tcurrentPlayer.pickup(market[itemIndex]);\r\n\t\t\tcurrentPlayer.updateGold(-7);\r\n\t\t\taddEvent(\"``\"+currentName+\"`` bought a \"+market[itemIndex].substring(0,market[itemIndex].length()-1).replace(\"1\",\"\"),true);\r\n\t\t\taddHistory(market[itemIndex].substring(0,market[itemIndex].length()-1).replace(\"1\",\"\").toUpperCase());\r\n\t\t\tmarket[itemIndex] = null;\r\n\t\t\tmarketItemCount[num-1] -= 1;\r\n\t\t\tupdateMarketAndTreasures(false);\r\n\t\t\tupdatePlayArea(currentPlayer, false);\r\n\t\t\t//updateDungeonRow(currentPlayer, false);\r\n\t\t\tupdateInfo(currentPlayer, false);\r\n\t\t}\r\n\t}" ]
[ "0.6905986", "0.6708167", "0.6226878", "0.62015516", "0.6091646", "0.60734856", "0.6024153", "0.60189784", "0.59815854", "0.59489954", "0.5928802", "0.5924167", "0.58962303", "0.5873603", "0.5847583", "0.58343214", "0.58265233", "0.5825289", "0.5817068", "0.58165425", "0.5815214", "0.5793286", "0.576906", "0.5748476", "0.5745697", "0.57429534", "0.5737898", "0.5726248", "0.57106346", "0.56842214", "0.5678261", "0.5674046", "0.5658652", "0.5657446", "0.5652601", "0.56523955", "0.5650377", "0.5649925", "0.5648546", "0.5646094", "0.5635171", "0.5633018", "0.5618298", "0.5612564", "0.56117374", "0.56104594", "0.56072056", "0.5606762", "0.5600104", "0.55986184", "0.55942816", "0.5587276", "0.5579679", "0.5573752", "0.5571124", "0.5567562", "0.55663675", "0.55620825", "0.55589104", "0.5557827", "0.55570215", "0.55470335", "0.55336094", "0.55333877", "0.55239296", "0.5506613", "0.5500796", "0.5499778", "0.5497577", "0.54949224", "0.54934007", "0.54784286", "0.5475269", "0.54661274", "0.54590744", "0.5457527", "0.54552466", "0.5452328", "0.545156", "0.5449441", "0.5448701", "0.54481184", "0.5446304", "0.5445937", "0.54414815", "0.5438976", "0.54352766", "0.54332274", "0.54304445", "0.542897", "0.5426314", "0.54244477", "0.54240507", "0.54208136", "0.54191136", "0.54084384", "0.5407072", "0.5404481", "0.53983", "0.539783", "0.53976214" ]
0.0
-1
This method is called when a player tries to build a city
boolean CanBuyCity();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void createNewCity()\r\n {\r\n int currentPlayer = worldPanel.getCurrentPlayer();\r\n int currentUnit = worldPanel.getCurrentUnit();\r\n boolean canBuild = false;\r\n\r\n if(currentPlayer == 1)\r\n {\r\n int unitType = worldPanel.player1.units[currentUnit - 1].getUnitType();\r\n if(unitType == 1)//if unit is a settler\r\n canBuild = true;\r\n }\r\n\r\n else if(currentPlayer == 2)\r\n {\r\n int unitType = worldPanel.player1.units[currentUnit - 1].getUnitType();\r\n if(unitType == 1)//if unit is a settler\r\n canBuild = true;\r\n }\r\n\r\n //if the unit who presses build is a settler\r\n if(canBuild == true)\r\n {\r\n if(currentPlayer == 1)\r\n {\r\n int playerLoc = worldPanel.player1.units[currentUnit - 1].getPosition();\r\n worldPanel.player1.addCity(playerLoc);\r\n currentUnit++;\r\n worldPanel.setCurrentUnit(currentUnit);\r\n }//end if\r\n else if(currentPlayer == 2)\r\n {\r\n int playerLoc = worldPanel.player2.units[currentUnit - 1].getPosition();\r\n worldPanel.player2.addCity(playerLoc);\r\n currentUnit++;\r\n worldPanel.setCurrentUnit(currentUnit);\r\n }//end elseif\r\n }//end if\r\n\r\n //set new player and unit if necessary\r\n int temp = worldPanel.getNumUnits(currentPlayer);\r\n if(currentUnit > temp)\r\n {\r\n if(currentPlayer == 1)\r\n worldPanel.setCurrentPlayer(2);\r\n else\r\n worldPanel.setCurrentPlayer(1);\r\n worldPanel.setCurrentUnit(1);\r\n }//end if\r\n\r\n //set up new mapPosition if player moved\r\n if(canBuild == true)\r\n setMapPos();\r\n setInfoPanel();\r\n }", "@Override\r\n\tpublic void buildCity() {\n\t\t\r\n\t}", "private void buildCity() {\r\n\t\tMessage message = new Message(clickedNode, true, null);\r\n\t\tsendMessage(message);\r\n\t}", "private void fillCity() {\n \n if(postalCodeTF.getText().length() == 4){\n City city = memberConnection.getCity(postalCodeTF.getText());\n cityTF.setText(city.getCity().replaceAll(\"_\", \" \"));\n municipalTF.setText(city.getMunicipal().replaceAll(\"_\", \" \"));\n }\n }", "public boolean canDoBuyCity(){\n\t\t if(resourceCardHand.canDoPayForCity() == false || playerPieces.hasAvailableCity() == false) {\n\t\t\t return false;\n\t\t }\n\t\t // If the player does not have a valid place to put a city on the map, we won't let the player buy a city\n\t\t if(playerPieces.canPlaceACityOnTheMap() == false) {\n\t\t\t return false;\n\t\t }\n\t\t return true;\n\t }", "private void searchCity() {\n toggleProgress();\n try {\n WeatherClient client = builder.attach(this)\n .provider(new OpenweathermapProviderType())\n .httpClient(WeatherClientDefault.class)\n .config(config)\n .build();\n\n // Try to find a good location\n // using medium settings\n Criteria criteria = new Criteria();\n criteria.setPowerRequirement(Criteria.POWER_MEDIUM);\n criteria.setAccuracy(Criteria.ACCURACY_MEDIUM);\n // Can we use data?\n criteria.setCostAllowed(true);\n\n // Search city by gps/network using\n // above critera\n client.searchCityByLocation(\n criteria,\n new WeatherClient.CityEventListener() {\n\n // When we get the city list\n @Override\n public void onCityListRetrieved(List<City> cityList) {\n for (int i = 0; i < cityList.size(); i++) {\n adapter.set(cityList.get(i), i);\n }\n displayMessage(\"Not the correct results?\" +\n \" Press the button above to try again.\");\n }\n\n\n @Override\n public void onWeatherError(WeatherLibException wle) {\n displayMessage(\"There seems to be no \" +\n \"weather data, please try again later.\");\n\n }\n\n\n @Override\n public void onConnectionError(Throwable t) {\n displayMessage(\"Whoops! We can't seem to \" +\n \"connect to the weather servers.\");\n }\n\n });\n\n } catch (WeatherProviderInstantiationException e) {\n displayMessage(\"Error: Unable to access \" +\n \"the weather provider.\");\n } catch (LocationProviderNotFoundException e) {\n displayMessage(\"Whoops! Unable to access \" +\n \"location provider.\");\n } catch (NullPointerException e) {\n displayMessage(\"Whoops! We can't seem to\" +\n \"connect to the weather servers.\");\n }\n\n }", "private void addCities() {\n int random2 = 0;\n for (int i = 1; i < MAP_LENGTH-1; i++) {\n for (int j = 1; j < MAP_LENGTH-1; j++) {\n if (tileMap[i][j].getTerrain() instanceof Grass) { //Make cities on grass tiles only\n random2 = (int)(Math.round(Math.random()*18));\n if (!adjacentCity(i, j) && (random2 < 3)) {\n tileMap[i][j].setCity(new City(i, j, false)); //If randomly chosen and not in proximity of another city, create a city there (right now set as not a capital)\n }\n }\n }\n }\n }", "@Override\n public void ready() {\n Entity en = ce();\n\n if ((en instanceof Dropship) && !en.isAirborne()) {\n ArrayList<Coords> crushedBuildingLocs = new ArrayList<Coords>();\n ArrayList<Coords> secondaryPositions = new ArrayList<Coords>();\n secondaryPositions.add(en.getPosition());\n for (int dir = 0; dir < 6; dir++) {\n secondaryPositions.add(en.getPosition().translated(dir));\n }\n for (Coords pos : secondaryPositions) {\n Building bld = clientgui.getClient().getGame().getBoard()\n .getBuildingAt(pos);\n if (bld != null) {\n crushedBuildingLocs.add(pos);\n }\n }\n if (!crushedBuildingLocs.isEmpty()) {\n JOptionPane\n .showMessageDialog(\n clientgui,\n Messages.getString(\"DeploymentDisplay.dropshipBuildingDeploy\"), //$NON-NLS-1$\n Messages.getString(\"DeploymentDisplay.alertDialog.title\"), //$NON-NLS-1$\n JOptionPane.ERROR_MESSAGE);\n return;\n }\n }\n\n disableButtons();\n\n clientgui.getClient().deploy(cen, en.getPosition(), en.getFacing(),\n en.getElevation(), en.getLoadedUnits(), assaultDropPreference);\n en.setDeployed(true);\n\n if (ce().isWeapOrderChanged()) {\n clientgui.getClient().sendEntityWeaponOrderUpdate(ce());\n }\n endMyTurn();\n }", "@Override\n public void placeCity(VertexLocation vertex) throws ModelException {\n assert vertex != null;\n if (!GameModelFacade.instance().canPlaceCity(vertex)) {\n throw new ModelException(\"Preconditions for action not met.\");\n }\n\n try {\n String clientModel = m_theProxy.buildCity(GameModelFacade.instance().getLocalPlayer().getIndex(), vertex);\n new ModelInitializer().initializeClientModel(clientModel, m_theProxy.getPlayerId());\n } catch (NetworkException e) {\n throw new ModelException(e);\n }\n }", "private void createNewUnit()\r\n {\r\n int currentPlayer = worldPanel.getCurrentPlayer();\r\n int currentUnit = worldPanel.getCurrentUnit();\r\n int randomNumber = (int)Math.ceil(Math.random() * 8);\r\n boolean canBuild = false;\r\n\r\n if(currentPlayer == 1)\r\n {\r\n int unitType = worldPanel.player1.units[currentUnit - 1].getUnitType();\r\n if(unitType == 1)//if unit is a settler\r\n canBuild = true;\r\n }\r\n\r\n else if(currentPlayer == 2)\r\n {\r\n int unitType = worldPanel.player2.units[currentUnit - 1].getUnitType();\r\n if(unitType == 1)//if unit is a settler\r\n canBuild = true;\r\n }\r\n\r\n //if the unit who presses build is a settler\r\n if(canBuild == true)\r\n {\r\n if(currentPlayer == 1)\r\n {\r\n int playerLoc = worldPanel.player1.units[currentUnit - 1].getPosition();\r\n worldPanel.player1.addUnit2(randomNumber);\r\n int noUnits = worldPanel.player1.getNumUnits();\r\n\t\t\t\t\t\t\t\tif(randomNumber == 7)//if unit is a ship\r\n\t\t\t\t\t\t\t\t\tworldPanel.player1.units[noUnits].setPosition(getSeaLoc(playerLoc));\r\n\t\t\t\t\t\t\t\telse\r\n \tworldPanel.player1.units[noUnits].setPosition(playerLoc);\r\n worldPanel.player1.setNumUnits(noUnits + 1);\r\n currentUnit++;\r\n worldPanel.setCurrentUnit(currentUnit);\r\n }//end if\r\n else if(currentPlayer == 2)\r\n {\r\n int playerLoc = worldPanel.player2.units[currentUnit - 1].getPosition();\r\n worldPanel.player2.addUnit2(randomNumber);\r\n int noUnits = worldPanel.player2.getNumUnits();\r\n\t\t\t\t\t\t\t\tif(randomNumber == 7)//if unit is a ship\r\n\t\t\t\t\t\t\t\t\tworldPanel.player2.units[noUnits].setPosition(getSeaLoc(playerLoc));\r\n\t\t\t\t\t\t\t\telse\r\n \tworldPanel.player2.units[noUnits].setPosition(playerLoc);\r\n worldPanel.player2.setNumUnits(noUnits + 1);\r\n currentUnit++;\r\n worldPanel.setCurrentUnit(currentUnit);\r\n }//end elseif\r\n }//end if\r\n\r\n //set new player and unit if necessary\r\n int temp = worldPanel.getNumUnits(currentPlayer);\r\n if(currentUnit > temp)\r\n {\r\n if(currentPlayer == 1)\r\n worldPanel.setCurrentPlayer(2);\r\n else\r\n worldPanel.setCurrentPlayer(1);\r\n worldPanel.setCurrentUnit(1);\r\n }//end if\r\n\r\n //set up new mapPosition if player moved\r\n if(canBuild == true)\r\n setMapPos();\r\n setInfoPanel();//set up information panel\r\n }", "@Override\n public boolean build(Match m, ClientHandler ch, Server server) {\n int wID=2;\n Player p = m.getPlayer(ch.getName());\n if(p.getWorker(0).getMoved()) wID = 0;\n if(p.getWorker(1).getMoved()) wID = 1;\n ArrayList<Coordinate> coordinates = whereCanBuild(m, ch, wID);\n server.write(ch, \"serviceMessage\", \"MSGE-Build: \\n\");\n if(coordinates.size()!=0){\n Coordinate c = null;\n server.write(ch, \"serviceMessage\", \"LIST-\"+printCoordinates(coordinates));\n server.write(ch, \"interactionServer\", \"TURN-Where you want to build?\\n\");\n int id;\n while(true){\n try{\n String msg = server.read(ch);\n if(msg == null){\n for(ClientHandler chl : server.getClientHandlers()){\n server.write(chl, \"serviceMessage\", \"WINM-Player disconnected\\n\");\n }\n ch.resetConnected();\n ch.closeConnection();\n return false;\n }else{\n id = Integer.parseInt(msg);\n }\n if(id<0 || id>=coordinates.size()){\n server.write(ch, \"serviceMessage\", \"MSGE-Invalid input\\n\");\n server.write(ch, \"interactionServer\", \"TURN-Try another index: \");\n continue;\n }\n break;\n } catch (NumberFormatException e){\n server.write(ch, \"serviceMessage\", \"MSGE-Invalid input\\n\");\n server.write(ch, \"interactionServer\", \"TURN-Try another index: \");\n }\n }\n c = coordinates.get(id);\n if(c.equals(p.getWorker(wID).getPosition()))\n server.write(ch, \"serviceMessage\", \"MSGE-You're using Zeus Power!\\n\");\n m.updateBuilding(c);\n m.getBoard()[c.getX()][c.getY()].setLevelledUp(true);\n p.getWorker(wID).changeBuilt(true);\n return true;\n }else{\n return false;\n }\n\n }", "private void startUpPhase()\n\t{\n\t\tmap.distributeCountries(); /* Randomly split the countries between the players */\n\t\tArrayList<Player> remainingPlayers = new ArrayList<Player>(map.players);\n\t\t\n\t\tdo \n\t\t{\n\t\t\tIterator<Player> i = remainingPlayers.iterator();\n\t\t\t\n\t\t\twhile (i.hasNext()) \n\t\t\t{\n\t\t\t\tPlayer p = i.next();\n\t\t\t\tif(p.getArmies() == 0) \n\t\t\t\t{\n\t\t\t\t\ti.remove();\n\t\t\t\t} \n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\tp.placeOneArmy();\n\t\t\t\t}\n\t\t\t}\n\t\t}while(remainingPlayers.size() != 0);\n\t}", "private void buildStreet() {\r\n\t\tbuilt = false;\r\n\t\tbuildPanelRoad.setVisible(false);\r\n\t\tMessage message = new Message(clickedRoad, true, null);\r\n\t\tsendMessage(message);\r\n\t}", "private void initializeCreateCity() throws Exception {\n if (cityId == null) {\n testACreateCity();\n }\n }", "private void constructionPhase() {\n for( final Player p : playerList ) {\n this.player = p;\n player.flipAllUp();\n ClickObserver.getInstance().setActivePlayer(this.player);\n pause();\n\n ClickObserver.getInstance().setTerrainFlag(\"\");\n ClickObserver.getInstance().setClickedTerrain(player.getHexesOwned().get(0));\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n Board.applyCovers();\n GUI.getRackGui().setOwner(player);\n GUI.getHelpText().setText(\"Construction Phase: \" + p.getName() \n + \", select one of your tiles to build a new tower, or upgrade an existing one.\");\n ClickObserver.getInstance().whenTerrainClicked();\n }\n });\n\t\t\ttry { Thread.sleep(500); } catch( Exception e ){ return; }\n ClickObserver.getInstance().setTerrainFlag(\"Construction: ConstructFort\");\n ArrayList<Terrain> ownedHexes = player.getHexesOwned();\n for (final Terrain t : ownedHexes) {\n if (t.getOwner().getName().equals(player.getName())) {\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n t.uncover();\n }\n });\n }\n }\n while( isPaused ){\n try { Thread.sleep(100); } catch( Exception e ){ return; }\n }\n player.flipAllDown();\n }\n ClickObserver.getInstance().setTerrainFlag(\"\");\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n Board.removeCovers();\n }\n });\n }", "public void playCity() throws ClientException {\n\t\t\tsettlements++;\n\t\t\tcities--;\n\n\t\t\tresources.setOre(resources.getOre() - 3);\n\t\t\tresources.setWheat(resources.getWheat() - 2);\n\n\t}", "public void buyCity(Vertex vertex) throws CannotBuyException, InsufficientPlayerResourcesException, AllPiecesPlayedException {\n\t\t if(canDoBuyCity() == false) {\n\t\t\t throw new CannotBuyException(\"Cannot Buy City, possibly no vertex to place a city\");\n\t\t }\n\t\t resourceCardHand.payForCity();\n\t\t playerPieces.placeCity(vertex);\n\t\t \n\t\t // increment victory points\n\t\t totalVictoryPoints++;\n\t }", "private void prepareWorkplace() throws GameActionException {\r\n\t\tFluxDeposit[] fluxDeposits = myRC.senseNearbyFluxDeposits();\r\n\t\tfor (FluxDeposit deposit : fluxDeposits) {\r\n\t\t\tFluxDepositInfo info = myRC.senseFluxDepositInfo(deposit);\r\n\t\t\tif (fluxInfo == null)\r\n\t\t\t\tfluxInfo = info;\r\n\t\t\tif (fluxInfo.location.distanceSquaredTo(myRC.getLocation()) > info.location.distanceSquaredTo(myRC.getLocation()))\r\n\t\t\t\tfluxInfo = info;\r\n\t\t}\r\n\t}", "public static City buildMapFromNewYork(){\n City bangorME = new City(\"Bangor, ME\");\n \n City portlandME = new City(\"Portland, ME\");\n connect(portlandME, bangorME, 118);\n \n City portsmouthNH = new City(\"Portsmouth, NH\");\n connect(portsmouthNH, portlandME, 55);\n \n City burlingtonVT = new City(\"Burlington, VT\");\n connect(burlingtonVT, portsmouthNH, 190);\n connect(burlingtonVT, portlandME, 259);\n \n City bostonMA = new City(\"Boston, MA\");\n connect(bostonMA, portsmouthNH, 60);\n \n City providenceRI = new City(\"Providence, RI\");\n connect(providenceRI, bostonMA, 53);\n \n City worcesterMA = new City(\"Worcester, MA\");\n connect(worcesterMA, bostonMA, 49);\n connect(worcesterMA, portsmouthNH, 83);\n connect(worcesterMA, providenceRI, 44);\n \n City albanyNY = new City(\"Albany, NY\");\n connect(albanyNY, burlingtonVT, 177);\n connect(albanyNY, worcesterMA, 128);\n \n City newHavenCT = new City(\"New Haven, CT\");\n connect(newHavenCT, worcesterMA, 97);\n connect(newHavenCT, providenceRI, 100);\n \n City newYorkNY = new City(\"New York, NY\");\n connect(newYorkNY, newHavenCT, 79);\n connect(newYorkNY, albanyNY, 141);\n \n City buffaloNY = new City(\"Buffalo, NY\");\n connect(buffaloNY, albanyNY, 266);\n \n City philadelphiaPA = new City(\"Philadelphia, PA\");\n connect(philadelphiaPA, newYorkNY, 98);\n \n City washingtonDC = new City(\"Washington, DC\");\n connect(washingtonDC, philadelphiaPA, 145);\n \n City pittsburghPA = new City(\"Pittsburgh, PA\");\n connect(pittsburghPA, washingtonDC, 240);\n connect(pittsburghPA, philadelphiaPA, 288);\n connect(pittsburghPA, buffaloNY, 200);\n \n City clevelandOH = new City(\"Cleveland, OH\");\n connect(clevelandOH, pittsburghPA, 133);\n connect(clevelandOH, buffaloNY, 183);\n \n City richmondVA = new City(\"Richmond, VA\");\n connect(richmondVA, washingtonDC, 105);\n \n City charlestonWV = new City(\"Charleston, WV\");\n connect(charlestonWV, pittsburghPA, 213);\n connect(charlestonWV, washingtonDC, 343);\n connect(charlestonWV, richmondVA, 297);\n \n City charlotteNC = new City(\"Charlotte, NC\");\n connect(charlotteNC, richmondVA, 260);\n connect(charlotteNC, charlestonWV, 254);\n \n City atlantaGA = new City(\"Atlanta, GA\");\n connect(atlantaGA, charlotteNC, 229);\n \n City jacksonvilleFL = new City(\"Jacksonville, FL\");\n connect(jacksonvilleFL, atlantaGA, 300);\n connect(jacksonvilleFL, charlotteNC, 337);\n \n City miamiFL = new City(\"Miami, FL\");\n connect(miamiFL, jacksonvilleFL, 308);\n \n City tampaFL = new City(\"Tampa, FL\");\n connect(tampaFL, miamiFL, 251);\n connect(tampaFL, jacksonvilleFL, 187);\n \n City newOrleansLA = new City(\"New Orleans, LA\");\n connect(newOrleansLA, jacksonvilleFL, 473);\n connect(newOrleansLA, tampaFL, 563);\n connect(newOrleansLA, atlantaGA, 410);\n \n City nashvilleTN = new City(\"Nashville, TN\");\n connect(nashvilleTN, charlotteNC, 390);\n connect(nashvilleTN, atlantaGA, 226);\n connect(nashvilleTN, charlestonWV, 350);\n \n City memphisTN = new City(\"Memphis, TN\");\n connect(memphisTN, nashvilleTN, 191);\n connect(memphisTN, newOrleansLA, 347);\n connect(memphisTN, atlantaGA, 346);\n \n City detroitMI = new City(\"Detroit, MI\");\n connect(detroitMI, clevelandOH, 164);\n \n City indianapolisIN = new City(\"Indianapolis, IN\");\n connect(indianapolisIN, nashvilleTN, 264);\n connect(indianapolisIN, pittsburghPA, 339);\n connect(indianapolisIN, clevelandOH, 294);\n connect(indianapolisIN, detroitMI, 265);\n connect(indianapolisIN, charlestonWV, 299);\n \n City chicagoIL = new City(\"Chicago, IL\");\n connect(chicagoIL, detroitMI, 265);\n connect(chicagoIL, indianapolisIN, 177);\n \n City milwaukeeWI = new City(\"Milwaukee, WI\");\n connect(milwaukeeWI, chicagoIL, 89);\n \n City minneapolisMN = new City(\"Minneapolis, MN\");\n connect(minneapolisMN, milwaukeeWI, 300);\n \n City fargoND = new City(\"Fargo, ND\");\n connect(fargoND, minneapolisMN, 213);\n \n City siouxFallsSD = new City(\"Sioux Falls, SD\");\n connect(siouxFallsSD, fargoND, 214);\n connect(siouxFallsSD, minneapolisMN, 230);\n connect(siouxFallsSD, milwaukeeWI, 443);\n \n City omahaNE = new City(\"Omaha, NE\");\n connect(omahaNE, siouxFallsSD, 164);\n \n City desMoinesIA = new City(\"Des Moines, IA\");\n connect(desMoinesIA, omahaNE, 124);\n connect(desMoinesIA, chicagoIL, 306);\n connect(desMoinesIA, minneapolisMN, 221);\n \n City stLouisMO = new City(\"St. Louis, MO\");\n connect(stLouisMO, chicagoIL, 286);\n connect(stLouisMO, indianapolisIN, 235);\n connect(stLouisMO, nashvilleTN, 281);\n connect(stLouisMO, memphisTN, 256);\n \n City kansasCityMO = new City(\"Kansas City, MO\");\n connect(kansasCityMO, omahaNE, 168);\n connect(kansasCityMO, desMoinesIA, 176);\n connect(kansasCityMO, stLouisMO, 226);\n \n City oklahomaCityOK = new City(\"Oklahoma City, OK\");\n connect(oklahomaCityOK, kansasCityMO, 312);\n connect(oklahomaCityOK, stLouisMO, 449);\n connect(oklahomaCityOK, memphisTN, 416);\n \n City dallasTX = new City(\"Dallas, TX\");\n connect(dallasTX, oklahomaCityOK, 189);\n connect(dallasTX, memphisTN, 408);\n connect(dallasTX, newOrleansLA, 455);\n \n City houstonTX = new City(\"Houston, TX\");\n connect(houstonTX, dallasTX, 214);\n connect(houstonTX, newOrleansLA, 313);\n \n City sanAntonioTX = new City(\"San Antonio, TX\");\n connect(sanAntonioTX, dallasTX, 246);\n connect(sanAntonioTX, houstonTX, 182);\n \n City elPasoTX = new City(\"El Paso, TX\");\n connect(elPasoTX, dallasTX, 552);\n connect(elPasoTX, sanAntonioTX, 473);\n \n City albuquerqueNM = new City(\"Albuquerque, NM\");\n connect(albuquerqueNM, elPasoTX, 234);\n connect(albuquerqueNM, oklahomaCityOK, 482);\n \n City denverCO = new City(\"Denver, CO\");\n connect(denverCO, albuquerqueNM, 392);\n connect(denverCO, kansasCityMO, 528);\n connect(denverCO, omahaNE, 466);\n \n City billingsMT = new City(\"Billings, MT\");\n connect(billingsMT, denverCO, 485);\n connect(billingsMT, siouxFallsSD, 597);\n connect(billingsMT, fargoND, 529);\n \n City butteMT = new City(\"Butte, MT\");\n connect(butteMT, billingsMT, 211);\n \n City saltLakeCityUT = new City(\"Salt Lake City, UT\");\n connect(saltLakeCityUT, butteMT, 366);\n connect(saltLakeCityUT, denverCO, 480);\n \n City phoenixAZ = new City(\"Phoenix, AZ\");\n connect(phoenixAZ, elPasoTX, 379);\n connect(phoenixAZ, albuquerqueNM, 397);\n \n City lasVegasNV = new City(\"Las Vegas, NV\");\n connect(lasVegasNV, saltLakeCityUT, 369);\n connect(lasVegasNV, albuquerqueNM, 514);\n connect(lasVegasNV, phoenixAZ, 294);\n \n City losAngelesCA = new City(\"Los Angeles, CA\");\n connect(losAngelesCA, lasVegasNV, 263);\n connect(losAngelesCA, phoenixAZ, 350);\n \n City sanDiegoCA = new City(\"San Diego, CA\");\n connect(sanDiegoCA, losAngelesCA, 116);\n connect(sanDiegoCA, phoenixAZ, 335);\n connect(sanDiegoCA, lasVegasNV, 311);\n \n City montereyCA = new City(\"Monterey, CA\");\n connect(montereyCA, losAngelesCA, 319);\n \n City sanFranciscoCA = new City(\"San Francisco, CA\");\n connect(sanFranciscoCA, montereyCA, 114);\n connect(sanFranciscoCA, losAngelesCA, 358);\n \n City sacramentoCA = new City(\"Sacramento, CA\");\n connect(sacramentoCA, sanFranciscoCA, 84);\n connect(sacramentoCA, saltLakeCityUT, 585);\n \n City boiseID = new City(\"Boise, ID\");\n connect(boiseID, butteMT, 393);\n connect(boiseID, saltLakeCityUT, 301);\n \n City portlandOR = new City(\"Portland, OR\");\n connect(portlandOR, sacramentoCA, 538);\n connect(portlandOR, boiseID, 407);\n \n City seattleWA = new City(\"Seattle, WA\");\n connect(seattleWA, portlandOR, 175);\n connect(seattleWA, butteMT, 544);\n connect(seattleWA, boiseID, 472);\n \n //change this return city to start wherever you want\n return newYorkNY;\n }", "@Override\r\n\tpublic void placeCity(VertexLocation vertLoc) {\n\t\t\r\n\t}", "public void init(){\r\n\t\tbuild(0);\r\n\t\taddFestiveCity(1);\r\n\t}", "public void newTown(Player player, String name, String mayorName) {\n\t\tTownyUniverse universe = plugin.getTownyUniverse();\n\t\ttry {\n\t\t\tif (universe.isWarTime())\n\t\t\t\tthrow new TownyException(\"You cannot do this when the world is at war.\");\n\t\t\t\n\t\t\tif (TownySettings.isTownCreationAdminOnly() && !plugin.isTownyAdmin(player) && !plugin.hasPermission(player, \"towny.town.new\"))\n\t\t\t\tthrow new TownyException(TownySettings.getNotPermToNewTownLine());\n\t\t\t\n\t\t\tif (TownySettings.hasTownLimit() && universe.getTowns().size() >= TownySettings.getTownLimit())\n\t\t\t\tthrow new TownyException(\"The universe cannot hold any more towns.\");\n\t\t\t\n\t\t\tResident resident = universe.getResident(mayorName);\n\t\t\tif (resident.hasTown())\n\t\t\t\tthrow new TownyException(resident.getName() + \" already belongs to a town.\");\n\n\t\t\tTownyWorld world = universe.getWorld(player.getWorld().getName());\n\t\t\tCoord key = Coord.parseCoord(player);\n\t\t\tif (world.hasTownBlock(key))\n\t\t\t\tthrow new TownyException(\"This area (\" + key + \") already belongs to someone.\");\n\n\t\t\tif (TownySettings.isUsingIConomy() && !resident.pay(TownySettings.getNewTownPrice()))\n\t\t\t\tthrow new TownyException(\"You can't afford to settle a new town here.\");\n\n\t\t\tnewTown(universe, world, name, resident, key, player.getLocation());\t\t\t\n\t\t\tuniverse.sendGlobalMessage(TownySettings.getNewTownMsg(player.getName(), name));\n\t\t} catch (TownyException x) {\n\t\t\tplugin.sendErrorMsg(player, x.getError());\n\t\t\t// TODO: delete town data that might have been done\n\t\t} catch (IConomyException x) {\n\t\t\tplugin.sendErrorMsg(player, x.getError());\n\t\t}\n\t}", "@Override\n public void run() {\n try {\n preparePlacedBoard();\n } catch (AllShipsPlacedSuccesfully ex) {\n placedBoard.setAsTargetBoard();\n }\n }", "String askForCity();", "private void initializeWeatherData() {\n Weather location = new Weather(getActivity());\n\n // Make sure the user has put in a location.\n if (location.getName() != null) {\n // Fetch the current forecast, which updates current conditions and weekly forecast.\n GetWeather.getWeatherData(location.getLatitudeLongitude(), adapter, getString(R.string.dark_sky_api), this);\n\n // Set the text on the location label.\n TextView locationLabel = (TextView) getView().findViewById(R.id.text_location_name);\n locationLabel.setText(location.getName());\n\n // If they haven't, ask them to put in a location.\n } else {\n ManualEntry addCityDialogFragment = new ManualEntry().newInstance();\n\n if (!addCityDialogFragment.isActive()) {\n addCityDialogFragment.show(getFragmentManager(), \"fragment_add_city\");\n }\n }\n\n/**\n * In the future, if we want to change their location, can enter another address.\n */\n// ImageButton imageButton = (ImageButton) getView().findViewById(R.id.imageButton);\n// imageButton.setOnClickListener(new View.OnClickListener() {\n// @Override\n// public void onClick(View v) {\n// ManualEntry addCityDialogFragment = new ManualEntry().newInstance();\n// if (!addCityDialogFragment.isActive()) {\n// addCityDialogFragment.show(getFragmentManager(), \"fragment_add_city\");\n// }\n// }\n// });\n }", "private void assignCapitals() {\n City bestCity = null;\n int mostLandTilesSurrounding = 0;\n int landTilesSurrounding = 0;\n int minRow = 0;\n int maxRow = 0;\n int minColumn = 0;\n int maxColumn = 0;\n if (numPlayers == 2) {\n for (int i = 0; i < 2; i++) {\n mostLandTilesSurrounding = 0;\n if (i == 0) {\n minRow = 0;\n maxRow = MAP_LENGTH-1;\n minColumn = 0;\n maxColumn = MAP_LENGTH/2;\n } else if (i == 1) {\n minRow = 0;\n maxRow = MAP_LENGTH-1;\n minColumn = MAP_LENGTH/2;;\n maxColumn = MAP_LENGTH-1;\n }\n for (int r = minRow; r < maxRow; r++) {\n for (int c = minColumn; c < maxColumn; c++) {\n if (tileMap[r][c].getCity() != null) {\n landTilesSurrounding = surroundingLandCheckCity(tileMap[r][c].getCity());\n if (landTilesSurrounding > mostLandTilesSurrounding) {\n mostLandTilesSurrounding = landTilesSurrounding;\n bestCity = tileMap[r][c].getCity();\n }\n }\n }\n }\n tileMap[bestCity.getRow()][bestCity.getCol()].getCity().setTribe(i);\n tileMap[bestCity.getRow()][bestCity.getCol()].getCity().setCapital(true);\n capitalCities[numCapitalCities] = tileMap[bestCity.getRow()][bestCity.getCol()].getCity();\n numCapitalCities++;\n }\n } else if (numPlayers == 3) {\n\n for (int i = 0; i < 3; i++) {\n mostLandTilesSurrounding = 0;\n if (i == 0) {\n minRow = 0;\n maxRow = MAP_LENGTH / 2;\n minColumn = 0;\n maxColumn = MAP_LENGTH / 2;\n } else if (i == 1) {\n minRow = 0;\n maxRow = MAP_LENGTH / 2;\n minColumn = MAP_LENGTH / 2;\n maxColumn = MAP_LENGTH - 1;\n } else if (i == 2) {\n minRow = MAP_LENGTH / 2;\n maxRow = MAP_LENGTH - 1;\n minColumn = 0;\n maxColumn = MAP_LENGTH / 2;\n }\n for (int r = minRow; r < maxRow; r++) {\n for (int c = minColumn; c < maxColumn; c++) {\n if (tileMap[r][c].getCity() != null) {\n landTilesSurrounding = surroundingLandCheckCity(tileMap[r][c].getCity());\n if (landTilesSurrounding > mostLandTilesSurrounding) {\n mostLandTilesSurrounding = landTilesSurrounding;\n bestCity = tileMap[r][c].getCity();\n }\n }\n }\n }\n tileMap[bestCity.getRow()][bestCity.getCol()].getCity().setTribe(i);\n tileMap[bestCity.getRow()][bestCity.getCol()].getCity().setCapital(true);\n capitalCities[numCapitalCities] = tileMap[bestCity.getRow()][bestCity.getCol()].getCity();\n numCapitalCities++;\n System.out.println(\"Capital city of player \" + i + \" is at \" + bestCity.getCol() + \", \" + bestCity.getRow()); //For checking capital city determination\n }\n } else if (numPlayers == 4) {\n for (int i = 0; i < 4; i++) {\n mostLandTilesSurrounding = 0;\n if (i == 0) {\n minRow = 0;\n maxRow = MAP_LENGTH/2;\n minColumn = 0;\n maxColumn = MAP_LENGTH/2;\n } else if (i == 1) {\n minRow = 0;\n maxRow = MAP_LENGTH/2;\n minColumn = MAP_LENGTH/2;\n maxColumn = MAP_LENGTH-1;\n } else if (i == 2) {\n minRow = MAP_LENGTH/2;\n maxRow = MAP_LENGTH-1;\n minColumn = 0;\n maxColumn = MAP_LENGTH/2;\n } else if (i == 3) {\n minRow = MAP_LENGTH/2;\n maxRow = MAP_LENGTH-1;\n minColumn = MAP_LENGTH/2;\n maxColumn = MAP_LENGTH-1;\n }\n for (int r = minRow; r < maxRow; r++) {\n for (int c = minColumn; c < maxColumn; c++) {\n if (tileMap[r][c].getCity() != null) {\n landTilesSurrounding = surroundingLandCheckCity(tileMap[r][c].getCity());\n if (landTilesSurrounding > mostLandTilesSurrounding) {\n mostLandTilesSurrounding = landTilesSurrounding;\n bestCity = tileMap[r][c].getCity();\n }\n }\n }\n }\n tileMap[bestCity.getRow()][bestCity.getCol()].getCity().setTribe(i);\n tileMap[bestCity.getRow()][bestCity.getCol()].getCity().setCapital(true);\n capitalCities[numCapitalCities] = tileMap[bestCity.getRow()][bestCity.getCol()].getCity();\n numCapitalCities++;\n }\n }\n }", "private void onChangeBanner() {\n double latitude = 0.0, longitude = 0.0;\n if (mGpsTracker != null) {\n latitude = mGpsTracker.getLatitude();\n longitude = mGpsTracker.getLongitude();\n Log.e(\"Error on Valid City\", \"\" + latitude);\n }\n\n if (Utility.isConnectingToInternet(getActivity())) {\n try {\n Map<String, String> param = new HashMap<>(3);\n param.put(\"city\", AppConstants.getCityByLocation(getActivity(), latitude, longitude));\n Log.e(\"Valid City\", \"\" + AppConstants.getCityByLocation(getActivity(), latitude, longitude));\n param.put(\"size\", getResources().getString(R.string.device_reso));\n RequestHandler.getInstance().stringRequestVolley(getActivity(), AppConstants.getBaseUrl(SharedPref.getInstance().getBooleanValue(getActivity(), isStaging)) + validCity, param, this, 5);\n\n } catch (Exception e) {\n e.printStackTrace();\n Log.e(\"Error on Valid City\", \"\" + e.toString());\n }\n\n } else {\n Utility.showInternetError(getActivity());\n }\n }", "public boolean buildResearchStation(City city){\n \treturn model.addStation(city);\n }", "private void build() {\n resetUpdate();\n\n gameMessage.setSpace1(clientMessage.getSpace1());\n gameMessage.setLevel(clientMessage.getLevelToBuild());\n gameMessage.notify(gameMessage);\n\n if ( liteGame.getCurrWorker() == null ){\n removePlayerFromTheGame();\n }\n }", "public void placeCity(int playerID, VertexLocation loc) {\n\n\t\tverticies.get(loc.getNormalizedLocation()).setPiece(new Piece(PieceType.CITY, null, null, playerID));\n\t}", "public boolean affordCity() {\n \t\treturn (FREE_BUILD || cities < MAX_CITIES\n \t\t\t\t&& getResources(Type.GRAIN) >= 2 && getResources(Type.ORE) >= 3);\n \t}", "@Override\r\n\tpublic void buildRoad() {\n\t\t\r\n\t}", "public void newGame() {\n // this.dungeonGenerator = new TowerDungeonGenerator();\n this.dungeonGenerator = cfg.getGenerator();\n\n Dungeon d = dungeonGenerator.generateDungeon(cfg.getDepth());\n Room[] rooms = d.getRooms();\n\n String playername = JOptionPane.showInputDialog(null, \"What's your name ?\");\n if (playername == null) playername = \"anon\";\n System.out.println(playername);\n\n this.player = new Player(playername, rooms[0], 0, 0);\n player.getCurrentCell().setVisible(true);\n rooms[0].getCell(0, 0).setEntity(player);\n\n frame.showGame();\n frame.refresh(player.getCurrentRoom().toString());\n frame.setHUD(player.getGold(), player.getStrength(), player.getCurrentRoom().getLevel());\n }", "pb4server.MakeCityAskReq getMakeCityAskReq();", "@Override\n\tpublic void update(City city) {\n\t\t\n\t}", "private void buildWorld() {\r\n\t\tremoveAll();\r\n\t\tintro = null;\r\n\t\tfacingEast = true;\r\n\t\t\r\n\t\taddLevels();\r\n\t\taddCharacters();\r\n\t\taddLifeDisplay();\r\n\t}", "public boolean build(Vertex vertex, int type) {\n \t\tif (vertex == null || !canBuild(vertex, type))\n \t\t\treturn false;\n \n \t\tboolean setup = board.isSetupPhase();\n \n \t\t// check resources based on type we want to build\n \t\tif (type == Vertex.TOWN) {\n \t\t\tif (!setup && !affordTown())\n \t\t\t\treturn false;\n \t\t} else if (type == Vertex.CITY) {\n \t\t\tif (!setup && !affordCity())\n \t\t\t\treturn false;\n \t\t} else {\n \t\t\t// invalid type\n \t\t\treturn false;\n \t\t}\n \n \t\tif (!vertex.build(this, type, setup))\n \t\t\treturn false;\n \n \t\t// deduct resources based on type\n \t\tif (vertex.getBuilding() == Vertex.TOWN) {\n \t\t\tif (!setup) {\n \t\t\t\tuseResources(Type.BRICK, 1);\n \t\t\t\tuseResources(Type.LUMBER, 1);\n \t\t\t\tuseResources(Type.GRAIN, 1);\n \t\t\t\tuseResources(Type.WOOL, 1);\n \t\t\t}\n \t\t\ttowns += 1;\n \t\t\tsettlements.add(vertex);\n \t\t\tboard.checkLongestRoad();\n \t\t} else {\n \t\t\tif (!setup) {\n \t\t\t\tuseResources(Type.GRAIN, 2);\n \t\t\t\tuseResources(Type.ORE, 3);\n \t\t\t}\n \t\t\ttowns -= 1;\n \t\t\tcities += 1;\n \t\t}\n \n \t\t// collect resources for second town during setup\n \t\tif (board.isSetupPhase2()) {\n \t\t\tfor (int i = 0; i < 3; i++) {\n \t\t\t\tHexagon hexagon = vertex.getHexagon(i);\n \t\t\t\tif (hexagon != null && hexagon.getType() != Type.DESERT)\n \t\t\t\t\taddResources(hexagon.getType(), 1);\n \t\t\t}\n \t\t}\n \n \t\tlastTown = vertex;\n \n \t\tappendAction(type == Vertex.TOWN ? R.string.player_town\n \t\t\t\t: R.string.player_city);\n \n \t\treturn true;\n \t}", "public void findCities() {\r\n\t\tpolygonMap.setCurrentPlayerID(client.getSettler().getID());\r\n\t\tint counter = 0;\r\n\t\tfor (int i = 0; i < island.getNodes().length; i++) {\r\n\t\t\tif (island.getNodes()[i].getBuilding() == Constants.SETTLEMENT\r\n\t\t\t\t\t&& island.getNodes()[i].getOwnerID() == client.getSettler()\r\n\t\t\t\t\t\t\t.getID()) {\r\n\t\t\t\tpolygonMap.setCityNodes(counter, i);\r\n\t\t\t\tcounter++;\r\n\t\t\t} else {\r\n\t\t\t\tpolygonMap.setCityNodes(counter, -1);\r\n\t\t\t\tcounter++;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public String buildCity(BuildCity buildCity) throws Exception {\n\t\tString url = server_url + \"/moves/buildCity\";\n\t\tURL obj = new URL(url);\n\t\tHttpURLConnection con = (HttpURLConnection) obj.openConnection();\n\n\t\t//add request header\n\t\tcon.setRequestMethod(\"POST\");\n\t\tcon.setRequestProperty(\"User-Agent\", \"Mozilla/5.0\");\n\t\tcon.setRequestProperty(\"Accept-Language\", \"en-US,en;q=0.5\");\n\t\tcon.setRequestProperty(\"Cookie\", usercookie + \"; \" + gamecookie);\n\t\t\n\t\tJsonObject info = new JsonObject();\n\t\tinfo.addProperty(\"type\",\"buildCity\");\n\t\tinfo.addProperty(\"playerIndex\", buildCity.playerIndex);\n\t\t\n\t\tJsonObject loc = new JsonObject();\n\t\tloc.addProperty(\"x\", buildCity.vertexLocation.getHexLoc().getX());\n\t\tloc.addProperty(\"y\", buildCity.vertexLocation.getHexLoc().getY());\n\t\tloc.addProperty(\"direction\", directions.get(buildCity.vertexLocation.getDir().name()));\n\t\tinfo.add(\"vertexLocation\", loc);\n\t\t\n\t\t// Send post request\n\t\tcon.setDoOutput(true);\n\t\tDataOutputStream wr = new DataOutputStream(con.getOutputStream());\n\t\twr.writeBytes(info.toString());\n\t\twr.flush();\n\t\twr.close();\n\n\t\tint responseCode = con.getResponseCode();\n\t\t//System.out.println(\"\\nSending 'POST' request to URL : \" + url);\n\t\t//System.out.println(\"Post parameters : \" + info.toString());\n\t\t//System.out.println(\"Response Code : \" + responseCode);\n\n\t\tif (responseCode == 400) {\n\t\t\tthrow new Exception();\n\t\t}\n\t\tBufferedReader in = new BufferedReader(\n\t\t new InputStreamReader(con.getInputStream()));\n\t\tString inputLine;\n\t\tStringBuffer response = new StringBuffer();\n\n\t\twhile ((inputLine = in.readLine()) != null) {\n\t\t\tresponse.append(inputLine);\n\t\t}\n\t\tin.close();\n\t\t\n\t\t//print result\n\t\t////System.out.println(response.toString());\n\t\treturn response.toString();\n\t}", "public void PlaceRandomBoard(){\r\n\r\n\t\tString whichShip;\r\n\t\tString coordinate;\r\n\t\t\r\n\t\t\t// Display the random board and the random board menu \r\n\t\t// DISPLAY BOARDS!!!!!\r\n\t\tint whichInput=0;\r\n\t\tShip temp = new Ship();\r\n\t\tRandom generator = new Random();\r\n\t\tint randomIndex = generator.nextInt();\r\n\t\twhile (!this.myBoard.carrier.placed || !this.myBoard.battleship.placed\r\n\t\t\t\t|| !this.myBoard.cruiser.placed || !this.myBoard.submarine.placed\r\n\t\t\t\t|| !this.myBoard.patrolboat.placed) {\r\n\r\n\t\t\twhichInput++;\r\n\r\n\t\t\twhichShip = String.valueOf(whichInput);\r\n\t\t\t\r\n\t\t\tint direction=0;\r\n\r\n\t\t\tboolean placed = false;\r\n\t\t\twhile (!placed) {\r\n\t\t\t\trandomIndex = generator.nextInt(10);\r\n\t\t\t\tcoordinate = this.indexToLetter(randomIndex);\r\n\t\t\t\tcoordinate += String.valueOf(generator.nextInt(10)+1);\r\n\t\t\t\tdirection = generator.nextInt(4) + 1;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tswitch (Integer.parseInt(whichShip)) {\r\n\t\t\t\tcase 1:\r\n\t\t\t\t\ttemp = new Carrier();\r\n\t\t\t\t\ttemp.name=\"Carrier\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 2:\r\n\t\t\t\t\ttemp = new Battleship();\r\n\t\t\t\t\ttemp.name=\"Battleship\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 3:\r\n\t\t\t\t\ttemp = new Cruiser();\r\n\t\t\t\t\ttemp.name=\"Cruiser\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 4:\r\n\t\t\t\t\ttemp = new Submarine();\r\n\t\t\t\t\ttemp.name=\"Submarine\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 5:\r\n\t\t\t\t\ttemp = new PatrolBoat();\r\n\t\t\t\t\ttemp.name=\"Patrol Boat\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} \r\n\t\t\t\t\r\n\t\t\t\tplaced = this.validateShipPlacement(temp, coordinate, direction);\r\n\r\n\t\t\t\tif (placed) {\r\n\t//\t\t\t\tSystem.out.println(\"Success\");\r\n\t\t\t\t\tthis.placeShip(temp, coordinate, direction);\r\n\t\t\t\t\t\r\n\t\t\t\t} else {\r\n\t//\t\t\t\tdisplay.scroll(\"Invalid coordinate, please enter another\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "public void getCityResult() {\n String cityNameStr = TextUtils.isEmpty(cityName) ? \"Halifax\" : cityName;\n final String url = \"http://api.openweathermap.org/data/2.5/weather?q=\" + cityNameStr + \"&appid=\" + API_KEY + \"&units=\" + CELSIUS_UNITS;\n //build the request\n JsonObjectRequest request = new JsonObjectRequest(\n Request.Method.GET, url, null, new Response.Listener<JSONObject>() {\n\n @Override\n public void onResponse(JSONObject response) {\n\n try {\n JSONArray weather = response.getJSONArray(\"weather\");\n JSONObject main = response.getJSONObject(\"main\");\n JSONObject cloudsJSON = response.getJSONObject(\"clouds\");\n\n //Set values on layout\n setCityNameOnLayout(response);\n setWeather(weather);\n setTemperature(main);\n setMinMaxTemperature(main);\n setHumidity(main);\n setClouds(cloudsJSON);\n setWeatherIcon((weather.getJSONObject(0)).get(\"icon\").toString());\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n error.printStackTrace();\n\n Toast.makeText(getApplicationContext(), \"Please, introduce an existing city\", Toast.LENGTH_SHORT).show();\n }\n }\n );\n RequestQueueSingleton.getInstance(getApplicationContext()).addToRequestQueue(request);\n }", "public static void main(String[] args) {\n City city = new City(60, 200);\n TourManager.addCity(city);\n City city2 = new City(180, 200);\n TourManager.addCity(city2);\n City city3 = new City(80, 180);\n TourManager.addCity(city3);\n City city4 = new City(140, 180);\n TourManager.addCity(city4);\n City city5 = new City(20, 160);\n TourManager.addCity(city5);\n City city6 = new City(100, 160);\n TourManager.addCity(city6);\n City city7 = new City(200, 160);\n TourManager.addCity(city7);\n City city8 = new City(140, 140);\n TourManager.addCity(city8);\n City city9 = new City(40, 120);\n TourManager.addCity(city9);\n City city10 = new City(100, 120);\n TourManager.addCity(city10);\n City city11 = new City(180, 100);\n TourManager.addCity(city11);\n City city12 = new City(60, 80);\n TourManager.addCity(city12);\n City city13 = new City(120, 80);\n TourManager.addCity(city13);\n City city14 = new City(180, 60);\n TourManager.addCity(city14);\n City city15 = new City(20, 40);\n TourManager.addCity(city15);\n City city16 = new City(100, 40);\n TourManager.addCity(city16);\n City city17 = new City(200, 40);\n TourManager.addCity(city17);\n City city18 = new City(20, 20);\n TourManager.addCity(city18);\n City city19 = new City(60, 20);\n TourManager.addCity(city19);\n City city20 = new City(160, 20);\n TourManager.addCity(city20);\n\n // Initialize population\n Population pop = new Population(50, true);\n System.out.println(\"Initial distance: \" + pop.getFittest().getDistance());\n\n // Evolve population for 100 generations\n pop = GA.evolvePopulation(pop);\n for (int i = 0; i < 100; i++) {\n pop = GA.evolvePopulation(pop);\n }\n\n // Print final results\n System.out.println(\"Finished\");\n System.out.println(\"Final distance: \" + pop.getFittest().getDistance());\n System.out.println(\"Solution:\");\n System.out.println(pop.getFittest());\n }", "@Override public void onCityChanged() {\n\t\tif (mode == ChangeCurrentCity) {\n\t\t\tint i;\n\t\t\tCity findme = parent.session.state.currentCity;\n\t\t\tfor (i=0; i<rawList.length; i++) {\n\t\t\t\tif (rawList[i] == findme) {\n\t\t\t\t\tcitySpinner.setSelection(i);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void updateLocationUI() {\r\n if (mCurrentLocation != null) {\r\n CityName = mCurrentLocation.getLatitude()+ mCurrentLocation.getLongitude();\r\n }\r\n }", "public void createChallenger() {\n\n Random random = new Random();\n if(currentTurn.getActivePlayers().size() != 1) {\n currentTurn.setCurrentPlayer(currentTurn.getActivePlayers().get(random.nextInt(currentTurn.getActivePlayers().size() - 1)));\n } else {\n currentTurn.setCurrentPlayer(currentTurn.getActivePlayers().get(0));\n }\n int i = onlinePlayers.indexOf(currentTurn.getCurrentPlayer());\n stateList.set(i, new Initialized(getCurrentTurn().getCurrentPlayer(), this));\n\n }", "public void setStartConditions() {\r\n\t\tplayer1.relocate(0, 0);\r\n\t\tgamemap.setPlayerLocation(1, 1);\r\n\t\tgamemap.setEnemyLocation(20, 10);\r\n\t\tenemy1.relocate(19*46, 9*85);\r\n\t\tportal1.relocate(9*46, 9*85);\r\n\t\tportal2.relocate(9*46, 0*85);\r\n\t\tspikes1.relocate(5*46,0*85);\r\n\t\tspikes2.relocate(5*46,1*85);\r\n\t\tspikes3.relocate(5*46,2*85);\r\n\t\tspikes4.relocate(5*46,7*85);\r\n\t\tspikes5.relocate(5*46,8*85);\r\n\t\tspikes6.relocate(5*46,9*85);\r\n\t\tspikes7.relocate(10*46,2*85);\r\n\t\tspikes8.relocate(10*46,3*85);\r\n\t\tspikes9.relocate(10*46,4*85);\r\n\t\tspikes10.relocate(10*46,5*85);\r\n\t\tspikes11.relocate(10*46,6*85);\r\n\t\tspikes12.relocate(10*46,7*85);\r\n\t\tspikes13.relocate(15*46,0*85);\r\n\t\tspikes14.relocate(15*46,1*85);\r\n\t\tspikes15.relocate(15*46,2*85);\r\n\t\tspikes16.relocate(15*46,7*85);\r\n\t\tspikes16.relocate(15*46,8*85);\r\n\t\tspikes17.relocate(15*46,9*85);\r\n\t\tRandom randomObj = new Random();\r\n\t\tint randomX = randomObj.nextInt(20);\r\n\t\tint randomY = randomObj.nextInt(10);\r\n\t\tcoins1.relocate(randomX*46, randomY*85);\r\n\t\tgamemap.setLootLocation(randomX + 1, randomY + 1);\r\n\t\t//coins1.relocate(10*46,5*85);\r\n\t\t//gamemap.setLootLocation(11, 6);\r\n\t}", "public void onLobby(){\n\t\tif(Bukkit.getPluginManager().isPluginEnabled(\"MVdWPlaceholderAPI\")){\n\t\t\tPlaceholderAPI.registerPlaceholder(SimplePlugin.getPlugin(ArenaPlugin.class), \"build_battle_players\",\n\t\t\t\t\tplaceholderReplaceEvent -> {\n\t\t\t\t\t\tint players = getArena().getPlayers(ArenaJoinMode.PLAYING).size();\n\t\t\t\t\t\treturn Integer.toString(players);\n\t\t\t\t\t});\n\n\t\t\tPlaceholderAPI.registerPlaceholder(SimplePlugin.getPlugin(ArenaPlugin.class), \"build_battle_time\",\n\t\t\t\t\tplaceholderReplaceEvent -> Common.plural(arena.getStartCountdown().getTimeLeft(), \"second\"));\n\n\t\t}\n\t}", "public void populate() { \n \n // make some grounds\n ground1 = new Body(world, PolygonShape.makeBox(100, 5), Body.Type.STATIC);\n ground1.setPosition(new Vec2(-380, -200));\n \n Body ground2 = new Body(world, PolygonShape.makeBox(100, 5), Body.Type.STATIC);\n ground2.setPosition(new Vec2(-0, -200));\n\n Body ground3 = new Body(world, PolygonShape.makeBox(100, 5), Body.Type.STATIC);\n ground3.setPosition(new Vec2(300, -100));\n \n // make a moving platform \n Body movingPlatform = new SlidingPlatform(world, PolygonShape.makeBox(100, 5), new Vec2(130, 0), 2);\n movingPlatform.setPosition(new Vec2(-260, -150));\n \n // make some bottles\n Bottle bottle1 = new Bottle(game);\n bottle1.putOn(ground1);\n bottle1.setName(\"bottle1\");\n \n Bottle bottle2 = new Bottle(game);\n bottle2.putOn(ground2);\n bottle2.setName(\"bottle2\");\n \n Bottle bottle3 = new Bottle(game);\n bottle3.putOn(ground3);\n bottle3.setName(\"bottle3\");\n \n // show dialog with information about level\n JOptionPane.showMessageDialog(frame, \"Press N or M to throw bottles to kill Boxies.\", \"Level instructions:\", JOptionPane.PLAIN_MESSAGE);\n \n // make some boxies\n Boxy boxy1 = new Boxy(game);\n boxy1.setName(\"boxy1\");\n Vec2 vec1 = new Vec2(100, 0);\n boxy1.move(vec1);\n\n Boxy boxy2 = new Boxy(game);\n boxy2.setName(\"boxy2\");\n Vec2 vec2 = new Vec2(-100, 200);\n boxy2.move(vec2);\n\n Boxy boxy3 = new Boxy(game);\n boxy3.setName(\"boxy3\");\n Vec2 vec3 = new Vec2(-400, 200);\n boxy3.move(vec3);\n \n }", "@Override\n\tpublic void build() {\n\t\tif(this.getContainer().isEmpty()){\n\t\t\tthis.addBuilding(new Building(BuildingType.CABSTAND, 150));\n\t\t\tMonopolyTheGame.getInstance().getActivePlayer().decBalance(150);\n\t\t\tsetEnabler(false);\n\t\t\t//currentSquare.setRent(currentSquare.getRent()*2);\n\t\t}else {\n\t\t\tSystem.out.println(\"You cannot bould multiple cab stands on a cab company\");\n\t\t}\n\t\t\n\t}", "@Override\n\tpublic void execute() {\n\t\t\n\t\tif (GamesHandler.test) {\n\t\t\tserverModel = ServerFacadeTest.getSingleton().getGameModel(gameID);\n\t\t} else {\n\t\t\tserverModel = ServerFacade.getSingleton().getGameModel(gameID);\n\t\t}\n\t\t\n\t\tPlayer player = serverModel.getPlayers().get(sender);\n\t\tDevCardList playerOldDevCards = player.getOldDevCards();\n\t\t\n\t\tplayerOldDevCards.setRoadBuilding(playerOldDevCards.getRoadBuilding() - 1);\n\t\t\n\t\tserverModel.getMap().addRoad(new Road(sender, spot1));\n\t\tserverModel.getMap().addRoad(new Road(sender, spot2));\n\t\t\n\t\tplayer.setRoads(player.getRoads() - 2);\n\t\t\n\t\tplayer.setPlayedDevCard(true);\n\t\t\n\t\tMessageLine line = new MessageLine();\n\t\tString username = player.getName();\n\t\tif(username.toLowerCase().equals(\"ife\") || username.toLowerCase().equals(\"ogeorge\")){\n\t\t\tline.setMessage(\"Ife built a couple of roads to try to catch up with Paul, but Daniel always wins anyway\");\n\t\t}\n\t\telse{\n\t\t\tline.setMessage(username + \" built a couple roads with a road building development card\");\n\t\t}\n//\t\tline.setMessage(username + \" built a couple roads with a road building development card\");\n\t\tline.setSource(username);\n\t\tserverModel.getLog().addLine(line);\n\t}", "@Override\r\n public void BuildArena() {\r\n competition.setArena(FactoryArena.buildDefaultArena());\r\n }", "@Override\r\n\tpublic void playRoadBuildingCard() {\n\t\t\r\n\t}", "private void updateWeatherView(String cityName){\n\t\t\t\n\t\t\tif (cityName.equals(\"--Remove?--\")){\n\t\t\t\t\tint count = 0;\n\t\t\t\t\tJFrame frame = new JFrame();\n\t\t\t\t\tString[] possibilities = new String[app.getMyLocations().length];\n\t\t\t\t\tfor (int i = 0; i < app.getMyLocations().length; i ++){\n\t\t\t\t\t\tlocation loc = app.getMyLocations()[i];\n\t\t\t\t\t\tif (!loc.getName().equals(\"Default\")){\n\t\t\t\t\t\t\tpossibilities[i] = loc.getName() + \", \" + loc.getCountryCode() + \" Lat: \" + loc.getLatitude()\n\t\t\t\t\t\t\t\t\t+ \" Long: \" + loc.getLongitude();\n\t\t\t\t\t\t\tcount ++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tString response = (String) JOptionPane.showInputDialog(frame, \"Pick a location to remove:\", \"Remove Location\", \n\t\t\t\t\t\t\tJOptionPane.QUESTION_MESSAGE, null, Arrays.copyOfRange(possibilities, 0, count), \"Titan\");\n\t\t\t\t\tif (response != null){\n\t\t\t\t\t\tString countryCode = response.substring(response.indexOf(',') + 2, response.indexOf(',') + 5);\n\t\t\t\t\t\tcityName = response.substring(0, response.indexOf(','));\n\t\t\t\t\t\tapp.removeLocation(cityName, countryCode);\n\t\t\t\t\t}\n\t\t\t\t\tlocBar.removeActionListener(Jcombo);\n\t\t\t\t\tpopulateMyLocationsBox();\n\t\t\t\t\t\t\n\t\t\t } else if (cityName.equals(\"--Empty--\")){\n\t\t\t\t\t\t//Do nothing\n\t\t\t} else {\n\t\t\t\t\tlocation update = new location();\n\t\t\t\t\tString countryCode = cityName.substring(cityName.indexOf(',') + 2, cityName.indexOf(',') + 4);\n\t\t\t\t\tcityName = cityName.substring(0, cityName.indexOf(','));\n\t\t\t\t\tfor (int i = 0; i < app.getMyLocations().length; i ++){\n\t\t\t\t\t\tString checkName = app.getMyLocations()[i].getName();\n\t\t\t\t\t\tString checkCode = app.getMyLocations()[i].getCountryCode();\n\t\t\t\t\t\tif (checkName.equals(cityName) && checkCode.equals(countryCode)){\n\t\t\t\t\t\t\tupdate = app.getMyLocations()[i];\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\tapp.setVisibleLocation(update);\n\t\t\t\t\trefreshPanels();\n\t\t\t}\n\t\t}", "void buildCity(VertexLocation vert);", "public void submitAddCity(View v){\n String name = ((EditText)findViewById(R.id.name)).getText().toString();\n String country = ((EditText)findViewById(R.id.country)).getText().toString();\n String population = ((EditText)findViewById(R.id.population)).getText().toString();\n String category = ((EditText)findViewById(R.id.category)).getText().toString();\n TextView results = (TextView) findViewById(R.id.results);\n if( name != null && !name.equals(\"\") &&\n country != null && !country.equals(\"\") &&\n population != null && !population.equals(\"\") &&\n category != null && !category.equals(\"\") ){\n sendAddCity(this, name, country, population, category, results);\n }\n else{\n results.setText(\"Error: All fields required\");\n }\n\n }", "public void newQuest() {\n\t\tList <String> quests;\n\t\tif (activeQuest == null) {\n\t\t\tquests = QuestCfg.getStringList(\"quests.names\");\n\t\t} else {\n\t\t\tquests = activeQuest.getSuccessors();\n\t\t\tif (quests == null) {\n\t\t\t\tquests = QuestCfg.getStringList(\"quests.names\");\n\t\t\t}\n\t\t}\n\t\tbakeInstance.getLogger().info(\"[BAKE] Choosing new quest. Quests available: \" + quests.toString());\n\t\tint questID = (int) Math.round(Math.random()*(quests.size()-1));\n\t\tactiveQuest = new Quest(QuestCfg, quests.get(questID));\n\t}", "public void chooseFortifyGivers(){\n gameState = GameState.FORTIFYGIVER;\n currentTerritoriesOfInterest = Player.getTerritoryStringArray(currentPlayer.getFortifyGivers());\n notifyObservers();\n }", "public void newCandy() {\n\t\tDebugger.print(\"Making new candy\");\n\t\tint x = (Random.nextInt(1, this.SIZE * 2) - 2);\n\t\tint y = (Random.nextInt(1, this.SIZE - 2));\n\n\t\tTile t = new Tile(x, y);\n\t\tboolean foundFreeTile = false;\n\t\twhile (!foundFreeTile) {\n\t\t\tfor (Snake snake : this.snakes) {\n\t\t\t\tif (snake != null) {\n\n\t\t\t\t\tif (snake.find(t)) {\n\t\t\t\t\t\tx = (Random.nextInt(1, this.SIZE * 2) - 1);\n\t\t\t\t\t\ty = (Random.nextInt(1, this.SIZE - 1));\n\t\t\t\t\t\tt.setX(x);\n\t\t\t\t\t\tt.setY(y);\n\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\tfoundFreeTile = true;\n\t\t}\n\t\tif (this.getGui() != null) {\n\t\t\tthis.getGui().print(\"New candy made\");\n\t\t}\n\t\tthis.setCandy(new Candy(x, y));\n\t}", "public void assignPoint(Person person, String cityName) {\n List<Place> zipsForCity;\n\n if (cityName == null) {\n int size = zipCodes.keySet().size();\n cityName = (String) zipCodes.keySet().toArray()[person.randInt(size)];\n }\n zipsForCity = zipCodes.get(cityName);\n\n if (zipsForCity == null) {\n zipsForCity = zipCodes.get(cityName + \" Town\");\n }\n\n Place place;\n if (zipsForCity != null && zipsForCity.size() == 1) {\n place = zipsForCity.get(0);\n } else if (zipsForCity != null) {\n String personZip = (String) person.attributes.get(Person.ZIP);\n if (personZip == null) {\n place = zipsForCity.get(person.randInt(zipsForCity.size()));\n } else {\n place = zipsForCity.stream()\n .filter(c -> personZip.equals(c.postalCode))\n .findFirst()\n .orElse(zipsForCity.get(person.randInt(zipsForCity.size())));\n }\n } else {\n // The place doesn't exist for some reason, pick a random location...\n String key = (String) zipCodes.keySet().toArray()[person.randInt(zipCodes.keySet().size())];\n place = zipCodes.get(key).get(person.randInt(zipCodes.get(key).size()));\n }\n\n if (place != null) {\n // Get the coordinate of the city/town\n Point2D.Double coordinate = new Point2D.Double();\n coordinate.setLocation(place.coordinate);\n // And now perturbate it slightly.\n // Precision within 0.001 degree is more or less a neighborhood or street.\n // Precision within 0.01 is a village or town\n // Precision within 0.1 is a large city\n double dx = person.rand(-0.05, 0.05);\n double dy = person.rand(-0.05, 0.05);\n coordinate.setLocation(coordinate.x + dx, coordinate.y + dy);\n person.attributes.put(Person.COORDINATE, coordinate);\n }\n }", "public static void main(String[] args) { Create and add our cities\n//\n try {\n // read file content from file\n StringBuffer sb= new StringBuffer(\"\");\n\n FileReader reader = new FileReader(\"location.txt\");\n BufferedReader br = new BufferedReader(reader);\n\n String str = null;\n\n while((str = br.readLine()) != null) {\n// sb.append(str+\"/n\");\n String []info = new String[3];\n String cityName;\n int locationX;\n int locationY;\n info = str.split(\" \");\n cityName = info[0];\n locationX = Integer.parseInt(info[1]);\n locationY = Integer.parseInt(info[2]);\n City city = new City(locationX, locationY, cityName);\n TourManager.addCity(city);\n }\n\n br.close();\n reader.close();\n\n\n }\n catch(FileNotFoundException e) {\n e.printStackTrace();\n }\n catch(IOException e) {\n e.printStackTrace();\n }\n\n\n // Set initial temp\n double temp = 1000000;\n\n // Cooling rate\n double coolingRate = 0.00001;\n\n // Initialize intial solution\n Tour currentSolution = new Tour();\n currentSolution.generateIndividual();\n\n System.out.println(\"Initial solution distance: \" + currentSolution.getDistance());\n\n // Set as current best\n Tour best = new Tour(currentSolution.getTour());\n\n // Loop until system has cooled\n while (temp > 1) {\n // Create new neighbour tour\n Tour newSolution = new Tour(currentSolution.getTour());\n\n // Get a random positions in the tour\n int tourPos1 = (int) (newSolution.tourSize() * Math.random());\n int tourPos2 = (int) (newSolution.tourSize() * Math.random());\n\n // Get the cities at selected positions in the tour\n City citySwap1 = newSolution.getCity(tourPos1);\n City citySwap2 = newSolution.getCity(tourPos2);\n\n // Swap them\n newSolution.setCity(tourPos2, citySwap1);\n newSolution.setCity(tourPos1, citySwap2);\n\n // Get energy of solutions\n int currentEnergy = currentSolution.getDistance();\n int neighbourEnergy = newSolution.getDistance();\n\n // Decide if we should accept the neighbour\n if (acceptanceProbability(currentEnergy, neighbourEnergy, temp) > Math.random()) {\n currentSolution = new Tour(newSolution.getTour());\n }\n\n // Keep track of the best solution found\n if (currentSolution.getDistance() < best.getDistance()) {\n best = new Tour(currentSolution.getTour());\n }\n\n // Cool system\n temp *= 1-coolingRate;\n }\n\n System.out.println(\"Final solution distance: \" + best.getDistance());\n System.out.println(\"Tour: \" + best);\n FinalGraph.drawGraph();\n }", "@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n\n if(data == null) {\n return;\n }\n\n String cityName = data.getStringExtra(\"cityName\");\n Log.d(TAG_WEATHER_FRAGMENT_MAIN, \"city = \" + cityName);\n\n new CitySelected(getActivity()).setCity(cityName);\n \n onRestart();\n }", "public void chase(City city) {\n super.move(city, 1);\n }", "private static void defineInitialAttackTarget() {\n\t\tUnit buildingToAttack = MapExploration.getNearestEnemyBuilding();\n\n\t\t// We know some building of CPU that we can attack.\n\t\tif (buildingToAttack != null) {\n\t\t\tchangeNextTargetTo(buildingToAttack);\n\t\t}\n\n\t\t// No building to attack found, safely decide not to attack.\n\t\telse {\n\t\t\tchangeStateTo(STATE_PEACE);\n\t\t}\n\t}", "void toyPlacingfStuff(){\n //nu stiu daca asta ramane\n gettingBackToInitial();\n nearingTheWallBefore();\n parallelToTheWall();\n actualToyPlacing();\n }", "@Override\n \t\tprotected Void doInBackground(Void... params) {\n \t\t\tgetJSONFromUrl(fore_city,fore_country);\n\n \t\t\treturn null;\n \t\t}", "private static void soldierCode() throws GameActionException {\n\t\tRobotInfo[] visibleEnemyArray = rc.senseHostileRobots(rc.getLocation(), 1000000);\n\t\tSignal[] incomingSignals = rc.emptySignalQueue();\n\t\tfor(Signal s:incomingSignals){\n\t\t\tint[] message = s.getMessage();\n\t\t\tif(s.getTeam()==rc.getTeam()){\n\t\t\t\tif(message!=null){\n\t\t\t\t\tif(message[0]%10==0){\n\t\t\t\t\t\tint x = message[1]/100000;\n\t\t\t\t\t\tint y = message[1]%100000;\n\t\t\t\t\t\tcenter= new MapLocation(x,y);\n\t\t\t\t\t\tint r = message[0]/10;\n\t\t\t\t\t\tradius=r;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tint dist = rc.getLocation().distanceSquaredTo(center);\n\t\tif (visibleEnemyArray.length==0) {\n\t\t\tif (goal!=null&&(rc.senseRubble(goal)<100 || rc.senseRobotAtLocation(goal)!=null)) {\n\t\t\t\tgoal = null;\n\t\t\t\trc.setIndicatorString(0, \"done clearing\");\n\t\t\t}\t\n\t\t\tif(goal==null) {\n\t\t\t\tMapLocation[] locs = MapLocation.getAllMapLocationsWithinRadiusSq(rc.getLocation(), 8);\n\t\t\t\tArrayList<MapLocation> inside = new ArrayList<MapLocation>();\n\t\t\t\tfor(MapLocation loc: locs) {\n\t\t\t\t\tif (loc.distanceSquaredTo(center)<=1.5*radius) {\n\t\t\t\t\t\tinside.add(loc);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor(MapLocation l: inside) {\n\t\t\t\t\tif (rc.senseRubble(l)>99 && rc.senseRobotAtLocation(l)==null) {\n\t\t\t\t\t\tgoal = l;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tUtility.tryToMove(goal);\n\t\t\t}\n\t\t\t\n\t\t\tif (dist>radius && dist< 4*radius) { //Explore\n\t\t\t\tMapLocation travel = soldierFind();\n\t\t\t\tUtility.tryToMove(travel);\n\t\t\t}else{ //Move back\n\t\t\t\tMapLocation loc = center.add(center.directionTo(rc.getLocation()), (int)Math.pow(radius, 0.5)+1);\n\t\t\t\tUtility.tryToMove(loc);\n\t\t\t}\n\t\t} else { //Kite\n\t\t\tkite(visibleEnemyArray);\n\t\t}\n\t}", "private void createRooms()//refactored\n {\n currentRoom = RoomCreator.buildCurrentRooms();//new\n }", "private void updateCargoInfo() {\n CargoView cargo = (CargoView) getView().findViewById(R.id.cargo);\n cargo.init(mClient, this);\n for (Unit unit : mColony.getTile().getUnitList()) {\n if (unit.isCarrier()) {\n cargo.setCarrier(unit);\n break;\n }\n }\n }", "public void doMission(Connection connection) {\n final Unit unit = getUnit();\n if (unit.getTile() == null) {\n logger.finest(\"AI pioneer waiting to go to\"\n + getTransportDestination() + \": \" + unit);\n return;\n }\n\n if (!hasTools()) { // Try to equip.\n if (colonyWithTools != null\n && !checkColonyForTools(getAIUnit(), colonyWithTools)) {\n colonyWithTools = null;\n }\n if (colonyWithTools == null) { // Find a new colony.\n colonyWithTools = findColonyWithTools(getAIUnit());\n }\n if (colonyWithTools == null) {\n abandonTileImprovementPlan();\n logger.finest(\"AI pioneer can not find equipment: \" + unit);\n return;\n }\n\n // Go there, equip unit.\n if (travelToTarget(\"AI pioneer\", colonyWithTools.getTile())\n != Unit.MoveType.MOVE) return;\n getAIUnit().equipForRole(Unit.Role.PIONEER, false);\n if (!hasTools()) {\n abandonTileImprovementPlan();\n logger.finest(\"AI pioneer reached \" + colonyWithTools.getName()\n + \" but could not equip: \" + unit);\n return;\n }\n logger.finest(\"AI pioneer reached \" + colonyWithTools.getName()\n + \" and equips: \" + unit);\n colonyWithTools = null;\n }\n\n // Check the plan still makes sense.\n final Player player = unit.getOwner();\n final EuropeanAIPlayer aiPlayer = getEuropeanAIPlayer();\n if (tileImprovementPlan != null\n && !validateTileImprovementPlan(tileImprovementPlan, aiPlayer)) {\n tileImprovementPlan = null;\n }\n if (tileImprovementPlan == null) { // Find a new plan.\n AIUnit aiu = getAIUnit();\n tileImprovementPlan = findTileImprovementPlan(aiu);\n if (tileImprovementPlan == null) {\n logger.finest(\"AI pioneer could not find an improvement: \"\n + unit);\n return;\n }\n tileImprovementPlan.setPioneer(aiu);\n }\n \n // Go to target and take control of the land before proceeding\n // to build.\n Tile target = tileImprovementPlan.getTarget();\n if (travelToTarget(\"AI pioneer\", target) != Unit.MoveType.MOVE) return;\n if (!player.owns(target)) {\n // TODO: Better choice whether to pay or steal.\n // Currently always pay if we can, steal if we can not.\n boolean fail = false;\n int price = player.getLandPrice(target);\n if (price < 0) {\n fail = true;\n } else {\n if (price > 0 && !player.checkGold(price)) {\n price = NetworkConstants.STEAL_LAND;\n }\n if (!AIMessage.askClaimLand(aiPlayer.getConnection(), target,\n null, price)\n || !player.owns(target)) { // Failed to take ownership\n fail = true;\n }\n }\n if (fail) {\n aiPlayer.removeTileImprovementPlan(tileImprovementPlan);\n tileImprovementPlan.dispose();\n tileImprovementPlan = null;\n logger.finest(\"AI pioneer can not claim land at \" + target\n + \": \" + unit);\n return;\n }\n }\n\n if (unit.getState() == UnitState.IMPROVING) {\n unit.setMovesLeft(0);\n logger.finest(\"AI pioneer improving \"\n + tileImprovementPlan.getType() + \": \" + unit);\n } else if (unit.checkSetState(UnitState.IMPROVING)) {\n // Ask to create the TileImprovement\n if (AIMessage.askChangeWorkImprovementType(getAIUnit(),\n tileImprovementPlan.getType())) {\n logger.finest(\"AI pioneer began improvement \"\n + tileImprovementPlan.getType()\n + \" at target \" + target\n + \": \" + unit);\n } else {\n aiPlayer.removeTileImprovementPlan(tileImprovementPlan);\n tileImprovementPlan.dispose();\n tileImprovementPlan = null;\n logger.finest(\"AI pioneer failed to improve \" + target\n + \": \" + unit);\n }\n } else { // Probably just out of moves.\n logger.finest(\"AI pioneer waiting to improve at \" + target.getId()\n + \": \" + unit);\n }\n }", "public void setCity(String city){\n this.city = city;\n }", "@Override\n public void finish() {\n\n super.finish();\n //construction.updateConstructionZones();\n }", "private void loadLocation() {\n\r\n\t\t_stateItems = new ArrayList<DropDownItem>();\r\n\t\t_stateAdapter = new DropDownAdapter(getActivity(), _stateItems);\r\n\t\tspin_state.setAdapter(_stateAdapter);\r\n\r\n\t\t_cityItems = new ArrayList<DropDownItem>();\r\n\t\t_cityAdapter = new DropDownAdapter(getActivity(), _cityItems);\r\n\t\tspin_city.setAdapter(_cityAdapter);\r\n\r\n\t\t_locationItems = new ArrayList<DropDownItem>();\r\n\t\t_locationAdapter = new DropDownAdapter(getActivity(), _locationItems);\r\n\t\tspin_location.setAdapter(_locationAdapter);\r\n\r\n\t\tnew StateAsync().execute(\"\");\r\n\r\n\t}", "private void captureCity(int playerNo, int city)\r\n {\r\n if(playerNo == 1)\r\n {\r\n worldPanel.player2.removeCity(city);\r\n }\r\n\r\n if(playerNo == 2)\r\n {\r\n worldPanel.player1.removeCity(city);\r\n }\r\n }", "private void cs8() {\n\t\t\t\n\t\n\t\t\tif(new Tile(3088,3092,0).matrix(ctx).reachable()){\n\t\t\t\t\n\t\t\t\tif(new Tile(3079,3084,0).distanceTo(ctx.players.local().tile())<7){\n\t\t\t\t\tMethod.interactO(9709, \"Open\", \"Door\");\n\t\t\t\t}else ctx.movement.step(new Tile(3079,3084,0));\n\t\t\t\t\n\t\t\t}else if(new Tile(3090,3092,0).distanceTo(ctx.players.local().tile())<7){\n\t\t\t\tfinal int[] bounds = {140, 108, -84, 144, -64, 136};\n\t\t\t\tGameObject gate = ctx.objects.select().id(GATEBYFISH).each(Interactive.doSetBounds(bounds)).select(Interactive.areInViewport()).nearest().poll();\n\t\t\t\tgate.interact(\"Open\",\"\");\n\t\t\t}else ctx.movement.step(new Tile(3090,3092,0));\n\t\t\t\n\t\t\t\n\t\t}", "public void reproduce() {\n if (getSelfCount() >= getMinMates() && getLocation()\n .getEmptyCount() >= getMinEmpty()\n && getFoodCount() >= getMinFood() && dayCountDown != 0) {\n int index = RandomGenerator.nextNumber(getLocation()\n .getEmptyCount());\n Cell selectedCell = getLocation().getEmptyArray().get(index);\n createLife(selectedCell).init();\n \n }\n \n }", "public void toPlaceWorker() {\n notifyTimeToPlaceWorker(getCurrentTurn().getCurrentPlayer().getNickname());\n }", "public void grab() {\r\n\t\tString item = mapContents[currentPlayer.getCurrentRoom()];\r\n\t\tif (item == null) return;\r\n\t\t\r\n\t\t// If artifact, make sure has room or backpack\r\n\t\tif (item.startsWith(\"Artifact\")) {\r\n\t\t\tif (currentPlayer.count(\"Artifact\") <= currentPlayer.count(\"Backpack\")) {\r\n\t\t\t\tcurrentPlayer.pickup(item);\r\n\t\t\t\tattackLevel++;\r\n\t\t\t\taddEvent(\"``\"+currentName+\"`` picked up an Artifact **\"+item.substring(8)+\"** :star:\",true);\r\n\t\t\t\taddHistory(\"ARTIFACT \"+item.substring(8));\r\n\t\t\t\tmapContents[currentPlayer.getCurrentRoom()] = null;\r\n\t\t\t}\r\n\t\t// If monkey idol, make sure didn't already pick one up this turn\r\n\t\t} else if (item.startsWith(\"MonkeyIdol\") && !currentPlayer.getAlreadyPickedUpMonkeyIdol()) {\r\n\t\t\tcurrentPlayer.pickup(item);\r\n\t\t\tcurrentPlayer.setAlreadyPickedUpMonkeyIdol(true);\r\n\t\t\tint num = Integer.parseInt(item.substring(10));\r\n\t\t\tnum--;\r\n\t\t\tif (num == 0) {\r\n\t\t\t\tmapContents[currentPlayer.getCurrentRoom()] = null;\r\n\t\t\t} else {\r\n\t\t\t\tmapContents[currentPlayer.getCurrentRoom()] = \"MonkeyIdol\"+num;\r\n\t\t\t}\r\n\t\t\taddEvent(\"``\"+currentName+\"`` picked up a Monkey Idol **5** :star:\",true);\r\n\t\t\taddHistory(\"IDOL \"+item.substring(8));\r\n\t\t}\r\n\t\tupdateReactionsInfo();\r\n\t\tupdatePlayArea(currentPlayer, false);\r\n\t\tupdateMarketAndTreasures(false);\r\n\t\ttry {\r\n\t\t\tupdateBoard();\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}\r\n\t}", "public void startGame() {\n\t\tinitChips();\n\t\tassignAndStartInitialProjects();\n\t}", "private static void setupLocations() {\n\t\tcatanWorld = Bukkit.createWorld(new WorldCreator(\"catan\"));\n\t\tspawnWorld = Bukkit.createWorld(new WorldCreator(\"world\"));\n\t\tgameLobby = new Location(catanWorld, -84, 239, -647);\n\t\tgameSpawn = new Location(catanWorld, -83, 192, -643);\n\t\thubSpawn = new Location(spawnWorld, 8, 20, 8);\n\t\twaitingRoom = new Location(catanWorld, -159, 160, -344);\n\t}", "public City(String name) {\n\t\tthis.name = name;\n\t\tthis.inhabitants = new ArrayList<Inhabitant>();\n\t\tthis.postbox = new ArrayList<Letter<?>>();\n\t\tSystem.out.println(\"Creating \" + this.name + \" city\");\n\t}", "public static boolean isFinishedCity()\r\n {\r\n try\r\n {\r\n Building b = astApp.getBuildings().get( astApp.getBuildings().size() - 1 );\r\n \r\n if( b.getBuilding().getXLocation() + b.getBuilding().getWidth() >= 700 )\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n }\r\n catch( ArrayIndexOutOfBoundsException e )\r\n {\r\n return false;\r\n }\r\n }", "public void prepareGame() {\n setInitialPosition();\n\n //Check NickName\n boolean nickNameEstablished = checkNickName();\n if (!nickNameEstablished) {\n Intent intent = new Intent(this, NickNameActivity.class);\n startActivityForResult(intent, NICKNAME_ACTIVITY_REQUEST_CODE);\n } else {\n setDynamicBackground();\n }\n }", "public City() {\r\n\t\tthis.x = (int) (Math.random() * 200);\r\n\t\tthis.y = (int) (Math.random() * 200);\r\n\t}", "@Override\n public void execute() {\n if (Players.getLocal().getAnimation() == -1) {\n // Teleport to Edgeville if we aren't there, walk to the bank if we are.\n if (!Constants.TO_BANK_AREA.contains(Players.getLocal())) {\n Lodestone.EDGEVILLE.teleport();\n } else {\n if (!Constants.BANK_AREA.contains(Players.getLocal())) {\n Walking.newTilePath(Constants.TO_BANK).traverse();\n Task.sleep(1000);\n }\n }\n }\n }", "public final void go() {\n this.getView().showCountries(this.getModel().getCountries());\n CountryFindChoice choice;\n do {\n choice = this.getView().askUserFindChoice();\n } while (choice == CountryFindChoice.error);\n String codeOrName = this.getView().askCodeOrName(choice);\n Country country = null;\n switch (choice) {\n case byCode:\n country = this.getModel().getCountryByCode(codeOrName);\n break;\n case byName:\n country = this.getModel().getCountryByName(codeOrName);\n break;\n }\n if(country != null) {\n this.getView().printMessage(country.getHelloWorld().getMessage());\n }\n this.getModel().close();\n }", "City(int 1_x_coordinate, int 1_y_coordinate, String name_coordinate){\n x_coordinate = 1_x_coordinate;\n y_coordinate = 1_y_coordinate;\n city_name = name_coordinate;\n }", "public void setBasicNewGameWorld()\r\n\t{\r\n\t\tlistCharacter = new ArrayList<Character>();\r\n\t\tlistRelationship = new ArrayList<Relationship>();\r\n\t\tlistLocation = new ArrayList<Location>();\r\n\t\t\r\n\t\t//Location;\r\n\t\t\r\n\t\tLocation newLocationCity = new Location();\r\n\t\tnewLocationCity.setToGenericCity();\r\n\t\tLocation newLocationDungeon = new Location();\r\n\t\tnewLocationDungeon.setToGenericDungeon();\r\n\t\tLocation newLocationForest = new Location();\r\n\t\tnewLocationForest.setToGenericForest();\r\n\t\tLocation newLocationJail = new Location();\r\n\t\tnewLocationJail.setToGenericJail();\r\n\t\tLocation newLocationPalace = new Location();\r\n\t\tnewLocationPalace.setToGenericPalace();\r\n\t\t\r\n\t\tlistLocation.add(newLocationCity);\r\n\t\tlistLocation.add(newLocationDungeon);\r\n\t\tlistLocation.add(newLocationForest);\r\n\t\tlistLocation.add(newLocationJail);\r\n\t\tlistLocation.add(newLocationPalace);\r\n\t\t\r\n\t\t\r\n\t\t//Item\r\n\t\tItem newItem = new Item();\r\n\t\t\r\n\t\tString[] type =\t\tnew String[]\t{\"luxury\"};\r\n\t\tString[] function = new String[]\t{\"object\"};\t\r\n\t\tString[] property = new String[]\t{\"\"};\r\n\t\tnewItem.setNewItem(900101,\"diamond\", type, function, \"null\", property, 2, true);\r\n\t\tnewLocationPalace.addOrUpdateItem(newItem);\r\n\t\t\r\n\t\ttype =\t \tnew String[]\t{\"weapon\"};\r\n\t\tfunction = new String[]\t{\"equipment\"};\t\r\n\t\tproperty = new String[]\t{\"weapon\"};\r\n\t\tnewItem = new Item();\r\n\t\tnewItem.setNewItem(500101,\"dagger\", type, function, \"null\", property, 1, false);\t\t\r\n\t\tnewLocationJail.addOrUpdateItem(newItem);\r\n\t\t\r\n\t\t\r\n\t\ttype =\t\tnew String[]\t{\"quest\"};\r\n\t\tfunction = new String[]\t{\"object\"};\t\r\n\t\tproperty = new String[]\t{\"\"};\r\n\t\tnewItem.setNewItem(900201,\"treasure_map\", type, function, \"null\", property, 2, true);\r\n\t\tnewLocationDungeon.addOrUpdateItem(newItem);\r\n\r\n\t\t\r\n\t\t////// Add very generic item (10+ items of same name)\r\n\t\t////// These item start ID at 100000\r\n\t\t\r\n\t\t//Add 1 berry\r\n\t\t//100000\r\n\t\tnewItem = new Item();\r\n\t\ttype =\t \tnew String[]\t{\"supply\"};\r\n\t\tfunction = new String[]\t{\"consumable\"};\t\r\n\t\tproperty = new String[]\t{\"berry\"};\r\n\t\tnewItem.setNewItem(100101,\"berry\", type, function, \"null\", property, 0, false);\r\n\t\tnewLocationForest.addOrUpdateItem(newItem);\r\n\t\t\r\n\t\t/* REMOVE 19-2-2019 to increase performance\r\n\t\t\r\n\t\tnewItem = new Item();\r\n\t\tnewItem.setNewItem(100102,\"berry\", type, function, \"null\", property, 0, false);\r\n\t\tnewLocationForest.addOrUpdateItem(newItem);\r\n\t\tnewItem = new Item();\r\n\t\tnewItem.setNewItem(100102,\"berry\", type, function, \"null\", property, 0, false);\r\n\t\tnewLocationForest.addOrUpdateItem(newItem);\r\n\t\tnewItem = new Item();\r\n\t\tnewItem.setNewItem(100103,\"berry\", type, function, \"null\", property, 0, false);\r\n\t\tnewLocationForest.addOrUpdateItem(newItem);\r\n\t\t\r\n\t\t*/\r\n\r\n\t\t\r\n\t\t//Add 2 poison_plant\r\n\t\t//101000\r\n\t\tnewItem = new Item();\r\n\t\ttype =\t \tnew String[]\t{\"supply\"};\r\n\t\tfunction = new String[]\t{\"consumable\"};\t\r\n\t\tproperty = new String[]\t{\"poison\"};\r\n\t\tnewItem.setNewItem(100201,\"poison_plant\", type, function, \"null\", property, 0, false);\r\n\t\tnewLocationForest.addOrUpdateItem(newItem);\r\n\t\tnewItem = new Item();\r\n\t\tnewItem.setNewItem(100202,\"poison_plant\", type, function, \"null\", property, 0, false);\r\n\t\tnewLocationForest.addOrUpdateItem(newItem);\r\n\t\tnewItem = new Item();\r\n\r\n\t\t//player\r\n\t\tCharacter newChar = new Character(\"player\", 1, true,\"city\", 0, false);\r\n\t\tnewChar.setIsPlayer(true);\r\n\t\tlistCharacter.add(newChar);\r\n\t\t\r\n\t\t//UNIQUE NPC\r\n\t\tnewChar = new Character(\"mob_NPC_1\", 15, true,\"city\", 0, false);\r\n\t\tlistCharacter.add(newChar);\r\n\r\n\t\t\r\n\t\tnewChar = new Character(\"king\", 20, true,\"palace\", 3, true);\r\n\t\tnewChar.addOccupation(\"king\");\r\n\t\tnewChar.addOccupation(\"noble\");\r\n\t\tnewChar.addStatus(\"rich\");\r\n\t\t\r\n\t\tlistCharacter.add(newChar);\r\n\r\n\r\n\t\t//Mob character\r\n\t\tnewChar = new Character(\"soldier1\", 20, true,\"city\", 2, true);\r\n\t\tnewChar.addOccupation(\"soldier\");\r\n\t\tlistCharacter.add(newChar);\r\n\t\t\r\n\t\t// REMOVE to improve performance\r\n\t\t/*\r\n\t\tnewChar = new Character(\"soldier2\", 20, true,\"jail\", 2, true);\r\n\t\tnewChar.addOccupation(\"soldier\");\r\n\t\tlistCharacter.add(newChar);\r\n\t\t*/\r\n\t\t\r\n\t\t\r\n\t\tnewChar = new Character(\"soldier3\", 20, true,\"palace\", 2, true);\r\n\t\tnewChar.addOccupation(\"soldier\");\r\n\t\tlistCharacter.add(newChar);\r\n\t\t\r\n\t\t//listLocation.add(newLocationCity);\r\n\t\t//listLocation.add(newLocationDungeon);\r\n\t\t//listLocation.add(newLocationForest);\r\n\t\t//listLocation.add(newLocationJail);\r\n\t\t//listLocation.add(newLocationPalace);\r\n\t\t\r\n\t\tnewChar = new Character(\"doctor1\", 20, true,\"city\", 3, true);\r\n\t\tnewChar.addSkill(\"heal\");\r\n\t\tnewChar.addOccupation(\"doctor\");\r\n\t\tlistCharacter.add(newChar);\t\r\n\t\tnewChar = new Character(\"blacksmith1\", 20, true,\"city\", 2, true);\r\n\t\tnewChar.addOccupation(\"blacksmith\");\r\n\t\tlistCharacter.add(newChar);\r\n\t\t\r\n\t\t\r\n\t\tnewChar = new Character(\"thief1\", 20, true,\"jail\", 2, true);\r\n\t\tnewChar.addOccupation(\"thief\");\r\n\t\ttype =\t \tnew String[]\t{\"supply\"};\r\n\t\tfunction = new String[]\t{\"consumable\"};\t\r\n\t\tproperty = new String[]\t{\"unlock\"};\r\n\t\tnewItem = new Item();\r\n\t\tnewItem.setNewItem(300101,\"lockpick\", type, function, \"thief1\", property, 1, false);\r\n\t\tnewChar.addOrUpdateItem(newItem);\r\n\t\tlistCharacter.add(newChar);\r\n\t\t\r\n\t\t// Remove to improve performance\r\n\t\t/*\r\n\t\tnewChar = new Character(\"messenger1\", 20, true,\"city\", 2, true);\r\n\t\tnewChar.addOccupation(\"messenger\");\r\n\t\tlistCharacter.add(newChar);\r\n\t\t*/\r\n\t\t\r\n\t\tnewChar = new Character(\"miner1\", 20, true,\"dungeon\", 1, true);\r\n\t\tnewChar.addOccupation(\"miner\");\r\n\t\tlistCharacter.add(newChar);\r\n\t\tnewChar = new Character(\"lumberjack1\", 20, true,\"forest\", 1, true);\r\n\t\tnewChar.addOccupation(\"lumberjack\");\r\n\t\tlistCharacter.add(newChar);\r\n\t\t\r\n\t\t/* REMOVE 19-2-2019 to increase performance\r\n\t\t\r\n\t\tnewChar = new Character(\"scout1\", 20, true,\"forest\", 2, true);\r\n\t\tnewChar.addOccupation(\"scout\");\r\n\t\tlistCharacter.add(newChar);\r\n\t\tnewChar = new Character(\"farmer1\", 20, true,\"forest\", 1, true);\r\n\t\tnewChar.addOccupation(\"farmer\");\r\n\t\tlistCharacter.add(newChar);\r\n\t\t\r\n\t\t*/\r\n\t\t\r\n\t\t\r\n\t\tnewChar = new Character(\"merchant1\", 20, true,\"city\", 3, true);\r\n\t\tnewChar.addOccupation(\"merchant\");\r\n\t\tnewChar.addStatus(\"rich\");\r\n\t\t\r\n\t\t// Merchant Item\r\n\t\t//NPC item start at 50000\r\n\t\ttype =\t \tnew String[]\t{\"supply\"};\r\n\t\tfunction = new String[]\t{\"consumable\"};\t\r\n\t\tproperty = new String[]\t{\"poison\"};\r\n\t\tnewItem = new Item();\r\n\t\tnewItem.setNewItem(200101,\"potion_poison\", type, function, \"merchant1\", property, 1, false);\r\n\t\tnewChar.addOrUpdateItem(newItem);\r\n\t\t\r\n\t\ttype =\t \tnew String[]\t{\"supply\"};\r\n\t\tfunction = new String[]\t{\"consumable\"};\t\r\n\t\tproperty = new String[]\t{\"healing\"};\r\n\t\tnewItem = new Item();\r\n\t\tnewItem.setNewItem(200201,\"potion_heal\", type, function, \"merchant1\", property, 1, false);\r\n\t\tnewChar.addOrUpdateItem(newItem);\r\n\t\t\r\n\t\ttype =\t \tnew String[]\t{\"supply\"};\r\n\t\tfunction = new String[]\t{\"consumable\"};\t\r\n\t\tproperty = new String[]\t{\"cure_poison\"};\r\n\t\tnewItem = new Item();\r\n\t\tnewItem.setNewItem(200301,\"antidote\", type, function, \"merchant1\", property, 1, false);\t\r\n\t\tnewChar.addOrUpdateItem(newItem);\r\n\t\t\r\n\t\t\r\n\t\t//add merchant to List\r\n\t\tlistCharacter.add(newChar);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t//Relation\r\n\t\tRelationship newRelation = new Relationship();\r\n\t\tnewRelation.setRelationship(\"merchant1\", \"soldier1\", \"friend\");\r\n\t\tlistRelationship.add(newRelation);\r\n\t\t\r\n\t\t//\r\n\t\r\n\t}", "public void run() {\n \t\t\t\t\tPerformTransition.transition(am, MatchState.LOSERS, am.getResult().getLosers(), false);\n \t\t\t\t\tif (victor != null) /// everyone died at once??\n \t\t\t\t\t\tPerformTransition.transition(am, MatchState.WINNER, victor, false);\n \t\t\t\t\tarenaInterface.onComplete();\n \t\t\t\t\tnotifyListeners(new MatchCompletedEvent(am));\n \t\t\t\t\tupdateBukkitEvents(MatchState.ONCOMPLETE);\n \t\t\t\t\tdeconstruct();\t\n \t\t\t\t}", "private void init(){\n //drawer layers, used to show the info of location\n layout_drawer = (DrawerLayout)findViewById(R.id.map_drawer);\n //lock the drawer first, so empty drawer wont be dragged out\n layout_drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);\n\n //views in the info layer\n et_drawer_name = (EditText)findViewById(R.id.drawer_et_name);\n\n //used to get current location\n locMan = (LocationManager)this.getSystemService(Context.LOCATION_SERVICE);\n locProv = LocationManager.GPS_PROVIDER;\n\n //check user permission\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED &&\n ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_COARSE_LOCATION)\n != PackageManager.PERMISSION_GRANTED) {\n\n //if do not have getLocation permission, request\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n 100);\n return;\n }else if(mMap != null) {\n //get current location\n Location current = locMan.getLastKnownLocation(locProv);\n mMap.setMyLocationEnabled(true); //my location button\n\n if(current != null){\n //go to current location\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(\n new LatLng(current.getLatitude(), current.getLongitude()),\n ZOOMLV));\n }\n\n }\n\n //initialize search bar\n PlaceAutocompleteFragment autocompleteFragment = (PlaceAutocompleteFragment)\n getFragmentManager().findFragmentById(R.id.map_search);\n\n autocompleteFragment.setOnPlaceSelectedListener(new PlaceSelectionListener() {\n @Override\n public void onPlaceSelected(Place place) {\n location = new cLocation(place);\n\n //move camera to searched place and zoom in\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(place.getLatLng(), ZOOMLV));\n\n //show the dialog for user to add\n openAddDialog();\n }\n\n @Override\n public void onError(Status status) {\n // TODO: Handle the error.\n }\n });\n }", "public void setCar() {\n\n\t\tint tries = 0;\n\t\tif(type ==RANDOM)\n\t\t{\n\t\t\tfor (int i = 0; i < noOfCarsGenerated; i++) {\n\t\t\t\tCar c = generateRandomCar(Timer.getClock());\n\t\t\t\twhile (c == null){\n\t\t\t\t\ttries++;\n\t\t\t\t\tSystem.out.println(\"i'm null somehow : \" + tries);\n\t\t\t\t\tc = generateRandomCar(Timer.getClock());\n\t\t\t\t}\n\t\t\t\tSimulator.getStations().get(c.getDestination()).addMovingQueue(c);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse if (type == FIXED) {\n\t\t\t\n\t\t\tPoint source=Simulator.geoToCor(latitude, longitude);\n\t\t\tString destination=strategy.chooseDestination(source);\n\n\t\t\tfor (int i = 0; i < noOfCarsGenerated; i++) {\n\t\t\t\tCar c = new Car(latitude, longitude, destination, Timer.getClock(), strategy.setChargingTime(source));\n\t\t\t\tc.saveRoute(c.getCarRoute());\n\t\t\t\tSimulator.getStations().get(c.getDestination()).addMovingQueue(c);\n\t\t\t}\n\t\t}\n\n\t\tcurrentNo += noOfCarsGenerated;\n\n\t\tSimulator.updateCarNolbl(noOfCarsGenerated);\n\n\n\t}", "pb4server.RandomPointMoveCityAskReq getRandomPointMoveCityAskReq();", "protected boolean selectTile(String player, int coordinate, String area, MBproduction.buildingType build){\n String culture = null;\n boolean AIflag = false;\n boolean placeFlag = false;\n MBproduction.terrainTypeEnum selected;\n String normalizeSelected;\n /*******************************/\n player=player.toLowerCase();\n switch(player.toLowerCase()){\n case\"human\":\n culture = playBoard.humanCulture();\n break;\n case\"ai1\":\n culture = playBoard.AICulture1();\n break;\n case\"ai2\":\n culture = playBoard.AICulture2();\n break;\n default:\n break;\n }\n selected = playBoard.getIndiTerrain(coordinate);\n normalizeSelected = \n selected.toString().substring(0, selected.toString().length()-1);\n switch(culture.toLowerCase()){\n //norse\n case\"norse\":\n switch(area.toLowerCase()){\n case\"production\":\n for (int i = 0; i < norseProduction.size(); i ++){\n if (norseProduction.get(i).getName().equalsIgnoreCase(normalizeSelected)){\n norseProduction.get(i).setIcon(new javax.swing.ImageIcon(\n getClass().getResource(selected.getPath())));\n norseProduction.remove(i);\n playBoard.updateProductionResourceCube(player, selected);\n playBoard.exileTerrain(selected); \n tileSelection.get(coordinate).setEnabled(false);\n stackAI.remove(stackAI.indexOf(coordinate));\n placeFlag = true;AIflag = true;\n break;\n }\n }\n break;\n //!!!!!!!!WARNNING!!!!!!!! NEED TO MODIFY FOR ITERATION II\n case\"city\":\n for (int i = 0; i < norseCity.size(); i ++){\n if (norseCity.get(i).getIcon() == null){\n norseCity.get(i).setIcon(new javax.swing.ImageIcon(\n getClass().getResource(build.getPath())));\n placeFlag = true;\n break;\n }\n }\n break;\n default:\n break;\n }\n break;\n //greek \n case\"greek\":\n switch(area.toLowerCase()){\n case\"production\":\n for (int i = 0; i < greekProduction.size(); i ++){\n if (greekProduction.get(i).getName().equalsIgnoreCase(normalizeSelected)){\n greekProduction.get(i).setIcon(new javax.swing.ImageIcon(\n getClass().getResource(selected.getPath())));\n greekProduction.remove(i);\n playBoard.updateProductionResourceCube(player, selected);\n playBoard.exileTerrain(selected); \n tileSelection.get(coordinate).setEnabled(false);\n stackAI.remove(stackAI.indexOf(coordinate));\n placeFlag = true;AIflag = true;\n break;\n }\n }\n break;\n //!!!!!!!!WARNNING!!!!!!!! NEED TO MODIFY FOR ITERATION II\n case\"city\":\n for (int i = 0; i < greekCity.size(); i ++){\n if (greekCity.get(i).getIcon() == null){\n greekCity.get(i).setIcon(new javax.swing.ImageIcon(\n getClass().getResource(build.getPath())));\n placeFlag = true;\n break;\n } \n }\n break;\n default:\n break;\n }\n break;\n //egypt\n case\"egypt\":\n switch(area.toLowerCase()){\n case\"production\":\n for (int i = 0; i < egyptProduction.size(); i ++){\n if (egyptProduction.get(i).getName().equalsIgnoreCase(normalizeSelected)){\n egyptProduction.get(i).setIcon(new javax.swing.ImageIcon(\n getClass().getResource(selected.getPath())));\n playBoard.updateProductionResourceCube(player, selected);\n playBoard.exileTerrain(selected);\n egyptProduction.remove(i);\n tileSelection.get(coordinate).setEnabled(false);\n stackAI.remove(stackAI.indexOf(coordinate));\n placeFlag = true;AIflag = true;\n break; \n }\n }\n break;\n //!!!!!!!!WARNNING!!!!!!!! NEED TO MODIFY FOR ITERATION II\n case\"city\":\n for (int i = 0; i < egyptCity.size(); i ++){\n if (egyptCity.get(i).getIcon() == null){\n egyptCity.get(i).setIcon(new javax.swing.ImageIcon(\n getClass().getResource(build.getPath())));\n placeFlag = true;\n break;\n } \n }\n break;\n default:\n break;\n }\n break;\n default:\n break;\n }\n if ((!placeFlag)&&(player.equalsIgnoreCase(\"human\"))){\n JOptionPane.showMessageDialog(\n null, \"No suitable tile for \" + player , \"Information\",\n JOptionPane.WARNING_MESSAGE);\n }\n return AIflag; \n }", "public static void main(String[] args) {\n City city = new City(60, 200);\n\n City city2 = new City(180, 200);\n\n City city3 = new City(80, 180);\n City city4 = new City(140, 180);\n\n City city5 = new City(20, 160);\n\n City city6 = new City(100, 160);\n\n City city7 = new City(200, 160);\n\n City city8 = new City(140, 140);\n\n City city9 = new City(40, 120);\n\n City city10 = new City(100, 120);\n\n City city11 = new City(180, 100);\n\n City city12 = new City(60, 80);\n\n City city13 = new City(120, 80);\n City city14 = new City(180, 60);\n City city15 = new City(20, 40);\n\n City city16 = new City(100, 40);\n\n City city17 = new City(200, 40);\n City city18 = new City(20, 20);\n\n City city19 = new City(60, 20);\n City city20 = new City(160, 20);\n List<City> list=new ArrayList<City>();\n list.add(city);list.add(city2);\n list.add(city3);\n list.add(city4);\n list.add(city5);\n list.add(city6);\n list.add(city7);\n list.add(city8);\n list.add(city9);\n list.add(city10);\n list.add(city11);\n list.add(city12);\n list.add(city13);\n list.add(city14);\n list.add(city15);\n list.add(city16);\n list.add(city17);\n list.add(city18);\n list.add(city19);\n list.add(city20);\n\n // Initialize population\n Population pop = new Population(100, true,list);\n System.out.println(\"Initial distance: \" + pop.getBestTour().getDistance());\n\n // Evolve population for 100 generations\n pop = Ga.evolvePopulation(pop);\n for (int i = 0; i < 500; i++) {\n pop = Ga.evolvePopulation(pop);\n System.out.println(\"第\"+i+\"代\"+pop.getBestTour().getDistance());\n }\n\n // Print final results\n System.out.println(\"Finished\");\n System.out.println(\"Final distance: \" + pop.getBestTour().getDistance());\n System.out.println(\"Solution:\");\n System.out.println(pop.getBestTour());\n }", "@Override\n public void performAction(int row, int col) throws MapException {\n if (GameData.get().getMap().getMapElement(row, col).getStructure() != null) {\n mCityActivity.inspectBuilding(row, col);\n }\n }", "@Override\n public void onSelectState(State state) {\n // pickCity.setVisibility(View.VISIBLE);\n stateNameTextView.setVisibility(View.VISIBLE);\n cityName.setText(\"City\");\n cityPicker.equalCityObject.clear();\n\n stateNameTextView.setText(state.getStateName());\n stateID = state.getStateId();\n\n\n for (int i = 0; i < cityObject.size(); i++) {\n cityPicker = new CityPicker.Builder().with(this).listener(this).build();\n City cityData = new City();\n if (cityObject.get(i).getStateId() == stateID) {\n cityData.setCityId(cityObject.get(i).getCityId());\n cityData.setCityName(cityObject.get(i).getCityName());\n cityData.setStateId(cityObject.get(i).getStateId());\n\n cityPicker.equalCityObject.add(cityData);\n }\n }\n }", "public void act() \n {\n World myWorld = getWorld();\n \n Mapa mapa = (Mapa)myWorld;\n \n EnergiaMedicZ vidaMZ = mapa.getEnergiaMedicZ();\n \n EnergiaGuerriZ vidaGZ = mapa.getEnergiaGuerriZ();\n \n EnergiaConstrucZ vidaCZ = mapa.getEnergiaConstrucZ();\n \n GasZerg gasZ = mapa.getGasZerg();\n \n CristalZerg cristalZ = mapa.getCristalZerg();\n \n BunkerZerg bunkerZ = mapa.getBunkerZerg();\n \n Mina1 mina1 = mapa.getMina1();\n Mina2 mina2 = mapa.getMina2();\n Mina3 mina3 = mapa.getMina3();\n \n \n //movimiento del personaje\n if(Greenfoot.isKeyDown(\"b\")){\n if(Greenfoot.isKeyDown(\"d\")){\n if(getX()<1000){\n setLocation(getX()+1,getY());\n }\n }\n if(Greenfoot.isKeyDown(\"a\")){\n if(getX()<1000){\n setLocation(getX()-1,getY());\n }\n }\n if(Greenfoot.isKeyDown(\"w\")){\n if(getY()<600){\n setLocation(getX(),getY()-1);\n }\n }\n if(Greenfoot.isKeyDown(\"s\")){\n if(getY()<600){\n setLocation(getX(),getY()+1);}\n }\n }\n else if(Greenfoot.isKeyDown(\"z\")){\n if(Greenfoot.isKeyDown(\"d\")){\n if(getX()<1000){\n setLocation(getX()+1,getY());\n }\n }\n if(Greenfoot.isKeyDown(\"a\")){\n if(getX()<1000){\n setLocation(getX()-1,getY());\n }\n }\n if(Greenfoot.isKeyDown(\"w\")){\n if(getY()<600){\n setLocation(getX(),getY()-1);\n }\n }\n if(Greenfoot.isKeyDown(\"s\")){\n if(getY()<600){\n setLocation(getX(),getY()+1);}\n }}\n //encuentro con objeto\n \n if(isTouching(Arbol.class) && Greenfoot.isKeyDown(\"d\"))\n {\n setLocation(getX()-1,getY());\n }\n if(isTouching(Arbol.class) && Greenfoot.isKeyDown(\"a\"))\n {\n setLocation(getX()+1,getY());\n }\n if(isTouching(Arbol.class) && Greenfoot.isKeyDown(\"w\"))\n {\n setLocation(getX(),getY()+1);\n }\n if(isTouching(Arbol.class) && Greenfoot.isKeyDown(\"s\"))\n {\n setLocation(getX(),getY()-1);\n }\n \n \n //probabilida de daño al enemigo\n \n if(isTouching(MedicTerran.class) && Greenfoot.getRandomNumber(100)==3)\n {\n \n vidaCZ.removervidaCZ();\n \n }\n \n if(isTouching(ConstructorTerran.class) && (Greenfoot.getRandomNumber(100)==3 ||\n Greenfoot.getRandomNumber(100)==2||Greenfoot.getRandomNumber(100)==1))\n {\n \n vidaCZ.removervidaCZ();\n \n }\n if(isTouching(GuerreroTerran.class) && (Greenfoot.getRandomNumber(100)==3||\n Greenfoot.getRandomNumber(100)==2||Greenfoot.getRandomNumber(100)==1||Greenfoot.getRandomNumber(100)==4||Greenfoot.getRandomNumber(100)==5))\n {\n \n vidaCZ.removervidaCZ();\n \n }\n \n \n \n //encuentro con Bunker\n \n \n if(isTouching(BunkerMedicoZ.class)&& Greenfoot.isKeyDown(\"d\"))\n {\n setLocation(getX()-1,getY());\n }\n \n if(isTouching(BunkerMedicoZ.class)&& Greenfoot.isKeyDown(\"a\"))\n {\n setLocation(getX()+1,getY());\n }\n \n if(isTouching(BunkerMedicoZ.class)&& Greenfoot.isKeyDown(\"w\"))\n {\n setLocation(getX(),getY()+1);\n }\n \n if(isTouching(BunkerMedicoZ.class)&& Greenfoot.isKeyDown(\"s\"))\n \n {\n setLocation(getX(),getY()-1);\n }\n \n //AccionesUnicas\n \n if(isTouching(YacimientoDeGas.class) && gasZ.gasZ < 100)\n {\n \n gasZ.addGasZ();\n \n }\n \n \n if(isTouching(Mina1.class) && cristalZ.cristalZ < 20) {\n \n cristalZ.addCristalZ();\n mina1.removemina1();\n \n }\n \n if(isTouching(Mina2.class) && cristalZ.cristalZ < 20) {\n \n cristalZ.addCristalZ();\n mina2.removemina2();\n \n }\n \n if(isTouching(Mina3.class) && cristalZ.cristalZ < 20) {\n \n cristalZ.addCristalZ();\n mina3.removemina3();\n \n }\n \n \n if(isTouching(DepositoZ.class) && gasZ.gasZ > 4 && bunkerZ.bunkerZ() < 400){\n \n gasZ.removeGasZ();\n bunkerZ.addbunkerZ();\n }\n \n if(isTouching(DepositoZ.class) && cristalZ.cristalZ() > 0 && bunkerZ.bunkerZ() < 400 ){\n \n cristalZ.removeCristalZ();\n bunkerZ.addbunkerZ();\n }\n \n //determinar si la vida llega a 0\n \n if( vidaCZ.vidaCZ <= 0 )\n {\n \n getWorld().removeObjects(getWorld().getObjects(EnergiaConstrucZ.class)); \n \n getWorld().removeObjects(getWorld().getObjects(ConstructorZerg.class));\n \n EnergiaZerg energiaZ = mapa.getEnergiaZerg(); \n \n energiaZ.removenergiaCZ();\n }\n \n if( mina1.mina1() == 0 ){\n \n getWorld().removeObjects(getWorld().getObjects(Mina1.class)); \n \n getWorld().removeObjects(getWorld().getObjects(Cristal1.class));\n \n }\n \n if( mina2.mina2() == 0 ){\n \n getWorld().removeObjects(getWorld().getObjects(Mina2.class)); \n \n getWorld().removeObjects(getWorld().getObjects(Cristal2.class));\n \n }\n \n if( mina3.mina3() == 0 ){\n \n getWorld().removeObjects(getWorld().getObjects(Mina3.class)); \n \n getWorld().removeObjects(getWorld().getObjects(Cristal3.class));\n \n }\n \n \n}", "@Override\n public void initialisePlayer(World world) {\n // To be implemented.\n \tthis.numRow = world.numRow;\n \tthis.numCol = world.numColumn;\n \tthis.world = world;\n \tthis.enemyShots = new ArrayList<Coordinate>();\n \t/*this.shots = this.world.shots;*/\n \tthis.shipLocations = this.world.shipLocations;\n \tthis.guesses = new ArrayList<Guess>();\n \tthis.parityList = new ArrayList<Coordinate>();\n \ttargeting = false;\n \tthis.hitGuesses = new ArrayList<Guess>();\n \tfillParityList();\n \t\n \n \t\n \t\n }", "@Override\n protected WeatherInfo doInBackground(Void... params) {\n String weatherID = \"\";\n String areaID = \"\";\n try {\n String cityIds = null;\n if (mRequest.getRequestInfo().getRequestType()\n == RequestInfo.TYPE_WEATHER_BY_WEATHER_LOCATION_REQ) {\n cityIds = mRequest.getRequestInfo().getWeatherLocation().getCityId();\n weatherID = cityIds.split(\",\")[0];\n areaID = cityIds.split(\",\")[1];\n } else if (mRequest.getRequestInfo().getRequestType() ==\n RequestInfo.TYPE_WEATHER_BY_GEO_LOCATION_REQ) {\n double lat = mRequest.getRequestInfo().getLocation().getLatitude();\n double lng = mRequest.getRequestInfo().getLocation().getLongitude();\n\n String cityNameResponse = HttpRetriever.retrieve(String.format(GEO_URL, lat, lng));\n if (TextUtils.isEmpty(cityNameResponse)) {\n return null;\n }\n cityNameResponse = cityNameResponse.replace(\"renderReverse&&renderReverse(\", \"\").replace(\")\", \"\");\n Log.d(TAG, \"cityNameResponse\" + cityNameResponse);\n JSONObject jsonObjectCity = JSON.parseObject(cityNameResponse);\n String areaName = jsonObjectCity.getJSONObject(\"result\").getJSONObject(\"addressComponent\").getString(\"district\");\n String cityName = jsonObjectCity.getJSONObject(\"result\").getJSONObject(\"addressComponent\").getString(\"city\");\n areaName = TextUtil.getFormatArea(areaName);\n cityName = TextUtil.getFormatArea(cityName);\n City city = cityDao.getCityByCityAndArea(cityName, areaName);\n if (city == null) {\n city = cityDao.getCityByCityAndArea(cityName, cityName);\n if (city == null)\n return null;\n }\n weatherID = city.getWeatherId();\n areaID = city.getAreaId();\n } else {\n return null;\n }\n\n //miui天气\n String miuiURL = String.format(URL_WEATHER_MIUI, weatherID);\n if (DEBUG) Log.d(TAG, \"miuiURL \" + miuiURL);\n String miuiResponse = HttpRetriever.retrieve(miuiURL);\n if (miuiResponse == null) return null;\n if (DEBUG) Log.d(TAG, \"Rmiuiesponse \" + miuiResponse);\n\n //2345天气\n String ttffUrl = String.format(URL_WEATHER_2345, areaID);\n if (DEBUG) Log.d(TAG, \"ttffUrl \" + ttffUrl);\n String ttffResponse = DecodeUtil.decodeResponse(HttpRetriever.retrieve(ttffUrl));\n if (ttffResponse == null) return null;\n if (DEBUG) Log.d(TAG, \"ttffResponse \" + ttffResponse);\n\n\n JSONObject ttffAll = JSON.parseObject(ttffResponse);\n String cityName = ttffAll.getString(\"cityName\");\n //实时\n JSONObject sk = ttffAll.getJSONObject(\"sk\");\n String humidity = sk.getString(\"humidity\");\n String sk_temp = sk.getString(\"sk_temp\");\n\n //日落日升\n JSONObject sunrise = ttffAll.getJSONObject(\"sunrise\");\n\n ArrayList<WeatherInfo.DayForecast> forecasts =\n parse2345(ttffAll.getJSONArray(\"days7\"), true);\n\n WeatherInfo.Builder weatherInfo = null;\n weatherInfo = new WeatherInfo.Builder(\n cityName, sanitizeTemperature(Double.parseDouble(sk_temp), true),\n WeatherContract.WeatherColumns.TempUnit.CELSIUS);\n //湿度\n humidity = humidity.replace(\"%\", \"\");\n weatherInfo.setHumidity(Double.parseDouble(humidity));\n\n if (miuiResponse != null) {\n //风速,风向\n JSONObject weather = JSON.parseObject(miuiResponse);\n JSONObject accu_cc = weather.getJSONObject(\"accu_cc\");\n weatherInfo.setWind(accu_cc.getDouble(\"WindSpeed\"), accu_cc.getDouble(\"WindDirectionDegrees\"),\n WeatherContract.WeatherColumns.WindSpeedUnit.KPH);\n }\n\n weatherInfo.setTimestamp(System.currentTimeMillis());\n weatherInfo.setForecast(forecasts);\n\n if (forecasts.size() > 0) {\n weatherInfo.setTodaysLow(sanitizeTemperature(forecasts.get(0).getLow(), true));\n weatherInfo.setTodaysHigh(sanitizeTemperature(forecasts.get(0).getHigh(), true));\n weatherInfo.setWeatherCondition(IconUtil.getWeatherCodeByType(\n ttffAll.getJSONArray(\"days7\").getJSONObject(0).getString(\n DateTimeUtil.isNight(sunrise.getString(\"todayRise\"), sunrise.getString(\"todaySet\"))\n ? \"nightWeaShort\" : \"dayWeaShort\"), sunrise.getString(\"todayRise\"), sunrise.getString(\"todaySet\")));\n }\n\n if (lastWeatherInfo != null)\n lastWeatherInfo = null;\n\n lastWeatherInfo = weatherInfo.build();\n\n return lastWeatherInfo;\n } catch (Exception e) {\n if (DEBUG) Log.w(TAG, \"JSONException while processing weather update\", e);\n }\n return null;\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 }", "private void fillCitiesTable() {\n try (Connection connection = this.getConnection();\n Statement statement = connection.createStatement();\n ResultSet rs = statement.executeQuery(INIT.GET_CITY.toString())) {\n if (!rs.next()) {\n try (PreparedStatement ps = connection.prepareStatement(INIT.FILL_CITIES.toString())) {\n connection.setAutoCommit(false);\n ParseSiteForCities parse = new ParseSiteForCities();\n for (City city : parse.parsePlanetologDotRu()) {\n ps.setString(1, city.getCountry());\n ps.setString(2, city.getCity());\n ps.addBatch();\n }\n ps.executeBatch();\n connection.commit();\n connection.setAutoCommit(true);\n }\n }\n\n } catch (SQLException e) {\n logger.error(e.getMessage(), e);\n }\n }", "private void insertStateAndCity(final UserLocation userLocation) {\r\n final String siteId = userLocation.getSiteId();\r\n final String buildingId = userLocation.getBuildingId();\r\n \r\n if (StringUtil.notNullOrEmpty(siteId) || StringUtil.notNullOrEmpty(buildingId)) {\r\n // Find the state and city id's for this location.\r\n final Building filter = new Building();\r\n filter.setSiteId(siteId);\r\n filter.setBuildingId(buildingId);\r\n final List<Building> buildings = this.spaceService.getBuildings(filter);\r\n if (!buildings.isEmpty()) {\r\n userLocation.setStateId(buildings.get(0).getStateId());\r\n userLocation.setCityId(buildings.get(0).getCityId());\r\n }\r\n }\r\n }" ]
[ "0.78899527", "0.699828", "0.6765818", "0.61841965", "0.6099458", "0.60949284", "0.6059709", "0.60111487", "0.6008716", "0.599806", "0.598924", "0.59667647", "0.59414655", "0.59377784", "0.59320474", "0.5915583", "0.58199364", "0.57818264", "0.5771182", "0.56956935", "0.56946594", "0.5680212", "0.56710243", "0.5616311", "0.5600362", "0.55845034", "0.5571654", "0.55446225", "0.5538039", "0.5522318", "0.55003256", "0.5495483", "0.5488073", "0.54675967", "0.5463471", "0.5445002", "0.5438393", "0.54379016", "0.5434674", "0.5432564", "0.543084", "0.54305613", "0.5425203", "0.54014766", "0.54008955", "0.5396508", "0.53955346", "0.5393496", "0.53914905", "0.5368994", "0.53607666", "0.53597224", "0.5354263", "0.5352519", "0.53472024", "0.53225106", "0.5322286", "0.5319111", "0.53152186", "0.531521", "0.5311278", "0.53096986", "0.5308895", "0.53025484", "0.53022784", "0.52977586", "0.52910256", "0.52893454", "0.5287953", "0.5284487", "0.52827656", "0.52787006", "0.5276692", "0.5275267", "0.5273477", "0.5266188", "0.5260197", "0.5255248", "0.5248249", "0.52466315", "0.5245882", "0.52454823", "0.52448803", "0.52414596", "0.5236225", "0.52358687", "0.52316695", "0.52292436", "0.5228136", "0.52269435", "0.52249074", "0.5222414", "0.521568", "0.52150136", "0.5214958", "0.5209968", "0.52088714", "0.52047884", "0.51936036", "0.51867884", "0.51863074" ]
0.0
-1
This method is called when a player attempts to offer a trade
boolean CanOfferTrade(Resources offer);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void acceptTrade(boolean willAccept) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onTrade(Trade trade) throws Exception {\n\t\t\r\n\t}", "@Override\r\n\tpublic void sendTradeOffer(TradeOffer offer) {\n\t\t\r\n\t}", "public void onTradeRequest(String name)\n {\n\t\tif(traded_ammount > 0)\n\t\t{\n\t\t\ttraded_ammount = 0;\n\t\t\ttime = System.currentTimeMillis();\n\t\t}\n\t\tint[] player = getPlayerByName(name);\n\t\tint player_id = getPlayerPID(player[0]);\n\t\tsendTradeRequest(player_id);\n }", "@Override\n protected void trade(){\n // An example of a random trade proposal: offer peasants in exchange of soldiers\n // Pick the id of the potential partner (without checking if it is my neighbor)\n double pertnerID = (new Random()).nextInt(42)+1;\n trade[0] = pertnerID;\n // Choose the type of good demanded (peasants - 3)\n double demandType = 3;\n trade[1] = demandType;\n // Choose the amount of demanded goods\n double demand = Math.random();\n trade[2] = demand;\n // Choose the type of good offered in exchange (peasants - 2)\n double offerType = 2;\n trade[3] = offerType;\n // Choode the amount of goods offered in exchange (random but less than my total number of peasants)\n double offer = (new Random()).nextDouble()*myTerritory.getPeasants();\n trade[4] = offer;\n\n // This procedure updated the array trade, which contains the information\n // about trade proposals of the current lord\n }", "public abstract void performPurchase(Player player);", "@Override\n public void offerTrade(IResourceBank offer, int recipientPlayerIndex) throws ModelException {\n IPlayer p = GameModelFacade.instance().getLocalPlayer();\n\n if (!p.canAfford(offer) || !GameModelFacade.instance().localPlayerIsPlaying() || !offer.containsResources()) {\n throw new ModelException(\"Preconditions for action not met.\");\n }\n\n try {\n String clientModel = m_theProxy.offerTrade(p.getIndex(), offer, recipientPlayerIndex);\n new ModelInitializer().initializeClientModel(clientModel, m_theProxy.getPlayerId());\n } catch (NetworkException e) {\n throw new ModelException(e);\n }\n }", "private void botTrading(){\n if(game.isCardPositive(game.getHighestSharePriceStock())){\n int numShares = player.getFunds()/(game.getHighestSharePriceStock().getSharePrice()+3);\n player.getShares().set(game.getIndex(game.getHighestSharePriceStock()), player.getShares().get(game.getIndex(game.getHighestSharePriceStock())) + numShares);\n player.setFunds(-numShares*(game.getHighestSharePriceStock().getSharePrice()+3));\n }\n }", "void offerTrade(int receiver, Resources resources);", "private void offer() {\n\t\t\t\n\t\t}", "public void doLogicBuy() {\n\t\tif (!player.isHuman) {\n\t\t\tif (player.money > estimatedFee * 1.5) //\n\t\t\t{\n\t\t\t\tint free = (int) (player.money - estimatedFee * 1.5);\n\t\t\t\tCell c = board.getCells().get(player.position);\n\t\t\t\tif (c instanceof TradeableCell) {\n\t\t\t\t\tTradeableCell tc = (TradeableCell) c;\n\t\t\t\t\tif (tc.getOwner() == null && tc.getPrice() < free) {\n\t\t\t\t\t\ttc.buy(player);\n\t\t\t\t\t\tboard.addMessage(\"Just bought\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\n protected void acceptTrade(Territory offerer, double demand, int typeDemand, double offer, int typeOffer){\n // An example for accepting a trade proposal: I only accept offers of peasants when I have less than 3 peasants\n // I am not checking what I am giving in exchange or how much, so you should work on that\n if (typeOffer == 3 && typeDemand == 2){\n acceptTrade = true;// no matter the amounts\n }\n else acceptTrade = false;\n }", "void askLeaderCardThrowing();", "public void buyStock(double askPrice, int shares, int tradeTime) {\n }", "public void surrender() {\n playerCash += playerBet / 2;\n\n //Play dealer's turn\n dealerTurn();\n\n //End the game and change the views\n restartGame();\n }", "public void requestAccepted(String username)\n\t{\n\t\t// Player otherPlayer = TcpProtocolHandler.getPlayer(username);\n\t\tPlayer otherPlayer = ActiveConnections.getPlayer(username);\n\t\tif(otherPlayer != null)\n\t\t{\n\t\t\tif(m_requests.containsKey(username))\n\t\t\t\tswitch(m_requests.get(username))\n\t\t\t\t{\n\t\t\t\t\tcase BATTLE:\n\t\t\t\t\t\t/* First, ensure both players are on the same map */\n\t\t\t\t\t\tif(otherPlayer.getMap() != getMap())\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t/* Based on the map's pvp type, check this battle is possible If pvp is enforced, it will be started when the offer is made */\n\t\t\t\t\t\tif(getMap().getPvPType() != null)\n\t\t\t\t\t\t\tswitch(getMap().getPvPType())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcase DISABLED:\n\t\t\t\t\t\t\t\t\t/* Some maps have pvp disabled */\n\t\t\t\t\t\t\t\t\tServerMessage sendNotOther = new ServerMessage(ClientPacket.PVP_PACKETS);\n\t\t\t\t\t\t\t\t\tsendNotOther.addInt(2);\n\t\t\t\t\t\t\t\t\totherPlayer.getSession().Send(sendNotOther);\n\t\t\t\t\t\t\t\t\tServerMessage sendNot = new ServerMessage(ClientPacket.PVP_PACKETS);\n\t\t\t\t\t\t\t\t\tsendNot.addInt(2);\n\t\t\t\t\t\t\t\t\tgetSession().Send(sendNot);\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\tcase ENABLED:\n\t\t\t\t\t\t\t\t\t/* This is a valid battle, start it */\n\t\t\t\t\t\t\t\t\tensureHealthyPokemon();\n\t\t\t\t\t\t\t\t\totherPlayer.ensureHealthyPokemon();\n\t\t\t\t\t\t\t\t\tm_battleField = new PvPBattleField(DataService.getBattleMechanics(), this, otherPlayer);\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\tcase ENFORCED:\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tm_battleField = new PvPBattleField(DataService.getBattleMechanics(), this, otherPlayer);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TRADE:\n\t\t\t\t\t\tif(canTrade() && otherPlayer.canTrade())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t/* Set the player as talking so they can't move */\n\t\t\t\t\t\t\tm_isTalking = true;\n\t\t\t\t\t\t\t/* Create the trade */\n\t\t\t\t\t\t\tm_trade = new Trade(this, otherPlayer);\n\t\t\t\t\t\t\totherPlayer.setTrade(m_trade);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tServerMessage sendNotOther = new ServerMessage(ClientPacket.PVP_PACKETS);\n\t\t\t\t\t\t\tsendNotOther.addInt(4);\n\t\t\t\t\t\t\totherPlayer.getSession().Send(sendNotOther);\n\t\t\t\t\t\t\tServerMessage sendNot = new ServerMessage(ClientPacket.PVP_PACKETS);\n\t\t\t\t\t\t\tsendNot.addInt(4);\n\t\t\t\t\t\t\tgetSession().Send(sendNot);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tServerMessage sendNot = new ServerMessage(ClientPacket.PVP_PACKETS);\n\t\t\tsendNot.addInt(0);\n\t\t\tgetSession().Send(sendNot);\n\t\t}\n\t}", "@Override\n\tpublic void satisfyTrade(TickEvent<Trade> tradeEvent) throws TradeException {\n\n\t}", "void purchaseMade();", "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 }", "@Override\r\n\tpublic void setPlayerToTradeWith(int playerIndex) {\n\t\t\r\n\t}", "void confirmRealWorldTrade(IUserAccount user, ITransaction trans);", "private void buyPlayer(FootballPlayer player, String playerName, int num) {\n\t\tint valid = game.addPlayer(playerName);\n\t\tif(valid==0) {\n\t\t\tplayerNameArray[num].setText(playerName);\n\t\t\timageArray[num].setIcon(MainGui.getShirt(player.getTeamName()));\n\t\t\tbuttonArray[num].setText(\"X\");\n\t\t\tlblBudgetText.setText(game.getCurrentUser().getBudget() + \" RGG\");\n\t\t\t\n\t\t} else if (valid==1) {\n\t\t\tJOptionPane.showMessageDialog(frame,\"You have already selected this player for your team\");\n\t\t} else if (valid==-1) {\n\t\t\tJOptionPane.showMessageDialog(frame,\"You don´t have enough budget too buy \" + playerName);\n\t\t}\n\t}", "protected final void hit() throws InsufficientCardsException {\n hand.add(deck.deal());\n update();\n }", "public void onTrade(Trade event) {\n tradeCount++;\n }", "public void establishDealOffer() {\n DealOffer offer = new DealOffer();\n \n int moneyToOffer = (Integer)this.playersMoneyMap.get(currentPlayer).getValue();\n offer.offerCash(moneyToOffer);\n \n Map<JCheckBox, Space> thisPlayerMap = playersCheckBoxes.get(currentPlayer);\n if (thisPlayerMap != null) {\n for (JCheckBox checkBox : thisPlayerMap.keySet()) {\n if (checkBox.isSelected()) {\n offer.addPropertyToOffer(thisPlayerMap.get(checkBox));\n }\n }\n }\n \n int moneyToRequest = (Integer)this.playersMoneyMap.get(playerToOfferTo).getValue();\n offer.requestCash(moneyToRequest);\n \n Map<JCheckBox, Space> otherPlayerMap = playersCheckBoxes.get(playerToOfferTo);\n if (otherPlayerMap != null) {\n for (JCheckBox checkBox : otherPlayerMap.keySet()) {\n if (checkBox.isSelected()) {\n offer.addPropertyToRequest(otherPlayerMap.get(checkBox));\n }\n }\n }\n this.dealOffer = offer;\n \n }", "private void tradeCommand(){\n out.println(\"\\r\\nShares you own:\" +\n \"\\r\\nApple: \" + player.getShares().get(0) +\n \"\\r\\nBP: \" + player.getShares().get(1) +\n \"\\r\\nCisco: \" + player.getShares().get(2) +\n \"\\r\\nDell: \" + player.getShares().get(3) +\n \"\\r\\nEricsson: \" + player.getShares().get(4) +\n \"\\r\\n\\r\\nShare prices: Apple-\" + game.apple.getSharePrice() +\n \", BP-\" + game.bp.getSharePrice() +\n \", Cisco-\" + game.cisco.getSharePrice() +\n \", Dell-\" + game.dell.getSharePrice() +\n \", Ericsson-\" + game.ericsson.getSharePrice() +\n \"\\r\\n\\r\\nFunds: £\" + player.getFunds() + \", Current value of shares: £\" + getTotalShareValue(player) + \"\\r\\n\"\n );\n\n out.println(\"Would you like to buy(b) or sell(s) shares? Enter 'X' to exit.\");\n String bsInput = in.nextLine().trim();\n if (bsInput.toUpperCase().equals(\"B\")){\n getTradeParam(1); //buy\n }else if (bsInput.toUpperCase().equals(\"S\")){\n getTradeParam(0); //sell\n }else if (bsInput.toUpperCase().equals(\"X\")){\n command();\n }else{\n out.println(\"Invalid input\");\n tradeCommand();\n }\n }", "@Override\n public void acceptTrade(boolean willAccept) throws ModelException {\n if (willAccept && !GameModelFacade.instance().canAcceptTrade()) {\n throw new ModelException(\"Preconditions for action not met.\");\n }\n\n IPlayer p = GameModelFacade.instance().getLocalPlayer();\n assert GameModelFacade.instance().getGame().getTradeOffer().getReceiver().equals(p);\n\n try {\n String clientModel = m_theProxy.acceptTrade(p.getIndex(), willAccept);\n new ModelInitializer().initializeClientModel(clientModel, m_theProxy.getPlayerId());\n } catch (NetworkException e) {\n throw new ModelException(e);\n }\n }", "public void isPurchased(Player player) {\n\t}", "public boolean request() {\n\t\tif (inAnySession()) {\n\t\t\tplayer.exchangeSession.reset();\n\t\t\treturn false;\n\t\t}\n\t\t\n if (!PlayerRight.isDeveloper(player) && !PlayerRight.isDeveloper(other)) {\n if (player.playTime < 3000) {\n player.message(\"You cannot trade until you have 30 minutes of playtime. \" + Utility.getTime(3000 - player.playTime) + \" minutes remaining.\");\n return false;\n }\n if (other.playTime < 3000) {\n player.message(other.getName() + \" cannot trade until they have 30 minutes of playtime.\");\n return false;\n }\n }\n\t\t \n\t\tif (getSession(other).isPresent() && getSession(other).get().inAnySession()) {\n\t\t\tplayer.message(\"This player is currently is a \" + type.name + \" with another player.\");\n\t\t\treturn false;\n\t\t}\n\t\tif (Objects.equals(player, other)) {\n\t\t\tplayer.message(\"You cannot \" + type.name + \" with yourself.\");\n\t\t\treturn false;\n\t\t}\n if (PlayerRight.isIronman(player) && !PlayerRight.isDeveloper(other)) {\n player.message(\"You can not \" + type.name + \" as you are an iron man.\");\n return false;\n }\n if (PlayerRight.isIronman(other) && !PlayerRight.isDeveloper(player)) {\n player.message(other.getName() + \" can not be \" + type.name + \"d as they are an iron man.\");\n return false;\n }\n\t\tif (player.exchangeSession.requested_players.contains(other)) {\n\t\t\tplayer.message(\"You have already sent a request to this player.\");\n\t\t\treturn false;\n\t\t}\n\t\tif (player.locking.locked()) {\n\t\t\tplayer.message(\"You cannot send a \" + type.name + \" request right now.\");\n\t\t\treturn false;\n\t\t}\n\t\tif (other.locking.locked()) {\n\t\t\tplayer.message(other.getName() + \" is currently busy.\");\n\t\t\treturn false;\n\t\t}\n\t\tif (player.playerAssistant.busy()) {\n\t\t\tplayer.message(\"Please finish what you are doing before you do that.\");\n\t\t\treturn false;\n\t\t}\n\t\tif (other.playerAssistant.busy()) {\n\t\t\tplayer.message(other.getName() + \" is currently busy.\");\n\t\t\treturn false;\n\t\t}\n\t\tif (player.inActivity(ActivityType.DUEL_ARENA)) {\n\t\t\tplayer.message(\"You can not do that whilst in a duel!\");\n\t\t\treturn false;\n\t\t}\n\t\tif (other.inActivity(ActivityType.DUEL_ARENA)) {\n\t\t\tother.message(\"You can not do that whilst in a duel!\");\n\t\t\treturn false;\n\t\t}\n\t\tif (!onRequest()) {\n\t\t\treturn false;\n\t\t}\n\t\treturn SESSIONS.add(this);\n\t}", "void respondToTrade(long tradeItemId, boolean response);", "@Override\n\tpublic void passedBy() {\n\t\tMonopolyGameController.getInstance();\n\t\tMonopolyGameController.getCurrentPlayer().increaseMoney(250);\n\t\tLogger.getInstance().notifyAll(MonopolyGameController.getCurrentPlayer().getName()+ \" gained 250 dollars by landing on Bonus Square\");\n\n\t}", "public boolean acceptedTradeOffer()\n\t{\n\t\treturn m_isReadyToTrade;\n\t}", "@Override\r\n\tpublic void buyCard() {\n\t\t\r\n\t}", "@ReceiveEvent\n public void onTradeResponse(TradeResponse response, EntityRef entity) {\n if (!entity.equals(localPlayer.getCharacterEntity())) {\n return;\n }\n\n tradingScreen.setMessage(response.message);\n refreshLists();\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}", "public void examine (Player player) {\n\t\tString desc = getType().getDescription()+\" (id=\"+id+\", amount=\"+amount+\")\";\n\t\tplayer.getDispatcher().sendGameMessage(desc);\n\t\tint value = Virtue.getInstance().getExchange().lookupPrice(id);\n\t\tif (value != -1) {\n\t\t\tplayer.getDispatcher().sendGameMessage(\"This item is worth: \"+StringUtility.formatNumber(value)\n\t\t\t\t\t+\"gp on the Grand Exchange.\");\n\t\t}\n\t}", "public void tryDeal() {\n if(previousTie){\n previousTie = false;\n emptyHands();\n shuffle();\n }\n if (player.getBet() < 2) {\n errorFlag = true;\n userMessage = \"You must bet a minimum of $2\";\n return;\n } else if (player.getHand().size() > 0) {\n errorFlag = true;\n userMessage = \"You have already been dealt your initial hand\";\n return;\n } else {\n player.setHand(deal(player.getHand(), 2));\n if (player.getHand().get(0).getValue() == player.getHand().get(1).getValue()) {\n //User can split if they want to\n userMessage = \"Hit, Stand or Split\";\n splitDisabled = false;\n }else{\n userMessage = \"Hit or Stand\";\n }\n dealDisabled = true;\n againDisabled = true;\n doubleDisabled = false;\n standDisabled = false;\n hitDisabled = false;\n bettingDisabled = true;\n }\n }", "public TransactionResponse sell() {\r\n \t\ttry {\r\n \t\t\tTransactionResponse response = new TransactionResponse(hp);\r\n \t\t\tCalculation calc = hc.getCalculation();\r\n \t\t\tAccount acc = hc.getAccount();\r\n \t\t\tLanguageFile L = hc.getLanguageFile();\r\n \t\t\tLog log = hc.getLog();\r\n \t\t\tNotification not = hc.getNotify();\r\n \t\t\tInfoSignHandler isign = hc.getInfoSignHandler();\r\n \t\t\tString playerecon = hp.getEconomy();\r\n \t\t\tint id = hyperObject.getId();\r\n \t\t\tint data = hyperObject.getData();\r\n \t\t\tString name = hyperObject.getName();\r\n \t\t\tif (giveInventory == null) {\r\n \t\t\t\tgiveInventory = hp.getPlayer().getInventory();\r\n \t\t\t}\r\n \t\t\tif (amount > 0) {\r\n \t\t\t\tif (id >= 0) {\r\n \t\t\t\t\tint totalitems = im.countItems(id, data, giveInventory);\r\n \t\t\t\t\tif (totalitems < amount) {\r\n \t\t\t\t\t\tboolean sellRemaining = hc.getYaml().getConfig().getBoolean(\"config.sell-remaining-if-less-than-requested-amount\");\r\n \t\t\t\t\t\tif (sellRemaining) {\r\n \t\t\t\t\t\t\tamount = totalitems;\r\n \t\t\t\t\t\t} else {\t\r\n \t\t\t\t\t\t\tresponse.addFailed(L.f(L.get(\"YOU_DONT_HAVE_ENOUGH\"), name), hyperObject);\r\n \t\t\t\t\t\t\treturn response;\t\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t}\r\n \t\t\t\t\tif (amount > 0) {\r\n \t\t\t\t\t\tdouble price = hyperObject.getValue(amount, hp);\r\n \t\t\t\t\t\tBoolean toomuch = false;\r\n \t\t\t\t\t\tif (price == 3235624645000.7) {\r\n \t\t\t\t\t\t\ttoomuch = true;\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\tif (!toomuch) {\r\n \t\t\t\t\t\t\tint maxi = hyperObject.getMaxInitial();\r\n \t\t\t\t\t\t\tboolean isstatic = false;\r\n \t\t\t\t\t\t\tboolean isinitial = false;\r\n \t\t\t\t\t\t\tisinitial = Boolean.parseBoolean(hyperObject.getInitiation());\r\n \t\t\t\t\t\t\tisstatic = Boolean.parseBoolean(hyperObject.getIsstatic());\r\n \t\t\t\t\t\t\tif ((amount > maxi) && !isstatic && isinitial) {\r\n \t\t\t\t\t\t\t\tamount = maxi;\r\n \t\t\t\t\t\t\t\tprice = hyperObject.getValue(amount, hp);\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\tboolean sunlimited = hc.getYaml().getConfig().getBoolean(\"config.shop-has-unlimited-money\");\r\n \t\t\t\t\t\t\tif (acc.checkshopBalance(price) || sunlimited) {\r\n \t\t\t\t\t\t\t\tif (maxi == 0) {\r\n \t\t\t\t\t\t\t\t\tprice = hyperObject.getValue(amount, hp);\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\tim.removeItems(id, data, amount, giveInventory);\r\n \t\t\t\t\t\t\t\tdouble shopstock = 0;\r\n \t\t\t\t\t\t\t\tshopstock = hyperObject.getStock();\r\n \t\t\t\t\t\t\t\tif (!Boolean.parseBoolean(hyperObject.getIsstatic()) || !hc.getConfig().getBoolean(\"config.unlimited-stock-for-static-items\")) {\r\n \t\t\t\t\t\t\t\t\thyperObject.setStock(shopstock + amount);\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\tint maxi2 = hyperObject.getMaxInitial();\r\n \t\t\t\t\t\t\t\tif (maxi2 == 0) {\r\n \t\t\t\t\t\t\t\t\thyperObject.setInitiation(\"false\");\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\tdouble salestax = hp.getSalesTax(price);\r\n \t\t\t\t\t\t\t\tacc.deposit(price - salestax, hp.getPlayer());\r\n \t\t\t\t\t\t\t\tacc.withdrawShop(price - salestax);\r\n \t\t\t\t\t\t\t\tif (sunlimited) {\r\n \t\t\t\t\t\t\t\t\tString globalaccount = hc.getYaml().getConfig().getString(\"config.global-shop-account\");\r\n \t\t\t\t\t\t\t\t\tacc.setBalance(0, globalaccount);\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\t\r\n \t\t\t\t\t\t\t\tresponse.addSuccess(L.f(L.get(\"SELL_MESSAGE\"), amount, calc.twoDecimals(price), name, calc.twoDecimals(salestax)), price - salestax, hyperObject);\r\n \t\t\t\t\t\t\t\tresponse.setSuccessful();\r\n \t\t\t\t\t\t\t\tString type = \"dynamic\";\r\n \t\t\t\t\t\t\t\tif (Boolean.parseBoolean(hyperObject.getInitiation())) {\r\n \t\t\t\t\t\t\t\t\ttype = \"initial\";\r\n \t\t\t\t\t\t\t\t} else if (Boolean.parseBoolean(hyperObject.getIsstatic())) {\r\n \t\t\t\t\t\t\t\t\ttype = \"static\";\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\tlog.writeSQLLog(hp.getName(), \"sale\", name, (double) amount, calc.twoDecimals(price - salestax), calc.twoDecimals(salestax), playerecon, type);\r\n \t\t\t\t\t\t\t\tisign.updateSigns();\r\n \t\t\t\t\t\t\t\tnot.setNotify(name, null, playerecon);\r\n \t\t\t\t\t\t\t\tnot.sendNotification();\r\n \t\t\t\t\t\t\t\treturn response;\r\n \t\t\t\t\t\t\t} else {\r\n \t\t\t\t\t\t\t\tresponse.addFailed(L.get(\"SHOP_NOT_ENOUGH_MONEY\"), hyperObject);\r\n \t\t\t\t\t\t\t\treturn response;\t\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t} else {\r\n \t\t\t\t\t\t\tresponse.addFailed(L.f(L.get(\"CURRENTLY_CANT_SELL_MORE_THAN\"), hyperObject.getStock(), name), hyperObject);\r\n \t\t\t\t\t\t\treturn response;\t\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t} else {\r\n \t\t\t\t\t\tresponse.addFailed(L.f(L.get(\"YOU_DONT_HAVE_ENOUGH\"), name), hyperObject);\r\n \t\t\t\t\t\treturn response;\t\r\n \t\t\t\t\t}\r\n \t\t\t\t} else {\r\n \t\t\t\t\tresponse.addFailed(L.f(L.get(\"CANNOT_BE_SOLD_WITH\"), name), hyperObject);\r\n \t\t\t\t\treturn response;\t\r\n \t\t\t\t}\r\n \t\t\t} else {\r\n \t\t\t\tresponse.addFailed(L.f(L.get(\"CANT_SELL_LESS_THAN_ONE\"), name), hyperObject);\r\n \t\t\t\treturn response;\t\r\n \t\t\t}\r\n \t\t} catch (Exception e) {\r\n \t\t\tString info = \"Transaction sell() passed values name='\" + hyperObject.getName() + \"', player='\" + hp.getName() + \"', id='\" + hyperObject.getId() + \"', data='\" + hyperObject.getData() + \"', amount='\" + amount + \"'\";\r\n \t\t\tnew HyperError(e, info);\r\n \t\t\treturn new TransactionResponse(hp);\r\n \t\t}\r\n \t}", "public void cancelTradeOffer()\n\t{\n\t\tm_trade.cancelOffer(this);\n\t}", "public void createTrade(String symbol, String fiat, String type, double amount) {\n // Type should be \"sell\" or \"buy\"\n if (!type.equals(\"sell\") && !type.equals(\"buy\"))\n return; // TODO - throw exception here\n\n // Create request object\n JSONObject data = new JSONObject();\n try {\n data.put(\"uuid\", getUUID());\n data.put(\"type\", type);\n data.put(\"fiat_value\", amount);\n data.put(\"fiat\", fiat);\n data.put(\"crypto_symbol\", symbol);\n } catch (JSONException e) {\n return; // TODO - throw exception here\n }\n\n api.createTrade(new VolleyJsonCallback() {\n @Override\n public void onSuccess(JSONObject json) throws JSONException {\n Trade t = new Trade(\n json.getString(\"uuid\"),\n json.getString(\"type\"),\n json.getDouble(\"fiat_value\"),\n json.getString(\"fiat\"),\n json.getDouble(\"crypto_value\"),\n json.getString(\"crypto_symbol\")\n );\n\n user.AddTrade(t);\n\n String typeStr = (type == \"buy\") ? \"Bought \" : \"Sold \";\n String text = typeStr + t.fiat_value + \"€ of \" + t.crypto_symbol;\n Toast.makeText(getApplicationContext(), text, Toast.LENGTH_LONG).show();\n\n // Create notification if enabled and trade is a buy\n if (getNotificationEnabled() && t.type.equals(\"buy\")) {\n Intent intent = new Intent(App.this, UpdateBroadcast.class);\n intent.putExtra(\"symbol\", t.crypto_symbol);\n intent.putExtra(\"fiat_price\", t.fiat_value);\n intent.putExtra(\"crypto_value\", t.crypto_value);\n PendingIntent pendingIntent = PendingIntent.getBroadcast(App.this, 0, intent, 0);\n\n AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);\n\n long currentTime = System.currentTimeMillis();\n //long remindIn = 1000 * 60 * 60; // Remind in this many milliseconds (1h)\n long remindIn = 1000 * 5;\n\n alarmManager.set(AlarmManager.RTC_WAKEUP, currentTime+remindIn, pendingIntent);\n }\n }\n\n @Override\n public void onError(String message) {\n Toast.makeText(getApplicationContext(), message, Toast.LENGTH_LONG).show();\n }\n }, data);\n }", "public void handleLastAcceptedOffer(String participant, long price);", "public void dealerAskCard() {\n int dealerScore = this.getDealerHand().getActualValue();\n while (dealerScore < 17) {\n Card card = this.deck.deal(this.getDealerHand());\n dealerScore = this.getDealerHand().getActualValue();\n }\n }", "@Override\r\n\tpublic void onStartTrading() throws Exception {\n\t\t\r\n\t}", "public static String requestTransfer(Player player, Team playersTeam, double bid, Library library, TransferList existingTransfers) {\n\t\tif (playersTeam.isMax()) {\n\t\t\treturn \"You already have 30 players in your team, this is the maximum. Sell some players before trying to buy any new!\";\n\t\t} else {\n\t\tif (existingTransfers.getTransfer(player)==null) {\n\t\t\tboolean answer = TransferLogic.getAnswer(player, bid, library, existingTransfers);\n\t\t\tif (answer) {\n\t\t\t\tTeam opponentsTeam = library.getTeamForName(player.getTeam());\n\t\t\t\topponentsTeam.deleteIfInCurrentTeam(player);\n//\t\t\t\tif (opponentsTeam.getPositions().contains(player)) {\n//\t\t\t\t\t\n//\t\t\t\t\tboolean itsdone=false;\n//\t\t\t\t\tfor (int i=0;i<opponentsTeam.getTeam().size();i++) {\n//\t\t\t\t\t\tif (!itsdone) {\n//\t\t\t\t\t\t\tPlayer p = opponentsTeam.getTeam().get(i);\n//\t\t\t\t\t\t\tif (p.getPlayerType().equals(player.getPlayerType()) && !(opponentsTeam.getPositions().contains(p))) {\n//\t\t\t\t\t\t\t\topponentsTeam.replacePlayerInCurrentTeam(player, p);\n//\t\t\t\t\t\t\t\titsdone=true;\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t}\n//\t\t\t\t\t}\n//\t\t\t\t\tif (!itsdone) {\n//\t\t\t\t\t\tfor (int i=0;i<opponentsTeam.getTeam().size();i++) {\n//\t\t\t\t\t\t\tif (!itsdone) {\n//\t\t\t\t\t\t\t\tPlayer p = opponentsTeam.getTeam().get(i);\n//\t\t\t\t\t\t\t\tif (((p instanceof FieldPlayer && player instanceof FieldPlayer) || (p instanceof Goalkeeper && player instanceof Goalkeeper)) && !(opponentsTeam.getPositions().contains(p))) {\n//\t\t\t\t\t\t\t\t\topponentsTeam.replacePlayerInCurrentTeam(player, p);\n//\t\t\t\t\t\t\t\t\titsdone=true;\n//\t\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t}\n//\t\t\t\t\t}\n//\t\t\t\t\t\n//\t\t\t\t\t\n//\t\t\t\t}\n\t\t\t\t\n\t\t\t\tplayersTeam.add(player);\n\t\t\t\topponentsTeam.getTeam().remove(player);\n\t\t\t\tplayer.setTeam(playersTeam.getTeamName());\n\t\t\t\tplayersTeam.setBudget(playersTeam.getBudget()-bid);\n\t\t\t\topponentsTeam.setBudget(opponentsTeam.getBudget()+bid);\n\t\t\t\tBigDecimal bbid = new BigDecimal(bid);\n\t\t\t\t\n\t\t\t\t//price string\n\t\t\t\t\n\t\t\t\tDecimalFormat formatter = (DecimalFormat) NumberFormat.getInstance(Locale.US);\n\t\t\t\tbbid = bbid.setScale(2, BigDecimal.ROUND_DOWN);\n\t\t\t\tDecimalFormat df = new DecimalFormat();\n\t\t\t\tdf.setGroupingUsed(false);\t\t\n\t\t\t\tString priceString = formatter.format(bbid.longValue());\n\t\t\t\t\n\t\t\t\t\n\t\t\t\treturn \"Congratulations! Your bid of \" + priceString + \" got accepted and \" + player.getName() + \" is now part of your team\";\n\t\t\t} else {\n\t\t\t\tdouble percentage = bid/player.getPrice().doubleValue()*100-100;\n\t\t\t\tdouble returnedprice=0;\n\t\t\t\tdouble price = player.getPrice().doubleValue();\n\t\t\t\tif (percentage<-10) {\n\t\t\t\t\treturnedprice=0.9*price;\n\t\t\t\t} if (percentage>=-10 && percentage<0) {\n\t\t\t\t\treturnedprice=price;\n\t\t\t\t} if (percentage>=0 && percentage<5) {\n\t\t\t\t\treturnedprice=1.05*price;\n\t\t\t\t} if (percentage>=5 && percentage<10) {\n\t\t\t\t\treturnedprice=1.1*price;\n\t\t\t\t} if (percentage>=10 && percentage<15) {\n\t\t\t\t\treturnedprice=1.15*price;\n\t\t\t\t} if (percentage>=15 && percentage<20) {\n\t\t\t\t\treturnedprice=1.2*price;\n\t\t\t\t} if (percentage>=20 && percentage<25) {\n\t\t\t\t\treturnedprice=1.25*price;\n\t\t\t\t} if (percentage>=25 && percentage<30) {\n\t\t\t\t\treturnedprice=1.3*price;\n\t\t\t\t} \n\t\t\t\t\n\t\t\t\tTransferInProgress tp = new TransferInProgress(player, returnedprice, bid);\n\t\t\t\texistingTransfers.addTransfer(tp);\n\t\t\t\tBigDecimal bbid = new BigDecimal(bid);\n\t\t\t\tBigDecimal breturnedprice = new BigDecimal(returnedprice);\n\t\t\t\t//price string\n\t\t\t\t\n\t\t\t\tDecimalFormat formatter = (DecimalFormat) NumberFormat.getInstance(Locale.US);\n\t\t\t\tbbid = bbid.setScale(2, BigDecimal.ROUND_DOWN);\n\t\t\t\tbreturnedprice = breturnedprice.setScale(2, BigDecimal.ROUND_DOWN);\n\t\t\t\tDecimalFormat df = new DecimalFormat();\n\t\t\t\tdf.setGroupingUsed(false);\t\t\n\t\t\t\tString priceString = formatter.format(bbid.longValue());\n\t\t\t\tString priceString2 = formatter.format(breturnedprice.longValue());\n\t\t\t\treturn player.getTeam() + \" did not accept your offer of \" + priceString + \" for \" + player.getName() + \". They have indicated they want at least \" + priceString2 + \" for this player\";\n\t\t\t\t\n\t\t\t}\n\t\t} else {\n\t\t\tTransferInProgress tp = existingTransfers.getTransfer(player);\n\t\t\tboolean answer = TransferLogic.getAnswerForExistingTransfer(player, bid, library, existingTransfers, tp.getPriceReturned());\n\t\t\tif (answer) {\n\t\t\t\tTeam opponentsTeam = library.getTeamForName(player.getTeam());\n\t\t\t\topponentsTeam.deleteIfInCurrentTeam(player);\n//\t\t\t\tif (opponentsTeam.getPositions().contains(player)) {\n//\t\t\t\t\tboolean itsdone=false;\n//\t\t\t\t\tfor (int i=0;i<opponentsTeam.getTeam().size();i++) {\n//\t\t\t\t\t\tif (!itsdone) {\n//\t\t\t\t\t\t\tPlayer p = opponentsTeam.getTeam().get(i);\n//\t\t\t\t\t\t\tif (p.getPlayerType().equals(player.getPlayerType()) && !(opponentsTeam.getPositions().contains(p))) {\n//\t\t\t\t\t\t\t\topponentsTeam.replacePlayerInCurrentTeam(player, p);\n//\t\t\t\t\t\t\t\titsdone=true;\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t}\n//\t\t\t\t\t}\n//\t\t\t\t\tif (!itsdone) {\n//\t\t\t\t\t\tfor (int i=0;i<opponentsTeam.getTeam().size();i++) {\n//\t\t\t\t\t\t\tif (!itsdone) {\n//\t\t\t\t\t\t\t\tPlayer p = opponentsTeam.getTeam().get(i);\n//\t\t\t\t\t\t\t\tif (((p instanceof FieldPlayer && player instanceof FieldPlayer) || (p instanceof Goalkeeper && player instanceof Goalkeeper)) && !(opponentsTeam.getPositions().contains(p))) {\n//\t\t\t\t\t\t\t\t\topponentsTeam.replacePlayerInCurrentTeam(player, p);\n//\t\t\t\t\t\t\t\t\titsdone=true;\n//\t\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t}\n//\t\t\t\t\t}\n//\t\t\t\t\t\n//\t\t\t\t\t\n//\t\t\t\t}\n\t\t\t\t\n\t\t\t\tplayersTeam.add(player);\n\t\t\t\topponentsTeam.getTeam().remove(player);\n\t\t\t\tplayer.setTeam(playersTeam.getTeamName());\n\t\t\t\texistingTransfers.getTransfers().remove(tp);\n\t\t\t\tplayersTeam.setBudget(playersTeam.getBudget()-bid);\n\t\t\t\topponentsTeam.setBudget(opponentsTeam.getBudget()+bid);\n\t\t\t\tBigDecimal bbid = new BigDecimal(bid);\n\t\t\t\t//price string\n\t\t\t\t\n\t\t\t\tDecimalFormat formatter = (DecimalFormat) NumberFormat.getInstance(Locale.US);\n\t\t\t\tbbid = bbid.setScale(2, BigDecimal.ROUND_DOWN);\n\t\t\t\tDecimalFormat df = new DecimalFormat();\n\t\t\t\tdf.setGroupingUsed(false);\t\t\n\t\t\t\tString priceString = formatter.format(bbid.longValue());\n\t\t\t\treturn \"Congratulations! Your bid of \" + priceString + \" got accepted and \" + player.getName() + \" is now part of your team\";\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tdouble pricereturned = existingTransfers.getTransfer(player).getPriceReturned();\n\t\t\t\t\n\t\t\t\tif (bid>pricereturned) {\n\t\t\t\t\tdouble percentage = bid/player.getPrice().doubleValue()*100-100;\n\t\t\t\t\tdouble returnedprice=0;\n\t\t\t\t\tdouble price = player.getPrice().doubleValue();\n\t\t\t\t\tif (percentage<-10) {\n\t\t\t\t\t\treturnedprice=0.9*price;\n\t\t\t\t\t} if (percentage>=-10 && percentage<0) {\n\t\t\t\t\t\treturnedprice=price;\n\t\t\t\t\t} if (percentage>=0 && percentage<5) {\n\t\t\t\t\t\treturnedprice=1.05*price;\n\t\t\t\t\t} if (percentage>=5 && percentage<10) {\n\t\t\t\t\t\treturnedprice=1.1*price;\n\t\t\t\t\t} if (percentage>=10 && percentage<15) {\n\t\t\t\t\t\treturnedprice=1.15*price;\n\t\t\t\t\t} if (percentage>=15 && percentage<20) {\n\t\t\t\t\t\treturnedprice=1.2*price;\n\t\t\t\t\t} if (percentage>=20 && percentage<25) {\n\t\t\t\t\t\treturnedprice=1.25*price;\n\t\t\t\t\t} if (percentage>=25 && percentage<30) {\n\t\t\t\t\t\treturnedprice=1.3*price;\n\t\t\t\t\t}\n\t\t\t\t\texistingTransfers.getTransfer(player).setPriceReturned(returnedprice);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\texistingTransfers.getTransfer(player).setBid(bid);\n\t\t\t\tBigDecimal bbid = new BigDecimal (bid);\n\t\t\t\tBigDecimal bpriceReturned = new BigDecimal(existingTransfers.getTransfer(player).getPriceReturned());\n\t\t\t\t//price string\n\t\t\t\t\n\t\t\t\tDecimalFormat formatter = (DecimalFormat) NumberFormat.getInstance(Locale.US);\n\t\t\t\tbbid = bbid.setScale(2, BigDecimal.ROUND_DOWN);\n\t\t\t\tbpriceReturned = bpriceReturned.setScale(2, BigDecimal.ROUND_DOWN);\n\t\t\t\tDecimalFormat df = new DecimalFormat();\n\t\t\t\tdf.setGroupingUsed(false);\t\t\n\t\t\t\tString priceString = formatter.format(bbid.longValue());\n\t\t\t\tString priceString2 = formatter.format(bpriceReturned.longValue());\n\t\t\t\treturn player.getTeam() + \" did not accept your offer of \" + priceString + \" for \" + player.getName() + \". They have indicated they want at least \" + priceString2 + \" for this player\";\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}}", "void acceptTrade(boolean accept);", "private void botBuy(Stock stock, int numShares){\n player.getShares().set(game.getIndex(stock), player.getShares().get(game.getIndex(stock)) + numShares);\n player.setFunds(-numShares*(stock.getSharePrice()+3));\n System.out.println(\"purchase made\"); //rem\n }", "@Override\n\tpublic void landedOn() {\n\t\tMonopolyGameController.getInstance();\n\t\tMonopolyGameController.getCurrentPlayer().increaseMoney(300);\n\t\tLogger.getInstance().notifyAll(MonopolyGameController.getCurrentPlayer().getName()+ \" gained 300 dollars by landing on Bonus Square\");\n\t\tMonopolyGameController.allowCurrentPlayerToEndTurn();\n\n\t}", "protected boolean processPlayerOffered(int gameNum, String playerName, String offer){\n return false;\n }", "public void trade(Drop myDrop, User receiver) {\n getInventory().removeDrop(myDrop);\n receiver.getInventory().addDrop(myDrop);\n }", "private void askPlayer() {\n System.out.println(\"Dealers last card is \" + Dealer.showLast());\n System.out.println(\"Your hand is \" + p1.getHand());\n System.out.println(\"Your Hand total is \" + p1.getTotal() + \". Would you like to hit or stand?\");\n\n String s = scan.nextLine();\n System.out.println();\n\n if (s.equalsIgnoreCase(\"hit\")) {\n p1.addToHand(dealCard());\n p1.calcTotal();\n if (p1.getTotal() > 31) {\n System.out.println(\"Your hand is \" + p1.getHand());\n System.out.println(\"Your hand total is \" + p1.getTotal());\n System.out.println(\"You bust, Dealer wins\");\n\n totalWinnings -= betNum;\n p1.subPointCount(betNum);\n bust = true;\n\n System.out.println(\"Total Winnings: \" + totalWinnings + \"\\n\");\n\n } else {\n askPlayer();\n }\n } else {\n System.out.println(\"You stand at \" + p1.getTotal());\n\n while (Dealer.calcTotal() < 26) {\n Dealer.addToHand(dealCard());\n\n }\n System.out.println(\"Dealer's hand is \" + Dealer.getHand());\n System.out.println(\"Dealer's hand total is \" + Dealer.getTotal());\n\n }\n }", "@Override\n \tpublic void handleBettingMarketEndOFSet() {\n \n \t}", "@Override\n public void run() {\n OrderBook.getInstance().addOfferMarketQuote(order);\n }", "public void buyIn(double buyingAmount) {\n if (bankroll > buyingAmount) {\n bankroll -= buyingAmount;\n activePlayer = true;\n }\n }", "public TransactionResponse buyEnchant() {\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 playerecon = hp.getEconomy();\r\n \t\t\tPlayer p = hp.getPlayer();\r\n \t\t\tString nenchant = hyperObject.getMaterial();\r\n \t\t\tEnchantment ench = Enchantment.getByName(nenchant);\r\n \t\t\tint shopstock = 0;\r\n \t\t\tshopstock = (int) hyperObject.getStock();\r\n \t\t\tif (shopstock >= 1) {\r\n \t\t\t\tString mater = p.getItemInHand().getType().toString();\r\n \t\t\t\tdouble price = hyperObject.getCost(EnchantmentClass.fromString(mater));\r\n \t\t\t\tprice = price + hyperObject.getPurchaseTax(price);\r\n \t\t\t\tif (price != 123456789) {\r\n \t\t\t\t\tif (!im.containsEnchantment(p.getItemInHand(), ench)) {\r\n \t\t\t\t\t\tif (acc.checkFunds(price, p)) {\r\n \t\t\t\t\t\t\tif (im.canAcceptEnchantment(p.getItemInHand(), ench) && p.getItemInHand().getAmount() == 1) {\r\n \t\t\t\t\t\t\t\thyperObject.setStock(shopstock - 1);\r\n \t\t\t\t\t\t\t\tacc.withdraw(price, p);\r\n \t\t\t\t\t\t\t\tacc.depositShop(price);\r\n \t\t\t\t\t\t\t\tif (hc.getYaml().getConfig().getBoolean(\"config.shop-has-unlimited-money\")) {\r\n \t\t\t\t\t\t\t\t\tString globalaccount = hc.getYaml().getConfig().getString(\"config.global-shop-account\");\r\n \t\t\t\t\t\t\t\t\tacc.setBalance(0, globalaccount);\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\tint l = hyperObject.getName().length();\r\n \t\t\t\t\t\t\t\tString lev = hyperObject.getName().substring(l - 1, l);\r\n \t\t\t\t\t\t\t\tint level = Integer.parseInt(lev);\r\n \t\t\t\t\t\t\t\tim.addEnchantment(p.getItemInHand(), ench, level);\r\n \t\t\t\t\t\t\t\tboolean stax;\r\n \t\t\t\t\t\t\t\tstax = Boolean.parseBoolean(hyperObject.getIsstatic());\r\n \t\t\t\t\t\t\t\tdouble taxrate;\r\n \t\t\t\t\t\t\t\tif (!stax) {\r\n \t\t\t\t\t\t\t\t\ttaxrate = hc.getYaml().getConfig().getDouble(\"config.enchanttaxpercent\");\r\n \t\t\t\t\t\t\t\t} else {\r\n \t\t\t\t\t\t\t\t\ttaxrate = hc.getYaml().getConfig().getDouble(\"config.statictaxpercent\");\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\tdouble taxpaid = price - (price / (1 + taxrate / 100));\r\n \t\t\t\t\t\t\t\ttaxpaid = calc.twoDecimals(taxpaid);\r\n \t\t\t\t\t\t\t\tprice = calc.twoDecimals(price);\r\n \t\t\t\t\t\t\t\tresponse.addSuccess(L.f(L.get(\"ENCHANTMENT_PURCHASE_MESSAGE\"), 1, price, hyperObject.getName(), calc.twoDecimals(taxpaid)), calc.twoDecimals(price), hyperObject);\r\n \t\t\t\t\t\t\t\tresponse.setSuccessful();\r\n \t\t\t\t\t\t\t\tString type = \"dynamic\";\r\n \t\t\t\t\t\t\t\tif (Boolean.parseBoolean(hyperObject.getInitiation())) {\r\n \t\t\t\t\t\t\t\t\ttype = \"initial\";\r\n \t\t\t\t\t\t\t\t} else if (Boolean.parseBoolean(hyperObject.getIsstatic())) {\r\n \t\t\t\t\t\t\t\t\ttype = \"static\";\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\tlog.writeSQLLog(p.getName(), \"purchase\", hyperObject.getName(), 1.0, price, taxpaid, playerecon, type);\r\n \r\n \t\t\t\t\t\t\t\tisign.updateSigns();\r\n \t\t\t\t\t\t\t\tnot.setNotify(hyperObject.getName(), mater, playerecon);\r\n \t\t\t\t\t\t\t\tnot.sendNotification();\r\n \t\t\t\t\t\t\t} else {\r\n \t\t\t\t\t\t\t\tresponse.addFailed(L.get(\"ITEM_CANT_ACCEPT_ENCHANTMENT\"), hyperObject);\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t} else {\r\n \t\t\t\t\t\t\tresponse.addFailed(L.get(\"INSUFFICIENT_FUNDS\"), hyperObject);\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t} else {\r\n \t\t\t\t\t\tresponse.addFailed(L.get(\"ITEM_ALREADY_HAS_ENCHANTMENT\"), hyperObject);\r\n \t\t\t\t\t}\r\n \t\t\t\t} else {\r\n \t\t\t\t\tresponse.addFailed(L.get(\"ITEM_CANT_ACCEPT_ENCHANTMENT\"), hyperObject);\r\n \t\t\t\t}\r\n \t\t\t} else {\r\n \t\t\t\tresponse.addFailed(L.f(L.get(\"THE_SHOP_DOESNT_HAVE_ENOUGH\"), 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 buyEnchant() 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}", "void addTrade(Trade trade);", "@Override\r\n\t@SuppressWarnings(\"deprecation\")\r\n\tpublic void raiseEvent(Event e) {\r\n\t\tPlayer p = ((PlayerInteractEvent) e).getPlayer();\r\n\t\tPlayerStats stats = plugin.getStats(p);\r\n\t\tif (stats.subtractmoney(cost)) {\r\n\t\t\tif (!items.isEmpty()) {\r\n\t\t\t\tLinkedList<ItemStack> givenItems = new LinkedList<ItemStack>();\r\n\t\t\t\tfor (ItemStack item : items.getItemStacks()) {\r\n\t\t\t\t\tgivenItems.add(item);\r\n\t\t\t\t\tHashMap<Integer, ItemStack> failed = p.getInventory().addItem(item);\r\n\r\n\t\t\t\t\tif (failed != null && failed.size() > 0) {\r\n\t\t\t\t\t\t// the inventory may be full\r\n\t\t\t\t\t\tTribu.messagePlayer(p, (plugin.getLocale(\"Message.UnableToGiveYouThatItem\")),ChatColor.RED);\r\n\t\t\t\t\t\tstats.addMoney(cost);\r\n\t\t\t\t\t\tfor (ItemStack i : givenItems)\r\n\t\t\t\t\t\t\tp.getInventory().remove(i);\r\n\t\t\t\t\t\tgivenItems = null;\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\tp.updateInventory();\r\n\t\t\t\t// Alright\r\n\t\t\t\tTribu.messagePlayer(p,String.format(plugin.getLocale(\"Message.PurchaseSuccessfulMoney\"), String.valueOf(stats.getMoney())),ChatColor.GREEN);\r\n\t\t\t} else {\r\n\t\t\t\tTribu.messagePlayer(p,plugin.getLocale(\"Message.UnknownItem\"),ChatColor.RED);\r\n\t\t\t\tstats.addMoney(cost);\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\tTribu.messagePlayer(p,plugin.getLocale(\"Message.YouDontHaveEnoughMoney\"),ChatColor.RED);\r\n\t\t}\r\n\r\n\t}", "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}", "public void dealerTurn() {\n\t\tview.writeLog(\"All players pass, dealer's turn.\");\n\t\tdealer.send(new Package(\"MESSAGE\",\"Now is your turn.\"));\n\t\tdealer.send(new Package(\"ASK\",null));\n\t}", "public void handleBuyPiranhaCommand() {\n if (Aquarium.money >= PIRANHAPRICE) {\n piranhaController.addNewEntity();\n Aquarium.money -= PIRANHAPRICE;\n }\n }", "private boolean offerCard(Player p) {\n\n //Offer card (take or pass)\n p.sendMessage(\"TAKE OR PASS\");\n\n //Wait until they take the card\n waitForPlayerAction(p, \"TAKE\", \"PASS\");\n\n if(actionChosen.equals(\"TAKE\")) {\n\n giveCard(p);\n return true;\n\n } else if(actionChosen.equals(\"PASS\")) {\n //Don't give card\n\n cList.sendToAll(\"Player \" + p.getUsername() + \" passes\");\n return false;\n }\n\n return false;\n }", "public void testOfferCounterTrade(){\n // starts Trade Detail Activity\n counterTradeActivity = (CounterTradeActivity) getActivity();\n\n // offer a counter trade\n // owner sends counter trade to borrower\n counterTradeActivity.runOnUiThread(new Runnable() {\n @Override\n public void run() {\n Button offerTrade = counterTradeActivity.getCounterTradeButton();\n offerTrade.performClick();\n }\n });\n\n getInstrumentation().waitForIdleSync();\n\n // owner will have a \"pending\" counter trade\n assertTrue(LoginActivity.USERLOGIN.getTrades().get(0).getStatus().equals(\"pending\"));\n }", "public void trade(Player player, Type type, int[] trade) {\n \t\taddResources(type, 1);\n \t\tplayer.useResources(type, 1);\n \n \t\tfor (int i = 0; i < Hexagon.TYPES.length; i++) {\n \t\t\tif (trade[i] <= 0)\n \t\t\t\tcontinue;\n \n \t\t\tuseResources(Hexagon.TYPES[i], trade[i]);\n \t\t\tplayer.addResources(Hexagon.TYPES[i], trade[i]);\n \n \t\t\tfor (int j = 0; j < trade[i]; j++) {\n \t\t\t\tappendAction(R.string.player_traded_away, Hexagon\n \t\t\t\t\t\t.getTypeStringResource(Hexagon.TYPES[i]));\n \t\t\t}\n \t\t}\n \n \t\tappendAction(R.string.player_traded_with, player.getName());\n \t\tappendAction(R.string.player_got_resource, Hexagon\n \t\t\t\t.getTypeStringResource(type));\n \t}", "public void buyItem(Player player, int idz) {\r\n\t\ttry{\r\n\t\tItemDefinitions def = ItemDefinitions.getItemDefinitions(idz);\r\n\t\tif (def == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(!canExchange(idz) || EconomyPrices.getPrice(def.id) <= 5) {\r\n\t\t\r\n\t\t\tplayer.sendMessage(name(idz) + \" are not exchangeable~ or has not been added\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tsendPriceConfigs(player, idz);\r\n\t\tset(player, idz, EconomyPrices.getPrice(def.id), 1);\r\n\r\n\t\t}catch (Exception e){\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "private SpeechletResponse handleTransferMoneyExecute(Session session) {\n\t\treturn null;\n\t}", "public final void give(final Player player) {\n\t\tplayer.getInventory().addItem(this.getItem());\n\t}", "protected void handleBuy(Message m) {\n return;\n }", "public TransactionResponse sellToInventory() {\r\n \t\tTransactionResponse response = new TransactionResponse(hp);\r\n \t\ttry {\r\n \t\t\tDataHandler sf = hc.getDataFunctions();\r\n \t\t\tCalculation calc = hc.getCalculation();\r\n \t\t\tAccount acc = hc.getAccount();\r\n \t\t\tLog log = hc.getLog();\r\n \t\t\tLanguageFile L = hc.getLanguageFile();\r\n \t\t\tString playerecon = tradePartner.getEconomy();\r\n \t\t\tdouble price = 0.0;\r\n \t\t\tif (setPrice) {\r\n \t\t\t\tprice = money;\r\n \t\t\t} else {\r\n \t\t\t\tprice = hyperObject.getValue(amount, hp);\r\n \t\t\t}\r\n \t\t\tBoolean toomuch = false;\r\n \t\t\tif (price == 3235624645000.7) {\r\n \t\t\t\ttoomuch = true;\r\n \t\t\t}\r\n \t\t\tif (!toomuch) {\r\n \t\t\t\tim.removeItems(hyperObject.getId(), hyperObject.getData(), amount, hp.getPlayer().getInventory());\r\n \t\t\t\tim.addItems(amount, hyperObject.getId(), hyperObject.getData(), receiveInventory);\r\n \t\t\t\tacc.deposit(price, hp.getPlayer());\r\n \t\t\t\tacc.withdrawAccount(price, tradePartner.getName());\r\n \t\t\t\tresponse.addSuccess(L.f(L.get(\"SELL_CHEST_MESSAGE\"), amount, calc.twoDecimals(price), hyperObject.getName(), tradePartner.getName()), calc.twoDecimals(price), hyperObject);\r\n \t\t\t\tresponse.setSuccessful();\r\n \t\t\t\tlog.writeSQLLog(hp.getName(), \"sale\", hyperObject.getName(), (double) amount, calc.twoDecimals(price), 0.0, tradePartner.getName(), \"chestshop\");\r\n \t\t\t\ttradePartner.sendMessage(L.f(L.get(\"CHEST_SELL_NOTIFICATION\"), amount, calc.twoDecimals(price), hyperObject.getName(), hp.getPlayer()));\r\n \t\t\t} else {\r\n \t\t\t\tresponse.addFailed(L.f(L.get(\"CURRENTLY_CANT_SELL_MORE_THAN\"), sf.getHyperObject(hyperObject.getName(), playerecon).getStock(), 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 = \"Transaction sellChest() passed values name='\" + hyperObject.getName() + \"', player='\" + hp.getName() + \"', owner='\" + tradePartner.getName() + \"', amount='\" + amount + \"'\";\r\n \t\t\tnew HyperError(e, info);\r\n \t\t\treturn new TransactionResponse(hp);\r\n \t\t}\r\n \t}", "public void handleBuyGuppyCommand() {\n if (Aquarium.money >= GUPPYPRICE) {\n guppyController.addNewEntity();\n Aquarium.money -= GUPPYPRICE;\n }\n }", "protected boolean processPlayerDeclined(int gameNum, String playerName, String offer){\n return false;\n }", "public boolean canTrade()\n\t{\n\t\treturn System.currentTimeMillis() - m_lastTrade > 60 * 1000 && getPartyCount() >= 2;\n\t}", "public String offerTrade(OfferTrade offerTrade) throws Exception {\n\t\tString url = server_url + \"/moves/offerTrade\";\n\t\tURL obj = new URL(url);\n\t\tHttpURLConnection con = (HttpURLConnection) obj.openConnection();\n\n\t\t//add request header\n\t\tcon.setRequestMethod(\"POST\");\n\t\tcon.setRequestProperty(\"User-Agent\", \"Mozilla/5.0\");\n\t\tcon.setRequestProperty(\"Accept-Language\", \"en-US,en;q=0.5\");\n\t\tcon.setRequestProperty(\"Cookie\", usercookie + \"; \" + gamecookie);\n\t\t\n\t\tJsonObject info = new JsonObject();\n\t\tinfo.addProperty(\"type\",\"offerTrade\");\n\t\tinfo.addProperty(\"playerIndex\", offerTrade.playerIndex);\n\t\tinfo.addProperty(\"receiver\", offerTrade.receiverIndex);\n\t\t\n\t\tJsonObject offer = new JsonObject();\n\t\toffer.addProperty(\"wood\", offerTrade.wood);\n\t\toffer.addProperty(\"sheep\", offerTrade.sheep);\n\t\toffer.addProperty(\"ore\", offerTrade.ore);\n\t\toffer.addProperty(\"wheat\", offerTrade.wheat);\n\t\toffer.addProperty(\"brick\", offerTrade.brick);\n\t\tinfo.add(\"offer\", offer);\n\t\t\n\t\t// Send post request\n\t\tcon.setDoOutput(true);\n\t\tDataOutputStream wr = new DataOutputStream(con.getOutputStream());\n\t\twr.writeBytes(info.toString());\n\t\twr.flush();\n\t\twr.close();\n\n\t\tint responseCode = con.getResponseCode();\n\t\t//System.out.println(\"\\nSending 'POST' request to URL : \" + url);\n\t\t//System.out.println(\"Post parameters : \" + info.toString());\n\t\t//System.out.println(\"Response Code : \" + responseCode);\n\n\t\tif (responseCode == 400) {\n\t\t\tthrow new Exception();\n\t\t}\n\t\tBufferedReader in = new BufferedReader(\n\t\t new InputStreamReader(con.getInputStream()));\n\t\tString inputLine;\n\t\tStringBuffer response = new StringBuffer();\n\n\t\twhile ((inputLine = in.readLine()) != null) {\n\t\t\tresponse.append(inputLine);\n\t\t}\n\t\tin.close();\n\t\t\n\t\t//print result\n\t\t////System.out.println(response.toString());\n\t\treturn response.toString();\n\t}", "@Override\n protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent resultIntent) {\n super.onActivityResult(requestCode, resultCode, resultIntent);\n if (requestCode == 1) {\n if (resultCode == Activity.RESULT_OK) {\n int price = resultIntent.getIntExtra(\"Price\", Integer.MAX_VALUE);\n if (playerStats.getPlayerCash() - price >= 0) {\n this.playerStats.subtractPlayerCash(price);\n this.masterDeck.unlockCard(resultIntent.getStringExtra(\"Name\"));\n this.adapter.notifyItemChanged(resultIntent.getIntExtra(\"Position\", -1));\n showCash();\n showCardStats();\n } else {\n Toast.makeText(CardLibraryActivity.this, \"Not enough minerals.\", Toast.LENGTH_SHORT).show();\n }\n }\n }\n }", "protected void processPlayerArrived(String name) {\n Player player = tournamentService.findPlayer(name);\n if (player == null) {\n alertManagers(\"Arriving player {0} is on my notify list, but I don''t have him in the tournament roster.\", name);\n return;\n }\n player.setState(PlayerState.WAITING);\n Game game = tournamentService.findPlayerGame(player);\n if (game == null) return;\n if (game.status.isFinished()) return;\n if (loggingIn) {\n \tcommand.sendCommand(\"observe {0}\", name);\n } else {\n tellManagers(\"{0} arrived. Reserving board {1}.\", name, game.boardNumber);\n }\n command.sendAdminCommand(\"spoof {0} tell JudgeBot nowin\", game.whitePlayer);\n command.sendAdminCommand(\"spoof {0} tell JudgeBot nowin\", game.blackPlayer);\n command.sendAdminCommand(\"set-other {0} kib 0\", game.blackPlayer);\n command.sendAdminCommand(\"set-other {0} kib 0\", game.whitePlayer);\n command.sendAdminCommand(\"reserve-game {0} {1}\", game.whitePlayer, game.boardNumber);\n command.sendAdminCommand(\"reserve-game {0} {1}\", game.blackPlayer, game.boardNumber);\n if (game.status.isAdjourned()) {\n command.sendAdminCommand(\"spoof {0} match {1}\", game.whitePlayer, game.blackPlayer);\n command.sendAdminCommand(\"spoof {0} match {1}\", game.blackPlayer, game.whitePlayer);\n }\n }", "public TradeItemsDialog(GUI gui, Player player) {\n\t\tsuper(gui, \"Trade Items\");\n\t\t\n\t\t// initialize variables and display GUI controls\n\t\tinitiator = player;\n\t\t\t\t\n\t\tloadPlayerPanel(initiator);\n\t\t\n\t\tc.gridx = 1;\n\t\tc.gridy = 1;\n\t\t// Load list of other players into a drop down box.\n\t\tLinkedList<Player> players = new LinkedList<Player>();\n\t\tplayers.addAll(GM.getPlayers());\n\t\tplayers.remove(initiator);\n\t\tfinal JComboBox playerBox = new JComboBox(players.toArray());\n\t\tplayerBox.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(Color.BLACK), \"Trade With\"));\n\t\tplayerBox.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\t// display selected player's items for trade\n\t\t\t\tloadPlayerPanel((Player)playerBox.getSelectedItem());\n\t\t\t}\t\n\t\t});\n\t\tgetContentPane().add(playerBox, c);\n\t\tplayerBox.setSelectedIndex(0);\n\t\t\n\t\tc.gridx = 1;\n\t\tc.gridy = 2;\n\t\t// allows player to request a trade of the selected items\n\t\tCustomButton tradeButton = new CustomButton(\"Trade\") {\n\t\t\tprivate static final long serialVersionUID = 1L;\n\t\t\t\n\t\t\tpublic void buttonPressed() {\n\t\t\t\tPlayer otherPlayer = (Player)playerBox.getSelectedItem();\n\t\t\t\tLinkedList<Card> initiatorCheckedItems = initiatorPanel.getCheckedCards();\n\t\t\t\tLinkedList<Card> otherPlayerCheckedItems = otherPlayerPanel.getCheckedCards();\n\t\t\t\t\n\t\t\t\tif (initiatorCheckedItems.isEmpty() && otherPlayerCheckedItems.isEmpty())\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\tif (otherPlayer.isComputer()) {\n\t\t\t\t\tif (!willComputerTrade(initiatorCheckedItems, otherPlayerCheckedItems, otherPlayer)) {\n\t\t\t\t\t\tif (!initiator.isComputer()) {\n\t\t\t\t\t\t\tString message = otherPlayer.toString();\n\t\t\t\t\t\t\tif (otherPlayer.getPlayerType() == PlayerType.COMPUTER_EASY)\n\t\t\t\t\t\t\t\tmessage += \" politely declines your offer.\";\n\t\t\t\t\t\t\telse if (otherPlayer.getPlayerType() == PlayerType.COMPUTER_MEDIUM)\n\t\t\t\t\t\t\t\tmessage += \" feels that this trade is not in his best interests.\";\n\t\t\t\t\t\t\telse if (otherPlayer.getPlayerType() == PlayerType.COMPUTER_HARD)\n\t\t\t\t\t\t\t\tmessage += \" spits on your offer and tells you to go trade for some brains.\";\n\t\t\t\t\t\t\tMessenger.display(message, \"Trade Items\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\telse if (!initiator.isComputer()) {\n\t\t\t\t\t\tString message = otherPlayer.toString();\n\t\t\t\t\t\tif (otherPlayer.getPlayerType() == PlayerType.COMPUTER_EASY)\n\t\t\t\t\t\t\tmessage += \" gladly accepts your generous offer.\";\n\t\t\t\t\t\telse if (otherPlayer.getPlayerType() == PlayerType.COMPUTER_MEDIUM)\n\t\t\t\t\t\t\tmessage += \" decides the trade is acceptable.\";\n\t\t\t\t\t\telse if (otherPlayer.getPlayerType() == PlayerType.COMPUTER_HARD)\n\t\t\t\t\t\t\tmessage += \" laughs maniacally, greedily accepts, and whispers \\\"Sucker!\\\".\";\n\t\t\t\t\t\tMessenger.display(message, \"Trade Items\");\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\t\t\t\t\n\t\t\t\t\t// Allows other player to accept or decline the trade\n\t\t\t\t\tString prompt = otherPlayer.getName() + \", do you accept this trade?\";\n\t\t\t\t\tint result = JOptionPane.showConfirmDialog(null, prompt, \"Trade Items\", JOptionPane.YES_NO_OPTION);\n\t\t\t\t\tif (result != JOptionPane.YES_OPTION)\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Takes cards from each player and gives them to the other.\n\t\t\t\tIterator<Card> itemIter = initiatorCheckedItems.iterator();\n\t\t\t\twhile (itemIter.hasNext()) {\n\t\t\t\t\tCard item = itemIter.next();\n\t\t\t\t\tif (!initiator.removeEquipmentItem(item))\n\t\t\t\t\t\tinitiator.getCarriedItems().remove(item);\t\t\t\t\t\t\n\t\t\t\t\tif (initiator.isCheatingItem(item))\n\t\t\t\t\t\tinitiator.removeCheat();\n\t\t\t\t\t\n\t\t\t\t\totherPlayer.addItem((TreasureCard)item);\n\t\t\t\t}\n\t\t\t\titemIter = otherPlayerCheckedItems.iterator();\n\t\t\t\twhile (itemIter.hasNext()) {\n\t\t\t\t\tCard item = itemIter.next();\n\t\t\t\t\tif (!otherPlayer.removeEquipmentItem(item))\n\t\t\t\t\t\totherPlayer.getCarriedItems().remove(item);\t\n\t\t\t\t\tif (otherPlayer.isCheatingItem(item))\n\t\t\t\t\t\totherPlayer.removeCheat();\n\t\t\t\t\t\n\t\t\t\t\tinitiator.addItem((TreasureCard)item);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tloadPlayerPanel(initiator);\n\t\t\t\tloadPlayerPanel(otherPlayer);\n\t\t\t}\n\t\t};\n\t\tgetContentPane().add(tradeButton, c);\n\t\t\t\t\n\t\tc.gridy = 3;\n\t\tc.gridx = 0;\n\t\tc.gridwidth = 3;\n\t\t// display warning about restrictions on Big Items\n\t\tgetContentPane().add(new JLabel(\"WARNING: If you trade for a Big Item that you cannot carry, it will be discarded!\"), c);\n\t\tc.gridwidth = 1;\n\t\t\n\t\trefresh();\n\t}", "public static void proposeTrade(League theLeague, Team theTeam, Scanner keyboard) {\r\n\t\tSystem.out.println(\"\");\r\n\t\tSystem.out.println(\"---Propose Trade---\");\r\n\t\tfor (int x = 0; x < theLeague.getNumTeams(); x++) {\r\n\t\t\tif (!theLeague.getTeam(x).equals(theTeam)) {\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t\tSystem.out.println(\"Team number: \" + (x + 1));\r\n\t\t\t\ttheLeague.getTeam(x).teamManNameToString();\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"\");\r\n\t\tSystem.out.println(\"Select a team to view:\");\r\n\t\t\r\n\t\tint otherTeamChoice;\r\n\t\tdo {\r\n\t\t\totherTeamChoice = Input.validInt(1, theLeague.getNumTeams(), keyboard) - 1;\r\n\t\t} while (otherTeamChoice == theLeague.getTeamList().indexOf(theTeam));\r\n\t\tTeam otherTeam = theLeague.getTeam(otherTeamChoice);\r\n\r\n\t\tSystem.out.println(\"\");\r\n\t\tSystem.out.println(\"---Propose Trade---\");\r\n\t\tSystem.out.println(\"\");\r\n\t\totherTeam.teamToString();\r\n\t\tSystem.out.println(\"\");\r\n\t\tSystem.out.println(\"Would you like to propose a trade to this team?\");\r\n\t\tSystem.out.println(\"1 - Yes\");\r\n\t\tSystem.out.println(\"2 - No, Return to Team Menu\");\r\n\t\t\r\n\t\tif (Input.validInt(1, 2, keyboard) == 1) {\r\n\t\t\tSystem.out.println(\"\");\r\n\t\t\tSystem.out.println(\"Enter your trade offer (max 64 characters):\");\r\n\t\t\tSystem.out.println(\"0 - Return to Team Menu\");\r\n\t\t\tString proposal = Input.validString(32, keyboard);\r\n\t\t\tif (proposal.equals(\"0\")) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\totherTeam.setProposedTrade(theTeam.getManagerName() + \": \" + proposal);\r\n\t\t\tSystem.out.println(\"\");\r\n\t\t\tSystem.out.println(\"***You have proposed a trade:***\");\r\n\t\t\tSystem.out.println(\"To \" + otherTeam.getManagerName() + \": \" + proposal);\r\n\t\t}\r\n\t}", "public void becomePremium() {\n\t\tif (this.account >= 100 && this.premium == false) {\n\t\t\tthis.account -= 100;\n\t\t\tthis.premium = true;\n\t\t\tSystem.out.println(\"Premium transaction successful\");\n\n\t\t} else if (this.premium == true) {\n\t\t\tSystem.out.println(\"They are already a premium user!\");\n\n\t\t} else {\n\t\t\tSystem.err.println(\n\t\t\t\t\t\"Error - not enough funds in account.\\nPremium charge is $100\\nBalance: $\" + this.getBalance() + \"\\nPlease top up account manually.\\nReturning to main menu.\");\n\t\t}\n\t}", "@Override\n public void summonHorsesToPaddock(){\n rl.lock();\n try{\n System.out.println(\"B : Trying to summon horse...\");\n //change broker state\n// MyThreadBroker broker = (MyThreadBroker) Thread.currentThread();\n// broker.broker_states = MyThreadBroker.Broker_States.ANNOUNCING_NEXT_RACE;\n //change log\n log.setBrokerState(MyThreadBroker.Broker_States.ANNOUNCING_NEXT_RACE);\n log.changeLog();\n keep_waiting = false;\n stable_horses.signal(); \n }finally{\n rl.unlock();\n }\n \n }", "@Override\n\tpublic void payCrew() {\n\t\tSystem.out.println(\"Crew paid!, You can start sailing now!\");\n\t\tgame.loading();\n\t}", "boolean canAcceptTrade();", "void givePlayerExp(BPlayer bPlayer, int exp);", "public int addPlayer(String name) {\n\t\tUser user = users.get(userTurn);\n\t\tFootballPlayer player = market.findPlayer(name);\n\t\tdouble marketValue = player.getMarketValue();\n\t\tSystem.out.println(\"budget before buy\" + user.getBudget());\n\t\t\n\t\tif(tmpTeam.containsPlayer(name)) {\n\t\t\treturn 1;\n\t\t} \n\t\telse if(user.hasEnoughBudget(marketValue)) {\n\t\t\ttmpTeam.addPlayer(name, player);\n\t\t\tuser.updateBudget(marketValue, \"-\");\n\t\t\tSystem.out.println(\"budget \" + user.getBudget());\n\t\t\tSystem.out.println(\"marketvalue \" +marketValue);\n\t\t\tSystem.out.println(\"budget after buy\" + user.getBudget());\n\t\t\treturn 0;\n\t\t}\n\t\treturn -1;\n\t}", "public TransactionResponse buyEnchantFromItem() {\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\ttry {\r\n \t\t\tPlayer p = hp.getPlayer();\r\n \t\t\tString nenchant = \"\";\r\n \t\t\tnenchant = hyperObject.getMaterial();\r\n \t\t\tEnchantment ench = Enchantment.getByName(nenchant);\r\n \t\t\tString mater = p.getItemInHand().getType().toString();\r\n \t\t\tdouble price = hyperObject.getValue(EnchantmentClass.fromString(mater));\r\n \t\t\tif (price != 123456789) {\r\n \t\t\t\tif (!im.containsEnchantment(p.getItemInHand(), ench)) {\r\n \t\t\t\t\tif (im.canAcceptEnchantment(p.getItemInHand(), ench) && p.getItemInHand().getAmount() == 1) {\r\n \t\t\t\t\t\tif (acc.checkFunds(price, p)) {\r\n \t\t\t\t\t\t\tacc.withdraw(price, p);\r\n \t\t\t\t\t\t\tacc.depositAccount(price, tradePartner.getName());\r\n \t\t\t\t\t\t\tint l = hyperObject.getName().length();\r\n \t\t\t\t\t\t\tString lev = hyperObject.getName().substring(l - 1, l);\r\n \t\t\t\t\t\t\tint level = Integer.parseInt(lev);\r\n \t\t\t\t\t\t\tim.addEnchantment(p.getItemInHand(), ench, level);\r\n \t\t\t\t\t\t\tim.removeEnchantment(giveItem, ench);\r\n \t\t\t\t\t\t\tprice = calc.twoDecimals(price);\r\n \t\t\t\t\t\t\tresponse.addSuccess(L.f(L.get(\"PURCHASE_ENCHANTMENT_CHEST_MESSAGE\"), 1, calc.twoDecimals(price), hyperObject.getName(), tradePartner.getName()), calc.twoDecimals(price), hyperObject);\r\n \t\t\t\t\t\t\tresponse.setSuccessful();\r\n \t\t\t\t\t\t\tlog.writeSQLLog(p.getName(), \"purchase\", hyperObject.getName(), 1.0, price, 0.0, tradePartner.getName(), \"chestshop\");\r\n \t\t\t\t\t\t\ttradePartner.sendMessage(L.f(L.get(\"CHEST_ENCHANTMENT_BUY_NOTIFICATION\"), 1, calc.twoDecimals(price), hyperObject.getName(), p));\r\n \t\t\t\t\t\t} else {\r\n \t\t\t\t\t\t\tresponse.addFailed(L.get(\"INSUFFICIENT_FUNDS\"), hyperObject);\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t} else {\r\n \t\t\t\t\t\tresponse.addFailed(L.get(\"ITEM_CANT_ACCEPT_ENCHANTMENT\"), hyperObject);\r\n \t\t\t\t\t}\r\n \t\t\t\t} else {\r\n \t\t\t\t\tresponse.addFailed(L.get(\"ITEM_ALREADY_HAS_ENCHANTMENT\"), hyperObject);\r\n \t\t\t\t}\r\n \t\t\t} else {\r\n \t\t\t\tresponse.addFailed(L.get(\"ITEM_CANT_ACCEPT_ENCHANTMENT\"), 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 buyChestEnchant() passed values name='\" + hyperObject.getName() + \"', player='\" + hp.getName() + \"', owner='\" + tradePartner.getName() + \"'\";\r\n \t\t\tnew HyperError(e, info);\r\n \t\t\treturn new TransactionResponse(hp);\r\n \t\t}\r\n \t}", "@Override\n\t\t\t\t\t public void visit(Player player) {\n\t\t\t\t\t\t\tPacketSendUtility.sendPacket(player, SM_SYSTEM_MESSAGE.STR_MSG_HF_ShugoCaravanAppear);\n\t\t\t\t\t }", "@Override\r\n\t\tpublic void action() {\n MessageTemplate mt = MessageTemplate.MatchPerformative(ACLMessage.ACCEPT_PROPOSAL);\r\n MessageTemplate mt2 = MessageTemplate.MatchPerformative(ACLMessage.PROPOSE);\r\n ACLMessage msg = myAgent.receive(mt);\r\n //If it is a ACCEPT_PROPOSAL, the seller sell the book to the buyer (execpt if the book if not here anymore)\r\n if (msg != null) {\r\n // ACCEPT_PROPOSAL Message received. Process it\r\n title = msg.getContent();\r\n ACLMessage reply = msg.createReply();\r\n\r\n Integer price = (Integer) catalogue.remove(title);\r\n if (price != null) {\r\n reply.setPerformative(ACLMessage.INFORM);\r\n reply.setContent(String.valueOf(price));\r\n System.out.println(title+\" sold to agent \"+msg.getSender().getName());\r\n }\r\n else {\r\n // The requested book has been sold to another buyer in the meanwhile .\r\n reply.setPerformative(ACLMessage.FAILURE);\r\n reply.setContent(\"not-available\");\r\n }\r\n myAgent.send(reply);\r\n }\r\n //If it is a new PROPOSE, the buyer is trying to negociate.\r\n else {\r\n ACLMessage msg2 = myAgent.receive(mt2);\r\n if(msg2 != null){\r\n ACLMessage reply = msg2.createReply();\r\n //If the price of the buyer is OK for the seller according to his tolerance, the transaction is made\r\n if(((Integer) catalogue.get(title) - Integer.parseInt(msg2.getContent())) <= tolerance){\r\n System.out.println(myAgent.getLocalName() + \" say : OK, let's make a deal\");\r\n updateCatalogue(title, Integer.parseInt(msg2.getContent()));\r\n reply.setPerformative(ACLMessage.INFORM);\r\n reply.setContent(msg2.getContent());\r\n }\r\n //Else, the seller accept to negociate, he up his tolerance and ask the buyer to up his real price\r\n else{\r\n //Send a REQUEST Message to negociate with the buyer\r\n reply.setPerformative(ACLMessage.REQUEST);\r\n //Up the tolerance by *change*\r\n tolerance += change;\r\n reply.setContent(String.valueOf(change));\r\n System.out.println(myAgent.getLocalName() + \" say : Let's up your real price while I up my tolerance (\" + ((Integer) catalogue.get(title) - Integer.parseInt(msg2.getContent())) + \" < \" + tolerance + \")\");\r\n }\r\n myAgent.send(reply);\r\n }\r\n else{\r\n block();\r\n }\r\n }\r\n\t\t}", "public TransactionResponse buyXP() {\r\n \t\tTransactionResponse response = new TransactionResponse(hp);\r\n \t\ttry {\r\n \t\t\tCalculation calc = hc.getCalculation();\r\n \t\t\tAccount acc = hc.getAccount();\r\n \t\t\tLanguageFile L = hc.getLanguageFile();\r\n \t\t\tLog log = hc.getLog();\r\n \t\t\tNotification not = hc.getNotify();\r\n \t\t\tInfoSignHandler isign = hc.getInfoSignHandler();\r\n \t\t\tString playerecon = hp.getEconomy();\r\n \t\t\tif (amount > 0) {\r\n \t\t\t\tint shopstock = 0;\r\n \t\t\t\tshopstock = (int) hyperObject.getStock();\r\n \t\t\t\tif (shopstock >= amount) {\r\n \t\t\t\t\tdouble price = hyperObject.getCost(amount);\r\n \t\t\t\t\tdouble taxpaid = hyperObject.getPurchaseTax(price);\r\n \t\t\t\t\tprice = calc.twoDecimals(price + taxpaid);\r\n \t\t\t\t\tif (acc.checkFunds(price, hp.getPlayer())) {\r\n \t\t\t\t\t\tint totalxp = im.gettotalxpPoints(hp.getPlayer());\r\n \t\t\t\t\t\tint newxp = totalxp + amount;\r\n \t\t\t\t\t\tint newlvl = im.getlvlfromXP(newxp);\r\n \t\t\t\t\t\tnewxp = newxp - im.getlvlxpPoints(newlvl);\r\n \t\t\t\t\t\tfloat xpbarxp = (float) newxp / (float) im.getxpfornextLvl(newlvl);\r\n \t\t\t\t\t\thp.getPlayer().setLevel(newlvl);\r\n \t\t\t\t\t\thp.getPlayer().setExp(xpbarxp);\r\n \t\t\t\t\t\tif (!Boolean.parseBoolean(hyperObject.getIsstatic()) || !hc.getConfig().getBoolean(\"config.unlimited-stock-for-static-items\")) {\r\n \t\t\t\t\t\t\thyperObject.setStock(shopstock - amount);\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\tacc.withdraw(price, hp.getPlayer());\r\n \t\t\t\t\t\tacc.depositShop(price);\r\n \t\t\t\t\t\tif (hc.getYaml().getConfig().getBoolean(\"config.shop-has-unlimited-money\")) {\r\n \t\t\t\t\t\t\tString globalaccount = hc.getYaml().getConfig().getString(\"config.global-shop-account\");\r\n \t\t\t\t\t\t\tacc.setBalance(0, globalaccount);\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\tresponse.addSuccess(L.f(L.get(\"PURCHASE_MESSAGE\"), amount, calc.twoDecimals(price), hyperObject.getName(), calc.twoDecimals(taxpaid)), calc.twoDecimals(price), hyperObject);\r\n \t\t\t\t\t\tresponse.setSuccessful();\r\n \t\t\t\t\t\tString type = \"dynamic\";\r\n \t\t\t\t\t\tif (Boolean.parseBoolean(hyperObject.getInitiation())) {\r\n \t\t\t\t\t\t\ttype = \"initial\";\r\n \t\t\t\t\t\t} else if (Boolean.parseBoolean(hyperObject.getIsstatic())) {\r\n \t\t\t\t\t\t\ttype = \"static\";\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\tlog.writeSQLLog(hp.getName(), \"purchase\", hp.getName(), (double) amount, calc.twoDecimals(price), calc.twoDecimals(taxpaid), playerecon, type);\r\n \t\t\t\t\t\tisign.updateSigns();\r\n \t\t\t\t\t\tnot.setNotify(hyperObject.getName(), null, playerecon);\r\n \t\t\t\t\t\tnot.sendNotification();\r\n \t\t\t\t\t} else {\r\n \t\t\t\t\t\tresponse.addFailed(L.get(\"INSUFFICIENT_FUNDS\"), hyperObject);\r\n \t\t\t\t\t}\r\n \t\t\t\t} else {\r\n \t\t\t\t\tresponse.addFailed(L.f(L.get(\"THE_SHOP_DOESNT_HAVE_ENOUGH\"), hyperObject.getName()), hyperObject);\r\n \t\t\t\t}\r\n \t\t\t} else {\r\n \t\t\t\tresponse.addFailed(L.f(L.get(\"CANT_BUY_LESS_THAN_ONE\"), 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 = \"Transaction buyXP() passed values name='\" + hyperObject.getName() + \"', player='\" + hp.getName() + \"', amount='\" + amount + \"'\";\r\n \t\t\tnew HyperError(e, info);\r\n \t\t\treturn new TransactionResponse(hp);\r\n \t\t}\r\n \t}", "public void call(int player)\r\n\t{\r\n\t\tint bet=maxBet-playerBet[player];\r\n\t\tif(bet>accountValue[player])System.out.println(\"cos\");//tu powino wyjatek rzucac \r\n\t\telse\r\n\t\t{\r\n\t\t\taccountValue[player]=accountValue[player]-bet;\r\n\t\t\tplayerBet[player]+=bet;\r\n\t\t\tpool+=bet;\r\n\t\t}\r\n\t}", "@Override\r\n public void pay() {\n }", "public abstract void onContribution(int amount, Player player);", "public TransactionResponse sellXP() {\r\n \t\tTransactionResponse response = new TransactionResponse(hp);\r\n \t\ttry {\r\n \t\t\tDataHandler sf = hc.getDataFunctions();\r\n \t\t\tCalculation calc = hc.getCalculation();\r\n \t\t\tAccount acc = hc.getAccount();\r\n \t\t\tLanguageFile L = hc.getLanguageFile();\r\n \t\t\tLog log = hc.getLog();\r\n \t\t\tNotification not = hc.getNotify();\r\n \t\t\tInfoSignHandler isign = hc.getInfoSignHandler();\r\n \t\t\tString playerecon = hp.getEconomy();\r\n \t\t\tif (amount > 0) {\r\n \t\t\t\tint totalxp = im.gettotalxpPoints(hp.getPlayer());\r\n \t\t\t\tif (totalxp >= amount) {\r\n \t\t\t\t\tdouble price = hyperObject.getValue(amount, hp);\r\n \t\t\t\t\tBoolean toomuch = false;\r\n \t\t\t\t\tif (price == 3235624645000.7) {\r\n \t\t\t\t\t\ttoomuch = true;\r\n \t\t\t\t\t}\r\n \t\t\t\t\tif (!toomuch) {\r\n \t\t\t\t\t\tint maxi = hyperObject.getMaxInitial();\r\n \t\t\t\t\t\tboolean itax;\r\n \t\t\t\t\t\tboolean stax;\r\n \t\t\t\t\t\titax = Boolean.parseBoolean(hyperObject.getInitiation());\r\n \t\t\t\t\t\tstax = Boolean.parseBoolean(hyperObject.getIsstatic());\r\n \t\t\t\t\t\tif (amount > (maxi) && !stax && itax) {\r\n \t\t\t\t\t\t\tamount = maxi;\r\n \t\t\t\t\t\t\tprice = hyperObject.getValue(amount, hp);\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\tboolean sunlimited = hc.getYaml().getConfig().getBoolean(\"config.shop-has-unlimited-money\");\r\n \t\t\t\t\t\tif (acc.checkshopBalance(price) || sunlimited) {\r\n \t\t\t\t\t\t\tif (maxi == 0) {\r\n \t\t\t\t\t\t\t\tprice = hyperObject.getValue(amount, hp);\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\tint newxp = totalxp - amount;\r\n \t\t\t\t\t\t\tint newlvl = im.getlvlfromXP(newxp);\r\n \t\t\t\t\t\t\tnewxp = newxp - im.getlvlxpPoints(newlvl);\r\n \t\t\t\t\t\t\tfloat xpbarxp = (float) newxp / (float) im.getxpfornextLvl(newlvl);\r\n \t\t\t\t\t\t\thp.getPlayer().setLevel(newlvl);\r\n \t\t\t\t\t\t\thp.getPlayer().setExp(xpbarxp);\r\n \t\t\t\t\t\t\tif (!Boolean.parseBoolean(hyperObject.getIsstatic()) || !hc.getConfig().getBoolean(\"config.unlimited-stock-for-static-items\")) {\r\n \t\t\t\t\t\t\t\thyperObject.setStock(amount + hyperObject.getStock());\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\tint maxi2 = hyperObject.getMaxInitial();\r\n \t\t\t\t\t\t\tif (maxi2 == 0) {\r\n \t\t\t\t\t\t\t\thyperObject.setInitiation(\"false\");\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\tdouble salestax = hp.getSalesTax(price);\r\n \t\t\t\t\t\t\tacc.deposit(price - salestax, hp.getPlayer());\r\n \t\t\t\t\t\t\tacc.withdrawShop(price - salestax);\r\n \t\t\t\t\t\t\tif (sunlimited) {\r\n \t\t\t\t\t\t\t\tString globalaccount = hc.getYaml().getConfig().getString(\"config.global-shop-account\");\r\n \t\t\t\t\t\t\t\tacc.setBalance(0, globalaccount);\r\n \t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tresponse.addSuccess(L.f(L.get(\"SELL_MESSAGE\"), amount, calc.twoDecimals(price), hyperObject.getName(), calc.twoDecimals(price - salestax)), calc.twoDecimals(price), hyperObject);\r\n \t\t\t\t\t\t\tresponse.setSuccessful();\r\n \t\t\t\t\t\t\tString type = \"dynamic\";\r\n \t\t\t\t\t\t\tif (Boolean.parseBoolean(hyperObject.getInitiation())) {\r\n \t\t\t\t\t\t\t\ttype = \"initial\";\r\n \t\t\t\t\t\t\t} else if (Boolean.parseBoolean(hyperObject.getIsstatic())) {\r\n \t\t\t\t\t\t\t\ttype = \"static\";\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\tlog.writeSQLLog(hp.getName(), \"sale\", hyperObject.getName(), (double) amount, calc.twoDecimals(price - salestax), calc.twoDecimals(salestax), playerecon, type);\r\n \r\n \t\t\t\t\t\t\tisign.updateSigns();\r\n \t\t\t\t\t\t\tnot.setNotify(hyperObject.getName(), null, playerecon);\r\n \t\t\t\t\t\t\tnot.sendNotification();\r\n \t\t\t\t\t\t} else {\r\n \t\t\t\t\t\t\tresponse.addFailed(L.get(\"SHOP_NOT_ENOUGH_MONEY\"), hyperObject);\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t} else {\r\n \t\t\t\t\t\tresponse.addFailed(L.f(L.get(\"CURRENTLY_CANT_SELL_MORE_THAN\"), sf.getHyperObject(hyperObject.getName(), playerecon).getStock(), hyperObject.getName()), hyperObject);\r\n \t\t\t\t\t}\r\n \t\t\t\t} else {\r\n \t\t\t\t\tresponse.addFailed(L.f(L.get(\"YOU_DONT_HAVE_ENOUGH\"), hyperObject.getName()), hyperObject);\r\n \t\t\t\t}\r\n \t\t\t} else {\r\n \t\t\t\tresponse.addFailed(L.f(L.get(\"CANT_SELL_LESS_THAN_ONE\"), 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 = \"Transaction sellXP() passed values name='\" + hyperObject.getName() + \"', player='\" + hp.getName() + \"', amount='\" + amount + \"'\";\r\n \t\t\tnew HyperError(e, info);\r\n \t\t\treturn new TransactionResponse(hp);\r\n \t\t}\r\n \t}", "@Override\n\t\t\tpublic void action() {\n\t\t\t\tMessageTemplate cfpTemplate = MessageTemplate.MatchPerformative(ACLMessage.CFP);\n\t\t\t\tMessageTemplate informTemplate = MessageTemplate.MatchPerformative(ACLMessage.INFORM);\n\t\t\t\tMessageTemplate messageTemplate = MessageTemplate.or(cfpTemplate, informTemplate);\n\t\t\t\tACLMessage receivedMessage = myAgent.receive(messageTemplate);\n\t\t\t\t\n\t\t\t\tif (receivedMessage != null) {\n\t\t\t\t\thasReceivedMessage = true;\n\t\t\t\t\t\n\t\t\t\t\tif (receivedMessage.getPerformative() == ACLMessage.CFP) {\n\t\t\t\t\t\tdouble price = Double.parseDouble(receivedMessage.getContent());\n\t\t\t\t\t\tSystem.out.println(\"Buyer [\" + getAID().getLocalName() + \"] received \"\n\t\t\t\t\t\t\t\t+ \"CFP with price \" + Double.toString(price));\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Value in range; send proposal\n\t\t\t\t\t\tif (price <= priceToBuy) {\n\t\t\t\t\t\t\tACLMessage proposal = new ACLMessage(ACLMessage.PROPOSE);\n\t\t\t\t\t\t\tproposal.addReceiver(receivedMessage.getSender());\n\t\t\t\t\t\t\tproposal.setProtocol(receivedMessage.getProtocol());\n\t\t\t\t\t\t\tmyAgent.send(proposal);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\ttransitionStatus = sendProposal;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Price too high; refuse and wait for new CFP\n\t\t\t\t\t\t\tACLMessage refusal = new ACLMessage(ACLMessage.REFUSE);\n\t\t\t\t\t\t\trefusal.addReceiver(receivedMessage.getSender());\n\t\t\t\t\t\t\trefusal.setProtocol(receivedMessage.getProtocol());\n\t\t\t\t\t\t\tmyAgent.send(refusal);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\ttransitionStatus = highPrice;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (receivedMessage.getPerformative() == ACLMessage.INFORM) {\n\t\t\t\t\t\ttransitionStatus = noBuyers;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tblock();\n\t\t\t\t}\n\t\t\t}", "@Override\n public void onTake(@Nonnull Player player, @Nonnull ItemStack stack) {\n super.onTake(player, stack);\n }", "public void onBetPlaced(Bet bet);", "@Override\n public void sell() {\n }", "public boolean recordTrade(Trade trade) throws Exception;", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t\teHp -= player.Attack();\n\t\t\t\t\tpHp -= player.Attack();\n\t\t\t\t\tif (pHp <= 0){\n\t\t\t\t\t\t\n\t\t\t\t\t\t// losing message\n\t\t\t\t\t\tContext context = getApplicationContext();\n\t\t\t\t\t\tToast toast = Toast.makeText(context, \"Aww...You Lost\", Toast.LENGTH_SHORT);\n\t\t\t\t\t\ttoast.show();\n\t\t\t\t\t\tIntent resultIntent = new Intent();\n\t\t\t\t\t\tresultIntent.putExtra(\"data1\", player);\n\t\t\t\t\t\tsetResult(RESULT_OK, resultIntent);\n\t\t\t\t\t\tfinish();\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse if (pHp > 0 && eHp < 0){\n\t\t\t\t\t\t\n\t\t\t\t\t\t// winning message\n\t\t\t\t\t\tplayer.setCandies(player.getCandies() + 500000000);\n\t\t\t\t\t\tToast toast = Toast.makeText(context, \"You have now surpassed yourself, young grasshopper take 500000000 candies!\", Toast.LENGTH_SHORT);\n\t\t\t\t\t\ttoast.show();\n\t\t\t\t\t\tIntent resultIntent = new Intent();\n\t\t\t\t\t\tresultIntent.putExtra(\"data1\", player);\n\t\t\t\t\t\tsetResult(RESULT_OK, resultIntent);\n\t\t\t\t\t\tfinish();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// update Hp\n\t\t\t\t\tplayHp.setText(\"Player Hp: \" + String.valueOf(pHp));\n\t\t\t\t\tenemyHp.setText(\"Enemy Hp: \" + String.valueOf(eHp));\n\t\t\t}", "@Override\r\n public void dispenseProduct() {\r\n System.out.println(\"Insufficient funds!\");\r\n\r\n }", "public void pickUpHerd() {\n rounds.get(currentRound).currentPlayerPickUpHerd();\n }", "public void checkAndExecute(){\n if(priceListener.getSecurityPrice() < buyPrice){\n executionService.buy(security, buyPrice, 100);\n // if the price < buyPrice then executionService.buy(buyquantity)\n }else if ( priceListener.getSecurityPrice() > sellPrice ) {\n executionService.sell(security, buyPrice, 100);\n }\n }", "@Override\r\n\tpublic void paidBehavior() {\n\t\tSystem.out.println(\"You paid using your Vias card\");\r\n\t\t\r\n\t}", "public abstract void sendConfirmationMessage(Player player);", "@Override\n public void submitAnswer(PlayerAnswer playerAnswer) {\n\n\n }" ]
[ "0.69478184", "0.6846601", "0.6817913", "0.668391", "0.6607297", "0.64670646", "0.64543295", "0.6444483", "0.63942736", "0.6336666", "0.62673473", "0.6259579", "0.62162846", "0.6167848", "0.6167186", "0.6141412", "0.61393183", "0.61264956", "0.6118133", "0.6113514", "0.6105347", "0.60873157", "0.6069562", "0.60668665", "0.60642964", "0.60553354", "0.6053382", "0.60443544", "0.60427094", "0.60283846", "0.59485507", "0.5944579", "0.59406155", "0.59355193", "0.5925482", "0.59152514", "0.590148", "0.5893081", "0.5890989", "0.58844584", "0.58797175", "0.58778155", "0.58690107", "0.5858785", "0.5856746", "0.5821706", "0.5817361", "0.5816146", "0.5811777", "0.5800583", "0.5787035", "0.5781718", "0.5777635", "0.5771722", "0.57551014", "0.5720363", "0.5718379", "0.57148135", "0.5714747", "0.571441", "0.5696371", "0.5692623", "0.56686145", "0.56609166", "0.56560093", "0.5649519", "0.5646627", "0.564139", "0.56389284", "0.5635355", "0.5632223", "0.5630415", "0.562872", "0.56244797", "0.5621266", "0.55978763", "0.5597225", "0.55972195", "0.558816", "0.5577862", "0.55722016", "0.55717254", "0.555909", "0.5555592", "0.55535555", "0.5540587", "0.55391294", "0.5533449", "0.5520429", "0.5512303", "0.5511141", "0.5510231", "0.55081904", "0.54942435", "0.549021", "0.548263", "0.5480965", "0.5480111", "0.54786676", "0.5478352", "0.54772466" ]
0.0
-1
This method is called when a player attempts to perform a Maritime Trade
boolean CanMaritimeTrade(int ratio, String inputResource, String outResource);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void botTrading(){\n if(game.isCardPositive(game.getHighestSharePriceStock())){\n int numShares = player.getFunds()/(game.getHighestSharePriceStock().getSharePrice()+3);\n player.getShares().set(game.getIndex(game.getHighestSharePriceStock()), player.getShares().get(game.getIndex(game.getHighestSharePriceStock())) + numShares);\n player.setFunds(-numShares*(game.getHighestSharePriceStock().getSharePrice()+3));\n }\n }", "@Override\r\n\tpublic void onTrade(Trade trade) throws Exception {\n\t\t\r\n\t}", "@Override\n public void maritimeTrade(int ratio, ResourceType giving, ResourceType getting) throws ModelException {\n assert ratio == 2 || ratio == 3 || ratio == 4;\n\n IPlayer p = GameModelFacade.instance().getLocalPlayer();\n\n if (!GameModelFacade.instance().localPlayerIsPlaying() || p.getResources().getCount(giving) < ratio) {\n throw new ModelException(\"Preconditions for action not met.\");\n }\n\n try {\n String clientModel = m_theProxy.maritimeTrade(p.getIndex(), ratio, giving, getting);\n new ModelInitializer().initializeClientModel(clientModel, m_theProxy.getPlayerId());\n } catch (NetworkException e) {\n throw new ModelException(e);\n }\n }", "public void tryAct() {\n\n List<Player> onCardPlayers = new ArrayList<Player>();\n List<Player> offCardPlayers = new ArrayList<Player>();\n if (currentPlayer.isEmployed() == true) {\n if(!currentPlayer.getHasPlayed()){\n onCardPlayers = findPlayers(currentPlayer.getLocation().getOnCardRoles());\n offCardPlayers = findPlayers(currentPlayer.getLocation().getOffCardRoles());\n currentPlayer.act(onCardPlayers, offCardPlayers);\n refreshPlayerPanel();\n }\n else{\n view.showPopUp(currentPlayer.isComputer(), \"You've already moved, rehearsed or acted this turn. Try a different command or click `end turn` to end your turn.\");\n }\n }\n else {\n view.showPopUp(currentPlayer.isComputer(), \"You're not employed, so you need to take a role before you can act.\");\n }\n view.updateSidePanel(playerArray);\n }", "public void onTradeRequest(String name)\n {\n\t\tif(traded_ammount > 0)\n\t\t{\n\t\t\ttraded_ammount = 0;\n\t\t\ttime = System.currentTimeMillis();\n\t\t}\n\t\tint[] player = getPlayerByName(name);\n\t\tint player_id = getPlayerPID(player[0]);\n\t\tsendTradeRequest(player_id);\n }", "public void action(){\n turn.sendMsg(turn.getController().getTurnOwner().getName()+\"'s turn!\");\n if(turn.getPlayer().isDown()){\n turn.setPhase(new RecoveryPhase());\n }else {\n turn.setPhase(new StarsPhase());\n }\n }", "@Override\r\n\tpublic void acceptTrade(boolean willAccept) {\n\t\t\r\n\t}", "@Override\n\t\t\tpublic void execute() {\n\t\t\t\tif (Math.abs(player.getPosition().getX() - x) > 25 || Math.abs(player.getPosition().getY() - y) > 25) {\n\t\t\t\t\tplayer.getMovementQueue().reset();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Get ground item..\n\t\t\t\tOptional<ItemOnGround> item = ItemOnGroundManager.getGroundItem(Optional.of(player.getUsername()), itemId, position);\n\t\t\t\tif(item.isPresent()) {\n\t\t\t\t\t//Handle it..\n\t\t\t\t\t\n\t\t\t\t\t/** FIREMAKING **/\n\t\t\t\t\tOptional<LightableLog> log = LightableLog.getForItem(item.get().getItem().getId());\n\t\t\t\t\tif(log.isPresent()) {\n\t\t\t\t\t\tplayer.getSkillManager().startSkillable(new Firemaking(log.get(), item.get()));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "@Override\r\n\tpublic void onStartTrading() throws Exception {\n\t\t\r\n\t}", "public abstract void performPurchase(Player player);", "@Override\n public void performAction(Player playerActingOn) {\n System.out.println(\"Perform action PlayerPlayingCard\");\n if (this.strengthBoost == 0)\n playerActingOn.gainInstantWin();\n playerActingOn.increaseStrengthGain(this.strengthBoost);\n }", "public void playerLost()\r\n {\r\n \r\n }", "void givePlayerExp(BPlayer bPlayer, int exp);", "@Override\n\tpublic void landedOn() {\n\t\tMonopolyGameController.getInstance();\n\t\tMonopolyGameController.getCurrentPlayer().increaseMoney(300);\n\t\tLogger.getInstance().notifyAll(MonopolyGameController.getCurrentPlayer().getName()+ \" gained 300 dollars by landing on Bonus Square\");\n\t\tMonopolyGameController.allowCurrentPlayerToEndTurn();\n\n\t}", "void confirmRealWorldTrade(IUserAccount user, ITransaction trans);", "private void tradeCommand(){\n out.println(\"\\r\\nShares you own:\" +\n \"\\r\\nApple: \" + player.getShares().get(0) +\n \"\\r\\nBP: \" + player.getShares().get(1) +\n \"\\r\\nCisco: \" + player.getShares().get(2) +\n \"\\r\\nDell: \" + player.getShares().get(3) +\n \"\\r\\nEricsson: \" + player.getShares().get(4) +\n \"\\r\\n\\r\\nShare prices: Apple-\" + game.apple.getSharePrice() +\n \", BP-\" + game.bp.getSharePrice() +\n \", Cisco-\" + game.cisco.getSharePrice() +\n \", Dell-\" + game.dell.getSharePrice() +\n \", Ericsson-\" + game.ericsson.getSharePrice() +\n \"\\r\\n\\r\\nFunds: £\" + player.getFunds() + \", Current value of shares: £\" + getTotalShareValue(player) + \"\\r\\n\"\n );\n\n out.println(\"Would you like to buy(b) or sell(s) shares? Enter 'X' to exit.\");\n String bsInput = in.nextLine().trim();\n if (bsInput.toUpperCase().equals(\"B\")){\n getTradeParam(1); //buy\n }else if (bsInput.toUpperCase().equals(\"S\")){\n getTradeParam(0); //sell\n }else if (bsInput.toUpperCase().equals(\"X\")){\n command();\n }else{\n out.println(\"Invalid input\");\n tradeCommand();\n }\n }", "public abstract void onContribution(int amount, Player player);", "@Override\n public void use(AbstractPlayer p, AbstractMonster m) {\n //give player plated armor\n AbstractDungeon.actionManager.addToBottom( // 2.Gain plated armor\n new com.megacrit.cardcrawl.actions.common.ApplyPowerAction(AbstractDungeon.player, AbstractDungeon.player,\n new com.megacrit.cardcrawl.powers.PlatedArmorPower(AbstractDungeon.player, 3), 3));\n }", "void askLeaderCardThrowing();", "public void updateMoney()\n\t\t{\n\t\t\t\n\t\t\tFPlayer p1 = this.viewer;\n\t\t\tFPlayer p2 = (p1.equals(this.t.p1)) ? this.t.p2 : this.t.p1;\n\t\t\t\n\t\t\tItemStack om = new ItemStack(Material.GREEN_WOOL,1);\n\t\t\tItemMeta it = om.getItemMeta();\n\t\t\tit.setDisplayName(ChatColor.DARK_GREEN+ChatColor.BOLD.toString()+\"Money in trade:\");\n\t\t\tit.setLore(Arrays.asList(new String[] {\"\",Util.getMoney(this.t.getMoneyTraded(p1)),\"\",\"Click to add/remove money from trade\"}));\n\t\t\tom.setItemMeta(it);\n\t\t\t\n\t\t\tif (this.canAdd()) super.contents.put(0,new ItemSwapMenu(this,om,new MenuMoney(super.viewer,this.t)));\n\t\t\telse super.contents.put(0,new ItemDummy(this,om));\n\t\t\t\n\t\t\t// Trader money in trade\n\t\t\tItemStack tm = new ItemStack(Material.GREEN_WOOL,1);\n\t\t\tit = tm.getItemMeta();\n\t\t\tit.setDisplayName(ChatColor.DARK_GREEN+ChatColor.BOLD.toString()+\"Money in trade:\");\n\t\t\tit.setLore(Arrays.asList(new String[] {\"\",Util.getMoney(this.t.getMoneyTraded(p2))}));\n\t\t\ttm.setItemMeta(it);\n\t\t\tsuper.contents.put(8,new ItemDummy(this,tm));\n\t\t\tthis.composeInv();\n\t\t}", "public void summonMonster() {\n if (Utility.checkAndPrompt(user, selectedCard == null,\n \"no card is selected yet\")) return;\n int place = getSelectedCardOnHandID();\n if (Utility.checkAndPrompt(user, !(selectedCard instanceof MonsterCard) || place == -1,\n \"you can’t summon this card\")) return;\n int placeOnField = getFirstEmptyPlaceOnMonstersField();\n if (Utility.checkAndPrompt(user, placeOnField == -1,\n \"monster card zone is full\")) return;\n if (Utility.checkAndPrompt(user, hasSummonedMonsterThisTurn,\n \"you already summoned/set on this turn\")) return;\n // event : [summon]\n CardEvent cardEvent = new CardEvent(selectedCard, CardEventInfo.ENTRANCE, null);\n if (!getPermissionFromAllEffects(cardEvent)) {\n\n UtilityView.showError(user, \"you don't have permission to summon\");\n return;\n }\n selectedCard.setFaceUp(true);\n int monsterLevel = ((MonsterCard) selectedCard).getCardLevel();\n if (monsterLevel <= 4) {\n summonMonsterLowLevel(place, placeOnField);\n UtilityView.playSoundWithoutCycle(\"summon.wav\");\n notifyAllEffectsForConsideration(cardEvent);\n Printer.showBoard(this, this.opponent);\n return;\n }\n if (monsterLevel <= 6) {\n if (Utility.checkAndPrompt(user, placeOnField == 1,\n \"there are not enough cards for tribute\")) return;\n int address = Integer.parseInt(UtilityView.obtainInformationInCertainWay(\"input the address of the card you want to tribute\", \"\\\\d+\"));\n if (Utility.checkAndPrompt(user, isMonsterAddressInvalid(address),\n \"there are no monsters on this address\")) return;\n summonMonsterMediumLevel(place, address);\n UtilityView.playSoundWithoutCycle(\"summon.wav\");\n notifyAllEffectsForConsideration(cardEvent);\n Printer.showBoard(this, this.opponent);\n return;\n }\n\n if (Utility.checkAndPrompt(user, placeOnField == 1 || placeOnField == 2,\n \"there are not enough cards for tribute\")) return;\n String input1, input2;\n //Printer.prompt(\"input two addresses for the cards you want to tribute in TWO DIFFERENT LINES:\");\n int firstTribute = Integer.parseInt(UtilityView.obtainInformationInCertainWay(\"input the first address for tribute\", \"\\\\d+\"));\n int secondTribute = Integer.parseInt(UtilityView.obtainInformationInCertainWay(\"input the second address for tribute\", \"\\\\d+\"));\n if (Utility.checkAndPrompt(user, isMonsterAddressInvalid(firstTribute) || isMonsterAddressInvalid(secondTribute),\n \"there is no monster on one of these addresses\")) return;\n if (Utility.checkAndPrompt(user, firstTribute == secondTribute,\n \"Tributes are the same!\")) return;\n summonMonsterHighLevel(firstTribute, secondTribute, place);\n UtilityView.playSoundWithoutCycle(\"summon.wav\");\n notifyAllEffectsForConsideration(cardEvent);\n\n Printer.showBoard(this, this.opponent);\n }", "@Override\r\n\tpublic void makeMaritimeTrade(ResourceType giveResource, ResourceType getResource, int ratio) {\n\t\t\r\n\t}", "public void action(Player myPlayer)\n {\n if (getNbUtilisation() == 0) {\n System.out.println(\"Not possible\");\n } else {\n int nHealthy = getPointsHealthy();\n myPlayer.addLifePoints(nHealthy);\n\n }\n }", "@Override\n protected void trade(){\n // An example of a random trade proposal: offer peasants in exchange of soldiers\n // Pick the id of the potential partner (without checking if it is my neighbor)\n double pertnerID = (new Random()).nextInt(42)+1;\n trade[0] = pertnerID;\n // Choose the type of good demanded (peasants - 3)\n double demandType = 3;\n trade[1] = demandType;\n // Choose the amount of demanded goods\n double demand = Math.random();\n trade[2] = demand;\n // Choose the type of good offered in exchange (peasants - 2)\n double offerType = 2;\n trade[3] = offerType;\n // Choode the amount of goods offered in exchange (random but less than my total number of peasants)\n double offer = (new Random()).nextDouble()*myTerritory.getPeasants();\n trade[4] = offer;\n\n // This procedure updated the array trade, which contains the information\n // about trade proposals of the current lord\n }", "@Override\n\tpublic void passedBy() {\n\t\tMonopolyGameController.getInstance();\n\t\tMonopolyGameController.getCurrentPlayer().increaseMoney(250);\n\t\tLogger.getInstance().notifyAll(MonopolyGameController.getCurrentPlayer().getName()+ \" gained 250 dollars by landing on Bonus Square\");\n\n\t}", "public void surrender() {\n playerCash += playerBet / 2;\n\n //Play dealer's turn\n dealerTurn();\n\n //End the game and change the views\n restartGame();\n }", "public boolean request() {\n\t\tif (inAnySession()) {\n\t\t\tplayer.exchangeSession.reset();\n\t\t\treturn false;\n\t\t}\n\t\t\n if (!PlayerRight.isDeveloper(player) && !PlayerRight.isDeveloper(other)) {\n if (player.playTime < 3000) {\n player.message(\"You cannot trade until you have 30 minutes of playtime. \" + Utility.getTime(3000 - player.playTime) + \" minutes remaining.\");\n return false;\n }\n if (other.playTime < 3000) {\n player.message(other.getName() + \" cannot trade until they have 30 minutes of playtime.\");\n return false;\n }\n }\n\t\t \n\t\tif (getSession(other).isPresent() && getSession(other).get().inAnySession()) {\n\t\t\tplayer.message(\"This player is currently is a \" + type.name + \" with another player.\");\n\t\t\treturn false;\n\t\t}\n\t\tif (Objects.equals(player, other)) {\n\t\t\tplayer.message(\"You cannot \" + type.name + \" with yourself.\");\n\t\t\treturn false;\n\t\t}\n if (PlayerRight.isIronman(player) && !PlayerRight.isDeveloper(other)) {\n player.message(\"You can not \" + type.name + \" as you are an iron man.\");\n return false;\n }\n if (PlayerRight.isIronman(other) && !PlayerRight.isDeveloper(player)) {\n player.message(other.getName() + \" can not be \" + type.name + \"d as they are an iron man.\");\n return false;\n }\n\t\tif (player.exchangeSession.requested_players.contains(other)) {\n\t\t\tplayer.message(\"You have already sent a request to this player.\");\n\t\t\treturn false;\n\t\t}\n\t\tif (player.locking.locked()) {\n\t\t\tplayer.message(\"You cannot send a \" + type.name + \" request right now.\");\n\t\t\treturn false;\n\t\t}\n\t\tif (other.locking.locked()) {\n\t\t\tplayer.message(other.getName() + \" is currently busy.\");\n\t\t\treturn false;\n\t\t}\n\t\tif (player.playerAssistant.busy()) {\n\t\t\tplayer.message(\"Please finish what you are doing before you do that.\");\n\t\t\treturn false;\n\t\t}\n\t\tif (other.playerAssistant.busy()) {\n\t\t\tplayer.message(other.getName() + \" is currently busy.\");\n\t\t\treturn false;\n\t\t}\n\t\tif (player.inActivity(ActivityType.DUEL_ARENA)) {\n\t\t\tplayer.message(\"You can not do that whilst in a duel!\");\n\t\t\treturn false;\n\t\t}\n\t\tif (other.inActivity(ActivityType.DUEL_ARENA)) {\n\t\t\tother.message(\"You can not do that whilst in a duel!\");\n\t\t\treturn false;\n\t\t}\n\t\tif (!onRequest()) {\n\t\t\treturn false;\n\t\t}\n\t\treturn SESSIONS.add(this);\n\t}", "public String maritimeTrade(MaritimeTrade maritimeTrade) throws Exception {\n\t\tString url = server_url + \"/moves/maritimeTrade\";\n\t\tURL obj = new URL(url);\n\t\tHttpURLConnection con = (HttpURLConnection) obj.openConnection();\n\n\t\t//add request header\n\t\tcon.setRequestMethod(\"POST\");\n\t\tcon.setRequestProperty(\"User-Agent\", \"Mozilla/5.0\");\n\t\tcon.setRequestProperty(\"Accept-Language\", \"en-US,en;q=0.5\");\n\t\tcon.setRequestProperty(\"Cookie\", usercookie + \"; \" + gamecookie);\n\t\t\n\t\tJsonObject info = new JsonObject();\n\t\tinfo.addProperty(\"type\",\"maritimeTrade\");\n\t\tinfo.addProperty(\"playerIndex\", maritimeTrade.playerIndex);\n\t\tinfo.addProperty(\"ratio\", maritimeTrade.ratio);\n\t\tinfo.addProperty(\"inputResource\", maritimeTrade.givingUp.name().toLowerCase());\n\t\tinfo.addProperty(\"outputResource\", maritimeTrade.getting.name().toLowerCase());\n\t\t\n\t\t// Send post request\n\t\tcon.setDoOutput(true);\n\t\tDataOutputStream wr = new DataOutputStream(con.getOutputStream());\n\t\twr.writeBytes(info.toString());\n\t\twr.flush();\n\t\twr.close();\n\n\t\tint responseCode = con.getResponseCode();\n\t\t//System.out.println(\"\\nSending 'POST' request to URL : \" + url);\n\t\t//System.out.println(\"Post parameters : \" + info.toString());\n\t\t//System.out.println(\"Response Code : \" + responseCode);\n\n\t\tif (responseCode == 400) {\n\t\t\tthrow new Exception();\n\t\t}\n\t\tBufferedReader in = new BufferedReader(\n\t\t new InputStreamReader(con.getInputStream()));\n\t\tString inputLine;\n\t\tStringBuffer response = new StringBuffer();\n\n\t\twhile ((inputLine = in.readLine()) != null) {\n\t\t\tresponse.append(inputLine);\n\t\t}\n\t\tin.close();\n\t\t\n\t\t//print result\n\t\t////System.out.println(response.toString());\n\t\treturn response.toString();\n\t}", "@Override\n\tpublic void run() {\n\t\tlogger.info(\"Timer for the initialization expired\");\n\t\tif(logic.getCurrentPlayer() != null) {\n\t\t\tlogic.setBonusBar(0, player.getPlayerID());\n\t\t}\n\t\telse {\n\t\t\tlogic.setLeaderCard(0, player.getPlayerID());\n\t\t}\n\t}", "public void tryDeal() {\n if(previousTie){\n previousTie = false;\n emptyHands();\n shuffle();\n }\n if (player.getBet() < 2) {\n errorFlag = true;\n userMessage = \"You must bet a minimum of $2\";\n return;\n } else if (player.getHand().size() > 0) {\n errorFlag = true;\n userMessage = \"You have already been dealt your initial hand\";\n return;\n } else {\n player.setHand(deal(player.getHand(), 2));\n if (player.getHand().get(0).getValue() == player.getHand().get(1).getValue()) {\n //User can split if they want to\n userMessage = \"Hit, Stand or Split\";\n splitDisabled = false;\n }else{\n userMessage = \"Hit or Stand\";\n }\n dealDisabled = true;\n againDisabled = true;\n doubleDisabled = false;\n standDisabled = false;\n hitDisabled = false;\n bettingDisabled = true;\n }\n }", "@Override\n\t\t\t\t\t\t\t\t\t\t\tpublic void execute(Object... arguments) {\n\t\t\t\t\t\t\t\t\t\t\t\tif (((Player) arguments[0])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getSummoning().familiarSpecialEnergy >= 15) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tServer.npcHandler.startAnimation(8288,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t((Player) arguments[0]).getInstance().summoningMonsterId);\n\t\t\t\t\t\t\t\t\t\t\t\t\t((Player) arguments[0]).getInstance().summoned.gfx0(1414);// unknown\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// wartoise\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// gfx\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ulti\n\t\t\t\t\t\t\t\t\t\t\t\t\t((Player) arguments[0]).startAnimation(7660);\n\t\t\t\t\t\t\t\t\t\t\t\t\t((Player) arguments[0]).gfx(1313, 0);\n\t\t\t\t\t\t\t\t\t\t\t\t\t((Player) arguments[0])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.sendMessage(\"Your defence has been boosted!\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t((Player) arguments[0]).getPotions().doTortoiseSpecial(1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t((Player) arguments[0]).getSummoning().specialTimer = 5;\n\t\t\t\t\t\t\t\t\t\t\t\t\t((Player) arguments[0]).getSummoning().familiarSpecialEnergy -= 15;\n\t\t\t\t\t\t\t\t\t\t\t\t\t((Player) arguments[0]).getItems()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.deleteItem2(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t((Player) arguments[0])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getSummoning().summonedFamiliar.scrollId,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t1);\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t((Player) arguments[0]).sendMessage(\"Your familiar has \"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ ((Player) arguments[0])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getSummoning().familiarSpecialEnergy\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ \" special energy left and needs 15..\");\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}", "@Override\n public void acceptTrade(boolean willAccept) throws ModelException {\n if (willAccept && !GameModelFacade.instance().canAcceptTrade()) {\n throw new ModelException(\"Preconditions for action not met.\");\n }\n\n IPlayer p = GameModelFacade.instance().getLocalPlayer();\n assert GameModelFacade.instance().getGame().getTradeOffer().getReceiver().equals(p);\n\n try {\n String clientModel = m_theProxy.acceptTrade(p.getIndex(), willAccept);\n new ModelInitializer().initializeClientModel(clientModel, m_theProxy.getPlayerId());\n } catch (NetworkException e) {\n throw new ModelException(e);\n }\n }", "@Override\r\n\tpublic void ThrowPotion(Player arg0, Player arg1) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void ThrowPotion(Player arg0, Player arg1) {\n\t\t\r\n\t}", "@Override\n public void summonHorsesToPaddock(){\n rl.lock();\n try{\n System.out.println(\"B : Trying to summon horse...\");\n //change broker state\n// MyThreadBroker broker = (MyThreadBroker) Thread.currentThread();\n// broker.broker_states = MyThreadBroker.Broker_States.ANNOUNCING_NEXT_RACE;\n //change log\n log.setBrokerState(MyThreadBroker.Broker_States.ANNOUNCING_NEXT_RACE);\n log.changeLog();\n keep_waiting = false;\n stable_horses.signal(); \n }finally{\n rl.unlock();\n }\n \n }", "public void onMushroomTimerTick() {\r\n\t\tgame.tryToPlantMushroom();\r\n\t}", "@ReceiveEvent\n public void onTradeResponse(TradeResponse response, EntityRef entity) {\n if (!entity.equals(localPlayer.getCharacterEntity())) {\n return;\n }\n\n tradingScreen.setMessage(response.message);\n refreshLists();\n }", "public void act() \n {\n CreatureWorld playerWorld = (CreatureWorld)getWorld();\n\n if( getHealthBar().getCurrent() <= 0 )\n {\n getWorld().showText(\"Charmander has fainted...\", getWorld().getWidth()/2, getWorld().getHeight()/2 + 26);\n Greenfoot.delay(30);\n }\n }", "protected void apply() {\r\n\t\tplayer.setAutoRoll(autoroll);\r\n\t\tplayer.setMission(mission);\r\n\t\tplayer.setState(state);\r\n\t\tplayer.getCards().setArtillery(cards.getArtillery());\r\n\t\tplayer.getCards().setCavalry(cards.getCavalry());\r\n\t\tplayer.getCards().setInfantry(cards.getInfantry());\r\n\t\tplayer.getCards().setJokers(cards.getJokers());\r\n\t\tMember member = player.getMember();\r\n\t\tif(score == Score.WIN) {\r\n\t\t\tmember.setScore(member.getScore() + player.getGame().getPlayers().size() - 1);\r\n\t\t\tmember.setWins(member.getWins() + 1);\r\n\t\t} else if(score == Score.LOSS) {\r\n\t\t\tmember.setScore(member.getScore() - 1);\r\n\t\t\tmember.setLosses(member.getLosses() + 1);\r\n\t\t}\r\n\t}", "public void Action(Player p) {\n int x = p.getMoney();\n int a = super.getAmount();\n if (x - a < 0) {\n p.setLoan((a - x) + 1000);\n p.setMoney((a - x) + 1000);\n p.setMoney(-a);\n } else {\n p.setMoney(-a);\n }\n this.JackMoney = a;\n }", "public void act() \r\n {\n if(getOneIntersectingObject(Player.class)!=null)\r\n {\r\n if(MenuWorld.gamemode == 1)\r\n //marcheaza regenerarea labirintului(trecere la nivelul urmator in Modul Contra Timp)\r\n TAworld.shouldRegen=true;\r\n else\r\n { \r\n //reseteaza variabilele care tin de modul de joc\r\n MenuWorld.gamemode=-1;\r\n MenuWorld.isPlaying=false;\r\n for(int i=0;i<4;i++)\r\n ItemCounter.gems_taken[i]=0;\r\n \r\n //arata fereastra de castig \r\n PMworld.shouldShowVictoryWindow=true;\r\n }\r\n \r\n }\r\n \r\n }", "private void updateTamingProcess() {\n\n if (!mseEntity.isTameable())\n return;\n\n int tamingIncrease = mseEntity.updateHunger();\n if (tamingIncrease > 0) {\n mseEntity.eatAnimation();\n }\n\n int tamingProgress = tamingHandler.getTamingProgress();\n tamingProgress += tamingIncrease;\n tamingHandler.setTamingProgress(tamingProgress);\n if (tamingProgress < 0)\n tamingProgress = 0;\n if (tamingProgress >= mseEntity.getMaxTamingProgress())\n tamingHandler.setSuccessfullyTamed();\n\n }", "@Override\n public void execute() {\n vars.setState(\"Teleporting...\");\n Methods.teleToFlameKing();\n }", "@Override\n\tpublic void satisfyTrade(TickEvent<Trade> tradeEvent) throws TradeException {\n\n\t}", "public void tryRehearse() {\n if (currentPlayer.isEmployed() == true) {\n if(!currentPlayer.getHasPlayed()){\n currentPlayer.rehearse();\n }\n else{ \n view.showPopUp(currentPlayer.isComputer(), \"You've already moved, rehearsed or acted this turn. Try a different command or click `end turn` to end your turn.\");\n }\n }\n else {\n view.showPopUp(currentPlayer.isComputer(), \"You're not employed, so you need to take a role before you can rehearse.\");\n }\n view.updateSidePanel(playerArray);\n }", "@EventHandler ( priority = EventPriority.HIGHEST )\n\tpublic void onThrow ( PlayerInteractEvent event ) {\n\t\tfinal Action action = event.getAction();\n\t\tif (action != Action.RIGHT_CLICK_AIR \n\t\t\t\t&& action != Action.LEFT_CLICK_AIR) { // check is left or right click to air.\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// get event values.\n\t\tfinal Player p = event.getPlayer();\n\t\tfinal BRPlayer bp = BRPlayer.getBRPlayer(p);\n\t\tfinal ItemStack stack = event.getItem();\n\t\t\n\t\t// check item.\n\t\tif (!BattleItems.TNT_GRENADE.isThis(stack)) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t/* check is not knocked */\n\t\tif (!bp.isKnocked()) {\n\t\t\t// spawn and modify tnt if the event is not cancelled\n\t\t\tfinal TNTPrimed tnt = (TNTPrimed) p.getWorld().spawn(p.getLocation(), TNTPrimed.class);\n\t\t\tMemberThrowTNT evemt = new MemberThrowTNT(bp, tnt).call();\n\t\t\tif (evemt.isCancelled()) {\n\t\t\t\ttnt.remove();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t/* apply modifiers */\n\t\t\ttnt.setVelocity(p.getLocation().getDirection().clone().multiply(1.1D));\n\t\t\ttnt.setFuseTicks(30); /* 80 by default */\n\t\t\ttnt.setMetadata(TNT_GRENADE_METADATA, new FixedMetadataValue(BattleRoyale.getInstance(), TNT_GRENADE_METADATA));\n\t\t\ttnt.setIsIncendiary(true);\n\t\t\ttnt.setYield(evemt.getExplosionStrength()); /* set explosion strength */\n\t\t\t\n\t\t\t/* consume item */\n\t\t\tif (evemt.isCosumeItemInHand()) {\n\t\t\t\tif (p.getGameMode() != GameMode.CREATIVE) { // check is not in creative mode.\n\t\t\t\t\t// consume.\n\t\t\t\t\tif ((stack.getAmount() - 1) > 0) {\n\t\t\t\t\t\tp.setItemInHand(BattleItems.TNT_GRENADE.asItemStack(stack.getAmount() - 1));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tp.setItemInHand(null);\n\t\t\t\t\t}\n\t\t\t\t\tp.updateInventory();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* cancel interaction */\n\t\tevent.setCancelled(true);\n\t}", "public void playAI() {\r\n // An item has been added to the ticket. Fire an event and let everyone know.\r\n System.out.println(\"You're going to lose foolish human!\");\r\n }", "public void createTrade(String symbol, String fiat, String type, double amount) {\n // Type should be \"sell\" or \"buy\"\n if (!type.equals(\"sell\") && !type.equals(\"buy\"))\n return; // TODO - throw exception here\n\n // Create request object\n JSONObject data = new JSONObject();\n try {\n data.put(\"uuid\", getUUID());\n data.put(\"type\", type);\n data.put(\"fiat_value\", amount);\n data.put(\"fiat\", fiat);\n data.put(\"crypto_symbol\", symbol);\n } catch (JSONException e) {\n return; // TODO - throw exception here\n }\n\n api.createTrade(new VolleyJsonCallback() {\n @Override\n public void onSuccess(JSONObject json) throws JSONException {\n Trade t = new Trade(\n json.getString(\"uuid\"),\n json.getString(\"type\"),\n json.getDouble(\"fiat_value\"),\n json.getString(\"fiat\"),\n json.getDouble(\"crypto_value\"),\n json.getString(\"crypto_symbol\")\n );\n\n user.AddTrade(t);\n\n String typeStr = (type == \"buy\") ? \"Bought \" : \"Sold \";\n String text = typeStr + t.fiat_value + \"€ of \" + t.crypto_symbol;\n Toast.makeText(getApplicationContext(), text, Toast.LENGTH_LONG).show();\n\n // Create notification if enabled and trade is a buy\n if (getNotificationEnabled() && t.type.equals(\"buy\")) {\n Intent intent = new Intent(App.this, UpdateBroadcast.class);\n intent.putExtra(\"symbol\", t.crypto_symbol);\n intent.putExtra(\"fiat_price\", t.fiat_value);\n intent.putExtra(\"crypto_value\", t.crypto_value);\n PendingIntent pendingIntent = PendingIntent.getBroadcast(App.this, 0, intent, 0);\n\n AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);\n\n long currentTime = System.currentTimeMillis();\n //long remindIn = 1000 * 60 * 60; // Remind in this many milliseconds (1h)\n long remindIn = 1000 * 5;\n\n alarmManager.set(AlarmManager.RTC_WAKEUP, currentTime+remindIn, pendingIntent);\n }\n }\n\n @Override\n public void onError(String message) {\n Toast.makeText(getApplicationContext(), message, Toast.LENGTH_LONG).show();\n }\n }, data);\n }", "public void perform() {\n\t\tlog.info(\"begin to play the drum\");\n\t\tthrow new RuntimeException();\n\t}", "@Override\n public void use(AbstractPlayer p, AbstractMonster m) {\n AbstractDungeon.actionManager.addToBottom(new VFXAction(p, new FlameBarrierEffect(p.hb.cX, p.hb.cY), 0.5F));\n AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(p, m, new FlameWardPower(p, block, magicNumber)));\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent resultIntent) {\n super.onActivityResult(requestCode, resultCode, resultIntent);\n if (requestCode == 1) {\n if (resultCode == Activity.RESULT_OK) {\n int price = resultIntent.getIntExtra(\"Price\", Integer.MAX_VALUE);\n if (playerStats.getPlayerCash() - price >= 0) {\n this.playerStats.subtractPlayerCash(price);\n this.masterDeck.unlockCard(resultIntent.getStringExtra(\"Name\"));\n this.adapter.notifyItemChanged(resultIntent.getIntExtra(\"Position\", -1));\n showCash();\n showCardStats();\n } else {\n Toast.makeText(CardLibraryActivity.this, \"Not enough minerals.\", Toast.LENGTH_SHORT).show();\n }\n }\n }\n }", "public void trade(Drop myDrop, User receiver) {\n getInventory().removeDrop(myDrop);\n receiver.getInventory().addDrop(myDrop);\n }", "public void transact() {\n\t\truPay.transact();\n\n\t}", "public void use(Player player){\r\n\t\t\tif(this.getEffect()==\"HEAL\"){\r\n\t\t\t\tplayer.heal(this.getValue());\r\n\t\t\t}\r\n\t\t\tif(this.getEffect() == \"BOOK\"){ \r\n\t\t\t\tplayer.increaseSkill(this.getValue(), 1); \r\n\t\t\t}\r\n\t\t\tif(this.getEffect() == \"RESSURECTION\"){\r\n\t\t\t\ttry {TrackLog.writeLog(\"I think I should keep this one, migth save my life some days\");} \r\n\t\t\t\tcatch (IOException e) {e.printStackTrace();}\r\n\t\t\t}\r\n\t\t}", "private void myTurn()\n\t{\n\t\t\n\t\tif (canPlay())\n\t\t{\n\t\t\tif (isTop())\n\t\t\t{\n\t\t\t\traise();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tequal();\n\t\t\t}\n\t\t}\n\t\ttable.nextPlayer();\n\t\t\n\t}", "protected void execute() {\n \tRobot.chassisSubsystem.shootHighM.set(0.75);\n \tif(timeSinceInitialized() >= 1.25){\n \t\tRobot.chassisSubsystem.liftM.set(1.0);\n \t}\n }", "void giveReward(BPlayer bPlayer, int tier, int status);", "public void act() \n {\n moveTowardsPlayer(); \n }", "public void playerTurnStart() {\n\r\n\t}", "void playerTurn(Player actualPlayer) {\n aiPlayer.chooseAction(actualPlayer);\n actualPlayer.setTheirTurn(false);\n }", "protected abstract void takeTurn(int player);", "public void doLogicBuy() {\n\t\tif (!player.isHuman) {\n\t\t\tif (player.money > estimatedFee * 1.5) //\n\t\t\t{\n\t\t\t\tint free = (int) (player.money - estimatedFee * 1.5);\n\t\t\t\tCell c = board.getCells().get(player.position);\n\t\t\t\tif (c instanceof TradeableCell) {\n\t\t\t\t\tTradeableCell tc = (TradeableCell) c;\n\t\t\t\t\tif (tc.getOwner() == null && tc.getPrice() < free) {\n\t\t\t\t\t\ttc.buy(player);\n\t\t\t\t\t\tboard.addMessage(\"Just bought\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void act() \n {\n // Add your action code here.\n tempoUp();\n }", "private SpeechletResponse handleTransferMoneyExecute(Session session) {\n\t\treturn null;\n\t}", "protected final void hit() throws InsufficientCardsException {\n hand.add(deck.deal());\n update();\n }", "public void act() \n {\n playerMovement();\n }", "private void botBuy(Stock stock, int numShares){\n player.getShares().set(game.getIndex(stock), player.getShares().get(game.getIndex(stock)) + numShares);\n player.setFunds(-numShares*(stock.getSharePrice()+3));\n System.out.println(\"purchase made\"); //rem\n }", "@Override\r\n\tpublic void showDoTimeMessage(Player player) {\n\t}", "@Override\r\n\tpublic void act() {\r\n\t\tdouble tankx, tanky;\r\n\t\ttankx = tank.getX();\r\n\t\ttanky = tank.getY();\r\n\t\t\r\n\t\t// If we're not in the center, rotate toward the center and move.\r\n\t\tif (tankx < 300 || tankx > 500 || tanky < 250 || tanky > 350) {\r\n\t\t\treceiver.receiveCommand(new RotateTowardsCommand(player, 400, 300));\r\n\t\t\treceiver.receiveCommand(new MoveCommand(player, false));\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// We are in the center. Just move the gun around and shoot.\r\n\t\t\treceiver.receiveCommand(new RotateGunCommand2(player, 0.05));\r\n\t\t\treceiver.receiveCommand(new FireCommand(player));\r\n\t\t}\r\n\t}", "@Override\n public void onSmelting(EntityPlayer player, ItemStack item) \n {\n \n }", "@Override\r\n\tpublic void setPlayerToTradeWith(int playerIndex) {\n\t\t\r\n\t}", "@Override\n public void applyEffect(Battle battle, Cell cell, Account player, int activeTime) {\n /* if (activeTime != -1)\n return;\n ManaItemBuff manaItemBuff = new ManaItemBuff(player, 1);\n manaItemBuff.setTurnCounter(-5);\n manaItemBuff.castBuff();\n player.getOwnBuffs().add(manaItemBuff);*/\n }", "@Override\n public void onTake(@Nonnull Player player, @Nonnull ItemStack stack) {\n super.onTake(player, stack);\n }", "private void updatePlayerClaim(){\n if(chestProgressLevel!=1){\n return; //the chest isnt unlocked!\n }\n\n //count the total players, and the players who unlocked it.\n int totalPlayers = 0;\n int unlockedPlayers = 0;\n for(JuggernautPlayer player: JuggernautGame.getInstance().getPlayers()){\n if(!player.isSurvivor() || !player.isAlive()){\n continue; //they be dead, they dont count! (Juggy also doesnt count, he doesnt get to unlock items)\n }\n totalPlayers++; //+1 total players\n if(player.isSurvivor() && player.getChestBonus(chestID)>=level){\n unlockedPlayers++; //they unlocked it, +1 unlocked players\n }\n }\n\n //all players unlocked it\n if(totalPlayers<=unlockedPlayers && chestProgressLevel==1){\n //lock the chest before respawning.\n lockChest();\n new BukkitRunnable() {\n\n int timeTillRespawn = 3; //3 seconds to respawn a chest\n @Override\n public void run() {\n //runs every second\n for(JuggernautPlayer jp : JuggernautGame.getInstance().getAllPeople()){\n //check if the player is in the radius of the chest (ignore Y)\n if(SkyMathHelper.isInRadius(location, jp.getPlayer().getLocation(), nametagRadius, false)) {\n //show them the hologram. Update if they already have the hologram active.\n //If this chest will not respawn, we tell them \"Good Luck!\" instead of the respawning message.\n if (jp.getLoadedEntities().containsKey(armorstandResetChestID)) {\n if(level==getMaxLevel()){\n jp.updateHologram(armorstandResetChestID, \"\\u00A76Good Luck!\");\n }else {\n jp.updateHologram(armorstandResetChestID, \"\\u00A76Respawning in \" + timeTillRespawn);\n }\n } else {\n if(level==getMaxLevel()) {\n jp.displayHologram(location.getX(), location.getY() + armorstandProgressbarHeight, location.getZ(), \"\\u00A76Good Luck!\", armorstandResetChestID);\n }else{\n jp.displayHologram(location.getX(), location.getY() + armorstandProgressbarHeight, location.getZ(), \"\\u00A76Respawning in \" + timeTillRespawn, armorstandResetChestID);\n }\n }\n }else{\n //they arent in range, so we remove this entity for them\n jp.removeEntities(armorstandResetChestID);\n }\n }\n\n //check if its time to respawn.\n if(timeTillRespawn--<=0){\n //its time! respawn the chest!\n respawnChest();\n for(JuggernautPlayer jp: JuggernautGame.getInstance().getPlayers()){\n //remove the countdown armorstand for all players\n jp.removeEntities(armorstandResetChestID);\n }\n this.cancel(); //cancel this runnable, we no longer need it.\n return;\n }\n }\n }.runTaskTimer(Juggernaut.pluginInstance, 0L, 20L); //every 20 ticks (1s)\n }else{\n //not all players unlocked the item yet. Lets indicate how many did.\n String emptyDisplayText = unlockedPlayers + \"/\" + totalPlayers + \" Claimed\";\n for(JuggernautPlayer JP: JuggernautGame.getInstance().getPlayers()){\n if(!SkyMathHelper.isInRadius(location, JP.getPlayer().getLocation(), nametagRadius, false)){\n //they arent in the radius, so we remove their armorstand again (if they had it).\n if(JP.getLoadedEntities().containsKey(this.armorstandClaimProgressID)) {\n JP.removeEntities(armorstandClaimProgressID);\n }\n continue;\n }\n\n //generate the color of the display text we need to show them. green if they claimed it, otherwise red.\n String displayText;\n if(JP.getChestBonus(chestID)>=level){\n displayText = \"\\u00A72\" + emptyDisplayText;\n }else{\n displayText = \"\\u00A7c\" + emptyDisplayText;\n }\n\n //update, or show the hologram to them.\n if(JP.getLoadedEntities().containsKey(this.armorstandClaimProgressID)){\n JP.updateHologram(armorstandClaimProgressID, displayText);\n }else{\n JP.displayHologram(this.location.getX(), this.location.getY()+this.armorstandClaimProgressHeight, this.location.getZ(), displayText, armorstandClaimProgressID);\n }\n }\n }\n }", "@Override\r\n public void fromFearToChase() {\r\n if (afraid()) {\r\n startChase();\r\n }\r\n }", "private void rewardPlayer(Player player) {\n\t\tRandom number = new Random();\n\t\tint num = number.nextInt(100);\n\t\t\n\t\tif(num >= 80 && num < 90) {\n\t\t\tplayer.increaseAttacks();\n\t\t\tserver.addTextToLoggingWindow(\"Player (\" + player.getName() + \") got rewarded one attack\");\n\t\t\tserver.sendMessageToClient(player.getName(), \"@134@\" + \"0\" + \"@\");\n\t\t}\n\t\telse if(num >= 90 && num <= 100) {\n\t\t\tplayer.increaseSafeTP();\n\t\t\tserver.addTextToLoggingWindow(\"Player (\" + player.getName() + \") got rewarded one safe teleport\");\n\t\t\tserver.sendMessageToClient(player.getName(), \"@134@\" + \"1\" + \"@\");\n\t\t}\n\t}", "private void haveFun() {\n\t\tint action = inputPrompt.funActivities(money);\r\n\t\tthis.money -= action;\r\n\t\t//has better effect depending on how much money you have spent\r\n\t\tthis.mentalHealth += FUNHEALTH + action;\r\n\t\tdailyTime--;\r\n\t\tinputPrompt.mainInfo(energy, physHealth, mentalHealth, money);\r\n\t\t\r\n\t}", "@Override\r\n\tpublic void performAction(Client client, RentUnit rentUnit) {\n\t\tSystem.err.println(\"Program was not implemented\");\r\n\t}", "public void playerLeftAFK(Player player)\n {\n updatePlayerAFKTimer(player);\n startOrResetAFKTimerForPlayer(player);\n }", "@Override\n public void onSmelting(EntityPlayer player, ItemStack item) {\n }", "public void buyStock(double askPrice, int shares, int tradeTime) {\n }", "public void startExecuting() {\n this.attackTime = 20;\n ShulkerEntity.this.updateArmorModifier(100);\n }", "@Override\n public void onCrafting(EntityPlayer player, ItemStack item, IInventory craftMatrix) \n {\n if (item.itemID == mod_TFmaterials.RubyPickaxe.itemID)\n {\n \t//player.addStat(mod_TFmaterials.RubyPickAchieve, 1);\n \tplayer.addStat(mod_TFmaterials.RubyPickAchieve, 1);\n }\n }", "@Override\r\n\tpublic void tick(){\n\t\tif(!alert){\r\n\t\t\tif(hostileToPlayer&&closeEnoughToAlert(World.player))\r\n\t\t\t\t{alert=true;target=World.player;}\r\n\t\t}\r\n\t\t\r\n\t\tif(alert&&null!=target){\r\n\t\t\t//For now, advance towards the player\r\n\t\t\tPathfinder.moveTowards(this, target);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//If within attacking range but not yet attacking, and not stunned, do so.\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "private synchronized void teamVictory() {\n \t\tif (state == MatchState.ONVICTORY || state == MatchState.ONCOMPLETE || state == MatchState.ONCANCEL) \n \t\t\treturn;\n \t\tstate = MatchState.ONVICTORY;\n \t\t/// Call the rest after a 2 tick wait to ensure the calling transitionMethods complete before the\n \t\t/// victory conditions start rolling in\n \t\tBukkit.getScheduler().scheduleSyncDelayedTask(plugin, new MatchVictory(this),2L);\n \t}", "@Override\n public void execute() {\n String nextPlayer = CModel.getInstance().getCurrGame().advancePlayerTurn();\n if(nextPlayer.equals(CModel.getInstance().getMyUser().getUserName())) {\n CModel.getInstance().setCurrGameState(new MyTurn());\n }\n else {\n //update the player stats\n CModel.getInstance().setCurrGameState(new NotMyTurn());\n }\n CModel.getInstance().updatePlayerStatsView();\n }", "private boolean willComputerTrade(LinkedList<Card> initiatorTradeItems, LinkedList<Card> otherPlayerTradeItems, Player otherPlayer) {\n\t\tint tradeValue = 0;\n\t\tfor (Card item : initiatorTradeItems)\n\t\t\ttradeValue += AICardEvaluator.getCardValueToPlayer(item, otherPlayer, otherPlayer.getHandCards());\n\t\tfor (Card item : otherPlayerTradeItems)\n\t\t\ttradeValue -= AICardEvaluator.getCardValueToPlayer(item, otherPlayer, otherPlayer.getHandCards());\n\t\t\n\t\t// factor in initiator rank and trade value, depending on other player's computer level\n\t\tif (otherPlayer.getPlayerType() == PlayerType.COMPUTER_MEDIUM) {\n\t\t\tint initiatorTradeValue = 0;\n\t\t\tfor (Card item : otherPlayerTradeItems)\n\t\t\t\tinitiatorTradeValue += AICardEvaluator.getCardValueToPlayer(item, initiator, null);\n\t\t\tfor (Card item : initiatorTradeItems)\n\t\t\t\tinitiatorTradeValue -= AICardEvaluator.getCardValueToPlayer(item, initiator, null);\n\t\t\ttradeValue -= initiatorTradeValue;\n\t\t}\n\t\telse if (otherPlayer.getPlayerType() == PlayerType.COMPUTER_HARD) {\n\t\t\tdouble playerFactor = GM.getPlayers().size() - AIManager.getRankedPlayers().indexOf(initiator);\n\t\t\tplayerFactor /= (double)GM.getPlayers().size();\n\t\t\tplayerFactor *= 2.0;\n\t\t\tint initiatorTradeValue = 0;\n\t\t\tfor (Card item : otherPlayerTradeItems)\n\t\t\t\tinitiatorTradeValue += AICardEvaluator.getCardValueToPlayer(item, initiator, null);\n\t\t\tfor (Card item : initiatorTradeItems)\n\t\t\t\tinitiatorTradeValue -= AICardEvaluator.getCardValueToPlayer(item, initiator, null);\n\t\t\ttradeValue -= initiatorTradeValue * playerFactor;\n\t\t}\n\t\t\n\t\treturn (tradeValue >= 0);\n\t}", "@Override\n public void execute(IRetrievableStrategyTraderModel m) {\n try {\n m.buyEquityWithCommission(tickerSymbol, volume, time,\n portfolio, commission);\n } catch (Exception e) {\n if (e instanceof IllegalArgumentException) {\n System.out.println(e.getMessage());\n }\n System.out.println(ErrorMsg.CONTROLLER_BUY_STOCK_WITH_COMMISSION_FAIL.getMsg());\n }\n }", "public void doComputerTurn() {\n Random rand = new Random();\n int randInt;\n\n if (!currentPlayer.isEmployed()) { // player not employed\n // moves (but suppresses popups) at random and update of player panel\n tryMove();\n\n if (!(currentPlayer.getLocation().getName() == \"trailer\")) {\n if (currentPlayer.getLocation().getName() == \"office\") { // in office\n // upgrade (but suppresses popups) at random and update of player panel\n tryUpgrade();\n \n } else { // in regular set\n // take role (but suppresses popups) at random and update of player panel\n tryTakeRole();\n }\n }\n endTurn();\n } else { // player is employed\n randInt = rand.nextInt(2); // get either 0 or 1\n if (randInt == 0) {\n // rehearse\n tryRehearse(); \n } else {\n // act\n tryAct();\n }\n\n endTurn();\n }\n }", "private void communityChest(Player currentPlayer){\n Random rand = new Random();\n int randomNum = rand.nextInt((3 - 1) + 1) + 1;\n int nextPlayer;\n if(m_currentTurn >= m_numPlayers){\n nextPlayer = 0;\n } else {\n nextPlayer = m_currentTurn+1;\n }\n\n if(randomNum == 1){\n convertTextToSpeech(\"Your new business takes off, collect 200\");\n if(m_manageFunds) {\n Log.d(\"chance add 200\", currentPlayer.getName() +\n String.valueOf(currentPlayer.getMoney()));\n currentPlayer.addMoney(200);\n funds.setText(String.valueOf(currentPlayer.getMoney()));\n Log.d(\"chance add 200\", currentPlayer.getName() +\n String.valueOf(currentPlayer.getMoney()));\n }\n }\n if(randomNum == 2){\n convertTextToSpeech(\"Your friend hires your villa for a week, \" +\n \"collect 100 off the next player\");\n if(m_manageFunds) {\n Log.d(\"chance add 100\", currentPlayer.getName() +\n String.valueOf(currentPlayer.getMoney()));\n currentPlayer.addMoney(100);\n funds.setText(String.valueOf(currentPlayer.getMoney()));\n Log.d(\"chance add 100\", currentPlayer.getName() +\n String.valueOf(currentPlayer.getMoney()));\n\n Log.d(\"chance subtract 100\", players.get(nextPlayer).getName() +\n String.valueOf(players.get(nextPlayer).getMoney()));\n players.get(nextPlayer).subtractMoney(100);\n Log.d(\"chance subtract 100\", players.get(nextPlayer).getName() +\n String.valueOf(players.get(nextPlayer).getMoney()));\n }\n }\n if(randomNum == 3){\n convertTextToSpeech(\"You receive a tax rebate, collect 300\");\n if(m_manageFunds) {\n Log.d(\"chance add 300\", currentPlayer.getName() +\n String.valueOf(currentPlayer.getMoney()));\n currentPlayer.addMoney(300);\n funds.setText(String.valueOf(currentPlayer.getMoney()));\n Log.d(\"chance add 300\", currentPlayer.getName() +\n String.valueOf(currentPlayer.getMoney()));\n }\n }\n }", "private void doSummon(){\n AbstractPieceFactory apf = FactoryProducer.getFactory(tf.getActivePlayer().playerType());\n // check is null\n assert apf != null;\n // create a piece instance\n IPiece temp = apf.getPiece(PieceConstants.MINION, destination);\n // cast Ipiece to minions class\n newPiece = (Minion) temp;\n newPiece.healthProperty().addListener(new ChangeListener<Number>() {\n @Override\n public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {\n if (newValue.doubleValue() <= 0) {\n tf.removePiece(newPiece);\n tf.resetAbilityUsed();\n }\n if (oldValue.doubleValue() <= 0 && newValue.doubleValue() > 0) {\n tf.addPiece(newPiece);\n tf.resetAbilityUsed();\n }\n }\n });\n // set piece name\n newPiece.setPieceName(MinionName);\n // set piece health points\n startingHealth = newPiece.getHealth();\n // add piece to game\n tf.addPiece(newPiece);\n }", "protected void execute() {\n //pitch.setSpeed(translator.getValue());\n }", "void onRespawned(Need need, NeedLevel level, PlayerEntity player, PlayerEntity oldPlayer);", "@Override\n public void use(AbstractPlayer p, AbstractMonster m) {\n AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(p, p, new ArtifactPower(p, magicNumber), magicNumber));\n }", "private void suarez() {\n\t\ttry {\n\t\t\tThread.sleep(5000); // espera, para dar tempo de ver as mensagens iniciais\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tint xInit = -10;\n\t\tint yInit = 8;\n\t\tplayerDeafaultPosition = new Vector2D(xInit*selfPerception.getSide().value(), yInit*selfPerception.getSide().value());\n\t\twhile (commander.isActive()) {\n\t\t\t\n\t\t\tupdatePerceptions(); // deixar aqui, no começo do loop, para ler o resultado do 'move'\n\t\t\tswitch (matchPerception.getState()) {\n\t\t\tcase BEFORE_KICK_OFF:\n\t\t\t\tcommander.doMoveBlocking(xInit, yInit);\t\t\t\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase PLAY_ON:\n\t\t\t\t//state = State.FOLLOW;\n\t\t\t\texecuteStateMachine();\n\t\t\t\tbreak;\n\t\t\tcase KICK_OFF_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase KICK_OFF_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CORNER_KICK_LEFT: // escanteio time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CORNER_KICK_RIGHT: // escanteio time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase KICK_IN_LEFT: // lateral time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\tcase KICK_IN_RIGHT: // lateal time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_LEFT: // Tiro livre time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_RIGHT: // Tiro Livre time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_FAULT_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_FAULT_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase GOAL_KICK_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase GOAL_KICK_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase AFTER_GOAL_LEFT:\n\t\t\t\tcommander.doMoveBlocking(xInit, yInit);\n\t\t\t\tbreak;\n\t\t\tcase AFTER_GOAL_RIGHT:\n\t\t\t\tcommander.doMoveBlocking(xInit, yInit);\n\t\t\t\tbreak;\n\t\t\tcase INDIRECT_FREE_KICK_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase INDIRECT_FREE_KICK_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\t}", "public void trade(String creatureName, World world) {\n\t\tCreature creature = world.dbCreatures().get(creatureName);\n\t\tRoom room = super.getRoom();\n\t\tList<Creature> roomCreatures = room.getCreatures();\n\t\tif (roomCreatures.contains(creature)) {\n\t\t\tif (creature.isStudent()){\n\t\t\t\tStudent student = (Student) creature;\n\t\t\t\tstudent.trade(this);\n\t\t\t} else if (creature.isTeacher()) {\n\t\t\t\tSystem.out.println(\"I don't think teachers takes kindly to bribes...\");\n\t\t\t}\n\n\t\t} else {\n\t\t\tSystem.out.println(\"No person called '\" + creatureName + \"' in the room.\");\n\t\t}\n\t}", "public TradeResult(int numberTraded, double price, int action) {\r\n this.numberTraded = numberTraded;\r\n this.price = price;\r\n this.action = action;\r\n }", "public static void handleMagicImbue(Player player) {\n\t\t\n\t}", "public void doAction(Player currentPlayer) {\n\t \n\t if(advanceNum == -1)\n\t {\n\t\t currentPlayer.setSpace(0);\n\t\t Action a = new BankPaymentAction(200);\n\t\t a.doAction(currentPlayer); //Pay $200\n\t }\n\t \n\t else\n\t {\n\t\t // We must then run the space action, with proper ui prompts\n\t\t \n\t\t if(currentPlayer.getSpace() + advanceNum > 39)\n\t\t {\n\t\t\t Action a = new BankPaymentAction(200);\n\t\t\t a.doAction(currentPlayer); //Pay $200\n\t\t }\n\t\t \n\t\t currentPlayer.setSpace((currentPlayer.getSpace() + advanceNum) % 40);\n\t }\n\t \n\n }", "public void becomePremium() {\n\t\tif (this.account >= 100 && this.premium == false) {\n\t\t\tthis.account -= 100;\n\t\t\tthis.premium = true;\n\t\t\tSystem.out.println(\"Premium transaction successful\");\n\n\t\t} else if (this.premium == true) {\n\t\t\tSystem.out.println(\"They are already a premium user!\");\n\n\t\t} else {\n\t\t\tSystem.err.println(\n\t\t\t\t\t\"Error - not enough funds in account.\\nPremium charge is $100\\nBalance: $\" + this.getBalance() + \"\\nPlease top up account manually.\\nReturning to main menu.\");\n\t\t}\n\t}", "@Override\n\tpublic void action(Player player) {\n\t\tfireMessageEvent(player.getPlayerId());\n\t\tplayer.setPosition(jail);\n\t\tplayer.setInJail(true);\n\t}" ]
[ "0.62243253", "0.61569524", "0.59674215", "0.5841733", "0.5797932", "0.5793388", "0.564205", "0.5616023", "0.5615112", "0.5610372", "0.5533093", "0.552664", "0.5515148", "0.5506361", "0.55047464", "0.5498274", "0.54584813", "0.5456778", "0.54503125", "0.5446954", "0.54456735", "0.5442931", "0.5434755", "0.5429595", "0.54206866", "0.54057807", "0.53940916", "0.53914106", "0.53903586", "0.5382886", "0.53816646", "0.5374672", "0.53741884", "0.53741884", "0.5373735", "0.5369242", "0.5363246", "0.535725", "0.5345614", "0.53384584", "0.53301775", "0.5319655", "0.5302775", "0.5295988", "0.52877915", "0.5277456", "0.52680844", "0.52640724", "0.52579516", "0.5254686", "0.52516866", "0.5247779", "0.5247269", "0.5246705", "0.52399933", "0.5234906", "0.5234484", "0.5225268", "0.5212521", "0.5208898", "0.5207964", "0.5204962", "0.51986736", "0.51967645", "0.5192686", "0.51885194", "0.51879007", "0.51873606", "0.5180308", "0.5176213", "0.51663315", "0.5166138", "0.5164557", "0.5155084", "0.51533043", "0.51510924", "0.515006", "0.5148706", "0.5148214", "0.51370174", "0.5136753", "0.5135554", "0.5134894", "0.51320523", "0.51220345", "0.5121187", "0.5112134", "0.51105267", "0.5104181", "0.5103976", "0.51015806", "0.5093347", "0.50877947", "0.5085739", "0.50842613", "0.50841093", "0.50837916", "0.50775605", "0.5073085", "0.50722086", "0.5065998" ]
0.0
-1
This method is called when the player tries to finish his/her turn
boolean CanFinishTurn();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void finishTurn();", "public void onTurnEnd() {\n\n\t}", "private void endTurn() {\n currentTurn = getNextPlayer();\n }", "@Override\r\n\tpublic void endTurn() {\n\t\t\r\n\t}", "void completeTurn() {\n\n\t\tremoveNotification();\n\n\t\tString matchId = match.getMatchId();// The Id for our match\n\t\tString pendingParticipant = GPGHelper.getOpponentId(\n\t\t\t\tgameHelper.getApiClient(), match);// We set who's turn it\n\t\t// is next since\n\t\t// we're done,\n\t\t// should always be\n\t\t// opponents turn\n\t\t// for us.\n\t\tbyte[] gameState = writeGameState(match);// We build the game state\n\t\t\t\t\t\t\t\t\t\t\t\t\t// bytes from the current\n\t\t\t\t\t\t\t\t\t\t\t\t\t// game state.\n\n\t\t// This actually tries to send our data to Google.\n\t\tGames.TurnBasedMultiplayer.takeTurn(gameHelper.getApiClient(), matchId,\n\t\t\t\tgameState, pendingParticipant).setResultCallback(\n\t\t\t\tnew ResultCallback<TurnBasedMultiplayer.UpdateMatchResult>() {\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onResult(UpdateMatchResult result) {\n\t\t\t\t\t\tturnUsed = true;\n\n\t\t\t\t\t\t// TODO:Handle this better\n\t\t\t\t\t\tif (!GooglePlayGameFragment.this.checkStatusCode(match,\n\t\t\t\t\t\t\t\tresult.getStatus().getStatusCode())) {\n\t\t\t\t\t\t\tLog.d(\"test\", result.getStatus().getStatusCode()\n\t\t\t\t\t\t\t\t\t+ \" Something went wrong\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t}", "public void finishTurn() {\n\t\tthis.cancelTimer();\n\t\t// if any hero is dead\n\t\tif (!opponents[0].isAlive() || !opponents[1].isAlive()) {\n\t\t\t// end the game\n\t\t\tfinishGame();\n\t\t} else {\n\t\t\t// switch turns\n\n\t\t\topponents[activeHero].setIsTurn(false);\n\t\t\topponents[activeHero].deselectAll();\n\n\t\t\tswitch (activeHero) {\n\t\t\tcase 0:\n\t\t\t\tactiveHero = 1;\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tactiveHero = 0;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tstartTurn(opponents[activeHero]);\n\t\t}\n\t}", "public void endOfTurn();", "public void playerFinishedGoNext() {\n\t\t// If game is over we don't want to switch turn.\n\t\tif (!isOver()) {\n\t\t\tswitchTurn();\n\t\t}\n\t}", "public void endTurn() {\n }", "void askEndTurn();", "@Override\n public void endTurn() {\n battle.setState(new EnemyTurn(battle));\n battle.continueBattle();\n }", "public void endTurn() {\r\n\t\tSystem.out.println(\"[DEBUG LOG/Game.java] Started endTurn() for player \"+currentPlayer.getNumber());\r\n\t\tturnIsEnding = true;\r\n\r\n\t\t// End turn restrictions\r\n\t\tif (!currentPlayer.isDead() && !currentPlayer.isFree() && !currentPlayer.hasQuit()) {\r\n\t\t\tif (currentPlayer.getPlayArea().getNonPlayedSize() > 0) {\r\n\t\t\t\tgameChannel.sendMessage(\"**[ERROR]** Cannot end turn until all cards in play area are played\").queue();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (mustChoose.size() > 0) {\r\n\t\t\t\tgameChannel.sendMessage(\"**[ERROR]** Cannot end turn until all choices are made\").queue();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (mustTrash.size() > 0) {\r\n\t\t\t\tgameChannel.sendMessage(\"**[ERROR]** Cannot end turn until all trashes are made\").queue();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t// Don't need to discard\r\n\t\t}\r\n\t\t\r\n\t\t// Mass deletes\r\n\t\tclearMessages();\r\n\t\t\r\n\t\t// If just escaped, send message after clearing\r\n\t\tif (currentPlayer.getCurrentRoom() == 0 && currentPlayer.getPiece().getX() == GlobalVars.playerCoordsPerRoom[39][0]) {\r\n\t\t\t// Update room\r\n\t\t\tcurrentPlayer.setCurrentRoom(39);\r\n\t\t\tif (firstEscapee == currentPlayer) {\r\n\t\t\t\tgameChannel.sendMessage(\":helicopter: **\"+currentName+\"** was the first to escape! They received a **20** :star: **Mastery Token**\\n:skull: Only **4** turn(s) left!\").queue();\r\n\t\t\t} else {\r\n\t\t\t\tgameChannel.sendMessage(\":helicopter: **\"+currentName+\"** escaped in time! They received a **20** :star: **Mastery Token**\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Set cards in PlayArea to not played for next time, Undos the Discarded tag\r\n\t\tfor (int i = 0; i < currentPlayer.getPlayArea().getSize(); i++) {\r\n\t\t\tcurrentPlayer.getPlayArea().getCard(i).setPlayed(false);\r\n\t\t\tif (currentPlayer.getPlayArea().getCard(i).toStringHand().contentEquals(\"*[Discarded]*\")) currentPlayer.getPlayArea().getCard(i).setStringInHand();\r\n\t\t}\r\n\t\t\r\n\t\t// Clear swords, skill, boots, etc\r\n\t\tcurrentPlayer.endOfTurnReset();\r\n\t\tmustDiscard.clear();\r\n\t\t\r\n\t\t// Replaces cards in dungeon row. Only one attack per turn\r\n\t\tif (!status.contentEquals(\"over\")) {\r\n\t\t\tboolean hasAttackedThisTurn = false;\r\n\t\t\tfor (int i = 0; i < 6; i++) {\r\n\t\t\t\t// Checks to see if it should replace card\r\n\t\t\t\tif (dungeonRow[i].isBought()) {\r\n\t\t\t\t\tdungeonRow[i] = mainDeck.getNext();\r\n\t\t\t\t\tif (dungeonRow[i].isDragonAttack() && !hasAttackedThisTurn) {\r\n\t\t\t\t\t\tdragonAttack(cubesPerLevel[attackLevel]);\r\n\t\t\t\t\t\thasAttackedThisTurn = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (dungeonRow[i].isHasArrive()) {\r\n\t\t\t\t\t\tdoArriveEffect(dungeonRow[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tmainDeck.removeTop();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Instantly go on to next player if no dragon attack\r\n\t\t\tif (!hasAttackedThisTurn) {\r\n\t\t\t\tdetermineNextPlayer();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public void endTurn() {\n\t\tturnEnd = false;\n\t\tmadeMove = false;\n\t\tcurrentPlayer.resetUndos();\n\t\tif (currentPlayer == player1) {\n\t\t\tcurrentPlayer = player2;\n\t\t} else {\n\t\t\tcurrentPlayer = player1;\n\t\t}\n\t\t//printBoard();\n\t\tSystem.out.println(\"It is now \" + currentPlayer.getName() + \"'s turn\");\n\t}", "public void finishGame() {\r\n gameFinished = true;\r\n }", "public void Gamefinished()\n\t\t{\n\t\t\tplayers_in_game--;\n\t\t}", "private void doLastTurn()\n\t{\n\t\tInteger time = turn;\n\n\t\tstartEnterScore(time);\n\t\tdisposeFrameMap();\n\n\t\ttimer.cancel();\n\t}", "private void endTurn() {\n\t\t// Upon completion of move, change the color of the current turn.\n\t\tif (currentTurnColor == PlayerColor.RED) {\n\t\t\tcurrentTurnColor = PlayerColor.BLUE;\n\t\t} else {\n\t\t\tcurrentTurnColor = PlayerColor.RED;\n\t\t}\n\n\t\tturnsCounter++;\n\t}", "public void endTurn(){\n game.setNextActivePlayer();\n myTurn = false;\n\n stb.updateData(\"playerManager\", game.getPlayerManager());\n stb.updateData(\"aktivePlayer\", game.getPlayerManager().getAktivePlayer());\n stb.updateData(\"roomList\", game.getRoomManager().getRoomList());\n\n getIntent().putExtra(\"GAME\",game);\n getIntent().putExtra(\"myTurn\", false);\n finish();\n if(!game.getPlayerManager().getPlayerList().get(whoAmI).isDead())\n startActivity(getIntent());\n else\n fcm.unbindListeners();\n }", "public void finishGame(){\r\n\t\t\t\tgameStarted = false;\r\n\t\t\t}", "public void action(){\n turn.sendMsg(turn.getController().getTurnOwner().getName()+\"'s turn!\");\n if(turn.getPlayer().isDown()){\n turn.setPhase(new RecoveryPhase());\n }else {\n turn.setPhase(new StarsPhase());\n }\n }", "public void endTurn() {\n \t\t// add new cards to the set of usable cards\n \t\tfor (int i = 0; i < newCards.size(); i++)\n \t\t\tcards[newCards.get(i).ordinal()] += 1;\n \n \t\tnewCards.clear();\n \t\tusedCard = false;\n \n \t\tappendAction(R.string.player_ended_turn);\n \t}", "public void endTurn() {\n controller.endTurn();\n }", "void gameFinished(Turn turn) throws IOException;", "public void toEndingTurn() {\n }", "public void endTurn() {\n suggestionMade = false;\n locAtTurnStart = currentPlayersTurn.getPiece().getLocation();\n accusationChoices = new CardChoice();\n suggestionChoices = new CardChoice();\n turnIndicator = (turnIndicator + 1) % playerOrder.size();\n currentPlayersTurn = playerOrder.get(turnIndicator).getKey();\n currentPlayersSteps = 0;\n }", "public void endUserTurn() {\n\t\tupdateUserTeam();\n\n\t\tusers.get(userTurn).setTransferFinished(true);\n\t\tPlayRound.endUserTurn();\n\t\tMainGui.showCardLayout(\"panelPlayRound\");\n\n\t}", "public void endTurnCurrent() {\n playerStatus.nActionsDone = 0;\n playerStatus.isActive = false;\n playerStatus.isFirstTurn = false;\n }", "private void endTurn(){\r\n String currentPlayer = cantStop.getGameBoard().getCurrentPlayer().getName();\r\n\t\tgameOver = cantStop.getGameBoard().endTurn(didBust);\r\n\t\t\r\n\t\tif(gameOver){\r\n\t\t\tstatusLabel.setText(currentPlayer + \r\n\t\t\t\t\t\" wins! Go again?\");\r\n\t\t\tupdate();\r\n\t\t} else {\r\n\t\t\tcantStop.getGameBoard().startNewTurn();\r\n\t\t\tallowNewRoll();\r\n\t\t}\r\n\t}", "public void buttonEndTurn() {\n\t\tendTurn();\n\t\t}", "public void endTurn()\n\t{\n\t\tthis.decrementEffectDurations();\n\t\tdoneWithTurn = true;\n\t}", "private void endTurn() {\n\t\t\n\t\tif (roundChanger == 1) {\n\t\t\tString currentPlayer = textFieldCurrentPlayer.getText();\n\t\t\tif (currentPlayer.equals(\"Player1\")) {\n\t\t\t\ttextAreaInstructions.setText(\"The current roll to beat is \" + player1.getDie1()\n\t\t\t\t+ \" \" + player1.getDie2() + \" \" + player1.getDie3());\n\t\t\t\trollToBeat = \"The current roll to beat is \" + player1.getDie1()\n\t\t\t\t+ \" \" + player1.getDie2() + \" \" + player1.getDie3();\n\t\t\t} else {\n\t\t\t\ttextAreaInstructions.setText(\"The current roll to beat is \" + player2.getDie1()\n\t\t\t\t+ \" \" + player2.getDie2() + \" \" + player2.getDie3());\n\t\t\t\trollToBeat = \"The current roll to beat is \" + player2.getDie1()\n\t\t\t\t+ \" \" + player2.getDie2() + \" \" + player2.getDie3();\n\t\t\t} \n\t\t\tchangeCurrentPlayerText();\n\t\t\tturn = 0;\n\t\t\troundChanger = 2;\n\t\t} else {\n\t\t\tString winningPlayer = calculateScore(player1, player2);\n\t\t\ttextFieldCurrentPlayer.setText(winningPlayer);\n\t\t\troundChanger = 1;\n\t\t\trollsTaken = 0;\n\t\t\tround = round + 1;\n\t\t\ttextFieldPlayerOneScore.setText(Integer.toString(player1.getPoints()));\n\t\t\ttextFieldPlayerTwoScore.setText(Integer.toString(player2.getPoints()));\n\t\t\ttextAreaInstructions.setText(\"Try to get the highest roll possible!\");\n\t\t\tcheckForGameOver();\n\t\t}\n\t\ttogglebtnD1.setSelected(false);\n\t\ttogglebtnD2.setSelected(false);\n\t\ttogglebtnD3.setSelected(false);\n\t\tdisableDice();\n\t\tturn = 0;\n\t}", "public void endTurn() {\r\n\t\tcontraband.clear();\r\n\t\tactions = 1;\r\n\t\tbuys = 1;\r\n\t\tif(treasure > 0) treasure = 0;\r\n\t\tpotion = 0;\r\n\t\tcoppersmith = 0;\r\n\t\tbridge = 0;\r\n\t\tquarry = 0;\r\n\t\tdeck.cleanUp();\r\n\t\taccess.log(getPlayerName() + \"'s Deck: \" + deck.toString());\r\n\t\taccess.log(getPlayerName() + \"'s turn ended\");\r\n\t\tnotifyObservers();\r\n\t}", "private void doGameTurn()\n\t{\n\t\tif (!lost && !won)\n\t\t{\n\t\t\trefreshMapAndFrame();\n\t\t\t\n\t\t\tcheckPlayerCondition();\n\t\t\tElementAccess.openExit();\n\t\t\tSystem.out.println(turn);\n\t\t}\n\t\telse if (lost)\n\t\t{\n\t\t\tSound.lost();\n\t\t\trefreshMapAndFrame();\n\n\t\t\tif (playerHasLost())\n\t\t\t{\n\t\t\t\tstop = true;\n\t\t\t}\n\n\t\t\tMapInstance.getInstance().levelRestart();\n\t\t\tlost = false;\n\t\t}\n\t\telse if (won)\n\t\t{\n\t\t\tSound.won();\n\t\t\trefreshMapAndFrame();\n\n\t\t\twon = false;\n\t\t\tif (playerNotInLevel())\n\t\t\t{\n\t\t\t\tstop = true;\n\t\t\t}\n\n\t\t\tnextLevel();\n\t\t\tMapInstance.getInstance().levelRestart();\n\t\t}\n\t}", "public void endTurn() {\r\n\t\tPlayer endingPlayer = getCurrentPlayer();\r\n\t\t\r\n\t\t// Show plays and buys during turn change screen\r\n\t\tArrayList<Card> plays = new ArrayList<>();\r\n\t\tArrayList<Card> gains = new ArrayList<>();\r\n\t\tplays.addAll(endingPlayer.deck.duration);\r\n\t\tplays.addAll(endingPlayer.deck.play);\r\n\t\tgains.addAll(endingPlayer.deck.gained);\r\n\t\tif(showGraphics) getGUI().showPlayerBuys(plays, gains);\r\n\t\t\r\n\t\t//Check the card ownership in decks is correct\r\n\t\tfor(Player p : players) {\r\n\t\t\tfor(Card c : p.deck.getDeck()) {\r\n\t\t\t\tif(c.getPlayer() == null) {\r\n\t\t\t\t\tthrow new RuntimeException(c.getName() + \" has no owner, in deck of \"\r\n\t\t\t\t\t\t\t+ p.getPlayerName());\r\n\t\t\t\t}\r\n\t\t\t\tif(!c.getPlayer().equals(p)) {\r\n\t\t\t\t\tthrow new RuntimeException(c.getName() + \" owned by \"\r\n\t\t\t\t\t\t\t+ c.getPlayer().getPlayerName() + \", in deck of \" + p.getPlayerName());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Check for duplicated cards\r\n\t\tfor(Player p : players) {\r\n\t\t\tList<Card> deck = p.deck.getDeck();\r\n\t\t\tfor(int i = 0; i < deck.size(); i++) {\r\n\t\t\t\tfor(int j = i + 1; j < deck.size(); j++) {\r\n\t\t\t\t\tif(deck.get(i) == deck.get(j)) {\r\n\t\t\t\t\t\tthrow new RuntimeException(deck.get(i) + \r\n\t\t\t\t\t\t\t\t\" in 2 places in deck of \" + p.getPlayerName());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//Run player-specific turn ending things\r\n\t\tgetCurrentPlayer().endTurn();\r\n\r\n\t\t//Change whose turn it is\r\n\t\tif(!extraTurn) {\r\n\t\t\tnextTurn();\r\n\t\t}\r\n\t\textraTurn = false;\r\n\r\n\t\t//Check if the game is over\r\n\t\tif(board.isGameOver()) {\r\n\t\t\tgetClient().stopThreads();\r\n\t\t\tmodels.close();\r\n\t\t\tif(showGraphics) getGUI().showScores();\r\n\t\t\tfor(Player p : players) {\r\n\t\t\t\tif(p.isComputerPlayer()) {\r\n\t\t\t\t\tp.getComputerPlayer().close();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t//Change Turn \r\n\t\tif(showGraphics && !getCurrentPlayer().isComputerPlayer()) {\r\n\t\t\tgetGUI().turnNotify();\r\n\t\t}\r\n\r\n\t\t//Resets game phase\r\n\t\tgamePhase = 0;\t\r\n\r\n\t\t//Starts the next person's turn\r\n\t\tgetCurrentPlayer().startTurn();\r\n\t\t\r\n\t\t\r\n\t\t//Save changes to server\r\n\t\tif(showGraphics && getGUI().getMyPlayer().equals(endingPlayer)) {\r\n\t\t\tgetClient().backupGame(this);\r\n\t\t}\r\n\r\n\t\t//Check the decks are correct between computers\r\n\t\tif(showGraphics && getGUI().getMyPlayer().equals(endingPlayer)) {\r\n\t\t\tfor(Player p : players) {\r\n\t\t\t\tgetClient().sendString(\"CHECK \" + p.getPlayerNum() + \" \" + p.deck.toString());\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public void endTurn() {\n\t\tfireChanges();\n\t\t\n\t\tif(!isConfirmed())\n\t\t\tfirePropertyChange(Handler.END_TURN_PROPERTY, \"Do you want to confirm ending your turn?\");\n\t\telse{\n\t\t\tAbstractGameCommand endTurnCommand = new EndTurnCommand(getGame());\n\t\t\tendTurnCommand.execute();\n\t\t\t\n\t \tfirePropertyChange(Handler.CURRENT_PLAYER_PROPERTY, getGame().getCurrentPlayer().getName());\n\t\t\tresetConfirm();\n\t\t}\n\t\t\n\t\tfireChanges();\n\t}", "public void endTurn()\n {\n revealedCardsScreen.setVisible(false);\n accusationScreen.setVisible(false);\n\n this.played = false;\n\n //call client controller's end turn method\n clientController.endTurn();\n }", "private void finishPlayAlong() {\n\n callback.questionPressed(null, score, lives); // ENDS this question\n\n }", "void waitingForMyTurn();", "@Override\n\tpublic void onTurnEnded(TurnEndedEvent event) {\n\t\tsuper.onTurnEnded(event);\n\t}", "void gameFinished();", "public abstract void userTurnEnds(long ms);", "void notifyPlayerHasAnotherTurn();", "public void handleEndTurn(ActionEvent event){\n sender.sendInput(\"end turn\");\n }", "public void endTurn() {\n if (getActiveColor() == Piece.COLOR.RED) {\n setActivePlayer(Piece.COLOR.WHITE);\n } else {\n setActivePlayer(Piece.COLOR.RED);\n }\n }", "public void endGame() {\n\t\twaitingPlayers.addAll(players);\n\t\tplayers.clear();\n\t\tfor(ClientThread player: waitingPlayers) {\n\t\t\tplayer.points = 0;\n\t\t\tplayer.clientCards.clear();\n\t\t}\n\t\twinners = 0;\n\t\tlosers = 0;\n\t\tpassCounter = 0;\n\t\tdeck.init();\n\t\tview.changeInAndWait(players.size(), waitingPlayers.size());\n\t\tview.writeLog(\"-------------GAME END--------------\");\n\t\tstatus = \"waiting\";\n\t\tstatusCheck();\n\t}", "public void imFinished() {\n isUserDone = true;\n layoutUserReady.setVisibility(View.VISIBLE);\n\n String userTextToShow = \"\";\n switch (challengeType) {\n case TIME:\n userTextToShow = getString(R.string.user_finished) +\n \"\\n\" +\n getString(R.string.final_distance) +\n (int)((ChallengeSenderFragment)senderFragment).getRun().getTrack().getDistance() +\n getString(R.string.meters);\n break;\n case DISTANCE:\n userTextToShow = getString(R.string.user_completed) +\n challengeGoal + getString(R.string.km) +\n getString(R.string.white_space) + getString(R.string.in) +\n UtilsUI.timeToString((int)((ChallengeSenderFragment)senderFragment).getRun().getDuration(),\n true);\n break;\n }\n userTxt.setText(userTextToShow);\n //noinspection deprecation\n userStatus.setImageDrawable(getResources().getDrawable(R.drawable.finish_icon));\n\n fragmentManager.beginTransaction().remove(senderFragment).commitAllowingStateLoss();\n\n challengeProxy.imFinished();\n\n if (isOpponentDone) {\n isIntendedActivityExit = true;\n endChallenge();\n }\n }", "public void inTurn() {\n\t\tthis.timer = new Timer();\n\t\ttimer.schedule(new TimerTask() {\n\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tfinishTurn();\n\t\t\t}\n\t\t}, turnMaxSeconds * 1000);\n\n\t}", "public void endOfTurn() {\n if (playerInTurn.equals(Player.RED)) {\n playerInTurn = Player.BLUE;\n observers.turnEnds(playerInTurn, age);\n controlStrategy.playRound(this);\n return;\n }\n\n // If blue is in turn, change player in turn to red and do end-of-round processing.\n playerInTurn = Player.RED;\n\n // Calculate the age of the game in the next round.\n age = ageStrategy.calculateAge(age);\n\n // Restore the move count of all the units.\n for (Position p : world.getUnitPositions()) {\n world.getUnitAt(p).restoreMoveCount();\n }\n\n // For each city, add 6 to the current amount of production, and produce as many units as it can afford.\n for (Position p : world.getCityPositions()) {\n ModifiableCity city = world.getCityAt(p);\n\n workForceStrategy.gatherFoodAndProduction(world, p);\n\n populationStrategy.populationGrowth(world, p);\n\n // produce units!\n city.produceUnits(world, p, observers);\n }\n // Add to the counter of rounds played in the game.\n roundsPlayed++;\n\n observers.turnEnds(playerInTurn, age);\n\n controlStrategy.playRound(this);\n\n }", "void gameFinished(String message) {\n leader.acknowledgeGameFinished(message);\n opponent.acknowledgeGameFinished(message);\n\n leader.requestRematch();\n opponent.requestRematch();\n }", "void finishMatch() {\n\t\tint playerResult = ParticipantResult.MATCH_RESULT_NONE;\n\t\tint opponentResult = ParticipantResult.MATCH_RESULT_NONE;\n\n\t\tif (!GameActivity.gameMachine.player.isAlive()) {\n\t\t\tLayoutHelper.showResult(resultTextView, false);\n\t\t\tplayerResult = ParticipantResult.MATCH_RESULT_LOSS;\n\t\t\topponentResult = ParticipantResult.MATCH_RESULT_WIN;\n\t\t} else if (!GameActivity.gameMachine.opponent.isAlive()) {\n\t\t\tLayoutHelper.showResult(resultTextView, true);\n\t\t\tplayerResult = ParticipantResult.MATCH_RESULT_WIN;\n\t\t\topponentResult = ParticipantResult.MATCH_RESULT_LOSS;\n\t\t}\n\n\t\tArrayList<ParticipantResult> results = new ArrayList<ParticipantResult>();\n\n\t\tresults.add(new ParticipantResult(GPGHelper.getMyId(\n\t\t\t\tgameHelper.getApiClient(), match), playerResult,\n\t\t\t\tParticipantResult.PLACING_UNINITIALIZED));\n\n\t\tresults.add(new ParticipantResult(GPGHelper.getOpponentId(\n\t\t\t\tgameHelper.getApiClient(), match), opponentResult,\n\t\t\t\tParticipantResult.PLACING_UNINITIALIZED));\n\n\t\tif (match.getStatus() == TurnBasedMatch.MATCH_STATUS_ACTIVE) {\n\t\t\tif (match.getTurnStatus() == TurnBasedMatch.MATCH_TURN_STATUS_MY_TURN) {\n\t\t\t\tGames.TurnBasedMultiplayer.finishMatch(\n\t\t\t\t\t\tgameHelper.getApiClient(), match.getMatchId(),\n\t\t\t\t\t\twriteGameState(match), results);\n\t\t\t\tturnUsed = true;\n\t\t\t\tremoveNotification();\n\t\t\t}\n\t\t} else if (match.getStatus() == TurnBasedMatch.MATCH_STATUS_COMPLETE) {\n\t\t\tif (match.getTurnStatus() == TurnBasedMatch.MATCH_TURN_STATUS_MY_TURN) {\n\t\t\t\tGames.TurnBasedMultiplayer.finishMatch(\n\t\t\t\t\t\tgameHelper.getApiClient(), match.getMatchId());\n\t\t\t}\n\t\t}\n\t}", "public void finishPhase(TurnTracker turn_tracker_pointer, int player_index);", "private void gameTimerOnFinish() {\n if (currentScreenGameState == GameState.PLAYING) {\n stopGame();\n }\n }", "public void nextTurn() {\n visionChanged = true;\n SoundPlayer.playEndTurn();\n // Check if any protection objectives have failed\n gameState.updateAllHeroProtectionGoals(getHeroManager());\n // hook the next turn\n if (!multiplayerGameManager.hookNextTurn()) {\n\n if (map.enemyPerformingMove()) {\n return;\n }\n // Enemy action was made\n if (playerTurn && map.hasEnemy()) {\n try {\n map.enemyTurn(this);\n } catch (InterruptedException e) {\n logger.error(\"ayylmao at the GameManager.nextTurn(..) Method\");\n Platform.exit();\n Thread.currentThread().interrupt();\n }\n } else {\n map.playerTurn(this);\n updateBuffIcons();\n updateTempVisiblePoints();\n map.turnTick();\n for(CurrentHeroChangeListener listener:heroChangeListeners){\n \tlistener.onHeroChange(getHeroManager().getCurrentHero());\n }\n }\n\n } else {\n moveViewTo(getHeroManager().getCurrentHero().getX(), getHeroManager().getCurrentHero().getY());\n updateBuffIcons();\n updateTempVisiblePoints();\n }\n\n map.updateVisibilityArray();\n dayNightClock.tick();\n turnTickLiveTiles();\n abilitySelected = AbilitySelected.MOVE;\n abilitySelectedChanged = true;\n backgroundChanged = true;\n gameChanged = true;\n minimapChanged = true;\n saveOriginator.writeMap(this.map, this.getObjectives(), this.gameState);\n // update(this.tracker,null);\n }", "@Override\n public void finishTurn() throws ModelException {\n logger.entering(\"shared.model.ServerModelFacade\", \"finishTurn\");\n\n IPlayer p = GameModelFacade.instance().getLocalPlayer();\n logger.fine(\"Player \" + p.getName() + \" ended turn.\");\n\n if (!GameModelFacade.instance().localPlayerIsPlaying()\n && !GameModelFacade.instance().localPlayerIsPlacingInitialPieces()) {\n throw new ModelException(\"Preconditions for action not met.\");\n }\n\n try {\n String clientModel = m_theProxy.finishTurn(p.getIndex());\n new ModelInitializer().initializeClientModel(clientModel, m_theProxy.getPlayerId());\n } catch (NetworkException e) {\n throw new ModelException(e);\n }\n\n logger.exiting(\"shared.model.ServerModelFacade\", \"finishTurn\");\n }", "static void playerLost() {\n\n\t\tSystem.exit(0); // This code ends the program\n\t}", "public void endTurn() {\n \tselectedX = -1;\n \tselectedY = -1;\n \tmoveToX = -1;\n \tmoveToY = -1;\n \toneMove = false;\n \thasMoved = false;\n\t\tplayer = 0 - player;\n\t\tfor (int i = 0; i < N; i++) {\n for (int j = 0; j < N; j++) {\n \tif (pieces[i][j]) {\n \t\tboardPieces[i][j].doneCapturing();\n \t}\n }\n\t\t}\n\t}", "public void onFinish() {\n\t\tthis.notRewarded.putAll(Bake_Auxillary.rewardPlayers(projectReminderList, activeQuest.getLoot(bakeInstance.API_LEVEL), activeQuest.getThreshold(), activeQuest.getName()));\n\t\tnewQuest();\n\t}", "public void roundEnded() {\n\t\t\n\t\t// Deduct a life from the currently active player.\n\t\t// Increment the current round number by 1.\n\t\tdeductLife();\n\t\tincrementCurrentRoundNumber();\n\t\t\n\t\t// Switch which player is now active. \n\t\tswitchPlayer();\n\t}", "public void dealerTurn() {\n\t\tview.writeLog(\"All players pass, dealer's turn.\");\n\t\tdealer.send(new Package(\"MESSAGE\",\"Now is your turn.\"));\n\t\tdealer.send(new Package(\"ASK\",null));\n\t}", "public void endGame() {\n Player player = playerManager.getWinner();\n MainActivity mainActivity = (MainActivity) this.getContext();\n updateLiveComment(\"Winner : \" + player.getName());\n mainActivity.setAlertDialog(player.getName()+\" Wins !\", \"Congratulations\", true);\n }", "void finishSwitching();", "@Override\r\n\tpublic void updateGameFinished() {\n\t\t\r\n\t}", "public void doTurn() {\n\t\tGFrame.getInstance().aiHold();\n\t}", "public void failedChallenge() {\n addGameRound(false);\n playedRounds++;\n updateActivePlayer();\n updateActiveChallenge();\n }", "private void finaliseGame() {\r\n gameOn = false;\r\n if(bestAnswer==null) {\r\n target.reply(\"Nobody got an answer. The best answer was: \" + CountdownSolver.Solve( sourceNumbers, targetNumber ));\r\n return;\r\n }\r\n if( bestAnswer.getAnswer() == bestPossibleAnswer ) {\r\n String reply = Constants.BOLD + bestAnswer.getUsername() + Constants.BOLD\r\n + \" has won with \" + bestAnswer.getAnswer() + \"!\";\r\n if( bestPossibleAnswer!=targetNumber)\r\n reply+=\" This was the best possible answer.\";\r\n target.reply(reply);\r\n } else {\r\n target.reply( \"The best answer was \" + bestAnswer.getAnswer() + \" by \" + bestAnswer.getUsername() + \".\"\r\n + \" But the best possible answer was: \" + CountdownSolver.Solve( sourceNumbers, targetNumber ));\r\n }\r\n bestAnswer=null;\r\n runner.stop();\r\n }", "public void startTurn(){\n if (hasWinner()){\n announceWinner();\n return;\n }\n\n gameDraft();\n gameAttack();\n if (hasWinner()) return; //Skipping fortify if the game is won\n gameFortify();\n displayMessage(\"End of \" + currentPlayer.getName() + \"'s turn!\");\n }", "public void tryRehearse() {\n if (currentPlayer.isEmployed() == true) {\n if(!currentPlayer.getHasPlayed()){\n currentPlayer.rehearse();\n }\n else{ \n view.showPopUp(currentPlayer.isComputer(), \"You've already moved, rehearsed or acted this turn. Try a different command or click `end turn` to end your turn.\");\n }\n }\n else {\n view.showPopUp(currentPlayer.isComputer(), \"You're not employed, so you need to take a role before you can rehearse.\");\n }\n view.updateSidePanel(playerArray);\n }", "public void endTurn() {\n\t\tif (whoseTurn == 0) {\n\t\t\twhoseTurn = 1;\n\t\t} else {\n\t\t\twhoseTurn = 0;\n\t\t}\n\t\thasMoved = false;\n\t\thasSelected = false;\n\t\tif (prevSelected != null) {\n\t\t\tprevSelected.doneCapturing();\n\t\t}\n\t\tprevSelected = null;\n\t\tprevSelectedX = 0;\n\t\tprevSelectedY = 0;\n\t}", "@Override\n\tpublic void onPlayerTurnListener() {\n\n\t}", "public void giveUp() {\n if (!finished)\n player.kill();\n }", "public void endTurn(){\n for (int i = 0; i<9; i++){\n if(bSquares.get(i).checkhasFocus()){//finds out which square user is playing in. \"i\" is that square\n for (int j = 0; j<9; j++){\n if (!bSquares.get(i).getSmallSquare(j).isCommitted()&&bSquares.get(i).getSmallSquare(j).getOwnership()>0){\n bSquares.get(i).getSmallSquare(j).setCommitted(true);\n stepsCompleted++;//user just finished his turn!\n updateDatabase(i,j, true); //updates the database with the player's move B4 the focus is changed\n for (int t = 0; t<9; t++){//removes focus everywhere else.\n bSquares.get(t).sethasFocus(false);\n }\n \n bSquares.get(j).sethasFocus(true);//tells which square has focus\n }\n }\n }\n }\n \n }", "public void playerTurnStart() {\n\r\n\t}", "@Override\r\n\tpublic void startTurn() {\n\t\t\r\n\t}", "public void onTurnBegin() {\n\n\t}", "@Override\n\tpublic void OnGameEnd() {\n\t\tsuper.OnGameEnd();\n\t}", "public void nextTurn()\n\t{\n\t\tthis.actionListToExecute.clear();\n\t\tthis.board.discardLastPlayedCard();\n\t\tthis.getCurrentPlayer().getDataInput().printMessage(this.getCurrentPlayerGameStatus());\n\t\tthis.getCurrentPlayer().execEndOfTurn();\n\t\t\n\t\tint nbPlayerCardPickup = this.getAmountOfPlayerCardToFillYourHand() - this.getCurrentPlayer().getPlayerCardDeck().size();\n\t\tfor(int i = 0; i < nbPlayerCardPickup; i++)\n\t\t{\n\t\t\tthis.getCurrentPlayer().getPlayerCardDeck().addCard(this.getNextPlayerCard());\n\t\t}\n\t\t\n\t\tcurrentPlayerID = (currentPlayerID + 1) % this.getPlayerList().size();\n\t\tif(currentPlayerID == 0)\n\t\t{\n\t\t\tcurrentPlayerID = this.getPlayerList().size();\n\t\t}\n\t\tthis.getCurrentPlayer().execBeginOfTurn();\n\t\tinitBeginOfTurn();\n\t}", "void concludeRound() {\n\n ArrayList<Card> currentTopCards = getCurrentTopCards();\n transferCards(roundWinner, currentTopCards);\n eliminatePlayers();\n\n logger.log(\"Communal Deck: \" + deck);\n logger.log(divider);\n for (Player player : players) {\n logger.log(\"Hand: \" + player);\n }\n\n logger.log(\"Round complete.\");\n\n setGameState(GameState.ROUND_COMPLETE);\n }", "public void gameEnded() {}", "private void finishGame(boolean again){\r\n\t\tdispose();\r\n\t\tif(again) Util.showNewGameDialog(\"Choose player names:\", cantStop.getGameBoard().getPlayers());\r\n\t}", "@Override\n protected void executeStrategy()\n {\n //Get the latest clue given by the SpyMaster\n Clue clue = game.getCurrentClue();\n pickCard(clue);\n\n // We used up our guesses so we are done\n if (game.getGuessesLeft() == 0) { this.game.endCurrentTurn(); }\n }", "public void completedGame()\n\t{\n\t\tJOptionPane.showMessageDialog(this,\"Congratulations, you beat the game!\" + ship.getTotalScore(), \"Beat the Game\", JOptionPane.INFORMATION_MESSAGE);\n\t\tbuttonPanel.endGameButton.setEnabled(false);\n\t\tsendScore();\n\t}", "@Override\n public boolean isWaitingForTurnPhase() {return true;}", "private void playTurn()\n {\n try\n {\n XMLHandler.saveGame(game, GAME_CLONE_PATH);\n }\n catch(IOException | JAXBException | SAXException ex)\n {\n // TODO... ConsoleUtils.message(\"An internal save error has occured, terminating current game\");\n gameEnded = true;\n return;\n }\n \n moveCycle();\n \n if (!game.validateGame()) \n {\n IllegalBoardPenalty();\n }\n \n String gameOverMessage = game.isGameOver();\n if (gameOverMessage != null) \n {\n //TODO: ConsoleUtils.message(gameOverMessage);\n gameEnded = true;\n }\n \n game.switchPlayer();\n }", "private void HandleOnMoveEnd(Board board, Piece turn, boolean success){\n\t}", "public void endsGameAndSetsWinner(Player player) {\n this.winner = player.getId(); \n this.gameStarted = false; \n \n }", "public void newTurn() {\n int[] playersAlive = GameEngine.playersAlive();\n if (playersAlive[0] > 0) {\n turnData.clear();\n Die dice = new Die();\n thrown = dice.main();\n turnOnePlayer();\n\n } else {\n GameEngine.theEnd(playersAlive[1]);\n }\n }", "public void lose() {\n status.setText(\"You're finished\");\n gamegoing = false;\n }", "private void onEndGame() {\n Intent intent1 = new Intent(this, MainActivity.class);\n startActivity(intent1);\n finish();\n }", "protected abstract boolean isGameFinished();", "public void endPhase(){\n if(this.actionPhase) {\n this.buyPhase = true;\n this.actionPhase = false;\n }else{\n endTurn();\n }\n }", "public void onFinish() {\n timer.setText(\"Time's Up!\");\n Intent timesUp = new Intent(QuizActivity.this, QuizComplete.class);\n timesUp.putExtra(TRANSFER_SCORE, mScore);\n startActivity(timesUp);\n }", "@Override\n public synchronized void postWinner(char result) {\n rememberGame(result);\n\n //Increase the heat (decrease randomness) as more games are played\n if (heat < heatMax && gamesPlayed % 50 == 0) heat++;\n\n gamesPlayed++;\n game = null; // No longer playing a game though.\n }", "void onTurn();", "public void beginTurn(){\n }", "@Override\n\tpublic void onOpponentTurnListener() {\n\n\t}", "public void tryMove() {\n if(!currentPlayer.getHasPlayed()){\n if (!currentPlayer.isEmployed()) {\n String destStr = chooseNeighbor();\n\n currentPlayer.moveTo(destStr, getBoardSet(destStr));\n if(currentPlayer.getLocation().getFlipStage() == 0){\n currentPlayer.getLocation().flipSet();\n }\n refreshPlayerPanel();\n }\n else {\n view.showPopUp(currentPlayer.isComputer(), \"Since you are employed in a role, you cannot move but you can act or rehearse if you have not already\");\n }\n }\n else{ \n view.showPopUp(currentPlayer.isComputer(), \"You've already moved, rehearsed or acted this turn. Try a different command or click `end turn` to end turn your turn.\");\n }\n view.updateSidePanel(playerArray);\n }", "@Override\n\tpublic void endGame() {\n\t\tsuper.endGame();\n\t}", "private void humanTurn() \n {\n \n playTurn();\n }", "@Override\n public void endGame(){\n gameOver = true;\n }", "public void turn(boolean yours) {\n\t\t_endTurn.setEnabled(yours);\n\t}" ]
[ "0.8182448", "0.78526485", "0.78338456", "0.77988285", "0.77884233", "0.7643885", "0.7619921", "0.7546022", "0.7537432", "0.75345474", "0.7428385", "0.742653", "0.73896384", "0.73629993", "0.7354133", "0.73430645", "0.7326622", "0.7310322", "0.7306047", "0.7253087", "0.72256345", "0.72123414", "0.7202769", "0.71448284", "0.71301365", "0.7126138", "0.7124516", "0.71045995", "0.70998544", "0.7076191", "0.70488185", "0.70443016", "0.7041593", "0.70235384", "0.69926965", "0.6970028", "0.69459367", "0.69459206", "0.69379336", "0.69118965", "0.68922794", "0.68831843", "0.6878442", "0.6876246", "0.6874984", "0.68736625", "0.68715453", "0.686671", "0.6855803", "0.68454885", "0.6827031", "0.68104154", "0.6799388", "0.6784454", "0.6782271", "0.677147", "0.6771327", "0.67661434", "0.67623866", "0.676058", "0.6755885", "0.6738897", "0.6733014", "0.67284685", "0.67142355", "0.6710371", "0.6708262", "0.67034894", "0.6686735", "0.666577", "0.6661823", "0.66526705", "0.66495895", "0.66440225", "0.6640553", "0.66341335", "0.66287625", "0.6627048", "0.6619741", "0.6617521", "0.66077024", "0.65973663", "0.65955204", "0.6593434", "0.6580233", "0.65798837", "0.65632766", "0.65547067", "0.6544284", "0.653732", "0.6533545", "0.65314823", "0.65215963", "0.65180975", "0.65107226", "0.65074897", "0.65011287", "0.6499776", "0.64904225", "0.6481706" ]
0.725753
19
This method is called when a player tries to buy a development card
boolean CanBuyDevCard();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void buyDevCard();", "void askBuyDevCards();", "@Override\r\n\tpublic void buyCard() {\n\t\t\r\n\t}", "void askDevCardProduction();", "public void buyDevCard() throws ClientException{\n\n\t\t\tresources.setOre(resources.getOre() -1 );\n\t\t\tresources.setWheat(resources.getWheat() -1 );\n\t\t\tresources.setSheep(resources.getSheep() -1 );\n\n\t}", "@Override\n public void buyDevCard() throws ModelException {\n if (!GameModelFacade.instance().canBuyDevCard()) {\n throw new ModelException(\"Preconditions for action not met.\");\n }\n\n IPlayer curPlayer = GameModelFacade.instance().getLocalPlayer();\n try {\n String clientModel = m_theProxy.buyDevCard(curPlayer.getIndex());\n new ModelInitializer().initializeClientModel(clientModel, m_theProxy.getPlayerId());\n } catch (NetworkException e) {\n throw new ModelException(e);\n }\n }", "@Test\n\tpublic void buyDevelopmentCardTest() throws CannotAffordException, BankLimitException\n\t{\n\t\tassertTrue(p.getDevelopmentCards().size() == 0);\n\t\tp.grantResources(DevelopmentCardType.getCardCost(), game.getBank());\n\t\tbuyDevelopmentCard();\n\t\tassertTrue(p.getDevelopmentCards().size() > 0);\n\t}", "@Test\n public void buyCard() throws Exception {\n model.getTurnTracker().setCurrentTurn(PlayerIndex.FIRST);\n when(devCardFacade.canBuyDevCard(currentPlayer)).thenReturn(true);\n dcc.buyCard();\n verify(devCardFacade, atMost(1)).buyDevCard(currentPlayer);\n }", "public void dealerAskCard() {\n int dealerScore = this.getDealerHand().getActualValue();\n while (dealerScore < 17) {\n Card card = this.deck.deal(this.getDealerHand());\n dealerScore = this.getDealerHand().getActualValue();\n }\n }", "@Override\n\tpublic void onCardSucess() {\n\t\tLoggerUtils.d(\"onCardSucess Start!!!\");\n\t\tonSucess();\n\t}", "public Board.Cards buyCard(Board.Cards card) {\n \t\tif (!affordCard())\n \t\t\treturn null;\n \n \t\t// out of cards\n \t\tif (card == null)\n \t\t\treturn null;\n \n \t\t// deduct resources\n \t\tuseResources(Type.WOOL, 1);\n \t\tuseResources(Type.GRAIN, 1);\n \t\tuseResources(Type.ORE, 1);\n \n \t\tif (card == Cards.VICTORY)\n \t\t\tvictory += 1;\n \t\telse\n \t\t\tnewCards.add(card);\n \n \t\tappendAction(R.string.player_bought_card);\n \n \t\treturn card;\n \t}", "void purchaseMade();", "void askLeaderCardActivation();", "protected final void hit() throws InsufficientCardsException {\n hand.add(deck.deal());\n update();\n }", "public void isPurchased(Player player) {\n\t}", "void askLeaderCardThrowing();", "private void buyPlayer(FootballPlayer player, String playerName, int num) {\n\t\tint valid = game.addPlayer(playerName);\n\t\tif(valid==0) {\n\t\t\tplayerNameArray[num].setText(playerName);\n\t\t\timageArray[num].setIcon(MainGui.getShirt(player.getTeamName()));\n\t\t\tbuttonArray[num].setText(\"X\");\n\t\t\tlblBudgetText.setText(game.getCurrentUser().getBudget() + \" RGG\");\n\t\t\t\n\t\t} else if (valid==1) {\n\t\t\tJOptionPane.showMessageDialog(frame,\"You have already selected this player for your team\");\n\t\t} else if (valid==-1) {\n\t\t\tJOptionPane.showMessageDialog(frame,\"You don´t have enough budget too buy \" + playerName);\n\t\t}\n\t}", "private void payValuablesToGetDevelopmentCard(Player player, DevelopmentCard developmentCard, InformationCallback informationCallback){\n LeaderCard leaderCard = player.getPersonalBoard().getLeaderCardWithName(\"Pico della Mirandola\");\n int devCardCoinsCost = developmentCard.getCost().getResources().get(ResourceType.COIN);\n if (leaderCard != null && leaderCard.getLeaderEffectActive()) {\n if (devCardCoinsCost >= 3)\n developmentCard.getCost().decrease(ResourceType.COIN, ((LEPicoDellaMirandola)leaderCard.getEffect()).getMoneyDiscount());\n else\n developmentCard.getCost().decrease(ResourceType.COIN, devCardCoinsCost);\n }\n developmentCard.payCost(player, informationCallback);\n }", "@Override\n protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent resultIntent) {\n super.onActivityResult(requestCode, resultCode, resultIntent);\n if (requestCode == 1) {\n if (resultCode == Activity.RESULT_OK) {\n int price = resultIntent.getIntExtra(\"Price\", Integer.MAX_VALUE);\n if (playerStats.getPlayerCash() - price >= 0) {\n this.playerStats.subtractPlayerCash(price);\n this.masterDeck.unlockCard(resultIntent.getStringExtra(\"Name\"));\n this.adapter.notifyItemChanged(resultIntent.getIntExtra(\"Position\", -1));\n showCash();\n showCardStats();\n } else {\n Toast.makeText(CardLibraryActivity.this, \"Not enough minerals.\", Toast.LENGTH_SHORT).show();\n }\n }\n }\n }", "public void ActonCard() {\n\t}", "public void creditCard() {\n\t\tSystem.out.println(\"hsbc --- credit card\");\n\t\t\n\t}", "@Override\n\tpublic void payCrew() {\n\t\tSystem.out.println(\"Crew paid!, You can start sailing now!\");\n\t\tgame.loading();\n\t}", "@Override\r\n\tpublic void paidBehavior() {\n\t\tSystem.out.println(\"You paid using your Vias card\");\r\n\t\t\r\n\t}", "public void credit(){\r\n\t\tSystem.out.println(\"HSBC-- Credit method called from Interface USBank \");\r\n\t}", "public String buyDevCard(BuyDevCard buyDevCard) throws Exception {\n\t\tString url = server_url + \"/moves/buyDevCard\";\n\t\tURL obj = new URL(url);\n\t\tHttpURLConnection con = (HttpURLConnection) obj.openConnection();\n\n\t\t//add request header\n\t\tcon.setRequestMethod(\"POST\");\n\t\tcon.setRequestProperty(\"User-Agent\", \"Mozilla/5.0\");\n\t\tcon.setRequestProperty(\"Accept-Language\", \"en-US,en;q=0.5\");\n\t\t//System.out.println(usercookie + \"; \" + gamecookie);\n\t\tcon.setRequestProperty(\"Cookie\", usercookie + \"; \" + gamecookie);\n\t\t\n\t\tJsonObject info = new JsonObject();\n\t\tinfo.addProperty(\"type\",\"buyDevCard\");\n\t\tinfo.addProperty(\"playerIndex\", buyDevCard.playerIndex);\n\t\t\n\t\t// Send post request\n\t\tcon.setDoOutput(true);\n\t\tDataOutputStream wr = new DataOutputStream(con.getOutputStream());\n\t\twr.writeBytes(info.toString());\n\t\twr.flush();\n\t\twr.close();\n\n\t\tint responseCode = con.getResponseCode();\n\t\t//System.out.println(\"\\nSending 'POST' request to URL : \" + url);\n\t\t//System.out.println(\"Post parameters : \" + info.toString());\n\t\t//System.out.println(\"Response Code : \" + responseCode);\n\n\t\tif (responseCode == 400) {\n\t\t\tthrow new Exception();\n\t\t}\n\t\tBufferedReader in = new BufferedReader(\n\t\t new InputStreamReader(con.getInputStream()));\n\t\tString inputLine;\n\t\tStringBuffer response = new StringBuffer();\n\n\t\twhile ((inputLine = in.readLine()) != null) {\n\t\t\tresponse.append(inputLine);\n\t\t}\n\t\tin.close();\n\t\t\n\t\t//print result\n\t\t////System.out.println(response.toString());\n\t\treturn response.toString();\n\t}", "void askBuyResources();", "@Override\r\n\tpublic void showGetPrisonCardMessage(Player player) {\n\t\t\r\n\t}", "@Test\n public void CardRequirementError() {\n MSG_ACTION_ACTIVATE_LEADERCARD message = new MSG_ACTION_ACTIVATE_LEADERCARD(0);\n DevelopmentCard card1 = new DevelopmentCard(1, Color.GREEN, 0, null, null);\n p.getDevelopmentSlot().addCard(card1, 1);\n c.emptyQueue();\n assertFalse(am.activateLeaderCard(p, message));\n assertEquals(MessageType.MSG_ERROR, c.messages.get(0).getMessageType());\n assertEquals(1, c.messages.size());\n }", "@Test\n public void buyCardWithNoResources() throws Exception {\n when(devCardFacade.canBuyDevCard(noDevCardsPlayer)).thenReturn(false);\n dcc.buyCard();\n verify(devCardFacade, never()).buyDevCard(noDevCardsPlayer);\n }", "@Override\n\tpublic void onCardFail() {\n\t\tLoggerUtils.d(\"onCardFail Start!!!\");\n\t\tonFail();\n\t}", "public void credit(){\n\t\tSystem.out.println(\"hdfcbank credited\");\n\t\t\n\t}", "public void playBlackjack() {\n\t\tString choice;\n\t\t\n\t\tSystem.out.println(\"Welcome to Blackjack! \\n\");\n\t\tSystem.out.println(\"Dealing hands \\n\");\n\t\tdeck.shuffle();\n\t\tplayer.setHand(deck.drawHand());\n\t\tdealer.setHand(deck.drawHand());\n\t\t\n\t\t\n\t\tif(checkForBlackjack(player) && checkForBlackjack(dealer)) {\n\t\t\tSystem.out.println(showHands());\n\t\t\tSystem.out.println(\"Both player's have blackjack! \\n\");\n\t\t}\n\t\telse if(checkForBlackjack(player)) {\n\t\t\tSystem.out.println(showHands());\n\t\t\tSystem.out.println(\"Player has blackjack! You win! \\n\");\n\t\t}\n\t\telse if(checkForBlackjack(dealer)) {\n\t\t\tSystem.out.println(showHands());\n\t\t\tSystem.out.println(\"Dealer has blackjack! Dealer wins! \\n\");\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(showInitinalHand());\n\t\t\twhile(player.getHandVal() < 21) {\n\t\t\t\tSystem.out.println(\"Player's turn. Pick to hit or stand \\n\");\n\t\t\t\tchoice = scanner.nextLine().toUpperCase();\n\t\t\t\tif(choice.equals(\"STAND\") || choice.equals(\"S\")) {\n\t\t\t\t\tSystem.out.println(\"Player stands \\n\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse if(choice.equals(\"HIT\")|| choice.equals(\"H\")) {\n\t\t\t\t\tSystem.out.println(\"Player hits \\n\");\n\t\t\t\t\tplayer.addCard(deck.drawCard());\n\t\t\t\t\tSystem.out.println(showInitinalHand());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.println(\"Invalid input \\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile(dealer.getHandVal() < 17) {\n\t\t\t\tSystem.out.println(\"Dealer hits \\n\");\n\t\t\t\tdealer.addCard(deck.drawCard());\n\t\t\t\tSystem.out.println(showHands());\n\t\t\t}\n\t\t\tSystem.out.println(showHands());\n\t\t}\n\t\tcheckWinner();\n\t\tif(result.equals(\"TIE\")) {\n\t\t\tSystem.out.println(\"The result is a tie! \\n\");\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"The winner is the \" + result + \"!\\n\");\n\t\t}\n\t}", "protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_cards);\n\n buyButtonListener = new View.OnClickListener(){\n @Override\n public void onClick(View v) {\n BuyCardPack(v.getId());\n }\n };\n\n mHelper = new IabHelper(this, \"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAhUad8+LQPImoIHj\" +\n \"gxDBbMKP2ikTU9avilAdgKeW6Ri8AgrmyEbLEZWOpXJcOQ1rPVOLLDzHz/vuwT5ybvlvYBmOW5jtW9k3I\" +\n \"R/bG9uVlxYsj2j2vXBSvKGj93eB7W8CG1qqHfGJ4kn9H6r2zPJe+PRkIzRsG2DazHAyoIsQyo7mKfJs/Z\" +\n \"unHdNKkT1ARoBSka2bJpDY9AqZOMqe6uNJbcbEelwV5mzV/5s8uuioNyVEqnd5xmAmRPspheUi1AZIZEU\" +\n \"dpkoYr4HhXlgHkdwGmOk1hcLYUKNeod+ekWA218QDuCKXRvAO4r2sAc2MW1dXpCntOAmNuXlb5GYJo7Oc\" +\n \"QnwIDAQAB\");\n\n //callback when billing is finished setting up\n mHelper.startSetup(new IabHelper.OnIabSetupFinishedListener() {\n public void onIabSetupFinished(IabResult result) {\n if (!result.isSuccess()) {\n System.err.println(\"Problem setting up In-app Billing: \" + result);\n } else {\n billingFinished = true;\n QueryInventory();\n }\n }\n });\n\n //callback when purchase is finished\n mPurchaseFinishedListener = new IabHelper.OnIabPurchaseFinishedListener(){\n public void onIabPurchaseFinished(IabResult result, Purchase purchase) {\n\n try{\n\n if (result.isFailure()) {\n return;\n }\n\n //consume the purchase immediately\n else if (purchase.getSku().equals(SKU_CARDS_PACK1)) {\n UnhidePack(1);\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n };\n\n //Add the view elements for each pack\n cardPacks = (ListView) findViewById(R.id.card_list_view);\n final ArrayList<CardPack> packList = LibraryDB.getCardPacks();\n adapter = new CardPackAdapter(this, packList);\n cardPacks.setAdapter(adapter);\n\n cardPacks.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {\n @Override\n public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {\n cardPacks.removeOnLayoutChangeListener(this);\n adapterFinished = true;\n QueryInventory();\n }\n });\n adapter.notifyDataSetChanged();\n }", "public DevCard giveDevCard(){\n \n return null;\n }", "public synchronized void sendCardFromDeck () {\n\t\t// Draw card from deck\n\t\tCard drawnCard = deck.drawCard();\n\t\t// Inform the player that a card will be sent\n\t\tsendMessage (\"Signal:SendCardFromDeck\", currentPlayer);\n\t\tsendCard (drawnCard, currentPlayer);\n\t}", "private void scanCard() {\n\n Intent intent = new ScanCardIntent.Builder(getActivity()).build();\n startActivityForResult(intent, Constant.REQUEST_CODE_SCAN_CARD);\n }", "private boolean offerCard(Player p) {\n\n //Offer card (take or pass)\n p.sendMessage(\"TAKE OR PASS\");\n\n //Wait until they take the card\n waitForPlayerAction(p, \"TAKE\", \"PASS\");\n\n if(actionChosen.equals(\"TAKE\")) {\n\n giveCard(p);\n return true;\n\n } else if(actionChosen.equals(\"PASS\")) {\n //Don't give card\n\n cList.sendToAll(\"Player \" + p.getUsername() + \" passes\");\n return false;\n }\n\n return false;\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 }", "private void payButtonClicked() {\n if (checkBoxAgreedTAC.isChecked()) {\n boolean validCard = validateCard();\n if (validCard) {\n Double payAmount = Double.parseDouble(textViewPrepaidPrice.getText().toString());\n MainActivity.bus.post(new PrepayPaymentAttemptEvent(payAmount, Long.parseLong(litersToBuy.getText().toString())));\n if (PrepayCalculatorFragment.this.payDialog != null) {\n PrepayCalculatorFragment.this.payDialog.dismiss();\n }\n }\n } else {\n Toast.makeText(getActivity(), getResources().getString(R.string.TACMustAgreedMessage), Toast.LENGTH_SHORT).show();\n }\n\n }", "public void addPartnerCard(Card card);", "public void addDealerCard() {\r\n dealerHand.addCard(cardDeck.rCard());\r\n }", "@Test\n\tpublic void playAndRemoveDevelopmentCardTest()\n\t\t\tthrows CannotAffordException, DoesNotOwnException, BankLimitException, CannotPlayException\n\t{\n\t\tassertTrue(p.getDevelopmentCards().size() == 0);\n\t\tp.grantResources(DevelopmentCardType.getCardCost(), game.getBank());\n\t\tDevelopmentCardType c = buyDevelopmentCard();\n\t\tassertTrue(p.getDevelopmentCards().get(c) == 1);\n\n\t\t// Reset recent dev card for player, so they can play this turn\n\t\tgame.getPlayer(game.getCurrentPlayer()).clearRecentDevCards();\n\n\t\t// Reset recent dev card for player, so they can play this turn\n\t\tgame.getPlayer(game.getCurrentPlayer()).clearRecentDevCards();\n\n\t\t// Play card and test it was removed\n\t\tDevelopmentCardType key = (DevelopmentCardType) p.getDevelopmentCards().keySet().toArray()[0];\n\t\tp.playDevelopmentCard(key, game.getBank());\n\n\t\tassertTrue(p.getDevelopmentCards().get(c) == 0);\n\t}", "public void buy(Slot slot) {\n if (slot.getPile().size() != 0) {\n if (!myTurn() || bought) {\n return;\n }\n\n // history.add(new CardAction(slot.getCard(), \"Sell: \" + slot.getCard().getName()));\n\n if (slot.getCard().getCoinCost() <= coins) {\n this.addToHistory(new CardAction(slot.getCard(), \"Buy\"));\n Card card = this.board.getMarketPlace().buy(slot);\n this.discard(card);\n this.coins = 0.0f;\n bought = true;\n }\n } else {\n return;\n }\n }", "public void buyItem(Player player, int idz) {\r\n\t\ttry{\r\n\t\tItemDefinitions def = ItemDefinitions.getItemDefinitions(idz);\r\n\t\tif (def == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(!canExchange(idz) || EconomyPrices.getPrice(def.id) <= 5) {\r\n\t\t\r\n\t\t\tplayer.sendMessage(name(idz) + \" are not exchangeable~ or has not been added\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tsendPriceConfigs(player, idz);\r\n\t\tset(player, idz, EconomyPrices.getPrice(def.id), 1);\r\n\r\n\t\t}catch (Exception e){\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "@Override\n\t\t\tpublic void mainBuyPro() {\n\t\t\t\tif (iap_is_ok && mHelper != null) {\n\t\t\t\t\t\n\t\t\t\t\t String payload = \"\";\n\t\t\t\t\t mHelper.launchPurchaseFlow(MainActivity.this, Paid_Id_VF, RC_REQUEST, mPurchaseFinishedListener);\n\t\t\t\t}else{\n\t\t\t\t}\n\t\t\t}", "public void doLogicBuy() {\n\t\tif (!player.isHuman) {\n\t\t\tif (player.money > estimatedFee * 1.5) //\n\t\t\t{\n\t\t\t\tint free = (int) (player.money - estimatedFee * 1.5);\n\t\t\t\tCell c = board.getCells().get(player.position);\n\t\t\t\tif (c instanceof TradeableCell) {\n\t\t\t\t\tTradeableCell tc = (TradeableCell) c;\n\t\t\t\t\tif (tc.getOwner() == null && tc.getPrice() < free) {\n\t\t\t\t\t\ttc.buy(player);\n\t\t\t\t\t\tboard.addMessage(\"Just bought\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void onBuyGasButtonClicked(View arg0) {\n\t\tLog.d(TAG, \"Buy gas button clicked.\");\n\t\t// if (mSubscribedToInfiniteGas) {\n\t\t// complain(\"No need! You're subscribed to infinite gas. Isn't that awesome?\");\n\t\t// return;\n\t\t// }\n\t\t// if (mTank >= TANK_MAX) {\n\t\t// complain(\"Your tank is full. Drive around a bit!\");\n\t\t// return;\n\t\t// }\n\t\t// launch the gas purchase UI flow.\n\t\t// We will be notified of completion via mPurchaseFinishedListener\n\t\tsetWaitScreen(true);\n\t\tLog.d(TAG, \"Launching purchase flow for gas.\");\n\t\t/*\n\t\t * TODO: for security, generate your payload here for verification. See\n\t\t * the comments on verifyDeveloperPayload() for more info. Since this is\n\t\t * a SAMPLE, we just use an empty string, but on a production app you\n\t\t * should carefully generate this.\n\t\t */\n//\t\tString payload = \"\";\n//\t\tmHelper.launchPurchaseFlow(GameRenderer.mStart, SKU_150000, RC_REQUEST,mPurchaseFinishedListener, payload);\n\t}", "private void checkBuyCard(PropertyCard card) {\n\t\tboolean almostComplete = checkCollection(this, card);\n\t\tif(almostComplete) {\n\t\t\tboolean boughtCard = buyCard(card);\n\t\t\tif(!boughtCard) {\n\t\t\t\tboolean madeChanges = checkPayment(card.getPrice());\n\t\t\t\tif(madeChanges) {\n\t\t\t\t\tbuyCard(card);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tboolean opponentAlmostComplete = false;\n\t\t\tfor(Player p: getPlayers()) {\n\t\t\t\tif(checkCollection(p,card)) {\n\t\t\t\t\topponentAlmostComplete = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(opponentAlmostComplete) {\n\t\t\t\tbuyCard(card);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif(getMoney()-card.getPrice()>=100) {\n\t\t\t\t\tbuyCard(card);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "static boolean playBlackjack() {\n\n Deck mazo; // Un mazo de cartas. Una nueva baraja para cada juego.\n BlackjackHand manoRepartidor; // La mano del repartidor.\n BlackjackHand manoUsuario; // La mano del usuario.\n \n mazo = new Deck();\n manoRepartidor = new BlackjackHand();\n manoUsuario = new BlackjackHand();\n\n // Baraja el mazo, luego reparte dos cartas a cada jugador.\n \n mazo.barajar();\n manoRepartidor.agregarCarta( mazo.cartaReparto());\n manoRepartidor.agregarCarta( mazo.cartaReparto() );\n manoUsuario.agregarCarta( mazo.cartaReparto() );\n manoUsuario.agregarCarta( mazo.cartaReparto() );\n \n System.out.println();\n System.out.println();\n \n /* Marque si uno de los jugadores tiene Blackjack (dos cartas con un total de 21).\n El jugador con Blackjack gana el juego. El repartidor gana empates.\n */\n \n if (manoRepartidor.obtenerValorBlackjack() == 21) {\n String m=\"El distribuidor tiene el \" + manoRepartidor.obtenerCarta(0) + \" y el \" + manoRepartidor.obtenerCarta(1) + \".\\n\"\n + \"El usuario tiene el \" + manoUsuario.obtenerCarta(0) + \" y el \" + manoUsuario.obtenerCarta(1) + \".\\n\"\n + \"El repartidor tiene Blackjack. El repartidor gana.\";\n JOptionPane.showMessageDialog(null, m);\n \n return false;\n }\n \n if (manoUsuario.obtenerValorBlackjack() == 21) {\n String m1 = \"El distribuidor tiene el \" + manoRepartidor.obtenerCarta(0) + \" y el \" + manoRepartidor.obtenerCarta(1) + \".\\n\"\n + \"El usuario tiene el \" + manoUsuario.obtenerCarta(0) + \" y el \" + manoUsuario.obtenerCarta(1) + \".\\n\"\n + \"Tienes Blackjack. Tú ganas.\";\n JOptionPane.showMessageDialog(null, m1);\n return true;\n }\n \n /* Si ninguno de los dos jugadores tiene Blackjack, juega el juego. Primero el usuario \n tiene la oportunidad de robar cartas (es decir,\"Golpear\"). El bucle while termina \n cuando el usuario elige \"Stand\". Si el usuario supera los 21,\n el usuario pierde inmediatamente.\n */\n \n while (true) {\n \n /* Muestra las cartas de los usuarios y deja que el usuario decida si golpea o se para. */\n\n System.out.println();\n System.out.println();\n System.out.println();\n String aux1=\"\";\n for ( int i = 0; i < manoUsuario.obtenerConteoCartas(); i++ ){\n aux1=aux1+\" \"+manoUsuario.obtenerCarta(i)+\"\\n\";\n }\n JOptionPane.showMessageDialog(null, \"Tus cartas son: \\n\" \n + aux1+\"\\n\"\n + \"Su total es \" + manoUsuario.obtenerValorBlackjack()+\"\\n\\n\"\n +\"El concesionario está mostrando el \" + manoRepartidor.obtenerCarta(0));\n \n char userAction= JOptionPane.showInputDialog(null,\"¿Pulse (H) o Pararse (S)? \").charAt(0);\n \n // char x = JOptionPane.showInputDialog(null,\"Ingres... el dato\").charAt(0);\n char opcion;\n do {\n opcion=Character.toUpperCase(userAction);\n if (opcion != 'H' && opcion != 'S')\n \n JOptionPane.showMessageDialog(null,\"Por favor responda H o S: \" );\n } while (opcion != 'H' && opcion != 'S');\n\n /* Si el usuario acierta, el usuario recibe una tarjeta. Si el usuario se para, el bucle termina \n (y es el turno de la banca para robar cartas).\n */\n \n if ( opcion == 'S' ) {\n // Termina el bucle; el usuario termina de coger las tarjetas.\n break;\n }\n else { // La accion del usuario es' H'. Dar al usuario una tarjeta. \n // Si el usuario pasa de 21, el usuario pierde.\n Card newCard = mazo.cartaReparto();\n manoUsuario.agregarCarta(newCard);\n \n System.out.println();\n System.out.println();\n System.out.println();\n \n JOptionPane.showMessageDialog(null, \"Aciertos de usuario.\\n\"\n + \"Su carta es el \" + newCard+\"\\n\"\n + \"Su total es ahora \" + manoUsuario.obtenerValorBlackjack());\n if (manoUsuario.obtenerValorBlackjack() > 21) {\n \n JOptionPane.showMessageDialog(null, \"Pasaste por encima de los 21. Tú pierdes.\\n\"\n + \"La otra carta del repartidor era el \" + manoRepartidor.obtenerCarta(1));\n return false; \n }\n }\n \n } // end while loop\n \n /* Si llegamos a este punto, el usuario tiene un nivel Ahora, es\n la oportunidad del traficante de dibujar. El Dealer coge cartas hasta que el dealer\n total es > 16. Si el concesionario pasa de 21, pierde.\n */\n\n \n JOptionPane.showMessageDialog(null, \"Usuario parado.\\n\"\n +\"Las cartas del distribuidor son\\n\"\n +\" \" + manoRepartidor.obtenerCarta(0)+\"\\n\"\n + \" \" + manoRepartidor.obtenerCarta(1));\n while (manoRepartidor.obtenerValorBlackjack() <= 16) {\n Card newCard = mazo.cartaReparto();\n \n JOptionPane.showMessageDialog(null, \"El distribuidor golpea y obtiene el \" + newCard);\n manoRepartidor.agregarCarta(newCard);\n if (manoRepartidor.obtenerValorBlackjack() > 21) {\n \n JOptionPane.showMessageDialog(null, \"Distribuidor detenido por pasar de 21. Usted gana.\");\n return true;\n }\n }\n \n JOptionPane.showMessageDialog(null, \"El total del distribuidor es \" + manoRepartidor.obtenerValorBlackjack());\n /* Si llegamos a este punto, ambos jugadores tienen 21 o menos. \n Podemos determinar el ganador comparando los valores de sus manos. */\n \n System.out.println();\n if (manoRepartidor.obtenerValorBlackjack() == manoUsuario.obtenerValorBlackjack()) {\n JOptionPane.showMessageDialog(null, \"El concesionario gana por empate. Tú pierdes.\");\n \n return false;\n }\n else if (manoRepartidor.obtenerValorBlackjack() > manoUsuario.obtenerValorBlackjack()) {\n \n JOptionPane.showMessageDialog(null, \"El concesionario gana, \" + manoRepartidor.obtenerValorBlackjack() \n + \" puntos para \" + manoUsuario.obtenerValorBlackjack() + \".\");\n return false;\n }\n else {\n \n JOptionPane.showMessageDialog(null, \"Tu ganas, \" + manoUsuario.obtenerValorBlackjack() \n + \" puntos para \" + manoRepartidor.obtenerValorBlackjack() + \".\");\n return true;\n }\n\n }", "public abstract void performPurchase(Player player);", "private void addCard() { \n\t\tint sic_idHolder; // declares sic_idHolder\n\t\tString titleHolder; // declares titleHolder\n\t\tString authorHolder; // declares authorHolder\n\t\tdouble priceHolder; // declares priceHolder\n\t\tint quantityHolder; // declares quantityHolder\n\t\t\n\t\t\n\t\tSystem.out.println(\"Making a new card:\\nPlease enter the new SIC-ID: \");\n\t\tsic_idHolder = scan.nextInt(); // prompts user to input the ID\n\t\tscan.nextLine();\n\t\t\n\t\tif(inventoryObject.cardExists(sic_idHolder) != true) {\n\t\t\tSystem.out.println(\"Please enter the title of the book: \");\n\t\t\ttitleHolder = scan.next(); // prompts user to input the title\n\t\t\tscan.nextLine();\n\t\t\tSystem.out.println(\"Please enter the author of the book\");\n\t\t\tauthorHolder = scan.next(); // prompts user to input the author\n\t\t\tscan.nextLine();\n\t\t\tSystem.out.println(\"Please enter the price of the book\");\n\t\t\tpriceHolder = scan.nextDouble(); // prompts user to input the price\n\t\t\tscan.nextLine();\n\t\t\n\t\t\tif(priceHolder < 0) { // checks to make sure priceHolder is positive\n\t\t\t\tSystem.out.println(\"ERROR! Price must be greater than or equal to 0:\");\n\t\t\t\tgetUserInfo();\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Please enter the number of books in invetory\");\n\t\tquantityHolder = scan.nextInt(); // prompts user to input the quantity\n\t\tscan.nextLine();\n\t\t\n\t\tif(quantityHolder <= 0) { // checks to make sure quantity isn't less than 1\n\t\t\tSystem.out.println(\"Error! Quantity must be greater than 0\\n\"); \n\t\t\tgetUserInfo();\n\t\t}\n\t\tinventoryObject.addStockIndexCard(sic_idHolder, titleHolder, authorHolder, priceHolder, quantityHolder); // calls addStockIndexCard from InventoryManagement\n\t\tgetUserInfo();\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"ERROR: The ID you entered is already in the system\\n\");\n\t\t\tgetUserInfo();\n\t\t}\n\t}", "@Override\r\n\tpublic void playSoldierCard() {\n\t\t\r\n\t}", "void playerUsedCard(Card c, boolean discard) {\n\t\t// The creator data is in the 2 first bytes, the other player in the 2\n\t\t// last bytes.\n\t\tplayedCard[0] = (discard ? DISCARDED_CARD : PLAYED_CARD);\n\t\tplayedCard[1] = (byte) c.id;\n\t}", "public boolean buyCard(Supply s) {\r\n\t\tboolean wasBought;\r\n\t\tif(s.getQuantity() < 1 || contraband.contains(s.getTopCard())) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tCard c = s.getTopCard();\r\n\t\tbuying = true;\r\n\t\tbought.add(c);\r\n\t\tif(buys > 0 && treasure - c.getCost() >= 0 && c.canBeGained()\r\n\t\t\t\t&& (!c.costsPotion() || potion > 0)) {\r\n\t\t\ttreasure -= c.getCost();\r\n\t\t\tif(c.costsPotion()) potion--;\r\n\t\t\tbuys--;\r\n\t\t\ts.takeCard();\r\n\t\t\tdeck.gain(c);\r\n\t\t\tfor(int i = 0; i < s.getEmbargo(); i++) {\r\n\t\t\t\tbuying = false;\r\n\t\t\t\tdeck.gain(access.board.getCurse().takeCard());\r\n\t\t\t\tbuying = true;\r\n\t\t\t}\r\n\t\t\taccess.gamePhase = 2;\r\n\t\t\twasBought = true;\r\n\t\t\taccess.log(getPlayerName() + \" bought \" + c.getName());\r\n\t\t}\r\n\t\telse {\r\n\t\t\twasBought = false;\r\n\t\t\tbought.remove(bought.size() - 1);\r\n\t\t}\r\n\t\tif(buys < 1) {\r\n\t\t\taccess.gamePhase = 3;\r\n\t\t}\r\n\t\tbuying = false;\r\n\t\tnotifyObservers();\r\n\t\treturn wasBought;\r\n\t}", "public void onSuccess (GameService.GiftResult result) {\n slot.setCard(_ctx, result.card.toThingCard(), false, null);\n // display the card big and fancy and allow them to gift it or cash it in\n CardPopup.display(_ctx, result, slot.status, slot, result.message);\n }", "@Override\n\tpublic void pay() {\n\t\tcreditCard.makePayment();\n\n\t}", "@Override\n\n public void onClick(View v) {\n\n simplify.createCardToken(cardEditor.getCard(), new CardToken.Callback() {\n\n @Override\n\n public void onSuccess(CardToken cardToken) {\n\n //Toast.makeText(getBaseContext(), \"Success\", Toast.LENGTH_SHORT).show();\n //finish();\n RequestManager.getInstance().init(getBaseContext());\n RequestManager.getInstance().paymentRequest(cardToken.getId());\n\n }\n\n @Override\n\n public void onError(Throwable throwable) {\n\n Toast.makeText(getBaseContext(), \"Success\", Toast.LENGTH_SHORT).show();\n\n }\n\n });\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}", "public void onBuyGoldButtonClicked(View arg0) {\n\t\tLog.d(TAG, \"Buy gas button clicked.\");\n\n\t\t// if (mSubscribedToInfiniteGas) {\n\t\t// complain(\"No need! You're subscribed to infinite gas. Isn't that awesome?\");\n\t\t// return;\n\t\t// }\n\t\t//\n\t\t// if (mTank >= TANK_MAX) {\n\t\t// complain(\"Your tank is full. Drive around a bit!\");\n\t\t// return;\n\t\t// }\n\n\t\t// launch the gas purchase UI flow.\n\t\t// We will be notified of completion via mPurchaseFinishedListener\n\t\tsetWaitScreen(true);\n\t\tLog.d(TAG, \"Launching purchase flow for gas.\");\n\n\t\t/*\n\t\t * TODO: for security, generate your payload here for verification. See\n\t\t * the comments on verifyDeveloperPayload() for more info. Since this is\n\t\t * a SAMPLE, we just use an empty string, but on a production app you\n\t\t * should carefully generate this.\n\t\t */\n//\t\tString payload = \"\";\n\n//\t\tmHelper.launchPurchaseFlow(GameRenderer.mStart, SKU_350000, RC_REQUEST,mPurchaseFinishedListener, payload);\n\t}", "private void confirmDrugOrder(String paySerialNumber) {\r\n\r\n showNetworkCacheCardView();\r\n lockPayNowOrHavePayButton(BEING_VERIFICATION);\r\n String requestAction = \"confirmOrder\";\r\n String parameter = \"&paySerialNumber=\" + paySerialNumber;\r\n HttpUtil.sendOkHttpRequest(requestAction, parameter, new Callback() {\r\n @Override\r\n public void onFailure(Call call, IOException e) {\r\n //because of network,the client can't recive message,but has success.\r\n closeNetworkCacheCardView();\r\n showErrorCardView(ACCESS_TIMEOUT);\r\n lockPayNowOrHavePayButton(ACCESS_TIMEOUT);\r\n }\r\n\r\n @Override\r\n public void onResponse(Call call, Response response) throws IOException {\r\n message = gson.fromJson(response.body().string(), Message.class);\r\n closeNetworkCacheCardView();\r\n if (message.isSuccess()) {\r\n // show pay success\r\n showPaySuccessCardView();\r\n lockPayNowOrHavePayButton(HAVE_PAY);\r\n } else {\r\n // other problems.it cause update fail\r\n showErrorCardView(UNKNOWN_ERROR);\r\n lockPayNowOrHavePayButton(UNKNOWN_ERROR);\r\n }\r\n }\r\n });\r\n\r\n }", "private void cards() {\n newUserCard();\n editTypeCard();\n changePasswordCard();\n }", "@Override\n public boolean canUseCard(){\n return false;\n }", "public void surrender() {\n playerCash += playerBet / 2;\n\n //Play dealer's turn\n dealerTurn();\n\n //End the game and change the views\n restartGame();\n }", "public void buyDevelopmentCard(int turnBought, Bank bank) throws CannotBuyException, InsufficientPlayerResourcesException {\n\t\tif(canDoBuyDevelopmentCard(bank) == false) {\n\t\t\tthrow new CannotBuyException(\"Cannot Buy Development Card, possibly not enough resources\");\n\t\t}\n\t\tDevelopmentCard cardBought = resourceCardHand.payForDevelopmentCard();\n\t\tcardBought.setTurnBought(turnBought);\n\t\ttry {\n\t\t\tdevelopmentCardHand.addCard(cardBought);\n\t\t} catch (NullCardException e) {\n\t\t\tSystem.out.println(\"I think I just bought a null card\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Test\n public void CardRequirement1() {\n MSG_ACTION_ACTIVATE_LEADERCARD message = new MSG_ACTION_ACTIVATE_LEADERCARD(1);\n DevelopmentCard card1 = new DevelopmentCard(1, Color.YELLOW, 0, null, null);\n DevelopmentCard card2 = new DevelopmentCard(2, Color.GREEN, 0, null, null);\n p.getDevelopmentSlot().addCard(card1, 1);\n p.getDevelopmentSlot().addCard(card2, 1);\n c.emptyQueue();\n\n assertTrue(am.activateLeaderCard(p, message));\n\n assertTrue(l2.isEnabled());\n\n assertEquals(1, c.messages.stream().filter(x -> x.getMessageType() == MessageType.MSG_UPD_Player).count());\n assertEquals(1, c.messages.stream().filter(x -> x.getMessageType() == MessageType.MSG_NOTIFICATION).count());\n assertEquals(2, c.messages.size());\n\n }", "private static void showPlayerDeckInfo() {\n }", "Card dealOneCard();", "public void allotCard(Player p_player) {\n Card l_Card = new Card();\n Random l_RandomNumber = new Random();\n l_Card.setD_CardType(l_Card.TYPES[l_RandomNumber.nextInt(l_Card.TYPES.length)]);\n p_player.addCard(l_Card);\n Console.displayMsg(\"Player \" + p_player.getD_Name() + \" has received \" + l_Card.getD_CardType() + \" card!\");\n }", "private static void playBlackjack(Player player) {\n\t\t//Delete hands of previous games.\n\t\tplayer.getReady();\n\t\t\n\t\t//Create the dealer.\n\t\tDealer dealer = new Dealer();\n\t\t\n\t\t//Deal two cards to each player.\n\t\tplayer.addCard(deck.dealCard());\n\t\tplayer.addCard(deck.dealCard());\n\t\t\n\t\tdealer.addCard(deck.dealCard());\n\t\tdealer.addCard(deck.dealCard());\n\t\t\n\t\t//Check if anyone has Blackjack.\n\t\tif (dealer.hasBlackjack()) {\n\t\t\tconsole.println(\"Your hand:\" + player.getHand());\n\t\t\tconsole.println(\"Dealer hand:\" + dealer.getHand());\n\t\t\tconsole.println(\"\\n*******************\\n\" +\n\t\t\t\t\t\"Blackjack! You lose!!\" +\n\t\t\t\t\t\"\\n*******************\\n\");\n\t\t\tconsole.println(\"Press <Enter> to continue.\");\n\t\t\tplayer.pay();\n\t\t\treturn;\n\t\t}\n\t\tif (player.hasBlackjack()) {\n\t\t\tconsole.println(\"Dealer hand:\" + dealer.getHand());\n\t\t\tconsole.println(\"Your hand:\" + player.getHand());\n\t\t\tconsole.println(\"\\n*******************\\n\" +\n\t\t\t\t\t\"Blackjack! You lose!!\" +\n\t\t\t\t\t\"\\n*******************\\n\");\n\t\t\tconsole.println(\"Press <Enter> to continue.\");\n\t\t\tplayer.collect();\n\t\t\treturn;\n\t\t\t\n\t\t}\n\t\t\n\t\t//Now the real game begins. Player play first.\n\t\t//Must play all the hands until dealer's turn.\n\t\tboolean dealerTurn = false;\n\t\t\n\t\tconsole.println(String.format(\"\\n\\nDealer first card: %s\", dealer.getFirstCard()));\n\t\t\n\t\twhile (!dealerTurn) { //Player keep playing as long as she can/wants\n\t\t\t\n\t\t\t//Player can have multiple hands (after split). Should play all of them independently.\n\t\t\tOptional<Hand> optionalPlayingHand = player.getNextPlayableHand();\n\t\t\t\n\t\t\tif (optionalPlayingHand.isPresent()) {\n\t\t\t\t\n\t\t\t\tplayer.setCurrentHand(optionalPlayingHand.get());\n\t\t\t\t\n\t\t\t\tconsole.println(\"Your playing hand:\" + player.getHand());\n\t\t\t\tconsole.print(\"Please, select an option: \");\n\t\t\t\tconsole.println(\"(1) Hit (2) Stand (3) Double Down (4) Split (5) Surrender\");\n\t\t\t\tint option = scanner.nextInt();\n\t\t\t\t\n\t\t\t\tswitch (UserAction.valueOf(option)) {\n\t\t\t\t\tcase HIT:\n\t\t\t\t\t\tconsole.println(\"You've chosen: HIT\");\n\t\t\t\t\t\tplayer.hit(deck.dealCard());\n\t\t\t\t\t\tconsole.println(\"Your resulting hand:\" + player.getHand());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase STAND:\n\t\t\t\t\t\tconsole.println(\"You've chosen: STAND\");\n\t\t\t\t\t\tplayer.stand();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase SPLIT:\n\t\t\t\t\t\tconsole.println(\"You've chosen: SPLIT\");\n\t\t\t\t\t\tif (player.split(deck.dealCard(), deck.dealCard())) {\n\t\t\t\t\t\t\tconsole.println(\"Your hand has been split\");\n\t\t\t\t\t\t\tconsole.println(\"Your resulting hand:\" + player.getHand());\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconsole.println(\"Your hand can not be split. Try another option\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DOUBLE_DOWN:\n\t\t\t\t\t\tconsole.println(\"You've chosen: DOUBLE DOWN\");\n\t\t\t\t\t\tplayer.doubleDown(deck.dealCard());\n\t\t\t\t\t\tconsole.println(\"Your resulting hand:\" + player.getHand());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase SURRENDER:\n\t\t\t\t\t\tconsole.println(\"You've chosen: SURRENDER\");\n\t\t\t\t\t\tif (player.surrender()) {\n\t\t\t\t\t\t\tconsole.println(\"Lose half of your bet.\");\n\t\t\t\t\t\t\tconsole.println(\"Dealer hand:\" + dealer.getHand());\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconsole.println(\"You cannot surrender. Try another option\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tdealerTurn = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//All player's hands are standing or busted\n\t\tfor (Hand hand : player.getHands()) {\n\t\t\tconsole.println(\"Your hand: \" + hand + \" Status: \" + hand.getStatus());\n\t\t}\n\t\t\n\t\tconsole.println(\"\\nDealer hand:\" + dealer.getHand());\n\t\t\n\t\tif (player.isBusted()) {\n\t\t\tconsole.println(\"\\n************\\n\" +\n\t\t\t\t\t\"You lose!!\" +\n\t\t\t\t\t\"\\n************\\n\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tconsole.println(\"\\nDealer turn.\\n\");\n\t\t//Dealer's turn.\n\t\twhile (dealerTurn) {\n\t\t\tUserAction dealerAction = dealer.getNextAction();\n\t\t\tswitch (dealerAction) {\n\t\t\t\tcase HIT:\n\t\t\t\t\tconsole.println(\"Dealer HIT\");\n\t\t\t\t\tdealer.hit(deck.dealCard());\n\t\t\t\t\tconsole.println(\"Dealer resulting hand:\" + dealer.getHand());\n\t\t\t\t\tbreak;\n\t\t\t\tcase STAND:\n\t\t\t\t\tconsole.println(\"Dealer STAND\");\n\t\t\t\t\tdealer.stand();\n\t\t\t\t\tdealerTurn = false;\n\t\t\t\t\tbreak;\n\t\t\t\tcase DONE:\n\t\t\t\t\tdealerTurn = false;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tconsole.println(\"Dealer hand:\" + dealer.getHand());\n\t\tif (dealer.isBusted()) {\n\t\t\t//Dealer is busted. Player wins!\n\t\t\tconsole.println(\"\\n************\\n\" +\n\t\t\t\t\t\"You win!!\" +\n\t\t\t\t\t\"\\n************\\n\");\n\t\t\tplayer.collect();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//Check if dealer won\n\t\tif (dealer.hasBlackjack()) {\n\t\t\tconsole.println(\"\\n******************************************************\\n\" +\n\t\t\t\t\t\"There is a tie!. Dealer wins. Its a casino after all\" +\n\t\t\t\t\t\"\\n******************************************************\\n\");\n\t\t\tplayer.pay();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tconsole.println(\"\\n*****************************************************************\\n\");\n\t\tfor (Hand hand : player.getNonBustedHands()) {\n\t\t\tif (hand.getValue() > dealer.getValue()) {\n\t\t\t\t//Player has a better hand. Hand wins.\n\t\t\t\tconsole.println(\"You have a winner hand :\" + hand);\n\t\t\t\tplayer.collect(hand);\n\t\t\t} else {\n\t\t\t\t//Player's hand lose\n\t\t\t\tconsole.println(\"You have a losing hand :\" + hand);\n\t\t\t\tif (hand.getValue() == dealer.getValue()) {\n\t\t\t\t\tconsole.println(\"Remember: in a tie, you lose!\");\n\t\t\t\t}\n\t\t\t\tplayer.pay(hand);\n\t\t\t}\n\t\t}\n\t\tconsole.println(\"\\n*****************************************************************\\n\");\n\t}", "@Override\r\n\tpublic void playCard() {\n\t\t\r\n\t}", "@Test\n public void giveCard() throws Exception {\n SmartPlayer x = new SmartPlayer(0,0);\n x.setCards(5,3);\n int numberOfCardsToGive = x.giveCard(5);\n assertTrue(numberOfCardsToGive == 3);\n }", "@Override\r\n\tpublic void playMonumentCard() {\n\t\t\r\n\t}", "public void buyProductionCard(DeckProductionCard deck, int chosenColumn) throws EmptyException, FullColumnException, NotEnoughResourcesException, LevelException, IOException, InterruptedException {\n try {\n currentPlayer.buyProductionCard(deck,chosenColumn);\n } catch (EndGameException e) {\n exceptionHandler(e);\n }\n notifyToOneObserver(new TakeCardMessage(deck.getDeckNumber(), chosenColumn));\n notifyAllObserverLessOne(new TakeCardForNotCurrentMessage(currentPlayer.getNickName(),deck.getDeckNumber()));\n notifyObserver(new DeckProductionCardMessage(deck.getDeckNumber()));\n }", "public void buyElement(Player customer, MarketObject<?> x) throws IllegalStateException{\n\t\tthis.transferCoin(customer, x);\n\t\tif(x.getObject().getClass().equals(Assistant.class))\n\t\t\tthis.assignAssistants(customer, ((Assistant)x.getObject()));\n\t\telse if(x.getObject().getClass().getSuperclass().equals(PoliticsCard.class))\n\t\t\tthis.assignPoliticsCard(customer, ((PoliticsCard)x.getObject()));\n\t\telse if(x.getObject().getClass().equals(BuildingPermit.class))\n\t\t\tthis.assignBuildingLicense(customer, ((BuildingPermit)x.getObject()));\n\t\tproducts.remove(x);\n\t\tgame.notifyObservers(new ModelChange(game));\n\t}", "public static void checkBlackjack()\n\t{\n\t\tint result=resultBlackjack();\n\t\tif(result==1)\n\t\t{\n\t\t\tcurrentVal.setText(\"Blackjack!\");\n\t\t\tdealerVal.setText(String.valueOf(calculateHand(dealersCards)));\n\t\t\tbet*=2;\n\t\t\tfor(int i=1;i<dealersCards.size();i++)\n\t\t\t\tdealerCardImg[i].setIcon(new ImageIcon(Gameplay.class.getResource(getCard(dealersCards.get(i)))));\n\t\t\twin();\n\t\t\tlblUpdate.setText(\"Blackjack! You win twice your bet!\");\n\t\t\tclearHands();\n\t\t\tbetting();\n\t\t}\n\t\telse if(result==2)\n\t\t{\n\t\t\tdealerVal.setText(\"Blackjack!\");\n\t\t\tfor(int i=1;i<dealersCards.size();i++)\n\t\t\t\tdealerCardImg[i].setIcon(new ImageIcon(Gameplay.class.getResource(getCard(dealersCards.get(i)))));\n\t\t\tlose();\n\t\t\tlblUpdate.setText(\"Dealer got a blackjack. You automatically lose.\");\n\t\t\tclearHands();\n\t\t\tbetting();\n\t\t}\n\t\telse if(result==3)\n\t\t{\n\t\t\tdealerVal.setText(\"Blackjack!\");\n\t\t\tcurrentVal.setText(\"Blackjack!\");\n\t\t\tlblUpdate.setText(\"You and the dealer got blackjacks! No money exchanges hands.\");\n\t\t\tfor(int i=1;i<dealersCards.size();i++)\n\t\t\t\tdealerCardImg[i].setIcon(new ImageIcon(Gameplay.class.getResource(getCard(dealersCards.get(i)))));\n\t\t\tpush();\n\t\t\tclearHands();\n\t\t\tbetting();\n\t\t}\n\t}", "public void credit(){\n\t\tSystem.out.println(\"HSBC BANK :: CREDIT\");\n\t}", "public void buySellEnergy(boolean buy, Player customer) {\n if (buy && energyQuantity == 0) {\n GameController.errorMessageBox(\"Not enough Energy in the store\");\n } else {\n if (buy) {\n if (customer.getMoney() >= energyCost) {\n energyQuantity--;\n customer.addSubMoney(-energyCost);\n customer.addSubEnergy(1);\n if (energyQuantity == 0) {\n energyCost = 25;\n } else {\n energyCost += 2;\n }\n } else {\n GameController.errorMessageBox(\"You do not have enough money for this item\");\n }\n } else {\n if (customer.getEnergy() >= 1) {\n customer.addSubMoney(energyCost - 5);\n if (energyQuantity == 0) {\n energyCost = 25;\n } else {\n energyCost -= 2;\n }\n customer.addSubEnergy(-1);\n energyQuantity++;\n } else {\n GameController.errorMessageBox(\"You do not have any of this item to sell\");\n }\n }\n }\n }", "public void buySellFood(boolean buy, Player customer) {\n if (buy && foodQuantity == 0) {\n GameController.errorMessageBox(\"Not enough Food in the store\");\n } else {\n if (buy) {\n if (customer.getMoney() >= foodCost) {\n foodQuantity--;\n customer.addSubMoney(-foodCost);\n customer.addSubFood(1);\n if (foodQuantity == 0) {\n foodCost = 30;\n } else {\n foodCost += 2;\n }\n } else {\n GameController.errorMessageBox(\"You do not have enough money for this item.\");\n }\n } else {\n if (customer.getFood() >= 1) {\n customer.addSubMoney(foodCost - 5);\n if (foodQuantity == 0) {\n foodCost = 30;\n } else {\n foodCost -= 2;\n }\n customer.addSubFood(-1);\n foodQuantity++;\n } else {\n GameController.errorMessageBox(\"You do not have any of this item to sell\");\n }\n }\n }\n }", "@Override\n\tpublic void onCardComfrim() {\n\t\tdialog = MessageUtils.showCommonDialog(\n\t\t\t\tactivity, \n\t\t\t\tactivity.getText(R.string.common_cardno_comfirm).toString(),\n\t\t\t\tbean.getPan(), \n\t\t\t\tnew View.OnClickListener() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\t\t// 确认\n\t\t\t\t\t\tdissmiss();\n\t\t\t\t\t\tonSucess();\n\t\t\t\t\t}\n\t\t\t\t}, \n\t\t\t\tnew View.OnClickListener() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\t\t// 取消\n\t\t\t\t\t\tdissmiss();\n\t\t\t\t\t\tonFail();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t30,\n\t\t\t\tTimeOutOper.CANCEL\n\t\t\t\t);\n\t}", "@Override\n\tpublic void playCard() {\n\t\t\n\t}", "public void catchCard(){\r\n changePlace(deck);\r\n changePlace(hand);\r\n }", "public void useDevCard(DevCardType card) throws ClientException{\n\t\t\n\t\t\tswitch(card){\n\t\t\tcase MONOPOLY:\n\t\t\t\tif (oldDevCards.getMonopoly() > 0) {\n\t\t\t\t\toldDevCards.setMonopoly(oldDevCards.getMonopoly()+1);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase YEAR_OF_PLENTY:\n\t\t\t\tif (oldDevCards.getYearOfPlenty() > 0) {\n\t\t\t\t\toldDevCards.setYearOfPlenty(oldDevCards.getYearOfPlenty()+1);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase SOLDIER:\n\t\t\t\tif (oldDevCards.getSoldier() > 0) {\n\t\t\t\t\toldDevCards.setSoldier(oldDevCards.getSoldier()+1);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase ROAD_BUILD:\n\t\t\t\tif (oldDevCards.getRoadBuilding() > 0) {\n\t\t\t\t\toldDevCards.setRoadBuilding(oldDevCards.getRoadBuilding()+1);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase MONUMENT:\n\t\t\t\tif (oldDevCards.getMonument() > 0) {\n\t\t\t\t\toldDevCards.setMonument(oldDevCards.getMonument()+1);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new ClientException(\"Exception thrown in useDevCard\");\n\t\t\t}\n\t\t}", "@Override\n public void swipCardSucess(String cardNumber) {\n showLogMessage(\"PAN:\" + cardNumber.toString());\n Message updateMessage = mMainMessageHandler.obtainMessage();\n updateMessage.obj = \"\";\n updateMessage.what = 0x98;\n updateMessage.sendToTarget();\n }", "public void payedConfirmation(){\n\t\tassert reserved: \"a seat also needs to be reserved when bought\";\n\t\tassert customerId != -1: \"this seat needs to have a valid user id\";\n\t\tpayed = true;\n\t}", "public boolean buyCard ( DevCard cardToBuy) {\n for(int i=0;i<4;i++){\n for(int j=0; j<3;j++){\n if(!devDecksOnTable[i][j].littleDevDeck.isEmpty())\n if((devDecksOnTable[i][j].littleDevDeck.get(0)).equals(cardToBuy)){\n devDecksOnTable[i][j].littleDevDeck.remove(0);\n return true;\n }\n }\n }\n return false;\n }", "private Swiftbuy() {\n\t\tsuper(\"swiftbuy\");\n\t}", "public void playCard(ActionCard card, Integer selectedPlayer)\n {\n System.out.println(\"gui: playCard: \" + card + \", selected: \" + selectedPlayer);\n // Guard against this\n if (!isTurn || this.played)\n {\n return;\n }\n \n if(card instanceof PrivateTip || card instanceof Snoop) \n {\n if(selectedPlayer == null) \n {\n JOptionPane.showMessageDialog(null, \"Please select \"\n + \"a player in the \"\n + \"Player Listing (Upper right) that is not yourself!\", \n \"Warning\", \n JOptionPane.ERROR_MESSAGE); \n return;\n }\n }\n\n if (card instanceof Suggestion)\n {\n this.played = true;\n // prompt for solution\n suggestionScreen = new AccusationScreen(this, true, (Suggestion)card);\n suggestionScreen.setVisible(true);\n }\n else\n {\n this.played = clientController.playActionCard(card, selectedPlayer);\n if(!this.played)\n {\n mainGameScreen.notifyUser(\"Play failed: To Play this card,\"\n + \" please select a CluePlayer from the 'Players' list,\"\n + \" then click on this card.\");\n }\n }\n\n }", "public void handleBuyGuppyCommand() {\n if (Aquarium.money >= GUPPYPRICE) {\n guppyController.addNewEntity();\n Aquarium.money -= GUPPYPRICE;\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 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 }", "public void hitBJ() {\n\t\tif (blackjack.isOkBet()) {\n\t\t\tif (blackjack.getCount(1, false, 21)) {\n\t\t\t\t((BlackjackView) manager.getPanel(Constants.BJ_VIEW_NAME)).addCard(blackjack.giveCard(1), 1);\n\t\t\t\tif (blackjack.getCount(1, true, 21)) {\n\t\t\t\t\tblackjack.playerLoses();\n\t\t\t\t\tJOptionPane.showMessageDialog(manager.getPanel(Constants.BJ_VIEW_NAME), \"You lose!\", \"BUSTED\",\n\t\t\t\t\t\t\tJOptionPane.PLAIN_MESSAGE);\n\t\t\t\t\tresetBJTable();\n\t\t\t\t}\n\t\t\t}\n\t\t} else\n\t\t\tJOptionPane.showMessageDialog(manager.getPanel(Constants.BJ_VIEW_NAME), \"You must bet something\", \"ERROR\",\n\t\t\t\t\tJOptionPane.PLAIN_MESSAGE);\n\t}", "private static void showDeckInfo() {\n }", "public void addWinning1(Card card)\n {\n player1Hand.enqueue(card);\n }", "private void askPlayer() {\n System.out.println(\"Dealers last card is \" + Dealer.showLast());\n System.out.println(\"Your hand is \" + p1.getHand());\n System.out.println(\"Your Hand total is \" + p1.getTotal() + \". Would you like to hit or stand?\");\n\n String s = scan.nextLine();\n System.out.println();\n\n if (s.equalsIgnoreCase(\"hit\")) {\n p1.addToHand(dealCard());\n p1.calcTotal();\n if (p1.getTotal() > 31) {\n System.out.println(\"Your hand is \" + p1.getHand());\n System.out.println(\"Your hand total is \" + p1.getTotal());\n System.out.println(\"You bust, Dealer wins\");\n\n totalWinnings -= betNum;\n p1.subPointCount(betNum);\n bust = true;\n\n System.out.println(\"Total Winnings: \" + totalWinnings + \"\\n\");\n\n } else {\n askPlayer();\n }\n } else {\n System.out.println(\"You stand at \" + p1.getTotal());\n\n while (Dealer.calcTotal() < 26) {\n Dealer.addToHand(dealCard());\n\n }\n System.out.println(\"Dealer's hand is \" + Dealer.getHand());\n System.out.println(\"Dealer's hand total is \" + Dealer.getTotal());\n\n }\n }", "@Test\n public void receiveCard() throws Exception {\n SmartPlayer x = new SmartPlayer(0, 0);\n x.receiveCard(4, 4);\n assertTrue(x.getCards().get(4) == 4);\n }", "@Override\r\n public void dispenseProduct() {\r\n System.out.println(\"Insufficient funds!\");\r\n\r\n }", "@Override\r\n\tpublic void payCheck() {\n\t\t\r\n\t}", "public void examine (Player player) {\n\t\tString desc = getType().getDescription()+\" (id=\"+id+\", amount=\"+amount+\")\";\n\t\tplayer.getDispatcher().sendGameMessage(desc);\n\t\tint value = Virtue.getInstance().getExchange().lookupPrice(id);\n\t\tif (value != -1) {\n\t\t\tplayer.getDispatcher().sendGameMessage(\"This item is worth: \"+StringUtility.formatNumber(value)\n\t\t\t\t\t+\"gp on the Grand Exchange.\");\n\t\t}\n\t}", "@Test\n public void giveCard2() throws Exception {\n SmartPlayer x = new SmartPlayer(0,0);\n int numberOfCardsToGive = x.giveCard(5);\n assertTrue(numberOfCardsToGive == 0);\n }", "@Override\n\tpublic void passedBy() {\n\t\tMonopolyGameController.getInstance();\n\t\tMonopolyGameController.getCurrentPlayer().increaseMoney(250);\n\t\tLogger.getInstance().notifyAll(MonopolyGameController.getCurrentPlayer().getName()+ \" gained 250 dollars by landing on Bonus Square\");\n\n\t}" ]
[ "0.81889224", "0.8034391", "0.795498", "0.77532846", "0.7122994", "0.70682305", "0.6976465", "0.68119144", "0.66997373", "0.66941535", "0.66726124", "0.66404784", "0.6561023", "0.6549275", "0.65154725", "0.64428157", "0.64287287", "0.64172333", "0.6381977", "0.6377715", "0.63752013", "0.63746846", "0.6353528", "0.634762", "0.6319285", "0.6313152", "0.6307404", "0.6261547", "0.625036", "0.62250024", "0.6208613", "0.62038594", "0.61876565", "0.61793643", "0.61607623", "0.6142413", "0.61342496", "0.6126959", "0.6126349", "0.6119401", "0.6111188", "0.61097133", "0.6090187", "0.60792226", "0.60766053", "0.6055636", "0.60524386", "0.6051385", "0.6050975", "0.6044605", "0.6037557", "0.6035572", "0.6032355", "0.6012224", "0.60099393", "0.6005945", "0.6001488", "0.59930193", "0.59906685", "0.5989643", "0.59811556", "0.5978645", "0.5974026", "0.59694034", "0.5961397", "0.5952582", "0.59474", "0.5940534", "0.5924665", "0.5920758", "0.59172446", "0.5914639", "0.5913448", "0.59097886", "0.5906677", "0.5904827", "0.5899399", "0.5877062", "0.58737457", "0.5871876", "0.5870713", "0.5870379", "0.58554596", "0.5851147", "0.58473533", "0.58405626", "0.58389544", "0.5830777", "0.58298326", "0.5823078", "0.58226144", "0.5821146", "0.5806737", "0.58010966", "0.5798357", "0.5783684", "0.5783664", "0.5783402", "0.5781494", "0.5781178" ]
0.7218869
4
This method is called when a player tries to play a development card
boolean CanUseYearOfPlenty(String resource1, String resource2);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void playCard() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void playMonumentCard() {\n\t\t\r\n\t}", "@Override\n\tpublic void playCard() {\n\t\t\n\t}", "@Override\r\n\tpublic void playSoldierCard() {\n\t\t\r\n\t}", "public void playCard(ActionCard card, Integer selectedPlayer)\n {\n System.out.println(\"gui: playCard: \" + card + \", selected: \" + selectedPlayer);\n // Guard against this\n if (!isTurn || this.played)\n {\n return;\n }\n \n if(card instanceof PrivateTip || card instanceof Snoop) \n {\n if(selectedPlayer == null) \n {\n JOptionPane.showMessageDialog(null, \"Please select \"\n + \"a player in the \"\n + \"Player Listing (Upper right) that is not yourself!\", \n \"Warning\", \n JOptionPane.ERROR_MESSAGE); \n return;\n }\n }\n\n if (card instanceof Suggestion)\n {\n this.played = true;\n // prompt for solution\n suggestionScreen = new AccusationScreen(this, true, (Suggestion)card);\n suggestionScreen.setVisible(true);\n }\n else\n {\n this.played = clientController.playActionCard(card, selectedPlayer);\n if(!this.played)\n {\n mainGameScreen.notifyUser(\"Play failed: To Play this card,\"\n + \" please select a CluePlayer from the 'Players' list,\"\n + \" then click on this card.\");\n }\n }\n\n }", "@Override\n\tpublic void onCouldNotPlayCardListener(int position) {\n\n\t}", "void playMonumentCard();", "void playCurrentStationCard();", "@Override\r\n\tpublic void showGetPrisonCardMessage(Player player) {\n\t\t\r\n\t}", "@Test(expected = DoesNotOwnException.class)\n\tpublic void cannotPlayDevCardTest() throws DoesNotOwnException, CannotPlayException\n\t{\n\t\tp.playDevelopmentCard(c, game.getBank());\n\t}", "public void playCard(int player, int card) {\n }", "@Override\r\n public void playGame() {\r\n printInvalidCommandMessage();\r\n }", "@Override\n\tpublic void cardInPlay() {\n\t\tIPlayer playedOn = this.game.getOtherPlayer();\n\t\tif(!playedOn.getFaction().equals(Faction.Cultist)){\n\t\t\tplayedOn.setFaction(Faction.UNAFFILIATED);\n\t\t}\n\t\tthis.setDiscard();\n\t}", "@Override\n\tpublic void onCardFail() {\n\t\tLoggerUtils.d(\"onCardFail Start!!!\");\n\t\tonFail();\n\t}", "private void startGame() {\n betOptionPane();\n this.computerPaquetView.setShowJustOneCard(true);\n blackjackController.startNewGame(this);\n }", "@Override\r\n\tpublic void playRoadBuildingCard() {\n\t\t\r\n\t}", "@Override\n\tpublic void onCardSucess() {\n\t\tLoggerUtils.d(\"onCardSucess Start!!!\");\n\t\tonSucess();\n\t}", "private void playThisCard(UnoCard clickedCard) throws NotYourTurnException, InvalidMoveException {\n\t\t// Check player's turn\n\t\tif (!isHisTurn(clickedCard)) {\n\t\t\tthrow new NotYourTurnException();\n\t\t} else {\n\n\t\t\t// Card validation\n\t\t\tif (isValidMove(clickedCard)) {\n\n\t\t\t\tplayedCards().add(clickedCard);\n\n\t\t\t\tremovePlayedCard(clickedCard);\n\n\t\t\t\t// function cards ??\n if (clickedCard instanceof ActionCard) {\n performAction(clickedCard);\n\n }\n\n\t\t\t\tfor (GameListener listener : gameListeners) {\n\t\t\t\t\tlistener.cardPlayed(clickedCard);\n\t\t\t\t}\n\n\t\t\t\tcheckResults();\n\t\t\t} else {\n\t\t\t\tthrow new InvalidMoveException();\n\n\t\t\t}\n\t\t}\n\t}", "public void play() {\r\n this.cardDeck = new JavaDeck();\r\n cardDeck.shuffle();\r\n dealerHand = new JavaHand(2);\r\n dealerHand.DiscardHand();\r\n addDealerCard();\r\n }", "@Override\n public void play(){\n \n // while neither player is dead\n while (continueGame()) {\n \n // both player and cpu draw a card and display the card\n player.play();\n System.out.printf(\"%s has drawn %s \\n\", player.getPlayerID(), \n player.getCard());\n cpu.play();\n System.out.printf(\"%s has drawn %s \\n\", cpu.getPlayerID(), \n cpu.getCard());\n \n // checks if the player wins the round\n if (winRound(player, cpu)) {\n // adds the cards to the gamedeck then the game deck to the\n // player deck\n winner(player, cpu, gameDeck);\n player.getWinningsPile().addCards(gameDeck.showCards().subList(0\n , gameDeck.getSize()));\n // empties the game deck\n gameDeck.showCards().clear();\n System.out.printf(\"%s wins round\\n\", player.getPlayerID());\n } else if (winRound(cpu, player)) { // if the cpu wins\n // adds the cards to the gamedeck then the game deck to the\n // cpu deck\n winner(cpu, player, gameDeck);\n cpu.getWinningsPile().addCards(gameDeck.showCards().subList(0, \n gameDeck.getSize()));\n // empties the game deck\n gameDeck.showCards().clear();\n System.out.println(\"CPU wins round\");\n } else {\n // if its a draw, check to see if either the cpu or player is\n // dying, if so, dont add the card to the gameDeck\n if (!(player.isDying())) {\n gameDeck.addCard(player.getCard());\n player.clearCard();\n }\n if (!(cpu.isDying())) {\n gameDeck.addCard(cpu.getCard());\n cpu.clearCard();\n }\n System.out.println(\"DRAW\");\n }\n // shows the current status of the game\n System.out.printf(\"%s's deck: %d winnings: %d \\n\", \n player.getPlayerID(), player.getDeck().getSize(), \n player.getWinningsPile().getSize());\n System.out.printf(\"CPU deck: %d winnings: %d \\n\", \n cpu.getDeck().getSize(), \n cpu.getWinningsPile().getSize());\n System.out.println(\"Press Enter to go to the next round\");\n in.nextLine();\n }\n //display the winner\n declareWinner();\n }", "private static void showPlayerDeckInfo() {\n }", "@Test\n\tpublic void playAndRemoveDevelopmentCardTest()\n\t\t\tthrows CannotAffordException, DoesNotOwnException, BankLimitException, CannotPlayException\n\t{\n\t\tassertTrue(p.getDevelopmentCards().size() == 0);\n\t\tp.grantResources(DevelopmentCardType.getCardCost(), game.getBank());\n\t\tDevelopmentCardType c = buyDevelopmentCard();\n\t\tassertTrue(p.getDevelopmentCards().get(c) == 1);\n\n\t\t// Reset recent dev card for player, so they can play this turn\n\t\tgame.getPlayer(game.getCurrentPlayer()).clearRecentDevCards();\n\n\t\t// Reset recent dev card for player, so they can play this turn\n\t\tgame.getPlayer(game.getCurrentPlayer()).clearRecentDevCards();\n\n\t\t// Play card and test it was removed\n\t\tDevelopmentCardType key = (DevelopmentCardType) p.getDevelopmentCards().keySet().toArray()[0];\n\t\tp.playDevelopmentCard(key, game.getBank());\n\n\t\tassertTrue(p.getDevelopmentCards().get(c) == 0);\n\t}", "@Override\r\n\tpublic void playGame() {\n\t\tSystem.out.println(\"SmartPhone具有玩游戏的功能\");\r\n\t}", "public void playerTurn(Game game){\n int cardHandNum;\n boolean nextPlayer = false;\n String recentCardDesc;\n if(game.recentCardPlayed() && !(game.playerGetAnotherTurn(this))){\n if(game.getRecentCard() instanceof Mineral){\n recentCardDesc = \"\\nRecent card = Name: \" + game.getRecentCard().getCardName() + \" \" +\n \"Hardness: \" + ((Mineral) game.getRecentCard()).getCardHardness() + \" \" +\n \"Specific Gravity: \" + ((Mineral) game.getRecentCard()).getCardSpecGravity() + \" \" +\n \"Cleavage: \" + ((Mineral) game.getRecentCard()).getCardCleavage() + \" \" +\n \"Crystal Abundance: \" + ((Mineral) game.getRecentCard()).getCardCrystalAbundance() + \" \" +\n \"Economic Value: \" + ((Mineral) game.getRecentCard()).getCardEconomicValue() + \"\\n\"; // The recent card description of the Mineral card\n }\n else{\n recentCardDesc = \"\\nThe recent player play the \" + ((SuperTrumps) game.getRecentCard()).getCardName() + \" card\" + \"\\n\"; // The recent card description of the Supertrumps card\n }\n }\n else if(game.recentCardPlayed() && game.playerGetAnotherTurn(this)){\n System.out.println(\"You are granted to select the trump mode again\");\n recentCardDesc = \"\\nYou may pick the card again as you made all of other players pass\" + \"\\n\";\n gameStart(game); // Allowing the player that is not passed to pick up another trump category\n }\n else {\n recentCardDesc = \"\\nThere are no recent cards that have been played\" + \"\\n\";\n gameStart(game); // Description when there is no cards that is been played (when it is the start of the game)\n }\n while (!nextPlayer){\n // Used for looping until the person did the action (play the card or pass), which allows the next player to move\n String playerChoice;\n System.out.println(\"Game mode: \" + game.getGameModeMessage() + recentCardDesc + showCardInHand() + getPlayerName() + \", enter the card number you want to play or simply enter PASS to pass\");\n System.out.print(\">>>\");\n Scanner options = new Scanner(System.in);\n playerChoice = options.nextLine();\n if (playerChoice.toUpperCase().equals(\"PASS\")){\n drawPlayerCard(game.getCardDeck().drawnCard());\n nextPlayer = true;\n }\n else{\n try {\n cardHandNum = Integer.parseInt(playerChoice); // Changing the input into int from String\n Card cardPlayed = getPlayerCard(cardHandNum); // Used for trying to get the card played\n boolean continueGame = game.gameCard(cardPlayed, this); // Trying to play the card\n if(game.getGameMode().equals(\"CHOICE\")){ // Decision when a player play a special supertrump card to allow player to freely choose the trump mode\n game.putCardToGame(cardPlayed);\n playerHand.remove((cardHandNum));\n gameStart(game);\n game.setRecentPlayer(this.getPlayerName());\n nextPlayer = true;\n }\n else if (game.getGameMode().equals(\"GRAV/MAG\")) {\n if(lookAtWinCard()) { // Check whether or not the player has the winning card, which is Magnetite\n for (Card cardInHand : playerHand) {\n game.putCardToGame(cardInHand);\n playerHand.remove(cardInHand);\n game.setRecentPlayer(this.getPlayerName());\n }\n game.setGameMode(\"SPECGRAV\"); // Change the game mode to Specific Gravity\n nextPlayer = true;\n }\n else {\n game.setGameMode(\"SPECGRAV\"); // Change the game mode to Specific Gravity\n }\n if(continueGame){\n game.putCardToGame(cardPlayed);\n playerHand.remove((cardHandNum));\n game.setRecentPlayer(this.getPlayerName());\n nextPlayer = true;\n }\n }\n else {\n if(continueGame){\n // Used for the normal card play\n game.putCardToGame(cardPlayed);\n playerHand.remove((cardHandNum));\n game.setRecentPlayer(this.getPlayerName());\n nextPlayer = true;\n }\n }\n }\n catch (Throwable e){\n System.out.println(\"Invalid input!\"); // When the user try to enter the input that does not match the card in the hand\n }\n }\n }\n if (playerHand.size() == 0){\n // Occurs when the player has no more card in the hand\n game.setRecentPlayer(game.getPlayers().get((game.getPlayers().indexOf(this)+1)%game.getPlayers().size()).getPlayerName());\n playerLeft(game);\n }\n }", "public void cantPlayGoNext() {\n\t switchTurn();\n }", "public void playTurn(){\r\n\t\t// all exceptions in this method are caught, because if this method throws an exception\r\n\t\t// the AIPlayer will not draw/discard a card and the program will freeze\r\n\t\ttry{\r\n\t\t\tupdateLastCardDiscarded();\r\n\t\t}catch(Exception e){\r\n\t\t\tSystem.out.println(\"AIPlayer, lastCard: \" + e.toString());\r\n\t\t}\r\n\t\ttry{\r\n\t\t\tif(!(drawOrPickUp()^bestChoice(BEST_CHOICE_AT_FIFTY))){ // choose whether to draw from the deck or pick up from the stack\r\n\t\t\t\tif(!game.getRound().drawFromDiscard()) // If picking up from the discard is not possible,\r\n\t\t\t\t\tgame.getRound().drawFromDeck(); // draw from the deck instead\r\n\t\t\t}else{\r\n\t\t\t\tgame.getRound().drawFromDeck();\r\n\t\t\t}\r\n\t\t}catch(Exception e){\r\n\t\t\tSystem.out.println(\"AIPlayer, draw: \" + e.toString());\r\n\t\t\tgame.getRound().drawFromDeck(); // if something goes wrong, draw\r\n\t\t}\r\n\r\n\t\ttry{\r\n\t\t\tgroup = new Groups(this, getHand());\r\n\t\t\tif(!hasLaidDownPhase() && group.getCompletePhaseGroups() != null && // if the AI player, hasn't laid down PhaseGroups\r\n\t\t\t\t\tgroup.getCompletePhaseGroups().length == Configuration.getNumberRequired(getPhase()) && // will lay down the right number of phasesGroups\r\n\t\t\t\t\tgetGame().getRound().getTurnNumber() >= 8 - (difficulty/10)) // is past a certain turn number based off difficulty\r\n\t\t\t\taddPhaseGroups(group.getCompletePhaseGroups()); \r\n\t\t}catch(Exception e){\r\n\t\t\tSystem.out.println(\"AIPlayer, laydown: \" + e.toString()); // laid down all my cards Hand92,AI90afterAI74\r\n\t\t}\r\n\r\n\t\ttry{\r\n\t\t\tif(hasLaidDownPhase())\r\n\t\t\t\tplayOffPhases();\r\n\t\t}catch(Exception e){\r\n\t\t\tSystem.out.println(\"AIPlayer, playoff: \" + e.toString());\r\n\t\t}\r\n\r\n\t\ttry{\r\n\t\t\tlastCardDiscarded = discardCard();\r\n\t\t\tgame.getRound().discard(lastCardDiscarded); // discard\r\n\t\t}catch(Phase10Exception e){\t\r\n\t\t}catch(Exception e){\r\n\t\t\tlastCardDiscarded = getHand().getCard(0);\r\n\t\t\tgame.getRound().discard(lastCardDiscarded);\r\n\t\t\tSystem.out.println(\"AIPlayer, discard: \" + e.toString());\r\n\t\t}\r\n\t}", "public PlayingCard(){\n\t\tsuper();\n\t}", "public void playGame()\r\n\t{\r\n\t\tSystem.out.println(\"Welcome to BlackJack! \\n\");\r\n\t\t\r\n\t\t// Boolean value to tell evaluateWin() method when the final win evaluation must be made\r\n\t\tboolean finalCheck = false;\r\n\t\t\r\n\t\tcardDeck.getDeck();\r\n\t\t\r\n\t\tSystem.out.println(\"Dealing cards...\");\r\n\t\t\r\n\t\t// Each player gets 2 cards to start\r\n\t\tplayer1.hit( cardDeck.draw() );\r\n\t\tplayer1.hit( cardDeck.draw() );\r\n\t\tdealer.hit( cardDeck.draw() );\r\n\t\tdealer.hit( cardDeck.draw() );\r\n\t\t\r\n\t\t// displays current cards\r\n\t\tdisplayPlayerCards(PLAYER1_ID);\r\n\t\tdisplayPlayerCards(DEALER_ID);\r\n\t\t\r\n\t\t// checks for win\r\n\t\tevaluateWin(finalCheck);\r\n\t\t\r\n\t\t// begins player1 turns\r\n\t\tplayerTurns();\r\n\t\t\r\n\t\t// begins dealer turns\r\n\t\tdealerTurns();\r\n\t\t\r\n\t\t// instructs evaluateWin to make final victory check\r\n\t\tfinalCheck = true;\r\n\t\tevaluateWin(finalCheck);\r\n\t\t\r\n\t\t// Cleans up objects\r\n\t\tcardDeck.newDeck();\r\n\t\tplayer1.resetHand();\r\n\t\tdealer.resetHand();\r\n\t}", "@Override\n public void onPreparing(EasyVideoPlayer player) {\n // TODO handle if needed\n }", "public void ActonCard() {\n\t}", "public void playDevelopmentCard(int turnNumber, DevCardType devCardType) throws Exception {\n\t\tif(canDoPlayDevelopmentCard(turnNumber, devCardType) == false) {\n\t\t\tthrow new Exception(\"Cannot play this card\");\n\t\t}\n\t\tdevelopmentCardHand.playDevelopmentCard(turnNumber, devCardType);\n\t}", "@Override\n public void beHelpful() {\n this.playPiano();\n this.takeABow();\n }", "public Card PlayCard() {\n\t Card ret = null;\n\t Card card;\n\t if (mCardCount > 0) {\n\t\t // To work out what card to play, see what cards can be played\n\t\t \tCard[] playableCards;\n\t\t \tplayableCards = mRules.GetPlayableCards();\n\t\t \tCard[] selectedCards;\n\t\t \tselectedCards = new Card[8];\n\t\t \tint iNumSelectableCards = 0;\n\t\t \tfor (int i = 0; i < 8; i++)\n\t\t \t\tselectedCards[i] = null;\n\t \tfor (int i = 0; i < mCardCount; i++){\n\t \t\tcard = mCard[i];\n\t \t\tswitch (card.GetSuit()){\n\t \t\tcase Card.HEARTS:\n\t \t\t\t\n\t \t\t\t// Card is a heart, can it be played?\n\t \t\t\t// Is it a seven, it can be played...\n\t \t\t\tif (card.GetValue() == 7){\n\t \t\t\t\tselectedCards[Rules.HEARTS8] = card;\n\t \t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t// and must be played first\n\t \t\t\t\tplayableCards[Rules.HEARTS8] = new Card(8,Card.HEARTS);\n\t \t\t\t\tplayableCards[Rules.HEARTS6] = new Card(6,Card.HEARTS);\n\t \t\t\t\tplayableCards[Rules.CLUBS8] = new Card(7,Card.CLUBS);\n\t \t\t\t\tplayableCards[Rules.DIAMONDS8] = new Card(7,Card.DIAMONDS);\n\t \t\t\t\tplayableCards[Rules.SPADES8] = new Card(7,Card.SPADES);\n\t \n\t \t\t\t\treturn card;\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() < 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.HEARTS6])){\n\t \t\t\t\t\tselectedCards[Rules.HEARTS6] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t\t//Log.i(\"\",\" Playing card \" + (card.GetValue()) + \" , \" +card.GetSuit());\n\t \t\t\t\t\t//Log.i(\"\",\" Updating playable card \" + (card.GetValue()-1) + \" , \" +Card.HEARTS);\t \t\t\t\t\t\n\t \t\t\t\t\t//playableCards[Rules.HEARTS6] = new Card(card.GetValue()-1,Card.HEARTS);\n\t \t\t\t\t\t//return card;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() > 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.HEARTS8])){\n\t \t\t\t\t\tselectedCards[Rules.HEARTS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t\t//Log.i(\"\",\" Playing card \" + (card.GetValue()) + \" , \" +card.GetSuit());\n\t \t\t\t\t\t//Log.i(\"\",\" Updating playable card \" + (card.GetValue()+1) + \" , \" +Card.HEARTS);\t \t\t\t\t\t\n\t \t\t\t\t\t//playableCards[Rules.HEARTS8] = new Card(card.GetValue()+1,Card.HEARTS);\n\t \t\t\t\t\t//return card;\n\t \t\t\t\t}\n\t \t\t\t}\t \t\t\t\n\t \t\t\t\n\t \t\t\tbreak;\n\t \t\tcase Card.DIAMONDS:\n\t \t\t\t// Is it a seven, it can be played...\n\t \t\t\tif (card.GetValue() == 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.DIAMONDS8])){\n\t \t\t\t\t\tselectedCards[Rules.DIAMONDS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\t\n\t \t\t\tif (card.GetValue() < 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.DIAMONDS6])){\n\t \t\t\t\t\tselectedCards[Rules.DIAMONDS6] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() > 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.DIAMONDS8])){\n\t \t\t\t\t\tselectedCards[Rules.DIAMONDS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\t\t \t\t\t\n\t \t\t\t\n\t \t\t\tbreak;\n\t \t\t\t\n\t \t\tcase Card.CLUBS:\n\t \t\t\t// Is it a seven, it can be played...\n\t \t\t\tif (card.GetValue() == 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS8])){\n\t \t\t\t\t\tselectedCards[Rules.CLUBS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\t \t\t\t\t\n\t \t\t\t}\n\t \t\t\t\n\t \t\t\tif (card.GetValue() < 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS6])){\n\t \t\t\t\t\tselectedCards[Rules.CLUBS6] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() > 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS8])){\n\t \t\t\t\t\tselectedCards[Rules.CLUBS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\t\t \t\t\t\n\t \t\t\tbreak;\n\t \t\t\t\n\t \t\tcase Card.SPADES:\n\t \t\t\t// Is it a seven, it can be played...\n\t \t\t\tif (card.GetValue() == 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.SPADES8])){\n\t \t\t\t\t\tselectedCards[Rules.SPADES8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\t \t\t\t\t\n\t \t\t\t}\n\t \t\t\t\n\t \t\t\tif (card.GetValue() < 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.SPADES6])){\n\t \t\t\t\t\tselectedCards[Rules.SPADES6] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() > 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.SPADES8])){\n\t \t\t\t\t\tselectedCards[Rules.SPADES8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\t \t\t\t\n\t \t\t\tbreak;\n\n\t \t\t\t\t \t\t\t\n\t \t\t}\n\t\n\t \t}\t\n\t \t\n\t \t// Now go through the selectable cards and see which is best to be played\n\t \tif (iNumSelectableCards == 0)\n\t \t\treturn ret;\n\t \t\n\t \tint iPos;\n\t \tcard = null;\n\t \tif (iNumSelectableCards == 1){\n\t\t\t \tfor (int i = 0; i < 8; i++)\n\t\t\t \t\tif (selectedCards[i] != null){\n\t\t\t \t\t\tcard = selectedCards[i];\n\t\t\t \t\t\tbreak;\n\t\t\t \t\t}\n\t\t\t \t\t\t \t\n\t \t}\n\t \telse {\n\t\t\t String sDifficulty = mRules.mView.GetSettings().getString(\"Difficulty\", \"0\");// 0 = hard, 1 = easy\n\t\t\t int iDifficulty = Integer.parseInt(sDifficulty);\n\t\t\t if (iDifficulty == EASY){\n\t\t\t \t// Get a random card from the playable ones\n\t\t\t\t\t Random generator = new Random();\n\t\t\t\t\t int randomIndex = generator.nextInt( iNumSelectableCards );\n\t\t\t\t\t int iCount = 0;\n\t\t\t\t\t \tfor (int i = 0; i < 8; i++){\n\t\t\t\t\t \t\tif (selectedCards[i] != null){\n\t\t\t\t\t \t\t\tif (iCount == randomIndex){\n\t\t\t\t\t \t\t\t\tcard = selectedCards[i];\n\t\t\t\t\t \t\t\t\tbreak;\n\t\t\t\t\t \t\t\t}\n\t\t\t\t\t \t\t\telse iCount++;\n\t\t\t\t\t \t\t}\t\n\t\t\t\t\t \t}\n\t\t\t }\n\t\t\t else {\n\t\t\t \tiPos = GetBestCard(selectedCards);\n\t\t\t \tcard = selectedCards[iPos];\n\t\t\t }\n\t \t}\n\t \t\n\t \tswitch (card.GetSuit()){\n \t\tcase Card.HEARTS:\t \t\n \t\t\tif (card.GetValue() == 7){\n \t\t\t\t// and must be played first\n \t\t\t\tplayableCards[Rules.HEARTS8] = new Card(8,Card.HEARTS);\n \t\t\t\tplayableCards[Rules.HEARTS6] = new Card(6,Card.HEARTS);\n \t\t\t\tplayableCards[Rules.CLUBS8] = new Card(7,Card.CLUBS);\n \t\t\t\tplayableCards[Rules.DIAMONDS8] = new Card(7,Card.DIAMONDS);\n \t\t\t\tplayableCards[Rules.SPADES8] = new Card(7,Card.SPADES);\n \n \t\t\t\treturn card;\n \t\t\t}\n \t\t\tif (card.GetValue() < 7){\n \t\t\t\tif (card.Equals(playableCards[Rules.HEARTS6])){\n \t\t\t\t\tplayableCards[Rules.HEARTS6] = new Card(card.GetValue()-1,Card.HEARTS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (card.GetValue() > 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.HEARTS8])){ \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.HEARTS8] = new Card(card.GetValue()+1,Card.HEARTS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\t \t\t\t\n \t\t\t\n \t\t\tbreak; \n \t\tcase Card.DIAMONDS:\n \t\t\t// Is it a seven, it can be played...\n \t\t\tif (card.GetValue() == 7){\n \t\t\t\tif (playableCards[Rules.HEARTS8] != null && playableCards[Rules.HEARTS8].GetValue() > 7){\n\t \t\t\t\tplayableCards[Rules.DIAMONDS8] = new Card(8,Card.DIAMONDS);\n\t \t\t\t\tplayableCards[Rules.DIAMONDS6] = new Card(6,Card.DIAMONDS);\t \t\t\t\t\t\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\tif (card.GetValue() < 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.DIAMONDS6])){\t \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.DIAMONDS6] = new Card(card.GetValue()-1,Card.DIAMONDS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (card.GetValue() > 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.DIAMONDS8])){\t \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.DIAMONDS8] = new Card(card.GetValue()+1,Card.DIAMONDS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\t\t \t\t\t\n \t\t\t\n \t\t\tbreak; \n \t\t\t\n \t\tcase Card.CLUBS:\n \t\t\t// Is it a seven, it can be played...\n \t\t\tif (card.GetValue() == 7){\n\n \t\t\t\tif (playableCards[Rules.HEARTS8] != null && playableCards[Rules.HEARTS8].GetValue() > 7){\n\t \t\t\t\tplayableCards[Rules.CLUBS8] = new Card(8,Card.CLUBS);\n\t \t\t\t\tplayableCards[Rules.CLUBS6] = new Card(6,Card.CLUBS);\t \t\t\t\t\t\n \t\t\t\t\treturn card;\n \t\t\t\t}\t \t\t\t\t\n \t\t\t}\n \t\t\t\n \t\t\tif (card.GetValue() < 7){\n \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS6])){\n \t\t\t\t\tplayableCards[Rules.CLUBS6] = new Card(card.GetValue()-1,Card.CLUBS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (card.GetValue() > 7){\n \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS8])){\n \t\t\t\t\tLog.i(\"\",\" Updating playable card \" + (card.GetValue()+1) + \" , \" +Card.CLUBS);\n \t\t\t\t\tplayableCards[Rules.CLUBS8] = new Card(card.GetValue()+1,Card.CLUBS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\t\t \t\t\t\n \t\t\tbreak; \n \t\tcase Card.SPADES:\n \t\t\t// Is it a seven, it can be played...\n \t\t\tif (card.GetValue() == 7){\n \t\t\t\tif (playableCards[Rules.HEARTS8] != null && playableCards[Rules.HEARTS8].GetValue() > 7){\n\t \t\t\t\tplayableCards[Rules.SPADES8] = new Card(8,Card.SPADES);\n\t \t\t\t\tplayableCards[Rules.SPADES6] = new Card(6,Card.SPADES);\t \t\t\t\t\t\n \t\t\t\t\treturn card;\n \t\t\t\t}\t \t\t\t\t\n \t\t\t}\n \t\t\t\n \t\t\tif (card.GetValue() < 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.SPADES6])){ \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.SPADES6] = new Card(card.GetValue()-1,Card.SPADES);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (card.GetValue() > 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.SPADES8])){\t \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.SPADES8] = new Card(card.GetValue()+1,Card.SPADES);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\t \t\t\t\n \t\t\tbreak;\n \t\t\t\n\t \t}\n\t \n\t }\n\t return ret;\n }", "private void resume() { player.resume();}", "private static void playBlackjack(Player player) {\n\t\t//Delete hands of previous games.\n\t\tplayer.getReady();\n\t\t\n\t\t//Create the dealer.\n\t\tDealer dealer = new Dealer();\n\t\t\n\t\t//Deal two cards to each player.\n\t\tplayer.addCard(deck.dealCard());\n\t\tplayer.addCard(deck.dealCard());\n\t\t\n\t\tdealer.addCard(deck.dealCard());\n\t\tdealer.addCard(deck.dealCard());\n\t\t\n\t\t//Check if anyone has Blackjack.\n\t\tif (dealer.hasBlackjack()) {\n\t\t\tconsole.println(\"Your hand:\" + player.getHand());\n\t\t\tconsole.println(\"Dealer hand:\" + dealer.getHand());\n\t\t\tconsole.println(\"\\n*******************\\n\" +\n\t\t\t\t\t\"Blackjack! You lose!!\" +\n\t\t\t\t\t\"\\n*******************\\n\");\n\t\t\tconsole.println(\"Press <Enter> to continue.\");\n\t\t\tplayer.pay();\n\t\t\treturn;\n\t\t}\n\t\tif (player.hasBlackjack()) {\n\t\t\tconsole.println(\"Dealer hand:\" + dealer.getHand());\n\t\t\tconsole.println(\"Your hand:\" + player.getHand());\n\t\t\tconsole.println(\"\\n*******************\\n\" +\n\t\t\t\t\t\"Blackjack! You lose!!\" +\n\t\t\t\t\t\"\\n*******************\\n\");\n\t\t\tconsole.println(\"Press <Enter> to continue.\");\n\t\t\tplayer.collect();\n\t\t\treturn;\n\t\t\t\n\t\t}\n\t\t\n\t\t//Now the real game begins. Player play first.\n\t\t//Must play all the hands until dealer's turn.\n\t\tboolean dealerTurn = false;\n\t\t\n\t\tconsole.println(String.format(\"\\n\\nDealer first card: %s\", dealer.getFirstCard()));\n\t\t\n\t\twhile (!dealerTurn) { //Player keep playing as long as she can/wants\n\t\t\t\n\t\t\t//Player can have multiple hands (after split). Should play all of them independently.\n\t\t\tOptional<Hand> optionalPlayingHand = player.getNextPlayableHand();\n\t\t\t\n\t\t\tif (optionalPlayingHand.isPresent()) {\n\t\t\t\t\n\t\t\t\tplayer.setCurrentHand(optionalPlayingHand.get());\n\t\t\t\t\n\t\t\t\tconsole.println(\"Your playing hand:\" + player.getHand());\n\t\t\t\tconsole.print(\"Please, select an option: \");\n\t\t\t\tconsole.println(\"(1) Hit (2) Stand (3) Double Down (4) Split (5) Surrender\");\n\t\t\t\tint option = scanner.nextInt();\n\t\t\t\t\n\t\t\t\tswitch (UserAction.valueOf(option)) {\n\t\t\t\t\tcase HIT:\n\t\t\t\t\t\tconsole.println(\"You've chosen: HIT\");\n\t\t\t\t\t\tplayer.hit(deck.dealCard());\n\t\t\t\t\t\tconsole.println(\"Your resulting hand:\" + player.getHand());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase STAND:\n\t\t\t\t\t\tconsole.println(\"You've chosen: STAND\");\n\t\t\t\t\t\tplayer.stand();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase SPLIT:\n\t\t\t\t\t\tconsole.println(\"You've chosen: SPLIT\");\n\t\t\t\t\t\tif (player.split(deck.dealCard(), deck.dealCard())) {\n\t\t\t\t\t\t\tconsole.println(\"Your hand has been split\");\n\t\t\t\t\t\t\tconsole.println(\"Your resulting hand:\" + player.getHand());\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconsole.println(\"Your hand can not be split. Try another option\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DOUBLE_DOWN:\n\t\t\t\t\t\tconsole.println(\"You've chosen: DOUBLE DOWN\");\n\t\t\t\t\t\tplayer.doubleDown(deck.dealCard());\n\t\t\t\t\t\tconsole.println(\"Your resulting hand:\" + player.getHand());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase SURRENDER:\n\t\t\t\t\t\tconsole.println(\"You've chosen: SURRENDER\");\n\t\t\t\t\t\tif (player.surrender()) {\n\t\t\t\t\t\t\tconsole.println(\"Lose half of your bet.\");\n\t\t\t\t\t\t\tconsole.println(\"Dealer hand:\" + dealer.getHand());\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconsole.println(\"You cannot surrender. Try another option\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tdealerTurn = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//All player's hands are standing or busted\n\t\tfor (Hand hand : player.getHands()) {\n\t\t\tconsole.println(\"Your hand: \" + hand + \" Status: \" + hand.getStatus());\n\t\t}\n\t\t\n\t\tconsole.println(\"\\nDealer hand:\" + dealer.getHand());\n\t\t\n\t\tif (player.isBusted()) {\n\t\t\tconsole.println(\"\\n************\\n\" +\n\t\t\t\t\t\"You lose!!\" +\n\t\t\t\t\t\"\\n************\\n\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tconsole.println(\"\\nDealer turn.\\n\");\n\t\t//Dealer's turn.\n\t\twhile (dealerTurn) {\n\t\t\tUserAction dealerAction = dealer.getNextAction();\n\t\t\tswitch (dealerAction) {\n\t\t\t\tcase HIT:\n\t\t\t\t\tconsole.println(\"Dealer HIT\");\n\t\t\t\t\tdealer.hit(deck.dealCard());\n\t\t\t\t\tconsole.println(\"Dealer resulting hand:\" + dealer.getHand());\n\t\t\t\t\tbreak;\n\t\t\t\tcase STAND:\n\t\t\t\t\tconsole.println(\"Dealer STAND\");\n\t\t\t\t\tdealer.stand();\n\t\t\t\t\tdealerTurn = false;\n\t\t\t\t\tbreak;\n\t\t\t\tcase DONE:\n\t\t\t\t\tdealerTurn = false;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tconsole.println(\"Dealer hand:\" + dealer.getHand());\n\t\tif (dealer.isBusted()) {\n\t\t\t//Dealer is busted. Player wins!\n\t\t\tconsole.println(\"\\n************\\n\" +\n\t\t\t\t\t\"You win!!\" +\n\t\t\t\t\t\"\\n************\\n\");\n\t\t\tplayer.collect();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//Check if dealer won\n\t\tif (dealer.hasBlackjack()) {\n\t\t\tconsole.println(\"\\n******************************************************\\n\" +\n\t\t\t\t\t\"There is a tie!. Dealer wins. Its a casino after all\" +\n\t\t\t\t\t\"\\n******************************************************\\n\");\n\t\t\tplayer.pay();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tconsole.println(\"\\n*****************************************************************\\n\");\n\t\tfor (Hand hand : player.getNonBustedHands()) {\n\t\t\tif (hand.getValue() > dealer.getValue()) {\n\t\t\t\t//Player has a better hand. Hand wins.\n\t\t\t\tconsole.println(\"You have a winner hand :\" + hand);\n\t\t\t\tplayer.collect(hand);\n\t\t\t} else {\n\t\t\t\t//Player's hand lose\n\t\t\t\tconsole.println(\"You have a losing hand :\" + hand);\n\t\t\t\tif (hand.getValue() == dealer.getValue()) {\n\t\t\t\t\tconsole.println(\"Remember: in a tie, you lose!\");\n\t\t\t\t}\n\t\t\t\tplayer.pay(hand);\n\t\t\t}\n\t\t}\n\t\tconsole.println(\"\\n*****************************************************************\\n\");\n\t}", "public void tryStand() {\n if(player.getHand().size() > 0){\n firstStand = true;\n dealerTurn(1);\n } else{\n errorFlag = true;\n userMessage = \"You must get your initial hand dealt before you can stand\";\n }\n\n\n }", "@Test\n public void CardRequirementError() {\n MSG_ACTION_ACTIVATE_LEADERCARD message = new MSG_ACTION_ACTIVATE_LEADERCARD(0);\n DevelopmentCard card1 = new DevelopmentCard(1, Color.GREEN, 0, null, null);\n p.getDevelopmentSlot().addCard(card1, 1);\n c.emptyQueue();\n assertFalse(am.activateLeaderCard(p, message));\n assertEquals(MessageType.MSG_ERROR, c.messages.get(0).getMessageType());\n assertEquals(1, c.messages.size());\n }", "public abstract CardAction play(Player p);", "void askDevCardProduction();", "void playMonopolyCard(String resource);", "protected final void hit() throws InsufficientCardsException {\n hand.add(deck.deal());\n update();\n }", "public void playerLost()\r\n {\r\n \r\n }", "public static void handleDream(Player player) {\n\t\t\n\t}", "public void failedMultiPlayer() {\r\n\t\tmultiplayer.setEnabled(true);\r\n\t\tToast.makeText(this, R.string.con_err, Toast.LENGTH_LONG)\r\n\t\t .show();\r\n\t}", "public void startGame() {\n this.deck = new Deck();\n this.deck.shuffle(); //shuffle the deck\n Card card = this.deck.deal(this.getPlayerHand());\n card = this.deck.deal(this.getPlayerHand());\n card = this.deck.deal(this.getDealerHand());\n }", "public void onPlayStart(){\n\n\t}", "public static void hitCorrect()\n\t{\n\t\tplayersCards.add(deck.deal());\n\t\tcurrentValue();\n\t\tuserCardImg[playersCards.size()-1].setIcon(new ImageIcon(Gameplay.class.getResource(getCard(playersCards.get(playersCards.size()-1)))));\n\t\tresume();\n\t\tif(calculateHand(playersCards)>21 || playersCards.size()==4 || calculateHand(playersCards)==0)\n\t\t{\n\t\t\troundEnd();\n\t\t}\n\t\t\n\t}", "void playerUsedCard(Card c, boolean discard) {\n\t\t// The creator data is in the 2 first bytes, the other player in the 2\n\t\t// last bytes.\n\t\tplayedCard[0] = (discard ? DISCARDED_CARD : PLAYED_CARD);\n\t\tplayedCard[1] = (byte) c.id;\n\t}", "public void wrong()\n\t{\n\t\tMediaPlayer wrong = MediaPlayer.create(this, R.raw.wrong);\n\t\twrong.start();\n\t}", "public void catchCard(){\r\n changePlace(deck);\r\n changePlace(hand);\r\n }", "public void nextStepInGame(View view){\n // called by click on either card, so need to track state\n Log.d(getClass().toString(),\"playstate before = \" + playstate.toString());\n\n playstate = playstate.getNext();\n Log.d(getClass().toString(),\"playstate after update = \" + playstate.toString());\n ImageButton computerCard = (ImageButton) findViewById(R.id.computerCard);\n ImageButton youCard = (ImageButton) findViewById(R.id.youCard);\n TextView infoPanel = (TextView) findViewById(R.id.info_panel);\n switch (playstate){\n case NOCARDS: {\n // show empty buttons as no cards on table\n computerCard.setImageResource(R.color.holo_green_dark);\n computerCard.setVisibility(View.VISIBLE);\n youCard.setImageResource(R.color.holo_blue_dark);\n youCard.setVisibility(View.VISIBLE);\n infoPanel.setText(\"Click to deal cards to both players\");\n\n break;\n }\n case DEALCARDS: {\n // show backs of cards ready to play them\n computerCard.setImageResource(R.drawable.card_back);\n computerCard.setVisibility(View.VISIBLE);\n youCard.setImageResource(R.drawable.card_back);\n youCard.setVisibility(View.VISIBLE);\n infoPanel.setText(\"Click to reveal cards\");\n break;\n }\n case SHOWCARDS: {\n // playARound, but only show card faces\n game.playARound();\n String cardToShow = this.game.getTurnlog().lastEntryFor(game.getPlayers()[1]).getHand().topShownCard().toDrawableName();\n computerCard.setImageResource(getResources().getIdentifier(cardToShow, \"drawable\", \"com.codeclan.cardgame\"));\n cardToShow = this.game.getTurnlog().lastEntryFor(game.getPlayers()[0]).getHand().topShownCard().toDrawableName();\n youCard.setImageResource(getResources().getIdentifier(cardToShow, \"drawable\", \"com.codeclan.cardgame\"));\n\n infoPanel.setText(getString(R.string.computer_label) + \" has \" +\n game.getPlayers()[1].getScore().toString() + \" points,\\n\" +\n getString(R.string.player_label) + \" has \" +\n game.getPlayers()[0].getScore().toString() + \" points.\\n Click for clear table\") ;\n\n break;\n }\n\n }\n if( game.isOver() ){\n//\n// break out of onClick loop by going to new activity to display results\n//\n Intent resultsIntent = new Intent(this, G2P1CHWResultsActivity.class);\n resultsIntent.putExtra(\"player1score\", game.getPlayers()[0].getScore());\n resultsIntent.putExtra(\"dealerscore\", game.getPlayers()[1].getScore());\n resultsIntent.putExtra(\"winner\", game.winner().getName());\n\n startActivity(resultsIntent);\n }\n\n }", "public void currentPlayerDrawCard() {\n Player currentPlayer = turnManager.currentPlayer();\n UnoCard newCard = getNextCard();\n currentPlayer.obtainCard(newCard);\n\n for (GameListener gameListener : gameListeners) {\n gameListener.cardDrawn();\n }\n\t}", "void askLeaderCardThrowing();", "@Override\r\n\t\t\tpublic void playGame() {\n\t\t\t\tSystem.out.println(\"隐式调用接口\");\r\n\t\t\t}", "@Override\n\tpublic void play() {\n\t\t\n\t}", "private void BlueEatsPlayer(Player player)\n {\n Player player_to_be_eaten = null;\n try\n {\n BluePlayer player_to_eat = (BluePlayer) player;\n player_to_be_eaten = checkIfEatsRedPlayer(player_to_eat);\n if (player_to_be_eaten == null)\n {\n player_to_be_eaten = checkIfEatsGreenPlayer(player_to_eat);\n if (player_to_be_eaten == null)\n {\n player_to_be_eaten = checkIfEatsYellowPlayer(player_to_eat);\n }\n }\n //player_to_be_eaten.println(\"blue_player_to_be_eaten\" + player_to_be_eaten.toString());\n if (player_to_be_eaten != null)\n {\n playPersonEatenMusic();\n returnPlayerHome(player_to_be_eaten);\n }\n }\n catch (Exception e)\n {\n \n }\n return;\n }", "private void reportPlay (Player player) {\n System.out.println(\"Player \" + player.name() +\n \" takes \" + player.numberTaken() +\n \" stick(s), leaving \" + game.sticksLeft()\n + \".\");\n }", "public void SpecialCardAction(UNOCard aCard) {\n\t\t\n\t\tif (aCard.getName() == \"Reverse\") { // Reverse card is played, so game direction is switched\n\t\t\tif (gameDirection == \"right\") {\n\t\t\t\tgameDirection = \"left\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\tgameDirection = \"right\";\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (aCard.getName() == \"Skip\") {\n\t\t\tif (gameDirection == \"right\") { // If Game is moving in one direction\n\t\t\t\tcurrentPlayerToPlayIndex = currentPlayerToPlayIndex + 2; // player next to play is skipped\n\t\t\t\tif (currentPlayerToPlayIndex >= players.size()) {\n\t\t\t\t\tcurrentPlayerToPlayIndex = currentPlayerToPlayIndex - players.size();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (gameDirection == \"left\") { // If Game is moving in other direction\n\t\t\t\tcurrentPlayerToPlayIndex = currentPlayerToPlayIndex - 2; // player next to play is skipped\n\t\t\t\tif (currentPlayerToPlayIndex <= 0) {\n\t\t\t\t\tcurrentPlayerToPlayIndex = currentPlayerToPlayIndex + players.size();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tcurrentPlayerToPlay = players.get(currentPlayerToPlayIndex); // Next Player to play a card\n\t\t\n\t\tif (aCard.getName() == \"Draw Two\") { // If a Draw Two Card is played, the enxt player to play is dealt two cards\n\t\t\tif (gameDirection == \"right\") {\n\t\t\t\tif (currentPlayerToPlayIndex < players.size()) {\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (gameDirection == \"left\") {\n\t\t\t\tif (currentPlayerToPlayIndex != 0) {\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (aCard.getName() == \"Wild\") { // Wild is played, function called to ask user for new color\n\t\t\tWildIsPlayedAskUserForColor();\n\t\t}\n\t\t\n\t\tif (aCard.getName() == \"Wild Draw Four\") {\n\t\t\tif (gameDirection == \"right\") { // if game direction is this way\n\t\t\t\tif (currentPlayerToPlayIndex < players.size()) {\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard()); // draw four cards\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard()); // draw four cards\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (gameDirection == \"left\") { // if game direction is this way\n\t\t\t\tif (currentPlayerToPlayIndex != 0) {\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard()); // draw four cards\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard()); // draw four cards\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t}\n\t\t\tWildIsPlayedAskUserForColor();\n\t\t}\n\t\t\n\t}", "public void play() {\n\t\t\r\n\t}", "void makePlay(int player) {\n }", "@Override\n protected void receiveInfo(GameInfo info) {\n if (!(info instanceof PalaceGameState)) {\n return;\n }\n PalaceGameState state = new PalaceGameState((PalaceGameState) info);\n PalaceSelectCardAction selectCardAction;\n if (state.getTurn() != this.playerNum) {\n return;\n } else {\n sleep(1000); // make the computer \"think\"\n boolean isBigger = false;// variable to check if they have a valid card\n\n //determines if the cards are valid\n if (!(state.getP2Hand().isEmpty()) && !state.getPlayPilePalaceCards().isEmpty()) {\n for (int i = 0; i < state.getP2Hand().size(); i++) {\n if (state.getP2Hand().get(i).getRank() > state.getPlayPilePalaceCards().\n get(state.getPlayPilePalaceCards().size() - 1).getRank()) {\n isBigger = true;\n }\n }\n }\n\n //takes pile if they have no hand cards to play\n if (isBigger == false && !(state.getP2Hand().isEmpty())) {\n PalaceTakePileAction take = new PalaceTakePileAction(this);\n Log.d(\"compPlayer\", \"took the pile\");\n this.game.sendAction(take);\n }\n\n //begins searching for a card to select\n PalaceCard cardToSelect = null;\n\n // check in the case when the play pile and their hand are both not empty\n if (!(state.getPlayPilePalaceCards().isEmpty()) && (!(state.getP2Hand().isEmpty()))) {\n\n // while they haven't selected a card or the card they selected is less than the top card\n // another card is selected at random from their hand\n while (cardToSelect == null ||\n (cardToSelect.getRank() <\n (state.getPlayPilePalaceCards().\n get(state.getPlayPilePalaceCards().size() - 1).getRank()) &&\n state.getPlayPilePalaceCards().\n get(state.getPlayPilePalaceCards().size() - 1).getRank() >=0)) {\n cardToSelect =\n state.getP2Hand().get((int) (Math.random() * state.getP2Hand().size()));\n }\n\n // selects a card when they are playing from their top cards\n } else if (state.getP2Hand().isEmpty() && (!(state.getP2TopPalaceCards().isEmpty()))) {\n\n //pick any random card if the play pile is empty\n if (state.getPlayPilePalaceCards().isEmpty()) {\n cardToSelect =\n state.getP2TopPalaceCards().\n get((int) (Math.random() * state.getP2TopPalaceCards().size()));\n }\n\n //play pile is not empty so find a valid card\n else {\n\n //checks to see if there is a valid card\n for (int i = 0; i < state.getP2TopPalaceCards().size(); i++) {\n if (state.getP2TopPalaceCards().get(i).getRank() >\n state.getPlayPilePalaceCards().\n get(state.getPlayPilePalaceCards().size() - 1).getRank() &&\n state.getPlayPilePalaceCards().\n get(state.getPlayPilePalaceCards().size() - 1).getRank() >= 0) {\n isBigger = true;\n }\n }\n\n //finds a random valid card because there is one that is valid\n if (isBigger) {\n while (cardToSelect == null ||\n (cardToSelect.getRank() <\n state.getPlayPilePalaceCards().\n get(state.getPlayPilePalaceCards().size() - 1).\n getRank() &&\n state.getPlayPilePalaceCards().\n get(state.getPlayPilePalaceCards().size() - 1).\n getRank() >= 0)) {\n cardToSelect =\n state.getP2TopPalaceCards().\n get((int) (Math.random() * state.\n getP2TopPalaceCards().size()));\n }\n }\n\n //no card to be played so take the pile\n else {\n PalaceTakePileAction take = new PalaceTakePileAction(this);\n Log.d(\"compPlayer\", \"took the pile\");\n this.game.sendAction(take);\n }\n }\n }\n\n //they only have bottom cards left, all are valid to be played so pick a random one\n else if (state.getP2TopPalaceCards().isEmpty()&&state.getP2Hand().isEmpty()) {\n cardToSelect =\n state.getP2BottomPalaceCards().\n get((int) (Math.random() * state.getP2BottomPalaceCards().size()));\n }\n\n //the play pile is empty and they only have hand cards, pick one at random\n else {\n cardToSelect =\n state.getP2Hand().get((int) (Math.random() * state.getP2Hand().size()));\n }\n\n //create and send the select card action with the selected card\n selectCardAction = new PalaceSelectCardAction(this, cardToSelect,\n state.getSelectedPalaceCards());\n this.game.sendAction(selectCardAction);\n\n //rerun selectCardAction if there are multiple of the same card\n if (!state.getP2Hand().isEmpty()) {\n for (int i = 0; i < state.getP2Hand().size(); i++) {\n if (state.getP2Hand().get(i).getRank() == cardToSelect.getRank() &&\n !cardToSelect.equals(state.getP2Hand().get(i))) {\n selectCardAction = new PalaceSelectCardAction(this, state.getP2Hand().get(i),\n state.getSelectedPalaceCards());\n this.game.sendAction(selectCardAction);\n }\n }\n }\n else if (state.getP2Hand().isEmpty() && !state.getP2TopPalaceCards().isEmpty()) {\n for (int i = 0; i < state.getP2Hand().size(); i++) {\n if (state.getP2Hand().get(i).getRank() == cardToSelect.getRank() &&\n !cardToSelect.equals(state.getP2TopPalaceCards().get(i))) {\n selectCardAction = new PalaceSelectCardAction(this, state.getP2TopPalaceCards().get(i),\n state.getSelectedPalaceCards());\n this.game.sendAction(selectCardAction);\n }\n }\n }\n\n //creates and sends the playCardAction\n PalacePlayCardAction playCardAction = new PalacePlayCardAction(this);\n this.game.sendAction(playCardAction);\n }\n\n\n }", "public void playerWon()\r\n {\r\n \r\n }", "public void playCard(IPlayer owner){\n // Wont play card unless a player has it\n if(command == \"Move1\"){\n owner.Move(owner.getPlayerDir());\n }\n else if(command == \"Move2\"){\n for (Integer i=0; i < 2; i++) {\n owner.Move(owner.getPlayerDir());\n }\n }\n else if(command == \"Move3\"){\n for (Integer i=0; i < 3; i++) {\n owner.Move(owner.getPlayerDir());\n }\n }\n else if (command == \"MoveBack\"){\n owner.Move(dirCtrl.invertDirection(owner.getPlayerDir()));\n }\n else if(command == \"TurnRight\"){\n owner.Turn(TurnDirection.RIGHT);\n }\n else if(command == \"TurnLeft\"){\n owner.Turn(TurnDirection.LEFT);\n }\n else if(command == \"Turn180\"){\n owner.Turn(TurnDirection.BACKWARDS);\n }\n }", "public Card playCard()\n {\n\n Card errorReturn = new Card('E', Card.Suit.spades); // in rare cases\n\n if (numCards == 0)\n return errorReturn;\n else\n return myCards[--numCards];\n }", "@Override\n\tpublic void play() {\n\t\tSystem.out.println(\"We played Snokker today\");\n\t\t\n\t\t\n\t}", "@Override\n public void playStart() {\n }", "@Test(expected = IllegalArgumentException.class)\n public void startPlayTest4() {\n GenericStandardDeckGame g = new GenericStandardDeckGame();\n g.startPlay(0, g.getDeck());\n }", "void onStartGameRequested();", "public void playBlackjack() {\n\t\tString choice;\n\t\t\n\t\tSystem.out.println(\"Welcome to Blackjack! \\n\");\n\t\tSystem.out.println(\"Dealing hands \\n\");\n\t\tdeck.shuffle();\n\t\tplayer.setHand(deck.drawHand());\n\t\tdealer.setHand(deck.drawHand());\n\t\t\n\t\t\n\t\tif(checkForBlackjack(player) && checkForBlackjack(dealer)) {\n\t\t\tSystem.out.println(showHands());\n\t\t\tSystem.out.println(\"Both player's have blackjack! \\n\");\n\t\t}\n\t\telse if(checkForBlackjack(player)) {\n\t\t\tSystem.out.println(showHands());\n\t\t\tSystem.out.println(\"Player has blackjack! You win! \\n\");\n\t\t}\n\t\telse if(checkForBlackjack(dealer)) {\n\t\t\tSystem.out.println(showHands());\n\t\t\tSystem.out.println(\"Dealer has blackjack! Dealer wins! \\n\");\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(showInitinalHand());\n\t\t\twhile(player.getHandVal() < 21) {\n\t\t\t\tSystem.out.println(\"Player's turn. Pick to hit or stand \\n\");\n\t\t\t\tchoice = scanner.nextLine().toUpperCase();\n\t\t\t\tif(choice.equals(\"STAND\") || choice.equals(\"S\")) {\n\t\t\t\t\tSystem.out.println(\"Player stands \\n\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse if(choice.equals(\"HIT\")|| choice.equals(\"H\")) {\n\t\t\t\t\tSystem.out.println(\"Player hits \\n\");\n\t\t\t\t\tplayer.addCard(deck.drawCard());\n\t\t\t\t\tSystem.out.println(showInitinalHand());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.println(\"Invalid input \\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile(dealer.getHandVal() < 17) {\n\t\t\t\tSystem.out.println(\"Dealer hits \\n\");\n\t\t\t\tdealer.addCard(deck.drawCard());\n\t\t\t\tSystem.out.println(showHands());\n\t\t\t}\n\t\t\tSystem.out.println(showHands());\n\t\t}\n\t\tcheckWinner();\n\t\tif(result.equals(\"TIE\")) {\n\t\t\tSystem.out.println(\"The result is a tie! \\n\");\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"The winner is the \" + result + \"!\\n\");\n\t\t}\n\t}", "public boolean needPlayer() {\n\t\treturn false;\n\t}", "public void playGame() {\n show();\n while (gameStatus) {\n if (canPut(players.get((state.getTurn())))) {\n int choice = -1;\n while (gameStatus) {\n choice = controls.get(state.getTurn()).putCard(currentCard);\n if (validInput(players.get((state.getTurn())), choice)) {\n System.out.println(players.get(state.getTurn()).getCards().get(choice).toString());\n try{Thread.sleep(1000);}catch(InterruptedException ignored){}\n break;\n }\n }\n decide(players.get(state.getTurn()), players.get(state.getTurn()).getCards().get(choice));\n }\n try{Thread.sleep(500);}catch(InterruptedException ignored){}\n checkFinish();\n if (gameStatus) {\n state.nextTurn();\n show();\n }\n }\n }", "private void playNextPlayer() {\n \n PlayerId nextPlayer = state.nextPlayer();\n players.get(nextPlayer).setHelp(state, handsOfCards.get(nextPlayer), nextPlayer);\n Card c = players.get(nextPlayer).cardToPlay(state, handsOfCards.get(nextPlayer));\n state = state.withNewCardPlayed(c);\n \n handsOfCards.put(nextPlayer, handsOfCards.get(nextPlayer).remove(c));\n players.get(nextPlayer).updateHand(handsOfCards.get(nextPlayer));\n \n for (Map.Entry<PlayerId, Player> pId: players.entrySet()) {\n pId.getValue().updateTrick(state.trick());\n }\n players.get(nextPlayer).resetHelp();\n }", "@Test(expected = NotPlayingException.class)\n public void not_allow_picking_cards_if_not_playing(){\n\n Deck deck = new Deck();\n Game game = new Game(deck);\n\n game.join(\"susan\");\n\n game.pickCard(\"susan\");\n }", "private void playTurn()\n {\n try\n {\n XMLHandler.saveGame(game, GAME_CLONE_PATH);\n }\n catch(IOException | JAXBException | SAXException ex)\n {\n // TODO... ConsoleUtils.message(\"An internal save error has occured, terminating current game\");\n gameEnded = true;\n return;\n }\n \n moveCycle();\n \n if (!game.validateGame()) \n {\n IllegalBoardPenalty();\n }\n \n String gameOverMessage = game.isGameOver();\n if (gameOverMessage != null) \n {\n //TODO: ConsoleUtils.message(gameOverMessage);\n gameEnded = true;\n }\n \n game.switchPlayer();\n }", "public void hitCard() {\n if (this.state == GameState.ROUNDACTIVE) {\n Seat s = this.getSeat(seatPlaying);\n if (s.hasPlayer()) {\n Hand h = s.getPlayer().getHands().get(0);\n h.addCard(this.deck.dealCard());\n if (h.getIsBusted()) {\n this.activeHandStand();\n }\n }\n repaintAll();\n }\n }", "@Override\n\tpublic void play() {\n\n\t}", "private void play() {\n\t\tParcel pc = Parcel.obtain();\n\t\tParcel pc_reply = Parcel.obtain();\n\t\ttry {\n\t\t\tSystem.out.println(\"DEBUG>>>pc\" + pc.toString());\n\t\t\tSystem.out.println(\"DEBUG>>>pc_replay\" + pc_reply.toString());\n\t\t\tib.transact(1, pc, pc_reply, 0);\n\t\t} catch (RemoteException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "private static void playGame() {\n CardDeck deck = new CardDeck();\n int dealer, player, hitOrStand = 1, score = 0;\n System.out.println(\"Goal: Beat the dealer without going over 21\");\n Scanner input = new Scanner(System.in);\n\n // Generate the dealer's card\n dealer = generateRandomNumber(16, 21); \n System.out.println(\"The Dealer scored: \" + dealer);\n System.out.println(\"\");\n \n\n // Keep playing while the player hasn't won or lost yet\n while (hitOrStand == 1 && score < 21 && score < dealer) {\n // Generate player's card\n player = generateRandomNumber(1, 10); \n System.out.println(\"Your card is worth \" + player);\n\n // Displays the picture of player's card\n String card = deck.drawCard(player);\n System.out.println(card);\n\n // Add player's card value to their score\n score = score + player;\n\n // Displays score and asks wether user wants to hit or stand\n if (score <= 21 && score < dealer) {\n System.out.println(\"Your score is \" + score);\n System.out.print(\"Another card? Hit=1 stand=0: \");\n hitOrStand = input.nextInt();\n System.out.println(\"\");\n }\n }\n \n // Display player won\n if (score > dealer && score <= 21 ) {\n System.out.println(\"You win!\");\n System.out.println(\"Your score is \" + score);\n System.out.println(\"The dealer score was \" + dealer);\n System.out.println(\"You were closer to 21 by \" + (score - dealer));\n\n // Display when player ties with dealer\n } else if (score == dealer) {\n System.out.println(\"Your score is \" + score);\n System.out.println(\"\");\n System.out.println(\"You tied!\");\n\n // Display if player lost\n } else if (score > 21) {\n System.out.println(\"Your score is \" + score);\n System.out.println(\"\");\n System.out.println(\"You lose!\");\n int over = score - 21;\n System.out.println(\"You were over 21 by \" + over);\n\n // Display if player lost\n } else {\n int difference;\n difference = dealer - score;\n System.out.println(\"Your score is \" + score);\n System.out.println(\"You lose!\");\n System.out.println(\"The dealer was closer to 21 than you by \" + difference);\n } \n }", "public Player switchPlayer(){\n Player player = getGame().getCurrentPlayer();\n\n List<Card> cards = new ArrayList<>();\n\n for(Card card: getGame().getCards()){\n if(card.rule.isValid(getGame().getDices())){\n cards.add(card);\n }\n }\n\n //get the best card\n if(!cards.isEmpty()){\n Card card = takeTheBestCard(cards);\n\n //add it to the player\n player.getCardsWon().add(card);\n getGame().getCards().remove(card);\n\n System.out.println(player.getName() + \" won \" + card.getExplaination());\n getGame().addAction(new Action(player.getName() + \" won \" + card.getExplaination()));\n }\n\n if(getGame().getCards().isEmpty()){\n game.setStatus(Game.GameStatus.COMPLETED);\n getGame().addAction(new Action(bestPlayer().getName() + \" WON THE GAME!!!\"));\n }\n //turn\n getGame().setCountOfTrialForPlayer(0);\n\n game.setIndexOfCurrentPlayer(game.getIndexOfCurrentPlayer()+1);\n\n if(game.getIndexOfCurrentPlayer() == getGame().getPlayers().size()){\n game.setIndexOfCurrentPlayer(0);\n }\n\n game.setCountOfTrialForPlayer(0);\n game.setDices(new ArrayList<>());\n\n return getGame().getCurrentPlayer();\n }", "public boolean playCard(Card card){\n boolean b = effectHandler.playCard( card , null);\n return b;\n }", "@Override\n\tpublic void onStandDown(PlatformPlayer player) {\n\t\t\n\t}", "private void RedEatsPlayer(Player player)\n {\n Player player_to_be_eaten = null;\n try\n {\n RedPlayer player_to_eat = (RedPlayer) player;\n player_to_be_eaten = checkIfEatsBluePlayer(player_to_eat);\n if (player_to_be_eaten == null)\n {\n player_to_be_eaten = checkIfEatsGreenPlayer(player_to_eat);\n if (player_to_be_eaten == null)\n {\n player_to_be_eaten = checkIfEatsYellowPlayer(player_to_eat);\n }\n }\n\n //player_to_be_eaten.println(\"red_player_to_be_eaten\" + player_to_be_eaten.toString());\n if (player_to_be_eaten != null)\n {\n playPersonEatenMusic();\n returnPlayerHome(player_to_be_eaten);\n }\n }\n catch (Exception e)\n {\n \n }\n return;\n }", "public void howToPlay() {\r\n // An item has been added to the ticket. Fire an event and let everyone know.\r\n System.out.println(\"Step 1: Have no life. \\nStep 2: Deal cards\\nStep 3: Cry yourself to sleep.\");\r\n }", "private void playGame() throws IOExceptionFromController {\n for (Player player : players) {\n if (player.getGodCard().hasAlwaysActiveModifier()) game.addModifier(player.getGodCard());\n }\n while (!game.hasWinner()) {\n if (!running.get()) return;\n Player currentPlayer = players.get(game.getActivePlayer());\n for (Card modifier : game.getActiveModifiers()) {\n if (!modifier.hasAlwaysActiveModifier() && modifier.getController().getPlayer().equals(currentPlayer))\n game.removeModifier(modifier);\n }\n\n broadcastGameInfo(\"turnStart\");\n String result = playerControllers.get(game.getActivePlayer()).playTurn();\n switch (result) {\n case \"next\":\n checkWorkers();\n game.nextPlayer();\n break;\n case \"outOfMoves\":\n case \"outOfBuilds\":\n case \"outOfWorkers\":\n eliminatePlayer(currentPlayer, result);\n game.nextPlayer();\n break;\n case \"winConditionAchieved\":\n case \"godConditionAchieved\":\n setWinner(currentPlayer, result);\n break;\n default:\n logError(\"invalid turn\");\n break;\n }\n }\n gameOver();\n }", "@Override\n\tpublic void nowPlaying() {\n\t}", "private void resume()\r\n {\r\n player.resume();\r\n }", "void askBuyDevCards();", "@Override\n public void keyPressed(KeyEvent e) {\n player.keyPressed(e); // tell player a key has been pressed\n if (e.getKeyCode() == KeyEvent.VK_X && player.invulnerableTime <= 0 && spellCards > 0){ // player cast spell card\n spellCards --;\n audioloader.play(\"spark\");\n player.invulnerableTime = 5.0 * FPS;\n }\n if (e.getKeyCode() == KeyEvent.VK_C){ // toggle hitbox\n if (player.invulnerableTime <= 0)\n player.invulnerableTime = 10000000;\n else\n player.invulnerableTime = 0;\n }\n if (e.getKeyCode() == KeyEvent.VK_ENTER && entityloader.frame >= levelEnd){ // advance to next level\n gameResult = 1;\n }\n if (e.getKeyCode() == KeyEvent.VK_A){ // add life\n lives++;\n }\n }", "@Override\n\tpublic void onRun(PlatformPlayer player) {\n\t\t\n\t}", "public void playTurn() {\r\n\r\n }", "public void play(){\n\t\t\n\t}", "@Override\r\n\tpublic boolean canPlay() {\n\t\treturn false;\r\n\t}", "@Override\n public void landedOn(Player player) {}", "void askLeaderCardActivation();", "public void startGame() {\n int numberOFPlayers = view.askForNumberOfPlayers();\n\n // adding dealer...\n players.add(dealer);\n //...and players to 'players' ArrayList\n for (int i = 1; i < numberOFPlayers; i++) {\n players.add(new RegularPlayer(i + 1));\n }\n\n // dealing cards to players\n dealer.dealCardsToPlayers(players);\n // Game\n while (!(players.size() == 1)) {\n\n for (int i = 0; i < players.size(); i++) {\n\n // printowanie ilości kart kazdego z graczy dla testów\n if (checkGameStatus()) {\n try {\n // display no of cards for each player\n for (Player player : players) {\n view.print(\"Player \" + player.getPlayerId() + \" no of cards: \" + player.getCardsCount());\n }\n\n round(players.get(i), players);\n } catch (IndexOutOfBoundsException e) {\n continue;\n }\n } else {\n break;\n }\n }\n }\n }", "public void playCard(int index) {\r\n\t\tCard c = deck.hand.get(index);\r\n\t\tif(c.isAction() && actions > 0 && access.gamePhase < 2) {\r\n\t\t\taccess.gamePhase = 1;\r\n\t\t\tif(!deck.play.contains(new Champion())) actions--;\r\n\t\t\tdeck.playCard(index);\r\n\t\t\tc.performAction();\r\n\t\t\tnotifyObservers();\r\n\t\t}\r\n\t\telse if(c.isTreasure() && access.gamePhase < 3) {\r\n\t\t\taccess.gamePhase = 1;\r\n\t\t\taddTreasure(c.getTreasure());\r\n\t\t\tdeck.playCard(index);\r\n\t\t\tc.performAction();\r\n\t\t\tnotifyObservers();\r\n\t\t}\r\n\t}", "@Override\n\t\tpublic void onLoaded(String arg0) {\n\t\t\t\tplayer.play();\n\t\t}", "public void preGame() {\n\n\t}", "public boolean mayPickup(Player debug1) {\n/* 112 */ return true;\n/* */ }", "public void handStarted(int position, GameState gs, Card[] cards) {\r\n }", "public void notifyPlayer(CardGraphics card){\n\t\tchosenCard = card.getCard();\n\t\t\n\t\tsynchronized(lock){\n\t\t\tlock.notify();\n\t\t}\n\t}" ]
[ "0.7410453", "0.73236656", "0.7311895", "0.72207314", "0.7068116", "0.7020802", "0.69322014", "0.67434806", "0.67256624", "0.6723173", "0.67121774", "0.66599023", "0.6587916", "0.6584277", "0.6574833", "0.6503764", "0.6488757", "0.6448004", "0.6388153", "0.63467383", "0.6314477", "0.6306998", "0.6296475", "0.6295797", "0.62936634", "0.6273792", "0.6270514", "0.62347686", "0.620201", "0.61843264", "0.61834466", "0.6169335", "0.61391383", "0.6132726", "0.61325717", "0.6132546", "0.613123", "0.6129976", "0.60923535", "0.6088289", "0.60844296", "0.6081897", "0.6077734", "0.60744494", "0.6029949", "0.602286", "0.60199267", "0.6014058", "0.6009962", "0.60083634", "0.59989756", "0.5990809", "0.59907186", "0.5987374", "0.5977484", "0.5975476", "0.59673506", "0.5965718", "0.5964075", "0.5957182", "0.5955525", "0.59544873", "0.5952262", "0.594589", "0.59418106", "0.5935631", "0.593338", "0.5929108", "0.59286714", "0.59182394", "0.59161097", "0.59140366", "0.59122413", "0.59088665", "0.59071153", "0.59028935", "0.58980364", "0.58968556", "0.5895106", "0.5893146", "0.5884195", "0.5883881", "0.58797926", "0.58772844", "0.58766794", "0.58701295", "0.586893", "0.5867332", "0.5865806", "0.586558", "0.58652776", "0.5862953", "0.5858327", "0.585111", "0.58481234", "0.5837304", "0.58372176", "0.5836926", "0.5834252", "0.5829728", "0.5828033" ]
0.0
-1
This method is called when a player tries to play a development card
boolean CanUseRoadBuilder(EdgeLocation spot1, EdgeLocation spot2);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void playCard() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void playMonumentCard() {\n\t\t\r\n\t}", "@Override\n\tpublic void playCard() {\n\t\t\n\t}", "@Override\r\n\tpublic void playSoldierCard() {\n\t\t\r\n\t}", "public void playCard(ActionCard card, Integer selectedPlayer)\n {\n System.out.println(\"gui: playCard: \" + card + \", selected: \" + selectedPlayer);\n // Guard against this\n if (!isTurn || this.played)\n {\n return;\n }\n \n if(card instanceof PrivateTip || card instanceof Snoop) \n {\n if(selectedPlayer == null) \n {\n JOptionPane.showMessageDialog(null, \"Please select \"\n + \"a player in the \"\n + \"Player Listing (Upper right) that is not yourself!\", \n \"Warning\", \n JOptionPane.ERROR_MESSAGE); \n return;\n }\n }\n\n if (card instanceof Suggestion)\n {\n this.played = true;\n // prompt for solution\n suggestionScreen = new AccusationScreen(this, true, (Suggestion)card);\n suggestionScreen.setVisible(true);\n }\n else\n {\n this.played = clientController.playActionCard(card, selectedPlayer);\n if(!this.played)\n {\n mainGameScreen.notifyUser(\"Play failed: To Play this card,\"\n + \" please select a CluePlayer from the 'Players' list,\"\n + \" then click on this card.\");\n }\n }\n\n }", "@Override\n\tpublic void onCouldNotPlayCardListener(int position) {\n\n\t}", "void playMonumentCard();", "void playCurrentStationCard();", "@Override\r\n\tpublic void showGetPrisonCardMessage(Player player) {\n\t\t\r\n\t}", "@Test(expected = DoesNotOwnException.class)\n\tpublic void cannotPlayDevCardTest() throws DoesNotOwnException, CannotPlayException\n\t{\n\t\tp.playDevelopmentCard(c, game.getBank());\n\t}", "public void playCard(int player, int card) {\n }", "@Override\r\n public void playGame() {\r\n printInvalidCommandMessage();\r\n }", "@Override\n\tpublic void cardInPlay() {\n\t\tIPlayer playedOn = this.game.getOtherPlayer();\n\t\tif(!playedOn.getFaction().equals(Faction.Cultist)){\n\t\t\tplayedOn.setFaction(Faction.UNAFFILIATED);\n\t\t}\n\t\tthis.setDiscard();\n\t}", "@Override\n\tpublic void onCardFail() {\n\t\tLoggerUtils.d(\"onCardFail Start!!!\");\n\t\tonFail();\n\t}", "private void startGame() {\n betOptionPane();\n this.computerPaquetView.setShowJustOneCard(true);\n blackjackController.startNewGame(this);\n }", "@Override\r\n\tpublic void playRoadBuildingCard() {\n\t\t\r\n\t}", "@Override\n\tpublic void onCardSucess() {\n\t\tLoggerUtils.d(\"onCardSucess Start!!!\");\n\t\tonSucess();\n\t}", "private void playThisCard(UnoCard clickedCard) throws NotYourTurnException, InvalidMoveException {\n\t\t// Check player's turn\n\t\tif (!isHisTurn(clickedCard)) {\n\t\t\tthrow new NotYourTurnException();\n\t\t} else {\n\n\t\t\t// Card validation\n\t\t\tif (isValidMove(clickedCard)) {\n\n\t\t\t\tplayedCards().add(clickedCard);\n\n\t\t\t\tremovePlayedCard(clickedCard);\n\n\t\t\t\t// function cards ??\n if (clickedCard instanceof ActionCard) {\n performAction(clickedCard);\n\n }\n\n\t\t\t\tfor (GameListener listener : gameListeners) {\n\t\t\t\t\tlistener.cardPlayed(clickedCard);\n\t\t\t\t}\n\n\t\t\t\tcheckResults();\n\t\t\t} else {\n\t\t\t\tthrow new InvalidMoveException();\n\n\t\t\t}\n\t\t}\n\t}", "public void play() {\r\n this.cardDeck = new JavaDeck();\r\n cardDeck.shuffle();\r\n dealerHand = new JavaHand(2);\r\n dealerHand.DiscardHand();\r\n addDealerCard();\r\n }", "@Override\n public void play(){\n \n // while neither player is dead\n while (continueGame()) {\n \n // both player and cpu draw a card and display the card\n player.play();\n System.out.printf(\"%s has drawn %s \\n\", player.getPlayerID(), \n player.getCard());\n cpu.play();\n System.out.printf(\"%s has drawn %s \\n\", cpu.getPlayerID(), \n cpu.getCard());\n \n // checks if the player wins the round\n if (winRound(player, cpu)) {\n // adds the cards to the gamedeck then the game deck to the\n // player deck\n winner(player, cpu, gameDeck);\n player.getWinningsPile().addCards(gameDeck.showCards().subList(0\n , gameDeck.getSize()));\n // empties the game deck\n gameDeck.showCards().clear();\n System.out.printf(\"%s wins round\\n\", player.getPlayerID());\n } else if (winRound(cpu, player)) { // if the cpu wins\n // adds the cards to the gamedeck then the game deck to the\n // cpu deck\n winner(cpu, player, gameDeck);\n cpu.getWinningsPile().addCards(gameDeck.showCards().subList(0, \n gameDeck.getSize()));\n // empties the game deck\n gameDeck.showCards().clear();\n System.out.println(\"CPU wins round\");\n } else {\n // if its a draw, check to see if either the cpu or player is\n // dying, if so, dont add the card to the gameDeck\n if (!(player.isDying())) {\n gameDeck.addCard(player.getCard());\n player.clearCard();\n }\n if (!(cpu.isDying())) {\n gameDeck.addCard(cpu.getCard());\n cpu.clearCard();\n }\n System.out.println(\"DRAW\");\n }\n // shows the current status of the game\n System.out.printf(\"%s's deck: %d winnings: %d \\n\", \n player.getPlayerID(), player.getDeck().getSize(), \n player.getWinningsPile().getSize());\n System.out.printf(\"CPU deck: %d winnings: %d \\n\", \n cpu.getDeck().getSize(), \n cpu.getWinningsPile().getSize());\n System.out.println(\"Press Enter to go to the next round\");\n in.nextLine();\n }\n //display the winner\n declareWinner();\n }", "private static void showPlayerDeckInfo() {\n }", "@Test\n\tpublic void playAndRemoveDevelopmentCardTest()\n\t\t\tthrows CannotAffordException, DoesNotOwnException, BankLimitException, CannotPlayException\n\t{\n\t\tassertTrue(p.getDevelopmentCards().size() == 0);\n\t\tp.grantResources(DevelopmentCardType.getCardCost(), game.getBank());\n\t\tDevelopmentCardType c = buyDevelopmentCard();\n\t\tassertTrue(p.getDevelopmentCards().get(c) == 1);\n\n\t\t// Reset recent dev card for player, so they can play this turn\n\t\tgame.getPlayer(game.getCurrentPlayer()).clearRecentDevCards();\n\n\t\t// Reset recent dev card for player, so they can play this turn\n\t\tgame.getPlayer(game.getCurrentPlayer()).clearRecentDevCards();\n\n\t\t// Play card and test it was removed\n\t\tDevelopmentCardType key = (DevelopmentCardType) p.getDevelopmentCards().keySet().toArray()[0];\n\t\tp.playDevelopmentCard(key, game.getBank());\n\n\t\tassertTrue(p.getDevelopmentCards().get(c) == 0);\n\t}", "@Override\r\n\tpublic void playGame() {\n\t\tSystem.out.println(\"SmartPhone具有玩游戏的功能\");\r\n\t}", "public void playerTurn(Game game){\n int cardHandNum;\n boolean nextPlayer = false;\n String recentCardDesc;\n if(game.recentCardPlayed() && !(game.playerGetAnotherTurn(this))){\n if(game.getRecentCard() instanceof Mineral){\n recentCardDesc = \"\\nRecent card = Name: \" + game.getRecentCard().getCardName() + \" \" +\n \"Hardness: \" + ((Mineral) game.getRecentCard()).getCardHardness() + \" \" +\n \"Specific Gravity: \" + ((Mineral) game.getRecentCard()).getCardSpecGravity() + \" \" +\n \"Cleavage: \" + ((Mineral) game.getRecentCard()).getCardCleavage() + \" \" +\n \"Crystal Abundance: \" + ((Mineral) game.getRecentCard()).getCardCrystalAbundance() + \" \" +\n \"Economic Value: \" + ((Mineral) game.getRecentCard()).getCardEconomicValue() + \"\\n\"; // The recent card description of the Mineral card\n }\n else{\n recentCardDesc = \"\\nThe recent player play the \" + ((SuperTrumps) game.getRecentCard()).getCardName() + \" card\" + \"\\n\"; // The recent card description of the Supertrumps card\n }\n }\n else if(game.recentCardPlayed() && game.playerGetAnotherTurn(this)){\n System.out.println(\"You are granted to select the trump mode again\");\n recentCardDesc = \"\\nYou may pick the card again as you made all of other players pass\" + \"\\n\";\n gameStart(game); // Allowing the player that is not passed to pick up another trump category\n }\n else {\n recentCardDesc = \"\\nThere are no recent cards that have been played\" + \"\\n\";\n gameStart(game); // Description when there is no cards that is been played (when it is the start of the game)\n }\n while (!nextPlayer){\n // Used for looping until the person did the action (play the card or pass), which allows the next player to move\n String playerChoice;\n System.out.println(\"Game mode: \" + game.getGameModeMessage() + recentCardDesc + showCardInHand() + getPlayerName() + \", enter the card number you want to play or simply enter PASS to pass\");\n System.out.print(\">>>\");\n Scanner options = new Scanner(System.in);\n playerChoice = options.nextLine();\n if (playerChoice.toUpperCase().equals(\"PASS\")){\n drawPlayerCard(game.getCardDeck().drawnCard());\n nextPlayer = true;\n }\n else{\n try {\n cardHandNum = Integer.parseInt(playerChoice); // Changing the input into int from String\n Card cardPlayed = getPlayerCard(cardHandNum); // Used for trying to get the card played\n boolean continueGame = game.gameCard(cardPlayed, this); // Trying to play the card\n if(game.getGameMode().equals(\"CHOICE\")){ // Decision when a player play a special supertrump card to allow player to freely choose the trump mode\n game.putCardToGame(cardPlayed);\n playerHand.remove((cardHandNum));\n gameStart(game);\n game.setRecentPlayer(this.getPlayerName());\n nextPlayer = true;\n }\n else if (game.getGameMode().equals(\"GRAV/MAG\")) {\n if(lookAtWinCard()) { // Check whether or not the player has the winning card, which is Magnetite\n for (Card cardInHand : playerHand) {\n game.putCardToGame(cardInHand);\n playerHand.remove(cardInHand);\n game.setRecentPlayer(this.getPlayerName());\n }\n game.setGameMode(\"SPECGRAV\"); // Change the game mode to Specific Gravity\n nextPlayer = true;\n }\n else {\n game.setGameMode(\"SPECGRAV\"); // Change the game mode to Specific Gravity\n }\n if(continueGame){\n game.putCardToGame(cardPlayed);\n playerHand.remove((cardHandNum));\n game.setRecentPlayer(this.getPlayerName());\n nextPlayer = true;\n }\n }\n else {\n if(continueGame){\n // Used for the normal card play\n game.putCardToGame(cardPlayed);\n playerHand.remove((cardHandNum));\n game.setRecentPlayer(this.getPlayerName());\n nextPlayer = true;\n }\n }\n }\n catch (Throwable e){\n System.out.println(\"Invalid input!\"); // When the user try to enter the input that does not match the card in the hand\n }\n }\n }\n if (playerHand.size() == 0){\n // Occurs when the player has no more card in the hand\n game.setRecentPlayer(game.getPlayers().get((game.getPlayers().indexOf(this)+1)%game.getPlayers().size()).getPlayerName());\n playerLeft(game);\n }\n }", "public void cantPlayGoNext() {\n\t switchTurn();\n }", "public void playTurn(){\r\n\t\t// all exceptions in this method are caught, because if this method throws an exception\r\n\t\t// the AIPlayer will not draw/discard a card and the program will freeze\r\n\t\ttry{\r\n\t\t\tupdateLastCardDiscarded();\r\n\t\t}catch(Exception e){\r\n\t\t\tSystem.out.println(\"AIPlayer, lastCard: \" + e.toString());\r\n\t\t}\r\n\t\ttry{\r\n\t\t\tif(!(drawOrPickUp()^bestChoice(BEST_CHOICE_AT_FIFTY))){ // choose whether to draw from the deck or pick up from the stack\r\n\t\t\t\tif(!game.getRound().drawFromDiscard()) // If picking up from the discard is not possible,\r\n\t\t\t\t\tgame.getRound().drawFromDeck(); // draw from the deck instead\r\n\t\t\t}else{\r\n\t\t\t\tgame.getRound().drawFromDeck();\r\n\t\t\t}\r\n\t\t}catch(Exception e){\r\n\t\t\tSystem.out.println(\"AIPlayer, draw: \" + e.toString());\r\n\t\t\tgame.getRound().drawFromDeck(); // if something goes wrong, draw\r\n\t\t}\r\n\r\n\t\ttry{\r\n\t\t\tgroup = new Groups(this, getHand());\r\n\t\t\tif(!hasLaidDownPhase() && group.getCompletePhaseGroups() != null && // if the AI player, hasn't laid down PhaseGroups\r\n\t\t\t\t\tgroup.getCompletePhaseGroups().length == Configuration.getNumberRequired(getPhase()) && // will lay down the right number of phasesGroups\r\n\t\t\t\t\tgetGame().getRound().getTurnNumber() >= 8 - (difficulty/10)) // is past a certain turn number based off difficulty\r\n\t\t\t\taddPhaseGroups(group.getCompletePhaseGroups()); \r\n\t\t}catch(Exception e){\r\n\t\t\tSystem.out.println(\"AIPlayer, laydown: \" + e.toString()); // laid down all my cards Hand92,AI90afterAI74\r\n\t\t}\r\n\r\n\t\ttry{\r\n\t\t\tif(hasLaidDownPhase())\r\n\t\t\t\tplayOffPhases();\r\n\t\t}catch(Exception e){\r\n\t\t\tSystem.out.println(\"AIPlayer, playoff: \" + e.toString());\r\n\t\t}\r\n\r\n\t\ttry{\r\n\t\t\tlastCardDiscarded = discardCard();\r\n\t\t\tgame.getRound().discard(lastCardDiscarded); // discard\r\n\t\t}catch(Phase10Exception e){\t\r\n\t\t}catch(Exception e){\r\n\t\t\tlastCardDiscarded = getHand().getCard(0);\r\n\t\t\tgame.getRound().discard(lastCardDiscarded);\r\n\t\t\tSystem.out.println(\"AIPlayer, discard: \" + e.toString());\r\n\t\t}\r\n\t}", "public PlayingCard(){\n\t\tsuper();\n\t}", "public void playGame()\r\n\t{\r\n\t\tSystem.out.println(\"Welcome to BlackJack! \\n\");\r\n\t\t\r\n\t\t// Boolean value to tell evaluateWin() method when the final win evaluation must be made\r\n\t\tboolean finalCheck = false;\r\n\t\t\r\n\t\tcardDeck.getDeck();\r\n\t\t\r\n\t\tSystem.out.println(\"Dealing cards...\");\r\n\t\t\r\n\t\t// Each player gets 2 cards to start\r\n\t\tplayer1.hit( cardDeck.draw() );\r\n\t\tplayer1.hit( cardDeck.draw() );\r\n\t\tdealer.hit( cardDeck.draw() );\r\n\t\tdealer.hit( cardDeck.draw() );\r\n\t\t\r\n\t\t// displays current cards\r\n\t\tdisplayPlayerCards(PLAYER1_ID);\r\n\t\tdisplayPlayerCards(DEALER_ID);\r\n\t\t\r\n\t\t// checks for win\r\n\t\tevaluateWin(finalCheck);\r\n\t\t\r\n\t\t// begins player1 turns\r\n\t\tplayerTurns();\r\n\t\t\r\n\t\t// begins dealer turns\r\n\t\tdealerTurns();\r\n\t\t\r\n\t\t// instructs evaluateWin to make final victory check\r\n\t\tfinalCheck = true;\r\n\t\tevaluateWin(finalCheck);\r\n\t\t\r\n\t\t// Cleans up objects\r\n\t\tcardDeck.newDeck();\r\n\t\tplayer1.resetHand();\r\n\t\tdealer.resetHand();\r\n\t}", "@Override\n public void onPreparing(EasyVideoPlayer player) {\n // TODO handle if needed\n }", "public void ActonCard() {\n\t}", "public void playDevelopmentCard(int turnNumber, DevCardType devCardType) throws Exception {\n\t\tif(canDoPlayDevelopmentCard(turnNumber, devCardType) == false) {\n\t\t\tthrow new Exception(\"Cannot play this card\");\n\t\t}\n\t\tdevelopmentCardHand.playDevelopmentCard(turnNumber, devCardType);\n\t}", "@Override\n public void beHelpful() {\n this.playPiano();\n this.takeABow();\n }", "public Card PlayCard() {\n\t Card ret = null;\n\t Card card;\n\t if (mCardCount > 0) {\n\t\t // To work out what card to play, see what cards can be played\n\t\t \tCard[] playableCards;\n\t\t \tplayableCards = mRules.GetPlayableCards();\n\t\t \tCard[] selectedCards;\n\t\t \tselectedCards = new Card[8];\n\t\t \tint iNumSelectableCards = 0;\n\t\t \tfor (int i = 0; i < 8; i++)\n\t\t \t\tselectedCards[i] = null;\n\t \tfor (int i = 0; i < mCardCount; i++){\n\t \t\tcard = mCard[i];\n\t \t\tswitch (card.GetSuit()){\n\t \t\tcase Card.HEARTS:\n\t \t\t\t\n\t \t\t\t// Card is a heart, can it be played?\n\t \t\t\t// Is it a seven, it can be played...\n\t \t\t\tif (card.GetValue() == 7){\n\t \t\t\t\tselectedCards[Rules.HEARTS8] = card;\n\t \t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t// and must be played first\n\t \t\t\t\tplayableCards[Rules.HEARTS8] = new Card(8,Card.HEARTS);\n\t \t\t\t\tplayableCards[Rules.HEARTS6] = new Card(6,Card.HEARTS);\n\t \t\t\t\tplayableCards[Rules.CLUBS8] = new Card(7,Card.CLUBS);\n\t \t\t\t\tplayableCards[Rules.DIAMONDS8] = new Card(7,Card.DIAMONDS);\n\t \t\t\t\tplayableCards[Rules.SPADES8] = new Card(7,Card.SPADES);\n\t \n\t \t\t\t\treturn card;\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() < 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.HEARTS6])){\n\t \t\t\t\t\tselectedCards[Rules.HEARTS6] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t\t//Log.i(\"\",\" Playing card \" + (card.GetValue()) + \" , \" +card.GetSuit());\n\t \t\t\t\t\t//Log.i(\"\",\" Updating playable card \" + (card.GetValue()-1) + \" , \" +Card.HEARTS);\t \t\t\t\t\t\n\t \t\t\t\t\t//playableCards[Rules.HEARTS6] = new Card(card.GetValue()-1,Card.HEARTS);\n\t \t\t\t\t\t//return card;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() > 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.HEARTS8])){\n\t \t\t\t\t\tselectedCards[Rules.HEARTS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t\t//Log.i(\"\",\" Playing card \" + (card.GetValue()) + \" , \" +card.GetSuit());\n\t \t\t\t\t\t//Log.i(\"\",\" Updating playable card \" + (card.GetValue()+1) + \" , \" +Card.HEARTS);\t \t\t\t\t\t\n\t \t\t\t\t\t//playableCards[Rules.HEARTS8] = new Card(card.GetValue()+1,Card.HEARTS);\n\t \t\t\t\t\t//return card;\n\t \t\t\t\t}\n\t \t\t\t}\t \t\t\t\n\t \t\t\t\n\t \t\t\tbreak;\n\t \t\tcase Card.DIAMONDS:\n\t \t\t\t// Is it a seven, it can be played...\n\t \t\t\tif (card.GetValue() == 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.DIAMONDS8])){\n\t \t\t\t\t\tselectedCards[Rules.DIAMONDS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\t\n\t \t\t\tif (card.GetValue() < 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.DIAMONDS6])){\n\t \t\t\t\t\tselectedCards[Rules.DIAMONDS6] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() > 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.DIAMONDS8])){\n\t \t\t\t\t\tselectedCards[Rules.DIAMONDS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\t\t \t\t\t\n\t \t\t\t\n\t \t\t\tbreak;\n\t \t\t\t\n\t \t\tcase Card.CLUBS:\n\t \t\t\t// Is it a seven, it can be played...\n\t \t\t\tif (card.GetValue() == 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS8])){\n\t \t\t\t\t\tselectedCards[Rules.CLUBS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\t \t\t\t\t\n\t \t\t\t}\n\t \t\t\t\n\t \t\t\tif (card.GetValue() < 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS6])){\n\t \t\t\t\t\tselectedCards[Rules.CLUBS6] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() > 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS8])){\n\t \t\t\t\t\tselectedCards[Rules.CLUBS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\t\t \t\t\t\n\t \t\t\tbreak;\n\t \t\t\t\n\t \t\tcase Card.SPADES:\n\t \t\t\t// Is it a seven, it can be played...\n\t \t\t\tif (card.GetValue() == 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.SPADES8])){\n\t \t\t\t\t\tselectedCards[Rules.SPADES8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\t \t\t\t\t\n\t \t\t\t}\n\t \t\t\t\n\t \t\t\tif (card.GetValue() < 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.SPADES6])){\n\t \t\t\t\t\tselectedCards[Rules.SPADES6] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() > 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.SPADES8])){\n\t \t\t\t\t\tselectedCards[Rules.SPADES8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\t \t\t\t\n\t \t\t\tbreak;\n\n\t \t\t\t\t \t\t\t\n\t \t\t}\n\t\n\t \t}\t\n\t \t\n\t \t// Now go through the selectable cards and see which is best to be played\n\t \tif (iNumSelectableCards == 0)\n\t \t\treturn ret;\n\t \t\n\t \tint iPos;\n\t \tcard = null;\n\t \tif (iNumSelectableCards == 1){\n\t\t\t \tfor (int i = 0; i < 8; i++)\n\t\t\t \t\tif (selectedCards[i] != null){\n\t\t\t \t\t\tcard = selectedCards[i];\n\t\t\t \t\t\tbreak;\n\t\t\t \t\t}\n\t\t\t \t\t\t \t\n\t \t}\n\t \telse {\n\t\t\t String sDifficulty = mRules.mView.GetSettings().getString(\"Difficulty\", \"0\");// 0 = hard, 1 = easy\n\t\t\t int iDifficulty = Integer.parseInt(sDifficulty);\n\t\t\t if (iDifficulty == EASY){\n\t\t\t \t// Get a random card from the playable ones\n\t\t\t\t\t Random generator = new Random();\n\t\t\t\t\t int randomIndex = generator.nextInt( iNumSelectableCards );\n\t\t\t\t\t int iCount = 0;\n\t\t\t\t\t \tfor (int i = 0; i < 8; i++){\n\t\t\t\t\t \t\tif (selectedCards[i] != null){\n\t\t\t\t\t \t\t\tif (iCount == randomIndex){\n\t\t\t\t\t \t\t\t\tcard = selectedCards[i];\n\t\t\t\t\t \t\t\t\tbreak;\n\t\t\t\t\t \t\t\t}\n\t\t\t\t\t \t\t\telse iCount++;\n\t\t\t\t\t \t\t}\t\n\t\t\t\t\t \t}\n\t\t\t }\n\t\t\t else {\n\t\t\t \tiPos = GetBestCard(selectedCards);\n\t\t\t \tcard = selectedCards[iPos];\n\t\t\t }\n\t \t}\n\t \t\n\t \tswitch (card.GetSuit()){\n \t\tcase Card.HEARTS:\t \t\n \t\t\tif (card.GetValue() == 7){\n \t\t\t\t// and must be played first\n \t\t\t\tplayableCards[Rules.HEARTS8] = new Card(8,Card.HEARTS);\n \t\t\t\tplayableCards[Rules.HEARTS6] = new Card(6,Card.HEARTS);\n \t\t\t\tplayableCards[Rules.CLUBS8] = new Card(7,Card.CLUBS);\n \t\t\t\tplayableCards[Rules.DIAMONDS8] = new Card(7,Card.DIAMONDS);\n \t\t\t\tplayableCards[Rules.SPADES8] = new Card(7,Card.SPADES);\n \n \t\t\t\treturn card;\n \t\t\t}\n \t\t\tif (card.GetValue() < 7){\n \t\t\t\tif (card.Equals(playableCards[Rules.HEARTS6])){\n \t\t\t\t\tplayableCards[Rules.HEARTS6] = new Card(card.GetValue()-1,Card.HEARTS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (card.GetValue() > 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.HEARTS8])){ \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.HEARTS8] = new Card(card.GetValue()+1,Card.HEARTS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\t \t\t\t\n \t\t\t\n \t\t\tbreak; \n \t\tcase Card.DIAMONDS:\n \t\t\t// Is it a seven, it can be played...\n \t\t\tif (card.GetValue() == 7){\n \t\t\t\tif (playableCards[Rules.HEARTS8] != null && playableCards[Rules.HEARTS8].GetValue() > 7){\n\t \t\t\t\tplayableCards[Rules.DIAMONDS8] = new Card(8,Card.DIAMONDS);\n\t \t\t\t\tplayableCards[Rules.DIAMONDS6] = new Card(6,Card.DIAMONDS);\t \t\t\t\t\t\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\tif (card.GetValue() < 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.DIAMONDS6])){\t \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.DIAMONDS6] = new Card(card.GetValue()-1,Card.DIAMONDS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (card.GetValue() > 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.DIAMONDS8])){\t \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.DIAMONDS8] = new Card(card.GetValue()+1,Card.DIAMONDS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\t\t \t\t\t\n \t\t\t\n \t\t\tbreak; \n \t\t\t\n \t\tcase Card.CLUBS:\n \t\t\t// Is it a seven, it can be played...\n \t\t\tif (card.GetValue() == 7){\n\n \t\t\t\tif (playableCards[Rules.HEARTS8] != null && playableCards[Rules.HEARTS8].GetValue() > 7){\n\t \t\t\t\tplayableCards[Rules.CLUBS8] = new Card(8,Card.CLUBS);\n\t \t\t\t\tplayableCards[Rules.CLUBS6] = new Card(6,Card.CLUBS);\t \t\t\t\t\t\n \t\t\t\t\treturn card;\n \t\t\t\t}\t \t\t\t\t\n \t\t\t}\n \t\t\t\n \t\t\tif (card.GetValue() < 7){\n \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS6])){\n \t\t\t\t\tplayableCards[Rules.CLUBS6] = new Card(card.GetValue()-1,Card.CLUBS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (card.GetValue() > 7){\n \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS8])){\n \t\t\t\t\tLog.i(\"\",\" Updating playable card \" + (card.GetValue()+1) + \" , \" +Card.CLUBS);\n \t\t\t\t\tplayableCards[Rules.CLUBS8] = new Card(card.GetValue()+1,Card.CLUBS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\t\t \t\t\t\n \t\t\tbreak; \n \t\tcase Card.SPADES:\n \t\t\t// Is it a seven, it can be played...\n \t\t\tif (card.GetValue() == 7){\n \t\t\t\tif (playableCards[Rules.HEARTS8] != null && playableCards[Rules.HEARTS8].GetValue() > 7){\n\t \t\t\t\tplayableCards[Rules.SPADES8] = new Card(8,Card.SPADES);\n\t \t\t\t\tplayableCards[Rules.SPADES6] = new Card(6,Card.SPADES);\t \t\t\t\t\t\n \t\t\t\t\treturn card;\n \t\t\t\t}\t \t\t\t\t\n \t\t\t}\n \t\t\t\n \t\t\tif (card.GetValue() < 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.SPADES6])){ \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.SPADES6] = new Card(card.GetValue()-1,Card.SPADES);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (card.GetValue() > 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.SPADES8])){\t \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.SPADES8] = new Card(card.GetValue()+1,Card.SPADES);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\t \t\t\t\n \t\t\tbreak;\n \t\t\t\n\t \t}\n\t \n\t }\n\t return ret;\n }", "private void resume() { player.resume();}", "private static void playBlackjack(Player player) {\n\t\t//Delete hands of previous games.\n\t\tplayer.getReady();\n\t\t\n\t\t//Create the dealer.\n\t\tDealer dealer = new Dealer();\n\t\t\n\t\t//Deal two cards to each player.\n\t\tplayer.addCard(deck.dealCard());\n\t\tplayer.addCard(deck.dealCard());\n\t\t\n\t\tdealer.addCard(deck.dealCard());\n\t\tdealer.addCard(deck.dealCard());\n\t\t\n\t\t//Check if anyone has Blackjack.\n\t\tif (dealer.hasBlackjack()) {\n\t\t\tconsole.println(\"Your hand:\" + player.getHand());\n\t\t\tconsole.println(\"Dealer hand:\" + dealer.getHand());\n\t\t\tconsole.println(\"\\n*******************\\n\" +\n\t\t\t\t\t\"Blackjack! You lose!!\" +\n\t\t\t\t\t\"\\n*******************\\n\");\n\t\t\tconsole.println(\"Press <Enter> to continue.\");\n\t\t\tplayer.pay();\n\t\t\treturn;\n\t\t}\n\t\tif (player.hasBlackjack()) {\n\t\t\tconsole.println(\"Dealer hand:\" + dealer.getHand());\n\t\t\tconsole.println(\"Your hand:\" + player.getHand());\n\t\t\tconsole.println(\"\\n*******************\\n\" +\n\t\t\t\t\t\"Blackjack! You lose!!\" +\n\t\t\t\t\t\"\\n*******************\\n\");\n\t\t\tconsole.println(\"Press <Enter> to continue.\");\n\t\t\tplayer.collect();\n\t\t\treturn;\n\t\t\t\n\t\t}\n\t\t\n\t\t//Now the real game begins. Player play first.\n\t\t//Must play all the hands until dealer's turn.\n\t\tboolean dealerTurn = false;\n\t\t\n\t\tconsole.println(String.format(\"\\n\\nDealer first card: %s\", dealer.getFirstCard()));\n\t\t\n\t\twhile (!dealerTurn) { //Player keep playing as long as she can/wants\n\t\t\t\n\t\t\t//Player can have multiple hands (after split). Should play all of them independently.\n\t\t\tOptional<Hand> optionalPlayingHand = player.getNextPlayableHand();\n\t\t\t\n\t\t\tif (optionalPlayingHand.isPresent()) {\n\t\t\t\t\n\t\t\t\tplayer.setCurrentHand(optionalPlayingHand.get());\n\t\t\t\t\n\t\t\t\tconsole.println(\"Your playing hand:\" + player.getHand());\n\t\t\t\tconsole.print(\"Please, select an option: \");\n\t\t\t\tconsole.println(\"(1) Hit (2) Stand (3) Double Down (4) Split (5) Surrender\");\n\t\t\t\tint option = scanner.nextInt();\n\t\t\t\t\n\t\t\t\tswitch (UserAction.valueOf(option)) {\n\t\t\t\t\tcase HIT:\n\t\t\t\t\t\tconsole.println(\"You've chosen: HIT\");\n\t\t\t\t\t\tplayer.hit(deck.dealCard());\n\t\t\t\t\t\tconsole.println(\"Your resulting hand:\" + player.getHand());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase STAND:\n\t\t\t\t\t\tconsole.println(\"You've chosen: STAND\");\n\t\t\t\t\t\tplayer.stand();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase SPLIT:\n\t\t\t\t\t\tconsole.println(\"You've chosen: SPLIT\");\n\t\t\t\t\t\tif (player.split(deck.dealCard(), deck.dealCard())) {\n\t\t\t\t\t\t\tconsole.println(\"Your hand has been split\");\n\t\t\t\t\t\t\tconsole.println(\"Your resulting hand:\" + player.getHand());\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconsole.println(\"Your hand can not be split. Try another option\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DOUBLE_DOWN:\n\t\t\t\t\t\tconsole.println(\"You've chosen: DOUBLE DOWN\");\n\t\t\t\t\t\tplayer.doubleDown(deck.dealCard());\n\t\t\t\t\t\tconsole.println(\"Your resulting hand:\" + player.getHand());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase SURRENDER:\n\t\t\t\t\t\tconsole.println(\"You've chosen: SURRENDER\");\n\t\t\t\t\t\tif (player.surrender()) {\n\t\t\t\t\t\t\tconsole.println(\"Lose half of your bet.\");\n\t\t\t\t\t\t\tconsole.println(\"Dealer hand:\" + dealer.getHand());\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconsole.println(\"You cannot surrender. Try another option\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tdealerTurn = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//All player's hands are standing or busted\n\t\tfor (Hand hand : player.getHands()) {\n\t\t\tconsole.println(\"Your hand: \" + hand + \" Status: \" + hand.getStatus());\n\t\t}\n\t\t\n\t\tconsole.println(\"\\nDealer hand:\" + dealer.getHand());\n\t\t\n\t\tif (player.isBusted()) {\n\t\t\tconsole.println(\"\\n************\\n\" +\n\t\t\t\t\t\"You lose!!\" +\n\t\t\t\t\t\"\\n************\\n\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tconsole.println(\"\\nDealer turn.\\n\");\n\t\t//Dealer's turn.\n\t\twhile (dealerTurn) {\n\t\t\tUserAction dealerAction = dealer.getNextAction();\n\t\t\tswitch (dealerAction) {\n\t\t\t\tcase HIT:\n\t\t\t\t\tconsole.println(\"Dealer HIT\");\n\t\t\t\t\tdealer.hit(deck.dealCard());\n\t\t\t\t\tconsole.println(\"Dealer resulting hand:\" + dealer.getHand());\n\t\t\t\t\tbreak;\n\t\t\t\tcase STAND:\n\t\t\t\t\tconsole.println(\"Dealer STAND\");\n\t\t\t\t\tdealer.stand();\n\t\t\t\t\tdealerTurn = false;\n\t\t\t\t\tbreak;\n\t\t\t\tcase DONE:\n\t\t\t\t\tdealerTurn = false;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tconsole.println(\"Dealer hand:\" + dealer.getHand());\n\t\tif (dealer.isBusted()) {\n\t\t\t//Dealer is busted. Player wins!\n\t\t\tconsole.println(\"\\n************\\n\" +\n\t\t\t\t\t\"You win!!\" +\n\t\t\t\t\t\"\\n************\\n\");\n\t\t\tplayer.collect();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//Check if dealer won\n\t\tif (dealer.hasBlackjack()) {\n\t\t\tconsole.println(\"\\n******************************************************\\n\" +\n\t\t\t\t\t\"There is a tie!. Dealer wins. Its a casino after all\" +\n\t\t\t\t\t\"\\n******************************************************\\n\");\n\t\t\tplayer.pay();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tconsole.println(\"\\n*****************************************************************\\n\");\n\t\tfor (Hand hand : player.getNonBustedHands()) {\n\t\t\tif (hand.getValue() > dealer.getValue()) {\n\t\t\t\t//Player has a better hand. Hand wins.\n\t\t\t\tconsole.println(\"You have a winner hand :\" + hand);\n\t\t\t\tplayer.collect(hand);\n\t\t\t} else {\n\t\t\t\t//Player's hand lose\n\t\t\t\tconsole.println(\"You have a losing hand :\" + hand);\n\t\t\t\tif (hand.getValue() == dealer.getValue()) {\n\t\t\t\t\tconsole.println(\"Remember: in a tie, you lose!\");\n\t\t\t\t}\n\t\t\t\tplayer.pay(hand);\n\t\t\t}\n\t\t}\n\t\tconsole.println(\"\\n*****************************************************************\\n\");\n\t}", "public void tryStand() {\n if(player.getHand().size() > 0){\n firstStand = true;\n dealerTurn(1);\n } else{\n errorFlag = true;\n userMessage = \"You must get your initial hand dealt before you can stand\";\n }\n\n\n }", "@Test\n public void CardRequirementError() {\n MSG_ACTION_ACTIVATE_LEADERCARD message = new MSG_ACTION_ACTIVATE_LEADERCARD(0);\n DevelopmentCard card1 = new DevelopmentCard(1, Color.GREEN, 0, null, null);\n p.getDevelopmentSlot().addCard(card1, 1);\n c.emptyQueue();\n assertFalse(am.activateLeaderCard(p, message));\n assertEquals(MessageType.MSG_ERROR, c.messages.get(0).getMessageType());\n assertEquals(1, c.messages.size());\n }", "public abstract CardAction play(Player p);", "void askDevCardProduction();", "void playMonopolyCard(String resource);", "protected final void hit() throws InsufficientCardsException {\n hand.add(deck.deal());\n update();\n }", "public void playerLost()\r\n {\r\n \r\n }", "public static void handleDream(Player player) {\n\t\t\n\t}", "public void failedMultiPlayer() {\r\n\t\tmultiplayer.setEnabled(true);\r\n\t\tToast.makeText(this, R.string.con_err, Toast.LENGTH_LONG)\r\n\t\t .show();\r\n\t}", "public void startGame() {\n this.deck = new Deck();\n this.deck.shuffle(); //shuffle the deck\n Card card = this.deck.deal(this.getPlayerHand());\n card = this.deck.deal(this.getPlayerHand());\n card = this.deck.deal(this.getDealerHand());\n }", "public void onPlayStart(){\n\n\t}", "public static void hitCorrect()\n\t{\n\t\tplayersCards.add(deck.deal());\n\t\tcurrentValue();\n\t\tuserCardImg[playersCards.size()-1].setIcon(new ImageIcon(Gameplay.class.getResource(getCard(playersCards.get(playersCards.size()-1)))));\n\t\tresume();\n\t\tif(calculateHand(playersCards)>21 || playersCards.size()==4 || calculateHand(playersCards)==0)\n\t\t{\n\t\t\troundEnd();\n\t\t}\n\t\t\n\t}", "void playerUsedCard(Card c, boolean discard) {\n\t\t// The creator data is in the 2 first bytes, the other player in the 2\n\t\t// last bytes.\n\t\tplayedCard[0] = (discard ? DISCARDED_CARD : PLAYED_CARD);\n\t\tplayedCard[1] = (byte) c.id;\n\t}", "public void wrong()\n\t{\n\t\tMediaPlayer wrong = MediaPlayer.create(this, R.raw.wrong);\n\t\twrong.start();\n\t}", "public void catchCard(){\r\n changePlace(deck);\r\n changePlace(hand);\r\n }", "public void nextStepInGame(View view){\n // called by click on either card, so need to track state\n Log.d(getClass().toString(),\"playstate before = \" + playstate.toString());\n\n playstate = playstate.getNext();\n Log.d(getClass().toString(),\"playstate after update = \" + playstate.toString());\n ImageButton computerCard = (ImageButton) findViewById(R.id.computerCard);\n ImageButton youCard = (ImageButton) findViewById(R.id.youCard);\n TextView infoPanel = (TextView) findViewById(R.id.info_panel);\n switch (playstate){\n case NOCARDS: {\n // show empty buttons as no cards on table\n computerCard.setImageResource(R.color.holo_green_dark);\n computerCard.setVisibility(View.VISIBLE);\n youCard.setImageResource(R.color.holo_blue_dark);\n youCard.setVisibility(View.VISIBLE);\n infoPanel.setText(\"Click to deal cards to both players\");\n\n break;\n }\n case DEALCARDS: {\n // show backs of cards ready to play them\n computerCard.setImageResource(R.drawable.card_back);\n computerCard.setVisibility(View.VISIBLE);\n youCard.setImageResource(R.drawable.card_back);\n youCard.setVisibility(View.VISIBLE);\n infoPanel.setText(\"Click to reveal cards\");\n break;\n }\n case SHOWCARDS: {\n // playARound, but only show card faces\n game.playARound();\n String cardToShow = this.game.getTurnlog().lastEntryFor(game.getPlayers()[1]).getHand().topShownCard().toDrawableName();\n computerCard.setImageResource(getResources().getIdentifier(cardToShow, \"drawable\", \"com.codeclan.cardgame\"));\n cardToShow = this.game.getTurnlog().lastEntryFor(game.getPlayers()[0]).getHand().topShownCard().toDrawableName();\n youCard.setImageResource(getResources().getIdentifier(cardToShow, \"drawable\", \"com.codeclan.cardgame\"));\n\n infoPanel.setText(getString(R.string.computer_label) + \" has \" +\n game.getPlayers()[1].getScore().toString() + \" points,\\n\" +\n getString(R.string.player_label) + \" has \" +\n game.getPlayers()[0].getScore().toString() + \" points.\\n Click for clear table\") ;\n\n break;\n }\n\n }\n if( game.isOver() ){\n//\n// break out of onClick loop by going to new activity to display results\n//\n Intent resultsIntent = new Intent(this, G2P1CHWResultsActivity.class);\n resultsIntent.putExtra(\"player1score\", game.getPlayers()[0].getScore());\n resultsIntent.putExtra(\"dealerscore\", game.getPlayers()[1].getScore());\n resultsIntent.putExtra(\"winner\", game.winner().getName());\n\n startActivity(resultsIntent);\n }\n\n }", "public void currentPlayerDrawCard() {\n Player currentPlayer = turnManager.currentPlayer();\n UnoCard newCard = getNextCard();\n currentPlayer.obtainCard(newCard);\n\n for (GameListener gameListener : gameListeners) {\n gameListener.cardDrawn();\n }\n\t}", "void askLeaderCardThrowing();", "@Override\r\n\t\t\tpublic void playGame() {\n\t\t\t\tSystem.out.println(\"隐式调用接口\");\r\n\t\t\t}", "@Override\n\tpublic void play() {\n\t\t\n\t}", "private void BlueEatsPlayer(Player player)\n {\n Player player_to_be_eaten = null;\n try\n {\n BluePlayer player_to_eat = (BluePlayer) player;\n player_to_be_eaten = checkIfEatsRedPlayer(player_to_eat);\n if (player_to_be_eaten == null)\n {\n player_to_be_eaten = checkIfEatsGreenPlayer(player_to_eat);\n if (player_to_be_eaten == null)\n {\n player_to_be_eaten = checkIfEatsYellowPlayer(player_to_eat);\n }\n }\n //player_to_be_eaten.println(\"blue_player_to_be_eaten\" + player_to_be_eaten.toString());\n if (player_to_be_eaten != null)\n {\n playPersonEatenMusic();\n returnPlayerHome(player_to_be_eaten);\n }\n }\n catch (Exception e)\n {\n \n }\n return;\n }", "private void reportPlay (Player player) {\n System.out.println(\"Player \" + player.name() +\n \" takes \" + player.numberTaken() +\n \" stick(s), leaving \" + game.sticksLeft()\n + \".\");\n }", "public void SpecialCardAction(UNOCard aCard) {\n\t\t\n\t\tif (aCard.getName() == \"Reverse\") { // Reverse card is played, so game direction is switched\n\t\t\tif (gameDirection == \"right\") {\n\t\t\t\tgameDirection = \"left\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\tgameDirection = \"right\";\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (aCard.getName() == \"Skip\") {\n\t\t\tif (gameDirection == \"right\") { // If Game is moving in one direction\n\t\t\t\tcurrentPlayerToPlayIndex = currentPlayerToPlayIndex + 2; // player next to play is skipped\n\t\t\t\tif (currentPlayerToPlayIndex >= players.size()) {\n\t\t\t\t\tcurrentPlayerToPlayIndex = currentPlayerToPlayIndex - players.size();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (gameDirection == \"left\") { // If Game is moving in other direction\n\t\t\t\tcurrentPlayerToPlayIndex = currentPlayerToPlayIndex - 2; // player next to play is skipped\n\t\t\t\tif (currentPlayerToPlayIndex <= 0) {\n\t\t\t\t\tcurrentPlayerToPlayIndex = currentPlayerToPlayIndex + players.size();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tcurrentPlayerToPlay = players.get(currentPlayerToPlayIndex); // Next Player to play a card\n\t\t\n\t\tif (aCard.getName() == \"Draw Two\") { // If a Draw Two Card is played, the enxt player to play is dealt two cards\n\t\t\tif (gameDirection == \"right\") {\n\t\t\t\tif (currentPlayerToPlayIndex < players.size()) {\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (gameDirection == \"left\") {\n\t\t\t\tif (currentPlayerToPlayIndex != 0) {\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (aCard.getName() == \"Wild\") { // Wild is played, function called to ask user for new color\n\t\t\tWildIsPlayedAskUserForColor();\n\t\t}\n\t\t\n\t\tif (aCard.getName() == \"Wild Draw Four\") {\n\t\t\tif (gameDirection == \"right\") { // if game direction is this way\n\t\t\t\tif (currentPlayerToPlayIndex < players.size()) {\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard()); // draw four cards\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard()); // draw four cards\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (gameDirection == \"left\") { // if game direction is this way\n\t\t\t\tif (currentPlayerToPlayIndex != 0) {\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard()); // draw four cards\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard()); // draw four cards\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t}\n\t\t\tWildIsPlayedAskUserForColor();\n\t\t}\n\t\t\n\t}", "public void play() {\n\t\t\r\n\t}", "void makePlay(int player) {\n }", "@Override\n protected void receiveInfo(GameInfo info) {\n if (!(info instanceof PalaceGameState)) {\n return;\n }\n PalaceGameState state = new PalaceGameState((PalaceGameState) info);\n PalaceSelectCardAction selectCardAction;\n if (state.getTurn() != this.playerNum) {\n return;\n } else {\n sleep(1000); // make the computer \"think\"\n boolean isBigger = false;// variable to check if they have a valid card\n\n //determines if the cards are valid\n if (!(state.getP2Hand().isEmpty()) && !state.getPlayPilePalaceCards().isEmpty()) {\n for (int i = 0; i < state.getP2Hand().size(); i++) {\n if (state.getP2Hand().get(i).getRank() > state.getPlayPilePalaceCards().\n get(state.getPlayPilePalaceCards().size() - 1).getRank()) {\n isBigger = true;\n }\n }\n }\n\n //takes pile if they have no hand cards to play\n if (isBigger == false && !(state.getP2Hand().isEmpty())) {\n PalaceTakePileAction take = new PalaceTakePileAction(this);\n Log.d(\"compPlayer\", \"took the pile\");\n this.game.sendAction(take);\n }\n\n //begins searching for a card to select\n PalaceCard cardToSelect = null;\n\n // check in the case when the play pile and their hand are both not empty\n if (!(state.getPlayPilePalaceCards().isEmpty()) && (!(state.getP2Hand().isEmpty()))) {\n\n // while they haven't selected a card or the card they selected is less than the top card\n // another card is selected at random from their hand\n while (cardToSelect == null ||\n (cardToSelect.getRank() <\n (state.getPlayPilePalaceCards().\n get(state.getPlayPilePalaceCards().size() - 1).getRank()) &&\n state.getPlayPilePalaceCards().\n get(state.getPlayPilePalaceCards().size() - 1).getRank() >=0)) {\n cardToSelect =\n state.getP2Hand().get((int) (Math.random() * state.getP2Hand().size()));\n }\n\n // selects a card when they are playing from their top cards\n } else if (state.getP2Hand().isEmpty() && (!(state.getP2TopPalaceCards().isEmpty()))) {\n\n //pick any random card if the play pile is empty\n if (state.getPlayPilePalaceCards().isEmpty()) {\n cardToSelect =\n state.getP2TopPalaceCards().\n get((int) (Math.random() * state.getP2TopPalaceCards().size()));\n }\n\n //play pile is not empty so find a valid card\n else {\n\n //checks to see if there is a valid card\n for (int i = 0; i < state.getP2TopPalaceCards().size(); i++) {\n if (state.getP2TopPalaceCards().get(i).getRank() >\n state.getPlayPilePalaceCards().\n get(state.getPlayPilePalaceCards().size() - 1).getRank() &&\n state.getPlayPilePalaceCards().\n get(state.getPlayPilePalaceCards().size() - 1).getRank() >= 0) {\n isBigger = true;\n }\n }\n\n //finds a random valid card because there is one that is valid\n if (isBigger) {\n while (cardToSelect == null ||\n (cardToSelect.getRank() <\n state.getPlayPilePalaceCards().\n get(state.getPlayPilePalaceCards().size() - 1).\n getRank() &&\n state.getPlayPilePalaceCards().\n get(state.getPlayPilePalaceCards().size() - 1).\n getRank() >= 0)) {\n cardToSelect =\n state.getP2TopPalaceCards().\n get((int) (Math.random() * state.\n getP2TopPalaceCards().size()));\n }\n }\n\n //no card to be played so take the pile\n else {\n PalaceTakePileAction take = new PalaceTakePileAction(this);\n Log.d(\"compPlayer\", \"took the pile\");\n this.game.sendAction(take);\n }\n }\n }\n\n //they only have bottom cards left, all are valid to be played so pick a random one\n else if (state.getP2TopPalaceCards().isEmpty()&&state.getP2Hand().isEmpty()) {\n cardToSelect =\n state.getP2BottomPalaceCards().\n get((int) (Math.random() * state.getP2BottomPalaceCards().size()));\n }\n\n //the play pile is empty and they only have hand cards, pick one at random\n else {\n cardToSelect =\n state.getP2Hand().get((int) (Math.random() * state.getP2Hand().size()));\n }\n\n //create and send the select card action with the selected card\n selectCardAction = new PalaceSelectCardAction(this, cardToSelect,\n state.getSelectedPalaceCards());\n this.game.sendAction(selectCardAction);\n\n //rerun selectCardAction if there are multiple of the same card\n if (!state.getP2Hand().isEmpty()) {\n for (int i = 0; i < state.getP2Hand().size(); i++) {\n if (state.getP2Hand().get(i).getRank() == cardToSelect.getRank() &&\n !cardToSelect.equals(state.getP2Hand().get(i))) {\n selectCardAction = new PalaceSelectCardAction(this, state.getP2Hand().get(i),\n state.getSelectedPalaceCards());\n this.game.sendAction(selectCardAction);\n }\n }\n }\n else if (state.getP2Hand().isEmpty() && !state.getP2TopPalaceCards().isEmpty()) {\n for (int i = 0; i < state.getP2Hand().size(); i++) {\n if (state.getP2Hand().get(i).getRank() == cardToSelect.getRank() &&\n !cardToSelect.equals(state.getP2TopPalaceCards().get(i))) {\n selectCardAction = new PalaceSelectCardAction(this, state.getP2TopPalaceCards().get(i),\n state.getSelectedPalaceCards());\n this.game.sendAction(selectCardAction);\n }\n }\n }\n\n //creates and sends the playCardAction\n PalacePlayCardAction playCardAction = new PalacePlayCardAction(this);\n this.game.sendAction(playCardAction);\n }\n\n\n }", "public void playerWon()\r\n {\r\n \r\n }", "public void playCard(IPlayer owner){\n // Wont play card unless a player has it\n if(command == \"Move1\"){\n owner.Move(owner.getPlayerDir());\n }\n else if(command == \"Move2\"){\n for (Integer i=0; i < 2; i++) {\n owner.Move(owner.getPlayerDir());\n }\n }\n else if(command == \"Move3\"){\n for (Integer i=0; i < 3; i++) {\n owner.Move(owner.getPlayerDir());\n }\n }\n else if (command == \"MoveBack\"){\n owner.Move(dirCtrl.invertDirection(owner.getPlayerDir()));\n }\n else if(command == \"TurnRight\"){\n owner.Turn(TurnDirection.RIGHT);\n }\n else if(command == \"TurnLeft\"){\n owner.Turn(TurnDirection.LEFT);\n }\n else if(command == \"Turn180\"){\n owner.Turn(TurnDirection.BACKWARDS);\n }\n }", "public Card playCard()\n {\n\n Card errorReturn = new Card('E', Card.Suit.spades); // in rare cases\n\n if (numCards == 0)\n return errorReturn;\n else\n return myCards[--numCards];\n }", "@Override\n\tpublic void play() {\n\t\tSystem.out.println(\"We played Snokker today\");\n\t\t\n\t\t\n\t}", "@Override\n public void playStart() {\n }", "@Test(expected = IllegalArgumentException.class)\n public void startPlayTest4() {\n GenericStandardDeckGame g = new GenericStandardDeckGame();\n g.startPlay(0, g.getDeck());\n }", "void onStartGameRequested();", "public void playBlackjack() {\n\t\tString choice;\n\t\t\n\t\tSystem.out.println(\"Welcome to Blackjack! \\n\");\n\t\tSystem.out.println(\"Dealing hands \\n\");\n\t\tdeck.shuffle();\n\t\tplayer.setHand(deck.drawHand());\n\t\tdealer.setHand(deck.drawHand());\n\t\t\n\t\t\n\t\tif(checkForBlackjack(player) && checkForBlackjack(dealer)) {\n\t\t\tSystem.out.println(showHands());\n\t\t\tSystem.out.println(\"Both player's have blackjack! \\n\");\n\t\t}\n\t\telse if(checkForBlackjack(player)) {\n\t\t\tSystem.out.println(showHands());\n\t\t\tSystem.out.println(\"Player has blackjack! You win! \\n\");\n\t\t}\n\t\telse if(checkForBlackjack(dealer)) {\n\t\t\tSystem.out.println(showHands());\n\t\t\tSystem.out.println(\"Dealer has blackjack! Dealer wins! \\n\");\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(showInitinalHand());\n\t\t\twhile(player.getHandVal() < 21) {\n\t\t\t\tSystem.out.println(\"Player's turn. Pick to hit or stand \\n\");\n\t\t\t\tchoice = scanner.nextLine().toUpperCase();\n\t\t\t\tif(choice.equals(\"STAND\") || choice.equals(\"S\")) {\n\t\t\t\t\tSystem.out.println(\"Player stands \\n\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse if(choice.equals(\"HIT\")|| choice.equals(\"H\")) {\n\t\t\t\t\tSystem.out.println(\"Player hits \\n\");\n\t\t\t\t\tplayer.addCard(deck.drawCard());\n\t\t\t\t\tSystem.out.println(showInitinalHand());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.println(\"Invalid input \\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile(dealer.getHandVal() < 17) {\n\t\t\t\tSystem.out.println(\"Dealer hits \\n\");\n\t\t\t\tdealer.addCard(deck.drawCard());\n\t\t\t\tSystem.out.println(showHands());\n\t\t\t}\n\t\t\tSystem.out.println(showHands());\n\t\t}\n\t\tcheckWinner();\n\t\tif(result.equals(\"TIE\")) {\n\t\t\tSystem.out.println(\"The result is a tie! \\n\");\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"The winner is the \" + result + \"!\\n\");\n\t\t}\n\t}", "public boolean needPlayer() {\n\t\treturn false;\n\t}", "public void playGame() {\n show();\n while (gameStatus) {\n if (canPut(players.get((state.getTurn())))) {\n int choice = -1;\n while (gameStatus) {\n choice = controls.get(state.getTurn()).putCard(currentCard);\n if (validInput(players.get((state.getTurn())), choice)) {\n System.out.println(players.get(state.getTurn()).getCards().get(choice).toString());\n try{Thread.sleep(1000);}catch(InterruptedException ignored){}\n break;\n }\n }\n decide(players.get(state.getTurn()), players.get(state.getTurn()).getCards().get(choice));\n }\n try{Thread.sleep(500);}catch(InterruptedException ignored){}\n checkFinish();\n if (gameStatus) {\n state.nextTurn();\n show();\n }\n }\n }", "private void playNextPlayer() {\n \n PlayerId nextPlayer = state.nextPlayer();\n players.get(nextPlayer).setHelp(state, handsOfCards.get(nextPlayer), nextPlayer);\n Card c = players.get(nextPlayer).cardToPlay(state, handsOfCards.get(nextPlayer));\n state = state.withNewCardPlayed(c);\n \n handsOfCards.put(nextPlayer, handsOfCards.get(nextPlayer).remove(c));\n players.get(nextPlayer).updateHand(handsOfCards.get(nextPlayer));\n \n for (Map.Entry<PlayerId, Player> pId: players.entrySet()) {\n pId.getValue().updateTrick(state.trick());\n }\n players.get(nextPlayer).resetHelp();\n }", "@Test(expected = NotPlayingException.class)\n public void not_allow_picking_cards_if_not_playing(){\n\n Deck deck = new Deck();\n Game game = new Game(deck);\n\n game.join(\"susan\");\n\n game.pickCard(\"susan\");\n }", "private void playTurn()\n {\n try\n {\n XMLHandler.saveGame(game, GAME_CLONE_PATH);\n }\n catch(IOException | JAXBException | SAXException ex)\n {\n // TODO... ConsoleUtils.message(\"An internal save error has occured, terminating current game\");\n gameEnded = true;\n return;\n }\n \n moveCycle();\n \n if (!game.validateGame()) \n {\n IllegalBoardPenalty();\n }\n \n String gameOverMessage = game.isGameOver();\n if (gameOverMessage != null) \n {\n //TODO: ConsoleUtils.message(gameOverMessage);\n gameEnded = true;\n }\n \n game.switchPlayer();\n }", "public void hitCard() {\n if (this.state == GameState.ROUNDACTIVE) {\n Seat s = this.getSeat(seatPlaying);\n if (s.hasPlayer()) {\n Hand h = s.getPlayer().getHands().get(0);\n h.addCard(this.deck.dealCard());\n if (h.getIsBusted()) {\n this.activeHandStand();\n }\n }\n repaintAll();\n }\n }", "@Override\n\tpublic void play() {\n\n\t}", "private void play() {\n\t\tParcel pc = Parcel.obtain();\n\t\tParcel pc_reply = Parcel.obtain();\n\t\ttry {\n\t\t\tSystem.out.println(\"DEBUG>>>pc\" + pc.toString());\n\t\t\tSystem.out.println(\"DEBUG>>>pc_replay\" + pc_reply.toString());\n\t\t\tib.transact(1, pc, pc_reply, 0);\n\t\t} catch (RemoteException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "private static void playGame() {\n CardDeck deck = new CardDeck();\n int dealer, player, hitOrStand = 1, score = 0;\n System.out.println(\"Goal: Beat the dealer without going over 21\");\n Scanner input = new Scanner(System.in);\n\n // Generate the dealer's card\n dealer = generateRandomNumber(16, 21); \n System.out.println(\"The Dealer scored: \" + dealer);\n System.out.println(\"\");\n \n\n // Keep playing while the player hasn't won or lost yet\n while (hitOrStand == 1 && score < 21 && score < dealer) {\n // Generate player's card\n player = generateRandomNumber(1, 10); \n System.out.println(\"Your card is worth \" + player);\n\n // Displays the picture of player's card\n String card = deck.drawCard(player);\n System.out.println(card);\n\n // Add player's card value to their score\n score = score + player;\n\n // Displays score and asks wether user wants to hit or stand\n if (score <= 21 && score < dealer) {\n System.out.println(\"Your score is \" + score);\n System.out.print(\"Another card? Hit=1 stand=0: \");\n hitOrStand = input.nextInt();\n System.out.println(\"\");\n }\n }\n \n // Display player won\n if (score > dealer && score <= 21 ) {\n System.out.println(\"You win!\");\n System.out.println(\"Your score is \" + score);\n System.out.println(\"The dealer score was \" + dealer);\n System.out.println(\"You were closer to 21 by \" + (score - dealer));\n\n // Display when player ties with dealer\n } else if (score == dealer) {\n System.out.println(\"Your score is \" + score);\n System.out.println(\"\");\n System.out.println(\"You tied!\");\n\n // Display if player lost\n } else if (score > 21) {\n System.out.println(\"Your score is \" + score);\n System.out.println(\"\");\n System.out.println(\"You lose!\");\n int over = score - 21;\n System.out.println(\"You were over 21 by \" + over);\n\n // Display if player lost\n } else {\n int difference;\n difference = dealer - score;\n System.out.println(\"Your score is \" + score);\n System.out.println(\"You lose!\");\n System.out.println(\"The dealer was closer to 21 than you by \" + difference);\n } \n }", "public Player switchPlayer(){\n Player player = getGame().getCurrentPlayer();\n\n List<Card> cards = new ArrayList<>();\n\n for(Card card: getGame().getCards()){\n if(card.rule.isValid(getGame().getDices())){\n cards.add(card);\n }\n }\n\n //get the best card\n if(!cards.isEmpty()){\n Card card = takeTheBestCard(cards);\n\n //add it to the player\n player.getCardsWon().add(card);\n getGame().getCards().remove(card);\n\n System.out.println(player.getName() + \" won \" + card.getExplaination());\n getGame().addAction(new Action(player.getName() + \" won \" + card.getExplaination()));\n }\n\n if(getGame().getCards().isEmpty()){\n game.setStatus(Game.GameStatus.COMPLETED);\n getGame().addAction(new Action(bestPlayer().getName() + \" WON THE GAME!!!\"));\n }\n //turn\n getGame().setCountOfTrialForPlayer(0);\n\n game.setIndexOfCurrentPlayer(game.getIndexOfCurrentPlayer()+1);\n\n if(game.getIndexOfCurrentPlayer() == getGame().getPlayers().size()){\n game.setIndexOfCurrentPlayer(0);\n }\n\n game.setCountOfTrialForPlayer(0);\n game.setDices(new ArrayList<>());\n\n return getGame().getCurrentPlayer();\n }", "public boolean playCard(Card card){\n boolean b = effectHandler.playCard( card , null);\n return b;\n }", "@Override\n\tpublic void onStandDown(PlatformPlayer player) {\n\t\t\n\t}", "private void RedEatsPlayer(Player player)\n {\n Player player_to_be_eaten = null;\n try\n {\n RedPlayer player_to_eat = (RedPlayer) player;\n player_to_be_eaten = checkIfEatsBluePlayer(player_to_eat);\n if (player_to_be_eaten == null)\n {\n player_to_be_eaten = checkIfEatsGreenPlayer(player_to_eat);\n if (player_to_be_eaten == null)\n {\n player_to_be_eaten = checkIfEatsYellowPlayer(player_to_eat);\n }\n }\n\n //player_to_be_eaten.println(\"red_player_to_be_eaten\" + player_to_be_eaten.toString());\n if (player_to_be_eaten != null)\n {\n playPersonEatenMusic();\n returnPlayerHome(player_to_be_eaten);\n }\n }\n catch (Exception e)\n {\n \n }\n return;\n }", "public void howToPlay() {\r\n // An item has been added to the ticket. Fire an event and let everyone know.\r\n System.out.println(\"Step 1: Have no life. \\nStep 2: Deal cards\\nStep 3: Cry yourself to sleep.\");\r\n }", "private void playGame() throws IOExceptionFromController {\n for (Player player : players) {\n if (player.getGodCard().hasAlwaysActiveModifier()) game.addModifier(player.getGodCard());\n }\n while (!game.hasWinner()) {\n if (!running.get()) return;\n Player currentPlayer = players.get(game.getActivePlayer());\n for (Card modifier : game.getActiveModifiers()) {\n if (!modifier.hasAlwaysActiveModifier() && modifier.getController().getPlayer().equals(currentPlayer))\n game.removeModifier(modifier);\n }\n\n broadcastGameInfo(\"turnStart\");\n String result = playerControllers.get(game.getActivePlayer()).playTurn();\n switch (result) {\n case \"next\":\n checkWorkers();\n game.nextPlayer();\n break;\n case \"outOfMoves\":\n case \"outOfBuilds\":\n case \"outOfWorkers\":\n eliminatePlayer(currentPlayer, result);\n game.nextPlayer();\n break;\n case \"winConditionAchieved\":\n case \"godConditionAchieved\":\n setWinner(currentPlayer, result);\n break;\n default:\n logError(\"invalid turn\");\n break;\n }\n }\n gameOver();\n }", "@Override\n\tpublic void nowPlaying() {\n\t}", "private void resume()\r\n {\r\n player.resume();\r\n }", "void askBuyDevCards();", "@Override\n public void keyPressed(KeyEvent e) {\n player.keyPressed(e); // tell player a key has been pressed\n if (e.getKeyCode() == KeyEvent.VK_X && player.invulnerableTime <= 0 && spellCards > 0){ // player cast spell card\n spellCards --;\n audioloader.play(\"spark\");\n player.invulnerableTime = 5.0 * FPS;\n }\n if (e.getKeyCode() == KeyEvent.VK_C){ // toggle hitbox\n if (player.invulnerableTime <= 0)\n player.invulnerableTime = 10000000;\n else\n player.invulnerableTime = 0;\n }\n if (e.getKeyCode() == KeyEvent.VK_ENTER && entityloader.frame >= levelEnd){ // advance to next level\n gameResult = 1;\n }\n if (e.getKeyCode() == KeyEvent.VK_A){ // add life\n lives++;\n }\n }", "@Override\n\tpublic void onRun(PlatformPlayer player) {\n\t\t\n\t}", "public void playTurn() {\r\n\r\n }", "public void play(){\n\t\t\n\t}", "@Override\r\n\tpublic boolean canPlay() {\n\t\treturn false;\r\n\t}", "@Override\n public void landedOn(Player player) {}", "void askLeaderCardActivation();", "public void startGame() {\n int numberOFPlayers = view.askForNumberOfPlayers();\n\n // adding dealer...\n players.add(dealer);\n //...and players to 'players' ArrayList\n for (int i = 1; i < numberOFPlayers; i++) {\n players.add(new RegularPlayer(i + 1));\n }\n\n // dealing cards to players\n dealer.dealCardsToPlayers(players);\n // Game\n while (!(players.size() == 1)) {\n\n for (int i = 0; i < players.size(); i++) {\n\n // printowanie ilości kart kazdego z graczy dla testów\n if (checkGameStatus()) {\n try {\n // display no of cards for each player\n for (Player player : players) {\n view.print(\"Player \" + player.getPlayerId() + \" no of cards: \" + player.getCardsCount());\n }\n\n round(players.get(i), players);\n } catch (IndexOutOfBoundsException e) {\n continue;\n }\n } else {\n break;\n }\n }\n }\n }", "public void playCard(int index) {\r\n\t\tCard c = deck.hand.get(index);\r\n\t\tif(c.isAction() && actions > 0 && access.gamePhase < 2) {\r\n\t\t\taccess.gamePhase = 1;\r\n\t\t\tif(!deck.play.contains(new Champion())) actions--;\r\n\t\t\tdeck.playCard(index);\r\n\t\t\tc.performAction();\r\n\t\t\tnotifyObservers();\r\n\t\t}\r\n\t\telse if(c.isTreasure() && access.gamePhase < 3) {\r\n\t\t\taccess.gamePhase = 1;\r\n\t\t\taddTreasure(c.getTreasure());\r\n\t\t\tdeck.playCard(index);\r\n\t\t\tc.performAction();\r\n\t\t\tnotifyObservers();\r\n\t\t}\r\n\t}", "@Override\n\t\tpublic void onLoaded(String arg0) {\n\t\t\t\tplayer.play();\n\t\t}", "public void preGame() {\n\n\t}", "public boolean mayPickup(Player debug1) {\n/* 112 */ return true;\n/* */ }", "public void handStarted(int position, GameState gs, Card[] cards) {\r\n }", "public void notifyPlayer(CardGraphics card){\n\t\tchosenCard = card.getCard();\n\t\t\n\t\tsynchronized(lock){\n\t\t\tlock.notify();\n\t\t}\n\t}" ]
[ "0.7410453", "0.73236656", "0.7311895", "0.72207314", "0.7068116", "0.7020802", "0.69322014", "0.67434806", "0.67256624", "0.6723173", "0.67121774", "0.66599023", "0.6587916", "0.6584277", "0.6574833", "0.6503764", "0.6488757", "0.6448004", "0.6388153", "0.63467383", "0.6314477", "0.6306998", "0.6296475", "0.6295797", "0.62936634", "0.6273792", "0.6270514", "0.62347686", "0.620201", "0.61843264", "0.61834466", "0.6169335", "0.61391383", "0.6132726", "0.61325717", "0.6132546", "0.613123", "0.6129976", "0.60923535", "0.6088289", "0.60844296", "0.6081897", "0.6077734", "0.60744494", "0.6029949", "0.602286", "0.60199267", "0.6014058", "0.6009962", "0.60083634", "0.59989756", "0.5990809", "0.59907186", "0.5987374", "0.5977484", "0.5975476", "0.59673506", "0.5965718", "0.5964075", "0.5957182", "0.5955525", "0.59544873", "0.5952262", "0.594589", "0.59418106", "0.5935631", "0.593338", "0.5929108", "0.59286714", "0.59182394", "0.59161097", "0.59140366", "0.59122413", "0.59088665", "0.59071153", "0.59028935", "0.58980364", "0.58968556", "0.5895106", "0.5893146", "0.5884195", "0.5883881", "0.58797926", "0.58772844", "0.58766794", "0.58701295", "0.586893", "0.5867332", "0.5865806", "0.586558", "0.58652776", "0.5862953", "0.5858327", "0.585111", "0.58481234", "0.5837304", "0.58372176", "0.5836926", "0.5834252", "0.5829728", "0.5828033" ]
0.0
-1
This method is called when a player tries to play a development card
boolean CanUseSoldier(int victimIndex, HexLocation location);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void playCard() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void playMonumentCard() {\n\t\t\r\n\t}", "@Override\n\tpublic void playCard() {\n\t\t\n\t}", "@Override\r\n\tpublic void playSoldierCard() {\n\t\t\r\n\t}", "public void playCard(ActionCard card, Integer selectedPlayer)\n {\n System.out.println(\"gui: playCard: \" + card + \", selected: \" + selectedPlayer);\n // Guard against this\n if (!isTurn || this.played)\n {\n return;\n }\n \n if(card instanceof PrivateTip || card instanceof Snoop) \n {\n if(selectedPlayer == null) \n {\n JOptionPane.showMessageDialog(null, \"Please select \"\n + \"a player in the \"\n + \"Player Listing (Upper right) that is not yourself!\", \n \"Warning\", \n JOptionPane.ERROR_MESSAGE); \n return;\n }\n }\n\n if (card instanceof Suggestion)\n {\n this.played = true;\n // prompt for solution\n suggestionScreen = new AccusationScreen(this, true, (Suggestion)card);\n suggestionScreen.setVisible(true);\n }\n else\n {\n this.played = clientController.playActionCard(card, selectedPlayer);\n if(!this.played)\n {\n mainGameScreen.notifyUser(\"Play failed: To Play this card,\"\n + \" please select a CluePlayer from the 'Players' list,\"\n + \" then click on this card.\");\n }\n }\n\n }", "@Override\n\tpublic void onCouldNotPlayCardListener(int position) {\n\n\t}", "void playMonumentCard();", "void playCurrentStationCard();", "@Override\r\n\tpublic void showGetPrisonCardMessage(Player player) {\n\t\t\r\n\t}", "@Test(expected = DoesNotOwnException.class)\n\tpublic void cannotPlayDevCardTest() throws DoesNotOwnException, CannotPlayException\n\t{\n\t\tp.playDevelopmentCard(c, game.getBank());\n\t}", "public void playCard(int player, int card) {\n }", "@Override\r\n public void playGame() {\r\n printInvalidCommandMessage();\r\n }", "@Override\n\tpublic void cardInPlay() {\n\t\tIPlayer playedOn = this.game.getOtherPlayer();\n\t\tif(!playedOn.getFaction().equals(Faction.Cultist)){\n\t\t\tplayedOn.setFaction(Faction.UNAFFILIATED);\n\t\t}\n\t\tthis.setDiscard();\n\t}", "@Override\n\tpublic void onCardFail() {\n\t\tLoggerUtils.d(\"onCardFail Start!!!\");\n\t\tonFail();\n\t}", "private void startGame() {\n betOptionPane();\n this.computerPaquetView.setShowJustOneCard(true);\n blackjackController.startNewGame(this);\n }", "@Override\r\n\tpublic void playRoadBuildingCard() {\n\t\t\r\n\t}", "@Override\n\tpublic void onCardSucess() {\n\t\tLoggerUtils.d(\"onCardSucess Start!!!\");\n\t\tonSucess();\n\t}", "private void playThisCard(UnoCard clickedCard) throws NotYourTurnException, InvalidMoveException {\n\t\t// Check player's turn\n\t\tif (!isHisTurn(clickedCard)) {\n\t\t\tthrow new NotYourTurnException();\n\t\t} else {\n\n\t\t\t// Card validation\n\t\t\tif (isValidMove(clickedCard)) {\n\n\t\t\t\tplayedCards().add(clickedCard);\n\n\t\t\t\tremovePlayedCard(clickedCard);\n\n\t\t\t\t// function cards ??\n if (clickedCard instanceof ActionCard) {\n performAction(clickedCard);\n\n }\n\n\t\t\t\tfor (GameListener listener : gameListeners) {\n\t\t\t\t\tlistener.cardPlayed(clickedCard);\n\t\t\t\t}\n\n\t\t\t\tcheckResults();\n\t\t\t} else {\n\t\t\t\tthrow new InvalidMoveException();\n\n\t\t\t}\n\t\t}\n\t}", "public void play() {\r\n this.cardDeck = new JavaDeck();\r\n cardDeck.shuffle();\r\n dealerHand = new JavaHand(2);\r\n dealerHand.DiscardHand();\r\n addDealerCard();\r\n }", "@Override\n public void play(){\n \n // while neither player is dead\n while (continueGame()) {\n \n // both player and cpu draw a card and display the card\n player.play();\n System.out.printf(\"%s has drawn %s \\n\", player.getPlayerID(), \n player.getCard());\n cpu.play();\n System.out.printf(\"%s has drawn %s \\n\", cpu.getPlayerID(), \n cpu.getCard());\n \n // checks if the player wins the round\n if (winRound(player, cpu)) {\n // adds the cards to the gamedeck then the game deck to the\n // player deck\n winner(player, cpu, gameDeck);\n player.getWinningsPile().addCards(gameDeck.showCards().subList(0\n , gameDeck.getSize()));\n // empties the game deck\n gameDeck.showCards().clear();\n System.out.printf(\"%s wins round\\n\", player.getPlayerID());\n } else if (winRound(cpu, player)) { // if the cpu wins\n // adds the cards to the gamedeck then the game deck to the\n // cpu deck\n winner(cpu, player, gameDeck);\n cpu.getWinningsPile().addCards(gameDeck.showCards().subList(0, \n gameDeck.getSize()));\n // empties the game deck\n gameDeck.showCards().clear();\n System.out.println(\"CPU wins round\");\n } else {\n // if its a draw, check to see if either the cpu or player is\n // dying, if so, dont add the card to the gameDeck\n if (!(player.isDying())) {\n gameDeck.addCard(player.getCard());\n player.clearCard();\n }\n if (!(cpu.isDying())) {\n gameDeck.addCard(cpu.getCard());\n cpu.clearCard();\n }\n System.out.println(\"DRAW\");\n }\n // shows the current status of the game\n System.out.printf(\"%s's deck: %d winnings: %d \\n\", \n player.getPlayerID(), player.getDeck().getSize(), \n player.getWinningsPile().getSize());\n System.out.printf(\"CPU deck: %d winnings: %d \\n\", \n cpu.getDeck().getSize(), \n cpu.getWinningsPile().getSize());\n System.out.println(\"Press Enter to go to the next round\");\n in.nextLine();\n }\n //display the winner\n declareWinner();\n }", "private static void showPlayerDeckInfo() {\n }", "@Test\n\tpublic void playAndRemoveDevelopmentCardTest()\n\t\t\tthrows CannotAffordException, DoesNotOwnException, BankLimitException, CannotPlayException\n\t{\n\t\tassertTrue(p.getDevelopmentCards().size() == 0);\n\t\tp.grantResources(DevelopmentCardType.getCardCost(), game.getBank());\n\t\tDevelopmentCardType c = buyDevelopmentCard();\n\t\tassertTrue(p.getDevelopmentCards().get(c) == 1);\n\n\t\t// Reset recent dev card for player, so they can play this turn\n\t\tgame.getPlayer(game.getCurrentPlayer()).clearRecentDevCards();\n\n\t\t// Reset recent dev card for player, so they can play this turn\n\t\tgame.getPlayer(game.getCurrentPlayer()).clearRecentDevCards();\n\n\t\t// Play card and test it was removed\n\t\tDevelopmentCardType key = (DevelopmentCardType) p.getDevelopmentCards().keySet().toArray()[0];\n\t\tp.playDevelopmentCard(key, game.getBank());\n\n\t\tassertTrue(p.getDevelopmentCards().get(c) == 0);\n\t}", "public void playerTurn(Game game){\n int cardHandNum;\n boolean nextPlayer = false;\n String recentCardDesc;\n if(game.recentCardPlayed() && !(game.playerGetAnotherTurn(this))){\n if(game.getRecentCard() instanceof Mineral){\n recentCardDesc = \"\\nRecent card = Name: \" + game.getRecentCard().getCardName() + \" \" +\n \"Hardness: \" + ((Mineral) game.getRecentCard()).getCardHardness() + \" \" +\n \"Specific Gravity: \" + ((Mineral) game.getRecentCard()).getCardSpecGravity() + \" \" +\n \"Cleavage: \" + ((Mineral) game.getRecentCard()).getCardCleavage() + \" \" +\n \"Crystal Abundance: \" + ((Mineral) game.getRecentCard()).getCardCrystalAbundance() + \" \" +\n \"Economic Value: \" + ((Mineral) game.getRecentCard()).getCardEconomicValue() + \"\\n\"; // The recent card description of the Mineral card\n }\n else{\n recentCardDesc = \"\\nThe recent player play the \" + ((SuperTrumps) game.getRecentCard()).getCardName() + \" card\" + \"\\n\"; // The recent card description of the Supertrumps card\n }\n }\n else if(game.recentCardPlayed() && game.playerGetAnotherTurn(this)){\n System.out.println(\"You are granted to select the trump mode again\");\n recentCardDesc = \"\\nYou may pick the card again as you made all of other players pass\" + \"\\n\";\n gameStart(game); // Allowing the player that is not passed to pick up another trump category\n }\n else {\n recentCardDesc = \"\\nThere are no recent cards that have been played\" + \"\\n\";\n gameStart(game); // Description when there is no cards that is been played (when it is the start of the game)\n }\n while (!nextPlayer){\n // Used for looping until the person did the action (play the card or pass), which allows the next player to move\n String playerChoice;\n System.out.println(\"Game mode: \" + game.getGameModeMessage() + recentCardDesc + showCardInHand() + getPlayerName() + \", enter the card number you want to play or simply enter PASS to pass\");\n System.out.print(\">>>\");\n Scanner options = new Scanner(System.in);\n playerChoice = options.nextLine();\n if (playerChoice.toUpperCase().equals(\"PASS\")){\n drawPlayerCard(game.getCardDeck().drawnCard());\n nextPlayer = true;\n }\n else{\n try {\n cardHandNum = Integer.parseInt(playerChoice); // Changing the input into int from String\n Card cardPlayed = getPlayerCard(cardHandNum); // Used for trying to get the card played\n boolean continueGame = game.gameCard(cardPlayed, this); // Trying to play the card\n if(game.getGameMode().equals(\"CHOICE\")){ // Decision when a player play a special supertrump card to allow player to freely choose the trump mode\n game.putCardToGame(cardPlayed);\n playerHand.remove((cardHandNum));\n gameStart(game);\n game.setRecentPlayer(this.getPlayerName());\n nextPlayer = true;\n }\n else if (game.getGameMode().equals(\"GRAV/MAG\")) {\n if(lookAtWinCard()) { // Check whether or not the player has the winning card, which is Magnetite\n for (Card cardInHand : playerHand) {\n game.putCardToGame(cardInHand);\n playerHand.remove(cardInHand);\n game.setRecentPlayer(this.getPlayerName());\n }\n game.setGameMode(\"SPECGRAV\"); // Change the game mode to Specific Gravity\n nextPlayer = true;\n }\n else {\n game.setGameMode(\"SPECGRAV\"); // Change the game mode to Specific Gravity\n }\n if(continueGame){\n game.putCardToGame(cardPlayed);\n playerHand.remove((cardHandNum));\n game.setRecentPlayer(this.getPlayerName());\n nextPlayer = true;\n }\n }\n else {\n if(continueGame){\n // Used for the normal card play\n game.putCardToGame(cardPlayed);\n playerHand.remove((cardHandNum));\n game.setRecentPlayer(this.getPlayerName());\n nextPlayer = true;\n }\n }\n }\n catch (Throwable e){\n System.out.println(\"Invalid input!\"); // When the user try to enter the input that does not match the card in the hand\n }\n }\n }\n if (playerHand.size() == 0){\n // Occurs when the player has no more card in the hand\n game.setRecentPlayer(game.getPlayers().get((game.getPlayers().indexOf(this)+1)%game.getPlayers().size()).getPlayerName());\n playerLeft(game);\n }\n }", "@Override\r\n\tpublic void playGame() {\n\t\tSystem.out.println(\"SmartPhone具有玩游戏的功能\");\r\n\t}", "public void cantPlayGoNext() {\n\t switchTurn();\n }", "public void playTurn(){\r\n\t\t// all exceptions in this method are caught, because if this method throws an exception\r\n\t\t// the AIPlayer will not draw/discard a card and the program will freeze\r\n\t\ttry{\r\n\t\t\tupdateLastCardDiscarded();\r\n\t\t}catch(Exception e){\r\n\t\t\tSystem.out.println(\"AIPlayer, lastCard: \" + e.toString());\r\n\t\t}\r\n\t\ttry{\r\n\t\t\tif(!(drawOrPickUp()^bestChoice(BEST_CHOICE_AT_FIFTY))){ // choose whether to draw from the deck or pick up from the stack\r\n\t\t\t\tif(!game.getRound().drawFromDiscard()) // If picking up from the discard is not possible,\r\n\t\t\t\t\tgame.getRound().drawFromDeck(); // draw from the deck instead\r\n\t\t\t}else{\r\n\t\t\t\tgame.getRound().drawFromDeck();\r\n\t\t\t}\r\n\t\t}catch(Exception e){\r\n\t\t\tSystem.out.println(\"AIPlayer, draw: \" + e.toString());\r\n\t\t\tgame.getRound().drawFromDeck(); // if something goes wrong, draw\r\n\t\t}\r\n\r\n\t\ttry{\r\n\t\t\tgroup = new Groups(this, getHand());\r\n\t\t\tif(!hasLaidDownPhase() && group.getCompletePhaseGroups() != null && // if the AI player, hasn't laid down PhaseGroups\r\n\t\t\t\t\tgroup.getCompletePhaseGroups().length == Configuration.getNumberRequired(getPhase()) && // will lay down the right number of phasesGroups\r\n\t\t\t\t\tgetGame().getRound().getTurnNumber() >= 8 - (difficulty/10)) // is past a certain turn number based off difficulty\r\n\t\t\t\taddPhaseGroups(group.getCompletePhaseGroups()); \r\n\t\t}catch(Exception e){\r\n\t\t\tSystem.out.println(\"AIPlayer, laydown: \" + e.toString()); // laid down all my cards Hand92,AI90afterAI74\r\n\t\t}\r\n\r\n\t\ttry{\r\n\t\t\tif(hasLaidDownPhase())\r\n\t\t\t\tplayOffPhases();\r\n\t\t}catch(Exception e){\r\n\t\t\tSystem.out.println(\"AIPlayer, playoff: \" + e.toString());\r\n\t\t}\r\n\r\n\t\ttry{\r\n\t\t\tlastCardDiscarded = discardCard();\r\n\t\t\tgame.getRound().discard(lastCardDiscarded); // discard\r\n\t\t}catch(Phase10Exception e){\t\r\n\t\t}catch(Exception e){\r\n\t\t\tlastCardDiscarded = getHand().getCard(0);\r\n\t\t\tgame.getRound().discard(lastCardDiscarded);\r\n\t\t\tSystem.out.println(\"AIPlayer, discard: \" + e.toString());\r\n\t\t}\r\n\t}", "public PlayingCard(){\n\t\tsuper();\n\t}", "public void playGame()\r\n\t{\r\n\t\tSystem.out.println(\"Welcome to BlackJack! \\n\");\r\n\t\t\r\n\t\t// Boolean value to tell evaluateWin() method when the final win evaluation must be made\r\n\t\tboolean finalCheck = false;\r\n\t\t\r\n\t\tcardDeck.getDeck();\r\n\t\t\r\n\t\tSystem.out.println(\"Dealing cards...\");\r\n\t\t\r\n\t\t// Each player gets 2 cards to start\r\n\t\tplayer1.hit( cardDeck.draw() );\r\n\t\tplayer1.hit( cardDeck.draw() );\r\n\t\tdealer.hit( cardDeck.draw() );\r\n\t\tdealer.hit( cardDeck.draw() );\r\n\t\t\r\n\t\t// displays current cards\r\n\t\tdisplayPlayerCards(PLAYER1_ID);\r\n\t\tdisplayPlayerCards(DEALER_ID);\r\n\t\t\r\n\t\t// checks for win\r\n\t\tevaluateWin(finalCheck);\r\n\t\t\r\n\t\t// begins player1 turns\r\n\t\tplayerTurns();\r\n\t\t\r\n\t\t// begins dealer turns\r\n\t\tdealerTurns();\r\n\t\t\r\n\t\t// instructs evaluateWin to make final victory check\r\n\t\tfinalCheck = true;\r\n\t\tevaluateWin(finalCheck);\r\n\t\t\r\n\t\t// Cleans up objects\r\n\t\tcardDeck.newDeck();\r\n\t\tplayer1.resetHand();\r\n\t\tdealer.resetHand();\r\n\t}", "@Override\n public void onPreparing(EasyVideoPlayer player) {\n // TODO handle if needed\n }", "public void ActonCard() {\n\t}", "public void playDevelopmentCard(int turnNumber, DevCardType devCardType) throws Exception {\n\t\tif(canDoPlayDevelopmentCard(turnNumber, devCardType) == false) {\n\t\t\tthrow new Exception(\"Cannot play this card\");\n\t\t}\n\t\tdevelopmentCardHand.playDevelopmentCard(turnNumber, devCardType);\n\t}", "@Override\n public void beHelpful() {\n this.playPiano();\n this.takeABow();\n }", "public Card PlayCard() {\n\t Card ret = null;\n\t Card card;\n\t if (mCardCount > 0) {\n\t\t // To work out what card to play, see what cards can be played\n\t\t \tCard[] playableCards;\n\t\t \tplayableCards = mRules.GetPlayableCards();\n\t\t \tCard[] selectedCards;\n\t\t \tselectedCards = new Card[8];\n\t\t \tint iNumSelectableCards = 0;\n\t\t \tfor (int i = 0; i < 8; i++)\n\t\t \t\tselectedCards[i] = null;\n\t \tfor (int i = 0; i < mCardCount; i++){\n\t \t\tcard = mCard[i];\n\t \t\tswitch (card.GetSuit()){\n\t \t\tcase Card.HEARTS:\n\t \t\t\t\n\t \t\t\t// Card is a heart, can it be played?\n\t \t\t\t// Is it a seven, it can be played...\n\t \t\t\tif (card.GetValue() == 7){\n\t \t\t\t\tselectedCards[Rules.HEARTS8] = card;\n\t \t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t// and must be played first\n\t \t\t\t\tplayableCards[Rules.HEARTS8] = new Card(8,Card.HEARTS);\n\t \t\t\t\tplayableCards[Rules.HEARTS6] = new Card(6,Card.HEARTS);\n\t \t\t\t\tplayableCards[Rules.CLUBS8] = new Card(7,Card.CLUBS);\n\t \t\t\t\tplayableCards[Rules.DIAMONDS8] = new Card(7,Card.DIAMONDS);\n\t \t\t\t\tplayableCards[Rules.SPADES8] = new Card(7,Card.SPADES);\n\t \n\t \t\t\t\treturn card;\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() < 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.HEARTS6])){\n\t \t\t\t\t\tselectedCards[Rules.HEARTS6] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t\t//Log.i(\"\",\" Playing card \" + (card.GetValue()) + \" , \" +card.GetSuit());\n\t \t\t\t\t\t//Log.i(\"\",\" Updating playable card \" + (card.GetValue()-1) + \" , \" +Card.HEARTS);\t \t\t\t\t\t\n\t \t\t\t\t\t//playableCards[Rules.HEARTS6] = new Card(card.GetValue()-1,Card.HEARTS);\n\t \t\t\t\t\t//return card;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() > 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.HEARTS8])){\n\t \t\t\t\t\tselectedCards[Rules.HEARTS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t\t//Log.i(\"\",\" Playing card \" + (card.GetValue()) + \" , \" +card.GetSuit());\n\t \t\t\t\t\t//Log.i(\"\",\" Updating playable card \" + (card.GetValue()+1) + \" , \" +Card.HEARTS);\t \t\t\t\t\t\n\t \t\t\t\t\t//playableCards[Rules.HEARTS8] = new Card(card.GetValue()+1,Card.HEARTS);\n\t \t\t\t\t\t//return card;\n\t \t\t\t\t}\n\t \t\t\t}\t \t\t\t\n\t \t\t\t\n\t \t\t\tbreak;\n\t \t\tcase Card.DIAMONDS:\n\t \t\t\t// Is it a seven, it can be played...\n\t \t\t\tif (card.GetValue() == 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.DIAMONDS8])){\n\t \t\t\t\t\tselectedCards[Rules.DIAMONDS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\t\n\t \t\t\tif (card.GetValue() < 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.DIAMONDS6])){\n\t \t\t\t\t\tselectedCards[Rules.DIAMONDS6] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() > 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.DIAMONDS8])){\n\t \t\t\t\t\tselectedCards[Rules.DIAMONDS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\t\t \t\t\t\n\t \t\t\t\n\t \t\t\tbreak;\n\t \t\t\t\n\t \t\tcase Card.CLUBS:\n\t \t\t\t// Is it a seven, it can be played...\n\t \t\t\tif (card.GetValue() == 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS8])){\n\t \t\t\t\t\tselectedCards[Rules.CLUBS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\t \t\t\t\t\n\t \t\t\t}\n\t \t\t\t\n\t \t\t\tif (card.GetValue() < 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS6])){\n\t \t\t\t\t\tselectedCards[Rules.CLUBS6] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() > 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS8])){\n\t \t\t\t\t\tselectedCards[Rules.CLUBS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\t\t \t\t\t\n\t \t\t\tbreak;\n\t \t\t\t\n\t \t\tcase Card.SPADES:\n\t \t\t\t// Is it a seven, it can be played...\n\t \t\t\tif (card.GetValue() == 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.SPADES8])){\n\t \t\t\t\t\tselectedCards[Rules.SPADES8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\t \t\t\t\t\n\t \t\t\t}\n\t \t\t\t\n\t \t\t\tif (card.GetValue() < 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.SPADES6])){\n\t \t\t\t\t\tselectedCards[Rules.SPADES6] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() > 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.SPADES8])){\n\t \t\t\t\t\tselectedCards[Rules.SPADES8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\t \t\t\t\n\t \t\t\tbreak;\n\n\t \t\t\t\t \t\t\t\n\t \t\t}\n\t\n\t \t}\t\n\t \t\n\t \t// Now go through the selectable cards and see which is best to be played\n\t \tif (iNumSelectableCards == 0)\n\t \t\treturn ret;\n\t \t\n\t \tint iPos;\n\t \tcard = null;\n\t \tif (iNumSelectableCards == 1){\n\t\t\t \tfor (int i = 0; i < 8; i++)\n\t\t\t \t\tif (selectedCards[i] != null){\n\t\t\t \t\t\tcard = selectedCards[i];\n\t\t\t \t\t\tbreak;\n\t\t\t \t\t}\n\t\t\t \t\t\t \t\n\t \t}\n\t \telse {\n\t\t\t String sDifficulty = mRules.mView.GetSettings().getString(\"Difficulty\", \"0\");// 0 = hard, 1 = easy\n\t\t\t int iDifficulty = Integer.parseInt(sDifficulty);\n\t\t\t if (iDifficulty == EASY){\n\t\t\t \t// Get a random card from the playable ones\n\t\t\t\t\t Random generator = new Random();\n\t\t\t\t\t int randomIndex = generator.nextInt( iNumSelectableCards );\n\t\t\t\t\t int iCount = 0;\n\t\t\t\t\t \tfor (int i = 0; i < 8; i++){\n\t\t\t\t\t \t\tif (selectedCards[i] != null){\n\t\t\t\t\t \t\t\tif (iCount == randomIndex){\n\t\t\t\t\t \t\t\t\tcard = selectedCards[i];\n\t\t\t\t\t \t\t\t\tbreak;\n\t\t\t\t\t \t\t\t}\n\t\t\t\t\t \t\t\telse iCount++;\n\t\t\t\t\t \t\t}\t\n\t\t\t\t\t \t}\n\t\t\t }\n\t\t\t else {\n\t\t\t \tiPos = GetBestCard(selectedCards);\n\t\t\t \tcard = selectedCards[iPos];\n\t\t\t }\n\t \t}\n\t \t\n\t \tswitch (card.GetSuit()){\n \t\tcase Card.HEARTS:\t \t\n \t\t\tif (card.GetValue() == 7){\n \t\t\t\t// and must be played first\n \t\t\t\tplayableCards[Rules.HEARTS8] = new Card(8,Card.HEARTS);\n \t\t\t\tplayableCards[Rules.HEARTS6] = new Card(6,Card.HEARTS);\n \t\t\t\tplayableCards[Rules.CLUBS8] = new Card(7,Card.CLUBS);\n \t\t\t\tplayableCards[Rules.DIAMONDS8] = new Card(7,Card.DIAMONDS);\n \t\t\t\tplayableCards[Rules.SPADES8] = new Card(7,Card.SPADES);\n \n \t\t\t\treturn card;\n \t\t\t}\n \t\t\tif (card.GetValue() < 7){\n \t\t\t\tif (card.Equals(playableCards[Rules.HEARTS6])){\n \t\t\t\t\tplayableCards[Rules.HEARTS6] = new Card(card.GetValue()-1,Card.HEARTS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (card.GetValue() > 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.HEARTS8])){ \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.HEARTS8] = new Card(card.GetValue()+1,Card.HEARTS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\t \t\t\t\n \t\t\t\n \t\t\tbreak; \n \t\tcase Card.DIAMONDS:\n \t\t\t// Is it a seven, it can be played...\n \t\t\tif (card.GetValue() == 7){\n \t\t\t\tif (playableCards[Rules.HEARTS8] != null && playableCards[Rules.HEARTS8].GetValue() > 7){\n\t \t\t\t\tplayableCards[Rules.DIAMONDS8] = new Card(8,Card.DIAMONDS);\n\t \t\t\t\tplayableCards[Rules.DIAMONDS6] = new Card(6,Card.DIAMONDS);\t \t\t\t\t\t\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\tif (card.GetValue() < 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.DIAMONDS6])){\t \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.DIAMONDS6] = new Card(card.GetValue()-1,Card.DIAMONDS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (card.GetValue() > 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.DIAMONDS8])){\t \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.DIAMONDS8] = new Card(card.GetValue()+1,Card.DIAMONDS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\t\t \t\t\t\n \t\t\t\n \t\t\tbreak; \n \t\t\t\n \t\tcase Card.CLUBS:\n \t\t\t// Is it a seven, it can be played...\n \t\t\tif (card.GetValue() == 7){\n\n \t\t\t\tif (playableCards[Rules.HEARTS8] != null && playableCards[Rules.HEARTS8].GetValue() > 7){\n\t \t\t\t\tplayableCards[Rules.CLUBS8] = new Card(8,Card.CLUBS);\n\t \t\t\t\tplayableCards[Rules.CLUBS6] = new Card(6,Card.CLUBS);\t \t\t\t\t\t\n \t\t\t\t\treturn card;\n \t\t\t\t}\t \t\t\t\t\n \t\t\t}\n \t\t\t\n \t\t\tif (card.GetValue() < 7){\n \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS6])){\n \t\t\t\t\tplayableCards[Rules.CLUBS6] = new Card(card.GetValue()-1,Card.CLUBS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (card.GetValue() > 7){\n \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS8])){\n \t\t\t\t\tLog.i(\"\",\" Updating playable card \" + (card.GetValue()+1) + \" , \" +Card.CLUBS);\n \t\t\t\t\tplayableCards[Rules.CLUBS8] = new Card(card.GetValue()+1,Card.CLUBS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\t\t \t\t\t\n \t\t\tbreak; \n \t\tcase Card.SPADES:\n \t\t\t// Is it a seven, it can be played...\n \t\t\tif (card.GetValue() == 7){\n \t\t\t\tif (playableCards[Rules.HEARTS8] != null && playableCards[Rules.HEARTS8].GetValue() > 7){\n\t \t\t\t\tplayableCards[Rules.SPADES8] = new Card(8,Card.SPADES);\n\t \t\t\t\tplayableCards[Rules.SPADES6] = new Card(6,Card.SPADES);\t \t\t\t\t\t\n \t\t\t\t\treturn card;\n \t\t\t\t}\t \t\t\t\t\n \t\t\t}\n \t\t\t\n \t\t\tif (card.GetValue() < 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.SPADES6])){ \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.SPADES6] = new Card(card.GetValue()-1,Card.SPADES);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (card.GetValue() > 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.SPADES8])){\t \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.SPADES8] = new Card(card.GetValue()+1,Card.SPADES);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\t \t\t\t\n \t\t\tbreak;\n \t\t\t\n\t \t}\n\t \n\t }\n\t return ret;\n }", "public void tryStand() {\n if(player.getHand().size() > 0){\n firstStand = true;\n dealerTurn(1);\n } else{\n errorFlag = true;\n userMessage = \"You must get your initial hand dealt before you can stand\";\n }\n\n\n }", "@Test\n public void CardRequirementError() {\n MSG_ACTION_ACTIVATE_LEADERCARD message = new MSG_ACTION_ACTIVATE_LEADERCARD(0);\n DevelopmentCard card1 = new DevelopmentCard(1, Color.GREEN, 0, null, null);\n p.getDevelopmentSlot().addCard(card1, 1);\n c.emptyQueue();\n assertFalse(am.activateLeaderCard(p, message));\n assertEquals(MessageType.MSG_ERROR, c.messages.get(0).getMessageType());\n assertEquals(1, c.messages.size());\n }", "private static void playBlackjack(Player player) {\n\t\t//Delete hands of previous games.\n\t\tplayer.getReady();\n\t\t\n\t\t//Create the dealer.\n\t\tDealer dealer = new Dealer();\n\t\t\n\t\t//Deal two cards to each player.\n\t\tplayer.addCard(deck.dealCard());\n\t\tplayer.addCard(deck.dealCard());\n\t\t\n\t\tdealer.addCard(deck.dealCard());\n\t\tdealer.addCard(deck.dealCard());\n\t\t\n\t\t//Check if anyone has Blackjack.\n\t\tif (dealer.hasBlackjack()) {\n\t\t\tconsole.println(\"Your hand:\" + player.getHand());\n\t\t\tconsole.println(\"Dealer hand:\" + dealer.getHand());\n\t\t\tconsole.println(\"\\n*******************\\n\" +\n\t\t\t\t\t\"Blackjack! You lose!!\" +\n\t\t\t\t\t\"\\n*******************\\n\");\n\t\t\tconsole.println(\"Press <Enter> to continue.\");\n\t\t\tplayer.pay();\n\t\t\treturn;\n\t\t}\n\t\tif (player.hasBlackjack()) {\n\t\t\tconsole.println(\"Dealer hand:\" + dealer.getHand());\n\t\t\tconsole.println(\"Your hand:\" + player.getHand());\n\t\t\tconsole.println(\"\\n*******************\\n\" +\n\t\t\t\t\t\"Blackjack! You lose!!\" +\n\t\t\t\t\t\"\\n*******************\\n\");\n\t\t\tconsole.println(\"Press <Enter> to continue.\");\n\t\t\tplayer.collect();\n\t\t\treturn;\n\t\t\t\n\t\t}\n\t\t\n\t\t//Now the real game begins. Player play first.\n\t\t//Must play all the hands until dealer's turn.\n\t\tboolean dealerTurn = false;\n\t\t\n\t\tconsole.println(String.format(\"\\n\\nDealer first card: %s\", dealer.getFirstCard()));\n\t\t\n\t\twhile (!dealerTurn) { //Player keep playing as long as she can/wants\n\t\t\t\n\t\t\t//Player can have multiple hands (after split). Should play all of them independently.\n\t\t\tOptional<Hand> optionalPlayingHand = player.getNextPlayableHand();\n\t\t\t\n\t\t\tif (optionalPlayingHand.isPresent()) {\n\t\t\t\t\n\t\t\t\tplayer.setCurrentHand(optionalPlayingHand.get());\n\t\t\t\t\n\t\t\t\tconsole.println(\"Your playing hand:\" + player.getHand());\n\t\t\t\tconsole.print(\"Please, select an option: \");\n\t\t\t\tconsole.println(\"(1) Hit (2) Stand (3) Double Down (4) Split (5) Surrender\");\n\t\t\t\tint option = scanner.nextInt();\n\t\t\t\t\n\t\t\t\tswitch (UserAction.valueOf(option)) {\n\t\t\t\t\tcase HIT:\n\t\t\t\t\t\tconsole.println(\"You've chosen: HIT\");\n\t\t\t\t\t\tplayer.hit(deck.dealCard());\n\t\t\t\t\t\tconsole.println(\"Your resulting hand:\" + player.getHand());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase STAND:\n\t\t\t\t\t\tconsole.println(\"You've chosen: STAND\");\n\t\t\t\t\t\tplayer.stand();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase SPLIT:\n\t\t\t\t\t\tconsole.println(\"You've chosen: SPLIT\");\n\t\t\t\t\t\tif (player.split(deck.dealCard(), deck.dealCard())) {\n\t\t\t\t\t\t\tconsole.println(\"Your hand has been split\");\n\t\t\t\t\t\t\tconsole.println(\"Your resulting hand:\" + player.getHand());\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconsole.println(\"Your hand can not be split. Try another option\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DOUBLE_DOWN:\n\t\t\t\t\t\tconsole.println(\"You've chosen: DOUBLE DOWN\");\n\t\t\t\t\t\tplayer.doubleDown(deck.dealCard());\n\t\t\t\t\t\tconsole.println(\"Your resulting hand:\" + player.getHand());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase SURRENDER:\n\t\t\t\t\t\tconsole.println(\"You've chosen: SURRENDER\");\n\t\t\t\t\t\tif (player.surrender()) {\n\t\t\t\t\t\t\tconsole.println(\"Lose half of your bet.\");\n\t\t\t\t\t\t\tconsole.println(\"Dealer hand:\" + dealer.getHand());\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconsole.println(\"You cannot surrender. Try another option\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tdealerTurn = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//All player's hands are standing or busted\n\t\tfor (Hand hand : player.getHands()) {\n\t\t\tconsole.println(\"Your hand: \" + hand + \" Status: \" + hand.getStatus());\n\t\t}\n\t\t\n\t\tconsole.println(\"\\nDealer hand:\" + dealer.getHand());\n\t\t\n\t\tif (player.isBusted()) {\n\t\t\tconsole.println(\"\\n************\\n\" +\n\t\t\t\t\t\"You lose!!\" +\n\t\t\t\t\t\"\\n************\\n\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tconsole.println(\"\\nDealer turn.\\n\");\n\t\t//Dealer's turn.\n\t\twhile (dealerTurn) {\n\t\t\tUserAction dealerAction = dealer.getNextAction();\n\t\t\tswitch (dealerAction) {\n\t\t\t\tcase HIT:\n\t\t\t\t\tconsole.println(\"Dealer HIT\");\n\t\t\t\t\tdealer.hit(deck.dealCard());\n\t\t\t\t\tconsole.println(\"Dealer resulting hand:\" + dealer.getHand());\n\t\t\t\t\tbreak;\n\t\t\t\tcase STAND:\n\t\t\t\t\tconsole.println(\"Dealer STAND\");\n\t\t\t\t\tdealer.stand();\n\t\t\t\t\tdealerTurn = false;\n\t\t\t\t\tbreak;\n\t\t\t\tcase DONE:\n\t\t\t\t\tdealerTurn = false;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tconsole.println(\"Dealer hand:\" + dealer.getHand());\n\t\tif (dealer.isBusted()) {\n\t\t\t//Dealer is busted. Player wins!\n\t\t\tconsole.println(\"\\n************\\n\" +\n\t\t\t\t\t\"You win!!\" +\n\t\t\t\t\t\"\\n************\\n\");\n\t\t\tplayer.collect();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//Check if dealer won\n\t\tif (dealer.hasBlackjack()) {\n\t\t\tconsole.println(\"\\n******************************************************\\n\" +\n\t\t\t\t\t\"There is a tie!. Dealer wins. Its a casino after all\" +\n\t\t\t\t\t\"\\n******************************************************\\n\");\n\t\t\tplayer.pay();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tconsole.println(\"\\n*****************************************************************\\n\");\n\t\tfor (Hand hand : player.getNonBustedHands()) {\n\t\t\tif (hand.getValue() > dealer.getValue()) {\n\t\t\t\t//Player has a better hand. Hand wins.\n\t\t\t\tconsole.println(\"You have a winner hand :\" + hand);\n\t\t\t\tplayer.collect(hand);\n\t\t\t} else {\n\t\t\t\t//Player's hand lose\n\t\t\t\tconsole.println(\"You have a losing hand :\" + hand);\n\t\t\t\tif (hand.getValue() == dealer.getValue()) {\n\t\t\t\t\tconsole.println(\"Remember: in a tie, you lose!\");\n\t\t\t\t}\n\t\t\t\tplayer.pay(hand);\n\t\t\t}\n\t\t}\n\t\tconsole.println(\"\\n*****************************************************************\\n\");\n\t}", "private void resume() { player.resume();}", "public abstract CardAction play(Player p);", "void askDevCardProduction();", "void playMonopolyCard(String resource);", "protected final void hit() throws InsufficientCardsException {\n hand.add(deck.deal());\n update();\n }", "public void playerLost()\r\n {\r\n \r\n }", "public static void handleDream(Player player) {\n\t\t\n\t}", "public void failedMultiPlayer() {\r\n\t\tmultiplayer.setEnabled(true);\r\n\t\tToast.makeText(this, R.string.con_err, Toast.LENGTH_LONG)\r\n\t\t .show();\r\n\t}", "public void startGame() {\n this.deck = new Deck();\n this.deck.shuffle(); //shuffle the deck\n Card card = this.deck.deal(this.getPlayerHand());\n card = this.deck.deal(this.getPlayerHand());\n card = this.deck.deal(this.getDealerHand());\n }", "public void onPlayStart(){\n\n\t}", "public static void hitCorrect()\n\t{\n\t\tplayersCards.add(deck.deal());\n\t\tcurrentValue();\n\t\tuserCardImg[playersCards.size()-1].setIcon(new ImageIcon(Gameplay.class.getResource(getCard(playersCards.get(playersCards.size()-1)))));\n\t\tresume();\n\t\tif(calculateHand(playersCards)>21 || playersCards.size()==4 || calculateHand(playersCards)==0)\n\t\t{\n\t\t\troundEnd();\n\t\t}\n\t\t\n\t}", "void playerUsedCard(Card c, boolean discard) {\n\t\t// The creator data is in the 2 first bytes, the other player in the 2\n\t\t// last bytes.\n\t\tplayedCard[0] = (discard ? DISCARDED_CARD : PLAYED_CARD);\n\t\tplayedCard[1] = (byte) c.id;\n\t}", "public void catchCard(){\r\n changePlace(deck);\r\n changePlace(hand);\r\n }", "public void wrong()\n\t{\n\t\tMediaPlayer wrong = MediaPlayer.create(this, R.raw.wrong);\n\t\twrong.start();\n\t}", "public void nextStepInGame(View view){\n // called by click on either card, so need to track state\n Log.d(getClass().toString(),\"playstate before = \" + playstate.toString());\n\n playstate = playstate.getNext();\n Log.d(getClass().toString(),\"playstate after update = \" + playstate.toString());\n ImageButton computerCard = (ImageButton) findViewById(R.id.computerCard);\n ImageButton youCard = (ImageButton) findViewById(R.id.youCard);\n TextView infoPanel = (TextView) findViewById(R.id.info_panel);\n switch (playstate){\n case NOCARDS: {\n // show empty buttons as no cards on table\n computerCard.setImageResource(R.color.holo_green_dark);\n computerCard.setVisibility(View.VISIBLE);\n youCard.setImageResource(R.color.holo_blue_dark);\n youCard.setVisibility(View.VISIBLE);\n infoPanel.setText(\"Click to deal cards to both players\");\n\n break;\n }\n case DEALCARDS: {\n // show backs of cards ready to play them\n computerCard.setImageResource(R.drawable.card_back);\n computerCard.setVisibility(View.VISIBLE);\n youCard.setImageResource(R.drawable.card_back);\n youCard.setVisibility(View.VISIBLE);\n infoPanel.setText(\"Click to reveal cards\");\n break;\n }\n case SHOWCARDS: {\n // playARound, but only show card faces\n game.playARound();\n String cardToShow = this.game.getTurnlog().lastEntryFor(game.getPlayers()[1]).getHand().topShownCard().toDrawableName();\n computerCard.setImageResource(getResources().getIdentifier(cardToShow, \"drawable\", \"com.codeclan.cardgame\"));\n cardToShow = this.game.getTurnlog().lastEntryFor(game.getPlayers()[0]).getHand().topShownCard().toDrawableName();\n youCard.setImageResource(getResources().getIdentifier(cardToShow, \"drawable\", \"com.codeclan.cardgame\"));\n\n infoPanel.setText(getString(R.string.computer_label) + \" has \" +\n game.getPlayers()[1].getScore().toString() + \" points,\\n\" +\n getString(R.string.player_label) + \" has \" +\n game.getPlayers()[0].getScore().toString() + \" points.\\n Click for clear table\") ;\n\n break;\n }\n\n }\n if( game.isOver() ){\n//\n// break out of onClick loop by going to new activity to display results\n//\n Intent resultsIntent = new Intent(this, G2P1CHWResultsActivity.class);\n resultsIntent.putExtra(\"player1score\", game.getPlayers()[0].getScore());\n resultsIntent.putExtra(\"dealerscore\", game.getPlayers()[1].getScore());\n resultsIntent.putExtra(\"winner\", game.winner().getName());\n\n startActivity(resultsIntent);\n }\n\n }", "public void currentPlayerDrawCard() {\n Player currentPlayer = turnManager.currentPlayer();\n UnoCard newCard = getNextCard();\n currentPlayer.obtainCard(newCard);\n\n for (GameListener gameListener : gameListeners) {\n gameListener.cardDrawn();\n }\n\t}", "void askLeaderCardThrowing();", "@Override\r\n\t\t\tpublic void playGame() {\n\t\t\t\tSystem.out.println(\"隐式调用接口\");\r\n\t\t\t}", "private void BlueEatsPlayer(Player player)\n {\n Player player_to_be_eaten = null;\n try\n {\n BluePlayer player_to_eat = (BluePlayer) player;\n player_to_be_eaten = checkIfEatsRedPlayer(player_to_eat);\n if (player_to_be_eaten == null)\n {\n player_to_be_eaten = checkIfEatsGreenPlayer(player_to_eat);\n if (player_to_be_eaten == null)\n {\n player_to_be_eaten = checkIfEatsYellowPlayer(player_to_eat);\n }\n }\n //player_to_be_eaten.println(\"blue_player_to_be_eaten\" + player_to_be_eaten.toString());\n if (player_to_be_eaten != null)\n {\n playPersonEatenMusic();\n returnPlayerHome(player_to_be_eaten);\n }\n }\n catch (Exception e)\n {\n \n }\n return;\n }", "@Override\n\tpublic void play() {\n\t\t\n\t}", "private void reportPlay (Player player) {\n System.out.println(\"Player \" + player.name() +\n \" takes \" + player.numberTaken() +\n \" stick(s), leaving \" + game.sticksLeft()\n + \".\");\n }", "public void SpecialCardAction(UNOCard aCard) {\n\t\t\n\t\tif (aCard.getName() == \"Reverse\") { // Reverse card is played, so game direction is switched\n\t\t\tif (gameDirection == \"right\") {\n\t\t\t\tgameDirection = \"left\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\tgameDirection = \"right\";\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (aCard.getName() == \"Skip\") {\n\t\t\tif (gameDirection == \"right\") { // If Game is moving in one direction\n\t\t\t\tcurrentPlayerToPlayIndex = currentPlayerToPlayIndex + 2; // player next to play is skipped\n\t\t\t\tif (currentPlayerToPlayIndex >= players.size()) {\n\t\t\t\t\tcurrentPlayerToPlayIndex = currentPlayerToPlayIndex - players.size();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (gameDirection == \"left\") { // If Game is moving in other direction\n\t\t\t\tcurrentPlayerToPlayIndex = currentPlayerToPlayIndex - 2; // player next to play is skipped\n\t\t\t\tif (currentPlayerToPlayIndex <= 0) {\n\t\t\t\t\tcurrentPlayerToPlayIndex = currentPlayerToPlayIndex + players.size();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tcurrentPlayerToPlay = players.get(currentPlayerToPlayIndex); // Next Player to play a card\n\t\t\n\t\tif (aCard.getName() == \"Draw Two\") { // If a Draw Two Card is played, the enxt player to play is dealt two cards\n\t\t\tif (gameDirection == \"right\") {\n\t\t\t\tif (currentPlayerToPlayIndex < players.size()) {\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (gameDirection == \"left\") {\n\t\t\t\tif (currentPlayerToPlayIndex != 0) {\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (aCard.getName() == \"Wild\") { // Wild is played, function called to ask user for new color\n\t\t\tWildIsPlayedAskUserForColor();\n\t\t}\n\t\t\n\t\tif (aCard.getName() == \"Wild Draw Four\") {\n\t\t\tif (gameDirection == \"right\") { // if game direction is this way\n\t\t\t\tif (currentPlayerToPlayIndex < players.size()) {\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard()); // draw four cards\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard()); // draw four cards\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (gameDirection == \"left\") { // if game direction is this way\n\t\t\t\tif (currentPlayerToPlayIndex != 0) {\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard()); // draw four cards\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard()); // draw four cards\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t}\n\t\t\tWildIsPlayedAskUserForColor();\n\t\t}\n\t\t\n\t}", "public void play() {\n\t\t\r\n\t}", "@Override\n protected void receiveInfo(GameInfo info) {\n if (!(info instanceof PalaceGameState)) {\n return;\n }\n PalaceGameState state = new PalaceGameState((PalaceGameState) info);\n PalaceSelectCardAction selectCardAction;\n if (state.getTurn() != this.playerNum) {\n return;\n } else {\n sleep(1000); // make the computer \"think\"\n boolean isBigger = false;// variable to check if they have a valid card\n\n //determines if the cards are valid\n if (!(state.getP2Hand().isEmpty()) && !state.getPlayPilePalaceCards().isEmpty()) {\n for (int i = 0; i < state.getP2Hand().size(); i++) {\n if (state.getP2Hand().get(i).getRank() > state.getPlayPilePalaceCards().\n get(state.getPlayPilePalaceCards().size() - 1).getRank()) {\n isBigger = true;\n }\n }\n }\n\n //takes pile if they have no hand cards to play\n if (isBigger == false && !(state.getP2Hand().isEmpty())) {\n PalaceTakePileAction take = new PalaceTakePileAction(this);\n Log.d(\"compPlayer\", \"took the pile\");\n this.game.sendAction(take);\n }\n\n //begins searching for a card to select\n PalaceCard cardToSelect = null;\n\n // check in the case when the play pile and their hand are both not empty\n if (!(state.getPlayPilePalaceCards().isEmpty()) && (!(state.getP2Hand().isEmpty()))) {\n\n // while they haven't selected a card or the card they selected is less than the top card\n // another card is selected at random from their hand\n while (cardToSelect == null ||\n (cardToSelect.getRank() <\n (state.getPlayPilePalaceCards().\n get(state.getPlayPilePalaceCards().size() - 1).getRank()) &&\n state.getPlayPilePalaceCards().\n get(state.getPlayPilePalaceCards().size() - 1).getRank() >=0)) {\n cardToSelect =\n state.getP2Hand().get((int) (Math.random() * state.getP2Hand().size()));\n }\n\n // selects a card when they are playing from their top cards\n } else if (state.getP2Hand().isEmpty() && (!(state.getP2TopPalaceCards().isEmpty()))) {\n\n //pick any random card if the play pile is empty\n if (state.getPlayPilePalaceCards().isEmpty()) {\n cardToSelect =\n state.getP2TopPalaceCards().\n get((int) (Math.random() * state.getP2TopPalaceCards().size()));\n }\n\n //play pile is not empty so find a valid card\n else {\n\n //checks to see if there is a valid card\n for (int i = 0; i < state.getP2TopPalaceCards().size(); i++) {\n if (state.getP2TopPalaceCards().get(i).getRank() >\n state.getPlayPilePalaceCards().\n get(state.getPlayPilePalaceCards().size() - 1).getRank() &&\n state.getPlayPilePalaceCards().\n get(state.getPlayPilePalaceCards().size() - 1).getRank() >= 0) {\n isBigger = true;\n }\n }\n\n //finds a random valid card because there is one that is valid\n if (isBigger) {\n while (cardToSelect == null ||\n (cardToSelect.getRank() <\n state.getPlayPilePalaceCards().\n get(state.getPlayPilePalaceCards().size() - 1).\n getRank() &&\n state.getPlayPilePalaceCards().\n get(state.getPlayPilePalaceCards().size() - 1).\n getRank() >= 0)) {\n cardToSelect =\n state.getP2TopPalaceCards().\n get((int) (Math.random() * state.\n getP2TopPalaceCards().size()));\n }\n }\n\n //no card to be played so take the pile\n else {\n PalaceTakePileAction take = new PalaceTakePileAction(this);\n Log.d(\"compPlayer\", \"took the pile\");\n this.game.sendAction(take);\n }\n }\n }\n\n //they only have bottom cards left, all are valid to be played so pick a random one\n else if (state.getP2TopPalaceCards().isEmpty()&&state.getP2Hand().isEmpty()) {\n cardToSelect =\n state.getP2BottomPalaceCards().\n get((int) (Math.random() * state.getP2BottomPalaceCards().size()));\n }\n\n //the play pile is empty and they only have hand cards, pick one at random\n else {\n cardToSelect =\n state.getP2Hand().get((int) (Math.random() * state.getP2Hand().size()));\n }\n\n //create and send the select card action with the selected card\n selectCardAction = new PalaceSelectCardAction(this, cardToSelect,\n state.getSelectedPalaceCards());\n this.game.sendAction(selectCardAction);\n\n //rerun selectCardAction if there are multiple of the same card\n if (!state.getP2Hand().isEmpty()) {\n for (int i = 0; i < state.getP2Hand().size(); i++) {\n if (state.getP2Hand().get(i).getRank() == cardToSelect.getRank() &&\n !cardToSelect.equals(state.getP2Hand().get(i))) {\n selectCardAction = new PalaceSelectCardAction(this, state.getP2Hand().get(i),\n state.getSelectedPalaceCards());\n this.game.sendAction(selectCardAction);\n }\n }\n }\n else if (state.getP2Hand().isEmpty() && !state.getP2TopPalaceCards().isEmpty()) {\n for (int i = 0; i < state.getP2Hand().size(); i++) {\n if (state.getP2Hand().get(i).getRank() == cardToSelect.getRank() &&\n !cardToSelect.equals(state.getP2TopPalaceCards().get(i))) {\n selectCardAction = new PalaceSelectCardAction(this, state.getP2TopPalaceCards().get(i),\n state.getSelectedPalaceCards());\n this.game.sendAction(selectCardAction);\n }\n }\n }\n\n //creates and sends the playCardAction\n PalacePlayCardAction playCardAction = new PalacePlayCardAction(this);\n this.game.sendAction(playCardAction);\n }\n\n\n }", "void makePlay(int player) {\n }", "public void playerWon()\r\n {\r\n \r\n }", "public void playCard(IPlayer owner){\n // Wont play card unless a player has it\n if(command == \"Move1\"){\n owner.Move(owner.getPlayerDir());\n }\n else if(command == \"Move2\"){\n for (Integer i=0; i < 2; i++) {\n owner.Move(owner.getPlayerDir());\n }\n }\n else if(command == \"Move3\"){\n for (Integer i=0; i < 3; i++) {\n owner.Move(owner.getPlayerDir());\n }\n }\n else if (command == \"MoveBack\"){\n owner.Move(dirCtrl.invertDirection(owner.getPlayerDir()));\n }\n else if(command == \"TurnRight\"){\n owner.Turn(TurnDirection.RIGHT);\n }\n else if(command == \"TurnLeft\"){\n owner.Turn(TurnDirection.LEFT);\n }\n else if(command == \"Turn180\"){\n owner.Turn(TurnDirection.BACKWARDS);\n }\n }", "public Card playCard()\n {\n\n Card errorReturn = new Card('E', Card.Suit.spades); // in rare cases\n\n if (numCards == 0)\n return errorReturn;\n else\n return myCards[--numCards];\n }", "@Override\n\tpublic void play() {\n\t\tSystem.out.println(\"We played Snokker today\");\n\t\t\n\t\t\n\t}", "@Override\n public void playStart() {\n }", "@Test(expected = IllegalArgumentException.class)\n public void startPlayTest4() {\n GenericStandardDeckGame g = new GenericStandardDeckGame();\n g.startPlay(0, g.getDeck());\n }", "void onStartGameRequested();", "public void playBlackjack() {\n\t\tString choice;\n\t\t\n\t\tSystem.out.println(\"Welcome to Blackjack! \\n\");\n\t\tSystem.out.println(\"Dealing hands \\n\");\n\t\tdeck.shuffle();\n\t\tplayer.setHand(deck.drawHand());\n\t\tdealer.setHand(deck.drawHand());\n\t\t\n\t\t\n\t\tif(checkForBlackjack(player) && checkForBlackjack(dealer)) {\n\t\t\tSystem.out.println(showHands());\n\t\t\tSystem.out.println(\"Both player's have blackjack! \\n\");\n\t\t}\n\t\telse if(checkForBlackjack(player)) {\n\t\t\tSystem.out.println(showHands());\n\t\t\tSystem.out.println(\"Player has blackjack! You win! \\n\");\n\t\t}\n\t\telse if(checkForBlackjack(dealer)) {\n\t\t\tSystem.out.println(showHands());\n\t\t\tSystem.out.println(\"Dealer has blackjack! Dealer wins! \\n\");\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(showInitinalHand());\n\t\t\twhile(player.getHandVal() < 21) {\n\t\t\t\tSystem.out.println(\"Player's turn. Pick to hit or stand \\n\");\n\t\t\t\tchoice = scanner.nextLine().toUpperCase();\n\t\t\t\tif(choice.equals(\"STAND\") || choice.equals(\"S\")) {\n\t\t\t\t\tSystem.out.println(\"Player stands \\n\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse if(choice.equals(\"HIT\")|| choice.equals(\"H\")) {\n\t\t\t\t\tSystem.out.println(\"Player hits \\n\");\n\t\t\t\t\tplayer.addCard(deck.drawCard());\n\t\t\t\t\tSystem.out.println(showInitinalHand());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.println(\"Invalid input \\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile(dealer.getHandVal() < 17) {\n\t\t\t\tSystem.out.println(\"Dealer hits \\n\");\n\t\t\t\tdealer.addCard(deck.drawCard());\n\t\t\t\tSystem.out.println(showHands());\n\t\t\t}\n\t\t\tSystem.out.println(showHands());\n\t\t}\n\t\tcheckWinner();\n\t\tif(result.equals(\"TIE\")) {\n\t\t\tSystem.out.println(\"The result is a tie! \\n\");\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"The winner is the \" + result + \"!\\n\");\n\t\t}\n\t}", "public boolean needPlayer() {\n\t\treturn false;\n\t}", "public void playGame() {\n show();\n while (gameStatus) {\n if (canPut(players.get((state.getTurn())))) {\n int choice = -1;\n while (gameStatus) {\n choice = controls.get(state.getTurn()).putCard(currentCard);\n if (validInput(players.get((state.getTurn())), choice)) {\n System.out.println(players.get(state.getTurn()).getCards().get(choice).toString());\n try{Thread.sleep(1000);}catch(InterruptedException ignored){}\n break;\n }\n }\n decide(players.get(state.getTurn()), players.get(state.getTurn()).getCards().get(choice));\n }\n try{Thread.sleep(500);}catch(InterruptedException ignored){}\n checkFinish();\n if (gameStatus) {\n state.nextTurn();\n show();\n }\n }\n }", "private void playNextPlayer() {\n \n PlayerId nextPlayer = state.nextPlayer();\n players.get(nextPlayer).setHelp(state, handsOfCards.get(nextPlayer), nextPlayer);\n Card c = players.get(nextPlayer).cardToPlay(state, handsOfCards.get(nextPlayer));\n state = state.withNewCardPlayed(c);\n \n handsOfCards.put(nextPlayer, handsOfCards.get(nextPlayer).remove(c));\n players.get(nextPlayer).updateHand(handsOfCards.get(nextPlayer));\n \n for (Map.Entry<PlayerId, Player> pId: players.entrySet()) {\n pId.getValue().updateTrick(state.trick());\n }\n players.get(nextPlayer).resetHelp();\n }", "@Test(expected = NotPlayingException.class)\n public void not_allow_picking_cards_if_not_playing(){\n\n Deck deck = new Deck();\n Game game = new Game(deck);\n\n game.join(\"susan\");\n\n game.pickCard(\"susan\");\n }", "public void hitCard() {\n if (this.state == GameState.ROUNDACTIVE) {\n Seat s = this.getSeat(seatPlaying);\n if (s.hasPlayer()) {\n Hand h = s.getPlayer().getHands().get(0);\n h.addCard(this.deck.dealCard());\n if (h.getIsBusted()) {\n this.activeHandStand();\n }\n }\n repaintAll();\n }\n }", "private void playTurn()\n {\n try\n {\n XMLHandler.saveGame(game, GAME_CLONE_PATH);\n }\n catch(IOException | JAXBException | SAXException ex)\n {\n // TODO... ConsoleUtils.message(\"An internal save error has occured, terminating current game\");\n gameEnded = true;\n return;\n }\n \n moveCycle();\n \n if (!game.validateGame()) \n {\n IllegalBoardPenalty();\n }\n \n String gameOverMessage = game.isGameOver();\n if (gameOverMessage != null) \n {\n //TODO: ConsoleUtils.message(gameOverMessage);\n gameEnded = true;\n }\n \n game.switchPlayer();\n }", "@Override\n\tpublic void play() {\n\n\t}", "private static void playGame() {\n CardDeck deck = new CardDeck();\n int dealer, player, hitOrStand = 1, score = 0;\n System.out.println(\"Goal: Beat the dealer without going over 21\");\n Scanner input = new Scanner(System.in);\n\n // Generate the dealer's card\n dealer = generateRandomNumber(16, 21); \n System.out.println(\"The Dealer scored: \" + dealer);\n System.out.println(\"\");\n \n\n // Keep playing while the player hasn't won or lost yet\n while (hitOrStand == 1 && score < 21 && score < dealer) {\n // Generate player's card\n player = generateRandomNumber(1, 10); \n System.out.println(\"Your card is worth \" + player);\n\n // Displays the picture of player's card\n String card = deck.drawCard(player);\n System.out.println(card);\n\n // Add player's card value to their score\n score = score + player;\n\n // Displays score and asks wether user wants to hit or stand\n if (score <= 21 && score < dealer) {\n System.out.println(\"Your score is \" + score);\n System.out.print(\"Another card? Hit=1 stand=0: \");\n hitOrStand = input.nextInt();\n System.out.println(\"\");\n }\n }\n \n // Display player won\n if (score > dealer && score <= 21 ) {\n System.out.println(\"You win!\");\n System.out.println(\"Your score is \" + score);\n System.out.println(\"The dealer score was \" + dealer);\n System.out.println(\"You were closer to 21 by \" + (score - dealer));\n\n // Display when player ties with dealer\n } else if (score == dealer) {\n System.out.println(\"Your score is \" + score);\n System.out.println(\"\");\n System.out.println(\"You tied!\");\n\n // Display if player lost\n } else if (score > 21) {\n System.out.println(\"Your score is \" + score);\n System.out.println(\"\");\n System.out.println(\"You lose!\");\n int over = score - 21;\n System.out.println(\"You were over 21 by \" + over);\n\n // Display if player lost\n } else {\n int difference;\n difference = dealer - score;\n System.out.println(\"Your score is \" + score);\n System.out.println(\"You lose!\");\n System.out.println(\"The dealer was closer to 21 than you by \" + difference);\n } \n }", "private void play() {\n\t\tParcel pc = Parcel.obtain();\n\t\tParcel pc_reply = Parcel.obtain();\n\t\ttry {\n\t\t\tSystem.out.println(\"DEBUG>>>pc\" + pc.toString());\n\t\t\tSystem.out.println(\"DEBUG>>>pc_replay\" + pc_reply.toString());\n\t\t\tib.transact(1, pc, pc_reply, 0);\n\t\t} catch (RemoteException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public Player switchPlayer(){\n Player player = getGame().getCurrentPlayer();\n\n List<Card> cards = new ArrayList<>();\n\n for(Card card: getGame().getCards()){\n if(card.rule.isValid(getGame().getDices())){\n cards.add(card);\n }\n }\n\n //get the best card\n if(!cards.isEmpty()){\n Card card = takeTheBestCard(cards);\n\n //add it to the player\n player.getCardsWon().add(card);\n getGame().getCards().remove(card);\n\n System.out.println(player.getName() + \" won \" + card.getExplaination());\n getGame().addAction(new Action(player.getName() + \" won \" + card.getExplaination()));\n }\n\n if(getGame().getCards().isEmpty()){\n game.setStatus(Game.GameStatus.COMPLETED);\n getGame().addAction(new Action(bestPlayer().getName() + \" WON THE GAME!!!\"));\n }\n //turn\n getGame().setCountOfTrialForPlayer(0);\n\n game.setIndexOfCurrentPlayer(game.getIndexOfCurrentPlayer()+1);\n\n if(game.getIndexOfCurrentPlayer() == getGame().getPlayers().size()){\n game.setIndexOfCurrentPlayer(0);\n }\n\n game.setCountOfTrialForPlayer(0);\n game.setDices(new ArrayList<>());\n\n return getGame().getCurrentPlayer();\n }", "public boolean playCard(Card card){\n boolean b = effectHandler.playCard( card , null);\n return b;\n }", "private void RedEatsPlayer(Player player)\n {\n Player player_to_be_eaten = null;\n try\n {\n RedPlayer player_to_eat = (RedPlayer) player;\n player_to_be_eaten = checkIfEatsBluePlayer(player_to_eat);\n if (player_to_be_eaten == null)\n {\n player_to_be_eaten = checkIfEatsGreenPlayer(player_to_eat);\n if (player_to_be_eaten == null)\n {\n player_to_be_eaten = checkIfEatsYellowPlayer(player_to_eat);\n }\n }\n\n //player_to_be_eaten.println(\"red_player_to_be_eaten\" + player_to_be_eaten.toString());\n if (player_to_be_eaten != null)\n {\n playPersonEatenMusic();\n returnPlayerHome(player_to_be_eaten);\n }\n }\n catch (Exception e)\n {\n \n }\n return;\n }", "@Override\n\tpublic void onStandDown(PlatformPlayer player) {\n\t\t\n\t}", "public void howToPlay() {\r\n // An item has been added to the ticket. Fire an event and let everyone know.\r\n System.out.println(\"Step 1: Have no life. \\nStep 2: Deal cards\\nStep 3: Cry yourself to sleep.\");\r\n }", "private void playGame() throws IOExceptionFromController {\n for (Player player : players) {\n if (player.getGodCard().hasAlwaysActiveModifier()) game.addModifier(player.getGodCard());\n }\n while (!game.hasWinner()) {\n if (!running.get()) return;\n Player currentPlayer = players.get(game.getActivePlayer());\n for (Card modifier : game.getActiveModifiers()) {\n if (!modifier.hasAlwaysActiveModifier() && modifier.getController().getPlayer().equals(currentPlayer))\n game.removeModifier(modifier);\n }\n\n broadcastGameInfo(\"turnStart\");\n String result = playerControllers.get(game.getActivePlayer()).playTurn();\n switch (result) {\n case \"next\":\n checkWorkers();\n game.nextPlayer();\n break;\n case \"outOfMoves\":\n case \"outOfBuilds\":\n case \"outOfWorkers\":\n eliminatePlayer(currentPlayer, result);\n game.nextPlayer();\n break;\n case \"winConditionAchieved\":\n case \"godConditionAchieved\":\n setWinner(currentPlayer, result);\n break;\n default:\n logError(\"invalid turn\");\n break;\n }\n }\n gameOver();\n }", "@Override\n\tpublic void nowPlaying() {\n\t}", "void askBuyDevCards();", "private void resume()\r\n {\r\n player.resume();\r\n }", "@Override\n public void keyPressed(KeyEvent e) {\n player.keyPressed(e); // tell player a key has been pressed\n if (e.getKeyCode() == KeyEvent.VK_X && player.invulnerableTime <= 0 && spellCards > 0){ // player cast spell card\n spellCards --;\n audioloader.play(\"spark\");\n player.invulnerableTime = 5.0 * FPS;\n }\n if (e.getKeyCode() == KeyEvent.VK_C){ // toggle hitbox\n if (player.invulnerableTime <= 0)\n player.invulnerableTime = 10000000;\n else\n player.invulnerableTime = 0;\n }\n if (e.getKeyCode() == KeyEvent.VK_ENTER && entityloader.frame >= levelEnd){ // advance to next level\n gameResult = 1;\n }\n if (e.getKeyCode() == KeyEvent.VK_A){ // add life\n lives++;\n }\n }", "@Override\n\tpublic void onRun(PlatformPlayer player) {\n\t\t\n\t}", "public void playTurn() {\r\n\r\n }", "public void play(){\n\t\t\n\t}", "@Override\r\n\tpublic boolean canPlay() {\n\t\treturn false;\r\n\t}", "@Override\n public void landedOn(Player player) {}", "void askLeaderCardActivation();", "public void startGame() {\n int numberOFPlayers = view.askForNumberOfPlayers();\n\n // adding dealer...\n players.add(dealer);\n //...and players to 'players' ArrayList\n for (int i = 1; i < numberOFPlayers; i++) {\n players.add(new RegularPlayer(i + 1));\n }\n\n // dealing cards to players\n dealer.dealCardsToPlayers(players);\n // Game\n while (!(players.size() == 1)) {\n\n for (int i = 0; i < players.size(); i++) {\n\n // printowanie ilości kart kazdego z graczy dla testów\n if (checkGameStatus()) {\n try {\n // display no of cards for each player\n for (Player player : players) {\n view.print(\"Player \" + player.getPlayerId() + \" no of cards: \" + player.getCardsCount());\n }\n\n round(players.get(i), players);\n } catch (IndexOutOfBoundsException e) {\n continue;\n }\n } else {\n break;\n }\n }\n }\n }", "public void preGame() {\n\n\t}", "public void playCard(int index) {\r\n\t\tCard c = deck.hand.get(index);\r\n\t\tif(c.isAction() && actions > 0 && access.gamePhase < 2) {\r\n\t\t\taccess.gamePhase = 1;\r\n\t\t\tif(!deck.play.contains(new Champion())) actions--;\r\n\t\t\tdeck.playCard(index);\r\n\t\t\tc.performAction();\r\n\t\t\tnotifyObservers();\r\n\t\t}\r\n\t\telse if(c.isTreasure() && access.gamePhase < 3) {\r\n\t\t\taccess.gamePhase = 1;\r\n\t\t\taddTreasure(c.getTreasure());\r\n\t\t\tdeck.playCard(index);\r\n\t\t\tc.performAction();\r\n\t\t\tnotifyObservers();\r\n\t\t}\r\n\t}", "@Override\n\t\tpublic void onLoaded(String arg0) {\n\t\t\t\tplayer.play();\n\t\t}", "public boolean mayPickup(Player debug1) {\n/* 112 */ return true;\n/* */ }", "public void handStarted(int position, GameState gs, Card[] cards) {\r\n }", "public void notifyPlayer(CardGraphics card){\n\t\tchosenCard = card.getCard();\n\t\t\n\t\tsynchronized(lock){\n\t\t\tlock.notify();\n\t\t}\n\t}" ]
[ "0.74089664", "0.7322171", "0.7310715", "0.7220169", "0.7067883", "0.7021363", "0.6930099", "0.6741363", "0.67259586", "0.6723835", "0.67106855", "0.66596425", "0.6587131", "0.65860456", "0.65746415", "0.6503048", "0.6490332", "0.6446939", "0.638743", "0.63460165", "0.63157016", "0.63078487", "0.62962294", "0.6295851", "0.62928003", "0.62730783", "0.62704134", "0.6234564", "0.6201527", "0.6184761", "0.6184431", "0.6166957", "0.6137935", "0.6132403", "0.6132374", "0.61317533", "0.6130833", "0.6127596", "0.6094086", "0.60852957", "0.6084549", "0.60814637", "0.6078053", "0.6074422", "0.60296017", "0.60220766", "0.6019693", "0.60146946", "0.60087174", "0.60075665", "0.5998809", "0.59909064", "0.59907824", "0.59866035", "0.5975789", "0.59754115", "0.5968073", "0.5964552", "0.59615064", "0.5954957", "0.59548455", "0.595386", "0.5950074", "0.5944899", "0.5940348", "0.59344107", "0.5933606", "0.59291136", "0.59287405", "0.59182805", "0.59145576", "0.59121776", "0.59115255", "0.5907762", "0.5907182", "0.59007764", "0.5897394", "0.5895403", "0.58942616", "0.5891908", "0.5884459", "0.58839303", "0.58786446", "0.5875877", "0.5874754", "0.5869633", "0.5868411", "0.5866101", "0.58647543", "0.58638513", "0.58628213", "0.58607733", "0.585822", "0.5850907", "0.5848047", "0.58371127", "0.5834973", "0.583492", "0.5834635", "0.5829707", "0.58280444" ]
0.0
-1
This method is called when a player tries to play a development card
boolean CanUseMonopoly(String resource);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void playCard() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void playMonumentCard() {\n\t\t\r\n\t}", "@Override\n\tpublic void playCard() {\n\t\t\n\t}", "@Override\r\n\tpublic void playSoldierCard() {\n\t\t\r\n\t}", "public void playCard(ActionCard card, Integer selectedPlayer)\n {\n System.out.println(\"gui: playCard: \" + card + \", selected: \" + selectedPlayer);\n // Guard against this\n if (!isTurn || this.played)\n {\n return;\n }\n \n if(card instanceof PrivateTip || card instanceof Snoop) \n {\n if(selectedPlayer == null) \n {\n JOptionPane.showMessageDialog(null, \"Please select \"\n + \"a player in the \"\n + \"Player Listing (Upper right) that is not yourself!\", \n \"Warning\", \n JOptionPane.ERROR_MESSAGE); \n return;\n }\n }\n\n if (card instanceof Suggestion)\n {\n this.played = true;\n // prompt for solution\n suggestionScreen = new AccusationScreen(this, true, (Suggestion)card);\n suggestionScreen.setVisible(true);\n }\n else\n {\n this.played = clientController.playActionCard(card, selectedPlayer);\n if(!this.played)\n {\n mainGameScreen.notifyUser(\"Play failed: To Play this card,\"\n + \" please select a CluePlayer from the 'Players' list,\"\n + \" then click on this card.\");\n }\n }\n\n }", "@Override\n\tpublic void onCouldNotPlayCardListener(int position) {\n\n\t}", "void playMonumentCard();", "void playCurrentStationCard();", "@Override\r\n\tpublic void showGetPrisonCardMessage(Player player) {\n\t\t\r\n\t}", "@Test(expected = DoesNotOwnException.class)\n\tpublic void cannotPlayDevCardTest() throws DoesNotOwnException, CannotPlayException\n\t{\n\t\tp.playDevelopmentCard(c, game.getBank());\n\t}", "public void playCard(int player, int card) {\n }", "@Override\r\n public void playGame() {\r\n printInvalidCommandMessage();\r\n }", "@Override\n\tpublic void cardInPlay() {\n\t\tIPlayer playedOn = this.game.getOtherPlayer();\n\t\tif(!playedOn.getFaction().equals(Faction.Cultist)){\n\t\t\tplayedOn.setFaction(Faction.UNAFFILIATED);\n\t\t}\n\t\tthis.setDiscard();\n\t}", "@Override\n\tpublic void onCardFail() {\n\t\tLoggerUtils.d(\"onCardFail Start!!!\");\n\t\tonFail();\n\t}", "private void startGame() {\n betOptionPane();\n this.computerPaquetView.setShowJustOneCard(true);\n blackjackController.startNewGame(this);\n }", "@Override\r\n\tpublic void playRoadBuildingCard() {\n\t\t\r\n\t}", "@Override\n\tpublic void onCardSucess() {\n\t\tLoggerUtils.d(\"onCardSucess Start!!!\");\n\t\tonSucess();\n\t}", "private void playThisCard(UnoCard clickedCard) throws NotYourTurnException, InvalidMoveException {\n\t\t// Check player's turn\n\t\tif (!isHisTurn(clickedCard)) {\n\t\t\tthrow new NotYourTurnException();\n\t\t} else {\n\n\t\t\t// Card validation\n\t\t\tif (isValidMove(clickedCard)) {\n\n\t\t\t\tplayedCards().add(clickedCard);\n\n\t\t\t\tremovePlayedCard(clickedCard);\n\n\t\t\t\t// function cards ??\n if (clickedCard instanceof ActionCard) {\n performAction(clickedCard);\n\n }\n\n\t\t\t\tfor (GameListener listener : gameListeners) {\n\t\t\t\t\tlistener.cardPlayed(clickedCard);\n\t\t\t\t}\n\n\t\t\t\tcheckResults();\n\t\t\t} else {\n\t\t\t\tthrow new InvalidMoveException();\n\n\t\t\t}\n\t\t}\n\t}", "public void play() {\r\n this.cardDeck = new JavaDeck();\r\n cardDeck.shuffle();\r\n dealerHand = new JavaHand(2);\r\n dealerHand.DiscardHand();\r\n addDealerCard();\r\n }", "@Override\n public void play(){\n \n // while neither player is dead\n while (continueGame()) {\n \n // both player and cpu draw a card and display the card\n player.play();\n System.out.printf(\"%s has drawn %s \\n\", player.getPlayerID(), \n player.getCard());\n cpu.play();\n System.out.printf(\"%s has drawn %s \\n\", cpu.getPlayerID(), \n cpu.getCard());\n \n // checks if the player wins the round\n if (winRound(player, cpu)) {\n // adds the cards to the gamedeck then the game deck to the\n // player deck\n winner(player, cpu, gameDeck);\n player.getWinningsPile().addCards(gameDeck.showCards().subList(0\n , gameDeck.getSize()));\n // empties the game deck\n gameDeck.showCards().clear();\n System.out.printf(\"%s wins round\\n\", player.getPlayerID());\n } else if (winRound(cpu, player)) { // if the cpu wins\n // adds the cards to the gamedeck then the game deck to the\n // cpu deck\n winner(cpu, player, gameDeck);\n cpu.getWinningsPile().addCards(gameDeck.showCards().subList(0, \n gameDeck.getSize()));\n // empties the game deck\n gameDeck.showCards().clear();\n System.out.println(\"CPU wins round\");\n } else {\n // if its a draw, check to see if either the cpu or player is\n // dying, if so, dont add the card to the gameDeck\n if (!(player.isDying())) {\n gameDeck.addCard(player.getCard());\n player.clearCard();\n }\n if (!(cpu.isDying())) {\n gameDeck.addCard(cpu.getCard());\n cpu.clearCard();\n }\n System.out.println(\"DRAW\");\n }\n // shows the current status of the game\n System.out.printf(\"%s's deck: %d winnings: %d \\n\", \n player.getPlayerID(), player.getDeck().getSize(), \n player.getWinningsPile().getSize());\n System.out.printf(\"CPU deck: %d winnings: %d \\n\", \n cpu.getDeck().getSize(), \n cpu.getWinningsPile().getSize());\n System.out.println(\"Press Enter to go to the next round\");\n in.nextLine();\n }\n //display the winner\n declareWinner();\n }", "private static void showPlayerDeckInfo() {\n }", "@Test\n\tpublic void playAndRemoveDevelopmentCardTest()\n\t\t\tthrows CannotAffordException, DoesNotOwnException, BankLimitException, CannotPlayException\n\t{\n\t\tassertTrue(p.getDevelopmentCards().size() == 0);\n\t\tp.grantResources(DevelopmentCardType.getCardCost(), game.getBank());\n\t\tDevelopmentCardType c = buyDevelopmentCard();\n\t\tassertTrue(p.getDevelopmentCards().get(c) == 1);\n\n\t\t// Reset recent dev card for player, so they can play this turn\n\t\tgame.getPlayer(game.getCurrentPlayer()).clearRecentDevCards();\n\n\t\t// Reset recent dev card for player, so they can play this turn\n\t\tgame.getPlayer(game.getCurrentPlayer()).clearRecentDevCards();\n\n\t\t// Play card and test it was removed\n\t\tDevelopmentCardType key = (DevelopmentCardType) p.getDevelopmentCards().keySet().toArray()[0];\n\t\tp.playDevelopmentCard(key, game.getBank());\n\n\t\tassertTrue(p.getDevelopmentCards().get(c) == 0);\n\t}", "@Override\r\n\tpublic void playGame() {\n\t\tSystem.out.println(\"SmartPhone具有玩游戏的功能\");\r\n\t}", "public void playerTurn(Game game){\n int cardHandNum;\n boolean nextPlayer = false;\n String recentCardDesc;\n if(game.recentCardPlayed() && !(game.playerGetAnotherTurn(this))){\n if(game.getRecentCard() instanceof Mineral){\n recentCardDesc = \"\\nRecent card = Name: \" + game.getRecentCard().getCardName() + \" \" +\n \"Hardness: \" + ((Mineral) game.getRecentCard()).getCardHardness() + \" \" +\n \"Specific Gravity: \" + ((Mineral) game.getRecentCard()).getCardSpecGravity() + \" \" +\n \"Cleavage: \" + ((Mineral) game.getRecentCard()).getCardCleavage() + \" \" +\n \"Crystal Abundance: \" + ((Mineral) game.getRecentCard()).getCardCrystalAbundance() + \" \" +\n \"Economic Value: \" + ((Mineral) game.getRecentCard()).getCardEconomicValue() + \"\\n\"; // The recent card description of the Mineral card\n }\n else{\n recentCardDesc = \"\\nThe recent player play the \" + ((SuperTrumps) game.getRecentCard()).getCardName() + \" card\" + \"\\n\"; // The recent card description of the Supertrumps card\n }\n }\n else if(game.recentCardPlayed() && game.playerGetAnotherTurn(this)){\n System.out.println(\"You are granted to select the trump mode again\");\n recentCardDesc = \"\\nYou may pick the card again as you made all of other players pass\" + \"\\n\";\n gameStart(game); // Allowing the player that is not passed to pick up another trump category\n }\n else {\n recentCardDesc = \"\\nThere are no recent cards that have been played\" + \"\\n\";\n gameStart(game); // Description when there is no cards that is been played (when it is the start of the game)\n }\n while (!nextPlayer){\n // Used for looping until the person did the action (play the card or pass), which allows the next player to move\n String playerChoice;\n System.out.println(\"Game mode: \" + game.getGameModeMessage() + recentCardDesc + showCardInHand() + getPlayerName() + \", enter the card number you want to play or simply enter PASS to pass\");\n System.out.print(\">>>\");\n Scanner options = new Scanner(System.in);\n playerChoice = options.nextLine();\n if (playerChoice.toUpperCase().equals(\"PASS\")){\n drawPlayerCard(game.getCardDeck().drawnCard());\n nextPlayer = true;\n }\n else{\n try {\n cardHandNum = Integer.parseInt(playerChoice); // Changing the input into int from String\n Card cardPlayed = getPlayerCard(cardHandNum); // Used for trying to get the card played\n boolean continueGame = game.gameCard(cardPlayed, this); // Trying to play the card\n if(game.getGameMode().equals(\"CHOICE\")){ // Decision when a player play a special supertrump card to allow player to freely choose the trump mode\n game.putCardToGame(cardPlayed);\n playerHand.remove((cardHandNum));\n gameStart(game);\n game.setRecentPlayer(this.getPlayerName());\n nextPlayer = true;\n }\n else if (game.getGameMode().equals(\"GRAV/MAG\")) {\n if(lookAtWinCard()) { // Check whether or not the player has the winning card, which is Magnetite\n for (Card cardInHand : playerHand) {\n game.putCardToGame(cardInHand);\n playerHand.remove(cardInHand);\n game.setRecentPlayer(this.getPlayerName());\n }\n game.setGameMode(\"SPECGRAV\"); // Change the game mode to Specific Gravity\n nextPlayer = true;\n }\n else {\n game.setGameMode(\"SPECGRAV\"); // Change the game mode to Specific Gravity\n }\n if(continueGame){\n game.putCardToGame(cardPlayed);\n playerHand.remove((cardHandNum));\n game.setRecentPlayer(this.getPlayerName());\n nextPlayer = true;\n }\n }\n else {\n if(continueGame){\n // Used for the normal card play\n game.putCardToGame(cardPlayed);\n playerHand.remove((cardHandNum));\n game.setRecentPlayer(this.getPlayerName());\n nextPlayer = true;\n }\n }\n }\n catch (Throwable e){\n System.out.println(\"Invalid input!\"); // When the user try to enter the input that does not match the card in the hand\n }\n }\n }\n if (playerHand.size() == 0){\n // Occurs when the player has no more card in the hand\n game.setRecentPlayer(game.getPlayers().get((game.getPlayers().indexOf(this)+1)%game.getPlayers().size()).getPlayerName());\n playerLeft(game);\n }\n }", "public void cantPlayGoNext() {\n\t switchTurn();\n }", "public void playTurn(){\r\n\t\t// all exceptions in this method are caught, because if this method throws an exception\r\n\t\t// the AIPlayer will not draw/discard a card and the program will freeze\r\n\t\ttry{\r\n\t\t\tupdateLastCardDiscarded();\r\n\t\t}catch(Exception e){\r\n\t\t\tSystem.out.println(\"AIPlayer, lastCard: \" + e.toString());\r\n\t\t}\r\n\t\ttry{\r\n\t\t\tif(!(drawOrPickUp()^bestChoice(BEST_CHOICE_AT_FIFTY))){ // choose whether to draw from the deck or pick up from the stack\r\n\t\t\t\tif(!game.getRound().drawFromDiscard()) // If picking up from the discard is not possible,\r\n\t\t\t\t\tgame.getRound().drawFromDeck(); // draw from the deck instead\r\n\t\t\t}else{\r\n\t\t\t\tgame.getRound().drawFromDeck();\r\n\t\t\t}\r\n\t\t}catch(Exception e){\r\n\t\t\tSystem.out.println(\"AIPlayer, draw: \" + e.toString());\r\n\t\t\tgame.getRound().drawFromDeck(); // if something goes wrong, draw\r\n\t\t}\r\n\r\n\t\ttry{\r\n\t\t\tgroup = new Groups(this, getHand());\r\n\t\t\tif(!hasLaidDownPhase() && group.getCompletePhaseGroups() != null && // if the AI player, hasn't laid down PhaseGroups\r\n\t\t\t\t\tgroup.getCompletePhaseGroups().length == Configuration.getNumberRequired(getPhase()) && // will lay down the right number of phasesGroups\r\n\t\t\t\t\tgetGame().getRound().getTurnNumber() >= 8 - (difficulty/10)) // is past a certain turn number based off difficulty\r\n\t\t\t\taddPhaseGroups(group.getCompletePhaseGroups()); \r\n\t\t}catch(Exception e){\r\n\t\t\tSystem.out.println(\"AIPlayer, laydown: \" + e.toString()); // laid down all my cards Hand92,AI90afterAI74\r\n\t\t}\r\n\r\n\t\ttry{\r\n\t\t\tif(hasLaidDownPhase())\r\n\t\t\t\tplayOffPhases();\r\n\t\t}catch(Exception e){\r\n\t\t\tSystem.out.println(\"AIPlayer, playoff: \" + e.toString());\r\n\t\t}\r\n\r\n\t\ttry{\r\n\t\t\tlastCardDiscarded = discardCard();\r\n\t\t\tgame.getRound().discard(lastCardDiscarded); // discard\r\n\t\t}catch(Phase10Exception e){\t\r\n\t\t}catch(Exception e){\r\n\t\t\tlastCardDiscarded = getHand().getCard(0);\r\n\t\t\tgame.getRound().discard(lastCardDiscarded);\r\n\t\t\tSystem.out.println(\"AIPlayer, discard: \" + e.toString());\r\n\t\t}\r\n\t}", "public PlayingCard(){\n\t\tsuper();\n\t}", "public void playGame()\r\n\t{\r\n\t\tSystem.out.println(\"Welcome to BlackJack! \\n\");\r\n\t\t\r\n\t\t// Boolean value to tell evaluateWin() method when the final win evaluation must be made\r\n\t\tboolean finalCheck = false;\r\n\t\t\r\n\t\tcardDeck.getDeck();\r\n\t\t\r\n\t\tSystem.out.println(\"Dealing cards...\");\r\n\t\t\r\n\t\t// Each player gets 2 cards to start\r\n\t\tplayer1.hit( cardDeck.draw() );\r\n\t\tplayer1.hit( cardDeck.draw() );\r\n\t\tdealer.hit( cardDeck.draw() );\r\n\t\tdealer.hit( cardDeck.draw() );\r\n\t\t\r\n\t\t// displays current cards\r\n\t\tdisplayPlayerCards(PLAYER1_ID);\r\n\t\tdisplayPlayerCards(DEALER_ID);\r\n\t\t\r\n\t\t// checks for win\r\n\t\tevaluateWin(finalCheck);\r\n\t\t\r\n\t\t// begins player1 turns\r\n\t\tplayerTurns();\r\n\t\t\r\n\t\t// begins dealer turns\r\n\t\tdealerTurns();\r\n\t\t\r\n\t\t// instructs evaluateWin to make final victory check\r\n\t\tfinalCheck = true;\r\n\t\tevaluateWin(finalCheck);\r\n\t\t\r\n\t\t// Cleans up objects\r\n\t\tcardDeck.newDeck();\r\n\t\tplayer1.resetHand();\r\n\t\tdealer.resetHand();\r\n\t}", "@Override\n public void onPreparing(EasyVideoPlayer player) {\n // TODO handle if needed\n }", "public void ActonCard() {\n\t}", "public void playDevelopmentCard(int turnNumber, DevCardType devCardType) throws Exception {\n\t\tif(canDoPlayDevelopmentCard(turnNumber, devCardType) == false) {\n\t\t\tthrow new Exception(\"Cannot play this card\");\n\t\t}\n\t\tdevelopmentCardHand.playDevelopmentCard(turnNumber, devCardType);\n\t}", "@Override\n public void beHelpful() {\n this.playPiano();\n this.takeABow();\n }", "public Card PlayCard() {\n\t Card ret = null;\n\t Card card;\n\t if (mCardCount > 0) {\n\t\t // To work out what card to play, see what cards can be played\n\t\t \tCard[] playableCards;\n\t\t \tplayableCards = mRules.GetPlayableCards();\n\t\t \tCard[] selectedCards;\n\t\t \tselectedCards = new Card[8];\n\t\t \tint iNumSelectableCards = 0;\n\t\t \tfor (int i = 0; i < 8; i++)\n\t\t \t\tselectedCards[i] = null;\n\t \tfor (int i = 0; i < mCardCount; i++){\n\t \t\tcard = mCard[i];\n\t \t\tswitch (card.GetSuit()){\n\t \t\tcase Card.HEARTS:\n\t \t\t\t\n\t \t\t\t// Card is a heart, can it be played?\n\t \t\t\t// Is it a seven, it can be played...\n\t \t\t\tif (card.GetValue() == 7){\n\t \t\t\t\tselectedCards[Rules.HEARTS8] = card;\n\t \t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t// and must be played first\n\t \t\t\t\tplayableCards[Rules.HEARTS8] = new Card(8,Card.HEARTS);\n\t \t\t\t\tplayableCards[Rules.HEARTS6] = new Card(6,Card.HEARTS);\n\t \t\t\t\tplayableCards[Rules.CLUBS8] = new Card(7,Card.CLUBS);\n\t \t\t\t\tplayableCards[Rules.DIAMONDS8] = new Card(7,Card.DIAMONDS);\n\t \t\t\t\tplayableCards[Rules.SPADES8] = new Card(7,Card.SPADES);\n\t \n\t \t\t\t\treturn card;\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() < 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.HEARTS6])){\n\t \t\t\t\t\tselectedCards[Rules.HEARTS6] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t\t//Log.i(\"\",\" Playing card \" + (card.GetValue()) + \" , \" +card.GetSuit());\n\t \t\t\t\t\t//Log.i(\"\",\" Updating playable card \" + (card.GetValue()-1) + \" , \" +Card.HEARTS);\t \t\t\t\t\t\n\t \t\t\t\t\t//playableCards[Rules.HEARTS6] = new Card(card.GetValue()-1,Card.HEARTS);\n\t \t\t\t\t\t//return card;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() > 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.HEARTS8])){\n\t \t\t\t\t\tselectedCards[Rules.HEARTS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t\t//Log.i(\"\",\" Playing card \" + (card.GetValue()) + \" , \" +card.GetSuit());\n\t \t\t\t\t\t//Log.i(\"\",\" Updating playable card \" + (card.GetValue()+1) + \" , \" +Card.HEARTS);\t \t\t\t\t\t\n\t \t\t\t\t\t//playableCards[Rules.HEARTS8] = new Card(card.GetValue()+1,Card.HEARTS);\n\t \t\t\t\t\t//return card;\n\t \t\t\t\t}\n\t \t\t\t}\t \t\t\t\n\t \t\t\t\n\t \t\t\tbreak;\n\t \t\tcase Card.DIAMONDS:\n\t \t\t\t// Is it a seven, it can be played...\n\t \t\t\tif (card.GetValue() == 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.DIAMONDS8])){\n\t \t\t\t\t\tselectedCards[Rules.DIAMONDS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\t\n\t \t\t\tif (card.GetValue() < 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.DIAMONDS6])){\n\t \t\t\t\t\tselectedCards[Rules.DIAMONDS6] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() > 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.DIAMONDS8])){\n\t \t\t\t\t\tselectedCards[Rules.DIAMONDS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\t\t \t\t\t\n\t \t\t\t\n\t \t\t\tbreak;\n\t \t\t\t\n\t \t\tcase Card.CLUBS:\n\t \t\t\t// Is it a seven, it can be played...\n\t \t\t\tif (card.GetValue() == 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS8])){\n\t \t\t\t\t\tselectedCards[Rules.CLUBS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\t \t\t\t\t\n\t \t\t\t}\n\t \t\t\t\n\t \t\t\tif (card.GetValue() < 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS6])){\n\t \t\t\t\t\tselectedCards[Rules.CLUBS6] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() > 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS8])){\n\t \t\t\t\t\tselectedCards[Rules.CLUBS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\t\t \t\t\t\n\t \t\t\tbreak;\n\t \t\t\t\n\t \t\tcase Card.SPADES:\n\t \t\t\t// Is it a seven, it can be played...\n\t \t\t\tif (card.GetValue() == 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.SPADES8])){\n\t \t\t\t\t\tselectedCards[Rules.SPADES8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\t \t\t\t\t\n\t \t\t\t}\n\t \t\t\t\n\t \t\t\tif (card.GetValue() < 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.SPADES6])){\n\t \t\t\t\t\tselectedCards[Rules.SPADES6] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() > 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.SPADES8])){\n\t \t\t\t\t\tselectedCards[Rules.SPADES8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\t \t\t\t\n\t \t\t\tbreak;\n\n\t \t\t\t\t \t\t\t\n\t \t\t}\n\t\n\t \t}\t\n\t \t\n\t \t// Now go through the selectable cards and see which is best to be played\n\t \tif (iNumSelectableCards == 0)\n\t \t\treturn ret;\n\t \t\n\t \tint iPos;\n\t \tcard = null;\n\t \tif (iNumSelectableCards == 1){\n\t\t\t \tfor (int i = 0; i < 8; i++)\n\t\t\t \t\tif (selectedCards[i] != null){\n\t\t\t \t\t\tcard = selectedCards[i];\n\t\t\t \t\t\tbreak;\n\t\t\t \t\t}\n\t\t\t \t\t\t \t\n\t \t}\n\t \telse {\n\t\t\t String sDifficulty = mRules.mView.GetSettings().getString(\"Difficulty\", \"0\");// 0 = hard, 1 = easy\n\t\t\t int iDifficulty = Integer.parseInt(sDifficulty);\n\t\t\t if (iDifficulty == EASY){\n\t\t\t \t// Get a random card from the playable ones\n\t\t\t\t\t Random generator = new Random();\n\t\t\t\t\t int randomIndex = generator.nextInt( iNumSelectableCards );\n\t\t\t\t\t int iCount = 0;\n\t\t\t\t\t \tfor (int i = 0; i < 8; i++){\n\t\t\t\t\t \t\tif (selectedCards[i] != null){\n\t\t\t\t\t \t\t\tif (iCount == randomIndex){\n\t\t\t\t\t \t\t\t\tcard = selectedCards[i];\n\t\t\t\t\t \t\t\t\tbreak;\n\t\t\t\t\t \t\t\t}\n\t\t\t\t\t \t\t\telse iCount++;\n\t\t\t\t\t \t\t}\t\n\t\t\t\t\t \t}\n\t\t\t }\n\t\t\t else {\n\t\t\t \tiPos = GetBestCard(selectedCards);\n\t\t\t \tcard = selectedCards[iPos];\n\t\t\t }\n\t \t}\n\t \t\n\t \tswitch (card.GetSuit()){\n \t\tcase Card.HEARTS:\t \t\n \t\t\tif (card.GetValue() == 7){\n \t\t\t\t// and must be played first\n \t\t\t\tplayableCards[Rules.HEARTS8] = new Card(8,Card.HEARTS);\n \t\t\t\tplayableCards[Rules.HEARTS6] = new Card(6,Card.HEARTS);\n \t\t\t\tplayableCards[Rules.CLUBS8] = new Card(7,Card.CLUBS);\n \t\t\t\tplayableCards[Rules.DIAMONDS8] = new Card(7,Card.DIAMONDS);\n \t\t\t\tplayableCards[Rules.SPADES8] = new Card(7,Card.SPADES);\n \n \t\t\t\treturn card;\n \t\t\t}\n \t\t\tif (card.GetValue() < 7){\n \t\t\t\tif (card.Equals(playableCards[Rules.HEARTS6])){\n \t\t\t\t\tplayableCards[Rules.HEARTS6] = new Card(card.GetValue()-1,Card.HEARTS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (card.GetValue() > 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.HEARTS8])){ \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.HEARTS8] = new Card(card.GetValue()+1,Card.HEARTS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\t \t\t\t\n \t\t\t\n \t\t\tbreak; \n \t\tcase Card.DIAMONDS:\n \t\t\t// Is it a seven, it can be played...\n \t\t\tif (card.GetValue() == 7){\n \t\t\t\tif (playableCards[Rules.HEARTS8] != null && playableCards[Rules.HEARTS8].GetValue() > 7){\n\t \t\t\t\tplayableCards[Rules.DIAMONDS8] = new Card(8,Card.DIAMONDS);\n\t \t\t\t\tplayableCards[Rules.DIAMONDS6] = new Card(6,Card.DIAMONDS);\t \t\t\t\t\t\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\tif (card.GetValue() < 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.DIAMONDS6])){\t \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.DIAMONDS6] = new Card(card.GetValue()-1,Card.DIAMONDS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (card.GetValue() > 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.DIAMONDS8])){\t \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.DIAMONDS8] = new Card(card.GetValue()+1,Card.DIAMONDS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\t\t \t\t\t\n \t\t\t\n \t\t\tbreak; \n \t\t\t\n \t\tcase Card.CLUBS:\n \t\t\t// Is it a seven, it can be played...\n \t\t\tif (card.GetValue() == 7){\n\n \t\t\t\tif (playableCards[Rules.HEARTS8] != null && playableCards[Rules.HEARTS8].GetValue() > 7){\n\t \t\t\t\tplayableCards[Rules.CLUBS8] = new Card(8,Card.CLUBS);\n\t \t\t\t\tplayableCards[Rules.CLUBS6] = new Card(6,Card.CLUBS);\t \t\t\t\t\t\n \t\t\t\t\treturn card;\n \t\t\t\t}\t \t\t\t\t\n \t\t\t}\n \t\t\t\n \t\t\tif (card.GetValue() < 7){\n \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS6])){\n \t\t\t\t\tplayableCards[Rules.CLUBS6] = new Card(card.GetValue()-1,Card.CLUBS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (card.GetValue() > 7){\n \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS8])){\n \t\t\t\t\tLog.i(\"\",\" Updating playable card \" + (card.GetValue()+1) + \" , \" +Card.CLUBS);\n \t\t\t\t\tplayableCards[Rules.CLUBS8] = new Card(card.GetValue()+1,Card.CLUBS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\t\t \t\t\t\n \t\t\tbreak; \n \t\tcase Card.SPADES:\n \t\t\t// Is it a seven, it can be played...\n \t\t\tif (card.GetValue() == 7){\n \t\t\t\tif (playableCards[Rules.HEARTS8] != null && playableCards[Rules.HEARTS8].GetValue() > 7){\n\t \t\t\t\tplayableCards[Rules.SPADES8] = new Card(8,Card.SPADES);\n\t \t\t\t\tplayableCards[Rules.SPADES6] = new Card(6,Card.SPADES);\t \t\t\t\t\t\n \t\t\t\t\treturn card;\n \t\t\t\t}\t \t\t\t\t\n \t\t\t}\n \t\t\t\n \t\t\tif (card.GetValue() < 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.SPADES6])){ \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.SPADES6] = new Card(card.GetValue()-1,Card.SPADES);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (card.GetValue() > 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.SPADES8])){\t \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.SPADES8] = new Card(card.GetValue()+1,Card.SPADES);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\t \t\t\t\n \t\t\tbreak;\n \t\t\t\n\t \t}\n\t \n\t }\n\t return ret;\n }", "private void resume() { player.resume();}", "private static void playBlackjack(Player player) {\n\t\t//Delete hands of previous games.\n\t\tplayer.getReady();\n\t\t\n\t\t//Create the dealer.\n\t\tDealer dealer = new Dealer();\n\t\t\n\t\t//Deal two cards to each player.\n\t\tplayer.addCard(deck.dealCard());\n\t\tplayer.addCard(deck.dealCard());\n\t\t\n\t\tdealer.addCard(deck.dealCard());\n\t\tdealer.addCard(deck.dealCard());\n\t\t\n\t\t//Check if anyone has Blackjack.\n\t\tif (dealer.hasBlackjack()) {\n\t\t\tconsole.println(\"Your hand:\" + player.getHand());\n\t\t\tconsole.println(\"Dealer hand:\" + dealer.getHand());\n\t\t\tconsole.println(\"\\n*******************\\n\" +\n\t\t\t\t\t\"Blackjack! You lose!!\" +\n\t\t\t\t\t\"\\n*******************\\n\");\n\t\t\tconsole.println(\"Press <Enter> to continue.\");\n\t\t\tplayer.pay();\n\t\t\treturn;\n\t\t}\n\t\tif (player.hasBlackjack()) {\n\t\t\tconsole.println(\"Dealer hand:\" + dealer.getHand());\n\t\t\tconsole.println(\"Your hand:\" + player.getHand());\n\t\t\tconsole.println(\"\\n*******************\\n\" +\n\t\t\t\t\t\"Blackjack! You lose!!\" +\n\t\t\t\t\t\"\\n*******************\\n\");\n\t\t\tconsole.println(\"Press <Enter> to continue.\");\n\t\t\tplayer.collect();\n\t\t\treturn;\n\t\t\t\n\t\t}\n\t\t\n\t\t//Now the real game begins. Player play first.\n\t\t//Must play all the hands until dealer's turn.\n\t\tboolean dealerTurn = false;\n\t\t\n\t\tconsole.println(String.format(\"\\n\\nDealer first card: %s\", dealer.getFirstCard()));\n\t\t\n\t\twhile (!dealerTurn) { //Player keep playing as long as she can/wants\n\t\t\t\n\t\t\t//Player can have multiple hands (after split). Should play all of them independently.\n\t\t\tOptional<Hand> optionalPlayingHand = player.getNextPlayableHand();\n\t\t\t\n\t\t\tif (optionalPlayingHand.isPresent()) {\n\t\t\t\t\n\t\t\t\tplayer.setCurrentHand(optionalPlayingHand.get());\n\t\t\t\t\n\t\t\t\tconsole.println(\"Your playing hand:\" + player.getHand());\n\t\t\t\tconsole.print(\"Please, select an option: \");\n\t\t\t\tconsole.println(\"(1) Hit (2) Stand (3) Double Down (4) Split (5) Surrender\");\n\t\t\t\tint option = scanner.nextInt();\n\t\t\t\t\n\t\t\t\tswitch (UserAction.valueOf(option)) {\n\t\t\t\t\tcase HIT:\n\t\t\t\t\t\tconsole.println(\"You've chosen: HIT\");\n\t\t\t\t\t\tplayer.hit(deck.dealCard());\n\t\t\t\t\t\tconsole.println(\"Your resulting hand:\" + player.getHand());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase STAND:\n\t\t\t\t\t\tconsole.println(\"You've chosen: STAND\");\n\t\t\t\t\t\tplayer.stand();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase SPLIT:\n\t\t\t\t\t\tconsole.println(\"You've chosen: SPLIT\");\n\t\t\t\t\t\tif (player.split(deck.dealCard(), deck.dealCard())) {\n\t\t\t\t\t\t\tconsole.println(\"Your hand has been split\");\n\t\t\t\t\t\t\tconsole.println(\"Your resulting hand:\" + player.getHand());\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconsole.println(\"Your hand can not be split. Try another option\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DOUBLE_DOWN:\n\t\t\t\t\t\tconsole.println(\"You've chosen: DOUBLE DOWN\");\n\t\t\t\t\t\tplayer.doubleDown(deck.dealCard());\n\t\t\t\t\t\tconsole.println(\"Your resulting hand:\" + player.getHand());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase SURRENDER:\n\t\t\t\t\t\tconsole.println(\"You've chosen: SURRENDER\");\n\t\t\t\t\t\tif (player.surrender()) {\n\t\t\t\t\t\t\tconsole.println(\"Lose half of your bet.\");\n\t\t\t\t\t\t\tconsole.println(\"Dealer hand:\" + dealer.getHand());\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconsole.println(\"You cannot surrender. Try another option\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tdealerTurn = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//All player's hands are standing or busted\n\t\tfor (Hand hand : player.getHands()) {\n\t\t\tconsole.println(\"Your hand: \" + hand + \" Status: \" + hand.getStatus());\n\t\t}\n\t\t\n\t\tconsole.println(\"\\nDealer hand:\" + dealer.getHand());\n\t\t\n\t\tif (player.isBusted()) {\n\t\t\tconsole.println(\"\\n************\\n\" +\n\t\t\t\t\t\"You lose!!\" +\n\t\t\t\t\t\"\\n************\\n\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tconsole.println(\"\\nDealer turn.\\n\");\n\t\t//Dealer's turn.\n\t\twhile (dealerTurn) {\n\t\t\tUserAction dealerAction = dealer.getNextAction();\n\t\t\tswitch (dealerAction) {\n\t\t\t\tcase HIT:\n\t\t\t\t\tconsole.println(\"Dealer HIT\");\n\t\t\t\t\tdealer.hit(deck.dealCard());\n\t\t\t\t\tconsole.println(\"Dealer resulting hand:\" + dealer.getHand());\n\t\t\t\t\tbreak;\n\t\t\t\tcase STAND:\n\t\t\t\t\tconsole.println(\"Dealer STAND\");\n\t\t\t\t\tdealer.stand();\n\t\t\t\t\tdealerTurn = false;\n\t\t\t\t\tbreak;\n\t\t\t\tcase DONE:\n\t\t\t\t\tdealerTurn = false;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tconsole.println(\"Dealer hand:\" + dealer.getHand());\n\t\tif (dealer.isBusted()) {\n\t\t\t//Dealer is busted. Player wins!\n\t\t\tconsole.println(\"\\n************\\n\" +\n\t\t\t\t\t\"You win!!\" +\n\t\t\t\t\t\"\\n************\\n\");\n\t\t\tplayer.collect();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//Check if dealer won\n\t\tif (dealer.hasBlackjack()) {\n\t\t\tconsole.println(\"\\n******************************************************\\n\" +\n\t\t\t\t\t\"There is a tie!. Dealer wins. Its a casino after all\" +\n\t\t\t\t\t\"\\n******************************************************\\n\");\n\t\t\tplayer.pay();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tconsole.println(\"\\n*****************************************************************\\n\");\n\t\tfor (Hand hand : player.getNonBustedHands()) {\n\t\t\tif (hand.getValue() > dealer.getValue()) {\n\t\t\t\t//Player has a better hand. Hand wins.\n\t\t\t\tconsole.println(\"You have a winner hand :\" + hand);\n\t\t\t\tplayer.collect(hand);\n\t\t\t} else {\n\t\t\t\t//Player's hand lose\n\t\t\t\tconsole.println(\"You have a losing hand :\" + hand);\n\t\t\t\tif (hand.getValue() == dealer.getValue()) {\n\t\t\t\t\tconsole.println(\"Remember: in a tie, you lose!\");\n\t\t\t\t}\n\t\t\t\tplayer.pay(hand);\n\t\t\t}\n\t\t}\n\t\tconsole.println(\"\\n*****************************************************************\\n\");\n\t}", "public void tryStand() {\n if(player.getHand().size() > 0){\n firstStand = true;\n dealerTurn(1);\n } else{\n errorFlag = true;\n userMessage = \"You must get your initial hand dealt before you can stand\";\n }\n\n\n }", "@Test\n public void CardRequirementError() {\n MSG_ACTION_ACTIVATE_LEADERCARD message = new MSG_ACTION_ACTIVATE_LEADERCARD(0);\n DevelopmentCard card1 = new DevelopmentCard(1, Color.GREEN, 0, null, null);\n p.getDevelopmentSlot().addCard(card1, 1);\n c.emptyQueue();\n assertFalse(am.activateLeaderCard(p, message));\n assertEquals(MessageType.MSG_ERROR, c.messages.get(0).getMessageType());\n assertEquals(1, c.messages.size());\n }", "public abstract CardAction play(Player p);", "void askDevCardProduction();", "void playMonopolyCard(String resource);", "protected final void hit() throws InsufficientCardsException {\n hand.add(deck.deal());\n update();\n }", "public void playerLost()\r\n {\r\n \r\n }", "public static void handleDream(Player player) {\n\t\t\n\t}", "public void failedMultiPlayer() {\r\n\t\tmultiplayer.setEnabled(true);\r\n\t\tToast.makeText(this, R.string.con_err, Toast.LENGTH_LONG)\r\n\t\t .show();\r\n\t}", "public void startGame() {\n this.deck = new Deck();\n this.deck.shuffle(); //shuffle the deck\n Card card = this.deck.deal(this.getPlayerHand());\n card = this.deck.deal(this.getPlayerHand());\n card = this.deck.deal(this.getDealerHand());\n }", "public void onPlayStart(){\n\n\t}", "public static void hitCorrect()\n\t{\n\t\tplayersCards.add(deck.deal());\n\t\tcurrentValue();\n\t\tuserCardImg[playersCards.size()-1].setIcon(new ImageIcon(Gameplay.class.getResource(getCard(playersCards.get(playersCards.size()-1)))));\n\t\tresume();\n\t\tif(calculateHand(playersCards)>21 || playersCards.size()==4 || calculateHand(playersCards)==0)\n\t\t{\n\t\t\troundEnd();\n\t\t}\n\t\t\n\t}", "void playerUsedCard(Card c, boolean discard) {\n\t\t// The creator data is in the 2 first bytes, the other player in the 2\n\t\t// last bytes.\n\t\tplayedCard[0] = (discard ? DISCARDED_CARD : PLAYED_CARD);\n\t\tplayedCard[1] = (byte) c.id;\n\t}", "public void wrong()\n\t{\n\t\tMediaPlayer wrong = MediaPlayer.create(this, R.raw.wrong);\n\t\twrong.start();\n\t}", "public void catchCard(){\r\n changePlace(deck);\r\n changePlace(hand);\r\n }", "public void nextStepInGame(View view){\n // called by click on either card, so need to track state\n Log.d(getClass().toString(),\"playstate before = \" + playstate.toString());\n\n playstate = playstate.getNext();\n Log.d(getClass().toString(),\"playstate after update = \" + playstate.toString());\n ImageButton computerCard = (ImageButton) findViewById(R.id.computerCard);\n ImageButton youCard = (ImageButton) findViewById(R.id.youCard);\n TextView infoPanel = (TextView) findViewById(R.id.info_panel);\n switch (playstate){\n case NOCARDS: {\n // show empty buttons as no cards on table\n computerCard.setImageResource(R.color.holo_green_dark);\n computerCard.setVisibility(View.VISIBLE);\n youCard.setImageResource(R.color.holo_blue_dark);\n youCard.setVisibility(View.VISIBLE);\n infoPanel.setText(\"Click to deal cards to both players\");\n\n break;\n }\n case DEALCARDS: {\n // show backs of cards ready to play them\n computerCard.setImageResource(R.drawable.card_back);\n computerCard.setVisibility(View.VISIBLE);\n youCard.setImageResource(R.drawable.card_back);\n youCard.setVisibility(View.VISIBLE);\n infoPanel.setText(\"Click to reveal cards\");\n break;\n }\n case SHOWCARDS: {\n // playARound, but only show card faces\n game.playARound();\n String cardToShow = this.game.getTurnlog().lastEntryFor(game.getPlayers()[1]).getHand().topShownCard().toDrawableName();\n computerCard.setImageResource(getResources().getIdentifier(cardToShow, \"drawable\", \"com.codeclan.cardgame\"));\n cardToShow = this.game.getTurnlog().lastEntryFor(game.getPlayers()[0]).getHand().topShownCard().toDrawableName();\n youCard.setImageResource(getResources().getIdentifier(cardToShow, \"drawable\", \"com.codeclan.cardgame\"));\n\n infoPanel.setText(getString(R.string.computer_label) + \" has \" +\n game.getPlayers()[1].getScore().toString() + \" points,\\n\" +\n getString(R.string.player_label) + \" has \" +\n game.getPlayers()[0].getScore().toString() + \" points.\\n Click for clear table\") ;\n\n break;\n }\n\n }\n if( game.isOver() ){\n//\n// break out of onClick loop by going to new activity to display results\n//\n Intent resultsIntent = new Intent(this, G2P1CHWResultsActivity.class);\n resultsIntent.putExtra(\"player1score\", game.getPlayers()[0].getScore());\n resultsIntent.putExtra(\"dealerscore\", game.getPlayers()[1].getScore());\n resultsIntent.putExtra(\"winner\", game.winner().getName());\n\n startActivity(resultsIntent);\n }\n\n }", "public void currentPlayerDrawCard() {\n Player currentPlayer = turnManager.currentPlayer();\n UnoCard newCard = getNextCard();\n currentPlayer.obtainCard(newCard);\n\n for (GameListener gameListener : gameListeners) {\n gameListener.cardDrawn();\n }\n\t}", "void askLeaderCardThrowing();", "@Override\r\n\t\t\tpublic void playGame() {\n\t\t\t\tSystem.out.println(\"隐式调用接口\");\r\n\t\t\t}", "@Override\n\tpublic void play() {\n\t\t\n\t}", "private void BlueEatsPlayer(Player player)\n {\n Player player_to_be_eaten = null;\n try\n {\n BluePlayer player_to_eat = (BluePlayer) player;\n player_to_be_eaten = checkIfEatsRedPlayer(player_to_eat);\n if (player_to_be_eaten == null)\n {\n player_to_be_eaten = checkIfEatsGreenPlayer(player_to_eat);\n if (player_to_be_eaten == null)\n {\n player_to_be_eaten = checkIfEatsYellowPlayer(player_to_eat);\n }\n }\n //player_to_be_eaten.println(\"blue_player_to_be_eaten\" + player_to_be_eaten.toString());\n if (player_to_be_eaten != null)\n {\n playPersonEatenMusic();\n returnPlayerHome(player_to_be_eaten);\n }\n }\n catch (Exception e)\n {\n \n }\n return;\n }", "private void reportPlay (Player player) {\n System.out.println(\"Player \" + player.name() +\n \" takes \" + player.numberTaken() +\n \" stick(s), leaving \" + game.sticksLeft()\n + \".\");\n }", "public void SpecialCardAction(UNOCard aCard) {\n\t\t\n\t\tif (aCard.getName() == \"Reverse\") { // Reverse card is played, so game direction is switched\n\t\t\tif (gameDirection == \"right\") {\n\t\t\t\tgameDirection = \"left\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\tgameDirection = \"right\";\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (aCard.getName() == \"Skip\") {\n\t\t\tif (gameDirection == \"right\") { // If Game is moving in one direction\n\t\t\t\tcurrentPlayerToPlayIndex = currentPlayerToPlayIndex + 2; // player next to play is skipped\n\t\t\t\tif (currentPlayerToPlayIndex >= players.size()) {\n\t\t\t\t\tcurrentPlayerToPlayIndex = currentPlayerToPlayIndex - players.size();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (gameDirection == \"left\") { // If Game is moving in other direction\n\t\t\t\tcurrentPlayerToPlayIndex = currentPlayerToPlayIndex - 2; // player next to play is skipped\n\t\t\t\tif (currentPlayerToPlayIndex <= 0) {\n\t\t\t\t\tcurrentPlayerToPlayIndex = currentPlayerToPlayIndex + players.size();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tcurrentPlayerToPlay = players.get(currentPlayerToPlayIndex); // Next Player to play a card\n\t\t\n\t\tif (aCard.getName() == \"Draw Two\") { // If a Draw Two Card is played, the enxt player to play is dealt two cards\n\t\t\tif (gameDirection == \"right\") {\n\t\t\t\tif (currentPlayerToPlayIndex < players.size()) {\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (gameDirection == \"left\") {\n\t\t\t\tif (currentPlayerToPlayIndex != 0) {\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (aCard.getName() == \"Wild\") { // Wild is played, function called to ask user for new color\n\t\t\tWildIsPlayedAskUserForColor();\n\t\t}\n\t\t\n\t\tif (aCard.getName() == \"Wild Draw Four\") {\n\t\t\tif (gameDirection == \"right\") { // if game direction is this way\n\t\t\t\tif (currentPlayerToPlayIndex < players.size()) {\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard()); // draw four cards\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard()); // draw four cards\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (gameDirection == \"left\") { // if game direction is this way\n\t\t\t\tif (currentPlayerToPlayIndex != 0) {\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard()); // draw four cards\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard()); // draw four cards\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t}\n\t\t\tWildIsPlayedAskUserForColor();\n\t\t}\n\t\t\n\t}", "public void play() {\n\t\t\r\n\t}", "void makePlay(int player) {\n }", "@Override\n protected void receiveInfo(GameInfo info) {\n if (!(info instanceof PalaceGameState)) {\n return;\n }\n PalaceGameState state = new PalaceGameState((PalaceGameState) info);\n PalaceSelectCardAction selectCardAction;\n if (state.getTurn() != this.playerNum) {\n return;\n } else {\n sleep(1000); // make the computer \"think\"\n boolean isBigger = false;// variable to check if they have a valid card\n\n //determines if the cards are valid\n if (!(state.getP2Hand().isEmpty()) && !state.getPlayPilePalaceCards().isEmpty()) {\n for (int i = 0; i < state.getP2Hand().size(); i++) {\n if (state.getP2Hand().get(i).getRank() > state.getPlayPilePalaceCards().\n get(state.getPlayPilePalaceCards().size() - 1).getRank()) {\n isBigger = true;\n }\n }\n }\n\n //takes pile if they have no hand cards to play\n if (isBigger == false && !(state.getP2Hand().isEmpty())) {\n PalaceTakePileAction take = new PalaceTakePileAction(this);\n Log.d(\"compPlayer\", \"took the pile\");\n this.game.sendAction(take);\n }\n\n //begins searching for a card to select\n PalaceCard cardToSelect = null;\n\n // check in the case when the play pile and their hand are both not empty\n if (!(state.getPlayPilePalaceCards().isEmpty()) && (!(state.getP2Hand().isEmpty()))) {\n\n // while they haven't selected a card or the card they selected is less than the top card\n // another card is selected at random from their hand\n while (cardToSelect == null ||\n (cardToSelect.getRank() <\n (state.getPlayPilePalaceCards().\n get(state.getPlayPilePalaceCards().size() - 1).getRank()) &&\n state.getPlayPilePalaceCards().\n get(state.getPlayPilePalaceCards().size() - 1).getRank() >=0)) {\n cardToSelect =\n state.getP2Hand().get((int) (Math.random() * state.getP2Hand().size()));\n }\n\n // selects a card when they are playing from their top cards\n } else if (state.getP2Hand().isEmpty() && (!(state.getP2TopPalaceCards().isEmpty()))) {\n\n //pick any random card if the play pile is empty\n if (state.getPlayPilePalaceCards().isEmpty()) {\n cardToSelect =\n state.getP2TopPalaceCards().\n get((int) (Math.random() * state.getP2TopPalaceCards().size()));\n }\n\n //play pile is not empty so find a valid card\n else {\n\n //checks to see if there is a valid card\n for (int i = 0; i < state.getP2TopPalaceCards().size(); i++) {\n if (state.getP2TopPalaceCards().get(i).getRank() >\n state.getPlayPilePalaceCards().\n get(state.getPlayPilePalaceCards().size() - 1).getRank() &&\n state.getPlayPilePalaceCards().\n get(state.getPlayPilePalaceCards().size() - 1).getRank() >= 0) {\n isBigger = true;\n }\n }\n\n //finds a random valid card because there is one that is valid\n if (isBigger) {\n while (cardToSelect == null ||\n (cardToSelect.getRank() <\n state.getPlayPilePalaceCards().\n get(state.getPlayPilePalaceCards().size() - 1).\n getRank() &&\n state.getPlayPilePalaceCards().\n get(state.getPlayPilePalaceCards().size() - 1).\n getRank() >= 0)) {\n cardToSelect =\n state.getP2TopPalaceCards().\n get((int) (Math.random() * state.\n getP2TopPalaceCards().size()));\n }\n }\n\n //no card to be played so take the pile\n else {\n PalaceTakePileAction take = new PalaceTakePileAction(this);\n Log.d(\"compPlayer\", \"took the pile\");\n this.game.sendAction(take);\n }\n }\n }\n\n //they only have bottom cards left, all are valid to be played so pick a random one\n else if (state.getP2TopPalaceCards().isEmpty()&&state.getP2Hand().isEmpty()) {\n cardToSelect =\n state.getP2BottomPalaceCards().\n get((int) (Math.random() * state.getP2BottomPalaceCards().size()));\n }\n\n //the play pile is empty and they only have hand cards, pick one at random\n else {\n cardToSelect =\n state.getP2Hand().get((int) (Math.random() * state.getP2Hand().size()));\n }\n\n //create and send the select card action with the selected card\n selectCardAction = new PalaceSelectCardAction(this, cardToSelect,\n state.getSelectedPalaceCards());\n this.game.sendAction(selectCardAction);\n\n //rerun selectCardAction if there are multiple of the same card\n if (!state.getP2Hand().isEmpty()) {\n for (int i = 0; i < state.getP2Hand().size(); i++) {\n if (state.getP2Hand().get(i).getRank() == cardToSelect.getRank() &&\n !cardToSelect.equals(state.getP2Hand().get(i))) {\n selectCardAction = new PalaceSelectCardAction(this, state.getP2Hand().get(i),\n state.getSelectedPalaceCards());\n this.game.sendAction(selectCardAction);\n }\n }\n }\n else if (state.getP2Hand().isEmpty() && !state.getP2TopPalaceCards().isEmpty()) {\n for (int i = 0; i < state.getP2Hand().size(); i++) {\n if (state.getP2Hand().get(i).getRank() == cardToSelect.getRank() &&\n !cardToSelect.equals(state.getP2TopPalaceCards().get(i))) {\n selectCardAction = new PalaceSelectCardAction(this, state.getP2TopPalaceCards().get(i),\n state.getSelectedPalaceCards());\n this.game.sendAction(selectCardAction);\n }\n }\n }\n\n //creates and sends the playCardAction\n PalacePlayCardAction playCardAction = new PalacePlayCardAction(this);\n this.game.sendAction(playCardAction);\n }\n\n\n }", "public void playerWon()\r\n {\r\n \r\n }", "public void playCard(IPlayer owner){\n // Wont play card unless a player has it\n if(command == \"Move1\"){\n owner.Move(owner.getPlayerDir());\n }\n else if(command == \"Move2\"){\n for (Integer i=0; i < 2; i++) {\n owner.Move(owner.getPlayerDir());\n }\n }\n else if(command == \"Move3\"){\n for (Integer i=0; i < 3; i++) {\n owner.Move(owner.getPlayerDir());\n }\n }\n else if (command == \"MoveBack\"){\n owner.Move(dirCtrl.invertDirection(owner.getPlayerDir()));\n }\n else if(command == \"TurnRight\"){\n owner.Turn(TurnDirection.RIGHT);\n }\n else if(command == \"TurnLeft\"){\n owner.Turn(TurnDirection.LEFT);\n }\n else if(command == \"Turn180\"){\n owner.Turn(TurnDirection.BACKWARDS);\n }\n }", "public Card playCard()\n {\n\n Card errorReturn = new Card('E', Card.Suit.spades); // in rare cases\n\n if (numCards == 0)\n return errorReturn;\n else\n return myCards[--numCards];\n }", "@Override\n\tpublic void play() {\n\t\tSystem.out.println(\"We played Snokker today\");\n\t\t\n\t\t\n\t}", "@Override\n public void playStart() {\n }", "@Test(expected = IllegalArgumentException.class)\n public void startPlayTest4() {\n GenericStandardDeckGame g = new GenericStandardDeckGame();\n g.startPlay(0, g.getDeck());\n }", "void onStartGameRequested();", "public void playBlackjack() {\n\t\tString choice;\n\t\t\n\t\tSystem.out.println(\"Welcome to Blackjack! \\n\");\n\t\tSystem.out.println(\"Dealing hands \\n\");\n\t\tdeck.shuffle();\n\t\tplayer.setHand(deck.drawHand());\n\t\tdealer.setHand(deck.drawHand());\n\t\t\n\t\t\n\t\tif(checkForBlackjack(player) && checkForBlackjack(dealer)) {\n\t\t\tSystem.out.println(showHands());\n\t\t\tSystem.out.println(\"Both player's have blackjack! \\n\");\n\t\t}\n\t\telse if(checkForBlackjack(player)) {\n\t\t\tSystem.out.println(showHands());\n\t\t\tSystem.out.println(\"Player has blackjack! You win! \\n\");\n\t\t}\n\t\telse if(checkForBlackjack(dealer)) {\n\t\t\tSystem.out.println(showHands());\n\t\t\tSystem.out.println(\"Dealer has blackjack! Dealer wins! \\n\");\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(showInitinalHand());\n\t\t\twhile(player.getHandVal() < 21) {\n\t\t\t\tSystem.out.println(\"Player's turn. Pick to hit or stand \\n\");\n\t\t\t\tchoice = scanner.nextLine().toUpperCase();\n\t\t\t\tif(choice.equals(\"STAND\") || choice.equals(\"S\")) {\n\t\t\t\t\tSystem.out.println(\"Player stands \\n\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse if(choice.equals(\"HIT\")|| choice.equals(\"H\")) {\n\t\t\t\t\tSystem.out.println(\"Player hits \\n\");\n\t\t\t\t\tplayer.addCard(deck.drawCard());\n\t\t\t\t\tSystem.out.println(showInitinalHand());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.println(\"Invalid input \\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile(dealer.getHandVal() < 17) {\n\t\t\t\tSystem.out.println(\"Dealer hits \\n\");\n\t\t\t\tdealer.addCard(deck.drawCard());\n\t\t\t\tSystem.out.println(showHands());\n\t\t\t}\n\t\t\tSystem.out.println(showHands());\n\t\t}\n\t\tcheckWinner();\n\t\tif(result.equals(\"TIE\")) {\n\t\t\tSystem.out.println(\"The result is a tie! \\n\");\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"The winner is the \" + result + \"!\\n\");\n\t\t}\n\t}", "public boolean needPlayer() {\n\t\treturn false;\n\t}", "public void playGame() {\n show();\n while (gameStatus) {\n if (canPut(players.get((state.getTurn())))) {\n int choice = -1;\n while (gameStatus) {\n choice = controls.get(state.getTurn()).putCard(currentCard);\n if (validInput(players.get((state.getTurn())), choice)) {\n System.out.println(players.get(state.getTurn()).getCards().get(choice).toString());\n try{Thread.sleep(1000);}catch(InterruptedException ignored){}\n break;\n }\n }\n decide(players.get(state.getTurn()), players.get(state.getTurn()).getCards().get(choice));\n }\n try{Thread.sleep(500);}catch(InterruptedException ignored){}\n checkFinish();\n if (gameStatus) {\n state.nextTurn();\n show();\n }\n }\n }", "private void playNextPlayer() {\n \n PlayerId nextPlayer = state.nextPlayer();\n players.get(nextPlayer).setHelp(state, handsOfCards.get(nextPlayer), nextPlayer);\n Card c = players.get(nextPlayer).cardToPlay(state, handsOfCards.get(nextPlayer));\n state = state.withNewCardPlayed(c);\n \n handsOfCards.put(nextPlayer, handsOfCards.get(nextPlayer).remove(c));\n players.get(nextPlayer).updateHand(handsOfCards.get(nextPlayer));\n \n for (Map.Entry<PlayerId, Player> pId: players.entrySet()) {\n pId.getValue().updateTrick(state.trick());\n }\n players.get(nextPlayer).resetHelp();\n }", "@Test(expected = NotPlayingException.class)\n public void not_allow_picking_cards_if_not_playing(){\n\n Deck deck = new Deck();\n Game game = new Game(deck);\n\n game.join(\"susan\");\n\n game.pickCard(\"susan\");\n }", "private void playTurn()\n {\n try\n {\n XMLHandler.saveGame(game, GAME_CLONE_PATH);\n }\n catch(IOException | JAXBException | SAXException ex)\n {\n // TODO... ConsoleUtils.message(\"An internal save error has occured, terminating current game\");\n gameEnded = true;\n return;\n }\n \n moveCycle();\n \n if (!game.validateGame()) \n {\n IllegalBoardPenalty();\n }\n \n String gameOverMessage = game.isGameOver();\n if (gameOverMessage != null) \n {\n //TODO: ConsoleUtils.message(gameOverMessage);\n gameEnded = true;\n }\n \n game.switchPlayer();\n }", "public void hitCard() {\n if (this.state == GameState.ROUNDACTIVE) {\n Seat s = this.getSeat(seatPlaying);\n if (s.hasPlayer()) {\n Hand h = s.getPlayer().getHands().get(0);\n h.addCard(this.deck.dealCard());\n if (h.getIsBusted()) {\n this.activeHandStand();\n }\n }\n repaintAll();\n }\n }", "@Override\n\tpublic void play() {\n\n\t}", "private void play() {\n\t\tParcel pc = Parcel.obtain();\n\t\tParcel pc_reply = Parcel.obtain();\n\t\ttry {\n\t\t\tSystem.out.println(\"DEBUG>>>pc\" + pc.toString());\n\t\t\tSystem.out.println(\"DEBUG>>>pc_replay\" + pc_reply.toString());\n\t\t\tib.transact(1, pc, pc_reply, 0);\n\t\t} catch (RemoteException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "private static void playGame() {\n CardDeck deck = new CardDeck();\n int dealer, player, hitOrStand = 1, score = 0;\n System.out.println(\"Goal: Beat the dealer without going over 21\");\n Scanner input = new Scanner(System.in);\n\n // Generate the dealer's card\n dealer = generateRandomNumber(16, 21); \n System.out.println(\"The Dealer scored: \" + dealer);\n System.out.println(\"\");\n \n\n // Keep playing while the player hasn't won or lost yet\n while (hitOrStand == 1 && score < 21 && score < dealer) {\n // Generate player's card\n player = generateRandomNumber(1, 10); \n System.out.println(\"Your card is worth \" + player);\n\n // Displays the picture of player's card\n String card = deck.drawCard(player);\n System.out.println(card);\n\n // Add player's card value to their score\n score = score + player;\n\n // Displays score and asks wether user wants to hit or stand\n if (score <= 21 && score < dealer) {\n System.out.println(\"Your score is \" + score);\n System.out.print(\"Another card? Hit=1 stand=0: \");\n hitOrStand = input.nextInt();\n System.out.println(\"\");\n }\n }\n \n // Display player won\n if (score > dealer && score <= 21 ) {\n System.out.println(\"You win!\");\n System.out.println(\"Your score is \" + score);\n System.out.println(\"The dealer score was \" + dealer);\n System.out.println(\"You were closer to 21 by \" + (score - dealer));\n\n // Display when player ties with dealer\n } else if (score == dealer) {\n System.out.println(\"Your score is \" + score);\n System.out.println(\"\");\n System.out.println(\"You tied!\");\n\n // Display if player lost\n } else if (score > 21) {\n System.out.println(\"Your score is \" + score);\n System.out.println(\"\");\n System.out.println(\"You lose!\");\n int over = score - 21;\n System.out.println(\"You were over 21 by \" + over);\n\n // Display if player lost\n } else {\n int difference;\n difference = dealer - score;\n System.out.println(\"Your score is \" + score);\n System.out.println(\"You lose!\");\n System.out.println(\"The dealer was closer to 21 than you by \" + difference);\n } \n }", "public Player switchPlayer(){\n Player player = getGame().getCurrentPlayer();\n\n List<Card> cards = new ArrayList<>();\n\n for(Card card: getGame().getCards()){\n if(card.rule.isValid(getGame().getDices())){\n cards.add(card);\n }\n }\n\n //get the best card\n if(!cards.isEmpty()){\n Card card = takeTheBestCard(cards);\n\n //add it to the player\n player.getCardsWon().add(card);\n getGame().getCards().remove(card);\n\n System.out.println(player.getName() + \" won \" + card.getExplaination());\n getGame().addAction(new Action(player.getName() + \" won \" + card.getExplaination()));\n }\n\n if(getGame().getCards().isEmpty()){\n game.setStatus(Game.GameStatus.COMPLETED);\n getGame().addAction(new Action(bestPlayer().getName() + \" WON THE GAME!!!\"));\n }\n //turn\n getGame().setCountOfTrialForPlayer(0);\n\n game.setIndexOfCurrentPlayer(game.getIndexOfCurrentPlayer()+1);\n\n if(game.getIndexOfCurrentPlayer() == getGame().getPlayers().size()){\n game.setIndexOfCurrentPlayer(0);\n }\n\n game.setCountOfTrialForPlayer(0);\n game.setDices(new ArrayList<>());\n\n return getGame().getCurrentPlayer();\n }", "public boolean playCard(Card card){\n boolean b = effectHandler.playCard( card , null);\n return b;\n }", "@Override\n\tpublic void onStandDown(PlatformPlayer player) {\n\t\t\n\t}", "private void RedEatsPlayer(Player player)\n {\n Player player_to_be_eaten = null;\n try\n {\n RedPlayer player_to_eat = (RedPlayer) player;\n player_to_be_eaten = checkIfEatsBluePlayer(player_to_eat);\n if (player_to_be_eaten == null)\n {\n player_to_be_eaten = checkIfEatsGreenPlayer(player_to_eat);\n if (player_to_be_eaten == null)\n {\n player_to_be_eaten = checkIfEatsYellowPlayer(player_to_eat);\n }\n }\n\n //player_to_be_eaten.println(\"red_player_to_be_eaten\" + player_to_be_eaten.toString());\n if (player_to_be_eaten != null)\n {\n playPersonEatenMusic();\n returnPlayerHome(player_to_be_eaten);\n }\n }\n catch (Exception e)\n {\n \n }\n return;\n }", "public void howToPlay() {\r\n // An item has been added to the ticket. Fire an event and let everyone know.\r\n System.out.println(\"Step 1: Have no life. \\nStep 2: Deal cards\\nStep 3: Cry yourself to sleep.\");\r\n }", "private void playGame() throws IOExceptionFromController {\n for (Player player : players) {\n if (player.getGodCard().hasAlwaysActiveModifier()) game.addModifier(player.getGodCard());\n }\n while (!game.hasWinner()) {\n if (!running.get()) return;\n Player currentPlayer = players.get(game.getActivePlayer());\n for (Card modifier : game.getActiveModifiers()) {\n if (!modifier.hasAlwaysActiveModifier() && modifier.getController().getPlayer().equals(currentPlayer))\n game.removeModifier(modifier);\n }\n\n broadcastGameInfo(\"turnStart\");\n String result = playerControllers.get(game.getActivePlayer()).playTurn();\n switch (result) {\n case \"next\":\n checkWorkers();\n game.nextPlayer();\n break;\n case \"outOfMoves\":\n case \"outOfBuilds\":\n case \"outOfWorkers\":\n eliminatePlayer(currentPlayer, result);\n game.nextPlayer();\n break;\n case \"winConditionAchieved\":\n case \"godConditionAchieved\":\n setWinner(currentPlayer, result);\n break;\n default:\n logError(\"invalid turn\");\n break;\n }\n }\n gameOver();\n }", "@Override\n\tpublic void nowPlaying() {\n\t}", "private void resume()\r\n {\r\n player.resume();\r\n }", "void askBuyDevCards();", "@Override\n public void keyPressed(KeyEvent e) {\n player.keyPressed(e); // tell player a key has been pressed\n if (e.getKeyCode() == KeyEvent.VK_X && player.invulnerableTime <= 0 && spellCards > 0){ // player cast spell card\n spellCards --;\n audioloader.play(\"spark\");\n player.invulnerableTime = 5.0 * FPS;\n }\n if (e.getKeyCode() == KeyEvent.VK_C){ // toggle hitbox\n if (player.invulnerableTime <= 0)\n player.invulnerableTime = 10000000;\n else\n player.invulnerableTime = 0;\n }\n if (e.getKeyCode() == KeyEvent.VK_ENTER && entityloader.frame >= levelEnd){ // advance to next level\n gameResult = 1;\n }\n if (e.getKeyCode() == KeyEvent.VK_A){ // add life\n lives++;\n }\n }", "@Override\n\tpublic void onRun(PlatformPlayer player) {\n\t\t\n\t}", "public void playTurn() {\r\n\r\n }", "public void play(){\n\t\t\n\t}", "@Override\r\n\tpublic boolean canPlay() {\n\t\treturn false;\r\n\t}", "@Override\n public void landedOn(Player player) {}", "void askLeaderCardActivation();", "public void startGame() {\n int numberOFPlayers = view.askForNumberOfPlayers();\n\n // adding dealer...\n players.add(dealer);\n //...and players to 'players' ArrayList\n for (int i = 1; i < numberOFPlayers; i++) {\n players.add(new RegularPlayer(i + 1));\n }\n\n // dealing cards to players\n dealer.dealCardsToPlayers(players);\n // Game\n while (!(players.size() == 1)) {\n\n for (int i = 0; i < players.size(); i++) {\n\n // printowanie ilości kart kazdego z graczy dla testów\n if (checkGameStatus()) {\n try {\n // display no of cards for each player\n for (Player player : players) {\n view.print(\"Player \" + player.getPlayerId() + \" no of cards: \" + player.getCardsCount());\n }\n\n round(players.get(i), players);\n } catch (IndexOutOfBoundsException e) {\n continue;\n }\n } else {\n break;\n }\n }\n }\n }", "public void playCard(int index) {\r\n\t\tCard c = deck.hand.get(index);\r\n\t\tif(c.isAction() && actions > 0 && access.gamePhase < 2) {\r\n\t\t\taccess.gamePhase = 1;\r\n\t\t\tif(!deck.play.contains(new Champion())) actions--;\r\n\t\t\tdeck.playCard(index);\r\n\t\t\tc.performAction();\r\n\t\t\tnotifyObservers();\r\n\t\t}\r\n\t\telse if(c.isTreasure() && access.gamePhase < 3) {\r\n\t\t\taccess.gamePhase = 1;\r\n\t\t\taddTreasure(c.getTreasure());\r\n\t\t\tdeck.playCard(index);\r\n\t\t\tc.performAction();\r\n\t\t\tnotifyObservers();\r\n\t\t}\r\n\t}", "@Override\n\t\tpublic void onLoaded(String arg0) {\n\t\t\t\tplayer.play();\n\t\t}", "public void preGame() {\n\n\t}", "public boolean mayPickup(Player debug1) {\n/* 112 */ return true;\n/* */ }", "public void handStarted(int position, GameState gs, Card[] cards) {\r\n }", "public void notifyPlayer(CardGraphics card){\n\t\tchosenCard = card.getCard();\n\t\t\n\t\tsynchronized(lock){\n\t\t\tlock.notify();\n\t\t}\n\t}" ]
[ "0.7410453", "0.73236656", "0.7311895", "0.72207314", "0.7068116", "0.7020802", "0.69322014", "0.67434806", "0.67256624", "0.6723173", "0.67121774", "0.66599023", "0.6587916", "0.6584277", "0.6574833", "0.6503764", "0.6488757", "0.6448004", "0.6388153", "0.63467383", "0.6314477", "0.6306998", "0.6296475", "0.6295797", "0.62936634", "0.6273792", "0.6270514", "0.62347686", "0.620201", "0.61843264", "0.61834466", "0.6169335", "0.61391383", "0.6132726", "0.61325717", "0.6132546", "0.613123", "0.6129976", "0.60923535", "0.6088289", "0.60844296", "0.6081897", "0.6077734", "0.60744494", "0.6029949", "0.602286", "0.60199267", "0.6014058", "0.6009962", "0.60083634", "0.59989756", "0.5990809", "0.59907186", "0.5987374", "0.5977484", "0.5975476", "0.59673506", "0.5965718", "0.5964075", "0.5957182", "0.5955525", "0.59544873", "0.5952262", "0.594589", "0.59418106", "0.5935631", "0.593338", "0.5929108", "0.59286714", "0.59182394", "0.59161097", "0.59140366", "0.59122413", "0.59088665", "0.59071153", "0.59028935", "0.58980364", "0.58968556", "0.5895106", "0.5893146", "0.5884195", "0.5883881", "0.58797926", "0.58772844", "0.58766794", "0.58701295", "0.586893", "0.5867332", "0.5865806", "0.586558", "0.58652776", "0.5862953", "0.5858327", "0.585111", "0.58481234", "0.5837304", "0.58372176", "0.5836926", "0.5834252", "0.5829728", "0.5828033" ]
0.0
-1
This method is called when a player tries to play a development card
boolean CanUseMonument();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void playCard() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void playMonumentCard() {\n\t\t\r\n\t}", "@Override\n\tpublic void playCard() {\n\t\t\n\t}", "@Override\r\n\tpublic void playSoldierCard() {\n\t\t\r\n\t}", "public void playCard(ActionCard card, Integer selectedPlayer)\n {\n System.out.println(\"gui: playCard: \" + card + \", selected: \" + selectedPlayer);\n // Guard against this\n if (!isTurn || this.played)\n {\n return;\n }\n \n if(card instanceof PrivateTip || card instanceof Snoop) \n {\n if(selectedPlayer == null) \n {\n JOptionPane.showMessageDialog(null, \"Please select \"\n + \"a player in the \"\n + \"Player Listing (Upper right) that is not yourself!\", \n \"Warning\", \n JOptionPane.ERROR_MESSAGE); \n return;\n }\n }\n\n if (card instanceof Suggestion)\n {\n this.played = true;\n // prompt for solution\n suggestionScreen = new AccusationScreen(this, true, (Suggestion)card);\n suggestionScreen.setVisible(true);\n }\n else\n {\n this.played = clientController.playActionCard(card, selectedPlayer);\n if(!this.played)\n {\n mainGameScreen.notifyUser(\"Play failed: To Play this card,\"\n + \" please select a CluePlayer from the 'Players' list,\"\n + \" then click on this card.\");\n }\n }\n\n }", "@Override\n\tpublic void onCouldNotPlayCardListener(int position) {\n\n\t}", "void playMonumentCard();", "void playCurrentStationCard();", "@Override\r\n\tpublic void showGetPrisonCardMessage(Player player) {\n\t\t\r\n\t}", "@Test(expected = DoesNotOwnException.class)\n\tpublic void cannotPlayDevCardTest() throws DoesNotOwnException, CannotPlayException\n\t{\n\t\tp.playDevelopmentCard(c, game.getBank());\n\t}", "public void playCard(int player, int card) {\n }", "@Override\r\n public void playGame() {\r\n printInvalidCommandMessage();\r\n }", "@Override\n\tpublic void cardInPlay() {\n\t\tIPlayer playedOn = this.game.getOtherPlayer();\n\t\tif(!playedOn.getFaction().equals(Faction.Cultist)){\n\t\t\tplayedOn.setFaction(Faction.UNAFFILIATED);\n\t\t}\n\t\tthis.setDiscard();\n\t}", "@Override\n\tpublic void onCardFail() {\n\t\tLoggerUtils.d(\"onCardFail Start!!!\");\n\t\tonFail();\n\t}", "private void startGame() {\n betOptionPane();\n this.computerPaquetView.setShowJustOneCard(true);\n blackjackController.startNewGame(this);\n }", "@Override\r\n\tpublic void playRoadBuildingCard() {\n\t\t\r\n\t}", "@Override\n\tpublic void onCardSucess() {\n\t\tLoggerUtils.d(\"onCardSucess Start!!!\");\n\t\tonSucess();\n\t}", "private void playThisCard(UnoCard clickedCard) throws NotYourTurnException, InvalidMoveException {\n\t\t// Check player's turn\n\t\tif (!isHisTurn(clickedCard)) {\n\t\t\tthrow new NotYourTurnException();\n\t\t} else {\n\n\t\t\t// Card validation\n\t\t\tif (isValidMove(clickedCard)) {\n\n\t\t\t\tplayedCards().add(clickedCard);\n\n\t\t\t\tremovePlayedCard(clickedCard);\n\n\t\t\t\t// function cards ??\n if (clickedCard instanceof ActionCard) {\n performAction(clickedCard);\n\n }\n\n\t\t\t\tfor (GameListener listener : gameListeners) {\n\t\t\t\t\tlistener.cardPlayed(clickedCard);\n\t\t\t\t}\n\n\t\t\t\tcheckResults();\n\t\t\t} else {\n\t\t\t\tthrow new InvalidMoveException();\n\n\t\t\t}\n\t\t}\n\t}", "public void play() {\r\n this.cardDeck = new JavaDeck();\r\n cardDeck.shuffle();\r\n dealerHand = new JavaHand(2);\r\n dealerHand.DiscardHand();\r\n addDealerCard();\r\n }", "@Override\n public void play(){\n \n // while neither player is dead\n while (continueGame()) {\n \n // both player and cpu draw a card and display the card\n player.play();\n System.out.printf(\"%s has drawn %s \\n\", player.getPlayerID(), \n player.getCard());\n cpu.play();\n System.out.printf(\"%s has drawn %s \\n\", cpu.getPlayerID(), \n cpu.getCard());\n \n // checks if the player wins the round\n if (winRound(player, cpu)) {\n // adds the cards to the gamedeck then the game deck to the\n // player deck\n winner(player, cpu, gameDeck);\n player.getWinningsPile().addCards(gameDeck.showCards().subList(0\n , gameDeck.getSize()));\n // empties the game deck\n gameDeck.showCards().clear();\n System.out.printf(\"%s wins round\\n\", player.getPlayerID());\n } else if (winRound(cpu, player)) { // if the cpu wins\n // adds the cards to the gamedeck then the game deck to the\n // cpu deck\n winner(cpu, player, gameDeck);\n cpu.getWinningsPile().addCards(gameDeck.showCards().subList(0, \n gameDeck.getSize()));\n // empties the game deck\n gameDeck.showCards().clear();\n System.out.println(\"CPU wins round\");\n } else {\n // if its a draw, check to see if either the cpu or player is\n // dying, if so, dont add the card to the gameDeck\n if (!(player.isDying())) {\n gameDeck.addCard(player.getCard());\n player.clearCard();\n }\n if (!(cpu.isDying())) {\n gameDeck.addCard(cpu.getCard());\n cpu.clearCard();\n }\n System.out.println(\"DRAW\");\n }\n // shows the current status of the game\n System.out.printf(\"%s's deck: %d winnings: %d \\n\", \n player.getPlayerID(), player.getDeck().getSize(), \n player.getWinningsPile().getSize());\n System.out.printf(\"CPU deck: %d winnings: %d \\n\", \n cpu.getDeck().getSize(), \n cpu.getWinningsPile().getSize());\n System.out.println(\"Press Enter to go to the next round\");\n in.nextLine();\n }\n //display the winner\n declareWinner();\n }", "private static void showPlayerDeckInfo() {\n }", "@Test\n\tpublic void playAndRemoveDevelopmentCardTest()\n\t\t\tthrows CannotAffordException, DoesNotOwnException, BankLimitException, CannotPlayException\n\t{\n\t\tassertTrue(p.getDevelopmentCards().size() == 0);\n\t\tp.grantResources(DevelopmentCardType.getCardCost(), game.getBank());\n\t\tDevelopmentCardType c = buyDevelopmentCard();\n\t\tassertTrue(p.getDevelopmentCards().get(c) == 1);\n\n\t\t// Reset recent dev card for player, so they can play this turn\n\t\tgame.getPlayer(game.getCurrentPlayer()).clearRecentDevCards();\n\n\t\t// Reset recent dev card for player, so they can play this turn\n\t\tgame.getPlayer(game.getCurrentPlayer()).clearRecentDevCards();\n\n\t\t// Play card and test it was removed\n\t\tDevelopmentCardType key = (DevelopmentCardType) p.getDevelopmentCards().keySet().toArray()[0];\n\t\tp.playDevelopmentCard(key, game.getBank());\n\n\t\tassertTrue(p.getDevelopmentCards().get(c) == 0);\n\t}", "@Override\r\n\tpublic void playGame() {\n\t\tSystem.out.println(\"SmartPhone具有玩游戏的功能\");\r\n\t}", "public void playerTurn(Game game){\n int cardHandNum;\n boolean nextPlayer = false;\n String recentCardDesc;\n if(game.recentCardPlayed() && !(game.playerGetAnotherTurn(this))){\n if(game.getRecentCard() instanceof Mineral){\n recentCardDesc = \"\\nRecent card = Name: \" + game.getRecentCard().getCardName() + \" \" +\n \"Hardness: \" + ((Mineral) game.getRecentCard()).getCardHardness() + \" \" +\n \"Specific Gravity: \" + ((Mineral) game.getRecentCard()).getCardSpecGravity() + \" \" +\n \"Cleavage: \" + ((Mineral) game.getRecentCard()).getCardCleavage() + \" \" +\n \"Crystal Abundance: \" + ((Mineral) game.getRecentCard()).getCardCrystalAbundance() + \" \" +\n \"Economic Value: \" + ((Mineral) game.getRecentCard()).getCardEconomicValue() + \"\\n\"; // The recent card description of the Mineral card\n }\n else{\n recentCardDesc = \"\\nThe recent player play the \" + ((SuperTrumps) game.getRecentCard()).getCardName() + \" card\" + \"\\n\"; // The recent card description of the Supertrumps card\n }\n }\n else if(game.recentCardPlayed() && game.playerGetAnotherTurn(this)){\n System.out.println(\"You are granted to select the trump mode again\");\n recentCardDesc = \"\\nYou may pick the card again as you made all of other players pass\" + \"\\n\";\n gameStart(game); // Allowing the player that is not passed to pick up another trump category\n }\n else {\n recentCardDesc = \"\\nThere are no recent cards that have been played\" + \"\\n\";\n gameStart(game); // Description when there is no cards that is been played (when it is the start of the game)\n }\n while (!nextPlayer){\n // Used for looping until the person did the action (play the card or pass), which allows the next player to move\n String playerChoice;\n System.out.println(\"Game mode: \" + game.getGameModeMessage() + recentCardDesc + showCardInHand() + getPlayerName() + \", enter the card number you want to play or simply enter PASS to pass\");\n System.out.print(\">>>\");\n Scanner options = new Scanner(System.in);\n playerChoice = options.nextLine();\n if (playerChoice.toUpperCase().equals(\"PASS\")){\n drawPlayerCard(game.getCardDeck().drawnCard());\n nextPlayer = true;\n }\n else{\n try {\n cardHandNum = Integer.parseInt(playerChoice); // Changing the input into int from String\n Card cardPlayed = getPlayerCard(cardHandNum); // Used for trying to get the card played\n boolean continueGame = game.gameCard(cardPlayed, this); // Trying to play the card\n if(game.getGameMode().equals(\"CHOICE\")){ // Decision when a player play a special supertrump card to allow player to freely choose the trump mode\n game.putCardToGame(cardPlayed);\n playerHand.remove((cardHandNum));\n gameStart(game);\n game.setRecentPlayer(this.getPlayerName());\n nextPlayer = true;\n }\n else if (game.getGameMode().equals(\"GRAV/MAG\")) {\n if(lookAtWinCard()) { // Check whether or not the player has the winning card, which is Magnetite\n for (Card cardInHand : playerHand) {\n game.putCardToGame(cardInHand);\n playerHand.remove(cardInHand);\n game.setRecentPlayer(this.getPlayerName());\n }\n game.setGameMode(\"SPECGRAV\"); // Change the game mode to Specific Gravity\n nextPlayer = true;\n }\n else {\n game.setGameMode(\"SPECGRAV\"); // Change the game mode to Specific Gravity\n }\n if(continueGame){\n game.putCardToGame(cardPlayed);\n playerHand.remove((cardHandNum));\n game.setRecentPlayer(this.getPlayerName());\n nextPlayer = true;\n }\n }\n else {\n if(continueGame){\n // Used for the normal card play\n game.putCardToGame(cardPlayed);\n playerHand.remove((cardHandNum));\n game.setRecentPlayer(this.getPlayerName());\n nextPlayer = true;\n }\n }\n }\n catch (Throwable e){\n System.out.println(\"Invalid input!\"); // When the user try to enter the input that does not match the card in the hand\n }\n }\n }\n if (playerHand.size() == 0){\n // Occurs when the player has no more card in the hand\n game.setRecentPlayer(game.getPlayers().get((game.getPlayers().indexOf(this)+1)%game.getPlayers().size()).getPlayerName());\n playerLeft(game);\n }\n }", "public void cantPlayGoNext() {\n\t switchTurn();\n }", "public void playTurn(){\r\n\t\t// all exceptions in this method are caught, because if this method throws an exception\r\n\t\t// the AIPlayer will not draw/discard a card and the program will freeze\r\n\t\ttry{\r\n\t\t\tupdateLastCardDiscarded();\r\n\t\t}catch(Exception e){\r\n\t\t\tSystem.out.println(\"AIPlayer, lastCard: \" + e.toString());\r\n\t\t}\r\n\t\ttry{\r\n\t\t\tif(!(drawOrPickUp()^bestChoice(BEST_CHOICE_AT_FIFTY))){ // choose whether to draw from the deck or pick up from the stack\r\n\t\t\t\tif(!game.getRound().drawFromDiscard()) // If picking up from the discard is not possible,\r\n\t\t\t\t\tgame.getRound().drawFromDeck(); // draw from the deck instead\r\n\t\t\t}else{\r\n\t\t\t\tgame.getRound().drawFromDeck();\r\n\t\t\t}\r\n\t\t}catch(Exception e){\r\n\t\t\tSystem.out.println(\"AIPlayer, draw: \" + e.toString());\r\n\t\t\tgame.getRound().drawFromDeck(); // if something goes wrong, draw\r\n\t\t}\r\n\r\n\t\ttry{\r\n\t\t\tgroup = new Groups(this, getHand());\r\n\t\t\tif(!hasLaidDownPhase() && group.getCompletePhaseGroups() != null && // if the AI player, hasn't laid down PhaseGroups\r\n\t\t\t\t\tgroup.getCompletePhaseGroups().length == Configuration.getNumberRequired(getPhase()) && // will lay down the right number of phasesGroups\r\n\t\t\t\t\tgetGame().getRound().getTurnNumber() >= 8 - (difficulty/10)) // is past a certain turn number based off difficulty\r\n\t\t\t\taddPhaseGroups(group.getCompletePhaseGroups()); \r\n\t\t}catch(Exception e){\r\n\t\t\tSystem.out.println(\"AIPlayer, laydown: \" + e.toString()); // laid down all my cards Hand92,AI90afterAI74\r\n\t\t}\r\n\r\n\t\ttry{\r\n\t\t\tif(hasLaidDownPhase())\r\n\t\t\t\tplayOffPhases();\r\n\t\t}catch(Exception e){\r\n\t\t\tSystem.out.println(\"AIPlayer, playoff: \" + e.toString());\r\n\t\t}\r\n\r\n\t\ttry{\r\n\t\t\tlastCardDiscarded = discardCard();\r\n\t\t\tgame.getRound().discard(lastCardDiscarded); // discard\r\n\t\t}catch(Phase10Exception e){\t\r\n\t\t}catch(Exception e){\r\n\t\t\tlastCardDiscarded = getHand().getCard(0);\r\n\t\t\tgame.getRound().discard(lastCardDiscarded);\r\n\t\t\tSystem.out.println(\"AIPlayer, discard: \" + e.toString());\r\n\t\t}\r\n\t}", "public PlayingCard(){\n\t\tsuper();\n\t}", "public void playGame()\r\n\t{\r\n\t\tSystem.out.println(\"Welcome to BlackJack! \\n\");\r\n\t\t\r\n\t\t// Boolean value to tell evaluateWin() method when the final win evaluation must be made\r\n\t\tboolean finalCheck = false;\r\n\t\t\r\n\t\tcardDeck.getDeck();\r\n\t\t\r\n\t\tSystem.out.println(\"Dealing cards...\");\r\n\t\t\r\n\t\t// Each player gets 2 cards to start\r\n\t\tplayer1.hit( cardDeck.draw() );\r\n\t\tplayer1.hit( cardDeck.draw() );\r\n\t\tdealer.hit( cardDeck.draw() );\r\n\t\tdealer.hit( cardDeck.draw() );\r\n\t\t\r\n\t\t// displays current cards\r\n\t\tdisplayPlayerCards(PLAYER1_ID);\r\n\t\tdisplayPlayerCards(DEALER_ID);\r\n\t\t\r\n\t\t// checks for win\r\n\t\tevaluateWin(finalCheck);\r\n\t\t\r\n\t\t// begins player1 turns\r\n\t\tplayerTurns();\r\n\t\t\r\n\t\t// begins dealer turns\r\n\t\tdealerTurns();\r\n\t\t\r\n\t\t// instructs evaluateWin to make final victory check\r\n\t\tfinalCheck = true;\r\n\t\tevaluateWin(finalCheck);\r\n\t\t\r\n\t\t// Cleans up objects\r\n\t\tcardDeck.newDeck();\r\n\t\tplayer1.resetHand();\r\n\t\tdealer.resetHand();\r\n\t}", "@Override\n public void onPreparing(EasyVideoPlayer player) {\n // TODO handle if needed\n }", "public void ActonCard() {\n\t}", "public void playDevelopmentCard(int turnNumber, DevCardType devCardType) throws Exception {\n\t\tif(canDoPlayDevelopmentCard(turnNumber, devCardType) == false) {\n\t\t\tthrow new Exception(\"Cannot play this card\");\n\t\t}\n\t\tdevelopmentCardHand.playDevelopmentCard(turnNumber, devCardType);\n\t}", "@Override\n public void beHelpful() {\n this.playPiano();\n this.takeABow();\n }", "public Card PlayCard() {\n\t Card ret = null;\n\t Card card;\n\t if (mCardCount > 0) {\n\t\t // To work out what card to play, see what cards can be played\n\t\t \tCard[] playableCards;\n\t\t \tplayableCards = mRules.GetPlayableCards();\n\t\t \tCard[] selectedCards;\n\t\t \tselectedCards = new Card[8];\n\t\t \tint iNumSelectableCards = 0;\n\t\t \tfor (int i = 0; i < 8; i++)\n\t\t \t\tselectedCards[i] = null;\n\t \tfor (int i = 0; i < mCardCount; i++){\n\t \t\tcard = mCard[i];\n\t \t\tswitch (card.GetSuit()){\n\t \t\tcase Card.HEARTS:\n\t \t\t\t\n\t \t\t\t// Card is a heart, can it be played?\n\t \t\t\t// Is it a seven, it can be played...\n\t \t\t\tif (card.GetValue() == 7){\n\t \t\t\t\tselectedCards[Rules.HEARTS8] = card;\n\t \t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t// and must be played first\n\t \t\t\t\tplayableCards[Rules.HEARTS8] = new Card(8,Card.HEARTS);\n\t \t\t\t\tplayableCards[Rules.HEARTS6] = new Card(6,Card.HEARTS);\n\t \t\t\t\tplayableCards[Rules.CLUBS8] = new Card(7,Card.CLUBS);\n\t \t\t\t\tplayableCards[Rules.DIAMONDS8] = new Card(7,Card.DIAMONDS);\n\t \t\t\t\tplayableCards[Rules.SPADES8] = new Card(7,Card.SPADES);\n\t \n\t \t\t\t\treturn card;\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() < 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.HEARTS6])){\n\t \t\t\t\t\tselectedCards[Rules.HEARTS6] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t\t//Log.i(\"\",\" Playing card \" + (card.GetValue()) + \" , \" +card.GetSuit());\n\t \t\t\t\t\t//Log.i(\"\",\" Updating playable card \" + (card.GetValue()-1) + \" , \" +Card.HEARTS);\t \t\t\t\t\t\n\t \t\t\t\t\t//playableCards[Rules.HEARTS6] = new Card(card.GetValue()-1,Card.HEARTS);\n\t \t\t\t\t\t//return card;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() > 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.HEARTS8])){\n\t \t\t\t\t\tselectedCards[Rules.HEARTS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t\t//Log.i(\"\",\" Playing card \" + (card.GetValue()) + \" , \" +card.GetSuit());\n\t \t\t\t\t\t//Log.i(\"\",\" Updating playable card \" + (card.GetValue()+1) + \" , \" +Card.HEARTS);\t \t\t\t\t\t\n\t \t\t\t\t\t//playableCards[Rules.HEARTS8] = new Card(card.GetValue()+1,Card.HEARTS);\n\t \t\t\t\t\t//return card;\n\t \t\t\t\t}\n\t \t\t\t}\t \t\t\t\n\t \t\t\t\n\t \t\t\tbreak;\n\t \t\tcase Card.DIAMONDS:\n\t \t\t\t// Is it a seven, it can be played...\n\t \t\t\tif (card.GetValue() == 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.DIAMONDS8])){\n\t \t\t\t\t\tselectedCards[Rules.DIAMONDS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\t\n\t \t\t\tif (card.GetValue() < 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.DIAMONDS6])){\n\t \t\t\t\t\tselectedCards[Rules.DIAMONDS6] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() > 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.DIAMONDS8])){\n\t \t\t\t\t\tselectedCards[Rules.DIAMONDS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\t\t \t\t\t\n\t \t\t\t\n\t \t\t\tbreak;\n\t \t\t\t\n\t \t\tcase Card.CLUBS:\n\t \t\t\t// Is it a seven, it can be played...\n\t \t\t\tif (card.GetValue() == 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS8])){\n\t \t\t\t\t\tselectedCards[Rules.CLUBS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\t \t\t\t\t\n\t \t\t\t}\n\t \t\t\t\n\t \t\t\tif (card.GetValue() < 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS6])){\n\t \t\t\t\t\tselectedCards[Rules.CLUBS6] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() > 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS8])){\n\t \t\t\t\t\tselectedCards[Rules.CLUBS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\t\t \t\t\t\n\t \t\t\tbreak;\n\t \t\t\t\n\t \t\tcase Card.SPADES:\n\t \t\t\t// Is it a seven, it can be played...\n\t \t\t\tif (card.GetValue() == 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.SPADES8])){\n\t \t\t\t\t\tselectedCards[Rules.SPADES8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\t \t\t\t\t\n\t \t\t\t}\n\t \t\t\t\n\t \t\t\tif (card.GetValue() < 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.SPADES6])){\n\t \t\t\t\t\tselectedCards[Rules.SPADES6] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() > 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.SPADES8])){\n\t \t\t\t\t\tselectedCards[Rules.SPADES8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\t \t\t\t\n\t \t\t\tbreak;\n\n\t \t\t\t\t \t\t\t\n\t \t\t}\n\t\n\t \t}\t\n\t \t\n\t \t// Now go through the selectable cards and see which is best to be played\n\t \tif (iNumSelectableCards == 0)\n\t \t\treturn ret;\n\t \t\n\t \tint iPos;\n\t \tcard = null;\n\t \tif (iNumSelectableCards == 1){\n\t\t\t \tfor (int i = 0; i < 8; i++)\n\t\t\t \t\tif (selectedCards[i] != null){\n\t\t\t \t\t\tcard = selectedCards[i];\n\t\t\t \t\t\tbreak;\n\t\t\t \t\t}\n\t\t\t \t\t\t \t\n\t \t}\n\t \telse {\n\t\t\t String sDifficulty = mRules.mView.GetSettings().getString(\"Difficulty\", \"0\");// 0 = hard, 1 = easy\n\t\t\t int iDifficulty = Integer.parseInt(sDifficulty);\n\t\t\t if (iDifficulty == EASY){\n\t\t\t \t// Get a random card from the playable ones\n\t\t\t\t\t Random generator = new Random();\n\t\t\t\t\t int randomIndex = generator.nextInt( iNumSelectableCards );\n\t\t\t\t\t int iCount = 0;\n\t\t\t\t\t \tfor (int i = 0; i < 8; i++){\n\t\t\t\t\t \t\tif (selectedCards[i] != null){\n\t\t\t\t\t \t\t\tif (iCount == randomIndex){\n\t\t\t\t\t \t\t\t\tcard = selectedCards[i];\n\t\t\t\t\t \t\t\t\tbreak;\n\t\t\t\t\t \t\t\t}\n\t\t\t\t\t \t\t\telse iCount++;\n\t\t\t\t\t \t\t}\t\n\t\t\t\t\t \t}\n\t\t\t }\n\t\t\t else {\n\t\t\t \tiPos = GetBestCard(selectedCards);\n\t\t\t \tcard = selectedCards[iPos];\n\t\t\t }\n\t \t}\n\t \t\n\t \tswitch (card.GetSuit()){\n \t\tcase Card.HEARTS:\t \t\n \t\t\tif (card.GetValue() == 7){\n \t\t\t\t// and must be played first\n \t\t\t\tplayableCards[Rules.HEARTS8] = new Card(8,Card.HEARTS);\n \t\t\t\tplayableCards[Rules.HEARTS6] = new Card(6,Card.HEARTS);\n \t\t\t\tplayableCards[Rules.CLUBS8] = new Card(7,Card.CLUBS);\n \t\t\t\tplayableCards[Rules.DIAMONDS8] = new Card(7,Card.DIAMONDS);\n \t\t\t\tplayableCards[Rules.SPADES8] = new Card(7,Card.SPADES);\n \n \t\t\t\treturn card;\n \t\t\t}\n \t\t\tif (card.GetValue() < 7){\n \t\t\t\tif (card.Equals(playableCards[Rules.HEARTS6])){\n \t\t\t\t\tplayableCards[Rules.HEARTS6] = new Card(card.GetValue()-1,Card.HEARTS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (card.GetValue() > 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.HEARTS8])){ \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.HEARTS8] = new Card(card.GetValue()+1,Card.HEARTS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\t \t\t\t\n \t\t\t\n \t\t\tbreak; \n \t\tcase Card.DIAMONDS:\n \t\t\t// Is it a seven, it can be played...\n \t\t\tif (card.GetValue() == 7){\n \t\t\t\tif (playableCards[Rules.HEARTS8] != null && playableCards[Rules.HEARTS8].GetValue() > 7){\n\t \t\t\t\tplayableCards[Rules.DIAMONDS8] = new Card(8,Card.DIAMONDS);\n\t \t\t\t\tplayableCards[Rules.DIAMONDS6] = new Card(6,Card.DIAMONDS);\t \t\t\t\t\t\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\tif (card.GetValue() < 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.DIAMONDS6])){\t \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.DIAMONDS6] = new Card(card.GetValue()-1,Card.DIAMONDS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (card.GetValue() > 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.DIAMONDS8])){\t \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.DIAMONDS8] = new Card(card.GetValue()+1,Card.DIAMONDS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\t\t \t\t\t\n \t\t\t\n \t\t\tbreak; \n \t\t\t\n \t\tcase Card.CLUBS:\n \t\t\t// Is it a seven, it can be played...\n \t\t\tif (card.GetValue() == 7){\n\n \t\t\t\tif (playableCards[Rules.HEARTS8] != null && playableCards[Rules.HEARTS8].GetValue() > 7){\n\t \t\t\t\tplayableCards[Rules.CLUBS8] = new Card(8,Card.CLUBS);\n\t \t\t\t\tplayableCards[Rules.CLUBS6] = new Card(6,Card.CLUBS);\t \t\t\t\t\t\n \t\t\t\t\treturn card;\n \t\t\t\t}\t \t\t\t\t\n \t\t\t}\n \t\t\t\n \t\t\tif (card.GetValue() < 7){\n \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS6])){\n \t\t\t\t\tplayableCards[Rules.CLUBS6] = new Card(card.GetValue()-1,Card.CLUBS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (card.GetValue() > 7){\n \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS8])){\n \t\t\t\t\tLog.i(\"\",\" Updating playable card \" + (card.GetValue()+1) + \" , \" +Card.CLUBS);\n \t\t\t\t\tplayableCards[Rules.CLUBS8] = new Card(card.GetValue()+1,Card.CLUBS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\t\t \t\t\t\n \t\t\tbreak; \n \t\tcase Card.SPADES:\n \t\t\t// Is it a seven, it can be played...\n \t\t\tif (card.GetValue() == 7){\n \t\t\t\tif (playableCards[Rules.HEARTS8] != null && playableCards[Rules.HEARTS8].GetValue() > 7){\n\t \t\t\t\tplayableCards[Rules.SPADES8] = new Card(8,Card.SPADES);\n\t \t\t\t\tplayableCards[Rules.SPADES6] = new Card(6,Card.SPADES);\t \t\t\t\t\t\n \t\t\t\t\treturn card;\n \t\t\t\t}\t \t\t\t\t\n \t\t\t}\n \t\t\t\n \t\t\tif (card.GetValue() < 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.SPADES6])){ \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.SPADES6] = new Card(card.GetValue()-1,Card.SPADES);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (card.GetValue() > 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.SPADES8])){\t \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.SPADES8] = new Card(card.GetValue()+1,Card.SPADES);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\t \t\t\t\n \t\t\tbreak;\n \t\t\t\n\t \t}\n\t \n\t }\n\t return ret;\n }", "private void resume() { player.resume();}", "private static void playBlackjack(Player player) {\n\t\t//Delete hands of previous games.\n\t\tplayer.getReady();\n\t\t\n\t\t//Create the dealer.\n\t\tDealer dealer = new Dealer();\n\t\t\n\t\t//Deal two cards to each player.\n\t\tplayer.addCard(deck.dealCard());\n\t\tplayer.addCard(deck.dealCard());\n\t\t\n\t\tdealer.addCard(deck.dealCard());\n\t\tdealer.addCard(deck.dealCard());\n\t\t\n\t\t//Check if anyone has Blackjack.\n\t\tif (dealer.hasBlackjack()) {\n\t\t\tconsole.println(\"Your hand:\" + player.getHand());\n\t\t\tconsole.println(\"Dealer hand:\" + dealer.getHand());\n\t\t\tconsole.println(\"\\n*******************\\n\" +\n\t\t\t\t\t\"Blackjack! You lose!!\" +\n\t\t\t\t\t\"\\n*******************\\n\");\n\t\t\tconsole.println(\"Press <Enter> to continue.\");\n\t\t\tplayer.pay();\n\t\t\treturn;\n\t\t}\n\t\tif (player.hasBlackjack()) {\n\t\t\tconsole.println(\"Dealer hand:\" + dealer.getHand());\n\t\t\tconsole.println(\"Your hand:\" + player.getHand());\n\t\t\tconsole.println(\"\\n*******************\\n\" +\n\t\t\t\t\t\"Blackjack! You lose!!\" +\n\t\t\t\t\t\"\\n*******************\\n\");\n\t\t\tconsole.println(\"Press <Enter> to continue.\");\n\t\t\tplayer.collect();\n\t\t\treturn;\n\t\t\t\n\t\t}\n\t\t\n\t\t//Now the real game begins. Player play first.\n\t\t//Must play all the hands until dealer's turn.\n\t\tboolean dealerTurn = false;\n\t\t\n\t\tconsole.println(String.format(\"\\n\\nDealer first card: %s\", dealer.getFirstCard()));\n\t\t\n\t\twhile (!dealerTurn) { //Player keep playing as long as she can/wants\n\t\t\t\n\t\t\t//Player can have multiple hands (after split). Should play all of them independently.\n\t\t\tOptional<Hand> optionalPlayingHand = player.getNextPlayableHand();\n\t\t\t\n\t\t\tif (optionalPlayingHand.isPresent()) {\n\t\t\t\t\n\t\t\t\tplayer.setCurrentHand(optionalPlayingHand.get());\n\t\t\t\t\n\t\t\t\tconsole.println(\"Your playing hand:\" + player.getHand());\n\t\t\t\tconsole.print(\"Please, select an option: \");\n\t\t\t\tconsole.println(\"(1) Hit (2) Stand (3) Double Down (4) Split (5) Surrender\");\n\t\t\t\tint option = scanner.nextInt();\n\t\t\t\t\n\t\t\t\tswitch (UserAction.valueOf(option)) {\n\t\t\t\t\tcase HIT:\n\t\t\t\t\t\tconsole.println(\"You've chosen: HIT\");\n\t\t\t\t\t\tplayer.hit(deck.dealCard());\n\t\t\t\t\t\tconsole.println(\"Your resulting hand:\" + player.getHand());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase STAND:\n\t\t\t\t\t\tconsole.println(\"You've chosen: STAND\");\n\t\t\t\t\t\tplayer.stand();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase SPLIT:\n\t\t\t\t\t\tconsole.println(\"You've chosen: SPLIT\");\n\t\t\t\t\t\tif (player.split(deck.dealCard(), deck.dealCard())) {\n\t\t\t\t\t\t\tconsole.println(\"Your hand has been split\");\n\t\t\t\t\t\t\tconsole.println(\"Your resulting hand:\" + player.getHand());\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconsole.println(\"Your hand can not be split. Try another option\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DOUBLE_DOWN:\n\t\t\t\t\t\tconsole.println(\"You've chosen: DOUBLE DOWN\");\n\t\t\t\t\t\tplayer.doubleDown(deck.dealCard());\n\t\t\t\t\t\tconsole.println(\"Your resulting hand:\" + player.getHand());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase SURRENDER:\n\t\t\t\t\t\tconsole.println(\"You've chosen: SURRENDER\");\n\t\t\t\t\t\tif (player.surrender()) {\n\t\t\t\t\t\t\tconsole.println(\"Lose half of your bet.\");\n\t\t\t\t\t\t\tconsole.println(\"Dealer hand:\" + dealer.getHand());\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconsole.println(\"You cannot surrender. Try another option\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tdealerTurn = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//All player's hands are standing or busted\n\t\tfor (Hand hand : player.getHands()) {\n\t\t\tconsole.println(\"Your hand: \" + hand + \" Status: \" + hand.getStatus());\n\t\t}\n\t\t\n\t\tconsole.println(\"\\nDealer hand:\" + dealer.getHand());\n\t\t\n\t\tif (player.isBusted()) {\n\t\t\tconsole.println(\"\\n************\\n\" +\n\t\t\t\t\t\"You lose!!\" +\n\t\t\t\t\t\"\\n************\\n\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tconsole.println(\"\\nDealer turn.\\n\");\n\t\t//Dealer's turn.\n\t\twhile (dealerTurn) {\n\t\t\tUserAction dealerAction = dealer.getNextAction();\n\t\t\tswitch (dealerAction) {\n\t\t\t\tcase HIT:\n\t\t\t\t\tconsole.println(\"Dealer HIT\");\n\t\t\t\t\tdealer.hit(deck.dealCard());\n\t\t\t\t\tconsole.println(\"Dealer resulting hand:\" + dealer.getHand());\n\t\t\t\t\tbreak;\n\t\t\t\tcase STAND:\n\t\t\t\t\tconsole.println(\"Dealer STAND\");\n\t\t\t\t\tdealer.stand();\n\t\t\t\t\tdealerTurn = false;\n\t\t\t\t\tbreak;\n\t\t\t\tcase DONE:\n\t\t\t\t\tdealerTurn = false;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tconsole.println(\"Dealer hand:\" + dealer.getHand());\n\t\tif (dealer.isBusted()) {\n\t\t\t//Dealer is busted. Player wins!\n\t\t\tconsole.println(\"\\n************\\n\" +\n\t\t\t\t\t\"You win!!\" +\n\t\t\t\t\t\"\\n************\\n\");\n\t\t\tplayer.collect();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//Check if dealer won\n\t\tif (dealer.hasBlackjack()) {\n\t\t\tconsole.println(\"\\n******************************************************\\n\" +\n\t\t\t\t\t\"There is a tie!. Dealer wins. Its a casino after all\" +\n\t\t\t\t\t\"\\n******************************************************\\n\");\n\t\t\tplayer.pay();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tconsole.println(\"\\n*****************************************************************\\n\");\n\t\tfor (Hand hand : player.getNonBustedHands()) {\n\t\t\tif (hand.getValue() > dealer.getValue()) {\n\t\t\t\t//Player has a better hand. Hand wins.\n\t\t\t\tconsole.println(\"You have a winner hand :\" + hand);\n\t\t\t\tplayer.collect(hand);\n\t\t\t} else {\n\t\t\t\t//Player's hand lose\n\t\t\t\tconsole.println(\"You have a losing hand :\" + hand);\n\t\t\t\tif (hand.getValue() == dealer.getValue()) {\n\t\t\t\t\tconsole.println(\"Remember: in a tie, you lose!\");\n\t\t\t\t}\n\t\t\t\tplayer.pay(hand);\n\t\t\t}\n\t\t}\n\t\tconsole.println(\"\\n*****************************************************************\\n\");\n\t}", "public void tryStand() {\n if(player.getHand().size() > 0){\n firstStand = true;\n dealerTurn(1);\n } else{\n errorFlag = true;\n userMessage = \"You must get your initial hand dealt before you can stand\";\n }\n\n\n }", "@Test\n public void CardRequirementError() {\n MSG_ACTION_ACTIVATE_LEADERCARD message = new MSG_ACTION_ACTIVATE_LEADERCARD(0);\n DevelopmentCard card1 = new DevelopmentCard(1, Color.GREEN, 0, null, null);\n p.getDevelopmentSlot().addCard(card1, 1);\n c.emptyQueue();\n assertFalse(am.activateLeaderCard(p, message));\n assertEquals(MessageType.MSG_ERROR, c.messages.get(0).getMessageType());\n assertEquals(1, c.messages.size());\n }", "public abstract CardAction play(Player p);", "void askDevCardProduction();", "void playMonopolyCard(String resource);", "protected final void hit() throws InsufficientCardsException {\n hand.add(deck.deal());\n update();\n }", "public void playerLost()\r\n {\r\n \r\n }", "public static void handleDream(Player player) {\n\t\t\n\t}", "public void failedMultiPlayer() {\r\n\t\tmultiplayer.setEnabled(true);\r\n\t\tToast.makeText(this, R.string.con_err, Toast.LENGTH_LONG)\r\n\t\t .show();\r\n\t}", "public void startGame() {\n this.deck = new Deck();\n this.deck.shuffle(); //shuffle the deck\n Card card = this.deck.deal(this.getPlayerHand());\n card = this.deck.deal(this.getPlayerHand());\n card = this.deck.deal(this.getDealerHand());\n }", "public void onPlayStart(){\n\n\t}", "public static void hitCorrect()\n\t{\n\t\tplayersCards.add(deck.deal());\n\t\tcurrentValue();\n\t\tuserCardImg[playersCards.size()-1].setIcon(new ImageIcon(Gameplay.class.getResource(getCard(playersCards.get(playersCards.size()-1)))));\n\t\tresume();\n\t\tif(calculateHand(playersCards)>21 || playersCards.size()==4 || calculateHand(playersCards)==0)\n\t\t{\n\t\t\troundEnd();\n\t\t}\n\t\t\n\t}", "void playerUsedCard(Card c, boolean discard) {\n\t\t// The creator data is in the 2 first bytes, the other player in the 2\n\t\t// last bytes.\n\t\tplayedCard[0] = (discard ? DISCARDED_CARD : PLAYED_CARD);\n\t\tplayedCard[1] = (byte) c.id;\n\t}", "public void wrong()\n\t{\n\t\tMediaPlayer wrong = MediaPlayer.create(this, R.raw.wrong);\n\t\twrong.start();\n\t}", "public void catchCard(){\r\n changePlace(deck);\r\n changePlace(hand);\r\n }", "public void nextStepInGame(View view){\n // called by click on either card, so need to track state\n Log.d(getClass().toString(),\"playstate before = \" + playstate.toString());\n\n playstate = playstate.getNext();\n Log.d(getClass().toString(),\"playstate after update = \" + playstate.toString());\n ImageButton computerCard = (ImageButton) findViewById(R.id.computerCard);\n ImageButton youCard = (ImageButton) findViewById(R.id.youCard);\n TextView infoPanel = (TextView) findViewById(R.id.info_panel);\n switch (playstate){\n case NOCARDS: {\n // show empty buttons as no cards on table\n computerCard.setImageResource(R.color.holo_green_dark);\n computerCard.setVisibility(View.VISIBLE);\n youCard.setImageResource(R.color.holo_blue_dark);\n youCard.setVisibility(View.VISIBLE);\n infoPanel.setText(\"Click to deal cards to both players\");\n\n break;\n }\n case DEALCARDS: {\n // show backs of cards ready to play them\n computerCard.setImageResource(R.drawable.card_back);\n computerCard.setVisibility(View.VISIBLE);\n youCard.setImageResource(R.drawable.card_back);\n youCard.setVisibility(View.VISIBLE);\n infoPanel.setText(\"Click to reveal cards\");\n break;\n }\n case SHOWCARDS: {\n // playARound, but only show card faces\n game.playARound();\n String cardToShow = this.game.getTurnlog().lastEntryFor(game.getPlayers()[1]).getHand().topShownCard().toDrawableName();\n computerCard.setImageResource(getResources().getIdentifier(cardToShow, \"drawable\", \"com.codeclan.cardgame\"));\n cardToShow = this.game.getTurnlog().lastEntryFor(game.getPlayers()[0]).getHand().topShownCard().toDrawableName();\n youCard.setImageResource(getResources().getIdentifier(cardToShow, \"drawable\", \"com.codeclan.cardgame\"));\n\n infoPanel.setText(getString(R.string.computer_label) + \" has \" +\n game.getPlayers()[1].getScore().toString() + \" points,\\n\" +\n getString(R.string.player_label) + \" has \" +\n game.getPlayers()[0].getScore().toString() + \" points.\\n Click for clear table\") ;\n\n break;\n }\n\n }\n if( game.isOver() ){\n//\n// break out of onClick loop by going to new activity to display results\n//\n Intent resultsIntent = new Intent(this, G2P1CHWResultsActivity.class);\n resultsIntent.putExtra(\"player1score\", game.getPlayers()[0].getScore());\n resultsIntent.putExtra(\"dealerscore\", game.getPlayers()[1].getScore());\n resultsIntent.putExtra(\"winner\", game.winner().getName());\n\n startActivity(resultsIntent);\n }\n\n }", "public void currentPlayerDrawCard() {\n Player currentPlayer = turnManager.currentPlayer();\n UnoCard newCard = getNextCard();\n currentPlayer.obtainCard(newCard);\n\n for (GameListener gameListener : gameListeners) {\n gameListener.cardDrawn();\n }\n\t}", "void askLeaderCardThrowing();", "@Override\r\n\t\t\tpublic void playGame() {\n\t\t\t\tSystem.out.println(\"隐式调用接口\");\r\n\t\t\t}", "@Override\n\tpublic void play() {\n\t\t\n\t}", "private void BlueEatsPlayer(Player player)\n {\n Player player_to_be_eaten = null;\n try\n {\n BluePlayer player_to_eat = (BluePlayer) player;\n player_to_be_eaten = checkIfEatsRedPlayer(player_to_eat);\n if (player_to_be_eaten == null)\n {\n player_to_be_eaten = checkIfEatsGreenPlayer(player_to_eat);\n if (player_to_be_eaten == null)\n {\n player_to_be_eaten = checkIfEatsYellowPlayer(player_to_eat);\n }\n }\n //player_to_be_eaten.println(\"blue_player_to_be_eaten\" + player_to_be_eaten.toString());\n if (player_to_be_eaten != null)\n {\n playPersonEatenMusic();\n returnPlayerHome(player_to_be_eaten);\n }\n }\n catch (Exception e)\n {\n \n }\n return;\n }", "private void reportPlay (Player player) {\n System.out.println(\"Player \" + player.name() +\n \" takes \" + player.numberTaken() +\n \" stick(s), leaving \" + game.sticksLeft()\n + \".\");\n }", "public void SpecialCardAction(UNOCard aCard) {\n\t\t\n\t\tif (aCard.getName() == \"Reverse\") { // Reverse card is played, so game direction is switched\n\t\t\tif (gameDirection == \"right\") {\n\t\t\t\tgameDirection = \"left\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\tgameDirection = \"right\";\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (aCard.getName() == \"Skip\") {\n\t\t\tif (gameDirection == \"right\") { // If Game is moving in one direction\n\t\t\t\tcurrentPlayerToPlayIndex = currentPlayerToPlayIndex + 2; // player next to play is skipped\n\t\t\t\tif (currentPlayerToPlayIndex >= players.size()) {\n\t\t\t\t\tcurrentPlayerToPlayIndex = currentPlayerToPlayIndex - players.size();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (gameDirection == \"left\") { // If Game is moving in other direction\n\t\t\t\tcurrentPlayerToPlayIndex = currentPlayerToPlayIndex - 2; // player next to play is skipped\n\t\t\t\tif (currentPlayerToPlayIndex <= 0) {\n\t\t\t\t\tcurrentPlayerToPlayIndex = currentPlayerToPlayIndex + players.size();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tcurrentPlayerToPlay = players.get(currentPlayerToPlayIndex); // Next Player to play a card\n\t\t\n\t\tif (aCard.getName() == \"Draw Two\") { // If a Draw Two Card is played, the enxt player to play is dealt two cards\n\t\t\tif (gameDirection == \"right\") {\n\t\t\t\tif (currentPlayerToPlayIndex < players.size()) {\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (gameDirection == \"left\") {\n\t\t\t\tif (currentPlayerToPlayIndex != 0) {\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (aCard.getName() == \"Wild\") { // Wild is played, function called to ask user for new color\n\t\t\tWildIsPlayedAskUserForColor();\n\t\t}\n\t\t\n\t\tif (aCard.getName() == \"Wild Draw Four\") {\n\t\t\tif (gameDirection == \"right\") { // if game direction is this way\n\t\t\t\tif (currentPlayerToPlayIndex < players.size()) {\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard()); // draw four cards\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard()); // draw four cards\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (gameDirection == \"left\") { // if game direction is this way\n\t\t\t\tif (currentPlayerToPlayIndex != 0) {\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard()); // draw four cards\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard()); // draw four cards\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t}\n\t\t\tWildIsPlayedAskUserForColor();\n\t\t}\n\t\t\n\t}", "public void play() {\n\t\t\r\n\t}", "void makePlay(int player) {\n }", "@Override\n protected void receiveInfo(GameInfo info) {\n if (!(info instanceof PalaceGameState)) {\n return;\n }\n PalaceGameState state = new PalaceGameState((PalaceGameState) info);\n PalaceSelectCardAction selectCardAction;\n if (state.getTurn() != this.playerNum) {\n return;\n } else {\n sleep(1000); // make the computer \"think\"\n boolean isBigger = false;// variable to check if they have a valid card\n\n //determines if the cards are valid\n if (!(state.getP2Hand().isEmpty()) && !state.getPlayPilePalaceCards().isEmpty()) {\n for (int i = 0; i < state.getP2Hand().size(); i++) {\n if (state.getP2Hand().get(i).getRank() > state.getPlayPilePalaceCards().\n get(state.getPlayPilePalaceCards().size() - 1).getRank()) {\n isBigger = true;\n }\n }\n }\n\n //takes pile if they have no hand cards to play\n if (isBigger == false && !(state.getP2Hand().isEmpty())) {\n PalaceTakePileAction take = new PalaceTakePileAction(this);\n Log.d(\"compPlayer\", \"took the pile\");\n this.game.sendAction(take);\n }\n\n //begins searching for a card to select\n PalaceCard cardToSelect = null;\n\n // check in the case when the play pile and their hand are both not empty\n if (!(state.getPlayPilePalaceCards().isEmpty()) && (!(state.getP2Hand().isEmpty()))) {\n\n // while they haven't selected a card or the card they selected is less than the top card\n // another card is selected at random from their hand\n while (cardToSelect == null ||\n (cardToSelect.getRank() <\n (state.getPlayPilePalaceCards().\n get(state.getPlayPilePalaceCards().size() - 1).getRank()) &&\n state.getPlayPilePalaceCards().\n get(state.getPlayPilePalaceCards().size() - 1).getRank() >=0)) {\n cardToSelect =\n state.getP2Hand().get((int) (Math.random() * state.getP2Hand().size()));\n }\n\n // selects a card when they are playing from their top cards\n } else if (state.getP2Hand().isEmpty() && (!(state.getP2TopPalaceCards().isEmpty()))) {\n\n //pick any random card if the play pile is empty\n if (state.getPlayPilePalaceCards().isEmpty()) {\n cardToSelect =\n state.getP2TopPalaceCards().\n get((int) (Math.random() * state.getP2TopPalaceCards().size()));\n }\n\n //play pile is not empty so find a valid card\n else {\n\n //checks to see if there is a valid card\n for (int i = 0; i < state.getP2TopPalaceCards().size(); i++) {\n if (state.getP2TopPalaceCards().get(i).getRank() >\n state.getPlayPilePalaceCards().\n get(state.getPlayPilePalaceCards().size() - 1).getRank() &&\n state.getPlayPilePalaceCards().\n get(state.getPlayPilePalaceCards().size() - 1).getRank() >= 0) {\n isBigger = true;\n }\n }\n\n //finds a random valid card because there is one that is valid\n if (isBigger) {\n while (cardToSelect == null ||\n (cardToSelect.getRank() <\n state.getPlayPilePalaceCards().\n get(state.getPlayPilePalaceCards().size() - 1).\n getRank() &&\n state.getPlayPilePalaceCards().\n get(state.getPlayPilePalaceCards().size() - 1).\n getRank() >= 0)) {\n cardToSelect =\n state.getP2TopPalaceCards().\n get((int) (Math.random() * state.\n getP2TopPalaceCards().size()));\n }\n }\n\n //no card to be played so take the pile\n else {\n PalaceTakePileAction take = new PalaceTakePileAction(this);\n Log.d(\"compPlayer\", \"took the pile\");\n this.game.sendAction(take);\n }\n }\n }\n\n //they only have bottom cards left, all are valid to be played so pick a random one\n else if (state.getP2TopPalaceCards().isEmpty()&&state.getP2Hand().isEmpty()) {\n cardToSelect =\n state.getP2BottomPalaceCards().\n get((int) (Math.random() * state.getP2BottomPalaceCards().size()));\n }\n\n //the play pile is empty and they only have hand cards, pick one at random\n else {\n cardToSelect =\n state.getP2Hand().get((int) (Math.random() * state.getP2Hand().size()));\n }\n\n //create and send the select card action with the selected card\n selectCardAction = new PalaceSelectCardAction(this, cardToSelect,\n state.getSelectedPalaceCards());\n this.game.sendAction(selectCardAction);\n\n //rerun selectCardAction if there are multiple of the same card\n if (!state.getP2Hand().isEmpty()) {\n for (int i = 0; i < state.getP2Hand().size(); i++) {\n if (state.getP2Hand().get(i).getRank() == cardToSelect.getRank() &&\n !cardToSelect.equals(state.getP2Hand().get(i))) {\n selectCardAction = new PalaceSelectCardAction(this, state.getP2Hand().get(i),\n state.getSelectedPalaceCards());\n this.game.sendAction(selectCardAction);\n }\n }\n }\n else if (state.getP2Hand().isEmpty() && !state.getP2TopPalaceCards().isEmpty()) {\n for (int i = 0; i < state.getP2Hand().size(); i++) {\n if (state.getP2Hand().get(i).getRank() == cardToSelect.getRank() &&\n !cardToSelect.equals(state.getP2TopPalaceCards().get(i))) {\n selectCardAction = new PalaceSelectCardAction(this, state.getP2TopPalaceCards().get(i),\n state.getSelectedPalaceCards());\n this.game.sendAction(selectCardAction);\n }\n }\n }\n\n //creates and sends the playCardAction\n PalacePlayCardAction playCardAction = new PalacePlayCardAction(this);\n this.game.sendAction(playCardAction);\n }\n\n\n }", "public void playerWon()\r\n {\r\n \r\n }", "public void playCard(IPlayer owner){\n // Wont play card unless a player has it\n if(command == \"Move1\"){\n owner.Move(owner.getPlayerDir());\n }\n else if(command == \"Move2\"){\n for (Integer i=0; i < 2; i++) {\n owner.Move(owner.getPlayerDir());\n }\n }\n else if(command == \"Move3\"){\n for (Integer i=0; i < 3; i++) {\n owner.Move(owner.getPlayerDir());\n }\n }\n else if (command == \"MoveBack\"){\n owner.Move(dirCtrl.invertDirection(owner.getPlayerDir()));\n }\n else if(command == \"TurnRight\"){\n owner.Turn(TurnDirection.RIGHT);\n }\n else if(command == \"TurnLeft\"){\n owner.Turn(TurnDirection.LEFT);\n }\n else if(command == \"Turn180\"){\n owner.Turn(TurnDirection.BACKWARDS);\n }\n }", "public Card playCard()\n {\n\n Card errorReturn = new Card('E', Card.Suit.spades); // in rare cases\n\n if (numCards == 0)\n return errorReturn;\n else\n return myCards[--numCards];\n }", "@Override\n\tpublic void play() {\n\t\tSystem.out.println(\"We played Snokker today\");\n\t\t\n\t\t\n\t}", "@Override\n public void playStart() {\n }", "@Test(expected = IllegalArgumentException.class)\n public void startPlayTest4() {\n GenericStandardDeckGame g = new GenericStandardDeckGame();\n g.startPlay(0, g.getDeck());\n }", "void onStartGameRequested();", "public void playBlackjack() {\n\t\tString choice;\n\t\t\n\t\tSystem.out.println(\"Welcome to Blackjack! \\n\");\n\t\tSystem.out.println(\"Dealing hands \\n\");\n\t\tdeck.shuffle();\n\t\tplayer.setHand(deck.drawHand());\n\t\tdealer.setHand(deck.drawHand());\n\t\t\n\t\t\n\t\tif(checkForBlackjack(player) && checkForBlackjack(dealer)) {\n\t\t\tSystem.out.println(showHands());\n\t\t\tSystem.out.println(\"Both player's have blackjack! \\n\");\n\t\t}\n\t\telse if(checkForBlackjack(player)) {\n\t\t\tSystem.out.println(showHands());\n\t\t\tSystem.out.println(\"Player has blackjack! You win! \\n\");\n\t\t}\n\t\telse if(checkForBlackjack(dealer)) {\n\t\t\tSystem.out.println(showHands());\n\t\t\tSystem.out.println(\"Dealer has blackjack! Dealer wins! \\n\");\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(showInitinalHand());\n\t\t\twhile(player.getHandVal() < 21) {\n\t\t\t\tSystem.out.println(\"Player's turn. Pick to hit or stand \\n\");\n\t\t\t\tchoice = scanner.nextLine().toUpperCase();\n\t\t\t\tif(choice.equals(\"STAND\") || choice.equals(\"S\")) {\n\t\t\t\t\tSystem.out.println(\"Player stands \\n\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse if(choice.equals(\"HIT\")|| choice.equals(\"H\")) {\n\t\t\t\t\tSystem.out.println(\"Player hits \\n\");\n\t\t\t\t\tplayer.addCard(deck.drawCard());\n\t\t\t\t\tSystem.out.println(showInitinalHand());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.println(\"Invalid input \\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile(dealer.getHandVal() < 17) {\n\t\t\t\tSystem.out.println(\"Dealer hits \\n\");\n\t\t\t\tdealer.addCard(deck.drawCard());\n\t\t\t\tSystem.out.println(showHands());\n\t\t\t}\n\t\t\tSystem.out.println(showHands());\n\t\t}\n\t\tcheckWinner();\n\t\tif(result.equals(\"TIE\")) {\n\t\t\tSystem.out.println(\"The result is a tie! \\n\");\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"The winner is the \" + result + \"!\\n\");\n\t\t}\n\t}", "public boolean needPlayer() {\n\t\treturn false;\n\t}", "public void playGame() {\n show();\n while (gameStatus) {\n if (canPut(players.get((state.getTurn())))) {\n int choice = -1;\n while (gameStatus) {\n choice = controls.get(state.getTurn()).putCard(currentCard);\n if (validInput(players.get((state.getTurn())), choice)) {\n System.out.println(players.get(state.getTurn()).getCards().get(choice).toString());\n try{Thread.sleep(1000);}catch(InterruptedException ignored){}\n break;\n }\n }\n decide(players.get(state.getTurn()), players.get(state.getTurn()).getCards().get(choice));\n }\n try{Thread.sleep(500);}catch(InterruptedException ignored){}\n checkFinish();\n if (gameStatus) {\n state.nextTurn();\n show();\n }\n }\n }", "private void playNextPlayer() {\n \n PlayerId nextPlayer = state.nextPlayer();\n players.get(nextPlayer).setHelp(state, handsOfCards.get(nextPlayer), nextPlayer);\n Card c = players.get(nextPlayer).cardToPlay(state, handsOfCards.get(nextPlayer));\n state = state.withNewCardPlayed(c);\n \n handsOfCards.put(nextPlayer, handsOfCards.get(nextPlayer).remove(c));\n players.get(nextPlayer).updateHand(handsOfCards.get(nextPlayer));\n \n for (Map.Entry<PlayerId, Player> pId: players.entrySet()) {\n pId.getValue().updateTrick(state.trick());\n }\n players.get(nextPlayer).resetHelp();\n }", "@Test(expected = NotPlayingException.class)\n public void not_allow_picking_cards_if_not_playing(){\n\n Deck deck = new Deck();\n Game game = new Game(deck);\n\n game.join(\"susan\");\n\n game.pickCard(\"susan\");\n }", "private void playTurn()\n {\n try\n {\n XMLHandler.saveGame(game, GAME_CLONE_PATH);\n }\n catch(IOException | JAXBException | SAXException ex)\n {\n // TODO... ConsoleUtils.message(\"An internal save error has occured, terminating current game\");\n gameEnded = true;\n return;\n }\n \n moveCycle();\n \n if (!game.validateGame()) \n {\n IllegalBoardPenalty();\n }\n \n String gameOverMessage = game.isGameOver();\n if (gameOverMessage != null) \n {\n //TODO: ConsoleUtils.message(gameOverMessage);\n gameEnded = true;\n }\n \n game.switchPlayer();\n }", "public void hitCard() {\n if (this.state == GameState.ROUNDACTIVE) {\n Seat s = this.getSeat(seatPlaying);\n if (s.hasPlayer()) {\n Hand h = s.getPlayer().getHands().get(0);\n h.addCard(this.deck.dealCard());\n if (h.getIsBusted()) {\n this.activeHandStand();\n }\n }\n repaintAll();\n }\n }", "@Override\n\tpublic void play() {\n\n\t}", "private void play() {\n\t\tParcel pc = Parcel.obtain();\n\t\tParcel pc_reply = Parcel.obtain();\n\t\ttry {\n\t\t\tSystem.out.println(\"DEBUG>>>pc\" + pc.toString());\n\t\t\tSystem.out.println(\"DEBUG>>>pc_replay\" + pc_reply.toString());\n\t\t\tib.transact(1, pc, pc_reply, 0);\n\t\t} catch (RemoteException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "private static void playGame() {\n CardDeck deck = new CardDeck();\n int dealer, player, hitOrStand = 1, score = 0;\n System.out.println(\"Goal: Beat the dealer without going over 21\");\n Scanner input = new Scanner(System.in);\n\n // Generate the dealer's card\n dealer = generateRandomNumber(16, 21); \n System.out.println(\"The Dealer scored: \" + dealer);\n System.out.println(\"\");\n \n\n // Keep playing while the player hasn't won or lost yet\n while (hitOrStand == 1 && score < 21 && score < dealer) {\n // Generate player's card\n player = generateRandomNumber(1, 10); \n System.out.println(\"Your card is worth \" + player);\n\n // Displays the picture of player's card\n String card = deck.drawCard(player);\n System.out.println(card);\n\n // Add player's card value to their score\n score = score + player;\n\n // Displays score and asks wether user wants to hit or stand\n if (score <= 21 && score < dealer) {\n System.out.println(\"Your score is \" + score);\n System.out.print(\"Another card? Hit=1 stand=0: \");\n hitOrStand = input.nextInt();\n System.out.println(\"\");\n }\n }\n \n // Display player won\n if (score > dealer && score <= 21 ) {\n System.out.println(\"You win!\");\n System.out.println(\"Your score is \" + score);\n System.out.println(\"The dealer score was \" + dealer);\n System.out.println(\"You were closer to 21 by \" + (score - dealer));\n\n // Display when player ties with dealer\n } else if (score == dealer) {\n System.out.println(\"Your score is \" + score);\n System.out.println(\"\");\n System.out.println(\"You tied!\");\n\n // Display if player lost\n } else if (score > 21) {\n System.out.println(\"Your score is \" + score);\n System.out.println(\"\");\n System.out.println(\"You lose!\");\n int over = score - 21;\n System.out.println(\"You were over 21 by \" + over);\n\n // Display if player lost\n } else {\n int difference;\n difference = dealer - score;\n System.out.println(\"Your score is \" + score);\n System.out.println(\"You lose!\");\n System.out.println(\"The dealer was closer to 21 than you by \" + difference);\n } \n }", "public Player switchPlayer(){\n Player player = getGame().getCurrentPlayer();\n\n List<Card> cards = new ArrayList<>();\n\n for(Card card: getGame().getCards()){\n if(card.rule.isValid(getGame().getDices())){\n cards.add(card);\n }\n }\n\n //get the best card\n if(!cards.isEmpty()){\n Card card = takeTheBestCard(cards);\n\n //add it to the player\n player.getCardsWon().add(card);\n getGame().getCards().remove(card);\n\n System.out.println(player.getName() + \" won \" + card.getExplaination());\n getGame().addAction(new Action(player.getName() + \" won \" + card.getExplaination()));\n }\n\n if(getGame().getCards().isEmpty()){\n game.setStatus(Game.GameStatus.COMPLETED);\n getGame().addAction(new Action(bestPlayer().getName() + \" WON THE GAME!!!\"));\n }\n //turn\n getGame().setCountOfTrialForPlayer(0);\n\n game.setIndexOfCurrentPlayer(game.getIndexOfCurrentPlayer()+1);\n\n if(game.getIndexOfCurrentPlayer() == getGame().getPlayers().size()){\n game.setIndexOfCurrentPlayer(0);\n }\n\n game.setCountOfTrialForPlayer(0);\n game.setDices(new ArrayList<>());\n\n return getGame().getCurrentPlayer();\n }", "public boolean playCard(Card card){\n boolean b = effectHandler.playCard( card , null);\n return b;\n }", "@Override\n\tpublic void onStandDown(PlatformPlayer player) {\n\t\t\n\t}", "private void RedEatsPlayer(Player player)\n {\n Player player_to_be_eaten = null;\n try\n {\n RedPlayer player_to_eat = (RedPlayer) player;\n player_to_be_eaten = checkIfEatsBluePlayer(player_to_eat);\n if (player_to_be_eaten == null)\n {\n player_to_be_eaten = checkIfEatsGreenPlayer(player_to_eat);\n if (player_to_be_eaten == null)\n {\n player_to_be_eaten = checkIfEatsYellowPlayer(player_to_eat);\n }\n }\n\n //player_to_be_eaten.println(\"red_player_to_be_eaten\" + player_to_be_eaten.toString());\n if (player_to_be_eaten != null)\n {\n playPersonEatenMusic();\n returnPlayerHome(player_to_be_eaten);\n }\n }\n catch (Exception e)\n {\n \n }\n return;\n }", "public void howToPlay() {\r\n // An item has been added to the ticket. Fire an event and let everyone know.\r\n System.out.println(\"Step 1: Have no life. \\nStep 2: Deal cards\\nStep 3: Cry yourself to sleep.\");\r\n }", "private void playGame() throws IOExceptionFromController {\n for (Player player : players) {\n if (player.getGodCard().hasAlwaysActiveModifier()) game.addModifier(player.getGodCard());\n }\n while (!game.hasWinner()) {\n if (!running.get()) return;\n Player currentPlayer = players.get(game.getActivePlayer());\n for (Card modifier : game.getActiveModifiers()) {\n if (!modifier.hasAlwaysActiveModifier() && modifier.getController().getPlayer().equals(currentPlayer))\n game.removeModifier(modifier);\n }\n\n broadcastGameInfo(\"turnStart\");\n String result = playerControllers.get(game.getActivePlayer()).playTurn();\n switch (result) {\n case \"next\":\n checkWorkers();\n game.nextPlayer();\n break;\n case \"outOfMoves\":\n case \"outOfBuilds\":\n case \"outOfWorkers\":\n eliminatePlayer(currentPlayer, result);\n game.nextPlayer();\n break;\n case \"winConditionAchieved\":\n case \"godConditionAchieved\":\n setWinner(currentPlayer, result);\n break;\n default:\n logError(\"invalid turn\");\n break;\n }\n }\n gameOver();\n }", "@Override\n\tpublic void nowPlaying() {\n\t}", "private void resume()\r\n {\r\n player.resume();\r\n }", "void askBuyDevCards();", "@Override\n public void keyPressed(KeyEvent e) {\n player.keyPressed(e); // tell player a key has been pressed\n if (e.getKeyCode() == KeyEvent.VK_X && player.invulnerableTime <= 0 && spellCards > 0){ // player cast spell card\n spellCards --;\n audioloader.play(\"spark\");\n player.invulnerableTime = 5.0 * FPS;\n }\n if (e.getKeyCode() == KeyEvent.VK_C){ // toggle hitbox\n if (player.invulnerableTime <= 0)\n player.invulnerableTime = 10000000;\n else\n player.invulnerableTime = 0;\n }\n if (e.getKeyCode() == KeyEvent.VK_ENTER && entityloader.frame >= levelEnd){ // advance to next level\n gameResult = 1;\n }\n if (e.getKeyCode() == KeyEvent.VK_A){ // add life\n lives++;\n }\n }", "@Override\n\tpublic void onRun(PlatformPlayer player) {\n\t\t\n\t}", "public void playTurn() {\r\n\r\n }", "public void play(){\n\t\t\n\t}", "@Override\r\n\tpublic boolean canPlay() {\n\t\treturn false;\r\n\t}", "@Override\n public void landedOn(Player player) {}", "void askLeaderCardActivation();", "public void startGame() {\n int numberOFPlayers = view.askForNumberOfPlayers();\n\n // adding dealer...\n players.add(dealer);\n //...and players to 'players' ArrayList\n for (int i = 1; i < numberOFPlayers; i++) {\n players.add(new RegularPlayer(i + 1));\n }\n\n // dealing cards to players\n dealer.dealCardsToPlayers(players);\n // Game\n while (!(players.size() == 1)) {\n\n for (int i = 0; i < players.size(); i++) {\n\n // printowanie ilości kart kazdego z graczy dla testów\n if (checkGameStatus()) {\n try {\n // display no of cards for each player\n for (Player player : players) {\n view.print(\"Player \" + player.getPlayerId() + \" no of cards: \" + player.getCardsCount());\n }\n\n round(players.get(i), players);\n } catch (IndexOutOfBoundsException e) {\n continue;\n }\n } else {\n break;\n }\n }\n }\n }", "public void playCard(int index) {\r\n\t\tCard c = deck.hand.get(index);\r\n\t\tif(c.isAction() && actions > 0 && access.gamePhase < 2) {\r\n\t\t\taccess.gamePhase = 1;\r\n\t\t\tif(!deck.play.contains(new Champion())) actions--;\r\n\t\t\tdeck.playCard(index);\r\n\t\t\tc.performAction();\r\n\t\t\tnotifyObservers();\r\n\t\t}\r\n\t\telse if(c.isTreasure() && access.gamePhase < 3) {\r\n\t\t\taccess.gamePhase = 1;\r\n\t\t\taddTreasure(c.getTreasure());\r\n\t\t\tdeck.playCard(index);\r\n\t\t\tc.performAction();\r\n\t\t\tnotifyObservers();\r\n\t\t}\r\n\t}", "@Override\n\t\tpublic void onLoaded(String arg0) {\n\t\t\t\tplayer.play();\n\t\t}", "public void preGame() {\n\n\t}", "public boolean mayPickup(Player debug1) {\n/* 112 */ return true;\n/* */ }", "public void handStarted(int position, GameState gs, Card[] cards) {\r\n }", "public void notifyPlayer(CardGraphics card){\n\t\tchosenCard = card.getCard();\n\t\t\n\t\tsynchronized(lock){\n\t\t\tlock.notify();\n\t\t}\n\t}" ]
[ "0.7410453", "0.73236656", "0.7311895", "0.72207314", "0.7068116", "0.7020802", "0.69322014", "0.67434806", "0.67256624", "0.6723173", "0.67121774", "0.66599023", "0.6587916", "0.6584277", "0.6574833", "0.6503764", "0.6488757", "0.6448004", "0.6388153", "0.63467383", "0.6314477", "0.6306998", "0.6296475", "0.6295797", "0.62936634", "0.6273792", "0.6270514", "0.62347686", "0.620201", "0.61843264", "0.61834466", "0.6169335", "0.61391383", "0.6132726", "0.61325717", "0.6132546", "0.613123", "0.6129976", "0.60923535", "0.6088289", "0.60844296", "0.6081897", "0.6077734", "0.60744494", "0.6029949", "0.602286", "0.60199267", "0.6014058", "0.6009962", "0.60083634", "0.59989756", "0.5990809", "0.59907186", "0.5987374", "0.5977484", "0.5975476", "0.59673506", "0.5965718", "0.5964075", "0.5957182", "0.5955525", "0.59544873", "0.5952262", "0.594589", "0.59418106", "0.5935631", "0.593338", "0.5929108", "0.59286714", "0.59182394", "0.59161097", "0.59140366", "0.59122413", "0.59088665", "0.59071153", "0.59028935", "0.58980364", "0.58968556", "0.5895106", "0.5893146", "0.5884195", "0.5883881", "0.58797926", "0.58772844", "0.58766794", "0.58701295", "0.586893", "0.5867332", "0.5865806", "0.586558", "0.58652776", "0.5862953", "0.5858327", "0.585111", "0.58481234", "0.5837304", "0.58372176", "0.5836926", "0.5834252", "0.5829728", "0.5828033" ]
0.0
-1
This method is called whenever the user is trying to place a road on the map. It is called by the view for each "mouse move" event. The returned value tells the view whether or not to allow the road to be placed at the specified location.
boolean canPlaceRoad(EdgeLocation edgeLoc, boolean free);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract boolean canMoveTo(Case Location);", "boolean hasLocationView();", "@Override\n public void onLongPress(MotionEvent event) { Place a new Route Point\n //\n switch (event.getActionMasked())\n {\n case MotionEvent.ACTION_DOWN:\n {\n //Log.i(\"onLongPress\", \"This is a onLongPress (ACTION_DOWN) event...\");\n if (routeVisuals.selectedWaypoint != null) {\n movingRoutePoint = true;\n placingRoutePoint = false;\n }\n else {\n placingRoutePoint = true;\n movingRoutePoint = false;\n }\n\n super.getLocationForPoint(new PointF(event.getX(), event.getY()), new LocationReceiver() {\n @Override\n public void receiveLocation(Location location) {\n if (!movingRoutePoint) {\n Log.w(\"onLongPress\", \"lon:\" + location.longitude + \" lat:\" + location.latitude);\n Coordinate c = new Coordinate(location.longitude, location.latitude);\n WithinAirspaceCheck check = new WithinAirspaceCheck(MyMapView.this.context, c);\n check.SetOnFoundAirspace(new WithinAirspaceCheck.OnFoundAirspace() {\n @Override\n public void OnFoundAirspace(Airspace airspace) {\n Log.i(TAG, \"Found: \" + airspace.Name);\n if (onFoundAirspace != null)\n onFoundAirspace.OnFoundAirspace(airspace);\n }\n\n @Override\n public void OnFoundAllAirspaces(Airspaces airspaces) {\n Log.i(TAG, \"Total airspaces : \" + airspaces.size());\n if (onFoundAirspace != null)\n onFoundAirspace.OnFoundAllAirspaces(airspaces);\n }\n });\n\n\n check.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);\n }\n\n }\n });\n\n break;\n }\n }\n\n// super.getLocationForPoint(new PointF(event.getX(), event.getY()), new ConvertPointCallback(){\n// @Override\n// public void convertComplete(Location loc) {\n// //Log.w(\"onLongPress\", \"lon:\" + loc.longitude + \" lat:\" + loc.latitude);\n//\n// if (placingRoutePoint) {\n// String name = loc.longitude + \",\" + loc.latitude;\n// routeVisuals.AddWaypoint(name, loc);\n//\n// //placingRoutePoint = false;\n// movingRoutePoint = true;\n// // insert the new point\n//\n// }\n//\n//\n// }});\n\n super.onLongPress(event);\n }", "@SuppressWarnings({\"SameParameterValue\", \"unused\"})\n public static void allowAccessToLocation(final Boolean value) {\n sAccessToLocation = value;\n }", "public boolean canMove() {\n\n\tArrayList<Location> moveLocs = getValid(getLocation());\n\n\tif (isEnd == true) {\n\t return false;\n\t} \n\tif (!moveLocs.isEmpty()) {\n\t \n\t randomSelect(moveLocs);\n\t // selectMoveLocation(moveLocs);\n\t return true;\n\n\t} else {\n\t return false;\n\t}\n }", "boolean hasDistanceView();", "public abstract boolean canMove();", "boolean canMove();", "public boolean canGetLocation() {\r\n return canGetLocation;\r\n }", "public boolean canMove(Location loc){\n if(loc.getX() >= theWorld.getX() || loc.getX() < 0){\n System.out.println(\"cant move1\");\n return false;\n }else if(loc.getY() >= theWorld.getY() || loc.getY() < 0){\n System.out.println(\"cant move2\");\n return false;\n }else{\n System.out.println(\"can move\");\n return true;\n }\n }", "public abstract boolean isAllowableMovement(int[] location, double[] direction);", "public Boolean isRoad() {\r\n\t \treturn this.road;\r\n\t }", "void checkMyLocationVisibility() {\n if (settings.getReturnToMyLocation() || presenter.isTracking())\n showMyLocation();\n }", "public void myLocationClick() {\n\n //Set the initial camera position to the current location\n GridPoint gridPoint = myGridPoint();\n float mpp = 1;\n\n if (gridPoint != null) {\n\n CameraPosition cameraPosition = new CameraPosition(gridPoint, mpp);\n mMap.moveCamera(cameraPosition, true);\n\n } else {\n\n //If GPS is off, notify the user to turn it on\n Toast.makeText(MainActivity.this,\"Turn on GPS.\",Toast.LENGTH_SHORT).show();\n\n }\n\n }", "boolean hasLocation();", "boolean hasLocation();", "boolean hasUserLocationView();", "public boolean canGetLocation() {\r\n return this.canGetLocation;\r\n }", "public boolean canMove()\n {\n return canMove;\n }", "public boolean setTurnOnLocation() {\n boolean isTurn = checkTurnOnLocation();\n editor.putBoolean(Constans.KeyPreference.TURN_ON_LOCATION, !isTurn);\n editor.commit();\n return !isTurn;\n }", "public boolean canGetLocation() {\n return this.canGetLocation;\n }", "public boolean canGetLocation() {\n return this.canGetLocation;\n }", "public boolean canGetLocation() {\n return this.canGetLocation;\n }", "public boolean allowMove(Point p, int pos);", "private boolean canMove(Location location) {\n if (location == null) return false;\n return location.getWorld().intersects(this, Util.getRectangle(location, size)) == null && location.getY() >= 0 && location.getX() >= 0;\n }", "@Override\n\t\t\tpublic void onMapClick(LatLng arg0) {\n\t\t\t\tfinal LatLng location = arg0;\n \tAlertDialog builder = new AlertDialog.Builder(MainActivity.this)\n\t .setMessage(\"Do you want to add your location here?\")\n\t .setPositiveButton(\"Yes\", new DialogInterface.OnClickListener() {\n\t public void onClick(DialogInterface dialog, int id) {\n\t \t setFlag = true;\n\t \t myLocation = location;\n\t \t //use this flag to indicate that we want to see the path from current location or a set point\n\t \t Log.d(\"my location:\", \"\"+myLocation.latitude + myLocation.longitude);\n\t \t if(setFlag == true){\n\t \t\t if(myMarker != null){\n\t\t \t\t myMarker.remove();\n\t\t \t }\n\t\t \t myMarker = mMap.addMarker(new MarkerOptions().position(myLocation).title(\"myLocation\").draggable(true)\n\t\t \t\t\t\t\t\t.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_BLUE)));\n\t\t \t\t\t\t landmarks.addMarker(\"myLocation\", myMarker);\n\t \t } \n\t }\n\t })\n\t .setNegativeButton(\"Not now\", new DialogInterface.OnClickListener() {\n\t public void onClick(DialogInterface dialog, int id) {\n\t // User cancelled the dialog\n\t }\n\t }).create();\n \tbuilder.show();\n\t\t\t}", "boolean isPlaced();", "@Override\r\n\tpublic void placeRoad(EdgeLocation edgeLoc) {\n\t\t\r\n\t}", "private boolean setLocationInformation() {\n try {\n this.mPostModel.setLocationPost(mAutoCompleteTextView.getText().toString());\n\n if (StringEmptyUtil.isEmptyString(this.mPostModel.getLocationPost())) {\n Toast.makeText(getApplicationContext(), \"Please Select Location\", Toast.LENGTH_LONG).show();\n return false;\n }\n\n this.drop_location.setVisibility(View.VISIBLE);\n this.location_view.setVisibility(View.VISIBLE);\n this.current_location.setVisibility(View.VISIBLE);\n this.current_location.setText(this.mPostModel.getLocationPost());\n return true;\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n Toast.makeText(getApplicationContext(), \"Please Select Location\", Toast.LENGTH_LONG).show();\n\n return false;\n }", "@Override\n public boolean isLocationValid(int x, int y)\n {\n return master.isLocationValid(x, y);\n }", "public boolean wander() {\n\t\tMapLocation target = sensor.findTargetLocation();\n\t\treturn(nav.moveToLocation(target));\n\t}", "boolean CanUseRoadBuilder(EdgeLocation spot1, EdgeLocation spot2);", "private boolean canMove() {\n\t\tif (System.currentTimeMillis() - lastTrunTime < 300) {// move time is\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 300ms before\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// last move\n\t\t\treturn false;\n\t\t}\n\t\tboolean status = false;\n\t\tif(stage == 1){\n\t\t\tmap = GameView.map;\n\t\t}else if(stage == 2){\n\t\t\tmap = GameViewStage2.map;\n\t\t}else {\n\t\t\tmap = GameViewStage3.map;\n\t\t}\n\t\tif (direction == UP) {// when tank moves up\n\t\t\tif (centerPoint.getY() - speed >= 0) {\n\t\t\t\tif (map[(centerPoint.getY() - speed) / UNIT][centerPoint\n\t\t\t\t\t\t.getX() / UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() - speed) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() + UNIT) / UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() - speed) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() + 2 * UNIT) / UNIT] == 0) {\n\t\t\t\t\tstatus = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (direction == DOWN) {\n\t\t\tif (centerPoint.getY() + tankBmp.getHeight() + speed < screenHeight) {\n\t\t\t\tif (map[(centerPoint.getY() + 2 * UNIT + speed) / UNIT][centerPoint\n\t\t\t\t\t\t.getX() / UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + 2 * UNIT + speed)\n\t\t\t\t\t\t\t\t/ UNIT][(centerPoint.getX() + UNIT) / UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + 2 * UNIT + speed)\n\t\t\t\t\t\t\t\t/ UNIT][(centerPoint.getX() + 2 * UNIT) / UNIT] == 0) {\n\t\t\t\tstatus = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (direction == LEFT) {\n\n\t\t\tif (centerPoint.getX() - speed >= 0) {\n\t\t\t\tif (map[centerPoint.getY() / UNIT][(centerPoint.getX() - speed)\n\t\t\t\t\t\t/ UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + UNIT) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() - speed) / UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + 2 * UNIT) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() - speed) / UNIT] == 0) {\n\t\t\t\t\tstatus = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (direction == RIGHT) {\n\t\t\tif (centerPoint.getX() + tankBmp.getWidth() + speed < screenWidth) {\n\t\t\t\tif (map[centerPoint.getY() / UNIT][(centerPoint.getX()\n\t\t\t\t\t\t+ 2 * UNIT + speed)\n\t\t\t\t\t\t/ UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + UNIT) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() + 2 * UNIT + speed)\n\t\t\t\t\t\t\t\t/ UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + 2 * UNIT) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() + 2 * UNIT + speed)\n\t\t\t\t\t\t\t\t/ UNIT] == 0) {\n\t\t\t\t\tstatus = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (status)\n\t\t\tlastTrunTime = System.currentTimeMillis();\n\t\treturn status;\n\t}", "public boolean placementDone() {return placedShips == 4;}", "public boolean canMove() {\n return (Math.abs(getDist())>=50);\n }", "private void fineLocationPermissionGranted() {\n UtilityService.addGeofences(this);\n UtilityService.requestLocation(this);\n }", "public void relocateToPoint(boolean isUserClick){\n// System.out.println(\"Scene x: \"+point.getX()+\", y: \"+point.getY());\n// System.out.println(\"Local x: \"+getParent().sceneToLocal(point).getX()+\", y: \"+getParent().sceneToLocal(point).getY());\n// System.out.println(\"Relocate x: \"+(getParent().sceneToLocal(point).getX() - (getWidth() / 2))+\", y: \"+(getParent().sceneToLocal(point).getY() - (getHeight() / 2)));\n// System.out.println(getBoundsInLocal().getWidth());\n// System.out.println(widthProperty());\n\n if (isUserClick) {\n double new_x=getParent().sceneToLocal(x,y).getX();\n double new_y=getParent().sceneToLocal(x,y).getY();\n setX(new_x);\n setY(new_y);\n relocate(\n// (getParent().sceneToLocal(x,y).getX() - (widthCountry / 2)),\n// (getParent().sceneToLocal(x,y).getY() - (heightCountry / 2))\n new_x,new_y\n );\n } else {\n relocate(x,y);\n }\n\n\n }", "private boolean isLocationAllowed() {\n int result = ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION);\r\n\r\n //If permission is granted returning true\r\n if (result == PackageManager.PERMISSION_GRANTED)\r\n return true;\r\n\r\n //If permission is not granted returning false\r\n return false;\r\n }", "public boolean canMove() {\n\t\tArrayList<Location> loc = getValid(getLocation());\n\t\tif (loc.isEmpty()) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\tpath.add(getLocation());\n\t\t\tif (loc.size() >= 2) {\n\t\t\t\tcrossLocation.push(path);\n\t\t\t\tpath = new ArrayList<Location>();\n\t\t\t\tnext = betterDir(loc);\n\t\t\t}\n\t\t\tnext = loc.get(0);\n\t\t}\n\t\treturn true;\n\t}", "public abstract boolean canMove(int originX, int originY, int destX, int destY);", "@Override\n\t\t\tpublic boolean onMyLocationButtonClick() {\n\t\t\t\tsupportClassObj.fitInMap(parentActivity.getItinerary(), googlemap, parentActivity);\n\t\t\t\treturn true;\n\t\t\t}", "boolean hasLatLng();", "public abstract boolean actualPlace(int row, int col);", "private void startTrackingRoute(){\n if(ContextCompat.checkSelfPermission(this, ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED){\n //Starts up alert dialog for getting permission\n ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, REQUEST_LOC_PERMISSION);\n }\n else{\n //Start the location updater listener\n locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, MIN_DISTANCE, this);\n }\n }", "@Override\r\n public boolean onTap(GeoPoint arg0, MapView arg1) {\n if(getMyLocation()!=null){\r\n int size = 30;\r\n Point out=new Point();\r\n mMapView.getProjection().toPixels(getMyLocation(), out); \r\n Rect rect = new Rect(out.x-size,out.y-size,out.x+size,out.y+size);\r\n mMapView.getProjection().toPixels(arg0, out);\r\n if(rect.contains(out.x, out.y)){\r\n //Log.e(\"MyLocation\", \"click my location \");\r\n mPopView.setVisibility(View.GONE);\r\n MapView.LayoutParams params = (MapView.LayoutParams) mPopView.getLayoutParams();\r\n params.x = 0;// Y轴偏移\r\n params.y = -5;// Y轴偏移\r\n GeoPoint point = getMyLocation().e();\r\n params.point = point;\r\n //mMapCtrl.animateTo(point);\r\n mMapView.updateViewLayout(mPopView, params);\r\n mPopView.setVisibility(View.VISIBLE);\r\n }else{\r\n mPopView.setVisibility(View.GONE) ; \r\n }\r\n }\r\n return super.onTap(arg0, arg1);\r\n }", "public void checkLocationPermission() {\n try {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n if (checkPermission(Manifest.permission.ACCESS_FINE_LOCATION, getActivity(), getActivity())) {\n if (checkPermission(Manifest.permission.ACCESS_COARSE_LOCATION, getActivity(), getActivity())) {\n gpsTracker.getLocation();\n } else {\n requestPermission(android.Manifest.permission.ACCESS_COARSE_LOCATION, PERMISSION_REQUEST_CODE_LOCATION, getActivity().getApplicationContext(),\n getActivity());\n }\n } else {\n requestPermission(android.Manifest.permission.ACCESS_FINE_LOCATION, PERMISSION_REQUEST_CODE_LOCATION, getActivity().getApplicationContext(),\n getActivity());\n }\n } else {\n gpsTracker.getLocation();\n }\n } catch (Exception e) {\n // logException(e, \"GpsMapManualFragment_checkLocationPermission()\");\n }\n\n\n }", "public boolean mapsToPlace(Place where) {\n\t\treturn false;\r\n\t}", "public boolean isPlaceable() {\n\t\tlong now = Calendar.getInstance().getTimeInMillis();\t\t\n\t\treturn now - createTime >= placeableThreshold && \n\t\t\t\tnow - focusTime >= placeableThreshold;\n\t}", "public void move (View view){\n\n if (toyRobotIsActive){//only run code after PLACE is DONE\n\n if (orientation == 0) {//Move while Facing North\n\n if((robot.getTranslationY()/perUnitY*(-1)) >=4) {\n System.out.println(\"Out of Bounds\");//Chk Error in Logs\n errorMessage(\"Out of Bounds\");//Error display to user via Toast\n } else {\n robot.animate().translationYBy(-perUnitY).setDuration(50);\n } //move robot 1 unit\n\n } else if (orientation == 3 || orientation == -1) {//Facing West\n if((robot.getTranslationX()/perUnitX) <= 0) {\n System.out.println(\"Out of Bounds\");\n errorMessage(\"Out of Bounds\");\n } else {\n robot.animate().translationXBy(-perUnitX).setDuration(50);\n }\n\n\n } else if (orientation == 2 || orientation == -2) {//Facing South\n if((robot.getTranslationY()/perUnitY)*(-1) <= 0){\n System.out.println(\"Out of Bounds\");\n errorMessage(\"Out of Bounds\");\n } else {\n robot.animate().translationYBy(perUnitY).setDuration(50);\n }\n\n\n } else if (orientation == 1 || orientation == -3) {//Facing East\n if((robot.getTranslationX()/perUnitX) >=4){\n System.out.println(\"Out of Bounds\");\n errorMessage(\"Out of Bounds\");\n } else {\n robot.animate().translationXBy(perUnitX).setDuration(50);\n }\n }\n } else errorMessage(\"Please place toy robot\"); //button not active if\n }", "@Override\n public void receiveLocation(Location loc) {\n if (movingRoutePoint)\n routeVisuals.dragSelectedWaypoint(loc);\n\n }", "public boolean canMoveTo(Position position){\n if(position.x > mapSize.x || position.x < 0 || position.y > mapSize.y || position.y < 0){\n return false;\n }\n return !isOccupied(position);\n }", "@FXML\n private void mouseMove(MouseEvent event) {\n SolarSystem mouseOver = findClosestSolarSystem(new Point((int) event.getX() - 5, (int) event.getY() - 5));\n if (mouseOver != null) {\n drawUniverse();\n g.setStroke(Color.WHITE);\n g.setFill(Color.WHITE);\n g.strokeOval(event.getX() - 15, event.getY() - 15, 30, 30);\n g.fillText(mouseOver.name(), event.getX(), event.getY());\n if (travelable.contains(mouseOver)) {\n double radx = ((player.getCurrentSolarSystem().getX() * UNIVERSE_SCALE) - mapOffsetX - dragOffsetX) + (512 - mapOffsetX - dragOffsetX);\n double rady = ((player.getCurrentSolarSystem().getY() * UNIVERSE_SCALE) - mapOffsetY - dragOffsetY) + (288 - mapOffsetY - dragOffsetY);\n g.strokeLine(radx, rady, event.getX(), event.getY());\n }\n } else {\n drawUniverse();\n }\n }", "boolean canMoveTo(Vector2d position);", "@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n mMap.getUiSettings().setCompassEnabled(true);\n String mPermission = Manifest.permission.ACCESS_FINE_LOCATION;\n // if Permission not already given\n if (ActivityCompat.checkSelfPermission(getContext(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(getContext(), Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n ActivityCompat.requestPermissions(getActivity(), new String[]{mPermission}, REQUEST_CODE_PERMISSION);\n Toast.makeText(getContext(), \"Location permission not granted\", Toast.LENGTH_SHORT).show();\n // checkLocationPermission();\n return;\n } else {\n mMap.setMyLocationEnabled(true);\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n getDeviceLocation();\n init();\n }\n if(sharedPref.getString(\"shared_status\",null).equalsIgnoreCase(\"User\")) { // if user in show driver\n showNearBy();\n }\n mMap.setOnMapClickListener(new GoogleMap.OnMapClickListener() {\n @Override\n public void onMapClick(LatLng latLng) {\n if (mPreviousMarker != null) {\n mPreviousMarker.remove();\n mPreviousMarker = mMap.addMarker(new MarkerOptions().position(latLng).title(\"Destination\"));\n // Toast.makeText(getContext(), mPreviousMarker.getSnippet(), Toast.LENGTH_LONG).show();\n }\n else\n mPreviousMarker = mMap.addMarker(new MarkerOptions().position(latLng).title(\"Destination\"));\n }\n });\n\n mMap.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() {\n @Override\n public boolean onMarkerClick(Marker marker) {\n // Toast.makeText(getContext(), \"MARKER CLICKED \"+marker.getTitle(), Toast.LENGTH_SHORT).show();\n if(!marker.getTitle().equalsIgnoreCase(\"Destination\")) {\n if(mPreviousMarker !=null) // destination is marked\n show_card(marker.getTitle(),true,mlocation,mPreviousMarker);\n else\n show_card(marker.getTitle(),false,mlocation,mPreviousMarker);\n }else\n mPreviousMarker.getSnippet();\n\n return false;\n }\n });\n }", "public boolean canMove (Location loc) {\n Grid<Actor> gr = getGrid();\n if (gr == null)\n return false;\n if (!gr.isValid(loc))\n return false;\n Actor neighbor = gr.get(loc);\n return !(neighbor instanceof Wall);\n }", "private boolean atLeastOneNonWallLocation() {\n\t\tfor (int x = 0; x < this.map.getMapWidth(); x++) {\n\t\t\tfor (int y = 0; y < this.map.getMapHeight(); y++) {\n\n\t\t\t\tif (this.map.getMapCell(new Location(x, y)).isWalkable()) {\n\t\t\t\t\t// If it's not a wall then we can put them there\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "@Override\r\n public boolean canMove() {\r\n Grid<Actor> gr = getGrid();\r\n int dirs[] = {\r\n Location.AHEAD, Location.HALF_CIRCLE, Location.LEFT,\r\n Location.RIGHT };\r\n // 当终点在周围时,不能移动且isEnd应当为true\r\n for (int i = 0; i < dirs.length; i++) {\r\n Location tarLoc = getLocation().getAdjacentLocation(dirs[i]);\r\n if (gr.isValid(tarLoc) && gr.get(tarLoc) != null) {\r\n // Color直接用==计算竟然不可行(真是哔了dog...\r\n if (gr.get(tarLoc) instanceof Rock\r\n && gr.get(tarLoc).getColor().equals(Color.RED)) {\r\n isEnd = true;\r\n return false;\r\n }\r\n }\r\n }\r\n ArrayList<Location> nextLocs = getValid(getLocation());\r\n // 当附近没有可以移动的位置时,不能移动\r\n if (nextLocs.size() == 0) {\r\n return false;\r\n }\r\n // 当可以移动的位置>1时,说明存在一个节点,这个节点应当被新建一个arraylist入栈\r\n if (nextLocs.size() > 1) {\r\n ArrayList<Location> newStackElem = new ArrayList<Location>();\r\n newStackElem.add(getLocation());\r\n crossLocation.push(newStackElem);\r\n }\r\n // 有可以移动的位置时,向概率最高的方向移动\r\n int maxProbLoc = 0;\r\n // 由于nextLocs不一定有4个location,所以只好循环判断取最大值\r\n for (int i = 0; i < nextLocs.size(); i++) {\r\n Location loc = nextLocs.get(i);\r\n int dirNum = getLocation().getDirectionToward(loc) / 90;\r\n if (probablyDir[dirNum] > probablyDir[maxProbLoc]) {\r\n maxProbLoc = i;\r\n }\r\n }\r\n next = nextLocs.get(maxProbLoc);\r\n return true;\r\n }", "private boolean canMove() {\n return !(bestMove[0].getX() == bestMove[1].getX() && bestMove[0].getY() == bestMove[1].getY());\n }", "public void setRoad(Boolean bool) {\r\n\t \tthis.road = bool;\r\n\t }", "public void randomHit() throws LocationHitException{\r\n\t\t// Random ran = new Random();\r\n\t\tint x = randomX();\r\n\t\tint y = randomY();\r\n\r\n\t\tboolean newHit = false;\r\n\t\twhile (!newHit) {\r\n\t\t\tif (Player.userGrid[x][y] == 2) {\r\n\t\t\t\tx = ran.nextInt(9);\r\n\t\t\t\ty = ran.nextInt(11);\r\n\t\t\t} else\r\n\t\t\t\tnewHit = true;\r\n\t\t}\r\n\t\tint hitCoord[] = { x, y };\r\n\t\tsetCoords(hitCoord);\r\n\t\tString coordx = Integer.toString(x);\r\n\t\tString coordy = Integer.toString(y);\r\n\t\tif (Player.userGrid[x][y] == 1) {\r\n\t\t\t// change the grid value from 1 to 2 to signify hit\r\n\t\t\tPlayer.userGrid[x][y] = 2;\r\n\t\t\t\r\n\t\t\tif(!time1) {\r\n\t\t\t\ttimea=java.lang.System.currentTimeMillis();\r\n\t\t\t\ttime1=!time1;\r\n\t\t\t}else if(!time2) {\r\n\t\t\t\ttimeb=java.lang.System.currentTimeMillis();\r\n\t\t\t\t\ttime2=!time2;\r\n\t\t\t}else {\r\n\t\t\t\tdouble t=timeb-timea;\r\n\t\t\t\tif(t<3000) {\r\n\t\t\t\t\tsetScore(20);\r\n\t\t\t\t}\r\n\t\t\t\ttime1=false;\r\n\t\t\t\ttime2=false;\r\n\t\t\t\ttimea=0;\r\n\t\t\t\ttimeb=0;\r\n\t\t\t\t\r\n\t\t\t}//if time between consecutive hit is less than 3 seconds ,then bonus score\r\n\t\t\tsetScore(10);\r\n\t\t\tPlayer.coordinatesHit.add(coordx + \",\" + coordy);\r\n\t\t\tsetReply(\"It's a Hit!!!!!\");\r\n\r\n\t\t} else if (Player.userGrid[x][y] == 0) {\r\n\t\t\tPlayer.userGrid[x][y] = 3;\r\n\t\t\tsetScore(-1);\r\n\t\t\tsetReply(\"It's a miss!!!!!\");\r\n\t\t} else if (Player.userGrid[x][y] == 2 || Player.userGrid[x][y] == 3) {\r\n\t\t\tsetReply(\"The location has been hit earlier\");\r\n\t\t\t //throw new LocationHitException(\"The location has been hit earlier\");\r\n\t\t}\r\n\t}", "@Override public void onLocationChanged(Location location) {\n if (mCurrentLocation == null) {\n map.getController().animateTo(new GeoPoint(location));\n }\n\n mCurrentLocation = location;\n\n long currentTime = System.currentTimeMillis();\n\n if (networkLocationIgnorer.shouldIgnore(location.getProvider(), currentTime))\n return;\n\n double dT = currentTime - mLastTime;\n if (dT < 200.0){\n return;\n };\n\n mLastTime = currentTime;\n\n if (!currentLocationOverlay.isEnabled()){\n currentLocationOverlay.setEnabled(true);\n }\n\n currentLocationOverlay.setLocation(new GeoPoint(location));\n currentLocationOverlay.setBearing(location.getBearing());\n currentLocationOverlay.setAccuracy((int) location.getAccuracy());\n\n // Navigation mode\n if (mNavigationMode) {\n if(!mNavigationRunning) {\n // Location for the first time -> get road\n mNavigationRunning = true;\n\n ArrayList<GeoPoint> wayPoints = new ArrayList<GeoPoint>();\n // Start location\n wayPoints.add(new GeoPoint(location));\n // Destination location\n wayPoints.add(getLocationFromAddress(destinationAddress));\n\n new RoadTask().execute(wayPoints);\n }\n else if (mNextNode != null) {\n GeoPoint currentGeoPoint = new GeoPoint(mCurrentLocation);\n int distance = currentGeoPoint.distanceTo(mNextNode.mLocation);\n boolean readInstructions = false;\n\n // TODO: Test which distance is good for marking node as reached\n // TODO: Preveri kako zaznati ali je šel čez node\n // TODO: Povej navodila tik preden zavije\n if ( distance < 4 ) {\n map.getController().animateTo(new GeoPoint(location));\n\n // Node reached, increase node index\n mNodeIndex++;\n\n if (mNodeIndex >= mRoad.mNodes.size()) {\n // Last node reached - turn navigation off\n mNavigationMode = false;\n mNavigationRunning = false;\n mNextNode = null;\n mCurrentNode = null;\n mNodeIndex = 0;\n\n Button button = (Button)findViewById(R.id.current_instruction_button);\n button.setVisibility(View.GONE);\n\n Button buttonFavPaths = (Button)findViewById(R.id.favourite_paths_button);\n buttonFavPaths.setVisibility(View.VISIBLE);\n }\n else {\n // Get next node\n mCurrentNode = mNextNode;\n mNextNode = mRoad.mNodes.get(mNodeIndex);\n\n readInstructions = true;\n }\n }\n else if (distance < 6) {\n readInstructions = true;\n }\n\n // Set new instruction\n setInstruction(readInstructions);\n }\n }\n\n map.invalidate();\n }", "public boolean isCanTravel() {\n return canTravel;\n }", "public void mapIsClicked(View view) {\n Controller.viewMappa();\n }", "@Override\n protected void checkLocation() {\n // nothing\n }", "@Override\r\n\tpublic boolean canMove() {\r\n\t\treturn false;\r\n\t}", "@objid (\"7f09cb7d-1dec-11e2-8cad-001ec947c8cc\")\n public boolean allowsMove() {\n return true;\n }", "public boolean canDoBuyRoad(){\n\t\t // If the player doesn't have resources for a road, or has already played all his roads, he can't buy another\n\t\t if(resourceCardHand.canDoPayForRoad() == false || playerPieces.hasAvailableRoad() == false) {\n\t\t\t return false;\n\t\t }\n\t\t if(playerPieces.getNumberOfRoads() > 13){\n\t\t\t return true;\n\t\t }\n\t\t // If the player has no legal place to put a road on the map, he shouldn't be allowed to buy one.\n\t\t if(playerPieces.canPlaceARoadOnTheMap() == false) {\n\t\t\t return false;\n\t\t }\n\t\t return true;\n\t }", "private static boolean canMove() {\n return GameManager.getCurrentTurn();\r\n }", "public boolean canMove() {\r\n return (state == State.VULNERABLE || state == State.INVULNERABLE);\r\n\r\n }", "@Override\n public void onCameraMove() {\n if(!markerClickflag)\n showMarkerButtons(false);\n }", "@Override//an ok la tu dong bat len can cai requet\n public boolean onMyLocationButtonClick() {\n if (Util.isGpsOpen(context)) {\n\n getMyLocation();//cho nay da co gps(di chuyen den vi tri cua minh va lay vi tri cua minh)\n\n return true;//no bat roi he thong lam tiesp ,\n } else {//bat GPS\n\n reqquestGps();\n return false;\n }\n//return true;\n// return false;//false la de mình lam xong no lam iep lý tiep con true thì no dung ơ ngay cho do\n }", "@Override\n public void onMouseClicked(MapMouseEvent ev) {\n \tint respuesta= JOptionPane.showConfirmDialog(null, \"¿Desea guardar este punto?\", \"Confirmar\",JOptionPane.YES_NO_OPTION);\n \tif(respuesta==0) {\n \t\tString texto=JOptionPane.showInputDialog(null, \"Nombre del lugar\");\n \t\tDirectPosition2D p = ev.getWorldPos();\n System.out.println(p.getX() + \" -- \" + p.getY());\n drawMyPoint(p.getX(), p.getY(), map, texto);\n \t}\n \telse{\n \t\tSystem.out.println(\"Punto no guardado\");\n \t}\n \n }", "private boolean placeFlag(Location m) {\r\n\r\n // if the game is finished then nothing to do\r\n if (gameState > STARTED) {\r\n return false;\r\n } \r\n \r\n // if the location is already revealed then nothing more to do\r\n if (query(m) != GameStateModel.HIDDEN && query(m) != GameStateModel.FLAG) {\r\n return false;\r\n }\r\n \r\n // otherwise toggle the flag\r\n flag[m.x][m.y] = !flag[m.x][m.y];\r\n \r\n if (flag[m.x][m.y]) {\r\n \r\n //if (board[m.x][m.y] != GameState.MINE) {\r\n // System.out.println(\"DEBUG (\" + m.x + \",\" + m.y + \") is not a mine!\");\r\n //}\r\n flagsPlaced++;\r\n } else {\r\n flagsPlaced--;\r\n }\r\n\r\n // call this handle to allow extra logic to be added by the extending class\r\n placeFlagHandle(m);\r\n \r\n return true;\r\n \r\n }", "public boolean isAssignedToLocation() {\n if (location == null) {\n return false;\n }\n return true;\n }", "boolean CanBuyRoad();", "public void onLocationChanged(Location location) {\n\n if (net_connection_check()) {\n\n String message = String.format(\n\n \"New Location \\n Longitude: %1$s \\n Latitude: %2$s\",\n\n location.getLongitude(), location.getLatitude());\n\n // *************************** GPS LOCATION ***************************\n\n\n driveruserid = User_id;\n driverlat = location.getLatitude();\n driverlong = location.getLongitude();\n\n\n Location driverLocation = new Location(\"user location\");\n driverLocation.setLatitude(driverlat);\n driverLocation.setLongitude(driverlong);\n\n aController.setDriverLocation(driverLocation);\n\n String drivercurrentaddress = lattoaddress(driverlat, driverlong);\n\n\n if (!checktripend && mGoogleMap != null) {\n // mGoogleMap.clear();\n\n\n }\n LatLng mark1 = new LatLng(driverlat, driverlong);\n\n if (logoutcheck) {\n//\t\t\tDriverdetails();\n }\n\n LatLng target = new LatLng(driverlat, driverlong);\n\n String check = fullbutton.getText().toString();\n if (acc.equals(\"yes\") || check.equals(\"End Trip\")) {\n if (check.equals(\"End Trip\")) {\n // mGoogleMap.clear();\n // mGoogleMap.setTrafficEnabled(true);\n }\n origin = new LatLng(driverlat, driverlong);\n /* try{\n String url = getDirectionsUrl(origin, dest);\n drawMarker(dest);\n DownloadTask downloadTask = new DownloadTask();\n //Start downloading json data from Google Directions API\n downloadTask.execute(url);\n }catch (Exception e){\n\n }*/\n\n// checkOffRouteAndRedrwaRoute(location);\n\n }\n\n checkOffRouteAndRedrwaRoute(location);\n if (location.hasBearing() && mGoogleMap != null) {\n CameraPosition cameraPosition = new CameraPosition.Builder()\n .target(target) // Sets the center of the map to current location\n .zoom(16)\n .bearing(location.getBearing()) // Sets the orientation of the camera to east\n .tilt(0) // Sets the tilt of the camera to 0 degrees\n .build(); // Creates a CameraPosition from the builder\n mGoogleMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));\n }\n }\n }", "boolean getRequireLocationPref();", "public boolean isPlaced() {\n return isPlaced;\n }", "public boolean hasLocation()\n {\n return targetLocation != null;\n }", "public boolean ifRailRoad() {\n return choiceSelect == RAIL_ROAD_CHOICE;\n }", "@Override\n public boolean isLocationValid(XYCoord coords)\n {\n return master.isLocationValid(coords);\n }", "public void mouseMoved(MouseEvent e) {\n if (e.getSource() instanceof MapBean) {\n // only when the mouse has already been pressed\n if (mousePressed) {\n float lat1, lat2, long1, long2;\n // set the map bean\n theMap = (MapBean) (e.getSource());\n // erase the old line and circle first\n paintRubberband(rPoint1, rPoint2);\n // get the current mouse location in latlon\n rPoint2 = theMap.getProjection().inverse(e.getPoint());\n // paint the new line and circle up to the current\n // mouse location\n paintRubberband(rPoint1, rPoint2);\n \n if (infoDelegator != null) {\n Debug.message(\"mousemodedetail\",\n \"DistanceMouseMode: firing mouse location\");\n // lat, lon of anchor point\n lat1 = (float) rPoint1.getY();\n long1 = (float) rPoint1.getX();\n // lat, lon of current mouse position\n lat2 = (float) rPoint2.getY();\n long2 = (float) rPoint2.getX();\n // calculate great circle distance in nm\n // distance = getGreatCircleDist(lat1, long1,\n // lat2, long2, Length.NM);\n distance = (double) GreatCircle.sphericalDistance(ProjMath.degToRad(lat1),\n ProjMath.degToRad(long1),\n ProjMath.degToRad(lat2),\n ProjMath.degToRad(long2));\n \n // calculate azimuth angle dec deg\n float azimuth = getSphericalAzimuth(lat1,\n long1,\n lat2,\n long2);\n // convert total distance into all distance units\n // String distNM =\n // df.format(totalDistance+distance);\n double tmpDistance = totalDistance + distance;\n String infoLine = createDistanceInformationLine(rPoint2,\n tmpDistance,\n azimuth);\n // setup the info event\n InfoDisplayEvent info = new InfoDisplayEvent(this, infoLine, InformationDelegator.COORDINATE_INFO_LINE);\n // ask the infoDelegator to display the info\n infoDelegator.requestInfoLine(info);\n }\n } else {\n fireMouseLocation(e);\n }\n }\n }", "boolean hasGeographicView();", "@OnClick(R.id.toggle_view_action)\n public void onToggleView() {\n logD(\"Be kind and implement map view of landmarks\");\n }", "public boolean isOnLand() {\r\n\t\treturn isOnLand;\r\n\t}", "public boolean place(int posX, int posY, Direction direction) {\r\n\t\tboolean isInvalidPlaceParameter = !tabletop.canMove(posX, posY) || direction == null;\r\n\t\tif (isInvalidPlaceParameter) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tthis.posX = posX;\r\n\t\tthis.posY = posY;\r\n\t\tthis.direction = direction;\r\n\t\treturn true;\r\n\t}", "boolean canPlaceCity(VertexLocation vertLoc);", "public boolean shouldTrack( ScannedRobotEvent e )\r\n {\n return ( enemy.none() || e.getDistance() < enemy.getDistance() - 70\r\n || e.getName().equals( enemy.getName() ) );\r\n }", "boolean land();", "@Override\r\n\t\tpublic boolean onTouchEvent(MotionEvent e, MapView m) {\n\t\t\tif(e.getAction()==MotionEvent.ACTION_DOWN){\r\n\t\t\t\tstart=e.getEventTime();\r\n\t\t\t\tx= (int)e.getX();\r\n\t\t\t\ty= (int)e.getY();\r\n\t\t\t\t touchedPoint = map.getProjection().fromPixels(x, y);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tif(e.getAction()==MotionEvent.ACTION_UP){\r\n\t\t\t\tstop=e.getEventTime();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(stop-start > 1500){\r\n\t\t\t\t//perform action\r\n\t\t\t\t\r\n\t\t\t\talert.setTitle(\"Pick an Option\");\r\n\t\t\t\talert.setMessage(\"Select An Option\");\r\n\t\t\t\t\r\n\t\t\r\n alert.setButton2(\"Toogle View \", new DialogInterface.OnClickListener() {\r\n\t\t\t\t\r\n\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\r\n\t\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\tif(map.isSatellite()){\r\n\t\t\t\t\t\tmap.setSatellite(false);\r\n\t\t\t\t\t\tmap.setStreetView(true);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tmap.setSatellite(true);\r\n\t\t\t\t\t\tmap.setStreetView(false);\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 alert.show();\r\n return true;\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}", "private void showOnMap(Location location) {\n\t\tfinal double RADIUS_KM = 1.5; // the distance, in KM, to show around the point.\n\n\t\tif (!TestHarnessUtils.isTestHarness() && isShowingMap) {\n\t\t\tLatLng gmLocation = new LatLng(location.getLatitude(), location.getLongitude());\n\n\t\t\t// Update user's location marker\n\t\t\tif (this.userMapMarker != null) {\n\t\t\t\tthis.userMapMarker.setPosition(gmLocation);\n\t\t\t}\n\n\t\t\t// For now, just display RADIUS_KM in all directions around the given location.\n\t\t\tLatLng northBounds = LocationUtils.getLocation(gmLocation, 0, RADIUS_KM);\n\t\t\tLatLng southBounds = LocationUtils.getLocation(gmLocation, 180, RADIUS_KM);\n\t\t\tLatLng eastBounds = LocationUtils.getLocation(gmLocation, 90, RADIUS_KM);\n\t\t\tLatLng westBounds = LocationUtils.getLocation(gmLocation, 270, RADIUS_KM);\n\n\t\t\tLatLngBounds bounds;\n\t\t\tint padding;\n\n\t\t\tif (routePolyline == null) {\n\t\t\t\tbounds = LatLngBounds.builder().include(northBounds).include(southBounds).include(eastBounds)\n\t\t\t\t\t\t.include(westBounds).include(gmLocation).build();\n\t\t\t\tpadding = 0;\n\t\t\t} else {\n\t\t\t\tLatLngBounds.Builder builder = LatLngBounds.builder().include(gmLocation);\n\t\t\t\tfor (LatLng pt : routePolyline.getPoints()) {\n\t\t\t\t\tbuilder.include(pt);\n\t\t\t\t}\n\t\t\t\tbounds = builder.build();\n\t\t\t\tpadding = 100;\n\t\t\t}\n\n\t\t\tfinal CameraUpdate camUpdate = CameraUpdateFactory.newLatLngBounds(bounds, padding);\n\n if (this.theMap != null) {\n try {\n this.theMap.moveCamera(camUpdate);\n\n } catch (IllegalStateException ex) {\n // Map not yet initialized.\n logger.info(\"showOnMap(): IllegalStateException when trying to move camera. Will delegate task to listener.\");\n final View mapView = mapFragment.getView();\n if (mapView.getViewTreeObserver().isAlive()) {\n mapView.getViewTreeObserver().addOnGlobalLayoutListener(new OnGlobalLayoutListener() {\n @SuppressWarnings(\"deprecation\")\n @SuppressLint(\"NewApi\")\n @Override\n public void onGlobalLayout() {\n if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {\n mapView.getViewTreeObserver().removeGlobalOnLayoutListener(this);\n } else {\n mapView.getViewTreeObserver().removeOnGlobalLayoutListener(this);\n }\n WorkoutActivity.this.theMap.moveCamera(camUpdate);\n }\n });\n }\n }\n }\n\t\t}\n\t}", "@SuppressWarnings( {\"MissingPermission\"})\n private void enableLocationComponent(@NonNull Style loadedMapStyle) {\n if (PermissionsManager.areLocationPermissionsGranted(this)) {\n\n // Get an instance of the component\n LocationComponent locationComponent = mapBoxMap.getLocationComponent();\n MapActivity.this.locationComponent=locationComponent;\n\n // Activate with options\n locationComponent.activateLocationComponent(\n LocationComponentActivationOptions.builder(this, loadedMapStyle).build());\n\n // Enable to make component visible\n locationComponent.setLocationComponentEnabled(true);\n\n // Set the component's camera mode\n locationComponent.setCameraMode(CameraMode.TRACKING);\n\n // Set the component's render mode\n locationComponent.setRenderMode(RenderMode.COMPASS);\n\n\n } else {\n permissionsManager = new PermissionsManager(this);\n permissionsManager.requestLocationPermissions(this);\n }\n }", "private boolean checkM(){\n if(currentLocation.x == previousLocation.x && currentLocation.y == previousLocation.y) {\n return false;\n }\n // Is outside the border\n if(currentLocation.x < size || currentLocation.y < size || currentLocation.x > map.numRows - size || currentLocation.y > map.numCols - size) {\n return false;\n }\n // Is on the land\n double angle2 = 0;\n while (angle2 < 6.3) {\n if (map.getTerrainGrid()[currentLocation.x + (int) (size/2 * cos(angle2))][currentLocation.y + (int) (size/2 * sin(angle2))] == Colors.OCEAN) {\n return false;\n }\n angle2 += 0.3;\n }\n return true;\n }", "boolean isSetRoadTerrain();", "public final boolean canMove(Coordinates coordinates) {\n Room room = TextRpg.currentRoom();\n if (!room.inBounds(coordinates))\n return false;\n return canMoveCondition(coordinates);\n }", "private boolean roadCheck(Road road) {\n\t\t\n\t\treturn false;\n\t}", "boolean canMove(Tile t);", "public boolean onGround() {\n return getLocation().getY() <= 0 || (interactingWithY != null && interactingWithY.getLocation().getY() + interactingWithY.size.height <= getLocation().getY());\n }", "public boolean onTouchEvent(MotionEvent event) {\r\n int action = event.getActionMasked();\r\n switch (action) {\r\n //if the user touched the screen\r\n case MotionEvent.ACTION_DOWN: {\r\n //check if the input is inside the circle\r\n if(CheckIfInside(event.getX(), event.getY())) {\r\n this.playMoving = true;\r\n }\r\n break;\r\n }\r\n case MotionEvent.ACTION_MOVE: {\r\n if (!this.playMoving)\r\n return true;\r\n //make sure user input is inside limits\r\n if (CheckForLimit(event.getX(), event.getY())) {\r\n this.x = event.getX();\r\n this.y = event.getY();\r\n notifyObservers(normelizeAilron(this.x), normelizeElevator(this.y));\r\n invalidate();\r\n }\r\n break;\r\n }\r\n //user input's is finished\r\n case MotionEvent.ACTION_UP :\r\n this.playMoving = false;\r\n returnDefualt();\r\n //call on draw\r\n invalidate();\r\n }\r\n return true;\r\n }", "public boolean onTouchEvent(MotionEvent event) {\n int action = MotionEventCompat.getActionMasked(event);\n switch (action) {\n\n case MotionEvent.ACTION_DOWN: {\n\n if(CheckIfInside(event.getX(), event.getY())) {\n this.playMoving = true;\n }\n break;\n }\n case MotionEvent.ACTION_MOVE: {\n if (!this.playMoving)\n return true;\n\n if (CheckForLimit(event.getX(), event.getY())) {\n this.x = event.getX();\n this.y = event.getY();\n invalidate();\n ///////////////////////////////////////////////////\n double normalizedX = normalizeAileron(x);\n double normalizedY = normalizeElevator(y);\n TcpClient tcpClient = TcpClient.getInstance();\n tcpClient.sendMessage(\"set controls/flight/aileron \" + normalizedX + \"\\r\\n\");\n tcpClient.sendMessage(\"set controls/flight/elevator \" + normalizedY + \"\\r\\n\");\n }\n break;\n }\n //user input's is finished\n case MotionEvent.ACTION_UP :\n this.playMoving = false;\n returnDefault();\n //call on draw\n invalidate();\n }\n return true;\n }" ]
[ "0.6190127", "0.60914785", "0.59469396", "0.56219566", "0.560707", "0.5565275", "0.5510716", "0.5503927", "0.54991776", "0.5476892", "0.54726803", "0.5467092", "0.5458098", "0.5441365", "0.5436802", "0.5436802", "0.54323167", "0.5399614", "0.5396097", "0.53689545", "0.5359404", "0.5359404", "0.5359404", "0.53537905", "0.53438747", "0.5340449", "0.53398937", "0.53336924", "0.53295416", "0.53274757", "0.531567", "0.53068364", "0.52977645", "0.5287208", "0.525517", "0.52551115", "0.52467304", "0.5228834", "0.52226275", "0.5213076", "0.5190444", "0.51885015", "0.5186369", "0.5179474", "0.515879", "0.5152123", "0.5149506", "0.5146396", "0.51457703", "0.51437235", "0.513758", "0.51374745", "0.513588", "0.51269823", "0.51255554", "0.5113736", "0.51134515", "0.51125467", "0.51112115", "0.51046926", "0.51044893", "0.51021534", "0.50981325", "0.5094361", "0.50881493", "0.507159", "0.5068575", "0.5058001", "0.5055223", "0.5052148", "0.5049566", "0.50492036", "0.50490195", "0.50436956", "0.5043114", "0.50365275", "0.5033447", "0.50300187", "0.50274515", "0.5025415", "0.50229305", "0.5014012", "0.50130343", "0.50061226", "0.5002637", "0.49956402", "0.49943975", "0.49940696", "0.49917242", "0.49905682", "0.4981036", "0.4979359", "0.49741378", "0.49706852", "0.49679247", "0.4962472", "0.49565795", "0.49557006", "0.49526072", "0.49481413" ]
0.55679333
5
This method is called whenever the user is trying to place a settlement on the map. It is called by the view for each "mouse move" event. The returned value tells the view whether or not to allow the settlement to be placed at the specified location.
boolean canPlaceSettlement(VertexLocation vertLoc, boolean free);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean placementDone() {return placedShips == 4;}", "private boolean setLocationInformation() {\n try {\n this.mPostModel.setLocationPost(mAutoCompleteTextView.getText().toString());\n\n if (StringEmptyUtil.isEmptyString(this.mPostModel.getLocationPost())) {\n Toast.makeText(getApplicationContext(), \"Please Select Location\", Toast.LENGTH_LONG).show();\n return false;\n }\n\n this.drop_location.setVisibility(View.VISIBLE);\n this.location_view.setVisibility(View.VISIBLE);\n this.current_location.setVisibility(View.VISIBLE);\n this.current_location.setText(this.mPostModel.getLocationPost());\n return true;\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n Toast.makeText(getApplicationContext(), \"Please Select Location\", Toast.LENGTH_LONG).show();\n\n return false;\n }", "boolean isPlaced();", "boolean hasLocationView();", "public abstract boolean canMoveTo(Case Location);", "@Override\r\n\t\tpublic boolean onTouchEvent(MotionEvent e, MapView m) {\n\t\t\tif(e.getAction()==MotionEvent.ACTION_DOWN){\r\n\t\t\t\tstart=e.getEventTime();\r\n\t\t\t\tx= (int)e.getX();\r\n\t\t\t\ty= (int)e.getY();\r\n\t\t\t\t touchedPoint = map.getProjection().fromPixels(x, y);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tif(e.getAction()==MotionEvent.ACTION_UP){\r\n\t\t\t\tstop=e.getEventTime();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(stop-start > 1500){\r\n\t\t\t\t//perform action\r\n\t\t\t\t\r\n\t\t\t\talert.setTitle(\"Pick an Option\");\r\n\t\t\t\talert.setMessage(\"Select An Option\");\r\n\t\t\t\t\r\n\t\t\r\n alert.setButton2(\"Toogle View \", new DialogInterface.OnClickListener() {\r\n\t\t\t\t\r\n\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\r\n\t\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\tif(map.isSatellite()){\r\n\t\t\t\t\t\tmap.setSatellite(false);\r\n\t\t\t\t\t\tmap.setStreetView(true);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tmap.setSatellite(true);\r\n\t\t\t\t\t\tmap.setStreetView(false);\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 alert.show();\r\n return true;\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}", "public boolean isPlaced() {\n return isPlaced;\n }", "public abstract boolean actualPlace(int row, int col);", "public boolean setTurnOnLocation() {\n boolean isTurn = checkTurnOnLocation();\n editor.putBoolean(Constans.KeyPreference.TURN_ON_LOCATION, !isTurn);\n editor.commit();\n return !isTurn;\n }", "public boolean wander() {\n\t\tMapLocation target = sensor.findTargetLocation();\n\t\treturn(nav.moveToLocation(target));\n\t}", "boolean isSetControlPosition();", "public boolean isPlaceable() {\n\t\tlong now = Calendar.getInstance().getTimeInMillis();\t\t\n\t\treturn now - createTime >= placeableThreshold && \n\t\t\t\tnow - focusTime >= placeableThreshold;\n\t}", "private boolean canMove() {\n\t\tif (System.currentTimeMillis() - lastTrunTime < 300) {// move time is\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 300ms before\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// last move\n\t\t\treturn false;\n\t\t}\n\t\tboolean status = false;\n\t\tif(stage == 1){\n\t\t\tmap = GameView.map;\n\t\t}else if(stage == 2){\n\t\t\tmap = GameViewStage2.map;\n\t\t}else {\n\t\t\tmap = GameViewStage3.map;\n\t\t}\n\t\tif (direction == UP) {// when tank moves up\n\t\t\tif (centerPoint.getY() - speed >= 0) {\n\t\t\t\tif (map[(centerPoint.getY() - speed) / UNIT][centerPoint\n\t\t\t\t\t\t.getX() / UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() - speed) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() + UNIT) / UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() - speed) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() + 2 * UNIT) / UNIT] == 0) {\n\t\t\t\t\tstatus = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (direction == DOWN) {\n\t\t\tif (centerPoint.getY() + tankBmp.getHeight() + speed < screenHeight) {\n\t\t\t\tif (map[(centerPoint.getY() + 2 * UNIT + speed) / UNIT][centerPoint\n\t\t\t\t\t\t.getX() / UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + 2 * UNIT + speed)\n\t\t\t\t\t\t\t\t/ UNIT][(centerPoint.getX() + UNIT) / UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + 2 * UNIT + speed)\n\t\t\t\t\t\t\t\t/ UNIT][(centerPoint.getX() + 2 * UNIT) / UNIT] == 0) {\n\t\t\t\tstatus = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (direction == LEFT) {\n\n\t\t\tif (centerPoint.getX() - speed >= 0) {\n\t\t\t\tif (map[centerPoint.getY() / UNIT][(centerPoint.getX() - speed)\n\t\t\t\t\t\t/ UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + UNIT) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() - speed) / UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + 2 * UNIT) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() - speed) / UNIT] == 0) {\n\t\t\t\t\tstatus = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (direction == RIGHT) {\n\t\t\tif (centerPoint.getX() + tankBmp.getWidth() + speed < screenWidth) {\n\t\t\t\tif (map[centerPoint.getY() / UNIT][(centerPoint.getX()\n\t\t\t\t\t\t+ 2 * UNIT + speed)\n\t\t\t\t\t\t/ UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + UNIT) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() + 2 * UNIT + speed)\n\t\t\t\t\t\t\t\t/ UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + 2 * UNIT) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() + 2 * UNIT + speed)\n\t\t\t\t\t\t\t\t/ UNIT] == 0) {\n\t\t\t\t\tstatus = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (status)\n\t\t\tlastTrunTime = System.currentTimeMillis();\n\t\treturn status;\n\t}", "void checkMyLocationVisibility() {\n if (settings.getReturnToMyLocation() || presenter.isTracking())\n showMyLocation();\n }", "@Override\n public void onMouseClicked(MapMouseEvent ev) {\n \tint respuesta= JOptionPane.showConfirmDialog(null, \"¿Desea guardar este punto?\", \"Confirmar\",JOptionPane.YES_NO_OPTION);\n \tif(respuesta==0) {\n \t\tString texto=JOptionPane.showInputDialog(null, \"Nombre del lugar\");\n \t\tDirectPosition2D p = ev.getWorldPos();\n System.out.println(p.getX() + \" -- \" + p.getY());\n drawMyPoint(p.getX(), p.getY(), map, texto);\n \t}\n \telse{\n \t\tSystem.out.println(\"Punto no guardado\");\n \t}\n \n }", "private void setLocation() {\n switch (getKey()) {\n case UP:\n this.y_location = -136.8 - 6;\n this.y_tile = -1;\n this.positive = false;\n break;\n case DOWN:\n this.y_location = 136.8 + 6;\n this.y_tile = 1;\n break;\n case LEFT:\n this.x_location = -140.6 - 6;\n this.x_tile = -1;\n this.positive = false;\n break;\n case RIGHT:\n this.x_location = 140.6 + 6;\n this.x_tile = 1;\n break;\n default:\n break;\n }\n }", "public void checkClickedArea(int xMouse,int yMouse)\n {\n\n isSelected=false;\n if(targetable==true&&(xMouse>=xBeginMap+15&&xMouse<=xEndMap-15\n &&yMouse>=yBeginMap+15&&yMouse<=yEndMap-15))\n {\n\n isSelected=true;\n }\n\n }", "public void placeShip(Coordinate selected, int orientation) {\r\n HashSet<Coordinate> location = new HashSet<>();\r\n if (orientation == -1) { //user Xed the orientation window\r\n location.add(selected);\r\n data.orientationXedFlag = true;\r\n } \r\n else { //user didnt X the orientation window\r\n Boolean spaceIsFree = false;\r\n if (data.gameState == 1) {\r\n location = game.getPlayerOne().constructLocation(selected, orientation, data.shipToPlace);\r\n spaceIsFree = game.getPlayerOne().checkLegalPlacement(location, orientation);\r\n }\r\n else if (data.gameState == 2) {\r\n location = game.getPlayerTwo().constructLocation(selected, orientation, data.shipToPlace);\r\n spaceIsFree = game.getPlayerTwo().checkLegalPlacement(location, orientation);\r\n }\r\n\r\n if (spaceIsFree) {\r\n if (data.gameState == 1)\r\n game.getPlayerOne().placeShip(location, data.shipToPlace);\r\n else if (data.gameState == 2)\r\n game.getPlayerTwo().placeShip(location, data.shipToPlace);\r\n data.placementSuccessful = true;\r\n data.shipToPlace++;\r\n }\r\n else {\r\n data.placementSuccessful = false; \r\n location.clear();\r\n location.add(selected);\r\n } \r\n }\r\n data.placement = convertPlacementData(location);\r\n setChanged();\r\n notifyObservers(data);\r\n data.orientationXedFlag = false;\r\n data.placementSuccessful = false; //reset flags to false to avoid errornous updates \r\n }", "public boolean isAutoPosition();", "boolean hasUserLocationView();", "public void myLocationClick() {\n\n //Set the initial camera position to the current location\n GridPoint gridPoint = myGridPoint();\n float mpp = 1;\n\n if (gridPoint != null) {\n\n CameraPosition cameraPosition = new CameraPosition(gridPoint, mpp);\n mMap.moveCamera(cameraPosition, true);\n\n } else {\n\n //If GPS is off, notify the user to turn it on\n Toast.makeText(MainActivity.this,\"Turn on GPS.\",Toast.LENGTH_SHORT).show();\n\n }\n\n }", "public void relocateToPoint(boolean isUserClick){\n// System.out.println(\"Scene x: \"+point.getX()+\", y: \"+point.getY());\n// System.out.println(\"Local x: \"+getParent().sceneToLocal(point).getX()+\", y: \"+getParent().sceneToLocal(point).getY());\n// System.out.println(\"Relocate x: \"+(getParent().sceneToLocal(point).getX() - (getWidth() / 2))+\", y: \"+(getParent().sceneToLocal(point).getY() - (getHeight() / 2)));\n// System.out.println(getBoundsInLocal().getWidth());\n// System.out.println(widthProperty());\n\n if (isUserClick) {\n double new_x=getParent().sceneToLocal(x,y).getX();\n double new_y=getParent().sceneToLocal(x,y).getY();\n setX(new_x);\n setY(new_y);\n relocate(\n// (getParent().sceneToLocal(x,y).getX() - (widthCountry / 2)),\n// (getParent().sceneToLocal(x,y).getY() - (heightCountry / 2))\n new_x,new_y\n );\n } else {\n relocate(x,y);\n }\n\n\n }", "private boolean placeFlag(Location m) {\r\n\r\n // if the game is finished then nothing to do\r\n if (gameState > STARTED) {\r\n return false;\r\n } \r\n \r\n // if the location is already revealed then nothing more to do\r\n if (query(m) != GameStateModel.HIDDEN && query(m) != GameStateModel.FLAG) {\r\n return false;\r\n }\r\n \r\n // otherwise toggle the flag\r\n flag[m.x][m.y] = !flag[m.x][m.y];\r\n \r\n if (flag[m.x][m.y]) {\r\n \r\n //if (board[m.x][m.y] != GameState.MINE) {\r\n // System.out.println(\"DEBUG (\" + m.x + \",\" + m.y + \") is not a mine!\");\r\n //}\r\n flagsPlaced++;\r\n } else {\r\n flagsPlaced--;\r\n }\r\n\r\n // call this handle to allow extra logic to be added by the extending class\r\n placeFlagHandle(m);\r\n \r\n return true;\r\n \r\n }", "public boolean place(int posX, int posY, Direction direction) {\r\n\t\tboolean isInvalidPlaceParameter = !tabletop.canMove(posX, posY) || direction == null;\r\n\t\tif (isInvalidPlaceParameter) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tthis.posX = posX;\r\n\t\tthis.posY = posY;\r\n\t\tthis.direction = direction;\r\n\t\treturn true;\r\n\t}", "public void handleEvent(Event event)\n \t{\n \t\tRectangle bounds = ti.getBounds();\n \t\tPoint point = tb.toDisplay(bounds.x, bounds.y + bounds.height);\n \t\tmu.setLocation(point);\n \t\tmu.setVisible(true);\n \t}", "public abstract boolean isAllowableMovement(int[] location, double[] direction);", "private boolean isLocationAllowed() {\n int result = ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION);\r\n\r\n //If permission is granted returning true\r\n if (result == PackageManager.PERMISSION_GRANTED)\r\n return true;\r\n\r\n //If permission is not granted returning false\r\n return false;\r\n }", "private void pickCurrentPlace() {\n if (mMap == null) {\n return;\n }\n\n if (mLocationPermissionGranted) {\n getDeviceLocation();\n } else {\n getLocationPermission();\n }\n }", "public boolean allowMove(Point p, int pos);", "boolean canSet(Coordinates coord, double horizon, long time) throws AstrometryException;", "public boolean mouseClicked(MouseEvent e)\r\n {\r\n double x = e.getX();\r\n double y = e.getY();\r\n \r\n //find if coordinates are in a \"button\"\r\n for (int i = 0; i < towerButtons.length; i++)\r\n {\r\n if (towerButtons[i].contains(x,y))\r\n {\r\n display.setUnit(dummyList.get(i));\r\n selectedIndex = i;\r\n }\r\n }\r\n \r\n //within bounds\r\n if ((new Rectangle2D.Double(initX, 0, width, height)).contains(x,y))\r\n return true;\r\n return false;\r\n }", "@Override\r\n public boolean onTap(GeoPoint arg0, MapView arg1) {\n if(getMyLocation()!=null){\r\n int size = 30;\r\n Point out=new Point();\r\n mMapView.getProjection().toPixels(getMyLocation(), out); \r\n Rect rect = new Rect(out.x-size,out.y-size,out.x+size,out.y+size);\r\n mMapView.getProjection().toPixels(arg0, out);\r\n if(rect.contains(out.x, out.y)){\r\n //Log.e(\"MyLocation\", \"click my location \");\r\n mPopView.setVisibility(View.GONE);\r\n MapView.LayoutParams params = (MapView.LayoutParams) mPopView.getLayoutParams();\r\n params.x = 0;// Y轴偏移\r\n params.y = -5;// Y轴偏移\r\n GeoPoint point = getMyLocation().e();\r\n params.point = point;\r\n //mMapCtrl.animateTo(point);\r\n mMapView.updateViewLayout(mPopView, params);\r\n mPopView.setVisibility(View.VISIBLE);\r\n }else{\r\n mPopView.setVisibility(View.GONE) ; \r\n }\r\n }\r\n return super.onTap(arg0, arg1);\r\n }", "public boolean canDoBuySettlement(){\n\t\t if(resourceCardHand.canDoPayForSettlement() == false || playerPieces.hasAvailableSettlement() == false) {\n\t\t\t return false;\n\t\t }\n\t\t // If the player does not have a valid place to put a settlement on the map, we won't let the player buy one\n\t\t if(playerPieces.canPlaceASettlementOnTheMap() == false) {\n\t\t\t return false;\n\t\t }\n\t\t return true;\n\t }", "@SuppressWarnings({\"SameParameterValue\", \"unused\"})\n public static void allowAccessToLocation(final Boolean value) {\n sAccessToLocation = value;\n }", "private void updateLocationUi() {\n if (mMap == null) {\n return;\n }\n try {\n if (mPermissionCheck.locationPermissionGranted()) {\n mMap.setMyLocationEnabled(true);\n mMap.getUiSettings().setMyLocationButtonEnabled(true);\n } else {\n mMap.setMyLocationEnabled(false);\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n }\n } catch (SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n }", "@Override\n public boolean isLocationValid(int x, int y)\n {\n return master.isLocationValid(x, y);\n }", "public boolean canMoveTo(Position position){\n if(position.x > mapSize.x || position.x < 0 || position.y > mapSize.y || position.y < 0){\n return false;\n }\n return !isOccupied(position);\n }", "@Override\n public void onLongPress(MotionEvent event) { Place a new Route Point\n //\n switch (event.getActionMasked())\n {\n case MotionEvent.ACTION_DOWN:\n {\n //Log.i(\"onLongPress\", \"This is a onLongPress (ACTION_DOWN) event...\");\n if (routeVisuals.selectedWaypoint != null) {\n movingRoutePoint = true;\n placingRoutePoint = false;\n }\n else {\n placingRoutePoint = true;\n movingRoutePoint = false;\n }\n\n super.getLocationForPoint(new PointF(event.getX(), event.getY()), new LocationReceiver() {\n @Override\n public void receiveLocation(Location location) {\n if (!movingRoutePoint) {\n Log.w(\"onLongPress\", \"lon:\" + location.longitude + \" lat:\" + location.latitude);\n Coordinate c = new Coordinate(location.longitude, location.latitude);\n WithinAirspaceCheck check = new WithinAirspaceCheck(MyMapView.this.context, c);\n check.SetOnFoundAirspace(new WithinAirspaceCheck.OnFoundAirspace() {\n @Override\n public void OnFoundAirspace(Airspace airspace) {\n Log.i(TAG, \"Found: \" + airspace.Name);\n if (onFoundAirspace != null)\n onFoundAirspace.OnFoundAirspace(airspace);\n }\n\n @Override\n public void OnFoundAllAirspaces(Airspaces airspaces) {\n Log.i(TAG, \"Total airspaces : \" + airspaces.size());\n if (onFoundAirspace != null)\n onFoundAirspace.OnFoundAllAirspaces(airspaces);\n }\n });\n\n\n check.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);\n }\n\n }\n });\n\n break;\n }\n }\n\n// super.getLocationForPoint(new PointF(event.getX(), event.getY()), new ConvertPointCallback(){\n// @Override\n// public void convertComplete(Location loc) {\n// //Log.w(\"onLongPress\", \"lon:\" + loc.longitude + \" lat:\" + loc.latitude);\n//\n// if (placingRoutePoint) {\n// String name = loc.longitude + \",\" + loc.latitude;\n// routeVisuals.AddWaypoint(name, loc);\n//\n// //placingRoutePoint = false;\n// movingRoutePoint = true;\n// // insert the new point\n//\n// }\n//\n//\n// }});\n\n super.onLongPress(event);\n }", "protected boolean isAcceptableDropLocation(DropTargetDragEvent dtde) {\n OtDragDropObject ddo = OtTreeDragSource._dragObject;\n if (ddo == null) {\n return false;\n }\n\n // MFO from ot-0.5\n // get the node under the mouse\n OtTreeNodeWidget node = getNode(dtde.getLocation());\n if (node == null) {\n return false;\n }\n\n return (getSpInsertData(ddo, node) != null);\n }", "private void setPickupLocation(){\n \t\t// Defines the AutoCompleteTextView pickupText\n \t\tacPickup = (AutoCompleteTextView)findViewById(R.id.pickupText);\n \t\t// Controls if the user has entered an address\n \t\tif(!acPickup.getText().toString().equals(\"\")){\n \t\t\t// Gets the GeoPoint of the written address\n \t\t\tGeoPoint pickupGeo = GeoHelper.getGeoPoint(acPickup.getText().toString());\n \t\t\t// Gets the MapLocation of the GeoPoint\n \t\t\tMapLocation mapLocation = (MapLocation) GeoHelper.getLocation(pickupGeo);\n \t\t\t// Finds the pickup location on the route closest to the given address\n \t\t\tLocation temp = findClosestLocationOnRoute(mapLocation);\n \t\t\n \t\t\t//Controls if the user has entered a NEW address\n \t\t\tif(pickupPoint != temp){\n \t\t\t\t// Removes old pickup point (thumb)\n \t\t\t\tif(overlayPickupThumb != null){\n \t\t\t\t\tmapView.getOverlays().remove(overlayPickupThumb);\n \t\t\t\t\toverlayPickupThumb = null;\n \t\t\t\t}\n \t\t\t\tmapView.invalidate();\n \t\t\t\t\n \t\t\t\t// If no dropoff point is specified, we add the pickup point to the map.\n \t\t\t\tif(dropoffPoint == null){\n \t\t\t\t\tpickupPoint = temp;\n \t\t\t\t\toverlayPickupThumb = drawThumb(pickupPoint, true);\n \t\t\t\t}else{ // If a dropoff point is specified:\n \t\t\t\t\tList<Location> l = getApp().getSelectedJourney().getRoute().getRouteData();\n \t\t\t\t\t// Checks to make sure the pickup point is before the dropoff point.\n \t\t\t\t\tif(l.indexOf(temp) < l.indexOf(dropoffPoint)){\n \t\t\t\t\t\t//makeToast(\"The pickup point has to be before the dropoff point\");\n \t\t\t\t\t\tAlertDialog.Builder ad = new AlertDialog.Builder(MapActivityAddPickupAndDropoff.this); \n \t\t\t\t\t\tad.setMessage(\"The pickup point has to be before the dropoff point\");\n \t\t\t\t\t\tad.setTitle(\"Unable to send request\");\n \t\t\t\t\t\tad.setPositiveButton(\"Ok\",new DialogInterface.OnClickListener() {\n \t\t\t\t\t\t\tpublic void onClick(DialogInterface dialog,int id) {\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\tad.show();\n \t\t\t\t\t}else{\n \t\t\t\t\t\t// Adds the pickup point to the map by drawing a cross\n \t\t\t\t\t\tpickupPoint = temp;\n \t\t\t\t\t\toverlayPickupThumb = drawThumb(pickupPoint, true);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}else{\n \t\t\t//makeToast(\"Please add a pickup address\");\n \t\t\tAlertDialog.Builder ad = new AlertDialog.Builder(MapActivityAddPickupAndDropoff.this); \n \t\t\tad.setMessage(\"Please add a pickup address\");\n \t\t\tad.setTitle(\"Unable to send request\");\n \t\t\tad.setPositiveButton(\"Ok\",new DialogInterface.OnClickListener() {\n \t\t\t\tpublic void onClick(DialogInterface dialog,int id) {\n \t\t\t\t\t\n \t\t\t\t}\n \t\t\t });\n \t\t\tad.show();\n \t\t}\n \t}", "boolean hasLocation();", "boolean hasLocation();", "@Override\n\tpublic void setLocation(Point location) throws CannotPlaceUserException {\n\t\tsuper.setLocation(location);\n\t}", "public boolean canMove() {\n\n\tArrayList<Location> moveLocs = getValid(getLocation());\n\n\tif (isEnd == true) {\n\t return false;\n\t} \n\tif (!moveLocs.isEmpty()) {\n\t \n\t randomSelect(moveLocs);\n\t // selectMoveLocation(moveLocs);\n\t return true;\n\n\t} else {\n\t return false;\n\t}\n }", "public static boolean isValidPlace(int[] setPos){\n if(setPos[0]<=4 && setPos[0]>=0)\n return (setPos[1]<=4 && setPos[1]>=0);\n return false;\n }", "@Override\n\t\t\tpublic boolean onMyLocationButtonClick() {\n\t\t\t\tsupportClassObj.fitInMap(parentActivity.getItinerary(), googlemap, parentActivity);\n\t\t\t\treturn true;\n\t\t\t}", "private boolean getCenterGps() {\n return this.mapState != MapState.FREE && this.mapState != MapState.WP;\n }", "@Override\n public void handle(MouseEvent event) {\n if( tradeBankGroup.isVisible() || domesticTradeGroup.isVisible())\n return;\n settlement_selected_rectangle.setVisible(true);\n city_selected_rectangle.setVisible(false);\n road_selected_rectangle.setVisible(false);\n \n construct_type = Construction_type.SETTLEMENT;\n }", "@FXML\n private void mouseMove(MouseEvent event) {\n SolarSystem mouseOver = findClosestSolarSystem(new Point((int) event.getX() - 5, (int) event.getY() - 5));\n if (mouseOver != null) {\n drawUniverse();\n g.setStroke(Color.WHITE);\n g.setFill(Color.WHITE);\n g.strokeOval(event.getX() - 15, event.getY() - 15, 30, 30);\n g.fillText(mouseOver.name(), event.getX(), event.getY());\n if (travelable.contains(mouseOver)) {\n double radx = ((player.getCurrentSolarSystem().getX() * UNIVERSE_SCALE) - mapOffsetX - dragOffsetX) + (512 - mapOffsetX - dragOffsetX);\n double rady = ((player.getCurrentSolarSystem().getY() * UNIVERSE_SCALE) - mapOffsetY - dragOffsetY) + (288 - mapOffsetY - dragOffsetY);\n g.strokeLine(radx, rady, event.getX(), event.getY());\n }\n } else {\n drawUniverse();\n }\n }", "protected EventHandler<MouseEvent> activateBoat() {\n EventHandler<MouseEvent> mousePressHandler = new EventHandler<MouseEvent>() { \n @Override\n public void handle(MouseEvent event) {\n if(!isValidate) {\n if (event.getButton() == MouseButton.PRIMARY) {\n //If the user has clicked in the window and no other boat is already selected\n if (activeBoat == null) {\n Rectangle myRectangle =(Rectangle) event.getSource();\n BoatDrawing myboat = boatMap.get(myRectangle);\n activeBoat = myboat.setActiveBoat(boatMap);\n activeBoat.setPlaced(false);\n logMsg(EXPLAIN_PLACEMENT);\n }\n\n }\n }\n }\n };\n return mousePressHandler;\n \n }", "@Test\n\t\tpublic void canGiveMinotaurLocation() {\n\t\t\tPoint whereMinotaur = new Pointer(1,3);\n\t\t\tgameLoader.addMinotaur(whereMinotaur);\n\t\t\tPoint expected = whereMinotaur;\n\t\t\tPoint actual = gameSaver.wheresMinotaur();\n\t\t\t\n\t\t\tassertEquals(expected.across(), actual.across());\n\t\t\tassertEquals(expected.down(), actual.down());\n\t\t}", "@Override\n \t\t\tpublic void onCheckedChanged(CompoundButton arg0, boolean arg1) {\n \t\t\t\tif(arg1==true)\n \t\t\t\t\tmMap.setMyLocationEnabled(true);\n \t\t\t\telse\n \t\t\t\t\tmMap.setMyLocationEnabled(false);\n \t\t\t}", "@Override\n \t\t\tpublic void onCheckedChanged(CompoundButton arg0, boolean arg1) {\n \t\t\t\tif(arg1==true)\n \t\t\t\t\tmMap.setMyLocationEnabled(true);\n \t\t\t\telse\n \t\t\t\t\tmMap.setMyLocationEnabled(false);\n \t\t\t}", "@Override\n public void mouseClicked(MouseEvent e) {\n //location where mouse was pressed\n Point mousePoint = e.getPoint();\n //conversion to location on frame\n Vec2 worldPoint = view.viewToWorld(mousePoint);\n float fx = e.getPoint().x;\n float fy = e.getPoint().y;\n float vx = worldPoint.x;\n float vy = worldPoint.y;\n //Completes checks for pressing of GUI components\n restartCheck(vx, vy);\n settingsCheck(vx, vy);\n zoomCheck(fx, fy);\n }", "private void checkClick(MouseEvent event) {\n SolarSystem mouseOver = findClosestSolarSystem(new Point((int) event.getX() - 5, (int) event.getY() - 5));\n if (mouseOver != null && travelable.contains(mouseOver)) {\n selectedSolarSystem = mouseOver;\n animateInfoScreen(true);\n solarSystemName.setText(mouseOver.name());\n ObservableList<Planet> planets = FXCollections.observableArrayList(mouseOver.planets());\n planetList.setItems(planets);\n fuelInfo.setText(\"Current:\\n\" + player.getShip().getFuel() + \"\\n\\nCost:\\n\" + player.distanceToSolarSystem(mouseOver) + \"\\n\\nSum:\\n\" + (player.getShip().getFuel() - player.distanceToSolarSystem(mouseOver)));\n drawUniverse();\n } else {\n drawUniverse();\n }\n }", "public boolean isMovement() {\n return isMovementEvent;\n }", "@Override\n\t\t\tpublic void onMapClick(LatLng arg0) {\n\t\t\t\tfinal LatLng location = arg0;\n \tAlertDialog builder = new AlertDialog.Builder(MainActivity.this)\n\t .setMessage(\"Do you want to add your location here?\")\n\t .setPositiveButton(\"Yes\", new DialogInterface.OnClickListener() {\n\t public void onClick(DialogInterface dialog, int id) {\n\t \t setFlag = true;\n\t \t myLocation = location;\n\t \t //use this flag to indicate that we want to see the path from current location or a set point\n\t \t Log.d(\"my location:\", \"\"+myLocation.latitude + myLocation.longitude);\n\t \t if(setFlag == true){\n\t \t\t if(myMarker != null){\n\t\t \t\t myMarker.remove();\n\t\t \t }\n\t\t \t myMarker = mMap.addMarker(new MarkerOptions().position(myLocation).title(\"myLocation\").draggable(true)\n\t\t \t\t\t\t\t\t.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_BLUE)));\n\t\t \t\t\t\t landmarks.addMarker(\"myLocation\", myMarker);\n\t \t } \n\t }\n\t })\n\t .setNegativeButton(\"Not now\", new DialogInterface.OnClickListener() {\n\t public void onClick(DialogInterface dialog, int id) {\n\t // User cancelled the dialog\n\t }\n\t }).create();\n \tbuilder.show();\n\t\t\t}", "public boolean canPlaceEntity() {\n boolean blocked = this.mapCoordinatesForEntityToPlace.stream().anyMatch(c -> c.placeableState == PlaceableState.BLOCKED);\n if (blocked) return false;\n\n return this.mapCoordinatesForEntityToPlace.stream().anyMatch(c -> c.placeableState == PlaceableState.PLACEABLE);\n }", "private void fineLocationPermissionGranted() {\n UtilityService.addGeofences(this);\n UtilityService.requestLocation(this);\n }", "private static void verifyViewPoint() {\n if (viewPoint.x < 0)\n viewPoint.x = 0;\n if (viewPoint.y < 0)\n viewPoint.y = 0;\n if (viewPoint.x > map.WIDTH - GAME_WIDTH * zoom)\n viewPoint.x = map.WIDTH - ((int) (GAME_WIDTH * zoom));\n if (viewPoint.y > map.HEIGHT - GAME_HEIGHT * zoom)\n viewPoint.y = map.HEIGHT - ((int) (GAME_HEIGHT * zoom));\n }", "private void requestLocationPermission() {\n if (ActivityCompat.shouldShowRequestPermissionRationale(this,\n Manifest.permission.ACCESS_FINE_LOCATION)) {\n\n new AlertDialog.Builder(this)\n .setTitle(\"Permission needed\")\n .setMessage(\"Location Permission is needed to show your current location on the map\")\n .setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n ActivityCompat.requestPermissions(ScavengerHunt.this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, 2);\n }\n })\n .setNegativeButton(\"Cancel\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.dismiss();\n Toast.makeText(ScavengerHunt.this, \"Location Permission is needed to update the map\", Toast.LENGTH_SHORT).show();\n }\n })\n .create()\n .show();\n\n } else {\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, 2);\n }\n }", "@Override\n protected void checkLocation() {\n // nothing\n }", "public void checkLocationPermission() {\n try {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n if (checkPermission(Manifest.permission.ACCESS_FINE_LOCATION, getActivity(), getActivity())) {\n if (checkPermission(Manifest.permission.ACCESS_COARSE_LOCATION, getActivity(), getActivity())) {\n gpsTracker.getLocation();\n } else {\n requestPermission(android.Manifest.permission.ACCESS_COARSE_LOCATION, PERMISSION_REQUEST_CODE_LOCATION, getActivity().getApplicationContext(),\n getActivity());\n }\n } else {\n requestPermission(android.Manifest.permission.ACCESS_FINE_LOCATION, PERMISSION_REQUEST_CODE_LOCATION, getActivity().getApplicationContext(),\n getActivity());\n }\n } else {\n gpsTracker.getLocation();\n }\n } catch (Exception e) {\n // logException(e, \"GpsMapManualFragment_checkLocationPermission()\");\n }\n\n\n }", "private void updateLocationUI() {\n if (mMap == null) {\n return;\n }\n try {\n if (mLocationPermissionGranted) {\n mMap.setMyLocationEnabled(true);\n mMap.getUiSettings().setMyLocationButtonEnabled(true);\n } else {\n mMap.setMyLocationEnabled(false);\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n mLastKnownLocation = null;\n getLocationPermission();\n }\n } catch (SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n }", "private void updateLocationUI() {\n if (mMap == null) {\n return;\n }\n try {\n if (mLocationPermissionGranted) {\n mMap.setMyLocationEnabled(true);\n mMap.getUiSettings().setMyLocationButtonEnabled(true);\n } else {\n mMap.setMyLocationEnabled(false);\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n mLastKnownLocation = null;\n getLocationPermission();\n }\n } catch (SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n }", "private void updateLocationUI() {\n if (mMap == null) {\n return;\n }\n try {\n if (mLocationPermissionGranted) {\n mMap.setMyLocationEnabled(true);\n mMap.getUiSettings().setMyLocationButtonEnabled(true);\n } else {\n mMap.setMyLocationEnabled(false);\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n mLastKnownLocation = null;\n getLocationPermission();\n }\n } catch (SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n }", "public void place(){\n\t\tplace((float) Math.floor(Main.mouseSelector.x)+0.5f,(float) Math.floor(Main.mouseSelector.y)+0.5f);\r\n\t}", "public void move (View view){\n\n if (toyRobotIsActive){//only run code after PLACE is DONE\n\n if (orientation == 0) {//Move while Facing North\n\n if((robot.getTranslationY()/perUnitY*(-1)) >=4) {\n System.out.println(\"Out of Bounds\");//Chk Error in Logs\n errorMessage(\"Out of Bounds\");//Error display to user via Toast\n } else {\n robot.animate().translationYBy(-perUnitY).setDuration(50);\n } //move robot 1 unit\n\n } else if (orientation == 3 || orientation == -1) {//Facing West\n if((robot.getTranslationX()/perUnitX) <= 0) {\n System.out.println(\"Out of Bounds\");\n errorMessage(\"Out of Bounds\");\n } else {\n robot.animate().translationXBy(-perUnitX).setDuration(50);\n }\n\n\n } else if (orientation == 2 || orientation == -2) {//Facing South\n if((robot.getTranslationY()/perUnitY)*(-1) <= 0){\n System.out.println(\"Out of Bounds\");\n errorMessage(\"Out of Bounds\");\n } else {\n robot.animate().translationYBy(perUnitY).setDuration(50);\n }\n\n\n } else if (orientation == 1 || orientation == -3) {//Facing East\n if((robot.getTranslationX()/perUnitX) >=4){\n System.out.println(\"Out of Bounds\");\n errorMessage(\"Out of Bounds\");\n } else {\n robot.animate().translationXBy(perUnitX).setDuration(50);\n }\n }\n } else errorMessage(\"Please place toy robot\"); //button not active if\n }", "public void checkPosition(){\n int absPos = mArm.getSensorCollection().getPulseWidthPosition();\n // mArm.configSelectedFeedbackSensor(FeedbackDevice.QuadEncoder);\n mArm.setSelectedSensorPosition(absPos - offset);\n }", "public abstract boolean canMove();", "private boolean checkM(){\n if(currentLocation.x == previousLocation.x && currentLocation.y == previousLocation.y) {\n return false;\n }\n // Is outside the border\n if(currentLocation.x < size || currentLocation.y < size || currentLocation.x > map.numRows - size || currentLocation.y > map.numCols - size) {\n return false;\n }\n // Is on the land\n double angle2 = 0;\n while (angle2 < 6.3) {\n if (map.getTerrainGrid()[currentLocation.x + (int) (size/2 * cos(angle2))][currentLocation.y + (int) (size/2 * sin(angle2))] == Colors.OCEAN) {\n return false;\n }\n angle2 += 0.3;\n }\n return true;\n }", "private boolean towerLocation(final Point current_point) {\r\n\t\tfor (int i = 0; i < my_towers.size(); i++) {\r\n\t\t\tif (my_towers.get(i).getLocation().equals(current_point)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public void getMovements()\n {\n if(\n Greenfoot.isKeyDown(\"Up\")||Greenfoot.isKeyDown(\"W\")||\n Greenfoot.isKeyDown(\"Down\")||Greenfoot.isKeyDown(\"S\")||\n Greenfoot.isKeyDown(\"Right\")||Greenfoot.isKeyDown(\"D\")||\n Greenfoot.isKeyDown(\"Left\") ||Greenfoot.isKeyDown(\"A\")||\n getWorld().getObjects(Traps.class).isEmpty() == false //car trap engendre un mouvement sans les touches directionnelles\n )\n {\n isMoved = true;\n }\n else{isMoved = false;}\n }", "void pointCheck(LatLng point, boolean valid);", "public boolean isAssignedToLocation() {\n if (location == null) {\n return false;\n }\n return true;\n }", "@Override\n\t\tpublic boolean onTouch(View arg0,MotionEvent event)\n\n\t\t\t{\n\t\t\t\tx = event.getX();\n\t\t\t\ty = event.getY();\n\t\t\t\tint W = mv.w;\n\t\t\t\tint H = mv.h;\n\t\t\t\tint A = mv.a;\n\t\t\t\tint x_coordinates[] = { W / 2 - A / 2 - A, W / 2 - A / 2,\n\t\t\t\t\t\tW / 2 + A / 2, W / 2 - A / 2 - A, W / 2 - A / 2,\n\t\t\t\t\t\tW / 2 + A / 2, W / 2 - A / 2 - A, W / 2 - A / 2,\n\t\t\t\t\t\tW / 2 + A / 2 };\n\t\t\t\tint y_coordinates[] = { H / 2 - A / 2 - A, H / 2 - A / 2 - A,\n\t\t\t\t\t\tH / 2 - A / 2 - A, H / 2 - A / 2, H / 2 - A / 2,\n\t\t\t\t\t\tH / 2 - A / 2, H / 2 + A / 2, H / 2 + A / 2,\n\t\t\t\t\t\tH / 2 + A / 2 };\n\t\t\t\tint x_extreme=W/2+A/2+2*A;\n\t\t\t\tint y_extreme=H/2+A/2+2*A;\n\n\t\t\t\tforWin(x_coordinates, y_coordinates);\n\t\t\t\tcheckForWin();\n\n\t\t\t\tcheckForCompletion();\n\t\t\t\tcheckForPlayerChance();\n\t\t\t\tcheckForCPUChance();\n\t\t\t\tCPUWork();\n\t\t\t\tbugflag = false;\n\n\t\t\t\treturn false;\n\n\t\t\t}", "public boolean canGetLocation() {\r\n return canGetLocation;\r\n }", "@objid (\"7f09cb7d-1dec-11e2-8cad-001ec947c8cc\")\n public boolean allowsMove() {\n return true;\n }", "@Override\n public boolean onMyLocationButtonClick() {\n LocationManager manager = (LocationManager) getContext().getSystemService(Context.LOCATION_SERVICE);\n if (!manager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {\n // If Location disable create a alert dialog\n AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(getContext());\n alertDialogBuilder.setMessage(\"Location is disabled in your device. Would you like to enable it?\")\n // Have to respond to this message not cancelable\n .setCancelable(false)\n // If yes open setting page to enable location\n .setPositiveButton(\"Yes\",\n new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n // intent calls the android activity of location settings\n Intent callGPSSettingIntent = new Intent(\n android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS);\n startActivity(callGPSSettingIntent);\n }\n });\n //if no close the dialog\n alertDialogBuilder.setNegativeButton(\"Maybe Later\",\n new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n dialog.cancel();\n }\n });\n AlertDialog alert = alertDialogBuilder.create();\n alert.show();\n }\n\n return false;\n }", "private void setDropOffLocation(){\n \t\t// Defines the AutoCompleteTextView with the dropoff address\n \t\tacDropoff = (AutoCompleteTextView)findViewById(R.id.dropoffText);\n \t\t//Controls if the user has entered an address\n \t\tif(!acDropoff.getText().toString().equals(\"\")){\n \t\t\t// Gets the GeoPoint of the given address\n \t\t\tGeoPoint dropoffGeo = GeoHelper.getGeoPoint(acDropoff.getText().toString());\n \t\t\t// Gets the MapLocation from the given GeoPoint\n \t\t\tMapLocation mapLocation = (MapLocation) GeoHelper.getLocation(dropoffGeo);\n \t\t\t// Finds the dropoff location on the route closest to the given address\n \t\t\tLocation temp = findClosestLocationOnRoute(mapLocation);\n \t\t\t\n \t\t\t// Controls if the user has entered a NEW address\n \t\t\tif(dropoffPoint != temp){\n \t\t\t\t// Removes old pickup point (thumb)\n \t\t\t\tif(overlayDropoffThumb != null){\n \t\t\t\t\tmapView.getOverlays().remove(overlayDropoffThumb);\n \t\t\t\t\toverlayDropoffThumb = null;\n \t\t\t\t}\n \t\t\t\tmapView.invalidate();\n \t\t\t\t\n \t\t\t\t// If no pickup point is specified, we add the dropoff point to the map.\n \t\t\t\tif(pickupPoint == null){\n \t\t\t\t\tdropoffPoint = temp;\n \t\t\t\t\toverlayDropoffThumb = drawThumb(dropoffPoint, false);\n \t\t\t\t}else{ // If a pickup point is specified:\n \t\t\t\t\tList<Location> l = getApp().getSelectedJourney().getRoute().getRouteData();\n \t\t\t\t\t// Checks to make sure the dropoff point is after the pickup point.\n \t\t\t\t\tif(l.indexOf(temp) > l.indexOf(pickupPoint)){\n \t\t\t\t\t\t//makeToast(\"The droppoff point has to be after the pickup point\");\n \t\t\t\t\t\tAlertDialog.Builder ad = new AlertDialog.Builder(MapActivityAddPickupAndDropoff.this); \n \t\t\t\t\t\tad.setMessage(\"The droppoff point has to be after the pickup point\");\n \t\t\t\t\t\tad.setTitle(\"Unable to send request\");\n \t\t\t\t\t\tad.setPositiveButton(\"Ok\",new DialogInterface.OnClickListener() {\n \t\t\t\t\t\t\tpublic void onClick(DialogInterface dialog,int id) {\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\tad.show();\n \t\t\t\t\t}else{\n \t\t\t\t\t\t// Adds the dropoff point to the map by drawing a cross\n \t\t\t\t\t\tdropoffPoint = temp;\n \t\t\t\t\t\toverlayDropoffThumb = drawThumb(dropoffPoint, false);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}else{\n \t\t\t//makeToast(\"Please add a dropoff address\");\n \t\t\tAlertDialog.Builder ad = new AlertDialog.Builder(MapActivityAddPickupAndDropoff.this); \n \t\t\tad.setMessage(\"Please add a dropoff address\");\n \t\t\tad.setTitle(\"Unable to send request\");\n \t\t\tad.setPositiveButton(\"Ok\",new DialogInterface.OnClickListener() {\n \t\t\t\tpublic void onClick(DialogInterface dialog,int id) {\n \t\t\t\t\t\n \t\t\t\t}\n \t\t\t });\n \t\t\tad.show();\n \t\t}\n \t}", "public boolean getPanStatus() {\n return doPan;\n }", "@Override\n public double getLocationX() {\n return myMovable.getLocationX();\n }", "public boolean needCoordinates() { return needCoords; }", "private void setTurtleLocToViewTurtleLoc()\n\t{\n\t\tSystem.out.println(\" in setTurtleLocToViewTurtleLoc \" + this.myTurtle.getLoc().getX() + \" \" +this.myTurtle.getLoc().getX());\n\t\tmyTurtle.setLocation(getViewTurtleLocation());\n\t}", "private void updateLocationUI() {\n if (mMap == null) {\n return;\n }\n try {\n if (mLocationPermissionGranted) {\n mMap.setMyLocationEnabled(true);\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n } else {\n mMap.setMyLocationEnabled(false);\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n mLastKnownLocation = null;\n getLocationPermission();\n }\n } catch (SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n }", "boolean canPickup(int x, int y) {\n return ((posX == x) && (posY == y));\n }", "public boolean isEntered();", "boolean canMoveTo(Vector2d position);", "private void updateLocationUI() {\n if (map == null) {\n return;\n }\n try {\n if (locationPermissionGranted) {\n map.setMyLocationEnabled(true);\n map.getUiSettings().setMyLocationButtonEnabled(true);\n } else {\n map.setMyLocationEnabled(false);\n map.getUiSettings().setMyLocationButtonEnabled(false);\n lastKnownLocation = null;\n getLocationPermission();\n }\n } catch (SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n }", "public native bool kbSetTownLocation(vector location);", "@Override\n public Point3D getLocation() {\n return myMovable.getLocation();\n }", "boolean canMove(Tile t);", "public void setIsLat(Boolean boo) {\n\t this.isLat = boo;\n }", "public boolean hasLocation()\n {\n return targetLocation != null;\n }", "boolean hasLatitude();", "boolean hasLatitude();", "boolean hasDistanceView();", "protected boolean shouldMoveTo(World worldIn, BlockPos pos)\n {\n Block block = worldIn.getBlockState(pos).getBlock();\n\n if (block == Blocks.FARMLAND)\n {\n pos = pos.up();\n IBlockState iblockstate = worldIn.getBlockState(pos);\n block = iblockstate.getBlock();\n\n if (block instanceof BlockCrops && this.wantsToReapStuff && (this.currentTask == 0 || this.currentTask < 0))\n {\n this.currentTask = 0;\n return true;\n }\n\n }\n\n return false;\n }", "@Override\n public boolean isTransforming() {\n return super.isTransforming() || desiredWorldPosition != null;\n }", "boolean canMove();" ]
[ "0.58723503", "0.58652383", "0.5848905", "0.584043", "0.5796616", "0.57201415", "0.56346184", "0.5596099", "0.55000377", "0.54906386", "0.54875946", "0.54753363", "0.54663223", "0.5425419", "0.53845865", "0.53710073", "0.53704035", "0.53695786", "0.53544", "0.5351273", "0.5336117", "0.5328494", "0.5325321", "0.5324928", "0.528275", "0.5277534", "0.5275126", "0.5272754", "0.5270612", "0.52568877", "0.5251398", "0.5241388", "0.5238779", "0.52074933", "0.5207044", "0.5203948", "0.5201419", "0.5193498", "0.5175726", "0.51731026", "0.5169374", "0.5169374", "0.516589", "0.51549375", "0.5152868", "0.5144045", "0.51436275", "0.5126551", "0.5119698", "0.51151323", "0.5112479", "0.5098928", "0.5098928", "0.5098174", "0.50972813", "0.50949544", "0.50945383", "0.50842804", "0.50728244", "0.50644124", "0.50640196", "0.5063883", "0.5059305", "0.5045898", "0.5045898", "0.5045898", "0.50438714", "0.50401783", "0.50383115", "0.5034877", "0.503407", "0.5028837", "0.50278455", "0.5022615", "0.5020052", "0.50194496", "0.50009036", "0.499589", "0.49950245", "0.4990958", "0.498783", "0.49845695", "0.4982064", "0.49788412", "0.49774173", "0.49753937", "0.497386", "0.49730822", "0.49708888", "0.49693137", "0.49685198", "0.49637344", "0.4962134", "0.49618706", "0.4959708", "0.4959708", "0.49594247", "0.49589044", "0.49582425", "0.49569649" ]
0.5108485
51
This method is called whenever the user is trying to place a city on the map. It is called by the view for each "mouse move" event. The returned value tells the view whether or not to allow the city to be placed at the specified location.
boolean canPlaceCity(VertexLocation vertLoc);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean setLocationInformation() {\n try {\n this.mPostModel.setLocationPost(mAutoCompleteTextView.getText().toString());\n\n if (StringEmptyUtil.isEmptyString(this.mPostModel.getLocationPost())) {\n Toast.makeText(getApplicationContext(), \"Please Select Location\", Toast.LENGTH_LONG).show();\n return false;\n }\n\n this.drop_location.setVisibility(View.VISIBLE);\n this.location_view.setVisibility(View.VISIBLE);\n this.current_location.setVisibility(View.VISIBLE);\n this.current_location.setText(this.mPostModel.getLocationPost());\n return true;\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n Toast.makeText(getApplicationContext(), \"Please Select Location\", Toast.LENGTH_LONG).show();\n\n return false;\n }", "public abstract boolean canMoveTo(Case Location);", "boolean hasLocationView();", "public boolean canMove(Location loc){\n if(loc.getX() >= theWorld.getX() || loc.getX() < 0){\n System.out.println(\"cant move1\");\n return false;\n }else if(loc.getY() >= theWorld.getY() || loc.getY() < 0){\n System.out.println(\"cant move2\");\n return false;\n }else{\n System.out.println(\"can move\");\n return true;\n }\n }", "public abstract boolean actualPlace(int row, int col);", "boolean isPlaced();", "void checkMyLocationVisibility() {\n if (settings.getReturnToMyLocation() || presenter.isTracking())\n showMyLocation();\n }", "public boolean isPlaced() {\n return isPlaced;\n }", "boolean hasLocation();", "boolean hasLocation();", "private boolean isLocationAllowed() {\n int result = ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION);\r\n\r\n //If permission is granted returning true\r\n if (result == PackageManager.PERMISSION_GRANTED)\r\n return true;\r\n\r\n //If permission is not granted returning false\r\n return false;\r\n }", "public boolean mapsToPlace(Place where) {\n\t\treturn false;\r\n\t}", "boolean hasUserLocationView();", "boolean isGoodLocation(World world, int x, int y, int z);", "@Override\n public boolean isLocationValid(int x, int y)\n {\n return master.isLocationValid(x, y);\n }", "private boolean canMove(Location location) {\n if (location == null) return false;\n return location.getWorld().intersects(this, Util.getRectangle(location, size)) == null && location.getY() >= 0 && location.getX() >= 0;\n }", "public boolean canGetLocation() {\r\n return canGetLocation;\r\n }", "public boolean place(int posX, int posY, Direction direction) {\r\n\t\tboolean isInvalidPlaceParameter = !tabletop.canMove(posX, posY) || direction == null;\r\n\t\tif (isInvalidPlaceParameter) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tthis.posX = posX;\r\n\t\tthis.posY = posY;\r\n\t\tthis.direction = direction;\r\n\t\treturn true;\r\n\t}", "@Override\r\n\tpublic void placeCity(VertexLocation vertLoc) {\n\t\t\r\n\t}", "public boolean canPlaceEntity() {\n boolean blocked = this.mapCoordinatesForEntityToPlace.stream().anyMatch(c -> c.placeableState == PlaceableState.BLOCKED);\n if (blocked) return false;\n\n return this.mapCoordinatesForEntityToPlace.stream().anyMatch(c -> c.placeableState == PlaceableState.PLACEABLE);\n }", "public boolean canDoBuyCity(){\n\t\t if(resourceCardHand.canDoPayForCity() == false || playerPieces.hasAvailableCity() == false) {\n\t\t\t return false;\n\t\t }\n\t\t // If the player does not have a valid place to put a city on the map, we won't let the player buy a city\n\t\t if(playerPieces.canPlaceACityOnTheMap() == false) {\n\t\t\t return false;\n\t\t }\n\t\t return true;\n\t }", "private boolean placeFlag(Location m) {\r\n\r\n // if the game is finished then nothing to do\r\n if (gameState > STARTED) {\r\n return false;\r\n } \r\n \r\n // if the location is already revealed then nothing more to do\r\n if (query(m) != GameStateModel.HIDDEN && query(m) != GameStateModel.FLAG) {\r\n return false;\r\n }\r\n \r\n // otherwise toggle the flag\r\n flag[m.x][m.y] = !flag[m.x][m.y];\r\n \r\n if (flag[m.x][m.y]) {\r\n \r\n //if (board[m.x][m.y] != GameState.MINE) {\r\n // System.out.println(\"DEBUG (\" + m.x + \",\" + m.y + \") is not a mine!\");\r\n //}\r\n flagsPlaced++;\r\n } else {\r\n flagsPlaced--;\r\n }\r\n\r\n // call this handle to allow extra logic to be added by the extending class\r\n placeFlagHandle(m);\r\n \r\n return true;\r\n \r\n }", "@Override\n public void onLocationChanged(MapWidget v, Location location) {\n }", "@Override\r\n public boolean onTap(GeoPoint arg0, MapView arg1) {\n if(getMyLocation()!=null){\r\n int size = 30;\r\n Point out=new Point();\r\n mMapView.getProjection().toPixels(getMyLocation(), out); \r\n Rect rect = new Rect(out.x-size,out.y-size,out.x+size,out.y+size);\r\n mMapView.getProjection().toPixels(arg0, out);\r\n if(rect.contains(out.x, out.y)){\r\n //Log.e(\"MyLocation\", \"click my location \");\r\n mPopView.setVisibility(View.GONE);\r\n MapView.LayoutParams params = (MapView.LayoutParams) mPopView.getLayoutParams();\r\n params.x = 0;// Y轴偏移\r\n params.y = -5;// Y轴偏移\r\n GeoPoint point = getMyLocation().e();\r\n params.point = point;\r\n //mMapCtrl.animateTo(point);\r\n mMapView.updateViewLayout(mPopView, params);\r\n mPopView.setVisibility(View.VISIBLE);\r\n }else{\r\n mPopView.setVisibility(View.GONE) ; \r\n }\r\n }\r\n return super.onTap(arg0, arg1);\r\n }", "public boolean isPlaceable() {\n\t\tlong now = Calendar.getInstance().getTimeInMillis();\t\t\n\t\treturn now - createTime >= placeableThreshold && \n\t\t\t\tnow - focusTime >= placeableThreshold;\n\t}", "@SuppressWarnings({\"SameParameterValue\", \"unused\"})\n public static void allowAccessToLocation(final Boolean value) {\n sAccessToLocation = value;\n }", "private void pickCurrentPlace() {\n if (mMap == null) {\n return;\n }\n\n if (mLocationPermissionGranted) {\n getDeviceLocation();\n } else {\n getLocationPermission();\n }\n }", "public boolean canGetLocation() {\r\n return this.canGetLocation;\r\n }", "@Override\n public boolean isLocationValid(XYCoord coords)\n {\n return master.isLocationValid(coords);\n }", "@Override\n protected void checkLocation() {\n // nothing\n }", "private void updateWeatherView(String cityName){\n\t\t\t\n\t\t\tif (cityName.equals(\"--Remove?--\")){\n\t\t\t\t\tint count = 0;\n\t\t\t\t\tJFrame frame = new JFrame();\n\t\t\t\t\tString[] possibilities = new String[app.getMyLocations().length];\n\t\t\t\t\tfor (int i = 0; i < app.getMyLocations().length; i ++){\n\t\t\t\t\t\tlocation loc = app.getMyLocations()[i];\n\t\t\t\t\t\tif (!loc.getName().equals(\"Default\")){\n\t\t\t\t\t\t\tpossibilities[i] = loc.getName() + \", \" + loc.getCountryCode() + \" Lat: \" + loc.getLatitude()\n\t\t\t\t\t\t\t\t\t+ \" Long: \" + loc.getLongitude();\n\t\t\t\t\t\t\tcount ++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tString response = (String) JOptionPane.showInputDialog(frame, \"Pick a location to remove:\", \"Remove Location\", \n\t\t\t\t\t\t\tJOptionPane.QUESTION_MESSAGE, null, Arrays.copyOfRange(possibilities, 0, count), \"Titan\");\n\t\t\t\t\tif (response != null){\n\t\t\t\t\t\tString countryCode = response.substring(response.indexOf(',') + 2, response.indexOf(',') + 5);\n\t\t\t\t\t\tcityName = response.substring(0, response.indexOf(','));\n\t\t\t\t\t\tapp.removeLocation(cityName, countryCode);\n\t\t\t\t\t}\n\t\t\t\t\tlocBar.removeActionListener(Jcombo);\n\t\t\t\t\tpopulateMyLocationsBox();\n\t\t\t\t\t\t\n\t\t\t } else if (cityName.equals(\"--Empty--\")){\n\t\t\t\t\t\t//Do nothing\n\t\t\t} else {\n\t\t\t\t\tlocation update = new location();\n\t\t\t\t\tString countryCode = cityName.substring(cityName.indexOf(',') + 2, cityName.indexOf(',') + 4);\n\t\t\t\t\tcityName = cityName.substring(0, cityName.indexOf(','));\n\t\t\t\t\tfor (int i = 0; i < app.getMyLocations().length; i ++){\n\t\t\t\t\t\tString checkName = app.getMyLocations()[i].getName();\n\t\t\t\t\t\tString checkCode = app.getMyLocations()[i].getCountryCode();\n\t\t\t\t\t\tif (checkName.equals(cityName) && checkCode.equals(countryCode)){\n\t\t\t\t\t\t\tupdate = app.getMyLocations()[i];\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\tapp.setVisibleLocation(update);\n\t\t\t\t\trefreshPanels();\n\t\t\t}\n\t\t}", "public boolean canGetLocation() {\n return this.canGetLocation;\n }", "public boolean canGetLocation() {\n return this.canGetLocation;\n }", "public boolean canGetLocation() {\n return this.canGetLocation;\n }", "boolean isCitySelected();", "private void updateLocationUi() {\n if (mMap == null) {\n return;\n }\n try {\n if (mPermissionCheck.locationPermissionGranted()) {\n mMap.setMyLocationEnabled(true);\n mMap.getUiSettings().setMyLocationButtonEnabled(true);\n } else {\n mMap.setMyLocationEnabled(false);\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n }\n } catch (SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n }", "public void myLocationClick() {\n\n //Set the initial camera position to the current location\n GridPoint gridPoint = myGridPoint();\n float mpp = 1;\n\n if (gridPoint != null) {\n\n CameraPosition cameraPosition = new CameraPosition(gridPoint, mpp);\n mMap.moveCamera(cameraPosition, true);\n\n } else {\n\n //If GPS is off, notify the user to turn it on\n Toast.makeText(MainActivity.this,\"Turn on GPS.\",Toast.LENGTH_SHORT).show();\n\n }\n\n }", "public boolean placementDone() {return placedShips == 4;}", "public boolean canMove (Location loc) {\n Grid<Actor> gr = getGrid();\n if (gr == null)\n return false;\n if (!gr.isValid(loc))\n return false;\n Actor neighbor = gr.get(loc);\n return !(neighbor instanceof Wall);\n }", "public void checkLocationPermission() {\n try {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n if (checkPermission(Manifest.permission.ACCESS_FINE_LOCATION, getActivity(), getActivity())) {\n if (checkPermission(Manifest.permission.ACCESS_COARSE_LOCATION, getActivity(), getActivity())) {\n gpsTracker.getLocation();\n } else {\n requestPermission(android.Manifest.permission.ACCESS_COARSE_LOCATION, PERMISSION_REQUEST_CODE_LOCATION, getActivity().getApplicationContext(),\n getActivity());\n }\n } else {\n requestPermission(android.Manifest.permission.ACCESS_FINE_LOCATION, PERMISSION_REQUEST_CODE_LOCATION, getActivity().getApplicationContext(),\n getActivity());\n }\n } else {\n gpsTracker.getLocation();\n }\n } catch (Exception e) {\n // logException(e, \"GpsMapManualFragment_checkLocationPermission()\");\n }\n\n\n }", "@Override\n\t\t\tpublic boolean onMyLocationButtonClick() {\n\t\t\t\tsupportClassObj.fitInMap(parentActivity.getItinerary(), googlemap, parentActivity);\n\t\t\t\treturn true;\n\t\t\t}", "private void pickCurrentPlace() {\n if (mMap == null) {\n return;\n }\n\n if (mLocationPermissionGranted) {\n getDeviceLocation();\n } else {\n // The user has not granted permission.\n Log.i(TAG, \"The user did not grant location permission.\");\n\n // Add a default marker, because the user hasn't selected a place.\n mMap.addMarker(new MarkerOptions()\n .title(getString(R.string.default_info_title))\n .position(mDefaultLocation)\n .snippet(getString(R.string.default_info_snippet)));\n\n // Prompt the user for permission.\n getLocationPermission();\n }\n }", "public abstract boolean isAllowableMovement(int[] location, double[] direction);", "public boolean canMove() {\n\n\tArrayList<Location> moveLocs = getValid(getLocation());\n\n\tif (isEnd == true) {\n\t return false;\n\t} \n\tif (!moveLocs.isEmpty()) {\n\t \n\t randomSelect(moveLocs);\n\t // selectMoveLocation(moveLocs);\n\t return true;\n\n\t} else {\n\t return false;\n\t}\n }", "@Override\n public void onLocationChanged(Location location) {\n }", "public boolean setTurnOnLocation() {\n boolean isTurn = checkTurnOnLocation();\n editor.putBoolean(Constans.KeyPreference.TURN_ON_LOCATION, !isTurn);\n editor.commit();\n return !isTurn;\n }", "@Override\n\tpublic void onLocationChanged(Location loc)\n\t{\n\t}", "@Override\n public void onPlaceSelected(int viewPosition) {\n if (mExternalEventListener != null){\n LocationData clickedPlace = null;\n /** make sure we have data for this place, for that check its state */\n try {\n clickedPlace = mRegistry.getPlaceByEncounter(viewPosition);\n /** make sure we have data for this place, for that check its state */\n PlaceUpdateState placeState = mRegistry.getPlaceState(clickedPlace);\n if (placeState == PlaceUpdateState.NameOnly){\n return;\n }\n }catch (IndexOutOfBoundsException e){\n Log.d(\"ForecastViewer\", \"Error, index out of bound because of unknown reason\");\n return;\n }\n mExternalEventListener.onPlaceSelected(clickedPlace);\n }\n }", "@Override\n\tpublic boolean canPlaceBlockAt(World world, int x, int y, int z) {\n\t\t//int currentID = world.getBlockId(x, y, z);\n\t\treturn (world.isAirBlock(x, y, z));\n\t}", "@Override\n\tpublic void onLocationChanged(Location arg0) {\n\n\t}", "@Override\n\tpublic void onLocationChanged(Location arg0) {\n\n\t}", "@Override\n \t\t\tpublic void onLocationChanged(Location loc) {\n \t \n \t\t\t}", "@Override\n public void onLocationChanged(Location location) {\n }", "public boolean hasLocation()\n {\n return targetLocation != null;\n }", "@Override\n\t\t\tpublic void onMapClick(LatLng arg0) {\n\t\t\t\tfinal LatLng location = arg0;\n \tAlertDialog builder = new AlertDialog.Builder(MainActivity.this)\n\t .setMessage(\"Do you want to add your location here?\")\n\t .setPositiveButton(\"Yes\", new DialogInterface.OnClickListener() {\n\t public void onClick(DialogInterface dialog, int id) {\n\t \t setFlag = true;\n\t \t myLocation = location;\n\t \t //use this flag to indicate that we want to see the path from current location or a set point\n\t \t Log.d(\"my location:\", \"\"+myLocation.latitude + myLocation.longitude);\n\t \t if(setFlag == true){\n\t \t\t if(myMarker != null){\n\t\t \t\t myMarker.remove();\n\t\t \t }\n\t\t \t myMarker = mMap.addMarker(new MarkerOptions().position(myLocation).title(\"myLocation\").draggable(true)\n\t\t \t\t\t\t\t\t.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_BLUE)));\n\t\t \t\t\t\t landmarks.addMarker(\"myLocation\", myMarker);\n\t \t } \n\t }\n\t })\n\t .setNegativeButton(\"Not now\", new DialogInterface.OnClickListener() {\n\t public void onClick(DialogInterface dialog, int id) {\n\t // User cancelled the dialog\n\t }\n\t }).create();\n \tbuilder.show();\n\t\t\t}", "@Override\n public void onMouseClicked(MapMouseEvent ev) {\n \tint respuesta= JOptionPane.showConfirmDialog(null, \"¿Desea guardar este punto?\", \"Confirmar\",JOptionPane.YES_NO_OPTION);\n \tif(respuesta==0) {\n \t\tString texto=JOptionPane.showInputDialog(null, \"Nombre del lugar\");\n \t\tDirectPosition2D p = ev.getWorldPos();\n System.out.println(p.getX() + \" -- \" + p.getY());\n drawMyPoint(p.getX(), p.getY(), map, texto);\n \t}\n \telse{\n \t\tSystem.out.println(\"Punto no guardado\");\n \t}\n \n }", "public boolean shouldChase(City city) {\n for (Human h : city.getHumans()) {\n if (this.isNear(h, city)) {\n return true;\n }\n }\n return false;\n }", "@Override\n public boolean isLocationFogged(XYCoord coord)\n {\n return isLocationFogged(coord.xCoord, coord.yCoord);\n }", "public boolean onGround() {\n return getLocation().getY() <= 0 || (interactingWithY != null && interactingWithY.getLocation().getY() + interactingWithY.size.height <= getLocation().getY());\n }", "public void onLocationChanged(Location location) {\n \n \t}", "public abstract boolean setLocation(World world, int coords[]);", "public void onLocationChanged(Location location) {\n }", "boolean hasLatitude();", "boolean hasLatitude();", "@Override\n\t\tpublic void onLocationChanged(Location location) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void onLocationChanged(Location location) {\n\t\t\t\n\t\t}", "public boolean isAssignedToLocation() {\n if (location == null) {\n return false;\n }\n return true;\n }", "private boolean knowMyLocation(LatLng myloc) {\n\t\tboolean isindoor = true;\n\t\tif((myloc.latitude>42.395||myloc.latitude<42.393) && (myloc.longitude>-72.528||myloc.longitude<-72.529)){\n\t\t\tisindoor = false;\n\t\t}\n\t\treturn isindoor;\n\t}", "private void checkLocationPermission() {\n\n if(ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED){\n //location permission required\n ActivityCompat.requestPermissions(this, new String[]\n {Manifest.permission.ACCESS_FINE_LOCATION}, PERMISSION_FINE_LOCATION);\n\n }else{\n //location already granted\n checkCoarseAddress();\n }\n }", "public void onLocationChanged(Location location){\n\n }", "private boolean getCenterGps() {\n return this.mapState != MapState.FREE && this.mapState != MapState.WP;\n }", "@Override\n\tpublic void setLocation(Point location) throws CannotPlaceUserException {\n\t\tsuper.setLocation(location);\n\t}", "private void getLocationPermission() {\n if (ContextCompat.checkSelfPermission(getActivity(),\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mLocationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(getActivity(),\n new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n }", "private boolean canSelectCurWorldType() {\n WorldType worldtype = WorldType.WORLD_TYPES[this.selectedIndex];\n if (worldtype != null && worldtype.canBeCreated()) {\n return worldtype == WorldType.DEBUG_ALL_BLOCK_STATES ? hasShiftDown() : true;\n } else {\n return false;\n }\n }", "@Override\n public void onLocationChanged(Location location) {\n\n }", "@Override\n public void onLocationChanged(Location location) {\n\n }", "@Override\n public void onLocationChanged(Location location) {\n Log.i(LOG_TAG, \"Location Change\");\n Location target = new Location(\"target\");\n String closePoint;\n int closestIndex = -1;// Default to none\n float minDistance = 1000; // Default to high value\n\n // Focus camera on initial location\n if (mapReady == true && initialCameraSet == true) {\n LatLng initialLocation = new LatLng(location.getLatitude(), location.getLongitude());\n gMap.moveCamera(CameraUpdateFactory.newLatLng(initialLocation));\n initialCameraSet = false; // Initial location already displayed\n }\n // Check if spot is close\n for (int i = 0; i < LocationsClass.spotsCoordinates.length; ++i) {\n target.setLatitude(LocationsClass.spotsCoordinates[i].latitude);\n target.setLongitude(LocationsClass.spotsCoordinates[i].longitude);\n if (location.distanceTo(target) < minDistance) {\n closestIndex = i; //Save closes index\n minDistance = location.distanceTo(target); // update minDistance\n }\n }\n\n if (minDistance < 200 && minDistance > 20) {\n Toast.makeText(getActivity(), \"Location: \" + LocationsClass.spotNames[closestIndex] +\n \" is within 200 meters!\\n\" + \"Go check it out!\", Toast.LENGTH_LONG).show();\n// pointsOfInterests.get(closestIndex).showInfoWindow();\n// gMap.getUiSettings().setMapToolbarEnabled(true);\n popNotification = true; // Allow notification to trigger when user reaches destination\n } else if (minDistance < 20) {\n if (closestIndex != currentUserLocation) {\n int locationId = getResources().getIdentifier(\"loc_\"+closestIndex, \"drawable\", getActivity().getPackageName());\n showArrivalNotification(locationId, LocationsClass.spotNames[closestIndex]);\n currentUserLocation = closestIndex; // Update user location\n }\n }\n\n if (hotspotIndex != -1) {\n pointsOfInterests.get(hotspotIndex).showInfoWindow();\n gMap.getUiSettings().setMapToolbarEnabled(true);\n }\n }", "public boolean canMoveTo(Position position){\n if(position.x > mapSize.x || position.x < 0 || position.y > mapSize.y || position.y < 0){\n return false;\n }\n return !isOccupied(position);\n }", "public void getLocationPermission() {\n if (ContextCompat.checkSelfPermission(getActivity().getApplicationContext(),\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mLocationPermissionGranted = true;\n } else {\n ActivityCompat.requestPermissions(getActivity(), new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n }", "private void updateLocationUI() {\n if (mMap == null) {\n return;\n }\n try {\n if (mLocationPermissionGranted) {\n mMap.setMyLocationEnabled(true);\n mMap.getUiSettings().setMyLocationButtonEnabled(true);\n } else {\n mMap.setMyLocationEnabled(false);\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n mLastKnownLocation = null;\n getLocationPermission();\n }\n } catch (SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n }", "private void updateLocationUI() {\n if (mMap == null) {\n return;\n }\n try {\n if (mLocationPermissionGranted) {\n mMap.setMyLocationEnabled(true);\n mMap.getUiSettings().setMyLocationButtonEnabled(true);\n } else {\n mMap.setMyLocationEnabled(false);\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n mLastKnownLocation = null;\n getLocationPermission();\n }\n } catch (SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n }", "private void updateLocationUI() {\n if (mMap == null) {\n return;\n }\n try {\n if (mLocationPermissionGranted) {\n mMap.setMyLocationEnabled(true);\n mMap.getUiSettings().setMyLocationButtonEnabled(true);\n } else {\n mMap.setMyLocationEnabled(false);\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n mLastKnownLocation = null;\n getLocationPermission();\n }\n } catch (SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n }", "@Test\n public void moveLocationTest()\n {\n boolean res1 = _city.moveLocation(1);\n boolean res2 = _city.moveLocation(3);\n assertTrue(res1);\n assertFalse(res2);\n }", "public native bool kbSetTownLocation(vector location);", "protected boolean isAcceptableDropLocation(DropTargetDragEvent dtde) {\n OtDragDropObject ddo = OtTreeDragSource._dragObject;\n if (ddo == null) {\n return false;\n }\n\n // MFO from ot-0.5\n // get the node under the mouse\n OtTreeNodeWidget node = getNode(dtde.getLocation());\n if (node == null) {\n return false;\n }\n\n return (getSpInsertData(ddo, node) != null);\n }", "public boolean canMoveTo (Coordinate c)\n\t{\n\t\tif (c.x < 0 || c.x >= GRID_SIZE){\n\t\t\treturn false;\n\t\t}\n\t\tif (c.y < 0 || c.y >= GRID_SIZE) {\n\t\t\treturn false;\n\t\t}\n\t\tif (grid[c.x][c.y] == GridChar.AVAILABLE || grid[c.x][c.y] == GridChar.END){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "private void setLocation() {\n switch (getKey()) {\n case UP:\n this.y_location = -136.8 - 6;\n this.y_tile = -1;\n this.positive = false;\n break;\n case DOWN:\n this.y_location = 136.8 + 6;\n this.y_tile = 1;\n break;\n case LEFT:\n this.x_location = -140.6 - 6;\n this.x_tile = -1;\n this.positive = false;\n break;\n case RIGHT:\n this.x_location = 140.6 + 6;\n this.x_tile = 1;\n break;\n default:\n break;\n }\n }", "private void getLocation() {\n\n }", "@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == 100) {\n if (resultCode != RESULT_OK)\n Toast.makeText(getContext(), \"GPS est déactivé\", Toast.LENGTH_LONG).show();\n else {\n if (ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED ||\n ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n setupmap();\n MapForm.setMyLocationEnabled(true);\n }\n }\n }\n }", "public boolean allowMove(Point p, int pos);", "@Override\n public void onPlaceSelected(Place place) {\n Log.i(TAG, \"Place: \" + place.getName() + \", \" + place.getId());\n\n move=place.getLatLng();\n moveCamera(move,15f);\n }", "@Override\n\t\t\tpublic void onLocationChanged(Location location) {\n\t\t\t\t\n\t\t\t\tmLatitude = location.getLatitude();\n\t\t\t\tmLongitude = location.getLongitude();\n\t\t\t\t\n\t\t\t\t LatLng point = new LatLng(mLatitude, mLongitude);\n\t\t\t\t\n\t\t\t\t try {\n\t\t\t\t \taddresses = geocoder.getFromLocation(location.getLatitude(), location.getLongitude(), 1);\n\t\t\t\t } catch (IOException e) {\n\t\t\t\t \t// TODO Auto-generated catch block\n\t\t\t\t \te.printStackTrace();\n\t\t\t\t }\n\t\t\t\t MarkerOptions maker= new MarkerOptions().position(point);\n\n\t\t\t\t address = addresses.get(0).getAddressLine(0);\n\t\t\t\t if(address==null)\n\t\t\t\t {\n\t\t\t\t\t maker.title(\"My Location\");\n\t\t\t\t\t\tgoogleMap.addMarker(maker);\n\t\t\t\t }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t\tmaker.title(\"\"+address);\n\t\t\t\t\tgoogleMap.addMarker(maker);\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t String type = mPlaceType;\n\t\t\t StringBuilder sb = new StringBuilder(\"https://maps.googleapis.com/maps/api/place/nearbysearch/json?\");\n\t\t\t sb.append(\"location=\"+mLatitude+\",\"+mLongitude);\n\t\t\t sb.append(\"&radius=1500\");\n\t\t\t sb.append(\"&types=\"+type);\n\t\t\t sb.append(\"&sensor=true\");\n\t\t\t sb.append(\"&key=AIzaSyAwZSGS1kZG7_UuqxqHH3MdO1hbwB2cjag\"); \n\t\t\t PlacesTask placesTask = new PlacesTask(); \n\t\t\t placesTask.execute(sb.toString());\n\t\t\t \n\t\t\t \n\t\t\t if(zoomm)\n\t\t\t {\n\t\t\t \t googleMap.animateCamera(CameraUpdateFactory.newCameraPosition(new CameraPosition(point, 15, 30, 0)));\n\t\t\t \t zoomm=false;\n\t\t\t }\n\t\t\t\t\n\t\t\t}", "private void updateLocationUI() {\n if (mMap == null) {\n return;\n }\n try {\n if (mLocationPermissionGranted) {\n mMap.setMyLocationEnabled(true);\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n } else {\n mMap.setMyLocationEnabled(false);\n mMap.getUiSettings().setMyLocationButtonEnabled(false);\n mLastKnownLocation = null;\n getLocationPermission();\n }\n } catch (SecurityException e) {\n Log.e(\"Exception: %s\", e.getMessage());\n }\n }", "private void setCurrentLocation() {\n foundLocation = false;\n //Ignore the red line - we check for permissions before this function is called\n if (ActivityCompat.checkSelfPermission(getContext(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &&\n ActivityCompat.checkSelfPermission(getContext(), Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n return;\n }\n googleMap.setMyLocationEnabled(true);\n FusedLocationProviderClient mFusedLocationProviderClient = LocationServices\n .getFusedLocationProviderClient(getActivity());\n //Ignore the red line - we check for permissions before this function is called\n Task<Location> lastLocation = mFusedLocationProviderClient.getLastLocation();\n lastLocation.addOnCompleteListener(task -> {\n if (task.isSuccessful()) {\n // Set the map's camera position to the current location of the device.\n Location location = task.getResult();\n if (location == null) {\n locationControlTask = new LocationControl();\n locationControlTask.execute(getActivity());\n } else {\n LatLng currentLatLng = new LatLng(location.getLatitude(),\n location.getLongitude());\n CameraUpdate update = CameraUpdateFactory.newLatLngZoom(currentLatLng,\n DEFAULT_ZOOM);\n googleMap.moveCamera(update);\n foundLocation = true;\n }\n }\n });\n }", "public void move (View view){\n\n if (toyRobotIsActive){//only run code after PLACE is DONE\n\n if (orientation == 0) {//Move while Facing North\n\n if((robot.getTranslationY()/perUnitY*(-1)) >=4) {\n System.out.println(\"Out of Bounds\");//Chk Error in Logs\n errorMessage(\"Out of Bounds\");//Error display to user via Toast\n } else {\n robot.animate().translationYBy(-perUnitY).setDuration(50);\n } //move robot 1 unit\n\n } else if (orientation == 3 || orientation == -1) {//Facing West\n if((robot.getTranslationX()/perUnitX) <= 0) {\n System.out.println(\"Out of Bounds\");\n errorMessage(\"Out of Bounds\");\n } else {\n robot.animate().translationXBy(-perUnitX).setDuration(50);\n }\n\n\n } else if (orientation == 2 || orientation == -2) {//Facing South\n if((robot.getTranslationY()/perUnitY)*(-1) <= 0){\n System.out.println(\"Out of Bounds\");\n errorMessage(\"Out of Bounds\");\n } else {\n robot.animate().translationYBy(perUnitY).setDuration(50);\n }\n\n\n } else if (orientation == 1 || orientation == -3) {//Facing East\n if((robot.getTranslationX()/perUnitX) >=4){\n System.out.println(\"Out of Bounds\");\n errorMessage(\"Out of Bounds\");\n } else {\n robot.animate().translationXBy(perUnitX).setDuration(50);\n }\n }\n } else errorMessage(\"Please place toy robot\"); //button not active if\n }", "@Override\n\tpublic boolean onTouchEvent(MotionEvent event) {\n\t\tswitch (event.getAction()) {\n\t\tcase MotionEvent.ACTION_DOWN:\n\t\tcase MotionEvent.ACTION_MOVE:\n\t\t\tcx = event.getX();\n\t\t\tcy = event.getY();\n\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t\treturn true;\n\t}", "@Override\n public void onLocationResult(LocationResult locationResult) {\n super.onLocationResult(locationResult);\n Log.d(TAG, \"onLocationResult: \");\n if (locationResult != null) {\n Log.d(TAG, \"onLocationResult: loaction!==null\");\n myLocation = locationResult.getLastLocation();\n showMarker();//de show hinh len\n }\n }", "private boolean isValidLocationFound() {\n return latitudeValue != null && longitudeValue != null;\n }", "private void phoneLocationChecked() {\n if (phoneLocation == null)\n return;\n phoneLocation.setShouldShowMarker(true);\n if (phoneLocation.latLon != null && !(phoneLocation.latLon.lat == 0 && phoneLocation.latLon.lon == 0)) {\n phoneLocation.showMarker();\n }\n\n if (kidLocation != null && !kidLocation.isLocating) {\n kidLocation.hideAddressCard();\n }\n phoneLocation.hideAddressCard();\n\n if (kidLocation != null) {\n kidLocation.showMarker();\n }\n\n boundKidAndPhoneMarkers();\n }", "@Override\r\n\tpublic boolean move(Tile newLocation){\r\n\t\tif(!newLocation.checkOccupied() && newLocation.attribute != Tile.typeAttributes.get(TileType.WALL_TILE)){\r\n\t\t\tcurrentPosition.pullUnit();\r\n\t\t\tthis.currentPosition = newLocation;\r\n\t\t\tthis.currentPosition.pushUnit(this);\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\tthis.act();\r\n\t\t}\r\n\t\treturn false;\r\n\t}" ]
[ "0.60897565", "0.60882235", "0.5928262", "0.58356744", "0.5800231", "0.56732696", "0.56549007", "0.55974495", "0.55681306", "0.55681306", "0.55088454", "0.55013674", "0.5498982", "0.54872763", "0.5479692", "0.5441052", "0.5440585", "0.5424474", "0.541707", "0.53928256", "0.5388159", "0.5347184", "0.5345497", "0.53423285", "0.5320876", "0.53153354", "0.5305953", "0.5297427", "0.5295209", "0.5290677", "0.5258788", "0.5244084", "0.5244084", "0.5244084", "0.5223822", "0.52080536", "0.51927346", "0.51895034", "0.51862943", "0.51829284", "0.5176265", "0.516367", "0.5161007", "0.5154717", "0.5153539", "0.5148563", "0.51412106", "0.5131901", "0.51318914", "0.5122219", "0.5122219", "0.51197237", "0.5113029", "0.51085526", "0.5095731", "0.50924665", "0.5085925", "0.5080934", "0.5073577", "0.50709945", "0.50684106", "0.50610507", "0.5060526", "0.5060526", "0.5057771", "0.5057771", "0.5055372", "0.50540584", "0.5053152", "0.50502086", "0.50455993", "0.50419694", "0.50401485", "0.5038223", "0.50372255", "0.50372255", "0.5036097", "0.503597", "0.50305736", "0.5026914", "0.5026914", "0.5026914", "0.50213945", "0.5018602", "0.50166315", "0.50160134", "0.5015613", "0.50112706", "0.5005747", "0.49909082", "0.49825314", "0.4979118", "0.49743056", "0.49678433", "0.49658716", "0.4960287", "0.49584198", "0.4957912", "0.49563235", "0.4955732" ]
0.61517507
0
This method is called whenever the user is trying to place the robber on the map. It is called by the view for each "mouse move" event. The returned value tells the view whether or not to allow the robber to be placed at the specified location.
boolean canPlaceRobber(HexLocation hexLoc);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract boolean canMoveTo(Case Location);", "boolean hasLocationView();", "@Override\n public void handle(MouseEvent event) {\n if( robberWillMove ){\n System.out.println(\"robber1\");\n robberWillMove = false;\n robberIsMoving = true;\n }\n }", "public boolean detectBound(){\n if(posX < 10){\n posX = 10;\n velX = 0;\n accX = 0;\n return true;\n }\n else if(posX > width - 10){\n posX = width - 10;\n velX = 0;\n accX = 0;\n return true;\n }\n if(posY < 10){\n posY = 10;\n velY = 0;\n accY = 0;\n return true;\n }\n else if(posY > height - 10){\n posY = height - 10;\n velY = 0;\n accY = 0;\n return true;\n }\n return false;\n }", "public abstract boolean actualPlace(int row, int col);", "public abstract boolean canMove();", "public abstract boolean isAllowableMovement(int[] location, double[] direction);", "public boolean allowMove(Point p, int pos);", "public boolean canMove(Location loc){\n if(loc.getX() >= theWorld.getX() || loc.getX() < 0){\n System.out.println(\"cant move1\");\n return false;\n }else if(loc.getY() >= theWorld.getY() || loc.getY() < 0){\n System.out.println(\"cant move2\");\n return false;\n }else{\n System.out.println(\"can move\");\n return true;\n }\n }", "private boolean canMove() {\n\t\tif (System.currentTimeMillis() - lastTrunTime < 300) {// move time is\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 300ms before\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// last move\n\t\t\treturn false;\n\t\t}\n\t\tboolean status = false;\n\t\tif(stage == 1){\n\t\t\tmap = GameView.map;\n\t\t}else if(stage == 2){\n\t\t\tmap = GameViewStage2.map;\n\t\t}else {\n\t\t\tmap = GameViewStage3.map;\n\t\t}\n\t\tif (direction == UP) {// when tank moves up\n\t\t\tif (centerPoint.getY() - speed >= 0) {\n\t\t\t\tif (map[(centerPoint.getY() - speed) / UNIT][centerPoint\n\t\t\t\t\t\t.getX() / UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() - speed) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() + UNIT) / UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() - speed) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() + 2 * UNIT) / UNIT] == 0) {\n\t\t\t\t\tstatus = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (direction == DOWN) {\n\t\t\tif (centerPoint.getY() + tankBmp.getHeight() + speed < screenHeight) {\n\t\t\t\tif (map[(centerPoint.getY() + 2 * UNIT + speed) / UNIT][centerPoint\n\t\t\t\t\t\t.getX() / UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + 2 * UNIT + speed)\n\t\t\t\t\t\t\t\t/ UNIT][(centerPoint.getX() + UNIT) / UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + 2 * UNIT + speed)\n\t\t\t\t\t\t\t\t/ UNIT][(centerPoint.getX() + 2 * UNIT) / UNIT] == 0) {\n\t\t\t\tstatus = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (direction == LEFT) {\n\n\t\t\tif (centerPoint.getX() - speed >= 0) {\n\t\t\t\tif (map[centerPoint.getY() / UNIT][(centerPoint.getX() - speed)\n\t\t\t\t\t\t/ UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + UNIT) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() - speed) / UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + 2 * UNIT) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() - speed) / UNIT] == 0) {\n\t\t\t\t\tstatus = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (direction == RIGHT) {\n\t\t\tif (centerPoint.getX() + tankBmp.getWidth() + speed < screenWidth) {\n\t\t\t\tif (map[centerPoint.getY() / UNIT][(centerPoint.getX()\n\t\t\t\t\t\t+ 2 * UNIT + speed)\n\t\t\t\t\t\t/ UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + UNIT) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() + 2 * UNIT + speed)\n\t\t\t\t\t\t\t\t/ UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + 2 * UNIT) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() + 2 * UNIT + speed)\n\t\t\t\t\t\t\t\t/ UNIT] == 0) {\n\t\t\t\t\tstatus = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (status)\n\t\t\tlastTrunTime = System.currentTimeMillis();\n\t\treturn status;\n\t}", "boolean canMove();", "protected boolean checkRep() {\n if ( this.getX() < 0 || this.getY() < 0 || this.getX() >= 20 || this.getY() >= 20 ) {\n return false;\n }\n return true;\n }", "boolean hasUserLocationView();", "public boolean detectBound(){\n if(posX < 0 || posX > width || posY < 0 || posY > height){\n return true;\n }\n else{\n return false;\n }\n }", "public void relocateToPoint(boolean isUserClick){\n// System.out.println(\"Scene x: \"+point.getX()+\", y: \"+point.getY());\n// System.out.println(\"Local x: \"+getParent().sceneToLocal(point).getX()+\", y: \"+getParent().sceneToLocal(point).getY());\n// System.out.println(\"Relocate x: \"+(getParent().sceneToLocal(point).getX() - (getWidth() / 2))+\", y: \"+(getParent().sceneToLocal(point).getY() - (getHeight() / 2)));\n// System.out.println(getBoundsInLocal().getWidth());\n// System.out.println(widthProperty());\n\n if (isUserClick) {\n double new_x=getParent().sceneToLocal(x,y).getX();\n double new_y=getParent().sceneToLocal(x,y).getY();\n setX(new_x);\n setY(new_y);\n relocate(\n// (getParent().sceneToLocal(x,y).getX() - (widthCountry / 2)),\n// (getParent().sceneToLocal(x,y).getY() - (heightCountry / 2))\n new_x,new_y\n );\n } else {\n relocate(x,y);\n }\n\n\n }", "public boolean canMove() {\n\n\tArrayList<Location> moveLocs = getValid(getLocation());\n\n\tif (isEnd == true) {\n\t return false;\n\t} \n\tif (!moveLocs.isEmpty()) {\n\t \n\t randomSelect(moveLocs);\n\t // selectMoveLocation(moveLocs);\n\t return true;\n\n\t} else {\n\t return false;\n\t}\n }", "boolean isPlaced();", "public void move (View view){\n\n if (toyRobotIsActive){//only run code after PLACE is DONE\n\n if (orientation == 0) {//Move while Facing North\n\n if((robot.getTranslationY()/perUnitY*(-1)) >=4) {\n System.out.println(\"Out of Bounds\");//Chk Error in Logs\n errorMessage(\"Out of Bounds\");//Error display to user via Toast\n } else {\n robot.animate().translationYBy(-perUnitY).setDuration(50);\n } //move robot 1 unit\n\n } else if (orientation == 3 || orientation == -1) {//Facing West\n if((robot.getTranslationX()/perUnitX) <= 0) {\n System.out.println(\"Out of Bounds\");\n errorMessage(\"Out of Bounds\");\n } else {\n robot.animate().translationXBy(-perUnitX).setDuration(50);\n }\n\n\n } else if (orientation == 2 || orientation == -2) {//Facing South\n if((robot.getTranslationY()/perUnitY)*(-1) <= 0){\n System.out.println(\"Out of Bounds\");\n errorMessage(\"Out of Bounds\");\n } else {\n robot.animate().translationYBy(perUnitY).setDuration(50);\n }\n\n\n } else if (orientation == 1 || orientation == -3) {//Facing East\n if((robot.getTranslationX()/perUnitX) >=4){\n System.out.println(\"Out of Bounds\");\n errorMessage(\"Out of Bounds\");\n } else {\n robot.animate().translationXBy(perUnitX).setDuration(50);\n }\n }\n } else errorMessage(\"Please place toy robot\"); //button not active if\n }", "public boolean canMove()\n {\n return canMove;\n }", "private boolean verifyBounds() {\r\n\t if((x>RobotController.BOUNDS_X || y>RobotController.BOUNDS_Y)\r\n\t || x<0 || y<0){\r\n\t return false;\r\n\t }\r\n\t return true;\r\n\t }", "private boolean canMove(Location location) {\n if (location == null) return false;\n return location.getWorld().intersects(this, Util.getRectangle(location, size)) == null && location.getY() >= 0 && location.getX() >= 0;\n }", "protected EventHandler<MouseEvent> activateBoat() {\n EventHandler<MouseEvent> mousePressHandler = new EventHandler<MouseEvent>() { \n @Override\n public void handle(MouseEvent event) {\n if(!isValidate) {\n if (event.getButton() == MouseButton.PRIMARY) {\n //If the user has clicked in the window and no other boat is already selected\n if (activeBoat == null) {\n Rectangle myRectangle =(Rectangle) event.getSource();\n BoatDrawing myboat = boatMap.get(myRectangle);\n activeBoat = myboat.setActiveBoat(boatMap);\n activeBoat.setPlaced(false);\n logMsg(EXPLAIN_PLACEMENT);\n }\n\n }\n }\n }\n };\n return mousePressHandler;\n \n }", "public boolean placementDone() {return placedShips == 4;}", "public void randomHit() throws LocationHitException{\r\n\t\t// Random ran = new Random();\r\n\t\tint x = randomX();\r\n\t\tint y = randomY();\r\n\r\n\t\tboolean newHit = false;\r\n\t\twhile (!newHit) {\r\n\t\t\tif (Player.userGrid[x][y] == 2) {\r\n\t\t\t\tx = ran.nextInt(9);\r\n\t\t\t\ty = ran.nextInt(11);\r\n\t\t\t} else\r\n\t\t\t\tnewHit = true;\r\n\t\t}\r\n\t\tint hitCoord[] = { x, y };\r\n\t\tsetCoords(hitCoord);\r\n\t\tString coordx = Integer.toString(x);\r\n\t\tString coordy = Integer.toString(y);\r\n\t\tif (Player.userGrid[x][y] == 1) {\r\n\t\t\t// change the grid value from 1 to 2 to signify hit\r\n\t\t\tPlayer.userGrid[x][y] = 2;\r\n\t\t\t\r\n\t\t\tif(!time1) {\r\n\t\t\t\ttimea=java.lang.System.currentTimeMillis();\r\n\t\t\t\ttime1=!time1;\r\n\t\t\t}else if(!time2) {\r\n\t\t\t\ttimeb=java.lang.System.currentTimeMillis();\r\n\t\t\t\t\ttime2=!time2;\r\n\t\t\t}else {\r\n\t\t\t\tdouble t=timeb-timea;\r\n\t\t\t\tif(t<3000) {\r\n\t\t\t\t\tsetScore(20);\r\n\t\t\t\t}\r\n\t\t\t\ttime1=false;\r\n\t\t\t\ttime2=false;\r\n\t\t\t\ttimea=0;\r\n\t\t\t\ttimeb=0;\r\n\t\t\t\t\r\n\t\t\t}//if time between consecutive hit is less than 3 seconds ,then bonus score\r\n\t\t\tsetScore(10);\r\n\t\t\tPlayer.coordinatesHit.add(coordx + \",\" + coordy);\r\n\t\t\tsetReply(\"It's a Hit!!!!!\");\r\n\r\n\t\t} else if (Player.userGrid[x][y] == 0) {\r\n\t\t\tPlayer.userGrid[x][y] = 3;\r\n\t\t\tsetScore(-1);\r\n\t\t\tsetReply(\"It's a miss!!!!!\");\r\n\t\t} else if (Player.userGrid[x][y] == 2 || Player.userGrid[x][y] == 3) {\r\n\t\t\tsetReply(\"The location has been hit earlier\");\r\n\t\t\t //throw new LocationHitException(\"The location has been hit earlier\");\r\n\t\t}\r\n\t}", "public boolean isPlaceable() {\n\t\tlong now = Calendar.getInstance().getTimeInMillis();\t\t\n\t\treturn now - createTime >= placeableThreshold && \n\t\t\t\tnow - focusTime >= placeableThreshold;\n\t}", "public abstract boolean hit(Rectangle2D r);", "public boolean wander() {\n\t\tMapLocation target = sensor.findTargetLocation();\n\t\treturn(nav.moveToLocation(target));\n\t}", "protected EventHandler<MouseEvent> MousePlaceBoat() {\n EventHandler<MouseEvent> mousePressGridHandler = new EventHandler<MouseEvent>() {\n @Override\n public void handle(MouseEvent event) {\n if (event.getButton() == MouseButton.PRIMARY) {\n if(activeBoat!=null){\n placeBoat(activeBoat);\n }\n }\n event.consume();\n }\n };\n return mousePressGridHandler;\n }", "@SuppressWarnings({\"SameParameterValue\", \"unused\"})\n public static void allowAccessToLocation(final Boolean value) {\n sAccessToLocation = value;\n }", "@Override\r\n\tpublic boolean canMove() {\r\n\t\treturn false;\r\n\t}", "public boolean getPanStatus() {\n return doPan;\n }", "private static void verifyViewPoint() {\n if (viewPoint.x < 0)\n viewPoint.x = 0;\n if (viewPoint.y < 0)\n viewPoint.y = 0;\n if (viewPoint.x > map.WIDTH - GAME_WIDTH * zoom)\n viewPoint.x = map.WIDTH - ((int) (GAME_WIDTH * zoom));\n if (viewPoint.y > map.HEIGHT - GAME_HEIGHT * zoom)\n viewPoint.y = map.HEIGHT - ((int) (GAME_HEIGHT * zoom));\n }", "@Override\n public boolean isLocationValid(int x, int y)\n {\n return master.isLocationValid(x, y);\n }", "public boolean checkRep() {\n return location.x() >= 0 && location.x() < board.getWidth() && \n location.y() >= 0 && location.y() < board.getHeight(); \n }", "@Override\n public void onMouseClicked(MapMouseEvent ev) {\n \tint respuesta= JOptionPane.showConfirmDialog(null, \"¿Desea guardar este punto?\", \"Confirmar\",JOptionPane.YES_NO_OPTION);\n \tif(respuesta==0) {\n \t\tString texto=JOptionPane.showInputDialog(null, \"Nombre del lugar\");\n \t\tDirectPosition2D p = ev.getWorldPos();\n System.out.println(p.getX() + \" -- \" + p.getY());\n drawMyPoint(p.getX(), p.getY(), map, texto);\n \t}\n \telse{\n \t\tSystem.out.println(\"Punto no guardado\");\n \t}\n \n }", "@objid (\"7f09cb7d-1dec-11e2-8cad-001ec947c8cc\")\n public boolean allowsMove() {\n return true;\n }", "@Override\r\n public boolean onPlace(BlockPlaceEvent event, BlockVector vector) {\n BlockVector doubleDoor = DoorHelper.getSecondIronDoor(vector);\r\n if (doubleDoor == null) {\r\n return false;\r\n }\r\n \r\n // check if there is a protection\r\n Protection protection = Core.protectionManager.getProtection(doubleDoor);\r\n if (protection == null) {\r\n return false;\r\n }\r\n \r\n // check permissions\r\n if (!protection.canEdit(event.getPlayer())) {\r\n PlayerUtils.sendError(event.getPlayer(), Core.NAME, \"You cannot place a door here.\");\r\n PlayerUtils.sendInfo(event.getPlayer(), \"The neighbour is a protected door.\");\r\n event.setCancelled(true);\r\n return true;\r\n }\r\n \r\n // send info\r\n PlayerUtils.sendInfo(event.getPlayer(), Core.NAME, \"Subprotection created.\");\r\n \r\n // return true to abort the event\r\n return true;\r\n }", "public HitWall() {\n\t\ttouch_r = Settings.TOUCH_R;\n\t\ttouch_l = Settings.TOUCH_L;\n\t\tpilot = Settings.PILOT;\n\t}", "private boolean placeFlag(Location m) {\r\n\r\n // if the game is finished then nothing to do\r\n if (gameState > STARTED) {\r\n return false;\r\n } \r\n \r\n // if the location is already revealed then nothing more to do\r\n if (query(m) != GameStateModel.HIDDEN && query(m) != GameStateModel.FLAG) {\r\n return false;\r\n }\r\n \r\n // otherwise toggle the flag\r\n flag[m.x][m.y] = !flag[m.x][m.y];\r\n \r\n if (flag[m.x][m.y]) {\r\n \r\n //if (board[m.x][m.y] != GameState.MINE) {\r\n // System.out.println(\"DEBUG (\" + m.x + \",\" + m.y + \") is not a mine!\");\r\n //}\r\n flagsPlaced++;\r\n } else {\r\n flagsPlaced--;\r\n }\r\n\r\n // call this handle to allow extra logic to be added by the extending class\r\n placeFlagHandle(m);\r\n \r\n return true;\r\n \r\n }", "private boolean isLocationAllowed() {\n int result = ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION);\r\n\r\n //If permission is granted returning true\r\n if (result == PackageManager.PERMISSION_GRANTED)\r\n return true;\r\n\r\n //If permission is not granted returning false\r\n return false;\r\n }", "@Override\n protected void checkLocation() {\n // nothing\n }", "public boolean canMoveTo(Position position){\n if(position.x > mapSize.x || position.x < 0 || position.y > mapSize.y || position.y < 0){\n return false;\n }\n return !isOccupied(position);\n }", "@Override\n\t\tprotected boolean condition() {\n\t\t\tWhichSide whichSide = VisionUtil.getPositionOfGearTarget();\n\t\t\tSystem.err.println(\"Position of gear target: \"+whichSide);\n\t\t\tif (whichSide == WhichSide.RIGHT)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public boolean imHovered(Point location) {\n\t\treturn false;\n\t}", "public boolean acceptsMouse() \n{\n // If hover shape, return false\n if(RMShapeUtils.getHoverShape()==this) return false;\n \n // Return true if there is a URL, Hover or MouseListener\n return getURL()!=null || getHover()!=null || getListenerCount(RMShapeMouseListener.class)>0;\n}", "public void correctPosition(Rectangle bounds) {\n\t\tif(!enabled())\n\t\t\treturn;\n\t\t\n\t\tbounds = Maths.wider(bounds, 20);\n\t\t\n\t\tif(!bounds.contains(renderX, track.getY())) {\n\t\t\trenderX = track.getX();\n\t\t}\n\t\tif(!bounds.contains(track.getX(), renderY)) {\n\t\t\trenderY = track.getY();\n\t\t}\n\t}", "@Override\n public void onCameraMove() {\n if(!markerClickflag)\n showMarkerButtons(false);\n }", "public abstract boolean pointerInside(int iPosX, int iPosY);", "protected abstract boolean dragged();", "public boolean inGoalRegion() {\n return position >= GOAL_POSITION;\n }", "public void checkwarp(){\n\t\tif(pacman.ypos > (colours[0].length*interval)-2){\r\n\t\t\tpacman.ypos = interval+2;\r\n\t\t}\r\n\t\telse if(pacman.xpos > (colours.length*interval)-2){\r\n\t\t\tpacman.xpos = interval+2;\r\n\t\t}\r\n\t\telse if(pacman.ypos < interval+2){\r\n\t\t\tpacman.ypos = (colours[0].length*interval)-2;\r\n\t\t}\r\n\t\telse if(pacman.xpos < interval+2){\r\n\t\t\tpacman.xpos = (colours.length*interval)-2;\r\n\t\t}\r\n\t\t\r\n\t}", "@Override\n public boolean canMove(double x, double y) {\n double xRec=rectangle.getX();\n double yRec=rectangle.getY();\n rectangle.setLocation((int)(xRec+x*1),(int)(yRec+y*1));\n\n List<Rectangle> staticRectangles= board.getStaticRectangles();\n List<Creature> creatures=board.getCreatures();\n Iterator<Rectangle> itr1=staticRectangles.iterator();\n\n while(itr1.hasNext()){\n Rectangle tmpRectangle =itr1.next();\n if(rectangle.intersects(tmpRectangle)) {\n return false;\n }\n }\n Iterator<Creature> itr2=creatures.iterator();\n while(itr2.hasNext()){\n Creature creature=itr2.next();\n if(creature==this){\n continue;\n }\n else{\n if(rectangle.intersects(creature.getRectangle()))\n return false;\n }\n\n }\n\n return true;\n }", "boolean canPickup(int x, int y) {\n return ((posX == x) && (posY == y));\n }", "public void update() {\n\t\t\n\t\tVector size = new Vector(Main.frame.getContentPane().getWidth() + 64, 64 + 64);\n\t\tposition = new Vector(0, Main.frame.getContentPane().getHeight() - 40);\n\t\t\n\t\tRectangle rect = new Rectangle(position, size);\n\t\t\n\t\tif (rect.contains(Mouse.getVector())) {\n\t\t\troom.isMouseOverGUI = true;\n\t\t}\n\t}", "@FXML\n private void mouseMove(MouseEvent event) {\n SolarSystem mouseOver = findClosestSolarSystem(new Point((int) event.getX() - 5, (int) event.getY() - 5));\n if (mouseOver != null) {\n drawUniverse();\n g.setStroke(Color.WHITE);\n g.setFill(Color.WHITE);\n g.strokeOval(event.getX() - 15, event.getY() - 15, 30, 30);\n g.fillText(mouseOver.name(), event.getX(), event.getY());\n if (travelable.contains(mouseOver)) {\n double radx = ((player.getCurrentSolarSystem().getX() * UNIVERSE_SCALE) - mapOffsetX - dragOffsetX) + (512 - mapOffsetX - dragOffsetX);\n double rady = ((player.getCurrentSolarSystem().getY() * UNIVERSE_SCALE) - mapOffsetY - dragOffsetY) + (288 - mapOffsetY - dragOffsetY);\n g.strokeLine(radx, rady, event.getX(), event.getY());\n }\n } else {\n drawUniverse();\n }\n }", "protected EventHandler<MouseEvent> drawBoatsNewPosition() {\n EventHandler<MouseEvent> mousePositionHandler = new EventHandler<MouseEvent>() {\n @Override\n public void handle(MouseEvent event) {\n if(activeBoat!=null){\n Node source = (Node)event.getSource() ;\n Integer colIndex = GridPane.getColumnIndex(source);\n Integer rowIndex = GridPane.getRowIndex(source);\n draw(activeBoat, colIndex, rowIndex); \n }\n event.consume();\n }\n };\n return mousePositionHandler;\n }", "public boolean canGetLocation() {\r\n return canGetLocation;\r\n }", "public boolean onTouchEvent(MotionEvent event) {\r\n int action = event.getActionMasked();\r\n switch (action) {\r\n //if the user touched the screen\r\n case MotionEvent.ACTION_DOWN: {\r\n //check if the input is inside the circle\r\n if(CheckIfInside(event.getX(), event.getY())) {\r\n this.playMoving = true;\r\n }\r\n break;\r\n }\r\n case MotionEvent.ACTION_MOVE: {\r\n if (!this.playMoving)\r\n return true;\r\n //make sure user input is inside limits\r\n if (CheckForLimit(event.getX(), event.getY())) {\r\n this.x = event.getX();\r\n this.y = event.getY();\r\n notifyObservers(normelizeAilron(this.x), normelizeElevator(this.y));\r\n invalidate();\r\n }\r\n break;\r\n }\r\n //user input's is finished\r\n case MotionEvent.ACTION_UP :\r\n this.playMoving = false;\r\n returnDefualt();\r\n //call on draw\r\n invalidate();\r\n }\r\n return true;\r\n }", "synchronized boolean go() {\n boolean retVal = false;\n if (!isVisible()) {\n retVal = true;\n //System.out.println(\"Tumbleweed.go-->not visible\");\n myJumpedOver = false;\n setVisible(true);\n // set the tumbleweed's position to the point\n // where it just barely appears on the screen\n // to that it can start approaching the cowboy:\n if (myLeft) {\n setRefPixelPosition(myCurrentRightBound, myY);\n move(-1, 0);\n } else {\n setRefPixelPosition(myCurrentLeftBound, myY);\n move(1, 0);\n }\n } else {\n //System.out.println(\"Tumbleweed.go-->visible\");\n }\n return (retVal);\n }", "public boolean inRange(){\n //System.out.println(\"inRange\");\n return Math.abs(GameView.instance.player.position.x - creationPoint.x) < GameView.instance.cameraSize * attackRange;\n }", "@Override\r\n public boolean canMove() {\r\n Grid<Actor> gr = getGrid();\r\n int dirs[] = {\r\n Location.AHEAD, Location.HALF_CIRCLE, Location.LEFT,\r\n Location.RIGHT };\r\n // 当终点在周围时,不能移动且isEnd应当为true\r\n for (int i = 0; i < dirs.length; i++) {\r\n Location tarLoc = getLocation().getAdjacentLocation(dirs[i]);\r\n if (gr.isValid(tarLoc) && gr.get(tarLoc) != null) {\r\n // Color直接用==计算竟然不可行(真是哔了dog...\r\n if (gr.get(tarLoc) instanceof Rock\r\n && gr.get(tarLoc).getColor().equals(Color.RED)) {\r\n isEnd = true;\r\n return false;\r\n }\r\n }\r\n }\r\n ArrayList<Location> nextLocs = getValid(getLocation());\r\n // 当附近没有可以移动的位置时,不能移动\r\n if (nextLocs.size() == 0) {\r\n return false;\r\n }\r\n // 当可以移动的位置>1时,说明存在一个节点,这个节点应当被新建一个arraylist入栈\r\n if (nextLocs.size() > 1) {\r\n ArrayList<Location> newStackElem = new ArrayList<Location>();\r\n newStackElem.add(getLocation());\r\n crossLocation.push(newStackElem);\r\n }\r\n // 有可以移动的位置时,向概率最高的方向移动\r\n int maxProbLoc = 0;\r\n // 由于nextLocs不一定有4个location,所以只好循环判断取最大值\r\n for (int i = 0; i < nextLocs.size(); i++) {\r\n Location loc = nextLocs.get(i);\r\n int dirNum = getLocation().getDirectionToward(loc) / 90;\r\n if (probablyDir[dirNum] > probablyDir[maxProbLoc]) {\r\n maxProbLoc = i;\r\n }\r\n }\r\n next = nextLocs.get(maxProbLoc);\r\n return true;\r\n }", "public boolean canMove() {\n return (Math.abs(getDist())>=50);\n }", "public boolean place(int posX, int posY, Direction direction) {\r\n\t\tboolean isInvalidPlaceParameter = !tabletop.canMove(posX, posY) || direction == null;\r\n\t\tif (isInvalidPlaceParameter) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tthis.posX = posX;\r\n\t\tthis.posY = posY;\r\n\t\tthis.direction = direction;\r\n\t\treturn true;\r\n\t}", "public abstract boolean canMove(int originX, int originY, int destX, int destY);", "public boolean canWalk() {\n\t\treturn rangeBottomLeft != null && !rangeBottomLeft.equals(location)\n\t\t\t\t&& rangeTopRight != null && !rangeTopRight.equals(location);\n\t}", "public boolean canMove (Location loc) {\n Grid<Actor> gr = getGrid();\n if (gr == null)\n return false;\n if (!gr.isValid(loc))\n return false;\n Actor neighbor = gr.get(loc);\n return !(neighbor instanceof Wall);\n }", "public boolean canMove() {\r\n return (state == State.VULNERABLE || state == State.INVULNERABLE);\r\n\r\n }", "public Location inRange()\n\t{\n\t\tboolean equals = false;\n\t\tif(getGrid() == null)\n\t\t\treturn null;\n\t\tfor(int i = -5; i < 6; i++)\n\t\t{\n\t\t\tfor(int j = -5; j < 6; j++)\n\t\t\t{\t\t\t\t\n\t\t\t\tif(getGrid().isValid(new Location(getLocation().getRow() + i, getLocation().getCol() + j)))\n\t\t\t\t{\n\t\t\t\t\tif(getGrid().get(new Location(getLocation().getRow() + i, getLocation().getCol() + j)) instanceof User)\n\t\t\t\t\t{\n\t\t\t\t\t\tequals = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tif(!equals)\n\t\t{\n\t\t\tArrayList<Location> locs = getGrid().getEmptyAdjacentLocations(getLocation());\n\t\t\tif(locs.size() != 0)\n\t\t\t\t return locs.get( (int) (Math.random() * locs.size()));\n\t\t\telse\n\t\t\t\treturn getLocation();\n\t\t}\n\t\t\t\n\t\tLocation moveLocation;\n\t\t\n\t\t\n\t\tif(getGrid().getNeighbors(getLocation()).contains(getGrid().getUser()))\n\t\t{\n\t\t\tmoveLocation = getGrid().getUser().getLocation();\n\t\t}\n\t\telse\n {\n PathFinder a = new PathFinder(getGrid(),20);\n Path path = a.findPath(this, this.getGrid().getUser().getLocation().getRow(), this.getGrid().getUser().getLocation().getCol(),true);\n if(path.getLength() != 0)\n moveLocation = a.findPath(this, this.getGrid().getUser().getLocation().getRow(), this.getGrid().getUser().getLocation().getCol(),true).getStep(0);\n else\n moveLocation = null;\n\n }\n\n\t\tif(moveLocation == null)\n\t\t{\n\t\t\tArrayList<Location> locs = getGrid().getEmptyAdjacentLocations(getLocation());\n\t\t\tif(locs.size() != 0)\n\t\t\t\tmoveLocation = locs.get( (int) (Math.random() * locs.size()));\n\t\t\telse\n\t\t\t\tmoveLocation = getLocation();\n\t\t}\n\t\t\n\t\treturn moveLocation;\n\t}", "private void move() {\n\n if(currentPosition.getX() == -1 && currentPosition.getY() == -1) {\n System.out.println(\"Robot is not placed, yet.\");\n return;\n }\n\n Position.Direction direction = currentPosition.getDirection();\n int newX = -1;\n int newY = -1;\n switch (direction) {\n case EAST:\n newX = currentPosition.getX() + 1;\n newY = currentPosition.getY();\n break;\n case WEST:\n newX = currentPosition.getX() - 1;\n newY = currentPosition.getY();\n break;\n case NORTH:\n newX = currentPosition.getX();\n newY = currentPosition.getY() + 1;\n break;\n case SOUTH:\n newX = currentPosition.getX();\n newY = currentPosition.getY() - 1;\n break;\n }\n\n if(newX < lowerBound.getX() || newY < lowerBound.getY()\n || newX > upperBound.getX() || newY > upperBound.getY()) {\n System.out.println(\"Cannot move to \" + direction);\n return;\n }\n\n currentPosition.setX(newX);\n currentPosition.setY(newY);\n }", "public boolean hitOrStand(){\r\n\t\treturn hitOrStand;\r\n\t}", "public boolean getCanSpawnHere()\n {\n return this.isValidLightLevel() && super.getCanSpawnHere();\n }", "public void move() {\n\t\t// Override move so we don't move, then get location set by owner.\n\t}", "boolean canMoveTo(Vector2d position);", "public abstract boolean changeMove();", "@Override\r\n\tpublic void canMoveArmLeg() {\n\t\tSystem.out.println(\"팔다리를 움직일 수 있습니다.\");\r\n\t}", "public boolean canGetLocation() {\r\n return this.canGetLocation;\r\n }", "void checkMyLocationVisibility() {\n if (settings.getReturnToMyLocation() || presenter.isTracking())\n showMyLocation();\n }", "@Override\n\t\t\tpublic boolean onMyLocationButtonClick() {\n\t\t\t\tsupportClassObj.fitInMap(parentActivity.getItinerary(), googlemap, parentActivity);\n\t\t\t\treturn true;\n\t\t\t}", "boolean hasLocation();", "boolean hasLocation();", "private boolean wrongPositioning(int x, int y, LoadedMap map) {\n boolean ans = false;\n if(hasAbove(x, y, map)&&(hasLeft(x, y, map)||hasRight(x, y, map))){\n ans = true;\n }else if (hasBelow(x, y, map)&&(hasLeft(x, y, map)||hasRight(x, y, map))) {\n ans = true;\n }\n return ans;\n }", "boolean wasHit();", "protected void warp() {\n\t\tRandom r = new Random();\n\t\t\n\t\t// Get random index from coordinates list\n\t\tint nextPos = r.nextInt(this.coords.length);\n\t\t\n\t\t// Set new position for monster\n\t\tthis.setBounds(this.coords[nextPos].width, this.coords[nextPos].height, mWidth, mHeight);\n\t\t\n\t\tthis.setVisible(true);\n\t}", "public void myLocationClick() {\n\n //Set the initial camera position to the current location\n GridPoint gridPoint = myGridPoint();\n float mpp = 1;\n\n if (gridPoint != null) {\n\n CameraPosition cameraPosition = new CameraPosition(gridPoint, mpp);\n mMap.moveCamera(cameraPosition, true);\n\n } else {\n\n //If GPS is off, notify the user to turn it on\n Toast.makeText(MainActivity.this,\"Turn on GPS.\",Toast.LENGTH_SHORT).show();\n\n }\n\n }", "private boolean setLocationInformation() {\n try {\n this.mPostModel.setLocationPost(mAutoCompleteTextView.getText().toString());\n\n if (StringEmptyUtil.isEmptyString(this.mPostModel.getLocationPost())) {\n Toast.makeText(getApplicationContext(), \"Please Select Location\", Toast.LENGTH_LONG).show();\n return false;\n }\n\n this.drop_location.setVisibility(View.VISIBLE);\n this.location_view.setVisibility(View.VISIBLE);\n this.current_location.setVisibility(View.VISIBLE);\n this.current_location.setText(this.mPostModel.getLocationPost());\n return true;\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n Toast.makeText(getApplicationContext(), \"Please Select Location\", Toast.LENGTH_LONG).show();\n\n return false;\n }", "public boolean canSpawnLightningBolt()\n {\n return this.func_150559_j() ? false : this.enableRain;\n }", "@Override\r\n\tpublic void mouseMoved(MouseEvent e) {\r\n\t\tlastPointOnScreen = e.getPoint();\t\t\t\r\n\t\t\r\n\t\tif(screenWidth != 0)//control looking around for first person\r\n\t\t{\r\n\t\taSquare.setAngularVelocity(2*Math.pow((e.getX() - screenWidth/2)/(screenWidth/2.),3));\r\n\t\t}\r\n\t\t\r\n\t\tif(showDebug)//select closest point to cursor for global var\r\n\t\t{\r\n\t\t\tdouble minDistance = 100.0;\r\n\t\t\tclosestPointToCursor = null;\r\n\t\t\t\r\n\t\t\tArrayList<PolygonD> objectsInScene = new ArrayList<PolygonD>();\r\n\t\t\tobjectsInScene.addAll(objects);\r\n\t\t\tobjectsInScene.add(currentShape);\r\n\r\n\t\t\t//iterate over all of the verts in all of the objects in the scene\r\n\t\t\tfor(PolygonD obj : objectsInScene)\r\n\t\t\t\tfor(PointD p : obj.getVerts())\r\n\t\t\t\t{\r\n\t\t\t\t\tdouble distance = (double)(new Vector(\r\n\t\t\t\t\t\t\tp, \r\n\t\t\t\t\t\t\tnew PointD(\r\n\t\t\t\t\t\t\t\t\te.getPoint().x - worldCenter.getX(),\r\n\t\t\t\t\t\t\t\t\te.getPoint().y - worldCenter.getY()\r\n\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t)).getMag();\r\n\t\t\t\t\tif(distance < minDistance)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t//set closest point to cursor\r\n\t\t\t\t\t\tminDistance = distance;\r\n\t\t\t\t\t\tclosestPointToCursor = p;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n public double getLocationX() {\n return myMovable.getLocationX();\n }", "@Override\r\n public boolean onTap(GeoPoint arg0, MapView arg1) {\n if(getMyLocation()!=null){\r\n int size = 30;\r\n Point out=new Point();\r\n mMapView.getProjection().toPixels(getMyLocation(), out); \r\n Rect rect = new Rect(out.x-size,out.y-size,out.x+size,out.y+size);\r\n mMapView.getProjection().toPixels(arg0, out);\r\n if(rect.contains(out.x, out.y)){\r\n //Log.e(\"MyLocation\", \"click my location \");\r\n mPopView.setVisibility(View.GONE);\r\n MapView.LayoutParams params = (MapView.LayoutParams) mPopView.getLayoutParams();\r\n params.x = 0;// Y轴偏移\r\n params.y = -5;// Y轴偏移\r\n GeoPoint point = getMyLocation().e();\r\n params.point = point;\r\n //mMapCtrl.animateTo(point);\r\n mMapView.updateViewLayout(mPopView, params);\r\n mPopView.setVisibility(View.VISIBLE);\r\n }else{\r\n mPopView.setVisibility(View.GONE) ; \r\n }\r\n }\r\n return super.onTap(arg0, arg1);\r\n }", "public boolean isAutoPosition();", "public boolean canGetLocation() {\n return this.canGetLocation;\n }", "public boolean canGetLocation() {\n return this.canGetLocation;\n }", "public boolean canGetLocation() {\n return this.canGetLocation;\n }", "public abstract boolean canMove(Rect rect, int xClearance, int yClearance);", "@Override\n public boolean onPlayAtLocation(GameState gameState, Location location) {\n if(gameState.tileAtLocation(location) && !gameState.wallAtLocation(location)) {\n gameState.addWall(location);\n return true;\n }\n else return false;\n }", "boolean insertRobot(Position pos, Robot rob);", "public void place(){\n\t\tplace((float) Math.floor(Main.mouseSelector.x)+0.5f,(float) Math.floor(Main.mouseSelector.y)+0.5f);\r\n\t}", "private boolean canMove() {\n return !(bestMove[0].getX() == bestMove[1].getX() && bestMove[0].getY() == bestMove[1].getY());\n }", "private void setLocation() {\n switch (getKey()) {\n case UP:\n this.y_location = -136.8 - 6;\n this.y_tile = -1;\n this.positive = false;\n break;\n case DOWN:\n this.y_location = 136.8 + 6;\n this.y_tile = 1;\n break;\n case LEFT:\n this.x_location = -140.6 - 6;\n this.x_tile = -1;\n this.positive = false;\n break;\n case RIGHT:\n this.x_location = 140.6 + 6;\n this.x_tile = 1;\n break;\n default:\n break;\n }\n }", "private boolean checkM(){\n if(currentLocation.x == previousLocation.x && currentLocation.y == previousLocation.y) {\n return false;\n }\n // Is outside the border\n if(currentLocation.x < size || currentLocation.y < size || currentLocation.x > map.numRows - size || currentLocation.y > map.numCols - size) {\n return false;\n }\n // Is on the land\n double angle2 = 0;\n while (angle2 < 6.3) {\n if (map.getTerrainGrid()[currentLocation.x + (int) (size/2 * cos(angle2))][currentLocation.y + (int) (size/2 * sin(angle2))] == Colors.OCEAN) {\n return false;\n }\n angle2 += 0.3;\n }\n return true;\n }" ]
[ "0.576041", "0.56302834", "0.55882454", "0.5565032", "0.55487114", "0.5527839", "0.55080086", "0.54497415", "0.5445263", "0.5436804", "0.53996104", "0.5374246", "0.5365637", "0.53655976", "0.5353175", "0.53456044", "0.5336818", "0.5334478", "0.53336763", "0.53302366", "0.5325098", "0.5321191", "0.53174865", "0.52867466", "0.5284268", "0.527839", "0.5277171", "0.5244927", "0.52442545", "0.52240455", "0.5217556", "0.5207413", "0.5196381", "0.51883197", "0.5177639", "0.5173127", "0.5171688", "0.51676136", "0.5164255", "0.51499856", "0.51487756", "0.51333505", "0.51304036", "0.5119728", "0.5119366", "0.51109", "0.5104888", "0.51047885", "0.50995046", "0.50990677", "0.50969976", "0.50959134", "0.5082072", "0.50802004", "0.5078961", "0.5070984", "0.5069386", "0.5067182", "0.50411135", "0.50371754", "0.5034117", "0.50312114", "0.50285393", "0.5022944", "0.5022814", "0.50219023", "0.5016403", "0.5015381", "0.5014072", "0.5010399", "0.5009441", "0.500125", "0.49991876", "0.4995259", "0.49909192", "0.4988454", "0.4987879", "0.4984534", "0.4982894", "0.4982894", "0.49761513", "0.49753025", "0.49719846", "0.49715242", "0.49701568", "0.49672893", "0.49671668", "0.49650988", "0.49616194", "0.49510565", "0.49400866", "0.49400866", "0.49400866", "0.49382564", "0.49348757", "0.49327987", "0.49310154", "0.4929483", "0.49294767", "0.49281588" ]
0.5340813
16
This method is called by the Rob View when a player to rob is selected via a button click.
void robPlayer(HexLocation location, int victimIndex);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void playerSelectionMade(View v) {\n final Animation animAlpha = AnimationUtils.loadAnimation(this, R.anim.anim_alpha);\n v.startAnimation(animAlpha);\n\n Intent intent = new Intent(this, GameResultActivity.class);\n intent.putExtra(PLAYER_CHOICE, v.getId());\n startActivity(intent);\n\n //Create Toast notification responding to player selection\n Integer playerChoice = GameUtils.formatPlayerChoice(v.getId());\n String toastText;\n switch(playerChoice)\n {\n case R.id.btnRock:\n toastText = \"Rock was clicked\";\n break;\n case R.id.btnPaper:\n toastText = \"Paper was clicked\";\n break;\n case R.id.btnScissors:\n toastText = \"Scissors was clicked\";\n break;\n case R.id.btnLizard:\n toastText = \"Lizard was clicked\";\n break;\n case R.id.btnSpock:\n toastText = \"Spock was clicked\";\n break;\n default:\n toastText = \"Error in selection\";\n break;\n }\n Toast toast = Toast.makeText(this, toastText, Toast.LENGTH_SHORT);\n toast.show();\n\n }", "public void onYesButtonClicked() {\n changeAfterClientPick();\n }", "public void onBoard(View view)\n {\n Intent intent = new Intent(this, Board.class);\n\n intent.putExtra(constants.player1Name, player1Name);\n intent.putExtra(constants.player2Name, player2Name);\n intent.putExtra(constants.currentPlayer, currentPlayer);\n\n intent.putExtra(constants.roundsLeft, roundsLeft);\n\n RadioGroup options = (RadioGroup) this.findViewById(R.id.gameOptions);\n int optionId = options.getCheckedRadioButtonId();\n\n if (optionId == R.id.dotCapture)\n {\n opt = constants.dotSelected;\n }\n else if (optionId == R.id.boxCapture)\n {\n opt = constants.boxSelected;\n }\n else\n {\n opt = constants.lineSelected;\n }\n\n intent.putExtra(constants.captureOption, opt);\n\n finish();\n startActivity(intent);\n }", "public void onClick(View v) {\n showSchedule(v);\n league_selected = leagues_sp.getSelectedItemPosition();\n Log.d(\"MainActivity\", \"Selected league is \" +league_selected);\n team_selected = teams_sp.getSelectedItem().toString();\n Log.d(\"MainActivity\", \"Selected team is \" +team_selected);\n }", "public void onClickPlayer() {\n carIcon.setOpacity(1);\n playerIcon.setOpacity(1);\n playerList.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> {\n displayUserInfo(newValue);\n });\n MAIN_MENU_AUDIO.play(Double.parseDouble(getInitData().get(\"SFXVol\")));\n }", "public void multiplayerSelected()\n {\n //call Client Controller's setState method with\n //a parameter of new ClientLobbyDiscoveryState()\n clientController.searchForGames();\n\n //populate the GameSelectScreen's text box with the lobbies from the\n //state\n gameSelectScreen.clearGames();\n\n //set state to GAMESELECT\n state = CurrentWindow.GAMESELECT;\n\n //hide the intro screen and show the game select screen\n introScreen.setVisible(false);\n gameSelectScreen.setVisible(true);\n }", "@Override\r\n\tpublic void onClick(View v) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\ttry {\r\n\t\t\t//===== Get Selected user values======//\r\n\t\t\tString userName = (String) sp.getSelectedItem();\r\n\t\t\titerator = db.rawQuery(\"SELECT * FROM UserStage WHERE User='\"\r\n\t\t\t\t\t+ userName + \"';\", null);\r\n\t\t\titerator.moveToFirst();\r\n\t\t\tint stage = iterator.getInt(iterator.getColumnIndex(\"Stage\"));\r\n\t\t\tint level = iterator.getInt(iterator.getColumnIndex(\"Level\"));\r\n\t\t\titerator.close();\r\n\t\t\tdb.close();\r\n\t\t\t//===== Get Selected user values======//\r\n\t\t\t\r\n\t\t\t//===== Start The Game ======//\r\n\t\t\tController.stage=stage;\r\n\t\t\tController.setUserName(userName);\r\n\t\t\tnew MyProgressBarMenu(getApplicationContext(),this, level).execute();\r\n\t\t\t//===== Start The Game ======//\r\n\t\t} catch (Exception e) {\r\n\t\t\tMyAlertBox mab=new MyAlertBox(this,\"2: \" + e.getMessage());\r\n\t\t}\r\n\t}", "@Override public void widgetSelected(SelectionEvent arg0) {\n\t\t\t if((gameAlive == false)&&(! (domain.getText().isEmpty()))&&(! algorithm.getText().isEmpty())&&(! hardLevel.getText().isEmpty())) {\r\n\t\t\t\t //get selected combos and start conversation with the model\r\n\t\t\t\t String s = \"SelectGame \"+domain.getText()+\":\"+hardLevel.getText()+\",SelectAlgoritm \"+algorithm.getText()+\",play\";\r\n\t\t\t\t actions = s.split(\",\");\r\n\t\t\t\t gameAlive = true;\r\n\t\t\t\t if(domain.getText().equals(\"TicTacToe\")) {\r\n\t\t\t\t\t board = new TicTacToeCanvas(shell, SWT.BORDER, view);\r\n\t\t\t\t\t shell.setSize(shell.getSize().x+1, shell.getSize().y+1);\r\n\t\t\t\t\t// board.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 3, 6));\r\n\t\t\t\t }\r\n\t\t\t\t else if(domain.getText().equals(\"Reversi\")) {\r\n\t\t\t\t\t board = new ReversiCanvas(shell, SWT.BORDER, view);\r\n\t\t\t\t\t shell.setSize(shell.getSize().x+1, shell.getSize().y+1);\r\n\t\t\t\t }\r\n\t\t\t\t try {\r\n\t\t\t\t\t startView();\r\n\t\t\t\t } catch (IOException e) {\r\n\t\t\t\t\t getExeptionMessage(e.getMessage());\r\n\t\t\t\t }\r\n\t\t\t }\r\n\t\t }", "protected void ACTION_B_SELECT(ActionEvent arg0) {\n\t\tchoseInterface();\r\n\t}", "public void singlePlayerSelected()\n {\n //call Client Controller's setState method with\n //a parameter of new ClientLobbyState()\n clientController.startSinglePlayerGame();\n }", "@Override\n\t\t\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\t\t\tmCurriculumVitaeInterface.onComputer();\n\t\t\t\t\t\t}", "@Override\n \t\t\tpublic void onClick(View v) {\n \t\t\t\tLog.d(\"VoMPCall\", \"Picking up\");\n \t\t\t\tServalBatPhoneApplication.context.servaldMonitor\n \t\t\t\t\t\t.sendMessage(\"pickup \"\n \t\t\t\t\t\t+ Integer.toHexString(local_id));\n \t\t\t}", "protected void PlayActionPerformed(ActionEvent e) {\n\t\tif(rdbtnNormal.isSelected())\n\t\t\tthis.difficulty=5;\n\t\telse if(rdbtnHard.isSelected())\n\t\t\tthis.difficulty=10;\n\t\telse if(rdbtnHell.isSelected())\n\t\t\tthis.difficulty=15;\n\t\telse\n\t\t\tthis.difficulty=1;\n\t\tthis.setVisible(false);\n\t\t\n\t\tTankClient tc = new TankClient();\n\t\tTankClient.difficulty=this.difficulty;\n\t\ttc.launchFrame();\n\t}", "@Override\n public void onClick(View v) {\n setGameTotal();\n\n // Call other player when click on hold\n callOtherPlayer();\n\n }", "private void leaderboardBtnListener() {\n leaderboardBtn.addListener(new ClickListener(){\n public void clicked(InputEvent event, float x, float y){\n ChessGame.client.ingame = false;\n game.setScreen(new LeaderboardScreen(game));\n }\n });\n }", "@Override\n\t\t\tpublic void onClick(View v)\n\t\t\t{\n\t\t\t\tif (checkbox.isChecked())\n\t\t\t\t{\n\t\t\t\t\t//add player to active roster\n\t\t\t\t\tInteger posInt = (Integer)v.getTag();\n\t\t\t\t\tint pos = posInt.intValue();\n\t\t\t\t\tcursor.moveToPosition(pos);\n\t\t\t\t\tString pId = cursor.getString(cursor.getColumnIndex(DatabaseHelper.COL_ID));\n\t\t\t\t\tactivity.db.updateActiveInfo(teamId, pId, 1);\n\t\t\t\t\tactivity.updateActiveCount();\n\t\t\t\t\t//update the \"active\" count\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//remove player from active roster\n\t\t\t\t\tInteger posInt = (Integer)v.getTag();\n\t\t\t\t\tint pos = posInt.intValue();\n\t\t\t\t\tcursor.moveToPosition(pos);\n\t\t\t\t\tString pId = cursor.getString(cursor.getColumnIndex(DatabaseHelper.COL_ID));\n\t\t\t\t\tactivity.db.updateActiveInfo(teamId, pId, 0);\n\t\t\t\t\tactivity.updateActiveCount();\n\t\t\t\t\t//update the \"active\" count\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}", "public void R2Pressed() {\n\t\tif (edit) {\n\t\t\tcurrentDeck.setActive(false);\n\t\t\tSoundPlayer.playSound(SoundMap.MENU_SWITCH_DECK);\n\t\t\tswitchDeck();\n\t\t}\n\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tLog.d(TAG,\"btnConnect OnClick()...\");\n\t\t\t\twhatIShouldChoose();\n\t\t\t}", "public void hitButtonClicked()\r\n {\r\n Card hit = game.hit(\"Player\");\r\n playerCardList.get(nextPlayerIndex).setImage(hit.toGraphic());\r\n nextPlayerIndex++;\r\n if(game.checkLose())\r\n {\r\n playerLost();\r\n }\r\n }", "protected void changeSideClicked(ActionEvent e) {\n blackPlayer = 1 - blackPlayer;\n updateTurnInfo();\n startNewGame();\n }", "public void actionPerformed(ActionEvent e) {\n\t\t\t\t\r\n\t\t\t\tcontroller.newShot();\r\n\t\t\t\tint selected = clubList.getSelectedIndex();\r\n\t\t\t\tif (selected >= 0){\r\n\t\t\t\t\tString selectedClub = (String)clubList.getModel().getElementAt(selected);\r\n\t\t\t\t\tcontroller.selectClub(selectedClub);\r\n\t\t\t\t\tcontroller.startShot();\r\n\t\t\t\t\t\r\n\t\t\t\t\tUI.getInstance().show(PanelNames.END_SHOT);\r\n\t\t\t\t\tclubList.clearSelection();\r\n\t\t\t\t}\r\n\t\t\t}", "public abstract boolean onButtonClick(Player player, int button);", "@Override\n\t\t\tpublic void clicked(InputEvent event, float x, float y) {\n\t\t\t\tdispose();\n\t\t\t\tgame.setScreen(new LobbyScreen(game)); // Switch over to lobby screen\n\t\t\t}", "public void takeTurn(){\r\n //Handled by GameWindow buttons\r\n }", "public void buttonClicked() {\n mSanitizorGame.buttonClicked();\n }", "@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\n\t\tObject o = arg0.getSource();\n\t\t\n\t\tif(o.equals(go))\n\t\t{\n\t\t\tif(all.isSelected()==true)\n\t\t\t{\n\t\t\t\t\n\t\t\t\t//System.exit(0);\n\t\t\t\tView_FragMain x=new View_FragMain();\n\t\t\t}\n\t\t\tif(bud.isSelected())\n\t\t\t{\n\t\t\t\t// connect BUDDY SYSTEM here....\n\t\t\t\tBuddy1_1 b1 = new Buddy1_1();\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t}", "@Override\n public void onBoomButtonClick(int index) {\n }", "public void onRollClick() {\n game.TakeTurn(player1);\n game.TakeTurn(computer);\n undoButton.setDisable(false);\n resetButton.setDisable(false);\n updateFields(\"player\");\n updateFields(\"computer\");\n setLeadPlayerImage();\n checkGame();\n }", "@Override\n public void onTeamButtonClick() {\n Toast.makeText(this, \"onTeamButtonClick\",Toast.LENGTH_SHORT).show();\n Intent intent = new Intent(Intent.ACTION_PICK);\n intent.setType(ContactsContract.Contacts.CONTENT_TYPE);\n if (intent.resolveActivity(getPackageManager()) != null) {\n startActivityForResult(intent, REQUEST_SELECT_CONTACT);\n }\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tCursurIndex = 5;\n\t\t\t\tHandleCursurDisplay.sendMessage(HandleCursurDisplay.obtainMessage(CursurIndex));\n\t\t\t\tClickOK();\n\t\t\t}", "private void choseLocal(java.awt.event.MouseEvent evt) { \n\t\tgameChoice = 'a';\n\t\twindowComplete = true;\n\t}", "public void actionPerformed(ActionEvent e) {\n\t\tplayerSelectNum++;\n\t\tfor (int i = 0; i<charButtons.size(); i++){\n\t\t\tif (e.getSource() == charButtons.get(i)){\n\t\t\t\tcharButtons.get(i).setEnabled(false);\n\t\t\t\tselection = new PlayerInfo(name, characters.get(i));\n\t\t\t\t\n\t\t\t}\n\t\t}\t\n\t\tif (playerSelectNum == 1){\n\t\t\tCLOGameClient c = new CLOGameClient(selection);\n\t\t\tdispose();\n\t\t}\n\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tllistenBtnset();\n\t\t\t}", "@Override\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\trb.performClick();\n\t\t\t\t\t}", "public void buttonPress(ActionEvent event) {\r\n Button clickedButton = (Button) event.getSource();\r\n String selectedButton = clickedButton.getId();\r\n System.out.print(selectedButton);\r\n \r\n // If the user correctly guesses the winning button\r\n if (correctButtonName.equals(selectedButton)) {\r\n \r\n //Displays a popup alerting the user that they won the game.\r\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\r\n alert.setTitle(\"You Win!\");\r\n alert.setHeaderText(\"Congratulations, you found the treasure!\");\r\n alert.setContentText(\"Would you like to play again?\");\r\n ButtonType okButton = new ButtonType(\"Play again\");\r\n ButtonType noThanksButton = new ButtonType(\"No Thanks!\");\r\n alert.getButtonTypes().setAll(okButton, noThanksButton);\r\n Optional<ButtonType> result = alert.showAndWait();\r\n \r\n //If the user selects \"Play again\" a new button will be randomly selected\r\n if (result.get() == okButton ){\r\n //Chooses a random button from the list of buttons\r\n correctButtonName = buttonList[(int)(Math.random() * buttonList.length)];\r\n }\r\n //If the user does not select \"Play again\", the application will be closed\r\n else {System.exit(0);}\r\n \r\n }\r\n \r\n //If the user chooses any button except for the winning button\r\n else if (!selectedButton.equals(correctButtonName)) {\r\n \r\n //Displays a popup alerting the user that they did not find the treasure.\r\n Alert alert2 = new Alert(Alert.AlertType.INFORMATION);\r\n alert2.setTitle(\"No treasure!\");\r\n alert2.setHeaderText(\"There was no treasure found on that island\");\r\n alert2.setContentText(\"Would you like to continue searching for treasure?\");\r\n ButtonType ayeCaptain = new ButtonType (\"Continue Searching\");\r\n ButtonType noCaptain = new ButtonType (\"Quit\");\r\n alert2.getButtonTypes().setAll(ayeCaptain,noCaptain);\r\n Optional<ButtonType> result2 = alert2.showAndWait();\r\n \r\n if (result2.get() == ayeCaptain){\r\n //The search for treasure continues!\r\n }\r\n else{ \r\n System.exit(0);\r\n }\r\n }\r\n }", "public void pickUp(Player player) {\n player.setBox(this);\n }", "protected final void onSelect(CommandSender sender) {\n setInteracting(sender);\n onSelect();\n }", "protected void doBridgeClick() {\r\n\t\tuiSound.playSound(\"Bridge\");\r\n\t\tif (onBridgeClicked != null) {\r\n\t\t\tonBridgeClicked.invoke();\r\n\t\t}\r\n\t}", "private void select(ActionEvent e){\r\n // Mark this client as an existing client since they are in the list\r\n existingClient = true;\r\n // To bring data to Management Screen we will modify the text fields\r\n NAME_FIELD.setText(client.getName());\r\n ADDRESS_1_FIELD.setText(client.getAddress1());\r\n ADDRESS_2_FIELD.setText(client.getAddress2());\r\n CITY_FIELD.setText(client.getCity());\r\n ZIP_FIELD.setText(client.getZip());\r\n COUNTRY_FIELD.setText(client.getCountry());\r\n PHONE_FIELD.setText(client.getPhone());\r\n // client.setAddressID();\r\n client.setClientID(Client.getClientID(client.getName(), client.getAddressID()));\r\n // Pass client information to Client Management Screen\r\n currClient = client;\r\n back(e);\r\n }", "Player getSelectedPlayer();", "@Override\n\t\tpublic void actionPerformed(ActionEvent e)\n\t\t{\n\t\t\tif (getSelected() == null)\n\t\t\t{\n\t\t\t\tprintMsg(\"Select cards to play.\\n\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tgame.makeMove(activePlayer, getSelected());\n\t\t\t}\n\t\t}", "@Override\n public void pressMovieButton() {\n System.out.println(\"Home: You must pick an app to show movies.\");\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tfireSwitchSceneEvent(new SwitchSceneEvent(this, new DiningRoomScene(player)));\n\t\t\t}", "private void setPlayer(BoardSquaresState player){\n\t\tif(player == BoardSquaresState.CROSS){\n\t\t\tselectedPlayer = BoardSquaresState.CROSS;\n\t\t\tplayerSelectionButton.setText(R.id.button_title, \"Cross\");\n\t\t\tplayerSelectionButton.setText(R.id.button_subtitle, \"You go first!\");\n\t\t\tplayerSelectionButton.setImageResource(R.id.selector_button_image, R.drawable.cross_1);\n\t\t\tplayerSelectionButton.setImageResource(R.id.item_set_image, R.drawable.btn_check_on_focused_holo_light);\n\t\t}\n\t\telse{\n\t\t\tselectedPlayer = BoardSquaresState.NOUGHT;\n\t\t\tplayerSelectionButton.setText(R.id.button_title, \"Nought\");\n\t\t\tplayerSelectionButton.setText(R.id.button_subtitle, \"Computer goes first!\");\n\t\t\tplayerSelectionButton.setImageResource(R.id.selector_button_image, R.drawable.nought_1);\n\t\t\tplayerSelectionButton.setImageResource(R.id.item_set_image, R.drawable.btn_check_on_focused_holo_light);\n\t\t}\n\n\t}", "@FXML\n\tprivate void userClicked(MouseEvent event) {\n\t\tuserList.getSelectionModel().getSelectedItem();\n\t\tString newConversation = userList.getSelectionModel().getSelectedItem();\n\t\tif (newConversation.equals(this.currentConversation)) {\n\t\t\treturn;\n\t\t}\n\t\tif (!sassiBot) {\n\t\t\tconversantName.setText(userList.getSelectionModel().getSelectedItem());\n\t\t\tSystem.out.println(this.conversations);\n\t\t\tSystem.out.println(newConversation);\n\t\t\tchatView.setText(\"\");\n\t\t\tfor (ArrayList <String> conversation : this.conversations) {\n\t\t\t\tif (newConversation.equals(String.join(\", \", conversation))) {\n\t\t\t\t\tclient.updateGroup(conversation);\n\t\t\t\t\tSystem.out.println(\"UPDATE GROUP\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis.currentConversation = newConversation;\n\t\tif (!sassiBot) {\n\t\t\tconversantImage.setVisible(true);\n\t\t\tgreenCircle.setVisible(true);\n\t\t}\n\t}", "@Override\n public void onClick(View view)\n {\n if (!team.OnClicked(pView))\n teamClickState.val = 0;\n\n // Register this as only active item\n statusBar.registerOnClicked(this);\n clickedListener.val = this;\n\n activity.runOnUiThread(new Runnable()\n {\n @Override\n public void run()\n {\n switch (teamClickState.val) {\n case 0:\n clearViews();\n state0(); // HeatMap\n teamClickState.val = 1;\n break;\n case 1:\n clearViews();\n state1(); // Passes by player\n teamClickState.val = 2;\n break;\n case 2:\n clearViews();\n state2(); // Passes to player\n teamClickState.val = 3;\n break;\n case 3:\n reset();\n break;\n }\n }\n });\n }", "public void mousePressed(MouseEvent event) { \n\t\t\t\t\n\t\tswitch(imgName) // Exécute une action différente en fonction du nom du bouton\n\t\t{\n\t\t\tcase \"endTurn\":\n\t\t\t\tGUI.getPlayer().setRoundCompleted(true);\n\t\t\t\tbreak;\n\t\t\tcase \"roads\":\n\t\t\t\tif(GUI.getPlayer().getNbRoad() > 0)\n\t\t\t\t{\n\t\t\t\t\tif(!this.isSelected) \n\t\t\t\t\t{\n\t\t\t\t\t\tthis.setSelected(true);\t\n\t\t\t\t\t\tBoardView.setAction(6);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.setSelected(false);\t\n\t\t\t\t\t\tBoardView.setAction(0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"bonusTools\":\n\t\t\tcase \"bonusDefense\":\n\t\t\t\tif(GUI.getPlayer().getDiceBonus() == 5)\n\t\t\t\t{\n\t\t\t\t\tif(imgName == \"bonusTools\")\n\t\t\t\t\t\tGUI.getPlayer().setNbBonus(0, GUI.getPlayer().getNbBonus(0) + 1);\n\t\t\t\t\telse\n\t\t\t\t\t\tGUI.getPlayer().setNbBonus(1, GUI.getPlayer().getNbBonus(1) + 1);\n\t\t\t\t\t\n\t\t\t\t\tGUI.getPlayer().setDiceBonus(0);\n\t\t\t\t}\n\t\t\t\telse if(GUI.getPlayer().getNbBonus((imgName == \"bonusTools\") ? 0 : 1) > 0)\n\t\t\t\t{\n\t\t\t\t\tif(!this.isSelected) \n\t\t\t\t\t{\n\t\t\t\t\t\tthis.setSelected(true);\n\t\t\t\t\t\tif(imgName == \"bonusTools\")\n\t\t\t\t\t\t\tBoardView.setAction(7);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tBoardView.setAction(8);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.setSelected(false);\t\n\t\t\t\t\t\tBoardView.setAction(0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"hand\":\n\t\t\t\tif(!this.isSelected) \n\t\t\t\t{\n\t\t\t\t\tthis.setSelected(true);\t\n\t\t\t\t\tGUI.getDrawHandView().display();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthis.setSelected(false);\t\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tif(GUI.getPlayer().getActions().size() >= GUI.getPlayer().getNbActionsAllowed() && !GameManager.devMode)\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\tif(!this.isSelected)\n\t\t\t\t{\n\t\t\t\t\tthis.setSelected(true);\t\n\t\t\t\t\t\n\t\t\t\t\tswitch(imgName)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase \"tile\":\n\t\t\t\t\t\t\tGUI.getDrawTileView().display();\n\t\t\t\t\t\t\tBoardView.setAction(1);\n\t\t\t\t\t\t\tGUI.getPlayer().addAction(1);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"road\":\n\t\t\t\t\t\t\tGUI.getPlayer().setNbRoad(GUI.getPlayer().getNbRoad() + 1);\n\t\t\t\t\t\t\tGUI.getPlayer().addAction(2);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"monster\":\n\t\t\t\t\t\t\tBoardView.setAction(3);\n\t\t\t\t\t\t\tGUI.getPlayer().addAction(3);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"architect\":\n\t\t\t\t\t\t\tBoardView.setAction(4);\n\t\t\t\t\t\t\tGUI.getPlayer().addAction(4);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"goal\":\n\t\t\t\t\t\t\tGUI.getDrawGoalView().display();\n\t\t\t\t\t\t\tGUI.getPlayer().addAction(5);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(!GameManager.devMode)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(GUI.getPlayer().getDiceBonus() != 3)\n\t\t\t\t\t\t\tthis.setVisible(false);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tif(GUI.getPlayer().getActions().size() > 1)\n\t\t\t\t\t\t\t\tthis.setVisible(false);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tthis.setSelected(false);\n\t\t\t\tbreak;\n\t\t}\n\t}", "protected void onSelectionPerformed(boolean success) {\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tCursurIndex = 3;\n\t\t\t\tHandleCursurDisplay.sendMessage(HandleCursurDisplay.obtainMessage(CursurIndex));\n\t\t\t\tClickOK();\n\t\t\t}", "@SuppressLint(\"SetTextI18n\")\n public void setClicked(View view) {\n\n playersCount++;\n TextView textView = findViewById(R.id.textView2);\n TextView textPlayer1 = findViewById(R.id.textView3);\n TextView textPlayer2 = findViewById(R.id.textView4);\n Button button = findViewById(R.id.button);\n EditText editText = findViewById(R.id.editText);\n\n // adds player's names to screen\n if (playersCount == 1) {\n player1 = editText.getText().toString();\n editText.setHint(\"Player\");\n textPlayer1.setText(player1);\n } else if (playersCount == 2) {\n player2 = editText.getText().toString();\n textPlayer2.setText(player2);\n editText.setVisibility(View.INVISIBLE);\n button.setVisibility(View.INVISIBLE);\n textView.setText(\"\");\n }\n\n editText.setText(\"\");\n\n }", "private void goToSelectionScreen(User user){\n Intent i = new Intent(getApplicationContext(), PlaySelectionActivity.class);\n i.putExtra(\"user\", user);\n startActivity(i);\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tgsv.startSelectState();\n\t\t\t}", "@Override\r\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\treceive();\r\n\t\t\t}", "public void clickMovie()\n\t{\n\n\t\t// code to change the displayed photo\n\t\tSystem.out.println(\"clicked on \" + movieList.getSelectionModel().getSelectedItem());\n\n\t\t// code to change the displayed description, available times and the displayed photo\n\t\tfor (int i = 0; i < movieListItems.size(); i++)\n\t\t{\n\t\t\tif (movieList.getSelectionModel().getSelectedItem().equals(movieListItems.get(i)))\n\t\t\t{ Image validImage = null;\n\t\t\tVariableTracker.movieTitle=movieListItems.get(i);\n\t\t\tVariableTracker.movieDescription=movieDescription.get(i);\n\t\t\t\tdescription.setText(movieDescription.get(i));\n\t\t\t\ttry {\n\t\t\t\t\tFile file = new File(ImagesPath.get(i));\n\t\t\t\t\tImage image = new Image(file.toURI().toString());\n\t\t\t\t\tvalidImage = image;\n\t\t\t\t}\n\t\t\t\tcatch (NullPointerException e)\n\t\t\t\t{\n\t\t\t\t\tFile file = new File(\"assets/placeholder.png\");\n\t\t\t\t\tImage image = new Image(file.toURI().toString());\n\t\t\t\t\tvalidImage = image;\n\t\t\t\t}\n\t\t\t\tVariableTracker.movieImage=validImage;\n\t\t\t\tiv.setImage(validImage);\n\t\t\t\tObservableList<String> movieTimesItems = FXCollections.observableArrayList();\n\t\t\t\tfor (int j = 0; j < movieTimesList.get(i).length; j++)\n\t\t\t\t{\n\t\t\t\t\tmovieTimesItems.add(movieTimesList.get(i)[j]);\n\t\t\t\t}\n\t\t\t\tmovieTimes.setItems(movieTimesItems);\n\t\t\t}\n\t\t}\n\n\t\t// code to change the available times\n\n\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tClickOK();\n\t\t\t\tCursurIndex = 3;\n\t\t\t\tHandleCursurDisplay.sendMessage(HandleCursurDisplay.obtainMessage(CursurIndex));\n\t\t\t}", "@Override\n public void pressNetflixButton() {\n System.out.println(\"Loading Netflix...\\n\");\n tv.setState(tv.getNetflixState());\n }", "@Override\r\n\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\treceive();\r\n\t\t\t\t}", "public void selectPressed() {\n\t\tif (edit) {\n\t\t\tdisplayCardHelp = !displayCardHelp;\n\t\t} else {\n\t\t\tSoundPlayer.playSound(SoundMap.MENU_ERROR);\n\t\t}\n\t}", "private void currentGamesBtnListener() {\n currentGamesBtn.addListener(new ClickListener(){\n public void clicked(InputEvent event, float x, float y){\n ChessGame.client.ingame = false;\n game.setScreen(new CurrentGamesScreen(game));\n }\n });\n }", "public void actionPerformed(ActionEvent arg0) {\n\t\t\t\tloadPlayerPanel((Player)playerBox.getSelectedItem());\n\t\t\t}", "protected void doScreenClick() {\r\n\t\tbtnColonyInfo.visible = btnButtons.down;\r\n\t\tbtnPlanet.visible = btnButtons.down;\r\n\t\tbtnStarmap.visible = btnButtons.down;\r\n\t\tbtnBridge.visible = btnButtons.down;\r\n\t\trepaint();\r\n\t}", "public void playerView(View view) {\n PlayerCapabilityFacade pcf = new PlayerCapabilityFacade();\n Intent intent;\n if(pcf.isTournamentActive()) {\n intent = new Intent(ModeSelectionActivity.this, PlayerTourneyActivity.class);\n } else {\n intent = new Intent(ModeSelectionActivity.this, PlayerTotalsActivity.class);\n }\n\n startActivity(intent);\n\n //else onclick go to PlayerTourneyActivity\n }", "private void assignButtonClick() {\n\n selectedPlayers.clear();\n final CharSequence[] p = new CharSequence[players.size()];\n final boolean[] pChecked = new boolean[p.length]; // array of booleans to record which saved players are ticked for randomisation\n for (int i = 0; i < players.size(); i++) {\n p[i] = players.get(i).toString();\n }\n\n final AlertDialog.Builder builder = new AlertDialog.Builder(this);\n\n if (players.size() > 0) {\n builder.setTitle(\"Select the players present...\");\n builder.setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n\n @Override\n public void onClick(DialogInterface dialog, int which) { // When the used pressed \"OK\"\n\n for (int i = 0; i < p.length; i++) {\n if (pChecked[i]) { // if a player's name has been ticked\n\n selectedPlayers.add(p[i]); // add that name to the selected players list\n pChecked[i] = false; // untick that name\n }\n }\n if (selectedPlayers.size() > 0) { // save the selection in case of repeated use\n editor.putString(\"previousSelection\", selectedPlayers.toString().trim());\n editor.commit();\n showResults();\n\n }\n }\n })\n\n .setNegativeButton(\"Cancel\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n\n }\n });\n\n builder.setNeutralButton(\"As before\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) { // Button that lets the user randomise the most recently randomised list of players\n String s = prefs.getString(\"previousSelection\", \"\").trim(); // retrieve the string of player names from the phone\n if (s.length() > 0) {\n s = s.replaceAll(\"\\\\[\", \"\").replaceAll(\"\\\\]\", \"\"); // replace the commas with spaces\n selectedPlayers = new ArrayList<String>(Arrays.asList(s.split(\", \"))); // split the string at each space and add each name to selected players list\n\n showResults();\n } else {\n builder.setTitle(\"No previous selection \\nSelect the players present...\");\n builder.show();\n }\n }\n });\n\n builder.setMultiChoiceItems(p, new boolean[p.length], new DialogInterface.OnMultiChoiceClickListener() {\n\n @Override\n public void onClick(DialogInterface dialog, int which, boolean isChecked) { // adds the saved players' names to the dialog, with boxes the user can select them with\n pChecked[which] = isChecked;\n }\n });\n } else {\n builder.setTitle(\"First add players.\"); // if the user tries to randomise a non-existant list of players\n builder.setPositiveButton(\"Sorry\", new DialogInterface.OnClickListener() {\n\n @Override\n public void onClick(DialogInterface dialog, int which) {\n }\n });\n }\n builder.show();\n }", "public void actionPerformed(ActionEvent ae) {\n rb_selection = ae.getActionCommand(); \t \n }", "public void actionPerformed(ActionEvent e) {\n\t\t\t\t\t\t// TODO Think about how to use the key in robots hashtable\n\t \t \tSystem.out.println(x.getName() + \" \" + Robot.getRobotInUse());\n\t \t \tRobot.setRobotInUse(x.getRobotKey());\n\t \t \tSystem.out.println(x.getName() + \" \" + Robot.getRobotInUse());\n\t \t \tjl.setText(x.getName());\n\t \t \t\n\t \t \tvi.showVideo(x);\n\t \t \t\n\t \t \t\n\t\t\t\t\t}", "@Override\n \tpublic void onClick(View v)\n \t{\n \t\tswitch (v.getId())\n \t\t{\n \t\t\tcase R.id.record_button:\n \t\t\t\trecordSound();\n \t\t\t\tbreak;\n \t\t\tcase R.id.select_button:\n\t\t\t\tContext context = getContext();\n\t\t\t\tIntent intent = new Intent(context, MediaSelectorActivity.class);\n\t\t\t\t((Activity) context).startActivityForResult(intent, REQUEST_MEDIA);\n \t\t\t\tbreak;\n \t\t\tcase R.id.delete_button:\n \t\t\t\tcallBack.onDelete();\n \t\t\t\tdismiss();\n \t\t\t\tbreak;\n \t\t\tcase R.id.save_button:\n \t\t\t\tcheckPoint.setName(nameTextField.getText().toString());\n \t\t\t\tString radiusString = radiusTextField.getText().toString();\n \t\t\t\tint radius = Integer.parseInt(radiusString);\n \t\t\t\tcheckPoint.setRadius(radius);\n \t\t\t\tdismiss();\n \t\t\t\tbreak;\n \t\t\tdefault:\n \t\t\t\tbreak;\n \t\t}\n \t}", "public void leaderboardPressed(View view) {\n\n Intent myLeaderboardIntent = new Intent(AllChannelListActivity.this, LeaderboardChannelActivity.class);\n\n myLeaderboardIntent.putExtra(\"userName\", userName);\n startActivity(myLeaderboardIntent);\n finish();\n }", "@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tMessage msg = Message.obtain();\r\n\t\t\t\tnextStep = BALLON;\r\n\t\t\t\tmsg.what = nextStep;\r\n\t\t\t\tmHandler.sendMessage(msg);\r\n\t\t\t\tisPause =true;\r\n\t\t\t}", "public void onReadyButton(View view) {\n mUser.setState(User.UserState.DoneWithNight);\n\n // NOTE!!!!!!!!!!!!!!!!!!\n // When ever the User updates,\n // Because of our event up above,\n // A check goes to see if everyone is ready.\n // If everyone is ready, then it moves to the next Lobby!\n // I hope.\n mRoom.updateUser(mUser);\n Intent intent = new Intent(this, DayMain.class);\n intent.putExtra(\"Client_Data\", mUser);\n intent.putExtra(\"Room_Data\", mRoom);\n Log.v(TAG, \"Starting day for the Villager \");\n startActivity(intent);\n\n }", "public void pressMovieButton() {\n System.out.println(\"Home: You must pick an app to show movies.\\n\");\n }", "@Override\n public void run() {\n isSelectable = true;\n hideResultView();\n initialScreenConditions();\n\n\n if (currentPlay <= Utility.game.getLength()) {\n // hiding time view\n if (Utility.isUmpire) {\n showUmpireOptions();\n } else {\n showPlayerOptions();\n }\n } else {\n RelativeLayout gameOver = (RelativeLayout) findViewById(com.ryansplayllc.ryansplay.R.id.final_game_sceen);\n gameOver.setVisibility(View.VISIBLE);\n playerStatsView();\n gameOver.bringToFront();\n currentPlay = 1;\n\n\n finalLeaderBoard.setOnClickListener(new OnClickListener() {\n @Override\n public void onClick(View v) {\n\n finish();\n Utility.enterdGameLobbyStatus = false;\n Intent i = new Intent(GameScreenActivity.this, FinalLeaderBoardActivity.class);\n i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP\n | Intent.FLAG_ACTIVITY_CLEAR_TASK);\n startActivity(i);\n }\n });\n\n }\n }", "public void pressTVButton() {\n System.out.println(\"Home: You must pick an app to show movies.\\n\");\n }", "public void onButtonPressed(String userId) {\n Log.i(Utils.TAG, \"new UUID: \" + userId);\n selectedUserId = userId;\n if (mListener != null) {\n mListener.onUserSelected(userId);\n }\n }", "@Override\n\tpublic void onClick(View v) {\n\n\t\tif (v.getId() == R.id.winnerid) {\n\t\t\tIntent myIntent = new Intent(this, Winners.class);\n\t\t\tstartActivity(myIntent);\n\t\t\t\n\n\t\t} else {\n\t\t\tIntent myIntent = new Intent(this, List.class);\n\t\t\tmyIntent.putExtra(\"typeList\", ((Button) v).getId());\n\n\t\t\tstartActivity(myIntent);\n\t\t\t\n\t\t}\n\n\t}", "public void onClick(View v) {\n\n switch (v.getId()) {\n\n case R.id.battleText:\n\n if(mPager.getCurrentItem() == 0) {\n\n if(!battleOver) {\n\n gameMaster.advance();\n\n //new CallBackendTask(CallBackendTask.START_BATTLERESULTS, this).execute(\"http://91.155.202.223:7500/api/battleresult\", Guser.getToken());\n\n } else {\n\n Intent intent = new Intent(this, MainActivity.class);\n intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);\n finish();\n startActivity(intent);\n overridePendingTransition(0,0);\n }\n\n } else {\n\n pushText(\"Select an action to use before advancing the turn...\");\n }\n\n return;\n\n case R.id.eslot1:\n\n if(mPager.getCurrentItem() != 0) {\n\n setSelectedTarget(1);\n }\n else\n return;\n\n break;\n\n case R.id.eslot2:\n\n if(mPager.getCurrentItem() != 0) {\n\n setSelectedTarget(2);\n }\n else\n return;\n\n break;\n\n case R.id.eslot3:\n\n if(mPager.getCurrentItem() != 0) {\n\n setSelectedTarget(3);\n }\n else\n return;\n\n break;\n\n case R.id.eslot4:\n\n if(mPager.getCurrentItem() != 0) {\n\n setSelectedTarget(4);\n }\n else\n return;\n\n break;\n\n default:\n\n return;\n }\n\n if(gameMaster.getTargets(gameMaster.getP(selectedSlot).getSelectedAction()) == 1)\n\n highlightEnemy(gameMaster.getSelectedTarget(selectedSlot), true);\n\n else {\n\n highlightEnemy(1, false);\n highlightEnemy(2, false);\n highlightEnemy(3, false);\n highlightEnemy(4, false);\n }\n }", "@Override\n public void onClick(View v) {\n Intent gameSelection = new Intent(\n OpponentSelectionActivity.this, GameSelectionActivity.class);\n // TODO: have id of opponent to send to game selection\n startActivity(gameSelection);\n overridePendingTransition(R.anim.abc_fade_in, R.anim.abc_fade_out);\n finish();\n }", "private void updateUI() {\n if(mChoice == Keys.CHOICE_WAITING) {\n mInstructionView.setText(\"Choose your weapon...\");\n mChoiceView.setImageResource(R.drawable.unknown);\n mRockButton.setEnabled(true);\n mPaperButton.setEnabled(true);\n mScissorsButton.setEnabled(true);\n } else {\n // A mChoice has been made\n mRockButton.setEnabled(false);\n mPaperButton.setEnabled(false);\n mScissorsButton.setEnabled(false);\n\n mInstructionView.setText(\"Waiting for opponent...\");\n\n switch(mChoice) {\n case Keys.CHOICE_ROCK:\n mChoiceView.setImageResource(R.drawable.rock);\n break;\n case Keys.CHOICE_PAPER:\n mChoiceView.setImageResource(R.drawable.paper);\n break;\n case Keys.CHOICE_SCISSORS:\n mChoiceView.setImageResource(R.drawable.scissors);\n break;\n }\n }\n\n // Check Pebble player response has arrived first\n if(mChoice != Keys.CHOICE_WAITING && mP2Choice != Keys.CHOICE_WAITING) {\n doMatch();\n }\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tmainFrame.mainToolBar.jtb_play.doClick();\n\t\t\t}", "public synchronized void pickTeam() {\n voteTeamState = pickTeamState.pickTeam(teamSelection);\n state = State.VOTE_TEAM;\n playerVotes = new HashMap<>();\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tMap<String,String>map=new HashMap<String,String>();\n\t\t\t\tmap.put(\"videoID\", object.videoID);\n\t\t\t\tmap.put(\"videoname\", object.videoname);\n\t\t\t\tString albumVideoImgUrl=CommonUrl.baseUrl + object.videoImgUrl +\".small\"+ object.suffix;\n\t\t\t\tmap.put(\"videoImgUrl\", albumVideoImgUrl);\n\t\t\t\tCommonUtil.jumpToPlayerActivity(context, map);\n\t\t\t}", "@Override\n public void onClick(View v) {\n // TODO Auto-generated method stub\n // Needs to be reversed here due to the setting of the team in the\n // Inkast module\n if (team1.isChecked()) {\n GlobalVars.setFirstTeam(team2.getText().toString());\n } else if (team2.isChecked()) {\n GlobalVars.setFirstTeam(team1.getText().toString());\n }\n\n GlobalVars.setTurnNumber(1);\n GlobalVars.initializegame();\n\n GlobalVars.addToString(\"{{Game initialize}}\\n\");\n Intent processturn = new Intent(\"ca.longship.planetkubb.TURNINKAST\");\n\n startActivity(processturn);\n\n }", "@Override\n\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\tLoadPlayerLog(); \n\t\t\t\t}", "protected void newPlayersClicked(ActionEvent e) {\n getPlayerNames();\n blackPlayer = 0;\n playerScores[0] = 0;\n playerScores[1] = 0;\n refreshScore();\n updateTurnInfo();\n startNewGame();\n }", "public void bTouchdown(View view) {\n scoreTeamB = scoreTeamB + 6;\n displayForTeamB(scoreTeamB);\n }", "@Override\n public void onClick(DialogInterface dialog, int which) {\n\n for (int i = 0; i < p.length; i++) {\n if (pChecked[i]) { // if a player's name has been ticked\n\n selectedPlayers.add(p[i]); // add that name to the selected players list\n pChecked[i] = false; // untick that name\n }\n }\n if (selectedPlayers.size() > 0) { // save the selection in case of repeated use\n editor.putString(\"previousSelection\", selectedPlayers.toString().trim());\n editor.commit();\n showResults();\n\n }\n }", "private void btnSelectPlaneActionPerformed(java.awt.event.ActionEvent evt) {\n this.airplaneSelected = true;\n SelectAirplaneScreen select = new SelectAirplaneScreen(this.rightPanel, this.agency, this.index, this.f);\n \n this.rightPanel.add(\"SelectAirplaneScreen\", select);\n CardLayout layout = (CardLayout) this.rightPanel.getLayout();\n layout.next(this.rightPanel);\n\n }", "@Override\r\n\tpublic void onBoardEvent(BoardEvent e) {\n\t\tif(e.getId() == BoardEvent.CAPTURE || e.getId() == BoardEvent.DROP){\r\n\t\t\tselected = -1;\r\n\t\t\tb.selectedFromHand(selected);\r\n\t\t\tinvalidate();\r\n\t\t}\r\n\t\telse if(e.getId() == BoardEvent.TURN_END){\r\n\t\t\tplayer = player^1;\r\n\t\t\tinvalidate();\r\n\t\t}\r\n\t}", "public void toSelectingAction() {\n }", "@FXML\n private void viewSelected() {\n if (selectedAccount == null) {\n // Warn user if no account was selected.\n noAccountSelectedAlert(\"View DonorReceiver\");\n } else {\n ViewProfilePaneController.setAccount(selectedAccount);\n PageNav.loadNewPage(PageNav.VIEW);\n }\n }", "public void actionPerformed (ActionEvent e){\n\t \t\t JButton currentButton= (JButton)e.getSource(); //save which button pressed in variable\n\t \t\t //sets how many players and the calls next GUI screen depending on button pressed\n\t \t\t if(currentButton==gameMode[0]) {\n\t \t\t\t System.out.println(\"1 Player vs 1 Player game mode selected\");\n\t \t\t\t numPlayers= 2; \n\t \t\t\t playersLeft = 2;\n\t \t\t\t gameModeSelected=0;\n\t \t\t\t createGui2(frame1, frame2, frame3, numPlayers);\n\t \t\t\t }\n\t \t\t else if(currentButton==gameMode[1]) {\n\t \t\t\t System.out.println(\"1 Player vs 1 Computer Player game mode selected\");\n\t \t\t\t numPlayers= 2;\n\t \t\t\t playersLeft = 2;\n\t \t\t\t gameModeSelected=1;\n\t \t\t\t createGui2(frame1, frame2, frame3, numPlayers);\n\t \t\t }\n\t \t\t else if(currentButton==gameMode[2]) {\n\t \t\t\tSystem.out.println(\"Two-Versus-Two Team Battle game mode selected\");\n\t \t\t\tnumPlayers=4;\n\t \t\t\tplayersLeft = 4;\n\t \t\t\tgameModeSelected=2;\n\t \t\t\t createGui2(frame1, frame2, frame3, numPlayers);\n\t \t\t }\n\t \t\t else {\n\t \t\t\t System.out.println(\"4 Player Free-for-All Game game mode selected\");\n\t \t\t\t numPlayers=4;\n\t \t\t\t playersLeft = 4;\n\t \t\t\t gameModeSelected=3;\n\t \t\t\t createGui2(frame1, frame2, frame3, numPlayers);\n\t \t\t }\t\n\t \t }", "@Override\n public void onClick(View v) {\n Intent intent = new Intent(TeamActivity.this, TeamActivity.class); //If the team number is pressed start a new TeamActivity with information about the selected team\n intent.putExtra(\"Team#\", TeamNumber); //Send the team number into the new activity in order to know which team the new activity should be about\n TeamActivity.this.startActivity(intent); //Start the new activity\n }", "public void multiPlayerChosen(){\n IP = view.ipTF.getText();\n ConnectingViewController connecting = new ConnectingViewController(this, IP);\n connecting.showView();\n this.hideView();\n }", "@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tMessage msg = Message.obtain();\r\n\t\t\t\tnextStep = OTHERBEACH;\r\n\t\t\t\tmsg.what = nextStep;\r\n\t\t\t\tmHandler.sendMessage(msg);\r\n\t\t\t\tisPause =true;\r\n\t\t\t}", "private void FortifyButtonMouseClicked(java.awt.event.MouseEvent evt) {// GEN-FIRST:event_FortifyButtonMouseClicked\r\n\t\trisk.setState(RiskGameModel.FORTIFY);\r\n\t\trisk.notifyPhaseViewChange();\r\n\t\tstatusLabel.setText(\"Select a country move armies from\");\r\n\t\tUtility.writeLog(\"Fortify Phase entered\");\r\n\t}", "void onAgentSelected(int agentPosition);", "private void changePlayer(int num, ActionEvent e) {\n\t\tJButton button = (JButton) e.getSource();\n\t\tif(tableMarket.getSelectedRow()==-1 && button.getText().equals(\"+\")) {\n\t\t\tJOptionPane.showMessageDialog(frame,\"You haven't selected any player\");\n\t\t}\n\t\t\n\t\telse if (button.getText().equals(\"+\")){\n\t\t\tString playerName = (String) tableMarket.getModel().getValueAt(tableMarket.getSelectedRow(), 0);\n\t\t\tFootballPlayer player = game.getMarket().findPlayer(playerName);\n\t\t\t\tbuyPlayer(player, playerName, num);\n\t\t}\n\t\t\n\t\telse{\n\t\t\tsellPlayer(num);\n\t\t\t}\n\t\t}", "public void pickUpHerd() {\n rounds.get(currentRound).currentPlayerPickUpHerd();\n }", "@Override\n public void onClick(View v) {\n switch (v.getId()) {\n case R.id.ivBack:\n onBackPressed();\n break;\n case R.id.btnSubmit:\n if (submitMatch()) {\n individualJoinMatch();\n }\n break;\n case R.id.server:// 选择服务器\n intent = new Intent();\n intent.setClass(context, GameServersActivity.class);\n intent.putExtra(\"gameId\", item_id + \"\");\n startActivityForResult(intent, REQUEST_CREAT_ZHANDUI_GAME);\n break;\n }\n }", "@Override\n\t\t\t\t\tpublic void onItemSelected(AdapterView<?> arg0, View arg1,\n\t\t\t\t\t\t\tint arg2, long arg3) {\n\t\t\t\t\t\tint position = gameSpinner.getSelectedItemPosition();\n\t\t\t\t\t\tif (macGames[+position] != \"-- Choose sport --\") {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/*Toast.makeText(getApplicationContext(),\n\t\t\t\t\t\t\t\t\t\"You have selected \" + macGames[+position],\n\t\t\t\t\t\t\t\t\tToast.LENGTH_LONG).show();*/\n\t\t\t\t\t\t\tchosenGame = macGames[+position];\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "public void onItemSelected(MovieModel movieModel);", "@Override\n public void actionPerformed(ActionEvent e) {\n Main.switchViews();\n }" ]
[ "0.67666024", "0.66001713", "0.64756614", "0.62566674", "0.6243526", "0.6223801", "0.6218044", "0.6174477", "0.6146875", "0.6126521", "0.6114122", "0.61120456", "0.606602", "0.60535794", "0.60449916", "0.60423654", "0.60404706", "0.60321486", "0.6016603", "0.60135096", "0.600348", "0.6002346", "0.5984296", "0.5957869", "0.5957097", "0.59550405", "0.59447056", "0.5943061", "0.5935101", "0.5934634", "0.5929644", "0.59292805", "0.5929046", "0.59260684", "0.59207743", "0.59197104", "0.5901229", "0.5888451", "0.5886605", "0.58831173", "0.5877875", "0.58659345", "0.58587724", "0.585392", "0.5852474", "0.58483994", "0.58470124", "0.5846214", "0.58427364", "0.58288926", "0.5828216", "0.5816546", "0.58035094", "0.57910496", "0.579078", "0.57836425", "0.5783439", "0.57816035", "0.57722944", "0.57545835", "0.57489955", "0.57457304", "0.57363915", "0.5732704", "0.57278705", "0.5726257", "0.5722708", "0.5721792", "0.5716139", "0.5715517", "0.5713369", "0.57123244", "0.5710669", "0.570949", "0.57090896", "0.57083577", "0.5700612", "0.570028", "0.569585", "0.56934905", "0.5691628", "0.5691454", "0.56890076", "0.5687498", "0.5685992", "0.56857586", "0.5685743", "0.5681301", "0.5680882", "0.5677239", "0.5673722", "0.5672789", "0.5670533", "0.5661624", "0.5660652", "0.5658717", "0.5651266", "0.5650671", "0.56505424", "0.5650157", "0.56491613" ]
0.0
-1
This method determines if the turn belongs to this client
boolean isPlayerTurn();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean isPlayerTurn(Move move) {\n return this.turn == move.getPlayer().getId();\n }", "public boolean hasTurn() {\n\t\treturn world.getCurrentPlayer() == this;\n\t}", "public boolean isMyTurn() {\n if (gameStatus == null || userId == null) return false;\n return userId.equals(gameStatus.getActivePlayer());\n }", "@Override\n public boolean isLocalPlayersTurn() {\n return getTeam().equals(currentBoard.turn());\n }", "public boolean isPlayerTurn() {\n return playerTurn;\n }", "public boolean isTurn() {\n\t\treturn turn;\n\t}", "public boolean isTurn()\n\t{\n\t\treturn isTurn;\n\t}", "private boolean passTurn() {\n\n\t\t// Return Boolean\n\t\tboolean ableToPassTurn = false;\n\n\t\tint playerOnTurn;\n\n\t\t// Get the playerID who is on turn\n\t\tplayerOnTurn = pTSM.playerOnTurn(gameID);\n\n\t\t// Check if the ID is equal to the playerID\n\t\ttry {\n\t\t\tif (playerOnTurn == this.userID && modelClass.gameIsWon(pTSM.getUsername(userID), gameID)) {\n\t\t\t\tthis.message = \"Het is niet jou beurt\";\n\t\t\t\tableToPassTurn = true;\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tif (playerOnTurn == this.userID) {\n\t\t\t\tableToPassTurn = true;\n\t\t\t}\n\t\t}\n\n\n\t\treturn ableToPassTurn;\n\t}", "public boolean isClient(){\r\n\t\treturn world.isRemote;\r\n\t}", "public static boolean getIsPlayersTurn()\r\n {\r\n return isPlayersTurn;\r\n }", "public boolean whoIsHere(){\r\n\t\treturn otherPlayer;\r\n\t}", "public boolean isCrossTurn() {\r\n\t\treturn p1Turn;\r\n\t}", "public boolean isWin() {\n if (chosen_door.getContains() == Contains.CAR) {\n return true;\n }\n return false;\n }", "private void checkIfMyTurn(boolean currPlayer) {\n gameService.setMyTurn(currPlayer);\n System.out.println();\n System.out.println(\"My turn now: \" + gameService.isMyTurn());\n\n if (! currPlayer) {\n gameService.setLabelTurnText(\"Wait for your turn.\");\n updateFields(gameService.receiveUpdates());\n } else {\n gameService.setLabelTurnText(\"Your turn!\");\n }\n }", "public boolean meTurn(){\n return (isWhite && isWhitePlayer) || (!isWhite && !isWhitePlayer);\n }", "public boolean isAiTurn() {\n return whosTurn() == aiPlayer;\n }", "@Override\n public boolean isWin() {\n for (Observer winner : winners) {\n if (winner.getName().equals(chosenHorse.getName())) {\n return true;\n }\n }\n return false;\n }", "boolean isInRoom(String username)\n {\n for (ClientHandle participant : participants) {\n if (participant.getUsername().equals(username))\n {\n return true;\n }\n }\n return false;\n }", "public final boolean isClient() {\n\t\treturn world.isRemote;\n\t}", "boolean hasLobbyId();", "public boolean checkForWin(){\n\t\t\n\t\tPlayer p = Game.getCurrPlayer();\n\t\t// if player made it to win area, player won\n\t\tif(p.won()){\n\t\t\tGame.gameWon = true;\n\t\t\tthis.network.sendWin();\n\t\t\treturn true;\n\t\t}\n\t\t// if player is the last player on the board, player won\n\t\tif(numPlayers == 1 && !p.hasBeenKicked()){\n\t\t\tGame.gameWon = true;\n\t\t\tthis.network.sendWin();\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public boolean isOnPlayerOne() {\r\n\t\treturn onTraderOne;\r\n\t}", "public boolean isTerritoryBelongsCurrentPlayer() {\n if(selectedTerritoryByPlayer.getConquerID() == null)\n return false;\n return selectedTerritoryByPlayer.getConquerID().equals(currentPlayerTurn.getID());\n }", "public boolean isTurned(){\n\treturn IS_TURNED;\n }", "public static boolean isClient() {\n return FMLCommonHandler.instance().getEffectiveSide().isClient();\n }", "boolean isMyTurn();", "@Override\n\tpublic boolean isOwnMessage() {\n\t\ttry {\n\t\t\treturn (this.user.id == AccountManager.current_account.getUser().id);\n\t\t} catch (Exception e) {\n\t\t\treturn false;\n\t\t}\n\t}", "@Override\n\tpublic Boolean isClient() {\n\t\treturn true;\n\t}", "public boolean isWinTurn() {\n for (int col = 0; col < mColsCount; col++) {\n if (isFourConnected(getCurrentPlayer(), 0, 1, 0, col, 0)\n || isFourConnected(getCurrentPlayer(), 1, 1, 0, col, 0)\n || isFourConnected(getCurrentPlayer(), -1, 1, 0, col, 0)) {\n hasWinner = true;\n return true;\n }\n }\n\n for (int row = 0; row < mRowsCount; row++) {\n if (isFourConnected(getCurrentPlayer(), 1, 0, row, 0, 0)\n || isFourConnected(getCurrentPlayer(), 1, 1, row, 0, 0)\n || isFourConnected(getCurrentPlayer(), -1, 1, row, mColsCount - 1, 0)) {\n hasWinner = true;\n return true;\n }\n }\n\n return false;\n }", "public boolean hasConversation() {\n return typeCase_ == 2;\n }", "public boolean isWon() {\r\n\t\tif (winner(CROSS) || winner(NOUGHT))\r\n\t\t\treturn true;\r\n\t\telse\r\n\t\t\treturn false;\r\n\t}", "public boolean hasConversation() {\n return typeCase_ == 2;\n }", "public boolean isCoachSeat() {\n \t return this.isCoachSeat;\n }", "public boolean isSetClient() {\r\n return this.client != null;\r\n }", "public void checkIfWinOrDraw() {\r\n\t\tif (theModel.getIsDraw() == true) {\r\n\t\t\tDrawNum++;\r\n\t\t\tactivePlayer = winningPlayer;\r\n\t\t\t// cards go to communalPile\r\n\r\n\t\t} else {\r\n\t\t\ttheModel.winningCard(winningPlayer);\r\n\t\t\ttheModel.transferWinnerCards(winningPlayer);\r\n\t\t}\r\n\r\n\t}", "boolean hasCustomerClient();", "private boolean mAsClient(String sRemoteDeviceName) {\n return (sRemoteDeviceName.equals(sDeviceName));\n }", "public boolean isLeader() throws RemoteException;", "public boolean isLeader() throws RemoteException;", "public java.lang.Boolean getIsClient()\n {\n return isClient;\n }", "@Override\n public boolean isUsable(Player player, boolean firstTurn) {\n\n return player.canPlaceOnThisTurn(firstTurn) && player.canUseCardOnThisTurn(firstTurn) && player.getGrid().getPlacedDice() >0;\n }", "boolean hasConversation();", "@Override\n\tpublic boolean estPleine() {\n\t\treturn getNbClients()==capacite;\n\t}", "public boolean findClient(String client) throws RemoteException {\n\t\tif (loggedIn.contains(client))\n\t\t\treturn true;\n\t\treturn false;\n\t}", "public boolean isWin_CommanderVimes(){\r\n // player got LordSelachii card\r\n Player playerHoldCard = null;\r\n for (Player player : discWorld.getPlayer_HASH().values()) {\r\n if (player.getPersonalityCardID() == 7) {\r\n playerHoldCard = player;\r\n break;\r\n }\r\n }\r\n \r\n if(playerHoldCard != null){\r\n if(discWorld.getShuffled_PlayerCard().size() == 0){\r\n return true;\r\n }\r\n } \r\n \r\n return false;\r\n }", "public boolean isConnected() {\n return (chord != null);\n }", "public boolean isHouse() {\n return (this.getId() == Player.PLAYER_1.getHouseIndex())\n || (this.getId() == Player.PLAYER_2.getHouseIndex());\n }", "boolean CanFinishTurn();", "public boolean isHisTurn(UnoCard clickedCard) {\n\t\tfor (Player p : getPlayers()) {\n\t\t\tif (p.hasCard(clickedCard) && p.isMyTurn())\n\t\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "boolean hasSendPlayerId();", "public boolean isWinner() {\n\t\treturn winner;\n\t}", "public boolean isConnectedTo(Airport that)\n\t{\n\t\tif(connections.contains(that)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public Player getPlayerInTurn();", "@Override\n\tpublic boolean isClient() {\n\t\treturn true;\n\t}", "public static boolean isInParty(Player player) {\n\t\treturn getParty(player) != null;\n\t}", "public boolean isConnectedToRendezVous() {\r\n return !rendezVous.isEmpty();\r\n }", "private boolean turnIfNeeded() {\n\t\tif (needToTurn()) {\n\t\t\tturnToDesiredDirection();\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public void checkSetPlayerTurn() // Check and if needed set the players turns so it is their turn.\n\t{\n\t\tswitch (totalPlayers) // Determine how many players there are...\n\t\t{\n\t\tcase 2: // For two players...\n\t\t\tswitch (gameState)\n\t\t\t{\n\t\t\tcase twoPlayersNowPlayerOnesTurn: // Make sure it's player one's turn.\n\t\t\t\tplayers.get(0).setIsPlayerTurn(true);\n\t\t\t\tbreak;\t\t\t\t\n\t\t\tcase twoPlayersNowPlayerTwosTurn: // Make sure it's player two's turn.\n\t\t\t\tplayers.get(1).setIsPlayerTurn(true);\n\t\t\t\tbreak;\t\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t}", "public boolean amIWinning() {\n return myCommitment != null && winning;\n }", "public boolean isPlayerInThisGame(Player player) {\n return player.equals(getRedPlayer()) || player.equals(getWhitePlayer());\n }", "@Override\n public boolean hasClientinfo() {\n return clientinfo_ != null;\n }", "@Override\n public boolean isChasingPlayer()\n {\n return(chasingPlayer);\n }", "boolean hasClientId();", "boolean hasClientId();", "public boolean winner(){ \r\n\t\tif (rowWin() || colWin() || diagWin()){ \r\n\t\t\tchangeTurn(); \r\n\t\t\tSystem.out.println(\"Winner: \" + playerToString(currentTurn) + \"!\"); \r\n\t\t\treturn true; \r\n\t\t}\r\n\t\telse if (tie()){\r\n\t\t\tSystem.out.println(\"There is a tie.\");\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse{ \r\n\t\t\tSystem.out.println(\"No winner yet.\\n\"); \r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t}", "boolean getIsLocalClient();", "boolean hasTargetPlayerId();", "public boolean isWinnerMe() {\n if (gameStatus == null || userId == null) return false;\n return userId.equals(gameStatus.getWinner())\n || (getMyPlayerNumber() == 1 && getPlayerTwoPoints() == 0)\n || (getMyPlayerNumber() == 2 && getPlayerOnePoints() == 0)\n || getMyPlayerNumber() == 1 && getPlayerOnePoints() > getPlayerTwoPoints()\n || getMyPlayerNumber() == 2 && getPlayerOnePoints() < getPlayerTwoPoints();\n }", "public boolean isWon() {\n return getWinningScenario() != null;\n }", "@Override\r\n\t\tpublic boolean isPlayer() {\n\t\t\treturn state.isPlayer();\r\n\t\t}", "public boolean extraTurn() {\n\t\tif (isPlayer1() && currentPit == 6 || !isPlayer1() && currentPit == 13) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "@Override\n public boolean isWaitingForTurnPhase() {return true;}", "public Boolean getYourTurn() {\n return yourTurn;\n }", "boolean hasJoinGameResponse();", "public boolean isCardToAccuse() {\n\t\treturn (getOwner() == CASE_FILE_PLAYER);\n\t}", "private void whichPlayerHasTurn() throws PlayerOutOfTurn {\n if (test.equals(lastPicked)) {\n throw (new PlayerOutOfTurn());\n }\n }", "private static boolean canMove() {\n return GameManager.getCurrentTurn();\r\n }", "private boolean playerWonGameWithDiagonalLine(Player player) {\n char playerSymbol = player.getType();\n if (boardState[0][0] == playerSymbol && boardState[1][1] == playerSymbol \n && boardState[2][2] == playerSymbol) {\n return true; \n } else if (boardState[0][2] == playerSymbol && boardState[1][1] == playerSymbol \n && boardState[2][0] == playerSymbol) {\n return true; \n }\n return false; \n }", "@java.lang.Override\n public boolean hasOpponent() {\n return opponent_ != null;\n }", "private boolean isConnectedToPrimary(SRVRecord[] recs)\n\t{\n\t\tString primaryAddress = getPrimaryServerRecord(recs).getTarget();\n\t\tif (primaryAddress != null && primaryAddress.equals(currentAddress))\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public boolean isConnecting ()\r\n\t{\r\n\t\tsynchronized (this)\r\n\t\t{\r\n\t\t\treturn _roboCOM!=null;\r\n\t\t}\r\n\t}", "boolean hasJoinGameRequest();", "public boolean isAt() {\n return Browser.getCurrentUrl().contains(\"clients\");\n }", "public boolean isBot() {\n//\t\treturn this.getUserIO().checkConnection();\n\t\treturn false;\n\t}", "@Override\r\n public boolean equals(Object object) {\n if (!(object instanceof Client)) {\r\n return false;\r\n }\r\n Client other = (Client) object;\r\n if ((this.idclient == null && other.idclient != null) || (this.idclient != null && !this.idclient.equals(other.idclient))) {\r\n return false;\r\n }\r\n return true;\r\n }", "void willStartTurn() throws RemoteException;", "public void checkWin(){\n boolean result = false;\n if(game.getTurn() > 3){\n Player currentPlayer = game.getPlayerTurn();\n int playernumber = currentPlayer.getPlayericon();\n result = game.winChecker(game.getBored(),playernumber);\n if(result == true) {\n setWinMsgBox(currentPlayer.getPlayerName() + \" Is victorious :)\",\"WIN\");\n }else if(game.getTurn() == 8 && result == false){\n setWinMsgBox(\"Too bad it is a draw, No one out smarted the other -_-\",\"DRAW\");\n }else{}\n }else{\n result = false;\n }\n }", "public boolean hasFullyTurned() {\r\n return turningPID.onTarget();\r\n }", "private boolean amIleader() {\n \t\treturn vs.getRank(myEndpt) == 0;\n \t}", "public boolean playerWonGame(Player player) {\n if (playerWonGameWithDiagonalLine(player) || playerWonGameWithHorizontalLine(player)\n || playerWonGameWithVerticalLine(player)) {\n return true; \n }\n return false; \n \n }", "public boolean isOwned(){\n\t\treturn isOwned;\n\t}", "public boolean isPlayerOwned(int row, int column) {\n return getCell(row, column).isPlayerOwned();\n }", "public Boolean getOrigineClient() {\r\n return origineClient;\r\n }", "@Override\n protected boolean canMove(int playerIdx) {\n if(pgs.getTurnID() == playerIdx){\n return true;\n }\n return false;\n }", "public boolean isWaitingFor( int clientId )\n {\n return clientId != myId && waitList.contains( clientId );\n }", "public boolean alreadyOwnsIdenticalRoute(){\n City city1 = mSelectedRoute.getCity1();\n City city2 = mSelectedRoute.getCity2();\n for(int i=0; i<mUser.getClaimedRoutes().size(); i++){\n City ownedCity1 = mUser.getClaimedRoutes().get(i).getCity1();\n City ownedCity2 = mUser.getClaimedRoutes().get(i).getCity2();\n if(city1.equals(ownedCity1) && city2.equals(ownedCity2))\n return true;\n }\n return false;\n }", "public boolean isHasWinner() {\n return hasWinner;\n }", "public boolean isComputerOwned(int row, int column) {\n return getCell(row, column).isComputerOwned();\n }", "public boolean isWin() {\n return win;\n }", "@Override\r\n public void isLeader() {\n }" ]
[ "0.69363666", "0.6920336", "0.6766549", "0.6738518", "0.65428054", "0.64512706", "0.63330007", "0.62992036", "0.6240861", "0.6179695", "0.6162671", "0.6131642", "0.61183816", "0.61183643", "0.61015636", "0.6091689", "0.60843456", "0.6078007", "0.60545146", "0.60453594", "0.60107183", "0.5978811", "0.59748745", "0.59690535", "0.59591424", "0.5951551", "0.59472644", "0.59209883", "0.59200996", "0.5906712", "0.5889243", "0.5875709", "0.58430237", "0.5817608", "0.5814518", "0.5783202", "0.578221", "0.576929", "0.576929", "0.57692254", "0.57626015", "0.57317233", "0.57265955", "0.57213324", "0.571861", "0.57123315", "0.5711323", "0.5708747", "0.57033473", "0.5688496", "0.5683562", "0.5676418", "0.5674582", "0.5672429", "0.5671443", "0.56706166", "0.56664926", "0.56566644", "0.5648099", "0.56427497", "0.56409764", "0.5640094", "0.5639607", "0.5639607", "0.5633385", "0.5627714", "0.5611607", "0.5611279", "0.56050444", "0.56034696", "0.56024534", "0.5594815", "0.55803734", "0.5577727", "0.5572527", "0.55540717", "0.5553027", "0.5550876", "0.5544081", "0.5539171", "0.5534645", "0.55310845", "0.5521911", "0.5521525", "0.5520765", "0.5519625", "0.55160415", "0.5511799", "0.5511745", "0.55044675", "0.5502977", "0.5502662", "0.5501539", "0.5496949", "0.5490553", "0.54904294", "0.5487184", "0.5471154", "0.5470889", "0.5470748" ]
0.6491043
5
This method determines if this play can discard cards
boolean CanDiscardCards(Resources resources);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void discardRestrictedCards()\n\t{\n\t\tif (playerList.size() == 2)\n\t\t{\n\t\t\tfor(Card card : restrictedCard2PlayerList)\n\t\t\t{\n\t\t\t\tswitch (card.getType())\n\t\t\t\t{\n\t\t\t\t\tcase GreenPlayerCard:\n\t\t\t\t\tcase BrownPlayerCard:\n\t\t\t\t\t\tCard playerCardMatch = board.getPlayerCardDeck().pickCardByID(card.getId());\n\t\t\t\t\t\tif (playerCardMatch != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tboard.getDiscardDeck().addCard(playerCardMatch);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase CityAreaCard:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PersonalityCard:\n\t\t\t\t\t\tCard personalityCardMatch = board.getPersonalityCardDeck().pickCardByID(card.getId());\n\t\t\t\t\t\tif (personalityCardMatch != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tboard.getDiscardDeck().addCard(personalityCardMatch);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase RandomEventCard:\n\t\t\t\t\t\tCard randomEventCardMatch = board.getRandomEventCardDeck().pickCardByID(card.getId());\n\t\t\t\t\t\tif (randomEventCardMatch != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tboard.getDiscardDeck().addCard(randomEventCardMatch);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public boolean canUseCard() {\n \t\tif (usedCard)\n \t\t\treturn false;\n \n \t\tfor (int i = 0; i < cards.length; i++) {\n \t\t\tif (cards[i] > 0)\n \t\t\t\treturn true;\n \t\t}\n \n \t\treturn false;\n \t}", "boolean canBeRemoved(int cardIndex);", "@Override\n public boolean canUseCard(){\n return false;\n }", "protected boolean excludeCardFromMixing(Card card) {\n Stack stack = card.getStack();\n\n if (!card.isUp()) {\n return false;\n }\n\n if (foundationStacksContain(stack.getId()) || stack == getDiscardStack()) {\n return true;\n }\n\n return stack.getId() < 24 && !stack.isEmpty() && validOrder(stack);\n }", "public boolean outOfCards() {\n return (this.gameDeck.isEmpty() && this.wonDeck.isEmpty());\n }", "protected boolean isDiscarded()\n {\n return m_cUnits == -1;\n }", "public boolean hasCardsLeftOver() {\r\n\r\n return !(currentCards.isEmpty());\r\n\r\n }", "void discardCards(Resources resources);", "public void discard(int num) {\r\n\t\tfor (int i = 0; i < mustDiscard.size(); i++) {\r\n\t\t\tif (currentPlayer.discard(num)) {\r\n\t\t\t\tif (mustDiscard.get(i).contentEquals(\"Sleight of Hand\")) {\r\n\t\t\t\t\tmustDiscard.remove(i);\r\n\t\t\t\t\tcurrentPlayer.draw(2);\r\n\t\t\t\t\tupdatePlayArea(currentPlayer, false);\r\n\t\t\t\t} else if (mustDiscard.get(i).contentEquals(\"Apothecary\")) {\r\n\t\t\t\t\tmustDiscard.remove(i);\r\n\t\t\t\t\tmustChoose.add(\"Apothecary\");\r\n\t\t\t\t\tchoosePrompt();\r\n\t\t\t\t\tupdatePlayArea(currentPlayer, false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void discard(){\n for(int i = 1 ; i <= 110 ; i++) cardDeck.remove(i);\n }", "private void discardPrompt() {\r\n\t\tfor (int i = 0; i < mustDiscard.size(); i++) {\r\n\t\t\tString prompt = \"**[Discard]** a card \";\r\n\t\t\tif (mustDiscard.get(i).contentEquals(\"Sleight of Hand\")) {\r\n\t\t\t\tprompt += \"to draw 2 cards\";\r\n\t\t\t} else if (mustDiscard.get(i).contentEquals(\"Apothecary\")) {\r\n\t\t\t\tprompt += \"to choose one: **3** :crossed_swords: **~OR~** **2** :moneybag: **~OR~** **1** :heart:\";\r\n\t\t\t}\r\n\t\t\tgameChannel.sendMessage(prompt).queue();\r\n\t\t}\r\n\t}", "public boolean hasBlackjack() {\n\t\treturn this.hand.countValue().lower(22) == 21;\n\t}", "public boolean hasBlackjack()\n {\n return getSumOfCards(false) == 21;\n }", "@Override\n public boolean anotherPlayIsPossible()\n {\n \t\n List<Integer> test = cardIndexes();\n return containsSum13(test) || containsK(test);\n \n }", "public void discard(Card card) {\n if (!myTurn()) {\n return;\n }\n // CardAction cardAct = new CardAction(card, \"Discard: \" + card.getName());\n // history.add(cardAct);\n\n if (handPile.contains(card)) {\n tmpDiscardPile.add(card);\n handPile.remove(card);\n } else {\n tmpDiscardPile.add(card);\n }\n }", "@Override\n public boolean isBlackjack() {\n return ( (countCards()==2) && (higherScore()==21) );\n }", "public boolean CheckIfCardPlayedIsValid(UNOCard aCard) {\n\t\t\n\t\tif (discardPile.size() == 0) {\n\t\t\tdiscardPile.add(aCard);\n\t\t\treturn true;\n\t\t}\n\t\telse if (discardPile.get(discardPile.size() - 1).getName() == aCard.getName()) { // If card has the same value as last card played it is valid\n\t\t\tdiscardPile.add(aCard);\n\t\t\tcurrentTurnColor = aCard.getColor();\n\t\t\tif (aCard.getName() == \"Skip\" || aCard.getName() == \"Reverse\" || aCard.getName() == \"Draw Two\") { //if it is a special card it needs to have the action performed\n\t\t\t\tSpecialCardAction(aCard);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\telse if (currentTurnColor == aCard.getColor()) { // if card is the same color as last card played's color it is valid\n\t\t\tdiscardPile.add(aCard);\n\t\t\tif (aCard.getName() == \"Skip\" || aCard.getName() == \"Reverse\" || aCard.getName() == \"Draw Two\") { //if it is a special card it needs to have the action performed\n\t\t\t\tSpecialCardAction(aCard);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\telse if (aCard.getName() == \"Wild\" || aCard.getName() == \"Wild Draw Four\") { // if it is a wild or wild draw four card it is valid and performs its special action\n\t\t\tSpecialCardAction(aCard);\n\t\t\tdiscardPile.add(aCard);\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "public boolean isCard() {\n\t\treturn id > 0 && id < 53;\n\t}", "public void discard(Card card) {\n discardPile.add(card);\n }", "public Boolean isAWildCardSet() {\r\n\t\tfor (RiskCardModel card : lstTradedCards) {\r\n\t\t\tif (card.card_type.equals(\"WILD\"))\r\n\t\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public boolean isStandardDeck() {\n Deck jeff = new Deck () ;\n if (this.cards.length == jeff.cards.length) {\n for (int i = 0; i < this.cards.length; i++ ) {\n if (!this.cards[i].equals(jeff.cards[i])) {\n return false;\n }\n }\n return true;\n }\n return false;\n }", "@Override\n public boolean isEffectOnCardPrevented(PhysicalCard card) {\n return _preventedCards.contains(card);\n }", "private boolean canAcceptCard(Card card) {\n return cardSet.canAcceptCard(card);\n }", "public boolean CheckForUnwinnableCondition(){\n int humanSize = GetSizeOfHumanHand();\n int computerSize = GetSizeOfComputerHand();\n\n for(int i = 0; i < humanSize; i++) {\n //Human can play a card\n String card = handHuman.get(i);\n\n String firstLetter = Character.toString(card.charAt(0));\n String topFirstLetter = Character.toString(topCard.charAt(0));\n\n if (topCard.contains(\"8\")) {\n //Can play any card ontop to determine suite\n return true;\n }\n\n if (card.contains(\"8\")) {\n //valid because 8s are wild cards, human can place it\n return true;\n }\n\n //the cards match in suite, doesn't matter what it is\n else if (firstLetter.equals(topFirstLetter)) {\n return true;\n }\n\n else {\n if (topFirstLetter.equals(\"c\")) {\n String temp = topCard.substring(5, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"h\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"d\")) {\n String temp = topCard.substring(8, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"s\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n }\n }\n }\n\n for(int i = 0; i < computerSize; i++){\n //Human can play a card\n String card = handComputer.get(i);\n\n String firstLetter = Character.toString(card.charAt(0));\n String topFirstLetter = Character.toString(topCard.charAt(0));\n\n if (topCard.contains(\"8\")) {\n //Can play any card ontop to determine suite\n return true;\n }\n\n if (card.contains(\"8\")) {\n //valid because 8s are wild cards, human can place it\n return true;\n }\n\n //the cards match in suite, doesn't matter what it is\n else if (firstLetter.equals(topFirstLetter)) {\n return true;\n }\n\n else {\n if (topFirstLetter.equals(\"c\")) {\n String temp = topCard.substring(5, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"h\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"d\")) {\n String temp = topCard.substring(8, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n\n } else if (topFirstLetter.equals(\"s\")) {\n String temp = topCard.substring(6, topCard.length());\n\n if (card.contains(temp)) {\n return true;\n }\n }\n }\n }\n\n //Human and computer can't play a card\n return false;\n }", "public boolean canCapture(Card otherCard) {\n return this.getRank().equals(Rank.JACK) || this.compareRank(otherCard);\n }", "boolean hasPlayCardRequest();", "@Override\n\tpublic ServerResponse movesDiscardCards(DiscardedCards cards) {\n\t\treturn null;\n\t}", "private boolean isDiscarded(Object obj) {\n if (obj instanceof Item) {\n return isDiscardedStatus(((Item) obj).getStatus());\n } else if (obj instanceof Container) {\n return isDiscardedStatus(((Container) obj).getStatus());\n } else if (obj instanceof Space) {\n return isDiscardedStatus(((Space) obj).getStatus());\n } else if (obj instanceof MetadataProfile) {\n return isDiscardedStatus(((MetadataProfile) obj).getStatus());\n } else if (obj instanceof Person) {\n return false;\n } else if (obj instanceof Organization) {\n return false;\n }\n return false;\n }", "@Test\n public void discardIfCannot() {\n gm.setPlayerInfo(clientPlayer3);\n gm.setThisPlayerIndex(clientPlayer3.getPlayerIndex());\n dc.increaseAmount(ResourceType.ORE);\n dc.increaseAmount(ResourceType.ORE);\n dc.increaseAmount(ResourceType.WOOD);\n assertEquals(2, getAmounts().getOfType(ResourceType.ORE));\n assertEquals(1, getAmounts().getOfType(ResourceType.WOOD));\n Player p = model.getPlayer(clientPlayer3.getPlayerIndex());\n when(robberFacade.canDiscard(dc.getDiscardAmount(), p)).thenReturn(false);\n dc.discard();\n // This verifies that the robberFacade.discard is only called once instead of twice\n verify(robberFacade, atMost(1)).discard(dc.getDiscardAmount(), p);\n\n }", "public boolean isGameWon(){\r\n for(Card c: this.cards){\r\n if (c.getFace() == false){\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "@Override\n public void discardCards(IResourceBank discardedCards) throws ModelException {\n IPlayer p = GameModelFacade.instance().getLocalPlayer();\n\n if (GameModelFacade.instance().getGame().getGameState() != GameState.Discarding\n || p.getResources().getCount() <= 7\n || !p.canAfford(discardedCards)) {\n throw new ModelException(\"Preconditions for action not met.\");\n }\n\n try {\n String clientModel = m_theProxy.discardCards(p.getIndex(), discardedCards);\n new ModelInitializer().initializeClientModel(clientModel, m_theProxy.getPlayerId());\n } catch (NetworkException e) {\n throw new ModelException(e);\n }\n }", "public static boolean can_remove(Card a, Card b){\n int asuit = a.getSuit();\n int bsuit = b.getSuit();\n int aface = a.getRank();\n int bface = b.getRank();\n\n if (same_int(asuit,bsuit)){\n if (compare_face(aface,bface,\"l\")){\n return true;\n }\n }\n return false;\n }", "@Test\n public void testCardCanPlay_FALSE() {\n System.out.println(\"cardCanPlay FALSE COLOUR\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.RED, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.ONE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n boolean result = utils.cardCanPlay(cardSelection, drawCard, wildColour);\n assertEquals(false, result);\n }", "private boolean isAllCardsPicked(){\n\t\t\n\t\tboolean isCardsPicked = true;\n\t\tfor ( int i = 0; i < pickedCards.length; i++ ){\n\t\t\tif(!pickedCards[i]) {\n\t\t\t\tisCardsPicked = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn isCardsPicked;\n\t}", "private boolean isAllCardsPicked(){\n\t\t\n\t\tboolean isCardsPicked = true;\n\t\tfor ( int i = 0; i < pickedCards.length; i++ ){\n\t\t\tif(!pickedCards[i]) {\n\t\t\t\tisCardsPicked = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn isCardsPicked;\n\t}", "public boolean canDoDiscardResourceOfType(ResourceType resourceType, int numberToDiscard) {\n\t\t\tif(resourceType == null || resourceCardHand.getNumberResourcesOfType(resourceType) < numberToDiscard) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}", "public void cancelCard() {}", "public CardStack getAvailableCards()\n {\n return null;\n }", "public DiscardDeck() {\n\t\tthis.content = new ArrayList<Card>();\n\t}", "boolean hasCardType();", "private void updateLastCardDiscarded(){\r\n\t\tint x = 0;\r\n\t\twhile(this != game.getPlayer(x++)){} // find the nextPlayer\r\n\t\tx = x % game.getNumberOfPlayers();\r\n\t\tnextPlayer = game.getPlayer(x);\r\n\t\t\r\n\t\tif(latestRound != game.getRoundNumber()){ // if it's a new Round, reset\r\n\t\t\tpickedUpCards = new ArrayList<Card>();\r\n\t\t\tlastCardDiscarded = null;\r\n\t\t\tlatestRound = game.getRoundNumber();\r\n\t\t\t\r\n\t\t\tfor(int y = 0; y < game.getNumberOfPlayers(); y++){ // ?????\r\n\t\t\t\tif(game.getPlayer(y) != this && \r\n\t\t\t\t\t\t(getScore() >= game.getPlayer(y).getScore() || getPhase() > game.getPlayer(y).getPhase())){//????\r\n\t\t\t\t\tsetName(oldName);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tsetName(oldName + \"is#WINNING\"); // ?????\r\n\t\t}else if(lastCardDiscarded != null && Configuration.getTypeRequired(nextPlayer.getPhase(), 0) == Configuration.SET_PHASE){\r\n\t\t\tif(nextPlayer.drewFromDiscard())\r\n\t\t\t\tpickedUpCards.add(lastCardDiscarded); // add the card to picked up card if it was picked up \r\n\t\t}\r\n\t}", "public boolean isPickItUp(int playerID, Card discard){\n if(turn == playerID && gameStage == 1 && dealer == playerID){\n currentTrumpSuit = middleCardSuit;\n // make dealer discard a card and give them the middle card\n if(dealer == 0){\n //discard card that player taps\n if(player1Hand.get(0) == discard){\n player1Hand.remove(0);\n player1Hand.add(middleCard);\n turn++;\n gameStage = 3;\n }\n else if(player1Hand.get(1) == discard){\n player1Hand.remove(1);\n player1Hand.add(middleCard);\n turn++;\n gameStage = 3;\n }\n else if(player1Hand.get(2) == discard){\n player1Hand.remove(2);\n player1Hand.add(middleCard);\n turn++;\n gameStage = 3;\n }\n else if(player1Hand.get(3) == discard){\n player1Hand.remove(3);\n player1Hand.add(middleCard);\n turn++;\n gameStage = 3;\n }\n else if(player1Hand.get(4) == discard){\n player1Hand.remove(4);\n player1Hand.add(middleCard);\n turn++;\n gameStage = 3;\n }\n }\n }\n return false;\n }", "private boolean checkRemainingRes() {\n for (int i = 0; i < playingField.getPlayingField().length; i++) {\n for (int j = 0; j < playingField.getPlayingField()[i].length; j++) {\n if (playingField.getPlayingField()[i][j].getResources() > 0) {\n return true;\n }\n }\n }\n return false;\n }", "public void testCanPlayOn() {\n \n DrawCard redDraw2 = new DrawCard(Card.COLOUR_RED, 2);\n \n // create another 4 normal cards\n \n Card card1 = new Card(Card.COLOUR_BLUE, 5);\n Card card2 = new Card(Card.COLOUR_BLUE,2);\n \n //card 1 and card 2 should yield false on the method\n assertFalse(redDraw2.canPlayOn(card1));\n assertFalse(redDraw2.canPlayOn(card2));\n \n Card card3 = new Card(Card.COLOUR_RED, 5);\n Card card4 = new Card(Card.COLOUR_RED,2);\n \n // card 3 and card 4 should gives true\n \n assertTrue(redDraw2.canPlayOn(card3));\n assertTrue(redDraw2.canPlayOn(card4));\n \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}", "protected boolean canPlay(Board gameBoard) {\n if (canPlayWithoutWild(gameBoard)) {\n return true;\n }\n Iterator<Card> it = myCards.iterator();\n while (it.hasNext()) { // check if the player has wild card\n Card temp = it.next();\n if (temp instanceof WildDrawCard || temp instanceof ColorChangeCard) {\n return true;\n }\n }\n return false;\n }", "public boolean isDiscarded() {\r\n return discarded;\r\n }", "@Test(expected = DidNotPickCardException.class)\n public void allow_discard_only_if_picked_before(){\n\n Deck deck = new Deck();\n deck.add(new Card(3,2,5));\n Game game = new Game(deck);\n\n game.join(\"susan\");\n game.join(\"peter\");\n\n game.discard(\"susan\");\n }", "public boolean canUseCard(Card card) {\r\n\t\tif (card.cardColor.contains(CardColor.GREEN)\r\n\t\t\t\t|| card.cardColor.contains(CardColor.GREY)) {\r\n\t\t\treturn false;\r\n\t\t} else if (this.blackTurns > 0) {\r\n\t\t\treturn true;\r\n\t\t} else if (card.cardColor.contains(CardColor.PURPLE)\r\n\t\t\t\t&& this.purpleTurns > 0) {\r\n\t\t\treturn true;\r\n\t\t} else if (card.cardColor.contains(CardColor.RED) && this.redTurns > 0) {\r\n\t\t\treturn true;\r\n\t\t} else if (card.cardColor.contains(CardColor.BLUE)\r\n\t\t\t\t&& this.blueTurns > 0) {\r\n\t\t\treturn true;\r\n\t\t} else if (card.cardColor.contains(CardColor.BROWN)\r\n\t\t\t\t&& this.brownTurns > 0) {\r\n\t\t\treturn true;\r\n\t\t} else\r\n\t\t\treturn false;\r\n\t}", "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}", "public boolean cardsIsEmpty() {\r\n\t\treturn cards.isEmpty();\r\n\t}", "@Test\n public void testCardCanPlay_FALSE_VALUE() {\n System.out.println(\"cardCanPlay FALSE VALUE\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.RED, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.THREE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n boolean result = utils.cardCanPlay(cardSelection, drawCard, wildColour);\n assertEquals(false, result);\n }", "public boolean cardsDealt(int players){\n\t\tif(deck.size()==0)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\n\t\t//TODO:\n\t\t//Implement for a variable # of players\n\t}", "public void discard(DiscardResponse discardResponse){\n int pos = cardPlayedPos;\n if (discardResponse.accepted){\n this.infoTokens += 1;\n int count = this.discardPile.getOrDefault(discardResponse.gameCard.toString(), 0);\n this.discardPile.put(discardResponse.gameCard.toString(), count + 1);\n playerCardsList.get(0).set(pos, new GameCard());\n }\n notifyObservors();\n }", "@Override\n\tpublic void cardInPlay() {\n\t\tIPlayer playedOn = this.game.getOtherPlayer();\n\t\tif(!playedOn.getFaction().equals(Faction.Cultist)){\n\t\t\tplayedOn.setFaction(Faction.UNAFFILIATED);\n\t\t}\n\t\tthis.setDiscard();\n\t}", "public boolean isWin_CommanderVimes(){\r\n // player got LordSelachii card\r\n Player playerHoldCard = null;\r\n for (Player player : discWorld.getPlayer_HASH().values()) {\r\n if (player.getPersonalityCardID() == 7) {\r\n playerHoldCard = player;\r\n break;\r\n }\r\n }\r\n \r\n if(playerHoldCard != null){\r\n if(discWorld.getShuffled_PlayerCard().size() == 0){\r\n return true;\r\n }\r\n } \r\n \r\n return false;\r\n }", "public boolean checkBlackJack() {\r\n if(cards.size() == 2 && score() == 21){\r\n blackJack = true;\r\n over = true;\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n }", "public boolean hasMoreCards() {\n if (cardHold == 0)\n return false;\n else\n return true;\n }", "public boolean checkForBlackjack(Player player) {\n\t\tif(player.getHandVal() == BLACKJACK) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "protected void discard() {\r\n discarded = true;\r\n onDiscard();\r\n }", "@Test\r\n public void testPlayer_getDumbStrategyCard_differentWinners() {\r\n player2 = new Player(\"\", true);\r\n player2.setHand(strategyHand.getAllCards());\r\n boolean differentLegalCardFound = false;\r\n Card firstDiscard = player2.getDumbStrategyCard(yellowSix, yellowSix.getColor());\r\n for(int i = 0; i < 25; i++) {\r\n Card loopCard = player2.getDumbStrategyCard(yellowSix, yellowSix.getColor());\r\n if(!loopCard.equals(firstDiscard)) {\r\n differentLegalCardFound = true;\r\n }\r\n }\r\n assertTrue(differentLegalCardFound);\r\n }", "public boolean blackCheck() {\n\t\treturn false;\n\t}", "private static boolean handOutCards(Player player){\r\n\t\t/* \r\n\t\t * Seleccionamos una de las cartas restantes\r\n\t\t * en la baraja de forma aleatoria y se la \r\n\t\t * pasamos a la mano del jugador\r\n\t\t */\r\n\t\tint index;\r\n\r\n\t\t// Comprobamos las cartas restantes en la baraja\r\n\t\tif(deckOfCards.size() <= 0 || deckOfCards == null){\r\n\t\t\tSystem.err.println(\"No hay cartas para repartir.\");\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\t// Seleccionamos una de las cartas de la baraja\r\n\t\t\tindex = (int) (Math.random()*deckOfCards.size());\r\n\t\t\tplayer.addCard(deckOfCards.get(index)); // Agregamos la carta a la mano del jugador\r\n\t\t\t// Eliminamos la carta de la baraja y lo mostramos en la consola\r\n\t\t\tSystem.out.println(player.getName() + \" recibió una carta con valor de \" + deckOfCards.remove(index).getValue() + \" puntos\"); \r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public void discardAll()\n\t{\n\t\thand = new Card[12];\n\t\tnumCards = 0;\n\t}", "@Test(expected = TooManyDiscardsException.class)\n public void allow_discard_no_more_than_2_cards(){\n\n Deck deck = new Deck();\n Card card1 = new Card(3,2,5);\n Card card2 = new Card(2,7,1);\n Card card3 = new Card(2,7,1);\n deck.add(card1);\n deck.add(card2);\n deck.add(card3);\n Game game = new Game(deck);\n\n game.join(\"susan\");\n game.join(\"peter\");\n\n Card pickedCard1 = game.pickCard(\"susan\");\n game.discard(\"susan\");\n Card pickedCard2 = game.pickCard(\"susan\");\n game.discard(\"susan\");\n Card pickedCard3 = game.pickCard(\"susan\");\n game.discard(\"susan\");\n\n }", "public boolean play(DiscardPile discardPile, \n\t Stack<Card> drawPile, \n\t\t\t\t\t\t\t\t\t\t\tArrayList<Player> players)\n\t{\t\n\t\n\t\n\tSystem.out.println(\"Before playing: \" + this.hand.toString());\n\t\tboolean temp = false;\n\t\tString suitEight = \"xyz\";\n\t\n\t\tif ((discardPile.top()).getRank() == 4 && super.checker_4 == true){\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\"\\t _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \");\n\t\t\tSystem.out.println(\"\\t | skipping the turn.. :( |\");\n\t\t\tSystem.out.println(\"\\t -----------------------------\");\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println();\n\t\t\tsuper.checker_4 = false;\n\t\t\treturn false;\n\t\t\t\n\t\t\t}\n\t\n\t\n\t\n\t\n\t\n\t\n\t\t/* adding two cards */\n\t\t if ((discardPile.top()).getRank() == 2 && super.checker_2 == true){\n\t\t\t \n\t\t\t System.out.println();\n\t\t\t System.out.println(\"\\t _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \");\n\t\t\t System.out.println(\"\\t | twice the value added! |\");\n\t\t\t System.out.println(\"\\t -----------------------------\");\n\t\t\t System.out.println();\n\t\t\t System.out.println();\n\t\t\t \n\t\t\t \n\t\t\tthis.hand.add(drawPile.pop());\n\t\t\t this.hand.add(drawPile.pop());\n\t\t\ttemp = false;\n\t\t\tsuper.checker_2 = false;\n\t\t }\n\t\t\n\t\t\n\t\t \n\t\t\n\t\telse{\n\t\t\tint i = location_1(discardPile);\n\t\t\t\n\t\t\t\n\t\t\tif(i == -1){\n\t\t\t\tthis.hand.add(drawPile.pop());\n\t\t\t\tif( i == location_2(discardPile)){ \n\t\t\t\t\t//System.out.println(\"value is added!\");\n\t\t\t\t\t//System.out.println();\n\t\t\t\t\t//System.out.println();\n\t\t\t\t\n\t\t\t\t} else{\n\t\t\t\t\ti = location_2(discardPile);\n\t\t\t\t\t//System.out.println(\"HAHA! got it!\");\n\t\t\t\t\tdiscardPile.add(this.hand.remove(i));\n\t\t\t\t\ttemp = false;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif ((discardPile.top()).getRank() == 2 && super.checker_2 == false){\n\t\t\t\t\t\tsuper.checker_2 = true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(discardPile.top().getRank() == 4 && super.checker_4 == false){\n\t\t\t\t\t\tsuper.checker_4 = true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ((discardPile.top()).getRank() == 8 && temp == false){\n\t\t\t\t\t\tsuitEight = this.wildEight(discardPile, drawPile, players);\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t \\t Changing the suit to: \" + suitEight);\n\t\t\t\t\t\tSystem.out.print(\"\\t \\t \\t Processing....\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\t(discardPile.top()).setSuit(suitEight);\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t \\t draw pile : \" + drawPile.peek() );\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t \\t discard pile : \" + discardPile.top() );\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif( this.hand.size() == 0 ){\n\t\t\t\t\ttemp = true;\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}\n\t\t\t\t\n\t\t\t\t\n\t\t\t} else{\n\t\t\t\tdiscardPile.add(this.hand.remove(i));\n\t\t\t\ttemp = false;\n\t\t\t\t\n\t\t\t\tif ((discardPile.top()).getRank() == 2 && super.checker_2 == false){\n\t\t\t\t\t\tsuper.checker_2 = true;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(discardPile.top().getRank() == 4 && super.checker_4 == false){\n\t\t\t\t\tsuper.checker_4 = true;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ((discardPile.top()).getRank() == 8 && temp == false){\n\t\t\t\t\t\tsuitEight = this.wildEight(discardPile, drawPile, players);\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t \\t Changing the suit to: \" + suitEight);\n\t\t\t\t\t\tSystem.out.print(\"\\t \\t \\t Processing....\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\t(discardPile.top()).setSuit(suitEight);\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t \\t draw pile : \" + drawPile.peek() );\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t \\t discard pile : \" + discardPile.top() );\n\t\t\t\t\t\tSystem.out.println(\"\\t \\t ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif( this.hand.size() == 0 ){\n\t\t\t\t\ttemp = true;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\n\n\t\t\n\t\t\n\t\n\t\tSystem.out.println(\"After Playing: \" + this.hand.toString());\n\t\tSystem.out.println();\n\t\treturn temp;\n\t\t\n\t\n\t}", "private boolean canPut(Player player) {\n boolean haveValidCart = false;\n boolean can = false;\n for (Card temp: player.getCards()) {\n if(temp.isValidCard(currentCard) || temp instanceof WildCard) {\n haveValidCart = true;\n can = true;\n break;\n }\n }\n if (!haveValidCart) {\n player.addCard(cards.get(0));\n cards.remove(0);\n if (player.getCards().get(player.getCards().size()-1).isValidCard(currentCard)) {\n show();\n System.out.println(player.getName() + \"! You were given a card because you didn't have any valid choice.\");\n can = true;\n }\n else {\n show();\n System.out.println(player.getName() + \"! You were given a card but you don't have any valid choice yet.\");\n }\n }\n return can;\n }", "public List<Card> getDiscardPile() {\r\n return discardPile;\r\n }", "public void discardToDeck() {\n\t\tfor(int i=discardPile.size(); i>0; i--) {\n\t\t deck.add(discardPile.remove(0));\n\t\t}\n\t\tCollections.shuffle(deck);\n\t}", "void playerUsedCard(Card c, boolean discard) {\n\t\t// The creator data is in the 2 first bytes, the other player in the 2\n\t\t// last bytes.\n\t\tplayedCard[0] = (discard ? DISCARDED_CARD : PLAYED_CARD);\n\t\tplayedCard[1] = (byte) c.id;\n\t}", "protected abstract boolean isCardActivatable(Card card);", "public Boolean emptyDeck(){\n return this.deckOfCards.isEmpty();\n }", "public void removeCards() {\n\t\tthis.content.removeAll(this.content);\n\t}", "@Test\n public void testCardCanPlay_WILD() {\n System.out.println(\"cardCanPlay WILD\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.WILD, UnoCardValue.ONE);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.THREE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n boolean result = utils.cardCanPlay(cardSelection, drawCard, wildColour);\n assertEquals(true, result);\n }", "public Boolean isValidCountWildCard() {\r\n\t\tint count = 0;\r\n\t\tfor (RiskCardModel card : lstTradedCards) {\r\n\t\t\tif (card.card_type.equals(\"WILD\")) {\r\n\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn (count > 1 ? false : true);\r\n\t}", "public void removePresentCard() {\n storageCards.remove();\n }", "public void giveOutCards() {\n boolean shared = false;\n while (!shared) {\n for (Player player : this.players) {\n if (this.cards.size() == 0) {\n shared = true;\n } else {\n Card card = this.cards.get(0);\n this.cards.remove(0);\n if (!envelope.has(card)) {\n player.addCard(card);\n }\n }\n }\n }\n }", "@Override\n public boolean isLegal(List<Integer> selectedCards)\n {\n //checks if the two cards selected added together equal 13\n if(selectedCards.size() == 2)\n {\n if(containsSum13(selectedCards))\n {\n \treturn true;\n }\n }\n \n //checks if the selected card is a K\n if(selectedCards.size() == 1)\n {\n \treturn containsK(selectedCards);\n }\n return false;\n \n }", "public boolean cardsLeft() {\n\t\tif (cards.size() - completedCards > 0) {\n\t\t\treturn true;\n\t\t}else {\n\t\t\treturn false;\n\t\t}\n\t}", "boolean hasAlreadShowCard();", "private boolean isValidPlay(ICard cardToPlay) {\n return cardToPlay.isValidOn(getTopCard());\n }", "public boolean isEmpty() {\n return super.cards.isEmpty();\n }", "public boolean isCardToAccuse() {\n\t\treturn (getOwner() == CASE_FILE_PLAYER);\n\t}", "public List<CardSprite> getDiscardPile() {\n return this.discardPile;\n }", "boolean hasAlreadFoldCard();", "@Test\n public void discardLessThan4() {\n gm.setPlayerInfo(clientPlayer4);\n gm.setThisPlayerIndex(clientPlayer4.getPlayerIndex());\n Player p = model.getPlayer(clientPlayer4.getPlayerIndex());\n ResourceSet discardSet = dc.getDiscardAmount();\n verify(robberFacade, atMost(3)).canDiscard(discardSet, p);\n verify(robberFacade, atMost(2)).discard(discardSet, p);\n }", "public void disable() {\r\n cardOne.setEnabled(false);\r\n cardTwo.setEnabled(false);\r\n cardThree.setEnabled(false);\r\n cardFour.setEnabled(false);\r\n cardFive.setEnabled(false);\r\n }", "public void checkCards(){\r\n if (Card1.getSource().equals(Card2.getSource())){\r\n Card1.setEnabled(false); \r\n Card2.setEnabled(false);\r\n Card1.setBackground(new Color(190, 190, 255));\r\n Card2.setBackground(new Color(190, 190, 255));\r\n Card1.setFace(true); \r\n Card2.setFace(true);\r\n if (this.isGameWon()){\r\n \t_s.stopThread();\r\n \tint[] x = _s.getTime();\r\n \tString s = \"\" + x[0] + \":\" + x[1] + \":\" + x[2] + \":\" + x[3];\r\n \tUIManager.put(\"OptionPane.background\",new ColorUIResource(0,255,0));\r\n UIManager.put(\"Panel.background\",new ColorUIResource(250,0,150));\r\n UIManager.put(\"OptionPane.messageFont\", new FontUIResource(new Font( \r\n \"Times New Roman\", Font.BOLD, 18)));\r\n JOptionPane.showMessageDialog(this, \"You win!\\n\"\r\n \t\t+ \"Your time is: \" + s +\"\\n\"\r\n \t\t\t\t+ \"You're (probably) getting better...\", \"\", -1, null);\r\n JOptionPane.showMessageDialog(this, \"Thanks for playing!\\n\"\r\n \t\t+ \"(Rhythm Heaven is a property of Nintendo and Tsunku.)\", \"\", -1, null);\r\n System.exit(0);\r\n }\r\n }\r\n\r\n else{\r\n Card1.setIcon(null); \r\n Card2.setIcon(null);\r\n }\r\n Card1 = null; \r\n Card2 = null;\r\n }", "public int numberUnplayedDevCards(DevCardType devCardType) {\n\t\tint numberAvailable = 0;\n\t\tif(devCardType == DevCardType.SOLDIER) {\n\t\t\tfor(DevelopmentCard Soldier : soldierCards) {\n\t\t\t\tif(Soldier.hasBeenPlayed() == false) {\n\t\t\t\t\tnumberAvailable++;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if(devCardType == DevCardType.MONUMENT) {\n\t\t\tfor(DevelopmentCard VP : victoryPointCards) {\n\t\t\t\tif(VP.hasBeenPlayed() == false) {\n\t\t\t\t\tnumberAvailable++;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if(devCardType == DevCardType.ROAD_BUILD) {\n\t\t\tfor(DevelopmentCard RB : roadBuilderCards) {\n\t\t\t\tif(RB.hasBeenPlayed() == false) {\n\t\t\t\t\tnumberAvailable++;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if(devCardType == DevCardType.MONOPOLY) {\n\t\t\tfor(DevelopmentCard Monopoly : monopolyCards) {\n\t\t\t\tif(Monopoly.hasBeenPlayed() == false) {\n\t\t\t\t\tnumberAvailable++;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if(devCardType == DevCardType.YEAR_OF_PLENTY) {\n\t\t\tfor(DevelopmentCard YOP : yearOfPlentyCards) {\n\t\t\t\tif(YOP.hasBeenPlayed() == false) {\n\t\t\t\t\tnumberAvailable++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//System.out.println(\"I am checking how many unplayed cards I have! Which is: \" + numberAvailable);\n\t\t\n\t\treturn numberAvailable;\n\t}", "public Boolean TrashesCards();", "public void otherDiscard(int pos, GameCard card){\n this.infoTokens += 1;\n int count = this.discardPile.getOrDefault(card.toString(), 0);\n this.discardPile.put(card.toString(), count + 1);\n playerCardsList.get(turnCounter % playerCardsList.size()).set(pos, card);\n notifyObservors();\n }", "@Test\n public void discardDrawFour() {\n this.reset();\n this.bps.startGame(this.fullDeck, false, 7, 3);\n assertEquals(this.drawCards, this.bps.getDrawCards());\n this.bps.discardDraw(0);\n assertNotEquals(this.drawCards, this.bps.getDrawCards());\n\n this.reset();\n this.bps.startGame(this.fullDeck, false, 7, 1);\n this.bps.discardDraw(0);\n ArrayList<Card> draw = new ArrayList<>();\n draw.add(h4);\n assertEquals(draw, this.bps.getDrawCards());\n }", "public boolean cardPlayedBefore() {\n boolean played = false;\n if (playedCards.size()>0) {\n played = true;\n }\n return played;\n }", "public static boolean isCdmaCardCompetion(Context context) {\n boolean isCdmaCard = true;\n boolean isCompetition = true;\n int simCount = 0;\n if (context != null) {\n simCount = TelephonyManager.from(context).getSimCount();\n }\n if (simCount == 2) {\n for (int i = 0; i < simCount ; i++) {\n isCdmaCard = isCdmaCard\n && (SvlteUiccUtils.getInstance().getSimType(i)\n == SvlteUiccUtils.SIM_TYPE_CDMA);\n SubscriptionInfo subscriptionInfo =\n SubscriptionManager.from(context).\n getActiveSubscriptionInfoForSimSlotIndex(i);\n if (subscriptionInfo != null) {\n isCompetition = isCompetition &&\n TelephonyManagerEx.getDefault().isInHomeNetwork(\n subscriptionInfo.getSubscriptionId());\n } else {\n isCompetition = false;\n break;\n }\n }\n } else {\n isCdmaCard = false;\n isCompetition = false;\n }\n Log.d(TAG, \"isCdmaCard: \" + isCdmaCard + \" isCompletition: \" + isCompetition\n + \" is Suppport SIM switch: \" + FeatureOption.MTK_DISABLE_CAPABILITY_SWITCH);\n return isCdmaCard && isCompetition && (!FeatureOption.MTK_DISABLE_CAPABILITY_SWITCH);\n }", "public boolean validCardPlay(UnoCard card) {\r\n return card.getColor() == validColor || card.getValue() == validValue;\r\n }", "public boolean canOfferInsurance() {\n\t\treturn this.hand.getCards().get(0) == Card.ACE;\n\t}", "@Test\r\n public void testHasAtLeastTwoPlayableCards() {\n Player player2 = new Player(\"Three Playable Cards Test\", true);\r\n Hand threePlayableCardsHand = strategyHand;\r\n player2.setHand(threePlayableCardsHand.getAllCards());\r\n\r\n // Make it harder to find playable cards:\r\n player2.getHand().discard(new Card(Card.COLORLESS, Card.WILD, cvm));\r\n player2.getHand().discard(new Card(Card.COLORLESS, Card.WILD_DRAW_FOUR, cvm));\r\n\r\n Card currentPlayedCard_1 = new Card(Card.YELLOW, Card.ONE, cvm);\r\n assertTrue(player2.hasAtLeastTwoPlayableCards(currentPlayedCard_1, Card.BLUE));\r\n\r\n Card currentPlayedCard_2 = new Card(Card.BLUE, Card.SEVEN, cvm);\r\n assertFalse(player2.hasAtLeastTwoPlayableCards(currentPlayedCard_2, Card.BLUE));\r\n }", "public static boolean validateItemCardUsage(Model model, ItemCard card) {\n\n if (model.getCurrentPlayerReference().getCharacter() instanceof Alien) {\n return false;\n }\n\n Human player = (Human) model.getCurrentPlayerReference().getCharacter();\n if (card instanceof AdrenalineCard\n && player.getMaxAllowedMovement() == 2) {\n return false;\n }\n if (card instanceof AttackCard && player.isAttackAllowed()) {\n return false;\n }\n if (card instanceof SedativesCard && !player.hasToDrawSectorCard()) {\n return false;\n }\n Sector playerPosition = model.getMap().getSectors()\n .get(model.getCurrentPlayerReference().getLastPosition());\n if (card instanceof TeleportCard\n && playerPosition instanceof SpawnSector) {\n return false;\n }\n\n List<ItemCard> heldCards = model.getCurrentPlayerReference().getHand()\n .getHeldCards();\n for (ItemCard i : heldCards) {\n if ((card.getClass()).equals(i.getClass())) {\n heldCards.remove(i);\n return true;\n }\n }\n return false;\n\n }", "public boolean deal() {\n int k, j;\n boolean enoughCards;\n\n // clear all hands\n for (j = 0; j < numPlayers; j++)\n hand[j].resetHand();\n\n enoughCards = true;\n for (k = 0; k < numCardsPerHand && enoughCards; k++) {\n for (j = 0; j < numPlayers; j++)\n if (deck.getNumCards() > 0)\n hand[j].takeCard(deck.dealCard());\n else {\n enoughCards = false;\n break;\n }\n }\n\n return enoughCards;\n }" ]
[ "0.7015899", "0.6935595", "0.68347025", "0.67247874", "0.6617679", "0.65309227", "0.6527584", "0.651128", "0.64799064", "0.6388165", "0.6387383", "0.63749623", "0.63695216", "0.6357576", "0.6294641", "0.62675786", "0.6243509", "0.6240876", "0.6213516", "0.61943203", "0.6186072", "0.6181842", "0.61500186", "0.6137268", "0.61356425", "0.61260706", "0.6123631", "0.6101208", "0.6098086", "0.60718054", "0.60253894", "0.60208076", "0.60068303", "0.6005637", "0.59955466", "0.59955466", "0.599026", "0.59863275", "0.5977676", "0.5969568", "0.59689045", "0.5938405", "0.5933787", "0.59268844", "0.592586", "0.5922347", "0.5914739", "0.5909059", "0.5900913", "0.588481", "0.5862238", "0.5857771", "0.585729", "0.5856937", "0.5854652", "0.5841029", "0.58396494", "0.5834131", "0.5820363", "0.5817136", "0.581207", "0.5794922", "0.5790321", "0.5785973", "0.5776499", "0.57761085", "0.5761874", "0.57380164", "0.5729529", "0.5716527", "0.5702921", "0.56986105", "0.5690451", "0.568407", "0.56754196", "0.5672183", "0.56628305", "0.56566155", "0.5652709", "0.56519914", "0.5651694", "0.56469905", "0.56453806", "0.56219345", "0.5620942", "0.5615995", "0.5612253", "0.5599352", "0.55899763", "0.55876285", "0.5584309", "0.5581379", "0.5577982", "0.5572818", "0.55712944", "0.5555654", "0.5552859", "0.55466485", "0.55342305", "0.5522715" ]
0.7941984
0
This method determines if the specified player can be robbed at that location
boolean canRobPlayer(HexLocation location, int victimIndex);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract boolean isPossible(Player p);", "public boolean playerCanMove(Player playerObject) {\n for (int r = 0; r < Board.MAX_ROW; r++) {\n for (int c = 0; c < Board.MAX_COLUMN; c++) {\n Slot slotFrom = boardObject.getSlot(r, c);\n Slot slotRight = boardObject.getSlot(r, c + 2);\n Slot slotLeft = boardObject.getSlot(r, c - 2);\n Slot slotUp = boardObject.getSlot(r - 2, c);\n Slot slotDown = boardObject.getSlot(r + 2, c);\n\n if (isValidMove(slotFrom, slotRight, playerObject.getColor())) {\n return true;\n }\n\n if (isValidMove(slotFrom, slotLeft, playerObject.getColor())) {\n return true;\n }\n\n if (isValidMove(slotFrom, slotUp, playerObject.getColor())) {\n return true;\n }\n\n if (isValidMove(slotFrom, slotDown, playerObject.getColor())) {\n return true;\n }\n }\n }\n\n return false;\n }", "@Override\n public final boolean canStand(Playery player) {\n return true;\n }", "public boolean playerInRangeProtection(Location loc, Player player) {\n Set set = plugin.map.entrySet();\n Iterator i = set.iterator();\n\n while (i.hasNext()) {\n Map.Entry me = (Map.Entry) i.next();\n List list = (List) me.getValue();\n for (int index = 0, d = list.size(); index < d; index++) {\n Areas area = (Areas)list.get(index);\n Location x = area.getLocation();\n if (loc.distance(x) < radius) {\n if(me.getKey().equals(player.getName())) {\n return false;\n } else {\n player.sendPopup(plugin.msg(\"You are in a protected area owned by: \" + me.getKey()));\n return true;\n }\n }\n }\n }\n return false;\n }", "public static boolean canPlayerMove(Player player){\r\n int playerX = 0;\r\n int playerY = 0;\r\n int nX;\r\n int nY;\r\n //finding the player on the board\r\n for(int i = 0; i < board.length; i++) {\r\n for (int j = 0; j < board[i].length; j++) {\r\n if(player.getPosition() == board[i][j]) {\r\n playerX = i;\r\n playerY = j;\r\n }\r\n }\r\n }\r\n //making sure that the player stays on the board\r\n\r\n if(playerY != board[0].length-1) {\r\n nX = playerX;\r\n nY = playerY + 1;\r\n if (board[nX][nY].west && board[playerX][playerY].east && !board[nX][nY].isOnFire) {//if the tile will accept the player\r\n return true;\r\n }\r\n }\r\n\r\n if(playerY != 0) {\r\n nX = playerX;\r\n nY = playerY - 1;\r\n if (board[nX][nY].east && board[playerX][playerY].west && !board[nX][nY].isOnFire) {\r\n return true;\r\n }\r\n }\r\n\r\n if(playerX != 0) {\r\n nX = playerX - 1;\r\n nY = playerY;\r\n if (board[nX][nY].south && board[playerX][playerY].north && !board[nX][nY].isOnFire) {\r\n return true;\r\n }\r\n }\r\n\r\n if(playerX != board.length-1) {\r\n nX = playerX + 1;\r\n nY = playerY;\r\n if (board[nX][nY].north && board[playerX][playerY].south && !board[nX][nY].isOnFire) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }", "public boolean canBuild(Location location, Player player) {\n if (!location.getWorld().getEnvironment().equals(Environment.NORMAL)) {\n // If theyre not in the overworld, they cant build\n return false;\n } else if (landIsClaimed(location)) {\n if(isOwner(location,player)) {\n return true;\n } else if(landPermissionCode(location).equals(\"p\")) {\n return true;\n } else if(landPermissionCode(location).equals(\"c\")) {\n String owner_uuid=REDIS.get(\"chunk\" + location.getChunk().getX() + \",\" + location.getChunk().getZ() + \"owner\");\n String owner_clan=REDIS.get(\"clan:\"+owner_uuid);\n String player_clan=REDIS.get(\"clan:\"+player.getUniqueId().toString());\n if(owner_clan.equals(player_clan)) {\n return true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n } else {\n return true;\n }\n }", "public boolean containsPoint(Player player)\n {\n //Initially calculate the squared values of the distance between the player and the object\n float xSquared = (player.getX() - x)*(player.getX() - x);\n\t\tfloat ySquared = (player.getY() - y)*(player.getY() - y);\n float radiusSquared = radius*radius;\n //While our asteroid is within the x bounds of our player.\n while (x > player.getX() && x < player.getX()+player.getWidth())\n {\n xSquared = 0; //Set to zero so we can calculate distance from the top\n //of the square rather than the top left x value\n //If statement for if the asteroid is below the player\n if (y > player.getY()+player.getHeight())\n {\n ySquared = ((player.getY()+player.getHeight())-y)*((player.getY()+player.getHeight())-y);\n if (xSquared + ySquared - radiusSquared <= 0)\n return true;\n else\n return false;\n }\n //For if the asteroid is above the player do nothing but compare\n\t\t if (xSquared + ySquared - radiusSquared <= 0)\n\t\t\t return true;\n\t\t else\n return false;\n }\n //While our asteroid is within the y bounds of our player\n while (y > player.getY() && y < player.getY()+player.getHeight())\n {\n ySquared = 0; //Similar to pervious while statement. We only care about\n //the x-component this time rather than the y-component.\n //If the asteroid is to the right of the player\n if (x > player.getX()+player.getWidth())\n {\n xSquared = ((player.getX()+player.getWidth())-x)*((player.getX()+player.getWidth())-x);\n if (xSquared + ySquared - radiusSquared <= 0)\n return true;\n else\n return false;\n }\n //Asteroid is to the left so compare\n if (xSquared + ySquared - radiusSquared <= 0)\n\t\t\t return true;\n\t\t else\n return false;\n }\n return false;\n }", "boolean canMove(Color player) {\n int[][] myStatusBoard;\n if (_playerOnMove == ORANGE) {\n myStatusBoard = _orangeStatusBoard;\n } else {\n myStatusBoard = _violetStatusBoard;\n }\n if (Game._totalMoves < 2) {\n return true;\n }\n int i, j;\n for (i = 0; i < 16; i++) {\n for (j = 0; j < 16; j++) {\n if (myStatusBoard[i][j] == 1) {\n if (findMove(i, j, myStatusBoard)) {\n return true;\n }\n }\n }\n }\n return false;\n }", "public boolean canDoBuyRoad(){\n\t\t // If the player doesn't have resources for a road, or has already played all his roads, he can't buy another\n\t\t if(resourceCardHand.canDoPayForRoad() == false || playerPieces.hasAvailableRoad() == false) {\n\t\t\t return false;\n\t\t }\n\t\t if(playerPieces.getNumberOfRoads() > 13){\n\t\t\t return true;\n\t\t }\n\t\t // If the player has no legal place to put a road on the map, he shouldn't be allowed to buy one.\n\t\t if(playerPieces.canPlaceARoadOnTheMap() == false) {\n\t\t\t return false;\n\t\t }\n\t\t return true;\n\t }", "public MoveResult canMovePiece(Alignment player, Coordinate from, Coordinate to);", "private boolean canAttack(Piece p, Location loc)\n {\n int thisRow = getLocation(p).getRow();\n int thisCol = getLocation(p).getCol();\n int otherRow = loc.getRow();\n int otherCol = loc.getCol();\n int rowDiff = Math.abs(otherRow-thisRow);\n int colDiff = Math.abs(otherCol-thisCol);\n switch (p.getType())\n {\n case PAWN:\n return rowDiff==1&&colDiff==1 &&\n ((p.white()&&otherRow<thisRow)||(!p.white()&&otherRow>thisRow));\n \n case KING:\n return adjacent(getLocation(p),loc);\n \n case KNIGHT:\n return rowDiff>0 && colDiff>0 && rowDiff+colDiff==3;\n \n //rook, bishop, queen are identical, except for their preconditions\n case ROOK:case BISHOP:case QUEEN:\n if ((p.getType()==Type.ROOK&&rowDiff>0&&colDiff>0)\n ||(p.getType()==Type.BISHOP&&rowDiff!=colDiff)\n ||(p.getType()==Type.QUEEN&&rowDiff>0&&colDiff>0&&rowDiff!=colDiff))\n return false;\n Location next = getLocation(p).closerTo(loc);\n while (!next.equals(loc))\n {\n if (getPiece(next)!=null) //checks for piece in the way\n return false;\n next = next.closerTo(loc);\n }\n return true;\n }\n return false; //will never happen because all piece types covered\n }", "public boolean canMove (Location loc) {\n Grid<Actor> gr = getGrid();\n if (gr == null)\n return false;\n if (!gr.isValid(loc))\n return false;\n Actor neighbor = gr.get(loc);\n return !(neighbor instanceof Wall);\n }", "boolean canPlaceRobber(HexLocation hexLoc);", "public boolean moveable() {\n //check reach border\n if (reachBorder()) {\n return false;\n }\n //get the location of the next spot to move to\n //move up\n Point nextLocation = this.getCenterLocation();\n if (direction == 12) {\n nextLocation = new Point(this.getCenterX(),\n this.getCenterY() - speed);\n }\n //move right\n if (direction == 3) {\n nextLocation = new Point(this.getCenterX() + speed,\n this.getCenterY());\n\n }\n //move down\n if (direction == 6) {\n nextLocation = new Point(this.getCenterX(),\n this.getCenterY() + speed);\n\n }\n //move left\n if (direction == 9) {\n nextLocation = new Point(this.getCenterX() - speed,\n this.getCenterY());\n }\n\n // get all objects in a circle of radius tileSize * 2 around the players\n //these objects are those which can possibly colide with the players\n int checkRadius = GameUtility.GameUtility.TILE_SIZE * 2;\n for (GameObject gameObject : GameManager.getGameObjectList()) {\n if (GameUtility.GameUtility.distance(gameObject.getCenterLocation(),\n this.getCenterLocation()) < checkRadius) {\n if ((GameUtility.GameUtility.dectectCollision(\n gameObject.getCenterLocation(),\n nextLocation)) && !(GameUtility.GameUtility.dectectCollision(\n gameObject.getCenterLocation(),\n this.getCenterLocation())) && gameObject.getType() != GameObjectType.POWER_UP && gameObject.getType() != GameObjectType.MONSTER && gameObject.getType() != GameObjectType.PLAYER) {\n return false;\n }\n }\n }\n return true;\n\n }", "public boolean canMove(Location loc){\n if(loc.getX() >= theWorld.getX() || loc.getX() < 0){\n System.out.println(\"cant move1\");\n return false;\n }else if(loc.getY() >= theWorld.getY() || loc.getY() < 0){\n System.out.println(\"cant move2\");\n return false;\n }else{\n System.out.println(\"can move\");\n return true;\n }\n }", "public void checkBoundaries(Player pl) {\n\t\tPoint loc = gameMap.toGridLocation(pl.getLocation());\n\t\tint locationX = loc.x;\n\t\tint locationY = loc.y;\n\t\t\n\t\tif(gameMap.getType(loc.x, loc.y) == GameMap.WALL)\n\t\t{\n\t\t\tif(loc.x > 0)\n\t\t\t\tpl.getLocation().x -= 1f;\n\t\t\telse\n\t\t\t\tpl.getLocation().x += 1f;\n\t\t}\n\t\t\n\t\tPoint[] surrounding = gameMap.getSurrounding((int) locationX, (int) locationY);\n\t\t\n\t\tRectangle2D.Float player = pl.getLocationAsRect();\n\t\tfor(Point p : surrounding)\n\t\t{\n\t\t\tRectangle2D.Float rect = new Rectangle2D.Float(p.x * 16 + 112, p.y * 16 + 32, 16, 16);\n\t\t\tif(rect.intersects(player))\n\t\t\t{\n\t\t\t\tbyte type = gameMap.getType(p.x, p.y);\n\t\t\t\tif(isSpecial(pl, type))\n\t\t\t\t{\n\t\t\t\t\tspecialMovement(pl, type);\n//\t\t\t\t\tSystem.out.println(pl.getClass().getSimpleName() + \" hit a boundary\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(type == GameMap.ORB)\n\t\t\t\t{\n\t\t\t\t\tgameMap.setType(p.x, p.y, GameMap.EATEN_ORB);\n\t\t\t\t\t\n\t\t\t\t\tonOrbCollect(pl);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public boolean canInteractWithBlock(Player player, Location location) {\n\t\tif (mayor.equals(player.getUniqueId()) || councils.containsKey(player.getUniqueId())) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tPlot plot = getPlotHere(location);\n\t\t\treturn (inhabitants.contains(player.getUniqueId()) && plot == null) || (plot != null && plot.canBuild(player, location));\n\t\t}\n\t}", "boolean canMove();", "@Override\n\tpublic boolean checkWinner( int player) {\n\t\t\n\t\treturn didWin(player, -1, 0) ||\n\t\t\t\tdidWin(player, 0, -1) ||\n didWin(player, -1, -1) ||\n didWin(player, 1, -1);\n\t}", "public boolean isWin_LordRust(){\r\n // player got LordSelachii card\r\n Player playerHoldCard = null;\r\n for(Player player : discWorld.getPlayer_HASH().values()){\r\n if(player.getPersonalityCardID() == 3){\r\n playerHoldCard = player;\r\n break;\r\n }\r\n }\r\n \r\n if(playerHoldCard != null){\r\n int numPlayers = discWorld.getPlayer_HASH().size();\r\n \r\n int numCityAreaCard = 0;\r\n \r\n for(Integer areaID : playerHoldCard.getCityAreaCardList()){\r\n Area area = discWorld.getArea_HASH().get(areaID);\r\n if(area.getDemonList().size() == 0){\r\n numCityAreaCard++;\r\n }\r\n }\r\n \r\n if (numPlayers == 2) {\r\n if(numCityAreaCard >= 7){\r\n return true;\r\n }\r\n } else if (numPlayers == 3) {\r\n if(numCityAreaCard >= 5){\r\n return true;\r\n }\r\n } else if (numPlayers == 4) {\r\n if(numCityAreaCard >= 4){\r\n return true;\r\n }\r\n }\r\n }\r\n \r\n return false;\r\n }", "public abstract boolean isPlayer();", "public boolean collides(Rectangle player) {\r\n return player.overlaps(boundsTop) || player.overlaps(boundsBot);\r\n }", "public boolean checkRequirements(PlayerBoard playerBoard);", "public boolean canMine(EntityPlayer player, int X, int Y, int Z);", "public boolean canMove() {\n\n\tArrayList<Location> moveLocs = getValid(getLocation());\n\n\tif (isEnd == true) {\n\t return false;\n\t} \n\tif (!moveLocs.isEmpty()) {\n\t \n\t randomSelect(moveLocs);\n\t // selectMoveLocation(moveLocs);\n\t return true;\n\n\t} else {\n\t return false;\n\t}\n }", "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}", "private boolean canMove(Location location) {\n if (location == null) return false;\n return location.getWorld().intersects(this, Util.getRectangle(location, size)) == null && location.getY() >= 0 && location.getX() >= 0;\n }", "public boolean isNear(Player player) {\n if(this.worldObject.getLocation().distance(player.getLocation()) <= this.harvestableObject.distanceToInteract()) {\n return true;\n }\n return false;\n }", "private boolean canMove() {\n\t\tif (System.currentTimeMillis() - lastTrunTime < 300) {// move time is\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 300ms before\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// last move\n\t\t\treturn false;\n\t\t}\n\t\tboolean status = false;\n\t\tif(stage == 1){\n\t\t\tmap = GameView.map;\n\t\t}else if(stage == 2){\n\t\t\tmap = GameViewStage2.map;\n\t\t}else {\n\t\t\tmap = GameViewStage3.map;\n\t\t}\n\t\tif (direction == UP) {// when tank moves up\n\t\t\tif (centerPoint.getY() - speed >= 0) {\n\t\t\t\tif (map[(centerPoint.getY() - speed) / UNIT][centerPoint\n\t\t\t\t\t\t.getX() / UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() - speed) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() + UNIT) / UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() - speed) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() + 2 * UNIT) / UNIT] == 0) {\n\t\t\t\t\tstatus = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (direction == DOWN) {\n\t\t\tif (centerPoint.getY() + tankBmp.getHeight() + speed < screenHeight) {\n\t\t\t\tif (map[(centerPoint.getY() + 2 * UNIT + speed) / UNIT][centerPoint\n\t\t\t\t\t\t.getX() / UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + 2 * UNIT + speed)\n\t\t\t\t\t\t\t\t/ UNIT][(centerPoint.getX() + UNIT) / UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + 2 * UNIT + speed)\n\t\t\t\t\t\t\t\t/ UNIT][(centerPoint.getX() + 2 * UNIT) / UNIT] == 0) {\n\t\t\t\tstatus = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (direction == LEFT) {\n\n\t\t\tif (centerPoint.getX() - speed >= 0) {\n\t\t\t\tif (map[centerPoint.getY() / UNIT][(centerPoint.getX() - speed)\n\t\t\t\t\t\t/ UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + UNIT) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() - speed) / UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + 2 * UNIT) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() - speed) / UNIT] == 0) {\n\t\t\t\t\tstatus = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (direction == RIGHT) {\n\t\t\tif (centerPoint.getX() + tankBmp.getWidth() + speed < screenWidth) {\n\t\t\t\tif (map[centerPoint.getY() / UNIT][(centerPoint.getX()\n\t\t\t\t\t\t+ 2 * UNIT + speed)\n\t\t\t\t\t\t/ UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + UNIT) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() + 2 * UNIT + speed)\n\t\t\t\t\t\t\t\t/ UNIT] == 0\n\t\t\t\t\t\t&& map[(centerPoint.getY() + 2 * UNIT) / UNIT][(centerPoint\n\t\t\t\t\t\t\t\t.getX() + 2 * UNIT + speed)\n\t\t\t\t\t\t\t\t/ UNIT] == 0) {\n\t\t\t\t\tstatus = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (status)\n\t\t\tlastTrunTime = System.currentTimeMillis();\n\t\treturn status;\n\t}", "public boolean roadBlocked(Player player)\n {\n int num = 0;\n int num2 = 0;\n int num3 = 0;\n if (person_to_play == 1)\n {\n num = check4CollisionWithRed(player);\n num2 = check4CollisionWithGreen(player);\n num3 = check4CollisionWithYellow(player);\n }\n else if (person_to_play == 2)\n {\n //println(\"inside road block\");\n num = check4CollisionWithBlue(player);\n num2 = check4CollisionWithGreen(player);\n num3 = check4CollisionWithYellow(player);\n //println(\"num=\"+num);\n }\n else if (person_to_play == 3)\n {\n num = check4CollisionWithBlue(player);\n num2 = check4CollisionWithRed(player);\n num3 = check4CollisionWithYellow(player);\n }\n else if (person_to_play == 4)\n {\n num = check4CollisionWithBlue(player);\n num2 = check4CollisionWithRed(player);\n num3 = check4CollisionWithGreen(player);\n }\n if (num > 1 || num2 > 1 || num3 > 1)\n {\n return true;\n }\n return false;\n }", "public abstract boolean canMoveTo(Case Location);", "public boolean isWin(Player player, Point p) {\n if (p.getX() == 0 && p.getY() == 0) {\n return false;\n }\n if (player == P1) {\n if (p.getY() >= 9) {\n winner = P1;\n return true;\n }\n return false;\n }\n else {\n if (p.getY() <= 1) {\n winner = P2;\n return true;\n }\n return false;\n }\n }", "private static boolean canMove() {\n return GameManager.getCurrentTurn();\r\n }", "@Override\n protected boolean canMove(int playerIdx) {\n if(pgs.getTurnID() == playerIdx){\n return true;\n }\n return false;\n }", "private void checkPlayerCondition()\n\t{\n\t\tif (playerExists() && PlayerAccess.getPlayer().isInExit())\n\t\t{\n\t\t\twon = true;\n\t\t}\n\t\tif (playerIsDead())\n\t\t{\n\t\t\tMapInstance.getInstance().levelRestart();\n\t\t}\n\t\tif (playerHasLost())\n\t\t{\n\t\t\tlost = true;\n\t\t}\n\t\tif (runOutOfTime())\n\t\t{\n\t\t\tPlayerAccess.getPlayer().die();\n\t\t}\n\t}", "public boolean canDoBuildInitialRoad(){\n\t\t // If the player already has two roads on the board then he has already placed the initial roads\n\t\t if(playerPieces.getNumberOfRoads() < 14){\n\t\t\t return false;\n\t\t }\n\t\t return true;\n\t }", "public boolean canMove() {\n ArrayList<Location> valid = canMoveInit();\n if (valid == null || valid.isEmpty()) {\n return false;\n }\n ArrayList<Location> lastCross = crossLocation.peek();\n for (Location loc : valid) {\n Actor actor = (Actor) getGrid().get(loc);\n if (actor instanceof Rock && actor.getColor().equals(Color.RED)) {\n next = loc;\n isEnd = true;\n return false;\n }\n if (!lastCross.contains(loc)) {\n lastCross.add(loc);\n next = loc;\n ArrayList<Location> nextCross = new ArrayList<>();\n nextCross.add(next);\n nextCross.add(last);\n crossLocation.push(nextCross);\n return probabilityAdd();\n }\n }\n next = lastCross.get(1);\n crossLocation.pop();\n return probabilitySub();\n }", "public boolean inRegionRadius(Location loc, int radius)\n {\n if (!loc.getWorld().getName().equals(world.getName()) || !setup)\n return false;\n \n int x = loc.getBlockX();\n int y = loc.getBlockY();\n int z = loc.getBlockZ();\n \n // Check the lobby first.\n if (lobbySetup)\n {\n if ((x + radius >= l1.getBlockX() && x - radius <= l2.getBlockX()) && \n (z + radius >= l1.getBlockZ() && z - radius <= l2.getBlockZ()) && \n (y + radius >= l1.getBlockY() && y - radius <= l2.getBlockY()))\n return true;\n }\n \n return ((x + radius >= p1.getBlockX() && x - radius <= p2.getBlockX()) &&\n (z + radius >= p1.getBlockZ() && z - radius <= p2.getBlockZ()) &&\n (y + radius >= p1.getBlockY() && y - radius <= p2.getBlockY()));\n }", "public static boolean hasWonTheGame(Player player) {\r\n FloorTile pos = null;\r\n for (int i = 0; i < board.length; i++) {\r\n for (int j = 0; j < board[i].length; j++) {\r\n if (player.getPosition() == board[i][j]) {\r\n pos = board[i][j];\r\n }\r\n }\r\n }\r\n if (goalTile == pos) {\r\n for (int i = 0; i < numOfPlayers; i++) {\r\n players[i].getPlayerProfile().incGamesPlayed();\r\n if (player == players[i]) {\r\n players[i].getPlayerProfile().incWins();\r\n } else {\r\n players[i].getPlayerProfile().incLosses();\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n return false;\r\n }", "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 canBuild(Player player, Location location) {\n\t\tif (mayor.equals(player.getUniqueId()) || councils.containsKey(player.getUniqueId())) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tPlot plot = getPlotHere(location);\n\t\t\treturn plot != null && plot.canBuild(player, location);\n\t\t}\n\t}", "private boolean playerWin(Board board)\n {\n return check(board, PLAYER);\n }", "public boolean canMove() {\r\n return (state == State.VULNERABLE || state == State.INVULNERABLE);\r\n\r\n }", "public boolean canSee ( Player player ) {\n\t\treturn extract ( handle -> handle.canSee ( player ) );\n\t}", "public boolean tilePlayerPlacable(float xTile, float yTile, int player)\r\n/* 196: */ {\r\n/* 197:220 */ return (tileInBounds(xTile, yTile)) && \r\n/* 198:221 */ (getStartPositionOnTile(player, xTile, yTile));\r\n/* 199: */ }", "public boolean inRegion(Location loc)\n {\n if (!loc.getWorld().getName().equals(world.getName()) || !setup)\n return false;\n \n int x = loc.getBlockX();\n int y = loc.getBlockY();\n int z = loc.getBlockZ();\n \n // Check the lobby first.\n if (lobbySetup)\n {\n if ((x >= l1.getBlockX() && x <= l2.getBlockX()) && \n (z >= l1.getBlockZ() && z <= l2.getBlockZ()) && \n (y >= l1.getBlockY() && y <= l2.getBlockY()))\n return true;\n }\n \n // Returns false if the location is outside of the region.\n return ((x >= p1.getBlockX() && x <= p2.getBlockX()) && \n (z >= p1.getBlockZ() && z <= p2.getBlockZ()) && \n (y >= p1.getBlockY() && y <= p2.getBlockY()));\n }", "private boolean try2GetRedPlayerFromHome(Player player)\n {\n try\n {\n RedPlayer redPlayer = (RedPlayer) player;\n if (RedPlayer.getNumber_of_buttons_allowed() > 0)\n {\n ludo.getPlayerFromHome(player);\n //RedPlayer.setNumber_of_buttons_allowed(RedPlayer.decrementNumberOfAllowedPlayers());\n return true;\n }\n return false;\n }\n catch (Exception e)\n {\n return false;\n }\n }", "private boolean canMove() {\n return !(bestMove[0].getX() == bestMove[1].getX() && bestMove[0].getY() == bestMove[1].getY());\n }", "private Player checkIfEatsRedPlayer(Player player)\n {\n int x_cord = getMidPoint(player.x_cordinate);//player.x_cordinate;\n int y_cord = getMidPoint(player.y_cordinate);//player.y_cordinate;\n int redx1 = getMidPoint(getRed_player1().x_cordinate);\n int redx2 = getMidPoint(getRed_player2().x_cordinate);\n int redx3 = getMidPoint(getRed_player3().x_cordinate);\n int redx4 = getMidPoint(getRed_player4().x_cordinate);\n int redy1 = getMidPoint(getRed_player1().y_cordinate);\n int redy2 = getMidPoint(getRed_player2().y_cordinate);\n int redy3 = getMidPoint(getRed_player3().y_cordinate);\n int redy4 = getMidPoint(getRed_player4().y_cordinate);\n if (collisionDetection(x_cord, y_cord, redx1, redy1) == 1)\n {\n return getRed_player1();\n }\n else if (collisionDetection(x_cord, y_cord, redx2, redy2) == 1)\n {\n return getRed_player2();\n }\n else if (collisionDetection(x_cord, y_cord, redx3, redy3) == 1)\n {\n return getRed_player3();\n }\n else if (collisionDetection(x_cord, y_cord, redx4, redy4) == 1)\n {\n return getRed_player4();\n }\n else\n {\n return null;\n }\n }", "public boolean canMove() {\n return (Math.abs(getDist())>=50);\n }", "@Override\n\tpublic boolean movable(Entity obj) {\n\t\tif (!(obj instanceof Player)) return false;\n\t\tPlayer player = (Player) obj;\n\t\t\n\t\tint futureX = this.getX();\n\t\tint futureY = this.getY();\n\t\t\n\t\t\n\t\tint playerX = player.getX();\n\t\tint playerY = player.getY();\n\t\t\n\t\tif (playerX == this.getX()) {\n\t\t\t// player moving either up or down\n\t\t\tif (playerY > this.getY()) {\n\t\t\t\t// player moving up so check what's up of boulder\n\t\t\t\tfutureY = this.getY() - 1;\n\t\t\t} else {\n\t\t\t\t// player moving down ''\n\t\t\t\tfutureY = this.getY() + 1;\n\t\t\t}\n\t\t} else if (playerY == this.getY()) {\n\t\t\t// player moving either left or right\n\t\t\tif (playerX > this.getX()) {\n\t\t\t\t// player moving left ''\n\t\t\t\tfutureX = this.getX() - 1;\n\t\t\t} else {\n\t\t\t\t// player moving right ''\n\t\t\t\tfutureX = this.getX() + 1;\n\t\t\t}\n\t\t}\n\t\t\n\t\tboolean result = checkMoveable(futureX, futureY);\n\t\treturn result;\n\t}", "public boolean playerWonGame(Player player) {\n if (playerWonGameWithDiagonalLine(player) || playerWonGameWithHorizontalLine(player)\n || playerWonGameWithVerticalLine(player)) {\n return true; \n }\n return false; \n \n }", "public boolean isValid(CoreProtectAPI.ParseResult ore) {\n if (worldName != null && worldName.equalsIgnoreCase(ore.worldName())) {\n Location loc = new Location(Bukkit.getWorld(ore.worldName()), ore.getX(), ore.getY(), ore.getZ());\n if (loc.distance(getLocation()) <= MAX_DISTANCE) {\n if (ore.getType() == type) {\n return true;\n }\n }\n }\n return false;\n }", "public abstract boolean canMove(Board board, Spot from, Spot to);", "protected abstract boolean isPlayerActivatable(PlayerSimple player);", "public boolean isRadiant(JsonNode player) {\n return player.get(\"player_slot\").asInt() < 128;\n }", "public boolean isPossibleOwner(Player player) {\n\t\treturn possibleOwners.contains(player);\n\t}", "public boolean isSpawnable(Location loc) {\n Block block = loc.getBlock();\n Block under = loc.getBlock().getRelative(BlockFace.DOWN);\n Block above = loc.getBlock().getRelative(BlockFace.UP);\n if (block.getType().equals(Material.AIR) && !under.getType().equals(Material.AIR) && above.getType().equals(Material.AIR)) {\n if (block.getLightLevel() <= plugin.CONFIG.SPAWNING_LIGHT) {\n return true;\n }\n }\n return false;\n }", "public boolean getCanSpawnHere()\n {\n return this.isValidLightLevel() && super.getCanSpawnHere();\n }", "public boolean canCastle(int direction){\n\t\tPiece rook;\n\t\t\n\t\tif(!((getColor().equals(\"White\") && getSquare().getCol() == 4 && getSquare().getRow() == 7 ) ||\n\t\t\t\t(getColor().equals(\"Black\") && getSquare().getCol() == 4 && getSquare().getRow() == 0 )))\n\t\t\treturn false;\n\t\t\n\t\t\n\t\tif(direction == 1){\n\t\t\trook = getSquare().getEast().getEast().getEast().getOccupant();\n\t\t\tif(rook == null || !rook.getColor().equals(this.getColor()) || !rook.getType().equals(\"Rook\") || rook.hasMoved() || this.hasMoved())\n\t\t\t\treturn false;\n\t\t\tif(getSquare().getEast().getEast().getOccupant() != null)\n\t\t\t\treturn false;\n\t\t\tif(getSquare().getEast().getOccupant() != null)\n\t\t\t\treturn false;\n\t\t\t\n\t\t\tif(getColor().equals(\"White\")){\n\t\t\t\tfor(int i = 0; i < ChessBoard.getPieces().size(); i++){\n\t\t\t\t\tif(ChessBoard.getPieces().get(i).getColor().equals(\"Black\"))\n\t\t\t\t\t\tfor(int location: ChessBoard.getPieces().get(i).getMoves()){\n\t\t\t\t\t\t\tif(location == 75 || location == 76){\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\tfor(int i = 0; i < ChessBoard.getPieces().size(); i++){\n\t\t\t\t\tif(ChessBoard.getPieces().get(i).getColor().equals(\"White\"))\n\t\t\t\t\t\tfor(int location: ChessBoard.getPieces().get(i).getMoves()){\n\t\t\t\t\t\t\tif(location == 5 || location == 6){\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t\t\n\t\telse if (direction == -1){//East\n\t\t\trook = getSquare().getWest().getWest().getWest().getWest().getOccupant();\n\t\t\tif(rook == null || !rook.getColor().equals(this.getColor()) || !rook.getType().equals(\"Rook\") || rook.hasMoved() || this.hasMoved())\n\t\t\t\treturn false;\n\t\t\tif(getSquare().getWest().getWest().getWest().getOccupant() != null)\n\t\t\t\treturn false;\n\t\t\tif(getSquare().getWest().getWest().getOccupant() != null)\n\t\t\t\treturn false;\n\t\t\tif(getSquare().getWest().getOccupant() != null)\n\t\t\t\treturn false;\n\t\t\t\n\t\t\tif(getColor().equals(\"White\")){\n\t\t\t\tfor(int i = 0; i < ChessBoard.getPieces().size(); i++){\n\t\t\t\t\tif(ChessBoard.getPieces().get(i).getColor().equals(\"Black\"))\n\t\t\t\t\t\tfor(int location: ChessBoard.getPieces().get(i).getMoves()){\n\t\t\t\t\t\t\tif(location == 73 || location == 72 || location == 71){\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\tfor(int i = 0; i < ChessBoard.getPieces().size(); i++){\n\t\t\t\t\tif(ChessBoard.getPieces().get(i).getColor().equals(\"White\"))\n\t\t\t\t\t\tfor(int location: ChessBoard.getPieces().get(i).getMoves()){\n\t\t\t\t\t\t\tif(location == 3 || location == 2 || location == 1){\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public boolean checkForWin(){\n\t\t\n\t\tPlayer p = Game.getCurrPlayer();\n\t\t// if player made it to win area, player won\n\t\tif(p.won()){\n\t\t\tGame.gameWon = true;\n\t\t\tthis.network.sendWin();\n\t\t\treturn true;\n\t\t}\n\t\t// if player is the last player on the board, player won\n\t\tif(numPlayers == 1 && !p.hasBeenKicked()){\n\t\t\tGame.gameWon = true;\n\t\t\tthis.network.sendWin();\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public abstract boolean isAllowableMovement(int[] location, double[] direction);", "public boolean canMove ()\n {\n return ((ActiveAdvancer)_advancer).canMove();\n }", "public boolean checkWithFragmentingWarheadRocketJump ()\n {\n Map<Square, List<Player>> squarePlayerListMap = checkRocketJump();\n List<Player> playerList;\n\n for (Square squareIterate : squarePlayerListMap.keySet())\n {\n\n for (Player playerIterate : squarePlayerListMap.get(squareIterate))\n {\n playerList = new ArrayList<>();\n\n playerList.addAll(playerIterate.getSquare().getPlayerList());\n playerList.remove(player);\n\n if (playerList.size()>1)\n return true;\n\n }\n }\n\n return false;\n }", "private void checkPlayerScoreboard(Player player) {\n\t\tScoreboard known = knownScoreboards.get(player);\n\t\t\n\t\tif (player.hasPermission(\"pandora.movement.nopush\")) {\n\t\t\tif (known == null || known != player.getScoreboard()) {\n\t\t\t\tknown = player.getScoreboard();\n\t\t\t\tknownScoreboards.put(player, known);\n\t\t\t\tsendFakeTeam(player);\n\t\t\t}\n\t\t} else {\n\t\t\tif (known != null) {\n\t\t\t\tdeleteFakeTeam(player);\n\t\t\t\tknownScoreboards.put(player, null);\n\t\t\t}\n\t\t}\n\t}", "public abstract boolean canMove();", "public boolean canTravelFromWorld(Player p, MultiverseWorld w) {\n List<String> blackList = w.getWorldBlacklist();\n \n boolean returnValue = true;\n \n for (String s : blackList) {\n if (s.equalsIgnoreCase(p.getWorld().getName())) {\n returnValue = false;\n break;\n }\n }\n \n return returnValue;\n }", "public boolean canRespawnHere() {\n\t\treturn false;\n\t}", "public boolean isPlayerWinner(int player)\n {\n return players[player] == 100;\n }", "public boolean isPlayerAlive() {\r\n\t\treturn !(this.getRobotsAlive().isEmpty());\r\n\t}", "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}", "private boolean checkInsideZone() {\n for (Zone z : shiftZones) {\n if (PolyUtil.containsLocation(userLocation, Arrays.asList(z.getCoords()), true)) {\n return true;\n }\n }\n return false;\n }", "boolean canMove(Tile t);", "public static boolean canJump(int[][] board, int player) {\r\n\t\t\r\n\t\tboolean ans = false;\r\n\t\tint [][]AlBJ = getAllBasicJumps(board,player);\r\n\t\t\r\n\t\tif (AlBJ.length>0){ans\t= true;}\r\n\t\treturn ans;\r\n\t}", "private boolean shouldAttackPlayer(EntityPlayer player) {\n ItemStack itemStack = player.inventory.armorInventory[3];\n if (itemStack != null && itemStack.getItem() == Item.getItemFromBlock(Blocks.pumpkin))\n return false;\n Vec3 lookVec = player.getLook(1.0F).normalize();\n Vec3 posVec = Vec3.createVectorHelper(this.posX - player.posX, this.boundingBox.minY + this.height / 2.0 - player.posY - player.getEyeHeight(), this.posZ - player.posZ);\n double distance = posVec.lengthVector();\n posVec = posVec.normalize();\n double dotProduct = lookVec.dotProduct(posVec);\n return dotProduct > 1.0 - 0.025 / distance ? player.canEntityBeSeen(this) : false;\n }", "public static boolean isValidMove(Player curr, int r, int c) {\n if (r < 0 || c < 0 || r >= board.length || c >= board[0].length)\n return false; //nobody can escape the dimensions of the board\n if (curr == null)\n return false;\n if (curr.isFlying()) //aircraft can fly over anything\n return true;\n if (curr.getName().startsWith(\"TRAIN\")) //trains can only run on tracks\n {\n if (board[r][c][panel].startsWith(\"T\")) //train tracks\n return true;\n return false;\n }\n\n if (board[r][c][panel].startsWith(\"#\")) //nobody can cross electric lines\n return false;\n if (Utilities.streetTraveler(curr)) //curr can only travel on streets\n { //street or crossroad\tor empty lot or bridge or rr x-ing AND\tno structure\n if (MapBuilder.isStreet(r, c, panel)) { //don't try to move into the monster\n if (r == players[PLAYER1].getRow() && c == players[PLAYER1].getCol())\n return false;\n return true;\n }\n return false;\n } else if (curr.getName().startsWith(\"CROWD\")) { //street, crossroad, empty lot, bridge, mud, sand or park or rr x-ing AND\tno structure\n if (MapBuilder.passableByCrowd(r, c, panel)) { //don't try to move into the monster\n if (r == players[PLAYER1].getRow() && c == players[PLAYER1].getCol())\n return false;\n return true;\n }\n return false;\n } else if (curr.getName().endsWith(\"tank\") || curr.getName().endsWith(\"flame\")) { //park, street, rubble or mud or rr x-ing\n if (MapBuilder.passableByTank(r, c, panel)) { //don't try to move into the monster\n if (r == players[PLAYER1].getRow() && c == players[PLAYER1].getCol())\n return false;\n return true;\n }\n return false;\n } else if (curr.getName().startsWith(\"BOAT\")) {\n if (board[r][c][panel].startsWith(\"~\"))\n return true;\n return false;\n }\n return true;\n }", "@Override\n public boolean canInteractWith(EntityPlayer player)\n {\n return teKeeper.isUsableByPlayer(player);\n }", "boolean isPlayerTurn();", "private boolean isWinner(byte player) {\n for (int row = 0; row <= 2; row++) {\n if (board[row][0] == player && board[row][1] == player && board[row][2] == player) {\n return true;\n }\n }\n for (int column = 0; column <= 2; column++) {\n if (board[0][column] == player && board[1][column] == player && board[2][column] == player) {\n return true;\n }\n }\n if (board[0][0] == player && board[1][1] == player && board[2][2] == player) {\n return true;\n } else if (board[0][2] == player && board[1][1] == player && board[2][0] == player) {\n return true;\n } else {\n return false;\n }\n }", "public boolean checkPlays(Player player){\n return true;\n }", "private static Boolean canStillReachEveryCrates(Cells[][] wallBoard, int column, int row)\n\t{\n\t\tif(playerPos.isEmpty())\n\t\t\treturn true;\n\n\t\tBoolean ret = true;\n\n\t\t_PF = new AStarPathFinder(wallBoard);\n\n\t\tfor(Point pos : playerPos)\n\t\t{\n\t\t\tret = (true && _PF.canFindAWay(pcolumn, prow, (int)pos.getX(), (int)pos.getY()));\n\t\t}\n\n\t\treturn ret;\n\t}", "public boolean isApplicable(BlockState state, Player player) {\n if (getRewardLimit() == 0) {\n debug(\"Group \" + this.getName() + \" was skipped because it has a reward limit of 0\");\n return false;\n }\n if (!isWorldAllowed(player.getWorld().getName())) {\n debug(\"Player was denied access to rewards in reward group because the reward group is not allowed in this world.\");\n return false;\n }\n WorldGuardManager wgm = cmr.getWGManager();\n if (wgm.usingWorldGuard() && !wgm.isAllowedInRegions(this, state.getBlock())) {\n debug(\"Player was denied access to rewards in reward group because the reward group is not allowed in this region.\");\n return false;\n }\n return true;\n }", "public boolean isWin(Player player, Point p, boolean test) {\n if (p.getX() == 0 && p.getY() == 0) {\n return false;\n }\n if (player == P1) {\n if (p.getY() >= 9) {\n return true;\n }\n return false;\n }\n else {\n if (p.getY() <= 1) {\n return true;\n }\n return false;\n }\n }", "public boolean towersBlocksOpponents(Player playr, int from, int diceNr) {\n\n int tPos;\n int pos = userGridToLudoBoardGrid(playr.getColour(), from);\n for (Player player : players) { //Goes through all other players\n for (Piece piece : player.pieces) {//Checks the relevant pieces\n if (player != playr && player.getName() != null &&\n piece.position != 0 && piece.towerPos != -1) {\n // If the piece is in a tower\n tPos = userGridToLudoBoardGrid(player.getColour(), piece.position);\n for (int i = pos; i <= pos + diceNr; i++) { //Checks all fields the piece would have to move\n if (tPos == i) { //Returns if a tower blocks the move\n return true;\n }\n }\n }\n }\n }\n return false;\n }", "public static boolean canSomebodyCapture(ItalianBoard board, Player player) {\n for (int i = 0; i < Board.DIMENSION_ITALIAN_BOARD; i++) {\n for (int j = 0; j < Board.DIMENSION_ITALIAN_BOARD; j++) {\n if (PlaceType.confrontPlayer(board.getBoard()[i][j].getPlace(), player) && board.getBoard()[i][j].getPlace() != PlaceType.EMPTY && canCapture(board, i, j))\n return true;\n }\n }\n return false;\n }", "public boolean isWin_LordVetinari(){\r\n // player got lordVetinari card\r\n Player playerHoldCard = null;\r\n for(Player player : discWorld.getPlayer_HASH().values()){\r\n if(player.getPersonalityCardID() == 1){\r\n playerHoldCard = player;\r\n break;\r\n }\r\n }\r\n \r\n if (playerHoldCard != null) {\r\n int numPlayers = discWorld.getPlayer_HASH().size();\r\n\r\n Set<Integer> areaList = new HashSet<Integer>();\r\n for (Integer minionID : playerHoldCard.getMinionList()) {\r\n int minion_ID = minionID;\r\n MinionPiece minion = discWorld.getMinionPiece_HASH().get(minion_ID);\r\n if (minion.getAreaNumber() != ConstantField.DEFAULT_UNDEFINED_PLAYID) {\r\n int areaID = minion.getAreaNumber();\r\n Area area = discWorld.getArea_HASH().get(areaID);\r\n // make sure free of demon\r\n if (area.getDemonList().size() == 0) {\r\n areaList.add(minion.getAreaNumber());\r\n }\r\n }\r\n\r\n }\r\n\r\n if (numPlayers == 2) {\r\n\r\n if (areaList.size() >= 11) {\r\n return true;\r\n }\r\n\r\n } else if (numPlayers == 3) {\r\n\r\n if (areaList.size() >= 10) {\r\n return true;\r\n }\r\n\r\n } else if (numPlayers == 4) {\r\n\r\n if (areaList.size() >= 9) {\r\n return true;\r\n }\r\n\r\n }\r\n }\r\n\r\n return false;\r\n }", "@Override\n\tpublic boolean isUseableByPlayer(EntityPlayer player){\n\t return worldObj.getTileEntity(xCoord, yCoord, zCoord) != this ? false : player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <= 64.0D;\n\t}", "public boolean isPlayerAllowedToUseThisHere(Player player, Location location, Material material)\n \t{\n \t\treturn FactionsPlayerListener.playerCanUseItemHere(player, location, material, true);\n \t}", "private boolean checkWin(Integer playerMove, Location loc)\n\t{\n\t\tboolean isWinAcross = true, isWinDown = true, isWinDiag1 = true, isWinDiag2 = true;\n\t\tfor (int col = 0; col < super.getRows() && isWinAcross; col++) //ends loop after isWinAcross is true\n\t\t\tif (grid[loc.getRow()][col] == null || !grid[loc.getRow()][col].equals(playerMove))\n\t\t\t\tisWinAcross = false;\n\t\tfor (int row = 0; row < super.getCols() && isWinDown; row++) //ends loop after isWinDown is true\n\t\t\tif (grid[row][loc.getCol()] == null || !grid[row][loc.getCol()].equals(playerMove))\n\t\t\t\tisWinDown = false;\n\t\tfor (int diagonal = 0; diagonal < super.getCols() && isWinDiag1; diagonal++) //ends loop after isWinDiag1 is true\n\t\t\tif (grid[diagonal][diagonal] == null || !grid[diagonal][diagonal].equals(playerMove))\n\t\t\t\tisWinDiag1 = false;\n\t\tfor (int diagonal2 = 0; diagonal2 < super.getCols() && isWinDiag2; diagonal2++) //ends loop after isWinDiag2 is true\n\t\t\tif (grid[getCols() - diagonal2 - 1][diagonal2] == null || !grid[getCols() - diagonal2 - 1][diagonal2].equals(playerMove))\n\t\t\t\tisWinDiag2 = false;\n\t\treturn isWinAcross || isWinDown || isWinDiag1 || isWinDiag2;\n\t}", "private boolean canMove(String direction) {\n\t\tif (currentPiece.getLocation() == null) {\n\t\t\treturn false;\n\t\t}\n\n\t\tfor (Loc loc : currentPiece.getLocation()) {\n\t\t\tLoc nextPoint = nextPoint(loc, direction);\n\t\t\tif (nextPoint == null) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// if there's someone else's piece blocking you\n\t\t\tif ((new Loc(nextPoint.row, nextPoint.col).isOnBoard())\n\t\t\t\t\t&& boardTiles[nextPoint.row][nextPoint.col] != backgroundColor && !isMyPiece(nextPoint)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "public static boolean validLocation(AbstractCard c) {\n return AbstractDungeon.player.hand.contains(c) ||\n AbstractDungeon.player.drawPile.contains(c) ||\n AbstractDungeon.player.discardPile.contains(c) ||\n AbstractDungeon.player.exhaustPile.contains(c);\n }", "public boolean canRespawnHere()\n {\n return false;\n }", "public boolean canPlaceRoad(Player p, Edge e){\r\n for(Corner c: e.getConnectingCorners()){\r\n if(c.getOwner()==p) return true;\r\n }\r\n return false;\r\n }", "public boolean vulnerableToPlayerRangedAttack(Player aPlayer)\n\t{\n\t\t//System.out.println(\"Tree.vulnerableToPlayerRangedAttack(\" + aPlayer + \")\");\n\t\treturn false;\n\t}", "@Override\r\n public boolean canMove() {\r\n Grid<Actor> gr = getGrid();\r\n int dirs[] = {\r\n Location.AHEAD, Location.HALF_CIRCLE, Location.LEFT,\r\n Location.RIGHT };\r\n // 当终点在周围时,不能移动且isEnd应当为true\r\n for (int i = 0; i < dirs.length; i++) {\r\n Location tarLoc = getLocation().getAdjacentLocation(dirs[i]);\r\n if (gr.isValid(tarLoc) && gr.get(tarLoc) != null) {\r\n // Color直接用==计算竟然不可行(真是哔了dog...\r\n if (gr.get(tarLoc) instanceof Rock\r\n && gr.get(tarLoc).getColor().equals(Color.RED)) {\r\n isEnd = true;\r\n return false;\r\n }\r\n }\r\n }\r\n ArrayList<Location> nextLocs = getValid(getLocation());\r\n // 当附近没有可以移动的位置时,不能移动\r\n if (nextLocs.size() == 0) {\r\n return false;\r\n }\r\n // 当可以移动的位置>1时,说明存在一个节点,这个节点应当被新建一个arraylist入栈\r\n if (nextLocs.size() > 1) {\r\n ArrayList<Location> newStackElem = new ArrayList<Location>();\r\n newStackElem.add(getLocation());\r\n crossLocation.push(newStackElem);\r\n }\r\n // 有可以移动的位置时,向概率最高的方向移动\r\n int maxProbLoc = 0;\r\n // 由于nextLocs不一定有4个location,所以只好循环判断取最大值\r\n for (int i = 0; i < nextLocs.size(); i++) {\r\n Location loc = nextLocs.get(i);\r\n int dirNum = getLocation().getDirectionToward(loc) / 90;\r\n if (probablyDir[dirNum] > probablyDir[maxProbLoc]) {\r\n maxProbLoc = i;\r\n }\r\n }\r\n next = nextLocs.get(maxProbLoc);\r\n return true;\r\n }", "public boolean isPlayerInRoom() {\n return !(roomPlayer == null);\n }", "public boolean canMove() {\n\n if (workers.size() == 0) return true;\n\n return workerCanMove(0) || workerCanMove(1);\n }", "private boolean hasMovements(Color playerColor){\r\n for(Point pos : getPieces(playerColor)){\r\n if(canMove(pos) || canEats(pos)) return true;\r\n }\r\n return false;\r\n }", "public boolean isPlayerInThisGame(Player player) {\n return player.equals(getRedPlayer()) || player.equals(getWhitePlayer());\n }", "private boolean playerDetection() {\n\t\tAxisAlignedBB axisalignedbb = new AxisAlignedBB(posX, posY, posZ, posX + 1, posY + 1, posZ + 1).grow(DETECTION_RANGE);\n\t\tList<EntityPlayer> list = world.getEntitiesWithinAABB(EntityPlayer.class, axisalignedbb);\n\n\t\treturn !list.isEmpty();\n\t}" ]
[ "0.6784996", "0.66966975", "0.6610399", "0.66079587", "0.6577588", "0.6554382", "0.65305436", "0.6418675", "0.64179105", "0.638676", "0.63809043", "0.6364759", "0.63444173", "0.63130474", "0.63128734", "0.6305462", "0.6240213", "0.6237142", "0.6231426", "0.6199423", "0.61882794", "0.61772805", "0.6176191", "0.61697793", "0.61524713", "0.6148304", "0.61275244", "0.61194915", "0.6118879", "0.6108605", "0.6086943", "0.608011", "0.60797703", "0.6067521", "0.60588443", "0.6042367", "0.60378927", "0.6031253", "0.602584", "0.6011976", "0.60089844", "0.6000388", "0.5996778", "0.59755874", "0.5965812", "0.5965628", "0.5960588", "0.59546304", "0.59522676", "0.5949683", "0.5932927", "0.5930616", "0.59236526", "0.5918263", "0.5911996", "0.5911487", "0.5908881", "0.59035844", "0.5903104", "0.58989644", "0.58927053", "0.5888627", "0.58853185", "0.58811015", "0.5880868", "0.5879605", "0.58764946", "0.58606684", "0.58532286", "0.585073", "0.5847584", "0.5845151", "0.58450717", "0.58348", "0.58272284", "0.5813434", "0.5797038", "0.5795527", "0.57948", "0.57927114", "0.5792208", "0.5791342", "0.57908136", "0.57798725", "0.5770489", "0.57689226", "0.5767738", "0.57670724", "0.5765746", "0.57533365", "0.5752237", "0.5750476", "0.5748257", "0.5747369", "0.5738165", "0.57354045", "0.5732989", "0.5727451", "0.5723913", "0.5720394" ]
0.7187453
0
This method plays the soldier card to the specified player at the specified hex
void playSoldierCard(int victimIndex, HexLocation location);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void playCard(int player, int card) {\n }", "@Override\r\n\tpublic void playSoldierCard() {\n\t\t\r\n\t}", "public void playCard(IPlayer owner){\n // Wont play card unless a player has it\n if(command == \"Move1\"){\n owner.Move(owner.getPlayerDir());\n }\n else if(command == \"Move2\"){\n for (Integer i=0; i < 2; i++) {\n owner.Move(owner.getPlayerDir());\n }\n }\n else if(command == \"Move3\"){\n for (Integer i=0; i < 3; i++) {\n owner.Move(owner.getPlayerDir());\n }\n }\n else if (command == \"MoveBack\"){\n owner.Move(dirCtrl.invertDirection(owner.getPlayerDir()));\n }\n else if(command == \"TurnRight\"){\n owner.Turn(TurnDirection.RIGHT);\n }\n else if(command == \"TurnLeft\"){\n owner.Turn(TurnDirection.LEFT);\n }\n else if(command == \"Turn180\"){\n owner.Turn(TurnDirection.BACKWARDS);\n }\n }", "void fireShellAtOpponent(int playerNr);", "public void playCard(ActionCard card, Integer selectedPlayer)\n {\n System.out.println(\"gui: playCard: \" + card + \", selected: \" + selectedPlayer);\n // Guard against this\n if (!isTurn || this.played)\n {\n return;\n }\n \n if(card instanceof PrivateTip || card instanceof Snoop) \n {\n if(selectedPlayer == null) \n {\n JOptionPane.showMessageDialog(null, \"Please select \"\n + \"a player in the \"\n + \"Player Listing (Upper right) that is not yourself!\", \n \"Warning\", \n JOptionPane.ERROR_MESSAGE); \n return;\n }\n }\n\n if (card instanceof Suggestion)\n {\n this.played = true;\n // prompt for solution\n suggestionScreen = new AccusationScreen(this, true, (Suggestion)card);\n suggestionScreen.setVisible(true);\n }\n else\n {\n this.played = clientController.playActionCard(card, selectedPlayer);\n if(!this.played)\n {\n mainGameScreen.notifyUser(\"Play failed: To Play this card,\"\n + \" please select a CluePlayer from the 'Players' list,\"\n + \" then click on this card.\");\n }\n }\n\n }", "@Override\n public void playOneRound (Player player) {\n this.executeActions(this.actionChoosed(player), player);\n }", "private void playOneTurnWithPlayer(Player player, RolledDice rolledDice) throws NotEnoughMoneyException {\n int position = player.increasePosition(rolledDice.getValue() - 1, fields.size());\n Field field = fields.get(position);\n field.playerStepped(player);\n //System.out.println(player);\n }", "public static void cardsPlayer(int player){\n System.out.println(\"Player has cards as below\");\n for(int i=0;i<player;i++){\n System.out.println(\"the player has cards\"+i);\n shuffleCards(arrayList,player);\n }\n }", "private void playTurn(Player player) {\n\n System.out.println(player.toString() + \"'s turn\");\n\n if (!player.getOccupiedSet().isEmpty())\n while(true) {\n Movement move = player.getMove();\n if (validMove(player, move)) {\n move(player, move);\n break;\n }\n }\n }", "public void stand(Player player) {\n int playerHandValue = player.getHand().getDeckValue();\n while (dealerHand.getDeckValue() < 17 && dealerHand.getDeckValue() <= playerHandValue) {\n dealerHand.drawCard();\n }\n }", "public abstract CardAction play(Player p);", "void makePlay(int player) {\n }", "public void playChip(int col, Player player) {\n\t\t// ********************\n\t\t// Aufgabe a)\n\t\t// Klasse muss selber verwalten, wer gerade am Zug war \n\t\tint inputRow = fields.length - fillState[col] - 1;\n\t\t\n\t\tfields[inputRow][col] = first_player ? 1:2;\n\t\t\n\t\tfirst_player = !first_player;\n\t\t\n\t\tfillState[col]++;\n\t\t\n\t\t// ********************\n\t}", "void fireShellAtPlayer(int playerNr, int x, int y);", "private void manualCommand(String player) {\n try {\n Piece s = Piece.playerValueOf(player);\n _playing = false;\n _players[s.ordinal()] = new HumanPlayer(s, this);\n } catch (IllegalArgumentException excp) {\n error(\"unknown player: %s\", player);\n System.out.println();\n }\n }", "public void playOne(VirtualPet player) {\n\t\tplayer.playPet();\n\t}", "private void playCard(int slotId) {\n boolean isSlotEmpty = Comm.get().gameLogic.getEngine().getSystem(MinionSystem.class).isSlotEmpty(slotId);\n if(!isSlotEmpty) return;\n\n //play it\n CardComponent cc = ccMapper.get(draggingEntity);\n PlayCard playCard = Comm.get().getCommand(PlayCard.class);\n playCard.targetSlot = slotId; // the slot we want to put this minion on\n playCard.targetPlayer = Comm.get().gameLogic.uniqueUserId; // todo: make this possible to target other player too\n playCard.targetType = 0; //todo: targeting minion, but make it possible to target hero as well.\n playCard.setCardComponent(cc);\n Comm.get().executeCommand(playCard);\n\n // do some fake hiding animation, which will come back if anything\n TransformComponent tc = draggingEntity.getComponent(TransformComponent.class);\n tc.initActorIfNotInited();\n tc.addAction(Actions.sequence(\n Actions.fadeOut(0.3f),\n Actions.delay(1.5f),\n Actions.fadeIn(0.1f)\n ));\n tc.tint.a = 0;\n }", "public void attack(int x, int y, int xx, int yy) {\n int result = ((MovablePiece)(controller.getBoard().getPiece(x, y))).attack(controller.getBoard().getPiece(xx,yy));\n int player;\n \n if(result < 4) {\n mc.playMusic(\"sounds\\\\Bomb.wav\");\n }\n \n if(result == 1) {\n controller.getPlayer(controller.getTurn()).getMyGraveyard().setPiece(controller.getBoard().getPiece(xx, yy));\n controller.getBoard().setPiece(controller.getBoard().getPiece(x, y), xx, yy);\n controller.getBoard().deletePiece(x, y);\n Cell[xx][yy].setIcon(new ImageIcon(\"pieces\\\\\" + this.getName()));\n } else if(result == 2) {\n controller.getPlayer(controller.getTurn()).getMyGraveyard().setPiece(controller.getBoard().getPiece(xx, yy));\n controller.getPlayer(prevTurn).getMyGraveyard().setPiece(controller.getBoard().getPiece(x, y));\n controller.getBoard().deletePiece(xx,yy);\n controller.getBoard().deletePiece(x, y);\n Cell[xx][yy].setIcon(null);\n Cell[xx][yy].setBackground(Color.white);\n } else if(result == 3){\n controller.getPlayer(prevTurn).getMyGraveyard().setPiece(controller.getBoard().getPiece(x, y));\n controller.getBoard().deletePiece(x, y);\n } else if(result == 5) {\n mc.playMusic(\"sounds\\\\Sorceress.wav\");\n try {\n Thread.sleep(4000);\n } catch (InterruptedException ex) {\n Logger.getLogger(Graphics.class.getName()).log(Level.SEVERE, null, ex);\n }\n piece = controller.getBoard().getTable()[xx][yy];\n if(piece.getLevel()< controller.getBoard().getPiece(x, y).getLevel() && piece.getLevel() != 0 ) {\n if(piece.getColour() == 'R') {\n piece.setColour('B');\n piece.setName(piece.getName().replace(\"R\", \"B\"));\n } else {\n piece.setColour('R');\n piece.setName(piece.getName().replace(\"B\", \"R\"));\n }\n piece.setIcon(piece.getName());\n }\n } else {\n /* NOTHING IS CHARGED */\n }\n Cell[x][y].setIcon(null);\n Cell[x][y].setBackground(Color.white);\n for(int i = 0; i < 12; i++) {\n RGrave[i].setToolTipText(controller.getPlayer(2).getMyGraveyard().getQuantity(i) + \"/\" + (new Collection('R')).getQuantity(i));\n BGrave[i].setToolTipText(controller.getPlayer(1).getMyGraveyard().getQuantity(i) + \"/\" + (new Collection('B')).getQuantity(i));\n }\n }", "public void setToPlayer(Player player)\n \t{\n \t\t// Define the inventory\n \t\tPlayerInventory inventory = player.getInventory();\n \n \t\t// Clear it all first\n \t\tinventory.clear();\n \t\tinventory.setHelmet(new ItemStack(Material.AIR));\n \t\tinventory.setChestplate(new ItemStack(Material.AIR));\n \t\tinventory.setLeggings(new ItemStack(Material.AIR));\n \t\tinventory.setBoots(new ItemStack(Material.AIR));\n \n \t\t// Set the armor contents\n \t\tif(this.helmet != null) inventory.setHelmet(this.helmet.toItemStack());\n \t\tif(this.chestplate != null) inventory.setChestplate(this.chestplate.toItemStack());\n \t\tif(this.leggings != null) inventory.setLeggings(this.leggings.toItemStack());\n \t\tif(this.boots != null) inventory.setBoots(this.boots.toItemStack());\n \n \t\t// Set items\n \t\tfor(int i = 0; i < 35; i++)\n \t\t{\n\t\t\tinventory.setItem(i, this.items[i].toItemStack());\n \t\t}\n \n \t\t// Delete\n \t\tDemigodsData.jOhm.delete(PlayerCharacterInventory.class, id);\n \t}", "@Override\r\n\tpublic void playCard() {\n\t\t\r\n\t}", "private void autoCommand(String player) {\n try {\n Piece s = Piece.playerValueOf(player);\n _playing = false;\n _players[s.ordinal()] = new MachinePlayer(s, this);\n } catch (IllegalArgumentException excp) {\n error(\"unknown player: %s\", player);\n System.out.println();\n }\n }", "@Override\r\n public void dealCardToPlayer(int dealerDeckPosition, int player, \r\n int plDeckPosition) {\r\n // Get the card from the dealer\r\n Card card = this.dealer.getCard(dealerDeckPosition);\r\n \r\n // Give the card to the player\r\n this.players.get(player).addCard(plDeckPosition, card);\r\n }", "@Override\n\tpublic void playCard() {\n\t\t\n\t}", "public void act(Player player) {\n int roleIndex = -1;\n for (int i = 0; i < roles.size(); i++) {\n if (roles.get(i).getPlayer() == player) {\n roleIndex = i;\n break;\n }\n }\n boolean isOnCard = false;\n List<Role> onCardRoles = scene.getRoles();\n if (roleIndex == -1) {\n isOnCard = true;\n for (int i = 0; i < onCardRoles.size(); i++) {\n if (onCardRoles.get(i).getPlayer() == player) {\n roleIndex = i;\n break;\n }\n }\n }\n\n int diceRoll = random.nextInt(6) + 1;\n\n if (isOnCard) {\n if (diceRoll + player.getPracticeChips() >= scene.getBudget()) {\n shotsLeft--;\n System.out.println(\"Success! You completed the shot and got two credits.\");\n player.addCredits(2);\n } else {\n System.out.println(\"Oh no! You messed up the shot and got nothing.\");\n }\n } else {\n Deadwood.bank.payMoney(player, 1);\n if (diceRoll + player.getPracticeChips() >= scene.getBudget()) {\n shotsLeft--;\n System.out.println(\"Success! You completed the shot and got a credit and $1.\");\n player.addCredits(1);\n } else {\n System.out.println(\"Oh no! You messed up the shot. You still get $1.\");\n }\n }\n\n if (shotsLeft == 0)\n wrap();\n }", "@Override\r\n public void giveCardToPlayer(Card card, int player, int plDeckPosition) {\r\n this.players.get(player).addCard(plDeckPosition, card);\r\n }", "public static void handleDisruptionShield(Player player) {\n\t\t\n\t}", "public void playPiece(Player player, Move move) {\n // if whos turn it is does not equal the player to make a move...\n if(!validMove(player, move)) {\n throw new IllegalArgumentException(\"DON'T CHEAT! That is an invalid move for this turn. \");\n }\n board.placePiece(turn.getPiece(), move.getRow(), move.getCol());\n lastMove = move;\n hasPlacedPiece = true;\n hasRotatedBoard = false;\n }", "public void DisplayWithShield() {\n\t\tplayers = new ArrayList<Player>();\n\t\tplayer1 = new Player(\"Nick\");\n\t\tplayer2 = new Player(\"Ausitn\");\n\t\tplayers.add(player1);\n\t\tplayers.add(player2);\n\t\tgame = new GameState();\n\t\tgame.initializeServer(players);\n\t\tRulesEngine.setColour(game, String.valueOf(Type.BLUE));\n\t\t\n\t\tgame.setTurn(0);\n\t\t\n\t\t\n\t\t//create cards to be added to player's hand and target's display\n\t\tCard purpleCard = new Card(Type.PURPLE, 3);\n\t\tCard greenCard = new Card(Type.GREEN, 1);\n\t\tCard yellowCard = new Card(Type.YELLOW, 2);\n\t\tCard blueCard = new Card(Type.BLUE, 3);\n\t\tCard redCard = new Card(Type.RED, 4);\n\t\tCard squire = new Card(Type.WHITE, 2);\n\t\tCard maiden = new Card (Type.WHITE, 6);\n\t\tCard shield = new Card(Type.ACTION, Card.SHIELD);\n\t\t\n\t\t//Give one of the players a riposte card to play\n\t\tCard riposte = new Card(Type.ACTION, Card.RIPOSTE);\n\t\tgame.getAllPlayers().get(0).getHand().add(riposte);\n\t\t\n\t\t//Give target player a custom display\n\t\tgame.getDisplay(1).add(redCard);\n\t\tgame.getDisplay(1).add(purpleCard);\n\t\tgame.getDisplay(1).add(blueCard);\n\t\tgame.getDisplay(1).add(greenCard);\n\t\tgame.getDisplay(1).add(squire);\n\t\tgame.getDisplay(1).add(yellowCard);\n\t\tgame.getDisplay(1).add(maiden);\n\t\tgame.getShield(1).add(shield); //give player a shield\n\t}", "public void presentPlayer( CoinFlipper theHandle, String theName );", "public void play() {\n Player playerOne = preparePlayer(getUserName(scanner, validator, shipsGameText.getMessage(\"show.player.one\"), null));\n Player currentPlayer = playerOne;\n ShipsGameBoard playerOneGameBoard = new ShipsGameBoard(playerOne, playerOneFleet);\n ShipsGameBoard playerOneCheckBoard = new ShipsGameBoard(playerOne, playerOneFleetToCheck);\n playerOneCheckBoard.setup();\n\n TreeMap<Character, Integer> lettersAndDigits = lettersAndDigits(playerOneGameBoard.getLength());\n ShipCreator threeMastShipCreatorPlayerOne = new ShipCreator(THREE_MASTS_SHIP,\n null,\n playerOne,\n ShipGameBoardMark.THREE_MASTS,\n playerOneGameBoard,\n playerOneShipsGameLogic);\n\n playerOneGameBoard.print();\n shipsDeployment(playerOneGameBoard,\n lettersAndDigits,\n threeMastShipCreatorPlayerOne,\n playerOneShipsGameLogic,\n playerOneFleet,\n NUMBER_OF_SHIPS);\n\n// playerOneShipsGameLogic.clearConsole();\n\n Player playerTwo = preparePlayer(getUserName(scanner, validator, shipsGameText.getMessage(\"show.player.two\"), playerOne.getName()));\n ShipsGameBoard playerTwoGameBoard = new ShipsGameBoard(playerTwo, playerTwoFleet);\n ShipsGameBoard playerTwoCheckBoard = new ShipsGameBoard(playerTwo, playerTwoFleetToCheck);\n playerTwoCheckBoard.setup();\n\n ShipCreator threeMastShipCreatorPlayerTwo = new ShipCreator(THREE_MASTS_SHIP,\n null,\n playerTwo,\n ShipGameBoardMark.THREE_MASTS,\n playerTwoGameBoard,\n playerTwoShipsGameLogic);\n\n playerTwoGameBoard.print();\n shipsDeployment(playerTwoGameBoard,\n lettersAndDigits,\n threeMastShipCreatorPlayerTwo,\n playerTwoShipsGameLogic,\n playerTwoFleet,\n NUMBER_OF_SHIPS);\n\n\n boolean isAWinner = false;\n do {\n int userRow;\n int userCol;\n// playerOneGameBoard.clearConsole();\n showCurrentPlayerBoards(playerOne, currentPlayer, playerOneGameBoard, playerTwoGameBoard, playerOneCheckBoard,\n playerTwoCheckBoard, shipsGameText);\n System.out.println(shipsGameText.getMessage(\"show.witch.player.move\", currentPlayer.getName()));\n\n System.out.println(shipsGameText.getMessage(\"show.input.row\", Integer.toString(playerOneGameBoard.getLength())));\n userRow = getPlayerRowChoice(scanner, validator, playerOneGameBoard.getLength());\n\n System.out.println(shipsGameText.getMessage(\"show.input.col\",\n Character.toString(playerOneGameBoard.generateLastLetterOfColumn('A', playerOneGameBoard.getLength()))));\n userCol = convertLetterToDigit(lettersAndDigits, getPlayerColChoice(scanner, validator,\n lettersAndDigits));\n\n if (currentPlayer.equals(playerOne)) {\n if (playerTwoShipsGameLogic.checkForHit(userRow, userCol)) {\n playerOneShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n playerTwoShipsGameLogic.changeMastStatus(userRow, userCol, playerTwo, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n if (playerTwoShipsGameLogic.checkShipForStatusChange(userRow, userCol)) {\n playerTwoShipsGameLogic.changeShipStatusToSunk(userRow, userCol, playerTwo);\n playerOneShipsGameLogicToCheck.changeShipStatusToSinkOnCheckBoard(playerTwoFleet, playerOne);\n System.out.println(shipsGameText.getMessage(\"show.player.sunk.ship\"));\n System.out.println(shipsGameText.getMessage(\"show.player.checkboard\", currentPlayer.getName()));\n playerOneCheckBoard.print();\n System.out.println(shipsGameText.getMessage(\"show.player.gameboard\", playerTwo.getName()));\n playerTwoGameBoard.print();\n } else {\n System.out.println(shipsGameText.getMessage(\"show.player.hit.ship\", playerOne.getName()));\n }\n } else {\n System.out.println(shipsGameText.getMessage(\"show.player.miss\"));\n playerOneShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.MISS);\n playerTwoShipsGameLogic.changeMastStatus(userRow, userCol, playerTwo, ShipGameBoardMark.MISS);\n }\n\n// if (playerTwoShipsGameLogic.checkShipForStatusChange(userRow, userCol)) {\n// playerTwoShipsGameLogic.changeShipStatusToSunk(userRow, userCol, playerTwo);\n// playerOneShipsGameLogicToCheck.changeShipStatusToSinkOnCheckBoard(playerTwoFleet, playerOne);\n// System.out.println(shipsGameText.getMessage(\"show.player.sunk.ship\"));\n// System.out.println(shipsGameText.getMessage(\"show.player.checkboard\", currentPlayer.getName()));\n// playerOneCheckBoard.print();\n// System.out.println(shipsGameText.getMessage(\"show.player.gameboard\", playerTwo.getName()));\n// playerTwoGameBoard.print();\n// }\n\n\n if (playerTwoShipsGameLogic.isPlayerLoose()) {\n System.out.println(shipsGameText.getMessage(\"show.player.win\", playerOne.getName()));\n isAWinner = true;\n }\n\n } else {\n if (playerOneShipsGameLogic.checkForHit(userRow, userCol)) {\n playerTwoShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerTwo, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n playerOneShipsGameLogic.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n if (playerOneShipsGameLogic.checkShipForStatusChange(userRow, userCol)) {\n playerOneShipsGameLogic.changeShipStatusToSunk(userRow, userCol, playerOne);\n playerTwoShipsGameLogicToCheck.changeShipStatusToSinkOnCheckBoard(playerOneFleet, playerTwo);\n System.out.println(shipsGameText.getMessage(\"show.player.sunk.ship\"));\n System.out.println(shipsGameText.getMessage(\"show.player.checkboard\", currentPlayer.getName()));\n playerTwoCheckBoard.print();\n System.out.println(shipsGameText.getMessage(\"show.player.gameboard\", playerOne.getName()));\n playerOneGameBoard.print();\n }\n else {\n System.out.println(shipsGameText.getMessage(\"show.player.hit.ship\", playerOne.getName()));\n }\n } else {\n playerTwoShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerOne,\n ShipGameBoardMark.MISS);\n playerOneShipsGameLogic.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.MISS);\n System.out.println(shipsGameText.getMessage(\"show.player.miss\"));\n }\n if (playerOneShipsGameLogic.isPlayerLoose()) {\n System.out.println(shipsGameText.getMessage(\"show.player.win\", playerTwo.getName()));\n isAWinner = true;\n }\n }\n\n currentPlayer = swapPlayers(playerOne, currentPlayer, playerTwo);\n }\n while (!isAWinner);\n }", "public static void handleDream(Player player) {\n\t\t\n\t}", "public void printPermitCards(Player player);", "public void setPlayer(String player) {\r\n this.player = player;\r\n }", "@Override\n public void playSoldier(HexLocation hex, int victimIndex) throws ModelException {\n assert hex != null;\n\n if (!GameModelFacade.instance().canPlaySoldier(hex)) {\n throw new ModelException(\"Preconditions for action not met.\");\n }\n\n try {\n String clientModel = m_theProxy.playSoldier(GameModelFacade.instance().getLocalPlayer().getIndex(), hex, victimIndex);\n new ModelInitializer().initializeClientModel(clientModel, m_theProxy.getPlayerId());\n } catch (NetworkException e) {\n throw new ModelException(e);\n }\n }", "private void transferCards(Player player) {\r\n\t\twhile(warPile.size() > 0) {\r\n\t\t\tplayer.addToWinningsPile(warPile.remove(0));\r\n\t\t}\r\n\t}", "private void performHarvest(Player player, InformationCallback informationCallback){\n for (DevelopmentCard card : this.players.get(player.getUsername()).getPersonalBoard().getCards(DevelopmentCardColor.GREEN)) {\n card.getPermanentEffect().runEffect(player, informationCallback);\n }\n }", "public void drawCard(int player) {\r\n\t\tCard topCard = drawPile.cards.get(0);\r\n\t\tplayers.get(player).addCard(topCard);\r\n\t\tdrawPile.removeCard(topCard);\r\n\t}", "public Player switchPlayer(){\n Player player = getGame().getCurrentPlayer();\n\n List<Card> cards = new ArrayList<>();\n\n for(Card card: getGame().getCards()){\n if(card.rule.isValid(getGame().getDices())){\n cards.add(card);\n }\n }\n\n //get the best card\n if(!cards.isEmpty()){\n Card card = takeTheBestCard(cards);\n\n //add it to the player\n player.getCardsWon().add(card);\n getGame().getCards().remove(card);\n\n System.out.println(player.getName() + \" won \" + card.getExplaination());\n getGame().addAction(new Action(player.getName() + \" won \" + card.getExplaination()));\n }\n\n if(getGame().getCards().isEmpty()){\n game.setStatus(Game.GameStatus.COMPLETED);\n getGame().addAction(new Action(bestPlayer().getName() + \" WON THE GAME!!!\"));\n }\n //turn\n getGame().setCountOfTrialForPlayer(0);\n\n game.setIndexOfCurrentPlayer(game.getIndexOfCurrentPlayer()+1);\n\n if(game.getIndexOfCurrentPlayer() == getGame().getPlayers().size()){\n game.setIndexOfCurrentPlayer(0);\n }\n\n game.setCountOfTrialForPlayer(0);\n game.setDices(new ArrayList<>());\n\n return getGame().getCurrentPlayer();\n }", "public void execute(Player player, ArrayList<Player> players, Game game) {\n Card card = player.getHand().get(0);\n if (card instanceof Copper) {\n //game.getSupply().getCardList().get(4).drawCard();\n }\n if (card instanceof Silver) {\n //game.getSupply().getCardList().get(5).drawCard();\n }\n\n player.getHand().remove(card);\n player.setBuyingPower();\n }", "public void playRound(CuarentaGame game){\n Player human = game.getHumanPlayer();\n Player computer = game.getComputerPlayer();\n Player activePlayer;\n \n for(int i=0; i<10; i++){\n // For now, human player starts always. This isn't quite intended, but not important right now\n if(i%2==0)\n activePlayer = human;\n else\n activePlayer = computer;\n // choose a card to play\n \n // choose next actions\n \n // add points accordingly\n\n // check win condition\n\n }\n\n human.addPoints(calculatePointsFromDiscardPile(game.getHumanPlayer()));\n computer.addPoints(calculatePointsFromDiscardPile(game.getComputerPlayer()));\n }", "private void specialPowersPhase() {\n \tSpecialCharacter tmpPiece = null;\n \tTerrain theHex = null;\n\n for (Player p : playerList) {\n pause();\n this.player = p;\n player.flipAllUp();\n ClickObserver.getInstance().setActivePlayer(this.player);\n \n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n Game.getRackGui().setOwner(player);\n }\n });\n /*\n * Loops through all of the hexes that the player has pieces on.\n * If one of the pieces is either Master Thief or Assassin Primus, perform their\n * special ability.\n */\n for (Terrain hex : player.getHexesWithPiece()) {\n for (Piece pc : hex.getContents(player.getName()).getStack()) {\n if (pc.getName().equals(\"Master Thief\") || pc.getName().equals(\"Assassin Primus\")) { \n ((Performable)pc).specialAbility();\n if (MasterThief.isReturnPiece() || AssassinPrimus.isReturnPiece()) {\n \ttmpPiece = (SpecialCharacter)pc;\n \ttheHex = hex;\n \ttmpPiece.returnToBank(theHex);\n \tbreak;\n }\n }\n }\n }\n player.flipAllDown();\n }\n ClickObserver.getInstance().setPlayerFlag(\"\");\n\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n DiceGUI.getInstance().setFaceValue(0);\n DiceGUI.getInstance().cover();\n }\n });\n }", "public void setPlayer(Player player) {\n this.player = player;\n }", "void playerTurn(Player actualPlayer) {\n aiPlayer.chooseAction(actualPlayer);\n actualPlayer.setTheirTurn(false);\n }", "void doAction(Player player);", "public Player playGame() {\r\n\r\n\t\tfor(int season = 0; season < 4; season++) {\r\n\r\n\t\t\t//deal out cards\r\n\t\t\tfor(int i = 0; i < state.dealAmounts[season]; i++) {\r\n\t\t\t\tfor(Player p : players) {\r\n\t\t\t\t\tp.deal(state.drawCard());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//debug\r\n\t\t\t//show money amounts\r\n\t\t\tfor(Player p : players) {\r\n\t\t\t\tif(debugPrinting)\r\n\t\t\t\tSystem.out.println(p.name + \" : \" + p.getMoney());\r\n\t\t\t}\r\n\r\n\t\t\tstate.resetSeason();\r\n\r\n\t\t\tfor(int turn = 0; true; turn = (turn+1)%players.length) {\r\n\t\t\t\t//have a player play a card\r\n\t\t\t\tCard card = players[turn].chooseCard();\r\n\t\t\t\tCard second = null;\r\n\t\t\t\t\r\n\t\t\t\t//TODO this should be fixed to include if no players have cards\r\n\t\t\t\tif(card == null) {\r\n\t\t\t\t\tint hasHands = 0;\r\n\t\t\t\t\tfor(Player p : players) {\r\n\t\t\t\t\t\tif(p.getHand().size() != 0) {\r\n\t\t\t\t\t\t\thasHands++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//if no players have anything in their hand\r\n\t\t\t\t\tif(hasHands == 0) {\r\n\t\t\t\t\t\tendSeason();\r\n\t\t\t\t\t\tbreak;//break out of the season\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tint secondPlayer = -1;\r\n\r\n\t\t\t\tif(card.getAuctionType() == AuctionType.DOUBLE) {\r\n\t\t\t\t\tsecond = card;\r\n\t\t\t\t\tcard = players[turn].chooseSecondCard(second.getArtist());\r\n\r\n\t\t\t\t\tif(card == null) {\r\n\t\t\t\t\t\tfor(int i = 0; i < players.length-1 && card == null; i++) {\r\n\t\t\t\t\t\t\tcard = players[(turn+i)%players.length].chooseSecondCard(second.getArtist());\r\n\t\t\t\t\t\t\tsecondPlayer = (turn+i)%players.length;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(card == null) {\r\n\t\t\t\t\t\t\tcard = second;\r\n\t\t\t\t\t\t\tsecond = null;\r\n\t\t\t\t\t\t\tsecondPlayer = -1;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t//card(s) selected\r\n\r\n\t\t\t\t//let the GameState know\r\n\t\t\t\tstate.sell(card.getArtist(), second != null);\r\n\r\n\t\t\t\t//check to see if the season has ended\r\n\t\t\t\t//System.out.println(state.seasonEnded());\r\n\t\t\t\tif(state.seasonEnded()) {\r\n\t\t\t\t\tendSeason();\r\n\t\t\t\t\tbreak;//this break will break out of the season\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//announce card(s)\r\n\t\t\t\tfor(Player p : players) {\r\n\t\t\t\t\tp.announceCard(card, !(second == null));\r\n\t\t\t\t}\r\n\t\t\t\tif(debugPrinting)\r\n\t\t\t\tSystem.out.println(\"Player : \" + players[turn].name + \" :: \" + card + \" :: \" + second);\r\n\r\n\t\t\t\t//card(s) are ready for auction\r\n\t\t\t\tBid winningBid = null;\r\n\t\t\t\tif(card.getAuctionType() == AuctionType.FIXED_PRICE) {\r\n\t\t\t\t\twinningBid = fixedPrice(turn, players[turn].getFixedPrice());\r\n\t\t\t\t} else if(card.getAuctionType() == AuctionType.ONCE_AROUND) {\r\n\t\t\t\t\twinningBid = onceAround(turn);\r\n\t\t\t\t} else if(card.getAuctionType() == AuctionType.SEALED) {\r\n\t\t\t\t\twinningBid = sealed(turn);\r\n\t\t\t\t} else {\r\n\t\t\t\t\twinningBid = standardBidding(turn);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//let everybody know who won the auction\r\n\t\t\t\tfor(Player p : players) {\r\n\t\t\t\t\tp.announceAuctionWinner(winningBid.index, players[winningBid.index].name, winningBid.price);\r\n\t\t\t\t}\r\n\t\t\t\tif(debugPrinting)\r\n\t\t\t\tSystem.out.println(\"Auction winner: \" + players[winningBid.index].name + \":: Price : \" + winningBid.price);\r\n\r\n\t\t\t\t//The auction has been won, time to execute the order (66)\r\n\t\t\t\tif(winningBid.index == turn) {\r\n\t\t\t\t\tplayers[turn].pay(winningBid.price);\r\n\t\t\t\t\tplayers[turn].givePainting(card);\r\n\t\t\t\t\tif(second != null) {\r\n\t\t\t\t\t\tplayers[turn].givePainting(second);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(secondPlayer != -1) {\r\n\t\t\t\t\t\tplayers[secondPlayer].recive(winningBid.price/2);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tplayers[winningBid.index].pay(winningBid.price);\r\n\t\t\t\t\tif(secondPlayer != -1) {\r\n\t\t\t\t\t\tif(secondPlayer != winningBid.index) {\r\n\t\t\t\t\t\t\tplayers[secondPlayer].recive(winningBid.price/2);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tplayers[turn].recive(winningBid.price/2);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tplayers[turn].recive(winningBid.price);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tplayers[winningBid.index].givePainting(card);\r\n\t\t\t\t\tif(second != null) {\r\n\t\t\t\t\t\tplayers[winningBid.index].givePainting(second);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//debug\r\n\t\t//show money amounts\r\n\t\tfor(Player p : players) {\r\n\t\t\tif(debugPrinting)\r\n\t\t\tSystem.out.println(p.name + \" : \" + p.getMoney());\r\n\t\t}\r\n\t\t\r\n\t\tPlayer winner = null;\r\n\t\tfor(Player p : players) {\r\n\t\t\tif(winner == null || winner.getMoney() < p.getMoney()) {\r\n\t\t\t\twinner = p;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn winner;\r\n\t}", "public void use(Player player) {\n\n\t}", "public void runTheGame() {\n\t\txPlayer.setOpponent(oPlayer);\n\t\toPlayer.setOpponent(xPlayer);\n\t\tboard.display();\n\t\txPlayer.play();\n\t}", "public void setPlayer(Player player) {\n this.player = player;\n }", "public abstract void changePlayerAt(ShortPoint2D pos, Player player);", "void playCurrentStationCard();", "public void setPlayer(Player player) {\r\n this.player = player;\r\n }", "private void checkHex(Hex currentHex) {\n\t\tArrayList<Player> listOfPlayers = new ArrayList<>();\n\t\t// update hex vertices now\n\t\tint vertexCounter = 0;\n\t\tfor (HexVertex vertex : currentHex.getVerticies()) {\n\t\t\tvertex = board.vertexList.get(board.vertexList.indexOf(vertex));\n\t\t\tif (vertex.getAsset() != null) {\n\t\t\t\tPlayer p = vertex.getAsset().getPlayer();\n\t\t\t\tSystem.out.println(p.toString());\n\t\t\t\tlistOfPlayers.add(vertex.getAsset().getPlayer());\n\t\t\t}\n\t\t\tvertexCounter++;\n\t\t}\n\t\tSystem.out.println(\"List o' Playas: \" + listOfPlayers);\n\t\tstealResources(listOfPlayers);\n\t}", "protected abstract void takeTurn(int player);", "public void activatedBy(final Player player) {\n //Battle with a Boss Unit\n }", "@Override\n\tpublic void setPlayer(Player player) {\n\n\t}", "private void playThisCard(UnoCard clickedCard) throws NotYourTurnException, InvalidMoveException {\n\t\t// Check player's turn\n\t\tif (!isHisTurn(clickedCard)) {\n\t\t\tthrow new NotYourTurnException();\n\t\t} else {\n\n\t\t\t// Card validation\n\t\t\tif (isValidMove(clickedCard)) {\n\n\t\t\t\tplayedCards().add(clickedCard);\n\n\t\t\t\tremovePlayedCard(clickedCard);\n\n\t\t\t\t// function cards ??\n if (clickedCard instanceof ActionCard) {\n performAction(clickedCard);\n\n }\n\n\t\t\t\tfor (GameListener listener : gameListeners) {\n\t\t\t\t\tlistener.cardPlayed(clickedCard);\n\t\t\t\t}\n\n\t\t\t\tcheckResults();\n\t\t\t} else {\n\t\t\t\tthrow new InvalidMoveException();\n\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void onPlayerDialogClick(DialogFragment dialog, int which) {\n\t\tLog.i(this.getClass().getName(), \"onPlayerDialogClick() - Entry\");\n\t\tswitch (which) {\n\t\tcase 0: //cross selected\n\t\t\tsetPlayer(BoardSquaresState.CROSS);\n\t\t\tbreak;\n\t\tcase 1: // Naught selected\n\t\t\tsetPlayer(BoardSquaresState.NOUGHT);\n\t\t\tbreak;\n\t\tcase 2: //random selection - make decision and set\n\t\t\tRandom rand=new Random();\n\t\t\tif(rand.nextInt(101)%2 == 1) {\n\t\t\t\tsetPlayer(BoardSquaresState.CROSS);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tsetPlayer(BoardSquaresState.NOUGHT);\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t\t//change display of buttons\n\t\tresetButton.setTextColor(getResources().getColor(R.color.ivory));\n\t\tif(difficulty != null){\n\t\t\tplayButton.setTextColor(getResources().getColor(R.color.ivory));\n\t\t}\n\t}", "public void switchPlayer(){\n // Menukar giliran player dalam bermain\n Player temp = this.currentPlayer;\n this.currentPlayer = this.oppositePlayer;\n this.oppositePlayer = temp;\n }", "public abstract void accept(Player player, String component);", "private void firstSlot(Player player, MessageBuilder payload) {\n int interfaceId = payload.getShort(edgeville.net.ValueType.A);\n int slot = payload.getShort(edgeville.net.ValueType.A);\n int itemId = payload.getShort(edgeville.net.ValueType.A);\n if (interfaceId < 0 || slot < 0 || itemId < 0)\n return;\n player.setSkillAction(false);\n switch (interfaceId) {\n case 1688:\n player.getEquipment().unequipItem(slot, true);\n player.getCombatBuilder().cooldown(true);\n break;\n case 5064:\n player.getBank().depositFromInventory(slot, 1);\n break;\n case 5382:\n player.getBank().withdraw(slot, 1, true);\n break;\n case 3900:\n Shop.SHOPS.get(player.getOpenShop()).sendPurchasePrice(player, new Item(itemId));\n break;\n case 3823:\n Shop.SHOPS.get(player.getOpenShop()).sendSellingPrice(player, new Item(itemId));\n break;\n case 3322:\n player.getTradeSession().add(new Item(itemId, 1), slot);\n break;\n case 3415:\n player.getTradeSession().remove(new Item(itemId, 1));\n break;\n }\n }", "private static void playBlackjack(Player player) {\n\t\t//Delete hands of previous games.\n\t\tplayer.getReady();\n\t\t\n\t\t//Create the dealer.\n\t\tDealer dealer = new Dealer();\n\t\t\n\t\t//Deal two cards to each player.\n\t\tplayer.addCard(deck.dealCard());\n\t\tplayer.addCard(deck.dealCard());\n\t\t\n\t\tdealer.addCard(deck.dealCard());\n\t\tdealer.addCard(deck.dealCard());\n\t\t\n\t\t//Check if anyone has Blackjack.\n\t\tif (dealer.hasBlackjack()) {\n\t\t\tconsole.println(\"Your hand:\" + player.getHand());\n\t\t\tconsole.println(\"Dealer hand:\" + dealer.getHand());\n\t\t\tconsole.println(\"\\n*******************\\n\" +\n\t\t\t\t\t\"Blackjack! You lose!!\" +\n\t\t\t\t\t\"\\n*******************\\n\");\n\t\t\tconsole.println(\"Press <Enter> to continue.\");\n\t\t\tplayer.pay();\n\t\t\treturn;\n\t\t}\n\t\tif (player.hasBlackjack()) {\n\t\t\tconsole.println(\"Dealer hand:\" + dealer.getHand());\n\t\t\tconsole.println(\"Your hand:\" + player.getHand());\n\t\t\tconsole.println(\"\\n*******************\\n\" +\n\t\t\t\t\t\"Blackjack! You lose!!\" +\n\t\t\t\t\t\"\\n*******************\\n\");\n\t\t\tconsole.println(\"Press <Enter> to continue.\");\n\t\t\tplayer.collect();\n\t\t\treturn;\n\t\t\t\n\t\t}\n\t\t\n\t\t//Now the real game begins. Player play first.\n\t\t//Must play all the hands until dealer's turn.\n\t\tboolean dealerTurn = false;\n\t\t\n\t\tconsole.println(String.format(\"\\n\\nDealer first card: %s\", dealer.getFirstCard()));\n\t\t\n\t\twhile (!dealerTurn) { //Player keep playing as long as she can/wants\n\t\t\t\n\t\t\t//Player can have multiple hands (after split). Should play all of them independently.\n\t\t\tOptional<Hand> optionalPlayingHand = player.getNextPlayableHand();\n\t\t\t\n\t\t\tif (optionalPlayingHand.isPresent()) {\n\t\t\t\t\n\t\t\t\tplayer.setCurrentHand(optionalPlayingHand.get());\n\t\t\t\t\n\t\t\t\tconsole.println(\"Your playing hand:\" + player.getHand());\n\t\t\t\tconsole.print(\"Please, select an option: \");\n\t\t\t\tconsole.println(\"(1) Hit (2) Stand (3) Double Down (4) Split (5) Surrender\");\n\t\t\t\tint option = scanner.nextInt();\n\t\t\t\t\n\t\t\t\tswitch (UserAction.valueOf(option)) {\n\t\t\t\t\tcase HIT:\n\t\t\t\t\t\tconsole.println(\"You've chosen: HIT\");\n\t\t\t\t\t\tplayer.hit(deck.dealCard());\n\t\t\t\t\t\tconsole.println(\"Your resulting hand:\" + player.getHand());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase STAND:\n\t\t\t\t\t\tconsole.println(\"You've chosen: STAND\");\n\t\t\t\t\t\tplayer.stand();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase SPLIT:\n\t\t\t\t\t\tconsole.println(\"You've chosen: SPLIT\");\n\t\t\t\t\t\tif (player.split(deck.dealCard(), deck.dealCard())) {\n\t\t\t\t\t\t\tconsole.println(\"Your hand has been split\");\n\t\t\t\t\t\t\tconsole.println(\"Your resulting hand:\" + player.getHand());\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconsole.println(\"Your hand can not be split. Try another option\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DOUBLE_DOWN:\n\t\t\t\t\t\tconsole.println(\"You've chosen: DOUBLE DOWN\");\n\t\t\t\t\t\tplayer.doubleDown(deck.dealCard());\n\t\t\t\t\t\tconsole.println(\"Your resulting hand:\" + player.getHand());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase SURRENDER:\n\t\t\t\t\t\tconsole.println(\"You've chosen: SURRENDER\");\n\t\t\t\t\t\tif (player.surrender()) {\n\t\t\t\t\t\t\tconsole.println(\"Lose half of your bet.\");\n\t\t\t\t\t\t\tconsole.println(\"Dealer hand:\" + dealer.getHand());\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconsole.println(\"You cannot surrender. Try another option\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tdealerTurn = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//All player's hands are standing or busted\n\t\tfor (Hand hand : player.getHands()) {\n\t\t\tconsole.println(\"Your hand: \" + hand + \" Status: \" + hand.getStatus());\n\t\t}\n\t\t\n\t\tconsole.println(\"\\nDealer hand:\" + dealer.getHand());\n\t\t\n\t\tif (player.isBusted()) {\n\t\t\tconsole.println(\"\\n************\\n\" +\n\t\t\t\t\t\"You lose!!\" +\n\t\t\t\t\t\"\\n************\\n\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tconsole.println(\"\\nDealer turn.\\n\");\n\t\t//Dealer's turn.\n\t\twhile (dealerTurn) {\n\t\t\tUserAction dealerAction = dealer.getNextAction();\n\t\t\tswitch (dealerAction) {\n\t\t\t\tcase HIT:\n\t\t\t\t\tconsole.println(\"Dealer HIT\");\n\t\t\t\t\tdealer.hit(deck.dealCard());\n\t\t\t\t\tconsole.println(\"Dealer resulting hand:\" + dealer.getHand());\n\t\t\t\t\tbreak;\n\t\t\t\tcase STAND:\n\t\t\t\t\tconsole.println(\"Dealer STAND\");\n\t\t\t\t\tdealer.stand();\n\t\t\t\t\tdealerTurn = false;\n\t\t\t\t\tbreak;\n\t\t\t\tcase DONE:\n\t\t\t\t\tdealerTurn = false;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tconsole.println(\"Dealer hand:\" + dealer.getHand());\n\t\tif (dealer.isBusted()) {\n\t\t\t//Dealer is busted. Player wins!\n\t\t\tconsole.println(\"\\n************\\n\" +\n\t\t\t\t\t\"You win!!\" +\n\t\t\t\t\t\"\\n************\\n\");\n\t\t\tplayer.collect();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//Check if dealer won\n\t\tif (dealer.hasBlackjack()) {\n\t\t\tconsole.println(\"\\n******************************************************\\n\" +\n\t\t\t\t\t\"There is a tie!. Dealer wins. Its a casino after all\" +\n\t\t\t\t\t\"\\n******************************************************\\n\");\n\t\t\tplayer.pay();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tconsole.println(\"\\n*****************************************************************\\n\");\n\t\tfor (Hand hand : player.getNonBustedHands()) {\n\t\t\tif (hand.getValue() > dealer.getValue()) {\n\t\t\t\t//Player has a better hand. Hand wins.\n\t\t\t\tconsole.println(\"You have a winner hand :\" + hand);\n\t\t\t\tplayer.collect(hand);\n\t\t\t} else {\n\t\t\t\t//Player's hand lose\n\t\t\t\tconsole.println(\"You have a losing hand :\" + hand);\n\t\t\t\tif (hand.getValue() == dealer.getValue()) {\n\t\t\t\t\tconsole.println(\"Remember: in a tie, you lose!\");\n\t\t\t\t}\n\t\t\t\tplayer.pay(hand);\n\t\t\t}\n\t\t}\n\t\tconsole.println(\"\\n*****************************************************************\\n\");\n\t}", "private void RedEatsPlayer(Player player)\n {\n Player player_to_be_eaten = null;\n try\n {\n RedPlayer player_to_eat = (RedPlayer) player;\n player_to_be_eaten = checkIfEatsBluePlayer(player_to_eat);\n if (player_to_be_eaten == null)\n {\n player_to_be_eaten = checkIfEatsGreenPlayer(player_to_eat);\n if (player_to_be_eaten == null)\n {\n player_to_be_eaten = checkIfEatsYellowPlayer(player_to_eat);\n }\n }\n\n //player_to_be_eaten.println(\"red_player_to_be_eaten\" + player_to_be_eaten.toString());\n if (player_to_be_eaten != null)\n {\n playPersonEatenMusic();\n returnPlayerHome(player_to_be_eaten);\n }\n }\n catch (Exception e)\n {\n \n }\n return;\n }", "@Override\n\t\t\t\t\t public void visit(Player player) {\n\t\t\t\t\t\t\tPacketSendUtility.sendPacket(player, SM_SYSTEM_MESSAGE.STR_MSG_HF_ShugoCaravanAppear);\n\t\t\t\t\t }", "public void setPlayer(Sprite player) {\n\t\tthis.player = player;\n\t}", "Card playCard(int playerIndex, int cardIndex)\n {\n if (playerIndex < 0 || playerIndex > numPlayers - 1 ||\n cardIndex < 0 || cardIndex > numCardsPerHand - 1)\n {\n //Creates a card that does not work\n return new Card('M', Card.Suit.spades); \n }\n\n // return the card played\n return hand[playerIndex].playCard(cardIndex);\n\n }", "public void play() {\n System.out.println(\"Player \" + this.name + \" started to play...\");\n System.out.println(\"Current balance: \" + getTotalAsset());\n\n // roll a dice to move\n int steps = rollDice();\n System.out.println(\"Player diced \" + steps);\n\n // move\n move(steps);\n Land land = Map.getLandbyIndex(position);\n\n // land triggered purchase or opportunity events\n land.trigger();\n\n System.out.println(\"Player \" + this.name + \"has finished.\");\n }", "public void play(GameController game){\n game.trashCard(this);\n \n }", "void playMonopolyCard(String resource);", "public void setPlayer(Player player) {\n\t\tthis.player = player;\r\n\t}", "@Override\r\n public void handleAttack(Player player) {\r\n player.decreaseHealth(3);\r\n player.setColor(true);\r\n }", "public void setPlayer(Player player) {\n\t\tthis.player = player;\n\t}", "public void playTheGame() {\n\t\tint column;\n\t\ttry {\n\t\t\tboolean gameIsOver = false;\n\t\t\tfor (int count = 0; count < thePlayers.length; count++)\n\t\t\t\tthePlayers[count].getView().showOutput(\n\t\t\t\t\t\taConnect4Field.toString());\n\n\t\t\tdo {\n\t\t\t\tfor (int index = 0; index < thePlayers.length; index++) {\n\t\t\t\t\t// thePlayers[index].getView().showOutput(aConnect4Field.toString());\n\t\t\t\t\tif (aConnect4Field.isItaDraw()) {\n\t\t\t\t\t\tfor (int count = 0; count < thePlayers.length; count++)\n\t\t\t\t\t\t\tthePlayers[count].getView().showOutput(\"Draw\");\n\t\t\t\t\t\tgameIsOver = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthePlayers[index].getView().showOutput(\n\t\t\t\t\t\t\t\tthePlayers[index].getName()\n\t\t\t\t\t\t\t\t\t\t+ \" it's Your Turn! play your move\");\n\t\t\t\t\t\tcolumn = thePlayers[index].nextMove();\n\t\t\t\t\t\twhile (!aConnect4Field\n\t\t\t\t\t\t\t\t.checkIfPiecedCanBeDroppedIn(column)) {\n\t\t\t\t\t\t\tthePlayers[index].getView().showOutput(\n\t\t\t\t\t\t\t\t\t\"Invalid Turn Try again\");\n\t\t\t\t\t\t\tcolumn = thePlayers[index].nextMove();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\taConnect4Field.dropPieces(column,\n\t\t\t\t\t\t\t\tthePlayers[index].getGamePiece());\n\t\t\t\t\t\tfor (int count = 0; count < thePlayers.length; count++)\n\t\t\t\t\t\t\tthePlayers[count].getView().showOutput(\n\t\t\t\t\t\t\t\t\taConnect4Field.toString());\n\t\t\t\t\t\tif (aConnect4Field.error != \"\") {\n\n\t\t\t\t\t\t\tthePlayers[index].getView().showOutput(\n\t\t\t\t\t\t\t\t\taConnect4Field.error);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (aConnect4Field.didLastMoveWin()) {\n\t\t\t\t\t\t\t\tgameIsOver = true;\n\t\t\t\t\t\t\t\t// all player get to know\n\t\t\t\t\t\t\t\tfor (int count = 0; count < thePlayers.length; count++)\n\t\t\t\t\t\t\t\t\tthePlayers[count].getView().showOutput(\n\t\t\t\t\t\t\t\t\t\t\t\"The winner is: \"\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ thePlayers[index]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getName());\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} while (!gameIsOver);\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t}", "void playMonumentCard();", "public RunecraftingEquipmentListener(Player player) {\n\t\tthis.player = player;\n\t}", "public void onAction(Player player) {\n }", "private void warSeed(Player player) {\n\t\t\n\t}", "public void showPlayer ( Player player ) {\n\t\ttry {\n\t\t\tinvoke ( \"showPlayer\" , new Class[] { Plugin.class , Player.class } ,\n\t\t\t\t\t AdrianSRCore.getInstance ( ) , player );\n\t\t} catch ( NoSuchMethodException ex ) { // legacy\n\t\t\texecute ( handle -> handle.hidePlayer ( player ) );\n\t\t}\n\t}", "public abstract void activatedBy(Player player);", "@Test\n public void alienAttacksBeforeMoving() throws FileNotFoundException,\n URISyntaxException, DisconnectedException {\n // preparo il terreno\n MatchController matchController = new MatchController() {\n @Override\n public void initMatch(PartyController partyController)\n throws FileNotFoundException, URISyntaxException {\n this.partyController = partyController;\n this.match = new Match();\n this.turnController = new TurnController(this);\n ZoneFactory zf = new TemplateZoneFactory(\n EftaiosGame.DEFAULT_MAP);\n this.zoneController = new ZoneController(zf);\n }\n };\n\n PlayerCard alien = new PlayerCard(PlayerRace.ALIEN, null);\n Party party = new Party(\"test\", new EftaiosGame(), false);\n PartyController partyController = PartyController.createNewParty(party);\n party.addToParty(UUID.randomUUID(), \"player1\");\n List<Player> players = new ArrayList<Player>(party.getMembers()\n .keySet());\n Player player1 = players.get(0);\n player1.setIdentity(alien);\n\n matchController.initMatch(partyController);\n Turn turn = new Turn(player1, matchController.getMatch().getTurnCount());\n matchController.getTurnController().setTurn(turn);\n HexPoint point = HexPoint.fromOffset(1, 1);\n Sector sec = new Sector(null, point);\n matchController.getZoneController().getCurrentZone()\n .movePlayer(player1, sec);\n matchController.getTurnController().getTurn().setCanAttack(true);\n ActionRequest action = new ActionRequest(ActionType.ATTACK, null, null);\n // eseguo l'azione\n Attack atk = new Attack();\n atk.initAction(matchController, action);\n // verifico gli esiti\n assertFalse(atk.isValid());\n }", "private void setPlayer(BoardSquaresState player){\n\t\tif(player == BoardSquaresState.CROSS){\n\t\t\tselectedPlayer = BoardSquaresState.CROSS;\n\t\t\tplayerSelectionButton.setText(R.id.button_title, \"Cross\");\n\t\t\tplayerSelectionButton.setText(R.id.button_subtitle, \"You go first!\");\n\t\t\tplayerSelectionButton.setImageResource(R.id.selector_button_image, R.drawable.cross_1);\n\t\t\tplayerSelectionButton.setImageResource(R.id.item_set_image, R.drawable.btn_check_on_focused_holo_light);\n\t\t}\n\t\telse{\n\t\t\tselectedPlayer = BoardSquaresState.NOUGHT;\n\t\t\tplayerSelectionButton.setText(R.id.button_title, \"Nought\");\n\t\t\tplayerSelectionButton.setText(R.id.button_subtitle, \"Computer goes first!\");\n\t\t\tplayerSelectionButton.setImageResource(R.id.selector_button_image, R.drawable.nought_1);\n\t\t\tplayerSelectionButton.setImageResource(R.id.item_set_image, R.drawable.btn_check_on_focused_holo_light);\n\t\t}\n\n\t}", "@Override\r\n\tpublic void landOnSquare(Player player) {\n\t\tplayer.deposit(bonus);\r\n\t\tGUIControl.refugeMessage(this,player,bonus);//prints a message to the user.\r\n\t\tGUIControl.updateBalance(player);\r\n\t}", "public void setHeroPlayer(Player heroPlayer) {\n this.heroPlayer = heroPlayer;\n startGame();\n }", "public void registerPlayer(BlackjackPlayer player) {\r\n getPlayers().add(player);\r\n }", "public void ActivateRobber(Player player, HexBoard board, boolean isKnight) {\n CurrentPlayer=player;\n this.board=board;\n if(!isKnight)\n\t\tSevenResourceCheck();\n checkHex(this.getCurrentHex()); \n\t}", "@Override\n\tpublic void getScoreCardByPlayer(Player player) {\n\t\tSystem.out.printf(\"%12s: \", player.getName());\n\t\tChance[] chances = player.getScoreCard().getChances();\n\t\tfor (int i = 0; i < chances.length; i++) {\n\t\t\tif (i == chances.length - 1) {\n\t\t\t\tSystem.out.printf(\"|~ %02d|%02d ~|\", chances[i].getThrow1(), chances[i].getThrow2());\n\t\t\t} else {\n\t\t\t\tSystem.out.printf(\"| %02d|%02d |\", chances[i].getThrow1(), chances[i].getThrow2());\n\t\t\t}\n\t\t}\n\t\tSystem.out.printf(\" => %03d \", player.getScoreCard().getTotalScore());\n\t\tSystem.out.printf(\"Total Spare: %02d \", player.getScoreCard().getTotalSpare());\n\t\tSystem.out.printf(\"Total Strike: %02d%n\", player.getScoreCard().getTotalStrike());\n\t}", "@Override\n public void run() {\n if (!GameState.getCurrent().equals(GameState.PLAYING)) return;\n \n player.setGameMode(GameMode.SURVIVAL);\n player.teleport(ConfigUtils.getRandomSpawn(game.getActiveWorld()));\n player.setHealth(20.0);\n player.setFoodLevel(20);\n new InventoryBuilder(main, player);\n \n }", "public void printPoliticCards(Player player);", "public void setPlayer(Player player) {\n\t\t\tthis.player = player;\n\t\t}", "public void SpecialCardAction(UNOCard aCard) {\n\t\t\n\t\tif (aCard.getName() == \"Reverse\") { // Reverse card is played, so game direction is switched\n\t\t\tif (gameDirection == \"right\") {\n\t\t\t\tgameDirection = \"left\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\tgameDirection = \"right\";\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (aCard.getName() == \"Skip\") {\n\t\t\tif (gameDirection == \"right\") { // If Game is moving in one direction\n\t\t\t\tcurrentPlayerToPlayIndex = currentPlayerToPlayIndex + 2; // player next to play is skipped\n\t\t\t\tif (currentPlayerToPlayIndex >= players.size()) {\n\t\t\t\t\tcurrentPlayerToPlayIndex = currentPlayerToPlayIndex - players.size();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (gameDirection == \"left\") { // If Game is moving in other direction\n\t\t\t\tcurrentPlayerToPlayIndex = currentPlayerToPlayIndex - 2; // player next to play is skipped\n\t\t\t\tif (currentPlayerToPlayIndex <= 0) {\n\t\t\t\t\tcurrentPlayerToPlayIndex = currentPlayerToPlayIndex + players.size();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tcurrentPlayerToPlay = players.get(currentPlayerToPlayIndex); // Next Player to play a card\n\t\t\n\t\tif (aCard.getName() == \"Draw Two\") { // If a Draw Two Card is played, the enxt player to play is dealt two cards\n\t\t\tif (gameDirection == \"right\") {\n\t\t\t\tif (currentPlayerToPlayIndex < players.size()) {\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (gameDirection == \"left\") {\n\t\t\t\tif (currentPlayerToPlayIndex != 0) {\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (aCard.getName() == \"Wild\") { // Wild is played, function called to ask user for new color\n\t\t\tWildIsPlayedAskUserForColor();\n\t\t}\n\t\t\n\t\tif (aCard.getName() == \"Wild Draw Four\") {\n\t\t\tif (gameDirection == \"right\") { // if game direction is this way\n\t\t\t\tif (currentPlayerToPlayIndex < players.size()) {\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard()); // draw four cards\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard()); // draw four cards\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (gameDirection == \"left\") { // if game direction is this way\n\t\t\t\tif (currentPlayerToPlayIndex != 0) {\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard()); // draw four cards\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard()); // draw four cards\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t}\n\t\t\tWildIsPlayedAskUserForColor();\n\t\t}\n\t\t\n\t}", "public void showTurn(PlayerClient[] players, DraftPoolMP draft, RoundTrackMP track, int[] tools, int activePlayer, int me, int round) throws InvalidIntArgumentException, IOException\n {\n printOut(cliToolsManager.sceneInitializer(width));\n printOut(printerMaker.getGameScene(players, draft, track, privateObjective, pubObjs, tools, activePlayer, me));\n\n printOut(cliToolsManager.printSpaces(width));\n\n printOut(printerMaker.round(round, players[activePlayer].getName()));\n\n printOut(cliToolsManager.sceneEnder(width));\n }", "public String printCard(int player) {\n\t\tif (player >= 4 || player < 0) {\n\t\t\treturn \"Error\";\n\t\t}\n\t\tif (show[player]) {\n\t\t\treturn suit + rank;\n\t\t}\n\t\treturn suit;\n\t}", "public static void handleBakePie(Player player) {\n\t\t\n\t}", "public void drawPlayer(){\n Player player = world.getPlayer();\n if(player.isGod()) {\n spriteBatch.draw(fadedPlayerTexture,player.getPosition().x * ppuX, player.getPosition().y * ppuY,\n player.WIDTH * ppuX, player.HEIGHT * ppuY);\n } else {\n spriteBatch.draw(playerTexture, player.getPosition().x * ppuX, player.getPosition().y * ppuY,\n player.WIDTH * ppuX, player.HEIGHT * ppuY);\n }\n }", "private void playNextPlayer() {\n \n PlayerId nextPlayer = state.nextPlayer();\n players.get(nextPlayer).setHelp(state, handsOfCards.get(nextPlayer), nextPlayer);\n Card c = players.get(nextPlayer).cardToPlay(state, handsOfCards.get(nextPlayer));\n state = state.withNewCardPlayed(c);\n \n handsOfCards.put(nextPlayer, handsOfCards.get(nextPlayer).remove(c));\n players.get(nextPlayer).updateHand(handsOfCards.get(nextPlayer));\n \n for (Map.Entry<PlayerId, Player> pId: players.entrySet()) {\n pId.getValue().updateTrick(state.trick());\n }\n players.get(nextPlayer).resetHelp();\n }", "@Override\n public void displayInventory(Player player)\n {\n Platform.runLater(() -> {\n InventoryDisplay inventory = gui.getInventory();\n inventory.displayInventory(player);\n });\n }", "void fight(Player attackingPlayer, Player attackedPlayer){\n\n // Ask what kind of attack\n Scanner scanner = new Scanner(System.in);\n System.out.println(attackingPlayer.getName() + \" (\" + attackingPlayer.getVitality()+ \" vitalité) veuillez choisir votre action ( 1: Attaque Basique\" + \" 2: Attaque Speciale\");\n\n int attack = scanner.nextInt();\n\n switch (attack) {\n case 1:\n attackingPlayer.basicAttack(attackedPlayer);\n break;\n case 2:\n attackingPlayer.specialAttack(attackedPlayer);\n break;\n default:\n }\n\n }", "public abstract Card cardPlayed(int playerIndex, Card played, int targetIndex);", "private void setWhitePlayer(Player player) {\r\n\t\tthis.whitePlayer = player;\r\n\t}", "private void firstRound(Player player)\n {\n PowerUpCard option1 = powerUpCardDeck.getFirstCard();\n PowerUpCard option2 = powerUpCardDeck.getFirstCard();\n try\n {\n String chosenId = player.getView().chooseSpawnPoint(option1.getCardData(), option2.getCardData());\n PowerUpCard chosen = option1.getId().equals(chosenId) ? option1 : option2;\n Block spawnPoint = map.findRoomByColor(chosen.getColor()).getSpawnPoint();\n powerUpCardDeck.addCard(chosen);\n player.addPowerUpCard(chosen.equals(option1) ? option2 : option1);\n player.setBlock(spawnPoint);\n player.setFirstRoundPlayed(true);\n sendBroadcastUpdate();\n }\n catch (ConnectionErrorException | TimeOutException e)\n {\n powerUpCardDeck.addCard(option1);\n powerUpCardDeck.addCard(option2);\n throw e;\n }\n\n }", "public static void main(String[] args) {\n CardGame c = new CardGame(4, 0);\r\n c.start();\r\n\r\n // h 9\r\n // h 7\r\n // h 12\r\n // h 4\r\n // p 5\r\n // p 6\r\n // p 14\r\n // p 11\r\n // e 13\r\n // e 10\r\n // e 9\r\n // c 7\r\n // c 4\r\n\r\n // System.out.println(Arrays.toString(c.onePlay(new int[][] { { 1, 12 }, { 0, 2\r\n // }, { 1, 10 }, { 1, 9 } }, 0)));\r\n\r\n // [] Hukum 0\r\n // [] Paan 1\r\n // [] Eat 2\r\n // [] Chiddi 3\r\n }" ]
[ "0.68067044", "0.67178345", "0.64125335", "0.6090674", "0.60166043", "0.5978308", "0.59529674", "0.59362435", "0.59237355", "0.59050363", "0.59035116", "0.58760244", "0.58626485", "0.58375514", "0.58215606", "0.5802511", "0.5737191", "0.57217455", "0.57195824", "0.5718634", "0.57005566", "0.5694205", "0.56926125", "0.5689776", "0.56368876", "0.5634532", "0.5628945", "0.5628216", "0.5626725", "0.56152576", "0.5595278", "0.5586838", "0.5581566", "0.55785847", "0.55710274", "0.5567171", "0.5566067", "0.5556274", "0.5550116", "0.55327755", "0.5505677", "0.5503043", "0.5502737", "0.55022407", "0.5493606", "0.5485812", "0.54852515", "0.5484409", "0.54839325", "0.54830843", "0.54798305", "0.54794055", "0.54737866", "0.54618144", "0.5460169", "0.54562753", "0.54533696", "0.5448585", "0.5442542", "0.5441176", "0.5431012", "0.54282796", "0.5425823", "0.5412993", "0.5406968", "0.5406808", "0.54042315", "0.5399869", "0.5396467", "0.53962535", "0.5393401", "0.5389819", "0.5387791", "0.53848857", "0.5380614", "0.5379348", "0.5369147", "0.5368644", "0.5366403", "0.5364753", "0.53644806", "0.5360207", "0.53478765", "0.5347055", "0.53456503", "0.5343645", "0.53419757", "0.5339862", "0.53387743", "0.53365105", "0.53337544", "0.5330348", "0.5329427", "0.5322051", "0.53206486", "0.5318886", "0.52893037", "0.5289206", "0.5289095", "0.52871525" ]
0.71448743
0
This method plays the year of plenty card, getting the specified resources
void playYearOfPlentyCard(String resource1, String resource2);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void playYearOfPlentyCard(ResourceType resource1, ResourceType resource2) {\n\t\t\r\n\t}", "void playMonopolyCard(String resource);", "private Type stealResource() {\n \t\tint count = getResourceCount();\n \t\tif (count <= 0)\n \t\t\treturn null;\n \n \t\t// pick random card\n \t\tint select = (int) (Math.random() * count);\n \t\tfor (int i = 0; i < resources.length; i++) {\n \t\t\tif (select < resources[i]) {\n \t\t\t\tuseResources(Type.values()[i], 1);\n \t\t\t\treturn Type.values()[i];\n \t\t\t}\n \n \t\t\tselect -= resources[i];\n \t\t}\n \n \t\treturn null;\n \t}", "@Override\r\n\tpublic void playMonopolyCard(ResourceType resource) {\n\t\t\r\n\t}", "public void populateDeck(){\n\n //Add everything to r\n for(int i=0;i<LUMBER;i++){\n deck.add(new ResourceCard(container, Resource.WOOD, cardStartPoint));\n }\n\n for(int i=0;i<WOOL;i++){\n deck.add(new ResourceCard(container, Resource.WOOL, cardStartPoint));\n }\n\n for(int i=0;i<GRAIN;i++){\n deck.add(new ResourceCard(container, Resource.WHEAT, cardStartPoint));\n }\n\n for(int i=0;i<BRICK;i++){\n deck.add(new ResourceCard(container, Resource.BRICKS, cardStartPoint));\n }\n\n for(int i=0;i<ORE;i++){\n deck.add(new ResourceCard(container, Resource.ORE, cardStartPoint));\n }\n //Collections.shuffle(deck);\n\n }", "public WorldData nextTurn(ArrayList<PolicyCard> cards)\n {\n LOGGER.info(\"Advancing Turn...\");\n WorldData threeYearData = new WorldData();\n\n model.nextYear(cards, threeYearData);\n model.nextYear(cards, threeYearData);\n model.nextYear(cards, threeYearData);\n LOGGER.info(\"Turn complete, year is now \" + threeYearData.year);\n return threeYearData;\n }", "public List<Integer> askPlayerCardsToUse();", "private void SevenResourceCheck() {\n\t\tint randomResourceNumber = 0;\n\t\tint resourceCounter = 0;\n\t\tfor (int i = 0; i < robberPlayers.size(); i++) // for loop runs once for\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// every player\n\t\t{\n\t\t\tif (robberPlayers.get(i).countResources() >= 7) // If the current\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// than 7 resource\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// cards...\n\t\t\t\tresourceCounter = robberPlayers.get(i).countResources() / 2;\n\t\t\t{\n\t\t\t\tSystem.out.println(\"\\n\" + robberPlayers.get(i).getNickname() + \" lost:\");\n\t\t\t\tfor (int j = 0; j < resourceCounter; j++) {\n\t\t\t\t\trandomResourceNumber = RandomResourceValue(i);\n\t\t\t\t\trobberPlayers.get(i).resources[randomResourceNumber]--;\n\t\t\t\t\tresourceBank.bankReturnResource(randomResourceNumber, 1);\n\t\t\t\t\tSystem.out.print(\" one \" + resourceBank.getResourceName(randomResourceNumber));\n\t\t\t\t} // end of inner for loop\n\t\t\t} // end of inner if statment\n\t\t} // end of for loop\n\t\tSystem.out.println(Arrays.toString(resourceBank.resources));\n\t\t//checkHex(this.getCurrentHex());\n\t}", "public void showResources(byte devCard) {\r\n\t\tif (devCard == Constants.GETRESOURCES)\r\n\t\t\tisResourceCard = true;\r\n\t\tif (devCard == Constants.MONOPOLY)\r\n\t\t\tisMonopolyCard = true;\r\n\t\tresourcePanel.setVisible(true);\r\n\t}", "private void populateResources(GameModel model) {\n\t\tPlayer player = model.getLocalPlayer(facade.getPlayerId());\n\t\tResourceList resource = player.getResources();\n\t\tint wood = resource.getWood();\n\t\tint brick = resource.getBrick();\n\t\tint sheep = resource.getSheep();\n\t\tint wheat = resource.getWheat();\n\t\tint ore = resource.getOre();\n\t\t\n\t\tgetView().setElementAmount(ResourceBarElement.WOOD, wood);\n\t\tgetView().setElementAmount(ResourceBarElement.BRICK, brick);\n\t\tgetView().setElementAmount(ResourceBarElement.SHEEP, sheep);\n\t\tgetView().setElementAmount(ResourceBarElement.WHEAT, wheat);\n\t\tgetView().setElementAmount(ResourceBarElement.ORE, ore);\n\t\t\n\t\t\n\t\t\n\t\tint roads = player.getRoads();\n\t\tint settlements = player.getSettlements();\n\t\tint cities = player.getCities();\n\t\t\n\t\tgetView().setElementAmount(ResourceBarElement.ROAD, roads);\n\t\tgetView().setElementEnabled(ResourceBarElement.ROAD, currState.canBuyRoad());\n\t\tgetView().setElementAmount(ResourceBarElement.SETTLEMENT, settlements);\n\t\tgetView().setElementEnabled(ResourceBarElement.SETTLEMENT, currState.canBuySettlement());\n\t\tgetView().setElementAmount(ResourceBarElement.CITY, cities);\n\t\tgetView().setElementEnabled(ResourceBarElement.CITY, currState.canBuyCity());\n\t\t\n\t\tboolean clickable = currState.canBuyDevCard();\n\t\tgetView().setElementEnabled(ResourceBarElement.BUY_CARD, clickable);\n\t\t\n\t\tclickable = player.hasDevCards();\n\t\tgetView().setElementEnabled(ResourceBarElement.PLAY_CARD, clickable);\n\t\t\n\t\tint soldiers = player.getSoldiers();\n\t\tgetView().setElementAmount(ResourceBarElement.SOLDIERS, soldiers);\n\t\t\n\t\t\n\t}", "void askBuyResources();", "boolean CanUseYearOfPlenty(String resource1, String resource2);", "void discardCards(Resources resources);", "@Override\n public void playYearOfPlenty(ResourceType r1, ResourceType r2) throws ModelException {\n if (!GameModelFacade.instance().canPlayYearOfPlenty(r1, r2)) {\n throw new ModelException(\"Preconditions for action not met.\");\n }\n\n try {\n String clientModel = m_theProxy.playYearOfPlenty(GameModelFacade.instance().getLocalPlayer().getIndex(), r1, r2);\n new ModelInitializer().initializeClientModel(clientModel, m_theProxy.getPlayerId());\n } catch (NetworkException e) {\n throw new ModelException(e);\n }\n }", "private List<AmountResource> getAvailableDessertResources(double amountNeeded, boolean isThirsty) {\n\n\t\tList<AmountResource> result = new ArrayList<AmountResource>();\n\n\t\tUnit containerUnit = person.getContainerUnit();\n\t\tif (!(containerUnit instanceof MarsSurface)) {\n\t\t\tInventory inv = containerUnit.getInventory();\n\n\t\t\tboolean option = true;\n\n\t\t\tAmountResource[] ARs = PreparingDessert.getArrayOfDessertsAR();\n\t\t\tfor (AmountResource ar : ARs) {\n\t\t\t\tif (isThirsty)\n\t\t\t\t\toption = ar.getName().contains(JUICE) || ar.getName().contains(MILK);\n\t\t\t\t\n\t\t\t\tboolean hasAR = false;\n\t\t\t\tif (amountNeeded > MIN) {\n\t\t\t\t\thasAR = Storage.retrieveAnResource(amountNeeded, ar, inv, false);\n\t\t\t\t}\n\t\t\t\tif (option && hasAR) {\n\t\t\t\t\tresult.add(ar);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}", "@Test\n public void getImageForLessonNumber() throws Exception {\n for (int i = 0; i < 10; i++) {\n int imageForLessonNumber = CardViewFactory.getImageResourceForLessonNumber(i);\n System.out.println(i + \" - \" + imageForLessonNumber);\n }\n }", "public void cards() {\n\t\t\n\n\t\tboolean[] randomCards = new boolean[52];\n\n\t\t// choose 4 random distinct cards from the deck\n\t\tint count = 0;\n\t\tint card1 = 0;\n\t\tint card2 = 0;\n\t\tint card3 = 0;\n\t\tint card4 = 0;\n\n\t\twhile (count < 4) {// Display only four cards\n\n\t\t\tcard1 = ((int) (Math.random() * 12) + 1) + 1;// Ignore zero\n\t\t\tcard2 = ((int) (Math.random() * 12) + 1) + 1;// Ignore zero\n\t\t\tcard3 = ((int) (Math.random() * 12) + 1) + 1;// Ignore zero\n\t\t\tcard4 = ((int) (Math.random() * 12) + 1) + 1;// Ignore zero\n\n\t\t\tif ((randomCards[card1] = !randomCards[card2]) && (randomCards[card1] = !randomCards[card3])\n\t\t\t\t\t&& (randomCards[card1] = !randomCards[card4]) && (randomCards[card2] = !randomCards[card3])\n\t\t\t\t\t&& (randomCards[card2] = !randomCards[card4]) && (randomCards[card3] = !randomCards[card4])) {\n\n\t\t\t\tString[] cards = { \"clubs\", \"diamonds\", \"hearts\", \"spades\" };\n\n\t\t\t\tString name1 = cards[(int) (Math.random() * cards.length)];\n\t\t\t\tString name2 = cards[(int) (Math.random() * cards.length)];\n\t\t\t\tString name3 = cards[(int) (Math.random() * cards.length)];\n\t\t\t\tString name4 = cards[(int) (Math.random() * cards.length)];\n\n\t\t\t\tImage image1 = new Image(\"png/\" + (card1) + \"_of_\" + name1 + \".png\");\n\t\t\t\tImage image2 = new Image(\"png/\" + (card2) + \"_of_\" + name2 + \".png\");\n\t\t\t\tImage image3 = new Image(\"png/\" + (card3) + \"_of_\" + name3 + \".png\");\n\t\t\t\tImage image4 = new Image(\"png/\" + (card4) + \"_of_\" + name4 + \".png\");\n\n\t\t\t\timgCard1.setImage(image1);\n\t\t\t\timgCard2.setImage(image2);\n\t\t\t\timgCard3.setImage(image3);\n\t\t\t\timgCard4.setImage(image4);\n\n\t\t\t\tcount++;\n\n\t\t\t}\n\n\t\t}\n\n\t\tString cardOneValue = Integer.toString(card1);\n\t\tString cardTwoValue = Integer.toString(card2);\n\t\tString cardThreeValue = Integer.toString(card3);\n\t\tString cardFourValue = Integer.toString(card4);\n\t\tSystem.out.println(cardOneValue + \" - \" + cardTwoValue + \" - \" + cardThreeValue + \" - \" + cardFourValue);\n\t\tsetText.setText(cardOneValue +\" \"+ cardTwoValue +\" \"+ cardThreeValue +\" \"+ cardFourValue);\n\t\t\n\t\tint solution = 0; \n\t\tif(solution!=24) {\n\t\tfor(int limit = 0; limit < 25; limit++) {\n\t\t\n\t\t\t\tSystem.out.println(\"No\");\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(solution);\n\t\t\n\t}", "public Card PlayCard() {\n\t Card ret = null;\n\t Card card;\n\t if (mCardCount > 0) {\n\t\t // To work out what card to play, see what cards can be played\n\t\t \tCard[] playableCards;\n\t\t \tplayableCards = mRules.GetPlayableCards();\n\t\t \tCard[] selectedCards;\n\t\t \tselectedCards = new Card[8];\n\t\t \tint iNumSelectableCards = 0;\n\t\t \tfor (int i = 0; i < 8; i++)\n\t\t \t\tselectedCards[i] = null;\n\t \tfor (int i = 0; i < mCardCount; i++){\n\t \t\tcard = mCard[i];\n\t \t\tswitch (card.GetSuit()){\n\t \t\tcase Card.HEARTS:\n\t \t\t\t\n\t \t\t\t// Card is a heart, can it be played?\n\t \t\t\t// Is it a seven, it can be played...\n\t \t\t\tif (card.GetValue() == 7){\n\t \t\t\t\tselectedCards[Rules.HEARTS8] = card;\n\t \t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t// and must be played first\n\t \t\t\t\tplayableCards[Rules.HEARTS8] = new Card(8,Card.HEARTS);\n\t \t\t\t\tplayableCards[Rules.HEARTS6] = new Card(6,Card.HEARTS);\n\t \t\t\t\tplayableCards[Rules.CLUBS8] = new Card(7,Card.CLUBS);\n\t \t\t\t\tplayableCards[Rules.DIAMONDS8] = new Card(7,Card.DIAMONDS);\n\t \t\t\t\tplayableCards[Rules.SPADES8] = new Card(7,Card.SPADES);\n\t \n\t \t\t\t\treturn card;\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() < 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.HEARTS6])){\n\t \t\t\t\t\tselectedCards[Rules.HEARTS6] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t\t//Log.i(\"\",\" Playing card \" + (card.GetValue()) + \" , \" +card.GetSuit());\n\t \t\t\t\t\t//Log.i(\"\",\" Updating playable card \" + (card.GetValue()-1) + \" , \" +Card.HEARTS);\t \t\t\t\t\t\n\t \t\t\t\t\t//playableCards[Rules.HEARTS6] = new Card(card.GetValue()-1,Card.HEARTS);\n\t \t\t\t\t\t//return card;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() > 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.HEARTS8])){\n\t \t\t\t\t\tselectedCards[Rules.HEARTS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t\t//Log.i(\"\",\" Playing card \" + (card.GetValue()) + \" , \" +card.GetSuit());\n\t \t\t\t\t\t//Log.i(\"\",\" Updating playable card \" + (card.GetValue()+1) + \" , \" +Card.HEARTS);\t \t\t\t\t\t\n\t \t\t\t\t\t//playableCards[Rules.HEARTS8] = new Card(card.GetValue()+1,Card.HEARTS);\n\t \t\t\t\t\t//return card;\n\t \t\t\t\t}\n\t \t\t\t}\t \t\t\t\n\t \t\t\t\n\t \t\t\tbreak;\n\t \t\tcase Card.DIAMONDS:\n\t \t\t\t// Is it a seven, it can be played...\n\t \t\t\tif (card.GetValue() == 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.DIAMONDS8])){\n\t \t\t\t\t\tselectedCards[Rules.DIAMONDS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\t\n\t \t\t\tif (card.GetValue() < 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.DIAMONDS6])){\n\t \t\t\t\t\tselectedCards[Rules.DIAMONDS6] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() > 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.DIAMONDS8])){\n\t \t\t\t\t\tselectedCards[Rules.DIAMONDS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\t\t \t\t\t\n\t \t\t\t\n\t \t\t\tbreak;\n\t \t\t\t\n\t \t\tcase Card.CLUBS:\n\t \t\t\t// Is it a seven, it can be played...\n\t \t\t\tif (card.GetValue() == 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS8])){\n\t \t\t\t\t\tselectedCards[Rules.CLUBS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\t \t\t\t\t\n\t \t\t\t}\n\t \t\t\t\n\t \t\t\tif (card.GetValue() < 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS6])){\n\t \t\t\t\t\tselectedCards[Rules.CLUBS6] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() > 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS8])){\n\t \t\t\t\t\tselectedCards[Rules.CLUBS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\t\t \t\t\t\n\t \t\t\tbreak;\n\t \t\t\t\n\t \t\tcase Card.SPADES:\n\t \t\t\t// Is it a seven, it can be played...\n\t \t\t\tif (card.GetValue() == 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.SPADES8])){\n\t \t\t\t\t\tselectedCards[Rules.SPADES8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\t \t\t\t\t\n\t \t\t\t}\n\t \t\t\t\n\t \t\t\tif (card.GetValue() < 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.SPADES6])){\n\t \t\t\t\t\tselectedCards[Rules.SPADES6] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() > 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.SPADES8])){\n\t \t\t\t\t\tselectedCards[Rules.SPADES8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\t \t\t\t\n\t \t\t\tbreak;\n\n\t \t\t\t\t \t\t\t\n\t \t\t}\n\t\n\t \t}\t\n\t \t\n\t \t// Now go through the selectable cards and see which is best to be played\n\t \tif (iNumSelectableCards == 0)\n\t \t\treturn ret;\n\t \t\n\t \tint iPos;\n\t \tcard = null;\n\t \tif (iNumSelectableCards == 1){\n\t\t\t \tfor (int i = 0; i < 8; i++)\n\t\t\t \t\tif (selectedCards[i] != null){\n\t\t\t \t\t\tcard = selectedCards[i];\n\t\t\t \t\t\tbreak;\n\t\t\t \t\t}\n\t\t\t \t\t\t \t\n\t \t}\n\t \telse {\n\t\t\t String sDifficulty = mRules.mView.GetSettings().getString(\"Difficulty\", \"0\");// 0 = hard, 1 = easy\n\t\t\t int iDifficulty = Integer.parseInt(sDifficulty);\n\t\t\t if (iDifficulty == EASY){\n\t\t\t \t// Get a random card from the playable ones\n\t\t\t\t\t Random generator = new Random();\n\t\t\t\t\t int randomIndex = generator.nextInt( iNumSelectableCards );\n\t\t\t\t\t int iCount = 0;\n\t\t\t\t\t \tfor (int i = 0; i < 8; i++){\n\t\t\t\t\t \t\tif (selectedCards[i] != null){\n\t\t\t\t\t \t\t\tif (iCount == randomIndex){\n\t\t\t\t\t \t\t\t\tcard = selectedCards[i];\n\t\t\t\t\t \t\t\t\tbreak;\n\t\t\t\t\t \t\t\t}\n\t\t\t\t\t \t\t\telse iCount++;\n\t\t\t\t\t \t\t}\t\n\t\t\t\t\t \t}\n\t\t\t }\n\t\t\t else {\n\t\t\t \tiPos = GetBestCard(selectedCards);\n\t\t\t \tcard = selectedCards[iPos];\n\t\t\t }\n\t \t}\n\t \t\n\t \tswitch (card.GetSuit()){\n \t\tcase Card.HEARTS:\t \t\n \t\t\tif (card.GetValue() == 7){\n \t\t\t\t// and must be played first\n \t\t\t\tplayableCards[Rules.HEARTS8] = new Card(8,Card.HEARTS);\n \t\t\t\tplayableCards[Rules.HEARTS6] = new Card(6,Card.HEARTS);\n \t\t\t\tplayableCards[Rules.CLUBS8] = new Card(7,Card.CLUBS);\n \t\t\t\tplayableCards[Rules.DIAMONDS8] = new Card(7,Card.DIAMONDS);\n \t\t\t\tplayableCards[Rules.SPADES8] = new Card(7,Card.SPADES);\n \n \t\t\t\treturn card;\n \t\t\t}\n \t\t\tif (card.GetValue() < 7){\n \t\t\t\tif (card.Equals(playableCards[Rules.HEARTS6])){\n \t\t\t\t\tplayableCards[Rules.HEARTS6] = new Card(card.GetValue()-1,Card.HEARTS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (card.GetValue() > 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.HEARTS8])){ \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.HEARTS8] = new Card(card.GetValue()+1,Card.HEARTS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\t \t\t\t\n \t\t\t\n \t\t\tbreak; \n \t\tcase Card.DIAMONDS:\n \t\t\t// Is it a seven, it can be played...\n \t\t\tif (card.GetValue() == 7){\n \t\t\t\tif (playableCards[Rules.HEARTS8] != null && playableCards[Rules.HEARTS8].GetValue() > 7){\n\t \t\t\t\tplayableCards[Rules.DIAMONDS8] = new Card(8,Card.DIAMONDS);\n\t \t\t\t\tplayableCards[Rules.DIAMONDS6] = new Card(6,Card.DIAMONDS);\t \t\t\t\t\t\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\tif (card.GetValue() < 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.DIAMONDS6])){\t \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.DIAMONDS6] = new Card(card.GetValue()-1,Card.DIAMONDS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (card.GetValue() > 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.DIAMONDS8])){\t \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.DIAMONDS8] = new Card(card.GetValue()+1,Card.DIAMONDS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\t\t \t\t\t\n \t\t\t\n \t\t\tbreak; \n \t\t\t\n \t\tcase Card.CLUBS:\n \t\t\t// Is it a seven, it can be played...\n \t\t\tif (card.GetValue() == 7){\n\n \t\t\t\tif (playableCards[Rules.HEARTS8] != null && playableCards[Rules.HEARTS8].GetValue() > 7){\n\t \t\t\t\tplayableCards[Rules.CLUBS8] = new Card(8,Card.CLUBS);\n\t \t\t\t\tplayableCards[Rules.CLUBS6] = new Card(6,Card.CLUBS);\t \t\t\t\t\t\n \t\t\t\t\treturn card;\n \t\t\t\t}\t \t\t\t\t\n \t\t\t}\n \t\t\t\n \t\t\tif (card.GetValue() < 7){\n \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS6])){\n \t\t\t\t\tplayableCards[Rules.CLUBS6] = new Card(card.GetValue()-1,Card.CLUBS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (card.GetValue() > 7){\n \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS8])){\n \t\t\t\t\tLog.i(\"\",\" Updating playable card \" + (card.GetValue()+1) + \" , \" +Card.CLUBS);\n \t\t\t\t\tplayableCards[Rules.CLUBS8] = new Card(card.GetValue()+1,Card.CLUBS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\t\t \t\t\t\n \t\t\tbreak; \n \t\tcase Card.SPADES:\n \t\t\t// Is it a seven, it can be played...\n \t\t\tif (card.GetValue() == 7){\n \t\t\t\tif (playableCards[Rules.HEARTS8] != null && playableCards[Rules.HEARTS8].GetValue() > 7){\n\t \t\t\t\tplayableCards[Rules.SPADES8] = new Card(8,Card.SPADES);\n\t \t\t\t\tplayableCards[Rules.SPADES6] = new Card(6,Card.SPADES);\t \t\t\t\t\t\n \t\t\t\t\treturn card;\n \t\t\t\t}\t \t\t\t\t\n \t\t\t}\n \t\t\t\n \t\t\tif (card.GetValue() < 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.SPADES6])){ \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.SPADES6] = new Card(card.GetValue()-1,Card.SPADES);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (card.GetValue() > 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.SPADES8])){\t \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.SPADES8] = new Card(card.GetValue()+1,Card.SPADES);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\t \t\t\t\n \t\t\tbreak;\n \t\t\t\n\t \t}\n\t \n\t }\n\t return ret;\n }", "private void setChanceCards()\n {\n m_chance.add(new Card(\"Advance to Go (Collect $200)\", 0, 1, 0));\n m_chance.add(new Card(\"Advance to Illinois Ave. If you pass Go, collect $200\", 0, 1, 24));\n m_chance.add(new Card(\"Income tax refund, Collect $20\", 20, 0));\n m_chance.add(new Card(\"Go directly to Jail. Do not pass Go, do not collect $200\", 0, 1, 30));\n m_chance.add(new Card(\"Advance token to Boardwalk\", 0, 1, 39));\n m_chance.add(new Card(\"Pay hospital fees of $100\", -100, 0));\n m_chance.add(new Card(\"Your building {and} loan matures, Collect $150\", 150, 0));\n m_chance.add(new Card(\"Pay poor tax of $15\", -15, 0));\n m_chance.add(new Card(\"Get out of Jail free card\", 0, 2));\n }", "public void stealResources(ArrayList<Player> listOfplayers) {\n\t\tint randomResourceNumber = 0;\n\t\trandomResourceNumber = RandomResourceValue(0);\n\t\tif (listOfplayers.size() == 1) {\n\t\t\tpickedPlayer = listOfplayers.get(0);\n\t\t\tpickedPlayer.resources[randomResourceNumber]--;\n\t\t\tCurrentPlayer.resources[randomResourceNumber]++;\n\t\t\tSystem.out.println(CurrentPlayer.getNickname() + \" stole one \"\n\t\t\t\t\t+ resourceBank.getResourceName(randomResourceNumber) + \" from \" + pickedPlayer);\n\t\t}\n\t\tif (listOfplayers.size() > 1) {\n\t\t\tfor (int i = 0; i < listOfplayers.size(); i++) {\n\t\t\t\trandomResourceNumber = RandomResourceValue(i);\n\t\t\t\tlistOfplayers.get(i).resources[randomResourceNumber]--;\n\t\t\t\tCurrentPlayer.resources[randomResourceNumber]++;\n\t\t\t\tSystem.out.println(\n\t\t\t\t\t\tCurrentPlayer.getNickname() + \" stole one \" + resourceBank.getResourceName(randomResourceNumber)\n\t\t\t\t\t\t\t\t+ \" from \" + listOfplayers.get(i).getNickname());\n\t\t\t}\n\t\t}\n\t}", "public ResourceCard giveUpResourceCard() throws Exception {\n\t\t return resourceCardHand.getRandomResourceCard();\n\t }", "@JsonIgnore\n\tpublic List<Card> getAvailableCards() {\n\t\tList<Card> availableCards = new ArrayList<>();\n\t\tfor (int i = dealtCards.get(); i < Deck.DECK_SIZE; i++) {\n\t\t\tCard card = cards.get(i);\n\t\t\tavailableCards.add(card);\n\t\t}\n\t\treturn availableCards;\n\t}", "private HashMap<String, Integer> getProducedResources() {\n HashMap<String, Integer> producedResources = new HashMap<>();\n\n // Ajoute à la liste des ressources produites par le joueur la ressource produite par la merveille\n producedResources.merge(wonder.getWonderResource().toString(), 1, Integer::sum);\n\n // Parcourt toutes les constructions afin de compte les ressources produites par les constructions\n for (Card card: buildings) {\n Iterator iterator = card.getProducedResources().entrySet().iterator();\n\n while (iterator.hasNext()) {\n Map.Entry pair = (Map.Entry)iterator.next();\n\n // Si la ressource produite n'est pas une pièce, on l'ajoute à la liste des ressources produites\n if (!pair.getKey().equals(\"COIN\")) {\n producedResources.merge((String)pair.getKey(), (Integer)pair.getValue(), Integer::sum);\n }\n\n iterator.remove();\n }\n }\n\n return producedResources;\n }", "public void printPermitCards(Player player);", "private PlayingCard chooseCard(HeartsGraphics g){\t\t\n\t\tHearts.setCurrentPlayer(this);\n\t\t\n\t\tif(number != PLAYER_ONE){\n\t\t\t// A.I. code\n\t\t\tint index;\n\t\t\t\n\t\t\tRandom r = new Random();\n\t\t\tindex = r.nextInt(hand.size());\t\t\t\n\t\t\t\n\t\t\treturn hand.get(index);\t\t\t\n\t\t} else {\n\t\t\treturn getCard(g);\n\t\t}\t\t\n\t}", "private void generateNewCards()\n {\n // Set the card sets to be drafted from.\n setsForDraft = new ArrayList<>();\n setsForDraft.add(M19_CARD_TABLE);\n\n // Generates sealed pool and places in openedCardPool.\n drawPacksFromSets();\n\n // Initialize a selectedCardPool that is empty, for the user to move cards into when desired.\n selectedCardPool = new ArrayList<>();\n }", "private void makeCards() {\n //make number cards(76 cards)\n for (int i = 0; i < 10; i++) {\n String s = i + \"\";\n cards.add(new NumberCard(s, Color.RED, i));\n cards.add(new NumberCard(s, Color.GREEN, i));\n cards.add(new NumberCard(s, Color.BLUE, i));\n cards.add(new NumberCard(s, Color.YELLOW, i));\n if(i > 0) {\n cards.add(new NumberCard(s, Color.RED, i));\n cards.add(new NumberCard(s, Color.GREEN, i));\n cards.add(new NumberCard(s, Color.BLUE, i));\n cards.add(new NumberCard(s, Color.YELLOW, i));\n }\n }\n\n //make wild cards(8 cards)⨁\n for (int i = 0; i < 4; i++) {\n cards.add(new WildCard(\"W\", Color.BLACK));\n cards.add(new WildDrawCard(\"W+4\", Color.BLACK));\n }\n\n //make reverse cards(8 cards)⤤⤦\n for (int i = 0; i < 2; i++) {\n cards.add(new ReverseCard(\"Rev\", Color.RED));\n cards.add(new ReverseCard(\"Rev\", Color.GREEN));\n cards.add(new ReverseCard(\"Rev\", Color.BLUE));\n cards.add(new ReverseCard(\"Rev\", Color.YELLOW));\n }\n\n //make draw cards(8 cards)⧉\n for (int i = 0; i < 2; i++) {\n cards.add(new Draw2Card(\"D+2\", Color.RED));\n cards.add(new Draw2Card(\"D+2\", Color.GREEN));\n cards.add(new Draw2Card(\"D+2\", Color.BLUE));\n cards.add(new Draw2Card(\"D+2\", Color.YELLOW));\n }\n\n //make skip cards(8 cards)🚫\n for (int i = 0; i < 2; i++) {\n cards.add(new SkipCard(\"Ski\", Color.RED));\n cards.add(new SkipCard(\"Ski\", Color.GREEN));\n cards.add(new SkipCard(\"Ski\", Color.BLUE));\n cards.add(new SkipCard(\"Ski\", Color.YELLOW));\n }\n //Shuffling cards list\n Collections.shuffle(cards);\n }", "@Override\r\n\tpublic int requestCard (ArrayList<Card> cardsAlreadyRequested) {\n\t\treturn (int)(Math.random() * 13);\r\n\t}", "public void printPoliticCards(Player player);", "public Image getCardPlayer3() {\n Random rand5 = new Random();\r\n randomNum5 = rand5.nextInt((52 - 1) + 1) + 1;\r\n Image p3 = new Image(\"/Images/cards/Card\" + randomNum5 + \".png\");\r\n return p3;\r\n }", "public DeckOfCards() {\n\n String faces[] = {\"Ace\", \"Deuce\", \"Three\", \"Four\", \"Five\", \"Six\", \"Seven\", \"Eight\", \"Nine\", \"Ten\", \"Jack\", \"Queen\", \"King\"};\n String suits[] = {\"Hearts\", \"Diamonds\", \"Clubs\", \"Spades\"};\n\n deck = new Card[NUMBER_OF_CARDS]; //create an array of card objects (52)\n currentCard = 0;\n randomNumbers = new Random();\n\n //Populate deck with card objects\n for(int count = 0; count < deck.length; count++){\n deck[count] = new Card(faces[count % 13], suits[count / 13]);\n //first 13 cards will be ace through king of hearts then ace though king of diamonds etc...\n\n }\n\n }", "public static List<Flashcard> generateStudySet() {\n\n Flashcard card1 = new Flashcard(\"ANT\", \n \"Another Neat Tool, a Java library for building Java projects\", 1); \n Flashcard card2 = new Flashcard(\"HTTP\", \"HyperText Transfer Protocol for \"\n + \"browser requests and server responses.\", 2); \n Flashcard card3 = new Flashcard(\"Servlet\", \"A Java class that handles \" \n + \"browser requests by sending responses with data.\", 2); \n Flashcard card4 = new Flashcard(\"JSP\", \"Java Server Page, server-compiled \" \n + \"webpages.\", 3);\n\n ArrayList<Flashcard> flashcards = new ArrayList<Flashcard>(); \n flashcards.add(card1);\n flashcards.add(card2);\n flashcards.add(card3);\n flashcards.add(card4);\n \n return flashcards; \n\n }", "public void getNewCards(int n) {\t\n\t\tif (n==0)\n\t\t\treturn;\n\t\tString cards = \"\";\n\t\tfor(int i=0; i<n; i++) {\n\t\t\tint val = (int)(Math.random() * 100 + 1);\n\t\t\tint nc = 0;\n\t\t\tString type = \"Common\";\n\t\t\tif (val <= 5) {\n\t\t\t\tnc++;\n\t\t\t\ttype = \"Legendary\";\n\t\t\t}\n\t\t\telse if(val<=20) {\n\t\t\t\tnc++;\n\t\t\t\ttype = \"Epic\";\n\t\t\t}\n\t\t\telse if(val<=50) {\n\t\t\t\tnc++;\n\t\t\t\ttype = \"Rare\";\n\t\t\t}\n\t\t\tif(i==n-1 && nc<1) {type = \"Rare\";}\n\t\t\tcards += ClientNetwork.getCardIDByRarityAddToUser(TitleScreen.UserID, type)+\"\\n\";\n\t\t}\n\t\tJOptionPane.showMessageDialog(null, \"You recieved the following cards from your pack:\\n\"+cards);\n\t}", "public int askWhatPoliticCards(List<PoliticCard> cards);", "public void loadPremiumPlayersPack(Context context) {\n PlayerDAO playerDAO = new PlayerDAO(context);\n ArrayList<PackOpenerPlayer> players = playerDAO.get81PlusRatedPlayers();\n\n Collections.shuffle(players);\n ArrayList<PackOpenerPlayer> tempPlayers = new ArrayList<>();\n int counter = 0;\n boolean higherRatedPlayerIncluded = false;\n while (tempPlayers.size() < 8) {\n if (players.get(counter).getRating() > 83) {\n if (!higherRatedPlayerIncluded) {\n tempPlayers.add(players.get(counter));\n higherRatedPlayerIncluded = true;\n }\n } else {\n tempPlayers.add(players.get(counter));\n }\n counter++;\n }\n Collections.sort(tempPlayers);\n packPlayers = new ArrayList<>(tempPlayers);\n }", "public void dealCards() {\n for(int i=0; i < 5; i++) { \n for(PokerPlayer player : players) {\n player.takeCard(deck.draw());\n }\n }\n }", "public int askWhatPermitCards(List<PermitCard> cards);", "boolean CanDiscardCards(Resources resources);", "private void pickCards() throws IOExceptionFromController {\n Deck deck = game.getDeck();\n try {\n if (playerControllers.get(0).getClient().chooseYesNo(\"Do you want to randomize the playable God Powers pool?\")) {\n deck.pickRandom(game.getPlayerNum());\n playerControllers.get(0).getClient().displayMessage(\"Picking cards...\");\n } else {\n ArrayList<Card> choices = playerControllers.get(0).getClient().chooseCards(deck.getCards(), game.getPlayerNum(), null);\n for (Card card : choices) {\n deck.pickCard(card);\n }\n }\n } catch (IOException | InterruptedException e) {\n throw new IOExceptionFromController(e, playerControllers.get(0));\n }\n ArrayList<Card> cardPool = deck.getPickedCards();\n ArrayList<Card> chosenCards = new ArrayList<Card>();\n for (int i = 0; i < game.getPlayerNum(); i++) {\n int j = (i == game.getPlayerNum() - 1) ? 0 : i + 1;\n Card chosenCard;\n try {\n chosenCard = playerControllers.get(j).getClient().chooseCards(cardPool, 1, chosenCards).get(0);\n } catch (IOException | InterruptedException e) {\n throw new IOExceptionFromController(e, playerControllers.get(j));\n }\n cardPool.remove(chosenCard);\n chosenCards.add(chosenCard);\n players.get(j).setGodCard(chosenCard);\n playerControllers.get(j).setGodController(chosenCard.getController());\n broadcastMessage((players.get(j).getId() + \" is \" + chosenCard.getGod() + \" (\" + players.get(j).getColor() + \")\\n\"));\n broadcastMessage(\"Picking cards...\");\n }\n }", "Card(String n, int ps[], int pr[], int y, ImageIcon i){\r\n\t\tname = n;\r\n\t\tprereqSkill = ps;\r\n\t\tprereqRoom = pr;\r\n\t\tyear = y;\r\n\t\timg = i;\r\n\t\tretCA = CardAction.NONE;\t\t\r\n\t}", "private void initializeDeck() {\r\n\t\t// Loop over the 4 card suits\r\n\t\tfor (Suit suit : Suit.values()) {\r\n\t\t\t// Loop over 13 card types\r\n\t\t\tfor (CardType value : CardType.values()) {\r\n\t\t\t\tcards.addCard(new Card(suit, value));\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public ArrayList<Card> getPlayableCards(Player p) {\n ArrayList<Card> playableCards;\n\t if (gameLogic.getLeadSuitCard() == null) {\n\t playableCards = p.getPlayableHand(null, gameLogic.getTrumpCard().getSuit());\n\t System.out.println(playableCards);\n\t System.out.println(\"Player's playable Cards: \" + p.getPlayableHand(null, gameLogic.getTrumpCard().getSuit()));\n\t } else {\n\t playableCards = p.getPlayableHand(gameLogic.getLeadSuitCard().getSuit(), gameLogic.getTrumpCard().getSuit());\n\t System.out.println(\"Player's playable Cards: \" + p.getPlayableHand(gameLogic.getLeadSuitCard().getSuit(),\n\t gameLogic.getTrumpCard().getSuit()));\n\t }\n\n\t return playableCards;\n\t}", "public Image getCardPlayer1() {\n Random rand = new Random();\r\n randomNum = rand.nextInt((52 - 1) + 1) + 1;\r\n Image p1 = new Image(\"/Images/cards/Card\" + randomNum + \".png\");\r\n return p1;\r\n }", "public void showNumberOfBooksInYear() {\n\tSystem.out.println(\"You have choose option 2\");\n\tSystem.out.println(\"Choose your year:\");\n\ttry {\n\t int choosenYear = sc.nextInt();\n\t int numOfBooks = logicTier.findNumberOfBooksInYear(choosenYear);\n\t System.out.println(\"The number of Book published in \"+choosenYear+\" is \"+numOfBooks);\n\t} catch (Exception e) {\n\t e.printStackTrace();\n\t}\n }", "private static void copyrightChoicesIntoContext(SessionState state, Context context)\n\t{\n\t\tboolean usingCreativeCommons = state.getAttribute(STATE_USING_CREATIVE_COMMONS) != null && state.getAttribute(STATE_USING_CREATIVE_COMMONS).equals(Boolean.TRUE.toString());\t\t\n\t\t\n\t\tif(usingCreativeCommons)\n\t\t{\n\t\t\t\n\t\t\tString ccOwnershipLabel = \"Who created this resource?\";\n\t\t\tList ccOwnershipList = new Vector();\n\t\t\tccOwnershipList.add(\"-- Select --\");\n\t\t\tccOwnershipList.add(\"I created this resource\");\n\t\t\tccOwnershipList.add(\"Someone else created this resource\");\n\t\t\t\n\t\t\tString ccMyGrantLabel = \"Terms of use\";\n\t\t\tList ccMyGrantOptions = new Vector();\n\t\t\tccMyGrantOptions.add(\"-- Select --\");\n\t\t\tccMyGrantOptions.add(\"Use my copyright\");\n\t\t\tccMyGrantOptions.add(\"Use Creative Commons License\");\n\t\t\tccMyGrantOptions.add(\"Use Public Domain Dedication\");\n\t\t\t\n\t\t\tString ccCommercialLabel = \"Allow commercial use?\";\n\t\t\tList ccCommercialList = new Vector();\n\t\t\tccCommercialList.add(\"Yes\");\n\t\t\tccCommercialList.add(\"No\");\n\t\t\t\n\t\t\tString ccModificationLabel = \"Allow Modifications?\";\n\t\t\tList ccModificationList = new Vector();\n\t\t\tccModificationList.add(\"Yes\");\n\t\t\tccModificationList.add(\"Yes, share alike\");\n\t\t\tccModificationList.add(\"No\");\n\t\t\t\n\t\t\tString ccOtherGrantLabel = \"Terms of use\";\n\t\t\tList ccOtherGrantList = new Vector();\n\t\t\tccOtherGrantList.add(\"Subject to fair-use exception\");\n\t\t\tccOtherGrantList.add(\"Public domain (created before copyright law applied)\");\n\t\t\tccOtherGrantList.add(\"Public domain (copyright has expired)\");\n\t\t\tccOtherGrantList.add(\"Public domain (government document not subject to copyright)\");\n\t\t\t\n\t\t\tString ccRightsYear = \"Year\";\n\t\t\tString ccRightsOwner = \"Copyright owner\";\n\t\t\t\n\t\t\tString ccAcknowledgeLabel = \"Require users to acknowledge author's rights before access?\";\n\t\t\tList ccAcknowledgeList = new Vector();\n\t\t\tccAcknowledgeList.add(\"Yes\");\n\t\t\tccAcknowledgeList.add(\"No\");\n\t\t\t\n\t\t\tString ccInfoUrl = \"\";\n\t\t\t\n\t\t\tint year = TimeService.newTime().breakdownLocal().getYear();\n\t\t\tString username = UserDirectoryService.getCurrentUser().getDisplayName(); \n\n\t\t\tcontext.put(\"usingCreativeCommons\", Boolean.TRUE);\n\t\t\tcontext.put(\"ccOwnershipLabel\", ccOwnershipLabel);\n\t\t\tcontext.put(\"ccOwnershipList\", ccOwnershipList);\n\t\t\tcontext.put(\"ccMyGrantLabel\", ccMyGrantLabel);\n\t\t\tcontext.put(\"ccMyGrantOptions\", ccMyGrantOptions);\n\t\t\tcontext.put(\"ccCommercialLabel\", ccCommercialLabel);\n\t\t\tcontext.put(\"ccCommercialList\", ccCommercialList);\n\t\t\tcontext.put(\"ccModificationLabel\", ccModificationLabel);\n\t\t\tcontext.put(\"ccModificationList\", ccModificationList);\n\t\t\tcontext.put(\"ccOtherGrantLabel\", ccOtherGrantLabel);\n\t\t\tcontext.put(\"ccOtherGrantList\", ccOtherGrantList);\n\t\t\tcontext.put(\"ccRightsYear\", ccRightsYear);\n\t\t\tcontext.put(\"ccRightsOwner\", ccRightsOwner);\n\t\t\tcontext.put(\"ccAcknowledgeLabel\", ccAcknowledgeLabel);\n\t\t\tcontext.put(\"ccAcknowledgeList\", ccAcknowledgeList);\n\t\t\tcontext.put(\"ccInfoUrl\", ccInfoUrl);\n\t\t\tcontext.put(\"ccThisYear\", Integer.toString(year));\n\t\t\tcontext.put(\"ccThisUser\", username);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//copyright\n\t\t\tif (state.getAttribute(COPYRIGHT_FAIRUSE_URL) != null)\n\t\t\t{\n\t\t\t\tcontext.put(\"fairuseurl\", state.getAttribute(COPYRIGHT_FAIRUSE_URL));\n\t\t\t}\n\t\t\tif (state.getAttribute(NEW_COPYRIGHT_INPUT) != null)\n\t\t\t{\n\t\t\t\tcontext.put(\"newcopyrightinput\", state.getAttribute(NEW_COPYRIGHT_INPUT));\n\t\t\t}\n\t\n\t\t\tif (state.getAttribute(COPYRIGHT_TYPES) != null)\n\t\t\t{\n\t\t\t\tList copyrightTypes = (List) state.getAttribute(COPYRIGHT_TYPES);\n\t\t\t\tcontext.put(\"copyrightTypes\", copyrightTypes);\n\t\t\t\tcontext.put(\"copyrightTypesSize\", new Integer(copyrightTypes.size() - 1));\n\t\t\t\tcontext.put(\"USE_THIS_COPYRIGHT\", copyrightTypes.get(copyrightTypes.size() - 1));\n\t\t\t}\n\t\t}\n\t\t\n\t\tBoolean preventPublicDisplay = (Boolean) state.getAttribute(STATE_PREVENT_PUBLIC_DISPLAY);\n\t\tif(preventPublicDisplay == null)\n\t\t{\n\t\t\tpreventPublicDisplay = Boolean.FALSE;\n\t\t\tstate.setAttribute(STATE_PREVENT_PUBLIC_DISPLAY, preventPublicDisplay);\n\t\t}\n\t\tcontext.put(\"preventPublicDisplay\", preventPublicDisplay);\n\t\t\n\t}", "private List<Map<String, String>> loadCredits() {\n\t\tfinal String[] creditsArray = this.getResources().getStringArray(\n\t\t\t\tR.array.credits);\n\t\tfinal Credits credits = new Credits(creditsArray);\n\t\treturn credits.getListCredits();\n\t}", "@Override\n protected void init() {\n ChanceCard card = new ChanceCard(\"Advance to Freas Hall (Collect $200)\", 0, 0, 0, \"none\", Card.CardType.MOVE_TO);\n deck.add(card);\n card = new ChanceCard(\"Go back 3 spaces\", 0, -3, 0, \"none\", Card.CardType.MOVE);\n deck.add(card);\n card = new ChanceCard(\"You got hungry at 2am in the morning and decided to buy Dominos. Pay $15\", -15, 0, 0, \"none\", Card.CardType.BANK_TRANSACTION);\n deck.add(card);\n card = new ChanceCard(\"You have won a crossword competition- Collect $100\", 100, 0, 0, \"none\", Card.CardType.BANK_TRANSACTION);\n deck.add(card);\n card = new ChanceCard(\"Make general repairs on all your property-For each house pay $25-For each hotel $100\", 0, 0, 0, \"none\", Card.CardType.STREET_REPAIRS);\n deck.add(card);\n card = new ChanceCard(\"Advance to Dana- If you pass Freas Hall, collect $200\", 0, 0, 24, \"none\", Card.CardType.MOVE_TO);\n deck.add(card);\n card = new ChanceCard(\"Advance to Larison- If you pass Freas Hall, collect $200\", 0, 0, 11, \"none\", Card.CardType.MOVE_TO);\n deck.add(card);\n card = new ChanceCard(\"You forget to do your project and are bailed out by your classmates. Pay each player $50\", 50, 0, 24, \"none\", Card.CardType.PLAYER_TRANSACTION);\n deck.add(card);\n card = new ChanceCard(\"You got first selection in the housing lottery. Advance to the Senior Apartments.\", 0, 0, 39, \"none\", Card.CardType.MOVE_TO);\n deck.add(card);\n card = new ChanceCard(\"Housing ran out of dorms to put you. Advance to Vedder. - If you pass Freas Hall, collect $200\", 0, 0, 1, \"none\", Card.CardType.MOVE_TO);\n deck.add(card);\n card = new ChanceCard(\"You got caught drinking in your dorm by P-Safe. Pay fee of $50\", -50, 0, 24, \"none\", Card.CardType.BANK_TRANSACTION);\n deck.add(card);\n card = new ChanceCard(\"You left your car on Moore Ave overnight and got a ticket. Pay fee of $20\", -20, 0, 24, \"none\", Card.CardType.BANK_TRANSACTION);\n deck.add(card);\n card = new ChanceCard(\"You got caught swiping someone else into the caf. Pay fee of $15\", -15, 0, 24, \"none\", Card.CardType.BANK_TRANSACTION);\n deck.add(card);\n card = new ChanceCard(\"Your mom sent you a care package. Advance 2 spaces.\", 0, 2, 24, \"none\", Card.CardType.MOVE);\n deck.add(card);\n card = new ChanceCard(\"Facilities found mold in your air conditioning unit. Pay fee of $30\", -30, 0, 24, \"none\", Card.CardType.BANK_TRANSACTION);\n deck.add(card);\n card = new ChanceCard(\"You got the internship you applied for! Collect $200.\", 200, 0, 24, \"none\", Card.CardType.BANK_TRANSACTION);\n deck.add(card);\n\n shuffle();\n }", "void getArrangedDeck() {\n\t\t\t\t\n\t\tint strength = 1;\n\t\t\n\t\tfor(int index = 0; index < this.numberOfCards; index++) {\n\n\t\t\tif((index+1)%4==0) {\n\t\t\t\tthis.cardsInDeck[index].setColor('\\u2660');\n\t\t\t} else {\n\t\t\t\tif((index+2)%4==0) {\n\t\t\t\t\tthis.cardsInDeck[index].setColor('\\u2665');\n\t\t\t\t} else {\n\t\t\t\t\tif((index+3)%4==0) {\n\t\t\t\t\t\tthis.cardsInDeck[index].setColor('\\u2666');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.cardsInDeck[index].setColor('\\u2663');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tthis.cardsInDeck[index].setStrength(strength);\n\t\t\tif((index+1) % 4 == 0){\n\t\t\t\tstrength++;\n\t\t\t}\n\t\t\t\n\t\t\tif (index >= 0 && index <= 3) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"2\");\n\t\t\t}\n\t\t\tif (index >= 4 && index <= 7) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"3\");\n\t\t\t}\n\t\t\tif (index >= 8 && index <= 11) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"4\");\n\t\t\t}\n\t\t\tif (index >= 12 && index <= 15) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"5\");\n\t\t\t}\n\t\t\tif (index >= 16 && index <= 19) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"6\");\n\t\t\t}\n\t\t\tif (index >= 20 && index <= 23) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"7\");\n\t\t\t}\n\t\t\tif (index >= 24 && index <= 27) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"8\");\n\t\t\t}\n\t\t\tif (index >= 28 && index <= 31) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"9\");\n\t\t\t}\n\t\t\tif (index >= 32 && index <= 35) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"10\");\n\t\t\t}\n\t\t\tif (index >= 36 && index <= 39) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"J\");\n\t\t\t}\n\t\t\tif (index >= 40 && index <= 43) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"Q\");\n\t\t\t}\n\t\t\tif (index >= 44 && index <= 47) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"K\");\n\t\t\t}\n\t\t\tif (index >= 48 && index <= 51) {\n\t\t\t\tthis.cardsInDeck[index].setName(\"A\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "public PileOfCards(int numCards) {\n descriptors = CardFactory.getDescriptorKeySet();\n pile = new ArrayList<Card>(numCards);\n for(int i = 0; i < numCards; i++)\n pile.add(CardFactory.drawCard());\n }", "private void initializeProgressCards() {\n\t\tprogressCardOccurences.put(ProgressCardType.ALCHEMIST, 2);\n\t\tprogressCardKind.put(ProgressCardType.ALCHEMIST, ProgressCardKind.SCIENCE);\n\n\t\tprogressCardOccurences.put(ProgressCardType.BISHOP, 2);\n\t\tprogressCardKind.put(ProgressCardType.BISHOP, ProgressCardKind.POLITICS);\n\n\t\tprogressCardOccurences.put(ProgressCardType.COMMERCIALHARBOUR, 2);\n\t\tprogressCardKind.put(ProgressCardType.COMMERCIALHARBOUR, ProgressCardKind.TRADE);\n\n\t\tprogressCardOccurences.put(ProgressCardType.CONSTITUTION, 1);\n\t\tprogressCardKind.put(ProgressCardType.CONSTITUTION, ProgressCardKind.POLITICS);\n\n\t\tprogressCardOccurences.put(ProgressCardType.CRANE, 2);\n\t\tprogressCardKind.put(ProgressCardType.CRANE, ProgressCardKind.SCIENCE);\n\n\t\tprogressCardOccurences.put(ProgressCardType.DESERTER, 2);\n\t\tprogressCardKind.put(ProgressCardType.DESERTER, ProgressCardKind.POLITICS);\n\n\t\tprogressCardOccurences.put(ProgressCardType.DIPLOMAT, 2);\n\t\tprogressCardKind.put(ProgressCardType.DIPLOMAT, ProgressCardKind.POLITICS);\n\n\t\tprogressCardOccurences.put(ProgressCardType.ENGINEER, 1);\n\t\tprogressCardKind.put(ProgressCardType.ENGINEER, ProgressCardKind.SCIENCE);\n\n\t\tprogressCardOccurences.put(ProgressCardType.INTRIGUE, 2);\n\t\tprogressCardKind.put(ProgressCardType.INTRIGUE, ProgressCardKind.POLITICS);\n\n\t\tprogressCardOccurences.put(ProgressCardType.INVENTOR, 2);\n\t\tprogressCardKind.put(ProgressCardType.INVENTOR, ProgressCardKind.SCIENCE);\n\n\t\tprogressCardOccurences.put(ProgressCardType.IRRIGATION, 2);\n\t\tprogressCardKind.put(ProgressCardType.IRRIGATION, ProgressCardKind.SCIENCE);\n\n\t\tprogressCardOccurences.put(ProgressCardType.MASTERMERCHANT, 2);\n\t\tprogressCardKind.put(ProgressCardType.MASTERMERCHANT, ProgressCardKind.TRADE);\n\n\t\tprogressCardOccurences.put(ProgressCardType.MEDICINE, 2);\n\t\tprogressCardKind.put(ProgressCardType.MEDICINE, ProgressCardKind.SCIENCE);\n\n\t\tprogressCardOccurences.put(ProgressCardType.MERCHANTFLEET, 2);\n\t\tprogressCardOccurences.put(ProgressCardType.MINING, 2);\n\t\tprogressCardKind.put(ProgressCardType.MINING, ProgressCardKind.SCIENCE);\n\n\t\tprogressCardOccurences.put(ProgressCardType.PRINTER, 1);\n\t\tprogressCardKind.put(ProgressCardType.PRINTER, ProgressCardKind.SCIENCE);\n\n\t\tprogressCardOccurences.put(ProgressCardType.RESOURCEMONOPOLY, 4);\n\t\tprogressCardKind.put(ProgressCardType.RESOURCEMONOPOLY, ProgressCardKind.TRADE);\n\n\t\tprogressCardOccurences.put(ProgressCardType.ROADBUILDING, 2);\n\t\tprogressCardKind.put(ProgressCardType.ROADBUILDING, ProgressCardKind.SCIENCE);\n\n\t\tprogressCardOccurences.put(ProgressCardType.SABOTEUR, 2);\n\t\tprogressCardKind.put(ProgressCardType.SABOTEUR, ProgressCardKind.POLITICS);\n\n\t\tprogressCardOccurences.put(ProgressCardType.SMITH, 2);\n\t\tprogressCardKind.put(ProgressCardType.SMITH, ProgressCardKind.SCIENCE);\n\n\t\tprogressCardOccurences.put(ProgressCardType.SPY, 3);\n\t\tprogressCardKind.put(ProgressCardType.SPY, ProgressCardKind.POLITICS);\n\n\t\tprogressCardOccurences.put(ProgressCardType.TRADEMONOPOLY, 2);\n\t\tprogressCardKind.put(ProgressCardType.TRADEMONOPOLY, ProgressCardKind.TRADE);\n\n\t\tprogressCardOccurences.put(ProgressCardType.WARLORD, 2);\n\t\tprogressCardKind.put(ProgressCardType.WARLORD, ProgressCardKind.POLITICS);\n\n\t\tprogressCardOccurences.put(ProgressCardType.WEDDING, 2);\n\t\tprogressCardKind.put(ProgressCardType.WEDDING, ProgressCardKind.POLITICS);\n\n\t\tprogressCardOccurences.put(ProgressCardType.MERCHANT, 6);\n\t\tprogressCardKind.put(ProgressCardType.MERCHANT, ProgressCardKind.TRADE);\n\t}", "public Boolean hasCards(Map<ResourceType, Integer> resourceList) {\n\t\tif (resourceList == null)\n\t\t\treturn false;\n\t\t//System.out.println(\"resourceList is not Null\");\n\t\tInteger wood = resourceList.get(ResourceType.WOOD);\n\t\tInteger brick = resourceList.get(ResourceType.BRICK);\n\t\tInteger sheep = resourceList.get(ResourceType.SHEEP);\n\t\tInteger wheat = resourceList.get(ResourceType.WHEAT);\n\t\tInteger ore = resourceList.get(ResourceType.ORE);\n\t\tif (wood != null)\n\t\t\tif (getWood() < wood)\n\t\t\t\treturn false;\n\t\t//System.out.println(\"there is enough wood\");\n\t\tif (brick != null)\n\t\t\tif (getBrick() < brick)\n\t\t\t\treturn false;\n\t\t//System.out.println(\"there is enough brick\");\n\t\tif (sheep != null)\n\t\t\tif (getSheep() < sheep)\n\t\t\t\treturn false;\n\t\t//System.out.println(\"there is enough sheep\");\n\t\tif (wheat != null)\n\t\t\tif (getWheat() < wheat)\n\t\t\t\treturn false;\n\t\t//System.out.println(\"there is enough wheat\");\n\t\tif (ore != null)\n\t\t\tif (getOre() < ore)\n\t\t\t\treturn false;\n\t\t//System.out.println(\"there is enough ore\");\n\t\treturn true;\n\t}", "public int getVictoryCards() {\n \t\treturn victory;\n \t}", "public List<ScheduleResource> neededSpecificResources();", "private void communityChest(Player currentPlayer){\n Random rand = new Random();\n int randomNum = rand.nextInt((3 - 1) + 1) + 1;\n int nextPlayer;\n if(m_currentTurn >= m_numPlayers){\n nextPlayer = 0;\n } else {\n nextPlayer = m_currentTurn+1;\n }\n\n if(randomNum == 1){\n convertTextToSpeech(\"Your new business takes off, collect 200\");\n if(m_manageFunds) {\n Log.d(\"chance add 200\", currentPlayer.getName() +\n String.valueOf(currentPlayer.getMoney()));\n currentPlayer.addMoney(200);\n funds.setText(String.valueOf(currentPlayer.getMoney()));\n Log.d(\"chance add 200\", currentPlayer.getName() +\n String.valueOf(currentPlayer.getMoney()));\n }\n }\n if(randomNum == 2){\n convertTextToSpeech(\"Your friend hires your villa for a week, \" +\n \"collect 100 off the next player\");\n if(m_manageFunds) {\n Log.d(\"chance add 100\", currentPlayer.getName() +\n String.valueOf(currentPlayer.getMoney()));\n currentPlayer.addMoney(100);\n funds.setText(String.valueOf(currentPlayer.getMoney()));\n Log.d(\"chance add 100\", currentPlayer.getName() +\n String.valueOf(currentPlayer.getMoney()));\n\n Log.d(\"chance subtract 100\", players.get(nextPlayer).getName() +\n String.valueOf(players.get(nextPlayer).getMoney()));\n players.get(nextPlayer).subtractMoney(100);\n Log.d(\"chance subtract 100\", players.get(nextPlayer).getName() +\n String.valueOf(players.get(nextPlayer).getMoney()));\n }\n }\n if(randomNum == 3){\n convertTextToSpeech(\"You receive a tax rebate, collect 300\");\n if(m_manageFunds) {\n Log.d(\"chance add 300\", currentPlayer.getName() +\n String.valueOf(currentPlayer.getMoney()));\n currentPlayer.addMoney(300);\n funds.setText(String.valueOf(currentPlayer.getMoney()));\n Log.d(\"chance add 300\", currentPlayer.getName() +\n String.valueOf(currentPlayer.getMoney()));\n }\n }\n }", "private void setCommunityChestCards()\n {\n m_communityChest.add(new Card(\"Advance to St. Charles Place If you pass Go, collect $200\", 0, 1, 11));\n m_communityChest.add(new Card(\"Bank error in your favor, Collect $200\", 200, 0));\n m_communityChest.add(new Card(\"Doctor's fees Pay $50\", -50, 0));\n m_communityChest.add(new Card(\"Get out of Jail free card\", 0, 2));\n m_communityChest.add(new Card(\"Go directly to Jail. Do not pass Go, do not collect $200\", 0, 1, 30));\n m_communityChest.add(new Card(\"Advance token to Reading Railroad\", 0, 1, 5));\n m_communityChest.add(new Card(\"Life insurance matures, Collect $100 \", 100, 0));\n m_communityChest.add(new Card(\"You won second prize in a Beauty contest, Collect $10\", 10, 0));\n m_communityChest.add(new Card(\"From sale of stock you get $50\", 50, 0));\n m_communityChest.add(new Card(\"You have won a crossword competition, Collect $100\", 100, 0));\n }", "public Image getCardPlayer2() {\n Random rand1 = new Random();\r\n randomNum1 = rand1.nextInt((52 - 1) + 1) + 1;\r\n Image p2 = new Image(\"/Images/cards/Card\" + randomNum1 + \".png\");\r\n return p2;\r\n }", "private void initCards() {\n\t\tArrayList<Card> cardsChart = new ArrayList<Card>();\n\t\tCard card = init_info_card(tmp.getFull(), tmp.getStatus(), tmp.getDue_date());\n\t\tcardsChart.add(card);\n\t\tcard = init_fulfilled_card();\n\t\tcardsChart.add(card);\n\t\tcard = init_proof_card();\n\t\tcardsChart.add(card);\n\t\tcard = init_chart_detail_card();\n\t\tcardsChart.add(card);\n\t\t\n\t\t/*for (int i = 0; i < 5; i++) {\n\t\t\tcard = init_chart_card();\n\t\t\tcardsChart.add(card);\n\t\t}*/\n\t\tCardArrayAdapter mCardArrayAdapterGrades = new CardArrayAdapter(getActivity(), cardsChart);\n\n\t\tCardListView listView = (CardListView) getActivity().findViewById(R.id.card_list);\n\t\tif (listView != null) {\n\t\t\tlistView.setAdapter(mCardArrayAdapterGrades);\n\t\t}\n\t}", "public void loadRarePlayersPack(Context context) {\n PlayerDAO playerDAO = new PlayerDAO(context);\n ArrayList<PackOpenerPlayer> players = playerDAO.getRarePlayers();\n\n Collections.shuffle(players);\n ArrayList<PackOpenerPlayer> tempPlayers = new ArrayList<>();\n int counter = 0;\n boolean higherRatedPlayerIncluded = false;\n while (tempPlayers.size() < 9) {\n if (players.get(counter).getRating() > 83) {\n if (!higherRatedPlayerIncluded) {\n tempPlayers.add(players.get(counter));\n higherRatedPlayerIncluded = true;\n }\n } else {\n tempPlayers.add(players.get(counter));\n }\n counter++;\n }\n Collections.sort(tempPlayers);\n packPlayers = new ArrayList<>(tempPlayers);\n }", "public static void cardsPlayer(int player){\n System.out.println(\"Player has cards as below\");\n for(int i=0;i<player;i++){\n System.out.println(\"the player has cards\"+i);\n shuffleCards(arrayList,player);\n }\n }", "public static void iterateJackpot() {\r\n for (int i = 0; i < LOTTERY_JACKPOT; i++) {\r\n int years = iteration(i+1);\r\n\r\n if(i+1 == LOTTERY_JACKPOT && years > 120) {\r\n System.out.println(\"You won!\");\r\n System.out.println(\"Althought it took more than a lifetime, let's try it again.\");\r\n i = -1;\r\n } else if(i+1 == LOTTERY_JACKPOT && years < 120) {\r\n System.out.println(\"You wont the jackpot in under 120 years.\");\r\n }\r\n }\r\n }", "public void loadPrimePlayersPack(Context context) {\n PlayerDAO playerDAO = new PlayerDAO(context);\n ArrayList<PackOpenerPlayer> players = playerDAO.get82PlusRatedPlayers();\n Collections.shuffle(players);\n ArrayList<PackOpenerPlayer> tempPlayers = new ArrayList<>();\n int counter = 0;\n boolean higherRatedPlayerIncluded = false;\n while (tempPlayers.size() < 8) {\n if (players.get(counter).getRating() > 83) {\n if (!higherRatedPlayerIncluded) {\n tempPlayers.add(players.get(counter));\n higherRatedPlayerIncluded = true;\n }\n } else {\n tempPlayers.add(players.get(counter));\n }\n counter++;\n }\n Collections.sort(tempPlayers);\n packPlayers = new ArrayList<>(tempPlayers);\n }", "public ResourceCard[] preparePlayerTrade(ResourceType resourceType, int amount) throws Exception {\n\t\treturn resourceCardHand.prepareCardTrade(resourceType, amount);\n\t}", "public List<Resource> getAvailableResources();", "public void playCard(int player, int card) {\n }", "@Test\r\n public void testHasAtLeastTwoPlayableCards() {\n Player player2 = new Player(\"Three Playable Cards Test\", true);\r\n Hand threePlayableCardsHand = strategyHand;\r\n player2.setHand(threePlayableCardsHand.getAllCards());\r\n\r\n // Make it harder to find playable cards:\r\n player2.getHand().discard(new Card(Card.COLORLESS, Card.WILD, cvm));\r\n player2.getHand().discard(new Card(Card.COLORLESS, Card.WILD_DRAW_FOUR, cvm));\r\n\r\n Card currentPlayedCard_1 = new Card(Card.YELLOW, Card.ONE, cvm);\r\n assertTrue(player2.hasAtLeastTwoPlayableCards(currentPlayedCard_1, Card.BLUE));\r\n\r\n Card currentPlayedCard_2 = new Card(Card.BLUE, Card.SEVEN, cvm);\r\n assertFalse(player2.hasAtLeastTwoPlayableCards(currentPlayedCard_2, Card.BLUE));\r\n }", "@Override\n public List<CardCollection.Item> openPackage() {\n List<CardCollection.Item> result = new LinkedList<CardCollection.Item>();\n addRandomPremiereCard(result, 3);\n addRandomJabbasPalaceCard(result, 3);\n addRandomFoilCard(result, 1);\n addRandomCloudCityCard(result, 3);\n addRandomReflectionsIICards(result);\n addRandomANewHopeOrHothCard(result, 1);\n addRandomSpecialEditionCard(result, 3);\n addRandomPremiereCard(result, 2);\n return result;\n }", "public static String chooseCardsFromCollection() {\n System.out.println(\"Please select the pokemons you want. By their number and separated by a - (a dash).\");\n System.out.println(\"Ex : 1-6-23-3-87-34...\");\n System.out.println(\"NB: Only 60 ! No more, no less ;) \");\n return keyboardChoice.nextLine();\n }", "private void addRandomFoilCard(List<CardCollection.Item> result, int count) {\n List<String> possibleCards = new ArrayList<String>();\n\n // Very Rare foils\n for (int i=0; i<3; ++i) {\n possibleCards.add(\"9_94\"); // Fighters Coming In\n possibleCards.add(\"7_168\"); // Boelo\n possibleCards.add(\"106_11\"); // Chall Bekan\n possibleCards.add(\"8_94\"); // Commander Igar\n possibleCards.add(\"9_110\"); // Janus Greejatus\n possibleCards.add(\"9_118\"); // Myn Kyneugh\n possibleCards.add(\"9_120\"); // Sim Aloo\n possibleCards.add(\"4_116\"); // Bad Feeling Have I\n possibleCards.add(\"1_222\"); // Lateral Damage\n possibleCards.add(\"6_149\"); // Scum And Villainy\n possibleCards.add(\"7_241\"); // Sienar Fleet Systems\n possibleCards.add(\"101_6\"); // Vader's Obsession\n possibleCards.add(\"9_147\"); // Death Star II: Throne Room\n possibleCards.add(\"4_161\"); // Executor: Holotheatre\n possibleCards.add(\"4_163\"); // Executor: Meditation Chamber\n possibleCards.add(\"3_150\"); // Hoth: Wampa Cave\n possibleCards.add(\"2_147\"); // Kiffex (Dark)\n possibleCards.add(\"106_10\"); // Black Squadron TIE\n possibleCards.add(\"110_8\"); // IG-88 In IG-2000\n possibleCards.add(\"106_1\"); // Arleil Schous\n possibleCards.add(\"7_44\"); // Tawss Khaa\n possibleCards.add(\"5_23\"); // Frozen Assets\n possibleCards.add(\"7_62\"); // Goo Nee Tay\n possibleCards.add(\"1_55\"); // Mantellian Savrip\n possibleCards.add(\"4_30\"); // Order To Engage\n possibleCards.add(\"101_3\"); // Run Luke, Run!\n possibleCards.add(\"104_2\"); // Lone Rogue\n possibleCards.add(\"6_83\"); // Kiffex (Light)\n possibleCards.add(\"9_64\"); // Blue Squadron B-wing\n possibleCards.add(\"103_1\"); // Gold Leader In Gold 1\n possibleCards.add(\"9_73\"); // Green Squadron A-wing\n possibleCards.add(\"9_76\"); // Liberty\n possibleCards.add(\"103_2\"); // Red Leader In Red 1\n possibleCards.add(\"106_9\"); // Z-95 Headhunter\n }\n\n // Super Rare foils\n for (int i=0; i<2; ++i) {\n possibleCards.add(\"109_6\"); // 4-LOM With Concussion Rifle\n possibleCards.add(\"9_98\"); // Admiral Piett\n possibleCards.add(\"9_99\"); // Baron Soontir Fel\n possibleCards.add(\"110_5\"); // Bossk With Mortar Gun\n possibleCards.add(\"108_6\"); // Darth Vader With Lightsaber\n possibleCards.add(\"110_7\"); // Dengar With Blaster Carbine\n possibleCards.add(\"1_171\"); // Djas Puhr\n possibleCards.add(\"109_11\"); // IG-88 With Riot Gun\n possibleCards.add(\"110_9\"); // Jodo Kast\n possibleCards.add(\"9_117\"); // Moff Jerjerrod\n possibleCards.add(\"7_195\"); // Outer Rim Scout\n possibleCards.add(\"9_136\"); // Force Lightning\n possibleCards.add(\"3_138\"); // Trample\n possibleCards.add(\"104_7\"); // Walker Garrison\n possibleCards.add(\"2_143\"); // Death Star\n possibleCards.add(\"9_142\"); // Death Star II\n possibleCards.add(\"109_8\"); // Boba Fett In Slave I\n possibleCards.add(\"9_154\"); // Chimaera\n possibleCards.add(\"109_10\"); // Dengar In Punishing One\n possibleCards.add(\"106_13\"); // Dreadnaught-Class Heavy Cruiser\n possibleCards.add(\"9_157\"); // Flagship Executor\n possibleCards.add(\"9_172\"); // The Emperor's Shield\n possibleCards.add(\"9_173\"); // The Emperor's Sword\n possibleCards.add(\"110_12\"); // Zuckuss In Mist Hunter\n possibleCards.add(\"104_5\"); // Imperial Walker\n possibleCards.add(\"8_172\"); // Tempest Scout 1\n possibleCards.add(\"9_178\"); // Darth Vader's Lightsaber\n possibleCards.add(\"110_11\"); // Mara Jade's Lightsaber\n possibleCards.add(\"9_1\"); // Capital Support\n possibleCards.add(\"9_6\"); // Admiral Ackbar\n possibleCards.add(\"2_2\"); // Brainiac\n possibleCards.add(\"109_1\"); // Chewie With Blaster Rifle\n possibleCards.add(\"8_3\"); // Chief Chirpa\n possibleCards.add(\"9_13\"); // General Calrissian\n possibleCards.add(\"8_14\"); // General Crix Madine\n possibleCards.add(\"1_15\"); // Kal'Falnl C'ndros\n possibleCards.add(\"102_3\"); // Leia\n possibleCards.add(\"108_3\"); // Luke With Lightsaber\n possibleCards.add(\"7_32\"); // Melas\n possibleCards.add(\"8_23\"); // Orrimaarko\n possibleCards.add(\"110_3\"); // See-Threepio\n possibleCards.add(\"9_31\"); // Wedge Antilles, Red Squadron Leader\n possibleCards.add(\"8_32\"); // Wicket\n possibleCards.add(\"3_32\"); // Bacta Tank\n possibleCards.add(\"3_34\"); // Echo Base Operations\n possibleCards.add(\"1_52\"); // Kessel Run\n possibleCards.add(\"1_76\"); // Don't Get Cocky\n possibleCards.add(\"1_82\"); // Gift Of The Mentor\n possibleCards.add(\"5_69\"); // Smoke Screen\n possibleCards.add(\"1_138\"); // Yavin 4: Massassi Throne Room\n possibleCards.add(\"111_2\"); // Artoo-Detoo In Red 5\n possibleCards.add(\"9_65\"); // B-wing Attack Squadron\n possibleCards.add(\"9_68\"); // Gold Squadron 1\n possibleCards.add(\"106_4\"); // Gold Squadron Y-wing\n possibleCards.add(\"9_74\"); // Home One\n possibleCards.add(\"9_75\"); // Independence\n possibleCards.add(\"109_2\"); // Lando In Millennium Falcon\n possibleCards.add(\"9_81\"); // Red Squadron 1\n possibleCards.add(\"106_7\"); // Red Squadron X-wing\n possibleCards.add(\"7_150\"); // X-wing Assault Squadron\n possibleCards.add(\"104_3\"); // Rebel Snowspeeder\n possibleCards.add(\"9_90\"); // Luke's Lightsaber\n }\n\n // Ultra Rare foils\n for (int i=0; i<1; ++i) {\n possibleCards.add(\"9_109\"); // Emperor Palpatine\n possibleCards.add(\"9_113\"); // Lord Vader\n possibleCards.add(\"110_10\"); // Mara Jade, The Emperor's Hand\n possibleCards.add(\"9_24\"); // Luke Skywalker, Jedi Knight\n }\n\n filterNonExistingCards(possibleCards);\n Collections.shuffle(possibleCards, _random);\n addCards(result, possibleCards.subList(0, Math.min(possibleCards.size(), count)), true);\n }", "public void start(){\n\t\tterritoryCardsReader.readCards(1,cards);\n\t\tterritoryCardsReader.readCards(2,cards);\n\t\tterritoryCardsReader.readCards(3,cards);\n\t\t\n\t\tbuildingCardsReader.readCards(1, cards);\n\t\tbuildingCardsReader.readCards(2, cards);\n\t\tbuildingCardsReader.readCards(3, cards);\n\t\t\n\t\tcharacterCardsReader.readCards(1, cards);\n\t\tcharacterCardsReader.readCards(2, cards);\n\t\tcharacterCardsReader.readCards(3, cards);\n\t\t\n\t\tventureCardsReader.readCards(1, cards);\n\t\tventureCardsReader.readCards(2, cards);\n\t\tventureCardsReader.readCards(3, cards);\n\t\t\n\t\tleaderCardsReader.readCards(cards);\n\t\t\n\t\tboardResourcesAndStartingPlayerResourcesReader.readResources(bonus);\n\t\tboardResourcesAndStartingPlayerResourcesReader.readStartingPlayerResources(bonus);\n\t\tboardResourcesAndStartingPlayerResourcesReader.readFaithTrack(bonus);\n\t\tboardResourcesAndStartingPlayerResourcesReader.readPersonalBoardTiles(bonus, \"advanced\");\n\t\tboardResourcesAndStartingPlayerResourcesReader.readTimers(timer);\n\t\t\n\t\texcommunicationTilesReader.readCards(1, cards);\n\t\texcommunicationTilesReader.readCards(2, cards);\n\t\texcommunicationTilesReader.readCards(3, cards);\n\t\t\n\t\t\n\t}", "public Player playGame() {\r\n\r\n\t\tfor(int season = 0; season < 4; season++) {\r\n\r\n\t\t\t//deal out cards\r\n\t\t\tfor(int i = 0; i < state.dealAmounts[season]; i++) {\r\n\t\t\t\tfor(Player p : players) {\r\n\t\t\t\t\tp.deal(state.drawCard());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//debug\r\n\t\t\t//show money amounts\r\n\t\t\tfor(Player p : players) {\r\n\t\t\t\tif(debugPrinting)\r\n\t\t\t\tSystem.out.println(p.name + \" : \" + p.getMoney());\r\n\t\t\t}\r\n\r\n\t\t\tstate.resetSeason();\r\n\r\n\t\t\tfor(int turn = 0; true; turn = (turn+1)%players.length) {\r\n\t\t\t\t//have a player play a card\r\n\t\t\t\tCard card = players[turn].chooseCard();\r\n\t\t\t\tCard second = null;\r\n\t\t\t\t\r\n\t\t\t\t//TODO this should be fixed to include if no players have cards\r\n\t\t\t\tif(card == null) {\r\n\t\t\t\t\tint hasHands = 0;\r\n\t\t\t\t\tfor(Player p : players) {\r\n\t\t\t\t\t\tif(p.getHand().size() != 0) {\r\n\t\t\t\t\t\t\thasHands++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//if no players have anything in their hand\r\n\t\t\t\t\tif(hasHands == 0) {\r\n\t\t\t\t\t\tendSeason();\r\n\t\t\t\t\t\tbreak;//break out of the season\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tint secondPlayer = -1;\r\n\r\n\t\t\t\tif(card.getAuctionType() == AuctionType.DOUBLE) {\r\n\t\t\t\t\tsecond = card;\r\n\t\t\t\t\tcard = players[turn].chooseSecondCard(second.getArtist());\r\n\r\n\t\t\t\t\tif(card == null) {\r\n\t\t\t\t\t\tfor(int i = 0; i < players.length-1 && card == null; i++) {\r\n\t\t\t\t\t\t\tcard = players[(turn+i)%players.length].chooseSecondCard(second.getArtist());\r\n\t\t\t\t\t\t\tsecondPlayer = (turn+i)%players.length;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(card == null) {\r\n\t\t\t\t\t\t\tcard = second;\r\n\t\t\t\t\t\t\tsecond = null;\r\n\t\t\t\t\t\t\tsecondPlayer = -1;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t//card(s) selected\r\n\r\n\t\t\t\t//let the GameState know\r\n\t\t\t\tstate.sell(card.getArtist(), second != null);\r\n\r\n\t\t\t\t//check to see if the season has ended\r\n\t\t\t\t//System.out.println(state.seasonEnded());\r\n\t\t\t\tif(state.seasonEnded()) {\r\n\t\t\t\t\tendSeason();\r\n\t\t\t\t\tbreak;//this break will break out of the season\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//announce card(s)\r\n\t\t\t\tfor(Player p : players) {\r\n\t\t\t\t\tp.announceCard(card, !(second == null));\r\n\t\t\t\t}\r\n\t\t\t\tif(debugPrinting)\r\n\t\t\t\tSystem.out.println(\"Player : \" + players[turn].name + \" :: \" + card + \" :: \" + second);\r\n\r\n\t\t\t\t//card(s) are ready for auction\r\n\t\t\t\tBid winningBid = null;\r\n\t\t\t\tif(card.getAuctionType() == AuctionType.FIXED_PRICE) {\r\n\t\t\t\t\twinningBid = fixedPrice(turn, players[turn].getFixedPrice());\r\n\t\t\t\t} else if(card.getAuctionType() == AuctionType.ONCE_AROUND) {\r\n\t\t\t\t\twinningBid = onceAround(turn);\r\n\t\t\t\t} else if(card.getAuctionType() == AuctionType.SEALED) {\r\n\t\t\t\t\twinningBid = sealed(turn);\r\n\t\t\t\t} else {\r\n\t\t\t\t\twinningBid = standardBidding(turn);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//let everybody know who won the auction\r\n\t\t\t\tfor(Player p : players) {\r\n\t\t\t\t\tp.announceAuctionWinner(winningBid.index, players[winningBid.index].name, winningBid.price);\r\n\t\t\t\t}\r\n\t\t\t\tif(debugPrinting)\r\n\t\t\t\tSystem.out.println(\"Auction winner: \" + players[winningBid.index].name + \":: Price : \" + winningBid.price);\r\n\r\n\t\t\t\t//The auction has been won, time to execute the order (66)\r\n\t\t\t\tif(winningBid.index == turn) {\r\n\t\t\t\t\tplayers[turn].pay(winningBid.price);\r\n\t\t\t\t\tplayers[turn].givePainting(card);\r\n\t\t\t\t\tif(second != null) {\r\n\t\t\t\t\t\tplayers[turn].givePainting(second);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(secondPlayer != -1) {\r\n\t\t\t\t\t\tplayers[secondPlayer].recive(winningBid.price/2);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tplayers[winningBid.index].pay(winningBid.price);\r\n\t\t\t\t\tif(secondPlayer != -1) {\r\n\t\t\t\t\t\tif(secondPlayer != winningBid.index) {\r\n\t\t\t\t\t\t\tplayers[secondPlayer].recive(winningBid.price/2);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tplayers[turn].recive(winningBid.price/2);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tplayers[turn].recive(winningBid.price);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tplayers[winningBid.index].givePainting(card);\r\n\t\t\t\t\tif(second != null) {\r\n\t\t\t\t\t\tplayers[winningBid.index].givePainting(second);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//debug\r\n\t\t//show money amounts\r\n\t\tfor(Player p : players) {\r\n\t\t\tif(debugPrinting)\r\n\t\t\tSystem.out.println(p.name + \" : \" + p.getMoney());\r\n\t\t}\r\n\t\t\r\n\t\tPlayer winner = null;\r\n\t\tfor(Player p : players) {\r\n\t\t\tif(winner == null || winner.getMoney() < p.getMoney()) {\r\n\t\t\t\twinner = p;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn winner;\r\n\t}", "@Override\n public Player getPlayerFor(int cardValue, Set<Player> availablePlayers) {\n return getRandomPlayer(availablePlayers);\n }", "private void obtainCourseSafely() {\n System.out.println(\"What is the name of the Course you wish to add (eg. CPSC 210)\");\n String name = scanner.nextLine();\n\n System.out.println(\"How many Sub-Classes does this have? (eg. CPSC 210 201 and CPSC 210 202 would mean 2)\");\n subClassNames = getNames(obtainIntSafely(1, 999, \"Enter int > 0\"), \"Class\");\n subClassTimes = getTimes(name, subClassNames);\n\n boolean response1 = yesNoQuestion(\"Does this class have a separate lab component?\");\n if (response1) {\n System.out.println(\"How many Labs does this have?\");\n labNames = getNames(obtainIntSafely(1, 999, \"Enter int > 0\"), \"Lab\");\n labTimes = getTimes(name, labNames);\n }\n\n boolean response2 = yesNoQuestion(\"Does this class have a separate tutorial component?\");\n if (response2) {\n System.out.println(\"How many Tutorials does this have?\");\n tutorialNames = getNames(obtainIntSafely(1, 999, \"Enter int > 0\"), \"Tutorial\");\n tutorialTimes = getTimes(name, tutorialNames);\n }\n\n if (response1 || response2) {\n activeCourseList.add(new Course(name, subClassNames, subClassTimes, response1, labNames, labTimes,\n response2, tutorialNames, tutorialTimes));\n } else {\n activeCourseList.add(new Course(name, subClassNames, subClassTimes));\n }\n }", "public String getCard(int buttonID)\n {\n String cardName = \"\";\n\n switch(buttonID)\n {\n case 0: cardName = \"2H\"; break;\n case 1: cardName = \"3H\"; break;\n case 2: cardName = \"4H\"; break;\n case 3: cardName = \"5H\"; break;\n case 4: cardName = \"6H\"; break;\n case 5: cardName = \"7H\"; break;\n case 6: cardName = \"8H\"; break;\n case 7: cardName = \"9H\"; break;\n case 8: cardName = \"10H\"; break;\n case 9: cardName = \"JH\"; break;\n case 10: cardName = \"QH\"; break;\n case 11: cardName = \"KH\"; break;\n case 12: cardName = \"AH\"; break;\n case 13: cardName = \"2D\"; break;\n case 14: cardName = \"3D\"; break;\n case 15: cardName = \"4D\"; break;\n case 16: cardName = \"5D\"; break;\n case 17: cardName = \"6D\"; break;\n case 18: cardName = \"7D\"; break;\n case 19: cardName = \"8D\"; break;\n case 20: cardName = \"9D\"; break;\n case 21: cardName = \"10D\"; break;\n case 22: cardName = \"JD\"; break;\n case 23: cardName = \"QD\"; break;\n case 24: cardName = \"KD\"; break;\n case 25: cardName = \"AD\"; break;\n case 26: cardName = \"2C\"; break;\n case 27: cardName = \"3C\"; break;\n case 28: cardName = \"4C\"; break;\n case 29: cardName = \"5C\"; break;\n case 30: cardName = \"6C\"; break;\n case 31: cardName = \"7C\"; break;\n case 32: cardName = \"8C\"; break;\n case 33: cardName = \"9C\"; break;\n case 34: cardName = \"10C\"; break;\n case 35: cardName = \"JC\"; break;\n case 36: cardName = \"QC\"; break;\n case 37: cardName = \"KC\"; break;\n case 38: cardName = \"AC\"; break;\n case 39: cardName = \"2S\"; break;\n case 40: cardName = \"3S\"; break;\n case 41: cardName = \"4S\"; break;\n case 42: cardName = \"5S\"; break;\n case 43: cardName = \"6S\"; break;\n case 44: cardName = \"7S\"; break;\n case 45: cardName = \"8S\"; break;\n case 46: cardName = \"9S\"; break;\n case 47: cardName = \"10S\"; break;\n case 48: cardName = \"JS\"; break;\n case 49: cardName = \"QS\"; break;\n case 50: cardName = \"KS\"; break;\n case 51: cardName = \"AS\"; break;\n\n }\n\n return cardName;\n }", "void playMonumentCard();", "public void ready() {\n\n try {\n Date date = new Date();\n date.getTime();\n List<Flashcard> toRemove = new ArrayList<>();\n for (Flashcard card : cards) {\n if (card.getRepetitionDate().after(date)) {\n toRemove.add(card);\n }\n }\n cards.removeAll(toRemove);\n\n } catch (Exception ex) {\n LogHelper.writeToLog(Level.INFO, \"Fehler beim Aufbereiten des Decks. \" + ex);\n }\n }", "public void transformResources (WarPlayer player) {\n int index = player.getStrategy().inputHowMnayResourcesToTransform();\n if ( player.getResources().size() == 0) {\n System.out.println(\"\\n\\n No resource to convert !\\n\");\n }\n else if (index == 0) {\n player.transformNeededResources(player.getFood());\n System.out.println(\"\\n\\n Needed resources transformed !\\n\");\n } else if (index == 1) {\n player.transformAllResources();\n System.out.println(\"\\n\\n All resources transformed !\\n\");\n }\n }", "com.yandex.ydb.rate_limiter.Resource getResource();", "private WarPlayer tryGetPlayerWithLessThanThreeCards() {\n for (WarPlayer player : players) {\n if (player.getHand().size() < 3)\n return player;\n }\n return null;\n\n }", "public static void playWar(Hand player1, Hand player2) {\n //intro for the game:\n System.out.println(\"Playing War!\");\n System.out.println(\"Cards dealt - here are the hands:\");\n System.out.println(\"Player 1:\");\n System.out.println(player1.toString());\n System.out.println(\"Player 2:\");\n System.out.println(player2.toString());\n //counting variables for the program\n int rounds = 0;\n int wars = 0;\n //gameCards is a hand object that collects each card as it is played\n Hand gameCards = new Hand();\n //these card objects represent each players card in the game\n Card player1Card;\n Card player2Card;\n //crate a boolean object for the game\n boolean gameOn = true;\n //let's go to war\n while(gameOn) {\n //player 1 plays a card\n player1Card = player1.getNext();\n gameCards.addCard(player1Card);\n //player 2 plays a card\n player2Card = player2.getNext();\n gameCards.addCard(player2Card);\n //check for war\n if(player1Card.equals(player2Card) && player1.size() > 0 && player2.size() > 0) {\n //let loose the dogs of war\n wars++;\n //each player puts another card on the table\n gameCards.addCard(player1.getNext());\n gameCards.addCard(player2.getNext());\n }\n //check if player1 ... won\n if(player1Card.compareValue(player2Card)) {\n rounds++;\n while(gameCards.size() > 0) { player1.addCard(gameCards.getNext()); }\n }\n \n //check if player 2 won\n else {\n rounds++;\n while(gameCards.size() > 0) { player2.addCard(gameCards.getNext()); }\n }\n //check for endgame scenarios\n if(player1.isEmpty() || player2.isEmpty()) {\n\t\t\t\tgameOn = false;\n\t\t\t}\n if(rounds == 5000) {\n\t\t\t\tgameOn = false;\n\t\t\t}\n }\n //endgame readout\n System.out.println(\"Hands at the end of the game:\");\n System.out.println(\"Player 1:\");\n System.out.println(player1.toString());\n System.out.println(\"Player 2:\");\n System.out.println(player2.toString());\n System.out.println(\"Results of the game:\");\n //readout if draw\n if(rounds == 5000) {\n System.out.println(\"No winner.\");\n System.out.println(\"Player 1 has \" + player1.size() + \" cards.\");\n System.out.println(\"Player 2 has \" + player2.size() + \" cards.\");\n }\n //readout if winner\n else {\n String winner = new String();\n if(player1.size() != 0) { winner = \"Player 1\"; }\n else { winner = \"Player 2\"; }\n System.out.println(\"Winner: \" + winner);\n System.out.println(\"Number of rounds: \" + rounds);\n }\n \n \n }", "public static void main(String[] args) {\n CardGame c = new CardGame(4, 0);\r\n c.start();\r\n\r\n // h 9\r\n // h 7\r\n // h 12\r\n // h 4\r\n // p 5\r\n // p 6\r\n // p 14\r\n // p 11\r\n // e 13\r\n // e 10\r\n // e 9\r\n // c 7\r\n // c 4\r\n\r\n // System.out.println(Arrays.toString(c.onePlay(new int[][] { { 1, 12 }, { 0, 2\r\n // }, { 1, 10 }, { 1, 9 } }, 0)));\r\n\r\n // [] Hukum 0\r\n // [] Paan 1\r\n // [] Eat 2\r\n // [] Chiddi 3\r\n }", "com.google.protobuf.ByteString getCards();", "void askStartItems(ArrayList<LightLeaderCard> quartet, int numResources, boolean faithPoints);", "private void addCards() {\r\n\t\tfor (Color color : UNO_COLORS) {\r\n\r\n\t\t\t// Create 76 NumberCards --> doubles except 0s.\r\n\t\t\tfor (int num : UNO_NUMBERS) {\r\n\t\t\t\tint i = 0;\r\n\t\t\t\tdo {\r\n\t\t\t\t\tUNOcards.add(new NumberCard(color, Integer.toString(num)));\r\n\t\t\t\t\ti++;\r\n\t\t\t\t} while (num != 0 && i < 2);\r\n\t\t\t}\r\n\r\n\t\t\t// Create 24 ActionCards --> everything twice\r\n\t\t\tfor (String type : ActionTypes) {\r\n\t\t\t\tfor (int i = 0; i < 2; i++)\r\n\t\t\t\t\tUNOcards.add(new ActionCard(color, type));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (String type : WildTypes) {\r\n\t\t\tfor (int i = 0; i < 4; i++) {\r\n\t\t\t\tUNOcards.add(new WildCard(type));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "@Test\n public void getterTest() {\n int shields2 = stack.getResource(ResourceType.SHIELDS);\n int servants2 = stack.getResource(ResourceType.SERVANTS);\n int coins2 = stack.getResource(ResourceType.COINS);\n int stones2 = stack.getResource(ResourceType.STONES);\n\n assertEquals(1, shields2);\n assertEquals(2, servants2);\n assertEquals(3, coins2);\n assertEquals(4, stones2);\n }", "@Override\r\n\tpublic void playCard() {\n\t\t\r\n\t}", "@Test\n\tpublic void testCardCoinDiscount() throws NotEnoughResourcesException, NotEnoughPointsException{\n\t\t// bonus is 1 coin\n\t\tInteger expectedCoins = 3;\n\t\t// card 3 is Triumphal Arch (cost: 2 stones and 2 coins)\n\t\ttestResourcesDecorator.resourcesForBuilding(testPlayer,testGameHandler.mainBoard.buildingMap.get(3));\n\t\t// card 1 is Preacher (cost: 2 coins)\n\t\ttestResourcesDecorator.coinsForCharacter(testPlayer,testGameHandler.mainBoard.characterMap.get(1));\n\t\t// card 3 is Repairing the Church (cost: 1 wood, 1 stone, 1 coin)\n\t\ttestResourcesDecorator.resourcesForVenture(testPlayer,testGameHandler.mainBoard.ventureMap.get(3));\n\t\tassertEquals(expectedCoins,testPlayer.resources.getCoins());\n\t\t\n\t}", "public static void main(String[] args) {\nArrayList<PlayingCard>deck=new ArrayList();\r\n\r\nint count=0;\r\n\r\nfor(int suit=1;suit<=4;suit++) {\r\n\tfor(int value=1;value<=13;value++) {\r\n\t\tPlayingCard pc=new PlayingCard(value,suit);\r\n\t\tdeck.add(pc);\r\n\t\tcount++;\r\n\t}\r\n}\r\n\r\nfor(PlayingCard pc:deck) {\r\n\tSystem.out.println(pc);\r\n}\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t}", "private void consumeResources(){\n\n Main.gang.setFood(Main.gang.getFood() - (Main.gang.getGangMembers().size() * Main.gang.getFoodIntake()));\n Main.gang.setWater(Main.gang.getWater() - (Main.gang.getGangMembers().size() * Main.gang.getFoodIntake()));\n }", "public void dealerAskCard() {\n int dealerScore = this.getDealerHand().getActualValue();\n while (dealerScore < 17) {\n Card card = this.deck.deal(this.getDealerHand());\n dealerScore = this.getDealerHand().getActualValue();\n }\n }", "public Image getCardCroupier3() {\n Random rand9 = new Random();\r\n randomNum9 = rand9.nextInt((52 - 1) + 1) + 1;\r\n Image c3 = new Image(\"/Images/cards/Card\" + randomNum9 + \".png\");\r\n return c3;\r\n }", "public int[] getCards() {\n \t\treturn cards;\n \t}", "private void generateDeckOfCards() {\n this.cards = new ArrayList<Card>(Suit.values().length * Rank.values().length);\n for (Suit suit : Suit.values()) {\n for (Rank rank : Rank.values()) {\n cards.add(new Card(suit, rank));\n }\n }\n }", "public static void requestGames() {\n\t\tarcade.requestGames();\n\t}", "public Resource takeResource( Resource.Type type, int amount );", "public void createDecks(){\r\n\t\tfor (int j = 10; j < 20; j++){\r\n\t\t\taddCard(new Card(cardNames[j]));\r\n\t\t}\r\n\t}", "public void initializeCards() {\n\t\tcardSet.clear();\n\t\tfor (Suit suit : Suit.values()) {\n\t\t\tfor (Rank rank : Rank.values()) {\n\t\t\t\tCard card = new Card(suit, rank);\n\t\t\t\tcardSet.add(card);\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n public List<Card> getDeck() {\n myDeck2.clear();\r\n\r\n //loops through twice in order to create the deck of 104\r\n for (int k = 0; k < 2; k++) {\r\n for (int i = 0; i < 4; i++) {\r\n for (int j = 1; j <= 13; j++) {\r\n Card nextCard = new Card(suit[i], j);\r\n myDeck2.add(nextCard);\r\n }\r\n }\r\n }\r\n\r\n return myDeck2;\r\n }", "private int RandomResourceValue(int playerNumber) {\n\t\tArrayList<Integer> excludedNumbers = new ArrayList<>();\n\t\tfor (int i = 0; i < CurrentPlayer.resources.length; i++) {\n\t\t\tif (robberPlayers.get(playerNumber).resources[i] == 0)\n\t\t\t\texcludedNumbers.add(i);\n\t\t}\n\t\tRandom r = new Random();\n\t\tint randomVariable = 0;\n\t\trandomVariable = r.nextInt(5 - 0) + 0;\n\n\t\tif (excludedNumbers.size() < 5) {\n\t\t\twhile (excludedNumbers.contains(randomVariable)) {\n\t\t\t\trandomVariable = r.nextInt(5 - 0) + 0;\n\t\t\t}\n\t\t}\n\t\treturn randomVariable;\n\t}", "@Override\n public Card cardToPlay(TurnState state, CardSet hand) {\n //Causes the player to spend a certain amount of time for each card\n double currentTime = System.currentTimeMillis();\n Card card = underlyingPlayer.cardToPlay(state, hand);\n try {\n long totalTime;\n if ((totalTime = (minTime - ((long) System.currentTimeMillis() - (long) currentTime))) > 0) {\n Thread.sleep(totalTime);\n }\n } catch (InterruptedException e) {\n }\n return card;\n }", "@Override\n public Card chooseCardtoPlay() {\n assert(card1 != null && card2 != null);\n if (card1.value == Card.PRINCESS) return playCard2();\n if (card2.value == Card.PRINCESS) return playCard1();\n return rand.nextBoolean() ? playCard1() : playCard2();\n }" ]
[ "0.7175711", "0.6201515", "0.59286296", "0.5725953", "0.56418747", "0.55599546", "0.5547289", "0.5542553", "0.5530005", "0.5517389", "0.5510473", "0.5430729", "0.5416794", "0.5401354", "0.5391617", "0.5370163", "0.53271735", "0.5303579", "0.5233618", "0.5214909", "0.5212625", "0.52014947", "0.5191323", "0.51866186", "0.51777244", "0.5176897", "0.51595324", "0.51577526", "0.5138532", "0.51166755", "0.5112438", "0.51044804", "0.50973827", "0.50947493", "0.50881946", "0.5075889", "0.50732726", "0.5063118", "0.5033601", "0.50324684", "0.5027075", "0.5020397", "0.5019949", "0.50197107", "0.50176775", "0.5003537", "0.49929827", "0.4989127", "0.49809188", "0.4969396", "0.49691814", "0.49601448", "0.49578574", "0.4956834", "0.4952143", "0.4945431", "0.49420506", "0.49412128", "0.49364835", "0.49326292", "0.49322176", "0.4927676", "0.49260956", "0.49101114", "0.4909727", "0.49040288", "0.4898235", "0.4897676", "0.48974895", "0.48973262", "0.4896999", "0.48945332", "0.48901665", "0.48893836", "0.48850274", "0.4880126", "0.48789483", "0.48782942", "0.48655525", "0.4865391", "0.48619545", "0.4849747", "0.48486698", "0.48442298", "0.48436928", "0.4838612", "0.4833277", "0.48318157", "0.48250744", "0.48120037", "0.48085997", "0.48031217", "0.48006028", "0.47945595", "0.47941723", "0.4792624", "0.47902355", "0.47852737", "0.47842172", "0.47828782" ]
0.74979097
0
This method plays the road card at the specified edge of the two neighboring hexes
void playRoadCard(EdgeLocation spot1, EdgeLocation spot2);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void turnOverItself() {\n byte tmp = leftEdge;\n leftEdge = reversedRightEdge;\n reversedRightEdge = tmp;\n\n tmp = rightEdge;\n rightEdge = reversedLeftEdge;\n reversedLeftEdge = tmp;\n\n tmp = topEdge;\n topEdge = reversedTopEdge;\n reversedTopEdge = tmp;\n\n tmp = botEdge;\n botEdge = reversedBotEdge;\n reversedBotEdge = tmp;\n\n tmp = ltCorner;\n ltCorner = rtCorner;\n rtCorner = tmp;\n\n tmp = lbCorner;\n lbCorner = rbCorner;\n rbCorner = tmp;\n }", "public void drawOnMap (char[][] roadMap) {\n int deltaX = 0;\n int deltaY = 0;\n int startX = 0;\n int startY = 0;\n /*\n * If there's no turn, pick an end and calculate the delta. To\n * avoid overwriting the intersections, reduce the delta by 1 and,\n * at the equality end (the initial i value in the loop) shift the\n * start by one for the same reason.\n */\n if (xTurn == -1) {\n startX = xOne;\n startY = yOne;\n deltaX = xTwo - xOne;\n deltaY = yTwo - yOne;\n if (deltaY == 0) {\n if (deltaX < 0) {\n deltaX += 1;\n } else {\n startX++;\n deltaX -= 1;\n }\n } else {\n if (deltaY < 0) {\n deltaY += 1;\n } else {\n startY++;\n deltaY -= 1;\n }\n }\n }\n /*\n * There's a turn. Our starting point will be the turn\n * coordinates. Calculate deltaX and deltaY. Here, we want to\n * overwrite the turn (offset of zero in the loops) and reduce\n * delta to avoid overwriting the intersections at each end.\n */\n else {\n startX = xTurn;\n startY = yTurn;\n if (startX == xOne) {\n deltaX = xTwo - startX;\n deltaY = yOne - startY;\n } else {\n deltaX = xOne - startX;\n deltaY = yTwo - startY;\n }\n if (deltaX < 0) {\n deltaX++;\n }\n if (deltaY < 0) {\n deltaY++;\n }\n }\n /*\n * Now we can run two loops to fill in the necessary chars.\n */\n if (deltaX != 0) {\n for (int i = Math.min(deltaX,0) ; i < Math.max(deltaX,0) ; i++) {\n roadMap[startY][startX + i] = '*';\n }\n }\n if (deltaY != 0) {\n for (int i = Math.min(deltaY,0) ; i < Math.max(deltaY,0) ; i++) {\n roadMap[startY + i][startX] = '*';\n }\n }\n /*\n * Blind spot: in the case where both deltaX and deltaY are\n * counting back toward the turn, an offset of zero, and not quite\n * getting there.\n */\n if (deltaX < 0 && deltaY < 0) roadMap[startY][startX] = '*';\n }", "private void alternateBeeper(){\n\t\tputBeeper();\n\t\tif(frontIsClear()){\n\t\tmove();\n\t\t}\n\t\tif(frontIsClear()){\n\t\t\tmove();\n\t\t} \n\t}", "public void checkForEdge() \n {\n if (getX() <= 1)\n {\n \n \n Greenfoot.playSound(\"pointScore.wav\");\n setLocation(getWorld().getWidth() / 2, getWorld().getHeight() / 2);\n dX = -dX;\n lWin++;\n \n MyWorld myWorld = (MyWorld) getWorld();\n myWorld.score2();\n \n wait = 0;\n \n }\n \n if(getX() >= getWorld().getWidth() -1 )\n {\n \n MyWorld myWorld = (MyWorld) getWorld();\n myWorld.score1();\n \n \n Greenfoot.playSound(\"pointScore.wav\");\n \n getWorld();\n setLocation(getWorld().getWidth() / 2, getWorld().getHeight() / 2);\n dX = -dX;\n rWin++;\n wait = 0;\n \n \n }\n\n \n }", "@Test\n\t\tpublic void boardEdgeTests() {\n\t\t\t//Testing a walkway space that is on the top edge of the board and is next to a door that points in its direction (\n\t\t\tSet<BoardCell> testList = board.getAdjList(0, 17);\n\t\t\tassertEquals(3, testList.size());\n\t\t\tassertTrue(testList.contains(board.getCellAt(0, 16)));\n\t\t\tassertTrue(testList.contains(board.getCellAt(0, 18)));\n\t\t\tassertTrue(testList.contains(board.getCellAt(1, 17)));\n\t\t\t//Testing a walkway space on the bottom edge of the board that is near a room space\n\t\t\ttestList = board.getAdjList(20, 5);\n\t\t\tassertEquals(2, testList.size());\n\t\t\tassertTrue(testList.contains(board.getCellAt(19, 5)));\n\t\t\tassertTrue(testList.contains(board.getCellAt(20, 6)));\n\t\t\t//Testing walkway a space on the left edge of the board that is surrounded by 3 other walkway spaces\n\t\t\ttestList = board.getAdjList(5, 0);\n\t\t\tassertEquals(3, testList.size());\n\t\t\tassertTrue(testList.contains(board.getCellAt(4, 0)));\n\t\t\tassertTrue(testList.contains(board.getCellAt(6, 0)));\n\t\t\tassertTrue(testList.contains(board.getCellAt(5, 1)));\n\t\t\t//Testing a room space in the bottom right corner\n\t\t\ttestList = board.getAdjList(20, 21);\n\t\t\tassertEquals(0, testList.size());\n\n\t\t}", "public void checkIfAtEdge() {\n\t\tif(x<=0){\n\t\t\tx=1;\n\t\t\tatEdge=true;\n\t\t\tmoving=false;\n\t\t}\n\t\tif(y<=0){\n\t\t\ty=1;\n\t\t\tatEdge=true;\n\t\t\tmoving=false;\n\t\t}\n\t\tif(x>=GameSystem.GAME_WIDTH-collisionWidth){\n\t\t\tx=GameSystem.GAME_WIDTH-collisionHeight-1;\n\t\t\tatEdge=true;\n\t\t\tmoving=false;\n\t\t}\n\t\tif(y>=GameSystem.GAME_HEIGHT-collisionWidth){\n\t\t\ty=GameSystem.GAME_HEIGHT-collisionHeight-1;\n\t\t\tatEdge=true;\n\t\t\tmoving=false;\n\t\t}\n\t\telse{\n\t\t\tatEdge=false;\n\t\t}\n\t\t\n\t}", "public boolean build(Edge edge) {\n \t\tif (edge == null || !canBuild(edge))\n \t\t\treturn false;\n \n \t\t// check resources\n \t\tboolean free = board.isSetupPhase() || board.isProgressPhase();\n \t\tif (!free && !affordRoad())\n \t\t\treturn false;\n \n \t\tif (!edge.build(this))\n \t\t\treturn false;\n \n \t\tif (!free) {\n \t\t\tuseResources(Type.BRICK, 1);\n \t\t\tuseResources(Type.LUMBER, 1);\n \t\t}\n \n \t\tappendAction(R.string.player_road);\n \n \t\tboolean hadLongest = (board.getLongestRoadOwner() == this);\n \t\tboard.checkLongestRoad();\n \n \t\tif (!hadLongest && board.getLongestRoadOwner() == this)\n \t\t\tappendAction(R.string.player_longest_road);\n \n \t\troads.add(edge);\n \n \t\tVertex vertex = edge.getVertex1();\n \t\tif (!reaching.contains(vertex))\n \t\t\treaching.add(vertex);\n \n \t\tvertex = edge.getVertex2();\n \t\tif (!reaching.contains(vertex))\n \t\t\treaching.add(vertex);\n \n \t\treturn true;\n \t}", "public void buyRoad(Edge edge) throws CannotBuyException, InsufficientPlayerResourcesException, AllPiecesPlayedException {\n\t\t if(canDoBuyRoad() == false) {\n\t\t\t throw new CannotBuyException(\"Cannot Buy Road, possibly no edge to place a road\");\n\t\t }\n\t\t resourceCardHand.payForRoad();\n\t\t playerPieces.placeRoad(edge);\n\t }", "@Override\r\n\tpublic void playRoadBuildingCard() {\n\t\t\r\n\t}", "private void drive2Neighbor(int nx, int ny) throws Exception {\n\t\t//note that since the map is upside down, so all left-right turn is switched here\n\t\tswitch(robot.getCurrentDirection()) {\n\t\tcase East:\n\t\t\tif (nx > robot.getCurrentPosition()[0]){\n\t\t\t\trobot.move(1, false);\n\t\t\t}\n\t\t\telse if (nx == robot.getCurrentPosition()[0]) {\n\t\t\t\tif (ny > robot.getCurrentPosition()[1]) {\n\t\t\t\t\trobot.rotate(Turn.LEFT);\n\t\t\t\t\trobot.move(1, false);\n\t\t\t\t}else{\n\t\t\t\t\trobot.rotate(Turn.RIGHT);\n\t\t\t\t\trobot.move(1, false);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\trobot.rotate(Turn.AROUND);\n\t\t\t\trobot.move(1, false);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase West:\n\t\t\tif (nx < robot.getCurrentPosition()[0]){\n\t\t\t\trobot.move(1, false);\n\t\t\t}\n\t\t\telse if (nx == robot.getCurrentPosition()[0]) {\n\t\t\t\tif (ny > robot.getCurrentPosition()[1]) {\n\t\t\t\t\trobot.rotate(Turn.RIGHT);\n\t\t\t\t\trobot.move(1, false);\n\t\t\t\t}else{\n\t\t\t\t\trobot.rotate(Turn.LEFT);\n\t\t\t\t\trobot.move(1, false);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\trobot.rotate(Turn.AROUND);\n\t\t\t\trobot.move(1, false);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase North:\n\t\t\tif (nx > robot.getCurrentPosition()[0]){\n\t\t\t\trobot.rotate(Turn.LEFT);\n\t\t\t\trobot.move(1, false);\n\t\t\t}\n\t\t\telse if (nx == robot.getCurrentPosition()[0]) {\n\t\t\t\tif (ny > robot.getCurrentPosition()[1]) {\n\t\t\t\t\trobot.rotate(Turn.AROUND);\n\t\t\t\t\trobot.move(1, false);\n\t\t\t\t}else{\n\t\t\t\t\trobot.move(1, false);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\trobot.rotate(Turn.RIGHT);\n\t\t\t\trobot.move(1, false);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase South:\n\t\t\tif (nx < robot.getCurrentPosition()[0]){\n\t\t\t\trobot.rotate(Turn.LEFT);\n\t\t\t\trobot.move(1, false);\n\t\t\t}\n\t\t\telse if (nx == robot.getCurrentPosition()[0]) {\n\t\t\t\tif (ny > robot.getCurrentPosition()[1]) {\n\t\t\t\t\trobot.move(1, false);\n\t\t\t\t}else{\n\t\t\t\t\trobot.rotate(Turn.AROUND);\n\t\t\t\t\trobot.move(1, false);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\trobot.rotate(Turn.RIGHT);\n\t\t\t\trobot.move(1, false);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}", "public void boarding(int dest) throws InterruptedException {\n // your code here\n \t\n \t\n }", "public void buildInitialRoad(Edge edge) throws CannotBuyException, InsufficientPlayerResourcesException, AllPiecesPlayedException {\n\t\t if(canDoBuildInitialRoad() == false) {\n\t\t\t throw new CannotBuyException(\"Cannot Buy Road, possibly no edge to place a road\");\n\t\t }\n\t\t playerPieces.placeRoad(edge);\n\t }", "public static void stageTwo() {\n status.recount();\n if (play) {\n coar_maze1.ending1();\n }\n while (status.getCounter() < 6 && play) {\n coar_maze1.direction();\n if (coar_maze1.china) {\n china_maze.china_orbs();\n china_maze.china_enemies();\n } else if (coar_maze1.amazon_forest) {\n amazon_jungle.amazon_river_orbs();\n amazon_jungle.amazon_river_enemies();\n }\n status.addCounter();\n quit();\n }\n status.recount();\n }", "public boolean connectTo(Hextile hexTile, Config.IncompleteRoadwayDirection relativePosition) {\r\n\t\tConfig.IncompleteRoadwayDirection head = null;\r\n\t\tConfig.IncompleteRoadwayDirection tail = null;\r\n\t\t\r\n\t\tConfig.IncompleteRoadwayDirection directions[] = new Config.IncompleteRoadwayDirection[] { Config.IncompleteRoadwayDirection.TOP, Config.IncompleteRoadwayDirection.TOP_RIGHT, Config.IncompleteRoadwayDirection.BOTTOM_RIGHT, Config.IncompleteRoadwayDirection.BOTTOM, Config.IncompleteRoadwayDirection.BOTTOM_LEFT, Config.IncompleteRoadwayDirection.TOP_LEFT};\r\n\t\tConfig.IncompleteRoadwayDirection relativePositionArray[] = new Config.IncompleteRoadwayDirection[directions.length];\r\n\t\t\r\n\t\tint startingLocation = -1;\r\n\t\t\r\n\t\t// Find relativePosition in direction array\r\n\t\tfor (int i = 0; i < directions.length; i++) {\r\n\t\t\tif (directions[i] == relativePosition) {\r\n\t\t\t\tstartingLocation = i;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (startingLocation == -1) {\r\n\t\t\tSystem.out.println(\"ERROR: startingLocation = -1\");\r\n\t\t}\r\n\t\t\r\n\t\t// Create new array which starts in the middle of the direction array with all the same content\r\n\t\tfor (int i = 0; i < relativePositionArray.length; i++) {\r\n\t\t\trelativePositionArray[i] = directions[(startingLocation + i) % 6];\r\n\t\t}\r\n\t\t\r\n\t\tswitch (rotation) {\r\n case 0: \r\n \thead = relativePositionArray[0]; break;\r\n case 60: \r\n \thead = relativePositionArray[5]; break;\r\n case 120:\r\n \thead = relativePositionArray[4]; break;\r\n case 180:\r\n \thead = relativePositionArray[3]; break;\r\n case 240:\r\n \thead = relativePositionArray[2]; break;\r\n case 300:\r\n \thead = relativePositionArray[1]; break;\r\n default: System.out.println(\"ERROR: Function connectTo - switch(rotation) does not handle value\" + rotation); break;\r\n\t\t}\r\n\t\t\r\n\t\tswitch (hexTile.getRotation()) {\r\n\t\t\tcase 0: \r\n\t \ttail = relativePositionArray[3]; break;\r\n\t case 60: \r\n\t \ttail = relativePositionArray[2]; break;\r\n\t case 120:\r\n\t \ttail = relativePositionArray[1]; break;\r\n\t case 180:\r\n\t \ttail = relativePositionArray[0]; break;\r\n\t case 240:\r\n\t \ttail = relativePositionArray[5]; break;\r\n\t case 300:\r\n\t \ttail = relativePositionArray[4]; break;\r\n\t default: System.out.println(\"ERROR: Function connectTo - switch(hexTile.getRotation()) does not handle value\" + rotation);\r\n\t\t}\r\n\t\t\r\n\r\n\t\tRoadway headRoadway = this.findRoadway(head);\r\n\t\tRoadway tailRoadway = hexTile.findRoadway(tail);\r\n\t\t\r\n\t\tif (this.name.equals(\"Deep Woods\") && hexTile.name.equals(\"Oak Woods\")) {\r\n\t\t\tSystem.out.println(headRoadway);\r\n\t\t\tSystem.out.println(tailRoadway);\r\n\t\t}\r\n\r\n\t\t// The roadways line up\r\n\t\tif ((headRoadway != null) && (tailRoadway != null)) {\r\n\t\t\theadRoadway.setTailClearing(tailRoadway.getHeadClearing());\r\n\t\t\ttailRoadway.setTailClearing(headRoadway.getHeadClearing());\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t// The roadways do not line up\r\n\t\telse {\r\n\t\t\treturn false;\r\n\t\t\t//System.out.println(\"Warning: No path found when connecting the \" + relativePosition + \" of \" + this.name + \" to \" + hexTile.name);\r\n\t\t}\r\n\t}", "private boolean isPathH(Board B, Move M, Graph G, int row, int column, Tile tile) {\n\n Tile t = tile;\n\n boolean result = true;\n boolean tempa = true;\n\n int sourceid = 0;\n\n\n int c = M.getX(), r = M.getY();\n\n if (r <= 0 && c <= 0) {\n\n\n } else if (r <= 0 && c >= 0) {\n\n\n } else if (r >= 0 && c >= 0) {\n\n for (int y = 0; y != 2; y++) {\n\n sourceid = (row * B.width) + column;\n\n // System.out.println(\"source id: \" + sourceid);\n\n if (y == 0) {\n\n\n //aab\n for (int i = 0; i != r; i++) {\n\n System.out.println(G.adj(sourceid).toString());\n\n if (G.adj.get(sourceid).contains(sourceid + B.width)) {\n\n // System.out.println(\"row artı\");\n\n } else {\n\n result = false;\n\n }\n\n sourceid += B.width;\n\n }\n\n for (int i = 0; i != c; i++) {\n\n\n if (G.adj.get(sourceid).contains(sourceid + 1)) {\n\n // System.out.println(\"okk\");\n\n } else {\n\n //return false;\n\n }\n\n sourceid += 1;\n\n System.out.println(\"b\");\n\n }\n } else {\n\n sourceid = row * B.width + column;\n\n for (int i = 0; i != c; i++) {\n // System.out.println(\"a\");\n\n }\n for (int i = 0; i != r; i++) {\n // System.out.println(\"b\");\n\n }\n }\n\n\n }\n\n\n }\n\n\n return result;\n }", "@Test\n public void play_StraightVsStraight() throws Exception {\n Hand hand1 = new Hand();\n hand1.addCard(new Card(Card.SUIT_SPADES, Card.CARD_2));\n hand1.addCard(new Card(Card.SUIT_HEARTS, Card.CARD_3));\n hand1.addCard(new Card(Card.SUIT_HEARTS, Card.CARD_4));\n hand1.addCard(new Card(Card.SUIT_HEARTS, Card.CARD_5));\n hand1.addCard(new Card(Card.SUIT_HEARTS, Card.CARD_6));\n Hand hand2 = new Hand();\n hand2.addCard(new Card(Card.SUIT_DIAMONDS, Card.CARD_5));\n hand2.addCard(new Card(Card.SUIT_SPADES, Card.CARD_6));\n hand2.addCard(new Card(Card.SUIT_SPADES, Card.CARD_7));\n hand2.addCard(new Card(Card.SUIT_SPADES, Card.CARD_8));\n hand2.addCard(new Card(Card.SUIT_SPADES, Card.CARD_9));\n assertEquals(hand2, FiveCardDraw.play(hand1, hand2));\n }", "void buildRoad(EdgeLocation edge, boolean free);", "public HotelCard searchAdjacentHotels(Board board, Tuple res) {\n ArrayList<HotelCard> hotels = board.getHotels();\n ArrayList<HotelCard> adjacent_hotels = new ArrayList<>();\n ArrayList<Integer> ids = new ArrayList<>();\n int x1, x2, y1, y2, x3, y3, x4, y4;\n\n // Presentation of player's adjacent hotels\n System.out.println(ANSI() + \"Here are the available adjacent hotels:\" + ANSI_RESET);\n // right\n x1 = res.a;\n y1 = res.b + 1;\n // up \n x2 = res.a - 1;\n y2 = res.b;\n // left\n x3 = res.a;\n y3 = res.b - 1; \n // down\n x4 = res.a + 1;\n y4 = res.b;\n \n if (isNum(board.board[x1][y1]) != -1) {\n ids.add(isNum(board.board[x1][y1]));\n }\n if (isNum(board.board[x2][y2]) != -1) {\n ids.add(isNum(board.board[x2][y2]));\n }\n if (isNum(board.board[x3][y3]) != -1) {\n ids.add(isNum(board.board[x3][y3]));\n }\n if (isNum(board.board[x4][y4]) != -1) {\n ids.add(isNum(board.board[x4][y4]));\n }\n for (int id : ids) {\n for (HotelCard hc : hotels) {\n if (hc.getID() == id) {\n System.out.print(ANSI() + \"Hotel Name: \" + hc.getName() + ANSI_RESET);\n System.out.print(ANSI() + \", Hotel ID: \" + hc.getID() + ANSI_RESET); \n System.out.println(ANSI() + \", Hotel Ranking: \" + hc.getRank() + ANSI_RESET); \n adjacent_hotels.add(hc); \n }\n }\n }\n\n // Choose one adjacent hotel\n System.out.println(\"Please type the id of the hotel you want to buy\");\n boolean answer = false;\n while (answer == false) {\n Scanner s = new Scanner(System.in);\n String str = s.nextLine();\n int ID;\n try { \n ID = Integer.parseInt(str);\n // Search for the hotel card with user's given ID \n for (HotelCard hc : adjacent_hotels) \n if (hc.getID() == ID) return hc; \n System.out.println(ANSI() + \"Please type a valid Hotel ID from the above Hotels shown\" + ANSI_RESET);\n } catch (Exception e) {\n System.out.println(ANSI() + \"Please type a valid Hotel ID from the above Hotels shown\" + ANSI_RESET);\n }\n }\n return null;\n }", "@Test\n public void testRelativeDirectionOfTileByAirFacingSouth() {\n Assert.assertEquals(Direction.FRONT, nav.finder().relativeDirectionOfTileByAir(getTile(9, 1)));\n Assert.assertEquals(Direction.FRONT, nav.finder().relativeDirectionOfTileByAir(getTile(9, 5)));\n Assert.assertEquals(Direction.FRONT, nav.finder().relativeDirectionOfTileByAir(getTile(9, 8)));\n Assert.assertEquals(Direction.FRONT, nav.finder().relativeDirectionOfTileByAir(getTile(10, 2)));\n Assert.assertEquals(Direction.FRONT, nav.finder().relativeDirectionOfTileByAir(getTile(10, 8)));\n Assert.assertEquals(Direction.FRONT, nav.finder().relativeDirectionOfTileByAir(getTile(11, 1)));\n Assert.assertEquals(Direction.FRONT, nav.finder().relativeDirectionOfTileByAir(getTile(11, 5)));\n Assert.assertEquals(Direction.FRONT, nav.finder().relativeDirectionOfTileByAir(getTile(11, 8)));\n\n /*\n Tile in front => FRONT\n */\n Assert.assertEquals(Direction.FRONT, nav.finder().relativeDirectionOfTileByAir(getTile(0, 1)));\n Assert.assertEquals(Direction.FRONT, nav.finder().relativeDirectionOfTileByAir(getTile(0, 5)));\n Assert.assertEquals(Direction.FRONT, nav.finder().relativeDirectionOfTileByAir(getTile(8, 1)));\n Assert.assertEquals(Direction.FRONT, nav.finder().relativeDirectionOfTileByAir(getTile(8, 5)));\n Assert.assertEquals(Direction.FRONT, nav.finder().relativeDirectionOfTileByAir(getTile(12, 1)));\n Assert.assertEquals(Direction.FRONT, nav.finder().relativeDirectionOfTileByAir(getTile(12, 5)));\n Assert.assertEquals(Direction.FRONT, nav.finder().relativeDirectionOfTileByAir(getTile(17, 1)));\n Assert.assertEquals(Direction.FRONT, nav.finder().relativeDirectionOfTileByAir(getTile(17, 5)));\n\n /*\n Tile to the left, but within the turning buffer => FRONT\n */\n Assert.assertEquals(Direction.FRONT, nav.finder().relativeDirectionOfTileByAir(getTile(12, 9)));\n Assert.assertEquals(Direction.FRONT, nav.finder().relativeDirectionOfTileByAir(getTile(12, 10)));\n Assert.assertEquals(Direction.FRONT, nav.finder().relativeDirectionOfTileByAir(getTile(12, 11)));\n Assert.assertEquals(Direction.FRONT, nav.finder().relativeDirectionOfTileByAir(getTile(13, 9)));\n Assert.assertEquals(Direction.FRONT, nav.finder().relativeDirectionOfTileByAir(getTile(13, 10)));\n Assert.assertEquals(Direction.FRONT, nav.finder().relativeDirectionOfTileByAir(getTile(13, 11)));\n Assert.assertEquals(Direction.FRONT, nav.finder().relativeDirectionOfTileByAir(getTile(14, 9)));\n Assert.assertEquals(Direction.FRONT, nav.finder().relativeDirectionOfTileByAir(getTile(14, 10)));\n Assert.assertEquals(Direction.FRONT, nav.finder().relativeDirectionOfTileByAir(getTile(14, 11)));\n\n /*\n Tile to the right, but within the turning buffer => FRONT\n */\n Assert.assertEquals(Direction.FRONT, nav.finder().relativeDirectionOfTileByAir(getTile(6, 9)));\n Assert.assertEquals(Direction.FRONT, nav.finder().relativeDirectionOfTileByAir(getTile(6, 10)));\n Assert.assertEquals(Direction.FRONT, nav.finder().relativeDirectionOfTileByAir(getTile(6, 11)));\n Assert.assertEquals(Direction.FRONT, nav.finder().relativeDirectionOfTileByAir(getTile(7, 9)));\n Assert.assertEquals(Direction.FRONT, nav.finder().relativeDirectionOfTileByAir(getTile(7, 10)));\n Assert.assertEquals(Direction.FRONT, nav.finder().relativeDirectionOfTileByAir(getTile(7, 11)));\n Assert.assertEquals(Direction.FRONT, nav.finder().relativeDirectionOfTileByAir(getTile(8, 9)));\n Assert.assertEquals(Direction.FRONT, nav.finder().relativeDirectionOfTileByAir(getTile(8, 10)));\n Assert.assertEquals(Direction.FRONT, nav.finder().relativeDirectionOfTileByAir(getTile(8, 11)));\n\n /*\n Tile to to the right, horizontally aligned => RIGHT\n */\n Assert.assertEquals(Direction.RIGHT, nav.finder().relativeDirectionOfTileByAir(getTile(0, 9)));\n Assert.assertEquals(Direction.RIGHT, nav.finder().relativeDirectionOfTileByAir(getTile(0, 10)));\n Assert.assertEquals(Direction.RIGHT, nav.finder().relativeDirectionOfTileByAir(getTile(0, 11)));\n Assert.assertEquals(Direction.RIGHT, nav.finder().relativeDirectionOfTileByAir(getTile(5, 9)));\n Assert.assertEquals(Direction.RIGHT, nav.finder().relativeDirectionOfTileByAir(getTile(5, 10)));\n Assert.assertEquals(Direction.RIGHT, nav.finder().relativeDirectionOfTileByAir(getTile(5, 11)));\n\n /*\n Tile in front, but within the turning buffer and to the right => RIGHT\n */\n Assert.assertEquals(Direction.RIGHT, nav.finder().relativeDirectionOfTileByAir(getTile(0, 6)));\n Assert.assertEquals(Direction.RIGHT, nav.finder().relativeDirectionOfTileByAir(getTile(0, 7)));\n Assert.assertEquals(Direction.RIGHT, nav.finder().relativeDirectionOfTileByAir(getTile(0, 8)));\n Assert.assertEquals(Direction.RIGHT, nav.finder().relativeDirectionOfTileByAir(getTile(6, 6)));\n Assert.assertEquals(Direction.RIGHT, nav.finder().relativeDirectionOfTileByAir(getTile(6, 7)));\n Assert.assertEquals(Direction.RIGHT, nav.finder().relativeDirectionOfTileByAir(getTile(6, 8)));\n Assert.assertEquals(Direction.RIGHT, nav.finder().relativeDirectionOfTileByAir(getTile(8, 6)));\n Assert.assertEquals(Direction.RIGHT, nav.finder().relativeDirectionOfTileByAir(getTile(8, 7)));\n Assert.assertEquals(Direction.RIGHT, nav.finder().relativeDirectionOfTileByAir(getTile(8, 8)));\n\n /*\n Tile is at the back, but to the right => RIGHT\n */\n Assert.assertEquals(Direction.RIGHT, nav.finder().relativeDirectionOfTileByAir(getTile(0, 12)));\n Assert.assertEquals(Direction.RIGHT, nav.finder().relativeDirectionOfTileByAir(getTile(0, 17)));\n Assert.assertEquals(Direction.RIGHT, nav.finder().relativeDirectionOfTileByAir(getTile(4, 14)));\n Assert.assertEquals(Direction.RIGHT, nav.finder().relativeDirectionOfTileByAir(getTile(4, 17)));\n Assert.assertEquals(Direction.RIGHT, nav.finder().relativeDirectionOfTileByAir(getTile(5, 12)));\n Assert.assertEquals(Direction.RIGHT, nav.finder().relativeDirectionOfTileByAir(getTile(6, 12)));\n Assert.assertEquals(Direction.RIGHT, nav.finder().relativeDirectionOfTileByAir(getTile(7, 12)));\n Assert.assertEquals(Direction.RIGHT, nav.finder().relativeDirectionOfTileByAir(getTile(8, 12)));\n Assert.assertEquals(Direction.RIGHT, nav.finder().relativeDirectionOfTileByAir(getTile(9, 12)));\n Assert.assertEquals(Direction.RIGHT, nav.finder().relativeDirectionOfTileByAir(getTile(9, 14)));\n Assert.assertEquals(Direction.RIGHT, nav.finder().relativeDirectionOfTileByAir(getTile(9, 17)));\n\n /*\n To to the left, horizontally aligned => LEFT\n */\n Assert.assertEquals(Direction.LEFT, nav.finder().relativeDirectionOfTileByAir(getTile(15, 9)));\n Assert.assertEquals(Direction.LEFT, nav.finder().relativeDirectionOfTileByAir(getTile(15, 10)));\n Assert.assertEquals(Direction.LEFT, nav.finder().relativeDirectionOfTileByAir(getTile(15, 11)));\n Assert.assertEquals(Direction.LEFT, nav.finder().relativeDirectionOfTileByAir(getTile(17, 9)));\n Assert.assertEquals(Direction.LEFT, nav.finder().relativeDirectionOfTileByAir(getTile(17, 10)));\n Assert.assertEquals(Direction.LEFT, nav.finder().relativeDirectionOfTileByAir(getTile(17, 11)));\n\n /*\n Tile in front, but within the turning buffer and to the left => LEFT\n */\n Assert.assertEquals(Direction.LEFT, nav.finder().relativeDirectionOfTileByAir(getTile(12, 6)));\n Assert.assertEquals(Direction.LEFT, nav.finder().relativeDirectionOfTileByAir(getTile(12, 7)));\n Assert.assertEquals(Direction.LEFT, nav.finder().relativeDirectionOfTileByAir(getTile(12, 8)));\n Assert.assertEquals(Direction.LEFT, nav.finder().relativeDirectionOfTileByAir(getTile(14, 6)));\n Assert.assertEquals(Direction.LEFT, nav.finder().relativeDirectionOfTileByAir(getTile(14, 7)));\n Assert.assertEquals(Direction.LEFT, nav.finder().relativeDirectionOfTileByAir(getTile(14, 8)));\n Assert.assertEquals(Direction.LEFT, nav.finder().relativeDirectionOfTileByAir(getTile(17, 6)));\n Assert.assertEquals(Direction.LEFT, nav.finder().relativeDirectionOfTileByAir(getTile(17, 7)));\n Assert.assertEquals(Direction.LEFT, nav.finder().relativeDirectionOfTileByAir(getTile(17, 8)));\n\n /*\n Tile is at the back, but to the left => LEFT\n */\n Assert.assertEquals(Direction.LEFT, nav.finder().relativeDirectionOfTileByAir(getTile(10, 12)));\n Assert.assertEquals(Direction.LEFT, nav.finder().relativeDirectionOfTileByAir(getTile(10, 14)));\n Assert.assertEquals(Direction.LEFT, nav.finder().relativeDirectionOfTileByAir(getTile(10, 17)));\n Assert.assertEquals(Direction.LEFT, nav.finder().relativeDirectionOfTileByAir(getTile(11, 12)));\n Assert.assertEquals(Direction.LEFT, nav.finder().relativeDirectionOfTileByAir(getTile(12, 12)));\n Assert.assertEquals(Direction.LEFT, nav.finder().relativeDirectionOfTileByAir(getTile(13, 12)));\n Assert.assertEquals(Direction.LEFT, nav.finder().relativeDirectionOfTileByAir(getTile(14, 12)));\n Assert.assertEquals(Direction.LEFT, nav.finder().relativeDirectionOfTileByAir(getTile(15, 12)));\n Assert.assertEquals(Direction.LEFT, nav.finder().relativeDirectionOfTileByAir(getTile(16, 14)));\n Assert.assertEquals(Direction.LEFT, nav.finder().relativeDirectionOfTileByAir(getTile(16, 17)));\n Assert.assertEquals(Direction.LEFT, nav.finder().relativeDirectionOfTileByAir(getTile(17, 12)));\n Assert.assertEquals(Direction.LEFT, nav.finder().relativeDirectionOfTileByAir(getTile(17, 17)));\n }", "public void loopThroughEdge()\n {\n int margin = 2;\n\n if (getX() < margin) //left side\n { \n setLocation(getWorld().getWidth()+ margin, getY());\n }\n else if (getX() > getWorld().getWidth() - margin) //right side\n {\n setLocation(margin, getY());\n }\n\n if (getY() < margin) //top side\n { \n setLocation(getX(), getWorld().getHeight() - margin);\n }\n else if(getY() > getWorld().getHeight() - margin) //bottom side\n { \n setLocation(getX(), margin);\n }\n }", "public static void testEdgeDetection()\n {\n Picture swan = new Picture(\"swan.jpg\");\n swan.edgeDetection();\n swan.explore();\n }", "protected Vec3 maybeBackOffFromEdge(Vec3 debug1, MoverType debug2) {\n/* 1102 */ if (!this.abilities.flying && (debug2 == MoverType.SELF || debug2 == MoverType.PLAYER) && isStayingOnGroundSurface() && isAboveGround()) {\n/* 1103 */ double debug3 = debug1.x;\n/* 1104 */ double debug5 = debug1.z;\n/* 1105 */ double debug7 = 0.05D;\n/* */ \n/* */ \n/* */ \n/* */ \n/* 1110 */ while (debug3 != 0.0D && this.level.noCollision((Entity)this, getBoundingBox().move(debug3, -this.maxUpStep, 0.0D))) {\n/* 1111 */ if (debug3 < 0.05D && debug3 >= -0.05D) {\n/* 1112 */ debug3 = 0.0D; continue;\n/* 1113 */ } if (debug3 > 0.0D) {\n/* 1114 */ debug3 -= 0.05D; continue;\n/* */ } \n/* 1116 */ debug3 += 0.05D;\n/* */ } \n/* */ \n/* */ \n/* */ \n/* 1121 */ while (debug5 != 0.0D && this.level.noCollision((Entity)this, getBoundingBox().move(0.0D, -this.maxUpStep, debug5))) {\n/* 1122 */ if (debug5 < 0.05D && debug5 >= -0.05D) {\n/* 1123 */ debug5 = 0.0D; continue;\n/* 1124 */ } if (debug5 > 0.0D) {\n/* 1125 */ debug5 -= 0.05D; continue;\n/* */ } \n/* 1127 */ debug5 += 0.05D;\n/* */ } \n/* */ \n/* */ \n/* */ \n/* 1132 */ while (debug3 != 0.0D && debug5 != 0.0D && this.level.noCollision((Entity)this, getBoundingBox().move(debug3, -this.maxUpStep, debug5))) {\n/* 1133 */ if (debug3 < 0.05D && debug3 >= -0.05D) {\n/* 1134 */ debug3 = 0.0D;\n/* 1135 */ } else if (debug3 > 0.0D) {\n/* 1136 */ debug3 -= 0.05D;\n/* */ } else {\n/* 1138 */ debug3 += 0.05D;\n/* */ } \n/* */ \n/* 1141 */ if (debug5 < 0.05D && debug5 >= -0.05D) {\n/* 1142 */ debug5 = 0.0D; continue;\n/* 1143 */ } if (debug5 > 0.0D) {\n/* 1144 */ debug5 -= 0.05D; continue;\n/* */ } \n/* 1146 */ debug5 += 0.05D;\n/* */ } \n/* */ \n/* 1149 */ debug1 = new Vec3(debug3, debug1.y, debug5);\n/* */ } \n/* 1151 */ return debug1;\n/* */ }", "@Test\n\tpublic void connectTest_East_HorizontalStraight() throws Exception {\n\n\t\tfinal Factory<Node> railNodeFactory = new DefaultRailNodeFactory();\n\n\t\tfinal RailNode switchLeft0RailNode = (RailNode) railNodeFactory.create(1, 1, ShapeType.SWITCH_LEFT_0);\n\t\tfinal RailNode horizontalRailNode = (RailNode) railNodeFactory.create(0, 1, ShapeType.STRAIGHT_HORIZONTAL);\n\n\t\tfinal Model model = new DefaultModel();\n\t\tmodel.setNode(1, 1, switchLeft0RailNode);\n\t\tmodel.setNode(0, 1, horizontalRailNode);\n\n\t\tswitchLeft0RailNode.connect(model);\n\t\thorizontalRailNode.connect(model);\n\n\t\tSystem.out.println(switchLeft0RailNode.toString());\n\t\tSystem.out.println(horizontalRailNode.toString());\n\n\t\tassertEquals(0, switchLeft0RailNode.getGraphNodeOne().getChildren().size());\n\t\tassertEquals(1, switchLeft0RailNode.getGraphNodeTwo().getChildren().size());\n\t\tassertEquals(3, switchLeft0RailNode.getGraphNodeTwo().getChildren().get(0).getId());\n\n\t\tassertEquals(1, horizontalRailNode.getGraphNodeOne().getChildren().size());\n\t\tassertEquals(0, horizontalRailNode.getGraphNodeTwo().getChildren().size());\n\t\tassertEquals(0, horizontalRailNode.getGraphNodeOne().getChildren().get(0).getId());\n\t}", "private void redEastTurnRight(int intersection) {\n int index = getIntersectionIndex(intersection);\n isGreenEastTurnRight[index] = false;\n }", "private void cs8() {\n\t\t\t\n\t\n\t\t\tif(new Tile(3088,3092,0).matrix(ctx).reachable()){\n\t\t\t\t\n\t\t\t\tif(new Tile(3079,3084,0).distanceTo(ctx.players.local().tile())<7){\n\t\t\t\t\tMethod.interactO(9709, \"Open\", \"Door\");\n\t\t\t\t}else ctx.movement.step(new Tile(3079,3084,0));\n\t\t\t\t\n\t\t\t}else if(new Tile(3090,3092,0).distanceTo(ctx.players.local().tile())<7){\n\t\t\t\tfinal int[] bounds = {140, 108, -84, 144, -64, 136};\n\t\t\t\tGameObject gate = ctx.objects.select().id(GATEBYFISH).each(Interactive.doSetBounds(bounds)).select(Interactive.areInViewport()).nearest().poll();\n\t\t\t\tgate.interact(\"Open\",\"\");\n\t\t\t}else ctx.movement.step(new Tile(3090,3092,0));\n\t\t\t\n\t\t\t\n\t\t}", "void addEdge(int x, int y);", "private void firstFaceEdge_fromLowerLayer(int pos) {\n Log.d(tag, \"Edge piece from lower layer\");\n Algorithm algorithm = new Algorithm();\n\n // the white should be on one of the sides, not front or back\n if (pos == EDGE_BOTTOM_NEAR || pos == EDGE_BOTTOM_FAR) {\n algorithm.addStep(Axis.Y_AXIS, Direction.CLOCKWISE, INNER);\n }\n\n if (pos <= EDGE_BOTTOM_LEFT) {\n algorithm.addStep(Axis.X_AXIS, Direction.CLOCKWISE, INNER);\n algorithm.addStep(Axis.Z_AXIS, Direction.CLOCKWISE, OUTER);\n if (mTopSquares.get(EDGE_TOP_LEFT).getColor() == mTopColor &&\n mLeftSquares.get(FIRST_ROW_CENTER).getColor() ==\n mLeftSquares.get(CENTER).getColor()) {\n algorithm.addStep(Axis.X_AXIS, Direction.COUNTER_CLOCKWISE, INNER);\n }\n } else {\n algorithm.addStep(Axis.X_AXIS, Direction.CLOCKWISE, OUTER);\n algorithm.addStep(Axis.Z_AXIS, Direction.COUNTER_CLOCKWISE, OUTER);\n if (mTopSquares.get(EDGE_TOP_RIGHT).getColor() == mTopColor &&\n mRightSquares.get(FIRST_ROW_CENTER).getColor() ==\n mRightSquares.get(CENTER).getColor()) {\n\n algorithm.addStep(Axis.X_AXIS, Direction.COUNTER_CLOCKWISE, OUTER);\n }\n }\n setAlgo(algorithm);\n }", "void setupEdge(EdgeGraph edge) {\n\n\t\tif (UserParameters.socialInteraction) updateCrowdness(edge);\n\t\tcurrentEdge = edge;\n\t\t//transform GeomPlanarGraphEdge in Linestring\n\t\tLineString line = edge.getLine();\n\t\t//index the Linestring\n\t\tsegment = new LengthIndexedLine(line);\n\t\tstartIndex = segment.getStartIndex();\n\t\tendIndex = segment.getEndIndex();\n\t\tlinkDirection = 1;\n\n\t\t// check to ensure that Agent is moving in the right direction (direction)\n\t\tdouble distanceToStart = line.getStartPoint().distance(agentLocation.geometry);\n\t\tdouble distanceToEnd = line.getEndPoint().distance(agentLocation.geometry);\n\n\t\tif (distanceToStart <= distanceToEnd) {\n\t\t\t// closer to start\n\t\t\tcurrentIndex = startIndex;\n\t\t\tlinkDirection = 1;\n\t\t}\n\t\telse if (distanceToEnd < distanceToStart) {\n\t\t\t// closer to end\n\t\t\tcurrentIndex = endIndex;\n\t\t\tlinkDirection = -1;\n\t\t}\n\n\t}", "public HexBoard(boolean playerOne){\n this.playerOne = playerOne;\n board = new int[126]; //really size 121 but begin indexing at 1\n Arrays.fill(board,0);\n boardWidth = (int) java.lang.Math.sqrt(board.length);\n\n //making final constants to store winning paths\n TOP = board.length -4;\n BOTTOM = board.length -3;\n LEFT = board.length -2;\n RIGHT = board.length -1;\n\n }", "private void enPassant(Board board, List<Move> moves) {\n int x = location.x;\n int y = location.y; \n \n if (this.color == Color.White && this.location.y == 3) {\n if(canCaptureEnPassant(board, new Point(x - 1, y)))\n moves.add(new Move(this, new Point(x - 1, y - 1),\n board.getPieceAt(new Point(x - 1, y))));\n if(canCaptureEnPassant(board, new Point(x + 1, y)))\n moves.add(new Move(this, new Point(x + 1, y - 1),\n board.getPieceAt(new Point(x + 1, y)))); \n }\n if (this.color == Color.Black && this.location.y == 4) {\n if(canCaptureEnPassant(board, new Point(x - 1, y)))\n moves.add(new Move(this, new Point(x - 1, y + 1),\n board.getPieceAt(new Point(x - 1, y))));\n if(canCaptureEnPassant(board, new Point(x + 1, y)))\n moves.add(new Move(this, new Point(x + 1, y + 1),\n board.getPieceAt(new Point(x + 1, y)))); \n }\n }", "public void checkEdge()\n {\n if(getX() < 10 || getX() > getWorld().getWidth() - 10)\n {\n speed *= -1;\n }\n }", "private void cp2turn(){\n\t\tboolean attacked = false;\n\t\twhile(!attacked){\n\t\t\tranX = ranNum.nextInt(30);\n\t\t\tranY = ranNum.nextInt(30);\n\n\t\t\tif(cp2Attacks[ranX][ranY] == false){\n\t\t\t\tcp2Shots.add(new Shot(ranX * 20,ranY * 20));\n\t\t\t\tboardOne.add(cp2Shots.get(cp2ShotCount));\n\n\t\t\t\tboardOne.setComponentZOrder(cp2Shots.get(cp2ShotCount), 0);\n\n\t\t\t\tfor(int x = 0; x < ships.length; x++){\n\t\t\t\t\tif(ships[x].getPlayer() == 1){\n\t\t\t\t\t\tif(ships[x].checkBounds(ranX * 20 + 5, ranY * 20 + 5)){\n\t\t\t\t\t\t\tcp2Shots.get(cp2ShotCount).hit();\n\t\t\t\t\t\t\tships[x].hit();\n\t\t\t\t\t\t\tif(ships[x].sunk()){\n\t\t\t\t\t\t\t\tcp1BoatsSunk++;\n\t\t\t\t\t\t\t\tcp1shipLabel.setText(\"Computer Player 1 ships sunk: \" + cp1BoatsSunk);\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\tcp2ShotCount++;\n\t\t\t\tattacked = true;\n\t\t\t\tcp2Attacks[ranX][ranY] = true;\n\t\t\t}\n\t\t}\n\t\trepaint();\n\t}", "@Test\n\t\t\tpublic void doorwayAdjacentSpots() {\n\t\t\t\t//Tests a left doorway for the spot to its left\n\t\t\t\tSet<BoardCell> testList = board.getAdjList(0, 18);\n\t\t\t\tassertTrue(testList.contains(board.getCellAt(0, 17)));\n\t\t\t\t//Tests a right door for the spot on its right\n\t\t\t\ttestList = board.getAdjList(17, 4);\n\t\t\t\tassertTrue(testList.contains(board.getCellAt(17, 5)));\n\t\t\t\t//Tests a down door for the space below\n\t\t\t\ttestList = board.getAdjList(5, 15);\n\t\t\t\tassertTrue(testList.contains(board.getCellAt(6, 15)));\n\t\t\t\t//Tests an up door with the space above\n\t\t\t\ttestList = board.getAdjList(14, 9);\n\t\t\t\tassertTrue(testList.contains(board.getCellAt(13, 9)));\n\t\t\t\n\t\t\t}", "private void drive(int e) {\r\n if (endx[e] + 120 >= width - radius[e] && directionend[e] == 0) {\r\n endx[e] += 20;\r\n endy[e] -= 20;\r\n directionend[e]++;\r\n radius[e] -= 60;\r\n directionchanged[e] = true;\r\n } else if (endy[e] + 120 >= height - radius[e] && directionend[e] == 1) {\r\n\r\n endx[e] += 20;\r\n endy[e] += 20;\r\n directionend[e]++;\r\n radius[e] -= 60;\r\n directionchanged[e] = true;\r\n } else if (endx[e] - 120 <= radius[e] && directionend[e] == 2) {\r\n endx[e] -= 20;\r\n endy[e] += 20;\r\n radius[e] -= 60;\r\n directionend[e]++;\r\n directionchanged[e] = true;\r\n } else if (endy[e] - 80 <= radius[e] && directionend[e] == 3) {\r\n endx[e] -= 20;\r\n endy[e] -= 20;\r\n radius[e] -= 60;\r\n directionend[e] = 0;\r\n directionchanged[e] = true;\r\n } else {\r\n directionchanged[e] = false;\r\n }\r\n }", "public abstract boolean hasEdge(int from, int to);", "public void TowerOfHanoi(int diskSize, LinkedList<Integer> src, LinkedList<Integer> dst, LinkedList<Integer> aux){\n numOfDisks = diskSize;\n // even number of disks\n System.out.printf(\"Pegs at start \\n\");\n printStacks(4,src,dst,aux);\n if(numOfDisks % 2 == 0){\n do{\n if( src.peek() != null && (dst.peek() == null || dst.peek().compareTo(src.peek()) > 0) )\n dst.push(src.pop());\n else if(dst.peek() != null && (src.peek() == null || src.peek().compareTo(dst.peek()) > 0))\n src.push(dst.pop());\n\n if (aux.peek() != null && (src.peek() == null || src.peek().compareTo(aux.peek()) > 0))\n src.push(aux.pop());\n else if(src.peek() != null && ( aux.peek() == null || aux.peek().compareTo(src.peek()) > 0))\n aux.push(src.pop());\n\n if(aux.peek() != null && (dst.peek() == null || dst.peek().compareTo(aux.peek()) > 0))\n dst.push(aux.pop());\n else if(dst.peek() != null &&(aux.peek() == null || aux.peek().compareTo(dst.peek()) > 0))\n aux.push(dst.pop());\n\n System.out.printf(\"After move \\n\");\n printStacks(4,src,dst,aux);\n }while (!isEnded(4,src,dst,aux));\n }\n // odd number of disks\n if(numOfDisks % 2 != 0){\n do {\n numOfDisks = numOfDisks;\n if (aux.peek() != null && (src.peek() == null || src.peek().compareTo(aux.peek()) > 0))\n src.push(aux.pop());\n else if (src.peek() != null && (aux.peek() == null || aux.peek().compareTo(src.peek()) > 0))\n aux.push(src.pop());\n\n if (src.peek() != null && (dst.peek() == null || dst.peek().compareTo(src.peek()) > 0))\n dst.push(src.pop());\n else if (dst.peek() != null && (src.peek() == null || src.peek().compareTo(dst.peek()) > 0))\n src.push(dst.pop());\n\n if (aux.peek() != null && (dst.peek() == null || dst.peek().compareTo(aux.peek()) > 0))\n dst.push(aux.pop());\n else if (dst.peek() != null && (aux.peek() == null || aux.peek().compareTo(dst.peek()) > 0))\n aux.push(dst.pop());\n\n System.out.printf(\"After move \\n\");\n printStacks(4,src,dst,aux);\n } while (!isEnded(4,src,dst,aux));\n }\n System.out.printf(\"Last status\");\n printStacks(4,src,dst,aux);\n }", "@Override\r\n\tpublic void mouseClicked(MouseEvent e) {\r\n\t\tSystem.out.println(e.getX()/100 + \", \" + e.getY()/100);\r\n\t\tif (board[e.getX()/100][e.getY()/100].equals(Color.blue)) {\r\n\t\t\tif (turn%2 == 0) {\r\n\t\t\t\tboard[e.getX()/100][e.getY()/100] = Color.yellow;\r\n\t\t\t} else {\r\n\t\t\t\tboard[e.getX()/100][e.getY()/100] = Color.red;\r\n\t\t\t}\r\n\t\t\tturn++;\r\n\t\t\t\r\n\t\t\t//win condition\r\n\t\t\tif(board[0][0] == Color.yellow && board[0][1] == Color.yellow && board[0][2] == Color.yellow && board[0][3] == Color.yellow){\r\n\t\t\t\tboard[0][0] = Color.yellow;\r\n\t\t\t\tboard[0][1] = Color.yellow;\r\n\t\t\t\tboard[0][2] = Color.yellow;\r\n\t\t\t\tboard[0][3] = Color.yellow;\r\n\t\t\t\tboard[1][0] = Color.yellow;\r\n\t\t\t\tboard[1][1] = Color.yellow;\r\n\t\t\t\tboard[1][2] = Color.yellow;\r\n\t\t\t\tboard[1][3] = Color.yellow;\r\n\t\t\t\tboard[2][0] = Color.yellow;\r\n\t\t\t\tboard[2][1] = Color.yellow;\r\n\t\t\t\tboard[2][2] = Color.yellow;\r\n\t\t\t\tboard[2][3] = Color.yellow;\r\n\t\t\t\tboard[3][0] = Color.yellow;\r\n\t\t\t\tboard[3][1] = Color.yellow;\r\n\t\t\t\tboard[3][2] = Color.yellow;\r\n\t\t\t\tboard[3][3] = Color.yellow;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(board[1][0] == Color.yellow && board[1][1] == Color.yellow && board[1][2] == Color.yellow && board[1][3] == Color.yellow){\r\n\t\t\t\tboard[0][0] = Color.yellow;\r\n\t\t\t\tboard[0][1] = Color.yellow;\r\n\t\t\t\tboard[0][2] = Color.yellow;\r\n\t\t\t\tboard[0][3] = Color.yellow;\r\n\t\t\t\tboard[1][0] = Color.yellow;\r\n\t\t\t\tboard[1][1] = Color.yellow;\r\n\t\t\t\tboard[1][2] = Color.yellow;\r\n\t\t\t\tboard[1][3] = Color.yellow;\r\n\t\t\t\tboard[2][0] = Color.yellow;\r\n\t\t\t\tboard[2][1] = Color.yellow;\r\n\t\t\t\tboard[2][2] = Color.yellow;\r\n\t\t\t\tboard[2][3] = Color.yellow;\r\n\t\t\t\tboard[3][0] = Color.yellow;\r\n\t\t\t\tboard[3][1] = Color.yellow;\r\n\t\t\t\tboard[3][2] = Color.yellow;\r\n\t\t\t\tboard[3][3] = Color.yellow;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(board[2][0] == Color.yellow && board[2][1] == Color.yellow && board[2][2] == Color.yellow && board[2][3] == Color.yellow){\r\n\t\t\t\tboard[0][0] = Color.yellow;\r\n\t\t\t\tboard[0][1] = Color.yellow;\r\n\t\t\t\tboard[0][2] = Color.yellow;\r\n\t\t\t\tboard[0][3] = Color.yellow;\r\n\t\t\t\tboard[1][0] = Color.yellow;\r\n\t\t\t\tboard[1][1] = Color.yellow;\r\n\t\t\t\tboard[1][2] = Color.yellow;\r\n\t\t\t\tboard[1][3] = Color.yellow;\r\n\t\t\t\tboard[2][0] = Color.yellow;\r\n\t\t\t\tboard[2][1] = Color.yellow;\r\n\t\t\t\tboard[2][2] = Color.yellow;\r\n\t\t\t\tboard[2][3] = Color.yellow;\r\n\t\t\t\tboard[3][0] = Color.yellow;\r\n\t\t\t\tboard[3][1] = Color.yellow;\r\n\t\t\t\tboard[3][2] = Color.yellow;\r\n\t\t\t\tboard[3][3] = Color.yellow;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(board[0][0] == Color.yellow && board[1][0] == Color.yellow && board[2][0] == Color.yellow && board[3][0] == Color.yellow){\r\n\t\t\t\tboard[0][0] = Color.yellow;\r\n\t\t\t\tboard[0][1] = Color.yellow;\r\n\t\t\t\tboard[0][2] = Color.yellow;\r\n\t\t\t\tboard[0][3] = Color.yellow;\r\n\t\t\t\tboard[1][0] = Color.yellow;\r\n\t\t\t\tboard[1][1] = Color.yellow;\r\n\t\t\t\tboard[1][2] = Color.yellow;\r\n\t\t\t\tboard[1][3] = Color.yellow;\r\n\t\t\t\tboard[2][0] = Color.yellow;\r\n\t\t\t\tboard[2][1] = Color.yellow;\r\n\t\t\t\tboard[2][2] = Color.yellow;\r\n\t\t\t\tboard[2][3] = Color.yellow;\r\n\t\t\t\tboard[3][0] = Color.yellow;\r\n\t\t\t\tboard[3][1] = Color.yellow;\r\n\t\t\t\tboard[3][2] = Color.yellow;\r\n\t\t\t\tboard[3][3] = Color.yellow;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(board[0][1] == Color.yellow && board[1][1] == Color.yellow && board[2][1] == Color.yellow && board[3][1] == Color.yellow){\r\n\t\t\t\tboard[0][0] = Color.yellow;\r\n\t\t\t\tboard[0][1] = Color.yellow;\r\n\t\t\t\tboard[0][2] = Color.yellow;\r\n\t\t\t\tboard[0][3] = Color.yellow;\r\n\t\t\t\tboard[1][0] = Color.yellow;\r\n\t\t\t\tboard[1][1] = Color.yellow;\r\n\t\t\t\tboard[1][2] = Color.yellow;\r\n\t\t\t\tboard[1][3] = Color.yellow;\r\n\t\t\t\tboard[2][0] = Color.yellow;\r\n\t\t\t\tboard[2][1] = Color.yellow;\r\n\t\t\t\tboard[2][2] = Color.yellow;\r\n\t\t\t\tboard[2][3] = Color.yellow;\r\n\t\t\t\tboard[3][0] = Color.yellow;\r\n\t\t\t\tboard[3][1] = Color.yellow;\r\n\t\t\t\tboard[3][2] = Color.yellow;\r\n\t\t\t\tboard[3][3] = Color.yellow;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(board[0][2] == Color.yellow && board[1][2] == Color.yellow && board[2][2] == Color.yellow && board[3][2] == Color.yellow){\r\n\t\t\t\tboard[0][0] = Color.yellow;\r\n\t\t\t\tboard[0][1] = Color.yellow;\r\n\t\t\t\tboard[0][2] = Color.yellow;\r\n\t\t\t\tboard[0][3] = Color.yellow;\r\n\t\t\t\tboard[1][0] = Color.yellow;\r\n\t\t\t\tboard[1][1] = Color.yellow;\r\n\t\t\t\tboard[1][2] = Color.yellow;\r\n\t\t\t\tboard[1][3] = Color.yellow;\r\n\t\t\t\tboard[2][0] = Color.yellow;\r\n\t\t\t\tboard[2][1] = Color.yellow;\r\n\t\t\t\tboard[2][2] = Color.yellow;\r\n\t\t\t\tboard[2][3] = Color.yellow;\r\n\t\t\t\tboard[3][0] = Color.yellow;\r\n\t\t\t\tboard[3][1] = Color.yellow;\r\n\t\t\t\tboard[3][2] = Color.yellow;\r\n\t\t\t\tboard[3][3] = Color.yellow;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(board[0][0] == Color.yellow && board[1][1] == Color.yellow && board[2][2] == Color.yellow && board[3][3] == Color.yellow){\r\n\t\t\t\tboard[0][0] = Color.yellow;\r\n\t\t\t\tboard[0][1] = Color.yellow;\r\n\t\t\t\tboard[0][2] = Color.yellow;\r\n\t\t\t\tboard[0][3] = Color.yellow;\r\n\t\t\t\tboard[1][0] = Color.yellow;\r\n\t\t\t\tboard[1][1] = Color.yellow;\r\n\t\t\t\tboard[1][2] = Color.yellow;\r\n\t\t\t\tboard[1][3] = Color.yellow;\r\n\t\t\t\tboard[2][0] = Color.yellow;\r\n\t\t\t\tboard[2][1] = Color.yellow;\r\n\t\t\t\tboard[2][2] = Color.yellow;\r\n\t\t\t\tboard[2][3] = Color.yellow;\r\n\t\t\t\tboard[3][0] = Color.yellow;\r\n\t\t\t\tboard[3][1] = Color.yellow;\r\n\t\t\t\tboard[3][2] = Color.yellow;\r\n\t\t\t\tboard[3][3] = Color.yellow;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(board[3][0] == Color.yellow && board[1][2] == Color.yellow && board[2][1] == Color.yellow && board[0][3] == Color.yellow){\r\n\t\t\t\tboard[0][0] = Color.yellow;\r\n\t\t\t\tboard[0][1] = Color.yellow;\r\n\t\t\t\tboard[0][2] = Color.yellow;\r\n\t\t\t\tboard[0][3] = Color.yellow;\r\n\t\t\t\tboard[1][0] = Color.yellow;\r\n\t\t\t\tboard[1][1] = Color.yellow;\r\n\t\t\t\tboard[1][2] = Color.yellow;\r\n\t\t\t\tboard[1][3] = Color.yellow;\r\n\t\t\t\tboard[2][0] = Color.yellow;\r\n\t\t\t\tboard[2][1] = Color.yellow;\r\n\t\t\t\tboard[2][2] = Color.yellow;\r\n\t\t\t\tboard[2][3] = Color.yellow;\r\n\t\t\t\tboard[3][0] = Color.yellow;\r\n\t\t\t\tboard[3][1] = Color.yellow;\r\n\t\t\t\tboard[3][2] = Color.yellow;\r\n\t\t\t\tboard[3][3] = Color.yellow;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif(board[0][0] == Color.red && board[0][1] == Color.red && board[0][2] == Color.red && board[0][3] == Color.red){\r\n\t\t\t\tboard[0][0] = Color.red;\r\n\t\t\t\tboard[0][1] = Color.red;\r\n\t\t\t\tboard[0][2] = Color.red;\r\n\t\t\t\tboard[0][3] = Color.red;\r\n\t\t\t\tboard[1][0] = Color.red;\r\n\t\t\t\tboard[1][1] = Color.red;\r\n\t\t\t\tboard[1][2] = Color.red;\r\n\t\t\t\tboard[1][3] = Color.red;\r\n\t\t\t\tboard[2][0] = Color.red;\r\n\t\t\t\tboard[2][1] = Color.red;\r\n\t\t\t\tboard[2][2] = Color.red;\r\n\t\t\t\tboard[2][3] = Color.red;\r\n\t\t\t\tboard[3][0] = Color.red;\r\n\t\t\t\tboard[3][1] = Color.red;\r\n\t\t\t\tboard[3][2] = Color.red;\r\n\t\t\t\tboard[3][3] = Color.red;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(board[1][0] == Color.red && board[1][1] == Color.red && board[1][2] == Color.red && board[1][3] == Color.red){\r\n\t\t\t\tboard[0][0] = Color.red;\r\n\t\t\t\tboard[0][1] = Color.red;\r\n\t\t\t\tboard[0][2] = Color.red;\r\n\t\t\t\tboard[0][3] = Color.red;\r\n\t\t\t\tboard[1][0] = Color.red;\r\n\t\t\t\tboard[1][1] = Color.red;\r\n\t\t\t\tboard[1][2] = Color.red;\r\n\t\t\t\tboard[1][3] = Color.red;\r\n\t\t\t\tboard[2][0] = Color.red;\r\n\t\t\t\tboard[2][1] = Color.red;\r\n\t\t\t\tboard[2][2] = Color.red;\r\n\t\t\t\tboard[2][3] = Color.red;\r\n\t\t\t\tboard[3][0] = Color.red;\r\n\t\t\t\tboard[3][1] = Color.red;\r\n\t\t\t\tboard[3][2] = Color.red;\r\n\t\t\t\tboard[3][3] = Color.red;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(board[2][0] == Color.red && board[2][1] == Color.red && board[2][2] == Color.red && board[2][3] == Color.red){\r\n\t\t\t\tboard[0][0] = Color.red;\r\n\t\t\t\tboard[0][1] = Color.red;\r\n\t\t\t\tboard[0][2] = Color.red;\r\n\t\t\t\tboard[0][3] = Color.red;\r\n\t\t\t\tboard[1][0] = Color.red;\r\n\t\t\t\tboard[1][1] = Color.red;\r\n\t\t\t\tboard[1][2] = Color.red;\r\n\t\t\t\tboard[1][3] = Color.red;\r\n\t\t\t\tboard[2][0] = Color.red;\r\n\t\t\t\tboard[2][1] = Color.red;\r\n\t\t\t\tboard[2][2] = Color.red;\r\n\t\t\t\tboard[2][3] = Color.red;\r\n\t\t\t\tboard[3][0] = Color.red;\r\n\t\t\t\tboard[3][1] = Color.red;\r\n\t\t\t\tboard[3][2] = Color.red;\r\n\t\t\t\tboard[3][3] = Color.red;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(board[0][0] == Color.red && board[1][0] == Color.red && board[2][0] == Color.red && board[3][0] == Color.red){\r\n\t\t\t\tboard[0][0] = Color.red;\r\n\t\t\t\tboard[0][1] = Color.red;\r\n\t\t\t\tboard[0][2] = Color.red;\r\n\t\t\t\tboard[0][3] = Color.red;\r\n\t\t\t\tboard[1][0] = Color.red;\r\n\t\t\t\tboard[1][1] = Color.red;\r\n\t\t\t\tboard[1][2] = Color.red;\r\n\t\t\t\tboard[1][3] = Color.red;\r\n\t\t\t\tboard[2][0] = Color.red;\r\n\t\t\t\tboard[2][1] = Color.red;\r\n\t\t\t\tboard[2][2] = Color.red;\r\n\t\t\t\tboard[2][3] = Color.red;\r\n\t\t\t\tboard[3][0] = Color.red;\r\n\t\t\t\tboard[3][1] = Color.red;\r\n\t\t\t\tboard[3][2] = Color.red;\r\n\t\t\t\tboard[3][3] = Color.red;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(board[0][1] == Color.red && board[1][1] == Color.red && board[2][1] == Color.red && board[3][1] == Color.red){\r\n\t\t\t\tboard[0][0] = Color.red;\r\n\t\t\t\tboard[0][1] = Color.red;\r\n\t\t\t\tboard[0][2] = Color.red;\r\n\t\t\t\tboard[0][3] = Color.red;\r\n\t\t\t\tboard[1][0] = Color.red;\r\n\t\t\t\tboard[1][1] = Color.red;\r\n\t\t\t\tboard[1][2] = Color.red;\r\n\t\t\t\tboard[1][3] = Color.red;\r\n\t\t\t\tboard[2][0] = Color.red;\r\n\t\t\t\tboard[2][1] = Color.red;\r\n\t\t\t\tboard[2][2] = Color.red;\r\n\t\t\t\tboard[2][3] = Color.red;\r\n\t\t\t\tboard[3][0] = Color.red;\r\n\t\t\t\tboard[3][1] = Color.red;\r\n\t\t\t\tboard[3][2] = Color.red;\r\n\t\t\t\tboard[3][3] = Color.red;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(board[0][2] == Color.red && board[1][2] == Color.red && board[2][2] == Color.red && board[3][2] == Color.red){\r\n\t\t\t\tboard[0][0] = Color.red;\r\n\t\t\t\tboard[0][1] = Color.red;\r\n\t\t\t\tboard[0][2] = Color.red;\r\n\t\t\t\tboard[0][3] = Color.red;\r\n\t\t\t\tboard[1][0] = Color.red;\r\n\t\t\t\tboard[1][1] = Color.red;\r\n\t\t\t\tboard[1][2] = Color.red;\r\n\t\t\t\tboard[1][3] = Color.red;\r\n\t\t\t\tboard[2][0] = Color.red;\r\n\t\t\t\tboard[2][1] = Color.red;\r\n\t\t\t\tboard[2][2] = Color.red;\r\n\t\t\t\tboard[2][3] = Color.red;\r\n\t\t\t\tboard[3][0] = Color.red;\r\n\t\t\t\tboard[3][1] = Color.red;\r\n\t\t\t\tboard[3][2] = Color.red;\r\n\t\t\t\tboard[3][3] = Color.red;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(board[0][0] == Color.red && board[1][1] == Color.red && board[2][2] == Color.red && board[3][3] == Color.red){\r\n\t\t\t\tboard[0][0] = Color.red;\r\n\t\t\t\tboard[0][1] = Color.red;\r\n\t\t\t\tboard[0][2] = Color.red;\r\n\t\t\t\tboard[0][3] = Color.red;\r\n\t\t\t\tboard[1][0] = Color.red;\r\n\t\t\t\tboard[1][1] = Color.red;\r\n\t\t\t\tboard[1][2] = Color.red;\r\n\t\t\t\tboard[1][3] = Color.red;\r\n\t\t\t\tboard[2][0] = Color.red;\r\n\t\t\t\tboard[2][1] = Color.red;\r\n\t\t\t\tboard[2][2] = Color.red;\r\n\t\t\t\tboard[2][3] = Color.red;\r\n\t\t\t\tboard[3][0] = Color.red;\r\n\t\t\t\tboard[3][1] = Color.red;\r\n\t\t\t\tboard[3][2] = Color.red;\r\n\t\t\t\tboard[3][3] = Color.red;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(board[3][0] == Color.red && board[1][2] == Color.red && board[2][1] == Color.red && board[0][3] == Color.red){\r\n\t\t\t\tboard[0][0] = Color.red;\r\n\t\t\t\tboard[0][1] = Color.red;\r\n\t\t\t\tboard[0][2] = Color.red;\r\n\t\t\t\tboard[0][3] = Color.red;\r\n\t\t\t\tboard[1][0] = Color.red;\r\n\t\t\t\tboard[1][1] = Color.red;\r\n\t\t\t\tboard[1][2] = Color.red;\r\n\t\t\t\tboard[1][3] = Color.red;\r\n\t\t\t\tboard[2][0] = Color.red;\r\n\t\t\t\tboard[2][1] = Color.red;\r\n\t\t\t\tboard[2][2] = Color.red;\r\n\t\t\t\tboard[2][3] = Color.red;\r\n\t\t\t\tboard[3][0] = Color.red;\r\n\t\t\t\tboard[3][1] = Color.red;\r\n\t\t\t\tboard[3][2] = Color.red;\r\n\t\t\t\tboard[3][3] = Color.red;\r\n\t\t\t}\r\n\t\t\trepaint();\r\n\t\t}\r\n\t}", "private static boolean makeHallway(int[][] board, int[] from, int[] to, float[] filled, Random random) {\n // ignore out of bounds attempts\n if (!(from[X] >= 0 && from[X] < board.length && from[Y] >= 0 && from[Y] < board[0].length)\n || !(to[X] >= 0 && to[X] < board.length && to[Y] >= 0 && to[Y] < board[0].length)) {\n return false;\n }\n\n int x1 = from[X];\n int x2 = to[X];\n int y1 = from[Y];\n int y2 = to[Y];\n\n board[x1][y1] = ROOM;\n board[x2][y2] = ROOM;\n\n filled[0] += 2;\n\n // keep track of directional motion\n int dirX, dirY;\n\n // find initial direction\n if (x2 > x1)\n dirX = 1; // east\n else\n dirX = -1; // west\n if (y2 > y1)\n dirY = 1; // north\n else\n dirY = -1; // south\n\n // move into random direction\n boolean firstHorizontal = random.nextBoolean();\n boolean secondHorizontal = random.nextBoolean();\n\n // making a corridor might take awhile, just continue this iterative\n // process\n while (true) {\n\n if (x1 != x2 && y1 != y2) {\n // adjust the first tile iterator\n if (firstHorizontal)\n x1 += dirX;\n else\n y1 += dirY;\n }\n\n if (x1 != x2 && y1 != y2)\n // still not equal\n {\n // adjust the second tile iterator\n if (secondHorizontal)\n x2 -= dirX;\n else\n y2 -= dirY;\n }\n\n if (board[x1][y1] == NULL) {\n board[x1][y1] = HALL;\n filled[0]++;\n }\n if (board[x2][y2] == NULL) {\n board[x2][y2] = HALL;\n filled[0]++;\n }\n // check once more if the iterators match after moving\n // if the iterators are on the same level, try connecting them\n if (x1 == x2) {\n while (y1 != y2) {\n // adjust y until we reach destination\n y1 += dirY;\n if (board[x1][y1] == NULL) {\n board[x1][y1] = HALL;\n filled[0]++;\n }\n }\n if (board[x1][y1] == NULL) {\n board[x1][y1] = HALL;\n filled[0]++;\n }\n // return that we've connected the hallway successfully\n return true;\n }\n // iterators are on the same level horizontally, so we must now\n // connect across\n if (y1 == y2) {\n while (x1 != x2) {\n // adjust y until we reach destination\n x1 += dirX;\n if (board[x1][y1] == NULL) {\n board[x1][y1] = HALL;\n filled[0]++;\n }\n }\n if (board[x1][y1] == NULL) {\n board[x1][y1] = HALL;\n filled[0]++;\n }\n return true;\n }\n }\n }", "@Test\n\tpublic void playBuildRoadsCardFailure() throws Exception\n\t{\n\t\t// Set up variables\n\t\tEdge e1 = n.getEdges().get(0);\n\t\tint oldResources = 0;\n\n\t\t// Set up development card\n\t\tp.grantResources(DevelopmentCardType.getCardCost(), game.getBank());\n\t\tDevelopmentCardType card = DevelopmentCardType.RoadBuilding;\n\t\tp.buyDevelopmentCard(card, game.getBank());\n\n\t\t// Reset recent dev card for player, so they can play this turn\n\t\tgame.getPlayer(game.getCurrentPlayer()).clearRecentDevCards();\n\n\t\t// Grant resources and make settlement\n\t\tp.grantResources(Settlement.getSettlementCost(), game.getBank());\n\t\tp.grantResources(Road.getRoadCost(), game.getBank());\n\t\tp.grantResources(Road.getRoadCost(), game.getBank());\n\t\tmakeSettlement(p, n);\n\n\t\t// Set up Road building card request, play the card\n\t\tRequests.Request.Builder req = Requests.Request.newBuilder();\n\t\treq.setPlayDevCard(Board.PlayableDevCard.ROAD_BUILDING);\n\t\tassertEquals(0, server.getExpectedMoves(p.getColour()).size());\n\t\tserver.addMessageToProcess(\n\t\t\t\tnew ReceivedMessage(p.getColour(), Messages.Message.newBuilder().setRequest(req).build()));\n\t\tserver.processMessage();\n\t\tassertEquals(2, server.getExpectedMoves(p.getColour()).size());\n\n\t\t// Now request to build a road\n\t\treq.clearPlayDevCard();\n\t\treq.setBuildRoad(e1.toEdgeProto());\n\t\tserver.addMessageToProcess(\n\t\t\t\tnew ReceivedMessage(p.getColour(), Messages.Message.newBuilder().setRequest(req).build()));\n\t\tserver.processMessage();\n\t\tassertEquals(1, server.getExpectedMoves(p.getColour()).size());\n\t\tassertEquals(1, p.getRoads().size());\n\t\tassertTrue(p.getRoads().get(0).getEdge().equals(e1));\n\n\t\t// ATTEMPT to build road in same location\n\t\treq.setBuildRoad(e1.toEdgeProto());\n\t\tserver.addMessageToProcess(\n\t\t\t\tnew ReceivedMessage(p.getColour(), Messages.Message.newBuilder().setRequest(req).build()));\n\t\tserver.processMessage();\n\n\t\t// Assert that server is STILL expecting a new road request, & only one\n\t\t// road was built\n\t\tassertEquals(1, server.getExpectedMoves(p.getColour()).size());\n\t\tassertTrue(server.getExpectedMoves(p.getColour()).get(0).equals(Requests.Request.BodyCase.BUILDROAD));\n\t\tassertEquals(1, p.getRoads().size());\n\t}", "public void playOn(int x, int y)\r\n\t{\r\n\t\t//Converts x positions to array indices.\r\n\t\tx--;\r\n\t\ty--;\r\n\t\t//The x and y inputs need to be within the board boundaries.\r\n\t\tif(x>=0 && x<grid.length && y>=0 && y<grid.length)\r\n\t\t{\r\n\t\t\t//The UI grid will be updated.\r\n\t\t\t/*This method will have to be resolved.\r\n\t\t\tif(ships.hitsShipOn(x, y))\r\n\t\t\t\t\tgrid[x][y] = 1;\r\n\t\t\telse\r\n\t\t\t\t\tgrid[x][y] = -1;*/\r\n\t\t}\r\n\t\t\t\r\n\t}", "public void testContainsEdgeEdge( ) {\n init( );\n\n //TODO Implement containsEdge().\n }", "public void act() \n {\n move(3);\n turnAtEdge(); \n StrikeSeaHorse();\n }", "@Test\n public void play_FullHouseVsFullHouse() throws Exception {\n Hand hand1 = new Hand();\n hand1.addCard(new Card(Card.SUIT_HEARTS, Card.CARD_5));\n hand1.addCard(new Card(Card.SUIT_SPADES, Card.CARD_5));\n hand1.addCard(new Card(Card.SUIT_CLUBS, Card.CARD_7));\n hand1.addCard(new Card(Card.SUIT_DIAMONDS, Card.CARD_7));\n hand1.addCard(new Card(Card.SUIT_HEARTS, Card.CARD_7));\n Hand hand2 = new Hand();\n hand2.addCard(new Card(Card.SUIT_CLUBS, Card.CARD_10));\n hand2.addCard(new Card(Card.SUIT_DIAMONDS, Card.CARD_10));\n hand2.addCard(new Card(Card.SUIT_HEARTS, Card.CARD_ACE));\n hand2.addCard(new Card(Card.SUIT_SPADES, Card.CARD_ACE));\n hand2.addCard(new Card(Card.SUIT_CLUBS, Card.CARD_ACE));\n assertEquals(hand2, FiveCardDraw.play(hand1, hand2));\n }", "static public void edge(Edge edge,float dx,float dy){\n edge.aX+=dx;\n edge.aY+=dy;\n edge.bX+=dx;\n edge.bY+=dy;\n edge.ghostAY+=dx;\n edge.ghostAY+=dy;\n edge.ghostBX+=dx;\n edge.ghostBY+=dy;\n }", "public RedAlien(int toEdge, int toRight) {\n super(GameConfig.getRedPath());\n this.y = toEdge;\n this.x = toRight;\n row = toEdge;\n column = toRight;\n angle = 0;\n st = new RedAlienState.Normal();\n isMovingRight = true;\n points = basePoints + 100*health;\n list = new ArrayList<AlienMissile>();\n health = baseHealth + 1;\n toSpot = 0;\n }", "public void turnOn(int x, int y);", "void playSoldierCard(int victimIndex, HexLocation location);", "private void goKnight(Board B, Graph G) {\n\n int start = B.knight;\n int end = B.gold;\n\n Queue<Integer> q = new Queue<Integer>();\n for (int v = 0; v < G.V(); v++)\n distTo[v] = INFINITY;\n\n int v = -1;\n distTo[start] = 0;\n marked[start] = true;\n q.enqueue(start);\n\n while (!q.isEmpty() && end != v) {\n v = q.dequeue();\n\n\n int tl_dest_R = (v / B.width);\n int tl_dest_C = (v % B.width);\n\n ArrayList<Integer> destinations = new ArrayList<Integer>();\n\n for (Move M : G.moves) {\n\n\n if (validateMove(M, v, G, B)) {\n\n if (true) {\n\n //System.out.println(thereispath(M, B.a.get(tl_dest_R).get(tl_dest_C), newDestination(M, v, G, B), G, B));\n\n if (!marked[newDestination(M, v, G, B)]) {\n\n\n q.enqueue(newDestination(M, v, G, B));\n marked[newDestination(M, v, G, B)] = true;\n edgeTo[newDestination(M, v, G, B)] = v;\n distTo[newDestination(M, v, G, B)] = distTo[v] + 1;\n\n // System.out.println(newDestination(M, v, G, B) + \" \" + edgeTo[newDestination(M, v, G, B)]);\n\n }\n\n\n }\n\n // System.out.println();\n\n }\n\n }\n\n\n //break;\n }\n\n System.out.println();\n\n Stack<Integer> reverse = new Stack<Integer>();\n\n\n int temp = end;\n reverse.push(temp);\n\n while (true) {\n\n\n temp = edgeTo[temp];\n reverse.push(temp);\n\n if (temp == start)\n break;\n }\n\n int last = 0;\n\n int temp_row = 0, temp_column = 0;\n\n String te = \"\";\n\n while (!reverse.isEmpty()) {\n\n if (last != 0) {\n te += \" -> \";\n }\n\n\n last = reverse.pop();\n\n\n temp_row = last / B.width;\n temp_column = last % B.width;\n\n\n te += B.a.get(temp_row).get(temp_column).toT();\n\n\n }\n\n if (distTo[last] == INFINITY) {\n System.out.println(\"No path to the target.\");\n } else {\n\n int a = 0, b = 0;\n\n a = B.gold / B.width;\n b = B.gold % B.width;\n int c = 0, d = 0;\n\n c = B.knight / B.width;\n d = B.knight % B.width;\n\n System.out.println(distTo[last] + \" steps\");\n System.out.println(B.a.get(c).get(d).toT() + \" to \" + B.a.get(a).get(b).toT() + \": \" + te);\n\n }\n\n\n }", "int otherface(int edge, int face) {\n int other = leftface[edge];\n return face == other ? rightface[edge] : other;\n }", "Road(boolean h, MP m){\n\t\t time = m.getLifeTime();\n\t\t horizontal = h; \n\t\t _MP = m;\n\t\t endPosition = _MP.createRandom(_MP.getRoadLengthMin(), _MP.getRoadLengthMax());\n\t }", "public void playMove(int[] move, int side, BoardModel board) {\n\t\tboard.placeOnBoard(move, side);\n\t\t\n\t\t//we kunnen niet getOpponentSide gebruiken, omdat deze ook gebruikt wordt \n\t\t//voor de opponent. Daarom ff zo :)\n\t\tint opponent = 0;\n\t\tif(side == 0) opponent = 1;\n\t\t\n\t\t//nu gaan we alle shit omflippen...\n\t\tfor(int[] surround : surroundingCoordinates(move[0], move[1])) {\n\t\t\t//zo'n aanliggende positie moet van de tegenstander zijn\n\t\t\tif(board.getBoardValue(surround[0], surround[1]) == opponent){\n\t\t\t\t//nu moeten we gaan kijken of we verderop w�l onzelf tegenkomen!\n\t\t\t\t//wat is de relatieve waarde van de aanliggende positie ten opzichte van de geteste positie?\n\t\t\t\tint row_diff = surround[0] - move[0];\n\t\t\t\tint col_diff = surround[1] - move[1];\n\t\t\t\tflipMoves.clear();\n\t\t\t\tif(checkNext((move[0]+row_diff), (move[1]+col_diff), row_diff, col_diff, side, board)){\n\t\t\t\t\tfor(int[] flipMove : flipMoves){\n\t\t\t\t\t\tboard.placeOnBoard(flipMove, side);\n\t\t\t\t\t}\n\t\t\t\t\tflipMoves.clear();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Test\n public void play_TwoPairVsTwoPair() throws Exception {\n Hand hand1 = new Hand();\n hand1.addCard(new Card(Card.SUIT_SPADES, Card.CARD_2));\n hand1.addCard(new Card(Card.SUIT_HEARTS, Card.CARD_2));\n hand1.addCard(new Card(Card.SUIT_DIAMONDS, Card.CARD_3));\n hand1.addCard(new Card(Card.SUIT_HEARTS, Card.CARD_3));\n hand1.addCard(new Card(Card.SUIT_DIAMONDS, Card.CARD_5));\n Hand hand2 = new Hand();\n hand2.addCard(new Card(Card.SUIT_SPADES, Card.CARD_8));\n hand2.addCard(new Card(Card.SUIT_HEARTS, Card.CARD_8));\n hand2.addCard(new Card(Card.SUIT_DIAMONDS, Card.CARD_9));\n hand2.addCard(new Card(Card.SUIT_HEARTS, Card.CARD_9));\n hand2.addCard(new Card(Card.SUIT_DIAMONDS, Card.CARD_10));\n assertEquals(hand2, FiveCardDraw.play(hand1, hand2));\n }", "public HexBoard(int boardSize,boolean playerOne) {\n this.playerOne = playerOne;\n board = new int[boardSize+5];\n Arrays.fill(board,0);\n boardWidth = (int) java.lang.Math.sqrt(board.length);\n\n //making final constants to store winning paths\n TOP = board.length -4;\n BOTTOM = board.length -3;\n LEFT = board.length -2;\n RIGHT = board.length -1;\n\n }", "void addEdge(int s1,int c,int s2)\r\n\t{\r\n\t\tg[s1][c][s2]=true;\r\n\t}", "@Test\n\t\t\tpublic void adjacentToDoorwayTest() {\n\t\t\t\t//Tests with a space to the left of a leftward door\n\t\t\t\tSet<BoardCell> testList = board.getAdjList(11, 15);\n\t\t\t\tassertTrue(testList.contains(board.getCellAt(11, 16)));\n\t\t\t\t//Tests with a space to the right of a rightward door\n\t\t\t\ttestList = board.getAdjList(12, 7);\n\t\t\t\tassertTrue(testList.contains(board.getCellAt(12, 6)));\n\t\t\t\t//Tests with a space below a downward door\n\t\t\t\ttestList = board.getAdjList(6, 15);\n\t\t\t\tassertTrue(testList.contains(board.getCellAt(5, 15)));\n\t\t\t\t//Tests with a space above an upward door\n\t\t\t\ttestList = board.getAdjList(15, 19);\n\t\t\t\tassertTrue(testList.contains(board.getCellAt(16, 19)));\n\t\t\t\n\t\t\t}", "public void crossEdge(Edge e) {}", "private void redSouthTurnLeft(int intersection) {\n int index = getIntersectionIndex(intersection);\n isGreenSouthTurnLeft[index] = false;\n }", "void findDown(Board board) {\n if (tile.getRowPos() != 6) {\n Tile downTile = board.getTileObjByPosition(tile.getRowPos() + 1, tile.getColPos());\n if (downTile != null) {\n if (RailroadInk.areConnectedNeighbours(tile.getPlacementStr(), downTile.getPlacementStr())) {\n Node downNode;\n if ((downTile.graphId > 0) || ((downTile.graphId == -1) && (downTile.downId == graphId))) {\n downNode = nodeMap.get(downTile.pos);\n } else {\n downNode = new Node(downTile);\n if (downTile.name.equals(\"B2\")) {\n downTile.upId = graphId;\n }\n nodeMap.put(downTile.pos, downNode);\n }\n\n // Update the connection relationship.\n this.down = downNode;\n downNode.up = this;\n if (this.tile.name.equals(\"B2\")) {\n this.tile.downId = graphId;\n }\n\n if ((!downTile.name.equals(\"B2\")) && (downNode.right == null)) {\n downNode.findRight(board);\n }\n if (downNode.down == null) {\n downNode.findDown(board);\n }\n if ((!downTile.name.equals(\"B2\")) && (downNode.left == null)) {\n downNode.findLeft(board);\n }\n\n }\n }\n }\n }", "void nextToPlay(StoneColor _nextToPlay);", "public void Excute() {\n Node img1 = new Node(\"Branche1\", 1);\r\n Node img2 = new Node(\"Branche2\", 2);\r\n Node img3 = new Node(\"Branche3\", 3);\r\n Node img4 = new Node(\"Branche4\", 4);\r\n Node img5 = new Node(\"Branche5\", 5);\r\n Node img6 = new Node(\"Branche6\", 6);\r\n Node img7 = new Node(\"Branche7\", 7);\r\n Node img8 = new Node(\"Branche8\", 8);\r\n Node img9 = new Node(\"Branche9\", 9);\r\n\r\n // creat the edges from class Edge and connection the edges(scene bulider) , nodes(that creat from class Node) , weight , node(scene bulider) \r\n Edge edge1 = new Edge(4, img1, img2, this.edg1);\r\n Edge edge2 = new Edge(5, img1, img8, this.edg2);\r\n Edge edge3 = new Edge(8, img2, img3, this.edg3);\r\n Edge edge4 = new Edge(11, img2, img8, this.edg4);\r\n Edge edge5 = new Edge(4, img2, img1, this.edg1);\r\n Edge edge6 = new Edge(1, img3, img4, this.edg5);\r\n Edge edge7 = new Edge(4, img3, img6, this.edg6);\r\n Edge edge8 = new Edge(2, img3, img9, this.edg7);\r\n Edge edge9 = new Edge(8, img3, img2, this.edg3);\r\n Edge edge10 = new Edge(9, img4, img5, this.edg8);\r\n Edge edge11 = new Edge(14, img4, img6, this.edg9);\r\n Edge edge12 = new Edge(7, img4, img3, this.edg5);\r\n Edge edge13 = new Edge(10, img5, img6, this.edg10);\r\n Edge edge14 = new Edge(9, img5, img4, this.edg8);\r\n Edge edge15 = new Edge(10, img6, img5, this.edg10);\r\n Edge edge16 = new Edge(14, img6, img4, this.edg9);\r\n Edge edge17 = new Edge(4, img6, img3, this.edg6);\r\n Edge edge18 = new Edge(2, img6, img7, this.edg11);\r\n Edge edge19 = new Edge(6, img7, img9, this.edg12);\r\n Edge edge20 = new Edge(1, img7, img8, this.edg13);\r\n Edge edge21 = new Edge(2, img7, img6, this.edg11);\r\n Edge edge22 = new Edge(7, img8, img9, this.edg14);\r\n Edge edge23 = new Edge(11, img8, img2, this.edg4);\r\n Edge edge24 = new Edge(5, img8, img1, this.edg2);\r\n Edge edge25 = new Edge(1, img8, img7, this.edg13);\r\n Edge edge26 = new Edge(7, img9, img8, this.edg14);\r\n Edge edge27 = new Edge(2, img9, img3, this.edg7);\r\n Edge edge28 = new Edge(6, img9, img7, this.edg12);\r\n\r\n //System.out.println(edg1.getId());\r\n // add per the node the edges them to it\r\n ArrayList img1Edges = new ArrayList<>();\r\n img1Edges.add(edge1);\r\n img1Edges.add(edge2);\r\n img1.setEdge(img1Edges);\r\n //Collections.sort(img1Edges);\r\n //----------------------------------------------------------------\r\n ArrayList img2Edges = new ArrayList<>();\r\n img2Edges.add(edge3);\r\n img2Edges.add(edge4);\r\n img2Edges.add(edge5);\r\n img2.setEdge(img2Edges);\r\n //Collections.sort(img2Edges);\r\n //----------------------------------------------------------------\r\n ArrayList img3Edges = new ArrayList<>();\r\n img3Edges.add(edge6);\r\n img3Edges.add(edge7);\r\n img3Edges.add(edge8);\r\n img3Edges.add(edge9);\r\n img3.setEdge(img3Edges);\r\n //Collections.sort(img3Edges);\r\n //----------------------------------------------------------------\r\n ArrayList img4Edges = new ArrayList<>();\r\n img4Edges.add(edge10);\r\n img4Edges.add(edge11);\r\n img4Edges.add(edge12);\r\n img4.setEdge(img4Edges);\r\n //Collections.sort(img4Edges);\r\n //----------------------------------------------------------------\r\n ArrayList img5Edges = new ArrayList<>();\r\n img5Edges.add(edge13);\r\n img5Edges.add(edge14);\r\n img5.setEdge(img5Edges);\r\n //Collections.sort(img5Edges);\r\n //----------------------------------------------------------------\r\n ArrayList img6Edges = new ArrayList<>();\r\n img6Edges.add(edge15);\r\n img6Edges.add(edge16);\r\n img6Edges.add(edge17);\r\n img6Edges.add(edge18);\r\n img6.setEdge(img6Edges);\r\n //Collections.sort(img6Edges);\r\n //----------------------------------------------------------------\r\n ArrayList img7Edges = new ArrayList<>();\r\n img7Edges.add(edge19);\r\n img7Edges.add(edge20);\r\n img7Edges.add(edge21);\r\n img7.setEdge(img7Edges);\r\n //Collections.sort(img7Edges);\r\n //----------------------------------------------------------------\r\n ArrayList img8Edges = new ArrayList<>();\r\n img8Edges.add(edge22);\r\n img8Edges.add(edge23);\r\n img8Edges.add(edge24);\r\n img8Edges.add(edge25);\r\n img8.setEdge(img8Edges);\r\n //Collections.sort(img8Edges);\r\n //----------------------------------------------------------------\r\n ArrayList img9Edges = new ArrayList<>();\r\n img9Edges.add(edge26);\r\n img9Edges.add(edge27);\r\n img9Edges.add(edge28);\r\n img9.setEdge(img9Edges);\r\n //Collections.sort(img9Edges);\r\n\r\n // Add all the nodes in array \r\n nodes = new ArrayList<>();\r\n nodes.add(img1);\r\n nodes.add(img2);\r\n nodes.add(img3);\r\n nodes.add(img4);\r\n nodes.add(img5);\r\n nodes.add(img6);\r\n nodes.add(img7);\r\n nodes.add(img8);\r\n nodes.add(img9);\r\n\r\n ObservableList<Node> userobserblood = FXCollections.observableArrayList(nodes);\r\n nodeStart.getItems().addAll(userobserblood);\r\n nodeStart.setPrefWidth(150);\r\n ObservableList<Node> uuserobserblood = FXCollections.observableArrayList(nodes);\r\n nodeEnd.getItems().addAll(uuserobserblood);\r\n nodeEnd.setPrefWidth(150);\r\n }", "@Override\n\tpublic void mousePressed(MouseEvent me) {\n\t\tint x = me.getX();\n\t\tint y = me.getY();\n\t\tx = (int)( (x-mrg_x+spc_x/2) / spc_x) + nWALL;\n\t\ty = (int)( (y-mrg_y+spc_y/2) / spc_y) + nWALL;\n\t\t\n\t\tif (isPlaying && arr[x][y] == NONE) {\n\t\t// TODO Auto-generated method stub\n\t\t\t\n\t\t\t\n\t\t\tint t = (n+isWhiteWin+1) %2 ;\n\t\t\t\n\t\t\tif ( is33(x, y, (t%2==0)? WHITE:BLACK) ) {\n\t\t\t\t\n\t\t\t\tGraphics g = cvBoard.getGraphics();\n\t\t\t\tg.setColor(Color.red);\n\t\t\t\tg.drawOval((int) (mrg_x + (x-nWALL) * spc_x - spc_x/2) ,\n\t\t\t\t\t\t(int) (mrg_y + (y-nWALL) * spc_y -spc_y/2),\n\t\t\t\t\t\t(int) spc_x-1, (int) spc_y-1);\n\t\t\t\tg.fillOval((int) (mrg_x + (x-nWALL) * spc_x - spc_x/2) ,\n\t\t\t\t\t\t(int) (mrg_y + (y-nWALL) * spc_y -spc_y/2),\n\t\t\t\t\t\t(int) spc_x, (int) spc_y);\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t}", "boolean CanUseRoadBuilder(EdgeLocation spot1, EdgeLocation spot2);", "public static void main(String[] args) {\n Board b = new Board();\n Scanner in = new Scanner(System.in);\n\n Random r = new Random(System.currentTimeMillis());\n int start = Math.abs(r.nextInt()) % 2;\n int init = start;\n // Daca start este 1, incepe calculatorul, altfel jucatorul\n PLAYER perspective = PLAYER.PLAY_AS_X;\n // X mereu va avea prima mutare\n\n\n while (b.GetWinner() == WINNER.PLAYER_NONE) {\n Pair current_move;\n if (start == 1) {\n System.out.println(\"Computer is thinking...\");\n Board newBoard = new Board(b);\n current_move = PlayMove(newBoard, perspective);\n System.out.println(\"Computer chose move: (\" + current_move.first +\" \" + current_move.second + \")\");\n } else {\n int row, col;\n System.out.println(\"It's your turn, enter move:\");\n do {\n System.out.println(\"Row:\");\n row = in.nextInt();\n } while (row < 0 || row > 2);\n do {\n System.out.println(\"Column:\");\n col = in.nextInt();\n } while (col < 0 || col > 2);\n current_move = new Pair(row, col);\n }\n if (b.GetMark(current_move.first, current_move.second) != MARK.NONE) {\n System.out.println(\"Invalid move, exiting\");\n return;\n }\n if (perspective == PLAYER.PLAY_AS_X) {\n b.MarkX(current_move.first, current_move.second);\n } else {\n b.MarkZero(current_move.first, current_move.second);\n }\n start = 1 - start;\n perspective = (perspective == PLAYER.PLAY_AS_X) ? PLAYER.PLAY_AS_ZERO : PLAYER.PLAY_AS_X;\n System.out.println(\"Current board is:\\n\" + b);\n }\n\n System.out.println(\"Game is finished\");\n if (b.GetWinner() == WINNER.PLAYER_X) {\n if (init == 1) {\n System.out.println(\"Computer won\");\n return;\n }\n System.out.println(\"Player won, you should at most draw, keep working on the AI\");\n return;\n }\n if (b.GetWinner() == WINNER.PLAYER_ZERO) {\n if (init == 1) {\n System.out.println(\"Player won, you should at most draw, keep working on the AI\");\n return;\n }\n System.out.println(\"Computer won\");\n return;\n }\n System.out.println(\"Draw, Well Done!\");\n return;\n }", "private void splitEdgeDetection() {\n\t\tif(!currentlyDetecting)\n {\n detectRisingEdge();\n }else{//if currentlyDetecting is true, then we are looking for a falling edge\n detectFallingEdge();\n }\n\t}", "private void coins_a2R(){\n\t\tthis.cube[13] = this.cube[53]; \n\t\tthis.cube[53] = this.cube[18];\n\t\tthis.cube[18] = this.cube[0];\n\t\tthis.cube[0] = this.cube[27];\n\t\tthis.cube[27] = this.cube[13];\n\t}", "public void act() \r\n {\r\n move(5);\r\n if(isAtEdge())\r\n turn(4);\r\n if(Greenfoot.getRandomNumber(35) < 34)\r\n turn(10);\r\n if(Greenfoot.getRandomNumber(20)<5)\r\n turn(-15);\r\n }", "private void greenEastTurnRight(int intersection, double time) {\n int index = getIntersectionIndex(intersection);\n isGreenEastTurnRight[index] = true;\n LinkedList<Vehicle> vehQueue = eastVehs.get(index);\n if (!vehQueue.isEmpty()) {\n Vehicle firstVeh = vehQueue.getLast();\n ProcessEvents.getEventQueue().add(new Event(time, EventType.Departure, intersection,\n Direction.E, firstVeh));\n }\n }", "public static void main(String[] args) throws InterruptedException\r\n {\n\t\t int[] XposT = {5,5,5,5,5}; //XposT and YposT are the Tail positions of the robot\r\n int[] YposT = {5,4,3,2,1}; // all the same, no ititial tail. 5,4,3,2 would give initial tail.\r\n\t\t // we have a variable that sets up the boundries of our snake and his environment.\r\n\t\t int blockSize = 20;\r\n boolean more = true;\r\n Scanner keyboard = new Scanner(System.in);\r\n char direction = ' ';\r\n\r\n\t\t //System.out.println(\"\\033[H\\033[2J\"); //Clear Screen\r\n\r\n cls.cs();\r\n\t\t //print initial instructions\r\n\t\t System.out.println( \"w up, s down, a left, d right, q to quit\");\r\n // direction = keyboard.next().charAt(0);\r\n\r\n while(more){\r\n\r\n\r\n\r\n //Draw:\r\n //System.out.println(\"\\033[H\\033[2J\"); //Clear Screen\r\n\t\t cls.cs();\r\n for(int y=0; y < blockSize; y++) //\r\n {\r\n for(int x=0; x < blockSize; x++) // Print a column\r\n {\r\n if(((x == XposT[0]) && (y == YposT[0])) )\r\n {\r\n System.out.print(\"H\" );\r\n\t\t\t\t //Print Head\r\n }\r\n else if (((x == XposT[1]) && (y == YposT[1]))\r\n\t\t\t || ((x == XposT[2]) && (y == YposT[2])) || ((x == XposT[3]) && (y == YposT[3])) ||\r\n\t\t\t ((x == XposT[4]) && (y == YposT[4]))) {\r\n\t\t\t \tSystem.out.print( \"T\" );\r\n\t\t\t\t// Print Tail\r\n\t\t\t }\r\n\t\t\t else\r\n {\r\n System.out.print(\" \");\r\n }\r\n System.out.print(\" \");\r\n }\r\n System.out.println();\r\n\r\n }//End Draw\r\n System.out.println( \"use: w up, s down, a left, d right, q to quit, then press enter.\");\r\n\r\n\r\n\r\n\t\t for(int i=4; i > 0; i--){\r\n\t\t\tXposT[i] = XposT[i-1];\r\n\t\t\tYposT[i] = YposT[i-1];\r\n\t\t }\r\n\r\n\t\t//XposT[0] = Xpos;\r\n\t\t//YposT[0] = Ypos;\r\n\r\n\t //User Input (Get New Head)\r\n\t\tswitch ( keyboard.next().charAt(0)) {\r\n case 'w': // UP\r\n\t\t case 'W':\r\n YposT[0]--;\r\n\t\t\tif(YposT[0] == -1) YposT[0] = blockSize-1; //9 for raparound, -1 for bounce\r\n break;\r\n case 's': // down\r\n\t\t case 'S':\r\n YposT[0]++;\r\n\t\t\t if(YposT[0] == blockSize) YposT[0] = 0; //1 for raparound, 10 for bounce\r\n break;\r\n case 'a': // Left\r\n XposT[0]--;\r\n\t\t\tif(XposT[0] == -1) XposT[0] = 0; //10 for raparound, 1 for bounce\r\n break;\r\n case 'd': // Right\r\n XposT[0]++;\r\n\t\t\tif(XposT[0] == blockSize) XposT[0] = blockSize - 1; //1 for raparound, 10 for bounce\r\n break;\r\n case 'q': // quit\r\n System.out.println(\"Thank you for playing.\");\r\n\t\t\tmore = false;\r\n break;\r\n\t\t default :\r\n\t\t System.out.println( \" oops, use: w up, s down, a left, d right, q to quit\");\r\n\t\t System.out.println(\"Yikes, an incorrect letter nips at my tail.\");\r\n\t\t System.out.println(\"Hit any letter then enter to continue.\");\r\n\t\t keyboard.next();\r\n\t\t }\r\n } //end while\r\n\t System.out.println(ANSI_RESET);\r\n }", "@Test\n\tpublic void testAdjacencyWalkways()\n\t{\n\t\t// Test on top edge of board, just one walkway piece\n\t\tSet<BoardCell> testList = board.getAdjList(22, 9);\n\t\tassertTrue(testList.contains(board.getCellAt(21, 9)));\n\t\tassertEquals(1, testList.size());\n\n\t\t// Test left edge of board, edge of room\n\t\ttestList = board.getAdjList(16, 0);\n\t\tassertTrue(testList.contains(board.getCellAt(17, 0)));\n\t\tassertTrue(testList.contains(board.getCellAt(16, 1)));\n\t\tassertEquals(2, testList.size());\n\n\t\t// Test on left edge of board, three walkway pieces\n\t\ttestList = board.getAdjList(6, 0);\n\t\tassertTrue(testList.contains(board.getCellAt(5, 0)));\n\t\tassertTrue(testList.contains(board.getCellAt(6, 1)));\n\t\tassertTrue(testList.contains(board.getCellAt(7, 0)));\n\t\tassertEquals(3, testList.size());\n\n\t\t// Test surrounded by 4 walkways\n\t\ttestList = board.getAdjList(16,19);\n\t\tassertTrue(testList.contains(board.getCellAt(15, 19)));\n\t\tassertTrue(testList.contains(board.getCellAt(17, 19)));\n\t\tassertTrue(testList.contains(board.getCellAt(16, 20)));\n\t\tassertTrue(testList.contains(board.getCellAt(16, 18)));\n\t\tassertEquals(4, testList.size());\n\n\t\t// Test on bottom edge of board, next to 1 room piece\n\t\ttestList = board.getAdjList(22, 15);\n\t\tassertTrue(testList.contains(board.getCellAt(21, 15)));\n\t\tassertTrue(testList.contains(board.getCellAt(22, 16)));\n\t\tassertEquals(2, testList.size());\n\n\n\t\t// Test on walkway next to door that is not in the needed\n\t\t// direction to enter\n\t\ttestList = board.getAdjList(9, 6);\n\t\tassertTrue(testList.contains(board.getCellAt(8, 6)));\n\t\tassertTrue(testList.contains(board.getCellAt(9, 7)));\n\t\tassertTrue(testList.contains(board.getCellAt(10, 6)));\n\t\tassertEquals(3, testList.size());\n\t}", "private boolean thereispath(Move m, Tile tile, Integer integer, Graph g, Board B) {\n\n boolean result = true;\n boolean result1 = true;\n\n int start_dest_C = tile.COLUMN;\n int start_dest_R = tile.ROW;\n\n int move_column = m.getX();\n int move_row = m.getY();\n\n int TEMP = 0;\n int TEMP_ID = 0;\n int TEMP_ID_F = tile.id;\n int TEMP_ID_FIRST = tile.id;\n\n int final_dest_R = (integer / B.width);\n int final_dest_C = (integer % B.width);\n\n //System.out.println(\"* \" + tile.toString() + \" \" + integer + \" \" + m.toString());\n\n // Y ROW - X COLUMN\n\n for (int i = 0; i != 2; i++) {\n\n TEMP_ID_FIRST = tile.id;\n\n // possibility 1\n if (i == 0) {\n\n\n // first move columns\n for (int c = 0; c != Math.abs(move_column) && result != false; c++) {\n\n if (c == 0) {\n TEMP_ID_FIRST = tile.id;\n\n } else {\n TEMP_ID_FIRST = B.a.get(start_dest_R).get(start_dest_C).id;\n\n }\n\n TEMP = move_column / Math.abs(move_column);\n\n //System.out.println(\"1C:\" + TEMP);\n\n //System.out.println(\" \" + TEMP_ID_FIRST + \" - > \" + (start_dest_C + TEMP));\n\n start_dest_C += TEMP;\n\n TEMP_ID = B.a.get(start_dest_R).get(start_dest_C).id;\n\n //System.out.println(TEMP_ID_FIRST + \" = \" + TEMP_ID);\n\n if (g.adj.get(TEMP_ID_FIRST).contains(TEMP_ID)) {\n\n // System.out.println(\"OK\");\n\n } else {\n\n result = false;\n\n // System.out.println(\"NOPE\");\n\n\n }\n }\n\n for (int r = 0; r != Math.abs(move_row) && result != false; r++) {\n\n TEMP_ID_FIRST = B.a.get(start_dest_R).get(start_dest_C).id;\n\n TEMP = move_row / Math.abs(move_row);\n\n //System.out.println(\"1R:\" + TEMP);\n\n //System.out.println(start_dest_R + \" - > \" + (start_dest_R + TEMP));\n\n start_dest_R += TEMP;\n\n TEMP_ID = B.a.get(start_dest_R).get(start_dest_C).id;\n\n // System.out.println(TEMP_ID_FIRST + \" and \" + TEMP_ID);\n\n if (g.adj.get(TEMP_ID_FIRST).contains(TEMP_ID)) {\n\n //System.out.println(\"OK\");\n\n\n } else {\n\n result = false;\n\n //System.out.println(\"NOPE\");\n\n\n }\n }\n\n if (result == true) {\n return true;\n }\n\n\n }\n\n TEMP_ID = 0;\n\n if (i == 1) {\n\n result = true;\n\n start_dest_C = tile.COLUMN;\n start_dest_R = tile.ROW;\n // first move row\n for (int r = 0; r != Math.abs(move_row) && result1 != false; r++) {\n\n if (r == 0) {\n TEMP_ID_FIRST = tile.id;\n\n } else {\n TEMP_ID_FIRST = B.a.get(start_dest_R).get(start_dest_C).id;\n\n }\n\n TEMP_ID_FIRST = B.a.get(start_dest_R).get(start_dest_C).id;\n\n TEMP = move_row / Math.abs(move_row);\n\n //System.out.println(\"1R:\" + TEMP);\n\n //System.out.println(start_dest_R + \" - > \" + (start_dest_R + TEMP));\n\n start_dest_R += TEMP;\n\n TEMP_ID = B.a.get(start_dest_R).get(start_dest_C).id;\n\n\n //System.out.println(TEMP_ID_FIRST + \" = \" + TEMP_ID);\n\n if (g.adj.get(TEMP_ID_FIRST).contains(TEMP_ID)) {\n\n //System.out.println(\"OK\");\n\n } else {\n\n //System.out.println(\"NOPE\");\n\n result = false;\n\n }\n\n\n }\n\n // first move columns\n for (int c = 0; c != Math.abs(move_column) && result1 != false; c++) {\n\n\n TEMP_ID_FIRST = B.a.get(start_dest_R).get(start_dest_C).id;\n\n TEMP = move_column / Math.abs(move_column);\n\n //System.out.println(\"1C:\" + TEMP);\n\n //System.out.println(\" \" + TEMP_ID_FIRST + \" - > \" + (start_dest_C + TEMP));\n\n start_dest_C += TEMP;\n\n TEMP_ID = B.a.get(start_dest_R).get(start_dest_C).id;\n\n //System.out.println(TEMP_ID_FIRST + \" and \" + TEMP_ID);\n\n if (g.adj.get(TEMP_ID_FIRST).contains(TEMP_ID)) {\n\n //System.out.println(\"OK\");\n\n } else {\n result = false;\n\n //System.out.println(\"NOPE\");\n\n\n }\n }\n\n if (result == false) {\n return false;\n\n }\n\n\n }\n\n\n }\n\n\n return true;\n }", "public static void exceptionCase(Robot r)\n {\n r.turnLeft();\n if(r.frontIsClear() == false) // If after traversing street x forward and street y backward\n { // the front is not clear (i.e. the robot has traversed the entire square area),\n stopCase(r); // then stop the program/robot by invoking the stopCase method\n }\n else\n {\n // If the front is clear (i.e. the entire square area has not been fully traversed yet), continue\n r.move();\n pickAllThings(r);\n r.turnLeft();\n traverseTwoStreets(r); // Invoke traverseTwoStreets method [traverse street1 forward and street2 backwards]\n }\n }", "@Test\n\tpublic void connectTest_North_VerticalStraight() throws Exception {\n\n\t\tfinal Factory<Node> railNodeFactory = new DefaultRailNodeFactory();\n\n\t\tfinal RailNode switchLeft0RailNode = (RailNode) railNodeFactory.create(1, 1, ShapeType.SWITCH_LEFT_0);\n\t\tfinal RailNode horizontalRailNode = (RailNode) railNodeFactory.create(1, 0, ShapeType.STRAIGHT_VERTICAL);\n\n\t\tfinal Model model = new DefaultModel();\n\t\tmodel.setNode(1, 1, switchLeft0RailNode);\n\t\tmodel.setNode(1, 0, horizontalRailNode);\n\n\t\tswitchLeft0RailNode.connect(model);\n\t\thorizontalRailNode.connect(model);\n\n\t\tSystem.out.println(switchLeft0RailNode.toString());\n\t\tSystem.out.println(horizontalRailNode.toString());\n\n\t\tassertEquals(1, switchLeft0RailNode.getGraphNodeOne().getChildren().size());\n\t\tassertEquals(0, switchLeft0RailNode.getGraphNodeTwo().getChildren().size());\n\t\tassertEquals(2, switchLeft0RailNode.getGraphNodeOne().getChildren().get(0).getId());\n\n\t\tassertEquals(0, horizontalRailNode.getGraphNodeOne().getChildren().size());\n\t\tassertEquals(1, horizontalRailNode.getGraphNodeTwo().getChildren().size());\n\t\tassertEquals(1, horizontalRailNode.getGraphNodeTwo().getChildren().get(0).getId());\n\t}", "private void checkCollision() {\n for (int i = snakeSize; i > 0; i--) {\n if (i>4 && x[0] == x[i] && y[0] == y[i]){\n isInGame=false;\n }\n }\n\n if (x[0] > FIELD_SIZE) {\n isInGame=false;\n }\n\n if (x[0] < 0) {\n isInGame=false;\n }\n\n if (y[0] > FIELD_SIZE) {\n isInGame=false;\n }\n\n if (y[0] < 0) {\n isInGame=false;\n }\n\n\n }", "@Override\n\tpublic void goForward() {\n\t\t// check side and move the according room and side\n\t\tif (side.equals(\"hRight\")) {\n\t\t\tthis.side = \"bFront\";\n\t\t\tthis.room = properties.getRoomFromProperties().get(3);\n\n\t\t} else if (side.equals(\"hFront\")) {\n\t\t\tthis.side = \"mFront\";\n\t\t\tthis.room = properties.getRoomFromProperties().get(2);\n\n\t\t} else if (side.equals(\"bLeft\")) {\n\t\t\tthis.side = \"rLeft\";\n\t\t\tthis.room = properties.getRoomFromProperties().get(4);\n\n\t\t} else if (side.equals(\"rBack\")) {\n\t\t\tthis.side = \"bBack\";\n\t\t\tthis.room = properties.getRoomFromProperties().get(3);\n\n\t\t} else if (side.equals(\"bBack\")) {\n\t\t\tthis.side = \"hLeft\";\n\t\t\tthis.room = properties.getRoomFromProperties().get(1);\n\n\t\t} else if (side.equals(\"kBack\")) {\n\t\t\tthis.side = \"lFront\";\n\t\t\tthis.room = properties.getRoomFromProperties().get(5);\n\n\t\t} else if (side.equals(\"lLeft\")) {\n\t\t\tthis.side = \"kRight\";\n\t\t\tthis.room = properties.getRoomFromProperties().get(6);\n\n\t\t} else if (side.equals(\"lBack\")) {\n\t\t\tthis.side = \"mBack\";\n\t\t\tthis.room = properties.getRoomFromProperties().get(2);\n\n\t\t} else if (side.equals(\"mFront\")) {\n\t\t\tthis.side = \"lFront\";\n\t\t\tthis.room = properties.getRoomFromProperties().get(5);\n\n\t\t} else if (side.equals(\"mBack\")) {\n\t\t\tthis.side = \"hBack\";\n\t\t\tthis.room = properties.getRoomFromProperties().get(1);\n\n\t\t} else {\n\t\t\trandomRoom();\n\t\t\tSystem.out.println(\"Entered Wormhole!\");\n\t\t\tSystem.out.println(\"Location was chosen at random\");\n\t\t\tSystem.out.println(\"New location is: \" + room + \" room and \" + side.substring(1) + \" side\");\n\n\t\t}\n\t}", "public void play() {\n Player playerOne = preparePlayer(getUserName(scanner, validator, shipsGameText.getMessage(\"show.player.one\"), null));\n Player currentPlayer = playerOne;\n ShipsGameBoard playerOneGameBoard = new ShipsGameBoard(playerOne, playerOneFleet);\n ShipsGameBoard playerOneCheckBoard = new ShipsGameBoard(playerOne, playerOneFleetToCheck);\n playerOneCheckBoard.setup();\n\n TreeMap<Character, Integer> lettersAndDigits = lettersAndDigits(playerOneGameBoard.getLength());\n ShipCreator threeMastShipCreatorPlayerOne = new ShipCreator(THREE_MASTS_SHIP,\n null,\n playerOne,\n ShipGameBoardMark.THREE_MASTS,\n playerOneGameBoard,\n playerOneShipsGameLogic);\n\n playerOneGameBoard.print();\n shipsDeployment(playerOneGameBoard,\n lettersAndDigits,\n threeMastShipCreatorPlayerOne,\n playerOneShipsGameLogic,\n playerOneFleet,\n NUMBER_OF_SHIPS);\n\n// playerOneShipsGameLogic.clearConsole();\n\n Player playerTwo = preparePlayer(getUserName(scanner, validator, shipsGameText.getMessage(\"show.player.two\"), playerOne.getName()));\n ShipsGameBoard playerTwoGameBoard = new ShipsGameBoard(playerTwo, playerTwoFleet);\n ShipsGameBoard playerTwoCheckBoard = new ShipsGameBoard(playerTwo, playerTwoFleetToCheck);\n playerTwoCheckBoard.setup();\n\n ShipCreator threeMastShipCreatorPlayerTwo = new ShipCreator(THREE_MASTS_SHIP,\n null,\n playerTwo,\n ShipGameBoardMark.THREE_MASTS,\n playerTwoGameBoard,\n playerTwoShipsGameLogic);\n\n playerTwoGameBoard.print();\n shipsDeployment(playerTwoGameBoard,\n lettersAndDigits,\n threeMastShipCreatorPlayerTwo,\n playerTwoShipsGameLogic,\n playerTwoFleet,\n NUMBER_OF_SHIPS);\n\n\n boolean isAWinner = false;\n do {\n int userRow;\n int userCol;\n// playerOneGameBoard.clearConsole();\n showCurrentPlayerBoards(playerOne, currentPlayer, playerOneGameBoard, playerTwoGameBoard, playerOneCheckBoard,\n playerTwoCheckBoard, shipsGameText);\n System.out.println(shipsGameText.getMessage(\"show.witch.player.move\", currentPlayer.getName()));\n\n System.out.println(shipsGameText.getMessage(\"show.input.row\", Integer.toString(playerOneGameBoard.getLength())));\n userRow = getPlayerRowChoice(scanner, validator, playerOneGameBoard.getLength());\n\n System.out.println(shipsGameText.getMessage(\"show.input.col\",\n Character.toString(playerOneGameBoard.generateLastLetterOfColumn('A', playerOneGameBoard.getLength()))));\n userCol = convertLetterToDigit(lettersAndDigits, getPlayerColChoice(scanner, validator,\n lettersAndDigits));\n\n if (currentPlayer.equals(playerOne)) {\n if (playerTwoShipsGameLogic.checkForHit(userRow, userCol)) {\n playerOneShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n playerTwoShipsGameLogic.changeMastStatus(userRow, userCol, playerTwo, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n if (playerTwoShipsGameLogic.checkShipForStatusChange(userRow, userCol)) {\n playerTwoShipsGameLogic.changeShipStatusToSunk(userRow, userCol, playerTwo);\n playerOneShipsGameLogicToCheck.changeShipStatusToSinkOnCheckBoard(playerTwoFleet, playerOne);\n System.out.println(shipsGameText.getMessage(\"show.player.sunk.ship\"));\n System.out.println(shipsGameText.getMessage(\"show.player.checkboard\", currentPlayer.getName()));\n playerOneCheckBoard.print();\n System.out.println(shipsGameText.getMessage(\"show.player.gameboard\", playerTwo.getName()));\n playerTwoGameBoard.print();\n } else {\n System.out.println(shipsGameText.getMessage(\"show.player.hit.ship\", playerOne.getName()));\n }\n } else {\n System.out.println(shipsGameText.getMessage(\"show.player.miss\"));\n playerOneShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.MISS);\n playerTwoShipsGameLogic.changeMastStatus(userRow, userCol, playerTwo, ShipGameBoardMark.MISS);\n }\n\n// if (playerTwoShipsGameLogic.checkShipForStatusChange(userRow, userCol)) {\n// playerTwoShipsGameLogic.changeShipStatusToSunk(userRow, userCol, playerTwo);\n// playerOneShipsGameLogicToCheck.changeShipStatusToSinkOnCheckBoard(playerTwoFleet, playerOne);\n// System.out.println(shipsGameText.getMessage(\"show.player.sunk.ship\"));\n// System.out.println(shipsGameText.getMessage(\"show.player.checkboard\", currentPlayer.getName()));\n// playerOneCheckBoard.print();\n// System.out.println(shipsGameText.getMessage(\"show.player.gameboard\", playerTwo.getName()));\n// playerTwoGameBoard.print();\n// }\n\n\n if (playerTwoShipsGameLogic.isPlayerLoose()) {\n System.out.println(shipsGameText.getMessage(\"show.player.win\", playerOne.getName()));\n isAWinner = true;\n }\n\n } else {\n if (playerOneShipsGameLogic.checkForHit(userRow, userCol)) {\n playerTwoShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerTwo, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n playerOneShipsGameLogic.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n if (playerOneShipsGameLogic.checkShipForStatusChange(userRow, userCol)) {\n playerOneShipsGameLogic.changeShipStatusToSunk(userRow, userCol, playerOne);\n playerTwoShipsGameLogicToCheck.changeShipStatusToSinkOnCheckBoard(playerOneFleet, playerTwo);\n System.out.println(shipsGameText.getMessage(\"show.player.sunk.ship\"));\n System.out.println(shipsGameText.getMessage(\"show.player.checkboard\", currentPlayer.getName()));\n playerTwoCheckBoard.print();\n System.out.println(shipsGameText.getMessage(\"show.player.gameboard\", playerOne.getName()));\n playerOneGameBoard.print();\n }\n else {\n System.out.println(shipsGameText.getMessage(\"show.player.hit.ship\", playerOne.getName()));\n }\n } else {\n playerTwoShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerOne,\n ShipGameBoardMark.MISS);\n playerOneShipsGameLogic.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.MISS);\n System.out.println(shipsGameText.getMessage(\"show.player.miss\"));\n }\n if (playerOneShipsGameLogic.isPlayerLoose()) {\n System.out.println(shipsGameText.getMessage(\"show.player.win\", playerTwo.getName()));\n isAWinner = true;\n }\n }\n\n currentPlayer = swapPlayers(playerOne, currentPlayer, playerTwo);\n }\n while (!isAWinner);\n }", "private void combinedEdgeDetection() {\n if(isDetectingEdge())\n {\n if(currentCount == 0)\n {\n debugTimer.start();\n }\n currentCount++;\n// SmartDashboard.putInt(\"current count: \", currentCount);\n }\n else{//otherwise, leave the count at 0\n currentCount = 0;\n }\n //once the count reaches the minimum required for detection\n if(currentCount >= minDetectionCount)\n {\n //invert the current state of detection\n currentlyDetecting = !currentlyDetecting;\n// SmartDashboard.putDouble(\"timer count: \", debugTimer.get());\n debugTimer.stop();\n debugTimer.reset();\n }\n\t}", "public void SpecialCardAction(UNOCard aCard) {\n\t\t\n\t\tif (aCard.getName() == \"Reverse\") { // Reverse card is played, so game direction is switched\n\t\t\tif (gameDirection == \"right\") {\n\t\t\t\tgameDirection = \"left\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\tgameDirection = \"right\";\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (aCard.getName() == \"Skip\") {\n\t\t\tif (gameDirection == \"right\") { // If Game is moving in one direction\n\t\t\t\tcurrentPlayerToPlayIndex = currentPlayerToPlayIndex + 2; // player next to play is skipped\n\t\t\t\tif (currentPlayerToPlayIndex >= players.size()) {\n\t\t\t\t\tcurrentPlayerToPlayIndex = currentPlayerToPlayIndex - players.size();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (gameDirection == \"left\") { // If Game is moving in other direction\n\t\t\t\tcurrentPlayerToPlayIndex = currentPlayerToPlayIndex - 2; // player next to play is skipped\n\t\t\t\tif (currentPlayerToPlayIndex <= 0) {\n\t\t\t\t\tcurrentPlayerToPlayIndex = currentPlayerToPlayIndex + players.size();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tcurrentPlayerToPlay = players.get(currentPlayerToPlayIndex); // Next Player to play a card\n\t\t\n\t\tif (aCard.getName() == \"Draw Two\") { // If a Draw Two Card is played, the enxt player to play is dealt two cards\n\t\t\tif (gameDirection == \"right\") {\n\t\t\t\tif (currentPlayerToPlayIndex < players.size()) {\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (gameDirection == \"left\") {\n\t\t\t\tif (currentPlayerToPlayIndex != 0) {\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (aCard.getName() == \"Wild\") { // Wild is played, function called to ask user for new color\n\t\t\tWildIsPlayedAskUserForColor();\n\t\t}\n\t\t\n\t\tif (aCard.getName() == \"Wild Draw Four\") {\n\t\t\tif (gameDirection == \"right\") { // if game direction is this way\n\t\t\t\tif (currentPlayerToPlayIndex < players.size()) {\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard()); // draw four cards\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex + 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard()); // draw four cards\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(0).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (gameDirection == \"left\") { // if game direction is this way\n\t\t\t\tif (currentPlayerToPlayIndex != 0) {\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard()); // draw four cards\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(currentPlayerToPlayIndex - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard()); // draw four cards\n\t\t\t\t\tplayers.get(players.size() - 1).getPlayersHand().add(GameUNODeck.DealACard());\n\t\t\t\t}\n\t\t\t}\n\t\t\tWildIsPlayedAskUserForColor();\n\t\t}\n\t\t\n\t}", "public void mouseClicked(MouseEvent e) \r\n\t{\r\n\t\t\tif (e.getButton() == 1) {\r\n\t\t\t\tif(turn == -2){\r\n\t\t\t\t\tturn++;\r\n\t\t\t\t}\r\n\t\t\t\telse if(gameOver){\r\n\t\t\t\t\tturn=-2;\r\n\t\t\t\t\tgameOver = false;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\tRectangle2D rect = new Rectangle2D.Double((4*60),((guessArray.length-1)*60)+22,60,60);\r\n\t\t\t\tif (rect.contains(e.getX(), e.getY())) {\r\n\r\n\t\t\t\t\tturn++;\r\n\r\n\t\t\t\t\tguessArray[turn] = new code(guessArray[guessArray.length-1]);\r\n\r\n\t\t\t\t\tcode response = new code();\r\n\r\n\t\t\t\t\tint redCount = guessArray[turn].sameColorSamePosition(cpuCode);\t\r\n\t\t\t\t\tint whiteCount = guessArray[turn].sameColor(cpuCode) - guessArray[turn].sameColorSamePosition(cpuCode);\r\n\r\n\t\t\t\t\tfor(int i = 0; i < redCount; i++) {\r\n\t\t\t\t\t\tresponse.append('r');\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfor(int i = 0; i < whiteCount; i++) {\r\n\t\t\t\t\t\tresponse.append('w');\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tresponseArray[turn] = new code(response);\r\n\r\n\r\n\t\t\t\t\tchar[] winCode = {'r','r','r','r'};\r\n\t\t\t\t\tif(responseArray[turn].sameColorSamePosition(new code(winCode)) == 4) {\r\n\t\t\t\t\t\twin = true;\r\n\t\t\t\t\t\tgameOver = true;\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(turn >= guessArray.length - 2) {\r\n\t\t\t\t\t\twin = false;\r\n\t\t\t\t\t\tgameOver = true;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t\telse if (returnGuessEllipse((guessArray.length-1),0).contains(e.getX(), e.getY()) ) {\r\n\t\t\t\t\tchar currentColor = guessArray[guessArray.length-1].getColorAtIndex(0);\r\n\t\t\t\t\tchar newColor = returnNextColor(currentColor);\r\n\t\t\t\t\tguessArray[guessArray.length-1].setColorAtIndex(0,newColor);\r\n\t\t\t\t}\t\r\n\t\t\t\telse if (returnGuessEllipse((guessArray.length-1),1).contains(e.getX(), e.getY()) ) {\r\n\t\t\t\t\tchar currentColor = guessArray[guessArray.length-1].getColorAtIndex(1);\r\n\t\t\t\t\tchar newColor = returnNextColor(currentColor);\r\n\t\t\t\t\tguessArray[guessArray.length-1].setColorAtIndex(1,newColor);\r\n\t\t\t\t}\t\r\n\t\t\t\telse if (returnGuessEllipse((guessArray.length-1),2).contains(e.getX(), e.getY()) ) {\r\n\t\t\t\t\tchar currentColor = guessArray[guessArray.length-1].getColorAtIndex(2);\r\n\t\t\t\t\tchar newColor = returnNextColor(currentColor);\r\n\t\t\t\t\tguessArray[guessArray.length-1].setColorAtIndex(2,newColor);\r\n\t\t\t\t}\t\r\n\t\t\t\telse if (returnGuessEllipse((guessArray.length-1),3).contains(e.getX(), e.getY()) ) {\r\n\t\t\t\t\tchar currentColor = guessArray[guessArray.length-1].getColorAtIndex(3);\r\n\t\t\t\t\tchar newColor = returnNextColor(currentColor);\r\n\t\t\t\t\tguessArray[guessArray.length-1].setColorAtIndex(3,newColor);\r\n\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\trepaint();\t\r\n\t\t\t\r\n\t\t\t}\r\n\r\n\t}", "public boolean checkIf_one_cardAwayFromStraight() {\n boolean oneAway = false;\n //CASE 1: Four in a row and missing one _ X X X X _ ---> open ended straight draw \n if (numSequentially == 4 && lowestValOfNumSequentially >= 2 && lowestValOfNumSequentially <= 10) {// _ 2 3 4 5 _, we can get ANY ace or ANY 6\n oneAway = true;\n numOuts += 8;\n bestHandFromCardsNickNameString = \"Open-Ended Straight Draw\";\n } else if (numSequentially == 4) {// A 2 3 4// any 5\n oneAway = true;\n numOuts += 4;\n bestHandFromCardsNickNameString = \"Single-Sided Straight Draw\";\n } else if (numSequentially == 3) {// CASE 2: 3 in a row and missing one between so either X _ X X X OR OR X X X _ X\n if (handContainsValueZ(lowestValOfNumSequentially - 2) || handContainsValueZ(lowestValOfNumSequentially + 4)) {\n numOuts += 4;\n oneAway = true;\n bestHandFromCardsNickNameString = \"Gutshot Straight Draw\";\n }\n } else if (numSequentially == 2) {//lowest value of num sequentially will be the higher pair X X _ K X (will be k)\n if (handContainsValueZ(lowestValOfNumSequentially - 2) && handContainsValueZ(lowestValOfNumSequentially - 3)) {\n numOuts += 4;\n oneAway = true;\n bestHandFromCardsNickNameString = \"Bulls-Eye Gutshot Straight Draw\";\n }\n\n }\n\n return oneAway;\n }", "private void alternatePlayer(Piece current) {\n if (currPlayer == X) {\n currPlayer = O;\n }\n else currPlayer = X;\n }", "public void naiveScanline(List<Edge> edgeList){\n\t\tCollections.sort(edgeList, new Comparator<Edge>(){\n\n\t\t\t@Override\n\t\t\tpublic int compare(Edge e1, Edge e2) {\n\t\t\t\tif(e1.y0>e2.y0){ return -1; }\n\t\t\t\tif(e2.y0>e1.y0){ return 1; }\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\t\n\t\t});\n\t\t\n\t\t// Define a list of active edges\n\t\tList<Edge> activeEdges = new ArrayList<Edge>();\n\t\t\n\t\t// Start with first scanline that intersects (lowest y)\n\t\tdouble scanline = Math.round(edgeList.get(0).y0);\n\t\twhile(scanline>=0){\n\t\t\t\n\t\t\t//System.out.println(\"Scanline: \"+scanline);\n\t\t\t\n\t\t\t// Remove old edges from active edge list\n\t\t\tIterator<Edge> aelit = activeEdges.iterator();\n\t\t\twhile(aelit.hasNext()){\n\t\t\t\tEdge e = aelit.next();\n\t\t\t\tif((e.y0<scanline||e.y1>=scanline)){\n\t\t\t\t\tedgeList.add(e);\n\t\t\t\t\taelit.remove();\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Add intersecting edges to AEL\n\t\t\tIterator<Edge> elit = edgeList.iterator();\n\t\t\twhile(elit.hasNext()){\n\t\t\t\tEdge e = elit.next();\n\t\t\t\tif(e.y0>=scanline&&e.y1<scanline){\n\t\t\t\t\tactiveEdges.add(e);\n\t\t\t\t\telit.remove();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Find intersection points\n\t\t\tfor(Edge e : activeEdges){\n\t\t\t\te.is = getIntersection(scanline, e);\n\t\t\t}\n\t\t\t\n\t\t\t// Sort on x intersection value\n\t\t\tCollections.sort(activeEdges, new Comparator<Edge>(){\n\n\t\t\t\t@Override\n\t\t\t\tpublic int compare(Edge e1, Edge e2) {\n\t\t\t\t\tif(e1.is<e2.is){ return -1; }\n\t\t\t\t\tif(e2.is<e1.is){ return 1; }\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t});\n\t\t\t\n\t\t\t// Active edges and intersection points\n/*\t\t\tSystem.out.println(\"Active edges: \");\n\t\t\tfor(Edge e : activeEdges){\n\t\t\t\tSystem.out.println(\"Edge: \"+ e.x0 + \", \" + e.y0 + \", \" + e.x1 + \", \" + e.y1 + \"(intersection: \" + e.is+\")\");\n\t\t\t}*/\n\t\t\t\n\t\t\t// Fill in pixels whilst between edges, assuming only even edges for now\n\t\t\tint numedges = activeEdges.size();\n\t\t\tint i = 0;\n\t\t\tint j = (numedges % 2 == 0) ? numedges : numedges-1;\n\t\t\t//System.out.println(\"i=\"+i+\"j=\"+j);\n\t\t\tint y = (int)Math.round(scanline);\n\t\t\twhile(i<j){\n\t\t\t\tint p = (int)Math.round(activeEdges.get(i).is);\n\t\t\t\tint q = (int)Math.round(activeEdges.get(i+1).is);\n\t\t\t\twhile(p<=q){\n\t\t\t\t\tRenderer.setPixel(p, y, 255, 0, 0);\n\t\t\t\t\tp++;\n\t\t\t\t}\n\t\t\t\ti+=2;\n\t\t\t}\n\t\t\t\n\t\t\tscanline--;\n\t\t\t\n\t\t}\n\t\t\n\t}", "public static void main(String[]args){\n Scanner reader = new Scanner(System.in);\n TTTBoard board = new TTTBoard();\n \n // Display the empty board\n System.out.println(board);\n\n // Let the non-CPU go first\n int turn = 1;\n int a = 0;\n int b = 0;\n char player;\n\n // Loop while there is no winner and the board is not full \n while (board.getWinner() == '-' && !board.full()){\n if (turn%2!=0){\n player = 'X';\n \n // Prompt the user for a move\n System.out.println(\"Your turn\");\n System.out.print(\"Enter the row and column[1-3, space, 1-3]: \");\n \n // Read the move\n int row = reader.nextInt();\n int column = reader.nextInt();\n \n // Attempt the move\n // If the move is illegal\n // display an error message\n // Else\n // display the board and switch players\n boolean success = board.placeXorO(player, row, column);\n if (!success)\n System.out.println(\"Error: cell already occupied!\");\n else{\n System.out.println(board);\n }\n }else{\n player = 'O';\n int row = board.getRow();\n int column = board.getColumn();\n boolean cool = board.placeXorO(player, row, column);\n while (!cool){\n row = (int) (Math.random()*3+1);\n column = (int) (Math.random()*3+1);\n cool = board.placeXorO(player, row, column);\n }System.out.println(board);\n }turn++;\n }\n \n // Display the results \n char winner = board.getWinner();\n if (winner != '-'){\n System.out.println(winner + \"s win!\");\n }else{\n System.out.println(\"It's a draw!\");\n }\n }", "private boolean isNextMoveRochade(Move move)\r\n\t{\r\n\t\tif (!(move.from.piece instanceof King)) return false;\r\n\t\tint xDiffAbs = Math.abs(move.to.coordinate.x - move.from.coordinate.x); \r\n\t\treturn xDiffAbs == 2;\r\n\t}", "public void run(){\n\t\twhile(frontIsClear()){\n\t\t\tdoFirstRow();\n\t\t\tif (leftIsClear()){\n\t\t\t\tadvanceRow();\n\t\t\t\tdoNextRow();\t\t\t\t\n\t\t\t}\t\n\t\t\tadvanceRow();\n\t\t}\t\n\t\t//Handles checkerboard by AVENUE only if STREET algorithm does not \n\t\tif (!frontIsClear() && leftIsClear()){\n\t\t\tturnLeft();\n\t\t\tdoFirstRow();\n\t\t}\n\t}", "private void relax(int x, int y, double[][] energyTo, int[] edgeTo) {\n if (width() == 1) {\n for (int i = 0; i < height(); i++)\n edgeTo[i] = 0;\n } else {\n if (x == 0) {\n if (y < height-1) {\n if (energyTo[x][y+1] >= energyTo[x][y] + energy[x][y+1]) {\n energyTo[x][y+1] = energyTo[x][y] + energy[x][y+1];\n }\n if (energyTo[x+1][y+1] >= energyTo[x][y] + energy[x+1][y+1]) {\n energyTo[x+1][y+1] = energyTo[x][y] + energy[x+1][y+1];\n }\n }\n } else if (x == width-1) {\n if (y < height-1) {\n if (energyTo[x][y+1] >= energyTo[x][y] + energy[x][y+1]) {\n energyTo[x][y+1] = energyTo[x][y] + energy[x][y+1];\n }\n if (energyTo[x-1][y+1] >= energyTo[x][y] + energy[x-1][y+1]) {\n energyTo[x-1][y+1] = energyTo[x][y] + energy[x-1][y+1];\n }\n }\n } else {\n if (y < height-1) {\n if (energyTo[x][y+1] >= energyTo[x][y] + energy[x][y+1]) {\n energyTo[x][y+1] = energyTo[x][y] + energy[x][y+1];\n }\n if (energyTo[x-1][y+1] >= energyTo[x][y] + energy[x-1][y+1]) {\n energyTo[x-1][y+1] = energyTo[x][y] + energy[x-1][y+1];\n }\n if (energyTo[x+1][y+1] >= energyTo[x][y] + energy[x+1][y+1]) {\n energyTo[x+1][y+1] = energyTo[x][y] + energy[x+1][y+1];\n }\n }\n }\n }\n }", "public boolean plizMovePlayerForward(Player player)\n {\n\n //check if die was rolled\n if (getValue_from_die() > 0)\n {\n int x_cord = player.getX_cordinate();\n int y_cord = player.getY_cordinate();\n int steps = player.getSteps_moved();\n\n //try to get player from color home\n if (attempt2GetPlayerFromHomeSucceds(player))\n {\n return true;\n }\n\n //if player has already reached home do nothing\n if (player.getSteps_moved() >= 58)\n {\n return false;\n }\n //if player is inside home stretch he has to play exact number to go home\n else if (player.getSteps_moved() >= 52)\n {\n if (59 - player.getSteps_moved() <= value_from_die)\n {\n return false;\n }\n }\n\n //if player isnt at home move him\n if (player.getSteps_moved() > 0)\n {\n for (int i = 1; i <= (value_from_die); i++)\n {\n player.movePlayerForward();\n if (roadBlocked(player))\n {\n road_blocked = true;\n }\n player.setHas_not_been_drawn(true);\n }\n\n //roll back changes\n if (road_blocked)\n {\n player.setX_cordinate(x_cord);\n player.setY_cordinate(y_cord);\n player.setSteps_moved(steps);\n ludo.setDrawRoadBlockedSign(true);\n //println(\"ROAD BLOCKED\");\n road_blocked = false;\n return false;\n }\n playPlayerHasMovedMusic();\n //see if player eats someone\n if (getPerson_to_play() == 1)\n {\n BlueEatsPlayer(player);\n }\n else if (getPerson_to_play() == 2)\n {\n RedEatsPlayer(player);\n }\n else if (getPerson_to_play() == 3)\n {\n GreenEatsPlayer(player);\n }\n else if (getPerson_to_play() == 4)\n {\n YellowEatsPlayer(player);\n }\n if (value_from_die == 6)\n {\n resetDieScore();\n ludo.setDrawScoreAllowed(false);\n return true;\n }\n //reset variables and change person to play\n resetDieScore();\n ludo.setDrawScoreAllowed(false);\n changePersonToPlay();\n return true;\n }\n //occurs rarely at the begining of the game\n else\n {\n //println(\"steps less than 0\");\n return false;\n }\n }\n else\n {\n //println(\"PLIZ ROLL DIE FIRST THEN MOVE BUTTON\");\n return false;\n }\n }", "@Test\r\n\tpublic void testAdjacencyWalkways()\r\n\t{\r\n\t\t// Test on top edge of board, two walkway pieces\r\n\t\tSet<BoardCell> testList = board.getAdjList(0, 7);\r\n\t\tassertTrue(testList.contains(board.getCellAt(0, 8)));\r\n\t\tassertTrue(testList.contains(board.getCellAt(1, 7)));\r\n\t\tassertEquals(2, testList.size());\r\n\t\t\r\n\t\t// Test on left edge of board, one walkway piece\r\n\t\ttestList = board.getAdjList(8, 0);\r\n\t\tassertTrue(testList.contains(board.getCellAt(9, 0)));\r\n\t\tassertEquals(1, testList.size());\r\n\r\n\t\t// Test a walkway next to closet, 2 walkway pieces\r\n\t\ttestList = board.getAdjList(12, 9);\r\n\t\tassertTrue(testList.contains(board.getCellAt(12, 10)));\r\n\t\tassertTrue(testList.contains(board.getCellAt(13, 9)));\r\n\t\tassertEquals(2, testList.size());\r\n\r\n\t\t// Test surrounded by 4 walkways\r\n\t\ttestList = board.getAdjList(11,4);\r\n\t\tassertTrue(testList.contains(board.getCellAt(11, 5)));\r\n\t\tassertTrue(testList.contains(board.getCellAt(11, 3)));\r\n\t\tassertTrue(testList.contains(board.getCellAt(12, 4)));\r\n\t\tassertTrue(testList.contains(board.getCellAt(10, 4)));\r\n\t\tassertEquals(4, testList.size());\r\n\t\t\r\n\t\t// Test on bottom edge of board, next to 1 room piece\r\n\t\ttestList = board.getAdjList(24, 18);\r\n\t\tassertTrue(testList.contains(board.getCellAt(23, 18)));\r\n\t\tassertTrue(testList.contains(board.getCellAt(24, 17)));\r\n\t\tassertEquals(2, testList.size());\r\n\t\t\r\n\t\t// Test on right edge of board, next to 1 room piece\r\n\t\ttestList = board.getAdjList(10, 24);\r\n\t\tassertTrue(testList.contains(board.getCellAt(11, 24)));\r\n\t\tassertTrue(testList.contains(board.getCellAt(10, 23)));\r\n\t\tassertEquals(2, testList.size());\r\n\r\n\t\t// Test on walkway next to door that is not in the needed\r\n\t\t// direction to enter\r\n\t\ttestList = board.getAdjList(12, 21);\r\n\t\tassertTrue(testList.contains(board.getCellAt(11, 21)));\r\n\t\tassertTrue(testList.contains(board.getCellAt(13, 21)));\r\n\t\tassertTrue(testList.contains(board.getCellAt(12, 20)));\r\n\t\tassertEquals(3, testList.size());\r\n\t}", "public void drawFromDeck(MapBoard board){\n\t\tdiscardUsedCards();\n\t\tint temp1=5-playerCards.size();\n\t\tfor (int i = 0; i < temp1; i++) {\n\t\t\tif(Helper.playerCardSet.size()>0)\n\t\t\t{\n\t\t\t\tPlayerCardActions temp=Helper.getRandomPlayerCard();\n\t\t\t\ttemp.p=this; \n\t\t\t\ttemp.board=board;\n\t\t\t\tplayerCards.add(temp);\n\t\t\t\tif (temp.playerCardName.equals(\"Gaspode\")||temp.playerCardName.equals(\"FreshStartClub\")||temp.playerCardName.equals(\"Wallace Sonky\")) {\n\t\t\t\t\tinterruptCollection.add(temp);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public abstract boolean putEdge(Edge incomingEdge);", "public boolean hitEdge(int newX, int newY)\n {\n return (newX > 0 && newX < screenWidth-width && newY > 0 && newY < screenHeight-height);\n }", "public void gameLoop() {\r\n if (up) {\r\n ear1Y--;\r\n ear2Y--;\r\n if (ear1Y == 190) {\r\n down = true;\r\n up = false;\r\n }\r\n }\r\n\r\n if (down) {\r\n ear1Y++;\r\n ear2Y++;\r\n if (ear1Y == 250) {\r\n down = false;\r\n up = true;\r\n\r\n }\r\n }\r\n }", "public boolean canPlaceRoad(Player p, Edge e){\r\n for(Corner c: e.getConnectingCorners()){\r\n if(c.getOwner()==p) return true;\r\n }\r\n return false;\r\n }", "@Test\n public void testRookSide() {\n // initialize the complete chess board\n ChessBoard chessBoard = init(\"CHESS\");\n\n assertEquals(north, chessBoard.getPiece(0, 0).getSide());\n assertEquals(north, chessBoard.getPiece(0, 7).getSide());\n assertEquals(south, chessBoard.getPiece(7, 0).getSide());\n assertEquals(south, chessBoard.getPiece(7, 7).getSide());\n }", "private void cp1turn(){\n\t\tboolean attacked = false;\n\t\twhile(!attacked){\n\t\t\tranX = ranNum.nextInt(30);\n\t\t\tranY = ranNum.nextInt(30);\n\n\t\t\tif(cp1Attacks[ranX][ranY] == false){\n\t\t\t\tcp1Shots.add(new Shot(ranX * 20,ranY * 20));\n\t\t\t\tboardTwo.add(cp1Shots.get(cp1ShotCount));\n\t\t\t\tboardTwo.setComponentZOrder(cp1Shots.get(cp1ShotCount), 0);\n\n\t\t\t\tfor(int x = 0; x < ships.length; x++){\n\t\t\t\t\tif(ships[x].getPlayer() == 2){\n\t\t\t\t\t\tif(ships[x].checkBounds(ranX * 20 + 5, ranY * 20 + 5)){\n\t\t\t\t\t\t\tcp1Shots.get(cp1ShotCount).hit();\n\t\t\t\t\t\t\tships[x].hit();\n\t\t\t\t\t\t\tif(ships[x].sunk()){\n\t\t\t\t\t\t\t\tcp2BoatsSunk++;\n\t\t\t\t\t\t\t\tcp2shipLabel.setText(\"Computer Player 2 ships sunk: \" + cp2BoatsSunk);\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\tcp1ShotCount++;\n\t\t\t\tattacked = true;\n\t\t\t\tcp1Attacks[ranX][ranY] = true;\n\t\t\t}\n\t\t}\n\t\trepaint();\n\t}", "public float[] findXY(){\n //Initialize the xy coordinates and the array\n int x = -1;\n int y = -1;\n float[] location = new float[2];\n\n //Find the blank card\n for(int i = 0; i < cardArray.length; i++){\n for(int j = 0; j < cardArray.length; j++){\n if(cardArray[i][j].getCardNum() == 16){\n x = i;\n y = j;\n }\n }\n }\n\n /* For each of the following cases, find the neighbors of the\n blank card. Select only neighbors that are in the incorrect spot so that\n the computer player does not mess up the game. If both are in the correct spot\n choose one to move\n */\n //Case 1: it is in the top left corner, find a neighbor\n if((x == 0) && (y == 0)){\n if(cardArray[x+1][y].getColor() == 255){\n location[0] = cardArray[x + 1][y].getXVal();\n location[1] = cardArray[x + 1][y].getYVal();\n }\n else{\n location[0] = cardArray[x][y + 1].getXVal();\n location[1] = cardArray[x][y + 1].getYVal();\n }\n }\n\n //Case 2: it is in the top right corner, find a neighbor\n if((x == 0) && (y == cardArray.length - 1)){\n if(cardArray[x + 1][y].getColor() == 255){\n location[0] = cardArray[x + 1][y].getXVal();\n location[1] = cardArray[x + 1][y].getYVal();\n }\n else{\n location[0] = cardArray[x][y - 1].getXVal();\n location[1] = cardArray[x][y - 1].getYVal();\n }\n }\n\n //Case 3: It is in the bottom left corner, find a neighbor\n if((x == cardArray.length - 1) && (y == 0)){\n if(cardArray[x - 1][y].getColor() == 255){\n location[0] = cardArray[x - 1][y].getXVal();\n location[1] = cardArray[x - 1][y].getYVal();\n }\n else{\n location[0] = cardArray[x][y + 1].getXVal();\n location[1] = cardArray[x][y + 1].getYVal();\n }\n }\n\n //Case 4: It is in the bottom right corner, find a neighbor\n if((x == cardArray.length - 1) && (y == cardArray.length - 1)){\n if(cardArray[x - 1][y].getColor() == 255){\n location[0] = cardArray[x - 1][y].getXVal();\n location[1] = cardArray[x - 1][y].getYVal();\n }\n else{\n location[0] = cardArray[x][y - 1].getXVal();\n location[1] = cardArray[x][y - 1].getYVal();\n }\n }\n\n //Case 5: It is in the top row, find a neighbor\n if((x == 0) && (y > 0) && ( y < cardArray.length - 1)){\n if(cardArray[x][y + 1].getColor() == 255){\n location[0] = cardArray[x][y + 1].getXVal();\n location[1] = cardArray[x][y + 1].getYVal();\n }\n else if(cardArray[x][y - 1].getColor() == 255){\n location[0] = cardArray[x][y - 1].getXVal();\n location[1] = cardArray[x][y - 1].getYVal();\n }\n else{\n location[0] = cardArray[x + 1][y].getXVal();\n location[1] = cardArray[x + 1][y].getYVal();\n }\n }\n\n //Case 6: It is on the bottom row, find a neighbor\n if((x == cardArray.length - 1) && (y > 0) && (y < cardArray.length- 1)){\n if (cardArray[x][y + 1].getColor() == 255){\n location[0] = cardArray[x][y + 1].getXVal();\n location[1] = cardArray[x][y + 1].getYVal();\n }\n else if (cardArray[x][y - 1].getColor() == 255){\n location[0] = cardArray[x][y - 1].getXVal();\n location[1] = cardArray[x][y - 1].getYVal();\n }\n else{\n location[0] = cardArray[x - 1][y].getXVal();\n location[1] = cardArray[x - 1][y].getYVal();\n }\n }\n\n //Case 7: It is on the left column, find a neighbor\n if((x > 0) && (x < cardArray.length - 1) && (y == 0)){\n if(cardArray[x + 1][y].getColor() == 255){\n location[0] = cardArray[x + 1][y].getXVal();\n location[1] = cardArray[x + 1][y].getYVal();\n }\n else if(cardArray[x - 1][y].getColor() == 255){\n location[0] = cardArray[x - 1][y].getXVal();\n location[1] = cardArray[x - 1][y].getYVal();\n }\n else{\n location[0] = cardArray[x][y + 1].getXVal();\n location[1] = cardArray[x][y + 1].getYVal();\n }\n }\n\n //Case 8: It is on the right column, find a neighbor\n if((x > 0) && (x < cardArray.length - 1) && (y == cardArray.length - 1)){\n if(cardArray[x + 1][y].getColor() == 255){\n location[0] = cardArray[x + 1][y].getXVal();\n location[1] = cardArray[x + 1][y].getYVal();\n }\n else if(cardArray[x - 1][y].getColor() == 255){\n location[0] = cardArray[x - 1][y].getXVal();\n location[1] = cardArray[x - 1][y].getYVal();\n }\n else{\n location[0] = cardArray[x][y - 1].getXVal();\n location[1] = cardArray[x][y - 1].getYVal();\n }\n }\n\n //Case 9: It is not an edge or corner, find a neighbor\n if((x > 0) && (x < cardArray.length - 1) && (y > 0) && (y < cardArray.length -1)){\n if(cardArray[x + 1][y].getColor() == 255){\n location[0] = cardArray[x + 1][y].getXVal();\n location[1] = cardArray[x + 1][y].getYVal();\n }\n else if(cardArray[x - 1][y].getColor() == 255){\n location[0] = cardArray[x - 1][y].getXVal();\n location[1] = cardArray[x - 1][y].getYVal();\n }\n else if(cardArray[x][y + 1].getColor() == 255){\n location[0] = cardArray[x][y + 1].getXVal();\n location[1] = cardArray[x][y + 1].getYVal();\n }\n else{\n location[0] = cardArray[x][y - 1].getXVal();\n location[1] = cardArray[x][y - 1].getYVal();\n }\n }\n\n //Return the array containing the xy coordinates of the blank square's neighbor\n return location;\n }", "public interface WedgeProcessor {\n /**\n * A wedge processor's test method accepts two edge chains A=(a0,a1,a2) and B=(b0,b1,b2) where\n * a1==b1, and returns either -1, 0, or 1 to indicate the relationship between the region to the\n * left of A and the region to the left of B.\n */\n int test(S2Point a0, S2Point ab1, S2Point a2, S2Point b0, S2Point b2);\n }", "@Test\n public void directedRouting() {\n EdgeIteratorState rightNorth, rightSouth, leftSouth, leftNorth;\n graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(1, 2).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(2, 3).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(3, 4).setDistance(3).set(speedEnc, 10, 10);\n rightNorth = graph.edge(4, 10).setDistance(1).set(speedEnc, 10, 10);\n rightSouth = graph.edge(10, 5).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(5, 6).setDistance(2).set(speedEnc, 10, 10);\n graph.edge(6, 2).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(2, 7).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(7, 8).setDistance(9).set(speedEnc, 10, 10);\n leftSouth = graph.edge(8, 9).setDistance(1).set(speedEnc, 10, 10);\n leftNorth = graph.edge(9, 0).setDistance(1).set(speedEnc, 10, 10);\n\n // make paths fully deterministic by applying some turn costs at junction node 2\n setTurnCost(7, 2, 3, 1);\n setTurnCost(7, 2, 6, 3);\n setTurnCost(1, 2, 3, 5);\n setTurnCost(1, 2, 6, 7);\n setTurnCost(1, 2, 7, 9);\n\n final double unitEdgeWeight = 0.1;\n assertPath(calcPath(9, 9, leftNorth.getEdge(), leftSouth.getEdge()),\n 23 * unitEdgeWeight + 5, 23, (long) ((23 * unitEdgeWeight + 5) * 1000),\n nodes(9, 0, 1, 2, 3, 4, 10, 5, 6, 2, 7, 8, 9));\n assertPath(calcPath(9, 9, leftSouth.getEdge(), leftNorth.getEdge()),\n 14 * unitEdgeWeight, 14, (long) ((14 * unitEdgeWeight) * 1000),\n nodes(9, 8, 7, 2, 1, 0, 9));\n assertPath(calcPath(9, 10, leftSouth.getEdge(), rightSouth.getEdge()),\n 15 * unitEdgeWeight + 3, 15, (long) ((15 * unitEdgeWeight + 3) * 1000),\n nodes(9, 8, 7, 2, 6, 5, 10));\n assertPath(calcPath(9, 10, leftSouth.getEdge(), rightNorth.getEdge()),\n 16 * unitEdgeWeight + 1, 16, (long) ((16 * unitEdgeWeight + 1) * 1000),\n nodes(9, 8, 7, 2, 3, 4, 10));\n }", "public void otherChess()\n {\n // Receive the column from the other player\n int col = theClient.recvInt();\n int row;\n // Find the unoccupied row from bottom to up to put the chess on\n for (row = ROWS - 1; row >= 0; row-- )\n {\n if (chessBoard[row][col] == 0)\n {\n break;\n }\n }\n // Put the chess from the other player on the board\n chessBoard[row][col] = other;\n grid[row][col].setIcon(new ImageIcon(otherURL));\n // If the column is full, disable the corresponding button\n if (row == 0)\n {\n drop[col].setEnabled(false);\n }\n // Check whether the other player wins.\n // If the other player wins, show the message dialog and tell the player\n // \"You lose\".\n // Then exit the system, terminate the game.\n if (win(row, col, other))\n {\n out.println(\"Lose.\");\n JOptionPane.showMessageDialog(null, \"You lose.\");\n System.exit(0);\n }\n // Else if the chess board is full, tie\n // Show the message dialog and tell the player \"Tie\".\n // Then exit the system, terminate the game.\n else if (full())\n {\n out.println(\"Tie.\");\n JOptionPane.showMessageDialog(null, \"Tie.\");\n System.exit(0);\n }\n }", "public void flip(int x, int y){\n\t\tPiece temp = grid[x][y];\n\t\tint tempRepeats; //used to work out how many times in a diagonal to go\n\t\ttry{\n\t\t\t//UP\n\t\t\tfor (int i = 0;i < y; i++){\n\t\t\t\t//if piece is equal/null\n\t\t\t\tif(grid[x][y-i-1] == null || grid[x][y-i-1] == temp){\n\t\t\t\t\t//if piece is equal\n\t\t\t\t\tif (grid[x][y-i-1] == temp){\n\t\t\t\t\t\t//if it has already passed over the other color\n\t\t\t\t\t\tif(i > 0){\n\t\t\t\t\t\t\t//flip pieces in the middle\n\t\t\t\t\t\t\tfor (int j = 0;j < i;j++){\n\t\t\t\t\t\t\t\tgrid[x][y-(j+1)] = grid[x][y-(j+1)].flip();\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\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//DOWN\n\t\t\tfor (int i = 0;i < grid.length - y - 1; i++){\n\t\t\t\t//if piece is equal/null\n\t\t\t\tif(grid[x][y+i+1] == null || grid[x][y+i+1] == temp){\n\t\t\t\t\t//if piece is equal\n\t\t\t\t\tif (grid[x][y+i+1] == temp){\n\t\t\t\t\t\t//if it has already passed over the other color\n\t\t\t\t\t\tif(i > 0){\n\t\t\t\t\t\t\t//flip pieces in the middle\n\t\t\t\t\t\t\tfor (int j = 0;j < i;j++){\n\t\t\t\t\t\t\t\tgrid[x][y+(j+1)] = grid[x][y+(j+1)].flip();\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\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//LEFT\n\t\t\tfor (int i = 0;i < x; i++){\n\t\t\t\t//if piece is equal/null\n\t\t\t\tif(grid[x-(i+1)][y] == null || grid[x-(i+1)][y] == temp){\n\t\t\t\t\t//if piece is equal\n\t\t\t\t\tif (grid[x-(i+1)][y] == temp){\n\t\t\t\t\t\t//if it has already passed over the other color\n\t\t\t\t\t\tif(i > 0){\n\t\t\t\t\t\t\t//flip pieces in the middle\n\t\t\t\t\t\t\tfor (int j = 0;j < i;j++){\n\t\t\t\t\t\t\t\tgrid[x-(j+1)][y] = grid[x-(j+1)][y].flip();\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\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//RIGHT\n\t\t\tfor (int i = 0;i < grid.length - x - 1; i++){\n\t\t\t\t//if piece is equal/null\n\t\t\t\tif(grid[x+(i+1)][y] == null || grid[x+(i+1)][y] == temp){\n\t\t\t\t\t//if piece is equal\n\t\t\t\t\tif (grid[x+(i+1)][y] == temp){\n\t\t\t\t\t\t//if it has already passed over the other color\n\t\t\t\t\t\tif(i > 0){\n\t\t\t\t\t\t\t//flip pieces in the middle\n\t\t\t\t\t\t\tfor (int j = 0;j < i;j++){\n\t\t\t\t\t\t\t\tgrid[x+(j+1)][y] = grid[x+(j+1)][y].flip();\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\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//Top left\n\t\t\tif(x < y){\n\t\t\t\ttempRepeats = x;\n\t\t\t} else {\n\t\t\t\ttempRepeats = y;\n\t\t\t}\n\t\t\tfor (int i = 0;i < tempRepeats; i++){\n\t\t\t\t//if piece is equal/null\n\t\t\t\tif(grid[x-(i+1)][y-(i+1)] == null || grid[x-(i+1)][y-(i+1)] == temp){\n\t\t\t\t\t//if piece is equal\n\t\t\t\t\tif (grid[x-(i+1)][y-(i+1)] == temp){\n\t\t\t\t\t\t//if it has already passed over the other color\n\t\t\t\t\t\tif(i > 0){\n\t\t\t\t\t\t\t//flip pieces in the middle\n\t\t\t\t\t\t\tfor (int j = 0;j < i;j++){\n\t\t\t\t\t\t\t\tgrid[x-(j+1)][y-(j+1)] = grid[x-(j+1)][y-(j+1)].flip();\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\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//top right\n\t\t\t\n\t\t\tif(grid.length - x < y){\n\t\t\t\ttempRepeats = grid.length - x - 1;\n\t\t\t} else {\n\t\t\t\ttempRepeats = y - 1;\n\t\t\t}\n\t\t\tfor (int i = 0;i < tempRepeats; i++){\n\t\t\t\t//if piece is equal/null\n\t\t\t\tif(grid[x+(i+1)][y-(i+1)] == null || grid[x+(i+1)][y-(i+1)] == temp){\n\t\t\t\t\t//if piece is equal\n\t\t\t\t\tif (grid[x+(i+1)][y-(i+1)] == temp){\n\t\t\t\t\t\t//if it has already passed over the other color\n\t\t\t\t\t\tif(i > 0){\n\t\t\t\t\t\t\t//flip pieces in the middle\n\t\t\t\t\t\t\tfor (int j = 0;j < i;j++){\n\t\t\t\t\t\t\t\tgrid[x+(j+1)][y-(j+1)] = grid[x+(j+1)][y-(j+1)].flip();\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\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\n\t\t\t//down Right\n\t\t\tif(grid.length - x < grid.length - y){\n\t\t\t\ttempRepeats = grid.length - x - 1;\n\t\t\t} else {\n\t\t\t\ttempRepeats = grid.length - y - 1;\n\t\t\t}\n\t\t\tfor (int i = 0;i < tempRepeats; i++){\n\t\t\t\t//if piece is equal/null\n\t\t\t\tif(grid[x+(i+1)][y+(i+1)] == null || grid[x+(i+1)][y+(i+1)] == temp){\n\t\t\t\t\t//if piece is equal\n\t\t\t\t\tif (grid[x+(i+1)][y+(i+1)] == temp){\n\t\t\t\t\t\t//if it has already passed over the other color\n\t\t\t\t\t\tif(i > 0){\n\t\t\t\t\t\t\t//flip pieces in the middle\n\t\t\t\t\t\t\tfor (int j = 0;j < i;j++){\n\t\t\t\t\t\t\t\tgrid[x+(j+1)][y+(j+1)] = grid[x+(j+1)][y+(j+1)].flip();\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\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//down Left\n\t\t\tif(x < grid.length - y){\n\t\t\t\ttempRepeats = x;\n\t\t\t} else {\n\t\t\t\ttempRepeats = grid.length - y - 1;\n\t\t\t}\n\t\t\tfor (int i = 0;i < tempRepeats; i++){\n\t\t\t\t//if piece is equal/null\n\t\t\t\tif(grid[x-(i+1)][y+(i+1)] == null || grid[x-(i+1)][y+(i+1)] == temp){\n\t\t\t\t\t//if piece is equal\n\t\t\t\t\tif (grid[x-(i+1)][y+(i+1)] == temp){\n\t\t\t\t\t\t//if it has already passed over the other color\n\t\t\t\t\t\tif(i > 0){\n\t\t\t\t\t\t\t//flip pieces in the middle\n\t\t\t\t\t\t\tfor (int j = 0;j < i;j++){\n\t\t\t\t\t\t\t\tgrid[x-(j+1)][y+(j+1)] = grid[x-(j+1)][y+(j+1)].flip();\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\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\tcatch(Exception e){\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\tfinally {\n\n\t\t}\n\t}", "@Test\n public void play_RoyalFlushVsStraightFlush() throws Exception {\n Hand hand1 = new Hand();\n hand1.addCard(new Card(Card.SUIT_DIAMONDS, Card.CARD_10));\n hand1.addCard(new Card(Card.SUIT_DIAMONDS, Card.CARD_JACK));\n hand1.addCard(new Card(Card.SUIT_DIAMONDS, Card.CARD_QUEEN));\n hand1.addCard(new Card(Card.SUIT_DIAMONDS, Card.CARD_KING));\n hand1.addCard(new Card(Card.SUIT_DIAMONDS, Card.CARD_ACE));\n Hand hand2 = new Hand();\n hand2.addCard(new Card(Card.SUIT_CLUBS, Card.CARD_8));\n hand2.addCard(new Card(Card.SUIT_CLUBS, Card.CARD_9));\n hand2.addCard(new Card(Card.SUIT_CLUBS, Card.CARD_10));\n hand2.addCard(new Card(Card.SUIT_CLUBS, Card.CARD_JACK));\n hand2.addCard(new Card(Card.SUIT_CLUBS, Card.CARD_QUEEN));\n assertEquals(hand1, FiveCardDraw.play(hand1, hand2));\n }" ]
[ "0.5958205", "0.55195135", "0.55147934", "0.5483428", "0.5472401", "0.543024", "0.54229194", "0.5411092", "0.5379298", "0.5369804", "0.53471196", "0.52863085", "0.5278603", "0.5246391", "0.52261966", "0.52227694", "0.5211774", "0.5198082", "0.5194969", "0.51838744", "0.51779556", "0.5163201", "0.515372", "0.51485974", "0.5138305", "0.5120312", "0.5118611", "0.5116607", "0.5109523", "0.5108564", "0.5101732", "0.5094153", "0.5085912", "0.50786614", "0.5039177", "0.502178", "0.502067", "0.50188345", "0.501646", "0.50110865", "0.5010632", "0.5008278", "0.5002582", "0.49868643", "0.49785843", "0.49679124", "0.49649674", "0.4964362", "0.49625325", "0.49620062", "0.49604964", "0.4960155", "0.49578977", "0.49492204", "0.49481952", "0.49474123", "0.4933101", "0.4932977", "0.4915947", "0.4911272", "0.49109843", "0.49097013", "0.49065048", "0.4905753", "0.49029863", "0.48998165", "0.48986524", "0.4891724", "0.48909035", "0.4889046", "0.48820263", "0.48764232", "0.4875462", "0.48714375", "0.4870634", "0.48692727", "0.48682126", "0.48674342", "0.48536754", "0.48509157", "0.48494196", "0.4844599", "0.48443523", "0.48428553", "0.48410398", "0.48409507", "0.4837052", "0.48343167", "0.48326176", "0.4832233", "0.48282367", "0.48273697", "0.48261082", "0.48210186", "0.48194164", "0.48194036", "0.4813092", "0.48052335", "0.4802117", "0.480026" ]
0.7664279
0
This method plays the monopoly card with the specified resource
void playMonopolyCard(String resource);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void playMonopolyCard(ResourceType resource) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void playMonumentCard() {\n\t\t\r\n\t}", "void playYearOfPlentyCard(String resource1, String resource2);", "void playMonumentCard();", "@Override\r\n\tpublic void playCard() {\n\t\t\r\n\t}", "@Override\n\tpublic void playCard() {\n\t\t\n\t}", "public abstract CardAction play(Player p);", "@Override\r\n\tpublic void playYearOfPlentyCard(ResourceType resource1, ResourceType resource2) {\n\t\t\r\n\t}", "public void playCard(int player, int card) {\n }", "@Override\r\n\tpublic void playRoadBuildingCard() {\n\t\t\r\n\t}", "public void giveResourcesToPlayer(Resource resource){\n resources.addResource(resource);\n }", "@Override\r\n\tpublic void playSoldierCard() {\n\t\t\r\n\t}", "public void play() {\n\t\t\r\n\t}", "void playCurrentStationCard();", "@Test\n public void playMonopolyCard() throws Exception {\n ResourceType type = ResourceType.ORE;\n when(devCardFacade.canUseMonopolyCard(noDevCardsPlayer, type)).thenReturn(false);\n dcc.playMonopolyCard(type);\n verify(devCardFacade, never()).useMonopolyCard(noDevCardsPlayer, type);\n //Player 1; has devCards\n when(devCardFacade.canUseMonopolyCard(currentPlayer, type)).thenReturn(true);\n dcc.playMonopolyCard(type);\n }", "@Override\n\tpublic void play() {\n\t\t\n\t}", "private void gameSound(int attack){\n switch (attack){\n case 1:\n mediaPlayer = MediaPlayer.create(Activity_Game.this, R.raw.sound_lightattack);\n break;\n case 2:\n mediaPlayer = MediaPlayer.create(Activity_Game.this, R.raw.sound_strongattack);\n break;\n case 3:\n mediaPlayer = MediaPlayer.create(Activity_Game.this, R.raw.sound_brutalattack);\n break;\n }\n mediaPlayer.start();\n }", "public void foodSound(){\n if (enableSound){\r\n\t clip.play();\r\n }\r\n\t\t\r\n\t}", "@Override\n\tpublic void play() {\n\n\t}", "public void play(){\n\t\t\n\t}", "private void play() {\n\t\tParcel pc = Parcel.obtain();\n\t\tParcel pc_reply = Parcel.obtain();\n\t\ttry {\n\t\t\tSystem.out.println(\"DEBUG>>>pc\" + pc.toString());\n\t\t\tSystem.out.println(\"DEBUG>>>pc_replay\" + pc_reply.toString());\n\t\t\tib.transact(1, pc, pc_reply, 0);\n\t\t} catch (RemoteException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public void initResourceOfPlayer(Resource resource) throws IOException, InterruptedException {\n try {\n\n currentPlayer.initResource(resource);\n } catch (CallForCouncilException e) {\n exceptionHandler(e);\n } catch (LastSpaceReachedException e) {\n exceptionHandler(e);\n }\n currentPlayer.setInitResource(true);\n notifyToOneObserver(new UpdateInitResourceMessage(resource));\n notifyAllObserverLessOne(new UpdateForNotCurrentResourceMessage(resource));\n\n\n }", "private void runBlueEssencePurchase2(String championName) {\r\n if (championName.equals(\"Blitzcrank\")) {\r\n playSound(\"./data/Blitzcrank.wav\");\r\n } else if (championName.equals(\"Darius\")) {\r\n playSound(\"./data/Darius.wav\");\r\n } else if (championName.equals(\"Syndra\")) {\r\n playSound(\"./data/Syndra.wav\");\r\n } else if (championName.equals(\"Lucian\")) {\r\n playSound(\"./data/Lucian.wav\");\r\n } else if (championName.equals(\"Akali\")) {\r\n playSound(\"./data/Akali.wav\");\r\n } else if (championName.equals(\"Sejuani\")) {\r\n playSound(\"./data/Sejuani.wav\");\r\n } else if (championName.equals(\"Fiddlesticks\")) {\r\n playSound(\"./data/Fiddlesticks.wav\");\r\n }\r\n }", "void makePlay(int player) {\n }", "public void giveMeResource(Resource resource, float amount) throws CallbackAIException;", "private Type stealResource() {\n \t\tint count = getResourceCount();\n \t\tif (count <= 0)\n \t\t\treturn null;\n \n \t\t// pick random card\n \t\tint select = (int) (Math.random() * count);\n \t\tfor (int i = 0; i < resources.length; i++) {\n \t\t\tif (select < resources[i]) {\n \t\t\t\tuseResources(Type.values()[i], 1);\n \t\t\t\treturn Type.values()[i];\n \t\t\t}\n \n \t\t\tselect -= resources[i];\n \t\t}\n \n \t\treturn null;\n \t}", "private void play(Player p){\r\n\t\tSystem.out.println(\"What pet would you like to play with?\");\r\n\t\tint c = 1;\r\n\t\tArrayList<Toy> toys = p.getToys();\r\n\r\n\t\tfor(Pet pet : p.getPets()){\r\n\t\t\tSystem.out.println(c + \". \" + pet.getPetname());\r\n\t\t\tc++;\r\n\t\t}\r\n\t\tint selectedpetindex = getNumber(1, p.getPets().size());\r\n\t\tPet selectedpet = p.getPets().get(selectedpetindex - 1);\r\n\t\tSystem.out.println(\"What toy do you want to use to play with \" + selectedpet.getPetname());\r\n\r\n\t\tc = 1;\r\n\t\tfor(Toy t : toys){\r\n\t\t\tSystem.out.println(c + \". \" + t.getName());\r\n\t\t\tc++;\r\n\t\t}\r\n\t\tint toyindex = getNumber(1, toys.size());\r\n\t\tToy selectedtoy = toys.get(toyindex);\r\n\r\n\t\tselectedpet.play(selectedtoy);\r\n\t\tselectedtoy.setDurability(selectedtoy.getDurability() - selectedpet.getRoughness());\r\n\r\n\t\tif(selectedtoy.getDurability() < 1){\r\n\t\t\ttoys.remove(toyindex);\r\n\t\t}else{\r\n\t\t\ttoys.set(toyindex, selectedtoy);\r\n\t\t}\r\n\r\n\t\tp.setToys(toys);\r\n\t\tp.setActions(p.getActions() - 1);\r\n\t}", "public String playMonopolyCard(Monopoly monopoly) throws Exception {\n\t\tString url = server_url + \"/moves/Monopoly\";\n\t\tURL obj = new URL(url);\n\t\tHttpURLConnection con = (HttpURLConnection) obj.openConnection();\n\n\t\t//add request header\n\t\tcon.setRequestMethod(\"POST\");\n\t\tcon.setRequestProperty(\"User-Agent\", \"Mozilla/5.0\");\n\t\tcon.setRequestProperty(\"Accept-Language\", \"en-US,en;q=0.5\");\n\t\tcon.setRequestProperty(\"Cookie\", usercookie + \"; \" + gamecookie);\n\t\t\n\t\tJsonObject info = new JsonObject();\n\t\tinfo.addProperty(\"type\",\"Monopoly\");\n\t\tinfo.addProperty(\"playerIndex\", monopoly.playerIndex);\n\t\tinfo.addProperty(\"resource\", monopoly.resource.name().toLowerCase());\n\t\t\n\t\t// Send post request\n\t\tcon.setDoOutput(true);\n\t\tDataOutputStream wr = new DataOutputStream(con.getOutputStream());\n\t\twr.writeBytes(info.toString());\n\t\twr.flush();\n\t\twr.close();\n\n\t\tint responseCode = con.getResponseCode();\n\t\t//System.out.println(\"\\nSending 'POST' request to URL : \" + url);\n\t\t//System.out.println(\"Post parameters : \" + info.toString());\n\t\t//System.out.println(\"Response Code : \" + responseCode);\n\n\t\tif (responseCode == 400) {\n\t\t\tthrow new Exception();\n\t\t}\n\t\tBufferedReader in = new BufferedReader(\n\t\t new InputStreamReader(con.getInputStream()));\n\t\tString inputLine;\n\t\tStringBuffer response = new StringBuffer();\n\n\t\twhile ((inputLine = in.readLine()) != null) {\n\t\t\tresponse.append(inputLine);\n\t\t}\n\t\tin.close();\n\t\t\n\t\t//print result\n\t\t////System.out.println(response.toString());\n\t\treturn response.toString();\n\t}", "public ResourceCard giveUpResourceCard() throws Exception {\n\t\t return resourceCardHand.getRandomResourceCard();\n\t }", "public void play() {\n\t\tplay(true, true);\n\t}", "public void showResources(byte devCard) {\r\n\t\tif (devCard == Constants.GETRESOURCES)\r\n\t\t\tisResourceCard = true;\r\n\t\tif (devCard == Constants.MONOPOLY)\r\n\t\t\tisMonopolyCard = true;\r\n\t\tresourcePanel.setVisible(true);\r\n\t}", "public static void playSound(){\r\n try{\r\n Clip clip = AudioSystem.getClip();\r\n clip.open(AudioSystem.getAudioInputStream(new File(\"Cheering.wav\")));\r\n clip.start();\r\n }\r\n catch (Exception exc){\r\n exc.printStackTrace(System.out);\r\n } \r\n }", "private void playGameOverSound()\n {\n try\n {\n java.io.File soundFile = new java.io.File(\n \"C:\\\\Windows\\\\Media\\\\ringout.wav\");\n javax.sound.sampled.AudioInputStream audioIn =\n javax.sound.sampled.AudioSystem.getAudioInputStream(\n soundFile);\n javax.sound.sampled.Clip clip =\n javax.sound.sampled.AudioSystem.getClip();\n\n clip.open(audioIn);\n clip.start();\n }\n catch (Exception ex)\n {\n System.out.println(ex);\n }\n }", "@Override\n\tpublic Entity interact(Player p) {\n\t\tif(p.getCarryOns() == null) {\n\t\t\tp.setCarryOns(this);\n\t\t\tp.getDungeon().removeEntity(this);\n\t\t\tSystem.out.println(\"CARRIED KEY WITH ID = \" +this.id);\n\t\t\tString musicFile = \"./sounds/Key.wav\";\n\t\t\tMedia sound = new Media(new File(musicFile).toURI().toString());\n\t\t\tMediaPlayer mediaPlayer = new MediaPlayer(sound);\n\t\t\tmediaPlayer.play();\n\t\t\treturn this;\n\t\t} else {\n\t\t\tSystem.out.println(\"Cannot pick up key, already carrying something\");\n\t\t\treturn null;\n\t\t}\n\t}", "@Test\n public void ResourceRequirement() {\n MSG_ACTION_ACTIVATE_LEADERCARD message = new MSG_ACTION_ACTIVATE_LEADERCARD(0);\n p.getStrongbox().addResource(Resource.SHIELD, 4);\n p.getWarehouseDepot().add(Resource.COIN);\n p.getWarehouseDepot().add(Resource.SHIELD);\n c.emptyQueue();\n\n assertTrue(am.activateLeaderCard(p, message));\n\n assertTrue(l1.isEnabled());\n\n assertEquals(1, c.messages.stream().filter(x -> x.getMessageType() == MessageType.MSG_UPD_Player).count());\n assertEquals(1, c.messages.stream().filter(x -> x.getMessageType() == MessageType.MSG_NOTIFICATION).count());\n assertEquals(2, c.messages.size());\n }", "private void makePlay() {\n\t\teating = true;\n\t\ttama.setLayoutX(200);\n\n\t\tplay = new Sprite(6, 6, 360, 379, new Image(\"file:./res/images/basketball.png\"), 1, 1000);\n\t\tplay.setLayoutX(140);\n\t\tplay.setLayoutY(190);\n\t\tplay.setScaleX(0.5);\n\t\tplay.setScaleY(0.5);\n\t\tgrid.getChildren().addAll(play);\n\t\tPauseTransition pause = new PauseTransition(Duration.millis(1000));\n\t\tpause.setOnFinished(e -> {\n\t\t\tgrid.getChildren().remove(play);\n\t\t\ttama.setLayoutX(190);\n\t\t\teating = false;\n\t\t\tmodel.getController().playWith();\n\t\t});\n\t\tpause.play();\n\n\t}", "void play();", "public boolean playCard(Card card){\n boolean b = effectHandler.playCard( card , null);\n return b;\n }", "public void playCard(ActionCard card, Integer selectedPlayer)\n {\n System.out.println(\"gui: playCard: \" + card + \", selected: \" + selectedPlayer);\n // Guard against this\n if (!isTurn || this.played)\n {\n return;\n }\n \n if(card instanceof PrivateTip || card instanceof Snoop) \n {\n if(selectedPlayer == null) \n {\n JOptionPane.showMessageDialog(null, \"Please select \"\n + \"a player in the \"\n + \"Player Listing (Upper right) that is not yourself!\", \n \"Warning\", \n JOptionPane.ERROR_MESSAGE); \n return;\n }\n }\n\n if (card instanceof Suggestion)\n {\n this.played = true;\n // prompt for solution\n suggestionScreen = new AccusationScreen(this, true, (Suggestion)card);\n suggestionScreen.setVisible(true);\n }\n else\n {\n this.played = clientController.playActionCard(card, selectedPlayer);\n if(!this.played)\n {\n mainGameScreen.notifyUser(\"Play failed: To Play this card,\"\n + \" please select a CluePlayer from the 'Players' list,\"\n + \" then click on this card.\");\n }\n }\n\n }", "public void Play();", "private void runRiotPointsPurchase2(String championName) {\r\n if (championName.equals(\"Blitzcrank\")) {\r\n playSound(\"./data/Blitzcrank.wav\");\r\n } else if (championName.equals(\"Darius\")) {\r\n playSound(\"./data/Darius.wav\");\r\n } else if (championName.equals(\"Syndra\")) {\r\n playSound(\"./data/Syndra.wav\");\r\n } else if (championName.equals(\"Lucian\")) {\r\n playSound(\"./data/Lucian.wav\");\r\n } else if (championName.equals(\"Akali\")) {\r\n playSound(\"./data/Akali.wav\");\r\n } else if (championName.equals(\"Sejuani\")) {\r\n playSound(\"./data/Sejuani.wav\");\r\n } else if (championName.equals(\"Fiddlesticks\")) {\r\n playSound(\"./data/Fiddlesticks.wav\");\r\n }\r\n }", "public void theRockSounds()\n {\n this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n this.setTitle(\"Test Sound Clip\");\n this.setSize(300, 200);\n this.setVisible(false);\n\n try {\n // Open an audio input stream.\n URL url= new URL(\"http://shortmp3.mobi/u/files/WAV/39627-The_Rock_(ShortMp3.com).wav\");\n AudioInputStream audioIn = AudioSystem.getAudioInputStream(url);\n\n // Get a sound clip resource.\n Clip clip = AudioSystem.getClip();\n // Open audio clip and load samples from the audio input stream.\n clip.open(audioIn);\n clip.start();\n\n } catch (UnsupportedAudioFileException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (LineUnavailableException e) {\n e.printStackTrace();\n }\n\n }", "@Override\n public void beHelpful() {\n this.playPiano();\n this.takeABow();\n }", "public void playPaper(ActionEvent e) throws IOException {\n try {\n //System.out.println(\"Class play: \" + game.getClass().toString());\n getWinnerRPS(game.play(2));\n playerPlays = \"Player plays paper\";\n computerPlays = \"Computer plays \" + addRPSPlayed(game.getComputerPlays());\n myctr.setLabels();\n } catch(Exception n) {\n System.out.println(\"Game \\\"RockPaperScissors\\\" not initialized!\");\n }\n }", "public static Clip loadSoundFromResourceFile(String filename) {\n try {\n ClassLoader classloader = Thread.currentThread().getContextClassLoader();\n InputStream is = classloader.getResourceAsStream(filename);\n AudioInputStream sound = AudioSystem.getAudioInputStream(new BufferedInputStream(is));\n Clip audioclip = AudioSystem.getClip();\n audioclip.open(sound);\n return audioclip;\n\n } catch (Exception e) {\n // Do nothing\n return null;\n }\n }", "public Card PlayCard() {\n\t Card ret = null;\n\t Card card;\n\t if (mCardCount > 0) {\n\t\t // To work out what card to play, see what cards can be played\n\t\t \tCard[] playableCards;\n\t\t \tplayableCards = mRules.GetPlayableCards();\n\t\t \tCard[] selectedCards;\n\t\t \tselectedCards = new Card[8];\n\t\t \tint iNumSelectableCards = 0;\n\t\t \tfor (int i = 0; i < 8; i++)\n\t\t \t\tselectedCards[i] = null;\n\t \tfor (int i = 0; i < mCardCount; i++){\n\t \t\tcard = mCard[i];\n\t \t\tswitch (card.GetSuit()){\n\t \t\tcase Card.HEARTS:\n\t \t\t\t\n\t \t\t\t// Card is a heart, can it be played?\n\t \t\t\t// Is it a seven, it can be played...\n\t \t\t\tif (card.GetValue() == 7){\n\t \t\t\t\tselectedCards[Rules.HEARTS8] = card;\n\t \t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t// and must be played first\n\t \t\t\t\tplayableCards[Rules.HEARTS8] = new Card(8,Card.HEARTS);\n\t \t\t\t\tplayableCards[Rules.HEARTS6] = new Card(6,Card.HEARTS);\n\t \t\t\t\tplayableCards[Rules.CLUBS8] = new Card(7,Card.CLUBS);\n\t \t\t\t\tplayableCards[Rules.DIAMONDS8] = new Card(7,Card.DIAMONDS);\n\t \t\t\t\tplayableCards[Rules.SPADES8] = new Card(7,Card.SPADES);\n\t \n\t \t\t\t\treturn card;\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() < 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.HEARTS6])){\n\t \t\t\t\t\tselectedCards[Rules.HEARTS6] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t\t//Log.i(\"\",\" Playing card \" + (card.GetValue()) + \" , \" +card.GetSuit());\n\t \t\t\t\t\t//Log.i(\"\",\" Updating playable card \" + (card.GetValue()-1) + \" , \" +Card.HEARTS);\t \t\t\t\t\t\n\t \t\t\t\t\t//playableCards[Rules.HEARTS6] = new Card(card.GetValue()-1,Card.HEARTS);\n\t \t\t\t\t\t//return card;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() > 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.HEARTS8])){\n\t \t\t\t\t\tselectedCards[Rules.HEARTS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t\t//Log.i(\"\",\" Playing card \" + (card.GetValue()) + \" , \" +card.GetSuit());\n\t \t\t\t\t\t//Log.i(\"\",\" Updating playable card \" + (card.GetValue()+1) + \" , \" +Card.HEARTS);\t \t\t\t\t\t\n\t \t\t\t\t\t//playableCards[Rules.HEARTS8] = new Card(card.GetValue()+1,Card.HEARTS);\n\t \t\t\t\t\t//return card;\n\t \t\t\t\t}\n\t \t\t\t}\t \t\t\t\n\t \t\t\t\n\t \t\t\tbreak;\n\t \t\tcase Card.DIAMONDS:\n\t \t\t\t// Is it a seven, it can be played...\n\t \t\t\tif (card.GetValue() == 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.DIAMONDS8])){\n\t \t\t\t\t\tselectedCards[Rules.DIAMONDS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\t\n\t \t\t\tif (card.GetValue() < 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.DIAMONDS6])){\n\t \t\t\t\t\tselectedCards[Rules.DIAMONDS6] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() > 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.DIAMONDS8])){\n\t \t\t\t\t\tselectedCards[Rules.DIAMONDS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\t\t \t\t\t\n\t \t\t\t\n\t \t\t\tbreak;\n\t \t\t\t\n\t \t\tcase Card.CLUBS:\n\t \t\t\t// Is it a seven, it can be played...\n\t \t\t\tif (card.GetValue() == 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS8])){\n\t \t\t\t\t\tselectedCards[Rules.CLUBS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\t \t\t\t\t\n\t \t\t\t}\n\t \t\t\t\n\t \t\t\tif (card.GetValue() < 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS6])){\n\t \t\t\t\t\tselectedCards[Rules.CLUBS6] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() > 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS8])){\n\t \t\t\t\t\tselectedCards[Rules.CLUBS8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\t\t \t\t\t\n\t \t\t\tbreak;\n\t \t\t\t\n\t \t\tcase Card.SPADES:\n\t \t\t\t// Is it a seven, it can be played...\n\t \t\t\tif (card.GetValue() == 7){\n\t \t\t\t\tif (card.Equals(playableCards[Rules.SPADES8])){\n\t \t\t\t\t\tselectedCards[Rules.SPADES8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\t \t\t\t\t\n\t \t\t\t}\n\t \t\t\t\n\t \t\t\tif (card.GetValue() < 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.SPADES6])){\n\t \t\t\t\t\tselectedCards[Rules.SPADES6] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t\tif (card.GetValue() > 7){\n\t \t\t\t\tif (card.Equals( playableCards[Rules.SPADES8])){\n\t \t\t\t\t\tselectedCards[Rules.SPADES8] = card;\n\t \t\t\t\t\tiNumSelectableCards++;\n\t \t\t\t\t}\n\t \t\t\t}\t \t\t\t\n\t \t\t\tbreak;\n\n\t \t\t\t\t \t\t\t\n\t \t\t}\n\t\n\t \t}\t\n\t \t\n\t \t// Now go through the selectable cards and see which is best to be played\n\t \tif (iNumSelectableCards == 0)\n\t \t\treturn ret;\n\t \t\n\t \tint iPos;\n\t \tcard = null;\n\t \tif (iNumSelectableCards == 1){\n\t\t\t \tfor (int i = 0; i < 8; i++)\n\t\t\t \t\tif (selectedCards[i] != null){\n\t\t\t \t\t\tcard = selectedCards[i];\n\t\t\t \t\t\tbreak;\n\t\t\t \t\t}\n\t\t\t \t\t\t \t\n\t \t}\n\t \telse {\n\t\t\t String sDifficulty = mRules.mView.GetSettings().getString(\"Difficulty\", \"0\");// 0 = hard, 1 = easy\n\t\t\t int iDifficulty = Integer.parseInt(sDifficulty);\n\t\t\t if (iDifficulty == EASY){\n\t\t\t \t// Get a random card from the playable ones\n\t\t\t\t\t Random generator = new Random();\n\t\t\t\t\t int randomIndex = generator.nextInt( iNumSelectableCards );\n\t\t\t\t\t int iCount = 0;\n\t\t\t\t\t \tfor (int i = 0; i < 8; i++){\n\t\t\t\t\t \t\tif (selectedCards[i] != null){\n\t\t\t\t\t \t\t\tif (iCount == randomIndex){\n\t\t\t\t\t \t\t\t\tcard = selectedCards[i];\n\t\t\t\t\t \t\t\t\tbreak;\n\t\t\t\t\t \t\t\t}\n\t\t\t\t\t \t\t\telse iCount++;\n\t\t\t\t\t \t\t}\t\n\t\t\t\t\t \t}\n\t\t\t }\n\t\t\t else {\n\t\t\t \tiPos = GetBestCard(selectedCards);\n\t\t\t \tcard = selectedCards[iPos];\n\t\t\t }\n\t \t}\n\t \t\n\t \tswitch (card.GetSuit()){\n \t\tcase Card.HEARTS:\t \t\n \t\t\tif (card.GetValue() == 7){\n \t\t\t\t// and must be played first\n \t\t\t\tplayableCards[Rules.HEARTS8] = new Card(8,Card.HEARTS);\n \t\t\t\tplayableCards[Rules.HEARTS6] = new Card(6,Card.HEARTS);\n \t\t\t\tplayableCards[Rules.CLUBS8] = new Card(7,Card.CLUBS);\n \t\t\t\tplayableCards[Rules.DIAMONDS8] = new Card(7,Card.DIAMONDS);\n \t\t\t\tplayableCards[Rules.SPADES8] = new Card(7,Card.SPADES);\n \n \t\t\t\treturn card;\n \t\t\t}\n \t\t\tif (card.GetValue() < 7){\n \t\t\t\tif (card.Equals(playableCards[Rules.HEARTS6])){\n \t\t\t\t\tplayableCards[Rules.HEARTS6] = new Card(card.GetValue()-1,Card.HEARTS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (card.GetValue() > 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.HEARTS8])){ \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.HEARTS8] = new Card(card.GetValue()+1,Card.HEARTS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\t \t\t\t\n \t\t\t\n \t\t\tbreak; \n \t\tcase Card.DIAMONDS:\n \t\t\t// Is it a seven, it can be played...\n \t\t\tif (card.GetValue() == 7){\n \t\t\t\tif (playableCards[Rules.HEARTS8] != null && playableCards[Rules.HEARTS8].GetValue() > 7){\n\t \t\t\t\tplayableCards[Rules.DIAMONDS8] = new Card(8,Card.DIAMONDS);\n\t \t\t\t\tplayableCards[Rules.DIAMONDS6] = new Card(6,Card.DIAMONDS);\t \t\t\t\t\t\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\tif (card.GetValue() < 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.DIAMONDS6])){\t \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.DIAMONDS6] = new Card(card.GetValue()-1,Card.DIAMONDS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (card.GetValue() > 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.DIAMONDS8])){\t \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.DIAMONDS8] = new Card(card.GetValue()+1,Card.DIAMONDS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\t\t \t\t\t\n \t\t\t\n \t\t\tbreak; \n \t\t\t\n \t\tcase Card.CLUBS:\n \t\t\t// Is it a seven, it can be played...\n \t\t\tif (card.GetValue() == 7){\n\n \t\t\t\tif (playableCards[Rules.HEARTS8] != null && playableCards[Rules.HEARTS8].GetValue() > 7){\n\t \t\t\t\tplayableCards[Rules.CLUBS8] = new Card(8,Card.CLUBS);\n\t \t\t\t\tplayableCards[Rules.CLUBS6] = new Card(6,Card.CLUBS);\t \t\t\t\t\t\n \t\t\t\t\treturn card;\n \t\t\t\t}\t \t\t\t\t\n \t\t\t}\n \t\t\t\n \t\t\tif (card.GetValue() < 7){\n \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS6])){\n \t\t\t\t\tplayableCards[Rules.CLUBS6] = new Card(card.GetValue()-1,Card.CLUBS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (card.GetValue() > 7){\n \t\t\t\tif (card.Equals(playableCards[Rules.CLUBS8])){\n \t\t\t\t\tLog.i(\"\",\" Updating playable card \" + (card.GetValue()+1) + \" , \" +Card.CLUBS);\n \t\t\t\t\tplayableCards[Rules.CLUBS8] = new Card(card.GetValue()+1,Card.CLUBS);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\t\t \t\t\t\n \t\t\tbreak; \n \t\tcase Card.SPADES:\n \t\t\t// Is it a seven, it can be played...\n \t\t\tif (card.GetValue() == 7){\n \t\t\t\tif (playableCards[Rules.HEARTS8] != null && playableCards[Rules.HEARTS8].GetValue() > 7){\n\t \t\t\t\tplayableCards[Rules.SPADES8] = new Card(8,Card.SPADES);\n\t \t\t\t\tplayableCards[Rules.SPADES6] = new Card(6,Card.SPADES);\t \t\t\t\t\t\n \t\t\t\t\treturn card;\n \t\t\t\t}\t \t\t\t\t\n \t\t\t}\n \t\t\t\n \t\t\tif (card.GetValue() < 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.SPADES6])){ \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.SPADES6] = new Card(card.GetValue()-1,Card.SPADES);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\n \t\t\tif (card.GetValue() > 7){\n \t\t\t\tif (card.Equals( playableCards[Rules.SPADES8])){\t \t\t\t\t\t\n \t\t\t\t\tplayableCards[Rules.SPADES8] = new Card(card.GetValue()+1,Card.SPADES);\n \t\t\t\t\treturn card;\n \t\t\t\t}\n \t\t\t}\t \t\t\t\n \t\t\tbreak;\n \t\t\t\n\t \t}\n\t \n\t }\n\t return ret;\n }", "private void playYouWinSound()\n {\n try\n {\n java.io.File soundFile = new java.io.File(\n \"C:\\\\Windows\\\\Media\\\\tada.wav\");\n javax.sound.sampled.AudioInputStream audioIn =\n javax.sound.sampled.AudioSystem.getAudioInputStream(\n soundFile);\n javax.sound.sampled.Clip clip =\n javax.sound.sampled.AudioSystem.getClip();\n\n clip.open(audioIn);\n clip.start();\n }\n catch (Exception ex)\n {\n System.out.println(ex);\n }\n }", "public void playRound(CuarentaGame game){\n Player human = game.getHumanPlayer();\n Player computer = game.getComputerPlayer();\n Player activePlayer;\n \n for(int i=0; i<10; i++){\n // For now, human player starts always. This isn't quite intended, but not important right now\n if(i%2==0)\n activePlayer = human;\n else\n activePlayer = computer;\n // choose a card to play\n \n // choose next actions\n \n // add points accordingly\n\n // check win condition\n\n }\n\n human.addPoints(calculatePointsFromDiscardPile(game.getHumanPlayer()));\n computer.addPoints(calculatePointsFromDiscardPile(game.getComputerPlayer()));\n }", "public static void playShootingSound(){\n String musicFile = \"Sounds\\\\Shoot.mp3\";\n Media sound = new Media(new File(musicFile).toURI().toString());\n MediaPlayer mediaPlayer = new MediaPlayer(sound);\n mediaPlayer.setVolume(App.getVolume());\n mediaPlayer.play();\n }", "public PlayingCard(){\n\t\tsuper();\n\t}", "@Override\n\tpublic void cardInPlay() {\n\t\tIPlayer playedOn = this.game.getOtherPlayer();\n\t\tif(!playedOn.getFaction().equals(Faction.Cultist)){\n\t\t\tplayedOn.setFaction(Faction.UNAFFILIATED);\n\t\t}\n\t\tthis.setDiscard();\n\t}", "private PlayingCard chooseCard(HeartsGraphics g){\t\t\n\t\tHearts.setCurrentPlayer(this);\n\t\t\n\t\tif(number != PLAYER_ONE){\n\t\t\t// A.I. code\n\t\t\tint index;\n\t\t\t\n\t\t\tRandom r = new Random();\n\t\t\tindex = r.nextInt(hand.size());\t\t\t\n\t\t\t\n\t\t\treturn hand.get(index);\t\t\t\n\t\t} else {\n\t\t\treturn getCard(g);\n\t\t}\t\t\n\t}", "public void play(Player p) {\n\t\tthis.player=p;\n\t\tplayer.setActualRoom(this.currentRoom);\n\t\twhile (!this.isFinished()) {\n\t\t\tthis.currentRoom=p.getActualRoom();\n\t\t\tif (this.GameOver()) {\n\t\t\t\tSystem.out.println(\"You LOOSE !\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (this.isFinished()) {\n\t\t\t\tSystem.out.println(\"You WIN !\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tp.act();\n\t\t}\n\t\tif (this.isFinished()) {\n\t\t\tSystem.out.println(\"You WIN !\");\n\t\t}\n\t\n\t\t\n\t}", "public static void playPickupSound(){\n String musicFile = \"Sounds\\\\Pickup.mp3\";\n Media sound = new Media(new File(musicFile).toURI().toString());\n MediaPlayer mediaPlayer = new MediaPlayer(sound);\n mediaPlayer.setVolume(App.getVolume());\n mediaPlayer.play();\n }", "protected abstract void internalPlay();", "public void play() {\n\t\tthis.initializeTurn();\n\t\twhile(this.getAction() > 0) {\n\t\t\tint choix = RandomInt.randomInt(1,6, this.rand);\n\t\t\tif(choix == 1) {\n\t\t\t\t//add building, preference of Machine\n\t\t\t\tint max = 0;\n\t\t\t\tint maxi = 0;\n\t\t\t\tboolean find = false;\n\t\t\t\tfor(int i = 0; i < this.getBoard().getFiveBuildingCards().size(); i++) {\n\t\t\t\t\tif(this.getBoard().getFiveBuildingCards().get(i) != null) {\n\t\t\t\t\t\tif(this.getBoard().getFiveBuildingCards().get(i) instanceof Machine) {\n\t\t\t\t\t\t\tmaxi = i;\n\t\t\t\t\t\t\tfind = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(this.getBoard().getFiveBuildingCards().get(i).getPoint() > max && !find) {\n\t\t\t\t\t\t\tmax = this.getBoard().getFiveBuildingCards().get(i).getPoint();\n\t\t\t\t\t\t\tmaxi = i;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.addBuilding(this.getBoard().getFiveBuildingCards().get(maxi));\n\t\t\t\tDesignString.printBorder(\"Ouverture d'un chantier\");\n\t\t\t}\n\t\t\telse if(choix == 2 || choix == 3) {\n\t\t\t\t//add worker, preference of the lowest one\n\t\t\t\tint min = 999;\n\t\t\t\tint mini = 0;\n\t\t\t\tfor(int i = 0; i < this.getBoard().getFiveWorkerCards().size(); i++) {\n\t\t\t\t\tif(this.getBoard().getFiveWorkerCards().get(i) != null) {\n\t\t\t\t\t\tif(this.getBoard().getFiveWorkerCards().get(i).getCost() < min && this.getBoard().getFiveWorkerCards().get(i).getCost() >= this.getCoin()) {\n\t\t\t\t\t\t\tmin = this.getBoard().getFiveWorkerCards().get(i).getCost();\n\t\t\t\t\t\t\tmini = i;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(this.getBoard().getFiveWorkerCards().get(mini).getCost() >= this.getCoin()) {\n\t\t\t\t\tDesignString.printBorder(\"Échange action vers écus\");\n\t\t\t\t\tthis.actionToCoins(RandomInt.randomInt(1,this.getAction(), this.rand));\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tDesignString.printBorder(\"Recrutement d'un ouvrier\");\n\t\t\t\t\tthis.hireWorker(this.getBoard().getFiveWorkerCards().get(mini));\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(choix == 4 || choix == 5 || choix == 6) {\n\t\t\t\t//worker to building. Preference to the started building. If it can't play, preference to action to coin\n\t\t\t\tIBuilding building = null;\n\t\t\t\tIWorker worker = null;\n\t\t\t\tif(this.getWorkerCards().size() > 0) {\n\t\t\t\t\tif(this.getStartedBuilding().size() > 0) {\n\t\t\t\t\t\tchoix = RandomInt.randomInt(0,2,this.rand);\n\t\t\t\t\t\tif(choix%2 == 0) {\n\t\t\t\t\t\t\tint max = 0;\n\t\t\t\t\t\t\tint maxi = 0;\n\t\t\t\t\t\t\tfor(int i = 0; i < this.getStartedBuilding().size(); i++) {\n\t\t\t\t\t\t\t\tif(this.getStartedBuilding().get(i) != null) {\n\t\t\t\t\t\t\t\t\tif(this.getStartedBuilding().get(i).getWorkerOn().size() > max) {\n\t\t\t\t\t\t\t\t\t\tmax = this.getStartedBuilding().get(i).getWorkerOn().size();\n\t\t\t\t\t\t\t\t\t\tmaxi = i;\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\tbuilding = this.getStartedBuilding().get(maxi);\n\n\t\t\t\t\t\t\tworker = this.getWorkerCards().get(RandomInt.randomInt(0,this.getWorkerCards().size()-1, this.rand));\n\n\t\t\t\t\t\t\twhile(worker != null && worker.getCost() > this.getCoin() && this.getAction() > 0) {\n\t\t\t\t\t\t\t\tworker = this.getWorkerCards().get(RandomInt.randomInt(0,this.getWorkerCards().size()-1, this.rand));\n\t\t\t\t\t\t\t\tchoix = RandomInt.randomInt(1,5,this.rand);\n\t\t\t\t\t\t\t\tif(choix == 1) {\n\t\t\t\t\t\t\t\t\tDesignString.printBorder(\"Échange action vers écus\");\n\t\t\t\t\t\t\t\t\tthis.actionToCoins(RandomInt.randomInt(1,this.getAction(), this.rand));\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\tif(this.getAction() >= this.getRemoveBuilding(building)) {\n\t\t\t\t\t\t\t\tDesignString.printBorder(\"Envoi d'un ouvrier sur un chantier\");\n\t\t\t\t\t\t\t\tthis.workerToBuilding(worker, building);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tbuilding = this.getBuildingsCards().get(RandomInt.randomInt(0,this.getBuildingsCards().size()-1, this.rand));\n\t\t\t\t\t\t\twhile(building == null) {\n\t\t\t\t\t\t\t\tbuilding = this.getBuildingsCards().get(RandomInt.randomInt(0,this.getBuildingsCards().size()-1, this.rand));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tworker = this.getWorkerCards().get(RandomInt.randomInt(0,this.getWorkerCards().size()-1, this.rand));\n\t\t\t\t\t\t\twhile(worker != null && worker.getCost() > this.getCoin() && this.getAction() > 0) {\n\t\t\t\t\t\t\t\tworker = this.getWorkerCards().get(RandomInt.randomInt(0,this.getWorkerCards().size()-1, this.rand));\n\t\t\t\t\t\t\t\tchoix = RandomInt.randomInt(1,5,this.rand);\n\t\t\t\t\t\t\t\tif(choix == 1) {\n\t\t\t\t\t\t\t\t\tDesignString.printBorder(\"Échange action vers écus\");\n\t\t\t\t\t\t\t\t\tthis.actionToCoins(RandomInt.randomInt(1,this.getAction(), this.rand));\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\tif(this.getAction() >= this.getRemoveBuilding(building)) {\n\t\t\t\t\t\t\t\tDesignString.printBorder(\"Envoi d'un ouvrier sur un chantier\");\n\t\t\t\t\t\t\t\tthis.workerToBuilding(worker, building);\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} else if(this.getBuildingsCards().size() > 0) {\n\t\t\t\t\t\tbuilding = this.getBuildingsCards().get(RandomInt.randomInt(0,this.getBuildingsCards().size()-1, this.rand));\n\t\t\t\t\t\twhile(building == null) {\n\t\t\t\t\t\t\tbuilding = this.getBuildingsCards().get(RandomInt.randomInt(0,this.getBuildingsCards().size()-1, this.rand));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tworker = this.getWorkerCards().get(RandomInt.randomInt(0,this.getWorkerCards().size()-1, this.rand));\n\t\t\t\t\t\twhile(worker != null && worker.getCost() > this.getCoin() && this.getAction() > 0) {\n\t\t\t\t\t\t\tworker = this.getWorkerCards().get(RandomInt.randomInt(0,this.getWorkerCards().size()-1, this.rand));\n\t\t\t\t\t\t\tchoix = RandomInt.randomInt(1,5,this.rand);\n\t\t\t\t\t\t\tif(choix == 1) {\n\t\t\t\t\t\t\t\tDesignString.printBorder(\"Échange action vers écus\");\n\t\t\t\t\t\t\t\tthis.actionToCoins(RandomInt.randomInt(1,this.getAction(), this.rand));\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(this.getAction() >= this.getRemoveBuilding(building)) {\n\t\t\t\t\t\t\tDesignString.printBorder(\"Envoi d'un ouvrier sur un chantier\");\n\t\t\t\t\t\t\tthis.workerToBuilding(worker, building);\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}", "public final void play() {\n\t\tinitialize();\n\t\tstartPlay();\n\t\tendPlay();\n\t}", "public void play() {\n if (!isHungry()) {\n hunger += 2;\n mood += 2;\n fatigue += 3;\n\n if (!muted) {\n System.out.println(\"play\\t|\\tPlaying is fun!\");\n }\n }\n }", "public void run() \n {\n try\n {\n Clip clip = AudioSystem.getClip();\n AudioInputStream inputStream = AudioSystem.getAudioInputStream(getClass().getResource(sound));\n clip = AudioSystem.getClip();\n clip.open(inputStream);\n clip.start(); \n } catch (UnsupportedAudioFileException e) {\n \t\t\te.printStackTrace();\n } catch (IOException e) {\n \t\t\te.printStackTrace();\n } catch (LineUnavailableException e) {\n \t\t\te.printStackTrace();\n }\n }", "public void playScissor(ActionEvent e) throws IOException {\n try {\n //System.out.println(\"Class play: \" + game.getClass().toString());\n getWinnerRPS(game.play(3));\n playerPlays = \"Player plays scissors\";\n computerPlays = \"Computer plays \" + addRPSPlayed(game.getComputerPlays());\n myctr.setLabels();\n } catch(Exception n) {\n System.out.println(\"Game \\\"RockPaperScissors\\\" not initialized!\");\n }\n }", "@Test\n public void testCardCanPlay_WILD() {\n System.out.println(\"cardCanPlay WILD\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.WILD, UnoCardValue.ONE);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.THREE);\n UnoCardColour wildColour = UnoCardColour.BLUE;\n boolean result = utils.cardCanPlay(cardSelection, drawCard, wildColour);\n assertEquals(true, result);\n }", "public static SoundPlayer playerFromResource(String filename) {\n\t\tif (currentlyPlaying >= maxSounds)\n\t\t\treturn null;\n\t\t\n\t\ttry {\n\t\t\tURL resource = SoundPlayer.class.getResource(filename);\n\t\t\tif (resource == null || resource.toURI() == null || resource.toURI().getPath() == null)\n\t\t\t\treturn null;\n\t\t\t\n\t\t\tSoundPlayer player = new SoundPlayer(resource.toURI());\n\t\t\t++currentlyPlaying;\n\t\t\treturn player;\n\t\t} catch (URISyntaxException e) {\n\t\t\treturn null;\n\t\t}\n\t}", "public void action(ActionCard card) {\n if (!myTurn()) {\n return;\n }\n if (handPile.contains(card)) {\n specialAction = card.performAction(this);\n while (specialAction.getDraw() > 0) {\n this.draw(1);\n specialAction.reduceDraw();\n }\n // CardAction cardAct = new CardAction(card, \"Play: \" + card.getName());\n // history.add(cardAct);\n }\n }", "protected void playDispenseSound(IBlockSource p_82485_1_)\n {\n p_82485_1_.getWorld().playAuxSFX(1000, p_82485_1_.getXInt(), p_82485_1_.getYInt(), p_82485_1_.getZInt(), 0);\n }", "public void play(PlasterClash p) {\n p.currentPlayer().getHand().remove(this);\n }", "public abstract void play();", "public abstract void play();", "@Override\n public Card cardToPlay(TurnState state, CardSet hand) {\n //Causes the player to spend a certain amount of time for each card\n double currentTime = System.currentTimeMillis();\n Card card = underlyingPlayer.cardToPlay(state, hand);\n try {\n long totalTime;\n if ((totalTime = (minTime - ((long) System.currentTimeMillis() - (long) currentTime))) > 0) {\n Thread.sleep(totalTime);\n }\n } catch (InterruptedException e) {\n }\n return card;\n }", "public void play() {\n System.out.println(\"Player \" + this.name + \" started to play...\");\n System.out.println(\"Current balance: \" + getTotalAsset());\n\n // roll a dice to move\n int steps = rollDice();\n System.out.println(\"Player diced \" + steps);\n\n // move\n move(steps);\n Land land = Map.getLandbyIndex(position);\n\n // land triggered purchase or opportunity events\n land.trigger();\n\n System.out.println(\"Player \" + this.name + \"has finished.\");\n }", "@Override\n\t\tpublic void onLoaded(String arg0) {\n\t\t\t\tplayer.play();\n\t\t}", "public void play() {\n field.draw();\n userTurn();\n if(! field.isFull()) {\n computerTurn();\n }\n }", "@Override\n public void playOneRound (Player player) {\n this.executeActions(this.actionChoosed(player), player);\n }", "public static play() {\n\t\t\n\t}", "public void printPoliticCards(Player player);", "@Override\n public Card chooseCardtoPlay() {\n assert(card1 != null && card2 != null);\n if (card1.value == Card.PRINCESS) return playCard2();\n if (card2.value == Card.PRINCESS) return playCard1();\n return rand.nextBoolean() ? playCard1() : playCard2();\n }", "public static void charge_sound() {\n\t\tm_player_charge.start();\n\t\tm_player_charge.setMediaTime(new Time(0));\n\t}", "private void playSound() {\n if (isFlashOn) {\n mp = MediaPlayer.create(this, R.raw.light_switch_off);\n } else {\n mp = MediaPlayer.create(this, R.raw.light_switch_on);\n }\n mp.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {\n\n @Override\n public void onCompletion(MediaPlayer mp) {\n // TODO Auto-generated method stub\n mp.release();\n }\n });\n mp.start();\n }", "public void takePrimaryAction(Card card) {\n HashMap<Stat, Boolean> cardEffect = card.getPrimaryEffect();\n int difficult = card.getDifficult();\n applyCardEffect(cardEffect, difficult);\n\n if (card.isProjectWeek()) projectWeekAnxiety();\n\n }", "public Card playCard() {\n Card card = this.myCards[this.numCards - 1];\n this.myCards[this.numCards - 1] = null;\n this.numCards--;\n return card;\n }", "void play ();", "@Override\r\n public void play()\r\n {\n\r\n }", "public void playSoundGameWon() {\n\t\tcompletedGameSound.play();\n\t}", "public void play() { player.resume();}", "public void continueSound() {\n\t\tclip.start();\n\t}", "public void play(){\n\n gameRounds++;\n mRound = new Round(players);\n mRound.beginRound();\n\n }", "public void run() {\n\t\t try {\n\t\t Clip clip = AudioSystem.getClip();\n\t\t //AudioInputStream inputStream = AudioSystem.getAudioInputStream(\n\t\t //Main.class.getResourceAsStream(\"/path/to/sounds/\" + url));\n\t\t //clip.open(inputStream);\n\t\t clip.start(); \n\t\t } catch (Exception e) {\n\t\t System.err.println(e.getMessage());\n\t\t }\n\t\t }", "boolean play();", "public void DisplayWithOneCard() {\n\t\tplayers = new ArrayList<Player>();\n\t\tplayer1 = new Player(\"Nick\");\n\t\tplayer2 = new Player(\"Ausitn\");\n\t\tplayers.add(player1);\n\t\tplayers.add(player2);\n\t\tgame = new GameState();\n\t\tgame.initializeServer(players);\n\t\tRulesEngine.setColour(game, String.valueOf(Type.BLUE));\n\t\t\n\t\tgame.setTurn(0);\n\t\t\n\t\t\n\t\t//create cards to be added to player's hand and target's display\n\t\tCard redCard = new Card(Type.RED, 4);\n\t\t\n\t\t//Give one of the players a riposte card to play\n\t\tCard riposte = new Card(Type.ACTION, Card.RIPOSTE);\n\t\tgame.getAllPlayers().get(0).getHand().add(riposte);\n\t\t\n\t\t//Give target player a custom display\n\t\tgame.getDisplay(1).add(redCard);\n\t}", "public void playHitWall() {\r\n hitWall.play(soundFxVol);\r\n }", "public boolean playCard(Card card, Enemy enemy){\n if( isGameOver() )return false;\n if( card.isHasTarget() && !enemyController.hasEnemy(enemy) )return false;\n\n System.out.println(\"IN PLAYCARD METHOD\");\n boolean b = effectHandler.playCard( card , enemy);\n System.out.println( \"HAND CARDS : \");\n for( int i = 0 ; i < piles.getHandPile().getCards().size() ; i++ ){\n System.out.println( piles.getHandPile().getCards().get(i).getName() );\n }\n\n return b;\n }", "public void playRock(ActionEvent e) throws IOException {\n try {\n //System.out.println(\"Class play: \" + game.getClass().toString());\n getWinnerRPS(game.play(1));\n playerPlays = \"Player plays rock\";\n computerPlays = \"Computer plays \" + addRPSPlayed(game.getComputerPlays());\n myctr.setLabels();\n } catch(Exception n) {\n System.out.println(\"Game \\\"RockPaperScissors\\\" not initialized!\");\n }\n }", "public void play() {\r\n\t\tSystem.out.println(\"Playing Cricket with ball and bat\");\r\n\t}", "public void stealPlayerResource(Player victim) throws Exception {\n\t\t if(canDoStealPlayerResource(victim) == false) {\n\t\t\t throw new Exception(\"canDoStealPlayerResource() == false\");\n\t\t }\n\t\t resourceCardHand.addCard(victim.giveUpResourceCard());\n\t }", "public void play() {\r\n this.cardDeck = new JavaDeck();\r\n cardDeck.shuffle();\r\n dealerHand = new JavaHand(2);\r\n dealerHand.DiscardHand();\r\n addDealerCard();\r\n }", "public void play() {\n\t\ttry {\n\t\t\taudioInput = AudioSystem.getAudioInputStream(this.music);\n\t\t\tclip.open(audioInput);\n\t\t\tclip.start();\n\t\t} catch (UnsupportedAudioFileException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (LineUnavailableException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void play() {\n /** Memanggil File MP3 \"indonesiaraya.mp3\" */\n try {\n mp.prepare();\n } catch (IllegalStateException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n /** Menjalankan Audio */\n mp.start();\n\n /** Penanganan Ketika Suara Berakhir */\n mp.setOnCompletionListener(new OnCompletionListener() {\n @Override\n public void onCompletion(MediaPlayer mp) {\n stateAwal();\n }\n });\n }", "private void playSound(String sound) {\r\n try {\r\n BufferedInputStream soundFileStream = new BufferedInputStream(this\r\n .getClass().getResourceAsStream(sound));\r\n AudioInputStream audioInputStream = AudioSystem\r\n .getAudioInputStream(soundFileStream);\r\n AudioFormat audioFormat = audioInputStream.getFormat();\r\n DataLine.Info dataLineInfo = new DataLine.Info(Clip.class, audioFormat);\r\n Clip clip = (Clip) AudioSystem.getLine(dataLineInfo);\r\n clip.open(audioInputStream);\r\n clip.start();\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }", "private void playAudio(int winLose)\t\t\t\t\t\t\t\n {\n // win\n if(winLose == 1)\n {\n String path = \"src/winningSound.wav\";\n Media media = new Media(new File(path).toURI().toString());\n\n mediaPlayer = new MediaPlayer(media);\n mediaPlayer.setCycleCount(1);\n mediaPlayer.setAutoPlay(true);\n }\n // lose\n else\n {\n String path = \"src/loserSound.wav\";\n Media media = new Media(new File(path).toURI().toString());\n mediaPlayer = new MediaPlayer(media);\n mediaPlayer.setCycleCount(1);\n mediaPlayer.setAutoPlay(true);\n }\n }", "public void play() {\n try {\n mSessionBinder.play(mContext.getPackageName(), mCbStub);\n } catch (RemoteException e) {\n Log.wtf(TAG, \"Error calling play.\", e);\n }\n }", "@Override\n\tpublic void play() {\n\t\tGuitar.super.play();\n\t\tPiano.super.play();\n\t}" ]
[ "0.8530414", "0.6911832", "0.6850692", "0.68193793", "0.6788403", "0.6648909", "0.6409819", "0.63713765", "0.6245908", "0.6097065", "0.6043358", "0.5986052", "0.5968067", "0.5960509", "0.58825934", "0.5873875", "0.58692724", "0.5855021", "0.58454293", "0.5841722", "0.5762964", "0.57189065", "0.5677473", "0.5656877", "0.56490606", "0.56448835", "0.5618979", "0.5610369", "0.55844766", "0.558174", "0.5579577", "0.5563946", "0.5562633", "0.5559494", "0.55465585", "0.5542087", "0.5529466", "0.55164254", "0.5513413", "0.5511815", "0.54990476", "0.54921734", "0.54920685", "0.54919815", "0.5489761", "0.5485195", "0.54849166", "0.5484285", "0.54729766", "0.547163", "0.546274", "0.5451557", "0.5450413", "0.54501396", "0.5408801", "0.5408651", "0.5404904", "0.5404577", "0.5401193", "0.53967875", "0.53908867", "0.5384525", "0.53829277", "0.538217", "0.5380327", "0.53776586", "0.53776586", "0.53773135", "0.5376375", "0.5376199", "0.5371463", "0.5365685", "0.536444", "0.53469956", "0.5342537", "0.5341718", "0.5339779", "0.53385097", "0.5332798", "0.53273284", "0.5320433", "0.5318954", "0.53112197", "0.5309115", "0.53068864", "0.5299581", "0.5293699", "0.5292188", "0.529046", "0.5283607", "0.5271514", "0.52699125", "0.5265561", "0.5264873", "0.5262581", "0.52623373", "0.5258648", "0.5254661", "0.52514136", "0.52512014" ]
0.88526666
0
This method plays the monument card, awarding the player a victory point
void playMonumentCard();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void playMonumentCard() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void playCard() {\n\t\t\r\n\t}", "@Override\n\tpublic void playCard() {\n\t\t\n\t}", "public void playCard(int player, int card) {\n }", "public void play() {\n if (!isHungry()) {\n hunger += 2;\n mood += 2;\n fatigue += 3;\n\n if (!muted) {\n System.out.println(\"play\\t|\\tPlaying is fun!\");\n }\n }\n }", "void playMonopolyCard(String resource);", "public void hitButtonClicked()\r\n {\r\n Card hit = game.hit(\"Player\");\r\n playerCardList.get(nextPlayerIndex).setImage(hit.toGraphic());\r\n nextPlayerIndex++;\r\n if(game.checkLose())\r\n {\r\n playerLost();\r\n }\r\n }", "public void victory() {\n fieldInerface.setPleasedSmile();\n fieldInerface.timestop();\n int result = fieldInerface.timeGet();\n /*try {\n if (result < Integer.parseInt(best.getProperty(type))) {\n best.setProperty(type, Integer.toString(result));\n fieldInerface.makeChampionWindow(type);\n }\n } catch (NullPointerException e) {\n } catch (NumberFormatException e) {\n best.setProperty(type, Integer.toString(result));\n fieldInerface.makeChampionWindow(type);\n }*/\n\n gamestart = true; // new game isn't started yet!\n for (int j = 0; j < heightOfField; j++)\n for (int i = 0; i < widthOfField; i++)\n if (fieldManager.isCellMined(i, j))\n if (!fieldManager.isCellMarked(i, j)) {\n fieldInerface.putMarkToButton(i, j);\n fieldInerface.decrement();\n }\n gameover = true; // game is over!!\n }", "void playCurrentStationCard();", "@Override\n public void performAction(Player playerActingOn) {\n System.out.println(\"Perform action PlayerPlayingCard\");\n if (this.strengthBoost == 0)\n playerActingOn.gainInstantWin();\n playerActingOn.increaseStrengthGain(this.strengthBoost);\n }", "public abstract CardAction play(Player p);", "@Override\r\n\tpublic void playSoldierCard() {\n\t\t\r\n\t}", "public void printVictoryMessage() { //main playing method\r\n System.out.println(\"Congrats \" + name + \" you won!!!\");\r\n }", "public void hitCard() {\n if (this.state == GameState.ROUNDACTIVE) {\n Seat s = this.getSeat(seatPlaying);\n if (s.hasPlayer()) {\n Hand h = s.getPlayer().getHands().get(0);\n h.addCard(this.deck.dealCard());\n if (h.getIsBusted()) {\n this.activeHandStand();\n }\n }\n repaintAll();\n }\n }", "private void myTurn()\n\t{\n\t\t\n\t\tif (canPlay())\n\t\t{\n\t\t\tif (isTop())\n\t\t\t{\n\t\t\t\traise();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tequal();\n\t\t\t}\n\t\t}\n\t\ttable.nextPlayer();\n\t\t\n\t}", "public void play() {\n System.out.println(\"Player \" + this.name + \" started to play...\");\n System.out.println(\"Current balance: \" + getTotalAsset());\n\n // roll a dice to move\n int steps = rollDice();\n System.out.println(\"Player diced \" + steps);\n\n // move\n move(steps);\n Land land = Map.getLandbyIndex(position);\n\n // land triggered purchase or opportunity events\n land.trigger();\n\n System.out.println(\"Player \" + this.name + \"has finished.\");\n }", "public static void hitCorrect()\n\t{\n\t\tplayersCards.add(deck.deal());\n\t\tcurrentValue();\n\t\tuserCardImg[playersCards.size()-1].setIcon(new ImageIcon(Gameplay.class.getResource(getCard(playersCards.get(playersCards.size()-1)))));\n\t\tresume();\n\t\tif(calculateHand(playersCards)>21 || playersCards.size()==4 || calculateHand(playersCards)==0)\n\t\t{\n\t\t\troundEnd();\n\t\t}\n\t\t\n\t}", "private void humanTurn() \n {\n \n playTurn();\n }", "@Override\n public void play() {\n quest();\n if ((int) (Math.random() * 10) % 2 == 0) {\n won = true;\n System.out.println(\"You beat the last quest!\");\n } else {\n System.out.println(\"There are many more adventures for you, young warrior\");\n }\n }", "public void playRound(CuarentaGame game){\n Player human = game.getHumanPlayer();\n Player computer = game.getComputerPlayer();\n Player activePlayer;\n \n for(int i=0; i<10; i++){\n // For now, human player starts always. This isn't quite intended, but not important right now\n if(i%2==0)\n activePlayer = human;\n else\n activePlayer = computer;\n // choose a card to play\n \n // choose next actions\n \n // add points accordingly\n\n // check win condition\n\n }\n\n human.addPoints(calculatePointsFromDiscardPile(game.getHumanPlayer()));\n computer.addPoints(calculatePointsFromDiscardPile(game.getComputerPlayer()));\n }", "public void play() {\n\t\t// setting up\n\t\tdeck = new Deck();\n\t\tdeck.shuffle();\n\t\tint turn = 0;\n\t\tRandom rand = new Random();\n\t\tCardRank previousCardRank = null;\n\t\tboolean snapTime = false;\n\t\t\n\t\t// the turning card loop, which ends when two cards with the same value/rank are revealed\n\t\t// or when no cards are left in the deck\n\t\twhile (!snapTime) {\n\t\t\tString currentPlayer = (turn % 2 == 0) ? player1 : player2;\n\t\t\t\n\t\t\tint timeout = 1000 + rand.nextInt(1000);\n\t\t\t\n\t\t\ttry {\n\t\t\t\tTimeUnit.MILLISECONDS.sleep((long) timeout);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\tCard nextCard = deck.turnCard();\n\t\t\t\n\t\t\t// possible draw if no cards are left in the deck\n\t\t\tif (nextCard == null) {\n\t\t\t\tSystem.out.println(\"No cards left in the deck! It's a draw!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tSystem.out.println(currentPlayer + \" turns card \\'\" + nextCard + \"\\'\");\n\t\t\t\n\t\t\tturn++;\n\t\t\t\n\t\t\t// trigger the end of the turning card loop\n\t\t\tif (nextCard.getCardRank() == previousCardRank) {\n\t\t\t\tsnapTime = true;\n\t\t\t}\n\t\t\tpreviousCardRank = nextCard.getCardRank();\n\t\t}\n\t\t\n\t\t// simulate the time needed for both players to say \"SNAP!\"\n\t\tint snapTimeoutP1 = 500 + rand.nextInt(1000);\n\t\tint snapTimeoutP2 = 500 + rand.nextInt(1000);\n\t\t\n\t\t// rare draw situation, if the two players say \"SNAP!\" at the same time\n\t\tif (snapTimeoutP1 == snapTimeoutP2) {\n\t\t\ttry {\n\t\t\t\tTimeUnit.MILLISECONDS.sleep((long) snapTimeoutP1);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tSystem.out.println(\"SNAP! It's a draw!\");\n\t\t}\n\t\t// in most cases, a player will say \"SNAP!\" first, and they will be the winner\n\t\telse {\n\t\t\tString result = String.format(\"SNAP! %s is the winner!\", (snapTimeoutP1 < snapTimeoutP2) ? player1 : player2);\n\t\t\t\n\t\t\ttry {\n\t\t\t\tTimeUnit.MILLISECONDS.sleep((long) Math.min(snapTimeoutP1, snapTimeoutP2));\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tSystem.out.println(result);\n\t\t}\n\t}", "private void play(Poker pokerInstance, int action) {\n if (this.playing) {\n if (action == Poker.ACTION_BET) {\n actionBet(pokerInstance, 50);\n } else if (action == Poker.ACTION_FOLLOW) {\n actionFollow(pokerInstance);\n } else if (action == Poker.ACTION_CHECK) {\n actionCheck();\n } else if (action == Poker.ACTION_BED) {\n actionLeave();\n }\n }\n }", "@Override\n public void beHelpful() {\n this.playPiano();\n this.takeABow();\n }", "public void playTurn() {\r\n\r\n }", "public void playRound(){\n this.gameState = GameController.createGameState(this.game);\n \n // Verifica se o \n if(this.gameState.isEnded()){\n var winner = this.gameState.getPlayerQttCards() == 0 ? this.game.getComputer() : this.game.getPlayer();\n\n this.gameState.setWinner(winner);\n }\n else{\n \n // Mostrando o vira, as manilhas, a quantidade de cartas dos jogadores e as cartas do jogador\n this.view.displayGame(this.gameState);\n\n var playerCardChose = this.getPlayerCardChose();\n var computerCardChose = Utils.generateRandomNumber(getGameState().getComputerQttCards());\n\n try{\n var playerCard = this.game.getPlayer().playCard(playerCardChose);\n var computerCard = this.game.getComputer().playCard(computerCardChose);\n\n var winnerCard = this.verifyBiggerCard(playerCard, computerCard);\n\n // Verificando qual `Player` ganhou e se um ganhou\n\n var hasPlayerWon = winnerCard.equals(playerCard);\n var hasComputerWon = winnerCard.equals(computerCard);\n\n var turnedCard = this.getGameState().getTurnedCard();\n\n // Aqui caso o player tenha ganhado ele recebe a carta do computador e senão ele perde a carta para o computador\n if(hasPlayerWon){\n this.game.getPlayer().earnCard(computerCard);\n this.game.getComputer().loseCard(computerCard);\n }\n else if(hasComputerWon){\n this.game.getComputer().earnCard(playerCard);\n this.game.getPlayer().loseCard(playerCard);\n }\n \n // Na hora de mostrar o vencedor eu verifico se um player venceu, se sim eu mostro vitória ou derrota para o Player\n // Se não eu mostro empate\n \n if(hasComputerWon || hasPlayerWon){\n this.view.displayRoundWinner(turnedCard, playerCard, computerCard, hasPlayerWon);\n }\n else {\n this.view.displayRoundWinner(turnedCard, playerCard, computerCard);\n }\n\n }\n catch(Exception excp){\n this.view.displayMessageError(excp.getMessage());\n\n this.playRound();\n }\n }\n \n }", "@Override\r\n\tpublic void playRoadBuildingCard() {\n\t\t\r\n\t}", "private void playAI (int actualAI) {\n }", "public void playGame()\r\n\t{\r\n\t\tSystem.out.println(\"Welcome to BlackJack! \\n\");\r\n\t\t\r\n\t\t// Boolean value to tell evaluateWin() method when the final win evaluation must be made\r\n\t\tboolean finalCheck = false;\r\n\t\t\r\n\t\tcardDeck.getDeck();\r\n\t\t\r\n\t\tSystem.out.println(\"Dealing cards...\");\r\n\t\t\r\n\t\t// Each player gets 2 cards to start\r\n\t\tplayer1.hit( cardDeck.draw() );\r\n\t\tplayer1.hit( cardDeck.draw() );\r\n\t\tdealer.hit( cardDeck.draw() );\r\n\t\tdealer.hit( cardDeck.draw() );\r\n\t\t\r\n\t\t// displays current cards\r\n\t\tdisplayPlayerCards(PLAYER1_ID);\r\n\t\tdisplayPlayerCards(DEALER_ID);\r\n\t\t\r\n\t\t// checks for win\r\n\t\tevaluateWin(finalCheck);\r\n\t\t\r\n\t\t// begins player1 turns\r\n\t\tplayerTurns();\r\n\t\t\r\n\t\t// begins dealer turns\r\n\t\tdealerTurns();\r\n\t\t\r\n\t\t// instructs evaluateWin to make final victory check\r\n\t\tfinalCheck = true;\r\n\t\tevaluateWin(finalCheck);\r\n\t\t\r\n\t\t// Cleans up objects\r\n\t\tcardDeck.newDeck();\r\n\t\tplayer1.resetHand();\r\n\t\tdealer.resetHand();\r\n\t}", "public void play() {\n field.draw();\n userTurn();\n if(! field.isFull()) {\n computerTurn();\n }\n }", "private static void playGame() {\n CardDeck deck = new CardDeck();\n int dealer, player, hitOrStand = 1, score = 0;\n System.out.println(\"Goal: Beat the dealer without going over 21\");\n Scanner input = new Scanner(System.in);\n\n // Generate the dealer's card\n dealer = generateRandomNumber(16, 21); \n System.out.println(\"The Dealer scored: \" + dealer);\n System.out.println(\"\");\n \n\n // Keep playing while the player hasn't won or lost yet\n while (hitOrStand == 1 && score < 21 && score < dealer) {\n // Generate player's card\n player = generateRandomNumber(1, 10); \n System.out.println(\"Your card is worth \" + player);\n\n // Displays the picture of player's card\n String card = deck.drawCard(player);\n System.out.println(card);\n\n // Add player's card value to their score\n score = score + player;\n\n // Displays score and asks wether user wants to hit or stand\n if (score <= 21 && score < dealer) {\n System.out.println(\"Your score is \" + score);\n System.out.print(\"Another card? Hit=1 stand=0: \");\n hitOrStand = input.nextInt();\n System.out.println(\"\");\n }\n }\n \n // Display player won\n if (score > dealer && score <= 21 ) {\n System.out.println(\"You win!\");\n System.out.println(\"Your score is \" + score);\n System.out.println(\"The dealer score was \" + dealer);\n System.out.println(\"You were closer to 21 by \" + (score - dealer));\n\n // Display when player ties with dealer\n } else if (score == dealer) {\n System.out.println(\"Your score is \" + score);\n System.out.println(\"\");\n System.out.println(\"You tied!\");\n\n // Display if player lost\n } else if (score > 21) {\n System.out.println(\"Your score is \" + score);\n System.out.println(\"\");\n System.out.println(\"You lose!\");\n int over = score - 21;\n System.out.println(\"You were over 21 by \" + over);\n\n // Display if player lost\n } else {\n int difference;\n difference = dealer - score;\n System.out.println(\"Your score is \" + score);\n System.out.println(\"You lose!\");\n System.out.println(\"The dealer was closer to 21 than you by \" + difference);\n } \n }", "public PlayingCard(int points, String display) {\r\n\t\tthis.points = points;\r\n\t\tthis.display = display;\r\n\t}", "public void action(ActionCard card) {\n if (!myTurn()) {\n return;\n }\n if (handPile.contains(card)) {\n specialAction = card.performAction(this);\n while (specialAction.getDraw() > 0) {\n this.draw(1);\n specialAction.reduceDraw();\n }\n // CardAction cardAct = new CardAction(card, \"Play: \" + card.getName());\n // history.add(cardAct);\n }\n }", "public void ActonCard() {\n\t}", "public void play() {\n\t\t\r\n\t}", "public void play() {\n\t\tthis.initializeTurn();\n\t\twhile(this.getAction() > 0) {\n\t\t\tint choix = RandomInt.randomInt(1,6, this.rand);\n\t\t\tif(choix == 1) {\n\t\t\t\t//add building, preference of Machine\n\t\t\t\tint max = 0;\n\t\t\t\tint maxi = 0;\n\t\t\t\tboolean find = false;\n\t\t\t\tfor(int i = 0; i < this.getBoard().getFiveBuildingCards().size(); i++) {\n\t\t\t\t\tif(this.getBoard().getFiveBuildingCards().get(i) != null) {\n\t\t\t\t\t\tif(this.getBoard().getFiveBuildingCards().get(i) instanceof Machine) {\n\t\t\t\t\t\t\tmaxi = i;\n\t\t\t\t\t\t\tfind = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(this.getBoard().getFiveBuildingCards().get(i).getPoint() > max && !find) {\n\t\t\t\t\t\t\tmax = this.getBoard().getFiveBuildingCards().get(i).getPoint();\n\t\t\t\t\t\t\tmaxi = i;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.addBuilding(this.getBoard().getFiveBuildingCards().get(maxi));\n\t\t\t\tDesignString.printBorder(\"Ouverture d'un chantier\");\n\t\t\t}\n\t\t\telse if(choix == 2 || choix == 3) {\n\t\t\t\t//add worker, preference of the lowest one\n\t\t\t\tint min = 999;\n\t\t\t\tint mini = 0;\n\t\t\t\tfor(int i = 0; i < this.getBoard().getFiveWorkerCards().size(); i++) {\n\t\t\t\t\tif(this.getBoard().getFiveWorkerCards().get(i) != null) {\n\t\t\t\t\t\tif(this.getBoard().getFiveWorkerCards().get(i).getCost() < min && this.getBoard().getFiveWorkerCards().get(i).getCost() >= this.getCoin()) {\n\t\t\t\t\t\t\tmin = this.getBoard().getFiveWorkerCards().get(i).getCost();\n\t\t\t\t\t\t\tmini = i;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(this.getBoard().getFiveWorkerCards().get(mini).getCost() >= this.getCoin()) {\n\t\t\t\t\tDesignString.printBorder(\"Échange action vers écus\");\n\t\t\t\t\tthis.actionToCoins(RandomInt.randomInt(1,this.getAction(), this.rand));\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tDesignString.printBorder(\"Recrutement d'un ouvrier\");\n\t\t\t\t\tthis.hireWorker(this.getBoard().getFiveWorkerCards().get(mini));\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(choix == 4 || choix == 5 || choix == 6) {\n\t\t\t\t//worker to building. Preference to the started building. If it can't play, preference to action to coin\n\t\t\t\tIBuilding building = null;\n\t\t\t\tIWorker worker = null;\n\t\t\t\tif(this.getWorkerCards().size() > 0) {\n\t\t\t\t\tif(this.getStartedBuilding().size() > 0) {\n\t\t\t\t\t\tchoix = RandomInt.randomInt(0,2,this.rand);\n\t\t\t\t\t\tif(choix%2 == 0) {\n\t\t\t\t\t\t\tint max = 0;\n\t\t\t\t\t\t\tint maxi = 0;\n\t\t\t\t\t\t\tfor(int i = 0; i < this.getStartedBuilding().size(); i++) {\n\t\t\t\t\t\t\t\tif(this.getStartedBuilding().get(i) != null) {\n\t\t\t\t\t\t\t\t\tif(this.getStartedBuilding().get(i).getWorkerOn().size() > max) {\n\t\t\t\t\t\t\t\t\t\tmax = this.getStartedBuilding().get(i).getWorkerOn().size();\n\t\t\t\t\t\t\t\t\t\tmaxi = i;\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\tbuilding = this.getStartedBuilding().get(maxi);\n\n\t\t\t\t\t\t\tworker = this.getWorkerCards().get(RandomInt.randomInt(0,this.getWorkerCards().size()-1, this.rand));\n\n\t\t\t\t\t\t\twhile(worker != null && worker.getCost() > this.getCoin() && this.getAction() > 0) {\n\t\t\t\t\t\t\t\tworker = this.getWorkerCards().get(RandomInt.randomInt(0,this.getWorkerCards().size()-1, this.rand));\n\t\t\t\t\t\t\t\tchoix = RandomInt.randomInt(1,5,this.rand);\n\t\t\t\t\t\t\t\tif(choix == 1) {\n\t\t\t\t\t\t\t\t\tDesignString.printBorder(\"Échange action vers écus\");\n\t\t\t\t\t\t\t\t\tthis.actionToCoins(RandomInt.randomInt(1,this.getAction(), this.rand));\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\tif(this.getAction() >= this.getRemoveBuilding(building)) {\n\t\t\t\t\t\t\t\tDesignString.printBorder(\"Envoi d'un ouvrier sur un chantier\");\n\t\t\t\t\t\t\t\tthis.workerToBuilding(worker, building);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tbuilding = this.getBuildingsCards().get(RandomInt.randomInt(0,this.getBuildingsCards().size()-1, this.rand));\n\t\t\t\t\t\t\twhile(building == null) {\n\t\t\t\t\t\t\t\tbuilding = this.getBuildingsCards().get(RandomInt.randomInt(0,this.getBuildingsCards().size()-1, this.rand));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tworker = this.getWorkerCards().get(RandomInt.randomInt(0,this.getWorkerCards().size()-1, this.rand));\n\t\t\t\t\t\t\twhile(worker != null && worker.getCost() > this.getCoin() && this.getAction() > 0) {\n\t\t\t\t\t\t\t\tworker = this.getWorkerCards().get(RandomInt.randomInt(0,this.getWorkerCards().size()-1, this.rand));\n\t\t\t\t\t\t\t\tchoix = RandomInt.randomInt(1,5,this.rand);\n\t\t\t\t\t\t\t\tif(choix == 1) {\n\t\t\t\t\t\t\t\t\tDesignString.printBorder(\"Échange action vers écus\");\n\t\t\t\t\t\t\t\t\tthis.actionToCoins(RandomInt.randomInt(1,this.getAction(), this.rand));\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\tif(this.getAction() >= this.getRemoveBuilding(building)) {\n\t\t\t\t\t\t\t\tDesignString.printBorder(\"Envoi d'un ouvrier sur un chantier\");\n\t\t\t\t\t\t\t\tthis.workerToBuilding(worker, building);\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} else if(this.getBuildingsCards().size() > 0) {\n\t\t\t\t\t\tbuilding = this.getBuildingsCards().get(RandomInt.randomInt(0,this.getBuildingsCards().size()-1, this.rand));\n\t\t\t\t\t\twhile(building == null) {\n\t\t\t\t\t\t\tbuilding = this.getBuildingsCards().get(RandomInt.randomInt(0,this.getBuildingsCards().size()-1, this.rand));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tworker = this.getWorkerCards().get(RandomInt.randomInt(0,this.getWorkerCards().size()-1, this.rand));\n\t\t\t\t\t\twhile(worker != null && worker.getCost() > this.getCoin() && this.getAction() > 0) {\n\t\t\t\t\t\t\tworker = this.getWorkerCards().get(RandomInt.randomInt(0,this.getWorkerCards().size()-1, this.rand));\n\t\t\t\t\t\t\tchoix = RandomInt.randomInt(1,5,this.rand);\n\t\t\t\t\t\t\tif(choix == 1) {\n\t\t\t\t\t\t\t\tDesignString.printBorder(\"Échange action vers écus\");\n\t\t\t\t\t\t\t\tthis.actionToCoins(RandomInt.randomInt(1,this.getAction(), this.rand));\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(this.getAction() >= this.getRemoveBuilding(building)) {\n\t\t\t\t\t\t\tDesignString.printBorder(\"Envoi d'un ouvrier sur un chantier\");\n\t\t\t\t\t\t\tthis.workerToBuilding(worker, building);\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}", "public void printPoliticCards(Player player);", "public void printPermitCards(Player player);", "public void playCard(ActionCard card, Integer selectedPlayer)\n {\n System.out.println(\"gui: playCard: \" + card + \", selected: \" + selectedPlayer);\n // Guard against this\n if (!isTurn || this.played)\n {\n return;\n }\n \n if(card instanceof PrivateTip || card instanceof Snoop) \n {\n if(selectedPlayer == null) \n {\n JOptionPane.showMessageDialog(null, \"Please select \"\n + \"a player in the \"\n + \"Player Listing (Upper right) that is not yourself!\", \n \"Warning\", \n JOptionPane.ERROR_MESSAGE); \n return;\n }\n }\n\n if (card instanceof Suggestion)\n {\n this.played = true;\n // prompt for solution\n suggestionScreen = new AccusationScreen(this, true, (Suggestion)card);\n suggestionScreen.setVisible(true);\n }\n else\n {\n this.played = clientController.playActionCard(card, selectedPlayer);\n if(!this.played)\n {\n mainGameScreen.notifyUser(\"Play failed: To Play this card,\"\n + \" please select a CluePlayer from the 'Players' list,\"\n + \" then click on this card.\");\n }\n }\n\n }", "@Override\n\tpublic void cardInPlay() {\n\t\tIPlayer playedOn = this.game.getOtherPlayer();\n\t\tif(!playedOn.getFaction().equals(Faction.Cultist)){\n\t\t\tplayedOn.setFaction(Faction.UNAFFILIATED);\n\t\t}\n\t\tthis.setDiscard();\n\t}", "void playSoldierCard(int victimIndex, HexLocation location);", "public abstract void cardDrawn(int playerIndex);", "public void playCard(IPlayer owner){\n // Wont play card unless a player has it\n if(command == \"Move1\"){\n owner.Move(owner.getPlayerDir());\n }\n else if(command == \"Move2\"){\n for (Integer i=0; i < 2; i++) {\n owner.Move(owner.getPlayerDir());\n }\n }\n else if(command == \"Move3\"){\n for (Integer i=0; i < 3; i++) {\n owner.Move(owner.getPlayerDir());\n }\n }\n else if (command == \"MoveBack\"){\n owner.Move(dirCtrl.invertDirection(owner.getPlayerDir()));\n }\n else if(command == \"TurnRight\"){\n owner.Turn(TurnDirection.RIGHT);\n }\n else if(command == \"TurnLeft\"){\n owner.Turn(TurnDirection.LEFT);\n }\n else if(command == \"Turn180\"){\n owner.Turn(TurnDirection.BACKWARDS);\n }\n }", "@Override\r\n public boolean playTurn()\r\n {\n System.out.println(\"current bid = \" + currentBid);\r\n currentBid = players[currentPlayer].playHand(currentBid);\r\n\r\n System.out.println(\"Player bid = \" + currentBid);\r\n // Add hand played to discard pile\r\n discards.add(currentBid.getHand());\r\n // Offer all other players the chance to call cheat\r\n int callee = -1;\r\n {\r\n int[] calls = new int[MINPLAYERS];\r\n int i = 0;\r\n for (int j = 0; j < players.length; ++j)\r\n {\r\n // don't allow us to call cheat on ourselves\r\n if (currentPlayer == j)\r\n continue;\r\n Player p = players[j];\r\n if (p.callCheat(currentBid, currentPlayer))\r\n calls[i++] = j;\r\n }\r\n if (i > 0)\r\n callee = calls[rg.nextInt(i)];\r\n }\r\n\r\n if (callee != -1)\r\n {\r\n System.out.println(\"Player called cheat by Player \" + (callee+1));\r\n if (isCheat(currentBid)) //CHEAT CALLED CORRECTLY\r\n {\r\n for (Player p : players)\r\n p.broadcastCheat(currentPlayer, callee, true);\r\n //Give the discard pile of cards to currentPlayer who then has to play again\r\n players[currentPlayer].addHand(discards);\r\n System.out.println(\"Player cheats!\");\r\n System.out.println(\"Adding cards to player \"+\r\n (currentPlayer+1) + \" \" + players[currentPlayer]);\r\n }\r\n else //CHEAT CALLED INCORRECTLY\r\n {\r\n for (Player p : players)\r\n p.broadcastCheat(currentPlayer, callee, false);\r\n System.out.println(\"Player Honest\");\r\n currentPlayer = callee; // set the currentPlayer to callee\r\n // later on we'll increase this, so it's the person after\r\n // they who called's turn.\r\n players[currentPlayer].addHand(discards);\r\n System.out.println(\"Adding cards to player \"+\r\n (currentPlayer+1) + players[currentPlayer]);\r\n }\r\n //If cheat is called, current bid reset to an empty bid with rank two whatever\r\n //the outcome\r\n currentBid = new Bid();\r\n //Discards now reset to empty\r\n discards = new Hand();\r\n }\r\n else\r\n {\r\n System.out.println(\"No Cheat Called\");\r\n }\r\n /*\r\n Game bug fix:\r\n The design of the game, as given, was floored in conjuction with\r\n the required implementations of the strategies.\r\n A scenario can arise where one player has all the twos and the other\r\n has none, but it's their turn to play.\r\n The player with all the twos can consitently correctly call cheat on the\r\n player, as they have to claim to of laid a 2.\r\n\r\n This is easily fixed by moving the turn to the player after the one who\r\n just got called out\r\n */\r\n currentPlayer = (currentPlayer+1) % nosPlayers;\r\n return true;\r\n }", "public void play(){\n\t\t\n\t}", "@Override\n public void play(){\n \n // while neither player is dead\n while (continueGame()) {\n \n // both player and cpu draw a card and display the card\n player.play();\n System.out.printf(\"%s has drawn %s \\n\", player.getPlayerID(), \n player.getCard());\n cpu.play();\n System.out.printf(\"%s has drawn %s \\n\", cpu.getPlayerID(), \n cpu.getCard());\n \n // checks if the player wins the round\n if (winRound(player, cpu)) {\n // adds the cards to the gamedeck then the game deck to the\n // player deck\n winner(player, cpu, gameDeck);\n player.getWinningsPile().addCards(gameDeck.showCards().subList(0\n , gameDeck.getSize()));\n // empties the game deck\n gameDeck.showCards().clear();\n System.out.printf(\"%s wins round\\n\", player.getPlayerID());\n } else if (winRound(cpu, player)) { // if the cpu wins\n // adds the cards to the gamedeck then the game deck to the\n // cpu deck\n winner(cpu, player, gameDeck);\n cpu.getWinningsPile().addCards(gameDeck.showCards().subList(0, \n gameDeck.getSize()));\n // empties the game deck\n gameDeck.showCards().clear();\n System.out.println(\"CPU wins round\");\n } else {\n // if its a draw, check to see if either the cpu or player is\n // dying, if so, dont add the card to the gameDeck\n if (!(player.isDying())) {\n gameDeck.addCard(player.getCard());\n player.clearCard();\n }\n if (!(cpu.isDying())) {\n gameDeck.addCard(cpu.getCard());\n cpu.clearCard();\n }\n System.out.println(\"DRAW\");\n }\n // shows the current status of the game\n System.out.printf(\"%s's deck: %d winnings: %d \\n\", \n player.getPlayerID(), player.getDeck().getSize(), \n player.getWinningsPile().getSize());\n System.out.printf(\"CPU deck: %d winnings: %d \\n\", \n cpu.getDeck().getSize(), \n cpu.getWinningsPile().getSize());\n System.out.println(\"Press Enter to go to the next round\");\n in.nextLine();\n }\n //display the winner\n declareWinner();\n }", "public void goAdventuring() {\n\n game.createRandomMonster(4);\n if(RandomClass.getRandomTenPercent() == 5) {\n System.out.println(\"Your are walking down the road... Everything looks peaceful and calm.. Hit enter to continue!\");\n sc.nextLine();\n\n } else {\n game.battle();\n p.checkXp();\n }\n }", "public void play() {\r\n\t\tSystem.out.println(\"Playing Cricket with ball and bat\");\r\n\t}", "public void drawCard();", "public void act(Player player) {\n int roleIndex = -1;\n for (int i = 0; i < roles.size(); i++) {\n if (roles.get(i).getPlayer() == player) {\n roleIndex = i;\n break;\n }\n }\n boolean isOnCard = false;\n List<Role> onCardRoles = scene.getRoles();\n if (roleIndex == -1) {\n isOnCard = true;\n for (int i = 0; i < onCardRoles.size(); i++) {\n if (onCardRoles.get(i).getPlayer() == player) {\n roleIndex = i;\n break;\n }\n }\n }\n\n int diceRoll = random.nextInt(6) + 1;\n\n if (isOnCard) {\n if (diceRoll + player.getPracticeChips() >= scene.getBudget()) {\n shotsLeft--;\n System.out.println(\"Success! You completed the shot and got two credits.\");\n player.addCredits(2);\n } else {\n System.out.println(\"Oh no! You messed up the shot and got nothing.\");\n }\n } else {\n Deadwood.bank.payMoney(player, 1);\n if (diceRoll + player.getPracticeChips() >= scene.getBudget()) {\n shotsLeft--;\n System.out.println(\"Success! You completed the shot and got a credit and $1.\");\n player.addCredits(1);\n } else {\n System.out.println(\"Oh no! You messed up the shot. You still get $1.\");\n }\n }\n\n if (shotsLeft == 0)\n wrap();\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t\teHp -= player.Attack();\n\t\t\t\t\tpHp -= player.Attack();\n\t\t\t\t\tif (pHp <= 0){\n\t\t\t\t\t\t\n\t\t\t\t\t\t// losing message\n\t\t\t\t\t\tContext context = getApplicationContext();\n\t\t\t\t\t\tToast toast = Toast.makeText(context, \"Aww...You Lost\", Toast.LENGTH_SHORT);\n\t\t\t\t\t\ttoast.show();\n\t\t\t\t\t\tIntent resultIntent = new Intent();\n\t\t\t\t\t\tresultIntent.putExtra(\"data1\", player);\n\t\t\t\t\t\tsetResult(RESULT_OK, resultIntent);\n\t\t\t\t\t\tfinish();\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse if (pHp > 0 && eHp < 0){\n\t\t\t\t\t\t\n\t\t\t\t\t\t// winning message\n\t\t\t\t\t\tplayer.setCandies(player.getCandies() + 500000000);\n\t\t\t\t\t\tToast toast = Toast.makeText(context, \"You have now surpassed yourself, young grasshopper take 500000000 candies!\", Toast.LENGTH_SHORT);\n\t\t\t\t\t\ttoast.show();\n\t\t\t\t\t\tIntent resultIntent = new Intent();\n\t\t\t\t\t\tresultIntent.putExtra(\"data1\", player);\n\t\t\t\t\t\tsetResult(RESULT_OK, resultIntent);\n\t\t\t\t\t\tfinish();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// update Hp\n\t\t\t\t\tplayHp.setText(\"Player Hp: \" + String.valueOf(pHp));\n\t\t\t\t\tenemyHp.setText(\"Enemy Hp: \" + String.valueOf(eHp));\n\t\t\t}", "public void act() \r\n {\r\n key();\r\n win();\r\n fall();\r\n lunch();\r\n }", "public void surrender() {\n playerCash += playerBet / 2;\n\n //Play dealer's turn\n dealerTurn();\n\n //End the game and change the views\n restartGame();\n }", "@Override\n\tpublic void attiva(Player player) {\n\n\t}", "@Override\n public void playOneRound (Player player) {\n this.executeActions(this.actionChoosed(player), player);\n }", "public void notifyPlayerVictory(Player p);", "@Override\r\n\tpublic void showGetPrisonCardMessage(Player player) {\n\t\t\r\n\t}", "protected final void hit() throws InsufficientCardsException {\n hand.add(deck.deal());\n update();\n }", "public void playCard(int index) {\r\n\t\tCard c = deck.hand.get(index);\r\n\t\tif(c.isAction() && actions > 0 && access.gamePhase < 2) {\r\n\t\t\taccess.gamePhase = 1;\r\n\t\t\tif(!deck.play.contains(new Champion())) actions--;\r\n\t\t\tdeck.playCard(index);\r\n\t\t\tc.performAction();\r\n\t\t\tnotifyObservers();\r\n\t\t}\r\n\t\telse if(c.isTreasure() && access.gamePhase < 3) {\r\n\t\t\taccess.gamePhase = 1;\r\n\t\t\taddTreasure(c.getTreasure());\r\n\t\t\tdeck.playCard(index);\r\n\t\t\tc.performAction();\r\n\t\t\tnotifyObservers();\r\n\t\t}\r\n\t}", "@Override\n\tpublic void play() {\n\t\tSystem.out.println(\"We played Snokker today\");\n\t\t\n\t\t\n\t}", "public void clickEvent(int index){\n t.stop();\n Timer(15);\n if (cards.get(index).getTurned() == false) {\n if (wait == 1) {\n setTurned(c1, false);\n setTurned(c2, false);\n wait = 0;\n }\n setTurned(index, true);\n if (state == 2) {\n state = 1;\n c2 = index;\n if (cards.get(c1).getImgAnime().contains((cards.get(c2).getImgAnime()))) {\n if (activePlayer == 1) {\n if(cards.get(index).getNumber() == 1){\n p1Points += 3;\n }\n else {\n p1Points++;\n }\n points(activePlayer, p1Points);\n activePlayer = 1;\n changePlayer(activePlayer);\n } else {\n if(cards.get(index).getNumber() == 1){\n p2Points += 3;\n }\n else {\n p2Points++;\n }\n points(activePlayer, p2Points);\n activePlayer = 2;\n changePlayer(2);\n\n }\n checkFinished();\n } else {\n wait = 1;\n if (activePlayer == 1) {\n activePlayer = 2;\n changePlayer(activePlayer);\n } else {\n activePlayer = 1;\n changePlayer(activePlayer);\n }\n }\n } else {\n state = 2;\n c1 = index;\n }\n }\n }", "public void playPvC() {\n boolean computerFirst = true;\n playPvC(computerFirst);\n }", "public void play() \n { \n \n createRooms();\n createCharacters();\n createItem();\n printWelcome();\n player = new Player(\"player\");\n Boolean exam;\n exam = false;\n /* player.addItem(necklace_red);\n player.addItem(halberd);\n player.addItem(set_of_forks_and_knives);\n player.addItem(candelar);\n player.addItem(potion6HP);\n player.addItem(bedroomkey);*/\n \n // Step 1 : start in the poolroom //\n Boolean step1Finish;\n Boolean step2Finish;\n Boolean step3Finish;\n Boolean step4Finish;\n Boolean step5Finish;\n Boolean step6Finish;\n Boolean step7Finish;\n Boolean step8Finish;\n Boolean step9Finish;\n Boolean step10Finish;\n Boolean step11Finish;\n step1Finish = false;\n step2Finish = false;\n step3Finish = false;\n step4Finish = false;\n step5Finish = false;\n step6Finish = false;\n step7Finish = false;\n step8Finish = false;\n step9Finish = false;\n step10Finish = false;\n step11Finish = false;\n \n // All the characters are in the poolroom and the exit opens only after speak with all the characters //\n Boolean canSpeak; // player can speak with PNG\n Boolean speak_with_mr_Taylor, speak_with_ms_Taylor, speak_with_ms_Cunningham, speak_with_chambermaid, speak_with_bob_Taylor, speak_with_mr_Cunningham;\n Boolean speak_with_ms_Wellington, speak_with_valet, speak_with_caretaker, speak_with_mr_Wellington, speak_with_nina_Taylor;\n Boolean find_bob_Taylor;\n Boolean toys_not_front_of_door = null;\n Boolean firstEnter;\n firstEnter = true;\n \n canSpeak = false;\n speak_with_mr_Taylor = false;\n speak_with_ms_Taylor = false;\n speak_with_ms_Cunningham = false;\n speak_with_chambermaid = false;\n speak_with_bob_Taylor = false;\n speak_with_mr_Cunningham = false;\n speak_with_ms_Wellington = false;\n speak_with_valet = false;\n speak_with_caretaker = false;\n speak_with_mr_Wellington = false;\n speak_with_nina_Taylor = false;\n\n Boolean can_exam_canvas;\n can_exam_canvas = false;\n Boolean find_bedroom_key;\n find_bedroom_key = false;\n \n int safe_code, essai_code;\n safe_code = 9515;\n \n if (exam)\n {\n System.out.println(\"You are in the poolroom. \\n\"\n + \"Mr Taylor was founded by the Chambermaid this morning when she came to clean the poolroom. Her scream attracted everyone. \\n\"\n + \"You notice that it is missing a pool cue and you find a strange red necklace nearby the pool. \\n\"\n + \"You examine the dead body and you notice a circular wound with the same diameter of a pool cue and some splinters of wood at the bottom of the neck. \\n\"\n + \"Take advantage that everyone is here to question them.\");\n canSpeak = true;\n exam = false;\n System.out.println(\"There are a lot of people in this room. \\n\" \n +\" Nina Taylor the master daughter has long brown hair. Sha has a beautiful blue dress. \\n\"\n +\" Bob Taylor is the little son of Mr Taylor. He seems to be really nice and kind. But he is really sad. \\n\"\n +\" Emma the Chambermaid is an old woman. She has been working for the family for a very long time. She has a black dress and a white pinny.\\n\" \n +\" Mr Cunningham is a grey-haired man with a beige square suit and a lie. \\n\"\n +\" Mr Taylor had dark blond hair and a mustache. He had nice black tuxedo. \\n\"\n +\" Mr Wellinghton is a brown-haired man with a brown square suit and a lie. \\n\"\n +\" Ms Cunnigham is a grey-blond-haired woman with a pink dress. \\n\"\n +\" Ms Taylor seems to be really sad. Sha has dark-brown hair and a long claret dress. \\n\"\n +\" Ms Wellinghton is a redhead-haired woman with a long light green dress. \\n \"\n +\" Alfred the Valet has curly blond hair. He seems to be bother. \\n\"\n +\" Sam the caretaker is a black-haired black man. \");\n }\n if (speak_with_mr_Taylor && speak_with_ms_Taylor && speak_with_ms_Cunningham && speak_with_chambermaid && speak_with_bob_Taylor && speak_with_mr_Cunningham\n && speak_with_ms_Wellington && speak_with_valet && speak_with_caretaker && speak_with_mr_Wellington && speak_with_nina_Taylor && exam)\n {\n canSpeak = false;\n step1Finish = true;\n poolroom.modifyExit(\"east\");\n speak_with_mr_Taylor = false;\n speak_with_ms_Taylor = false;\n speak_with_ms_Cunningham = false;\n speak_with_chambermaid = false;\n speak_with_bob_Taylor = false;\n speak_with_mr_Cunningham = false;\n speak_with_ms_Wellington = false;\n speak_with_valet = false;\n speak_with_caretaker = false;\n speak_with_mr_Wellington = false;\n speak_with_nina_Taylor = false;\n }\n\n // Step 2 : banqueting hall //\n if (step1Finish)\n {\n bob_Taylor.setRoom(cellar);\n nina_Taylor.setRoom(banquetinghall);\n ms_Cunningham.setRoom(dancingroom);\n if (currentRoom == banquetinghall)\n {\n if (firstEnter)\n { \n toys_not_front_of_door = false; //false = toys front of the door // true = toys not front of the door\n find_bob_Taylor = false;\n System.out.println(\" When you opened the poolroom door, you shut on a toy so you lose one HealthPoint\");\n player.setHP(player.getHP() - 1);\n firstEnter = false;\n }\n if (exam)\n {\n System.out.println(\"You cannot open the dancing room door now because there are a lot of toys. \\n\"\n + \"Nina Taylor is next to the toys and you can speak with her. \");\n canSpeak = true;\n exam = false;\n }\n if (speak_with_nina_Taylor)\n {\n nina_Taylor.setText(\"These are my brother toys. Find him to tidy his toys\");\n speak_with_nina_Taylor = false;\n canSpeak = false;\n }\n }\n else if (currentRoom == hall)\n {\n // Step 2 bis : Hall //\n if (exam)\n {\n System.out.println(\" You are in the hall but there is nobody here. \");\n exam = false;\n }\n }\n else if (currentRoom == poolroom)\n {\n if (exam)\n {\n System.out.println(\"You are in the poolroom. Mr Taylor's body was removed. All the peopple are gone. \\n\"\n + \"You do not want to stay in this room. The atmosphere has become bad. You want to leave.\");\n exam = false;\n }\n }\n else if (currentRoom == kitchen)\n {\n if (exam)\n {\n System.out.println(\"This is the kitchen, Bob Taylor is not here. \\n\"\n + \"A set of forks and knives is in one of the cupboards of the kitchen.\");\n exam = false;\n // Recupère arme\n }\n }\n else if (currentRoom == cellar)\n {\n if (exam)\n {\n System.out.println(\"You found Bob Taylor in the back of the cellar\");\n find_bob_Taylor = true;\n exam = false;\n canSpeak = true;\n }\n if (speak_with_bob_Taylor)\n {\n System.out.println(\"You convince Bob to tidy up his toys.\");\n toys_not_front_of_door = true;\n canSpeak = false;\n speak_with_bob_Taylor = false;\n }\n if (toys_not_front_of_door) \n {\n banquetinghall.modifyExit(\"south\");\n step2Finish = true;\n }\n }\n if (step2Finish)\n {\n if (currentRoom == dancingroom)\n {\n if (firstEnter)\n {\n if (exam)\n {\n System.out.println(\"You are in an extraordinary dancing room. You perceive a gramophone on a commode. You see a beautiful candlestick and a gramophone. \\n\"\n + \"Strangely here is no disk on the gramophone. You see Ms Cunningham beside it. She seems to want to talk with you.\");\n exam = false;\n canSpeak = true;\n }\n if (speak_with_ms_Cunningham)\n {\n ms_Cunningham.setText(\"Oh, good morning ! I am happy to see you. Unlike the dark atmosphere of the mansion it is a beautiful weather outside. \\n\"\n + \"I hope your investigation is progressing well. I am scared that the murderer is still at liberty. I cannot sleep properly since the night of the murder. Ah ! I know, you are going to dance with me. It will make me think of something other than this dark situation. \\n\"\n + \"Sorry I will walk on your feet. Do I hurt you not too much ? I can be very clumsy.Oh, good morning ! I am happy to see you. Unlike the dark atmosphere of the mansion it is a beautiful weather outside. \\n\"\n + \"I hope your investigation is progressing well. I am scared that the murderer is still at liberty. I cannot sleep properly since the night of the murder. Ah ! I know, you are going to dance with me. It will make me think of something other than this dark situation. \\n\"\n + \"Sorry I will walk on your feet. Do I hurt you not too much ? I can be very clumsy.\");\n System.out.println(\"You spoke and danced a lot of time with Ms Cunningham. Then you are very tired so you lose one healthpoint\");\n player.setHP(player.getHP() - 1);\n canSpeak = false;\n speak_with_ms_Cunningham = false;\n }\n firstEnter = false;\n } \n if (exam)\n {\n {\n System.out.println(\"You are in an extraordinary dancing room. You perceive a gramophone on a commode. You see a beautiful candlestick and a gramophone. \\n\"\n + \"Strangely here is no disk on the gramophone. You see Ms Cunningham beside it.\");\n exam = false;\n canSpeak = true; \n }\n if (speak_with_ms_Cunningham)\n {\n ms_Cunningham.setText(\"Thank you. I feel better thanks to you.\");\n canSpeak = false;\n speak_with_ms_Cunningham = false;\n }\n }\n }\n else if (currentRoom == livingroom)\n {\n exam = false;\n System.out.println(\"You ride the last step and arrive in the living room. A little green ghost appears in the room. He seems not to be kind. \");\n if (ghost.getHP() <=0) \n {\n livingroom.modifyExit(\"north\");\n livingroom.modifyExit(\"west\");\n exam = true;\n if (exam)\n {\n System.out.println(\"There is no useful object and there is nobody here. \"); \n step3Finish = true;\n }\n }\n }\n \n if (step3Finish)\n {\n if (currentRoom == library)\n {\n if (exam)\n {\n System.out.println(\" A library with a lot of books is behind the door you just pushed. \\n\"\n + \"You see a big painting which depicts the same library where you are. There is just a difference between them. \\n\"\n + \"On the painting, a gramophone is pictured on a sideboard. The gramophone on the painting curiously looks like the gramophone in the dancing room. \\n\"\n + \"When you inspect the sideboard on the real library you see some wear marks as if an object was previously placed on it. \\n\"\n + \"You meet the chambermaid wanting to leave the library. She seems to want to tell you something but do not dare to approach you.\");\n canSpeak = true;\n exam = false;\n }\n if (speak_with_chambermaid)\n {\n chambermaid.setText(\"I saw Nina Taylor go to the gardener hut some nights. I do not know what she is doing there. \");\n canSpeak = false;\n speak_with_chambermaid = false;\n \n }\n }\n \n else if (currentRoom == corridor)\n {\n System.out.println(\"There is a statut with a weapon in this corridor. You can take it weapon if you want. \");\n // recupere arme\n Boolean fight; // this variable will be initialize with the fight\n if (fight)\n {\n if (exam)\n {\n System.out.println(\" You are in a corridor. You see four doors. Only two are opened.\");\n exam = false;\n step4Finish = true;\n }\n }\n }\n if (step4Finish)\n {\n if (currentRoom == bathroom)\n {\n if (exam)\n {\n System.out.println(\" You enter in the bathroom and you see the chambermaid treating the valet's arm. \\n\"\n + \" The wound looks like a rodent bite but it is much bigger than a rat. It is strange because Mr Taylor was allergic to animals. \\n\"\n + \"You notice that there is a potion on the furniture next to the chambermaid. She notices that you are injured. \\n\"\n + \"She signals to you that you can take it. \"); \n //permet de prendre la potion\n exam = false;\n }\n //ajout potion possible pour le joueur\n\n }\n if (currentRoom == guestbedroom)\n {\n if (exam)\n {\n System.out.println(\" You are in the guest bedroom. Today this bedroom is Mr&Ms Cunnigham's bedroom. Mr Cunnigham is in his bedrrom.\");\n mr_Cunningham.setRoom(guestbedroom);\n ms_Cunningham.setText(\"It is strange, last time this canvas was not here.\");\n can_exam_canvas = true;\n if (exam && can_exam_canvas)\n {\n System.out.println(\" You find a key behind the canvas and you take it.\");\n find_bedroom_key = true;\n player.addItem(bedroomkey);\n } \n exam = false;\n }\n }\n \n if (step5Finish)\n {\n if (find_bedroom_key)\n {\n corridor.modifyExit(\"south\");\n }\n if (currentRoom == bedroom)\n {\n if (exam)\n {\n System.out.println(\"You are in the host bedroom. You see a big safe with a four number code. Ms Taylor is in her room.\");\n ms_Taylor.setText(\"Oh no ! I am forgetting the number code ! Please, ask to my daughter, my guests and my employees. I gave to several of them a piece of this code. \");\n \n if (speak_with_ms_Taylor)\n {\n nina_Taylor.setRoom(dancingroom);\n nina_Taylor.setText(\"Bob Taylor has fallen into a 10-meter deep well and is trying to pull it up. \\n \" +\n \"Each day it rises 3 meters and slides 2 meters during the night.\\n\" +\n \"How many days will it take to get to the surface?\");\n ms_Wellington.setRoom(library);\n ms_Wellington.setText(\"In a girl group\\n\" +\n \" 70% wear a blue sweater\\n\" +\n \" 75% wear blue pants\\n\" +\n \" 85% wear a blue hat\\n\" +\n \" 85% wear a blue coat\\n\" +\n \"What is the minimum percentage of girls wearing only blue clothes?\");\n \n bob_Taylor.setRoom(library);\n bob_Taylor.setText(\"I saw my sister and my father arguing before his death.\");\n \n mr_Cunningham.setRoom(poolroom);\n mr_Cunningham.setText(\"David is 10 years old and his younger brother is half his age. \\n\" +\n \"When David will be 10 times older, how old will Franck be?\");\n \n \n }\n }\n }\n if (step6Finish)\n {\n if (currentRoom == bedroom)\n {\n System.out.println(\"Did you find the safe code? \");\n // enter the safe code -- creation int essai_code\n if (essai_code == safe_code)\n {\n System.out.println(\"You find the good number code, the safe door is opened. \\n \" +\n \"The safe contains a disk, a lot of money and a biscuits box.\");\n }\n }\n if (currentRoom == dancingroom\n // && il doit avoir le dique dans son inventaire\n )\n {\n ms_Taylor.setRoom(dancingroom);\n ms_Taylor.setText(\"What does this object do here, it should be in the library\");\n // player has to take the gramophone in his inventory\n }\n if (currentRoom == library \n // && il doit avoir le disque et le gramophone dans son inventaire\n )\n {\n System.out.println(\"You put the gramophone at its place and you insert the disk on it. \\n\"+\n \" You are hearing a loud noise and a door is appearing.\"); \n library.modifyExit(\"north\"); \n }\n if (step7Finish)\n {\n if (currentRoom == laboratory)\n {\n System.out.println(\"When you opened the door, a little green ghost appears and attacked you.\");\n if(fight_win)\n {\n System.out.println(\"The skeleton is dead. You see that one of its bone is strange. This bone seems to be carved as a key\");\n // joueur doit ramasser la clef\n \n if (exam)\n {\n System.out.println(\" You look and the desk and you find some construction plans. It seems that Mr Taylor wanted to dig very deeply at east from the garden. It is the same place than the gardener hut. \");\n }\n corridor.modifyExit(\"up\");\n System.out.println(\"You unblock a new room. A trapdoor appears in the corridor\");\n }\n }\n if (currentRoom == attic)\n {\n if (exam)\n {\n System.out.println(\" You finally discover the attic. It is dark because there is only one window lighting the room. \\n\"\n + \" You decide to look out the window and discover a huge garden hidden by the trees when guests arrive by the entrance. \");\n hall.modifyExit(\"north\");\n }\n }\n if (step8Finish)\n {\n if (currentRoom == garden)\n {\n if (exam)\n {\n System.out.println(\" You see a well at the north but there is a steel grid locked by a padlock.\\n\"\n + \"There is an apple tree next to it with only one apple on the tree. You can maybe pick up the apple and eat it now or later.\\n\"\n + \"\");\n }\n }\n }\n \n \n }\n \n \n \n \n /*player.addItem(necklace_red);\n player.addItem(necklace_red);\n player.addItem(necklace_red);*/\n /* \n \n \n // Enter the main command loop. Here we repeatedly read commands and\n // execute them until the game is over.\n \n boolean finished = false;\n while (! finished) {\n Command command = parser.getCommand();\n finished = processCommand(command);\n }\n System.out.println(\"Thank you for playing. Good bye.\");\n */\n }\n }\n }\n }\n }\n }\n \n }", "private void startGame() {\n betOptionPane();\n this.computerPaquetView.setShowJustOneCard(true);\n blackjackController.startNewGame(this);\n }", "void play();", "private PlayingCard chooseCard(HeartsGraphics g){\t\t\n\t\tHearts.setCurrentPlayer(this);\n\t\t\n\t\tif(number != PLAYER_ONE){\n\t\t\t// A.I. code\n\t\t\tint index;\n\t\t\t\n\t\t\tRandom r = new Random();\n\t\t\tindex = r.nextInt(hand.size());\t\t\t\n\t\t\t\n\t\t\treturn hand.get(index);\t\t\t\n\t\t} else {\n\t\t\treturn getCard(g);\n\t\t}\t\t\n\t}", "@Override\n public void onClick(View v) {\n if(mSoundStatus.equals(Constants.ON)) mPutPieceSound.start();\n\n // Creating a new game and reinitializing UI components:\n mGame = new Game();\n setupGrid();\n mBlackCounter.setText(\"2\");\n mWhiteCounter.setText(\"2\");\n startGame();\n\n // Dismiss dialog:\n verificationDialog.dismiss();\n\n // Showing a promo ad by chance:\n showPromoAdByChance();\n\n }", "public void Play();", "public void yelowCardA(View v) {\n yelowCardsA = yelowCardsA + 1;\n displayYelowCardA(yelowCardsA);\n }", "@Override\n\tpublic void OnAttackCommand() {\n\t\tsuper.OnAttackCommand();\n\t\tSoundManage.playSound(atkSound1);\n\t}", "@Override\r\n\tpublic void playMonopolyCard(ResourceType resource) {\n\t\t\r\n\t}", "public void currentPlayerDrawCard() {\n Player currentPlayer = turnManager.currentPlayer();\n UnoCard newCard = getNextCard();\n currentPlayer.obtainCard(newCard);\n\n for (GameListener gameListener : gameListeners) {\n gameListener.cardDrawn();\n }\n\t}", "public void playAI() {\r\n // An item has been added to the ticket. Fire an event and let everyone know.\r\n System.out.println(\"You're going to lose foolish human!\");\r\n }", "void win() {\n\t\t_money += _bet * 2;\n\t\t_wins++;\n\t\tclearHand();\n\t\t_bet = 0;\n\t}", "private int playerTurn() {\n List<Card> drawnCards = new LinkedList<>();\n boolean exit = false;\n\n // Ask the player to draw more cards\n do {\n // Draw cards\n Card drawn = drawCard();\n drawnCards.add(drawn);\n Ui.cls();\n Ui.println(\"You drew a \" + drawn.getName());\n Ui.pause();\n\n // Shows current cards and drawn cards\n Ui.cls();\n Ui.println(getHeader());\n Ui.println();\n Ui.print(\"Cards:\");\n // Draw every card\n for (int i = 0; i < drawnCards.size(); i++) {\n Ui.print(\" \" + drawnCards.get(i));\n if (i + 1 < drawnCards.size()) {\n Ui.print(\",\");\n }\n }\n // Value of cards\n Ui.println(\"Value: \" + highestPossibleValue(drawnCards));\n Ui.println();\n\n // Check for too much points\n if (highestPossibleValue(drawnCards) > 21) {\n Ui.println(\"Unfortunately you got more than 21 points, resulting in a total of 0 points!\");\n Ui.pause();\n break;\n } else {\n Ui.println(\"Would you like to draw another card?\");\n Ui.println(\"1) Take another card\");\n Ui.println(\"2) Stop taking cards\");\n }\n\n // Input\n boolean quitInput = false;\n while (!quitInput) {\n int menuChoice = Ui.getValidInt();\n\n switch (menuChoice) {\n case 1:\n quitInput = true;\n break;\n case 2:\n exit = true;\n quitInput = true;\n break;\n default:\n break;\n }\n }\n\n } while (!exit);\n\n if (highestPossibleValue(drawnCards) > 21) {\n return 0;\n } else {\n return highestPossibleValue(drawnCards);\n }\n }", "@Override\n\tpublic Entity interact(Player p) {\n\t\tif(p.getCarryOns() == null) {\n\t\t\tp.setCarryOns(this);\n\t\t\tp.getDungeon().removeEntity(this);\n\t\t\tSystem.out.println(\"CARRIED KEY WITH ID = \" +this.id);\n\t\t\tString musicFile = \"./sounds/Key.wav\";\n\t\t\tMedia sound = new Media(new File(musicFile).toURI().toString());\n\t\t\tMediaPlayer mediaPlayer = new MediaPlayer(sound);\n\t\t\tmediaPlayer.play();\n\t\t\treturn this;\n\t\t} else {\n\t\t\tSystem.out.println(\"Cannot pick up key, already carrying something\");\n\t\t\treturn null;\n\t\t}\n\t}", "public void howToPlay() {\r\n // An item has been added to the ticket. Fire an event and let everyone know.\r\n System.out.println(\"Step 1: Have no life. \\nStep 2: Deal cards\\nStep 3: Cry yourself to sleep.\");\r\n }", "private void play(Player p){\r\n\t\tSystem.out.println(\"What pet would you like to play with?\");\r\n\t\tint c = 1;\r\n\t\tArrayList<Toy> toys = p.getToys();\r\n\r\n\t\tfor(Pet pet : p.getPets()){\r\n\t\t\tSystem.out.println(c + \". \" + pet.getPetname());\r\n\t\t\tc++;\r\n\t\t}\r\n\t\tint selectedpetindex = getNumber(1, p.getPets().size());\r\n\t\tPet selectedpet = p.getPets().get(selectedpetindex - 1);\r\n\t\tSystem.out.println(\"What toy do you want to use to play with \" + selectedpet.getPetname());\r\n\r\n\t\tc = 1;\r\n\t\tfor(Toy t : toys){\r\n\t\t\tSystem.out.println(c + \". \" + t.getName());\r\n\t\t\tc++;\r\n\t\t}\r\n\t\tint toyindex = getNumber(1, toys.size());\r\n\t\tToy selectedtoy = toys.get(toyindex);\r\n\r\n\t\tselectedpet.play(selectedtoy);\r\n\t\tselectedtoy.setDurability(selectedtoy.getDurability() - selectedpet.getRoughness());\r\n\r\n\t\tif(selectedtoy.getDurability() < 1){\r\n\t\t\ttoys.remove(toyindex);\r\n\t\t}else{\r\n\t\t\ttoys.set(toyindex, selectedtoy);\r\n\t\t}\r\n\r\n\t\tp.setToys(toys);\r\n\t\tp.setActions(p.getActions() - 1);\r\n\t}", "void makePlay(int player) {\n }", "public Player switchPlayer(){\n Player player = getGame().getCurrentPlayer();\n\n List<Card> cards = new ArrayList<>();\n\n for(Card card: getGame().getCards()){\n if(card.rule.isValid(getGame().getDices())){\n cards.add(card);\n }\n }\n\n //get the best card\n if(!cards.isEmpty()){\n Card card = takeTheBestCard(cards);\n\n //add it to the player\n player.getCardsWon().add(card);\n getGame().getCards().remove(card);\n\n System.out.println(player.getName() + \" won \" + card.getExplaination());\n getGame().addAction(new Action(player.getName() + \" won \" + card.getExplaination()));\n }\n\n if(getGame().getCards().isEmpty()){\n game.setStatus(Game.GameStatus.COMPLETED);\n getGame().addAction(new Action(bestPlayer().getName() + \" WON THE GAME!!!\"));\n }\n //turn\n getGame().setCountOfTrialForPlayer(0);\n\n game.setIndexOfCurrentPlayer(game.getIndexOfCurrentPlayer()+1);\n\n if(game.getIndexOfCurrentPlayer() == getGame().getPlayers().size()){\n game.setIndexOfCurrentPlayer(0);\n }\n\n game.setCountOfTrialForPlayer(0);\n game.setDices(new ArrayList<>());\n\n return getGame().getCurrentPlayer();\n }", "public void playHitWall() {\r\n hitWall.play(soundFxVol);\r\n }", "public void play() {\r\n this.cardDeck = new JavaDeck();\r\n cardDeck.shuffle();\r\n dealerHand = new JavaHand(2);\r\n dealerHand.DiscardHand();\r\n addDealerCard();\r\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tsp12.play(sound_id12 , 1.0F, 1.0F, 0, 0, 1.0F);\n\t\t\t}", "public String action() { \n return \"Player capped.\";\n }", "private void chance(Player currentPlayer) {\n Random rand = new Random();\n int randomNum = rand.nextInt((3 - 1) + 1) + 1;\n\n if(randomNum == 1){\n convertTextToSpeech(\"Advance to Bond Street\");\n currentPlayer.setCurrentPosition(34);\n }\n if(randomNum == 2){\n convertTextToSpeech(\"Unpaid charges. Go to jail\");\n setJail(currentPlayer);\n }\n if(randomNum == 3){\n convertTextToSpeech(\"Build a rooftop swimming pool on your apartment, pay 300\");\n if(m_manageFunds) {\n currentPlayer.subtractMoney(300);\n funds.setText(String.valueOf(currentPlayer.getMoney()));\n m_freeParking += 300;\n Log.d(\"chance subtract 300\", currentPlayer.getName() +\n String.valueOf(currentPlayer.getMoney()));\n Log.d(\"chance free parking\", String.valueOf(m_freeParking));\n }\n }\n }", "private void play() {\n\t\tParcel pc = Parcel.obtain();\n\t\tParcel pc_reply = Parcel.obtain();\n\t\ttry {\n\t\t\tSystem.out.println(\"DEBUG>>>pc\" + pc.toString());\n\t\t\tSystem.out.println(\"DEBUG>>>pc_replay\" + pc_reply.toString());\n\t\t\tib.transact(1, pc, pc_reply, 0);\n\t\t} catch (RemoteException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "void playMatch() {\n while (!gameInformation.checkIfSomeoneWonGame() && gameInformation.roundsPlayed() < 3) {\n gameInformation.setMovesToZeroAfterSmallMatch();\n playSmallMatch();\n }\n String winner = gameInformation.getWinner();\n if(winner.equals(\"DRAW!\")){\n System.out.println(messageProvider.provideMessage(\"draw\"));\n }else {\n System.out.println(messageProvider.provideMessage(\"winner\")+\" \"+winner+\"!\");\n }\n }", "private void playThisCard(UnoCard clickedCard) throws NotYourTurnException, InvalidMoveException {\n\t\t// Check player's turn\n\t\tif (!isHisTurn(clickedCard)) {\n\t\t\tthrow new NotYourTurnException();\n\t\t} else {\n\n\t\t\t// Card validation\n\t\t\tif (isValidMove(clickedCard)) {\n\n\t\t\t\tplayedCards().add(clickedCard);\n\n\t\t\t\tremovePlayedCard(clickedCard);\n\n\t\t\t\t// function cards ??\n if (clickedCard instanceof ActionCard) {\n performAction(clickedCard);\n\n }\n\n\t\t\t\tfor (GameListener listener : gameListeners) {\n\t\t\t\t\tlistener.cardPlayed(clickedCard);\n\t\t\t\t}\n\n\t\t\t\tcheckResults();\n\t\t\t} else {\n\t\t\t\tthrow new InvalidMoveException();\n\n\t\t\t}\n\t\t}\n\t}", "public void playGame() {\n show();\n while (gameStatus) {\n if (canPut(players.get((state.getTurn())))) {\n int choice = -1;\n while (gameStatus) {\n choice = controls.get(state.getTurn()).putCard(currentCard);\n if (validInput(players.get((state.getTurn())), choice)) {\n System.out.println(players.get(state.getTurn()).getCards().get(choice).toString());\n try{Thread.sleep(1000);}catch(InterruptedException ignored){}\n break;\n }\n }\n decide(players.get(state.getTurn()), players.get(state.getTurn()).getCards().get(choice));\n }\n try{Thread.sleep(500);}catch(InterruptedException ignored){}\n checkFinish();\n if (gameStatus) {\n state.nextTurn();\n show();\n }\n }\n }", "@Override\n\tpublic void play() {\n\t\t\n\t}", "private void crossPressed() {\n\t\tif (!talkmode) {\n\t\t\tif (checkLoot() || checkNearbyVillagers() || checkDoors(doors, player.direction) || checkSigns()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\t\t\tif (question) {\n\t\t\t\texitQuestionDialog();\n\t\t\t}\n\n\t\t\tLoot g = dialog.getGift();\n\t\t\tif (g != null) {\n\t\t\t\tLoad.collectLoot(g);\n\t\t\t}\n\t\t\tString takeName = dialog.getTakeName();\n\t\t\tif (takeName != null) {\n\t\t\t\tint takeAmount = dialog.getTakeAmount();\n\t\t\t\tif (takeName.equals(\"gold\")) {\n\t\t\t\t\tLoad.getPartyItems().addGold(-takeAmount);\n\t\t\t\t} else {\n\t\t\t\t\tLoad.getPartyItems().take(takeName, takeAmount);\n\t\t\t\t}\n\t\t\t}\n\t\t\tHashMap<String, Integer> t = dialog.getBeforeTriggers();\n\t\t\tHashMap<String, Integer> triggerAdds = dialog.getTriggerAdds();\n\t\t\tboolean finished = dialog.isFinished();\n\t\t\tdoTriggers(t);\n\t\t\tif (triggerAdds != null) {\n\t\t\t\tDatabase.incrementStatus(triggerAdds);\n\t\t\t}\n\t\t\tif (finished) {\n\t\t\t\tsetTalking(false);\n\t\t\t\tif (dialog.shouldTrigger()) {\n\t\t\t\t\tt = dialog.getTriggers();\n\t\t\t\t\tdoTriggers(t);\n\t\t\t\t\texecuteTrigger(talkingVillager);\n\t\t\t\t} else {\n\t\t\t\t\tdialog.resetDialog();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (dialog.isQuestion()) {\n\t\t\t\t\tinitQuestionDialog();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void doAi(){\n\t\t\tif(MathHelper.getRandom(0, Game.FRAMERATE * 5) == 5){\n\t\t\t\tsetScared(true);\n\t\t\t}\n\t\t\n\t\t//Update rectangle\n\t\tsetRectangle(getX(), getY(), getTexture().getWidth(), getTexture().getHeight());\n\t\t\n\t\trect = new Rectangle(getDestinationX(), getDestinationY(), 10, 10);\n\t\t\n\t\tif(rect.intersects(getRectangle())){\n\t\t\t\n\t\t\tif(StateManager.getState() == StateManager.STATE_BOSSTWO){\n\t\t\t\t\n\t\t\t\t\tsetDestinationX(StateGame.player.getX());\n\t\t\t\t\t\n\t\t\t\t\tsetDestinationY(StateGame.player.getY());\n\t\t\t\t\t\n\t\t\t\t\trect = new Rectangle(getDestinationX(), getDestinationY(), 10, 10);\n\t\t\t\t\treachedDestination = (true);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Check for collision with jelly\n\t\tint checkedJelly = (0);\n\t\twhile(checkedJelly < EntityJelly.JELLY.size() && EntityJelly.JELLY.get(checkedJelly) != null){\n\t\t\tif(EntityJelly.JELLY.get(checkedJelly).getDead() == false){\n\t\t\t\tif(getRectangle().intersects(EntityJelly.JELLY.get(checkedJelly).getRectangle())){\n\t\t\t\t\tsetHealth(getHealth() - 2);\n\t\t\t\t\tif(MathHelper.getRandom(1, 10) == 10){\n\t\t\t\t\tAnnouncer.addAnnouncement(\"-2\", 60, EntityJelly.JELLY.get(checkedJelly).getX(), EntityJelly.JELLY.get(checkedJelly).getY());\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t\tcheckedJelly++;\n\t\t}\n\t\t\n\t\t//If we're out of health, kill the entity\n\t\tif(getHealth() < 0){\n\t\t\tsetDead(true);\n\t\t}\n\t\t\n\t\tif(StateManager.getState() == StateManager.STATE_BOSSTWO){\n\t\t\tif(reachedDestination == true){\n\t\t\t\tif(getScared() == false){\n\t\t\t\tsetY(getY() + getSpeed());\n\t\t\t\t}else{\n\t\t\t\t\tsetY(getY() - getSpeed() * 3);\n\t\t\t\t\tsetX(getX() - getSpeed() * 3);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tif(getScared() == false){\n\t\t\t\tif(getX() < getDestinationX())\n\t\t\t\t\tsetX(getX() + getSpeed());\n\t\t\t\tif(getX() > getDestinationX())\n\t\t\t\t\tsetX(getX() - getSpeed());\n\t\t\t\tif(getY() < getDestinationY())\n\t\t\t\t\tsetY(getY() + getSpeed());\n\t\t\t\tif(getY() > getDestinationY())\n\t\t\t\t\tsetY(getY() - getSpeed());\n\t\t\t\t}else{\n\t\t\t\t\t\tsetY(getY() - getSpeed() * 3);\n\t\t\t\t\t\tsetX(getX() - getSpeed() * 3);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void play() {\n\n int turn = 1;\n\n while (!isCheckMate()) {\n System.out.println(\"Turn \" + turn++);\n board.print();\n playTurn(whitePlayer);\n board.print();\n playTurn(blackPlayer);\n }\n }", "public void victoryCardFind();", "void play() {\n\n ArrayList<Card> cardsInMiddle = new ArrayList<>();\n\n Card[] lastCardsPlayed = new Card[numOfPlayers];\n\n //simulation of each player flipping their next card\n for (int i = 0; i < players.length; i++) {\n lastCardsPlayed[i] = players[i].getNextCard();\n cardsInMiddle.add(lastCardsPlayed[i]);\n\n }\n\n //if there's a tie\n while (tieForCards(lastCardsPlayed)) {\n //check to see if players have enough cards to continue\n //if not, then clear that players hand and game will end\n WarPlayer lessThan3Cards = tryGetPlayerWithLessThanThreeCards();\n if (lessThan3Cards != null) {\n lessThan3Cards.getHand().clear();\n return;\n }\n\n //simulation of flipping 2 extra cards\n for (int i = 0; i < players.length; i++) {\n cardsInMiddle.add(players[i].getNextCard());\n cardsInMiddle.add(players[i].getNextCard());\n\n Card lastCard = players[i].getNextCard();\n cardsInMiddle.add(lastCard);\n lastCardsPlayed[i] = lastCard;\n }\n }\n setLastCardsPlayed(lastCardsPlayed);\n\n //determining who gets all the cards played for the round\n int highestCardIndex = largestCard(lastCardsPlayed);\n players[highestCardIndex].addCards(cardsInMiddle);\n players[highestCardIndex].addPoints(cardsInMiddle.size() / numOfPlayers);\n }", "public abstract char play(PlacedBet placedBet, HashMap<Character, Payout> payoutMap, char selected);", "public void hit() {\n Card c = cards.draw(); //Draws a card\n cardPane.add(c); //Adds card to card panel\n repaint(); //Redraws hand\n revalidate(); //Refreshes hand\n int cardValue = c.getValue(); //Gets value of card\n ArrayList<Integer> newValues = new ArrayList<>(); //Collection of new Integer values\n for (Integer i : values) {\n newValues.add(i + cardValue); //Populates new list with old list + new card value\n }\n values.clear(); //Erases old list\n values.addAll(newValues); //Sets values to newValues\n if (cardValue == 11) { //If card is an ace\n for (Integer i : values) {\n newValues.add(i - 10); //Adds values where ace is value 1\n }\n values.clear();\n values.addAll(newValues);\n }\n updateValue(); //Updates the value of the hand\n }", "public void drawCard(int player) {\r\n\t\tCard topCard = drawPile.cards.get(0);\r\n\t\tplayers.get(player).addCard(topCard);\r\n\t\tdrawPile.removeCard(topCard);\r\n\t}", "public void playTurn(){\r\n\t\t// all exceptions in this method are caught, because if this method throws an exception\r\n\t\t// the AIPlayer will not draw/discard a card and the program will freeze\r\n\t\ttry{\r\n\t\t\tupdateLastCardDiscarded();\r\n\t\t}catch(Exception e){\r\n\t\t\tSystem.out.println(\"AIPlayer, lastCard: \" + e.toString());\r\n\t\t}\r\n\t\ttry{\r\n\t\t\tif(!(drawOrPickUp()^bestChoice(BEST_CHOICE_AT_FIFTY))){ // choose whether to draw from the deck or pick up from the stack\r\n\t\t\t\tif(!game.getRound().drawFromDiscard()) // If picking up from the discard is not possible,\r\n\t\t\t\t\tgame.getRound().drawFromDeck(); // draw from the deck instead\r\n\t\t\t}else{\r\n\t\t\t\tgame.getRound().drawFromDeck();\r\n\t\t\t}\r\n\t\t}catch(Exception e){\r\n\t\t\tSystem.out.println(\"AIPlayer, draw: \" + e.toString());\r\n\t\t\tgame.getRound().drawFromDeck(); // if something goes wrong, draw\r\n\t\t}\r\n\r\n\t\ttry{\r\n\t\t\tgroup = new Groups(this, getHand());\r\n\t\t\tif(!hasLaidDownPhase() && group.getCompletePhaseGroups() != null && // if the AI player, hasn't laid down PhaseGroups\r\n\t\t\t\t\tgroup.getCompletePhaseGroups().length == Configuration.getNumberRequired(getPhase()) && // will lay down the right number of phasesGroups\r\n\t\t\t\t\tgetGame().getRound().getTurnNumber() >= 8 - (difficulty/10)) // is past a certain turn number based off difficulty\r\n\t\t\t\taddPhaseGroups(group.getCompletePhaseGroups()); \r\n\t\t}catch(Exception e){\r\n\t\t\tSystem.out.println(\"AIPlayer, laydown: \" + e.toString()); // laid down all my cards Hand92,AI90afterAI74\r\n\t\t}\r\n\r\n\t\ttry{\r\n\t\t\tif(hasLaidDownPhase())\r\n\t\t\t\tplayOffPhases();\r\n\t\t}catch(Exception e){\r\n\t\t\tSystem.out.println(\"AIPlayer, playoff: \" + e.toString());\r\n\t\t}\r\n\r\n\t\ttry{\r\n\t\t\tlastCardDiscarded = discardCard();\r\n\t\t\tgame.getRound().discard(lastCardDiscarded); // discard\r\n\t\t}catch(Phase10Exception e){\t\r\n\t\t}catch(Exception e){\r\n\t\t\tlastCardDiscarded = getHand().getCard(0);\r\n\t\t\tgame.getRound().discard(lastCardDiscarded);\r\n\t\t\tSystem.out.println(\"AIPlayer, discard: \" + e.toString());\r\n\t\t}\r\n\t}", "private synchronized void teamVictory() {\n \t\tif (state == MatchState.ONVICTORY || state == MatchState.ONCOMPLETE || state == MatchState.ONCANCEL) \n \t\t\treturn;\n \t\tstate = MatchState.ONVICTORY;\n \t\t/// Call the rest after a 2 tick wait to ensure the calling transitionMethods complete before the\n \t\t/// victory conditions start rolling in\n \t\tBukkit.getScheduler().scheduleSyncDelayedTask(plugin, new MatchVictory(this),2L);\n \t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tsp5.play(sound_id5, 1.0F, 1.0F, 0, 0, 1.0F);\n\t\t\t}" ]
[ "0.7530404", "0.71190685", "0.70147943", "0.6733652", "0.6594264", "0.6582272", "0.65600216", "0.6535958", "0.64662343", "0.64598936", "0.64315057", "0.6426759", "0.6369454", "0.63611525", "0.6331183", "0.6313886", "0.6310145", "0.6302573", "0.6291464", "0.6285605", "0.62681943", "0.6244403", "0.6180296", "0.6163764", "0.6149908", "0.6144528", "0.61302954", "0.6114835", "0.6097742", "0.6091679", "0.60876673", "0.60827255", "0.6076034", "0.60724753", "0.6072117", "0.60691994", "0.6067706", "0.6059008", "0.605545", "0.6044664", "0.60372025", "0.60338503", "0.60306144", "0.6025287", "0.60140675", "0.60124147", "0.5993547", "0.599353", "0.5991671", "0.598057", "0.59754866", "0.59668374", "0.59665716", "0.59549767", "0.59520483", "0.5948637", "0.59473675", "0.5938531", "0.5938257", "0.59354335", "0.5928446", "0.59255517", "0.5920375", "0.59151345", "0.5909463", "0.5908615", "0.5905787", "0.59045494", "0.59022874", "0.59021443", "0.58998233", "0.589633", "0.5893349", "0.588959", "0.5881957", "0.587898", "0.58752584", "0.5874589", "0.58714646", "0.58709496", "0.58683926", "0.5861186", "0.58604604", "0.584976", "0.58493143", "0.58486867", "0.5845737", "0.5845609", "0.58422565", "0.5841622", "0.58392113", "0.58358794", "0.58280134", "0.58266777", "0.5822198", "0.58208925", "0.5820255", "0.58154327", "0.58083475", "0.5807464" ]
0.76656497
0
This method rolls the number from two dice
void rollNumber(int d1, int d2);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void roll()\n {\n rand = (int)(((Math.random())*6)+1); // dice roll #1\n rand2 = (int)(((Math.random())*6)+1);// dice roll #2\n }", "public int rollDice() {\n\t\td1 = r.nextInt(6) + 1;\n\t\td2 = r.nextInt(6) + 1;\n\t\trepaint();\n\t\treturn d1 + d2;\n\t}", "public int rollDice() {\n\t\td1 = (int)rand.nextInt(6)+1;\n\t\td2 = (int)rand.nextInt(6)+1;\n\t\treturn d1+d2;\n\t}", "public int roll()\r\n\t{\r\n\t return die1.roll() + die2.roll();\r\n \t}", "public int roll() \r\n {\r\n \r\n die1FaceValue = die1.roll();\r\n die2FaceValue = die2.roll();\r\n \r\n diceTotal = die1FaceValue + die2FaceValue;\r\n \r\n return diceTotal;\r\n }", "public static int diceRoll(){\n Random rd = new Random();\n int dice1, dice2;\n\n dice1 = rd.nextInt(6) + 1; //assigns random integer between 1 and 6 inclusive to dice 1\n dice2 = rd.nextInt(6) + 1; //assigns random integer between 1 and 6 inclusive to dice 2\n\n System.out.println(\"You rolled \" + dice1 + \" + \" + dice2 + \" = \" + (dice1+dice2)); //print result\n\n return dice1 + dice2; //returns sum of dice rolls\n\n }", "public void Roll() // Roll() method\n {\n // Roll the dice by setting each of the dice to be\n // \ta random number between 1 and 6.\n die1Rand = (int)(Math.random()*6) + 1;\n die2Rand = (int)(Math.random()*6) + 1;\n }", "public void Diceroll()\n\t{\n\t\tdice1 = rand.nextInt(6)+1;\n\t\tdice2 = rand.nextInt(6)+1;\n\t\ttotal = dice1+dice2;\n\t}", "public void roll()\r\n\t{\r\n\t\tRandom rand = new Random();\r\n\r\n\t\trollNumber = rand.nextInt(numOfSides) + 1;\r\n\t}", "public int roll(int dices){\n int faces[] = new int[dices];\n int total = 0;\n Dice dice = new Dice();\n for(int i = 0; i < dices; i++){\n faces[i] = (dice.rand.nextInt(6) + 1);\n }\n for(int i = 0; i < faces.length-1; i++){\n if(faces[i] != faces[i+1]){\n this.isDouble = false;\n break;\n }\n else{\n this.isDouble = true;\n }\n }\n if(this.isDouble == true){\n this.twiceCounter++;\n }\n for(int i = 1; i < faces.length+1; i++){\n System.out.print(\"The \" + i + \". dice: \" + faces[i-1] + \" \");\n total += faces[i-1];\n }\n System.out.println(\" and the sum is \" + total);\n\n return total;\n }", "private void roll2(DiceModel player1, DiceModel player2) {\n\t\t\n\t\tint random;\t\n\t\t\n\t\t// enables the dice to be kept\n\t\tenableDice();\n\t\t\n\t\t// reset text if player previously failed to select a die\n\t\tif (roundChanger == 2) {\n\t\t\ttextAreaInstructions.setText(rollToBeat);\n\t\t} else {\n \ttextAreaInstructions.setText(\"Start by clicking\" + \"\\n\" + \"Roll Dice button!\");\n \t}\n\t\t\n\t\t// display round number\n\t\ttextFieldRound.setText(Integer.toString(round));\n\t\t\n\t\t// if we are on the first roller, count up rolls till they end turn\n\t\tif (roundChanger == 1) {\n\t\t\trollsTaken = rollsTaken + 1;\n\t\t}\n\t\t\n\t\t// turn should increment for both rollers\n\t\tturn = turn + 1;\n\t\t\n\t\t// if all three die are selected then end turn\n\t\tif (togglebtnD1.isSelected() == true && togglebtnD2.isSelected() == true &&\n\t\t\t\ttogglebtnD3.isSelected() == true) {\n\t\t\tendTurn();\n\t\t}\n\t\t\n\t\t// determines who has the current roll\n\t\tString currentPlayer = textFieldCurrentPlayer.getText();\n\t\tString stringPlayer1 = \"Player1\";\n\t\t\n\t\t// enforces player requirement of having at least 1 die selected per roll\n\t\tif (turn != 1 && togglebtnD1.isSelected() == false && togglebtnD2.isSelected() == false &&\n \ttogglebtnD3.isSelected() == false) {\n \t\tif (roundChanger == 1) {\n \t\tturn = turn - 1;\n \t\trollsTaken = rollsTaken - 1;\n \t\ttextAreaInstructions.setText(\"Please select at least 1 die to continue.\");\n \t\t} else if (roundChanger == 2 && turn == 0){\n \t\t\ttextAreaInstructions.setText(rollToBeat);\n \t\t}else {\n \t\tturn = turn - 1;\n \t\ttextAreaInstructions.setText(\"Please select at least 1 die to continue.\");\n \t\t}\n \t} else {\n\t\t\t// only get new values for dice that haven't been kept\t\t\n\t\t\tif (togglebtnD1.isSelected() == false) {\n\t\t\t\trandom = generateRandom();\n\t\t\t\t displayDie(random, togglebtnD1);\n\t\t\t\tif (currentPlayer.equals(stringPlayer1)) {\n\t\t\t\t\tplayer1.setDie1(random);\n\t\t\t\t} else {\n\t\t\t\t\tplayer2.setDie1(random);\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t}\n\t\t\tif (togglebtnD2.isSelected() == false) {\n\t\t\t\trandom = generateRandom();\n\t\t\t\tdisplayDie(random, togglebtnD2);\n\t\t\t\tif (currentPlayer.equals(stringPlayer1)) {\n\t\t\t\t\tplayer1.setDie2(random);\n\t\t\t\t} else {\n\t\t\t\t\tplayer2.setDie2(random);\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t}\n\t\t\tif (togglebtnD3.isSelected() == false) {\n\t\t\t\trandom = generateRandom();\n\t\t\t\tdisplayDie(random, togglebtnD3);\n\t\t\t\tif (currentPlayer.equals(stringPlayer1)) {\n\t\t\t\t\tplayer1.setDie3(random);\n\t\t\t\t} else {\n\t\t\t\t\tplayer2.setDie3(random);\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t}\n\n\t\t\t// limit second rollers turns to as many turns as first roller had\n\t\t\tif (turn == rollsTaken && roundChanger == 2) {\n\t\t\t\tendTurn();\n\t\t\t}\n\n\t\t\tif (turn == 3) { \n\t\t\t\tendTurn();\n\t\t\t}\n\t\t}\t\n\t\n\t}", "void rollDice();", "int RollDice ()\n {\n\tint roll = (int) (Math.random () * 6) + 1;\n\treturn roll;\n }", "public int roll() {\n int result = ThreadLocalRandom.current().nextInt(SIDES+1) + 1;// standard 1-7\n if(result == 7){ //LoadedDie 6 occurs twice as often\n return 6;\n } else{\n return result;\n }\n }", "public int rollDice();", "public int roll_the_dice() {\n Random r = new Random();\n int number = r.nextInt(6) + 1;\n\n return number;\n }", "static int roll() {\n\t\tRandom rand = new Random();\t\t\t\t//get large random number\n\t\tint num2 = rand.nextInt();\t\t\t\t//convert from long to int\n\t\treturn Math.abs(num2%6)+1;\t\t\t\t//num between 1 and 6\n\t}", "public static int rollDice (int a, int b)\r\n\t\t\t{\n\t\t\t\tint count=0;\r\n\t\t\t\tint total=0;\r\n\t\t\t\twhile(count<a)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tint roll=(int)((Math.random()*b)+1);\t\r\n\t\t\t\t\t\ttotal=total+roll;\r\n\t\t\t\t\t\tcount++;\r\n\t\t\t\t\t}\r\n\t\t\t\treturn total;\r\n\t\t\t\t\r\n\t\t\t}", "public static void roll()\n {\n Random no = new Random();\n Integer dice = no.nextInt(7);\n System.out.println(dice);\n }", "public static int diceRoll() {\n Random roller = new Random();//Create a random number generator\r\n return roller.nextInt(6) + 1;//Generate a number between 0-5 and add 1 to it\r\n }", "private int diceRoll(int sides) {\n return (int) ((Math.random() * sides) + 1);\n }", "public void rollDices(Dice dice1, Dice dice2) {\n\n while (true) {\n // click to roll\n dice1.rollDice();\n dice2.rollDice();\n setSum(dice1, dice2);\n\n // if(roll == pN)\n // player and npcs that bet 1 win\n if (sum == pN) {\n player.playerWin();\n System.out.println(\"You rolled \" + sum + WINMESSAGE +\n \"\\nYou have a total of \" + player.getWins() + \" wins and \"\n + player.getLoses() + \" loses.\");\n break;\n }\n // if(roll == out7)\n else if (sum == OUT7) {\n player.playerLose();\n System.out.println(\"You hit the out 7.\" + LMESSAGE + \"\\nYou have a total of \" + player.getWins()\n + \" wins and \" + player.getLoses() + \" loses.\");\n\n break;\n } else {\n System.out.println(\"\\nYour total roll is \" + sum + \"\\nYou need to hit \" + pN +\n \" to win.\" + \"\\n\\nContinue rolling\\n\");\n }\n\n\n }\n\n }", "public static int rollDice()\n\t{\n\t\tint roll = (int)(Math.random()*6)+1;\n\t\t\n\t\treturn roll;\n\n\t}", "void roll(int noOfPins);", "public void comeOutRoll(Dice dice1, Dice dice2) {\n\n setExit(false);\n System.out.println(\"***This is the come out roll***\" +\n \"\\nIf you roll 7 or 11 you win.\\nBut if you roll 2,3 or 12\" +\n \" you lose.\");\n dice1.rollDice();\n dice2.rollDice();\n setSum(dice1, dice2);\n\n // if (winCon.contains(roll)) player wins, npcs that bet 1 wins\n\n if (sum == OUT7 || sum == 11) {\n player.playerWin();\n System.out.println(\"Your total is \" + sum + WINMESSAGE +\n \"\\nYou have a total of \" + player.getWins() + \" wins and \"\n + player.getLoses() + \" loses.\");\n setExit(true);\n\n }\n // if (failCon.contains(roll)) player loses, npcs with bet 2 wins\n else if (sum == 2 || sum == 3 || sum == 12) {\n player.playerLose();\n System.out.println(\"Your total is \" + sum + LMESSAGE + \"\\nYou have a total of \" + player.getWins() + \" wins and \"\n + player.getLoses() + \" loses.\");\n\n setExit(true);\n\n }\n // else set pN // cannot be winCon or failCon\n else {\n System.out.println(\"\\nYour total is \" + sum + \" this is your point number, hit this to win\");\n setPN(sum);\n }\n }", "public int rollResult(){\r\n return rand.nextInt(6) + 1;\r\n }", "public static int rollDice(){\n return (int)(Math.random()*6) + 1;\n // Math.random returns a double number >=0.0 and <1.0\n }", "public void roll(){\n Random rand = new Random();\n this.rollVal = rand.nextInt(this.faces) + 1;\n }", "public int roll() {\n if(!debug)\n this.result = random.nextInt(6) + 1;\n else{\n scanner = new Scanner(showInputDialog(\"Enter dice value (1-6):\"));\n try{int res = scanner.nextInt()%7;\n this.result = res!=0? res:6;\n }\n catch(NoSuchElementException ne){this.result=6;} \n }\n return this.result;\n }", "public int rollDice(){\r\n\t\tString playerResponse;\r\n\t\tplayerResponse=JOptionPane.showInputDialog(name+\". \"+\"Type anything to roll\");\r\n\t\t//System.out.println(name+\"'s response: \"+playerResponse);\r\n\t\tdice1=(int)(Math.random() * ((6 - 1) + 1)) + 1;\r\n\t\tdice2=(int)(Math.random() * ((6 - 1) + 1)) + 1;\r\n\t\tdicetotal=dice1+dice2;\r\n\t\tnumTurns++;\r\n\t\treturn dicetotal;\r\n\t}", "public String play() \r\n { \r\n \r\n theDiceTotal = dice.roll();\r\n \r\n while ( theDiceTotal != 12 )\r\n { \r\n theDiceTotal = dice.roll();\r\n System.out.println( dice.getDie1FaceValue() + \" \" + dice.getDie2FaceValue() );\r\n count++;\r\n }\r\n \r\n return ( count - 1 ) + \" dice rolled.\"; \r\n }", "public int roll()\n {\n int r = (int)(Math.random() * sides) + 1;\n return r;\n }", "public int roll() {\n Random r;\n if (hasSeed) {\n r = new Random();\n }\n else {\n r = new Random();\n }\n prevRoll = r.nextInt(range) + 1;\n return prevRoll;\n }", "public static int diceRoll() {\n\t\t\n\t\t//the outcome of the die is stored as an integer and returned\n\t\t\n\t\tint diceNumber = (int)((6 * (Math.random())) + 1);\n\t\treturn diceNumber;\n\t}", "public int roll() {\n this.assuerNN_random();\n //Roll once\n int result = random.nextInt(this.sides)+1;\n //TODO Save the roll somewhere\n\n //Return the roll\n return result;\n }", "int roll();", "public int takeTurn(Dice theDice){\n \n this.turnCounter++;\n \n return(theDice.rollDice());\n \n }", "private int rollDie() {\r\n final SecureRandom random = new SecureRandom();\r\n return random.nextInt(6 - 1) + 1;\r\n }", "public int roll(){\r\n myFaceValue = (int)(Math.random() * myNumSides) + 1;\r\n return myFaceValue;\r\n }", "public void rollCup()\n {\n die1.rolldice();\n die2.rolldice();\n gui.setDice(die1.getFacevalue(), die2.getFacevalue());\n }", "public int roll() {\n return random.nextInt(6) + 1;\n }", "public static String diceRoll () {\n Scanner scanner = new Scanner(System.in);\n\n System.out.println(\"Enter the number of sides for a pair of dice: \");\n String userInput = scanner.nextLine();\n int numberOfSides = Integer.parseInt(userInput);\n numberOfSides /= 2;\n\n boolean userAgain = true;\n\n do {\n\n double randomRollOne = Math.random() * numberOfSides + 1;\n double randomRollTwo = Math.random() * numberOfSides + 1;\n int diceOne = (int) randomRollOne;\n int diceTwo = (int) randomRollTwo;\n\n System.out.println(\"You rolled a \" + diceOne + \" and a \" + diceTwo + \".\");\n\n System.out.println(\"Do you want to roll again? y/n: \");\n String yesOrNo = scanner.nextLine();\n\n if (yesOrNo.equals(\"n\")) {\n userAgain = false;\n }\n\n } while (userAgain);\n\n return \"Goodbye.\";\n }", "public void roll()\r\n\t{\r\n\t\tthis.value = rnd.nextInt(6) + 1;\r\n\t}", "private void otherRolls() {\n\t\t// program tells that player should select dices to re-roll.\n\t\tdisplay.printMessage(\"Select the dice you wish to re-roll and click \"\n\t\t\t\t+ '\\\"' + \"Roll Again\" + '\\\"');\n\t\t// program will wait until player clicks \"roll again\" button.\n\t\tdisplay.waitForPlayerToSelectDice();\n\t\t// we randomly get six integers, from one to six, and we do it N_DICE\n\t\t// times and every time we write our random integer in the array.\n\t\tfor (int i = 0; i < N_DICE; i++) {\n\t\t\tif (display.isDieSelected(i) == true) {\n\t\t\t\tint dice = rgen.nextInt(1, 6);\n\t\t\t\tdiceResults[i] = dice;\n\t\t\t}\n\t\t}\n\t\t// program will display dice, that depends on our randomly taken\n\t\t// integers.\n\t\tdisplay.displayDice(diceResults);\n\t}", "public void roll() {\n\t\tthis.currentValue = ThreadLocalRandom.current().nextInt(1, this.numSides + 1);\n\t}", "public void roll(){\n currentValue = rand.nextInt(6)+1;\n }", "public void buttonRoll() {\n\t\troll2(player1, player2);\n\t\t}", "public int generateRoll() {\n\t\tint something = (int) (Math.random() * 100) + 1;\n\t\tif (something <= 80) {\n\t\t\tint allNumRoll = (int) (Math.random() * getNumSides()) + 1;\n\t\t\tint roll = allNumRoll * 2 - 1;\n\t\t\treturn roll;\n\t\t} else {\n\t\t\tint allNumRoll = (int) (Math.random() * getNumSides()) + 1;\n\t\t\tint roll = allNumRoll * 2;\t\t\n\t\t\treturn roll;\n\t\t}\n\t}", "@Override\r\n\tpublic int rollDice() {\n\t\treturn 0;\r\n\t}", "public int rollDie() {\n\t\treturn (int) (Math.random()*6)+1;\n\t}", "public static void main(String[] args)\n {\n Die dice_1 = new Die();\n Die dice_2 = new Die();\n Scanner in = new Scanner(System.in);\n\n while (true)\n {\n System.out.println(\"Time for some Craps!\");\n\n System.out.println(\"Hit [Enter] to roll both dice:\");\n in.nextLine();\n\n int roll_1 = dice_1.roll();\n int roll_2 = dice_2.roll();\n int totalroll = roll_1 + roll_2;\n System.out.println(\"You rolled a \" + roll_1 + \" and a \" + roll_2);\n System.out.println(\"Which combine for a total roll of \" + totalroll);\n\n // time to set up if statements to determine whether the player has won, lost, or still plays.\n\n if (totalroll == 7 || totalroll == 11)\n {\n System.out.println(\"Congrats! You won! :D \");\n }\n\n else if (totalroll == 2 || totalroll == 3 || totalroll == 12)\n {\n System.out.println(\"Sorry! You lost! :( \");\n } \n\n else\n {\n // we now need a point for the player to attempt to roll for\n int point = totalroll;\n\n // boolean needed here to keep the game continuous after the first roll\n boolean keepplaying = true;\n\n while(keepplaying) \n {\n // same code from above needed for the game to continue\n System.out.println(\"Hit [Enter] to roll both dice:\");\n in.nextLine();\n\n roll_1 = dice_1.roll();\n roll_2 = dice_2.roll();\n totalroll = roll_1 + roll_2;\n System.out.println(\"You rolled a \" + roll_1 + \" and a \" + roll_2);\n System.out.println(\"Which combine for a total roll of \" + totalroll);\n\n // now we check to see if they rolled the point\n if (totalroll == point)\n {\n System.out.println(\"You matched the point. You win! :D\");\n keepplaying = false;\n }\n\n else if (totalroll == 7)\n {\n System.out.println(\"You rolled a 7. You lost! :(\");\n keepplaying = false;\n } \n }\n } \n System.out.println(\"Play again?\");\n String playAgain = in.nextLine();\n if (playAgain.equals(\"\"))\n {\n }\n if (playAgain.substring(0,1).equals(\"n\"))\n {\n break;\n } \n }\n System.out.println(\"Thanks for playing Craps!\");\n }", "public int roll() {\n Random random = new Random();\n faceValue = random.nextInt(sides)+1;\n return faceValue;\n }", "void roll(int pins);", "public abstract int rollDice();", "public void rollDie(){\r\n\t\tthis.score = score + die.roll();\r\n\t}", "public int tossDice(){\n\t\tRandom r = new Random();\n\t\tdiceValue = r.nextInt(6)+1;\n\t\tdiceTossed = true;\n\t\treturn diceValue;\n\t}", "private void rollDie() {\n if (mTimer != null) {\n mTimer.cancel();\n }\n mTimer = new CountDownTimer(1000, 100) {\n public void onTick(long millisUntilFinished) {\n die.roll();\n showDice();\n }\n public void onFinish() {\n afterRoll();\n }\n }.start();\n }", "public static int diceRoll() {\n int max = 20;\n int min = 1;\n int range = max - min + 1;\n int rand = (int) (Math.random() * range) + min;\n return rand;\n }", "public void roll() {\n\t\tthis.faceValue = (int)(NUM_SIDES*Math.random()) + 1;\n\t}", "public static void main(String[] args) {\n\t\tRandom ricoDude = new Random();\r\n\t\tint x = ricoDude.nextInt(20) + 1;\r\n\t\t// the dice will have arange of 0-5 to make it 1-6 , + 1 to the end of it\r\n\t\t\r\n\t\tSystem.out.println(\"You rolled a: \" + x);\r\n\t\tint a = 1, b= 2,k;\r\n\t\tk = a + b + a++ + b++;\r\n\t\tSystem.out.println(k);\r\n\t\t\r\n\t}", "public int getRoll2()\r\n {\r\n return roll2;\r\n }", "public int setRollResult(int diceAmount, int diceSides) {\n\t\tint result = 0;\n\t\tfor (int i = 0; i < diceAmount; i++) {\n\t\t\tresult += diceBag.rollDice(diceSides);\n\t\t}\n\t\treturn result;\n\t}", "public static void main(String[] args) {\n CDice dice = new CDice();\n dice.init(1, 2, 3, 4, 5, 6);\n int random = dice.roll();\n System.out.println(\"dice roll side number: \"+random);\n }", "public static int rollDie() {\n int n = ThreadLocalRandom.current().nextInt(1, 7);\n return n;\n }", "public int rollDice()\n{\n int die1, die2, sum; \n\n // pick random die values\n die1 = 1 + ( int ) ( Math.random() * 6 );\n die2 = 1 + ( int ) ( Math.random() * 6 );\n\n sum = die1 + die2; // sum die values\n\n // display results\n die1Field.setText( Integer.toString( die1 ) );\n die2Field.setText( Integer.toString( die2 ) );\n sumField.setText( Integer.toString( sum ) );\n\n return sum; // return sum of dice\n\n\n}", "public int roll3D6()\n {\n Random random1 = new Random();\n int r = random1.nextInt(6) +1;\n r += random1.nextInt(6) +1;\n r += random1.nextInt(6) +1;\n return r;\n }", "public static int[] sumOfTwoDice(int n) {\n int[] dice = new int[11];\n for(int b = n; b > 0; b--) {\n\t\tint d = ThreadLocalRandom.current().nextInt(1, 7);\n int d1 = ThreadLocalRandom.current().nextInt(1, 7);\n int i = d+d1-2;\n dice[i]+=1; \n\t}\n return dice;\n }", "public void setPlayerRoll20()\r\n {\r\n \r\n roll2 = ((int)(Math.random() * 100) % HIGHEST_DIE_VALUE20 + LOWEST_DIE_VALUE20);\r\n \r\n }", "public int throwDice() {\n //create new random number between 1 and 6\n int nr = ThreadLocalRandom.current().nextInt(1, 6 + 1);\n //throw the number\n throwDice(nr);\n //return number\n return nr;\n }", "public static void main(String[] args) {\r\n\t\r\n\t\tint die1; // The number on the first die.\r\n\t\tint die2; // The number on the second die.\r\n\t\tint roll; // The total roll (sum of the two dice).\r\n\t \r\n\t\tdie1 = (int)(Math.random()*6) + 1;\r\n\t\tdie2 = (int)(Math.random()*6) + 1;\r\n\t\troll = die1 + die2;\r\n\t \r\n\t\tSystem.out.println(\"The first die comes up \" + die1);\r\n\t\tSystem.out.println(\"The second die comes up \" + die2);\r\n\t\tSystem.out.println(\"Your total roll is \" + roll);\r\n\r\n\t\t}", "public int diceValue()\r\n\t{\r\n\t\treturn rollNumber;\r\n\t}", "private void firstRoll(int playerName) {\n\t\t// we randomly get six integers, from one to six, and we do it N_DICE\n\t\t// times and every time we write our random integer in the array.\n\t\tfor (int i = 0; i < N_DICE; i++) {\n\t\t\tint dice = rgen.nextInt(1, 6);\n\t\t\tdiceResults[i] = dice;\n\t\t}\n\t\t// program will tell witch players turn it is.\n\t\tdisplay.printMessage(playerNames[playerName - 1]\n\t\t\t\t+ \"'s turn! Click the \" + '\\\"' + \"Roll Dice\" + '\\\"'\n\t\t\t\t+ \" button to roll the dice.\");\n\t\t// program will wait until player clicks \"roll dice\" button.\n\t\tdisplay.waitForPlayerToClickRoll(playerName);\n\t\t// program will display dice, that depends on our randomly taken\n\t\t// integers.\n\t\tdisplay.displayDice(diceResults);\n\t}", "public static Integer getScoreFor_RollOnTwoPairs(Dice dice) \r\n\t{\r\n\t\tlog.debug(\"Inside method getScoreFor_RollOnTwoPairs\");\r\n\t\t\r\n\t\tInteger score = 0;\r\n\t\tInteger tempScore = 0;\r\n\t\tInteger pairCount = 0;\r\n\t\t\r\n\t\tMap<Integer, Integer> map = dice.getDiceNumberCountMap();\r\n\t\t\r\n\t\tfor ( Integer diceNumber : map.keySet() )\r\n\t\t{\r\n\t\t\t// if we can find a number in pair\r\n\t\t\tif ( map.get(diceNumber) >= 2 ) \r\n\t\t\t{\r\n\t\t\t\tpairCount = pairCount + 1;\r\n\t\t\t\t\r\n\t\t\t\ttempScore = tempScore + diceNumber * 2;\r\n\t\t\t\t\r\n\t\t\t\t// if pair count is 2 then score\r\n\t\t\t\tscore = ( pairCount == 2 ) ? tempScore : score;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn score;\r\n\t}", "public int setDiceValue(int num){\r\n\t\trollNumber = num;\r\n\r\n\t\treturn rollNumber;\r\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t\tint[] totals = new int[11];\r\n\t\tint dice;\r\n\t\tint diceTwo;\r\n\t\tint total;\r\n\r\n\t\t\r\n\r\n\t\tfor (int i = 0; i < 10000; i++) {\r\n\t\t\tdice = (int) (Math.random() * 6) + 1;\r\n\t\t\tdiceTwo = (int) (Math.random() * 6) + 1;\r\n\t\t\ttotal = dice + diceTwo; \r\n\t\t\tif (total == 2) {\r\n\r\n\t\t\t\ttotals[0]++;\r\n\t\t\t}\r\n\r\n\t\t\telse if (total == 3) {\r\n\r\n\t\t\t\ttotals[1]++;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (total == 4) {\r\n\r\n\t\t\t\ttotals[2]++;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (total == 5) {\r\n\r\n\t\t\t\ttotals[3]++;\r\n\t\t\t}\r\n\t\t\telse if (total == 6) {\r\n\r\n\t\t\t\ttotals[4]++;\r\n\t\t\t}\r\n\t\t\telse if (total == 7) {\r\n\r\n\t\t\t\ttotals[5]++;\r\n\t\t\t}\r\n\t\t\telse if (total == 8) {\r\n\r\n\t\t\t\ttotals[6]++;\r\n\t\t\t}\r\n\t\t\telse if (total == 9) {\r\n\r\n\t\t\t\ttotals[7]++;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (total == 10) {\r\n\r\n\t\t\t\ttotals[8]++;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if (total == 11) {\r\n\r\n\t\t\t\ttotals[9]++;\r\n\t\t\t}\r\n\t\t\telse if (total == 12) {\r\n\r\n\t\t\t\ttotals[10]++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(\"Total - Number of Rolls\");\r\n\t\tSystem.out.println(\"2 \" + totals[0] );\r\n\t\tSystem.out.println(\"3 \" + totals[1] );\r\n\t\tSystem.out.println(\"4 \" + totals[2] );\r\n\t\tSystem.out.println(\"5 \" + totals[3] );\r\n\t\tSystem.out.println(\"6 \" + totals[4] );\r\n\t\tSystem.out.println(\"7 \" + totals[5] );\r\n\t\tSystem.out.println(\"8 \" + totals[6] );\r\n\t\tSystem.out.println(\"9 \" + totals[7] );\r\n\t\tSystem.out.println(\"10 \" + totals[8] );\r\n\t\tSystem.out.println(\"11 \" + totals[9] );\r\n\t\tSystem.out.println(\"12 \" + totals[10] );\r\n\t}", "public int roll() {\n\t\treturn 3;\n\t}", "public Dice() {\n\t\td1 = 0;\n\t\td2 = 0;\n\t}", "private static byte roll6SidedDie() {\n\t\tint test = (int)Math.floor(Math.random() * 6) + 1;\n\t\tbyte roll = (byte)test;\n\t\treturn roll;\n\t}", "public static int rollFairDie(){\n\t\t\n\t\tdouble rand = Math.random();\n\t\tint roll = (int) (rand * 6); // [0,5] what above code does.\n\t\treturn roll + 1;\n\t}", "public void roll ()\n {\n //sets faceValue to an int between 1 - numFaces (both inclusive)\n faceValue = (int)(Math.random() * numFaces + 1);\n }", "public void reRoll() {\n this.result = this.roll();\n this.isSix = this.result == 6;\n }", "public void setDice(int faceValue1, int faceValue2) {\n boardController.setDice(faceValue1, faceValue2);\n }", "private void nextTurnRoll() {\n Log.d(\"nextTurnRoll\", \"next player please roll\");\n m_currentTurn++;\n if(m_currentTurn >= m_numPlayers){\n m_currentTurn = 0;\n }\n convertTextToSpeech(players.get(m_currentTurn).getName() + \"please roll the dice\");\n }", "public int rollNumber() throws ClientException{\n\t\t//if(canRollNumber()){\n\t\t\thasRolled = true;\n\t\t\tRandom rand = new Random();\n\t\t\tint roll = rand.nextInt(6)+1;\n\t\t\troll += rand.nextInt(6)+1;\n\t\t\treturn roll == 7 ? 6:roll;\n\n\t}", "RollingResult roll(Player player);", "public void roll() { \n this.value = (int)(Math.random() * this.faces()) + 1; \n }", "public void roll(boolean [] which){\n for(int i = 0; i < HAND_SIZE; ++i){\n if(which[i]){\n dice[i].roll();\n }\n }\n }", "public int roll(int roll) {\n \t\tappendAction(R.string.player_roll, Integer.toString(roll));\n \t\tboard.roll(roll);\n \n \t\treturn roll;\n \t}", "public void setDice(int faceValue1, int x1, int y1, int faceValue2,\n int x2, int y2) {\n boardController.setDice(faceValue1, x1, y1, faceValue2, x2, y2);\n }", "public String rollResult() {\n\t\treturn String.format(\"Your rolled a %s and a %s, giving a sum of %s\", die1.getFaceValue(), die2.getFaceValue(),\n\t\t\t\tsumOfDies());\n\t}", "public static void playGame(String player1, String player2 ) {\n // no need for an iterator, as with random rollDice we never run out of values\n int player1Dice;\n int player2Dice;\n\n do {\n // no need for the other player.dice != 0 condition because of the correct dice roll simulation that never returns 0\n // player 1 roll\n player1Dice = rollDice();\n System.out.print(player1 + \" rolled \" + player1Dice + \", \");\n // player 2 roll\n player2Dice = rollDice();\n System.out.println(player2 + \" rolled \" + player2Dice);\n } while(isDraw(player1Dice, player2Dice));\n\n // announcing a winner (no draw here, because we never get out of dice rolls)\n if(player1Dice > player2Dice) {\n System.out.println(\"Round over. \" + player1 + \" is the winner\");\n } else if(player2Dice > player1Dice){\n System.out.println(\"Round over. \" + player2 + \" is the winner\");\n }\n }", "private void rollDice(){\n int rollNumber=rng.nextInt(6)+1;\n //int rollNumber=5;\n switch(rollNumber) {\n case 1:\n dice_picture.setImageResource(R.drawable.one);\n break;\n case 2:\n dice_picture.setImageResource(R.drawable.two);\n break;\n case 3:\n dice_picture.setImageResource(R.drawable.three);\n break;\n case 4:\n dice_picture.setImageResource(R.drawable.four);\n break;\n case 5:\n dice_picture.setImageResource(R.drawable.five);\n break;\n case 6:\n dice_picture.setImageResource(R.drawable.six);\n break;\n default:\n }\n\n move(rollNumber);\n }", "public static int OneDice( int rTotal ) // Static method\n {\n \tint rollTotal = rTotal;\n \treturn rollTotal * 2;\n }", "public int rollDice(int amount) {\r\n int randomNum = ThreadLocalRandom.current().nextInt(1, amount + 1);\r\n return randomNum;\r\n }", "@Override\n public void run() {\n n =r.nextInt(6)+1;\n rollDieFace(n);\n }", "private void roll() {\n value = (int) (Math.random() * MAXVALUE) + 1;\n }", "public void setPlayerRoll10()\r\n {\r\n \r\n roll1 = ((int)(Math.random() * 100) % HIGHEST_DIE_VALUE10 + LOWEST_DIE_VALUE10);\r\n }", "public void rollDice() {\n try {\n if (numOfDices != Integer.parseInt(numOfDicesText.getText().toString())) {\n init();\n }\n }\n catch (Exception e) {\n System.out.println(e);\n numOfDicesText.setText(\"1\");\n init();\n }\n int rolledNumber;\n for (int i = 0; i < numOfDices; i++) {\n rolledNumber = dices.get(i).roll();\n textViews.get(i).setText(\"Dice \" + (i+1) + \" rolled a \" + rolledNumber);\n imageViews.get(i).setImageBitmap(DiceImages.getImage(rolledNumber));\n }\n }", "public void setDice(int faceValue1, int rotation1, int faceValue2, int rotation2) {\n boardController.setDice(faceValue1, rotation1, faceValue2, rotation2);\n }", "public int getDice(){\n\t\treturn diceValue;\n\t\t\n\t}" ]
[ "0.7819411", "0.78117454", "0.7642116", "0.75803536", "0.7529968", "0.73638344", "0.71493125", "0.70836896", "0.7081325", "0.70570517", "0.70195234", "0.70057267", "0.6991893", "0.6988611", "0.69662887", "0.69522464", "0.6942807", "0.6934831", "0.6907386", "0.6904062", "0.68994224", "0.6889693", "0.6851368", "0.6835737", "0.6833421", "0.68309337", "0.6790052", "0.6743078", "0.67087924", "0.6708213", "0.66458005", "0.6637251", "0.66343933", "0.6596554", "0.6579494", "0.65670234", "0.65553164", "0.6524962", "0.6521289", "0.651594", "0.6506333", "0.6504375", "0.6504335", "0.64934045", "0.64858526", "0.6476421", "0.6459881", "0.6451683", "0.64318764", "0.6412396", "0.63725585", "0.635135", "0.6300052", "0.6284857", "0.62423193", "0.6233539", "0.62294453", "0.62290466", "0.6219858", "0.6219661", "0.6212018", "0.621058", "0.6196384", "0.61841977", "0.61739194", "0.61683506", "0.61272424", "0.6098796", "0.6086761", "0.60801333", "0.6051077", "0.6046891", "0.60233164", "0.601281", "0.5998637", "0.59892905", "0.59728354", "0.5958833", "0.59534633", "0.59443545", "0.59438944", "0.59413284", "0.5939854", "0.59139824", "0.5911271", "0.59038377", "0.58803385", "0.5873654", "0.5859292", "0.5852166", "0.58316845", "0.58250827", "0.5822227", "0.5801364", "0.57990706", "0.57988036", "0.5765072", "0.5751317", "0.5746609", "0.5730677" ]
0.802979
0
This method sends a chat to the server
void sendChat(SendChatParam param);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void sendChat(String message) {\r\n connection.chat(message);\r\n }", "public void doSendMsg() {\n FacesContext fctx = FacesContext.getCurrentInstance();\n HttpSession sess = (HttpSession) fctx.getExternalContext().getSession(false);\n SEHRMessagingListener chatHdl = (SEHRMessagingListener) sess.getAttribute(\"ChatHandler\");\n if (chatHdl.isSession()) {\n //TODO implement chat via sehr.xnet.DOMAIN.chat to all...\n if (room.equalsIgnoreCase(\"public\")) {\n //send public inside zone\n chatHdl.sendMsg(this.text, SEHRMessagingListener.PUBLIC, moduleCtrl.getLocalZoneID(), -1, -1);\n } else {\n chatHdl.sendMsg(this.text, SEHRMessagingListener.PRIVATE_USER, moduleCtrl.getLocalZoneID(), -1, curUserToChat.getUsrid());\n }\n this.text = \"\";\n }\n //return \"pm:vwChatRoom\";\n }", "public void sendChat(String s) {\n ACLMessage m = new ACLMessage(briscola.common.ACLCodes.ACL_CHAT);\n m.setConversationId(getChatID());\n m.setContent(s);\n if (players == null) {\n say(\"Nessun giocatore in lista\");\n } else {\n for (Player p : players) {\n m.addReceiver(p.getAID());\n }\n send(m);\n }\n }", "public void sendChatMessage(String chatMessage) throws IOException {\r\n\t\tif (chatMessage.length() > 2\r\n\t\t\t\t&& chatMessage.substring(0, 2).equals(\"/w \")) { //$NON-NLS-1$\r\n\t\t\tchatMessage = \"/w [\" + client.getUsername() + \"]: \" //$NON-NLS-1$ //$NON-NLS-2$\r\n\t\t\t\t\t+ chatMessage.substring(3);\r\n\t\t} else {\r\n\t\t\tchatMessage = \"[\" + client.getUsername() + \"]: \" + chatMessage; //$NON-NLS-1$ //$NON-NLS-2$\r\n\t\t}\r\n\t\tsendMessage(new Message(chatMessage, client.getID()));\r\n\t}", "public void clientToServerChatMessage(String message){\n String chatMessage = message;\n System.out.println(\"chatmessage\" + chatID + \" \" + chatMessage);\n toServer.println(\"chatmessage\" + chatID + \" \" + chatMessage);\n toServer.flush();\n }", "public void sendChat(String message) {\n\t\tenqueue(\"PRIVMSG #\"+Executable.targetChannel+\" :imGlitch \"+message);\n\t}", "public boolean sendChatRequest(String to) {\r\n\t\t\r\n\t\tString message= \"102&\"+to;\r\n\t\tsendDatagramPacket(message);\r\n\t\tthis.chatReceiver = new User();\r\n\t\tthis.chatReceiver.setNick(to);\r\n\t\t\r\n\t\treturn true;\r\n\t}", "@OnClick(R.id.enter_chat1)\n public void sendMessage() {\n if (getView() == null) {\n return;\n }\n EditText editText = getView().findViewById(R.id.chat_edit_text1);\n sendMessageBackend(editText.getText().toString(), utils.getChatUser());\n updateListAdapter();\n editText.setText(\"\");\n }", "public void sendMsgToClient() {\n\n try {\n\n writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(socket.getOutputStream())), true);\n\n Log.d(TAG, \"The transmitted data:\" + msg);\n\n writer.println(msg);\n\n } catch (Exception e) {\n\n e.printStackTrace();\n\n }\n\n }", "public void sendChat(String client, String message) {\n\t\t//enqueue(\"PRIVMSG #\"+myself+\" :.w \"+client + \" imGlitch \" + message); //whisper\n\t\tenqueue(\"PRIVMSG #\"+Executable.targetChannel+\" :imGlitch (@\"+client + \") \" + message);\n\t}", "@Override\n public boolean sendMessage(ChatMessage chatMessage){\n return true;\n }", "@Override\r\n\t\t\tpublic void onChat(String message) {\n\r\n\t\t\t}", "public void chat ( String message ) {\n\t\texecute ( handle -> handle.chat ( message ) );\n\t}", "private void sendMessage(String content, String room) {\n }", "private void sendTextMessage(String message) {\n if ( message == null || message.length() < 1 ) {\n return;\n }\n DateFormat localDateFormat = Constant.getServerDateFormat();\n Chat chat = new Chat(0,tournamentID,clubID,receiverID, selfID,self.getDisplayName(),\n Constant.MESSAGE_TYPE_TEXT,message,localDateFormat.format(new Date()));\n RequestAction actionPostChatText = new RequestAction() {\n @Override\n public void actOnPre() {\n et_message.setText(\"\");\n }\n\n @Override\n public void actOnPost(int responseCode, String response) {\n if ( responseCode == 201 ) {\n Log.d(TAG,\"Message sent successfully!\");\n }\n }\n };\n String url;\n if ( tournament != null ) { // tournament chat\n url = UrlHelper.urlChatByTournament(tournament.id,club.id);\n } else if ( club != null ) {// club chat\n url = UrlHelper.urlChatByClub(club.id);\n } else if ( receiver != null ) { // private chat\n url = UrlHelper.urlPrivateChat(receiver.getId());\n } else {\n Toast.makeText(getContext(), \"Unknown error!\", Toast.LENGTH_SHORT).show();\n Log.e(TAG,\"Unspecified chat type.\");\n return;\n }\n RequestHelper.sendPostRequest(url,chat.toJson(),actionPostChatText);\n }", "public void requestChat(String otherUsername) {\n System.out.println(\"Requesting chat with \" + otherUsername);\n toServer.println(\"newchat\" + \" \" + username + \" \" + otherUsername);\n toServer.flush();\n }", "public String sendChat(SendChat sendChat) throws Exception {\n\t\tString url = server_url + \"/moves/sendChat\";\n\t\tURL obj = new URL(url);\n\t\tHttpURLConnection con = (HttpURLConnection) obj.openConnection();\n\n\t\t//add request header\n\t\tcon.setRequestMethod(\"POST\");\n\t\tcon.setRequestProperty(\"User-Agent\", \"Mozilla/5.0\");\n\t\tcon.setRequestProperty(\"Accept-Language\", \"en-US,en;q=0.5\");\n\t\tcon.setRequestProperty(\"Cookie\", usercookie + \"; \" + gamecookie);\n\t\t\n\t\tJsonObject info = new JsonObject();\n\t\tinfo.addProperty(\"type\",\"sendChat\");\n\t\tinfo.addProperty(\"playerIndex\", sendChat.playerIndex);\n\t\tinfo.addProperty(\"content\", sendChat.content);\n\t\t\n\t\t// Send post request\n\t\tcon.setDoOutput(true);\n\t\tDataOutputStream wr = new DataOutputStream(con.getOutputStream());\n\t\twr.writeBytes(info.toString());\n\t\twr.flush();\n\t\twr.close();\n\n\t\tint responseCode = con.getResponseCode();\n\t\t//System.out.println(\"\\nSending 'POST' request to URL : \" + url);\n\t\t//System.out.println(\"Post parameters : \" + info.toString());\n\t\t//System.out.println(\"Response Code : \" + responseCode);\n\n\t\tif (responseCode == 400) {\n\t\t\tthrow new Exception();\n\t\t}\n\t\t\n\t\tBufferedReader in = new BufferedReader(\n\t\t new InputStreamReader(con.getInputStream()));\n\t\tString inputLine;\n\t\tStringBuffer response = new StringBuffer();\n\n\t\twhile ((inputLine = in.readLine()) != null) {\n\t\t\tresponse.append(inputLine);\n\t\t}\n\t\tin.close();\n\t\t\n\t\treturn response.toString();\n\t}", "@Override\n\tpublic void run() {\n\t\tInetSocketAddress remoteAddr = (InetSocketAddress) socket.getRemoteSocketAddress();\n\t\tChatServer.log(\"[server] connected by client[\" + remoteAddr.getAddress().getHostAddress() + \":\" + remoteAddr.getPort());\n\t\t\n\t\ttry {\n\t\t\t//2. 스트림 얻기\n\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(socket.getInputStream(), \"utf-8\"));\n\t\t PrintWriter writer = new PrintWriter(new OutputStreamWriter(socket.getOutputStream() ,\"utf-8\"),true);\n\t\t \n\t\t while(true) {\n\t\t \tString request = reader.readLine();\n\t\t \tSystem.out.println(request);\n\t\t \tif(request == null) {\n\t\t \t\tChatServer.log(\"클라이언트로 부터 연결 끊김\");\n\t\t \t\tbreak;\n\t\t \t}\n\t\t \tString[] tokens = request.split(\":\");\n\t\t \t// Join:둘리 일때 - 0은 Join 1은 둘리\n\t\t \tif(\"join\".equals(tokens[0])) {\n\t\t \t\tnickname = tokens[1]; \n\t\t \t\tdoJoin(nickname + \"님이 입장하였습니다.\", writer);\n\t\t \t}else if(\"message\".equals(tokens[0])) {\n\t\t \t\t\n\t\t \t\tdoMessage(nickname + \":\" + tokens[1] );\n\t\t \t}else if(\"quit\".equals(tokens[0])) {\n\t\t \t\tdoQuit(nickname + \"님이 퇴장하였습니다.\", writer);\n\t\t \t}else {\n\t\t \t\tChatServer.log(\"에러: 알수 없는 요청(\" + tokens[0] + \")\");\n\t\t \t}\n\t\t }\n\t\t\n\t\t} catch (SocketException e) {\n\t\t\tChatServer.log(nickname);\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void sendMessage()\r\n {\r\n MessageScreen messageScreen = new MessageScreen(_lastMessageSent);\r\n pushScreen(messageScreen);\r\n }", "private void sendMessage() {\n\t\tString text = myMessagePane.getText();\n\t\tMessage msg = new Message(text, myData.userName, myData.color);\n\n\t\tcommunicationsHandler.send(msg);\n\n\t\t// De-escape xml-specific characters\n\t\tXmlParser xmlParser = new XmlParser(myData);\n\t\tString outText = xmlParser.deEscapeXMLChars(msg.text);\n\t\tmsg.text = outText;\n\n\t\tmyMessagePane.setText(\"\");\n\t\tupdateMessageArea(msg);\n\n\t}", "void sendMessage(String msg);", "public void chatMsg(String msg)\n\t{\n\t\tchatArea.append(msg + \"\\n\");\n\t}", "public void send(int messageType)\n {\n //CHAT message: sends the message\n //CONNECT message: sends the message\n //DISCONNECT message: sends the message, then closes application\n //USER_LIST message: client can't send a user list message\n try\n {\n switch(messageType)\n {\n case Message.CHAT:\n //Split text into receiver and message text\n String completeText = ChatGUI.getInstance().getMessageField().getText();\n String receiver = completeText.startsWith(\"@\") ? completeText.substring(1, completeText.indexOf(\" \")) : null;\n String text = completeText.startsWith(\"@\") ? completeText.substring(completeText.indexOf(\" \") + 1): completeText;\n \n //Validate message receiver\n if(nickname.equals(receiver))\n ChatGUI.getInstance().getChatHistory().append(\"YOU (TO YOU): \" + text + \"\\n\");\n else if(!allUsers.contains(receiver) && receiver != null)\n ChatGUI.getInstance().getChatHistory().append(\"SYSTEM: this user isn't connected\\n\");\n else\n {\n ChatMessage cmsg = new ChatMessage(nickname, receiver, text);\n \n if(receiver == null)\n ChatGUI.getInstance().getChatHistory().append(\"YOU (TO ALL): \" + text + \"\\n\");\n else\n ChatGUI.getInstance().getChatHistory().append(\"YOU (TO \" + receiver + \"): \" + text + \"\\n\");\n\n outputStream.writeBytes(gson.toJson(cmsg) + \"\\n\");\n }\n break;\n case Message.CONNECT:\n ConnectMessage comsg = new ConnectMessage(ChatGUI.getInstance().getLoginField().getText());\n outputStream.writeBytes(gson.toJson(comsg) + \"\\n\");\n break;\n case Message.DISCONNECT:\n DisconnectMessage dmsg = new DisconnectMessage(nickname);\n outputStream.writeBytes(gson.toJson(dmsg) + \"\\n\");\n close();\n break;\n }\n } \n catch (IOException e)\n {\n System.out.println(e.getMessage());\n }\n }", "boolean processChatCmd( String s )\n\t{\n\t\t\n\t\tman.getOpponent(this).out.println(s);\n\t\tman.getOpponent(this).out.flush();\n\t\tout.println(\"Message sent.\");\n\t\tout.flush();\n\t\treturn true;\n\t}", "public void sendMessageToAll(String msg) {\n try {\n if (socket == null){\n JOptionPane.showMessageDialog(null, \"SSLSocket is not connected to server. Connect before sending message.\",Env.ChatClientMessageBoxTitle, JOptionPane.ERROR_MESSAGE);\n return;\n }\n PrintWriter writer = new PrintWriter(new OutputStreamWriter(socket.getOutputStream(), \"UTF-8\"), true);\n writer.println(passUtil.toHexString(\"msg|split|\" + user.getUsername() + \"|split|\" + msg));\n writer.flush();\n chatClientController.appendToPane(new Date(System.currentTimeMillis()) + \": You (\" + user.getUsername() + \"): \" + msg , \"BLUE\", null);\n } catch (Exception ex){\n ex.printStackTrace();\n if (ex.toString().toLowerCase().contains(\"socket output is already shutdown\")){\n disconnectFromServer(false);\n }\n JOptionPane.showMessageDialog(null, \"Error sending message: \" + ex.toString(),Env.ChatClientMessageBoxTitle, JOptionPane.ERROR_MESSAGE);\n }\n }", "private void sendMessage(String message){\n try{\n output.writeObject(nickname+\" : \" + message);\n output.flush();\n showMessage(\"\\n\"+nickname+\" : \" + message);\n }catch(IOException ioException){\n chatWindow.append(\"\\n Oops! Something went wrong!\");\n }\n }", "private void sendMessage(String message){\n\t\ttry{\n\t\t\toutput.writeObject(\"Punk Ass Server: \" + message);\n\t\t\toutput.flush();\n\t\t\tshowMessage(\"\\nPunk Ass Server: \" + message); \n\t\t}catch(IOException ioe){\n\t\t\tchatWindow.append(\"\\n Message not sent, try again or typing something else\");\n\t\t\t\n\t\t}\n\t\t\n\t}", "Boolean sendMsg(String token, Long chatSessionId, String Content);", "void sendMessage(ChatMessage msg) {\n\t\ttry {\n\t\t\tsOutput.writeObject(msg);\n\t\t}\n\t\tcatch(IOException e) {\n\t\t\tdisplay(\"Não foi possível enviar a mesagem !!!\");\n\t\t}\n\t}", "public void sendMessage(ChatMessage msg) {\n\t\ttry {\n\t\t\tsOutput.writeObject(msg);\n\t\t}\n\t\tcatch(IOException e) {\n\t\t\tdisplay(\"Exception writing to server: \" + e);\n\t\t}\n\t}", "private void sendMessage(ChatMessage msg) {\n try {\n sOutput.writeObject(msg);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public static void sendChatMessage(Player toSend, byte chatType, String message){\n ChatComponentText chat = new ChatComponentText(message);\n\n PacketPlayOutChat packet = new PacketPlayOutChat(chat, chatType);\n ((CraftPlayer) toSend).getHandle().playerConnection.sendPacket(packet);\n }", "private void ChatNachricht() {\n\t\t//Kein leerer Text\n\t\tif (this.chatSendenArea.getText() != null) {\n\t\t\ttry {\n\t\t\t\tserver.sendChatMessage(\"Spieler \" + this.spielerNummer + \":\"\n\t\t\t\t\t\t+ this.chatSendenArea.getText());\n\t\t\t\tthis.chatSendenArea.setText(\"\");\n\t\t\t} catch (RemoteException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) {\n\n System.out.println(\"Hi. This is a greeting.\");\n Scanner scanner = new Scanner(System.in);\n\n String name = \"\";\n String address = \"localhost\";\n int portNum = 1500;\n\n if (args.length == 1)\n name = args[0];\n else {\n System.out.print(\"Please type a username. \");\n name = scanner.nextLine();\n }\n if (args.length == 2){\n name = args[0];\n try {\n portNum = Integer.parseInt(args[1]);\n } catch (Exception e) {\n System.out.println(\"Invalid port number!\");\n return;\n }\n }\n if (args.length == 3){\n address = args[2];\n try {\n portNum = Integer.parseInt(args[1]);\n } catch (Exception e) {\n System.out.println(\"Invalid port number!\");\n return;\n }\n name = args[0];\n }\n\n\n // Create your client and start it\n ChatClient client = new ChatClient(address, portNum, name);\n if (!client.start()) {\n return;\n }\n\n\n // Send an empty message to the server\n\n while (true) {\n String message = scanner.nextLine();\n message = message.toLowerCase();\n if (message.contains(\"/ttt\")) {\n String[] messageArray = message.split(\" \");\n if (messageArray.length <= 1) {\n System.out.println(\"Dude do this right!!!\");\n continue;\n }\n if(messageArray[1].equals(name)) {\n System.out.println(\"Error.\");\n continue;\n }\n client.sendMessage(new ChatMessage(ChatMessage.TICTACTOE,message, messageArray[1]));\n\n\n /// /tt <recipent> <placement>\n\n\n } else if (message.equals(\"/logout\")){\n client.sendMessage(new ChatMessage(ChatMessage.LOGOUT, \" \" + name + \" disconnected\", name));\n client.close();\n break;\n\n } else if (message.equals(\"/list\")) {\n// System.out.println(name + \"requested a list of users.\");\n client.sendMessage(new ChatMessage(ChatMessage.LIST, \" \",name));\n\n } else if (message.contains(\"/msg\")){\n String[] messageArray = message.split(\" \");\n if(messageArray[1].equals(name)) {\n System.out.println(\"Error. You cannot slide into your own DM.\");\n }\n\n else {\n int index = message.indexOf(messageArray[2]);\n client.sendMessage(new ChatMessage(ChatMessage.DM, message.substring(index), messageArray[1]));\n }\n } else {\n client.sendMessage(new ChatMessage(ChatMessage.MESSAGE, message, name));\n }\n }\n }", "private void sendMyMessage(JSONObject jsonMsg) {\n String link = \"http://\"+ip+\":8065/api/v1/channels/\"+channel_id+\"/create\";\n String response;\n try{\n ConnectAPIs messageAPI = new ConnectAPIs(link,token);\n messageAPI.sendComment(jsonMsg,this,this);\n }catch(Exception e){\n System.out.println(\"Sending error: \" + e.toString());\n }\n }", "public void onlinerequest() {\r\n int size = Server.getUsers().size();\r\n \r\n try {\r\n this.output.flush();\r\n this.output.writeUTF(\"ONLINE\");\r\n this.output.flush();\r\n this.output.writeUTF(Integer.toString(size));\r\n this.output.flush();\r\n// Log.print(\"Sending the data\");\r\n for(int x = 0; x < Server.getUsers().size(); x++){\r\n if(Server.getUsers().get(x).getName().equals(this.name)){\r\n this.output.writeUTF(Server.getUsers().get(x).getName() + \" (You)\");\r\n }\r\n else{\r\n this.output.writeUTF(Server.getUsers().get(x).getName());\r\n this.output.flush();\r\n }\r\n \r\n \r\n }\r\n// Log.print(\"Successfully sent\");\r\n } catch (IOException ex) {\r\n Log.error(ex.getMessage());\r\n }\r\n }", "public void sendMessage(String message);", "public void sendMessage(ChatMessage msg) {\n try{\n loginOutput.writeObject(msg);\n }\n catch(IOException e){\n display(\"Exception on send message to server: \" + e);\n }\n }", "@Override\n\tpublic void onSendChatDone(byte arg0) {\n\t\t\n\t}", "public void sendChannelMessage(String msg) throws RemoteException {\n if(mService.isConnected()) {\n try {\n IJumbleService binder = mService.getBinder();\n\n int channelId = mService.getBinder().getSessionChannel().getId();\n binder.sendChannelTextMessage(channelId, msg, false);\n }\n catch(NullPointerException e) {\n Log.d(TAG, \"Unable to send command '\" + msg + \"': \" + e);\n }\n }\n }", "public void sendToServer(Message message){\n\t\ttry {\n\t\t\tSystem.out.println(message._sender+\" to \"+message._receiver+\": \"+message._message);\n\t\t\tFileUtils.writeLineInFile(message._sender+\" to \"+message._receiver+\": \"+message._message, new File(FileUtils.getSettingsProperty(\"path\")+\"/chatlog.txt\"));\n\t\t\t_outputStream.writeObject(message);\n\t\t\t_main._clientMenuController.updateChatlog();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void createNewChat() {\n if (advertisement.getUniqueOwnerID().equals(dataModel.getUserID())) {\n view.showCanNotSendMessageToYourselfToast();\n return;\n }\n\n dataModel.createNewChat(advertisement.getUniqueOwnerID(), advertisement.getOwner(), advertisement.getUniqueID(),\n advertisement.getImageUrl(), chatID -> view.openChat(chatID));\n }", "public void sendMessage(String s){\r\n\t\tsynchronized(msgToSend){ // synchronized to maintain thread-safety\r\n\t\t\tmsgToSend.append(s + \"\\n\");\r\n\t\t}\r\n\t}", "public void writeChatServerMessage(String message) {\n\t\tSystem.out.println(\"WRITING \" + message);\n\t\tif(m_chatSession != null)\n\t\t\tm_chatSession.write(message);\n\t}", "@Override\n\tpublic void sendMessage() {\n\t\t\n\t}", "void send(String message);", "private void showMessage() throws IOException {\n String msg = fromServer.readUTF();\n chatArea.append(msg + \"\\n\");\n // set the chat area always keep focus at bottom\n chatArea.setCaretPosition(chatArea.getDocument().getLength());\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n chat.receiveMessage();\n }", "private void sendMessage(ChatMessage msg) throws IOException {\n try {\n sOutput.writeObject(msg);\n } catch (IOException e) {\n sOutput.close();\n sInput.close();\n e.printStackTrace();\n }\n //sOutput.flush();\n }", "@Override\n\tpublic void doChat(LoginDetails loginDetails) {\n\tSystem.out.println(\"Boomer chat\");\t\n\t}", "public void send(Message msg);", "private void sendMessage(String message) {\n if (mChatService.getState() != BluetoothChatService.STATE_CONNECTED) {\n // Toast.makeText(this, R.string.not_connected, Toast.LENGTH_SHORT).show();\n return;\n }\n\n if (message.length() > 0) {\n byte[] send = message.getBytes();\n mChatService.write(send);\n mOutStringBuffer.setLength(0);\n\n }\n }", "public void sendMessage(String message) {}", "private void sendMessageToClient(String messageToClient){\n SwingUtilities.invokeLater(new Runnable() {\n @Override\n public void run() {\n output.println(\"\\n\" + \"Server: \" + messageToClient);\n output.flush();\n }\n });\n }", "public synchronized void broadcastMsg(String msg) {\n try (BufferedWriter bufferedWriter = new BufferedWriter(new OutputStreamWriter(\n new FileOutputStream(\"chatHistory.txt\", true)));) {\n bufferedWriter.append(msg).append(\"\\n\");\n } catch (IOException e) {\n LOG.error(\"Try save history to file\", e);\n e.printStackTrace();\n }\n\n for (ClientHandler clientHandler : clients) {\n clientHandler.sendMsg(msg);\n }\n }", "void sendMessage() {\n\n\t}", "private void individualSend(UserLogic t) {\n if(t != UserLogic.this && t != null && ((String)UI.getContacts().getSelectedValue()).equals(t.username)){\r\n if(((String)t.UI.getContacts().getSelectedValue()).equals(username)) { //If both users are directly communicating\r\n t.UI.getProperList().addElement(username + \"> \" + UI.getMessage().getText()); //Send message\r\n t.UI.getContacts().setCellRenderer(clearNotification); //Remove notification\r\n }\r\n else{ //If the user are not directly communicating\r\n t.UI.getContacts().setCellRenderer(setNotification); //Set notification\r\n }\r\n if(t.chats.containsKey(username)){ //Store chats in other users database (When database exists)\r\n ArrayList<String> arrayList = t.chats.get(username); //Get data\r\n arrayList.add(username + \"> \" + UI.getMessage().getText()); //Add new message to the database\r\n t.chats.put(username, arrayList); //Store data\r\n }\r\n else { //When database doesn't exist\r\n ArrayList<String> arrayList = new ArrayList<>(); //create new database\r\n arrayList.add(username + \"> \" + UI.getMessage().getText()); //Add new message to the database\r\n t.chats.put(username, arrayList); //Store data\r\n }\r\n }\r\n //This writes on my screen\r\n if(t == UserLogic.this && t!=null){ //On the current user side\r\n UI.getProperList().addElement(\"Me> \" + UI.getMessage().getText()); //Write message to screen\r\n String currentChat = (String) UI.getContacts().getSelectedValue(); //Get selected user\r\n if(chats.containsKey(currentChat)){ //check if database exists\r\n ArrayList<String> arrayList = chats.get(currentChat);\r\n arrayList.add(\"Me> \" + UI.getMessage().getText());\r\n chats.put(currentChat, arrayList);\r\n }\r\n else { //When database doesn't exist\r\n ArrayList<String> arrayList = new ArrayList<>();\r\n arrayList.add(\"Me> \" + UI.getMessage().getText());\r\n chats.put(currentChat, arrayList);\r\n }\r\n }\r\n }", "public void sendMessage(String msg) {\n try {\n out.write(msg);\n out.newLine();\n out.flush();\n \n } catch (IOException e) {\n \tshutdown();\n e.printStackTrace();\n }\n }", "public void talk() {\n\t try{\t\n\t \twhile(exit) {\n\t\t \t\t//Definizione stream per la comunicazione\n\t\t \t\ttastiera = new BufferedReader(new InputStreamReader(System.in));\n\t\t \t\tout = new DataOutputStream(connection.getOutputStream());\n\t\t\t\t in = new DataInputStream(connection.getInputStream());\n\t\t\t\t \n\t\t \t\t//Invio messaggio\n\t\t\t\t System.out.println(\"Inserisci il messaggio da mandare al server: \\n\");\n\t\t\t\t mess = tastiera.readLine();\n\t\t\t\t\tout.writeUTF(mess + \"\\n\");\n\t\t\t\t\t\n\t\t\t\t\t//Ricezione risposta server\n\t\t\t\t\tservermess = in.readUTF();\n\t\t\t System.out.println(\"Risposta dal server: \"+servermess);\n\t\t\t if(mess.equals(\"FINE\")) {\n\t\t\t \texit = false;\n\t\t\t }\n\t\t\t\t}\n\t\t }\n\t\t catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t }\n\t \tfinally {\n\t\t\t try {\n\t\t\t\t if (connection!=null)\n\t\t\t\t {\n\t\t\t\t connection.close();\n\t\t\t\t System.out.println(\"Connessione chiusa!\");\n\t\t\t\t }\n\t\t\t\t\t}\n\t\t\t catch(IOException e){\n\t\t\t System.err.println(\"Errore nella chiusura della connessione!\");\n\t\t\t }\n\t \t}\t\n \t}", "@Override\r\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tchat.append(s);\r\n\t\t\t\t\t}", "public void run(){\n\t\ttry{\n\t\t\t// Get client socket.\n\t\t\tSocket client = server.getClientSocket();\n\t\t\t// Get the inputstream from the socket\n\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(client.getInputStream()));\n\t\t\tString line;\n\t\t\twhile(true){\n\t\t\t\tif(client.isClosed()){\n\t\t\t\t\tSystem.out.println(\"The client is offline. Chat finished.\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tline= reader.readLine();\n\t\t\t\t\tif(line.equals(\"bye\")){\n\t\t\t\t\t\tSystem.out.println(line);\n\t\t\t\t\t\tSystem.out.println(\"Chat finished.\");\n\t\t\t\t\t\tclient.close();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tSystem.out.println(\"Client: \");\n\t\t\t\t\t\tSystem.out.println(line);\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}\n\t\t\t\n\t\t\treader.close();\n\t\t}catch(IOException e){\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "synchronized static void chat(String name, String message) throws IOException\n {\t \n PrintWriter pw;\n \n //prints message to the server console\n System.out.println(name + \" >> \" + message);\n \n //goes through each ChatClient stored in linkedList \n for (Object o : linkedList)\n {\n //casts object in linked list to a socket\n pw = new PrintWriter(((Socket) o).getOutputStream(), true);\n \n //prints ChatClient's name with message to all connected ChatClients\n //on ChatClient socket outputstream\n pw.println(name + \" >> \" + message);\n }\n }", "public void sendMessageXMPP(String message, String targetUser, MainActivity mainActivity) {\n ChatManager chatmanager = xmppConnection.getChatManager();\n Chat newChat = chatmanager.createChat(targetUser, new MessageListener(mainActivity));\n\n try {\n newChat.sendMessage(message);\n System.out.println(\"yohoo message sent\");\n// receiveMessage(connection);\n } catch (XMPPException e) {\n System.out.println(\"Error Delivering block\");\n System.out.println(\"----------sendMessageXMPP---------\" + e.getMessage());\n } catch (Exception e) {\n System.out.println(\"----------sendMessageXMPP---------\" + e.getMessage());\n }\n\n }", "private static void sendMessageToAll(Message msg) throws IOException, EncodeException {\n String jsonStr = JSON.toJSONString(msg);\n\n for (String key : onlineSessions.keySet()) {\n System.out.println(\"WebSocketChatServer - Message \" + jsonStr + \" sent to client with username \" + key + \" and session \" + onlineSessions.get(key));\n System.out.println(key + \" : \" + onlineSessions.get(key));\n try {\n onlineSessions.get(key).getBasicRemote().sendObject(msg);\n } catch (IOException | EncodeException error) {\n error.printStackTrace();\n }\n }\n }", "public void receive()\n {\n //Client receives a message: it finds out which type of message is and so it behaves differently\n //CHAT message: prints the message in the area\n //CONNECT message: client can't receive a connect message from the server once it's connected properly\n //DISCONNECT message: client can't receive a disconnect message from the server\n //USER_LIST message: it shows the list of connected users\n try\n {\n String json = inputStream.readLine();\n\n switch (gson.fromJson(json, Message.class).getType())\n {\n case Message.CHAT:\n ChatMessage cmsg = gson.fromJson(json, ChatMessage.class);\n\n if(cmsg.getReceiverClient() == null)\n ChatGUI.getInstance().getChatHistory().append(cmsg.getSenderClient() + \" (TO ALL): \" + cmsg.getText() + \"\\n\");\n else\n ChatGUI.getInstance().getChatHistory().append(cmsg.getSenderClient() + \" (TO YOU): \" + cmsg.getText() + \"\\n\");\n break;\n case Message.CONNECT:\n //Send login nickname and wait for permission to join\n //if message code is 1, nickname is a duplicate and must be changed, then login again\n //(send call is inside button event)\n ConnectMessage comsg = gson.fromJson(json, ConnectMessage.class);\n\n if(comsg.getCode() == 1)\n {\n //Show error\n ChatGUI.getInstance().getLoginErrorLabel().setVisible(true);\n }\n else\n {\n //Save nickname\n nickname = ChatGUI.getInstance().getLoginField().getText();\n\n //Hide this panel and show main panel\n ChatGUI.getInstance().getLoginPanel().setVisible(false);\n ChatGUI.getInstance().getMainPanel().setVisible(true);\n }\n break;\n case Message.USER_LIST:\n UserListMessage umsg2 = gson.fromJson(json, UserListMessage.class);\n fillUserList(umsg2);\n break;\n }\n } \n catch (JsonSyntaxException | IOException e)\n {\n System.out.println(e.getMessage());\n System.exit(1);\n }\n }", "public static void main(String[] args){\n\t\tint port = 6677;\n\t\tboolean done = false;\n\t\tboolean connected = false;\n\t\tboolean ourTurnToSend = true;\n\t\tString clientTextSent = new String();\n\t\tString emptyString = new String();\n\t\tString ip = new String(\"\");\n\t\tScanner in;\n\t\tScanner terminalText = new Scanner(System.in);\n\t\tPrintWriter out;\n\t\ttry{\n\t\t\tSocket chatSocket;\n\t\t\tchatSocket = new Socket(ip,3000);\n\t//------------------------------------------------------------------------I have a chat socket, HOHOHO--------------------------\n\t\t\tin = new Scanner(chatSocket.getInputStream());\n\t\t\tout = new PrintWriter(chatSocket.getOutputStream());\n\t//------------------------------------------------------------------------Fully initialised, front-back chat possible------------\n\t\t\twhile(done == false){\n\t\t\t\tout.println(\"{\\\"PLAYER_NUMBER\\\":\\\"P1\\\",\\\"PROTOCOL\\\":\\\"PADDLE_MOVEMENT\\\",\\\"X\\\":-293.3333333333334,\\\"Y\\\":-230}\");out.flush();\n\t\t\t}\n\n\t\t}\n\t\tcatch(Exception e){\n\t\t\tSystem.out.println(\"Shit be whack Yo\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void sendPlayerChat1(String s) {\n\t\tc.getPA().sendFrame200(969, 591);\n\t\tc.getPA().sendFrame126(c.playerName, 970);\n\t\tc.getPA().sendFrame126(s, 971);\n\t\tc.getPA().sendFrame185(969);\n\t\tc.getPA().sendFrame164(968);\n\t}", "private void b_sendActionPerformed(java.awt.event.ActionEvent evt) { \r\n\t\tString nothing = \"\";\r\n\t\tif ((b_sendText.getText()).equals(nothing)) {\r\n\t\t\tb_sendText.setText(\"\");\r\n\t\t\tb_sendText.requestFocus();\r\n\t\t}\r\n\t\telse {\r\n\t\t\ttry {\r\n\t\t\t\ttellEveryone(\"Server\" + \":\" + b_sendText.getText() + \":\" + \"Chat\");\r\n\t\t\t\tPrint_Writer.flush(); // flushes the buffer\r\n\t\t\t} catch (Exception ex) {\r\n\t\t\t}\r\n\t\t\tb_sendText.setText(\"\");\r\n\t\t\tb_sendText.requestFocus();\r\n\t\t}\r\n\r\n\t\tb_sendText.setText(\"\");\r\n\t\tb_sendText.requestFocus();\r\n\r\n\t}", "public synchronized void send(final String _mes) {\r\n\t\t// new Thread(new Runnable() {\r\n\t\t// @Override\r\n\t\t// public void run() {\r\n\t\tif (!closed) {\r\n\t\t\toutput.write(_mes + \"\\r\\n\");\r\n\t\t\toutput.flush();\r\n\t\t}\r\n\t\t// }\r\n\t\t// }).run();\r\n\t}", "public void sendToServer(String msg) throws IOException {\n if (clientSocket == null || output == null) {\n throw new SocketException(\"socket does not exist\");\n }\n\n // messageQueue.offer(msg);\n // sendFromMessageQueue();\n \n // 發送中文\n byte[] bytes = msg.getBytes(\"big5\");\n int[] ints = new int[bytes.length];\n for (int i = 0, l = bytes.length; i < l; i++) {\n ints[i] = bytes[i] & 0xff;\n output.write(ints[i]);\n }\n output.writeBytes(\"\\n\");\n }", "@Override\n public void onClick(View v) {\n try {\n message = etMessage.getText().toString();\n if(mService != null){\n if (ouserStat){\n //dout.writeUTF(wUser + \"SendTo@*@~\" + message);\n mService.writeMessage(wUser + \"SendTo@*@~\" + message);\n etMessage.setText(\"\");\n talk.insert(\"I said : \" + message, 0);\n //talk.add(\"I said : \" + message);\n }\n else{\n mService.writeMessage(wUser + \"OfMsg@*@~\" + message);\n etMessage.setText(\"\");\n talk.insert(\"I said : \" + message + \" \\n(\" + wUser + \" is offline for now.\\n He'll receive ur message when he comes online.)\\n\", 0);\n //dout.writeUTF(to + \"OfMsg@*@~\"+message);\n }\n }\n else{\n talk.insert(\"Connection Problem.. Wait\", 0);\n //talk.add(\"Connection Problem.. Wait\");\n }\n } catch (IOException e) {\n e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.\n System.out.println(\"Ezio Problem Found in writing in Chat Fragment\");\n updateStatus(false);\n }\n }", "@FXML\n private void sendMessage(ActionEvent actionEvent) {\n String playerName = RiskMain.getInstance().getDomain().getPlayerName();\n System.out.println(messageInput.getText());\n String text = playerName + \": \" + messageInput.getText();\n if (RiskMain.getInstance().getDomain().isServer()) {\n this.serverInterface = RiskMain.getInstance().getDomain().getServer();\n this.serverInterface\n .sendMessageChat(RiskMain.getInstance().getDomain().getPlayerName(),\n messageInput.getText(), recipientList.getValue());\n } else {\n this.clientPlayerInterface = RiskMain.getInstance().getDomain().getClient();\n this.clientPlayerInterface.sendMessageChat(RiskMain.getInstance().getDomain().getPlayerName(),\n messageInput.getText(), recipientList.getValue());\n }\n }", "public void send(String command)\n {\n if (connected) { \n writer.println(command + \";\");\n }\n }", "@SuppressWarnings({ \"rawtypes\", \"unchecked\" })\n\t@NiftyEventSubscriber(id = \"chatText\")\n\tpublic void submitChatText(String id, NiftyInputEvent event){\n\t\tTextField tf = nifty.getScreen(\"hud\").findNiftyControl(\"chatText\",TextField.class);\n\t\tListBox lb = nifty.getScreen(\"hud\").findNiftyControl(\"listBoxChat\",ListBox.class);\n\t\tif (NiftyInputEvent.SubmitText.equals(event)) {\n\t\t\tString sendText = tf.getDisplayedText();\n\t\t\tif (sendText.length() == 0){\n\t\t\t\tnifty.getScreen(\"hud\").getFocusHandler().resetFocusElements();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttf.setText(\"\");\n\t\t\tif(observers.size()== 0){\n\t\t\t\tlb.addItem(sendText);\n\t\t\t}\n\t\t\tfor (GUIObserver g : observers) {\n\t\t\t\tg.onChatMessage(sendText);\n\t\t\t}\n\t\t\tnifty.getScreen(\"hud\").getFocusHandler().resetFocusElements();\n\t\t\tlb.showItem(lb.getItems().get(lb.getItems().size()-1));\n\t\t}\n\t}", "@Override\n public void sendChat(String message) throws ModelException {\n assert message != null;\n\n try {\n String clientModel = m_theProxy.sendChat(GameModelFacade.instance().getLocalPlayer().getIndex(), message);\n new ModelInitializer().initializeClientModel(clientModel, m_theProxy.getPlayerId());\n } catch (NetworkException e) {\n throw new ModelException(e);\n }\n }", "private void groupChatSend(UserLogic t) {\n if(((String) UI.getContacts().getSelectedValue()).equals( groupChat)){\r\n if (t != UserLogic.this && t != null) { //Sending to other users chat\r\n if(((String)t.UI.getContacts().getSelectedValue()).equals(groupChat)) {\r\n t.UI.getProperList().addElement(username + \"> \" + UI.getMessage().getText());\r\n t.UI.getContacts().setCellRenderer(clearNotification);\r\n }\r\n else{\r\n t.UI.getContacts().setCellRenderer(setNotification);\r\n }\r\n if(t.chats.containsKey(groupChat)){\r\n ArrayList<String> arrayList = t.chats.get(groupChat);\r\n arrayList.add(username + \"> \" + UI.getMessage().getText());\r\n t.chats.put(groupChat, arrayList);\r\n }\r\n else {\r\n ArrayList<String> arrayList = new ArrayList<>();\r\n arrayList.add(username + \"> \" + UI.getMessage().getText());\r\n t.chats.put(groupChat, arrayList);\r\n }\r\n }\r\n\r\n if(t == UserLogic.this && t!=null){ //Send to my screen\r\n UI.getProperList().addElement(\"Me> \" + UI.getMessage().getText());\r\n if(chats.containsKey(groupChat)){ //Database group chat exists\r\n ArrayList<String> arrayList = chats.get(groupChat);\r\n arrayList.add(\"Me> \" + UI.getMessage().getText());\r\n chats.put(groupChat, arrayList);\r\n }\r\n else {\r\n ArrayList<String> arrayList = new ArrayList<>();\r\n arrayList.add(\"Me> \" + UI.getMessage().getText());\r\n chats.put(groupChat, arrayList);\r\n }\r\n }\r\n }\r\n }", "public void SendToAll()\r\n {\r\n AlertDialog.Builder dialog=new AlertDialog.Builder(MainActivity.this);\r\n dialog.setTitle(\"Send Message To All Users\");\r\n dialog.setIcon(R.drawable.ic_action_send) ;\r\n dialog.setMessage(\"Enter your message :\") ;\r\n final EditText input =new EditText(this);\r\n input.setHint(\"Hi !\");\r\n dialog.setView(input) ;\r\n dialog.setPositiveButton(\"Send\", new DialogInterface.OnClickListener() {\r\n @Override\r\n public void onClick(DialogInterface dialog, int which) {\r\n if (!TextUtils.isEmpty(input.getText()))\r\n {\r\n firebaseUser=FirebaseAuth.getInstance().getCurrentUser() ;\r\n reference=FirebaseDatabase.getInstance().getReference(\"Users\");\r\n reference.addListenerForSingleValueEvent(new ValueEventListener() {\r\n @Override\r\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\r\n for (DataSnapshot snapshot:dataSnapshot.getChildren())\r\n {\r\n final Users users=snapshot.getValue(Users.class);\r\n if (!users.getId().equals(firebaseUser.getUid()))\r\n {\r\n Calendar calendar=Calendar.getInstance() ;\r\n SimpleDateFormat format=new SimpleDateFormat(\"HH:mm\") ;\r\n String time=format.format(calendar.getTime()) ;\r\n String key = reference.child(\"Chats\").push().getKey() ;\r\n HashMap<String,Object>hashMap=new HashMap<>();\r\n hashMap.put(\"sender\",firebaseUser.getUid());\r\n hashMap.put(\"receiver\",users.getId());\r\n hashMap.put(\"message\",input.getText().toString());\r\n hashMap.put(\"id\",key);\r\n hashMap.put(\"time\",time);\r\n hashMap.put(\"isseen\",false) ;\r\n reference=FirebaseDatabase.getInstance().getReference(\"Chats\") ;\r\n reference.child(key).setValue(hashMap) ;\r\n final DatabaseReference chatRef=FirebaseDatabase.getInstance().getReference(\"chatlist\").child(firebaseUser.getUid()).child(users.getId());\r\n chatRef.addListenerForSingleValueEvent(new ValueEventListener() {\r\n @Override\r\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\r\n if(!dataSnapshot.exists())\r\n {\r\n chatRef.child(\"id\").setValue(users.getId());\r\n }\r\n }\r\n\r\n @Override\r\n public void onCancelled(@NonNull DatabaseError databaseError) {\r\n\r\n }\r\n });\r\n }\r\n }\r\n }\r\n\r\n @Override\r\n public void onCancelled(@NonNull DatabaseError databaseError) {\r\n\r\n }\r\n });\r\n }\r\n\r\n }\r\n });\r\n dialog.setNegativeButton(\"cancel\", new DialogInterface.OnClickListener() {\r\n @Override\r\n public void onClick(DialogInterface dialog, int which) {\r\n dialog.cancel();\r\n }\r\n });\r\n dialog.show();\r\n }", "public static void startChatServer() {\n\t\tbyte[] buffer = new byte[1024];\n\t\tStreamConnectionNotifier cn = null;\n\t\ttry {\n\t\t\tLocalDevice local = LocalDevice.getLocalDevice();\n\t\t\tlocal.setDiscoverable(DiscoveryAgent.GIAC);\n\t\t\tcn = (StreamConnectionNotifier) Connector.open(INSECURE_URL);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\twhile (true) {\n\t\t\tOutputThread t = null;\n\t\t\tStreamConnection sock = null;\n\t\t\tInputStream is = null;\n\t\t\tOutputStream os = null;\n\t\t\ttry {\n\t\t\t\tSystem.out.println(\"accepting connection:\");\n\t\t\t\tsock = cn.acceptAndOpen();\n\t\t\t\tSystem.out.println(\"accept!: \" + Charset.defaultCharset());\n\t\t\t\tis = sock.openInputStream();\n\t\t\t\tos = sock.openOutputStream();\n\n\t\t\t\tt = new OutputThread(os);\n\t\t\t\tt.start();\n\n\t\t\t\twhile (t.isAlive()) {\n\t\t\t\t\t//TODO: use timeout read?\n\t\t\t\t\tint len = is.read(buffer);\n\t\t\t\t\t// printAsHex(buffer, len);\n\t\t\t\t\tif (len > 0) {\n\t\t\t\t\t\tSystem.out.println(\"received message(\" + len + \"): \" + new String(buffer, 0, len));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//TODO: check connection is live or not,\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} finally {\n\t\t\t\tt.interrupt();\n\t\t\t\tt = null;\n\t\t\t\ttry {\n\t\t\t\t\tsock.close();\n\t\t\t\t\tcn.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t//\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void SendMessage(String message) {\n\t\t\n\t\ttry\n\t\t{\n\t\tprintWriters.get(clients.get(0)).println(message);\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\n\t}", "public void getChatMessage(String text) {\n\t\tint idplayer = gamecontroller.getPlayerController().getPlayerID();\n\t\tChatM.writeChatToDatabase(idplayer, text);\n\t}", "private void sendMessage(String body, String toJid) {\n Log.d(TAG, \"Sending message to :\" + toJid);\n\n EntityBareJid jid = null;\n\n toJid = toJid + \"@\" + mApplicationContext.getString(R.string.txt_domain_name) + \"/\" + mApplicationContext.getString(R.string.txt_resource);\n ChatManager chatManager = ChatManager.getInstanceFor(mConnection);\n\n try {\n jid = JidCreate.entityBareFrom(toJid);\n Log.e(TAG, \"sendMessage: jid : \" + jid);\n } catch (XmppStringprepException e) {\n e.printStackTrace();\n }\n Chat chat = chatManager.chatWith(jid);\n try {\n Message message = new Message(jid, Message.Type.chat);\n message.setBody(body);\n chat.send(message);\n\n } catch (SmackException.NotConnectedException e) {\n e.printStackTrace();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "public void enableChat();", "public void sendMessage(String str) {\n\t\ttry {\n\t\t\tsession.getRemote().sendString(str);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void SendTextMessage(String text)\n\t{\n\t\tif(text.contains(\"/to\"))\n\t\t{\n\t\t\tMessageToUser m = new MessageToUser();\n\t\t\tm.Message = text.substring(text.lastIndexOf(\"\\\"\")+1);\n\t\t\tm.To = text.substring(text.indexOf(\"\\\"\") +1, text.lastIndexOf(\"\\\"\"));\n\t\t\t\n\t\t\t//ApplicationManager.textChat.write(m.To);\n\t\t\t///ApplicationManager.textChat.write(m.Message);\n\t\t\t\n\t\t\tSendMessage(m, MessageType.sendMessageToUser);\n\t\t}\n\t\telse\n\t\tSendMessage(text, MessageType.message);\n\t}", "public void receiveChatRequest() {\n\t\t\r\n\t\tString message = \"Chat request details\";\r\n\t\t\r\n\t\t//Notify the chat request details to the GUI\r\n\t\tthis.observable.notifyObservers(message);\r\n\t}", "@Override\n\tpublic void send(String msg) {\n\t\t\n\t\t\n\t\n\t}", "public static void sendMsg(String msg)\n throws IOException\n {\n if (streamOut == null)\n clientFrame.printMsg(\"Error: Not connected.\");\n else\n streamOut.write((msg + \"\\n\").getBytes());\n }", "public void writeMassege() {\n m = ChatClient.message;\n jtaChatHistory.setText(\"You : \" + m);\n //writeMassageServer();\n }", "private void sendMessage() throws Exception {\n\t\tGetTimestamp(\"Sending Message: \");\n\t\tString inputMessage;\n\t\tinputMessage = input.nextLine();\n\t\tString tosend = encrypt(clientkey, inputMessage);\n\t\t\n\t\tJSONObject RESPONSE = new JSONObject();\n\t\tRESPONSE.put(\"payload\",tosend);\n\t\tSystem.out.println(RESPONSE);\n\t\t\n\t\tpw.println(tosend);\n\t\tpw.flush();\n\t\tSystem.out.println(\"Message sent to the client : \" + inputMessage);\n\t\tif (inputMessage.equalsIgnoreCase(\"bye\")) {\n\t\t\tSystem.out.println(\"sending close command\");\n\t\t\tcloseConnection();\n\t\t} else {\n\t\t\tgetMessage();\n\t\t}\n\t}", "static void sendMsg(String msg){\r\n for(ServerThread t: threads){\r\n t.sendMsgToClient(msg);\r\n }\r\n }", "public void sendHelloMessage() {\n getSocketController().send(getMessageController().createHelloMessage(\"Сервер\", getUser().getName()));\n }", "@Override\r\n\tpublic void sendMessage(String message) {\n\t\t\r\n\t}", "public void login() {\r\n if (connected) {\r\n return;\r\n }\r\n try {\r\n sock = new Socket(\"localhost\", port);\r\n showStatus(\"CONNECTION DONE !!!\");\r\n reader = new BufferedReader(new InputStreamReader(sock.getInputStream()));\r\n writer = new PrintWriter(sock.getOutputStream(), true);\r\n } catch (IOException e) {\r\n System.err.println(e);\r\n }\r\n\r\n clientName = myText.getText();\r\n\r\n writer.println(\"? \" + clientName);\r\n connected = true;\r\n new Thread(new Runnable() {\r\n public void run() {\r\n String st;\r\n try {\r\n while (connected && ((st = reader.readLine()) != null)) {\r\n chat.append(st + \"\\n\");\r\n }\r\n } catch (IOException e) {\r\n showStatus(\"CONNECTION LOST !!!\");\r\n return;\r\n }\r\n }\r\n }).start();\r\n }", "public void sendMessage(CharSequence text, String conversation)\n {\n String user = currentUId();\n Map<String, Object> map = new HashMap<>();\n map.put(\"user\", user);\n map.put(\"time\", ServerValue.TIMESTAMP);\n map.put(\"text\", text.toString());\n Map<String, Object> read = new HashMap<>();\n read.put(user, true);\n map.put(\"read\", read);\n rootRef.child(\"messaging/\" + conversation).push().setValue(map, ServerValue.TIMESTAMP);\n }", "public void sendMessage(String content, String toUser) throws IOException, BadLocationException{\r\n\t\tdataSending.sendMessage(content, toUser);\r\n\t\tuserModel.getArchive().getArchiveWriter().addNewTalk(toUser,\"Messeage sent to user\" +toUser + System.lineSeparator() + content);\r\n\t\tclientView.addNewMesseage(content, \"sent to user: \"+toUser);\r\n\t\t\r\n\t}", "public void sendStatusToServer(String status){\n System.out.println(\"typingstatus\" + chatID + username + \" \" + status);\n toServer.println(\"typingstatus\"+ \" \" + chatID + \" \" + username + \" \" + status);\n toServer.flush();\n }", "public void sendmsg(String to, String msg){\n\n HashMap cur_hash = null;\n PrintWriter to_PW = null;\n\n try{\n synchronized (chat_room) {\n Iterator chat_hash = chat_room.values().iterator();\n while(chat_hash.hasNext()) {\n cur_hash = (HashMap)chat_hash.next();\n if(cur_hash.containsKey(to)) {\n to_PW = (PrintWriter)cur_hash.get(to);\n break;\n }\n }\n }\n \n if(to_PW != null){\n to_PW.println(msg);\n to_PW.flush();\n }\n } catch (Exception e) {\n System.out.println(e);\n } \n }", "@Override\n\tpublic void onChatReceived(ChatEvent arg0) {\n\t\t\n\t}", "public void processMessage(Chat chat, Message message)\n {\n }", "public void sendMessage() {\n String userMessage = textMessage.getText();\n if (!userMessage.isBlank()) {//проверяю а есть ли что то в текстовом поле\n textMessage.clear();//очищаю текстовое поле на форме\n\n //пока оставлю\n //sb.append(userMessage).append(\"\\n\");\n\n //в общее поле добавляю сообщение\n areaMessage.appendText(userMessage+\"\\n\");\n }\n\n }" ]
[ "0.7628014", "0.7407859", "0.71892", "0.71652734", "0.7069431", "0.695136", "0.6913647", "0.686098", "0.68382424", "0.68312824", "0.6799741", "0.6721857", "0.6697873", "0.6693136", "0.6648641", "0.6633893", "0.6626203", "0.6612095", "0.6609891", "0.65818286", "0.657663", "0.6576536", "0.65650564", "0.6540234", "0.65350497", "0.653175", "0.6463794", "0.6453236", "0.64517677", "0.64093554", "0.64062876", "0.6405193", "0.6399358", "0.63963896", "0.6393942", "0.63853705", "0.6383226", "0.63804793", "0.63724816", "0.6365649", "0.63566345", "0.63308424", "0.63302755", "0.6328809", "0.6315443", "0.6312941", "0.63128483", "0.63107073", "0.6309375", "0.62901914", "0.62879753", "0.6284648", "0.62834233", "0.6276846", "0.6275551", "0.62559795", "0.62480456", "0.6237961", "0.6226404", "0.6217919", "0.62059605", "0.6203953", "0.62023556", "0.6198519", "0.6194901", "0.6187808", "0.6180675", "0.6163604", "0.6161479", "0.6158821", "0.6153997", "0.61477095", "0.6142793", "0.61422133", "0.61409986", "0.61403006", "0.61397094", "0.61369187", "0.6133915", "0.61324", "0.6123043", "0.61202985", "0.6100553", "0.6089033", "0.6086959", "0.60771096", "0.6072542", "0.6069607", "0.6064913", "0.606428", "0.60626024", "0.60451657", "0.60439277", "0.6038716", "0.60343313", "0.60318834", "0.60316724", "0.6028395", "0.60272765", "0.60264874" ]
0.7444409
1
This method accepts or declines a trade
void acceptTrade(boolean accept);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void acceptTrade(boolean willAccept) {\n\t\t\r\n\t}", "@Override\n\tpublic void satisfyTrade(TickEvent<Trade> tradeEvent) throws TradeException {\n\n\t}", "boolean canAcceptTrade();", "@Override\r\n\tpublic void onTrade(Trade trade) throws Exception {\n\t\t\r\n\t}", "void confirmRealWorldTrade(IUserAccount user, ITransaction trans);", "public boolean recordTrade(Trade trade) throws Exception;", "public boolean trade(Type type, int[] trade) {\n \t\t// validate trade\n \t\tif (!canTrade(type, trade))\n \t\t\treturn false;\n \n \t\t// check for 2:1 trader\n \t\tfor (int i = 0; i < trade.length; i++) {\n \t\t\tif (Hexagon.TYPES[i] == Type.DESERT)\n \t\t\t\tcontinue;\n \n \t\t\t// check for specific 2:1 trader\n \t\t\tif (hasTrader(Hexagon.TYPES[i])\n \t\t\t\t\t&& getResources(Hexagon.TYPES[i]) >= 2 && trade[i] >= 2) {\n \t\t\t\taddResources(type, 1);\n \t\t\t\tuseResources(Hexagon.TYPES[i], 2);\n \t\t\t\treturn true;\n \t\t\t}\n \t\t}\n \n \t\t// normal 4:1 or 3:1 trade\n \t\tint value = tradeValue;\n \t\tfor (int i = 0; i < trade.length; i++) {\n \t\t\tif (Hexagon.TYPES[i] == Type.DESERT)\n \t\t\t\tcontinue;\n \n \t\t\tint number = getResources(Hexagon.TYPES[i]);\n \n \t\t\t// deduct from number of resource cards needed\n \t\t\tif (trade[i] >= value && number >= value) {\n \t\t\t\tuseResources(Hexagon.TYPES[i], value);\n \t\t\t\taddResources(type, 1);\n \n \t\t\t\tappendAction(R.string.player_traded_for, Hexagon\n \t\t\t\t\t\t.getTypeStringResource(type));\n \n \t\t\t\tfor (int j = 0; j < value; j++) {\n \t\t\t\t\tappendAction(R.string.player_traded_away, Hexagon\n \t\t\t\t\t\t\t.getTypeStringResource(Hexagon.TYPES[i]));\n \t\t\t\t}\n \n \t\t\t\treturn true;\n \t\t\t} else if (trade[i] > 0 && number >= trade[i]) {\n \t\t\t\tuseResources(Hexagon.TYPES[i], trade[i]);\n \t\t\t\tvalue -= trade[i];\n \t\t\t}\n \t\t}\n \n \t\t// this shouldn't happen\n \t\treturn false;\n \t}", "@Override\n protected void trade(){\n // An example of a random trade proposal: offer peasants in exchange of soldiers\n // Pick the id of the potential partner (without checking if it is my neighbor)\n double pertnerID = (new Random()).nextInt(42)+1;\n trade[0] = pertnerID;\n // Choose the type of good demanded (peasants - 3)\n double demandType = 3;\n trade[1] = demandType;\n // Choose the amount of demanded goods\n double demand = Math.random();\n trade[2] = demand;\n // Choose the type of good offered in exchange (peasants - 2)\n double offerType = 2;\n trade[3] = offerType;\n // Choode the amount of goods offered in exchange (random but less than my total number of peasants)\n double offer = (new Random()).nextDouble()*myTerritory.getPeasants();\n trade[4] = offer;\n\n // This procedure updated the array trade, which contains the information\n // about trade proposals of the current lord\n }", "public void cancelTradeOffer()\n\t{\n\t\tm_trade.cancelOffer(this);\n\t}", "@Override\n protected void acceptTrade(Territory offerer, double demand, int typeDemand, double offer, int typeOffer){\n // An example for accepting a trade proposal: I only accept offers of peasants when I have less than 3 peasants\n // I am not checking what I am giving in exchange or how much, so you should work on that\n if (typeOffer == 3 && typeDemand == 2){\n acceptTrade = true;// no matter the amounts\n }\n else acceptTrade = false;\n }", "private void botTrading(){\n if(game.isCardPositive(game.getHighestSharePriceStock())){\n int numShares = player.getFunds()/(game.getHighestSharePriceStock().getSharePrice()+3);\n player.getShares().set(game.getIndex(game.getHighestSharePriceStock()), player.getShares().get(game.getIndex(game.getHighestSharePriceStock())) + numShares);\n player.setFunds(-numShares*(game.getHighestSharePriceStock().getSharePrice()+3));\n }\n }", "public void buyStock(double askPrice, int shares, int tradeTime) {\n }", "public void trade(CheeseConnoisseur c) {\n try {\n if (this.hold.getType() == null || c.hold.getType() == null) {\n CheeseConnoisseur n = this;\n } else if (this.hold.equals(c.hold)) {\n CheeseConnoisseur n = this;\n } else {\n CheeseConnoisseur higher = this.hold.getPrice() > c.hold.getPrice() ? this : c;\n CheeseConnoisseur lower = this.hold.getPrice() < c.hold.getPrice() ? this : c;\n double diff = higher.hold.getPrice() - lower.hold.getPrice();\n System.out.println(diff);\n if (this.hold.getPrice() > c.hold.getPrice() && c.money >= diff) {\n c.money -= diff;\n this.money += diff;\n this.hold.beTraded();\n c.hold.beTraded();\n Cheese tmp = this.hold;\n this.hold = c.hold;\n c.hold = tmp;\n } else if (this.hold.getPrice() < c.hold.getPrice() && this.money >= diff) {\n c.money += diff;\n this.money -= diff;\n this.hold.beTraded();\n c.hold.beTraded();\n Cheese tmp = this.hold;\n this.hold = c.hold;\n c.hold = tmp;\n } else {\n CheeseConnoisseur n = this;\n }\n }\n } catch (Exception e) {\n System.out.println(\"Fail to trade\");\n }\n\n }", "private void makeWithdraw() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void setTrade(Trade trade) {\n\t\t this.trade = trade;\r\n\t}", "public TransactionResponse sell() {\r\n \t\ttry {\r\n \t\t\tTransactionResponse response = new TransactionResponse(hp);\r\n \t\t\tCalculation calc = hc.getCalculation();\r\n \t\t\tAccount acc = hc.getAccount();\r\n \t\t\tLanguageFile L = hc.getLanguageFile();\r\n \t\t\tLog log = hc.getLog();\r\n \t\t\tNotification not = hc.getNotify();\r\n \t\t\tInfoSignHandler isign = hc.getInfoSignHandler();\r\n \t\t\tString playerecon = hp.getEconomy();\r\n \t\t\tint id = hyperObject.getId();\r\n \t\t\tint data = hyperObject.getData();\r\n \t\t\tString name = hyperObject.getName();\r\n \t\t\tif (giveInventory == null) {\r\n \t\t\t\tgiveInventory = hp.getPlayer().getInventory();\r\n \t\t\t}\r\n \t\t\tif (amount > 0) {\r\n \t\t\t\tif (id >= 0) {\r\n \t\t\t\t\tint totalitems = im.countItems(id, data, giveInventory);\r\n \t\t\t\t\tif (totalitems < amount) {\r\n \t\t\t\t\t\tboolean sellRemaining = hc.getYaml().getConfig().getBoolean(\"config.sell-remaining-if-less-than-requested-amount\");\r\n \t\t\t\t\t\tif (sellRemaining) {\r\n \t\t\t\t\t\t\tamount = totalitems;\r\n \t\t\t\t\t\t} else {\t\r\n \t\t\t\t\t\t\tresponse.addFailed(L.f(L.get(\"YOU_DONT_HAVE_ENOUGH\"), name), hyperObject);\r\n \t\t\t\t\t\t\treturn response;\t\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t}\r\n \t\t\t\t\tif (amount > 0) {\r\n \t\t\t\t\t\tdouble price = hyperObject.getValue(amount, hp);\r\n \t\t\t\t\t\tBoolean toomuch = false;\r\n \t\t\t\t\t\tif (price == 3235624645000.7) {\r\n \t\t\t\t\t\t\ttoomuch = true;\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\tif (!toomuch) {\r\n \t\t\t\t\t\t\tint maxi = hyperObject.getMaxInitial();\r\n \t\t\t\t\t\t\tboolean isstatic = false;\r\n \t\t\t\t\t\t\tboolean isinitial = false;\r\n \t\t\t\t\t\t\tisinitial = Boolean.parseBoolean(hyperObject.getInitiation());\r\n \t\t\t\t\t\t\tisstatic = Boolean.parseBoolean(hyperObject.getIsstatic());\r\n \t\t\t\t\t\t\tif ((amount > maxi) && !isstatic && isinitial) {\r\n \t\t\t\t\t\t\t\tamount = maxi;\r\n \t\t\t\t\t\t\t\tprice = hyperObject.getValue(amount, hp);\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\tboolean sunlimited = hc.getYaml().getConfig().getBoolean(\"config.shop-has-unlimited-money\");\r\n \t\t\t\t\t\t\tif (acc.checkshopBalance(price) || sunlimited) {\r\n \t\t\t\t\t\t\t\tif (maxi == 0) {\r\n \t\t\t\t\t\t\t\t\tprice = hyperObject.getValue(amount, hp);\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\tim.removeItems(id, data, amount, giveInventory);\r\n \t\t\t\t\t\t\t\tdouble shopstock = 0;\r\n \t\t\t\t\t\t\t\tshopstock = hyperObject.getStock();\r\n \t\t\t\t\t\t\t\tif (!Boolean.parseBoolean(hyperObject.getIsstatic()) || !hc.getConfig().getBoolean(\"config.unlimited-stock-for-static-items\")) {\r\n \t\t\t\t\t\t\t\t\thyperObject.setStock(shopstock + amount);\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\tint maxi2 = hyperObject.getMaxInitial();\r\n \t\t\t\t\t\t\t\tif (maxi2 == 0) {\r\n \t\t\t\t\t\t\t\t\thyperObject.setInitiation(\"false\");\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\tdouble salestax = hp.getSalesTax(price);\r\n \t\t\t\t\t\t\t\tacc.deposit(price - salestax, hp.getPlayer());\r\n \t\t\t\t\t\t\t\tacc.withdrawShop(price - salestax);\r\n \t\t\t\t\t\t\t\tif (sunlimited) {\r\n \t\t\t\t\t\t\t\t\tString globalaccount = hc.getYaml().getConfig().getString(\"config.global-shop-account\");\r\n \t\t\t\t\t\t\t\t\tacc.setBalance(0, globalaccount);\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\t\r\n \t\t\t\t\t\t\t\tresponse.addSuccess(L.f(L.get(\"SELL_MESSAGE\"), amount, calc.twoDecimals(price), name, calc.twoDecimals(salestax)), price - salestax, hyperObject);\r\n \t\t\t\t\t\t\t\tresponse.setSuccessful();\r\n \t\t\t\t\t\t\t\tString type = \"dynamic\";\r\n \t\t\t\t\t\t\t\tif (Boolean.parseBoolean(hyperObject.getInitiation())) {\r\n \t\t\t\t\t\t\t\t\ttype = \"initial\";\r\n \t\t\t\t\t\t\t\t} else if (Boolean.parseBoolean(hyperObject.getIsstatic())) {\r\n \t\t\t\t\t\t\t\t\ttype = \"static\";\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\tlog.writeSQLLog(hp.getName(), \"sale\", name, (double) amount, calc.twoDecimals(price - salestax), calc.twoDecimals(salestax), playerecon, type);\r\n \t\t\t\t\t\t\t\tisign.updateSigns();\r\n \t\t\t\t\t\t\t\tnot.setNotify(name, null, playerecon);\r\n \t\t\t\t\t\t\t\tnot.sendNotification();\r\n \t\t\t\t\t\t\t\treturn response;\r\n \t\t\t\t\t\t\t} else {\r\n \t\t\t\t\t\t\t\tresponse.addFailed(L.get(\"SHOP_NOT_ENOUGH_MONEY\"), hyperObject);\r\n \t\t\t\t\t\t\t\treturn response;\t\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t} else {\r\n \t\t\t\t\t\t\tresponse.addFailed(L.f(L.get(\"CURRENTLY_CANT_SELL_MORE_THAN\"), hyperObject.getStock(), name), hyperObject);\r\n \t\t\t\t\t\t\treturn response;\t\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t} else {\r\n \t\t\t\t\t\tresponse.addFailed(L.f(L.get(\"YOU_DONT_HAVE_ENOUGH\"), name), hyperObject);\r\n \t\t\t\t\t\treturn response;\t\r\n \t\t\t\t\t}\r\n \t\t\t\t} else {\r\n \t\t\t\t\tresponse.addFailed(L.f(L.get(\"CANNOT_BE_SOLD_WITH\"), name), hyperObject);\r\n \t\t\t\t\treturn response;\t\r\n \t\t\t\t}\r\n \t\t\t} else {\r\n \t\t\t\tresponse.addFailed(L.f(L.get(\"CANT_SELL_LESS_THAN_ONE\"), name), hyperObject);\r\n \t\t\t\treturn response;\t\r\n \t\t\t}\r\n \t\t} catch (Exception e) {\r\n \t\t\tString info = \"Transaction sell() passed values name='\" + hyperObject.getName() + \"', player='\" + hp.getName() + \"', id='\" + hyperObject.getId() + \"', data='\" + hyperObject.getData() + \"', amount='\" + amount + \"'\";\r\n \t\t\tnew HyperError(e, info);\r\n \t\t\treturn new TransactionResponse(hp);\r\n \t\t}\r\n \t}", "void addTrade(Trade trade);", "private void tradeCommand(){\n out.println(\"\\r\\nShares you own:\" +\n \"\\r\\nApple: \" + player.getShares().get(0) +\n \"\\r\\nBP: \" + player.getShares().get(1) +\n \"\\r\\nCisco: \" + player.getShares().get(2) +\n \"\\r\\nDell: \" + player.getShares().get(3) +\n \"\\r\\nEricsson: \" + player.getShares().get(4) +\n \"\\r\\n\\r\\nShare prices: Apple-\" + game.apple.getSharePrice() +\n \", BP-\" + game.bp.getSharePrice() +\n \", Cisco-\" + game.cisco.getSharePrice() +\n \", Dell-\" + game.dell.getSharePrice() +\n \", Ericsson-\" + game.ericsson.getSharePrice() +\n \"\\r\\n\\r\\nFunds: £\" + player.getFunds() + \", Current value of shares: £\" + getTotalShareValue(player) + \"\\r\\n\"\n );\n\n out.println(\"Would you like to buy(b) or sell(s) shares? Enter 'X' to exit.\");\n String bsInput = in.nextLine().trim();\n if (bsInput.toUpperCase().equals(\"B\")){\n getTradeParam(1); //buy\n }else if (bsInput.toUpperCase().equals(\"S\")){\n getTradeParam(0); //sell\n }else if (bsInput.toUpperCase().equals(\"X\")){\n command();\n }else{\n out.println(\"Invalid input\");\n tradeCommand();\n }\n }", "@Override\n\tpublic void rollBackTrade(TickEvent<Trade> tradeEvent)\n\t\t\tthrows TradeException {\n\n\t}", "public Object dismissTrade() {\n return client.sendRpcAndWait(SERVICE, \"dismissTrade\");\n }", "public void setTrade(Trade t)\n\t{\n\t\tm_trade = t;\n\t}", "private void commitSell(Stock stock, int numShares){\n if(numShares <= player.getShares().get(game.getIndex(stock))){\n out.println(\"Selling \" + numShares + \" \" + stock.getName() + \" shares for £\" + stock.getSharePrice() + \" each.\");\n out.println(\"Funds after transaction: £\" + (player.getFunds()+numShares*stock.getSharePrice()));\n out.println(\"\\r\\nConfirm sale? (Y/N)\");\n String sConfirmInput = in.nextLine();\n if(sConfirmInput.toUpperCase().equals(\"Y\")){\n player.getShares().set(game.getIndex(stock), player.getShares().get(game.getIndex(stock)) - numShares);\n player.setFunds(numShares*stock.getSharePrice());\n player.deductTradesLeft();\n out.println(\"Sale complete.\");\n display();\n command();\n }else if (sConfirmInput.toUpperCase().equals(\"N\")){\n out.println(\"Sale cancelled.\");\n getTradeParam(0);\n }\n }else{\n out.println(\"You do not own that many shares in this stock\");\n getTradeParam(0);\n }\n }", "@Override\n public boolean withdraw(double amount) {\n boolean res = store_trans(amount*-1);\n\n if(res){\n res=super.withdraw(amount);\n }\n\n return res;\n }", "@Override\r\n\tpublic boolean deopsit(double amount) {\n\t\ttry {\r\n\t\t\tif (accountStatus.equals(AccountStatus.ACTIVE)) {\r\n\t\t\t\tbalance = (float) (balance + amount);\r\n\t\t\t} else {\r\n\t\t\t\tthrow new AccountInactiveException(\"You'er Account is not Active !\");\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\tSystem.err.println(e.getMessage());\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "@Override\r\n\tpublic void deposit(int amount) {\n\t\t\r\n\t}", "public void denyTrade(Trade trade) {\n Player owner = trade.getOwner();\n Player targetPlayer = trade.getTarget();\n owner.removeTrade(trade);\n targetPlayer.removeTrade(trade);\n }", "@Override\r\n\tpublic void onStopTrading(boolean isException) throws Exception {\n\t\t\r\n\t}", "@Override\n public void acceptTrade(boolean willAccept) throws ModelException {\n if (willAccept && !GameModelFacade.instance().canAcceptTrade()) {\n throw new ModelException(\"Preconditions for action not met.\");\n }\n\n IPlayer p = GameModelFacade.instance().getLocalPlayer();\n assert GameModelFacade.instance().getGame().getTradeOffer().getReceiver().equals(p);\n\n try {\n String clientModel = m_theProxy.acceptTrade(p.getIndex(), willAccept);\n new ModelInitializer().initializeClientModel(clientModel, m_theProxy.getPlayerId());\n } catch (NetworkException e) {\n throw new ModelException(e);\n }\n }", "public void trade(Player player, Type type, int[] trade) {\n \t\taddResources(type, 1);\n \t\tplayer.useResources(type, 1);\n \n \t\tfor (int i = 0; i < Hexagon.TYPES.length; i++) {\n \t\t\tif (trade[i] <= 0)\n \t\t\t\tcontinue;\n \n \t\t\tuseResources(Hexagon.TYPES[i], trade[i]);\n \t\t\tplayer.addResources(Hexagon.TYPES[i], trade[i]);\n \n \t\t\tfor (int j = 0; j < trade[i]; j++) {\n \t\t\t\tappendAction(R.string.player_traded_away, Hexagon\n \t\t\t\t\t\t.getTypeStringResource(Hexagon.TYPES[i]));\n \t\t\t}\n \t\t}\n \n \t\tappendAction(R.string.player_traded_with, player.getName());\n \t\tappendAction(R.string.player_got_resource, Hexagon\n \t\t\t\t.getTypeStringResource(type));\n \t}", "Trade editTrade(String tradeId, Trade editedTrade) throws \n OrderBookTradeException;", "private static void deposite (double amount) {\n double resultDeposit = balance + amount;\r\n System.out.println(\"Deposit successful.\\nCurrent balance: \" + \"$\" + resultDeposit+ \".\");\r\n }", "public Trade saveTrade(Trade trade) {\n Account account = trade.getTrader().getAccount();\n Double currentBalUSD = account.getUsd();\n Double usdAmount = trade.getUsdAmount();\n Double foreignAmount = -usdAmount*(1/trade.getRate()); // this calculation is happening on the front end too, more efficient: store the foreign amount in the table too and send it in with the trade\n account.setUsd(currentBalUSD+usdAmount);\n\n /*\n Checking which type of trade to be made (eurusd, gbpusd, nzdusd)\n */\n switch (trade.getCurrencyPair().getId()) {\n case 1: {\n Double currentForeignBal = account.getEur();\n account.setEur(currentForeignBal + foreignAmount);\n break;\n }\n case 2: {\n Double currentForeignBal = account.getGbp();\n account.setGbp(currentForeignBal + foreignAmount);\n break;\n }\n case 3: {\n Double currentForeignBal = account.getNzd();\n account.setNzd(currentForeignBal + foreignAmount);\n break;\n }\n }\n\n return tradeRepository.save(trade);\n }", "public boolean canTrade()\n\t{\n\t\treturn System.currentTimeMillis() - m_lastTrade > 60 * 1000 && getPartyCount() >= 2;\n\t}", "@Override\n protected void withdraw(int request, boolean isOverdraft){\n if(request>0){\n request += SERVICE_FEE;\n }\n //need to change both balances just in case there was a LARGE_DEPOSIT \n //making it so that the 2 balance values differ\n setBalance(getBalance() - request);\n setBalanceAvailable(getBalanceAvailable() - request);\n }", "public void setTRADE(java.lang.String TRADE) {\n this.TRADE = TRADE;\n }", "public void trade(Drop myDrop, User receiver) {\n getInventory().removeDrop(myDrop);\n receiver.getInventory().addDrop(myDrop);\n }", "private void deleteTransaction() {\n LogUtils.logEnterFunction(Tag);\n\n boolean isDebtValid = true;\n if(mDbHelper.getCategory(mTransaction.getCategoryId()).getDebtType() == Category.EnumDebt.MORE) { // Borrow\n List<Debt> debts = mDbHelper.getAllDebts();\n\n Double repayment = 0.0, borrow = 0.0;\n for(Debt debt : debts) {\n if(mDbHelper.getCategory(debt.getCategoryId()).isExpense() && mDbHelper.getCategory(debt.getCategoryId()).getDebtType() == Category.EnumDebt.LESS) { // Repayment\n repayment += debt.getAmount();\n }\n\n if(!mDbHelper.getCategory(debt.getCategoryId()).isExpense() && mDbHelper.getCategory(debt.getCategoryId()).getDebtType() == Category.EnumDebt.MORE) { // Borrow\n borrow += debt.getAmount();\n }\n }\n\n if(borrow - mTransaction.getAmount() < repayment) {\n isDebtValid = false;\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.message_debt_delete_invalid));\n }\n }\n\n if(isDebtValid) {\n mDbHelper.deleteTransaction(mTransaction.getId());\n if(mDbHelper.getDebtByTransactionId(mTransaction.getId()) != null) {\n mDbHelper.deleteDebt(mDbHelper.getDebtByTransactionId(mTransaction.getId()).getId());\n }\n\n cleanup();\n\n // Return to FragmentListTransaction\n getFragmentManager().popBackStackImmediate();\n LogUtils.logLeaveFunction(Tag);\n }\n }", "public TransactionResponse sellToInventory() {\r\n \t\tTransactionResponse response = new TransactionResponse(hp);\r\n \t\ttry {\r\n \t\t\tDataHandler sf = hc.getDataFunctions();\r\n \t\t\tCalculation calc = hc.getCalculation();\r\n \t\t\tAccount acc = hc.getAccount();\r\n \t\t\tLog log = hc.getLog();\r\n \t\t\tLanguageFile L = hc.getLanguageFile();\r\n \t\t\tString playerecon = tradePartner.getEconomy();\r\n \t\t\tdouble price = 0.0;\r\n \t\t\tif (setPrice) {\r\n \t\t\t\tprice = money;\r\n \t\t\t} else {\r\n \t\t\t\tprice = hyperObject.getValue(amount, hp);\r\n \t\t\t}\r\n \t\t\tBoolean toomuch = false;\r\n \t\t\tif (price == 3235624645000.7) {\r\n \t\t\t\ttoomuch = true;\r\n \t\t\t}\r\n \t\t\tif (!toomuch) {\r\n \t\t\t\tim.removeItems(hyperObject.getId(), hyperObject.getData(), amount, hp.getPlayer().getInventory());\r\n \t\t\t\tim.addItems(amount, hyperObject.getId(), hyperObject.getData(), receiveInventory);\r\n \t\t\t\tacc.deposit(price, hp.getPlayer());\r\n \t\t\t\tacc.withdrawAccount(price, tradePartner.getName());\r\n \t\t\t\tresponse.addSuccess(L.f(L.get(\"SELL_CHEST_MESSAGE\"), amount, calc.twoDecimals(price), hyperObject.getName(), tradePartner.getName()), calc.twoDecimals(price), hyperObject);\r\n \t\t\t\tresponse.setSuccessful();\r\n \t\t\t\tlog.writeSQLLog(hp.getName(), \"sale\", hyperObject.getName(), (double) amount, calc.twoDecimals(price), 0.0, tradePartner.getName(), \"chestshop\");\r\n \t\t\t\ttradePartner.sendMessage(L.f(L.get(\"CHEST_SELL_NOTIFICATION\"), amount, calc.twoDecimals(price), hyperObject.getName(), hp.getPlayer()));\r\n \t\t\t} else {\r\n \t\t\t\tresponse.addFailed(L.f(L.get(\"CURRENTLY_CANT_SELL_MORE_THAN\"), sf.getHyperObject(hyperObject.getName(), playerecon).getStock(), 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 = \"Transaction sellChest() passed values name='\" + hyperObject.getName() + \"', player='\" + hp.getName() + \"', owner='\" + tradePartner.getName() + \"', amount='\" + amount + \"'\";\r\n \t\t\tnew HyperError(e, info);\r\n \t\t\treturn new TransactionResponse(hp);\r\n \t\t}\r\n \t}", "public abstract boolean deposit(float amount);", "void depositByCheque(double amount) {\n\t\tif (isSuspended()) {\n\t\t\tSystem.out.println(\"Account is suspended.\");\n\t\t\treturn;\n\t\t}\n\t\tif (amount <= 0) {\n\t\t\tSystem.out.println(\"Amount must be more than 0.\");\n\t\t\tSystem.out.println(\"Depositing failed.\");\n\t\t\treturn;\n\t\t}\n\t\tcheque += amount;\n\t\tSystem.out.println(\"Deposit cheque \" + amount + \" successfully\");\n\t}", "@Override\r\n\tpublic void setPlayerToTradeWith(int playerIndex) {\n\t\t\r\n\t}", "public void transferToChecking(double amount){\n withdrawSavings(amount);\r\n depositChecking(amount);\r\n }", "Trade removeTrade(String tradeId) throws OrderBookTradeException;", "public void onTradeRequest(String name)\n {\n\t\tif(traded_ammount > 0)\n\t\t{\n\t\t\ttraded_ammount = 0;\n\t\t\ttime = System.currentTimeMillis();\n\t\t}\n\t\tint[] player = getPlayerByName(name);\n\t\tint player_id = getPlayerPID(player[0]);\n\t\tsendTradeRequest(player_id);\n }", "@Override\n protected void tradeOutcome(long period, int proposerID, double[] tradeProposal, boolean tradeCompleted){\n // This method provides information about the outcome of the trade, so I will leave this open to you,\n // to do whatever you want to do with the info.\n\n // period: step of the simulation in which the trade occured\n // proposerID: id of the territory that created the trade proposal (it can be yourself)\n // tradeProposal: the actual trade proposal that was either sent or received by your lord.\n // The information in the tradeProposal array is organized in the exact same way as in your own tradeProposal\n // so you can store and use that information as you wish\n // tradeCompleted: an indicator if the transaction was completed (true) or not (false)\n }", "@Override\n\tpublic void deposit(int money) {\n\t\t\n\t}", "private void addSellCashTrade( final Trade trade )\n throws CloneNotSupportedException {\n\n // Check if the number of active units is greater than or equal to\n // the number of units that have been sold. If not, it is an error\n // condition. We are not handling short sell scenarios.\n if( getNumActiveCashUnits() < trade.getUnits() ) {\n logger.error( \"Selling more than active untis. Error condition\" ) ;\n logger.error( \" SYMBOL = \" + trade.getSymbol() ) ;\n logger.error( \" active units = \" + getNumActiveCashUnits() ) ;\n logger.error( \" sell units = \" + trade.getUnits() ) ;\n throw new IllegalArgumentException( \"Trying to sell more than \" +\n \"what we have. Bad bad..\" ) ;\n }\n\n // Selling happens in FIFO order.\n int qtyMatched = 0 ;\n Trade buyTrade = null ;\n int buyActUnits = 0 ;\n int sellUnitsLeft = trade.getUnits() ;\n Trade sellTrade= null ;\n\n // While we have not quenched all the units of the sell trade, we\n // continue matching it against our buy orders. Assumption is that if\n // we receive a sell order, we must have enough buy orders already\n // registered to quench the sell order. Else we have an error condition\n while( qtyMatched != trade.getUnits() ) {\n\n // Clone the sell order. In case one sell order matches multiple\n // buy orders, we need to attach a clone of the sell order with\n // appropriate quantity matched to each buy order.\n sellTrade = ( Trade )trade.clone() ;\n\n // Get the first buy order which has still some active units left.\n buyTrade = this.posHldCashTrades.get( 0 ) ;\n\n // Determine how many active units we are dealing with.\n buyActUnits = buyTrade.getNumActiveUnits() ;\n\n // If the buy active units are greater than the sell units left,\n // it implies that the complete sell order will be used up here.\n if( buyActUnits >= sellUnitsLeft ) {\n\n // Increase the total quantity matched by the sell units left.\n qtyMatched += sellUnitsLeft ;\n buyTrade.setMatchedUnits( buyTrade.getMatchedUnits() + sellUnitsLeft ) ;\n sellTrade.setMatchedUnits( sellUnitsLeft ) ;\n sellUnitsLeft = 0 ;\n }\n else {\n // If the sell units are more than the current buy units, it\n // implies that this sell order spans multiple buy orders.\n qtyMatched += buyActUnits ;\n\n // The buy order is completely matched. Hence the matched units\n // is equal to the number of buy units.\n buyTrade.setMatchedUnits( buyTrade.getUnits() ) ;\n\n // Set the number of units matched for this sell trade.\n sellTrade.setMatchedUnits( buyActUnits ) ;\n sellUnitsLeft -= buyActUnits ;\n }\n\n buyTrade.addSellTrade( sellTrade ) ;\n\n // If the buy order is completely matched, remove it from the list\n // of positive holdings and move it to the zero holdings list.\n if( buyTrade.getNumActiveUnits() == 0 ) {\n this.posHldCashTrades.remove( 0 ) ;\n }\n }\n }", "abstract public Decision askKeepOrLiquidate(int fundValue, int timespan);", "public void onTrade(Trade trade) {\n thePosition += trade.getVolume();\n theCashBalance += -1 * trade.getPrice() * trade.getVolume();\n }", "public void sell() {\n for (Company x : _market.getCompanies()) {\n if (x.getRisk() > _confidence || x.numLeft() < 3 || x.getRisk() < _confidence - 15){\n if (_stocks.get(x) == 1) {\n _stocks.remove(x);\n } else {\n _stocks.put(x, _stocks.get(x) - 1);\n }\n _money += x.getPrice();\n x.gain();\n break;\n } else {\n _happy = true;\n }\n }\n }", "private void updateTransaction() {\n LogUtils.logEnterFunction(Tag);\n\n String inputtedAmount = etAmount.getText().toString().trim().replaceAll(\",\", \"\");\n if (inputtedAmount.equals(\"\") || Double.parseDouble(inputtedAmount) == 0) {\n etAmount.setError(getResources().getString(R.string.Input_Error_Amount_Empty));\n return;\n }\n\n if (mAccount == null) {\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.Input_Error_Account_Empty));\n return;\n }\n\n Double amount = Double.parseDouble(inputtedAmount);\n int categoryId = mCategory != null ? mCategory.getId() : 0;\n String description = tvDescription.getText().toString();\n int accountId = mAccount.getId();\n String strEvent = tvEvent.getText().toString();\n Event event = null;\n\n if (!strEvent.equals(\"\")) {\n event = mDbHelper.getEventByName(strEvent);\n if (event == null) {\n long eventId = mDbHelper.createEvent(new Event(0, strEvent, mCal, null));\n if (eventId != -1) {\n event = mDbHelper.getEvent(eventId);\n }\n }\n }\n\n // Less: Repayment, More: Lend\n if(mCategory.getDebtType() == Category.EnumDebt.LESS || mCategory.getDebtType() == Category.EnumDebt.MORE) {\n\n boolean isDebtValid = true;\n if(mCategory.getDebtType() == Category.EnumDebt.LESS) { // Income -> Debt Collecting\n List<Debt> debts = mDbHelper.getAllDebtByPeople(tvPeople.getText().toString());\n\n Double lend = 0.0, debtCollect = 0.0;\n for(Debt debt : debts) {\n if(mDbHelper.getCategory(debt.getCategoryId()).isExpense() && mDbHelper.getCategory(debt.getCategoryId()).getDebtType() == Category.EnumDebt.MORE) {\n lend += debt.getAmount();\n }\n\n if(!mDbHelper.getCategory(debt.getCategoryId()).isExpense() && mDbHelper.getCategory(debt.getCategoryId()).getDebtType() == Category.EnumDebt.LESS) {\n debtCollect += debt.getAmount();\n }\n }\n\n if(debtCollect + amount > lend) {\n isDebtValid = false;\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.message_debt_collect_invalid));\n }\n\n } // End DebtType() == Category.EnumDebt.LESS\n if(isDebtValid) {\n Transaction transaction = new Transaction(mTransaction.getId(),\n TransactionEnum.Income.getValue(),\n amount,\n categoryId,\n description,\n 0,\n accountId,\n mCal,\n 0.0,\n \"\",\n event);\n\n int row = mDbHelper.updateTransaction(transaction);\n if (row == 1) { // Update transaction OK\n\n if(mDbHelper.getDebtByTransactionId(mTransaction.getId()) != null) {\n Debt debt = mDbHelper.getDebtByTransactionId(mTransaction.getId());\n debt.setCategoryId(mCategory.getId());\n debt.setAmount(amount);\n debt.setPeople(tvPeople.getText().toString());\n\n int debtRow = mDbHelper.updateDebt(debt);\n if(debtRow == 1) {\n ((ActivityMain) getActivity()).showToastSuccessful(getResources().getString(R.string.message_transaction_update_successful));\n cleanup();\n // Return to last fragment\n getFragmentManager().popBackStackImmediate();\n } else {\n // Revert update\n mDbHelper.updateTransaction(mTransaction);\n ((ActivityMain) getActivity()).showToastSuccessful(getResources().getString(R.string.message_transaction_update_fail));\n }\n } else {\n Debt newDebt = new Debt();\n newDebt.setCategoryId(mCategory.getId());\n newDebt.setTransactionId((int) mTransaction.getId());\n newDebt.setAmount(amount);\n newDebt.setPeople(tvPeople.getText().toString());\n\n long debtId = mDbHelper.createDebt(newDebt);\n if(debtId != -1) {\n ((ActivityMain) getActivity()).showToastSuccessful(getResources().getString(R.string.message_transaction_create_successful));\n cleanup();\n // Return to last fragment\n getFragmentManager().popBackStackImmediate();\n } else {\n // Revert update\n mDbHelper.updateTransaction(mTransaction);\n ((ActivityMain) getActivity()).showToastSuccessful(getResources().getString(R.string.message_transaction_update_fail));\n }\n } // End create new Debt\n\n } // End Update transaction OK\n } // End isDebtValid\n\n } else { // CATEGORY NORMAL\n Transaction transaction = new Transaction(mTransaction.getId(),\n TransactionEnum.Income.getValue(),\n amount,\n categoryId,\n description,\n 0,\n accountId,\n mCal,\n 0.0,\n \"\",\n event);\n\n int row = mDbHelper.updateTransaction(transaction);\n if (row == 1) { // Update transaction OK\n if(mDbHelper.getDebtByTransactionId(mTransaction.getId()) != null) {\n mDbHelper.deleteDebt(mDbHelper.getDebtByTransactionId(mTransaction.getId()).getId());\n }\n // Return to last fragment\n getFragmentManager().popBackStackImmediate();\n }\n }\n\n LogUtils.logLeaveFunction(Tag);\n }", "@Override\n\tpublic void deposit() {\n\t\t\n\t}", "public void fundClosed(int time, int yourRevenue, int partnerRevenue) {\n /* Do nothing */\n }", "@Override\n public void deposit(double amount) {\n super.deposit(amount);\n store_trans(amount);\n }", "public void recordPurchase(double amount)\n {\n balance = balance - amount;\n // your code here\n \n }", "public void save_order_without_payment(String advert, String userWhoGive,String userWhoGet,Date date,Date start, Date finish,Float price);", "public void createTrade(String symbol, String fiat, String type, double amount) {\n // Type should be \"sell\" or \"buy\"\n if (!type.equals(\"sell\") && !type.equals(\"buy\"))\n return; // TODO - throw exception here\n\n // Create request object\n JSONObject data = new JSONObject();\n try {\n data.put(\"uuid\", getUUID());\n data.put(\"type\", type);\n data.put(\"fiat_value\", amount);\n data.put(\"fiat\", fiat);\n data.put(\"crypto_symbol\", symbol);\n } catch (JSONException e) {\n return; // TODO - throw exception here\n }\n\n api.createTrade(new VolleyJsonCallback() {\n @Override\n public void onSuccess(JSONObject json) throws JSONException {\n Trade t = new Trade(\n json.getString(\"uuid\"),\n json.getString(\"type\"),\n json.getDouble(\"fiat_value\"),\n json.getString(\"fiat\"),\n json.getDouble(\"crypto_value\"),\n json.getString(\"crypto_symbol\")\n );\n\n user.AddTrade(t);\n\n String typeStr = (type == \"buy\") ? \"Bought \" : \"Sold \";\n String text = typeStr + t.fiat_value + \"€ of \" + t.crypto_symbol;\n Toast.makeText(getApplicationContext(), text, Toast.LENGTH_LONG).show();\n\n // Create notification if enabled and trade is a buy\n if (getNotificationEnabled() && t.type.equals(\"buy\")) {\n Intent intent = new Intent(App.this, UpdateBroadcast.class);\n intent.putExtra(\"symbol\", t.crypto_symbol);\n intent.putExtra(\"fiat_price\", t.fiat_value);\n intent.putExtra(\"crypto_value\", t.crypto_value);\n PendingIntent pendingIntent = PendingIntent.getBroadcast(App.this, 0, intent, 0);\n\n AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);\n\n long currentTime = System.currentTimeMillis();\n //long remindIn = 1000 * 60 * 60; // Remind in this many milliseconds (1h)\n long remindIn = 1000 * 5;\n\n alarmManager.set(AlarmManager.RTC_WAKEUP, currentTime+remindIn, pendingIntent);\n }\n }\n\n @Override\n public void onError(String message) {\n Toast.makeText(getApplicationContext(), message, Toast.LENGTH_LONG).show();\n }\n }, data);\n }", "Trade addTrade(String tradeId, Trade trade) throws OrderBookTradeException;", "public void addTrade( final Trade trade ) throws STException {\n\n if( trade == null ) {\n throw new IllegalArgumentException( \"Trade can't be null\" ) ;\n }\n else if( !trade.getSymbol().equals( this.symbol ) ) {\n throw new IllegalArgumentException( \"A trade for \" + trade.getSymbol() +\n \" can't be added to stock trades for \" + this.symbol ) ;\n }\n\n // Note that orders would be always added in ascending order of their\n // trade date.\n if( trade.isCashTrade() ) {\n // Cash trades have different characteristics as compared to margin\n // trades. In case of cash trades, we can't sell if we do not have\n // as many active units.\n if( trade.isBuy() ) {\n addBuyCashTrade( trade ) ;\n }\n else {\n try {\n // It we are dealing with a sell trade. Handle it separately\n addSellCashTrade( trade ) ;\n }\n catch ( final CloneNotSupportedException e ) {\n throw new STException( e, ErrorCode.UNKNOWN_EXCEPTION ) ;\n }\n }\n }\n else if( trade.isMarginTrade() ) {\n // Margin trades show different characteristics as compared to\n // cash trades. The net active units at the end of a day is 0.\n // Also, in case of margin trades we can do short selling implying\n // we can sell even if we don't have as many active units.\n }\n else {\n throw new STException( \"Trade type \" + trade.getTradeType() +\n \" not supported\", ErrorCode.INVALID_ARG ) ;\n }\n\n this.allTrades.add( trade ) ;\n }", "public void deposit (double amount)\n {\n imposeTransactionFee ();\n super.deposit (amount);\n }", "public abstract boolean withdraw(float amount);", "public void subtractCreditTransaction(double withdrawAmount){\n if(!checkAccountOpen()){\n System.out.println(\"Your credit transaction in the amount of -$\" + withdrawAmount +\" has been declined\");\n }\n else {\n this.currentBalance = this.currentBalance - withdrawAmount;\n if(this.currentBalance<0){\n System.out.println(\"Appropriate funds not found. Please check your current balance.\");\n this.currentBalance = this.currentBalance + withdrawAmount;\n }\n else {\n System.out.println(\"Your credit transaction has been approved!\");\n System.out.println(\"Your current balance is: $\" + currentBalance);\n }\n }\n\n }", "Trade getTrade(String tradeId) throws OrderBookTradeException;", "public boolean debit(double amount) throws InsufficientFundsException,InvalidAmountException {\r\n\t\tif (getAmount() + overdraftBalance < amount){\r\n\t\t\tthrow new InsufficientFundsException(\"Insufficient funds to withdraw the amount.\");\r\n\t\t}\r\n\t\tif (amount <= 0){\r\n throw new InvalidAmountException(\"Amount can't be negative or 0.\");\r\n }\r\n\t\tsetAmount(getAmount() - amount);\r\n\t\tthis.setCountVal(this.getCountVal() + 1);\r\n return true;\r\n\t}", "public static void deposit() {\n\t\ttry {\n\t\t\tif (!LoginMgr.isLoggedIn()) {\n\t\t\t\tthrow new NotLoggedInException();\n\t\t\t}\n\n\t\t\t//Scanner s = new Scanner(System.in);\n\t\t\tSystem.out.println(\"Enter account number:\");\n\t\t\tString accNum = \"\";\n\t\t\tif (Quinterac.s.hasNextLine())\n\t\t\t\taccNum = Quinterac.s.nextLine();\n\n\t\t\tif (!ValidAccListMgr.checkAccNumExist(accNum)) {\n\t\t\t\tSystem.out.println(\"Please enter a valid account number\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tSystem.out.println(\"Enter the amount of money to deposit in cents:\");\n\t\t\tint amount = 0;\n\t\t\tif (Quinterac.s.hasNextInt()) amount = Integer.parseInt(Quinterac.s.nextLine());\n\t\t\t\n\t\t\tString modeName = LoginMgr.checkMode();\n\t\t\tif (modeName.equals(\"machine\")) {\n\t\t\t\tatmCheckDepositValid(accNum, amount);\n\t\t\t} else if (modeName.equals(\"agent\")) {\n\t\t\t\tagentCheckDepositValid(accNum, amount);\n\t\t\t}\n\n\t\t} catch (NotLoggedInException e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t}", "void generateTrades(Player p, PlayerInventory inv, ItemStack item, List<MerchantRecipe> trades, Map<Enchantment, Integer> enchants) {\n if(item.getType() != Material.ENCHANTED_BOOK || enchants.size() <= 0)\r\n return;\r\n\r\n // If it's a book that contains a fortune 4 or above enchant then block\r\n if(enchants.containsKey(Enchantment.LOOT_BONUS_BLOCKS) &&\r\n enchants.get(Enchantment.LOOT_BONUS_BLOCKS) >= 4)\r\n return;\r\n\r\n // Create resulting book with incremented levels\r\n ItemStack resultingBook = item.clone();\r\n\r\n for (Map.Entry<Enchantment, Integer> enchant : enchants.entrySet()) {\r\n\r\n remEnchant(resultingBook, enchant.getKey());\r\n addEnchant(resultingBook, enchant.getKey(), enchant.getValue() + 1);\r\n }\r\n\r\n // Calculate price\r\n int price = getPriceFromBook(resultingBook);\r\n\r\n // Locked Box\r\n ItemStack resultingItem = createLockedBox(\"Enchanted Item\", Collections.singletonList(resultingBook), price);\r\n\r\n // Add trade\r\n addTrade(item, item, resultingItem, trades);\r\n }", "@Override \n\tpublic TradeAction tick(double price) {\n\t\tma10before=average(priceQ10);\n\t\t\n\t\tif (priceQ10.size()<10)\n\t\t{\n\t\t\tpriceQ10.offer(price);\n\t\t}\n\t\tif(priceQ10.size()==10)\n\t\t{\n\t\t\tpriceQ10.poll();\n\t\t\tpriceQ10.offer(price);\t\t\n\t\t}\n\t\t\n\t\t ma10after=average(priceQ10);\n\t\t \n\t\t// 60 days moving average\n\t\tma60before=average(priceQ60);\n\t\tif (priceQ60.size()<60)\n\t\t{\n\t\t\tpriceQ60.offer(price);\n\t\t}\n\t\tif(priceQ60.size()==60)\n\t\t{\n\t\t\tpriceQ60.poll();\n\t\t\tpriceQ60.offer(price);\t\t\n\t\t}\n\t\tma60after=average(priceQ60);\n\t\t\t\n\t\t//buy when its 10 day moving average goes above the 60 day moving average\n\t\tif((ma10before < ma60before) & (ma10after > ma60after))\n\t\t{\n\t\t\tprofit = profit - price;\n\t\t\t//System.out.println(\"buy\");\n\t\t\t//System.out.println(\"profit is\");\n\t\t\t//System.out.println(profit);\n\t\t\tif(mark==1){\n\t\t\t\tmark=-1;\n\t\t\t\treturn TradeAction.BUY;\n\t\t\t}\n\t\t\telse \n\t\t\t\treturn TradeAction.DO_NOTHING;\n\t\t\t\n\t\t}\n\t\t//buy when its 10 day moving average goes below the 60 day moving average\n\t\tif((ma10before > ma60before) & (ma10after < ma60after))\n\t\t{\n\t\t\tprofit = profit + price;\n\t\t\t//System.out.println(\"sell\");\n\t\t\t//System.out.println(\"profit is\");\n\t\t\t//System.out.println(profit);\n\t\t\tif(mark==-1){\n\t\t\t\tmark=1;\n\t\t\t\treturn TradeAction.SELL;\n\t\t\t}\n\t\t\telse \n\t\t\t\treturn TradeAction.DO_NOTHING;\n\t\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn TradeAction.DO_NOTHING;\t\t\t\n\t\t}\n\n\t}", "boolean debit(TransactionRequest transaction) throws ebank.InsufficientBalanceException,ebank.CardNumberException, SQLException, ClassNotFoundException;", "public void applyTrade(Trade trade) {\n\t\tthis.sharesOwned += trade.getNumberOfShares();\n\t}", "public void withdraw (double amount)\n {\n super.withdraw (amount);\n imposeTransactionFee ();\n }", "void respondToTrade(long tradeItemId, boolean response);", "private void botBuy(Stock stock, int numShares){\n player.getShares().set(game.getIndex(stock), player.getShares().get(game.getIndex(stock)) + numShares);\n player.setFunds(-numShares*(stock.getSharePrice()+3));\n System.out.println(\"purchase made\"); //rem\n }", "@Override\n public TickerData call() throws TimeoutException, ExchangeDataException {\n\n BigDecimal baseFund = null;\n BigDecimal counterFund = null;\n BigDecimal baseNeed;\n BigDecimal counterNeed;\n\n //tickerData object that uses the exchange data getter to get activated exchanges and currency pairs\n TickerData tickerData = ExchangeDataGetter.getTickerData(activatedExchange.getExchange(), currencyPair);\n\n // the part below format specially TickerData for the trading action having one more check (sufficient fund)\n if (tradingEnvironment && tickerData != null) {\n try {\n Wallet wallet = activatedExchange.getExchange().getAccountService().getAccountInfo().getWallet();\n baseFund = wallet.getBalance(currencyPair.base).getTotal();\n counterFund = wallet.getBalance(currencyPair.counter).getTotal();\n\n } catch (IOException e) { e.printStackTrace(); }\n\n baseNeed = tradeAmountBase;\n counterNeed = tradeAmountBase.multiply(tickerData.getBid());\n\n //Ticker data trading object made up of the tickerdata basefund and counterund\n TickerDataTrading tickerDataTrading = new TickerDataTrading(tickerData, baseFund, counterFund);\n\n if (counterFund.compareTo(counterNeed) < 0) {\n tickerDataTrading.setAsk(tickerDataTrading.getAsk().multiply(BigDecimal.valueOf(1000))); // (null creates issues)\n }\n if (baseFund.compareTo(baseNeed) < 0) {\n tickerDataTrading.setBid(BigDecimal.valueOf(-1));\n }\n // bad design that I pull tickerData then turn it null but I need it to figure baseNeed\n if (counterFund.compareTo(counterNeed) < 0 && baseFund.compareTo(baseNeed) < 0) {\n\n throw new ExchangeDataException(\"You do not have the funds to complete this trade\");\n }\n return tickerDataTrading;\n }\n return tickerData;\n }", "@Override\r\n\tpublic boolean withdraw(double amount) {\n\t\ttry {\r\n\t\t\tif (accountStatus.equals(AccountStatus.ACTIVE)) {\r\n\t\t\t\tif (balance > amount) {\r\n\t\t\t\t\tbalance = (float) (balance - amount);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthrow new InsufficientBalanceException(\"You'er Balance is insufficient to make this transation !\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\telse {\r\n\t\t\t\tthrow new AccountInactiveException(\"You'er Account is not Active !\");\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\tSystem.err.println(e.getMessage());\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public void withdraw(float amount) {}", "public void withdraw(float amount) {}", "void rejectNewOrders();", "public void withdraw(double amount)\n {\n if (amount <= balance) {\n balance = balance - amount;\n }\n else {\n System.err.println(\"Transaction Declined\");\n remainder = balance - amount;\n System.out.println(\"Your balance would have been \" + remainder);\n }\n }", "public void declineTransaction(CommandOfService c) throws Exception {\n // We give back the points to the user\n Service s = c.getService();\n User u = c.getOwner();\n if(s.getTypeService() == 0){\n userDAO.addPoints(s.getCost(),u);\n }\n DAO.declineTransaction(c);\n FacadeNotification facadeNotification = FacadeNotification.getInstance();\n String title = \"Transaction declined!\";\n String desc = \"Your command for: \"+s.getTitle()+\" has been declined.\\n\";\n try {\n facadeNotification.createNotification(u.getIdUser(),title,desc);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "void depositByCash(double amount) {\n\t\tif (isSuspended()) {\n\t\t\tSystem.out.println(\"Account is suspended.\");\n\t\t\tSystem.out.println(\"Depositing failed.\");\n\t\t\treturn;\n\t\t}\n\t\tif (amount <= 0) {\n\t\t\tSystem.out.println(\"Amount must be more than 0.\");\n\t\t\tSystem.out.println(\"Depositing failed.\");\n\t\t\treturn;\n\t\t}\n\t\tbalance += amount;\n\t\tSystem.out.println(\"Deposit \" + amount + \" successfully\");\n\t}", "public void execute() {\r\n int depositAmount = this.promptDepositAmount(); // amount in cents\r\n if (depositAmount != CANCELED) {\r\n screen.displayMessage(\"\\nPlease insert a deposit envelope containing: \");\r\n screen.displayDollarAmount(depositAmount / 100);\r\n screen.displayMessageLine(\".\");\r\n\r\n if (depositSlot.isEnvelopeReceived()) {\r\n screen.displayMessageLine(\"\\nYour envelope has been received.\");\r\n screen.displayMessageLine(\"The money just deposited will not be available until we verify \" +\r\n \"the amount of any enclosed cash and your checks clear.\");\r\n bankDatabase.credit(this.accountNumber, depositAmount / 100);\r\n } else {\r\n screen.displayMessageLine (\"\\nYou did not insert an envelope. The ATM has canceled your transaction.\");\r\n }\r\n } else {\r\n screen.displayMessageLine( \"\\nCanceling transaction...\");\r\n }\r\n }", "@Override\n\tpublic boolean desposit(int accNo, double money) {\n\t\treturn false;\n\t}", "public void payEconomical() {\n if (this.balance >= 2.50) {\n this.balance -= 2.50;\n }\n }", "List<TradeItem> getDeclinedTrades(long accountId);", "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}", "public void trade(Cheese c) {\n if (this.hold == null) {\n this.hold = c;\n } else {\n Cheese tmp = this.hold;\n this.hold = c;\n c = tmp;\n this.hold.beTraded();\n c.beTraded();\n }\n }", "void preWithdraw(double amount) {\n\t\tSystem.out.println(\"Your account is not saver account.\");\n\t}", "public void makeDeposit() {\n deposit();\n }", "void withdraw(double amount) {\n\t\tif (isSuspended()) {\n\t\t\tSystem.out.println(\"Account is suspended.\");\n\t\t\treturn;\n\t\t}\n\t\tif (amount <= 0) {\n\t\t\tSystem.out.println(\"Amount must be more than 0.\");\n\t\t\tSystem.out.println(\"Withdrawing failed.\");\n\t\t\treturn;\n\t\t}\n\t\tif (check(amount)) {\n\t\t\tbalance -= amount;\n\t\t\tSystem.out.println(\"Withdraw \" + amount + \" successfully.\");\n\t\t} else {\n\t\t\tSystem.out.println(\"Withdraw \" + amount + \" unsuccessfully. Do not have enough available funds.\");\n\t\t}\n\t}", "boolean deposite(double amount);", "@Override\r\n\tpublic void saveASNew(Trade trade) {\n\t\ttradeid.setText(new Integer(trade.getId()).toString());\r\n\t\ttradestatus.setText(trade.getStatus());\r\n\t\tactionstatus.removeAllElements();\r\n\t\t\r\n\t//\tprocessActionData(actionstatus,trade.getTradedesc1()); \r\n\t\t/// imp note : wf understand CASH productType as MM so passing MM as hardcoded\r\n processActionData(actionstatus,productType.toUpperCase(),trade.getTradedesc1(),tradestatus.getText(),rtradeservices);\r\n\t\tthis.trade = trade;\r\n\t\tsetTrade(trade);\r\n\t\tgetTradeTransfers(transferPanel);\r\n\t\tgetTradeTask(taskPanel);\r\n\t\tgetTradeSDI(sdiPanel);\r\n\t}", "@Override\n public boolean deposit(Account account, BigDecimal amount) {\n return false;\n }", "public void haltMarket(OrderManagementContext orderManagementContext_);", "public String saleOrdinance(String stockSymbol, int amount, int limit, String userName, String type) throws SymbolDidntExistException, OnlyPositiveNumberException, UserDidntExistException, UserDoesntHoldingTheStockException, UserDoesntHoldEnoughStocksException, TraderDidntExistException, NonTraderUserException, OrdinanceTypeDoesNotExistException {\n OrdinanceType ordinanceType = null;\n\n Trader trader = usersList.getTrader(userName);\n if (trader == null) {\n throw new TraderDidntExistException(userName);\n }\n\n\n if (type.equalsIgnoreCase(\"MKT\") == true) {\n ordinanceType = OrdinanceType.MKT;\n } else if (type.equalsIgnoreCase(\"LMT\") == true) {\n ordinanceType = OrdinanceType.LMT;\n }\n else if (type.equalsIgnoreCase(\"FOK\") == true) {\n ordinanceType = OrdinanceType.FOK;\n }\n else if (type.equalsIgnoreCase(\"IOC\") == true) {\n ordinanceType = OrdinanceType.IOC;\n }\n else{\n throw new OrdinanceTypeDoesNotExistException(type);\n }\n\n Stock stock = stocksList.getStockBySymbol(stockSymbol);\n if (stock == null) {\n throw new SymbolDidntExistException(stockSymbol);\n }\n\n if (trader.getHoldingAmount(stock) < amount) {\n throw new UserDoesntHoldEnoughStocksException(stockSymbol, userName, trader.getHoldingAmount(stock));\n } else if (amount <= 0) {\n throw new OnlyPositiveNumberException(amount);\n } else {\n return (new Trade(new Sale(stock, amount, limit, trader, ordinanceType))).toString();\n }\n }", "boolean withdraw(UUID name, double amount);", "public void buyIn(double buyingAmount) {\n if (bankroll > buyingAmount) {\n bankroll -= buyingAmount;\n activePlayer = true;\n }\n }", "public void completeOrderTransaction(Transaction trans){\n }", "public void onTrade(Trade event) {\n tradeCount++;\n }", "public void withdraw(long amount) {\n\t\n\tif(canWithdraw == true) {\n\t\tSystem.out.println(\"before \"+balance);\n\t\tbalance\t-= amount;\n\t\tSystem.out.println(\"after \"+balance);\n\t\t//add to log\n\t\tlog += \"Withdraw made to this account in the ammount of \"+amount+\" on \"+date+\"\\n\";\n\t\tlog += log += \" Current balance is \"+balance+\" \\n\"+date;\n\t\tupdate();\n\t}else {\n\t\tlog += \"Overdraft account on \"+date+\" \\n\";\n\t\tSystem.out.println(\"Insufficients funds to complete tranaction!\");\n\t\t}//end else statement\n}", "@Override\r\n\tpublic void deposit() {\n\t\tSystem.out.println(\"This Deposit value is from Axisbank class\");\r\n\t\t//super.deposit();\r\n\t}" ]
[ "0.69427556", "0.6506025", "0.6381478", "0.6356175", "0.63299465", "0.6268397", "0.625594", "0.6236207", "0.62029046", "0.61764795", "0.61277926", "0.6044551", "0.59901506", "0.59639466", "0.59622985", "0.5856048", "0.5850192", "0.5835535", "0.5787222", "0.57804835", "0.5776176", "0.5771265", "0.57706654", "0.5763432", "0.5736171", "0.57302034", "0.572663", "0.5705108", "0.5702539", "0.5691146", "0.56774575", "0.56728464", "0.56573516", "0.56479925", "0.56422156", "0.5639113", "0.56321776", "0.56205285", "0.56131303", "0.5604002", "0.5603585", "0.5578898", "0.55788296", "0.55691844", "0.5567973", "0.55624753", "0.5561154", "0.5556099", "0.5549466", "0.5544924", "0.55268025", "0.5512894", "0.5507018", "0.5505874", "0.55050284", "0.548353", "0.5482852", "0.5479639", "0.54684466", "0.5466506", "0.5464863", "0.546451", "0.54565775", "0.54551566", "0.5445259", "0.5443413", "0.543759", "0.54358995", "0.54314274", "0.54214525", "0.541983", "0.5418471", "0.541725", "0.540895", "0.54064107", "0.54064107", "0.54002833", "0.5397468", "0.5394194", "0.53843176", "0.53820854", "0.53807145", "0.5374326", "0.5371594", "0.5370923", "0.5367778", "0.53656006", "0.5362706", "0.5361", "0.536011", "0.53565675", "0.5353202", "0.5343451", "0.533736", "0.5336732", "0.53363276", "0.5335246", "0.53329974", "0.53308886", "0.5327875" ]
0.68045074
1
This method discards the cards as specified by the params
void discardCards(Resources resources);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void discard(){\n for(int i = 1 ; i <= 110 ; i++) cardDeck.remove(i);\n }", "public void discardAll()\n\t{\n\t\thand = new Card[12];\n\t\tnumCards = 0;\n\t}", "private void discardRestrictedCards()\n\t{\n\t\tif (playerList.size() == 2)\n\t\t{\n\t\t\tfor(Card card : restrictedCard2PlayerList)\n\t\t\t{\n\t\t\t\tswitch (card.getType())\n\t\t\t\t{\n\t\t\t\t\tcase GreenPlayerCard:\n\t\t\t\t\tcase BrownPlayerCard:\n\t\t\t\t\t\tCard playerCardMatch = board.getPlayerCardDeck().pickCardByID(card.getId());\n\t\t\t\t\t\tif (playerCardMatch != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tboard.getDiscardDeck().addCard(playerCardMatch);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase CityAreaCard:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PersonalityCard:\n\t\t\t\t\t\tCard personalityCardMatch = board.getPersonalityCardDeck().pickCardByID(card.getId());\n\t\t\t\t\t\tif (personalityCardMatch != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tboard.getDiscardDeck().addCard(personalityCardMatch);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase RandomEventCard:\n\t\t\t\t\t\tCard randomEventCardMatch = board.getRandomEventCardDeck().pickCardByID(card.getId());\n\t\t\t\t\t\tif (randomEventCardMatch != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tboard.getDiscardDeck().addCard(randomEventCardMatch);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void discard(Card card) {\n discardPile.add(card);\n }", "public void discard(Card card) {\n if (!myTurn()) {\n return;\n }\n // CardAction cardAct = new CardAction(card, \"Discard: \" + card.getName());\n // history.add(cardAct);\n\n if (handPile.contains(card)) {\n tmpDiscardPile.add(card);\n handPile.remove(card);\n } else {\n tmpDiscardPile.add(card);\n }\n }", "private void discardPrompt() {\r\n\t\tfor (int i = 0; i < mustDiscard.size(); i++) {\r\n\t\t\tString prompt = \"**[Discard]** a card \";\r\n\t\t\tif (mustDiscard.get(i).contentEquals(\"Sleight of Hand\")) {\r\n\t\t\t\tprompt += \"to draw 2 cards\";\r\n\t\t\t} else if (mustDiscard.get(i).contentEquals(\"Apothecary\")) {\r\n\t\t\t\tprompt += \"to choose one: **3** :crossed_swords: **~OR~** **2** :moneybag: **~OR~** **1** :heart:\";\r\n\t\t\t}\r\n\t\t\tgameChannel.sendMessage(prompt).queue();\r\n\t\t}\r\n\t}", "public void discardToDeck() {\n\t\tfor(int i=discardPile.size(); i>0; i--) {\n\t\t deck.add(discardPile.remove(0));\n\t\t}\n\t\tCollections.shuffle(deck);\n\t}", "public void removeCards() {\n\t\tthis.content.removeAll(this.content);\n\t}", "@Override\n\tpublic ServerResponse movesDiscardCards(DiscardedCards cards) {\n\t\treturn null;\n\t}", "public void discard(int num) {\r\n\t\tfor (int i = 0; i < mustDiscard.size(); i++) {\r\n\t\t\tif (currentPlayer.discard(num)) {\r\n\t\t\t\tif (mustDiscard.get(i).contentEquals(\"Sleight of Hand\")) {\r\n\t\t\t\t\tmustDiscard.remove(i);\r\n\t\t\t\t\tcurrentPlayer.draw(2);\r\n\t\t\t\t\tupdatePlayArea(currentPlayer, false);\r\n\t\t\t\t} else if (mustDiscard.get(i).contentEquals(\"Apothecary\")) {\r\n\t\t\t\t\tmustDiscard.remove(i);\r\n\t\t\t\t\tmustChoose.add(\"Apothecary\");\r\n\t\t\t\t\tchoosePrompt();\r\n\t\t\t\t\tupdatePlayArea(currentPlayer, false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void discard() {\n }", "public void discard();", "public void cancelCard() {}", "public DiscardDeck() {\n\t\tthis.content = new ArrayList<Card>();\n\t}", "public void removePresentCard() {\n storageCards.remove();\n }", "public void cancelCard(String cardNumber) {}", "public void discardCard(int player, Card card) {\r\n\t\tplayers.get(player).removeCard(card);\r\n\t\tdiscardPile.addCard(card);\r\n\t}", "public CardCollection destroyAllCards() ;", "@Override\n public void discardCards(IResourceBank discardedCards) throws ModelException {\n IPlayer p = GameModelFacade.instance().getLocalPlayer();\n\n if (GameModelFacade.instance().getGame().getGameState() != GameState.Discarding\n || p.getResources().getCount() <= 7\n || !p.canAfford(discardedCards)) {\n throw new ModelException(\"Preconditions for action not met.\");\n }\n\n try {\n String clientModel = m_theProxy.discardCards(p.getIndex(), discardedCards);\n new ModelInitializer().initializeClientModel(clientModel, m_theProxy.getPlayerId());\n } catch (NetworkException e) {\n throw new ModelException(e);\n }\n }", "void discard();", "void discard();", "@Override\r\n\tpublic void discard(Resources toDiscard) {\n\t\t\r\n\t}", "public void discardLeader(int bool){\n this.leaderCardsPanel.discardLeaderCard(bool);\n }", "public void giveOutCards() {\n boolean shared = false;\n while (!shared) {\n for (Player player : this.players) {\n if (this.cards.size() == 0) {\n shared = true;\n } else {\n Card card = this.cards.get(0);\n this.cards.remove(0);\n if (!envelope.has(card)) {\n player.addCard(card);\n }\n }\n }\n }\n }", "public Builder clearCards() {\n \n cards_ = getDefaultInstance().getCards();\n onChanged();\n return this;\n }", "public void otherDiscard(int pos, GameCard card){\n this.infoTokens += 1;\n int count = this.discardPile.getOrDefault(card.toString(), 0);\n this.discardPile.put(card.toString(), count + 1);\n playerCardsList.get(turnCounter % playerCardsList.size()).set(pos, card);\n notifyObservors();\n }", "protected void discard() {\r\n discarded = true;\r\n onDiscard();\r\n }", "public void reset() {\r\n\t\tcards.addAll(dealt);\r\n\t\tdealt.clear();\r\n\t}", "public void resetDeck() {\n cards.addAll(removedCards);\n removedCards.clear();\n }", "for (Card ca : deck) {\n\t\tif (ca.suit == 'c') {\n\t\t\tdeck.remove(ca);\n\t\t}\n\t}", "public void resetDeck() {\r\n\t\tcards = new ArrayList<Card>();\r\n\t\tfor (Suit f : Suit.values())\r\n\t\t\tfor (int i = 2; i < 15; i++)\r\n\t\t\t\tcards.add(new Card(i, f));\r\n\r\n\t}", "public void discard(DiscardResponse discardResponse){\n int pos = cardPlayedPos;\n if (discardResponse.accepted){\n this.infoTokens += 1;\n int count = this.discardPile.getOrDefault(discardResponse.gameCard.toString(), 0);\n this.discardPile.put(discardResponse.gameCard.toString(), count + 1);\n playerCardsList.get(0).set(pos, new GameCard());\n }\n notifyObservors();\n }", "void dealTheCards();", "private void removeCard() {\n\t\tint sic_idHolder; // declares sic_idHolder\n\t\t\n\t\tSystem.out.println(\"Please enter the SIC ID number you'd like to remove:\");\n\t\tsic_idHolder = scan.nextInt(); // prompts user to input sic_idHolder\n\t\tscan.nextLine();\n\t\t\n\t\tinventoryObject.removeStockIndexCard(sic_idHolder); //calls removeStockIndexCard from InventoryManagement\n\t\tgetUserInfo();\n\t}", "protected void removeChosenCard(Board gameBoard, Card chosenCard) {\n Iterator<Card> it = myCards.iterator();\n Card tempgroundCard= gameBoard.getGroundCard();\n while (it.hasNext()) {\n Card tempCard = it.next();\n if (tempCard.equals(chosenCard)) {\n it.remove();\n // Card tempgroundCard=gameBoard.getGroundCard;\n if (tempgroundCard instanceof WildDrawCard\n || tempgroundCard instanceof ColorChangeCard) {// if the last ground card was Wild set\n // it black again\n gameBoard.getGroundCard().setColor(0);\n }\n gameBoard.setGroundCard(tempCard);\n gameBoard.addToStorage(tempCard);\n if (!(tempCard instanceof DrawCard) && !(tempCard instanceof WildDrawCard)) { // if the Card was't Draw\n gameBoard.resetDraw();\n }\n cardNumber = myCards.size();\n break;\n }\n }\n }", "boolean CanDiscardCards(Resources resources);", "public CardCollection destroyCards(List<AbstractCard> cardsToDestroy) ;", "public Card drawCard() {\n Card c = cards.get(0);//get a card\n cards.remove(0);//remove the card form the deck that's given out\n discard.add(c);//so the card given out is added to the discard list\n return c;//return a card object\n\n }", "public void disable() {\r\n cardOne.setEnabled(false);\r\n cardTwo.setEnabled(false);\r\n cardThree.setEnabled(false);\r\n cardFour.setEnabled(false);\r\n cardFive.setEnabled(false);\r\n }", "public void discard(Type type) {\n \t\tType choice = type;\n \n \t\t// pick random type if none is specified\n \t\tif (choice == null) {\n \t\t\twhile (true) {\n \t\t\t\tint pick = (int) (Math.random() * Hexagon.TYPES.length);\n \t\t\t\tif (resources[pick] > 0) {\n \t\t\t\t\tchoice = Hexagon.TYPES[pick];\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \n \t\tuseResources(choice, 1);\n \n \t\tint res = Hexagon.getTypeStringResource(choice);\n \t\tappendAction(R.string.player_discarded, res);\n \t}", "public void dealCards() {\n for(int i=0; i < 5; i++) { \n for(PokerPlayer player : players) {\n player.takeCard(deck.draw());\n }\n }\n }", "public void clear(){\r\n cards.clear();\r\n deckSize = 0;\r\n }", "public void hideCard()\n {\n ArrayList<Card> superCards = super.removeCards();\n if (hiddenCard != null) {\n super.addCard(Card.getEmptyCard());\n super.addCards(superCards.subList(1, superCards.size()));\n }\n hidden = true;\n }", "public CardCollection destroyCardType(String type) ;", "Set<Card> remove();", "private void resetCardStates() {\n // Clear newcomers\n for (CardView cardView : cardViews) {\n cardView.setNewcomer(false);\n }\n }", "public String discardCards(DiscardedCards discardedCards) throws Exception {\n\t\tString url = server_url + \"/moves/discardCards\";\n\t\tURL obj = new URL(url);\n\t\tHttpURLConnection con = (HttpURLConnection) obj.openConnection();\n\n\t\t//add request header\n\t\tcon.setRequestMethod(\"POST\");\n\t\tcon.setRequestProperty(\"User-Agent\", \"Mozilla/5.0\");\n\t\tcon.setRequestProperty(\"Accept-Language\", \"en-US,en;q=0.5\");\n\t\tcon.setRequestProperty(\"Cookie\", usercookie + \"; \" + gamecookie);\n\t\t\n\t\tJsonObject info = new JsonObject();\n\t\tinfo.addProperty(\"type\",\"discardCards\");\n\t\tinfo.addProperty(\"playerIndex\", discardedCards.playerIndex);\n\t\t\n\t\tJsonObject discarded = new JsonObject();\n\t\tdiscarded.addProperty(\"wood\", discardedCards.wood);\n\t\tdiscarded.addProperty(\"sheep\", discardedCards.sheep);\n\t\tdiscarded.addProperty(\"ore\", discardedCards.ore);\n\t\tdiscarded.addProperty(\"wheat\", discardedCards.wheat);\n\t\tdiscarded.addProperty(\"brick\", discardedCards.brick);\n\t\tinfo.add(\"discardedCards\", discarded);\n\t\t\n\t\t// Send post request\n\t\tcon.setDoOutput(true);\n\t\tDataOutputStream wr = new DataOutputStream(con.getOutputStream());\n\t\twr.writeBytes(info.toString());\n\t\twr.flush();\n\t\twr.close();\n\n\t\tint responseCode = con.getResponseCode();\n\t\t//System.out.println(\"\\nSending 'POST' request to URL : \" + url);\n\t\t//System.out.println(\"Post parameters : \" + info.toString());\n\t\t//System.out.println(\"Response Code : \" + responseCode);\n\n\t\tif (responseCode == 400) {\n\t\t\tthrow new Exception();\n\t\t}\n\t\tBufferedReader in = new BufferedReader(\n\t\t new InputStreamReader(con.getInputStream()));\n\t\tString inputLine;\n\t\tStringBuffer response = new StringBuffer();\n\n\t\twhile ((inputLine = in.readLine()) != null) {\n\t\t\tresponse.append(inputLine);\n\t\t}\n\t\tin.close();\n\t\t\n\t\t//print result\n\t\t////System.out.println(response.toString());\n\t\treturn response.toString();\n\t}", "@Override\n public boolean canUseCard(){\n return false;\n }", "public void setPlayerDeckByCardType(List<CardModel> cards, EnumHandler.CardType cardType, int numbeOfUnits) {\n ArrayList<CardModel> playerCards=playerModel.getDeck();\n ArrayList<CardModel> playerCardsToRemove=new ArrayList<CardModel>();\n int cardCounter=0;\n if(cards!=null){\n\n for (int i = 0; i < playerCards.size(); i++){\n if(playerCards.get(i).getCardType() == cardType && cardCounter<numbeOfUnits){\n playerCardsToRemove.add(playerCards.get(i));\n cardCounter=cardCounter+1;\n }\n }\n if(playerCardsToRemove.size() > 0) {\n playerCards.removeAll(playerCardsToRemove);\n }\n cardCounter=0;\n }\n\n\n /// CardModel card = cards.stream().filter(x -> x.getCardType().equals(cardType)).findFirst().get();\n// if (card != null) {\n// //card.setNumberOfCards(card.getNumberOfCards() - numbeOfUnits);\n// }\n\n }", "@Test\n public void discardDrawFour() {\n this.reset();\n this.bps.startGame(this.fullDeck, false, 7, 3);\n assertEquals(this.drawCards, this.bps.getDrawCards());\n this.bps.discardDraw(0);\n assertNotEquals(this.drawCards, this.bps.getDrawCards());\n\n this.reset();\n this.bps.startGame(this.fullDeck, false, 7, 1);\n this.bps.discardDraw(0);\n ArrayList<Card> draw = new ArrayList<>();\n draw.add(h4);\n assertEquals(draw, this.bps.getDrawCards());\n }", "private void reshuffleDiscardPile() {\n ICard topCard = discardPile.pop();\n\n drawPile.addAll(discardPile);\n Collections.shuffle(drawPile, rng);\n\n discardPile.clear();\n discardPile.add(topCard);\n }", "public void findAndRemoveCard(Card c){\n\t\tboolean b = myCards.remove(c);\n//\t\tSystem.out.println(\"mycards size\" + myCards.size() + \"and removed was \" + b);\n\t\treturn;\n\t}", "public void removeCard(int index) {\n cards.remove(index);\n }", "private void eliminatePlayers() {\n \n Iterator<Player> iter = players.iterator();\n\n while (iter.hasNext()) {\n Player player = iter.next();\n\n if (player.getList().isEmpty()) {\n iter.remove();\n if (player.getIsHuman()) {\n setGameState(GameState.HUMAN_OUT);\n }\n // need to remember that due to successive draws, the active player could run\n // out of cards\n // select a new random player if player gets eliminated\n if (!players.contains(activePlayer)) {\n selectRandomPlayer();\n }\n }\n }\n }", "public Card removeCard(){\n Card temp = pile[0]; //removes top card. putting placement card to avoid null pointer\n for(int i = 0; i < pilePlace; i++){ //shifts cards\n pile[i] = pile[i+1];\n }\n pilePlace--;\n return temp;\n\n }", "public void removeCards(int i) {\n while (i > 0) {\n removeCard(cardViews.get(0));\n i--;\n }\n }", "public void discard(EnumRegion playerRegion, EnumPolicy card)\n {\n if (!playerRegion.isUS())\n {\n throw new IllegalArgumentException(\"discard(=\"+playerRegion+\", cards) must be \" +\n \"a player region.\");\n }\n\n CardDeck deck = playerDeck[playerRegion.ordinal()];\n deck.discard(card);\n }", "public void removeCardToSplit() {\n if (cards.size() == 2) {\n cards.remove(1);\n super.setSize(1);\n }\n }", "public void RemoveCardFromComputer(int value){\n handComputer.remove(value);\n }", "boolean canBeRemoved(int cardIndex);", "protected void onDiscard() {\r\n this.setActive(false);\r\n }", "private void discardNecklaceIfVisible(){\n CardDealer cardDealer = CardDealer.getInstance();\n Treasure necklace = null;\n for (Treasure t: this.visibleTreasures){\n if (t.getType() == TreasureKind.NECKLACE){\n necklace = t;\n }\n }\n if (necklace != null){\n this.visibleTreasures.remove(necklace);\n cardDealer.giveTreasureBack(necklace);\n }\n }", "public void discardLeaderCard(Player player, int leaderCardAtIndex, InformationCallback informationCallback){\n player.getPersonalBoard().getLeaderCards().remove(leaderCardAtIndex);\n CouncilPrivilege councilPrivilege = new CouncilPrivilege(1);\n councilPrivilege.chooseCouncilPrivilege(player, informationCallback);\n }", "public void deleteAllCards()\n\t{\n\t\tcards.clear();\n\t\t\n\t\t// Update the views\n\t\tsyncCardsWithViews();\n\t\t\n\t}", "public void clearHand(){\n\t\tthis.hand = new ArrayList<Card>();\n\t}", "public void setClearCards(String type) {\r\n int currentSize = getGiftCardList().size();\r\n \r\n setGiftCardList(new ArrayList());\r\n for (int i = 0; i < currentSize; i++) {\r\n addBlankGiftCard(getGiftCardList());\r\n }\r\n \r\n setGiftCardTempList(new ArrayList());\r\n for (int i = 0; i < getMaxNumGiftCards(); i++) {\r\n addBlankGiftCard(getGiftCardTempList());\r\n }\r\n }", "public List<PlayerResult> dealCards(List<Player> players) {\n return null;\n }", "private void setPlayerDeckByCardType(List<CardModel> cards, EnumHandler.CardType cardType) {\n ArrayList<CardModel> playerCards=playerModel.getDeck();\n ArrayList<CardModel> playerCardsToRemove=new ArrayList<CardModel>();\n int cardCounter=0;\n int cardsLimit=(3 * (cards.size()/ 3));\n if(cards!=null){\n\n for (int i = 0; i < playerCards.size(); i++){\n if(playerCards.get(i).getCardType() == cardType && cardCounter<cardsLimit){\n playerCardsToRemove.add(playerCards.get(i));\n cardCounter=cardCounter+1;\n }\n }\n if(playerCardsToRemove.size() >0) {\n playerCards.removeAll(playerCardsToRemove);\n }\n cardCounter=0;\n }\n }", "@Test\n public void discardPlayer2() {\n gm.setPlayerInfo(clientPlayer2);\n gm.setThisPlayerIndex(clientPlayer2.getPlayerIndex());\n\n dc.increaseAmount(ResourceType.ORE);\n dc.increaseAmount(ResourceType.ORE);\n dc.increaseAmount(ResourceType.WOOD);\n dc.increaseAmount(ResourceType.WOOD);\n assertEquals(2, getAmounts().getOfType(ResourceType.ORE));\n assertEquals(2, getAmounts().getOfType(ResourceType.WOOD));\n Player p = model.getPlayer(clientPlayer2.getPlayerIndex());\n ResourceSet discardSet = dc.getDiscardAmount();\n when(robberFacade.canDiscard(discardSet, p)).thenReturn(true);\n dc.discard();\n // This verifies that the robberFacade.discard is only called twice\n verify(robberFacade, atMost(2)).discard(discardSet, p);\n\n }", "public void forceDiscard(TurnTracker turn_tracker_pointer, int player_index) throws Exception;", "void playerUsedCard(Card c, boolean discard) {\n\t\t// The creator data is in the 2 first bytes, the other player in the 2\n\t\t// last bytes.\n\t\tplayedCard[0] = (discard ? DISCARDED_CARD : PLAYED_CARD);\n\t\tplayedCard[1] = (byte) c.id;\n\t}", "public void RemoveCardFromDeck(int value){\n deck.remove(value);\n }", "private void discardPlayer(Player p)\n {\n locations.remove(p);\n plugin.getAM().arenaMap.remove(p);\n clearPlayer(p);\n }", "public TrainCard usedCard(){\n TrainCard removedCard = cardDeck.remove(0);\n return removedCard;\n }", "public void addCardsToDiscardPile(List<Card> cards) {\r\n discardPile.addAll(cards); // TODO: this triggers a nullpointerexception ( ava.lang.NullPointerException: Attempt to invoke interface method 'int java.util.Collection.size()' on a null object reference\r\n // at java.util.LinkedList.addAll(LinkedList.java:386)\r\n // at ch.ethz.inf.vs.a4.minker.einz.model.GlobalState.addCardsToDiscardPile(GlobalState.java:158) )\r\n discardPile.subList(Math.max(0, discardPile.size() - maxDiscardPileSize), discardPile.size());\r\n }", "public void discardContent() {\n dispose();\n }", "public void removePapalCard(int i){\n this.gameboardPanel.removePapalCard(i);\n }", "void discardProfile( String profileId );", "public void discard(int idGioc, String value){\n\t\t partita.discard( idGioc, value);\n\t}", "public void dealCards(List<Player> players) {\n card.dealCards(players);\n }", "public void discardLeaderCard(int index) throws LeaderCardsGameBoardEmptyException, IOException, InterruptedException {\n try {\n currentPlayer.discardLeaderCard(index);\n } catch (CallForCouncilException e) {\n exceptionHandler(e);\n } catch (LastSpaceReachedException e) {\n exceptionHandler(e);\n }\n notifyToOneObserver(new DiscardLeaderForCurrentMessage(index));\n notifyAllObserverLessOne(new DiscardLeaderForNotCurrentMessage(currentPlayer.getNickName()));\n\n notifyToOneObserver(new FaithPathMessage(1));\n notifyAllObserverLessOneByNickname(new FaithPathOpponentMessage(currentPlayer.getNickName(), 1),currentPlayer.getNickName());\n\n\n }", "public void removeParade(){\n\t\tfor(int i = 0; i < count; i++){\n\t\t\tthis.getChildren().remove(paradeCards[i]);\n\t\t}\n\t}", "public void discardLeaderCard(Player player, int leaderCardAtIndex, Privilege privilege){\n player.getPersonalBoard().getLeaderCards().remove(leaderCardAtIndex);\n for (Map.Entry<ResourceType, Integer> entry: privilege.getValuables().getResources().entrySet()) {\n if(entry.getValue() > 0) {\n player.getPersonalBoard().getValuables().increase(entry.getKey(), entry.getValue());\n player.getPersonalBoard().getValuables().decrease(entry.getKey(), player.getPersonalBoard().getExcommunicationValues().getNormalResourcesMalus().get(entry.getKey()));\n }\n }\n\n for (Map.Entry<PointType, Integer> entry: privilege.getValuables().getPoints().entrySet()) {\n if(entry.getValue() > 0) {\n player.getPersonalBoard().getValuables().increase(entry.getKey(), entry.getValue());\n player.getPersonalBoard().getValuables().decrease(entry.getKey(), player.getPersonalBoard().getExcommunicationValues().getNormalPointsMalus().get(entry.getKey()));\n }\n }\n }", "private void clearPreviousInstances() {\n DiscardedCards.clearInstance();\n Fireworks.clearInstance();\n History.clearInstance();\n SelectedSymbol.clearInstance();\n Tokens.clearInstance();\n HanabiCards.initDeck();\n }", "@Override\n public void removeCard(int i) {\n this.cards.remove(i);\n }", "public void reset(){\n\n deck = new PlayingCard[52];\n String[] cardTypes = {\"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"J\", \"Q\", \"K\"};\n\n // initialise Aces separately for a cleaner loop later\n deck[0] = new PlayingCard(\"A\", PlayingCard.HEARTS, 1, 14);\n deck[1] = new PlayingCard(\"A\", PlayingCard.DIAMONDS, 1, 14);\n deck[2] = new PlayingCard(\"A\", PlayingCard.CLUBS, 1, 14);\n deck[3] = new PlayingCard(\"A\", PlayingCard.SPADES, 1, 14);\n\n int j = 0;\n\n for(int i = 0; i < Constants.SUIT_SIZE-1; ++i) {\n\n j = (i+1) * 4; // used to be able to declare 4 cards at once without overwriting\n deck[j] = new PlayingCard(cardTypes[i], PlayingCard.HEARTS, i + 2, i + 2);\n deck[j+1] = (new PlayingCard(cardTypes[i], PlayingCard.CLUBS, i + 2, i + 2));\n deck[j+2] = new PlayingCard(cardTypes[i], PlayingCard.DIAMONDS, i + 2, i + 2);\n deck[j+3] = new PlayingCard(cardTypes[i], PlayingCard.SPADES, i + 2, i + 2);\n }\n\n this.shuffle();\n }", "public void discardItem(LoopManiaWorld world) {\n super.discardItem(world, PRICE);\n }", "public void removePrevCardList(){\n for (int i = 0; i < playerCardList.getPlayerCardListSize(); i++){\n playerCardPuzzle.getChildren().remove(playerCardList.getPlayerCardByNo(i));\n }\n }", "private void dealCards(){\n\t\tfor(int k = 0; k <2;k++){\n\t\t\tfor(int i = 0; i < Players.size();i++){\n\t\t\t\tPlayers.get(i).addCardToHand(gameDeck.dealCard());\n\t\t\t}\n\t\t}\n\t\t\n\t setChanged();\n\t notifyObservers(\"CardsDealed\");\n\t}", "public void clearHand() {\n cards.clear();\n aceCount = 0;\n setSize(0);\n }", "private java.util.List<Card> deal(java.util.List<Card> hand, int numCards) {\n for (int i = 0; i < numCards; ++i) {\n hand.add(removeTop(deck));\n }\n return hand;\n }", "public void resetCityAreaCards() {\r\n\t\tfor (CityAreaCard c : cityCards) {\r\n\t\t\tc.reset();\r\n\t\t}\r\n\t}", "@Override\n public void askLeaderCardToKeep(ArrayList<LeaderCard> leaderCards) throws IOException, InterruptedException {\n\n\n clear(container);\n\n CardManager cardManager = new CardManager(container,gui);\n cardManager.setHeading(\"Choose two cards:\");\n cardManager.showWhatToChoose(true);\n\n applyChangesTo(container);\n }", "public ArrayList<Player> checkToEliminate() {\n ArrayList<Player> eliminated = new ArrayList<Player>();\n\n // Check which players are to be eliminated\n for (Player player : playersInGame) {\n if (player.peekCard() == null) {\n eliminated.add(player);\n }\n }\n\n // Eliminate players from model\n for (Player eliminatedPlayer : eliminated) {\n playersInGame.remove(eliminatedPlayer);\n }\n\n return eliminated;\n }", "public void remove(int idx) {\r\n\t\tcards.remove(idx);\r\n\t}", "public void dealCards () {\t\n\n\t\tint numOfPlayers = players.size();\n\t\tint count = 0;\n\t\tCard[] cards = deck.getDeck();\n\t\tfor (int i=0; i<cards.length; i++) {\n\t\t\t\t// Go through all the cards, for each player deal 1 card at a time\n\t\t\t\t(players.get(count % numOfPlayers).getCards()).add(cards[i]); \n\t\t\t\tcount++;\n\t\t}\n\t}", "public void reset() {\r\n setGiftCardList(new ArrayList());\r\n for (int i = 0; i < getMaxNumGiftCards(); i++) {\r\n addBlankGiftCard(getGiftCardList());\r\n }\r\n \r\n setGiftCardTempList(new ArrayList());\r\n for (int i = 0; i < getMaxNumGiftCards(); i++) {\r\n addBlankGiftCard(getGiftCardTempList());\r\n }\r\n }", "public synchronized void discardPage(PageId pid) {\n // some code goes here\n // only necessary for lab5\n bufferPool.remove(pid);\n }", "public void RemoveCardFromHuman(int value){\n handHuman.remove(value);\n }", "public void endRound() {\n if (!myTurn()) {\n return;\n }\n if (this.board.getWinners().size() > 0 && this.playerId == board.getPlayers().get(board.getPlayers().size() - 1).playerId) {\n this.board.setRunning(false);\n }\n // currentPlayerNumber = (currentPlayerNumber + 1) % players.size();\n // current = players.get(currentPlayerNumber);\n this.removableBlockades = new ArrayList<>();\n coins = (float) 0;\n bought = false;\n specialAction.setDraw(0);\n specialAction.setRemove(0);\n specialAction.setSteal(0);\n history = new ArrayList<>();\n //for (int i = tmpDiscardPile.size(); i > 0; i--){\n // discardPile.add(tmpDiscardPile.remove(0));\n //}\n discardPile.addAll(tmpDiscardPile);\n tmpDiscardPile = new ArrayList<Card>();\n draw();\n board.endRound();\n }" ]
[ "0.7733731", "0.7394855", "0.7391059", "0.7121058", "0.69007474", "0.6841378", "0.68393594", "0.6829219", "0.6826293", "0.6796913", "0.6793262", "0.6734885", "0.67186517", "0.6679165", "0.64350754", "0.63829434", "0.63813126", "0.63046384", "0.62907016", "0.6259853", "0.6259853", "0.6237833", "0.61953294", "0.61685765", "0.6105166", "0.6065729", "0.60565436", "0.60538137", "0.60397524", "0.6037294", "0.6035435", "0.60259247", "0.6025291", "0.6006536", "0.59903735", "0.594247", "0.59317654", "0.59312457", "0.5909996", "0.5908203", "0.5905114", "0.58928436", "0.5850042", "0.58203584", "0.5811183", "0.57610494", "0.57436186", "0.57406825", "0.57385415", "0.5737169", "0.57168156", "0.57156783", "0.57121325", "0.570867", "0.5702688", "0.5677845", "0.56657547", "0.5663662", "0.5663319", "0.5653097", "0.5641798", "0.5637792", "0.5621047", "0.5620185", "0.56151545", "0.56136435", "0.5605016", "0.5602462", "0.5596197", "0.5589025", "0.55861783", "0.5582904", "0.55803466", "0.55788374", "0.5576483", "0.557342", "0.5572228", "0.5562883", "0.5555143", "0.55548686", "0.5538247", "0.55374277", "0.552613", "0.55219626", "0.55194724", "0.55169386", "0.5511288", "0.5509778", "0.5505926", "0.5497988", "0.54926944", "0.5490701", "0.54902923", "0.54868555", "0.5482638", "0.54804313", "0.54766953", "0.5458478", "0.54439294", "0.54386836" ]
0.7676681
1
This method builds a road specified by the edge and if it is free or not
void buildRoad(EdgeLocation edge, boolean free);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean build(Edge edge) {\n \t\tif (edge == null || !canBuild(edge))\n \t\t\treturn false;\n \n \t\t// check resources\n \t\tboolean free = board.isSetupPhase() || board.isProgressPhase();\n \t\tif (!free && !affordRoad())\n \t\t\treturn false;\n \n \t\tif (!edge.build(this))\n \t\t\treturn false;\n \n \t\tif (!free) {\n \t\t\tuseResources(Type.BRICK, 1);\n \t\t\tuseResources(Type.LUMBER, 1);\n \t\t}\n \n \t\tappendAction(R.string.player_road);\n \n \t\tboolean hadLongest = (board.getLongestRoadOwner() == this);\n \t\tboard.checkLongestRoad();\n \n \t\tif (!hadLongest && board.getLongestRoadOwner() == this)\n \t\t\tappendAction(R.string.player_longest_road);\n \n \t\troads.add(edge);\n \n \t\tVertex vertex = edge.getVertex1();\n \t\tif (!reaching.contains(vertex))\n \t\t\treaching.add(vertex);\n \n \t\tvertex = edge.getVertex2();\n \t\tif (!reaching.contains(vertex))\n \t\t\treaching.add(vertex);\n \n \t\treturn true;\n \t}", "boolean canPlaceRoad(EdgeLocation edgeLoc, boolean free);", "boolean CanUseRoadBuilder(EdgeLocation spot1, EdgeLocation spot2);", "public void buildInitialRoad(Edge edge) throws CannotBuyException, InsufficientPlayerResourcesException, AllPiecesPlayedException {\n\t\t if(canDoBuildInitialRoad() == false) {\n\t\t\t throw new CannotBuyException(\"Cannot Buy Road, possibly no edge to place a road\");\n\t\t }\n\t\t playerPieces.placeRoad(edge);\n\t }", "@Override\r\n\tpublic void buildRoad() {\n\t\t\r\n\t}", "private boolean buildStreetIsAllowed(Road road) {\r\n\t\tif (!client.isBeginning()\r\n\t\t\t\t&& road.isBuildable(island, client.getSettler().getID())\r\n\t\t\t\t&& road.getOwner() == Constants.NOBODY) {\r\n\t\t\treturn true;\r\n\t\t} else if (((client.isBeginning() && road.getEnd() == getLastSettlementNode()) || (client\r\n\t\t\t\t.isBeginning() && road.getStart() == getLastSettlementNode()))\r\n\t\t\t\t&& road.getOwner() == Constants.NOBODY) {\r\n\t\t\treturn true;\r\n\t\t} else\r\n\t\t\treturn false;\r\n\t}", "public boolean canBuild(Edge edge) {\n \t\tif (edge == null || roads.size() >= MAX_ROADS)\n \t\t\treturn false;\n \n \t\tif (board.isSetupPhase()) {\n \t\t\t// check if the edge is adjacent to the last town built\n \t\t\tif (lastTown != edge.getVertex1() && lastTown != edge.getVertex2())\n \t\t\t\treturn false;\n \t\t}\n \n \t\treturn edge.canBuild(this);\n \t}", "public boolean affordRoad() {\n \t\treturn (FREE_BUILD || roads.size() < MAX_ROADS\n \t\t\t\t&& getResources(Type.BRICK) >= 1\n \t\t\t\t&& getResources(Type.LUMBER) >= 1);\n \t}", "private boolean roadCheck(Road road) {\n\t\t\n\t\treturn false;\n\t}", "public void buyRoad(Edge edge) throws CannotBuyException, InsufficientPlayerResourcesException, AllPiecesPlayedException {\n\t\t if(canDoBuyRoad() == false) {\n\t\t\t throw new CannotBuyException(\"Cannot Buy Road, possibly no edge to place a road\");\n\t\t }\n\t\t resourceCardHand.payForRoad();\n\t\t playerPieces.placeRoad(edge);\n\t }", "private boolean isCanBuildRoad(Rectangle newRoad) {\n\t\tfor (Node otherRoad : roads) {\n\t\t\tif (newRoad.getBoundsInParent().intersects(otherRoad.getBoundsInParent())) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public void createEdges() {\n \tfor(String key : ways.keySet()) {\n \t Way way = ways.get(key);\n \t if(way.canDrive()) {\n \t\tArrayList<String> refs = way.getRefs();\n \t\t\t\n \t\tif(refs.size() > 0) {\n \t\t GPSNode prev = (GPSNode) this.getNode(refs.get(0));\n \t\t drivableNodes.add(prev);\n \t\t \n \t\t GPSNode curr = null;\n \t\t for(int i = 1; i <refs.size(); i++) {\n \t\t\tcurr = (GPSNode) this.getNode(refs.get(i));\n \t\t\tif(curr == null || prev == null)\n \t\t\t continue;\n \t\t\telse {\n \t\t\t double distance = calcDistance(curr.getLatitude(), curr.getLongitude(),\n \t\t\t\t prev.getLatitude(), prev.getLongitude());\n\n \t\t\t GraphEdge edge = new GraphEdge(prev, curr, distance, way.id);\n \t\t\t prev.addEdge(edge);\n \t\t\t curr.addEdge(edge);\n \t\t\t \n \t\t\t drivableNodes.add(curr);\n \t\t\t prev = curr;\n \t\t\t}\n \t\t }\t\n \t\t}\n \t }\n \t}\n }", "private boolean buildStreetIsAllowed() {\r\n\t\tif (clickedRoad.getEnd() == lastSettlementNode\r\n\t\t\t\t|| clickedRoad.getStart() == lastSettlementNode) {\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 addRoad(\n String fromName, String toName, double roadDistance, String roadName\n ) {\n Vertex<String> from = addLocation(fromName);\n Vertex<String> to = addLocation(toName);\n\n // Add the road to the network - We assume all roads are two-way and\n // ignore if we've already added the road as a reverse of another\n try {\n\n Edge<String> road = graph.insert(from, to, roadName);\n Edge<String> backwardsRoad = graph.insert(to, from, roadName);\n\n // Label each road with it's weight\n graph.label(road, roadDistance);\n graph.label(backwardsRoad, roadDistance);\n\n } catch (InsertionException ignored) {\n return false;\n }\n\n return true;\n }", "private void buildStreet() {\r\n\t\tbuilt = false;\r\n\t\tbuildPanelRoad.setVisible(false);\r\n\t\tMessage message = new Message(clickedRoad, true, null);\r\n\t\tsendMessage(message);\r\n\t}", "private boolean linkMappingAggSeparate(VirtualLink vLink, SubstrateSwitch edgeSwitch1, SubstrateSwitch edgeSwitch2, \n\t\t\tLinkedList<SubstrateSwitch> listAggConnectStartEdge, Topology topo) {\n\t\tboolean success = false;\n\t\tboolean checkAgg = false;\n\t\tboolean checkEdge = false;\n\t\tdouble bandwidth = vLink.getBandwidthRequest();\n\t\t\n\t\tLinkedList<LinkPhyEdge> listPhyEdge = topo.getListLinkPhyEdge();\n\t\tLinkedList<SubstrateLink> listLinkBandwidth = topo.getLinkBandwidth();\n\t\t\n\t\tPhysicalServer phy1 = vLink.getsService().getBelongToServer();\n\t\tPhysicalServer phy2 = vLink.getdService().getBelongToServer();\n\t\t\n\t\tSubstrateLink linkAggEdge01 = new SubstrateLink();\n\t\tSubstrateLink linkAggEdge10 = new SubstrateLink();\n\t\tSubstrateLink linkAggEdge02 = new SubstrateLink();\n\t\tSubstrateLink linkAggEdge20 = new SubstrateLink();\n\t\t\n\t\tLinkPhyEdge linkPhyEdge1 = new LinkPhyEdge();\n\t\tLinkPhyEdge linkPhyEdge2 = new LinkPhyEdge();\n\t\t\n\t\tSubstrateSwitch aggSW = new SubstrateSwitch();\n\t\t\n\t\t\n\t\tfor(SubstrateSwitch sw : listAggConnectStartEdge) {\n\t\t\tint count = 0;\n\t\t\tfor(SubstrateLink link : listLinkBandwidth) {\n\t\t\t\tif(link.getStartSwitch().equals(sw) && link.getEndSwitch().equals(edgeSwitch1) && link.getBandwidth() >= bandwidth) {\n\t\t\t\t\tcount++;\n\t\t\t\t\tlinkAggEdge01 = link;\n\t\t\t\t} else if(link.getStartSwitch().equals(edgeSwitch1) && link.getEndSwitch().equals(sw) && link.getBandwidth() >= bandwidth) {\n\t\t\t\t\tcount++;\n\t\t\t\t\tlinkAggEdge10 = link;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(link.getStartSwitch().equals(sw) && link.getEndSwitch().equals(edgeSwitch2) && link.getBandwidth() >= bandwidth) {\n\t\t\t\t\tcount++;\n\t\t\t\t\tlinkAggEdge02 = link;\n\t\t\t\t} else if(link.getStartSwitch().equals(edgeSwitch2) && link.getEndSwitch().equals(sw) && link.getBandwidth() >= bandwidth) {\n\t\t\t\t\tcount++;\n\t\t\t\t\tlinkAggEdge20 = link;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(count == 4) {\n\t\t\t\t\taggSW = sw;\n\t\t\t\t\tcheckAgg = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tint count = 0;\n\t\tfor(LinkPhyEdge link : listPhyEdge) {\n\t\t\tif(link.getEdgeSwitch().equals(edgeSwitch1) && link.getPhysicalServer().equals(phy1) && link.getBandwidth() >= bandwidth) {\n\t\t\t\tlinkPhyEdge1 = link;\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\t\n\t\t\tif(link.getEdgeSwitch().equals(edgeSwitch2) && link.getPhysicalServer().equals(phy2) && link.getBandwidth() >= bandwidth) {\n\t\t\t\tlinkPhyEdge2 = link;\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\t\n\t\t\tif(count == 2) {\n\t\t\t\tcheckEdge = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(checkAgg == true && checkEdge == true) {\n\t\t\t\n\t\t\tsuccess = true;\n\t\t\t\n\t\t\tLinkedList<SubstrateSwitch> listSWUsed = topo.getListSwitchUsed();\n\t\t\tboolean checkContain = false;\n\t\t\tfor(SubstrateSwitch sw : listSWUsed) {\n\t\t\t\tif(sw.getNameSubstrateSwitch().equals(aggSW.getNameSubstrateSwitch())) {\n\t\t\t\t\tcheckContain = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(checkContain == false) {\n\t\t\t\tlistSWUsed.add(aggSW);\n\t\t\t\ttopo.setListSwitchUsed(listSWUsed);\n\t\t\t}\n\t\t\t\n\t\t\tlinkAggEdge01.setBandwidth(linkAggEdge01.getBandwidth() - bandwidth);\n\t\t\tlinkAggEdge01.getStartSwitch().setPort(linkAggEdge01.getEndSwitch(), bandwidth);\n\t\t\tlinkAggEdge10.setBandwidth(linkAggEdge10.getBandwidth() - bandwidth);\n\t\t\tlinkAggEdge10.getStartSwitch().setPort(linkAggEdge10.getEndSwitch(), bandwidth);\n\t\t\tlinkAggEdge02.setBandwidth(linkAggEdge02.getBandwidth() - bandwidth);\n\t\t\tlinkAggEdge02.getStartSwitch().setPort(linkAggEdge02.getEndSwitch(), bandwidth);\n\t\t\tlinkAggEdge20.setBandwidth(linkAggEdge20.getBandwidth() - bandwidth);\n\t\t\tlinkAggEdge20.getStartSwitch().setPort(linkAggEdge20.getEndSwitch(), bandwidth);\n\t\t\tvLink.getLinkSubstrate().add(linkAggEdge01);\n\t\t\tvLink.getLinkSubstrate().add(linkAggEdge10);\n\t\t\tvLink.getLinkSubstrate().add(linkAggEdge02);\n\t\t\tvLink.getLinkSubstrate().add(linkAggEdge20);\n\t\t\t\n\t\t\tlinkPhyEdge1.setBandwidth(linkPhyEdge1.getBandwidth() - bandwidth);\n\t\t\tlinkPhyEdge1.getEdgeSwitch().setPort(linkPhyEdge1.getEdgeSwitch(), bandwidth);\n\t\t\tlinkPhyEdge2.setBandwidth(linkPhyEdge2.getBandwidth() - bandwidth);\n\t\t\tlinkPhyEdge2.getEdgeSwitch().setPort(linkPhyEdge2.getEdgeSwitch(), bandwidth);\t\t\t\n\t\t\tvLink.getLinkPhyEdge().add(linkPhyEdge1);\n\t\t\tvLink.getLinkPhyEdge().add(linkPhyEdge2);\n\t\t\t\n\t\t} else {\n\t\t\tsuccess = false;\n\t\t}\n\t\t\n\t\treturn success;\n\t}", "@Override\r\n\tpublic void placeRoad(EdgeLocation edgeLoc) {\n\t\t\r\n\t}", "private boolean forbidEdgeCreation(NetworkEdge edge) {\n return network.getEdges().stream()\n .filter(networkEdge ->\n edge.getFrom().equals(networkEdge.getTo())\n ).anyMatch(networkEdge ->\n edge.getTo().equals(networkEdge.getFrom())\n );\n }", "public void setRoad(Boolean bool) {\r\n\t \tthis.road = bool;\r\n\t }", "public boolean addEdge(Edge e) {\n return g.addNode(e.getSrc())&&g.addNode(e.getDst())&&g.addEdge(e.getSrc(),e.getDst());\n }", "private Set<Cell> findShortestRoad(Set<Cell> b, Land land) {\n\t\tfor (Cell cell : b) {\n\t\t\tif (isNextToRoad(cell.i, cell.j, land))\n\t\t\t\treturn new HashSet<Cell>();\n\t\t}\n\t\t\n\t\tSet<Cell> output = new HashSet<Cell>();\n\t\tboolean[][] checked = new boolean[land.side][land.side];\n\t\tQueue<Cell> queue = new LinkedList<Cell>();\n\t\t// add border cells that don't have a road currently\n\t\t// dummy cell to serve as road connector to perimeter cells\n\t\tCell source = new Cell(Integer.MAX_VALUE, Integer.MAX_VALUE);\n\t\tfor (int z = 0; z < land.side; z++) {\n\t\t\tif (b.contains(new Cell(0, z)) || b.contains(new Cell(z, 0)) || b.contains(new Cell(land.side - 1, z))\n\t\t\t\t\t|| b.contains(new Cell(z, land.side - 1)))\n\t\t\t\treturn output;\n\t\t\tif (land.unoccupied(0, z))\n\t\t\t\tqueue.add(new Cell(0, z, source));\n\t\t\tif (land.unoccupied(z, 0))\n\t\t\t\tqueue.add(new Cell(z, 0, source));\n\t\t\tif (land.unoccupied(z, land.side - 1))\n\t\t\t\tqueue.add(new Cell(z, land.side - 1, source));\n\t\t\tif (land.unoccupied(land.side - 1, z))\n\t\t\t\tqueue.add(new Cell(land.side - 1, z, source));\n\t\t}\n\t\t// add cells adjacent to current road cells\n\t\tfor (Cell p : road_cells) {\n\t\t\tfor (Cell q : p.neighbors()) {\n\t\t\t\tif (!road_cells.contains(q) && land.unoccupied(q) && !b.contains(q))\n\t\t\t\t\tqueue.add(new Cell(q.i, q.j, p)); // use tail field of cell\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// to keep track of\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// previous road cell\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// during the search\n\t\t\t}\n\t\t}\n\t\twhile (!queue.isEmpty()) {\n\t\t\tCell p = queue.remove();\n\t\t\tchecked[p.i][p.j] = true;\n\t\t\tfor (Cell x : p.neighbors()) {\n\t\t\t\tif (b.contains(x)) { // trace back through search tree to find\n\t\t\t\t\t\t\t\t\t\t// path\n\t\t\t\t\tCell tail = p;\n\t\t\t\t\twhile (!b.contains(tail) && !road_cells.contains(tail) && !tail.equals(source)) {\n\t\t\t\t\t\toutput.add(new Cell(tail.i, tail.j));\n\t\t\t\t\t\ttail = tail.previous;\n\t\t\t\t\t}\n\t\t\t\t\tif (!output.isEmpty())\n\t\t\t\t\t\treturn output;\n\t\t\t\t} else if (!checked[x.i][x.j] && land.unoccupied(x.i, x.j)) {\n\t\t\t\t\tx.previous = p;\n\t\t\t\t\tqueue.add(x);\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\tif (output.isEmpty() && queue.isEmpty())\n\t\t\treturn null;\n\t\telse\n\t\t\treturn output;\n\t}", "@Override\n public void placeRoad(EdgeLocation edge) throws ModelException {\n assert edge != null;\n\n if (!GameModelFacade.instance().canPlaceRoad(edge)) {\n throw new ModelException(\"Preconditions for action not met.\");\n }\n\n try {\n String clientModel = m_theProxy.buildRoad(GameModelFacade.instance().getLocalPlayer().getIndex(), edge, GameModelFacade.instance().isFreeRound());\n new ModelInitializer().initializeClientModel(clientModel, m_theProxy.getPlayerId());\n } catch (NetworkException e) {\n throw new ModelException(e);\n }\n }", "public void setRoad(int a, int b, int size) {\n if (size != 0 && roads[a][b] == 0) {\n roadCount++;\n inDegree[b]++;\n outDegree[a]++;\n } else if (size == 0 && roads[a][b] != 0) {\n roadCount--;\n inDegree[b]--;\n outDegree[a]--;\n }\n roads[a][b] = size;\n }", "public abstract boolean hasEdge(int from, int to);", "public abstract boolean putEdge(Edge incomingEdge);", "public Boolean isRoad() {\r\n\t \treturn this.road;\r\n\t }", "public void loadEdge()\r\n {\r\n town.createConnection();\r\n }", "void buildSettlement(VertexLocation vert, boolean free);", "public Edge build() {\n Utilities.checkArgument(this.first != null, \"First vertex cannot be null\");\n Utilities.checkArgument(this.cost != null, \"Cost of edge cannot be null\");\n\n return new Edge(this.first, this.second, this.cost);\n }", "@Test\n public void restrictedEdges() {\n int costlySource = graph.edge(0, 1).setDistance(5).set(speedEnc, 10, 10).getEdge();\n graph.edge(1, 2).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(2, 3).setDistance(1).set(speedEnc, 10, 10);\n int costlyTarget = graph.edge(3, 4).setDistance(5).set(speedEnc, 10, 10).getEdge();\n int cheapSource = graph.edge(0, 5).setDistance(1).set(speedEnc, 10, 10).getEdge();\n graph.edge(5, 6).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(6, 7).setDistance(1).set(speedEnc, 10, 10);\n int cheapTarget = graph.edge(7, 4).setDistance(1).set(speedEnc, 10, 10).getEdge();\n graph.edge(2, 6).setDistance(1).set(speedEnc, 10, 10);\n\n assertPath(calcPath(0, 4, cheapSource, cheapTarget), 0.4, 4, 400, nodes(0, 5, 6, 7, 4));\n assertPath(calcPath(0, 4, cheapSource, costlyTarget), 0.9, 9, 900, nodes(0, 5, 6, 2, 3, 4));\n assertPath(calcPath(0, 4, costlySource, cheapTarget), 0.9, 9, 900, nodes(0, 1, 2, 6, 7, 4));\n assertPath(calcPath(0, 4, costlySource, costlyTarget), 1.2, 12, 1200, nodes(0, 1, 2, 3, 4));\n }", "public void testContainsEdgeEdge( ) {\n init( );\n\n //TODO Implement containsEdge().\n }", "private boolean linkMappingCoreSeparate( VirtualLink vLink, SubstrateSwitch edgeSwitch1,\n\t\t\tSubstrateSwitch edgeSwitch2, Topology topo) {\n\t\tMap<SubstrateSwitch, LinkedList<SubstrateSwitch>> listAggConnectEdge = topo.getListAggConnectEdge();\n\t\tMap<SubstrateSwitch, LinkedList<SubstrateSwitch>> listCoreConnectAggMap = topo.getListCoreConnectAgg();\t\n\t\tLinkedList<LinkPhyEdge> listPhyEdge = topo.getListLinkPhyEdge();\n\t\tLinkedList<SubstrateLink> listLinkBandwidth = topo.getLinkBandwidth();\n\t\tLinkedList<SubstrateSwitch> listAggSort1 = new LinkedList<>();\n\t\tLinkedList<SubstrateSwitch> listAggSort2 = new LinkedList<>();\n\t\tLinkedList<SubstrateSwitch> listCoreSort1 = new LinkedList<>();\n\t\tLinkedList<SubstrateSwitch> listCoreSort2 = new LinkedList<>();\n\t\t\n\t\tService sService = vLink.getsService();\n\t\tService dService = vLink.getdService();\n\t\t\n\t\tdouble bandwidthDemand = vLink.getBandwidthRequest();\n\t\tint count = 0;\n\t\t\n\t\tSubstrateSwitch edge1 = null, edge2 = null;\n\t\tSubstrateSwitch agg1 = null, agg2 = null;\n\t\tSubstrateSwitch core = null;\n\t\t\n\t\tLinkPhyEdge linkEdge1 = null, linkEdge2 = null;\n\t\t\n\t\tSubstrateLink linkAggEdge1a = null, linkAggEdge1b = null;\n\t\tSubstrateLink linkAggEdge2a = null, linkAggEdge2b = null;\n\t\tSubstrateLink linkCoreAgg1a = null, linkCoreAgg1b = null;\n\t\tSubstrateLink linkCoreAgg2a = null, linkCoreAgg2b = null;\n\t\t//===get edge switch connect to server=====================================//\n\t\tfor (LinkPhyEdge linkPhyEdge: listPhyEdge) { \n\t\t\t\n\t\t\tif(linkPhyEdge.getPhysicalServer().equals(sService.getBelongToServer())){\n\t\t\t\tedge1 = linkPhyEdge.getEdgeSwitch();\n\t\t\t\tif(linkPhyEdge.getBandwidth() < bandwidthDemand) {\n\t\t\t\t\treturn false;\n\t\t\t\t}else {\n\t\t\t\t\tlinkEdge1 = linkPhyEdge;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t\tif(linkPhyEdge.getPhysicalServer().equals(dService.getBelongToServer())) {\n\t\t\t\tedge2 = linkPhyEdge.getEdgeSwitch();\n\t\t\t\tif(linkPhyEdge.getBandwidth() < bandwidthDemand) {\n\t\t\t\t\treturn false;\n\t\t\t\t}else {\n\t\t\t\t\tlinkEdge2 = linkPhyEdge;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tlistAggSort1 = sortListSwitch(listAggConnectEdge.get(edge1));\n\t\tlistAggSort2 = sortListSwitch(listAggConnectEdge.get(edge2));\n\t\n\t\t//=== find link connect Agg to Edge ======================================//\n\t\tAGG_EDGE_LOOP1:\n\t\tfor(int index = 0; index < listAggSort1.size(); index++) {\n\t\t\tagg1 = listAggSort1.get(index);\n\t\t\tfor (SubstrateLink link : listLinkBandwidth) {\n\t\t\t\tif(link.getStartSwitch() == edge1 && link.getEndSwitch() == agg1) {\n\t\t\t\t\tif(link.getBandwidth() < bandwidthDemand) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}else {\n\t\t\t\t\t\tlinkAggEdge1a = link;\n\t\t\t\t\t\tcount ++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(link.getStartSwitch() == agg1 && link.getEndSwitch() == edge1) {\n\t\t\t\t\tif(link.getBandwidth() < bandwidthDemand) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}else {\n\t\t\t\t\t\tlinkAggEdge1b = link;\n\t\t\t\t\t\tcount ++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(count == 2) break AGG_EDGE_LOOP1;\n\t\t\t}\t\n\t\t} // end for loop 1\n\t\tcount = 0;\n\t\tAGG_EDGE_LOOP2:\n\t\tfor(int index = 0; index < listAggSort2.size(); index++) {\n\t\t\tagg2 = listAggSort2.get(index);\n\t\t\tfor (SubstrateLink link : listLinkBandwidth) {\n\t\t\t\tif(link.getStartSwitch() == edge2 && link.getEndSwitch() == agg2) {\n\t\t\t\t\tif(link.getBandwidth() < bandwidthDemand) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}else {\n\t\t\t\t\t\tlinkAggEdge2a = link;\n\t\t\t\t\t\tcount ++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(link.getStartSwitch() == agg2 && link.getEndSwitch() == edge2) {\n\t\t\t\t\tif(link.getBandwidth() < bandwidthDemand) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}else {\n\t\t\t\t\t\tlinkAggEdge2b = link;\n\t\t\t\t\t\tcount ++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(count == 2) break AGG_EDGE_LOOP2;\n\t\t\t}\t\n\t\t} // end for loop 2\n\t\t//=== find link connect Agg to Core ======================================//\n\t\tlistCoreSort1 = sortListSwitch(listCoreConnectAggMap.get(agg1));\n\t\tlistCoreSort2 = sortListSwitch(listCoreConnectAggMap.get(agg2));\n\t\t\n\t\tif(!listCoreSort1.equals(listCoreSort2)) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tfor(int index = 0; index < listCoreSort1.size(); index++) {\n\t\t\tcore = listCoreSort1.get(index);\n\t\t\tfor (SubstrateLink link : listLinkBandwidth) {\n\t\t\t\tif(link.getStartSwitch() == agg1 && link.getEndSwitch() == core) {\n\t\t\t\t\tif(link.getBandwidth() < bandwidthDemand) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}else {\n\t\t\t\t\t\tlinkCoreAgg1a = link;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(link.getStartSwitch() == core && link.getEndSwitch() == agg1) {\n\t\t\t\t\tif(link.getBandwidth() < bandwidthDemand) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}else {\n\t\t\t\t\t\tlinkCoreAgg1b = link;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(link.getStartSwitch() == agg2 && link.getEndSwitch() == core) {\n\t\t\t\t\tif(link.getBandwidth() < bandwidthDemand) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}else {\n\t\t\t\t\t\tlinkCoreAgg2a = link;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(link.getStartSwitch() == core && link.getEndSwitch() == agg2) {\n\t\t\t\t\tif(link.getBandwidth() < bandwidthDemand) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}else {\n\t\t\t\t\t\tlinkCoreAgg2b = link;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//===set up bandwidth for all found links above ========//\n\t\tlinkEdge1.setBandwidth(linkEdge1.getBandwidth() - bandwidthDemand);\n\t\tlinkEdge1.getEdgeSwitch().setPort(linkEdge1.getEdgeSwitch(), bandwidthDemand);\n\t\tlinkEdge2.setBandwidth(linkEdge2.getBandwidth() - bandwidthDemand);\n\t\tlinkEdge2.getEdgeSwitch().setPort(linkEdge2.getEdgeSwitch(), bandwidthDemand);\n\t\tvLink.getLinkPhyEdge().add(linkEdge1);\n\t\tvLink.getLinkPhyEdge().add(linkEdge2);\n\t\tlinkAggEdge1a.setBandwidth(linkAggEdge1a.getBandwidth() - bandwidthDemand);\n\t\tlinkAggEdge1a.getStartSwitch().setPort(linkAggEdge1a.getEndSwitch(), bandwidthDemand);\n\t\tlinkAggEdge1b.setBandwidth(linkAggEdge1b.getBandwidth() - bandwidthDemand);\n\t\tlinkAggEdge1b.getStartSwitch().setPort(linkAggEdge1b.getEndSwitch(), bandwidthDemand);\n\t\tlinkAggEdge2a.setBandwidth(linkAggEdge2a.getBandwidth() - bandwidthDemand);\n\t\tlinkAggEdge2a.getStartSwitch().setPort(linkAggEdge2a.getEndSwitch(), bandwidthDemand);\n\t\tlinkAggEdge2b.setBandwidth(linkAggEdge2b.getBandwidth() - bandwidthDemand);\n\t\tlinkAggEdge2b.getStartSwitch().setPort(linkAggEdge2b.getEndSwitch(), bandwidthDemand);\n\t\tlinkCoreAgg1a.setBandwidth(linkCoreAgg1a.getBandwidth() - bandwidthDemand);\n\t\tlinkCoreAgg1a.getStartSwitch().setPort(linkCoreAgg1a.getEndSwitch(), bandwidthDemand);\n\t\tlinkCoreAgg1b.setBandwidth(linkCoreAgg1b.getBandwidth() - bandwidthDemand);\n\t\tlinkCoreAgg1b.getStartSwitch().setPort(linkCoreAgg1b.getEndSwitch(), bandwidthDemand);\n\t\tlinkCoreAgg2a.setBandwidth(linkCoreAgg2a.getBandwidth() - bandwidthDemand);\n\t\tlinkCoreAgg2a.getStartSwitch().setPort(linkCoreAgg2a.getEndSwitch(), bandwidthDemand);\n\t\tlinkCoreAgg2b.setBandwidth(linkCoreAgg2b.getBandwidth() - bandwidthDemand);\n\t\tlinkCoreAgg2b.getStartSwitch().setPort(linkCoreAgg2b.getEndSwitch(), bandwidthDemand);\n\t\tvLink.getLinkSubstrate().add(linkAggEdge1a);\n\t\tvLink.getLinkSubstrate().add(linkAggEdge1b);\n\t\tvLink.getLinkSubstrate().add(linkAggEdge2a);\n\t\tvLink.getLinkSubstrate().add(linkAggEdge2b);\n\t\tvLink.getLinkSubstrate().add(linkCoreAgg1a);\n\t\tvLink.getLinkSubstrate().add(linkCoreAgg1b);\n\t\tvLink.getLinkSubstrate().add(linkCoreAgg2a);\n\t\tvLink.getLinkSubstrate().add(linkCoreAgg2b);\n\t\treturn true;\n\t}", "public boolean canDoBuyRoad(){\n\t\t // If the player doesn't have resources for a road, or has already played all his roads, he can't buy another\n\t\t if(resourceCardHand.canDoPayForRoad() == false || playerPieces.hasAvailableRoad() == false) {\n\t\t\t return false;\n\t\t }\n\t\t if(playerPieces.getNumberOfRoads() > 13){\n\t\t\t return true;\n\t\t }\n\t\t // If the player has no legal place to put a road on the map, he shouldn't be allowed to buy one.\n\t\t if(playerPieces.canPlaceARoadOnTheMap() == false) {\n\t\t\t return false;\n\t\t }\n\t\t return true;\n\t }", "boolean addEdge(E edge);", "public void addEdge(Edge edge){\n \n synchronized(vertexes){\n Long start = edge.getStart();\n Vertex sVertex = vertexes.get(start);\n if(sVertex != null){\n sVertex.addEdge(edge, true);\n }\n// if undirected graph then adds edge to the finish vertex too \n if(!edge.isDirected()){\n Long finish = edge.getFinish();\n Vertex fVertex = vertexes.get(finish);\n if(fVertex != null){\n fVertex.addEdge(edge, false);\n }\n }\n }\n \n }", "void addEdge(Edge e) {\n\t\t\tif(!_edges.containsKey(e.makeKey())) {\n\t\t\t\t_edges.put(e.makeKey(),e);\n\t\t\t\te._one.addNeighborEdge(e);\n\t\t\t\te._two.addNeighborEdge(e);\n\t\t\t}\n\t\t}", "public void addEdge(GeographicPoint from, GeographicPoint to, String roadName,\n\t\t\tString roadType, double length) throws IllegalArgumentException {\n\n\t\t//TODO: Implement this method in WEEK 3\n\t\t\n\t\tif (length < 0 || (!map.containsKey(from) || !map.containsKey(to)) || (from == null || to == null)) {\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\tMapNode start = map.get(from);\n\t\tboolean added = start.addNeighbours(to, length, roadName, roadType);\n\t\tif (added) {\n\t\t\tnumEdges++;\n\t\t}\n\t}", "public void addPath(int startRoom, int door, int destinationRoom){\r\n\t\tEdge e= new Edge(startRoom,door,destinationRoom);\r\n\t\tprint(\"Adding edge \"+e);\r\n\t\tBoolean flag=false;\r\n\t\tif(startPaths.containsKey(startRoom)){\r\n\t\t\tprint(\"Start path contains \"+startRoom);\r\n\t\t\tfor(int i=0;i<startPaths.get(startRoom).size();i++){\r\n\t\t\t\tif(e.equals(startPaths.get(i))){\r\n\t\t\t\t\tflag=true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(flag==false){\r\n\t\t\tstartPaths.get(startRoom).add(e);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\tVector<Edge> v= new Vector<Edge>();\r\n\t\t\tv.add(e);\r\n\t\t\tstartPaths.put(startRoom, v);\r\n\t\t}\r\n\r\n\t\tif(destinationPaths.containsKey(destinationRoom)){\r\n\t\t\tprint(\"Destination path contains \"+destinationRoom);\r\n\t\t\tfor(int i=0;i<destinationPaths.get(destinationRoom).size();i++){\r\n\t\t\t\tif(e.equals(destinationPaths.get(i))){\r\n\t\t\t\t\tflag=true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(flag==false){\r\n\t\t\t\tdestinationPaths.get(destinationRoom).add(e);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\tVector<Edge> v= new Vector<Edge>();\r\n\t\t\tv.add(e);\r\n\t\t\tdestinationPaths.put(destinationRoom, v);\r\n\t\t}\r\n\t}", "@Override\n public void buildWorldObject() {\n setPoint(new Point3d());\n\n List<Point2d> pointList = new ArrayList<Point2d>();\n\n for (int i = 0; i < way.getNodesCount(); i++) {\n Node node = way.getNode(i);\n pointList.add(perspective.calcPoint(node));\n }\n\n list = pointList;\n\n roadWidth = (float) DEFAULT_ROAD_WIDTH;\n\n roadWidth = getRoadWidth();\n\n TextureData texture = getTexture();\n\n Material m = MaterialFactory.createTextureMaterial(texture.getFile());\n\n ModelFactory modelBuilder = ModelFactory.modelBuilder();\n\n int mi = modelBuilder.addMaterial(m);\n\n MeshFactory meshWalls = modelBuilder.addMesh(\"road\");\n\n meshWalls.materialID = mi;\n meshWalls.hasTexture = true;\n\n if (list.size() > 1) {\n\n FaceFactory leftBorder = meshWalls.addFace(FaceType.QUAD_STRIP);\n FaceFactory leftPart = meshWalls.addFace(FaceType.QUAD_STRIP);\n FaceFactory rightBorder = meshWalls.addFace(FaceType.QUAD_STRIP);\n FaceFactory rightPart = meshWalls.addFace(FaceType.QUAD_STRIP);\n\n Vector3d flatSurface = new Vector3d(0, 1, 0);\n\n int flatNormalI = meshWalls.addNormal(flatSurface);\n\n Point2d beginPoint = list.get(0);\n for (int i = 1; i < list.size(); i++) {\n Point2d endPoint = list.get(i);\n\n double x = endPoint.x - beginPoint.x;\n double y = endPoint.y - beginPoint.y;\n // calc lenght of road segment\n double mod = Math.sqrt(x * x + y * y);\n\n double distance = beginPoint.distance(endPoint);\n\n // calc orthogonal for road segment\n double orthX = x * cos90 + y * sin90;\n double orthY = -x * sin90 + y * cos90;\n\n // calc vector for road width;\n double normX = roadWidth / 2 * orthX / mod;\n double normY = roadWidth / 2 * orthY / mod;\n // calc vector for border width;\n double borderX = normX + 0.2 * orthX / mod;\n double borderY = normY + 0.2 * orthY / mod;\n\n double uEnd = distance / texture.getLenght();\n\n // left border\n int tcb1 = meshWalls.addTextCoord(new TextCoord(0, 0.99999d));\n // left part of road\n int tcb2 = meshWalls.addTextCoord(new TextCoord(0, 1 - 0.10d));\n // Middle part of road\n int tcb3 = meshWalls.addTextCoord(new TextCoord(0, 0.00001d));\n // right part of road\n int tcb4 = meshWalls.addTextCoord(new TextCoord(0, 1 - 0.10d));\n // right border\n int tcb5 = meshWalls.addTextCoord(new TextCoord(0, 0.99999d));\n\n // left border\n int tce1 = meshWalls.addTextCoord(new TextCoord(uEnd, 0.99999d));\n // left part of road\n int tce2 = meshWalls.addTextCoord(new TextCoord(uEnd, 1 - 0.10d));\n // Middle part of road\n int tce3 = meshWalls.addTextCoord(new TextCoord(uEnd, 0.00001d));\n // right part of road\n int tce4 = meshWalls.addTextCoord(new TextCoord(uEnd, 1 - 0.10d));\n // right border\n int tce5 = meshWalls.addTextCoord(new TextCoord(uEnd, 0.99999d));\n\n // left border\n int wbi1 = meshWalls.addVertex(new Point3d(beginPoint.x + borderX, 0.0d, -(beginPoint.y + borderY)));\n // left part of road\n int wbi2 = meshWalls.addVertex(new Point3d(beginPoint.x + normX, 0.1d, -(beginPoint.y + normY)));\n // middle part of road\n int wbi3 = meshWalls.addVertex(new Point3d(beginPoint.x, 0.15d, -beginPoint.y));\n // right part of road\n int wbi4 = meshWalls.addVertex(new Point3d(beginPoint.x - normX, 0.1d, -(beginPoint.y - normY)));\n // right border\n int wbi5 = meshWalls.addVertex(new Point3d(beginPoint.x - borderX, 0.0d, -(beginPoint.y - borderY)));\n\n // left border\n int wei1 = meshWalls.addVertex(new Point3d(endPoint.x + borderX, 0.0d, -(endPoint.y + borderY)));\n // left part of road\n int wei2 = meshWalls.addVertex(new Point3d(endPoint.x + normX, 0.1d, -(endPoint.y + normY)));\n // middle part of road\n int wei3 = meshWalls.addVertex(new Point3d(endPoint.x, 0.15d, -endPoint.y));\n // right part of road\n int wei4 = meshWalls.addVertex(new Point3d(endPoint.x - normX, 0.1d, -(endPoint.y - normY)));\n // right border\n int wei5 = meshWalls.addVertex(new Point3d(endPoint.x - borderX, 0.0d, -(endPoint.y - borderY)));\n\n leftBorder.addVert(wbi1, tcb1, flatNormalI);\n leftBorder.addVert(wbi2, tcb2, flatNormalI);\n leftBorder.addVert(wei1, tce1, flatNormalI);\n leftBorder.addVert(wei2, tce2, flatNormalI);\n\n leftPart.addVert(wbi2, tcb2, flatNormalI);\n leftPart.addVert(wbi3, tcb3, flatNormalI);\n leftPart.addVert(wei2, tce2, flatNormalI);\n leftPart.addVert(wei3, tce3, flatNormalI);\n\n rightBorder.addVert(wbi3, tcb3, flatNormalI);\n rightBorder.addVert(wbi4, tcb4, flatNormalI);\n rightBorder.addVert(wei3, tce3, flatNormalI);\n rightBorder.addVert(wei4, tce4, flatNormalI);\n\n rightPart.addVert(wbi4, tcb4, flatNormalI);\n rightPart.addVert(wbi5, tcb5, flatNormalI);\n rightPart.addVert(wei4, tce4, flatNormalI);\n rightPart.addVert(wei5, tce5, flatNormalI);\n\n beginPoint = endPoint;\n }\n }\n\n model = modelBuilder.toModel();\n model.setUseLight(true);\n model.setUseTexture(true);\n\n buildModel = true;\n }", "public String buildRoad(BuildRoad buildRoad) throws Exception {\n\t\tString url = server_url + \"/moves/buildRoad\";\n\t\tURL obj = new URL(url);\n\t\tHttpURLConnection con = (HttpURLConnection) obj.openConnection();\n\n\t\t//add request header\n\t\tcon.setRequestMethod(\"POST\");\n\t\tcon.setRequestProperty(\"User-Agent\", \"Mozilla/5.0\");\n\t\tcon.setRequestProperty(\"Accept-Language\", \"en-US,en;q=0.5\");\n\t\tcon.setRequestProperty(\"Cookie\", usercookie + \"; \" + gamecookie);\n\t\t\n\t\tJsonObject info = new JsonObject();\n\t\tinfo.addProperty(\"type\",\"buildRoad\");\n\t\tinfo.addProperty(\"playerIndex\", buildRoad.playerIndex);\n\t\t\n\t\tJsonObject loc = new JsonObject();\n\t\tloc.addProperty(\"x\", buildRoad.roadLocation.getHexLoc().getX());\n\t\tloc.addProperty(\"y\", buildRoad.roadLocation.getHexLoc().getY());\n\t\tloc.addProperty(\"direction\", directions.get(buildRoad.roadLocation.getDir().name()));\n\t\tinfo.add(\"roadLocation\", loc);\n\t\t\n\t\tinfo.addProperty(\"free\", buildRoad.free);\n\t\t\n\t\t// Send post request\n\t\tcon.setDoOutput(true);\n\t\tDataOutputStream wr = new DataOutputStream(con.getOutputStream());\n\t\twr.writeBytes(info.toString());\n\t\twr.flush();\n\t\twr.close();\n\n\t\tint responseCode = con.getResponseCode();\n\t\t//System.out.println(\"\\nSending 'POST' request to URL : \" + url);\n\t\t//System.out.println(\"Post parameters : \" + info.toString());\n\t\t//System.out.println(\"Response Code : \" + responseCode);\n\n\t\tif (responseCode == 400) {\n\t\t\tthrow new Exception();\n\t\t}\n\t\tBufferedReader in = new BufferedReader(\n\t\t new InputStreamReader(con.getInputStream()));\n\t\tString inputLine;\n\t\tStringBuffer response = new StringBuffer();\n\n\t\twhile ((inputLine = in.readLine()) != null) {\n\t\t\tresponse.append(inputLine);\n\t\t}\n\t\tin.close();\n\t\t\n\t\t//print result\n\t\t////System.out.println(response.toString());\n\t\treturn response.toString();\n\t}", "void addNeighborEdge(Edge e) {\n\t\t\t_neighborEdges.put(e,false);\n\t\t}", "public void addEdgeToBounds(S2Point from, S2Point to) {\n if (!boundSet) {\n boundSet = true;\n xmin = xmax = from.x;\n ymin = ymax = from.y;\n zmin = zmax = from.z;\n }\n xmin = Math.min(xmin, Math.min(to.x, from.x));\n ymin = Math.min(ymin, Math.min(to.y, from.y));\n zmin = Math.min(zmin, Math.min(to.z, from.z));\n xmax = Math.max(xmax, Math.max(to.x, from.x));\n ymax = Math.max(ymax, Math.max(to.y, from.y));\n zmax = Math.max(zmax, Math.max(to.z, from.z));\n\n // Because our arcs are really geodesics on the surface of the earth\n // an edge can have intermediate points outside the xyz bounds implicit\n // in the end points. Based on the length of the arc we compute a\n // generous bound for the maximum amount of deformation. For small edges\n // it will be very small but for some large arcs (ie. from (1N,90W) to\n // (1N,90E) the path can be wildly deformed. I did a bunch of\n // experiments with geodesics to get safe bounds for the deformation.\n double approxArcLen =\n Math.abs(from.x - to.x) + Math.abs(from.y - to.y) + Math.abs(from.z - to.z);\n if (approxArcLen < 0.025) { // less than 2 degrees\n maxDeformation = Math.max(maxDeformation, approxArcLen * 0.0025);\n } else if (approxArcLen < 1.0) { // less than 90 degrees\n maxDeformation = Math.max(maxDeformation, approxArcLen * 0.11);\n } else {\n maxDeformation = approxArcLen * 0.5;\n }\n }", "private void relax(SiteEdge e) {\n int v = e.from(), w = e.to();\n if (distTo[w] > distTo[v] + e.weight()) {\n distTo[w] = distTo[v] + e.weight();\n edgeTo[w] = e;\n if (pq.contains(w)) pq.decreaseKey(w, distTo[w]);\n else pq.insert(w, distTo[w]);\n }\n }", "public boolean canPlaceRoad(Player p, Edge e){\r\n for(Corner c: e.getConnectingCorners()){\r\n if(c.getOwner()==p) return true;\r\n }\r\n return false;\r\n }", "private void relax(DirectedEdge e) {\n int v = e.from(), w = e.to();\n if (distTo[w] > distTo[v] + e.weight()) {\n distTo[w] = distTo[v] + e.weight();\n edgeTo[w] = e;\n if (pq.contains(w)) pq.change(w, distTo[w]);\n else pq.insert(w, distTo[w]);\n }\n }", "void setupEdge(EdgeGraph edge) {\n\n\t\tif (UserParameters.socialInteraction) updateCrowdness(edge);\n\t\tcurrentEdge = edge;\n\t\t//transform GeomPlanarGraphEdge in Linestring\n\t\tLineString line = edge.getLine();\n\t\t//index the Linestring\n\t\tsegment = new LengthIndexedLine(line);\n\t\tstartIndex = segment.getStartIndex();\n\t\tendIndex = segment.getEndIndex();\n\t\tlinkDirection = 1;\n\n\t\t// check to ensure that Agent is moving in the right direction (direction)\n\t\tdouble distanceToStart = line.getStartPoint().distance(agentLocation.geometry);\n\t\tdouble distanceToEnd = line.getEndPoint().distance(agentLocation.geometry);\n\n\t\tif (distanceToStart <= distanceToEnd) {\n\t\t\t// closer to start\n\t\t\tcurrentIndex = startIndex;\n\t\t\tlinkDirection = 1;\n\t\t}\n\t\telse if (distanceToEnd < distanceToStart) {\n\t\t\t// closer to end\n\t\t\tcurrentIndex = endIndex;\n\t\t\tlinkDirection = -1;\n\t\t}\n\n\t}", "public static RoadSegment getRoadSegment(String freeway, String direction, String onOffKey)\n\t{\n\t\tif(direction.equalsIgnoreCase(\"north\"))\n\t\t{\n\t\t\tif(freeway.equalsIgnoreCase(\"101\"))\n\t\t\t{\n\t\t\t\tint i = -1;\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\ti += 1;\n\t\t\t\t} while(!(N101.getRoadSegAt(i).getKey()).equalsIgnoreCase(onOffKey));\n\t\t\t\t\n\t\t\t\treturn N101.getRoadSegAt(i);\n\t\t\t\t\n\t\t\t}\n\t\t\telse //if(freeway.equalsIgnoreCase(\"405\"))\n\t\t\t{\n\t\t\t\tint i = -1;\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\ti += 1;\n\t\t\t\t} while(!(N405.getRoadSegAt(i).getKey()).equalsIgnoreCase(onOffKey));\n\t\t\t\t\n\t\t\t\treturn N405.getRoadSegAt(i);\n\t\t\t}\n\t\t}\n\t\telse if(direction.equalsIgnoreCase(\"south\"))\n\t\t{\n\t\t\tif(freeway.equalsIgnoreCase(\"101\"))\n\t\t\t{\n\t\t\t\tint i = -1;\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\ti += 1;\n\t\t\t\t} while(!(S101.getRoadSegAt(i).getKey()).equalsIgnoreCase(onOffKey));\n\t\t\t\t\n\t\t\t\treturn S101.getRoadSegAt(i);\n\t\t\t\t\n\t\t\t}\n\t\t\telse //if(freeway.equalsIgnoreCase(\"405\"))\n\t\t\t{\n\t\t\t\tint i = -1;\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\ti += 1;\n\t\t\t\t} while(!(S405.getRoadSegAt(i).getKey()).equalsIgnoreCase(onOffKey));\n\t\t\t\t\n\t\t\t\treturn S405.getRoadSegAt(i);\n\t\t\t}\n\t\t}\n\t\telse if(direction.equalsIgnoreCase(\"east\"))\n\t\t{\n\t\t\tif(freeway.equalsIgnoreCase(\"10\"))\n\t\t\t{\n\t\t\t\tint i = -1;\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\ti += 1;\n\t\t\t\t} while(!(E10.getRoadSegAt(i).getKey()).equalsIgnoreCase(onOffKey));\n\t\t\t\t\n\t\t\t\treturn E10.getRoadSegAt(i);\n\t\t\t\t\n\t\t\t}\n\t\t\telse //if(freeway.equalsIgnoreCase(\"105\"))\n\t\t\t{\n\t\t\t\tint i = -1;\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\ti += 1;\n\t\t\t\t} while(!(E105.getRoadSegAt(i).getKey()).equalsIgnoreCase(onOffKey));\n\t\t\t\t\n\t\t\t\treturn E105.getRoadSegAt(i);\n\t\t\t}\n\t\t}\n\t\telse //if(direction.equalsIgnoreCase(\"west\"))\n\t\t{\n\t\t\tif(freeway.equalsIgnoreCase(\"10\"))\n\t\t\t{\n\n\t\t\t\tint i = -1;\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\ti += 1;\n\t\t\t\t} while(!(W10.getRoadSegAt(i).getKey()).equalsIgnoreCase(onOffKey));\n\t\t\t\t\n\t\t\t\treturn W10.getRoadSegAt(i);\n\t\t\t\t\n\t\t\t}\n\t\t\telse //if(freeway.equalsIgnoreCase(\"105\"))\n\t\t\t{\n\n\t\t\t\tint i = -1;\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\ti += 1;\n\t\t\t\t} while(!(W105.getRoadSegAt(i).getKey()).equalsIgnoreCase(onOffKey));\n\t\t\t\t\n\t\t\t\treturn W105.getRoadSegAt(i);\n\t\t\t}\n\n\t\t}\n\t\n\t}", "public Road(Place A, Place B)\n\t{\n\t\tEmpire roadEmpire = Empire.getInstance();\n\t\t\n\t\tint intXA, intYA, intXB, intYB;\n\t\tdouble xA, yA, xB, yB;\n\t\t\n\t\tintXA = A.getXPosition();\n\t\tintYA = A.getYPosition();\n\t\tintXB = B.getXPosition();\n\t\tintYB = B.getYPosition();\n\t\t\n\t\txA = (double) intXA;\n\t\tyA = (double) intYA;\n\t\txB = (double) intXB;\n\t\tyB = (double) intYB;\n\t\t\n\t\taPoint = new Point((int) xA, (int) yA);\n\t\tbPoint = new Point((int) xB, (int) yB);\n\t\t\n\t\taName = A.getName();\n\t\tbName = B.getName();\n\t\t\n\t\tlength = Math.sqrt((((xA-xB)*(xA-xB) + (yA - yB)*(yA - yB))));\n\t\tkFactor = (yB - yA)/(xB-xA);\n\t\t\n\t\troad.add(new Point(intXA, intYA));\n\t\t\n\t\tString keyA = String.valueOf(intXA) + \"-\" + String.valueOf(intYA);\n\t\tif(!roadEmpire.POINTS.containsKey(keyA));\n\t\t{\n\t\t\tMapPoint m = new MapPoint(intXA,intYA);\n\t\t\troadEmpire.POINTS.put(keyA, m);\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tif((xA == xB) && (yA == yB))\n\t\t{\n\t\t\tdirection = Direction.NONE;\n\t\t}\n\t\telse if(xA == xB)\n\t\t{\n\t\t\tif(yB > yA)\n\t\t\t{\n\t\t\t\tdirection = Direction.SOUTH;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdirection = Direction.NORTH;\n\t\t\t}\t\t\n\t\t\t\n\t\t\tfor (int i=1; i<(int)length; i++)\n\t\t\t{\n\t\t\t\tint x = (int) xA;\n\t\t\t\tint y;\n\t\t\t\t\n\t\t\t\tif(yB > yA)\n\t\t\t\t{\n\t\t\t\t\ty = ((int)yA) + i;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ty = ((int)yA) - i;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\troad.add(new Point(x,y));\n\t\t\t\t\n\t\t\t\tString key = String.valueOf(x) + \"-\" + String.valueOf(y);\n\t\t\t\tif(!roadEmpire.POINTS.containsKey(key));\n\t\t\t\t{\n\t\t\t\t\tMapPoint m = new MapPoint(x,y);\n\t\t\t\t\troadEmpire.POINTS.put(key, m);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse if(yA == yB)\n\t\t{\n\t\t\tif(xB > xA)\n\t\t\t{\n\t\t\t\tdirection = Direction.EAST;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdirection = Direction.WEST;\n\t\t\t}\n\t\t\t\n\t\t\tfor (int i=1; i<(int)length; i++)\n\t\t\t{\n\t\t\t\tint x;\n\t\t\t\tint y = (int)yA;\n\t\t\t\t\n\t\t\t\tif(xB > xA)\n\t\t\t\t{\n\t\t\t\t\tx = ((int)xA) + i;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tx = ((int)xA) - i;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\troad.add(new Point(x,y));\n\t\t\t\t\n\t\t\t\tString key = String.valueOf(x) + \"-\" + String.valueOf(y);\n\t\t\t\tif(!roadEmpire.POINTS.containsKey(key));\n\t\t\t\t{\n\t\t\t\t\tMapPoint m = new MapPoint(x,y);\n\t\t\t\t\troadEmpire.POINTS.put(key, m);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\t\n\t\t\tif((xB > xA) && (yB > yA))\n\t\t\t{\n\t\t\t\tdirection = Direction.SOUTH_EAST;\n\t\t\t}\n\t\t\telse if((xB > xA) && (yB < yA))\n\t\t\t{\t\n\t\t\t\tdirection = Direction.NORTH_EAST;\n\t\t\t}\n\t\t\telse if((xB < xA) && (yB > yA))\n\t\t\t{\n\t\t\t\tdirection = Direction.SOUTH_WEST;\n\t\t\t}\n\t\t\telse if((xB < xA) && (yB < yA))\n\t\t\t{\n\t\t\t\tdirection = Direction.NORTH_WEST;\n\t\t\t}\n\t\t\t\t\n\t\t\tfor (int i=1; i<(int)length; i++)\n\t\t\t{\n\t\t\t\tint x;\n\t\t\t\tint y;\n\t\t\t\t\n\t\t\t\tdouble c = (double) i;\n\t\t\t\tdouble a = c/(Math.sqrt((kFactor*kFactor + 1.0))); \n\t\t\t\tdouble b = Math.abs(a*kFactor);\n\t\t\t\t\n\t\t\t\tif((xB > xA) && (yB > yA))\n\t\t\t\t{\n\t\t\t\t\tx = (int)(xA + a);\n\t\t\t\t\ty = (int)(yA + b);\n\t\t\t\t}\n\t\t\t\telse if((xB > xA) && (yB < yA))\n\t\t\t\t{\n\t\t\t\t\tx = (int)(xA + a);\n\t\t\t\t\ty = (int)(yA - b);\n\t\t\t\t}\n\t\t\t\telse if((xB < xA) && (yB > yA))\n\t\t\t\t{\n\t\t\t\t\tx = (int)(xA - a);\n\t\t\t\t\ty = (int)(yA + b);\n\t\t\t\t}\n\t\t\t\telse if((xB < xA) && (yB < yA))\n\t\t\t\t{\n\t\t\t\t\tx = (int)(xA - a);\n\t\t\t\t\ty = (int)(yA - b);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tx = 100;\n\t\t\t\t\ty = 100;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\troad.add(new Point (x,y));\n\t\t\t\t\n\t\t\t\tString key = String.valueOf(x) + \"-\" + String.valueOf(y);\n\t\t\t\tif(!roadEmpire.POINTS.containsKey(key));\n\t\t\t\t{\n\t\t\t\t\tMapPoint m = new MapPoint(x,y);\n\t\t\t\t\troadEmpire.POINTS.put(key, m);\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t}\n\t\t}\n\t\t\n\t\troad.add(new Point(intXB, intYB));\n\t\t\n\t\tString keyB = String.valueOf(intXB) + \"-\" + String.valueOf(intYB);\n\t\tif(!roadEmpire.POINTS.containsKey(keyB));\n\t\t{\n\t\t\tMapPoint m = new MapPoint(intXB,intYB);\n\t\t\troadEmpire.POINTS.put(keyB, m);\n\t\t}\n\t}", "@Test\n public void simpleGraph() {\n graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(1, 2).setDistance(1).set(speedEnc, 10, 10);\n\n // source edge does not exist -> no path\n assertNotFound(calcPath(0, 2, 5, 0));\n // target edge does not exist -> no path\n assertNotFound(calcPath(0, 2, 0, 5));\n // using NO_EDGE -> no path\n assertNotFound(calcPath(0, 2, NO_EDGE, 0));\n assertNotFound(calcPath(0, 2, 0, NO_EDGE));\n // using ANY_EDGE -> no restriction\n assertPath(calcPath(0, 2, ANY_EDGE, 1), 0.2, 2, 200, nodes(0, 1, 2));\n assertPath(calcPath(0, 2, 0, ANY_EDGE), 0.2, 2, 200, nodes(0, 1, 2));\n // edges exist -> they are used as restrictions\n assertPath(calcPath(0, 2, 0, 1), 0.2, 2, 200, nodes(0, 1, 2));\n }", "private Road()\n\t{\n\t\t\n\t}", "private final void relaxNeighbors(_Node unsettledNode)\r\n {\r\n for (_Edge destinationEdge : map.getDestinations(unsettledNode))\r\n {\r\n \tif (isSettled(destinationEdge.getEndNode())) continue;\r\n \tint shortDist = getShortestDistance(unsettledNode) + destinationEdge.getWeight();// map.getDistance(unsettledNode, destinationEdge.getEndNode());\r\n if (shortDist <= getShortestDistance(destinationEdge.getEndNode()))\r\n {\r\n setShortestDistance(destinationEdge.getEndNode(), shortDist);\r\n setPredecessor(destinationEdge.getEndNode(),unsettledNode);\r\n }\r\n } \r\n }", "private void relax(int x, int y, double[][] energyTo, int[] edgeTo) {\n if (width() == 1) {\n for (int i = 0; i < height(); i++)\n edgeTo[i] = 0;\n } else {\n if (x == 0) {\n if (y < height-1) {\n if (energyTo[x][y+1] >= energyTo[x][y] + energy[x][y+1]) {\n energyTo[x][y+1] = energyTo[x][y] + energy[x][y+1];\n }\n if (energyTo[x+1][y+1] >= energyTo[x][y] + energy[x+1][y+1]) {\n energyTo[x+1][y+1] = energyTo[x][y] + energy[x+1][y+1];\n }\n }\n } else if (x == width-1) {\n if (y < height-1) {\n if (energyTo[x][y+1] >= energyTo[x][y] + energy[x][y+1]) {\n energyTo[x][y+1] = energyTo[x][y] + energy[x][y+1];\n }\n if (energyTo[x-1][y+1] >= energyTo[x][y] + energy[x-1][y+1]) {\n energyTo[x-1][y+1] = energyTo[x][y] + energy[x-1][y+1];\n }\n }\n } else {\n if (y < height-1) {\n if (energyTo[x][y+1] >= energyTo[x][y] + energy[x][y+1]) {\n energyTo[x][y+1] = energyTo[x][y] + energy[x][y+1];\n }\n if (energyTo[x-1][y+1] >= energyTo[x][y] + energy[x-1][y+1]) {\n energyTo[x-1][y+1] = energyTo[x][y] + energy[x-1][y+1];\n }\n if (energyTo[x+1][y+1] >= energyTo[x][y] + energy[x+1][y+1]) {\n energyTo[x+1][y+1] = energyTo[x][y] + energy[x+1][y+1];\n }\n }\n }\n }\n }", "public void makeEdge(char start,char end,int distance){\n\n Edge e = new Edge(start,end,distance);\n adjList[getIdx(start)].addFirst(e);\n //undirected graph add two edges in opposite direction\n e = new Edge(end,start,distance);\n adjList[getIdx(end)].addFirst(e);\n numEdges++;\n }", "org.landxml.schema.landXML11.RoadwayDocument.Roadway getRoadway();", "@Test\n public void notConnectedDueToRestrictions() {\n int sourceNorth = graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 10).getEdge();\n int sourceSouth = graph.edge(0, 3).setDistance(2).set(speedEnc, 10, 10).getEdge();\n int targetNorth = graph.edge(1, 2).setDistance(3).set(speedEnc, 10, 10).getEdge();\n int targetSouth = graph.edge(3, 2).setDistance(4).set(speedEnc, 10, 10).getEdge();\n\n assertPath(calcPath(0, 2, sourceNorth, targetNorth), 0.4, 4, 400, nodes(0, 1, 2));\n assertNotFound(calcPath(0, 2, sourceNorth, targetSouth));\n assertNotFound(calcPath(0, 2, sourceSouth, targetNorth));\n assertPath(calcPath(0, 2, sourceSouth, targetSouth), 0.6, 6, 600, nodes(0, 3, 2));\n }", "public Highway createHighway(RoadMap r) {\n\t\tHighway newHighway;\n\t\ttry {\n\t\t\tnewHighway = new Highway(roadID, length, maxVel, verifyJunction(r,\n\t\t\t\t\tini), verifyJunction(r, end), lanes);\n\n\t\t} catch (IllegalArgumentException | ObjectNotFoundException e) {\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\"Error: Could not create Highway \" + roadID + \" at time \"\n\t\t\t\t\t\t\t+ getTime() + \".\\n\" + e.getMessage(), e);\n\t\t}\n\t\treturn newHighway;\n\t}", "public abstract boolean isUsing(Edge graphEdge);", "protected abstract Deque<Vertex<AtomicReference>> getVehicleRoute(int entry, int exit);", "public boolean addEdge(Edge edge) {\r\n\t\treturn true;\r\n\t}", "public void determineNodeBoundary(boolean drivable) {\r\n \t\t//System.out.println(\"Determine node boundary of \" + name);\r\n \t\tArrayList<Point2D.Double> pointCloud = new ArrayList<Point2D.Double>(); \r\n \t\t// Add all end points of (drive-able) crossSectionElements to the pointCloud\r\n \t\tfor (DirectionalLink dl : links) {\r\n \t\t\tCrossSection cs = dl.link.getCrossSectionAtNode(dl.incoming);\r\n \t\t\t//if (name.equals(\"node_een\"))\r\n \t\t\t//\tLog.logToFile(\"d:/hull.txt\", false, \"selecting crosssection %s %s %s\", cs.toString(), dl.incoming ? \"from\" : \"to\", dl.incoming ? dl.link.getFromNode_r().getName_r() : dl.link.getToNode_r().getName_r());\r\n \t\t\tfor (int index = 2 * cs.getCrossSectionElementList_r().size(); --index >= 0; )\r\n \t\t\t\tif ((! drivable) || cs.elementFromNode(dl.incoming, true, index).getCrossSectionElementTypology().getDrivable()) {\r\n \t\t\t\t\tLine2D.Double dlLine = cs.vectorAtNode(dl.incoming, true, index, false);\r\n \t\t\t\t\tif (null == dlLine)\r\n \t\t\t\t\t\tcontinue;\r\n \t\t\t\t\tpointCloud.add((Point2D.Double) dlLine.getP1());\r\n \t\t\t\t\t//if (name.equals(\"node_een\"))\r\n \t\t\t\t\t//\tLog.logToFile(\"d:/hull.txt\", false, \"added endpoint %d %.3f,%.3f\", index, dlLine.x1, dlLine.y1);\r\n \t\t\t\t\t// Add the intersections of the boundaries of different (drive-able) crossSectionElements\r\n \t\t\t\t\tfor (DirectionalLink otherDL : links) {\r\n \t\t\t\t\t\tif (otherDL.angle >= dl.angle) // only search up to dl (and NEVER include dl itself)\r\n \t\t\t\t\t\t\tbreak;\t// this way we'll find each intersection only ONCE\r\n \t\t\t\t\t\tCrossSection otherCS = otherDL.link.getCrossSectionAtNode(otherDL.incoming);\r\n \t\t\t\t\t\tfor (int otherIndex = 2 * otherCS.getCrossSectionElementList_r().size(); --otherIndex >= 0; )\r\n \t\t\t\t\t\t\tif ((! drivable) || (otherCS.elementFromNode(otherDL.incoming, true, otherIndex).getCrossSectionElementTypology().getDrivable())) {\r\n \t\t\t\t\t\t\t\tLine2D.Double otherDLLine = otherCS.vectorAtNode(otherDL.incoming, true, otherIndex, false);\r\n \t\t\t\t\t\t\t\tif (null == otherDLLine)\r\n \t\t\t\t\t\t\t\t\tcontinue;\r\n \t\t\t\t\t\t\t\t//if (name.equals(\"node_een\"))\r\n \t\t\t\t\t\t\t\t//\tLog.logToFile(\"d:/hull.txt\", false, \"checking intersection between %s and %s\", GeometryTools.Line2DToString(dlLine), GeometryTools.Line2DToString(otherDLLine));\r\n \t\t\t\t\t\t\t\tif (Planar.lineIntersectsLine(dlLine, otherDLLine)) {\r\n \t\t\t\t\t\t\t\t\tPoint2D.Double intersection = Planar.intersection(dlLine, otherDLLine);\r\n \t\t\t\t\t\t\t\t\t//System.out.println(\"Adding boundary intersection \" + intersection);\r\n \t\t\t\t\t\t\t\t\tpointCloud.add(intersection);\r\n \t\t\t\t\t\t\t\t\t//if (name.equals(\"node_een\"))\r\n \t\t\t\t\t\t\t\t\t//\tLog.logToFile(\"d:/hull.txt\", false, \"added boundary intersection %.3f,%.3f\", intersection.x, intersection.y);\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}\r\n \t\t\t\t}\r\n \t\t}\r\n \r\n \t\t//System.out.println(\"pointCloud of \" + name + \" contains these points: \" + pointCloud.toString());\r\n \t\tif (0 == pointCloud.size())\r\n \t\t\tpointCloud.add(getPoint());\t// add design point of this node\r\n \t\tcircle = Planar.circleCoveringPoints(pointCloud);\r\n \t\t//ArrayList<Point2D.Double> ppp = new ArrayList<Point2D.Double>();\r\n \t\t//ppp.add(new Point2D.Double(this.x, this.y));\r\n \t\t//circle = GeometryTools.circleCoveringPoints(ppp);\r\n \t\t//System.out.format(Main.Locale, \"covering circle is %s\\r\\n\", circle.toString());\r\n \t\t// Create the convex hull consisting of the points where the drive-able parts of the links enter the covering circle\r\n \t\tArrayList<Point2D.Double> points = new ArrayList<Point2D.Double>();\r\n \t\tfor (DirectionalLink dl : links) {\r\n \t\t\tCrossSection cs = dl.link.getCrossSectionAtNode(dl.incoming);\r\n \t\t\tfor (int index = 2 * cs.getCrossSectionElementList_r().size(); --index >= 0; )\r\n \t\t\t\tif (cs.elementFromNode(dl.incoming, true, index).getCrossSectionElementTypology().getDrivable()) {\r\n \t\t\t\t\tLine2D.Double line = cs.vectorAtNode(dl.incoming, true, index, false);\r\n \t\t\t\t\tif (null == line)\r\n \t\t\t\t\t\tcontinue;\r\n \t\t\t\t\tPoint2D.Double intersections[] = Planar.intersectRayAndCircle(line, circle);\r\n \t\t\t\t\t//System.out.format(Main.Locale, \"line %s intersects circle %s at %d point(s)\\r\\n\", GeometryTools.Line2DToString(line), circle.toString(), intersections.length);\r\n \t\t\t\t\tif (intersections.length > 1) {\r\n \t\t\t\t\t\tSystem.err.println(\"Peter thinks this never happens...\");\r\n \t\t\t\t\t\t// use the one that is closest to the far end of the line\r\n \t\t\t\t\t\tif (intersections[0].distance(line.getP2()) < intersections[1].distance(line.getP2()))\r\n \t\t\t\t\t\t\tpoints.add(intersections[0]);\r\n \t\t\t\t\t\telse\r\n \t\t\t\t\t\t\tpoints.add(intersections[1]);\r\n \t\t\t\t\t}\r\n \t\t\t\t\telse if (intersections.length > 0)\r\n \t\t\t\t\t\tpoints.add(intersections[0]);\r\n \t\t\t\t\telse {\r\n \t\t\t\t\t\tSystem.out.println(\"line \" + Planar.Line2DToString(line) + \" does not intersect the circle \" + circle.toString());\r\n \t\t\t\t\t\t// probably a very near miss\r\n \t\t\t\t\t\tdouble ratio = circle.radius() / line.getP1().distance(circle.center());\r\n \t\t\t\t\t\tif ((ratio > 0.99) && (ratio < 1.01))\r\n \t\t\t\t\t\t\tpoints.add(Planar.logPoint(\"adding almost intersection\", (Point2D.Double)(line.getP1())));\r\n \t\t\t\t\t\telse\r\n \t\t\t\t\t\t\tSystem.err.println(\"Total miss: ratio is \" + ratio + \" (\" + circle.radius() / line.getP2().distance(circle.center()) + \")\");\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n \t\t}\r\n \t\tif (points.size() == 0)\r\n \t\t\treturn;\r\n \t\t// Compute the convex hull (in 2D) and convert that into an ArrayList<Vertex>\r\n \t\t//System.out.println(\"Computing convex hull of \" + points.toString());\r\n \t\t//if (name.equals(\"node_een\"))\r\n \t\t//\tLog.logToFile(\"d:/hull.txt\", false, \"points is %s\", points.toString());\r\n \t\tconflictArea = new ArrayList<Vertex>();\r\n \t\tfor (Point2D.Double p : Planar.convexHull(points))\r\n \t\t\tconflictArea.add(new Vertex(p, z));\t// use Z-component of this node\r\n \t\tconflictArea.add(conflictArea.get(0));\t// close the polygon\r\n \t\t//System.out.println(\"convex hull is \" + conflictArea.toString());\r\n \t\t//if (name.equals(\"node_een\"))\r\n \t\t//\tLog.logToFile(\"d:/hull.txt\", false, \"hull is %s\", conflictArea.toString());\r\n \t}", "Road(boolean h, MP m){\n\t\t time = m.getLifeTime();\n\t\t horizontal = h; \n\t\t _MP = m;\n\t\t endPosition = _MP.createRandom(_MP.getRoadLengthMin(), _MP.getRoadLengthMax());\n\t }", "org.landxml.schema.landXML11.RoadsideDocument.Roadside addNewRoadside();", "public void dfs(int startV,int end, double maxCost, double maxHops,LinkedList<Edge>[] routes,double cost,double distance,double hops,int totRoutes,LinkedList<Edge>edges) {\n marked[startV] = true;\n if(startV == end){\n Routes newRo = new Routes(hops,cost,distance, edges);\n finRoutes.add(newRo);\n return; \n }\n\n if(hops<maxHops){\n for (Edge w : adj(startV)) {\n //System.out.println(w.toString());\n //if(startV==w.other(w.either()))\n int e = w.other(w.either());\n int v =w.either();\n int next;\n\n if(startV == e)\n next=v;\n else next =e;\n if(!marked[next]) {\n double nc = cost + w.cost();\n if(nc<=maxCost){\n hops++;\n //routes[totRoutes].add(w);\n edges.add(w);\n //distance+=w.distance();\n double nd = distance+w.distance();\n //dfs(next,end,maxCost,maxHops,routes,cost,distance,hops,totRoutes,edges);\n dfs(next,end,maxCost,maxHops,routes,nc,nd,hops,totRoutes,edges);\n \n marked[next]=false;\n hops--;\n //if(routes[totRoutes].size()>0)\n // routes[totRoutes].remove(routes[totRoutes].size()-1);\n if(edges.size()>0)\n edges.remove(edges.size()-1);\n }\n //edgeTo[w.either()] = startV;\n //dfs( startV);\n \n }\n }\n }\n \n }", "boolean CanBuyRoad();", "@Test\n public void directedRouting() {\n EdgeIteratorState rightNorth, rightSouth, leftSouth, leftNorth;\n graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(1, 2).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(2, 3).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(3, 4).setDistance(3).set(speedEnc, 10, 10);\n rightNorth = graph.edge(4, 10).setDistance(1).set(speedEnc, 10, 10);\n rightSouth = graph.edge(10, 5).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(5, 6).setDistance(2).set(speedEnc, 10, 10);\n graph.edge(6, 2).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(2, 7).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(7, 8).setDistance(9).set(speedEnc, 10, 10);\n leftSouth = graph.edge(8, 9).setDistance(1).set(speedEnc, 10, 10);\n leftNorth = graph.edge(9, 0).setDistance(1).set(speedEnc, 10, 10);\n\n // make paths fully deterministic by applying some turn costs at junction node 2\n setTurnCost(7, 2, 3, 1);\n setTurnCost(7, 2, 6, 3);\n setTurnCost(1, 2, 3, 5);\n setTurnCost(1, 2, 6, 7);\n setTurnCost(1, 2, 7, 9);\n\n final double unitEdgeWeight = 0.1;\n assertPath(calcPath(9, 9, leftNorth.getEdge(), leftSouth.getEdge()),\n 23 * unitEdgeWeight + 5, 23, (long) ((23 * unitEdgeWeight + 5) * 1000),\n nodes(9, 0, 1, 2, 3, 4, 10, 5, 6, 2, 7, 8, 9));\n assertPath(calcPath(9, 9, leftSouth.getEdge(), leftNorth.getEdge()),\n 14 * unitEdgeWeight, 14, (long) ((14 * unitEdgeWeight) * 1000),\n nodes(9, 8, 7, 2, 1, 0, 9));\n assertPath(calcPath(9, 10, leftSouth.getEdge(), rightSouth.getEdge()),\n 15 * unitEdgeWeight + 3, 15, (long) ((15 * unitEdgeWeight + 3) * 1000),\n nodes(9, 8, 7, 2, 6, 5, 10));\n assertPath(calcPath(9, 10, leftSouth.getEdge(), rightNorth.getEdge()),\n 16 * unitEdgeWeight + 1, 16, (long) ((16 * unitEdgeWeight + 1) * 1000),\n nodes(9, 8, 7, 2, 3, 4, 10));\n }", "public abstract boolean getEdge(Point a, Point b);", "@Override\n public ArrayList<GraphEdge> getRoute(GraphNode a, GraphNode b) {\n \tHashMap<GraphNode, Double> distances = new HashMap<GraphNode, Double>();\n \tHashMap<GraphNode, GraphEdge> predecessor = new HashMap<GraphNode, GraphEdge>();\n \tHashSet<GraphNode> visited = new HashSet<GraphNode>();\n \t\n \tArrayList<GraphEdge> result = new ArrayList<GraphEdge>();\n\t\n \t//Initialize distances, predecessor, and visited\n \tfor(GraphNode g : drivableNodes) {\n \t distances.put(g, Double.MAX_VALUE);\n \t predecessor.put(g, null);\n \t}\n \t\n \tint remaining = drivableNodes.size();\n \t\n \t//Put starting node\n \tdistances.put(a, 0.0);\n \t//predecessor.put(a, null);\n \t\n \t//Main loop\n \twhile(remaining > 0) {\n \t GraphNode closest = null;\n \t double minDist = Double.MAX_VALUE;\n\n \t for(GraphNode n : distances.keySet()) {\n \t\tdouble dist = distances.get(n);\n \t\tif(!visited.contains(n) &&\n \t\t\tdist != Double.MAX_VALUE &&\n \t\t\t(minDist == Double.MAX_VALUE || dist < minDist)) {\n \t\t closest = n;\n \t\t minDist = dist;\n \t\t}\n \t }\n \t \n \t if(closest == null)\n \t\treturn null;\n \t \n \t if(closest.equals(b))\n \t\tbreak;\n \t \n \t visited.add(closest);\n \t \n \t for(GraphEdge edge : closest.getEdges()) {\n \t\tGraphNode adjacent = edge.getOtherNode(closest);\n \t\tif(adjacent != null && !visited.contains(adjacent)) {\n \t\t //Map distance value for the other Node\n \t\t double otherDist = distances.get(adjacent);\n \t\t //Weight of edge from closest node to adjacent node\n \t\t double weight = edge.getWeight();\n \t\t String way = edge.getWay();\n \t\t \n \t\t if(otherDist == Double.MAX_VALUE ||\n \t\t\t weight + minDist < otherDist) {\n \t\t\tdistances.put(adjacent, weight + minDist);\n \t\t\t\n \t\t\t//Make new edge in correct order\n \t\t\tGraphEdge corrected = new GraphEdge(closest, adjacent, weight, way);\n \t\t\t\n \t\t\tpredecessor.put(adjacent, corrected);\n \t\t }\n \t\t}\n \t }\n\n \t remaining--;\n \t}\n \t\n \t//Backtrack to build route\n \tif(distances.get(b) == Double.MAX_VALUE) {\n \t return null;\n \t} else {\n \t //buildPath(predecessor, a, b, result);\n \t //Non recursive version\n \t Stack<GraphEdge> stack = new Stack<GraphEdge>(); \n \t while(!b.equals(a)) {\n \t\tGraphEdge edge = predecessor.get(b);\n \t\t\n \t\t//Make sure vertices are in correct order\n \t\tGraphNode start = edge.getOtherNode(b);\n \t\t//double weight = edge.getWeight();\n \t\t//GraphEdge corrected = new GraphEdge(start, b, weight);\n \t\t\n \t\tstack.push(edge);\n \t\tb = start;\n \t }\n \t \n \t while(!stack.isEmpty()) {\n \t\tGraphEdge edge = stack.pop();\n \t\tresult.add(edge);\n \t }\n \t}\n \t\n\treturn result;\n }", "@Test\n public void forcingDirectionDoesNotMeanWeCannotUseEdgeAtAll() {\n int north = graph.edge(1, 0).setDistance(1).set(speedEnc, 10, 10).getEdge();\n int south = graph.edge(1, 2).setDistance(1).set(speedEnc, 10, 10).getEdge();\n graph.edge(2, 5).setDistance(1).set(speedEnc, 10, 0);\n graph.edge(5, 4).setDistance(1).set(speedEnc, 10, 0);\n graph.edge(4, 3).setDistance(1).set(speedEnc, 10, 0);\n graph.edge(3, 2).setDistance(1).set(speedEnc, 10, 0);\n graph.edge(1, 0).setDistance(1).set(speedEnc, 10, 0);\n graph.edge(0, 6).setDistance(1).set(speedEnc, 10, 0);\n int targetEdge = graph.edge(6, 7).setDistance(1).set(speedEnc, 10, 0).getEdge();\n assertPath(calcPath(1, 7, north, targetEdge), 0.3, 3, 300, nodes(1, 0, 6, 7));\n assertPath(calcPath(1, 7, south, targetEdge), 0.9, 9, 900, nodes(1, 2, 5, 4, 3, 2, 1, 0, 6, 7));\n }", "private static void addTripToGraph(Trip newTrip, Graph<Node, WeightEdge> graph, List<Node> depots, List<Node> trips, Problem problem){\n Node tripStart = new Node(newTrip, 0, false);\n Node tripEnd = new Node(newTrip, 0, true);\n\n graph.addVertex(tripStart);\n graph.addVertex(tripEnd);\n\n // Add weightEdgeWithBounders from trip startPoint to trip endPoint\n // lowerBound and upperBound for this edges is 1, because we are looking for solution that saturates all trips\n WeightEdge tripInternalWeightEdge = new BoundedWeightEdge(1,1);\n graph.addEdge(tripStart, tripEnd, tripInternalWeightEdge);\n graph.setEdgeWeight(tripInternalWeightEdge, 0);\n\n for(Node depot : depots){\n if(depot.isExitNode()){ // is source\n // add weightEdgeWithBounders from depot source to trip startPoint\n WeightEdge depotToTripWeightEdge = new BoundedWeightEdge(0, 1);\n graph.addEdge(depot, tripStart, depotToTripWeightEdge);\n graph.setEdgeWeight(depotToTripWeightEdge, problem.getCost(depot.getLocation(), tripStart.getLocation()).toMinutes());\n }else{ // is depot sink\n // add weightEdgeWithBounders from trip endPoint to depot sink\n WeightEdge tripToDepotWeightEdge = new BoundedWeightEdge(0, 1);\n graph.addEdge(tripEnd, depot, tripToDepotWeightEdge);\n graph.setEdgeWeight(tripToDepotWeightEdge, problem.getCost(tripEnd.getLocation(), depot.getLocation()).toMinutes());\n }\n }\n\n for(Node otherTrip : trips){\n if(otherTrip.isExitNode()){\n // add feasible edges from all trips endPoints to this trip startPoint\n if(isFeasibleEdge(otherTrip, tripStart, problem)){\n WeightEdge otherTripToThisTrip = new BoundedWeightEdge(0, 1);\n graph.addEdge(otherTrip, tripStart, otherTripToThisTrip);\n graph.setEdgeWeight(otherTripToThisTrip, problem.getCost(otherTrip.getLocation(), tripStart.getLocation()).toMinutes());\n }\n }else{\n // add feasible edges from this trip endPoint to all trips startPoints\n if(isFeasibleEdge(tripEnd, otherTrip, problem)){\n WeightEdge thisTripToOtherTrip = new BoundedWeightEdge(0, 1);\n graph.addEdge(tripEnd, otherTrip, thisTripToOtherTrip);\n graph.setEdgeWeight(thisTripToOtherTrip, problem.getCost(tripEnd.getLocation(), otherTrip.getLocation()).toMinutes());\n }\n }\n }\n\n // add this nodes in our trips list;\n trips.add(tripStart);\n trips.add(tripEnd);\n }", "private void optimizeEdgePropFlag() {\n TreeNode currentTreeNode = treeLeaf;\n while (!(currentTreeNode instanceof SourceTreeNode)) {\n if (currentTreeNode instanceof EdgeTreeNode) {\n EdgeTreeNode edgeTreeNode = EdgeTreeNode.class.cast(currentTreeNode);\n TreeNode nextTreeNode = edgeTreeNode.getOutputNode();\n if (null != nextTreeNode &&\n edgeTreeNode.beforeRequirementList.isEmpty() &&\n edgeTreeNode.afterRequirementList.isEmpty()) {\n if (nextTreeNode instanceof EdgeVertexTreeNode ||\n (nextTreeNode.getNodeType() == NodeType.AGGREGATE &&\n !(nextTreeNode instanceof GroupTreeNode))) {\n edgeTreeNode.setFetchPropFlag(true);\n }\n\n }\n }\n currentTreeNode = UnaryTreeNode.class.cast(currentTreeNode).getInputNode();\n }\n }", "InternalRoad getOutEgde(){\r\n\t\tSet out = this.getOutEdges();\r\n\t\tIterator iter = out.iterator();\r\n\t\treturn (InternalRoad)iter.next();\r\n\t}", "private List<Graph.Edge> getEdge(PathMap map) {\n // record the visited coordinates\n List<Coordinate> visited = new ArrayList<>();\n // get all coordinates from the map\n List<Coordinate> allCoordinates = map.getCoordinates();\n // for record all generated edges\n List<Graph.Edge> edges = new ArrayList<>();\n\n\n while (visited.size() <= allCoordinates.size() - 1) {\n for (Coordinate temp : allCoordinates) {\n\n if (visited.contains(temp)) {\n continue;\n }\n visited.add(temp);\n List<Coordinate> neighbors = map.neighbours(temp);\n for (Coordinate tempNeighbour : neighbors) {\n edges.add(new Graph.Edge(temp, tempNeighbour, tempNeighbour.getTerrainCost()));\n }\n }\n }\n // trim impassable coordinates\n List<Graph.Edge> fEdges = new ArrayList<>();\n for (Graph.Edge dd : edges) {\n if (dd.startNode.getImpassable() || dd.endNode.getImpassable()) {\n continue;\n }\n fEdges.add(dd);\n }\n return fEdges;\n }", "org.landxml.schema.landXML11.RoadwayDocument.Roadway addNewRoadway();", "public Road(Village start, Village end, int cost) {\n\t\tleave = start;\n\t\tarrive = end;\n\t\ttoll = cost;\n\t}", "boolean addEdge(V v, V w);", "@Test\n\tvoid testAddEdge() {\n\t\tgeo_location ge = new GeoLoc(0,1,2);\n\t\tnode_data n0 =new NodeData(0,ge);\n\t\tgeo_location ge1 = new GeoLoc(0,6,2);\n\t\tnode_data n1 =new NodeData(2,ge1);\n\t\tgraph.addNode(n0);\n\t\tgraph.addNode(n1);\n\t\tedge_data e = new EdgeData(0, 2, 20);\n\t\tgraph.connect(0, 2, 20);\n\t\tedge_data actual = graph.getEdge(0, 2);\n\t\tedge_data expected = e;\n\t\tassertEquals(expected.getSrc(), actual.getSrc());\n\t\tassertEquals(expected.getDest(), actual.getDest());\n\t\tassertEquals(expected.getWeight(), actual.getWeight());\n\t}", "public void addEdge(edge_type edge) {\n //first make sure the from and to nodes exist within the graph\n assert (edge.getFrom() < nextNodeIndex) && (edge.getTo() < nextNodeIndex) :\n \"<SparseGraph::AddEdge>: invalid node index\";\n\n //make sure both nodes are active before adding the edge\n if ((nodeVector.get(edge.getTo()).getIndex() != invalid_node_index)\n && (nodeVector.get(edge.getFrom()).getIndex() != invalid_node_index)) {\n //add the edge, first making sure it is unique\n if (isEdgeNew(edge.getFrom(), edge.getTo())) {\n edgeListVector.get(edge.getFrom()).add(edge);\n }\n\n //if the graph is undirected we must add another connection in the opposite\n //direction\n if (!isDirectedGraph) {\n //check to make sure the edge is unique before adding\n if (isEdgeNew(edge.getTo(), edge.getFrom())) {\n GraphEdge reversedEdge = new GraphEdge(edge.getTo(),edge.getFrom(),edge.getCost());\n edgeListVector.get(edge.getTo()).add(reversedEdge);\n }\n }\n }\n }", "private void constructMirrorEdge(Edge edge) {\n MirrorEdge mirrorEdge = new MirrorEdge();\n mirrorEdge.original = edge;\n mirrorEdge.source = edge.source();\n mirrorEdge.target = edge.target();\n directEdgeMap.put(edge, mirrorEdge);\n }", "private void supplementMST(){\n\t\tList<Village> noOutRoads = getNoOutRoadVillages();\n\t\tList<Village> noInRoads = getNoInRoadVillages();\n\t\t\n\t\tfor(Village v: noOutRoads){\n\t\t\tVillage closestVillage = findClosestVillageTo(v,noInRoads);\n\t\t\tnoInRoads.remove(closestVillage);\n\t\t\tnew Road(v,closestVillage);\n\t\t}\n\t\t\n\t\tfor(Village v: noInRoads){\n\t\t\tnew Road(findClosestVillageTo(v,villages),v);\n\t\t}\n\t}", "public void addedge(String fro, String to, int wt) {\r\n Edge e = new Edge(fro, to, wt);\r\n\r\n\r\n Set<String> keys = graph.keySet();\r\n// Object[] arr = keys.toArray();\r\n int f = 0;\r\n if(graph.containsKey(fro)&&graph.containsKey(to))\r\n {\r\n\r\n int[] bb2 = new int[2000];\r\n for(int zz=0;zz<5000;zz++){\r\n\r\n\r\n ArrayList<Integer> abcd = new ArrayList<>();\r\n abcd.add(zz);\r\n\r\n if(zz<2500)\r\n zz++;\r\n else\r\n zz++;\r\n\r\n bb2[zz%500]=zz;\r\n\r\n\r\n int qq= 5000;\r\n\r\n qq--;\r\n\r\n String nnn = \"aaa aa\";\r\n nnn+=\"df\";\r\n\r\n\r\n }\r\n\r\n }\r\n else\r\n {\r\n\r\n\r\n System.out.println(\"some vertices are not present\");\r\n return;\r\n }\r\n for ( String y : keys) {\r\n if (fro.compareTo(y) == 0) {\r\n f = 1;\r\n ArrayList<Edge> ee =graph.get(y);\r\n\r\n\r\n ee.add(e);\r\n }\r\n\r\n\r\n }\r\n if (f == 0) {}\r\n }", "void addEdge(int source, int destination, int weight);", "public void checkEdge()\n {\n if(getX() < 10 || getX() > getWorld().getWidth() - 10)\n {\n speed *= -1;\n }\n }", "public void fillEdges() {\n\t\tfor (int y = 0; y < mapSize; y++) {\n\t\t\tfor (int x = 0; x < mapSize; x++) {\n\t\t\t\tCoordinates coordinates = new Coordinates(x, y);\n\t\t\t\tint vertexSrc = coordinateToVertex(coordinates);\n\n\t\t\t\tif (deletedVertices.contains(vertexSrc)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tDirection[] directions = Direction.values();\n\n\t\t\t\tfor (Direction direction : directions) {\n\t\t\t\t\tCoordinates destCoordinates = new Coordinates(x, y);\n\n\t\t\t\t\tdestCoordinates = destCoordinates.addCoordinates(direction.coordinates());\n\n\t\t\t\t\tif (destCoordinates.areCorrect(mapSize)) {\n\t\t\t\t\t\tint vertexDest = coordinateToVertex(destCoordinates);\n\t\t\t\t\t\tif (!deletedVertices.contains(vertexDest)) {\n\t\t\t\t\t\t\taddEdge(vertexSrc, vertexDest);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void makeComplete() {\n\t\t// A complete graph has N(N-1)/2 edges. Create an ArrayList for those\n\t\t// for performance.\n\t\tint n = nodeArray.size();\n\t\tthis.edges = new ArrayList<Edge>(n * (n - 1) / 2);\n\n\t\t// Connect every node to the others\n\t\tfor (int i = 0; i < nodeArray.size(); i++) {\n\t\t\tfor (int k = i + 1; k < nodeArray.size(); k++) {\n\n\t\t\t\tEdge edge = new Edge(nodeArray.get(i), nodeArray.get(k));\n\t\t\t\tedges.add(edge);\n\t\t\t}\n\t\t}\n\t}", "public boolean ifRailRoad() {\n return choiceSelect == RAIL_ROAD_CHOICE;\n }", "public ImmutableNetwork<Node, Edge> buildGraph() {\n\n // MutableNetwork is an interface requiring a type for nodes and a type for edges\n MutableNetwork<Node, Edge> roads = NetworkBuilder.undirected().build();\n\n // Construct Nodes for cities,\n // and add them to a map\n String[] cities = {\"Wuhan\", \"shanghai\", \"Beijing\", \"Tianjin\", \"dalian\"};\n\n Map<String, Node> all_nodes = new TreeMap<String, Node>();\n for (int i = 0; i < cities.length; i++) {\n // Add nodes to map\n Node node = new Node(cities[i]);\n all_nodes.put(cities[i], node);\n\n // Add nodes to network\n roads.addNode(node);\n }\n\n // Construct Edges for roads,\n // and add them to a map\n String[] distances = {\"Wuhan:shanghai:9239\", \"Wuhan:Beijing:1103\", \"Wuhan:Tianjin:1162\", \"Wuhan:dalian:1423\", \"shanghai:Beijing:1214\", \"shanghai:Tianjin:20\", \"Beijing:Tianjin:4\", \"shanghai:dalian:1076\", \"Tianjin:dalian:802\" };\n //String[] distances = {\"A:B:10\",\"A:D:20\", \"A:C:15\", \"B:D:25\", \"B:C:35\" , \"C:D:30\"};\n Map<String, Edge> all_edges = new TreeMap<String, Edge>();\n for (int j = 0; j < distances.length; j++) {\n // Parse out (city1):(city2):(distance)\n String[] splitresult = distances[j].split(\":\");\n String left = splitresult[0];\n String right = splitresult[1];\n String label = left + \":\" + right;\n int value = Integer.parseInt(splitresult[2]);\n\n // Add edges to map\n Edge edge = new Edge(left, right, value);\n all_edges.put(label, edge);\n\n // Add edges to network\n roads.addEdge(all_nodes.get(edge.left), all_nodes.get(edge.right), edge);\n }\n\n // Freeze the network\n ImmutableNetwork<Node, Edge> frozen_roads = ImmutableNetwork.copyOf(roads);\n\n return frozen_roads;\n }", "public GraphEdge()\r\n {\r\n cost = 1.0;\r\n indexFrom = -1;\r\n indexTo = -1;\r\n }", "public boolean canDoBuildInitialRoad(){\n\t\t // If the player already has two roads on the board then he has already placed the initial roads\n\t\t if(playerPieces.getNumberOfRoads() < 14){\n\t\t\t return false;\n\t\t }\n\t\t return true;\n\t }", "public static Multigraph smartAddEdge(Multigraph graph, Edge edge, boolean stopIfMissing) {\n\n if (!graph.containsVertex(edge.getSource())) {\n if(stopIfMissing){\n throw new IllegalStateException(\"Missing source node for edge \"+ edge);\n }\n graph.addVertex(edge.getSource());\n }\n if (!graph.containsVertex(edge.getDestination())) {\n if(stopIfMissing){\n throw new IllegalStateException(\"Missing destination node for edge \"+ edge);\n }\n graph.addVertex(edge.getDestination());\n }\n //That a good mapping edge, add to the related query\n graph.addEdge(edge.getSource(), edge.getDestination(), edge.getLabel());\n return graph;\n }", "public boolean hasEdge(Edge e) {\n for (Edge outEdge : outEdges) {\n if (outEdge.equals(e) && e.getTo() == outEdge.getTo()) {\n return true;\n }\n }\n return false;\n }", "public Block createPath(Block currentBlock){\n\n\t\tint indexOfNeighbouringBlock = (int) (Math.random()*RoomGen.neighbouringBlocks.get(currentBlock).size());\n\t\tint size = RoomGen.neighbouringBlocks.get(currentBlock).size();\n\t\t\n\t\tif(!path.contains(currentBlock)){\n\t\t\tpath.add(currentBlock);\n\t\t}\n\t\t\n\t\t//set the next index to make sure that elements of path are distinct\n\t\tSystem.out.println(\"size of neighbours: \" + RoomGen.neighbouringBlocks.get(currentBlock).size());\n\t\tif(path.contains(RoomGen.neighbouringBlocks.get(currentBlock).get(indexOfNeighbouringBlock))){\n\t\t\tif(indexOfNeighbouringBlock != 0 || indexOfNeighbouringBlock == RoomGen.neighbouringBlocks.get(currentBlock).size() - 1){\n\t\t\t\tindexOfNeighbouringBlock = indexOfNeighbouringBlock-1;\n\t\t\t}else{\n\t\t\t\tindexOfNeighbouringBlock = indexOfNeighbouringBlock+1;\n\t\t\t}\n\t\t}else{\t\t\n\t\t}\n\t\tBlock next = new Block(0,0,0,0);\n\t\t\n\t\t//Initialise next block\n\t\tif(unfinishedDoors.contains(RoomGen.neighbouringBlocks.get(currentBlock).get(indexOfNeighbouringBlock))){\n\t\t\tnext = RoomGen.neighbouringBlocks.get(currentBlock).get(indexOfNeighbouringBlock);\n\t\t}else{\n\t\t\tfor(int i = 0; i<RoomGen.neighbouringBlocks.get(currentBlock).size(); i++){\n\t\t\t\tif(unfinishedDoors.contains(RoomGen.neighbouringBlocks.get(currentBlock).get(i))){\n\t\t\t\t\tnext = RoomGen.neighbouringBlocks.get(currentBlock).get(i);\n\t\t\t\t\tbreak;\n\t\t\t\t}else if(i==RoomGen.neighbouringBlocks.get(currentBlock).size()-1){\n\t\t\t\t\treturn currentBlock;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\taddDoor(currentBlock, next);\n\t\t\n\t\tcurrentBlock.addDoor();\n\t\tnext.addDoor();\n\t\t\n\t\t//if current block reaches full door potential when adding door to next,\n\t\t//add it to the list of finished blocks and remove it from the list of unfinished ones\n\t\tif(currentBlock.getPotentialDoorNum() == currentBlock.getCurrentDoorNum()){\n\t\t\tfinishedDoors.add(currentBlock);\n\t\t\tfor(int i = 0; i< unfinishedDoors.size(); i++){\n\t\t\t\tif(unfinishedDoors.get(i).equals(currentBlock)){\n\t\t\t\t\tunfinishedDoors.remove(i);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//path ends if next reaches full door potential when adding door from b to next\n\t\t//next is put to finished list and removed from unfinished list\n\t\tif(next.getPotentialDoorNum() == next.getCurrentDoorNum()){\n\t\t\tfinishedDoors.add(next);\n\t\t\tpath.add(next);\n\t\t\t\n\t\t\tfor(int i = 0; i< unfinishedDoors.size(); i++){\n\t\t\t\tif(unfinishedDoors.get(i).equals(next)){\n\t\t\t\t\tunfinishedDoors.remove(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn next;\n\t\t}\n\t\t//otherwise the path continues\n\t\telse{\n\t\t\treturn createPath(next);\n\t\t}\n\t\t}", "@Test\n public void blockArea() {\n EdgeIteratorState edge1 = graph.edge(0, 1).setDistance(10).set(speedEnc, 10, 10);\n graph.edge(1, 2).setDistance(10).set(speedEnc, 10, 10);\n EdgeIteratorState edge2 = graph.edge(2, 3).setDistance(10).set(speedEnc, 10, 10);\n graph.edge(0, 4).setDistance(100).set(speedEnc, 10, 10);\n graph.edge(4, 5).setDistance(100).set(speedEnc, 10, 10);\n graph.edge(5, 6).setDistance(100).set(speedEnc, 10, 10);\n graph.edge(6, 3).setDistance(100).set(speedEnc, 10, 10);\n\n // usually we would take the direct route\n assertPath(calcPath(0, 3, ANY_EDGE, ANY_EDGE), 3, 30, 3000, nodes(0, 1, 2, 3));\n\n // with forced edges we might have to go around\n assertPath(calcPath(0, 3, 3, ANY_EDGE), 40, 400, 40000, nodes(0, 4, 5, 6, 3));\n assertPath(calcPath(0, 3, ANY_EDGE, 6), 40, 400, 40000, nodes(0, 4, 5, 6, 3));\n\n // with avoided edges we also have to take a longer route\n assertPath(calcPath(0, 3, ANY_EDGE, ANY_EDGE, createAvoidEdgeWeighting(edge1)), 40, 400, 40000, nodes(0, 4, 5, 6, 3));\n assertPath(calcPath(0, 3, ANY_EDGE, ANY_EDGE, createAvoidEdgeWeighting(edge2)), 40, 400, 40000, nodes(0, 4, 5, 6, 3));\n\n // enforcing forbidden start/target edges still does not allow using them\n assertNotFound(calcPath(0, 3, edge1.getEdge(), edge2.getEdge(), createAvoidEdgeWeighting(edge1)));\n assertNotFound(calcPath(0, 3, edge1.getEdge(), edge2.getEdge(), createAvoidEdgeWeighting(edge2)));\n\n // .. even when the nodes are just next to each other\n assertNotFound(calcPath(0, 1, edge1.getEdge(), ANY_EDGE, createAvoidEdgeWeighting(edge1)));\n assertNotFound(calcPath(0, 1, ANY_EDGE, edge2.getEdge(), createAvoidEdgeWeighting(edge2)));\n }", "default Optional<E> getEdge(N leftNode, N rightNode) {\n return this.getOutgoingEdges(leftNode).stream()\n .filter(a -> a.getRightNode().equals(rightNode) || (!a.isDirected()&& a.getLeftNode().equals(rightNode)))\n .findAny();\n }", "public void makeRoads()\r\n\t{\r\n\t\tfor(int i=0; i<roads.length; i++)\r\n\t\t\troads[i] = new Road(i*SCREEN_HEIGHT/20,SCREEN_WIDTH,SCREEN_HEIGHT/20-10);\r\n\t}", "void addEdge(int s1,int c,int s2)\r\n\t{\r\n\t\tg[s1][c][s2]=true;\r\n\t}", "private void relax(Edge e, int v) {\r\n int w = e.other(v);\r\n if (distTo[w] > distTo[v] + e.weight()) {\r\n distTo[w] = distTo[v] + e.weight();\r\n edgeTo[w] = e;\r\n if(nWays[v]>0)\r\n \tnWays[w]= nWays[v];\t\t\t//posibles caminos desde origen...\r\n else\r\n \tnWays[w]=1;\r\n if (pq.contains(w)) pq.decreaseKey(w, distTo[w]);\r\n else pq.insert(w, distTo[w]);\r\n }else if(distTo[w] == distTo[v] + e.weight()){\r\n \tnWays[w] += nWays[v];\r\n \t/* if(nWays[v]>1)\r\n \tnWays[w]=nWays[w]*nWays[v];\r\n \t else\r\n \t\t nWays[w]++;*/\r\n }\r\n }", "private void buildReachable() {\n // This is a simple search algorithm.\n // It doesn't matter whether it's depth-first or breadth-first.\n this.reachables = new ArrayList<Boolean>();\n for (int n = 0; n < code.size(); n++) {\n this.reachables.add(false);\n }\n\n ArrayDeque<Integer> next = new ArrayDeque<Integer>();\n if (!code.isEmpty()) {\n next.add(0);\n }\n \n while (!next.isEmpty()) {\n int here = next.remove();\n \n if (this.reachables.get(here)) {\n continue;\n }\n this.reachables.set(here, true);\n next.addAll(this.succ(here));\n }\n }", "private int[] calculateCoverage(Route rt, Point edge){\n\n \tint[] latLonMinMax = new int[4];\n \t\n // figure out the bounding box of the route\n latLonMinMax[0] = rt.getStart().getLatitude();\n latLonMinMax[1] = latLonMinMax[0];\n latLonMinMax[2] = rt.getStart().getLongitude();\n latLonMinMax[3] = latLonMinMax[2];\n \n for(GeoSegment gs : rt.getGeoSegments()){\n \tint temp = gs.getP2().getLatitude();\n \tlatLonMinMax[0] = latLonMinMax[0] > temp ? temp : latLonMinMax[0];\n \tlatLonMinMax[1] = latLonMinMax[1] < temp ? temp : latLonMinMax[1];\n \t\n \ttemp = gs.getP2().getLongitude();\n \tlatLonMinMax[2] = latLonMinMax[2] > temp ? temp : latLonMinMax[2];\n \tlatLonMinMax[3] = latLonMinMax[3] < temp ? temp : latLonMinMax[3];\n }\n \n \n // now use aspect ratio of the window to get bounds of the display\n int diffLat = latLonMinMax[1] - latLonMinMax[0];\n int diffLon = latLonMinMax[3] - latLonMinMax[2];\n \n // the longest aspect will be a larger ratio\n double horzAsp = diffLon / edge.getX();\n double vertAsp = diffLat / edge.getY();\n \n double expandLat = 0.0;\n double expandLon = 0.0;\n if(horzAsp > vertAsp){\n \tdouble factor = horzAsp/vertAsp;\n \t// calculate the expansion of the short dimension\n \texpandLat = ((diffLat * factor - diffLat) / 2.0);\n \texpandLat += ((diffLat * factor) / 20.0); // 20.0 for 5%\n \t// long dimension\n \texpandLon = diffLon / 20.0;\n }else{\n\t double factor = vertAsp/horzAsp;\n\t \t// calculate the expansion of the short dimension\n\t \texpandLon = ((diffLon * factor - diffLon) / 2);\n \texpandLon += ((diffLon * factor) / 20.0);\n \t// long dimension\n \texpandLat = diffLat / 20.0;\n }\n \n latLonMinMax[0] -= ( ((int)expandLat) != 0 ? ((int)expandLat) : 2);\n latLonMinMax[1] += ( ((int)expandLat) != 0 ? ((int)expandLat) : 2);\n latLonMinMax[2] -= ( ((int)expandLon) != 0 ? ((int)expandLon) : 2);\n latLonMinMax[3] += ( ((int)expandLon) != 0 ? ((int)expandLon) : 2);\n \n \treturn latLonMinMax;\n }", "private static Lane newLaneConnection(Lane upLane, Lane downLane, boolean createCurve, Lane oldLane, boolean sameOutlink) {\n \t\tdouble laneWidth = downLane.getWidth();\r\n \t\tLane newLane = new Lane(null, null, null, 0, laneWidth, Lane.NOORIGIN, Lane.NODESTINATION);\r\n \t\tnewLane.addDownLane(downLane);\r\n \t\tnewLane.addUpLane(upLane);\t\t\t\t\t\t\t\r\n \t\tdownLane.addUpLane(newLane);\r\n \t\tupLane.addDownLane(newLane);\r\n \t\tif (null == upLane.getLaneVerticesCenter()) {\r\n \t\t\tSystem.err.println(\"newLaneConnection: linkPointList is null\");\r\n \t\t\tupLane.getLaneVerticesCenter();\r\n \t\t\treturn null;\r\n \t\t}\r\n \t\tif (null == downLane.getLaneVerticesCenter()) {\r\n \t\t\tSystem.err.println(\"newLaneConnection: linkPointList is null\");\r\n \t\t\treturn null;\r\n \t\t}\r\n \t\tif (createCurve) {\r\n \t\t\tArrayList<Vertex> up = upLane.getLaneVerticesCenter();\r\n \t\t\tArrayList<Vertex> down = downLane.getLaneVerticesCenter();\t\t\r\n \t\t\tPoint2D.Double ctrlPoint = \tCurves.createControlPoint(up, down);\r\n \t\t\tnewLane.setCtrlPointCenter(ctrlPoint);\r\n \t\t\tArrayList<Vertex> laneVerticesCenter = new ArrayList<Vertex>();\r\n \t\t\tlaneVerticesCenter = Curves.connectVerticesCurve(up, down, ctrlPoint, 0.3);\r\n \t\t\t// laneVerticesCenter.get(0).setPoint(up.get(up.size()-1).getX(), up.get(up.size()-1).getY(), up.get(up.size()-1).getZ());\r\n \t\t\t// laneVerticesCenter.get(laneVerticesCenter.size()-1).setPoint(down.get(0).getX(), down.get(0).getY(), down.get(0).getZ());\r\n \t\t\tnewLane.setDesignLine(laneVerticesCenter);\t\t\t\r\n \t\t\tnewLane.setLaneVerticesInner(Planar.createParallelVertices(laneVerticesCenter, - newLane.getLateralWidth() / 2));\r\n \t\t\tnewLane.setLaneVerticesOuter(Planar.createParallelVertices(laneVerticesCenter, + newLane.getLateralWidth() / 2));\r\n \t\t}\r\n \t\telse {\r\n \t\t\tboolean sameUp = false;\r\n \t\t\tboolean sameDown = false;\r\n \t\t\tArrayList<Vertex> laneVerticesCenter = new ArrayList<Vertex>();\r\n \t\t\tArrayList<Vertex> prevLaneVerticesCenter = oldLane.getUp().get(0).getLaneVerticesCenter();\r\n \t\t\tVertex oldUp = prevLaneVerticesCenter.get(prevLaneVerticesCenter.size()-1);\r\n \t\t\tprevLaneVerticesCenter = oldLane.getDown().get(0).getLaneVerticesCenter();\r\n \t\t\tVertex oldDown = prevLaneVerticesCenter.get(0);\r\n \t\t\tVertex up = upLane.getLaneVerticesCenter().get(upLane.getLaneVerticesCenter().size()-1);\r\n \t\t\tVertex down = downLane.getLaneVerticesCenter().get(0);\t\t\r\n \t\t\t\r\n \t\t\tif (up.equals(oldUp) && sameOutlink)\r\n \t\t\t\tsameUp = true;\r\n \t\t\tif (down.equals(oldDown))\r\n \t\t\t\tsameDown = true;\r\n \t\t\t// create parallel vertices\r\n \t\t\tprevLaneVerticesCenter = oldLane.getLaneVerticesCenter();\r\n \t\t\tlaneVerticesCenter = Planar.createParallelVertices(prevLaneVerticesCenter, -oldLane.getLateralWidth());\r\n \t\t\t// if same upLane: create weighted vertices inbetween\r\n \t\t\tif (sameUp == true) {\r\n \t\t\t\tlaneVerticesCenter = Planar.createPartlyParallelVertices(prevLaneVerticesCenter, laneVerticesCenter, sameUp, sameDown);\r\n \t\t\t}\r\n \t\t\tnewLane.setDesignLine(laneVerticesCenter);\r\n \t\t\tnewLane.setLaneVerticesInner(Planar.createParallelVertices(laneVerticesCenter, - newLane.getLateralWidth() / 2));\r\n \t\t\tnewLane.setLaneVerticesOuter(Planar.createParallelVertices(laneVerticesCenter, + newLane.getLateralWidth() / 2));\r\n \t\t}\r\n \t\treturn newLane; \t\r\n }", "public void calculateRoute() {\n SKRouteSettings route = new SKRouteSettings();\n route.setStartCoordinate(start);\n route.setDestinationCoordinate(end);\n route.setNoOfRoutes(1);\n switch (routingType) {\n case SHORTEST:\n route.setRouteMode(SKRouteSettings.SKRouteMode.BICYCLE_SHORTEST);\n break;\n case FASTEST:\n route.setRouteMode(SKRouteSettings.SKRouteMode.BICYCLE_FASTEST);\n break;\n case QUIET:\n route.setRouteMode(SKRouteSettings.SKRouteMode.BICYCLE_QUIETEST);\n break;\n }\n route.setRouteExposed(true);\n SKRouteManager.getInstance().calculateRoute(route);\n }" ]
[ "0.73367894", "0.72880596", "0.6776586", "0.64847475", "0.6469233", "0.6181518", "0.61467266", "0.6118292", "0.6103762", "0.5849501", "0.57624626", "0.5748484", "0.5582643", "0.5566905", "0.5561306", "0.5467064", "0.5454378", "0.54215276", "0.5418249", "0.5412767", "0.54000765", "0.53940016", "0.538686", "0.5354051", "0.5325824", "0.53031135", "0.5299971", "0.5295361", "0.52641225", "0.5244904", "0.52434886", "0.5229078", "0.52288914", "0.5222489", "0.5213302", "0.5210063", "0.5200185", "0.51942587", "0.5192785", "0.51852906", "0.5171376", "0.5163203", "0.51605797", "0.51541704", "0.5145975", "0.5133617", "0.51330215", "0.5129534", "0.51289386", "0.51246816", "0.5109139", "0.5093124", "0.509249", "0.5068532", "0.5065875", "0.5059941", "0.50526667", "0.5052392", "0.50480425", "0.5035708", "0.5029413", "0.502863", "0.5013879", "0.5013073", "0.5010546", "0.500305", "0.4999851", "0.49993932", "0.49969745", "0.49934584", "0.49930903", "0.49891177", "0.49851888", "0.4982442", "0.49818107", "0.49817878", "0.49752668", "0.49609068", "0.49414405", "0.49376142", "0.49350822", "0.49222854", "0.49187198", "0.4907656", "0.49068168", "0.49043795", "0.49025366", "0.48955715", "0.4891969", "0.48875353", "0.48835036", "0.4882658", "0.48791185", "0.4872443", "0.48722097", "0.48667762", "0.48506466", "0.48413795", "0.48406503", "0.4830287" ]
0.88825244
0
This method builds a settlement specified by the vertex and if it is free or not
void buildSettlement(VertexLocation vert, boolean free);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean canPlaceSettlement(VertexLocation vertLoc, boolean free);", "public void buySettlement(Vertex vertex) throws CannotBuyException, InsufficientPlayerResourcesException, AllPiecesPlayedException{\n\t\t if(canDoBuySettlement() == false) {\n\t\t\t throw new CannotBuyException(\"Cannot Buy Settlement, possibly no vertex to place a settlement\");\n\t\t }\n\t\t resourceCardHand.payForSettlement();\n\t\t playerPieces.placeSettlement(vertex);\n\t\t // increment victory points\n\t\t totalVictoryPoints++;\n\t }", "public TransactionBuilder checkInternalVertexExistence();", "private void buildSettlement() {\r\n\t\t// client.setCurrentPhase(Constants.PHASE_3);\r\n\t\tlastSettlementNode = clickedNode;\r\n\t\tMessage message = new Message(clickedNode, true, null);\r\n\t\tsendMessage(message);\r\n\t}", "@Override\r\n\tpublic void buildSettlement() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void placeSettlement(VertexLocation vertLoc) {\n\t\t\r\n\t}", "void buildCity(VertexLocation vert);", "@Override\n public void placeSettlement(VertexLocation vertex) throws ModelException {\n assert vertex != null;\n if (!GameModelFacade.instance().canPlaceSettlement(vertex)) {\n throw new ModelException(\"Preconditions for action not met.\");\n }\n\n try {\n String clientModel = m_theProxy.buildSettlement(GameModelFacade.instance().getLocalPlayer().getIndex(), vertex, GameModelFacade.instance().isFreeRound());\n new ModelInitializer().initializeClientModel(clientModel, m_theProxy.getPlayerId());\n } catch (NetworkException e) {\n throw new ModelException(e);\n }\n }", "private ProjectedVertex() {\n this.valid = false;\n this.edge = null;\n }", "protected Vertex() {\n\t\tisInDepot = false;\n\t}", "public void buyCity(Vertex vertex) throws CannotBuyException, InsufficientPlayerResourcesException, AllPiecesPlayedException {\n\t\t if(canDoBuyCity() == false) {\n\t\t\t throw new CannotBuyException(\"Cannot Buy City, possibly no vertex to place a city\");\n\t\t }\n\t\t resourceCardHand.payForCity();\n\t\t playerPieces.placeCity(vertex);\n\t\t \n\t\t // increment victory points\n\t\t totalVictoryPoints++;\n\t }", "void buildRoad(EdgeLocation edge, boolean free);", "public String buildSettlement(BuildSettlement buildSettlement) throws Exception {\n\t\tString url = server_url + \"/moves/buildSettlement\";\n\t\tURL obj = new URL(url);\n\t\tHttpURLConnection con = (HttpURLConnection) obj.openConnection();\n\n\t\t//add request header\n\t\tcon.setRequestMethod(\"POST\");\n\t\tcon.setRequestProperty(\"User-Agent\", \"Mozilla/5.0\");\n\t\tcon.setRequestProperty(\"Accept-Language\", \"en-US,en;q=0.5\");\n\t\tcon.setRequestProperty(\"Cookie\", usercookie + \"; \" + gamecookie);\n\t\t\n\t\tJsonObject info = new JsonObject();\n\t\tinfo.addProperty(\"type\",\"buildSettlement\");\n\t\tinfo.addProperty(\"playerIndex\", buildSettlement.playerIndex);\n\t\tinfo.addProperty(\"free\", buildSettlement.free);\n\t\t\n\t\tJsonObject loc = new JsonObject();\n\t\tloc.addProperty(\"x\", buildSettlement.vertexLocation.getHexLoc().getX());\n\t\tloc.addProperty(\"y\", buildSettlement.vertexLocation.getHexLoc().getY());\n\t\tloc.addProperty(\"direction\", directions.get(buildSettlement.vertexLocation.getDir().name()));\n\t\tinfo.add(\"vertexLocation\", loc);\n\t\t\n\t\t// Send post request\n\t\tcon.setDoOutput(true);\n\t\tDataOutputStream wr = new DataOutputStream(con.getOutputStream());\n\t\twr.writeBytes(info.toString());\n\t\twr.flush();\n\t\twr.close();\n\n\t\tint responseCode = con.getResponseCode();\n\t\t//System.out.println(\"\\nSending 'POST' request to URL : \" + url);\n\t\t//System.out.println(\"Post parameters : \" + info.toString());\n\t\t//System.out.println(\"Response Code : \" + responseCode);\n\n\t\tif (responseCode == 400) {\n\t\t\tthrow new Exception();\n\t\t}\n\t\tBufferedReader in = new BufferedReader(\n\t\t new InputStreamReader(con.getInputStream()));\n\t\tString inputLine;\n\t\tStringBuffer response = new StringBuffer();\n\n\t\twhile ((inputLine = in.readLine()) != null) {\n\t\t\tresponse.append(inputLine);\n\t\t}\n\t\tin.close();\n\t\t\n\t\t//print result\n\t\t////System.out.println(response.toString());\n\t\treturn response.toString();\n\t}", "public void testCreateAndSetOnSameVertexShouldCreateOnlyVertexOnly() {\n }", "public boolean build(Vertex vertex, int type) {\n \t\tif (vertex == null || !canBuild(vertex, type))\n \t\t\treturn false;\n \n \t\tboolean setup = board.isSetupPhase();\n \n \t\t// check resources based on type we want to build\n \t\tif (type == Vertex.TOWN) {\n \t\t\tif (!setup && !affordTown())\n \t\t\t\treturn false;\n \t\t} else if (type == Vertex.CITY) {\n \t\t\tif (!setup && !affordCity())\n \t\t\t\treturn false;\n \t\t} else {\n \t\t\t// invalid type\n \t\t\treturn false;\n \t\t}\n \n \t\tif (!vertex.build(this, type, setup))\n \t\t\treturn false;\n \n \t\t// deduct resources based on type\n \t\tif (vertex.getBuilding() == Vertex.TOWN) {\n \t\t\tif (!setup) {\n \t\t\t\tuseResources(Type.BRICK, 1);\n \t\t\t\tuseResources(Type.LUMBER, 1);\n \t\t\t\tuseResources(Type.GRAIN, 1);\n \t\t\t\tuseResources(Type.WOOL, 1);\n \t\t\t}\n \t\t\ttowns += 1;\n \t\t\tsettlements.add(vertex);\n \t\t\tboard.checkLongestRoad();\n \t\t} else {\n \t\t\tif (!setup) {\n \t\t\t\tuseResources(Type.GRAIN, 2);\n \t\t\t\tuseResources(Type.ORE, 3);\n \t\t\t}\n \t\t\ttowns -= 1;\n \t\t\tcities += 1;\n \t\t}\n \n \t\t// collect resources for second town during setup\n \t\tif (board.isSetupPhase2()) {\n \t\t\tfor (int i = 0; i < 3; i++) {\n \t\t\t\tHexagon hexagon = vertex.getHexagon(i);\n \t\t\t\tif (hexagon != null && hexagon.getType() != Type.DESERT)\n \t\t\t\t\taddResources(hexagon.getType(), 1);\n \t\t\t}\n \t\t}\n \n \t\tlastTown = vertex;\n \n \t\tappendAction(type == Vertex.TOWN ? R.string.player_town\n \t\t\t\t: R.string.player_city);\n \n \t\treturn true;\n \t}", "protected void building(double xCoord, double yCoord, double len, double width, double height)\n {\n double x1 = (xCoord - (width/2)); // Low x\n double x2 = (xCoord + (width/2)); // High x\n double y1 = (yCoord - (len/2)); // Low y\n double y2 = (yCoord + (len/2)); // High y\n\n Vertex vertex1, vertex2, vertex3;\n\n Triple pos1, pos2, pos3, pos4, pos5, pos6, pos7, pos8, col1, col2, col3, col4;\n Vertex vert1, vert2, vert3;\n\n pos1 = new Triple(x1, y1, 0); \n pos2 = new Triple(x2, y1, 0); \n pos3 = new Triple(x2, y1, height);\n pos4 = new Triple(x1, y1, height);\n pos5 = new Triple(x1, y2, 0); \n pos6 = new Triple(x2, y2, 0); \n pos7 = new Triple(x2, y2, height);\n pos8 = new Triple(x1, y2, height);\n\n col1 = new Triple(1, 0, 0); \n col2 = new Triple(0, 1, 0); \n col3 = new Triple(0, 0, 1); \n col4 = new Triple(1, 0, 1); \n \n // Front Triangles\n frozenSoups.addTri( new Triangle(new Vertex(pos1, 0, 0), \n new Vertex(pos2, 0, 1), \n new Vertex(pos3, 1, 1), \n\t\t\t\t 25 ) );\n\n frozenSoups.addTri( new Triangle(new Vertex(pos3, 1, 1), \n new Vertex(pos4, 1, 0), \n new Vertex(pos1, 0, 0),\n 25 ) );\n \n // Left Triangles\n frozenSoups.addTri( new Triangle(new Vertex(pos1, 0, 0), \n new Vertex(pos5, 0, 1), \n new Vertex(pos8, 1, 1),\n 26 ) );\n\n frozenSoups.addTri( new Triangle(new Vertex(pos8, 1, 1), \n new Vertex(pos4, 1, 0), \n new Vertex(pos1, 0, 0),\n 26 ) );\n\n // Right Triangles\n frozenSoups.addTri( new Triangle(new Vertex(pos2, 0, 0), \n new Vertex(pos6, 0, 1), \n new Vertex(pos7, 1, 1),\n 24 ) );\n\n frozenSoups.addTri( new Triangle(new Vertex(pos7, 1, 1), \n new Vertex(pos3, 1, 0), \n new Vertex(pos2, 0, 0),\n 24 ) );\n\n // Back Triangles\n frozenSoups.addTri( new Triangle(new Vertex(pos5, 0, 0), \n new Vertex(pos6, 0, 1), \n new Vertex(pos7, 1, 1),\n 27 ) );\n\n frozenSoups.addTri( new Triangle(new Vertex(pos7, 1, 1), \n new Vertex(pos8, 1, 0), \n new Vertex(pos5, 0, 0),\n 27 ) );\n\n // Top Triangles\n frozenSoups.addTri( new Triangle(new Vertex(pos4, 0, 0), \n new Vertex(pos3, 0, 1), \n new Vertex(pos7, 1, 1),\n 28 ) );\n\n frozenSoups.addTri( new Triangle(new Vertex(pos7, 1, 1), \n new Vertex(pos8, 1, 0), \n new Vertex(pos4, 0, 0),\n 28 ) );\n }", "public void finish(){\n //check start vertex is valid for given algorithm\n }", "private boolean buildStreetIsAllowed() {\r\n\t\tif (clickedRoad.getEnd() == lastSettlementNode\r\n\t\t\t\t|| clickedRoad.getStart() == lastSettlementNode) {\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 String breadthFirstSearch( AnyType start_vertex ) throws VertexException {\n \n StringBuffer buffer = new StringBuffer();\n \n // ----------------------------\n // TODO: Add your code here\n // ----------------------------\n boolean exists = false;\n Vertex<AnyType> S = new Vertex<AnyType>(start_vertex);\n int counter = 1;\n //make new vertex to check if its in list\n //make queue to hold vertices\n SemiConstantTimeQueue<Vertex<AnyType>> queue = new SemiConstantTimeQueue<Vertex<AnyType>>();\n //loop through and set not visited\n for( int i = 0; i < vertex_adjacency_list.size(); i++){\n vertex_adjacency_list.get(i).setVisited(-1);\n //if it's in list then set exists to true\n //and set visited \n if(vertex_adjacency_list.get(i).compareTo(S) == 0){\n exists = true;\n vertex_adjacency_list.get(i).setVisited(counter);\n counter = i;\n }\n } \n //if doesn't exist then throw the exception\n if(exists == false){\n throw new VertexException(\"Start Vertex does not exist\");\n }\n //make new queue\n queue.add(vertex_adjacency_list.get(counter));\n vertex_adjacency_list.get(counter).setVisited(1);\n counter = 1;\n int k=0;\n Vertex<AnyType>e;\n //while the queue isn't empty\n while(queue.peek() !=null){\n //make e the top of the queue \n e = queue.peek(); \n //go through the list and if you reach the begining it exits loop\n for( k = 0; k < vertex_adjacency_list.size()-1; k++){\n if(vertex_adjacency_list.get(k).compareTo(e)==0){\n break;\n }\n } \n //go through loop and check if visited, if not then add it to queue, set visited\n for( int j = 0; j< vertex_adjacency_list.get(k).numberOfAdjacentVertices(); j++){\n if(vertex_adjacency_list.get(k).getAdjacentVertex(j).hasBeenVisited()==false){\n counter++;\n queue.add(vertex_adjacency_list.get(k).getAdjacentVertex(j));\n vertex_adjacency_list.get(k).getAdjacentVertex(j).setVisited(counter);\n }\n }\n //remove from queue when through loop once\n k++;\n queue.remove();\n }\n //loop through list and print vertex and when it was visited\n for(int o = 0; o< vertex_adjacency_list.size(); o++){\n buffer.append(vertex_adjacency_list.get(o) + \":\" + vertex_adjacency_list.get(o).getVisited()+ \"\\n\");\n }\n return buffer.toString();\n }", "public void setTo(Vertex<VV> vertex)\r\n { this.to = vertex; }", "public static boolean Util(Graph<V, DefaultEdge> g, ArrayList<V> set, int colors, HashMap<String, Integer> coloring, int i, ArrayList<arc> arcs, Queue<arc> agenda)\n {\n /*if (i == set.size())\n {\n System.out.println(\"reached max size\");\n return true;\n }*/\n if (set.isEmpty())\n {\n System.out.println(\"Set empty\");\n return true;\n }\n //V currentVertex = set.get(i);\n\n /*System.out.println(\"vertices and mrv:\");\n V start = g.vertexSet().stream().filter(V -> V.getID().equals(\"0\")).findAny().orElse(null);\n Iterator<V> iterator = new DepthFirstIterator<>(g, start);\n while (iterator.hasNext()) {\n V v = iterator.next();\n System.out.println(\"vertex \" + v.getID() + \" has mrv of \" + v.mrv);\n }*/\n\n // Find vertex with mrv\n V currentVertex;\n int index = -1;\n int mrv = colors + 10;\n for (int it = 0; it < set.size(); it++)\n {\n if (set.get(it).mrv < mrv)\n {\n mrv = set.get(it).mrv;\n index = it;\n }\n }\n currentVertex = set.remove(index);\n\n //System.out.println(\"Got vertex: \" + currentVertex.getID());\n\n\n // Try to assign that vertex a color\n for (int c = 0; c < colors; c++)\n {\n currentVertex.color = c;\n if (verifyColor(g, currentVertex))\n {\n\n // We can assign color c to vertex v\n // See if AC3 is satisfied\n /*currentVertex.domain.clear();\n currentVertex.domain.add(c);*/\n if (!agenda.isEmpty()) numAgenda++;\n while(!agenda.isEmpty())\n {\n arc temp = agenda.remove();\n\n // Make sure there exists v1, v2, in V1, V2, such that v1 != v2\n V v1 = g.vertexSet().stream().filter(V -> V.getID().equals(temp.x)).findAny().orElse(null);\n V v2 = g.vertexSet().stream().filter(V -> V.getID().equals(temp.y)).findAny().orElse(null);\n\n\n\n // No solution exists in this branch if a domain is empty\n //if ((v1.domain.isEmpty()) || (v2.domain.isEmpty())) return false;\n\n if (v2.color == -1) continue;\n else\n {\n Boolean[] toRemove = new Boolean[colors];\n Boolean domainChanged = false;\n for (Integer it : v1.domain)\n {\n if (it == v2.color)\n {\n toRemove[it] = true;\n }\n }\n for (int j = 0; j < toRemove.length; j++)\n {\n if ((toRemove[j] != null))\n {\n v1.domain.remove(j);\n domainChanged = true;\n }\n }\n // Need to check constraints with v1 on the right hand side\n if (domainChanged)\n {\n for (arc it : arcs)\n {\n // Add arc back to agenda to check constraints again\n if (it.y.equals(v1.getID()))\n {\n agenda.add(it);\n }\n }\n }\n }\n if ((v1.domain.isEmpty()) || (v2.domain.isEmpty()))\n {\n System.out.println(\"returning gfalse here\");\n return false;\n }\n }\n\n // Reset agenda to check arc consistency on next iteration\n for (int j = 0; j < arcs.size(); j++)\n {\n agenda.add(arcs.get(i));\n }\n\n\n //System.out.println(\"Checking if vertex \" + currentVertex.getID() + \" can be assigned color \" + c);\n coloring.put(currentVertex.getID(), c);\n updateMRV(g, currentVertex);\n if (Util(g, set, colors, coloring, i + 1, arcs, agenda))\n {\n\n return true;\n }\n\n //System.out.println(\"Assigning vertex \" + currentVertex.getID() + \" to color \" + currentVertex.color + \" did not work\");\n coloring.remove(currentVertex.getID());\n currentVertex.color = -1;\n }\n }\n return false;\n }", "private void computeSat(){\n addVertexVisitConstraint();\n //add clause for each vertex must be visited only once/ all vertices must be on path\n addVertexPositionConstraint();\n //add clause for every edge in graph to satisfy constraint of vertices not belonging to edge not part of successive positions\n addVertexNonEdgeConstraint();\n }", "public void setFrom(Vertex<VV> vertex)\r\n { this.from = vertex; }", "private void vertexUp(String vertex) {\r\n\t\tIterator it = vertexMap.entrySet().iterator();\r\n\t\twhile (it.hasNext()) {\r\n\t\t\tMap.Entry pair = (Map.Entry) it.next();\r\n\t\t\tif (pair.getKey().equals(vertex)) {\r\n\t\t\t\tVertex v = (Vertex) pair.getValue();\r\n\t\t\t\tv.setStatus(true);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "boolean hasIsVertexOf();", "public boolean hasVertex(T vert);", "Vertex createVertex();", "public void buildPath(Vertex v) {\n\t\t// permutations des directions\n\t\tList<direction> direct = new ArrayList<>();\n\t\tCollections.addAll(direct, direction.values());\n\t\tCollections.shuffle(direct);\n\t\t\n\t\tfor (int i = 0 ; i < direct.size() ; i++) {\n\t\t\tVertex v2;\n\t\t\tdirection dir = direct.get(i);\n\t\t\tif (v.inBorders(dir) && g.vertexDoesntExist(v, dir) && g.edgeDoesntExist(v, dir)) {\n\t\t\t\tv2 = g.vertexByDir(v, dir);\n\t\t\t\tv2.setNbr(v.getNbr()+1);\n\t\t\t\tg.addVertex(v2);\n\t\t\t\tg.addEdge(v, v2);\n\t\t\t\t//System.out.println(\"edge : \"+\"(\"+v.toString()+\",\"+v2.toString()+\") \"+dir);\n\t\t\t\tbuildPath(v2);\n\t\t\t}\n\t\t}\n\t}", "public boolean canBuild(Vertex vertex, int type) {\n \t\tif (type == Vertex.TOWN && towns >= MAX_TOWNS)\n \t\t\treturn false;\n \t\telse if (type == Vertex.CITY && cities >= MAX_CITIES)\n \t\t\treturn false;\n \n \t\treturn vertex.canBuild(this, type, board.isSetupPhase());\n \t}", "boolean newVertex() {\n if (next == null) {\n return false;\n }\n System.arraycopy(next, 0, simp[worst], 0, numVertices);\n return true;\n }", "private Polygon2D getTriByVertex(Point2D vertex) {\n \t\tPolygon2D tri = new Polygon2D();\n \t\tdouble y = vertex.getY();\n \t\ttri.append(vertex);\n \t\ttri.append(250+y*Math.sqrt(3)/2, 250*Math.sqrt(3)-y/2);\n \t\ttri.append(750-y*Math.sqrt(3)/2, 250*Math.sqrt(3)-y/2);\n \t\treturn tri;\n }", "public boolean addVertex(T vert);", "public List<Long> getPath(Long start, Long finish){\n \n \n List<Long> res = new ArrayList<>();\n // auxiliary list\n List<DeixtraObj> serving = new ArrayList<>();\n// nearest vertexes map \n Map<Long,DeixtraObj> optimMap = new HashMap<>();\n// thread save reading \n synchronized (vertexes){ \n // preparation\n for (Map.Entry<Long, Vertex> entry : vertexes.entrySet()) {\n Vertex userVertex = entry.getValue();\n // If it`s start vertex weight = 0 and the nereast vertex is itself \n if(userVertex.getID().equals(start)){\n serving.add(new DeixtraObj(start, 0.0, start));\n }else{\n // For other vertex weight = infinity and the nereast vertex is unknown \n serving.add(new DeixtraObj(userVertex.getID(), Double.MAX_VALUE, null));\n }\n\n } \n // why auxiliary is not empty \n while(serving.size()>0 ){\n // sort auxiliary by weight \n Collections.sort(serving);\n\n \n // remove shortes fom auxiliary and put in to answer \n DeixtraObj minObj = serving.remove(0);\n optimMap.put(minObj.getID(), minObj);\n\n Vertex minVertex = vertexes.get(minObj.getID());\n\n // get all edges from nearest \n for (Map.Entry<Long, Edge> entry : minVertex.allEdges().entrySet()) {\n Long dest = entry.getKey();\n Double wieght = entry.getValue().getWeight();\n // by all remain vertexes \n for(DeixtraObj dx : serving){\n if(dx.getID().equals(dest)){\n // if in checking vertex weight more then nearest vertex weight plus path to cheking \n // then change in checking weight and nearest\n if( (minObj.getWeight()+wieght) < dx.getWeight()){\n dx.setNearest(minVertex.getID());\n dx.setWeight((minObj.getWeight()+wieght));\n }\n }\n }\n }\n\n }\n }\n \n // create output list\n res.add(finish);\n Long point = finish;\n while(!point.equals(start)){\n \n point = ((DeixtraObj)optimMap.get(point)).getNearest();\n res.add(point);\n }\n \n Collections.reverse(res);\n \n \n return res;\n \n }", "public abstract boolean putVertex(Vertex incomingVertex);", "@Test\n public void testShortestPathEstacoes() {\n completeMap = new Graph(false);\n incompleteMap = new Graph(false);\n\n completeMap.insertVertex(porto);\n Company.getParkRegistry().getParkMap().put(porto, portoL);\n completeMap.insertVertex(braga);\n Company.getParkRegistry().getParkMap().put(braga, bragaL);\n completeMap.insertVertex(vila);\n Company.getParkRegistry().getParkMap().put(vila, vilaL);\n completeMap.insertVertex(aveiro);\n Company.getParkRegistry().getParkMap().put(aveiro, aveiroL);\n completeMap.insertVertex(coimbra);\n Company.getParkRegistry().getParkMap().put(coimbra, coimbraL);\n completeMap.insertVertex(leiria);\n Company.getParkRegistry().getParkMap().put(leiria, leiriaL);\n\n completeMap.insertVertex(viseu);\n Company.getParkRegistry().getParkMap().put(viseu, viseuL);\n completeMap.insertVertex(guarda);\n Company.getParkRegistry().getParkMap().put(guarda, guardaL);\n completeMap.insertVertex(castelo);\n Company.getParkRegistry().getParkMap().put(castelo, casteloL);\n completeMap.insertVertex(lisboa);\n Company.getParkRegistry().getParkMap().put(lisboa, lisboaL);\n completeMap.insertVertex(faro);\n Company.getParkRegistry().getParkMap().put(faro, faroL);\n\n completeMap.insertEdge(porto, aveiro, c, 75);\n completeMap.insertEdge(porto, braga, c2, 60);\n completeMap.insertEdge(porto, vila, c3, 100);\n completeMap.insertEdge(viseu, guarda, c4, 75);\n completeMap.insertEdge(guarda, castelo, c5, 100);\n completeMap.insertEdge(aveiro, coimbra, c6, 60);\n completeMap.insertEdge(coimbra, lisboa, c7, 200);\n completeMap.insertEdge(coimbra, leiria, c8, 80);\n completeMap.insertEdge(aveiro, leiria, c9, 120);\n completeMap.insertEdge(leiria, lisboa, c10, 150);\n\n completeMap.insertEdge(aveiro, viseu, c11, 85);\n completeMap.insertEdge(leiria, castelo, c12, 170);\n completeMap.insertEdge(lisboa, faro, c13, 280);\n\n incompleteMap = completeMap.clone();\n\n incompleteMap.removeEdge(aveiro, viseu);\n incompleteMap.removeEdge(leiria, castelo);\n incompleteMap.removeEdge(lisboa, faro);\n\n System.out.println(\"Test of shortest path\");\n\n LinkedList<String> shortPath = new LinkedList<>();\n double lenpath = 0;\n\n Company.getParkRegistry().setGraph(completeMap);\n lenpath = GraphAlgorithms.shortestPathEnergySpent(completeMap, porto, l, shortPath);\n assertTrue(\"Length path should be 0 if vertex does not exist\", lenpath == 0);\n\n Company.getParkRegistry().setGraph(incompleteMap);\n lenpath = GraphAlgorithms.shortestPathEnergySpent(incompleteMap, porto, faro, shortPath);\n assertTrue(\"Length path should be 0 if there is no path\", lenpath == 0);\n\n Company.getParkRegistry().setGraph(completeMap);\n lenpath = GraphAlgorithms.shortestPath(completeMap, porto, porto, shortPath);\n assertTrue(\"Number of nodes should be 1 if source and vertex are the same\", lenpath == 0);\n\n Company.getParkRegistry().setGraph(incompleteMap);\n lenpath = GraphAlgorithms.shortestPath(incompleteMap, porto, lisboa, shortPath);\n assertTrue(\"Path between Porto and Lisboa should be 335 Km\", lenpath == 335);\n\n Iterator<String> it = shortPath.iterator();\n assertTrue(\"First in path should be Porto\", it.next().equals(porto));\n assertTrue(\"then Aveiro\", it.next().equals(aveiro));\n assertTrue(\"then Coimbra\", it.next().equals(coimbra));\n assertTrue(\"then Lisboa\", it.next().equals(lisboa));\n completeMap.insertEdge(porto, lisboa, c, 10);\n\n Company.getParkRegistry().setGraph(incompleteMap);\n lenpath = GraphAlgorithms.shortestPathEnergySpent(incompleteMap, braga, leiria, shortPath);\n assertEquals(\"Path between Braga and Leiria should be close to 152.89\", lenpath, 152, 1);\n\n it = shortPath.iterator();\n\n assertTrue(\"First in path should be Braga\", it.next().equals(braga));\n assertTrue(\"then Porto\", it.next().equals(porto));\n assertTrue(\"then Aveiro\", it.next().equals(aveiro));\n assertTrue(\"then Coimbra\", it.next().equals(coimbra));\n assertTrue(\"then Leiria\", it.next().equals(leiria));\n\n shortPath.clear();\n Company.getParkRegistry().setGraph(completeMap);\n lenpath = GraphAlgorithms.shortestPathEnergySpent(completeMap, porto, castelo, shortPath);\n assertEquals(\"Path between Porto and Castelo Branco should be close to 202.86\", lenpath, 202, 1);\n assertTrue(\"N. cities between Porto and Castelo Branco should be 5 \", shortPath.size() == 5);\n\n it = shortPath.iterator();\n\n assertTrue(\"First in path should be Porto\", it.next().equals(porto));\n assertTrue(\"then Aveiro\", it.next().equals(aveiro));\n assertTrue(\"then Viseu\", it.next().equals(viseu));\n assertTrue(\"then Viseu\", it.next().equals(guarda));\n assertTrue(\"then Castelo Branco\", it.next().equals(castelo));\n\n //Changing Edge: aveiro-viseu with Edge: leiria-C.Branco \n //should change shortest path between porto and castelo Branco\n completeMap.removeEdge(aveiro, viseu);\n completeMap.insertEdge(leiria, castelo, c12, 170);\n shortPath.clear();\n\n Company.getParkRegistry().setGraph(completeMap);\n lenpath = GraphAlgorithms.shortestPath(completeMap, porto, castelo, shortPath);\n assertTrue(\"Path between Porto and Castelo Branco should now be 330 Km\", lenpath == 330);\n assertTrue(\"Path between Porto and Castelo Branco should be 4 cities\", shortPath.size() == 4);\n\n }", "@Test\n void testAddVertexGraph() {\n Assertions.assertTrue(graph.addVertex(v1));\n Assertions.assertTrue(graph.containsVertex(v1));\n Assertions.assertTrue(checkInv());\n }", "@MessageMapping(\"/setupsettlement\")\n @SendTo(\"/topic/settlement\")\n public ViewPiece setupSettlement(ViewPiece pNew, Principal caller){\n System.out.println(\"Check settlement\");\n Player checkee = gameManager.getPlayerFromString(caller.getName());\n Intersection checker = gameManager.getGame().getBoard().getIntersections().get(pNew.getId());\n boolean isValid = gameManager.checkIntersectionSetupEligibility(checker);\n if(isValid) {\n gameManager.placeSettlement(checkee, checker);\n }\n pNew.setIsValid(isValid);\n return pNew;\n }", "boolean canPlaceCity(VertexLocation vertLoc);", "public void breadthFirstSearch(int vertexIndex) {\n Queue<Integer> queue = new LinkedList<Integer>();\n vertexList[vertexIndex].wasVisited = true;\n displayVertex(vertexIndex);\n int unvisitedIndex;\n do {\n\n do {\n unvisitedIndex = getAdjacentUnvisitedVertexIndex(vertexIndex);\n if(unvisitedIndex != -1) {\n vertexList[unvisitedIndex].wasVisited = true;\n displayVertex(unvisitedIndex);\n queue.add(unvisitedIndex);\n\n }\n } while(unvisitedIndex != -1);\n if(!queue.isEmpty()) {\n vertexIndex = queue.remove();\n\n }\n\n } while(!queue.isEmpty());\n\n for (int i = 0; i < vertexCount; i++) {\n vertexList[i].wasVisited = false;\n\n }\n }", "private void CreatingBeautyContent(int count,int typeSymmetry, int methodSearch) {\n\t\t\tConstraintsPlacement objConstraints= new ConstraintsPlacement(this);\r\n\t\t\t//Creating array with states\r\n\t\t\tArrayList<BlockNode> states = new ArrayList<BlockNode>();\r\n\t\t\t//Building the graph in a deph way\r\n\t \tGraphBuilder objGrapB= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB2= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB3= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB3a= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB4= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB5= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB6= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB7= new GraphBuilder(1);\r\n\t \tGraphBuilder objGrapB8= new GraphBuilder(1);\r\n\t \t\r\n\t \tobjGrapB.setWparamether(wParamether);\r\n\t \tobjGrapB2.setWparamether(wParamether);\r\n\t \tobjGrapB3.setWparamether(wParamether);\r\n\t \tobjGrapB3a.setWparamether(wParamether);\r\n\t \tobjGrapB4.setWparamether(wParamether);\r\n\t \tobjGrapB5.setWparamether(wParamether);\r\n\t \tobjGrapB6.setWparamether(wParamether);\r\n\t \tobjGrapB7.setWparamether(wParamether);\r\n\t \tobjGrapB8.setWparamether(wParamether);\r\n\t \t\r\n\t \tint numElements=objElem.getNumberObjects();\r\n\t \tint numEnemies=objElem.getNumberObjectsEnemies();\r\n\t \tint globalControlSearch=0;\r\n\t \t\r\n\t \tdouble time6=0;\r\n\t \tdouble time7=0;\r\n\t \tdouble time3=0;\r\n\t \tdouble time4=0;\r\n\t \tdouble time5=0;\r\n\t \tdouble time8=0;\r\n\t \t\r\n\t \tdouble startTime=0;\r\n\t \tdouble stopTime=0;\r\n\t \t\r\n\t \tdouble sum3=0;\r\n\t \tdouble sum4=0;\r\n\t \tdouble sum5=0;\r\n\t \tdouble sum6=0;\r\n\t \tdouble sum7=0;\r\n\t \tdouble sum8=0;\r\n\r\n\t \t\r\n\t \t//Beststates=objGrapB.basicDepthSearch(mediumStraight,height,numElements,numElements,states,objConstraints, objElem.getFinalList(),objElem);\r\n\t \t//Beststates=objGrapB.relativePositionDepthSearch(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,-mediumStraight+2,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch);\r\n\t \t//Beststates=objGrapB.relativeTransPositionDepthSearch(mediumStraight,height,numElements,numElements,states,objConstraints, objElem.getFinalList(),objElem,-mediumStraight+1,mediumStraight-1,floorTileHeight,0,0,currentState,hTable);\r\n\t \t//Beststates=objGrapB.DepthSearchCenterFrame(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,1,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch);\r\n\t \t//Beststates=objGrapB.DepthSearchPruningAlt(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,1,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch);\r\n\t \t\r\n\t \r\n\r\n\t \r\n\t //3.3) Brute-force search\r\n\t //objElem.setFinalList(objElem.getFinalListNoOrder());\r\n\t \tfor(int i=0;i<1;i++)\r\n\t \t{\r\n\t \t\tstartTime = System.currentTimeMillis();\r\n\t \t\tBeststates3=objGrapB3.DepthSearchCenterFrameNoPruningNoRegionsNoObjects(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,0,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch,8,typeSymmetry);\r\n\t \t\tstopTime = System.currentTimeMillis();\r\n\t \t\ttime3 = stopTime - startTime;\r\n//\t \t\tround(time3,2);\r\n//\t \t\tdouble nodes3=round((double)objGrapB3.getCounterIDs(),2);\r\n//\t \t\tSystem.out.println(objGrapB3.bestSymmetryV+\" \"+time3+\" \"+((objGrapB3.getCounterIDs())));\r\n\t \t\tsum3=sum3+time3;\r\n\t \t}\r\n\t \ttime3=sum3/1;\r\n\t \ttime3=round(time3,2);\r\n\t //System.out.println(\"Time Brute-force search \"+elapsedTime);\r\n\t \t\r\n\t \r\n\t \r\n\t //3.7) B&B+heuristic\r\n\t //objElem.setFinalList(objElem.getFinalListNoOrder());\r\n\t \tfor(int i=0;i<1;i++)\r\n\t \t{\r\n\t \t\tstartTime = System.currentTimeMillis();\r\n\t \t\tBeststates7=objGrapB7.depthSearchBBHeuristic(mediumStraight,height,numElements-numEnemies,numElements-numEnemies,states,objConstraints, objElem.getFinalList(),objElem,0,mediumStraight-2,floorTileHeight,0,0,numEnemies,random,globalControlSearch,8,typeSymmetry);\r\n\t \t\tstopTime = System.currentTimeMillis();\r\n\t \t\ttime7 = stopTime - startTime;\r\n//\t \t\tround(time7,2);\r\n//\t \t\tdouble nodes7=round((double)objGrapB3.getCounterIDs(),2);\r\n//\t \t\tSystem.out.println(objGrapB6.bestSymmetryV+\" \"+time6+\" \"+((objGrapB6.getCounterIDs())));\r\n\t \t\tsum7=sum7+time7;\r\n\t \t}\r\n\t \ttime7=sum7/1;\r\n\t \ttime7=round(time7,2);\r\n\t //System.out.println(\"Time B&B+heuristic + region ordering \"+elapsedTime);\r\n\t \t\r\n\t \t\r\n\t \t\r\n//\t \tif(objGrapB3.bestSymmetryV<objGrapB5.bestSymmetryV)\r\n//\t \t{\r\n//\t \t\tdouble bestSYmmetry=objGrapB3.bestSymmetryV;\r\n//\t \t\t//System.out.println(\"bestSym \"+bestSYmmetry);\r\n//\t \t\tBestGlobalstates=Beststates3;\r\n//\t \t\t\r\n//\t \t}\r\n//\t \telse\r\n//\t \t{\r\n//\t \t\tdouble bestSYmmetry=objGrapB5.bestSymmetryV;\r\n//\t \t\t//System.out.println(\"bestSym \"+bestSYmmetry);\r\n//\t \t\tBestGlobalstates=Beststates5;\r\n//\t \t}\r\n\t \t\r\n\t \tBestGlobalstates=Beststates7;\r\n\t \r\n\t \r\n\t \t//**System.out.println(\"Simetry 0-> Brute-force search order \"+objGrapB3a.bestSymmetryV);\t\r\n\t \t//System.out.println(\"Simetry 1-> Brute-force search \"+objGrapB3.bestSymmetryV);\t \t\r\n\t \t//System.out.println(\"Simetry 2-> B&B+oldheuristic \"+objGrapB4.bestSymmetryV);\r\n\t \t//**System.out.println(\"Simetry 3-> B&B+heuristic + object ordering \"+objGrapB2.bestSymmetryV);\t \t\r\n\t \t//System.out.println(\"Simetry 4-> B&B+ region + leviheuristic\"+objGrapB5.bestSymmetryV);\r\n\t \t//**System.out.println(\"Simetry 5-> B&B+heuristic + region ordering + object ordering \"+objGrapB.bestSymmetryV);\r\n\t \t//System.out.println(\"Simetry 6-> B&B+heuristic + leviheuristic \"+objGrapB6.bestSymmetryV);\r\n\t \t//System.out.println(\"Simetry 7-> B&B+oldoldheuristic \"+objGrapB7.bestSymmetryV);\r\n\t \t\r\n\t \t//**System.out.println( \"States 0 \"+objGrapB3a.getCounterIDs() );\r\n\t \t//System.out.println( \"States 1 \"+objGrapB3.getCounterIDs() );\r\n\t \t//System.out.println( \"States 2 \"+objGrapB4.getCounterIDs() );\r\n\t \t//**System.out.println( \"States 3 \"+objGrapB2.getCounterIDs() );\t \t\t \t\r\n\t \t//System.out.println( \"States 4 \"+objGrapB5.getCounterIDs() );\r\n\t \t//**System.out.println( \"States 5 \"+objGrapB.getCounterIDs() );\r\n\t \t//System.out.println( \"States 6 \"+objGrapB6.getCounterIDs() );\r\n\t \t//System.out.println( \"States 7 \"+objGrapB7.getCounterIDs() );\r\n\t \t\r\n\t \tdouble TimeRate7=time3/time7;\r\n\t \tdouble TimeRate6=time3/time6;\r\n\t \tdouble TimeRate5=time3/time5;\r\n\t \t\r\n\t \tTimeRate7=round(TimeRate7,2);\r\n\t \tTimeRate6=round(TimeRate6,2);\r\n\t \tTimeRate5=round(TimeRate5,2);\r\n\t \t\r\n\t \tdouble NodesRate7=(double)objGrapB3.getCounterIDs()/(double)objGrapB7.getCounterIDs();\r\n\t \tdouble NodesRate6=(double)objGrapB3.getCounterIDs()/(double)objGrapB6.getCounterIDs();\r\n\t \tdouble NodesRate5=(double)objGrapB3.getCounterIDs()/(double)objGrapB5.getCounterIDs();\r\n\t \t\r\n\t \tNodesRate7=round(NodesRate7,2);\r\n\t \tNodesRate6=round(NodesRate6,2);\r\n\t \tNodesRate5=round(NodesRate5,2);\r\n\r\n\t \t\r\n\t \t\r\n\r\n\t //imprimiendo los estados visitados\r\n\t /*\r\n\t Iterator<BlockNode> nombreIterator = states.iterator();\r\n\t while(nombreIterator.hasNext()){\r\n\t \tBlockNode elemento = nombreIterator.next();\r\n\t \tSystem.out.print(elemento.getID()+\" / \");\r\n\t }*/\r\n\t \r\n\t //here we are painting as the best branch founded\r\n\t \r\n\t //System.out.println(\"nene \"+BestGlobalstates.size());\r\n\t Iterator<BlockNode> nombreIterator = BestGlobalstates.iterator();\r\n\t while(nombreIterator.hasNext()){\r\n\t \tBlockNode elemento = nombreIterator.next();\r\n\t \t//System.out.print(elemento.getID()+\"(\"+elemento.getX()+\" \"+elemento.getY()+\" ) - \"+elemento.getType()+\" \"+elemento.getIdElement()+ \" / \");\r\n\t }\r\n\t \r\n\t \r\n\t //Here we will put the elements on the tile\r\n\t try {\r\n\t Level levelScreen=PaintElements(BestGlobalstates,this);\r\n\t Screen objScreen=new Screen();\r\n\t\t\tobjScreen.SaveScreen(levelScreen,odds,objElem);\r\n \t\tInformacoesTelas info = new InformacoesTelas();\r\n\t CopiaArquivos copiador = new CopiaArquivos();\r\n\t \r\n\t info = info.carregaInfoTela(\"infoTela\");\r\n\t\t\tinfo.setOutrasVariaveis(0, 0); // Salva outras informacoes da Tela\r\n\t\t\tinfo.salvaInfoTela(\"infoTela\", info);\t\t\t\t\t\r\n\t\t\tcopiador.copy(\"\" + count, \"Screens/\");\r\n\t\t\t\r\n\t } catch (ClassNotFoundException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}", "public void bsetCostElements() {\n\t\t\t\n\t\t\t\n\t\tfor (int obj = 0; obj < finalLocation.length; obj++) {\n\t\t for (int time = 0; time < finalLocation[obj].length; time++) {\n\t\t\t\n\t\t bfCost[obj][time].bstorageCost=totalCostCalculation.btotalResidentCost[time][obj][finalLocation[obj][time]].bstorageCost;\n\t\t\t bfCost[obj][time].breadCost=totalCostCalculation.btotalResidentCost[time][obj][finalLocation[obj][time]].breadCost;\n\t\t\t bfCost[obj][time].bwriteCost=totalCostCalculation.btotalResidentCost[time][obj][finalLocation[obj][time]].bwriteCost;\n\t\t\t bfCost[obj][time].btranCost=totalCostCalculation.btotalResidentCost[time][obj][finalLocation[obj][time]].btranCost;\n\t\t\t \n\t\t\t //1. we calculate latency cost for two cases separately: when the object is in the hot tier or cool tier.\n\t\t\t if (finalLocation[obj][time]==0){//Object is in the cool tier\n\t\t\t\t bfCost[obj][time].bdelayCost=totalCostCalculation.btotalResidentCost[time][obj][0].bdelayCost;\n\t\t\t\t \n\t\t\t }else{// object is in both tiers and, in consequence, the latency cost of writes is the maximum latency of writing in both tiers, and the read latency is the one in hot tier.\n\t\t\t\t bfCost[obj][time].bedelCost=fc.bdelayMaxWriteReadCost(workloadGenerator.objectListRegion[obj], 1, obj, time);\n\t\t\t }\n\t\t\t \n\t\t /* 2. Here we calculate storage cost and transaction cost to make consistent data. This requires just write transaction. Since in our cost \n calculation make a computation for both read and writes.\n\t\t */\n\t\t \n\t\t if(finalLocation[obj][time]==1){//NOTE: in above cost storage, we calculate the cost of object in either in hot or cold tier. \n\t\t \t //So here we calculate the storage cost in cold tier when the object is in hot tier.\n\t\t \t bfCost[obj][time].bstorageCost=bfCost[obj][time].bstorageCost.add(totalCostCalculation.btotalResidentCost[time][obj][0].bstorageCost);\n\t\t bfCost[obj][time].bconsisCost=totalCostCalculation.btotalResidentCost[time][obj][0].bconsisCost;\n\t\t }\n\t\t\t bfCost[obj][time].bnonMigrationCost=bfCost[obj][time].bstorageCost.add(bfCost[obj][time].breadCost).add( bfCost[obj][time].bwriteCost).\n\t\t\t\t\t add(bfCost[obj][time].btranCost).add( bfCost[obj][time].bconsisCost).\n\t\t\t\t\t add(bfCost[obj][time].bdelayCost);\n\t\t\t\t\t //totalCostCalculation.btotalResidentCost[time][obj][finalLocation[obj][time]].bnonMigrationCost.add(bfCost[obj][time].bconsisCost);\n\t\t\t \n\t\t\t //3. We need to calculate just transfer cost between cold to hot tier. From hot to cold tier does not make sense because we have a copy of data in cold tier.\n\t\t if(breakPoint==1){//If breakPoint is ONE then for serving every user, the object for each time slot is transfered from Cold to Hot tier.\n\t\t \t \n\t\t }\n\t\t else if(time>0 && finalLocation[obj][time-1]==0 && finalLocation[obj][time]==1){\n\t\t\t bfCost[obj][time].bmigrationCost=totalCostCalculation.btotalMigrationCost[time][obj][finalLocation[obj][time-1]][finalLocation[obj][time]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\n\t}", "public void setSettlement(Settlement set);", "private void setupSettlementCost(){\n\t\tsettlementCost.put(ResourceKind.WOOL, 1);\n\t\tsettlementCost.put(ResourceKind.WOOD, 1);\n\t\tsettlementCost.put(ResourceKind.BRICK, 1);\n\t\tsettlementCost.put(ResourceKind.GRAIN, 1);\n\t}", "public boolean netzPlanBerechnung() throws SQLException {\n if(this.netz.getFreierPuffer() > -1) {\n // Abhängigkeiten setzen\n this.defineOrdersFirst(vorgangList);\n this.refInitSize = initVorgang.size(); \n \n for(int i=0; i< this.initVorgang.size(); ++i) {\n if(this.listIdCheck(initVorgang.get(i).getVorgangId())==false) { \n sortierteVorgaenge.add(initVorgang.get(i));\n }\n }\n \n for(int j=0; j<sortierteVorgaenge.size(); ++j) {\n sortierteVorgaenge.get(j).setNachf(con.ladeAlleNachf(sortierteVorgaenge.get(j).getVorgangId()));\n for(int k=0; k< sortierteVorgaenge.get(j).getNachf().size(); ++k) {\n if(this.listIdCheck(sortierteVorgaenge.get(j).getNachf().get(k).getVorgangId())==false) {\n sortierteVorgaenge.add(sortierteVorgaenge.get(j).getNachf().get(k));\n }\n }\n }\n \n for(int l=0; l<sortierteVorgaenge.size(); ++l) {\n if(l<this.refInitSize) {\n sortierteVorgaenge.get(l).setFez(sortierteVorgaenge.get(l).getDauer()); \n } \n if(l>=refInitSize) {\n vorgaengerCash = con.ladeAlleVorg(sortierteVorgaenge.get(l).getVorgangId()); \n for(int z=0; z<vorgaengerCash.size(); ++z) {\n for(int y=0; y<sortierteVorgaenge.size(); ++y) {\n if(vorgaengerCash.get(z).getVorgangId() == sortierteVorgaenge.get(y).getVorgangId()) {\n vorgaengerCash.get(z).setFez(sortierteVorgaenge.get(y).getFez());\n }\n }\n }\n this.minSt = vorgaengerCash.get(0).getFez();\n \n for(int p=0; p<vorgaengerCash.size(); ++p) {\n double minRef = vorgaengerCash.get(p).getFez();\n \n if(minRef < minSt) {\n minSt = minRef;\n }\n sortierteVorgaenge.get(l).setFaz(minSt);\n \n sortierteVorgaenge.get(l).setFez(sortierteVorgaenge.get(l).getFaz() + sortierteVorgaenge.get(l).getDauer());\n vorgaengerCash.clear();\n }\n }\n }\n System.out.println(\"===============================================================\");\n System.out.println(\"START DER BERECHNUNG DER SPAETESTEN ANFANGSZEITEN UND ENDZEITEN\");\n System.out.println(\"===============================================================\");\n this.sortierteVorgaengeRef = sortierteVorgaenge;\n this.defineOrdersLast(sortierteVorgaenge);\n this.refBackInitSize = backInit.size();\n for(int n=0; n<backInit.size(); ++n) {\n for(int o=0; o<sortierteVorgaenge.size(); ++o) {\n if(backInit.get(n).getVorgangId()==sortierteVorgaenge.get(o).getVorgangId()) {\n sortierteVorgaenge.get(o).setSez(netz.getEnde());\n sortierteVorgaenge.get(o).setSaz(netz.getEnde() - sortierteVorgaenge.get(o).getDauer());\n for(int x=0; x<sortierteVorgaengeRef.size(); ++x) {\n if(sortierteVorgaengeRef.get(x).getVorgangId()==backInit.get(n).getVorgangId()) {\n }\n }\n }\n }\n } \n \n for(int u=sortierteVorgaengeRef.size()-1; u>-1; --u) {\n vorgaengerCash = con.ladeAlleVorg(sortierteVorgaengeRef.get(u).getVorgangId());\n \n if(vorgaengerCash.size() != 0) {\n for(int y=0; y < vorgaengerCash.size(); ++y) {\n for(int c=0; c<sortierteVorgaenge.size(); ++c) {\n if(vorgaengerCash.get(y).getVorgangId()== sortierteVorgaenge.get(c).getVorgangId()) {\n for(int v=0; v<sortierteVorgaenge.size(); ++v) {\n if(sortierteVorgaengeRef.get(u).getVorgangId()== sortierteVorgaenge.get(v).getVorgangId()) {\n if(this.refSaz > sortierteVorgaenge.get(c).getSez() - sortierteVorgaenge.get(c).getDauer() || sortierteVorgaenge.get(c).getSaz()==0) {\n sortierteVorgaenge.get(c).setSez(sortierteVorgaenge.get(v).getSaz());\n sortierteVorgaenge.get(c).setSaz(sortierteVorgaenge.get(c).getSez() - sortierteVorgaenge.get(c).getDauer());\n this.refSaz = sortierteVorgaenge.get(c).getSez();\n }\n }\n } \n }\n }\n }\n }\n }\n vorgaengerCash.clear();\n }\n \n if(this.checkBetriebsmittelStatus(sortierteVorgaenge)==false) {\n this.netzDurabilityCheck = false;\n System.out.println(\"=================================================================================================\");\n System.out.println(\"Es ist nicht möglich den Netzplan mit den vorhandenen Betriebsmittelkapazitäten auszufuehren!!!\\n\");\n System.out.println(\"=================================================================================================\"); \n for(int n=0; n < bmgOutOfKapa.size(); ++n) {\n System.out.println(\"Dies liegt an dem Betriebsmittel mit der Id: \"+bmgOutOfKapa.get(n).getBetrMittelGrId());\n System.out.println(\"Betriebsmittelname: \"+bmgOutOfKapa.get(n).getNameBetrMittelGr());\n System.out.println(\"Der Vorgang, der die Kapazitaet der Betriebsmittelgruppe ueberschritten hat: \"+bmgOutOfKapa.get(n).getVorgangId());\n } \n } else {\n this.netzDurabilityCheck = true;\n System.out.println(\"=================================================================================================\");\n System.out.println(\"Die Betriebsmittelkapazitaeten reichen aus um den Netzplan auszufuehren!!!\\n\");\n System.out.println(\"=================================================================================================\");\n for(int d=0; d<sortierteVorgaenge.size(); ++d) {\n System.out.println(\"VorgangId: \"+sortierteVorgaenge.get(d).getVorgangId());\n System.out.println(\"VorgangsName: \"+sortierteVorgaenge.get(d).getName());\n System.out.println(\"VorgangsDauer: \"+sortierteVorgaenge.get(d).getDauer());\n System.out.println(\"VorgangsFaz: \"+sortierteVorgaenge.get(d).getFaz());\n System.out.println(\"VogangsFez:\" +sortierteVorgaenge.get(d).getFez());\n System.out.println(\"VorgangsSaz: \"+sortierteVorgaenge.get(d).getSaz());\n System.out.println(\"VorgangsSez: \"+sortierteVorgaenge.get(d).getSez()+\"\\n\\n\\n\");\n }\n } \n return this.netzDurabilityCheck;\n }", "public void kruskalMST()\n\t\t{\n\t\t\tPriorityQueue<Edge> pq = new PriorityQueue<>(allEdges.size(), Comparator.comparingInt(o -> o.roadCost));\n\n\t\t\tfor(int i = 0; i < allEdges.size(); i++)\n\t\t\t{\t\n\t\t\t\tpq.add(allEdges.get(i));\n\t\t\t}\t\t\t\n\n\t\t\tint [] parent = new int[edges];\n\t\t\tmakeSet(parent);\n\t\t\tArrayList<Edge> mst = new ArrayList<>();\n\t\t\tint index = 0, tempCost = 0;\n\n\t\t\t// Step 2: Pick the lowest cost edges to add to our result\n\t\t\twhile(index < edges - 1)\n\t\t\t{\n\t\t\t\tEdge edge = pq.remove();\n\t\t\t\tint x_set = find(parent, edge.source);\n\t\t\t\tint y_set = find(parent, edge.destination);\n\n\t\t\t\t// If creates a cycle, or a road with n wagons can't support the total weight ignore it\n\t\t\t\tif(x_set == y_set /* ||edge.weightCap * wagons < shipWeight */ ){\n\t\t\n\t\t\t\t}else{\n\t\t\t\t\t// These are valid edges for our MST\n\t\t\t\t\tmst.add(edge);\n\t\t\t\t\ttempCost += edge.roadCost;\n\t\t\t\t\tindex++;\n\t\t\t\t\tunion(parent, x_set, y_set);\n\t\t\t\t}\n\t\t\t\t// If there are no edges left, break out of the while loop\n\t\t\t\tif(pq.size() < 1)\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// ----------- Output working MSTs ----------- \n\t\t\t// printGraph(allEdges);\n\t\t\t// printCities(allCities);\n\n\t\t}", "boolean CanBuySettlement();", "final protected void prepareVertexBuffer() {\n vertexReference = new VectorQD[calculateVertexNumber()];\n vertexBuffer = new VectorQD[vertexReference.length];\n for (int i = 0; i < vertexBuffer.length; i++) {\n vertexBuffer[i] = new VectorQD();\n }\n }", "@Test\n @org.junit.Ignore\n public void shouldConstructDetachedVertex() {\n }", "public Path shortestPath(Vertex a, Vertex b) {\n // If a or b aren't present in the set of vertices throw an exception\n if (!myGraph.containsKey(b) || !myGraph.containsKey(a)) {\n throw new IllegalArgumentException(\"One of the vertices isn't valid\");\n }\n /* Create a map of Vertices to VertexInfos. Fill it with VertexInfos for all\n vertices that each have no previous vertex and and a cost of INFINITY */\n Map<Vertex, VertexInfo> vertInfos = new HashMap<Vertex, VertexInfo>();\n for (Vertex v : vertices()) {\n vertInfos.put(v, new VertexInfo(v, null, INFINITY));\n }\n /* Create a PriorityQueue for VertexInfos */\n PriorityQueue<VertexInfo> viQueue = new PriorityQueue<VertexInfo>();\n /* Create a VertexInfo for the start Vertex 'a' with a cost of 0. This uses a copy of Vertex a&b for immutability */\n Vertex copyA = new Vertex(a.getLabel());\n Vertex copyB = new Vertex(b.getLabel());\n\n VertexInfo vi_a = new VertexInfo(copyA, null, 0);\n /* Add VerxtexInfo for a to PQ and map it to it's VertexInfo */\n viQueue.add(vi_a);\n vertInfos.put(a, vi_a);\n while(!viQueue.isEmpty()) {\n /* Remove the VertexInfo with lowest cost */\n Vertex curr = viQueue.poll().getVertex();\n /* Check all adjacent Vertices of curr Vertex */\n for (Vertex v : adjacentVertices(curr)) {\n /* Calculate cost to get to v through curr */\n int cost = vertInfos.get(curr).getCost() + edgeCost(curr, v);\n /* If cost through curr is lower than previous */\n if (cost < vertInfos.get(v).getCost()) {\n /* Remove v's VertexInfo from PQ */\n viQueue.remove(vertInfos.get(v));\n /* Overwrite previous value of v in map\n Add updated VerexInfo to PQ */\n VertexInfo vi = new VertexInfo(v, curr, cost);\n vertInfos.put(v,vi);\n viQueue.add(vi);\n }\n }\n }\n /* Create ArrayList for path */\n List<Vertex> path = new ArrayList<Vertex>();\n \n /* Add each vertex and it's previous vertex to path until a null vertex is reached */\n for (Vertex vert = copyB; vert != null; vert = vertInfos.get(vert).getPrev()) {\n path.add(vert);\n }\n\n /* Reverse order of path */ \n Collections.reverse(path);\n /* Create new Path object with corresponding parameters */\n if(path.contains(copyA)){\n Path pathToB = new Path(path, vertInfos.get(copyB).getCost());\n return pathToB;\n } else {\n return null;\n }\n }", "@Test\n public void finiteUTurnCosts() {\n int right0 = graph.edge(0, 1).setDistance(10).set(speedEnc, 10, 10).getEdge();\n graph.edge(1, 2).setDistance(10).set(speedEnc, 10, 10);\n graph.edge(2, 3).setDistance(10).set(speedEnc, 10, 10);\n graph.edge(3, 4).setDistance(10).set(speedEnc, 10, 10);\n graph.edge(4, 5).setDistance(10).set(speedEnc, 10, 10);\n graph.edge(5, 2).setDistance(1000).set(speedEnc, 10, 10);\n int left6 = graph.edge(1, 6).setDistance(10).set(speedEnc, 10, 10).getEdge();\n int left0 = graph.edge(0, 7).setDistance(10).set(speedEnc, 10, 10).getEdge();\n graph.edge(7, 8).setDistance(10).set(speedEnc, 10, 10);\n graph.edge(8, 9).setDistance(10).set(speedEnc, 10, 10);\n int right6 = graph.edge(9, 6).setDistance(10).set(speedEnc, 10, 10).getEdge();\n\n // enforce p-turn (using the loop in clockwise direction)\n setRestriction(0, 1, 6);\n setRestriction(5, 4, 3);\n\n assertPath(calcPath(0, 6, right0, left6), 107.0, 1070, 107000, nodes(0, 1, 2, 3, 4, 5, 2, 1, 6));\n // if the u-turn cost is finite it depends on its value if we rather do the p-turn or do an immediate u-turn at node 2\n assertPath(calcPath(0, 6, right0, left6, createWeighting(5000)), 107.0, 1070, 107000, nodes(0, 1, 2, 3, 4, 5, 2, 1, 6));\n assertPath(calcPath(0, 6, right0, left6, createWeighting(40)), 44, 40, 44000, nodes(0, 1, 2, 1, 6));\n\n assertPath(calcPath(0, 6, left0, right6), 4, 40, 4000, nodes(0, 7, 8, 9, 6));\n assertPath(calcPath(0, 6, left0, left6), 111, 1110, 111000, nodes(0, 7, 8, 9, 6, 1, 2, 3, 4, 5, 2, 1, 6));\n // if the u-turn cost is finite we do a u-turn at node 1 (not at node 7 at the beginning!)\n assertPath(calcPath(0, 6, left0, left6, createWeighting(40)), 46.0, 60, 46000, nodes(0, 7, 8, 9, 6, 1, 6));\n }", "public static void main(String[] args) {\n\t\t\n\t\tString emailTo = \"[email protected]\";\n\t\tString body = \"\";\n\t\tString subject = \"Information for an apartment building!\";\n\t\t\n\t\t\n\t\t//first construct units, then construct a tenant with a unit\n\t\tArrayList<unit> thirtyFourthStreet = new ArrayList<unit>();\n\t\tArrayList<tenant> thirtyFourthStreetTenants = new ArrayList<tenant>();\n\t\t\n\t\tunit oneA = new unit(\"1 Bedroom\", 1400, \"1a\");\n\t\tunit oneB = new unit(\"2 Bedroom\", 2500, \"1b\");\n\t\tunit oneC = new unit(\"1 Bedroom\", 1600, \"1c\");\n\t\tunit oneD = new unit(\"3 Bedroom\", 3500, \"1d\");\n\t\t\n\t\tunit twoA = new unit(\"2 Bedroom\", 2200, \"2a\");\n\t\tunit twoB = new unit(\"2 Bedroom\", 2600, \"2b\");\n\t\tunit twoC = new unit(\"1 Bedroom\", 1500, \"2c\");\n\t\tunit twoD = new unit(\"2 Bedroom\", 1300, \"2d\");\n\t\t\n\t\tthirtyFourthStreet.add(oneA);\n\t\tthirtyFourthStreet.add(oneB);\n\t\tthirtyFourthStreet.add(oneC);\n\t\tthirtyFourthStreet.add(oneD);\n\t\t\n\t\tthirtyFourthStreet.add(twoA);\n\t\tthirtyFourthStreet.add(twoB);\n\t\tthirtyFourthStreet.add(twoC);\n\t\tthirtyFourthStreet.add(twoD);\n\t\t\n\t\ttenant josh = new tenant(\"Josh\", oneA, \"01/22/2017\", \"01/22/2018\");\n\t\ttenant bob = new tenant(\"Bob\", oneB, \"01/22/2017\", \"01/22/2018\");\n\t\ttenant tracy = new tenant(\"Tracy\", oneC, \"01/22/2017\", \"01/22/2018\");\n\t\ttenant sam = new tenant(\"Sam\", oneD, \"01/22/2017\", \"01/22/2018\");\n\t\t\n\t\ttenant samantha = new tenant(\"Samantha\", twoA, \"01/22/2017\", \"01/22/2018\");\n\t\ttenant bruce = new tenant(\"Bruce\", twoB, \"01/22/2017\", \"01/22/2018\");\n\t\ttenant rebecca = new tenant(\"Rebecca\", twoC, \"01/22/2017\", \"01/22/2018\");\n\t\ttenant steve = new tenant(\"Steve\", twoD, \"01/22/2017\", \"01/22/2018\");\n\t\t\n\t\tthirtyFourthStreetTenants.add(josh);\n\t\tthirtyFourthStreetTenants.add(bob);\n\t\tthirtyFourthStreetTenants.add(tracy);\n\t\tthirtyFourthStreetTenants.add(sam);\n\t\tthirtyFourthStreetTenants.add(samantha);\n\t\tthirtyFourthStreetTenants.add(bruce);\n\t\tthirtyFourthStreetTenants.add(rebecca);\n\t\tthirtyFourthStreetTenants.add(steve);\n\t\t/*\n\t\tSystem.out.println(\"Tracy, which apartment are you in?\");\n\t\tSystem.out.println(tracy.apartment.id);\n\t\tSystem.out.println(\"How big is your unit?\");\n\t\tSystem.out.println(tracy.apartment.size);\n\t\tSystem.out.println(\"What is your rent?\");\n\t\tSystem.out.println(tracy.apartment.rent);\n\t\t*/\n\t\t\n\t\tbody += \"Tracy, which apartment are you in?\\n\";\n\t\tbody += tracy.apartment.id + \"\\n\";\n\t\tbody += \"How big is your unit?\\n\";\n\t\tbody += tracy.apartment.size + \"\\n\";\n\t\tbody += \"What is your rent?\\n\";\n\t\tbody += tracy.apartment.rent + \"\\n\";\n\t\t\n\t\tbody += \"Name everyone in my building and what they're paying.\\n\";\n\t\tfor (tenant a : thirtyFourthStreetTenants){\n\t\tbody += a.name + \" \" + a.apartment.id + \" \" + a.apartment.rent + \"\\n\";\n\t\t}\n\t\t\n\t\tEmail newEmail = new Email(emailTo, body, subject);\n\t\tnewEmail.sendEmail();\n\t}", "List<Vertex> assignBumpOrdering(Tree t, Vertex root) throws FactorException {\n\t\t_bumpOnUpwardPass = false;\n\t\tif(DEBUG) System.out.println(\"\\n\\nassigning ordering!\\n\\n\");\n\t\tnextOrderID = UNMARKED; // begin again at 0\n\t\tList<Vertex> ordering = new ArrayList<Vertex>();\n//\t\tif(t._vertices.size() == 0) return ordering;\n//\t\t// mark all vertices unmarked\n//\t\tfor(Vertex v : t._vertices.values()) {\n//\t\t\tv.setUnmarked();\n//\t\t}\n//\t\tQueue<Vertex> toProcess = new LinkedList<Vertex>();\n//\t\ttoProcess.add(root);\n//\t\tif(DEBUG) System.out.println(\"root is \"+root.getVariableNames());\n//\t\t\n//\t\t// giving a number is equivalent to adding to ordering, giving index\n//\t\t// while all vertices don't have a number\n//\t\twhile(ordering.size() != t._vertices.size()) {\n//\t\t\tif(toProcess.size() == 0) {\n//\t\t\t\t// find an unmarked node... expensive\n//\t\t\t\tfor(Vertex v : t._vertices.values()) {\n//\t\t\t\t\tif(v._orderID == UNMARKED) {\n//\t\t\t\t\t\ttoProcess.add(v); // add to queue when find unmarked\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t}\n//\t\t\tVertex curr = toProcess.remove();\n//\t\t\tif(DEBUG) System.out.printf(\"curr VertexMax:%s\\n\",curr);\n//\t\t\t// mark\n//\t\t\tcurr.setOrderID();\n//\t\t\tordering.add(curr); // and add to our ordered list\n//\t\t\tif(curr._orderID != ordering.size()) {// verify\n//\t\t\t\tSystem.err.println(\"oops! order id incorrect\");\n//\t\t\t}\n//\t\t\t// and then for each downstream child...\n//\t\t\tfor(Edge e : curr._neighborEdges.keySet()) {\n//\t\t\t\tVertex k = e.getOtherVertex(curr);\n//\t\t\t\tif(DEBUG) System.out.println(\"check neighbor:\"+k);\n//\t\t\t\tif(k._orderID == UNMARKED) {\n//\t\t\t\t\tif(DEBUG) System.out.println(k+\" is unmarked - it's downstream\");\n//\t\t\t\t\t// downstream if we haven't marked it yet\n////\t\t\t\t\t// send belief update message to the child\n////\t\t\t\t\tcurr.sendMessage(e);\n//\t\t\t\t\t// and add the child to our list to process\n//\t\t\t\t\tif(DEBUG) System.out.printf(\"adding %s to be processed\\n\",root.getVariableNames());\n//\t\t\t\t\ttoProcess.add(k);\n//\t\t\t\t}\n//\t\t\t}\n//\t\t}\n//\t\treturn ordering;\n\t\tVertex v = findVertexInTree(t, 3,2);\n\t\tv.setOrderID();\n\t\tordering.add(v);\n\t\tv = findVertexInTree(t, 2,0);\n\t\tv.setOrderID();\n\t\tordering.add(v);\n\t\tv = findVertexInTree(t, 1,0);\n\t\tv.setOrderID();\n\t\tordering.add(v);\n\t\treturn ordering;\n//\t\t[[G, I], [I, J], [G, H]]\n\t}", "private void setupGraph() {\n graph = new DualGraph(SchemaFactoryUtilities.getSchemaFactory(VisualSchemaFactory.VISUAL_SCHEMA_ID).createSchema());\n try {\n\n WritableGraph wg = graph.getWritableGraph(\"\", true);\n\n // Create LayerMask attributes\n layerMaskV = LayersConcept.VertexAttribute.LAYER_MASK.ensure(wg);\n layerMaskT = LayersConcept.TransactionAttribute.LAYER_MASK.ensure(wg);\n\n // Create LayerVisilibity Attributes\n layerVisibilityV = LayersConcept.VertexAttribute.LAYER_VISIBILITY.ensure(wg);\n layerVisibilityT = LayersConcept.TransactionAttribute.LAYER_VISIBILITY.ensure(wg);\n\n // Create Selected Attributes\n selectedV = VisualConcept.VertexAttribute.SELECTED.ensure(wg);\n selectedT = VisualConcept.TransactionAttribute.SELECTED.ensure(wg);\n\n // Adding 2 Vertices - not selected, layer 1, visible\n vxId1 = wg.addVertex();\n wg.setIntValue(layerMaskV, vxId1, 1);\n wg.setFloatValue(layerVisibilityV, vxId1, 1.0f);\n wg.setBooleanValue(selectedV, vxId1, false);\n\n vxId2 = wg.addVertex();\n wg.setIntValue(layerMaskV, vxId2, 1);\n wg.setFloatValue(layerVisibilityV, vxId2, 1.0f);\n wg.setBooleanValue(selectedV, vxId2, false);\n\n // Adding 2 Transactions - not selected, layer 1, visible\n txId1 = wg.addTransaction(vxId1, vxId2, true);\n wg.setIntValue(layerMaskT, txId1, 1);\n wg.setFloatValue(layerVisibilityT, txId1, 1.0f);\n wg.setBooleanValue(selectedT, txId1, false);\n\n txId2 = wg.addTransaction(vxId1, vxId2, false);\n wg.setIntValue(layerMaskT, txId2, 1);\n wg.setFloatValue(layerVisibilityT, vxId2, 1.0f);\n wg.setBooleanValue(selectedT, vxId2, false);\n\n wg.commit();\n\n } catch (final InterruptedException ex) {\n Exceptions.printStackTrace(ex);\n Thread.currentThread().interrupt();\n }\n }", "@Test\r\n void add_20_remove_20_add_20() {\r\n //Add 20\r\n for(int i = 0; i < 20; i++) {\r\n graph.addVertex(\"\" +i);\r\n }\r\n vertices = graph.getAllVertices();\r\n //Check all 20 are in graph\r\n for(int i = 0; i < 20; i++) {\r\n if(!vertices.contains(\"\" + i)) {\r\n fail();\r\n }\r\n }\r\n //Remove 20 \r\n for(int i = 0; i < 20; i++) {\r\n graph.removeVertex(\"\" +i);\r\n }\r\n //Check all 20 are not in graph anymore \r\n \r\n for(int i = 0; i < 20; i++) {\r\n if(vertices.contains(\"\" + i)) {\r\n fail();\r\n }\r\n }\r\n //Add 20 again\r\n for(int i = 0; i < 20; i++) {\r\n graph.addVertex(\"\" +i);\r\n }\r\n //Check all 20 are in graph\r\n for(int i = 0; i < 20; i++) {\r\n if(!vertices.contains(\"\" + i)) {\r\n fail();\r\n }\r\n }\r\n }", "private void rebuildPolygon() {\n //recalculate new center\n float borderNeeded = mPolygonShapeSpec.hasBorder() ? mPolygonShapeSpec.getBorderWidth() : 0;\n float shadowNeeded = mPolygonShapeSpec.hasShadow() ? mPolygonShapeSpec.getShadowRadius() : 0;\n mPolygonShapeSpec.setCenterX(mPolygonShapeSpec.getDiameter() / 2 + (float) (getPaddingLeft() +\n getPaddingRight()) / 2 + borderNeeded + shadowNeeded);\n mPolygonShapeSpec.setCenterY(mPolygonShapeSpec.getDiameter() / 2 + (float) (getPaddingTop() +\n getPaddingBottom()) / 2 + borderNeeded + shadowNeeded);\n\n if (mPolygonShapeSpec.getNumVertex() < 3)\n return;\n\n mPath = mPolygonShape.getPolygonPath(mPolygonShapeSpec);\n }", "private void calculate() {\n\t\tList<Edge> path = new ArrayList<>();\n\t\tPriorityQueue<Vert> qv = new PriorityQueue<>();\n\t\tverts[s].dist = 0;\n\t\tqv.add(verts[s]);\n\t\twhile (!qv.isEmpty()) {\n\t\t\tVert v = qv.poll();\n\t\t\tint vidx = v.idx;\n\t\t\tfor (Edge e : v.edges) {\n\t\t\t\tif (e.w==0) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tVert vo = verts[e.other(vidx)];\n\t\t\t\tif (vo.dist > v.dist + e.w) {\n\t\t\t\t\tvo.dist = v.dist + e.w;\n\t\t\t\t\tqv.add(vo);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (verts[t].dist < L) {\n\t\t\tok = false;\n\t\t\treturn;\n\t\t} else if (verts[t].dist == L) {\n\t\t\tok = true;\n\t\t\tfor (int i=0; i<m; i++) {\n\t\t\t\tif (edges[i].w == 0) {\n\t\t\t\t\tedges[i].w = MAX_DIST;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t// replace 0 with 1, adding to za list\n\t\tfor (int i=0; i<m; i++) {\n\t\t\tif (edges[i].w == 0) {\n\t\t\t\tza[i] = true;\n\t\t\t\tedges[i].w = 1;\n\t\t\t} else {\n\t\t\t\tza[i] = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// looking for shortest path from s to t with 0\n\t\tfor (int i=0; i<n; i++) {\n\t\t\tif (i != s) {\n\t\t\t\tverts[i].dist = MAX_DIST;\n\t\t\t}\n\t\t}\n\t\tqv.clear();\n\t\tqv.add(verts[s]);\n\t\twhile (!qv.isEmpty()) {\n\t\t\tVert v = qv.poll();\n\t\t\tint vidx = v.idx;\n\t\t\tfor (Edge e : v.edges) {\n\t\t\t\tVert vo = verts[e.other(vidx)];\n\t\t\t\tif (vo.dist > v.dist + e.w) {\n\t\t\t\t\tvo.dist = v.dist + e.w;\n\t\t\t\t\tqv.add(vo);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (verts[t].dist > L) {\n\t\t\tok = false;\n\t\t\treturn;\n\t\t}\n\t\tVert v = verts[t];\n\t\twhile (v.dist > 0) {\n\t\t\tlong minDist = MAX_DIST;\n\t\t\tVert vMin = null;\n\t\t\tEdge eMin = null;\n\t\t\tfor (Edge e : v.edges) {\n\t\t\t\tVert vo = verts[e.other(v.idx)];\n\t\t\t\tif (vo.dist+e.w < minDist) {\n\t\t\t\t\tvMin = vo;\n\t\t\t\t\teMin = e;\n\t\t\t\t\tminDist = vMin.dist+e.w;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\tv = vMin;\t\n\t\t\tpath.add(eMin);\n\t\t}\n\t\tCollections.reverse(path);\n\t\tfor (int i=0; i<m; i++) {\n\t\t\tif (za[i]) {\n\t\t\t\tedges[i].w = MAX_DIST;\n\t\t\t}\n\t\t}\n\t\tlong totLen=0;\n\t\tboolean wFixed = false;\n\t\tfor (Edge e : path) {\n\t\t\ttotLen += (za[e.idx] ? 1 : e.w);\n\t\t}\n\t\tfor (Edge e : path) {\n\t\t\tif (za[e.idx]) {\n\t\t\t\tif (!wFixed) {\n\t\t\t\t\te.w = L - totLen + 1;\n\t\t\t\t\twFixed = true;\n\t\t\t\t} else {\n\t\t\t\t\te.w = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tok = true;\n\t}", "public void addVertexManagerToPR(ApprovalRequest ar, Approvable lic) {\r\n\t\tLog.customer.debug(\"%s ::: addVertexManagerToPR - %s\", className, lic);\r\n\t\tProcureLineItemCollection plic = (ProcureLineItemCollection) lic;\r\n\r\n\t\tString TaxRole = \"VertexManager\";\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(\r\n\t\t\t\t\"%s ::: isTaxManagerRequired - 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 addIsVertexOf(Subdomain_group newIsVertexOf);", "public List<Vertex> newPath() {\r\n\t\tList<Vertex> Pathchange = new ArrayList<Vertex>();\r\n\t\tList<Vertex> tempPath = new ArrayList<Vertex>();\r\n\t\tint BestEval = Integer.MAX_VALUE;\r\n\t\tVertex changeVertexV1 = new Vertex();\r\n\t\tVertex changeVertexV2 = new Vertex();\r\n\r\n\t\tfor (int position = 0; position < this.LastPath.size() - 1; position++) {\r\n\t\t\tfor (int changement = position+1; changement < this.LastPath.size(); changement++) {\r\n\r\n\t\t\t\ttempPath.clear();\r\n\t\t\t\ttempPath = new ArrayList<Vertex>(this.LastPath);\r\n\t\t\t\tif (!(this.TabuListV1.contains(tempPath.get(position)) || this.TabuListV1.contains(tempPath.get(changement)) || this.TabuListV2.contains(tempPath.get(position)) || this.TabuListV2.contains(tempPath.get(changement)))) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tCollections.swap(tempPath, position, changement);\r\n\t\t\t\t\tif (this.fit(tempPath) < BestEval) {\r\n\t\t\t\t\t\tPathchange.clear();\r\n\t\t\t\t\t\tPathchange = new ArrayList<Vertex>(tempPath);\r\n\t\t\t\t\t\tchangeVertexV1 = tempPath.get(position);\r\n\t\t\t\t\t\tchangeVertexV2 = tempPath.get(changement);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(this.tabuElementType == 0) {\r\n\t\t\tthis.TabuListV1.add(0, changeVertexV1);\r\n\t\t}else if(this.tabuElementType == 1) {\r\n\t\t\tthis.TabuListV2.add(0, changeVertexV2);\r\n\t\t}else {\r\n\t\t\tthis.TabuListV1.add(0, changeVertexV1);\r\n\t\t\tthis.TabuListV2.add(0, changeVertexV2);\r\n\t\t}\r\n\t\t\r\n\t\tif (this.TabuListV1.size() > this.TabuListSize) {\r\n\t\t\tthis.TabuListV1.remove(this.TabuListV1.size() - 1);\r\n\t\t}\r\n\t\tif (this.TabuListV2.size() > this.TabuListSize) {\r\n\t\t\tthis.TabuListV2.remove(this.TabuListV2.size() - 1);\r\n\t\t}\r\n\r\n\t\treturn Pathchange;\r\n\t}", "public void bft() {\r\n\t\tHashMap<String, Boolean> processed = new HashMap<>();\r\n\t\tLinkedList<Pair> queue = new LinkedList<>();\r\n\r\n\t\tArrayList<String> vnames = new ArrayList<>(vces.keySet());\r\n\t\tfor (String vname : vnames) {\r\n\t\t\tif (processed.containsKey(vname)) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tPair rootpair = new Pair(vname, vname);\r\n\t\t\tqueue.addLast(rootpair);\r\n\t\t\twhile (queue.size() != 0) {\r\n\t\t\t\t// 1. removeFirst\r\n\t\t\t\tPair rp = queue.removeFirst();\r\n\r\n\t\t\t\t// 2. check if processed, mark if not\r\n\t\t\t\tif (processed.containsKey(rp.vname)) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tprocessed.put(rp.vname, true);\r\n\r\n\t\t\t\t// 3. Check, if an edge is found\r\n\t\t\t\tSystem.out.println(rp.vname + \" via \" + rp.psf);\r\n\r\n\t\t\t\t// 4. Add the unprocessed nbrs back\r\n\t\t\t\tArrayList<String> nbrnames = new ArrayList<>(rp.vtx.nbrs.keySet());\r\n\t\t\t\tfor (String nbrname : nbrnames) {\r\n\t\t\t\t\tif (!processed.containsKey(nbrname)) {\r\n\t\t\t\t\t\tPair np = new Pair(nbrname, rp.psf + nbrname);\r\n\t\t\t\t\t\tqueue.addLast(np);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void addFrindge(int v, int w) {\n\t\tgetEdge(v, w).setSelected(true);\n\t\tdouble cost = newCost(v, w);\n\t\tGreedyVertex vertex = getVertex(w);\n\t\tvertex.setFringe(true);\n\t\tvertex.setParent(v);\n\t\tvertex.setCost(cost);\n\t\tp.add(vertex);\n\t}", "private void buildGraph(Target target) {\n Graph g = new Graph();\n\n //add the nodes to the graph\n for (int i = 0; i < vertices.size() ; i++) {\n if (vertices.get(i).getNeigbours().size() != 0) {\n Node d = new Node(\"\" + i);\n d.set_id(i);\n g.add(d);\n }\n }\n\n Node a = new Node(\"\" + (vertices.size() -1));\n a.set_id((vertices.size() -1));\n g.add(a);\n\n //add the edges\n for (int i = 0; i < vertices.size(); i++) {\n GraphNode curr = vertices.get(i);\n if (curr.getNeigbours().size() != 0 ) {\n for (GraphNode neighbour : curr.getNeigbours()) {\n g.addEdge(\"\" + i, \"\" + neighbour.getID(), curr.getPoint().distance2D(neighbour.getPoint()));\n }\n }\n }\n\n // find the minimums path to the fruit\n Graph_Algo.dijkstra(g, \"\"+ 0);\n Node b = g.getNodeByName(\"\" + (vertices.size()-1));\n ArrayList<String> shortestPath = b.getPath();\n target.setDistance(b.getDist());\n\n for (int i = 0 ;i < shortestPath.size() ; i++){\n String s = b.getPath().get(i);\n target.getPath().add(s);\n }\n\n targts.add(target);\n g.clear_meta_data();\n GraphNode.resetCounterId();\n Target.resetCounterId();\n\n if (target.getFruit().getID() != game.getFruits().get(game.getFruits().size()-1).getID()) {\n vertices.clear();\n }\n }", "public void setVertexB(E3DTexturedVertex vertex){\r\n\t\tthis.vertices[1] = vertex;\r\n\t\tneedNormalRecalc = true;\r\n\t\tneedPlaneEquationRecalc = true;\r\n\t}", "private boolean buildStreetIsAllowed(Road road) {\r\n\t\tif (!client.isBeginning()\r\n\t\t\t\t&& road.isBuildable(island, client.getSettler().getID())\r\n\t\t\t\t&& road.getOwner() == Constants.NOBODY) {\r\n\t\t\treturn true;\r\n\t\t} else if (((client.isBeginning() && road.getEnd() == getLastSettlementNode()) || (client\r\n\t\t\t\t.isBeginning() && road.getStart() == getLastSettlementNode()))\r\n\t\t\t\t&& road.getOwner() == Constants.NOBODY) {\r\n\t\t\treturn true;\r\n\t\t} else\r\n\t\t\treturn false;\r\n\t}", "public void makeVertexUp( String sourceName)\n {\n Vertex v = vertexMap.get( sourceName );\n if(v!=null)\n \tv.isDown =false;\n else\n \tSystem.out.println(\"Invalid vertex\");\n \n \n // v.weightnext.put(w.name,(Double) distance);\n }", "public static <V> Graph<V> getMinimumSpanningTreePrim(Graph<V> graph) {\n V[] array = graph.getValuesAsArray();\n double[][] matriz = graph.getGraphStructureAsMatrix();\n\n double[][] matrizCopia = new double[array.length][array.length]; //Se hace una copia del array. Sino, se modificaria en el grafo original.\n for (int x = 0; x < array.length; x++) {\n for (int y = 0; y < array.length; y++) {\n matrizCopia[x][y] = matriz[x][y];\n }\n }\n\n boolean[] revisados = new boolean[array.length]; // Arreglo de booleanos que marca los valores por donde ya se paso.\n Set<V> conjuntoRevisados = new LinkedListSet<>(); //Conjunto donde se guardan los vertices por donde ya se paso\n Graph<V> nuevo = new AdjacencyMatrix<>(graph.isDirected(), true);\n\n if (array.length > 0) { // Grafo no vacio\n\n revisados[0] = true;\n conjuntoRevisados.put(array[0]);\n nuevo.addNode(array[0]);\n\n double menorArista = 50000;\n V verticeOrigen = null;\n V verticeDestino = null;\n\n while (conjuntoRevisados.size() != array.length) { // mientras hayan vertices sin revisar\n\n Iterator<V> it1 = conjuntoRevisados.iterator(); //Se recorren todos los vertices guardados\n while (it1.hasNext()) {\n\n V aux = it1.next();\n int posArray = buscarPosicion(aux, array);\n for (int x = 0; x < array.length; x++) {\n\n if (matrizCopia[posArray][x] != -1) { //Si existe arista\n //Si los 2 vertices no estan en el arbol, para evitar un ciclo\n if (!(conjuntoRevisados.isMember(aux) && conjuntoRevisados.isMember(array[x]))) {\n if (matrizCopia[posArray][x] < menorArista) {\n menorArista = matrizCopia[posArray][x];\n if (!graph.isDirected()) {\n matrizCopia[x][posArray] = -1;\n }\n verticeOrigen = aux;\n verticeDestino = array[x];\n }\n }\n }\n }\n }\n\n if (verticeOrigen != null) {\n if (!nuevo.contains(verticeDestino)) {\n nuevo.addNode(verticeDestino);\n if (!conjuntoRevisados.isMember(verticeDestino)) {\n conjuntoRevisados.put(verticeDestino);\n }\n revisados[buscarPosicion(verticeDestino, array)] = true;\n }\n nuevo.addEdge(verticeOrigen, verticeDestino, menorArista);\n\n verticeOrigen = null;\n menorArista = 50000;\n } else {\n for (int x = 0; x < array.length; x++) {\n if (revisados[x] == false) {\n conjuntoRevisados.put(array[x]);\n nuevo.addNode(array[x]);\n }\n }\n }\n }\n }\n return nuevo;\n }", "private TakTree<TakPiece> treeBuilder(TakTree<TakPiece> tree, Point startingPoint, ArrayList<Point> visited){\n if(containsWinningPath(visited)){\n // Did white or black win?\n if(getTop(startingPoint).isWhite()){\n whiteWins = true;\n } else {\n blackWins = true;\n }\n\n // return our tree because this is certainly a leaf node\n return tree;\n }\n\n Point right = new Point(startingPoint.x + 1, startingPoint.y);\n Point left = new Point(startingPoint.x - 1, startingPoint.y);\n Point up = new Point(startingPoint.x, startingPoint.y - 1);\n Point down = new Point(startingPoint.x, startingPoint.y + 1);\n\n\n // Check for backtracking right\n if(isValidAndSimilar(right, startingPoint) && !visitedContains(visited, right)){\n // Create new subtree with our right as root\n TakTree<TakPiece> treeToAttach = new TakTree<>();\n treeToAttach.addRoot(getTop(right));\n //Add this position to the visited array\n visited.add(right);\n // Attach subtree to right position\n tree.attachRight(treeBuilder(treeToAttach, right, visited));\n }\n\n // Try to build left subtree\n if(isValidAndSimilar(left, startingPoint) && !visitedContains(visited, left)){\n // Create new subtree with our right as root\n TakTree<TakPiece> treeToAttach = new TakTree<>();\n treeToAttach.addRoot(getTop(left));\n //Add this position to the visited array\n visited.add(left);\n // Attach subtree to right position\n tree.attachLeft(treeBuilder(treeToAttach, left, visited));\n }\n\n // Try to build up subtree\n if(isValidAndSimilar(up, startingPoint) && !visitedContains(visited, up)){\n // Create new subtree with our right as root\n TakTree<TakPiece> treeToAttach = new TakTree<>();\n treeToAttach.addRoot(getTop(up));\n //Add this position to the visited array\n visited.add(up);\n // Attach subtree to right position\n tree.attachUp(treeBuilder(treeToAttach, up, visited));\n }\n\n // Try to build down subtree\n if(isValidAndSimilar(down, startingPoint) && !visitedContains(visited, down)){\n\n // Create new subtree with our right as root\n TakTree<TakPiece> treeToAttach = new TakTree<>();\n treeToAttach.addRoot(getTop(down));\n //Add this position to the visited array\n visited.add(down);\n // Attach subtree to right position\n tree.attachDown(treeBuilder(treeToAttach, down, visited));\n }\n\n return tree;\n }", "public void calcSP(Graph g, Vertex source){\n // Algorithm:\n // 1. Take the unvisited node with minimum weight.\n // 2. Visit all its neighbours.\n // 3. Update the distances for all the neighbours (In the Priority Queue).\n // Repeat the process till all the connected nodes are visited.\n\n // clear existing info\n// System.out.println(\"Calc SP from vertex:\" + source.name);\n g.resetMinDistance();\n source.minDistance = 0;\n PriorityQueue<Vertex> queue = new PriorityQueue<Vertex>();\n queue.add(source);\n\n while(!queue.isEmpty()){\n Vertex u = queue.poll();\n for(Edge neighbour:u.neighbours){\n// System.out.println(\"Scanning vector: \"+neighbour.target.name);\n Double newDist = u.minDistance+neighbour.weight;\n\n // get new shortest path, empty existing path info\n if(neighbour.target.minDistance>newDist){\n // Remove the node from the queue to update the distance value.\n queue.remove(neighbour.target);\n neighbour.target.minDistance = newDist;\n\n // Take the path visited till now and add the new node.s\n neighbour.target.path = new ArrayList<>(u.path);\n neighbour.target.path.add(u);\n// System.out.println(\"Path\");\n// for (Vertex vv: neighbour.target.path) {\n// System.out.print(vv.name);\n// }\n// System.out.print(\"\\n\");\n\n// System.out.println(\"Paths\");\n neighbour.target.pathCnt = 0;\n neighbour.target.paths = new ArrayList<ArrayList<Vertex>>();\n if (u.paths.size() == 0) {\n ArrayList<Vertex> p = new ArrayList<Vertex>();\n p.add(u);\n neighbour.target.paths.add(p);\n neighbour.target.pathCnt++;\n } else {\n for (ArrayList<Vertex> p : u.paths) {\n ArrayList<Vertex> p1 = new ArrayList<>(p);\n p1.add(u);\n// for (Vertex vv : p1) {\n// System.out.print(vv.name);\n// }\n// System.out.print(\"\\n\");\n neighbour.target.paths.add(p1);\n neighbour.target.pathCnt++;\n }\n }\n\n //Reenter the node with new distance.\n queue.add(neighbour.target);\n }\n // get equal cost path, add into path list\n else if (neighbour.target.minDistance == newDist) {\n queue.remove(neighbour.target);\n for(ArrayList<Vertex> p: u.paths) {\n ArrayList<Vertex> p1 = new ArrayList<>(p);\n p1.add(u);\n neighbour.target.paths.add(p1);\n neighbour.target.pathCnt++;\n }\n queue.add(neighbour.target);\n }\n }\n }\n }", "public void addVertex (T vertex){\n if (vertexIndex(vertex) > 0) return; // vertex already in graph, return.\n if (n == vertices.length){ // need to expand capacity of arrays\n expandCapacity();\n }\n \n vertices[n] = vertex;\n for (int i = 0; i < n; i++){ // populating new edges with -1\n edges[n][i] = -1;\n edges[i][n] = -1;\n }\n n++;\n }", "private void build(int v, int from, int size) {\n\t\tNode node = new Node();\n\t\theap[v] = node;\n\t\tnode.from = from;\n\t\tnode.to = from + size - 1;\n\t\tif (size == 1) {\n\t\t\tnode.sum = array[from];\n\t\t\tnode.min = array[from];\n\t\t} else {\n\t\t\tint len = size / 2;\n\t\t\tbuild(2 * v, from, len);\n\t\t\tbuild(2 * v + 1, from + len, size - len);\n\t\t\tnode.sum = heap[2 * v].sum + heap[2 * v + 1].sum;\n\t\t\tnode.min = Math.min(heap[2 * v].min, heap[2 * v + 1].min);\n\t\t}\n\t}", "public void setFree(Boolean free)\n\t{\n\t\tthis.free = free;\n\t}", "void contractEdges(DynamicGraph G, Integer u, Integer v ){\n G.removeEdges(u, v);\n // for all vertices w adj to v\n for (Integer w: G.adjacent(v)){\n // addEdge(u, w);\n G.addEdge(u, w);\n }\n // removeVertex(v); decrement V.\n G.removeVertex(v);\n /*System.out.println(\"After contracting edge u: \"+ u +\" v: \"+ v);\n System.out.println(G);*/\n }", "private void buildNewTree(PlanNode plan) {\n ILogicalOperator leftInput = plan.getLeafInput();\n skipAllIndexes(plan, leftInput);\n ILogicalOperator selOp = findSelectOrDataScan(leftInput);\n if (selOp != null) {\n addCardCostAnnotations(selOp, plan);\n }\n addCardCostAnnotations(findDataSourceScanOperator(leftInput), plan);\n }", "boolean hasPathTo(int v)\n\t{\n\t\treturn edgeTo[v].weight()!=Double.POSITIVE_INFINITY;\n\t}", "private static void spreadVirus(int v){\n Queue<Integer> queue = new LinkedList<>();\n queue.add(v);\n while(!queue.isEmpty()){\n int temp = queue.poll();\n isVisited[temp]=true;\n for(int i = 1; i<adj[temp].length;i++){\n if(isVisited[i]==false && adj[temp][i]==1){\n queue.add(i);\n isVisited[i]=true;\n maxContamination++;\n }\n }\n }\n }", "private static void addTripToGraph(Trip newTrip, Graph<Node, WeightEdge> graph, List<Node> depots, List<Node> trips, Problem problem){\n Node tripStart = new Node(newTrip, 0, false);\n Node tripEnd = new Node(newTrip, 0, true);\n\n graph.addVertex(tripStart);\n graph.addVertex(tripEnd);\n\n // Add weightEdgeWithBounders from trip startPoint to trip endPoint\n // lowerBound and upperBound for this edges is 1, because we are looking for solution that saturates all trips\n WeightEdge tripInternalWeightEdge = new BoundedWeightEdge(1,1);\n graph.addEdge(tripStart, tripEnd, tripInternalWeightEdge);\n graph.setEdgeWeight(tripInternalWeightEdge, 0);\n\n for(Node depot : depots){\n if(depot.isExitNode()){ // is source\n // add weightEdgeWithBounders from depot source to trip startPoint\n WeightEdge depotToTripWeightEdge = new BoundedWeightEdge(0, 1);\n graph.addEdge(depot, tripStart, depotToTripWeightEdge);\n graph.setEdgeWeight(depotToTripWeightEdge, problem.getCost(depot.getLocation(), tripStart.getLocation()).toMinutes());\n }else{ // is depot sink\n // add weightEdgeWithBounders from trip endPoint to depot sink\n WeightEdge tripToDepotWeightEdge = new BoundedWeightEdge(0, 1);\n graph.addEdge(tripEnd, depot, tripToDepotWeightEdge);\n graph.setEdgeWeight(tripToDepotWeightEdge, problem.getCost(tripEnd.getLocation(), depot.getLocation()).toMinutes());\n }\n }\n\n for(Node otherTrip : trips){\n if(otherTrip.isExitNode()){\n // add feasible edges from all trips endPoints to this trip startPoint\n if(isFeasibleEdge(otherTrip, tripStart, problem)){\n WeightEdge otherTripToThisTrip = new BoundedWeightEdge(0, 1);\n graph.addEdge(otherTrip, tripStart, otherTripToThisTrip);\n graph.setEdgeWeight(otherTripToThisTrip, problem.getCost(otherTrip.getLocation(), tripStart.getLocation()).toMinutes());\n }\n }else{\n // add feasible edges from this trip endPoint to all trips startPoints\n if(isFeasibleEdge(tripEnd, otherTrip, problem)){\n WeightEdge thisTripToOtherTrip = new BoundedWeightEdge(0, 1);\n graph.addEdge(tripEnd, otherTrip, thisTripToOtherTrip);\n graph.setEdgeWeight(thisTripToOtherTrip, problem.getCost(tripEnd.getLocation(), otherTrip.getLocation()).toMinutes());\n }\n }\n }\n\n // add this nodes in our trips list;\n trips.add(tripStart);\n trips.add(tripEnd);\n }", "public static String BFS(Graph grafo, Vertice vertice) {\r\n\t\tArrayList<Integer> busca = new ArrayList<Integer>(); // vertice nivel pai em ordem de descoberta\r\n\t\tArrayList<Vertice> aux1 = new ArrayList<Vertice>(); // fila de nos pais a serem visitados\r\n\t\tArrayList<Vertice> aux2 = new ArrayList<Vertice>(); // fila de nos filhos a serem visitdados\r\n\r\n\t\tint nivel = 0;\r\n\r\n\t\taux1.add(vertice);// adiciona a raiz a aux1 para inicio da iteracao\r\n\t\tvertice.setPai(0);// seta o pai da raiz para zero\r\n\r\n\t\twhile (aux1.size() > 0) {\r\n\t\t\tfor (int i = 0; i < aux1.size(); i++) {\r\n\t\t\t\tif (aux1.get(i).statusVertice() == false) {// verifrifica se o no ja nao foi atingido por outra ramificacao.\r\n\t\t\t\t\tbusca.add(aux1.get(i).getValor());\r\n\t\t\t\t\tbusca.add(nivel);\r\n\t\t\t\t\tbusca.add(aux1.get(i).getPai());\r\n\t\t\t\t\tvertice.alteraStatusVertice(true);\r\n\r\n\t\t\t\t\tfor (int j = 0; i < vertice.getArestas().size(); j++) {\r\n\t\t\t\t\t\tproxVertice(vertice, vertice.getArestas().get(j)).setPai(aux1.get(i).getValor());// associa o no pai\r\n\t\t\t\t\t\taux2.add(proxVertice(vertice, vertice.getArestas().get(j)));// adiciona lista dos proximos nos filhos serem percorridos\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\taux1 = aux2; // todos os nos pai ja foram percoridos, filhos se tornam a lista de nos pai\r\n\t\t\t\t\taux2.clear(); // lista de nos filhos e esvaziada para o proximo ciclo de iteracoes\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tnivel++;\r\n\t\t}\r\n\r\n\t\tresetStatusVertex(grafo);\r\n\r\n\t\treturn criaStringDeSaida(grafo, busca);// formata o resutltado da busca para a string esperada\r\n\t}", "DFS(int ver){\n // assign the nu,mber of vertex\n v = ver;\n // assign the number of boolean at it's vertex\n visited = new boolean[ver];\n // assisgn the array with the vertex length\n pre = new int[ver];\n // asssigning the adjList length\n adjList = new ArrayList[ver];\n\n // now going throgh the loop and adding the newList to adjList each index , in pre making all -1, and false in all visited\n for (int x=0; x<ver; x+=1){\n adjList[x] = new ArrayList();\n\n // for the visited boolean value false\n visited[x] = false;\n\n // pre \n pre[x]=-1;\n }\n }", "WithCreate withFreeSku();", "public void expandBlossom(Vertex vertex3) {\n\t\tthrow new RuntimeException(\"Unimplemented\");\r\n\t}", "private void breadthHelper(Graph<VLabel, ELabel>.Vertex v) {\n LinkedList<Graph<VLabel, ELabel>.Vertex> fringe =\n new LinkedList<Graph<VLabel, ELabel>.Vertex>();\n fringe.add(v);\n while (fringe.size() > 0) {\n Graph<VLabel, ELabel>.Vertex curV = fringe.poll();\n try {\n if (!_marked.contains(curV)) {\n _marked.add(curV);\n try {\n visit(curV);\n } catch (RejectException rExc) {\n fringe.add(curV);\n continue;\n }\n for (Graph<VLabel, ELabel>.Edge e: _graph.outEdges(curV)) {\n Graph<VLabel, ELabel>.Vertex child = e.getV(curV);\n if (!_marked.contains(child)) {\n try {\n preVisit(e, curV);\n fringe.add(child);\n } catch (RejectException rExc) {\n int unused = 0;\n }\n }\n }\n fringe.add(curV);\n } else {\n postVisit(curV);\n while (fringe.remove(curV)) {\n continue;\n }\n }\n } catch (StopException sExc) {\n _finalVertex = curV;\n return;\n }\n }\n }", "private void supplementMST(){\n\t\tList<Village> noOutRoads = getNoOutRoadVillages();\n\t\tList<Village> noInRoads = getNoInRoadVillages();\n\t\t\n\t\tfor(Village v: noOutRoads){\n\t\t\tVillage closestVillage = findClosestVillageTo(v,noInRoads);\n\t\t\tnoInRoads.remove(closestVillage);\n\t\t\tnew Road(v,closestVillage);\n\t\t}\n\t\t\n\t\tfor(Village v: noInRoads){\n\t\t\tnew Road(findClosestVillageTo(v,villages),v);\n\t\t}\n\t}", "@Test\n void test01_addVertex() {\n graph.addVertex(\"a\");\n graph.addVertex(\"b\"); // adds two vertices\n\n Set<String> vertices = new LinkedHashSet<>();\n vertices.add(\"a\");\n vertices.add(\"b\"); // creates a check list to compare with\n\n if (!graph.getAllVertices().equals(vertices)) {\n fail(\"Graph didn't add the vertices correctly\");\n }\n }", "public void placeSettlement(boolean maximal) {\n List<Tile> tiles;\n if (maximal) {\n tiles = getGame().getMap()\n .getClaimableTiles(owner, tile, getRadius());\n } else {\n tiles = new ArrayList<Tile>();\n tiles.add(tile);\n }\n \n tile.setSettlement(this);\n for (Tile t : tiles) {\n t.changeOwnership(owner, this);\n }\n for (Tile t : tile.getSurroundingTiles(getLineOfSight())) {\n owner.setExplored(t);\n }\n owner.invalidateCanSeeTiles();\n }", "TEdge createTEdge();", "public boolean isStartingVertexCity() {\r\n\t\t\treturn (getDegrees() == ZERO_DEGREE);\r\n\t\t}", "@Test\n public void tr0()\n {\n Graph g = new Graph(1);\n Set<Integer> nodes = new TreeSet<Integer>();\n nodes.add(0);\n assertTrue(g.reachable(nodes, nodes));\n }", "public boolean addVertex(V vertex);", "public boolean addVertex(V vertex);", "public void buildInCell() {\n this.level++;\n if (this.level == 4) {\n this.setFreeSpace(false);\n }\n }", "public Builder clearPakringFree() {\n bitField0_ = (bitField0_ & ~0x00000004);\n pakringFree_ = lanyotech.cn.park.protoc.CommonProtoc.PARKINGFREE.ALL;\n onChanged();\n return this;\n }", "ShipmentCostEstimate createShipmentCostEstimate();", "private void makeWithdraw() {\n\t\t\r\n\t}", "public boolean isSetVertexDestiny() {\n return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __VERTEXDESTINY_ISSET_ID);\n }", "protected void createBody(int x, int y, Vector v){\n \tint a[] = {x - 1 , x + 1 , x , x};\n \tint b[] = {y , y , y - 1 , y + 1};\n\n int curState = getPoint(x, y).getState();\n\t\tif (v != null) v.addElement(new Point(x, y));\n\n\t\tgetPoint(x, y).setSigned(true);\n\n \tfor (int i = 0 ; i < 4 ; i++){\n if (!validatePoint(a[i], b[i]))\n continue;\n else {\n\t \t\t\tint xx = a[i];\n\t \t\tint yy = b[i];\n\t \t\tif (getPoint(xx, yy).isSigned()) continue;\n \t\t\tif (getPoint(xx, yy).getState() == curState){\n \t\t\tcreateBody(xx, yy, v);\n \t\t}\n \t\t}\n\t\t} // end for\n\t}", "public Builder clearPakringFree() {\n bitField0_ = (bitField0_ & ~0x00000008);\n pakringFree_ = lanyotech.cn.park.protoc.CommonProtoc.PARKINGFREE.ALL;\n onChanged();\n return this;\n }", "boolean contains(int vertex);", "@Test\r\n void test_insert_1_vertex_check() {\r\n graph.addVertex(\"1\");\r\n vertices = graph.getAllVertices();\r\n if (!vertices.contains(\"1\"))\r\n fail(\"Insert not working!!\");\r\n }", "private void modifyFringe(int v, int w) {\n\t\tgetEdge(v, w).setSelected(true);\n\t\tgetEdge(getVertex(w).getParent(), w).setSelected(false);\n\t\tdouble cost = newCost(v, w);\n\t\tGreedyVertex vertex = getVertex(w);\n\t\tvertex.setParent(v);\n\t\tvertex.setCost(cost);\n\t\tp.promote(vertex);\n\t}", "@Test\r\n void test_insert_50_vertex_check() {\r\n String str;\r\n for(int i = 0; i < 50; i++) {\r\n str = \"\" + i;\r\n graph.addVertex(str);\r\n }\r\n vertices = graph.getAllVertices();\r\n for(int j = 0; j < 50; j++) {\r\n str = \"\" + j;\r\n if (!vertices.contains(str))\r\n fail(\"Insert not working!!\");\r\n }\r\n }" ]
[ "0.72249085", "0.64920884", "0.6375447", "0.60469097", "0.59374624", "0.57366276", "0.56565166", "0.55207956", "0.54561526", "0.54504997", "0.5348297", "0.53109473", "0.5236293", "0.51943105", "0.51198536", "0.5116829", "0.5109746", "0.5064432", "0.49680948", "0.49464983", "0.4933954", "0.4920192", "0.4858828", "0.4852746", "0.4851901", "0.4824881", "0.48202088", "0.47813883", "0.47785035", "0.47762614", "0.47742993", "0.47532186", "0.4745519", "0.4743671", "0.47234505", "0.4717627", "0.47163457", "0.471394", "0.47008282", "0.4698904", "0.46947572", "0.46684852", "0.46639156", "0.46485803", "0.46377257", "0.4634065", "0.4632016", "0.46241632", "0.46144882", "0.46100855", "0.46043786", "0.4600961", "0.45905066", "0.4588676", "0.45848688", "0.45814377", "0.45793656", "0.45749637", "0.45653948", "0.4556849", "0.4556713", "0.45508623", "0.4544856", "0.45442778", "0.45402417", "0.45383537", "0.45360747", "0.4531516", "0.45279717", "0.45159477", "0.45156705", "0.45155615", "0.45131195", "0.45127788", "0.45120022", "0.45080307", "0.45059204", "0.4501996", "0.44964215", "0.44951287", "0.44932225", "0.4491818", "0.4488961", "0.44878438", "0.44874954", "0.44837615", "0.44834217", "0.44721854", "0.44721854", "0.44702235", "0.44701833", "0.44661203", "0.44660124", "0.44589534", "0.44585598", "0.44574356", "0.44565433", "0.44559047", "0.4454946", "0.44420502" ]
0.8720108
0
This method builds a city specified by the vertex
void buildCity(VertexLocation vert);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void placeCity(VertexLocation vertLoc) {\n\t\t\r\n\t}", "private void setStartingVertexCity(CityByDegrees vertexCity) {\r\n\t\tthis.startingVertexCity = vertexCity;\r\n\t}", "private void buildCity() {\r\n\t\tMessage message = new Message(clickedNode, true, null);\r\n\t\tsendMessage(message);\r\n\t}", "@Override\r\n\tpublic void buildCity() {\n\t\t\r\n\t}", "private void setStartingVertexCityName(String vertexCityName) {\r\n\t\tthis.startingVertexCityName = vertexCityName;\r\n\t}", "@Override\n public void placeCity(VertexLocation vertex) throws ModelException {\n assert vertex != null;\n if (!GameModelFacade.instance().canPlaceCity(vertex)) {\n throw new ModelException(\"Preconditions for action not met.\");\n }\n\n try {\n String clientModel = m_theProxy.buildCity(GameModelFacade.instance().getLocalPlayer().getIndex(), vertex);\n new ModelInitializer().initializeClientModel(clientModel, m_theProxy.getPlayerId());\n } catch (NetworkException e) {\n throw new ModelException(e);\n }\n }", "private CityByDegrees getStartingVertexCity() {\r\n\t\treturn this.startingVertexCity;\r\n\t}", "public void buyCity(Vertex vertex) throws CannotBuyException, InsufficientPlayerResourcesException, AllPiecesPlayedException {\n\t\t if(canDoBuyCity() == false) {\n\t\t\t throw new CannotBuyException(\"Cannot Buy City, possibly no vertex to place a city\");\n\t\t }\n\t\t resourceCardHand.payForCity();\n\t\t playerPieces.placeCity(vertex);\n\t\t \n\t\t // increment victory points\n\t\t totalVictoryPoints++;\n\t }", "public City getStartCity() {\n \treturn vertex1;\n }", "public String buildCity(BuildCity buildCity) throws Exception {\n\t\tString url = server_url + \"/moves/buildCity\";\n\t\tURL obj = new URL(url);\n\t\tHttpURLConnection con = (HttpURLConnection) obj.openConnection();\n\n\t\t//add request header\n\t\tcon.setRequestMethod(\"POST\");\n\t\tcon.setRequestProperty(\"User-Agent\", \"Mozilla/5.0\");\n\t\tcon.setRequestProperty(\"Accept-Language\", \"en-US,en;q=0.5\");\n\t\tcon.setRequestProperty(\"Cookie\", usercookie + \"; \" + gamecookie);\n\t\t\n\t\tJsonObject info = new JsonObject();\n\t\tinfo.addProperty(\"type\",\"buildCity\");\n\t\tinfo.addProperty(\"playerIndex\", buildCity.playerIndex);\n\t\t\n\t\tJsonObject loc = new JsonObject();\n\t\tloc.addProperty(\"x\", buildCity.vertexLocation.getHexLoc().getX());\n\t\tloc.addProperty(\"y\", buildCity.vertexLocation.getHexLoc().getY());\n\t\tloc.addProperty(\"direction\", directions.get(buildCity.vertexLocation.getDir().name()));\n\t\tinfo.add(\"vertexLocation\", loc);\n\t\t\n\t\t// Send post request\n\t\tcon.setDoOutput(true);\n\t\tDataOutputStream wr = new DataOutputStream(con.getOutputStream());\n\t\twr.writeBytes(info.toString());\n\t\twr.flush();\n\t\twr.close();\n\n\t\tint responseCode = con.getResponseCode();\n\t\t//System.out.println(\"\\nSending 'POST' request to URL : \" + url);\n\t\t//System.out.println(\"Post parameters : \" + info.toString());\n\t\t//System.out.println(\"Response Code : \" + responseCode);\n\n\t\tif (responseCode == 400) {\n\t\t\tthrow new Exception();\n\t\t}\n\t\tBufferedReader in = new BufferedReader(\n\t\t new InputStreamReader(con.getInputStream()));\n\t\tString inputLine;\n\t\tStringBuffer response = new StringBuffer();\n\n\t\twhile ((inputLine = in.readLine()) != null) {\n\t\t\tresponse.append(inputLine);\n\t\t}\n\t\tin.close();\n\t\t\n\t\t//print result\n\t\t////System.out.println(response.toString());\n\t\treturn response.toString();\n\t}", "boolean canPlaceCity(VertexLocation vertLoc);", "private String getStartingVertexCityName() {\r\n\t\treturn this.startingVertexCityName;\r\n\t}", "void buildSettlement(VertexLocation vert, boolean free);", "public City<E> city(String name){\n\t\tint index = -1;\n\t\tint i;\n\t\tint size = graphList.size();\n\t\tfor(i=0;i<size;i++){\n\t\t\tif(graphList.get(i).getName().equals(name)){\n\t\t\t\tindex = i;\n\t\t\t}\n\t\t}\n\t\tif(index == -1){\n\t\t\tSystem.out.println(\"Edge can't be built because city cant be found, in Graph city method\");\n\t\t\treturn null;\n\t\t}\n\t\treturn graphList.get(index);\n\t}", "private void createNewCity()\r\n {\r\n int currentPlayer = worldPanel.getCurrentPlayer();\r\n int currentUnit = worldPanel.getCurrentUnit();\r\n boolean canBuild = false;\r\n\r\n if(currentPlayer == 1)\r\n {\r\n int unitType = worldPanel.player1.units[currentUnit - 1].getUnitType();\r\n if(unitType == 1)//if unit is a settler\r\n canBuild = true;\r\n }\r\n\r\n else if(currentPlayer == 2)\r\n {\r\n int unitType = worldPanel.player1.units[currentUnit - 1].getUnitType();\r\n if(unitType == 1)//if unit is a settler\r\n canBuild = true;\r\n }\r\n\r\n //if the unit who presses build is a settler\r\n if(canBuild == true)\r\n {\r\n if(currentPlayer == 1)\r\n {\r\n int playerLoc = worldPanel.player1.units[currentUnit - 1].getPosition();\r\n worldPanel.player1.addCity(playerLoc);\r\n currentUnit++;\r\n worldPanel.setCurrentUnit(currentUnit);\r\n }//end if\r\n else if(currentPlayer == 2)\r\n {\r\n int playerLoc = worldPanel.player2.units[currentUnit - 1].getPosition();\r\n worldPanel.player2.addCity(playerLoc);\r\n currentUnit++;\r\n worldPanel.setCurrentUnit(currentUnit);\r\n }//end elseif\r\n }//end if\r\n\r\n //set new player and unit if necessary\r\n int temp = worldPanel.getNumUnits(currentPlayer);\r\n if(currentUnit > temp)\r\n {\r\n if(currentPlayer == 1)\r\n worldPanel.setCurrentPlayer(2);\r\n else\r\n worldPanel.setCurrentPlayer(1);\r\n worldPanel.setCurrentUnit(1);\r\n }//end if\r\n\r\n //set up new mapPosition if player moved\r\n if(canBuild == true)\r\n setMapPos();\r\n setInfoPanel();\r\n }", "City(int 1_x_coordinate, int 1_y_coordinate, String name_coordinate){\n x_coordinate = 1_x_coordinate;\n y_coordinate = 1_y_coordinate;\n city_name = name_coordinate;\n }", "private void setDegreesForCities() {\r\n\r\n\t\t//Retrieve the staring vertex city\r\n\t\tLinkedList<CityByDegrees> linkedList = new LinkedList<CityByDegrees>();\r\n\t\tgetStartingVertexCity().setVisited(true);\r\n\t\tlinkedList.add(getStartingVertexCity());\r\n\r\n\t\t//Go through and determine the degrees to the vertext city for each city\r\n\t\twhile(linkedList.size() > 0) {\r\n\t\t\tCityByDegrees cityByDegrees = (CityByDegrees)linkedList.remove();\r\n\t\t\tHashSet <CityByDegrees>adjacentCities = cityByDegrees.getAdjacentCities();\r\n\t\t\tIterator iterator = adjacentCities.iterator();\r\n\r\n\t\t\twhile(iterator.hasNext()) {\r\n\t\t\t\tCityByDegrees currentCity = (CityByDegrees)iterator.next();\r\n\t\t\t\tif(!currentCity.isVisited()) {\r\n\t\t\t\t\tcurrentCity.setVisited(true);\r\n\t\t\t\t\tif(cityByDegrees.getDegrees() >= 0) {\r\n\t\t\t\t\t\tcurrentCity.setDegrees(cityByDegrees.getDegrees() + 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlinkedList.add(currentCity);\r\n\t\t\t\t}\r\n\t\t\t}//end inner while\r\n\t\t}//end outer while\r\n\t}", "public static City buildMapFromNewYork(){\n City bangorME = new City(\"Bangor, ME\");\n \n City portlandME = new City(\"Portland, ME\");\n connect(portlandME, bangorME, 118);\n \n City portsmouthNH = new City(\"Portsmouth, NH\");\n connect(portsmouthNH, portlandME, 55);\n \n City burlingtonVT = new City(\"Burlington, VT\");\n connect(burlingtonVT, portsmouthNH, 190);\n connect(burlingtonVT, portlandME, 259);\n \n City bostonMA = new City(\"Boston, MA\");\n connect(bostonMA, portsmouthNH, 60);\n \n City providenceRI = new City(\"Providence, RI\");\n connect(providenceRI, bostonMA, 53);\n \n City worcesterMA = new City(\"Worcester, MA\");\n connect(worcesterMA, bostonMA, 49);\n connect(worcesterMA, portsmouthNH, 83);\n connect(worcesterMA, providenceRI, 44);\n \n City albanyNY = new City(\"Albany, NY\");\n connect(albanyNY, burlingtonVT, 177);\n connect(albanyNY, worcesterMA, 128);\n \n City newHavenCT = new City(\"New Haven, CT\");\n connect(newHavenCT, worcesterMA, 97);\n connect(newHavenCT, providenceRI, 100);\n \n City newYorkNY = new City(\"New York, NY\");\n connect(newYorkNY, newHavenCT, 79);\n connect(newYorkNY, albanyNY, 141);\n \n City buffaloNY = new City(\"Buffalo, NY\");\n connect(buffaloNY, albanyNY, 266);\n \n City philadelphiaPA = new City(\"Philadelphia, PA\");\n connect(philadelphiaPA, newYorkNY, 98);\n \n City washingtonDC = new City(\"Washington, DC\");\n connect(washingtonDC, philadelphiaPA, 145);\n \n City pittsburghPA = new City(\"Pittsburgh, PA\");\n connect(pittsburghPA, washingtonDC, 240);\n connect(pittsburghPA, philadelphiaPA, 288);\n connect(pittsburghPA, buffaloNY, 200);\n \n City clevelandOH = new City(\"Cleveland, OH\");\n connect(clevelandOH, pittsburghPA, 133);\n connect(clevelandOH, buffaloNY, 183);\n \n City richmondVA = new City(\"Richmond, VA\");\n connect(richmondVA, washingtonDC, 105);\n \n City charlestonWV = new City(\"Charleston, WV\");\n connect(charlestonWV, pittsburghPA, 213);\n connect(charlestonWV, washingtonDC, 343);\n connect(charlestonWV, richmondVA, 297);\n \n City charlotteNC = new City(\"Charlotte, NC\");\n connect(charlotteNC, richmondVA, 260);\n connect(charlotteNC, charlestonWV, 254);\n \n City atlantaGA = new City(\"Atlanta, GA\");\n connect(atlantaGA, charlotteNC, 229);\n \n City jacksonvilleFL = new City(\"Jacksonville, FL\");\n connect(jacksonvilleFL, atlantaGA, 300);\n connect(jacksonvilleFL, charlotteNC, 337);\n \n City miamiFL = new City(\"Miami, FL\");\n connect(miamiFL, jacksonvilleFL, 308);\n \n City tampaFL = new City(\"Tampa, FL\");\n connect(tampaFL, miamiFL, 251);\n connect(tampaFL, jacksonvilleFL, 187);\n \n City newOrleansLA = new City(\"New Orleans, LA\");\n connect(newOrleansLA, jacksonvilleFL, 473);\n connect(newOrleansLA, tampaFL, 563);\n connect(newOrleansLA, atlantaGA, 410);\n \n City nashvilleTN = new City(\"Nashville, TN\");\n connect(nashvilleTN, charlotteNC, 390);\n connect(nashvilleTN, atlantaGA, 226);\n connect(nashvilleTN, charlestonWV, 350);\n \n City memphisTN = new City(\"Memphis, TN\");\n connect(memphisTN, nashvilleTN, 191);\n connect(memphisTN, newOrleansLA, 347);\n connect(memphisTN, atlantaGA, 346);\n \n City detroitMI = new City(\"Detroit, MI\");\n connect(detroitMI, clevelandOH, 164);\n \n City indianapolisIN = new City(\"Indianapolis, IN\");\n connect(indianapolisIN, nashvilleTN, 264);\n connect(indianapolisIN, pittsburghPA, 339);\n connect(indianapolisIN, clevelandOH, 294);\n connect(indianapolisIN, detroitMI, 265);\n connect(indianapolisIN, charlestonWV, 299);\n \n City chicagoIL = new City(\"Chicago, IL\");\n connect(chicagoIL, detroitMI, 265);\n connect(chicagoIL, indianapolisIN, 177);\n \n City milwaukeeWI = new City(\"Milwaukee, WI\");\n connect(milwaukeeWI, chicagoIL, 89);\n \n City minneapolisMN = new City(\"Minneapolis, MN\");\n connect(minneapolisMN, milwaukeeWI, 300);\n \n City fargoND = new City(\"Fargo, ND\");\n connect(fargoND, minneapolisMN, 213);\n \n City siouxFallsSD = new City(\"Sioux Falls, SD\");\n connect(siouxFallsSD, fargoND, 214);\n connect(siouxFallsSD, minneapolisMN, 230);\n connect(siouxFallsSD, milwaukeeWI, 443);\n \n City omahaNE = new City(\"Omaha, NE\");\n connect(omahaNE, siouxFallsSD, 164);\n \n City desMoinesIA = new City(\"Des Moines, IA\");\n connect(desMoinesIA, omahaNE, 124);\n connect(desMoinesIA, chicagoIL, 306);\n connect(desMoinesIA, minneapolisMN, 221);\n \n City stLouisMO = new City(\"St. Louis, MO\");\n connect(stLouisMO, chicagoIL, 286);\n connect(stLouisMO, indianapolisIN, 235);\n connect(stLouisMO, nashvilleTN, 281);\n connect(stLouisMO, memphisTN, 256);\n \n City kansasCityMO = new City(\"Kansas City, MO\");\n connect(kansasCityMO, omahaNE, 168);\n connect(kansasCityMO, desMoinesIA, 176);\n connect(kansasCityMO, stLouisMO, 226);\n \n City oklahomaCityOK = new City(\"Oklahoma City, OK\");\n connect(oklahomaCityOK, kansasCityMO, 312);\n connect(oklahomaCityOK, stLouisMO, 449);\n connect(oklahomaCityOK, memphisTN, 416);\n \n City dallasTX = new City(\"Dallas, TX\");\n connect(dallasTX, oklahomaCityOK, 189);\n connect(dallasTX, memphisTN, 408);\n connect(dallasTX, newOrleansLA, 455);\n \n City houstonTX = new City(\"Houston, TX\");\n connect(houstonTX, dallasTX, 214);\n connect(houstonTX, newOrleansLA, 313);\n \n City sanAntonioTX = new City(\"San Antonio, TX\");\n connect(sanAntonioTX, dallasTX, 246);\n connect(sanAntonioTX, houstonTX, 182);\n \n City elPasoTX = new City(\"El Paso, TX\");\n connect(elPasoTX, dallasTX, 552);\n connect(elPasoTX, sanAntonioTX, 473);\n \n City albuquerqueNM = new City(\"Albuquerque, NM\");\n connect(albuquerqueNM, elPasoTX, 234);\n connect(albuquerqueNM, oklahomaCityOK, 482);\n \n City denverCO = new City(\"Denver, CO\");\n connect(denverCO, albuquerqueNM, 392);\n connect(denverCO, kansasCityMO, 528);\n connect(denverCO, omahaNE, 466);\n \n City billingsMT = new City(\"Billings, MT\");\n connect(billingsMT, denverCO, 485);\n connect(billingsMT, siouxFallsSD, 597);\n connect(billingsMT, fargoND, 529);\n \n City butteMT = new City(\"Butte, MT\");\n connect(butteMT, billingsMT, 211);\n \n City saltLakeCityUT = new City(\"Salt Lake City, UT\");\n connect(saltLakeCityUT, butteMT, 366);\n connect(saltLakeCityUT, denverCO, 480);\n \n City phoenixAZ = new City(\"Phoenix, AZ\");\n connect(phoenixAZ, elPasoTX, 379);\n connect(phoenixAZ, albuquerqueNM, 397);\n \n City lasVegasNV = new City(\"Las Vegas, NV\");\n connect(lasVegasNV, saltLakeCityUT, 369);\n connect(lasVegasNV, albuquerqueNM, 514);\n connect(lasVegasNV, phoenixAZ, 294);\n \n City losAngelesCA = new City(\"Los Angeles, CA\");\n connect(losAngelesCA, lasVegasNV, 263);\n connect(losAngelesCA, phoenixAZ, 350);\n \n City sanDiegoCA = new City(\"San Diego, CA\");\n connect(sanDiegoCA, losAngelesCA, 116);\n connect(sanDiegoCA, phoenixAZ, 335);\n connect(sanDiegoCA, lasVegasNV, 311);\n \n City montereyCA = new City(\"Monterey, CA\");\n connect(montereyCA, losAngelesCA, 319);\n \n City sanFranciscoCA = new City(\"San Francisco, CA\");\n connect(sanFranciscoCA, montereyCA, 114);\n connect(sanFranciscoCA, losAngelesCA, 358);\n \n City sacramentoCA = new City(\"Sacramento, CA\");\n connect(sacramentoCA, sanFranciscoCA, 84);\n connect(sacramentoCA, saltLakeCityUT, 585);\n \n City boiseID = new City(\"Boise, ID\");\n connect(boiseID, butteMT, 393);\n connect(boiseID, saltLakeCityUT, 301);\n \n City portlandOR = new City(\"Portland, OR\");\n connect(portlandOR, sacramentoCA, 538);\n connect(portlandOR, boiseID, 407);\n \n City seattleWA = new City(\"Seattle, WA\");\n connect(seattleWA, portlandOR, 175);\n connect(seattleWA, butteMT, 544);\n connect(seattleWA, boiseID, 472);\n \n //change this return city to start wherever you want\n return newYorkNY;\n }", "private static void shortestPathFinder(Graph graph, Character userCity, int algoNum) {\n\n // Finds and stores the City that corresponds to the cityName input\n City currentCity = graph.cityOf(userCity);\n\n // Array List to store every City that was visited by the current one\n ArrayList<Character> citiesVisited = new ArrayList<>();\n\n // Adds the cityName of the input userCity\n citiesVisited.add(userCity);\n\n // Creates a Stack to store and manage all Cities visited\n Stack<City> visitingCities = new Stack<>();\n\n // Loops over each City object in the graph until currentCity becomes the final destinantion Z.\n while (!(currentCity.equals(graph.cityOf('Z')))) {\n // As long as we startCity did not reach the final destination, it means it has visited the\n // previous City object, therefore:\n\n // Adds currentCity to the stack\n visitingCities.add(currentCity);\n\n // Sets true to setCitiesVisited() as it has been visited\n currentCity.setCitiesVisited(true);\n\n // It will also be included to the shortest path\n currentCity.setItIsTheShortest(true);\n\n // Gets all the edges that are connected to the current City we are on\n ArrayList<Edge> cityEdges = currentCity.getCityEdges();\n\n // Temporary City object to update currentCity\n City nextCity = null;\n\n // Integer to track the shortest distance (weight + direct distance) for heuristic algorithm 2\n int weightDistanceTotal = Integer.MAX_VALUE;\n\n // Loop to keep track of currentCity as it advances to the final destination\n // It iterates over edges of currentCity and chooses among its edges Cities that have not been\n // visited yet, using either algorithm 1 or algorithm 2 based on the method input above.\n // the loop terminates if the final currentCity becomes the final destination Z\n // It also terminates after iterating over all edges and choosing the one with the City that\n // has the shortest direct distance to final destination Z\n for (Edge edge: cityEdges) {\n\n // Checks if City of this edge was visited. If so, it continues to check the next edge\n if (edge.getAdjacentCity().getCitiesVisited()) {\n\n // Continues to the next edge\n continue;\n }\n\n // 2. assign the next City to the destination\n if (nextCity == null) {\n\n // Updates nextCity to be adjacent City\n nextCity = edge.getAdjacentCity();\n\n } else {\n\n // Checks which algorithm is being called, and executes the right one\n if (algoNum == 1) {\n if (nextCity.getCityToDestination() > edge.getAdjacentCity().getCityToDestination()) {\n nextCity = edge.getAdjacentCity();\n }\n\n // if algorithm 1 was not chosen, it executes algorithm 2 in the else block bellow\n } else {\n weightDistanceTotalCity cityWithWeightDistanceTotal =\n weightPlusDistanceAlgorithm(nextCity, edge, weightDistanceTotal);\n nextCity = cityWithWeightDistanceTotal.city;\n weightDistanceTotal = cityWithWeightDistanceTotal.weightDistanceTotal;\n }\n }\n }\n\n // If nextCity is still null, it means that its edge was skipped in the for loop above,\n // because it has already been visited by checking if getCitiesVisited() returns true\n if (nextCity == null) {\n\n // Pops off the City we just visited, and flag it to be not the shortest distant City\n visitingCities.pop().setItIsTheShortest(false);\n\n // Sets the next City to the previous one\n nextCity = visitingCities.pop();\n }\n\n // Adds the City name that was visited to keep track of the path\n citiesVisited.add(nextCity.getName());\n\n // CurrentCity is updated to be the next City\n currentCity = nextCity;\n\n // When visiting the last City mark z in the shortest path found\n if (currentCity.getName() == 'Z') {\n currentCity.setItIsTheShortest(true);\n }\n }\n\n // Tracks the path visited and adds up all the weights of the path found\n int pathCounter = 0;\n\n // Constructs the shortest path found\n ArrayList<City> shortestPath = new ArrayList<>();\n\n for (Character tempCity: citiesVisited) {\n // Gets the City of cityVisitor\n City city = graph.cityOf(tempCity);\n\n // Adds to the shortest path found\n if (city.getItIsTheShortest() && !shortestPath.contains(city)) {\n shortestPath.add(city);\n }\n }\n\n // Prints out the shortest path found\n for (int i = 0; i < shortestPath.size() - 1; i++) {\n currentCity = shortestPath.get(i);\n City nextCity = shortestPath.get(i + 1);\n\n // find the weight of that City\n int weight = currentCity.findWeight(nextCity);\n pathCounter += weight;\n }\n\n // Constructs the final output\n String fullPathSequence = \"\";\n String citiesVisitedAsString = \"\";\n\n for (int i = 0; i < citiesVisited.size(); i++) {\n if (i != citiesVisited.size() - 1) {\n fullPathSequence += citiesVisited.get(i) + \" -> \";\n }\n }\n\n // Constructs a string to store all cityNames\n fullPathSequence += citiesVisited.get(citiesVisited.size() - 1);\n\n for (int i = 0; i < shortestPath.size(); i++) {\n if (i != shortestPath.size() - 1) {\n citiesVisitedAsString += shortestPath.get(i).getName() + \" -> \";\n }\n }\n\n if (currentCity.getName() == 'Z') {\n citiesVisitedAsString += \"Z\";\n } else {\n citiesVisitedAsString += shortestPath.get(shortestPath.size() - 1).getName();\n }\n\n // Prints out the String results.\n System.out.println(\"Algorithm \" + algoNum + \":\\nSequence of all Cities: \" + fullPathSequence\n + \"\\nShortest path: \" + citiesVisitedAsString + \"\\nShortest path length: \" + pathCounter + \"\\n\");\n }", "public City getEndCity() {\n \treturn vertex2;\n }", "public City() {\r\n\t\tthis.x = (int) (Math.random() * 200);\r\n\t\tthis.y = (int) (Math.random() * 200);\r\n\t}", "public boolean build(Vertex vertex, int type) {\n \t\tif (vertex == null || !canBuild(vertex, type))\n \t\t\treturn false;\n \n \t\tboolean setup = board.isSetupPhase();\n \n \t\t// check resources based on type we want to build\n \t\tif (type == Vertex.TOWN) {\n \t\t\tif (!setup && !affordTown())\n \t\t\t\treturn false;\n \t\t} else if (type == Vertex.CITY) {\n \t\t\tif (!setup && !affordCity())\n \t\t\t\treturn false;\n \t\t} else {\n \t\t\t// invalid type\n \t\t\treturn false;\n \t\t}\n \n \t\tif (!vertex.build(this, type, setup))\n \t\t\treturn false;\n \n \t\t// deduct resources based on type\n \t\tif (vertex.getBuilding() == Vertex.TOWN) {\n \t\t\tif (!setup) {\n \t\t\t\tuseResources(Type.BRICK, 1);\n \t\t\t\tuseResources(Type.LUMBER, 1);\n \t\t\t\tuseResources(Type.GRAIN, 1);\n \t\t\t\tuseResources(Type.WOOL, 1);\n \t\t\t}\n \t\t\ttowns += 1;\n \t\t\tsettlements.add(vertex);\n \t\t\tboard.checkLongestRoad();\n \t\t} else {\n \t\t\tif (!setup) {\n \t\t\t\tuseResources(Type.GRAIN, 2);\n \t\t\t\tuseResources(Type.ORE, 3);\n \t\t\t}\n \t\t\ttowns -= 1;\n \t\t\tcities += 1;\n \t\t}\n \n \t\t// collect resources for second town during setup\n \t\tif (board.isSetupPhase2()) {\n \t\t\tfor (int i = 0; i < 3; i++) {\n \t\t\t\tHexagon hexagon = vertex.getHexagon(i);\n \t\t\t\tif (hexagon != null && hexagon.getType() != Type.DESERT)\n \t\t\t\t\taddResources(hexagon.getType(), 1);\n \t\t\t}\n \t\t}\n \n \t\tlastTown = vertex;\n \n \t\tappendAction(type == Vertex.TOWN ? R.string.player_town\n \t\t\t\t: R.string.player_city);\n \n \t\treturn true;\n \t}", "public City other(City vertex) {\n if (vertex.equals(city1)) return city2;\n else if (vertex.equals(city2)) return city1;\n else throw new RuntimeException(\"Illegal endpoint\");\n }", "public void addCity(City c) throws CityExistException{\r\n\t\ttry {\r\n\t\t\tmap.addVertex(c);\r\n\t\t} \r\n\t\tcatch (VertexExistException e) {\r\n\t\t\tthrow new CityExistException(\"such city already exists\");\r\n\t\t}\r\n\t}", "public boolean buildResearchStation(City city){\n \treturn model.addStation(city);\n }", "public City(){\n this.x = (int)(Math.random()*200);\n this.y = (int)(Math.random()*200);\n }", "public PersonAddressBuilderDFB in(String city){\n person.city = city;\n return this;\n }", "City(){\n x_coordinate = (int)(Math.random()*200);\n y_coordinate = (int)(Math.random()*200);\n }", "public City(String name) {\n\t\tthis.name = name;\n\t\tthis.inhabitants = new ArrayList<Inhabitant>();\n\t\tthis.postbox = new ArrayList<Letter<?>>();\n\t\tSystem.out.println(\"Creating \" + this.name + \" city\");\n\t}", "public City(int x, int y){\n this.x = x;\n this.y = y;\n }", "private void setAdjacentCities(List <CityByDegrees> cityList)\r\n\t{\r\n\t\t//get a mapping of interstates to cities\r\n\t\tHashMap<String, Set<CityByDegrees>> interstateMap = new HashMap<String, Set<CityByDegrees>>();\r\n\t\tfor(int i = 0; i < cityList.size(); i++)\r\n\t\t{\r\n\t\t\tList interstates = ((CityByDegrees)cityList.get(i)).getInterstates();\r\n\t\t\tfor(int j = 0; j < interstates.size(); j++)\r\n\t\t\t{\r\n\t\t\t\tString interstate = (String)interstates.get(j);\r\n\t\t\t\tif(interstateMap.containsKey(interstate)) {\r\n\t\t\t\t\t((Set)interstateMap.get(interstate)).add(cityList.get(i));\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tSet <CityByDegrees> interstateCitySet = new HashSet<CityByDegrees>();\r\n\t\t\t\t\tinterstateCitySet.add(cityList.get(i));\r\n\t\t\t\t\tinterstateMap.put(interstate, interstateCitySet);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}//end for\r\n\r\n\t\t//get a mapping of vertices to each city\r\n\t\tfor(int i = 0; i < cityList.size(); i++)\r\n\t\t{\r\n\t\t\tList interstates = ((CityByDegrees)cityList.get(i)).getInterstates();\r\n\t\t\tfor(int j = 0; j < interstates.size(); j++)\r\n\t\t\t{\r\n\r\n\t\t\t\tString interstate = (String)interstates.get(j);\r\n\t\t\t\tHashSet<CityByDegrees> interstateCitySet = (HashSet)interstateMap.get(interstate);\r\n\r\n\t\t\t\tif(interstateCitySet.contains(cityList.get(i))) {\r\n\t\t\t\t\tIterator iterator = interstateCitySet.iterator();\r\n\t\t\t\t\twhile(iterator.hasNext()) {\r\n\t\t\t\t\t\tCityByDegrees temp = (CityByDegrees)iterator.next();\r\n\t\t\t\t\t\tif(!temp.getCity().equals( ((CityByDegrees)cityList.get(i)).getCity()))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t((CityByDegrees)cityList.get(i)).addAdjacentCity(temp);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}//end for\r\n\r\n\t}", "public void placeCity(int playerID, VertexLocation loc) {\n\n\t\tverticies.get(loc.getNormalizedLocation()).setPiece(new Piece(PieceType.CITY, null, null, playerID));\n\t}", "public City(int x, int y) {\r\n this.x = x;\r\n this.y = y;\r\n }", "public Address city(String city) {\n this.city = city;\n return this;\n }", "Vertex createVertex();", "public void addWay(City c1,City c2) throws CityNotFoundException{\r\n\t\ttry {\r\n\t\t\tmap.addEdge(c1, c2);\r\n\t\t} catch (VertexNotExistException e) {\r\n\r\n\t\t\tthrow new CityNotFoundException(\"city not founds\");\r\n\t\t}\r\n\t}", "private void fillCity() {\n \n if(postalCodeTF.getText().length() == 4){\n City city = memberConnection.getCity(postalCodeTF.getText());\n cityTF.setText(city.getCity().replaceAll(\"_\", \" \"));\n municipalTF.setText(city.getMunicipal().replaceAll(\"_\", \" \"));\n }\n }", "public boolean isStartingVertexCity() {\r\n\t\t\treturn (getDegrees() == ZERO_DEGREE);\r\n\t\t}", "public void findCities() {\r\n\t\tpolygonMap.setCurrentPlayerID(client.getSettler().getID());\r\n\t\tint counter = 0;\r\n\t\tfor (int i = 0; i < island.getNodes().length; i++) {\r\n\t\t\tif (island.getNodes()[i].getBuilding() == Constants.SETTLEMENT\r\n\t\t\t\t\t&& island.getNodes()[i].getOwnerID() == client.getSettler()\r\n\t\t\t\t\t\t\t.getID()) {\r\n\t\t\t\tpolygonMap.setCityNodes(counter, i);\r\n\t\t\t\tcounter++;\r\n\t\t\t} else {\r\n\t\t\t\tpolygonMap.setCityNodes(counter, -1);\r\n\t\t\t\tcounter++;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void buildVerticies(){\n\t\tfor(Entry<HexLocation, TerrainHex> entry : hexes.entrySet()){\n\t\t\t\n\t\t\tVertexLocation vertLoc1 = new VertexLocation(entry.getKey(), VertexDirection.NorthWest);\n\t\t\tVertex v1 = new Vertex(vertLoc1);\n\t\t\tverticies.put(vertLoc1, v1);\n\t\t\t\n\t\t\tVertexLocation vertLoc2 = new VertexLocation(entry.getKey(), VertexDirection.NorthEast);\n\t\t\tVertex v2 = new Vertex(vertLoc2);\n\t\t\tverticies.put(vertLoc2, v2);\n\t\t\t\n\t\t\tVertexLocation vertLoc3 = new VertexLocation(entry.getKey(), VertexDirection.East);\n\t\t\tVertex v3 = new Vertex(vertLoc3);\n\t\t\tverticies.put(vertLoc3, v3);\n\t\t\t\n\t\t\tVertexLocation vertLoc4 = new VertexLocation(entry.getKey(), VertexDirection.SouthEast);\n\t\t\tVertex v4 = new Vertex(vertLoc4);\n\t\t\tverticies.put(vertLoc4, v4);\n\t\t\t\n\t\t\tVertexLocation vertLoc5 = new VertexLocation(entry.getKey(), VertexDirection.SouthWest);\n\t\t\tVertex v5 = new Vertex(vertLoc5);\n\t\t\tverticies.put(vertLoc5, v5);\n\t\t\t\n\t\t\tVertexLocation vertLoc6 = new VertexLocation(entry.getKey(), VertexDirection.West);\n\t\t\tVertex v6 = new Vertex(vertLoc6);\n\t\t\tverticies.put(vertLoc6, v6);\n\t\t\t\n\t\t\t\n\t\t}\n\t}", "@Test\n public void testACreateCity() {\n // do not replace this with a call to setUserContext,\n // the city must be stored using the client/org of the 100 user\n // this ensures that webservice calls will be able to find the city\n // again\n OBContext.setOBContext(\"100\");\n\n // first delete the current cities, as we should start fresh\n final OBCriteria<City> obc = OBDal.getInstance().createCriteria(City.class);\n for (final City c : obc.list()) {\n OBDal.getInstance().remove(c);\n }\n\n final City city = OBProvider.getInstance().get(City.class);\n city.setAreaCode(\"3941\");\n city.setCoordinates(\"00\");\n city.setCoordinates(\"lo\");\n city.setPostalCode(\"postal\");\n city.setName(\"name\");\n city.setCountry(getOneInstance(Country.class));\n city.setRegion(getOneInstance(Region.class));\n OBDal.getInstance().save(city);\n commitTransaction();\n cityId = city.getId();\n }", "private void compute() {\n InputReader sc = null;\n try {\n sc = new InputReader(new FileInputStream(new File(\"./resources/worldtour\")));\n } catch (FileNotFoundException ex) {\n throw new IllegalArgumentException(ex);\n }\n\n //Build Graph\n Graph G = new Graph(sc);\n adj = new int[G.totalVertices + 1][G.totalVertices + 1];\n\n //Run BFS from each vertex and fill adjacency matrix\n for (int v = 1; v <= G.totalVertices; v++) {\n Bfs bfs = new Bfs(G, v, adj);\n }\n\n //printAdjMatrix();\n // Find the farthest 3 cities to each city\n City[][] threeFurthestTo = new City[G.totalVertices + 1][4];\n // Find the farthest 3 cities from each city\n City[][] threeFurthestFrom = new City[G.totalVertices + 1][4];\n\n for (int i = 1; i <= G.totalVertices; i++) {\n City[] source = new City[G.totalVertices + 1];\n int sourceIdx = 1;\n City[] dest = new City[G.totalVertices + 1];\n int destIdx = 1;\n for (int j = 1; j <= G.totalVertices; j++) {\n if (adj[j][i] > 0) {\n source[sourceIdx] = new City(j, adj[j][i]);\n sourceIdx++;\n }\n if (adj[i][j] > 0) {\n dest[destIdx] = new City(j, adj[i][j]);\n destIdx++;\n }\n }\n Arrays.sort(source, 1, sourceIdx);\n threeFurthestTo[i][1] = source[1];\n threeFurthestTo[i][2] = source[2];\n threeFurthestTo[i][3] = source[3];\n Arrays.sort(dest, 1, destIdx);\n threeFurthestFrom[i][1] = dest[1];\n threeFurthestFrom[i][2] = dest[2];\n threeFurthestFrom[i][3] = dest[3];\n }\n\n //printMax3To(threeFurthestTo);\n //printMax3From(threeFurthestFrom);\n //For every path a -> x -> y -> b find the largest path\n int max = 0;\n int[] result = new int[4];\n for (int x = 1; x <= G.totalVertices; x++) {\n for (int y = 1; y <= G.totalVertices; y++) {\n if (adj[x][y] > 0) {\n for (int a = 1; a < 4; a++) {\n City start = threeFurthestTo[x][a];\n if (start != null) {\n for (int b = 1; b < 4; b++) {\n City end = threeFurthestFrom[y][b];\n if (end != null) {\n int startCityId = start.cityId;\n int endCityId = end.cityId;\n if (isDistinctCity(startCityId, x, y, endCityId)) {\n int sum = adj[startCityId][x] + adj[x][y] + adj[y][endCityId];\n if (sum > max) {\n result[0] = startCityId;\n result[1] = x;\n result[2] = y;\n result[3] = endCityId;\n max = sum;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n\n for (int x : result) {\n System.out.print(x + \" \");\n }\n }", "public CitiesMap(){\r\n\t\tmap=new Graph<City>();\r\n\t}", "public City getCityAt(Position p);", "@Override\n\tpublic City create(City newCity) {\n\t\treturn newCity;\n\t}", "public CustomerAddressQuery city() {\n startField(\"city\");\n\n return this;\n }", "public HashMap<VertexLocation, VertexObject> parseCitiesAndStlmtsFromJSON(JSONArray stlmtsJSON, JSONArray citiesJSON){\n\n HashMap<VertexLocation, VertexObject> newCitiesStlmtsMap = new HashMap<>();\n\n //SETTLEMENTS\n //go parse all the data in the newStlmts array:\n for (int s = 0; s < stlmtsJSON.length(); s++){\n\n JSONObject currStlmtJSON = stlmtsJSON.getJSONObject(s);\n //get the HexLocation object out of the currStlmtJSON:\n JSONObject currStlmtLocJSON = currStlmtJSON.getJSONObject(\"location\");\n int sHLx = currStlmtLocJSON.getInt(\"x\");\n int sHLy = currStlmtLocJSON.getInt(\"y\");\n HexLocation newStlmtHexLoc = new HexLocation(sHLx, sHLy);\n //get the VertexDirection out of the currStlmtLocJSON:\n //VertexDirection newStlmtVtxDir = exchangeStringForVertexDirection(currStlmtLocJSON.getString(\"direction\"));\n VertexDirection newStlmtVtxDir = Converter.stringToVertexDirection(currStlmtLocJSON.getString(\"direction\"));\n //build a VertexLocation obj out of HexLoc and VertexDir:\n VertexLocation newStlmtVtxLoc = new VertexLocation(newStlmtHexLoc, newStlmtVtxDir);\n //get the stlmt owner:\n int newStlmtOwnerIndex = currStlmtJSON.getInt(\"owner\");\n //now build a complete VertexObject to represent the new settlement:\n VertexObject newSettlement = new VertexObject(newStlmtVtxLoc.getNormalizedLocation());\n newSettlement.setOwner(newStlmtOwnerIndex);\n newSettlement.setPieceType(PieceType.SETTLEMENT); //these are all of Settlement pieceType!\n\n newCitiesStlmtsMap.put(newSettlement.getVertexLocation().getNormalizedLocation(), newSettlement);\n }\n\n //CITIES\n for (int c = 0; c < citiesJSON.length(); c++){\n\n JSONObject currCityJSON = citiesJSON.getJSONObject(c);\n //get the HexLocation object out of the currCityJSON:\n JSONObject currCityLocJSON = currCityJSON.getJSONObject(\"location\");\n int cHLx = currCityLocJSON.getInt(\"x\");\n int cHLy = currCityLocJSON.getInt(\"y\");\n HexLocation newCityHexLoc = new HexLocation(cHLx, cHLy);\n //get the VertexDirection out of the currCityLocJSON:\n VertexDirection newCityVtxDir = Converter.stringToVertexDirection(currCityLocJSON.getString(\"direction\"));\n //build a VertexLocation obj out of HexLoc and VertexDir:\n VertexLocation newCityVtxLoc = new VertexLocation(newCityHexLoc, newCityVtxDir);\n //get the city owner:\n int newCityOwnerIndex = currCityJSON.getInt(\"owner\");\n //now build a complete VertexObject to represent the new city:\n VertexObject newCity = new VertexObject(newCityVtxLoc.getNormalizedLocation());\n newCity.setOwner(newCityOwnerIndex);\n newCity.setPieceType(PieceType.CITY); //these are all of City pieceType!\n\n newCitiesStlmtsMap.put(newCity.getVertexLocation().getNormalizedLocation(), newCity);\n }\n\n return newCitiesStlmtsMap;\n }", "private void build(int nodeIdx){\r\n\t\t//get the sizes of each node in this subtree, with nodeIdx as root\r\n\t\tgetSizeDfs(nodeIdx, -1);\r\n\t\t\r\n\t\t//get the balanced root of this subtree, stored in curRootIdx\r\n\t\tcurMinMaxSize = curTreeSize = subTreeSize[nodeIdx];\r\n\t\tcurRootIdx = -1;\r\n\t\tgetBalancedRootDfs(nodeIdx, -1);\r\n\t\t\r\n\t\t//generate distances to this root node, for all the nodes in this subtree\r\n\t\tgenDistToRoot(curRootIdx, -1, 0);\r\n\t\tvisited[curRootIdx] = true;\t\t//set the root to be visited\r\n\t\t\r\n\t\t//recursively build the subtrees\r\n\t\tfor(Integer idx: cities[curRootIdx].adjacentNodeIndices){\r\n\t\t\tif(visited[idx]) continue;\r\n\t\t\tbuild(idx);\r\n\t\t}\r\n\t}", "public City(String cityName) {\n\t\tname = cityName;\n\t\tvisited = false;\n\t}", "public static void main(String[] args) {\n City city = new City(60, 200);\n TourManager.addCity(city);\n City city2 = new City(180, 200);\n TourManager.addCity(city2);\n City city3 = new City(80, 180);\n TourManager.addCity(city3);\n City city4 = new City(140, 180);\n TourManager.addCity(city4);\n City city5 = new City(20, 160);\n TourManager.addCity(city5);\n City city6 = new City(100, 160);\n TourManager.addCity(city6);\n City city7 = new City(200, 160);\n TourManager.addCity(city7);\n City city8 = new City(140, 140);\n TourManager.addCity(city8);\n City city9 = new City(40, 120);\n TourManager.addCity(city9);\n City city10 = new City(100, 120);\n TourManager.addCity(city10);\n City city11 = new City(180, 100);\n TourManager.addCity(city11);\n City city12 = new City(60, 80);\n TourManager.addCity(city12);\n City city13 = new City(120, 80);\n TourManager.addCity(city13);\n City city14 = new City(180, 60);\n TourManager.addCity(city14);\n City city15 = new City(20, 40);\n TourManager.addCity(city15);\n City city16 = new City(100, 40);\n TourManager.addCity(city16);\n City city17 = new City(200, 40);\n TourManager.addCity(city17);\n City city18 = new City(20, 20);\n TourManager.addCity(city18);\n City city19 = new City(60, 20);\n TourManager.addCity(city19);\n City city20 = new City(160, 20);\n TourManager.addCity(city20);\n\n // Initialize population\n Population pop = new Population(50, true);\n System.out.println(\"Initial distance: \" + pop.getFittest().getDistance());\n\n // Evolve population for 100 generations\n pop = GA.evolvePopulation(pop);\n for (int i = 0; i < 100; i++) {\n pop = GA.evolvePopulation(pop);\n }\n\n // Print final results\n System.out.println(\"Finished\");\n System.out.println(\"Final distance: \" + pop.getFittest().getDistance());\n System.out.println(\"Solution:\");\n System.out.println(pop.getFittest());\n }", "public City(String cit) {\n this.thecity = cit;\n city.add(this);\n }", "private void addCities() {\n int random2 = 0;\n for (int i = 1; i < MAP_LENGTH-1; i++) {\n for (int j = 1; j < MAP_LENGTH-1; j++) {\n if (tileMap[i][j].getTerrain() instanceof Grass) { //Make cities on grass tiles only\n random2 = (int)(Math.round(Math.random()*18));\n if (!adjacentCity(i, j) && (random2 < 3)) {\n tileMap[i][j].setCity(new City(i, j, false)); //If randomly chosen and not in proximity of another city, create a city there (right now set as not a capital)\n }\n }\n }\n }\n }", "void buildRoad(EdgeLocation edge, boolean free);", "public static void main(String[] args) {\n City city = new City(60, 200);\n\n City city2 = new City(180, 200);\n\n City city3 = new City(80, 180);\n City city4 = new City(140, 180);\n\n City city5 = new City(20, 160);\n\n City city6 = new City(100, 160);\n\n City city7 = new City(200, 160);\n\n City city8 = new City(140, 140);\n\n City city9 = new City(40, 120);\n\n City city10 = new City(100, 120);\n\n City city11 = new City(180, 100);\n\n City city12 = new City(60, 80);\n\n City city13 = new City(120, 80);\n City city14 = new City(180, 60);\n City city15 = new City(20, 40);\n\n City city16 = new City(100, 40);\n\n City city17 = new City(200, 40);\n City city18 = new City(20, 20);\n\n City city19 = new City(60, 20);\n City city20 = new City(160, 20);\n List<City> list=new ArrayList<City>();\n list.add(city);list.add(city2);\n list.add(city3);\n list.add(city4);\n list.add(city5);\n list.add(city6);\n list.add(city7);\n list.add(city8);\n list.add(city9);\n list.add(city10);\n list.add(city11);\n list.add(city12);\n list.add(city13);\n list.add(city14);\n list.add(city15);\n list.add(city16);\n list.add(city17);\n list.add(city18);\n list.add(city19);\n list.add(city20);\n\n // Initialize population\n Population pop = new Population(100, true,list);\n System.out.println(\"Initial distance: \" + pop.getBestTour().getDistance());\n\n // Evolve population for 100 generations\n pop = Ga.evolvePopulation(pop);\n for (int i = 0; i < 500; i++) {\n pop = Ga.evolvePopulation(pop);\n System.out.println(\"第\"+i+\"代\"+pop.getBestTour().getDistance());\n }\n\n // Print final results\n System.out.println(\"Finished\");\n System.out.println(\"Final distance: \" + pop.getBestTour().getDistance());\n System.out.println(\"Solution:\");\n System.out.println(pop.getBestTour());\n }", "private DTOCity cityFromName(String name) {\n\t\tfor(DTOCity c : this.cities) {\n\t\t\tif(c.getName().equals(name))\n\t\t\t\treturn c;\n\t\t}\n\t\tthrow new NoSuchElementException(\"Error in creating the DTO graph!\");\n\t}", "GARoute(){\n cityIndex = new ArrayList<Integer>();\n }", "public void setCity(String city){\n\t\tthis.city = city;\n\t}", "public Vertex[] createGraph(){\n\t\t /* constructing a graph using matrices\n\t\t * If there is a connection between two adjacent LETTERS, the \n\t * cell will contain a num > 1, otherwise a 0. A value of -1 in the\n\t * cell denotes that the cities are not neighbors.\n\t * \n\t * GRAPH (with weights b/w nodes):\n\t * E+---12-------+B--------18-----+F----2---+C\n\t * +\t\t\t\t+\t\t\t\t +\t\t +\n\t * |\t\t\t\t|\t\t\t\t/\t\t |\n\t * |\t\t\t\t|\t\t\t |\t\t |\n\t * |\t\t\t\t|\t\t\t |\t\t 10\n\t * 24\t\t\t\t8\t\t\t 8\t |\n\t * |\t\t\t\t|\t\t\t |\t\t +\n\t * |\t\t\t\t|\t\t\t | H <+---11---I\n\t * |\t\t\t\t|\t\t\t /\n\t * +\t\t\t\t+\t\t\t +\n\t * G+---12----+A(start)+---10--+D\n\t * \n\t * NOTE: I is the only unidirectional node\n\t */\n\t\t\n\t\tint cols = 9;\n\t\tint rows = 9;\n\t\t//adjacency matrix\n\t\t\t\t //A B C D E F G H I\n\t int graph[][] = { {0,8,0,10,0,0,12,0,0}, //A\n\t {8,0,0,0,12,18,0,0,0}, //B\n\t {0,0,0,0,0,2,0,10,0}, //C\n\t {10,0,0,0,0,8,0,0,0}, //D\n\t {0,12,0,0,0,0,24,0,0}, //E\n\t {0,18,2,8,0,0,0,0,0}, //F\n\t {12,0,0,0,0,0,24,0,0}, //G\n\t {0,0,10,0,0,0,0,0,11}, //H\n\t {0,0,0,0,0,0,0,11,0}}; //I\n\t \n\t //initialize stores vertices\n\t Vertex[] vertices = new Vertex[rows]; \n\n\t //Go through each row and collect all [i,col] >= 1 (neighbors)\n\t int weight = 0; //weight of the neighbor\n\t for (int i = 0; i < rows; i++) {\n\t \tVector<Integer> vec = new Vector<Integer>(rows);\n\t\t\tfor (int j = 0; j < cols; j++) {\n\t\t\t\tif (graph[i][j] >= 1) {\n\t\t\t\t\tvec.add(j);\n\t\t\t\t\tweight = j;\n\t\t\t\t}//is a neighbor\n\t\t\t}\n\t\t\tvertices[i] = new Vertex(Vertex.getVertexName(i), vec);\n\t\t\tvertices[i].state = weight;\n\t\t\tvec = null; // Allow garbage collection\n\t\t}\n\t return vertices;\n\t}", "private void buildStreet() {\r\n\t\tbuilt = false;\r\n\t\tbuildPanelRoad.setVisible(false);\r\n\t\tMessage message = new Message(clickedRoad, true, null);\r\n\t\tsendMessage(message);\r\n\t}", "public void setCity(String city){\n this.city = city;\n }", "public void setTo(Vertex<VV> vertex)\r\n { this.to = vertex; }", "Vertex(){}", "private void graphInfo() {\n \n this.distances = new double[this.cities.size()][this.cities.size()];\n \n City c1, c2;\n \n // take the city\n for (int i = 0; i < this.cities.size(); i++) {\n // go through all the other cities\n c1 = this.cities.get(i);\n for (int j = 0; j < this.cities.size(); j++) {\n c2 = this.cities.get(j);\n this.distances[i][j] = c1.to(c2);\n }\n }\n \n }", "public void addCity(String city) {\n connects.put(city, new ArrayList<Flight>());\n }", "public void setCity(City city) {\n this.city = city;\n }", "public void setCity(String city) {\n this.city = city;\n }", "public void setCity(String city) {\n this.city = city;\n }", "public void setCity(String city) {\n this.city = city;\n }", "public void setCity(String city) {\n this.city = city;\n }", "public void setCity(String city) {\n this.city = city;\n }", "public void setCity(String city) {\n this.city = city;\n }", "public void setFrom(Vertex<VV> vertex)\r\n { this.from = vertex; }", "public String toString(){\n return (\"new City(\" + \n this.zipFormat.format(this.zip) + \", \" + \n this.name + \", \" + this.state + \", \" + \n this.longitude + \", \" + this.latitude + \")\");\n }", "public void setCity(String city) {\n this.city = city;\n }", "public void setCity(String city) {\r\n this.city = city;\r\n }", "public void setCity(String city) {\r\n this.city = city;\r\n }", "public City(String city, LatLng location) {\n\t\tthis.city = city;\n\t\tthis.location = location;\n\t\tcityCount++;\n\t}", "public CityscapeComponent(int x)\n {\n numOfBuildings = x;\n \n }", "public void setCity(String city) {\r\n\t\tthis.city = city;\r\n\t}", "public void setCity(String city) {\r\n\t\tthis.city = city;\r\n\t}", "public City(Integer aKey)\r\n {\r\n label = \" \";\r\n key = aKey;\r\n }", "@Override\r\n\tpublic void buildRoad() {\n\t\t\r\n\t}", "public void setCity(String city)\n\t{\n\t\tCity = city;\n\t}", "public void setCity(String city) {\n\t\tthis.city = city;\n\t}", "public void setCity(String city) {\n\t\tthis.city = city;\n\t}", "public void setCity(String city) {\n\t\tthis.city = city;\n\t}", "public void setCity(String city) {\n\t\tthis.city = city;\n\t}", "public City() {\n connects = new HashMap<String, ArrayList<Flight>>();\n }", "public City() {\n\t}", "public City() {\n\t}", "public void setCity (String city) {\n\t\tthis.city=city;\n\t}", "@Override\r\n\tpublic void placeSettlement(VertexLocation vertLoc) {\n\t\t\r\n\t}", "public static void main(String[] args) {\n\n\t\tString[][] example = {\n //Boston ... Manila\n\t\t{\"-\" ,\"225\",\"575\",\"200\",\"70\" ,\"85\" ,\"340\",\"675\",\"975\"},\n\t\t{\"225\",\"-\" ,\"225\",\"50\" ,\"125\",\"220\",\"120\",\"435\",\"550\"},\n\t\t{\"575\",\"225\",\"-\" ,\"510\",\"650\",\"675\",\"735\",\"225\",\"200\"},\n\t\t{\"200\",\"50\" ,\"510\",\"-\" ,\"-\" ,\"-\" ,\"-\" ,\"-\" ,\"-\" },\n\t\t{\"70\" ,\"125\",\"650\",\"-\" ,\"-\" ,\"-\" ,\"-\" ,\"-\" ,\"-\" },\n\t\t{\"85\" ,\"220\",\"675\",\"-\" ,\"-\" ,\"-\" ,\"-\" ,\"-\" ,\"-\" },\n\t\t{\"340\",\"120\",\"735\",\"-\" ,\"-\" ,\"-\" ,\"-\" ,\"-\" ,\"-\" },\n\t\t{\"675\",\"435\",\"225\",\"-\" ,\"-\" ,\"-\" ,\"-\" ,\"-\" ,\"-\" },\n\t\t{\"975\",\"550\",\"200\",\"-\" ,\"-\" ,\"-\" ,\"-\" ,\"-\" ,\"-\" }};\n\n\t\tint n = example.length; //n x n grid\n\n\t\tNode[] nodes = new Node[n];\n\t\tfor (int i = 0; i < n; i++)\n\t\t\tnodes[i] = new Node(cities[i]);\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tfor (int j = 0; j < n; j++) {\n\t\t\t\tif (!example[i][j].equals(\"-\")) {\n\t\t\t\t\tint cost = Integer.parseInt(example[i][j]);\n\t\t\t\t\tnodes[i].addEdge(new Edge(nodes[i], nodes[j], cost));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tint start = cityIndex(\"Boston\"); //start of our trip\n\t\tint end = cityIndex(\"Beijing\"); //end of our trip\n\t\tSystem.out.println(\"total cost:\");\n\t\tSystem.out.println(dijkstra(nodes[start], nodes[end]));\n\t\tSystem.out.println(\"optimal path taken:\");\n\t\ttracePath(nodes[end]);\n\t}", "public static void main(String[] args)\r\n\t{\r\n\t\tif(args.length != 1)\r\n\t\t{\r\n\t\t\tusage();\r\n\t\t}\r\n\t\tVertex[] vertices;\r\n\t\tint capital; // the rank of the capital city\r\n\t\tCities cities = new Cities();\r\n\t\t\r\n\t\tcities.readFile(args[0]);\r\n\t\tvertices = cities.minSpanningTree(0);\r\n\t\tV = vertices.length;\r\n\t\tpopulateNeighbors(vertices);\r\n\t\tList<SimpleEntry<Integer, Double>> bc = betweennessCent(vertices);\r\n\t\tMathContext mc = new MathContext(6); // to format numbers to 6 sig digs\r\n\t\tcapital = -1; // should never be -1 one when trying to access it, and we want to know if it is.\r\n\t\t\r\n\t\tSystem.out.println(\"Rank\\tVertex\\tBetweenness\");\r\n\t\tfor(int i = 0; i < V; i++)\r\n\t\t{\r\n\t\t\tif(i < 40)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println((i+1) + \"\\t\" + bc.get(i).getKey() + \"\\t\" + new BigDecimal(bc.get(i).getValue(), mc));\r\n\t\t\t}\r\n\t\t\tif(bc.get(i).getKey() == 0)\r\n\t\t\t{\r\n\t\t\t\tcapital = i;\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"\\nCapital city:\");\r\n\t\tSystem.out.println((capital+1) + \"\\t\" + bc.get(capital).getKey() + \"\\t\" + new BigDecimal(bc.get(capital).getValue(), mc));\r\n\t}", "public static void main(String[] args) { Create and add our cities\n//\n try {\n // read file content from file\n StringBuffer sb= new StringBuffer(\"\");\n\n FileReader reader = new FileReader(\"location.txt\");\n BufferedReader br = new BufferedReader(reader);\n\n String str = null;\n\n while((str = br.readLine()) != null) {\n// sb.append(str+\"/n\");\n String []info = new String[3];\n String cityName;\n int locationX;\n int locationY;\n info = str.split(\" \");\n cityName = info[0];\n locationX = Integer.parseInt(info[1]);\n locationY = Integer.parseInt(info[2]);\n City city = new City(locationX, locationY, cityName);\n TourManager.addCity(city);\n }\n\n br.close();\n reader.close();\n\n\n }\n catch(FileNotFoundException e) {\n e.printStackTrace();\n }\n catch(IOException e) {\n e.printStackTrace();\n }\n\n\n // Set initial temp\n double temp = 1000000;\n\n // Cooling rate\n double coolingRate = 0.00001;\n\n // Initialize intial solution\n Tour currentSolution = new Tour();\n currentSolution.generateIndividual();\n\n System.out.println(\"Initial solution distance: \" + currentSolution.getDistance());\n\n // Set as current best\n Tour best = new Tour(currentSolution.getTour());\n\n // Loop until system has cooled\n while (temp > 1) {\n // Create new neighbour tour\n Tour newSolution = new Tour(currentSolution.getTour());\n\n // Get a random positions in the tour\n int tourPos1 = (int) (newSolution.tourSize() * Math.random());\n int tourPos2 = (int) (newSolution.tourSize() * Math.random());\n\n // Get the cities at selected positions in the tour\n City citySwap1 = newSolution.getCity(tourPos1);\n City citySwap2 = newSolution.getCity(tourPos2);\n\n // Swap them\n newSolution.setCity(tourPos2, citySwap1);\n newSolution.setCity(tourPos1, citySwap2);\n\n // Get energy of solutions\n int currentEnergy = currentSolution.getDistance();\n int neighbourEnergy = newSolution.getDistance();\n\n // Decide if we should accept the neighbour\n if (acceptanceProbability(currentEnergy, neighbourEnergy, temp) > Math.random()) {\n currentSolution = new Tour(newSolution.getTour());\n }\n\n // Keep track of the best solution found\n if (currentSolution.getDistance() < best.getDistance()) {\n best = new Tour(currentSolution.getTour());\n }\n\n // Cool system\n temp *= 1-coolingRate;\n }\n\n System.out.println(\"Final solution distance: \" + best.getDistance());\n System.out.println(\"Tour: \" + best);\n FinalGraph.drawGraph();\n }", "public void buildLocation() {\n try (PreparedStatement prep = Database.getConnection()\n .prepareStatement(\"CREATE TABLE IF NOT EXISTS location (location_name\"\n + \" TEXT, lat REAL, lon REAL PRIMARY KEY (location_name));\")) {\n prep.executeUpdate();\n } catch (final SQLException e) {\n e.printStackTrace();\n }\n }", "public com.inikah.slayer.model.MMCity create(long cityId);", "public static void main(String[] args) throws Exception {\r\n\r\n\t\t\t/*\r\n\t\t\tIn future add a parameter to accept default city from commandline\r\n\t\t\tFor now hardcode the default city as Chicago.\r\n\t\t\t*/\r\n\t\t\t//Set the default/vertex city to run the report against\r\n\t\t\tSolution solution = new Solution();\r\n\t\t\tsolution.setStartingVertexCityName(\"Chicago\");\r\n\r\n\t\t\t//Read in the input from STDIN and parse it\r\n\t\t\tsolution.setCityByDegreesList(solution.parseCityInput());\r\n\r\n\t\t\t//Set the adjacent cities for each city in the list\r\n\t\t\tsolution.setAdjacentCities(solution.getCityByDegreesList());\r\n\r\n\t\t\t//determine the degrees to the vertex city for each city\r\n\t\t\tsolution.setDegreesForCities();\r\n\r\n\t\t\t//Sort the list of cities by degrees descending then city ascending then state ascending\r\n\t\t\tCollections.sort(solution.getCityByDegreesList(), solution.new CityByDegreesChainedComparator(\r\n\t\t\t solution.new DegreeComparator(),\r\n\t\t\t solution.new CityComparator(),\r\n\t\t\t solution.new StateComparator())\r\n\t\t\t);\r\n\r\n\t\t\t//print the result to the command line\r\n\t\t\tsolution.printResults(solution.getCityByDegreesList());\r\n\r\n\t}", "private void getVertex(int x, int y, Vector3f vertex) {\n\t\tfloat height = getRawHeightFieldValue(x, y);\n\n\t\tswitch (m_upAxis) {\n\t\tcase 0: {\n\t\t\tvertex.set(height - m_localOrigin.x, (-m_width / 2.0f) + x, (-m_length / 2.0f) + y);\n\t\t\tbreak;\n\t\t}\n\t\tcase 1: {\n\t\t\tvertex.set((-m_width / 2.0f) + x, height - m_localOrigin.y, (-m_length / 2.0f) + y);\n\t\t\tbreak;\n\t\t}\n\n\t\tcase 2: {\n\t\t\tvertex.set((-m_width / 2.0f) + x, (-m_length / 2.0f) + y, height - m_localOrigin.z);\n\t\t\tbreak;\n\t\t}\n\t\t}\n\n\t\tvertex.x = vertex.x * m_localScaling.x;\n\t\tvertex.y = vertex.y * m_localScaling.y;\n\t\tvertex.z = vertex.z * m_localScaling.z;\n\t}", "public ImmutableNetwork<Node, Edge> buildGraph() {\n\n // MutableNetwork is an interface requiring a type for nodes and a type for edges\n MutableNetwork<Node, Edge> roads = NetworkBuilder.undirected().build();\n\n // Construct Nodes for cities,\n // and add them to a map\n String[] cities = {\"Wuhan\", \"shanghai\", \"Beijing\", \"Tianjin\", \"dalian\"};\n\n Map<String, Node> all_nodes = new TreeMap<String, Node>();\n for (int i = 0; i < cities.length; i++) {\n // Add nodes to map\n Node node = new Node(cities[i]);\n all_nodes.put(cities[i], node);\n\n // Add nodes to network\n roads.addNode(node);\n }\n\n // Construct Edges for roads,\n // and add them to a map\n String[] distances = {\"Wuhan:shanghai:9239\", \"Wuhan:Beijing:1103\", \"Wuhan:Tianjin:1162\", \"Wuhan:dalian:1423\", \"shanghai:Beijing:1214\", \"shanghai:Tianjin:20\", \"Beijing:Tianjin:4\", \"shanghai:dalian:1076\", \"Tianjin:dalian:802\" };\n //String[] distances = {\"A:B:10\",\"A:D:20\", \"A:C:15\", \"B:D:25\", \"B:C:35\" , \"C:D:30\"};\n Map<String, Edge> all_edges = new TreeMap<String, Edge>();\n for (int j = 0; j < distances.length; j++) {\n // Parse out (city1):(city2):(distance)\n String[] splitresult = distances[j].split(\":\");\n String left = splitresult[0];\n String right = splitresult[1];\n String label = left + \":\" + right;\n int value = Integer.parseInt(splitresult[2]);\n\n // Add edges to map\n Edge edge = new Edge(left, right, value);\n all_edges.put(label, edge);\n\n // Add edges to network\n roads.addEdge(all_nodes.get(edge.left), all_nodes.get(edge.right), edge);\n }\n\n // Freeze the network\n ImmutableNetwork<Node, Edge> frozen_roads = ImmutableNetwork.copyOf(roads);\n\n return frozen_roads;\n }" ]
[ "0.7024829", "0.6939623", "0.67519474", "0.6652785", "0.6632132", "0.65873766", "0.6489061", "0.6361162", "0.63373053", "0.63138384", "0.6307286", "0.6255368", "0.6209794", "0.6180402", "0.61000776", "0.6057489", "0.60038406", "0.59972644", "0.57844913", "0.573472", "0.5733923", "0.57082766", "0.5663379", "0.56377405", "0.5630178", "0.5552046", "0.55407566", "0.55390596", "0.55196834", "0.55102783", "0.54838157", "0.5478241", "0.5475075", "0.5454185", "0.54331374", "0.53510743", "0.5350197", "0.5337489", "0.53205717", "0.5301951", "0.52964646", "0.52928925", "0.52506196", "0.5233386", "0.52298254", "0.520535", "0.5205096", "0.5198243", "0.51954854", "0.5180248", "0.5163104", "0.5153879", "0.51515967", "0.5146266", "0.5138011", "0.51168495", "0.51039433", "0.50999695", "0.50942653", "0.50938517", "0.5083227", "0.5072809", "0.5072687", "0.5051359", "0.5047003", "0.5041772", "0.5041772", "0.5041772", "0.5041772", "0.5041772", "0.5041772", "0.50393176", "0.5038325", "0.5023216", "0.5016284", "0.5016284", "0.5011267", "0.4984557", "0.49794", "0.49794", "0.49709442", "0.4961319", "0.4952734", "0.4943953", "0.4943953", "0.4943953", "0.4943953", "0.49296445", "0.49281198", "0.49281198", "0.49280304", "0.4926221", "0.4918723", "0.49132904", "0.49095428", "0.49087116", "0.49070868", "0.49048975", "0.48990595", "0.48988584" ]
0.90960175
0
This method offers a trade from one player to another
void offerTrade(int receiver, Resources resources);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n protected void trade(){\n // An example of a random trade proposal: offer peasants in exchange of soldiers\n // Pick the id of the potential partner (without checking if it is my neighbor)\n double pertnerID = (new Random()).nextInt(42)+1;\n trade[0] = pertnerID;\n // Choose the type of good demanded (peasants - 3)\n double demandType = 3;\n trade[1] = demandType;\n // Choose the amount of demanded goods\n double demand = Math.random();\n trade[2] = demand;\n // Choose the type of good offered in exchange (peasants - 2)\n double offerType = 2;\n trade[3] = offerType;\n // Choode the amount of goods offered in exchange (random but less than my total number of peasants)\n double offer = (new Random()).nextDouble()*myTerritory.getPeasants();\n trade[4] = offer;\n\n // This procedure updated the array trade, which contains the information\n // about trade proposals of the current lord\n }", "private void botTrading(){\n if(game.isCardPositive(game.getHighestSharePriceStock())){\n int numShares = player.getFunds()/(game.getHighestSharePriceStock().getSharePrice()+3);\n player.getShares().set(game.getIndex(game.getHighestSharePriceStock()), player.getShares().get(game.getIndex(game.getHighestSharePriceStock())) + numShares);\n player.setFunds(-numShares*(game.getHighestSharePriceStock().getSharePrice()+3));\n }\n }", "@Override\r\n\tpublic void setPlayerToTradeWith(int playerIndex) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void sendTradeOffer(TradeOffer offer) {\n\t\t\r\n\t}", "public void updateMoney()\n\t\t{\n\t\t\t\n\t\t\tFPlayer p1 = this.viewer;\n\t\t\tFPlayer p2 = (p1.equals(this.t.p1)) ? this.t.p2 : this.t.p1;\n\t\t\t\n\t\t\tItemStack om = new ItemStack(Material.GREEN_WOOL,1);\n\t\t\tItemMeta it = om.getItemMeta();\n\t\t\tit.setDisplayName(ChatColor.DARK_GREEN+ChatColor.BOLD.toString()+\"Money in trade:\");\n\t\t\tit.setLore(Arrays.asList(new String[] {\"\",Util.getMoney(this.t.getMoneyTraded(p1)),\"\",\"Click to add/remove money from trade\"}));\n\t\t\tom.setItemMeta(it);\n\t\t\t\n\t\t\tif (this.canAdd()) super.contents.put(0,new ItemSwapMenu(this,om,new MenuMoney(super.viewer,this.t)));\n\t\t\telse super.contents.put(0,new ItemDummy(this,om));\n\t\t\t\n\t\t\t// Trader money in trade\n\t\t\tItemStack tm = new ItemStack(Material.GREEN_WOOL,1);\n\t\t\tit = tm.getItemMeta();\n\t\t\tit.setDisplayName(ChatColor.DARK_GREEN+ChatColor.BOLD.toString()+\"Money in trade:\");\n\t\t\tit.setLore(Arrays.asList(new String[] {\"\",Util.getMoney(this.t.getMoneyTraded(p2))}));\n\t\t\ttm.setItemMeta(it);\n\t\t\tsuper.contents.put(8,new ItemDummy(this,tm));\n\t\t\tthis.composeInv();\n\t\t}", "@Override\r\n\tpublic void acceptTrade(boolean willAccept) {\n\t\t\r\n\t}", "public void buyStock(double askPrice, int shares, int tradeTime) {\n }", "public TransactionResponse sell() {\r\n \t\ttry {\r\n \t\t\tTransactionResponse response = new TransactionResponse(hp);\r\n \t\t\tCalculation calc = hc.getCalculation();\r\n \t\t\tAccount acc = hc.getAccount();\r\n \t\t\tLanguageFile L = hc.getLanguageFile();\r\n \t\t\tLog log = hc.getLog();\r\n \t\t\tNotification not = hc.getNotify();\r\n \t\t\tInfoSignHandler isign = hc.getInfoSignHandler();\r\n \t\t\tString playerecon = hp.getEconomy();\r\n \t\t\tint id = hyperObject.getId();\r\n \t\t\tint data = hyperObject.getData();\r\n \t\t\tString name = hyperObject.getName();\r\n \t\t\tif (giveInventory == null) {\r\n \t\t\t\tgiveInventory = hp.getPlayer().getInventory();\r\n \t\t\t}\r\n \t\t\tif (amount > 0) {\r\n \t\t\t\tif (id >= 0) {\r\n \t\t\t\t\tint totalitems = im.countItems(id, data, giveInventory);\r\n \t\t\t\t\tif (totalitems < amount) {\r\n \t\t\t\t\t\tboolean sellRemaining = hc.getYaml().getConfig().getBoolean(\"config.sell-remaining-if-less-than-requested-amount\");\r\n \t\t\t\t\t\tif (sellRemaining) {\r\n \t\t\t\t\t\t\tamount = totalitems;\r\n \t\t\t\t\t\t} else {\t\r\n \t\t\t\t\t\t\tresponse.addFailed(L.f(L.get(\"YOU_DONT_HAVE_ENOUGH\"), name), hyperObject);\r\n \t\t\t\t\t\t\treturn response;\t\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t}\r\n \t\t\t\t\tif (amount > 0) {\r\n \t\t\t\t\t\tdouble price = hyperObject.getValue(amount, hp);\r\n \t\t\t\t\t\tBoolean toomuch = false;\r\n \t\t\t\t\t\tif (price == 3235624645000.7) {\r\n \t\t\t\t\t\t\ttoomuch = true;\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\tif (!toomuch) {\r\n \t\t\t\t\t\t\tint maxi = hyperObject.getMaxInitial();\r\n \t\t\t\t\t\t\tboolean isstatic = false;\r\n \t\t\t\t\t\t\tboolean isinitial = false;\r\n \t\t\t\t\t\t\tisinitial = Boolean.parseBoolean(hyperObject.getInitiation());\r\n \t\t\t\t\t\t\tisstatic = Boolean.parseBoolean(hyperObject.getIsstatic());\r\n \t\t\t\t\t\t\tif ((amount > maxi) && !isstatic && isinitial) {\r\n \t\t\t\t\t\t\t\tamount = maxi;\r\n \t\t\t\t\t\t\t\tprice = hyperObject.getValue(amount, hp);\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\tboolean sunlimited = hc.getYaml().getConfig().getBoolean(\"config.shop-has-unlimited-money\");\r\n \t\t\t\t\t\t\tif (acc.checkshopBalance(price) || sunlimited) {\r\n \t\t\t\t\t\t\t\tif (maxi == 0) {\r\n \t\t\t\t\t\t\t\t\tprice = hyperObject.getValue(amount, hp);\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\tim.removeItems(id, data, amount, giveInventory);\r\n \t\t\t\t\t\t\t\tdouble shopstock = 0;\r\n \t\t\t\t\t\t\t\tshopstock = hyperObject.getStock();\r\n \t\t\t\t\t\t\t\tif (!Boolean.parseBoolean(hyperObject.getIsstatic()) || !hc.getConfig().getBoolean(\"config.unlimited-stock-for-static-items\")) {\r\n \t\t\t\t\t\t\t\t\thyperObject.setStock(shopstock + amount);\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\tint maxi2 = hyperObject.getMaxInitial();\r\n \t\t\t\t\t\t\t\tif (maxi2 == 0) {\r\n \t\t\t\t\t\t\t\t\thyperObject.setInitiation(\"false\");\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\tdouble salestax = hp.getSalesTax(price);\r\n \t\t\t\t\t\t\t\tacc.deposit(price - salestax, hp.getPlayer());\r\n \t\t\t\t\t\t\t\tacc.withdrawShop(price - salestax);\r\n \t\t\t\t\t\t\t\tif (sunlimited) {\r\n \t\t\t\t\t\t\t\t\tString globalaccount = hc.getYaml().getConfig().getString(\"config.global-shop-account\");\r\n \t\t\t\t\t\t\t\t\tacc.setBalance(0, globalaccount);\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\t\r\n \t\t\t\t\t\t\t\tresponse.addSuccess(L.f(L.get(\"SELL_MESSAGE\"), amount, calc.twoDecimals(price), name, calc.twoDecimals(salestax)), price - salestax, hyperObject);\r\n \t\t\t\t\t\t\t\tresponse.setSuccessful();\r\n \t\t\t\t\t\t\t\tString type = \"dynamic\";\r\n \t\t\t\t\t\t\t\tif (Boolean.parseBoolean(hyperObject.getInitiation())) {\r\n \t\t\t\t\t\t\t\t\ttype = \"initial\";\r\n \t\t\t\t\t\t\t\t} else if (Boolean.parseBoolean(hyperObject.getIsstatic())) {\r\n \t\t\t\t\t\t\t\t\ttype = \"static\";\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\tlog.writeSQLLog(hp.getName(), \"sale\", name, (double) amount, calc.twoDecimals(price - salestax), calc.twoDecimals(salestax), playerecon, type);\r\n \t\t\t\t\t\t\t\tisign.updateSigns();\r\n \t\t\t\t\t\t\t\tnot.setNotify(name, null, playerecon);\r\n \t\t\t\t\t\t\t\tnot.sendNotification();\r\n \t\t\t\t\t\t\t\treturn response;\r\n \t\t\t\t\t\t\t} else {\r\n \t\t\t\t\t\t\t\tresponse.addFailed(L.get(\"SHOP_NOT_ENOUGH_MONEY\"), hyperObject);\r\n \t\t\t\t\t\t\t\treturn response;\t\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t} else {\r\n \t\t\t\t\t\t\tresponse.addFailed(L.f(L.get(\"CURRENTLY_CANT_SELL_MORE_THAN\"), hyperObject.getStock(), name), hyperObject);\r\n \t\t\t\t\t\t\treturn response;\t\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t} else {\r\n \t\t\t\t\t\tresponse.addFailed(L.f(L.get(\"YOU_DONT_HAVE_ENOUGH\"), name), hyperObject);\r\n \t\t\t\t\t\treturn response;\t\r\n \t\t\t\t\t}\r\n \t\t\t\t} else {\r\n \t\t\t\t\tresponse.addFailed(L.f(L.get(\"CANNOT_BE_SOLD_WITH\"), name), hyperObject);\r\n \t\t\t\t\treturn response;\t\r\n \t\t\t\t}\r\n \t\t\t} else {\r\n \t\t\t\tresponse.addFailed(L.f(L.get(\"CANT_SELL_LESS_THAN_ONE\"), name), hyperObject);\r\n \t\t\t\treturn response;\t\r\n \t\t\t}\r\n \t\t} catch (Exception e) {\r\n \t\t\tString info = \"Transaction sell() passed values name='\" + hyperObject.getName() + \"', player='\" + hp.getName() + \"', id='\" + hyperObject.getId() + \"', data='\" + hyperObject.getData() + \"', amount='\" + amount + \"'\";\r\n \t\t\tnew HyperError(e, info);\r\n \t\t\treturn new TransactionResponse(hp);\r\n \t\t}\r\n \t}", "private void tradeCommand(){\n out.println(\"\\r\\nShares you own:\" +\n \"\\r\\nApple: \" + player.getShares().get(0) +\n \"\\r\\nBP: \" + player.getShares().get(1) +\n \"\\r\\nCisco: \" + player.getShares().get(2) +\n \"\\r\\nDell: \" + player.getShares().get(3) +\n \"\\r\\nEricsson: \" + player.getShares().get(4) +\n \"\\r\\n\\r\\nShare prices: Apple-\" + game.apple.getSharePrice() +\n \", BP-\" + game.bp.getSharePrice() +\n \", Cisco-\" + game.cisco.getSharePrice() +\n \", Dell-\" + game.dell.getSharePrice() +\n \", Ericsson-\" + game.ericsson.getSharePrice() +\n \"\\r\\n\\r\\nFunds: £\" + player.getFunds() + \", Current value of shares: £\" + getTotalShareValue(player) + \"\\r\\n\"\n );\n\n out.println(\"Would you like to buy(b) or sell(s) shares? Enter 'X' to exit.\");\n String bsInput = in.nextLine().trim();\n if (bsInput.toUpperCase().equals(\"B\")){\n getTradeParam(1); //buy\n }else if (bsInput.toUpperCase().equals(\"S\")){\n getTradeParam(0); //sell\n }else if (bsInput.toUpperCase().equals(\"X\")){\n command();\n }else{\n out.println(\"Invalid input\");\n tradeCommand();\n }\n }", "public TransactionResponse sellToInventory() {\r\n \t\tTransactionResponse response = new TransactionResponse(hp);\r\n \t\ttry {\r\n \t\t\tDataHandler sf = hc.getDataFunctions();\r\n \t\t\tCalculation calc = hc.getCalculation();\r\n \t\t\tAccount acc = hc.getAccount();\r\n \t\t\tLog log = hc.getLog();\r\n \t\t\tLanguageFile L = hc.getLanguageFile();\r\n \t\t\tString playerecon = tradePartner.getEconomy();\r\n \t\t\tdouble price = 0.0;\r\n \t\t\tif (setPrice) {\r\n \t\t\t\tprice = money;\r\n \t\t\t} else {\r\n \t\t\t\tprice = hyperObject.getValue(amount, hp);\r\n \t\t\t}\r\n \t\t\tBoolean toomuch = false;\r\n \t\t\tif (price == 3235624645000.7) {\r\n \t\t\t\ttoomuch = true;\r\n \t\t\t}\r\n \t\t\tif (!toomuch) {\r\n \t\t\t\tim.removeItems(hyperObject.getId(), hyperObject.getData(), amount, hp.getPlayer().getInventory());\r\n \t\t\t\tim.addItems(amount, hyperObject.getId(), hyperObject.getData(), receiveInventory);\r\n \t\t\t\tacc.deposit(price, hp.getPlayer());\r\n \t\t\t\tacc.withdrawAccount(price, tradePartner.getName());\r\n \t\t\t\tresponse.addSuccess(L.f(L.get(\"SELL_CHEST_MESSAGE\"), amount, calc.twoDecimals(price), hyperObject.getName(), tradePartner.getName()), calc.twoDecimals(price), hyperObject);\r\n \t\t\t\tresponse.setSuccessful();\r\n \t\t\t\tlog.writeSQLLog(hp.getName(), \"sale\", hyperObject.getName(), (double) amount, calc.twoDecimals(price), 0.0, tradePartner.getName(), \"chestshop\");\r\n \t\t\t\ttradePartner.sendMessage(L.f(L.get(\"CHEST_SELL_NOTIFICATION\"), amount, calc.twoDecimals(price), hyperObject.getName(), hp.getPlayer()));\r\n \t\t\t} else {\r\n \t\t\t\tresponse.addFailed(L.f(L.get(\"CURRENTLY_CANT_SELL_MORE_THAN\"), sf.getHyperObject(hyperObject.getName(), playerecon).getStock(), 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 = \"Transaction sellChest() passed values name='\" + hyperObject.getName() + \"', player='\" + hp.getName() + \"', owner='\" + tradePartner.getName() + \"', amount='\" + amount + \"'\";\r\n \t\t\tnew HyperError(e, info);\r\n \t\t\treturn new TransactionResponse(hp);\r\n \t\t}\r\n \t}", "public static String requestTransfer(Player player, Team playersTeam, double bid, Library library, TransferList existingTransfers) {\n\t\tif (playersTeam.isMax()) {\n\t\t\treturn \"You already have 30 players in your team, this is the maximum. Sell some players before trying to buy any new!\";\n\t\t} else {\n\t\tif (existingTransfers.getTransfer(player)==null) {\n\t\t\tboolean answer = TransferLogic.getAnswer(player, bid, library, existingTransfers);\n\t\t\tif (answer) {\n\t\t\t\tTeam opponentsTeam = library.getTeamForName(player.getTeam());\n\t\t\t\topponentsTeam.deleteIfInCurrentTeam(player);\n//\t\t\t\tif (opponentsTeam.getPositions().contains(player)) {\n//\t\t\t\t\t\n//\t\t\t\t\tboolean itsdone=false;\n//\t\t\t\t\tfor (int i=0;i<opponentsTeam.getTeam().size();i++) {\n//\t\t\t\t\t\tif (!itsdone) {\n//\t\t\t\t\t\t\tPlayer p = opponentsTeam.getTeam().get(i);\n//\t\t\t\t\t\t\tif (p.getPlayerType().equals(player.getPlayerType()) && !(opponentsTeam.getPositions().contains(p))) {\n//\t\t\t\t\t\t\t\topponentsTeam.replacePlayerInCurrentTeam(player, p);\n//\t\t\t\t\t\t\t\titsdone=true;\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t}\n//\t\t\t\t\t}\n//\t\t\t\t\tif (!itsdone) {\n//\t\t\t\t\t\tfor (int i=0;i<opponentsTeam.getTeam().size();i++) {\n//\t\t\t\t\t\t\tif (!itsdone) {\n//\t\t\t\t\t\t\t\tPlayer p = opponentsTeam.getTeam().get(i);\n//\t\t\t\t\t\t\t\tif (((p instanceof FieldPlayer && player instanceof FieldPlayer) || (p instanceof Goalkeeper && player instanceof Goalkeeper)) && !(opponentsTeam.getPositions().contains(p))) {\n//\t\t\t\t\t\t\t\t\topponentsTeam.replacePlayerInCurrentTeam(player, p);\n//\t\t\t\t\t\t\t\t\titsdone=true;\n//\t\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t}\n//\t\t\t\t\t}\n//\t\t\t\t\t\n//\t\t\t\t\t\n//\t\t\t\t}\n\t\t\t\t\n\t\t\t\tplayersTeam.add(player);\n\t\t\t\topponentsTeam.getTeam().remove(player);\n\t\t\t\tplayer.setTeam(playersTeam.getTeamName());\n\t\t\t\tplayersTeam.setBudget(playersTeam.getBudget()-bid);\n\t\t\t\topponentsTeam.setBudget(opponentsTeam.getBudget()+bid);\n\t\t\t\tBigDecimal bbid = new BigDecimal(bid);\n\t\t\t\t\n\t\t\t\t//price string\n\t\t\t\t\n\t\t\t\tDecimalFormat formatter = (DecimalFormat) NumberFormat.getInstance(Locale.US);\n\t\t\t\tbbid = bbid.setScale(2, BigDecimal.ROUND_DOWN);\n\t\t\t\tDecimalFormat df = new DecimalFormat();\n\t\t\t\tdf.setGroupingUsed(false);\t\t\n\t\t\t\tString priceString = formatter.format(bbid.longValue());\n\t\t\t\t\n\t\t\t\t\n\t\t\t\treturn \"Congratulations! Your bid of \" + priceString + \" got accepted and \" + player.getName() + \" is now part of your team\";\n\t\t\t} else {\n\t\t\t\tdouble percentage = bid/player.getPrice().doubleValue()*100-100;\n\t\t\t\tdouble returnedprice=0;\n\t\t\t\tdouble price = player.getPrice().doubleValue();\n\t\t\t\tif (percentage<-10) {\n\t\t\t\t\treturnedprice=0.9*price;\n\t\t\t\t} if (percentage>=-10 && percentage<0) {\n\t\t\t\t\treturnedprice=price;\n\t\t\t\t} if (percentage>=0 && percentage<5) {\n\t\t\t\t\treturnedprice=1.05*price;\n\t\t\t\t} if (percentage>=5 && percentage<10) {\n\t\t\t\t\treturnedprice=1.1*price;\n\t\t\t\t} if (percentage>=10 && percentage<15) {\n\t\t\t\t\treturnedprice=1.15*price;\n\t\t\t\t} if (percentage>=15 && percentage<20) {\n\t\t\t\t\treturnedprice=1.2*price;\n\t\t\t\t} if (percentage>=20 && percentage<25) {\n\t\t\t\t\treturnedprice=1.25*price;\n\t\t\t\t} if (percentage>=25 && percentage<30) {\n\t\t\t\t\treturnedprice=1.3*price;\n\t\t\t\t} \n\t\t\t\t\n\t\t\t\tTransferInProgress tp = new TransferInProgress(player, returnedprice, bid);\n\t\t\t\texistingTransfers.addTransfer(tp);\n\t\t\t\tBigDecimal bbid = new BigDecimal(bid);\n\t\t\t\tBigDecimal breturnedprice = new BigDecimal(returnedprice);\n\t\t\t\t//price string\n\t\t\t\t\n\t\t\t\tDecimalFormat formatter = (DecimalFormat) NumberFormat.getInstance(Locale.US);\n\t\t\t\tbbid = bbid.setScale(2, BigDecimal.ROUND_DOWN);\n\t\t\t\tbreturnedprice = breturnedprice.setScale(2, BigDecimal.ROUND_DOWN);\n\t\t\t\tDecimalFormat df = new DecimalFormat();\n\t\t\t\tdf.setGroupingUsed(false);\t\t\n\t\t\t\tString priceString = formatter.format(bbid.longValue());\n\t\t\t\tString priceString2 = formatter.format(breturnedprice.longValue());\n\t\t\t\treturn player.getTeam() + \" did not accept your offer of \" + priceString + \" for \" + player.getName() + \". They have indicated they want at least \" + priceString2 + \" for this player\";\n\t\t\t\t\n\t\t\t}\n\t\t} else {\n\t\t\tTransferInProgress tp = existingTransfers.getTransfer(player);\n\t\t\tboolean answer = TransferLogic.getAnswerForExistingTransfer(player, bid, library, existingTransfers, tp.getPriceReturned());\n\t\t\tif (answer) {\n\t\t\t\tTeam opponentsTeam = library.getTeamForName(player.getTeam());\n\t\t\t\topponentsTeam.deleteIfInCurrentTeam(player);\n//\t\t\t\tif (opponentsTeam.getPositions().contains(player)) {\n//\t\t\t\t\tboolean itsdone=false;\n//\t\t\t\t\tfor (int i=0;i<opponentsTeam.getTeam().size();i++) {\n//\t\t\t\t\t\tif (!itsdone) {\n//\t\t\t\t\t\t\tPlayer p = opponentsTeam.getTeam().get(i);\n//\t\t\t\t\t\t\tif (p.getPlayerType().equals(player.getPlayerType()) && !(opponentsTeam.getPositions().contains(p))) {\n//\t\t\t\t\t\t\t\topponentsTeam.replacePlayerInCurrentTeam(player, p);\n//\t\t\t\t\t\t\t\titsdone=true;\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t}\n//\t\t\t\t\t}\n//\t\t\t\t\tif (!itsdone) {\n//\t\t\t\t\t\tfor (int i=0;i<opponentsTeam.getTeam().size();i++) {\n//\t\t\t\t\t\t\tif (!itsdone) {\n//\t\t\t\t\t\t\t\tPlayer p = opponentsTeam.getTeam().get(i);\n//\t\t\t\t\t\t\t\tif (((p instanceof FieldPlayer && player instanceof FieldPlayer) || (p instanceof Goalkeeper && player instanceof Goalkeeper)) && !(opponentsTeam.getPositions().contains(p))) {\n//\t\t\t\t\t\t\t\t\topponentsTeam.replacePlayerInCurrentTeam(player, p);\n//\t\t\t\t\t\t\t\t\titsdone=true;\n//\t\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t}\n//\t\t\t\t\t}\n//\t\t\t\t\t\n//\t\t\t\t\t\n//\t\t\t\t}\n\t\t\t\t\n\t\t\t\tplayersTeam.add(player);\n\t\t\t\topponentsTeam.getTeam().remove(player);\n\t\t\t\tplayer.setTeam(playersTeam.getTeamName());\n\t\t\t\texistingTransfers.getTransfers().remove(tp);\n\t\t\t\tplayersTeam.setBudget(playersTeam.getBudget()-bid);\n\t\t\t\topponentsTeam.setBudget(opponentsTeam.getBudget()+bid);\n\t\t\t\tBigDecimal bbid = new BigDecimal(bid);\n\t\t\t\t//price string\n\t\t\t\t\n\t\t\t\tDecimalFormat formatter = (DecimalFormat) NumberFormat.getInstance(Locale.US);\n\t\t\t\tbbid = bbid.setScale(2, BigDecimal.ROUND_DOWN);\n\t\t\t\tDecimalFormat df = new DecimalFormat();\n\t\t\t\tdf.setGroupingUsed(false);\t\t\n\t\t\t\tString priceString = formatter.format(bbid.longValue());\n\t\t\t\treturn \"Congratulations! Your bid of \" + priceString + \" got accepted and \" + player.getName() + \" is now part of your team\";\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tdouble pricereturned = existingTransfers.getTransfer(player).getPriceReturned();\n\t\t\t\t\n\t\t\t\tif (bid>pricereturned) {\n\t\t\t\t\tdouble percentage = bid/player.getPrice().doubleValue()*100-100;\n\t\t\t\t\tdouble returnedprice=0;\n\t\t\t\t\tdouble price = player.getPrice().doubleValue();\n\t\t\t\t\tif (percentage<-10) {\n\t\t\t\t\t\treturnedprice=0.9*price;\n\t\t\t\t\t} if (percentage>=-10 && percentage<0) {\n\t\t\t\t\t\treturnedprice=price;\n\t\t\t\t\t} if (percentage>=0 && percentage<5) {\n\t\t\t\t\t\treturnedprice=1.05*price;\n\t\t\t\t\t} if (percentage>=5 && percentage<10) {\n\t\t\t\t\t\treturnedprice=1.1*price;\n\t\t\t\t\t} if (percentage>=10 && percentage<15) {\n\t\t\t\t\t\treturnedprice=1.15*price;\n\t\t\t\t\t} if (percentage>=15 && percentage<20) {\n\t\t\t\t\t\treturnedprice=1.2*price;\n\t\t\t\t\t} if (percentage>=20 && percentage<25) {\n\t\t\t\t\t\treturnedprice=1.25*price;\n\t\t\t\t\t} if (percentage>=25 && percentage<30) {\n\t\t\t\t\t\treturnedprice=1.3*price;\n\t\t\t\t\t}\n\t\t\t\t\texistingTransfers.getTransfer(player).setPriceReturned(returnedprice);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\texistingTransfers.getTransfer(player).setBid(bid);\n\t\t\t\tBigDecimal bbid = new BigDecimal (bid);\n\t\t\t\tBigDecimal bpriceReturned = new BigDecimal(existingTransfers.getTransfer(player).getPriceReturned());\n\t\t\t\t//price string\n\t\t\t\t\n\t\t\t\tDecimalFormat formatter = (DecimalFormat) NumberFormat.getInstance(Locale.US);\n\t\t\t\tbbid = bbid.setScale(2, BigDecimal.ROUND_DOWN);\n\t\t\t\tbpriceReturned = bpriceReturned.setScale(2, BigDecimal.ROUND_DOWN);\n\t\t\t\tDecimalFormat df = new DecimalFormat();\n\t\t\t\tdf.setGroupingUsed(false);\t\t\n\t\t\t\tString priceString = formatter.format(bbid.longValue());\n\t\t\t\tString priceString2 = formatter.format(bpriceReturned.longValue());\n\t\t\t\treturn player.getTeam() + \" did not accept your offer of \" + priceString + \" for \" + player.getName() + \". They have indicated they want at least \" + priceString2 + \" for this player\";\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}}", "public void trade(Player player, Type type, int[] trade) {\n \t\taddResources(type, 1);\n \t\tplayer.useResources(type, 1);\n \n \t\tfor (int i = 0; i < Hexagon.TYPES.length; i++) {\n \t\t\tif (trade[i] <= 0)\n \t\t\t\tcontinue;\n \n \t\t\tuseResources(Hexagon.TYPES[i], trade[i]);\n \t\t\tplayer.addResources(Hexagon.TYPES[i], trade[i]);\n \n \t\t\tfor (int j = 0; j < trade[i]; j++) {\n \t\t\t\tappendAction(R.string.player_traded_away, Hexagon\n \t\t\t\t\t\t.getTypeStringResource(Hexagon.TYPES[i]));\n \t\t\t}\n \t\t}\n \n \t\tappendAction(R.string.player_traded_with, player.getName());\n \t\tappendAction(R.string.player_got_resource, Hexagon\n \t\t\t\t.getTypeStringResource(type));\n \t}", "@Override\n protected void acceptTrade(Territory offerer, double demand, int typeDemand, double offer, int typeOffer){\n // An example for accepting a trade proposal: I only accept offers of peasants when I have less than 3 peasants\n // I am not checking what I am giving in exchange or how much, so you should work on that\n if (typeOffer == 3 && typeDemand == 2){\n acceptTrade = true;// no matter the amounts\n }\n else acceptTrade = false;\n }", "private void botBuy(Stock stock, int numShares){\n player.getShares().set(game.getIndex(stock), player.getShares().get(game.getIndex(stock)) + numShares);\n player.setFunds(-numShares*(stock.getSharePrice()+3));\n System.out.println(\"purchase made\"); //rem\n }", "public abstract void performPurchase(Player player);", "@Override\r\n\tpublic void onTrade(Trade trade) throws Exception {\n\t\t\r\n\t}", "void tradePokemon(Long pokemonId1, Long pokemonId2);", "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 }", "void acceptTrade(boolean accept);", "public void logTrade(String player1, String player2) {\n\t\ttry {\n\n\t\t\tDateFormat df = new SimpleDateFormat(\"'On' MM/dd/yyyy 'at' HH:mm:ss\");\n\t\t\tDate d = new Date();\n\t\t\tBufferedWriter log = new BufferedWriter(new FileWriter(Data.TRADE_LOG, true));\n\n\t\t\ttry {\n\t\t\t\tlog.write(df.format(d) + \", \" + player1 + \" and \" + player2 + \" traded with each other.\");\n\n\t\t\t\tlog.newLine();\n\t\t\t\tlog.newLine();\n\n\t\t\t\tlog.write(player1 + \"'s offer was: \");\n\t\t\t\tfor (int i = 0; i < ClickingButtons.ids1.size(); i++) {\n\t\t\t\t\tlog.write(ClickingButtons.amounts1.get(i) + \"x \"\n\t\t\t\t\t\t\t+ c.getItems().getItemName(ClickingButtons.ids1.get(i)) + \", \");\n\t\t\t\t}\n\n\t\t\t\tlog.newLine();\n\t\t\t\tlog.newLine();\n\n\t\t\t\tlog.write(player2 + \"'s offer was: \");\n\t\t\t\tfor (int i = 0; i < ClickingButtons.ids2.size(); i++) {\n\t\t\t\t\tlog.write(ClickingButtons.amounts2.get(i) + \"x \"\n\t\t\t\t\t\t\t+ c.getItems().getItemName(ClickingButtons.ids2.get(i)) + \", \");\n\n\t\t\t\t}\n\n\t\t\t\tlog.newLine();\n\n\t\t\t} finally {\n\t\t\t\tlog.newLine();\n\t\t\t\tlog.newLine();\n\t\t\t\tlog.newLine();\n\t\t\t\tlog.close();\n\n\t\t\t\tClickingButtons.ids1.clear();\n\t\t\t\tClickingButtons.ids2.clear();\n\t\t\t\tClickingButtons.amounts1.clear();\n\t\t\t\tClickingButtons.amounts2.clear();\n\t\t\t}\n\n\t\t} catch (IOException ioe) {\n\t\t\tioe.printStackTrace();\n\t\t}\n\t}", "public void establishDealOffer() {\n DealOffer offer = new DealOffer();\n \n int moneyToOffer = (Integer)this.playersMoneyMap.get(currentPlayer).getValue();\n offer.offerCash(moneyToOffer);\n \n Map<JCheckBox, Space> thisPlayerMap = playersCheckBoxes.get(currentPlayer);\n if (thisPlayerMap != null) {\n for (JCheckBox checkBox : thisPlayerMap.keySet()) {\n if (checkBox.isSelected()) {\n offer.addPropertyToOffer(thisPlayerMap.get(checkBox));\n }\n }\n }\n \n int moneyToRequest = (Integer)this.playersMoneyMap.get(playerToOfferTo).getValue();\n offer.requestCash(moneyToRequest);\n \n Map<JCheckBox, Space> otherPlayerMap = playersCheckBoxes.get(playerToOfferTo);\n if (otherPlayerMap != null) {\n for (JCheckBox checkBox : otherPlayerMap.keySet()) {\n if (checkBox.isSelected()) {\n offer.addPropertyToRequest(otherPlayerMap.get(checkBox));\n }\n }\n }\n this.dealOffer = offer;\n \n }", "public void onTradeRequest(String name)\n {\n\t\tif(traded_ammount > 0)\n\t\t{\n\t\t\ttraded_ammount = 0;\n\t\t\ttime = System.currentTimeMillis();\n\t\t}\n\t\tint[] player = getPlayerByName(name);\n\t\tint player_id = getPlayerPID(player[0]);\n\t\tsendTradeRequest(player_id);\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}", "void confirmRealWorldTrade(IUserAccount user, ITransaction trans);", "@Override\n public void offerTrade(IResourceBank offer, int recipientPlayerIndex) throws ModelException {\n IPlayer p = GameModelFacade.instance().getLocalPlayer();\n\n if (!p.canAfford(offer) || !GameModelFacade.instance().localPlayerIsPlaying() || !offer.containsResources()) {\n throw new ModelException(\"Preconditions for action not met.\");\n }\n\n try {\n String clientModel = m_theProxy.offerTrade(p.getIndex(), offer, recipientPlayerIndex);\n new ModelInitializer().initializeClientModel(clientModel, m_theProxy.getPlayerId());\n } catch (NetworkException e) {\n throw new ModelException(e);\n }\n }", "private boolean willComputerTrade(LinkedList<Card> initiatorTradeItems, LinkedList<Card> otherPlayerTradeItems, Player otherPlayer) {\n\t\tint tradeValue = 0;\n\t\tfor (Card item : initiatorTradeItems)\n\t\t\ttradeValue += AICardEvaluator.getCardValueToPlayer(item, otherPlayer, otherPlayer.getHandCards());\n\t\tfor (Card item : otherPlayerTradeItems)\n\t\t\ttradeValue -= AICardEvaluator.getCardValueToPlayer(item, otherPlayer, otherPlayer.getHandCards());\n\t\t\n\t\t// factor in initiator rank and trade value, depending on other player's computer level\n\t\tif (otherPlayer.getPlayerType() == PlayerType.COMPUTER_MEDIUM) {\n\t\t\tint initiatorTradeValue = 0;\n\t\t\tfor (Card item : otherPlayerTradeItems)\n\t\t\t\tinitiatorTradeValue += AICardEvaluator.getCardValueToPlayer(item, initiator, null);\n\t\t\tfor (Card item : initiatorTradeItems)\n\t\t\t\tinitiatorTradeValue -= AICardEvaluator.getCardValueToPlayer(item, initiator, null);\n\t\t\ttradeValue -= initiatorTradeValue;\n\t\t}\n\t\telse if (otherPlayer.getPlayerType() == PlayerType.COMPUTER_HARD) {\n\t\t\tdouble playerFactor = GM.getPlayers().size() - AIManager.getRankedPlayers().indexOf(initiator);\n\t\t\tplayerFactor /= (double)GM.getPlayers().size();\n\t\t\tplayerFactor *= 2.0;\n\t\t\tint initiatorTradeValue = 0;\n\t\t\tfor (Card item : otherPlayerTradeItems)\n\t\t\t\tinitiatorTradeValue += AICardEvaluator.getCardValueToPlayer(item, initiator, null);\n\t\t\tfor (Card item : initiatorTradeItems)\n\t\t\t\tinitiatorTradeValue -= AICardEvaluator.getCardValueToPlayer(item, initiator, null);\n\t\t\ttradeValue -= initiatorTradeValue * playerFactor;\n\t\t}\n\t\t\n\t\treturn (tradeValue >= 0);\n\t}", "public void trade(Drop myDrop, User receiver) {\n getInventory().removeDrop(myDrop);\n receiver.getInventory().addDrop(myDrop);\n }", "void addTrade(Trade trade);", "public void doLogicBuy() {\n\t\tif (!player.isHuman) {\n\t\t\tif (player.money > estimatedFee * 1.5) //\n\t\t\t{\n\t\t\t\tint free = (int) (player.money - estimatedFee * 1.5);\n\t\t\t\tCell c = board.getCells().get(player.position);\n\t\t\t\tif (c instanceof TradeableCell) {\n\t\t\t\t\tTradeableCell tc = (TradeableCell) c;\n\t\t\t\t\tif (tc.getOwner() == null && tc.getPrice() < free) {\n\t\t\t\t\t\ttc.buy(player);\n\t\t\t\t\t\tboard.addMessage(\"Just bought\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public TradeItemsDialog(GUI gui, Player player) {\n\t\tsuper(gui, \"Trade Items\");\n\t\t\n\t\t// initialize variables and display GUI controls\n\t\tinitiator = player;\n\t\t\t\t\n\t\tloadPlayerPanel(initiator);\n\t\t\n\t\tc.gridx = 1;\n\t\tc.gridy = 1;\n\t\t// Load list of other players into a drop down box.\n\t\tLinkedList<Player> players = new LinkedList<Player>();\n\t\tplayers.addAll(GM.getPlayers());\n\t\tplayers.remove(initiator);\n\t\tfinal JComboBox playerBox = new JComboBox(players.toArray());\n\t\tplayerBox.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(Color.BLACK), \"Trade With\"));\n\t\tplayerBox.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\t// display selected player's items for trade\n\t\t\t\tloadPlayerPanel((Player)playerBox.getSelectedItem());\n\t\t\t}\t\n\t\t});\n\t\tgetContentPane().add(playerBox, c);\n\t\tplayerBox.setSelectedIndex(0);\n\t\t\n\t\tc.gridx = 1;\n\t\tc.gridy = 2;\n\t\t// allows player to request a trade of the selected items\n\t\tCustomButton tradeButton = new CustomButton(\"Trade\") {\n\t\t\tprivate static final long serialVersionUID = 1L;\n\t\t\t\n\t\t\tpublic void buttonPressed() {\n\t\t\t\tPlayer otherPlayer = (Player)playerBox.getSelectedItem();\n\t\t\t\tLinkedList<Card> initiatorCheckedItems = initiatorPanel.getCheckedCards();\n\t\t\t\tLinkedList<Card> otherPlayerCheckedItems = otherPlayerPanel.getCheckedCards();\n\t\t\t\t\n\t\t\t\tif (initiatorCheckedItems.isEmpty() && otherPlayerCheckedItems.isEmpty())\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\tif (otherPlayer.isComputer()) {\n\t\t\t\t\tif (!willComputerTrade(initiatorCheckedItems, otherPlayerCheckedItems, otherPlayer)) {\n\t\t\t\t\t\tif (!initiator.isComputer()) {\n\t\t\t\t\t\t\tString message = otherPlayer.toString();\n\t\t\t\t\t\t\tif (otherPlayer.getPlayerType() == PlayerType.COMPUTER_EASY)\n\t\t\t\t\t\t\t\tmessage += \" politely declines your offer.\";\n\t\t\t\t\t\t\telse if (otherPlayer.getPlayerType() == PlayerType.COMPUTER_MEDIUM)\n\t\t\t\t\t\t\t\tmessage += \" feels that this trade is not in his best interests.\";\n\t\t\t\t\t\t\telse if (otherPlayer.getPlayerType() == PlayerType.COMPUTER_HARD)\n\t\t\t\t\t\t\t\tmessage += \" spits on your offer and tells you to go trade for some brains.\";\n\t\t\t\t\t\t\tMessenger.display(message, \"Trade Items\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\telse if (!initiator.isComputer()) {\n\t\t\t\t\t\tString message = otherPlayer.toString();\n\t\t\t\t\t\tif (otherPlayer.getPlayerType() == PlayerType.COMPUTER_EASY)\n\t\t\t\t\t\t\tmessage += \" gladly accepts your generous offer.\";\n\t\t\t\t\t\telse if (otherPlayer.getPlayerType() == PlayerType.COMPUTER_MEDIUM)\n\t\t\t\t\t\t\tmessage += \" decides the trade is acceptable.\";\n\t\t\t\t\t\telse if (otherPlayer.getPlayerType() == PlayerType.COMPUTER_HARD)\n\t\t\t\t\t\t\tmessage += \" laughs maniacally, greedily accepts, and whispers \\\"Sucker!\\\".\";\n\t\t\t\t\t\tMessenger.display(message, \"Trade Items\");\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\t\t\t\t\n\t\t\t\t\t// Allows other player to accept or decline the trade\n\t\t\t\t\tString prompt = otherPlayer.getName() + \", do you accept this trade?\";\n\t\t\t\t\tint result = JOptionPane.showConfirmDialog(null, prompt, \"Trade Items\", JOptionPane.YES_NO_OPTION);\n\t\t\t\t\tif (result != JOptionPane.YES_OPTION)\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Takes cards from each player and gives them to the other.\n\t\t\t\tIterator<Card> itemIter = initiatorCheckedItems.iterator();\n\t\t\t\twhile (itemIter.hasNext()) {\n\t\t\t\t\tCard item = itemIter.next();\n\t\t\t\t\tif (!initiator.removeEquipmentItem(item))\n\t\t\t\t\t\tinitiator.getCarriedItems().remove(item);\t\t\t\t\t\t\n\t\t\t\t\tif (initiator.isCheatingItem(item))\n\t\t\t\t\t\tinitiator.removeCheat();\n\t\t\t\t\t\n\t\t\t\t\totherPlayer.addItem((TreasureCard)item);\n\t\t\t\t}\n\t\t\t\titemIter = otherPlayerCheckedItems.iterator();\n\t\t\t\twhile (itemIter.hasNext()) {\n\t\t\t\t\tCard item = itemIter.next();\n\t\t\t\t\tif (!otherPlayer.removeEquipmentItem(item))\n\t\t\t\t\t\totherPlayer.getCarriedItems().remove(item);\t\n\t\t\t\t\tif (otherPlayer.isCheatingItem(item))\n\t\t\t\t\t\totherPlayer.removeCheat();\n\t\t\t\t\t\n\t\t\t\t\tinitiator.addItem((TreasureCard)item);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tloadPlayerPanel(initiator);\n\t\t\t\tloadPlayerPanel(otherPlayer);\n\t\t\t}\n\t\t};\n\t\tgetContentPane().add(tradeButton, c);\n\t\t\t\t\n\t\tc.gridy = 3;\n\t\tc.gridx = 0;\n\t\tc.gridwidth = 3;\n\t\t// display warning about restrictions on Big Items\n\t\tgetContentPane().add(new JLabel(\"WARNING: If you trade for a Big Item that you cannot carry, it will be discarded!\"), c);\n\t\tc.gridwidth = 1;\n\t\t\n\t\trefresh();\n\t}", "public String offerTrade(OfferTrade offerTrade) throws Exception {\n\t\tString url = server_url + \"/moves/offerTrade\";\n\t\tURL obj = new URL(url);\n\t\tHttpURLConnection con = (HttpURLConnection) obj.openConnection();\n\n\t\t//add request header\n\t\tcon.setRequestMethod(\"POST\");\n\t\tcon.setRequestProperty(\"User-Agent\", \"Mozilla/5.0\");\n\t\tcon.setRequestProperty(\"Accept-Language\", \"en-US,en;q=0.5\");\n\t\tcon.setRequestProperty(\"Cookie\", usercookie + \"; \" + gamecookie);\n\t\t\n\t\tJsonObject info = new JsonObject();\n\t\tinfo.addProperty(\"type\",\"offerTrade\");\n\t\tinfo.addProperty(\"playerIndex\", offerTrade.playerIndex);\n\t\tinfo.addProperty(\"receiver\", offerTrade.receiverIndex);\n\t\t\n\t\tJsonObject offer = new JsonObject();\n\t\toffer.addProperty(\"wood\", offerTrade.wood);\n\t\toffer.addProperty(\"sheep\", offerTrade.sheep);\n\t\toffer.addProperty(\"ore\", offerTrade.ore);\n\t\toffer.addProperty(\"wheat\", offerTrade.wheat);\n\t\toffer.addProperty(\"brick\", offerTrade.brick);\n\t\tinfo.add(\"offer\", offer);\n\t\t\n\t\t// Send post request\n\t\tcon.setDoOutput(true);\n\t\tDataOutputStream wr = new DataOutputStream(con.getOutputStream());\n\t\twr.writeBytes(info.toString());\n\t\twr.flush();\n\t\twr.close();\n\n\t\tint responseCode = con.getResponseCode();\n\t\t//System.out.println(\"\\nSending 'POST' request to URL : \" + url);\n\t\t//System.out.println(\"Post parameters : \" + info.toString());\n\t\t//System.out.println(\"Response Code : \" + responseCode);\n\n\t\tif (responseCode == 400) {\n\t\t\tthrow new Exception();\n\t\t}\n\t\tBufferedReader in = new BufferedReader(\n\t\t new InputStreamReader(con.getInputStream()));\n\t\tString inputLine;\n\t\tStringBuffer response = new StringBuffer();\n\n\t\twhile ((inputLine = in.readLine()) != null) {\n\t\t\tresponse.append(inputLine);\n\t\t}\n\t\tin.close();\n\t\t\n\t\t//print result\n\t\t////System.out.println(response.toString());\n\t\treturn response.toString();\n\t}", "public boolean request() {\n\t\tif (inAnySession()) {\n\t\t\tplayer.exchangeSession.reset();\n\t\t\treturn false;\n\t\t}\n\t\t\n if (!PlayerRight.isDeveloper(player) && !PlayerRight.isDeveloper(other)) {\n if (player.playTime < 3000) {\n player.message(\"You cannot trade until you have 30 minutes of playtime. \" + Utility.getTime(3000 - player.playTime) + \" minutes remaining.\");\n return false;\n }\n if (other.playTime < 3000) {\n player.message(other.getName() + \" cannot trade until they have 30 minutes of playtime.\");\n return false;\n }\n }\n\t\t \n\t\tif (getSession(other).isPresent() && getSession(other).get().inAnySession()) {\n\t\t\tplayer.message(\"This player is currently is a \" + type.name + \" with another player.\");\n\t\t\treturn false;\n\t\t}\n\t\tif (Objects.equals(player, other)) {\n\t\t\tplayer.message(\"You cannot \" + type.name + \" with yourself.\");\n\t\t\treturn false;\n\t\t}\n if (PlayerRight.isIronman(player) && !PlayerRight.isDeveloper(other)) {\n player.message(\"You can not \" + type.name + \" as you are an iron man.\");\n return false;\n }\n if (PlayerRight.isIronman(other) && !PlayerRight.isDeveloper(player)) {\n player.message(other.getName() + \" can not be \" + type.name + \"d as they are an iron man.\");\n return false;\n }\n\t\tif (player.exchangeSession.requested_players.contains(other)) {\n\t\t\tplayer.message(\"You have already sent a request to this player.\");\n\t\t\treturn false;\n\t\t}\n\t\tif (player.locking.locked()) {\n\t\t\tplayer.message(\"You cannot send a \" + type.name + \" request right now.\");\n\t\t\treturn false;\n\t\t}\n\t\tif (other.locking.locked()) {\n\t\t\tplayer.message(other.getName() + \" is currently busy.\");\n\t\t\treturn false;\n\t\t}\n\t\tif (player.playerAssistant.busy()) {\n\t\t\tplayer.message(\"Please finish what you are doing before you do that.\");\n\t\t\treturn false;\n\t\t}\n\t\tif (other.playerAssistant.busy()) {\n\t\t\tplayer.message(other.getName() + \" is currently busy.\");\n\t\t\treturn false;\n\t\t}\n\t\tif (player.inActivity(ActivityType.DUEL_ARENA)) {\n\t\t\tplayer.message(\"You can not do that whilst in a duel!\");\n\t\t\treturn false;\n\t\t}\n\t\tif (other.inActivity(ActivityType.DUEL_ARENA)) {\n\t\t\tother.message(\"You can not do that whilst in a duel!\");\n\t\t\treturn false;\n\t\t}\n\t\tif (!onRequest()) {\n\t\t\treturn false;\n\t\t}\n\t\treturn SESSIONS.add(this);\n\t}", "@RequestMapping(value = \"tradeOffer\",method = RequestMethod.GET)\n public @ResponseBody BotResult tradeOffer(String steamId) throws IOException, ServiceException {\n int r = processOrderService.answer(steamId);\n switch (r){\n case 0:\n return new BotResult(true,\"发送报价成功\",null);\n case 1:\n return new BotResult(false,\"未找到您的订单\",null);\n default:\n return new BotResult(false,\"服务器未知错误,请联系客服\",null);\n }\n }", "public TransactionResponse buyEnchant() {\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 playerecon = hp.getEconomy();\r\n \t\t\tPlayer p = hp.getPlayer();\r\n \t\t\tString nenchant = hyperObject.getMaterial();\r\n \t\t\tEnchantment ench = Enchantment.getByName(nenchant);\r\n \t\t\tint shopstock = 0;\r\n \t\t\tshopstock = (int) hyperObject.getStock();\r\n \t\t\tif (shopstock >= 1) {\r\n \t\t\t\tString mater = p.getItemInHand().getType().toString();\r\n \t\t\t\tdouble price = hyperObject.getCost(EnchantmentClass.fromString(mater));\r\n \t\t\t\tprice = price + hyperObject.getPurchaseTax(price);\r\n \t\t\t\tif (price != 123456789) {\r\n \t\t\t\t\tif (!im.containsEnchantment(p.getItemInHand(), ench)) {\r\n \t\t\t\t\t\tif (acc.checkFunds(price, p)) {\r\n \t\t\t\t\t\t\tif (im.canAcceptEnchantment(p.getItemInHand(), ench) && p.getItemInHand().getAmount() == 1) {\r\n \t\t\t\t\t\t\t\thyperObject.setStock(shopstock - 1);\r\n \t\t\t\t\t\t\t\tacc.withdraw(price, p);\r\n \t\t\t\t\t\t\t\tacc.depositShop(price);\r\n \t\t\t\t\t\t\t\tif (hc.getYaml().getConfig().getBoolean(\"config.shop-has-unlimited-money\")) {\r\n \t\t\t\t\t\t\t\t\tString globalaccount = hc.getYaml().getConfig().getString(\"config.global-shop-account\");\r\n \t\t\t\t\t\t\t\t\tacc.setBalance(0, globalaccount);\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\tint l = hyperObject.getName().length();\r\n \t\t\t\t\t\t\t\tString lev = hyperObject.getName().substring(l - 1, l);\r\n \t\t\t\t\t\t\t\tint level = Integer.parseInt(lev);\r\n \t\t\t\t\t\t\t\tim.addEnchantment(p.getItemInHand(), ench, level);\r\n \t\t\t\t\t\t\t\tboolean stax;\r\n \t\t\t\t\t\t\t\tstax = Boolean.parseBoolean(hyperObject.getIsstatic());\r\n \t\t\t\t\t\t\t\tdouble taxrate;\r\n \t\t\t\t\t\t\t\tif (!stax) {\r\n \t\t\t\t\t\t\t\t\ttaxrate = hc.getYaml().getConfig().getDouble(\"config.enchanttaxpercent\");\r\n \t\t\t\t\t\t\t\t} else {\r\n \t\t\t\t\t\t\t\t\ttaxrate = hc.getYaml().getConfig().getDouble(\"config.statictaxpercent\");\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\tdouble taxpaid = price - (price / (1 + taxrate / 100));\r\n \t\t\t\t\t\t\t\ttaxpaid = calc.twoDecimals(taxpaid);\r\n \t\t\t\t\t\t\t\tprice = calc.twoDecimals(price);\r\n \t\t\t\t\t\t\t\tresponse.addSuccess(L.f(L.get(\"ENCHANTMENT_PURCHASE_MESSAGE\"), 1, price, hyperObject.getName(), calc.twoDecimals(taxpaid)), calc.twoDecimals(price), hyperObject);\r\n \t\t\t\t\t\t\t\tresponse.setSuccessful();\r\n \t\t\t\t\t\t\t\tString type = \"dynamic\";\r\n \t\t\t\t\t\t\t\tif (Boolean.parseBoolean(hyperObject.getInitiation())) {\r\n \t\t\t\t\t\t\t\t\ttype = \"initial\";\r\n \t\t\t\t\t\t\t\t} else if (Boolean.parseBoolean(hyperObject.getIsstatic())) {\r\n \t\t\t\t\t\t\t\t\ttype = \"static\";\r\n \t\t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t\tlog.writeSQLLog(p.getName(), \"purchase\", hyperObject.getName(), 1.0, price, taxpaid, playerecon, type);\r\n \r\n \t\t\t\t\t\t\t\tisign.updateSigns();\r\n \t\t\t\t\t\t\t\tnot.setNotify(hyperObject.getName(), mater, playerecon);\r\n \t\t\t\t\t\t\t\tnot.sendNotification();\r\n \t\t\t\t\t\t\t} else {\r\n \t\t\t\t\t\t\t\tresponse.addFailed(L.get(\"ITEM_CANT_ACCEPT_ENCHANTMENT\"), hyperObject);\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t} else {\r\n \t\t\t\t\t\t\tresponse.addFailed(L.get(\"INSUFFICIENT_FUNDS\"), hyperObject);\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t} else {\r\n \t\t\t\t\t\tresponse.addFailed(L.get(\"ITEM_ALREADY_HAS_ENCHANTMENT\"), hyperObject);\r\n \t\t\t\t\t}\r\n \t\t\t\t} else {\r\n \t\t\t\t\tresponse.addFailed(L.get(\"ITEM_CANT_ACCEPT_ENCHANTMENT\"), hyperObject);\r\n \t\t\t\t}\r\n \t\t\t} else {\r\n \t\t\t\tresponse.addFailed(L.f(L.get(\"THE_SHOP_DOESNT_HAVE_ENOUGH\"), 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 buyEnchant() 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}", "public boolean trade(Type type, int[] trade) {\n \t\t// validate trade\n \t\tif (!canTrade(type, trade))\n \t\t\treturn false;\n \n \t\t// check for 2:1 trader\n \t\tfor (int i = 0; i < trade.length; i++) {\n \t\t\tif (Hexagon.TYPES[i] == Type.DESERT)\n \t\t\t\tcontinue;\n \n \t\t\t// check for specific 2:1 trader\n \t\t\tif (hasTrader(Hexagon.TYPES[i])\n \t\t\t\t\t&& getResources(Hexagon.TYPES[i]) >= 2 && trade[i] >= 2) {\n \t\t\t\taddResources(type, 1);\n \t\t\t\tuseResources(Hexagon.TYPES[i], 2);\n \t\t\t\treturn true;\n \t\t\t}\n \t\t}\n \n \t\t// normal 4:1 or 3:1 trade\n \t\tint value = tradeValue;\n \t\tfor (int i = 0; i < trade.length; i++) {\n \t\t\tif (Hexagon.TYPES[i] == Type.DESERT)\n \t\t\t\tcontinue;\n \n \t\t\tint number = getResources(Hexagon.TYPES[i]);\n \n \t\t\t// deduct from number of resource cards needed\n \t\t\tif (trade[i] >= value && number >= value) {\n \t\t\t\tuseResources(Hexagon.TYPES[i], value);\n \t\t\t\taddResources(type, 1);\n \n \t\t\t\tappendAction(R.string.player_traded_for, Hexagon\n \t\t\t\t\t\t.getTypeStringResource(type));\n \n \t\t\t\tfor (int j = 0; j < value; j++) {\n \t\t\t\t\tappendAction(R.string.player_traded_away, Hexagon\n \t\t\t\t\t\t\t.getTypeStringResource(Hexagon.TYPES[i]));\n \t\t\t\t}\n \n \t\t\t\treturn true;\n \t\t\t} else if (trade[i] > 0 && number >= trade[i]) {\n \t\t\t\tuseResources(Hexagon.TYPES[i], trade[i]);\n \t\t\t\tvalue -= trade[i];\n \t\t\t}\n \t\t}\n \n \t\t// this shouldn't happen\n \t\treturn false;\n \t}", "private void trade_shortsell() {\n\t\ttext_code.setText(code);\n\t\t\n\t\tDecimalFormat df=new DecimalFormat(\"#.00\");\n\t\ttext_uprice.setText(df.format(Double.parseDouble(information[2])*1.1) );//涨停价\n\t\t\n\t\ttext_downprice.setText(df.format(Double.parseDouble(information[2])*0.9));//跌停价\n\t\t\n\t\t//getfundown().setText(homepage.get_table_userinfo().getItem(1).getText(1));//可用资金\n\t\t\n\t\t//double d1 = Double.parseDouble(homepage.get_table_userinfo().getItem(1).getText(1));\n\t\t//double d2 = Double.parseDouble(information[3]);\n\t\t//text_limitnum.setText(Integer.toString( (int)(d1/d2) ) );//可卖数量\n\t\t\n\n\t}", "public void buyIn(double buyingAmount) {\n if (bankroll > buyingAmount) {\n bankroll -= buyingAmount;\n activePlayer = true;\n }\n }", "public static void proposeTrade(League theLeague, Team theTeam, Scanner keyboard) {\r\n\t\tSystem.out.println(\"\");\r\n\t\tSystem.out.println(\"---Propose Trade---\");\r\n\t\tfor (int x = 0; x < theLeague.getNumTeams(); x++) {\r\n\t\t\tif (!theLeague.getTeam(x).equals(theTeam)) {\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t\tSystem.out.println(\"Team number: \" + (x + 1));\r\n\t\t\t\ttheLeague.getTeam(x).teamManNameToString();\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"\");\r\n\t\tSystem.out.println(\"Select a team to view:\");\r\n\t\t\r\n\t\tint otherTeamChoice;\r\n\t\tdo {\r\n\t\t\totherTeamChoice = Input.validInt(1, theLeague.getNumTeams(), keyboard) - 1;\r\n\t\t} while (otherTeamChoice == theLeague.getTeamList().indexOf(theTeam));\r\n\t\tTeam otherTeam = theLeague.getTeam(otherTeamChoice);\r\n\r\n\t\tSystem.out.println(\"\");\r\n\t\tSystem.out.println(\"---Propose Trade---\");\r\n\t\tSystem.out.println(\"\");\r\n\t\totherTeam.teamToString();\r\n\t\tSystem.out.println(\"\");\r\n\t\tSystem.out.println(\"Would you like to propose a trade to this team?\");\r\n\t\tSystem.out.println(\"1 - Yes\");\r\n\t\tSystem.out.println(\"2 - No, Return to Team Menu\");\r\n\t\t\r\n\t\tif (Input.validInt(1, 2, keyboard) == 1) {\r\n\t\t\tSystem.out.println(\"\");\r\n\t\t\tSystem.out.println(\"Enter your trade offer (max 64 characters):\");\r\n\t\t\tSystem.out.println(\"0 - Return to Team Menu\");\r\n\t\t\tString proposal = Input.validString(32, keyboard);\r\n\t\t\tif (proposal.equals(\"0\")) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\totherTeam.setProposedTrade(theTeam.getManagerName() + \": \" + proposal);\r\n\t\t\tSystem.out.println(\"\");\r\n\t\t\tSystem.out.println(\"***You have proposed a trade:***\");\r\n\t\t\tSystem.out.println(\"To \" + otherTeam.getManagerName() + \": \" + proposal);\r\n\t\t}\r\n\t}", "public void surrender() {\n playerCash += playerBet / 2;\n\n //Play dealer's turn\n dealerTurn();\n\n //End the game and change the views\n restartGame();\n }", "public static boolean getAnswer(Player player, double bid, Library library, TransferList existingTransfers) {\n\t\tTeam team = library.getTeamForName(player.getTeam());\n\t\tArrayList<Player> playerlist = new ArrayList<Player>();\n\t\tfor (int i=0;i<team.getTeam().size();i++) {\n\t\t\tif (player.getPlayerType().equals(team.getTeam().get(i).getPlayerType())) {\n\t\t\t\tplayerlist.add(team.getTeam().get(i));\n\t\t\t}\n\t\t}\n\t\tint[] ratings = new int[playerlist.size()];\n\t\tif(player.getPlayerType().equals(\"Attacker\")) {\n\t\t\tfor (int i=0;i<playerlist.size();i++) {\n\t\t\t\tFieldPlayer p = (FieldPlayer)playerlist.get(i);\n\t\t\t\tratings[i]= (int) (0.6*p.getFinishingValue() + 0.2*p.getDribblingValue() + 0.2*p.getStaminaValue());\n\t\t\t}\n\t\t} if (player.getPlayerType().equals(\"Midfielder\")) {\n\t\t\tfor (int i=0;i<playerlist.size();i++) {\n\t\t\t\tFieldPlayer p = (FieldPlayer)playerlist.get(i);\n\t\t\t\tratings[i]=(int) (0.15*p.getFinishingValue() + 0.4*p.getDribblingValue() + 0.3*p.getStaminaValue() + 0.15*p.getDefenseValue());\n\t\t\t\t\n\t\t\t}\n\t\t} if (player.getPlayerType().equals(\"Defender\")) {\n\t\t\tfor (int i=0;i<playerlist.size();i++) {\n\t\t\t\tFieldPlayer p = (FieldPlayer)playerlist.get(i);\n\t\t\t\tratings[i]=(int) (0.05*p.getDribblingValue() + 0.25*p.getStaminaValue() + 0.7*p.getDefenseValue());\n\t\t\t\t\n\t\t\t}\n\t\t} if (player.getPlayerType().equals(\"Goalkeeper\")) {\n\t\t\tfor (int i=0;i<playerlist.size();i++) {\n\t\t\t\tGoalkeeper p = (Goalkeeper)playerlist.get(i);\n\t\t\t\tratings[i]=p.getGoalkeeperValue();\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (playerlist.size()==1) {\n\t\t\t\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tint playerid=playerlist.indexOf(player);\n\t\tint typecounter=1;\n\t\tfor (int i=0;i<ratings.length;i++) {\n\t\t\tif (i==playerid) {\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tif (ratings[playerid]<ratings[i]) {\n\t\t\t\t\ttypecounter++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tint random = GameLogic.randomGenerator(1, 100);\n\t\tdouble percentage = bid/player.getPrice().doubleValue()*100-100;\n\t\tif (typecounter==1||typecounter==2) {\n\t\t\tif(percentage<0) {\n\t\t\t\treturn false;\n\t\t\t\t\n\t\t\t} if (percentage>=0 && percentage<5) {\n\t\t\t\tif (random<=10) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else return false;\n\t\t\t\t\n\t\t\t\t\n\t\t\t} if (percentage>=5 && percentage<10) {\n\t\t\t\tif (random<=20) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else return false;\n\t\t\t} if (percentage>=10 && percentage<15) {\n\t\t\t\tif (random<=30) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else return false;\n\t\t\t} if (percentage>=15 && percentage<20) {\n\t\t\t\tif (random<=40) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else return false;\n\t\t\t} if (percentage>=20 && percentage<25) {\n\t\t\t\tif (random<=50) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else return false;\n\t\t\t} if (percentage>=25 && percentage<30) {\n\t\t\t\tif (random<=75) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else return false;\n\t\t\t} else return true;\n\t\t} if (typecounter==3 || typecounter==4 || typecounter==5) {\n\t\t\tif (percentage<-10) {\n\t\t\t\treturn false;\n\t\t\t} if (percentage>=-10 && percentage<0) {\n\t\t\t\tif (random<=5) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else return false;\n\t\t\t} if (percentage>=0 && percentage <5) {\n\t\t\t\tif (random<=15) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else return false;\n\t\t\t} if (percentage>=5 && percentage<10) {\n\t\t\t\tif (random<=30) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else return false;\n\t\t\t} if (percentage>=10 && percentage<15) {\n\t\t\t\tif (random<=45) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else return false;\n\t\t\t} if (percentage>=15 && percentage<20) {\n\t\t\t\tif (random<=60) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else return false;\n\t\t\t} if (percentage>=20 && percentage<25) {\n\t\t\t\tif (random<=80) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else return false;\n\t\t\t} else return true;\n\t\t} else {\n\t\t\tif (percentage<-10) {\n\t\t\t\treturn false;\n\t\t\t} if (percentage>=-10 && percentage<0) {\n\t\t\t\tif (random<=20) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else return false;\n\t\t\t} if (percentage>=0 && percentage<5) {\n\t\t\t\tif (random<=45) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else return false;\n\t\t\t} if (percentage>=5 && percentage<10) {\n\t\t\t\tif (random<=70) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else return false;\n\t\t\t} if (percentage>=10 && percentage<15) {\n\t\t\t\tif (random<=85) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else return false;\n\t\t\t} else return true;\n\t\t}\n\t\t\n\t\t\n\t}", "TradeItem createTradeItem(Account proposer, Flippo proposerFlippo, Account receiver, Flippo receiverFlippo);", "Trade matchOrder(List<Order> buyList, List<Order> sellList) throws \n OrderBookOrderException, OrderBookTradeException;", "public void trade(CheeseConnoisseur c) {\n try {\n if (this.hold.getType() == null || c.hold.getType() == null) {\n CheeseConnoisseur n = this;\n } else if (this.hold.equals(c.hold)) {\n CheeseConnoisseur n = this;\n } else {\n CheeseConnoisseur higher = this.hold.getPrice() > c.hold.getPrice() ? this : c;\n CheeseConnoisseur lower = this.hold.getPrice() < c.hold.getPrice() ? this : c;\n double diff = higher.hold.getPrice() - lower.hold.getPrice();\n System.out.println(diff);\n if (this.hold.getPrice() > c.hold.getPrice() && c.money >= diff) {\n c.money -= diff;\n this.money += diff;\n this.hold.beTraded();\n c.hold.beTraded();\n Cheese tmp = this.hold;\n this.hold = c.hold;\n c.hold = tmp;\n } else if (this.hold.getPrice() < c.hold.getPrice() && this.money >= diff) {\n c.money += diff;\n this.money -= diff;\n this.hold.beTraded();\n c.hold.beTraded();\n Cheese tmp = this.hold;\n this.hold = c.hold;\n c.hold = tmp;\n } else {\n CheeseConnoisseur n = this;\n }\n }\n } catch (Exception e) {\n System.out.println(\"Fail to trade\");\n }\n\n }", "boolean CanOfferTrade(Resources offer);", "boolean canAcceptTrade();", "@Override\r\n\tpublic void setTrade(Trade trade) {\n\t\t this.trade = trade;\r\n\t}", "private void getTradeParam(int select){\n String buysell;if (select==1){buysell = \"buy\";}else{buysell = \"sell\";}\n out.println(\"\\r\\nEnter stock and number of shares you wish to \" + buysell + \" (e.g. E5). Enter 'X' to exit.\" +\n \"\\r\\n£3 transaction charge for purchases\");\n String tradeInput = in.nextLine();\n if(player.getTradesLeft() == 0){out.println(\"No more trade actions left\\r\\n\");command();}\n if(tradeInput.toUpperCase().equals(\"X\")){tradeCommand();}\n int numShares = Integer.parseInt(tradeInput.trim().substring(1));\n switch(tradeInput.toUpperCase().charAt(0)){\n case 'A': if(select==1){commitBuy(game.apple, numShares);}\n else{commitSell(game.apple, numShares);}\n break;\n case 'B': if(select==1){commitBuy(game.bp, numShares);}\n else{commitSell(game.bp, numShares);}\n break;\n case 'C': if(select==1){commitBuy(game.cisco, numShares);}\n else{commitSell(game.cisco, numShares);}\n break;\n case 'D': if(select==1){commitBuy(game.dell, numShares);}\n else{commitSell(game.dell, numShares);}\n break;\n case 'E': if(select==1){commitBuy(game.ericsson, numShares);}\n else{commitSell(game.ericsson, numShares);}\n break;\n default:\n out.println(\"Invalid input\");\n command();\n break;\n }\n }", "public void isPurchased(Player player) {\n\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 void applyTrade(Trade trade) {\n\t\tthis.sharesOwned += trade.getNumberOfShares();\n\t}", "public interface ITicketSpotBiz {\n //send ticket\n public void sendTicket(Player player);\n}", "private void buyPlayer(FootballPlayer player, String playerName, int num) {\n\t\tint valid = game.addPlayer(playerName);\n\t\tif(valid==0) {\n\t\t\tplayerNameArray[num].setText(playerName);\n\t\t\timageArray[num].setIcon(MainGui.getShirt(player.getTeamName()));\n\t\t\tbuttonArray[num].setText(\"X\");\n\t\t\tlblBudgetText.setText(game.getCurrentUser().getBudget() + \" RGG\");\n\t\t\t\n\t\t} else if (valid==1) {\n\t\t\tJOptionPane.showMessageDialog(frame,\"You have already selected this player for your team\");\n\t\t} else if (valid==-1) {\n\t\t\tJOptionPane.showMessageDialog(frame,\"You don´t have enough budget too buy \" + playerName);\n\t\t}\n\t}", "@Override\r\n\t\t\tpublic void buy(String security, double price, int volume) {\n\t\t\t\tSystem.out.println(\"buy is\"+price+volume);\r\n\t\t\t\t\r\n\t\t\t}", "Trade getTrade(String tradeId) throws OrderBookTradeException;", "public TransactionResponse sellXP() {\r\n \t\tTransactionResponse response = new TransactionResponse(hp);\r\n \t\ttry {\r\n \t\t\tDataHandler sf = hc.getDataFunctions();\r\n \t\t\tCalculation calc = hc.getCalculation();\r\n \t\t\tAccount acc = hc.getAccount();\r\n \t\t\tLanguageFile L = hc.getLanguageFile();\r\n \t\t\tLog log = hc.getLog();\r\n \t\t\tNotification not = hc.getNotify();\r\n \t\t\tInfoSignHandler isign = hc.getInfoSignHandler();\r\n \t\t\tString playerecon = hp.getEconomy();\r\n \t\t\tif (amount > 0) {\r\n \t\t\t\tint totalxp = im.gettotalxpPoints(hp.getPlayer());\r\n \t\t\t\tif (totalxp >= amount) {\r\n \t\t\t\t\tdouble price = hyperObject.getValue(amount, hp);\r\n \t\t\t\t\tBoolean toomuch = false;\r\n \t\t\t\t\tif (price == 3235624645000.7) {\r\n \t\t\t\t\t\ttoomuch = true;\r\n \t\t\t\t\t}\r\n \t\t\t\t\tif (!toomuch) {\r\n \t\t\t\t\t\tint maxi = hyperObject.getMaxInitial();\r\n \t\t\t\t\t\tboolean itax;\r\n \t\t\t\t\t\tboolean stax;\r\n \t\t\t\t\t\titax = Boolean.parseBoolean(hyperObject.getInitiation());\r\n \t\t\t\t\t\tstax = Boolean.parseBoolean(hyperObject.getIsstatic());\r\n \t\t\t\t\t\tif (amount > (maxi) && !stax && itax) {\r\n \t\t\t\t\t\t\tamount = maxi;\r\n \t\t\t\t\t\t\tprice = hyperObject.getValue(amount, hp);\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\tboolean sunlimited = hc.getYaml().getConfig().getBoolean(\"config.shop-has-unlimited-money\");\r\n \t\t\t\t\t\tif (acc.checkshopBalance(price) || sunlimited) {\r\n \t\t\t\t\t\t\tif (maxi == 0) {\r\n \t\t\t\t\t\t\t\tprice = hyperObject.getValue(amount, hp);\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\tint newxp = totalxp - amount;\r\n \t\t\t\t\t\t\tint newlvl = im.getlvlfromXP(newxp);\r\n \t\t\t\t\t\t\tnewxp = newxp - im.getlvlxpPoints(newlvl);\r\n \t\t\t\t\t\t\tfloat xpbarxp = (float) newxp / (float) im.getxpfornextLvl(newlvl);\r\n \t\t\t\t\t\t\thp.getPlayer().setLevel(newlvl);\r\n \t\t\t\t\t\t\thp.getPlayer().setExp(xpbarxp);\r\n \t\t\t\t\t\t\tif (!Boolean.parseBoolean(hyperObject.getIsstatic()) || !hc.getConfig().getBoolean(\"config.unlimited-stock-for-static-items\")) {\r\n \t\t\t\t\t\t\t\thyperObject.setStock(amount + hyperObject.getStock());\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\tint maxi2 = hyperObject.getMaxInitial();\r\n \t\t\t\t\t\t\tif (maxi2 == 0) {\r\n \t\t\t\t\t\t\t\thyperObject.setInitiation(\"false\");\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\tdouble salestax = hp.getSalesTax(price);\r\n \t\t\t\t\t\t\tacc.deposit(price - salestax, hp.getPlayer());\r\n \t\t\t\t\t\t\tacc.withdrawShop(price - salestax);\r\n \t\t\t\t\t\t\tif (sunlimited) {\r\n \t\t\t\t\t\t\t\tString globalaccount = hc.getYaml().getConfig().getString(\"config.global-shop-account\");\r\n \t\t\t\t\t\t\t\tacc.setBalance(0, globalaccount);\r\n \t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tresponse.addSuccess(L.f(L.get(\"SELL_MESSAGE\"), amount, calc.twoDecimals(price), hyperObject.getName(), calc.twoDecimals(price - salestax)), calc.twoDecimals(price), hyperObject);\r\n \t\t\t\t\t\t\tresponse.setSuccessful();\r\n \t\t\t\t\t\t\tString type = \"dynamic\";\r\n \t\t\t\t\t\t\tif (Boolean.parseBoolean(hyperObject.getInitiation())) {\r\n \t\t\t\t\t\t\t\ttype = \"initial\";\r\n \t\t\t\t\t\t\t} else if (Boolean.parseBoolean(hyperObject.getIsstatic())) {\r\n \t\t\t\t\t\t\t\ttype = \"static\";\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\tlog.writeSQLLog(hp.getName(), \"sale\", hyperObject.getName(), (double) amount, calc.twoDecimals(price - salestax), calc.twoDecimals(salestax), playerecon, type);\r\n \r\n \t\t\t\t\t\t\tisign.updateSigns();\r\n \t\t\t\t\t\t\tnot.setNotify(hyperObject.getName(), null, playerecon);\r\n \t\t\t\t\t\t\tnot.sendNotification();\r\n \t\t\t\t\t\t} else {\r\n \t\t\t\t\t\t\tresponse.addFailed(L.get(\"SHOP_NOT_ENOUGH_MONEY\"), hyperObject);\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t} else {\r\n \t\t\t\t\t\tresponse.addFailed(L.f(L.get(\"CURRENTLY_CANT_SELL_MORE_THAN\"), sf.getHyperObject(hyperObject.getName(), playerecon).getStock(), hyperObject.getName()), hyperObject);\r\n \t\t\t\t\t}\r\n \t\t\t\t} else {\r\n \t\t\t\t\tresponse.addFailed(L.f(L.get(\"YOU_DONT_HAVE_ENOUGH\"), hyperObject.getName()), hyperObject);\r\n \t\t\t\t}\r\n \t\t\t} else {\r\n \t\t\t\tresponse.addFailed(L.f(L.get(\"CANT_SELL_LESS_THAN_ONE\"), 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 = \"Transaction sellXP() passed values name='\" + hyperObject.getName() + \"', player='\" + hp.getName() + \"', amount='\" + amount + \"'\";\r\n \t\t\tnew HyperError(e, info);\r\n \t\t\treturn new TransactionResponse(hp);\r\n \t\t}\r\n \t}", "public TransactionResponse buyEnchantFromItem() {\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\ttry {\r\n \t\t\tPlayer p = hp.getPlayer();\r\n \t\t\tString nenchant = \"\";\r\n \t\t\tnenchant = hyperObject.getMaterial();\r\n \t\t\tEnchantment ench = Enchantment.getByName(nenchant);\r\n \t\t\tString mater = p.getItemInHand().getType().toString();\r\n \t\t\tdouble price = hyperObject.getValue(EnchantmentClass.fromString(mater));\r\n \t\t\tif (price != 123456789) {\r\n \t\t\t\tif (!im.containsEnchantment(p.getItemInHand(), ench)) {\r\n \t\t\t\t\tif (im.canAcceptEnchantment(p.getItemInHand(), ench) && p.getItemInHand().getAmount() == 1) {\r\n \t\t\t\t\t\tif (acc.checkFunds(price, p)) {\r\n \t\t\t\t\t\t\tacc.withdraw(price, p);\r\n \t\t\t\t\t\t\tacc.depositAccount(price, tradePartner.getName());\r\n \t\t\t\t\t\t\tint l = hyperObject.getName().length();\r\n \t\t\t\t\t\t\tString lev = hyperObject.getName().substring(l - 1, l);\r\n \t\t\t\t\t\t\tint level = Integer.parseInt(lev);\r\n \t\t\t\t\t\t\tim.addEnchantment(p.getItemInHand(), ench, level);\r\n \t\t\t\t\t\t\tim.removeEnchantment(giveItem, ench);\r\n \t\t\t\t\t\t\tprice = calc.twoDecimals(price);\r\n \t\t\t\t\t\t\tresponse.addSuccess(L.f(L.get(\"PURCHASE_ENCHANTMENT_CHEST_MESSAGE\"), 1, calc.twoDecimals(price), hyperObject.getName(), tradePartner.getName()), calc.twoDecimals(price), hyperObject);\r\n \t\t\t\t\t\t\tresponse.setSuccessful();\r\n \t\t\t\t\t\t\tlog.writeSQLLog(p.getName(), \"purchase\", hyperObject.getName(), 1.0, price, 0.0, tradePartner.getName(), \"chestshop\");\r\n \t\t\t\t\t\t\ttradePartner.sendMessage(L.f(L.get(\"CHEST_ENCHANTMENT_BUY_NOTIFICATION\"), 1, calc.twoDecimals(price), hyperObject.getName(), p));\r\n \t\t\t\t\t\t} else {\r\n \t\t\t\t\t\t\tresponse.addFailed(L.get(\"INSUFFICIENT_FUNDS\"), hyperObject);\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t} else {\r\n \t\t\t\t\t\tresponse.addFailed(L.get(\"ITEM_CANT_ACCEPT_ENCHANTMENT\"), hyperObject);\r\n \t\t\t\t\t}\r\n \t\t\t\t} else {\r\n \t\t\t\t\tresponse.addFailed(L.get(\"ITEM_ALREADY_HAS_ENCHANTMENT\"), hyperObject);\r\n \t\t\t\t}\r\n \t\t\t} else {\r\n \t\t\t\tresponse.addFailed(L.get(\"ITEM_CANT_ACCEPT_ENCHANTMENT\"), 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 buyChestEnchant() passed values name='\" + hyperObject.getName() + \"', player='\" + hp.getName() + \"', owner='\" + tradePartner.getName() + \"'\";\r\n \t\t\tnew HyperError(e, info);\r\n \t\t\treturn new TransactionResponse(hp);\r\n \t\t}\r\n \t}", "public boolean canTrade()\n\t{\n\t\treturn System.currentTimeMillis() - m_lastTrade > 60 * 1000 && getPartyCount() >= 2;\n\t}", "public void sell() {\n for (Company x : _market.getCompanies()) {\n if (x.getRisk() > _confidence || x.numLeft() < 3 || x.getRisk() < _confidence - 15){\n if (_stocks.get(x) == 1) {\n _stocks.remove(x);\n } else {\n _stocks.put(x, _stocks.get(x) - 1);\n }\n _money += x.getPrice();\n x.gain();\n break;\n } else {\n _happy = true;\n }\n }\n }", "private void botVoting(){\n int stockPos;\n int myStockPos = getMostShares(playerList.lastIndexOf(player));\n Collections.sort(playerList);\n if(playerList.get(0) == player){ //if i am the leader\n stockPos = getMostShares(1); //get the second players info\n }else{\n stockPos = getMostShares(0); //else get the first players info\n }\n\n //if my most shares are the same as other players most shares, don't vote.\n if(game.getStockByIndex(stockPos) != game.getStockByIndex(myStockPos)){\n //offensive play against leader\n if(game.isCardPositive(game.getStockByIndex(stockPos))){\n game.getStockByIndex(stockPos).vote(0);\n player.getVotedStocks().append(game.getStockByIndex(stockPos).getName().charAt(0));\n player.deductVotesLeft();\n System.out.println(\"bot voted NO for \" + game.getStockByIndex(stockPos).getName() );\n }else{\n game.getStockByIndex(stockPos).vote(1);\n player.getVotedStocks().append(game.getStockByIndex(stockPos).getName().charAt(0));\n player.deductVotesLeft();\n System.out.println(\"bot voted YES for \" + game.getStockByIndex(stockPos).getName());\n }\n //defensive play, votes that will benefit me\n if(game.isCardPositive(game.getStockByIndex(myStockPos))){\n game.getStockByIndex(myStockPos).vote(1);\n player.getVotedStocks().append(game.getStockByIndex(myStockPos).getName().charAt(0));\n player.deductVotesLeft();\n System.out.println(\"bot voted YES for \" + game.getStockByIndex(myStockPos).getName());\n }else{\n game.getStockByIndex(myStockPos).vote(0);\n player.getVotedStocks().append(game.getStockByIndex(myStockPos).getName().charAt(0));\n player.deductVotesLeft();\n System.out.println(\"bot voted NO for \" + game.getStockByIndex(myStockPos).getName());\n }\n }\n }", "@Test\n public void testMarketOrder() throws InterruptedException {\n setUp();\n testMatchingEngine.start();\n\n NewOrder nosB1 = createLimitOrder(\"BUY1\", Side.BUY, 100, 100.1, System.currentTimeMillis());\n clientSession.sendNewOrder(nosB1);\n NewOrder nosB2 = createLimitOrder(\"BUY2\", Side.BUY, 200, 99.99, System.currentTimeMillis());\n clientSession.sendNewOrder(nosB2);\n NewOrder nosB3 = createLimitOrder(\"BUY3\", Side.BUY, 300, 99.79, System.currentTimeMillis());\n clientSession.sendNewOrder(nosB3);\n\n // Sell Order with Qty=150 and Market Order\n NewOrder nosS1 = createMarketOrder(\"SELL1\", Side.SELL, 700, System.currentTimeMillis());\n clientSession.sendNewOrder(nosS1);\n\n List<Event> msg = clientSession.getMessagesInQueue();\n assertEquals(7, msg.size());\n\n Trade t = ( Trade) msg.get(0);\n assertEquals( t.getLastTradedPrice().value() , new Price(100.1).value() );\n assertEquals( t.getLastTradedQty() , 100 );\n t = ( Trade) msg.get(1);\n assertEquals( t.getLastTradedPrice().value() , new Price(100.1).value() );\n assertEquals( t.getLastTradedQty() , 100 );\n t = ( Trade) msg.get(2);\n assertEquals( t.getLastTradedPrice().value() , new Price(99.99).value() );\n assertEquals( t.getLastTradedQty() , 200 );\n t = ( Trade) msg.get(3);\n assertEquals( t.getLastTradedPrice().value() , new Price(99.99).value() );\n assertEquals( t.getLastTradedQty() , 200 );\n t = ( Trade) msg.get(4);\n assertEquals( t.getLastTradedPrice().value() , new Price(99.79).value() );\n assertEquals( t.getLastTradedQty() , 300 );\n t = ( Trade) msg.get(5);\n assertEquals( t.getLastTradedPrice().value() , new Price(99.79).value() );\n assertEquals( t.getLastTradedQty() , 300 );\n Canceled t1 = ( Canceled) msg.get(6);\n assertEquals( t1.getCanceledQty() , 100 );\n }", "@Override\r\n\tpublic Trade getTrade() {\n\t\treturn trade;\r\n\t}", "public void setTrade(Trade t)\n\t{\n\t\tm_trade = t;\n\t}", "@Override \n\tpublic TradeAction tick(double price) {\n\t\tma10before=average(priceQ10);\n\t\t\n\t\tif (priceQ10.size()<10)\n\t\t{\n\t\t\tpriceQ10.offer(price);\n\t\t}\n\t\tif(priceQ10.size()==10)\n\t\t{\n\t\t\tpriceQ10.poll();\n\t\t\tpriceQ10.offer(price);\t\t\n\t\t}\n\t\t\n\t\t ma10after=average(priceQ10);\n\t\t \n\t\t// 60 days moving average\n\t\tma60before=average(priceQ60);\n\t\tif (priceQ60.size()<60)\n\t\t{\n\t\t\tpriceQ60.offer(price);\n\t\t}\n\t\tif(priceQ60.size()==60)\n\t\t{\n\t\t\tpriceQ60.poll();\n\t\t\tpriceQ60.offer(price);\t\t\n\t\t}\n\t\tma60after=average(priceQ60);\n\t\t\t\n\t\t//buy when its 10 day moving average goes above the 60 day moving average\n\t\tif((ma10before < ma60before) & (ma10after > ma60after))\n\t\t{\n\t\t\tprofit = profit - price;\n\t\t\t//System.out.println(\"buy\");\n\t\t\t//System.out.println(\"profit is\");\n\t\t\t//System.out.println(profit);\n\t\t\tif(mark==1){\n\t\t\t\tmark=-1;\n\t\t\t\treturn TradeAction.BUY;\n\t\t\t}\n\t\t\telse \n\t\t\t\treturn TradeAction.DO_NOTHING;\n\t\t\t\n\t\t}\n\t\t//buy when its 10 day moving average goes below the 60 day moving average\n\t\tif((ma10before > ma60before) & (ma10after < ma60after))\n\t\t{\n\t\t\tprofit = profit + price;\n\t\t\t//System.out.println(\"sell\");\n\t\t\t//System.out.println(\"profit is\");\n\t\t\t//System.out.println(profit);\n\t\t\tif(mark==-1){\n\t\t\t\tmark=1;\n\t\t\t\treturn TradeAction.SELL;\n\t\t\t}\n\t\t\telse \n\t\t\t\treturn TradeAction.DO_NOTHING;\n\t\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn TradeAction.DO_NOTHING;\t\t\t\n\t\t}\n\n\t}", "private void storeTrip(Player p){\r\n\t\tSystem.out.println(\"Welcome to the store!\");\r\n\t\tSystem.out.println(\"Just a reminder, you have $\" + p.getMoney() + \" to spend!\");\r\n\t\tSystem.out.println(\"Please Select An Option: \");\r\n\t\tSystem.out.println(\"1. Buy Food\");\r\n\t\tSystem.out.println(\"2. Buy Toys\");\r\n\t\tSystem.out.println(\"3. Leave the store\");\r\n\t\tArrayList<Toy> storetoys = store.getToys();\r\n\t\tArrayList<Food> storefood = store.getFoods();\r\n\t\tint[] toyamounts = store.getToyamounts();\r\n\t\tint[] foodamounts = store.getFoodamounts();\r\n\t\tint buyoption; //The buying option\r\n\t\tint c; //Counter\r\n\r\n\t\tint selectedoption = getNumber(1, 3);\r\n\t\tswitch(selectedoption){\r\n\t\t//Buy food\r\n\t\tcase 1:\r\n\t\t\tc = 1;\r\n\t\t\tfor(Food f : storefood){\r\n\t\t\t\tSystem.out.println(c + \". \" + f.getName() + \"\\nPrice: $\" + f.getValue() + \" Stock: \" + foodamounts[c-1]);\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t\tc++;\r\n\t\t\t}\r\n\t\t\tbuyoption = getNumber(1, storefood.size());\r\n\t\t\tFood selectedfood = storefood.get(buyoption -1);\r\n\t\t\tif(p.getMoney() > selectedfood.getValue() && foodamounts[buyoption-1] > 0){\r\n\t\t\t\tp.setMoney(p.getMoney() - selectedfood.getValue());\r\n\t\t\t\tfoodamounts[buyoption -1]--; //Take one away, as it has been sold.\r\n\t\t\t\tp.addFood(selectedfood);\r\n\t\t\t\tstore.setFoodamounts(foodamounts);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\t\t//Buy toys\r\n\t\tcase 2:\r\n\t\t\tc = 1;\r\n\t\t\tfor(Toy t : storetoys){\r\n\t\t\t\tSystem.out.println(c + \". \" + t.getName() + \"\\nPrice: $\" + t.getPrice() + \" Stock: \" + toyamounts[c-1]);\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t\tc++;\r\n\t\t\t}\r\n\t\t\tbuyoption = getNumber(1, storetoys.size());\r\n\t\t\tToy selectedtoy = storetoys.get(buyoption -1);\r\n\t\t\tif(p.getMoney() > selectedtoy.getPrice() && toyamounts[buyoption-1] > 0){\r\n\t\t\t\tp.setMoney(p.getMoney() - selectedtoy.getPrice());\r\n\t\t\t\ttoyamounts[buyoption -1]--; //Take one away, as it has been sold.\r\n\t\t\t\tp.addToy(selectedtoy);\r\n\t\t\t\tstore.setToyamounts(toyamounts);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tSystem.out.println(\"\\n\\n\\n\\n\\n\\nError. Either the store was out of stock for the selected product or the player was out of money.\");\r\n\t\t\t}\r\n\t\tcase 3:\r\n\t\t\tbreak;\r\n\r\n\t\tdefault:\r\n\t\t\tSystem.out.println(\"ERROR\");\r\n\t\t}\r\n\t}", "@Override\r\n public void onClick(View view) {\n Log.d(\"WTF Buy stock at ppl detail\", \"0001 data:\" + StockData.getStockData(1).getDescription());\r\n Log.d(\"WTF Buy stock at ppl detail\", \"Current M: \" + CommonAccount.getCurrentAccount().getCurrentCash());\r\n\r\n CommonAccount.getCurrentAccount().stockBuySell(1, 100);\r\n Log.d(\"WTF Buy stock at ppl detail\", \"After M: \" + CommonAccount.getCurrentAccount().getCurrentCash());\r\n\r\n Log.d(\"WTF Buy stock at ppl detail\", \"Amount of 0001:\" + CommonAccount.getCurrentAccount().getStockInventory(1));\r\n\r\n\r\n try {\r\n CommonAccount.updateCurrentAccount(activity_ppl_details.this);\r\n }\r\n catch (Exception e)\r\n {\r\n Log.e(\"Cannot stock buy\", e.getMessage());\r\n }\r\n\r\n// Intent intent = new Intent(activity_ppl_details.this, activity_ppl_status.class);\r\n// startActivity(intent);\r\n\r\n Intent returnIntent = new Intent();\r\n setResult(RESULT_OK, returnIntent);\r\n\r\n finish();\r\n\r\n }", "public String acceptTrade(AcceptTrade acceptTrade) throws Exception {\n\t\tString url = server_url + \"/moves/acceptTrade\";\n\t\tURL obj = new URL(url);\n\t\tHttpURLConnection con = (HttpURLConnection) obj.openConnection();\n\n\t\t//add request header\n\t\tcon.setRequestMethod(\"POST\");\n\t\tcon.setRequestProperty(\"User-Agent\", \"Mozilla/5.0\");\n\t\tcon.setRequestProperty(\"Accept-Language\", \"en-US,en;q=0.5\");\n\t\tcon.setRequestProperty(\"Cookie\", usercookie + \"; \" + gamecookie);\n\t\t\n\t\tJsonObject info = new JsonObject();\n\t\tinfo.addProperty(\"type\",\"acceptTrade\");\n\t\tinfo.addProperty(\"playerIndex\", acceptTrade.playerIndex);\n\t\tinfo.addProperty(\"willAccept\", acceptTrade.response);\n\t\t\n\t\t// Send post request\n\t\tcon.setDoOutput(true);\n\t\tDataOutputStream wr = new DataOutputStream(con.getOutputStream());\n\t\twr.writeBytes(info.toString());\n\t\twr.flush();\n\t\twr.close();\n\n\t\tint responseCode = con.getResponseCode();\n\t\t//System.out.println(\"\\nSending 'POST' request to URL : \" + url);\n\t\t//System.out.println(\"Post parameters : \" + info.toString());\n\t\t//System.out.println(\"Response Code : \" + responseCode);\n\n\t\tif (responseCode == 400) {\n\t\t\tthrow new Exception();\n\t\t}\n\t\tBufferedReader in = new BufferedReader(\n\t\t new InputStreamReader(con.getInputStream()));\n\t\tString inputLine;\n\t\tStringBuffer response = new StringBuffer();\n\n\t\twhile ((inputLine = in.readLine()) != null) {\n\t\t\tresponse.append(inputLine);\n\t\t}\n\t\tin.close();\n\t\t\n\t\t//print result\n\t\t////System.out.println(response.toString());\n\t\treturn response.toString();\n\t}", "public void denyTrade(Trade trade) {\n Player owner = trade.getOwner();\n Player targetPlayer = trade.getTarget();\n owner.removeTrade(trade);\n targetPlayer.removeTrade(trade);\n }", "public boolean recordTrade(Trade trade) throws Exception;", "@Override\n\tpublic void satisfyTrade(TickEvent<Trade> tradeEvent) throws TradeException {\n\n\t}", "@Override\n public void sell() {\n }", "@Override\r\n\t\tpublic void action() {\n MessageTemplate mt = MessageTemplate.MatchPerformative(ACLMessage.ACCEPT_PROPOSAL);\r\n MessageTemplate mt2 = MessageTemplate.MatchPerformative(ACLMessage.PROPOSE);\r\n ACLMessage msg = myAgent.receive(mt);\r\n //If it is a ACCEPT_PROPOSAL, the seller sell the book to the buyer (execpt if the book if not here anymore)\r\n if (msg != null) {\r\n // ACCEPT_PROPOSAL Message received. Process it\r\n title = msg.getContent();\r\n ACLMessage reply = msg.createReply();\r\n\r\n Integer price = (Integer) catalogue.remove(title);\r\n if (price != null) {\r\n reply.setPerformative(ACLMessage.INFORM);\r\n reply.setContent(String.valueOf(price));\r\n System.out.println(title+\" sold to agent \"+msg.getSender().getName());\r\n }\r\n else {\r\n // The requested book has been sold to another buyer in the meanwhile .\r\n reply.setPerformative(ACLMessage.FAILURE);\r\n reply.setContent(\"not-available\");\r\n }\r\n myAgent.send(reply);\r\n }\r\n //If it is a new PROPOSE, the buyer is trying to negociate.\r\n else {\r\n ACLMessage msg2 = myAgent.receive(mt2);\r\n if(msg2 != null){\r\n ACLMessage reply = msg2.createReply();\r\n //If the price of the buyer is OK for the seller according to his tolerance, the transaction is made\r\n if(((Integer) catalogue.get(title) - Integer.parseInt(msg2.getContent())) <= tolerance){\r\n System.out.println(myAgent.getLocalName() + \" say : OK, let's make a deal\");\r\n updateCatalogue(title, Integer.parseInt(msg2.getContent()));\r\n reply.setPerformative(ACLMessage.INFORM);\r\n reply.setContent(msg2.getContent());\r\n }\r\n //Else, the seller accept to negociate, he up his tolerance and ask the buyer to up his real price\r\n else{\r\n //Send a REQUEST Message to negociate with the buyer\r\n reply.setPerformative(ACLMessage.REQUEST);\r\n //Up the tolerance by *change*\r\n tolerance += change;\r\n reply.setContent(String.valueOf(change));\r\n System.out.println(myAgent.getLocalName() + \" say : Let's up your real price while I up my tolerance (\" + ((Integer) catalogue.get(title) - Integer.parseInt(msg2.getContent())) + \" < \" + tolerance + \")\");\r\n }\r\n myAgent.send(reply);\r\n }\r\n else{\r\n block();\r\n }\r\n }\r\n\t\t}", "public void ExecuteSellOrder() throws SQLException, InvalidOrderException, InvalidAssetException, NegativePriceException, UnitException {\n // Current asset instance\n Asset currentAsset = Asset.findAsset(this.assetID);\n\n // Check if just ordered asset has corresponding order\n\n // Find buy orders of same asset\n Statement smt = connection.createStatement();\n String sqlFindOrder\n = \"SELECT * FROM orders WHERE assetID = '\" + assetID + \"' and orderType = 'BUY' \" +\n \"and orderStatus = 'INCOMPLETE' and unitID != '\" + this.unitID + \"' \" +\n \"ORDER BY orderTime;\";\n ResultSet buyOrders = smt.executeQuery(sqlFindOrder);\n\n // List to store corresponding buy orders of the same asset\n ArrayList<Order> matchingOrders = new ArrayList<>();\n\n // Add queried rows as new Buy Orders in list\n while (buyOrders.next()) {\n matchingOrders.add(\n new BuyOrder(\n buyOrders.getString(\"orderID\"),\n buyOrders.getString(\"userID\"),\n buyOrders.getString(\"unitID\"),\n buyOrders.getString(\"assetID\"),\n buyOrders.getString(\"orderTime\").substring(0,19),\n OrderStatus.valueOf(buyOrders.getString(\"orderStatus\")),\n OrderType.valueOf(buyOrders.getString(\"orderType\")),\n buyOrders.getDouble(\"orderPrice\"),\n buyOrders.getInt(\"orderQuantity\"),\n buyOrders.getInt(\"quantFilled\"),\n buyOrders.getInt(\"quantRemain\")\n )\n );\n }\n\n // Remove orders if the buy bid is less than the sell ask\n matchingOrders.removeIf(buys -> (buys.orderPrice < this.orderPrice));\n\n // List to store required orders that can fully/partially or completely not fill order\n ArrayList<Order> requiredOrders = new ArrayList<>();\n\n // Required asset amount to facilitate quantity of this order\n int requiredQuant = this.quantRemain;\n\n // Loop through orders matching conditions and append as many orders possible to\n // fully/partially facilitate this order\n for (int i = 0; i < matchingOrders.size(); i++) {\n // Stores quantity of current order in matchingOrders list\n int quantity = matchingOrders.get(i).quantRemain;\n if (requiredQuant > 0) {\n requiredOrders.add(matchingOrders.get(i));\n requiredQuant -= quantity;\n } else if (requiredQuant <= 0) {\n break;\n }\n }\n\n // If requiredOrders is filled it can either\n // - Have enough buy orders to fully facilitate the sell order\n // * Complete sell order (set COMPLETE flag, 0 quant remain, max quant fill)\n // * Update buyer and seller inventory numbers\n // * Change buy order (INCOMPLETE, quantFilled, quantRemain)\n // - Have enough buy orders to partially fill the sell order\n // * Complete the corresponding buy order/s (set COMPLETE flag, 0 quant remain, max quant fill)\n // * Change sell order (INCOMPLETE, change quant remain, change quant filled)\n // * Add inventory entry and update corresponding inventory numbers\n\n for (int i = 0; i < requiredOrders.size(); i++) {\n // How much this order has remaining to fill\n int sellQuant = this.quantRemain;\n // How much can this corresponding order faciliate of this order\n int buyQuant = requiredOrders.get(i).quantRemain;\n\n // Track executed quantity\n int executed = 0;\n\n if (buyQuant > sellQuant) {\n // When this order has more than the quantity required to fill remaining units\n\n // Stores how many more units the buy order has over this sell order\n this.quantFilled += sellQuant;\n this.quantRemain -= sellQuant;\n\n // Deduct the amount remaining of the sell order from the quantity remaining in the buy order\n requiredOrders.get(i).quantRemain -= sellQuant;\n requiredOrders.get(i).quantFilled += sellQuant;\n executed = sellQuant;\n\n // Change quantities in database\n ChangeQuantRemainFilled(this.quantRemain, this.quantFilled);\n requiredOrders.get(i).ChangeQuantRemainFilled(requiredOrders.get(i).quantRemain, requiredOrders.get(i).quantFilled);\n\n // Set complete status of this order\n this.ChangeStatus(OrderStatus.COMPLETE);\n\n } else if (buyQuant == sellQuant) {\n // When this order has exactly the same amount required to fill remaining units\n\n // Stores how many more units the buy order has over this sell order\n this.quantFilled += sellQuant;\n this.quantRemain -= sellQuant;\n\n // Deduct the amount remaining of the sell order from the quantity remaining in the buy order\n requiredOrders.get(i).quantRemain -= sellQuant;\n requiredOrders.get(i).quantFilled += sellQuant;\n executed = sellQuant;\n\n assert requiredOrders.get(i).quantRemain == 0;\n assert requiredOrders.get(i).quantFilled == requiredOrders.get(i).orderQuant;\n\n // Change quantities in database\n this.ChangeQuantRemainFilled(this.quantRemain, this.quantFilled);\n requiredOrders.get(i).ChangeQuantRemainFilled(requiredOrders.get(i).quantRemain, requiredOrders.get(i).quantFilled);\n\n // Set complete status of this order\n this.ChangeStatus(OrderStatus.COMPLETE);\n requiredOrders.get(i).ChangeStatus(OrderStatus.COMPLETE);\n\n } else {\n // When this order has less than required amount to fill remaining units\n\n // Stores how many more units the buy order has over this sell order\n this.quantFilled += requiredOrders.get(i).quantRemain;\n this.quantRemain -= requiredOrders.get(i).quantRemain;\n\n assert this.quantRemain + this.quantFilled == this.orderQuant;\n\n // Deduct the amount remaining of the sell order from the quantity remaining in the buy order\n requiredOrders.get(i).quantRemain -= buyQuant;\n requiredOrders.get(i).quantFilled += buyQuant;\n executed = buyQuant;\n\n assert requiredOrders.get(i).quantRemain == 0;\n assert requiredOrders.get(i).quantFilled == requiredOrders.get(i).orderQuant;\n\n // Change quantities in database\n ChangeQuantRemainFilled(this.quantRemain, this.quantFilled);\n requiredOrders.get(i).ChangeQuantRemainFilled(requiredOrders.get(i).quantRemain, requiredOrders.get(i).quantFilled);\n\n // Set complete status of this order\n ChangeStatus(OrderStatus.INCOMPLETE);\n requiredOrders.get(i).ChangeStatus(OrderStatus.COMPLETE);\n\n }\n\n // Change asset price\n currentAsset.SetPrice(requiredOrders.get(i).orderPrice);\n\n // Change inventory amounts\n new InventoryItem(this.unitID, this.assetID, requiredOrders.get(i).orderPrice, -executed, this.orderID);\n new InventoryItem(requiredOrders.get(i).unitID, requiredOrders.get(i).assetID, requiredOrders.get(i).orderPrice, executed, requiredOrders.get(i).orderID);\n\n // Set credit balance of units\n Unit sellerUnit = Unit.getUnit(this.unitID);\n sellerUnit.ChangeUnitBalance(this.unitID, requiredOrders.get(i).orderPrice * executed);\n Unit buyerUnit = Unit.getUnit(requiredOrders.get(i).unitID);\n buyerUnit.ChangeUnitBalance(requiredOrders.get(i).unitID, -requiredOrders.get(i).orderPrice * executed);\n }\n\n // If requiredOrders is empty, no current buy orders are able to facilitate sell order\n\n // Modify watchlist balances\n\n }", "@Override\n\tpublic CommandResult execute(CommandSource sender, CommandContext args)throws CommandException {\n\t\tif (sender instanceof Player) {\n \n\t\t\tPlayer player = (Player) sender;\n String playerName;\n\t\t\tint numberOfTransactions;\n\n if(args.getOne(\"numberOfTransactions\").isPresent()){\n \tnumberOfTransactions = (Integer) args.getOne(\"numberOfTransactions\").get();\n }else{\n \tnumberOfTransactions = 10;\n }\n if(args.getOne(\"playerName\").isPresent()){\n \tif(player.hasPermission(\"whippyconomy.accHistory.others\")){ \t\t\n \t\tplayerName = (String) args.getOne(\"playerName\").get();\n \t}else{\n \t\tplayer.sendMessage(Texts.builder(\"You do not have permission to sue that command\").color(TextColors.RED).build());\n \t\treturn CommandResult.empty();\n \t}\n }else{\n \tplayerName = player.getName();\n }\n List<Payment> transactions = EconomyCache.getLastTransactions(player, playerName);\n\t\t\t\n\t\t\tif(transactions.size()==0){\n\t\t\t\tplayer.sendMessage(Texts.builder(\"No transactions found\").color(TextColors.BLUE).build());\n\t\t\t}else{\n\t\t\t\tint size = transactions.size();\n\t\t\t\tif(size < numberOfTransactions){\n\t\t\t\t\tfor(int i = 0; i<transactions.size(); i++){\n\t\t\t\t\t\tPayment transaction = transactions.get(i);\n\t\t\t\t\t\tplayer.sendMessage(transaction.toText(player.getName()));\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tfor(int i = transactions.size()-numberOfTransactions; i<transactions.size(); i++){\n\t\t\t\t\t\tPayment transaction = transactions.get(i);\n\t\t\t\t\t\tplayer.sendMessage(transaction.toText(player.getName()));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\n \n } else {\n \tStaticsHandler.getLogger().warn(\"Transactions called by non player entity\");\n \treturn CommandResult.empty();\n }\n\t\treturn CommandResult.success();\n\n }", "public void cancelTradeOffer()\n\t{\n\t\tm_trade.cancelOffer(this);\n\t}", "public void trade(Cheese c) {\n if (this.hold == null) {\n this.hold = c;\n } else {\n Cheese tmp = this.hold;\n this.hold = c;\n c = tmp;\n this.hold.beTraded();\n c.beTraded();\n }\n }", "Trade addTrade(String tradeId, Trade trade) throws OrderBookTradeException;", "public TransactionResponse buyXP() {\r\n \t\tTransactionResponse response = new TransactionResponse(hp);\r\n \t\ttry {\r\n \t\t\tCalculation calc = hc.getCalculation();\r\n \t\t\tAccount acc = hc.getAccount();\r\n \t\t\tLanguageFile L = hc.getLanguageFile();\r\n \t\t\tLog log = hc.getLog();\r\n \t\t\tNotification not = hc.getNotify();\r\n \t\t\tInfoSignHandler isign = hc.getInfoSignHandler();\r\n \t\t\tString playerecon = hp.getEconomy();\r\n \t\t\tif (amount > 0) {\r\n \t\t\t\tint shopstock = 0;\r\n \t\t\t\tshopstock = (int) hyperObject.getStock();\r\n \t\t\t\tif (shopstock >= amount) {\r\n \t\t\t\t\tdouble price = hyperObject.getCost(amount);\r\n \t\t\t\t\tdouble taxpaid = hyperObject.getPurchaseTax(price);\r\n \t\t\t\t\tprice = calc.twoDecimals(price + taxpaid);\r\n \t\t\t\t\tif (acc.checkFunds(price, hp.getPlayer())) {\r\n \t\t\t\t\t\tint totalxp = im.gettotalxpPoints(hp.getPlayer());\r\n \t\t\t\t\t\tint newxp = totalxp + amount;\r\n \t\t\t\t\t\tint newlvl = im.getlvlfromXP(newxp);\r\n \t\t\t\t\t\tnewxp = newxp - im.getlvlxpPoints(newlvl);\r\n \t\t\t\t\t\tfloat xpbarxp = (float) newxp / (float) im.getxpfornextLvl(newlvl);\r\n \t\t\t\t\t\thp.getPlayer().setLevel(newlvl);\r\n \t\t\t\t\t\thp.getPlayer().setExp(xpbarxp);\r\n \t\t\t\t\t\tif (!Boolean.parseBoolean(hyperObject.getIsstatic()) || !hc.getConfig().getBoolean(\"config.unlimited-stock-for-static-items\")) {\r\n \t\t\t\t\t\t\thyperObject.setStock(shopstock - amount);\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\tacc.withdraw(price, hp.getPlayer());\r\n \t\t\t\t\t\tacc.depositShop(price);\r\n \t\t\t\t\t\tif (hc.getYaml().getConfig().getBoolean(\"config.shop-has-unlimited-money\")) {\r\n \t\t\t\t\t\t\tString globalaccount = hc.getYaml().getConfig().getString(\"config.global-shop-account\");\r\n \t\t\t\t\t\t\tacc.setBalance(0, globalaccount);\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\tresponse.addSuccess(L.f(L.get(\"PURCHASE_MESSAGE\"), amount, calc.twoDecimals(price), hyperObject.getName(), calc.twoDecimals(taxpaid)), calc.twoDecimals(price), hyperObject);\r\n \t\t\t\t\t\tresponse.setSuccessful();\r\n \t\t\t\t\t\tString type = \"dynamic\";\r\n \t\t\t\t\t\tif (Boolean.parseBoolean(hyperObject.getInitiation())) {\r\n \t\t\t\t\t\t\ttype = \"initial\";\r\n \t\t\t\t\t\t} else if (Boolean.parseBoolean(hyperObject.getIsstatic())) {\r\n \t\t\t\t\t\t\ttype = \"static\";\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\tlog.writeSQLLog(hp.getName(), \"purchase\", hp.getName(), (double) amount, calc.twoDecimals(price), calc.twoDecimals(taxpaid), playerecon, type);\r\n \t\t\t\t\t\tisign.updateSigns();\r\n \t\t\t\t\t\tnot.setNotify(hyperObject.getName(), null, playerecon);\r\n \t\t\t\t\t\tnot.sendNotification();\r\n \t\t\t\t\t} else {\r\n \t\t\t\t\t\tresponse.addFailed(L.get(\"INSUFFICIENT_FUNDS\"), hyperObject);\r\n \t\t\t\t\t}\r\n \t\t\t\t} else {\r\n \t\t\t\t\tresponse.addFailed(L.f(L.get(\"THE_SHOP_DOESNT_HAVE_ENOUGH\"), hyperObject.getName()), hyperObject);\r\n \t\t\t\t}\r\n \t\t\t} else {\r\n \t\t\t\tresponse.addFailed(L.f(L.get(\"CANT_BUY_LESS_THAN_ONE\"), 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 = \"Transaction buyXP() passed values name='\" + hyperObject.getName() + \"', player='\" + hp.getName() + \"', amount='\" + amount + \"'\";\r\n \t\t\tnew HyperError(e, info);\r\n \t\t\treturn new TransactionResponse(hp);\r\n \t\t}\r\n \t}", "public void giveJackpot(Player p){\n p.addCash(amount);\n amount = 0;\n }", "@Override\n public void acceptTrade(boolean willAccept) throws ModelException {\n if (willAccept && !GameModelFacade.instance().canAcceptTrade()) {\n throw new ModelException(\"Preconditions for action not met.\");\n }\n\n IPlayer p = GameModelFacade.instance().getLocalPlayer();\n assert GameModelFacade.instance().getGame().getTradeOffer().getReceiver().equals(p);\n\n try {\n String clientModel = m_theProxy.acceptTrade(p.getIndex(), willAccept);\n new ModelInitializer().initializeClientModel(clientModel, m_theProxy.getPlayerId());\n } catch (NetworkException e) {\n throw new ModelException(e);\n }\n }", "private void transferCoin(Player customer, MarketObject<?> x) throws IllegalStateException {\n\t\tPlayer seller=game.getPlayerByID(x.getSellingPlayer().getPlayerID());\n\t\tif(customer.checkCoins(x.getPrice()))\n\t\t\tseller.setCoins(\n\t\t\t\tseller.getCoins() + x.getPrice());\n\t\telse\n\t\t\tthrow new IllegalStateException(\"Impossible to buy. You only own \"\n\t\t\t\t\t+customer.getCoins()+\" instead of the \"+x.getPrice()+\" required\");\n\t\t\n\t}", "public static String requestSell(Player player, Team playersTeam, double askingPrice, Library library) {\n\t\tif (!player.isCanBeSold()) {\n\t\t\treturn \"You can't try to sell this player until after \" + player.getDaysNotForSale() + \" more rounds\";\n\t\t}\n\t\t\n\t\tArrayList<Team> teamswithbudget = new ArrayList<Team>();\n\t\tfor (int i=0;i<library.getLibrary().size();i++) {\n\t\t\tTeam t = library.getLibrary().get(i);\n\t\t\tif (t!=playersTeam) {\n\t\t\t\tif (t.getBudget()>=askingPrice) {\n\t\t\t\t\tteamswithbudget.add(t);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tif (teamswithbudget.size()==0) {\n\t\t\tplayer.triedToSell();\n\t\t\treturn \"Your player was not bought by any team, due to the fact that none of the teams has got enough money to fulfill your asking price\";\n\t\t}\n\t\t\n\t\tdouble percentage = askingPrice/player.getPrice().doubleValue()*100-100;\n\t\tboolean sell = false;\n\t\tint random = GameLogic.randomGenerator(1, 100);\n\t\tif (percentage<-10) {\n\t\t\tsell=true;\n\t\t} if (percentage >=-10 && percentage<0) {\n\t\t\tif (random<=95) {\n\t\t\t\tsell=true;\n\t\t\t}\n\t\t} if (percentage>=0 && percentage <5) {\n\t\t\tif (random<=75) {\n\t\t\t\tsell=true;\n\t\t\t}\n\t\t} if (percentage>=5 && percentage <10) {\n\t\t\tif (random<=50) {\n\t\t\t\tsell=true;\n\t\t\t}\n\t\t} if (percentage>=10 && percentage <15) {\n\t\t\tif (random<=30) {\n\t\t\t\tsell=true;\n\t\t\t}\n\t\t} if (percentage>=15 && percentage <20) {\n\t\t\tif (random<=20) {\n\t\t\t\tsell=true;\n\t\t\t}\n\t\t} if (percentage>=20 && percentage<25) {\n\t\t\tif (random<=10) {\n\t\t\t\tsell=true;\n\t\t\t}\n\t\t} if (percentage>=25 && percentage<30) {\n\t\t\tif (random==1) {\n\t\t\t\tsell=true;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (sell) {\n\t\t\tif (playersTeam.isMax()) {\n\t\t\t\tplayersTeam.setMax(false);\n\t\t\t}\n\t\t\tTeam buyingTeam = teamswithbudget.get(GameLogic.randomGenerator(0, teamswithbudget.size()-1));\n\t\t\tplayersTeam.setBudget(playersTeam.getBudget()+askingPrice);\n\t\t\t//System.out.println(playersTeam.getBudget());\n\t\t\tbuyingTeam.setBudget(buyingTeam.getBudget()-askingPrice);\n\t\t\tbuyingTeam.add(player);\n\t\t\tplayer.setTeam(buyingTeam.getTeamName());\n\t\t\tplayersTeam.getTeam().remove(player);\n\t\t\tplayer.setNumber(buyingTeam.getTeam().size());\n\t\t\tif (playersTeam.getPositions().contains(player)) {\n\t\t\t\tplayersTeam.getPositions().remove(player);\n\t\t\t}\n\t\t\tBigDecimal baskingPrice = new BigDecimal(askingPrice);\n\t\t\t//price string\n\t\t\t\n\t\t\tDecimalFormat formatter = (DecimalFormat) NumberFormat.getInstance(Locale.US);\n\t\t\tbaskingPrice = baskingPrice.setScale(2, BigDecimal.ROUND_DOWN);\n\t\t\tDecimalFormat df = new DecimalFormat();\n\t\t\tdf.setGroupingUsed(false);\t\t\n\t\t\tString priceString = formatter.format(baskingPrice.longValue());\n\t\t\t\n\t\t\treturn \"Congratulations! \" + player.getName() + \" got bought by \" + buyingTeam.getTeamName() + \" for the price of \" + priceString;\n\t\t} else {\n\t\t\tplayer.triedToSell();\n\t\t\treturn \"Unfortunately your player didn't get bought. Lowering the asking price might increase the chances for a team buying your player.\";\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "void respondToTrade(long tradeItemId, boolean response);", "public interface ITradingDao {\n\t/**\n\t * Get a trade item by id\n\t * @param id The id of the trade item\n\t * @return The trade item with the specified id.\n\t */\n\tTradeItem getTradeItem(long id);\n\n\tList<TradeItem> getAllTrades();\n\n\t/**\n\t * Create a tradeitem\n\t * @param item the tradeitem that needs to be created.\n\t * @return The item created\n\t */\n\tTradeItem createTradeItem(TradeItem item);\n\n\t/**\n\t * Create a tradeitem with the base values.\n\t * @param proposer\t\t : The account that started the trade\n\t * @param proposerFlippo : The flippo that the proposer is offering\n\t * @param receiver\t\t : The one that is receiving the trade offer.\n\t * @param receiverFlippo : The flippo that the proposer want.\n\t * @return The trade item.\n\t */\n\tTradeItem createTradeItem(Account proposer, Flippo proposerFlippo, Account receiver, Flippo receiverFlippo);\n\n\t/**\n\t * Get all the trades that this account has made.\n\t * @param accountId The id of the account that you want to get the data from.\n\t * @return A list of all trades the account proposed.\n\t */\n\tList<TradeItem> getTradesFromAccount(long accountId);\n\n\t/**\n\t * Get the trades that the account is the receiver of.\n\t * @param accountId The id of the receiving account.\n\t * @return a list of trades that have been made to this account.\n\t */\n\tList<TradeItem> getTradesForAccount(long accountId);\n\n\t/**\n\t * Get all the trades that the receiver has accepted.\n\t * @param accountId The id of the proposer of the trade\n\t * @return a list of all the trades that the proposer made that have been accepted and not yet handles.\n\t */\n\tList<TradeItem> getUnhandledAcceptedTrades(long accountId);\n\n\t/**\n\t * Get all declined trades from an account.\n\t * @param accountId The proposer.\n\t * @return\n\t */\n\tList<TradeItem> getDeclinedTrades(long accountId);\n\n\t/**\n\t * Respond to a trade.\n\t * @param response If the user wishes to accept or reject the trade.\n\t */\n\tvoid respondToTrade(long tradeItemId, boolean response);\n}", "public void onTrade(Trade event) {\n tradeCount++;\n }", "public final void give(final Player player) {\n\t\tplayer.getInventory().addItem(this.getItem());\n\t}", "public void onTrade(Trade trade) {\n thePosition += trade.getVolume();\n theCashBalance += -1 * trade.getPrice() * trade.getVolume();\n }", "Player(String name){\n this.name = name;\n funds = 500;\n shares = new ArrayList<>(5);\n votedStocks = new StringBuilder();\n votesLeft = 2;\n tradesLeft = 2;\n playerWorth = 0;\n botMode = false;\n addShares();\n }", "public void switchPlayer(){\n // Menukar giliran player dalam bermain\n Player temp = this.currentPlayer;\n this.currentPlayer = this.oppositePlayer;\n this.oppositePlayer = temp;\n }", "private void communityChest(Player currentPlayer){\n Random rand = new Random();\n int randomNum = rand.nextInt((3 - 1) + 1) + 1;\n int nextPlayer;\n if(m_currentTurn >= m_numPlayers){\n nextPlayer = 0;\n } else {\n nextPlayer = m_currentTurn+1;\n }\n\n if(randomNum == 1){\n convertTextToSpeech(\"Your new business takes off, collect 200\");\n if(m_manageFunds) {\n Log.d(\"chance add 200\", currentPlayer.getName() +\n String.valueOf(currentPlayer.getMoney()));\n currentPlayer.addMoney(200);\n funds.setText(String.valueOf(currentPlayer.getMoney()));\n Log.d(\"chance add 200\", currentPlayer.getName() +\n String.valueOf(currentPlayer.getMoney()));\n }\n }\n if(randomNum == 2){\n convertTextToSpeech(\"Your friend hires your villa for a week, \" +\n \"collect 100 off the next player\");\n if(m_manageFunds) {\n Log.d(\"chance add 100\", currentPlayer.getName() +\n String.valueOf(currentPlayer.getMoney()));\n currentPlayer.addMoney(100);\n funds.setText(String.valueOf(currentPlayer.getMoney()));\n Log.d(\"chance add 100\", currentPlayer.getName() +\n String.valueOf(currentPlayer.getMoney()));\n\n Log.d(\"chance subtract 100\", players.get(nextPlayer).getName() +\n String.valueOf(players.get(nextPlayer).getMoney()));\n players.get(nextPlayer).subtractMoney(100);\n Log.d(\"chance subtract 100\", players.get(nextPlayer).getName() +\n String.valueOf(players.get(nextPlayer).getMoney()));\n }\n }\n if(randomNum == 3){\n convertTextToSpeech(\"You receive a tax rebate, collect 300\");\n if(m_manageFunds) {\n Log.d(\"chance add 300\", currentPlayer.getName() +\n String.valueOf(currentPlayer.getMoney()));\n currentPlayer.addMoney(300);\n funds.setText(String.valueOf(currentPlayer.getMoney()));\n Log.d(\"chance add 300\", currentPlayer.getName() +\n String.valueOf(currentPlayer.getMoney()));\n }\n }\n }", "@Override\n public void playWithTwoPlayers(Player player1, Player player2) {\n int[] combinationPlayer;\n int counter = config.getMaxTries();\n config.getMsgInfo().choiceGameBonus();\n config.getMsgInfo().counter(counter);\n\n // initialize a random number that both players will try to find\n IAPlayer ia = new IAPlayer(config);\n int[] defenseCombination = ia.initialiseCombination();\n if (config.isDevMode())\n config.getMsgCombination().devMode(defenseCombination);\n config.getMsgInfo().computer();\n\n // Proposition player1\n config.getMsgInfo().player1();\n combinationPlayer = player1.research(null);\n config.getMsgCombination().newAnswer(combinationPlayer);\n String[] clues = ia.clues(combinationPlayer);\n if (IsWin.winIf(clues)) {\n config.getMsgInfo().isWin();\n return;\n }\n config.getMsgCombination().cluesAre(clues);\n\n // Proposition player2\n config.getMsgInfo().player2();\n combinationPlayer = player2.research(null);\n config.getMsgCombination().newAnswer(combinationPlayer);\n String[] clews = ia.clues(combinationPlayer);\n if (IsWin.winIf(clews)) {\n config.getMsgInfo().isWin();\n return;\n }\n config.getMsgCombination().cluesAre(clews);\n\n counter--;\n config.getMsgInfo().counterLess(counter);\n\n do {\n // Proposition player1\n config.getMsgInfo().player1();\n combinationPlayer = player1.research(clues);\n config.getMsgCombination().newAnswer(combinationPlayer);\n clues = ia.clues(combinationPlayer);\n if (IsWin.winIf(clues)) {\n config.getMsgInfo().isWin();\n return;\n } else if (counter > 1) {\n config.getMsgCombination().cluesAre(clues);\n } else if (counter == 1) {\n if (!Arrays.equals(combinationPlayer, defenseCombination))\n config.getMsgInfo().notGood();\n }\n\n // Proposition player2\n config.getMsgInfo().player2();\n combinationPlayer = player2.research(clews);\n config.getMsgCombination().newAnswer(combinationPlayer);\n clews = ia.clues(combinationPlayer);\n if (IsWin.winIf(clews)) {\n config.getMsgInfo().isWin();\n return;\n } else if (counter > 1) {\n config.getMsgCombination().cluesAre(clews);\n } else if (counter == 1) {\n if (!Arrays.equals(combinationPlayer, defenseCombination))\n config.getMsgInfo().notGood();\n }\n\n counter--;\n if (counter >= 1)\n config.getMsgInfo().counterLess(counter);\n else {\n config.getMsgInfo().endGameDuel();\n config.getMsgCombination().finallyRevealSecretCombination(defenseCombination);\n break;\n }\n } while (true);\n }", "public void sell(int amount, JsonObject quote, Handler<AsyncResult<Portfolio>> resultHandler) { \n delegate.sell(amount, quote, resultHandler);\n }", "public void transact() {\n\t\truPay.transact();\n\n\t}", "private void addSellCashTrade( final Trade trade )\n throws CloneNotSupportedException {\n\n // Check if the number of active units is greater than or equal to\n // the number of units that have been sold. If not, it is an error\n // condition. We are not handling short sell scenarios.\n if( getNumActiveCashUnits() < trade.getUnits() ) {\n logger.error( \"Selling more than active untis. Error condition\" ) ;\n logger.error( \" SYMBOL = \" + trade.getSymbol() ) ;\n logger.error( \" active units = \" + getNumActiveCashUnits() ) ;\n logger.error( \" sell units = \" + trade.getUnits() ) ;\n throw new IllegalArgumentException( \"Trying to sell more than \" +\n \"what we have. Bad bad..\" ) ;\n }\n\n // Selling happens in FIFO order.\n int qtyMatched = 0 ;\n Trade buyTrade = null ;\n int buyActUnits = 0 ;\n int sellUnitsLeft = trade.getUnits() ;\n Trade sellTrade= null ;\n\n // While we have not quenched all the units of the sell trade, we\n // continue matching it against our buy orders. Assumption is that if\n // we receive a sell order, we must have enough buy orders already\n // registered to quench the sell order. Else we have an error condition\n while( qtyMatched != trade.getUnits() ) {\n\n // Clone the sell order. In case one sell order matches multiple\n // buy orders, we need to attach a clone of the sell order with\n // appropriate quantity matched to each buy order.\n sellTrade = ( Trade )trade.clone() ;\n\n // Get the first buy order which has still some active units left.\n buyTrade = this.posHldCashTrades.get( 0 ) ;\n\n // Determine how many active units we are dealing with.\n buyActUnits = buyTrade.getNumActiveUnits() ;\n\n // If the buy active units are greater than the sell units left,\n // it implies that the complete sell order will be used up here.\n if( buyActUnits >= sellUnitsLeft ) {\n\n // Increase the total quantity matched by the sell units left.\n qtyMatched += sellUnitsLeft ;\n buyTrade.setMatchedUnits( buyTrade.getMatchedUnits() + sellUnitsLeft ) ;\n sellTrade.setMatchedUnits( sellUnitsLeft ) ;\n sellUnitsLeft = 0 ;\n }\n else {\n // If the sell units are more than the current buy units, it\n // implies that this sell order spans multiple buy orders.\n qtyMatched += buyActUnits ;\n\n // The buy order is completely matched. Hence the matched units\n // is equal to the number of buy units.\n buyTrade.setMatchedUnits( buyTrade.getUnits() ) ;\n\n // Set the number of units matched for this sell trade.\n sellTrade.setMatchedUnits( buyActUnits ) ;\n sellUnitsLeft -= buyActUnits ;\n }\n\n buyTrade.addSellTrade( sellTrade ) ;\n\n // If the buy order is completely matched, remove it from the list\n // of positive holdings and move it to the zero holdings list.\n if( buyTrade.getNumActiveUnits() == 0 ) {\n this.posHldCashTrades.remove( 0 ) ;\n }\n }\n }", "public void call(int player)\r\n\t{\r\n\t\tint bet=maxBet-playerBet[player];\r\n\t\tif(bet>accountValue[player])System.out.println(\"cos\");//tu powino wyjatek rzucac \r\n\t\telse\r\n\t\t{\r\n\t\t\taccountValue[player]=accountValue[player]-bet;\r\n\t\t\tplayerBet[player]+=bet;\r\n\t\t\tpool+=bet;\r\n\t\t}\r\n\t}", "boolean placeBet(Player player, int bet);", "public void purchaseTower(Tower towerType){ //This method will pruchase a tower from the player class given a Attacker Object\n if(this.coins()<towerType.getPrice()){ //checks to make sure that the player has neough money, if not it returns\n return;\n }\n\n myGame.addTower(Tower towerType); //calls the addTower method from the game class. Game will be resopnsible for storing towers not the player class\n this.coins-=towerType.getPrice(); //decrement the appropriate number of coins after purchsing the tower\n }", "public static void teleportAway(ClientContext ctx) {\n Item sceptre = ctx.inventory.select().id(Items.SKULL_SCEPTRE_I_21276).poll();\n\n if (sceptre.valid()) {\n sceptre.interact(\"Invoke\", sceptre.name());\n sleep(3000);\n } else {\n // Teletab\n Item tab = ctx.inventory.select().select(new Filter<Item>() {\n @Override\n public boolean accept(Item item) {\n return item.name().toLowerCase().contains(\"teleport\");\n }\n }).poll();\n\n if (tab.valid()) {\n tab.click();\n } else {\n // Glory Teleport\n ctx.game.tab(Game.Tab.EQUIPMENT);\n Item ammy = ctx.equipment.itemAt(Equipment.Slot.NECK);\n if (ammy.name().toLowerCase().contains(\"glory\")) {\n ammy.interact(\"Edgeville\");\n sleep(4000);\n }\n }\n }\n }", "public void sendJoiningPlayer() {\r\n Player p = nui.getPlayerOne();\r\n XferJoinPlayer xfer = new XferJoinPlayer(p);\r\n nui.notifyJoinConnected();\r\n networkPlayer.sendOutput(xfer);\r\n }", "public void isBought(Player p){\n\t\towner = p;\n\t\tisOwned=true;\n\t}", "void makeMarketSellOrder(AuthInfo authInfo, String pair, String money,HibtcApiCallback<Object> callback);" ]
[ "0.688767", "0.6849008", "0.66313815", "0.65472335", "0.6437681", "0.643095", "0.6399759", "0.6343951", "0.6338334", "0.6306611", "0.6259827", "0.6259542", "0.61734444", "0.6169373", "0.6161404", "0.61536133", "0.6125308", "0.61242956", "0.61241233", "0.607988", "0.6075197", "0.6064448", "0.604747", "0.60269314", "0.6007879", "0.600464", "0.6000574", "0.59757626", "0.5934739", "0.5922948", "0.5920138", "0.5908323", "0.5897573", "0.58508277", "0.58476174", "0.58436644", "0.5802059", "0.57907665", "0.5780495", "0.57769936", "0.5774541", "0.5765728", "0.5741296", "0.5714547", "0.57056284", "0.5702025", "0.56976193", "0.56717926", "0.5662885", "0.5650679", "0.564192", "0.56410164", "0.5640559", "0.56360984", "0.56215465", "0.56053793", "0.5600502", "0.555702", "0.55449134", "0.5540587", "0.55404246", "0.5536105", "0.55334723", "0.55306536", "0.5530429", "0.55230975", "0.55210704", "0.5520108", "0.54835033", "0.5477387", "0.5472612", "0.54658365", "0.546494", "0.54624885", "0.54558814", "0.5453805", "0.5445522", "0.5444067", "0.5443772", "0.5431504", "0.54312617", "0.5425084", "0.5422158", "0.5420726", "0.5403301", "0.54022455", "0.53966033", "0.5396288", "0.5394794", "0.5394216", "0.538899", "0.5372532", "0.5365931", "0.53624487", "0.5359798", "0.53519493", "0.5348153", "0.53462726", "0.5344683", "0.5331018" ]
0.66665095
2
This method initiates a maritime trade
void maritimeTrade(int ratio, String inputResource, String outResource);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Trade() {\n\t}", "@Override\r\n\tpublic void onStartTrading() throws Exception {\n\t\t\r\n\t}", "@Override\n protected void trade(){\n // An example of a random trade proposal: offer peasants in exchange of soldiers\n // Pick the id of the potential partner (without checking if it is my neighbor)\n double pertnerID = (new Random()).nextInt(42)+1;\n trade[0] = pertnerID;\n // Choose the type of good demanded (peasants - 3)\n double demandType = 3;\n trade[1] = demandType;\n // Choose the amount of demanded goods\n double demand = Math.random();\n trade[2] = demand;\n // Choose the type of good offered in exchange (peasants - 2)\n double offerType = 2;\n trade[3] = offerType;\n // Choode the amount of goods offered in exchange (random but less than my total number of peasants)\n double offer = (new Random()).nextDouble()*myTerritory.getPeasants();\n trade[4] = offer;\n\n // This procedure updated the array trade, which contains the information\n // about trade proposals of the current lord\n }", "public TurkeyMarket()\n {\n System.out.println(\"### Turkey Market is created. ###\\n\");\n }", "@Override\n public void init() {\n robot = new MecanumBotHardware(true,true,true,true);\n robot.init(hardwareMap);\n int deg180=845;\n // Create the state machine and configure states.\n smDrive = new StateMachine(this, 16);\n smDrive.addStartState(new WaitState(\"wait\",0.1,\"MainDriveTeleop\"));\n smDrive.addState(new GigabyteTeleopDriveState(\"MainDriveTeleop\", robot));\n smDrive.addState(new SpinPose(\"90DegSpin\",(int)(deg180*0.5),robot,0.1f));\n smDrive.addState(new SpinPose(\"180DegSpin\",deg180,robot,0.1f));\n smDrive.addState(new SpinPose(\"270DegSpin\",(int)(deg180*1.5),robot,0.1f));\n\n smArm = new StateMachine(this, 16);\n smArm.addStartState(new WaitState(\"wait\",0.1,\"MainArmTeleop\"));\n smArm.addState(new GigabyteTeleopArmState(\"MainArmTeleop\", robot));\n smArm.addState(new ShoulderPose(\"Pose1\", robot,0, \"MainArmTeleop\"));//0.12\n smArm.addState(new ShoulderPose(\"Pose2\", robot,1079, \"MainArmTeleop\"));//0.05\n smArm.addState(new ShoulderPose(\"Pose3\", robot,2602, \"MainArmTeleop\"));//-0.17\n smArm.addState(new ShoulderPose(\"Pose4\", robot,3698, \"MainArmTeleop\" ));//-0.35\n // Init the state machine\n smDrive.init();\n smArm.init();\n }", "@Override\n public void maritimeTrade(int ratio, ResourceType giving, ResourceType getting) throws ModelException {\n assert ratio == 2 || ratio == 3 || ratio == 4;\n\n IPlayer p = GameModelFacade.instance().getLocalPlayer();\n\n if (!GameModelFacade.instance().localPlayerIsPlaying() || p.getResources().getCount(giving) < ratio) {\n throw new ModelException(\"Preconditions for action not met.\");\n }\n\n try {\n String clientModel = m_theProxy.maritimeTrade(p.getIndex(), ratio, giving, getting);\n new ModelInitializer().initializeClientModel(clientModel, m_theProxy.getPlayerId());\n } catch (NetworkException e) {\n throw new ModelException(e);\n }\n }", "@Override\r\n\tpublic void makeMaritimeTrade(ResourceType giveResource, ResourceType getResource, int ratio) {\n\t\t\r\n\t}", "public void buyStock(double askPrice, int shares, int tradeTime) {\n }", "@Override\r\n\tpublic void onTrade(Trade trade) throws Exception {\n\t\t\r\n\t}", "public void presetTime(long tick,int ento){\r\n\r\n\t}", "public static void start() { \r\n\t\ttempo_inicial = System.nanoTime(); \r\n\t\ttempo_final = 0; \r\n\t\tdiftempo = 0; \r\n\t}", "@SuppressWarnings({ \"deprecation\", \"unchecked\" })\r\n\tpublic void init() throws Exception{\r\n\t\tSShort = getSecurity(ShortSecurity);\r\n/* buy the long */\r\nTotalAmount = CurrentPortfolio.getTotalAmount(CurrentDate);\r\nCurrentPortfolio.sellAsset(curAsset, CurrentDate);\r\nCurrentPortfolio.buy (curAsset, LongSecurity, TotalAmount, CurrentDate);\r\n/* short */\r\n//ShortShares = (int)(TotalAmount/SShort.getCurrentPrice(CurrentDate));\r\n//CurrentPortfolio.shortSellByShareNumber(curAsset, ShortSecurity, ShortShares, CurrentDate);\r\nCurrentPortfolio.shortSell(curAsset, ShortSecurity, TotalAmount, CurrentDate);\r\n\t}", "public void init()\r\n {\r\n m_active = false;\r\n m_entryTimes = new HashMap<String, Long>();\r\n m_tsm = BotAction.getBotAction().getTSM();\r\n m_tsm.setOperatorLevel(ER_LEVEL);\r\n registerSettings();\r\n m_tsm.addTSChangeListener(this);\r\n m_botAction.setPlayerPositionUpdating(500);\r\n }", "void openSuperMarketSimulation()\r\n\t{\n\t\t\r\n\t\tqueueManager = new QueueManager(shoppingQueue);\r\n\t\tdataManager = new DataCollector();\r\n\t\ttimerLoop.start();\r\n\t\tsuperMarketTime.timerStart();\r\n//\t\twhile(timerLoop.isRunning())\r\n//\t\t{\r\n//\t\t\t\r\n//\t\t}\r\n\t\t\r\n\t\t\r\n\t\t//CLOSE THE MARKET :(((\r\n\t}", "@Override\n public void teleopInit() {\n if (m_autonomousCommand != null) {\n m_autonomousCommand.cancel();\n }\n\n // Don't resume climbing\n IsHoldingBack = false;\n IsHoldingFront = false;\n\n safetyCount = 0;\n\n clearAllButtonStates();\n\n ArmsExtended = ArmsClosed = false;\n //ClimbFront.set(Value.kReverse);\n //ClimbBack.set(Value.kReverse);\n\n LiftSetpoint = Lifter.getSelectedSensorPosition();\n LiftRamp = new SRamp();\n LiftRamp.Rate = 300;\n LiftRamp.setOutput(Lifter.getSelectedSensorPosition());\n\n SpeedRamp = new SRamp();\n SpeedRamp.Rate = 0.06;\n SpeedRamp.setMaxAccelRate(0.004);\n\n VisionTable.getEntry(\"Tape\").setBoolean(true);\n\n Comp.start();\n }", "public void teleopInit() {\n\t\tauto.cancel();\r\n\t\t// Create the teleop command and start it.\r\n\t\tteleop.start();\r\n\t\t// Reset the drivetrain encoders\r\n\t\tDriveTrain.getInstance().resetEncoders();\r\n\t\t// Start pushing sensor readings to the SD.\r\n\t\treadings.start();\r\n\t}", "public void teleopInit() {\n\t\tif (autonomousCommand != null)\n\t\t\tautonomousCommand.cancel();\n\t\t\n//\t\tif ((intake.intakeIsUp() || intake.intakeSolenoidIsOff()) && shooterArm.getAngle() > 45) {\n//\t\t\traiseArm90.start();\t\t\t\n//\t\t}\n\t\tshooterArm.setBrakeOff();\n\t\t\n\t\tvision.enableCameraSaving();\n\t\tvision.setCameraPeriod(1);\n\t}", "@Override\n\tpublic void teleopInit() {\n\t\tif (m_autonomousCommand != null) {\n\t\t\tm_autonomousCommand.cancel();\n\t\t}\n\t\t\n\t\tSmartDashboard.putData(\"Stow Robot\", new PreMatchPresets());\n\t\t\n\t\tgetSwitchColor();\n\t\tchassis.chassisInit();\n\t\tintake.intakeInit();\n\t\tarm.armInit();\n\t\televator.elevatorInit();\n\t\tSmartDashboard.putNumber(\"Arm Pot Value\", Robot.arm.getArmPot());\n\n//\t\tSmartDashboard.putData(\"high\", new ShuttleHigh());\n\t}", "public DepotTimetableAsk() {\n }", "@Override\n public void teleopInit() {\n if (autonomousCommand != null) \n {\n autonomousCommand.cancel();\n }\n\n new ArcadeDrive().start();\n\n new BackElevatorControl().start();\n\n new IntakeControl().start();\n\n new FrontElevatorManual().start();\n\n new ElevatorAutomatic().start();\n }", "public TitanTransaction start();", "public void teleopInit()\n\t{\n\t\tif (autonomousCommand != null)\n\t\t\tautonomousCommand.cancel();\n\t\tif (secondAuton != null)\n\t\t\tsecondAuton.cancel();\n\t\tif (isAuton && auton == \"Left\")\t{\n\t\t\tpostAuton.start();\n\t\t\tisAuton = false;\n\t\t}\n\t\tconveyor.setPlate(true);\n\t}", "public void run() {\n String[] instruments = getInstrumentIds();\n String[] parties = getPartyIds();\n String[] venues = getVenueIds();\n //TradeMapStore tms = new TradeMapStore();\n\n\n while(true) {\n Trade trade = new Trade();\n trade.setTradeId(UUID.randomUUID().toString());\n logger.info(\"Generating Trade with Id \"+trade.getTradeId());\n trade.setAltTradeIds(new HashMap<String, String>());\n trade.setExecutionVenueDimId(getVenue(venues));\n trade.setTradeTransactionType(TradeTransactionTypeEnum.NEW);\n trade.setSecondaryTradeTypeEnum(TradeTypeEnum.WAP_TRADE);\n trade.setCurrencyPair(CurrencyPairEnum.EURUSD);\n trade.setInstrumentDimId(getInstrument(instruments));\n trade.setCounterPartyDimId(getCounterParty(parties));\n trade.setMarketId(getVenue(venues));\n trade.setOriginalTradeDate(new DateTime(new Date()));\n trade.setPrice(getPrice());\n trade.setQuantity(getSize());\n HashMap<String, Party> partyHashMap = new HashMap<String, Party>();\n trade.setParties(partyHashMap);\n trade.setTradeType(TradeTypeEnum.REGULAR_TRADE);\n logger.info(\"Inserting Trade: \"+trade.toJSON());\n trades.put(trade.getTradeId(),trade);\n\n logger.info(\"TradeLoader Having a snooze\");\n try {\n Thread.sleep(current().nextInt(10, 100));\n }\n catch(InterruptedException e){\n logger.error(\"Error while sleeping\");\n }\n }\n\n }", "@RequiresApi(api = Build.VERSION_CODES.O)\n public OneWayTrade(TransactionRequest re, LocalDateTime meetingTime) {\n super(re.getOwner(), re.getTheOtherUser(), re, meetingTime);\n this.item = re.getItemsToTrade().get(0);\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t\tsubscribeBroadcast(TickBroadcast.class, tick_msg -> { //subscribe to timer\n\t\t\tif (!tick_msg.isRunning()){ //if reached duration time \n\t\t\t\tLogger.getLogger(\"logger\").log(Level.INFO,getName()+ \" is terminating \");\n\t\t\t\tterminate();\n\t\t\t}\n\t\t\tsetTick(tick_msg.getTick());\n\t\t\t\n\t\t\tif (curr_request!=null){\n\t\t\t\tif (curr_amount>0){\n\t\t\t\t\tLogger.getLogger(\"logger\").log(Level.INFO,getName()+ \" created a pair of \" +curr_request.getShoeType());\n\t\t\t\t\tcurr_amount--;\n\t\t\t\t}\n\t\t\t\telse if (curr_amount==0){\n\t\t\t\t\tLogger.getLogger(\"logger\").log(Level.INFO,getName()+ \" finished producing the restock request for \"+curr_request.getAmount()+\" \"+curr_request.getShoeType());\n\t\t\t\t\tReceipt r= new Receipt(getName(),\"store\",curr_request.getShoeType(),false,curr_tick,curr_request.getCurr_tick(),curr_request.getAmount());\n\t\t\t\t\tcomplete(curr_request,r);\n\t\t\t\t\tif (!restock_orders.isEmpty()){\n\t\t\t\t\t\tcurr_request = restock_orders.remove();\n\t\t\t\t\t\tcurr_amount = curr_request.getAmount();\n\t\t\t\t\t\tif (curr_amount>0){\n\t\t\t\t\t\t\tLogger.getLogger(\"logger\").log(Level.INFO,getName()+ \" created a pair of \" +curr_request.getShoeType());\n\t\t\t\t\t\t\tcurr_amount--;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tcurr_request=null;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif (!restock_orders.isEmpty()){\n\t\t\t\t\tsetRequest(restock_orders.remove());\n\t\t\t\t\tLogger.getLogger(\"logger\").log(Level.INFO,getName()+ \" created 1 pair of \"+curr_request.getShoeType());\n\t\t\t\t\tcurr_request.setAmount(curr_request.getAmount()-1);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t});\n\t\t\n\t\tsubscribeRequest(ManufacturingOrderRequest.class, man_req -> {\n\t\t\tLogger.getLogger(\"logger\").log(Level.INFO,getName()+ \" was asked from the store to produce \"+man_req.getAmount()+\" \"+man_req.getShoeType());\n\t\t\tif (curr_request==null){\n\t\t\t\tsetRequest(man_req);\n\t\t\t\tcurr_amount=man_req.getAmount();\n\t\t\t}\n\t\t\telse\n\t\t\t\ttry {\n\t\t\t\t\trestock_orders.put(man_req);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t});\n\t\t\n\t\tlatchObject.countDown();\n\t}", "@Override\n\tpublic void inset(Trade trade) {\n\t\tString sqlString = \"INSERT INTO (userid, tradetime) VALUES(?, ?)\";\n\t\tlong tradeId = insert(sqlString, trade.getUserId(), trade.getTradeTime());\n\t\ttrade.setTradeId((int)tradeId);\n\t}", "public void setTradeTime(Integer tradeTime) {\n this.tradeTime = tradeTime;\n }", "public TradeData() {\r\n\r\n\t}", "private void generateTrades() {\n\t\tSystem.out.println(\"\\nGenerating fake trade records for stock: \" + stockSymbol);\n Random rd = new Random();\n \n for (int i = 0; i < 5; i++) {\n // Create arbitrary timestamp and TradeRecord data \n \t// within the last 20 minutes\n \n int minutes = rd.nextInt(21);\n int sharesQty = rd.nextInt(100) + 1;\n boolean isBuy = rd.nextBoolean();\n double price = (rd.nextDouble() + 0.1) * 100;\n // truncate price to 2 decimal places\n String tmpPrc = String.format(Locale.ENGLISH, \"%.2f\", price);\n price = Double.parseDouble(tmpPrc);\n TradeRecordType indicator = isBuy ? TradeRecordType.BUY : TradeRecordType.SELL;\n \n Calendar cal = Calendar.getInstance();\n cal.add(Calendar.MINUTE, -minutes);\n Date date = cal.getTime();\n \n // Create and save fake trade record\n TradeRecord rec = new TradeRecord(date, sharesQty, indicator, price);\n System.out.println(rec);\n this.stockTrades.put(date, rec);\n }\n }", "@Override\n\tpublic void run() {\n\t\tlogger.info(\"Timer for the initialization expired\");\n\t\tif(logic.getCurrentPlayer() != null) {\n\t\t\tlogic.setBonusBar(0, player.getPlayerID());\n\t\t}\n\t\telse {\n\t\t\tlogic.setLeaderCard(0, player.getPlayerID());\n\t\t}\n\t}", "public static void init(){\r\n CommandBase.magazine.setSpeed(0.0);\r\n CommandBase.loader.setSpeed(0.0);\r\n Init.manualTankDrive.start(); \r\n Init.runCompressor.start();\r\n Init.stopGyroDrift.start();\r\n \r\n }", "@Override\r\n\tpublic void setTrade(Trade trade) {\n\t\t this.trade = trade;\r\n\t}", "public TransferMarket() {\n }", "public void teleopInit() {\n \n }", "public void setSettlement(Settlement set);", "public String maritimeTrade(MaritimeTrade maritimeTrade) throws Exception {\n\t\tString url = server_url + \"/moves/maritimeTrade\";\n\t\tURL obj = new URL(url);\n\t\tHttpURLConnection con = (HttpURLConnection) obj.openConnection();\n\n\t\t//add request header\n\t\tcon.setRequestMethod(\"POST\");\n\t\tcon.setRequestProperty(\"User-Agent\", \"Mozilla/5.0\");\n\t\tcon.setRequestProperty(\"Accept-Language\", \"en-US,en;q=0.5\");\n\t\tcon.setRequestProperty(\"Cookie\", usercookie + \"; \" + gamecookie);\n\t\t\n\t\tJsonObject info = new JsonObject();\n\t\tinfo.addProperty(\"type\",\"maritimeTrade\");\n\t\tinfo.addProperty(\"playerIndex\", maritimeTrade.playerIndex);\n\t\tinfo.addProperty(\"ratio\", maritimeTrade.ratio);\n\t\tinfo.addProperty(\"inputResource\", maritimeTrade.givingUp.name().toLowerCase());\n\t\tinfo.addProperty(\"outputResource\", maritimeTrade.getting.name().toLowerCase());\n\t\t\n\t\t// Send post request\n\t\tcon.setDoOutput(true);\n\t\tDataOutputStream wr = new DataOutputStream(con.getOutputStream());\n\t\twr.writeBytes(info.toString());\n\t\twr.flush();\n\t\twr.close();\n\n\t\tint responseCode = con.getResponseCode();\n\t\t//System.out.println(\"\\nSending 'POST' request to URL : \" + url);\n\t\t//System.out.println(\"Post parameters : \" + info.toString());\n\t\t//System.out.println(\"Response Code : \" + responseCode);\n\n\t\tif (responseCode == 400) {\n\t\t\tthrow new Exception();\n\t\t}\n\t\tBufferedReader in = new BufferedReader(\n\t\t new InputStreamReader(con.getInputStream()));\n\t\tString inputLine;\n\t\tStringBuffer response = new StringBuffer();\n\n\t\twhile ((inputLine = in.readLine()) != null) {\n\t\t\tresponse.append(inputLine);\n\t\t}\n\t\tin.close();\n\t\t\n\t\t//print result\n\t\t////System.out.println(response.toString());\n\t\treturn response.toString();\n\t}", "@SuppressWarnings({ \"deprecation\", \"unchecked\" })\r\n\tpublic void init() throws Exception{\r\n\t\tAsset CurrentAsset;\r\ndouble TotalAmount = CurrentPortfolio.getTotalAmount(CurrentDate);\r\nCurrentPortfolio.sellAssetCollection(CurrentDate);\r\n\r\n\t\t\r\nCurrentAsset = new Asset();\r\nCurrentAsset.setAssetStrategyID(getStrategyID(\"STATIC\"));\r\nCurrentAsset.setName(\"US large cap\");\r\nCurrentAsset.setClassID(getAssetClassID(\"US Equity\"));\r\nCurrentAsset.setTargetPercentage(0.1428);\r\nCurrentPortfolio.addAsset(CurrentAsset);\r\nCurrentPortfolio.buy(CurrentAsset.getName(), \"^GSPC\", TotalAmount/7,\r\n\t\tCurrentDate);\r\n\t\r\n\t\t\r\nCurrentAsset = new Asset();\r\nCurrentAsset.setAssetStrategyID(getStrategyID(\"STATIC\"));\r\nCurrentAsset.setName(\"IUS small cap\");\r\nCurrentAsset.setClassID(52l);\r\nCurrentAsset.setTargetPercentage(0.1428);\r\nCurrentPortfolio.addAsset(CurrentAsset);\r\nCurrentPortfolio.buy(CurrentAsset.getName(), \"^RUT\", TotalAmount /7,\r\n\t\tCurrentDate);\r\n\t\t\r\nCurrentAsset = new Asset();\r\nCurrentAsset.setAssetStrategyID(getStrategyID(\"STATIC\"));\r\nCurrentAsset.setName(\"International Equity\");\r\nCurrentAsset.setClassID(9l);\r\nCurrentAsset.setTargetPercentage(0.1428);\r\nCurrentPortfolio.addAsset(CurrentAsset);\r\nCurrentPortfolio.buy(CurrentAsset.getName(), \"VGTSX\", TotalAmount /7,CurrentDate);\r\n\r\nCurrentAsset = new Asset();\r\nCurrentAsset.setAssetStrategyID(getStrategyID(\"STATIC\"));\r\nCurrentAsset.setName(\"Real Estate\");\r\nCurrentAsset.setClassID(5l);\r\nCurrentAsset.setTargetPercentage(0.1428);\r\nCurrentPortfolio.addAsset(CurrentAsset);\r\nCurrentPortfolio.buy(CurrentAsset.getName(), \"VGSIX\",\r\n\t\tTotalAmount /7, CurrentDate);\r\n\t\t\r\nCurrentAsset = new Asset();\r\nCurrentAsset.setAssetStrategyID(getStrategyID(\"STATIC\"));\r\nCurrentAsset.setName(\"Commodity\");\r\nCurrentAsset.setClassID(getAssetClassID(\"Commodity\"));\r\nCurrentAsset.setTargetPercentage(0.1428);\r\nCurrentPortfolio.addAsset(CurrentAsset);\r\nCurrentPortfolio.buy(CurrentAsset.getName(), \"QRAAX\",\r\n\t\tTotalAmount /7, CurrentDate);\r\n\r\n\r\n\r\n\t\t\r\nCurrentAsset = new Asset();\r\nCurrentAsset.setAssetStrategyID(getStrategyID(\"STATIC\"));\r\nCurrentAsset.setName(\"Cash\");\r\nCurrentAsset.setClassID(3l);\r\nCurrentAsset.setTargetPercentage(0.1428);\r\nCurrentPortfolio.addAsset(CurrentAsset);\r\nCurrentPortfolio.buy(CurrentAsset.getName(), \"CASH\",\r\n\t\tTotalAmount /7, CurrentDate);\r\n\t\t\r\nCurrentAsset = new Asset();\r\nCurrentAsset.setAssetStrategyID(getStrategyID(\"STATIC\"));\r\nCurrentAsset.setName(\"US Bond\");\r\nCurrentAsset.setClassID(2l);\r\nCurrentAsset.setTargetPercentage(0.1428);\r\nCurrentPortfolio.addAsset(CurrentAsset);\r\nCurrentPortfolio.buy(CurrentAsset.getName(), \"VBMFX\", TotalAmount /7,\r\n\t\tCurrentDate);\r\n\r\ninitialAmount=TotalAmount;\r\nwithdrawRate=0.05;\r\n\t}", "public void createTrade(String symbol, String fiat, String type, double amount) {\n // Type should be \"sell\" or \"buy\"\n if (!type.equals(\"sell\") && !type.equals(\"buy\"))\n return; // TODO - throw exception here\n\n // Create request object\n JSONObject data = new JSONObject();\n try {\n data.put(\"uuid\", getUUID());\n data.put(\"type\", type);\n data.put(\"fiat_value\", amount);\n data.put(\"fiat\", fiat);\n data.put(\"crypto_symbol\", symbol);\n } catch (JSONException e) {\n return; // TODO - throw exception here\n }\n\n api.createTrade(new VolleyJsonCallback() {\n @Override\n public void onSuccess(JSONObject json) throws JSONException {\n Trade t = new Trade(\n json.getString(\"uuid\"),\n json.getString(\"type\"),\n json.getDouble(\"fiat_value\"),\n json.getString(\"fiat\"),\n json.getDouble(\"crypto_value\"),\n json.getString(\"crypto_symbol\")\n );\n\n user.AddTrade(t);\n\n String typeStr = (type == \"buy\") ? \"Bought \" : \"Sold \";\n String text = typeStr + t.fiat_value + \"€ of \" + t.crypto_symbol;\n Toast.makeText(getApplicationContext(), text, Toast.LENGTH_LONG).show();\n\n // Create notification if enabled and trade is a buy\n if (getNotificationEnabled() && t.type.equals(\"buy\")) {\n Intent intent = new Intent(App.this, UpdateBroadcast.class);\n intent.putExtra(\"symbol\", t.crypto_symbol);\n intent.putExtra(\"fiat_price\", t.fiat_value);\n intent.putExtra(\"crypto_value\", t.crypto_value);\n PendingIntent pendingIntent = PendingIntent.getBroadcast(App.this, 0, intent, 0);\n\n AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);\n\n long currentTime = System.currentTimeMillis();\n //long remindIn = 1000 * 60 * 60; // Remind in this many milliseconds (1h)\n long remindIn = 1000 * 5;\n\n alarmManager.set(AlarmManager.RTC_WAKEUP, currentTime+remindIn, pendingIntent);\n }\n }\n\n @Override\n public void onError(String message) {\n Toast.makeText(getApplicationContext(), message, Toast.LENGTH_LONG).show();\n }\n }, data);\n }", "@Override\n\tpublic void teleopInit() {\n\t\tif (driveTrainCommand != null) {\n\t\t\tdriveTrainCommand.start();\n\t\t}\n\t\tif (colorCommand != null) {\n\t\t\tcolorCommand.start();\n\t\t}\n\t\tif (intakeCommand != null) {\n\t\t\tintakeCommand.start();\n\t\t}\n\t\tif (outtakeCommand != null) {\n\t\t\touttakeCommand.start();\n\t\t}\n\t}", "public void startNewSale() {\n sale = new Sale(cashRegister);\n }", "public void teleopInit() {\n }", "public void teleopInit() {\n }", "protected abstract void startIndividualTrx();", "public void setTranTime(int time)\n\t{\n\t\tthis.tranTime = time;\n\t}", "protected void initialize() {\n \t\n \tstart_time = System.currentTimeMillis();\n \t\n \tgoal = start_time + duration;\n }", "private TradeForDataGen initializeData(String type,String t,String securityName,String securityType, int quantity, double price, String traderName, String brokerName) {\n\t\tTradeForDataGen tempTrade = new TradeForDataGen();\n\t\tTimestamp timestamp = Timestamp.valueOf(t);\n\t\ttempTrade.setType(type);\n\t\ttempTrade.setTimestamp(timestamp);\n\t\ttempTrade.setQuantity(quantity);\n\t\ttempTrade.setBrokerName(brokerName);\n\t\ttempTrade.setPrice(price);\n\t\ttempTrade.setSecurityName(securityName);\n\t\ttempTrade.setTraderName(traderName);\n\t\ttempTrade.setSecurityType(securityType);\n\t\treturn tempTrade;\n\t}", "public void doInit() {\n\t\ttimer = new Timer() {\n\t\t public void run() {\n\t\t \t\tgetTrumpStack();\n\t\t }\n\t\t };\n\t\t timer.schedule(1000);\n\t}", "protected void initialize() {\n \tstartTime = System.currentTimeMillis();\n \tintake.setLeftPower(power);\n \tintake.setRightPower(power);\n }", "@Override\n protected void initialize() {\n desiredTime = System.currentTimeMillis() + (long) (seconds * 1000);\n Robot.driveTrain.configForTeleopMode();\n }", "public static void init() {\n \n if(stock==null){\n stock=Analyser.stock;\n //for each stock, it price and the time\n// stoc\n// String[] listedCompanies = new NSELoader(20).getAllStocks();\n// \n// for (int i =0; i < listedCompanies.length; i++) {\n// \n// String stockName = listedCompanies[i];\n// float price = 0;\n// int time = 0;\n// ArrayList<String> value = new ArrayList<>();\n// String data = time + \":\" + price;// ':' is used as boundary token\n// value.add(data);\n// stock.put(stockName, value);\n// }\n \n\n }\n }", "public void setTrade(Trade t)\n\t{\n\t\tm_trade = t;\n\t}", "public TimeDepositAccount(double interestRate, double balance, int maturityPeriods, double interestPenaltyRate) // constructor\n {\n super(interestRate,balance);\n this.elapsedPeriods=0;\n this.maturityPeriods=maturityPeriods;\n this.interestPenaltyRate = interestPenaltyRate;\n \n \n }", "private void initTransactions() {\n\n\t transactions = ModelFactory.createDefaultModel();\n\t try\n\t {\n\t\t\ttransactions.read(new FileInputStream(\"transactions.ttl\"),null,\"TTL\");\n\t\t}\n\t catch (FileNotFoundException e) {\n\t \tSystem.out.println(\"Error creating tansactions model\" + e.getMessage());\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "public Object prepareForTrading()\r\n/* */ {\r\n\t\t\t\tlogger.info(count++ + \" About to prepareForTrading : \" + \"Agent\");\r\n/* 230 */ return this;\r\n/* */ }", "public void startRideTime(){\r\n\t\trideTime.start();\r\n\t}", "public static void init() \r\n {\r\n currentTime = getTime(); \r\n lastTime = getTime(); \r\n }", "@Override\n\tpublic MonthlyTrading createMonthlyTrading(long monthlyTradingId) {\n\t\treturn monthlyTradingPersistence.create(monthlyTradingId);\n\t}", "@Override\n\tprotected void init() {\n\t\t//Set movementSpeed in px/s\n\t\tmovementSpeed = 100;\n\t\t//Set previousTime to start at the \n\t}", "@Override\n\tpublic void teleopInit() {\n\t\tif (autonomousCommand != null)\n\t\t\tlowGearCommand.start();\n\t\tautonomousCommand.cancel();\n\t}", "protected void setup() {\n\t\t\n\n\n\t\tif(PropertiesLoaderImpl.IS_MAIN_SIMULATION_NODE)addBehaviour(new HandleClockBehaviour(this, TimeRateControl));\n\t\telse addBehaviour(new SlaveNodeClockBehaviour(this, TimeRateControl));\n\t\t\n\t\tif(PropertiesLoaderImpl.DEBUG) System.out.println(this.getName() +\" alive!!!!!!!!!!\\nStarting the simulation time\");\n\t\t\n\t\n\t\t\tSimulationClock.getInstance().setSimulationStarted(true);\n\t\n\t}", "public Object setInitialCash(double initcash)\r\n/* */ {\r\n\t\t\t\tlogger.info(count++ + \" About to setInitialCash : \" + \"Agent\");\r\n/* 86 */ \tthis.initialcash = initcash;\r\n/* 87 */ \treturn this;\r\n/* */ }", "public void setCurrentTime(double time) {\n if (time < 0) {\n time = 0;\n }\n \n nextStartTime = time;\n \n makeNewMusic();\n }", "public void init() {\r\n\r\n\t\t// dater collectors\r\n\t\t//trucksArrived = new TimeSeries(this, \"arrived\", new TimeInstant(0), new TimeInstant(1500), true, false);\r\n\t\t//trucksServiced = new TimeSeries(this, \"finished\", new TimeInstant(0), new TimeInstant(1500), true, false);\r\n\t\ttrucksArrived = new TimeSeries(this, \"arrived\", new TimeInstant(0), new TimeInstant(1500), true, false);\r\n\t\ttrucksServiced = new TimeSeries(this, \"finished\", new TimeInstant(0), new TimeInstant(1500), true, false);\r\n\t\twaitTimeHistogram = new Histogram(this, \"Truck Wait Times\", 0, 16, 10, true, false);\r\n\r\n\t\t// distributions DEFAULT\r\n\t\t// serviceTime = new ContDistUniform(this, \"ServiceTimeStream\", 3.0, 7.0, true, false);\r\n\t\t// truckArrivalTime = new ContDistExponential(this, \"TruckArrivalTimeStream\", 3.0, true, false);\r\n\r\n\t\t// distributions PROBLEM DESCRIPTION\r\n\t\t// serviceTime = new ContDistUniform(this, \"ServiceTimeStream\", 3.5,6.5, true, false);\r\n\t\t// truckArrivalTime = new ContDistExponential(this, \"TruckArrivalTimeStream\", 2.0, true, false);\r\n\t\tserviceTime = new ContDistExponential(this, \"ServiceTimeStream\", 4.0, true, false);\r\n\t\ttruckArrivalTime = new ContDistExponential(this, \"TruckArrivalTimeStream\", 2.0, true, false);\r\n\r\n\t\t// queues\r\n\t\ttruckQueue = new ProcessQueue<Truck>(this, \"Truck Queue\", true, false);\r\n\t\tidleVCQueue = new ProcessQueue<VC>(this, \"idle VC Queue\", true, false);\r\n\t}", "public TimeSeriesTally() {\n\tsuper();\n\tfPrevTime = 0.0;\n }", "private void buildSettlement() {\r\n\t\t// client.setCurrentPhase(Constants.PHASE_3);\r\n\t\tlastSettlementNode = clickedNode;\r\n\t\tMessage message = new Message(clickedNode, true, null);\r\n\t\tsendMessage(message);\r\n\t}", "public TimeTravel() {\r\n\t\t}", "@Scheduled(cron = \"0 0 0 * * ?\")\n\tpublic void executeMaturityTrades() {\n\t\tfinal Stream<Trade> maturedTrades = this.getTrades().stream()\n\t\t\t\t.filter(item -> item.getmDate().before(DateTimeUtils.getTodayDate()));\n\t\tmaturedTrades.forEachOrdered(item -> item.setExpired('Y'));\n\t\tSystem.out.println(\"All matured trades set to exprired.\");\n\t}", "void addTrade(Trade trade);", "@Override\n\tpublic void teleopInit() {\n\t\tservoCIMCommand.start();\n\t\tmonitorCommand.start();\n\t\twindowCommand.start();\n\t\t\n\t}", "public Trader(String traderName, Planet traderOrigin) {\n name = traderName;\n origin = traderOrigin;\n welcomeText = \"What're ya buy'in?\";\n }", "@Override\r\n\tpublic void acceptTrade(boolean willAccept) {\n\t\t\r\n\t}", "public void startTeleopTimer() {\n t.reset();\n t.start();\n }", "public abstract void aktualisiereZeitpunk(int momentanZeitpunkt);", "public Market() {\n }", "@Override\r\n\tpublic void start() {\r\n\t\tsuper.start();\r\n\t\tresetDice();\r\n\t\tclearPlayer();\r\n\t\t// changing the state of all the players to playing.\r\n\r\n\t\tsuccessID = 0;\r\n\t\t// 输家ID\r\n\t\tfailID = 0;\r\n\r\n\t\tint taxes = hallType.getSystemTaxes();\r\n\t\tList<Player> list = getAllPlayers();\r\n\t\tfor (Player player : list) {\r\n\t\t\tplayer.setPlayerState(PlayerState.Playing);\r\n\t\t\tplayer.getPlayerDetail().addCoins(taxes * -1);\r\n\t\t\taddPlayer(player);\r\n\r\n\t\t\tplayer.resetPlayer(hallType.getGameType());\r\n\t\t}\r\n\t\tint gamePlayerCount = list.size();// 记录游戏类型的局数\r\n\t\tGameMgr.addGameTypeCount(gamePlayerCount);\r\n\t\tsendUpdatePlayerState();\r\n\r\n\t\tsortQueue();\r\n\t\tSendGameStart(taxes);\r\n\t\tgameState = GameState.Playing;\r\n\r\n\t\tWaitTime(1 * 1000);\r\n\t\t// checkState(0);\r\n\r\n\t}", "public CarWashSimulation ()\n {\n bay = new Bay(CarWashApplication.BAY_TIME);\n waitingLine = new LLQueue<Car>();\n randGen = new Random();\n reset();\n }", "public Maestro()\r\n\t{\r\n\t\tint i;\r\n\t\tint hora = 0;\r\n\t\tint minutos = 0;\r\n\t\tint segundos = 0;\r\n\t\tint milisegundos = 0;\r\n\t\tthis.reloj = new Reloj(\"Reloj Servidor\",hora,minutos,segundos,milisegundos);\r\n\t\tthis.reloj.start();\r\n\r\n\t\tthis.s_BD = new Sincronizador_BD(this.Conect);\r\n\t\tthis.s_BD.start();\r\n\t}", "@SuppressWarnings(\"rawtypes\")\n @BeforeEach\n public void setUp() \n {\n // Clean up from previous tests\n tariffRepo.recycle();\n timeslotRepo.recycle();\n brokerRepo.recycle();\n reset(mockProxy);\n reset(mockServerProperties);\n\n // create a Competition, needed for initialization\n comp = Competition.newInstance(\"accounting-test\");\n \n // set the clock\n //Instant now = new DateTime(2011, 1, 26, 12, 0, 0, 0, DateTimeZone.UTC).toInstant();\n Instant now = Competition.currentCompetition().getSimulationBaseTime(); \n now = now.plus(TimeService.HOUR);\n timeService.setCurrentTime(now);\n \n // set up brokers and customers\n bob = new Broker(\"Bob\");\n brokerRepo.add(bob);\n jim = new Broker(\"Jim\");\n brokerRepo.add(jim);\n\n customerInfo1 = new CustomerInfo(\"downtown\", 42)\n .withPowerType(PowerType.CONSUMPTION);\n customerInfo2 = new CustomerInfo(\"suburbs\", 21)\n .withPowerType(PowerType.CONSUMPTION);\n customerInfo3 = new CustomerInfo(\"exburbs\", 11)\n .withPowerType(PowerType.CONSUMPTION);\n\n // set up tariffs - tariff1 for consumption, tariff2 for production\n Instant exp = now.plus(TimeService.WEEK * 10);\n TariffSpecification tariffSpec = new TariffSpecification(bob, PowerType.CONSUMPTION)\n .withExpiration(exp)\n .withMinDuration(TimeService.WEEK * 8)\n .withPeriodicPayment(0.02)\n .addRate(new Rate().withValue(0.121));\n tariffRepo.addSpecification(tariffSpec);\n tariffB1 = new Tariff(tariffSpec);\n tariffB1.init();\n tariffRepo.addTariff(tariffB1);\n\n tariffSpec = new TariffSpecification(bob, PowerType.CONSUMPTION)\n .withMinDuration(TimeService.WEEK * 8)\n .withExpiration(exp)\n .addRate(new Rate().withValue(0.09));\n tariffRepo.addSpecification(tariffSpec);\n tariffB2 = new Tariff(tariffSpec);\n tariffB2.init();\n tariffRepo.addTariff(tariffB2);\n tariffSpec = new TariffSpecification(jim, PowerType.CONSUMPTION)\n .withMinDuration(TimeService.WEEK * 8)\n .withExpiration(exp)\n .withPeriodicPayment(0.01)\n .addRate(new Rate().withValue(0.123));\n tariffRepo.addSpecification(tariffSpec);\n tariffJ1 = new Tariff(tariffSpec);\n tariffJ1.init();\n tariffRepo.addTariff(tariffJ1);\n \n // set up some timeslots\n timeslotRepo.makeTimeslot(now.minus(TimeService.HOUR));\n timeslotRepo.makeTimeslot(now);\n timeslotRepo.makeTimeslot(now.plus(TimeService.HOUR));\n timeslotRepo.makeTimeslot(now.plus(TimeService.HOUR * 2));\n\n // Set up serverProperties mock\n config = new Configurator();\n doAnswer(new Answer() {\n @Override\n public Object answer(InvocationOnMock invocation) {\n Object[] args = invocation.getArguments();\n config.configureSingleton(args[0]);\n return null;\n }\n }).when(mockServerProperties).configureMe(any());\n }", "public void scheduleMarathon()\n\t{\n\n\t\t//Create new threads\n\t\tThread h = new Thread(new ThreadRunner(HARE,H_REST,H_SPEED)); \n\t\tThread t = new Thread(new ThreadRunner(TORTOISE,T_REST,T_SPEED)); \n\n\t\tArrayList<Thread> runnerList = new ArrayList<Thread>();\n\t\trunnerList.add(h);\n\t\trunnerList.add(t);\n\n\t\tSystem.out.println(\"Get set...Go! \");\n\t\t//Start threads\n\t\tfor (Thread i: runnerList){\n\t\t\ti.start();\n\t\t}\n\n\t\twaitMarathonFinish(runnerList);\n\t}", "@Test\n public void testCurrentMarketPosition ()\n {\n initializeService();\n accountingService.addMarketTransaction(bob,\n timeslotRepo.findBySerialNumber(2), 0.5, -45.0);\n accountingService.addMarketTransaction(bob,\n timeslotRepo.findBySerialNumber(2), 0.3, -31.0);\n accountingService.addMarketTransaction(bob,\n timeslotRepo.findBySerialNumber(3), 0.7, -43.0);\n accountingService.addMarketTransaction(jim,\n timeslotRepo.findBySerialNumber(2), 0.4, -35.0);\n accountingService.addMarketTransaction(jim,\n timeslotRepo.findBySerialNumber(2), -0.2, 20.0);\n assertEquals(5, accountingService.getPendingTransactions().size(), \"correct number in list\");\n accountingService.activate(timeService.getCurrentTime(), 3);\n // current timeslot is 4, should be 0 mkt posn\n assertEquals(0.0, accountingService.getCurrentMarketPosition (bob), 1e-6, \"correct position, bob, ts4\");\n assertEquals(0.0, accountingService.getCurrentMarketPosition (jim), 1e-6, \"correct position, jim, ts4\");\n // move forward to timeslot 5 and try again\n timeService.setCurrentTime(timeService.getCurrentTime().plus(TimeService.HOUR));\n assertEquals(0.8, accountingService.getCurrentMarketPosition (bob), 1e-6, \"correct position, bob, ts5\");\n assertEquals(0.2, accountingService.getCurrentMarketPosition (jim), 1e-6, \"correct position, jim, ts5\");\n // another hour and try again\n timeService.setCurrentTime(timeService.getCurrentTime().plus(TimeService.HOUR));\n assertEquals(0.7, accountingService.getCurrentMarketPosition (bob), 1e-6, \"correct position, bob, ts5\");\n assertEquals(0.0, accountingService.getCurrentMarketPosition (jim), 1e-6, \"correct position, jim, ts5\");\n }", "public void teleopInit(){\r\n drive.setupTeleop();\r\n shooter.setupTeleop();\r\n pickup.setupTeleop();\r\n }", "public Object getMarketTradeTransactionInitiateActionRecord() {\n return marketTradeTransactionInitiateActionRecord;\n }", "@Override\r\n\tpublic void saveASNew(Trade trade) {\n\t\ttradeid.setText(new Integer(trade.getId()).toString());\r\n\t\ttradestatus.setText(trade.getStatus());\r\n\t\tactionstatus.removeAllElements();\r\n\t\t\r\n\t//\tprocessActionData(actionstatus,trade.getTradedesc1()); \r\n\t\t/// imp note : wf understand CASH productType as MM so passing MM as hardcoded\r\n processActionData(actionstatus,productType.toUpperCase(),trade.getTradedesc1(),tradestatus.getText(),rtradeservices);\r\n\t\tthis.trade = trade;\r\n\t\tsetTrade(trade);\r\n\t\tgetTradeTransfers(transferPanel);\r\n\t\tgetTradeTask(taskPanel);\r\n\t\tgetTradeSDI(sdiPanel);\r\n\t}", "@Override\n public void teleopInit() {\n /* factory default values */\n _talonL1.configFactoryDefault();\n _talonL2.configFactoryDefault();\n _talonR1.configFactoryDefault();\n _talonR2.configFactoryDefault();\n\n /* flip values so robot moves forward when stick-forward/LEDs-green */\n _talonL1.setInverted(true); // <<<<<< Adjust this\n _talonL2.setInverted(true); // <<<<<< Adjust this\n _talonR1.setInverted(true); // <<<<<< Adjust this\n _talonR2.setInverted(true); // <<<<<< Adjust this\n\n\n /*\n * WPI drivetrain classes defaultly assume left and right are opposite. call\n * this so we can apply + to both sides when moving forward. DO NOT CHANGE\n */\n _drive.setRightSideInverted(true);\n }", "public void teleopInit() {\n // Initalize test command\n Jagbot.isAutonomous = false;\n MessageWindow.write(1, \"Robot init\");\n //testCommand = new TestCommand();\n //testCommand.start();\n }", "public PulseTransitTime() {\n currPTT = 0.0;\n hmPeakTimes = new ArrayList<>();\n //maf = new MovingAverage(WINDOW_SIZE);\n }", "public void teleopInit() {\n armTask.stop();\n driveTask.stop();\n armTask2.stop();\n getRobotDrive().stop();\n driveState = TELEOP;\n armState = TELEOP;\n\n }", "private void setupTimeline(){\n KeyFrame kf = new KeyFrame(Duration.millis(Constants.DURATION), new TimeHandler());\n Timeline timeline = new Timeline(kf);\n timeline.setCycleCount(Animation.INDEFINITE);\n timeline.play();\n }", "public void setTempoInit(LocalDateTime tempoInit) {\n this.tempoInit = tempoInit;\n }", "public void init() {\n\ttsp.init();\n }", "private void botTrading(){\n if(game.isCardPositive(game.getHighestSharePriceStock())){\n int numShares = player.getFunds()/(game.getHighestSharePriceStock().getSharePrice()+3);\n player.getShares().set(game.getIndex(game.getHighestSharePriceStock()), player.getShares().get(game.getIndex(game.getHighestSharePriceStock())) + numShares);\n player.setFunds(-numShares*(game.getHighestSharePriceStock().getSharePrice()+3));\n }\n }", "public void resetTimeTrackingManager() {\n this.timeTrankiManager.setHour(9);\n this.timeTrankiManager.setMinute(0);\n this.timeTrankiManager.setSecond(0);\n }", "@Override\n public void teleopInit() {\n\t// This makes sure that the autonomous stops running when\n\t// teleop starts running. If you want the autonomous to\n\t// continue until interrupted by another command, remove\n\t// this line or comment it out.\n\tif (autonomousCommand != null) {\n\t autonomousCommand.cancel();\n\t}\n }", "public TradeResult(int numberTraded, double price, int action) {\r\n this.numberTraded = numberTraded;\r\n this.price = price;\r\n this.action = action;\r\n }", "@Override\n public void run() {\n OrderBook.getInstance().addOfferMarketQuote(order);\n }", "@Override\r\n\tpublic void init() { \r\n\t\t\r\n\t\tsession = -1;\r\n\t\t\r\n\t\tProgressDif = 0;\r\n\t\tnoisFact = 0;\r\n\t\tcompromiseFact = 0;\r\n\t\t\r\n\t\tcompromiseLearn = 20;\r\n\t\tprogressLearn = 10;\r\n\t\tnoisLearn = 0.2;\r\n\t\t\r\n\t\treservationPanic = 0.2;\r\n\t\tmyBids = new ArrayList<Pair<Bid,Double>>();\r\n\t\topponentBidsA = new Vector<ArrayList<Pair<Bid,Double>>>();\r\n\t\topponentBidsB = new Vector<ArrayList<Pair<Bid,Double>>>();\r\n\r\n\t\tdf = utilitySpace.getDiscountFactor();\r\n\t\tif (df==0) df = 1; \r\n\r\n\t\ttry {\r\n\t\t\tinitStates();\r\n\t\t} catch (Exception e) {\r\n \t\t\te.printStackTrace();\r\n\t\t}\t\t\r\n\t}", "private TransactionRequest initTransactionRequest() {\n TransactionRequest transactionRequestNew = new\n TransactionRequest(System.currentTimeMillis() + \"\", 20000);\n\n //set customer details\n transactionRequestNew.setCustomerDetails(initCustomerDetails());\n\n\n // set item details\n ItemDetails itemDetails = new ItemDetails(\"1\", 20000, 1, \"Trekking Shoes\");\n\n // Add item details into item detail list.\n ArrayList<ItemDetails> itemDetailsArrayList = new ArrayList<>();\n itemDetailsArrayList.add(itemDetails);\n transactionRequestNew.setItemDetails(itemDetailsArrayList);\n\n\n // Create creditcard options for payment\n CreditCard creditCard = new CreditCard();\n\n creditCard.setSaveCard(false); // when using one/two click set to true and if normal set to false\n\n// this methode deprecated use setAuthentication instead\n// creditCard.setSecure(true); // when using one click must be true, for normal and two click (optional)\n\n creditCard.setAuthentication(CreditCard.AUTHENTICATION_TYPE_3DS);\n\n // noted !! : channel migs is needed if bank type is BCA, BRI or MyBank\n// creditCard.setChannel(CreditCard.MIGS); //set channel migs\n creditCard.setBank(BankType.BCA); //set spesific acquiring bank\n\n transactionRequestNew.setCreditCard(creditCard);\n\n return transactionRequestNew;\n }", "private void doLine()\n\t{\n\t\tubisenseData = new UbisenseMockupData();\n\t\tDecimalFormat df = new DecimalFormat(\"#0,00\");\n\n\t\telapsedTime = 0;\n\t\t\n\t\tubisenseData.setTagID(Helper.DEFAULT_TAG_ID);\n\t\tubisenseData.setUnit(Helper.UBISENSE_UNIT);\n\t\tubisenseData.setOntology(Helper.LP_ONTOLOGY_URL);\n\t\tubisenseData.setVersion(Helper.UBISENSE_VERSION);\n\t\tubisenseData.setId(\"\");\n\t\tubisenseData.setSendTime(sendTime);\n\t\t\n\t\tlong millis = startDate.getMillis();\n\t\tmillis += offset.toStandardDuration().getMillis();\n//\t\tmillis += parentOffset.toStandardDuration().getMillis();\n\t\t\n\t\t// Steigung m und Achsenabschnitt b berechnen\n//\t\tdouble m = 0.;\n//\t\tif ((x2-x1)!=0)\n//\t\t\tm = (y2-y1)/(x2-x1);\n//\t\tdouble b = y1 - (m * x1);\n\t\t\n\t\t// Abstand zwischen beiden Koordinaten d\n\t\tdouble dsquare = Math.pow((x2-x1),2) + Math.pow((y2-y1),2);\n\t\tdouble d = Math.sqrt(dsquare);\n\n\t\t// Zeit t [s] berechnen, die für die Distanz d unter gegebener Geschwindigkeit benötigt wird.\n\t\tdouble t = d / toolSpeed;\n\t\tdouble steps = Math.ceil(t) +1;\n\t\t\n\t\twhile (steps>0 && !terminate)\n\t\t{\n\t\t\tdouble x,y, currentTime=0;\n\t\t\tif (t != 0)\n\t\t\tcurrentTime = elapsedTime / t;\n\t\t\t\n\t\t\tx = (x2-x1) * currentTime + x1;\n\t\t\ty = (y2-y1) * currentTime + y1;\n\t\t\tubisenseData.setPosition(new Point3D(\tDouble.parseDouble(df.format(x)),\n\t\t\t \tDouble.parseDouble(df.format(y)),\n\t\t\t\t\t\t\t\t\t\t\t\t\t1.6));\n\t\t\tubisenseData.setId(String.valueOf(Helper.getRandomInt()));\n\t\t\tubisenseData.setTime(millis + (long)(elapsedTime*SLEEP_INTERVAL));\n\t\t\tEntryEvent event = new EntryEvent(this);\n\t\t\tnotifyListeners(event);\n\t\t\telapsedTime++;\n\t\t\tif (elapsedTime > t)\n\t\t\t\telapsedTime = t;\n\t\t\t\n\t\t\tsteps--;\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif (speed > 0)\n\t\t\t\t\tThread.sleep(SLEEP_INTERVAL/speed);\n\t\t\t}\n\t\t\tcatch (InterruptedException e)\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "@Test\n public void testMarketOrder() throws InterruptedException {\n setUp();\n testMatchingEngine.start();\n\n NewOrder nosB1 = createLimitOrder(\"BUY1\", Side.BUY, 100, 100.1, System.currentTimeMillis());\n clientSession.sendNewOrder(nosB1);\n NewOrder nosB2 = createLimitOrder(\"BUY2\", Side.BUY, 200, 99.99, System.currentTimeMillis());\n clientSession.sendNewOrder(nosB2);\n NewOrder nosB3 = createLimitOrder(\"BUY3\", Side.BUY, 300, 99.79, System.currentTimeMillis());\n clientSession.sendNewOrder(nosB3);\n\n // Sell Order with Qty=150 and Market Order\n NewOrder nosS1 = createMarketOrder(\"SELL1\", Side.SELL, 700, System.currentTimeMillis());\n clientSession.sendNewOrder(nosS1);\n\n List<Event> msg = clientSession.getMessagesInQueue();\n assertEquals(7, msg.size());\n\n Trade t = ( Trade) msg.get(0);\n assertEquals( t.getLastTradedPrice().value() , new Price(100.1).value() );\n assertEquals( t.getLastTradedQty() , 100 );\n t = ( Trade) msg.get(1);\n assertEquals( t.getLastTradedPrice().value() , new Price(100.1).value() );\n assertEquals( t.getLastTradedQty() , 100 );\n t = ( Trade) msg.get(2);\n assertEquals( t.getLastTradedPrice().value() , new Price(99.99).value() );\n assertEquals( t.getLastTradedQty() , 200 );\n t = ( Trade) msg.get(3);\n assertEquals( t.getLastTradedPrice().value() , new Price(99.99).value() );\n assertEquals( t.getLastTradedQty() , 200 );\n t = ( Trade) msg.get(4);\n assertEquals( t.getLastTradedPrice().value() , new Price(99.79).value() );\n assertEquals( t.getLastTradedQty() , 300 );\n t = ( Trade) msg.get(5);\n assertEquals( t.getLastTradedPrice().value() , new Price(99.79).value() );\n assertEquals( t.getLastTradedQty() , 300 );\n Canceled t1 = ( Canceled) msg.get(6);\n assertEquals( t1.getCanceledQty() , 100 );\n }", "@Override\n public void init(TaskManager tm, Ui ui) {\n setResponse(ui.askEventName());\n setUtility(tm, ui);\n }", "@Override\n protected void onTick() {\n leerFromMatlab();\n if ((voltajeMR > 120 * 1.1 && voltajeMR < 120 * 0.9) || (frecuenciaMR > 60 * 1.1 && frecuenciaMR < 60 * 0.9)) {\n alarmaMR = true;\n System.out.println(\"Alarma de condiciones no deseadas de microred encendida\");\n } else {\n alarmaMR = false;\n }\n\n if ((voltajeRE > 120 * 1.1 && voltajeRE < 120 * 0.9) || (frecuenciaRE > 60 * 1.1 && frecuenciaRE < 60 * 0.9)) {\n alarmaRE = true;\n System.out.println(\"Alarma de condiciones no deseadas de red externa encendida\");\n } else {\n alarmaRE = false;\n }\n\n try {\n ACLMessage mensaje = new ACLMessage();\n AID r1 = new AID();\n r1.setLocalName(\"EnergyMarketAgent\");\n AID r2 = new AID();\n r2.setLocalName(\"InterfaceAgent\");\n mensaje.setSender(getAID());\n //mensaje.addReceiver(r);\n mensaje.addReceiver(r1);\n mensaje.addReceiver(r2);\n //mensaje.addReceiver(getDefaultDF());\n mensaje.setLanguage(codec.getName());\n mensaje.setOntology(ontologia.getName());\n mensaje.setPerformative(ACLMessage.INFORM);\n Operacion operacion = new Operacion();\n operacion.setEstadoFallaMicroRed(alarmaMR);\n operacion.setEstadoFallaRedExterna(alarmaRE);\n operacion.setPotenciaAlmacenada((float) potenciaAlmacenada);\n operacion.setPotenciaGenerada((float) potenciaGenerada);\n operacion.setPotenciaDemanda((float) demandaPotencia);\n operacion.setModoOperacionApagado(modoOperacionApagado);\n operacion.setModoOperacionInterno(modoOperacionInterno);\n operacion.setModoOperacionExterno(modoOperacionExterno);\n operacion.setModoOperacionParcial(modoOperacionParcial);\n operacion.setModoOperacionVenta(modoOperacionVenta);\n operacion.setModoOperacionAlmacenamiento(modoOperacionAlmacenamiento);\n\n EnviarInfoOperacion enviarModoOperacion = new EnviarInfoOperacion();\n enviarModoOperacion.setParametros(operacion);\n //mensaje.setContentObject(enviarModoOperacion);\n getContentManager().fillContent(mensaje, (ContentElement) enviarModoOperacion);\n \n\n send(mensaje);\n } catch (Codec.CodecException ex) {\n Logger.getLogger(AgenteMicroRed.class.getName()).log(Level.SEVERE, null, ex);\n } catch (OntologyException ex) {\n Logger.getLogger(AgenteMicroRed.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n }" ]
[ "0.5891969", "0.5778467", "0.55708385", "0.5494991", "0.5389259", "0.5375252", "0.5365509", "0.53645813", "0.5329264", "0.5294067", "0.5282879", "0.52729726", "0.52723444", "0.5261153", "0.5254951", "0.52547556", "0.5240131", "0.52302426", "0.52127326", "0.5205251", "0.5198854", "0.5164143", "0.5155341", "0.51522464", "0.5146348", "0.51175785", "0.50990593", "0.50767344", "0.5067818", "0.5065159", "0.50113654", "0.4989223", "0.49890316", "0.49853733", "0.4980774", "0.49755454", "0.49630147", "0.49604756", "0.49380443", "0.4935575", "0.49120215", "0.49120215", "0.4911221", "0.49087116", "0.4892447", "0.48732755", "0.48718676", "0.48714575", "0.48660088", "0.48555884", "0.48536196", "0.48468465", "0.4840879", "0.48389447", "0.48382735", "0.48371884", "0.4832458", "0.48276258", "0.48215857", "0.4818937", "0.48116294", "0.47977567", "0.4796931", "0.47966745", "0.47946033", "0.47905847", "0.478379", "0.4781294", "0.4773281", "0.47677025", "0.4767475", "0.47659928", "0.47610888", "0.47473937", "0.47472516", "0.4743536", "0.47425535", "0.47366798", "0.47343895", "0.4727058", "0.47267202", "0.47265542", "0.4726397", "0.47213072", "0.47204942", "0.47189626", "0.47178742", "0.47165734", "0.4714793", "0.47123092", "0.4711259", "0.47086245", "0.4706478", "0.4695263", "0.46942198", "0.46923494", "0.468936", "0.4689262", "0.46872798", "0.46866626", "0.46836922" ]
0.0
-1
This method finishes the current players turn
void finishTurn();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void endTurn() {\n currentTurn = getNextPlayer();\n }", "void completeTurn() {\n\n\t\tremoveNotification();\n\n\t\tString matchId = match.getMatchId();// The Id for our match\n\t\tString pendingParticipant = GPGHelper.getOpponentId(\n\t\t\t\tgameHelper.getApiClient(), match);// We set who's turn it\n\t\t// is next since\n\t\t// we're done,\n\t\t// should always be\n\t\t// opponents turn\n\t\t// for us.\n\t\tbyte[] gameState = writeGameState(match);// We build the game state\n\t\t\t\t\t\t\t\t\t\t\t\t\t// bytes from the current\n\t\t\t\t\t\t\t\t\t\t\t\t\t// game state.\n\n\t\t// This actually tries to send our data to Google.\n\t\tGames.TurnBasedMultiplayer.takeTurn(gameHelper.getApiClient(), matchId,\n\t\t\t\tgameState, pendingParticipant).setResultCallback(\n\t\t\t\tnew ResultCallback<TurnBasedMultiplayer.UpdateMatchResult>() {\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onResult(UpdateMatchResult result) {\n\t\t\t\t\t\tturnUsed = true;\n\n\t\t\t\t\t\t// TODO:Handle this better\n\t\t\t\t\t\tif (!GooglePlayGameFragment.this.checkStatusCode(match,\n\t\t\t\t\t\t\t\tresult.getStatus().getStatusCode())) {\n\t\t\t\t\t\t\tLog.d(\"test\", result.getStatus().getStatusCode()\n\t\t\t\t\t\t\t\t\t+ \" Something went wrong\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t}", "public void finishTurn() {\n\t\tthis.cancelTimer();\n\t\t// if any hero is dead\n\t\tif (!opponents[0].isAlive() || !opponents[1].isAlive()) {\n\t\t\t// end the game\n\t\t\tfinishGame();\n\t\t} else {\n\t\t\t// switch turns\n\n\t\t\topponents[activeHero].setIsTurn(false);\n\t\t\topponents[activeHero].deselectAll();\n\n\t\t\tswitch (activeHero) {\n\t\t\tcase 0:\n\t\t\t\tactiveHero = 1;\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tactiveHero = 0;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tstartTurn(opponents[activeHero]);\n\t\t}\n\t}", "private void endTurn() {\n\t\t// Upon completion of move, change the color of the current turn.\n\t\tif (currentTurnColor == PlayerColor.RED) {\n\t\t\tcurrentTurnColor = PlayerColor.BLUE;\n\t\t} else {\n\t\t\tcurrentTurnColor = PlayerColor.RED;\n\t\t}\n\n\t\tturnsCounter++;\n\t}", "public void endTurn() {\n\t\tturnEnd = false;\n\t\tmadeMove = false;\n\t\tcurrentPlayer.resetUndos();\n\t\tif (currentPlayer == player1) {\n\t\t\tcurrentPlayer = player2;\n\t\t} else {\n\t\t\tcurrentPlayer = player1;\n\t\t}\n\t\t//printBoard();\n\t\tSystem.out.println(\"It is now \" + currentPlayer.getName() + \"'s turn\");\n\t}", "public void playerFinishedGoNext() {\n\t\t// If game is over we don't want to switch turn.\n\t\tif (!isOver()) {\n\t\t\tswitchTurn();\n\t\t}\n\t}", "@Override\r\n\tpublic void endTurn() {\n\t\t\r\n\t}", "public void endOfTurn();", "public void endTurn() {\r\n\t\tSystem.out.println(\"[DEBUG LOG/Game.java] Started endTurn() for player \"+currentPlayer.getNumber());\r\n\t\tturnIsEnding = true;\r\n\r\n\t\t// End turn restrictions\r\n\t\tif (!currentPlayer.isDead() && !currentPlayer.isFree() && !currentPlayer.hasQuit()) {\r\n\t\t\tif (currentPlayer.getPlayArea().getNonPlayedSize() > 0) {\r\n\t\t\t\tgameChannel.sendMessage(\"**[ERROR]** Cannot end turn until all cards in play area are played\").queue();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (mustChoose.size() > 0) {\r\n\t\t\t\tgameChannel.sendMessage(\"**[ERROR]** Cannot end turn until all choices are made\").queue();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (mustTrash.size() > 0) {\r\n\t\t\t\tgameChannel.sendMessage(\"**[ERROR]** Cannot end turn until all trashes are made\").queue();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t// Don't need to discard\r\n\t\t}\r\n\t\t\r\n\t\t// Mass deletes\r\n\t\tclearMessages();\r\n\t\t\r\n\t\t// If just escaped, send message after clearing\r\n\t\tif (currentPlayer.getCurrentRoom() == 0 && currentPlayer.getPiece().getX() == GlobalVars.playerCoordsPerRoom[39][0]) {\r\n\t\t\t// Update room\r\n\t\t\tcurrentPlayer.setCurrentRoom(39);\r\n\t\t\tif (firstEscapee == currentPlayer) {\r\n\t\t\t\tgameChannel.sendMessage(\":helicopter: **\"+currentName+\"** was the first to escape! They received a **20** :star: **Mastery Token**\\n:skull: Only **4** turn(s) left!\").queue();\r\n\t\t\t} else {\r\n\t\t\t\tgameChannel.sendMessage(\":helicopter: **\"+currentName+\"** escaped in time! They received a **20** :star: **Mastery Token**\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Set cards in PlayArea to not played for next time, Undos the Discarded tag\r\n\t\tfor (int i = 0; i < currentPlayer.getPlayArea().getSize(); i++) {\r\n\t\t\tcurrentPlayer.getPlayArea().getCard(i).setPlayed(false);\r\n\t\t\tif (currentPlayer.getPlayArea().getCard(i).toStringHand().contentEquals(\"*[Discarded]*\")) currentPlayer.getPlayArea().getCard(i).setStringInHand();\r\n\t\t}\r\n\t\t\r\n\t\t// Clear swords, skill, boots, etc\r\n\t\tcurrentPlayer.endOfTurnReset();\r\n\t\tmustDiscard.clear();\r\n\t\t\r\n\t\t// Replaces cards in dungeon row. Only one attack per turn\r\n\t\tif (!status.contentEquals(\"over\")) {\r\n\t\t\tboolean hasAttackedThisTurn = false;\r\n\t\t\tfor (int i = 0; i < 6; i++) {\r\n\t\t\t\t// Checks to see if it should replace card\r\n\t\t\t\tif (dungeonRow[i].isBought()) {\r\n\t\t\t\t\tdungeonRow[i] = mainDeck.getNext();\r\n\t\t\t\t\tif (dungeonRow[i].isDragonAttack() && !hasAttackedThisTurn) {\r\n\t\t\t\t\t\tdragonAttack(cubesPerLevel[attackLevel]);\r\n\t\t\t\t\t\thasAttackedThisTurn = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (dungeonRow[i].isHasArrive()) {\r\n\t\t\t\t\t\tdoArriveEffect(dungeonRow[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tmainDeck.removeTop();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Instantly go on to next player if no dragon attack\r\n\t\t\tif (!hasAttackedThisTurn) {\r\n\t\t\t\tdetermineNextPlayer();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public void endTurn() {\n }", "public void Gamefinished()\n\t\t{\n\t\t\tplayers_in_game--;\n\t\t}", "public void endTurn(){\n game.setNextActivePlayer();\n myTurn = false;\n\n stb.updateData(\"playerManager\", game.getPlayerManager());\n stb.updateData(\"aktivePlayer\", game.getPlayerManager().getAktivePlayer());\n stb.updateData(\"roomList\", game.getRoomManager().getRoomList());\n\n getIntent().putExtra(\"GAME\",game);\n getIntent().putExtra(\"myTurn\", false);\n finish();\n if(!game.getPlayerManager().getPlayerList().get(whoAmI).isDead())\n startActivity(getIntent());\n else\n fcm.unbindListeners();\n }", "public void endOfTurn() {\n if (playerInTurn.equals(Player.RED)) {\n playerInTurn = Player.BLUE;\n observers.turnEnds(playerInTurn, age);\n controlStrategy.playRound(this);\n return;\n }\n\n // If blue is in turn, change player in turn to red and do end-of-round processing.\n playerInTurn = Player.RED;\n\n // Calculate the age of the game in the next round.\n age = ageStrategy.calculateAge(age);\n\n // Restore the move count of all the units.\n for (Position p : world.getUnitPositions()) {\n world.getUnitAt(p).restoreMoveCount();\n }\n\n // For each city, add 6 to the current amount of production, and produce as many units as it can afford.\n for (Position p : world.getCityPositions()) {\n ModifiableCity city = world.getCityAt(p);\n\n workForceStrategy.gatherFoodAndProduction(world, p);\n\n populationStrategy.populationGrowth(world, p);\n\n // produce units!\n city.produceUnits(world, p, observers);\n }\n // Add to the counter of rounds played in the game.\n roundsPlayed++;\n\n observers.turnEnds(playerInTurn, age);\n\n controlStrategy.playRound(this);\n\n }", "public void endTurnCurrent() {\n playerStatus.nActionsDone = 0;\n playerStatus.isActive = false;\n playerStatus.isFirstTurn = false;\n }", "public void endTurn() {\n \t\t// add new cards to the set of usable cards\n \t\tfor (int i = 0; i < newCards.size(); i++)\n \t\t\tcards[newCards.get(i).ordinal()] += 1;\n \n \t\tnewCards.clear();\n \t\tusedCard = false;\n \n \t\tappendAction(R.string.player_ended_turn);\n \t}", "public void onTurnEnd() {\n\n\t}", "public void endUserTurn() {\n\t\tupdateUserTeam();\n\n\t\tusers.get(userTurn).setTransferFinished(true);\n\t\tPlayRound.endUserTurn();\n\t\tMainGui.showCardLayout(\"panelPlayRound\");\n\n\t}", "@Override\n public void endTurn() {\n battle.setState(new EnemyTurn(battle));\n battle.continueBattle();\n }", "public void endTurn() {\n \tselectedX = -1;\n \tselectedY = -1;\n \tmoveToX = -1;\n \tmoveToY = -1;\n \toneMove = false;\n \thasMoved = false;\n\t\tplayer = 0 - player;\n\t\tfor (int i = 0; i < N; i++) {\n for (int j = 0; j < N; j++) {\n \tif (pieces[i][j]) {\n \t\tboardPieces[i][j].doneCapturing();\n \t}\n }\n\t\t}\n\t}", "public void finishGame() {\r\n gameFinished = true;\r\n }", "public void endTurn(){\n for (int i = 0; i<9; i++){\n if(bSquares.get(i).checkhasFocus()){//finds out which square user is playing in. \"i\" is that square\n for (int j = 0; j<9; j++){\n if (!bSquares.get(i).getSmallSquare(j).isCommitted()&&bSquares.get(i).getSmallSquare(j).getOwnership()>0){\n bSquares.get(i).getSmallSquare(j).setCommitted(true);\n stepsCompleted++;//user just finished his turn!\n updateDatabase(i,j, true); //updates the database with the player's move B4 the focus is changed\n for (int t = 0; t<9; t++){//removes focus everywhere else.\n bSquares.get(t).sethasFocus(false);\n }\n \n bSquares.get(j).sethasFocus(true);//tells which square has focus\n }\n }\n }\n }\n \n }", "public void endTurn() {\r\n\t\tPlayer endingPlayer = getCurrentPlayer();\r\n\t\t\r\n\t\t// Show plays and buys during turn change screen\r\n\t\tArrayList<Card> plays = new ArrayList<>();\r\n\t\tArrayList<Card> gains = new ArrayList<>();\r\n\t\tplays.addAll(endingPlayer.deck.duration);\r\n\t\tplays.addAll(endingPlayer.deck.play);\r\n\t\tgains.addAll(endingPlayer.deck.gained);\r\n\t\tif(showGraphics) getGUI().showPlayerBuys(plays, gains);\r\n\t\t\r\n\t\t//Check the card ownership in decks is correct\r\n\t\tfor(Player p : players) {\r\n\t\t\tfor(Card c : p.deck.getDeck()) {\r\n\t\t\t\tif(c.getPlayer() == null) {\r\n\t\t\t\t\tthrow new RuntimeException(c.getName() + \" has no owner, in deck of \"\r\n\t\t\t\t\t\t\t+ p.getPlayerName());\r\n\t\t\t\t}\r\n\t\t\t\tif(!c.getPlayer().equals(p)) {\r\n\t\t\t\t\tthrow new RuntimeException(c.getName() + \" owned by \"\r\n\t\t\t\t\t\t\t+ c.getPlayer().getPlayerName() + \", in deck of \" + p.getPlayerName());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Check for duplicated cards\r\n\t\tfor(Player p : players) {\r\n\t\t\tList<Card> deck = p.deck.getDeck();\r\n\t\t\tfor(int i = 0; i < deck.size(); i++) {\r\n\t\t\t\tfor(int j = i + 1; j < deck.size(); j++) {\r\n\t\t\t\t\tif(deck.get(i) == deck.get(j)) {\r\n\t\t\t\t\t\tthrow new RuntimeException(deck.get(i) + \r\n\t\t\t\t\t\t\t\t\" in 2 places in deck of \" + p.getPlayerName());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//Run player-specific turn ending things\r\n\t\tgetCurrentPlayer().endTurn();\r\n\r\n\t\t//Change whose turn it is\r\n\t\tif(!extraTurn) {\r\n\t\t\tnextTurn();\r\n\t\t}\r\n\t\textraTurn = false;\r\n\r\n\t\t//Check if the game is over\r\n\t\tif(board.isGameOver()) {\r\n\t\t\tgetClient().stopThreads();\r\n\t\t\tmodels.close();\r\n\t\t\tif(showGraphics) getGUI().showScores();\r\n\t\t\tfor(Player p : players) {\r\n\t\t\t\tif(p.isComputerPlayer()) {\r\n\t\t\t\t\tp.getComputerPlayer().close();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t//Change Turn \r\n\t\tif(showGraphics && !getCurrentPlayer().isComputerPlayer()) {\r\n\t\t\tgetGUI().turnNotify();\r\n\t\t}\r\n\r\n\t\t//Resets game phase\r\n\t\tgamePhase = 0;\t\r\n\r\n\t\t//Starts the next person's turn\r\n\t\tgetCurrentPlayer().startTurn();\r\n\t\t\r\n\t\t\r\n\t\t//Save changes to server\r\n\t\tif(showGraphics && getGUI().getMyPlayer().equals(endingPlayer)) {\r\n\t\t\tgetClient().backupGame(this);\r\n\t\t}\r\n\r\n\t\t//Check the decks are correct between computers\r\n\t\tif(showGraphics && getGUI().getMyPlayer().equals(endingPlayer)) {\r\n\t\t\tfor(Player p : players) {\r\n\t\t\t\tgetClient().sendString(\"CHECK \" + p.getPlayerNum() + \" \" + p.deck.toString());\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "void askEndTurn();", "void finishMatch() {\n\t\tint playerResult = ParticipantResult.MATCH_RESULT_NONE;\n\t\tint opponentResult = ParticipantResult.MATCH_RESULT_NONE;\n\n\t\tif (!GameActivity.gameMachine.player.isAlive()) {\n\t\t\tLayoutHelper.showResult(resultTextView, false);\n\t\t\tplayerResult = ParticipantResult.MATCH_RESULT_LOSS;\n\t\t\topponentResult = ParticipantResult.MATCH_RESULT_WIN;\n\t\t} else if (!GameActivity.gameMachine.opponent.isAlive()) {\n\t\t\tLayoutHelper.showResult(resultTextView, true);\n\t\t\tplayerResult = ParticipantResult.MATCH_RESULT_WIN;\n\t\t\topponentResult = ParticipantResult.MATCH_RESULT_LOSS;\n\t\t}\n\n\t\tArrayList<ParticipantResult> results = new ArrayList<ParticipantResult>();\n\n\t\tresults.add(new ParticipantResult(GPGHelper.getMyId(\n\t\t\t\tgameHelper.getApiClient(), match), playerResult,\n\t\t\t\tParticipantResult.PLACING_UNINITIALIZED));\n\n\t\tresults.add(new ParticipantResult(GPGHelper.getOpponentId(\n\t\t\t\tgameHelper.getApiClient(), match), opponentResult,\n\t\t\t\tParticipantResult.PLACING_UNINITIALIZED));\n\n\t\tif (match.getStatus() == TurnBasedMatch.MATCH_STATUS_ACTIVE) {\n\t\t\tif (match.getTurnStatus() == TurnBasedMatch.MATCH_TURN_STATUS_MY_TURN) {\n\t\t\t\tGames.TurnBasedMultiplayer.finishMatch(\n\t\t\t\t\t\tgameHelper.getApiClient(), match.getMatchId(),\n\t\t\t\t\t\twriteGameState(match), results);\n\t\t\t\tturnUsed = true;\n\t\t\t\tremoveNotification();\n\t\t\t}\n\t\t} else if (match.getStatus() == TurnBasedMatch.MATCH_STATUS_COMPLETE) {\n\t\t\tif (match.getTurnStatus() == TurnBasedMatch.MATCH_TURN_STATUS_MY_TURN) {\n\t\t\t\tGames.TurnBasedMultiplayer.finishMatch(\n\t\t\t\t\t\tgameHelper.getApiClient(), match.getMatchId());\n\t\t\t}\n\t\t}\n\t}", "public void buttonEndTurn() {\n\t\tendTurn();\n\t\t}", "void gameFinished(Turn turn) throws IOException;", "private void doLastTurn()\n\t{\n\t\tInteger time = turn;\n\n\t\tstartEnterScore(time);\n\t\tdisposeFrameMap();\n\n\t\ttimer.cancel();\n\t}", "public void endGame() {\n\t\twaitingPlayers.addAll(players);\n\t\tplayers.clear();\n\t\tfor(ClientThread player: waitingPlayers) {\n\t\t\tplayer.points = 0;\n\t\t\tplayer.clientCards.clear();\n\t\t}\n\t\twinners = 0;\n\t\tlosers = 0;\n\t\tpassCounter = 0;\n\t\tdeck.init();\n\t\tview.changeInAndWait(players.size(), waitingPlayers.size());\n\t\tview.writeLog(\"-------------GAME END--------------\");\n\t\tstatus = \"waiting\";\n\t\tstatusCheck();\n\t}", "public void finishGame(){\r\n\t\t\t\tgameStarted = false;\r\n\t\t\t}", "public void endTurn() {\n controller.endTurn();\n }", "public void endTurn() {\n if (getActiveColor() == Piece.COLOR.RED) {\n setActivePlayer(Piece.COLOR.WHITE);\n } else {\n setActivePlayer(Piece.COLOR.RED);\n }\n }", "public void endTurn() {\n suggestionMade = false;\n locAtTurnStart = currentPlayersTurn.getPiece().getLocation();\n accusationChoices = new CardChoice();\n suggestionChoices = new CardChoice();\n turnIndicator = (turnIndicator + 1) % playerOrder.size();\n currentPlayersTurn = playerOrder.get(turnIndicator).getKey();\n currentPlayersSteps = 0;\n }", "public void endTurn()\n\t{\n\t\tthis.decrementEffectDurations();\n\t\tdoneWithTurn = true;\n\t}", "private void endTurn() {\n\t\t\n\t\tif (roundChanger == 1) {\n\t\t\tString currentPlayer = textFieldCurrentPlayer.getText();\n\t\t\tif (currentPlayer.equals(\"Player1\")) {\n\t\t\t\ttextAreaInstructions.setText(\"The current roll to beat is \" + player1.getDie1()\n\t\t\t\t+ \" \" + player1.getDie2() + \" \" + player1.getDie3());\n\t\t\t\trollToBeat = \"The current roll to beat is \" + player1.getDie1()\n\t\t\t\t+ \" \" + player1.getDie2() + \" \" + player1.getDie3();\n\t\t\t} else {\n\t\t\t\ttextAreaInstructions.setText(\"The current roll to beat is \" + player2.getDie1()\n\t\t\t\t+ \" \" + player2.getDie2() + \" \" + player2.getDie3());\n\t\t\t\trollToBeat = \"The current roll to beat is \" + player2.getDie1()\n\t\t\t\t+ \" \" + player2.getDie2() + \" \" + player2.getDie3();\n\t\t\t} \n\t\t\tchangeCurrentPlayerText();\n\t\t\tturn = 0;\n\t\t\troundChanger = 2;\n\t\t} else {\n\t\t\tString winningPlayer = calculateScore(player1, player2);\n\t\t\ttextFieldCurrentPlayer.setText(winningPlayer);\n\t\t\troundChanger = 1;\n\t\t\trollsTaken = 0;\n\t\t\tround = round + 1;\n\t\t\ttextFieldPlayerOneScore.setText(Integer.toString(player1.getPoints()));\n\t\t\ttextFieldPlayerTwoScore.setText(Integer.toString(player2.getPoints()));\n\t\t\ttextAreaInstructions.setText(\"Try to get the highest roll possible!\");\n\t\t\tcheckForGameOver();\n\t\t}\n\t\ttogglebtnD1.setSelected(false);\n\t\ttogglebtnD2.setSelected(false);\n\t\ttogglebtnD3.setSelected(false);\n\t\tdisableDice();\n\t\tturn = 0;\n\t}", "public void finish() {\n if (this.finished) {\n warn(\"Can't finish the scoreboard since it is already finished.\");\n return;\n }\n\n this.finished = true;\n\n for (int i = rowCache.size() - 1; i >= 0; i--){\n final Row row = rowCache.get(i);\n final Team team = this.bukkitScoreboard.registerNewTeam(\"dummy.test.\" + (i+1));\n\n team.addEntry(ChatColor.values()[i] + \"\");\n\n this.obj.getScore(ChatColor.values()[i] + \"\").setScore(rowCache.size()-i);\n\n row.team = team;\n row.setMessage(row.message);\n }\n }", "boolean CanFinishTurn();", "public void nextTurn()\n\t{\n\t\tthis.actionListToExecute.clear();\n\t\tthis.board.discardLastPlayedCard();\n\t\tthis.getCurrentPlayer().getDataInput().printMessage(this.getCurrentPlayerGameStatus());\n\t\tthis.getCurrentPlayer().execEndOfTurn();\n\t\t\n\t\tint nbPlayerCardPickup = this.getAmountOfPlayerCardToFillYourHand() - this.getCurrentPlayer().getPlayerCardDeck().size();\n\t\tfor(int i = 0; i < nbPlayerCardPickup; i++)\n\t\t{\n\t\t\tthis.getCurrentPlayer().getPlayerCardDeck().addCard(this.getNextPlayerCard());\n\t\t}\n\t\t\n\t\tcurrentPlayerID = (currentPlayerID + 1) % this.getPlayerList().size();\n\t\tif(currentPlayerID == 0)\n\t\t{\n\t\t\tcurrentPlayerID = this.getPlayerList().size();\n\t\t}\n\t\tthis.getCurrentPlayer().execBeginOfTurn();\n\t\tinitBeginOfTurn();\n\t}", "public void toEndingTurn() {\n }", "public void nextTurn() {\n visionChanged = true;\n SoundPlayer.playEndTurn();\n // Check if any protection objectives have failed\n gameState.updateAllHeroProtectionGoals(getHeroManager());\n // hook the next turn\n if (!multiplayerGameManager.hookNextTurn()) {\n\n if (map.enemyPerformingMove()) {\n return;\n }\n // Enemy action was made\n if (playerTurn && map.hasEnemy()) {\n try {\n map.enemyTurn(this);\n } catch (InterruptedException e) {\n logger.error(\"ayylmao at the GameManager.nextTurn(..) Method\");\n Platform.exit();\n Thread.currentThread().interrupt();\n }\n } else {\n map.playerTurn(this);\n updateBuffIcons();\n updateTempVisiblePoints();\n map.turnTick();\n for(CurrentHeroChangeListener listener:heroChangeListeners){\n \tlistener.onHeroChange(getHeroManager().getCurrentHero());\n }\n }\n\n } else {\n moveViewTo(getHeroManager().getCurrentHero().getX(), getHeroManager().getCurrentHero().getY());\n updateBuffIcons();\n updateTempVisiblePoints();\n }\n\n map.updateVisibilityArray();\n dayNightClock.tick();\n turnTickLiveTiles();\n abilitySelected = AbilitySelected.MOVE;\n abilitySelectedChanged = true;\n backgroundChanged = true;\n gameChanged = true;\n minimapChanged = true;\n saveOriginator.writeMap(this.map, this.getObjectives(), this.gameState);\n // update(this.tracker,null);\n }", "private void finishPlayAlong() {\n\n callback.questionPressed(null, score, lives); // ENDS this question\n\n }", "public void endRace(){\n\t\tstartTime =-1;\n\t\tfor(Player p: playersFinished){\n\t\t\twhile(!setPlayerID(p.getID())){\n\t\t\t\ttempNumber++;\n\t\t\t\tsetPlayerID(tempNumber);\n\t\t\t}\n\t\t}\n\t}", "public void finishPhase(TurnTracker turn_tracker_pointer, int player_index);", "public void endTurn() {\n\t\tif (whoseTurn == 0) {\n\t\t\twhoseTurn = 1;\n\t\t} else {\n\t\t\twhoseTurn = 0;\n\t\t}\n\t\thasMoved = false;\n\t\thasSelected = false;\n\t\tif (prevSelected != null) {\n\t\t\tprevSelected.doneCapturing();\n\t\t}\n\t\tprevSelected = null;\n\t\tprevSelectedX = 0;\n\t\tprevSelectedY = 0;\n\t}", "public void endTurn() {\r\n\t\tcontraband.clear();\r\n\t\tactions = 1;\r\n\t\tbuys = 1;\r\n\t\tif(treasure > 0) treasure = 0;\r\n\t\tpotion = 0;\r\n\t\tcoppersmith = 0;\r\n\t\tbridge = 0;\r\n\t\tquarry = 0;\r\n\t\tdeck.cleanUp();\r\n\t\taccess.log(getPlayerName() + \"'s Deck: \" + deck.toString());\r\n\t\taccess.log(getPlayerName() + \"'s turn ended\");\r\n\t\tnotifyObservers();\r\n\t}", "private void doGameTurn()\n\t{\n\t\tif (!lost && !won)\n\t\t{\n\t\t\trefreshMapAndFrame();\n\t\t\t\n\t\t\tcheckPlayerCondition();\n\t\t\tElementAccess.openExit();\n\t\t\tSystem.out.println(turn);\n\t\t}\n\t\telse if (lost)\n\t\t{\n\t\t\tSound.lost();\n\t\t\trefreshMapAndFrame();\n\n\t\t\tif (playerHasLost())\n\t\t\t{\n\t\t\t\tstop = true;\n\t\t\t}\n\n\t\t\tMapInstance.getInstance().levelRestart();\n\t\t\tlost = false;\n\t\t}\n\t\telse if (won)\n\t\t{\n\t\t\tSound.won();\n\t\t\trefreshMapAndFrame();\n\n\t\t\twon = false;\n\t\t\tif (playerNotInLevel())\n\t\t\t{\n\t\t\t\tstop = true;\n\t\t\t}\n\n\t\t\tnextLevel();\n\t\t\tMapInstance.getInstance().levelRestart();\n\t\t}\n\t}", "public void nextPlayerInTurn() {\n currentPlayerTurn= playersTurns.poll();\n if (currentPlayerTurn != null) {\n eventListener.addEventObject(new PlayerEvent(currentPlayerTurn.getPlayerName(),EventNamesConstants.PlayerTurnArrived));\n currentPlayerName = currentPlayerTurn.getPlayerName();\n }\n else {\n currentPlayerName = \"None\";\n }\n }", "public void endTurn() {\n\t\tfireChanges();\n\t\t\n\t\tif(!isConfirmed())\n\t\t\tfirePropertyChange(Handler.END_TURN_PROPERTY, \"Do you want to confirm ending your turn?\");\n\t\telse{\n\t\t\tAbstractGameCommand endTurnCommand = new EndTurnCommand(getGame());\n\t\t\tendTurnCommand.execute();\n\t\t\t\n\t \tfirePropertyChange(Handler.CURRENT_PLAYER_PROPERTY, getGame().getCurrentPlayer().getName());\n\t\t\tresetConfirm();\n\t\t}\n\t\t\n\t\tfireChanges();\n\t}", "public void endRound() {\n\t\tif (roundNumber>maxRounds) {\n\t\t\tSystem.out.println(\"hae �etta er MAX ROUNDS! LEIKUR �TTI A� VERA B�INN\");\n\t\t\tendGame();\n\t\t} else {\n\t\t\tSystem.out.println(\"�ETTA er r�tt leikur er ekki b�inn round: \"+ getCurrentRound());\n\t\t\tmatchResults = core.simulateNextRound();\n\t\t\tSystem.out.println(\"B�INN A� SIMULATA ROUND \");\n\t\t\tFootballPlayer[] players = core.getAllFootballPlayers();\n\t\t\tfor (int i = 0; i<players.length; i++) {\n\t\t\t\tStatistics[] stats = players[i].getStats();\n\t\t\t\tSystem.out.println(players[i].getName() + \" \" + stats[1].getGoals());\n\t\t\t}\n\t\t\tcalculatePoints();\n\t\t\troundNumber++;\n\t\t}\n\t\tusers.get(0).setTransferFinished(false);\n\t\tusers.get(1).setTransferFinished(false);\n\t}", "private void nextRound()\n {\n Player currentPlayer = roundManager.next();\n\n if(!currentPlayer.getClientConnection().isConnected() || !currentPlayer.getClientConnection().isLogged())\n {\n if(currentPlayer.equals(lastFinalFrenzyPlayer))return;\n nextRound();\n return;\n }\n\n if(gameMode == GameMode.FINAL_FRENZY_BEFORE_FP && roundManager.isFirstPlayer(currentPlayer))gameMode = GameMode.FINAL_FRENZY_AFTER_FP;\n\n try\n {\n currentPlayer.getView().roundStart();\n notifyOtherClients(currentPlayer, virtualView -> virtualView.showNotification(\"È il turno di \"+currentPlayer.getUsername()));\n\n if(roundManager.isFirstRound() || !currentPlayer.isFirstRoundPlayed()) firstRound(currentPlayer);\n\n for(int i = 0; i < gameMode.getPlayableAction(); i++)\n {\n currentPlayer.resetExecutedAction();\n boolean continueRound = executeAction(currentPlayer);\n if(!continueRound)break;\n }\n\n if(gameMode == GameMode.NORMAL)new ReloadAction(this, currentPlayer, ReloadAction.RELOAD_ALL).execute();\n }\n catch (ConnectionErrorException e)\n {\n Logger.error(\"Connection error during \"+currentPlayer.getUsername()+\"'s round!\");\n notifyOtherClients(currentPlayer, virtualView -> virtualView.showNotification(currentPlayer.getUsername()+\" si è disconnesso!\"));\n }\n catch (TimeOutException e)\n {\n Logger.info(\"Player \"+currentPlayer.getUsername()+\" has finished his time\");\n }\n\n currentPlayer.getView().roundEnd();\n currentPlayer.resetExecutedAction();\n refillMap();\n sendBroadcastUpdate();\n if(isFinalFrenzy())currentPlayer.setLastRoundPlayed(true);\n handleDeadPlayers(currentPlayer);\n if(isFinalFrenzy() && currentPlayer.equals(lastFinalFrenzyPlayer))return;\n checkForFinalFrenzy(currentPlayer);\n if(match.connectedPlayerSize() <= 0 || match.connectedPlayerSize() < MatchSettings.getInstance().getMinPlayers())return;\n nextRound();\n\n }", "public void imFinished() {\n isUserDone = true;\n layoutUserReady.setVisibility(View.VISIBLE);\n\n String userTextToShow = \"\";\n switch (challengeType) {\n case TIME:\n userTextToShow = getString(R.string.user_finished) +\n \"\\n\" +\n getString(R.string.final_distance) +\n (int)((ChallengeSenderFragment)senderFragment).getRun().getTrack().getDistance() +\n getString(R.string.meters);\n break;\n case DISTANCE:\n userTextToShow = getString(R.string.user_completed) +\n challengeGoal + getString(R.string.km) +\n getString(R.string.white_space) + getString(R.string.in) +\n UtilsUI.timeToString((int)((ChallengeSenderFragment)senderFragment).getRun().getDuration(),\n true);\n break;\n }\n userTxt.setText(userTextToShow);\n //noinspection deprecation\n userStatus.setImageDrawable(getResources().getDrawable(R.drawable.finish_icon));\n\n fragmentManager.beginTransaction().remove(senderFragment).commitAllowingStateLoss();\n\n challengeProxy.imFinished();\n\n if (isOpponentDone) {\n isIntendedActivityExit = true;\n endChallenge();\n }\n }", "public void nextTurn() {\r\n activePlayer = nextPlayer;\r\n advanceNextPlayer();\r\n }", "public void onFinish() {\n\t\tthis.notRewarded.putAll(Bake_Auxillary.rewardPlayers(projectReminderList, activeQuest.getLoot(bakeInstance.API_LEVEL), activeQuest.getThreshold(), activeQuest.getName()));\n\t\tnewQuest();\n\t}", "public void endTurn()\n {\n revealedCardsScreen.setVisible(false);\n accusationScreen.setVisible(false);\n\n this.played = false;\n\n //call client controller's end turn method\n clientController.endTurn();\n }", "void concludeRound() {\n\n ArrayList<Card> currentTopCards = getCurrentTopCards();\n transferCards(roundWinner, currentTopCards);\n eliminatePlayers();\n\n logger.log(\"Communal Deck: \" + deck);\n logger.log(divider);\n for (Player player : players) {\n logger.log(\"Hand: \" + player);\n }\n\n logger.log(\"Round complete.\");\n\n setGameState(GameState.ROUND_COMPLETE);\n }", "public void nextTurn(){\n\t\tplayers[currentPlayer].setNotCurrentPlayer();\n\t\t\n\t\t//increment current player to advance to next player\n\t\tcurrentPlayer = (currentPlayer + 1) % players.length;\n\t\t\n\t\t//update the new current player\n\t\tupdateCurrentPlayerView();\n\t}", "public void endGame() {\n for (Player player : this.players.values()) {\n if (player.getBankroll() == this.playerAmount * DEFAULT_BANKROLL) {\n this.doPokerEnds = true;\n break;\n }\n }\n this.startingGamePlayer = ++this.startingGamePlayer % this.playerAmount;\n }", "private void endTurn(){\r\n String currentPlayer = cantStop.getGameBoard().getCurrentPlayer().getName();\r\n\t\tgameOver = cantStop.getGameBoard().endTurn(didBust);\r\n\t\t\r\n\t\tif(gameOver){\r\n\t\t\tstatusLabel.setText(currentPlayer + \r\n\t\t\t\t\t\" wins! Go again?\");\r\n\t\t\tupdate();\r\n\t\t} else {\r\n\t\t\tcantStop.getGameBoard().startNewTurn();\r\n\t\t\tallowNewRoll();\r\n\t\t}\r\n\t}", "private void finishGame() {\n for (GameObject gameObject : gameObjects) gameObject.finishGame(game);\n gameAlertDialog.show(\"FINISH\");\n }", "public void inTurn() {\n\t\tthis.timer = new Timer();\n\t\ttimer.schedule(new TimerTask() {\n\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tfinishTurn();\n\t\t\t}\n\t\t}, turnMaxSeconds * 1000);\n\n\t}", "public void roundEnded() {\n\t\t\n\t\t// Deduct a life from the currently active player.\n\t\t// Increment the current round number by 1.\n\t\tdeductLife();\n\t\tincrementCurrentRoundNumber();\n\t\t\n\t\t// Switch which player is now active. \n\t\tswitchPlayer();\n\t}", "public static void NextTurn() {\n if (num_of_players == turn)\n turn=0;\n turn++;\n }", "void gameFinished();", "public boolean isFinished() {\n\t\tif ((player1_moves | player2_moves) == COMPLETE) {\n\t\t\tfinished = true;\n\t\t\tcurrentPlayer = '\\0';\n\t\t}\n\t\tfor (int i : winning_cases) {\n\t\t\tif ((player1_moves & i) == i) {\n\t\t\t\twinner = 'X';\n\t\t\t\tfinished = true;\n\t\t\t} else if ((player2_moves & i) == i) {\n\t\t\t\twinner = 'O';\n\t\t\t\tfinished = true;\n\t\t\t}\n\t\t}\n\t\treturn finished;\n\t}", "public void nextTurn(){\r\n removeIceAndFire();\r\n currentTurn++;\r\n }", "public void onFinish() {\n timer.setText(\"Time's Up!\");\n Intent timesUp = new Intent(QuizActivity.this, QuizComplete.class);\n timesUp.putExtra(TRANSFER_SCORE, mScore);\n startActivity(timesUp);\n }", "private void nextTurn()\n\t{\n\t\tturn++;\n\t\tFrameMap.remove();\n\t}", "public void endsGameAndSetsWinner(Player player) {\n this.winner = player.getId(); \n this.gameStarted = false; \n \n }", "void waitingForMyTurn();", "@Override\n public void execute() {\n String nextPlayer = CModel.getInstance().getCurrGame().advancePlayerTurn();\n if(nextPlayer.equals(CModel.getInstance().getMyUser().getUserName())) {\n CModel.getInstance().setCurrGameState(new MyTurn());\n }\n else {\n //update the player stats\n CModel.getInstance().setCurrGameState(new NotMyTurn());\n }\n CModel.getInstance().updatePlayerStatsView();\n }", "public void nextTurn() {\n\t\tLog.d(TAG, \"nextTurn()\");\t\t\n\t\ttickPeople();\n\t\t//doEvents();\n\t\tupdateBar();\n\t}", "void finishSwitching();", "private void endGame() {\r\n\r\n m_state.setState(State.ENDING_GAME);\r\n\r\n /* find winner */\r\n for(KimTeam team : m_survivingTeams) {\r\n if(team != null) {\r\n if(!team.isOut()) {\r\n m_winner = team;\r\n }\r\n\r\n //remove survivors from m_teams so not to duplicate stats\r\n m_teams[team.m_freq] = null;\r\n }\r\n }\r\n\r\n /* end poll */\r\n if(m_poll != null) {\r\n m_poll.endPoll(m_winner, m_connectionName);\r\n m_poll = null;\r\n }\r\n\r\n /* display scoresheet */\r\n m_botAction.sendArenaMessage(\"--------Base1--------W--L --------Base2--------W--L --------Base3--------W--L --------Base4--------W--L\");\r\n\r\n if(!m_skipFirstRound) {\r\n printFormattedTeams(m_teams, m_numTeams);\r\n m_botAction.sendArenaMessage(\"------------------------- ------------------------- ------------------------- -------------------------\");\r\n }\r\n\r\n printFormattedTeams(m_survivingTeams, 4);\r\n m_botAction.sendArenaMessage(\"-------------------------------------------------------------------------------------------------------\");\r\n\r\n if(m_winner != null) {\r\n m_botAction.sendArenaMessage(\"Winner: \" + m_winner.toString(), 5);\r\n\r\n for(KimPlayer kp : m_winner) {\r\n Player p = m_botAction.getPlayer(kp.m_name);\r\n\r\n if(p != null && p.isPlaying()) {\r\n m_botAction.warpTo(p.getPlayerID(), 512, 277);\r\n }\r\n }\r\n } else {\r\n m_botAction.sendArenaMessage(\"No winner.\");\r\n }\r\n\r\n updateDB();\r\n\r\n /* announce mvp and clean up */\r\n m_botAction.scheduleTask(new TimerTask() {\r\n public void run() {\r\n m_botAction.sendArenaMessage(\"MVP: \" + m_mvp.m_name, 7);\r\n //refreshScoreboard();\r\n cleanUp();\r\n resetArena();\r\n m_state.setState(State.STOPPED);\r\n }\r\n }, 4000);\r\n }", "@Override\n\tpublic boolean nextPlayersTurn(int currentTurn, int startRow, int startCol, int endRow, int endCol) {\n\t\tif (currentTurn % player2.turn == 0) {\n\t\t\tSystem.out.println(\"****YEE-HAW! ITS PLAYER 2'S TURN*****\");\n\t\t\texecuteMove(player2, player1, state.gameBoard, currentTurn, startRow, startCol, endRow, endCol);\n\t\t} else {\n\t\t\tSystem.out.println(\"****YEE-HAW! ITS PLAYER 2'S TURN*****\");\n\t\t\texecuteMove(player1, player2, state.gameBoard, currentTurn, startRow, startCol, endRow, endCol);\n\t\t}\n\t\treturn continueGame;\n}", "public void next_player() {\n\t\tthis.nb_turn++;\n\t\tthis.player_turn++;\n\t\tthis.same_dice_in_a_row = 0;\n\t\tif (player_turn == this.players.size()) {\n\t\t\tthis.player_turn = 0;\n\t\t}\n\n\t\tif (get_player_from_turn().get_surrend()) {\n\t\t\tthis.nb_turn--;\n\t\t\tif (get_player_in_game() > 0) {\n\t\t\t\tthis.next_player();\n\t\t\t}\n\t\t}\n\t}", "public void endGame()\n\t{\n\t\tthis.opponent = null;\n\t\tthis.haveGame = false;\n\t\tthis.isTurn = false;\n\t\tfor(int i = 0; i < 3; i++)\n\t\t{\n\t\t\tfor(int j = 0; j < 3; j++)\n\t\t\t{\n\t\t\t\tboard[i][j] = 0;\n\t\t\t}\n\t\t}\n\t}", "public void doTurn() {\n\t\tGFrame.getInstance().aiHold();\n\t}", "public void giveUp() {\n if (!finished)\n player.kill();\n }", "private void checkFinish() {\n for (Player temp: players) {\n if (temp.getNumberOfCards() == 0) {\n System.out.println(\"...................................................................................................................................................................\");\n System.out.println(\"Game finished.\\n\");\n System.out.println(Color.PURPLE.getPrintColor() + temp.getName() + \" is winner.\\n\" + Color.RESET.getPrintColor());\n setGameStatus();\n }\n }\n if (!gameStatus) {\n System.out.println(Color.RESET.getPrintColor() + \"Results:\\n\");\n for (Player temp: players) {\n if (temp.getNumberOfCards() != 0) {\n System.out.println(Color.CYAN.getPrintColor() + temp.toString());\n System.out.print(temp.handToString() + Color.RESET.getPrintColor());\n }\n }\n }\n }", "public void setPlayerFinished(Player player) {\r\n Log.d(Thread.currentThread().getName(), \"setPlayerFinished(\" + player.getName() + \")\");\r\n for (int i = 0; i < players.size(); i++) {\r\n PlayerContainer pc = players.get(i);\r\n if (pc.player.getName().equals(player.getName())) {\r\n players.remove(pc);\r\n finishedPlayers.add(player);\r\n break;\r\n }\r\n }\r\n if (activePlayer.getName().equals(player.getName())) {\r\n nextTurn();\r\n }\r\n if (nextPlayer.getName().equals(player.getName())) {\r\n advanceNextPlayer();\r\n }\r\n }", "public void nextTurn() {\r\n\r\n\t\t// System.out.println(\"nextTurn================================================================================================\" + this.DiceNumber);\r\n\t\tif (gameState == GameState.Playing) {\r\n\t\t\tif (!isPlayerCall && currentTurnPlayer != null && !currentTurnPlayer.getPlayerDetail().getIsRobot()) {\r\n\t\t\t\tif (currentTurnPlayer.PlayerTimeOutCall()) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tcurrentTurnPlayer.addNoOperateTime();\r\n\r\n\t\t\t}\r\n\r\n\t\t\t// current turn count add one.\r\n\t\t\tturnIndex++;\r\n\t\t\tisPlayerCall = false;\r\n\t\t\tcurrentTurnPlayer = findNextLiving();\r\n\t\t\tsendGameNextTurn(currentTurnPlayer, this);\r\n\r\n\t\t\t// if current player is robot,add robot logical action.\r\n\t\t\tif (currentTurnPlayer.getPlayerDetail().getIsRobot()\r\n\t\t\t\t\t|| currentTurnPlayer.getPlayerDetail().getIsRobotState()) {\r\n\t\t\t\tThreadSafeRandom random = new ThreadSafeRandom();\r\n\t\t\t\tAddAction(new RobotProcessAction(random.next(1, 6) * 1000, currentTurnPlayer));// 机器人随机一个叫的时间\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// if the player has trusteed the game,add trustee action to deal\r\n\t\t\t// with the condition.\r\n\t\t\t// if (currentTurnPlayer.getPlayerState() == PlayerState.Trustee)\r\n\t\t\t// {\r\n\t\t\t// AddAction(new TrusteePlayerAction(random.next(3, 6) * 1000,\r\n\t\t\t// currentTurnPlayer));\r\n\t\t\t// return;\r\n\t\t\t// }\r\n\r\n\t\t\t// this turn wait for 20 seconds.\r\n\t\t\tWaitTime(1000 * 20);// csf0423 以前是12 + 8\r\n\t\t\tonBeginNewTurn();\r\n\t\t}\r\n\t}", "private void playTurn()\n {\n try\n {\n XMLHandler.saveGame(game, GAME_CLONE_PATH);\n }\n catch(IOException | JAXBException | SAXException ex)\n {\n // TODO... ConsoleUtils.message(\"An internal save error has occured, terminating current game\");\n gameEnded = true;\n return;\n }\n \n moveCycle();\n \n if (!game.validateGame()) \n {\n IllegalBoardPenalty();\n }\n \n String gameOverMessage = game.isGameOver();\n if (gameOverMessage != null) \n {\n //TODO: ConsoleUtils.message(gameOverMessage);\n gameEnded = true;\n }\n \n game.switchPlayer();\n }", "public void endTurn() throws JSONException {\n\t\tJSONObject json = new JSONObject();\n\t\tJSONObject json2 = new JSONObject();\n\t\tjson.put(\"Zug beenden\", json2);\n\t\tcontroller.getGame().setRoundCounter(controller.getGame().getRoundCounter()+1);\n\t\t// setze die entwicklungskarte zurück die in diesem zug gekauft wurde\n\t\tcontroller.setDevCard(-1);\n\t\tclient.send(json);\n\t}", "private void endMyTurn() {\n // end my turn, then.\n Entity next = clientgui.getClient().getGame()\n .getNextEntity(clientgui.getClient().getGame().getTurnIndex());\n if ((IGame.Phase.PHASE_DEPLOYMENT == clientgui.getClient().getGame()\n .getPhase())\n && (null != next)\n && (null != ce())\n && (next.getOwnerId() != ce().getOwnerId())) {\n clientgui.setDisplayVisible(false);\n }\n cen = Entity.NONE;\n clientgui.getBoardView().select(null);\n clientgui.getBoardView().highlight(null);\n clientgui.getBoardView().cursor(null);\n clientgui.bv.markDeploymentHexesFor(null);\n disableButtons();\n }", "private void endGame(){\n if (winner){\n Toast.makeText(this, \"Fin del Juego: Tu ganas\", Toast.LENGTH_SHORT).show();\n finish();\n } else {\n Toast.makeText(this, \"Fin del Juego: Tu pierdes\", Toast.LENGTH_SHORT).show();\n finish();\n }\n }", "public void startTurn(){\n if (hasWinner()){\n announceWinner();\n return;\n }\n\n gameDraft();\n gameAttack();\n if (hasWinner()) return; //Skipping fortify if the game is won\n gameFortify();\n displayMessage(\"End of \" + currentPlayer.getName() + \"'s turn!\");\n }", "@Override\n public void endGameAsWin()\n {\n // UPDATE THE GAME STATE USING THE INHERITED FUNCTIONALITY\n super.endGameAsWin();\n \n // RECORD THE TIME IT TOOK TO COMPLETE THE GAME\n long gameTime = endTime.getTimeInMillis() - startTime.getTimeInMillis();\n \n // RECORD IT AS A WIN\n ((MahjongSolitaireMiniGame)miniGame).getPlayerRecord().addWin(currentLevel, gameTime);\n ((MahjongSolitaireMiniGame)miniGame).savePlayerRecord();\n \n // DISPLAY THE WIN DIALOG\n miniGame.getGUIDialogs().get(WIN_DIALOG_TYPE).setState(VISIBLE_STATE); \n\n // AND PLAY THE WIN ANIMATION\n playWinAnimation();\n \n // AND PLAY THE WIN AUDIO\n miniGame.getAudio().stop(MahjongSolitairePropertyType.SPLASH_SCREEN_SONG_CUE.toString()); \n miniGame.getAudio().stop(MahjongSolitairePropertyType.GAMEPLAY_SONG_CUE.toString());\n miniGame.getAudio().play(MahjongSolitairePropertyType.WIN_AUDIO_CUE.toString(), false);\n }", "private void HandleOnMoveEnd(Board board, Piece turn, boolean success){\n\t}", "@Override\n\tpublic void nextTurn()\n\t{\n\t\tif (isInventoryFull())\n\t\t{\n\t\t\tgetMyPlayer().getDoneActions().add(\n\t\t\t\t\t\"[THE INVENTORY OF \" + myWorker.getId()\n\t\t\t\t\t\t\t+ \" IS FULL AND IS GONNA UNLOAD]\");\n\t\t\tdestBuilding.getWorkersInside().remove(myWorker);\n\t\t\tBuilding unloadBuilding = null;\n\t\t\tif (getMyPlayer().getStockpiles().size() > 0)\n\t\t\t{\n\t\t\t\tRandom random = new Random(100);\n\t\t\t\tint chosenStockpile = random.nextInt(getMyPlayer()\n\t\t\t\t\t\t.getStockpiles().size());\n\n\t\t\t\tunloadBuilding = getMyPlayer().getStockpiles().get(\n\t\t\t\t\t\tchosenStockpile);\n\t\t\t} else if (getMyPlayer().getMainBuildings().size() > 0)\n\t\t\t{\n\t\t\t\tunloadBuilding = getMyPlayer().getMainBuildings().get(0);\n\t\t\t}\n\n\t\t\tif (doIMoveToBuilding(unloadBuilding))\n\t\t\t{\n\t\t\t\tMoveAction move;\n\t\t\t\tPoint dest = getMoveDestination(unloadBuilding);\n\t\t\t\tif (dest != null)\n\t\t\t\t{\n\t\t\t\t\tmove = new MoveAction(getMyPlayer(), myWorker, dest);\n\t\t\t\t\tmove.doAction();\n\t\t\t\t}\n\t\t\t} else\n\t\t\t{\n\t\t\t\tgetMyPlayer().getDoneActions().add(\n\t\t\t\t\t\t\"[\" + myWorker.getId() + \" ADDED \"\n\t\t\t\t\t\t\t\t+ myWorker.getLoadInInventory()\n\t\t\t\t\t\t\t\t+ \" TO RESOURCES]\");\n\t\t\t\tif (destBuilding instanceof Farm)\n\t\t\t\t\tgetMyPlayer().getPlayerInfo().getFoodInStock()\n\t\t\t\t\t\t\t.addTo(myWorker.getLoadInInventory());\n\t\t\t\telse if (destBuilding instanceof StoneMine)\n\t\t\t\t\tgetMyPlayer().getPlayerInfo().getStoneInStock()\n\t\t\t\t\t\t\t.addTo(myWorker.getLoadInInventory());\n\t\t\t\telse if (destBuilding instanceof GoldMine)\n\t\t\t\t\tgetMyPlayer().getPlayerInfo().getGoldInStock()\n\t\t\t\t\t\t\t.addTo(myWorker.getLoadInInventory());\n\t\t\t\telse if (destBuilding instanceof WoodCamp)\n\t\t\t\t\tgetMyPlayer().getPlayerInfo().getLumberInStock()\n\t\t\t\t\t\t\t.addTo(myWorker.getLoadInInventory());\n\t\t\t\tmyWorker.setOccupationType(OccupationType.IDLE);\n\t\t\t\tdestBuilding.getWorkersInside().remove(myWorker);\n\t\t\t\tmyWorker.setLoadInInventory(0);\n\t\t\t\tmyWorker.setActionController(null);\n\t\t\t}\n\t\t} else if (doIMoveToBuilding(destBuilding))\n\t\t{\n\t\t\tPoint dest = getMoveDestination(destBuilding);\n\t\t\tif (dest == null)\n\t\t\t\tSystem.err\n\t\t\t\t\t\t.println(\"BuildController class:nextTurn(): dest is null! do something!!!!\");\n\t\t\telse\n\t\t\t{\n\t\t\t\tMoveAction move = new MoveAction(getMyPlayer(), myWorker, dest);\n\t\t\t\tmove.doAction();\n\t\t\t}\n\t\t} else if (!isInventoryFull())\n\t\t{\n\t\t\tdestBuilding.getWorkersInside().add(myWorker);\n\t\t\tint collectResourcePerTurn = 0;\n\t\t\tif (destBuilding instanceof Farm)\n\t\t\t{\n\t\t\t\tmyWorker.setFoodCollectingExperience(myWorker\n\t\t\t\t\t\t.getFoodCollectingExperience() + 0.01);\n\t\t\t\tfor (int i = 0; i < getMyPlayer().getPlayerInfo()\n\t\t\t\t\t\t.getBuildingSize().get(destBuilding.getObjectType()); i++)\n\t\t\t\t{\n\t\t\t\t\tfor (int j = 0; j < getMyPlayer().getPlayerInfo()\n\t\t\t\t\t\t\t.getBuildingSize()\n\t\t\t\t\t\t\t.get(destBuilding.getObjectType()); j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tcollectResourcePerTurn += getMyPlayer().getMyMap()\n\t\t\t\t\t\t\t\t.getMapBlocks()[i\n\t\t\t\t\t\t\t\t+ destBuilding.getPosition().getX()][j\n\t\t\t\t\t\t\t\t+ destBuilding.getPosition().getY()].getFood();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcollectResourcePerTurn /= (getMyPlayer().getPlayerInfo()\n\t\t\t\t\t\t.getBuildingSize().get(destBuilding.getObjectType()) * getMyPlayer()\n\t\t\t\t\t\t.getPlayerInfo().getBuildingSize()\n\t\t\t\t\t\t.get(destBuilding.getObjectType()));\n\t\t\t\tcollectResourcePerTurn *= (int) ((1 + myWorker\n\t\t\t\t\t\t.getFoodCollectingExperience()) * (getMyPlayer()\n\t\t\t\t\t\t.getPlayerInfo().getFoodProductionRate()));\n\t\t\t} else if (destBuilding instanceof GoldMine)\n\t\t\t{\n\t\t\t\tmyWorker.setGoldMiningExperience(myWorker\n\t\t\t\t\t\t.getGoldMiningExperience() + 0.01);\n\t\t\t\tfor (int i = 0; i < getMyPlayer().getPlayerInfo()\n\t\t\t\t\t\t.getBuildingSize().get(destBuilding.getObjectType()); i++)\n\t\t\t\t{\n\t\t\t\t\tfor (int j = 0; j < getMyPlayer().getPlayerInfo()\n\t\t\t\t\t\t\t.getBuildingSize()\n\t\t\t\t\t\t\t.get(destBuilding.getObjectType()); j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tcollectResourcePerTurn += getMyPlayer().getMyMap()\n\t\t\t\t\t\t\t\t.getMapBlocks()[i\n\t\t\t\t\t\t\t\t+ destBuilding.getPosition().getX()][j\n\t\t\t\t\t\t\t\t+ destBuilding.getPosition().getY()].getGold();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcollectResourcePerTurn /= (getMyPlayer().getPlayerInfo()\n\t\t\t\t\t\t.getBuildingSize().get(destBuilding.getObjectType()) * getMyPlayer()\n\t\t\t\t\t\t.getPlayerInfo().getBuildingSize()\n\t\t\t\t\t\t.get(destBuilding.getObjectType()));\n\n\t\t\t\tcollectResourcePerTurn *= (int) ((1 + myWorker\n\t\t\t\t\t\t.getGoldMiningExperience()) * (getMyPlayer()\n\t\t\t\t\t\t.getPlayerInfo().getGoldProductionRate()));\n\t\t\t} else if (destBuilding instanceof StoneMine)\n\t\t\t{\n\t\t\t\tmyWorker.setStoneMiningExperience(myWorker\n\t\t\t\t\t\t.getFoodCollectingExperience() + 0.01);\n\t\t\t\tfor (int i = 0; i < getMyPlayer().getPlayerInfo()\n\t\t\t\t\t\t.getBuildingSize().get(destBuilding.getObjectType()); i++)\n\t\t\t\t{\n\t\t\t\t\tfor (int j = 0; j < getMyPlayer().getPlayerInfo()\n\t\t\t\t\t\t\t.getBuildingSize()\n\t\t\t\t\t\t\t.get(destBuilding.getObjectType()); j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tcollectResourcePerTurn += getMyPlayer().getMyMap()\n\t\t\t\t\t\t\t\t.getMapBlocks()[i\n\t\t\t\t\t\t\t\t+ destBuilding.getPosition().getX()][j\n\t\t\t\t\t\t\t\t+ destBuilding.getPosition().getY()].getStone();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcollectResourcePerTurn /= (getMyPlayer().getPlayerInfo()\n\t\t\t\t\t\t.getBuildingSize().get(destBuilding.getObjectType()) * getMyPlayer()\n\t\t\t\t\t\t.getPlayerInfo().getBuildingSize()\n\t\t\t\t\t\t.get(destBuilding.getObjectType()));\n\n\t\t\t\tcollectResourcePerTurn *= (int) ((1 + myWorker\n\t\t\t\t\t\t.getStoneMiningExperience()) * (getMyPlayer()\n\t\t\t\t\t\t.getPlayerInfo().getStoneProductionRate()));\n\n\t\t\t} else if (destBuilding instanceof WoodCamp)\n\t\t\t{\n\t\t\t\tmyWorker.setWoodCampExperience(myWorker.getWoodCampExperience() + 0.01);\n\t\t\t\tfor (int i = 0; i < getMyPlayer().getPlayerInfo()\n\t\t\t\t\t\t.getBuildingSize().get(destBuilding.getObjectType()); i++)\n\t\t\t\t{\n\t\t\t\t\tfor (int j = 0; j < getMyPlayer().getPlayerInfo()\n\t\t\t\t\t\t\t.getBuildingSize()\n\t\t\t\t\t\t\t.get(destBuilding.getObjectType()); j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tcollectResourcePerTurn += getMyPlayer().getMyMap()\n\t\t\t\t\t\t\t\t.getMapBlocks()[i\n\t\t\t\t\t\t\t\t+ destBuilding.getPosition().getX()][j\n\t\t\t\t\t\t\t\t+ destBuilding.getPosition().getY()]\n\t\t\t\t\t\t\t\t.getLumber();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcollectResourcePerTurn /= (getMyPlayer().getPlayerInfo()\n\t\t\t\t\t\t.getBuildingSize().get(destBuilding.getObjectType()) * getMyPlayer()\n\t\t\t\t\t\t.getPlayerInfo().getBuildingSize()\n\t\t\t\t\t\t.get(destBuilding.getObjectType()));\n\n\t\t\t\tcollectResourcePerTurn *= (int) ((1 + myWorker\n\t\t\t\t\t\t.getWoodCampExperience()) * (getMyPlayer()\n\t\t\t\t\t\t.getPlayerInfo().getWoodProductionRate()));\n\t\t\t\tgetMyPlayer().getDoneActions().add(\n\t\t\t\t\t\t\"[\" + myWorker.getId() + \" ADD \"\n\t\t\t\t\t\t\t\t+ collectResourcePerTurn\n\t\t\t\t\t\t\t\t+ \" OF RESOURCE THIS TURN]\");\n\t\t\t}\n\n\t\t\tmyWorker.setLoadInInventory(collectResourcePerTurn\n\t\t\t\t\t+ myWorker.getLoadInInventory());\n\t\t}\n\t}", "@Override\n\tpublic void moveExecFinished(ReadOnlyBoard board, Counter player,\n\t\t\tCounter nextPlayer) {\n\n\t}", "private void gameTimerOnFinish() {\n if (currentScreenGameState == GameState.PLAYING) {\n stopGame();\n }\n }", "@Override\n public void setFinished() {\n if (finished > 0) {\n return;\n }\n\n // A mine has been opened (lose game)\n int openMines = (int) cells.stream().flatMap(Collection::stream)\n .filter(c -> c.isOpen() && c.isMine()).count();\n if (openMines > 0) {\n finished = 2;\n alertListeners(GameChangeType.LOSE);\n return;\n }\n\n // The board has been revealed (win game)\n int openCells = (int) cells.stream().flatMap(Collection::stream)\n .filter(c -> c.isOpen() && !c.isMine() && c.getCellState() != CellState.MINE3).count();\n if (openCells == (dims.getX() * dims.getY() - numMines)) {\n finished = 1;\n alertListeners(GameChangeType.WIN);\n return;\n }\n\n // Nothing so far, not finished\n finished = 0;\n }", "public abstract void userTurnEnds(long ms);", "public void dealerTurn() {\n\t\tview.writeLog(\"All players pass, dealer's turn.\");\n\t\tdealer.send(new Package(\"MESSAGE\",\"Now is your turn.\"));\n\t\tdealer.send(new Package(\"ASK\",null));\n\t}", "public void endGame() {\n Player player = playerManager.getWinner();\n MainActivity mainActivity = (MainActivity) this.getContext();\n updateLiveComment(\"Winner : \" + player.getName());\n mainActivity.setAlertDialog(player.getName()+\" Wins !\", \"Congratulations\", true);\n }", "public boolean end(Match match, Profile player) throws Exception{\n System.out.println(\"S: \" + player.getName() + \" end game!\");\n synchronized(this){\n player.setEnd(true);\n int end = 0;\n for(Profile i: this.players)\n if(i.finish())\n end++;\n if(end == this.players.size()){\n notifyAll();\n return true;\n }\n wait();\n return true;\n }\n }", "private void finaliseGame() {\r\n gameOn = false;\r\n if(bestAnswer==null) {\r\n target.reply(\"Nobody got an answer. The best answer was: \" + CountdownSolver.Solve( sourceNumbers, targetNumber ));\r\n return;\r\n }\r\n if( bestAnswer.getAnswer() == bestPossibleAnswer ) {\r\n String reply = Constants.BOLD + bestAnswer.getUsername() + Constants.BOLD\r\n + \" has won with \" + bestAnswer.getAnswer() + \"!\";\r\n if( bestPossibleAnswer!=targetNumber)\r\n reply+=\" This was the best possible answer.\";\r\n target.reply(reply);\r\n } else {\r\n target.reply( \"The best answer was \" + bestAnswer.getAnswer() + \" by \" + bestAnswer.getUsername() + \".\"\r\n + \" But the best possible answer was: \" + CountdownSolver.Solve( sourceNumbers, targetNumber ));\r\n }\r\n bestAnswer=null;\r\n runner.stop();\r\n }", "public void handleEndTurn(ActionEvent event){\n sender.sendInput(\"end turn\");\n }", "private void nextTurn(){\n\t\tint[] currentTurnInfo = mTurnIndicator.nextTurn(); \n\t\tif(currentTurnInfo[TurnView.TURN_POSITION] > -1){\n\t\t\t// highlight the current player\n\t\t\tCombatAdapter adapter = (CombatAdapter) getList().getAdapter();\n\t\t\tadapter.setCurrentTurn(currentTurnInfo[TurnView.TURN_POSITION]);\n\t\t\t// change the turn in the game table\n\t\t\tGameTable.setTurn(GameSQLDataSource.getDatabase(getActivity()), mEncounterRowID, currentTurnInfo[TurnView.TURN_POSITION]);\n\t\t\t// set the label\n\t\t\tmTurn.setText(currentTurnInfo[TurnView.TURN_INIT] + \"\");\n\t\t\t// increment the round if necessary\n\t\t\tif(currentTurnInfo[TurnView.TURN_POSITION] == 0){\n\t\t\t\tint round = GameTable.addRound(GameSQLDataSource.getDatabase(getActivity()), mEncounterRowID);\n\t\t\t\tmRound.setText(round + \"\");\n\t\t\t}\n\t\t}\n\t}", "private void finishGame(boolean again){\r\n\t\tdispose();\r\n\t\tif(again) Util.showNewGameDialog(\"Choose player names:\", cantStop.getGameBoard().getPlayers());\r\n\t}", "@Override\n protected void executeStrategy()\n {\n //Get the latest clue given by the SpyMaster\n Clue clue = game.getCurrentClue();\n pickCard(clue);\n\n // We used up our guesses so we are done\n if (game.getGuessesLeft() == 0) { this.game.endCurrentTurn(); }\n }" ]
[ "0.80029964", "0.78962535", "0.78022313", "0.7672266", "0.75888157", "0.75019765", "0.74538356", "0.7395462", "0.7340072", "0.73360986", "0.7321251", "0.7309589", "0.7290722", "0.72741866", "0.7245821", "0.72278816", "0.71930754", "0.71845657", "0.7181388", "0.71602243", "0.71397716", "0.7125433", "0.7122011", "0.7114367", "0.7106688", "0.7102145", "0.7076697", "0.7043627", "0.7040758", "0.7010497", "0.6953566", "0.69171643", "0.69027585", "0.6882857", "0.6872279", "0.68713015", "0.6864154", "0.6857851", "0.6829104", "0.6828335", "0.67906016", "0.67717457", "0.6733513", "0.67084575", "0.6698018", "0.66873825", "0.6680666", "0.6647949", "0.66425544", "0.66279507", "0.6624596", "0.6617618", "0.66157234", "0.6611523", "0.6590105", "0.6579913", "0.65729636", "0.6569227", "0.6551938", "0.65478605", "0.65439004", "0.65364116", "0.6525047", "0.6523906", "0.6523339", "0.65112597", "0.64963245", "0.6488007", "0.64869803", "0.64678425", "0.6464178", "0.64488864", "0.6443743", "0.64357597", "0.64234906", "0.64218503", "0.6417464", "0.6410987", "0.6407737", "0.640023", "0.63957465", "0.63696986", "0.6366091", "0.63642675", "0.6362165", "0.6360421", "0.6358419", "0.63496333", "0.6339337", "0.6337896", "0.63193125", "0.63171417", "0.6300634", "0.62968457", "0.6290346", "0.6288898", "0.62779844", "0.6268528", "0.62646246", "0.62617236" ]
0.82035047
0
Purchases a random devcard from the deck
void buyDevCard();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Card dealCard() {\n int randPos = random.nextInt(51 - 0 + 1);\n Card rand = deck[randPos];\n return rand;\n\n }", "public Deck randomShuffle(){\n\t\tshuffleOnceRandom();\n\t\tshuffleOnceRandom();\n\t\treturn ourDeck;\n\t}", "void askBuyDevCards();", "public void generateDeck() {\n\t\tList<String> valueList = Arrays.asList(\"Ace\", \"2\", \"3\",\"4\", \"5\", \"6\",\"7\", \"8\", \"9\",\"10\", \"Jack\", \"Queen\",\"King\");\n\t\tList<String> suitList = Arrays.asList(\"Diamonds\", \"Spades\", \"Clubs\", \"Hearts\");\n\t\tvalues.addAll(valueList);\n\t\tsuits.addAll(suitList);\n\t\t\n\t\t//adding card objects to deckOfCards arraylist\n\t\tint i = 1;\n\t\twhile(i<=52){\n Card card = new Card(values.get(random.nextInt(13)), suits.get(random.nextInt(4)));\n if (!deckOfCards.contains(card)) {\n deckOfCards.add(card);\n i++;\n }else{\n\n }\n }\n\t}", "public void deal()\n\t{\n\t Random generator = new Random();\n\t int thisCard = generator.nextInt(52);\n\n\t face = faces[thisCard % 13];\n\t suit = suits[thisCard / 13];\n\n\t faceValue = thisCard %13;\n\t}", "public void cardGen(){\n\t\tRandom rand = new Random();\n\t\tint randValue = rand.nextInt(13);\n\t\tcardString = value[randValue] + suit[rand.nextInt(4)];\n\t}", "public Deck() {\n\t\trand = new Random();\n\t\trand.setSeed(System.currentTimeMillis());\n\t\twhile(deck.size()<52){\n\t\t\tint suit = rand.nextInt(4);\n\t\t\tint rank = rand.nextInt(13);\n\t\t\tString card = this.rank[rank] +\" of \" + this.suit[suit];\n\t\t\tdeck.add(card);\n\t\t}\n\t}", "void shuffleDeck() {\n\t\tfor(int index = 0; index < this.getNumberOfCards(); index++) {\n\t\t\tint randomNumber = index + (int)(Math.random() * (this.getNumberOfCards() - index));\n\t\t\tCard temp = this.cardsInDeck[randomNumber];\n\t\t\tthis.cardsInDeck[randomNumber] = this.cardsInDeck[index];\n\t\t\tthis.cardsInDeck[index] = temp;\n\t\t}\n\t}", "public Card dealCard() {\n\t\tnumCards = deckCount * 52;\n\t\tif (dealt >= numCards) {\n\t\t\tthrow new IllegalStateException(\"No Cards Left In The Deck\");\n\t\t} else {\n\n\t\t\tcardsRemaining = numCards - dealt;\n\t\t\tswitch (cardsRemaining) {\n\t\t\tcase 15:\n\t\t\t\tSystem.out.println(\"15 cards remaining in the shoe\");\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\tSystem.out\n\t\t\t\t.println(\"5 cards remaining in the shoe, adding cards \"\n\t\t\t\t\t\t+ \"to shoe \");\n\t\t\t\tShoe.clear();\n\t\t\t\tfor (int h = 0; h < deckCount; h++) {\n\t\t\t\t\tfor (int i = 1; i < 14; i++) {\n\t\t\t\t\t\tfor (int j = 1; j < 4; j++) {\n\t\t\t\t\t\t\tShoe.add(new Card(i, j));\n\t\t\t\t\t\t\tCollections.shuffle(Shoe);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tdealt++;\n\t\t\treturn Shoe.get(dealt - 1);\n\t\t}\n\t}", "public CardCollection destroyRandom(int number) ;", "void askDevCardProduction();", "public Card draw(){\n\t\tif(count < 0 ){\n\t\t\tthrow new IllegalStateException(\"Drew from an empty card deck!\");\n\t\t}\n\t\tint pick = (count == 0 ? 0 : rand.nextInt(count));\n\t\tCard ret = cards[pick];\n\t\tcards[pick] = cards[count];\n\t\tcount--;\n\t\treturn ret;\n\t}", "public Deck(){\n\t\tcount = 51;\n\t\tcards = new Card[52];\n\t\trand = new Random();\n\t\tfor(Suit suit : Suit.values()){\n\t\t\tfor (int i = 2; i < 15; i++) {\n\t\t\t\tcards[suit.ordinal()*13 + i - 2] = new Card(suit,i);\n\t\t\t}\n\t\t}\n\t}", "static Card generateRandomCard()\n {\n Card.Suit suit;\n char val;\n\n int suitSelector, valSelector;\n\n // get random suit and value\n suitSelector = (int) (Math.random() * 4);\n valSelector = (int) (Math.random() * 14);\n\n // pick suit\n suit = Card.Suit.values()[suitSelector];\n\n // pick value\n valSelector++; // put in range 1-14\n switch(valSelector)\n {\n case 1:\n val = 'A';\n break;\n case 10:\n val = 'T';\n break;\n case 11:\n val = 'J';\n break;\n case 12:\n val = 'Q';\n break;\n case 13:\n val = 'K';\n break;\n case 14:\n val = 'X';\n break;\n default:\n val = (char)('0' + valSelector); // simple way to turn n into 'n' \n }\n return new Card(val, suit);\n }", "public void shuffle()\n\t{\n\t\tHashSet<Integer> usedRandoms = new HashSet<Integer>();\n\t\tthis.currentCard = 0;\n\t\tint i= 0;\n\t\twhile (i < deck.length)\n\t\t{\n\t\t\tint another = this.rand.nextInt(NUMBER_OF_CARDS);\n\t\t\tif(!usedRandoms.contains(another))\n\t\t\t{\n\t\t\t\tCard temp = this.deck[i];\n\t\t\t\tthis.deck[i] = this.deck[another];\n\t\t\t\tthis.deck[another] = temp;\n\t\t\t\ti++;\n\t\t\t\tusedRandoms.add(another);\n\t\t\t}\n\t\t}\n\t}", "public void shuffleDeck() {\n for (int i = 0; i < TOTAL_NUMBER_OF_CARDS - 1; i++) {\n Random r = new Random();\n int x = r.nextInt(TOTAL_NUMBER_OF_CARDS);\n Card y = deck.get(x);\n deck.set(x, deck.get(i));\n deck.set(i, y);\n }\n }", "public static Card deal(ArrayList<Card> deck) {\n\t\treturn deck.get(randomInt(0, 52));\n\n\t\t// return null; // delete this after writing the above\n\t}", "public void shuffle() {\r\n for ( int i = deck.size()-1; i > 0; i-- ) {\r\n int rand = (int)(Math.random()*(i+1));\r\n SpoonsCard temp = deck.get(i);\r\n deck.set(i, deck.get(rand));\r\n deck.set(rand, temp);\r\n }\r\n cardsUsed = 0;\r\n }", "public void Shuffle() {\n int i = 0;\n while (i < 52) {\n int rando = (int) (5.0 * (Math.random()));\n Cards temp = deck[rando];\n deck[rando] = deck[i];\n deck[i] = temp;\n i++;\n }\n\n Arrays.stream(deck).forEach(c -> System.out.format(\"%s,\",c));\n }", "@Test\n public void buyCard() throws Exception {\n model.getTurnTracker().setCurrentTurn(PlayerIndex.FIRST);\n when(devCardFacade.canBuyDevCard(currentPlayer)).thenReturn(true);\n dcc.buyCard();\n verify(devCardFacade, atMost(1)).buyDevCard(currentPlayer);\n }", "public Card dealCard() {\n if (deck.size() == 52) {\n shuffle();\n }\n Card temp;\n temp = deck.get(0);\n remove(0);\n return temp;\n }", "public Card deal()\n\t{\n\t\tif (cards.isEmpty())\n\t\t\treturn null;\n\t\t\n\t\t//Generate a random index to pull a random card from the ordered deck\n\t\tint rand = (int) (Math.random() * cards.size());\n\t\tCard dealt = cards.get(rand);\n\t\t//Remove the pulled card from the deck\n\t\tcards.remove(rand);\n\t\t\n\t\treturn dealt;\n\t}", "@Override\r\n public void dealerShuffleDeck(){\r\n this.dealer.shuffleDecks();\r\n }", "public void shuffle() {\n\t\tRandom random = new Random();\n\t\tint dealtCards = this.dealtCards.get();\n\t\tfor (int i = dealtCards; i < Deck.DECK_SIZE; i++) {\n\t\t\t// Obtain random position for available cards.\n\t\t\tint randomNumber = dealtCards + random.nextInt((Deck.DECK_SIZE - dealtCards));\n Card tempCard = cards.get(i);\n // Swap cards position.\n cards.set(i, cards.get(randomNumber));\n cards.set(randomNumber, tempCard);\n }\n\t}", "public Card() {\n var random = new SecureRandom();\n var allTypes = Type.values();\n var allSuits = Suit.values();\n this.type = allTypes[random.nextInt(10)];\n this.suit = allSuits[random.nextInt(4)];\n }", "public void RandomizeTheDeck() {\r\n ArrayList<ArrayList<Card>> alalCopy = new ArrayList<>();\r\n int i, iRand;\r\n Random rand = new Random();\r\n \r\n // remove deck to the copy\r\n for( i=0; i<104; i++) {\r\n alalCopy.add( alalSets.get(i) );\r\n }\r\n alalSets.clear();\r\n \r\n // randomly copy them back as copy size gets smaller\r\n for( i=104; i>0; i-- ) {\r\n iRand = (int)rand.nextInt(i);\r\n alalSets.add( alalCopy.remove(iRand) );\r\n }\r\n }", "@Test\n public void buy() {\n System.out.println(client.purchase(1, 0, 1));\n }", "public void Shuffle() {\n\t\tCollections.shuffle(cards);\n\t}", "void shuffle() {\r\n cards.addAll(dealtCards);\r\n dealtCards.removeAll(dealtCards);\r\n Collections.shuffle(cards);\r\n System.out.println(\"Shuffled cards\" + cards);\r\n }", "@Override\r\n\tpublic void buyCard() {\n\t\t\r\n\t}", "public void reCharge() {\r\n\t\tRandom rand = new Random();\r\n\t\tString plusEnergyCard = \"\";\r\n\t\t\r\n\t\tswitch (rand.nextInt(3)) {\r\n\t\tcase 0: plusEnergyCard = \"Red\";\r\n\t\t\t\tbreak;\r\n\t\tcase 1: plusEnergyCard = \"Blue\";\r\n\t\t\t\tbreak;\r\n\t\tcase 2: plusEnergyCard = \"Yellow\";\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\tif (energycolour.equals(\"Colourless\") || energycolour.equals(plusEnergyCard)) {\r\n\t\t\tenergy += 5;\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.printf(\"Drew a %s card, energy become %d.\\n\\n\", plusEnergyCard, energy);\r\n\t}", "public void shuffle() {\n\t\tfor (int i = deck.length - 1; i > 0; i--) {\n\t\t\tint rand = (int) (Math.random() * (i + 1));\n\t\t\tCard temp = deck[i];\n\t\t\tdeck[i] = deck[rand];\n\t\t\tdeck[rand] = temp;\n\t\t}\n\t\tcardsUsed = 0;\n\t}", "@Override\n\tpublic void shuffleDeck() {\n\t\tfor(int i = 0; i < 1000000; i++) {\n\t\t\tint randomStelle1 = (int) (Math.random() * 32);\n\t\t\tint randomStelle2 = (int) (Math.random() * 32);\n\t\t\tPlayingCard copy = aktuellesDeck[randomStelle1];\n\t\t\taktuellesDeck[randomStelle1] = aktuellesDeck[randomStelle2];\n\t\t\taktuellesDeck[randomStelle2] = copy;\n\t\t}\n\t}", "public void shuffle(){\n\n // resetting the int counters\n nextCard = 0;\n nextDiscardedPlace = 0;\n discardPile = new PlayingCard[Constants.DECK_SIZE];\n\n PlayingCard temp = null;\n Random rand = new Random();\n\n for(int i = 0; i < MAX_SHUFFLE; i++) {\n int pos1 = rand.nextInt(Constants.DECK_SIZE);\n int pos2 = rand.nextInt(Constants.DECK_SIZE);\n\n temp = deck[pos1];\n deck[pos1] = deck[pos2];\n deck[pos2] = temp;\n }\n }", "public void shuffleDeck() {\n\t\tCollections.shuffle(deck);\n\t}", "public void hinduShuffle()\r\n {\r\n List<Card> cut = new ArrayList<Card>();\r\n List<Card> cut2 = new ArrayList<Card>();\r\n List<Card> shuffledDeck = new ArrayList<Card>();\r\n int cutPoint = 0;\r\n int cutPoint2 = 0;\r\n for (int x = 0; x < SHUFFLE_COUNT; x++) {\r\n cutPoint = rand.nextInt( cards.size()-1 );\r\n cutPoint2 = rand.nextInt( cards.size() - cutPoint ) + cutPoint;\r\n for (int i = 0; i < cutPoint; i++) {\r\n cut.add(draw());\r\n }\r\n for (int i = cutPoint2; i < cards.size(); i++) {\r\n cut2.add(draw());\r\n }\r\n for (int i = 0; i < cut.size(); i++) {\r\n shuffledDeck.add(cut.remove(0));\r\n }\r\n for (int i = 0; i < cards.size(); i++) {\r\n shuffledDeck.add(cards.remove(0));\r\n }\r\n for (int i = 0; i < cut2.size(); i++) {\r\n shuffledDeck.add(cut2.remove(0));\r\n }\r\n cut = cards;\r\n cut.clear();\r\n cut2.clear();\r\n cards = shuffledDeck;\r\n }\r\n }", "public void shuffleDeck() {\n\t\tCollections.shuffle(this.deck);\n\t}", "public void shuffleDeck() {\n\t\tint numberOfShuffles = (int) ( Math.random() * 4 + 1 ) ;\n\t\tCard temp;\n\t\t\n\t\tfor( int j = 0; j < numberOfShuffles; j++ ) {\n\t\t\tfor( int i = 0; i < deck.length; i++ ) {\n\t\t\t\tint randSwitchNum = (int) (Math.random() * 52);\n\t\t\t\ttemp = deck[i];\n\t\t\t\tdeck[i] = deck[randSwitchNum];\n\t\t\t\tdeck[randSwitchNum] = temp;\n\t\t\t}\n\t\t}\t\n\t}", "public void populateDeck(){\n\n //Add everything to r\n for(int i=0;i<LUMBER;i++){\n deck.add(new ResourceCard(container, Resource.WOOD, cardStartPoint));\n }\n\n for(int i=0;i<WOOL;i++){\n deck.add(new ResourceCard(container, Resource.WOOL, cardStartPoint));\n }\n\n for(int i=0;i<GRAIN;i++){\n deck.add(new ResourceCard(container, Resource.WHEAT, cardStartPoint));\n }\n\n for(int i=0;i<BRICK;i++){\n deck.add(new ResourceCard(container, Resource.BRICKS, cardStartPoint));\n }\n\n for(int i=0;i<ORE;i++){\n deck.add(new ResourceCard(container, Resource.ORE, cardStartPoint));\n }\n //Collections.shuffle(deck);\n\n }", "public void shuffle()\n\t{\n\t\tCollections.shuffle(card);\n\t}", "public Deck() {\n generateDeckOfCards();\n }", "public void shuffle(){\n //After shuffling dealing starts at deck[0] again\n currentCard = 0;\n //for each card , pick another random card and swap them\n for(int first = 0; first < deck.length; first++){\n int second = randomNumbers.nextInt(NUMBER_OF_CARDS);\n\n //Swap Method to swap current card with randomly selected card\n Card temp = deck[first];\n deck[first] = deck[second];\n deck[second] = temp;\n }\n }", "public void buyDevCard() throws ClientException{\n\n\t\t\tresources.setOre(resources.getOre() -1 );\n\t\t\tresources.setWheat(resources.getWheat() -1 );\n\t\t\tresources.setSheep(resources.getSheep() -1 );\n\n\t}", "@Test\n public void buyCardWithNoResources() throws Exception {\n when(devCardFacade.canBuyDevCard(noDevCardsPlayer)).thenReturn(false);\n dcc.buyCard();\n verify(devCardFacade, never()).buyDevCard(noDevCardsPlayer);\n }", "public static void main(String[] args) {\r\n\r\n CardDeck deck = new CardDeck();\r\n System.out.println(deck.dealHand(5)); // <- print 5 cards 3 times\r\n System.out.println(deck.dealHand(5));\r\n System.out.println(deck.dealHand(5));\r\n System.out.println(deck.dealHand(50)); // <- only 39 cards should be printed here\r\n System.out.println(deck.dealHand(50)); // <- and empty list should be printed\r\n deck.shuffle();\r\n System.out.println(deck.dealHand(5)); // <- another 5 cards\r\n\r\n }", "@Override\r\n\tprotected int giveCardProtected(ArrayList<Card> hand) {\n\t\treturn getRandomCard(hand);\r\n\t}", "public static void deal_singel_card(Deck deck, ArrayList<String> playerDeck)\n\t{\n\t\tint cardidx;\n\t\tcardidx = (int)(Math.random() * deck.getTotalCards());\n\t\tplayerDeck.add(deck.getCard(cardidx));\n\t\tdeck.removeCard(cardidx);\n\t\tdeck.setTotalCards(deck.getTotalCards() - 1);\n\t}", "public void initChanceDeck() {\n\t\tchanceDeck = new Deck();\n\t\tfor (int i = 0; i < 16; i++) {\n\t\t\tchanceDeck.addCard(new Card(i));\n\t\t}\n\t\t//shuffled to make the order random\n\t\tchanceDeck.shuffle();\n\t}", "public static void shuffle(int[] deck){\n //temporary variable for swapping the values\n int storage = 0;\n //random integer\n int randomInt;\n for(int i = 0; i < deck.length; i++){\n //set the variable equal to a random integer every time\n randomInt = (int) (Math.random() * (deck.length));\n //store the original deck[i] in storage\n //swap deck[i] and deck[randomInt]\n storage = deck[i];\n deck[i] = deck[randomInt];\n deck[randomInt] = storage;\n }\n }", "@Test\n public void randomTest() {\n Deck deck1 = new DeckImplementation();\n Deck deck2 = new DeckImplementation();\n\n assertEquals(\"Wrong size!\", 180, deck1.numberOfCardsRemaining());\n assertEquals(\"Wrong size!\", 180, deck2.numberOfCardsRemaining());\n\n assertEquals(\"Decks are equal!\", false, deck1.equals(deck2));\n }", "public Board.Cards buyCard(Board.Cards card) {\n \t\tif (!affordCard())\n \t\t\treturn null;\n \n \t\t// out of cards\n \t\tif (card == null)\n \t\t\treturn null;\n \n \t\t// deduct resources\n \t\tuseResources(Type.WOOL, 1);\n \t\tuseResources(Type.GRAIN, 1);\n \t\tuseResources(Type.ORE, 1);\n \n \t\tif (card == Cards.VICTORY)\n \t\t\tvictory += 1;\n \t\telse\n \t\t\tnewCards.add(card);\n \n \t\tappendAction(R.string.player_bought_card);\n \n \t\treturn card;\n \t}", "public Deck(boolean shuffle) {\n\t\t//52 cards\n\t\tthis.cardNumber = 52;\n\t\t//Total slots of 52 ARRAY\n\t\tthis.card = new Card[this.cardNumber];\n\t\t\n\t\t//location of the card\n\t\tint cardLocation= 0;\n\t\t\n\t\t// each suit\n\t\tfor(int suit = 0; suit < 4; suit++)\n\t\t{\n\t\t\t//each number in the deck\n\t\t\tfor(int num = 1; num <=13; num++)\n\t\t\t{\n\t\t\t\t// add a new card to the deck \n\t\t\t\tthis.card[cardLocation] = new Card(Suit.values()[suit],num);\n\t\t\t\tcardLocation++;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Shuffling done\n\t\tif(shuffle == true)\n\t\t{\n\t\t\tthis.shuffle();\n\t\t}\n\t}", "public void spreadShuffle()\r\n {\r\n List<Card> shuffledDeck = new ArrayList<Card>();\r\n List<Card> tempDeck = null;\r\n for (int i = 0; i < SHUFFLE_COUNT; i++) {\r\n while (cards.size() > 0)\r\n {\r\n shuffledDeck.add( drawRandom() );\r\n }\r\n tempDeck = cards;\r\n cards = shuffledDeck;\r\n tempDeck.clear();\r\n shuffledDeck = tempDeck;\r\n }\r\n }", "@Test\n public void testShuffleGood() {\n System.out.println(\"shuffleGood\");\n Deck deck = new Deck();\n boolean shuffled = false;\n deck.shuffle();\n //we take out one card from the deck\n Card lastCard = deck.nextCard();\n //we take out 58 more cards\n for (int i =0 ; i<57;i++)\n {\n deck.nextCard();\n }\n //we take out the last card from the deck\n Card firstCard = deck.nextCard();\n \n //if both cards = the same value they were before being shuffled, then test will fail.\n if (lastCard.getValue() != CardType.WILDCARD )\n shuffled = true;\n else if (firstCard.getValue()!=CardType.ZERO)\n shuffled = true;\n \n //if either of the cards are different, that means the deck was shuffled and the test will pass\n assertEquals(true, shuffled);\n }", "boolean CanBuyDevCard();", "public Card drawCard() {\n Card c = cards.get(0);//get a card\n cards.remove(0);//remove the card form the deck that's given out\n discard.add(c);//so the card given out is added to the discard list\n return c;//return a card object\n\n }", "public void shuffle(){\r\n int randomPos;\r\n //for each card in the deck\r\n for(int i=0; i<52; i++){\r\n randomPos = getRandomPos(i);\r\n exchangeCards(i, randomPos);\r\n }\r\n topCardIndex = 0;\r\n\t}", "Card dealOneCard();", "public Card giveCard()\n {\n return deck.pop();\n }", "public Card(){\n\t\trank = (int) (Math.random()*(13-1));\n\t\tsuit = (int) (Math.random()*4);\n\t}", "public void shuffle() {\n List<Card> shuffledCards = new ArrayList<>(52);\n while (cards.size() > 0) {\n int index = random.nextInt(cards.size());\n shuffledCards.add(cards.remove(index));\n }\n cards = shuffledCards;\n }", "public void shuffle()\r\n {\r\n // We will start from the last element and swap the cards one by one. We actually\r\n // don't need to swap the last element.\r\n for (int i = valid - 1; i > 0; i --) { \r\n \r\n // By using Math.random, we will get a random integer from 0 to i\r\n int j = (int) ( (i+1) * Math.random()); \r\n \r\n // Swapping with the help of temp instance of Card Class.\r\n Card temp = cards[i]; \r\n cards[i] = cards[j]; \r\n cards[j] = temp; \r\n } \r\n // Prints the random array \r\n }", "public void dealerAskCard() {\n int dealerScore = this.getDealerHand().getActualValue();\n while (dealerScore < 17) {\n Card card = this.deck.deal(this.getDealerHand());\n dealerScore = this.getDealerHand().getActualValue();\n }\n }", "public void purchase() {\r\n\t\tdo {\r\n\t\t\tString id = getToken(\"Enter customer id: \");\r\n\t\t\tString brand = getToken(\"Enter washer brand: \");\r\n\t\t\tString model = getToken(\"Enter washer model: \");\r\n\t\t\tint quantity = getInteger(\"Enter quantity to purchase: \");\r\n\t\t\tboolean purchased = store.purchaseWasher(id, brand, model, quantity);\r\n\t\t\tif (purchased) {\r\n\t\t\t\tSystem.out.println(\"Purchased \" + quantity + \" of \" + brand + \" \" + model + \" for customer \" + id);\r\n\t\t\t} else {\r\n\t\t\t\tSystem.out.println(\"Purchase unsuccessful.\");\r\n\t\t\t}\r\n\t\t} while (yesOrNo(\"Make another Purchase?\"));\r\n\t}", "public Card drawFromChance()\n {\n Random draw = new Random();\n \n //if the chance cards are exhausted, re-fill the cards\n if(m_chance.size() == 0)\n {\n m_chance = m_drawnChance;\n m_drawnChance.clear();\n }\n //draw a random card and add it to the list of the cards drawn\n int drawFrom = draw.nextInt(m_chance.size() - 1) + 1;\n Card card = m_chance.remove(drawFrom);\n m_drawnChance.add(card);\n \n return card;\n }", "public static int[] shuffle(int[] deck){\n\t\tRandom rnd = new Random();\n\t for (int i = deck.length - 1; i > 0; i--)\n\t {\n\t int index = rnd.nextInt(i + 1);\n\t int a = deck[index];\n\t deck[index] = deck[i];\n\t deck[i] = a;\n\t }\n\t return deck;\n\t}", "public void cards() {\n\t\t\n\n\t\tboolean[] randomCards = new boolean[52];\n\n\t\t// choose 4 random distinct cards from the deck\n\t\tint count = 0;\n\t\tint card1 = 0;\n\t\tint card2 = 0;\n\t\tint card3 = 0;\n\t\tint card4 = 0;\n\n\t\twhile (count < 4) {// Display only four cards\n\n\t\t\tcard1 = ((int) (Math.random() * 12) + 1) + 1;// Ignore zero\n\t\t\tcard2 = ((int) (Math.random() * 12) + 1) + 1;// Ignore zero\n\t\t\tcard3 = ((int) (Math.random() * 12) + 1) + 1;// Ignore zero\n\t\t\tcard4 = ((int) (Math.random() * 12) + 1) + 1;// Ignore zero\n\n\t\t\tif ((randomCards[card1] = !randomCards[card2]) && (randomCards[card1] = !randomCards[card3])\n\t\t\t\t\t&& (randomCards[card1] = !randomCards[card4]) && (randomCards[card2] = !randomCards[card3])\n\t\t\t\t\t&& (randomCards[card2] = !randomCards[card4]) && (randomCards[card3] = !randomCards[card4])) {\n\n\t\t\t\tString[] cards = { \"clubs\", \"diamonds\", \"hearts\", \"spades\" };\n\n\t\t\t\tString name1 = cards[(int) (Math.random() * cards.length)];\n\t\t\t\tString name2 = cards[(int) (Math.random() * cards.length)];\n\t\t\t\tString name3 = cards[(int) (Math.random() * cards.length)];\n\t\t\t\tString name4 = cards[(int) (Math.random() * cards.length)];\n\n\t\t\t\tImage image1 = new Image(\"png/\" + (card1) + \"_of_\" + name1 + \".png\");\n\t\t\t\tImage image2 = new Image(\"png/\" + (card2) + \"_of_\" + name2 + \".png\");\n\t\t\t\tImage image3 = new Image(\"png/\" + (card3) + \"_of_\" + name3 + \".png\");\n\t\t\t\tImage image4 = new Image(\"png/\" + (card4) + \"_of_\" + name4 + \".png\");\n\n\t\t\t\timgCard1.setImage(image1);\n\t\t\t\timgCard2.setImage(image2);\n\t\t\t\timgCard3.setImage(image3);\n\t\t\t\timgCard4.setImage(image4);\n\n\t\t\t\tcount++;\n\n\t\t\t}\n\n\t\t}\n\n\t\tString cardOneValue = Integer.toString(card1);\n\t\tString cardTwoValue = Integer.toString(card2);\n\t\tString cardThreeValue = Integer.toString(card3);\n\t\tString cardFourValue = Integer.toString(card4);\n\t\tSystem.out.println(cardOneValue + \" - \" + cardTwoValue + \" - \" + cardThreeValue + \" - \" + cardFourValue);\n\t\tsetText.setText(cardOneValue +\" \"+ cardTwoValue +\" \"+ cardThreeValue +\" \"+ cardFourValue);\n\t\t\n\t\tint solution = 0; \n\t\tif(solution!=24) {\n\t\tfor(int limit = 0; limit < 25; limit++) {\n\t\t\n\t\t\t\tSystem.out.println(\"No\");\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(solution);\n\t\t\n\t}", "public UnoCard getCard(){\n Random rnd = new Random();\n int rnd_number = rnd.nextInt(((this.cards.size()-1)-0) + 1) + 0;\n return this.cards.get(rnd_number);\n\n }", "private void shuffleDeck()\r\n {\n cardList = new ArrayList<Card>(deck);\r\n // shuffle the deck of cards using the ArrayList\r\n Collections.shuffle(getCardList());\r\n // convert it back to a HashSet\r\n deck = new HashSet<Card>(getCardList());\r\n }", "public Card[] shuffleDeck(Card[] deck, int decks) {\n Random rnd = new Random();\n Card temp;\n\n int numCards = 52 * decks;\n\n if (decks < 1)\n numCards = 52;\n\n //Iterate through the deck\n for (int i = 0; i < numCards; i++) {\n //Get a random index\n int random = rnd.nextInt(52);\n\n //Swap the current card with the random index\n temp = deck[random];\n deck[random] = deck[i];\n deck[i] = temp;\n }\n\n //Return the shuffled deck\n return deck;\n }", "public Card drawCard() {\n return deck.pop();\n }", "public void shuffle(){\n Collections.shuffle(this.deckOfCards);\n }", "private void viewPurchases(User user, Scanner sc) {\n\n\t\tboolean run = true;\n\t\tdo {\n\t\t\tlog.info(\"The Following are your Purchases\\n\");\n\t\t\tList<Item> purchased = cService.seeOwnedItems(user);\n\t\t\tpurchased.stream().forEach(item -> log.info(item.toString()));\n\n\t\t\tlog.info(\"Choose an option:\");\n\t\t\tlog.info(\"\t\tPress anything else to exit\");\n\t\t\tString choice = sc.nextLine();\n\t\t\tswitch (choice) {\n\t\t\tdefault:\n\t\t\t\tlog.info(\"\\nGoing back to the Customer Dashboard\\n\");\n\t\t\t\trun = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} while (run);\n\t}", "public void play() {\r\n this.cardDeck = new JavaDeck();\r\n cardDeck.shuffle();\r\n dealerHand = new JavaHand(2);\r\n dealerHand.DiscardHand();\r\n addDealerCard();\r\n }", "public void shuffle() {\r\n for (int i = 0; i < this.numCards; i++) {\r\n int spot = (int) (Math.random() * ((this.numCards - 1) - i + 1) + i);\r\n Card temp = cards[i];\r\n cards[i] = cards[spot];\r\n cards[spot] = temp;\r\n\r\n\r\n }\r\n }", "public void shuffle() {\n Random rand = new Random();\n for(int i = 0; i < deck.length; i++) {\n // get random index past current index\n int randomVal = i + rand.nextInt(deck.length - i);\n // swaps randomly selected card with card at index i\n Card swap = deck[randomVal];\n deck[randomVal] = deck[i];\n deck[i] = swap;\n }\n }", "public static int[] createShuffledDeck(){\n //create a deck\n int[] deck = new int[52];\n //make each item their respective index + 1 to avoid repetition\n for(int i = 0; i < deck.length; i++){\n deck[i] = i+1;\n }\n //shuffle deck\n shuffle(deck);\n return deck;\n }", "public void startGame() {\n this.deck = new Deck();\n this.deck.shuffle(); //shuffle the deck\n Card card = this.deck.deal(this.getPlayerHand());\n card = this.deck.deal(this.getPlayerHand());\n card = this.deck.deal(this.getDealerHand());\n }", "public void generateDeck(){\n\t\tString type;\n\t\t//Randomize MAX_TILES number of Tile Objects\n\t\tfor(int i=0; i<GameInfo.MAX_TILES; i++){\n\t\t\ttype = GameInfo.allowedTiles[rg.nextInt(GameInfo.MAX_TYPES)];\n\t\t\tdeck.add(tf.create(type));\n\t\t}\n\t\tgenerated = true;\n\t}", "public void shuffle() {\n for (int i = 0; i < this.cards.length ; i++ ) {\n double x = Math.floor(Math.random() * ((double)this.cards.length - (double)0)) + (double)0;\n Card temp = this.cards[i];\n this.cards[i]= this.cards[(int)x];\n this.cards[(int)x]= temp;\n }\n }", "public void setChanceCardShuffle() {\n ChanceCardShuffle = true;\n }", "public int performDuel(){\n Random rand = new Random();\n int intRand;\n intRand = rand(6);\n while(this.engine.getGameInformation().cards[intRand][intRand] == 0 ){\n intRand = rand(6);\n }\n return intRand;\n }", "public Deck() { // This constructor creates a standard deck\n\n\tcards = new Card[52];\n\tint k=0;\n\t\n\tfor (int i=0; i<4; i++)\n\t for (int j=2; j<15; j++){\n\t\tcards[k]= new Card (j, i);\n\t\tk++;\n\t\t }\n\t \n\n\tshuffle();\n\t\n\tcardsLeft = 52;\n\t/*\tfor (int i=0; i<52; i++)\n\t\tSystem.out.println (cards[i]);*/\n }", "private PlayingCard chooseCard(HeartsGraphics g){\t\t\n\t\tHearts.setCurrentPlayer(this);\n\t\t\n\t\tif(number != PLAYER_ONE){\n\t\t\t// A.I. code\n\t\t\tint index;\n\t\t\t\n\t\t\tRandom r = new Random();\n\t\t\tindex = r.nextInt(hand.size());\t\t\t\n\t\t\t\n\t\t\treturn hand.get(index);\t\t\t\n\t\t} else {\n\t\t\treturn getCard(g);\n\t\t}\t\t\n\t}", "public SpoonsCard dealCard() {\r\n\t SpoonsCard card = deck.get(0);\r\n\t deck.remove(0);\r\n\t return card;\r\n }", "public void RefillDeck()\n\t{\n\t\tRefillDeck(false);\n\t}", "void fillDeck()\n\t{\n\t\t\n\t\tfor ( byte decks = 0 ; decks < howManyDecks ; decks++ )\n\t\t\tfor ( byte suit = 0 ; suit < 4 ; suit++ )\n\t\t\t\tfor ( byte value = 1 ; value < 14 ; value++ ) \n\t\t\t\t\tdeck.add ( new Card (value , suit , true) );\n\t}", "boolean isInPursuit(Point2D target, double noise);", "public TrainCard usedCard(){\n TrainCard removedCard = cardDeck.remove(0);\n return removedCard;\n }", "void dealTheCards();", "Deque<PokerCard> getShuffledHalfDeck();", "@Override\n public Double buyDevice(String name, String type) {\n Cash c = null;\n Cheque ch = null;\n Card cd = null;\n \n Date d = new Date();\n \n switch (type) {\n case \"c1\":\n c = new Cash.Builder(d.toString())\n .build();\n break;\n case \"c2\":\n ch = new Cheque.Builder(d.toString())\n .build();\n break;\n case \"c3\":\n cd = new Card.Builder(d.toString())\n .build();\n break;\n }\n \n \n PurchaseVinyl v = new PurchaseVinyl.Builder()\n .setName(\"Let The Good Times Role\")\n .setPrice(3.99)\n .build();\n \n PurchaseVinyl v1 = new PurchaseVinyl.Builder()\n .setName(\"Thanks For The Meomories\")\n .setPrice(3.99)\n .build();\n \n List<PurchaseVinyl> vinylList = new ArrayList();\n vinylList.add(v);\n vinylList.add(v1);\n \n \n ProductPurchase pc = new ProductPurchase.Builder(d)\n .setVinylPurchases(vinylList)\n .setCardPurchases(cd)\n .setCashPurchases(c)\n .setChequePurchases(ch)\n .build();\n \n repo.save(pc);\n id = pc.getID();\n \n ProductPurchase pc2 = repo.findOne(id);\n for(int x = 0; pc2.getVinylPurchases().size() > x; x++){\n if(pc2.getVinylPurchases().get(x).getName().equals(name)){\n return pc2.getVinylPurchases().get(x).getPrice();\n }\n }\n return null; \n }", "public ResourceCard giveUpResourceCard() throws Exception {\n\t\t return resourceCardHand.getRandomResourceCard();\n\t }", "public void shuffle()\r\n\t{\r\n\t\tRandom rand = ThreadLocalRandom.current();\r\n\t\t\r\n\t\tfor (int i = topCard; i > 0; i--)\r\n\t\t{\r\n\t\t\tint index = rand.nextInt(i + 1);\r\n\t\t\tString temp = cards[index];\r\n\t\t\tcards[index] = cards[i];\r\n\t\t\tcards[i] = temp;\r\n\t\t}\r\n\t}", "public String drawCard()\n {\n // put your code here\n randCard = new Random();\n randNum = randCard.nextInt(message.size());\n return message.get(randNum);\n }", "public int chooseCard(){\n if(playable.size() == 1)//checks the size\n return searchCard(0);//returns the only playable card\n else{\n int temp = (int) Math.random()*playable.size();//chooses a random one\n return searchCard(temp);//returns that cards position\n }\n }", "public TrainCard draw(){\n TrainCard card = cardDeck.get(0);\n cardDeck.remove(0);\n return card;\n }", "public int dealCard() {\n\n\t\tif (currentPosition == 52) {\n\t\t\tshuffle();\n\t\t}\n\t\tcurrentPosition++;\n\t\treturn deck[currentPosition - 1];\n\t}", "@Test\n public void testGetCardID() {\n DevCard devCard = new DevCard(cost, level, color, victoryPoints, productionPower);\n String s = devCard.getCardID();\n }", "public void pick(Card card, Deck deck) throws DeckSizeException\n {\n add(card);\n deck.remove(card);\n }" ]
[ "0.6402746", "0.63565457", "0.61112624", "0.606732", "0.60554516", "0.60552853", "0.6038885", "0.5939981", "0.59166855", "0.58998233", "0.5899593", "0.5857056", "0.58561355", "0.58493483", "0.58283335", "0.5816443", "0.57683116", "0.57634854", "0.5760739", "0.57569027", "0.57302773", "0.57164985", "0.57149076", "0.5702026", "0.5698353", "0.5693077", "0.56837416", "0.5673716", "0.56672883", "0.5647439", "0.5641951", "0.56220615", "0.561285", "0.5612279", "0.5583028", "0.5581499", "0.55549526", "0.5552658", "0.5550677", "0.5532373", "0.55299175", "0.5529728", "0.55270594", "0.5514564", "0.55092365", "0.55017084", "0.54942554", "0.5493692", "0.5492474", "0.54884565", "0.54822373", "0.54818183", "0.5471869", "0.54700446", "0.54688203", "0.5459062", "0.54577523", "0.545141", "0.54431945", "0.54391694", "0.5438277", "0.5425118", "0.54250747", "0.54094756", "0.54022574", "0.54019034", "0.5394662", "0.5379352", "0.53637993", "0.53620607", "0.53597075", "0.5359094", "0.53530204", "0.53529096", "0.53521514", "0.534386", "0.5341299", "0.53379244", "0.5337759", "0.53351426", "0.5331148", "0.53286123", "0.5322947", "0.5320733", "0.53202266", "0.53139937", "0.53086394", "0.53056145", "0.5299149", "0.5295319", "0.5294158", "0.5289015", "0.52846515", "0.5277983", "0.5275093", "0.5272769", "0.5267921", "0.52628016", "0.5256314", "0.52546835" ]
0.6354236
2
Creates an instance which sources data from the given snapshot link.
public SnapshotYieldCurveDataProviderFn(SnapshotLink<YieldCurveDataSnapshot> snapshotLink) { _snapshotLink = ArgumentChecker.notNull(snapshotLink, "snapshotLink"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Snapshot create();", "public SnapshotFeedReader(String feedurl) {\n super(feedurl);\n this.feed = new SnapshotFeed();\n this.links = new HashSet<AtomLink>();\n }", "Snapshot create(Context context);", "CreateSnapshotResult createSnapshot(CreateSnapshotRequest createSnapshotRequest);", "@Override\n public View onCreateSnapshotView(Context context, Parcelable snapshot) {\n View view = new View(context);\n final Bitmap snapshotBitmap = getSnapshot(snapshot);\n if (snapshotBitmap != null) {\n view.setBackground(new BitmapDrawable(context.getResources(), snapshotBitmap));\n }\n return view;\n }", "public void createSnapshot(){\n \t\tthis.snapshot = new SnapShot(this.getAddress(),this.getRoot() + File.separatorChar + this.snapshot_dir);\n \t\tthis.pRecursiveDelete(this.getRoot() + File.separatorChar + this.snapshot_dir);\n \t\tthis.clearFilelist();\n \n \t\tfor(String str : this.dirRecursiveRel(this.getRoot())){\n \t\t\tthis.pCreateFile(this.getSnapshot().getRoot() + File.separatorChar + str);\n \t\t\tthis.pCopyFile(this.getRoot() + File.separatorChar + str,this.getSnapshot().getRoot() + File.separatorChar + str);\n \t\t\tthis.addFile(str);\n \t\t\tthis.getFilelist().get(str).put(this.getAddress(),this.getFilelist().get(str).get(this.getAddress()) + 1);\n \t\t}\n \t\t\n \t\tthis.storeMetadata(this.getRoot());\n \t}", "private MarketSnapshot() {\n\n }", "private void loadSnapshot()\n {\n m_snapshotDoc = null;\n m_Element = null;\n m_ElementStatus = null;\n m_bOffline = false;\n try\n {\n File snapshot = new File(MainFrame.getConfig().getUserPath(),\n SNAPSHOTFILE);\n if(snapshot.exists())\n {\n DocumentBuilder db = RXFileTracker.getDocumentBuilder();\n m_snapshotDoc = db.parse(snapshot.getPath());\n m_Element = m_snapshotDoc.getDocumentElement();\n }\n }\n catch(SAXException | IOException ioe)\n {\n log.error(PSExceptionUtils.getMessageForLog(ioe));\n }\n\n }", "public static SnapshotFeed readSnapshotFeed(String filename_or_url)\n throws IOException, SAXException {\n String uri = URIUtils.getURI(filename_or_url).getExternalForm();\n SnapshotFeedReader handler = new SnapshotFeedReader(uri);\n parseWithHandler(uri, handler);\n return handler.getFeed();\n }", "public ServiceDescription createSnapshot(SICache siCache)\n {\n return new ServiceDescriptionImpl(siCache, data, lsData);\n }", "SMRSnapshot<S> getSnapshot(@NonNull ViewGenerator<S> viewGenerator,\n @NonNull VersionedObjectIdentifier version);", "CopySnapshotResult copySnapshot(CopySnapshotRequest copySnapshotRequest);", "public static GoldenCopy create(\n final String snapshotName,\n final String viewName,\n final Instant valuationTime,\n final CalculationResults calculationResults) {\n return new GoldenCopy(snapshotName, viewName, valuationTime, calculationResults);\n }", "private static FeedSource createFeedSource(String name, URL url) {\n FeedSource feedSource = new FeedSource();\n feedSource.fetchFrequency = FetchFrequency.MINUTES;\n feedSource.fetchInterval = 1;\n feedSource.deployable = false;\n feedSource.name = name;\n feedSource.projectId = project.id;\n feedSource.retrievalMethod = FeedRetrievalMethod.FETCHED_AUTOMATICALLY;\n feedSource.url = url;\n return feedSource;\n }", "public abstract SnapShot GetSnapshot();", "private BlockSnapshotSessionManager getSnapshotSessionManager() {\n BlockSnapshotSessionManager snapshotSessionManager = new BlockSnapshotSessionManager(_dbClient,\n _permissionsHelper, _auditMgr, _coordinator, sc, uriInfo, _request);\n return snapshotSessionManager;\n }", "private void buildMediaSource(Uri uri){\n DefaultBandwidthMeter bandwidthMeter = new DefaultBandwidthMeter();\n //Produces DataSource instances through which media data is loaded\n DataSource.Factory dataSourceFactory = new DefaultDataSourceFactory(this,\n Util.getUserAgent(this, getString(R.string.app_name)), bandwidthMeter);\n // This is the MediaSource representing the media to be played.\n MediaSource videoSource = new ExtractorMediaSource.Factory(dataSourceFactory)\n .createMediaSource(uri);\n //Prepare the player with the source\n mPlayer.prepare(videoSource);\n mPlayer.setPlayWhenReady(true);\n mPlayer.addListener(this);\n }", "public void init(long availSnapshotId) {\n this.availSnapshotInfoRef.set(new SnapshotInfo(availSnapshotId, availSnapshotId));\n }", "public void init(String[] args, RefDataSession refDataSession, SnapshotSession snapshotSession)\n {\n EDFConsumer.addCommandLineArgs();\n try\n {\n CommandLine.parseArgs(args);\n }\n catch (IllegalArgumentException ile)\n {\n System.err.println(\"Error loading command line arguments:\\t\");\n System.err.println(ile.getMessage());\n System.err.println();\n System.err.println(CommandLine.optionHelpString());\n System.exit(CodecReturnCodes.FAILURE);\n }\n\n try\n {\n runtime = System.currentTimeMillis() + CommandLine.intValue(\"runtime\") * 1000;\n }\n catch (NumberFormatException ile)\n {\n System.err.println(\"Invalid argument, number expected.\\t\");\n System.err.println(ile.getMessage());\n System.exit(CodecReturnCodes.FAILURE);\n }\n\n // load dictionary\n dictionaryHandler = refDataSession.dictionary();\n\n seqMcastInfo = refDataSession.seqMcastInfo();\n symbolListHandler = snapshotSession.symbolListHandler();\n \n PingHandler pingHandler = new PingHandler();\n InProgInfo inProg = TransportFactory.createInProgInfo();\n \n List<String> addresses;\n List<String> ports;\n List<String> interfaces;\n \n if (state != RealTimeSessionState.REALTIME_STATE_READY)\n {\n if ((addresses = CommandLine.values(\"rtda\")) != null &&\n (ports = CommandLine.values(\"rtdp\")) != null &&\n (interfaces = CommandLine.values(\"rtif\")) != null)\n {\n for (int i = 0; i < addresses.size(); ++i)\n {\n try\n {\n connect(inProg, addresses.get(i), ports.get(i), interfaces.get(i));\n }\n catch (InterruptedException e)\n {\n System.out.println(\"Thread: \" + Thread.currentThread() + \" interrupted. Error:\"\n + e.getLocalizedMessage());\n return;\n }\n }\n }\n else\n try\n {\n if (CommandLine.values(\"mbo\") != null)\n for (int i = 0; i < CommandLine.values(\"mbo\").size(); ++i)\n {\n if ((itemEntry = symbolListHandler.symbolList().get(CommandLine.values(\"mbo\").get(i))) != null)\n {\n if(!checkIfConnected(itemEntry.getRealTimeChannelId(DomainTypes.MARKET_BY_ORDER)))\n {\n connect(inProg, itemEntry.getRealTimeChannelId(DomainTypes.MARKET_BY_ORDER));\n }\n\n }\n\n }\n if (CommandLine.values(\"mbp\") != null)\n for (int i = 0; i < CommandLine.values(\"mbp\").size(); ++i)\n {\n if ((itemEntry = symbolListHandler.symbolList().get(CommandLine.values(\"mbp\").get(i))) != null)\n {\n if(!checkIfConnected(itemEntry.getRealTimeChannelId(DomainTypes.MARKET_BY_PRICE)))\n {\n connect(inProg, itemEntry.getRealTimeChannelId(DomainTypes.MARKET_BY_PRICE));\n }\n }\n\n }\n if (CommandLine.values(\"mp\") != null)\n for (int i = 0; i < CommandLine.values(\"mp\").size(); ++i)\n {\n if ((itemEntry = symbolListHandler.symbolList().get(CommandLine.values(\"mp\").get(i))) != null)\n {\n if(!checkIfConnected(itemEntry.getRealTimeChannelId(DomainTypes.MARKET_PRICE)))\n {\n connect(inProg, itemEntry.getRealTimeChannelId(DomainTypes.MARKET_PRICE));\n }\n }\n }\n }\n catch (InterruptedException intExp)\n {\n System.out.println(\"Thread: \" + Thread.currentThread() + \" interrupted. Error:\"\n + intExp.getLocalizedMessage());\n return;\n }\n }\n // Handle run-time\n if (System.currentTimeMillis() >= runtime)\n {\n System.out.println(\"RealTimeSession run-time expired...\");\n return;\n }\n\n state = RealTimeSessionState.REALTIME_STATE_READY;\n\n \n \n // Initialize ping handlers\n for (ChannelSession channelSession : channelSessions)\n pingHandler.initPingHandler(channelSession.channel().pingTimeout());\n }", "public static StreamsConnection createInstance(String userName,\n String authToken, String url) {\n IStreamsConnection delegate = createDelegate(userName, authToken, url);\n StreamsConnection sc = new StreamsConnection(delegate, false);\n sc.userName = userName;\n sc.authToken = authToken;\n sc.url = url;\n return sc;\n }", "protected BlockSnapshot prepareSnapshotFromVolume(Volume volume, String snapshotName, Volume targetVolume) {\n BlockSnapshot snapshot = new BlockSnapshot();\n snapshot.setId(URIUtil.createId(BlockSnapshot.class));\n URI cgUri = null;\n\n URIQueryResultList queryResults = new URIQueryResultList();\n _dbClient.queryByConstraint(AlternateIdConstraint.Factory\n .getVolumeByAssociatedVolumesConstraint(volume.getId().toString()),\n queryResults);\n if (queryResults.iterator().hasNext()) {\n Volume sourceVplexVolume = _dbClient.queryObject(Volume.class, queryResults.iterator().next());\n cgUri = sourceVplexVolume.getConsistencyGroup();\n snapshot.setProject(new NamedURI(sourceVplexVolume.getProject().getURI(), snapshotName));\n } else {\n cgUri = volume.getConsistencyGroup();\n snapshot.setProject(new NamedURI(volume.getProject().getURI(), snapshotName));\n }\n\n if (cgUri != null) {\n snapshot.setConsistencyGroup(cgUri);\n }\n\n snapshot.setSourceNativeId(volume.getNativeId());\n snapshot.setParent(new NamedURI(volume.getId(), snapshotName));\n String modifiedSnapshotName = snapshotName;\n\n // We want snaps of targets to contain the varray label so we can distinguish multiple\n // targets from one another\n if (targetVolume != null) {\n VirtualArray targetVarray = _dbClient.queryObject(VirtualArray.class, targetVolume.getVirtualArray());\n modifiedSnapshotName = modifiedSnapshotName + \"-\" + targetVarray.getLabel();\n }\n snapshot.setLabel(modifiedSnapshotName);\n\n snapshot.setStorageController(volume.getStorageController());\n snapshot.setVirtualArray(volume.getVirtualArray());\n snapshot.setProtocol(new StringSet());\n snapshot.getProtocol().addAll(volume.getProtocol());\n snapshot.setSnapsetLabel(ResourceOnlyNameGenerator.removeSpecialCharsForName(\n snapshotName, SmisConstants.MAX_SNAPSHOT_NAME_LENGTH));\n\n return snapshot;\n }", "Ressource createRessource();", "@SubL(source = \"cycl/sbhl/sbhl-link-methods.lisp\", position = 13313) \n public static final SubLObject create_and_store_sbhl_link(SubLObject arg1, SubLObject arg2, SubLObject direction, SubLObject mt, SubLObject tv, SubLObject module) {\n if ((NIL != module)) {\n checkType(module, $sym4$SBHL_MODULE_P);\n }\n sbhl_graphs.set_sbhl_graph_link(arg1, create_new_sbhl_link(direction, mt, tv, arg2, module), module);\n return NIL;\n }", "public NewsSource(String name, String link, String rss_link)\n\t{\n\t\tthis.name = name;\n\t\tthis.link = link;\n\t\tthis.rss_link = rss_link;\n\t}", "@Override\n public void onSnapshotReady(Bitmap arg0) {\n mIsMapStatic = true;\n\n // Creating an imageview with the snapshot\n ImageView imageView = new ImageView(getActivity());\n imageView.setLayoutParams(new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT,\n LayoutParams.WRAP_CONTENT));\n imageView.setImageBitmap(arg0);\n\n // Removing all the views (dynamic map) and adding the imageview\n assert getView() != null;\n ((ViewGroup) getView()).removeAllViews();\n ((ViewGroup) getView()).addView(imageView);\n\n mMapDataLoader.onMapCameraChange();\n }", "public AgentInstance instantiate(AgentInstance refererInstance, User user, AgentServer agentServer) throws AgentServerException {\n AgentInstance agentInstance = agentServer.getAgentInstance(user, dataSource, parameterValues, true);\r\n \r\n // Optionally record reference to instance\r\n if (refererInstance != null)\r\n agentInstance.addReference(refererInstance);\r\n \r\n // Mark the instance as being \"auto-created\"\r\n agentInstance.autoCreated = true;\r\n \r\n // Return the new instance\r\n return agentInstance;\r\n }", "public DataSourceDetail(DataSourceDetail source) {\n if (source.Id != null) {\n this.Id = new String(source.Id);\n }\n if (source.Title != null) {\n this.Title = new String(source.Title);\n }\n if (source.Name != null) {\n this.Name = new String(source.Name);\n }\n if (source.Type != null) {\n this.Type = new String(source.Type);\n }\n if (source.Description != null) {\n this.Description = new String(source.Description);\n }\n if (source.Schema != null) {\n this.Schema = new String(source.Schema);\n }\n if (source.CmsProject != null) {\n this.CmsProject = new String(source.CmsProject);\n }\n if (source.PkgId != null) {\n this.PkgId = new String(source.PkgId);\n }\n if (source.SchemaVersion != null) {\n this.SchemaVersion = new String(source.SchemaVersion);\n }\n if (source.CreatorId != null) {\n this.CreatorId = new String(source.CreatorId);\n }\n if (source.CreatedAt != null) {\n this.CreatedAt = new String(source.CreatedAt);\n }\n if (source.UpdatedAt != null) {\n this.UpdatedAt = new String(source.UpdatedAt);\n }\n if (source.EnvId != null) {\n this.EnvId = new String(source.EnvId);\n }\n if (source.DataSourceVersion != null) {\n this.DataSourceVersion = new String(source.DataSourceVersion);\n }\n if (source.AppUsageList != null) {\n this.AppUsageList = new DataSourceLinkApp[source.AppUsageList.length];\n for (int i = 0; i < source.AppUsageList.length; i++) {\n this.AppUsageList[i] = new DataSourceLinkApp(source.AppUsageList[i]);\n }\n }\n if (source.PublishedAt != null) {\n this.PublishedAt = new String(source.PublishedAt);\n }\n if (source.ChildDataSourceIds != null) {\n this.ChildDataSourceIds = new String[source.ChildDataSourceIds.length];\n for (int i = 0; i < source.ChildDataSourceIds.length; i++) {\n this.ChildDataSourceIds[i] = new String(source.ChildDataSourceIds[i]);\n }\n }\n if (source.Fun != null) {\n this.Fun = new String(source.Fun);\n }\n if (source.ScfStatus != null) {\n this.ScfStatus = new Long(source.ScfStatus);\n }\n if (source.Methods != null) {\n this.Methods = new String(source.Methods);\n }\n if (source.ChildDataSourceNames != null) {\n this.ChildDataSourceNames = new String[source.ChildDataSourceNames.length];\n for (int i = 0; i < source.ChildDataSourceNames.length; i++) {\n this.ChildDataSourceNames[i] = new String(source.ChildDataSourceNames[i]);\n }\n }\n if (source.IsNewDataSource != null) {\n this.IsNewDataSource = new Long(source.IsNewDataSource);\n }\n if (source.ViewId != null) {\n this.ViewId = new String(source.ViewId);\n }\n if (source.Configuration != null) {\n this.Configuration = new String(source.Configuration);\n }\n if (source.TemplateCode != null) {\n this.TemplateCode = new String(source.TemplateCode);\n }\n if (source.Source != null) {\n this.Source = new Long(source.Source);\n }\n if (source.PublishVersion != null) {\n this.PublishVersion = new String(source.PublishVersion);\n }\n if (source.PublishViewId != null) {\n this.PublishViewId = new String(source.PublishViewId);\n }\n if (source.SubType != null) {\n this.SubType = new String(source.SubType);\n }\n if (source.AuthStatus != null) {\n this.AuthStatus = new Long(source.AuthStatus);\n }\n if (source.AuthInfo != null) {\n this.AuthInfo = new TicketAuthInfo(source.AuthInfo);\n }\n }", "Link createLink();", "public static ClientLoader newInstance(final DBInfo theSourceDB) {\r\n final ClientLoader instance = new ClientLoader();\r\n instance.sourceDB = checkNotNull(theSourceDB, \"sourceDB is null\");\r\n return instance;\r\n }", "public History(History historyData) {\n\tthis.timestampMinute = historyData.getTimestampMinute();\n\tthis.status = historyData.getStatus();\n\tthis.plug = historyData.getPlug();\n }", "@Override\n public void handleSnapshot(FarmUtilDomain.PublishUtilState snapshot) {\n \n }", "public RealTimeDataStream(RealTimeDataSource source, PushBufferStream stream) {\n this.stream = stream;\n this.source = source;\n this.stream.setTransferHandler(this);\n }", "private Link() {\n }", "public Link() {\n }", "private void createMockArchivedSnapshot(String sSnapshot, File fileSnapshot, int nPartitions)\n throws IOException\n {\n File fileSnapshotDir = new File(fileSnapshot, CLUSTER_NAME);\n\n fileSnapshotDir = new File(fileSnapshotDir, SERVICE_NAME);\n fileSnapshotDir = new File(fileSnapshotDir, sSnapshot);\n\n fileSnapshotDir.mkdir();\n\n for (int i = 0; i < nPartitions; i++)\n {\n File fileGUIDDir = new File(fileSnapshotDir, GUIDHelper.generateGUID(i, 1, MEMBER_DATE, getMockMember(1)));\n\n fileGUIDDir.createNewFile();\n }\n }", "public EventHistoryItem(EventHistoryItem source) {\n if (source.TimeStamp != null) {\n this.TimeStamp = new Long(source.TimeStamp);\n }\n if (source.ProductId != null) {\n this.ProductId = new String(source.ProductId);\n }\n if (source.DeviceName != null) {\n this.DeviceName = new String(source.DeviceName);\n }\n if (source.EventId != null) {\n this.EventId = new String(source.EventId);\n }\n if (source.Type != null) {\n this.Type = new String(source.Type);\n }\n if (source.Data != null) {\n this.Data = new String(source.Data);\n }\n }", "public static Domain loadSnapshot(final String snapshotLocation, final String environment) \n\t\t\tthrows SwitcherSnapshotLoadException, FileNotFoundException {\n\t\t\n\t\tfinal Gson gson = new Gson();\n\n\t\ttry {\n\t\t\tfinal Snapshot data = gson.fromJson(new FileReader(String.format(SNAPSHOT_FILE_FORMAT, snapshotLocation, environment)), Snapshot.class);\n\t\t\treturn data.getDomain();\n\t\t} catch (JsonSyntaxException | JsonIOException e) {\n\t\t\tlogger.error(e);\n\t\t\tthrow new SwitcherSnapshotLoadException(String.format(SNAPSHOT_FILE_FORMAT, snapshotLocation, environment), e);\n\t\t} catch (FileNotFoundException e) {\n\t\t\tthrow e;\n\t\t}\n\t}", "public interface Snapshot {\n /**\n * Gets the id property: Fully qualified resource Id for the resource.\n *\n * @return the id value.\n */\n String id();\n\n /**\n * Gets the name property: The name of the resource.\n *\n * @return the name value.\n */\n String name();\n\n /**\n * Gets the type property: The type of the resource.\n *\n * @return the type value.\n */\n String type();\n\n /**\n * Gets the location property: The geo-location where the resource lives.\n *\n * @return the location value.\n */\n String location();\n\n /**\n * Gets the tags property: Resource tags.\n *\n * @return the tags value.\n */\n Map<String, String> tags();\n\n /**\n * Gets the managedBy property: Unused. Always Null.\n *\n * @return the managedBy value.\n */\n String managedBy();\n\n /**\n * Gets the sku property: The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS.\n *\n * @return the sku value.\n */\n SnapshotSku sku();\n\n /**\n * Gets the timeCreated property: The time when the disk was created.\n *\n * @return the timeCreated value.\n */\n OffsetDateTime timeCreated();\n\n /**\n * Gets the osType property: The Operating System type.\n *\n * @return the osType value.\n */\n OperatingSystemTypes osType();\n\n /**\n * Gets the hyperVGeneration property: The hypervisor generation of the Virtual Machine. Applicable to OS disks\n * only.\n *\n * @return the hyperVGeneration value.\n */\n HyperVGeneration hyperVGeneration();\n\n /**\n * Gets the creationData property: Disk source information. CreationData information cannot be changed after the\n * disk has been created.\n *\n * @return the creationData value.\n */\n CreationData creationData();\n\n /**\n * Gets the diskSizeGB property: If creationData.createOption is Empty, this field is mandatory and it indicates the\n * size of the disk to create. If this field is present for updates or creation with other options, it indicates a\n * resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's\n * size.\n *\n * @return the diskSizeGB value.\n */\n Integer diskSizeGB();\n\n /**\n * Gets the diskSizeBytes property: The size of the disk in bytes. This field is read only.\n *\n * @return the diskSizeBytes value.\n */\n Long diskSizeBytes();\n\n /**\n * Gets the uniqueId property: Unique Guid identifying the resource.\n *\n * @return the uniqueId value.\n */\n String uniqueId();\n\n /**\n * Gets the encryptionSettingsCollection property: Encryption settings collection used be Azure Disk Encryption, can\n * contain multiple encryption settings per disk or snapshot.\n *\n * @return the encryptionSettingsCollection value.\n */\n EncryptionSettingsCollection encryptionSettingsCollection();\n\n /**\n * Gets the provisioningState property: The disk provisioning state.\n *\n * @return the provisioningState value.\n */\n String provisioningState();\n\n /**\n * Gets the incremental property: Whether a snapshot is incremental. Incremental snapshots on the same disk occupy\n * less space than full snapshots and can be diffed.\n *\n * @return the incremental value.\n */\n Boolean incremental();\n\n /**\n * Gets the encryption property: Encryption property can be used to encrypt data at rest with customer managed keys\n * or platform managed keys.\n *\n * @return the encryption value.\n */\n Encryption encryption();\n\n /**\n * Gets the region of the resource.\n *\n * @return the region of the resource.\n */\n Region region();\n\n /**\n * Gets the name of the resource region.\n *\n * @return the name of the resource region.\n */\n String regionName();\n\n /**\n * Gets the inner com.azure.resourcemanager.azurestack.compute.fluent.models.SnapshotInner object.\n *\n * @return the inner object.\n */\n SnapshotInner innerModel();\n\n /** The entirety of the Snapshot definition. */\n interface Definition\n extends DefinitionStages.Blank,\n DefinitionStages.WithLocation,\n DefinitionStages.WithResourceGroup,\n DefinitionStages.WithCreate {\n }\n /** The Snapshot definition stages. */\n interface DefinitionStages {\n /** The first stage of the Snapshot definition. */\n interface Blank extends WithLocation {\n }\n /** The stage of the Snapshot definition allowing to specify location. */\n interface WithLocation {\n /**\n * Specifies the region for the resource.\n *\n * @param location The geo-location where the resource lives.\n * @return the next definition stage.\n */\n WithResourceGroup withRegion(Region location);\n\n /**\n * Specifies the region for the resource.\n *\n * @param location The geo-location where the resource lives.\n * @return the next definition stage.\n */\n WithResourceGroup withRegion(String location);\n }\n /** The stage of the Snapshot definition allowing to specify parent resource. */\n interface WithResourceGroup {\n /**\n * Specifies resourceGroupName.\n *\n * @param resourceGroupName The name of the resource group.\n * @return the next definition stage.\n */\n WithCreate withExistingResourceGroup(String resourceGroupName);\n }\n /**\n * The stage of the Snapshot definition which contains all the minimum required properties for the resource to\n * be created, but also allows for any other optional properties to be specified.\n */\n interface WithCreate\n extends DefinitionStages.WithTags,\n DefinitionStages.WithSku,\n DefinitionStages.WithOsType,\n DefinitionStages.WithHyperVGeneration,\n DefinitionStages.WithCreationData,\n DefinitionStages.WithDiskSizeGB,\n DefinitionStages.WithEncryptionSettingsCollection,\n DefinitionStages.WithIncremental,\n DefinitionStages.WithEncryption {\n /**\n * Executes the create request.\n *\n * @return the created resource.\n */\n Snapshot create();\n\n /**\n * Executes the create request.\n *\n * @param context The context to associate with this operation.\n * @return the created resource.\n */\n Snapshot create(Context context);\n }\n /** The stage of the Snapshot definition allowing to specify tags. */\n interface WithTags {\n /**\n * Specifies the tags property: Resource tags..\n *\n * @param tags Resource tags.\n * @return the next definition stage.\n */\n WithCreate withTags(Map<String, String> tags);\n }\n /** The stage of the Snapshot definition allowing to specify sku. */\n interface WithSku {\n /**\n * Specifies the sku property: The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS..\n *\n * @param sku The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS.\n * @return the next definition stage.\n */\n WithCreate withSku(SnapshotSku sku);\n }\n /** The stage of the Snapshot definition allowing to specify osType. */\n interface WithOsType {\n /**\n * Specifies the osType property: The Operating System type..\n *\n * @param osType The Operating System type.\n * @return the next definition stage.\n */\n WithCreate withOsType(OperatingSystemTypes osType);\n }\n /** The stage of the Snapshot definition allowing to specify hyperVGeneration. */\n interface WithHyperVGeneration {\n /**\n * Specifies the hyperVGeneration property: The hypervisor generation of the Virtual Machine. Applicable to\n * OS disks only..\n *\n * @param hyperVGeneration The hypervisor generation of the Virtual Machine. Applicable to OS disks only.\n * @return the next definition stage.\n */\n WithCreate withHyperVGeneration(HyperVGeneration hyperVGeneration);\n }\n /** The stage of the Snapshot definition allowing to specify creationData. */\n interface WithCreationData {\n /**\n * Specifies the creationData property: Disk source information. CreationData information cannot be changed\n * after the disk has been created..\n *\n * @param creationData Disk source information. CreationData information cannot be changed after the disk\n * has been created.\n * @return the next definition stage.\n */\n WithCreate withCreationData(CreationData creationData);\n }\n /** The stage of the Snapshot definition allowing to specify diskSizeGB. */\n interface WithDiskSizeGB {\n /**\n * Specifies the diskSizeGB property: If creationData.createOption is Empty, this field is mandatory and it\n * indicates the size of the disk to create. If this field is present for updates or creation with other\n * options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and\n * can only increase the disk's size..\n *\n * @param diskSizeGB If creationData.createOption is Empty, this field is mandatory and it indicates the\n * size of the disk to create. If this field is present for updates or creation with other options, it\n * indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can\n * only increase the disk's size.\n * @return the next definition stage.\n */\n WithCreate withDiskSizeGB(Integer diskSizeGB);\n }\n /** The stage of the Snapshot definition allowing to specify encryptionSettingsCollection. */\n interface WithEncryptionSettingsCollection {\n /**\n * Specifies the encryptionSettingsCollection property: Encryption settings collection used be Azure Disk\n * Encryption, can contain multiple encryption settings per disk or snapshot..\n *\n * @param encryptionSettingsCollection Encryption settings collection used be Azure Disk Encryption, can\n * contain multiple encryption settings per disk or snapshot.\n * @return the next definition stage.\n */\n WithCreate withEncryptionSettingsCollection(EncryptionSettingsCollection encryptionSettingsCollection);\n }\n /** The stage of the Snapshot definition allowing to specify incremental. */\n interface WithIncremental {\n /**\n * Specifies the incremental property: Whether a snapshot is incremental. Incremental snapshots on the same\n * disk occupy less space than full snapshots and can be diffed..\n *\n * @param incremental Whether a snapshot is incremental. Incremental snapshots on the same disk occupy less\n * space than full snapshots and can be diffed.\n * @return the next definition stage.\n */\n WithCreate withIncremental(Boolean incremental);\n }\n /** The stage of the Snapshot definition allowing to specify encryption. */\n interface WithEncryption {\n /**\n * Specifies the encryption property: Encryption property can be used to encrypt data at rest with customer\n * managed keys or platform managed keys..\n *\n * @param encryption Encryption property can be used to encrypt data at rest with customer managed keys or\n * platform managed keys.\n * @return the next definition stage.\n */\n WithCreate withEncryption(Encryption encryption);\n }\n }\n /**\n * Begins update for the Snapshot resource.\n *\n * @return the stage of resource update.\n */\n Snapshot.Update update();\n\n /** The template for Snapshot update. */\n interface Update\n extends UpdateStages.WithTags,\n UpdateStages.WithSku,\n UpdateStages.WithOsType,\n UpdateStages.WithDiskSizeGB,\n UpdateStages.WithEncryptionSettingsCollection,\n UpdateStages.WithEncryption {\n /**\n * Executes the update request.\n *\n * @return the updated resource.\n */\n Snapshot apply();\n\n /**\n * Executes the update request.\n *\n * @param context The context to associate with this operation.\n * @return the updated resource.\n */\n Snapshot apply(Context context);\n }\n /** The Snapshot update stages. */\n interface UpdateStages {\n /** The stage of the Snapshot update allowing to specify tags. */\n interface WithTags {\n /**\n * Specifies the tags property: Resource tags.\n *\n * @param tags Resource tags.\n * @return the next definition stage.\n */\n Update withTags(Map<String, String> tags);\n }\n /** The stage of the Snapshot update allowing to specify sku. */\n interface WithSku {\n /**\n * Specifies the sku property: The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS..\n *\n * @param sku The snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS.\n * @return the next definition stage.\n */\n Update withSku(SnapshotSku sku);\n }\n /** The stage of the Snapshot update allowing to specify osType. */\n interface WithOsType {\n /**\n * Specifies the osType property: the Operating System type..\n *\n * @param osType the Operating System type.\n * @return the next definition stage.\n */\n Update withOsType(OperatingSystemTypes osType);\n }\n /** The stage of the Snapshot update allowing to specify diskSizeGB. */\n interface WithDiskSizeGB {\n /**\n * Specifies the diskSizeGB property: If creationData.createOption is Empty, this field is mandatory and it\n * indicates the size of the disk to create. If this field is present for updates or creation with other\n * options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and\n * can only increase the disk's size..\n *\n * @param diskSizeGB If creationData.createOption is Empty, this field is mandatory and it indicates the\n * size of the disk to create. If this field is present for updates or creation with other options, it\n * indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can\n * only increase the disk's size.\n * @return the next definition stage.\n */\n Update withDiskSizeGB(Integer diskSizeGB);\n }\n /** The stage of the Snapshot update allowing to specify encryptionSettingsCollection. */\n interface WithEncryptionSettingsCollection {\n /**\n * Specifies the encryptionSettingsCollection property: Encryption settings collection used be Azure Disk\n * Encryption, can contain multiple encryption settings per disk or snapshot..\n *\n * @param encryptionSettingsCollection Encryption settings collection used be Azure Disk Encryption, can\n * contain multiple encryption settings per disk or snapshot.\n * @return the next definition stage.\n */\n Update withEncryptionSettingsCollection(EncryptionSettingsCollection encryptionSettingsCollection);\n }\n /** The stage of the Snapshot update allowing to specify encryption. */\n interface WithEncryption {\n /**\n * Specifies the encryption property: Encryption property can be used to encrypt data at rest with customer\n * managed keys or platform managed keys..\n *\n * @param encryption Encryption property can be used to encrypt data at rest with customer managed keys or\n * platform managed keys.\n * @return the next definition stage.\n */\n Update withEncryption(Encryption encryption);\n }\n }\n /**\n * Refreshes the resource to sync with Azure.\n *\n * @return the refreshed resource.\n */\n Snapshot refresh();\n\n /**\n * Refreshes the resource to sync with Azure.\n *\n * @param context The context to associate with this operation.\n * @return the refreshed resource.\n */\n Snapshot refresh(Context context);\n}", "public static Instance findObject(@NonNull Snapshot snapshot, String id) {\n long id2 = Long.parseLong(id, 16);\n\n return snapshot.findInstance(id2);\n }", "public DBInstance(DBInstance source) {\n if (source.InstanceId != null) {\n this.InstanceId = new String(source.InstanceId);\n }\n if (source.InstanceName != null) {\n this.InstanceName = new String(source.InstanceName);\n }\n if (source.AppId != null) {\n this.AppId = new Long(source.AppId);\n }\n if (source.ProjectId != null) {\n this.ProjectId = new Long(source.ProjectId);\n }\n if (source.Region != null) {\n this.Region = new String(source.Region);\n }\n if (source.Zone != null) {\n this.Zone = new String(source.Zone);\n }\n if (source.VpcId != null) {\n this.VpcId = new Long(source.VpcId);\n }\n if (source.SubnetId != null) {\n this.SubnetId = new Long(source.SubnetId);\n }\n if (source.Status != null) {\n this.Status = new Long(source.Status);\n }\n if (source.Vip != null) {\n this.Vip = new String(source.Vip);\n }\n if (source.Vport != null) {\n this.Vport = new Long(source.Vport);\n }\n if (source.WanDomain != null) {\n this.WanDomain = new String(source.WanDomain);\n }\n if (source.WanVip != null) {\n this.WanVip = new String(source.WanVip);\n }\n if (source.WanPort != null) {\n this.WanPort = new Long(source.WanPort);\n }\n if (source.CreateTime != null) {\n this.CreateTime = new String(source.CreateTime);\n }\n if (source.UpdateTime != null) {\n this.UpdateTime = new String(source.UpdateTime);\n }\n if (source.AutoRenewFlag != null) {\n this.AutoRenewFlag = new Long(source.AutoRenewFlag);\n }\n if (source.PeriodEndTime != null) {\n this.PeriodEndTime = new String(source.PeriodEndTime);\n }\n if (source.Uin != null) {\n this.Uin = new String(source.Uin);\n }\n if (source.TdsqlVersion != null) {\n this.TdsqlVersion = new String(source.TdsqlVersion);\n }\n if (source.Memory != null) {\n this.Memory = new Long(source.Memory);\n }\n if (source.Storage != null) {\n this.Storage = new Long(source.Storage);\n }\n if (source.UniqueVpcId != null) {\n this.UniqueVpcId = new String(source.UniqueVpcId);\n }\n if (source.UniqueSubnetId != null) {\n this.UniqueSubnetId = new String(source.UniqueSubnetId);\n }\n if (source.OriginSerialId != null) {\n this.OriginSerialId = new String(source.OriginSerialId);\n }\n if (source.NodeCount != null) {\n this.NodeCount = new Long(source.NodeCount);\n }\n if (source.IsTmp != null) {\n this.IsTmp = new Long(source.IsTmp);\n }\n if (source.ExclusterId != null) {\n this.ExclusterId = new String(source.ExclusterId);\n }\n if (source.Id != null) {\n this.Id = new Long(source.Id);\n }\n if (source.Pid != null) {\n this.Pid = new Long(source.Pid);\n }\n if (source.Qps != null) {\n this.Qps = new Long(source.Qps);\n }\n if (source.Paymode != null) {\n this.Paymode = new String(source.Paymode);\n }\n if (source.Locker != null) {\n this.Locker = new Long(source.Locker);\n }\n if (source.StatusDesc != null) {\n this.StatusDesc = new String(source.StatusDesc);\n }\n if (source.WanStatus != null) {\n this.WanStatus = new Long(source.WanStatus);\n }\n if (source.IsAuditSupported != null) {\n this.IsAuditSupported = new Long(source.IsAuditSupported);\n }\n if (source.Machine != null) {\n this.Machine = new String(source.Machine);\n }\n if (source.IsEncryptSupported != null) {\n this.IsEncryptSupported = new Long(source.IsEncryptSupported);\n }\n if (source.Cpu != null) {\n this.Cpu = new Long(source.Cpu);\n }\n if (source.Ipv6Flag != null) {\n this.Ipv6Flag = new Long(source.Ipv6Flag);\n }\n if (source.Vipv6 != null) {\n this.Vipv6 = new String(source.Vipv6);\n }\n if (source.WanVipv6 != null) {\n this.WanVipv6 = new String(source.WanVipv6);\n }\n if (source.WanPortIpv6 != null) {\n this.WanPortIpv6 = new Long(source.WanPortIpv6);\n }\n if (source.WanStatusIpv6 != null) {\n this.WanStatusIpv6 = new Long(source.WanStatusIpv6);\n }\n if (source.DbEngine != null) {\n this.DbEngine = new String(source.DbEngine);\n }\n if (source.DbVersion != null) {\n this.DbVersion = new String(source.DbVersion);\n }\n if (source.DcnFlag != null) {\n this.DcnFlag = new Long(source.DcnFlag);\n }\n if (source.DcnStatus != null) {\n this.DcnStatus = new Long(source.DcnStatus);\n }\n if (source.DcnDstNum != null) {\n this.DcnDstNum = new Long(source.DcnDstNum);\n }\n if (source.InstanceType != null) {\n this.InstanceType = new Long(source.InstanceType);\n }\n if (source.ResourceTags != null) {\n this.ResourceTags = new ResourceTag[source.ResourceTags.length];\n for (int i = 0; i < source.ResourceTags.length; i++) {\n this.ResourceTags[i] = new ResourceTag(source.ResourceTags[i]);\n }\n }\n if (source.DbVersionId != null) {\n this.DbVersionId = new String(source.DbVersionId);\n }\n }", "protected abstract T createRessource();", "public PhysicalLink() {\n\n }", "public static Domain loadSnapshot(final String snapshotFile) throws SwitcherSnapshotLoadException {\n\t\t\n\t\tfinal Gson gson = new Gson();\n\n\t\ttry {\n\t\t\tfinal Snapshot data = gson.fromJson(new FileReader(snapshotFile), Snapshot.class);\n\t\t\treturn data.getDomain();\n\t\t} catch (JsonSyntaxException | JsonIOException | FileNotFoundException e) {\n\t\t\tlogger.error(e);\n\t\t\tthrow new SwitcherSnapshotLoadException(snapshotFile, e);\n\t\t}\n\t}", "public void setSnapshot(Snapshot snapshot) {\n m_table.getEntry(\"snapshot\").setValue(snapshot.getValue());\n }", "public void takeSnapshot(String snapshotName) throws IOException\n {\n ssProxy.takeAllSnapshot(snapshotName);\n }", "protected void openStream ()\n {\n stream = Util.stream (entry, \"Holder.java\");\n }", "Object create(String uri) throws IOException, SAXException, ParserConfigurationException;", "private AdsMediaSource buildMediaSource(Uri uri) {\n /*DataSource.Factory dataSourceFactory =\n new DefaultDataSourceFactory(this, Util.getUserAgent(this, \"playlist\"));*/\n hlsMediaSource = new HlsMediaSource.Factory(dataSourceFactory).setPlaylistParserFactory(\n new DefaultHlsPlaylistParserFactory(getOfflineStreamKeys(uri)))\n .createMediaSource(uri);\n ;\n return new AdsMediaSource(hlsMediaSource,\n dataSourceFactory,\n adsLoader,\n simpleExoPlayerView.getOverlayFrameLayout());\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic AnalysisGraph createNewInstance() {\n\t\tAnalysisGraph graph = new AnalysisGraph();\n\t\tgraph.currentIndex = currentIndex;\n\t\t\n\t\tgraph.nodes = (HashMap<String, Node>) nodes.clone();\n\t\tgraph.nodeList = (ArrayList<Node>)((ArrayList<Node>) nodeList).clone();\n\t\tgraph.links = (ArrayList<Link>)((ArrayList<Link>) links).clone();\n\t\treturn graph;\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n mView = inflater.inflate(R.layout.camera_page, container, false);\n\n if(null != savedInstanceState) {\n mSnapshot = savedInstanceState.getParcelable(CameraPage.ARG_IMAGE);\n }\n Button doCameraSnapshotBtn = (Button) mView.findViewById(R.id.get_camera_snapshot_btn);\n doCameraSnapshotBtn.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n MQTT_Client mqttClient = (MQTT_Client) MainActivity.Args.get(Arg.MQTT_CLIENT);\n mqttClient.askSnapshot(new MQTT_Client.OnResultListener() {\n @Override\n public void onSuccess(@Nullable Object result) {\n byte[] imageData = (byte[]) result;\n mSnapshot = BitmapFactory.decodeByteArray(imageData, 0, imageData.length);\n mUpdateGUICallback.onUpdate();\n }\n @Override\n public void onFailure(@Nullable Object result) {\n Toast message = Toast.makeText(getActivity(), (String) result, Toast.LENGTH_LONG);\n message.show();\n }\n });\n }\n });\n return mView;\n }", "public Database(String url) {\n this.url = url;\n\n File f = new File(url);\n\n if (f.exists()) {\n try {\n f.mkdirs();\n f.createNewFile();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n //create table relationship\n LinkedList<String> relationship_attributes = new LinkedList<>();\n relationship_attributes.add(\"id_entity1\");\n relationship_attributes.add(\"id_entity2\");\n relationship_attributes.add(\"description\");\n this.create_table(\"relationship\", relationship_attributes);\n }", "public BookDatabaseEntrySnapshot(\n final BookID in_id,\n final OptionType<File> in_cover,\n final OptionType<File> in_book,\n final OPDSAcquisitionFeedEntry in_entry,\n final OptionType<AdobeAdeptLoan> in_adobe_rights)\n {\n this.id = NullCheck.notNull(in_id);\n this.cover = NullCheck.notNull(in_cover);\n this.book = NullCheck.notNull(in_book);\n this.entry = NullCheck.notNull(in_entry);\n this.adobe_rights = NullCheck.notNull(in_adobe_rights);\n }", "LINK createLINK();", "public PSFUDApplication()\n {\n loadSnapshot();\n }", "public DetailHost(DetailHost source) {\n if (source.AppId != null) {\n this.AppId = new Long(source.AppId);\n }\n if (source.ZoneId != null) {\n this.ZoneId = new String(source.ZoneId);\n }\n if (source.Status != null) {\n this.Status = new String(source.Status);\n }\n if (source.Host != null) {\n this.Host = new String(source.Host);\n }\n }", "public interface FS2MetaSnapshot {\r\n\r\n Date createdOn();\r\n\r\n String createdBy();\r\n \r\n void dump(PrintStream printStream);\r\n\r\n // obtain a single header\r\n String[] getHeader(String key);\r\n\r\n // get the set of all header names\r\n Set<String> getHeaderNames();\r\n\r\n // set of key/value pairs providing metadata for this object\r\n FS2ObjectHeaders getHeaders();\r\n\r\n URI getURI();\r\n\r\n // when was this snapshot taken?\r\n Date snapshotTime();\r\n\r\n // TODO add these later... should be pluggable config...\r\n // boolean isEncrypted();\r\n // boolean isCompressed();\r\n\r\n // JSON representation of this snapshot\r\n String toJSON();\r\n\r\n}", "private SnapshotUtils() {\r\n\t}", "private synchronized static void createInstance() {\n if (INSTANCE == null) { \n INSTANCE = new DataConnection();\n }\n }", "DatabaseClient newStagingClient();", "public void snapshot(PSSnapshotBuilder builder) throws DocumentException;", "public void takePreviewSnapshot(String file);", "GUISource(GUI source) {\n _source = source;\n }", "private ReplicaInfo createNewReplicaObjWithLink(ExtendedBlock block,\n FsDatasetImpl fsDataSetImpl) throws IOException {\n ReplicaInfo replicaInfo = fsDataSetImpl.getReplicaInfo(block);\n FsVolumeSpi destVolume = getDestinationVolume(block, fsDataSetImpl);\n return fsDataSetImpl.moveReplicaToVolumeOnSameMount(block, replicaInfo,\n destVolume.obtainReference());\n }", "public void addSnapshot(Vector<Observation<P>> snapshot)\n\t{\n\t\tVector<P> newSnapshot = new Vector<P>();\n\n\t\tfor (Observation<P> observation : snapshot)\n\t\t{\n\t\t\tnewSnapshot.add(this.clonePoint(observation.getRobotPosition()));\n\t\t}\n\n\t\tthis.snapshots.add(newSnapshot);\n\t}", "@Override\n\tpublic IDnaStrand getInstance(String source) {\n\t\treturn new LinkStrand(source);\n\t}", "@Override\n public void onSnapshotReady(Bitmap snapshot) {\n bitmap = snapshot;\n try {\n FileOutputStream out = new FileOutputStream(\"/mnt/sdcard/\"\n + \"MyActivity\"\n + \".png\");\n\n // above \"/mnt ..... png\" => is a storage path (where image will be stored) + name of image you can customize as per your Requirement\n\n bitmap.compress(Bitmap.CompressFormat.PNG, 90, out);\n myBitmap = bitmap;\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "@Override\n public void initialize(URL url, ResourceBundle rb) {\n \n createBookingTimeStart.localTimeProperty().set(LocalTime.of(0,0));\n createBookingTimeEnd.localTimeProperty().set(LocalTime.of(0,0));\n \n booking = new Booking();\n \n \n createBookingType.getItems().addAll(dbH.getBookingTypes(2).toArray(new String[dbH.getBookingTypes(2).size()]));\n \n createBookingMechanic.getItems().addAll(getMechanicNames(dbH.getAllMechanics())); \n \n }", "ReferenceLink createReferenceLink();", "public static PhotoDetailFragment newInstance(Uri uri){\n Bundle args = new Bundle();\n args.putParcelable(ARG_URI, uri);\n PhotoDetailFragment fragment = new PhotoDetailFragment();\n fragment.setArguments(args);\n return fragment;\n }", "private DataHandler createDataHandler(URL url) throws MalformedURLException {\n return new DataHandler(url);\n }", "public void setSnapshotId(String snapshotId) {\n this.snapshotId = snapshotId;\n }", "private void createCameraSource() {\n\n int facing = CameraSource.CAMERA_FACING_FRONT;\n\n // If there's no existing cameraSource, create one.\n if (cameraSource == null) {\n cameraSource = new CameraSource(this, graphicOverlay);\n }\n\n CameraSource.setFacing(facing);\n cameraSource.setMachineLearningFrameProcessor(\n new FaceDetectorProcessor(this, defaultOptions));\n }", "Object create(URL url) throws IOException, SAXException, ParserConfigurationException;", "public void loadAndPopulateViewer(final ActionLink viewerLink) throws Exception {\n final WindowViewer w = Platform.getWindowViewer();\n final FunctionCallbackWaiter waiter = new FunctionCallbackWaiter();\n\n w.createViewer(viewerLink, waiter.createCallback(VIEWER_CALLBACK_ID));\n load(waiter.createCallback(DOCUMENT_CALLBACK_ID));\n\n iFunctionCallback cb = new iFunctionCallback() {\n @Override\n public void finished(boolean canceled, Object returnValue) {\n try {\n ObjectHolder h = (ObjectHolder) returnValue;\n HashMap<Object, CallbackResult> resultsMap = (HashMap<Object, CallbackResult>) h.value;\n CallbackResult vr = resultsMap.get(VIEWER_CALLBACK_ID);\n CallbackResult dr = resultsMap.get(DOCUMENT_CALLBACK_ID);\n\n if (vr.resultIsError()) {\n Utils.handleError((Throwable) vr.getReturnValue());\n\n return;\n }\n\n if (dr.resultIsError()) {\n Utils.handleError((Throwable) dr.getReturnValue());\n\n return;\n }\n\n iContainer v = (iContainer) vr.getContent();\n\n populateViewer(v);\n\n String target = viewerLink.getTargetName();\n\n if (target == null) {\n target = iTarget.TARGET_WORKSPACE;\n }\n\n if (iTarget.TARGET_WORKSPACE.equals(target)) {\n Utils.pushWorkspaceViewer(v);\n } else {\n w.activateViewer(v, target);\n }\n } finally {\n w.hideWaitCursor();\n }\n }\n };\n\n w.showWaitCursor();\n waiter.startWaiting(cb);\n }", "public void setSnapshotIdentifier(String snapshotIdentifier) {\n this.snapshotIdentifier = snapshotIdentifier;\n }", "public void setSnapshotId(Integer snapshotId) {\r\n this.snapshotId = snapshotId;\r\n }", "public SampleSnapshotTaskInput(SampleSnapshotTaskInput source) {\n if (source.Definition != null) {\n this.Definition = new Long(source.Definition);\n }\n if (source.WatermarkSet != null) {\n this.WatermarkSet = new WatermarkInput[source.WatermarkSet.length];\n for (int i = 0; i < source.WatermarkSet.length; i++) {\n this.WatermarkSet[i] = new WatermarkInput(source.WatermarkSet[i]);\n }\n }\n }", "public PullSnapshotResp getSnapshot(PullSnapshotRequest request) throws IOException {\n // if the requester pulls the snapshots because the header of the group is removed, then the\n // member should no longer receive new data\n if (request.isRequireReadOnly()) {\n setReadOnly();\n }\n\n // Make sure local data is complete.\n if (character != NodeCharacter.LEADER\n && lastAppliedPartitionTableVersion.getVersion()\n != metaGroupMember.getPartitionTable().getLastMetaLogIndex()) {\n return null;\n }\n\n List<Integer> requiredSlots = request.getRequiredSlots();\n for (Integer requiredSlot : requiredSlots) {\n // wait if the data of the slot is in another node\n slotManager.waitSlot(requiredSlot);\n }\n if (logger.isDebugEnabled()) {\n logger.debug(\n \"{}: {} slots are requested, first:{}, last: {}\",\n name,\n requiredSlots.size(),\n requiredSlots.get(0),\n requiredSlots.get(requiredSlots.size() - 1));\n }\n\n // If the logs between [currCommitLogIndex, currLastLogIndex] are committed after the\n // snapshot is generated, they will be invisible to the new slot owner and thus lost forever\n long currLastLogIndex = logManager.getLastLogIndex();\n logger.info(\n \"{}: Waiting for logs to commit before snapshot, {}/{}\",\n name,\n logManager.getCommitLogIndex(),\n currLastLogIndex);\n while (logManager.getCommitLogIndex() < currLastLogIndex) {\n try {\n Thread.sleep(10);\n } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n logger.warn(\"{}: Unexpected interruption when waiting for logs to commit\", name, e);\n }\n }\n\n // this synchronized should work with the one in AppendEntry when a log is going to commit,\n // which may prevent the newly arrived data from being invisible to the new header.\n synchronized (logManager) {\n PullSnapshotResp resp = new PullSnapshotResp();\n Map<Integer, ByteBuffer> resultMap = new HashMap<>();\n ((PartitionedSnapshotLogManager) logManager)\n .takeSnapshotForSpecificSlots(requiredSlots, false);\n\n PartitionedSnapshot<Snapshot> allSnapshot = (PartitionedSnapshot) logManager.getSnapshot();\n for (int requiredSlot : requiredSlots) {\n Snapshot snapshot = allSnapshot.getSnapshot(requiredSlot);\n if (snapshot != null) {\n resultMap.put(requiredSlot, snapshot.serialize());\n }\n }\n resp.setSnapshotBytes(resultMap);\n logger.debug(\"{}: Sending {} snapshots to the requester\", name, resultMap.size());\n return resp;\n }\n }", "WithCreate withSku(SnapshotSku sku);", "@SubL(source = \"cycl/sbhl/sbhl-link-methods.lisp\", position = 12676) \n public static final SubLObject create_new_sbhl_link(SubLObject direction, SubLObject mt, SubLObject tv, SubLObject node, SubLObject module) {\n if ((module == UNPROVIDED)) {\n module = NIL;\n }\n if ((NIL != module)) {\n checkType(module, $sym4$SBHL_MODULE_P);\n }\n {\n SubLObject link = NIL;\n link = sbhl_links.create_sbhl_direction_link(direction, sbhl_links.create_sbhl_mt_links(mt, sbhl_links.create_sbhl_tv_links(tv, node)), module);\n return link;\n }\n }", "public ViewObject(ActivityInstance instance)\n {\n // Populate fields\n this.templateId = instance.getTemplate().getId();\n this.name = instance.getName();\n this.description = instance.getDescription();\n this.paramValues = instance.getParameterValues();\n }", "public Beacon createFromObject( Beacon b ) throws IllegalAccessException, InstantiationException {\r\n return createBeacon(b.getId(),b.getUuid(),b.getMajor(),b.getMinor(),b.getType(),b.getManufactorer(),b.getData(),b.getLastKnownDistance());\r\n }", "SourceBuilder createRepository();", "public LinkBuilder() {\n }", "public Links() {\n }", "protected synchronized URLLoader getURLLoader(String url, long startTime, long endTime) {\r\n if (currentLoader != null) return null;\r\n currentLoader = new URLLoader(url, startTime, endTime);\r\n return currentLoader;\r\n }", "CompletableFuture<SnapshotRestoreResponse> requestSnapshotChunk(\n MemberId server, SnapshotRestoreRequest request);", "public static LinkingFragment newInstance() {\n LinkingFragment fragment = new LinkingFragment();\n return fragment;\n }", "public CachedSource(Cache<V> cache, Source<V> source) {\n mCache = cache;\n mSource = source;\n }", "public static VideoSource startCamera(CameraConfig config) {\n System.out.println(\"Starting camera '\" + config.name + \"' on \" + config.path);\n CameraServer inst = CameraServer.getInstance();\n UsbCamera camera = new UsbCamera(config.name, config.path);\n MjpegServer server = inst.startAutomaticCapture(camera);\n\n Gson gson = new GsonBuilder().create();\n\n camera.setConfigJson(gson.toJson(config.config));\n camera.setConnectionStrategy(VideoSource.ConnectionStrategy.kKeepOpen);\n\n if (config.streamConfig != null) {\n server.setConfigJson(gson.toJson(config.streamConfig));\n }\n\n return camera;\n }", "private void createCameraSource() {\n if (cameraSource == null) {\n cameraSource = new CameraSource(this, fireFaceOverlay);\n cameraSource.setFacing(CameraSource.CAMERA_FACING_FRONT);\n }\n\n try {\n processor = new FaceDetectionProcessor();\n processor.setFaceDetectionResultListener(getFaceDetectionListener());\n processor.setCustomization(cameraScreenCustomization);\n cameraSource.setMachineLearningFrameProcessor(processor);\n } catch (Exception e) {\n Logger.e(TAG, \"Can not create image processor: \" + Log.getStackTraceString(e));\n }\n\n }", "@Override\n public void handleSnapshotStart(String dpSchemaName, PrimaryKey primaryKey, ConnectSchema\n sinkSchema) {\n }", "private void prepareClone(final MasterProcedureEnv env) throws IOException {\n final TableName tableName = getTableName();\n if (env.getMasterServices().getTableDescriptors().exists(tableName)) {\n throw new TableExistsException(tableName);\n }\n\n // check whether ttl has expired for this snapshot\n if (\n SnapshotDescriptionUtils.isExpiredSnapshot(snapshot.getTtl(), snapshot.getCreationTime(),\n EnvironmentEdgeManager.currentTime())\n ) {\n throw new SnapshotTTLExpiredException(ProtobufUtil.createSnapshotDesc(snapshot));\n }\n\n validateSFT();\n }", "public void setSnapshotId(java.lang.String snapshotId) {\r\n this.snapshotId = snapshotId;\r\n }", "@Provides\n @Singleton\n FeedFetcher providesFeedFetcher(OkHttpClient okHttpClient, DataStorage dataStorage, EventBus eventBus) {\n FeedFetcher feedFetcher = new FeedFetcher(okHttpClient, dataStorage, eventBus);\n return feedFetcher;\n }", "ReferenceData add(ReferenceData instance) throws DataException;", "private RSS(Properties props) throws ParameterError {\n super(new String[0], null);\n Logger static_logger = Logging.getLogger(RSS.class);\n if (static_logger.isDebugEnabled()) {\n static_logger.debug(\"QRS Property=\" + props);\n }\n this.props = props;\n instance = this;\n this.sitesurl_string = props.getProperty(\"qrs.SitesURL\");\n data_feeds = new Hashtable<String, DataFeed>();\n\n String raw_feed_data = props.getProperty(\"qrs.DataFeeds\");\n if (raw_feed_data != null) {\n StringTokenizer tokenizer = new StringTokenizer(raw_feed_data, \" \");\n while (tokenizer.hasMoreTokens()) {\n String feed_name = tokenizer.nextToken().trim();\n makeFeed(feed_name, props);\n }\n }\n\n String sysstat_interval_str = props.getProperty(\"qrs.sysstat\");\n if (sysstat_interval_str != null) {\n int sysstat_interval = Integer.parseInt(sysstat_interval_str);\n TimerQueueingDataFeed feed = new TimerQueueingDataFeed();\n registerFeed(feed, \"DirectEntry\");\n DirectSysStatSupplier supplier = new DirectSysStatSupplier(null, feed);\n supplier.schedule(sysstat_interval);\n }\n\n String gui_id = props.getProperty(GUI_PROPERTY);\n if (gui_id != null) {\n new org.cougaar.qos.qrs.gui.MainWindow(gui_id);\n }\n\n }", "public GitFileSite(GitCommit aGC) { _cmt = aGC; setURL(createURL()); }", "private History() {}", "public abstract void installSnapshot(byte[] state);" ]
[ "0.6022321", "0.5725303", "0.5364308", "0.51819026", "0.50457394", "0.4968858", "0.49288094", "0.4925532", "0.4860215", "0.4778555", "0.4775774", "0.475067", "0.47100314", "0.4694196", "0.46812594", "0.4608459", "0.4597371", "0.45966113", "0.45805866", "0.45741922", "0.45535436", "0.45528316", "0.45394668", "0.45309177", "0.44943544", "0.44814578", "0.44708005", "0.4468365", "0.44656497", "0.44433123", "0.4430876", "0.44241896", "0.4409908", "0.44098923", "0.44032043", "0.43979543", "0.4387666", "0.4373329", "0.43692154", "0.4346631", "0.431416", "0.4308015", "0.42981172", "0.4287061", "0.42587146", "0.4258347", "0.42566466", "0.42516008", "0.42314705", "0.42238277", "0.42211178", "0.42163247", "0.42135966", "0.42085373", "0.42042676", "0.41921332", "0.41849038", "0.41829672", "0.41807115", "0.41794658", "0.41779852", "0.41725475", "0.41685367", "0.41622013", "0.41588685", "0.41561508", "0.4153209", "0.41364372", "0.41321668", "0.41300067", "0.4130002", "0.41261205", "0.41240066", "0.41134894", "0.41098306", "0.41093367", "0.41065192", "0.41052565", "0.41048923", "0.4104667", "0.40986502", "0.40903306", "0.40886182", "0.4078508", "0.4076918", "0.40750697", "0.40721852", "0.40681127", "0.40653932", "0.40627465", "0.40605244", "0.40599132", "0.40591148", "0.40571412", "0.40561926", "0.40443388", "0.40424904", "0.40384588", "0.4033825", "0.40329787" ]
0.527498
3
Create a Java program and name it Double Comparison. Declare 2 double values and if value of first variable is higher then the second, print "Double value __ is larger than __ ." Otherwise print...
public static void main(String[] args) { double num1=18.6, num2=11.5; if(num1>num2) { System.out.println("Double value "+num1+" is larger than "+num2); }else { System.out.println("Double value "+num1+" is smaller than "+num2); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n\t\n\tScanner scan=new Scanner(System.in);\n\tSystem.out.println(\"2 sayi giriniz\");\n\tdouble sayi1 = scan.nextDouble();\n\tdouble sayi2 = scan.nextDouble();\n\t\n\tdouble sonuc= sayi1 > sayi2 ? sayi1 :sayi2;\n\tSystem.out.println(sonuc);\n\t\n\tscan.close();\n}", "public static void main(String[] args) {\n\t\t\n\t\tSystem.out.println(\"lütfen değer giriniz\");\n\t\tScanner scanner = new Scanner(System.in);\n\t\tdouble a = scanner.nextDouble();\n\t\t\n\t\tSystem.out.println(\"lütfen değer giriniz\");\n\t\tScanner scanner1 = new Scanner(System.in);\n\t\tdouble b = scanner1.nextDouble();\n\t\t\n\t\tif(a>b) {\n\t\t\tSystem.out.println(\"Biggest value is \"+a); }\n\t\telse {\n\t\t\tSystem.out.println(\"Biggest value is \"+b);}\n\n\t}", "public static void main(String[] args) {\n\tScanner scan= new Scanner(System.in);\n\tSystem.out.println(\"iki sayi giriniz\");\n\tdouble a= scan.nextDouble();\n\tdouble b= scan.nextDouble();\n\t\tif(a>b){\n\t\t\tSystem.out.println(\"ilk sayi buyuk\");\n\t\t}\n\t\t\n\t\tif (a<b) {\n\t\tSystem.out.println(\"ikincı sayi buyuk\");\n\t}\n\n\tscan.close();\n\t\n\t\n\t\n\t\n\t\n\t\n\t}", "public static void main(String[] args) {\n double a=100;\n double b=200;\n double c=400.5;\n boolean aMin=a<b && a<c; //if a is less than both b and c,then is the minimum\n boolean bMin=b<a && b<c;//if b is less then booth a and c, then b is the minimum\n boolean cMin=c<a && c<b;//if\n if(aMin){\n System.out.println(a+\"is the minimum number\");}\n if(bMin){\n System.out.println(b+\"is the minimum number\");}\n if(cMin){\n System.out.println(c+\"is the minimum number\");}\n\n }", "public static void main(String[] args) {\n \r\n int x;\r\n int y;\r\n x= 40;\r\n y= 60;\r\n if(x<y) {\r\n\t System.out.println(\"y is bigger\");\t\r\n\t\r\n\t} \r\n\t}", "public boolean greaterThan(NumberP other)\n {\n \treturn OperationsCompareTo.CompareDouble(this, other) == 1;\n }", "public static int compare(double obj1,double obj2){\n\t\tif(obj1 == obj2) { return 0; }\n\t\telse if(obj1 > obj2){\n\t\t\treturn 1;\n\t\t} else{ return -1; }\n\t}", "static double getMax(double a, double b) {\n\t\treturn (a > b) ? a : b;\n\t}", "public static void main(String [] args){\n double a= 5+(4*5)/5;\n double b= (6*4%2)+15;\n System.out.println(\"a = \"+a);\n System.out.println(\"b = \"+b); \n \n //Ejemplo de operadores relacionales.\n boolean resultado1= a > b;\n boolean resultado2= a !=b; \n System.out.println(\"R1= \"+resultado1);\n System.out.println(\"R2= \"+resultado2); \n }", "public static boolean almost_less(double a, double b) {\n if (almost_equals(a, b)) {\n return false;\n }\n return a < b;\n }", "public static boolean almost_greater(double a, double b) {\n if (almost_equals(a,b)) {\n return false;\n }\n return a > b;\n }", "public static void main(String[] args) {\n int num1 = 45;\n int num2 = 55;\n\n\n //CODE HERE\n if(num1==num2){System.out.println(num1+ \" and \" + num2 + \" are equal\");} else if (num1>num2){System.out.println (num1+ \" is greater than \" + num2);}else{System.out.println(num2 + \"is greater than \" + num1);}\n\n\n\n\n }", "public boolean Mayor(Object obj1, Object obj2){\n return (Double.parseDouble(obj1.toString()) > Double.parseDouble(obj2.toString()));\n }", "public static int compare(double v1, double v2) {\n return ( v1 - v2 ) > 0 ? 1 : ( ( v1 - v2 ) == 0 ? 0 : -1 );\n }", "public static void main(String[] args) {\n int x=20;\r\n \r\n int y=30;\r\n if (x<\r\n y) {\r\n System.out.println(x);\r\n System.out.println(y);\r\n System.out.println(\"hi\");\r\n\t}\r\n else {\r\n \t System.out.println(\"xequaly\");\r\n }\r\n \r\n\t}", "public Comparison compare(double left, double right) {\n return checkResult(Double.compare(left, right));\n }", "public static void main(String[] args) {\n\t\t\n\t\t//compare 2 numbers --> 3 possible conditions\n\t\tdouble a=2;\n\t\tdouble b=21;\n\t\t\n\t\tif(a>b) {\n\t\t\tSystem.out.println(\"Double value\" +a+ \" is larger than \"+b);\n\t\t}else if (a<b){\n\t\t\tSystem.out.println(\"Double value \"+b+ \" is larger than \"+a);\n\t\t}else { // else if(a==b)\n\t\t\tSystem.out.println(a+\" is equal to \"+b);\n\t\t}\n\t\t\n\t\tSystem.out.println(\"------------------\");\n\t\t\n\t\t\n\t\t//2. baced on the day number define a day\n\t\t\n\t\tint day=0;\n\t\t\n\t\tif(day==1) {\n\t\t\tSystem.out.println(\"Taday is Monday\");\n\t\t}else if(day==2) {\n\t\t\tSystem.out.println(\"Today is Tuesday\");\n\t\t}else if(day==3) {\n\t\t\tSystem.out.println(\"Today is Wednesday\");\n\t\t}else if(day==4) {\n\t\t\tSystem.out.println(\"Today is Thursday\");\n\t\t}else if(day==5) {\n\t\t\tSystem.out.println(\"Today is Friday\");\n\t\t}else if(day==6) {\n\t\t\tSystem.out.println(\"Today is Saturday\");\n\t\t}else if(day==7){\n\t\t\tSystem.out.println(\"Today is Sunday\");\n\t\t}else {\n\t\t\tSystem.out.println(\"This date is invalid day\");\n\t\t}\n\t\t// to format code: cmd +shift+f ---> mac users\n\t\t\n\t\t\n\t\t\n\t}", "@Override\r\n\t\tpublic int compare(Double arg0, Double arg1) {\n\t\t\treturn arg0.compareTo(arg1);\r\n\t\t}", "public static void main(String[] args)\n {\n Scanner input = new Scanner(System.in);\n\n int number1; //first number to compare\n int number2; // second number to compare\n \n System.out.print(\"Enter first integer: \"); //prompt\n number1 = input.nextInt(); //read first number from command line\n\n System.out.print(\"Enter second integer: \"); //prompt\n number2 = input.nextInt(); //read first number from command line\n\n if (number1 > number2)\n System.out.printf(\"%d is larger\\n\", number1);\n\n if (number1 < number2)\n System.out.printf(\"%d is larger\\n\", number2);\n \n if (number2 == number1)\n System.out.printf(\"These numbers are eqqual\\n\");\n \n }", "public static void greaterThan(double arg, double min, String argName) {\r\n if (arg <= min) {\r\n throw new IllegalArgumentException(\"Argument \\\"\" + argName + \"\\\" must be greater than \" + min);\r\n }\r\n }", "@Override\r\n\t\tpublic int compare(Double o1, Double o2) {\n\t\t\treturn o2.compareTo(o1);\r\n\t\t}", "public void testGreaterThanElement() {\n\t // fail(\"testGreaterThanElement\");\n \tCircuit circuit = new Circuit();\n \tDouble x1 = 0.5;\n \tAnd and = (And) circuit.getFactory().getGate(Gate.AND);\n\t\tNot not = (Not) circuit.getFactory().getGate(Gate.NOT);\n\t\tGte gte1 = (Gte) circuit.getFactory().getGate(Gate.GTE);\n \tand.setLeftInput(x1);\n \tnot.setInput(x1);\n \tnot.eval();\n \tand.setRightInput(not.getOutput());\n\t\tand.eval();\n \tgte1.setLeftInput(and.getOutput());\n\t\tgte1.setRightInput(x1);\n \tassertEquals( new Double(0.0), gte1.eval());\n }", "@Override\n\t\t\tpublic int compare(Entry<String, Double> o1,\n\t\t\t\t\tEntry<String, Double> o2) {\n\t\t\t\tif(o1.getValue()>o2.getValue()){\n\t\t\t\t\treturn -1;\n\t\t\t\t}else if(o1.getValue()<o2.getValue()){\n\t\t\t\t\treturn 1;\n\t\t\t\t}else{\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t}", "public static void main(String[] args) {\n\t\t// \"If-else\" Condition Practice\n\t\t\n\t\tint x = 20;\n\t\tint y = 20;\n\t\t\n\t\tif(x < y){\n\t\t\tSystem.out.println(\"X is less than Y\");\n\t\t}\n\t\t\n\t\tif(x == y){\n\t\t\tSystem.out.println(\"X is equal to Y\");\n\t\t} \n\t\t\n\t\tif(x > y){\n\t\t\tSystem.out.println(\"X is greater than Y\");\n\t\t}\n\t\t\n\t\tint a = 10;\n\t\tint b = 10;\n\t\t\n\t\tif(a < b){\n\t\t\tSystem.out.println(\"A is less than B\");\n\t\t}else if(a == b){\n\t\t\tSystem.out.println(\"A is equal to B\");\n\t\t}else if (a > b){\n\t\t\tSystem.out.println(\"A is equal to B\");\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tdouble a,b,c;\n\t\tScanner sc = new Scanner(System.in);\n\t\tSystem.out.print(\"Enter any Three numbers\\n\");\n\t\ta = sc.nextDouble();\n\t\tb = sc.nextDouble();\n\t\tc = sc.nextDouble();\n\t\tif(a>b)\n\t\t\t{\n\t\t\tif(a>c)\n\t\t\t\tSystem.out.print(\"Greatest Number is \"+a);\n\t\t\telse\n\t\t\t\tSystem.out.print(\"Greatest Number is \"+c);\n\t\t\t}\n\t\telse if(b>c)\n\t\t\tSystem.out.print(\"Greatest Number is \"+b);\n\t\telse\n\t\t\tSystem.out.print(\"Greatest Number is \"+c);\n\t\t\n\t\tsc.close();\n\t\t\n\n\t}", "public static void main(String[] args) {\n\t\tint num1 = 6, num2 = 4;\n\t\tif (num1 == num2) {\n\t\t\tSystem.out.println(num1 + \" and \" + num2 + \" are equal\");\n\t\t} else if (num2 < num1) {\n\t\t\tSystem.out.println(num1 + \" is greater than \" + num2);\n\t\t} else if (num2 > num1) {\n\t\t\tSystem.out.println(num2 + \" is greater than \" + num1);\n\t\t}\n\n\t}", "public static void main(String[] args) {\n int a = 1;\n int b = 2;\n if (a < b){\n System.out.println(\"a is less than b\");\n }\n\n // write your code below\n int red = 10;\n int blue = 20;\n\n if (red > blue) {\n System.out.println(\"red is greater than blue\");\n }\n else {\n System.out.println(\"false\");\n }\n\n if (blue >= red) {\n System.out.println(\"blue is greater than or equal to red\");\n }\n\n if (red < blue) {\n System.out.println(\"red is less than blue\");\n }\n\n if (red <= blue) {\n System.out.println(\"red is less than or equal to blue\");\n }\n\n if (red == blue) {\n System.out.println(\"red equals blue\");\n }\n else {\n System.out.println(\"false\");\n }\n\n\n }", "public boolean lessThan(NumberP other)\n {\n \treturn OperationsCompareTo.CompareDouble(this, other) == -1;\n }", "public static void main(String[] args) {\n double a=100;\n double b=200;\n double c=300;\nboolean aIsMedium = (a>b && a<c) || (a>c && a<b);\nboolean bIsMedium = (b<c && b>a) || (b>c && b<a);\nboolean cIsMedium = (c>a && c<b) || (c>b && c<a);\n\n double medium=0;\n\n if(aIsMedium){\n //System.out.println(a);\n medium= a;\n }\n if (bIsMedium){\n // System.out.println(b);\n medium= b;\n }\n if (cIsMedium){\n //System.out.println(c);\n medium=c;\n }\n System.out.println(medium+ \" is medium number\");\n }", "public static void main(String[] args) {\n\t\tdouble[] list1 = {2.4,3.7,4.8,6.7};\n\t\tSystem.out.println(isSorted(list1));\n\t}", "public void testComparisons() {\n\tfinal double small = Math.pow(2.0, -42);\n\n\t// Input: a, b\n\tdouble[][] input = new double[][] { new double[] { 1, 1 },\n\t\tnew double[] { 1, 2 }, new double[] { 1, 1 - small / 10 },\n\t\tnew double[] { 1, 1 + small / 10 },\n\n\t\tnew double[] { 0, 1 }, new double[] { 0, 0 },\n\t\tnew double[] { 0, -1 }, new double[] { 0, small / 100 },\n\t\tnew double[] { 2100000001.0001, 2100000001.0003 }, };\n\n\t// Output: less, equals\n\tboolean[][] output = new boolean[][] { new boolean[] { false, true },\n\t\tnew boolean[] { true, false }, new boolean[] { false, true },\n\t\tnew boolean[] { false, true },\n\n\t\tnew boolean[] { true, false }, new boolean[] { false, true },\n\t\tnew boolean[] { false, false }, new boolean[] { false, true },\n\t\tnew boolean[] { false, true }, };\n\n\tfor (int i = 0; i < input.length; ++i) {\n\t boolean l = StandardFloatingPointComparator.getDouble().less(\n\t\t input[i][0], input[i][1]);\n\t boolean e = StandardFloatingPointComparator.getDouble().equals(\n\t\t input[i][0], input[i][1]);\n\n\t boolean ne = StandardFloatingPointComparator.getDouble().notEquals(\n\t\t input[i][0], input[i][1]);\n\t boolean le = StandardFloatingPointComparator.getDouble()\n\t\t .lessOrEquals(input[i][0], input[i][1]);\n\t boolean g = StandardFloatingPointComparator.getDouble().greater(\n\t\t input[i][0], input[i][1]);\n\t boolean ge = StandardFloatingPointComparator.getDouble()\n\t\t .greaterOrEquals(input[i][0], input[i][1]);\n\n\t boolean less = output[i][0];\n\t boolean equals = output[i][1];\n\n\t boolean notEquals = !equals;\n\t boolean lessOrEquals = less || equals;\n\t boolean greater = !lessOrEquals;\n\t boolean greaterOrEquals = !less;\n\n\t assertFalse(l != less);\n\t assertFalse(g != greater);\n\t assertFalse(e != equals);\n\t assertFalse(ne != notEquals);\n\t assertFalse(le != lessOrEquals);\n\t assertFalse(ge != greaterOrEquals);\n\t}\n }", "public static void greaterThanOrEqual(double arg, double min, String argName) {\r\n if (arg < min) {\r\n throw new IllegalArgumentException(\"Argument \\\"\" + argName + \"\\\" must be greater than or equal to \" + min);\r\n }\r\n }", "public static void main(String[] args) {\n\t\t\n\t\tint result = BoundedType.compare(3.14, 4.15);\n\t\tSystem.out.println(result);\n\t\t\n\t\tArrayList<String> list;\n\t}", "public static void main ( String[] args )\n\t{\n\t\tbyte aByte = 5;\n\t\tshort aShort = -9025;\n\t\tint anInt = 50000;\n\t\tlong aLong = 8092309723987492342L;\n\t\tfloat aFloat = 5.0F;\n\t\tdouble aDouble = 3.1415926535897;\n\t\tchar char1 = 'A', char2 = 'B', char3 = 'a';\n\t\t\n\t\t// form logical expressions\n\t\tboolean longFloatComparison = ( aLong == aFloat ),\n\t\t\tbyteIntComparison = ( aByte <= anInt ),\n\t\t\tdoubleShortComparison = ( aDouble != aShort ),\n\t\t\tcharComparison1 = ( char1 == char3 ),\n\t\t\tcharComparison2 = ( char3 < char2 );\n\t\t\n\t\tboolean expression = 15 % 4 * 7 + 15 >= 1\n\t\t\t\t || 7 < 12 || ! (-8 != 7 && 7 <= 10 && 5 > 7);\n\t\t\n\t\t// print results\n\t\tSystem.out.println( \"Compare long & float: \" + longFloatComparison );\n\t\tSystem.out.println( \"Compare byte & int: \" + byteIntComparison );\n\t\tSystem.out.println( \"Compare double & short: \" + doubleShortComparison );\n\t\tSystem.out.println( \"Compare char1 & char3: \" + charComparison1 );\n\t\tSystem.out.println( \"Compare char3 & char2: \" + charComparison2 );\n\t\tSystem.out.println( \"Value of long expression: \" + expression );\n\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tint x = 13;\n\t\tint y = 15;\n\t\tint z = 12;\n\t\t\n/*\t\tif(x>y && x>z) {\n\t\t}\n\t\t\n\t\tif (y>x && y>z) {\n\t\t}\n\t\t\n\t\tif(z>x && z>y) {\n\t\t}*/\n\t\t\n\t\t\n\t\tif(x>y && x>z) {\n\t\t\tSystem.out.println(\"X is greater\");\n\t\t}\n\t\telse if(y>z) {\n\t\t\tSystem.out.println(\"Y is greater\");\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"Z is greater\");\n\t\t}\n\t\t\n\t\t\n\t\t\n\n\t}", "public static void main(String[] args) {\n\t\tint num=1234;\r\n\t\tint num2=56;\r\n\t\tint bigger;\r\n\t\tif(num>num2){\r\n\t\t\tbigger=num;\r\n\t\t\tSystem.out.println(\"num \"+num+\" is bigger\");\r\n\t\t}\r\n\t\telse{\r\n\t\t\tbigger=num2;\r\n\t\t\tSystem.out.println(\"num2 \"+num2+\" is bigger\");\r\n\t\t}\r\n\t\t//created a variable called bigger\r\n\t\t//which is going to be the bigger of the two numbers\r\n\t\t\r\n\tbigger=num > num2 ? num : num2;\r\n\tSystem.out.println(\"bigger is \"+bigger);\r\n\t\r\n\tint age=16;\r\n\tString adm;\r\n\tadm=age>18 ? \"addmitted\":\" No admission\";\r\n\t\r\n\tSystem.out.println(adm);\r\n\t\r\n\tboolean sex;//true is female, falses is male\r\n\tdouble price;//price of a haircut\r\n\tsex=false;//if male price is 10, otherwise price is 15.50\r\n\tprice=sex==false ? 10.00:15.50;\r\n\tSystem.out.println(\"price is \"+price);\r\n\r\n\t}", "public static void main(String[] args) {\nString score = JOptionPane.showInputDialog(\"What did you get on the test\");\ndouble test = Double.parseDouble(score);\nif(test>= 80) {\n\tJOptionPane.showMessageDialog(null, \"you must've studied really hard to get a \" + test);\n}\nif(test<= 79.99999999999999999999999999999999999999999999999999999999999) {\n\tJOptionPane.showMessageDialog(null, \"Maybe you should try harder next time becuase you only got a \" + test);\n}\n\t\t\n\t\t\n\t}", "private double min(double a, double b) {\n if (a > b) {\n return b;\n }\n return a;\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tint a=Integer.parseInt(args[0]);\r\n\t\tint b=Integer.parseInt(args[1]);\r\n\t\tSystem.out.println(larger(a,b));\r\n\t}", "public static void main(String[] args) {\n\t Scanner numara=new Scanner(System.in);\n\t System.out.println(\"Please enter your first number\");\n\t int num1=numara.nextInt();\n\t \n\t System.out.println(\"please enter your second number\");\n int num2=numara.nextInt();\n \n if(num1>num2) {System.out.println(num1+\" larger than \"+num2);}\n else if(num1==num2) {System.out.println(num1+\" equel \"+num2);}\n else {System.out.println(num1+\" smaller than \"+num2);}\n \n \n\t \n\t \n}", "public static int comp( double a, double b ) {\n return equal( a, b, REL_TOL, ABS_TOL ) ? 0 : (a < b ? -1 : 1 );\n }", "public boolean greaterOrEqualThan(NumberP other)\n {\n \treturn OperationsCompareTo.CompareDouble(this, other) >= 0;\n }", "public static boolean doubleCompare(double accuracy, double d1, double d2)\n {\n if (Math.abs(d1 - d2) < accuracy) { return true; }\n return false;\n }", "public boolean a(double paramDouble)\r\n/* 28: */ {\r\n/* 29: 44 */ double d1 = aQ().a() * 4.0D;\r\n/* 30: 45 */ d1 *= 64.0D;\r\n/* 31: 46 */ return paramDouble < d1 * d1;\r\n/* 32: */ }", "public static RuntimeValue greaterThan(RuntimeValue left, RuntimeValue right) throws RuntimeException {\n if (isDiscreteIntSamples(left, right)) {\n return new RuntimeValue(\n RuntimeValue.Type.DISCRETE_BOOL_SAMPLE,\n Operators.greaterThanIntegers(left.getDiscreteIntSample(), right.getDiscreteIntSample())\n );\n }\n\n if (isDiscreteFloatSamples(left, right)) {\n return new RuntimeValue(\n RuntimeValue.Type.DISCRETE_BOOL_SAMPLE,\n Operators.greaterThanFloats(left.getDiscreteFloatSample(), right.getDiscreteFloatSample())\n );\n }\n\n if (isDiscreteFloatSample(right) && isContinuousSample(left)) {\n return new RuntimeValue(\n RuntimeValue.Type.DISCRETE_BOOL_SAMPLE,\n Operators.not(Operators.lessThanContinuous(left.getContinuousSample(), right.getDiscreteFloatSample()))\n );\n }\n\n if (isDiscreteFloatSample(left) && isContinuousSample(right)) {\n return new RuntimeValue(\n RuntimeValue.Type.DISCRETE_BOOL_SAMPLE,\n Operators.lessThanContinuous(right.getContinuousSample(), left.getDiscreteFloatSample())\n );\n }\n\n throw new RuntimeException(\"Comparing incompatible types\");\n }", "@SuppressWarnings(\"resource\")\n\tpublic static void main(String[] args) {\n\t\tScanner geshu=new Scanner(System.in);\n\t\tScanner zhengshu=new Scanner(System.in);\n\t\tint T=geshu.nextInt();\n\t\tif(T>10)\n\t\t\treturn;\n\t\tdouble A,B,C;\n\t\tfor(int i=1;i<=T;i++)\n\t\t{\n\t\t\tA=zhengshu.nextDouble();\n\t\t\tB=zhengshu.nextDouble();\n\t\t C=zhengshu.nextDouble();\n\t\t if(A+B>C)\n\t\t \tSystem.out.println(\"Case #\"+i+\": true\");\n\t\t else\n\t\t System.out.println(\"Case #\"+i+\": false\");\n\t\t }\n\t\tgeshu.close();\n\t\tzhengshu.close();\n\t}", "public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n scan.useLocale(Locale.ENGLISH);\n System.out.print(\"Enter A: \");\n double A = scan.nextDouble();\n System.out.print(\"Enter B: \");\n double B = scan.nextDouble();\n System.out.print(\"Enter x: \");\n double x = scan.nextDouble();\n System.out.print(\"Enter y: \");\n double y = scan.nextDouble();\n System.out.print(\"Enter z: \");\n double z = scan.nextDouble();\n\n double minSize = Math.min(A,B);\n double maxSize = Math.max(A,B);\n double minBrick = Math.min(Math.min(x,y),z);\n double midBrick = Math.min(Math.max(x,y),z);\n\n if (A*B>=minBrick*midBrick) {\n if (minSize>=minBrick || maxSize>=midBrick) {\n System.out.println(\"True\");\n }\n } else {\n System.out.println(\"False\");\n }\n }", "public static void main(String[] args) {\n\t\tdouble a = 3;\r\n\t\tdouble b = -3.8;\r\n\t\tdouble c = 3.2;\r\n\t\tif ( (a + b) > 0 || (a + c) > 0 || (b + c) > 0) {\r\n\t\t\tSystem.out.println(\"Сумма двух чисел положительна\");\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"Все суммы неположительны\");\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t\tScanner data=new Scanner(System.in);\n\t\t\n\t\t\n\t\tSystem.out.println(\"Please enter first number\");\n\t\t\n\t\tint num1= data.nextInt();\n\t\t\n\t\tSystem.out.println(\"Please enter a second number\");\n\t\tint num2= data.nextInt();\n\t\t\n\t\t\n\t\tif(num1>num2) {\n\t\t\tSystem.out.println(num1+ \" is larger than \"+ num2);\n\t\t}else if (num1<num2) {\n\t\t\tSystem.out.println(num1+ \" is smaller than \"+ num2);\n\t\t}else {\n\t\t\tSystem.out.println(num1+\" is equal to \"+num2);\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\n\t}", "public double compare(double x, double y) {\n\t\tif (Math.abs(x - y) > _threshold)\n\t\t\treturn 0;\n\t\telse\n\t\t\treturn 1;\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tScanner sc = new Scanner (System.in);\n\t\t\n\t\tboolean flag = false;\n\t\t\n\t\tdouble number1 = sc.nextDouble();\n\t\tdouble number2 = sc.nextDouble();\n\t\t\n\t\tdouble change = number1 - number2;\n\t\t\n\t\twhile(!flag) {\n\t\t\t\n\t\t\tif(change>=50){\n\t\t\t\tchange = change-50;\n\t\t\t\tSystem.out.print(\"50, \");\n\t\t\t} else if (change>=20) {\n\t\t\t\tchange = change-20;\n\t\t\t\tSystem.out.print(\"20, \");\n\t\t\t} else if (change>=10) {\n\t\t\t\tchange = change-10;\n\t\t\t\tSystem.out.print(\"10, \");\n\t\t\t} else if (change>=5) {\n\t\t\t\tchange = change-5;\n\t\t\t\tSystem.out.print(\"5, \");\n\t\t\t} else if (change>=2) {\n\t\t\t\tchange = change-2;\n\t\t\t\tSystem.out.print(\"2, \");\n\t\t\t} else if (change>=1) {\n\t\t\t\tchange = change-1;\n\t\t\t\tSystem.out.print(\"1, \");\n\t\t\t} else if (change>=0.5) {\n\t\t\t\tchange = change-0.5;\n\t\t\t\tSystem.out.print(\"0.5, \");\n\t\t\t} else if (change>=0.2) {\n\t\t\t\tchange = change-0.2;\n\t\t\t\tSystem.out.print(\"0.2, \");\n\t\t\t} else if (change>=0.1) {\n\t\t\t\tchange = change-0.1;\n\t\t\t\tSystem.out.print(\"0.1, \");\n\t\t\t}\n\t\t\t\n\t\t\tif(change==0){\n\t\t\t\tflag = true;\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) {\nint b=1;\nif (b<10)\n{\n\tSystem.out.println(\"Value is less than 10\");\n}\n\n\telse if(b<20) \n\t\t{\n\t\tSystem.out.println(\"Value is less tha 20\");\n\t}\n\telse\n\t{\n\t\tSystem.out.println(\"Value is greater than 20\");\n\t\t\n\t}\n}", "@Override\n\t\t\tpublic int compare(Entry<Integer, Double> o1,\n\t\t\t\t\tEntry<Integer, Double> o2) {\n\t\t\t\tDouble v2 = o2.getValue();\n\t\t\t\tDouble v1 = o1.getValue();\n\t\t\t\treturn v2.compareTo(v1);\n\t\t\t}", "@Override\r\n\tpublic int compareTo(Double another) {\n\t\treturn 0;\r\n\t}", "@Override\n\t\t\tpublic int compare(Entry<String, Double> o1,\n\t\t\t\t\tEntry<String, Double> o2) {\n\t\t\t\tDouble v2 = o2.getValue();\n\t\t\t\tDouble v1 = o1.getValue();\n\t\t\t\treturn v2.compareTo(v1);\n\t\t\t}", "public static void main(String[] args) {\n\t\t\n\t\tboolean directTrue = true;\n\t\tboolean directFalse = false;\n\n\t\t\n\t\tSystem.out.println(\"true = \"+directTrue+\" false = \"+directFalse);\n\t\t\n\t\t\n\t\t// Values changed dynamically\n\t\t// As per condition\n\t\t\n\t\tboolean dynamicallyTrue = ( 2 < 5);\n\t\tboolean dynamicallyFalse = ( 2 > 5);\n\n\t\tSystem.out.println(\"( 2 < 5 ) = \"+dynamicallyTrue+\" ( 2 > 5 ) = \"+dynamicallyFalse);\n\t\t\n\t}", "public static void main(String[] args) {\n int i = 140;\n int j = 150;\n int k = 200;\n\n if (i>j){\n System.out.println(\"I is greater then J\");\n }\n else {\n System.out.println(\"I is Less then J \");\n }\n\n System.out.println(\"------------------------//Example of multiple conditions...---------------------------------------\");\n if (k>j){\n System.out.println(\"K is greater then J\");\n }\n else if (j==k){\n System.out.println(\"I is Equal to K\");\n }\n else {\n System.out.println(\"I is Less then to K \");\n }\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(20>10&&20<30);\n\t\tint a=10;\n\t\tint b=20;\n\t\tint max=a>b?a:b;\n\t\tSystem.out.println(max);\n\n\n\n\n\t}", "public static void main(String[] args) {\n\r\n\t\tdouble numero1, numero2;\r\n\r\n\t\tnumero1 = Double.parseDouble(JOptionPane.showInputDialog(\"Introduce el primer numero\"));\r\n\r\n\t\tnumero2 = Double.parseDouble(JOptionPane.showInputDialog(\"Introduce el segundo numero\"));\r\n\r\n\t\tif (numero1 < numero2) {\r\n\t\t\tJOptionPane.showMessageDialog(null, numero2 + \" es mayor que \" + numero1);\r\n\t\t} else if (numero1 > numero2) {\r\n\t\t\tJOptionPane.showMessageDialog(null, numero1 + \" es mayor que \" + numero2);\r\n\t\t} else {\r\n\t\t\tJOptionPane.showMessageDialog(null, \"Los numero son iguales\");\r\n\t\t}\r\n\t\t\r\n\t\r\n\r\n\t}", "public boolean greaterP(Stella_Object y) {\n { Ratio x = this;\n\n { Ratio yRatio = ((Ratio)(x.coerceTo(y)));\n\n return ((x.numerator * yRatio.denominator) > (yRatio.numerator * x.denominator));\n }\n }\n }", "private double min(double value1 , double value2){\n double minValue = 0.0;\n if(value1 <= value2){\n minValue = value1;\n }else{\n minValue = value2;\n }\n\n return minValue;\n }", "public static double max(double a, double b) {\t\n\t\treturn ((a>b)?a:b);\n\t}", "@Override\r\n\t\t\tpublic int compare(Entry<Integer, Double> o1, Entry<Integer, Double> o2) {\n\t\t\t\tif ((o1.getValue()-o2.getValue())>0) {\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn 1;\r\n\t\t\t\t} else if ((o1.getValue()-o2.getValue())<0) {\r\n\t\t\t\t\treturn -1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn 0;\r\n\t\t\t\t}\r\n\t\t\t}", "public static void main(String[] args) {\n\t\tint x, y;\n\t\tx=175; y=225;\n\t\tSystem.out.println(\" X = 175 \\n Y = 225\");\n\t\tSystem.out.println(\"\\n Addition : X + Y = \"+(x+y));\n\t\tSystem.out.println(\"\\n Subtraction : X - Y = \"+(x-y));\n\t\tSystem.out.println(\"\\n Multiplication : X * Y = \"+(x*y));\n\t\tSystem.out.println(\"\\n Division : X / Y = \"+(x/y));\n\t\tif (x>y) {\n\t\t\tSystem.out.println(\"\\n\"+x+\" is greater than \"+y+\" : True\");\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"\\n\"+x+\" is greater than \"+y+\" : False\");\n\t\t}\n\t\t\n\n\t}", "public static void main(String[] args) {\n\n\t\tdouble poluprecnik = 1.25;\n\t\t\n\t\tdouble V = (4 / 3) * poluprecnik * poluprecnik * poluprecnik * Math.PI;\n\t\t\n\t\tdouble tolerancija = 6.014 * 0.05 / 100;\n\t\t\n\t\tif(V <= 6.014 - tolerancija && V <= 6.014 + tolerancija){\n\t\t\tSystem.out.println(\"Lopta je dobrog kvaliteta\");\n\t\t} else {\n\t\t\tSystem.out.println(\"Lopta nije dobrog kvaliteta\");\t\t\t\n\t\t}\t\t\n\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tint firstValue = 24, secondValue = 32, thirdValue = 11;\n\t\tint mostLargestValue, secondLargeValue, minimumValue;\n\t\tint temporary; // 임시로 사용할 저장 공간\n\n//\t\tSystem.out.print(\"첫번째 수 = \");\n//\t\tfirstValue = in.nextInt();\n//\n//\t\tSystem.out.print(\"두번째 수 = \");\n//\t\tsecondValue = in.nextInt();\n//\n//\t\tSystem.out.print(\"세번째 수 = \");\n//\t\tthirdValue = in.nextInt();\n \n\t\t// and\n//\t\tif (secondValue >= firstValue && secondValue >= thirdValue) {\n//\t\t\ttemporary = firstValue;\n//\t\t\tfirstValue = secondValue;\n//\t\t\tsecondValue = temporary;\n//\t\t} else if (thirdValue >= firstValue && thirdValue >= secondValue) {\n//\t\t\ttemporary = firstValue;\n//\t\t\tfirstValue = thirdValue;\n//\t\t\tthirdValue = temporary;\n//\t\t}\n//\n//\t\tif (thirdValue >= secondValue) {\n//\t\t\ttemporary = secondValue;\n//\t\t\tsecondValue = thirdValue;\n//\t\t\tthirdValue = temporary;\n//\t\t}\n\t\t\n\t\tif (secondValue >= firstValue && secondValue >= thirdValue) {\n\t\t\tmostLargestValue = secondValue;\n\t\t} \n\n\t\tSystem.out.println();\n\t\tSystem.out.println(firstValue + \" >= \" + secondValue + \" >= \" + thirdValue);\n\n//\t\tin.close();\n\t}", "public static void main(String[] args) {\n double kilometers = 1.609334 * 100.00;\n int highScore = 50;\n\n if (highScore == 50) {\n System.out.println(\"This ia an expression\");\n }\n }", "public static void main(String[] args) {\n\t\tint a = 80;\n\t\t\n\t\tif (a > 100)\n\t\t\tSystem.out.println(\"a > 100\");\n\t\telse if (a > 50)\n\t\t\tSystem.out.println(\"50 < a < 100\");\n\t\telse\n\t\t\tSystem.out.println(\"50 > a\");\n\t}", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint a = sc.nextInt();\n\t\tint b = sc.nextInt();\n\t\tif(a>b)\n\t\t\tSystem.out.println(a+\" is greater number\");\n\t\telse\n\t\t\tSystem.out.println(b+\" id greater number\");\n\n\t}", "public int compare(Key<Double, Double> a, Key<Double, Double> b){\n\t\t\tif (a.getFirst() < b.getFirst()){\n\t\t\t\treturn -1;\n\t\t\t} else if (a.getFirst() == b.getFirst()){\n\t\t\t\treturn 0;\n\t\t\t} else {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}", "@Override\r\n\t\t\tpublic int compare(SimpleEntry<Integer, Double> arg0, SimpleEntry<Integer, Double> arg1)\r\n\t\t\t{\r\n\t\t\t\treturn arg1.getValue().compareTo(arg0.getValue());\r\n\t\t\t}", "public static void main(String[] args) \r\n {\n Scanner input = new Scanner(System.in);\r\n \r\n //Declare the anonymous variables as a double variable data type\r\n double n1, n2, n3;\r\n \r\n //Allow user input first random number of any size\r\n System.out.println(\"Enter first number: \");\r\n n1 = input.nextDouble();\r\n \r\n //Allow user input second random number of any size\r\n System.out.println(\"Enter second number: \");\r\n n2 = input.nextDouble();\r\n \r\n //Allow user input third random number of any size\r\n System.out.println(\"Enter third number: \");\r\n n3 = input.nextDouble();\r\n \r\n /*Computation that compares the values of the variables inputed by the\r\n user\r\n */\r\n \r\n if (n1 > n2 & n1 > n3)\r\n System.out.println(n1 + \" is the largest number.\");\r\n \r\n else if (n2 > n1 & n2 > n3)\r\n System.out.println(n2 + \" is the largest number.\");\r\n \r\n else if (n3 > n2 & n3 > n1)\r\n System.out.println(n3 + \" is the largest number.\");\r\n \r\n else System.out.println(\"The numbers are not distinct.\");\r\n \r\n //Details of the Author of the program are displayed below output of the program\r\n System.out.println(\"Name: BECKLEY Moses Oluwadamilola\");\r\n System.out.println(\"Email: [email protected]\");\r\n System.out.println(\"Phone Number: 07030325335\");\r\n }", "public static Object gt(Object val1, Object val2) {\n\t\tif (isFloat(val1) && isFloat(val2)) {\n\t\t\treturn ((BigDecimal) val1).compareTo((BigDecimal) val2) > 0;\n\t\t} else if (isInt(val1) && isInt(val2)) {\n\t\t\treturn ((BigInteger) val1).compareTo((BigInteger) val2) > 0;\n\t\t}\n\t\tthrow new OrccRuntimeException(\"type mismatch in gt\");\n\t}", "@Override\r\n public int compare(Pair<Integer, Double> o1, Pair<Integer, Double> o2) {\r\n return o2.getValue().compareTo(o1.getValue());\r\n }", "public static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tdouble result=1.0;\n\t\tfor (int i = 0; i < 3; i++) {\n\t\t\tdouble w=scanner.nextDouble();\n\t\t\tdouble t=scanner.nextDouble();\n\t\t\tdouble l=scanner.nextDouble();\n\t\t\tif (w>t&&w>l) {\n\t\t\t\tSystem.out.print(\"W \");\n\t\t\t\tresult*=w;\n\t\t\t}else if (t>w&&t>l) {\n\t\t\t\tSystem.out.print(\"T \");\n\t\t\t\tresult*=t;\n\t\t\t}else {\n\t\t\t\tSystem.out.print(\"L \");\n\t\t\t\tresult*=l;\n\t\t\t}\n\t\t}\n\t\tscanner.close();\n\t\tSystem.out.println(String.format(\"%.2f\", 2*(result*0.65-1)));\n\t}", "public boolean lessOrEqualThan(NumberP other)\n {\n \treturn OperationsCompareTo.CompareDouble(this, other) <= 0;\n }", "static int compar(int d1,int m1, int y1,int d2,int m2, int y2 )\n{\n if(y1>y2)\n return 1;\n if(y1<y2)\n return -1;\n \n if(m1>m2)\n return 1;\n if(m1<m2)\n return -1;\n \n if(d1>d2)\n return 1;\n if(d1<d2)\n return -1;\n \n \n \n return 0;\n \n \n}", "public static void main(String[] args) {\n\t\tHashSet<Double> hash = new HashSet<>();\n\t\thash.add(1.5);\n\t\thash.add(8.25);\n\t\thash.add(-7.32);\n\t\thash.add(13.3);\n\t\thash.add(-12.45);\n\t\thash.add(48.5);\n\t\thash.add(0.01);\n\t\tdouble max = 0;\n\t\tdouble min = 0;\n\t\t\n\t\tfor (Double double1 : hash) {\n\t\t\tSystem.out.println(double1);\n\t\t\tif (double1 > max) {\n\t\t\t\tmax = double1;\n\t\t\t}\n\t\t\tif (double1 < min) {\n\t\t\t\tmin = double1;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Max : \" + max);\n\t\tSystem.out.println(\"Min : \" + min);\n\t\thash.remove(min);\n\t\tfor (Double double1 : hash)\n\t\t\tSystem.out.println(double1);\n\t}", "public boolean almostEqual(double a, double b);", "public static void main(String[] args) {\n\t\tint a, b, c;\n\t\tScanner S1 = new Scanner(System.in);\n\t\tSystem.out.println(\"Enter the value of A:\");\n\t\ta = S1.nextInt();\n\t\tSystem.out.println(\"Enter the value of B:\");\n\t\tb = S1.nextInt();\n\t\tSystem.out.println(\"Enter the value of c:\");\n\t\tc = S1.nextInt();\n\t\tif (a > b && a > c) {\n\t\t\tSystem.out.println(\"A is greater.\");\n\t\t} else if (b > a && b > c) {\n\t\t\tSystem.out.println(\"B is greater:\");\n\t\t} else {\n\t\t\tSystem.out.println(\"C is greater.\");\n\t\t}\n\n\t}", "public static void main(String[] args) \r\n\t{\n\t\tint a=3,b=5,c=2;\r\n\t\tif((a>b)&&(a>c))\r\n\t\t{\r\n\t\t\tSystem.out.println(\"A is big\");\r\n\t\t}\r\n\t\telse if(b>c)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"B is big\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tSystem.out.println(\"C is big\");\r\n\t\t}\r\n\t\t\r\n\t\tint d=3,e=5,f=8;\r\n\t\tif(d>e||d>f)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"D is big\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tSystem.out.println(\"E or F is Big\");\r\n\t\t}\r\n\t\t\r\n\t\tint g=0;\r\n\t\tif(g!=0)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"True\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tSystem.out.println(\"False\");\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\t\tint a;\n\t\tint b;\n\t\tint c;\n\t\ta=10;\n\t\tb=20;\n\t\tc=a+b;\n\t\tSystem.out.println(\"Sum of a and b is \"+ c);\n\t\tSystem.out.println(1212);\n\t\tSystem.out.println(\"hello\");\n\t\tSystem.out.println(\"same line\");\n\t\t\n\t\tSystem.out.println(a>b);\n\t\t\n\t\tif(a>b)\n\t\t{\n\t\t\tSystem.out.println(\"a is greater than b\");\n\t\t}\n\t\telse if(a==b)\n\t\t{\n\t\t\tSystem.out.println(\"a and b are same\");\n\n\t\t}else\n\t\t{\n\t\t\tSystem.out.println(\"a is not greater than b\");\n\t\t}\n\t}", "public static boolean almost_greater(double a, double b, long maxUlps) {\n if (almost_equals(a, b, maxUlps)) {\n return false;\n }\n return a > b;\n }", "public static void main(String[] args) {\n\n\t\tScanner scan;\n\t\tdouble num1;\n\t\tdouble num2;\n\t\tdouble num3;\n\t\tdouble largest=0.0;\n\t\tscan=new Scanner(System.in);\n\t\tSystem.out.println(\"Please enter three decimal numbers\");\n\t\tnum1=scan.nextDouble();\n\t\tnum2=scan.nextDouble();\n\t\tnum3=scan.nextDouble();\n\t\tif (num1>num2 && num1>num3) {\n\t\t\tlargest=num1;\n\t\t}else if (num2>num1 && num2>num3) {\n\t\t\tlargest=num2;\n\t\t}else if (num3>num1 && num3>num2) {\n\t\t\tlargest=num3;\n\t\t}\n\t\tSystem.out.println(\"Largest number is\" +largest);\n\t}", "@Override\n\t\t\tpublic int compare(Entry<String, Double> o1, Entry<String, Double> o2) {\n\t\t\t\treturn o1.getValue().compareTo(o2.getValue());\n\t\t\t}", "public static void main(String[] args) {\n\t\tint n,n1,n2;\r\n\t\tScanner ja=new Scanner(System.in);\r\n\t\tn=ja.nextInt();\r\n\t\tn1=ja.nextInt();\r\n\t\tn2=ja.nextInt();\r\n\t\tif(n1>n2||n1>n2){\r\n\t\t\tSystem.out.println(n1);\r\n\t\t}\r\n\t\telse if(n1>n||n1>n2){\r\n\t\t\tSystem.out.println(n2);\r\n\t\t}\r\n\t\telse{\r\n\t\t\tSystem.out.println(n);\r\n\t\t}\r\n\r\n\t}", "boolean hasDouble();", "public static void main(String[] args) {\n int a =0;\n System.out.println((a!=0)?\"true\":\"false\");\n Double d = null;\n System.out.println((d instanceof Double)?true:false);\n\n\n }", "public static boolean assertGreaterThan(java.lang.String message, double expected, double actual) \r\n\t\t{\r\n\t\t\tString screenshotLink = captureScreenshotIfEnabled();\r\n\t\t\tmessage = message + \": assert that \" + actual + \" is greater than \" + expected;\r\n\t\t\tif(actual < expected)\r\n\t\t\t{\r\n\t\t\t\tLog.error(\"FAIL: \" + message + screenshotLink);\r\n\t\t\t} else {\r\n\t\t\t\tif(!failureOnlyLogging)\r\n\t\t\t\t{\r\n\t\t\t\t\tLog.info(\"PASS: \" + message + screenshotLink);\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t\torg.junit.Assert.assertTrue(message, actual > expected);\r\n\t\t\treturn actual > expected;\t\t\t\r\n\t\t}", "public static void main(String[] args) {\nString input=JOptionPane.showInputDialog(\"What is your test score? (0-100%)\");\ndouble score=Double.parseDouble(input);\nif (score>90) {\n\tJOptionPane.showMessageDialog(null, \"Wow! You must have studied really hard for that test!\");\n}\nif (score<70) {\n\tJOptionPane.showMessageDialog(null, \"Nice try... Study harder next time!\");\n}\nif (score<90&&score>70) {\n\tJOptionPane.showMessageDialog(null, \"Good job! ... but you can do better!\");\n}\n}", "public static void main(String[] args) {\n\n\t\tScanner all = new Scanner(System.in);\n\t\tSystem.out.println(\"Please enter the first number\");\n\t\tint first = all.nextInt();\n\t\tSystem.out.println(first);\n\t\tSystem.out.println(\"Please enter the second number\");\n\t\tdouble second = all.nextDouble();\n\t\tSystem.out.println(second);\n\t\tSystem.out.println(first + second + \" This is a number of total\");\n\t\tif (first > second) {\n\t\t\tSystem.out.println(\"that is greater number\");\n\t\t} else {\n\t\t\tSystem.out.println(\"that is smaller number\");\n\t\t}\n\n\t}", "public static void main(String[] args) {\n\t\t\tint x=10;\r\n\t\t\tif(x>42) {\r\n\t\t\t\tSystem.out.println(\"UTP\");\r\n\t\t\t\t\t }\r\n\t\t\telse\r\n\t\t\t {\r\n\t\t\t\tSystem.out.println(\"Error\");\r\n\t\t\t }\r\n\t\t\t\r\n\t\t\tint edad=40;\r\n\t\t\tif(edad>16)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"joven\");\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"adulto\");\r\n\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t }", "public static void main(String[] args) {\n\t\t\n\t\tScanner scan = new Scanner(System.in);\n\t\tSystem.out.println(\"Lutfen Kenar Uzunluklarini Giriniz\");\n\t\t\n\t\tdouble kenar1=scan.nextDouble();\n\t\tdouble kenar2=scan.nextDouble();\n\t\t\n\t\tif (kenar1==kenar2) {\n\t\t\tSystem.out.println(\"Kare\");\n\t\t} else {\n\t\t\tSystem.out.println(\"Dikdortgen\");\n\t\t}\nscan.close();\n\t\t\t\t\n\t}", "public static void main(String[] args) {\n\t\tint num = 19;\r\n\t\t\r\n\t\tif(num!=0) {\r\n\t\t\tif(num>18) {\r\n\t\t\t\tSystem.out.println(\"age is greater than 18\");\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tSystem.out.println(\"age is 18 or less\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "public static void main (String[] args) {\n\n Integer a=7,b=4,c=10,d=18;\n\n if (a > b) {\n if(a > c){\n if (a >d){\n System.out.println(a+ \" is biggest\");\n }\n }\n }\n\n if (b > c) {\n if(b > d){\n if (b >a){\n System.out.println(b+ \" is biggest\");\n }\n }\n }\n\n if (c > b) {\n if(c > a){\n if (c >d){\n System.out.println(c+\" is biggest\");\n }\n }\n }\n\n if (d > b) {\n if(d > c){\n if (d >a){\n System.out.println(d+\" is biggest\");\n }\n }\n }\n }", "private double selectDouble(String prompt, double min, double max) {\n System.out.println(\"\\n\" + prompt);\n double value = input.nextDouble();\n if (value > min && value < max) {\n return value;\n } else {\n return selectDouble(prompt, min, max);\n }\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(\"***************Float****************\");\n\t\tSystem.out.println(\"Float default value is :\"+f);\n\t\tSystem.out.println(\"Float Max Value is :\"+fMax);\n\t\tSystem.out.println(\"Float Min Value is :\"+fMin);\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"***************Double****************\");\n\t\tSystem.out.println(\"Double default value is :\"+d);\n\t\tSystem.out.println(\"Double Max Value is :\"+dMax);\n\t\tSystem.out.println(\"Double Min Value is :\"+dMin);\n\t}", "public boolean HasGreaterUtility(DijkstraDistance d2, Method source)\n\t{\n\t\tdouble thisQuality = this.quality - source.getPosition().distance(this.position);\n\t\tdouble d2Quality = d2.quality - source.getPosition().distance(d2.position);\n\t\tboolean result = thisQuality>d2Quality;\n\t\tif (result)\n\t\t{\n\t\t\tMain.Message(debugFlag, \"[DijkstraDistance] Utility \" + source.label + \"-\" + nodeName + \" (\" + thisQuality + \")>\"\n\t\t\t\t\t+ source.label + \"-\" + d2.nodeName + \"(\" + d2Quality + \")\");\n\t\t}\n\t\treturn result;\n\t}", "public static double min(double a, double b) {\t\n\t\treturn ((a<b)?a:b);\n\t}", "public static void main(String[] args) {\n\t\tint[] nums1 = {10,2,8};\n\t\tint[] nums2 = {10,3,2,1,8,-1,12,15};\n\t\tnextGreaterElement(nums1, nums2);\n\t}" ]
[ "0.67858917", "0.6729956", "0.6417047", "0.6371006", "0.6357657", "0.6353547", "0.63514817", "0.63384354", "0.6316506", "0.6240018", "0.62322533", "0.62153697", "0.61912876", "0.6147311", "0.6144911", "0.614079", "0.60867435", "0.60823536", "0.60761225", "0.60561335", "0.60521454", "0.6017349", "0.6015546", "0.60040146", "0.6002973", "0.5995784", "0.5995646", "0.59905934", "0.59772724", "0.5967967", "0.59632933", "0.59586936", "0.59582037", "0.59562016", "0.5950672", "0.5948565", "0.59289145", "0.5927176", "0.59147686", "0.5885166", "0.5847275", "0.5845056", "0.58416855", "0.582254", "0.5797995", "0.5790295", "0.5788339", "0.5782401", "0.5777818", "0.5769309", "0.5759695", "0.5748307", "0.5724583", "0.5719736", "0.5717351", "0.5709667", "0.57095826", "0.57089865", "0.5703879", "0.5697945", "0.5697646", "0.56938463", "0.567989", "0.56704986", "0.5664212", "0.56603026", "0.56511927", "0.56418407", "0.563753", "0.56189775", "0.56184644", "0.56096673", "0.5597637", "0.55958855", "0.55857116", "0.55827224", "0.5579948", "0.556912", "0.55670786", "0.5563962", "0.5560486", "0.55543613", "0.55536544", "0.55460584", "0.5522305", "0.5522269", "0.55203825", "0.55107886", "0.5510139", "0.5502656", "0.54905933", "0.5489464", "0.5487281", "0.54752094", "0.5469402", "0.5469315", "0.54680794", "0.546767", "0.5464638", "0.54606295" ]
0.822975
0
In here i've created a method named doSomething as mentioned in question
public void doSomething(){ // now in here calling doMore(); doMore(); System.out.println("-----------"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void doSomething() {\n \n }", "public void doSomething() {\n\t}", "@Override\n\tpublic void doIt() {\n\t\t\n\t}", "@Override\n\tpublic void doSomething() {\n\t\tSystem.out.println(\"业务操作\");\n\t}", "protected void doSomethingElse()\r\n {\r\n \r\n }", "abstract public T doSomething();", "@Override\r\n\tpublic String doSome() {\n\t\tSystem.out.println(\"执行dosome()方法\");\r\n\t\treturn \"abcde\";\r\n\t}", "@Override\n\tpublic void dosomething() {\n\t\t\n\t}", "@Override\n\tpublic void doYouWantTo() {\n\n\t}", "@Override\n\tpublic void some() {\n\t\t\n\t}", "boolean doSomething() {\n\t\treturn true;\n\t}", "public void smell() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void doDomething() {\r\n\t\t\tSystem.out.println(\"I am here\");\r\n\t\t\t\r\n\t\t}", "public abstract void Do();", "public void doService() {\n }", "public void doSomething(){\n return;\n }", "public void woke(){\n\n //TODO\n\n }", "@Override\r\n\tpublic void doing() {\n\t\tSystem.out.println(\"doing\");\r\n\t}", "public abstract void doSomething() throws Exception;", "@Override\n protected void doAct() {\n }", "private void doSomething(Object object) {\n\n }", "public abstract void doWork();", "@Override\r\n\tpublic void doTask() {\n\t}", "@Override\n\tpublic void dosomething2() {\n\t\t\n\t}", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "public void method(){}", "@Override\r\n\tpublic void doSomething(int i, double x) {\n\t\tdidItWork(1, 1.1, \"a\");\r\n\t}", "protected abstract void work();", "public void doAction(){}", "public void logic(){\r\n\r\n\t}", "@Override\r\n\tprotected void doF1() {\n\t\t\r\n\t}", "abstract void doJob();", "private void someUtilityMethod() {\n }", "private void someUtilityMethod() {\n }", "public void doSomething(Object str){\n System.out.println(\"Base impl:\"+str);\n }", "public void work() {\n\t}", "public void work() {\n\t}", "@Override\n public void doExeception(Map<String, Object> args)\n {\n \n }", "@Override\n public void doExeception(Map<String, Object> args)\n {\n \n }", "@Override\r\n\tpublic String doOther() {\n\t\tSystem.out.println(\"执行doOther()方法\");\r\n\t\treturn \"fghij\";\r\n\t}", "public void callmetoo(){\r\n\tSystem.out.println(\"This is a concrete method\");\r\n\t}", "@Override\r\n\tpublic String doSome() {\n\t\treturn super.doSome().toUpperCase();\r\n\t}", "@Override\n\tpublic void execute() {\n\t\trecevier.doSomething();\n\t}", "@Override\r\n\tpublic void smthAbstr() {\n\t\t\r\n\t}", "@Override\n\tpublic void myMethod() {\n\t\t\n\t}", "@Override\r\n\tpublic void method() {\n\t\r\n\t}", "public void andThisIsAMethodName(){}", "public void process() {\n\n }", "public void working()\n {\n \n \n }", "public void doStuff() {\n\t\twrite(\"Hello World\");\n\t}", "@Override\n\tpublic void call() {\n\t\t\n\t}", "public abstract void call();", "public void doGeneralThings() {\n logger.debug(\"Overrided or implememted method - doGeneralThings!\");\n }", "@Override\n\tpublic void myWork() {\n\t\t\n\t}", "public void process() {\n\t}", "@Override\n\t\tprotected Void doInBackground(String... arg0) {\n\t\t\tdoSomething();\n\t\t\treturn null;\n\t\t}", "abstract void method();", "protected void execute() {}", "abstract void doTaskOnRun();", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public void hello(){\n\t\t\r\n \t\r\n\t\t\r\n\t}", "protected void execute() {\n\t\t\n\t}", "private void Nice(){\n }", "abstract protected void doService(HttpServletRequest request,\r\n\t\t\t\t\t\t\t\t\t HttpServletResponse response) throws ServletException, IOException,ApplicationException;", "void work();", "public void processThought(Thought thought);", "public void callit();", "private void test() {\n\n\t}", "public void makeCall() {\n\n }", "protected void execute()\n\t{\n\t}", "public abstract void doCommand(String command);", "public void doSomething(String input) throws MyBusinessException {\n // code ...\n }", "protected abstract void executeHelper();", "public abstract void doInvoke(InvocationContext ic) throws Exception;", "public void doNothing(){\n\t}", "protected void additionalProcessing() {\n\t}", "public void method_201() {}", "public void think() {\n\t\t\n\t}", "static void perform_call(String passed){\n\t\tint type = type_of_call(passed);\n\t\tswitch(type){\n\t\tcase 1:\n\t\t\tcall_without_condition(passed);\n\t\t\tbreak;\n\t\t}\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "protected void execute() {\n\n\t}", "@Override\r\n\tpublic void doWork() {\n\t\tSystem.out.println(\"Barking Bow Bow\");\r\n\t}", "@Override\n\tpublic void doWork() {\n\t\tSystem.out.println(\"写作业\");\n\t}", "protected void execute()\n {\n }", "protected void execute() {\r\n }", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "protected void execute() {\n\t}", "private Integer doSomething(Integer input) {\n System.out.println(\"The thread name is \"+Thread.currentThread().getName()+\" for handed data is \"+input);\n return input;\n }", "protected void internalRun() {\n work();\n }", "@Override\n\tprotected void logic() {\n\n\t}", "public default void doStuff() {\r\n System.out.println(\"Hello world\");\r\n }", "public void furyo ()\t{\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }" ]
[ "0.79993516", "0.7827778", "0.73071975", "0.7277868", "0.7209273", "0.7125634", "0.7011162", "0.686575", "0.6760912", "0.6703463", "0.6673637", "0.6564401", "0.65586233", "0.65177494", "0.648622", "0.6467106", "0.6353585", "0.6245127", "0.6239128", "0.61965674", "0.61863124", "0.6163145", "0.61504626", "0.61447406", "0.6144462", "0.60861295", "0.6082672", "0.6074691", "0.60731536", "0.6057688", "0.5964134", "0.5961535", "0.59538496", "0.59538496", "0.5936078", "0.59259933", "0.59259933", "0.59144783", "0.59144783", "0.58942664", "0.5875094", "0.58695376", "0.5857057", "0.5834646", "0.58324873", "0.58247894", "0.581416", "0.57600254", "0.57497096", "0.572416", "0.5719638", "0.57086384", "0.5699259", "0.5693052", "0.56889635", "0.56797475", "0.567956", "0.5665358", "0.5664468", "0.5660314", "0.5660314", "0.5658555", "0.5646042", "0.56385756", "0.5635062", "0.5627433", "0.56258374", "0.5623871", "0.56167954", "0.5616414", "0.5611099", "0.559379", "0.5586246", "0.55814296", "0.55765086", "0.55652493", "0.5562508", "0.55595094", "0.5556761", "0.55549586", "0.55508995", "0.5544183", "0.55416465", "0.55345607", "0.5529913", "0.5524621", "0.5521382", "0.5515288", "0.55007327", "0.5488335", "0.5484636", "0.54826814", "0.54824007", "0.5482284", "0.5482284", "0.5482284", "0.5482284", "0.5482284", "0.5482284", "0.5482284" ]
0.6925622
7
In here i've created a another method void doMore() as mentioned in question
public void doMore(){ /** * ArithmeticExceptiont this exception occurs when an integer is * divided by zero. * * */ int number=500/0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void doSomething(){\n\t\t// now in here calling doMore();\n\t\tdoMore();\n\t\tSystem.out.println(\"-----------\");\n\t\t\n\t\t\t\n\t\t}", "@Override\n public void onLoadMore() {\n }", "@Override\r\n\tpublic void onLoadMore() {\n\t}", "@Override\r\n\tpublic void onLoadMore() {\n\r\n\t}", "@Override\n public void onMoreLoadding() {\n\n }", "@Override\n public void onLoadMore() {\n\n }", "protected void additionalProcessing() {\n\t}", "public abstract void onLoadMore(int skipStart);", "boolean isMore();", "@Override\r\n\tprotected void doNext() {\n\t\t\r\n\t}", "@Override\n\tpublic void onMyLoadMore() {\n\t\t\n\t}", "@Override\n\tpublic void onMyLoadMore() {\n\t\t\n\t}", "@Override\n\tpublic boolean hasMore() {\n\t\treturn false;\n\t}", "boolean hasMore();", "@Override\r\n\tprotected void doLast() {\n\t\t\r\n\t}", "public static void doMore ( RunData data)\n\t{\n\t\tSessionState state = ((JetspeedRunData)data).getPortletSessionState (((JetspeedRunData)data).getJs_peid ());\n\n\t\tParameterParser params = data.getParameters ();\n\n\t\tMap current_stack_frame = pushOnStack(state);\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\tstate.setAttribute(STATE_LIST_SELECTIONS, new TreeSet());\n\n\t\t// the hosted item ID\n\t\tString id = NULL_STRING;\n\n\t\t// the collection id\n\t\tString collectionId = NULL_STRING;\n\n\t\ttry\n\t\t{\n\t\t\tid = params.getString (\"id\");\n\t\t\tif (id!=null)\n\t\t\t{\n\t\t\t\t// set the collection/resource id for more context\n\t\t\t\tcurrent_stack_frame.put(STATE_MORE_ID, id);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// get collection/resource id from the state object\n\t\t\t\tid =(String) current_stack_frame.get(STATE_MORE_ID);\n\t\t\t}\n\n\t\t\tcollectionId = params.getString (\"collectionId\");\n\t\t\tcurrent_stack_frame.put(STATE_MORE_COLLECTION_ID, collectionId);\n\n\t\t\tif (collectionId.equals ((String) state.getAttribute(STATE_HOME_COLLECTION_ID)))\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t// this is a test to see if the collection exists. If not, it is created.\n\t\t\t\t\tContentCollection collection = ContentHostingService.getCollection (collectionId);\n\t\t\t\t}\n\t\t\t\tcatch (IdUnusedException e )\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// default copyright\n\t\t\t\t\t\tString mycopyright = (String) state.getAttribute (STATE_MY_COPYRIGHT);\n\n\t\t\t\t\t\tResourcePropertiesEdit resourceProperties = ContentHostingService.newResourceProperties ();\n\t\t\t\t\t\tString homeCollectionId = (String) state.getAttribute (STATE_HOME_COLLECTION_ID);\n\t\t\t\t\t\tresourceProperties.addProperty (ResourceProperties.PROP_DISPLAY_NAME, ContentHostingService.getProperties (homeCollectionId).getPropertyFormatted (ResourceProperties.PROP_DISPLAY_NAME));\n\n\t\t\t\t\t\tContentCollection collection = ContentHostingService.addCollection (homeCollectionId, resourceProperties);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (IdUsedException ee)\n\t\t\t\t\t{\n\t\t\t\t\t\taddAlert(state, rb.getString(\"idused\"));\n\t\t\t\t\t}\n\t\t\t\t\tcatch (IdUnusedException ee)\n\t\t\t\t\t{\n\t\t\t\t\t\taddAlert(state,RESOURCE_NOT_EXIST_STRING);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (IdInvalidException ee)\n\t\t\t\t\t{\n\t\t\t\t\t\taddAlert(state, rb.getString(\"title\") + \" \" + ee.getMessage ());\n\t\t\t\t\t}\n\t\t\t\t\tcatch (PermissionException ee)\n\t\t\t\t\t{\n\t\t\t\t\t\taddAlert(state, rb.getString(\"permisex\"));\n\t\t\t\t\t}\n\t\t\t\t\tcatch (InconsistentException ee)\n\t\t\t\t\t{\n\t\t\t\t\t\taddAlert(state, RESOURCE_INVALID_TITLE_STRING);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (TypeException e )\n\t\t\t\t{\n\t\t\t\t\taddAlert(state, rb.getString(\"typeex\"));\n\t\t\t\t}\n\t\t\t\tcatch (PermissionException e )\n\t\t\t\t{\n\t\t\t\t\taddAlert(state, rb.getString(\"permisex\"));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch (NullPointerException eE)\n\t\t{\n\t\t\taddAlert(state,\" \" + rb.getString(\"nullex\") + \" \" + id + \". \");\n\t\t}\n\t\t\n\t\tEditItem item = getEditItem(id, collectionId, data);\n\t\t\n\t\t\n\n\t\t// is there no error?\n\t\tif (state.getAttribute(STATE_MESSAGE) == null)\n\t\t{\n\t\t\t// go to the more state\n\t\t\tstate.setAttribute(STATE_MODE, MODE_MORE);\n\n\t\t}\t// if-else\n\n\t}", "@Override\n\t\tpublic void onLoadMore() {\n\t\t\tpageIndex++;\n\t\t\tloadInfo(pageIndex, 1);\n\t\t\tif (DzqcStu.isDebug) {\n\t\t\t\tLog.i(\"pageIndex------\", pageIndex+\"\");\n\t\t\t}\n\t\t}", "@Override\n public void run() {\n loadingMore=true;\n //load data from url\n ArrayList<Recipe> recipe = Utils.fetchListOfRecipeData(stringUrl+current_page);\n ++current_page;\n recipesList.addAll(recipe);\n }", "protected void addmore() \n\t{\t\n\t\tcall();\n\t\tstrwadd=wadds.getText().toString();\n\t\tstrcompadd=comadd.getText().toString();\n\t\tstrpadd=epah.getText().toString();\n\t\tstrnname=nn.getText().toString();\n\t\tstrbirth=bir.getText().toString();\n\t\tstrani=aniv.getText().toString();\n\t\tstrorgcw=eorgwc.getText().toString();\n\t\tstrorgco=eorgoc.getText().toString();\n\t\tstrorgpw=eorgwp.getText().toString();\n\t\tstrorgpo=eorgop.getText().toString();\n\t\tstrpaw=epaw.getText().toString();\n\t\tstrpao=epao.getText().toString();\n\t\tif(strwadd==null)\n\t\t{\n\t\t\tstrwadd=\"\";\n\t\t}\n\t\tif(strcompadd==null)\n\t\t{\n\t\t\tstrcompadd=\"\";\n\t\t}\n\t\tif(strnname==null)\n\t\t{\n\t\t\tstrnname=\"\";\n\t\t}\n\t\tif(strpadd==null)\n\t\t{\n\t\t\tstrpadd=\"\";\n\t\t}\n\t\tif(strpaw==null)\n\t\t{\n\t\t\tstrpaw=\"\";\n\t\t}\n\t\tif(strani==null)\n\t\t{\n\t\t\tstrani=\"\";\n\t\t}\n\t\tif(strbirth==null)\n\t\t{\n\t\t\tstrbirth=\"\";\n\t\t}\n\t\tif(strorgcw==null)\n\t\t{\n\t\t\tstrorgcw=\"\";\n\t\t}\n\t\tif(strorgco==null)\n\t\t{\n\t\t\tstrorgco=\"\";\n\t\t}\n\t\tif(strorgpo==null)\n\t\t{\n\t\t\tstrorgpo=\"\";\n\t\t}\n\t\tif(strpao==null)\n\t\t{\n\t\t\tstrpao=\"\";\t\n\t\t}\n\t\t//Inserts more info of contact to database \n\t\tdata.InsertMore(id,strwadd,strorgcw,strorgco,strorgpw,strorgpo,strorgcust,strcompadd, strnname, strpadd,strpaw,strpao,strpacust, strbirth, strani);\n\t\tToast.makeText(AddContact.this, \"Added Successfully\",Toast.LENGTH_SHORT).show();\n\t\tCursor c5=data.getMoreInfoData();\n\t\twhile(c5.moveToNext())\n\t\t{\n\t\t\tint a=c5.getInt(0);\n\t\t\tString c1=c5.getString(1);\n\t\t\tString d=c5.getString(2);\n\t\t\tString e=c5.getString(3);\n\t\t\tString e1=c5.getString(4);\n\t\t\tString e2=c5.getString(5);\n\t\t\tString e3=c5.getString(6);\n\t\t\tString e4=c5.getString(7);\n\t\t\tSystem.out.println(\"Id....\"+a);\n\t\t\tSystem.out.println(\"wadd....\"+c1);\n\t\t\tSystem.out.println(\"Comp....\"+d);\n\t\t\tSystem.out.println(\"Com Add....\"+e);\n\t\t\tSystem.out.println(\"Job....\"+e1);\n\t\t\tSystem.out.println(\"Nick name....\"+e2);\n\t\t\tSystem.out.println(\"Bday....\"+e3);\n\t\t\tSystem.out.println(\"Ani....\"+e4);\n\t\t}\n c5.close();\n\t\t\n\t}", "@Override\n\tpublic void onLoadMore() {\n\t\tpage++;\n\t\texecutorService.submit(new Runnable() {\n\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\ttry {\n\t\t\t\t\tgetResultByKeyword(page);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "public void readMore10(View view) {\n String readMore10 = \"Founder: Amanda Gicharu\" + \"\\nWebsite: http://www.techrepublicafrica.com/\";\n displayMessage10(readMore10);\n }", "@Override\n\tpublic void onLoadMore() {\n\t\tLog.d(\"load\", \"\");\n\t\tcurrentPage++;\n\t\tmodel.getPostsByType(userId, currentPage, method, postListiner);\n\t}", "public void loadMore() {\n String[] moreSymbols = mListManipulator.getMoreToLoad();\n\n if (moreSymbols != null) {\n mLoadingMore = true;\n\n // Start service to load a few\n Intent serviceIntent = new Intent(getActivity(), MainService.class);\n serviceIntent.setAction(Constants.ACTION_LOAD_MORE);\n serviceIntent.putExtra(Constants.KEY_LOAD_MORE_QUERY, moreSymbols);\n getActivity().startService(serviceIntent);\n\n } else {\n mLoadingMore = false;\n }\n }", "public void readMore1(View view) {\n String readMore1 = \"Founder: Johann Kok\" + \"\\nWebsite: http://www.seebox.co.za\";\n displayMessage(readMore1);\n }", "public abstract void onLoadMore(int page, int totalItemsCount);", "public abstract void onLoadMore(int page, int totalItemsCount);", "public void readMore9(View view) {\n String readMore9 = \"Founder: Eyram Tawia\" + \"\\nWebsite: http://letiarts.com/\";\n displayMessage9(readMore9);\n }", "@Override\n\tpublic void onLoadMore() {\n\t\tif (onRefresh_number) {\n\t\t\tpage = page + 1;\n\n\t\t\tonRefresh_number = false;\n\t\t\tgetData();\n\n\t\t\t// if (Tools.isConnect(getApplicationContext())) {\n\t\t\t// onRefresh_number = false;\n\t\t\t// getData();\n\t\t\t// } else {\n\t\t\t// onRefresh_number = true;\n\t\t\t// handler.sendEmptyMessage(2);\n\t\t\t// }\n\t\t} else {\n\t\t\thandler.sendEmptyMessage(3);\n\t\t}\n\t}", "public void readMore2(View view) {\n String readMore2 = \"Founder: Kwabena Danso\" + \"\\nWebsite: http://booomers.com/\";\n displayMessage2(readMore2);\n }", "@Override\n public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {\n loadMoreRecyclerViewData(hal[0]);\n hal[0]++;\n }", "boolean getMoreResults();", "public void onRequestMore() {\n buildTimeline(getLastTweetId() - 1, NO_SINCE_ID);\n }", "public void smell() {\n\t\t\n\t}", "@Override\r\n\tprotected void doFirst() {\n\t\t\r\n\t}", "public void fetchMore() {\n List<SuggestionsSection> supportingSections = new LinkedList<>();\n\n for (SuggestionsSection section : mSections.values()) {\n if (section.getCategoryInfo().isFetchMoreSupported()) {\n supportingSections.add(section);\n }\n }\n\n if (supportingSections.size() > 1) {\n assert false : \"SectionList.fetchMore - Multiple supporting sections: \"\n + getCategoriesForDebugging();\n } else if (supportingSections.size() == 0) {\n Log.d(TAG, \"SectionList.fetchMore - No supporting sections: %s\",\n getCategoriesForDebugging());\n } else if (getChildren().get(getChildren().size() - 1) != supportingSections.get(0)) {\n Log.d(TAG, \"SectionList.fetchMore - Supporting section not at end: %s\",\n getCategoriesForDebugging());\n } else if (supportingSections.get(0).isLoading()) {\n Log.d(TAG, \"SectionList.fetchMore - Supporting section is already loading.\");\n } else {\n // Fetch more is called when the user does not explicitly trigger a fetch (eg, the user\n // scrolls down). In this case we don't inform the user of the outcomes, hence the null\n // parameters.\n supportingSections.get(0).fetchSuggestions(null, null);\n }\n }", "@Override\n public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {\n System.out.println(\"load more\" + totalItemsCount);\n loadMore(totalItemsCount);\n }", "public void readMore6(View view) {\n String readMore6 = \"Founder: Chinazo Ikenna\" + \"\\nWebsite: http://www.solarkobo.com\";\n displayMessage6(readMore6);\n }", "public void searchMore() {\n if (session != null) session.searchMore();\n }", "private void sub() {\n\n\t}", "public void readMore23(View view) {\n String readMore23 = \"Founder: Tinashe Makaza\" + \"\\nWebsite: http://www.virtualbank.co.zw/\";\n displayMessage23(readMore23);\n }", "public void readMore3(View view) {\n String readMore3 = \"Founder: James Steere\" + \"\\nWebsite: http://www.idropwater.com\";\n displayMessage3(readMore3);\n }", "@Override\n public void run() {\n refreshLayout.finishLoadMore(true);\n }", "public void indentMore() {\n\t\tindentLevel += indentStep;\n\t}", "@Override\n\t\tpublic synchronized void onLoadMore() {\n\t\t\ttry {\n\t\t\t\t//如果总页数大于当前页码数,加载更多\n\t\t\t\tif(pageSize > curPage){\n\t\t\t\t\tURL = URL.substring(0, URL.lastIndexOf(\"_\")+1);\n\t\t\t\t\tcurPage++;\n\t\t\t\t\tURL = URL+curPage+\".xml\";\n\t\t\t\t\tnew AsyncLoadNews(flag,lsnb,URL).execute();\n\t\t\t\t}else{\n\t\t\t\t\tlistView.setPullLoadEnable(false);\n\t\t\t\t\tonLoadStop();\n\t\t\t\t\tToast toast = Toast.makeText(getActivity(), \"数据已经加载完毕!\", Toast.LENGTH_LONG);\n//\t\t\t\t\ttoast.getView().setBackgroundResource(R.drawable.red_toast_bg);\n\t\t\t\t\ttoast.getView().setPadding(20, 10, 20, 10);\n\t\t\t\t\ttoast.show();\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}", "@Override\r\n\tprotected void doF1() {\n\t\t\r\n\t}", "public void readMore12(View view) {\n String readMore12 = \"Founder: Adama Kane\" + \"\\nWebsite: http://www.jokkosante.org/\";\n displayMessage12(readMore12);\n }", "protected HL7DataTree more() {\n return null;\n }", "public static void listing5_14() {\n }", "@Test\n public void testQueryMore1() throws Exception {\n testQueryMore(true, true);\n }", "@Override\n\t\tpublic void onLoadMore() {\n\t\t\tdaoIndex++;\n\t\t\tgetData();\n\t\t\tadapter.notifyDataSetChanged();\n\t\t\tonLoad();\n\t\t}", "public void run() {\n\t\t\t\t\t\t\t\t\timageList.removeView(Moreview);\r\n\t\t\t\t\t\t\t\t\tgenerateUI(tempArrayList);\r\n\t\t\t\t\t\t\t\t}", "public static void listing5_15() {\n }", "public void readMore4(View view) {\n String readMore4 = \"Founder: Dr. William Mapham\" + \"\\nWebsite: http://www.vulamobile.com/\";\n displayMessage4(readMore4);\n }", "private void loadMoreData() {\n twitterClient.getNextPageOfTweets(new JsonHttpResponseHandler() {\n @Override\n public void onSuccess(int statusCode, Headers headers, JSON json) {\n Log.i(ACTIVITY_TAG, \"onSuccess: loadMoreData\");\n // deserialize and construct new model objects from API response\n JSONArray jsonArray = json.jsonArray;\n try {\n // append new data object tweets to existing list\n // notify adapter\n tweetsAdapter.addAll(Tweet.fromJsonArray(jsonArray));\n } catch (JSONException e) {\n Log.e(ACTIVITY_TAG, \"JSON exception: loadMoreData\", e);\n }\n }\n\n @Override\n public void onFailure(int statusCode, Headers headers, String response, Throwable throwable) {\n Log.e(ACTIVITY_TAG, \"onFailure: loadMoreData:\" + response , throwable);\n }\n }, tweets.get(tweets.size() - 1).getId());\n }", "@Test\n public void testQueryMore3() throws Exception {\n testQueryMore(false, false);\n }", "public void loadMoreEnd() {\n loadMoreEnd(false);\n }", "public void readMore15(View view) {\n String readMore15 = \"Website: http://gomyway.com\";\n displayMessage15(readMore15);\n }", "@Override\n public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {\n G.i(\"YOOOHO\");\n\n G.i(\"passed threshold p: \" + page + \" activity: \" + totalItemsCount);\n if (!noMorePost){\n loadPosts(Constant.POST_REQUEST_COUNT,totalItemsCount,page, searchPhrase);\n }else\n noMorePost = false;\n\n }", "@Override\n\tpublic synchronized void onLoadMore() {\n\t\ttry {\n\t\t\t// 如果总页数大于当前页码数,加载更多\n\t\t\tif (pageSize > curPage) {\n\t\t\t\tURL = URL.substring(0, URL.lastIndexOf(\"_\") + 1);\n\t\t\t\tcurPage++;\n\t\t\t\tURL = URL + curPage + \".xml\";\n\t\t\t\tnew AsyncLoadNews(lsnb, URL).execute();\n\t\t\t} else {\n\t\t\t\tlistView.setPullLoadEnable(false);\n\t\t\t\tonLoadStop();\n\t\t\t\tToast toast = Toast.makeText(getActivity(), \"数据已经加载完毕!\",\n\t\t\t\t\t\tToast.LENGTH_LONG);\n\t\t\t\t// toast.getView().setBackgroundResource(R.drawable.red_toast_bg);\n\t\t\t\ttoast.getView().setPadding(20, 10, 20, 10);\n\t\t\t\ttoast.show();\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n public void onLoadMore() {\n MyApplacation.getmHandler().postDelayed(new Runnable() {\n @Override\n public void run() {\n pageNo++;\n getDataForService();\n }\n }, 1000);\n\n }", "@Override\n\t public void onLoadMore(int page, int totalItemsCount) {\n\t customLoadMoreDataFromApi(); \n // or customLoadMoreDataFromApi(totalItemsCount); \n\t }", "protected void indentMore() \r\n\t{\r\n\tindent += 3;\r\n\t}", "@Override\n protected Void doInBackground(Void... params) {\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n //change the flag to be true\n loadingMore=true;\n //load data from url\n ArrayList<Recipe> recipe = Utils.fetchListOfRecipeData(stringUrl+current_page);\n ++current_page;\n recipesList.addAll(recipe);\n }\n });\n\n\n return null;\n }", "public void readMore8(View view) {\n String readMore8 = \"Founder: Antony Tonee Ndungu\" + \"\\nWebsite: http://kytabu.com\";\n displayMessage8(readMore8);\n }", "public void readMore16(View view) {\n String readMore16 = \"Founder: Theuri Mwangi\" + \"\\nWebsite: https://mymookh.com/\";\n displayMessage16(readMore16);\n }", "public void readMore21(View view) {\n String readMore21 = \"Website: http://www.flyingdoctorsnigeria.com/\";\n displayMessage21(readMore21);\n }", "@Override\n\tpublic void onMoreLisenter() {\n\t\tstartActivity(new Intent(this, AccidentHandlingActivity.class));\n\t}", "public void readMore5(View view) {\n String readMore5 = \"Founders: John Lush, Gunter Rust, Toivo Thomas\" + \"\\nWebsite: http://agri-cyclenamibia.weebly.com/\";\n displayMessage5(readMore5);\n }", "public b(Function1 function1) {\n super(1);\n this.$loadMore = function1;\n }", "@Override\n\t public void onLoadMore(int page, int totalItemsCount) {\n\t customLoadMoreDataFromApi(page); \n // or customLoadMoreDataFromApi(totalItemsCount); \n\t }", "public boolean hasMoreItems();", "public void readMore14(View view) {\n String readMore14 = \"Website: http://ologa.com/\";\n displayMessage14(readMore14);\n }", "public static void helpermethod(int numberofsteps){\n ways(numberofsteps, 0, \"[\");\r\n }", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "public void readMore17(View view) {\n String readMore17 = \"Founder: Terry Kanu-Iroegbu\" + \"\\nWebsite: https://www.pushcv.com\";\n displayMessage17(readMore17);\n }", "@Test\n public void testQueryMore4() throws Exception {\n testQueryMore(true, false);\n }", "public void readMore13(View view) {\n String readMore13 = \"Founder: Harouna Ba\" + \"\\nWebsite: http://greenwashafrica.com/\";\n displayMessage13(readMore13);\n }", "@Override\n public void onLoadMore(int page, int totalItemsCount) {\n customLoadMoreDataFromApi(page);\n // or customLoadMoreDataFromApi(totalItemsCount);\n }", "@Override\n public void onLoadMore(int page, int totalItemsCount) {\n customLoadMoreDataFromApi(page);\n // or customLoadMoreDataFromApi(totalItemsCount);\n }", "public void readMore20(View view) {\n String readMore20 = \"Website: http://hellodoc.ng/\";\n displayMessage20(readMore20);\n }", "@Override\n public void onMoreDataFetch() {\n Log.d(TAG, \"onMoreDataFetch: hasMoreData:\" + hasMoreData);\n //figure out if we have more data to fetch, i.e. hasMoreData == true\n if (!hasMoreData) return;\n\n //fetch more data\n ((SuggestionsDataFragment) fragments[DATA]).fetchSuggestions(pageNumber + 1, nextUrl);\n }", "@Override\r\n public boolean hasMoreObjects() {\r\n return hasMore;\r\n }", "@Override\n public void onLoadMore(int page, int totalItemsCount) {\n if(next_url != null) {\n curent_page = page;\n loadMore(page);\n }\n // or customLoadMoreDataFromApi(totalItemsCount);\n }", "@Override\n public void onLoadMore(int page, int totalItemsCount) {\n if(next_url != null) {\n curent_page = page;\n loadMore(page);\n }\n // or customLoadMoreDataFromApi(totalItemsCount);\n }", "public void customLoadMoreDataFromApi(int offset) {\n }", "@Override\n\t\t\tpublic void onStart() {\n\t\t\t\tLog.d(TAG, \"点击了读取更多 \");\n\t\t\t\tnumber++;\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tnew AsyncTask<Void, Void, Void>() {\n\t\t\t\t\t@Override\n\t\t\t\t\tprotected Void doInBackground(Void... params) {\n\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\tgetdata(number);\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\t@Override\n\t\t\t\t\tprotected void onPostExecute(Void result) {\n\t\t\t\t\t\txlistview.setLoadMoreSuccess();\n\t\t\t\t\t\tadapter.notifyDataSetChanged();\n\t\t\t\t\t\tLog.d(TAG, \"jieshu\");\n\t\t\t\t\t}\n\t\t\t\t}.execute(null, null, null);\n\t\t\t}", "@Test\n public void testQueryMore2() throws Exception {\n testQueryMore(false, true);\n }", "private void setupMoreActionButton() {\n moreButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n InterfaceAction.startMoreActionButtonAnimation(moreButton);\n\n boolean isCurrentUserThePostCreator = Helper.isPrismUserCurrentUser(prismPost.getPrismUser());\n AlertDialog morePrismPostAlertDialog = InterfaceAction.createMorePrismPostAlertDialog(context, prismPost, isCurrentUserThePostCreator);\n morePrismPostAlertDialog.show();\n }\n });\n }", "public void readMore11(View view) {\n String readMore11 = \"Website: http://www.settic.sn/\";\n displayMessage11(readMore11);\n }", "@Override\n public void onLoadMore() {\n if (searchbeanArrayList_new.size() != 0) {\n\n\n handler.postDelayed(new Runnable() {\n @Override\n public void run() {\n // remove progress item\n\n\n //add items one by one\n\n if (pageTokenAvailable) {\n smoothProgressBar.setVisibility(View.VISIBLE);\n\n current_start += 10;\n\n // searchbean_post_data.getStart_limit()+=10;\n\n searchbean_post_data.setStart_limit(current_start);\n\n\n findDataFromServer();\n\n\n //or you can add all at once but do not forget to call mAdapter.notifyDataSetChanged();\n }\n\n\n }\n }, 2000);\n\n }\n\n }", "@Override\n\tpublic void doIt() {\n\t\t\n\t}", "private void loadMoreHistoryChat(){\n loadChatHistory(CHAT_LIMIT,headIndex,0);\n }", "private void offer() {\n\t\t\t\n\t\t}", "@Override\r\n\tpublic void clickAdd(int count) {\n\t\t\r\n\t}", "public abstract void increaseThis();", "public static void listing5_16() {\n }", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "@Override\n public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {\n loadNextData(page);\n }", "public void readMore18(View view) {\n String readMore18 = \"Website: http://www.wecyclers.com\";\n displayMessage18(readMore18);\n }", "@Override\n\tpublic void some() {\n\t\t\n\t}" ]
[ "0.7534166", "0.65239495", "0.6493768", "0.6399896", "0.6398378", "0.61969", "0.6088587", "0.6079048", "0.60585636", "0.6057", "0.5958327", "0.5958327", "0.593081", "0.5926142", "0.5887422", "0.5885088", "0.58778393", "0.5802473", "0.57918656", "0.57727385", "0.57068896", "0.5689778", "0.56767434", "0.566342", "0.56362385", "0.56362385", "0.5630351", "0.56294376", "0.56122184", "0.5610254", "0.5595929", "0.5583146", "0.55829227", "0.55719405", "0.555095", "0.55275613", "0.5526157", "0.55223125", "0.5519443", "0.55187285", "0.5509003", "0.55075294", "0.54944116", "0.54882276", "0.54794884", "0.5478595", "0.54757935", "0.5474126", "0.54642606", "0.546093", "0.54608196", "0.5459593", "0.5453333", "0.54511875", "0.5441624", "0.5441061", "0.54390436", "0.5434854", "0.5433507", "0.54329807", "0.5432424", "0.5426373", "0.54241437", "0.54211944", "0.54178375", "0.54169744", "0.54091525", "0.5402001", "0.53858787", "0.53787434", "0.5352872", "0.53423256", "0.5339141", "0.53374755", "0.5335711", "0.5333374", "0.5329537", "0.5327084", "0.5327084", "0.5309032", "0.53056526", "0.5303951", "0.5302121", "0.5302121", "0.5297848", "0.52963394", "0.52935195", "0.5290767", "0.5289774", "0.5280646", "0.5273442", "0.52595216", "0.5257073", "0.52532685", "0.5250666", "0.5248932", "0.5248262", "0.5247707", "0.52439433", "0.524276" ]
0.605102
10
maximum health a ship box can have, 1 or 2 Class Methods No argument constructor
public Ship(){ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static int maxHealth(int health){\r\n int mHealth = 0;\r\n mHealth = health + 5;\r\n return mHealth; \r\n }", "public int getMaxHealth();", "public int getMaxHealth()\r\n\t{\r\n\t\treturn MaxHealth;\r\n\t}", "@Override\n public int maxHealth() {\n return 25;\n }", "public int getMaxHealth() {\n \t\treturn (int)(maxHealthModifier + (stamina/2 + strength/4)*Math.PI);\n \t}", "public void setMaxHealth() {\n\t\tthis.maxHealth *= level / 10;\n\t}", "public int getMaxHealth() {\r\n return maxHealth;\r\n }", "public Ship(int l){\n this.lifePoints=l;\n }", "public float getMaxHealth()\n {\n return maxHealth;\n }", "public int getMaxHealth() {\n return maxHealth;\n }", "public Player(int max_inventory){\n this.max_inventory = max_inventory;\n }", "public HealthComponent(int maxHealth) {\n\t\tthis(maxHealth, maxHealth);\n\t}", "public int getBaseMaxHealth()\r\n\t{\treturn this.baseMaxHealth;\t}", "int getMaxMana();", "int getMaxHP();", "int getMaxHP();", "int getMaxHP();", "int getMaxHP();", "int getMaxHP();", "int getMaxHP();", "int getMaxHP();", "public double getMaxHealth() {\n return maxHealth;\n }", "public int getMaxHealth() {\n return this.maxHealth;\n }", "public int getMaxHealth() {\n\t\treturn maxHealth;\n\t}", "public int getMaxHealth() {\n\t\treturn maxHealth;\n\t}", "public int calcMaxLife() {\n\t\treturn 10;\r\n\t}", "public M csmiStatusMax(Object max){this.put(\"csmiStatusMax\", max);return this;}", "public void changeMaxHealth(int i) {\n \t\tmaxHealthModifier += i;\n \t\tif (getMaxHealth() < 1 ){\n \t\t\thealth = 0;\n \t\t\talive = false;\n \t\t}\n \t\tif (getMaxHealth() < health) {\n \t\t\thealth = getMaxHealth();\n \t\t}\n \t}", "public SoldierEnemy(int health) {\n super(health);\n }", "public void setMaxHealth(final int maxHealth) {\n this.maxHealth = maxHealth;\n }", "public int getShipHealth()\r\n\t{\r\n\t\treturn ShipHealth;\r\n\t}", "public int getHealth();", "public int getMineMaxAmmo() {\r\n\t\t\r\n\t\t// Code kann nur bei Verwendung von eea verwendet werden, sonst muss er geloescht werden!\r\n\t\t// Auch bei Verwendung von eea muss diese Methode erweitert werden.\r\n\r\n\t\tList<Entity> entities = new ArrayList<Entity>();\r\n\r\n\t\tentities = StateBasedEntityManager.getInstance().getEntitiesByState(Tanks.GAMEPLAYSTATE);\r\n\r\n\t\t//TODO\r\n\r\n\t\treturn -1;\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 }", "public Human(int theShipType){\n super(theShipType);\n }", "Residency(int initialPrice, int maxHealth, int health, int x, int y, int maxCap){\n\n super(initialPrice, maxHealth, health, x, y);\n this.maxCapacity = maxCap;\n\n this.setSprite(Toolkit.getDefaultToolkit().getImage(\"./assets/Residency.png\"));\n }", "protected void setMaxHealthPerLevel(double maxHealthPerLevel) \r\n\t{\tthis.maxHealthPerLevel = maxHealthPerLevel;\t}", "public WallAnt()\n {\n health = 4;\n cost = 4;\n }", "int maxHit(Player player, Entity target);", "protected void setBaseMaxHealth(int baseMaxHealth) \r\n\t{\tthis.baseMaxHealth = baseMaxHealth;\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 Max()\r\n {\r\n }", "int getHealth();", "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 hardestBoss() {\r\n // Get array with names of bosses.\r\n BossNames[] names = BossNames.values();\r\n\r\n // Get array of damage/attack points of the bosses.\r\n Boss boss = new Boss();\r\n int bossDamage[] = boss.getBossDamage();\r\n\r\n // Calculate max damage/attack points using for-each loop.\r\n int maxDamage = bossDamage[0];\r\n for (int damage : bossDamage) {\r\n if (damage > maxDamage) {\r\n maxDamage = damage;\r\n }\r\n }\r\n\r\n // Search array for maxDamage to calculate index.\r\n int index = -1;\r\n for (int i = 0; i < bossDamage.length; i++) {\r\n if (bossDamage[i] == maxDamage) {\r\n index = i;\r\n }\r\n }\r\n\r\n if (index != -1) {\r\n console.println(\"The boss with the greatest attack points is \" + names[index] + \".\");\r\n }\r\n }", "public Sheep()\n {\n super(\"Sheep\",3,2,0); \n \n // tagline = \"Whatever\";\n maxHealth = 5;\n currentHealth = maxHealth;\n equip(new Cloth());\n equip(new SheepClaws());\n \n \n \n engaged = false;\n aggression = 1;\n special = 0;\n hostileRange = 2;\n }", "public void makeHero()\r\n { \r\n maxHealth = 100;\r\n health = maxHealth;\r\n }", "@Test\r\n public void testMaxSum() {\r\n Player player = new Player();\r\n int expResult = -1;\r\n int result = player.maxSum();\r\n assertEquals(expResult, result);\r\n \r\n Stack stack=new Stack(false);\r\n player.setHand(stack.drawTiles(28));\r\n int expResult2=12;\r\n int result2=player.maxSum();\r\n assertEquals(expResult2, result2);\r\n }", "@Test\r\n public void testMaxDouble() {\r\n Player player = new Player();\r\n int expResult = -1;\r\n int result = player.maxDouble();\r\n assertEquals(expResult, result);\r\n \r\n Stack stack=new Stack(false);\r\n player.setHand(stack.drawTiles(28));\r\n int expResult2=6;\r\n int result2=player.maxDouble();\r\n assertEquals(expResult2, result2);\r\n \r\n \r\n }", "@Override\n public void hp(){\n HP=50*nivel;\n }", "public int getHealth() { return this.health; }", "public Blocks(int h)\n {\n health=h;\n worth=h;\n setImage(colors[health-1]);\n }", "public Integer getHealth();", "public void setMaxHealth(int newMaxHealth)\r\n\t{\r\n\t\tMaxHealth = newMaxHealth;\r\n\t}", "@Test\n public void whenSecondIsMax() {\n Max max = new Max();\n int rsl = max.max(0, 3, -1);\n assertThat(rsl, is(3));\n }", "public double getHealth() { return health; }", "public int getHealthCost();", "public double getMaxHealthPerLevel()\r\n\t{\treturn this.maxHealthPerLevel;\t}", "public abstract int getMaximumValue();", "public float getMaxMana()\n {\n return maxMana;\n }", "public E max() {\n\n }", "public Melee(ScrGame game, Player player){\n super();\n this.game = game;\n this.player = player;\n isPlayer = true;\n\n nSpray = 0;\n nShotsPerFire = 1;\n nAmmo = 1;\n nAmmoMax = nAmmo;\n }", "private void setMax(int max) { this.max = new SimplePosition(false,false,max); }", "public static void main(String[] args) {\n\t\t\n\t\tEnemy e1 = new Enemy(10); // Initialize a new enemy. It will call the constructor in the class enemy.\n\t\tEnemy e2 = new Enemy();\n\t\tEnemy e3 = new Enemy(3);\n\t\t\n\t\te1.SetHealth(100);\n\t\te2.SetHealth(50);\n\t\te3.SetHealth(25);\n\t\t\n\t\t// e1.lives = 10; Since now there is a constructor called Enemy that needs a value of lives it will be not necessary declare here the parameters.\n\t\t\n\t\tSystem.out.println(e1.lives);\n\t\tSystem.out.println(e2.lives); // Since I didn't declare the lives it will take the default value in the class Enemy.\n\t\tSystem.out.println(e3.lives);\n\t\t\n\t\te2.ReduceHealth(9); // It access the method ReduceHealth in the class enemy.\n\t\t\n\t\tSystem.out.println(e1.GetHealth());\n\t\tSystem.out.println(e2.GetHealth());\n\t\tSystem.out.println(e3.GetHealth());\n\t}", "public int getHealth(){\n return health;\n }", "public GameBoard(int numLanes, int yPos, int laneLength, int maxObjects){\n super(BULLET_DEPTH); //all attacks will be drawn at a depth of 20\n attacks = new ArrayList<AttackObject>(maxObjects);\n attacksToDelete = new LinkedList<>();\n attacksToAdd = new LinkedList<>();\n this.laneTopPosition = yPos;\n this.numLanes = numLanes;\n this.laneLength = laneLength;\n this.maxObjects = maxObjects;\n this.clearing = false;\n }", "public double getMaxHp() {\n return maxHp;\n }", "public Builder setMaxHP(int value) {\n bitField0_ |= 0x00000010;\n maxHP_ = value;\n onChanged();\n return this;\n }", "public Builder setMaxHP(int value) {\n bitField0_ |= 0x00000040;\n maxHP_ = value;\n onChanged();\n return this;\n }", "public Builder setMaxHP(int value) {\n bitField0_ |= 0x00000040;\n maxHP_ = value;\n onChanged();\n return this;\n }", "public GameLogic() {\n this.display = createScreen();\n playerShipHealth = 30;\n enemyShipHealth = 20;\n playerShield = 1;\n enemyShield = 1;\n playerMissile = 10;\n enemyMissile = 5;\n\n isPlayerPilotDamaged = false;\n isPlayerGunLDamaged = false;\n isPlayerGunMDamaged = false;\n isPlayerShieldDamaged = false;\n isPlayerEngineDamaged = false;\n\n isEnemyPilotDamaged = false;\n isEnemyGunLDamaged = false;\n isEnemyGunMDamaged = false;\n isEnemyShieldDamaged = false;\n isEnemyEngineDamaged = false;\n\n playerEvasionPercent = .3;\n enemyEvasionPercent = .3;\n\n }", "public Builder setMaxHP(int value) {\n bitField0_ |= 0x00000040;\n maxHP_ = value;\n onChanged();\n return this;\n }", "public M csmiHostMax(Object max){this.put(\"csmiHostMax\", max);return this;}", "@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 }", "public CruiseShip(String inShipName, int inYearBuilt, double inMax, double inPassengers) \r\n {\r\n super(inShipName, inYearBuilt);\r\n //Set Max first, then current\r\n SetMaxPassengers(inMax);\r\n if (inPassengers <= maxPassengers && inPassengers >= 0)\r\n {\r\n curPassengers = inPassengers;\r\n }\r\n else if (inPassengers > maxPassengers)\r\n {\r\n curPassengers = maxPassengers;\r\n }\r\n else\r\n {\r\n curPassengers = 0;\r\n }\r\n }", "abstract int getMaxLevel();", "public Square(boolean limited, int time, int health, Color color, int value, boolean armor) {\n this.limited = limited;\n this.time = time;\n this.health = health;\n this.color = color;\n this.value = value;\n covered = false;\n this.armor = armor;\n }", "static public int getGoblinMaxHP(int battles){\n maxHP = rand.nextInt(8) + 10 + battles;\n currentHP = maxHP;\n return maxHP;\n }", "public M csmiSexMax(Object max){this.put(\"csmiSexMax\", max);return this;}", "public interface Iship {\t\n\t\n//gunpoints, places where the cannons stick out of a model, cannot have more than 2?\t\n\tpublic static final int[] PLAYER_GUNPOINTS = {3,60};\n\tpublic static final int[] GUNSHIP_GUNPOINTS = {8, 40};\n\tpublic static final int[] SIDEWAYS_GUNPOINTS = {12, 36};\n\tpublic static final int[] ADVANCED_GUNPOINTS = {0};\n\tpublic static final int[] MOTHERSHIP_GUNPOINTS = {36, 190, 56, 168, 84, 140};\n\tpublic static final int[] SUIBOSS_GUNPOINTS = {10, 200, 145, 60};\n\t\n//bullet destruction vals\npublic static final int PLAYER_BULLET_VAL = 50;\n\n//ship score vals\npublic static final int SUICIDE_SCORE_VAL = 15;\npublic static final int SHOOTER_SCORE_VAL = 25;\npublic static final int SIDEWAYS_SCORE_VAL = 50;\n\n//health values:\npublic static final int PLAYER_MAX_HEALTH = 100;\n\n//standard collision health value\npublic static final int COLLISION_DAMAGE = 10;\npublic static final int BULLET_DAMAGE = 15;\n\n//enemy type ids \npublic static final int SUICIDE_ID = 0;\npublic static final int GUNSHIP_ID = 1;\n\n//enemy health\npublic static final int REGULAR_ENEM_HEALTH = 1;\npublic static final int ELEVATED_ENEM_HEALTH = 2;\n\n//speeds \npublic static final float SHIP_SPEED_NORMAL = 0.2f;\n\n//methods\n\t\n\tpublic int[] getGunpoints(); //returns gun-barrel pixels\n\tpublic int getHealth(); //gets health\n\tpublic void setHealth(int newHealth); //sets the health\n}", "public Inventory(int max) {\n items = new Item[max];\n }", "public int getHealth()\r\n {\r\n return health;\r\n }", "public Builder setMaxHP(int value) {\n bitField0_ |= 0x00000020;\n maxHP_ = value;\n onChanged();\n return this;\n }", "public MaxHeap() {\n this(64);\n }", "public int calculate_maximum_HP(int level, int mod_from_race) {\n return (level * die_type) + class_hp_mod + mod_from_race;\n }", "@Test\n public void whenFirstGreaterThanSecond() {\n Max maximum = new Max();\n int result = maximum.max(2, 1);\n assertThat(result, is(2));\n }", "int getMaximum();", "public int getMaxHP() {\n return maxHP;\n }", "Float getHealth();", "public int getBaseMaxMana()\r\n\t{\treturn this.baseMaxMana;\t}", "public int getMaxActive();", "public void setMaximumHHOccumpancyPerField(int num) {\n this.maximum_occupancy_Threshold = num;\n }", "public int GetMaxVal();", "public Warlock() {\n name = \"\";\n className = \"\";\n currentHealth = 0;\n strength = 0;\n defense = 0;\n special = 0;\n points = 0;\n }", "public void SetHealth(int h)\n{\n\thealth=h;\n}", "public void setMaxHealth(float maxHealth)\n {\n float percentage;\n\n if (getMaxHealth() > 0)\n {\n percentage = getHealth() / getMaxHealth();\n }\n else\n {\n percentage = 1.0f;\n }\n\n this.maxHealth = maxHealth;\n\n // Update the health to continue as the same percentage of the max.\n setHealth( getMaxHealth() * percentage );\n }", "public short getSiegeWeaponDamage();", "@Test\n public void whenFirstLessThanSecond() {\n Max maximum = new Max();\n int result = maximum.max(1, 2);\n assertThat(result, is(2));\n }", "public static int getEnemyLives(){\n return 1 + currentLvl * 2;\n\n }", "public static int getMaxDamage() {\n\t\treturn MAX_DAMAGE;\n\t}", "@Test\n public void whenFirstMoreSecondAndSecondMoreThird() {\n Max maximum = new Max();\n int result = maximum.max(3, 2, 1);\n assertThat(result, is(3));\n }" ]
[ "0.6973766", "0.6845458", "0.6531191", "0.6510701", "0.63303655", "0.6317338", "0.62393844", "0.6227016", "0.61976963", "0.6176762", "0.61182714", "0.60922223", "0.608329", "0.60698056", "0.6065036", "0.6065036", "0.6065036", "0.6065036", "0.6065036", "0.6065036", "0.6065036", "0.5984868", "0.59175956", "0.58976763", "0.58976763", "0.58316725", "0.57127786", "0.5710116", "0.57084185", "0.5701346", "0.56929064", "0.5681617", "0.5663719", "0.56627464", "0.56598914", "0.5658444", "0.56441295", "0.56427914", "0.5641545", "0.5629888", "0.56288266", "0.5621872", "0.56018764", "0.559387", "0.55918634", "0.55883235", "0.55766344", "0.557433", "0.5569067", "0.5565125", "0.55638385", "0.55195117", "0.551261", "0.5507698", "0.5491087", "0.54879797", "0.54822713", "0.54756844", "0.547491", "0.54718703", "0.54717433", "0.5465797", "0.54522824", "0.5446741", "0.5442442", "0.54315597", "0.54225373", "0.5421042", "0.5419705", "0.5419705", "0.5419559", "0.54191995", "0.5418514", "0.54174185", "0.5413568", "0.5410769", "0.5405629", "0.5405463", "0.54049325", "0.5402918", "0.54012537", "0.5396968", "0.5388893", "0.53877735", "0.53843427", "0.5373268", "0.5361499", "0.53614473", "0.53603166", "0.53588676", "0.5355901", "0.5348236", "0.53403217", "0.53348225", "0.53235555", "0.53183806", "0.5317796", "0.5317388", "0.5316314", "0.5309988", "0.5298811" ]
0.0
-1
Sets the size of the ship, ex: Cruiser = 5, Torpedo boat = 4. . .
public void setSize(int size){ this.shipSize = size; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public final void testSetSize() {\n int expRes = 5;\n int falseEnter = -4;\n ship.setSize(falseEnter);\n int result = this.ship.getSize();\n assertEquals(expRes, result);\n falseEnter = -1;\n ship.setSize(falseEnter);\n result = this.ship.getSize();\n assertEquals(expRes, result);\n }", "public int getSize(){\n\t\treturn shipSize;\n\t}", "private void setSize(int s){\n\t\tsize = s;\n\t}", "public void setSize(int size){\n this.size = size;\n }", "public void setSize(int value) {\n\t\tthis.size = value;\n\t}", "public void setSize(int size) {\r\n _size = size;\r\n }", "private void set_size(int size)\r\n\t{\r\n\t\tthis.size = size;\r\n\t}", "public void setSize(int _size)\r\n {\r\n size = _size;\r\n }", "public void setSize(int size) {\r\n this.size = size;\r\n }", "public Ship(String name, int size) {\r\n this.name = name;\r\n this.size = size;\r\n this.livesLeft = size;\r\n this.isSunk = false;\r\n }", "public void setSize(double size) \n {\n this.size = size;\n }", "public void setSize(int size);", "public void setSize(int size) {\n this.size = size;\n }", "public void setSize(int size) {\n this.size = size;\n }", "public void setSize(int size) {\n\t\t _size = size;\n\t}", "public void setSize(int size) {\n\tthis.sizeNumber = sizeNumber;\r\n}", "public void set_size(int s);", "public void setSize(int size) {\n\t\tthis.size = size;\n\t}", "public void setSize(int size) {\n\t\tthis.size = size;\n\t}", "public void setSize(int size) {\n\t\tthis.size = size;\n\t}", "public void setSize(int size) {\n\t\tthis.size = size;\n\t}", "public void setSize(int size) {\n this.size = size;\n }", "PlayerShip(int screenLength, int newY, int size, int newSpeed) {\n \tsuper(screenLength/2, newY, size, size);\n setHSpeed(newSpeed);\n }", "public void setSize(double s)\n\t{\n\t\tsize = s;\n\t}", "public void setSize(String size) {\r\n //System.out.print(\"Setting Size...\");\r\n this.Size = size;\r\n }", "public void setSize(Integer size) {\n this.size = size;\n }", "@Test\n public final void testValidGetSize() {\n int expRes = 5;\n int result = ship.getSize();\n assertEquals(expRes, result);\n expRes = 19;\n ship.setSize(expRes);\n result = ship.getSize();\n assertEquals(expRes, result);\n }", "void setSize(Dimension size);", "public void setSize(RMSize aSize) { setSize(aSize.width, aSize.height); }", "public void setSize(Dimension size) {\r\n this.size = size;\r\n }", "public void setSize(int x, int y)\n {\n \tthis.width = x;\n \tthis.height = y;\n }", "public Builder setSize(int value) {\n\n size_ = value;\n onChanged();\n return this;\n }", "public Builder setSize(int value) {\n\n size_ = value;\n onChanged();\n return this;\n }", "public void setSize(String size) throws IllegalPizza{\n\t\tif(size == null)\n\t\t\tthrow new IllegalPizza(\"Illegal, pizza size is not null!\");\n\t\tString size1 = size.toLowerCase();\n\t\tif (Objects.equals(size1, \"small\"))\n\t\t\tSize = size1;\n\t\telse if (Objects.equals(size1, \"medium\"))\n\t\t\tSize = size1;\n\t\telse if (Objects.equals(size1, \"large\"))\n\t\t\tSize = size1;\n\t\telse \n\t\t\tthrow new IllegalPizza(\"Illegal pizza size\");\n\t}", "public void setSize(String size) {\n this.size = size;\n }", "public static void setHotelSize(int size) {\r\n\t\tfor(int count = 0;count< size; count++) {\r\n\t\t\thotel_size.add(count + 1);\r\n\t\t}\r\n\t}", "public void setLocalSize(int size);", "public void setSize(int size) {\n\t members = size;\n\t}", "public void setShip (Ship s){\n \tthis.ship=s;\n }", "public void setSizeModifier(Dimension size) {\n\t\tthis.size = size;\n\t}", "public F2_Ship4() {\n\n setH(100);\n setW(50); //Set the size of the ship\n\n setArt(\"Art/SpaceShips/Faction2/Ship4.png\"); //Set the artwork of the ship\n }", "public void setHeight(int newValue)\r\n {\r\n seatHeight = newValue;\r\n }", "public void setSizeP(Number value) {\n setAttributeInternal(SIZEP, value);\n }", "public void setSize(int newSize);", "public void setSize(int newSize);", "public void setSize(long size) {\r\n\t\tthis.size = size;\r\n\t}", "public void setGameSize(int size) throws ConfigurationException {\n\t\tif (size < MINIMAL_SIZE || size > MAXIMAL_SIZE) {\n\t\t\tthrow ConfigurationException.wrongSizeBounds(MINIMAL_SIZE, MAXIMAL_SIZE, size);\n\t\t}\n\t\tgameSize = size;\n\t}", "public void setSize(float width, float height);", "public void setSize(int x, int y) {\n if (x < 0 || y < 0) {\n throw new AssertionError();\n }\n\n fenetre.setSize(x, y); \n }", "public int getShipLength() {\n return shipLength;\n }", "void setSize(float w, float h) {\n _w = w;\n _h = h;\n }", "public void setSize(long value) {\n this.size = value;\n }", "public void size(final int theWidth, final int theHeight);", "@JSProperty(\"size\")\n void setSize(double value);", "public void setSize( int newSize, int newWidth )\n\t{\n\t\tif( newSize > 0 )\n\t\t\tsize = newSize;\n\t\telse\n\t\t{\n\t\t\tsize = 0;\n\t\t\tSystem.err.printf(\"Board's parameter values can not be negative!\");\n\t\t}\n\t\tif( newWidth > 0 )\n\t\t\twidth = newWidth;\n\t\telse\n\t\t{\n\t\t\twidth = 0;\n\t\t\tSystem.err.printf(\"Board's parameter values can not be negative!\");\n\t\t}\n\t\tthis.createBoard();\n\t\tthis.reset();\n\t}", "@Element \n public void setSize(String size) {\n this.size = size;\n }", "public void setSize(double aWidth, double aHeight) { setWidth(aWidth); setHeight(aHeight); }", "private void setSize(FireSize size) throws InvalidFireSizeException {\n if (!isValidFireSize(size)) {\n throw new InvalidFireSizeException(String.format(\"\\\"%s\\\" isn't a valid fire size for a fire emergency.\", size));\n }\n this.size = size;\n }", "public void setHeight(int newValue) {\n seatHeight = newValue;\n }", "@Override\n\tpublic void setSize(float size) {\n\t\tthis.size = size;\n\t\trxs = new int [ Math.max(Math.round(size/calibration[0]), Math.round(size/calibration[1])) + 1 ];\t\t\n\t\treset();\n\t}", "public void setSize(String size) {\r\n this.size = size == null ? null : size.trim();\r\n }", "public void setSizeQty(Number value) {\n setAttributeInternal(SIZEQTY, value);\n }", "public void setBarSize(int aValue)\n {\n if (aValue==_barSize) return;\n firePropChange(BarSize_Prop, _barSize, _barSize = aValue);\n }", "public void sizeBy(float size) {\n internalGroup.sizeBy(size);\n dataTrait.width = internalGroup.getWidth();\n dataTrait.height = internalGroup.getHeight();\n resetSprite();\n }", "public void setSizeSno(Number value) {\n setAttributeInternal(SIZESNO, value);\n }", "public void setPointSize(float pointSize)\n {\n myPointSize = pointSize;\n }", "public void setShape(ChamberShape theShape) {\n mySize = theShape;\n setExits();\n }", "public void setPackageSize(int size){\r\n }", "public void setPizzaSize(String size) {\n pizzaSize = size;\n }", "public abstract void setSize(Dimension d);", "void setPaperSize(short size);", "public void changeSquareSize(){\r\n for(Square i : sqList){\r\n i.setSize(48);\r\n } \r\n }", "public void setSize(double value) {\n getElement().setSize(value);\n }", "private void setShape(ChamberShape theShape) {\n mySize = theShape;\n createDoorsFromExits();\n }", "public void setNumberShips(int numberShips);", "public void setSize(Vector2ic size){\n glfwSetWindowSize(handle, size.x(), size.y());\n this.size.set(size);\n sizeMultiplexer.handle(new WindowSizeEvent(handle, size.x(), size.y()));\n }", "public Ship(int size, boolean direction){\n this.size = size;\n this.location = null;\n this.orientation = direction;\n }", "void setDimension(double width, double height);", "public void setPopSize(int i){\n if (i < 2){\n throw new IllegalArgumentException(\"The population size must be at least 2.\");\n }\n if (i < randGenes){\n throw new IllegalArgumentException(\"The population size must be greater than the number of random genes per generation.\");\n }\n populationSize = i;\n }", "public void setValue(int size) {\n s.setValue(-size);\n }", "public void setSize(PlayerSize size) {\n if (size == this.size) {\n return; // Return, already sized like that\n }\n\n PlayerSize oldSize = this.size;\n this.size = size;\n\n updateSizeSafely(getView());\n\n if (mListener != null) {\n mListener.onPlayerSizeChanged(size, oldSize);\n }\n }", "public void settings() { size(1200, 800); }", "public void setFrameSize();", "public void setXSize(int xSize) {\n\t\tif (xSize < 1) {\n\t\t\tSystem.out.println(\"xSize should be positive! It is set to \" + X_SIZE + \".\");\n\t\t\txSize = X_SIZE;\n\t\t}\n\t\tthis.xSize = xSize;\n\n\t\t// To update the panel with new values if necessary\n\t\tthis.setNumRabbits(this.getNumRabbits());\n\n\t\tupdatePanel();\n\t}", "public void enlargeSquare()\n {\n squareSize++;\n }", "public void setSize( Point size ) {\n checkWidget();\n if ( size == null )\n error( SWT.ERROR_NULL_ARGUMENT );\n setSize( size.x, size.y );\n }", "public Builder setSize(godot.wire.Wire.Vector2 value) {\n if (sizeBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n size_ = value;\n onChanged();\n } else {\n sizeBuilder_.setMessage(value);\n }\n\n return this;\n }", "private void cbxSizeActionPerformed(java.awt.event.ActionEvent evt) {\n\n String size = (String) cbxSize.getSelectedItem();\n if (size.contains(\"4\")) {\n panelSize = 4;\n } else if (size.contains(\"5\")) {\n panelSize = 5;\n } else {\n panelSize = 3;\n }\n initPanel();\n }", "public void setSize();", "public FontRenderer setSize(float size) {\n\t\tthis.size = size;\n\t\ttransform.setScale(size);\n\t\t\n\t\treturn this;\n\t}", "public void setSizeOfDeck(int newSize, int burnCards)\n\t{\n\t\tsizeOfDeck = newSize;\n\t\tsizeOfBurnDeck = burnCards;\n\t}", "protected final void multiplySize(float size)\n {\n super.setSize(this.bokoblinWidth * size, this.bokoblinHeight * size);\n }", "@Override\r\n\tpublic int getPegCount() {\r\n\t\tint shipSize = 3;\r\n\t\treturn shipSize;\r\n\t}", "protected void newSize() {\r\n adjustSize();\r\n halt();\r\n newGame();\r\n }", "public Builder setSize(double value) {\n bitField0_ |= 0x00000020;\n size_ = value;\n onChanged();\n return this;\n }", "public void setSize(@Nullable String size) {\n this.size = size;\n }", "protected void adjustSize() {\r\n fieldDim = mineField.getSquareLength() * mineField.getFieldLength();\r\n setSize( fieldDim + X_BORDER * 2, fieldDim + Y_BORDER * 3 );\r\n validate();\r\n }", "private void setNumberOfShips(int numberOfShips) {\r\n\t\tthis.numberOfShips = numberOfShips;\r\n\t}", "void incNetSize(){\r\n\t\t\t\tif (size<500)size+=50;\r\n\t\t\t\telse System.out.println(\"Max net size reached!\");\r\n\t\t\t}", "public void setSize(Dimension d) {\n\n\t}" ]
[ "0.7535432", "0.72171664", "0.714449", "0.70080775", "0.6964712", "0.6951602", "0.6945788", "0.6942869", "0.6940322", "0.6937139", "0.6914531", "0.6892714", "0.68882585", "0.68882585", "0.6860129", "0.68567747", "0.6854659", "0.68143165", "0.68143165", "0.68143165", "0.68143165", "0.67729646", "0.6740364", "0.6722704", "0.6682287", "0.663681", "0.65987265", "0.6560872", "0.6547176", "0.6513362", "0.6510784", "0.65000796", "0.65000796", "0.6498615", "0.6457446", "0.6453889", "0.6390644", "0.63903666", "0.6369318", "0.635826", "0.63468885", "0.6329674", "0.63246536", "0.6321077", "0.6321077", "0.62718236", "0.6260189", "0.62419534", "0.62314254", "0.6215799", "0.61992383", "0.6150101", "0.61488456", "0.613182", "0.6115809", "0.6115424", "0.611376", "0.61093026", "0.6103372", "0.6096709", "0.6091221", "0.6089895", "0.60828406", "0.60758346", "0.6047786", "0.6040249", "0.60390615", "0.6028287", "0.6007556", "0.60042334", "0.60010123", "0.59990126", "0.5973194", "0.5971445", "0.597076", "0.5968913", "0.5958998", "0.5904162", "0.5886942", "0.5885856", "0.5875955", "0.5861136", "0.5845913", "0.5838051", "0.5826169", "0.5818172", "0.5814801", "0.5809326", "0.580178", "0.58014256", "0.57950455", "0.5790938", "0.5767986", "0.5757161", "0.5749548", "0.5748347", "0.57459563", "0.57405174", "0.5739894", "0.573517" ]
0.8668133
0
Returns the size of the ship
public int getSize(){ return shipSize; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getShipLength() {\n return shipLength;\n }", "@Override\r\n\tpublic int getPegCount() {\r\n\t\tint shipSize = 3;\r\n\t\treturn shipSize;\r\n\t}", "godot.wire.Wire.Vector2 getSize();", "public int getSize() {\n\t\treturn WORLD_SIZE;\n\t}", "godot.wire.Wire.Vector3 getSize();", "public long getSize() {\n\t\treturn Math.abs(getXSize() * getYSize() * getZSize());\n\t}", "public static Integer getNumberOfships() {\n\t\treturn NUMBEROFSHIPS;\n\t}", "public float getSize() {\n\t\treturn size;\n\t}", "public Point2D.Float getSize() {\r\n\t\treturn size;\r\n\t}", "public float getSize()\n {\n return size;\n }", "public float getSize() {\n return size;\n }", "public int getFleetSize() {\n return fleet.size();\n }", "public int getShipHealth()\r\n\t{\r\n\t\treturn ShipHealth;\r\n\t}", "public double getSize()\n\t{\n\t\treturn size;\n\t}", "public final Vector2f getSize() {\r\n return size;\r\n }", "public int getSpeed() {return ship.getSpeed();}", "public void setSize(int size){\n\t\tthis.shipSize = size;\n\t}", "public static int GetSize() {\n\t\t\treturn gridSize.getValue();\n\t\t}", "public Point getSize();", "public int getNumberOfShips() {\r\n\t\treturn numberOfShips;\r\n\t}", "public Dimension getSize()\n\t{\n\t\treturn rect.getSize();\n\t}", "public int getSize() {\n return board.getSize();\n }", "long getPlaneSize();", "public double getSize() \n {\n return size;\n }", "public Size getSize() {\n return size;\n }", "public int pileSize()\n {\n return warPile.getSize();\n }", "Dimension getSize();", "Dimension getSize();", "public double getSize() {\n return size_;\n }", "double getSize();", "public FireSize getSize() {\n return size;\n }", "public int getNumberShips();", "public int getSize(){\n //To be written by student\n return localSize;\n }", "public double getSize() {\n return size_;\n }", "public int getShipsAlive() {\n return this.numberOfShips;\n }", "@Override\n public int getShoeSize() {\n return this.cards.size();\n }", "public Dimension getSize() {\r\n\t\treturn this.size;\r\n\t}", "public int getDecshipCount(int shipSize){\n\t\topponentShipCounter[shipSize-1]--;\n\t\treturn opponentShipCounter[shipSize-1];\n\t}", "public Ship getShip() {\r\n\t\treturn ship;\r\n\t}", "public Ship getShip() {\r\n\t\treturn ship;\r\n\t}", "public static int size_hop() {\n return (8 / 8);\n }", "public int getSize()\n\t{\n\t\treturn itsPosition;\n\t}", "Vector getSize();", "public int obstacleSize(MovingSprite s) {\n\t\treturn 0;\n\t}", "public int getSize() {\n\t\treturn width + length;\n\t}", "public Dimension getSize() {\n\t\treturn size.getCopy();\n\t}", "public Vector2i getSize() {\n return new Vector2i(getWidth(), getHeight());\n }", "@Test\n public final void testValidGetSize() {\n int expRes = 5;\n int result = ship.getSize();\n assertEquals(expRes, result);\n expRes = 19;\n ship.setSize(expRes);\n result = ship.getSize();\n assertEquals(expRes, result);\n }", "public int getShipPieces() {\r\n\t\treturn shipPiecesFound;\r\n\t}", "public int getSize()\r\n {\r\n return pile.size();\r\n }", "public int getMazeSize() \r\n\t{\r\n\t\treturn this.size;\r\n\t}", "public int getGameSize() {\r\n\t\treturn this.gameSize;\r\n\t}", "int getTileSize();", "public int getHopSize()\n {\n return hopSize;\n }", "public int getSize() {\r\n return _size;\r\n }", "public Vector2f getSize() {return new Vector2f(sizeX, sizeX);}", "public int getSize()\n\t{\n\n\t\t// Return the number of Products in the inventory\n\t\treturn myProductInventory.size();\n\n\t}", "public int getSize( )\n {\n return size;\n }", "public int getSize() {\n return cart.size();\n }", "public int getSize() {\n return size;\n }", "public int getSize() {\n return size;\n }", "public int getSize() {\n return size;\n }", "public int getSize() {\n return size;\n }", "public int getSize() {\n return size;\n }", "public int getSize() {\n return size;\n }", "public int getSize() {\n return size;\n }", "public int getSize() {\n return size;\n }", "public int getSize() {\r\n return size;\r\n }", "public int getSize() {\n\t\treturn cart.size();\n\t}", "public Point getSize() {\n\t\treturn p_screenSize;\n\t}", "public String getSize() {\n return size;\n }", "public String getSize() {\n return size;\n }", "public int getSize()\r\n {\r\n return size;\r\n }", "public int getSize() {\n\n return size;\n }", "public final int getSize() {\n return size;\n }", "private int getSize() {\n\t\t\treturn size;\n\t\t}", "@java.lang.Override\n public godot.wire.Wire.Vector2 getSize() {\n return size_ == null ? godot.wire.Wire.Vector2.getDefaultInstance() : size_;\n }", "public String getSize() {\r\n return size;\r\n }", "public int getSize() {\n return size;\n }", "public Number getSizeSno() {\n return (Number)getAttributeInternal(SIZESNO);\n }", "public int getSize()\n {\n return size;\n }", "public int getSize()\n {\n return size;\n }", "public int getSize()\n {\n return size;\n }", "public int getSize() {\n\t\treturn _size;\n\t}", "public static float getSize() {\n return STAFF_LEN + FLAG_DEL_Y;\n }", "public double getMySize() {\n\t\treturn size;\n\t}", "public int pileSize() {\n return size;\n }", "public int getCommunalPileSize() {\n return communalPile.size();\n }", "public int getSize() {\n return size;\n }", "public int getSize() {\r\n\t\treturn size;\r\n\t}", "public int getSize() {\n\t\treturn size;\n\t}", "public int getSize() {\n\t\treturn size;\n\t}", "public int getSize() {\n\t\treturn size;\n\t}", "public int getSize() {\n\t\treturn size;\n\t}", "public int getSize() {\n\t\treturn size;\n\t}", "public int getSize() {\n\t\treturn size;\n\t}", "public int getSize() {\n\t\treturn size;\n\t}", "public int getSize() {\n\t\treturn size;\n\t}", "public int getSize() {\n\t\treturn size;\n\t}", "public int getSize() {\n\t\treturn size;\n\t}" ]
[ "0.82752883", "0.73726314", "0.69691896", "0.68864167", "0.688091", "0.68529874", "0.6836948", "0.67788154", "0.67656267", "0.67540294", "0.6752939", "0.67513746", "0.67356306", "0.67283016", "0.6719101", "0.6708274", "0.66986364", "0.6695221", "0.6684675", "0.665435", "0.6653646", "0.6643222", "0.6629181", "0.66245955", "0.6607459", "0.6603925", "0.66030705", "0.66030705", "0.6578233", "0.6556071", "0.65502024", "0.6545656", "0.6545555", "0.6528764", "0.65189093", "0.65178967", "0.6503921", "0.650357", "0.64880085", "0.64880085", "0.64738643", "0.64705783", "0.64653766", "0.6457165", "0.6414624", "0.64127624", "0.6412497", "0.64101225", "0.63966244", "0.6393421", "0.639339", "0.6391982", "0.6385004", "0.63796055", "0.63714355", "0.63583505", "0.63530016", "0.635247", "0.6342108", "0.63382256", "0.63382256", "0.63382256", "0.63382256", "0.63382256", "0.63382256", "0.63382256", "0.63382256", "0.6332048", "0.6328834", "0.63277835", "0.63226986", "0.63226986", "0.63218546", "0.6321833", "0.63186616", "0.63176966", "0.6317552", "0.63118917", "0.6311701", "0.6309411", "0.62989527", "0.62989527", "0.62989527", "0.62984896", "0.6298401", "0.6294765", "0.62939703", "0.6291992", "0.6290729", "0.62902755", "0.62890184", "0.62890184", "0.62890184", "0.62890184", "0.62890184", "0.62890184", "0.62890184", "0.62890184", "0.62890184", "0.62890184" ]
0.90871423
0
Returns the position of the ship's bow
public Point getPosition(){ return position; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Integer getBPos();", "public static int getBukkitPosition(int x,int y){\n return ((y-1)*9)+x-1;\n }", "public Ship getShip() {\r\n\t\treturn ship;\r\n\t}", "public Ship getShip() {\r\n\t\treturn ship;\r\n\t}", "godot.wire.Wire.Vector2 getPosition();", "private Point2D getBoardPosition() {\n double size = getCellSize();\n double x = canvas.getWidth() / 2 - board.getWidth() * size / 2;\n double y = canvas.getHeight() / 2 - board.getHeight() * size / 2;\n\n return new Point2D(x, y);\n }", "public int get_X_Coordinate()\n {\n return currentBallX;\n }", "private Vector2 getNewBombPosition() {\n float xx=heroBody.getBody().getPosition().x*16, yy=heroBody.getBody().getPosition().y*16;\n if(heroBody.getCurrentState() == HeroBody.State.STAND_UP || heroBody.getCurrentState() == HeroBody.State.WALK_UP)\n yy+=16;\n else if(heroBody.getCurrentState() == HeroBody.State.STAND_DOWN || heroBody.getCurrentState() == HeroBody.State.WALK_DOWN)\n yy-=16;\n else if(heroBody.getCurrentState() == HeroBody.State.STAND_RIGHT || heroBody.getCurrentState() == HeroBody.State.WALK_RIGHT)\n xx+=16;\n else if(heroBody.getCurrentState() == HeroBody.State.STAND_LEFT || heroBody.getCurrentState() == HeroBody.State.WALK_LEFT)\n xx-=16;\n return new Vector2(xx,yy);\n }", "public int getX() { return position.x; }", "Square getCurrentPosition();", "public final BlockPos getPos() {\n\t\treturn baseTile.getPos();\n\t}", "public Point getBPosition()\n\t{\n\t\treturn bPoint;\n\t}", "public Ship getShip (){\n \treturn this.ship;\n }", "public Position findWeedPosition() {\n int x = 0;\n int y = 0;\n int sum = 0;\n for (int i = 0; i < this.WORLD.getMapSize().getX(); i++) {\n for (int j = 0; j < this.WORLD.getMapSize().getY(); j++) {\n\n //hogweed\n Organism organism = this.WORLD.getOrganism(i, j);\n if(organism!=null){\n Class c = organism.getClass();\n if (c.getSimpleName().equals(\"Parnsip\")) {\n int tmpX = Math.abs(this.position.getX() - i);\n int tmpY = Math.abs(this.position.getY() - j);\n if (!(sum==0)) {\n int tmpSum = tmpX + tmpY;\n if (sum > tmpSum) {\n x = i;\n y = j;\n sum = tmpSum;\n }\n }\n else {\n x = i;\n y = j;\n sum = tmpX + tmpY;\n\n }\n }\n }\n\n }\n }\n return new Position(x,y);\n }", "public Position gibPosition()\n {\n return position;\n }", "String getPosX();", "godot.wire.Wire.Vector3 getPosition();", "public Point getXyLocation() {\n return playerxy;\n }", "@Override\n public String toString() {\n return \"Ship X:\" + position.x\n + \"\\nShip Y:\" + position.y;\n }", "public int getBoardLocation() {return boardLocation;}", "public int[] getPosBrazo()\n {\n return brazo.getPosBrazo();\n }", "public Ship getShip()\n {\n return ship;\n }", "public int getX(){\n return this.position[0];\n }", "@Override\n public double getPosX() {\n return this.pos[0];\n }", "public int getX(){\n\t\treturn this.x_location;\n\t}", "public int getLocationX() {\r\n\t\treturn x;\r\n\t}", "public DoubleSolenoid.Value getPosition() {\n return m_ballholder.get();\n }", "public int getBoardPosition() {\n return boardPosition;\n }", "public int getX() { return loc.x; }", "String getLawnPosition();", "Tile getPosition();", "public int getXPos();", "public Coordinate getPosition();", "public Vec2 \tgetPos(){ \t\t\t\t\treturn bound.getPos();\t\t}", "public Point getLocation() {\n return pos;\n }", "public int getX() {\n return pos_x;\n }", "@Override\n\tpublic int getPositionOrder() {\n\t\treturn _dmGTShipPosition.getPositionOrder();\n\t}", "public Vector2 getPosition () {\n\t\tVec2 pos = body.getPosition();\n\t\tposition.set(pos.x, pos.y);\n\t\treturn position;\n\t}", "double getXPosition();", "public Integer getShip_address() {\n return ship_address;\n }", "public final int getX()\n\t{\n\t\treturn pos.x;\n\t}", "public double monsterPos(){\r\n\r\n\t\treturn monster.getY();\r\n\r\n\t}", "@Override\n public double getLocationX() {\n return myMovable.getLocationX();\n }", "public final double getX() { return location.getX(); }", "public MowerPosition getPosition() {\n return position;\n }", "public PointF getPosition()\n {\n return getMazeSprite().getPosition();\n }", "public Position findWeed() {\n int xVec =0;\n int yVec=0;\n int sum = 0;\n Position move = new Position(0, 0);\n for (int i = 0; i < this.WORLD.getMapSize().getX(); i++) {\n for (int j = 0; j < this.WORLD.getMapSize().getY(); j++) {\n\n //hogweed\n Organism organism = this.WORLD.getOrganism(i, j);\n if(organism!=null){\n Class c = organism.getClass();\n if (c.getSimpleName().equals(\"Parnsip\")) {\n int tmpX = Math.abs(this.position.getX() - i);\n int tmpY = Math.abs(this.position.getY() - j);\n if (!(xVec == 0 && yVec == 0)) {\n int tmpSum = tmpX + tmpY;\n if (sum > tmpSum) {\n xVec=tmpX;\n yVec=tmpY;\n sum = tmpSum;\n this.setMove(move, j, i);\n }\n }\n else {\n xVec=tmpX;\n yVec=tmpY;\n sum = tmpX + tmpY;\n this.setMove(move, j, i);\n }\n }\n }\n\n }\n }\n return move;\n }", "public int getX(){ return xPosition; }", "double getX() { return pos[0]; }", "public int getXcoord(){\n\t\treturn this.coordinates[0];\n\t}", "public Location getBedSpawnLocation ( ) {\n\t\treturn extract ( handle -> handle.getBedSpawnLocation ( ) );\n\t}", "public int getLiftPosition() {\n //Do some math on getting the encoder positions\n return liftStageOne.getCurrentPosition() + liftStageTwo.getCurrentPosition();\n }", "Vector getPos();", "public int getY(){\n return this.position[1];\n }", "public Vector2F getWorldLocation() {\n\t\treturn new Vector2F(xPos, yPos);\n\t}", "String getPosY();", "public int get_Y_Coordinate()\n {\n return currentBallY;\n }", "public int getPos();", "public int getPos();", "public int getY() { return loc.y; }", "public double getX() {\n return position.getX();\n }", "public int getLocation(int x, int y) {\n\t\treturn board[x][y];\n\t}", "public String getWishPosition() {\n return wishPosition;\n }", "@Override\n\tpublic Vector2 getPosition() {\n\t\treturn body.getPosition();\n\t}", "public int getX() {\n return positionX;\n }", "public int getX() {\n return posX;\n }", "public static int getCoords()\n\t{\n\t\treturn moveCoords;\n\t}", "double getY() { return pos[1]; }", "@Override\n\tpublic java.lang.String getPositionCode() {\n\t\treturn _dmGTShipPosition.getPositionCode();\n\t}", "public List<Coordinate> getShipPositions() {\n\t\treturn shipPositions;\n\t}", "int getPos(int xPos, int yPos) {\n\t\treturn yPos * Game.ROWLENGTH + xPos;\n\t}", "public int getX()\r\n {\r\n return xLoc;\r\n }", "Square kingPosition() {\r\n return king;\r\n }", "godot.wire.Wire.Vector2 getX();", "public double getXPos() {\n\t\treturn this.position[0];\n\t}", "public float getX() {\n return pos.x;\n }", "public double smilePos(){\r\n\r\n\t\treturn smile.getY();\r\n\r\n\t}", "public Point getLocation() {\r\n return new Point((int)x,(int)y);\r\n }", "@Override\n public double getPosY() {\n return this.pos[1];\n }", "Object getPosition();", "public int getX() {\r\n return xpos;\r\n }", "int getPosition();", "public Pos getPos()\r\n\t{\r\n\t\treturn position;\r\n\t}", "public Optional<Integer> getPosition() {\n return this.placement.getAlleles().stream()\n .map(p -> p.getAllele().getSpdi().getPosition())\n .findFirst();\n }", "public Point[] getLocation()\n {\n return shipLocation.clone();\n }", "public Vector2F getScreenLocation() {\n\t\treturn new Vector2F(xPos, yPos);\n\t}", "public int getX() {\n return this.coordinate.x;\n }", "public float getInitialBattlePosition()\n {\n return initialBattlePosition;\n }", "public int getPosX() {\n return posX;\n }", "public Ship getShip(){\n return this.ship;\n }", "public int PositionGet();", "Position getPosition();", "Position getPosition();", "public int getPos_x(){\n\t\treturn pos_x;\n\t}", "public int getSpeed() {return ship.getSpeed();}", "public int getLocationX( )\n\t{\n\t\treturn locationX;\n\t}", "int getX() {\n return xPos;\n }", "public Position attackCell() {\n if (this.strategy == null) {\n return null;\n } else {\n return this.strategy.generateAttackPosn(this.battleMap);\n }\n }", "public int getX() {\n\treturn baseXCoord;\n}", "public int getX() {\n return (int) xPos;\n }", "public int getLocX() {\n return locX;\n }" ]
[ "0.66414726", "0.661949", "0.65853286", "0.65853286", "0.6475606", "0.6433899", "0.6417146", "0.64107865", "0.6385716", "0.63819426", "0.636556", "0.6336614", "0.6304589", "0.6302232", "0.63017404", "0.62566346", "0.6235268", "0.6229852", "0.62197363", "0.62139255", "0.6202093", "0.62013364", "0.6189597", "0.61869013", "0.6182047", "0.6170392", "0.6165089", "0.61408514", "0.6140356", "0.6139183", "0.61304885", "0.61260194", "0.61228526", "0.6116517", "0.61120015", "0.61080444", "0.6088378", "0.60792786", "0.6078278", "0.60731024", "0.60567623", "0.60464275", "0.6039262", "0.60385406", "0.6032351", "0.6032033", "0.60265976", "0.6018271", "0.600709", "0.5998952", "0.5997881", "0.59973973", "0.5993185", "0.5987505", "0.5985419", "0.59843284", "0.59750974", "0.5972879", "0.5972879", "0.59723115", "0.5971582", "0.5968498", "0.596755", "0.59639704", "0.5957834", "0.5956065", "0.5955762", "0.5952712", "0.59467727", "0.5944441", "0.5942998", "0.59399563", "0.59396195", "0.5934225", "0.5921067", "0.59146214", "0.5912956", "0.59123975", "0.59119236", "0.59112316", "0.58991945", "0.58990103", "0.5896583", "0.5895698", "0.5894286", "0.5891586", "0.589078", "0.58892465", "0.58870345", "0.5884677", "0.5883891", "0.58796656", "0.58796656", "0.58766496", "0.58731455", "0.58686376", "0.5866507", "0.58651996", "0.5864965", "0.5863158", "0.58579475" ]
0.0
-1
Takes the direction as an argument and checks for validity and sets then sets the direction
public void setDirection(char dir) throws IllegalArgumentException { if (dir == 'N' || dir == 'n'){ this.direction = 'n'; } else if (dir == 'E' || dir == 'e'){ this.direction = 'e'; } else if (dir == 'S' || dir == 's'){ this.direction = 's'; } else if (dir == 'W' || dir == 'w'){ this.direction = 'w'; } else { throw new IllegalArgumentException(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setDirection(double direction) {\n\t\tif (direction <= MAX_DIRECTION && direction >= MIN_DIRECTION) {\n\t\t\tthis.direction = direction;\n\t\t} else if (direction > MAX_DIRECTION) { \n\t\t\t//this.direction = MIN_DIRECTION + (MAX_DIRECTION - direction);\n\t\t\tthis.direction %= MIN_DIRECTION ;\n\t\t\tif (Double.isNaN(this.direction)) {\n\t\t\t\tthis.direction = MIN_DIRECTION;\n\t\t\t}\n\t\t} else if (direction < MIN_DIRECTION) {\n\t\t\t//this.direction = MAX_DIRECTION - (MIN_DIRECTION + direction);\n\t\t\tthis.direction %= MAX_DIRECTION;\n\t\t\tif (Double.isNaN(this.direction)) {\n\t\t\t\tthis.direction = MAX_DIRECTION;\n\t\t\t}\n\t\t} //else if (direction)\n\t\t\n\t}", "public abstract void setDirection(int dir);", "public void setDirection(int dir) {\n if((dir % 10) == 0 && dir <=350 && dir >=0) {\n this.directionDegree = dir; \n } else {\n throw new IllegalArgumentException(\"Direction \" + dir +\" is not valid. Directions must be between 0/350 in multiples of 10\"); \n }\n }", "@Override\n public void setDirection(Direction direction) {\n\n }", "public boolean setDirection(Direction dir) {\n //If a new direction was set but the update wasn't made yet,\n // you cannot change the direction.\n if (!moveMade) {\n return false;\n }\n if (!direction.isValid(dir)) {\n return false;\n }\n prevDir = direction;\n direction = dir;\n moveMade = false;\n return true;\n }", "private void setDirection() {\r\n\t\tif (destinationFloor > initialFloor){\r\n\t\t\tdirection = 1;\r\n\t\t} else {\r\n\t\t\tdirection = -1;\r\n\t\t}\r\n\t}", "public void setDirection(Vector direction){\n\t\t_direction = direction;\n\t}", "public static void setDirection(String direction) {\n if (direction.equals(\"up\")) {\n pacManDirection = up;\n } else if (direction.equals(\"down\")) {\n pacManDirection = down;\n } else if (direction.equals(\"left\")) {\n pacManDirection = left;\n } else {\n pacManDirection = right;\n }\n }", "public void setDirection(float direction)\r\n {\r\n this.direction = direction;\r\n }", "public void setDirection(int dir)\r\n\t{\r\n\t\tdirection = dir;\r\n\t}", "@Test\r\n\tpublic void testSetDirection()\r\n\t{\r\n\t\tIDirectionController directionController = new RadianDirectionControlAdapter(new RadianDirectionControl());\r\n\t\tdirectionController.setCurrentDirection(90.0);\r\n\t\tassertEquals(90.0, directionController.getCurrentDirection(), 0.0);\r\n\t\tdirectionController.setCurrentDirection(390.0);\r\n\t\tassertEquals(30.0, directionController.getCurrentDirection(), 0.0);\r\n\t\tdirectionController.setCurrentDirection(-90.0);\r\n\t\tassertEquals(270.0, directionController.getCurrentDirection(), 0.0);\r\n\t}", "public void setDirection(Direction direction) {\n this.direction = direction;\n update();\n }", "public void setDirectionMove(double direction);", "public Player setDirection(String direction) { //<>// //<>//\n switch (direction) {\n case (\"UP\"):\n this.direction = UPKEY;\n break;\n case (\"DOWN\"):\n this.direction = DOWNKEY;\n break;\n case (\"LEFT\"):\n this.direction = LEFTKEY;\n break;\n case (\"RIGHT\"): //<>//\n this.direction = RIGHTKEY; //<>//\n break;\n }\n //<>//\n return this;\n }", "public void setDirection(Direction direction) {\n this.direction = direction;\n }", "public void setDirection(Direction direction) {\n this.direction = direction;\n }", "public void setDirection(Direction direction) {\n this.direction = direction;\n }", "public void setDirection(Directions direction) {\n\t\tlogic.setDirection(direction);\n\t}", "public void setDirection(int direction) {\r\n\t\tthis.direction = direction;\r\n\t}", "void setDirections(Directions dir){\n this.dir = dir;\n }", "public void setDirection(Vector3f direction) {\r\n\t\tmDirection.set(direction);\r\n\t}", "abstract void setDirection(double x, double y, double z);", "public void setDirection(String direction) {\r\n this.direction = direction;\r\n }", "public boolean setDirection(Direction dir)\n {\n this.dir = dir;\n return true;\n }", "public void setDirection(int value) {\n this.direction = value;\n }", "public void setDirection(String direction) {\n this.direction = direction;\n }", "public void setDirection(int value) {\n this.direction = value;\n }", "public void setDirection(float directionDegree);", "void changeDirection();", "public void setDirection(int direction) {\n/* 172 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "protected void changeDirection(Direction newDir)\n {\n // Change direction.\n myDir = newDir;\n }", "public void directionRestriction(){\n \t\n }", "public void setDirectionOfTravel(typekey.DirectionOfTravelPEL value);", "private void assignDirection(char d) throws InputMismatchException{\n\t\tif(d == NL) {\n\t\t\tdir = NL;\n\t\t}else if(d == NR) {\n\t\t\tdir = NR;\n\t\t}else if(d == SL) {\n\t\t\tdir = SL;\n\t\t}else if(d == SR){\n\t\t\tdir = SR;\n\t\t}else {\n\t\t\tthrow new InputMismatchException(\"There is no such filling direction.\");\n\t\t}\n\t}", "public void changerDirection(int d)\n {\n directionInput = d;\n }", "public void setDirection(byte value) \n\t{\n\t\tdirection = value;\n\t}", "public void setDirection() {\n\t\tdouble randomDirection = randGen.nextDouble();\n\t\tif (randomDirection < .25) {\n\t\t\tthis.xDirection = 1;\n\t\t\tthis.yDirection = -1;\n\t\t} else if (randomDirection < .5) {\n\t\t\tthis.xDirection = -1;\n\t\t\tthis.yDirection = -1;\n\t\t} else if (randomDirection < .75) {\n\t\t\tthis.xDirection = -1;\n\t\t\tthis.yDirection = 1;\n\t\t} else {\n\t\t\tthis.xDirection = 1;\n\t\t\tthis.yDirection = 1;\n\t\t}\n\t}", "public void changeDirection() {\n\t\t// Define the direction we want to change from as our current direction.\n\t\tfinal float oldDirection = this.requiredSwipeDirection;\n\t\t// While our swipe direction is the direction we want to change from,\n\t\twhile (this.requiredSwipeDirection == oldDirection)\n\t\t\t// Set our SwipeTile's direction to a random direction.\n\t\t\tsetDirection(SwipeTile.randomDirection());\n\t}", "public Builder setDirection(int value) {\n bitField0_ |= 0x00000020;\n direction_ = value;\n onChanged();\n return this;\n }", "public void setDirection(boolean positive) {\n setRange(mRangeStart, mRange, positive);\n }", "public void setDirection(){\n\n if (gameStatus != demoPlay)\n client_sb.i_Button = direct;\n\n TankMoveDelay++;\n StarGun_GSR loc=(StarGun_GSR)client_sb.getGameStateRecord();\n\n if (TankMoveDelay >= 1 &&\n loc.getPlayerX() < StarGun_SB.PLAYER_RIGHT_BORDER &&\n\t loc.getPlayerX() > 0) {\n TankMoveDelay = 0;\n switch (direct) {\n\tcase StarGun_SB.DIRECT_LEFT:\n\t if (TankPos==0)TankPos=iTankAmount-1;\n\t else TankPos--;\n\t\t\t\t break;\n case StarGun_SB.DIRECT_RIGHT:\n\t if (TankPos==iTankAmount-1)TankPos=0;\n\t else TankPos++;\n\t\t\t\t break;\n }\n }\n }", "private void setDirection() {\n directionX = corePos.getX() - projectile.getX();\n directionY = corePos.getY() - projectile.getY();\n\n double length = Math.sqrt(directionX*directionX + directionY*directionY);\n\n if (length != 0) {\n directionX = directionX/length;\n directionY = directionY/length;\n }\n }", "private void setMovingDir(Direction dir)\n {\n if(moving != dir)\n {\n \txSpeed = 0;\n \t\n \tSystem.out.println(\"xSpeed = 0\");\n \t\n resetAccelX();\n }\n moving = dir;\n setFacing(dir);\n //System.out.println(\"setMovingDir: \" + dir);\n }", "public void setDirection(double direction) {\n\t\tgyroPid.setSetpoint(direction);\n\t}", "public void changeDirection (int dir) {\n if ((dir == UPKEY || dir == DOWNKEY || dir == RIGHTKEY || dir == LEFTKEY) && validMove(dir))\n {\n direction = dir;\n }\n }", "public void setDirection(Direction direction) {\r\n\t\tif (direction == null){\r\n\t\t\tcreateFeatureNotSupportedEventDirectionIsNull();\r\n\t\t\tthis.direction = new PolarDirection();\r\n\t\t}\r\n\t\tthis.direction = direction;\r\n\t}", "public void getUserInput(int direction) { this.direction = direction; }", "private void turnToDesiredDirection() {\n\n\t\tdouble dir = sens.getDirection();\n\n\t\tif (dir < desiredDirection) {\n\t\t\tif (Math.abs(dir - desiredDirection) < 180) {\n\t\t\t\tdir += TURNSPEED;\n\t\t\t} else {\n\t\t\t\tdir -= TURNSPEED;\n\t\t\t}\n\t\t} else {\n\t\t\tif (Math.abs(dir - desiredDirection) < 180) {\n\t\t\t\tdir -= TURNSPEED;\n\t\t\t} else {\n\t\t\t\tdir += TURNSPEED;\n\t\t\t}\n\t\t}\n\t\t\n\t\tsens.setDirection(dir);\n\t\t\n\t}", "public void setDirectionFrom(Position ep, Position vp) throws InvalidPositionException;", "public void setDirection(String nDirection) {\r\n\t\tthis.direction = nDirection;\r\n\t}", "public Direction()\n {\n dirInDegrees = 0; // default to North\n }", "@JsonSetter(\"direction\")\r\n public void setDirection(String direction) {\r\n this.direction = direction;\r\n }", "public void moveUporDown(int direction)\n\t{\n\t\tif (this.direction == direction || this.direction == -direction)\n\t\t\treturn ;\n\t\tthis.direction = direction;\n\t\tdirx = 0;\n\t\tdiry = 0;\n\t\tif (direction == 1 || direction == -1)\n\t\t\tdirx = direction;\n\t\telse\n\t\t\tdiry = direction / 2;\n\t}", "public static void setDirection(float x, float y) {\n PlayerDirectionSystem.directionX = x;\r\n PlayerDirectionSystem.directionY = y;\r\n }", "public void move(String direction) {\n \n }", "void move(String direction) {\n \tif (direction.equals(\"A\")) { \n \t\tsetXCoord(getXCoord()-getHSpeed());\n \t} else if (direction.equals(\"D\")) {\n \t\tsetXCoord(getXCoord()+getHSpeed());\n \t}\n }", "public Coordinate checkDirection(Direction direction){\r\n\t\treturn new Coordinate(x + direction.getX(), y + direction.getY());\r\n\t}", "void xsetDirection(com.microsoft.schemas.crm._2011.contracts.SearchDirection direction);", "public void changeDirection()\n {\n if(goLeft){\n goLeft = false;\n }else{\n goLeft = true;\n }\n }", "public void setDirection(int direction) {\r\n\t\tsuper.setDirection(direction);\r\n\t\trobotImage.setImage(Constant.ROBOTIMAGEPATHS[direction]);\r\n\t}", "public void setLocation(Direction direction){\n switch (direction) {\n case NORTH:\n location.y = -offset;\n location.x = Constants.GAMEWIDTH / 2;\n break;\n case SOUTH:\n location.y = Constants.GAMEHEIGHT + offset;\n location.x = Constants.GAMEWIDTH / 2;\n break;\n case EAST:\n location.y = Constants.GAMEHEIGHT / 2;\n location.x = Constants.GAMEWIDTH + offset;\n break;\n case WEST:\n location.y = Constants.GAMEHEIGHT / 2;\n location.x = -offset;\n break;\n default:\n\n break;\n }\n }", "public void direction(int dirX, int dirY) {\r\n if (dirX == 1 && dirY == 0) {\r\n this.direction = \"HORI\";\r\n }\r\n else if (dirX == 1 && dirY == -1) {\r\n this.direction = \"RISE\";\r\n }\r\n else if (dirX == 0 && dirY == 1) {\r\n this.direction = \"VERTI\";\r\n }\r\n else {\r\n this.direction = \"FALL\";\r\n }\r\n }", "public void setDirection(Direction direction) {\n\t\t// Set the arrow textures to the new direction's corresponding arrow textures.\n\t\tthis.arrowGreen = SwipeTile.getArrow(game, direction, true);\n\t\tthis.arrowGray = SwipeTile.getArrow(game, direction, false);\n\t\t// Set the required swipe direction to the new direction.\n\t\tsetSwipeRequirement(SwipeTile.createSwipe(direction, requiredSwipeMagnitude));\n\t\t// Refresh the arrow so it uses the new Textures.\n\t\trefreshArrow();\n\t}", "@JsonSetter(\"direction\")\n public void setDirection (String value) { \n this.direction = value;\n }", "public void updateDirection(float dir)\n {\n firstDraw = false;\n direction = dir;\n invalidate();\n }", "public Move(String direction) throws InputException {\n\t\tif(direction.equals(LEFT) || direction.equals(RIGHT))\n\t\t\tthis.direction = direction;\n\t\telse\n\t\t\tthrow new InputException(\"Error: a turing machine can only move left (L) or right (R)\");\n\t}", "public void setDirectionTo(Position ep, Position vp) throws InvalidPositionException;", "public void setTravelDirection(int travelDirection) {\n\t\t//TODO: Should not be any number except 0 - 5\n\t\t/*\n\n\t\t */\n\t\t\n\t\t/*\n\t\t * The user should not be able to set their direction to 180 degrees opposite\n\t\t * If they try to, ignore it, but add it to the logs\n\t\t * Example; Travel Direction = north, user can not set direction to south\n\t\t * Example; Travel Direction = west, user can not set direction to east\n\t\t */\n\t\tthis.travelDirection = travelDirection;\n\t\tlogger.debug(\"TravelDirection set to \" + travelDirection);\n\t}", "boolean isSetDirection();", "Direction(int ID, Place from, Place to, String dir) {\n\t\tthis.ID = ID;\n\t\tthis.from = from;\n\t\tthis.to = to;\n\t\tthis.dir = DirType.valueOf(dir);\t// Use valueOf() to get the enum of it\n\n\t\tlocked = false;\t// All new directions are by default unlocked\n\t}", "private static boolean validDir(double direction) {\r\n\t\treturn multipleOfTen(direction) && withinDirRange(direction);\r\n\t}", "void setDirection(com.microsoft.schemas.crm._2011.contracts.SearchDirection.Enum direction);", "@Override\n public void setFacing(Direction dir)\n {\n facing = dir;\n if(!userHoldingLeftXOrRight)\n {\n setStandingAnim();\n }\n }", "public void move(Direction direction){\r\n if((this.orientation==Orientation.VERTICAL&&\r\n (direction==Direction.RIGHT||direction==Direction.LEFT))||\r\n (this.orientation==Orientation.HORIZONTAL&&\r\n (direction==Direction.UP||direction==Direction.DOWN))){\r\n throw new IllegalArgumentException(\"Move this car is impossible\");\r\n }else{\r\n this.currentPosition.getPosition(direction);\r\n }\r\n }", "@Ignore\r\n @Test\r\n public void testSetDirection() {\r\n System.out.println(\"testSetDirection()\");\r\n Relation instance = new Relation(\"singer\");\r\n instance.setDirection(Relation.OUT);\r\n }", "@Test\r\n public void testSetMovementDirs(){\r\n \r\n SRtest.setLeft(true);\r\n SRtest.setRight(true);\r\n SRtest.setUp(true);\r\n SRtest.setDown(true);\r\n \r\n assertTrue(SRtest.getLeft());\r\n assertTrue(SRtest.getRight());\r\n assertTrue(SRtest.getUp());\r\n assertTrue(SRtest.getDown());\r\n \r\n SRtest.setLeft(false);\r\n SRtest.setRight(false);\r\n SRtest.setUp(false);\r\n SRtest.setDown(false);\r\n \r\n assertFalse(SRtest.getLeft());\r\n assertFalse(SRtest.getRight());\r\n assertFalse(SRtest.getUp());\r\n assertFalse(SRtest.getDown());\r\n \r\n }", "@Raw @Model\r\n\tvoid setDir(Directory dir) {\r\n\t\tthis.dir = dir;\r\n\t\tthis.move(dir);\r\n\t\t\r\n\t}", "boolean checkDir(Directions dir);", "static void changeDirectionBackwards() {\n\n if(--direction == -1)\n direction = 3;\n }", "public void setDirection() {\n frontLeft.setDirection(DcMotorSimple.Direction.REVERSE);\n backLeft.setDirection(DcMotorSimple.Direction.REVERSE);\n frontRight.setDirection(DcMotorSimple.Direction.FORWARD);\n backRight.setDirection(DcMotorSimple.Direction.FORWARD);\n }", "public void move(Direction direction) {\n if (this.orientation == Orientation.HORIZONTAL\n && (direction == Direction.UP\n || direction == Direction.DOWN)) {\n throw new IllegalArgumentException(\n \"Car oriented horizontally, invalid direction.\");\n } else if (this.orientation == Orientation.VERTICAL\n && (direction == Direction.LEFT\n || direction == Direction.RIGHT)) {\n throw new IllegalArgumentException(\n \"Car oriented vertically, invalid direction.\");\n }\n\n this.currentPosition = this.currentPosition.getPosition(direction);\n }", "@NotNull\n void move(Direction direction) {\n this.position.move(direction);\n lookingDirection = direction;\n }", "public Door(Direction direction){\n this.direction=direction;\n location=new PointF();\n setLocation(direction);\n rect = new RectF(location.x - size, location.y - size, location.x + size, location.y + size);\n }", "public void setCurrentDirection(ElevatorStatus currentDirection) {\n\t\tthis.currentDirection = currentDirection;\n\t}", "public Vec4 expectDirection() {\n if(isPoint()) throw new IllegalArgumentException(\"expected direction: \" + this);\n return this;\n }", "public void changeDirection(Direction direction) {\n\t\tstate.updateDirection(direction);\n\t}", "void onDirectionChanged(Direction direction);", "void setLeftToRight(boolean ltor);", "private void setMainTankDir() {\n Dir dir = myTank.getDir();\n\n if(!bL&&!bU&&!bR&&!bD){\n myTank.setMoving(false);\n Client.INSTANCE.send(new TankStopMsg(getMyTank()));\n }else {\n if (bL) myTank.setDir(Dir.LEFT);\n if (bU) myTank.setDir(Dir.UP);\n if (bR) myTank.setDir(Dir.RIGHT);\n if (bD) myTank.setDir(Dir.DOWN);\n if (bL && bU) myTank.setDir(Dir.LEFT_UP);\n if (bL && bD) myTank.setDir(Dir.LEFT_DOWN);\n if (bR && bU) myTank.setDir(Dir.RIGHT_UP);\n if (bR && bD) myTank.setDir(Dir.RIGHT_DOWN);\n if(!myTank.isMoving())\n Client.INSTANCE.send(new TankStartMovingMsg(getMyTank()));\n myTank.setMoving(true);\n\n if(dir != myTank.getDir()) {\n Client.INSTANCE.send(new TankDirChangedMsg(myTank));\n }\n }\n }", "default void setDirection(Vector3 v) {\r\n setDirection(v.getX(), v.getY(), v.getZ());\r\n }", "public void setDir(Vector2 dirVec) {\n this.dirVec = dirVec;\n // Travelling horizontally\n if (dirVec.x == 0) {\n setAngle(Math.PI);\n }\n else {\n setAngle(Math.PI/2);\n }\n }", "private void fixDirections() {\n\t\tdouble sensDir = sens.getDirection();\n\t\tif (sensDir > 360) {\n\t\t\tsensDir -= 360;\n\t\t} // Rotate back around to keep it tidy\n\t\telse if (sensDir < 1) {\n\t\t\tsensDir += 360;\n\t\t}\n\t\tsens.setDirection(sensDir);\n\n\t\tif (desiredDirection > 360) {\n\t\t\tdesiredDirection -= 360;\n\t\t} // Rotate back around to keep it tidy\n\t\telse if (desiredDirection < 1) {\n\t\t\tdesiredDirection += 360;\n\t\t}\n\t}", "public Place followDirection ( String checkDirection)\r\n\t{\t\r\n\t\t for( int i=0; i < directions.size(); i++)\r\n\t\t {\r\n\t\t\t if( directions.get(i).match( checkDirection))\r\n\t\t\t {\r\n\t\t\t\t // If direction matches with direction object's direction, now again check that if the door is unlocked or not. \r\n\t\t\t\t return directions.get(i).follow();\r\n\t\t\t\t \r\n\t\t\t }\r\n\t\t } \r\n\t\t System.out.println (\"There is no direction from this DOOR....OH No, You are stuck at this Current Place:\" + this.name());\r\n\t\t return this;\r\n\t}", "private boolean checkDirection(PositionTracker tracker, int direction){\n\n\t boolean validFlag = false;\n\n\t switch(direction){//initiate switch statement, checking the value of direction\n\n\t //enter case 1 and invoke the checkMoveNext method\n\t case 1:\tvalidFlag = this.checkMoveNext(tracker);\n\t \t\t\tbreak;\n\n\t //enter case 2 and invoke the checkMovePrevious method\n\t case 2:\tvalidFlag = this.checkMovePrevious(tracker);\n\t \t\t\tbreak;\n\n\t \t}//end switch\n\n\t return validFlag;\n\t }", "public void direction()\n {\n if(!goLeft){\n horzVelocity = 1;\n }else{\n horzVelocity = -1;\n }\n }", "public void setCurrentDirection(int currentDirection) {\r\n this.currentDirection = currentDirection;\r\n }", "public InputDirection(InputMethod method, Direction direction) {\n this.direction = direction;\n this.method = method;\n }", "private void goDirection(Command command) {\n String direction = command.getFirstParameter();\n Room nextRoom = currentRoom.nextRoom(direction);\n\n // try to leave current room\n if (nextRoom == null) {\n System.out.println(\"There is no door!\");\n } else {\n currentRoom = nextRoom;\n }\n }", "public void move(String direction);", "public void faceDirection(Vector direction) {\n \tVector originalFaceDirection = new Vector(0,0,-1);\n \t\n \tfloat angle;\n \t\n \tif (direction.size() == 0)\n \t\tangle = 0;\n \telse\n \t\tangle = (float)Math.toDegrees( direction.angleBetween(originalFaceDirection) );\n \t\n \tVector orientation = player.getOrientation();\n \tplayer.setOrientation( angle , orientation.y(), orientation.z());\n }" ]
[ "0.7889339", "0.7592094", "0.7382291", "0.73481864", "0.72258425", "0.7206741", "0.7168206", "0.713036", "0.7114941", "0.70870805", "0.7070447", "0.7011955", "0.694994", "0.6947363", "0.69455975", "0.69455975", "0.69455975", "0.69134897", "0.6873748", "0.6862667", "0.68256503", "0.6799524", "0.67743766", "0.67561245", "0.67343223", "0.6694795", "0.66281945", "0.65913945", "0.6565839", "0.65536356", "0.65335613", "0.65328294", "0.6505981", "0.64971447", "0.649485", "0.6468116", "0.6403927", "0.63885945", "0.6386136", "0.63572377", "0.6351446", "0.63426805", "0.63415927", "0.62819165", "0.6270151", "0.6267885", "0.6258747", "0.62376255", "0.623474", "0.6214654", "0.6203788", "0.61793584", "0.6171916", "0.6167419", "0.6165102", "0.6143027", "0.6133379", "0.6113121", "0.60881335", "0.60717064", "0.6070838", "0.60635436", "0.60623467", "0.60572743", "0.60479784", "0.604429", "0.603223", "0.60269207", "0.60259753", "0.6021753", "0.60119593", "0.60062015", "0.60054284", "0.60004294", "0.59952015", "0.5965991", "0.59502906", "0.59352136", "0.59335035", "0.59207535", "0.5919036", "0.5915213", "0.5908817", "0.5902409", "0.5888177", "0.587366", "0.586743", "0.5851628", "0.58311737", "0.58306134", "0.5824982", "0.58241105", "0.5819053", "0.5800028", "0.5797928", "0.57965106", "0.57819366", "0.57759386", "0.5735069", "0.5715235" ]
0.7083529
10
Returns the direction of the ship, in lower case
public char getDirection(){ return direction; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getDirection();", "public String getDirection(){\n\t\tif(this.toRight)\n\t\t\treturn \"RIGHT\";\n\t\telse\n\t\t\treturn \"LEFT\";\n\t}", "public String getDirection() {\n return this.direction;\n }", "public String getDirection() {\r\n return direction;\r\n }", "int getDirection();", "public String getDirection() {\n return direction;\n }", "public String getDirection() {\n\t\treturn this.direction;\n\t}", "private String getUserDirection() {\n System.out.println(\"Which direction do you want to go?\\n>>>\");\n String direction = sc.nextLine().toLowerCase();\n return direction;\n }", "public float getDirection();", "public int getDirection();", "public void direction(int dirX, int dirY) {\r\n if (dirX == 1 && dirY == 0) {\r\n this.direction = \"HORI\";\r\n }\r\n else if (dirX == 1 && dirY == -1) {\r\n this.direction = \"RISE\";\r\n }\r\n else if (dirX == 0 && dirY == 1) {\r\n this.direction = \"VERTI\";\r\n }\r\n else {\r\n this.direction = \"FALL\";\r\n }\r\n }", "default Vector3 getDirection() {\r\n return Vector3.fromXYZ(getDirX(), getDirY(), getDirZ());\r\n }", "public Vector getDirection(){\n\t\treturn new Vector(_direction);\n\t}", "public Direction getDirection()\n {\n return dir;\n }", "public float getDirection()\r\n {\r\n return direction;\r\n }", "public int getDirection()\r\n\t{\r\n\t\treturn direction;\r\n\t}", "public java.lang.String getDirectionname() {\n\treturn directionname;\n}", "public static String stringFromDirection(int dir) {\n return dir == 0 ? \"NORTH\" : dir == 1 ? \"EAST\" : dir == 2 ? \"SOUTH\" : dir == 3 ? \"WEST\" : \"NONSENSE\";\n }", "public int getDirection() {\n return direction_;\n }", "private DominoInKingdom.DirectionKind getDirection(String dir) {\n switch (dir) {\n case \"up\":\n return DominoInKingdom.DirectionKind.Up;\n case \"down\":\n return DominoInKingdom.DirectionKind.Down;\n case \"left\":\n return DominoInKingdom.DirectionKind.Left;\n case \"right\":\n return DominoInKingdom.DirectionKind.Right;\n default:\n throw new java.lang.IllegalArgumentException(\"Invalid direction: \" + dir);\n }\n }", "protected final Direction getDirection() {\n\t\treturn tile.getDirection();\n\t}", "public int getDirection() {\n return direction;\n }", "public abstract int getDirection();", "public int getDirection() {\n return direction;\n }", "public int getDirection() {\n return direction;\n }", "public int getDirection() {\r\n\t\treturn direction;\r\n\t}", "public double direction(){\n return Math.atan2(this.y, this.x);\n }", "private static String getXadlDirection(Direction direction) {\n\t\tString strDirection = null;\n\t\tswitch (direction) {\n\t\tcase IN:\n\t\t\tstrDirection = \"in\";\n\t\t\tbreak;\n\t\tcase OUT_MULTI:\n\t\tcase OUT_SINGLE:\n\t\t\tstrDirection = \"out\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tstrDirection = \"none\";\n\n\t\t}\n\n\t\treturn strDirection;\n\t}", "public byte getDirection() {\n return this.direction;\n }", "public byte getDirection() {\n return this.direction;\n }", "public byte getDirection() {\n\t\treturn direction;\n\t}", "public Direction direction()\n {\n return myDir;\n }", "public CS getDirectionCode() { return _directionCode; }", "public int getDirection() {\n return direction_;\n }", "public Direction getDirection() {\n return direction;\n }", "public Direction getDirection() {\n return direction;\n }", "public Direction getDirection() {\n return direction;\n }", "public java.lang.String getDirection1() {\r\n return direction1;\r\n }", "public double getDirectionMove();", "@Generated\n @Selector(\"direction\")\n @ByValue\n public native CGVector direction();", "public Direction getDirection() {\r\n\t\treturn direction;\r\n\t}", "public Direction getMove(){\n\t\tif (diam < 3){\n\t\t\tdiam++;\n\t\t\tjustnow = \"east\";\n\t\t\treturn Direction.EAST;\n\t\t}\n\t\telse if (diam < 6){\n\t\t\tdiam++;\n\t\t\tjustnow = \"south\";\n\t\t\treturn Direction.SOUTH;\n\t\t}\n\t\telse if (diam < 9){\n\t\t\tdiam++;\n\t\t\tjustnow = \"west\";\n\t\t\treturn Direction.WEST;\n\t\t}\n\t\telse if (diam < 12){\n\t\t\tdiam++;\n\t\t\tjustnow = \"north\";\n\t\t\treturn Direction.NORTH;\n\t\t}\n\t\telse {\n\t\t\tdiam = 0;\n\t\t\tdiam++;\n\t\t\tjustnow = \"east\";\n\t\t\treturn Direction.EAST;\n\t\t}\t\n\t}", "public Direction getDirection()\n\t{\n\t\treturn this.direction;\n\t}", "public Direction getDirect() {\n \tif(xMoving && yMoving){\n \t\tif(right && down)\n \t\t\tdir = Direction.SOUTHEAST;\n \t\telse if(right && !down)\n \t\t\tdir = Direction.NORTHEAST;\n \t\telse if(!right && down)\n \t\t\tdir = Direction.SOUTHWEST;\n \t\telse\n \t\t\tdir = Direction.NORTHWEST;\n \t}\n \telse if(xMoving){\n \t\tdir = right ? Direction.EAST : Direction.WEST;\n \t}\n \telse if(yMoving){\n \t\tdir = down ? Direction.SOUTH : Direction.NORTH;\n \t}\n \treturn dir;\n }", "public DirectionEnum getDirection() {\n return direction;\n }", "public Direction getDirection() {\n\t\treturn direction;\n\t}", "public void direction()\n {\n if(!goLeft){\n horzVelocity = 1;\n }else{\n horzVelocity = -1;\n }\n }", "@JsonGetter(\"direction\")\n public String getDirection ( ) { \n return this.direction;\n }", "public final Vector3f getDirection() {\r\n return direction;\r\n }", "@JsonGetter(\"direction\")\r\n public String getDirection() {\r\n return direction;\r\n }", "EChannelDirection direction();", "@Override\n\tpublic String getDirection(List<String> path) {\n\n\t\tString nextMove = path.get(path.size() - 1);\n\t\tif (nextMove.equals(\"TOP\")) {\n\t\t\treturn \"DOWN\";\n\t\t} else if (nextMove.equals(\"DOWN\")) {\n\t\t\treturn \"TOP\";\n\t\t} else if (nextMove.equals(\"LEFT\")) {\n\t\t\treturn \"RIGHT\";\n\t\t} else if (nextMove.equals(\"RIGHT\")) {\n\t\t\treturn \"LEFT\";\n\t\t}\n\t\treturn \"\";\n\t}", "public Vector3d getDirection() { return mDirection; }", "public Enums.Direction getDirection() {\n return direction;\n }", "public MoveDirection getDirection() {\n\t\treturn direction;\n\t}", "public String toString() {\n\t\treturn \"Missile Launcher dir = \" + this.getDirection();\n\t}", "public Vector3f getDirection() {\r\n\t\treturn new Vector3f(mDirection);\r\n\t}", "public ForgeDirection toForgeDirection()\n {\n for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS)\n {\n if (this.x == direction.offsetX && this.y == direction.offsetY && this.z == direction.offsetZ)\n {\n return direction;\n }\n }\n\n return ForgeDirection.UNKNOWN;\n }", "public Direction getDirection() {\n return currentDirection;\n }", "@Basic\r\n\tpublic Direction getDirection()\r\n\t{\r\n\t\treturn this.direction;\r\n\t}", "Directions getDirections(){\n return this.dir;\n }", "public static String getDirection(Node A, Node B){\r\n if ((A == null)||(B == null))\r\n return \"\";\r\n Point first = A.getSpace();\r\n Point second = B.getSpace();\r\n if ((int)first.getX()>(int)second.getX())\r\n return \"N\";\r\n if ((int)first.getX()<(int)second.getX())\r\n return \"S\";\r\n if ((int)first.getY()>(int)second.getY())\r\n return \"W\";\r\n else\r\n return \"E\";\r\n }", "public Direction getCorrectRobotDirection();", "public String getBound() {\n\t\tif (direction.equals(\"S\"))\n\t\t\treturn \"sur\";\n\t\telse if (direction.equals(\"N\"))\n\t\t\treturn \"norte\";\n\t\telse if (direction.equals(\"W\"))\n\t\t\treturn \"oeste\";\n\t\telse\n\t\t\treturn \"este\";\n\t}", "public void getDirection (float xDir, float yDir){\n this.xDir = xDir;\n this.yDir = yDir;\n }", "public Direction toLeft()\n {\n return new Direction(dirInDegrees - (FULL_CIRCLE / 4));\n }", "com.microsoft.schemas.crm._2011.contracts.SearchDirection xgetDirection();", "@AutoEscape\n\tpublic String getRequestDirection();", "public Bearing getLeftNeighbour() {\n return this == N || this == S ? W : N;\n }", "public char getFillingDirection() {\n\t\treturn dir;\n\t}", "public String getWindDirection() {\n\t\treturn windDirection;\n\t}", "public String getWindDirection() {\n\t\treturn windDirection;\n\t}", "public void setDirection(String nDirection) {\r\n\t\tthis.direction = nDirection;\r\n\t}", "void changeDirection();", "public com.cognos.developer.schemas.raas.Returns__by__Order__Method___x002d__Prompted__Chart.TextDirectionEnum getDirection() {\r\n return direction;\r\n }", "public static String findDirection(XYLocation initial, XYLocation goingTo) {\n\t\tfloat goingToX = goingTo.getX();\n\t\tfloat goingToY = goingTo.getY();\n\t\tfloat initialX = initial.getX();\n\t\tfloat inititalY = initial.getY();\n\t\tfloat theta = (float) Math.atan2(goingToY - inititalY, goingToX - initialX);\n\t\t\n\t\tif (Math.abs(theta) <= oneEighthPI && Math.abs(theta) >= negOneEighthPI) {\n\t\t\t\treturn \"East\";\n\t\t\t} else if (theta > oneEighthPI && theta < threeEighthsPI) {\n\t\t\t\treturn \"SouthEast\";\n\t\t\t} else if (theta > negThreeEighthsPI && theta < negOneEighthPI) {\n\t\t\t\treturn \"NorthEast\";\n\t\t\t} else if (theta > threeEighthsPI && theta < fiveEighthsPI) {\n\t\t\t\treturn \"South\";\n\t\t\t} else if (theta > negFiveEighthsPI && theta < negThreeEighthsPI){\n\t\t\t\treturn \"North\";\n\t\t\t} else if (theta > fiveEighthsPI && theta < sevenEighthsPI) {\n\t\t\t\treturn \"SouthWest\";\n\t\t\t} else if (theta > negSevenEighthsPI && theta < negFiveEighthsPI) {\n\t\t\t\treturn \"NorthWest\";\n\t\t\t} else {\n\t\t\t\treturn \"West\";\n\t\t\t}\n\t}", "@Field(13) \n\tpublic byte Direction() {\n\t\treturn this.io.getByteField(this, 13);\n\t}", "@gw.internal.gosu.parser.ExtendedProperty\n public typekey.DirectionOfTravelPEL getDirectionOfTravel();", "@Schema(description = \"Indicates the threshold crossing direction: up or down.\")\n\n\tpublic String getDirection() {\n\t\treturn direction;\n\t}", "public Movement getDir() {\n\t\treturn dir;\n\t}", "public Directions getDirectionsOfHits() {\n\t\tList<Coordinate> woundPositions = getWoundPositions();\n\t\tif (woundPositions.get(0).getxPosition() == woundPositions.get(1).getxPosition())\n\t\t\treturn Directions.NORTH;\n\t\telse\n\t\t\treturn Directions.WEST;\n\t}", "private String getDirectionAnt(Board inputBoard, String antName) {\nString dir = \"\";\nfor (int p = 0; p < inputBoard.getAntsOnBoard().size(); p++) {\nif (antName.equalsIgnoreCase(inputBoard.getAntsOnBoard().get(p).getName())) {\ndir = inputBoard.getAntsOnBoard().get(p).getDirection();\n}\n}\nif (dir.isEmpty()) {\nTerminal.printError(\"This ant is not on board\");\n}\nreturn dir;\n}", "public java.lang.Integer getDirectioncode() {\n\treturn directioncode;\n}", "public String getDirectionMove() {\n\t\treturn directionMove;\n\t}", "public Transaction.DirectionType getDirection() {\n\t\treturn direction;\n\t}", "@Override\n\tpublic Direction getMove() {\n if (ticks < MAX_TICKS_PER_ROUND - 100) {\n Direction[] dirs = Direction.values();\n return dirs[random.nextInt(dirs.length)];\n } else {\n // Move towards boat\n int deltaX = 0;\n int deltaY = 0;\n if (currentLocation.getX() < 0)\n deltaX = 1;\n else if (currentLocation.getX() > 0)\n deltaX = -1;\n\n if (currentLocation.getY() < 0)\n deltaY = 1;\n else if (currentLocation.getY() > 0)\n deltaY = -1;\n\n if (deltaX > 0 && deltaY == 0) {\n return Direction.E;\n } else if (deltaX > 0 && deltaY > 0) {\n return Direction.NE;\n } else if (deltaX > 0 && deltaY < 0) {\n return Direction.SE;\n } else if (deltaX == 0 && deltaY == 0) {\n return Direction.STAYPUT;\n } else if (deltaX == 0 && deltaY < 0) {\n return Direction.N;\n } else if (deltaX == 0 && deltaY > 0) {\n return Direction.S;\n } else if (deltaX < 0 && deltaY == 0) {\n return Direction.W;\n } else if (deltaX < 0 && deltaY > 0) {\n return Direction.NW;\n } else if (deltaX < 0 && deltaY < 0) {\n return Direction.NE;\n } else {\n throw new RuntimeException(\"I HAVE NO IDEA\");\n }\n }\n\t}", "public int getCurrentDirection() {\r\n return currentDirection;\r\n }", "public java.lang.String getDirection2() {\r\n return direction2;\r\n }", "public static Direction selectDirection() {\n return Direction.values()[randomDirection()];\n }", "public Direction directionVers(Lutin lutin) {\n return coord.directionsVers(lutin.coord).get(0);\n\n }", "public Direction getDirection(float x1, float y1, float x2, float y2){\n double angle = getAngle(x1, y1, x2, y2);\n return Direction.fromAngle(angle);\n }", "public final String getTextDirectionAttribute() {\n return getAttributeValue(\"dir\");\n }", "@SlideDirection\n public int getDirection() {\n return mImpl.getDirection().getNumber();\n }", "@SlideDirection\n public int getDirection() {\n return mImpl.getDirection().getNumber();\n }", "public void setDirection(String direction) {\r\n this.direction = direction;\r\n }", "public double getDirectionView();", "public DIRECTION getDirection(int index) {\n if (gameData.charAt(index) == 'L') {\n return DIRECTION.LEFT;\n } else if (gameData.charAt(index) == 'R') {\n return DIRECTION.RIGHT;\n } else {\n System.out.println(\"GameData.getDirection: ERROR GETTING DIRECTION!!!!\");\n }\n return null;\n }", "public Direction getStartDirection() {\n return f_startDirection;\n }", "public Direction sideSymm(Direction dir) {\n return new Direction(-1 * dir.xDist(), dir.yDist(), dir.length());\n }", "public void reverseDirection() {\n\t\tdirection *= -1;\n\t\ty += 10;\n\t}" ]
[ "0.7397278", "0.68103534", "0.66412306", "0.66397506", "0.66171557", "0.66137445", "0.6515727", "0.6478717", "0.6466164", "0.6451282", "0.6377158", "0.6348123", "0.62851876", "0.62219346", "0.62121755", "0.61858916", "0.61739814", "0.61166847", "0.6099289", "0.6076696", "0.607663", "0.6073065", "0.6070203", "0.60686725", "0.60686725", "0.6055641", "0.605276", "0.60371166", "0.6030398", "0.6030398", "0.6024976", "0.60235", "0.60206753", "0.5997867", "0.59829605", "0.59829605", "0.59829605", "0.5979426", "0.59768015", "0.5972816", "0.59589845", "0.5941316", "0.5928129", "0.5927377", "0.5923204", "0.5911622", "0.58929354", "0.5890669", "0.58814174", "0.5874956", "0.5871154", "0.58619934", "0.58614427", "0.5844509", "0.583547", "0.58315134", "0.5830048", "0.5795865", "0.57895094", "0.5754744", "0.5729602", "0.568867", "0.5680322", "0.5679895", "0.56486815", "0.564455", "0.56413966", "0.56392604", "0.5634002", "0.56148726", "0.5603444", "0.5603444", "0.55799496", "0.55746084", "0.5571405", "0.55678535", "0.55644524", "0.5543173", "0.55391455", "0.5528191", "0.5525636", "0.5515286", "0.5513143", "0.5512364", "0.55107415", "0.54879344", "0.5484778", "0.548344", "0.5450516", "0.5443338", "0.543947", "0.5434469", "0.54338336", "0.54338336", "0.54289216", "0.5423947", "0.5423812", "0.54190624", "0.5418988", "0.5404957" ]
0.65668297
6
Takes no argument and sets the damage of each block to 1 (untouched)
public void resetDamage(int maxDamage){ this.maxHealth = maxDamage; this.shipDamage = new int[this.shipSize]; for (int i = 0; i < this.shipDamage.length; i++){ this.shipDamage[i] = maxDamage; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void applyDamage(int damage)\r\n\t{\r\n\r\n\t}", "private void takeDamage(int damage){ health -= damage;}", "@Override\r\n\tpublic void damage(float amount) {\n\t\t\r\n\t}", "public void setBorderDamagePerBlock(double damage)\n {\n borderDamagePerBlock = damage;\n }", "public void takeDamage(int damage);", "public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) {}", "protected void takeDamage(int damage)\n {\n health = health - damage;\n \n }", "public void damage(int amount) {\n \tshield = shield - amount;\n }", "public void specialize()\n {\n\tdef -= 200;\n\tdmg += 0.5;\n\tcounter += 1;\n }", "public void takeDamage(double damage){\n damage -= this.armor;\n this.health -= damage;\n }", "@Override\n\tpublic void damage(float f) {\n\t\t\n\t}", "public void damaged() {\n this.damageState = DamageState.DAMAGED;\n }", "public void resetDamages() {\n damages = new ArrayList<>();\n }", "public void takeDamage(int damage) {\n this.damageTaken += damage;\n }", "private void damage(){\n\n LevelMap.getLevel().damage(dmg);\n //System.out.println(\"died\");\n setDie();\n }", "private void subtractEnemySheild(int damage) {\n this.enemyShield -= damage;\n }", "public void reduceHealth(int damage){\n health -= damage;\n }", "public void takeDamage(int damage) {\r\n this.health -= damage;\r\n if(this.health < 0)\r\n this.health = 0;\r\n }", "public int giveDamage();", "void takeDamage(int points) {\n this.health -= points;\n }", "public void normalize()\n {\n\tdef += 200*counter;\n\tdmg -= 0.5*counter;\n\tcounter = 0;\n }", "public void setDamage(int damage) {\n\t\tWeapon.itemDamage = damage;\n\t}", "public void takeDamage(int damage) {\n\t\tlife = (life-damage<0)?0:life-damage;\n\t}", "public void setDamage(int damage) {\r\n\t\tthis.damage = damage;\r\n\t}", "public void specialEffect() {\n if (getDefense() > 0) {\n setDefense(0);\n setCurrentHealth(currentHealth + 50);\n }\n\n }", "private void subtractPlayerSheild(int damage) {\n this.playerShield -= damage;\n }", "public void setDamage() {\n\t\tRandom rand = new Random();\n\t\tint damage = rand.nextInt(getMaxDamage()) + 1;\n\t\tthis.damage = damage;\n\t}", "public void suffer(int damage){\r\n\t\thp -= damage;\r\n\t\tinvulnerable = true;\r\n\t}", "@Override\n\tpublic void takeDamage(double damage) {\n\n\t}", "public void setHungerDamage(float hunger);", "public void reduceHealth(int ammo_damage){\n this.health -= ammo_damage;\n }", "public Builder setDamage(int value) {\n bitField0_ |= 0x00000200;\n damage_ = value;\n onChanged();\n return this;\n }", "public void takeAttack(int damage) {\r\n if(this.evasion > 0)\r\n this.evasion--;\r\n else\r\n this.takeDamage(damage);\r\n }", "public void takeDamage(int amount){\r\n\t\tthis.life = this.life - amount;\r\n\t}", "public void takeDamage(int dmg){\r\n this.currHP -= dmg;\r\n }", "public void damage(int damageTaken) {\n //TODO: Create specific damage methods instead of damage calls everywhere(see damagedByBullet())\n if (!invincible) {\n this.hp -= damageTaken;\n }\n }", "public Builder setDamage(int value) {\n bitField0_ |= 0x00000400;\n damage_ = value;\n onChanged();\n return this;\n }", "public Builder setDamage(int value) {\n bitField0_ |= 0x00000400;\n damage_ = value;\n onChanged();\n return this;\n }", "public Builder setDamage(int value) {\n bitField0_ |= 0x00000080;\n damage_ = value;\n onChanged();\n return this;\n }", "public Builder setDamage(int value) {\n bitField0_ |= 0x00000400;\n damage_ = value;\n onChanged();\n return this;\n }", "public void takeDamage(int damage) {\r\n health -= damage;\r\n if(health<=0)setAlive(false);\r\n }", "public void damageDevice() {\n\t\t\r\n\t}", "public void damagePlayer(int damage){\n hero.decreaseHp(damage);\n }", "void damagePlayer(int i) throws IOException {\n }", "public void beAttacked(int damage) {\r\n\t\tif (health > damage) {\r\n\t\t\thealth -= damage;\r\n\t\t}else {\r\n\t\t\thealth = 0;\r\n\t\t}\r\n\t}", "public void setDamage(int d) {\r\n this.damage = d;\r\n }", "public void setBowDamage(short bowDamage);", "@Override\n\tpublic int calculateDamage() \n\t{\n\t\t// TODO Auto-generated method stub\n\t\treturn 0;\n\t}", "public void takeDamage(int damage){\n\t\thealth -= damage;\n\t\tif(health<= 0) {\n\t\t\tspawnNew();\n\t\t}\n\t}", "void inflictDamage(double amount) {\r\n if (amount < 0) // shouldn't happen\r\n return;\r\n damage = Math.min(MAX_DAMAGE, damage + amount);\r\n if (damage == MAX_DAMAGE)\r\n setIsAlive(false);\r\n }", "public void hurt(int damage)\n {\n \t hp -= (damage - ( damage * armor / 100 ));\n \t //System.out.println(\"hp: \" + hp);\n }", "public void inflictDamage(float damage) {\r\n \t\tif(!isInvincible) {\r\n \t\t\thealth -= damage;\r\n \t\t}\r\n \t\tif(health <= 0) {\r\n \t\t\tisDead = true;\r\n \t\t}\r\n \t}", "@Override\n public int doDamage() {\n if (difficulty <5)\n return damage;\n else \n return damage*2;\n }", "boolean takeDamage(DamageCount damage);", "@Override\r\n public void setDead()\r\n {\r\n if (!worldObj.isRemote && !this.isDead)\r\n {\r\n if (blocks != null)\r\n {\r\n for (ItemStack[][] barrarr : blocks)\r\n {\r\n for (ItemStack[] barr : barrarr)\r\n for (ItemStack b : barr)\r\n {\r\n if (b != null) this.entityDropItem(b, 0.5f);\r\n }\r\n }\r\n if (this.getHeldItem() != null) this.entityDropItem(getHeldItem(), 1);\r\n }\r\n }\r\n super.setDead();\r\n }", "public Shot(int damage) {\n\t\tthis.damage = damage;\n\t}", "public void repair(){\n if(health < 9) {\n this.health++;\n }\n }", "@Override\n public void hit(int damage)\n {\n state.hit(damage, this);\n }", "public void buyDecreaseDamage() {\n this.decreaseDamage++;\n }", "@Override\n public int damage(){\n int damage = 0;\n Random rand = new Random();\n int x = rand.nextInt(20) + 1;\n if (x == 1)\n damage = 50;\n return damage; \n }", "@Override\r\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\tfor (Damage damage : actionAttack.damages) {\r\n\t\t\t\t\t\t\t\tBattlerSprite attacked = damage.target.getTag();\r\n\t\t\t\t\t\t\t\tattacked.takeHit(damage.damage);\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}", "@Override\n public void attackedByShaman(double attack) {\n damageCounter += (2 * attack) / 3;\n this.attack = Math.max(this.attack - (2 * attack) / 3, 0);\n }", "public void baptism() {\n for (Card targetCard : Battle.getInstance().getActiveAccount().getActiveCardsOnGround().values()) {\n if (targetCard instanceof Minion) {\n targetCard.setHolyBuff(2, 1);\n }\n }\n }", "public void setHandThrowDamage(short handThrowDamage);", "@Override\n public int damage() {\n int newDamage=criticalStrike();\n return newDamage;\n }", "public void takeDamage(int dmg) {\n\t\thealth -= dmg;\n\t}", "@Override\n protected int strengthViability(Creature c){\n int baseViability = super.strengthViability(c);\n if (Elements.elementDamageMultiplier(c,bossFormation.getFrontCreature().getElement()) > 1){\n baseViability = (int)(baseViability * (double)Elements.DAMAGE_BOOST * 3);\n }\n if (Elements.elementDamageMultiplier(bossFormation.getFrontCreature(),c.getElement()) > 1){\n baseViability = (int)(baseViability * (double)Elements.DAMAGE_BOOST / 3);\n }\n return baseViability;\n }", "boolean takeDamage(int dmg);", "public void applyDamage(int damage)\n\t{\n\t\tthis.currHP -= damage;\n\t\tif(currHP <= 0)\n\n\t\t{\n\t\t\tthis.currHP = 0;\n\t\t\tthis.kill();\n\t\t}\n\t\t\t\n\t}", "int getDamage();", "int getDamage();", "int getDamage();", "int getDamage();", "int getDamage();", "private void subtractEnemyHealth(int damage) {\n this.enemyShipHealth -= damage;\n }", "public void takedmg(int dmg){\n curHp -= dmg;\n }", "protected void setItemDamage(Material material, int damage) \r\n\t{\tthis.itemDamage.put(material, damage);\t}", "public void takeDamage(double num) {\r\n \r\n int damage = (int)Math.round(num);\r\n this.health -= damage;\r\n this.state=this.color+16;\r\n if (damage <= 5) {\r\n if (this.playerNum == 1)\r\n this.positionX -= 40;\r\n else \r\n this.positionX += 40;\r\n }\r\n else if (this.playerNum == 1)\r\n this.positionX -= damage * 6;\r\n else\r\n this.positionX += damage * 6;\r\n \r\n }", "public void setDamage(double damage) {\r\n\t\tthis.damage = damage;\r\n\t}", "public void receiveDamage(double damage) {\r\n health = health - damage;\r\n }", "public int setDamage(int damage) {\n\t\tthis.damage = damage;\n\t\treturn 0;\n\t}", "private void fullRepaired() { //full life\n this.active = true;\n this.damageState = DamageState.FULL;\n }", "public void incrementBlock(Fighter f1)\r\n {\r\n if(f1.getBlocking() == 1) //if the fighter is blocking\r\n {\r\n if(f1.getBlockT() == 20) //if 20 frames have passed\r\n {\r\n \r\n f1.setBlockT(0); //reset timer\r\n f1.setBlocking(2); //set fighter to cooldown\r\n }else\r\n {\r\n f1.setBlockT(f1.getBlockT() + 1); //increment timer\r\n }\r\n }\r\n \r\n if(f1.getBlocking() == 2) //if the fighter is in cooldown\r\n {\r\n if(f1.getBlockT() == 240) //if 240 frames have passed\r\n {\r\n f1.setBlockT(0); //reset timer\r\n f1.setBlocking(0); //set fighter to can block\r\n }\r\n else\r\n {\r\n f1.setBlockT(f1.getBlockT() + 1); //increment timer\r\n }\r\n }\r\n }", "void decreaseHealth(Float damage);", "public Blocks(int h)\n {\n health=h;\n worth=h;\n setImage(colors[health-1]);\n }", "public InaccurateAttackEffect() {\n\t\tsuper(Effect.Target.OPPONENT, Effect.FLIP_COIN);\n\t\tthis.numberOfHits = 1;\n\t\tthis.hitsPerEnergy = Effect.BOOL_NOT_USED;\n\t\tthis.hitsIndefinitely = Effect.BOOL_NOT_USED;\n\t}", "protected int damageDropped(int par1)\n {\n return par1 & 3;\n }", "private void addEnemySheild() {\n this.enemyShield += 1;\n }", "public void takeDamage(int damage) {\n Random rand = new Random();\n int game = rand.nextInt(51) + 75;\n double game2 = (double) game;\n double percDamage = game2/100.0;\n double realSomething = (double) damage;\n double actualDamageNotReal = realSomething * percDamage;\n int actualDamage = (int) actualDamageNotReal;\n int actualDmg = actualDamage - this.armour;\n if (actualDmg <= 0){\n actualDmg = 0;\n }\n this.health -= actualDmg;\n slowDisplay(String.format(\"%s takes %s damage, now at %s\\n\",this.name,actualDmg,this.health));\n\n }", "public void handleAttack(int damage) {\n this.health -= damage;\n }", "@Override\r\n public void onHit(int damage){\n if(box2body != null){\r\n hp -= damage;\r\n screen.getGameManager().get(\"Sounds/orc-34-hit.wav\", Sound.class).play();\r\n if(this.hp <= 0) {\r\n screen.bodiesToDelete.add(box2body);\r\n deleteFlag = true;\r\n screen.spawnedCreatures.remove(this);\r\n screen.getGameManager().get(\"Sounds/orc-32-death.wav\", Sound.class).play();\r\n\r\n //Award Experience\r\n screen.getPlayer().awardExperience(this.experienceValue);\r\n screen.getPlayer().increaseKillCount();\r\n }\r\n }\r\n //Attack player when damaged\r\n //Prevents player from sniping monsters using Wander AI\r\n if(currentState != State.ATTACKING){\r\n Vector2 orcPosition = new Vector2(box2body.getPosition().x, box2body.getPosition().y);\r\n Vector2 playerPosition = new Vector2(screen.getPlayer().box2body.getPosition().x, screen.getPlayer().box2body.getPosition().y);\r\n\r\n currentState = State.HASBEENATTACKED;\r\n velocity = new Vector2(playerPosition.x - orcPosition.x, playerPosition.y - orcPosition.y);\r\n box2body.setLinearVelocity(velocity.scl(speed));\r\n }\r\n }", "@Override\n public int getDamageToComponent(ItemStack itemStack) {\n return 0;\n }", "public void setWeaponDamage (int weaponDamage)\r\n\t{\r\n\t\tthis.weaponDamage = weaponDamage;\r\n\t}", "public void injure(int a, PhysicsEntity attacker ){\n\t\ta *= getArmorPercentage();\n\t\tsuper.injure(a,attacker);\n\t}", "public void takeDamage (double damage)\n {\n getComponent(HealthC.class).decrease(damage);\n if (getComponent(HealthC.class).isDead())\n {\n setActive(false);\n }\n }", "public void resetDamagedRange() {\r\n fDamagedRange[0] = Integer.MAX_VALUE;\r\n fDamagedRange[1] = Integer.MIN_VALUE;\r\n }", "public void damage ( double amount ) {\n\t\texecute ( handle -> handle.damage ( amount ) );\n\t}", "public void setSiegeWeaponDamage(short siegeWeaponDamage);", "@Override\n public void attackedByPaladin(double attack) {\n this.attack += (2 * attack) / 3;\n damageCounter = Math.max(damageCounter - (2 * attack) / 3, 0);\n }", "public void OnDamage(AI ai, int aTK, float f) {\n\tif(DamagedTimer < 0.8f)\n\t\treturn;\n\tvel.x = f;\n\tvel.y = 3;\n\tDamagedTimer = 0;\n\tgrounded = false;\n\taTK -= (getDEF()*0.8f);\n\tif(aTK <= 0)\n\t\taTK = 1;\n\tHP -= aTK;\n\tInventory.CurrentInventory.dmgTxts.add(new dmgText(pos.x, pos.y+1, aTK));\n\t\n\tSoundManager.PlaySound(\"playerHurt\",3);\n\t\n\t\n}", "private void subtractPlayerHealth(int damage) {\n this.playerShipHealth -= damage;\n }" ]
[ "0.68035835", "0.6792174", "0.66737014", "0.6671937", "0.66372085", "0.6573638", "0.65702784", "0.65630454", "0.64672965", "0.6443013", "0.64327824", "0.6425508", "0.6381946", "0.6376565", "0.6368834", "0.63355637", "0.63169444", "0.6315228", "0.6281007", "0.6235436", "0.61994076", "0.6184679", "0.6172703", "0.6151912", "0.61448747", "0.61432266", "0.6135257", "0.6118944", "0.6107002", "0.6068681", "0.6055303", "0.6037609", "0.60297924", "0.6026789", "0.6021324", "0.601948", "0.6012673", "0.6012673", "0.60115045", "0.60112303", "0.60064614", "0.59843504", "0.59549975", "0.5948398", "0.59333086", "0.5932011", "0.5905905", "0.5905284", "0.5897385", "0.589043", "0.5875263", "0.5875212", "0.5871393", "0.5870354", "0.5860123", "0.5857856", "0.5839333", "0.5834185", "0.5833244", "0.5832389", "0.58207077", "0.5816405", "0.5811834", "0.581097", "0.5801171", "0.5800014", "0.5799617", "0.57992995", "0.5795965", "0.57954067", "0.57954067", "0.57954067", "0.57954067", "0.57954067", "0.57951516", "0.5794176", "0.57875675", "0.5787193", "0.57849133", "0.57843775", "0.57824713", "0.5771721", "0.57691985", "0.5765506", "0.5764384", "0.57637477", "0.57501113", "0.57469887", "0.5745079", "0.5744952", "0.57338446", "0.5729216", "0.57145864", "0.56990165", "0.5693606", "0.56857663", "0.56842375", "0.5680135", "0.56773275", "0.5666381", "0.5666183" ]
0.0
-1
Takes no arguments and returns an array containing the states of each block of the ship
public int[] getDamage(){ return shipDamage; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public long[] getState() {\n return new long[] {(long)Cg0, (long)Cg1, (long)Cg2,\n (long)Cg3, (long)Cg4, (long)Cg5};\n }", "public int [][] getState() {\n return stateArray;\n }", "public double[] getState(){\n if (AgentType.Abstraction == SimpleExperiment.activeAgentType) {\n // Abstraction agent type\n return this.getCustomState();\n }\n else {\n // System.out.println(\"E[\" + marioEgoPos[0] + \",\" + marioEgoPos[1] + \"] F[\" + marioFloatPos[0] + \",\" + marioFloatPos[1] + \"]\");\n\n // other agent type\n double[] state = new double[10];\n\n // CLOSEST TWO ENEMIES\n state[0] = isMarioAbleToJump ? 1 : 0;\n state[1] = isMarioOnGround ? 1 : 0;\n state[2] = isMarioAbleToShoot ? 1 : 0;//marioMode;//\n float xdiff = marioFloatPos[0] - prevMarioPos[0];\n float ydiff = marioFloatPos[1] - prevMarioPos[1];\n state[3] = xdiff < 0 ? 0 : (xdiff == 0 ? 1 : 2);\n state[3] += 3*(ydiff < 0 ? 0 : (ydiff == 0 ? 1 : 2));\n\n state[4] = enemies(1, 0);\n state[5] = enemies(3, 1);\n state[6] = 0;//enemies(5, 3);\n\n state[7] = obstacle();\n\n int[] enemy = closestEnemy();\n if(Math.abs(enemy[0]) < 11 && Math.abs(enemy[1]) < 11){\n state[8] = enemy[0]+10;\n state[9] = enemy[1]+10;\n } else {\n state[8] = 21;\n state[9] = 21;\n }\n\n //state[10] = marioFloatPos[0];\n //state[11] = marioFloatPos[1];\n\n return state;\n }\n }", "private static List<State<StepStateful>> getStates() {\n List<State<StepStateful>> states = new LinkedList<>();\n states.add(s0);\n states.add(s1);\n states.add(s2);\n states.add(s3);\n states.add(s4);\n states.add(s5);\n states.add(s6);\n return states;\n }", "@NotNull\r\n BlockState[] getTileEntities();", "@Override\n public ArrayList<AState> getAllPossibleStates(AState state){\n MazeState s = (MazeState)state;\n ArrayList<AState> moves = new ArrayList<AState> ();\n\n\n int row = s.getState().getRowIndex();\n int col = s.getState().getColumnIndex();\n int [][] matrix = mySearchableMaze.getMazeMatrix();\n\n\n if(row+1 < matrix.length){\n if( matrix[row+1][col]==0 ){\n moves.add(new MazeState(new Position(row+1,col),false,s.getCost()+1));\n\n }\n }\n if(row-1 >= 0 ){\n if( matrix[row-1][col]==0){\n moves.add(new MazeState(new Position(row-1,col),false,s.getCost()+1));\n\n }\n }\n if(col+1 < matrix[0].length ){\n if( matrix[row][col+1]==0 ){\n moves.add(new MazeState(new Position(row,col+1),false,s.getCost()+1));\n\n }\n }\n if(col-1 >= 0 ){\n if( matrix[row][col-1]==0 ){\n moves.add(new MazeState(new Position(row,col-1),false,s.getCost()+1));\n }\n }\n return moves;\n }", "@Deprecated(\n since = \"forever\",\n forRemoval = false\n )\n public static void initStates() {\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5568, \"facing=north\", \"half=top\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5569, \"facing=north\", \"half=top\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5570, \"facing=north\", \"half=top\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5571, \"facing=north\", \"half=top\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5572, \"facing=north\", \"half=top\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5573, \"facing=north\", \"half=top\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5574, \"facing=north\", \"half=top\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5575, \"facing=north\", \"half=top\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5576, \"facing=north\", \"half=top\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5577, \"facing=north\", \"half=top\", \"shape=outer_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5578, \"facing=north\", \"half=bottom\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5579, \"facing=north\", \"half=bottom\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5580, \"facing=north\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5581, \"facing=north\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5582, \"facing=north\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5583, \"facing=north\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5584, \"facing=north\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5585, \"facing=north\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5586, \"facing=north\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5587, \"facing=north\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5588, \"facing=south\", \"half=top\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5589, \"facing=south\", \"half=top\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5590, \"facing=south\", \"half=top\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5591, \"facing=south\", \"half=top\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5592, \"facing=south\", \"half=top\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5593, \"facing=south\", \"half=top\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5594, \"facing=south\", \"half=top\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5595, \"facing=south\", \"half=top\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5596, \"facing=south\", \"half=top\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5597, \"facing=south\", \"half=top\", \"shape=outer_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5598, \"facing=south\", \"half=bottom\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5599, \"facing=south\", \"half=bottom\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5600, \"facing=south\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5601, \"facing=south\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5602, \"facing=south\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5603, \"facing=south\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5604, \"facing=south\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5605, \"facing=south\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5606, \"facing=south\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5607, \"facing=south\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5608, \"facing=west\", \"half=top\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5609, \"facing=west\", \"half=top\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5610, \"facing=west\", \"half=top\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5611, \"facing=west\", \"half=top\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5612, \"facing=west\", \"half=top\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5613, \"facing=west\", \"half=top\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5614, \"facing=west\", \"half=top\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5615, \"facing=west\", \"half=top\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5616, \"facing=west\", \"half=top\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5617, \"facing=west\", \"half=top\", \"shape=outer_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5618, \"facing=west\", \"half=bottom\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5619, \"facing=west\", \"half=bottom\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5620, \"facing=west\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5621, \"facing=west\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5622, \"facing=west\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5623, \"facing=west\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5624, \"facing=west\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5625, \"facing=west\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5626, \"facing=west\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5627, \"facing=west\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5628, \"facing=east\", \"half=top\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5629, \"facing=east\", \"half=top\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5630, \"facing=east\", \"half=top\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5631, \"facing=east\", \"half=top\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5632, \"facing=east\", \"half=top\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5633, \"facing=east\", \"half=top\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5634, \"facing=east\", \"half=top\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5635, \"facing=east\", \"half=top\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5636, \"facing=east\", \"half=top\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5637, \"facing=east\", \"half=top\", \"shape=outer_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5638, \"facing=east\", \"half=bottom\", \"shape=straight\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5639, \"facing=east\", \"half=bottom\", \"shape=straight\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5640, \"facing=east\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5641, \"facing=east\", \"half=bottom\", \"shape=inner_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5642, \"facing=east\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5643, \"facing=east\", \"half=bottom\", \"shape=inner_right\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5644, \"facing=east\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5645, \"facing=east\", \"half=bottom\", \"shape=outer_left\", \"waterlogged=false\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5646, \"facing=east\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=true\"));\n Block.JUNGLE_STAIRS.addBlockAlternative(new BlockAlternative((short) 5647, \"facing=east\", \"half=bottom\", \"shape=outer_right\", \"waterlogged=false\"));\n }", "public static ArrayList genStates(){\n ArrayList states = new ArrayList(44);\n List<String> notes = new ArrayList<String>(Arrays.asList(\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\"));\n List<String> beat = new ArrayList<String>(Arrays.asList(\"1\",\"2\",\"3\",\"4\"));\n //List<String> dot = new ArrayList<String>(Arrays.asList(\"1\",\"0\"));\n for(int n = 0; n<=10; n++){\n for(int b = 0; b<=3; b++){\n //for(int d = 0; d<=1; d++){\n String state = \"\"; \n state += notes.get(n);\n state += beat.get(b);\n //state += dot.get(d);\n states.add(state);\n //}\n }\n }\n return states;\n }", "public int[][] getState(){\r\n return this.state;\r\n }", "public ArrayList genStates2(){\n ArrayList states = new ArrayList(44);\n List<String> notes = new ArrayList<String>(Arrays.asList(\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\"));\n List<String> beat = new ArrayList<String>(Arrays.asList(\"1\",\"2\",\"3\",\"4\"));\n //List<String> dot = new ArrayList<String>(Arrays.asList(\"1\",\"0\"));\n for(String s : notes){\n for(String d : beat){\n //for(int d = 0; d<=1; d++){\n String state = \"\"; \n state += s;\n state += d;\n //state += dot.get(d);\n states.add(state);\n //}\n }\n }\n return states;\n }", "public Array<BlockDrawable> getAllBlocksToDraw() {\r\n \tArray<BlockDrawable> blocksToDraw = new Array<BlockDrawable>();\r\n\t\tblocksToDraw.addAll(tablero);\r\n\t\tif(isGhostActivated()){\r\n\t\t\tblocksToDraw.addAll(getGhostBlocksToDraw());\r\n\t\t}\r\n\t\tif (hasFalling())\r\n\t\t\tblocksToDraw.addAll(falling.allOuterBlocks());\r\n\t\t\r\n\t\treturn blocksToDraw;\r\n }", "public List<S> getAvailableStates();", "public Block[] getAllBlocks(){\n\t\tBlock[] arr = new Block[tail];\n\t\tfor(int x = 0; x < tail; x++)\n\t\t\tarr[x] = ds[x];\n\t\treturn arr;\n\t}", "public static void getInitialStates(int rows, int cols, int [][] states){\n // Create a 2d array for initial state of cells\n states = new int[rows][cols];\n Random rand = new Random();\n int random = rand.nextInt();\n for (int i = 0; i < rows; i++) {\n for (int j = 0; j < cols; j++) {\n if (random%100 <= 100*NUM_CELLS/(rows*cols)){\n states[i][j] = 1;\n }\n else{\n states[i][j] = 0;\n }\n }\n }\n }", "@Deprecated(\n since = \"forever\",\n forRemoval = false\n )\n public static void initStates() {\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15071, \"face=floor\", \"facing=north\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15072, \"face=floor\", \"facing=south\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15073, \"face=floor\", \"facing=west\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15074, \"face=floor\", \"facing=east\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15075, \"face=wall\", \"facing=north\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15076, \"face=wall\", \"facing=south\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15077, \"face=wall\", \"facing=west\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15078, \"face=wall\", \"facing=east\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15079, \"face=ceiling\", \"facing=north\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15080, \"face=ceiling\", \"facing=south\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15081, \"face=ceiling\", \"facing=west\"));\n Block.GRINDSTONE.addBlockAlternative(new BlockAlternative((short) 15082, \"face=ceiling\", \"facing=east\"));\n }", "public int func_180651_a(IBlockState state) { return 0; }", "public IPlacementState getState();", "@Override\r\n public List<Block> blocks() {\r\n List<Block> blockList = new ArrayList<Block>();\r\n java.awt.Color[] colors = new Color[5];\r\n colors[0] = Color.decode(\"#c1b8b2\");\r\n colors[1] = Color.decode(\"#ef1607\");\r\n colors[2] = Color.decode(\"#ffff1e\");\r\n colors[3] = Color.decode(\"#211ed8\");\r\n colors[4] = Color.decode(\"#fffff6\");\r\n int y = 150;\r\n int[] hitPoints = {2, 1, 1, 1, 1};\r\n for (int i = 0; i < colors.length; i++) {\r\n for (int j = i + 5; j < 15; j++) {\r\n blockList.add(new Block(j * 50 + 25, y, 50, 20, colors[i], hitPoints[i]));\r\n }\r\n y += 20;\r\n }\r\n return blockList;\r\n }", "public Iterable<Board> neighbors() {\n LinkedList<Board> states = new LinkedList<>();\n LinkedList<int[]> neighbors = neighborFinder();\n int[] curr_loc = blankFinder();\n\n for(int[] temp : neighbors){\n tiles[curr_loc[0]][curr_loc[1]] = tiles[temp[0]][temp[1]];\n tiles[temp[0]][temp[1]] = 0;\n states.add(new Board(deepCopy(tiles)));\n tiles[temp[0]][temp[1]] = tiles[curr_loc[0]][curr_loc[1]];\n tiles[curr_loc[0]][curr_loc[1]] = 0;\n\n }\n return states;\n }", "List<WorkflowProcessingState> getStates();", "public List<Integer> getNeighborStates(Grid theGrid) {\n ArrayList<Integer> neighborStates = new ArrayList();\n int[] neighborColIndexForMyRow = getNeighborColIndex();\n\n for (int i = 0; i < neighborColIndexForMyRow.length; i++) {\n if (theGrid.isValidIndex(myRow + neighborRowIndex[i], myCol + neighborColIndexForMyRow[i])) {\n neighborStates.add(\n theGrid.getCell((myRow + neighborRowIndex[i]), (myCol + neighborColIndexForMyRow[i]))\n .getCurrentState());\n } else if (toroidal) {\n int[] newIndexes = getTorodialIndex(theGrid, i);\n if (theGrid.isValidIndex(newIndexes[0], newIndexes[1])) {\n neighborStates.add(\n theGrid.getCell(newIndexes[0], newIndexes[1]).getCurrentState());\n }\n }\n\n }\n return neighborStates;\n }", "List<S> getAllPossibleStates(S state);", "public AeBpelState getState();", "State(int[][] startBoardState, int [][] goalBoardState){\n this.currentBoardState = startBoardState;\n this.goalBoardState = goalBoardState;\n this.g_cost = 0;\n this.parentState = null;\n }", "public ProductionBlock[] getAllProductionBlocks();", "private double[] getCustomState() {\n double[] state = new double[this.stateLength];\n\n // *** YOUR CODE HERE **********************************************************************\n\n // *** END OF YOUR CODE ********************************************************************\n\n return state;\n }", "List<Block> blocks();", "public Array<BlockDrawable> getFallingBlocksToDraw() {\r\n\t\tif (hasFalling())\r\n\t\t\treturn falling.allOuterBlocks();\r\n\t\treturn new Array<BlockDrawable>();\r\n\t}", "public ArrayList<State> getStates(){\n\t\treturn this.states;\n\t}", "com.google.protobuf.ByteString\n getStateBytes();", "@Override\n public List<Block> blocks() {\n List<Block> blocksList = new ArrayList<Block>();\n\n //Setting the blocks\n for (int j = 0; j <= 14; j++) {\n if (j == 0 || j == 1) {\n blocksList.add(new Block(new Rectangle(\n new Point(730 - j * 50.6666667, 215), 51, 25), java.awt.Color.CYAN));\n } else if (j == 2 || j == 3) {\n blocksList.add(new Block(new Rectangle(\n new Point(730 - j * 50.6666667, 215), 51, 25), java.awt.Color.PINK));\n } else if (j == 4 || j == 5) {\n blocksList.add(new Block(new Rectangle(\n new Point(730 - j * 50.6666667, 215), 51, 25), java.awt.Color.BLUE));\n } else if (j == 6 || j == 7 || j == 8) {\n blocksList.add(new Block(new Rectangle(\n new Point(730 - j * 50.6666667, 215), 51, 25), java.awt.Color.GREEN));\n } else if (j == 9 || j == 10) {\n blocksList.add(new Block(new Rectangle(\n new Point(730 - j * 50.6666667, 215), 51, 25), java.awt.Color.YELLOW));\n } else if (j == 11 || j == 12) {\n blocksList.add(new Block(new Rectangle(\n new Point(730 - j * 50.6666667, 215), 51, 25), java.awt.Color.ORANGE));\n } else if (j == 13 || j == 14) {\n blocksList.add(new Block(new Rectangle(\n new Point(730 - j * 50.6666667, 215), 51, 25), java.awt.Color.RED));\n }\n }\n\n return blocksList;\n }", "public int getStates() {\n return states;\n }", "@Deprecated(\n since = \"forever\",\n forRemoval = false\n )\n public static void initStates() {\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18656, \"facing=north\", \"waterlogged=true\"));\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18657, \"facing=north\", \"waterlogged=false\"));\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18658, \"facing=south\", \"waterlogged=true\"));\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18659, \"facing=south\", \"waterlogged=false\"));\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18660, \"facing=west\", \"waterlogged=true\"));\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18661, \"facing=west\", \"waterlogged=false\"));\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18662, \"facing=east\", \"waterlogged=true\"));\n Block.BIG_DRIPLEAF_STEM.addBlockAlternative(new BlockAlternative((short) 18663, \"facing=east\", \"waterlogged=false\"));\n }", "public BSState() {\n this.playerTurn=1;\n this.p1TotalHits=0;\n this.p2TotalHits=0;\n this.shipsAlive=10;\n this.shipsSunk=0;\n this.isHit=false;\n this.phaseOfGame=\"SetUp\";\n this.shotLocations=null;\n this.shipLocations=null;\n this.shipType=1;\n this.board=new String[10][20];\n //this.player1=new HumanPlayer;\n //this.player2=new ComputerPlayer;\n\n }", "public List<MclnState> getAvailableStates();", "public Block[] getBlocks() {\n\t\treturn blocks;\n\t}", "public Set<StateVertex> getAllStates() {\n\t\treturn sfg.vertexSet();\n\t}", "private Board(byte [] blocks) {\n this.state = Arrays.copyOf(blocks, blocks.length);\n }", "void blockState(BooleanFormula pState, int pMaxLevel, CFANode pLocation);", "private List<Block> createBlocks() {\n ArrayList<String> listOfBlocksAndSpacers = new ArrayList<String>();\n boolean buffer = false;\n for (int i = 0; i < level.size(); i++) {\n // if it starts with END_BLOCKS\n if (level.get(i).startsWith(\"END_BLOCKS\")) {\n buffer = false;\n } // if the buffer is true\n if (buffer) {\n listOfBlocksAndSpacers.add(level.get(i));\n } // if it starts with START_BLOCKS\n if (level.get(i).startsWith(\"START_BLOCKS\")) {\n buffer = true;\n } else if (level.get(i).startsWith(\"END_BLOCKS\")) {\n buffer = false;\n }\n }\n // find the x position where it all starts\n int startX = Integer.parseInt(this.map.get(\"blocks_start_x\"));\n int xForSave = startX;\n // find the y position where it all starts\n int startY = Integer.parseInt(this.map.get(\"blocks_start_y\"));\n List<Block> listOfBlocks = new ArrayList<>();\n String[] s;\n setBlocks();\n // go over the list of blocks of spacers\n for (int i = 0; i < listOfBlocksAndSpacers.size(); i++) {\n // split it with empty lines\n s = listOfBlocksAndSpacers.get(i).split(\"\");\n for (int j = 0; j < s.length; j++) {\n if (s[j].equals(\"\")) {\n continue;\n } // if it is a block symbol\n if (this.factory.isBlockSymbol(s[j])) {\n // add to listOfBlocks a block\n listOfBlocks.add(this.factory.getBlock(s[j], startX, startY));\n // continue to the next block with the next location\n startX += this.factory.getBlock(s[j], startX, startY).getCollisionRectangle().getWidth();\n } else if (this.factory.isSpaceSymbol(s[j])) { // move following\n // spacers\n startX += this.factory.getSpaceWidth(s[j]);\n }\n }\n startX = xForSave;\n startY += Integer.parseInt(this.map.get(\"row_height\"));\n }\n // put the blocks in a new blocks list and return it\n List<Block> listOfBlocksCopy = new ArrayList<>();\n for (int z = 0; z < listOfBlocks.size(); z++) {\n listOfBlocksCopy.add(listOfBlocks.get(z).copyBlock());\n }\n return listOfBlocksCopy;\n }", "@Deprecated(\n since = \"forever\",\n forRemoval = false\n )\n public static void initStates() {\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9244, \"facing=north\", \"half=upper\", \"hinge=left\", \"open=true\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9245, \"facing=north\", \"half=upper\", \"hinge=left\", \"open=true\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9246, \"facing=north\", \"half=upper\", \"hinge=left\", \"open=false\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9247, \"facing=north\", \"half=upper\", \"hinge=left\", \"open=false\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9248, \"facing=north\", \"half=upper\", \"hinge=right\", \"open=true\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9249, \"facing=north\", \"half=upper\", \"hinge=right\", \"open=true\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9250, \"facing=north\", \"half=upper\", \"hinge=right\", \"open=false\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9251, \"facing=north\", \"half=upper\", \"hinge=right\", \"open=false\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9252, \"facing=north\", \"half=lower\", \"hinge=left\", \"open=true\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9253, \"facing=north\", \"half=lower\", \"hinge=left\", \"open=true\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9254, \"facing=north\", \"half=lower\", \"hinge=left\", \"open=false\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9255, \"facing=north\", \"half=lower\", \"hinge=left\", \"open=false\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9256, \"facing=north\", \"half=lower\", \"hinge=right\", \"open=true\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9257, \"facing=north\", \"half=lower\", \"hinge=right\", \"open=true\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9258, \"facing=north\", \"half=lower\", \"hinge=right\", \"open=false\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9259, \"facing=north\", \"half=lower\", \"hinge=right\", \"open=false\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9260, \"facing=south\", \"half=upper\", \"hinge=left\", \"open=true\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9261, \"facing=south\", \"half=upper\", \"hinge=left\", \"open=true\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9262, \"facing=south\", \"half=upper\", \"hinge=left\", \"open=false\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9263, \"facing=south\", \"half=upper\", \"hinge=left\", \"open=false\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9264, \"facing=south\", \"half=upper\", \"hinge=right\", \"open=true\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9265, \"facing=south\", \"half=upper\", \"hinge=right\", \"open=true\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9266, \"facing=south\", \"half=upper\", \"hinge=right\", \"open=false\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9267, \"facing=south\", \"half=upper\", \"hinge=right\", \"open=false\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9268, \"facing=south\", \"half=lower\", \"hinge=left\", \"open=true\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9269, \"facing=south\", \"half=lower\", \"hinge=left\", \"open=true\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9270, \"facing=south\", \"half=lower\", \"hinge=left\", \"open=false\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9271, \"facing=south\", \"half=lower\", \"hinge=left\", \"open=false\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9272, \"facing=south\", \"half=lower\", \"hinge=right\", \"open=true\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9273, \"facing=south\", \"half=lower\", \"hinge=right\", \"open=true\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9274, \"facing=south\", \"half=lower\", \"hinge=right\", \"open=false\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9275, \"facing=south\", \"half=lower\", \"hinge=right\", \"open=false\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9276, \"facing=west\", \"half=upper\", \"hinge=left\", \"open=true\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9277, \"facing=west\", \"half=upper\", \"hinge=left\", \"open=true\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9278, \"facing=west\", \"half=upper\", \"hinge=left\", \"open=false\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9279, \"facing=west\", \"half=upper\", \"hinge=left\", \"open=false\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9280, \"facing=west\", \"half=upper\", \"hinge=right\", \"open=true\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9281, \"facing=west\", \"half=upper\", \"hinge=right\", \"open=true\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9282, \"facing=west\", \"half=upper\", \"hinge=right\", \"open=false\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9283, \"facing=west\", \"half=upper\", \"hinge=right\", \"open=false\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9284, \"facing=west\", \"half=lower\", \"hinge=left\", \"open=true\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9285, \"facing=west\", \"half=lower\", \"hinge=left\", \"open=true\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9286, \"facing=west\", \"half=lower\", \"hinge=left\", \"open=false\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9287, \"facing=west\", \"half=lower\", \"hinge=left\", \"open=false\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9288, \"facing=west\", \"half=lower\", \"hinge=right\", \"open=true\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9289, \"facing=west\", \"half=lower\", \"hinge=right\", \"open=true\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9290, \"facing=west\", \"half=lower\", \"hinge=right\", \"open=false\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9291, \"facing=west\", \"half=lower\", \"hinge=right\", \"open=false\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9292, \"facing=east\", \"half=upper\", \"hinge=left\", \"open=true\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9293, \"facing=east\", \"half=upper\", \"hinge=left\", \"open=true\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9294, \"facing=east\", \"half=upper\", \"hinge=left\", \"open=false\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9295, \"facing=east\", \"half=upper\", \"hinge=left\", \"open=false\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9296, \"facing=east\", \"half=upper\", \"hinge=right\", \"open=true\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9297, \"facing=east\", \"half=upper\", \"hinge=right\", \"open=true\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9298, \"facing=east\", \"half=upper\", \"hinge=right\", \"open=false\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9299, \"facing=east\", \"half=upper\", \"hinge=right\", \"open=false\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9300, \"facing=east\", \"half=lower\", \"hinge=left\", \"open=true\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9301, \"facing=east\", \"half=lower\", \"hinge=left\", \"open=true\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9302, \"facing=east\", \"half=lower\", \"hinge=left\", \"open=false\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9303, \"facing=east\", \"half=lower\", \"hinge=left\", \"open=false\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9304, \"facing=east\", \"half=lower\", \"hinge=right\", \"open=true\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9305, \"facing=east\", \"half=lower\", \"hinge=right\", \"open=true\", \"powered=false\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9306, \"facing=east\", \"half=lower\", \"hinge=right\", \"open=false\", \"powered=true\"));\n Block.DARK_OAK_DOOR.addBlockAlternative(new BlockAlternative((short) 9307, \"facing=east\", \"half=lower\", \"hinge=right\", \"open=false\", \"powered=false\"));\n }", "public SBlock() {\n // todo\n cells = new boolean[rows][columns];\n cells[0][0] = false;\n cells[0][1] = true;\n cells[0][2] = true;\n cells[1][0] = true;\n cells[1][1] = true;\n cells[1][2] = false;\n cells[2][0] = false;\n cells[2][1] = false;\n cells[2][2] = false;\n }", "public Array<BlockDrawable> getGhostBlocksToDraw() {\t\t\r\n\t\tif(hasFalling()){\r\n\t\t\treturn ghost.allOuterBlocks();\r\n\t\t}\t\t\r\n\t\treturn new Array<BlockDrawable>();\r\n\t}", "@Deprecated(\n since = \"forever\",\n forRemoval = false\n )\n public static void initStates() {\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6900, \"inverted=true\", \"power=0\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6901, \"inverted=true\", \"power=1\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6902, \"inverted=true\", \"power=2\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6903, \"inverted=true\", \"power=3\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6904, \"inverted=true\", \"power=4\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6905, \"inverted=true\", \"power=5\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6906, \"inverted=true\", \"power=6\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6907, \"inverted=true\", \"power=7\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6908, \"inverted=true\", \"power=8\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6909, \"inverted=true\", \"power=9\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6910, \"inverted=true\", \"power=10\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6911, \"inverted=true\", \"power=11\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6912, \"inverted=true\", \"power=12\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6913, \"inverted=true\", \"power=13\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6914, \"inverted=true\", \"power=14\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6915, \"inverted=true\", \"power=15\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6916, \"inverted=false\", \"power=0\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6917, \"inverted=false\", \"power=1\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6918, \"inverted=false\", \"power=2\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6919, \"inverted=false\", \"power=3\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6920, \"inverted=false\", \"power=4\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6921, \"inverted=false\", \"power=5\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6922, \"inverted=false\", \"power=6\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6923, \"inverted=false\", \"power=7\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6924, \"inverted=false\", \"power=8\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6925, \"inverted=false\", \"power=9\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6926, \"inverted=false\", \"power=10\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6927, \"inverted=false\", \"power=11\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6928, \"inverted=false\", \"power=12\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6929, \"inverted=false\", \"power=13\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6930, \"inverted=false\", \"power=14\"));\n Block.DAYLIGHT_DETECTOR.addBlockAlternative(new BlockAlternative((short) 6931, \"inverted=false\", \"power=15\"));\n }", "List<Integer> getState()\n\t{\n\t\treturn state;\n\t}", "public BlockType[] getBlocks() {\n return blocks;\n }", "public List<Pair> calculateShipTileIndices() {\n List<Pair> shipTileIndices = new ArrayList<>();\n for (int i = 0; i < shipSize; i++) {\n if (orientation == Orientation.HORIZONTAL) {\n shipTileIndices.add(new Pair(startX + i, startY));\n } else {\n shipTileIndices.add(new Pair(startX, startY + i));\n }\n }\n return shipTileIndices;\n }", "private byte[] calculateAllPossibleOutboundStates(byte state, byte[] allPossible){\n int stateNumParticles = calcNumParticlesInState(state);\n int[] stateMomentum = calculateMomentum(state);\n ArrayList<Byte> possibleStates = new ArrayList<>();\n for(byte poss:allPossible){\n int possNumPart = calcNumParticlesInState(poss);\n if(possNumPart==stateNumParticles){\n int[] possMomentum = calculateMomentum(poss);\n if(compareMomenta(possMomentum, stateMomentum)){\n possibleStates.add(poss);\n }\n }\n }\n byte[] ret = new byte[possibleStates.size()];\n int i = 0;\n for(Byte b:possibleStates){\n ret[i++] = b.byteValue();\n }\n return ret;\n }", "public double[][][] getState() {\r\n return this.state;\r\n }", "public static String[][] getBoardState() {\n return boardState;\n }", "public List<Block> blocks() {\r\n List<Block> list = new ArrayList<Block>();\r\n double width = 50;\r\n for (int i = 0; i < 7; ++i) {\r\n Color c = new Color(0, 0, 0);\r\n switch (i) {\r\n case 0:\r\n c = Color.gray;\r\n break;\r\n case 1:\r\n c = Color.red;\r\n break;\r\n case 2:\r\n c = Color.yellow;\r\n break;\r\n case 3:\r\n c = Color.green;\r\n break;\r\n case 4:\r\n c = Color.white;\r\n break;\r\n case 5:\r\n c = Color.pink;\r\n break;\r\n default:\r\n c = Color.cyan;\r\n break;\r\n }\r\n for (int j = 0; j < 15; ++j) {\r\n Block b = new Block(new Rectangle(new Point(\r\n 25 + j * width, 100 + i * 20), width, 20));\r\n if (i == 0) {\r\n b.setHitPoints(2);\r\n } else {\r\n b.setHitPoints(1);\r\n }\r\n list.add(b);\r\n }\r\n }\r\n return list;\r\n }", "public GameState(int initialStones) \n {\n \tif (initialStones < 1) initialStones = 4;\n \tfor (int i=0; i<6; i++)\n \t\tstate[i] = state[i+7] = initialStones;\n }", "void block(Directions dir);", "default BlockState getSpecialState(Block block) { return block.defaultBlockState(); }", "public List<AState> getStates() {\n return states;\n }", "public ArrayList<DrawableGraphState> getStates() {\r\n\t\treturn new ArrayList<DrawableGraphState>(states);\r\n\t}", "public Array<BlockDrawable> getBoardBlocksToDraw() {\r\n\t\tArray<BlockDrawable> blocksToDraw = new Array<BlockDrawable>();\r\n\t\tblocksToDraw.addAll(tablero);\t\t\r\n\t\treturn blocksToDraw;\r\n\t}", "Set<? extends IRBasicBlock> getBlocks();", "@Override\n public List<Block> blocks() {\n int columns = 15, width = 51, height = 30;\n Color darkGreen = new Color(29, 101, 51);\n List<Block> blocks = new ArrayList<>();\n for (int j = 0; j < columns; j++) {\n blocks.add(new Block(new arkanoid.geometry.Rectangle(new Point(20 + width * j, 110 + height),\n width, height), darkGreen));\n }\n return blocks;\n }", "private int[][] initialStateMatrix() {\n return new int[][]{{2,1,-1,3,0,-1},\n {2,-1,-1,3,-1,-1},\n {2,-1,5,4,8,-1},\n {4,-1,-1,-1,-1,-1},\n {4,-1,5,-1,8,-1},\n {7,6,-1,-1,-1,-1},\n {7,-1,-1,-1,-1,-1},\n {7,-1,-1,-1,8,-1},\n {-1,-1,-1,-1,8,-1}};\n }", "public ArrayList<Block> getBlocks() {\n ArrayList<Block> blocks = new ArrayList<>();\n\n for (Vector2D pos : template) {\n blocks.add(new Block(pos.addVectorGetNewVector(center), this.color));\n }\n return blocks;\n }", "public static String[][] createBoardState() {\n String[][] initialBoardState = {\n {\"Rw\", \"Nw\", \"Bw\", \"Qw\", \"Kw\", \"Bw\", \"Nw\", \"Rw\"},\n {\"Pw\", \"Pw\", \"Pw\", \"Pw\", \"Pw\", \"Pw\", \"Pw\", \"Pw\"},\n {\" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \"},\n {\" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \"},\n {\" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \"},\n {\" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \"},\n {\"Pb\", \"Pb\", \"Pb\", \"Pb\", \"Pb\", \"Pb\", \"Pb\", \"Pb\"},\n {\"Rb\", \"Nb\", \"Bb\", \"Qb\", \"Kb\", \"Bb\", \"Nb\", \"Rb\"}\n };\n\n return initialBoardState;\n }", "public int getShipState(Point xy) {\r\n\t\treturn shipStateMap.get(xy);\r\n\t}", "public Board(String blocks, Heuristic h, int[] order) {\n Scanner s = new Scanner(blocks);\n ByteArrayOutputStream bs = new ByteArrayOutputStream();\n while (s.hasNextInt()) bs.write(s.nextInt());\n state = bs.toByteArray();\n for (int i = 0; i < state.length; i++) {\n if (state[i] == 0) zero = i;\n }\n Board.dim = (int)Math.sqrt((double)state.length);\n if (state.length != Board.dim*Board.dim) {\n System.out.println(\" Invalid input length.\");\n }\n Board.heuristic = h;\n if (order != null)\n Board.ORDER = order;\n // build lookup tables of rows and columns\n if (Board.rowOf == null || Board.rowOf.length != state.length) {\n Board.rowOf = new byte[state.length];\n Board.colOf = new byte[state.length];\n }\n for (int i = 0; i < state.length; i++) {\n Board.rowOf[i] = (byte)(i / Board.dim);\n Board.colOf[i] = (byte)(i % Board.dim);\n }\n // perform initial state cost analysis\n switch(Board.heuristic) {\n case HAM: dist = hamming(); break;\n case INT: inter = conflicts();\n case MAN: // build lookup table for manhattan distance to avoid costly divide and modulus ops\n if (Board.manhattanTable == null || Board.manhattanTable[0].length != state.length) {\n Board.manhattanTable = new byte[state.length][state.length];\n for (int i = 1; i < state.length; i++) \n for (int n = 0; n < state.length; n++) \n Board.manhattanTable[i][n] = \n (byte)(Math.abs(i % Board.dim - n % Board.dim) + \n Math.abs(i / Board.dim - n / Board.dim));\n }\n dist = manhattan();\n }\n // build lookup table of valid moves\n if (Board.isValidMove == null || Board.isValidMove[0].length != state.length) {\n Board.isValidMove = new boolean[Board.DIRECTIONS][state.length];\n for (int n = 0; n < state.length; n++) {\n Board.isValidMove[Board.UP ][n] = (Board.rowOf[n] != 0 );\n Board.isValidMove[Board.RIGHT][n] = (Board.colOf[n] + 1 != Board.dim);\n Board.isValidMove[Board.LEFT ][n] = (Board.colOf[n] != 0 );\n Board.isValidMove[Board.DOWN ][n] = (Board.rowOf[n] + 1 != Board.dim);\n }\n } \n\n // check solvability\n // based on counting inversions\n // for odd dim, an even number of inversions is solvable, and odd is not\n // for even dim, the number of inversions correlates with row of zero position\n switch (Board.dim % 2) {\n case 1: Board.solvable = (inversions() % 2) == 0; break;\n case 0: Board.solvable = (inversions() % 2) == (zero/Board.dim)%2; break;\n }\n }", "public State getState(Action action) { \n\t\tState newstate = new State(getTractor(), getK(), getMax(), getRows(), getColumns());\n\t\tfor (int i = 0; i < getRows(); i++) {\n\t\t\tfor (int j = 0; j < getColumns(); j++) {\n\t\t\t\tnewstate.cells[i][j] = new Square(i, j, cells[i][j].getSand()); \n\t\t\t}\n\t\t} \n\t\tnewstate.getSquare(newstate.getTractor()).setSand(newstate.getSquare(newstate.getTractor()).getSand()-action.distributedAmount());\n\t\tnewstate.tractor=(Square) action.getMovement();\n\t\tSquare[] adjacents = action.getAdjacents();\n\t\tint[] values = action.getValues();\n\n\t\tfor (int i = 0; i < adjacents.length; i++) {\n\t\t\tnewstate.getSquare(adjacents[i]).setSand(newstate.getSquare(adjacents[i]).getSand()+values[i]);\n\t\t}\n\t\treturn newstate;\n\t}", "public void compileStates(int timeinterval) {\r\n\t\tif(timeinterval == -1) {\r\n\t\t\t//Add initial State\r\n\t\t\treachableStates.add(initialState);\r\n\t\t\tthis.numReachableState = 1;\r\n\t\t\t\r\n\t\t}else{\t\t\t\t\r\n\t\tState s;\r\n\t\tint index = 0;\r\n\t\treachableStates.clear();\r\n\t\tfor(int i = 0; i < totalWorkloadLevel; i++) {\r\n\t\t\tfor(int j = 0; j < totalGreenEnergyLevel; j++) {\r\n\t\t\t\tfor(int k = 0; k < totalBatteryLevel; k++) {\r\n\t\t\t\t\ts = grid[timeinterval][i][j][k];\r\n\t\t\t\t\tif(s.getProbability() != 0) {\r\n\t\t\t\t\t\t//If probability of state is not 0, put this state into the reachable list. \r\n\t\t\t\t\t\ts.index = index;\r\n\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t\treachableStates.add(s);\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\tthis.numReachableState = index;\r\n\t\t}\r\n\t}", "private static void populateBlocks() {\n\n //TODO set sensors for each\n\n /* Path A */\n SW1A.setProceeding(new Block[]{SW2A, STA1Z, SW2B});\n SW1A.setPreceding(new Block[]{PTH5A});\n\n SW2A.setProceeding(new Block[]{LD1A});\n SW2A.setPreceding(new Block[]{SW1A});\n\n SW3A.setProceeding(new Block[]{SW4A});\n SW3A.setPreceding(new Block[]{LD1A});\n\n SW4A.setProceeding(new Block[]{PTH1A});\n SW4A.setPreceding(new Block[]{SW3A, STA1Z, SW3B});\n\n PTH1A.setProceeding(new Block[]{PTH2A});\n PTH1A.setPreceding(new Block[]{SW4A});\n\n PTH2A.setProceeding(new Block[]{PTH3A});\n PTH2A.setPreceding(new Block[]{PTH1A});\n\n PTH3A.setProceeding(new Block[]{PTH4A});\n PTH3A.setPreceding(new Block[]{PTH2A});\n\n PTH4A.setProceeding(new Block[]{PTH5A});\n PTH4A.setPreceding(new Block[]{PTH3A});\n\n PTH5A.setProceeding(new Block[]{SW1A});\n PTH5A.setPreceding(new Block[]{PTH4A});\n\n LD1A.setProceeding(new Block[]{SW3A});\n LD1A.setPreceding(new Block[]{SW2A});\n\n\n /* Station */\n STA1Z.setProceeding(new Block[]{SW4A});\n STA1Z.setPreceding(new Block[]{SW1A});\n\n\n /* Path B */\n //TODO path B items aren't in yet\n LD1B.setProceeding(new Block[]{SW3B});\n LD1B.setPreceding(new Block[]{SW2B});\n\n SW2B.setProceeding(new Block[]{LD1B});\n SW2B.setPreceding(new Block[]{SW1B});\n\n SW3B.setProceeding(new Block[]{SW4B});\n SW3B.setPreceding(new Block[]{LD1B});\n\n\n /* Maintenance Bay */\n //TODO maintenance bay items aren't in yet\n\n\n\n\n /* Set up array */\n blocksArray = new Block[] {}; //TODO fill\n }", "public byte getState(){\n\t\t/*\n\t\tOFFLINE((byte)0),\n ONLINE((byte)1),\n SAVING((byte)2);\n\t\t */\n\t\t//getWorld().getcWorld().update(this);\n\t\treturn state;\n\t}", "public States states();", "public void arrayToState(int[] gX){\r\n int i = 0;\r\n int j = 0;\r\n int count = 0;\r\n while(count < gX.length){\r\n this.setState(i, j, gX[count]);\r\n count++;\r\n if(j == 3){\r\n i++;\r\n j = 0;\r\n }\r\n else\r\n j++;\r\n }\r\n }", "int getState();", "int getState();", "int getState();", "int getState();", "int getState();", "int getState();", "int getStateValues(int index);", "private boolean[] getState(){\n int [] ids = new int[]{\n R.id.box1, R.id.box2, R.id.box3, R.id.box4, R.id.box5, R.id.box6,\n R.id.box7, R.id.box8, R.id.box9\n };\n\n boolean[] enabled = new boolean[ids.length];\n\n for (int i = 0; i<ids.length; i++)\n {\n ImageButton btn = (ImageButton)findViewById(ids[i]);\n enabled[i] = btn.isEnabled();\n }\n\n return enabled;\n }", "private void updateStateOnce() {\n for(int i = 0; i < maskArray.length; i++) {\n for (int j = 0; j < maskArray[i].length; j++) {\n\n if (maskArray[i][j] == 1){\n stateArray[i][j] = stateGenerator.generateElementState();\n }\n\n }\n }\n }", "public void updateNeighbours(int i) {\n if (currentState[i] != 0) {\n int ix0 = (i - STEPX) & MASKX;\n int iy0 = (i - STEPY) & MASKY;\n int iz0 = (i - STEPZ) & MASKZ;\n\n int ix1 = (i) & MASKX;\n int iy1 = (i) & MASKY;\n int iz1 = (i) & MASKZ;\n\n int ix2 = (i + STEPX) & MASKX;\n int iy2 = (i + STEPY) & MASKY;\n int iz2 = (i + STEPZ) & MASKZ;\n\n ++nextState[ix0 | iy0 | iz0];\n ++nextState[ix0 | iy0 | iz1];\n ++nextState[ix0 | iy0 | iz2];\n ++nextState[ix0 | iy1 | iz0];\n ++nextState[ix0 | iy1 | iz1];\n ++nextState[ix0 | iy1 | iz2];\n ++nextState[ix0 | iy2 | iz0];\n ++nextState[ix0 | iy2 | iz1];\n ++nextState[ix0 | iy2 | iz2];\n\n ++nextState[ix1 | iy0 | iz0];\n ++nextState[ix1 | iy0 | iz1];\n ++nextState[ix1 | iy0 | iz2];\n ++nextState[ix1 | iy1 | iz0];\n\n //!\t\t++nextState[ix1|iy1|iz1];\n ++nextState[ix1 | iy1 | iz2];\n ++nextState[ix1 | iy2 | iz0];\n ++nextState[ix1 | iy2 | iz1];\n ++nextState[ix1 | iy2 | iz2];\n\n ++nextState[ix2 | iy0 | iz0];\n ++nextState[ix2 | iy0 | iz1];\n ++nextState[ix2 | iy0 | iz2];\n ++nextState[ix2 | iy1 | iz0];\n ++nextState[ix2 | iy1 | iz1];\n ++nextState[ix2 | iy1 | iz2];\n ++nextState[ix2 | iy2 | iz0];\n ++nextState[ix2 | iy2 | iz1];\n ++nextState[ix2 | iy2 | iz2];\n }\n }", "Object getState();", "public static int getStartState() {\n int startState = 1;\n int n = 1;\n for (int i = 2; i <= state; i ++) {\n if (stateList.get(i).getN1() == n || stateList.get(i).getN2() == n) {\n startState = i;\n n = i;\n }\n }\n return startState;\n }", "public static int[] getCoordinate(int state) {\n return new int[]{(state % 4), (state / 4)};\n }", "public void evolve() {\n\t\tboolean[][] nextState = new boolean[width][height];\n\t\t\n\t\t// Look at each position\n\t\tfor (int x = 0; x < width; x++) {\n\t\t\tfor (int y = 0; y < height; y++) {\n\t\t\t\tboolean value = calculateNextState(x, y);\n\t\t\t\tnextState[x][y] = value;\n\t\t\t}\n\t\t}\n\t\t\n\t\tstate = nextState;\n\t}", "public static PieceState[] createStates(int pieces) {\n final PieceState[] statuses = new PieceState[pieces];\n for (int i = 0; i < statuses.length; i++) {\n statuses[i] = new PieceState(i);\n }\n return statuses;\n }", "public boolean isThereStandingShips() {\r\n\t\r\n\t/*\t\r\n\t\tint SIZE = 100;\r\n\t\tint state = 0;\r\n\t\tboolean shipPresent = false;\r\n\t\tint x = 0, y = -1;\r\n\t\tfor (int i = 0; i < SIZE; i++) {\r\n\t\t\tif (i % 10 == 0) {\r\n\t\t\t\tx = 0;\r\n\t\t\t\ty = y + 1;\r\n\t\t\t}\r\n\t\t\tstate = shipStateMap.get(new Point(x, y));\r\n\t\t\tif (state == 1)\r\n\t\t\t\tshipPresent = true;\r\n\t\t\tx++;\r\n\t\t}\r\n\t\treturn shipPresent;\r\n\t*/\r\n\r\n\t\treturn (numberOfAllowedShotsRemaining!=0);\r\n\t}", "public State getState(){\n\t\treturn State.TUT_ISLAND;\n\t}", "public Block[] getCannons() {\n\t\tArrayList<Block> cannons = new ArrayList<Block>();\n\t\tfor (int i = 0; i < this.blocks.length; i++) {\n\t\t\tif (blocks[i].getType().equals(Material.DISPENSER))\n\t\t\t\tcannons.add(blocks[i]);\n\t\t}\n\t\treturn cannons.toArray(new Block[0]);\n\t}", "@Deprecated(\n since = \"forever\",\n forRemoval = false\n )\n public static void initStates() {\n Block.TARGET.addBlockAlternative(new BlockAlternative((short) 16014, \"power=0\"));\n Block.TARGET.addBlockAlternative(new BlockAlternative((short) 16015, \"power=1\"));\n Block.TARGET.addBlockAlternative(new BlockAlternative((short) 16016, \"power=2\"));\n Block.TARGET.addBlockAlternative(new BlockAlternative((short) 16017, \"power=3\"));\n Block.TARGET.addBlockAlternative(new BlockAlternative((short) 16018, \"power=4\"));\n Block.TARGET.addBlockAlternative(new BlockAlternative((short) 16019, \"power=5\"));\n Block.TARGET.addBlockAlternative(new BlockAlternative((short) 16020, \"power=6\"));\n Block.TARGET.addBlockAlternative(new BlockAlternative((short) 16021, \"power=7\"));\n Block.TARGET.addBlockAlternative(new BlockAlternative((short) 16022, \"power=8\"));\n Block.TARGET.addBlockAlternative(new BlockAlternative((short) 16023, \"power=9\"));\n Block.TARGET.addBlockAlternative(new BlockAlternative((short) 16024, \"power=10\"));\n Block.TARGET.addBlockAlternative(new BlockAlternative((short) 16025, \"power=11\"));\n Block.TARGET.addBlockAlternative(new BlockAlternative((short) 16026, \"power=12\"));\n Block.TARGET.addBlockAlternative(new BlockAlternative((short) 16027, \"power=13\"));\n Block.TARGET.addBlockAlternative(new BlockAlternative((short) 16028, \"power=14\"));\n Block.TARGET.addBlockAlternative(new BlockAlternative((short) 16029, \"power=15\"));\n }", "private void createBlocks(){\n for (int row=0; row < grid.length; row++) \n {\n for (int column=0; column < grid[row].length; column++)\n {\n boolean player = false;\n boolean walkable;\n \n switch (grid[row][column]){\n case(0) : \n returnImage = wall; \n walkable = false;\n break;\n case(2) : \n returnImage = start; \n walkable = true;\n player = true;\n break;\n case(4) : \n returnImage = finish; \n walkable = true;\n break;\n \n default :\n returnImage = pad; \n walkable = false;\n }\n \n \n Block blok;\n try {\n if(player==true) \n { \n blok = new Block(returnImage, blockSize, true);\n blok.setTopImage(held);\n }else\n {\n blok = new Block(returnImage, blockSize, false);\n }\n blocks.add(blok);\n } catch (Exception e) {\n \n }\n } \n \n }\n \n }", "public boolean func_149686_d(IBlockState state) { return false; }", "public boolean[][] getBlockMatrix() {\n\t\treturn blockMatrix; \n\t}", "public interface GameState {\r\n void init(boolean[][] cells);\r\n\r\n void tick();\r\n\r\n Collection<ICell> getCells();\r\n\r\n boolean isLifeExtinct();\r\n}", "default Collection<I_GameState> getRepeatStates() {\n return getRepeatStates(FULL_EQUAL);\n }", "@Override\n public Iterable<WorldState> neighbors() {\n Queue<WorldState> neighbor = new ArrayDeque<>();\n int xDim = 0, yDim = 0;\n int[][] tiles = new int[_N][_N];\n\n for (int i = 0; i < _N; i++) {\n for (int j = 0; j < _N; j++) {\n tiles[i][j] = _tiles[i][j];\n if (_tiles[i][j] == 0) {\n xDim = i;\n yDim = j;\n }\n }\n }\n\n for (int i = 0; i < _N; i++) {\n for (int j = 0; j < _N; j++) {\n if (Math.abs(i - xDim) + Math.abs(j - yDim) == 1) {\n tiles[i][j] = _tiles[xDim][yDim];\n tiles[xDim][yDim] = _tiles[i][j];\n neighbor.add(new Board(tiles));\n // System.out.println(new Board(tiles));\n tiles[xDim][yDim] = _tiles[xDim][yDim];\n tiles[i][j] = _tiles[i][j];\n }\n }\n }\n return neighbor;\n }", "SpacecraftState getInitialState() throws OrekitException;", "private void initialize() {\n\n this.levelName = \"Green 3\";\n this.numberOfBalls = 2;\n int ballsRadius = 5;\n Color ballsColor = Color.white;\n this.paddleHeight = (screenHeight / 27);\n this.paddleWidth = (screenWidth / 8);\n this.paddleSpeed = 11;\n int surroundingBlocksWidth = 30;\n this.paddleColor = new Color(1.0f, 0.699f, 0.000f);\n this.paddleUpperLeft = new Point(screenWidth / 2.2, screenHeight - surroundingBlocksWidth\n - this.paddleHeight);\n Color backgroundColor = new Color(0.000f, 0.420f, 0.000f);\n this.background = new Block(new Rectangle(new Point(0, 0), screenWidth + 1\n , screenHeight + 2), backgroundColor);\n this.background.setNumber(-1);\n\n Color[] colors = {Color.darkGray, Color.red, Color.yellow, Color.blue, Color.white};\n int blocksRowsNum = 5;\n int blocksInFirstRow = 10;\n int blocksWidth = screenWidth / 16;\n int blockHeight = screenHeight / 20;\n int firstBlockYlocation = screenHeight / 4;\n int removableBlocks = 0;\n Block[][] stairs = new Block[blocksRowsNum][];\n //blocks initialize.\n for (int i = 0; i < blocksRowsNum; i++, blocksInFirstRow--) {\n int number;\n for (int j = 0; j < blocksInFirstRow; j++) {\n if (i == 0) {\n number = 2; //top row.\n } else {\n number = 1;\n }\n stairs[i] = new Block[blocksInFirstRow];\n Point upperLeft = new Point(screenWidth - (blocksWidth * (j + 1)) - surroundingBlocksWidth\n , firstBlockYlocation + (blockHeight * i));\n stairs[i][j] = new Block(new Rectangle(upperLeft, blocksWidth, blockHeight), colors[i % 5]);\n if (stairs[i][j].getHitPoints() != -2 && stairs[i][j].getHitPoints() != -3) { // not death or live block\n stairs[i][j].setNumber(number);\n removableBlocks++;\n }\n this.blocks.add(stairs[i][j]);\n }\n\n }\n this.numberOfBlocksToRemove = (int) (removableBlocks * 0.5); //must destroy half of them.\n this.ballsCenter.add(new Point(screenWidth / 1.93, screenHeight * 0.9));\n this.ballsCenter.add(new Point(screenWidth / 1.93, screenHeight * 0.9));\n List<Velocity> v = new ArrayList<>();\n v.add(Velocity.fromAngleAndSpeed(45, 9));\n v.add(Velocity.fromAngleAndSpeed(-45, 9));\n this.ballsFactory = new BallsFactory(this.ballsCenter, ballsRadius, ballsColor,\n screenWidth, screenHeight, v);\n\n //bodies.\n //tower.\n Block base = new Block(new Rectangle(new Point(surroundingBlocksWidth + screenWidth / 16, screenHeight * 0.7)\n , screenWidth / 6, screenHeight * 0.3), Color.darkGray);\n base.setNumber(-1);\n this.bodies.add(base);\n Block base2 = new Block(new Rectangle(new Point(base.getCollisionRectangle().getUpperLine()\n .middle().getX() - base.getWidth() / 6\n , base.getCollisionRectangle().getUpperLeft().getY() - base.getHeight() / 2.5), base.getWidth() / 3\n , base.getHeight() / 2.5), Color.gray);\n base2.setNumber(-1);\n this.bodies.add(base2);\n Block pole = new Block(new Rectangle(new Point(base2.getCollisionRectangle().getUpperLine().middle().getX()\n - base2.getWidth() / 6, base2.getCollisionRectangle().getUpperLeft().getY() - screenHeight / 3)\n , base2.getWidth() / 3, screenHeight / 3), Color.lightGray);\n pole.setNumber(-1);\n this.bodies.add(pole);\n\n double windowWidth = base.getWidth() / 10;\n double windowHeight = base.getHeight() / 7;\n double b = base.getWidth() / 12;\n double h = base.getHeight() / 20;\n for (int i = 0; i < 6; i++) { //windows of tower.\n for (int j = 0; j < 5; j++) {\n Block window = new Block(new Rectangle(new Point(base.getCollisionRectangle().getUpperLeft().getX() + b\n + (windowWidth + b) * j,\n base.getCollisionRectangle().getUpperLeft().getY() + h + (windowHeight + h) * i), windowWidth\n , windowHeight), Color.white);\n window.setNumber(-1);\n this.bodies.add(window);\n }\n }\n\n //circles on the top of the tower.\n Circle c1 = new Circle(pole.getCollisionRectangle().getUpperLine().middle().getX()\n , pole.getCollisionRectangle().getUpperLine().middle().getY() - 17, 17, Color.black, \"fill\");\n Circle c2 = new Circle(pole.getCollisionRectangle().getUpperLine().middle().getX()\n , pole.getCollisionRectangle().getUpperLine().middle().getY() - 17, 12, Color.darkGray, \"fill\");\n Circle c3 = new Circle(pole.getCollisionRectangle().getUpperLine().middle().getX()\n , pole.getCollisionRectangle().getUpperLine().middle().getY() - 17, 7, Color.red, \"fill\");\n this.bodies.add(c1);\n this.bodies.add(c2);\n this.bodies.add(c3);\n\n\n }", "public static int[][] generateBlockers () {\n int[][] blockers;\n\n blockers = new int[15][15];\n\n Random rd = new Random();\n\n for (int i = 0; i < 23; i++) { // 23 = (15^2)*.1\n int x = rd.nextInt(15);\n int y = rd.nextInt(15);\n\n // If the node is already blocked\n if (blockers[x][y] == 1) {\n blockers[rd.nextInt(15)][rd.nextInt(15)] = 1; // Try another node\n i++;\n } else // Otherwise block it\n blockers[x][y] = 1;\n }\n\n return blockers;\n }", "public int[][] getInitialState() {\n\t\treturn this.copyState(this.initialState);\n\t}", "public GraphicsState getState(\n )\n {return state;}", "public boolean func_149662_c(IBlockState state) { return false; }" ]
[ "0.6364879", "0.63023245", "0.6092061", "0.6014711", "0.6011321", "0.6008842", "0.6003559", "0.59003687", "0.58754456", "0.58576626", "0.5829526", "0.57795376", "0.5729798", "0.56857413", "0.566747", "0.565266", "0.5644729", "0.564054", "0.5606842", "0.5602364", "0.5601665", "0.55717665", "0.5560965", "0.5559527", "0.5551002", "0.55308074", "0.55296695", "0.55250823", "0.55216527", "0.5515468", "0.5499626", "0.5490904", "0.5487252", "0.54859996", "0.54785687", "0.5477753", "0.5448905", "0.5446535", "0.54306465", "0.54277575", "0.54268366", "0.54022396", "0.5391051", "0.5384549", "0.53829116", "0.53778416", "0.53762764", "0.5372877", "0.53719115", "0.5370908", "0.536786", "0.5365338", "0.53486", "0.533424", "0.53159654", "0.5313081", "0.53111154", "0.5298182", "0.52688897", "0.5247374", "0.5243004", "0.524216", "0.52292514", "0.5226641", "0.5225554", "0.5214207", "0.520646", "0.52057326", "0.5193631", "0.519303", "0.5188878", "0.5188878", "0.5188878", "0.5188878", "0.5188878", "0.5188878", "0.518881", "0.51727414", "0.51705104", "0.51666456", "0.5159511", "0.5158673", "0.51538265", "0.5142833", "0.51406187", "0.51405513", "0.5134877", "0.5130339", "0.51299113", "0.51265365", "0.5122889", "0.51190263", "0.51156884", "0.51121163", "0.5097604", "0.5088902", "0.50858355", "0.5063641", "0.50616", "0.50603294", "0.50533605" ]
0.0
-1
TODO receive mine damage
public boolean receiveDamage(Point damLoc, char damType) throws IllegalArgumentException { Point[] shipCoordinates = this.getShipCoordinates(); boolean shipDamaged = false; for (int i = 0; i < shipCoordinates.length; i++){ if (shipCoordinates[i].equals(damLoc)){ switch(damType){ case 't': shipDamaged = this.applyTorDamage(i); break; case 'g': shipDamaged = this.applyGunDamage(i); break; case 'm': shipDamaged = this.applyMineDamage(); break; default: throw new IllegalArgumentException (); } } } return shipDamaged; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void damage(){\n\n LevelMap.getLevel().damage(dmg);\n //System.out.println(\"died\");\n setDie();\n }", "public int giveDamage();", "@Override\r\n\tpublic void damage(float amount) {\n\t\t\r\n\t}", "@Override\n\tpublic void takeDamage(double damage) {\n\n\t}", "public int magicMissile();", "@Override\n public int doDamage() {\n if (difficulty <5)\n return damage;\n else \n return damage*2;\n }", "public void mine() {\n mined = true;\n }", "@Override\n public void onSmelting(EntityPlayer player, ItemStack item) \n {\n \n }", "@Override\n\tpublic int calculateDamage() \n\t{\n\t\t// TODO Auto-generated method stub\n\t\treturn 0;\n\t}", "private void takeDamage(int damage){ health -= damage;}", "@Override\n\tpublic void damage(float f) {\n\t\t\n\t}", "public short getSiegeWeaponDamage();", "int getDamage();", "int getDamage();", "int getDamage();", "int getDamage();", "int getDamage();", "public short getHandThrowDamage();", "private void subtractPlayerSheild(int damage) {\n this.playerShield -= damage;\n }", "@Override\n public void onCrafting(EntityPlayer player, ItemStack item, IInventory craftMatrix) \n {\n if (item.itemID == mod_TFmaterials.RubyPickaxe.itemID)\n {\n \t//player.addStat(mod_TFmaterials.RubyPickAchieve, 1);\n \tplayer.addStat(mod_TFmaterials.RubyPickAchieve, 1);\n }\n }", "@Override\n public int damage(){\n int damage = 0;\n Random rand = new Random();\n int x = rand.nextInt(20) + 1;\n if (x == 1)\n damage = 50;\n return damage; \n }", "public void takeDamage(int damage);", "@Override\n public int craftBonus() {\n\treturn 1;\n }", "public void getAttackedByDarknessMagicBook(IEquipableItem item){item.strongAttackTo(this.getOwner());}", "private void subtractEnemySheild(int damage) {\n this.enemyShield -= damage;\n }", "@Override\n public void onSmelting(EntityPlayer player, ItemStack item) {\n }", "public void baptism() {\n for (Card targetCard : Battle.getInstance().getActiveAccount().getActiveCardsOnGround().values()) {\n if (targetCard instanceof Minion) {\n targetCard.setHolyBuff(2, 1);\n }\n }\n }", "public void ability(LevelManager lm){\n\n int prevDamage = lm.player.getDamage();\n int newDamage = prevDamage+12;\n lm.player.setDamage(newDamage);\n }", "protected void takeDamage(int damage)\n {\n health = health - damage;\n \n }", "@Override\n public void use(AbstractPlayer p, AbstractMonster m) {\n addToBot(new GainBlockAction(p,block));\n if (AbstractDungeon.player.hand.contains(this)){\n if (AbstractDungeon.player.hand.group.indexOf(this)-1 >= 0){\n addToBot(new RewindAction(AbstractDungeon.player.hand.group.get(AbstractDungeon.player.hand.group.indexOf(this)-1),AbstractDungeon.player.hand));\n }\n if (AbstractDungeon.player.hand.group.indexOf(this)+1 <= AbstractDungeon.player.hand.group.size()-1){\n addToBot(new RewindAction(AbstractDungeon.player.hand.group.get(AbstractDungeon.player.hand.group.indexOf(this)+1),AbstractDungeon.player.hand));\n }\n }\n }", "public int getDmg(){\r\n return enemyDmg;\r\n }", "public int getDamage() {\n \t\treturn damage + ((int) 0.5*level);\n \t}", "public static double getWeaponDamage(Item weapon, Skill attStrength) {\n/* 2348 */ if (weapon.isBodyPart() && weapon.getAuxData() != 100) {\n/* */ \n/* */ try {\n/* */ \n/* 2352 */ float f = Server.getInstance().getCreature(weapon.getOwnerId()).getCombatDamage(weapon);\n/* */ \n/* 2354 */ return (f + Server.rand.nextFloat() * f * 2.0F);\n/* */ }\n/* 2356 */ catch (NoSuchCreatureException nsc) {\n/* */ \n/* 2358 */ logger.log(Level.WARNING, \"Could not find Creature owner of weapon: \" + weapon + \" due to \" + nsc.getMessage(), (Throwable)nsc);\n/* */ \n/* */ }\n/* 2361 */ catch (NoSuchPlayerException nsp) {\n/* */ \n/* 2363 */ logger.log(Level.WARNING, \"Could not find Player owner of weapon: \" + weapon + \" due to \" + nsp.getMessage(), (Throwable)nsp);\n/* */ } \n/* */ }\n/* */ \n/* */ \n/* 2368 */ float base = 6.0F;\n/* 2369 */ if (weapon.isWeaponSword()) {\n/* */ \n/* 2371 */ base = 24.0F;\n/* */ }\n/* 2373 */ else if (weapon.isWeaponAxe()) {\n/* 2374 */ base = 30.0F;\n/* 2375 */ } else if (weapon.isWeaponPierce()) {\n/* 2376 */ base = 12.0F;\n/* 2377 */ } else if (weapon.isWeaponSlash()) {\n/* 2378 */ base = 18.0F;\n/* 2379 */ } else if (weapon.isWeaponCrush()) {\n/* 2380 */ base = 36.0F;\n/* 2381 */ } else if (weapon.isBodyPart() && weapon.getAuxData() == 100) {\n/* */ \n/* 2383 */ base = 6.0F;\n/* */ } \n/* 2385 */ if (weapon.isWood()) {\n/* 2386 */ base *= 0.1F;\n/* 2387 */ } else if (weapon.isTool()) {\n/* 2388 */ base *= 0.3F;\n/* */ } \n/* 2390 */ base = (float)(base * (1.0D + attStrength.getKnowledge(0.0D) / 100.0D));\n/* */ \n/* 2392 */ float randomizer = (50.0F + Server.rand.nextFloat() * 50.0F) / 100.0F;\n/* */ \n/* 2394 */ return base + (randomizer * base * 4.0F * weapon.getQualityLevel() * weapon.getDamagePercent()) / 10000.0D;\n/* */ }", "public void takedmg(int dmg){\n curHp -= dmg;\n }", "public int getMetadata(int damage) {\n/* 50 */ return damage;\n/* */ }", "private void calculateDamage() {\n this.baseDamage = this.actualBaseDamage;\n this.applyPowers();\n this.baseDamage = Math.max(this.baseDamage - ((this.baseDamage * this.otherCardsPlayed) / this.magicNumber), 0);\n }", "private void addPlayerSheild() {\n this.playerShield += 1;\n }", "public short getBowDamage();", "@Override\n public void chew() {\n MessageUtility.logSound(name,\"Bleats and Stomps its legs, then chews\");\n }", "@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)\r\n public void onPlayerDamagedByPlayer(final EntityDamageByEntityEvent event) {\n if (!(event.getEntity() instanceof Player)) {\r\n return;\r\n }\r\n if (!(event.getDamager() instanceof Player)) {\r\n return;\r\n }\r\n \r\n final Player target = (Player)event.getEntity();\r\n final Player attacker = (Player)event.getDamager();\r\n final ItemStack is = attacker.getItemInHand();\r\n \r\n if (is != null){\r\n switch (is.getType()){\r\n case EMERALD:\r\n attacker.setItemInHand(ItemUtil.decrementItem(is, 1));\r\n \r\n // 体力・空腹回復、燃えてたら消化\r\n target.setHealth(target.getMaxHealth());\r\n target.setFoodLevel(20);\r\n target.setFireTicks(0);\r\n \r\n // ポーション効果付与\r\n target.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 45 * 20, 0)); // 45 secs\r\n target.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 7 * 60 * 20, 0)); // 7 mins\r\n target.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 9 * 60 * 20, 1)); // 9 mins\r\n target.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 9 * 60 * 20, 0)); // 9 mins\r\n target.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 5 * 60 * 20, 1)); // 5 mins\r\n target.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 3 * 60 * 20, 0)); // 3 mins\r\n \r\n // effect, messaging\r\n target.getWorld().playEffect(target.getLocation(), Effect.ENDER_SIGNAL, 0, 10);\r\n Util.message(target, PlayerManager.getPlayer(attacker).getName() + \" &aから特殊効果を与えられました!\");\r\n Util.message(attacker, PlayerManager.getPlayer(target).getName() + \" &aに特殊効果を与えました!\");\r\n \r\n event.setCancelled(true);\r\n event.setDamage(0);\r\n break;\r\n default: break;\r\n }\r\n }\r\n }", "public static void damageStep () {\r\n // rough plan:\r\n // #1: flip defending monster, if face down -> see flipMonster(...);\r\n // #2: Ask CPU and player for possible effect negation! (For an attack negation it is too late!) -> see below in this method\r\n // #3: calculate damage, kill monsters, if needed\r\n // (consider also banishing and immunity, also copied passive effect of (Holy) Lance)\r\n // -> see makeDamageCalculation(...);\r\n // #4: decrease life points, if needed -> see isDealingBattleDamageAndContinuingGame(...);\r\n // #5: consider passive (also copied) trap monster effects -> see possibleSuicideEffect(...);\r\n // #6: display Win/Lose dialog and end match, if needed -> see Game.over(...);\r\n // #7: finally end the attack (consider the effects that happen afterwards), thus allowing the next attack -> endDamageStep(...);\r\n \r\n // about #1:\r\n if (Game.ActiveGuardingMonster.isFaceDown) {flipMonster(Game.ActiveGuardingMonster);}\r\n // about #2:\r\n if (Game.ActiveAttackingMonster.canBeNegated() || Game.ActiveGuardingMonster.canBeNegated()) {\r\n AIinterrupts.cpuIsUsingEffectNegateDuringBattlePhase(); // ask CPU to negate effects first\r\n // ask player to negate effect here\r\n boolean isCanceling = false;\r\n boolean hasEffectNegateHandTrap = Hand.lookForEffectNegateOnHand(true);\r\n boolean hasEffectNegateOnField = Hand.lookForEffectNegateOnField(true);\r\n if (hasEffectNegateHandTrap || hasEffectNegateOnField) {\r\n if (hasEffectNegateHandTrap && !hasEffectNegateOnField) {\r\n isCanceling = PlayerInterrupts.playerMayNegateEffect(Game.ActiveAttackingMonster, Game.ActiveGuardingMonster, true);\r\n }\r\n else if (!hasEffectNegateHandTrap && hasEffectNegateOnField) {\r\n isCanceling = PlayerInterrupts.playerMayNegateEffect(Game.ActiveAttackingMonster, Game.ActiveGuardingMonster, false);\r\n }\r\n else {\r\n int intDialogResult = YuGiOhJi.multipleChoiceDialog(\"Do you want to negate effects on the field?\", \"You can negate passive effects.\", new String[]{\"yes, by discarding Neutraliser\", \"yes, by paying the cost worth 1 card\", \"no (default)\"}, \"no (default)\");\r\n if (intDialogResult==0) {\r\n isCanceling = PlayerInterrupts.playerMayNegateEffect(Game.ActiveAttackingMonster, Game.ActiveGuardingMonster, true);\r\n }\r\n else if (intDialogResult==1) {\r\n isCanceling = PlayerInterrupts.playerMayNegateEffect(Game.ActiveAttackingMonster, Game.ActiveGuardingMonster, false);\r\n }\r\n }\r\n }\r\n if (!isCanceling) {\r\n makeDamageCalculation(Game.ActiveAttackingMonster, Game.ActiveGuardingMonster); // whole rest of battle\r\n }\r\n }\r\n else {\r\n makeDamageCalculation(Game.ActiveAttackingMonster, Game.ActiveGuardingMonster); // whole rest of battle\r\n }\r\n \r\n }", "public MineHard()\r\n { \r\n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\r\n super(16, 16, 32);\r\n addObject(new Person() , 1 , 14);\r\n addObject(new Rock() , 1 , 15);\r\n addObject(new Rock() , 8 , 15);\r\n addObject(new Rock() , 12 , 15);\r\n addObject(new Rock() , 5 , 14);\r\n addObject(new Rock() , 15 , 13);\r\n addObject(new Rock() , 9 , 13);\r\n addObject(new Rock() , 12 , 12);\r\n addObject(new Rock() , 10 , 11);\r\n addObject(new Rock() , 7 , 11);\r\n addObject(new Rock() , 2 , 11);\r\n addObject(new Rock() , 1 , 12);\r\n addObject(new Rock() , 15 , 10);\r\n addObject(new Rock() , 12 , 9);\r\n addObject(new Rock() , 4 , 9);\r\n addObject(new Rock() , 1 , 9);\r\n addObject(new Rock() , 11 , 8);\r\n addObject(new Rock() , 13 , 7);\r\n addObject(new Rock() , 10 , 7);\r\n addObject(new Rock() , 9 , 7);\r\n addObject(new Rock() , 8 , 7);\r\n addObject(new Rock() , 7 , 7);\r\n addObject(new Rock() , 2 , 6);\r\n addObject(new Rock() , 5 , 5);\r\n addObject(new Rock() , 12 , 5);\r\n addObject(new Rock() , 9 , 4);\r\n addObject(new Rock() , 13 , 2);\r\n addObject(new Rock() , 3 , 3);\r\n addObject(new Rock() , 4 , 2);\r\n addObject(new Rock() , 1 , 1);\r\n addObject(new Rock() , 9 , 1);\r\n addObject(new Rock() , 10 , 0);\r\n addObject(new Rock() , 0 , 0);\r\n addObject(new Rock() , 0 , 7);\r\n addObject(new Rock() , 5 , 0);\r\n addObject(new Rock() , 15 , 0);\r\n addObject(new Rock() , 15 , 8);\r\n \r\n addObject(new Goldbar() , 15 , 2);\r\n addObject(new Goldbar() , 12 , 8);\r\n addObject(new Goldbar() , 15 , 15);\r\n addObject(new Goldbar() , 3 , 2);\r\n addObject(new Goldbar() , 9 , 0);\r\n addObject(new Goldbar() , 2 , 9);\r\n \r\n addObject(new Zombie() , 13 , 13);\r\n addObject(new Zombie() , 12 , 6);\r\n addObject(new Zombie() , 6 , 0);\r\n addObject(new Zombie() , 1 , 4);\r\n addObject(new Zombie() , 7 , 9);\r\n addObject(new TryC() , 2 , 1);\r\n addObject(new MainMenu() , 12 , 1);\r\n }", "public void hack(Entity e) {\r\n\t\te.modifyHp(10);\r\n\t}", "public int getDamage() {\n //TODO\n return 1;\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 applyEffect(Battle battle, Cell cell, Account player, int activeTime) {\n /* if (activeTime != -1)\n return;\n ManaItemBuff manaItemBuff = new ManaItemBuff(player, 1);\n manaItemBuff.setTurnCounter(-5);\n manaItemBuff.castBuff();\n player.getOwnBuffs().add(manaItemBuff);*/\n }", "public void takeDamage(double damage){\n damage -= this.armor;\n this.health -= damage;\n }", "public void func_180430_e(float distance, float damageMultiplier) {}", "public Wand() {\n damage = 5;\n damageType = \"Magic\";\n }", "private void addEnemySheild() {\n this.enemyShield += 1;\n }", "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 void takeDamage(int damage) {\n Random rand = new Random();\n int game = rand.nextInt(51) + 75;\n double game2 = (double) game;\n double percDamage = game2/100.0;\n double realSomething = (double) damage;\n double actualDamageNotReal = realSomething * percDamage;\n int actualDamage = (int) actualDamageNotReal;\n int actualDmg = actualDamage - this.armour;\n if (actualDmg <= 0){\n actualDmg = 0;\n }\n this.health -= actualDmg;\n slowDisplay(String.format(\"%s takes %s damage, now at %s\\n\",this.name,actualDmg,this.health));\n\n }", "@Override\n public String performSpecialEffect() {\n this.health += HEALTH_STEAL_AMOUNT;\n return \"The vampire stole a bit of health after it attacked.\";\n }", "void DoMining(float x, float y) {\n\t\tWorld world = World.CurrentWorld;\n\t\t\n\t\tMapRenderer.CurrentRenderer.ItemAnimation = null;\n\t\t\tmineTime = 0;\n\t\t\tlastDamaged.set(x,y);\n\t\t\n\t\t\tInvObject item = null;\n\t\t\tif(inventory.BagItem[inventory.currSelected][1] > 0)\n\t\t\t\titem = inventory.Items[inventory.BagItem[inventory.currSelected][0]];\n\t\t\tint delay = 100;\n\t\t\tif(item != null)\n\t\t\t\tdelay = item.Delay;\n\t\t\n//\t\t\tif(TimeUtils.millis() - LastUsed > delay)\n//\t\t\t{\n\t\t\t\tif(inventory.BagItem[inventory.currSelected][1] > 0)\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tprog2.x = pos.x+0.5f;\n\t\t\t\t\tprog2.y = pos.y+0.5f;\n\t\t\t\t\tMapRenderer.CurrentCam.project(prog2);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tRay projectCoordinates = MapRenderer.CurrentCam.getPickRay(Gdx.input.getX(0), Gdx.input.getY(0));\n\t\t\t\t\tfloat x2 = (projectCoordinates.origin.x);\n\t\t\t\t\tfloat y2 = (projectCoordinates.origin.y);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tfloat angle = (float) Math.toDegrees(MathUtils.atan2(y-prog2.y, x-prog2.x));\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif(World.CurrentWorld.isClient) {\n\n\t\t\t\t\t\tWorld.CurrentWorld.client.serverBob.remoteOnUse((int)x2,(int)y2,angle);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(World.CurrentWorld.server != null) {\n\t\t\t\t\t\tonServerUse(item,x2,y2,angle);\n\t\t\t\t\t}\n\t\t\t\t\tif(item.HoldTouch) {\n\t\t\t\t\titem.OnUse(this,x2, y2,angle);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif(Gdx.input.justTouched())\n\t\t\t\t\t\t\titem.OnUse(this,x2, y2,angle);\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\tLastUsed = TimeUtils.millis();\n//\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\n\t}", "public void takeDamage(int damage) {\n this.damageTaken += damage;\n }", "@Override\n public void use(AbstractPlayer p, AbstractMonster m) {\n addToBot(new DamageAction(m, new DamageInfo(p, damage, damageTypeForTurn), AbstractGameAction.AttackEffect.BLUNT_LIGHT));\n int count = 0;\n for (AbstractMonster monster : AbstractDungeon.getMonsters().monsters) {\n if (!monster.isDeadOrEscaped()) {\n count++;\n }\n }\n if (count > 1) {\n addToBot(new DamageAllEnemiesAction(p, multiDamage, damageTypeForTurn, AbstractGameAction.AttackEffect.BLUNT_LIGHT));\n }\n }", "static int bukkitToneAmount() { return 25; }", "void damagePlayer(int i) throws IOException {\n }", "public IIcon getIconFromDamage(int par1)\n/* 54: */ {\n/* 55:53 */ if (this.isIron) {\n/* 56:54 */ return Items.iron_sword.getIconFromDamage(par1);\n/* 57: */ }\n/* 58:55 */ return Items.diamond_sword.getIconFromDamage(par1);\n/* 59: */ }", "@Override\n public int damage() {\n int newDamage=criticalStrike();\n return newDamage;\n }", "@Override\r\n\tpublic void uniqueOnStartInteraction() {\n\t\tif (Main.clientPlayer.getNumWood() < cost) {\r\n\t\t\tMain.clientPlayer.stopInteraction();\r\n\t\t}\r\n\r\n\t}", "public void applyDamage(int damage)\r\n\t{\r\n\r\n\t}", "public int calcCharMagicDamage() \n\t{\n\t\treturn npcInt;\n\t}", "@Override\n\tpublic double attack() {\n\t\treturn 12.5;\n\t}", "@Override\r\n public void use(AbstractPlayer p, AbstractMonster m) {\r\n // Gain Block\r\n AbstractDungeon.actionManager.addToBottom(new GainBlockAction(p, p, block));\r\n\r\n // Food eaten += 3\r\n this.addToBot(new ApplyPowerAction(p, p, new FoodEatenPower(p, p, baseMagicNumber)));\r\n }", "public void takeDamage()\n {\n if(getWorld()!= null)\n {\n if(this.isTouching(Enemies.class))\n {\n Life = Life - Enemies.damage;\n if(Life <=0)\n {\n getWorld().removeObject(this);\n Store.wealth += Game.credit;\n }\n }\n }\n }", "public int getDamage () {\n\t\treturn (this.puissance + stuff.getDegat());\n\t}", "@Override\n public void applyItem() {\n Player player;\n if (Battle.getRunningBattle().getTurn() % 2 == 1)\n player = Battle.getRunningBattle().getPlayer2();\n else\n player = Battle.getRunningBattle().getPlayer1();\n\n if (player.getInGameCards().size() == 0)\n return;\n Random random = new Random();\n int randomIndex = random.nextInt(player.getInGameCards().size());\n while (!(getPlayer().getInGameCards().get(randomIndex) instanceof Warrior)) {\n randomIndex = random.nextInt(getPlayer().getInGameCards().size());\n }\n\n Buff buff = new PoisonBuff(1, true);\n buff.setWarrior((Warrior) player.getInGameCards().get(randomIndex));\n Battle.getRunningBattle().getPassiveBuffs().add(buff);\n }", "PlayingSquare giveDamage(int damage);", "@Override\n\tpublic void attack(Fightable f, int special) {\n\t\tif(super.getLuck() >= rand.nextInt(100) + 1){\n\t\t\t((Player)f).setCurHp(((Player)f).getCurHp() - special*(super.getDamage()+super.getAtkRange()));\n\t\t\treturn;\n\t\t}\n\t\t((Player)f).setCurHp(((Player)f).getCurHp() - super.getDamage()+super.getAtkRange());\n\t}", "public void takeDamage(int amount){\r\n\t\tthis.life = this.life - amount;\r\n\t}", "public abstract int getRandomDamage();", "private int lightAttack() {\n return attack(9, 0);\n }", "public void getKilledProduct() \n {\n try{\n Player.getInstance().getInventory().add(new CowMeat());\n } catch (IllegalAccessException e) {\n //Do nothing\n }\n }", "private void subtractPlayerHealth(int damage) {\n this.playerShipHealth -= damage;\n }", "private void subtractEnemyMissile() {\n this.enemyMissile -= 1;\n }", "public boolean processInteract(EntityPlayer entityplayer, EnumHand hand, @Nullable ItemStack stack)\n {\n ItemStack itemstack = entityplayer.inventory.getCurrentItem();\n\n if (!bumgave && angerLevel == 0)\n {\n if (itemstack != null && (itemstack.getItem() == Items.DIAMOND || itemstack.getItem() == Items.GOLD_INGOT || itemstack.getItem() == Items.IRON_INGOT))\n {\n if (itemstack.getItem() == Items.IRON_INGOT)\n {\n value = rand.nextInt(2) + 1;\n }\n else if (itemstack.getItem() == Items.GOLD_INGOT)\n {\n value = rand.nextInt(5) + 1;\n }\n else if (itemstack.getItem() == Items.DIAMOND)\n {\n value = rand.nextInt(10) + 1;\n }\n\n if (itemstack.stackSize - 1 == 0)\n {\n entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, null);\n }\n else\n {\n itemstack.stackSize--;\n }\n\n for (int i = 0; i < 4; i++)\n {\n for (int i1 = 0; i1 < 10; i1++)\n {\n double d1 = rand.nextGaussian() * 0.02D;\n double d3 = rand.nextGaussian() * 0.02D;\n double d6 = rand.nextGaussian() * 0.02D;\n worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_NORMAL, (posX + (double)(rand.nextFloat() * width * 2.0F)) - (double)width, posY + (double)(rand.nextFloat() * height) + (double)i, (posZ + (double)(rand.nextFloat() * width * 2.0F)) - (double)width, d1, d3, d6);\n }\n }\n\n texture = new ResourceLocation(Reference.MODID, Reference.TEXTURE_PATH_ENTITES +\n \t\tReference.TEXTURE_BUM_DRESSED);\n angerLevel = 0;\n //findPlayerToAttack();\n\n if (rand.nextInt(5) == 0)\n {\n // worldObj.playSoundAtEntity(this, \"morecreeps:bumsucker\", 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n worldObj.playSound((EntityPlayer) null, getPosition(), MCSoundEvents.ENTITY_BUM_SUCKER, SoundCategory.NEUTRAL, 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n bumgave = true;\n }\n else\n {\n // worldObj.playSoundAtEntity(this, \"morecreeps:bumthankyou\", 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n worldObj.playSound((EntityPlayer) null, getPosition(), MCSoundEvents.ENTITY_BUM_THANKYOU, SoundCategory.NEUTRAL, 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n bumgave = true;\n\n for (int j = 0; j < 10; j++)\n {\n double d = rand.nextGaussian() * 0.02D;\n double d2 = rand.nextGaussian() * 0.02D;\n double d5 = rand.nextGaussian() * 0.02D;\n worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_NORMAL, (posX + (double)(rand.nextFloat() * width * 2.0F)) - (double)width, posY + (double)(rand.nextFloat() * height), (posZ + (double)(rand.nextFloat() * width * 2.0F)) - (double)width, d, d2, d5);\n }\n\n for (int k = 0; k < value; k++)\n {\n \tif(!worldObj.isRemote) {\n\t dropItem(Item.getItemById(rand.nextInt(95)), 1);\n\t dropItem(Items.IRON_SHOVEL, 1);\n \t}\n }\n\n return true;\n }\n }\n else if (itemstack != null)\n {\n if (timetopee > 0)\n {\n // worldObj.playSoundAtEntity(this, \"morecreeps:bumdontwant\", 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n worldObj.playSound((EntityPlayer) null, getPosition(), MCSoundEvents.ENTITY_BUM_DONTWANT, SoundCategory.NEUTRAL, 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n \n }\n else if (itemstack != null && (itemstack.getItem() == Item.getItemFromBlock(Blocks.YELLOW_FLOWER) || itemstack.getItem() == Item.getItemFromBlock(Blocks.RED_FLOWER)))\n {\n \t/* TODO\n \tif(!((EntityPlayerMP)entityplayer).getStatFile().hasAchievementUnlocked(MoreCreepsAndWeirdos.achievebumflower))\n \t{\n \tworldObj.playSoundAtEntity(entityplayer, \"morecreeps:achievement\", 1.0F, 1.0F);\n \tentityplayer.addStat(MoreCreepsAndWeirdos.achievebumflower, 1);\n \tconfetti(entityplayer);\n \t} */\n\n // worldObj.playSoundAtEntity(this, \"morecreeps:bumthanks\", 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n worldObj.playSound((EntityPlayer) null, getPosition(), MCSoundEvents.ENTITY_BUM_THANKS, SoundCategory.NEUTRAL, 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n timetopee = rand.nextInt(1900) + 1500;\n\n if (itemstack.stackSize - 1 == 0)\n {\n entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, null);\n }\n else\n {\n itemstack.stackSize--;\n }\n }\n else if (itemstack != null && itemstack.getItem() == Items.BUCKET)\n {\n \t/* TODO\n if (!((EntityPlayerMP)entityplayer).getStatFile().hasAchievementUnlocked(MoreCreepsAndWeirdos.achievebumpot) && ((EntityPlayerMP)entityplayer).getStatFile().hasAchievementUnlocked(MoreCreepsAndWeirdos.achievebumflower))\n {\n worldObj.playSoundAtEntity(entityplayer, \"morecreeps:achievement\", 1.0F, 1.0F);\n entityplayer.addStat(MoreCreepsAndWeirdos.achievebumpot, 1);\n confetti(entityplayer);\n } \n entityplayer.addStat(MoreCreepsAndWeirdos.achievebumpot, 1);\n */\n // worldObj.playSoundAtEntity(this, \"morecreeps:bumthanks\", 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n worldObj.playSound((EntityPlayer) null, getPosition(), MCSoundEvents.ENTITY_BUM_THANKS, SoundCategory.NEUTRAL, 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n timetopee = rand.nextInt(1900) + 1500;\n\n if (itemstack.stackSize - 1 == 0)\n {\n entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, null);\n }\n else\n {\n itemstack.stackSize--;\n }\n }\n else if (itemstack != null && itemstack.getItem() == Items.LAVA_BUCKET)\n {\n \t/* \n if (!((EntityPlayerMP)entityplayer).getStatFile().hasAchievementUnlocked(MoreCreepsAndWeirdos.achievebumlava) && ((EntityPlayerMP)entityplayer).getStatFile().hasAchievementUnlocked(MoreCreepsAndWeirdos.achievebumpot))\n {\n worldObj.playSoundAtEntity(entityplayer, \"morecreeps:achievement\", 1.0F, 1.0F);\n entityplayer.addStat(MoreCreepsAndWeirdos.achievebumlava, 1);\n confetti(entityplayer);\n }\n\n entityplayer.addStat(MoreCreepsAndWeirdos.achievebumpot, 1);\n */\n // worldObj.playSoundAtEntity(this, \"morecreeps:bumthanks\", 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n worldObj.playSound((EntityPlayer) null, getPosition(), MCSoundEvents.ENTITY_BUM_THANKS, SoundCategory.NEUTRAL, 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n timetopee = rand.nextInt(1900) + 1500;\n\n if (itemstack.stackSize - 1 == 0)\n {\n entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, null);\n }\n else\n {\n itemstack.stackSize--;\n }\n\n int l = (int)posX;\n int j1 = (int)posY;\n int k1 = (int)posZ;\n\n if (rand.nextInt(4) == 0)\n {\n for (int l1 = 0; l1 < rand.nextInt(3) + 1; l1++)\n {\n Blocks.OBSIDIAN.dropBlockAsItem(worldObj, new BlockPos(l, j1, k1), worldObj.getBlockState(new BlockPos(l, j1, k1)), 0);\n }\n }\n\n for (int i2 = 0; i2 < 15; i2++)\n {\n double d4 = (float)l + worldObj.rand.nextFloat();\n double d7 = (float)j1 + worldObj.rand.nextFloat();\n double d8 = (float)k1 + worldObj.rand.nextFloat();\n double d9 = d4 - posX;\n double d10 = d7 - posY;\n double d11 = d8 - posZ;\n double d12 = MathHelper.sqrt_double(d9 * d9 + d10 * d10 + d11 * d11);\n d9 /= d12;\n d10 /= d12;\n d11 /= d12;\n double d13 = 0.5D / (d12 / 10D + 0.10000000000000001D);\n d13 *= worldObj.rand.nextFloat() * worldObj.rand.nextFloat() + 0.3F;\n d9 *= d13;\n d10 *= d13;\n d11 *= d13;\n worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, (d4 + posX * 1.0D) / 2D, (d7 + posY * 1.0D) / 2D + 2D, (d8 + posZ * 1.0D) / 2D, d9, d10, d11);\n worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d4, d7, d8, d9, d10, d11);\n }\n\n if (rand.nextInt(4) == 0)\n {\n entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, new ItemStack(Items.BUCKET));\n }\n }\n else if (!bumgave)\n {\n // worldObj.playSoundAtEntity(this, \"morecreeps:bumpee\", 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n worldObj.playSound((EntityPlayer) null, getPosition(), MCSoundEvents.ENTITY_BUM_PEE, SoundCategory.NEUTRAL, 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n }\n }\n }\n else\n {\n // worldObj.playSoundAtEntity(this, \"morecreeps:bumleavemealone\", 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n worldObj.playSound((EntityPlayer) null, getPosition(), MCSoundEvents.ENTITY_BUM_LEAVEMEALONE, SoundCategory.NEUTRAL, 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n }\n\n return super.processInteract(entityplayer, hand, stack);\n }", "private void subtractPlayerMissile() {\n this.playerMissile -= 1;\n }", "public void damage(int amount) {\n \tshield = shield - amount;\n }", "@Override\n public void use(AbstractPlayer p, AbstractMonster m) {\n AbstractDungeon.actionManager.addToBottom(new VFXAction(p, new FlameBarrierEffect(p.hb.cX, p.hb.cY), 0.5F));\n AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(p, m, new FlameWardPower(p, block, magicNumber)));\n }", "protected int recalculateDamage(int baseDamage, Conveyer info, Combatant striker, Combatant victim) {\n return baseDamage;\n }", "public void recieveDamage(){\n this.health--;\n }", "@Override\n public void use(AbstractPlayer p, AbstractMonster m) {\n AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(p, p, new ArtifactPower(p, magicNumber), magicNumber));\n }", "public void cheat() {\r\n\t\t\t\tnourriture += population*10;\r\n\t\t\t\tarmee += population/2;\r\n\t\t\t\tpopulation += armee*tailleArmee;\r\n\t\t\t}", "private int heavyAttack() {\n return attack(6, 2);\n }", "@Override\n public void increaseStrength(int power) {\n this.damageStrength += power;\n }", "boolean takeDamage(int dmg);", "@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}", "@Override\n\tpublic void attack() {\n\n\t}", "public void doItemEffect(RobotPeer robot){\n\t\t//System.out.println(\"Energy = \" + robot.getEnergy());\n\t\trobot.updateEnergy(-15);\n\t\t//System.out.println(\"Poison item USED\");\n\t\t//System.out.println(\"Energy = \" + robot.getEnergy());\n\t\t\n\t}", "private void subtractEnemyHealth(int damage) {\n this.enemyShipHealth -= damage;\n }", "public float getHungerDamage();", "public static void giveStuff(GamePlayer player) {\r\n\t\tItemStack sword = new ItemStack(Material.WOOD_SWORD);\r\n\t\tItemStack bow = new ItemStack(Material.BOW);\r\n\t\tItemStack arrow = new ItemStack(Material.ARROW);\r\n\t\tItemStack compass = new ItemStack(Material.COMPASS);\r\n\t\tItemMeta compassMeta = sword.getItemMeta();\r\n\t\tItemMeta swordMeta = sword.getItemMeta();\r\n\t\tItemMeta bowMeta = sword.getItemMeta();\r\n\t\t\r\n\t\tplayer.getPlayer().getInventory().clear();\r\n\t\tswordMeta.spigot().setUnbreakable(true);\r\n\t\tsword.setItemMeta(swordMeta);\r\n\t\tsword.setAmount(1);\r\n\t\t\r\n\t\tbowMeta.spigot().setUnbreakable(true);\r\n\t\tbowMeta.setDisplayName(\"§aSniper§r §7(One Shot Kill)\");\r\n\t\tbow.setItemMeta(bowMeta);\r\n\t\tbow.addUnsafeEnchantment(Enchantment.ARROW_DAMAGE, 10);\r\n\t\tbow.setAmount(1);\r\n\t\t\r\n\t\tarrow.setAmount(1);\r\n\t\t\r\n\t\tcompassMeta.setDisplayName(\"§aTarget Tracker\");\r\n\t\tcompass.setItemMeta(compassMeta);\r\n\t\tcompass.setAmount(1);\r\n\t\t\r\n player.getPlayer().getInventory().addItem(sword);\r\n player.getPlayer().getInventory().addItem(bow);\r\n player.getPlayer().getInventory().addItem(arrow);\r\n player.getPlayer().getInventory().addItem(compass);\r\n\t}", "@Override\n\tpublic void attack(Slime slime) {\n\t\t\n\t}", "public void specialEffect() {\n if (getDefense() > 0) {\n setDefense(0);\n setCurrentHealth(currentHealth + 50);\n }\n\n }", "@Override\n public void use(AbstractPlayer p, AbstractMonster m) {\n //give player plated armor\n AbstractDungeon.actionManager.addToBottom( // 2.Gain plated armor\n new com.megacrit.cardcrawl.actions.common.ApplyPowerAction(AbstractDungeon.player, AbstractDungeon.player,\n new com.megacrit.cardcrawl.powers.PlatedArmorPower(AbstractDungeon.player, 3), 3));\n }", "public void attack() {\n energy = 2;\n redBull = 0;\n gun = 0;\n target = 1;\n // if Player is in range take off a life.\n if (CharacterTask.ghostLocation == GameWindow.playerLocation) {\n playerLives = playerLives - 1;\n System.out.println(\"Player Lives: \" + playerLives);\n }\n }", "public int getDamage() {\n return damage;\n }", "@Override\n\t\t\tpublic void shotHere(boolean wasHit, int shipMod, Coordinate c) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void shotHere(boolean wasHit, int shipMod, Coordinate c) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void shotHere(boolean wasHit, int shipMod, Coordinate c) {\n\t\t\t\t\n\t\t\t}" ]
[ "0.6851247", "0.6705425", "0.6686184", "0.65720767", "0.6533823", "0.6513867", "0.65130293", "0.650961", "0.647972", "0.64730346", "0.6464171", "0.6412588", "0.6375703", "0.6375703", "0.6375703", "0.6375703", "0.6375703", "0.6372611", "0.6372541", "0.6364834", "0.63643914", "0.6353896", "0.63316643", "0.63141865", "0.63025486", "0.6301603", "0.6294799", "0.6286648", "0.6248439", "0.6224566", "0.62043446", "0.61908704", "0.61782575", "0.6172839", "0.61719996", "0.6168275", "0.6163931", "0.6154647", "0.6138927", "0.61220574", "0.6120289", "0.61161596", "0.6116124", "0.61108214", "0.61025786", "0.6100852", "0.60975343", "0.6094636", "0.6087439", "0.60818225", "0.6077783", "0.6073055", "0.60728407", "0.60722864", "0.60652477", "0.6064707", "0.6056792", "0.60472655", "0.60413027", "0.6040965", "0.6040887", "0.60376936", "0.6025736", "0.6024858", "0.60244954", "0.60239977", "0.60097003", "0.600461", "0.6003024", "0.60014826", "0.5998062", "0.59979236", "0.5987011", "0.59809977", "0.5979578", "0.5976948", "0.59729403", "0.5969523", "0.59613925", "0.5948594", "0.5944864", "0.59374386", "0.59342164", "0.5929229", "0.5924704", "0.59241784", "0.5922882", "0.59211", "0.59198165", "0.5917952", "0.59154075", "0.5915174", "0.59138924", "0.59126294", "0.5911711", "0.59084", "0.5906856", "0.5902741", "0.59022266", "0.59022266", "0.59022266" ]
0.0
-1
Takes a point as the new position, checks validity and then sets the point of the new bow
public void setPosition(Point newPosition)throws IllegalArgumentException { if (newPosition.x < 0 || newPosition.y < 0 || newPosition.x > 30 || newPosition.y > 30){ throw new IllegalArgumentException(); } else { this.position = newPosition; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract void setPoint(Point p);", "void setPosition(Point point);", "public void setPosition(Point newPosition);", "public void setPosition(Point position);", "public T setPoint(@NonNull PointF point) {\n return setPoint(point.x, point.y);\n }", "public void setPoint(double point){\r\n this.point = point;\r\n }", "private BoatBean createBoatAtThisPointWithThisSize(PointBean point, int newBoatSize) {\n\t\t// Trouver une direction random et tester dans cette direction\n\t\tDirection direction = Direction.values()[Util.getRandomInt(0, 3)];\n\t\tBoatBean newBoat = null;\n\t\tint durectionTriedNumber = 0;\n\t\twhile ((durectionTriedNumber < 4) && (newBoat == null)) {\n\t\t\tBoatFactory boatFactory = new BoatFactory(newBoatSize, point, direction);\n\t\t\tnewBoat = boatFactory.CreateBoat();\n\t\t\tif (!(isBoatGetValidPosition(newBoat))) {\n\t\t\t\tnewBoat = null;\n\t\t\t\tdirection.nexDirection();\n\t\t\t\tdurectionTriedNumber++;\n\t\t\t}\n\n\t\t}\n\t\treturn newBoat;\n\t}", "public abstract void setPosition(Point2D position);", "public void setLocation(Point2D p);", "public void setPosition(Point point) {\n setPosition(point.x, point.y);\n }", "public void set(Point p)\r\n\t{\r\n\t\tx = p.x;\r\n\t\ty = p.y;\r\n\t}", "public void setP1(Point point){\n\t\tif((point.getX() >= getP2().getX()) || (point.getY() >= getP2().getY())){\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\tsuper.setP1(point);\n\t}", "public Point(Point point) {\n super(point.getReferenceX(), point.getReferenceY());\n this.x = point.x;\n this.y = point.y;\n this.setHeight(point.getHeight());\n }", "void pointCheck(LatLng point, boolean valid);", "public void moveTo(Point point){\n updateUndoBuffers(new LinkedList<>());\n xPos = point.getMyX()+myGrid.getWidth()/ HALF;\n yPos = myGrid.getHeight()/ HALF-point.getMyY();\n }", "public void setPosition(int position, boolean passThroughGoSquare)\n\t{\n\t\tsomethingChanged = true;\n\t\tif ((position >= 40 || this.position > position) && passThroughGoSquare)\n\t\t{\n\t\t\taddMoney(200);\n\t\t}\n\t\tsetPreviousPosition(this.position);\n\t\tthis.position = position;\n\t\tthis.position %= 40;\n\t}", "public void update(Point point)\n {\n rectangle.set(point.x - rectangle.width()/2, point.y - rectangle.height()/2, point.x + rectangle.width()/2,point.y + rectangle.height()/2);\n\n //hitBox(this.rectangle);\n }", "public void setSetpoint(double setpoint);", "public Point(Point point) {\n this.x = point.x;\n this.y = point.y;\n }", "public void setRobotLocation(Point p);", "public void setObjectAtLocation(Point p, Object o);", "void setPointChange(Integer setPoint, Integer expectedValue);", "public void setMoveTo(Coordinate coordinate);", "public void setLocation(Coordinate coordinate);", "public void setP2(Point point){\n\t\tif((point.getX() <= getP1().getX()) || (point.getY() <= getP1().getY())){\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\tsuper.setP2(point);\n\t}", "public void setLocation( Point p ) {\r\n this.x = p.x;\r\n this.y = p.y;\r\n }", "public void setLocation(Point newLocation) {\r\n this.p = newLocation;\r\n }", "static void setViewPointRelevantTo(Point point) {\n point.translate(-1 * viewPoint.x, -1 * viewPoint.y);\n point.x /= Map.zoom;\n point.y /= Map.zoom;\n point.translate(viewPoint.x, viewPoint.y);\n viewPoint.setLocation(point.x - GAME_WIDTH / 2, point.y - GAME_HEIGHT / 2);\n verifyViewPoint();\n }", "public void placePiece(Piece newPiece){pieceAtVertex = newPiece;}", "void setLocation(int x, int y);", "boolean setStone(int x, int y);", "boolean setPiece(int x, int y, Piece.OthelloPieceColour colour) {\n return false;\n }", "public void setPosition(GeoPoint position){\n\t\tmPosition = position.clone();\n\t\tif (isInfoWindowShown()) {\n\t\t\tcloseInfoWindow();\n\t\t\tshowInfoWindow();\n\t\t}\n\t\tmBounds=new BoundingBox(position.getLatitude(),position.getLongitude(),position.getLatitude(),position.getLongitude());\n\t}", "private void _setPoint(int index, DataPoint point) {\n ntree.set(index, point);\n ensureDistances();\n }", "@Override\n public void setSetpoint(double setpoint) {\n if (getController() != null) {\n getController().setSetpoint(Utilities.clip(setpoint, Constants.Hood.MIN_ANGLE, Constants.Hood.MAX_ANGLE));\n }\n super.setSetpoint(Utilities.clip(setpoint, Constants.Hood.MIN_ANGLE, Constants.Hood.MAX_ANGLE));\n }", "private void CreaCoordinate(){\n \n this.punto = new Point(80, 80);\n \n }", "public abstract Piece setLocation(int row, int column);", "public int setPoint(float x, float y, int gnum);", "public void setPoint(Integer point) {\n this.point = point;\n }", "public void setXY(Point2D aPoint) { setXY(aPoint.getX(), aPoint.getY()); }", "void moveToPoint(float x, float y) {\n _x = x;\n _y = y;\n }", "protected void placeBoat(BoatDrawing myBoat) {\n if(positionCorrect(myBoat)) {\n myBoat.setPlaced(true);\n desactiveBoat(); \n // enable validate button if all boats are well placed\n valider.setDisable(!allBoatsArePlaced());\n }\n }", "public void makemove (char piece)\n {\n\tint x = IBIO.inputInt (\"\\nEnter the x-coordinate: \");\n\tint y = IBIO.inputInt (\"Enter the y-coordinate: \");\n\twhile (!isValid (x, y))\n\t{\n\t System.out.println (\"Error - invalid coordinate. Try again.\");\n\t x = IBIO.inputInt (\"\\nEnter the x-coordinate: \");\n\t y = IBIO.inputInt (\"Enter the y-coordinate: \");\n\t}\n\n\n\tif (x == 1 && y == 1)\n\t a = piece;\n\telse if (x == 2 && y == 1)\n\t b = piece;\n\telse if (x == 3 && y == 1)\n\t c = piece;\n\telse if (x == 1 && y == 2)\n\t d = piece;\n\telse if (x == 2 && y == 2)\n\t e = piece;\n\telse if (x == 3 && y == 2)\n\t f = piece;\n\telse if (x == 1 && y == 3)\n\t g = piece;\n\telse if (x == 2 && y == 3)\n\t h = piece;\n\telse if (x == 3 && y == 3)\n\t i = piece;\n }", "public void setLocation(float x, float y);", "public void changePos(double xP, double yP){ \n this.xCoor += xP;\n this.yCoor += yP;\n \n }", "public void setPoint( Float point ) {\n this.point = point;\n }", "private void placeBomb(int x, int y, int newValue) {\n setCell(x, y, newValue); // a: Turns this cell into a bomb\n ++bombsPlaced; // b: increments bombs placed\n GridHelper.oneUpAll(x, y, hiddenGrid); // b: Increments all cells surrounding the new bomb\n }", "void setPos(float x, float y);", "public void setX(double point) {\n this.x = point;\n }", "public void setPoint(Integer point) {\n\t\tthis.point = point;\n\t}", "public boolean setFigure(final Field field, final Point point, final Figure figure)\n throws InvalidPointException, AlreadyOccupiedException {\n if (field.getFigure(point) != null) {\n throw new AlreadyOccupiedException(\"This cell is occupied\");\n }\n field.setFigure(point, figure);\n return true;\n }", "public void setCoordinate(int PointX, int PointY)\n {\n rectangle.set(PointX - rectangle.width()/2, PointY - rectangle.height()/2, PointX + rectangle.width()/2,PointY + rectangle.height()/2);\n\n //hitBox(this.rectangle);\n }", "public void setGoal(Point point) {\n mGoal = point;\n }", "public void setPoint(int x, int y) {\r\n this.x = x;\r\n this.y = y;\r\n }", "public void setPoint(double value) {\r\n this.point = value;\r\n }", "void setPosition(Position p);", "void setPosition(double xPos, double yPos);", "public void setPosition(Point position){\r\n this.position.set(position.x, position.y);\r\n\r\n this.shadow.setPosition(position);\r\n this.surface.setPosition(position);\r\n this.shading.setPosition(position);\r\n\r\n\r\n this.setBounds(new Rect(\r\n this.position.x - this.radius,\r\n this.position.y - this.radius,\r\n this.position.x + this.radius,\r\n this.position.y + this.radius\r\n ));\r\n \r\n }", "private void setP1( Point p1 ){\n this.p1=p1;\n }", "public void setPiece(Piece piece, PieceValidator pv);", "public void setPosition(Vector2 position);", "public Coords bound(final Coords point)\r\n {\r\n int xx = point.getX();\r\n int yy = point.getY();\r\n if(xx < x)\r\n {\r\n xx = x;\r\n }\r\n if(xx > x + width)\r\n {\r\n xx = x + width;\r\n }\r\n if(yy < y)\r\n {\r\n yy = y;\r\n }\r\n if(yy > y + height)\r\n {\r\n yy = y + height;\r\n }\r\n return new Coords(xx, yy);\r\n }", "public void setFrameXY(RMPoint aPoint) { setFrameXY(aPoint.x, aPoint.y); }", "final protected void setSpawnPosition(int newX, int newY)\n {\n spawnPoint = new Point(newX, newY);\n boundingBox.setLocation(spawnPoint);\n }", "public abstract void setPosition(Position position);", "public void testSetLocationNegX() {\n try {\n container.setLocation(new Point(-1, 1));\n fail(\"the x of the point is -1, IllegalArgumentException is expected.\");\n } catch (IllegalArgumentException e) {\n // expected\n }\n }", "public void setPosition(Position p);", "@Override\n public void setLoc(Point p) {\n this.rect.setLocation(p);\n }", "private Point(Point p) {\n\t\tthis.name = p.name;\n\t\tthis.position = p.position.copy();\n\t\tthis.collisionRadius = p.collisionRadius;\n\t}", "public void setPiece(int x, int y, int player) throws GameException {\n if (!squareInBounds(x, y)) {\n throw new GameException(\"Square is off the board\");\n }\n int arrayPos = getArrayPos(x, y);\n if (!isSquareFree(arrayPos)) {\n throw new GameException(\"Location is already taken\");\n }\n ;\n setSurrounding(x, y);\n intArray[arrayPos] = player;\n }", "Tower(Point location)\r\n\t{\r\n\t\tthis.location=location;\r\n\t}", "Point createPoint();", "public abstract void move(Point point);", "public static void setNexPoint(MyInt x, MyBool b) {\n if (x.intger == 359) b.b = false;\n if (x.intger == 0) b.b = true;\n if (b.b) x.intger++;\n if (!b.b) x.intger--;\n }", "@Before\n\tpublic void before() {\n\t\tpoint = new Point(-200, 150);\n\t\tpoint1 = new Point(-400, -150);\n\t}", "public void placeBoat(int boatIndex, int startX, int startY, int endX, int endY) throws InvalidPlacementException {\n System.out.println(\"placeBoat(): boatNum \" + boatIndex);\n Boat toPlace = getBoatAt(boatIndex);\n //checking if coordinates are within GRID_DIMENSIONS\n if (!withinGridDimensions(startX, startY, endX, endY)) {\n throw new InvalidPlacementException(\"Your boat isn't on the grid. \");\n }\n \n //checking for any boat overlapping\n if (doesBoatOverlap((startX-1), (startY-1), (endX-1), (endY-1))) {\n throw new InvalidPlacementException(\"There is already a boat in the area you selected. \");\n }\n \n //checking that the coordinates match boat's length\n if (((startX==endX) && (Math.abs(endY-startY)!=toPlace.getLength()-1)) || ((startY==endY) && (Math.abs(endX-startX)!=toPlace.getLength()-1))) {\n System.out.println(startX +\" \" + endX + \"diff in Y: \" + (endY-startY));\n System.out.println(startY +\" \" + endY + \"diff in X: \" + (endX-startX));\n throw new InvalidPlacementException(\"Your boat isn't the right length.\");\n }\n \n //ensures boat is vertical/horizontal\n if ((startX != endX) && (startY != endY)) {\n throw new InvalidPlacementException(\"You need to make your boat either vertical or horizontal.\");\n }\n \n //setting boat's start and end coordinates\n toPlace.setStartX(startX);\n toPlace.setStartY(startY);\n System.out.println(\"placeBoat(): StartX, Y = \" + toPlace.getStartX()+\" \"+\n toPlace.getStartY());\n toPlace.setEndX(endX);\n toPlace.setEndY(endY);\n System.out.println(\"placeBoat(): EndX, Y = \" + toPlace.getEndX()+\" \"+\n toPlace.getEndY());\n \n //setting all checked coordinates of boat to have a boat\n int gridStartX = Math.min(startX, endX);\n int gridEndX = Math.max(startX, endX);\n int gridStartY = Math.min(startY, endY);\n int gridEndY = Math.max(startY, endY);\n if (gridStartX==gridEndX) {\n for (int j = gridStartY; j <= gridEndY; j++) {\n grid[gridStartX-1][j-1].setHasBoat(true); //0indexing\n System.out.println(\"grid[\"+(gridStartX-1)+\"][\"+(j-1)+\"] hasBoat: \"+grid[gridStartX-1][j-1].getHasBoat());\n }\n } else if (gridStartY==gridEndY) {\n for (int i = gridStartX; i <= gridEndX; i++) {\n grid[i-1][gridStartY-1].setHasBoat(true); //o-indexing\n System.out.println(\"grid[\"+(i-1)+\"][\"+(gridStartY-1)+\"] hasBoat: \"+grid[i-1][gridStartY-1].getHasBoat());\n }\n }\n System.out.println(\"Boat \" + (boatIndex+1) + \"'s coordinates have successfully been set!~*~!~*~!*~!~*~!\");\n }", "public void setPosition(Point p) {\r\n\t\tthis.position = p;\r\n\t\tc.setPosition(p);\r\n\t}", "private void addPoint( LatLng point ) {\n \t\tthis.addMarker( point );\n \t\tthis.commitPolygon();\n \t}", "public void changeAnchors(int point, Items item) throws Exception {\n\t\tif (point < 0 || point > this.getAnchors().length)\n\t\t\tthrow new Exception(\"That's not a valid point.\");\n\t\tif (point < 2)\n\t\t\tif (item instanceof Weapons || item == null) {\n\t\t\t\tthis.anchors[point] = item;\n\t\t\t\tif (item != null)\n\t\t\t\t\titem.setHolder(this);\n\t\t\t}\n\t\t\telse\n\t\t\t\tthrow new Exception (\"That item cannot go into that position.\");\n\t\telse if (point == 2)\n\t\t\tif (item instanceof Backpacks || item == null) {\n\t\t\t\tthis.anchors[point] = item;\n\t\t\t\tif (item != null)\n\t\t\t\t\titem.setHolder(this);\n\t\t\t}\n\t\t\telse\n\t\t\t\tthrow new Exception(\"That item cannot go into that position.\");\n\t\telse {\n\t\t\tthis.anchors[point] = item;\n\t\t\tif (item != null)\n\t\t\t\titem.setHolder(this);\n\t\t}\n\t}", "public void setXY(int newX, int newY)\n\t{\n\t\tx=newX; \n\t\ty=newY;\n\t\tboundingBox = new Rectangle(x,y,width,height);\n\t}", "public void setLocation(Point p)\n\t{\n\t\tsetLocation(p.x,p.y);\n\t}", "public void addPoint(Point point){\n\t\tif (point.getX() < minPoint.getX()){\n\t\t\tminPoint.setX(point.getX());\n\t\t}\n\t\tif (point.getY() < minPoint.getY()){\n\t\t\tminPoint.setY(point.getY());\n\t\t}\n\t\tif (point.getX() > maxPoint.getX()){\n\t\t\tmaxPoint.setX(point.getX());\n\t\t}\n\t\tif (point.getY() > maxPoint.getY()){\n\t\t\tmaxPoint.setY(point.getY());\n\t\t}\n\t}", "public Point2D(Point2D point){\n \n //on peut faire point.x et point.y puisqu'on est dans la classe\n this.x = point.x;\n this.y = point.y;\n }", "public abstract Point move(Point position);", "private void setP2( Point p2 ){\n this.p2=p2;\n }", "public boolean addPoint(Point p);", "void setStartPoint(Location location, boolean persistPoints);", "@Override\n public void setLocation(Point location) {\n pos = location;\n try {\n if (TerraGen.window != null && TerraGen.window.getClient() != null)\n TerraGen.window.getClient().pushGameChange(TerraGen.window.game.getMap().getTokens().indexOf(this), NetworkType.TOKEN, this);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "void addHasXCoordinate(Object newHasXCoordinate);", "public void setPosition(float x, float y);", "public void setBedSpawnLocation ( Location location , boolean force ) {\n\t\texecute ( handle -> handle.setBedSpawnLocation ( location , force ) );\n\t}", "public void setPosition(Point2D position)\n {\n mPosition = position;\n }", "public Point()\n {\n x = -100 + (int) (Math.random() * ((100 - (-100)) + 1)); \n y = -100 + (int) (Math.random() * ((100 - (-100)) + 1));\n //x = (int) (Math.random()); \n //y =(int) (Math.random());\n pointArr[0] = 1;\n pointArr[1] = x;\n pointArr[2] = y;\n //If the point is on the line, is it accepted? I counted it as accepted for now\n if(y >= 3*x){\n desiredOut = 1;\n }\n else\n {\n desiredOut = 0;\n }\n }", "public void setPosition(Point position) {\n this.position = position;\n }", "public void setPositionClosedLoopSetpoint(final double setpoint) {\n m_X.set(ControlMode.Position, 1000 * setpoint);\n //System.out.println(this.getEncPosition());\n }", "@Override\n protected boolean isValid(java.security.spec.ECPoint point) {\n return convertECPoint(point).isValid();\n }", "protected abstract boolean swapPointCheck(final TreeStructure tree, final Point current, final Point pending);", "T set(Position<T> p, T data) throws IllegalStateException;", "public void setPosition(Point2 position) {\r\n this.position = position;\r\n }", "public Point movePoint(){\n\t\tSystem.out.println(\"Enter new zero point for figure\");\n\t\tthis.in = new Scanner(System.in);\n\t\tString temp = in.nextLine();\n\t\tString[] data = temp.trim().split(\" \");\n\t\tint a = Integer.parseInt(data[0]);\n\t\tint\tb = Integer.parseInt(data[1]);\n\t\tPoint p = new Point(a, b);\n\t\treturn p;\n\t}" ]
[ "0.6995137", "0.69459265", "0.66794264", "0.6445827", "0.6364032", "0.62413704", "0.62245905", "0.6180951", "0.6102255", "0.6090253", "0.6036176", "0.6016229", "0.60110027", "0.6006816", "0.60063654", "0.5977398", "0.59733444", "0.5936558", "0.59358096", "0.59333366", "0.59333247", "0.5882857", "0.58480597", "0.5841462", "0.5839314", "0.5838075", "0.58127946", "0.58077484", "0.5793955", "0.57936436", "0.57877797", "0.57719094", "0.5758573", "0.5754375", "0.57498074", "0.57496095", "0.57247454", "0.5720453", "0.5718373", "0.57018715", "0.56698364", "0.56671304", "0.56667775", "0.5655845", "0.5654691", "0.5622071", "0.5616819", "0.5611204", "0.5609752", "0.5595114", "0.5587331", "0.55692095", "0.556724", "0.5560766", "0.55501074", "0.5547875", "0.5543409", "0.5535052", "0.55329275", "0.5521464", "0.55193055", "0.55174965", "0.5502157", "0.55013645", "0.54982185", "0.54979086", "0.5490419", "0.5487929", "0.54865557", "0.54852474", "0.54819727", "0.5478972", "0.54777133", "0.5476561", "0.5470887", "0.54656863", "0.54609996", "0.54519403", "0.54480755", "0.54475456", "0.54283905", "0.5423088", "0.5418246", "0.5412749", "0.54084265", "0.54013956", "0.53975004", "0.5396863", "0.5396293", "0.53865707", "0.53831524", "0.53764206", "0.53718907", "0.5365713", "0.5365532", "0.53648716", "0.53647244", "0.5359306", "0.5355048", "0.5354331" ]
0.5779632
31
Fetch and store information into the database.
@Override public JsonObjectRequest fetchData(AppDatabase database) { // create the JSON request for courses offered by each school return new JsonObjectRequest (Request.Method.GET, "https://data.gov.sg/api/action/datastore_search?resource_id=3bb9e6b0-6865-4a55-87ba-cc380bc4df39&limit=500000", null, new Response.Listener<JSONObject>() { @Override public void onResponse(JSONObject response) { try { // parse results as json array JSONArray allSchoolToCourseAsJSONArray = getResultsAsJSONArray(response); // get each entry in results and store in database parseJSONArrayAndStoreInDatabase(database, allSchoolToCourseAsJSONArray); } catch (JSONException e) { e.printStackTrace(); } } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { // TODO: Handle error System.out.println("Rabak la bro: " + error.toString()); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void getDataFromDB() {\n ArrayList<ArtworkData> artworkData = getArtworksFromDatabase();\n if (artworkData.size() <= 0) {\n // there is no data in local DB, error\n onErrorReceived();\n } else {\n sendArtworkData(artworkData);\n }\n }", "private void FetchingData() {\n\t\t try { \n\t\t\t \n\t \tmyDbhelper.onCreateDataBase();\n\t \t \t\n\t \t\n\t \t} catch (IOException ioe) {\n\t \n\t \t\tthrow new Error(\"Unable to create database\");\n\t \n\t \t} \n\t \ttry {\n\t \n\t \t\tmyDbhelper.openDataBase();\n\t \t\tmydb = myDbhelper.getWritableDatabase();\n\t\t\tSystem.out.println(\"executed\");\n\t \t\n\t \t}catch(SQLException sqle){\n\t \n\t \t\tthrow sqle;\n\t \n\t \t}\n\t}", "public void save() {\n //write lift information to datastore\n LiftDataAccess lda = new LiftDataAccess();\n ArrayList<Long>newKeys = new ArrayList<Long>();\n for (Lift l : lift) {\n newKeys.add(lda.insert(l));\n }\n\n //write resort information to datastore\n liftKeys = newKeys;\n dao.update(this);\n }", "public void fetchData()\n {\n FetchingDataTask fetchingDataTask = new FetchingDataTask();\n fetchingDataTask.execute();\n }", "private void retrieve() {\r\n\t\ttry {\r\n\t\t\tif (store == null) {\r\n\t\t\t\tstore = Store.retrieve();\r\n\t\t\t\tif (store != null) {\r\n\t\t\t\t\tSystem.out.println(\" The store has been successfully retrieved from the file StoreData. \\n\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tstore = Store.instance();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (Exception cnfe) {\r\n\t\t\tcnfe.printStackTrace();\r\n\t\t}\r\n\t}", "public void store() throws IOException, SQLException {\r\n \r\n /* Project section */\r\n final HashMap<Object, Object> projectdata = new HashMap<Object, Object>(8);\r\n \r\n if(project == null){\r\n \t// The title \r\n projectdata.put(ProjectAccessor.TITLE, title);\r\n // Create the project database object.\r\n final ProjectAccessor newProject = new ProjectAccessor(projectdata);\r\n newProject.persist(conn);\r\n projectid = (Long) newProject.getGeneratedKeys()[0];\r\n } else {\r\n \tprojectid = project.getProjectid();\r\n }\r\n }", "private void saveData() {\n readViews();\n final BookEntry bookEntry = new BookEntry(mNameString, mQuantityString, mPriceString, mSupplier, mPhoneString);\n AppExecutors.getInstance().diskIO().execute(new Runnable() {\n @Override\n public void run() {\n // Insert the book only if mBookId matches DEFAULT_BOOK_ID\n // Otherwise update it\n // call finish in any case\n if (mBookId == DEFAULT_BOOK_ID) {\n mDb.bookDao().insertBook(bookEntry);\n } else {\n //update book\n bookEntry.setId(mBookId);\n mDb.bookDao().updateBook(bookEntry);\n }\n finish();\n }\n });\n }", "private void storeData() {\r\n final File tweetsFile = new File(tweetsStorePath);\r\n final File usersFile = new File(usersStorePath);\r\n final Set<TweetEntity> tweetEntities = new HashSet();\r\n final Set<UserEntity> userEntities = new HashSet();\r\n \r\n tweets.entrySet().stream().forEach(entry -> {\r\n entry.getValue().stream().forEach(\r\n status -> {\r\n try {\r\n tweetEntities.add(\r\n new TweetEntity(status,\r\n entry.getKey()));\r\n userEntities.add(\r\n new UserEntity(status.getUser()));\r\n } catch (UnsupportedEncodingException ex) {\r\n \r\n }\r\n });\r\n });\r\n\r\n try {\r\n try (PrintWriter tweetWriter = new PrintWriter(tweetsFile)) {\r\n tweetEntities.stream().forEach(entity -> {\r\n tweetWriter.println(entity.toString());\r\n });\r\n }\r\n try (PrintWriter userWriter = new PrintWriter(usersFile)) {\r\n userEntities.stream().forEach(entity -> {\r\n userWriter.println(entity.toString());\r\n });\r\n }\r\n } catch (IOException ex) {\r\n System.out.println(\"DBLIS - storeData() - error storing data\" + ex);\r\n }\r\n }", "void fetchForRentHousesData();", "private void putPersonalInformation() throws SQLException, FileNotFoundException, IOException {\n AdUserPersonalData personal;\n try {\n personal = PersonalDataController.getInstance().getPersonalData(username);\n staff_name = personal.getGbStaffName();\n staff_surname = personal.getGbStaffSurname();\n id_type = \"\"+personal.getGbIdType();\n id_number = personal.getGbIdNumber();\n putProfPic(personal.getGbPhoto());\n phone_number = personal.getGbPhoneNumber();\n mobile_number = personal.getGbMobileNumber();\n email = personal.getGbEmail();\n birthdate = personal.getGbBirthdate();\n gender = \"\"+personal.getGbGender();\n } catch (GB_Exception ex) {\n LOG.error(ex);\n GBMessage.putException(ex);\n }\n }", "void fetchForSaleHousesData();", "public abstract void fetch();", "public void fetchTaskDetailsFromDB() {\n TaskInfo taskInfo = TaskInfo.getOrBadRequest(userTaskUUID);\n taskParams = Json.fromJson(taskInfo.getDetails(), UniverseDefinitionTaskParams.class);\n }", "private DatabaseCustomAccess(Context context) {\n\t\thelper = new SpokaneValleyDatabaseHelper(context);\n\n\t\tsaveInitialPoolLocation(); // save initial pools into database\n\t\tsaveInitialTotalScore(); // create total score in database\n\t\tsaveInitialGameLocation(); // create game location for GPS checking\n\t\tLoadingDatabaseTotalScore();\n\t\tLoadingDatabaseScores();\n\t\tLoadingDatabaseGameLocation();\n\t}", "private void saveAT() \n {\n // get DatabaseConnector to interact with the SQLite database\n\t AnimalDatabase db = new AnimalDatabase(this);\n\t AnimalList al = new AnimalList (db);\n\t \n // insert the contact information into the database\n al.Update(id, amount, comments);\n\n }", "public void initiateStore() {\r\n\t\tURLConnection urlConnection = null;\r\n\t\tBufferedReader in = null;\r\n\t\tURL dataUrl = null;\r\n\t\ttry {\r\n\t\t\tdataUrl = new URL(URL_STRING);\r\n\t\t\turlConnection = dataUrl.openConnection();\r\n\t\t\tin = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));\r\n\t\t\tString inputLine;\r\n\t\t\twhile ((inputLine = in.readLine()) != null) {\r\n\t\t\t\tString[] splittedLine = inputLine.split(\";\");\r\n\t\t\t\t// an array of 4 elements, the fourth element\r\n\t\t\t\t// the first three elements are the properties of the book.\r\n\t\t\t\t// last element is the quantity.\r\n\t\t\t\tBook book = new Book();\r\n\t\t\t\tbook.setTitle(splittedLine[0]);\r\n\t\t\t\tbook.setAuthor(splittedLine[1]);\r\n\t\t\t\tBigDecimal decimalPrice = new BigDecimal(splittedLine[2].replaceAll(\",\", \"\"));\r\n\t\t\t\tbook.setPrice(decimalPrice);\r\n\t\t\t\tfor(int i=0; i<Integer.parseInt(splittedLine[3]); i++)\r\n\t\t\t\t\tthis.addBook(book);\r\n\t\t\t}\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tif(!in.equals(null)) in.close();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void pullDetails() {\n\t\t\n\t\tint userId = Auth.getCurrentUser().getId();\n\t\tString sql = \"select * from PersonalDetails where id='\"+userId+\"'\";\n\t\t\n\t\tconnectToDb();\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\t\n\t\t\t\tint foundId = rs.getInt(\"id\");\n\t\t\t\tif(foundId == userId) {\n\t\t\t\t\t// Get new details from database\n\t\t\t\t\tString firstName = rs.getString(\"fName\");\n\t\t\t\t\tString lastName = rs.getString(\"sName\");\n\t\t\t\t\tString dob = rs.getString(\"dob\");\n\t\t\t\t\tString address1 = rs.getString(\"address1\");\n\t\t\t\t\tString address2 = rs.getString(\"address2\");\n\t\t\t\t\tString city = rs.getString(\"city\");\n\t\t\t\t\tString county = rs.getString(\"county\");\n\t\t\t\t\tString postCode = rs.getString(\"postcode\");\n\t\t\t\t\tString mobileNum = rs.getString(\"mobileNum\");\n\t\t\t\t\tString telephoneNum = rs.getString(\"telephoneNum\");\n\t\t\t\t\tString emergencyContact = rs.getString(\"emergencyContact\");\n\t\t\t\t\tString emergencyNum = rs.getString(\"emergencyContactNum\");\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t// Set new Details\n\t\t\t\t\tmyCurrentDetails.setFirstName(firstName);\n\t\t\t\t\tmyCurrentDetails.setLastName(lastName);\n\t\t\t\t\tmyCurrentDetails.setDoB(dob);\n\t\t\t\t\tmyCurrentDetails.setAddress1(address1);\n\t\t\t\t\tmyCurrentDetails.setAddress2(address2);\n\t\t\t\t\tmyCurrentDetails.setCity(city);\n\t\t\t\t\tmyCurrentDetails.setCounty(county);\n\t\t\t\t\tmyCurrentDetails.setPostcode(postCode);\n\t\t\t\t\tmyCurrentDetails.setMobile(mobileNum);\n\t\t\t\t\tmyCurrentDetails.setTelenum(telephoneNum);\n\t\t\t\t\tmyCurrentDetails.setEmergencyContact(emergencyContact);\n\t\t\t\t\tmyCurrentDetails.setEmergencyNum(emergencyNum);\n\t\t\t}else {\n\t\t\t\tJOptionPane.showMessageDialog(null,\n\t\t \t\t \"Connection Made but User not found!\",\n\t\t \t\t \"Error-User Not Found\",\n\t\t \t\t JOptionPane.ERROR_MESSAGE);\n\t\t\t}\n\t\t}catch(SQLException e){\n\t\t\tJOptionPane.showMessageDialog(null,\n\t \t\t \"Cannot Fetch Your Details!\",\n\t \t\t \"Error\",\n\t \t\t JOptionPane.ERROR_MESSAGE);\n\t\t}\n\t}", "public void extractObjectDB() {\n\n\t\ttry {\n\t\t\t\n\t\t\tstatement = c.createStatement();\n\t\t\tResultSet rs = stmt.executeQuery(\"SELECT * FROM User WHERE id NOT IN (SELECT id FROM OrderManager)\");\n\t\t\tResultSet results = statement.executeQuery(\"select FirstName , LastName, Password,Phonenumber,AFM,User.id, Company,Regular,Season from User INNER JOIN OrderManager on User.id=OrderManager.Id\"); \n\t\t \n\n\t\t\twhile (rs.next()) {\n\t\t\t\n\t\t\t\tUser us = new User();\n\t\t\t\tus.setFirstName(rs.getString(\"FirstName\"));\n\t\t\t\tus.setSurName(rs.getString(\"LastName\"));\n\t\t\t\tus.setPassword(rs.getString(\"Password\"));\n\t\t\t\tus.setTelephone(rs.getString(\"Phonenumber\"));\n\t\t\t\tus.setAFM(rs.getString(\"AFM\"));\n\t\t\t\tus.setId(rs.getString(\"id\"));\n\t\t\t\tus.setCompany(rs.getString(\"Company\"));\n\t\t\t\tusers.add(us);\n\t\t\t\t\n\t\t\t}\n\t\t\tfor(User u: users)\n\t\t\t{\n\t\t\t\tint index = users.indexOf(u);\n\t\t\t\tif (u instanceof Stockkeeper) {\n\t\t\t\t\tStockkeeper st = (Stockkeeper) u;\n\t\t\t\t\tusers.set(index,st);\n\t\t\t\t}\n\t\t\t\telse if(u instanceof Seller){\n\t\t\t\t\tSeller se = (Seller) u;\n\t\t\t\t\tusers.set(index, se);\n\t\t\t}\n\t\t\t}\n\t\t\twhile (results.next()) {\n\t\t\t\t\n\t\t\t\tOrderManager om = new OrderManager(\"\",\"\",\"\",\"\",\"\",\"\",true,\"\");\n\t\t\t\tom.setFirstName(results.getString(\"FirstName\"));\n\t\t\t\tom.setSurName(results.getString(\"LastName\"));\n\t\t\t\tom.setPassword(results.getString(\"Password\"));\n\t\t\t\tom.setTelephone(results.getString(\"Phonenumber\"));\n\t\t\t\tom.setAFM(results.getString(\"AFM\"));\n\t\t\t\tom.setId(results.getString(\"id\"));\n\t\t\t\tom.setCompany(results.getString(\"Company\"));\n\t\t\t\tif (results.getInt(\"Regular\")== 0) \n\t\t\t\t\tom.setRegular(true);\n\t\t\t\telse \n\t\t\t\t\tom.setRegular(false);\n\t\t\t\tom.setSeason(results.getString(\"Season\"));\n\t\t\t\tusers.add(om);\n\t\t\t\t\n\t\t\t}\n\t\t\tc.close();\n\t\t}catch(SQLException | ClassNotFoundException e){\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t\t\n\t\t\n\t}", "private void fetchData() {\n mFirstNameLabel = \"First name:\";\n mFirstNameValue = \"Taylor\";\n mSurnameLabel = \"Surname:\";\n mSurnameValue = \"Swift\";\n\n initFields();\n }", "public void saveData(){\n SerializableManager.saveSerializable(this,user,\"userInfo.data\");\n SerializableManager.saveSerializable(this,todayCollectedID,\"todayCollectedCoinID.data\");\n SerializableManager.saveSerializable(this,CollectedCoins,\"collectedCoin.data\");\n uploadUserData uploadUserData = new uploadUserData(this);\n uploadUserData.execute(this.Uid);\n System.out.println(Uid);\n\n }", "private void loadFromDB() throws SQLException {\n\t\tif (rev_page != -1)\n\t\t\treturn;\n\t\t\n\t\tPreparedStatement stmt = dbc.prepareStatement(\n\t\t\t\t\"SELECT rev_page, rev_text_id, rev_timestamp, rev_comment, user_name \" +\n\t\t\t\t\"FROM revision, users WHERE rev_id = ? AND rev_user = user_id\");\n\t\tstmt.setInt(1, rev_id);\n\t\tstmt.execute();\n\n\t\tResultSet rs = stmt.getResultSet();\n\t\tif (!rs.next()) {\n\t\t\t/*\n\t\t\t * Shouldn't happen?\n\t\t\t */\n\t\t\tstmt.close();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\trev_page = rs.getInt(1);\n\t\trev_text_id = rs.getInt(2);\n\t\trev_timestamp = rs.getTimestamp(3);\n\t\trev_comment = rs.getString(4);\n\t\trev_user_text = rs.getString(5);\n\t\tstmt.close();\n\t}", "private void saveDBValues() {\r\n this.pl_DB.setParam(\"Hostname\", this.rhostfield.getText());\r\n this.pl_DB.setParam(\"Port\", this.rportfield.getText());\r\n this.pl_DB.setParam(\"Username\", this.ruserfield.getText());\r\n\r\n String pw = \"\";\r\n for (int i = 0; i < this.rpasswdfield.getPassword().length; i++) {\r\n pw += this.rpasswdfield.getPassword()[i];\r\n }\r\n this.pl_DB.setParam(\"Password\", pw);\r\n this.pl_DB.setParam(\"Database\", this.rdatabasefield.getText());\r\n this.pl_DB.setParam(\"nodeTableName\", this.rtablename1efield.getText());\r\n this.pl_DB.setParam(\"nodeColIDName\", this.colnodeIdfield.getText());\r\n this.pl_DB.setParam(\"nodeColLabelName\", this.colnodeLabelfield.getText());\r\n this.pl_DB.setParam(\"edgeTableName\", this.rtablename2efield.getText());\r\n this.pl_DB.setParam(\"edgeCol1Name\", this.coledge1field.getText());\r\n this.pl_DB.setParam(\"edgeCol2Name\", this.coledge2field.getText());\r\n this.pl_DB.setParam(\"edgeColWeightName\", this.colweightfield.getText());\r\n this.pl_DB.setParam(\"resultTableName\", this.otablenamefield.getText());\r\n\r\n this.is_alg_started = false;\r\n this.is_already_read_from_DB = false;\r\n this.is_already_renumbered = false;\r\n }", "public boolean AddToDatabase()\n\t{\n\t\ttry\n\t\t{\n\t\t\tConnector con = new Connector();\n\t \n\t //add info to database\n\t\t\tString query = \"INSERT INTO Housing(name, address, phone_number, year_built, price, housing_uid, \"\n\t\t\t\t\t+ \"max_residents, catagory) \"\n\t\t\t\t\t+ \"VALUES('\"+name+\"', '\"+address+\"', '\"+phoneNumber+\"', '\"+yearBuilt+\"', '\"+price+\"', \"\n\t\t\t\t\t+ \"'\"+uid+\"', '\"+maxResidents+\"', '\"+catagory+\"')\"; \n\t\t\t\n\t\t\tint insertResult = con.stmt.executeUpdate(query);\n\t\t\tif(insertResult > 0)\n\t\t\t{\n\t\t\t\tSystem.out.println (\"Housing added to database.\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tSystem.out.println (\"Housing NOT added to database.\");\n\t\t\t}\n\t\t\t\n\t\t\t//get housing id\n\t\t\tquery = \"SELECT h_id FROM Housing WHERE name ='\"+name+\"' AND address ='\"+address+\"'\"; \n\t\t\tResultSet rs = con.stmt.executeQuery(query); \n\t\t\tif(rs.next())\n\t\t\t{\n\t\t\t\thid = rs.getInt(\"h_id\"); \n\t\t\t}\n\t\t\t\n\t\t\tcon.closeConnection();\n\t\t\t\n\t\t\t//set up keywords\n\t\t\tif (keywords.size() > 0)\n\t\t\t{\n\t\t\t\tAddKeywords(); \n\t\t\t}\n\t\t\t\n\t\t\tif(openDates.size() > 0)\n\t\t\t{\n\t\t\t\tAddAvailableDates(); \n\t\t\t}\n\t\t\t\n\t\t\treturn true; \n\t\t\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t\treturn false;\n\t}", "protected abstract void retrievedata();", "public void getDataFromDatabase(){\r\n\t \tArrayList<Object> row = HomeActivity.dbPrograms.getDetail(SelectedID);\r\n\t \t\r\n\t\t\t// store data to variables\r\n\t \tProgramID = Integer.parseInt(row.get(0).toString());\r\n\t \tWorkoutID = Integer.parseInt(row.get(1).toString());\r\n\t \tName = row.get(2).toString();\r\n\t \tSelectedDayID = Integer.parseInt(row.get(3).toString());\r\n\t \tImage = row.get(4).toString();\r\n\t \tTime = row.get(5).toString().trim();\r\n\t \tSteps = row.get(6).toString();\r\n\t \t\r\n\t }", "public Object createEntry(Object key) throws Exception {\n\r\n\t\t\r\n\t\t\r\n\t\tConnection connect = null;\r\n\t Statement st = null;\r\n\t ResultSet rs = null;\r\n\t String url = \"jdbc:mysql://localhost:3306/\";\r\n\t String db = \"ehcache\";\r\n\t String driver = \"com.mysql.jdbc.Driver\";\r\n\t String user = \"ehcache\";\r\n\t String pass = \"terracotta\";\r\n\t customer mc = new customer();\r\n\t \r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tClass.forName(driver);\r\n\t\t\tconnect = DriverManager\r\n\t\t\t .getConnection(url + db, user, pass);\r\n\t\t\t\r\n\t\t\tst = connect.createStatement();\r\n\t\t rs = st.executeQuery(\"select * from customers where ID='\" + key + \"'\");\r\n\t\t // rs = st.executeQuery(\"select * from customers where ID='1'\");\r\n\t\t \r\n\t\t System.out.println(\"(dbReadThrough) Retrieving customer \" + key + \" from DB ... \");\r\n\t\t \r\n\t\t while (rs.next()) {\r\n\t\t \t\r\n\t\t \t\r\n\t\t \tint ID = rs.getInt(\"ID\");\r\n\t\t \tString FIRSTNAME = rs.getString(\"FIRSTNAME\");\r\n\t\t \tString LASTNAME = rs.getString(\"LASTNAME\");\r\n\t\t \tString REGION = rs.getString(\"REGION\");\r\n\t\t \tString ADDRESS = rs.getString(\"ADDRESS\");\r\n\t\t \r\n\t\t \tSystem.out.println(\"(dbReadThrough) Found customer: \" + ID + \" -- \" + FIRSTNAME + \" \" + LASTNAME + \" \" + REGION + \" \" + ADDRESS);\r\n\t\t \t\t\t \t\r\n\t \t\tmc.setID(ID);\r\n\t \t\tmc.setFIRSTNAME(FIRSTNAME);\r\n\t \t\tmc.setLASTNAME(LASTNAME);\r\n\t \t\tmc.setREGION(REGION);\r\n\t \t\tmc.setADDRESS(ADDRESS); \t\r\n\t\t \t\t\t \t\r\n\t\t }\r\n\t\t \r\n\t\t System.out.println(\"(dbReadThrough) Writing object for customer \" + key + \" to the cache ... \");\r\n\t return mc;\r\n\t\t\r\n\t\t} finally {\r\n\t\t\tconnect.close();\r\n\t\t}\r\n\r\n\t}", "private List<Student> scrapeStudentsAndPersist(HtmlPage curPage) throws IOException {\r\n\t\tList<Student> students = scrapeStudents(curPage);\r\n\t\tLOGGER.info(\"Students scraped from class rank.\");\r\n\t\tif(PERSISTENCE_INTERFACE.connect()) {\r\n\t\t\tLOGGER.info(\"Connected to DB\");\r\n\t\t\tpersistClassRankFromPowerSchool(students);\r\n\t\t\tLOGGER.info(\"Class rank data persisted for \" + students.size() + \" students\");\r\n\t\t} else {\r\n\t\t\thandleDatabaseConnectionFailure();\r\n\t\t}\r\n\t\treturn students;\r\n\t}", "public void storeValues() throws SQLException { //store values into the database\n \tstoreValuesDump();\n \tstoreValuesMatl();\n }", "protected void fetch() {\n HttpClient client = new HttpClient();\n client.getHostConfiguration().setHost(HOST, PORT, SCHEME);\n\n List<String> prefectures = getCodes(client, PATH_PREF, \"pref\");\n List<String> categories = getCodes(client, PATH_CTG, \"category_s\");\n\n // This is a workaround for the gnavi API.\n // Gnavi API only allows max 1000 records for output.\n // Therefore, we divide records into smaller pieces\n // by prefectures and categories.\n for (String prefecture: prefectures) {\n for (String category: categories) {\n logger.debug(\"Prefecture: {}\", prefecture);\n logger.debug(\"Category: {}\", category);\n getVenues(client, prefecture, category, 1);\n }\n }\n }", "public int toDatabase()\r\n\t{\r\n\t\tRationaleDB db = RationaleDB.getHandle();\r\n\t\tConnection conn = db.getConnection();\r\n\t\t\r\n\t\tint ourid = 0;\r\n\r\n\t\t// Update Event To Inform Subscribers Of Changes\r\n\t\t// To Rationale\r\n\t\tRationaleUpdateEvent l_updateEvent;\t\t\r\n\t\t\r\n\t\t//find out if this tradeoff is already in the database\r\n\t\tStatement stmt = null; \r\n\t\tResultSet rs = null; \r\n\t\t\r\n//\t\tSystem.out.println(\"Saving to the database\");\r\n\t\t\r\n\t\ttry {\r\n\t\t\tstmt = conn.createStatement(); \r\n\t\t\t\r\n\t\t\t//now we need to find our ontology entries, and that's it!\r\n\t\t\tString findQuery3 = \"SELECT id FROM OntEntries where name='\" +\r\n\t\t\tRationaleDBUtil.escape(this.ont1.getName()) + \"'\";\r\n\t\t\trs = stmt.executeQuery(findQuery3); \r\n//\t\t\t***\t\t\tSystem.out.println(findQuery3);\r\n\t\t\tint ontid1;\r\n\t\t\tif (rs.next())\r\n\t\t\t{\r\n\t\t\t\tontid1 = rs.getInt(\"id\");\r\n//\t\t\t\trs.close();\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tontid1 = 0;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//now we need to find our ontology entries\r\n\t\t\tString findQuery4 = \"SELECT id FROM OntEntries where name='\" +\r\n\t\t\tRationaleDBUtil.escape(this.ont2.getName()) + \"'\";\r\n\t\t\trs = stmt.executeQuery(findQuery4); \r\n//\t\t\t***\t\t\tSystem.out.println(findQuery4);\r\n\t\t\tint ontid2;\r\n\t\t\tif (rs.next())\r\n\t\t\t{\r\n\t\t\t\tontid2 = rs.getInt(\"id\");\r\n//\t\t\t\trs.close();\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tontid2 = 0;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tString trade;\r\n\t\t\tif (tradeoff)\r\n\t\t\t{\r\n\t\t\t\ttrade = \"Tradeoff\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\ttrade = \"Co-Occurrence\";\r\n\t\t\t}\r\n\t\t\tString sym;\r\n\t\t\tsym = new Boolean(symmetric).toString();\r\n\t\t\t\r\n\t\t\t/*\r\n\t\t\t String findQuery = \"SELECT id FROM tradeoffs where name='\" +\r\n\t\t\t this.name + \"'\";\r\n\t\t\t System.out.println(findQuery);\r\n\t\t\t rs = stmt.executeQuery(findQuery); \r\n\t\t\t \r\n\t\t\t if (rs.next())\r\n\t\t\t {\r\n\t\t\t System.out.println(\"already there\");\r\n\t\t\t ourid = rs.getInt(\"id\");\r\n\t\t\t //\t\t\t\trs.close();\r\n\t\t\t */\r\n\t\t\t\r\n\t\t\tif (this.id > 0)\r\n\t\t\t{\t\t\t\t\r\n\t\t\t\t//now, update it with the new information\r\n\t\t\t\tString updateOnt = \"UPDATE Tradeoffs \" +\r\n\t\t\t\t\"SET name = '\" +\r\n\t\t\t\tRationaleDBUtil.escape(this.name) + \"', \" +\r\n\t\t\t\t\"description = '\" +\r\n\t\t\t\tRationaleDBUtil.escape(this.description) + \"', \" +\r\n\t\t\t\t\"type = '\" + \r\n\t\t\t\ttrade + \"', \" +\r\n\t\t\t\t\"symmetric = '\" +\r\n\t\t\t\tsym + \"', \" +\r\n\t\t\t\t\"ontology1 = \" + new Integer(ontid1).toString() + \", \" +\r\n\t\t\t\t\"ontology2 = \" + new Integer(ontid2).toString() +\r\n\t\t\t\t\" WHERE \" +\r\n\t\t\t\t\"id = \" + this.id + \" \" ;\r\n//\t\t\t\tSystem.out.println(updateOnt);\r\n\t\t\t\tstmt.execute(updateOnt);\r\n\t\t\t\t\r\n\t\t\t\tourid = this.id;\r\n\t\t\t\t\r\n\t\t\t\tl_updateEvent = m_eventGenerator.MakeUpdated();\r\n\t\t\t\t//\t\t\tSystem.out.println(\"sucessfully added?\");\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\t//now, we have determined that the tradeoff is new\r\n\t\t\t\t\r\n\t\t\t\tString newArgSt = \"INSERT INTO Tradeoffs \" +\r\n\t\t\t\t\"(name, description, type, symmetric, ontology1, ontology2) \" +\r\n\t\t\t\t\"VALUES ('\" +\r\n\t\t\t\tRationaleDBUtil.escape(this.name) + \"', '\" +\r\n\t\t\t\tRationaleDBUtil.escape(this.description) + \"', '\" +\r\n\t\t\t\ttrade + \"', '\" +\r\n\t\t\t\tsym + \"', \" +\r\n\t\t\t\tnew Integer(ontid1).toString() + \", \" +\r\n\t\t\t\tnew Integer(ontid2).toString() + \")\";\r\n\t\t\t\t\r\n//\t\t\t\tSystem.out.println(newArgSt);\r\n\t\t\t\tstmt.execute(newArgSt); \r\n//\t\t\t\tSystem.out.println(\"inserted stuff\");\r\n\t\t\t\t\r\n//\t\t\t\tnow, we need to get our ID\r\n\t\t\t\tString findQuery2 = \"SELECT id FROM tradeoffs where name='\" +\r\n\t\t\t\tRationaleDBUtil.escape(this.name) + \"'\";\r\n\t\t\t\trs = stmt.executeQuery(findQuery2); \r\n\t\t\t\t\r\n\t\t\t\tif (rs.next())\r\n\t\t\t\t{\r\n\t\t\t\t\tourid = rs.getInt(\"id\");\r\n\t\t\t\t\trs.close();\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tourid = -1;\r\n\t\t\t\t}\r\n\t\t\t\tthis.id = ourid;\r\n\t\t\t\t\r\n\t\t\t\tl_updateEvent = m_eventGenerator.MakeCreated();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tm_eventGenerator.Broadcast(l_updateEvent);\r\n\t\t} catch (SQLException ex) {\r\n\t\t\tRationaleDB.reportError(ex, \"Tradeoff.toDatabase\", \"SQL Error\");\r\n\t\t}\r\n\t\t\r\n\t\tfinally { \r\n\t\t\tRationaleDB.releaseResources(stmt, rs);\r\n\t\t}\r\n\t\t\r\n\t\treturn ourid;\t\r\n\t\t\r\n\t}", "protected void loadInfo() {\n\t\tboolean isSuccess = true;\n\t\ttry {\n\t\t\tsmt = conn.createStatement();\n\t\t\trs = smt.executeQuery(\"select * from Google_Auth\");\n\t\t\totp_username = rs.getString(\"username\");\n\t\t\totp_SECRET_KEY = aria.Decrypt(rs.getString(\"secretcode\"));\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n isSuccess = false;\n }\n }", "private void saveData(){\n\t\tdataBase=mHelper.getWritableDatabase();\n\t\tContentValues values=new ContentValues();\n\t\t\n\t\tvalues.put(DbHelper.KEY_NNAME,nname);\n\t\t//values.put(DbHelper.KEY_LNAME,lname );\n\t\t\n\t\tSystem.out.println(\"\");\n\t\tif(isUpdate)\n\t\t{ \n\t\t\t//update database with new data \n\t\t\tdataBase.update(DbHelper.TABLE_NOTE, values, DbHelper.KEY_ID+\"=\"+id, null);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//insert data into database\n\t\t\tdataBase.insert(DbHelper.TABLE_NOTE, null, values);\n\t\t}\n\t\t//close database\n\t\tdataBase.close();\n\t\tfinish();\n\t\t\n\t\t\n\t}", "@Override\n public void run() {\n long[] saved = AppDatabase.getInstance().modelByName(name).insertAll((List) response);\n updateProgressDownload(1, name);\n }", "protected abstract T fetch();", "private void storeInputInDatabase(){\n // get the {@userInfoValues} as inputs of userInfo that needs to be inserted in the table {@ user_info}\n // get the {@productInfoValues} as inputs of user Product details that needs to be inserted in the table {@ product_info}\n // This is called when user clicks on add new client.\n if (firstName == null && location == null) {\n ContentValues userInfoValues = storeUserInfo();\n /**\n * {@user_info_insertion_uri} {@product_info_insertion_uri} returns a Uri with the last inserted row number after the insertion of the content values,\n * {@user_info_insertion_uri} last character which is {@ID} is then used by {@productInfoValues} for it's foreign key.\n * ContentUris.parseId(uri) find the id from the uri and return it.\n * */\n Uri user_info_insertion_uri = getContentResolver().insert(clientContract.ClientEntry.CONTENT_URI, userInfoValues);\n ContentValues productInfoValues = storeProductInfo(ContentUris.parseId(user_info_insertion_uri));\n Uri product_info_insertion_uri = getContentResolver().insert(clientContract.ClientInfo.CONTENT_URI,productInfoValues);\n Toast.makeText(AddNewClient.this,\"Added\",Toast.LENGTH_SHORT).show();\n\n }// when clients client buys a new item so this will add it to the product_info\n // currentClientUri is the Uri received from MainActivity.\n else if( (firstName != null && location != null) && payMode == null && product_pk_id == -2) {\n ContentValues productInfoValues = storeProductInfo(ContentUris.parseId(currentClientUri));\n Uri uris = getContentResolver().insert(clientContract.ClientInfo.CONTENT_URI_PRODUCT_INFO_INSERT_ITEM,productInfoValues);\n Toast.makeText(AddNewClient.this,\"Added\",Toast.LENGTH_SHORT).show();\n }else if (firstName != null && location != null && payMode != null && product_pk_id != -2){\n ContentValues productInfoValues = storeProductInfo(product_pk_id);\n int rows = getContentResolver().update(clientContract.ClientInfo.CONTENT_URI,productInfoValues,clientContract.ClientInfo.COLUMN_PK_ID+\"=\"+product_pk_id,null);\n if (rows == 0){\n Toast.makeText(this,\"Error\",Toast.LENGTH_SHORT).show();\n }else{\n Toast.makeText(this,\"Updated\",Toast.LENGTH_SHORT).show();\n }\n }\n }", "@Override\n protected Integer doInBackground(Void... params){\n ManagerClass managerClass = new ManagerClass();\n CognitoCachingCredentialsProvider credentialsProvider = managerClass.getCredentials(MainActivity.this); //Pass in the activity name\n AmazonDynamoDBClient ddbClient = new AmazonDynamoDBClient(credentialsProvider);\n DynamoDBMapper mapper = new DynamoDBMapper(ddbClient);\n\n //Get values through ID of field or Geo code\n Truck newTruck = new Truck();\n newTruck.setID(5);\n newTruck.setLat(3);\n newTruck.setLon(4);\n newTruck.setName(\"Best Tacos\");\n mapper.save(newTruck);\n\n return null;\n }", "public void loadInitialData() {\n\t\t\texecuteTransaction(new Transaction<Boolean>() {\n\t\t\t\t@Override\n\t\t\t\tpublic Boolean execute(Connection conn) throws SQLException {\n\t\t\t\t\tList<Item> inventory;\n\t\t\t\t\tList<Location> locationList;\n\t\t\t\t\tList<User> userList;\n\t\t\t\t\tList<JointLocations> jointLocationsList;\n\t\t\t\t\t//List<Description> descriptionList; \n\t\t\t\t\t\n\t\t\t\t\ttry {\n\t\t\t\t\t\tinventory = InitialData.getInventory();\n\t\t\t\t\t\tlocationList = InitialData.getLocations(); \n\t\t\t\t\t\tuserList = InitialData.getUsers();\n\t\t\t\t\t\tjointLocationsList = InitialData.getJointLocations();\n\t\t\t\t\t\t//descriptionList = //InitialData.getDescriptions();\n\t\t\t\t\t\t\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\tthrow new SQLException(\"Couldn't read initial data\", e);\n\t\t\t\t\t}\n\n\t\t\t\t\tPreparedStatement insertItem = null;\n\t\t\t\t\tPreparedStatement insertLocation = null; \n\t\t\t\t\tPreparedStatement insertUser = null;\n\t\t\t\t\tPreparedStatement insertJointLocations = null;\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// AD: populate locations first since location_id is foreign key in inventory table\n\t\t\t\t\t\tinsertLocation = conn.prepareStatement(\"insert into locations (description_short, description_long) values (?, ?)\" );\n\t\t\t\t\t\tfor (Location location : locationList)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinsertLocation.setString(1, location.getShortDescription());\n\t\t\t\t\t\t\tinsertLocation.setString(2, location.getLongDescription());\n\t\t\t\t\t\t\tinsertLocation.addBatch();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinsertLocation.executeBatch(); \n\t\t\t\t\t\t\n\t\t\t\t\t\tinsertJointLocations = conn.prepareStatement(\"insert into jointLocations (fk_location_id, location_north, location_south, location_east, location_west) values (?, ?, ?, ?, ?)\" );\n\t\t\t\t\t\tfor (JointLocations jointLocations: jointLocationsList)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinsertJointLocations.setInt(1, jointLocations.getLocationID());\n\t\t\t\t\t\t\tinsertJointLocations.setInt(2, jointLocations.getLocationNorth());\n\t\t\t\t\t\t\tinsertJointLocations.setInt(3, jointLocations.getLocationSouth());\n\t\t\t\t\t\t\tinsertJointLocations.setInt(4, jointLocations.getLocationEast());\n\t\t\t\t\t\t\tinsertJointLocations.setInt(5, jointLocations.getLocationWest());\n\t\t\t\t\t\t\tinsertJointLocations.addBatch();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinsertJointLocations.executeBatch();\n\t\t\t\t\t\t\n\t\t\t\t\t\tinsertItem = conn.prepareStatement(\"insert into inventory (location_id, item_name) values (?, ?)\");\n\t\t\t\t\t\tfor (Item item : inventory) \n\t\t\t\t\t\t{\n//\t\t\t\t\t\t\t// Auto generate itemID\n\t\t\t\t\t\t\tinsertItem.setInt(1, item.getLocationID());\n\t\t\t\t\t\t\tinsertItem.setString(2, item.getName());\n\t\t\t\t\t\t\tinsertItem.addBatch();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinsertItem.executeBatch();\n\t\t\t\t\t\t\n\t\t\t\t\t\tinsertUser = conn.prepareStatement(\"insert into users (username, password) values (?, ?)\");\n\t\t\t\t\t\tfor(User user: userList) {\n\t\t\t\t\t\t\tinsertUser.setString(1, user.getUsername());\n\t\t\t\t\t\t\tinsertUser.setString(2, user.getPassword());\n\t\t\t\t\t\t\tinsertUser.addBatch();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinsertUser.executeBatch();\n\t\t\t\t\t\t\n\t\t\t\t\t\tSystem.out.println(\"Tables populated\");\n\t\t\t\t\t\t\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tDBUtil.closeQuietly(insertLocation);\t\n\t\t\t\t\t\tDBUtil.closeQuietly(insertItem);\n\t\t\t\t\t\tDBUtil.closeQuietly(insertUser);\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t});\n\t\t}", "@WorkerThread\n public abstract void saveToDb(NetworkModel fetchedModel);", "private void saveData() {\n // Actualiza la información\n client.setName(nameTextField.getText());\n client.setLastName(lastNameTextField.getText());\n client.setDni(dniTextField.getText());\n client.setAddress(addressTextField.getText());\n client.setTelephone(telephoneTextField.getText());\n\n // Guarda la información\n DBManager.getInstance().saveData(client);\n }", "void loadWeather() {\n\n // existing station's weather records are never updated.\n // why not?????\n\n// if (!\"\".equals(stationId) && !stationIgnore) {\n if (!stationExists && !weather.isNullRecord()) {\n\n if (!weatherIsLoaded) {\n\n // is there a weather record?\n// int count = weather.getRecCnt(\n// MrnWeather.STATION_ID + \"=\" + stationId);\n\n// if (count == 0) {\n\n // insert weather record\n weather.setStationId(stationId);\n if (dbg3) System.out.println(\"<br>loadWeather: put weather = \" + weather);\n try {\n weather.put();\n } catch(Exception e) {\n System.err.println(\"loadWeather: put weather = \" + weather);\n System.err.println(\"loadWeather: put sql = \" + weather.getInsStr());\n e.printStackTrace();\n } // try-catch\n\n weatherCount++;\n\n// } else {\n//\n// // update weather record\n// MrnWeather whereWeather = new MrnWeather(stationId);\n// whereWeather.upd(weather);\n//\n// } // if (weatherRecordCount == 0)\n//\n weatherIsLoaded = true;\n } // if (!weather.isNullRecord())\n\n } // if (!stationExists && !weather.isNullRecord())\n// } // if (!\"\".equals(stationId) && !stationIgnore)\n\n weather = new MrnWeather();\n\n }", "public void fetch() {\n DateMidnight today = new DateMidnight(DateTimeZone.forID(tzString));\n this.setDate(today);\n this.scrape();\n }", "void getData() throws SQLException, IOException {\n\t\tint i = 0;\n\t\twhile (cu.rst.next()) {\n\t\t\t\n\t\t\t\n\t\t\tcm[i].setDetails(cu.rst.getInt(1), cu.rst.getString(3),\n\t\t\t\t\tcu.rst.getString(4), cu.rst.getString(5), cu.rst.getString(6),\n\t\t\t\t\tcu.rst.getInt(7));\n\t\t\ti++;\n\n\t\t}\n\t\tSystem.out.println(\"**************************DETAILS TAKEN**************************\");\n\n\t}", "@Override\n\tpublic long store() {\n\t\tlong existence = exists(this.nompId);\n\t\tif (existence != -1) {\n\t\t\treturn existence;\n\t\t}\n\t\t\n\t\t// build the content values for insert\n\t\tContentValues mContentValues = getBaseContentValues();\n\t\tmContentValues.put(NOMPDataContract.Need.COLUMN_NAME_BUDGET, budget);\n\n\t\t// insert\n\t\tSQLiteDatabase writable = this.getWritableDatabase();\n\t\t_id = writable.insert(NOMPDataContract.Need.TABLE_NAME, null,\n\t\t\t\tmContentValues);\n\n\t\twritable.close();\n\t\treturn _id;\n\t}", "public abstract void loadFromDatabase();", "private void updateDatabase( ) {\n\t\tList<Site> siteList = readRemoteData( );\n\n\t\t// Open the database\n\t\tEcoDatabaseHelper helper = new EcoDatabaseHelper(context_);\n\t\tSQLiteDatabase database = helper.getWritableDatabase();\n\n\t\t// Delete the current records\n\t\thelper.dropAndCreate(database);\n\n\t\t// Insert new ones\n\t\tnotifyListenersNumSites( siteList.size() );\n\t\tint siteIndex = 1;\n\n\t\t// Insert each site\n\t\tfor( Site site : siteList ) {\n\t\t\t// Add the site to the database\n\t\t\tContentValues cv = new ContentValues();\n\t\t\tcv.put(EcoDatabaseHelper.SITE_NAME, site.getName());\n\t\t\tcv.put(EcoDatabaseHelper.SITE_DESCRIPTION, site.getDescription());\n\t\t\tcv.put(EcoDatabaseHelper.SITE_TYPE, site.getType());\n\t\t\tcv.put(EcoDatabaseHelper.SITE_LINK, site.getLink());\n\t\t\tcv.put(EcoDatabaseHelper.SITE_LATITUDE, site.getLatitude());\n\t\t\tcv.put(EcoDatabaseHelper.SITE_LONGITUDE, site.getLongitude());\n\t\t\tcv.put(EcoDatabaseHelper.SITE_ICON, site.getIcon());\n\n\t\t\tif( database.insert(EcoDatabaseHelper.TABLE_SITES, null, cv) == -1 ) {\n\t\t\t\tLog.w(getClass( ).getCanonicalName(), \"Failed to insert record\" );\n\t\t\t}\n\n\t\t\t// Notify the listeners\n\t\t\tnotifyListenersSiteIndex( siteIndex );\n\t\t\t++siteIndex;\n\t\t}\n\t\tdatabase.close();\n\t}", "private void fetchIncomingData() {\n Bundle bundle = getIntent().getExtras();\n if (bundle.containsKey(\"TAX_ID\") && bundle.containsKey(\"TAX_NAME\")) {\n INCOMING_TAX_NAME = bundle.getString(\"TAX_NAME\");\n INCOMING_TAX_ID = bundle.getString(\"TAX_ID\");\n if (INCOMING_TAX_ID != null) {\n new fetchTaxDetails().execute();\n } else {\n //TODO: SHOW AN ERROR\n }\n } else {\n //TODO: SHOW AN ERROR\n }\n }", "public void fillLocalDatabase(String artist, String track)\n\t{\n\t\topenConnection();\n\t\tif(artist != null && track !=null)\n\t\t{\n\t\t\tTrack t = external.getTrack(artist, track);\n\t\t\tif (t!=null)\n\t\t\t{\n\t\t\t\tCollection<User> users = external.getListeners(t);\n\t\t\t\tinsertDataIntoPersons(users);\n\t\t\t\tfor(User u : users)\n\t\t\t\t{\n\t\t\t\t\tif(u!=null)\n\t\t\t\t\t{\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tCollection<Track> tracks = User.getTopTracks(u.getName(), key);\n\t\t\t\t\t\t\tinsertDataIntoListenings(u, tracks);\n\t\t\t\t\t\t\tSystem.out.println(u.getName()+\" added to listenings\");\n\t\t\t\t\t\t\tinsertDataIntoRecordings(tracks);\n\t\t\t\t\t\t\tSystem.out.println(u.getName()+\"s' tracks added to recordings\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch(Exception e)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSystem.out.println(\"Invalid Used data while adding to listeners\");\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\tcloseConnection();\n\t}", "private void fetchData() {\n mNest.addGlobalListener(new NestListener.GlobalListener() {\n @Override\n public void onUpdate(@NonNull GlobalUpdate update) {\n mThermostat = update.getThermostats().get(0);\n mStructure = update.getStructures().get(0);\n if(!Auth.isSignedIn){\n Log.d(TAG, \"GlobalListener: onUpdate: User is not signed in, signing in\");\n Auth.signIn(mThermostat,mStructure);\n }\n updateViews();\n }\n });\n }", "public static MainDatabase deserializeDatabase() {\n MainDatabase data = new MainDatabase();\n // first check if the file exists\n File file = new File(Constants.SAVE_FILE);\n if (!file.exists()) {\n return data;\n }\n try (FileInputStream in = new FileInputStream(Constants.SAVE_FILE);\n BufferedInputStream reader = new BufferedInputStream(in)) {\n\n // un-encrypted header (salt and iv necessary for decryption)\n byte[] salt = new byte[reader.read()];\n reader.read(salt);\n byte[] iv = new byte[reader.read()];\n reader.read(iv);\n Cipher enc = getEncryptionCipher(salt, iv);\n\n try (CipherInputStream cis = new CipherInputStream(reader, enc);\n ObjectInputStream ois = new ObjectInputStream(cis)) {\n\n // if we need any settings, read them here\n\n // read the travel database\n int count = ois.readByte();\n for (int i = 0; i < count; i++) {\n int size = ois.readInt();\n for (int j = 0; j < size; j++) {\n data.addTravel((SingleTravel) ois.readObject());\n }\n }\n\n // read the user database\n count = ois.readInt();\n for (int i = 0; i < count; i++) {\n RegisteredUser ru = (RegisteredUser) ois.readObject();\n data.addUser(ru);\n\n int size = ois.readInt();\n for (int j = 0; j < size; j++) {\n int itSize = ois.readInt();\n // check the itinerary to make sure it is still valid\n boolean validItinerary = (itSize > 0);\n Itinerary it = new Itinerary();\n for (int k = 0; k < itSize; k++) {\n try {\n SingleTravel st = data.getTravel(TravelType.values()[ois.readByte()],\n ois.readUTF());\n if (st == null) { // doesn't exist; do not add itinerary\n validItinerary = false;\n } else {\n it.add(st);\n }\n } catch (IllegalArgumentException e) {\n validItinerary = false;\n // we don't need to log this -- probably a travel expired\n }\n }\n if (validItinerary) {\n ru.bookItinerary(it);\n }\n }\n }\n }\n } catch (IOException | GeneralSecurityException | ClassNotFoundException e) {\n log.log(Level.SEVERE, \"Error reading from file.\", e);\n }\n return data;\n }", "EmployeeDetail save(EmployeeDetail detail) throws DBException;", "private void fetchDataFromDatabase() {\n\n listOfPersons.clear();\n Cursor cursor = AppDatabase.getInstance(context).getPersonList();\n if (cursor != null && cursor.moveToFirst()) {\n do {\n String firstName = cursor.getString(cursor.getColumnIndex(\"firstName\"));\n String lastName = cursor.getString(cursor.getColumnIndex(\"lastName\"));\n String email = cursor.getString(cursor.getColumnIndex(\"email\"));\n String dob = cursor.getString(cursor.getColumnIndex(\"dobDate\"));\n String phoneNumber = cursor.getString(cursor.getColumnIndex(\"phoneNumber\"));\n String pictureUrl = cursor.getString(cursor.getColumnIndex(\"pictureMediumUrl\"));\n String pictureImageData = cursor.getString(cursor.getColumnIndex(\"pictureImageData\"));\n String fullName = firstName + \" \" + lastName;\n Bitmap imageBitmap = UtilFunctions.stringToBitmap(pictureImageData);\n\n PersonWrapper person = new PersonWrapper(fullName, email, dob, phoneNumber, pictureUrl, imageBitmap);\n listOfPersons.add(person);\n\n } while (cursor.moveToNext());\n }\n\n initView(listOfPersons);\n }", "@Override\r\n\tpublic Account loadAccount(String accountNumber) {\n\t\tAccount account1=null;\r\n\t\ttry {\r\n\t\t\taccount1 = account.getclone(account);\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tString sql = \"SELECT a.accountNumber, a.balance, a.accountType, b.name, b.email, c.street, c.city, c.zip, c.state \"+\r\n \"FROM customer b \"+\r\n \"INNER JOIN address c \"+\r\n \"ON b.addressID = c.ID \"+\r\n \"INNER JOIN account a \"+\r\n \"ON b.ID = a.CustomerID \"+\r\n\t\t\"WHERE a.accountNumber = \"+accountNumber+\";\" ;\r\n\t\tPreparedStatement preparedStatement;\r\n\r\n\r\n\r\ntry {\r\n\r\n\tpreparedStatement = con.prepareStatement(sql);\r\n\t\r\n\t\r\n ResultSet rs=preparedStatement.executeQuery();\r\n\r\n\r\n while ( rs.next() ) {\r\n \taccount1.setAccountNumber(Integer.toString(rs.getInt(1)));\r\n \taccount1.setBalance((double) rs.getInt(2));\r\n \tAccountType accty=BankAccountType.CHECKING;\r\n \tif(\"SAVING\".equalsIgnoreCase(rs.getString(3))){\r\n \t\taccty=BankAccountType.SAVING;\r\n \t}\r\n \taccount1.setAccountType(accty);\r\n \taccount1.getCustomer().setName(rs.getString(4));\r\n \taccount1.getCustomer().setEmail(rs.getString(5));\r\n \taccount1.getCustomer().getAddress().setStreet(rs.getString(6));\r\n \taccount1.getCustomer().getAddress().setCity(rs.getString(7));\r\n \taccount1.getCustomer().getAddress().setZip(rs.getString(8));\r\n \taccount1.getCustomer().getAddress().setState(rs.getString(9));\r\n \taccount1.setAccountEntries(getAccountEntry(accountNumber));\r\n \t\r\n System.out.println(account1);\r\n \r\n }\r\n} catch (SQLException e) {\r\n\t// TODO Auto-generated catch block\r\n\tSystem.out.println(\"Connection Failed! Check output console\");\r\n\te.printStackTrace();\r\n}\r\nlog();\r\n\r\n \r\nreturn account1;\r\n\t}", "void lookupAndSaveNewPerson();", "private ContentValues storeUserInfo(){\n EditText et_client_name = findViewById(R.id.et_client_fName);\n EditText et_client_location = findViewById(R.id.et_client_sName);\n\n String name = String.valueOf(et_client_name.getText()).trim();\n String location = String.valueOf(et_client_location.getText()).trim();\n ContentValues userInfoValues = new ContentValues();\n userInfoValues.put(clientContract.ClientEntry.COLUMN_FIRST_NAME,name);\n userInfoValues.put(clientContract.ClientEntry.COLUMN_LOCATION,location);\n return userInfoValues;\n }", "void fetchStartHousesData();", "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 }", "private void pushToHibernate(){\n DATA_API.saveUser(USER);\n }", "static void fillData() {\n\n try {\n // Class.forName(\"org.sqlite.JDBC\");\n connection = DriverManager.getConnection(\"jdbc:sqlite:CarServiceDatabase.db\");\n \n Statement stmt = null;\n\n stmt = connection.createStatement();\n ResultSet rs = stmt.executeQuery(\"SELECT * from Car_Info;\");\n\n // adding Cars to the Software store\n while (rs.next()) {\n\n String model = rs.getString(\"car_model\");\n String make = rs.getString(\"car_make\");\n String VIN = rs.getString(\"car_VIN\");\n int year = rs.getInt(\"car_year\");\n int mileage = rs.getInt(\"car_mileage\");\n String serviceDate = null;\n\n String owner = connection.createStatement().executeQuery(\"select owner_firstName from Car_Owner where owner_ID = \" + rs.getInt(\"owner_ID\")).getString(\"owner_firstName\");\n owner = owner + connection.createStatement().executeQuery(\"select owner_lastName from Car_Owner where owner_ID = \" + rs.getInt(\"owner_ID\")).getString(\"owner_lastName\");\n Cars.add(new Car(VIN, make, model, year, mileage, serviceDate, owner));\n\n }\n\n rs = stmt.executeQuery(\"SELECT * FROM Dealership;\");\n\n // adding Dealer to the Software store\n while (rs.next()) {\n String dealer_Name = rs.getString(\"dealer_name\");\n String dealer_address = rs.getString(\"dealer_address\");\n String dealer_phoneNum = rs.getString(\"dealer_phoneNum\");\n dealerships.add(new Dealership(dealer_Name, dealer_address, dealer_phoneNum));\n }\n\n rs = stmt.executeQuery(\"SELECT * FROM Service_Techs;\");\n\n // adding TECHS to the Software store\n while (rs.next()) {\n int dealer_ID = rs.getInt(\"dealer_ID\");\n String techName = rs.getString(\"tech_Name\");\n\n ServiceTechs.add(dealerships.get(dealer_ID - 1).new ServiceTech(dealer_ID, techName));\n }\n\n // adding Service_Info to the Software store\n rs = stmt.executeQuery(\"SELECT * FROM Service_Info;\");\n\n while (rs.next()) {\n String serviceDate = null;\n int techID = rs.getInt(\"tech_ID\");\n int dealershipID = rs.getInt(\"dealer_ID\");\n String carVIN = rs.getString(\"car_VIN\");\n\n String partsUsed = rs.getString(\"parts_used\");\n String serviceDesc = rs.getString(\"service_description\");\n double partsCost = rs.getDouble(\"cost_of_parts\");\n double totalCost = rs.getDouble(\"cost_of_service\");\n double laborHours = rs.getDouble(\"labor_hours\");\n\n serviceOrders.add(new ServiceOrder(carVIN, serviceDesc, serviceDate, partsUsed, techID, dealershipID,\n partsCost, totalCost, laborHours));\n\n }\n\n rs = stmt.executeQuery(\"SELECT * FROM Car_Owner;\");\n\n // adding Dealer to the Software store\n while (rs.next()) {\n String ownerFirstName = rs.getString(\"owner_firstName\");\n String ownerLastName = rs.getString(\"owner_lastName\");\n String ownerPhoneNumer = rs.getString(\"phone_num\");\n String ownerEmail = rs.getString(\"owner_email\");\n owners.add(new Owner(ownerFirstName, ownerLastName, ownerPhoneNumer, ownerEmail));\n }\n\n rs.close();\n stmt.close();\n\n } catch (Exception e) {\n Alert a = new Alert(AlertType.ERROR);\n a.setContentText(\"Something is wrong when accessing the database\");\n\n // show the dialog\n a.show();\n }\n\n }", "public final boolean save( ) throws Exception\n\t{\n\t\tboolean ret;\n\n\t\tif ( this.href == null )\n\t\t{\n\t\t\tfinal String location = Datastore.getInstance( ).postOnServer( this );\n\t\t\tthis.href = location;\n\t\t\tret = location != null;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tret = Datastore.getInstance( ).updateOnServer( this );\n\t\t}\n\n\t\t/* fetch server-side values */\n\t\tload( );\n\n\t\treturn ret;\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 retrieveAllUserData() {\n retrieveBasicUserInfo();\n retrieveUsersRecentMedia();\n retrieveUsersLikedMedia();\n }", "private void updateDatabase() {\n\t\tAbstractSerializer serializer = new CineplexSerializer();\n\t\tArrayList<String> updatedRecords = serializer.serialize(records);\n\t\tDatabaseHandler.writeToDatabase(DATABASE_NAME, updatedRecords);\n\t}", "public void loadDataFromDB() {\n if(user == null) {\n return;\n }\n decodeImage(user.getProfilePic(), imageView);\n usernameTV.setText(user.getUserID());\n emailTV.setText(user.getEmail());\n followingTV.setText(Integer.toString(user.getFollowingList().size()));\n followerTV.setText(Integer.toString(user.getNumFollwers()));\n list.clear();\n for (int i = 0; i < user.getNotification().size(); i++) {\n list.add(user.getNotification().get(i).getString());\n }\n\n getUsers();\n }", "private void populateFromDatabase() throws Exception {\n ResultSet results = database.select(\"AnswerOptions\", \"*\", \"optionId = \" + this.optionId);\n while (results.next()) {\n this.questionId = results.getInt(\"questionId\");\n this.option = results.getString(\"option\");\n this.position = results.getInt(\"matchingPosition\");\n }\n database.closeConnection();\n }", "private void getInfo() throws SQLException {\n printAllWebsites();\n\n System.out.println(\"What website do you want to look up?\");\n String website = input.next();\n System.out.println(\"What is the username?\");\n String username = input.next();\n\n try (PreparedStatement stmt = connection.prepareStatement(\"SELECT password FROM website_data\\n\" +\n \"LEFT JOIN passwords p on website_data.website_data_id = p.website_data_id\\n\" +\n \"LEFT JOIN users u on p.user_id = u.id\\n\" +\n \"WHERE website like (?) AND u.id like (?) AND website_data.username like (?)\")) {\n stmt.setString(1, website);\n stmt.setInt(2, this.user.getId());\n stmt.setString(3, username);\n ResultSet rs = stmt.executeQuery();\n String password;\n if (rs.next()) {\n SecretKey key = User.getKey(user.getDecryptedKey());\n try {\n Cipher cipher = Cipher.getInstance(\"AES/ECB/PKCS5PADDING\");\n cipher.init(Cipher.DECRYPT_MODE, key);\n password = new String(cipher.doFinal(Base64.getDecoder().decode(rs.getString(\"password\"))));\n System.out.println(\"password: \" + password);\n } catch (Exception e) {\n System.out.println(\"Error while decrypting: \" + e.toString());\n }\n } else System.out.println(\"No passwords found.\");\n } catch (SQLException e) {\n System.out.println(\"Error while retrieving password.\");\n throw e;\n }\n }", "@Override\n public void executeQuery() {\n try {\n Put put = new Put(this.userId.getBytes());\n put.add(\"cf\".getBytes(), Bytes.toBytes(this.poi.getTimestamp()), this.poi.getBytes());\n this.table.put(put);\n \n } catch (IOException ex) {\n Logger.getLogger(InsertPOIVisitClient.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "@Override\r\n\tpublic void loadData() {\r\n\t\t// Get Session\r\n\r\n\t\tSession ses = HibernateUtil.getSession();\r\n\r\n\t\tQuery query = ses.createQuery(\"FROM User\");\r\n\r\n\t\tList<User> list = null;\r\n\t\tSet<PhoneNumber> phone = null;\r\n\t\tlist = query.list();\r\n\t\tfor (User u : list) {\r\n\t\t\tSystem.out.println(\"Users are \" + u);\r\n\t\t\t// Getting phones for for a particular user Id\r\n\t\t\tphone = u.getPhone();\r\n\t\t\tfor (PhoneNumber ph : phone) {\r\n\t\t\t\tSystem.out.println(\"Phones \" + ph);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}", "public void insert() {\n\t\tSession session = DBManager.getSession();\n\t\tsession.beginTransaction();\n\t\tsession.save(this);\n\t\tsession.getTransaction().commit();\n\t}", "private ArrayList<HashMap<String, String>> processRetrieve() {\n //Transform and Return Rows to a List of HashMaps\n try {\n if (rs == null) {\n System.out.println(\"rs is null\");\n } else {\n return rsToMaps();\n }\n } catch (SQLException ex) {\n throw new RuntimeException(ex);\n }\n return null;\n }", "private void retrieveData(){\n databaseReference.addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n Teacher teacher = dataSnapshot.getValue(Teacher.class);\n\n if (teacher==null){\n saveData();\n }\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n toast(getString(R.string.retrieve_failed));\n }\n });\n }", "private void readAndSAVE(){\n boolean vaidation_status = true;\n\n achiv_title = edtxt_achiv_title.getText().toString();\n if (TextUtils.isEmpty(achiv_title)){\n edtxt_achiv_title.setError(\"Please enter valid details !!\");\n vaidation_status = false;\n } else {\n edtxt_achiv_title.setError(null);\n }\n\n achiv_date = edtxt_achiv_date.getText().toString();\n if (TextUtils.isEmpty(achiv_date)){\n edtxt_achiv_date.setError(\"Please enter valid details !!\");\n vaidation_status = false;\n } else {\n edtxt_achiv_date.setError(null);\n }\n\n\n\n achiv_details = edtxt_achiv_details.getText().toString();\n if(achiv_details.isEmpty()){\n vaidation_status = false;\n edtxt_achiv_details.setText(\"Please write Details!!\");\n }\n\n // if all vaidation is true then add all details into firbase database\n if(vaidation_status){\n\n //create Details model\n AchivmentsDetails addNewAchiv = new AchivmentsDetails();\n\n addNewAchiv.setAchv_titles(achiv_title);\n addNewAchiv.setAchv_date(achiv_date);\n addNewAchiv.setAchv_details(achiv_details);\n\n showProgressDialog();\n\n if(mAuth.getCurrentUser()!=null)\n {\n //CHECK IF new achivments has been added or update process.\n String achiv_key;\n if(operationStatus.equals(\"ADD_NEW\")) {\n\n // Get new push key\n achiv_key = mDatabase.child(\"UserNode\").child(mAuth.getCurrentUser().getUid()).child(\"Achivments_Info\").push().getKey();\n addNewAchiv.setAchv_firbase_ID(achiv_key);\n\n } else {\n achiv_key = operationStatus;\n addNewAchiv.setAchv_firbase_ID(achiv_key);\n }\n\n // save the user at UserNode under user UID\n mDatabase.child(\"UserNode\").child(mAuth.getCurrentUser().getUid()).child(\"Achivments_Info\").child(achiv_key).setValue(addNewAchiv, new DatabaseReference.CompletionListener() {\n @Override\n public void onComplete(DatabaseError databaseError, DatabaseReference databaseReference) {\n\n hideProgressDialog();\n\n if(databaseError==null)\n {\n Toast.makeText(AddNewAchivmentsActivity.this, \"Your Details has been saved !!\",\n Toast.LENGTH_SHORT).show();\n finish();\n }\n }\n });\n }\n\n\n\n }\n }", "public void populate(){\n salesRepRepository.save(new SalesRep(\"Maddy\"));\n salesRepRepository.save(new SalesRep(\"Jegor\"));\n salesRepRepository.save(new SalesRep(\"Natalia\"));\n salesRepRepository.save(new SalesRep(\"Joao\"));\n }", "public void store(DBConnection db) throws IOException;", "public static void fetch() throws SQLException {\n courses.clear();\n ResultSet rs;\n String sql = \"SELECT * FROM course order by courseNum\";\n rs = DatabaseConnector.returnQuery(sql);\n while (rs.next()) {\n Course course = new Course();\n course.setCourseDept(rs.getString(\"courseDept\"));\n course.setCourseNum(rs.getString(\"courseNum\"));\n course.setCourseName(rs.getString(\"courseName\"));\n course.setInfo(rs.getString(\"info\"));\n course.setCredit(rs.getInt(\"credit\"));\n courses.add(course);\n }\n }", "public List<CustomerModel> readDatabase() throws Exception{\n\nList<CustomerModel> list = new ArrayList<CustomerModel>();\n\ntry{\nlog.info(\"Loading MySql driver\");\nClass.forName(\"com.mysql.jdbc.Driver\");\n\nlog.info(\"Setting up connection with db\");\nconnect= DriverManager.getConnection(\"jdbc:mysql://localhost:3306/apidft\",\"root\",\"cisco\");\nlog.info(\"Database connection successful\");\nstatement = connect.createStatement();\n\nresultSet= statement.executeQuery(\"select * from customer\");\n\nwhile(resultSet.next()){\nlist.add(processRow(resultSet));\n}\n}\n\ncatch(Exception e){\nlog.error(\"Database connection fail\");\n}\n\nfinally{\nconnect.close();\n}\nreturn list;\n}", "public void getDataFromFile() throws SQLException{\n \n //SQL database\n getGuestDate_DB();\n getHotelRoomData_DB();\n updateRoomChanges_DB();\n \n //this.displayAll();\n //this.displayAllRooms();\n \n }", "int insert(UserInfo record);", "public void persistHotel(Hotel hotel) throws SQLException{\n\t\tPlace place = new Place(hotel.getName(), hotel.getCoord(), hotel.getDescriptionFile());\n\t\tpersistPlace(place);\n\t\tpersistPlace(hotel.getBeach());\n\t\t\n\t\tString readPlacePKQuery = \"SELECT id FROM Place WHERE name = ? AND descriptionFile = ?\";\n\t\tString readBeachPKQuery = \"SELECT id FROM Place WHERE name = ? AND descriptionFile = ?\";\n\t\tString insertHotelQuery = \"INSERT INTO Hotel (id_place, pricePerDay, id_beach) VALUES (?,?,?)\";\n\n\t\t//Then, get the primary key of the Place part and the beach\n\t\tPreparedStatement preparedStatement = conn.prepareStatement(readPlacePKQuery);\n\t\t\n\t\tpreparedStatement.setString(1, place.getName());\n\t\tpreparedStatement.setString(2, place.getDescriptionFile());\n\t\t\n\t\tResultSet result = preparedStatement.executeQuery();\n\t\tresult.next();\n\t\t\n\t\tint placePK = result.getInt(\"id\");\n\t\t\n\t\tpreparedStatement.close();\n\t\t\n\t\tpreparedStatement = conn.prepareStatement(readBeachPKQuery);\n\t\t\n\t\tpreparedStatement.setString(1, hotel.getBeach().getName());\n\t\tpreparedStatement.setString(2, hotel.getBeach().getDescriptionFile());\n\t\t\n\t\tresult = preparedStatement.executeQuery();\n\t\tresult.next();\n\t\t\n\t\tint beachPK = result.getInt(\"id\");\n\n\t\t//Set place in the database\n\t\tpreparedStatement = conn.prepareStatement(insertHotelQuery);\n\t\t\n\t\tpreparedStatement.setInt(1, placePK);\n\t\tpreparedStatement.setFloat(2, hotel.getPricePerDay());\n\t\tpreparedStatement.setInt(3, beachPK);\n\n\t\tpreparedStatement.executeUpdate();\n\n\t\tpreparedStatement.close();\n\t\t\n\t}", "public void insert(){\n Connection conn = null;\n PreparedStatement ps = null;\n ResultSet rs = null;\n \n try{\n Class.forName(\"com.mysql.jdbc.Driver\");\n conn = DriverManager.getConnection(\n \"jdbc:mysql://localhost:3306/process_checkout\",\"root\",\"\"\n );\n \n String query = \"INSERT INTO area (name) VALUES (?)\";\n \n PreparedStatement preparedStmt = conn.prepareStatement(query);\n preparedStmt.setString(1, name);\n preparedStmt.execute();\n \n }catch(SQLException e){\n \n } catch (ClassNotFoundException ex) {\n \n }finally{\n try {\n if(rs != null)rs.close();\n } catch (SQLException e) {\n /* ignored */ }\n try {\n if(ps != null)ps.close();\n } catch (SQLException e) {\n /* ignored */ }\n try {\n if(conn != null)conn.close();\n } catch (SQLException e) {\n /* ignored */ }\n }\n \n }", "protected void saveValues() {\n dataModel.persist();\n }", "public void fetch(){ \n for(int i = 0; i < this.queries.size(); i++){\n fetch(i);\n }\n }", "public void save() {\r\n\t\tString checkQuery = \"SELECT * FROM users WHERE id = \" + this.id;\r\n\t\tStatement stm;\r\n\t\tResultSet rs = null;\r\n\t\ttry {\r\n\t\t\tconnection = DBConnection.getConnection();\r\n\t\t\tstm = connection.createStatement();\r\n\t\t\trs = stm.executeQuery(checkQuery);\r\n\t\t\t// istnieje już ten obiekt - update\r\n\t\t\tif (rs.first()) {\r\n\t\t\t\tString query = \"UPDATE users SET name = \" + toStringOrNULL(name)\r\n\t\t\t\t\t\t+ \", password = \" + toStringOrNULL(password)\r\n\t\t\t\t\t\t+ \", is_admin = \" + isAdmin \r\n\t\t\t\t\t\t+ \", removed_at = \" + toStringOrNULL(removedAt) \r\n\t\t\t\t\t\t+ \" WHERE id = \" + getId();\r\n\t\t\t\texecuteNonReturningQuery(query);\r\n\t\t\t}\r\n\t\t\t// jeszcze go nie ma - zapis nowego\r\n\t\t\telse {\r\n\t\t\t\tString query = \"INSERT INTO users (name, password, removed_at, is_admin) VALUES (\"\r\n\t\t\t\t\t\t+ toStringOrNULL(name) + \", \"\r\n\t\t\t\t\t\t+ toStringOrNULL(password) + \", \"\r\n\t\t\t\t\t\t+ toStringOrNULL(removedAt) + \", \"\r\n\t\t\t\t\t\t+ isAdmin + \")\";\r\n\t\t\t\texecuteNonReturningQuery(query);\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tconnection.close();\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void loadData(){\n try (BufferedReader br = new BufferedReader(new FileReader(this.fileName))) {\n String line;\n while((line=br.readLine())!=null){\n E e = createEntity(line);\n super.save(e);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void retrieve() {\n //retrieving details EditText input bars\n password_handler = findViewById(R.id.PasswordInput);\n email_handler = findViewById(R.id.EmailInput);\n inputPhone = findViewById(R.id.inputPhone);\n inputFullName = findViewById(R.id.inputFullName);\n\n city = findViewById(R.id.cityNameInput);\n street = findViewById(R.id.streetNameInput);\n floor = findViewById(R.id.floorNumberInput);\n appartment = findViewById(R.id.appartmentNumberInput);\n houseNum = findViewById(R.id.buildingNumberInput);\n\n progressBar2 = findViewById(R.id.progressBar2);\n\n //retrieving the names near the input bars\n pass = findViewById(R.id.Password);\n mail = findViewById(R.id.Email);\n phone = findViewById(R.id.Phone);\n name = findViewById(R.id.fullName);\n\n //confirm button\n confirm = findViewById(R.id.confirm);\n\n //checkboxes of advertiser and adopter\n inputadvertiser = findViewById(R.id.ifadvertiser);\n inputadopter = findViewById(R.id.ifadopter);\n\n }", "protected void proccesValues() {\n Users user = new Users();\n user.setName(bean.getName());\n user.setSurname(bean.getSurname());\n user.setUsername(bean.getUsername());\n StrongPasswordEncryptor passwordEncryptor = new StrongPasswordEncryptor();\n String encryptedPassword = passwordEncryptor.encryptPassword(bean.getPassword());\n user.setPassword(encryptedPassword);\n \n usersService.persist(user);\n Notification.show(msgs.getMessage(INFO_REGISTERED), Notification.Type.ERROR_MESSAGE);\n resetValues();\n UI.getCurrent().getNavigator().navigateTo(ViewLogin.NAME);\n }", "public void store() throws PersistenceException {\n }", "public void store() {\n session=(HttpSession)getPageContext().getSession();\n session.setAttribute(\"remoteUser\", getRemoteUser());\n session.setAttribute(\"authCode\", getAuthCode());\n }", "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}", "private void loadSchoolInfo() {\r\n \r\n try {\r\n // Get fine ammount to be incurred by retrieving data from the database. \r\n String sql3 = \"SELECT * FROM schoolInfo \";\r\n pstmt = con.prepareStatement(sql3);\r\n\r\n ResultSet rs3=pstmt.executeQuery();\r\n if (rs3.next()) {\r\n schoolName = rs3.getString(\"name\");\r\n schoolContact = rs3.getString(\"contact\");\r\n schoolAddress = rs3.getString(\"address\");\r\n schoolRegion = rs3.getString(\"region\");\r\n schoolEmail = rs3.getString(\"email\");\r\n schoolWebsite = rs3.getString(\"website\");\r\n } \r\n \r\n pstmt.close();\r\n \r\n } catch (SQLException e) {\r\n }\r\n \r\n //////////////////////////////////// \r\n }", "@Override\r\n protected void fetchData() {\n\r\n }", "private ServerError updateDatabase() {\n return updateDatabase(WebConf.DB_CONN, WebConf.JSON_OBJECTS, WebConf.DEFAULT_VERSION);\r\n }", "@Override\r\n public void read() {\n System.out.println('\\n' + \"DB repo: \");\r\n //Idk, probably search for a person and read data??\r\n\r\n }", "private void updateDB() {\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 }", "public void addAll() throws SQLException {\r\n DbHandler dbHandler = new DbHandler();\r\n\r\n ResultSet resultSet = dbHandler.getAll();\r\n while (resultSet.next()) {\r\n Photographer photographer = new Photographer();\r\n photographer.setId(resultSet.getString(1));\r\n System.out.println(photographer.getId());\r\n photographer.setName(resultSet.getString(2));\r\n System.out.println(photographer.getName());\r\n photographer.setSurname(resultSet.getString(3));\r\n System.out.println(photographer.getSurname());\r\n photographer.setStage(resultSet.getString(4));\r\n System.out.println(photographer.getStage());\r\n photographer.setPortfolio(resultSet.getString(5));\r\n System.out.println(photographer.getPortfolio());\r\n photographer.setLocation_(resultSet.getString(6));\r\n System.out.println(photographer.getLocation_());\r\n readersList.add(photographer);\r\n }\r\n }", "void all_Data_retrieve() {\n\t\tStatement stm=null;\n\t\tResultSet rs=null;\n\t\ttry{\n\t\t\t//Retrieve tuples by executing SQL command\n\t\t stm=con.createStatement();\n\t String sql=\"select * from \"+tableName+\" order by id desc\";\n\t\t rs=stm.executeQuery(sql);\n\t\t DataGUI.model.setRowCount(0);\n\t\t //Add rows to table model\n\t\t while (rs.next()) {\n Vector<Object> newRow = new Vector<Object>();\n //Add cells to each row\n for (int i = 1; i <=colNum; i++) \n newRow.addElement(rs.getObject(i));\n DataGUI.model.addRow(newRow);\n }//end of while\n\t\t //Catch SQL exception\n }catch (SQLException e ) {\n \te.printStackTrace();\n\t } finally {\n\t \ttry{\n\t if (stm != null) stm.close(); \n\t }\n\t \tcatch (SQLException e ) {\n\t \t\te.printStackTrace();\n\t\t }\n\t }\n\t}", "@Override\n\tprotected void onActivityResult(int requestCode, int resultCode, Intent intent) {\n\t\tsuper.onActivityResult(requestCode, resultCode, intent);\n\t\tfetchDataFromDb();\n\t}", "private Account loadDataFromDB(String id){\n if(mCurrentAccount == null){\n mCurrentAccount = getAccountDetailUC.execute(id);\n try {\n mLastSaveAccount = mCurrentAccount.clone();\n } catch (CloneNotSupportedException e) {\n e.printStackTrace();\n }\n }else{\n mCurrentAccount = getAccountDetailUC.execute(id);\n }\n return mCurrentAccount;\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 }", "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 }", "public interface RecipeStore {\n //Returns a recipe list of all recipes\n List<Recipe> getAllRecipes();\n //Returns a string list of recipe titles found from ingredients query\n List<String> getRecipeByIngredients(CharSequence query);\n //Returns a single recipe found from query\n Recipe getRecipe(CharSequence query);\n //Returns a single recipe image from query\n byte[] getRecipeImage(CharSequence query);\n //Returns a bitmap list of all small images for all recipes\n List<Bitmap> getRecipeImgSmall();\n //Returns a string list of all recipe titles\n List<String> getRecipeTitles();\n //Takes a recipe id and adds it to the favorites table\n void addToFavorites(int recipeId);\n //Returns a bitmap list of all images for recipes in the favorites table\n List<Bitmap> getFavoriteRecipeImgs();\n //Returns a string list of all titles for recipes in the favorites table\n List<String> getFavoriteRecipeTitle();\n //Takes a recipe id and deletes it from the favorites table\n void deleteFavorite(int id);\n //Takes a recipe id and checks if it exists in the favorites table\n boolean isFavorite(int id);\n //Takes recipe parameters and inserts a new row in recipes table\n Recipe createRecipe(String title, String description, String ingredients, String instructions, byte[] photo, byte[] photoSmall);\n //Returns number of rows in recipes\n long getRecipesCount();\n //Opens the database\n SQLiteDatabase open() throws SQLException;\n //Closes the database\n void close();\n}" ]
[ "0.6163843", "0.5927853", "0.5801698", "0.5726887", "0.563628", "0.56225365", "0.5620925", "0.561441", "0.5599612", "0.5579809", "0.55701345", "0.5552106", "0.55396616", "0.5510327", "0.5494719", "0.5466773", "0.5440931", "0.5440193", "0.5439379", "0.5412184", "0.53959435", "0.53703326", "0.5321842", "0.5317554", "0.53090674", "0.5280352", "0.52544206", "0.52460706", "0.52420664", "0.5224115", "0.5224094", "0.5219919", "0.5204582", "0.5198551", "0.51920164", "0.5180406", "0.5174746", "0.5173718", "0.5163971", "0.51560104", "0.51303035", "0.51167953", "0.5111871", "0.51109314", "0.5097382", "0.50906134", "0.50846565", "0.5084526", "0.5075348", "0.5072579", "0.50658756", "0.5059996", "0.50597316", "0.50583166", "0.5054259", "0.5052604", "0.5050943", "0.5047678", "0.50476176", "0.50407493", "0.5035939", "0.50255305", "0.5010798", "0.5005888", "0.50033104", "0.49968016", "0.49913996", "0.49901268", "0.4985768", "0.49830544", "0.49822915", "0.49617743", "0.49555463", "0.49552837", "0.49551868", "0.49522153", "0.49447736", "0.49379292", "0.49303588", "0.49231362", "0.49222136", "0.49131113", "0.49103358", "0.49097466", "0.49096367", "0.4907015", "0.49018323", "0.4901577", "0.49002197", "0.4898881", "0.4895844", "0.48946115", "0.48935008", "0.48905373", "0.48903766", "0.48897403", "0.48842594", "0.48820826", "0.48761305", "0.48733371", "0.48670533" ]
0.0
-1
Retourne la distance euclidienne entre deux noeuds
public static double getDistance(Node a, Node b) { return Math.abs(a.getX() - b.getX()) + Math.abs(a.getY() - b.getY()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private double calculeDistanceLinaire(int[] tableauDeIntRandom) {\n double resultat = 0;\n for (int i = 0; i < tableauDeIntRandom.length; i++) {\n resultat += Math.abs(tableauDeIntRandom[i] - tableauDeIntRandom[(i + 1) % tableauDeIntRandom.length]);\n }\n return resultat;\n }", "double getSquareDistance();", "public double calcularCantidadGasolinaNecesaria()\n\t{\n\t\tif(alojamiento == null)\n\t\t\treturn 0;\n\t\t\n\t\telse \n\t\t\treturn alojamiento.darDistancia()/capacidadKilometrosPorGalon;\n\t}", "double getDistance();", "public double calculaDistancia(double latitude, double longitude)\n\t{\n\t\tdouble menorDistancia = Double.MAX_VALUE;\n\t\t\n\t\tif (posicoes.size() < 2)\n\t\t\treturn menorDistancia;\n\t\t\n\t\tPosicaoMapa posicaoAnterior = posicoes.get(0);\n\t\t\n\t\tfor (int i = 1; i < posicoes.size(); i++)\n\t\t{\n\t\t\tPosicaoMapa posicaoAtual = posicoes.get(i);\n\t\t\tdouble distancia = Geodesic.trackDistance(latitude, longitude, posicaoAnterior.getLatitude(), posicaoAnterior.getLongitude(), posicaoAtual.getLatitude(), posicaoAtual.getLongitude());\n\t\t\t\t\t\n\t\t\tif (distancia < menorDistancia)\n\t\t\t\tmenorDistancia = distancia;\n\t\t\t\n\t\t\tposicaoAnterior = posicaoAtual;\n\t\t}\n\t\t\n\t\treturn menorDistancia;\n\t}", "@Test\r\n\tpublic void testDistancia0() \r\n\t{\r\n\t\tAssert.assertEquals(1.41, new Ponto(3,3).dist(new Ponto(4,2)), EPSILON);\r\n\t\tAssert.assertEquals(26.20, new Ponto(-7,-4).dist(new Ponto(17,6.5)), EPSILON);\t\r\n\t\tAssert.assertEquals(0.00, new Ponto(0,0).dist(new Ponto(0,0)), EPSILON);\t\r\n\t}", "public static double distancia(Entidade e1,Entidade e2){\r\n\t\tdouble dx = e1.getPosicaoX() - e2.getPosicaoX();\r\n\t\tdouble dy = e1.getPosicaoY() - e2.getPosicaoY();\r\n\t\tdouble d = Math.sqrt(dx*dx + dy*dy);\r\n\t\treturn d;\r\n\t}", "public float getTheDistance(){\n\t\t\n\t\tdistance = sonic.getDistance();\n\t\tSystem.out.println(\"value:\"+ distance);\n\t\t//considering the test results we see after 23 cm we see the +1cm precision and below 23cm we see + 5cm range \n\t\tif (distance<=25){\n\t\treturn (distance-7);\n\t\t}\n\t\telse{return (distance-3);}\n\t}", "public double getDistance() {\n\n final int R = 6371; // Radius of the earth\n double lat1 = latitude;\n double lon1 = longitude;\n double lat2 = 41.917715; //lat2, lon2 is location of St.Charles, IL\n double lon2 = -88.266027;\n double el1=0,el2 = 0;\n double latDistance = Math.toRadians(lat2 - lat1);\n double lonDistance = Math.toRadians(lon2 - lon1);\n double a = Math.sin(latDistance / 2) * Math.sin(latDistance / 2)\n + Math.cos(Math.toRadians(lat1)) * Math.cos(Math.toRadians(lat2))\n * Math.sin(lonDistance / 2) * Math.sin(lonDistance / 2);\n double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n double distance = R * c * 1000; // convert to meters\n\n double height = el1 - el2;\n\n distance = Math.pow(distance, 2) + Math.pow(height, 2);\n\n return Math.sqrt(distance);\n }", "private double distantziaKalkulatu() {\r\n\t\tdouble lurrarenRadioa = 6371;// kilometrotan Lurraren radioa\r\n\t\tdouble dLat = Math.toRadians(terLat - latitudea); //\r\n\t\tdouble dLng = Math.toRadians(termLong - longitudea);\r\n\t\tdouble sindLat = Math.sin(dLat / 2);\r\n\t\tdouble sindLng = Math.sin(dLng / 2);\r\n\t\tdouble va1 = Math.pow(sindLat, 2)\r\n\t\t\t\t+ Math.pow(sindLng, 2) * Math.cos(Math.toRadians(terLat)) * Math.cos(Math.toRadians(latitudea));\r\n\t\tdouble va2 = 2 * Math.atan2(Math.sqrt(va1), Math.sqrt(1 - va1));\r\n\t\tdouble distancia = lurrarenRadioa * va2;\r\n\r\n\t\treturn distancia;\r\n\t}", "private double distanceResult(double preLng, double preLat, double nextLng, double nextLat) {\n\t\treturn Math.sqrt((preLng - nextLng) * (preLng - nextLng) + (preLat - nextLat) * (preLat - nextLat));\n\t}", "public static double eucleidian(InputSpacePoint a, InputSpacePoint b) {\n double sum =0.0;\n for(String s : a.getKeysAsCollection()) {\n sum += Math.pow(a.getValue(s)-b.getValue(s), 2);\n }\n return Math.sqrt(sum);\n }", "private static int calculateEuclidianDistance(Node actualNode, Node targetNode)\n\t{\n\t\t\n\t\treturn (int)Math.sqrt(Math.pow((actualNode.getRow() - targetNode.getRow()), 2) +\n\t\t\t\t\tMath.pow((actualNode.getColumn() - targetNode.getColumn()), 2));//distance*(int)Math.sqrt(dx+dy);\n\t}", "public int euclideanDistance(DataValue<T> value1, DataValue<T> value2)\r\n\t{\n\t\tint difference = value1.difference(value2);\r\n\t\tdifference = difference * difference;\t\r\n\t\treturn (int) Math.sqrt(difference);\r\n\t}", "public static double euclidDist(Point p1, Point p2) {\r\n\t\tvar p1Lat = p1.latitude();\r\n\t\tvar p1Lon = p1.longitude();\r\n\t\tvar p2Lat = p2.latitude();\r\n\t\tvar p2Lon = p2.longitude();\r\n\t\tvar dist = Math.sqrt( ((p1Lat-p2Lat)*(p1Lat-p2Lat)) + ((p1Lon-p2Lon)*(p1Lon-p2Lon)) );\r\n\t\treturn dist;\r\n\t}", "double getDistanceInMiles();", "public double getSquaredEuclidianDistanceTo(final Coordinate c2){\n return Math.pow(c2.latitude - this.latitude,2) + Math.pow(c2.longitude - this.longitude, 2);\n }", "private int obliczDowoz() {\n int x=this.klient.getX();\n int y=this.klient.getY();\n double odl=Math.sqrt((Math.pow((x-189),2))+(Math.pow((y-189),2)));\n int kilometry=(int)(odl*0.5); //50 gr za kilometr\n return kilometry;\n }", "double getDistance(int i, int j){\r\n\tdouble d = (coord[i][0]-coord[j][0])*(coord[i][0]-coord[j][0])+ (coord[i][1]-coord[j][1])*(coord[i][1]-coord[j][1]);\r\n\td = Math.sqrt(d);\r\n\treturn d;\r\n}", "double distance() {\r\n\t double dist_total = 0;\r\n\t for (int i = 0; i < index.length - 1; i++) {\r\n\t dist_total += city(i).distance(city(i + 1));\r\n\t }\r\n\t \r\n\t return dist_total;\r\n\t}", "@Test\n public void testMesurerDistanceCoordonnees() {\n System.out.println(\"MesurerDistanceCoordonnees\");\n double lat1 = 0.0;\n double lon1 = 0.0;\n double lat2 = 0.0;\n double lon2 = 0.0;\n double expResult = 0.0;\n double result = Utils.MesurerDistanceCoordonnees(lat1, lon1, lat2, lon2);\n assertEquals(expResult, result, 0.0);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "public double ComputeDistance(){ \n\t\tdouble lat1 = this.depAirportCity.getLatDegs() + (double)(this.depAirportCity.getLatMins())/60; \n\t\tdouble lon1 = this.depAirportCity.getLongDegs() + (double)(this.depAirportCity.getLongMins())/60;\n\t\tdouble lat2 = this.arrAirportCity.getLatDegs() + (double)(this.arrAirportCity.getLatMins())/60; \n\t\tdouble lon2 = this.arrAirportCity.getLongDegs() + (double)(this.arrAirportCity.getLongMins())/60;\n\t\t\n\t\tdouble distance = Haversine.getMiles(lat1, lon1, lat2, lon2);\n\t\treturn distance;\n\t}", "private Double euclidean(LatitudeLongitude point1, LatitudeLongitude point2) {\n return Double.valueOf(Math.sqrt(Math.pow(point1.getLatitude() - point2.getLatitude(), 2)\n + Math.pow(point1.getLongitude() - point2.getLongitude(), 2)));\n }", "public double getDistance()\n {\n return Math.abs(getDifference());\n }", "public int distance(Coord coord1, Coord coord2);", "private static double distance(double lat1, double lon1, double lat2, double lon2, String unit) {\n double theta = lon1 - lon2;\n double dist = Math.sin(deg2rad(lat1)) * Math.sin(deg2rad(lat2)) + Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) * Math.cos(deg2rad(theta));\n dist = Math.acos(dist);\n dist = rad2deg(dist);\n dist = dist * 60 * 1.1515;\n if (unit.equals(\"K\")) {\n dist = dist * 1.609344;\n } else if (unit.equals(\"N\")) {\n dist = dist * 0.8684;\n }\n //default miles\n return (dist);\n }", "public double getDistanceMoyenne() {\n\t\treturn getDistanceTotale () / 12;\n\t}", "private static double calculaDistancia(double[] param1, double[] param2){\n\t\tdouble res1= Math.pow((param1[0]-param2[0]), 2);\n\t\tdouble res2= Math.pow((param1[1]-param2[1]), 2);\n\t\tdouble res3= Math.pow((param1[2]-param2[2]), 2);\n\t\tdouble res4= res1 + res2 + res3;\n\t\tdouble res5= res4/3;\n\t\tdouble res6= Math.sqrt(res5);\n\t\treturn res6;\n\t}", "@Override\n public double distance(NumberVector o1, NumberVector o2) {\n double dt = Math.abs(o1.doubleValue(0) - o2.doubleValue(0));\n // distance value of earth coordinates in meter\n double dc = getDistance(o1.doubleValue(1), o1.doubleValue(2), o2.doubleValue(1), o2.doubleValue(2));\n return dt + dc;\n }", "int calDeg(int u){\n int ans=0;\n for (int i=0;i<n;i++){\n ans+=a[u][i];\n }\n return ans;\n }", "public static double euclideanDistance(Prototype one, Prototype two)\r\n {\r\n return d(one, two);\r\n }", "public static double distance(LatLng one, LatLng two, char unit) {\n double theta = one.longitude - two.longitude;\n double dist = Math.sin(deg2rad(one.latitude)) * Math.sin(deg2rad(two.latitude)) + Math.cos(deg2rad(one.latitude)) * Math.cos(deg2rad(two.latitude)) * Math.cos(deg2rad(theta));\n dist = Math.acos(dist);\n dist = rad2deg(dist);\n dist = dist * 60 * 1.1515;\n if (unit == 'K') {\n dist = dist * 1.609344;\n } else if (unit == 'N') {\n dist = dist * 0.8684;\n }\n return (dist);\n }", "public static double GetDistance(double lat1, double lon1, double lat2, double lon2) {\n double radLat1 = rad(lat1);\n double radLat2 = rad(lat2);\n double a = radLat1 - radLat2;\n double b = rad(lon1) - rad(lon2);\n double s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) +\n Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2)));\n s = s * EARTH_RADIUS;//km\n// Log.e(\"s\", \"s=\" + s);\n return s;\n }", "public static double getDistance( GameObject one, GameObject two )\n {\n double deltaX = getDeltaX( one, two );\n double deltaY = getDeltaY( one, two );\n return Math.sqrt( deltaX * deltaX + deltaY * deltaY );\n }", "public double distance() {\n \tif (dist == -1) {\n \t\tdist = distance(vertex1, vertex2);\n \t}\n \n \treturn dist;\n }", "private double distance(double lat1, double lon1, double lat2, double lon2) {\n double theta = lon1 - lon2;\r\n double dist = Math.sin(deg2rad(lat1)) * Math.sin(deg2rad(lat2)) + Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) * Math.cos(deg2rad(theta));\r\n dist = Math.acos(dist);\r\n dist = rad2deg(dist);\r\n dist = dist * 60 * 1.1515;\r\n dist = dist * 1.609344;\r\n return (dist); // return distance in kilometers\r\n }", "private static Double getDistance(Double lng1, Double lat1, Double lng2, Double lat2) {\n double radLat1 = lat1 * RAD;\n double radLat2 = lat2 * RAD;\n double a = radLat1 - radLat2;\n double b = (lng1 - lng2) * RAD;\n double s = 2 * Math.asin(Math.sqrt(\n Math.pow(Math.sin(a / 2), 2) + Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2)));\n s = s * EARTH_RADIUS;\n s = Math.round(s * 10000) / 10000000.0;\n return s;\n }", "public double distance(double x, double y);", "private static double distance(double lat1, double lat2, double lon1, double lon2,\n\t double el1, double el2) {\n\n\t final int R = 6371; // Radius of the earth\n\n\t Double latDistance = deg2rad(lat2 - lat1);\n\t Double lonDistance = deg2rad(lon2 - lon1);\n\t Double a = Math.sin(latDistance / 2) * Math.sin(latDistance / 2)\n\t + Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2))\n\t * Math.sin(lonDistance / 2) * Math.sin(lonDistance / 2);\n\t Double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n\t double distance = R * c * 1000; // convert to meters\n\n\t double height = el1 - el2;\n\t distance = Math.pow(distance, 2) + Math.pow(height, 2);\n\t return Math.sqrt(distance);\n\t}", "public double calcDistance(GpsCoordinate other)\n\t{\n\t\tdouble lat1 = degToRadian(this.latitude);\n\t\tdouble lng1 = degToRadian(this.longitude);\n\t\tdouble lat2 = degToRadian(other.latitude);\n\t\tdouble lng2 = degToRadian(other.longitude);\n\t\t\n\t\t/*\n\t\t * use haversine Formula to calc the distance\n\t\t * @see: http://en.wikipedia.org/wiki/Haversine_formula\n\t\t */\n\t\tdouble inRootFormula = Math.sqrt(\n\t\t\t\tMath.sin((lat1 - lat2)/2)*Math.sin((lat1 - lat2)/2)+\n\t\t\t\tMath.cos(lat1)*Math.cos(lat2)*Math.sin((lng1-lng2)/2)*Math.sin((lng1-lng2)/2));\n\t\t\n\t\treturn 2* EARTH_RADIUS * Math.asin(inRootFormula);\n\n\t\n\t}", "public float getDistance();", "default double euclideanDistance(double[] a, double[] b) {\n checkLengthOfArrays(a, b);\n double sum = 0.0;\n for (int i = 0; i < a.length; i++) {\n final double d = a[i] - b[i];\n sum += d * d;\n }\n return Math.sqrt(sum);\n }", "public double getFinalDistance(){\n return valori.get(end_node);\n }", "private double moyenne(Hashtable<Integer, Double> h){\n\t\tEnumeration<Integer> e = h.keys();\n\t\tdouble res = 0 ;\n\t\t// On somme l'ensemble des distances entre cette tables et les tables occuppées, on divise ensuite.\n\t\twhile(e.hasMoreElements()){ res += h.get(e.nextElement()) ; }\n\t\tres /= h.size() ;\n\t\treturn res ;\n\t}", "public double getEuclideanDistanceTo(Position other) {\n\n double sum = 0;\n //POEY comment: values.length = the number of extraction functions\n //find different values of every object's values in each function (round-robin tournament event itself)\n for (int i = 0; i < values.length; i++) {\n double value = values[i];\n double otherValue = other.values[i];\n double diff = value - otherValue;\n sum += (diff * diff);\n }\n\n return Math.sqrt(sum);\n \n }", "public void calcDistance() {\n if (DataManager.INSTANCE.getLocation() != null && location.getLength() == 2) {\n Log.e(\"asdf\", DataManager.INSTANCE.getLocation().getLength() + \"\");\n Log.e(\"asdf\", DataManager.INSTANCE.getLocation().getLength() + \"\");\n double dLat = Math.toRadians(location.getLatitude() - DataManager.INSTANCE.getLocation().getLatitude()); // deg2rad below\n double dLon = Math.toRadians(location.getLongitude() - DataManager.INSTANCE.getLocation().getLongitude());\n double a =\n Math.sin(dLat / 2) * Math.sin(dLat / 2) +\n Math.cos(Math.toRadians(location.getLatitude()))\n * Math.cos(Math.toRadians(location.getLatitude()))\n * Math.sin(dLon / 2)\n * Math.sin(dLon / 2);\n double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n double d = KM_IN_RADIUS * c; // Distance in km\n distance = (float) d;\n } else distance = null;\n }", "public static double distance(double latitude,double longitude,double latitude2,double longitude2){\n\n \t double deltalat = Math.toRadians(latitude2 - latitude);\n \t double deltalog = Math.toRadians(longitude2 - longitude);\n\n \t double a = Math.pow(Math.sin(deltalat/2),2) +\n \t\t\t\t Math.pow(Math.sin(deltalog/2),2) *\n \t\t\t\t Math.cos(latitude) *\n \t\t\t\t Math.cos(latitude2);\n \t double c = 2 * Math.asin(Math.sqrt(a));\n\n \t return EARTH_RADIUS * c;\n\n }", "public double getDistance() { \n\t\treturn Math.pow(input.getAverageVoltage(), exp) * mul; \n\t}", "public double euclideDistance(ArrayList<Double> vectorA, ArrayList<Double> vectorB) {\n double distance = 0.0;\n for (int i = 0; i < vectorA.size(); i++) {\n distance += Math.pow(vectorA.get(i) - vectorB.get(i), 2);\n }\n return Math.sqrt(distance);\n }", "public int getDistance(User u) {\n\t\tPosition mine = getPosition();\n\t\tPosition hers = u.getPosition();\n\t\t\n\t\treturn (mine == null || hers == null) ? -1 : mine.getDistance(hers);\n\t}", "private int calcDistance()\n\t{\n\t\tint distance = 0;\n\n\t\t// Generate a sum of all of the difference in locations of each list element\n\t\tfor(int i = 0; i < listSize; i++) \n\t\t{\n\t\t\tdistance += Math.abs(indexOf(unsortedList, sortedList[i]) - i);\n\t\t}\n\n\t\treturn distance;\n\t}", "private double distance(double lat1, double lat2, double lon1, double lon2)\n {\n lon1 = Math.toRadians(lon1);\n lon2 = Math.toRadians(lon2);\n lat1 = Math.toRadians(lat1);\n lat2 = Math.toRadians(lat2);\n\n // Haversine formula\n double dlon = lon2 - lon1;\n double dlat = lat2 - lat1;\n double a = Math.pow(Math.sin(dlat / 2), 2)\n + Math.cos(lat1) * Math.cos(lat2)\n * Math.pow(Math.sin(dlon / 2),2);\n\n double c = 2 * Math.asin(Math.sqrt(a));\n\n // Radius of earth in kilometers. Use 3956\n // for miles\n double r = 6371;\n\n // calculate the result\n return(c * r);\n }", "public static double d(Prototype one, Prototype two)\r\n {\r\n return Math.sqrt(squaredEuclideanDistance(one, two));\r\n }", "private double getDistance() {\n\t\tfinal double h2 = 86.7;\n\t\t// h1: height of top of camera\n\t\tfinal double h1 = 17.6;\n\n\t\t// a1: angle of camera (relative to chasis)\n\t\tfinal double a1 = 36.175;\n\t\t// a2: angle of target relative to a1\n\t\tfinal double a2 = ty.getDouble(0.0);\n\n\t\t// distance: distance from camera to base of target\n\t\tfinal double distance = ((h2 - h1) / Math.tan(Math.toRadians(a1 + a2)));\n\n\t\tfinal double d = Math.sqrt(Math.pow(h2 - h1, 2) + Math.pow(distance, 2));\n\t\tSmartDashboard.putNumber(\"Py Distance\", d);\n\n\t\treturn (distance);\n\n\t}", "public int getDistance(){\n if (distance == 0) {\n int tourDistance = 0;\n // Loop through our tour's cities\n for (int cityIndex=0; cityIndex < tourSize(); cityIndex++) {\n // Get city we're travelling from\n City fromCity = getCity(cityIndex);\n // City we're travelling to\n City destinationCity;\n // Check we're not on our tour's last city, if we are set our \n // tour's final destination city to our starting city\n if(cityIndex+1 < tourSize()){\n destinationCity = getCity(cityIndex+1);\n }\n else{\n destinationCity = getCity(0);\n }\n // Get the distance between the two cities\n tourDistance += fromCity.distanceTo(destinationCity);\n }\n distance = tourDistance;\n }\n return distance;\n }", "private int getDistance(double lat1, double lng1, double lat2, double lng2) {\n\n double earthRadius = 6371; // kilometer output\n double dLat = Math.toRadians(lat2-lat1);\n double dLng = Math.toRadians(lng2-lng1);\n double sindLat = Math.sin(dLat / 2);\n double sindLng = Math.sin(dLng / 2);\n\n double a = Math.pow(sindLat, 2) + Math.pow(sindLng, 2)\n * Math.cos(Math.toRadians(lat1)) * Math.cos(Math.toRadians(lat2));\n double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));\n double dist = earthRadius * c;\n\n int distance = (int)dist / 20; // output distance\n return distance;\n }", "public double getDistance(Node start, Node end) {\n\tstartX = start.getX();\n\tstartY = start.getY();\n\tendX = end.getX();\n\tendY = end.getY();\n\n int Xsquared = (startX - endX) * (startX - endX);\n\tint Ysquared = (startY - endY) * (startY - endY);\n\n\treturn Math.sqrt(Xsquared + Ysquared);\n\t\n }", "public double getNajmensie() {\n\t\tif ((cislo1 <= cislo2) && (cislo1 <= cislo3)) {\n\t\t\ttretie = cislo1;\n\t\t} else if ((cislo2 <= cislo1) && (cislo2 <= cislo3)) {\n\t\t\ttretie = cislo2;\n\t\t} else if ((cislo3 <= cislo1) && (cislo3 <= cislo2)) {\n\t\t\ttretie = cislo3;\n\t\t}\n\t\treturn tretie;\n\t}", "private long calculateDistance(GeoPoint prv , GeoPoint nxt) {\n double lat1 = prv.getLatitude();\n double lng1 = prv.getLatitude();\n double lat2 = nxt.getLatitude();\n double lng2 = nxt.getLatitude();\n\n double dLat = Math.toRadians(lat2 - lat1);\n double dLon = Math.toRadians(lng2 - lng1);\n double a = Math.sin(dLat / 2) * Math.sin(dLat / 2)\n + Math.cos(Math.toRadians(lat1))\n * Math.cos(Math.toRadians(lat2)) * Math.sin(dLon / 2)\n * Math.sin(dLon / 2);\n double c = 2 * Math.asin(Math.sqrt(a));\n return Math.round(6371000 * c);\n }", "public double getDistance() {\n\t\tdouble sum = 0;\n\t\tfor(int i = 0; i < ordering.size() - 1; i++) {\n\t\t\tsum += cost[ordering.get(i) - 1][ordering.get(i+1) - 1];\n\t\t}\n\t\treturn sum;\n\t}", "public double distancia2(GPS a2,GPS a3){\n return this.distancia(a2)+a2.distancia(a3);\n }", "public double calcDistBetweenStops(){\n List<Location> locs = destinations.getLocationList();\r\n double totalDist = 0;\r\n for (int i = 0; i < (locs.size() - 1); i++){\r\n double distance = locs.get(i).DistanceTo(locs.get(i+1));\r\n totalDist += distance;\r\n }\r\n return totalDist;\r\n }", "public double calcDist(double lat2, double lon2, ArrayList<Record> cCentres)\n {\n double dist = 0;\n if (lat1==lat2 && lon1==lon2)\n dist = 0;\n else {\n double theta = lon1 - lon2;\n dist = Math.sin(Math.toRadians(lat1)) * Math.sin(Math.toRadians(lat2)) + Math.cos(Math.toRadians(lat1)) * Math.cos(Math.toRadians(lat2)) * Math.cos(Math.toRadians(theta));\n dist = Math.acos(dist);\n dist = Math.toDegrees(dist);\n dist = dist * 60 * 1.1515;\n dist = dist * 1.609344; //km\n }\n return (dist);\n }", "public double computeDistance(Object o){\n \n if (o!=null && o.getClass()==this.getClass()){\n NDimensionalPoint newPoint = (NDimensionalPoint) o;\n if (newPoint.values.size()==values.size()){\n double dist = 0.0;\n for (int i=0;i<values.size();i++){\n dist+=Math.pow(newPoint.getValues().get(i) -values.get(i),2);\n }\n return Math.sqrt(dist);\n }else\n {\n return MAX_DIST;\n }\n }else{\n return MAX_DIST;\n }\n }", "public double getDistance(ArrayList<Integer> e, ArrayList<Integer> f) {\n double distance =0;\n if(e.size()>2 || f.size()>2){\n \n ArrayList<Double> aux = new ArrayList<>();\n aux.add (Math.sqrt(Math.pow(e.get(0) - f.get(0), 2) + Math.pow(e.get(1) - f.get(1), 2)));\n aux.add(Math.sqrt(Math.pow(e.get(0) - f.get(2), 2) + Math.pow(e.get(1) - f.get(3), 2)));\n aux.add(Math.sqrt(Math.pow(e.get(0) - f.get(4), 2) + Math.pow(e.get(1) - f.get(5), 2)));\n aux.add(Math.sqrt(Math.pow(e.get(0) - f.get(6), 2) + Math.pow(e.get(1) - f.get(7), 2)));\n Collections.sort(aux);\n distance = aux.get(0);\n \n }\n else{\n\n distance = Math.sqrt(Math.pow(e.get(0) - f.get(0), 2) + Math.pow(e.get(1) - f.get(1), 2));\n //distancia entre dois pontos\n }\n return distance;\n\n }", "private void calcularDistanciaRecorrer(){\r\n\t\tfloat diferenciax = siguientePunto.x - posicion.x;\r\n\t\tfloat diferenciay = siguientePunto.y - posicion.y;\r\n\t\tdistanciaRecorrer = (float) Math.sqrt(diferenciax*diferenciax+diferenciay*diferenciay);\r\n\t}", "private double distance() {\n\t\tdouble dist = 0;\n\t\tdist = Math.sqrt(Math.abs((xOrigin - x) * (xOrigin - x) + (yOrigin - y) * (yOrigin - y)));\n\t\treturn dist;\n\t}", "public float getDistance(){\n\t\t\treturn s1.start.supportFinal.dot(normal);\n\t\t}", "public double distancia(Pixel pixel) {\r\n\t\tdouble distX = this.xDouble - pixel.xDouble;\r\n\t\tdouble distY = this.yDouble - pixel.yDouble;\r\n\t\tdouble val = distX * distX + distY * distY;\r\n\t\tif (val != 0)\r\n\t\t\treturn Math.sqrt(val);\r\n\t\treturn 0;\r\n\t}", "private static double get_distance ( String one, String two){\n String temp[] = one.split(\" \");\n double lat1 = Double.parseDouble(temp[0]);\n double long1 = Double.parseDouble(temp[1]);\n\n String temp2[] = two.split(\" \");\n double lat2 = Double.parseDouble(temp2[0]);\n double long2 = Double.parseDouble(temp2[1]);\n\n// Get distance between two lats and two lans\n double latDistance = Math.toRadians(lat1 - lat2);\n double lngDistance = Math.toRadians(long1 - long2);\n\n// Step 1\n double a = (Math.sin ( latDistance / 2 ) * Math.sin (latDistance / 2)) +\n (Math.cos ( Math.toRadians(lat1)) * Math.cos(Math.toRadians(lat2)) )\n * ( Math.sin (lngDistance /2 ) * Math.sin(lngDistance / 2) );\n// Step 2\n double c = ( 2 * (Math.atan2( Math.sqrt(a), Math.sqrt(1-a))));\n// Step 3\n double d = ( EARTH_RADIUS * c );\n return d;\n }", "public double getDistance(College c) {\n double salary_diff = Math.pow(this.medianSalary - c.getMedianSalary(), 2.0);\n double sat_diff = Math.pow(this.avgSAT - c.getAvgSAT(), 2.0);\n double gpa_diff = Math.pow(this.avgGPA - c.getAvgGPA(), 2.0);\n double accRate_diff = Math.pow(this.accRate - c.getAccRate(), 2.0);\n\n return Math.sqrt(salary_diff + sat_diff + gpa_diff + accRate_diff);\n }", "public abstract double distanceFrom(double x, double y);", "public int distance() {\n return distance;\n }", "public static double distance(City start, City end) {\n \tdouble result = Math.sqrt(Math.pow((end.x() - start.x()), 2) +\n \t\t\t(Math.pow((end.y() - start.y()), 2)));\n \n \treturn result;\n }", "private float distance(double startLat, double startLon,\n double endLat, double endLon) {\n // Based on http://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf\n // using the \"Inverse Formula\" (section 4)\n int MAXITERS = 20;\n // Convert lat/long to radians\n startLat *= Math.PI / 180.0;\n endLat *= Math.PI / 180.0;\n startLon *= Math.PI / 180.0;\n endLon *= Math.PI / 180.0;\n double a = 6378137.0; // WGS84 major axis\n double b = 6356752.3142; // WGS84 semi-major axis\n double f = (a - b) / a;\n double aSqMinusBSqOverBSq = (a * a - b * b) / (b * b);\n double L = endLon - startLon;\n double A = 0.0;\n double U1 = Math.atan((1.0 - f) * Math.tan(startLat));\n double U2 = Math.atan((1.0 - f) * Math.tan(endLat));\n double cosU1 = Math.cos(U1);\n double cosU2 = Math.cos(U2);\n double sinU1 = Math.sin(U1);\n double sinU2 = Math.sin(U2);\n double cosU1cosU2 = cosU1 * cosU2;\n double sinU1sinU2 = sinU1 * sinU2;\n double sigma = 0.0;\n double deltaSigma = 0.0;\n double cosSqAlpha = 0.0;\n double cos2SM = 0.0;\n double cosSigma = 0.0;\n double sinSigma = 0.0;\n double cosLambda = 0.0;\n double sinLambda = 0.0;\n double lambda = L; // initial guess\n for (int iter = 0; iter < MAXITERS; iter++) {\n double lambdaOrig = lambda;\n cosLambda = Math.cos(lambda);\n sinLambda = Math.sin(lambda);\n double t1 = cosU2 * sinLambda;\n double t2 = cosU1 * sinU2 - sinU1 * cosU2 * cosLambda;\n double sinSqSigma = t1 * t1 + t2 * t2; // (14)\n sinSigma = Math.sqrt(sinSqSigma);\n cosSigma = sinU1sinU2 + cosU1cosU2 * cosLambda; // (15)\n sigma = Math.atan2(sinSigma, cosSigma); // (16)\n double sinAlpha = (sinSigma == 0) ? 0.0 :\n cosU1cosU2 * sinLambda / sinSigma; // (17)\n cosSqAlpha = 1.0 - sinAlpha * sinAlpha;\n cos2SM = (cosSqAlpha == 0) ? 0.0 :\n cosSigma - 2.0 * sinU1sinU2 / cosSqAlpha; // (18)\n double uSquared = cosSqAlpha * aSqMinusBSqOverBSq; // defn\n A = 1 + (uSquared / 16384.0) * // (3)\n (4096.0 + uSquared *\n (-768 + uSquared * (320.0 - 175.0 * uSquared)));\n double B = (uSquared / 1024.0) * // (4)\n (256.0 + uSquared *\n (-128.0 + uSquared * (74.0 - 47.0 * uSquared)));\n double C = (f / 16.0) *\n cosSqAlpha *\n (4.0 + f * (4.0 - 3.0 * cosSqAlpha)); // (10)\n double cos2SMSq = cos2SM * cos2SM;\n deltaSigma = B * sinSigma * // (6)\n (cos2SM + (B / 4.0) *\n (cosSigma * (-1.0 + 2.0 * cos2SMSq) -\n (B / 6.0) * cos2SM *\n (-3.0 + 4.0 * sinSigma * sinSigma) *\n (-3.0 + 4.0 * cos2SMSq)));\n lambda = L +\n (1.0 - C) * f * sinAlpha *\n (sigma + C * sinSigma *\n (cos2SM + C * cosSigma *\n (-1.0 + 2.0 * cos2SM * cos2SM))); // (11)\n double delta = (lambda - lambdaOrig) / lambda;\n if (Math.abs(delta) < 1.0e-12) {\n break;\n }\n }\n float distance = (float) (b * A * (sigma - deltaSigma));\n return distance;\n }", "public static double dist (ECEF a, ECEF b)\r\n\t{\r\n\t\tdouble distsquared = square (a.x-b.x) + square (a.y-b.y) + square (a.z-b.z);\r\n\t\treturn Math.sqrt(distsquared);\r\n\t}", "public double getDistanceTotale() {\n\t\treturn distanceTotale;\n\t}", "public double calDistance()\n {\n double closest = poly[0].getD();\n\n for(int i = 1; i < sides; i++)\n {\n if(closest > poly[i].getD())\n {\n closest = poly[i].getD();\n }\n }\n this.distance = closest;\n\n return closest;\n }", "double distanceSq (double px, double py);", "public static double distance(double lat1, double lon1, double lat2, double lon2) {\n\n\n float[] dist = new float[1];\n Location.distanceBetween(lat1, lon1, lat2, lon2, dist);\n //Log.d(\"*******dist\", \":\" + dist[0]);\n return (dist[0]);\n //\n // double theta = lon1 - lon2;\n // double dist = Math.sin(deg2rad(lat1)) * Math.sin(deg2rad(lat2))\n // + Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2))\n // * Math.cos(deg2rad(theta));\n // dist = Math.acos(dist);\n // dist = rad2deg(dist);\n // dist = dist * 60; // 60 nautical miles per degree of seperation\n // dist = dist * 1852; // 1852 meters per nautical mile\n // return (dist);\n //\n }", "private static double dist(Data d, Centroid c)\r\n \t{\r\n \t\treturn Math.sqrt(Math.pow((c.Y() - d.Y()), 2) + Math.pow((c.X() - d.X()), 2));\r\n \t}", "public double getDistance(){\n return sensor.getVoltage()*100/2.54 - 12;\n }", "private double distance (double lata, double lona, double latb, double lonb) { \r\n return Math.acos(Math.sin(lata)*Math.sin(latb)+Math.cos(lata)*Math.cos(latb)*Math.cos(lonb-lona))*6371;\r\n }", "double getDistance(Point p);", "public double distanceTo(GeoPoint gp) {\n checkRep();\n double distance_longitude = Math.abs(gp.longitude - this.longitude) * KM_PER_DEGREE_LONGITUDE;\n double distance_latitude = Math.abs(gp.latitude - this.latitude) * KM_PER_DEGREE_LATITUDE;\n return Math.sqrt(Math.pow(distance_longitude, 2) + Math.pow(distance_latitude, 2)) / 1000000;\n }", "private static double getDistance(final WayNodeOSM a, final WayNodeOSM b) {\n \t\tdouble latA = a.getLatitude()/180*Math.PI;\n \t\tdouble latB = b.getLatitude()/180*Math.PI;\n \t\tdouble lonDif = (b.getLongitude() - a.getLongitude())/180*Math.PI;\n \t\treturn (Math.acos((Math.sin(latA) * Math.sin(latB)) + (Math.cos(latA) * Math.cos(latB) * Math.cos(lonDif))) * 6367500);\n \t}", "private static double calculDistanceTourneeAlea(List<Point> points, Random rand) {\n double distance = 0;\n Collections.shuffle(points, rand);\n Point courant = points.get(0);\n Point suivant;\n for(int i=1; i<points.size(); i++) {\n suivant = points.get(i);\n distance += courant.getDistance(suivant);\n courant = suivant;\n }\n suivant = points.get(0);\n distance += courant.getDistance(suivant);\n return distance;\n }", "public static double calcularDistancia(Coordenada origen, Coordenada destino) {\n\n\t\t\tdouble r = 6371; // Radio de la tierra, en kilometros\n\n\t\t\tdouble lat1 = Math.toRadians(origen.getLatitud());\t\t// La formula del\n\t\t\tdouble lon1 = Math.toRadians(origen.getLongitud());\t\t// semiverseno\n\t\t\tdouble lat2 = Math.toRadians(destino.getLatitud());\t\t// recibe radianes,\n\t\t\tdouble lon2 = Math.toRadians(destino.getLongitud());\t// no grados\n\n\t\t\tdouble dLon = (lon2 - lon1); // Delta longitud\n\t\t\tdouble dLat = (lat2 - lat1); // y delta latitud\n\n\t\t\tdouble sinLat = Math.sin(dLat / 2);\t// Seno de la latitud\n\t\t\tdouble sinLon = Math.sin(dLon / 2);\t// y de la longitud\n\n\t\t\tdouble a = (sinLat * sinLat) + Math.cos(lat1)*Math.cos(lat2)*(sinLon*sinLon);\n\t\t\tdouble c = 2 * Math.asin (Math.min(1.0, Math.sqrt(a)));\n\n\t\t\treturn r * c;\n\t}", "public double findDensity() {\n\t\tdouble temp = 0.0;\n\t\tfor (int i = 0; i < neighbors.size(); i++) { //calculate desnity using point and k nearest neighbors\n\t\t\tPoint t = neighbors.get(i);\n\t\t\tArrayList<Double> pa = t.getList();\n\t\t\tArrayList<Double> pb = p.getList();\n\t\t\tdouble sum = 0.0;\n\t\t\tfor (int j = 0; j < pa.size(); j++) {\n\t\t\t\tsum += Math.pow(pa.get(j)- pb.get(j), 2); //use euclidian distance\n\t\t\t}\n\t\t\ttemp += Math.sqrt(sum);\n\t\t}\n\t\treturn ((neighbors.size())/temp);\n\t}", "public double distance() {\n return distance;\n }", "public double distance() {\n return distance;\n }", "private float distanceMoyenne(DMatchVector bestMatches){\n\n float DM=0.0f;\n for(int i=0;i<bestMatches.size();i++){\n\n DM+=bestMatches.get(i).distance();\n }\n\n DM=DM/bestMatches.size();\n return DM;\n\n }", "public double distance(){\n return DistanceTraveled;\n }", "private static void calculDistanceTournees(List<Point> points, int nbTournees) {\n long time = System.currentTimeMillis();\n double distance = 0;\n Random rand = new Random(0);\n for(int i=0; i<nbTournees; i++) {\n distance += calculDistanceTourneeAlea(points, rand);\n }\n long deltaTime = System.currentTimeMillis() - time;\n System.out.println(\"Calcul de la moyenne des distances pour \"+nbTournees+ \" tournees\");\n System.out.println(\"La moyenne vaut : \"+distance/nbTournees);\n System.out.println(\"La moyenne est calculee en \"+deltaTime+\" ms\");\n }", "private void euclidean(Node node, int d){\n int row1 = this.row;\n int col1 = this.col;\n int row2 = node.getRow();\n int col2 = node.getCol();\n\n double aSquared = Math.pow((row1-row2), 2);\n double bSquared = Math.pow((col1-col2), 2);\n\n if(d == 0) //Euclidean normal\n this.hVal = (float)Math.sqrt(aSquared+bSquared);\n else //Euclidean squared\n this.hVal = (float)(aSquared+bSquared);\n\n }", "public static double getDistance(GPSPosition first, GPSPosition second) {\n\t\tdouble distance = 0;\n\t\t\n\t\tdouble latitude_distance_in_radians = \n\t\t\t\tMath.toRadians(second.getLatitude() - first.getLatitude());\n\t\tdouble longitude_distance_in_radians = \n\t\t\t\tMath.toRadians(second.getLongitude() - first.getLongitude());\n\t\t// harvesin(d / R) = harvesin(lat1 - lat2) + cos(lat1) * cos(lat2) * harvesin(lng1 - lng2);\n\t\t// harvesin(angle) = sin(angle / 2) ^ 2;\n\t\t// d = 2 * R * arcsin(sqrt(harvesin));\n\t\tdouble harvesin_diff_lat = Math.pow(Math.sin(latitude_distance_in_radians / 2), 2);\n\t\tdouble harvesin_diff_lng = Math.pow(Math.sin(longitude_distance_in_radians / 2), 2);\n\t\tdouble cos_lat1 = Math.cos(Math.toRadians(first.getLatitude()));\n\t\tdouble cos_lat2 = Math.cos(Math.toRadians(second.getLatitude()));\n\t\tdouble harvesin = harvesin_diff_lat + cos_lat1 * cos_lat2 * harvesin_diff_lng;\n\n\t\tdistance = 2 * kEarthRadius * Math.atan2(Math.sqrt(harvesin), Math.sqrt(1 - harvesin));\n\t\treturn distance;\n\t}", "private double distance(double lat1, double lon1, double lat2, double lon2) {\r\n double theta = lon1 - lon2;\r\n double dist = Math.sin(deg2rad(lat1))\r\n * Math.sin(deg2rad(lat2))\r\n + Math.cos(deg2rad(lat1))\r\n * Math.cos(deg2rad(lat2))\r\n * Math.cos(deg2rad(theta));\r\n dist = Math.acos(dist);\r\n dist = rad2deg(dist);\r\n dist = dist * 60 * 1.1515;\r\n return (dist);\r\n }", "protected double minimumCostPerUnitDistance( ) {\n\t\treturn 0.0;\n\t}", "private double getDistFromNadir(double lat, double lng) {\r\n GeoPoint satNadir = new GeoPoint(Math.toRadians(satLat), Math.toRadians(thetaP));\r\n GeoPoint thePoint = new GeoPoint(Math.toRadians(lat), Math.toRadians(lng));\r\n if (gc == null)\r\n gc = new GreatCircle();\r\n gc.setStart(satNadir);\r\n gc.setArrival(thePoint);\r\n gc.calculateGreatCircle(1);\r\n double dist = Math.toDegrees(gc.getDistance()) * 60.0;\r\n\r\n return dist;\r\n }", "public double getDistance(){\r\n\t\treturn Math.sqrt(\r\n\t\t\t\t(\r\n\t\t\t\t\tMath.pow(\r\n\t\t\t\t\t\tthis.getFirstObject().getCenterX()\r\n\t\t\t\t\t\t- this.getSecondObject().getCenterX()\r\n\t\t\t\t\t, 2 )\r\n\t )\r\n\t\t\t\t+ (\r\n\t\t\t\t\tMath.pow(\r\n\t\t\t\t\t\tthis.getFirstObject().getCenterY()\r\n\t\t\t\t\t\t- this.getSecondObject().getCenterY()\r\n\t\t\t\t\t, 2 )\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t}", "private double calculateDis(double lata, double lona, double latb, double lonb){\n\t\tdouble lon2latRatio = Math.cos(lata * 3.14159 / 180.0);\n\t\tdouble milesperDegreeLat = 69.0;\n\t\tdouble milesperDegreeLon = milesperDegreeLat * lon2latRatio;\n\t\tdouble distance = 0.0;\n\t\tdistance = Math.sqrt((milesperDegreeLat * (latb - lata))\n\t\t\t\t* (milesperDegreeLat * (latb - lata))\n\t\t\t\t+ (milesperDegreeLon * (lonb - lona))\n\t\t\t\t* (milesperDegreeLon * (lonb - lona)));\n\t\treturn distance;\n\t}" ]
[ "0.6705288", "0.65619457", "0.65435994", "0.6443384", "0.64287657", "0.63994974", "0.6370745", "0.6344169", "0.6336382", "0.6335547", "0.6326058", "0.6308336", "0.6294328", "0.62919813", "0.62898195", "0.62819904", "0.6273587", "0.6254345", "0.62510544", "0.6240372", "0.62227154", "0.6204123", "0.62004155", "0.6196252", "0.6188333", "0.61543345", "0.61516637", "0.6150985", "0.61492145", "0.613667", "0.6131431", "0.6124357", "0.6121966", "0.61050427", "0.6097785", "0.60821855", "0.60568786", "0.6032469", "0.6020526", "0.60158485", "0.6000072", "0.59854424", "0.5978523", "0.5977839", "0.59695643", "0.5965954", "0.595956", "0.5955568", "0.5954258", "0.5953008", "0.5949552", "0.59425926", "0.5937134", "0.5933765", "0.5933442", "0.5898543", "0.589526", "0.5893398", "0.5890153", "0.5890044", "0.5886864", "0.5874335", "0.5872971", "0.5866967", "0.5865505", "0.5862607", "0.5859622", "0.5859428", "0.5854224", "0.58446145", "0.58422554", "0.5842163", "0.58406", "0.5830874", "0.5815057", "0.58142453", "0.5812067", "0.58115846", "0.5809128", "0.5808721", "0.5802568", "0.5801209", "0.5796456", "0.5795742", "0.5794941", "0.57942826", "0.57921827", "0.579012", "0.5788303", "0.5788178", "0.5788178", "0.578481", "0.57778907", "0.577527", "0.57747406", "0.5769045", "0.57681066", "0.576302", "0.5761312", "0.5752994", "0.57489854" ]
0.0
-1
TODO Autogenerated method stub
@Override public void onScrollStateChanged(AbsListView view, int scrollState) { this.currentScrollState = scrollState; try { isScrollCompleted(); } catch (Exception ex) { } }
{ "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 onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { this.currentFirstVisibleItem = firstVisibleItem; this.currentVisibleItemCount = visibleItemCount; this.totalItem = totalItemCount; try { isScrollCompleted(); } catch (Exception ex) { } }
{ "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: rename to setAllProducts
public void setAllProducts(List<Product> products) { for (Product product : products) { this.products.put(product.getId(), product); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void getAllProducts() {\n }", "public void setProducts(List<Product> products) {\n this.products = products;\n }", "private void loadProducts() {\n\t\tproduct1 = new Product();\n\t\tproduct1.setId(1L);\n\t\tproduct1.setName(HP);\n\t\tproduct1.setDescription(HP);\n\t\tproduct1.setPrice(BigDecimal.TEN);\n\n\t\tproduct2 = new Product();\n\t\tproduct2.setId(2L);\n\t\tproduct2.setName(LENOVO);\n\t\tproduct2.setDescription(LENOVO);\n\t\tproduct2.setPrice(new BigDecimal(20));\n\n\t}", "Product getPProducts();", "@SuppressWarnings(\"unchecked\")\n\tpublic void set_List_Of_Product_Type_Of_Store_One()\n\t{\n\t\tArrayList<Product> Product_Of_Store_One = new ArrayList<Product>(); /* ArrayList Of Product */\n\t\tArrayList<String> String_Product_Of_Store_One = new ArrayList<String>(); /* ArrayList Of The String Of The Product */\n\t\tArrayList<Product> temp_Product_Of_Store_One = (ArrayList<Product>)CompanyManagerUI.Object_From_Comparing_For_Store_1.get(4);\t\n\t\t\n\t\tfor(int i = 0 ; i < temp_Product_Of_Store_One.size() ; i++)\n\t\t{\n\t\t\tProduct_Of_Store_One.add(temp_Product_Of_Store_One.get(i));\n\t\t}\n\t\t\n\t\tfor(int i = 0 ; i < Product_Of_Store_One.size() ; i++)\n\t\t{\n\t\t\tString_Product_Of_Store_One.add(String.valueOf(Product_Of_Store_One.get(i).getQuantity()) + \" ---> \" + String.valueOf(Product_Of_Store_One.get(i).getpType()));\n\t\t}\n\t\t\n\t\tProduct_Of_Store_1 = FXCollections.observableArrayList(String_Product_Of_Store_One);\n\t\tListViewQuantity_Store_1.setItems(Product_Of_Store_1);\n\t}", "private void updateProductsList() {\n this.productsList = demonstrationApplicationController.getProductsList();\n this.jListProduct.setModel(new ModelListSelectable(this.productsList));\n }", "public void setProduct(entity.APDProduct value);", "public void setProduct(Product product) {\n this.product = product;\n }", "public void setOrdersProductss(com.sybase.collections.GenericList<ru.terralink.mvideo.sap.Products> x)\n {\n __ordersProductss = x;\n }", "private void printAllProducts()\n {\n manager.printAllProducts();\n }", "public UpdateProduct() {\n\t\tsuper();\t\t\n\t}", "public void updateProducts()\n {\n ObservableList<Product> inventoryProducts = this.inventory.getAllProducts();\n\n // Configure product table and bind with inventory products\n productIDColumn.setCellValueFactory(new PropertyValueFactory<Product, String>(\"id\"));\n productNameColumn.setCellValueFactory(new PropertyValueFactory<Product, String>(\"name\"));\n productInventoryColumn.setCellValueFactory(new PropertyValueFactory<Product, String>(\"stock\"));\n productPriceColumn.setCellValueFactory(new PropertyValueFactory<Product, String>(\"price\"));\n\n productTable.setItems(inventoryProducts);\n // Unselect parts in table after part is updated\n productTable.getSelectionModel().clearSelection();\n productTable.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);\n }", "public allProductUpdate() {\n initComponents();\n }", "@Override\n\tpublic List<Product> selectAllProduct() {\n\t\treturn productMapper.selectAllProduct();\n\t}", "public void fillProducts(int totalEntries) {\n Fairy fairy = Fairy.create();\n TextProducer text = fairy.textProducer();\n StoreAPI storeOperations = new StoreAPIMongoImpl();\n for (int i = 0; i < totalEntries; i++) {\n storeOperations.addProduct(i, text.sentence(getRandomNumber(1, 10)), text.paragraph(getRandomNumber(1, 50)), (float) getRandomNumber(1, 3000), getRandomNumber(1, 5000));\n }\n }", "private Set<Product> getProductSet(Product product) {\n\t\treturn get(product.getType(), product.getState(), product.getItemId());\n\t}", "@FXML\n\t private void populateProducts (ObservableList<Product> prodData) throws ClassNotFoundException {\n\t //Set items to the productTable\n\t \tproductTable.setItems(prodData);\n\t }", "public void showAllProducts() {\n try {\n System.out.println(Constants.DECOR+\"ALL PRODUCTS IN STORE\"+Constants.DECOR_END);\n List<Product> products = productService.getProducts();\n System.out.println(Constants.PRODUCT_HEADER);\n for (Product product : products) { \n System.out.println((product.getName()).concat(\"\\t\\t\").concat(product.getDescription()).concat(\"\\t\\t\")\n .concat(String.valueOf(product.getId()))\n .concat(\"\\t\\t\").concat(product.getSKU()).concat(\"\\t\").concat(String.valueOf(product.getPrice()))\n .concat(\"\\t\").concat(String.valueOf(product.getMaxPrice())).concat(\"\\t\")\n .concat(String.valueOf(product.getStatus()))\n .concat(\"\\t\").concat(product.getCreated()).concat(\"\\t\\t\").concat(product.getModified())\n .concat(\"\\t\\t\").concat(String.valueOf(product.getUser().getUserId())));\n }\n } catch (ProductException ex) {\n System.out.println(ex);\n }\n }", "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 }", "private void initialize() {\r\n //Below are for testing purposes\r\n this.addProductQuantity(new Product(\"1984\", 1, 1.99), 10);\r\n this.addProductQuantity(new Product(\"The Great Gatsby\", 2, 2.45), 25);\r\n this.addProductQuantity(new Product(\"Silent Spring\", 3, 1.86), 3);\r\n this.addProductQuantity(new Product(\"A Room of One's Own\", 4, 3.75), 15);\r\n this.addProductQuantity(new Product(\"Catcher in The Rye\", 5, 2.89), 11);\r\n this.addProductQuantity(new Product(\"The Code Breaker\", 6, 2.50), 26);\r\n this.addProductQuantity(new Product(\"Crime and Punishment\", 7, 2.75), 1);\r\n this.addProductQuantity(new Product(\"Moby Dick\", 8, 2.50), 13);\r\n this.addProductQuantity(new Product(\"The Sixth Extinction\", 9, 3.10), 10);\r\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic void set_List_Of_Product_Type_Of_Store_Two()\n\t{\n\t\tArrayList<Product> Product_Of_Store_Two = new ArrayList<Product>(); /* ArrayList Of Product */\n\t\tArrayList<String> String_Product_Of_Store_Two = new ArrayList<String>(); /* ArrayList Of The String Of The Product */\n\t\tArrayList<Product> temp_Product_Of_Store_Two = (ArrayList<Product>)CompanyManagerUI.Object_From_Comparing_For_Store_2.get(4);\t\n\t\t\n\t\tfor(int i = 0 ; i < temp_Product_Of_Store_Two.size() ; i++)\n\t\t{\n\t\t\tProduct_Of_Store_Two.add(temp_Product_Of_Store_Two.get(i));\n\t\t}\n\t\t\n\t\tfor(int i = 0 ; i < Product_Of_Store_Two.size() ; i++)\n\t\t{\n\t\t\tString_Product_Of_Store_Two.add(String.valueOf(Product_Of_Store_Two.get(i).getQuantity()) + \" ---> \" + String.valueOf(Product_Of_Store_Two.get(i).getpType()));\n\t\t}\n\t\t\n\t\tProduct_Of_Store_2 = FXCollections.observableArrayList(String_Product_Of_Store_Two);\n\t\tListViewQuantity_Store_2.setItems(Product_Of_Store_2);\n\t}", "public void setProduct(String product) {\r\n this.product = product;\r\n }", "@Override\n protected void customize(final UserAgentBuilder builder) {\n List<Product> products = request.getProducts();\n if (products != null) {\n for (Product product : products) {\n builder.product(product);\n }\n }\n }", "private static void createProducts() {\n productRepository.addProduct(Product.builder()\n .name(\"Milk\")\n .barcode(new Barcode(\"5900017304007\"))\n .price(new BigDecimal(2.90))\n .build()\n );\n productRepository.addProduct(Product.builder()\n .name(\"Butter\")\n .barcode(new Barcode(\"5906217041483\"))\n .price(new BigDecimal(4.29))\n .build()\n );\n productRepository.addProduct(Product.builder()\n .name(\"Beer\")\n .barcode(new Barcode(\"5905927001114\"))\n .price(new BigDecimal(2.99))\n .build()\n );\n }", "public void setProductos(ArrayList<Producto> productos) {\r\n this.productos = productos;\r\n }", "void setUpdatedProduct(ObservableList<MotorCycleProduct> productSelected, String updatedPartNumber, String updatedName, Integer updatedQuantity, Double updatedPrice, String updatedCategory, String updatedDate);", "public void selectAll() {\n\t\tProductMenu menu = new ProductMenu();\n\t\ttry {\n\t\t\tList<Stock> list = service.selectAll();\n\t\t\tmenu.displayList(list);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n\tpublic List<Products> getAllProduct() {\n\t\treturn dao.getAllProduct();\n\t}", "public void initShop(){\n addCountToStorage(actionProduct.findProductByName(\"Jemeson\"), 3);\n addCountToStorage(actionProduct.findProductByName(\"Red Label\"), 5);\n addCountToStorage(actionProduct.findProductByName(\"Burenka\"), 10);\n addCountToStorage(actionProduct.findProductByName(\"Kupyanskoe\"), 21);\n\n //add transaction\n int idxCustomer = actionCustomer.findCustomerByName(\"Perto\");\n int idxProduct = actionProduct.findProductByName(\"Burenka\");\n\n addTransaction(idxCustomer, idxProduct, getDate(-7), 1 , actionProduct.getPriceByIdx(idxProduct));\n\n idxProduct = actionProduct.findProductByName(\"white bread\");\n addTransaction(idxCustomer, idxProduct, getDate(-7), 1 , actionProduct.getPriceByIdx(idxProduct));\n\n idxCustomer = actionCustomer.findCustomerByName(\"Dmytro\");\n addTransaction(idxCustomer, idxProduct, getDate(-6), 2 , actionProduct.getPriceByIdx(idxProduct));\n\n idxProduct = actionProduct.findProductByName(\"burenka\");\n addTransaction(idxCustomer, idxProduct, getDate(-6), 2 , actionProduct.getPriceByIdx(idxProduct));\n\n\n }", "Product updateProductInStore(Product product);", "@Override\r\n\tpublic void setSaleAndReviewNum(List<Product> products) {\n\t\tfor(Product product : products) {\r\n\t\t\tsetSaleAndReviewNum(product);\r\n\t\t}\r\n\t}", "public void initialize(ArrayList<Product> allProducts, ArrayList<Offer> offers) {\n this.allProducts = allProducts;\n this.allOffers = offers;\n }", "@Override\r\n public void getProduct() {\r\n\r\n InventoryList.add(new Product(\"Prod1\", \"Shirt\", \"Each\", 10.0, LocalDate.of(2021,03,19)));\r\n InventoryList.add(new Product(\"Prod1\", \"Trousers\", \"Each\", 20.0, LocalDate.of(2021,03,21)));\r\n InventoryList.add(new Product(\"Prod1\", \"Trousers\", \"Each\", 20.0, LocalDate.of(2021,03,29)));\r\n }", "protected void setProductId(String productId) {\n this.productId = productId;\n }", "public void setProducts(Employee employee, List<Product> products) {\n employee.getProducts().clear();\n employee.setProducts(products);\n employeeRepository.save(employee);\n }", "@Override\n public Iterable<Product> findAllProduct() {\n return productRepository.findAll();\n }", "@Override\n\t\tpublic List<ProductInfo> getProducts() {\n\t\t\treturn TargetProducts;\n\t\t}", "@Override\r\n\tpublic List<Product> getAllProducts() {\n\t\treturn dao.getAllProducts();\r\n\t}", "public void setProductId(String productId) ;", "@Override\n public void initialize() {\n this.product = new Product(this.productId,this.productName,this.productPrice,this.productInv,this.productMin,this.productMax);\n productTitleLabel.setText(\"Modify Product\");\n }", "List<Product> getAllProducts();", "List<Product> getAllProducts();", "List<Product> getAllProducts();", "public void updateProductList(ProductList productList) {\n this.productList = productList;\n }", "public Set<ProductBarcode> getProducts();", "@Override\n\t@Transactional\n\tpublic List<Product> getAllProducts() {\n\t\treturn (List<Product>)productDAO.findAll();\n\t\t\n\t}", "public ProductManager() {\n\t\tsuper();\n\t\ttotalQuantity = 0;\n\t\tcategoryList = new HashMap<Integer, ArrayList>();\n\t\tavailableProducts = new HashMap<String, String>();\n\t}", "@Override\n\tpublic List<Product> getAllProduct() {\n\t\treturn productRepository.findAll();\n\t}", "@Override\n\tpublic List<Product> getAllProduct() {\n\t\treturn productRepository.findAll();\n\t}", "public void defaultSetup() {\n\t\tthis.cart = this.endUser.getCart();\n\t\tLinkedList<Integer> prices = cart.getPrices();\n\t\tLinkedList<Integer> units = cart.getUnits();\n\t\tallProducts = FXCollections.observableList(cart.getProducts());\n\t\tallPrices = FXCollections.observableList(cart.getPrices());\n\t\tallUnits = FXCollections.observableList(cart.getUnits());\n\t\tlsvProduct.setItems(allProducts);\n\t\tlsvPrice.setItems(allPrices);\n\t\tlsvUnit.setItems(allUnits);\n\t\tint total_value = 0;\n\t\tfor (int i=0; i<prices.size();i++) {\n\t\t\ttotal_value += prices.get(i)*units.get(i);\n\t\t}\n\t\tlblTotal.setText(Integer.toString(total_value));\n\t}", "public void setAllValues() {\n//\t\tNewRestaurantDetailsByStoreId newRestaurantDetailsByStoreId = null;\n\t\t\n\t\tif (Constants.allthemes!=null){\n\t\t int length = Constants.allthemes.size();\n\t\t for(int i=0;i<length;i++){\n\t\t \tThemes currentTheme = Constants.allthemes.get(i);\n\t\t \tAddObjectToList(currentTheme.photo_url,\n\t\t \t\t\tcurrentTheme.title, \n\t\t\t\t\t\t\"~\"+currentTheme.content,\n\t\t\t\t\t\t\"\",\n\t\t\t\t\t\tcurrentTheme.themeIndex);\n\t\t }\n\t\t \n\t\t \n\t\t runOnUiThread(new Runnable() {\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tprepareArrayLits();//CREATE LIST VIEW OF THE NEW RESTAURANTS\n\t\t\t\t}\n\t\t\t});\n\t\t}else{\n\t\t\tToast.makeText(SlyThemesActivity.this, \"無資料,請重開App.\",Toast.LENGTH_SHORT).show();\n\t\t}\n\t}", "private void setProductPicked(int productsPosition, int filteredPosition) {\n if (productsPosition == -1) {\n Product product = filteredProducts.get(filteredPosition);\n for (int i=0; i<productList.size();i++) {\n if (productList.get(i).getProductName().equals(product.getProductName())) {\n productsPosition = i;\n }\n }\n }\n\n if(productList.get(productsPosition).isPicked()) {\n productList.get(productsPosition).setPicked(false);\n } else {\n //set product picked\n productList.get(productsPosition).setPicked(true);\n }\n //refresh list\n adapter.notifyDataSetChanged();\n\n //update user\n user.setShoppingLists(shoppingLists);\n dataController.saveUser(user);\n }", "@Override\n public void updateProductCounter() {\n\n }", "@Override\n public void onChanged(@Nullable final List<Product> product) {\n adapter.setProductEntities(product);\n }", "public List<Product> getAllProducts() {\n List<Product> listProduct= productBean.getAllProducts();\n return listProduct;\n }", "public void saveAll(Collection<Product> products);", "void createOrUpdateProducts(List<PsdProduct> psdProducts);", "public void setProduct(java.lang.String product) {\n this.product = product;\n }", "private void cargarProductos() {\r\n\t\tproductos = productoEJB.listarInventariosProductos();\r\n\r\n\t\tif (productos.size() == 0) {\r\n\r\n\t\t\tList<Producto> listaProductos = productoEJB.listarProductos();\r\n\r\n\t\t\tif (listaProductos.size() > 0) {\r\n\r\n\t\t\t\tMessages.addFlashGlobalWarn(\"Para realizar una venta debe agregar los productos a un inventario\");\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}", "@Override\r\n\tpublic int updateProduct(Product product) {\n\t\treturn 0;\r\n\t}", "public void setProduct(Product product) {\n this.product = product;\n this.updateTotalPrice();\n }", "public void setProductId(int productId) {\n this.productId = productId;\n }", "public void setProductId(int productId) {\n this.productId = productId;\n }", "public void setProduct(Product selectedProduct) {\n\t\t\n\t\tthis.modifiedProduct = selectedProduct;\n\n\t\tidField.setText(Integer.toString(modifiedProduct.getId()));\n\t\tproductNameField.setText(modifiedProduct.getName());\n\t\tpriceField.setText(Double.toString(modifiedProduct.getPrice()));\n\t\tinvField.setText(Integer.toString(modifiedProduct.getStock()));\n\t\tmaxField.setText(Integer.toString(modifiedProduct.getMax()));\n\t\tminField.setText(Integer.toString(modifiedProduct.getMin()));\n\t\t\t\t\n\t\tdummyList = modifiedProduct.getAllAssociatedParts();\n\t\tpartListProductTable.setItems(dummyList);\n\t}", "public void setProduct(Product product){\n //set the product fields\n productIdField.setText(String.valueOf(product.getId()));\n productNameField.setText(product.getName());\n productInvField.setText(String.valueOf(product.getInv()));\n productPriceField.setText(Double.toString(product.getPrice()));\n productMaxField.setText(String.valueOf(product.getMax()));\n productMinField.setText(String.valueOf(product.getMin()));\n\n //set the associated parts to the associatedPartTableView\n tmpAssociatedParts.addAll(product.getAllAssociatedParts());\n associatedPartTableView.setItems(tmpAssociatedParts);\n\n }", "@Override\r\n\tpublic List<Product> getallProducts() {\n\t\treturn dao.getallProducts();\r\n\t}", "@Override\n public void loadPaymentProducts() {\n mPaymentPresenter.loadPaymentProducts();\n }", "@Override\r\n\tpublic List<Product> findAllProducts() {\n\t\treturn productRepository.findAllProducts();\r\n\t}", "private void initialize() {\nproductCatalog.add(new ProductStockPair(new Product(100.0, \"SYSC2004\", 0), 76));\nproductCatalog.add(new ProductStockPair(new Product(55.0, \"SYSC4906\", 1), 0));\nproductCatalog.add(new ProductStockPair(new Product(45.0, \"SYSC2006\", 2), 32));\nproductCatalog.add(new ProductStockPair(new Product(35.0, \"MUSI1001\", 3), 3));\nproductCatalog.add(new ProductStockPair(new Product(0.01, \"CRCJ1000\", 4), 12));\nproductCatalog.add(new ProductStockPair(new Product(25.0, \"ELEC4705\", 5), 132));\nproductCatalog.add(new ProductStockPair(new Product(145.0, \"SYSC4907\", 6), 322));\n}", "@Override\r\n\tpublic void setSaleAndReviewNum(Product product) {\n\t\tproduct.setSaleCount(OrderItemService.getSaleCount(product.getId()));\r\n\t\tproduct.setReviewCount(reviewService.getCount(product.getId()));\r\n\t}", "public void setData(List<Products> productList) {\r\n this.productList.clear();\r\n this.productList.addAll(productList);\r\n notifyDataSetChanged();\r\n }", "@Test\n public void testGetAllProducts() throws Exception {\n when(repository.findAll()).thenReturn(Collections.singletonList(this.product));\n\n assertEquals(Collections.singletonList(this.product), service.getAllProducts());\n }", "public void setM_Product_ID (int M_Product_ID);", "public void setM_Product_ID (int M_Product_ID);", "public void addItems() {\r\n\t\tproductSet.add(new FoodItems(1000, \"maggi\", 12.0, 100, new Date(), new Date(), \"yes\"));\r\n\t\tproductSet.add(new FoodItems(1001, \"Pulses\", 55.0, 50, new Date(), new Date(), \"yes\"));\r\n\t\tproductSet.add(new FoodItems(1004, \"Meat\", 101.53, 5, new Date(), new Date(), \"no\"));\r\n\t\tproductSet.add(new FoodItems(1006, \"Jelly\", 30.0, 73, new Date(), new Date(), \"no\"));\r\n\t\t\r\n\t\tproductSet.add(new Apparels(1005, \"t-shirt\", 1000.0, 10, \"small\", \"cotton\"));\r\n\t\tproductSet.add(new Apparels(1002, \"sweater\", 2000.0, 5,\"medium\", \"woolen\"));\r\n\t\tproductSet.add(new Apparels(1003, \"cardigan\", 1001.53,22, \"large\", \"cotton\"));\r\n\t\tproductSet.add(new Apparels(1007, \"shirt\", 500.99, 45,\"large\",\"woolen\"));\r\n\t\t\r\n\t\tproductSet.add(new Electronics(1010, \"tv\", 100000.0, 13, 10));\r\n\t\tproductSet.add(new Electronics(1012, \"mobile\", 20000.0, 20,12));\r\n\t\tproductSet.add(new Electronics(1013, \"watch\", 1101.53,50, 5));\r\n\t\tproductSet.add(new Electronics(1009, \"headphones\", 300.0, 60,2));\r\n\t\t\r\n\t}", "public void Addproduct(Product objproduct) {\n\t\t\n\t}", "@JsonSetter(\"product_identifiers\")\n public void setProductIdentifiers (ProductIdentifiers value) { \n this.productIdentifiers = value;\n }", "List<Product> getAllProducts() throws PersistenceException;", "public void updateProductIds(String productID){\n\t\t\n\t\tproductIds.add(productID);\n\t}", "public void setOrderList(String products){\n\t\tStringBuilder stringBuilder = new StringBuilder();\n\n\t\t// split the orders\n\t\tString[] lines = products.split(\"\\n\");\n\n\t\tList<Order> orders = new ArrayList<>();\n\t\tfor (int i = 0; i < lines.length; i++) {\n\t\t\tOrder order = new Order();\n\t\t\t// all the properties of a product\n\t\t\tString[] properties = lines[i].split(\"&\");\n\n\t\t\t// set the manufacturer property\n\t\t\torder.setManufacturer(properties[0]);\n\t\t\tstringBuilder.append(\"Manufacturer: \").append(properties[0]).append(\"\\n\");\n\n\t\t\t// set the model property\n\t\t\torder.setModel(properties[1]);\n\t\t\tstringBuilder.append(\"Model: \").append(properties[1]).append(\"\\n\");\n\n\t\t\t// set the imei number\n\t\t\torder.setImeiNumber(properties[2]);\n\t\t\tstringBuilder.append(\"IMEI Number: \").append(properties[2]).append(\"\\n\");\n\n\t\t\t// set the rate\n\t\t\torder.setRate(Float.parseFloat(properties[3]));\n\t\t\tstringBuilder.append(\"Rate: \").append(properties[3]).append(\"\\n\\n\\n\");\n\n\t\t\t// set the id of product\n\t\t\torder.getP().setId(UUID.fromString(properties[4]));\n\n\t\t\t// set the amount to rate as there is only one quantity\n\t\t\torder.setAmount((Float.parseFloat(properties[3])));\n\t\t\t// update the total amount (adding all amounts of each order)\n\t\t\ttotal_amount.set(total_amount.getValue()+order.getAmount());\n\t\t\torders.add(order);\n\t\t}\n\t\tthis.orderList = orders;\n\t\t// set the products property to string of orders\n\t\tthis.products.set(stringBuilder.toString());\n\t}", "@Override\n public ArrayList<ProductType> loadProducts() {\n ProductType product = new ProductType(\"TestProduct\", new BigDecimal(\"5.00\"), new BigDecimal(\"10.00\"));\n ArrayList<ProductType> list = new ArrayList<>();\n list.add(product);\n return list;\n }", "public void setItems(){\n }", "public void setProductRelatedByProductIdKey(ObjectKey key) throws TorqueException\n {\n \n setProductId(((NumberKey) key).intValue());\n }", "public void updateProduct() throws ApplicationException {\n Session session = HibernateUtil.getSessionFactory().getCurrentSession();\n\n try {\n session.beginTransaction();\n Menu updateProduct = (Menu) session.get(Menu.class, menuFxObjectPropertyEdit.getValue().getIdProduct());\n\n updateProduct.setName(menuFxObjectPropertyEdit.getValue().getName());\n updateProduct.setPrice(menuFxObjectPropertyEdit.getValue().getPrice());\n\n session.update(updateProduct);\n session.getTransaction().commit();\n } catch (RuntimeException e) {\n session.getTransaction().rollback();\n SQLException sqlException = getCauseOfClass(e, SQLException.class);\n throw new ApplicationException(sqlException.getMessage());\n }\n\n initMenuList();\n }", "private void checkProducts() {\n for (JButton prodButton : productButtons) {\n if (inventoryManager.checkProductAvailability(prodButton.getText())) {\n prodButton.setEnabled(true);\n } else {\n prodButton.setEnabled(false);\n }\n }\n }", "public void ListAllProduct() {\r\n\t\t\tSystem.out.println(\" *************from inside ListAllProduct()********************** \");\r\n\t\t\tTransaction tx = null;\r\n\t\t\ttry {\r\n\r\n\t\t\t\tsessionObj = HibernateUtil.buildSessionFactory().openSession();\r\n\t\t\t\ttx = sessionObj.beginTransaction();\r\n\t\t\t\t// retrive logic\r\n\t\t\t\tList products = sessionObj.createQuery(\"From Product\").list(); // select * from employee: \"Employee refer\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Employee class\r\n\t\t\t\tIterator iterator = products.iterator();\r\n\t\t\t\twhile (iterator.hasNext()) {\r\n\t\t\t\t\tProduct product1 = (Product) iterator.next();\r\n\t\t\t\t\tSystem.out.println(\"Product Category \" + product1.getProductCategory());\r\n\t\t\t\t\tSystem.out.println(\"Product Description\" + product1.getProductDescription());\r\n\t\t\t\t\tSystem.out.println(\"Product Manufacturer \" + product1.getProductManufacturer());\r\n\t\t\t\t\tSystem.out.println(\"Product Name \"+product1.getProductName());\r\n\t\t\t\t\tSystem.out.println(\"Product Price \"+product1.getProductPrice());\r\n\t\t\t\t\tSystem.out.println(\"Product Unit \"+product1.getProductUnit());\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\r\n\t\t\t\ttx.commit();// explictiy call the commit esure that auto commite should be false\r\n\t\t\t} catch (\r\n\r\n\t\t\tHibernateException e) {\r\n\t\t\t\tif (tx != null)\r\n\t\t\t\t\ttx.rollback();\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} finally {\r\n\t\t\t\tsessionObj.close();\r\n\t\t\t}\r\n\t\t}", "@Test\n\tpublic void updateProductTest2() throws Exception {\n Attribute attr1 = ProductAttributeGenerator.generate(Generator.randomString(6, Generator.AlphaChars), \"Date\", \"AdminEntered\", \"Datetime\", false, false, true);\n Attribute createdAttr = AttributeFactory.addAttribute(apiContext, attr1, HttpStatus.SC_CREATED);\n \n\t\t\n\t //update product type\n ProductType myPT = ProductTypeGenerator.generate(createdAttr, Generator.randomString(5, Generator.AlphaChars));\n ProductType createdPT = ProductTypeFactory.addProductType(apiContext, DataViewMode.Live, myPT, HttpStatus.SC_CREATED);\n \n Product myProduct = ProductGenerator.generate(createdPT);\n List<ProductPropertyValue> salePriceDateValue = new ArrayList<ProductPropertyValue>();\n ProductPropertyValue salePriceValue = new ProductPropertyValue();\n DateTime date = DateTime.now();\n salePriceValue.setValue(date);\n salePriceDateValue.add(salePriceValue);\n myProduct.getProperties().get(myProduct.getProperties().size()-1).setValues(salePriceDateValue);\n Product createdProduct = ProductFactory.addProduct(apiContext, DataViewMode.Live, myProduct, HttpStatus.SC_CREATED);\n\t}", "@Override\r\n\tpublic List<Product> getProducts() {\n\t\treturn null;\r\n\t}", "@Override\n public void loadCartProductsData() {\n mCartPresenter.loadCartProductsData();\n }", "public Set<JavaproductModel> getproductList(Set<JavaproductModel> SetOfproductList){\n\n /* Create a new hibernate session and begin the transaction*/\n Session hibernateSession = HibernateUtil.getSessionFactory().openSession();\n Transaction hibernateTransaction = hibernateSession.beginTransaction();\n\n /* Retrieve the list of product resources that are needed.*/\n String strHibernateQuery = \"FROM JavaproductModel\";\n Query hibernateQuery = hibernateSession.createQuery(strHibernateQuery);\n SetOfproductList = new HashSet(hibernateQuery.list());\n\n /* Commit and terminate the session*/\n hibernateTransaction.commit();\n hibernateSession.close();\n return SetOfproductList;\n }", "private List<Product> extractProducts() {\r\n\t\t//load products from hidden fields\r\n\t\tif (this.getListProduct() != null){\r\n\t\t\tfor(String p : this.getListProduct()){\r\n\t\t\t\tProduct product = new Product();\r\n\t\t\t\tproduct.setId(Long.valueOf(p));\r\n\t\t\t\tthis.products.add(product);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn this.products;\r\n\t}", "public void setProductIds(Set<Long> productIdsIn) {\n productIds = productIdsIn;\n }", "@Before\r\n\tpublic void setUp() throws Exception {\r\n\t\to = new Order(\"Customer 1\");\t\t\r\n\t\to.addProduct(new Product(\"p101\",\"Orange\",12,10));\r\n\t\to.addProduct(new Product(\"p102\",\"Banana\",4,5));\r\n\t\to.addProduct(new Product(\"p103\",\"Apple\",10,10));\r\n\t\to.addProduct(new Product(\"p104\",\"Lemons\",5,20));\r\n\t\to.addProduct(new Product(\"p105\",\"Peaches\",5,5));\r\n\t}", "private void initializeData() {\n lblItem.setText(product.getName());\n txtReference.setText(product.getTransaction().getReferenceNumber());\n txtItem.setText(product.getName());\n txtDescription.setText(product.getDescription());\n txtBrand.setText(product.getBrand());\n txtModel.setText(product.getModel());\n txtQuantity.setText(String.valueOf(product.getQuantity()));\n txtUnit.setText(product.getUnit());\n txtProductDate.setDate(product.getProduct_date());\n txtOrigPrice.setText(String.valueOf(product.getOriginalPrice()));\n txtAgent.setText(product.getAgent());\n txtContactPerson.setText(product.getContactPerson());\n try { \n txtSupplier.setText(((Supplier)product.getSuppliers().toArray()[0]).getName());\n } catch(ArrayIndexOutOfBoundsException ex) {\n System.out.println(ex.toString());\n }\n }", "public List<Product> getProducts();", "public List<Product> getProducts();", "public ProductBeans() {\n \n services = BeanHelper.getService();\n list = services.listOfProducts();\n\n }", "void setProduct(x0401.oecdStandardAuditFileTaxPT1.ProductDocument.Product product);", "@Override\r\n\tpublic List prodAllseach() {\n\t\treturn adminDAO.seachProdAll();\r\n\t}", "public void setProduct(Product product) {\n mProduct = product;\n mBeaut = mProduct.getBeaut();\n }" ]
[ "0.7379823", "0.7155914", "0.68135995", "0.66628635", "0.6619061", "0.6589379", "0.6569644", "0.6538741", "0.64784694", "0.64582646", "0.64566594", "0.644385", "0.63869", "0.6361422", "0.6361008", "0.63591146", "0.6352004", "0.6322327", "0.63147944", "0.6312612", "0.6301014", "0.6295259", "0.62759966", "0.6254738", "0.62280494", "0.6225764", "0.6219808", "0.6203134", "0.6197769", "0.6197563", "0.6193125", "0.6173179", "0.61341065", "0.6093782", "0.60852885", "0.6077093", "0.60680485", "0.6062718", "0.6042223", "0.6038656", "0.6027187", "0.6027187", "0.6027187", "0.6012428", "0.6012217", "0.6008972", "0.60008293", "0.59974325", "0.59974325", "0.5988071", "0.5976427", "0.59700954", "0.5969103", "0.59681845", "0.5967667", "0.5963726", "0.595973", "0.5957297", "0.59538877", "0.59424794", "0.59302884", "0.5920054", "0.5920054", "0.5918496", "0.59178853", "0.5916613", "0.59092194", "0.5908452", "0.5906009", "0.5902427", "0.5899855", "0.58973545", "0.58847165", "0.58847165", "0.58839786", "0.5880517", "0.58738285", "0.58699286", "0.58670515", "0.58657646", "0.58654934", "0.58643144", "0.5854267", "0.58452046", "0.584514", "0.58358455", "0.58321136", "0.58230174", "0.5818793", "0.58186144", "0.58155644", "0.58145034", "0.5806592", "0.580193", "0.57911694", "0.57911694", "0.578997", "0.57864696", "0.5775336", "0.5773933" ]
0.68487144
2
/ TODO: rename to getAllProducts
public List<Product> getAllProducts() { return new ArrayList<Product>(this.products.values()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void getAllProducts() {\n }", "List<Product> getAllProducts();", "List<Product> getAllProducts();", "List<Product> getAllProducts();", "List<Product> retrieveProducts();", "@Override\r\n\tpublic List<Product> getAllProducts() {\n\t\treturn dao.getAllProducts();\r\n\t}", "public List<Product> getProducts();", "public List<Product> getProducts();", "@Override\n\tpublic List<Products> getAllProduct() {\n\t\treturn dao.getAllProduct();\n\t}", "@Override\r\n\tpublic List<Product> getallProducts() {\n\t\treturn dao.getallProducts();\r\n\t}", "List<Product> getAllProducts() throws PersistenceException;", "public List<Product> getAllProducts() {\n List<Product> listProduct= productBean.getAllProducts();\n return listProduct;\n }", "Product getPProducts();", "List<Product> getProductsList();", "public void showAllProducts() {\n try {\n System.out.println(Constants.DECOR+\"ALL PRODUCTS IN STORE\"+Constants.DECOR_END);\n List<Product> products = productService.getProducts();\n System.out.println(Constants.PRODUCT_HEADER);\n for (Product product : products) { \n System.out.println((product.getName()).concat(\"\\t\\t\").concat(product.getDescription()).concat(\"\\t\\t\")\n .concat(String.valueOf(product.getId()))\n .concat(\"\\t\\t\").concat(product.getSKU()).concat(\"\\t\").concat(String.valueOf(product.getPrice()))\n .concat(\"\\t\").concat(String.valueOf(product.getMaxPrice())).concat(\"\\t\")\n .concat(String.valueOf(product.getStatus()))\n .concat(\"\\t\").concat(product.getCreated()).concat(\"\\t\\t\").concat(product.getModified())\n .concat(\"\\t\\t\").concat(String.valueOf(product.getUser().getUserId())));\n }\n } catch (ProductException ex) {\n System.out.println(ex);\n }\n }", "List<Product> getAllProducts() throws DataBaseException;", "@Override\n\tpublic List<Product> getAllProduct() {\n\t\treturn productRepository.findAll();\n\t}", "@Override\n\tpublic List<Product> getAllProduct() {\n\t\treturn productRepository.findAll();\n\t}", "public List<Product> getAllProducts() {\n\t\tSession session = sessionFactory.getCurrentSession();\r\n\t\tQuery query = (Query) session.createQuery(\"from Product\");\r\n\t\tList<Product> products = query.list();\r\n\t\treturn products;\r\n\t}", "@Override\r\n\tpublic List<Product> findAllProducts() {\n\t\treturn productRepository.findAllProducts();\r\n\t}", "@Override\n\t@Transactional\n\tpublic List<Product> getAllProducts() {\n\t\treturn (List<Product>)productDAO.findAll();\n\t\t\n\t}", "@GetMapping(\"/getproduct\")\n\t\tpublic List<Product> getAllProduct() {\n\t\t\tlogger.info(\"products displayed\");\n\t\t\treturn productService.getAllProduct();\n\t\t}", "public List<Product> getAllProducts() {\n\t\treturn dao.getAllProducts();\n\t}", "@Override\n public Iterable<Product> findAllProduct() {\n return productRepository.findAll();\n }", "@Override\n\tpublic List<Products> getProducts() {\n\t\tSession currentSession = sessionFactory.getCurrentSession();\n\n\t\t// create a query\n\t\tQuery<Products> theQuery = currentSession.createQuery(\"from Products order by id\", Products.class);\n\n\t\t// execute query and get result list\n\t\tList<Products> products = theQuery.getResultList();\n\n\t\t// return the results\n\t\treturn products;\n\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\t@Override\r\n\tpublic ProductResponseModel getAllProduct() {\n\r\n\t\tProductResponseModel productResponseModel = new ProductResponseModel();\r\n\r\n\t\tMap<String, Object> map = productRepositoryImpl.getAllProduct();\r\n\r\n\t\t// productResponseModel.setCount((long) map.get(\"count\"));\r\n\t\tList<Product> product = (List<Product>) map.get(\"data\");\r\n\t\tList<ProductModel> productList = product.stream().map(p -> new ProductModel(p.getId(), p.getProName(),\r\n\t\t\t\tp.getProPrice(), p.getProQuantity(), p.getProDescription(), p.getProSize()))\r\n\t\t\t\t.collect(Collectors.toList());\r\n\r\n\t\tproductResponseModel.setData(productList);\r\n\r\n\t\treturn productResponseModel;\r\n\t}", "public List<Product> getAll() {\n\t\treturn productRepository.findAll();\n\n\t}", "@Override\r\n public List<Product> findAll() {\r\n return productRepository.findAll();\r\n }", "@Override\r\n\tpublic List<ProductMaster> getAllProducts() {\n\t\treturn this.repository.findAll();\r\n\t}", "public static ObservableList<Product> getAllProducts() {\n return allProducts;\n }", "@CrossOrigin()\r\n @GetMapping(\"/products/all\")\r\n List<ProductEntity> getAllProducts() {\r\n // TODO add error if there are not enough products\r\n return productRepository.findAll();\r\n }", "public List<Product> findAll();", "@Override\n\tpublic List<Product> getProducts() {\n\t\treturn productDao.getProducts();\n\t}", "public ObservableList<Product> getAllProducts() { return allProducts; }", "List<Product> findAll();", "List<Product> findAll();", "public List<Product> returnProducts() throws FlooringMasteryDaoException {\n\n List<Product> products = dao.loadProductInfo();\n return products;\n\n }", "@GetMapping(path =\"/products\")\n public ResponseEntity<List<Product>> getProducts() {\n return ResponseEntity.ok(productService.getAll());\n }", "@Override\n\tpublic List<Product> getAll() {\n\t\tQuery query = session.createQuery(\"from Product \");\n\t\t\n\t\treturn query.getResultList();\n\t}", "@Override\r\n\tpublic List prodAllseach() {\n\t\treturn adminDAO.seachProdAll();\r\n\t}", "@GetMapping(\"/findAllProduct\")\n @ResponseBody\n public ResponseEntity<List<ProductEntity>> findAllProduct() {\n List<ProductEntity> productResponse = productService.viewProduct();\n return new ResponseEntity<>(productResponse, HttpStatus.OK);\n }", "private void printAllProducts()\n {\n manager.printAllProducts();\n }", "@Override\r\n\tpublic List<Product> showAll() throws Exception {\n\t\treturn this.dao.showAll();\r\n\t}", "private List<Product> extractProducts() {\r\n\t\t//load products from hidden fields\r\n\t\tif (this.getListProduct() != null){\r\n\t\t\tfor(String p : this.getListProduct()){\r\n\t\t\t\tProduct product = new Product();\r\n\t\t\t\tproduct.setId(Long.valueOf(p));\r\n\t\t\t\tthis.products.add(product);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn this.products;\r\n\t}", "@Override\n\tpublic List<Product> selectAllProduct() {\n\t\treturn productMapper.selectAllProduct();\n\t}", "@GetMapping(\"/allProduct\")\n\tpublic ResponseEntity<Response> getAllProduct(){\n\t\treturn ResponseEntity.status(HttpStatus.OK)\n\t\t\t\t.body(new Response(productService.getProduct(), new Date()));\n\t}", "@GetMapping(\"/view-all\")\r\n\tpublic List<ProductDetails> viewAllProducts() {\r\n\r\n\t\treturn productUtil.toProductDetailsList(productService.viewAllProducts());\r\n\t}", "List<ProductDto> getProducts();", "@Override\n\tpublic List<Product> getAllProductByName(String name) {\n\t\treturn productRepository.findByName(name);\n\t}", "public ArrayList<Product> viewAllProduct() throws ProductException{\r\n\t\t\tArrayList<Product> products=new ArrayList<Product>();\r\n\t\t\tif(ProductRepository.productsList.isEmpty()) {\r\n\t\t\t\tthrow new ProductException(\"there are no products in the store\");\r\n\t\t\t\t\r\n\t\t\t}else {\r\n\t\t\t\r\n\t\t\tproducts.addAll(pDoa.viewProductsDoa());\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\treturn products;\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t}", "@Override\r\n\tpublic List<Mobile> showAllProduct() {\n\t\tQuery query=entitymanager.createQuery(\"FROM Mobile\");\r\n\t\tList<Mobile> myProd=query.getResultList();\r\n\t\treturn myProd;\r\n\t}", "public ObservableList<Product> getAllProducts() {\n return allProducts;\n }", "ArrayList<Product> ListOfProducts();", "public List<Product> getProductList(){\n List<Product> productList = mongoDbConnector.getProducts();\n return productList;\n }", "public ArrayList<Product> getAllProducts(){\r\n\t\tArrayList<Product> prods = new ArrayList<Product>();\r\n\t\tIterator<Integer> productCodes = inventory.keySet().iterator();\r\n\t\twhile(productCodes.hasNext()) {\r\n\t\t\tint code = productCodes.next();\r\n\t\t\tfor(Product currProduct : Data.productArr) {\r\n\t\t\t\tif(currProduct.getID() == code) {\r\n\t\t\t\t\tprods.add(currProduct);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn prods;\r\n\t}", "@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n public List<Product> getProductFindAll() {\n return em.createNamedQuery(\"Product.findAll\", Product.class).getResultList();\n }", "@Override\n\tpublic List<Product> getAll() throws SQLException {\n\t\treturn null;\n\t}", "public List<Products> getProducts() {\n\t\treturn pdao.getProducts();\r\n\t}", "@RequestMapping(value = \"/displayallproducts\",method=RequestMethod.POST)\r\n\tList<ProductBean> displayAllProducts() throws ProductNotFoundException {\r\n\t\t\r\n\t\t//try {\r\n\t\t\treturn service.displayAllProducts();\r\n\t\t//} catch (ProductNotFoundException e) {\r\n\t\t\t//throw e;\r\n\t\t//}\r\n\t\t\r\n\t}", "List<Product> getProducts(Order order);", "@Override\n\tpublic List<ProductDTO> viewAllProducts() throws ProductException {\n\t\tCollection<Product> products = ProductStore.map.values();\n\t\tList<ProductDTO> list = new ArrayList();\n\n\t\tfor (Product product : products) {\n\t\t\tProductDTO product1 = ProductUtil.convertToProductDto(product);\n\t\t\tlist.add(product1);\n\t\t}\n\n\t\treturn list;\n\t}", "@Override\n\tpublic List<ProductDto> getAllActiveProducts() throws Exception {\n\t\tList<ProductDto> productDtoList = new ArrayList<ProductDto>();\n\t\tList<Product> productList = (List<Product>) this.getHibernateTemplate()\n\t\t\t\t.findByNamedQuery(\"Product.getAllActiveProducts\");\n\t\tfor(Product product: productList){\n\t\t\tProductDto productDto = new ProductDto();\n\t\t\tCommonUtils.copyProperties(productDto, product);\n\t\t\tproductDtoList.add(productDto);\n\t\t}\n\t\tCollections.sort(productDtoList,ProductDto.productNameComparator);\n\t\treturn productDtoList;\n\t}", "public List<Product> getProducts() {\n\t\treturn productRepository.findAll();\n\t}", "@Override\r\n\tpublic List<Producto> getAll() throws Exception {\n\t\treturn productRepository.buscar();\r\n\t}", "@Test\n public void testGetAllProducts() throws Exception {\n when(repository.findAll()).thenReturn(Collections.singletonList(this.product));\n\n assertEquals(Collections.singletonList(this.product), service.getAllProducts());\n }", "@GetMapping(\"/products\")\n\t@HystrixCommand(fallbackMethod = \"getFallBackAllProducts\")\n\tpublic Products getAllProducts(){\n\t\tList<Product> pList=restTemplate.getForObject(\"http://product-service/products\", List.class);\n\t\tProducts p=new Products();\n\t\tp.setProductList(pList);\n\t\treturn p;\n\t}", "public List<Product> getProducts(ProductRequest request) throws IOException {\n if (request.isSingle()){\n List<Product> products = new ArrayList<>();\n products.add(parseResult(executeRequest(request),Product.class));\n return products;\n } else {\n return parseResults(executeRequest(request), Product.class);\n }\n }", "List<Product> getProductPage(int pageNumber, int pageSize);", "@NonNull\n public List<Product> findAll() {\n return productRepository.findAll();\n }", "@GetMapping(\"/retrieve\")\n public ResponseEntity<List<Product>> getProdAll(final HttpSession session) {\n log.info(session.getId() + \" : Retrieving all products\");\n return ResponseEntity.status(HttpStatus.OK).body(prodService.getAll());\n }", "@Override\n\tpublic List<Product> findAll() {\n\t\tConnection conn=null;\n\t\tPreparedStatement pst=null;\n\t\tResultSet rs=null;\n\t\t\n\t\tList<Product> list=new ArrayList<Product>();\n\t\ttry {\n\t\t\tconn=DBUtils.getConnection();\n\t\t\tpst=conn.prepareStatement(\"select id,category_id,name,Subtitle,main_image,sub_images,detail,price,stock,status,create_time,update_time from product\");\n\t\t\t\n\t\t\trs=pst.executeQuery();\n\t\t while(rs.next()) {\n\t\t \t Product product =new Product(rs.getInt(\"id\"),rs.getInt(\"category_id\"),rs.getString(\"name\"),rs.getString(\"Subtitle\"),rs.getString(\"main_image\"),rs.getString(\"sub_images\"),rs.getString(\"detail\"),rs.getBigDecimal(\"price\"),rs.getInt(\"stock\"),rs.getInt(\"status\"),rs.getDate(\"create_time\"),rs.getDate(\"update_time\"));\n\t\t \t list.add(product);\n\t\t \t \n\t\t } \n\t\t\t\n\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}finally {\n\t\t\ttry {\n\t\t\t\tDBUtils.Close(conn, pst, rs);\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}\n\t\t}\n\t\t\n\t\t\n\t\treturn list;\n\t}", "public String listAllProducts() throws Exception {\r\n\t\ttry {\r\n\t\t\tthis.setProducts(this.productService.listAll());\r\n\t\t\treturn SUCCESS;\t\r\n\t\t} catch (Exception e) {\r\n\t\t\treturn ERROR;\r\n\t\t}\r\n\t}", "@CrossOrigin(origins = \"http://localhost:5000\")\r\n @GetMapping(\"/allproducts/{page}\")\r\n public Iterable<product> allproducts(@PathVariable(\"page\") int pagenum) {\r\n int pageSize = 2;\r\n \r\n Pageable pageable = PageRequest.of(pagenum,pageSize);\r\n Page<product> allproducts = productrepo.findAll(pageable);\r\n \r\n return productrepo.findAll(pageable);\r\n }", "List<ProductView> getAllByPage(int pageNumber, int itemsPerPage) throws ProductException;", "private List<ProductView> fetchProducts(String developerId) {\n LOG.debug(\"Enter. developerId: {}.\", developerId);\n\n List<Product> products = productService.getByDeveloperId(developerId);\n\n List<ProductView> result = ProductMapper.toView(products);\n\n List<String> productIds = products.stream().map(Product::getId).collect(Collectors.toList());\n\n Map<String, List<ProductDataView>> productDataViews =\n restClient.getProductData(developerId, productIds);\n\n mergeProductData(result, productDataViews);\n\n cacheApplication.cacheProducts(developerId, result);\n\n LOG.trace(\"Product: {}.\", result);\n LOG.debug(\"Exit. product size: {}.\", result.size());\n\n return result;\n }", "@GetMapping(produces=\"application/json\" )\n public ResponseEntity<PaginatedResponse> getAllProducts(@RequestParam Map<String, String> requestParams) {\n \n int limit = DEFAULT_LIMIT;\n if (requestParams.containsKey(\"limit\")) {\n limit = Integer.parseInt(requestParams.get(\"limit\"));\n }\n \n int page = FIRST_PAGE;\n if (requestParams.containsKey(\"page\")) {\n page = Integer.parseInt(requestParams.get(\"page\"));\n }\n \n List<Product> products = productDao.findAll(requestParams);\n int numberOfProducts = products.size();\n \n int endValue = (page * limit) + limit;\n if (endValue > numberOfProducts) {\n endValue = numberOfProducts;\n }\n \n LOGGER.debug(\"total: {} page: {} end: {}\", numberOfProducts, page, endValue);\n\n // only provide a page worth of data\n products = products.subList(page * limit, endValue);\n \n // add self links to each product\n products.forEach(p -> {\n p.add(linkTo(methodOn(ProductSearchService.class).getProduct(p.getProductId())).withSelfRel());\n });\n \n return new ResponseEntity<>(new PaginatedResponse(numberOfProducts, requestParams, products, page, limit), HttpStatus.OK);\n }", "@Override\n public ArrayList<Product> getAllProducts(boolean retrieveAssociation) throws Exception\n {\n ArrayList<Product> returnList = new ArrayList<Product>();\n\n PreparedStatement query = _da.getCon().prepareStatement(\"SELECT * FROM Products\");\n _da.setSqlCommandText(query);\n ResultSet products = _da.callCommandGetResultSet();\n\n while(products.next())\n {\n Product product = buildProduct(products, retrieveAssociation);\n returnList.add(product);\n }\n\n return returnList;\n }", "public List<ProductWithSupplierTO> getAllProducts(long storeID) throws NotInDatabaseException;", "public List<Product> getAll() {\n List<Product> list = new ArrayList<>();\n String selectQuery = \"SELECT * FROM \" + PRODUCT_TABLE;\n SQLiteDatabase database = this.getReadableDatabase();\n try (Cursor cursor = database.rawQuery(selectQuery, null)) {\n if (cursor.moveToFirst()) {\n do {\n int id = cursor.getInt(0);\n String name = cursor.getString(1);\n String url = cursor.getString(2);\n double current = cursor.getDouble(3);\n double change = cursor.getDouble(4);\n String date = cursor.getString(5);\n double initial = cursor.getDouble(6);\n Product item = new Product(name, url, current, change, date, initial, id);\n list.add(item);\n }\n while (cursor.moveToNext());\n }\n }\n return list;\n }", "@Override\r\n\tpublic List<Product> getProducts() {\n\t\treturn null;\r\n\t}", "List<Product> list();", "public List<Product> getProducts() {\n return products;\n }", "@ServiceMethod(name = \"FetchStoreProduct\")\r\n\tpublic IResponseHandler fetchStoreProduct()\r\n\t{\t\r\n\t\tStoreProductOutDTO outDTO = new StoreProductOutDTO();\r\n\t\t\r\n\t\tList<StoreProduct> sps= StoreProductDAO.getInstance(getSession()).readStoresProduct();\r\n\t\t\r\n\t\tfor(StoreProduct sp : sps)\r\n\t\t{\r\n\t\t\tStoreProductDTO dto = new StoreProductDTO();\r\n\t\t\t\r\n\t\t\toutDTO.getStoreProducts().add(dto.assemble(sp));\r\n\t\t}\r\n\t\t\r\n\t\tStoreService storeService = (StoreService)newInstance(new StoreService());\r\n\t\toutDTO.setStores((StoreOutDTO)storeService.fetchStore());\r\n\t\t\r\n\t\tProductService productService = (ProductService)newInstance(new ProductService());\r\n\t\toutDTO.setProducts((ProductOutDTO)productService.fetchProduct());\r\n\t\t\r\n\t\treturn outDTO;\r\n\t}", "public List<ProductDto> getProducts() {\n return tradingSystemFacade.getProducts();\n }", "public List<Product> get() {\r\n return sessionFactory.getCurrentSession()\r\n .createCriteria(Product.class)\r\n .addOrder(Order.asc(\"name\"))\r\n .list();\r\n }", "@GetMapping(\"/sysadm/product\")\n public String showAllProduct() {\n return \"admin/sysadm/productList\";\n }", "@Override\n\tpublic int getProducts(List<Product> products, int pageNo, int pageSize) {\n\t\treturn 0;\n\t}", "@Override\n public List<ProductDTO> getProducts(Map<String, String> allParams) throws ProductException {\n List<Criterion> criteria = new ArrayList<>();\n int criteriaCounter = 0;\n String order = null;\n\n if (allParams != null) {\n for (Map.Entry<String, String> entry : allParams.entrySet()) {\n // Validate params\n if (!Arrays.stream(avalibleParams).anyMatch(val -> val.equals(entry.getKey())))\n throw new ProductException(ProductException.INVALID_INPUT, ProductException.INVALID_INPUT_MSG);\n\n if (entry.getKey().equals(avalibleParams[0])) { // avalibleParams[0] is \"order\"\n order = entry.getValue();\n } else {\n // Add a criterion\n criteria.add(new Criterion(entry.getValue(), entry.getKey()));\n criteriaCounter++;\n }\n }\n }\n // Params Excess exception\n if (criteriaCounter > 2)\n throw new ProductException(ProductException.PARAMS_EXCESS, ProductException.PARAMS_EXCESS_MSG);\n\n return articleRepository.getProducts(criteria, order);\n }", "@Override\n\tpublic List<ProductInfo> getProducts() {\n\t\treturn shoppercnetproducts;\n\t}", "List<ProductView> getAllByPage(PageableAndSortable pageableAndSortable) throws ProductException;", "@Override\n\tpublic List<Product> getProducts() {\n\t\treturn null;\n\t}", "@Test\n public void testGetAllProduct() throws Exception {\n System.out.println(\"getAllProduct\");\n prs = dao.getAllProduct();\n \n assertArrayEquals(products.toArray(), prs.toArray());\n }", "public List<Products> getProductsDetails() {\n\t\treturn productsRepo.findAll();\n\t}", "List<ProductCategory> getAll();", "@Override\n\tpublic List<Product> getProducts(int pageNo, int pageSize) {\n\t\treturn null;\n\t}", "public List<Product> getAllProducts()\n {\n SQLiteDatabase db = this.database.getWritableDatabase();\n\n // Creates a comma-separated string of all columns in the shopping list table\n String values = TextUtils.join(\", \", ShoppingListTable.COLUMNS);\n\n // Constructs the SQL query\n String sql = String.format(\"SELECT %s FROM %s\", values, ShoppingListTable.TABLE_NAME);\n\n Cursor query = db.rawQuery(sql, null);\n\n Product product = null;\n List<Product> products = new ArrayList<>();\n\n // Check whether there are any products\n if (query.moveToFirst())\n {\n do\n {\n int tpnb = Integer.parseInt(query.getString(0));\n String name = query.getString(1);\n String description = query.getString(2);\n float cost = Float.parseFloat(query.getString(3));\n float quantity = Float.parseFloat(query.getString(4));\n String superDepartment = query.getString(5);\n String department = query.getString(6);\n String imageURL = query.getString(7);\n Boolean isChecked = query.getString(8).equals(\"1\");\n int amount = Integer.parseInt(query.getString(9));\n int position = Integer.parseInt(query.getString(10));\n\n product = new Product(tpnb, name, description, cost, quantity, superDepartment, department, imageURL);\n\n product.setChecked(isChecked);\n product.setAmount(amount);\n product.setPosition(position);\n\n products.add(product);\n }\n while (query.moveToNext());\n }\n\n return products;\n }", "public List<Product> getFullProductList(){\n\t\t/*\n\t\t * La lista dei prodotti da restituire.\n\t\t */\n\t\tList<Product> productList = new ArrayList<Product>();\n\t\t\n\t\t/*\n\t\t * Preleviamo il contenuto della tabella PRODOTTO.\n\t\t */\n\t\tStatement productStm = null;\n\t\tResultSet productRs = null;\n\t\t\n\t\ttry{\n\t\t\tproductStm = connection.createStatement();\n\t\t\tString sql = \"SELECT * FROM PRODOTTO;\";\n\t\t\tproductRs = productStm.executeQuery(sql);\n\t\t}\n\t\tcatch(SQLException sqle){\n\t\t\tSystem.out.println(\"DB issue: failed to retrive product data from database.\");\n\t\t\tSystem.out.println(sqle.getClass().getName() + \": \" + sqle.getMessage());\n\t\t}\n\t\t\n\t\ttry{\n\t\t\tproductList = this.getProductListFromRs(productRs);\n\t\t\tproductStm.close(); // Chiude anche il ResultSet productRs\n\t\t\tConnector.releaseConnection(connection);\n\t\t}\n\t\tcatch(SQLException sqle){\n\t\t\tSystem.out.println(\"ResultSet issue 2: failed to retrive data from ResultSet.\\n\");\n\t\t\tSystem.out.println(sqle.getClass().getName() + \": \" + sqle.getMessage());\n\t\t}\n\t\t\n\t\treturn productList;\n\t}", "private void get_products_search()\r\n\r\n {\n MakeWebRequest.MakeWebRequest(\"get\", AppConfig.SALES_RETURN_PRODUCT_LIST,\r\n AppConfig.SALES_RETURN_PRODUCT_LIST + \"[\" + Chemist_ID + \",\"+client_id +\"]\", this, true);\r\n\r\n// MakeWebRequest.MakeWebRequest(\"out_array\", AppConfig.SALES_RETURN_PRODUCT_LIST, AppConfig.SALES_RETURN_PRODUCT_LIST,\r\n// null, this, false, j_arr.toString());\r\n //JSONArray jsonArray=new JSONArray();\r\n }", "@Override\n\tpublic List<ProductDto> getProducts() {\n\t\treturn null;\n\t}", "public List<Product> getProducts() {\n Connection connection = null;\n Statement statement = null;\n ResultSet resultSet = null;\n List<Product> products = new ArrayList<>(); //creating an array\n String sql=\"select * from products order by product_id\"; //writing sql statement\n try {\n connection = db.getConnection();\n statement = connection.createStatement();\n resultSet = statement.executeQuery(sql);\n while (resultSet.next()) { //receive data from database\n products.add(new Product( resultSet.getInt(1), resultSet.getString(2), resultSet.getInt(3),\n resultSet.getString(4),resultSet.getString(5),resultSet.getString(6),\n resultSet.getString(7), resultSet.getString(8))); //creating object of product and\n // inserting it into an array\n }\n return products; //return this array\n } catch (SQLException | ClassNotFoundException throwable) {\n throwable.printStackTrace();\n } finally {\n try {\n assert resultSet != null;\n resultSet.close();\n statement.close();\n connection.close();\n } catch (SQLException throwable) {\n throwable.printStackTrace();\n }\n }\n return null;\n }" ]
[ "0.8682658", "0.85834545", "0.85834545", "0.85834545", "0.8149862", "0.8092503", "0.80238146", "0.80238146", "0.8022991", "0.8000854", "0.7986676", "0.7975639", "0.79701287", "0.7967392", "0.7912052", "0.7896949", "0.7803486", "0.7803486", "0.77484167", "0.7747321", "0.76886797", "0.76750845", "0.76433235", "0.7616911", "0.75792766", "0.75704944", "0.7529074", "0.7523833", "0.74371666", "0.74353856", "0.74350643", "0.7432634", "0.7377492", "0.7371867", "0.7370427", "0.7370427", "0.7365315", "0.7340734", "0.7336018", "0.7335097", "0.7324431", "0.73022616", "0.72842807", "0.72706366", "0.72600067", "0.7256297", "0.72527194", "0.72311777", "0.7231142", "0.7230566", "0.72272605", "0.72233045", "0.72095865", "0.7206633", "0.72010785", "0.7186651", "0.7181083", "0.71761966", "0.7163305", "0.7162248", "0.7153134", "0.71515155", "0.71503633", "0.71464914", "0.7140535", "0.71363086", "0.71126926", "0.71004164", "0.70941585", "0.7089271", "0.70732135", "0.7054765", "0.7047662", "0.70328104", "0.70316976", "0.70305306", "0.70210624", "0.7011639", "0.7011289", "0.699932", "0.6979765", "0.69496834", "0.69338393", "0.69167185", "0.6915466", "0.69132024", "0.68838125", "0.68779796", "0.6872072", "0.68703526", "0.6867495", "0.68541735", "0.68450034", "0.6837921", "0.68274933", "0.6824739", "0.6813889", "0.67995304", "0.67815065", "0.6772198" ]
0.73954076
32
input 21462675756 output : 21462675756
public static void main(String[] args) { String input = "21462675756"; System.out.println(createString(input)); int a[] = { 1, 2, 3, 7, 5 }; int b[] = {1, 4, 20, 3, 10, 5}; // sortAndRemoveDuplicates(a); // shiftelements(a, 2); subArrayWithGivenSum(a, 12); subArrayWithGivenSum(b, 33); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) throws IOException {\r\n\t long a = 1182312000;\r\n\t System.out.println((a<<1) + 57596000);\r\n\t System.out.println(Long.MAX_VALUE);\r\n }", "public static void main(String args[] ) throws Exception {\n Scanner in = new Scanner(System.in);\n \n String original = in.next();\n int n = original.length();\n long moda = 1000000007;\n long ones = 1;\n long sum=0; \n for (int s=original.length()-1; s>=0; s--) {\n sum = (sum + (s+1) * (original.charAt(s) - '0') * ones) %moda; \n ones = (ones * 10 + 1) % moda;\n \n }\n \n System.out.println(sum);\n \n }", "String mo30285c(long j);", "public static void main(String[] args) {\n\tString NUM = \"73167176531330624919225119674426574742355349194934\" +\n \"96983520312774506326239578318016984801869478851843\" +\n \"85861560789112949495459501737958331952853208805511\" +\n \"12540698747158523863050715693290963295227443043557\" +\n \"66896648950445244523161731856403098711121722383113\" +\n \"62229893423380308135336276614282806444486645238749\" +\n \"30358907296290491560440772390713810515859307960866\" +\n \"70172427121883998797908792274921901699720888093776\" +\n \"65727333001053367881220235421809751254540594752243\" +\n \"52584907711670556013604839586446706324415722155397\" +\n \"53697817977846174064955149290862569321978468622482\" +\n \"83972241375657056057490261407972968652414535100474\" +\n \"82166370484403199890008895243450658541227588666881\" +\n \"16427171479924442928230863465674813919123162824586\" +\n \"17866458359124566529476545682848912883142607690042\" +\n \"24219022671055626321111109370544217506941658960408\" +\n \"07198403850962455444362981230987879927244284909188\" +\n \"84580156166097919133875499200524063689912560717606\" +\n \"05886116467109405077541002256983155200055935729725\" +\n \"71636269561882670428252483600823257530420752963450\";\n\n //greatest combo array\n int[] greatestCombo = new int[13];\n //array to iterate through NUMS\n int[] combos = new int[13];\n //adjacency\n boolean adjacent = true;\n //product\n long product = 1;\n //maxProduct\n long maxProduct = 0;\n\n\t//iterating through the entire NUM string\n\tfor(int i = 0 ; i < NUM.length()-13; i++){\n\t //make a temporary array with the combination of the three numbers\n\t for(int c = 0; c < 13; c++){\n\t combos[c] = NUM.charAt(i+c);\n }\n\n\t //loop to determine if the numbers are adjacent\n for(int k = 1; k < 13; k++){\n if(abs(combos[k-1]-combos[k])>1){\n adjacent = false;\n break;\n }\n }\n\n //now that we have an adjacent 13-number array\n if(adjacent){\n //find the product\n for(int r = 0; r < 13; r++){\n product *= combos[r];\n }\n\n if(product > maxProduct){\n maxProduct = product;\n for(int p = 0; p < 13; p++){\n greatestCombo[p]=combos[p];\n }\n }\n }\n\n }\n System.out.println(maxProduct);\n\n }", "public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n int n = in.nextInt();\n String base = n + \"000000000\";\n int sum = 0;\n while (in.hasNextInt()) {\n sum += in.nextInt() % 1000000000;\n }\n String sumS = Integer.toString(sum);\n System.out.println(base.substring(0, base.length() - sumS.length()) + sumS);\n }", "long mo107678c(Integer num);", "public static void main(String[] args) {\n System.out.println(\"Enter the number\");\n try (Scanner scanner = new Scanner(System.in)) {\n long theNumber = scanner.nextLong();\n\n //Using inBuilt method from the Integer class\n String x = Long.toBinaryString(theNumber);\n System.out.println(x);\n\n System.out.println(x.concat(\"0\".repeat(5)));\n new String(new char[10]);\n\n\n }\n }", "public static void main(String arg[]) {\n\t\t\n\t\tlong longNumberWithoutL = 1000*60*60*24*365;\n\t\tlong longNumberWithL = 1000*60*60*24*365L;\n\n\t\tSystem.out.println(longNumberWithoutL);//1471228928\n\t\tSystem.out.println(longNumberWithL);//31536000000\n\n\t\t//31536000000 -- 36 bits\n\t\t// 11101010111101100010010110000000000\n\t\t//max limit of 32 bit int: 2147483647\n\t\t//1010111101100010010110000000000 --> 1471228928\n\t}", "long mo25071a(long j);", "public static void main(String[] args) {\n\t\t long ms = 671684;\r\n\t\t long ms1 = 607222 ;\r\n\t\t SimpleDateFormat formatter = new SimpleDateFormat(\"HH:mm:ss\");\r\n\t formatter.setTimeZone(TimeZone.getTimeZone(\"GMT+00:00\"));\r\n\t String hms = formatter.format(416970);\r\n\t String hms1 = formatter.format(710036);\r\n\t System.out.println(hms);\r\n\t System.out.println(hms1);\r\n\t //��ʦ���������ExecutorService������һ��\r\n\t}", "public static void main(String[] args) {\n\t\tDate date=new Date(Long.parseLong(\"1438842265000\"));\n\t\tSystem.err.println(new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\").format(date));\n\t}", "void mo25957a(long j, long j2);", "int mo5867a(String str, long j);", "public static void main(String[] args) {\n\t\tString s1 = \"234\";\n\t\tint fd = 0;\n\t\tint fd1 = 0;\n\t\tint fd2 = 1;\n\t\tfor (int df = s1.length() - 1; df >= 0; df--) {\n\t\t\tString firstLetter7 = String.valueOf(s1.charAt(df));\n\t\t\tif (firstLetter7.equals(\"0\"))\n\t\t\t\tfd1 = 0;\n\t\t\telse if (firstLetter7.equals(\"1\"))\n\t\t\t\tfd1 = 1;\n\t\t\telse if (firstLetter7.equals(\"2\"))\n\t\t\t\tfd1 = 2;\n\t\t\telse if (firstLetter7.equals(\"3\"))\n\t\t\t\tfd1 = 3;\n\t\t\telse if (firstLetter7.equals(\"4\"))\n\t\t\t\tfd1 = 4;\n\t\t\telse if (firstLetter7.equals(\"5\"))\n\t\t\t\tfd1 = 5;\n\t\t\telse if (firstLetter7.equals(\"6\"))\n\t\t\t\tfd1 = 6;\n\t\t\telse if (firstLetter7.equals(\"7\"))\n\t\t\t\tfd1 = 7;\n\t\t\telse if (firstLetter7.equals(\"8\"))\n\t\t\t\tfd1 = 8;\n\t\t\telse if (firstLetter7.equals(\"9\"))\n\t\t\t\tfd1 = 9;\n\t\t\tfd = fd + fd2 * fd1;\n\t\t\tfd2 = fd2 * 10;\n\t\t}\n\t\tint a = fd - 1;\n\t\tfor (int i = a; i > 1; i--) {\n\t\t\tint qw = 0;\n\t\t\tint qw1 = i;\n\t\t\tString s2 = \"\";\n\t\t\twhile (qw1 > 0) {\n\t\t\t\tqw = qw1 % 10;\n\t\t\t\tif (qw == 0)\n\t\t\t\t\ts2 = \"0\" + s2;\n\t\t\t\telse if (qw == 1)\n\t\t\t\t\ts2 = \"1\" + s2;\n\t\t\t\telse if (qw == 2)\n\t\t\t\t\ts2 = \"2\" + s2;\n\t\t\t\telse if (qw == 3)\n\t\t\t\t\ts2 = \"3\" + s2;\n\t\t\t\telse if (qw == 4)\n\t\t\t\t\ts2 = \"4\" + s2;\n\t\t\t\telse if (qw == 5)\n\t\t\t\t\ts2 = \"5\" + s2;\n\t\t\t\telse if (qw == 6)\n\t\t\t\t\ts2 = \"6\" + s2;\n\t\t\t\telse if (qw == 7)\n\t\t\t\t\ts2 = \"7\" + s2;\n\t\t\t\telse if (qw == 8)\n\t\t\t\t\ts2 = \"8\" + s2;\n\t\t\t\telse if (qw == 9)\n\t\t\t\t\ts2 = \"9\" + s2;\n\t\t\t\tqw1 = qw1 / 10;\n\t\t\t}\n\t\t\tSystem.out.println(s1);\n\t\t\tSystem.out.println(s2);\n\t\t\tExp11 ur = new Exp11();\n\t\t\ts1 = ur.emp11(s1, s2);\n\t\t}\n\t\tSystem.out.println(s1);\n\t}", "private String zxt (long inp, int length) {\n String result = Long.toString(inp);\n int dist = (length - result.length());\n for (int i = 0; i < dist; i++) {\n result = \"0\" + result;\n }\n return result;\n }", "void mo5875b(String str, long j);", "public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n \n int t = in.nextInt();\n \n int count = 1;\n \n while(count<=t)\n {\n long n = in.nextLong();\n \n long backupN = n;\n \n int zeroes = (n+\"\").length()-1;\n \n // StringBuilder sb = new StringBuilder(\"1\");\n \n // for(int i = 0;i<zeroes;i++)\n // {\n // sb.append(\"0\");\n // }\n \n // System.out.println(sb.toString());\n \n long divisor = (long)Math.pow(10,zeroes);\n //Integer.parseInt(sb.toString());\n \n \n // System.out.println(\"divisor = \"+divisor);\n \n int counter = 0;\n while(n>0)\n {\n // System.out.println(\"value of n = \"+n);\n // System.out.println(\"value of divisor = \"+divisor);\n long q = n/divisor;\n \n if(q != 0 && backupN%q == 0)\n {\n \n counter++;\n }\n n = n%divisor;\n divisor = divisor/10;\n } \n \n System.out.println(counter);\n count++;\n }\n }", "void mo64942a(String str, long j, long j2);", "public static void main(String[] args) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tBigInteger num = new BigInteger(\"2\");\r\n\t\tnum = num.pow(1000);\r\n\t\tString str = num.toString();\r\n\t\tint sum = 0;\r\n\t\tfor(int i = 0; i < str.length(); i++) {\r\n\t\t\tString sub = str.substring(i,i+1);\r\n\t\t\tsum = sum + Integer.parseInt(sub);\r\n\t\t}\r\n\t\tSystem.out.println(sum);\r\n\t}", "C3579d mo19716j(long j) throws IOException;", "public static void main(String[] args) {\n List<Integer> res = sequentialDigits(744, 1928);\n }", "void mo30275a(long j);", "public static void main(String[] args) {\n// String before1 = \"27e80000\";\n// String before1 = \"715b00000\";\n String before1 = \"715b00000\";\n\n long after1 = Long.parseLong(before1, 16);\n System.out.println(after1);\n\n// String before2 = \"28d80000\";\n// String before2 = \"7c0000000\";\n// String before2 = \"71db80000\";\n String before2 = \"720580000\";\n long after2 = Long.parseLong(before2, 16);\n System.out.println(after2);\n\n long size = (after2 - after1) / 1024 / 1024;\n System.out.println(\"Size: \" + size + \"M\");\n }", "long mo133613a();", "public static void main(String[] args) {\n\t\tint n=345;\r\n\t\tint s=0;\r\n\t\twhile(n!=0)\r\n\t\t{\r\n\t\tint last=n%10;\r\n\t\ts =s+last;\r\n\t\tn= n/10;\t\r\n\t\t\t\r\n\t\t\t}\r\n\r\nSystem.out.println(s);\r\n\t}", "int main()\n{\n int a;\n std::cin>>a;\n int b=(a%10)+(a/1000);\n std::cout<<b;\n}", "static String GetCheckDigitAndCheckCode(String input) {\n int sum = 0;\n for(int i = 0; i < input.length(); i++) {\n if(i%2 == 0 || i == 0) {\n\n sum += 3 * Character.getNumericValue(input.charAt(i));\n }else {\n sum += Character.getNumericValue(input.charAt(i));\n }\n }\n int subDigit = ((sum/10) + 1 ) * 10;\n int checkDigit = subDigit - sum;\n\n input = input + checkDigit;\n\n\n int digit1 = get9Digits(input.substring(0, 8));\n int digit2 = get9Digits(input.substring(9));\n\n // NOTE - Not able to understand what means by index of 2\n // digit numbers so here am just adding instead of multiplying the 2 9 digits.\n int result = digit1 + digit2 + 207;\n int remainder = result % 103;\n\n StringBuilder sb = new StringBuilder();\n sb.append(checkDigit);\n sb.append(',');\n sb.append(remainder);\n return sb.toString();\n }", "public abstract long mo24412e();", "long mo117970a();", "int toHashKey(String s)\n\t{\n\t\tint A = 1952786893;\n\t\tint B = 367257;\n\t\tint v = B;\n\t\tfor (int j = 0; j < s.length(); j++)\n\t\t{\n\t\t\tchar c = s.charAt(j);\n\t\t\tv = A * (v + (int) c + j) + B;\n\t\t}\n\n\t\tif (v < 0) v = -v;\n\t\treturn v;\n\t}", "@Test\n public void stringFromLong() {\n assertEquals(\n \"784dd132\",\n JdkHashTools.getStringFromLong(2018365746)\n );\n }", "@Override\n public String solve() {\n\n long firstCoin = 1504170715041707L;\n long modValue = 4503599627370517L;\n //System.out.println(\"Second Coin \" + (firstCoin - (4503599627370517L % firstCoin)));\n long secondCoin = firstCoin - (modValue % firstCoin);\n long ans = firstCoin + secondCoin;\n while(secondCoin > 1) {\n modValue = firstCoin;\n firstCoin = secondCoin;\n secondCoin = firstCoin - (modValue % firstCoin);\n //System.out.println(secondCoin);\n ans += secondCoin;\n }\n return Long.toString(ans);\n }", "private void greensnum(long a) {\n\n\t\tSystem.out.println(\"OMR phonenumber is\"+a);\n\t}", "C3579d mo19719m(long j) throws IOException;", "private static long m26011b(Context context) {\n if (f26945h == null) {\n long j = 0;\n if (context == null) {\n return 0;\n }\n if (m26010a(context)) {\n j = C10310f5.m26109a(context.getContentResolver(), \"android_id\", 0);\n }\n f26945h = Long.valueOf(j);\n }\n return f26945h.longValue();\n }", "public static void main(String[] args) {\n\r\n\t\tScanner sc = new Scanner(System.in);\r\n\r\n\t\tint num = sc.nextInt();\r\n\t\tint snum[] = new int[4];\r\n\t\tint count = 0;\r\n\t\tint k1 = 0;\r\n\t\tint k2 = 0;\r\n\r\n\t\twhile (num != 6174) { // 반복\r\n\r\n\t\t\tcount++;\r\n\r\n\t\t\tsnum[0] = num / 1000; // 1000의자리수\r\n\t\t\tsnum[1] = (num - (snum[0] * 1000)) / 100; // 100의 자리수\r\n\t\t\tsnum[2] = (num - ((snum[0] * 1000) + (snum[1] * 100))) / 10; // 10의자리수\r\n\t\t\tsnum[3] = num % 10; // 1의자리수\r\n\r\n\t\t\tint temp;\r\n\t\t\tfor (int i = 0; i < snum.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < snum.length; j++) {\r\n\t\t\t\t\ttemp = snum[i];\r\n\t\t\t\t\tif (snum[i] >= snum[j]) { // 큰수부터 정렬\r\n\t\t\t\t\t\tsnum[i] = snum[j];\r\n\t\t\t\t\t\tsnum[j] = temp;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tk1 = Integer.parseInt(Integer.toString(snum[0]) + snum[1] + snum[2] + snum[3]); // 큰\r\n\t\t\tk2 = Integer.parseInt(Integer.toString(snum[3]) + snum[2] + snum[1] + snum[0]); // 작은\r\n\r\n\t\t\tnum = k1 - k2; // 뺀\r\n\r\n\t\t}\r\n\t\tSystem.out.println(count);\r\n\t}", "Long mo20729a();", "private String parseToTwoInteger(int input) {\n\t\treturn input < 10 ? \"0\" + input : \"\" + input;\n\t}", "private static long tagId(long x) {\n return x & 0xFFFFFFFFFFFFL; // 1\n }", "protected long m8222b(long j) {\n return (((long) this.f7048i) * j) / 1000000;\n }", "public static void main(String[] args) {\n String idNum = \"410326880818551\";\n System.out.println(verify15(idNum));\n// String idNum2 = \"411111198808185510\";\n String idNum2 = \"410326198808185515\";\n System.out.println(verify(idNum2));\n }", "C3197iu mo30281b(long j);", "void mo107677b(Integer num);", "private static int m24353e(int i) {\n return i - (i >> 2);\n }", "public int h(long j2) {\n if (j2 >= 0) {\n return (int) (j2 % 86400000);\n }\n return ((int) ((j2 + 1) % 86400000)) + 86399999;\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(\"enter the number:\");\r\n\t\tScanner sc=new Scanner(System.in);\r\n\t\tint a=sc.nextInt();\r\n\t\tint i=0,j=0;\r\n\t\tint n=a;\r\n\t\twhile(n>0)\r\n\t\t{\r\n\t\t\ti=n%10;\r\n\t\t\tj=j*10+i;\r\n\t\t\tn=n/10;\r\n\t\t\r\n\t\t}\r\n\t\tSystem.out.println(j);\r\n\t\t\r\n\r\n\t}", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint ip = sc.nextInt();\n\t\tsc.close();\n\t\tint op =1,i=0,mul=1,n=0,temp=0;\n\t\tint len = Integer.valueOf(String.valueOf(ip).length());\n\t\tfor(int j=0;j<len-1;j++){\n\t\t\ttemp=Integer.valueOf(String.valueOf(ip).charAt(j)-48);\n\t\t\tn=Integer.valueOf(String.valueOf(ip).charAt(j+1)-48);\n\t\t\ti=0;mul=1;\n\t\t\t\n\t\t\twhile(i<n){\n\t\t\t\tmul*=temp;\n\t\t\t\ti++;\n\t\t\t}\n\t\t\top+=mul;\n\t\t\t\n\t\t}\n\t\tSystem.out.println(op);\n\n\t}", "public long mo9786y() {\n long j;\n long j2;\n long j3;\n byte b;\n long j4 = this.f9091i;\n if (this.f9090h != j4) {\n long j5 = j4 + 1;\n byte a = C3691q1.m8803a(j4);\n if (a >= 0) {\n this.f9091i = j5;\n return (long) a;\n } else if (this.f9090h - j5 >= 9) {\n long j6 = j5 + 1;\n byte a2 = a ^ (C3691q1.m8803a(j5) << 7);\n if (a2 < 0) {\n b = a2 ^ Byte.MIN_VALUE;\n } else {\n long j7 = j6 + 1;\n byte a3 = a2 ^ (C3691q1.m8803a(j6) << 14);\n if (a3 >= 0) {\n j = (long) (a3 ^ 16256);\n } else {\n j6 = j7 + 1;\n byte a4 = a3 ^ (C3691q1.m8803a(j7) << 21);\n if (a4 < 0) {\n b = a4 ^ -2080896;\n } else {\n j7 = j6 + 1;\n long a5 = ((long) a4) ^ (((long) C3691q1.m8803a(j6)) << 28);\n if (a5 >= 0) {\n j3 = 266354560;\n } else {\n long j8 = j7 + 1;\n long a6 = a5 ^ (((long) C3691q1.m8803a(j7)) << 35);\n if (a6 < 0) {\n j2 = -34093383808L;\n } else {\n j7 = j8 + 1;\n a5 = a6 ^ (((long) C3691q1.m8803a(j8)) << 42);\n if (a5 >= 0) {\n j3 = 4363953127296L;\n } else {\n j8 = j7 + 1;\n a6 = a5 ^ (((long) C3691q1.m8803a(j7)) << 49);\n if (a6 < 0) {\n j2 = -558586000294016L;\n } else {\n j7 = j8 + 1;\n j = (a6 ^ (((long) C3691q1.m8803a(j8)) << 56)) ^ 71499008037633920L;\n if (j < 0) {\n long j9 = 1 + j7;\n if (((long) C3691q1.m8803a(j7)) >= 0) {\n j6 = j9;\n this.f9091i = j6;\n return j;\n }\n }\n }\n }\n }\n j = a6 ^ j2;\n j6 = j8;\n this.f9091i = j6;\n return j;\n }\n j = a5 ^ j3;\n }\n }\n j6 = j7;\n this.f9091i = j6;\n return j;\n }\n j = (long) b;\n this.f9091i = j6;\n return j;\n }\n }\n return mo9787z();\n }", "public static void main(String[] args) {\nint t = 101010101;\n// koden begynner her\nString s = \"\";\nwhile ( t % 10 > 0 ) {\ns = t % 10 + s;\nt = t / 10;\n}\ns = \"s = \" + s;\nout.println(s);\n\n }", "public static void main(String[] args) {\n\r\n\t\tlong ln= 6008514751431L;\r\n\t\tint max=0;\r\n\t\tfor (int i=2; i<= ln;i++)\r\n\t\t\twhile (ln % i == 0)\r\n\t\t\t{\r\n\t\t\t\tif(i>max)\r\n\t\t\t\tmax=i;\r\n\t\t\t\tln/=i;\r\n\t\t\t}\t\r\n\t\tSystem.out.println(\"the greatest prime factor of the given number is :\"+max);\r\n\t\t}", "long mo1636a(long j, alb alb);", "public static void main(String[] args) {\n\t\tBigDecimal bd = new BigDecimal( input );\n\t\tBigDecimal microsDivisor = new BigDecimal( 1_000_000_000L );\n\t\tlong seconds = bd.longValue( );\n\t\tBigDecimal bdMicros = bd.subtract( new BigDecimal( seconds ) ).multiply( microsDivisor );\n\t\tlong nanos = bdMicros.longValue( );\n\t\t\n\t\tInstant instant = Instant.ofEpochSecond( seconds , nanos ) ;\n\t\tSystem.out.println(instant.toString());\n\t\tlong ut1 = Instant.now().getEpochSecond();\n System.out.println(ut1-ut1%86400);\n\n long ut2 = System.currentTimeMillis() / 1000L;\n System.out.println(ut2);\n\n Date now = new Date();\n long ut3 = now.getTime() / 1000L;\n System.out.println(ut3);\n\t}", "public String long_ip(long numero_ip){\n String str_num_ip=\"\";\n for(int i=3; i>=0; i--){\n str_num_ip += (0b1111_1111 & (numero_ip >> (i*8) )) + (i!=0? \".\": \"\");\n }\n return str_num_ip;\n }", "private static long m146732b(String str) {\n String[] split = str.split(\"_\");\n if (split.length != 3) {\n return 0;\n }\n try {\n return Long.valueOf(split[2]).longValue();\n } catch (NumberFormatException unused) {\n return 0;\n }\n }", "public final void mo4369a(long j) {\n byte[] bArr;\n if (!zzut.f17550c || mo4375b() < 10) {\n while ((j & -128) != 0) {\n bArr = this.f20653b;\n int i = this.f20656e;\n this.f20656e = i + 1;\n bArr[i] = (byte) ((((int) j) & 127) | 128);\n j >>>= 7;\n }\n try {\n bArr = this.f20653b;\n int i2 = this.f20656e;\n this.f20656e = i2 + 1;\n bArr[i2] = (byte) ((int) j);\n return;\n } catch (long j2) {\n throw new zzc(String.format(\"Pos: %d, limit: %d, len: %d\", new Object[]{Integer.valueOf(this.f20656e), Integer.valueOf(this.f20655d), Integer.valueOf(1)}), j2);\n }\n }\n while ((j2 & -128) != 0) {\n bArr = this.f20653b;\n i = this.f20656e;\n this.f20656e = i + 1;\n dp.m11753a(bArr, (long) i, (byte) ((((int) j2) & 127) | 128));\n j2 >>>= 7;\n }\n bArr = this.f20653b;\n i2 = this.f20656e;\n this.f20656e = i2 + 1;\n dp.m11753a(bArr, (long) i2, (byte) ((int) j2));\n }", "public abstract long mo9743h();", "private int hashFunc(String input) {\n\t\tBigInteger value = BigInteger.valueOf(0);\n\t\tBigInteger k2 = new BigInteger(\"27\");\n\t\tchar c = input.charAt(0);\n\t\tlong i1 = (int) c - 96;\n\t\tBigInteger k1 = new BigInteger(\"0\");\n\t\tk1 = k1.add(BigInteger.valueOf(i1));\n\t\tvalue = k1;\n\n\t\tfor (int i = 1; i < input.length(); i++) {\n\n\t\t\tchar c2 = input.charAt(i);\n\n\t\t\tvalue = value.multiply(k2);\n\n\t\t\tlong i2 = (int) c2 - 96;\n\t\t\tBigInteger k3 = new BigInteger(\"0\");\n\t\t\tk3 = k3.add(BigInteger.valueOf(i2));\n\n\t\t\tvalue = value.add(k3);\n\n\t\t}\n\t\tBigInteger size = new BigInteger(\"0\");\n\t\tsize = size.add(BigInteger.valueOf(this.size));\n\t\tvalue = value.mod(size);\n\n\t\treturn value.intValue();\n\t}", "private int m145807c(int i) {\n int i2 = this.f119502d;\n this.f119502d = i2 + 1;\n return i | (i2 << 8);\n }", "public static void main(String[] args) {\n int i = 1;\n int n = 100;\n for(;i<=n;i++){\n System.out.println(\"i:\" + i);\n }\n\n BigInteger bigInteger = BigInteger.valueOf(111L);\n bigInteger.longValue();\n }", "public static void main(String[] args) {\n\t\tint a = 103217;\n\t\tSystem.out.println(AssortedMethods.toFullBinaryString(a));\n\t\tint b = 13;\n\t\tSystem.out.println(AssortedMethods.toFullBinaryString(b));\t\t\n\t\tint c = updateBits(a, b, 4, 12);\n\t\tSystem.out.println(AssortedMethods.toFullBinaryString(c));\n\t\t\t\n\t}", "public static String m3980s(String str, long j) {\n AppMethodBeat.m2504i(93201);\n String format;\n if (j == 0) {\n format = String.format(str + \";?enc=%d\", new Object[]{Long.valueOf(314159265)});\n AppMethodBeat.m2505o(93201);\n return format;\n }\n format = String.format(str + \";?enc=%d\", new Object[]{Long.valueOf(j)});\n AppMethodBeat.m2505o(93201);\n return format;\n }", "public static long m148010a(long j) {\n return j;\n }", "public static String solution() {\r\n\t\treturn \"73162890\";\r\n\t}", "private long m7156a(String str) {\n Matcher matcher = f5713d.matcher(str);\n return matcher.find() ? Long.parseLong(matcher.group(1)) : -1;\n }", "private static long getGeyserIdFromString(String appId){\n\t\ttry{\n\t\t\treturn new Long(appId.substring(appId.lastIndexOf(\"_\")+1));\n\t\t} catch (Exception e){\n\t\t\tlogger.error(\"Geyser ID failure. Using defualt ID '0000'\"); \n\t\t\treturn (long)0000;\n\t\t}\n\t}", "public static void main(String[] args) {\n int num;\n Random rd = new Random();\n num = 1+rd.nextInt(Integer.MAX_VALUE);\n System.out.println(\"原来的数为\"+num);\n while(num!=1) {\n \tSystem.out.println(\"产生的新数是\"+num);\n \tif(num%2==0) {\n \t\tnum = num/2;\n \t}else {\n \t\tnum=num*3+1;\n \t}\n }\n System.out.println(num);\n\t}", "long mo1154d();", "public static void main(String args[]) {\n\t\tBigDecimal start = new BigDecimal(\"2658455991569831744654692615953842176\");\n//\t\tBigDecimal start = new BigDecimal(\"8128\");\n//\t\tBigDecimal dd = start.divide(next, 0);\n//\t\tSystem.out.println(dd);\n\t\t\n\t\tList<BigDecimal> fs = new PerfectNumber().factor2(start, 10, null);\n\t\tBigDecimal multiply = new BigDecimal(1);\n\t\tBigDecimal sum = new BigDecimal(0);\n\t\tfor (BigDecimal d : fs) {\n\t\t\tSystem.out.println(d);\n\t\t\tmultiply = multiply.multiply(d);\n\t\t\tsum = sum.add(d);\n\t\t}\n\t\tSystem.out.println(\"sum = \" + sum);\n\t\tSystem.out.println(\"multiply = \" + multiply);\n\t}", "public static void main(String[] args) {\n byte a=25;\n short b=124;\n int c=200;\n long d=50000L+10L*(a+b+c);\n System.out.println (d);\n\n short az=(short)(1000+10*(a+b+c));\n System.out.println (az);\n\n\n\n }", "public abstract void mo20156a(long j);", "public abstract long mo9746k();", "long mo25074b();", "public int g(long j2) {\n long j3;\n if (j2 >= 0) {\n j3 = j2 / 86400000;\n } else {\n j3 = (j2 - 86399999) / 86400000;\n if (j3 < -3) {\n return ((int) ((j3 + 4) % 7)) + 7;\n }\n }\n return ((int) ((j3 + 3) % 7)) + 1;\n }", "short digits();", "private long m10267c(long j) {\r\n return (j << 1) ^ (j >> 63);\r\n }", "void mo24142a(long j);", "public static int m22579g(long j) {\n return 8;\n }", "public static long inputLong()\n\t{\n\t\treturn(sc.nextLong());\n\t}", "private static int threadId(long x) {\n return (int) ((x>>>48) & 0x7FFFL); // 1\n }", "private int getNumberBase(String n1){\n return Integer.parseUnsignedInt(n1, base);\n }", "public long mo1597a(long j) {\n return 0;\n }", "@Override\r\n public long problem2() {\r\n ArrayList<String> arrList = new ArrayList<>();\r\n long start = System.currentTimeMillis(); \r\n for(int i = 0; i<1234567; i++){\r\n arrList.add(Integer.toString(i));\r\n }\r\n long end = System.currentTimeMillis(); \r\n return end - start; \r\n }", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint input1 = sc.nextInt(); //input 값 입력\n\t\tint length1 = (int)(Math.log10(input1)+1); // input값 자릿수 저장\n\t\tint input2 = sc.nextInt();\n\t\tint length2 = (int)(Math.log10(input2)+1);\n\t\t\n\t\tString trans = String.valueOf(input2); //두번째 값 string형 변환\n\t\t\n\t\tchar [] arr = trans.toCharArray(); // 변환된 String char배열 변환\n\t\tint [] arr2 = new int[arr.length]; // arr의 값을 int형을 바꿀 배열\n\t\tint [] result = new int[arr2.length];//arr2의 값을 첫번째 input값과 계산하여 저장\n\n\t\t\n\t\tif(length1 < 3 || length1 > 3) { //자릿수 검사\n\t\t\tSystem.out.println(\"입력값의 자릿수는 3자리\");\n\t\t}else if(length2 <3 || length2 > 3) {\n\t\t\tSystem.out.println(\"입력값의 자릿수는 3자리\");\n\t\t}\n\t\tfor(int i = arr.length-1 ; i <= 0 ; i--) {\n\t\t\tSystem.out.println(arr[i]);\n\t\t}\n\t\t\n\t\t\n\t\tfor(int i = 0 ; i < arr2.length ; i++) { //int형 변환\n\t\t\tarr2[i] = arr[i] - '0';\n\t\t}\n\t\t\n\t\t\n\t\tint count = 100, sum = 0;\n\t\tfor(int i = 0 ; i < result.length ; i++) {\n\t\t\tresult[i] = input1*arr2[i]; //계산결과 저장\n\t\t\tsum += result[i] * count; // 계산결과 저장\n\t\t\tcount /= 10;\n\t\t}\n\t\t\n\t\tfor(int i = result.length-1 ; i >= 0 ; i--) { // 출력\n\t\t\tSystem.out.println(result[i]);\n\t\t}\n\t\tSystem.out.println(sum);\n\t\t\n\t\t\n\t\t\n\t}", "public static long D(long n) {\n\t\tlong count = 0;\n\t\n\t\tlong m = 9;\n\t\t// F(7) = 138, F(8) = 362\n\t\tlong recPrev=138;\n\t\tlong recCurrent=362;\n\n\t\twhile (n >= m) {\t\n\t\t\tif (m %6 == 0) {\n\t\t\t\tlong current = recCurrent;\n\t\t\t\trecCurrent = 3L*recCurrent-2*recPrev + 38L;\n\t\t\t\trecPrev = current;\n\t\t\t} else if (m%6== 1) {\n\t\t\t\tlong current = recCurrent;\n\t\t\t\trecCurrent = 3L*recCurrent-2*recPrev + 36L;\n\t\t\t\trecPrev = current;\n\t\t\t} else if (m%6==2 || m%6==3 || m%6==5) {\n\t\t\t\tlong current = recCurrent;\n\t\t\t\trecCurrent = 3L*recCurrent-2*recPrev + 32L;\n\t\t\t\trecPrev = current;\n\t\t\t} else /*(m%6==4)*/{\n\t\t\t\tlong current = recCurrent;\n\t\t\t\trecCurrent = 3L*recCurrent-2*recPrev + 30L;\n\t\t\t\trecPrev = current;\n\t\t\t}\n\t\t\trecPrev = recPrev % 87654321;\n\t\t\trecCurrent = recCurrent % 87654321;\t\n\t\t\tif (recCurrent == 0) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\tm +=1;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\treturn count;\n\n\t}", "private int m150332e(long j) {\n return m150326a(this.f111579b, j);\n }", "void mo30290d(long j);", "protected static final int getUnitId(String inputHex) {\r\n\t\t\r\n\t\tString msb = inputHex.substring(0, 2);\r\n\t\tString lsb = inputHex.substring(2, 4);\r\n\r\n\t\tint val = ( Integer.parseInt(msb, 16) * 256 ) + ( Integer.parseInt(lsb, 16) * 1 );\r\n//\t\tGQDKPMConstants.logger.debug(\"incoming lsb = \" + lsb +\" lsb hex-dec = \"+Integer.parseInt(lsb, 16) * 1 +\r\n//\t\t\t\t\" , msb = \"+ msb + \" msb hex-dec = \"+Integer.parseInt(msb, 16) * 256 + \" , val = \" + val );\r\n\t\treturn val;\r\n\t}", "void overflowDigits() {\n for (int i = 0; i < preDigits.length(); i++) {\n char digit = preDigits.charAt(i);\n // This could be implemented with a modulo, but compared to the main\n // loop this code is too quick to measure.\n if (digit == '9') {\n preDigits.setCharAt(i, '0');\n } else {\n preDigits.setCharAt(i, (char)(digit + 1));\n }\n }\n }", "public static int m22571e(long j) {\n if ((-128 & j) == 0) {\n return 1;\n }\n if (j < 0) {\n return 10;\n }\n int i;\n if ((-34359738368L & j) != 0) {\n i = 6;\n j >>>= 28;\n } else {\n i = 2;\n }\n if ((-2097152 & j) != 0) {\n i += 2;\n j >>>= 14;\n }\n if ((j & -16384) != 0) {\n i++;\n }\n return i;\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(removeKdigits(\"12305607890\", 4));\n\t}", "private static long m7404a(long j, long j2) {\n return (long) Math.floor(Math.pow((double) j, 1.0d / ((double) j2)));\n }", "private static long m26007a(String str, long j) {\n if (str == null || str.isEmpty()) {\n return C10442z4.m26659a(ByteBuffer.allocate(8).putLong(j).array());\n }\n byte[] bytes = str.getBytes(f26939b);\n ByteBuffer allocate = ByteBuffer.allocate(bytes.length + 8);\n allocate.put(bytes);\n allocate.putLong(j);\n return C10442z4.m26659a(allocate.array());\n }", "private static String m33072s(long j, String str) {\n AppMethodBeat.m2504i(135625);\n C4990ab.m7417i(\"MicroMsg.AppMsgLogic\", \"summerbig initDownloadAttach msgLocalId[%d], msgXml[%s], downloadPath[%s]\", Long.valueOf(j), str, null);\n C8910b me = C8910b.m16064me(str);\n if (me == null) {\n AppMethodBeat.m2505o(135625);\n return null;\n }\n String X = C21595a.m33066X(C6457e.euQ, me.title, me.fgp);\n if (C5046bo.isNullOrNil(me.csD) && !C5046bo.isNullOrNil(me.fgD)) {\n me.csD = me.fgD.hashCode();\n }\n String a = C21595a.m33067a(X, j, me.sdkVer, me.appId, me.csD, me.fgo, me.type, me.fgs);\n AppMethodBeat.m2505o(135625);\n return a;\n }", "private static long convertNumber(String text, int base)\r\n\t{\r\n\t\tlong result = 0;\r\n\t\ttext = text.toLowerCase();\r\n\t\tfor (int i = 2; i < text.length(); i++)\r\n\t\t{\r\n\t\t\tint d;\r\n\t\t\tchar c = text.charAt(i);\r\n\t\t\tif (c > '9')\r\n\t\t\t\td = (int) (c - 'a') + 10;\r\n\t\t\telse\r\n\t\t\t\td = (int) (c - '0');\r\n\t\t\tresult = (result * base) + d;\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public static void main(String[] aArg) {\n int j = 1214740;\n int i;\n int z = 0;\n \n \n while (j > 5) {\n i = j;\n j--;\n Console.write(\"Badum\"); // + j +\"\\n\");\n \n \n while (i > 5) {\n if ((i % 2) == 0) {\n i = i / 2;\n } else {\n i = 1 + (i * 3);\n z++;\n }\n }\n \n \n }\n //System.out.println(z);\n if (z == 52591218)\n Console.write(\"Yahy!\");\n else\n Console.write(\"Nahy!\");\n }", "private static String bigIntDecode(String in){\n\n\t BigInteger largeNum = new BigInteger(in); // declare and initialize the largenum\n\t\t//\n\t BigInteger smallNum = largeNum.divide(key); // reverse math done in encryption\n\tSystem.out.println(\"--------------------------------------------------------------------------------------------------------------------------\");\n\tSystem.out.println( \"Char Value *Must subtract shift now*: \" + smallNum.toString());\n\t\tSystem.out.println(\"--------------------------------------------------------------------------------------------------------------------------\\n\\n\");\n\t in = smallNum.toString(); //updates in to the small original big int\n\n\n\t String r = \"\"; // empty result string\n\n\t for(int i = 0; i < in.length();i += 3){ // for loop to extract each 3 nums and get ascii value\n\n\t char add; // declars the char to be added\n\n\t if(in.length() < 2){ //if to determine and handle short encryption\n\t add = (char)(Integer.parseInt(in.substring(i, i + 3)) - shift);\n\n\t }else{ // else, countine as normal, substring each 2 numbers and convert to ascii letter\n\t add = (char)(Integer.parseInt(in.substring(i, i + 3)) - shift );\n\n\t }\n\n\t r+= add; // updates result string\n\t }\n\t\t\t\t\t\tSystem.out.println(\"--------------------------------------------------------------------------------------------------------------------------\");\n\t\t\t\t\tSystem.out.println(\" Decrypted Message Found: \" + r);\n\t\t\t\t\t\tSystem.out.println(\"--------------------------------------------------------------------------------------------------------------------------\\n\\n\");\n\t return r; // returns result string\n\t }", "long part2(long[] input) {\n\t\tString[] inarr = { //\n\t\t\t\t\"A,B,A,B,C,C,B,C,B,A\", //\n\t\t\t\t\"R,12,L,8,R,12\", //\n\t\t\t\t\"R,8,R,6,R,6,R,8\", //\n\t\t\t\t\"R,8,L,8,R,8,R,4,R,4\"//\n\t\t};\n\t\tinput[0] = 2;\n\t\tIntCode ic = new IntCode();\n\t\tic.setStack(input);\n\t\tint state = ic.execIO();\n\t\tint inArrI = 0;\n\t\tint inArrJ = 0;\n\t\tboolean observing = false;\n\t\twhile (state != IntCode._STATE_HALT) {\n\t\t\tif (observing) {\n\t\t\t\tic.setInput(10);\n\t\t\t\tList<Long> out = ic.getAndResetOutput();\n\t\t\t\tprintGrid(longListToGrid(out));\n\t\t\t} else if (inArrI >= inarr.length) {\n\t\t\t\tic.setInput((int) 'n');\n\t\t\t\tstate = ic.execIO();\n\t\t\t\tic.setInput(10);\n\t\t\t\tstate = ic.execIO();\n\t\t\t\tbreak;\n//\t\t\t\tobserving = true;\n\t\t\t} else if (inArrJ >= inarr[inArrI].length()) {\n\t\t\t\tic.setInput(10);\n\t\t\t\tinArrI++;\n\t\t\t\tinArrJ = 0;\n\t\t\t} else {\n\t\t\t\tic.setInput((int) inarr[inArrI].charAt(inArrJ++));\n\t\t\t}\n\t\t\tstate = ic.execIO();\n\t\t}\n\t\tList<Long> out = ic.getOutputList();\n\t\treturn out.get(out.size() - 1);\n\t}", "private static long m45374Tj(String str) {\n AppMethodBeat.m2504i(104873);\n try {\n int la;\n int la2;\n String[] split = str.split(VideoMaterialUtil.FRAMES_ID_SEPARATOR_3D);\n int la3 = C39444d.m67388la(split[0]);\n if (split.length > 1) {\n split = split[1].split(\"\\\\.\");\n la = C39444d.m67388la(split[0]);\n la2 = split.length > 1 ? C39444d.m67388la(split[1]) : 0;\n } else {\n la2 = 0;\n la = 0;\n }\n long j = ((long) (la2 * 10)) + (((long) (la * 1000)) + ((((long) la3) * 60) * 1000));\n AppMethodBeat.m2505o(104873);\n return j;\n } catch (Exception e) {\n C4990ab.printErrStackTrace(\"MicroMsg.Music.LyricObj\", e, \"\", new Object[0]);\n C4990ab.m7421w(\"MicroMsg.Music.LyricObj\", \"strToLong error: %s\", e.getLocalizedMessage());\n AppMethodBeat.m2505o(104873);\n return 0;\n }\n }", "private static String digits(long val, int digits) {\n\tlong hi = 1L << (digits * 4);\n\treturn Long.toHexString(hi | (val & (hi - 1))).substring(1);\n }", "public abstract long mo9755t();" ]
[ "0.6410471", "0.63607025", "0.63229114", "0.62054634", "0.6184625", "0.6175383", "0.6098209", "0.6026053", "0.60103047", "0.5961886", "0.5947119", "0.5911927", "0.5896705", "0.58939964", "0.5869418", "0.5864519", "0.5847303", "0.5834319", "0.58321834", "0.57860273", "0.57774234", "0.5769696", "0.5746647", "0.57268816", "0.56927776", "0.56822175", "0.5667645", "0.5658573", "0.565257", "0.5648365", "0.56441456", "0.56417936", "0.56234044", "0.5617994", "0.5617953", "0.5616357", "0.561368", "0.56087846", "0.5608496", "0.5586515", "0.55844885", "0.55736274", "0.55704343", "0.55701697", "0.55686283", "0.55584645", "0.555777", "0.5550037", "0.5548933", "0.5546101", "0.5544816", "0.5528478", "0.55082226", "0.54960954", "0.54918647", "0.5491348", "0.54903036", "0.5488986", "0.5485819", "0.5485696", "0.5480794", "0.5474854", "0.5474048", "0.5471897", "0.5468468", "0.54635406", "0.54632455", "0.54623264", "0.5460757", "0.54569805", "0.5443935", "0.544291", "0.544076", "0.5434949", "0.5434561", "0.5432517", "0.5431834", "0.54295987", "0.5427812", "0.5423053", "0.5419604", "0.54193807", "0.5417131", "0.5414869", "0.5400144", "0.5396271", "0.53940296", "0.5391851", "0.5391429", "0.5391122", "0.5390835", "0.5386591", "0.5384466", "0.5376528", "0.53754807", "0.5371772", "0.53684944", "0.5368423", "0.53680056", "0.53615236" ]
0.6182498
5
Creates new form LoginPage
public LoginPage() { initComponents(); Point center = GraphicsEnvironment.getLocalGraphicsEnvironment().getCenterPoint(); int windowWidth = this.getWidth(); int windowHeight = this.getHeight(); this.setBounds(center.x - windowWidth / 2, center.y - windowHeight / 2, windowWidth, windowHeight); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setVisible(true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public LoginPage goToLoginPage() {\n loginButton.click();\n return new LoginPage();\n }", "NewAccountPage openNewAccountPage();", "public LoginPage(){\n\t\tPageFactory.initElements(driver, this);\n\t\t\n\t}", "public LoginPage() {\n }", "public LoginPage(){\n\t\tPageFactory.initElements(driver, this);\n\t}", "public loginPage() {\n\t\tPageFactory.initElements(driver, this);\n\t}", "public LoginPage() {\n\t\tPageFactory.initElements(driver, this);\n\t}", "public LoginPage() {\n\t\tPageFactory.initElements(driver, this);\n\t}", "public LoginPage() {\n initComponents();\n }", "public Loginpage()\n\t{\n\t\tPageFactory.initElements(driver, this);\n\t}", "public LoginPage() {\n {\n }\n initComponents();\n\n }", "public LoginPage()\r\n\t{\r\n\t\tPageFactory.initElements(driver,this);\r\n\t}", "public pageLogin() {\n initComponents();\n labelimage.setBorder(new EmptyBorder(0,0,0,0));\n enterButton.setBorder(null);\n enterButton.setContentAreaFilled(false);\n enterButton.setVisible(true);\n usernameTextField.setText(\"Username\");\n usernameTextField.setForeground(new Color(153,153,153));\n passwordTextField.setText(\"Password\");\n passwordTextField.setForeground(new Color(153,153,153));\n usernameAlert.setText(\" \");\n passwordAlert.setText(\" \");\n \n }", "public LoginPage() {\r\n\t\t\t\r\n\t\t\t//Initialize webElements.\r\n\t\t\tPageFactory.initElements(driver, this);\r\n\t\t}", "void goToLogin() {\n mainFrame.setPanel(panelFactory.createPanel(PanelFactoryOptions.panelNames.LOGIN));\n }", "public LoginPage()\n{\n\tPageFactory.initElements(driver, this);\n}", "public MainPage submitForm() {\n LOGGER.info(\"Clicked the button 'LOGIN'\");\n clickOnElement(loginButtonLocator);\n return MainPage.Instance;\n }", "private Component createLogin() {\n CustomLayout custom = new CustomLayout(\"../../sampler/layouts/examplecustomlayout\");\n\n // Create components and bind them to the location tags\n // in the custom layout.\n username = new TextField();\n custom.addComponent(username, \"username\");\n\n password = new PasswordField();\n custom.addComponent(password, \"password\");\n\n Button ok = new Button(\"Login\");\n custom.addComponent(ok, \"okbutton\");\n\n // Add login listener\n ok.addListener(this);\n\n return custom;\n\n }", "public Login() \n {\n super();\n create();\n this.setVisible(true);\n initComponents();\n }", "public PageBase click_on_login_submit_form_button () {\r\n HomePageClass homePage = new HomePageClass(driver);\r\n\r\n LGN_Login_submitBTN.click();\r\n\r\n WebDriverWait wait = getWait();\r\n wait.until(ExpectedConditions.visibilityOf(homePage.logout));\r\n\r\n return homePage;\r\n\r\n }", "public loginForm() {\n initComponents();\n \n }", "public AdminLogInPage() {\n initComponents();\n }", "public AccountPage Signup_through_loginpage() {\n\tJavascriptExecutor js = (JavascriptExecutor)driver;\n\tjs.executeScript( \"arguments[0].click();\", SignUpButton );\n\tsignupPage.SignUp_Form();\n\treturn new AccountPage();\n\t}", "public LoginPOJO() {\n\n\t\tPageFactory.initElements(driver, this);\t\n\t}", "public Form getLoginForm() {\n if (LoginForm == null) {//GEN-END:|14-getter|0|14-preInit\n // write pre-init user code here\n LoginForm = new Form(\"Welcome\", new Item[]{getTextField()});//GEN-BEGIN:|14-getter|1|14-postInit\n LoginForm.addCommand(getExitCommand());\n LoginForm.addCommand(getOkCommand());\n LoginForm.setCommandListener(this);//GEN-END:|14-getter|1|14-postInit\n // write post-init user code here\n }//GEN-BEGIN:|14-getter|2|\n return LoginForm;\n }", "public LoginPage(String username, String password, String userType) {\n\t\tsuper();\n\t\tthis.username=username;\n\t\tthis.password=password;\n\t\tthis.userType=userType;\n\t\t\n\t}", "public login() {\n initComponents();\n \n \n }", "private static void postLoginPage() {\n post(\"/login\", \"application/json\", (req, res) -> {\n HomerAccount loggedInAccount = homerAuth.login(req.body());\n if(loggedInAccount != null) {\n req.session().attribute(\"account\", loggedInAccount);\n res.redirect(\"/team\");\n } else {\n res.redirect(\"/login\");\n }\n return null;\n });\n }", "public frm_LoginPage() {\n initComponents();\n setIcon();\n txt_userName.setText(\"\");\n txt_userName.requestFocus();\n password_password.setText(\"\");\n }", "public login() {\n initComponents();\n }", "public void CreateAccount(View view)\n {\n Toast.makeText(getApplicationContext(), \"Redirecting...\", \n Toast.LENGTH_SHORT).show();\n Intent i = new Intent(LoginView.this, Page_CreateAccount.class);\n startActivity(i);\n }", "public static Result login(){\n String username= Form.form().bindFromRequest().get(\"username\");\n String password= Form.form().bindFromRequest().get(\"password\");\n String new_user= Form.form().bindFromRequest().get(\"new_user\");\n if(new_user != null){\n return ok(login.render(username,password));\n } else {\n Skier s=Session.authenticate(username,password);\n if(s==null){\n return badRequest(index.render(\"Invalid Username or Password\"));\n } else {\n login(s);\n return redirect(\"/home\");\n }\n }\n }", "public LoginPageTest()\n\t{\n\t\tsuper();\n\t}", "public LoginPageActions Navigate_LoginPage()\n\t{\n\t\t\n\t\tUIActions.fn_click(HomePageObjects.customerAccount);\n\t\treturn new LoginPageActions();\n\t}", "public Page_Home doDefaultLogin() {\n\t\tLogStatus.info(\"Logging in with username :: \\'\" + TestUtils.getValue(\"username\") + \"\\' and password :: \\'\"\n\t\t\t\t+ TestUtils.getValue(\"password\") + \"\\'\");\n\t\tDriverManager.getDriver().findElement(By.name(\"username\")).sendKeys(TestUtils.getValue(\"username\"));\n\t\tDriverManager.getDriver().findElement(By.name(\"password\")).sendKeys(TestUtils.getValue(\"password\"));\n\t\tDriverManager.getDriver().findElement(By.id(\"Registration Desk\")).click();\n\t\tDriverManager.getDriver().findElement(By.id(\"loginButton\")).click();\n\n\t\treturn new Page_Home();\n\n\t}", "public void goToLoginPage()\n\t{\n\t\tclickAccountNameIcon();\n\t\tclickSignInLink();\n\t}", "@AutoGenerated\r\n\tprivate Panel buildPnlLogin() {\n\t\tpnlLogin = new Panel();\r\n\t\tpnlLogin.setImmediate(false);\r\n\t\tpnlLogin.setWidth(\"-1px\");\r\n\t\tpnlLogin.setHeight(\"500px\");\r\n\t\t\r\n\t\t// layoutLogin\r\n\t\tlayoutLogin = buildLayoutLogin();\r\n\t\tpnlLogin.setContent(layoutLogin);\r\n\t\t\r\n\t\treturn pnlLogin;\r\n\t}", "private MarkupContainer createLoginFragment() {\r\n return new Fragment(CONTENT_VIEW, LOGIN_FRAGMENT, this)\r\n .add(new LoginPanel(PART_LOGIN_VIEW, LoginPanel.NextPage.CART))\r\n .add(new RegisterPanel(PART_REGISTER_VIEW, RegisterPanel.NextPage.CART))\r\n .add(new GuestPanel(PART_GUEST_VIEW));\r\n }", "public LoginPageController() {\n\t}", "public T01Login() {\n initComponents();\n btnMenu.setVisible(false);\n }", "protected String getLoginPage() {\r\n return loginPage;\r\n }", "Page createPage();", "public Login() {\n initComponents();\n \n }", "public void goToLoginPage(ActionEvent event) throws IOException{\n\t\t//this should return to the Login Page\n\t\tParent user_page = FXMLLoader.load(getClass().getResource(\"/view/LoginPage.fxml\"));\n\t\tScene userpage_scene = new Scene(user_page);\n\t\tStage app_stage = (Stage) ((Node) (event.getSource())).getScene().getWindow();\n\t\tapp_stage.setScene(userpage_scene);\n\t\tapp_stage.setTitle(\"Login Page\");\n\t\tapp_stage.show();\n\t}", "public HomePage loginAs(String username, String password) {\n // The PageObject methods that enter username, password & submit login have\n // already defined and should not be repeated here.\n typeUserName(username);\n typePassword(password);\n return clickOnSignInButton();\n }", "Login() { \n }", "public LoginPage(){\n PageFactory.initElements(driver, this); //all vars in this class will be init with this driver\n }", "public void showPage(){\n\t\tflexTable.setWidget(0, 0, lblNome);\n\t flexTable.setWidget(0, 1, nomePratoBox);\n\t flexTable.setWidget(0, 2, pesquisarButton);\n\t\t\n\t initWidget(flexTable);\n\t \n\t\tRootPanel formRootPanel = RootPanel.get(\"loginContainer\");\n\t\tformRootPanel.add(this);\n\t}", "@Override\n\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tloginPage = new LoginGUI();\n\t\t\t\t\t} catch (ClassNotFoundException | IOException e1) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\tloginPage.setVisible(true);\n\t\t\t\t\t\n\t\t\t\t\tdispose();\n\t\t\t\t}", "private void genLoginGui(){\n loginFrame = new JFrame(\"Log in\");\n\n // login panel, inputs name\n loginPanel = new JPanel();\n loginPanel.setLayout(new FlowLayout());\n nameLabel = new JLabel(\"Name\");\n nameTextFiled = new JTextField();\n nameTextFiled.setPreferredSize(new Dimension(100, 20));\n nameTextFiled.addActionListener(clientAction);\n nameTextFiled.setActionCommand(\"ENTERROOM\");\n\n btnEnterRoom = new JButton(\"Enter Room\");\n btnEnterRoom.addActionListener(clientAction);\n btnEnterRoom.setActionCommand(\"ENTERROOM\");\n\n loginPanel.add(nameLabel);\n loginPanel.add(nameTextFiled);\n loginPanel.add(btnEnterRoom);\n\n loginFrame.add(loginPanel, BorderLayout.CENTER);\n\n loginFrame.setSize(700, 500);\n loginFrame.setLocation(0, 200);\n loginFrame.add(loginPanel);\n loginFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n loginFrame.setVisible(true);\n }", "public FormLogin() {\n initComponents();\n open_db();\n setLocationRelativeTo(this);\n }", "public DashboardPage clickLogin() {\n driver.findElement(By.id(\"login-button\")).click();\n return new DashboardPage(driver);\n }", "public void LoginButton() {\n\t\t\r\n\t}", "public Login() {\n initComponents();\n \n }", "@Override\n\tpublic void goToLogin() {\n\t\t\n\t}", "public void createHomePage(){\n\t\tsetLayout(new GridBagLayout());\n\t\tGridBagConstraints c = new GridBagConstraints(); \n\t\t//insert username and password fields\n\t\tJLabel title;\n\n\t\t//build the title panel\n\t\ttitlePanel = new JPanel();\n\t\ttitle = new JLabel(\"Budgie\");\n\t\ttitle.setSize(new Dimension(40, 40));\n\t\ttitlePanel.add(title);\n\n\t\tc.anchor = GridBagConstraints.CENTER;\n\t\tc.gridy = 0;\n\t\tc.weighty = .5;\n\t\tadd(titlePanel, c);\n\n\t\tinputField = addinputField();\n\n\t\t//positioning of the grid field\n\t\tc.fill = GridBagConstraints.HORIZONTAL;\n\t\tc.gridy = 1;\n\t\tc.ipady = 10;\n\t\tc.weighty = .5;\n\t\tadd(inputField, c);\n\n\t\tc.gridy++;\n\t\tJButton debug = new JButton(\"Debug\");\n\t\tdebug.addActionListener(new ActionListener(){\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tDebugPrinter.toggleDebug();\n\t\t\t}\n\n\t\t});\n\t\tadd(debug,c);\n\n\n\t\tpack();\n\n\n\t}", "public Login() {\n initComponents();\n }", "public Login() {\n initComponents();\n }", "public Login() {\n initComponents();\n }", "public Login() {\n initComponents();\n }", "public Login() {\n initComponents();\n }", "public Login() {\n initComponents();\n }", "public Login() {\n initComponents();\n }", "public Login() {\n initComponents();\n }", "public Login() {\n initComponents();\n }", "public Login() {\n initComponents();\n }", "public Login() {\n initComponents();\n }", "public Login() {\n initComponents();\n }", "public Login() {\n initComponents();\n }", "public Login() {\n initComponents();\n }", "public Login() {\n initComponents();\n }", "public Login() {\n initComponents();\n }", "public LoginController(LoginForm form) {this.loginForm = form;}", "public DashboardPage clickloginButton (){\n driver.findElement(loginButton).click ();\n\n return new DashboardPage (driver);\n }", "public void navLogin() {\n container.getChildren().clear();\n loginText.setText(\"Vennligst skriv inn brukernavn og passord:\");\n Label name = new Label(\"Brukernavn:\");\n Label pwd = new Label(\"Passord:\");\n TextField username = new TextField(); /* Lager tekstfelt */\n username.getStyleClass().add(\"textField\");\n PasswordField password = new PasswordField(); /* Ditto */\n password.getStyleClass().add(\"textField\");\n password.setOnAction(new EventHandler<ActionEvent>() {\n public void handle(ActionEvent args) {\n handleLogin(login.checkLogin(username.getText(), password.getText()));\n }\n });\n username.getStyleClass().add(\"inpDefault\");\n password.getStyleClass().add(\"inpDefault\");\n Button logIn = new Button(\"Logg inn\"); /* Laget knapp, Logg inn */\n Button register = new Button(\"Registrer deg\"); /* Skal sende deg til en side for registrering */\n HBox buttons = new HBox();\n buttons.getChildren().addAll(logIn, register);\n container.setPadding(new Insets(15, 12, 15, 12));\n container.setSpacing(5);\n container.getChildren().addAll(loginText, name, username, pwd, password, buttons);\n register.setOnMouseClicked(event -> navRegister());\n logIn.setOnMouseClicked(event -> handleLogin(login.checkLogin(username.getText(), password.getText())));\n }", "public LoginBackendPage() {\n\t\t PageFactory.initElements(driver, this);\n\t}", "public login() {\n\n initComponents();\n \n usuarios.add(new usuarios(\"claudio\", \"claudioben10\"));\n usuarios.get(0).setAdminOno(true);\n \n }", "public void premutoLogin()\n\t{\n\t\tnew _FINITO_funzione_loginGUI();\n\t}", "private Widget createLoginPanel(final IViewContext<ICommonClientServiceAsync> viewContext)\n {\n DockPanel loginPanel = new DockPanel();\n // WORKAROUND The mechanism behind the autofill support does not work in testing\n if (!GWTUtils.isTesting())\n {\n final LoginPanelAutofill loginWidget = LoginPanelAutofill.get(viewContext);\n loginPanel.add(loginWidget, DockPanel.CENTER);\n } else\n {\n final LoginWidget loginWidget = new LoginWidget(viewContext);\n loginPanel.add(loginWidget, DockPanel.CENTER);\n }\n return loginPanel;\n }", "protected void login() {\n\t\t\r\n\t}", "public LoginForm() {\n initComponents();\n }", "public MainView() {\r\n LoginOverlay login = new LoginOverlay();\r\n login.setOpened(true);\r\n LoginI18n i18n = LoginI18n.createDefault();\r\n i18n.setHeader(new LoginI18n.Header());\r\n i18n.getHeader().setTitle(\"Webvision\");\r\n i18n.getHeader().setDescription(\"Please login, if you don't have an account you will be redirected to finish registration.\");\r\n i18n.getForm().setUsername(\"Email\");\r\n i18n.getForm().setPassword(\"Password\");\r\n login.setI18n(i18n);\r\n login.addLoginListener(event -> {\r\n String email = event.getUsername();\r\n User user = userService.findByEmail(email);\r\n if (user == null) {\r\n login.close();\r\n UI.getCurrent().navigate(RegistrationView.ROUTE);\r\n } else {\r\n String password = event.getPassword();\r\n boolean isAuthenticated = password.equals(user.getPassword());\r\n if (isAuthenticated) {\r\n CurrentUser.setCurrentUser(user);\r\n login.close();\r\n UI.getCurrent().navigate(HomeView.ROUTE);\r\n }\r\n login.setError(true);\r\n }\r\n });\r\n add(login);\r\n }", "public Login() {\n initComponents();\n this.setTitle(\"Login\");\n setLocationRelativeTo(null);\n }", "public static void login() {\n\t\trender();\n\t}", "public void login() {\n\n String username = usernameEditText.getText().toString();\n String password = passwordEditText.getText().toString();\n regPresenter.setHost(hostEditText.getText().toString());\n regPresenter.login(username, password);\n }", "@Override public void onNewViewStateInstance() {\n showLoginForm();\n }", "public static LoginPage getInstance() {\n\t\tif (loginPage == null)\n\t\t\tloginPage = new LoginPage();\n\t\treturn loginPage;\n\t}", "public Login() {\n initComponents();\n hideregister ();\n }", "public LoginPanel(Controller theController) {\n\t\tsuper();\n\t\tmyController = theController;\n\t\tusername = new JTextField();\n\t\tpassword = new JPasswordField();\n\t\tsubmit = new JButton(\"Login\");\n\t\tcreate();\n\t}", "public Login() {\n\t\tinitComponents();\n\t\tthis.setTitle(\"学生成绩管理系统-登录\");\n\t\tthis.setResizable(false);\n\t\tthis.setLocationRelativeTo(null);\n\t}", "private void goToLoginPage() {\n\n startActivity(new Intent(this,LoginActivity.class));\n finish();\n }", "public void login() {\n presenter.login(username.getText().toString(), password.getText().toString());\n }", "public Login() {\n initComponents();\n KiemTraKN();\n }", "public HomePage login(String userId, String password) {\n\t\tthis.enterUserId(userId);\n\t\tthis.enterPassword(password);\n\t\tthis.clickOnLoginButton();\n\t\treturn new HomePage();\n\t}", "public Login() {\n initComponents();\n setDefaultCloseOperation(HIDE_ON_CLOSE);\n }", "public login() {\n initComponents();\n setTitle(\"COLLAGE MANAGEMENT SYSTEM\");\n }", "public Login() {\n initComponents();\n this.setTitle(\"Login\");\n this.setLocationRelativeTo(null);\n this.pack();\n // Asignanado objecto\n adminUsers = new usuarioAdmin();\n \n // No hay inicializacion de usuarios\n sys.us[0] = new Usuario();\n sys.us[0].setId(\"admin\");\n sys.us[0].setNombre(\"admin\");\n sys.us[0].setApellido(\"admin\");\n sys.us[0].setUser(\"admin\");\n sys.us[0].setPassword(\"admin\");\n sys.us[0].setRol(\"admin\");\n }", "public void loginBuilder(){\n loginFrame = new JFrame(\"Coronos Login\");\n loginFrame.setLayout(new GridLayout(3, 1));\n\n jpUserName = new JPanel(new FlowLayout());\n jtfUserNameField = new JTextField(10);\n userNameLabel = new JLabel(\"Username:\");\n userNameLabel.setLabelFor(jtfUserNameField);\n jpUserName.add(userNameLabel);\n jpUserName.add(jtfUserNameField);\n loginFrame.add(jpUserName);\n \n jpPassWord = new JPanel(new FlowLayout());\n passWordField = new JPasswordField(10);\n passWordLabel = new JLabel(\"Password:\");\n passWordField.addActionListener(this);\n passWordField.setActionCommand(\"Login\");\n passWordLabel.setLabelFor(passWordField);\n jpPassWord.add(passWordLabel);\n jpPassWord.add(passWordField);\n loginFrame.add(jpPassWord);\n \n jpOptions = new JPanel(new FlowLayout());\n loginButton = new JButton(\"Login\");\n loginButton.addActionListener(this);\n showPassword = new JButton(\"Reveal Password\");\n showPassword.addActionListener(this);\n jpOptions.add(loginButton);\n jpOptions.add(showPassword);\n loginFrame.add(jpOptions);\n \n loginFrame.setLocationRelativeTo(null);\n loginFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n loginFrame.setVisible(true);\n loginFrame.pack();\n }", "public ForgotPasswordPage goToNewPasswordPage(){\n\n botStyle.click(forgotPasswordLink);\n\n return PageFactory.initElements(driver, ForgotPasswordPage.class);\n }", "@FXML\n\tprivate void handleLogin() {\n\t \n\t\t\t\ttry {\n\t\t\t\t\tmain.showHomePageOverview(username.getText(),password.getText());\n\t\t\t\t} catch (SQLException 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\n\t}", "public Login(){\n\t\tthis.setTitle(\"DSI | Sokoban\");\n\t\tvalido = false;\n\t\tthis.getContentPane().setLayout(new FlowLayout());\n\t\tcrearLabels();\n\t\tcrearBotones();\n\t\tthis.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tthis.setPreferredSize(new Dimension(250, 200));\n\t\tthis.pack();\n\t\tthis.setResizable(false);\n\t\tthis.setVisible(true);\n\t\tthis.setLocationRelativeTo(null);\n\t}" ]
[ "0.7168578", "0.70983094", "0.70101553", "0.70043707", "0.69167566", "0.6892679", "0.68264717", "0.68264717", "0.68202186", "0.6750295", "0.6722954", "0.6720724", "0.66444165", "0.6623645", "0.65569925", "0.6484977", "0.64452696", "0.63838017", "0.63757974", "0.6347774", "0.63309985", "0.6327657", "0.6323692", "0.6319348", "0.63071686", "0.6304875", "0.63000554", "0.6279557", "0.6272221", "0.6222091", "0.6218523", "0.6214268", "0.6191697", "0.6191351", "0.6177407", "0.6168418", "0.6160821", "0.6157151", "0.615572", "0.6154285", "0.6144443", "0.61420697", "0.6134295", "0.61279535", "0.6125535", "0.61102533", "0.61069304", "0.60761607", "0.60738826", "0.6061842", "0.606052", "0.6045864", "0.60434026", "0.6043402", "0.6012965", "0.60086125", "0.5991886", "0.5991886", "0.5991886", "0.5991886", "0.5991886", "0.5991886", "0.5991886", "0.5991886", "0.5991886", "0.5991886", "0.5991886", "0.5991886", "0.5991886", "0.5991886", "0.5991886", "0.5991886", "0.5983498", "0.5973476", "0.5967914", "0.596764", "0.5961892", "0.5942265", "0.5941742", "0.5907801", "0.59061444", "0.59039044", "0.5901137", "0.58912003", "0.58911145", "0.58900493", "0.58897215", "0.58765197", "0.58700013", "0.5863555", "0.58631456", "0.5861933", "0.58597684", "0.585642", "0.5855185", "0.58432174", "0.5824742", "0.58227587", "0.5819409", "0.5807139", "0.58063805" ]
0.0
-1
for testing purposes until we can figure out how to mock firebase
public RegistrationInteractor(String s){ this.theUser = new User(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private FirebaseUtil(){}", "private FirebaseDAO() {}", "public static void setupFirebase(Context context) {\n // initialised Firebase\n com.firebase.client.Firebase.setAndroidContext(context);\n }", "private void initFirebase() {\n FirebaseApp.initializeApp(this);\n firebaseDatabase = FirebaseDatabase.getInstance();\n databaseReference = firebaseDatabase.getReference();\n storageReference = FirebaseStorage.getInstance().getReference();\n }", "public interface FirebaseService {\n public void init();\n}", "private void initFirebase() {\n //инициализируем наше приложение для Firebase согласно параметрам в google-services.json\n // (google-services.json - файл, с настройками для firebase, кот. мы получили во время регистрации)\n FirebaseApp.initializeApp(this);\n //получаем точку входа для базы данных\n database = FirebaseDatabase.getInstance();\n myRef = database.getReference();\n\n }", "private void iniciarFirebase(){\n FirebaseApp.initializeApp(getApplicationContext());\n firebaseDatabase = FirebaseDatabase.getInstance();\n databaseReference = firebaseDatabase.getReference();\n }", "private void testFirebase() {\n Intent launchIntent = new Intent(this, HomeActivity.class);\n launchIntent.putExtra(Constants.FIREBASE_ACTION, true);\n launchIntent.putExtra(Constants.FIREBASE_TITLE, \"Sample Title\");\n launchIntent.putExtra(Constants.FIREBASE_BODY, \"Sample Body\");\n PendingIntent pendingIntent = PendingIntent.getActivity(this, 0 /* Request code */, launchIntent,\n PendingIntent.FLAG_UPDATE_CURRENT);\n Bitmap rawBitmap = BitmapFactory.decodeResource(getResources(),\n R.mipmap.ic_launcher_round);\n NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)\n .setSmallIcon(R.drawable.ic_stat_notif_icon_firebase_om)\n .setLargeIcon(rawBitmap)\n .setContentTitle(getResources().getString(R.string.app_name))\n .setContentText(\"Sample body\")\n .setAutoCancel(true)\n .setContentIntent(pendingIntent);\n\n NotificationManager notificationManager =\n (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n\n Notification notification = notificationBuilder.build();\n notification.flags |= Notification.FLAG_NO_CLEAR;\n\n notificationManager.notify(0 /* ID of notification */, notification);\n }", "private void initFirebase() {\n database = FirebaseDatabase.getInstance();\n user = FirebaseAuth.getInstance().getCurrentUser();\n dRef = database.getReference(\"Trails\");\n }", "@Override\n public void onVerificationFailed(FirebaseException e) {\n // displaying error message with firebase exception.\n Toast.makeText(MainActivity.this, e.getMessage(), Toast.LENGTH_LONG).show();\n }", "private void setupFirebaseAuth(){\n Log.d(TAG, \"setupFirebaseAuth: setting up firebase auth.\");\n\n mAuth = FirebaseAuth.getInstance();\n mFirebaseDatabase = FirebaseDatabase.getInstance();\n myRef = mFirebaseDatabase.getReference();\n\n mAuthListener = new FirebaseAuth.AuthStateListener() {\n @Override\n public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {\n FirebaseUser user = firebaseAuth.getCurrentUser();\n\n if (user != null) {\n // User is signed in\n Log.d(TAG, \"onAuthStateChanged:signed_in:\" + user.getUid());\n } else {\n // User is signed out\n Log.d(TAG, \"onAuthStateChanged:signed_out\");\n }\n // ...\n }\n };\n\n\n }", "@Override\n public void onVerificationFailed(FirebaseException e) {\n\n Toast.makeText(MainActivity.this, e.getMessage(), Toast.LENGTH_LONG).show();\n }", "private void createDependencies(){\n client = new FireStoreClient(this);\n authentication = new FirestoreAuthentication();\n }", "public AndroidInterfaceClass(){\n database = FirebaseDatabase.getInstance(\"https://brainstorming-1fa06-default-rtdb.europe-west1.firebasedatabase.app/\");\n }", "@Override\n public void onCancelled(FirebaseError firebaseError) {\n }", "private void setupFirebaseAuth(){\r\n Log.d(TAG, \"setupFirebaseAuth: setting up setupFirebaseAuth\");\r\n\r\n mAuth = FirebaseAuth.getInstance();\r\n mFirebaseDatabase = FirebaseDatabase.getInstance();\r\n myRef = mFirebaseDatabase.getReference();\r\n\r\n mAuthListener = new FirebaseAuth.AuthStateListener() {\r\n @Override\r\n public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {\r\n FirebaseUser user = firebaseAuth.getCurrentUser();\r\n\r\n if (user != null) {\r\n // User is signed in\r\n Log.d(TAG, \"onAuthStateChanged:signed_in:\" + user.getUid());\r\n } else {\r\n // User is signed out\r\n Log.d(TAG, \"onAuthStateChanged:signed_out\");\r\n }\r\n // ...\r\n }\r\n };\r\n\r\n myRef.addValueEventListener(new ValueEventListener() {\r\n @Override\r\n public void onDataChange(DataSnapshot dataSnapshot) {\r\n\r\n // retrieve user info from database\r\n// setProfileWidgets(mFirebaseMethods.getUserSettings(dataSnapshot));\r\n\r\n // retrieve job Post info from database\r\n// setJobPost(mFirebaseMethods.getUserSettings(dataSnapshot));\r\n// mFirebaseMethods.addNewJobPost(job_date,job_description, job_title,user_name );\r\n\r\n //retrieve bids from database\r\n\r\n\r\n }\r\n\r\n @Override\r\n public void onCancelled(DatabaseError databaseError) {\r\n\r\n }\r\n });\r\n\r\n }", "@Before\n public void init() {\n DatabaseReference mockReference = mock(DatabaseReference.class);\n Task mockTask = mock(Task.class);\n mockAccount = mock(Account.class);\n when(mockReference.child(isA(String.class))).thenReturn(mockReference);\n when(mockReference.removeValue()).thenReturn(mockTask);\n doNothing().when(mockReference)\n .addListenerForSingleValueEvent(isA(ValueEventListener.class));\n }", "private void setupFirebase(){\n FirebaseAuth firebaseAuth = FirebaseAuth.getInstance();\n FirebaseUser user = firebaseAuth.getCurrentUser();\n\n FirebaseDatabase firebaseDatabase = FirebaseDatabase.getInstance();\n if (user!=null){\n databaseReference = firebaseDatabase.getReference(\"Users\").child(user.getUid()).child(\"teacher\");\n }\n }", "public static DatabaseReference getFirebaseDatabase(){\n\n if (firebase == null){\n firebase = FirebaseDatabase.getInstance().getReference();\n }\n return firebase;\n }", "private void setUpFirebaseAuthentication() {\n authentication = FirebaseAuth.getInstance();\n authStateListener = firebaseAuth -> {\n currentUser = firebaseAuth.getCurrentUser();\n if (currentUser != null) {\n Log.d(TAG, \"Success\");\n Intent intent = new Intent(SignInActivity.this, HomePageActivity.class);\n startActivity(intent);\n\n } else {\n Log.d(\"HIRHEFOIH\", \"signed out\");\n }\n };\n }", "@Override\n public void onError(FirebaseError firebaseError) {\n }", "public interface DatabaseUtils {\n\n static boolean save(String path, Object object){\n FirebaseDatabase.getInstance()\n .getReference(path == null ? \"\" : path)\n .push()\n .setValue(object);\n return false;\n }\n\n boolean get();\n}", "private void addUserToFireBase() {\n Storage storage = new Storage(activity);\n RetrofitInterface retrofitInterface = RetrofitClient.getRetrofit().create(RetrofitInterface.class);\n Call<String> tokenCall = retrofitInterface.addUserToFreebase(RetrofitClient.FIREBASE_ENDPOINT + \"/\" + storage.getUserId() + \"/\" + storage.getFirebaseToken(), storage.getAccessToken());\n tokenCall.enqueue(new Callback<String>() {\n @Override\n public void onResponse(Call<String> call, Response<String> response) {\n if (response.isSuccessful()) {\n\n Toast.makeText(activity, \"Firebase success!\", Toast.LENGTH_SHORT).show();\n\n } else {\n Toast.makeText(activity, \"Failed to add you in Firebase!\", Toast.LENGTH_SHORT).show();\n }\n }\n\n @Override\n public void onFailure(Call<String> call, Throwable t) {\n\n /*handle network error and notify the user*/\n if (t instanceof SocketTimeoutException) {\n Toast.makeText(activity, R.string.connection_timeout, Toast.LENGTH_SHORT).show();\n }\n }\n });\n\n }", "@Override\n public void onAuthenticationError(FirebaseError firebaseError) {\n }", "@PostConstruct\r\n\tprivate void firebaseLogIn() {\n\t\ttry {\r\n\r\n\t\t\tInputStream serviceAccount = getClass()\r\n\t\t\t\t\t.getResourceAsStream(\"/avisosnick-firebase-adminsdk-ln9j6-55140aa5db.json\");\r\n\r\n//\t\t\t\t\tnew FileInputStream(\r\n//\t\t\t\t\t\"src/main/resources/avisosnick-firebase-adminsdk-ln9j6-55140aa5db.json\");\r\n\r\n\t\t\tFirebaseOptions options = FirebaseOptions.builder()\r\n\t\t\t\t\t.setCredentials(GoogleCredentials.fromStream(serviceAccount))\r\n\t\t\t\t\t.setDatabaseUrl(\"https://avisosnick.firebaseio.com\").build();\r\n\r\n\t\t\tFirebaseApp.initializeApp(options);\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t}", "public void inicializarFirebaseAuth() {\n refAutenticacaofb = ConfiguracaoFirebase.metodoAutenticacaoFirebase();\n }", "public void initConnection() {\n try {\n FileInputStream serviceAccount = new FileInputStream(\"serviceAccountKey.json\");\n\n FirebaseOptions options = new FirebaseOptions.Builder()\n .setCredentials(GoogleCredentials.fromStream(serviceAccount))\n .setDatabaseUrl(\"https://yieldcomparisontool.firebaseio.com\")\n .build();\n try {\n if (FirebaseApp.getInstance(FirebaseApp.DEFAULT_APP_NAME) == null) {\n FirebaseApp.initializeApp(options);\n }\n } catch (IllegalStateException e) {\n FirebaseApp.initializeApp(options);\n }\n } catch (IOException e) {\n System.out.println(\"ERROR Invalid Firebase Service account credentials.\");\n System.out.println(e);\n System.exit(1);\n }\n }", "@Override\n public void onCancelled(DatabaseError firebaseError) {\n }", "private void SaveUserToFirebase(FirebaseUser user)\n {\n\n }", "private void setupFirebaseAuth() {\n Log.d(TAG, \"setupFirebaseAuth: setting up firebase auth.\");\n mAuth = FirebaseAuth.getInstance();\n mAuthListener = new FirebaseAuth.AuthStateListener() {\n @Override\n public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {\n FirebaseUser user = firebaseAuth.getCurrentUser();\n\n //check if the user is logged in\n checkCurrentUser(user);\n\n if (user != null) {\n //User is signed in\n Log.d(TAG, \"onAuthStateChanged: signed_in:\" + user.getUid());\n }\n else {\n //User is signed out\n Log.d(TAG, \"onAuthStateChanged: signed out\");\n }\n }\n };\n }", "@Override\n public void onCancelled(FirebaseError firebaseError) {\n System.out.println(\"The read failed: \" + firebaseError.getMessage());\n }", "@Override\n public void onCancelled(FirebaseError firebaseError) {\n System.out.println(\"The read failed: \" + firebaseError.getMessage());\n }", "@Override\n public void onCancelled(FirebaseError firebaseError) {\n System.out.println(\"The read failed: \" + firebaseError.getMessage());\n }", "@Override\n public void onCancelled(FirebaseError firebaseError) {\n System.out.println(\"The read failed: \" + firebaseError.getMessage());\n }", "private void iniciarBaseDeDatos(){\n db_reference = FirebaseDatabase.getInstance().getReference();\n\n }", "private DataManager() {\n ref = FirebaseStorage.getInstance().getReference();\n }", "public static DatabaseReference getFirebaseDataBase(){\n if(firebase==null){\n firebase = FirebaseDatabase.getInstance().getReference();\n }\n return firebase;\n }", "public static FirebaseDatabase getDatabase() {\n //Start Work here\n if (mFirebaseDatabase != null) {\n mFirebaseDatabase = FirebaseDatabase.getInstance();\n } else if (mFirebaseDatabase == null) {\n mFirebaseDatabase = FirebaseDatabase.getInstance();\n// mFirebaseDatabase.setPersistenceEnabled(true);\n }\n return mFirebaseDatabase;\n }", "private void setupFirebase() {\r\n mFirebaseDatabase = FirebaseDatabase.getInstance();\r\n mFirebaseDatabaseReference = mFirebaseDatabase.getReference().child(Constants.ROOM_DATABASE_REFERENCE);\r\n mQuery = mFirebaseDatabaseReference.orderByChild(Constants.ROOM_INT_REFERENCE).startAt(Utils.convertHallStart(mHallStart)).endAt(Utils.convertHallEnd(mHallEnd));\r\n }", "public interface FirebaseActionListenerCallback {\n public void onSuccess();\n public void onError(Exception exception);\n public void onDatabaseError(DatabaseError error);\n}", "private void setFirebase() {\n auth = FirebaseAuth.getInstance();\n\n //get current user\n final FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();\n\n authListener = new FirebaseAuth.AuthStateListener() {\n @Override\n public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {\n FirebaseUser user = firebaseAuth.getCurrentUser();\n if (user == null) {\n // user auth state is changed - user is null\n // launch login activity\n startActivity(new Intent(MainActivity.this, LoginActivity.class));\n finish();\n }\n }\n };\n }", "private void setupFirebaseAuth(){\n Log.d(TAG, \"setupFirebaseAuth\");\n mAuth = FirebaseAuth.getInstance();\n fbaseDB = FirebaseDatabase.getInstance();\n dbRef = fbaseDB.getReference();\n\n mAuthListener = new FirebaseAuth.AuthStateListener() {\n @Override\n public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {\n FirebaseUser user = firebaseAuth.getCurrentUser();\n\n if(user != null){\n //somebody signed in\n Log.d(TAG, \"onAuthStateChanged:signed_in\" + user.getUid());\n dbRef.addListenerForSingleValueEvent(\n new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n if(checkUsernamExists(username.getText().toString(), dataSnapshot)){\n Toast.makeText(SignUp.this,\"Signup SUCCESSFUL\",Toast.LENGTH_SHORT).show();\n } else{\n\n mAuth.signOut();\n }\n\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n\n }\n }\n );\n } else{\n //nobodys here\n Log.d(TAG, \"onAuthStateChanged:signed_out\");\n }\n }\n };\n }", "private void setupFirebaseAuth() {\n Log.d(TAG, \"setupFirebaseAuth: setting up firebase auth.\");\n\n mAuth = FirebaseAuth.getInstance();\n mFirebaseDatabse = FirebaseDatabase.getInstance();\n mRef = mFirebaseDatabse.getReference();\n\n mAuthStateListener = new FirebaseAuth.AuthStateListener() {\n @Override\n public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {\n final FirebaseUser user = firebaseAuth.getCurrentUser();\n if (user != null) {\n Log.d(TAG, \"onAuthStateChanged: signed in:\" + user.getUid());\n\n mRef.addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n\n checkIfUsernameExists(username);\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n\n }\n });\n\n //moving back to login screen after successful sign up.\n finish();\n\n } else\n Log.d(TAG, \"onAuthStateChanged: signed out\");\n }\n };\n\n\n }", "public MyFirebaseMessagingService() {\n// mContext = this;\n }", "public DatabaseClient() {\n initConnection();\n dbClient = FirestoreClient.getFirestore();\n }", "@Override\n\n public void onVerificationFailed(FirebaseException e) {\n\n Toast.makeText(otpsignin.this,\"Something went wrong\",Toast.LENGTH_SHORT).show();\n\n }", "void onUserCreated(FirebaseUser firebaseUser);", "@Override\n public void onError(FirebaseError firebaseError) {\n Log.d(TAG, \"New user creation Firebase error\");\n }", "@Override\n public void onAuthenticationError(FirebaseError firebaseError) {\n Log.i(\"lt\",\"auth failed\");\n }", "private void googleSignInResult(GoogleSignInResult result) {\n if (result.isSuccess()) {\n // add to shared preferences\n GoogleSignInAccount account = result.getSignInAccount();\n userName = account.getDisplayName();\n userEmail = account.getEmail();\n userGoogleId = account.getId();\n userPhotoUrl = account.getPhotoUrl();\n\n editor.putString(getString(R.string.shared_prefs_key_username), userName);\n editor.putString(getString(R.string.shared_prefs_key_email), userEmail);\n editor.putString(getString(R.string.shared_prefs_key_google_id), userGoogleId);\n editor.putString(getString(R.string.shared_prefs_key_user_photo_url), userPhotoUrl.toString());\n\n editor.apply();\n\n // add to firebase users\n member = new Member();\n member.setUsername(userName);\n member.setEmail(userEmail);\n member.setId(userGoogleId);\n member.setPhotoUrl(userPhotoUrl.toString());\n member.setLoginType(getString(R.string.login_type_google));\n\n rref.orderByChild(getString(R.string.firebase_key_email)).equalTo(member.getEmail()).addListenerForSingleValueEvent(\n new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n String key;\n if (dataSnapshot.exists()) {\n key = dataSnapshot.getChildren().iterator().next().getKey();\n firebaseKey = key;\n getUserDetailsFromFirebase();\n } else {\n // new user\n key = rref.push().getKey();\n }\n editor.putString(getString(R.string.shared_prefs_key_firebasekey), key);\n editor.apply();\n\n Map<String, Object> userUpdates = new HashMap<>();\n\n userUpdates.put(key + \"/\" + getString(R.string.firebase_key_username), userName);\n userUpdates.put(key + \"/\" + getString(R.string.firebase_key_google_id), userGoogleId);\n userUpdates.put(key + \"/\" + getString(R.string.firebase_key_photo_url), userPhotoUrl.toString());\n userUpdates.put(key + \"/\" + getString(R.string.firebase_key_login_type), getString(R.string.login_type_google));\n userUpdates.put(key + \"/\" + getString(R.string.firebase_key_email), userEmail);\n\n rref.updateChildren(userUpdates);\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n }\n }\n );\n\n } else {\n gotoMainActivity();\n }\n }", "private void initializeFirebase() {\n mGameFirebase = new Firebase(Constants.FIREBASE_BASE_URL + Constants.FIREBASE_TEST_PATH + Constants.FIREBASE_GAME_ACTIVE_PATH + mGameWaitModel.getId());\n mGameFirebase.setValue(mGameModel);\n mGameFirebase.addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n mGameModel = dataSnapshot.getValue(GameModel.class);\n if (mGameModel == null) {\n return;\n }\n try {\n if (mGameModel.isGenerateNewQuestion()) {\n mGameModel.getGameMaster().setDidPlayerAnswer(false);\n mGameModel.getGameMaster().setPlayerAnswerCorrect(false);\n mGameModel.getGameSlave().setDidPlayerAnswer(false);\n mGameModel.getGameSlave().setPlayerAnswerCorrect(false);\n }\n if (isGameMaster() && mGameModel.isGenerateNewQuestion()) {\n generateNewQuestion();\n mGameModel.setGenerateNewQuestion(false);\n mGameFirebase.setValue(mGameModel);\n return;\n }\n mQuestionTextView.setText(mGameModel.getQuestion().getQuestion());\n mOption1Button.setText(mGameModel.getQuestion().getOptions().get(0).getOptionString());\n mOption2Button.setText(mGameModel.getQuestion().getOptions().get(1).getOptionString());\n mOption3Button.setText(mGameModel.getQuestion().getOptions().get(2).getOptionString());\n mOption4Button.setText(mGameModel.getQuestion().getOptions().get(3).getOptionString());\n mGameNameTextView.setText(mGameWaitModel.getGameName());\n if (isGameMaster()) {\n mMyScoreTextView.setText(String.valueOf(mGameModel.getGameMaster().getScore()));\n mOpponentScoreTextView.setText(String.valueOf(mGameModel.getGameSlave().getScore()));\n if (mGameModel.getGameMaster().isDidPlayerAnswer() && mGameModel.getGameSlave().isDidPlayerAnswer()) {\n mGameModel.setGenerateNewQuestion(true);\n mGameFirebase.child(\"generateNewQuestion\").setValue(mGameModel.isGenerateNewQuestion());\n }\n } else {\n mMyScoreTextView.setText(String.valueOf(mGameModel.getGameSlave().getScore()));\n mOpponentScoreTextView.setText(String.valueOf(mGameModel.getGameMaster().getScore()));\n }\n } catch (NullPointerException e) {\n\n }\n }\n\n @Override\n public void onCancelled(FirebaseError firebaseError) {\n\n }\n });\n mGameFirebase.child(\"question\").addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n\n }\n\n @Override\n public void onCancelled(FirebaseError firebaseError) {\n\n }\n });\n }", "public DatabaseConnector() {\n\n try {\n firebaseAuth = FirebaseAuth.getInstance();\n //Firebase Instance..\n authStateListener = new FirebaseAuth.AuthStateListener() {\n @Override\n public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {\n FirebaseUser user = firebaseAuth.getCurrentUser();\n if(user !=null) {\n Log.d(TAG, \"onAuthStateChanged: ***********\" + user.getUid());\n } else Log.d(TAG, \"onAuthStateChanged: ______________\");\n }\n };\n firebaseAuth.addAuthStateListener(authStateListener);\n } catch (Exception e) {\n Log.d(\"DatabaseConnector\", \"DatabaseConnector: Constructor | Error: \" + e.getMessage());\n }\n\n }", "private void addMember(String firstName, String lastName, String emailId) {\n Log.e(\"AddMember\", \"Fn \" + firstName + \", Ln \" + lastName + \"eid \" + emailId);\n\n\n// myRef.setValue(\"Hello, World!\");\n String key = myRef.push().getKey();\n Log.e(\"AddMember\", \"key \" + key);\n\n CoreMember member = new CoreMember(firstName, lastName, emailId);\n myRef.child(key).setValue(member, new DatabaseReference.CompletionListener() {\n @Override\n public void onComplete(DatabaseError databaseError, DatabaseReference databaseReference) {\n if (databaseError != null) {\n System.out.println(\"Data could not be saved \" + databaseError.getMessage());\n } else {\n System.out.println(\"Data saved successfully.\" + databaseReference.toString());\n memberKey = databaseReference.getKey();\n hideInputForm(true);\n\n }\n }\n });\n }", "public void createUserAccount(String email, String password, final String userId, final SignUpInterface listner) {\n collectionReference = db.collection(\"Users\");\n firebaseAuth = FirebaseAuth.getInstance();\n firebaseAuth.createUserWithEmailAndPassword(email, password)\n .addOnCompleteListener(new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n\n if(task.isSuccessful()){\n currentUser = FirebaseAuth.getInstance().getCurrentUser();\n assert currentUser!= null;\n final String currentUserId = currentUser.getUid();\n\n Map<String, String> userMap = new HashMap<>();\n userMap.put(\"UserIdInDB\", currentUserId);\n userMap.put(\"UserName\", userId);\n\n collectionReference.add(userMap)\n .addOnSuccessListener(new OnSuccessListener<DocumentReference>() {\n @Override\n public void onSuccess(DocumentReference documentReference) {\n documentReference.get()\n .addOnCompleteListener(new OnCompleteListener<DocumentSnapshot>() {\n @Override\n public void onComplete(@NonNull Task<DocumentSnapshot> task) {\n if(task.getResult().exists()) {\n\n String name = task.getResult().getString(\"UserName\");\n\n EntityClass entityObj = EntityClass.getInstance();\n entityObj.setUserName(name);\n entityObj.setUserIdInDb(currentUserId);\n listner.signUpStatus(true);\n }\n }\n });\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Log.d(TAG, \"onFailure: \" + e.getMessage());\n listner.signUpStatus(false);\n listner.onFailure(e.getMessage());\n }\n });\n }\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Log.d(TAG, \"onFailure: \" + e.getMessage());\n listner.signUpStatus(false);\n listner.onFailure(e.getMessage());\n }\n });\n }", "private void firebaseAuthWithGoogle(AuthCredential credential) {\n\n\n try {\n// showProgressDialog();\n mAuth.signInWithCredential(credential)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n Utility.logData(\"signInWithCredential:onComplete:\" + task.isSuccessful());\n if (!task.isSuccessful()) {\n Utility.logData(\"signInWithCredential\" + task.getException().getMessage());\n task.getException().printStackTrace();\n Toast.makeText(LoginActivity.this, \"Authentication failed.\",\n Toast.LENGTH_SHORT).show();\n } else {\n// createUserInFirebaseHelper(mUser);\n\n DatabaseReference mDatabase = FirebaseDatabase.getInstance().getReference();\n\n\n mDatabase.child(AppStringConstants.USER_ENTITY).\n child(Utility.encodeEmail(mUser.getEmail())).child(AppStringConstants.PROFILE_ENTITY).\n addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot snapshot) {\n try {\n if (snapshot.getValue() != null) {\n try {\n\n mUser = snapshot.getValue(UserModel.class);\n SessionManager.getInstance().createUser(mUser);\n SessionManager.getInstance().setCurrentuserRole(mUser.getRole());\n\n\n Utility.logData(\"logging user \\n\" + Objects.requireNonNull(mUser).toString());\n\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n } else {\n UserModel model = new UserModel();\n model.setEmail(mUser.getEmail());\n model.setName(mUser.getName());\n model.setPhoto(mUser.getPhoto());\n model.setIdToken(mUser.getIdToken());\n model.setRole(UserRole.USER);\n model.setCity(mUser.getCity());\n model.setSpecialisation(mUser.getSpecialisation());\n mDatabase.child(AppStringConstants.USER_ENTITY).\n child(Utility.encodeEmail(model.getEmail())).child(AppStringConstants.PROFILE_ENTITY).\n setValue(model);\n SessionManager.getInstance().createUser(model);\n SessionManager.getInstance().setCurrentuserRole(model.getRole());\n\n\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n\n }\n\n });\n\n\n startMainActivity();\n\n\n Utility.showLongToast(\"Login successful\");\n\n\n }\n// hideProgressDialog();\n }\n });\n }catch (Exception e){\n Utility.logExceptionData(e);\n Utility.hideLoader(this);\n }\n }", "private void sendGuideRegDataToFireBase(){\n }", "@Override\n public void onSuccess(QuerySnapshot queryDocumentSnapshots) {\n\n if(queryDocumentSnapshots.size()>=1){\n\n //then here we can log in\n\n registrationProcessFireStore();\n\n }else {\n\n //return as User is not verified by any admin,\n //sign him out from firebase authentication page.\n\n logOutNow();\n }\n\n\n\n\n\n }", "public static void initialize() {\n //Get Firebase auth instance\n GlobalData.auth = FirebaseAuth.getInstance();\n\n GlobalData.u = new User();\n GlobalData.u.setId(\"Hh7qGadAgPeRUJYAEGjvRu845DC3\");//\n Thread t = new Thread(new Runnable() {\n @Override\n public void run() {\n /**\n * Start Firebase!\n */\n FirebaseCore.start();\n// User u = new User();\n// u.setId(\"6ZxSGeHS4DOoFHEE2McBcGH7XHP2\");\n//\n// try {\n// u = DUser.crud(u, true);\n// } catch (Exception e) {\n// e.printStackTrace();\n// }\n// Log.e(\"Test\", u.getEmail());\n//\n// Message m = new Message();\n// m.setMessage(\"Hello \" + System.currentTimeMillis());\n// m.setBlobname(null);\n// m.setBlob(null);\n// m.setTimestamp(System.currentTimeMillis());\n//\n// try {\n// m.setOrder(DAutoIncrement.order(DAutoIncrement.MESSAGE));\n//\n// m = DMessage.crud(m, false, false);\n// Message m2 = new Message();\n// m2.setId(m.getId());\n// m2 = DMessage.crud(m2, true, false);\n//// Log.w(\"Message\",m2.getId());\n// Message m3 = new Message();\n// m3.setId(m.getId());\n//// DMessage.crud(m3,false, true);\n//// Log.w(\"Message2\",m3.getId());\n// DMessageList.crd(u, u, m, false, false);\n//\n// final ArrayList<Message> messages = DMessageList.crd(u, u, null, true, false);\n// for (Message mes : messages\n// ) {\n// DMessage.crud(mes, true, false); // Fill the message with data\n//\n// }\n// // Sorting require all messages element to be filled, otherwise, it won't work\n// Collections.sort(messages);\n// for (Message mes : messages\n// ) {\n// Log.e(mes.getId(), mes.getMessage());\n//\n// }\n//\n// RunnableDataSnapshot rds = new RunnableDataSnapshot() {\n// @Override\n// public void run(DataSnapshot dataSnapshot, Object object) {\n// ArrayList<Message> messages2 = (ArrayList<Message>) object;\n// Collections.sort(messages2);\n// for (int i = messages.size(); i < messages2.size(); i++) {\n// Log.e(\"New Input\", messages2.get(i).getId());\n// messages.add(messages2.get(i));\n// }\n// Log.e(\"Data change\", \"Data is changing\");\n// }\n// };\n// DMessageList.nonblockRead(u, u, rds);\n// User u2 = new User();\n// u2.setId(\"Hh7qGadAgPeRUJYAEGjvRu845DC3\");\n// ArrayList<User> users = new ArrayList<User>();\n// users.add(u2);\n// HashMap<String, ArrayList<User>> hm = new HashMap<String, ArrayList<User>>();\n// hm.put(\"Group 1\", users);\n// DBroadcast.uBroadcastPushorDelete(u, hm, true);\n// ArrayList<User> users2 = new ArrayList<User>();\n// users2.add(u);\n// users2.add(u2); // it add itself which must be avoided!\n// HashMap<String, ArrayList<User>> hm2 = new HashMap<String, ArrayList<User>>();\n// hm.put(\"Group 2\", users2);\n// DBroadcast.uBroadcastPushorDelete(u2, hm2, true);\n// } catch (Exception e) {\n// e.printStackTrace();\n// }\n }\n });\n t.start();\n\n }", "public void onClick(View v) {\n EditText email = (EditText) findViewById(R.id.email);\n final String emailString = email.getText().toString();\n\n EditText pass = (EditText) findViewById(R.id.pass);\n final String passString = pass.getText().toString();\n Firebase ref = new Firebase(\"https://gymguy.firebaseio.com\");\n\n // Create a handler to handle the result of the authentication\n Firebase.AuthResultHandler authResultHandler = new Firebase.AuthResultHandler() {\n @Override\n public void onAuthenticated(AuthData authData) {\n // Authenticated successfully with payload authData\n\n Context context = getApplicationContext();\n CharSequence text = \"Logged in\";\n int duration = Toast.LENGTH_SHORT;\n\n Toast toast = Toast.makeText(context, text, duration);\n toast.show();\n //save uid\n //remove uid\n SharedPreferences sharedPref = getApplicationContext().getSharedPreferences(\n getString(R.string.preference_file_key), Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPref.edit();\n editor.putString(\"uid\", authData.getUid().toString());\n editor.commit();\n\n Intent goToNextActivity = new Intent(getApplicationContext(), MainActivity.class);\n startActivity(goToNextActivity);\n }\n\n @Override\n public void onAuthenticationError(FirebaseError firebaseError) {\n // Authenticated failed with error firebaseError\n Context context = getApplicationContext();\n// CharSequence text = firebaseError.getMessage() + \" : for \" + emailString + passString + firebaseError.getDetails();\n CharSequence text = firebaseError.getMessage() + \" : \" + firebaseError.getDetails();\n int duration = Toast.LENGTH_LONG;\n\n Toast toast = Toast.makeText(context, text, duration);\n toast.show();\n }\n };\n\n // Authenticate users with a custom Firebase token\n// ref.authWithCustomToken(\"<token>\", authResultHandler);\n // Or with an email/password combination\n ref.authWithPassword(emailString, passString, authResultHandler);\n }", "private void registrationProcessFireStore() {\n\n Log.i(\"checkk UserReg: \", \"registrationprocess\");\n presenter.checkUserDoc(userName,userPhone,adminName,adminPhone);\n Log.i(\"checkk UserReg: \", \"registrationprocess AFTER\");\n\n\n\n }", "@Override\n public void onCreate() {\n super.onCreate();\n if(!FirebaseApp.getApps(this).isEmpty()) {\n FirebaseDatabase.getInstance().setPersistenceEnabled(true);\n }\n appInstance = this;\n\n\n\n }", "@SuppressWarnings( \"VoidMethodAnnotatedWithGET\" )\n@Options( dispatcher = FirebaseAuthDispatcher.class, serviceRootKey = Configuration.PRODUCT_BILLING_API_ROOT )\npublic interface ProductBillingFacade\n extends RestService\n{\n //////////////////////\n ////// products //////\n //////////////////////\n\n @GET\n @Path( \"products\" )\n void getProducts( @QueryParam( \"offset\" ) Integer offset,\n @QueryParam( \"limit\" ) Integer limit,\n @QueryParam( \"lightList\" ) boolean lightList,\n @HeaderParam( \"vnd.turnon.cloud.calc-pricing-items\" ) boolean calcPricingItems,\n SuccessCallback<Items<Product>> callback );\n\n @GET\n @Path( \"products/{product_id}\" )\n void findProductById( @PathParam( \"product_id\" ) Long productId,\n @HeaderParam( \"vnd.turnon.cloud.calc-pricing-items\" ) boolean calcPricingItems,\n FacadeCallback<Product> callback );\n\n @POST\n @Path( \"products\" )\n void createProduct( @HeaderParam( \"vnd.turnon.cloud.calc-pricing-items\" ) boolean calcPricingItems,\n Product product,\n FacadeCallback<Product> callback );\n\n @PUT\n @Path( \"products/{product_id}\" )\n void updateProduct( @PathParam( \"product_id\" ) Long productId,\n @HeaderParam( \"vnd.turnon.cloud.calc-pricing-items\" ) boolean calcPricingItems,\n Product product,\n FacadeCallback<Product> callback );\n\n @PUT\n @Path( \"products/{product_id}/publishing\" )\n void updateProductPublishing( @PathParam( \"product_id\" ) Long productId,\n ProductPublishing productPublishing,\n FacadeCallback<ProductPublishing> callback );\n\n @DELETE\n @Path( \"products/{product_id}\" )\n void deleteProduct( @PathParam( \"product_id\" ) Long productId,\n FacadeCallback<Void> callback );\n\n @DELETE\n @Path( \"products/{product_id}/publishing/pictures/{order}\" )\n void deleteProductPicture( @PathParam( \"product_id\" ) Long productId,\n @PathParam( \"order\" ) Integer order,\n FacadeCallback<Void> callback );\n\n //////////////////////\n ////// orders ////////\n //////////////////////\n\n @GET\n @Path( \"orders\" )\n void getOrders( @QueryParam( \"offset\" ) Integer offset,\n @QueryParam( \"limit\" ) Integer limit,\n @QueryParam( \"lightList\" ) boolean lightList,\n SuccessCallback<Items<Order>> callback );\n\n @GET\n @Path( \"orders/{order_id}\" )\n void findOrderById( @PathParam( \"order_id\" ) Long orderId,\n @QueryParam( \"invoices\" ) Integer numberOf,\n FacadeCallback<Order> callback );\n\n @POST\n @Path( \"orders\" )\n void createOrder( Order order,\n FacadeCallback<Order> callback );\n\n @PUT\n @Path( \"orders/{order_id}\" )\n void updateOrder( @PathParam( \"order_id\" ) Long orderId,\n Order order,\n FacadeCallback<Order> callback );\n\n @DELETE\n @Path( \"orders/{order_id}\" )\n void deleteOrder( @PathParam( \"order_id\" ) Long orderId,\n FacadeCallback<Void> callback );\n\n @GET\n @Path( \"orders/{order_id}/status\" )\n void getOrderStatus( @PathParam( \"order_id\" ) Long orderId,\n SuccessCallback<OrderStatus> callback );\n\n @PUT\n @Path( \"orders/{order_id}/status\" )\n void changeOrderStatus( @PathParam( \"order_id\" ) Long orderId,\n OrderStatus status,\n FacadeCallback<Void> callback );\n\n //////////////////////\n ////// invoices //////\n //////////////////////\n\n @GET\n @Path( \"invoices\" )\n void getInvoices( @QueryParam( \"offset\" ) Integer offset,\n @QueryParam( \"limit\" ) Integer limit,\n @QueryParam( \"lightList\" ) boolean lightList,\n SuccessCallback<Items<Invoice>> callback );\n\n @GET\n @Path( \"orders/{order_id}/invoices\" )\n void getOrderInvoices( @PathParam( \"order_id\" ) Long orderId,\n @QueryParam( \"offset\" ) Integer offset,\n @QueryParam( \"limit\" ) Integer limit,\n @QueryParam( \"lightList\" ) boolean lightList,\n SuccessCallback<Items<Invoice>> callback );\n\n @POST\n @Path( \"orders/{order_id}/invoices\" )\n void createOrderInvoice( @PathParam( \"order_id\" ) Long orderId,\n Invoice invoice,\n FacadeCallback<Invoice> callback );\n\n @GET\n @Path( \"orders/{order_id}/invoices/{invoice_id}\" )\n void findInvoiceById( @PathParam( \"order_id\" ) Long orderId,\n @PathParam( \"invoice_id\" ) Long invoiceId,\n FacadeCallback<Invoice> callback );\n\n @POST\n @Path( \"invoices\" )\n void createInvoice( Invoice invoice,\n FacadeCallback<Invoice> callback );\n\n @PUT\n @Path( \"orders/{order_id}/invoices/{invoice_id}\" )\n void updateInvoice( @PathParam( \"order_id\" ) Long orderId,\n @PathParam( \"invoice_id\" ) Long invoiceId,\n Invoice invoice,\n FacadeCallback<Invoice> callback );\n\n @PUT\n @Path( \"orders/{order_id}/invoices/{invoice_id}\" )\n void sendInvoice( @PathParam( \"order_id\" ) Long orderId,\n @PathParam( \"invoice_id\" ) Long invoiceId,\n @HeaderParam( \"vnd.turnon.cloud.send-invoice\" ) Boolean sendInvoice,\n Invoice invoice,\n FacadeCallback<Invoice> callback );\n\n @PUT\n @Path( \"orders/{order_id}/invoices/{invoice_id}\" )\n void emailInvoice( @PathParam( \"order_id\" ) Long orderId,\n @PathParam( \"invoice_id\" ) Long invoiceId,\n @HeaderParam( \"vnd.turnon.cloud.send-invoice\" ) Boolean sendInvoice,\n @HeaderParam( \"vnd.turnon.cloud.contact-email\" ) String email,\n Invoice invoice,\n FacadeCallback<Invoice> callback );\n\n @DELETE\n @Path( \"orders/{order_id}/invoices/{invoice_id}\" )\n void deleteInvoice( @PathParam( \"order_id\" ) Long orderId,\n @PathParam( \"invoice_id\" ) Long invoiceId,\n FacadeCallback<Void> callback );\n\n @POST\n @Path( \"prices\" )\n void calculate( Pricing pricing, SuccessCallback<Pricing> callback );\n\n //////////////////////\n ////// codebooks /////\n //////////////////////\n\n @GET\n @Path( \"codebook/billing-units\" )\n void getBillingUnits( @HeaderParam( \"Accept-Language\" ) String acceptLanguage,\n SuccessCallback<Items<BillingUnit>> callback );\n\n @GET\n @Path( \"codebook/vat-rates\" )\n void getVatRates( @QueryParam( \"domicile\" ) String domicile,\n @HeaderParam( \"Accept-Language\" ) String acceptLanguage,\n SuccessCallback<Items<VatRate>> callback );\n\n @GET\n @Path( \"codebook/categories\" )\n void getCategories( @HeaderParam( \"Accept-Language\" ) String acceptLanguage,\n SuccessCallback<Items<Category>> callback );\n\n //////////////////////\n ///// purchases //////\n //////////////////////\n\n @GET\n @Path( \"purchases/orders\" )\n void searchPurchaseOrders( @QueryParam( \"offset\" ) Integer offset,\n @QueryParam( \"limit\" ) Integer limit,\n @QueryParam( \"lightList\" ) boolean lightList,\n SuccessCallback<Items<PurchaseOrder>> callback );\n\n @GET\n @Path( \"purchases/orders/{order_id}\" )\n void getPurchaseOrder( @PathParam( \"order_id\" ) Long orderId,\n @QueryParam( \"invoices\" ) Integer numberOf,\n SuccessCallback<PurchaseOrder> callback );\n\n @DELETE\n @Path( \"purchases/orders/{order_id}\" )\n void declinePurchaseOrder( @PathParam( \"order_id\" ) Long orderId,\n FacadeCallback<Void> callback );\n\n @GET\n @Path( \"purchases/expenses\" )\n void searchExpenses( @QueryParam( \"offset\" ) Integer offset,\n @QueryParam( \"limit\" ) Integer limit,\n @QueryParam( \"lightList\" ) boolean lightList,\n SuccessCallback<Items<Expense>> callback );\n\n @GET\n @Path( \"purchases/expenses\" )\n void searchExpensesByOrder( @QueryParam( \"offset\" ) Integer offset,\n @QueryParam( \"limit\" ) Integer limit,\n @QueryParam( \"lightList\" ) boolean lightList,\n @QueryParam( \"orderId\" ) Long orderId,\n SuccessCallback<Items<Expense>> callback );\n\n @GET\n @Path( \"purchases/orders/{order_id}/invoices\" )\n void listOrderIncomingInvoices( @PathParam( \"order_id\" ) Long orderId,\n @QueryParam( \"offset\" ) Integer offset,\n @QueryParam( \"limit\" ) Integer limit,\n @QueryParam( \"lightList\" ) boolean lightList,\n SuccessCallback<Items<IncomingInvoice>> callback );\n\n @GET\n @Path( \"purchases/orders/{order_id}/invoices/{invoice_id}\" )\n void getIncomingOrderInvoice( @PathParam( \"order_id\" ) Long orderId,\n @PathParam( \"invoice_id\" ) Long invoiceId,\n SuccessCallback<IncomingInvoice> callback );\n\n @DELETE\n @Path( \"purchases/orders/{order_id}/invoices/{invoice_id}\" )\n void deleteIncomingInvoice( @PathParam( \"order_id\" ) Long orderId,\n @PathParam( \"invoice_id\" ) Long invoiceId,\n FacadeCallback<Void> callback );\n\n /**\n * Searches for transaction that match the filtering criteria.\n *\n * @param orderId Identification of the order to search for transactions.\n * If invoice Id is not provided, a transactions of all associated invoices will be in the results.\n * @param invoiceId Identification of the invoice to search settled transactions.\n * Order Id is being required for successful match.\n * @param callback the result callback\n */\n @GET\n @Path( \"transactions\" )\n void getTransactions( @QueryParam( \"orderId\" ) Long orderId,\n @QueryParam( \"invoiceId\" ) Long invoiceId,\n SuccessCallback<Items<Transaction>> callback );\n\n @GET\n @Path( \"transactions/{transaction_id}\" )\n void getTransactionById( @PathParam( \"transaction_id\" ) Long transactionId,\n SuccessCallback<Transaction> callback );\n}", "public interface FirebaseInsertResult {\n\n /**\n * insert result callback\n * @param success true if success\n * @param msg prompt message\n */\n void insertResult(boolean success, String msg);\n}", "@Override\n public void onAuthenticationError(FirebaseError firebaseError) {\n Log.d(TAG, \"Login attempt failed\");\n }", "@Override\n public void onAuthenticationError(FirebaseError firebaseError) {\n Log.d(TAG, \"Login attempt failed\");\n }", "private void createUserInFirebaseHelper(final String encodedEmail) {\n }", "@Override\n public void onError(FirebaseError firebaseError) {\n Log.d(\"LOGIN\", \"Registration error\");\n }", "public interface getAuth {\n @FormUrlEncoded\n @POST(\"auth/facebook\")\n Call<AuthResponse> facebookUserAuth(\n @Field(\"access_token\") String access_token,\n @Field(\"user_id\") String user_id,\n @Field(\"firebase_token\") String firebase_token\n );\n @FormUrlEncoded\n @POST(\"auth/fbUpdateAcessToken\")\n Call<AuthResponse> facebookTokenUpdate(\n @Field(\"access_token\") String access_token,\n @Field(\"user_id\") String user_id\n );\n\n @FormUrlEncoded\n @POST(\"auth/updateFcmToken\")\n Call<AuthResponse> fcmTokenUpdate(\n @Field(\"token\") String fcmToken,\n @Field(\"user_id\") String userId\n );\n\n @FormUrlEncoded\n @POST(\"auth/updateTopics\")\n Call<AuthResponse> updateUserTopics(\n @Field(\"user_topics\") String user_topics,\n @Field(\"user_id\") String user_id\n );\n\n @FormUrlEncoded\n @POST(\"auth/updateNotification\")\n Call<AuthResponse> updateNotification(\n @Field(\"user_id\") String user_id,\n @Field(\"notification\") Boolean notification\n );\n\n @FormUrlEncoded\n @POST(\"auth/saveFcm\")\n Call<FcmKey> saveFcm(\n @Field(\"fcmToken\") String fcmToken\n );\n\n}", "private void onSignIn() {\n\n //get the signed in user's info from the db and\n //turn it into a user object.\n db.collection(\"users\").document(email).get()\n .addOnSuccessListener(new OnSuccessListener<DocumentSnapshot>() {\n @Override\n public void onSuccess(DocumentSnapshot documentSnapshot) {\n user = documentSnapshot.toObject(User.class);\n goToDoctors();\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Log.w(\"MainActivity\", \"Couldn't get user's data\", e);\n Toast.makeText(getApplicationContext(), \"Data retrieval failed.\",\n Toast.LENGTH_SHORT).show();\n }\n });\n\n }", "public void uploadUserDetailsToDatabase(String email, String password){\n User user = new User(email, password);\n FirebaseDatabase.getInstance().getReference(\"Users\").push()\n .setValue(user).addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n Log.i(\"details\", \"uploaded\");\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Log.i(\"details\", \"upload failed\");\n }\n });\n }", "public static DatabaseReference getFirebaseDatabase() {\n if (referenciaFirebase == null) {\n referenciaFirebase = FirebaseDatabase.getInstance().getReference();\n }\n return referenciaFirebase;\n }", "private final com.google.android.gms.internal.p000firebaseperf.zzbu zzw() {\n /*\n r15 = this;\n java.lang.String r0 = \"FirebasePerformance\"\n r1 = 0\n java.io.BufferedReader r2 = new java.io.BufferedReader // Catch:{ IOException -> 0x00a4, ArrayIndexOutOfBoundsException -> 0x0085, NumberFormatException -> 0x0083, NullPointerException -> 0x0081 }\n java.io.FileReader r3 = new java.io.FileReader // Catch:{ IOException -> 0x00a4, ArrayIndexOutOfBoundsException -> 0x0085, NumberFormatException -> 0x0083, NullPointerException -> 0x0081 }\n java.lang.String r4 = r15.zzba // Catch:{ IOException -> 0x00a4, ArrayIndexOutOfBoundsException -> 0x0085, NumberFormatException -> 0x0083, NullPointerException -> 0x0081 }\n r3.<init>(r4) // Catch:{ IOException -> 0x00a4, ArrayIndexOutOfBoundsException -> 0x0085, NumberFormatException -> 0x0083, NullPointerException -> 0x0081 }\n r2.<init>(r3) // Catch:{ IOException -> 0x00a4, ArrayIndexOutOfBoundsException -> 0x0085, NumberFormatException -> 0x0083, NullPointerException -> 0x0081 }\n java.util.concurrent.TimeUnit r3 = java.util.concurrent.TimeUnit.MILLISECONDS // Catch:{ Throwable -> 0x006c, all -> 0x0069 }\n long r4 = java.lang.System.currentTimeMillis() // Catch:{ Throwable -> 0x006c, all -> 0x0069 }\n long r3 = r3.toMicros(r4) // Catch:{ Throwable -> 0x006c, all -> 0x0069 }\n java.lang.String r5 = r2.readLine() // Catch:{ Throwable -> 0x006c, all -> 0x0069 }\n java.lang.String r6 = \" \"\n java.lang.String[] r5 = r5.split(r6) // Catch:{ Throwable -> 0x006c, all -> 0x0069 }\n r6 = 13\n r6 = r5[r6] // Catch:{ Throwable -> 0x006c, all -> 0x0069 }\n long r6 = java.lang.Long.parseLong(r6) // Catch:{ Throwable -> 0x006c, all -> 0x0069 }\n r8 = 15\n r8 = r5[r8] // Catch:{ Throwable -> 0x006c, all -> 0x0069 }\n long r8 = java.lang.Long.parseLong(r8) // Catch:{ Throwable -> 0x006c, all -> 0x0069 }\n r10 = 14\n r10 = r5[r10] // Catch:{ Throwable -> 0x006c, all -> 0x0069 }\n long r10 = java.lang.Long.parseLong(r10) // Catch:{ Throwable -> 0x006c, all -> 0x0069 }\n r12 = 16\n r5 = r5[r12] // Catch:{ Throwable -> 0x006c, all -> 0x0069 }\n long r12 = java.lang.Long.parseLong(r5) // Catch:{ Throwable -> 0x006c, all -> 0x0069 }\n com.google.android.gms.internal.firebase-perf.zzbu$zza r5 = com.google.android.gms.internal.p000firebaseperf.zzbu.zzdl() // Catch:{ Throwable -> 0x006c, all -> 0x0069 }\n com.google.android.gms.internal.firebase-perf.zzbu$zza r3 = r5.zzu(r3) // Catch:{ Throwable -> 0x006c, all -> 0x0069 }\n long r10 = r10 + r12\n long r4 = r15.zzd(r10) // Catch:{ Throwable -> 0x006c, all -> 0x0069 }\n com.google.android.gms.internal.firebase-perf.zzbu$zza r3 = r3.zzw(r4) // Catch:{ Throwable -> 0x006c, all -> 0x0069 }\n long r6 = r6 + r8\n long r4 = r15.zzd(r6) // Catch:{ Throwable -> 0x006c, all -> 0x0069 }\n com.google.android.gms.internal.firebase-perf.zzbu$zza r3 = r3.zzv(r4) // Catch:{ Throwable -> 0x006c, all -> 0x0069 }\n com.google.android.gms.internal.firebase-perf.zzga r3 = r3.zzhr() // Catch:{ Throwable -> 0x006c, all -> 0x0069 }\n com.google.android.gms.internal.firebase-perf.zzep r3 = (com.google.android.gms.internal.p000firebaseperf.zzep) r3 // Catch:{ Throwable -> 0x006c, all -> 0x0069 }\n com.google.android.gms.internal.firebase-perf.zzbu r3 = (com.google.android.gms.internal.p000firebaseperf.zzbu) r3 // Catch:{ Throwable -> 0x006c, all -> 0x0069 }\n r2.close() // Catch:{ IOException -> 0x00a4, ArrayIndexOutOfBoundsException -> 0x0085, NumberFormatException -> 0x0083, NullPointerException -> 0x0081 }\n return r3\n L_0x0069:\n r3 = move-exception\n r4 = r1\n goto L_0x0072\n L_0x006c:\n r3 = move-exception\n throw r3 // Catch:{ all -> 0x006e }\n L_0x006e:\n r4 = move-exception\n r14 = r4\n r4 = r3\n r3 = r14\n L_0x0072:\n if (r4 == 0) goto L_0x007d\n r2.close() // Catch:{ Throwable -> 0x0078 }\n goto L_0x0080\n L_0x0078:\n r2 = move-exception\n com.google.android.gms.internal.p000firebaseperf.zzak.zza(r4, r2) // Catch:{ IOException -> 0x00a4, ArrayIndexOutOfBoundsException -> 0x0085, NumberFormatException -> 0x0083, NullPointerException -> 0x0081 }\n goto L_0x0080\n L_0x007d:\n r2.close() // Catch:{ IOException -> 0x00a4, ArrayIndexOutOfBoundsException -> 0x0085, NumberFormatException -> 0x0083, NullPointerException -> 0x0081 }\n L_0x0080:\n throw r3 // Catch:{ IOException -> 0x00a4, ArrayIndexOutOfBoundsException -> 0x0085, NumberFormatException -> 0x0083, NullPointerException -> 0x0081 }\n L_0x0081:\n r2 = move-exception\n goto L_0x0086\n L_0x0083:\n r2 = move-exception\n goto L_0x0086\n L_0x0085:\n r2 = move-exception\n L_0x0086:\n java.lang.String r3 = \"Unexpected '/proc/[pid]/stat' file format encountered: \"\n java.lang.String r2 = r2.getMessage()\n java.lang.String r2 = java.lang.String.valueOf(r2)\n int r4 = r2.length()\n if (r4 == 0) goto L_0x009b\n java.lang.String r2 = r3.concat(r2)\n goto L_0x00a0\n L_0x009b:\n java.lang.String r2 = new java.lang.String\n r2.<init>(r3)\n L_0x00a0:\n android.util.Log.w(r0, r2)\n goto L_0x00c2\n L_0x00a4:\n r2 = move-exception\n java.lang.String r3 = \"Unable to read 'proc/[pid]/stat' file: \"\n java.lang.String r2 = r2.getMessage()\n java.lang.String r2 = java.lang.String.valueOf(r2)\n int r4 = r2.length()\n if (r4 == 0) goto L_0x00ba\n java.lang.String r2 = r3.concat(r2)\n goto L_0x00bf\n L_0x00ba:\n java.lang.String r2 = new java.lang.String\n r2.<init>(r3)\n L_0x00bf:\n android.util.Log.w(r0, r2)\n L_0x00c2:\n return r1\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.internal.p000firebaseperf.zzap.zzw():com.google.android.gms.internal.firebase-perf.zzbu\");\n }", "private void callRegisterByEmailToGoogleFirebase(){\n mFirebaseAuth = FirebaseAuth.getInstance();\n\n String userEmail = mEmailAddress.getText().toString();\n String userPassword = mPassword.getText().toString();\n\n // create the user with email and password\n mFirebaseAuth.createUserWithEmailAndPassword(userEmail,userPassword).addOnCompleteListener(getActivity(), new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if(task.isSuccessful()){\n showBottomSnackBar(\"Corresponding Firebase User Created\");\n }else{\n showBottomSnackBar(\"Firebase User Creation Fails\");\n }\n\n replaceActivity(MainActivity.class, null);\n }\n });\n\n }", "@Override\n\tpublic void onCancelled(FirebaseError arg0) {\n\t\t\n\t}", "public static boolean FireBaseAddWord(String source,String target,String userId){\n\r\n FirebaseDatabase firebaseDatabase = FirebaseDatabase.getInstance();\r\n DatabaseReference root = firebaseDatabase.getReference(\"words\").child(userId); // Firebase database table path.\r\n\r\n Map wordMap = new HashMap(); // Set word information in map\r\n\r\n wordMap.put(\"source\",source);\r\n wordMap.put(\"target\",target);\r\n wordMap.put(\"time\",ServerValue.TIMESTAMP);\r\n\r\n root.push().updateChildren(wordMap).addOnCompleteListener(new OnCompleteListener() {\r\n @Override\r\n public void onComplete(@NonNull Task task) { // Update Database\r\n if(task.isSuccessful()){\r\n setAddWordIsSuccessful(true);\r\n }else {\r\n setAddWordIsSuccessful(false);\r\n }\r\n }\r\n });\r\n\r\n\r\n return addWordIsSuccessful;\r\n\r\n\r\n }", "@Inject\n public UserRepositoryImpl() {\n database = FirebaseDatabase.getInstance();\n auth = FirebaseAuth.getInstance();\n }", "private void sentRequestGG(FirebaseAuth firebaseAuth) {\n if (firebaseAuth.getCurrentUser() != null) {\n SharedPref.instance.putName(firebaseAuth.getCurrentUser().getDisplayName());\n SharedPref.instance.putPassword(firebaseAuth.getCurrentUser().getUid());\n SharedPref.instance.putUrlAvatar(String.valueOf(firebaseAuth.getCurrentUser().getPhotoUrl()));\n SharedPref.instance.putUser(firebaseAuth.getCurrentUser().getDisplayName());\n SharedPref.instance.putEmail(firebaseAuth.getCurrentUser().getEmail());\n username = firebaseAuth.getCurrentUser().getEmail();\n password = firebaseAuth.getCurrentUser().getUid();\n\n UserService userService = NetContext.instance.create(UserService.class);\n MediaType jsonType = MediaType.parse(\"application/json\");\n String loginJson = (new Gson().toJson(new UserRegisterResponseJson(username, password)));\n final RequestBody loginBody = RequestBody.create(jsonType, loginJson);\n // create call\n Call<Token> loginCall = userService.postNewAccount(loginBody);\n loginCall.enqueue(new Callback<Token>() {\n @Override\n public void onResponse(Call<Token> call, Response<Token> response) {\n DBContext.instance.cleanCart();\n SharedPref.instance.putCount(0);\n //EventBus.getDefault().postSticky(new SentUserIdEvent(u.getId().get$oid()));\n //Dang nhap 1 tai khoan moi hay tai khoan cu deu tra ve 307\n if (response.code() == 307){\n login(username, password);\n } else {\n Toast.makeText(LoginActivity.this, \"Could not parse body\", Toast.LENGTH_SHORT).show();\n }\n }\n\n @Override\n public void onFailure(Call<Token> call, Throwable t) {\n Toast.makeText(LoginActivity.this, \"Lỗi xác minh tài khoản google!\", Toast.LENGTH_SHORT).show();\n progressDialog.dismiss();\n }\n });\n }\n }", "public static void signUp(final String email, String password, final String fullName, final String pictureUrl, final Activity activity) {\n Statics.auth.createUserWithEmailAndPassword(email, password)\n .addOnSuccessListener(new OnSuccessListener<AuthResult>() {\n @Override\n public void onSuccess(AuthResult authResult) {\n // add user to database\n Log.d(\"Test\",\"Facebook to firebase success\");\n User userToAdd = new User();\n userToAdd.setEmailAddress(email);\n String[] splited = fullName.split(\"\\\\s+\");\n userToAdd.setFirstName(splited[0]);\n userToAdd.setLastName(splited[1]);\n userToAdd.setPictureUrl(pictureUrl);\n usersTable.child(FirebaseAuth.getInstance().getCurrentUser().getUid()).setValue(userToAdd).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Log.d(\"Failure\",e.getMessage());\n }\n });\n Toast.makeText(activity, \"added to database \", Toast.LENGTH_LONG).show();\n }\n }).addOnCompleteListener(new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n Log.d(\"Test\",\"Facebook ato firebase success\");\n\n }\n });\n }", "private void configureGoogleClient() {\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n // for the requestIdToken, this is in the values.xml file that\n // is generated from your google-services.json\n .requestIdToken(getString(R.string.default_web_client_id))\n .requestEmail()\n .build();\n // Build a GoogleSignInClient with the options specified by gso.\n googleSignInClient = GoogleSignIn.getClient(this, gso);\n // Initialize Firebase Auth\n firebaseAuth = FirebaseAuth.getInstance();\n }", "public void addAccount() {\n\n String path = addPhotoToFirebase();\n // Rescue.currentRescue.setImageStorageReference(addPhotoToFirebase());\n\n\n DocumentReference newDoc = MainActivity.firestore.collection(\"rescue\").document();\n\n Map<String, Object> newRescue = new HashMap<>();\n newRescue.put(\"city\", city);\n newRescue.put(\"email\", email);\n newRescue.put(\"organization\", name);\n newRescue.put(\"state\", state);\n newRescue.put(\"street\", street);\n newRescue.put(\"username\", username);\n newRescue.put(\"zip\", zip);\n newRescue.put(\"image\", path);\n newRescue.put(\"rescueID\", newDoc.getId());\n\n newDoc.set(newRescue);\n\n\n Map<String, Object> newAccount = new HashMap<>();\n newAccount.put(\"username\", username);\n newAccount.put(\"password\", Account.getMD5(password));\n newAccount.put(\"isAdopter\", false);\n\n\n MainActivity.firestore.collection(\"account\").document(username)\n .set(newAccount);\n\n\n Rescue.currentRescue =\n new Rescue(bitmap, name, street, city, state, zip, email, path);\n Rescue.currentRescue.setRescueID(newDoc.getId());\n Rescue.currentRescue.setUsername(username);\n Account.currentAccount = new Account(username, password, false);\n\n }", "private MockClientFacade() {\n\t\t//this.c = Client.getInstance();\n\t}", "@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"Firebase read \", \"Failed to read value.\", error.toException());\n }", "public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n @SuppressWarnings(\"VisibleForTests\")\n Uri downloadUrI = taskSnapshot.getDownloadUrl();\n FirebasePost firebasePost = new FirebasePost();\n firebasePost.imageUrl = downloadUrI.toString();\n myImage.child(\"home\").setValue(firebasePost);\n\n\n }", "@Override\n\t\t\tpublic void onCancelled(FirebaseError arg0) {\n\t\t\t\t\n\t\t\t}", "@Before\n public void setUpAcceptedRequest() {\n // create a mock book\n Book book = new Book(\"test owner\", \"test owner id\");\n book.setTitle(\"test title\");\n book.setAuthor(\"test author\");\n book.setIsbn(\"11223344556677889900\");\n\n // upload the mock accepted request for the mock book\n String email = FirebaseAuth.getInstance().getCurrentUser().getEmail();\n Database.getUserFromEmail(email)\n .addOnSuccessListener(queryDocumentSnapshots -> {\n DocumentSnapshot doc = queryDocumentSnapshots.getDocuments().get(0);\n Request request = new Request(book, doc.toObject(User.class), \"available\");\n request.getCreator().setUsername(doc.getId());\n Database.createRequest(request)\n .addOnSuccessListener(e -> {\n setUpHelper(doc.getId());\n })\n .addOnFailureListener(e -> {\n fail(\"failed creating request\");\n });\n });\n\n // Initialize the solo instance on BorrowerMainActivity\n solo = new Solo(InstrumentationRegistry.getInstrumentation(), rule.getActivity());\n solo.sleep(3000);\n }", "private RefereesInLeagueDBAccess() {\n\n }", "private void initGoogleClient() {\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestIdToken(getString(R.string.default_web_client_id))\n .requestEmail()\n .build();\n\n mGoogleSignInClient = GoogleSignIn.getClient(this, gso);\n\n // [START initialize_auth]\n // Initialize Firebase Auth\n // [END initialize_auth]\n }", "@Override\n public void onVerificationFailed(FirebaseException e) {\n Log.w(TAG, \"onVerificationFailed\", e);\n\n if (e instanceof FirebaseAuthInvalidCredentialsException) {\n // Invalid request\n } else if (e instanceof FirebaseTooManyRequestsException) {\n // The SMS quota for the project has been exceeded\n }\n\n // Show a message and update the UI\n }", "public static DatabaseReference getBase() {\n return FirebaseDatabase.getInstance().getReference();\n }", "@Override\n public void onAuthenticationError(FirebaseError firebaseError) {\n Log.d(\"LOGIN\", \"Error logging in after creating user\");\n }", "@Override\n protected void onStart() {\n super.onStart();\n\n // NOT ALLOWED: using multiple `orderBy` statements in the same line.\n Log.d(TAG, currUserID);\n Query query = databaseReferenceGroup.orderByChild(\"/groupMembers/\" + currUserID).equalTo(currUserID);\n\n FirebaseRecyclerOptions<Group> firebaseRecyclerOptions = new FirebaseRecyclerOptions\n .Builder<Group>()\n .setQuery(query, Group.class)\n .build();\n\n FirebaseRecyclerAdapter<Group, GroupDisplay> firebaseRecyclerAdapter = new FirebaseRecyclerAdapter<Group, GroupDisplay>(firebaseRecyclerOptions) {\n @NonNull\n @Override\n public GroupDisplay onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {\n // Inflate the group card view\n View view = LayoutInflater\n .from(parent.getContext())\n .inflate(R.layout.activity_display_group_database, parent, false);\n return new GroupDisplay(view);\n }\n\n @Override\n protected void onBindViewHolder(@NonNull GroupDisplay holder, int position, @NonNull Group model) {\n // It is what is going to display on the group card view\n holder.setGroupName(model.getGroupName());\n Map<String, String> groupMembersMap = model.getGroupMembers();\n Map<String, String> groupAdmins = model.getGroupAdmins();\n\n if (groupMembersMap.size() > 1){\n for (String userID : groupMembersMap.keySet()){\n Query queryToGetMemberName = databaseReference.child(\"User\").child(userID).child(\"userName\");\n queryToGetMemberName.addListenerForSingleValueEvent(new ValueEventListener(){\n @Override\n public void onDataChange(@NonNull DataSnapshot dataSnapshot){\n String memberName = dataSnapshot.getValue(String.class);\n holder.addMemberToGroupMembersStr(memberName);\n Log.d(TAG, \"Member Name: \" + memberName);\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError error) {\n Log.d(TAG, \"Unable to get groupMemberName: \" + error);\n }\n });\n }\n } else {\n holder.setGroupMembersStr(\"Only You\");\n }\n\n // If you click the group, it will open the create task activity\n holder.view.setOnClickListener((view) -> {\n Intent intent;\n\n //Here we check if the currUser is an Admin.\n if (groupAdmins.containsKey(currUserID)) {\n intent = new Intent(CreateGroup.this, CreateTaskAdmin.class);\n } else {\n intent = new Intent(CreateGroup.this, CreateTaskUser.class);\n }\n\n // How do I pass data between Activities in Android application\n // https://stackoverflow.com/questions/2091465/how-do-i-pass-data-between-activities-in-android-application\n // How to use putExtra() and getExtra() for string data\n // https://stackoverflow.com/questions/5265913/how-to-use-putextra-and-getextra-for-string-data\n // It is the name of group that you click\n\n String groupNameStr = model.getGroupName();\n intent.putExtra(\"EXTRA_GROUP_NAME\", groupNameStr);\n\n // Count user and admin\n int groupMembersCount = groupMembersMap.size();\n intent.putExtra(\"EXTRA_MEMBER_COUNT\", Integer.toString(groupMembersCount));\n\n int groupAdminsCount = groupAdmins.size();\n intent.putExtra(\"EXTRA_ADMIN_COUNT\", Integer.toString(groupAdminsCount));\n\n // pass the groupID to the intent.\n intent.putExtra(\"EXTRA_GROUP_ID\", model.getGroupId());\n\n startActivity(intent);\n });\n }\n };\n\n // Attach the adapter\n recyclerViewGroup.setAdapter(firebaseRecyclerAdapter);\n firebaseRecyclerAdapter.startListening();\n }", "private void addToRealDB(String GoogleId){\n this.newUser.setGOOGLE_ID(GoogleId);\n dbRootRef.child(USERS).child(this.newUser.getGOOGLE_ID()).setValue(this.newUser);\n dbRootRef.child(USERS_NOTES).child(this.newUser.getGOOGLE_ID()).child(\"numOfNotesInAllTime\").setValue(\"0\");\n }", "private InternalStorage() {}", "void UploadToFirebase() {\n // This gives the path name for the storage\n StorageReference photoRef = mStorageRef.child(\"images\").child(selectedImageUri.getLastPathSegment());\n\n // This uploads it into firebase storage\n // Toast makes the little comment appear at the bottom of the screen\n photoRef.putFile(selectedImageUri).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @SuppressLint(\"ShowToast\")\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n Toast toast = Toast.makeText(getApplicationContext(), \"Uploaded\", Toast.LENGTH_SHORT);\n toast.show();\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @SuppressLint(\"ShowToast\")\n @Override\n public void onFailure(@NonNull Exception e) {\n Toast toast = Toast.makeText(getApplicationContext(), \"Upload failed\", Toast.LENGTH_SHORT);\n toast.show();\n }\n });\n }", "public static FirebaseAuth getFirebaseAutenticacao() {\n if (referenciaAutenticacao == null) {\n referenciaAutenticacao = FirebaseAuth.getInstance();\n }\n\n return referenciaAutenticacao;\n }", "synchronized public FirebaseAuth getDefaultFirebaseAuth() {\n if (mFirebaseAuth == null) {\n mFirebaseAuth = FirebaseAuth.getInstance();\n }\n\n return mFirebaseAuth;\n }", "@Before\n public void setUp(){\n mockStatic(JcrUtil.class);\n mockStatic(JcrUtils.class);\n }", "private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {\n\n AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);\n fbAuth.signInWithCredential(credential)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n // Sign in success, update UI with the signed-in user's information\n //Log.d(TAG, \"signInWithCredential:success\");\n FirebaseUser user = fbAuth.getCurrentUser();\n UserModel userModel=new UserModel();\n userModel.setEmail(user.getEmail());\n userModel.setDisplayName(user.getDisplayName());\n userModel.setPhotoUrl(user.getPhotoUrl().toString());\n userModel.setUid(user.getUid());\n UserFBDB userFBDB = new UserFBDB();\n userFBDB.save(userModel);\n updateUI(user);\n } else {\n // If sign in fails, display a message to the user.\n //Log.w(TAG, \"signInWithCredential:failure\", task.getException());\n Exception ex=task.getException();\n signupWithGoogleBtn.setVisibility(View.VISIBLE);\n mProgress.setVisibility(View.INVISIBLE);\n Toast.makeText(SignupActivity.this, \"Authentication failed.\",\n Toast.LENGTH_SHORT).show();\n //updateUI(null);\n }\n\n // ...\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Log.d(\"singn\", e.getMessage());\n }\n });\n }", "private void upToFireBase(Bill _bill)\n {\n Log.d(\"RECORD\", \"Up to firebase\"+_fbfs);\n String _number_room = _bill.getRoom().getPhase()+String.valueOf(_bill.getRoom().getFloor())+_bill.getRoom().getNumber_room();\n _fbfs.collection(\"Resident\")\n .document(\"USER\")\n .collection(_number_room)\n .document(_bill.getMonth()+_bill.getYear())\n .set(_bill)\n .addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n Log.d(\"RECORD\", \"SUCCESS\");\n PHASE_CHOOSE = _room.getPhase();\n FLOOR_CHOOSE = String.valueOf(_room.getFloor());\n goToNextPage();\n Toast.makeText(getActivity(), \"Success\", Toast.LENGTH_SHORT).show();\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Log.d(\"RECORD\", \"FAILED\");\n Toast.makeText(getActivity(), \"Not found\", Toast.LENGTH_SHORT).show();\n }\n });\n }", "private void attemptLogin2(String emailString,String passwordString) {\n FirebaseDatabase skoovyDatabase = FirebaseDatabase.getInstance();\r\n // Get a reference to our userInfo node\r\n DatabaseReference currentSkoovyUsers = skoovyDatabase.getReference(\"userInfo\");\r\n mAuth.signInWithEmailAndPassword(email, password)\r\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\r\n @Override\r\n public void onComplete(@NonNull Task<AuthResult> task) {\r\n //Log.d(TAG, \"signInWithEmail:onComplete:\" + task.isSuccessful());\r\n Toast.makeText(loginActivity.this, \"login successful\",\r\n Toast.LENGTH_SHORT).show();\r\n // If sign in fails, display a message to the user. If sign in succeeds\r\n // the auth state listener will be notified and logic to handle the\r\n // signed in user can be handled in the listener.\r\n if (!task.isSuccessful()) {\r\n //Log.w(TAG, \"signInWithEmail:failed\", task.getException());\r\n Toast.makeText(loginActivity.this, \"login failed\",\r\n Toast.LENGTH_SHORT).show();\r\n }\r\n\r\n // ...\r\n }\r\n });\r\n }", "@Before\n\tpublic void setUp()\n\t{\n\t\tm_mockery = new Mockery();\n\t\tm_values = m_mockery.mock(KeyedValues.class);\n\t}" ]
[ "0.738583", "0.66798776", "0.66244763", "0.6611554", "0.6572415", "0.65126055", "0.6214612", "0.6167451", "0.61543226", "0.6137463", "0.6028123", "0.6026762", "0.5989772", "0.5968806", "0.59356654", "0.58465886", "0.5839321", "0.58181375", "0.5808987", "0.58020693", "0.5772249", "0.5768383", "0.57494885", "0.5713046", "0.5693023", "0.5692495", "0.56776303", "0.5671845", "0.5651013", "0.5649787", "0.5643411", "0.5643411", "0.5643411", "0.5643411", "0.56360775", "0.5615091", "0.5609039", "0.5596996", "0.55657935", "0.5513114", "0.5512135", "0.5494926", "0.5490752", "0.5423806", "0.54198337", "0.5385415", "0.5368879", "0.53588146", "0.53186053", "0.5316832", "0.5310492", "0.5289764", "0.5285682", "0.52611244", "0.5256098", "0.5251516", "0.52293664", "0.52078193", "0.52043027", "0.5179631", "0.51687354", "0.5149912", "0.51448816", "0.51274264", "0.51274264", "0.5125362", "0.51183605", "0.508469", "0.5080815", "0.50726324", "0.50687295", "0.5066272", "0.5059723", "0.5056112", "0.5054239", "0.5051742", "0.5037516", "0.503451", "0.503082", "0.5029079", "0.50265586", "0.5014326", "0.50050396", "0.50029457", "0.49982005", "0.49855727", "0.49825573", "0.49688542", "0.49675825", "0.4967203", "0.49663353", "0.49654794", "0.4963563", "0.49623445", "0.49614912", "0.49608445", "0.49548298", "0.49544695", "0.49488372", "0.4935197", "0.49288118" ]
0.0
-1
write your code here
public void push(int element) { stack1.push(element); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void logic(){\r\n\r\n\t}", "public static void generateCode()\n {\n \n }", "@Override\n\tprotected void logic() {\n\n\t}", "private static void cajas() {\n\t\t\n\t}", "void pramitiTechTutorials() {\n\t\n}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "public void ganar() {\n // TODO implement here\n }", "public static void main(String[] args) {\n // write your code here - this is called comment and it always starts with double slash\n // and comlier will ignore this because of the // sign.\n // I am gonna say hello\n // JAVA IS CASE SENSITIVE LANGUAGE\n // System and system are very different things in java\n //Hello AND hello are different for java\n // System.out.println(\"Hello Batch 15!\");\n // System.out.println(\"I am still here.\");\n // System.out.println(\"I love Java.\");\n\n // Write a program to display your information.\n // When you run it, it should have this outcome.\n // I am your name here\n // I am from batch 15\n // I am from your city here\n // I love Java\n\n System.out.println(\"I am Sevim.\");\n System.out.println(\"I am from Batch 15.\");\n System.out.println(\"I'm from New Jersey.\");\n System.out.println(\"I love Java.\");\n\n\n\n }", "CD withCode();", "private stendhal() {\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "public void gored() {\n\t\t\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\r\n\tpublic void runn() {\n\t\t\r\n\t}", "public void genCode(CodeFile code) {\n\t\t\n\t}", "public void hello(){\n\t\t\r\n \t\r\n\t\t\r\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "public void baocun() {\n\t\t\n\t}", "public void mo38117a() {\n }", "public void furyo ()\t{\n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "private void strin() {\n\n\t}", "public void themesa()\n {\n \n \n \n \n }", "Programming(){\n\t}", "@Override\n\tvoid output() {\n\t\t\n\t}", "private void yy() {\n\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "void rajib () {\n\t\t \n\t\t System.out.println(\"Rajib is IT Eng\");\n\t }", "private void kk12() {\n\n\t}", "public void edit() {\n\t\tSystem.out.println(\"编写java笔记\");\r\n\t}", "public static void main(String[] args) {\n\t// write your code here\n }", "private static void ThridUmpireReview() {\n\t\tSystem.out.println(\" Umpier Reviews the Score Board\");\n\t\t \n\t\t\n\t}", "@Override\r\n\t\tpublic void doDomething() {\r\n\t\t\tSystem.out.println(\"I am here\");\r\n\t\t\t\r\n\t\t}", "protected void mo6255a() {\n }", "public void gen(CodeSeq code, ICodeEnv env) {\n\r\n\t}", "@Override\n\tpublic void function() {\n\t\t\n\t}", "public void working()\n {\n \n \n }", "@Override\n\tprotected void postRun() {\n\n\t}", "public void perder() {\n // TODO implement here\n }", "public void smell() {\n\t\t\n\t}", "protected void execute() {\n\t\t\n\t}", "public void mo55254a() {\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tpublic void orgasm() {\n\t\t\n\t}", "public void cocinar(){\n\n }", "@Override\r\n\tvoid func04() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}", "@Override\n\tprotected void interr() {\n\t}", "public void run() {\n\t\t\t\t\n\t\t\t}", "protected void execute() {\n\n\n \n }", "@Override\n public void execute() {\n \n \n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\r\n\tpublic void crawl_data() {\n\t\t\r\n\t}", "@Override\n public void memoria() {\n \n }", "public static void main(String args[]) throws Exception\n {\n \n \n \n }", "@Override\r\n\tpublic void code() {\n\t\tus.code();\r\n\t\tSystem.out.println(\"我会java...\");\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "protected void display() {\n\r\n\t}", "private void sout() {\n\t\t\n\t}", "private static void oneUserExample()\t{\n\t}", "public void nhapdltextlh(){\n\n }", "public void miseAJour();", "protected void additionalProcessing() {\n\t}", "private void sub() {\n\n\t}", "@Override\n\tpublic void view() {\n\t\t\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void engine() {\r\n\t\t// TODO Auto-generated method stub\t\t\r\n\t}", "@Override\r\n\tpublic void code() {\n\t\tSystem.out.println(\"我会C语言....\");\r\n\t}", "void mo67924c();", "@Override\n\tpublic void dosomething() {\n\t\t\n\t}", "@Override\r\n public void run() {\n basicEditor.createEdge(); // replaced Bibianas method with Moritz Roidl, Orthodoxos Kipouridis\r\n }", "public void mo5382o() {\n }", "@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void doF6() {\n\t\t\r\n\t}", "public void mo3376r() {\n }", "public static void main(String[] args)\r\n {\n System.out.println(\"Mehedi Hasan Nirob\");\r\n //multiple line comment\r\n /*\r\n At first printing my phone number\r\n then print my address \r\n then print my university name\r\n */\r\n System.out.println(\"01736121659\\nJamalpur\\nDhaka International University\");\r\n \r\n }", "void kiemTraThangHopLi() {\n }", "public void skystonePos5() {\n }", "public final void cpp() {\n }", "public final void mo51373a() {\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(\"This is the main class of this project\");\r\n\t\tSystem.out.println(\"how about this\");\r\n\r\n\t\t\r\n\t\tSystem.out.println(\"new push\");\r\n\r\n\t\t//how to update this line\r\n\t\t\r\n\t\tSystem.out.println(\"hello there\");\r\n\r\n\t\tSystem.out.println(\"zen me shuoXXXXXXXXXXXKKKKkKKKKKKXXXXXXXX\");\r\n\r\n\t\tSystem.out.println(\"eventually we succeeded!\");\r\n\t\t//wa!!!\r\n\t\t\r\n\r\n\r\n\t\t//hen shu fu !\r\n\t\t\r\n\t\t//it is a good day\r\n\t\t\r\n\t\t//testing\r\n\r\n\t\t\r\n\t\tSystem.out.println(\"hope it works\");\r\n\t\t\r\n\r\n\t\t\r\n\r\n\t}", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}" ]
[ "0.61019534", "0.6054925", "0.58806974", "0.58270746", "0.5796887", "0.56999695", "0.5690986", "0.56556827", "0.5648637", "0.5640487", "0.56354505", "0.56032085", "0.56016207", "0.56006724", "0.5589654", "0.5583692", "0.55785793", "0.55733466", "0.5560209", "0.55325305", "0.55133164", "0.55123806", "0.55114794", "0.5500045", "0.5489272", "0.5482718", "0.5482718", "0.5477585", "0.5477585", "0.54645246", "0.5461012", "0.54548836", "0.5442613", "0.5430592", "0.5423748", "0.5419415", "0.5407118", "0.54048806", "0.5399331", "0.539896", "0.5389593", "0.5386248", "0.5378453", "0.53751254", "0.5360644", "0.5357343", "0.5345515", "0.53441405", "0.5322276", "0.5318302", "0.53118485", "0.53118485", "0.53085434", "0.530508", "0.53038436", "0.5301922", "0.5296964", "0.52920514", "0.52903354", "0.5289583", "0.5287506", "0.52869135", "0.5286737", "0.5286737", "0.5286737", "0.5286737", "0.5286737", "0.5286737", "0.5286737", "0.52859664", "0.52849185", "0.52817136", "0.52791214", "0.5278664", "0.5278048", "0.5276269", "0.52728665", "0.5265451", "0.526483", "0.526005", "0.5259683", "0.52577406", "0.5257731", "0.5257731", "0.52560073", "0.5255759", "0.5255707", "0.5250705", "0.5246863", "0.5243053", "0.52429926", "0.5242727", "0.52396125", "0.5239378", "0.5232576", "0.5224529", "0.52240705", "0.52210563", "0.52203166", "0.521787", "0.52172214" ]
0.0
-1
write your code here
public int pop() { if(!stack2.isEmpty()) return stack2.pop(); else { while(!stack1.isEmpty()) { stack2.push(stack1.pop()); } return stack2.pop(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void logic(){\r\n\r\n\t}", "public static void generateCode()\n {\n \n }", "@Override\n\tprotected void logic() {\n\n\t}", "private static void cajas() {\n\t\t\n\t}", "void pramitiTechTutorials() {\n\t\n}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "public void ganar() {\n // TODO implement here\n }", "public static void main(String[] args) {\n // write your code here - this is called comment and it always starts with double slash\n // and comlier will ignore this because of the // sign.\n // I am gonna say hello\n // JAVA IS CASE SENSITIVE LANGUAGE\n // System and system are very different things in java\n //Hello AND hello are different for java\n // System.out.println(\"Hello Batch 15!\");\n // System.out.println(\"I am still here.\");\n // System.out.println(\"I love Java.\");\n\n // Write a program to display your information.\n // When you run it, it should have this outcome.\n // I am your name here\n // I am from batch 15\n // I am from your city here\n // I love Java\n\n System.out.println(\"I am Sevim.\");\n System.out.println(\"I am from Batch 15.\");\n System.out.println(\"I'm from New Jersey.\");\n System.out.println(\"I love Java.\");\n\n\n\n }", "CD withCode();", "private stendhal() {\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "public void gored() {\n\t\t\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\r\n\tpublic void runn() {\n\t\t\r\n\t}", "public void genCode(CodeFile code) {\n\t\t\n\t}", "public void hello(){\n\t\t\r\n \t\r\n\t\t\r\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "public void baocun() {\n\t\t\n\t}", "public void mo38117a() {\n }", "public void furyo ()\t{\n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "private void strin() {\n\n\t}", "public void themesa()\n {\n \n \n \n \n }", "Programming(){\n\t}", "@Override\n\tvoid output() {\n\t\t\n\t}", "private void yy() {\n\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "void rajib () {\n\t\t \n\t\t System.out.println(\"Rajib is IT Eng\");\n\t }", "private void kk12() {\n\n\t}", "public void edit() {\n\t\tSystem.out.println(\"编写java笔记\");\r\n\t}", "public static void main(String[] args) {\n\t// write your code here\n }", "private static void ThridUmpireReview() {\n\t\tSystem.out.println(\" Umpier Reviews the Score Board\");\n\t\t \n\t\t\n\t}", "@Override\r\n\t\tpublic void doDomething() {\r\n\t\t\tSystem.out.println(\"I am here\");\r\n\t\t\t\r\n\t\t}", "protected void mo6255a() {\n }", "public void gen(CodeSeq code, ICodeEnv env) {\n\r\n\t}", "@Override\n\tpublic void function() {\n\t\t\n\t}", "public void working()\n {\n \n \n }", "@Override\n\tprotected void postRun() {\n\n\t}", "public void perder() {\n // TODO implement here\n }", "public void smell() {\n\t\t\n\t}", "protected void execute() {\n\t\t\n\t}", "public void mo55254a() {\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tpublic void orgasm() {\n\t\t\n\t}", "public void cocinar(){\n\n }", "@Override\r\n\tvoid func04() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}", "@Override\n\tprotected void interr() {\n\t}", "public void run() {\n\t\t\t\t\n\t\t\t}", "protected void execute() {\n\n\n \n }", "@Override\n public void execute() {\n \n \n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\r\n\tpublic void crawl_data() {\n\t\t\r\n\t}", "@Override\n public void memoria() {\n \n }", "public static void main(String args[]) throws Exception\n {\n \n \n \n }", "@Override\r\n\tpublic void code() {\n\t\tus.code();\r\n\t\tSystem.out.println(\"我会java...\");\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "protected void display() {\n\r\n\t}", "private void sout() {\n\t\t\n\t}", "private static void oneUserExample()\t{\n\t}", "public void nhapdltextlh(){\n\n }", "public void miseAJour();", "protected void additionalProcessing() {\n\t}", "private void sub() {\n\n\t}", "@Override\n\tpublic void view() {\n\t\t\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void engine() {\r\n\t\t// TODO Auto-generated method stub\t\t\r\n\t}", "@Override\r\n\tpublic void code() {\n\t\tSystem.out.println(\"我会C语言....\");\r\n\t}", "void mo67924c();", "@Override\n\tpublic void dosomething() {\n\t\t\n\t}", "@Override\r\n public void run() {\n basicEditor.createEdge(); // replaced Bibianas method with Moritz Roidl, Orthodoxos Kipouridis\r\n }", "public void mo5382o() {\n }", "@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void doF6() {\n\t\t\r\n\t}", "public void mo3376r() {\n }", "public static void main(String[] args)\r\n {\n System.out.println(\"Mehedi Hasan Nirob\");\r\n //multiple line comment\r\n /*\r\n At first printing my phone number\r\n then print my address \r\n then print my university name\r\n */\r\n System.out.println(\"01736121659\\nJamalpur\\nDhaka International University\");\r\n \r\n }", "void kiemTraThangHopLi() {\n }", "public void skystonePos5() {\n }", "public final void cpp() {\n }", "public final void mo51373a() {\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(\"This is the main class of this project\");\r\n\t\tSystem.out.println(\"how about this\");\r\n\r\n\t\t\r\n\t\tSystem.out.println(\"new push\");\r\n\r\n\t\t//how to update this line\r\n\t\t\r\n\t\tSystem.out.println(\"hello there\");\r\n\r\n\t\tSystem.out.println(\"zen me shuoXXXXXXXXXXXKKKKkKKKKKKXXXXXXXX\");\r\n\r\n\t\tSystem.out.println(\"eventually we succeeded!\");\r\n\t\t//wa!!!\r\n\t\t\r\n\r\n\r\n\t\t//hen shu fu !\r\n\t\t\r\n\t\t//it is a good day\r\n\t\t\r\n\t\t//testing\r\n\r\n\t\t\r\n\t\tSystem.out.println(\"hope it works\");\r\n\t\t\r\n\r\n\t\t\r\n\r\n\t}", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}" ]
[ "0.61019534", "0.6054925", "0.58806974", "0.58270746", "0.5796887", "0.56999695", "0.5690986", "0.56556827", "0.5648637", "0.5640487", "0.56354505", "0.56032085", "0.56016207", "0.56006724", "0.5589654", "0.5583692", "0.55785793", "0.55733466", "0.5560209", "0.55325305", "0.55133164", "0.55123806", "0.55114794", "0.5500045", "0.5489272", "0.5482718", "0.5482718", "0.5477585", "0.5477585", "0.54645246", "0.5461012", "0.54548836", "0.5442613", "0.5430592", "0.5423748", "0.5419415", "0.5407118", "0.54048806", "0.5399331", "0.539896", "0.5389593", "0.5386248", "0.5378453", "0.53751254", "0.5360644", "0.5357343", "0.5345515", "0.53441405", "0.5322276", "0.5318302", "0.53118485", "0.53118485", "0.53085434", "0.530508", "0.53038436", "0.5301922", "0.5296964", "0.52920514", "0.52903354", "0.5289583", "0.5287506", "0.52869135", "0.5286737", "0.5286737", "0.5286737", "0.5286737", "0.5286737", "0.5286737", "0.5286737", "0.52859664", "0.52849185", "0.52817136", "0.52791214", "0.5278664", "0.5278048", "0.5276269", "0.52728665", "0.5265451", "0.526483", "0.526005", "0.5259683", "0.52577406", "0.5257731", "0.5257731", "0.52560073", "0.5255759", "0.5255707", "0.5250705", "0.5246863", "0.5243053", "0.52429926", "0.5242727", "0.52396125", "0.5239378", "0.5232576", "0.5224529", "0.52240705", "0.52210563", "0.52203166", "0.521787", "0.52172214" ]
0.0
-1
write your code here
public int top() { if(!stack2.isEmpty()) { Integer k = stack2.pop(); stack2.push(k); return k; } else { while(!stack1.isEmpty()) { stack2.push(stack1.pop()); } Integer k = stack2.pop(); stack2.push(k); return k; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void logic(){\r\n\r\n\t}", "public static void generateCode()\n {\n \n }", "@Override\n\tprotected void logic() {\n\n\t}", "private static void cajas() {\n\t\t\n\t}", "void pramitiTechTutorials() {\n\t\n}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "public void ganar() {\n // TODO implement here\n }", "public static void main(String[] args) {\n // write your code here - this is called comment and it always starts with double slash\n // and comlier will ignore this because of the // sign.\n // I am gonna say hello\n // JAVA IS CASE SENSITIVE LANGUAGE\n // System and system are very different things in java\n //Hello AND hello are different for java\n // System.out.println(\"Hello Batch 15!\");\n // System.out.println(\"I am still here.\");\n // System.out.println(\"I love Java.\");\n\n // Write a program to display your information.\n // When you run it, it should have this outcome.\n // I am your name here\n // I am from batch 15\n // I am from your city here\n // I love Java\n\n System.out.println(\"I am Sevim.\");\n System.out.println(\"I am from Batch 15.\");\n System.out.println(\"I'm from New Jersey.\");\n System.out.println(\"I love Java.\");\n\n\n\n }", "CD withCode();", "private stendhal() {\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "public void gored() {\n\t\t\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\r\n\tpublic void runn() {\n\t\t\r\n\t}", "public void genCode(CodeFile code) {\n\t\t\n\t}", "public void hello(){\n\t\t\r\n \t\r\n\t\t\r\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "public void baocun() {\n\t\t\n\t}", "public void mo38117a() {\n }", "public void furyo ()\t{\n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "private void strin() {\n\n\t}", "public void themesa()\n {\n \n \n \n \n }", "Programming(){\n\t}", "@Override\n\tvoid output() {\n\t\t\n\t}", "private void yy() {\n\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "void rajib () {\n\t\t \n\t\t System.out.println(\"Rajib is IT Eng\");\n\t }", "private void kk12() {\n\n\t}", "public void edit() {\n\t\tSystem.out.println(\"编写java笔记\");\r\n\t}", "public static void main(String[] args) {\n\t// write your code here\n }", "private static void ThridUmpireReview() {\n\t\tSystem.out.println(\" Umpier Reviews the Score Board\");\n\t\t \n\t\t\n\t}", "@Override\r\n\t\tpublic void doDomething() {\r\n\t\t\tSystem.out.println(\"I am here\");\r\n\t\t\t\r\n\t\t}", "protected void mo6255a() {\n }", "public void gen(CodeSeq code, ICodeEnv env) {\n\r\n\t}", "@Override\n\tpublic void function() {\n\t\t\n\t}", "public void working()\n {\n \n \n }", "@Override\n\tprotected void postRun() {\n\n\t}", "public void perder() {\n // TODO implement here\n }", "public void smell() {\n\t\t\n\t}", "protected void execute() {\n\t\t\n\t}", "public void mo55254a() {\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tpublic void orgasm() {\n\t\t\n\t}", "public void cocinar(){\n\n }", "@Override\r\n\tvoid func04() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}", "@Override\n\tprotected void interr() {\n\t}", "public void run() {\n\t\t\t\t\n\t\t\t}", "protected void execute() {\n\n\n \n }", "@Override\n public void execute() {\n \n \n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\r\n\tpublic void crawl_data() {\n\t\t\r\n\t}", "@Override\n public void memoria() {\n \n }", "public static void main(String args[]) throws Exception\n {\n \n \n \n }", "@Override\r\n\tpublic void code() {\n\t\tus.code();\r\n\t\tSystem.out.println(\"我会java...\");\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "protected void display() {\n\r\n\t}", "private void sout() {\n\t\t\n\t}", "private static void oneUserExample()\t{\n\t}", "public void nhapdltextlh(){\n\n }", "public void miseAJour();", "protected void additionalProcessing() {\n\t}", "private void sub() {\n\n\t}", "@Override\n\tpublic void view() {\n\t\t\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void engine() {\r\n\t\t// TODO Auto-generated method stub\t\t\r\n\t}", "@Override\r\n\tpublic void code() {\n\t\tSystem.out.println(\"我会C语言....\");\r\n\t}", "void mo67924c();", "@Override\n\tpublic void dosomething() {\n\t\t\n\t}", "@Override\r\n public void run() {\n basicEditor.createEdge(); // replaced Bibianas method with Moritz Roidl, Orthodoxos Kipouridis\r\n }", "public void mo5382o() {\n }", "@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void doF6() {\n\t\t\r\n\t}", "public void mo3376r() {\n }", "public static void main(String[] args)\r\n {\n System.out.println(\"Mehedi Hasan Nirob\");\r\n //multiple line comment\r\n /*\r\n At first printing my phone number\r\n then print my address \r\n then print my university name\r\n */\r\n System.out.println(\"01736121659\\nJamalpur\\nDhaka International University\");\r\n \r\n }", "void kiemTraThangHopLi() {\n }", "public void skystonePos5() {\n }", "public final void cpp() {\n }", "public final void mo51373a() {\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(\"This is the main class of this project\");\r\n\t\tSystem.out.println(\"how about this\");\r\n\r\n\t\t\r\n\t\tSystem.out.println(\"new push\");\r\n\r\n\t\t//how to update this line\r\n\t\t\r\n\t\tSystem.out.println(\"hello there\");\r\n\r\n\t\tSystem.out.println(\"zen me shuoXXXXXXXXXXXKKKKkKKKKKKXXXXXXXX\");\r\n\r\n\t\tSystem.out.println(\"eventually we succeeded!\");\r\n\t\t//wa!!!\r\n\t\t\r\n\r\n\r\n\t\t//hen shu fu !\r\n\t\t\r\n\t\t//it is a good day\r\n\t\t\r\n\t\t//testing\r\n\r\n\t\t\r\n\t\tSystem.out.println(\"hope it works\");\r\n\t\t\r\n\r\n\t\t\r\n\r\n\t}", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}" ]
[ "0.61019534", "0.6054925", "0.58806974", "0.58270746", "0.5796887", "0.56999695", "0.5690986", "0.56556827", "0.5648637", "0.5640487", "0.56354505", "0.56032085", "0.56016207", "0.56006724", "0.5589654", "0.5583692", "0.55785793", "0.55733466", "0.5560209", "0.55325305", "0.55133164", "0.55123806", "0.55114794", "0.5500045", "0.5489272", "0.5482718", "0.5482718", "0.5477585", "0.5477585", "0.54645246", "0.5461012", "0.54548836", "0.5442613", "0.5430592", "0.5423748", "0.5419415", "0.5407118", "0.54048806", "0.5399331", "0.539896", "0.5389593", "0.5386248", "0.5378453", "0.53751254", "0.5360644", "0.5357343", "0.5345515", "0.53441405", "0.5322276", "0.5318302", "0.53118485", "0.53118485", "0.53085434", "0.530508", "0.53038436", "0.5301922", "0.5296964", "0.52920514", "0.52903354", "0.5289583", "0.5287506", "0.52869135", "0.5286737", "0.5286737", "0.5286737", "0.5286737", "0.5286737", "0.5286737", "0.5286737", "0.52859664", "0.52849185", "0.52817136", "0.52791214", "0.5278664", "0.5278048", "0.5276269", "0.52728665", "0.5265451", "0.526483", "0.526005", "0.5259683", "0.52577406", "0.5257731", "0.5257731", "0.52560073", "0.5255759", "0.5255707", "0.5250705", "0.5246863", "0.5243053", "0.52429926", "0.5242727", "0.52396125", "0.5239378", "0.5232576", "0.5224529", "0.52240705", "0.52210563", "0.52203166", "0.521787", "0.52172214" ]
0.0
-1
mission 1 O(1)// ////////////// DON'T DELETE THIS CONSTRUCTOR ////////////////
public DataStructure() { this.minx = null; this.maxx = null; this.miny = null; this.maxy = null; this.current = null; size = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Constructor(){\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "protected abstract void construct();", "public Pleasure() {\r\n\t\t}", "private SingleObject()\r\n {\r\n }", "private UniqueChromosomeReconstructor() { }", "public Self__1() {\n }", "public CacheFIFO()\r\n/* 16: */ {\r\n/* 17: 95 */ this(20);\r\n/* 18: */ }", "public lo() {}", "O() { super(null); }", "private void __sep__Constructors__() {}", "private SimpleRepository() {\n \t\t// private ct to disallow external object creation\n \t}", "public static void copyConstructor(){\n\t}", "private HailstoneSequence(){ // This private constructor hides the implicit public one\r\n\r\n}", "Reproducible newInstance();", "private Rekenhulp()\n\t{\n\t}", "private Solution() { }", "private Solution() { }", "private SingleObject(){}", "public ArrayAccess()\r\n {\r\n }", "public Clade() {}", "private TMCourse() {\n\t}", "protected AbstractSpliterator(long param1Long, int param1Int) {\n/* 1274 */ this.est = param1Long;\n/* 1275 */ this.characteristics = ((param1Int & 0x40) != 0) ? (param1Int | 0x4000) : param1Int;\n/* */ }", "private SimplexComparator() {}", "private PSUniqueObjectGenerator()\n {\n }", "private Heap() { }", "private Heap() { }", "private ChainingMethods() {\n // private constructor\n\n }", "private BigB()\r\n{\tsuper();\t\r\n}", "public Orbiter() {\n }", "private Solution() {\n //constructor\n }", "protected SimpleMatrix() {}", "public IntHashSet()\n/* */ {\n/* 69 */ this(0, 0.3D);\n/* */ }", "Memory() {}", "private OMUtil() { }", "private ObjectRepository() {\n\t}", "public MethodEx2() {\n \n }", "private ATCres() {\r\n // prevent to instantiate this class\r\n }", "public Naive() {\n\n }", "private IdentifiableComparator() {\n\t\t// This class is not intended to create own objects from it.\n\t}", "private Solution() {\n }", "Composite() {\n\n\t}", "public NativePrimitiveArrayStateManagerImpl()\n {\n }", "private AlgorithmTools() {}", "public CSSTidier() {\n\t}", "private IndexBitmapObject() {\n\t}", "private Solution() {\n\n }", "public Member() {}", "protected OpinionFinding() {/* intentionally empty block */}", "private Mth()\n\t{\n\t\tthrow new AssertionError();\n\t}", "public OrdinaryTruck() {\n\t\tsuper();\n\t\tmaxCapacity = 1000;\n\t}", "private ObjectFactory() { }", "public DoublyLL()\r\n\t{\r\n\t\tstart = null;\r\n\t\t//end = null;\r\n\t\tsize = 0;\r\n\t}", "public AbstractCache() {\n }", "public CacheFIFO(int paramInt)\r\n/* 11: */ {\r\n/* 12: 84 */ super(paramInt);\r\n/* 13: */ }", "private TopM() {}", "protected GeometricObject() \n\t{\n\t\tdateCreated = new java.util.Date();\n\t}", "protected DenseMatrix()\n\t{\n\t}", "private Singleton()\n\t\t{\n\t\t}", "private Logistic() {\n }", "public ObjectUtils() {\n super();\n }", "private DiscretePotentialOperations() {\r\n\t}", "private Composite() {\n }", "Merge() {\n //Unused Constructor.\n }", "private SingleObject(){\n }", "private EagerlySinleton()\n\t{\n\t}", "public Pitonyak_09_02() {\r\n }", "@SuppressWarnings(\"unused\")\n public NoConstructor() {\n // Empty\n }", "private SingletonObject() {\n\n\t}", "public D() {}", "public LocalObject() {}", "protected AbstractLongSpliterator(long param1Long, int param1Int) {\n/* 1507 */ this.est = param1Long;\n/* 1508 */ this.characteristics = ((param1Int & 0x40) != 0) ? (param1Int | 0x4000) : param1Int;\n/* */ }", "private Node() {\n\n }", "public Identity() {\n\n\t}", "public StructureCustom(){\r\n\t\tsetMonotonicity(Monotonicity.DECREASING);\r\n\t}", "private CostHelper() {}", "private Singletion3() {}", "protected Problem() {/* intentionally empty block */}", "public AllDifferent()\n {\n this(0);\n }", "private Consts(){\n //this prevents even the native class from \n //calling this ctor as well :\n throw new AssertionError();\n }", "public Complex(){\r\n\t this(0,0);\r\n\t}", "protected TestBench() {}", "private TbusRoadGraph() {}", "private SBomCombiner()\n\t{}", "public OriginalSparseVector () {}", "private Arena() {}", "public Vector() {\n construct();\n }", "private Solution() {\n /**.\n * { constructor }\n */\n }", "private Terms(){\n\t\t //this prevents even the native class from calling this ctor as well :\n\t\t throw new AssertionError();\n\t\t }", "private Topography()\n\t{\n\t\tthrow new IllegalStateException(\"This is an utility class, it can not be instantiated\");\n\t}", "private ArrayOps() {\r\n }", "private FlexOrderTransformer() {\n // constructor preventing instantiation.\n }", "public MossClone() {\n super();\n }", "public void testCtorLargeScale() throws Exception {\n long start = System.currentTimeMillis();\n for (int i = 0; i < TOTAL_ITERATION; i++) {\n assertNotNull(\"Fail to create MessageImpl instance.\",\n new MessageImpl());\n }\n System.out.println(\"Creating \" + TOTAL_ITERATION + \" MessageImpl instances\"\n + \" with the first constructor costs:\" + (System.currentTimeMillis() - start) + \" ms\");\n }", "protected BaseComparator() {}", "public Interface()\n {\n this(10); //stats object of size 10\n }", "private LOCFacade() {\r\n\r\n\t}", "public Individual()\r\n\t{\r\n\t}", "private NullSafe()\n {\n super();\n }", "public Vector()\r\n {\r\n // initialise instance variables\r\n first = null;\r\n last = null;\r\n count = 0;\r\n }", "private Instantiation(){}" ]
[ "0.65910375", "0.65763575", "0.6469908", "0.6437401", "0.6423403", "0.63889414", "0.6357021", "0.63138175", "0.6313734", "0.628148", "0.62486213", "0.62165296", "0.6201551", "0.61874926", "0.6170071", "0.6166342", "0.6162597", "0.6162597", "0.6150684", "0.6107513", "0.60381955", "0.60289043", "0.6002282", "0.59982526", "0.5991369", "0.5987628", "0.5987628", "0.59868735", "0.597697", "0.5973884", "0.5972258", "0.59642756", "0.59509385", "0.5945577", "0.5935942", "0.5933817", "0.592893", "0.5928784", "0.59236753", "0.590538", "0.5882278", "0.58820105", "0.5878523", "0.5861344", "0.58577186", "0.58554107", "0.5850164", "0.5836667", "0.5829403", "0.58282876", "0.58276045", "0.58262354", "0.582514", "0.5824989", "0.5813983", "0.5811732", "0.579906", "0.57851404", "0.5784709", "0.57846373", "0.5778311", "0.5777866", "0.5768155", "0.5765165", "0.5762345", "0.5761795", "0.57540935", "0.57458365", "0.57387954", "0.57380515", "0.5733195", "0.57331735", "0.5728717", "0.5727535", "0.5722734", "0.5722727", "0.5720934", "0.5719166", "0.57188815", "0.57188296", "0.57135874", "0.57135826", "0.5709556", "0.5708987", "0.570872", "0.5707248", "0.5702067", "0.5699218", "0.56981385", "0.56914836", "0.5689127", "0.5686507", "0.5685621", "0.568178", "0.5680988", "0.5680881", "0.56808096", "0.568055", "0.56797737", "0.56778514", "0.56776315" ]
0.0
-1
mission 2 O(n) //
@Override public void addPoint(Point point) { if (size==0){ current = new Container(point,null,null,null,null); this.minx=current; this.maxx=current; this.miny=current; this.maxy=current; this.size=1; } else{ int counter=0; Container toAdd; //---------------------find the right place in order,axis x---------------// this.current = this.minx; Point currentData = this.current.getData(); while (counter<this.size-1 && currentData.getX() < point.getX()){ // counter<=this.size => this.current.getNext()!=null this.current = this.current.getNextX(); currentData = this.current.getData(); counter++; } if (currentData.getX() < point.getX()){ toAdd = new Container(point,this.current,this.current.getNextX(),null,null); if (this.current.getNextX()!=null) this.current.getNextX().setPrevX(toAdd); this.current.setNextX(toAdd); counter++; } else { toAdd = new Container(point,this.current.getPrevX(),this.current,null,null); if (this.current.getPrevX()!=null) this.current.getPrevX().setNextX(toAdd); this.current.setPrevX(toAdd); } if (counter==0) this.minx=toAdd; if (counter==this.size) this.maxx=toAdd; //----------------------find the right place in order,axis y----------------// counter=0; currentData = this.miny.getData(); this.current = this.miny; while (counter<this.size-1 && currentData.getY() < point.getY()){ this.current = this.current.getNextY(); currentData = this.current.getData(); counter++; } if (currentData.getY() < point.getY()){ toAdd.setY(this.current, this.current.getNextY()); if (this.current.getNextY()!=null) this.current.getNextY().setPrevY(toAdd); this.current.setNextY(toAdd); counter++; }else { toAdd.setY(this.current.getPrevY(), this.current); if (this.current.getPrevY()!=null) this.current.getPrevY().setNextY(toAdd); this.current.setPrevY(toAdd); } if (counter==0) this.miny=toAdd; if (counter==this.size) this.maxy=toAdd; this.size++; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int f2(int N) { \n int x = 0; //O(1)\n for(int i = 0; i < N; i++) // O(n)\n // O(n)`\n for(int j = 0; j < i; j++) \n x++;\n return x;\n }", "public static int f1(int N) {\n int x = 0; //O(1)\n for(int i = 0; i < N; i++) // O(n) \n x++; \n return x; \n \n }", "public static int example2(int[] arr) { // O(1)\r\n\t\tint n = arr.length, total = 0; // O(1)\r\n\t\tfor (int j = 0; j < n; j += 2) // note the increment of 2 // O(1)\r\n\t\t\ttotal += arr[j];\r\n\t\treturn total;\r\n\r\n\t\t/*\r\n\t\t * Explanation: Once Again, we have a (for) loop and it runs (n) times and this\r\n\t\t * for loop dominates the runtime.So this is linear time and the answer is O(n).\r\n\t\t * \r\n\t\t */\r\n\t}", "public int[] squareUp(int n) {\r\n int[]arreglo=new int[(n*n)]; // O(1)\r\n if(n==0){ // O(1)\r\n return arreglo; // O(1)\r\n }\r\n for(int i=n-1;i<arreglo.length;i=i+n){ // O(n)\r\n for (int j=i;j>=i-(i/n);j--){ // O(1)\r\n arreglo[j]=1+(i-j); // O(1)\r\n }\r\n }\r\n return arreglo; // O(1)\r\n}", "private final int m()\n\t { int n = 0;\n\t int i = 0;\n\t while(true)\n\t { if (i > j) return n;\n\t if (! cons(i)) break; i++;\n\t }\n\t i++;\n\t while(true)\n\t { while(true)\n\t { if (i > j) return n;\n\t if (cons(i)) break;\n\t i++;\n\t }\n\t i++;\n\t n++;\n\t while(true)\n\t { if (i > j) return n;\n\t if (! cons(i)) break;\n\t i++;\n\t }\n\t i++;\n\t }\n\t }", "public static int example3(int[] arr) { // O(n)\r\n\t\tint n = arr.length, total = 0; // O(1)\r\n\t\tfor (int j = 0; j < n; j++) // loop from 0 to n-1 // O(n^2)\r\n\t\t\tfor (int k = 0; k <= j; k++) // loop from 0 to j\r\n\t\t\t\ttotal += arr[j];\r\n\t\treturn total;\r\n\r\n\t\t/*\r\n\t\t * Explanation: Since we have nested for loop which dominates here and it is\r\n\t\t * O(n^2) and we always take the maximum. so the answer is quadratic time O(n^2)\r\n\t\t * \r\n\t\t */\r\n\t}", "private int d(@Nullable K ☃) {\r\n/* 127 */ return (xq.f(System.identityHashCode(☃)) & Integer.MAX_VALUE) % this.b.length;\r\n/* */ }\r\n/* */ private int b(@Nullable K ☃, int i) {\r\n/* */ int j;\r\n/* 131 */ for (j = i; j < this.b.length; j++) {\r\n/* 132 */ if (this.b[j] == ☃) {\r\n/* 133 */ return j;\r\n/* */ }\r\n/* 135 */ if (this.b[j] == a) {\r\n/* 136 */ return -1;\r\n/* */ }\r\n/* */ }", "public int[] fix34(int[] nums) {\r\n\tint i=0; // O(1)\r\n while(i<nums.length && nums[i]!=3) // O(n)\r\n i++; // n+1\r\n int j=i; // O(1)\r\n while(j+1<nums.length && nums[j+1]!=4) // O(n)\r\n j++; // n+1\r\n while(i<nums.length){ // O(n)\r\n if(nums[i]==3){ // O(1)\r\n int temp=nums[i+1]; // O(1)\r\n nums[i+1]=nums[j+1]; //O(1)\r\n nums[j+1]=temp; // O(1)\r\n while(j+1<nums.length && nums[j+1] != 4) //O(n)\r\n j++; // n+1\r\n }\r\n i++; // n+1\r\n }\r\n return nums; //O(1)\r\n}", "static int[] OnepassSol1(int[]a, int n){\r\n Map<Integer, Integer> map = new HashMap<>();\r\n for (int i = 0; i < a.length; i++) {\r\n int complement = n - a[i];\r\n if (map.containsKey(complement)) {\r\n return new int[] { map.get(complement), i };\r\n }\r\n map.put(a[i], i);\r\n }\r\n int[] ans = {-1,-1};\r\n return ans;\r\n }", "public static int example4(int[] arr) { // O(1)\r\n\t\tint n = arr.length, prefix = 0, total = 0; // O(1), O(1), (1)\r\n\t\tfor (int j = 0; j < n; j++) { // loop from 0 to n-1 // O(n)\r\n\t\t\tprefix += arr[j];\r\n\t\t\ttotal += prefix;\r\n\t\t}\r\n\t\treturn total;\r\n\r\n\t\t/*\r\n\t\t * Explanation: The method contains a (for) loop and it runs (n) times.This loop\r\n\t\t * dominates the runtime.We always aim for the worse-case and maximum time. The\r\n\t\t * answer is it is linear time of O(n) notation.\r\n\t\t * \r\n\t\t */\r\n\t}", "public static int example1(int[] arr) { // O(1)\r\n\t\tint n = arr.length, total = 0; // O(1)\r\n\t\tfor (int j = 0; j < n; j++) // loop from 0 to n-1 // O(n)\r\n\t\t\ttotal += arr[j];\r\n\t\treturn total;\r\n\t}", "public void sum2(int n){\n int sum =0; //1\n for (int j = 0; j < n; j++) //2n+2\n for (int k = 0; k < n; k++) //2n+2\n sum += k + j; //1\n for (int l = 0; l < n; l++) //2n+2\n sum += l; //1\n }", "static int[] sol1(int[]a, int n){\r\n\t\tMap <Integer,Integer> map= new HashMap();\r\n\t\tfor (int i = 0; i< a.length; i++){\r\n\t\t\tmap.put(a[i],i);\r\n\t\t}\r\n\t\tArrays.sort(a);\r\n\t\tint i = 0; \r\n\t\tint j = a.length -1;\r\n\t\twhile (i <= j){\r\n\t\t\tif(a[i]+a[j]>n) j--;\r\n\t\t\telse if (a[i]+a[j]<n) i++;\r\n\t\t\telse break;\r\n\t\t}\r\n\t\tint[] ans= {map.get(a[i]),map.get(a[j])};\r\n\t\treturn ans;\r\n\t}", "public boolean linearIn(int[] outer, int[] inner) {\r\n int comp=0; // O(1)\r\n int count=0; // O(1)\r\n if(inner.length==0) // O(1)\r\n return true; // O(1)\r\n for(int i=0; i<outer.length; i++) { // O(n)\r\n if(outer[i]==inner[count]) { // O(1)\r\n comp++; // O(1)\r\n count++; // O(1)\r\n } else if(outer[i]>inner[count]) // O(1)\r\n return false; // O(1)\r\n if (comp==inner.length) // O(1)\r\n return true; // O(1)\r\n }\r\n return false; // O(1)\r\n}", "public int get_odd_occurences_optimal_v2(int[] a) {\n\t\tint result = 0;\n\t\tfor (int i = 0; i < a.length; i++) {\n\t\t\tresult ^= i;\n\t\t}\n\t\treturn result;\n\t}", "private static int f(int n, int complete, int other, int[] arr) {\n if(n<=0)\n return 0;\n int res=0;\n ArrayList<Integer>list=new ArrayList<Integer>();\n for(int a:arr)\n if(a>0)\n list.add(a);\n int brr[]=new int[list.size()];\n for(int i=0;i<brr.length;i++)\n brr[i]=list.get(i);\n while(brr.length!=0){\n int index=0;\n for(int i=1;i<brr.length;i++)\n if(brr[index]<brr[i])\n index=i;\n for(int i=0;i<brr.length;i++){\n if(index==i)\n brr[i]-=complete;\n else\n brr[i]-=other;\n }\n list=new ArrayList<Integer>();\n for(int a:brr)\n if(a>0)\n list.add(a);\n brr=new int[list.size()];\n for(int i=0;i<brr.length;i++)\n brr[i]=list.get(i);\n res++;\n }\n return res;\n }", "public static int f5(int N) { \n int x = 0;\n // log(n)\n for(int i = N; i > 0; i = i/2)\n // O(n) + O(n/2) + O(n/4)\n x += f1(i);\n \n return x; \n \n }", "public int findDuplicate(int[] nums) {\n if(nums == null || nums.length == 0) return 0;\n\n int slow = nums[0];\n int fast = nums[nums[0]];\n\n while(slow != fast) {\n slow = nums[slow];\n fast = nums[nums[fast]];\n }\n\n fast = 0;\n while(slow != fast) {\n slow = nums[slow];\n fast = nums[fast];\n }\n\n return slow;\n}", "public int sget2(int n) {\n\t\tint res = get(n);\n\t\tint top = 1 << (n - 1);\n\t\tif ((res & top) != 0) {\n\t\t\tint mask = top - 1;\n\t\t\tif ((res & mask) == 0) {\n\t\t\t\tint res2 = sget2(n);\n\t\t\t\tres = (~mask | res) + 1 + res2;\n\t\t\t} else {\n\t\t\t\tres = ~mask | res;\n\t\t\t}\n\t\t}\n\t\treturn res;\n\t}", "private static int[] p2(int[] ar, int n) {\n int[] p2 = new int[n];\n Arrays.fill(p2, n);\n Stack<Integer> st = new Stack<>();\n for (int i = 0; i < n; i++) {\n while (st.size() != 0 && ar[i] < ar[st.peek()]) {\n p2[st.peek()] = i;\n st.pop();\n }\n st.push(i);\n }\n return p2;\n }", "public static int degreeOfArray(List<Integer> arr) { arr.length = n\n // num of Keys = k\n // O(n + k)\n // max value count = m\n //\n PriorityQueue<Node> pq = new PriorityQueue<>((i, j)-> j.count - i.count);\n Map<Integer, NodePosition> posMap = new HashMap<>();\n Map<Integer, Node> countMap = new HashMap<>();\n // [1, 2, 3, 4, 5, 6]\n for (int i = 0; i < arr.size(); i++) {\n int cur = arr.get(i);\n\n if (!countMap.containsKey(cur)) {\n countMap.put(cur, new Node(cur, 1));\n } else {\n Node curNode = countMap.get(cur);\n curNode.count++;\n countMap.put(cur, curNode);\n }\n\n if (!posMap.containsKey(cur)) {\n posMap.put(cur, new NodePosition(i, i));\n } else {\n NodePosition curNodePos = posMap.get(cur);\n curNodePos.endIndex = i;\n posMap.put(cur, curNodePos);\n }\n }\n //Iterator<Map.Entry<Integer, Node> it = new Iterator<>(countMap);\n for (Map.Entry<Integer, Node> e : countMap.entrySet()) {\n pq.add(e.getValue());\n }\n\n // [1, 2, 1, 3 ,2]\n // 1 , 2 , 3\n Node curNode = pq.remove();\n int maxCount = curNode.count;\n\n int minRange = posMap.get(curNode.num).endIndex - posMap.get(curNode.num).startIndex;\n\n while (!pq.isEmpty() && maxCount == pq.peek().count) {\n curNode = pq.remove();\n NodePosition nPos = posMap.get(curNode.num);\n minRange = Math.min(minRange, nPos.endIndex - nPos.startIndex);\n }\n\n return minRange + 1;\n }", "public static int[] exe1(int[] arr){ // Solution O(n) in time and constant in Memory\n int nzeros=0;\n\n for (int i=0; i<arr.length; i++) {\n arr[i-nzeros] = arr[i];\n if (arr[i] == 0) {\n nzeros++;\n }\n }\n for (int i=arr.length-1; i>arr.length-nzeros-1; i--) {\n arr[i] = 0;\n }\n\n return arr;\n }", "public static int solveEfficient(int n) {\n if (n == 0 || n == 1)\n return 1;\n\n int n1 = 1;\n int n2 = 1;\n int sum = 0;\n\n for (int i = 2; i <= n; i++) {\n sum = n1 + n2;\n n1 = n2;\n n2 = sum;\n }\n return sum;\n }", "void h(List<List<Integer>> r, List<Integer> t, int n, int s){ \n for(int i = s; i*i <= n; i++){\n if(n % i != 0) continue; \n t.add(i);\n t.add(n / i);\n r.add(new ArrayList<>(t));\n t.remove(t.size() - 1);\n h(r, t, n/i, i);\n t.remove(t.size() - 1);\n }\n }", "private int getCondensedIndex(int n, int i, int j) {\n if (i < j) {\n return n * i - (i * (i + 1) / 2) + (j - i - 1);\n }\n else if (i > j) {\n return n * j - (j * (j + 1) / 2) + (i - j - 1);\n }\n else{\n return 0;\n }\n }", "public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\n\t\tint a[] = {2,1,3,-4,-2};\n\t\t//int a[] = {1 ,2, 3, 7, 5};\n\t\tboolean found = false;\n\t\t\n\t\t//this will solve in o n^2\n\t\tfor(int i = 0 ; i < a.length ; i++){\n\t\t\tint sum = 0;\n\t\t\tfor(int j = i ; j< a.length ; j++){\n\t\t\t\tsum += a[j] ;\n\t\t\t\tif(sum == 0){\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tif(found)\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t\n\t\t// link : https://www.youtube.com/watch?v=PSpuM9cimxA&list=PLKKfKV1b9e8ps6dD3QA5KFfHdiWj9cB1s&index=49\n\t\tSystem.out.println(found + \" found\");\n\t\tfound = false;\n\t\t//solving with O of N with the help sets\n\t\t// x + 0 = y\n\t\tSet<Integer> set = new HashSet<>();\n\t\tint sum = 0;\n\t\tfor(int element : a){\n\t\t\tset.add(sum);\n\t\t\tsum += element;\n\t\t\tif(set.contains(sum)){\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\tSystem.out.println(set);\n\t\t\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t\tfound = false;\n\t\t// when the sum of subarray is K\n\t\t\n\t\t//solving with O of N with the help sets\n\t\t//x + k = y >>>\n\t\tSet<Integer> set1 = new HashSet<>();\n\t\tint k = 12;\n\t\tint summ = 0;\n\t\tfor(int element : a){\n\t\t\tset1.add(summ);\n\t\t\tsumm += element;\n\t\t\tif(set1.contains(summ - k)){ // y - k = x(alredy presnt or not)\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(set1);\n\t\tSystem.out.println();\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t}", "public static void main(String args[] ) throws Exception {\n Scanner scanner = new Scanner(System.in);\n int n = scanner.nextInt();\n int[] seqArray = new int[n];\n for (int i = 0; i < n; i++) {\n seqArray[i] = scanner.nextInt();\n }\n // getSeqValue(seqArray); //this method is an accepted one on Hackerrank but time complexity is not order n; i.e. !O(n);\n getLinearOrderY(seqArray); // trying to get O(n) time complexity;\n }", "static int[] find2(int a[]){\r\n int sum = a[0];\r\n int pro = a[0];\r\n for(int i=1;i<a.length;i++){\r\n sum += a[i];\r\n pro += a[i]*a[i];\r\n }\r\n int s = (n*(n+1))/2 - sum;\r\n int p = (n*(n+1)*(2*n+1))/6 - pro;\r\n return solveSP(s, p);\r\n }", "static long nPolyNTime(int[] n) {\n int temp = n.length;\n long sum = 0;\n if(n == null || n.length == 0) return -1;\n for(int i = 0; i < n.length; ++i) {\n while(temp --> 0) {\n for(int j = 0; j < n.length; ++j) {\n sum += n[i] + n[j];\n }\n }\n }\n return sum;\n }", "public static int ulam(int n) {\n\n List<Integer> list = new ArrayList<>();\n list.add(1);\n list.add(2);\n\n int i = 3;\n while (list.size() < n) {\n\n int count = 0;\n for (int j = 0; j < list.size() - 1; j++) {\n\n for (int k = j + 1; k < list.size(); k++) {\n if (list.get(j) + list.get(k) == i)\n count++;\n if (count > 1)\n break;\n }\n if (count > 1)\n break;\n }\n if (count == 1)\n list.add(i);\n i++;\n }\n return list.get(n - 1);\n }", "private int getIndex2(int val){\n return val/bucket;\n }", "private int e(amj paramamj)\r\n/* 202: */ {\r\n/* 203:221 */ alq localalq = paramamj.b();\r\n/* 204:222 */ int i = paramamj.b;\r\n/* 205: */ \r\n/* 206:224 */ int j = d(paramamj);\r\n/* 207:225 */ if (j < 0) {\r\n/* 208:226 */ j = j();\r\n/* 209: */ }\r\n/* 210:228 */ if (j < 0) {\r\n/* 211:229 */ return i;\r\n/* 212: */ }\r\n/* 213:231 */ if (this.a[j] == null)\r\n/* 214: */ {\r\n/* 215:232 */ this.a[j] = new amj(localalq, 0, paramamj.i());\r\n/* 216:233 */ if (paramamj.n()) {\r\n/* 217:234 */ this.a[j].d((fn)paramamj.o().b());\r\n/* 218: */ }\r\n/* 219: */ }\r\n/* 220:238 */ int k = i;\r\n/* 221:239 */ if (k > this.a[j].c() - this.a[j].b) {\r\n/* 222:240 */ k = this.a[j].c() - this.a[j].b;\r\n/* 223: */ }\r\n/* 224:242 */ if (k > p_() - this.a[j].b) {\r\n/* 225:243 */ k = p_() - this.a[j].b;\r\n/* 226: */ }\r\n/* 227:246 */ if (k == 0) {\r\n/* 228:247 */ return i;\r\n/* 229: */ }\r\n/* 230:250 */ i -= k;\r\n/* 231:251 */ this.a[j].b += k;\r\n/* 232:252 */ this.a[j].c = 5;\r\n/* 233: */ \r\n/* 234:254 */ return i;\r\n/* 235: */ }", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int T = sc.nextInt();\n for(int i = 0 ; i < T; i++) {\n int n = sc.nextInt();\n int a = sc.nextInt();\n int b = sc.nextInt();\n PriorityQueue<Integer> queue = new PriorityQueue<Integer>();\n int[][] m = new int[n][n];\n //n^2 * log(n)\n for(int row = 0; row < n; row++) {\n for(int col = 0; col < n; col++) {\n if(row == 0 && col == 0 && n != 1) {\n continue;\n }else if(row == 0) {\n m[row][col] = m[row][col - 1] + a;\n }else if(col == 0) {\n m[row][col] = m[row-1][col] + b;\n }else {\n m[row][col] = m[row-1][col-1] + a + b;\n }\n\n if(row + col == (n -1)) {\n pool.add(m[row][col]); //log(n)\n }\n }\n }\n //O(n*log(n))\n for (Integer item:pool) {\n queue.add(item); //O(logn)\n }\n while(!queue.isEmpty()) {\n System.out.print(queue.poll() + \" \"); //O(1)\n }\n System.out.println();\n queue.clear();\n pool.clear();\n }\n }", "public static void main(String[] args) {\nScanner s=new Scanner(System.in);\nint n=s.nextInt();\nint a[]=new int[n];\nint x=0;\nfor(int i=1;i<=n;i++)\n{\n\tif(i%2!=0)\n\t{\n\t\ta[x++]=i;\n\t}\n}\nint sum=0;\nsum=a[0];\nfor(int i=0;i<x;i++)\n{\n\tif((i+1)<x)\n\t{\n\tif(i%2==0)\n\t\tsum=sum+a[i+1];\n\telse\n\t\tsum=sum-a[i+1];\n\t}\n}\nSystem.out.println(sum);\n\t}", "static int getMissingByAvoidingOverflow(int a[], int n)\n\t {\n\t int total = 2;\n\t for (int i = 3; i <= (n + 1); i++)\n\t {\n\t total =total+ i -a[i - 2];\n\t //total =total- a[i - 2];\n\t }\n\t return total;\n\t }", "public static void a2v2(int[] A)\n {\n Map<Integer, List<Integer>> hashMap = new HashMap<>();\n\n insert(hashMap, 0, -1);\n\n int sum = 0;\n\n for (int i = 0; i < A.length; i++)\n {\n sum += A[i];\n\n if (hashMap.containsKey(sum))\n {\n List<Integer> list = hashMap.get(sum);\n\n // find all subarrays with the same sum\n for (Integer value: list)\n {\n System.out.println(\"Subarray [\" + (value + 1) + \"…\" +\n i + \"]\");\n }\n }\n\n // insert (sum so far, current index) pair into the hashmap\n insert(hashMap, sum, i);\n }\n }", "public int get_odd_occurences_optimal_v1(int[] a) {\n\t\tHashMap<Integer, Integer> hashSet = new HashMap<>();\n\t\tfor (int i = 0; i < a.length; i++) {\n\t\t\tif (hashSet.containsKey(a[i])) {\n\t\t\t\thashSet.put(a[i], hashSet.get(a[i]) + 1);\n\t\t\t} else {\n\t\t\t\thashSet.put(a[i], 1);\n\t\t\t}\n\t\t}\n\t\tfor (Integer i : hashSet.keySet()) {\n\t\t\tif (hashSet.get(i) % 2 != 0) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "private static int betterSolution(int n) {\n return n*n*n;\n }", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\r\n\t\tint n = sc.nextInt();\r\n\t\tint[] a = new int[n];\r\n\t\tfor(int i = 0; i < n; i++){\r\n\t\t\ta[i] = sc.nextInt();\r\n\t\t}\r\n\t\tint res = 0, p = 0, t = 0;\r\n\t\twhile(true){\r\n\t\t\tp = 0; t = 0;\r\n\t\t\tfor(int i = 0; i < a.length; i++){\r\n\t\t\t\t\r\n\t\t\t\tif(i == a.length-1){\r\n\t\t\t\t\ta[i] /= 2;\r\n\t\t\t\t\tt = a[i];\r\n\t\t\t\t\ta[i] += p;\r\n\t\t\t\t\tp = t;\r\n\t\t\t\t\ta[0] += p;\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\ta[i] /= 2;\r\n\t\t\t\t\tt = a[i];\r\n\t\t\t\t\ta[i] += p;\r\n\t\t\t\t\tp = t;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tboolean flag = true;\r\n\t\t\tint temp = a[0];\r\n\t\t\tfor(int j = 1; j < a.length; j++){\r\n\t\t\t\tif(a[j] != temp){\r\n\t\t\t\t\tflag = false;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(flag){\r\n\t\t\t\tSystem.out.println(res);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tfor(int j = 0; j < a.length; j++){\r\n\t\t\t\tif(a[j] % 2 != 0){\r\n\t\t\t\t\ta[j] += 1;\r\n\t\t\t\t\tres++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "static int gen(int n)\n{ \n int []S = new int [n + 1];\n \n S[0] = 0;\n if(n != 0)\n S[1] = 1;\n \n for (int i = 2; i <= n; i++)\n { \n \n // S(2 * n) = 4 * S(n)\n if (i % 2 == 0)\n S[i] = 4 * S[i / 2];\n \n // S(2 * n + 1) = 4 * S(n) + 1\n else\n S[i] = 4 * S[i/2] + 1;\n }\n \n return S[n];\n}", "public static void main(String[] args) {\n\t\tint a[]= {15,3,7,1,9,2};\n\t\tsubarraysum(a,11);//Time complexity O(n^2) space O(1)\n\n\t\tsubarraysum_reducecomplexity(a,11,a.length); //Time complexity O(n) space O(1)\n\n\t}", "private static int solution2(int[] A) {\n Map<Integer, Integer> map = new HashMap<>();\n\n for(int i=0; i<A.length; i++){\n if(map.get(A[i]) != null){\n int counter = map.get(A[i]) + 1;\n map.put(A[i], counter);\n } else {\n map.put(A[i], 1);\n }\n }\n\n for (Map.Entry<Integer, Integer> pair : map.entrySet()) {\n if(pair.getValue() % 2 != 0) {\n return pair.getKey();\n }\n }\n\n return -1;\n }", "public static int solutionN2(int[] A) {\n\n\t\tclass Pair {\n\t\t\tpublic int start;\n\t\t\tpublic int end;\n\n\t\t\tpublic Pair(int start, int end) {\n\t\t\t\tthis.start = start;\n\t\t\t\tthis.end = end;\n\t\t\t}\n\t\t}\n\n\t\tPair[] pairs = new Pair[A.length];\n\n\t\tfor (int i = 0; i < A.length; i++) {\n\t\t\tpairs[i] = new Pair(i - A[i], i + A[i]);\n\t\t}\n\n\t\tArrays.sort(pairs, new Comparator<Pair>() {\n\t\t\t@Override\n\t\t\tpublic int compare(Pair o1, Pair o2) {\n\t\t\t\treturn o1.start - o2.start;\n\t\t\t}\n\t\t});\n\n\t\tint countIntersection = 0;\n\n\t\tfor (int i = 0; i < A.length; i++) {\n\t\t\tPair current = pairs[i];\n\n\t\t\tfor (int j = i + 1; j < A.length; j++) {\n\t\t\t\tPair p = pairs[j];\n\t\t\t\tif (current.end >= p.start) {\n\t\t\t\t\tcountIntersection++;\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tif (countIntersection > 10000000)\n\t\t\treturn -1;\n\n\t\treturn countIntersection;\n\t}", "public static List<Integer> solution2(int n) {\n List<Integer> rs=new ArrayList<Integer>();\n rs.add(0);\n for(int i=0;i<n;i++){\n int size=rs.size();\n for(int k=size-1;k>=0;k--)\n rs.add(rs.get(k) | 1<<i);\n }\n return rs;\n }", "public static int method2(int temp[]) {\r\n\r\n\t\tMap<Integer, Integer> map = new HashMap<Integer, Integer>();\r\n\r\n\t\tfor (int i = 0; i < temp.length; i++) {\r\n\t\t\tif (map.containsKey(temp[i])) {\r\n\t\t\t\tmap.put(temp[i], map.get(temp[i]) + 1);\r\n\t\t\t} else {\r\n\t\t\t\tmap.put(temp[i], 1);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tIterator<Entry<Integer, Integer>> it = map.entrySet().iterator();\r\n\r\n\t\twhile (it.hasNext()) {\r\n\t\t\tEntry<Integer, Integer> entry = it.next();\r\n\t\t\tint key = entry.getKey();\r\n\t\t\tint count = entry.getValue();\r\n\r\n\t\t\tif ((count % 2) != 0) {\r\n\t\t\t\treturn key;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\treturn -1;\r\n\t}", "private int calcDistanceMemoize(int i, int j, char[] one, char[] two, int [][]table) {\n if (i < 0)\n return j+1;\n\tif (j < 0)\n\t return i+1;\n\n if (table[i][j] == -1) \n table[i][j] = calcDistanceRecursive(i, j, one, two, table);\n\t\n return table[i][j];\n }", "int minOperations(int[] arr) {\n // Write your code here\n Set<String> set = new HashSet<>();//store visited string\n Queue<String> queue = new LinkedList<>(); // store next strs\n int counter = 0;\n\n queue.offer(getKey(arr));\n set.add(getKey(arr));\n\n while (!queue.isEmpty()) {\n int size = queue.size();\n List<String> curs = new ArrayList<>();\n while (size > 0) {\n curs.add(queue.poll());\n size--;\n }\n\n for(String cur : curs) {\n if (isIncreasing(cur)) {\n return counter;\n }\n\n for(int i = 0; i < cur.length(); i++) {\n String next = reverseString(cur, i);\n if (!set.contains(next)) {\n set.add(next);\n queue.offer(next);\n }\n }\n }\n\n counter++;\n }\n\n return counter;\n }", "private static void second(int[] arr, int sum){\n\n Map<Integer,Boolean> map = new Hashtable<>();\n\n for(int i:arr){\n\n if (map.containsKey(sum - i)){\n System.out.println(i + \" , \" + (sum-i));\n }\n else{\n map.put(i, true);\n }\n\n }\n\n }", "void solve() throws IOException {\n int[] nk = ril(2);\n int n = nk[0];\n int k = nk[1];\n int[] p = ril(n);\n int[] b = ril(k);\n for (int i = 0; i < n; i++) p[i]--;\n for (int i = 0; i < k; i++) b[i]--;\n\n int[] numToIdx = new int[n];\n for (int i = 0; i < n; i++) numToIdx[p[i]] = i;\n\n boolean[] remove = new boolean[n];\n Arrays.fill(remove, true);\n for (int bi : b) remove[bi] = false;\n List<Integer> toRemove = new ArrayList<>(n - k);\n for (int i = 0; i < n; i++) if (remove[i]) toRemove.add(i);\n Collections.sort(toRemove);\n\n int[] prevSmaller = new int[n];\n prevSmaller[0] = -1;\n int prevIdx = remove[p[0]] ? -1 : 0;\n for (int i = 1; i < n; i++) {\n int j = prevIdx;\n while (j != -1 && p[i] < p[j]) j = prevSmaller[j];\n prevSmaller[i] = j;\n if (!remove[p[i]]) prevIdx = i;\n }\n int[] nextSmaller = new int[n];\n nextSmaller[n-1] = n;\n prevIdx = remove[p[n-1]] ? n : n-1;\n for (int i = n-2; i >= 0; i--) {\n int j = prevIdx;\n while (j != n && p[i] < p[j]) j = nextSmaller[j];\n nextSmaller[i] = j;\n if (!remove[p[i]]) prevIdx = i;\n }\n\n int[] init = new int[n];\n Arrays.fill(init, 1);\n SegmentTree st = new SegmentTree(init);\n long ans = 0;\n for (int x : toRemove) {\n int idx = numToIdx[x];\n int l = prevSmaller[idx] + 1;\n int r = nextSmaller[idx] - 1;\n ans += st.query(l, r+1);\n st.modify(idx, 0);\n }\n pw.println(ans);\n }", "static long findSum(int N)\n\t{\n\t\tif(N==0) return 0;\n\t\treturn (long)((N+1)>>1)*((N+1)>>1)+findSum((int)N>>1);\n\t\t\n\t}", "public int[] findAnyPairIndexesWhileLCMMinimized() {\n if (seq.length < 2) {\n return null;\n }\n int size = 0;\n for (int i = 1; i <= m; i++) {\n size += m / i;\n }\n\n IntegerMultiWayDeque deque = new IntegerMultiWayDeque(m + 1, size);\n for (int i = 1; i <= m; i++) {\n for (int j = i; j <= m; j += i) {\n if (!indexesOfSeq.isEmpty(j)) {\n deque.addLast(i, j / i);\n }\n }\n }\n\n long lcm = INF;\n int v1 = 0;\n int v2 = 0;\n\n for (int i = 1; i <= m; i++) {\n if (!indexesOfSeq.isEmpty(i) && indexesOfSeq.peekFirst(i) != indexesOfSeq.peekLast(i)) {\n lcm = v1 = v2 = i;\n break;\n }\n }\n\n IntegerVersionArray iva = new IntegerVersionArray(m + 1);\n IntegerDequeImpl stack = new IntegerDequeImpl(m);\n for (int i = 1; i <= m; i++) {\n iva.clear();\n stack.clear();\n while (!deque.isEmpty(i)) {\n int last = deque.removeFirst(i);\n factorize(last);\n int total = ie(iva, allFactors.size() - 1, 1, 0);\n if (total > 0) {\n int pop = 0;\n while (total > 0) {\n pop = stack.removeLast();\n if (GCDs.gcd(pop, last) == 1) {\n total--;\n }\n add(iva, pop, -1);\n }\n long l = LCMs.lcm(last, pop) * i;\n if (l < lcm) {\n lcm = l;\n v1 = last * i;\n v2 = pop * i;\n }\n }\n add(iva, last, 1);\n stack.addLast(last);\n }\n }\n\n return new int[]{indexesOfSeq.peekFirst(v1), indexesOfSeq.peekLast(v2)};\n }", "private int hashFunc2(String word) {\n int hashVal = word.hashCode();\n hashVal = hashVal % arraySize;\n\n if (hashVal < 0) {\n hashVal += arraySize;\n }\n\n // Research shows that you can use a Prime number Less than the array size to calculate the step value.\n // Prime Number 3 arbitrarily chosen.\n return 3 - hashVal % 3;\n }", "private int first_leaf() { return n/2; }", "public static boolean addUpToFast(int[] array, int n){\n\t\tHashSet<Integer> hs = new HashSet<Integer>();\n\t\tfor(int i = 0; i < array.length; i++){\n\t\t\tif(hs.contains(n-array[i]))\n\t\t\t\treturn true;\n\t\t\ths.add(array[i]);\n\t\t}\n\t\treturn false;\n\t}", "private static void sortAccording(int A1[], int A2[], int m, int n)\n {\n // The temp array is used to store a copy \n // of A1[] and visited[] is used to mark the \n // visited elements in temp[].\n int temp[] = new int[m], visited[] = new int[m];\n for (int i = 0; i < m; i++)\n {\n temp[i] = A1[i];\n visited[i] = 0;\n }\n \n // Sort elements in temp\n Arrays.sort(temp);\n \n // for index of output which is sorted A1[]\n int ind = 0; \n \n // Consider all elements of A2[], find them\n // in temp[] and copy to A1[] in order.\n for (int i = 0; i < n; i++){\n\n // Find index of the first occurrence\n // of A2[i] in temp\n int f = first(temp, 0, m-1, A2[i], m);\n \n // If not present, no need to proceed\n if (f == -1) \n continue;\n \n // Copy all occurrences of A2[i] to A1[]\n for (int j = f; (j < m && temp[j] == A2[i]); j++){\n \n A1[ind++] = temp[j];\n visited[j] = 1;\n }\n }\n \n // Now copy all items of temp[] which are \n // not present in A2[]\n for (int i = 0; i < m; i++)\n if (visited[i] == 0)\n A1[ind++] = temp[i];\n }", "public static void targetSumPair(int[] arr, int target){\n //write your code here\n Arrays.sort(arr); // O(nlogn)\n int i=0, j=arr.length-1;\n while(i < j) {\n if(arr[i]+arr[j] < target) {\n i++;\n }\n else if(arr[i] + arr[j] > target)\n j--;\n else {\n System.out.println(arr[i] + \", \" + arr[j]);\n i++; j--;\n }\n }\n }", "static void nonRecHeapPermutation(int[] A, int n) {\n\t\tint[] c = new int[n];\n\t\tprintArray(A);\n\t\tint i = 0;\n\t\twhile (i < n) {\n\t\t\tif (c[i] < i) {\n\t\t\t\t// if i is even\n\t\t\t\tif (i % 2 == 0) {\n\t\t\t\t\t// exchange A[0] and A[i]\n\t\t\t\t\tswap(A, 0, i);\n\t\t\t\t} else {\n\t\t\t\t\t// i is odd\n\t\t\t\t\t// exchange A[c[i]] and A[i]\n\t\t\t\t\tswap(A, c[i], i);\n\t\t\t\t}\n\t\t\t\tprintArray(A);\n\t\t\t\tc[i] += 1;\n\t\t\t\ti = 0;\n\t\t\t} else {\n\t\t\t\tc[i] = 0;\n\t\t\t\ti += 1;\n\t\t\t}\n\t\t}\n\t}", "public int[] twoSum2(int[] nums, int target) {\n int max = nums[0];\n int min = max;\n // get rank\n for (int e : nums) {\n if (e > max) {\n max = e;\n }\n if (e < min) {\n min = e;\n }\n }\n // show up table\n Integer[] showUpMap = new Integer[max - min + 1];\n LinkedList[] indicesMap = new LinkedList[max - min + 1];\n for (int i = 0; i < nums.length; i++) {\n showUpMap[nums[i] - min] = 1;\n if (indicesMap[nums[i] - min] == null) {\n indicesMap[nums[i] - min] = new LinkedList<Integer>();\n }\n indicesMap[nums[i] - min].add(i);\n }\n System.out.println(Arrays.toString(showUpMap));\n System.out.println(Arrays.toString(indicesMap));\n for (int i = 0; i < showUpMap.length; i++) {\n boolean show = showUpMap[i] != null;\n if (show) {\n int a = i + min;\n int need = target - a;\n if (need - min < showUpMap.length &&\n showUpMap[need - min] != null) {\n int ai = (int) indicesMap[i].get(0);\n int bi = (int) indicesMap[need - min].get(0);\n if (ai == bi) {\n bi = (int) indicesMap[need - min].get(1);\n }\n return new int[]{ai, bi};\n }\n }\n }\n return null;\n }", "public static int majorityIn2N(int[] a)\n {\n int i=0;\n //case1: check if the array is like this: 1, 1, 2, 3, 4, 1...\n //this case is the opposite one to the second one\n for(; i<a.length-1; i++)\n {\n if(a[i]==a[i+1])\n return a[i];\n }\n //case2: if we get here, the array must be like 1, 3, 1, 4, 1, 5\n for(i=0; i<a.length-2; i++)\n {\n if(a[i]==a[i+2])\n return a[i];\n }\n return Integer.MIN_VALUE;\n }", "public static int f3(int N) {\n \n // O(1)\n if (N == 0) return 1;\n else{ \n \n int x = 0;\n // O(N)\n for(int i = 0; i < N; i++)\n x += f3(N-1);\n return x;\n }\n }", "public static void getLeastNumbers_2(int[] input, int[] output) {\n int start = 0;\n int end = input.length - 1;\n int k = output.length;\n int index = partition(input, start, end);\n while(index != k - 1) {\n if(index > k - 1) {\n end = index - 1;\n index = partition(input, start, end);\n }\n else {\n start = index + 1;\n index = partition(input, start, end);\n }\n }\n \n for(int i = 0; i < k; ++i)\n output[i] = input[i];\n }", "private int find(int p){\n while(p!=id[p]){\n p=id[p];\n eachDoUnionArrayAccessTimes+=2; //遍历读取某个元素算一次,设置值也算一次,所以加2次\n }\n eachDoUnionArrayAccessTimes++; //查询p的时候依然会读取一次\n return p;\n }", "public void sum(int n) {\n int sum = 0;\n for (int j = 0; j < n; j++) // 2n+2\n sum += j;\n for (int k = 0; k < n; k++) // 2n+2\n sum += k;\n for (int l = 0; l < n; l++) //2n+2\n sum += l;\n }", "private int siguientePrimo(int n)\r\n {\r\n if (n%2 == 0) n++;\r\n for (; !esPrimo(n); n+=2);\r\n return n;\r\n }", "public static int getBetterApproach(int n){\n\t\t\n\t\tint t[] = new int[n+1];\n\t\t\n if(n<=2)\n return n;\n \n\t\tt[0] = 0;\n\t\tt[1] = 1;\n\t\tt[2] = 2;\n\t\tfor(int i = 3;i<=n;i++){\n\t\t\tt[i] = t[i-1] + t[i-2];\n\t\t}\n\t\treturn t[n];\n\t}", "public int singles(int [] arr){\n HashMap<Integer, Integer> hm = new HashMap<>();\n long s1 = 0, s2 = 0;\n for(int x = 0; x < arr.length; x++){\n if(!hm.containsKey(arr[x])){\n s1 += arr[x];\n hm.put(arr[x], 1);\n }\n s2 += arr[x];\n }\n return (int)(2* s1 - s2);\n }", "@Override\r\n public long problem2() {\r\n ArrayList<String> arrList = new ArrayList<>();\r\n long start = System.currentTimeMillis(); \r\n for(int i = 0; i<1234567; i++){\r\n arrList.add(Integer.toString(i));\r\n }\r\n long end = System.currentTimeMillis(); \r\n return end - start; \r\n }", "public boolean containsNearbyDuplicate2(int[] nums, int k) {\n\n int max = Integer.MIN_VALUE;\n for (int i = 0; i < nums.length; i++) {\n max=Math.max(max,nums[i]);\n }\n Integer[] map = new Integer[max+1];\n for (int i = 0; i < nums.length; i++) {\n Integer c = map[nums[i]];\n if(c!=null && i-c<=k){\n return true;\n }else {\n map[nums[i]]=i;\n }\n }\n return false;\n }", "public static ArrayList<ArrayList<Integer>> fourSum(ArrayList<Integer> a, int k) {\n Collections.sort(a);\n System.out.println(a);\n LinkedHashMap<Integer, List<List<Integer>>> m = new LinkedHashMap<Integer, List<List<Integer>>>();\n for (int i = 0; i <= a.size() - 3; i++) {\n for (int j = i + 1; j <= a.size() - 2; j++) {\n if (m.get(a.get(i) + a.get(j)) == null) {\n ArrayList<List<Integer>> v = new ArrayList<List<Integer>>();\n List<Integer> c = new ArrayList<Integer>();\n c.add(i);\n c.add(j);\n v.add(c);\n m.put(a.get(i) + a.get(j), v);\n } else {\n List<List<Integer>> v = m.get(a.get(i) + a.get(j));\n List<Integer> c = new ArrayList<Integer>();\n c.add(i);\n c.add(j);\n v.add(c);\n m.put(a.get(i) + a.get(j), v);\n }\n\n }\n }\n LinkedHashSet<ArrayList<Integer>> res = new LinkedHashSet<ArrayList<Integer>>();\n for (int i = 2; i <= a.size() - 1; i++) {\n for (int j = i + 1; j < a.size(); j++) {\n List<List<Integer>> v = m.get(k - (a.get(i) + a.get(j)));\n if (v != null && v.size() >= 1) {\n for (List<Integer> l : v) {\n\n if (l.get(0) < l.get(1) && l.get(1) < i && l.get(1) < j) {\n //System.out.println(l.get(0) + \" \" + l.get(1) + \" \" + i + \" \" + j);\n ArrayList<Integer> out = new ArrayList<Integer>();\n out.add(a.get(l.get(0)));\n out.add(a.get(l.get(1)));\n out.add(a.get(i));\n out.add(a.get(j));\n Collections.sort(out);\n //System.out.println(out);\n res.add(out);\n }\n }\n }\n }\n }\n return new ArrayList<ArrayList<Integer>>(res);\n }", "public static int[] twoSum(int[] numbers, int target) {\n // Start typing your Java solution below\n // DO NOT write main() function\n int[] aux = new int[numbers.length];\n HashMap<Integer, Integer> valueToIndex = new HashMap<Integer, Integer>();\n for (int i = 0; i < numbers.length; i++) {\n valueToIndex.put(numbers[i], i);\n aux[i] = numbers[i];\n }\n \n int i = 0, j = numbers.length - 1;\n boolean found = false;\n \n Arrays.sort(aux);\n \n while (i != j) {\n if (aux[i] + aux[j] < target) i++;\n else if (aux[i] + aux[j] > target) j--;\n else {\n found = true;\n break;\n }\n }\n \n if (!found) return null;\n \n int[] result = new int[2];\n if (aux[i] == aux[j]) { /* Handle duplicates */\n int first = -1, second = -1;\n for (int k = 0; k < numbers.length; k++) {\n if (numbers[k] == aux[i]) {\n if (first == -1) {\n first = k;\n } else if (second == -1) {\n second = k;\n break;\n }\n }\n }\n result[0] = first + 1;\n result[1] = second + 1;\n return result;\n }\n \n \n if (valueToIndex.get(aux[i]) < valueToIndex.get(aux[j])) {\n result[0] = valueToIndex.get(aux[i]) + 1;\n result[1] = valueToIndex.get(aux[j]) + 1;\n } else {\n result[0] = valueToIndex.get(aux[j]) + 1;\n result[1] = valueToIndex.get(aux[i]) + 1;\n }\n return result;\n }", "public static void process(int n){\n\t\tint right, left, i;\n\n\t\tright = i = 0;\n\t\twhile(i < n){\n\t\t\twhile (right < n && c[i] == c[right]) right++;\n\t\t\tfor(int j = i; j < right; ++j) max_right[j] = right;\n\t\t\ti = right;\n\t\t}\n\n\t\tleft = i = n-1;\n\t\twhile(i >= 0){\n\t\t\twhile (left >= 0 && c[i] == c[left]) left--;\n\t\t\tfor (int j = i; j > left; --j) max_left[j] = left;\n\t\t\ti = left;\n\t\t}\n\t}", "public static int solution(int[] arr) {\n int n = arr.length;\n for (int i = 0; i < n; i++) {\n while (arr[i] != i + 1 && arr[i] < n && arr[i] > 0) {\n int temp = arr[i];\n if (temp == arr[temp - 1])\n break;\n arr[i] = arr[temp - 1];\n arr[temp - 1] = temp;\n }\n }\n for (int i = 0; i < n; i++)\n if (arr[i] != i + 1)\n return i + 1;\n return n + 1;\n }", "static long arrayManipulation(int n, int[][] queries) {\r\n long result = 0, sum = 0;\r\n long[] arr = new long[n];\r\n for(int i = 0; i < queries.length; i++){\r\n int firstIndex = queries[i][0] - 1;\r\n int lastIndex = queries[i][1] - 1;\r\n long numberToAdd = queries[i][2];\r\n arr[firstIndex] += numberToAdd;\r\n if (lastIndex+1 < n)\r\n arr[lastIndex+1] -= numberToAdd;\r\n }\r\n\r\n for(long l : arr){\r\n sum += l;\r\n if(sum > result)\r\n result = sum;\r\n }\r\n\r\n return result;\r\n }", "public static void main(String[] args){\n int MIN = Integer.parseInt(args[0]);\n MAX = Integer.parseInt(args[1]);\n cutoffs = new int[args.length - 2];\n cache = new ArrayList<IndexedArrayList<SuperSavvyTrieHelper2>>();\n for (int i = 2; i < args.length; i++){\n cutoffs[i - 2] = Integer.parseInt(args[i]);\n cache.add(new IndexedArrayList<SuperSavvyTrieHelper2>());\n }\n for (int i = 0; i < cutoffs.length / 2; i++){\n int temp = cutoffs[i];\n cutoffs[i] = cutoffs[cutoffs.length - 1 - i];\n cutoffs[cutoffs.length - 1 - i] = temp;\n }\n multiplicitiesUsed = new boolean[MAX + 1];\n basesUsed = new DoublyLinkedArray(MAX + 1);\n SuperSavvyTrieHelper2.setCorrespondance(basesUsed);\n /*\n long count1 = lowerRecursion(MAX, 0);\n long count2 = middleRecursion(MAX, 0);\n long count3 = upperRecursion(MAX, 0);\n long total = count1 + count2 + count3;\n System.out.printf(\"%d + %d + %d = %d\\n\", count1, count2, count3, total);\n */\n hitCounts = new long[cutoffs.length];\n missCounts = new long[cutoffs.length];\n statCollector = new StatCollector(cutoffs);\n\n long startTime = System.nanoTime();\n long[] values = new long[MAX - MIN + 1];\n for (int i = MIN; i <= MAX; i++) {\n values[i - MIN] = upperRecursionWrapper(i);\n }\n //long[] testValues = new long[] {1752443,1911046, 2067456,2249444,2429337, 2647532,2852449,3101167,3350292,3632299,3916575};\n for (int i = 0; i < values.length; i++){\n //if (testValues[i] != values[i]){\n System.out.printf(\"%d: %d\\n\", i + MIN, values[i]);\n //}\n }\n long endTime = System.nanoTime();\n System.out.printf(\"%f,\", (double)(endTime - startTime) / 1000000000.0);\n long totalMissCounts = 0;\n long totalMissWeight1 = 0;\n long totalMissWeight2 = 0;\n long totalMissWeight3 = 0;\n /*\n for (int i = 0; i < cutoffs.length; i++){\n long totalCounts = hitCounts[i] + missCounts[i];\n totalMissCounts += missCounts[i];\n totalMissWeight1 += missCounts[i] * cutoffs[i];\n totalMissWeight2 += (hitCounts[i] / missCounts[i]) * cutoffs[i];\n totalMissWeight3 += (hitCounts[i] - missCounts[i]) * cutoffs[i] * cutoffs[i];\n System.out.printf(\"\\tCache %d: %d/%d/%d (%.5f%%)\", cutoffs[i], hitCounts[i], missCounts[i], totalCounts, (double) hitCounts[i] / totalCounts);\n }\n System.out.printf(\"\\t\\tMissCounts: %d, weighted: %d, ratio: %d, diff^2: %d\\n\", totalMissCounts, totalMissWeight1, totalMissWeight2, totalMissWeight3);\n */\n statCollector.printAll();\n }", "static int[] productExceptSelfSpaceOptimized(int[] nums) {\n int n = nums.length;\n int[] result = new int[n];\n Arrays.fill(result, 1);\n int curr = 1;\n\n for (int i = 0; i < n; i++) {\n result[i] *= curr;\n curr *= nums[i];\n }\n\n curr = 1;\n for (int i = n - 1; i >= 0; i--) {\n result[i] *= curr;\n curr *= nums[i];\n }\n\n return result;\n }", "public static void main(String[] args) {\n\n pairsSum();\n\n printAllSubArrays();\n\n tripletZero();\n\n // int[][] sub = subsets();\n\n PairsSum sum = new PairsSum();\n int[] arr = { 10, 1, 2, 3, 4, 5, 6, 1 };\n boolean flag = sum.almostIncreasingSequence(arr);\n System.out.println(flag);\n\n String s = \"\";\n for (int i = 0; i < 100000; i++) {\n // s += \"CodefightsIsAwesome\";\n }\n long start = System.currentTimeMillis();\n // int k = subStr(s, \"IsA\");\n System.out.println(System.currentTimeMillis() - start);\n // System.out.println(k);\n\n String[] a = { \"aba\", \"aa\", \"ad\", \"vcd\", \"aba\" };\n String[] b = sum.allLongestStrings(a);\n System.out.println(Arrays.deepToString(b));\n\n List<String> al = new ArrayList<>();\n al.toArray();\n\n Map<Integer, Integer> map = new HashMap<>();\n Set<Integer> keySet = map.keySet();\n for (Integer integer : keySet) {\n\n }\n\n String st = reverseBracksStack(\"a(bc(de)f)g\");\n System.out.println(st);\n\n int[] A = { 1, 2, 3, 2, 2, 3, 3, 33 };\n int[] B = { 1, 2, 2, 2, 2, 3, 2, 33 };\n\n System.out.println(sum.isIPv4Address(\"2.2.34\"));\n\n Integer[] AR = { 5, 3, 6, 7, 9 };\n int h = sum.avoidObstacles(AR);\n System.out.println(h);\n\n int[][] image = { { 36, 0, 18, 9 }, { 27, 54, 9, 0 }, { 81, 63, 72, 45 } };\n int[][] im = { { 7, 4, 0, 1 }, { 5, 6, 2, 2 }, { 6, 10, 7, 8 }, { 1, 4, 2, 0 } };\n int[][] res = sum.boxBlur(im);\n\n for (int i = 0; i < res.length; i++) {\n for (int j = 0; j < res[0].length; j++) {\n System.out.print(res[i][j] + \" \");\n }\n System.out.println();\n }\n\n boolean[][] ms = { { true, false, false, true }, { false, false, true, false }, { true, true, false, true } };\n int[][] mines = sum.minesweeper(ms);\n for (int i = 0; i < mines.length; i++) {\n for (int j = 0; j < mines[0].length; j++) {\n System.out.print(mines[i][j] + \" \");\n }\n System.out.println();\n }\n\n System.out.println(sum.variableName(\"var_1__Int\"));\n\n System.out.println(sum.chessBoard());\n\n System.out.println(sum.depositProfit(100, 20, 170));\n\n String[] inputArray = { \"abc\", \"abx\", \"axx\", \"abx\", \"abc\" };\n System.out.println(sum.stringsRearrangement(inputArray));\n\n int[][] queens = { { 1, 1 }, { 3, 2 } };\n int[][] queries = { { 1, 1 }, { 0, 3 }, { 0, 4 }, { 3, 4 }, { 2, 0 }, { 4, 3 }, { 4, 0 } };\n boolean[] r = sum.queensUnderAttack(5, queens, queries);\n\n }", "public int[] findAnyPairIndexesWhileLCMMaximized() {\n if (seq.length < 2) {\n return null;\n }\n int size = 0;\n for (int i = 1; i <= m; i++) {\n size += m / i;\n }\n\n IntegerMultiWayDeque deque = new IntegerMultiWayDeque(m + 1, size);\n for (int i = 1; i <= m; i++) {\n for (int j = i; j <= m; j += i) {\n if (!indexesOfSeq.isEmpty(j)) {\n deque.addLast(i, j / i);\n }\n }\n }\n\n long lcm = -1;\n int v1 = 0;\n int v2 = 0;\n\n for (int i = m; i >= 1; i--) {\n if (!indexesOfSeq.isEmpty(i) && indexesOfSeq.peekFirst(i) != indexesOfSeq.peekLast(i)) {\n lcm = v1 = v2 = i;\n break;\n }\n }\n\n IntegerVersionArray iva = new IntegerVersionArray(m + 1);\n IntegerDequeImpl stack = new IntegerDequeImpl(m);\n for (int i = 1; i <= m; i++) {\n iva.clear();\n stack.clear();\n while (!deque.isEmpty(i)) {\n int last = deque.removeLast(i);\n factorize(last);\n int total = ie(iva, allFactors.size() - 1, 1, 0);\n if (total > 0) {\n int pop = 0;\n while (total > 0) {\n pop = stack.removeLast();\n if (GCDs.gcd(pop, last) == 1) {\n total--;\n }\n add(iva, pop, -1);\n }\n long l = LCMs.lcm(last, pop) * i;\n if (l > lcm) {\n lcm = l;\n v1 = last * i;\n v2 = pop * i;\n }\n }\n add(iva, last, 1);\n stack.addLast(last);\n }\n }\n\n return new int[]{indexesOfSeq.peekFirst(v1), indexesOfSeq.peekLast(v2)};\n }", "static int trappingWater(int arr[], int n) {\r\n\r\n // Your code here\r\n /** *** tle\r\n for(int i=1;i<n-1;i++){\r\n int l=arr[i];\r\n for (int j = 0; j < i; j++) {\r\n l=l < arr[j] ? arr[j] : l;\r\n }\r\n int r=arr[i];\r\n for (int j = i+1; j <n ; j++) {\r\n r=r < arr[j] ? arr[j] : r;\r\n }\r\n\r\n s=s+(l>r? r:l) -arr[i];\r\n }\r\n return s;\r\n\r\n //////////////////////////////////////////////\r\n SC=O(N)\r\n if(n<=2)\r\n return 0;\r\n int[] left=new int[n];\r\n int[] right=new int[n];\r\n left[0]=0;\r\n int leftmax=arr[0];\r\n for (int i = 1; i <n ; ++i) {\r\n left[i]=leftmax;\r\n leftmax=Math.max(leftmax,arr[i]);\r\n }\r\n right[n-1]=0;\r\n int mxright=arr[n-1];\r\n for (int i = n-2; i >=0 ; --i) {\r\n right[i]=mxright;\r\n mxright=Math.max(mxright,arr[i]);\r\n }\r\n int s=0;\r\n for (int i = 1; i < n-1; ++i) {\r\n if(arr[i]<left[i] && arr[i]<right[i]){\r\n s+=Math.min(left[i],right[i])-arr[i];\r\n }\r\n }\r\n return s;\r\n /////////////////////////////////////////////////////\r\n **/\r\n\r\n if(n<=2)\r\n return 0;\r\n\r\n int leftMax = arr[0];\r\n int rightMax = arr[n-1];\r\n\r\n int left = 1;\r\n int right = n-2;\r\n int water = 0;\r\n\r\n while(left <= right) {\r\n if (leftMax < rightMax) {\r\n if (arr[left] >= leftMax) {\r\n leftMax = arr[left];\r\n } else\r\n water = water + (leftMax - arr[left]);\r\n\r\n //leftMax = Math.max(leftMax, arr[left]);\r\n left++;\r\n } else {\r\n if (arr[right] > rightMax) {\r\n rightMax = arr[right];\r\n }\r\n\r\n water = water + (rightMax - arr[right]);\r\n right--;\r\n }\r\n }\r\n return water;\r\n\r\n }", "private static int[] p1(int[] ar, int n) {\n int[] p1 = new int[n];\n Arrays.fill(p1, -1);\n Stack<Integer> st = new Stack<>();\n for (int i = 0; i < n; i++) {\n while (st.size() != 0 && ar[i] <= ar[st.peek()]) {\n st.pop();\n }\n if (st.size() != 0) {\n p1[i] = st.peek();\n }\n st.push(i);\n }\n return p1;\n }", "public int[] twoSum2(int[] nums, int target) {\n int[] res = new int[2];\n int n = nums.length;\n Map<Integer, Integer> map = new HashMap<>();\n for (int i = 0; i < n; i++) {\n map.put(nums[i], i);\n }\n for (int i = 0; i < n; i++) {\n int key = target - nums[i];\n if (map.containsKey(key) && map.get(key) != i) {\n res[0] = i;\n res[1] = map.get(key);\n return res;\n }\n }\n return res;\n }", "static int countSubarrWithEqualZeroAndOne(int arr[], int n)\n {\n int count=0;\n int currentSum=0;\n HashMap<Integer,Integer> mp=new HashMap<>();\n for(int i=0;i<arr.length;i++)\n {\n if(arr[i]==0)\n arr[i]=-1;\n currentSum+=arr[i];\n \n if(currentSum==0)\n count++;\n if(mp.containsKey(currentSum))\n count+=mp.get(currentSum);\n if(!mp.containsKey(currentSum))\n mp.put(currentSum,1);\n else\n mp.put(currentSum,mp.get(currentSum)+1);\n \n \n }\n return count;\n }", "public static void main(String[] args) \n {\n int[] numOfPoints = { 1000, 10000, 7000, 10000, 13000 };\n for(int count = 0; count < numOfPoints.length; count++)\n {\n List<Point> pointsTobeUsed = new ArrayList<Point>();\n int current = numOfPoints[count];\n int inc = 0;\n \n //creating list of points to be used\n for(int x = 0; x <= current; x++)\n {\n \n if(x <= current/2)\n {\n pointsTobeUsed.add(new Point(x,x));\n \n }\n else\n {\n pointsTobeUsed.add(new Point(x, x - (1 + 2*(inc)) ) );\n inc++;\n }\n }\n \n //n logn implementation of Pareto optimal\n long timeStart = System.currentTimeMillis();\n \n // n logn quicksort\n pointsTobeUsed = quickSort(pointsTobeUsed, 0, pointsTobeUsed.size() -1 );\n \n \n \n ParetoOptimal(pointsTobeUsed);\n \n \n long timeEnd = System.currentTimeMillis();\n System.out.println(\"final:\" + \" exper: \" + (timeEnd - timeStart) + \" N: \" + current ); \n }\n }", "static Object m11869n(@NullableDecl int[] iArr, @NullableDecl Object[] objArr, int i, int i2, @NullableDecl Object obj) {\n Object obj2 = null;\n if (obj == null) {\n return null;\n }\n if (i == 1) {\n if (objArr[i2].equals(obj)) {\n obj2 = objArr[i2 ^ 1];\n }\n return obj2;\n } else if (iArr == null) {\n return null;\n } else {\n int length = iArr.length - 1;\n int b = Hashing.m11897b(obj.hashCode());\n while (true) {\n int i3 = b & length;\n int i4 = iArr[i3];\n if (i4 == -1) {\n return null;\n }\n if (objArr[i4].equals(obj)) {\n return objArr[i4 ^ 1];\n }\n b = i3 + 1;\n }\n }\n }", "static long solve(long[] d) {\n int len = d.length;\n long[] dp = new long[len];\n\n Set<Long> set = new HashSet<>();\n\n for (int index1 = len - 1; index1 >= 0; index1--) {\n int count = 0;\n for (int index2 = index1 + 1; index2 < len; index2++) {\n if (d[index2] > d[index1]) {\n if( set.contains(d[index2] ) )continue;\n set.add(d[index2]);\n count++;\n }\n }\n set = new HashSet<>();\n dp[index1] = count;\n }\n\n long res = 0;\n Set<Long> distinct = new HashSet<>();\n for (int index1 = 0; index1 < len; index1++) {\n long curr = d[index1];\n if (distinct.contains(curr)) {\n continue;\n } else distinct.add(curr);\n for (int index2 = index1 + 1; index2 < len; index2++) {\n if (d[index2] > curr) {\n if (set.contains(d[index2])) continue;\n res += dp[index2];\n set.add(d[index2]);\n }\n }\n set = new HashSet<>();\n }\n\n return res;\n\n }", "public void getTwoElements(int arr[], int n) {\r\n\t\t/*\r\n\t\t * Will hold xor of all elements and numbers from 1 to n\r\n\t\t */\r\n\t\tint xor1;\r\n\r\n\t\t/* Will have only single set bit of xor1 */\r\n\t\tint set_bit_no;\r\n\r\n\t\tint i, x = 0, y = 0;\r\n\r\n\t\txor1 = arr[0];\r\n\r\n\t\t/* Get the xor of all array elements */\r\n\t\tfor (i = 1; i < n; i++)\r\n\t\t\txor1 = xor1 ^ arr[i];\r\n\r\n\t\t/*\r\n\t\t * XOR the previous result with numbers from 1 to n\r\n\t\t */\r\n\t\tfor (i = 1; i <= n; i++)\r\n\t\t\txor1 = xor1 ^ i;\r\n\r\n\t\t/* Get the rightmost set bit in set_bit_no */\r\n\t\tset_bit_no = xor1 & ~(xor1 - 1);\r\n\r\n\t\t/*\r\n\t\t * Now divide elements in two sets by comparing rightmost set bit of xor1 with bit at same position in each\r\n\t\t * element. Also, get XORs of two sets. The two XORs are the output elements.The following two for loops serve\r\n\t\t * the purpose\r\n\t\t */\r\n\t\tfor (i = 0; i < n; i++) {\r\n\t\t\tif ((arr[i] & set_bit_no) != 0)\r\n\t\t\t\t/* arr[i] belongs to first set */\r\n\t\t\t\tx = x ^ arr[i];\r\n\r\n\t\t\telse\r\n\t\t\t\t/* arr[i] belongs to second set */\r\n\t\t\t\ty = y ^ arr[i];\r\n\t\t}\r\n\t\tfor (i = 1; i <= n; i++) {\r\n\t\t\tif ((i & set_bit_no) != 0)\r\n\t\t\t\t/* i belongs to first set */\r\n\t\t\t\tx = x ^ i;\r\n\r\n\t\t\telse\r\n\t\t\t\t/* i belongs to second set */\r\n\t\t\t\ty = y ^ i;\r\n\t\t}\r\n\r\n\t\t/* *x and *y hold the desired output elements */\r\n\t}", "private int houseRobberWithMaxAmountHousesFromItoJInConstantSpace(int[] a, int i, int j) {\n\t\tif (null == a || i > j)\n\t\t\treturn 0;\n\n\t\tif (j - i == 0)\n\t\t\treturn a[i];\n\n\t\tint incl = a[i];\n\t\tint excl = 0, temp;\n\n\t\tfor (int k = i + 1; k <= j; k++) {\n\t\t\ttemp = incl;\n\t\t\tincl = Math.max(excl + a[k], incl);\n\t\t\texcl = temp;\n\t\t}\n\t\treturn incl;\n\t}", "public void triplet(int[] b,int n){\r\n\t\tint count=0;\r\n\t\tfor(int i=0;i<n;i++){\r\n\t\t\tfor(int j=i+1;j<n-1;j++){\r\n\t\t\t\tfor(int k=j+1;k<n-2;k++){\r\n\t\t\t\t\tif(b[i]+b[j]+b[k]==0){\r\n\t\t\t\t\t\tSystem.out.println(b[i]+\" \"+b[j]+\" \"+b[k]);\r\n\t\t\t\t\t\tcount++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"no of distinct triplet is:\"+count);\t\r\n\r\n\t}", "private int hash2(K key){\r\n return indexFor(hash(key.hashCode2()), capacity);\r\n }", "@Override\n public Z computeNext() {\n int n = size();\n if (n <= 2) {\n return Z.valueOf(mInits[n]);\n }\n final int pow2 = Integer.highestOneBit(n);\n final int j = n - pow2;\n Z result = a(j).multiply(mFaj0).add(a(j + 1).multiply(mFaj1));\n if (j == pow2 - 1) {\n result = result.add(1);\n }\n return result;\n \n }", "private static List<Integer> getCommonElementsAlgo2(int [] arr1, int [] arr2) {\n\t\t\n\t\tList<Integer> duplicates = new ArrayList<>();\n\t\t\n\t\tHashtable<Integer, Integer> table = new Hashtable<>();\n\t\t\n\t\tfor (int i : arr1) {\n\t\t\tif (table.containsKey(i)) {\n\t\t\t\ttable.put(i, table.get(i) + 1);\n\t\t\t}\n\t\t\ttable.put(i, 1);\n\t\t}\n\t\t\n\t\tfor (int j : arr2) {\n\t\t\tif (table.containsKey(j)) {\n\t\t\t\tduplicates.add(j);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn duplicates;\n\t\t\n\t}", "public int solution2(int N) {\n\n int l = 0; // 2*l - r\n int r = 1; // 2*r - l\n\n return search2(l, r, N);\n }", "static void findTwoMissingNumber(int a[]) {\n int miss1 = 0;\n int miss2;\n int miss1miss2 = 0;\n\n int size = a.length;\n for (int i = 0; i < size; i++) {\n miss1miss2 ^= ((i + 1) ^ a[i]);\n }\n\n miss1miss2 ^= (size + 1);\n miss1miss2 ^= (size + 2);\n\n int diff = miss1miss2 & (-miss1miss2);\n\n for (int i = 0; i < size; i++) {\n if (((i + 1) & diff) > 0)\n miss1 ^= (i + 1);\n\n if ((a[i] & diff) > 0)\n miss1 ^= a[i];\n }\n\n if (((size + 1) ^ diff) > 0)\n miss1 ^= (size + 1);\n\n if (((size + 2) ^ diff) > 0)\n miss1 ^= (size + 2);\n\n miss2 = miss1miss2 ^ miss1;\n\n System.out.println(miss1);\n System.out.println(miss2);\n }", "public static int efficientOne(int n) {\r\n\t\tif (n < 2)\r\n\t\t\treturn n;\r\n\t\tint prevPrev = 0;\r\n\t\tint prev = 1;\r\n\t\tint fib = 0;\r\n\t\tfor (int i = 2; i <= n; i++) {\r\n\t\t\tfib = prev + prevPrev;\r\n\t\t\tprevPrev = prev;\r\n\t\t\tprev = fib;\r\n\t\t}\r\n\t\treturn fib;\r\n\t}", "private static void get4ElementsSumCountFastest(String inputLine, int target) {\n String[] arr = inputLine.split(\" \");\n if (arr.length < 3) {\n System.out.println(0);\n return;\n }\n\n Map<Integer, Set<String>> pairSumMap = new HashMap<>();\n List<Integer> list = new ArrayList<>(arr.length);\n for (String s : arr) {\n list.add(Integer.parseInt(s.trim()));\n }\n\n int sum = 0, diff = 0;\n for (int i = 0; i < arr.length; i++) {\n for (int j = i + 1; j < arr.length; j++) {\n sum = list.get(i) + list.get(j);\n if (sum < target) {\n pairSumMap.putIfAbsent(sum, new HashSet<>());\n pairSumMap.get(sum).add(i + \"-\" + j);\n }\n }\n }\n\n for (Map.Entry<Integer, Set<String>> mk : pairSumMap.entrySet()) {\n diff = target - mk.getKey();\n if (pairSumMap.containsKey(diff)) {\n Set<String> indexesList = mk.getValue();\n for (String index : indexesList) {\n int indexOrgX = Integer.parseInt(index.split(\"-\")[0]);\n int indexOrgY = Integer.parseInt(index.split(\"-\")[1]);\n for (String newIdx : pairSumMap.get(diff)) {\n int indexNewX = Integer.parseInt(newIdx.split(\"-\")[0]);\n int indexNewY = Integer.parseInt(newIdx.split(\"-\")[1]);\n if (indexOrgX != indexNewX && indexOrgX != indexNewY && indexOrgY != indexNewX && indexOrgY != indexNewY) {\n System.out.println(1);\n return;\n }\n }\n }\n }\n }\n System.out.println(0);\n }", "private void discretization(int[] nums) {\n\t\tint[] sorted = nums.clone();\n\t\tArrays.sort(sorted);\n\t\tfor (int i = 0; i < nums.length; i++) {\n\t\t\tnums[i] = Arrays.binarySearch(sorted, nums[i]);\n\t\t}\n\t}", "public int findPairsTwoPointers(int[] nums, int k) {\n if (k < 0) {\n return 0;\n }\n Arrays.sort(nums); // O(N*logN)\n\n int i = 0;\n int j = 1;\n int count = 0;\n while (j < nums.length) { // O(N)\n if (i == j || nums[j] - nums[i] < k) {\n j++;\n } else if (nums[j] - nums[i] > k) {\n i++;\n } else {\n count += 1;\n j++;\n while (j < nums.length && nums[j] == nums[j - 1]) {\n j++;\n }\n }\n }\n return count;\n }", "public void missingNumberEfficient2(int[] array, int n) {\n\t\t\n\t\tint X = 0;\n\t\tint Y = 0;\n\t\t\n\t\tfor(int i = 0; i < array.length; i++) {\n\t\t\tX ^= array[i];\n\t\t}\n\t\t\n\t\tfor(int i = 1; i <= n; i++) {\n\t\t\tY ^= i;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Missing Number is : \" + (X ^ Y));\n\t}", "private int gameV(int i, int j, int x) {\n int count = 2;\n for (int ii = 0; ii < i; ii++) {\n for (int jj = ii + 1; jj < n; jj++) {\n if (ii != x && jj != x) count++;\n }\n }\n for (int jj = i + 1; jj < j; jj++) {\n if (jj != x) count++;\n }\n return count;\n }", "public static boolean find3Numbers(int A[], int n, int X) { \n \n // Your code \n for(int i=0;i<n-2;i++)\n {\n HashSet<Integer> set = new HashSet<>();\n int toFind=X-A[i];\n for(int j=i+1;j<n;j++)\n {\n if(set.contains(toFind-A[j]))\n {\n return true;\n }\n set.add(A[j]);\n }\n }\n return false;\n }", "private int A(int n, int m) {\n int res = 1;\n for (int i = 0; i < m; n++)\n res *= n;\n return res;\n }", "private int rs(final int x) {\n assert(! leaf(x));\n return Math.min(2*x+2, n);\n }" ]
[ "0.7396602", "0.6926155", "0.66727793", "0.6604036", "0.6139762", "0.61213535", "0.60339177", "0.6024553", "0.59879553", "0.59857476", "0.59813523", "0.5978266", "0.59459406", "0.58895546", "0.58704984", "0.584019", "0.58024865", "0.58018345", "0.5766866", "0.5747929", "0.5723036", "0.57043445", "0.5687392", "0.56680864", "0.5666808", "0.56556624", "0.56497604", "0.563736", "0.55963296", "0.554491", "0.5540274", "0.55133474", "0.5504359", "0.54968506", "0.54876524", "0.5468845", "0.54647845", "0.54613703", "0.54526114", "0.54409885", "0.54375714", "0.5434039", "0.542431", "0.5418548", "0.5399609", "0.53896827", "0.5386928", "0.5385145", "0.53849304", "0.53701293", "0.5368307", "0.536376", "0.53608483", "0.535483", "0.53393245", "0.5334708", "0.5331785", "0.53307796", "0.5325118", "0.53233993", "0.53076476", "0.53066844", "0.52990353", "0.5298913", "0.5287771", "0.52833277", "0.5281074", "0.5258852", "0.5256403", "0.5250259", "0.52418", "0.5241291", "0.52391416", "0.52370006", "0.52370006", "0.5235927", "0.5228908", "0.522609", "0.52257335", "0.5223524", "0.5215733", "0.52149016", "0.52105373", "0.5210529", "0.5208183", "0.5199018", "0.5196319", "0.51934", "0.5186212", "0.51803315", "0.5178804", "0.51775116", "0.5174224", "0.5171943", "0.51680875", "0.5163739", "0.51628816", "0.5159846", "0.51589537", "0.51532376", "0.5153146" ]
0.0
-1
// mission 3 O(n) //
public Point[] getPointsInRangeRegAxis(int min, int max, Boolean axis) { int Number = NumInRangeAxis(min, max, axis); //how much points are there ? Point[] pointsInRange = new Point[Number]; if (Number==0) return pointsInRange; int i = 0; if (axis){ this.current=this.minx; while (i<Number){ if (this.current.getData().getX()>=min && this.current.getData().getX()<=max){ pointsInRange[i]=this.current.getData(); i++;} this.current=this.current.getNextX(); } } else { this.current=this.miny; while (i<Number){ if (this.current.getData().getY()>=min && this.current.getData().getY()<=max){ pointsInRange[i]=this.current.getData(); i++;} this.current=this.current.getNextY(); } } return pointsInRange; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int f2(int N) { \n int x = 0; //O(1)\n for(int i = 0; i < N; i++) // O(n)\n // O(n)`\n for(int j = 0; j < i; j++) \n x++;\n return x;\n }", "public int[] fix34(int[] nums) {\r\n\tint i=0; // O(1)\r\n while(i<nums.length && nums[i]!=3) // O(n)\r\n i++; // n+1\r\n int j=i; // O(1)\r\n while(j+1<nums.length && nums[j+1]!=4) // O(n)\r\n j++; // n+1\r\n while(i<nums.length){ // O(n)\r\n if(nums[i]==3){ // O(1)\r\n int temp=nums[i+1]; // O(1)\r\n nums[i+1]=nums[j+1]; //O(1)\r\n nums[j+1]=temp; // O(1)\r\n while(j+1<nums.length && nums[j+1] != 4) //O(n)\r\n j++; // n+1\r\n }\r\n i++; // n+1\r\n }\r\n return nums; //O(1)\r\n}", "public static int f1(int N) {\n int x = 0; //O(1)\n for(int i = 0; i < N; i++) // O(n) \n x++; \n return x; \n \n }", "public static int example3(int[] arr) { // O(n)\r\n\t\tint n = arr.length, total = 0; // O(1)\r\n\t\tfor (int j = 0; j < n; j++) // loop from 0 to n-1 // O(n^2)\r\n\t\t\tfor (int k = 0; k <= j; k++) // loop from 0 to j\r\n\t\t\t\ttotal += arr[j];\r\n\t\treturn total;\r\n\r\n\t\t/*\r\n\t\t * Explanation: Since we have nested for loop which dominates here and it is\r\n\t\t * O(n^2) and we always take the maximum. so the answer is quadratic time O(n^2)\r\n\t\t * \r\n\t\t */\r\n\t}", "public static int example4(int[] arr) { // O(1)\r\n\t\tint n = arr.length, prefix = 0, total = 0; // O(1), O(1), (1)\r\n\t\tfor (int j = 0; j < n; j++) { // loop from 0 to n-1 // O(n)\r\n\t\t\tprefix += arr[j];\r\n\t\t\ttotal += prefix;\r\n\t\t}\r\n\t\treturn total;\r\n\r\n\t\t/*\r\n\t\t * Explanation: The method contains a (for) loop and it runs (n) times.This loop\r\n\t\t * dominates the runtime.We always aim for the worse-case and maximum time. The\r\n\t\t * answer is it is linear time of O(n) notation.\r\n\t\t * \r\n\t\t */\r\n\t}", "private final int m()\n\t { int n = 0;\n\t int i = 0;\n\t while(true)\n\t { if (i > j) return n;\n\t if (! cons(i)) break; i++;\n\t }\n\t i++;\n\t while(true)\n\t { while(true)\n\t { if (i > j) return n;\n\t if (cons(i)) break;\n\t i++;\n\t }\n\t i++;\n\t n++;\n\t while(true)\n\t { if (i > j) return n;\n\t if (! cons(i)) break;\n\t i++;\n\t }\n\t i++;\n\t }\n\t }", "static int[] sol1(int[]a, int n){\r\n\t\tMap <Integer,Integer> map= new HashMap();\r\n\t\tfor (int i = 0; i< a.length; i++){\r\n\t\t\tmap.put(a[i],i);\r\n\t\t}\r\n\t\tArrays.sort(a);\r\n\t\tint i = 0; \r\n\t\tint j = a.length -1;\r\n\t\twhile (i <= j){\r\n\t\t\tif(a[i]+a[j]>n) j--;\r\n\t\t\telse if (a[i]+a[j]<n) i++;\r\n\t\t\telse break;\r\n\t\t}\r\n\t\tint[] ans= {map.get(a[i]),map.get(a[j])};\r\n\t\treturn ans;\r\n\t}", "public static int f3(int N) {\n \n // O(1)\n if (N == 0) return 1;\n else{ \n \n int x = 0;\n // O(N)\n for(int i = 0; i < N; i++)\n x += f3(N-1);\n return x;\n }\n }", "public List<List<Integer>> threeSum(int[] nums) {\n List<List<Integer>> result = new ArrayList<>(nums.length);\n\n // Prepare\n Arrays.sort(nums);\n// int firstPositiveIndex = 0;\n// int negativeLength = 0;\n// List<Integer> numsFiltered = new ArrayList<>();\n// for (int i = 0; i < nums.length; i++) {\n// if (i == 0 || i == 1 || nums[i] == 0 || (nums[i] != nums[i-2])) {\n// numsFiltered.add(nums[i]);\n// if ((nums[i] >= 0) && (firstPositiveIndex == 0)) {\n// firstPositiveIndex = numsFiltered.size() - 1;\n// }\n// if ((nums[i] <= 0)) {\n// negativeLength = numsFiltered.size();\n// }\n// }\n// }\n// nums = numsFiltered.stream().mapToInt(i->i).toArray();\n\n // Func\n\n for(int i=0; (i < nums.length) && (nums[i] <= 0); i++) {\n if (i != 0 && nums[i] == nums[i-1]) {\n continue;\n }\n for(int j=i+1; j<nums.length; j++) {\n if (j != i+1 && nums[j] == nums[j-1]) {\n continue;\n }\n for(int k=nums.length-1; (k>j) && nums[k] >= 0; k--) {\n if (k != nums.length-1 && nums[k] == nums[k+1]) {\n continue;\n }\n int sum = nums[i]+nums[j]+nums[k];\n if (sum > 0) {\n continue;\n } else if (sum < 0) {\n break;\n }\n\n List<Integer> ok = new ArrayList<>();\n ok.add(nums[i]);\n ok.add(nums[j]);\n ok.add(nums[k]);\n result.add(ok);\n break;\n }\n }\n }\n\n// System.out.println(\"Finish time = \" + (System.nanoTime() - start) / 1_000_000);\n// System.out.println(\"result size = \" + result.size());\n\n return result;\n }", "static int[] OnepassSol1(int[]a, int n){\r\n Map<Integer, Integer> map = new HashMap<>();\r\n for (int i = 0; i < a.length; i++) {\r\n int complement = n - a[i];\r\n if (map.containsKey(complement)) {\r\n return new int[] { map.get(complement), i };\r\n }\r\n map.put(a[i], i);\r\n }\r\n int[] ans = {-1,-1};\r\n return ans;\r\n }", "public List<List<Integer>> threeSum(int[] nums) {\n Arrays.sort(nums);\n\n Set<List<Integer>> triplets = new HashSet<List<Integer>>();\n\n for (int i = 0; i < nums.length; i++) {\n // we choose the number at index i to pinpoint\n int a = nums[i];\n int deficit = 0 - a;\n\n // initialize our two pointers such that they're at either end of the\n // array and that they're not i\n int b = i == 0 ? 1 : 0;\n int c = i == nums.length - 1 ? nums.length - 2 : nums.length - 1;\n\n while (b < c) {\n // check if b and c add up to the deficit\n if (nums[b] + nums[c] == deficit) {\n // add it to the list\n List<Integer> triplet = new ArrayList<Integer>();\n\n triplet.add(a);\n triplet.add(nums[b]);\n triplet.add(nums[c]);\n\n Collections.sort(triplet);\n if (!triplets.contains(triplet)) {\n triplets.add(triplet);\n }\n\n\n // move pointer up and down\n c -= 1;\n if (c == i) {\n c -= 1;\n }\n\n b += 1;\n if (b == i) {\n b += 1;\n }\n } else if (nums[b] + nums[c] > deficit) {\n // if it's too large, bring top pointer down\n c -= 1;\n if (c == i) {\n c -= 1;\n }\n } else {\n // if it's too small, bring bottom pointer up\n b += 1;\n if (b == i) {\n b += 1;\n }\n }\n }\n }\n\n List<List<Integer>> last = new ArrayList<List<Integer>>(triplets);\n return last;\n }", "public List<List<Integer>> threeSum3(int[] nums) {\n List<List<Integer>> result = new ArrayList<>();\n Arrays.sort(nums);\n int n = nums.length;\n for (int i = 0; i < n - 2; i++) {\n if (i > 0 && nums[i - 1] == nums[i]) continue; // Bypass duplicate!\n for (int l = i + 1, r = n - 1; l < r; ) {\n if (nums[i] + nums[l] + nums[r] < 0) l++;\n else if (nums[i] + nums[l] + nums[r] > 0) r--;\n else {\n result.add(Arrays.asList(nums[i], nums[l++], nums[r--]));\n while (l < r && nums[l] == nums[l - 1]) l++; // Bypass duplicate!\n while (l < r && nums[r] == nums[r + 1]) r--;\n }\n }\n }\n return result;\n }", "public static int example2(int[] arr) { // O(1)\r\n\t\tint n = arr.length, total = 0; // O(1)\r\n\t\tfor (int j = 0; j < n; j += 2) // note the increment of 2 // O(1)\r\n\t\t\ttotal += arr[j];\r\n\t\treturn total;\r\n\r\n\t\t/*\r\n\t\t * Explanation: Once Again, we have a (for) loop and it runs (n) times and this\r\n\t\t * for loop dominates the runtime.So this is linear time and the answer is O(n).\r\n\t\t * \r\n\t\t */\r\n\t}", "public static boolean canThreePartsEqualSum(int[] arr) {\n int sum=0;\n int cumulative[]=new int[arr.length];\n for(int i=0;i<arr.length;i++){\n sum+=arr[i];\n cumulative[i]=sum;\n }\n for(int i=0;i<cumulative.length;i++){\n for(int j=i+1;j<cumulative.length;j++){\n if(cumulative[i]==cumulative[j]-cumulative[i]){\n if(cumulative[i]==cumulative[cumulative.length-1]-cumulative[j] && (cumulative.length-1) !=j){\n return true;\n }\n }\n }\n }\n return false;\n}", "private int e(amj paramamj)\r\n/* 202: */ {\r\n/* 203:221 */ alq localalq = paramamj.b();\r\n/* 204:222 */ int i = paramamj.b;\r\n/* 205: */ \r\n/* 206:224 */ int j = d(paramamj);\r\n/* 207:225 */ if (j < 0) {\r\n/* 208:226 */ j = j();\r\n/* 209: */ }\r\n/* 210:228 */ if (j < 0) {\r\n/* 211:229 */ return i;\r\n/* 212: */ }\r\n/* 213:231 */ if (this.a[j] == null)\r\n/* 214: */ {\r\n/* 215:232 */ this.a[j] = new amj(localalq, 0, paramamj.i());\r\n/* 216:233 */ if (paramamj.n()) {\r\n/* 217:234 */ this.a[j].d((fn)paramamj.o().b());\r\n/* 218: */ }\r\n/* 219: */ }\r\n/* 220:238 */ int k = i;\r\n/* 221:239 */ if (k > this.a[j].c() - this.a[j].b) {\r\n/* 222:240 */ k = this.a[j].c() - this.a[j].b;\r\n/* 223: */ }\r\n/* 224:242 */ if (k > p_() - this.a[j].b) {\r\n/* 225:243 */ k = p_() - this.a[j].b;\r\n/* 226: */ }\r\n/* 227:246 */ if (k == 0) {\r\n/* 228:247 */ return i;\r\n/* 229: */ }\r\n/* 230:250 */ i -= k;\r\n/* 231:251 */ this.a[j].b += k;\r\n/* 232:252 */ this.a[j].c = 5;\r\n/* 233: */ \r\n/* 234:254 */ return i;\r\n/* 235: */ }", "public int[] squareUp(int n) {\r\n int[]arreglo=new int[(n*n)]; // O(1)\r\n if(n==0){ // O(1)\r\n return arreglo; // O(1)\r\n }\r\n for(int i=n-1;i<arreglo.length;i=i+n){ // O(n)\r\n for (int j=i;j>=i-(i/n);j--){ // O(1)\r\n arreglo[j]=1+(i-j); // O(1)\r\n }\r\n }\r\n return arreglo; // O(1)\r\n}", "private int d(@Nullable K ☃) {\r\n/* 127 */ return (xq.f(System.identityHashCode(☃)) & Integer.MAX_VALUE) % this.b.length;\r\n/* */ }\r\n/* */ private int b(@Nullable K ☃, int i) {\r\n/* */ int j;\r\n/* 131 */ for (j = i; j < this.b.length; j++) {\r\n/* 132 */ if (this.b[j] == ☃) {\r\n/* 133 */ return j;\r\n/* */ }\r\n/* 135 */ if (this.b[j] == a) {\r\n/* 136 */ return -1;\r\n/* */ }\r\n/* */ }", "public static int ulam(int n) {\n\n List<Integer> list = new ArrayList<>();\n list.add(1);\n list.add(2);\n\n int i = 3;\n while (list.size() < n) {\n\n int count = 0;\n for (int j = 0; j < list.size() - 1; j++) {\n\n for (int k = j + 1; k < list.size(); k++) {\n if (list.get(j) + list.get(k) == i)\n count++;\n if (count > 1)\n break;\n }\n if (count > 1)\n break;\n }\n if (count == 1)\n list.add(i);\n i++;\n }\n return list.get(n - 1);\n }", "private static List<List<Integer>> threeSum(int[] nums) {\n int len = nums.length;\n int start = 0;\n List<List<Integer>> result = new LinkedList<>();\n\n Arrays.sort(nums);\n\n while (start < len - 2) {\n if (start > 0 && nums[start] == nums[start - 1]) {\n start++;\n continue;\n }\n findPair(nums, -nums[start], start + 1, result);\n start++;\n }\n return result;\n }", "public static boolean find3Numbers(int A[], int n, int X) { \n \n // Your code \n for(int i=0;i<n-2;i++)\n {\n HashSet<Integer> set = new HashSet<>();\n int toFind=X-A[i];\n for(int j=i+1;j<n;j++)\n {\n if(set.contains(toFind-A[j]))\n {\n return true;\n }\n set.add(A[j]);\n }\n }\n return false;\n }", "private static int f(int n, int complete, int other, int[] arr) {\n if(n<=0)\n return 0;\n int res=0;\n ArrayList<Integer>list=new ArrayList<Integer>();\n for(int a:arr)\n if(a>0)\n list.add(a);\n int brr[]=new int[list.size()];\n for(int i=0;i<brr.length;i++)\n brr[i]=list.get(i);\n while(brr.length!=0){\n int index=0;\n for(int i=1;i<brr.length;i++)\n if(brr[index]<brr[i])\n index=i;\n for(int i=0;i<brr.length;i++){\n if(index==i)\n brr[i]-=complete;\n else\n brr[i]-=other;\n }\n list=new ArrayList<Integer>();\n for(int a:brr)\n if(a>0)\n list.add(a);\n brr=new int[list.size()];\n for(int i=0;i<brr.length;i++)\n brr[i]=list.get(i);\n res++;\n }\n return res;\n }", "public int findDuplicate(int[] nums) {\n if(nums == null || nums.length == 0) return 0;\n\n int slow = nums[0];\n int fast = nums[nums[0]];\n\n while(slow != fast) {\n slow = nums[slow];\n fast = nums[nums[fast]];\n }\n\n fast = 0;\n while(slow != fast) {\n slow = nums[slow];\n fast = nums[fast];\n }\n\n return slow;\n}", "static long nPolyNTime(int[] n) {\n int temp = n.length;\n long sum = 0;\n if(n == null || n.length == 0) return -1;\n for(int i = 0; i < n.length; ++i) {\n while(temp --> 0) {\n for(int j = 0; j < n.length; ++j) {\n sum += n[i] + n[j];\n }\n }\n }\n return sum;\n }", "static int countCollinearFast(int[] a1, int[] a2, int[] a3)\n {\n //TODO: implement this method\n \tsort(a3);\n \tint count = 0;\n \tint search;\n \t\n \tfor (int i=0; i<a1.length; i++)\n \t\tfor (int j=0; j<a2.length; j++)\n \t\t{\n \t\t\tsearch = 2*a2[j] - a1[i];\n \t\t\tif (binarySearch(a3, search))\n \t\t\t\tcount++;\n \t\t}\n \t\n \treturn count;\n }", "public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\n\t\tint a[] = {2,1,3,-4,-2};\n\t\t//int a[] = {1 ,2, 3, 7, 5};\n\t\tboolean found = false;\n\t\t\n\t\t//this will solve in o n^2\n\t\tfor(int i = 0 ; i < a.length ; i++){\n\t\t\tint sum = 0;\n\t\t\tfor(int j = i ; j< a.length ; j++){\n\t\t\t\tsum += a[j] ;\n\t\t\t\tif(sum == 0){\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tif(found)\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t\n\t\t// link : https://www.youtube.com/watch?v=PSpuM9cimxA&list=PLKKfKV1b9e8ps6dD3QA5KFfHdiWj9cB1s&index=49\n\t\tSystem.out.println(found + \" found\");\n\t\tfound = false;\n\t\t//solving with O of N with the help sets\n\t\t// x + 0 = y\n\t\tSet<Integer> set = new HashSet<>();\n\t\tint sum = 0;\n\t\tfor(int element : a){\n\t\t\tset.add(sum);\n\t\t\tsum += element;\n\t\t\tif(set.contains(sum)){\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\tSystem.out.println(set);\n\t\t\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t\tfound = false;\n\t\t// when the sum of subarray is K\n\t\t\n\t\t//solving with O of N with the help sets\n\t\t//x + k = y >>>\n\t\tSet<Integer> set1 = new HashSet<>();\n\t\tint k = 12;\n\t\tint summ = 0;\n\t\tfor(int element : a){\n\t\t\tset1.add(summ);\n\t\t\tsumm += element;\n\t\t\tif(set1.contains(summ - k)){ // y - k = x(alredy presnt or not)\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(set1);\n\t\tSystem.out.println();\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t}", "public List<List<Integer>> threeSum(int[] nums) {\n Arrays.sort(nums);\n List<List<Integer>> ret = new ArrayList<>();\n int n = nums.length;\n for (int i = 0; i < n - 2; i++) {\n if (i > 0 && nums[i - 1] == nums[i]) continue;\n for (int j = i + 1, k = n - 1; j < k; ) {\n int sum = nums[i] + nums[j] + nums[k];\n if (j > i + 1 && nums[j - 1] == nums[j]) j++;\n else if (sum < 0) j++;\n else if (sum > 0) k--;\n else ret.add(Arrays.asList(nums[i], nums[j++], nums[k--]));\n }\n }\n return ret;\n }", "public static int[] exe1(int[] arr){ // Solution O(n) in time and constant in Memory\n int nzeros=0;\n\n for (int i=0; i<arr.length; i++) {\n arr[i-nzeros] = arr[i];\n if (arr[i] == 0) {\n nzeros++;\n }\n }\n for (int i=arr.length-1; i>arr.length-nzeros-1; i--) {\n arr[i] = 0;\n }\n\n return arr;\n }", "public static void main(String[] args) {\n\n pairsSum();\n\n printAllSubArrays();\n\n tripletZero();\n\n // int[][] sub = subsets();\n\n PairsSum sum = new PairsSum();\n int[] arr = { 10, 1, 2, 3, 4, 5, 6, 1 };\n boolean flag = sum.almostIncreasingSequence(arr);\n System.out.println(flag);\n\n String s = \"\";\n for (int i = 0; i < 100000; i++) {\n // s += \"CodefightsIsAwesome\";\n }\n long start = System.currentTimeMillis();\n // int k = subStr(s, \"IsA\");\n System.out.println(System.currentTimeMillis() - start);\n // System.out.println(k);\n\n String[] a = { \"aba\", \"aa\", \"ad\", \"vcd\", \"aba\" };\n String[] b = sum.allLongestStrings(a);\n System.out.println(Arrays.deepToString(b));\n\n List<String> al = new ArrayList<>();\n al.toArray();\n\n Map<Integer, Integer> map = new HashMap<>();\n Set<Integer> keySet = map.keySet();\n for (Integer integer : keySet) {\n\n }\n\n String st = reverseBracksStack(\"a(bc(de)f)g\");\n System.out.println(st);\n\n int[] A = { 1, 2, 3, 2, 2, 3, 3, 33 };\n int[] B = { 1, 2, 2, 2, 2, 3, 2, 33 };\n\n System.out.println(sum.isIPv4Address(\"2.2.34\"));\n\n Integer[] AR = { 5, 3, 6, 7, 9 };\n int h = sum.avoidObstacles(AR);\n System.out.println(h);\n\n int[][] image = { { 36, 0, 18, 9 }, { 27, 54, 9, 0 }, { 81, 63, 72, 45 } };\n int[][] im = { { 7, 4, 0, 1 }, { 5, 6, 2, 2 }, { 6, 10, 7, 8 }, { 1, 4, 2, 0 } };\n int[][] res = sum.boxBlur(im);\n\n for (int i = 0; i < res.length; i++) {\n for (int j = 0; j < res[0].length; j++) {\n System.out.print(res[i][j] + \" \");\n }\n System.out.println();\n }\n\n boolean[][] ms = { { true, false, false, true }, { false, false, true, false }, { true, true, false, true } };\n int[][] mines = sum.minesweeper(ms);\n for (int i = 0; i < mines.length; i++) {\n for (int j = 0; j < mines[0].length; j++) {\n System.out.print(mines[i][j] + \" \");\n }\n System.out.println();\n }\n\n System.out.println(sum.variableName(\"var_1__Int\"));\n\n System.out.println(sum.chessBoard());\n\n System.out.println(sum.depositProfit(100, 20, 170));\n\n String[] inputArray = { \"abc\", \"abx\", \"axx\", \"abx\", \"abc\" };\n System.out.println(sum.stringsRearrangement(inputArray));\n\n int[][] queens = { { 1, 1 }, { 3, 2 } };\n int[][] queries = { { 1, 1 }, { 0, 3 }, { 0, 4 }, { 3, 4 }, { 2, 0 }, { 4, 3 }, { 4, 0 } };\n boolean[] r = sum.queensUnderAttack(5, queens, queries);\n\n }", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int T = sc.nextInt();\n for(int i = 0 ; i < T; i++) {\n int n = sc.nextInt();\n int a = sc.nextInt();\n int b = sc.nextInt();\n PriorityQueue<Integer> queue = new PriorityQueue<Integer>();\n int[][] m = new int[n][n];\n //n^2 * log(n)\n for(int row = 0; row < n; row++) {\n for(int col = 0; col < n; col++) {\n if(row == 0 && col == 0 && n != 1) {\n continue;\n }else if(row == 0) {\n m[row][col] = m[row][col - 1] + a;\n }else if(col == 0) {\n m[row][col] = m[row-1][col] + b;\n }else {\n m[row][col] = m[row-1][col-1] + a + b;\n }\n\n if(row + col == (n -1)) {\n pool.add(m[row][col]); //log(n)\n }\n }\n }\n //O(n*log(n))\n for (Integer item:pool) {\n queue.add(item); //O(logn)\n }\n while(!queue.isEmpty()) {\n System.out.print(queue.poll() + \" \"); //O(1)\n }\n System.out.println();\n queue.clear();\n pool.clear();\n }\n }", "void findCommon(int ar1[], int ar2[], int ar3[], int n1,\n int n2, int n3)\n{\n int i = 0, j = 0, k = 0;\n int prev1, prev2, prev3;\n prev1 = prev2 = prev3 = INT_MIN;\n while (i < n1 && j < n2 && k < n3) {\n while (ar1[i] == prev1 && i < n1)\n i++;\n while (ar2[j] == prev2 && j < n2)\n j++;\n while (ar3[k] == prev3 && k < n3)\n k++;\n if (ar1[i] == ar2[j] && ar2[j] == ar3[k]) {\n cout << ar1[i] << \" \";\n prev1 = ar1[i];\n prev2 = ar2[j];\n prev3 = ar3[k];\n i++;\n j++;\n k++;\n }\n else if (ar1[i] < ar2[j]) {\n prev1 = ar1[i];\n i++;\n }\n else if (ar2[j] < ar3[k]) {\n prev2 = ar2[j];\n j++;\n }\n else {\n prev3 = ar3[k];\n k++;\n }\n }\n}", "static int getMissingByAvoidingOverflow(int a[], int n)\n\t {\n\t int total = 2;\n\t for (int i = 3; i <= (n + 1); i++)\n\t {\n\t total =total+ i -a[i - 2];\n\t //total =total- a[i - 2];\n\t }\n\t return total;\n\t }", "public static ArrayList<ArrayList<Integer>> fourSum(ArrayList<Integer> a, int k) {\n Collections.sort(a);\n System.out.println(a);\n LinkedHashMap<Integer, List<List<Integer>>> m = new LinkedHashMap<Integer, List<List<Integer>>>();\n for (int i = 0; i <= a.size() - 3; i++) {\n for (int j = i + 1; j <= a.size() - 2; j++) {\n if (m.get(a.get(i) + a.get(j)) == null) {\n ArrayList<List<Integer>> v = new ArrayList<List<Integer>>();\n List<Integer> c = new ArrayList<Integer>();\n c.add(i);\n c.add(j);\n v.add(c);\n m.put(a.get(i) + a.get(j), v);\n } else {\n List<List<Integer>> v = m.get(a.get(i) + a.get(j));\n List<Integer> c = new ArrayList<Integer>();\n c.add(i);\n c.add(j);\n v.add(c);\n m.put(a.get(i) + a.get(j), v);\n }\n\n }\n }\n LinkedHashSet<ArrayList<Integer>> res = new LinkedHashSet<ArrayList<Integer>>();\n for (int i = 2; i <= a.size() - 1; i++) {\n for (int j = i + 1; j < a.size(); j++) {\n List<List<Integer>> v = m.get(k - (a.get(i) + a.get(j)));\n if (v != null && v.size() >= 1) {\n for (List<Integer> l : v) {\n\n if (l.get(0) < l.get(1) && l.get(1) < i && l.get(1) < j) {\n //System.out.println(l.get(0) + \" \" + l.get(1) + \" \" + i + \" \" + j);\n ArrayList<Integer> out = new ArrayList<Integer>();\n out.add(a.get(l.get(0)));\n out.add(a.get(l.get(1)));\n out.add(a.get(i));\n out.add(a.get(j));\n Collections.sort(out);\n //System.out.println(out);\n res.add(out);\n }\n }\n }\n }\n }\n return new ArrayList<ArrayList<Integer>>(res);\n }", "public static int degreeOfArray(List<Integer> arr) { arr.length = n\n // num of Keys = k\n // O(n + k)\n // max value count = m\n //\n PriorityQueue<Node> pq = new PriorityQueue<>((i, j)-> j.count - i.count);\n Map<Integer, NodePosition> posMap = new HashMap<>();\n Map<Integer, Node> countMap = new HashMap<>();\n // [1, 2, 3, 4, 5, 6]\n for (int i = 0; i < arr.size(); i++) {\n int cur = arr.get(i);\n\n if (!countMap.containsKey(cur)) {\n countMap.put(cur, new Node(cur, 1));\n } else {\n Node curNode = countMap.get(cur);\n curNode.count++;\n countMap.put(cur, curNode);\n }\n\n if (!posMap.containsKey(cur)) {\n posMap.put(cur, new NodePosition(i, i));\n } else {\n NodePosition curNodePos = posMap.get(cur);\n curNodePos.endIndex = i;\n posMap.put(cur, curNodePos);\n }\n }\n //Iterator<Map.Entry<Integer, Node> it = new Iterator<>(countMap);\n for (Map.Entry<Integer, Node> e : countMap.entrySet()) {\n pq.add(e.getValue());\n }\n\n // [1, 2, 1, 3 ,2]\n // 1 , 2 , 3\n Node curNode = pq.remove();\n int maxCount = curNode.count;\n\n int minRange = posMap.get(curNode.num).endIndex - posMap.get(curNode.num).startIndex;\n\n while (!pq.isEmpty() && maxCount == pq.peek().count) {\n curNode = pq.remove();\n NodePosition nPos = posMap.get(curNode.num);\n minRange = Math.min(minRange, nPos.endIndex - nPos.startIndex);\n }\n\n return minRange + 1;\n }", "public static int example1(int[] arr) { // O(1)\r\n\t\tint n = arr.length, total = 0; // O(1)\r\n\t\tfor (int j = 0; j < n; j++) // loop from 0 to n-1 // O(n)\r\n\t\t\ttotal += arr[j];\r\n\t\treturn total;\r\n\t}", "void h(List<List<Integer>> r, List<Integer> t, int n, int s){ \n for(int i = s; i*i <= n; i++){\n if(n % i != 0) continue; \n t.add(i);\n t.add(n / i);\n r.add(new ArrayList<>(t));\n t.remove(t.size() - 1);\n h(r, t, n/i, i);\n t.remove(t.size() - 1);\n }\n }", "private int getCondensedIndex(int n, int i, int j) {\n if (i < j) {\n return n * i - (i * (i + 1) / 2) + (j - i - 1);\n }\n else if (i > j) {\n return n * j - (j * (j + 1) / 2) + (i - j - 1);\n }\n else{\n return 0;\n }\n }", "private int hashFunc2(String word) {\n int hashVal = word.hashCode();\n hashVal = hashVal % arraySize;\n\n if (hashVal < 0) {\n hashVal += arraySize;\n }\n\n // Research shows that you can use a Prime number Less than the array size to calculate the step value.\n // Prime Number 3 arbitrarily chosen.\n return 3 - hashVal % 3;\n }", "public List<List<Integer>> threeSum2(int[] nums) {\n Arrays.sort(nums);\n\n List<List<Integer>> result = new ArrayList<>();\n for (int i = 0; i < nums.length - 2; i++) {\n if (i > 0 && nums[i - 1] == nums[i]) { // Common trick to bypass duplicate. Better than a nested while loop!\n continue; // But it's quite annoying to bypass in nested loop. eg.[-2,0,0,2,2]\n }\n int target = 0 - nums[i];\n int left = i + 1, right = nums.length - 1;\n while (left < right) {\n if (nums[left] + nums[right] < target || (left > i + 1 && nums[left - 1] == nums[left])) {\n left++;\n } else if (nums[left] + nums[right] > target || (right < nums.length - 1 && nums[right] == nums[right + 1])) {\n right--;\n } else {\n result.add(Arrays.asList(nums[i], nums[left], nums[right]));\n left++;\n right--;\n }\n }\n }\n return result;\n }", "private static void get4ElementsSumCountFastest(String inputLine, int target) {\n String[] arr = inputLine.split(\" \");\n if (arr.length < 3) {\n System.out.println(0);\n return;\n }\n\n Map<Integer, Set<String>> pairSumMap = new HashMap<>();\n List<Integer> list = new ArrayList<>(arr.length);\n for (String s : arr) {\n list.add(Integer.parseInt(s.trim()));\n }\n\n int sum = 0, diff = 0;\n for (int i = 0; i < arr.length; i++) {\n for (int j = i + 1; j < arr.length; j++) {\n sum = list.get(i) + list.get(j);\n if (sum < target) {\n pairSumMap.putIfAbsent(sum, new HashSet<>());\n pairSumMap.get(sum).add(i + \"-\" + j);\n }\n }\n }\n\n for (Map.Entry<Integer, Set<String>> mk : pairSumMap.entrySet()) {\n diff = target - mk.getKey();\n if (pairSumMap.containsKey(diff)) {\n Set<String> indexesList = mk.getValue();\n for (String index : indexesList) {\n int indexOrgX = Integer.parseInt(index.split(\"-\")[0]);\n int indexOrgY = Integer.parseInt(index.split(\"-\")[1]);\n for (String newIdx : pairSumMap.get(diff)) {\n int indexNewX = Integer.parseInt(newIdx.split(\"-\")[0]);\n int indexNewY = Integer.parseInt(newIdx.split(\"-\")[1]);\n if (indexOrgX != indexNewX && indexOrgX != indexNewY && indexOrgY != indexNewX && indexOrgY != indexNewY) {\n System.out.println(1);\n return;\n }\n }\n }\n }\n }\n System.out.println(0);\n }", "public void sum2(int n){\n int sum =0; //1\n for (int j = 0; j < n; j++) //2n+2\n for (int k = 0; k < n; k++) //2n+2\n sum += k + j; //1\n for (int l = 0; l < n; l++) //2n+2\n sum += l; //1\n }", "public static long journeyToMoon(int n, List<List<Integer>> astronaut) {\n // Write your code here\n Map<Integer, Node<Integer>> countryMap = new HashMap<>();\n for(List<Integer> pairs: astronaut) {\n Node<Integer> node1 = countryMap.computeIfAbsent(pairs.get(0), Node::new);\n Node<Integer> node2 = countryMap.computeIfAbsent(pairs.get(1), Node::new);\n node1.connected.add(node2);\n node2.connected.add(node1);\n }\n\n List<Integer> countryCluster = new ArrayList<>();\n for(Node<Integer> node: countryMap.values()) {\n if(node.connected.size() == 0) {\n countryCluster.add(1);\n } else if(!node.visited){\n countryCluster.add(getNodeCount3(node));\n }\n }\n List<Integer> countryNodes = countryMap.values().stream().map(nn -> nn.value).collect(Collectors.toList());\n List<Integer> missingNodes = new ArrayList<>();\n for(int i=0; i < n; i++) {\n if(!countryNodes.contains(i))\n missingNodes.add(i);\n }\n\n for(int i=0; i < missingNodes.size(); i++) {\n countryCluster.add(1);\n }\n\n long ans = 0;\n //For one country we cannot pair with any other astronauts\n if(countryCluster.size() >= 2) {\n ans = (long) countryCluster.get(0) * countryCluster.get(1);\n if(countryCluster.size() > 2) {\n int sum = countryCluster.get(0) + countryCluster.get(1);\n for(int i=2; i < countryCluster.size(); i++) {\n ans += (long) sum * countryCluster.get(i);\n sum += countryCluster.get(i);\n }\n }\n }\n\n /*\n permutation of two set with size A and B = AxB\n permutation of three set with size A,B,C = AxB + AxC + BxC = AxB + (A+B)xC\n permutation of four set with size A,B,C,D = AxB + AxC + AxD + BxC + BxD + CxD = AxB + (A+B)xC + (A+B+C)xD\n */\n /*\n if(keys.length == 1) {\n ans = keys[0].size();\n } else {\n ans = keys[0].size() * keys[1].size();\n if(keys.length > 2) {\n int sum = keys[0].size() + keys[1].size();\n for (int i = 2; i < keys.length; i++) {\n ans += sum * keys[i].size();\n sum += keys[i].size();\n }\n }\n }\n */\n return ans;\n }", "public List<List<Integer>> threeSum(int[] nums) {\n List<List<Integer>> res = new ArrayList<>();\n Arrays.sort(nums);\n for (int i = 0; i < nums.length - 2; i++) {\n if (nums[i] > 0) break;\n if (i > 0 && nums[i] == nums[i - 1]) {\n continue;\n }\n int low = i + 1;\n int high = nums.length - 1;\n int sum = -nums[i];\n while (low < high) {\n if (nums[low] + nums[high] == sum) {\n res.add(Arrays.asList(nums[i], nums[low], nums[high]));\n while (low < high && nums[low] == nums[low + 1]) low++;\n low++;\n while (low < high && nums[high] == nums[high - 1]) high--;\n high--;\n } else if (nums[low] + nums[high] > sum) {\n while (low < high && nums[high] == nums[high - 1]) high--;\n high--;\n } else {\n while (low < high && nums[low] == nums[low + 1]) low++;\n low++;\n }\n\n }\n }\n return res;\n }", "public static void main(String[] args) {\n\t\tint a[]= {15,3,7,1,9,2};\n\t\tsubarraysum(a,11);//Time complexity O(n^2) space O(1)\n\n\t\tsubarraysum_reducecomplexity(a,11,a.length); //Time complexity O(n) space O(1)\n\n\t}", "private static int[] p2(int[] ar, int n) {\n int[] p2 = new int[n];\n Arrays.fill(p2, n);\n Stack<Integer> st = new Stack<>();\n for (int i = 0; i < n; i++) {\n while (st.size() != 0 && ar[i] < ar[st.peek()]) {\n p2[st.peek()] = i;\n st.pop();\n }\n st.push(i);\n }\n return p2;\n }", "public static void main(String args[] ) throws Exception {\n Scanner scanner = new Scanner(System.in);\n int n = scanner.nextInt();\n int[] seqArray = new int[n];\n for (int i = 0; i < n; i++) {\n seqArray[i] = scanner.nextInt();\n }\n // getSeqValue(seqArray); //this method is an accepted one on Hackerrank but time complexity is not order n; i.e. !O(n);\n getLinearOrderY(seqArray); // trying to get O(n) time complexity;\n }", "public static int wayToArrange3N(int n) {\n\t\treturn 0;\n\t}", "public static int f5(int N) { \n int x = 0;\n // log(n)\n for(int i = N; i > 0; i = i/2)\n // O(n) + O(n/2) + O(n/4)\n x += f1(i);\n \n return x; \n \n }", "private boolean kcss(int[] i, long[] e, long y) {\n int I = i.length;\n long[] x = new long[I];\n while (true) {\n x[0] = ll(i[0]); // 1\n snapshot(i, 1, I, x); // 2\n if (Arrays.compare(x, e) != 0) { // 3\n sc(i[0], x[0]); // 3a\n return false; // 3a\n }\n if (sc(i[0], y)) return true; // 3b\n } // 3c\n }", "static int beautifulTriplets(int d, int[] arr) {\n int result = 0;\n\n for (int i = 0; i < arr.length; i++) {\n int prev = arr[i];\n int arrCount = 1;\n\n for (int j = i+1; j < arr.length; j++) {\n if (prev + d == arr[j]) {\n arrCount++;\n prev = arr[j];\n if (arrCount == 3) {\n result++;\n break;\n }\n }\n }\n }\n\n return result;\n }", "private static void task3(int nUMS, BinarySearchTree<Integer> t) {\n\t\t\n\t\t long start = System.nanoTime();\n\t\t System.out.println( \"Deletion in the table...\" );\n\t\t int count=0;\n\t\t\tfor( int i = 1; i <= nUMS; i++)\n\t\t\t{\n\t\t\t\tif(t.isEmpty() == false)\n\t\t\t\t{\n\t\t\t\t\n\t\t\t\tt.remove(i);\n\t\t\t\t\n\t\t\t\t}\n//\t\t\t\tSystem.out.println(GenerateInt.generateNumber());\n\n\t\t\t}\n\t\t\tSystem.out.println(\"Total Size \" + count);\n\t\t\tSystem.out.println(\"Is it empty \" + t.isEmpty());\n\t\t\tlong end = System.nanoTime();;\n\t\t\tlong elapsedTime = end - start;\n\t\t\tSystem.out.println(elapsedTime + \" NanoSeconds\");\n\t\t\tSystem.out.println(\"Average Time \" + elapsedTime/nUMS);\n\t\t \n\t\t }", "public void triplet(int[] b,int n){\r\n\t\tint count=0;\r\n\t\tfor(int i=0;i<n;i++){\r\n\t\t\tfor(int j=i+1;j<n-1;j++){\r\n\t\t\t\tfor(int k=j+1;k<n-2;k++){\r\n\t\t\t\t\tif(b[i]+b[j]+b[k]==0){\r\n\t\t\t\t\t\tSystem.out.println(b[i]+\" \"+b[j]+\" \"+b[k]);\r\n\t\t\t\t\t\tcount++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"no of distinct triplet is:\"+count);\t\r\n\r\n\t}", "static long arrayManipulation(int n, int[][] queries) {\r\n long result = 0, sum = 0;\r\n long[] arr = new long[n];\r\n for(int i = 0; i < queries.length; i++){\r\n int firstIndex = queries[i][0] - 1;\r\n int lastIndex = queries[i][1] - 1;\r\n long numberToAdd = queries[i][2];\r\n arr[firstIndex] += numberToAdd;\r\n if (lastIndex+1 < n)\r\n arr[lastIndex+1] -= numberToAdd;\r\n }\r\n\r\n for(long l : arr){\r\n sum += l;\r\n if(sum > result)\r\n result = sum;\r\n }\r\n\r\n return result;\r\n }", "public static int solveEfficient(int n) {\n if (n == 0 || n == 1)\n return 1;\n\n int n1 = 1;\n int n2 = 1;\n int sum = 0;\n\n for (int i = 2; i <= n; i++) {\n sum = n1 + n2;\n n1 = n2;\n n2 = sum;\n }\n return sum;\n }", "private static int maxSubSumN3(int[] a) {\n int maxSum = 0;\n\n for (int first = 0; first < a.length; first++) {\n for (int last = first; last < a.length; last++) {\n int thisSum = 0;\n\n for (int i = first; i <= last; i++)\n thisSum += a[i];\n\n if (thisSum > maxSum) {\n maxSum = thisSum;\n }\n }\n }\n\n return maxSum;\n }", "static int[] find2(int a[]){\r\n int sum = a[0];\r\n int pro = a[0];\r\n for(int i=1;i<a.length;i++){\r\n sum += a[i];\r\n pro += a[i]*a[i];\r\n }\r\n int s = (n*(n+1))/2 - sum;\r\n int p = (n*(n+1)*(2*n+1))/6 - pro;\r\n return solveSP(s, p);\r\n }", "public List<List<Integer>> threeSum(int[] nums) {\n List<List<Integer>> ans = new ArrayList<>();\n Arrays.sort(nums);\n for (int i = 0; i < nums.length - 2; i++) {\n if (i == 0 || (i > 0 && nums[i] != nums[i - 1])) {\n // find 2sum equals to 0 - first\n int lo = i + 1, hi = nums.length - 1, twoSum = 0 - nums[i];\n while (lo < hi) {\n if (nums[lo] + nums[hi] == twoSum) {\n ans.add(Arrays.asList(nums[i], nums[lo], nums[hi]));\n while (lo < hi && nums[lo] == nums[lo + 1]) lo++;\n while (lo < hi && nums[hi] == nums[hi - 1]) hi--;\n lo++;hi--;\n } else if (nums[lo] + nums[hi] < twoSum) {\n lo++;\n } else {\n hi--;\n }\n }\n }\n }\n return ans;\n }", "public static void main(String[] args) {\n int a[] = {12,11,10,5,6,2,30};\n // smaller greater approach with 3 passes can be used to find total number of triplet subsequences in array \n int smaller[] = new int[a.length];\n int greater[] = new int[a.length];\n \n for(int i=0;i<a.length;i++) {\n smaller[i] = greater[i] = -1;\n }\n // smaller fill up\n int min = a[0];\n for(int i=1;i<a.length;i++) {\n if (a[i] > min) {\n smaller[i] = 1;\n } else if ( a[i] < min) {\n min = a[i];\n }\n }\n \n int max = a[a.length-1];\n for(int i=a.length-2;i>=0;i--) {\n if (a[i] < max) {\n greater[i] = 1;\n } else if ( a[i] > max) {\n max = a[i];\n }\n }\n \n for(int i=1;i<a.length-1;i++) {\n if (smaller[i] == greater[i] && greater[i] == 1) {\n System.out.println(\"Triplet found, mid is at -> \" + i + \" : \" + a[i]);\n }\n }\n System.out.println(\"Do we have increasing triplet ?? \" + increasingTripletOnePass(a));\n }", "private int gameV(int i, int j, int x) {\n int count = 2;\n for (int ii = 0; ii < i; ii++) {\n for (int jj = ii + 1; jj < n; jj++) {\n if (ii != x && jj != x) count++;\n }\n }\n for (int jj = i + 1; jj < j; jj++) {\n if (jj != x) count++;\n }\n return count;\n }", "public static int tripleStep(int n) {\n int[] steps = {1,2,3};\n int[] count = new int[n+1];\n\n for(int i=1; i<=n; i++) {\n for(int j=0; j<steps.length; j++) {\n if(i-j == 0) {\n count[i]++;\n }\n if(i-j > 0) {\n count[i] += count[i-j];\n }\n }\n }\n return count[n];\n }", "public int arrangeCoinsApprach3(int n) {\n long nLong = (long)n;\n \n long st = 0;\n long ed = nLong;\n \n long mid = 0;\n \n while (st <= ed){\n mid = st + (ed - st) / 2;\n \n if (mid * (mid + 1) <= 2 * nLong){\n st = mid + 1;\n }else{\n ed = mid - 1;\n }\n }\n \n return (int)(st - 1);\n }", "private static int betterSolution(int n) {\n return n*n*n;\n }", "private int getIndex2(int val){\n return val/bucket;\n }", "public static void process(int n){\n\t\tint right, left, i;\n\n\t\tright = i = 0;\n\t\twhile(i < n){\n\t\t\twhile (right < n && c[i] == c[right]) right++;\n\t\t\tfor(int j = i; j < right; ++j) max_right[j] = right;\n\t\t\ti = right;\n\t\t}\n\n\t\tleft = i = n-1;\n\t\twhile(i >= 0){\n\t\t\twhile (left >= 0 && c[i] == c[left]) left--;\n\t\t\tfor (int j = i; j > left; --j) max_left[j] = left;\n\t\t\ti = left;\n\t\t}\n\t}", "public int[] twoSum3(int[] nums, int target) {\n int[] res = new int[2];\n int n = nums.length;\n Map<Integer, Integer> map = new HashMap<>();\n for (int i = 0; i < n; i++) {\n int key = target - nums[i];\n if (map.containsKey(key) && map.get(key) != i) {\n res[0] = map.get(key);\n res[1] = i;\n return res;\n }\n map.put(nums[i], i);\n }\n return res;\n }", "public ArrayList<ArrayList<Integer>> threeSum(int[] num) {\n // Start typing your Java solution below\n // DO NOT write main() function\n\n // A three pointer solution\n ArrayList<ArrayList<Integer>> res = new ArrayList<ArrayList<Integer>>();\n if (num.length < 3) return res;\n Arrays.sort(num);\n HashSet hashSet = new HashSet();\n\n for (int i = 0; i < num.length - 2; i++) {\n int leftP = i + 1;\n int rightP = num.length - 1;\n\n while (leftP < rightP) {\n if (num[i] + num[leftP] + num[rightP] > 0) rightP--;\n else if (num[i] + num[leftP] + num[rightP] < 0) leftP++;\n else {\n ArrayList<Integer> temp = new ArrayList<Integer>();\n temp.add(num[i]);\n temp.add(num[leftP]);\n temp.add(num[rightP]);\n if (hashSet.add(temp)) res.add(temp);\n rightP--;\n leftP++;\n }\n }\n }\n return res;\n }", "private static int lucas_cost(int n, double v) {\r\n\t\tint c, d, e, r;\r\n\r\n\t\td = n;\r\n\t\tr = (int) ((double) d / v + 0.5);\r\n\t\tif (r >= n)\r\n\t\t\treturn (ADD * n);\r\n\t\td = n - r;\r\n\t\te = 2 * r - n;\r\n\t\tc = DUP + ADD; /* initial duplicate and final addition */\r\n\t\twhile (d != e) {\r\n\t\t\tif (d < e) {\r\n\t\t\t\tr = d;\r\n\t\t\t\td = e;\r\n\t\t\t\te = r;\r\n\t\t\t}\r\n\t\t\tif (4 * d <= 5 * e && ((d + e) % 3) == 0) { /* condition 1 */\r\n\t\t\t\tr = (2 * d - e) / 3;\r\n\t\t\t\te = (2 * e - d) / 3;\r\n\t\t\t\td = r;\r\n\t\t\t\tc += 3 * ADD; /* 3 additions */\r\n\t\t\t} else if (4 * d <= 5 * e && (d - e) % 6 == 0) { /* condition 2 */\r\n\t\t\t\td = (d - e) / 2;\r\n\t\t\t\tc += ADD + DUP; /* one addition, one duplicate */\r\n\t\t\t} else if (d <= (4 * e)) { /* condition 3 */\r\n\t\t\t\td -= e;\r\n\t\t\t\tc += ADD; /* one addition */\r\n\t\t\t} else if ((d + e) % 2 == 0) { /* condition 4 */\r\n\t\t\t\td = (d - e) / 2;\r\n\t\t\t\tc += ADD + DUP; /* one addition, one duplicate */\r\n\t\t\t} else if (d % 2 == 0) { /* condition 5 */\r\n\t\t\t\td /= 2;\r\n\t\t\t\tc += ADD + DUP; /* one addition, one duplicate */\r\n\t\t\t} else if (d % 3 == 0) { /* condition 6 */\r\n\t\t\t\td = d / 3 - e;\r\n\t\t\t\tc += 3 * ADD + DUP; /* three additions, one duplicate */\r\n\t\t\t} else if ((d + e) % 3 == 0) { /* condition 7 */\r\n\t\t\t\td = (d - 2 * e) / 3;\r\n\t\t\t\tc += 3 * ADD + DUP; /* three additions, one duplicate */\r\n\t\t\t} else if ((d - e) % 3 == 0) { /* condition 8 */\r\n\t\t\t\td = (d - e) / 3;\r\n\t\t\t\tc += 3 * ADD + DUP; /* three additions, one duplicate */\r\n\t\t\t} else if (e % 2 == 0) { /* condition 9 */\r\n\t\t\t\te /= 2;\r\n\t\t\t\tc += ADD + DUP; /* one addition, one duplicate */\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn (c);\r\n\t}", "int minOperations(int[] arr) {\n // Write your code here\n Set<String> set = new HashSet<>();//store visited string\n Queue<String> queue = new LinkedList<>(); // store next strs\n int counter = 0;\n\n queue.offer(getKey(arr));\n set.add(getKey(arr));\n\n while (!queue.isEmpty()) {\n int size = queue.size();\n List<String> curs = new ArrayList<>();\n while (size > 0) {\n curs.add(queue.poll());\n size--;\n }\n\n for(String cur : curs) {\n if (isIncreasing(cur)) {\n return counter;\n }\n\n for(int i = 0; i < cur.length(); i++) {\n String next = reverseString(cur, i);\n if (!set.contains(next)) {\n set.add(next);\n queue.offer(next);\n }\n }\n }\n\n counter++;\n }\n\n return counter;\n }", "private int m3423z(int i, int i2) {\n int i3;\n int i4;\n for (int size = this.f4373c.size() - 1; size >= 0; size--) {\n C0933b bVar = this.f4373c.get(size);\n int i5 = bVar.f4379a;\n if (i5 == 8) {\n int i6 = bVar.f4380b;\n int i7 = bVar.f4382d;\n if (i6 < i7) {\n i4 = i6;\n i3 = i7;\n } else {\n i3 = i6;\n i4 = i7;\n }\n if (i < i4 || i > i3) {\n if (i < i6) {\n if (i2 == 1) {\n bVar.f4380b = i6 + 1;\n bVar.f4382d = i7 + 1;\n } else if (i2 == 2) {\n bVar.f4380b = i6 - 1;\n bVar.f4382d = i7 - 1;\n }\n }\n } else if (i4 == i6) {\n if (i2 == 1) {\n bVar.f4382d = i7 + 1;\n } else if (i2 == 2) {\n bVar.f4382d = i7 - 1;\n }\n i++;\n } else {\n if (i2 == 1) {\n bVar.f4380b = i6 + 1;\n } else if (i2 == 2) {\n bVar.f4380b = i6 - 1;\n }\n i--;\n }\n } else {\n int i8 = bVar.f4380b;\n if (i8 <= i) {\n if (i5 == 1) {\n i -= bVar.f4382d;\n } else if (i5 == 2) {\n i += bVar.f4382d;\n }\n } else if (i2 == 1) {\n bVar.f4380b = i8 + 1;\n } else if (i2 == 2) {\n bVar.f4380b = i8 - 1;\n }\n }\n }\n for (int size2 = this.f4373c.size() - 1; size2 >= 0; size2--) {\n C0933b bVar2 = this.f4373c.get(size2);\n if (bVar2.f4379a == 8) {\n int i9 = bVar2.f4382d;\n if (i9 == bVar2.f4380b || i9 < 0) {\n this.f4373c.remove(size2);\n mo7620a(bVar2);\n }\n } else if (bVar2.f4382d <= 0) {\n this.f4373c.remove(size2);\n mo7620a(bVar2);\n }\n }\n return i;\n }", "public static int[] decomposeToBECC(int[][] g) {\n// this part of code is taken from uwi submissions\n int n = g.length;\n boolean[] visited = new boolean[n];\n int[] ord = new int[n];\n int[] low = new int[n];\n\n int[] ids = new int[n];\n int[] inds = new int[n];\n int[] parct = new int[n];\n int pos = 0;\n for (int i = 0; i < n; i++) {\n if (!visited[i]) {\n ids[0] = i;\n inds[0] = 0;\n int sp = 1;\n while (sp > 0) {\n int cur = ids[sp - 1];\n if (inds[sp - 1] == 0) {\n visited[cur] = true;\n ord[cur] = low[cur] = pos++;\n parct[sp - 1] = 0;\n }\n if (inds[sp - 1] == g[cur].length) {\n if (sp - 2 >= 0) {\n low[ids[sp - 2]] = Math.min(low[ids[sp - 2]], low[cur]);\n }\n sp--;\n continue;\n }\n int next = g[cur][inds[sp - 1]];\n if (!visited[next]) {\n ids[sp] = next;\n inds[sp] = 0;\n inds[sp - 1]++;\n sp++;\n continue;\n } else if (sp - 2 >= 0 && (next != ids[sp - 2] || ++parct[sp - 1] >= 2)) {\n low[cur] = Math.min(low[cur], ord[next]);\n }\n inds[sp - 1]++;\n }\n }\n }\n\n int[] clus = new int[n];\n Arrays.fill(clus, -1);\n int[] q = new int[n];\n int cnum = 0;\n for (int i = 0; i < n; i++) {\n if (clus[i] == -1) {\n int p = 0;\n q[p++] = i;\n clus[i] = cnum++;\n for (int r = 0; r < p; r++) {\n int cur = q[r];\n for (int next : g[cur]) {\n if (clus[next] == -1) {\n clus[next] = ord[cur] < low[next] ? cnum++ : clus[cur];\n q[p++] = next;\n }\n }\n }\n }\n }\n return clus;\n }", "@Test\n\tpublic void intersection() {\n\n\t\tlong n = 105;\n\t\tlong m = 100;\n\t\tfor(long i = n - 1; i > 1; i--){\n\t\t\tn = n * i;\n\t\t\tfor(long j = getZero(n); j > 0; j--){\n\t\t\t\tm = m * 10;\n\t\t\t}\n\t\t\tn = n % m;\n\t\t\tm = 100;\n\n\t\t\tSystem.out.println(n+\" \"+i);\n\n\t\t}\n\n\n\n\n\n\t}", "private int d(amj paramamj)\r\n/* 50: */ {\r\n/* 51: 70 */ for (int i = 0; i < this.a.length; i++) {\r\n/* 52: 71 */ if ((this.a[i] != null) && (this.a[i].b() == paramamj.b()) && (this.a[i].d()) && (this.a[i].b < this.a[i].c()) && (this.a[i].b < p_()) && ((!this.a[i].f()) || (this.a[i].i() == paramamj.i())) && (amj.a(this.a[i], paramamj))) {\r\n/* 53: 72 */ return i;\r\n/* 54: */ }\r\n/* 55: */ }\r\n/* 56: 75 */ return -1;\r\n/* 57: */ }", "static int countWaysUtil(int n, int m) \n\t { \n\t int res[] = new int[n]; \n\t res[0] = 1; res[1] = 1; \n\t for (int i=2; i<n; i++) \n\t { \n\t res[i] = 0; \n\t for (int j=1; j<=m && j<=i; j++) \n\t res[i] += res[i-j]; \n\t } \n\t return res[n-1]; \n\t }", "private static int solution2(String s) {\r\n int n = s.length();\r\n int ans = 0;\r\n for (int i = 0; i < n; i++)\r\n for (int j = i + 1; j <= n; j++)\r\n if (allUnique(s, i, j)) ans = Math.max(ans, j - i);\r\n return ans;\r\n }", "static void minimumBribes(int[] q) {\nint count =0;\nboolean isprint = true;\nint first = 1;\nint second = 2;\nint third = 3;\n\n for(int i=0;i< q.length-1;i++){\n \n if (q[i] == first) {\n first = second;\n second = third;\n third++;\n }else if(q[i]== second){\n second = third;\n third++;\n count++;\n }else if(q[i]==third){\n third++;\n count++;\n count++;\n }else{\n isprint = false;\n }\n }\n\n // if((q[i-1]-q[i]) > 2){\n // System.out.println(\"Too chaotic\");\n // isprint = false;\n // break; \n // }else if((q[i-1]-q[i])==1){\n // count++;\n // }else if((q[i-1]-q[i])==2){\n // count+=2;\n // }\n \n //}\n if(isprint){\n System.out.println(count);\n }else{\n System.out.println(\"Too chaotic\");\n }\n }", "private static void third(int[] arr, int sum){\n\n Arrays.sort(arr);\n\n int i =0;\n int j = arr.length-1;\n\n while( i<j ){\n\n int curr = arr[i] + arr[j];\n\n if(curr == sum){\n System.out.println(arr[i] + \" \" + arr[j]);\n break;\n }\n else if(curr < sum){\n i++;\n }\n else{\n j--;\n }\n }\n\n }", "public int climbStairs3(int n){\n if(n==1) return 1;\n int[] dp=new int[n+1];\n dp[1]=1;\n dp[2]=2;\n for(int i=3;i<=n;i++){\n dp[i]=dp[i-1]+dp[i-2];\n }\n return dp[n];\n }", "int query(int l, int r) {\n l += n;\n r += n;\n int resl = identity;\n int resr = identity;\n while (l < r) {\n if ((l & 1) > 0) resl = combine(resl, st[l++]);\n if ((r & 1) > 0) resr = combine(st[--r], resr);\n l /= 2;\n r /= 2;\n }\n return combine(resl, resr);\n }", "private static int solution3(String s) {\r\n int n = s.length();\r\n Set<Character> set = new HashSet<>();\r\n int ans = 0, i = 0, j = 0;\r\n while (i < n && j < n) {\r\n if (!set.contains(s.charAt(j))) {\r\n set.add(s.charAt(j++));\r\n ans = Math.max(ans, j - i);\r\n } else {\r\n set.remove(s.charAt(i++));\r\n }\r\n }\r\n return ans;\r\n }", "public boolean linearIn(int[] outer, int[] inner) {\r\n int comp=0; // O(1)\r\n int count=0; // O(1)\r\n if(inner.length==0) // O(1)\r\n return true; // O(1)\r\n for(int i=0; i<outer.length; i++) { // O(n)\r\n if(outer[i]==inner[count]) { // O(1)\r\n comp++; // O(1)\r\n count++; // O(1)\r\n } else if(outer[i]>inner[count]) // O(1)\r\n return false; // O(1)\r\n if (comp==inner.length) // O(1)\r\n return true; // O(1)\r\n }\r\n return false; // O(1)\r\n}", "private void go(int i) {\n\t\tcol[i] = 1;\r\n\t\tint j = f[i];\r\n\t\tint cnt = 0;\r\n\t\tint delAll = 0;\r\n\t\tint[][] cd = new int[1000][3];\r\n\t\tint sa = 0;\r\n\t\tint sb = 0;\r\n\t\tint m1 = Integer.MAX_VALUE;\r\n\t\tint m2 = Integer.MAX_VALUE;\r\n\t\tint m1a = 0;\r\n\t\tint m2a = 0;\r\n\t\tint m1b = 0;\r\n\t\tint m2b = 0;\r\n\t\twhile (j != -1) {\r\n\t\t\tif (col[e[j]] == 0) {\r\n\t\t\t\tgo(e[j]);\r\n\t\t\t\tdelAll += a[e[j]];\r\n\t\t\t\tint dif = b[e[j]] - a[e[j]];\r\n\t\t\t\tif (dif < m1) {\r\n\t\t\t\t\tm2 = m1;\r\n\t\t\t\t\tm2b = m1b;\r\n\t\t\t\t\tm2a = m1a;\r\n\t\t\t\t\tm1 = dif;\r\n\t\t\t\t\tm1a = a[e[j]];\r\n\t\t\t\t\tm1b = b[e[j]];\r\n\t\t\t\t} else if (dif < m2) {\r\n\t\t\t\t\tm2 = dif;\r\n\t\t\t\t\tm2a = a[e[j]];\r\n\t\t\t\t\tm2b = b[e[j]];\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tsa += a[e[j]];\r\n\t\t\t\tsb += a[e[j]];\r\n\t\t\t\tcd[cnt][0] = a[e[j]];\r\n\t\t\t\tcd[cnt][1] = b[e[j]];\r\n\t\t\t\tcd[cnt][2] = b[e[j]] - a[e[j]];\r\n\t\t\t\tcnt++;\r\n\t\t\t}\r\n\t\t\tj = next[j];\r\n\t\t}\r\n\t\tif (cnt == 0) {\r\n\t\t\ta[i] = 1;\r\n\t\t\tb[i] = 0;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tArrays.sort(cd, new Comparator<int[]>() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic int compare(int[] o1, int[] o2) {\r\n\t\t\t\t// TODO Auto-generated method stub\t\t\t\t\r\n\t\t\t\treturn o1[2] - o2[2];\r\n\t\t\t}\r\n\t\t});\r\n\t\ta[i] = delAll + 1;\r\n\t\t//leave 0 or 2\r\n\t\tint cost1 = 0;\r\n\t\tint cost = 0;\r\n\t\tfor (j = 2; j < cnt; j++)\r\n\t\t\tcost1 += cd[j][0];\r\n\t\tif (cnt >= 2) {\r\n\t\t\tcost += m1b + m2b + sa - m1a - m2a;\r\n\t\t\tcost1 += cd[0][1] + cd[1][1];\r\n\t\t} else {\r\n\t\t\tcost += sa;\r\n\t\t\tcost1 += cd[0][0];\r\n\t\t}\r\n\t\tif (cost1 != cost)\r\n\t\t\tSystem.err.println(\"FUCK\");\r\n\t\tb[i] = cost;\r\n\t}", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\r\n\t\tint n = sc.nextInt();\r\n\t\tint[] a = new int[n];\r\n\t\tfor(int i = 0; i < n; i++){\r\n\t\t\ta[i] = sc.nextInt();\r\n\t\t}\r\n\t\tint res = 0, p = 0, t = 0;\r\n\t\twhile(true){\r\n\t\t\tp = 0; t = 0;\r\n\t\t\tfor(int i = 0; i < a.length; i++){\r\n\t\t\t\t\r\n\t\t\t\tif(i == a.length-1){\r\n\t\t\t\t\ta[i] /= 2;\r\n\t\t\t\t\tt = a[i];\r\n\t\t\t\t\ta[i] += p;\r\n\t\t\t\t\tp = t;\r\n\t\t\t\t\ta[0] += p;\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\ta[i] /= 2;\r\n\t\t\t\t\tt = a[i];\r\n\t\t\t\t\ta[i] += p;\r\n\t\t\t\t\tp = t;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tboolean flag = true;\r\n\t\t\tint temp = a[0];\r\n\t\t\tfor(int j = 1; j < a.length; j++){\r\n\t\t\t\tif(a[j] != temp){\r\n\t\t\t\t\tflag = false;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(flag){\r\n\t\t\t\tSystem.out.println(res);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tfor(int j = 0; j < a.length; j++){\r\n\t\t\t\tif(a[j] % 2 != 0){\r\n\t\t\t\t\ta[j] += 1;\r\n\t\t\t\t\tres++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private static int distance(ArrayList<Integer>[] adj, ArrayList<Integer>[] cost, int s, int t) {\n\n Set<Integer> visited = new HashSet<>(); //option 1\n Map<Integer, Integer> distance = new HashMap<>();\n// Queue<Integer> q = new PriorityQueue<>(11, (o1, o2) -> { //option 0\n// Integer d1 = distance.get(o1); //option 0\n// Integer d2 = distance.get(o2); //option 0\n Queue<Map.Entry<Integer, Integer>> q = new PriorityQueue<>(11, (o1, o2) -> { //option 1\n Integer d1 = o1.getValue(); //option 1\n Integer d2 = o2.getValue(); //option 1\n\n if (Objects.equals(d1, d2)) return 0;\n if (d1 == null) return 1;\n if (d2 == null) return -1;\n\n return d1 - d2;\n });\n\n distance.put(s, 0);\n// q.addAll(IntStream.range(0, adj.length).boxed().collect(Collectors.toList())); //option 0\n q.add(new AbstractMap.SimpleImmutableEntry<>(s, 0)); //option 1\n\n while (!q.isEmpty()) {\n// int u = q.remove(); //option 0\n int u = q.remove().getKey(); //option 1\n\n if (u == t) {\n Integer dist = distance.get(u);\n if (dist == null) return -1;\n return dist;\n }\n\n if (visited.contains(u)) continue; //option 1\n visited.add(u); //option 1\n\n List<Integer> adjList = adj[u];\n List<Integer> costList = cost[u];\n for (int i = 0; i < adjList.size(); i++) {\n int v = adjList.get(i);\n int w = costList.get(i);\n Integer dist = distance.get(v);\n Integer newDist = distance.get(u);\n if (newDist != null) newDist += w;\n\n if (newDist != null && (dist == null || dist > newDist)) {\n //relax\n distance.put(v, newDist);\n// q.remove(v); //option 0\n// q.add(v); //option 0\n q.add(new AbstractMap.SimpleImmutableEntry<>(v, distance.get(v))); //option 1\n }\n }\n }\n\n return -1;\n }", "private int bepaalByes(int[] arr, int n) {\r\n\t\tint tot = 0;\r\n\t\tfor (int v : arr)\r\n\t\t\ttot += v;\r\n\t\treturn (tot - n);\r\n\t}", "public static void fourSum(int[] data){\n HashMap<Integer,Pair> set = new HashMap<>();//integer = sum, pair are the nums\n for(int i = 0; i < data.length; i++)\n for(int j = i+1; j < data.length; j++) {\n Pair check = set.get(i+j);\n if(check != null) {\n System.out.println(\"fauifa\");\n return;\n }\n set.put(check.a()+check.b(), check);\n }\n System.out.println(\"None found.\");\n }", "static long findSum(int N)\n\t{\n\t\tif(N==0) return 0;\n\t\treturn (long)((N+1)>>1)*((N+1)>>1)+findSum((int)N>>1);\n\t\t\n\t}", "public List<List<Integer>> threeSum(int[] nums) {\n\n if (nums.length < 3) {\n return new ArrayList<>();\n }\n\n Arrays.sort(nums);\n\n // ex. [-1, 0, 1, 2,-1,-4] =>\n // [-4,-1,-1, 0, 1, 2]\n\n // ex. [ 3, 0,-2,-1, 1, 2] =>\n // [-2,-1, 0, 1, 2, 3]\n\n // ex. [-1, 0, 1, 2,-1,-4] =>\n // [-4,-1,-1, 0, 1, 2]\n\n List<List<Integer>> list = new ArrayList<List<Integer>>();\n\n // Loop throught the array\n for (int i = 0; i < nums.length - 2; i++) {\n\n if (i > 0 && nums[i] == nums[i - 1]) {\n continue;\n }\n\n // Index of first number\n int first = i;\n\n // Indices of second and third numbers\n int left = i + 1;\n int right = nums.length - 1;\n\n // Find nums[left] and nums[right] that add up to -firstNum\n // (Implies that the 3 numbers add up to 0)\n while (left < right) {\n int leftNum = nums[left];\n int rightNum = nums[right];\n int firstNumComplement = -nums[first];\n if (nums[left] + nums[right] == firstNumComplement) {\n List<Integer> triplet = new ArrayList<Integer>(3);\n triplet.add(nums[first]);\n triplet.add(nums[left]);\n triplet.add(nums[right]);\n list.add(triplet);\n left++;\n right--;\n while (left < right && nums[left] == leftNum) {\n left++;\n }\n while (left < right && nums[right] == rightNum) {\n right--;\n }\n } else if (nums[left] + nums[right] > firstNumComplement) {\n right--;\n } else {\n left++;\n }\n }\n }\n\n return list;\n }", "private int houseRobberWithMaxAmountHousesFromItoJInConstantSpace(int[] a, int i, int j) {\n\t\tif (null == a || i > j)\n\t\t\treturn 0;\n\n\t\tif (j - i == 0)\n\t\t\treturn a[i];\n\n\t\tint incl = a[i];\n\t\tint excl = 0, temp;\n\n\t\tfor (int k = i + 1; k <= j; k++) {\n\t\t\ttemp = incl;\n\t\t\tincl = Math.max(excl + a[k], incl);\n\t\t\texcl = temp;\n\t\t}\n\t\treturn incl;\n\t}", "public static void main(String[] args) \n {\n int[] numOfPoints = { 1000, 10000, 7000, 10000, 13000 };\n for(int count = 0; count < numOfPoints.length; count++)\n {\n List<Point> pointsTobeUsed = new ArrayList<Point>();\n int current = numOfPoints[count];\n int inc = 0;\n \n //creating list of points to be used\n for(int x = 0; x <= current; x++)\n {\n \n if(x <= current/2)\n {\n pointsTobeUsed.add(new Point(x,x));\n \n }\n else\n {\n pointsTobeUsed.add(new Point(x, x - (1 + 2*(inc)) ) );\n inc++;\n }\n }\n \n //n logn implementation of Pareto optimal\n long timeStart = System.currentTimeMillis();\n \n // n logn quicksort\n pointsTobeUsed = quickSort(pointsTobeUsed, 0, pointsTobeUsed.size() -1 );\n \n \n \n ParetoOptimal(pointsTobeUsed);\n \n \n long timeEnd = System.currentTimeMillis();\n System.out.println(\"final:\" + \" exper: \" + (timeEnd - timeStart) + \" N: \" + current ); \n }\n }", "public static int getBetterApproach(int n){\n\t\t\n\t\tint t[] = new int[n+1];\n\t\t\n if(n<=2)\n return n;\n \n\t\tt[0] = 0;\n\t\tt[1] = 1;\n\t\tt[2] = 2;\n\t\tfor(int i = 3;i<=n;i++){\n\t\t\tt[i] = t[i-1] + t[i-2];\n\t\t}\n\t\treturn t[n];\n\t}", "private static int solve(int[] arr, int length) {\n\tint i =0,j;\n\tint extremum = 0;\n\t\n\tfor(j=i;j<length;){\n\t\tif(arr[i]==arr[j]){\n\t\t\tif((j==length-1) && ((arr[j]>arr[i-1])||(arr[j]<arr[i-1])))\n\t\t\t\textremum++;\n\t\t\tj++;\n\t\t\tcontinue;\n\t\t}\n\t\t\t\n\t\telse if((i==0 && ((arr[j]>arr[i])||(arr[j]<arr[i])))){\n\t\t\textremum ++;\n\t\t}\n\t\t\t\n\t\telse if((arr[i-1]>arr[i])&&(arr[j]>arr[j-1])){\n\t\t\textremum++;\n\t\t}\n\t\t\t\n\t\telse if((arr[i-1]<arr[i])&&(arr[j]<arr[j-1])){\n extremum++;\n\t\t}\n\t\t\n\t i = j;\n\t\t\t\n\t}\n\t\n\treturn extremum;\n}", "static int solve(int n) \n\t{ \n\t // base case \n\t if (n < 0) \n\t return 0; \n\t if (n == 0) \n\t return 1; \n\t \n\t return solve(n-1) + solve(n-3) + solve(n-5); \n\t}", "public static void main(String[] args) {\nScanner s=new Scanner(System.in);\nint n=s.nextInt();\nint a[]=new int[n];\nint x=0;\nfor(int i=1;i<=n;i++)\n{\n\tif(i%2!=0)\n\t{\n\t\ta[x++]=i;\n\t}\n}\nint sum=0;\nsum=a[0];\nfor(int i=0;i<x;i++)\n{\n\tif((i+1)<x)\n\t{\n\tif(i%2==0)\n\t\tsum=sum+a[i+1];\n\telse\n\t\tsum=sum-a[i+1];\n\t}\n}\nSystem.out.println(sum);\n\t}", "public boolean containsNearbyAlmostDuplicate(int[] nums, int k, int t) {\n if (t < 0) return false;\n long sz = (long)t + 1;\n Map<Long, Long> map = new HashMap<>();\n for (int i = 0; i < nums.length; ++i) {\n long bucket = getBucket(nums[i], sz);\n if (map.containsKey(bucket)) return true;\n if (map.containsKey(bucket + 1) && Math.abs(nums[i] - map.get(bucket + 1)) < sz) return true;\n if (map.containsKey(bucket - 1) && Math.abs(nums[i] - map.get(bucket - 1)) < sz) return true;\n map.put(bucket, (long)nums[i]);\n if (i >= k) map.remove(getBucket(nums[i - k], sz));\n }\n return false;\n}", "protected static void endPartial(long[] h) {\n h[11] += h[1]; \n h[2] ^= h[11]; \n h[1] = (h[1] << 44) | (h[1] >>> 20);\n h[0] += h[2]; \n h[3] ^= h[0]; \n h[2] = (h[2] << 15) | (h[2] >>> 49);\n h[1] += h[3]; \n h[4] ^= h[1]; \n h[3] = (h[3] << 34) | (h[3] >>> 30);\n h[2] += h[4]; \n h[5] ^= h[2]; \n h[4] = (h[4] << 21) | (h[4] >>> 43);\n h[3] += h[5]; \n h[6] ^= h[3]; \n h[5] = (h[5] << 38) | (h[5] >>> 26);\n h[4] += h[6]; \n h[7] ^= h[4]; \n h[6] = (h[6] << 33) | (h[6] >>> 31);\n h[5] += h[7]; \n h[8] ^= h[5]; \n h[7] = (h[7] << 10) | (h[7] >>> 54);\n h[6] += h[8]; \n h[9] ^= h[6]; \n h[8] = (h[8] << 13) | (h[8] >>> 51);\n h[7] += h[9]; \n h[10] ^= h[7]; \n h[9] = (h[9] << 38) | (h[9] >>> 26);\n h[8] += h[10]; \n h[11] ^= h[8]; \n h[10] = (h[10] << 53) | (h[10] >>> 11);\n h[9] += h[11]; \n h[0] ^= h[9]; \n h[11] = (h[11] << 42) | (h[11] >>> 22);\n h[10] += h[0]; \n h[1] ^= h[10]; \n h[0] = (h[0] << 54) | (h[0] >>> 10);\t\t\n\t}", "public static int foo3( int n )\r\n\t{\r\n\t\tif ( n == 0 )\r\n\t\t\treturn 0;\r\n\t\telse\r\n\t\t\treturn n + foo3( n - 1 );\r\n\t\t\r\n\t}", "static public void findPossibleTrianglesCount_V1(int[] arr, int n){\n \r\n int i,j,k; //loop or index variables\r\n int nTriangles = 0;\r\n \r\n for(i=0; i<n-2; i++){\r\n for(j=i+1; j<n-1; j++){\r\n for(k=j+1; k<n; k++){\r\n if(arr[i] != arr[j] && arr[i] != arr[k] && arr[j] != arr[k]){\r\n if(arr[i]+arr[j] > arr[k] && arr[i]+arr[k] > arr[j] && arr[j]+arr[k] > arr[i] ){ //a+b > c \r\n System.out.println(arr[i] + \" , \" + arr[j] + \" , \" + arr[k]);\r\n nTriangles+=1;\r\n }\r\n } //if\r\n } //innermost for k\r\n } //inner for j\r\n } //outer for i\r\n \r\n System.out.println(\"Number of possible triangles: \" + nTriangles);\r\n }", "private int find(int p){\n while(p!=id[p]){\n p=id[p];\n eachDoUnionArrayAccessTimes+=2; //遍历读取某个元素算一次,设置值也算一次,所以加2次\n }\n eachDoUnionArrayAccessTimes++; //查询p的时候依然会读取一次\n return p;\n }", "void solve() throws IOException {\n int[] nk = ril(2);\n int n = nk[0];\n int k = nk[1];\n int[] p = ril(n);\n int[] b = ril(k);\n for (int i = 0; i < n; i++) p[i]--;\n for (int i = 0; i < k; i++) b[i]--;\n\n int[] numToIdx = new int[n];\n for (int i = 0; i < n; i++) numToIdx[p[i]] = i;\n\n boolean[] remove = new boolean[n];\n Arrays.fill(remove, true);\n for (int bi : b) remove[bi] = false;\n List<Integer> toRemove = new ArrayList<>(n - k);\n for (int i = 0; i < n; i++) if (remove[i]) toRemove.add(i);\n Collections.sort(toRemove);\n\n int[] prevSmaller = new int[n];\n prevSmaller[0] = -1;\n int prevIdx = remove[p[0]] ? -1 : 0;\n for (int i = 1; i < n; i++) {\n int j = prevIdx;\n while (j != -1 && p[i] < p[j]) j = prevSmaller[j];\n prevSmaller[i] = j;\n if (!remove[p[i]]) prevIdx = i;\n }\n int[] nextSmaller = new int[n];\n nextSmaller[n-1] = n;\n prevIdx = remove[p[n-1]] ? n : n-1;\n for (int i = n-2; i >= 0; i--) {\n int j = prevIdx;\n while (j != n && p[i] < p[j]) j = nextSmaller[j];\n nextSmaller[i] = j;\n if (!remove[p[i]]) prevIdx = i;\n }\n\n int[] init = new int[n];\n Arrays.fill(init, 1);\n SegmentTree st = new SegmentTree(init);\n long ans = 0;\n for (int x : toRemove) {\n int idx = numToIdx[x];\n int l = prevSmaller[idx] + 1;\n int r = nextSmaller[idx] - 1;\n ans += st.query(l, r+1);\n st.modify(idx, 0);\n }\n pw.println(ans);\n }", "public int f3(char[] array, int start, int end) {\n if (array.length <= 1 || end <= start) return 1;\n int mid = start + ((end - start) / 2);\n return f3(array, start, mid) + f3(array, mid + 1, end);\n }", "public int a(alq paramalq, int paramInt1, int paramInt2, fn paramfn)\r\n/* 120: */ {\r\n/* 121:137 */ int i = 0;\r\n/* 122: */ amj localamj;\r\n/* 123: */ int k;\r\n/* 124:138 */ for (int j = 0; j < this.a.length; j++)\r\n/* 125: */ {\r\n/* 126:139 */ localamj = this.a[j];\r\n/* 127:140 */ if (localamj != null) {\r\n/* 128:143 */ if ((paramalq == null) || (localamj.b() == paramalq)) {\r\n/* 129:146 */ if ((paramInt1 <= -1) || (localamj.i() == paramInt1)) {\r\n/* 130:149 */ if ((paramfn == null) || (cy.a(paramfn, localamj.o(), true)))\r\n/* 131: */ {\r\n/* 132:153 */ k = paramInt2 <= 0 ? localamj.b : Math.min(paramInt2 - i, localamj.b);\r\n/* 133:154 */ i += k;\r\n/* 134:155 */ if (paramInt2 != 0)\r\n/* 135: */ {\r\n/* 136:156 */ this.a[j].b -= k;\r\n/* 137:157 */ if (this.a[j].b == 0) {\r\n/* 138:158 */ this.a[j] = null;\r\n/* 139: */ }\r\n/* 140:160 */ if ((paramInt2 > 0) && (i >= paramInt2)) {\r\n/* 141:161 */ return i;\r\n/* 142: */ }\r\n/* 143: */ }\r\n/* 144: */ }\r\n/* 145: */ }\r\n/* 146: */ }\r\n/* 147: */ }\r\n/* 148: */ }\r\n/* 149:165 */ for (j = 0; j < this.b.length; j++)\r\n/* 150: */ {\r\n/* 151:166 */ localamj = this.b[j];\r\n/* 152:167 */ if (localamj != null) {\r\n/* 153:170 */ if ((paramalq == null) || (localamj.b() == paramalq)) {\r\n/* 154:173 */ if ((paramInt1 <= -1) || (localamj.i() == paramInt1)) {\r\n/* 155:176 */ if ((paramfn == null) || (cy.a(paramfn, localamj.o(), false)))\r\n/* 156: */ {\r\n/* 157:180 */ k = paramInt2 <= 0 ? localamj.b : Math.min(paramInt2 - i, localamj.b);\r\n/* 158:181 */ i += k;\r\n/* 159:182 */ if (paramInt2 != 0)\r\n/* 160: */ {\r\n/* 161:183 */ this.b[j].b -= k;\r\n/* 162:184 */ if (this.b[j].b == 0) {\r\n/* 163:185 */ this.b[j] = null;\r\n/* 164: */ }\r\n/* 165:187 */ if ((paramInt2 > 0) && (i >= paramInt2)) {\r\n/* 166:188 */ return i;\r\n/* 167: */ }\r\n/* 168: */ }\r\n/* 169: */ }\r\n/* 170: */ }\r\n/* 171: */ }\r\n/* 172: */ }\r\n/* 173: */ }\r\n/* 174:193 */ if (this.f != null)\r\n/* 175: */ {\r\n/* 176:194 */ if ((paramalq != null) && (this.f.b() != paramalq)) {\r\n/* 177:195 */ return i;\r\n/* 178: */ }\r\n/* 179:197 */ if ((paramInt1 > -1) && (this.f.i() != paramInt1)) {\r\n/* 180:198 */ return i;\r\n/* 181: */ }\r\n/* 182:200 */ if ((paramfn != null) && (!cy.a(paramfn, this.f.o(), false))) {\r\n/* 183:201 */ return i;\r\n/* 184: */ }\r\n/* 185:204 */ j = paramInt2 <= 0 ? this.f.b : Math.min(paramInt2 - i, this.f.b);\r\n/* 186:205 */ i += j;\r\n/* 187:206 */ if (paramInt2 != 0)\r\n/* 188: */ {\r\n/* 189:207 */ this.f.b -= j;\r\n/* 190:208 */ if (this.f.b == 0) {\r\n/* 191:209 */ this.f = null;\r\n/* 192: */ }\r\n/* 193:211 */ if ((paramInt2 > 0) && (i >= paramInt2)) {\r\n/* 194:212 */ return i;\r\n/* 195: */ }\r\n/* 196: */ }\r\n/* 197: */ }\r\n/* 198:217 */ return i;\r\n/* 199: */ }", "static long countTriplets(List<Long> arr, long r) {\n long result = 0L;\n long size = arr.size();\n\n ArrayList<long[]> duoList = new ArrayList<>();\n\n // triplet 이 될 수 있는 duo를 선발\n for (int i = 0; i < (size - 1); i++) {\n long firstItem = arr.get(i);\n\n for (int j = i + 1; j < size; j++) {\n long secondItem = arr.get(j);\n if (j >= (size - 1)) continue;\n if (secondItem / (float) firstItem == r) {\n long[] tripletAble = {i, j};\n // System.out.println(\"tripletAble : \" + Arrays.toString(tripletAble));\n if (duoList.contains(tripletAble)) {\n continue;\n } else {\n duoList.add(tripletAble);\n }\n }\n }\n }\n\n // duo인 int[] 의 두 번째 item (int[1]) 의 다음 index부터 탐색해서\n // 해당 수가 triplet이 될 수 있다면 result + 1\n // 판단 기준은 thirdItem / secondItem 이 r이 되는 경우\n int listSize = duoList.size();\n for (int k = 0; k < listSize; k++) {\n long[] targetArr = duoList.get(k);\n long secondIdx = targetArr[1];\n for (int l = (int) secondIdx + 1; l < size; l++) {\n\n long secondItem = arr.get((int) targetArr[1]);\n long thirdItem = arr.get(l);\n\n if (thirdItem / (float) secondItem == r) {\n result += 1L;\n }\n }\n }\n\n return result;\n }" ]
[ "0.64969844", "0.64588165", "0.62250316", "0.6131948", "0.60594136", "0.59865105", "0.5944839", "0.59432524", "0.5887996", "0.5870389", "0.5859284", "0.57878405", "0.5781826", "0.5779588", "0.5773686", "0.576751", "0.56769997", "0.56659925", "0.56458205", "0.5637843", "0.5590983", "0.55903727", "0.55902094", "0.5581042", "0.55787337", "0.55701005", "0.5564797", "0.55541575", "0.55375695", "0.55262905", "0.550539", "0.54780084", "0.5464475", "0.545117", "0.5442952", "0.5442672", "0.5441311", "0.54384845", "0.54348373", "0.5431648", "0.54274416", "0.5419177", "0.54139686", "0.5410306", "0.5406132", "0.5395832", "0.539256", "0.5361726", "0.53497493", "0.53231657", "0.532079", "0.53172547", "0.5316145", "0.5312581", "0.5310732", "0.53091514", "0.5301223", "0.5288326", "0.5283216", "0.5272334", "0.5266868", "0.52635837", "0.5256653", "0.5247994", "0.52461326", "0.5245772", "0.52434164", "0.52392685", "0.52391636", "0.5230516", "0.5227601", "0.52224755", "0.5216924", "0.521519", "0.5214786", "0.5213644", "0.5211949", "0.5211728", "0.5209484", "0.52090096", "0.52089226", "0.52078027", "0.52066964", "0.52052957", "0.51991504", "0.5197189", "0.51943034", "0.5192412", "0.518748", "0.51859576", "0.51826715", "0.5181607", "0.51796865", "0.517902", "0.5178719", "0.5177822", "0.5177548", "0.5176108", "0.51739275", "0.51731336", "0.51654106" ]
0.0
-1
Aid Function how much points are in the bounds//
private int NumInRangeAxis(int min, int max, Boolean axis){ int counter = 0; boolean stop = false; if (this.size==0) return 0; if (axis){ //axis x if (min>this.maxx.getData().getX() || max<this.minx.getData().getX()) stop=true; this.current=this.minx; while (!stop && this.current!=null){ if (this.current.getData().getX()>=min && this.current.getData().getX() <=max) counter++; if (this.current.getData().getX() >= max) stop=true; this.current=this.current.getNextX(); }} else { //axis y if (min>this.maxy.getData().getY() || max<this.miny.getData().getY()) stop=true; this.current=this.miny; while (!stop && this.current!=null){ if (this.current.getData().getY()>=min && this.current.getData().getY() <=max) counter++; if (this.current.getData().getY() >= max) stop=true; this.current=this.current.getNextY(); }} return counter; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getBound();", "int getBoundsX();", "int getNeedPoints();", "private double getRangeCenter(int lowerBound, int upperBound) {\n return (lowerBound + upperBound) / 2.0;\n }", "public boolean detectBound(){\n if(posX < 10){\n posX = 10;\n velX = 0;\n accX = 0;\n return true;\n }\n else if(posX > width - 10){\n posX = width - 10;\n velX = 0;\n accX = 0;\n return true;\n }\n if(posY < 10){\n posY = 10;\n velY = 0;\n accY = 0;\n return true;\n }\n else if(posY > height - 10){\n posY = height - 10;\n velY = 0;\n accY = 0;\n return true;\n }\n return false;\n }", "int getBoundsWidth();", "int getPoints();", "int getBoundsY();", "public Coords bound(final Coords point)\r\n {\r\n int xx = point.getX();\r\n int yy = point.getY();\r\n if(xx < x)\r\n {\r\n xx = x;\r\n }\r\n if(xx > x + width)\r\n {\r\n xx = x + width;\r\n }\r\n if(yy < y)\r\n {\r\n yy = y;\r\n }\r\n if(yy > y + height)\r\n {\r\n yy = y + height;\r\n }\r\n return new Coords(xx, yy);\r\n }", "boolean isBound();", "public boolean detectBound(){\n if(posX < 0 || posX > width || posY < 0 || posY > height){\n return true;\n }\n else{\n return false;\n }\n }", "Rectangle getBounds();", "public Bounds getProbabilityBounds();", "public Rectangle getBounds();", "public Rectangle getBounds();", "public Bounds getBounds () { return (bounds); }", "public int getPoints();", "RectangleLatLng getBounds();", "int getPointLength();", "private double getMarginFromBounds(int lowerBound, int upperBound) {\n return (upperBound - lowerBound) / 2.0;\n }", "public abstract int getPoints();", "public int isInBounds(T a);", "public abstract float calArea();", "public float[] getBounds() {\r\n\t\tfloat[] bounds = {x_ - width_/ 2, x_ + width_ / 2, y_ - height_ / 2, y_ + height_ / 2};\r\n\t\treturn bounds;\r\n\t}", "public void computeStoredBounds()\n {\n computeSRectangleBound();\n computeCircleBound();\n }", "public int getLowerBound ();", "public abstract Rectangle getBounds();", "public abstract Rectangle getBounds();", "public abstract Rectangle getBounds();", "int getHitpoints(Unit unit);", "public void checkBounds(Scope scope) {\n}", "int getBoundsHeight();", "@Override\n\tvoid findArea(double dim1) {\n\t\t\n\t}", "public int GetNPoints();", "boolean isIncludeBounds();", "@Override\n\tpublic Rectangle getBound() {\n\t\trectBound.setX(posX+20);\n\t\trectBound.setY(Y_LAND - image.getHeight() +10);\n\t\trectBound.setWidth(image.getWidth()-10);\n\t\trectBound.setHeight(image.getHeight());\n\t\treturn rectBound;\n\t}", "public void computeCircleBound()\n {\n this.savedCircleBound = getCircleBound();\n }", "@Override\r\n\tpublic Rectangle getBound() {\n\t\treturn new Rectangle((int)x, (int)y, (int)width, (int)height);\r\n\t}", "double area();", "int getUsedPoints();", "int getUsedPoints();", "int getUsedPoints();", "public Rectangle getPlotBounds();", "public Rect getBound() {\n return new Rect((int) (x - radius), (int) (y - radius), (int) (x + radius), (int) (y + radius));\n }", "public abstract float area();", "double area() {\nSystem.out.println(\"Inside Area for Rectangle.\");\nreturn dim1 * dim2;\n }", "int getRemainPoints();", "double area() {\nSystem.out.println(\"Inside Area for Rectangle.\");\nreturn dim1 * dim2;\n}", "double getArea();", "double getArea();", "public void computeSRectangleBound()\n {\n this.savedSRectangleBound = getSRectangleBound();\n }", "int getPointsCount();", "Float getTotalPoints();", "void addBounds(int x, int y, int width, int height);", "public InfinitNumber getBound() {\n\t\treturn mBound;\n\t}", "public Vec2 \tgetPos(){ \t\t\t\t\treturn bound.getPos();\t\t}", "public RectF getBounds()\n {\n return bounds;\n }", "private int inRange(int x, int y) {\n\t\tif (x > 3 && y > 3 && x < max_x - 3 && y < max_y - 3) {\n\t\t\treturn 1;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}", "@Test\n public void testOverboundsInside() {\n Coordinate a, b, c, d;\n a = new Coordinate2D(2, 2, 0);\n b = new Coordinate2D(3, 3, 0);\n c = new Coordinate2D(2, 0, 0);\n d = new Coordinate2D(4, 2, 0);\n\n int actual, expected;\n\n expected = 0;\n actual = hex.getDistanceOverBoundary(a);\n assertEquals(expected, actual);\n\n expected = 0;\n actual = hex.getDistanceOverBoundary(b);\n assertEquals(expected, actual);\n\n expected = 0;\n actual = hex.getDistanceOverBoundary(c);\n assertEquals(expected, actual);\n\n expected = 0;\n actual = hex.getDistanceOverBoundary(d);\n assertEquals(expected, actual);\n }", "private boolean isInBound(int current, int bound){\n return (current >= 0 && current < bound);\n }", "public double pointsEarned();", "public IRectangleBound getClipBound();", "private boolean isBetweenBounds(int x, int y, int[] bounds) {\n return x >= bounds[0] && x <= bounds[2] && y >= bounds[1] && y <= bounds[3];\n }", "abstract double area();", "abstract double area();", "abstract double area();", "abstract double area();", "double area() {\n System.out.println(\"Inside Area for Rectangle.\");\n return dim1 * dim2;\n }", "public abstract double[] getLowerBound();", "@Override\r\n\tpublic void calcArea() {\n\t\t\r\n\t}", "public double area();", "private int[] getBounds(Node node) {\n String[] boundsAttr = (((Element) node).getAttribute(\"bounds\")).replace(\"[\",\"\").split(\"[^0-9]\");\n int[] bounds = new int[boundsAttr.length];\n for (int i = 0; i < boundsAttr.length; i++) {\n bounds[i] = Integer.parseInt(boundsAttr[i]);\n }\n return bounds;\n }", "private boolean hasValidBounds() {\n\n\n\n return false;\n }", "private float signedArea()\n {\n float twiceArea = 0.0f;\n\n for (int i = 0; i < size(); i++)\n {\n PointF curr = get(i);\n PointF next = get(i + 1);\n twiceArea += curr.x * next.y - next.x * curr.y;\n }\n\n return twiceArea / 2;\n }", "@Override\n\tpublic void CheckBounds() {\n\t\t\n\t}", "void calculateRange() {\n //TODO: See Rules\n }", "public float getWidth()\n {\n return getBounds().width();\n }", "DAABBC getAABB ();", "@Override\n public int getPoints(){\n\n }", "public Rectangle bounds()\n\t{\n\t\treturn (new Rectangle(x, y, 10, 10));\n\t}", "private boolean verifyBounds() {\r\n\t if((x>RobotController.BOUNDS_X || y>RobotController.BOUNDS_Y)\r\n\t || x<0 || y<0){\r\n\t return false;\r\n\t }\r\n\t return true;\r\n\t }", "public double findArea(){\n\t\tdouble area= (0.5*(length * width));\n\t\treturn area;\n\t}", "abstract void findArea();", "abstract void findArea();", "private void showBounds(){\n\n LatLngBounds.Builder boundBuilder = new LatLngBounds.Builder();\n\n\n for (int i = 0; i < points.size(); i++) {\n LatLng b_position = new LatLng(points.get(i).getLatitude(),points.get(i).getLongitude());\n boundBuilder.include(b_position);\n }\n\n LatLngBounds bounds = boundBuilder.build();\n\n int deviceWidth = getResources().getDisplayMetrics().widthPixels;\n int deviceHeight = getResources().getDisplayMetrics().heightPixels;\n int devicePadding = (int) (deviceHeight * 0.20); // offset from edges of the map 10% of screen\n\n CameraUpdate cu = CameraUpdateFactory.newLatLngBounds(bounds, deviceWidth, deviceHeight, devicePadding);\n mMap.animateCamera(cu);\n\n }", "public double[] setMapBounds(double ulLon, double ulLat, double lrLon, double lrLat)\n/* 154: */ {\n/* 117:182 */ int x_min = 2147483647;\n/* 118:183 */ int y_min = 2147483647;\n/* 119:184 */ int x_max = -2147483648;\n/* 120:185 */ int y_max = -2147483648;\n/* 121:186 */ int mapZoomMax = 20;\n/* 122: */\n/* 123:188 */ x_max = Math.max(x_max, MercatorProj.LonToX(lrLon, mapZoomMax));\n/* 124:189 */ x_max = Math.max(x_max, MercatorProj.LonToX(ulLon, mapZoomMax));\n/* 125:190 */ y_max = Math.max(y_max, MercatorProj.LatToY(ulLat, mapZoomMax));\n/* 126:191 */ y_max = Math.max(y_max, MercatorProj.LatToY(lrLat, mapZoomMax));\n/* 127:192 */ x_min = Math.min(x_min, MercatorProj.LonToX(ulLon, mapZoomMax));\n/* 128:193 */ x_min = Math.min(x_min, MercatorProj.LonToX(lrLon, mapZoomMax));\n/* 129:194 */ y_min = Math.min(y_min, MercatorProj.LatToY(ulLat, mapZoomMax));\n/* 130:195 */ y_min = Math.min(y_min, MercatorProj.LatToY(lrLat, mapZoomMax));\n /* x_max= (int)(Math.max(ulLon,lrLon)*1000000);\n x_min= (int)(Math.min(ulLon,lrLon)*1000000);\n y_max= (int)(Math.max(ulLat,lrLat)*1000000);\n y_min= (int)(Math.min(ulLat,lrLat)*1000000);*/\n/* 134:199 */ int height = Math.max(0, this.mapPanel.getHeight());\n/* 135:200 */ int width = Math.max(0, this.mapPanel.getWidth());\n/* 136:201 */ int newZoom = mapZoomMax;\n/* 137:202 */ int x = x_max - x_min;\n/* 138:203 */ int y = y_max - y_min;\n/* 139:204 */ while ((x > width) || (y > height))\n/* 140: */ {\n/* 141:205 */ newZoom--;\n/* 142:206 */ x >>= 1;\n/* 143:207 */ y >>= 1;\n/* 144: */ }\n/* 145:209 */ x = x_min + (x_max - x_min)/2;\n/* 146:210 */ y = y_min + (y_max - y_min)/2;\n/* 147:211 */ int z = 1 << mapZoomMax - newZoom;\n/* 148:212 */ x /= z;\n/* 149:213 */ y /= z;\n /* int Cx=256;\n int Cy=256;\n //Cx>>=(newZoom);\n //Cy>>=(newZoom);\n double x1=((x*(width/2))/Cx);\n double y1=((y*(height/2))/Cy);\n x=(int) x1;\n y=(int) y1;\n x >>=(newZoom-this.mapPanel.zoom);\n y >>=(newZoom-this.mapPanel.zoom);\n //x = x+156;\n //y = y-137;*/\n x=x/10000;\n y=y/10000;\n /* 150:214 */ this.mapPanel.setZoom(new Point((int)x, (int)y), newZoom);\n double[] res = { this.mapPanel.zoom, this.mapPanel.centerX, this.mapPanel.centerY,x,y, newZoom, z };\n traceln(Arrays.toString(res));\n traceln( x_max+\",\"+x_min+\",\"+y_max+\",\"+y_min+\",x:\"+x+\",y:\"+y+\",z:\"+z+\",nZomm:\"+newZoom);\n // this.mapPanel.getBounds().getX()setBounds( (int)ulLon,(int)ulLat, (int)width,(int)height);\n return res;\n\n/* 167: */ }", "public abstract double[] getUpperBound();", "private void getArea() {\n\t\tdouble a = 0;\n\t\tint n = points.length;\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\ta += (points[i-1].x + points[i].x) * (points[i-1].y - points[i].y);\n\t\t}\n\t\t// process last segment if ring is not closed\n\t\tif (!points[0].equals(points[n-1])) {\n\t\t\ta += (points[n-1].x + points[0].x) * (points[n-1].y - points[0].y);\n\t\t}\n\t\tarea = Math.abs(a / 2);\n\t}", "double calculateArea();", "public double area(){\r\n\t\treturn this.base()*this.altezza();\r\n\t}", "@Override\r\n\tpublic void getarea(int a) {\n\t\t\r\n\t}", "double distanceSq (IPoint p);", "public int area() {\n \tarea = width()*height();\n }", "public abstract double getRangeSize();", "public abstract int positionBonus();", "public double getCircleArea();", "public Rectangle getBounds()\n {\n return new Rectangle ((int)x,(int)y,32,32);\n }", "public LatLngBounds setupBounds(){\n\t\t\n\t\t\n\t\tdouble deltaLat = 0.000015; // correction value\n\t\t\n\t\tLatLng northEast = new LatLng(60.1876397959336 + (2.4 * deltaLat), 24.8207008838576);\n\t\tLatLng southWest = new LatLng(60.1866756699501 + deltaLat, 24.8172971606177);\n\t\t\n\t\t\n\t\t// 60.1866756699501\n\t\treturn new LatLngBounds(southWest, northEast);\n\t}", "public int getPoints()\n {\n return (10000 - this.points);\n }", "public Rectangle getBounds() {\r\n return bounds;\r\n }", "public abstract float getArea();" ]
[ "0.7466469", "0.6804313", "0.66710603", "0.65437573", "0.65197855", "0.6437915", "0.64104193", "0.6403869", "0.6401772", "0.63834834", "0.63724655", "0.63149256", "0.63075733", "0.63020647", "0.63020647", "0.6240427", "0.6235785", "0.6217505", "0.6211271", "0.61762375", "0.61519355", "0.6127808", "0.61042655", "0.6103865", "0.6088691", "0.60748744", "0.6060464", "0.6060464", "0.6060464", "0.60526985", "0.6047104", "0.6001546", "0.5988649", "0.5981866", "0.59763694", "0.5958723", "0.5948235", "0.5933929", "0.5933927", "0.59124935", "0.59124935", "0.59124935", "0.5906852", "0.5900912", "0.58955365", "0.58947545", "0.58731735", "0.58677554", "0.5857453", "0.5857453", "0.5854201", "0.5840317", "0.5839849", "0.58376515", "0.5831375", "0.5827951", "0.58170515", "0.5811681", "0.5785644", "0.5764435", "0.5759696", "0.5753474", "0.5743489", "0.573563", "0.573563", "0.573563", "0.573563", "0.5732382", "0.5730769", "0.57257164", "0.5724509", "0.57157034", "0.5709155", "0.5709113", "0.5706085", "0.5702415", "0.56995696", "0.5670056", "0.5669946", "0.5669652", "0.56550777", "0.56508785", "0.5647031", "0.5647031", "0.56466514", "0.5641084", "0.56375873", "0.5626325", "0.5624046", "0.5620918", "0.5618423", "0.5618066", "0.5616242", "0.5613067", "0.5612534", "0.5611402", "0.5597676", "0.5597362", "0.55969125", "0.5592578", "0.55852735" ]
0.0
-1
// mission 4 O(n) same logic as mission 3//
public Point[] getPointsInRangeOppAxis(int min, int max, Boolean axis) { int Number = NumInRangeAxis(min, max, axis); Point[] pointsInRange = new Point[Number]; if (Number==0) return pointsInRange; int i = 0; if (axis){ // sorted by axis y this.current=this.miny; while (i<Number){ if (this.current.getData().getX()>=min && this.current.getData().getX() <=max){ pointsInRange[i]=this.current.getData(); i++;} this.current=this.current.getNextY(); } } else {// sorted by axis x this.current=this.minx; while (i<Number){ if (this.current.getData().getY()>=min && this.current.getData().getY() <=max){ pointsInRange[i]=this.current.getData(); i++;} this.current=this.current.getNextX(); } } return pointsInRange; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int[] fix34(int[] nums) {\r\n\tint i=0; // O(1)\r\n while(i<nums.length && nums[i]!=3) // O(n)\r\n i++; // n+1\r\n int j=i; // O(1)\r\n while(j+1<nums.length && nums[j+1]!=4) // O(n)\r\n j++; // n+1\r\n while(i<nums.length){ // O(n)\r\n if(nums[i]==3){ // O(1)\r\n int temp=nums[i+1]; // O(1)\r\n nums[i+1]=nums[j+1]; //O(1)\r\n nums[j+1]=temp; // O(1)\r\n while(j+1<nums.length && nums[j+1] != 4) //O(n)\r\n j++; // n+1\r\n }\r\n i++; // n+1\r\n }\r\n return nums; //O(1)\r\n}", "private int e(amj paramamj)\r\n/* 202: */ {\r\n/* 203:221 */ alq localalq = paramamj.b();\r\n/* 204:222 */ int i = paramamj.b;\r\n/* 205: */ \r\n/* 206:224 */ int j = d(paramamj);\r\n/* 207:225 */ if (j < 0) {\r\n/* 208:226 */ j = j();\r\n/* 209: */ }\r\n/* 210:228 */ if (j < 0) {\r\n/* 211:229 */ return i;\r\n/* 212: */ }\r\n/* 213:231 */ if (this.a[j] == null)\r\n/* 214: */ {\r\n/* 215:232 */ this.a[j] = new amj(localalq, 0, paramamj.i());\r\n/* 216:233 */ if (paramamj.n()) {\r\n/* 217:234 */ this.a[j].d((fn)paramamj.o().b());\r\n/* 218: */ }\r\n/* 219: */ }\r\n/* 220:238 */ int k = i;\r\n/* 221:239 */ if (k > this.a[j].c() - this.a[j].b) {\r\n/* 222:240 */ k = this.a[j].c() - this.a[j].b;\r\n/* 223: */ }\r\n/* 224:242 */ if (k > p_() - this.a[j].b) {\r\n/* 225:243 */ k = p_() - this.a[j].b;\r\n/* 226: */ }\r\n/* 227:246 */ if (k == 0) {\r\n/* 228:247 */ return i;\r\n/* 229: */ }\r\n/* 230:250 */ i -= k;\r\n/* 231:251 */ this.a[j].b += k;\r\n/* 232:252 */ this.a[j].c = 5;\r\n/* 233: */ \r\n/* 234:254 */ return i;\r\n/* 235: */ }", "private void cpu_jogada(){\n\n for(i=0;i<8;i++){\n for(j=0;j<8;j++){\n if(matriz[i][j] == jd2){\n // verificarAtaque(i,j,jd2);\n //verificarAtaque as posssibilidades de\n // ataque : defesa : aleatorio\n //ataque tem prioridade 1 - ve se tem como comer quem ataca\n //defesa tem prioridade 2 - ou movimenta a peca que esta sob ataque ou movimenta a outa para ajudar\n //aleatorio nao tem prioridade -- caso nao esteja sob ataque ou defesa\n }\n }\n }\n }", "public static int example4(int[] arr) { // O(1)\r\n\t\tint n = arr.length, prefix = 0, total = 0; // O(1), O(1), (1)\r\n\t\tfor (int j = 0; j < n; j++) { // loop from 0 to n-1 // O(n)\r\n\t\t\tprefix += arr[j];\r\n\t\t\ttotal += prefix;\r\n\t\t}\r\n\t\treturn total;\r\n\r\n\t\t/*\r\n\t\t * Explanation: The method contains a (for) loop and it runs (n) times.This loop\r\n\t\t * dominates the runtime.We always aim for the worse-case and maximum time. The\r\n\t\t * answer is it is linear time of O(n) notation.\r\n\t\t * \r\n\t\t */\r\n\t}", "private int m3423z(int i, int i2) {\n int i3;\n int i4;\n for (int size = this.f4373c.size() - 1; size >= 0; size--) {\n C0933b bVar = this.f4373c.get(size);\n int i5 = bVar.f4379a;\n if (i5 == 8) {\n int i6 = bVar.f4380b;\n int i7 = bVar.f4382d;\n if (i6 < i7) {\n i4 = i6;\n i3 = i7;\n } else {\n i3 = i6;\n i4 = i7;\n }\n if (i < i4 || i > i3) {\n if (i < i6) {\n if (i2 == 1) {\n bVar.f4380b = i6 + 1;\n bVar.f4382d = i7 + 1;\n } else if (i2 == 2) {\n bVar.f4380b = i6 - 1;\n bVar.f4382d = i7 - 1;\n }\n }\n } else if (i4 == i6) {\n if (i2 == 1) {\n bVar.f4382d = i7 + 1;\n } else if (i2 == 2) {\n bVar.f4382d = i7 - 1;\n }\n i++;\n } else {\n if (i2 == 1) {\n bVar.f4380b = i6 + 1;\n } else if (i2 == 2) {\n bVar.f4380b = i6 - 1;\n }\n i--;\n }\n } else {\n int i8 = bVar.f4380b;\n if (i8 <= i) {\n if (i5 == 1) {\n i -= bVar.f4382d;\n } else if (i5 == 2) {\n i += bVar.f4382d;\n }\n } else if (i2 == 1) {\n bVar.f4380b = i8 + 1;\n } else if (i2 == 2) {\n bVar.f4380b = i8 - 1;\n }\n }\n }\n for (int size2 = this.f4373c.size() - 1; size2 >= 0; size2--) {\n C0933b bVar2 = this.f4373c.get(size2);\n if (bVar2.f4379a == 8) {\n int i9 = bVar2.f4382d;\n if (i9 == bVar2.f4380b || i9 < 0) {\n this.f4373c.remove(size2);\n mo7620a(bVar2);\n }\n } else if (bVar2.f4382d <= 0) {\n this.f4373c.remove(size2);\n mo7620a(bVar2);\n }\n }\n return i;\n }", "public int[] a(int paramInt1, int paramInt2, int paramInt3, int paramInt4)\r\n/* 11: */ {\r\n/* 12:13 */ int i = paramInt1 - 1;\r\n/* 13:14 */ int j = paramInt2 - 1;\r\n/* 14:15 */ int k = paramInt3 + 2;\r\n/* 15:16 */ int m = paramInt4 + 2;\r\n/* 16:17 */ int[] arrayOfInt1 = this.a.a(i, j, k, m);\r\n/* 17: */ \r\n/* 18:19 */ int[] arrayOfInt2 = boy.a(paramInt3 * paramInt4);\r\n/* 19:20 */ for (int n = 0; n < paramInt4; n++) {\r\n/* 20:21 */ for (int i1 = 0; i1 < paramInt3; i1++)\r\n/* 21: */ {\r\n/* 22:22 */ int i2 = c(arrayOfInt1[(i1 + 0 + (n + 1) * k)]);\r\n/* 23:23 */ int i3 = c(arrayOfInt1[(i1 + 2 + (n + 1) * k)]);\r\n/* 24:24 */ int i4 = c(arrayOfInt1[(i1 + 1 + (n + 0) * k)]);\r\n/* 25:25 */ int i5 = c(arrayOfInt1[(i1 + 1 + (n + 2) * k)]);\r\n/* 26:26 */ int i6 = c(arrayOfInt1[(i1 + 1 + (n + 1) * k)]);\r\n/* 27:27 */ if ((i6 != i2) || (i6 != i4) || (i6 != i3) || (i6 != i5)) {\r\n/* 28:28 */ arrayOfInt2[(i1 + n * paramInt3)] = arm.w.az;\r\n/* 29: */ } else {\r\n/* 30:30 */ arrayOfInt2[(i1 + n * paramInt3)] = -1;\r\n/* 31: */ }\r\n/* 32: */ }\r\n/* 33: */ }\r\n/* 34:35 */ return arrayOfInt2;\r\n/* 35: */ }", "public int[] solver(int startPlayerId, int curplayer, int[][] oneP, int[][][] memory, int count) {\n\r\n int[][] one = oneP.clone(); // OnePlay Input\r\n int[] k; // onePlay points\r\n int j = curplayer;\r\n int[][][] m = memory.clone();\r\n int[] minCard = new int[3];\r\n int[] t;\r\n ArrayList<int[]> store = new ArrayList<>();\r\n minCard[2] = 100000;\r\n t = new int[3];\r\n for (int i = 0; i < 4; i++) { // 4 types of cards\r\n for (int l = 2; l < cardPerPlayer + 2; l++) {\r\n if (m[j][i][l] == 1 || m[j][i][l] == 2) {\r\n one[j][0] = i;\r\n one[j][1] = l;\r\n remove(new int[] { i, l }, m);\r\n if ((j + 1) % players != startPlayerId) {\r\n t = solver(startPlayerId, (j + 1) % players, one, m, count);\r\n one[(j + 1) % players][0] = t[0];\r\n one[(j + 1) % players][1] = t[1];\r\n }\r\n // } else if ((j + 2) % players != startPlayerId) {\r\n // t = solver(startPlayerId, (j + 2) % players, one, m, count);\r\n // one[(j + 1) % players][0] = t[0];\r\n // one[(j + 1) % players][1] = t[1];\r\n // } else if ((j + 3) % players != startPlayerId) {\r\n // t = solver(startPlayerId, (j + 3) % players, one, m, count);\r\n // one[(j + 1) % players][0] = t[0];\r\n // one[(j + 1) % players][1] = t[1];\r\n // }\r\n\r\n k = onePlay(one, startPlayerId);\r\n int curpoint = 0;\r\n if (count != cardPerPlayer - 1) { // cardPerPlayer - 1 = 12\r\n t = solver(k[0], k[0], new int[4][2], m, count++);\r\n curpoint = t[2];\r\n }\r\n\r\n if (k[0] == myID) {\r\n curpoint += k[1] + k[2] * 12;\r\n }\r\n store.add(new int[] { i, l, curpoint });\r\n if (curpoint < minCard[2]) {\r\n minCard[2] = curpoint;\r\n minCard[0] = i;\r\n minCard[1] = l;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return minCard;\r\n }", "private static void get4ElementsSumCountFastest(String inputLine, int target) {\n String[] arr = inputLine.split(\" \");\n if (arr.length < 3) {\n System.out.println(0);\n return;\n }\n\n Map<Integer, Set<String>> pairSumMap = new HashMap<>();\n List<Integer> list = new ArrayList<>(arr.length);\n for (String s : arr) {\n list.add(Integer.parseInt(s.trim()));\n }\n\n int sum = 0, diff = 0;\n for (int i = 0; i < arr.length; i++) {\n for (int j = i + 1; j < arr.length; j++) {\n sum = list.get(i) + list.get(j);\n if (sum < target) {\n pairSumMap.putIfAbsent(sum, new HashSet<>());\n pairSumMap.get(sum).add(i + \"-\" + j);\n }\n }\n }\n\n for (Map.Entry<Integer, Set<String>> mk : pairSumMap.entrySet()) {\n diff = target - mk.getKey();\n if (pairSumMap.containsKey(diff)) {\n Set<String> indexesList = mk.getValue();\n for (String index : indexesList) {\n int indexOrgX = Integer.parseInt(index.split(\"-\")[0]);\n int indexOrgY = Integer.parseInt(index.split(\"-\")[1]);\n for (String newIdx : pairSumMap.get(diff)) {\n int indexNewX = Integer.parseInt(newIdx.split(\"-\")[0]);\n int indexNewY = Integer.parseInt(newIdx.split(\"-\")[1]);\n if (indexOrgX != indexNewX && indexOrgX != indexNewY && indexOrgY != indexNewX && indexOrgY != indexNewY) {\n System.out.println(1);\n return;\n }\n }\n }\n }\n }\n System.out.println(0);\n }", "public static void main(String[] args) {\n\n pairsSum();\n\n printAllSubArrays();\n\n tripletZero();\n\n // int[][] sub = subsets();\n\n PairsSum sum = new PairsSum();\n int[] arr = { 10, 1, 2, 3, 4, 5, 6, 1 };\n boolean flag = sum.almostIncreasingSequence(arr);\n System.out.println(flag);\n\n String s = \"\";\n for (int i = 0; i < 100000; i++) {\n // s += \"CodefightsIsAwesome\";\n }\n long start = System.currentTimeMillis();\n // int k = subStr(s, \"IsA\");\n System.out.println(System.currentTimeMillis() - start);\n // System.out.println(k);\n\n String[] a = { \"aba\", \"aa\", \"ad\", \"vcd\", \"aba\" };\n String[] b = sum.allLongestStrings(a);\n System.out.println(Arrays.deepToString(b));\n\n List<String> al = new ArrayList<>();\n al.toArray();\n\n Map<Integer, Integer> map = new HashMap<>();\n Set<Integer> keySet = map.keySet();\n for (Integer integer : keySet) {\n\n }\n\n String st = reverseBracksStack(\"a(bc(de)f)g\");\n System.out.println(st);\n\n int[] A = { 1, 2, 3, 2, 2, 3, 3, 33 };\n int[] B = { 1, 2, 2, 2, 2, 3, 2, 33 };\n\n System.out.println(sum.isIPv4Address(\"2.2.34\"));\n\n Integer[] AR = { 5, 3, 6, 7, 9 };\n int h = sum.avoidObstacles(AR);\n System.out.println(h);\n\n int[][] image = { { 36, 0, 18, 9 }, { 27, 54, 9, 0 }, { 81, 63, 72, 45 } };\n int[][] im = { { 7, 4, 0, 1 }, { 5, 6, 2, 2 }, { 6, 10, 7, 8 }, { 1, 4, 2, 0 } };\n int[][] res = sum.boxBlur(im);\n\n for (int i = 0; i < res.length; i++) {\n for (int j = 0; j < res[0].length; j++) {\n System.out.print(res[i][j] + \" \");\n }\n System.out.println();\n }\n\n boolean[][] ms = { { true, false, false, true }, { false, false, true, false }, { true, true, false, true } };\n int[][] mines = sum.minesweeper(ms);\n for (int i = 0; i < mines.length; i++) {\n for (int j = 0; j < mines[0].length; j++) {\n System.out.print(mines[i][j] + \" \");\n }\n System.out.println();\n }\n\n System.out.println(sum.variableName(\"var_1__Int\"));\n\n System.out.println(sum.chessBoard());\n\n System.out.println(sum.depositProfit(100, 20, 170));\n\n String[] inputArray = { \"abc\", \"abx\", \"axx\", \"abx\", \"abc\" };\n System.out.println(sum.stringsRearrangement(inputArray));\n\n int[][] queens = { { 1, 1 }, { 3, 2 } };\n int[][] queries = { { 1, 1 }, { 0, 3 }, { 0, 4 }, { 3, 4 }, { 2, 0 }, { 4, 3 }, { 4, 0 } };\n boolean[] r = sum.queensUnderAttack(5, queens, queries);\n\n }", "private int m5278d(int pos, int cmd) {\n int end;\n int start;\n for (int i = this.f3533c.size() - 1; i >= 0; i--) {\n C1070b postponed = (C1070b) this.f3533c.get(i);\n int i2 = postponed.f3539a;\n if (i2 == 8) {\n if (postponed.f3540b < postponed.f3542d) {\n start = postponed.f3540b;\n end = postponed.f3542d;\n } else {\n start = postponed.f3542d;\n end = postponed.f3540b;\n }\n if (pos < start || pos > end) {\n int i3 = postponed.f3540b;\n if (pos < i3) {\n if (cmd == 1) {\n postponed.f3540b = i3 + 1;\n postponed.f3542d++;\n } else if (cmd == 2) {\n postponed.f3540b = i3 - 1;\n postponed.f3542d--;\n }\n }\n } else {\n int i4 = postponed.f3540b;\n if (start == i4) {\n if (cmd == 1) {\n postponed.f3542d++;\n } else if (cmd == 2) {\n postponed.f3542d--;\n }\n pos++;\n } else {\n if (cmd == 1) {\n postponed.f3540b = i4 + 1;\n } else if (cmd == 2) {\n postponed.f3540b = i4 - 1;\n }\n pos--;\n }\n }\n } else {\n int i5 = postponed.f3540b;\n if (i5 <= pos) {\n if (i2 == 1) {\n pos -= postponed.f3542d;\n } else if (i2 == 2) {\n pos += postponed.f3542d;\n }\n } else if (cmd == 1) {\n postponed.f3540b = i5 + 1;\n } else if (cmd == 2) {\n postponed.f3540b = i5 - 1;\n }\n }\n }\n for (int i6 = this.f3533c.size() - 1; i6 >= 0; i6--) {\n C1070b op = (C1070b) this.f3533c.get(i6);\n if (op.f3539a == 8) {\n int i7 = op.f3542d;\n if (i7 == op.f3540b || i7 < 0) {\n this.f3533c.remove(i6);\n mo8470a(op);\n }\n } else if (op.f3542d <= 0) {\n this.f3533c.remove(i6);\n mo8470a(op);\n }\n }\n return pos;\n }", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int T = sc.nextInt();\n for(int i = 0 ; i < T; i++) {\n int n = sc.nextInt();\n int a = sc.nextInt();\n int b = sc.nextInt();\n PriorityQueue<Integer> queue = new PriorityQueue<Integer>();\n int[][] m = new int[n][n];\n //n^2 * log(n)\n for(int row = 0; row < n; row++) {\n for(int col = 0; col < n; col++) {\n if(row == 0 && col == 0 && n != 1) {\n continue;\n }else if(row == 0) {\n m[row][col] = m[row][col - 1] + a;\n }else if(col == 0) {\n m[row][col] = m[row-1][col] + b;\n }else {\n m[row][col] = m[row-1][col-1] + a + b;\n }\n\n if(row + col == (n -1)) {\n pool.add(m[row][col]); //log(n)\n }\n }\n }\n //O(n*log(n))\n for (Integer item:pool) {\n queue.add(item); //O(logn)\n }\n while(!queue.isEmpty()) {\n System.out.print(queue.poll() + \" \"); //O(1)\n }\n System.out.println();\n queue.clear();\n pool.clear();\n }\n }", "public List<List<Integer>> fourSum_optimization(int[] nums, int target) {\n int len = nums.length;\n Arrays.sort(nums);\n if (len < 4)\n return Collections.emptyList();\n List<List<Integer>> arr = new ArrayList<>();\n\n for (int i = 0; i < len - 1; i++) {\n for (int j = i + 1; j < len - 1; j++) {\n int Left = j + 1;\n int Right = len - 1;\n int left_target_sum = target - nums[i] + nums[j];\n\n while (Left < Right) {\n int two_sum = nums[Left] + nums[Right];\n if (two_sum < left_target_sum)\n Left++;\n else if (two_sum > left_target_sum)\n Right--;\n else {\n List<Integer> arr2 = new ArrayList<>();\n if (left_target_sum + two_sum == target) {\n arr2.add(nums[i]);\n arr2.add(nums[j]);\n arr2.add(nums[Left]);\n arr2.add(nums[Right]);\n arr.add(arr2);\n }\n while (Left < Right && nums[Left] == arr2.get(2))\n ++Left;\n while (Left < Right && nums[Right] == arr2.get(3))\n --Right;\n }\n }\n while (i + 1 < len && nums[i + 1] == nums[i])\n ++i;\n while (j + 1 < len && nums[j + 1] == nums[j])\n ++j;\n }\n }\n\n return arr;\n }", "protected static void endPartial(long[] h) {\n h[11] += h[1]; \n h[2] ^= h[11]; \n h[1] = (h[1] << 44) | (h[1] >>> 20);\n h[0] += h[2]; \n h[3] ^= h[0]; \n h[2] = (h[2] << 15) | (h[2] >>> 49);\n h[1] += h[3]; \n h[4] ^= h[1]; \n h[3] = (h[3] << 34) | (h[3] >>> 30);\n h[2] += h[4]; \n h[5] ^= h[2]; \n h[4] = (h[4] << 21) | (h[4] >>> 43);\n h[3] += h[5]; \n h[6] ^= h[3]; \n h[5] = (h[5] << 38) | (h[5] >>> 26);\n h[4] += h[6]; \n h[7] ^= h[4]; \n h[6] = (h[6] << 33) | (h[6] >>> 31);\n h[5] += h[7]; \n h[8] ^= h[5]; \n h[7] = (h[7] << 10) | (h[7] >>> 54);\n h[6] += h[8]; \n h[9] ^= h[6]; \n h[8] = (h[8] << 13) | (h[8] >>> 51);\n h[7] += h[9]; \n h[10] ^= h[7]; \n h[9] = (h[9] << 38) | (h[9] >>> 26);\n h[8] += h[10]; \n h[11] ^= h[8]; \n h[10] = (h[10] << 53) | (h[10] >>> 11);\n h[9] += h[11]; \n h[0] ^= h[9]; \n h[11] = (h[11] << 42) | (h[11] >>> 22);\n h[10] += h[0]; \n h[1] ^= h[10]; \n h[0] = (h[0] << 54) | (h[0] >>> 10);\t\t\n\t}", "public ArrayList<ArrayList<Integer>> fourSum(int[] num, int target) {\n int temp = 0;\n Arrays.sort(num);\n\n ArrayList<ArrayList<Integer>> a = new ArrayList<ArrayList<Integer>>();\n int [] s = new int [4];\n int total = 0;\n int current = -1;\n int i = 0;\n Arrays.fill(s, 0);\n HashMap<Long, Integer> m = new HashMap<Long, Integer>();\n \n \n if (num.length < 4) return a;\n \n while (i!=-1) {\n //increase the current pointer\n ++current;\n if (current > num.length-1) {\n --i;\n if (i >= 0) \n {\n current = s[i];\n total -= num[current];\n }\n }\n else if (total + num[current] > target || total + (4-i)*num[num.length-1] < target) {\n --i;\n if (i >= 0) \n {\n current = s[i];\n total -= num[current];\n }\n }\n else {\n //check if current number will work\n /*if (current == 0)\n {\n */\n if (i < 3) {s[i] = current; total += num[current]; ++i;}\n else if (num[current] + total == target) {\n //bingo one answer\n ArrayList<Integer> b = new ArrayList<Integer>();\n long c = num[s[0]]*num[s[1]]*num[s[2]]*num[current];\n long d = Math.abs((long)num[s[0]]*1000000000) \n + Math.abs((long)num[s[1]]*1000000)\n + Math.abs((long)num[s[2]]*1000)\n + Math.abs((long)num[current]);\n if (c < 0) d *= -1;\n if (!m.containsKey(d))\n {\n b.add(num[s[0]]);\n b.add(num[s[1]]);\n b.add(num[s[2]]);\n b.add(num[current]);\n a.add(b);\n m.put(d, 1);\n }\n }\n /*\n } \n else if (num[current] != num[current-1])\n {\n if (i < 2) {s[i] = current; total += num[current]; ++i;}\n else if (num[current] + total == 0) {\n //bingo one answer\n ArrayList<Integer> b = new ArrayList<Integer>();\n b.add(num[s[0]]);\n b.add(num[s[1]]);\n b.add(num[s[2]]);\n a.add(b);\n }\n }\n */\n }\n }\n return a;\n }", "public static void main(String[] args) throws Exception {\n\t\tScanner scn = new Scanner(System.in);\r\n\t\tint tc = scn.nextInt();\r\n\t\tfor(int t=1; t<=tc; t++) {\r\n\t\t\tint n = scn.nextInt();\r\n\t\t\tint k = scn.nextInt();\r\n\t\t\tString str = scn.next();\r\n\t\t\tString arr[] = new String[n];\r\n\t\t\tarr = str.split(\"\");\r\n\t\t\tLinkedList<String> list = new LinkedList<>();\r\n\t\t\tLinkedList<Integer> result = new LinkedList<>();\r\n\t\t\tfor(int i=0; i<n; i++) {\r\n\t\t\t\tlist.add(arr[i]);\r\n\t\t\t}\r\n\t\t\tint comeback = 0;\r\n\t\t\twhile(comeback<4) {\r\n\t\t\t\tint cnt = 0;\r\n\t\t\t\tcomeback = 0;\r\n\t\t\t\tString st = \"\";\r\n\t\t\t\tfor(int i=0; i<n; i++) {\r\n\t\t\t\t\tif(cnt==(n/4)-1) {\r\n\t\t\t\t\t\tcnt = 0;\r\n\t\t\t\t\t\tst += list.get(i);\r\n\t\t\t\t\t\tint tmp = Integer.parseInt(st, 16);\r\n\t\t\t\t\t\tif(!isHave(result,tmp) && (result.size()>0)) {\r\n\t\t\t\t\t\t\tresult.add(tmp);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if(result.size() == 0){\r\n\t\t\t\t\t\t\tresult.add(tmp);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tcomeback++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tst = \"\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tst+= list.get(i);\r\n\t\t\t\t\t\tcnt++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\trotate(list);\r\n\t\t\t}\r\n\t\t\tCollections.sort(result);\r\n\t\t\tint cnt = 0;\r\n\t\t\tSystem.out.println(\"#\"+t+\" \"+result.get(result.size()-k));\t\t\t\r\n\t\t}\r\n\t}", "public static void main(String[] args) \n {\n int[] numOfPoints = { 1000, 10000, 7000, 10000, 13000 };\n for(int count = 0; count < numOfPoints.length; count++)\n {\n List<Point> pointsTobeUsed = new ArrayList<Point>();\n int current = numOfPoints[count];\n int inc = 0;\n \n //creating list of points to be used\n for(int x = 0; x <= current; x++)\n {\n \n if(x <= current/2)\n {\n pointsTobeUsed.add(new Point(x,x));\n \n }\n else\n {\n pointsTobeUsed.add(new Point(x, x - (1 + 2*(inc)) ) );\n inc++;\n }\n }\n \n //n logn implementation of Pareto optimal\n long timeStart = System.currentTimeMillis();\n \n // n logn quicksort\n pointsTobeUsed = quickSort(pointsTobeUsed, 0, pointsTobeUsed.size() -1 );\n \n \n \n ParetoOptimal(pointsTobeUsed);\n \n \n long timeEnd = System.currentTimeMillis();\n System.out.println(\"final:\" + \" exper: \" + (timeEnd - timeStart) + \" N: \" + current ); \n }\n }", "public static void main(String[] args) throws IOException {\n\t\tbr = new BufferedReader(new FileReader(new File(\"input.txt\")));\r\n\t\tSystem.setOut(new PrintStream(new File(\"output.txt\")));\r\n\t\tint T = readInt();\r\n\t\t\r\n\t\tfor (int ind = 1; ind<=T; ind++) {\r\n\t\t\tSystem.out.print(\"Case #\" + ind + \": \");\r\n\t\t\t\r\n\t\t\tint N = readInt();\r\n\t\t\tint[] ar = readIntArr();\r\n\t\t\tfor (int i = 0; i < N; i++)ar[i]--;\r\n\t\t\tboolean used[] = new boolean[N];\r\n\t\t\tint ans = 0;\r\n\t\t\tint pairMax = 0;\r\n\t\t\tint cycleMax = 0;\r\n\t\t\tint cyclePair = 0;\r\n\t\t\tint pair = 0;\r\n\t\t\tfor (int i = 0; i < N; i++) {\r\n\t\t\t\tif (!used[i]) {\r\n\t\t\t\t\tList<Integer> list = new LinkedList<Integer>();\r\n\t\t\t\t\tlist.add(i);\r\n\t\t\t\t\tused[i] = true;\r\n\t\t\t\t\tint j = ar[i];\r\n\t\t\t\t\twhile(!list.contains(j) && !used[j]) {\r\n\t\t\t\t\t\tlist.add(j);\r\n\t\t\t\t\t\tused[j] = true;\r\n\t\t\t\t\t\tj = ar[j];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!list.contains(j))continue;\r\n\t\t\t\t\tif (list.size() == 2)pair++;\r\n\t\t\t\t\tboolean removed = false;\r\n\t\t\t\t\twhile(list.get(0) != j){list.remove(0);removed = true;}\r\n\t\t\t\t\tif (list.size() > 2 && list.size() > cycleMax) cycleMax = list.size();\r\n\t\t\t\t\tif (list.size() == 2) {\r\n\t\t\t\t\t\tint a = list.remove(0);\r\n\t\t\t\t\t\tint b = list.remove(0);\r\n\t\t\t\t\t\tint tmp = 2;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tboolean us[] = new boolean[N];\r\n\t\t\t\t\t\t\tus[a] = true;\r\n\t\t\t\t\t\t\tus[b] = true;\r\n\t\t\t\t\t\t\t//System.out.println(\" test \" + a + b);\r\n\t\t\t\t\t\t\tSet<Integer> set = new HashSet<Integer>();\r\n\t\t\t\t\t\t\tset.add(a);\r\n\t\t\t\t\t\t\twhile (true) {\r\n\t\t\t\t\t\t\t\tboolean found = false;\r\n\t\t\t\t\t\t\t\tSet<Integer> tSet = new HashSet<Integer>();\r\n\t\t\t\t\t\t\t\tfor (int ii = 0; ii < N; ii++) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif (!us[ii] && set.contains(ar[ii])) {\r\n\t\t\t\t\t\t\t\t\t\tus[ii] = true;\r\n\t\t\t\t\t\t\t\t\t\tfound = true;\r\n\t\t\t\t\t\t\t\t\t\ttSet.add(ii);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (found)tmp++;\r\n\t\t\t\t\t\t\t\tif (!found)break;\r\n\t\t\t\t\t\t\t\tset.addAll(tSet);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tset = new HashSet<Integer>();\r\n\t\t\t\t\t\t\tset.add(b);\r\n\t\t\t\t\t\t\twhile (true) {\r\n\t\t\t\t\t\t\t\tboolean found = false;\r\n\t\t\t\t\t\t\t\tSet<Integer> tSet = new HashSet<Integer>();\r\n\t\t\t\t\t\t\t\tfor (int ii = 0; ii < N; ii++) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif (!us[ii] && set.contains(ar[ii])) {\r\n\t\t\t\t\t\t\t\t\t\tus[ii] = true;\r\n\t\t\t\t\t\t\t\t\t\tfound = true;\r\n\t\t\t\t\t\t\t\t\t\ttSet.add(ii);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif(found)tmp++;\r\n\t\t\t\t\t\t\t\tif (!found)break;\r\n\t\t\t\t\t\t\t\tset.addAll(tSet);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//if (removed) {\r\n\t\t\t\t\t\t//\tif (tmp > cyclePair)cyclePair = tmp;\r\n\t\t\t\t\t\t//} else {\r\n\t\t\t\t\t\t pairMax += tmp;\r\n\t\t\t\t\t\t//}\r\n\t\t\t\t\t} else {\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\r\n\t\t\t//cyclePair += 2 * pair;\r\n\t\t\t//if (pair > 1) pairMax += 2 * (pair - 1);\r\n\t\t\tans = Math.max(cyclePair, pairMax);\r\n\t\t\tans = Math.max(cycleMax, ans);\r\n\t\t\tSystem.out.println(ans);\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\r\n\t}", "private static int[] post4(int[] input) {\n int indexFor = 0;\n for (int i = input.length - 1; i >= 0; i--) {\n if (input[i] == 4) {\n indexFor = i;\n break;\n }\n }\n // 1. done\n int size = input.length - indexFor - 1;\n // 2. done\n int[] output = new int[size];\n // 2.5. done\n /* for (int i = size - 1; i >= 0; i--) {\n output[i] = input[input.length + i - size];\n }*/\n for (int i = 0; i < size; i++) {\n output[i] = input[i + indexFor + 1];\n }\n // 3. done\n return output;\n }", "private static void task4(int nUMS, BinarySearchTree<Integer> t) {\n\t\t\n\t\tdouble search_start = 0, search_end = 0;\n\n\t System.out.println(\"SPLAY DELETION Started...\");\n\t search_start = System.nanoTime();\n\t int count = 0;\n\t \t\n\t for (int z = 0; z < nUMS; z++) {\n\t \tint checker= GenerateInt.generateNumber();\n//\t \tSystem.out.println(GenerateStrings.getAlphaNumericString(limit));\n\t if (t.contains(checker)) {\n\t t.remove(checker);\n//\t System.out.println(\"INT Removed\");\n\t count++;\n\t }\n\t }\n\t search_end = System.nanoTime();\n\t System.out.println(\"Average time for each deletion: \" + (search_end - search_start) / nUMS + \" nanoseconds\");\n\t \n\t System.out.println(\"TOTAL REMOVES\" + count);\n\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n long startTime = System.nanoTime();\n Board b = new Board();\n b.board = InitialPositions.kiwiPeteBoard; // perft test\n\n int p2 = 0;\n int p3 = 0;\n int p4 = 0;\n int p5 = 0;\n\n List<Move> p1Moves = b.validMoves();\n int p1 = p1Moves.size();\n for (Move m : p1Moves){\n b.makeMove(m);\n List<Move> p2Moves = b.validMoves();\n p2 += p2Moves.size();\n for (Move n : p2Moves){\n b.makeMove(n);\n List<Move> p3Moves = b.validMoves();\n for (Move m3 : p3Moves){\n b.makeMove(m3);\n List<Move> moves4 = b.validMoves();\n p4 += moves4.size();\n for (Move m4 : moves4){\n b.makeMove(m4);\n p5 += b.validMoves().size();\n b.undoMove(m4);\n }\n b.undoMove(m3);\n }\n p3 += p3Moves.size();\n b.undoMove(n);\n }\n b.undoMove(m);\n }\n System.out.println();\n System.out.println(p1);\n System.out.println(p2);\n System.out.println(p3);\n System.out.println(p4);\n System.out.println(p5); // 193690690\n System.out.println(\"Time taken: \"+(System.nanoTime()-startTime)); // with int castles : 35003485400\n }", "private final int m()\n\t { int n = 0;\n\t int i = 0;\n\t while(true)\n\t { if (i > j) return n;\n\t if (! cons(i)) break; i++;\n\t }\n\t i++;\n\t while(true)\n\t { while(true)\n\t { if (i > j) return n;\n\t if (cons(i)) break;\n\t i++;\n\t }\n\t i++;\n\t n++;\n\t while(true)\n\t { if (i > j) return n;\n\t if (! cons(i)) break;\n\t i++;\n\t }\n\t i++;\n\t }\n\t }", "public static int f2(int N) { \n int x = 0; //O(1)\n for(int i = 0; i < N; i++) // O(n)\n // O(n)`\n for(int j = 0; j < i; j++) \n x++;\n return x;\n }", "public void a()\r\n/* 49: */ {\r\n/* 50: 64 */ HashSet<BlockPosition> localHashSet = Sets.newHashSet();\r\n/* 51: */ \r\n/* 52: 66 */ int m = 16;\r\n/* 53: 67 */ for (int n = 0; n < 16; n++) {\r\n/* 54: 68 */ for (int i1 = 0; i1 < 16; i1++) {\r\n/* 55: 69 */ for (int i2 = 0; i2 < 16; i2++) {\r\n/* 56: 70 */ if ((n == 0) || (n == 15) || (i1 == 0) || (i1 == 15) || (i2 == 0) || (i2 == 15))\r\n/* 57: */ {\r\n/* 58: 74 */ double d1 = n / 15.0F * 2.0F - 1.0F;\r\n/* 59: 75 */ double d2 = i1 / 15.0F * 2.0F - 1.0F;\r\n/* 60: 76 */ double d3 = i2 / 15.0F * 2.0F - 1.0F;\r\n/* 61: 77 */ double d4 = Math.sqrt(d1 * d1 + d2 * d2 + d3 * d3);\r\n/* 62: */ \r\n/* 63: 79 */ d1 /= d4;\r\n/* 64: 80 */ d2 /= d4;\r\n/* 65: 81 */ d3 /= d4;\r\n/* 66: */ \r\n/* 67: 83 */ float f2 = this.i * (0.7F + this.d.rng.nextFloat() * 0.6F);\r\n/* 68: 84 */ double d6 = this.e;\r\n/* 69: 85 */ double d8 = this.f;\r\n/* 70: 86 */ double d10 = this.g;\r\n/* 71: */ \r\n/* 72: 88 */ float f3 = 0.3F;\r\n/* 73: 89 */ while (f2 > 0.0F)\r\n/* 74: */ {\r\n/* 75: 90 */ BlockPosition localdt = new BlockPosition(d6, d8, d10);\r\n/* 76: 91 */ Block localbec = this.d.getBlock(localdt);\r\n/* 77: 93 */ if (localbec.getType().getMaterial() != Material.air)\r\n/* 78: */ {\r\n/* 79: 94 */ float f4 = this.h != null ? this.h.a(this, this.d, localdt, localbec) : localbec.getType().a((Entity)null);\r\n/* 80: 95 */ f2 -= (f4 + 0.3F) * 0.3F;\r\n/* 81: */ }\r\n/* 82: 98 */ if ((f2 > 0.0F) && ((this.h == null) || (this.h.a(this, this.d, localdt, localbec, f2)))) {\r\n/* 83: 99 */ localHashSet.add(localdt);\r\n/* 84: */ }\r\n/* 85:102 */ d6 += d1 * 0.300000011920929D;\r\n/* 86:103 */ d8 += d2 * 0.300000011920929D;\r\n/* 87:104 */ d10 += d3 * 0.300000011920929D;\r\n/* 88:105 */ f2 -= 0.225F;\r\n/* 89: */ }\r\n/* 90: */ }\r\n/* 91: */ }\r\n/* 92: */ }\r\n/* 93: */ }\r\n/* 94:111 */ this.j.addAll(localHashSet);\r\n/* 95: */ \r\n/* 96:113 */ float f1 = this.i * 2.0F;\r\n/* 97: */ \r\n/* 98:115 */ int i1 = MathUtils.floor(this.e - f1 - 1.0D);\r\n/* 99:116 */ int i2 = MathUtils.floor(this.e + f1 + 1.0D);\r\n/* 100:117 */ int i3 = MathUtils.floor(this.f - f1 - 1.0D);\r\n/* 101:118 */ int i4 = MathUtils.floor(this.f + f1 + 1.0D);\r\n/* 102:119 */ int i5 = MathUtils.floor(this.g - f1 - 1.0D);\r\n/* 103:120 */ int i6 = MathUtils.floor(this.g + f1 + 1.0D);\r\n/* 104:121 */ List<Entity> localList = this.d.b(this.h, new AABB(i1, i3, i5, i2, i4, i6));\r\n/* 105:122 */ Vec3 localbrw = new Vec3(this.e, this.f, this.g);\r\n/* 106:124 */ for (int i7 = 0; i7 < localList.size(); i7++)\r\n/* 107: */ {\r\n/* 108:125 */ Entity localwv = (Entity)localList.get(i7);\r\n/* 109:126 */ if (!localwv.aV())\r\n/* 110: */ {\r\n/* 111:129 */ double d5 = localwv.f(this.e, this.f, this.g) / f1;\r\n/* 112:131 */ if (d5 <= 1.0D)\r\n/* 113: */ {\r\n/* 114:132 */ double d7 = localwv.xPos - this.e;\r\n/* 115:133 */ double d9 = localwv.yPos + localwv.getEyeHeight() - this.f;\r\n/* 116:134 */ double d11 = localwv.zPos - this.g;\r\n/* 117: */ \r\n/* 118:136 */ double d12 = MathUtils.sqrt(d7 * d7 + d9 * d9 + d11 * d11);\r\n/* 119:137 */ if (d12 != 0.0D)\r\n/* 120: */ {\r\n/* 121:141 */ d7 /= d12;\r\n/* 122:142 */ d9 /= d12;\r\n/* 123:143 */ d11 /= d12;\r\n/* 124: */ \r\n/* 125:145 */ double d13 = this.d.a(localbrw, localwv.getAABB());\r\n/* 126:146 */ double d14 = (1.0D - d5) * d13;\r\n/* 127:147 */ localwv.receiveDamage(DamageSource.a(this), (int)((d14 * d14 + d14) / 2.0D * 8.0D * f1 + 1.0D));\r\n/* 128: */ \r\n/* 129:149 */ double d15 = EnchantmentProtection.a(localwv, d14);\r\n/* 130:150 */ localwv.xVelocity += d7 * d15;\r\n/* 131:151 */ localwv.yVelocity += d9 * d15;\r\n/* 132:152 */ localwv.zVelocity += d11 * d15;\r\n/* 133:154 */ if ((localwv instanceof EntityPlayer)) {\r\n/* 134:155 */ this.k.put((EntityPlayer)localwv, new Vec3(d7 * d14, d9 * d14, d11 * d14));\r\n/* 135: */ }\r\n/* 136: */ }\r\n/* 137: */ }\r\n/* 138: */ }\r\n/* 139: */ }\r\n/* 140: */ }", "private boolean kcss(int[] i, long[] e, long y) {\n int I = i.length;\n long[] x = new long[I];\n while (true) {\n x[0] = ll(i[0]); // 1\n snapshot(i, 1, I, x); // 2\n if (Arrays.compare(x, e) != 0) { // 3\n sc(i[0], x[0]); // 3a\n return false; // 3a\n }\n if (sc(i[0], y)) return true; // 3b\n } // 3c\n }", "public void mo442d() {\n long j;\n long j2;\n int i;\n long j3;\n boolean z;\n C0245a[] aVarArr;\n int i2;\n int i3;\n C3683c<? super U> cVar = this.f472a;\n int i4 = 1;\n while (!mo443e()) {\n C0211f<U> fVar = this.f477f;\n long j4 = this.f482m.get();\n boolean z2 = j4 == Long.MAX_VALUE;\n if (fVar != null) {\n j = 0;\n while (true) {\n long j5 = 0;\n Object obj = null;\n while (true) {\n if (j4 == 0) {\n break;\n }\n Object e_ = fVar.mo386e_();\n if (!mo443e()) {\n if (e_ == null) {\n obj = e_;\n break;\n }\n cVar.onNext(e_);\n j++;\n j5++;\n j4--;\n obj = e_;\n } else {\n return;\n }\n }\n if (j5 != 0) {\n if (z2) {\n j4 = Long.MAX_VALUE;\n } else {\n j4 = this.f482m.addAndGet(-j5);\n }\n }\n if (j4 == 0 || obj == null) {\n break;\n }\n }\n } else {\n j = 0;\n }\n boolean z3 = this.f478g;\n C0211f<U> fVar2 = this.f477f;\n C0245a[] aVarArr2 = (C0245a[]) this.f481j.get();\n int length = aVarArr2.length;\n if (!z3 || ((fVar2 != null && !fVar2.mo384b()) || length != 0)) {\n if (length != 0) {\n i = i4;\n long j6 = this.f485p;\n int i5 = this.f486q;\n if (length <= i5 || aVarArr2[i5].f462a != j6) {\n if (length <= i5) {\n i5 = 0;\n }\n int i6 = i5;\n for (int i7 = 0; i7 < length && aVarArr2[i6].f462a != j6; i7++) {\n i6++;\n if (i6 == length) {\n i6 = 0;\n }\n }\n this.f486q = i6;\n this.f485p = aVarArr2[i6].f462a;\n i5 = i6;\n }\n int i8 = i5;\n z = false;\n int i9 = 0;\n while (true) {\n if (i9 >= length) {\n aVarArr = aVarArr2;\n break;\n } else if (!mo443e()) {\n C0245a aVar = aVarArr2[i8];\n Object obj2 = null;\n while (!mo443e()) {\n C0212g<U> gVar = aVar.f467f;\n if (gVar == null) {\n aVarArr = aVarArr2;\n i2 = length;\n } else {\n aVarArr = aVarArr2;\n i2 = length;\n long j7 = 0;\n while (j2 != 0) {\n try {\n obj2 = gVar.mo386e_();\n if (obj2 == null) {\n break;\n }\n cVar.onNext(obj2);\n if (!mo443e()) {\n j2--;\n j7++;\n } else {\n return;\n }\n } catch (Throwable th) {\n Throwable th2 = th;\n C0171b.m584b(th2);\n aVar.dispose();\n this.f479h.mo516a(th2);\n if (!this.f474c) {\n this.f483n.mo407a();\n }\n if (!mo443e()) {\n mo439b(aVar);\n i9++;\n i3 = i2;\n z = true;\n } else {\n return;\n }\n }\n }\n if (j7 != 0) {\n j2 = !z2 ? this.f482m.addAndGet(-j7) : Long.MAX_VALUE;\n aVar.mo433a(j7);\n }\n if (!(j2 == 0 || obj2 == null)) {\n aVarArr2 = aVarArr;\n length = i2;\n }\n }\n boolean z4 = aVar.f466e;\n C0212g<U> gVar2 = aVar.f467f;\n if (z4 && (gVar2 == null || gVar2.mo384b())) {\n mo439b(aVar);\n if (!mo443e()) {\n j++;\n z = true;\n } else {\n return;\n }\n }\n if (j2 == 0) {\n break;\n }\n int i10 = i8 + 1;\n i3 = i2;\n i8 = i10 == i3 ? 0 : i10;\n i9++;\n length = i3;\n aVarArr2 = aVarArr;\n }\n return;\n } else {\n return;\n }\n }\n this.f486q = i8;\n this.f485p = aVarArr[i8].f462a;\n j3 = j;\n } else {\n i = i4;\n j3 = j;\n z = false;\n }\n if (j3 != 0 && !this.f480i) {\n this.f483n.mo408a(j3);\n }\n if (z) {\n i4 = i;\n } else {\n i4 = addAndGet(-i);\n if (i4 == 0) {\n return;\n }\n }\n } else {\n Throwable a = this.f479h.mo515a();\n if (a != C0315e.f669a) {\n if (a == null) {\n cVar.onComplete();\n } else {\n cVar.onError(a);\n }\n }\n return;\n }\n }\n }", "private void go(int i) {\n\t\tcol[i] = 1;\r\n\t\tint j = f[i];\r\n\t\tint cnt = 0;\r\n\t\tint delAll = 0;\r\n\t\tint[][] cd = new int[1000][3];\r\n\t\tint sa = 0;\r\n\t\tint sb = 0;\r\n\t\tint m1 = Integer.MAX_VALUE;\r\n\t\tint m2 = Integer.MAX_VALUE;\r\n\t\tint m1a = 0;\r\n\t\tint m2a = 0;\r\n\t\tint m1b = 0;\r\n\t\tint m2b = 0;\r\n\t\twhile (j != -1) {\r\n\t\t\tif (col[e[j]] == 0) {\r\n\t\t\t\tgo(e[j]);\r\n\t\t\t\tdelAll += a[e[j]];\r\n\t\t\t\tint dif = b[e[j]] - a[e[j]];\r\n\t\t\t\tif (dif < m1) {\r\n\t\t\t\t\tm2 = m1;\r\n\t\t\t\t\tm2b = m1b;\r\n\t\t\t\t\tm2a = m1a;\r\n\t\t\t\t\tm1 = dif;\r\n\t\t\t\t\tm1a = a[e[j]];\r\n\t\t\t\t\tm1b = b[e[j]];\r\n\t\t\t\t} else if (dif < m2) {\r\n\t\t\t\t\tm2 = dif;\r\n\t\t\t\t\tm2a = a[e[j]];\r\n\t\t\t\t\tm2b = b[e[j]];\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tsa += a[e[j]];\r\n\t\t\t\tsb += a[e[j]];\r\n\t\t\t\tcd[cnt][0] = a[e[j]];\r\n\t\t\t\tcd[cnt][1] = b[e[j]];\r\n\t\t\t\tcd[cnt][2] = b[e[j]] - a[e[j]];\r\n\t\t\t\tcnt++;\r\n\t\t\t}\r\n\t\t\tj = next[j];\r\n\t\t}\r\n\t\tif (cnt == 0) {\r\n\t\t\ta[i] = 1;\r\n\t\t\tb[i] = 0;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tArrays.sort(cd, new Comparator<int[]>() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic int compare(int[] o1, int[] o2) {\r\n\t\t\t\t// TODO Auto-generated method stub\t\t\t\t\r\n\t\t\t\treturn o1[2] - o2[2];\r\n\t\t\t}\r\n\t\t});\r\n\t\ta[i] = delAll + 1;\r\n\t\t//leave 0 or 2\r\n\t\tint cost1 = 0;\r\n\t\tint cost = 0;\r\n\t\tfor (j = 2; j < cnt; j++)\r\n\t\t\tcost1 += cd[j][0];\r\n\t\tif (cnt >= 2) {\r\n\t\t\tcost += m1b + m2b + sa - m1a - m2a;\r\n\t\t\tcost1 += cd[0][1] + cd[1][1];\r\n\t\t} else {\r\n\t\t\tcost += sa;\r\n\t\t\tcost1 += cd[0][0];\r\n\t\t}\r\n\t\tif (cost1 != cost)\r\n\t\t\tSystem.err.println(\"FUCK\");\r\n\t\tb[i] = cost;\r\n\t}", "private void d() {\n Queue<c> queue;\n Queue<c> queue2 = queue = i;\n synchronized (queue2) {\n long l2 = System.currentTimeMillis();\n Iterator iterator = i.iterator();\n while (iterator.hasNext()) {\n if (l2 - ((c)iterator.next()).a < 60000L) continue;\n iterator.remove();\n }\n if (i.size() >= 15) {\n for (int i2 = 0; i2 < 5; ++i2) {\n i.remove();\n }\n }\n return;\n }\n }", "public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\n\t\tint a[] = {2,1,3,-4,-2};\n\t\t//int a[] = {1 ,2, 3, 7, 5};\n\t\tboolean found = false;\n\t\t\n\t\t//this will solve in o n^2\n\t\tfor(int i = 0 ; i < a.length ; i++){\n\t\t\tint sum = 0;\n\t\t\tfor(int j = i ; j< a.length ; j++){\n\t\t\t\tsum += a[j] ;\n\t\t\t\tif(sum == 0){\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tif(found)\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t\n\t\t// link : https://www.youtube.com/watch?v=PSpuM9cimxA&list=PLKKfKV1b9e8ps6dD3QA5KFfHdiWj9cB1s&index=49\n\t\tSystem.out.println(found + \" found\");\n\t\tfound = false;\n\t\t//solving with O of N with the help sets\n\t\t// x + 0 = y\n\t\tSet<Integer> set = new HashSet<>();\n\t\tint sum = 0;\n\t\tfor(int element : a){\n\t\t\tset.add(sum);\n\t\t\tsum += element;\n\t\t\tif(set.contains(sum)){\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\tSystem.out.println(set);\n\t\t\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t\tfound = false;\n\t\t// when the sum of subarray is K\n\t\t\n\t\t//solving with O of N with the help sets\n\t\t//x + k = y >>>\n\t\tSet<Integer> set1 = new HashSet<>();\n\t\tint k = 12;\n\t\tint summ = 0;\n\t\tfor(int element : a){\n\t\t\tset1.add(summ);\n\t\t\tsumm += element;\n\t\t\tif(set1.contains(summ - k)){ // y - k = x(alredy presnt or not)\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(set1);\n\t\tSystem.out.println();\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t}", "public static long journeyToMoon(int n, List<List<Integer>> astronaut) {\n // Write your code here\n Map<Integer, Node<Integer>> countryMap = new HashMap<>();\n for(List<Integer> pairs: astronaut) {\n Node<Integer> node1 = countryMap.computeIfAbsent(pairs.get(0), Node::new);\n Node<Integer> node2 = countryMap.computeIfAbsent(pairs.get(1), Node::new);\n node1.connected.add(node2);\n node2.connected.add(node1);\n }\n\n List<Integer> countryCluster = new ArrayList<>();\n for(Node<Integer> node: countryMap.values()) {\n if(node.connected.size() == 0) {\n countryCluster.add(1);\n } else if(!node.visited){\n countryCluster.add(getNodeCount3(node));\n }\n }\n List<Integer> countryNodes = countryMap.values().stream().map(nn -> nn.value).collect(Collectors.toList());\n List<Integer> missingNodes = new ArrayList<>();\n for(int i=0; i < n; i++) {\n if(!countryNodes.contains(i))\n missingNodes.add(i);\n }\n\n for(int i=0; i < missingNodes.size(); i++) {\n countryCluster.add(1);\n }\n\n long ans = 0;\n //For one country we cannot pair with any other astronauts\n if(countryCluster.size() >= 2) {\n ans = (long) countryCluster.get(0) * countryCluster.get(1);\n if(countryCluster.size() > 2) {\n int sum = countryCluster.get(0) + countryCluster.get(1);\n for(int i=2; i < countryCluster.size(); i++) {\n ans += (long) sum * countryCluster.get(i);\n sum += countryCluster.get(i);\n }\n }\n }\n\n /*\n permutation of two set with size A and B = AxB\n permutation of three set with size A,B,C = AxB + AxC + BxC = AxB + (A+B)xC\n permutation of four set with size A,B,C,D = AxB + AxC + AxD + BxC + BxD + CxD = AxB + (A+B)xC + (A+B+C)xD\n */\n /*\n if(keys.length == 1) {\n ans = keys[0].size();\n } else {\n ans = keys[0].size() * keys[1].size();\n if(keys.length > 2) {\n int sum = keys[0].size() + keys[1].size();\n for (int i = 2; i < keys.length; i++) {\n ans += sum * keys[i].size();\n sum += keys[i].size();\n }\n }\n }\n */\n return ans;\n }", "private int d(amj paramamj)\r\n/* 50: */ {\r\n/* 51: 70 */ for (int i = 0; i < this.a.length; i++) {\r\n/* 52: 71 */ if ((this.a[i] != null) && (this.a[i].b() == paramamj.b()) && (this.a[i].d()) && (this.a[i].b < this.a[i].c()) && (this.a[i].b < p_()) && ((!this.a[i].f()) || (this.a[i].i() == paramamj.i())) && (amj.a(this.a[i], paramamj))) {\r\n/* 53: 72 */ return i;\r\n/* 54: */ }\r\n/* 55: */ }\r\n/* 56: 75 */ return -1;\r\n/* 57: */ }", "private static int lucas_cost(int n, double v) {\r\n\t\tint c, d, e, r;\r\n\r\n\t\td = n;\r\n\t\tr = (int) ((double) d / v + 0.5);\r\n\t\tif (r >= n)\r\n\t\t\treturn (ADD * n);\r\n\t\td = n - r;\r\n\t\te = 2 * r - n;\r\n\t\tc = DUP + ADD; /* initial duplicate and final addition */\r\n\t\twhile (d != e) {\r\n\t\t\tif (d < e) {\r\n\t\t\t\tr = d;\r\n\t\t\t\td = e;\r\n\t\t\t\te = r;\r\n\t\t\t}\r\n\t\t\tif (4 * d <= 5 * e && ((d + e) % 3) == 0) { /* condition 1 */\r\n\t\t\t\tr = (2 * d - e) / 3;\r\n\t\t\t\te = (2 * e - d) / 3;\r\n\t\t\t\td = r;\r\n\t\t\t\tc += 3 * ADD; /* 3 additions */\r\n\t\t\t} else if (4 * d <= 5 * e && (d - e) % 6 == 0) { /* condition 2 */\r\n\t\t\t\td = (d - e) / 2;\r\n\t\t\t\tc += ADD + DUP; /* one addition, one duplicate */\r\n\t\t\t} else if (d <= (4 * e)) { /* condition 3 */\r\n\t\t\t\td -= e;\r\n\t\t\t\tc += ADD; /* one addition */\r\n\t\t\t} else if ((d + e) % 2 == 0) { /* condition 4 */\r\n\t\t\t\td = (d - e) / 2;\r\n\t\t\t\tc += ADD + DUP; /* one addition, one duplicate */\r\n\t\t\t} else if (d % 2 == 0) { /* condition 5 */\r\n\t\t\t\td /= 2;\r\n\t\t\t\tc += ADD + DUP; /* one addition, one duplicate */\r\n\t\t\t} else if (d % 3 == 0) { /* condition 6 */\r\n\t\t\t\td = d / 3 - e;\r\n\t\t\t\tc += 3 * ADD + DUP; /* three additions, one duplicate */\r\n\t\t\t} else if ((d + e) % 3 == 0) { /* condition 7 */\r\n\t\t\t\td = (d - 2 * e) / 3;\r\n\t\t\t\tc += 3 * ADD + DUP; /* three additions, one duplicate */\r\n\t\t\t} else if ((d - e) % 3 == 0) { /* condition 8 */\r\n\t\t\t\td = (d - e) / 3;\r\n\t\t\t\tc += 3 * ADD + DUP; /* three additions, one duplicate */\r\n\t\t\t} else if (e % 2 == 0) { /* condition 9 */\r\n\t\t\t\te /= 2;\r\n\t\t\t\tc += ADD + DUP; /* one addition, one duplicate */\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn (c);\r\n\t}", "public static void main(String args[] ) throws Exception {\n String l[] = br.readLine().split(\" \");\n long N = Long.parseLong(l[0]);\n long S = Long.parseLong(l[1]);\n long E = Long.parseLong(l[2]);\n TreeMap<Long,Long> t1 = new TreeMap<Long,Long>();\n TreeMap<Long,Long> t2 = new TreeMap<Long,Long>();\n for(int i=0;i<N;i++) {\n String s[] = br.readLine().split(\" \");\n long x = Long.parseLong(s[0]);\n long p = Long.parseLong(s[1]);\n t1.put((x-p),(x+p));\n }\n ArrayList<Long> l1 = new ArrayList<Long>(t1.keySet());\n ArrayList<Long> l2 = new ArrayList<Long>(t1.values());\n long c = l1.get(0);\n long d = l2.get(0);\n for(int i=1;i<t1.size();i++)\n {\n if(l1.get(i)<=d)\n d = Math.max(d,l2.get(i));\n else\n {\n \n t2.put(c,d);\n c = l1.get(i);\n d = l2.get(i);\n }\n \n }\n t2.put(c,d);\n int i;\n long ans = 0;\n l1=new ArrayList<Long>(t2.keySet());\n l2=new ArrayList<Long>(t2.values());\n \n \n for(i=0;i<l1.size();i++)\n {\n if(S>=E)\n {\n S=E;\n break;\n }\n if(l1.get(i)<=S && S<=l2.get(i))\n S = l2.get(i);\n \n else if(S<=l1.get(i) && E>=l2.get(i))\n {\n ans+=l1.get(i)-S;\n S = l2.get(i);\n \n }\n else if(S<=l1.get(i) && E>=l1.get(i) && E<=l2.get(i))\n {\n ans+=l1.get(i)-S;\n S = E;\n }\n else if(S<=l1.get(i) && E<=l1.get(i))\n {\n ans+=E-S;\n S = E;\n }\n }\n if(S<E)\n ans+=E-S;\n pw.println(ans);\n \n pw.close();\n }", "public static void fourSum(int[] data){\n HashMap<Integer,Pair> set = new HashMap<>();//integer = sum, pair are the nums\n for(int i = 0; i < data.length; i++)\n for(int j = i+1; j < data.length; j++) {\n Pair check = set.get(i+j);\n if(check != null) {\n System.out.println(\"fauifa\");\n return;\n }\n set.put(check.a()+check.b(), check);\n }\n System.out.println(\"None found.\");\n }", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int q = sc.nextInt();\n\n for(int k = 0; k < q; k++) {\n int m = sc.nextInt();\n int n = sc.nextInt();\n\n // indicate number of pieces\n long x = 1;\n long y = 1;\n \n ArrayList<Long> c_y = new ArrayList<Long>();\n for(int i = 0; i < m - 1; i++) {\n c_y.add(sc.nextLong());\n }\n \n ArrayList<Long> c_x = new ArrayList<Long>();\n for(int i = 0; i < n - 1; i++) {\n c_x.add(sc.nextLong());\n }\n\n Collections.sort(c_y, Collections.reverseOrder());\n Collections.sort(c_x, Collections.reverseOrder());\n\n // cut: most expensive = cut first\n int index_X = 0;\n int index_Y = 0;\n long totalCost = 0;\n\n while(!(x == n && y == m)) {\n if(x < n && y < m) {\n // compare cost to decide whether cut horizontally or vertically\n if(c_y.get(index_Y) >= c_x.get(index_X)) {\n totalCost += c_y.get(index_Y) * x;\n y++;\n index_Y++;\n } else if(c_y.get(index_Y) < c_x.get(index_X)) {\n totalCost += c_x.get(index_X) * y;\n x++;\n index_X++; \n }\n } else if(x == n && y < m) {\n totalCost += c_y.get(index_Y) * x;\n index_Y++;\n y++;\n } else if(x < n && y == m) {\n totalCost += c_x.get(index_X) * y;\n index_X++;\n x++;\n }\n }\n\n totalCost = totalCost % (long)(Math.pow(10, 9) + 7);\n System.out.println(totalCost );\n }\n }", "private static int[] greedyAssign(double[][] array, int[] assignment, int chunk_size) {\n\n\t\tint[] jToi = new int[chunk_size];\n\t\tArrays.fill(assignment, -1);\n\t\tArrays.fill(jToi, -1);\n\t\tfor (int i=0; i<edge_size; i++){\n\t\t\tHeapNode node = (HeapNode) edges[i];\n\t\t\tif (assignment[node.getI()]==-1 && jToi[node.getJ()]==-1){\n\t\t\t\tassignment[node.getI()]=node.getJ();\n\t\t\t\tjToi[node.getJ()]=node.getI();\n\t\t\t}\n\t\t}\n\t\t//long backtrace_start = System.currentTimeMillis();\n\t\tfor (int index = 0; index<chunk_size; index++){\n\t\t\tboolean swap_done = false;\n\t\t\tif (assignment[index]==-1){\n\t\t\t\tSystem.out.println(index);\n\t\t\t\tfor (int step=1; step<chunk_size/2; step++){\n\t\t\t\t\tint possible_i = (chunk_size+index-step)%chunk_size;\n\t\t\t\t\tint possible_j = assignment[possible_i];\n\t\t\t\t\tif (possible_j != -1){\n\t\t\t\t\t\tif (array[index][possible_j]!=BIG){\n\t\t\t\t\t\t\tfor (int l=0; l<chunk_size; l++){\n\t\t\t\t\t\t\t\tif (jToi[l]==-1 && array[possible_i][l]!=BIG){\n\t\t\t\t\t\t\t\t\tassignment[index]=possible_j;\n\t\t\t\t\t\t\t\t\tassignment[possible_i]=l;\n\t\t\t\t\t\t\t\t\tjToi[l]=possible_i;\n\t\t\t\t\t\t\t\t\tjToi[possible_j]=index;\n\t\t\t\t\t\t\t\t\tswap_done = true;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/*for (int step2 = 1; step2<chunk_size/2; step2++){\n\t\t\t\t\t\t\t int l = (chunk_size+possible_j-step2)%chunk_size;\n\n\t\t\t\t\t\t\t if (jToi[l]==-1 && array[possible_i][l]!=BIG){\n\t\t\t\t\t\t\t assignment[index]=possible_j;\n\t\t\t\t\t\t\t assignment[possible_i]=l;\n\t\t\t\t\t\t\t jToi[l]=possible_i;\n\t\t\t\t\t\t\t jToi[possible_j]=index;\n\t\t\t\t\t\t\t swap_done = true;\n\t\t\t\t\t\t\t break;\n\t\t\t\t\t\t\t }\n\n\t\t\t\t\t\t\t l=(possible_j+step2)%chunk_size;\n\t\t\t\t\t\t\t if (jToi[l]==-1 && array[possible_i][l]!=BIG){\n\t\t\t\t\t\t\t assignment[index]=possible_j;\n\t\t\t\t\t\t\t assignment[possible_i]=l;\n\t\t\t\t\t\t\t jToi[l]=possible_i;\n\t\t\t\t\t\t\t jToi[possible_j]=index;\n\t\t\t\t\t\t\t swap_done = true;\n\t\t\t\t\t\t\t break;\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t }\t*/\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (swap_done)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\telse {\n\t\t\t\t\t\tpossible_i = (index+step)%chunk_size;\n\t\t\t\t\t\tpossible_j = assignment[possible_i];\n\t\t\t\t\t\tif (possible_j != -1){\n\t\t\t\t\t\t\tif (array[index][possible_j]!=BIG){\n\t\t\t\t\t\t\t\tfor (int l=0; l<chunk_size; l++){\n\t\t\t\t\t\t\t\t\tif (jToi[l]==-1 && array[possible_i][l]!=BIG){\n\t\t\t\t\t\t\t\t\t\tassignment[index]=possible_j;\n\t\t\t\t\t\t\t\t\t\tassignment[possible_i]=l;\n\t\t\t\t\t\t\t\t\t\tjToi[l]=possible_i;\n\t\t\t\t\t\t\t\t\t\tjToi[possible_j]=index;\n\t\t\t\t\t\t\t\t\t\tswap_done = true;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/*for (int step2 = 1; step2<chunk_size/2; step2++){\n\t\t\t\t\t\t\t\t int l = (chunk_size+possible_j-step2)%chunk_size;\n\n\t\t\t\t\t\t\t\t if (jToi[l]==-1 && array[possible_i][l]!=BIG){\n\t\t\t\t\t\t\t\t assignment[index]=possible_j;\n\t\t\t\t\t\t\t\t assignment[possible_i]=l;\n\t\t\t\t\t\t\t\t jToi[l]=possible_i;\n\t\t\t\t\t\t\t\t jToi[possible_j]=index;\n\t\t\t\t\t\t\t\t swap_done = true;\n\t\t\t\t\t\t\t\t break;\n\t\t\t\t\t\t\t\t }\n\n\t\t\t\t\t\t\t\t l=(possible_j+step2)%chunk_size;\n\t\t\t\t\t\t\t\t if (jToi[l]==-1 && array[possible_i][l]!=BIG){\n\t\t\t\t\t\t\t\t assignment[index]=possible_j;\n\t\t\t\t\t\t\t\t assignment[possible_i]=l;\n\t\t\t\t\t\t\t\t jToi[l]=possible_i;\n\t\t\t\t\t\t\t\t jToi[possible_j]=index;\n\t\t\t\t\t\t\t\t swap_done = true;\n\t\t\t\t\t\t\t\t break;\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t }*/\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (swap_done)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn assignment;\n\t}", "protected static int m34121a(int i, long j, List<C22441c> list) {\n C22441c c22441c;\n AppMethodBeat.m2504i(114774);\n Object obj = 1;\n while (i < sJS.size()) {\n try {\n Object obj2;\n c22441c = (C22441c) sJS.get(i);\n if (obj == null || c22441c.endTime <= j) {\n list.add(c22441c);\n obj2 = obj;\n } else {\n C22441c c22441c2 = new C22441c();\n c22441c2.sJY = c22441c.sJY;\n c22441c2.startTime = j;\n c22441c2.endTime = c22441c.endTime;\n list.add(c22441c2);\n obj2 = null;\n }\n i++;\n obj = obj2;\n } catch (Exception e) {\n AppMethodBeat.m2505o(114774);\n return -1;\n }\n }\n if (list.size() == 0) {\n c22441c = new C22441c();\n c22441c.sJY = sJQ;\n c22441c.startTime = j;\n c22441c.endTime = System.currentTimeMillis();\n list.add(c22441c);\n } else {\n c22441c = new C22441c();\n c22441c.sJY = sJQ;\n c22441c.startTime = sJP.startTime;\n c22441c.endTime = System.currentTimeMillis();\n list.add(c22441c);\n }\n int size = sJS.size();\n AppMethodBeat.m2505o(114774);\n return size;\n }", "private void method_259(int[] var1, int[] var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9, int var10, int var11, int var12, int var13, int var14, int var15) {\n boolean var28 = field_759;\n int var19 = var12 >> 16 & 255;\n int var20 = var12 >> 8 & 255;\n int var21 = var12 & 255;\n\n try {\n int var22 = var4;\n int var23 = -var8;\n if(var28 || var23 < 0) {\n do {\n int var24 = (var5 >> 16) * var11;\n int var25 = var13 >> 16;\n int var26 = var7;\n int var27;\n if(var25 < this.field_745) {\n var27 = this.field_745 - var25;\n var26 = var7 - var27;\n var25 = this.field_745;\n var4 += var9 * var27;\n }\n\n if(var25 + var26 >= this.field_746) {\n var27 = var25 + var26 - this.field_746;\n var26 -= var27;\n }\n\n var15 = 1 - var15;\n if(var15 != 0) {\n var27 = var25;\n if(var28 || var25 < var25 + var26) {\n do {\n var3 = var2[(var4 >> 16) + var24];\n if(var3 != 0) {\n label33: {\n int var16 = var3 >> 16 & 255;\n int var17 = var3 >> 8 & 255;\n int var18 = var3 & 255;\n if(var16 == var17 && var17 == var18) {\n var1[var27 + var6] = (var16 * var19 >> 8 << 16) + (var17 * var20 >> 8 << 8) + (var18 * var21 >> 8);\n if(!var28) {\n break label33;\n }\n }\n\n var1[var27 + var6] = var3;\n }\n }\n\n var4 += var9;\n ++var27;\n } while(var27 < var25 + var26);\n }\n }\n\n var5 += var10;\n var4 = var22;\n var6 += this.field_723;\n var13 += var14;\n ++var23;\n } while(var23 < 0);\n\n }\n } catch (Exception var29) {\n System.out.println(\"error in transparent sprite plot routine\"); // authentic System.out.println\n }\n }", "public static int distinctPaths4(int n) {\n\t\tint[][] mem = new int[n+1][n+1];\n\t\tfor(int j = 1; j <= n; ++j) {\n\t\t\tmem[1][j] = 1;\n\t\t\tmem[j][1] = 1;\n\t\t}\n\t\tfor(int i = 2; i <= n; ++i) {\n\t\t\tfor(int j = 2; j <= n; ++j) {\n\t\t\t\tmem[i][j] = mem[i-1][j] + mem[i][j-1];\n\t\t\t}\n\t\t}\n\t\treturn mem[n][n];\n\t}", "void solve() {\n num = new ArrayList<>();\n num.add(BigInteger.valueOf(4));\n for (int len = 2; len <= 100; len++)\n generate(\"4\", 1, len, false);\n Collections.sort(num);\n for (int tc = ii(); tc > 0; tc--) {\n long x = il();\n BigInteger X = BigInteger.valueOf(x);\n for (int i = 0; i < num.size(); i++) {\n if (num.get(i).mod(X).equals(BigInteger.ZERO)) {\n String z = num.get(i).toString();\n int end = z.lastIndexOf('4');\n int len = z.length();\n int a = 2 * (end+1);\n int b = len - end;\n out.println(a + b);\n break;\n }\n }\n }\n }", "public List<List<Integer>> threeSum(int[] nums) {\n List<List<Integer>> result = new ArrayList<>(nums.length);\n\n // Prepare\n Arrays.sort(nums);\n// int firstPositiveIndex = 0;\n// int negativeLength = 0;\n// List<Integer> numsFiltered = new ArrayList<>();\n// for (int i = 0; i < nums.length; i++) {\n// if (i == 0 || i == 1 || nums[i] == 0 || (nums[i] != nums[i-2])) {\n// numsFiltered.add(nums[i]);\n// if ((nums[i] >= 0) && (firstPositiveIndex == 0)) {\n// firstPositiveIndex = numsFiltered.size() - 1;\n// }\n// if ((nums[i] <= 0)) {\n// negativeLength = numsFiltered.size();\n// }\n// }\n// }\n// nums = numsFiltered.stream().mapToInt(i->i).toArray();\n\n // Func\n\n for(int i=0; (i < nums.length) && (nums[i] <= 0); i++) {\n if (i != 0 && nums[i] == nums[i-1]) {\n continue;\n }\n for(int j=i+1; j<nums.length; j++) {\n if (j != i+1 && nums[j] == nums[j-1]) {\n continue;\n }\n for(int k=nums.length-1; (k>j) && nums[k] >= 0; k--) {\n if (k != nums.length-1 && nums[k] == nums[k+1]) {\n continue;\n }\n int sum = nums[i]+nums[j]+nums[k];\n if (sum > 0) {\n continue;\n } else if (sum < 0) {\n break;\n }\n\n List<Integer> ok = new ArrayList<>();\n ok.add(nums[i]);\n ok.add(nums[j]);\n ok.add(nums[k]);\n result.add(ok);\n break;\n }\n }\n }\n\n// System.out.println(\"Finish time = \" + (System.nanoTime() - start) / 1_000_000);\n// System.out.println(\"result size = \" + result.size());\n\n return result;\n }", "public void n()\r\n/* 515: */ {\r\n/* 516:523 */ for (int i = 0; i < this.a.length; i++) {\r\n/* 517:524 */ if (this.a[i] != null)\r\n/* 518: */ {\r\n/* 519:525 */ this.d.a(this.a[i], true, false);\r\n/* 520:526 */ this.a[i] = null;\r\n/* 521: */ }\r\n/* 522: */ }\r\n/* 523:529 */ for (i = 0; i < this.b.length; i++) {\r\n/* 524:530 */ if (this.b[i] != null)\r\n/* 525: */ {\r\n/* 526:531 */ this.d.a(this.b[i], true, false);\r\n/* 527:532 */ this.b[i] = null;\r\n/* 528: */ }\r\n/* 529: */ }\r\n/* 530: */ }", "public static int f1(int N) {\n int x = 0; //O(1)\n for(int i = 0; i < N; i++) // O(n) \n x++; \n return x; \n \n }", "private static void task3(int nUMS, BinarySearchTree<Integer> t) {\n\t\t\n\t\t long start = System.nanoTime();\n\t\t System.out.println( \"Deletion in the table...\" );\n\t\t int count=0;\n\t\t\tfor( int i = 1; i <= nUMS; i++)\n\t\t\t{\n\t\t\t\tif(t.isEmpty() == false)\n\t\t\t\t{\n\t\t\t\t\n\t\t\t\tt.remove(i);\n\t\t\t\t\n\t\t\t\t}\n//\t\t\t\tSystem.out.println(GenerateInt.generateNumber());\n\n\t\t\t}\n\t\t\tSystem.out.println(\"Total Size \" + count);\n\t\t\tSystem.out.println(\"Is it empty \" + t.isEmpty());\n\t\t\tlong end = System.nanoTime();;\n\t\t\tlong elapsedTime = end - start;\n\t\t\tSystem.out.println(elapsedTime + \" NanoSeconds\");\n\t\t\tSystem.out.println(\"Average Time \" + elapsedTime/nUMS);\n\t\t \n\t\t }", "private void step4(Node node) {\n\t\tHashMap<String, ArrayList<String>> svn = node.svN;\r\n\t\tHashMap<String, ArrayList<String>> cn = node.cN;\r\n\t\tArrayList<String> keys = node.keysN;\r\n\t\tString c = checksubset(cn);\r\n\r\n\t\tif (c != null) {\r\n\t\t\tfor (int i = 0; i < keys.size(); i++) {\r\n\t\t\t\tif (svn.get(keys.get(i)).contains(c)) {\r\n\t\t\t\t\tsvn.get(keys.get(i)).remove(c);\r\n\t\t\t\t\tif (svn.get(keys.get(i)).size() <= 1) {\r\n\t\t\t\t\t\tsvn.remove(keys.get(i));\r\n\t\t\t\t\t\tkeys.remove(i);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcn.remove(c);\r\n\t\t}\r\n\t}", "public List<List<Integer>> fourSum_1(int[] nums, int target) \n {\n \tList<List<Integer>> result = new ArrayList<List<Integer>>();\n \tif(nums==null || nums.length<4) return result;\n \tArrays.sort(nums);\n \tfor(int i=0; i<nums.length-3; i++)\n \t{\n \t\tif(i!=0 && nums[i]==nums[i-1]) continue;\n \t\t//if(nums[i]>target) break; \n \t\t//Revisit!!! Why you cannot do this break here\n \t\tfor(int j=i+1; j<nums.length-2;j++)\n \t\t{\n \t\t\tif(j!=(i+1) && nums[j]==nums[j-1]) continue;\n \t\t\tint cur = nums[i]+nums[j];\n \t\t\t//if(cur>target) break;\n \t\t\t//Revisit!!! Why you cannot do this break here\n \t\t\t\n \t\t\tint k=j+1;\n \t\t\tint l = nums.length-1;\n \t\t\twhile(k<l)\n \t\t\t{\n \t\t\t\tif((cur+nums[k]+nums[l])==target)\n \t\t\t\t{\n \t\t\t\t\tList<Integer> newRes = new ArrayList<Integer>();\n \t\t\t\t\tnewRes.add(nums[i]);\n \t\t\t\t\tnewRes.add(nums[j]);\n \t\t\t\t\tnewRes.add(nums[k]);\n \t\t\t\t\tnewRes.add(nums[l]);\n \t\t\t\t\tresult.add(newRes);\n \t\t\t\t\tk++;\n \t\t\t\t\tl--;\n \t\t\t\t\twhile(k<l && nums[k]==nums[k-1]) k++;\n \t\t\t\t\twhile(k<l && nums[l]==nums[l+1]) l--;\n \t\t\t\t}\n \t\t\t\telse if((cur+nums[k]+nums[l])>target)\n \t\t\t\t{\n \t\t\t\t\tl--;\n \t\t\t\t\twhile(k<l && nums[l]==nums[l+1]) l--;\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\tk++;\n \t\t\t\t\twhile(k<l && nums[k]==nums[k-1]) k++;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}\n \treturn result;\n }", "public static void main(String[] args) {\n int a[] = {12,11,10,5,6,2,30};\n // smaller greater approach with 3 passes can be used to find total number of triplet subsequences in array \n int smaller[] = new int[a.length];\n int greater[] = new int[a.length];\n \n for(int i=0;i<a.length;i++) {\n smaller[i] = greater[i] = -1;\n }\n // smaller fill up\n int min = a[0];\n for(int i=1;i<a.length;i++) {\n if (a[i] > min) {\n smaller[i] = 1;\n } else if ( a[i] < min) {\n min = a[i];\n }\n }\n \n int max = a[a.length-1];\n for(int i=a.length-2;i>=0;i--) {\n if (a[i] < max) {\n greater[i] = 1;\n } else if ( a[i] > max) {\n max = a[i];\n }\n }\n \n for(int i=1;i<a.length-1;i++) {\n if (smaller[i] == greater[i] && greater[i] == 1) {\n System.out.println(\"Triplet found, mid is at -> \" + i + \" : \" + a[i]);\n }\n }\n System.out.println(\"Do we have increasing triplet ?? \" + increasingTripletOnePass(a));\n }", "public boolean a(amj paramamj)\r\n/* 268: */ {\r\n/* 269:293 */ if ((paramamj == null) || (paramamj.b == 0) || (paramamj.b() == null)) {\r\n/* 270:294 */ return false;\r\n/* 271: */ }\r\n/* 272: */ try\r\n/* 273: */ {\r\n/* 274:298 */ if (!paramamj.g())\r\n/* 275: */ {\r\n/* 276: */ do\r\n/* 277: */ {\r\n/* 278:301 */ i = paramamj.b;\r\n/* 279:302 */ paramamj.b = e(paramamj);\r\n/* 280:303 */ } while ((paramamj.b > 0) && (paramamj.b < i));\r\n/* 281:304 */ if ((paramamj.b == i) && (this.d.by.d))\r\n/* 282: */ {\r\n/* 283:306 */ paramamj.b = 0;\r\n/* 284:307 */ return true;\r\n/* 285: */ }\r\n/* 286:309 */ return paramamj.b < i;\r\n/* 287: */ }\r\n/* 288:312 */ int i = j();\r\n/* 289:313 */ if (i >= 0)\r\n/* 290: */ {\r\n/* 291:314 */ this.a[i] = amj.b(paramamj);\r\n/* 292:315 */ this.a[i].c = 5;\r\n/* 293:316 */ paramamj.b = 0;\r\n/* 294:317 */ return true;\r\n/* 295: */ }\r\n/* 296:318 */ if (this.d.by.d)\r\n/* 297: */ {\r\n/* 298:320 */ paramamj.b = 0;\r\n/* 299:321 */ return true;\r\n/* 300: */ }\r\n/* 301:323 */ return false;\r\n/* 302: */ }\r\n/* 303: */ catch (Throwable localThrowable)\r\n/* 304: */ {\r\n/* 305:325 */ b localb = b.a(localThrowable, \"Adding item to inventory\");\r\n/* 306:326 */ j localj = localb.a(\"Item being added\");\r\n/* 307: */ \r\n/* 308:328 */ localj.a(\"Item ID\", Integer.valueOf(alq.b(paramamj.b())));\r\n/* 309:329 */ localj.a(\"Item data\", Integer.valueOf(paramamj.i()));\r\n/* 310:330 */ localj.a(\"Item name\", new ahc(this, paramamj));\r\n/* 311: */ \r\n/* 312: */ \r\n/* 313: */ \r\n/* 314: */ \r\n/* 315: */ \r\n/* 316: */ \r\n/* 317:337 */ throw new u(localb);\r\n/* 318: */ }\r\n/* 319: */ }", "private int d(@Nullable K ☃) {\r\n/* 127 */ return (xq.f(System.identityHashCode(☃)) & Integer.MAX_VALUE) % this.b.length;\r\n/* */ }\r\n/* */ private int b(@Nullable K ☃, int i) {\r\n/* */ int j;\r\n/* 131 */ for (j = i; j < this.b.length; j++) {\r\n/* 132 */ if (this.b[j] == ☃) {\r\n/* 133 */ return j;\r\n/* */ }\r\n/* 135 */ if (this.b[j] == a) {\r\n/* 136 */ return -1;\r\n/* */ }\r\n/* */ }", "public static void main(String[] args) {\n\n long a_i3 = 3;\n long a_i2 = 4;\n long a_i1 = 10;\n\n int MOD = 1000_000_000 + 7;\n\n for (int i = 4; i < 30; i++) {\n long a_i = (a_i1 + 2 * a_i2 + 4 * a_i3) % MOD;\n System.out.println(\"N: \" + i + \" --> \" + a_i);\n\n a_i3 = a_i2;\n a_i2 = a_i1;\n a_i1 = a_i;\n }\n\n old1();\n }", "public static void main(String[] args) {\n\t\tArrayList<Integer> primelist = sieve(7071);\n\t\tArrayList<Double> second = new ArrayList<Double>();\n\t\tfor(int one : primelist) \n\t\t\tsecond.add(Math.pow(one, 2));\n\t\tArrayList<Double> third = new ArrayList<Double>();\n\t\tprimelist = sieve(368);\n\t\tfor(int one : primelist)\n\t\t\tthird.add(Math.pow(one, 3));\n\t\tArrayList<Double> fourth = new ArrayList<Double>();\n\t\tprimelist = sieve(84);\n\t\tfor(int one : primelist)\n\t\t\tfourth.add(Math.pow(one, 4));\n\n\t\tArrayList<Double> possibilities = new ArrayList<Double>();\n\t\tfor (int k = fourth.size() - 1; k >=0 ; k--) {\n\t\t\tfor (int j = 0; j < third.size(); j++) {\n\t\t\t\tdouble sum = fourth.get(k) + third.get(j);\n\t\t\t\tif (sum > 50000000)\n\t\t\t\t\tbreak;\n\t\t\t\telse {\n\t\t\t\t\tfor (int i = 0; i < second.size(); i++) {\n\t\t\t\t\t\tdouble nextsum = sum + second.get(i);\n\t\t\t\t\t\tif (nextsum > 50000000)\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// I am not sure whether it can be proved that the sum is unique.\n\t\t\t\t\t\t\tif (!possibilities.contains(nextsum))\n\t\t\t\t\t\t\t\tpossibilities.add(nextsum);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tint totalcount = possibilities.size();\n\t\tSystem.out.println(totalcount);\n\t}", "static double sol4(int[] a,int[] b){\r\n \tint mid1=0,mid2= 0;\r\n \tif((a.length+b.length)%2==0) {\r\n \t\tmid1 = (a.length+b.length)/2 -1;\r\n \t\tmid2 = mid1 + 1;\r\n \t\t}else {\r\n \t\t\tmid1 = mid2 = (a.length+b.length)/2;\r\n \t\t}\r\n \t\tint[] ab = new int[a.length+b.length];\r\n \t\tint i=0,j=0,count=0;\r\n\t\twhile (i<a.length && j<b.length){\r\n\t\t\tif (a[i]<b[j]){ \r\n\t\t\t\tab[count++]=a[i++];\r\n\t\t\t}else{\r\n\t\t\t\tab[count++]=b[j++];\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (i==a.length){\r\n\t\t\twhile (j<b.length){\r\n\t\t\t\tab[count++]=b[j++];\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\twhile (i<a.length){\r\n\t\t\t\tab[count++]=a[i++];\r\n\t\t\t}\r\n\t\t}\r\n\t\t//for (int n =0; n< ab.length;n++){\r\n\t\t//\tSystem.out.println(ab[n]);\r\n\t\t//}\r\n\t\tdouble ans = -1;\r\n\t\tif (mid1 == mid2){\r\n\t\t\tans = (double) ab[mid1];\r\n\t\t\treturn ans;\r\n\t\t}\r\n\t\tans = (double) (ab[mid1]+ab[mid2])/2;\r\n\t\treturn ans;\r\n\r\n }", "public static void threeSumForFourSum(int[] nums, int target, int low, int high, ArrayList<List<Integer>> fourSumList,\n int z1) {\n if (low + 1 >= high)\n return;\n\n int max = nums[high];\n if (3 * nums[low] > target || 3 * max < target)\n return;\n\n int i, z;\n for (i = low; i < high - 1; i++) {\n z = nums[i];\n if (i > low && z == nums[i - 1]) // avoid duplicate\n continue;\n if (z + 2 * max < target) // z is too small\n continue;\n\n if (3 * z > target) // z is too large\n break;\n\n if (3 * z == target) { // z is the boundary\n if (i + 1 < high && nums[i + 2] == z)\n fourSumList.add(Arrays.asList(z1, z, z, z));\n break;\n }\n\n twoSumForFourSum(nums, target - z, i + 1, high, fourSumList, z1, z);\n }\n\n}", "public static void main(String[] args) throws Exception {\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n int t = Integer.parseInt(in.readLine());int j=0,k=0; int res1=0, res2=0; \n for(int p=0;p<t;p++){\n int m = Integer.parseInt(in.readLine());\n int n = Integer.parseInt(in.readLine());\n String[] str=in.readLine().split(\" \");\n int[] num = new int[n];\n for(int i=0;i<n;i++){\n num[i] = Integer.parseInt(str[i]);\n }\n for(j=0;j<n;j++){\n for(k=j+1;k<n;k++){\n \tint tmp = num[j]+num[k];\n if(m==tmp){res1=j+1;res2=k+1; break;}\n }\n }\n System.out.println(res1+\" \"+res2);\n j=0;k=0;\n }\n }", "public static void main(String[] args) throws IOException {\n BufferedReader bufferedReader = new BufferedReader(new FileReader(UFTest.class.getResource(\"/\").getPath()+\"1.5/largeUF.txt\"));\n String str = bufferedReader.readLine();\n UFLJWQU uf = new UFLJWQU(Integer.parseInt(str));\n long beginTime =System.currentTimeMillis();\n while ((str = bufferedReader.readLine())!=null){\n String[] array = str.split(\" \");\n int p = Integer.parseInt(array[0]);\n int q = Integer.parseInt(array[1]);\n if(uf.connected(p,q)) continue;\n uf.union(p,q);\n// System.out.println(p+\" -- \"+q);\n }\n System.out.println(uf.count());\n System.out.println(\"cost time :\"+(System.currentTimeMillis() - beginTime));\n }", "public abstract void mo4363a(int i, long j);", "public static void main(String[] args) {\n\n\t\tint a = 10000;\n\t\tint num = 325489;\n\t\tint [][] lst = new int[a][a];\n\t\tint x = a/4, y = a/4;\n\t\tfinal int x0 = x,y0 = y;\n\t\tint layer = 0,cnt =1;\n\t\twhile (cnt <= num)\n\t\t{\n\t\t\tif (cnt == (2*layer+1)*(2*layer+1))\n\t\t\t{\n\t\t\t\tlst[x][y] = cnt;\n\t\t\t\ty++;\n\t\t\t\tlayer++;\n\t\t\t\tcnt++;\n\t\t\t}\n\t\t\tfor (int j = 0 ; j < layer*2-1;j++)\n\t\t\t{\n\t\t\t\tlst[x][y] = cnt;\n\t\t\t\tx++;\n\t\t\t\tcnt++;\n\t\t\t}\n\t\t\tfor (int j = 0 ; j < layer * 2;j++)\n\t\t\t{\n\t\t\t\tlst[x][y] = cnt;\n\t\t\t\ty--;\n\t\t\t\tcnt++;\n\t\t\t}\n\t\t\tfor (int j = 0 ; j < layer * 2;j++)\n\t\t\t{\n\t\t\t\tlst[x][y] = cnt;\n\t\t\t\tx--;\n\t\t\t\tcnt++;\n\t\t\t}\n\t\t\tfor (int j = 0 ; j < layer * 2;j++)\n\t\t\t{\n\t\t\t\tlst[x][y] = cnt;\n\t\t\t\ty++;\n\t\t\t\tcnt++;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tint finalX = findx(lst,num);\n\t\tint finalY = findy(lst,num);\n\t\tSystem.out.println(Math.abs(finalY - y) + (finalX - x));\n\t}", "public static void main(String args[] ) throws Exception {\n Scanner scanner = new Scanner(System.in);\n int n = scanner.nextInt();\n int[] seqArray = new int[n];\n for (int i = 0; i < n; i++) {\n seqArray[i] = scanner.nextInt();\n }\n // getSeqValue(seqArray); //this method is an accepted one on Hackerrank but time complexity is not order n; i.e. !O(n);\n getLinearOrderY(seqArray); // trying to get O(n) time complexity;\n }", "private static int benchmarkedMethod() {\n return 3;\n }", "public int a(alq paramalq, int paramInt1, int paramInt2, fn paramfn)\r\n/* 120: */ {\r\n/* 121:137 */ int i = 0;\r\n/* 122: */ amj localamj;\r\n/* 123: */ int k;\r\n/* 124:138 */ for (int j = 0; j < this.a.length; j++)\r\n/* 125: */ {\r\n/* 126:139 */ localamj = this.a[j];\r\n/* 127:140 */ if (localamj != null) {\r\n/* 128:143 */ if ((paramalq == null) || (localamj.b() == paramalq)) {\r\n/* 129:146 */ if ((paramInt1 <= -1) || (localamj.i() == paramInt1)) {\r\n/* 130:149 */ if ((paramfn == null) || (cy.a(paramfn, localamj.o(), true)))\r\n/* 131: */ {\r\n/* 132:153 */ k = paramInt2 <= 0 ? localamj.b : Math.min(paramInt2 - i, localamj.b);\r\n/* 133:154 */ i += k;\r\n/* 134:155 */ if (paramInt2 != 0)\r\n/* 135: */ {\r\n/* 136:156 */ this.a[j].b -= k;\r\n/* 137:157 */ if (this.a[j].b == 0) {\r\n/* 138:158 */ this.a[j] = null;\r\n/* 139: */ }\r\n/* 140:160 */ if ((paramInt2 > 0) && (i >= paramInt2)) {\r\n/* 141:161 */ return i;\r\n/* 142: */ }\r\n/* 143: */ }\r\n/* 144: */ }\r\n/* 145: */ }\r\n/* 146: */ }\r\n/* 147: */ }\r\n/* 148: */ }\r\n/* 149:165 */ for (j = 0; j < this.b.length; j++)\r\n/* 150: */ {\r\n/* 151:166 */ localamj = this.b[j];\r\n/* 152:167 */ if (localamj != null) {\r\n/* 153:170 */ if ((paramalq == null) || (localamj.b() == paramalq)) {\r\n/* 154:173 */ if ((paramInt1 <= -1) || (localamj.i() == paramInt1)) {\r\n/* 155:176 */ if ((paramfn == null) || (cy.a(paramfn, localamj.o(), false)))\r\n/* 156: */ {\r\n/* 157:180 */ k = paramInt2 <= 0 ? localamj.b : Math.min(paramInt2 - i, localamj.b);\r\n/* 158:181 */ i += k;\r\n/* 159:182 */ if (paramInt2 != 0)\r\n/* 160: */ {\r\n/* 161:183 */ this.b[j].b -= k;\r\n/* 162:184 */ if (this.b[j].b == 0) {\r\n/* 163:185 */ this.b[j] = null;\r\n/* 164: */ }\r\n/* 165:187 */ if ((paramInt2 > 0) && (i >= paramInt2)) {\r\n/* 166:188 */ return i;\r\n/* 167: */ }\r\n/* 168: */ }\r\n/* 169: */ }\r\n/* 170: */ }\r\n/* 171: */ }\r\n/* 172: */ }\r\n/* 173: */ }\r\n/* 174:193 */ if (this.f != null)\r\n/* 175: */ {\r\n/* 176:194 */ if ((paramalq != null) && (this.f.b() != paramalq)) {\r\n/* 177:195 */ return i;\r\n/* 178: */ }\r\n/* 179:197 */ if ((paramInt1 > -1) && (this.f.i() != paramInt1)) {\r\n/* 180:198 */ return i;\r\n/* 181: */ }\r\n/* 182:200 */ if ((paramfn != null) && (!cy.a(paramfn, this.f.o(), false))) {\r\n/* 183:201 */ return i;\r\n/* 184: */ }\r\n/* 185:204 */ j = paramInt2 <= 0 ? this.f.b : Math.min(paramInt2 - i, this.f.b);\r\n/* 186:205 */ i += j;\r\n/* 187:206 */ if (paramInt2 != 0)\r\n/* 188: */ {\r\n/* 189:207 */ this.f.b -= j;\r\n/* 190:208 */ if (this.f.b == 0) {\r\n/* 191:209 */ this.f = null;\r\n/* 192: */ }\r\n/* 193:211 */ if ((paramInt2 > 0) && (i >= paramInt2)) {\r\n/* 194:212 */ return i;\r\n/* 195: */ }\r\n/* 196: */ }\r\n/* 197: */ }\r\n/* 198:217 */ return i;\r\n/* 199: */ }", "static int[] sol1(int[]a, int n){\r\n\t\tMap <Integer,Integer> map= new HashMap();\r\n\t\tfor (int i = 0; i< a.length; i++){\r\n\t\t\tmap.put(a[i],i);\r\n\t\t}\r\n\t\tArrays.sort(a);\r\n\t\tint i = 0; \r\n\t\tint j = a.length -1;\r\n\t\twhile (i <= j){\r\n\t\t\tif(a[i]+a[j]>n) j--;\r\n\t\t\telse if (a[i]+a[j]<n) i++;\r\n\t\t\telse break;\r\n\t\t}\r\n\t\tint[] ans= {map.get(a[i]),map.get(a[j])};\r\n\t\treturn ans;\r\n\t}", "public static ArrayList<ArrayList<Integer>> fourSum(ArrayList<Integer> a, int k) {\n Collections.sort(a);\n System.out.println(a);\n LinkedHashMap<Integer, List<List<Integer>>> m = new LinkedHashMap<Integer, List<List<Integer>>>();\n for (int i = 0; i <= a.size() - 3; i++) {\n for (int j = i + 1; j <= a.size() - 2; j++) {\n if (m.get(a.get(i) + a.get(j)) == null) {\n ArrayList<List<Integer>> v = new ArrayList<List<Integer>>();\n List<Integer> c = new ArrayList<Integer>();\n c.add(i);\n c.add(j);\n v.add(c);\n m.put(a.get(i) + a.get(j), v);\n } else {\n List<List<Integer>> v = m.get(a.get(i) + a.get(j));\n List<Integer> c = new ArrayList<Integer>();\n c.add(i);\n c.add(j);\n v.add(c);\n m.put(a.get(i) + a.get(j), v);\n }\n\n }\n }\n LinkedHashSet<ArrayList<Integer>> res = new LinkedHashSet<ArrayList<Integer>>();\n for (int i = 2; i <= a.size() - 1; i++) {\n for (int j = i + 1; j < a.size(); j++) {\n List<List<Integer>> v = m.get(k - (a.get(i) + a.get(j)));\n if (v != null && v.size() >= 1) {\n for (List<Integer> l : v) {\n\n if (l.get(0) < l.get(1) && l.get(1) < i && l.get(1) < j) {\n //System.out.println(l.get(0) + \" \" + l.get(1) + \" \" + i + \" \" + j);\n ArrayList<Integer> out = new ArrayList<Integer>();\n out.add(a.get(l.get(0)));\n out.add(a.get(l.get(1)));\n out.add(a.get(i));\n out.add(a.get(j));\n Collections.sort(out);\n //System.out.println(out);\n res.add(out);\n }\n }\n }\n }\n }\n return new ArrayList<ArrayList<Integer>>(res);\n }", "public static void main(String[] args) {\n\t\tint a[]= {15,3,7,1,9,2};\n\t\tsubarraysum(a,11);//Time complexity O(n^2) space O(1)\n\n\t\tsubarraysum_reducecomplexity(a,11,a.length); //Time complexity O(n) space O(1)\n\n\t}", "void h(List<List<Integer>> r, List<Integer> t, int n, int s){ \n for(int i = s; i*i <= n; i++){\n if(n % i != 0) continue; \n t.add(i);\n t.add(n / i);\n r.add(new ArrayList<>(t));\n t.remove(t.size() - 1);\n h(r, t, n/i, i);\n t.remove(t.size() - 1);\n }\n }", "private int hashFunc2(String word) {\n int hashVal = word.hashCode();\n hashVal = hashVal % arraySize;\n\n if (hashVal < 0) {\n hashVal += arraySize;\n }\n\n // Research shows that you can use a Prime number Less than the array size to calculate the step value.\n // Prime Number 3 arbitrarily chosen.\n return 3 - hashVal % 3;\n }", "private void method_247(int[] var1, int[] var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9, int var10) {\n boolean var15 = field_759;\n int var11 = -(var6 >> 2);\n var6 = -(var6 & 3);\n int var12 = -var7;\n if(var15 || var12 < 0) {\n do {\n int var13 = var11;\n int var14;\n if(!var15 && var11 >= 0) {\n var14 = var6;\n if(var15 || var6 < 0) {\n do {\n label89: {\n var3 = var2[var4++];\n if(var3 != 0) {\n var1[var5++] = var3;\n if(!var15) {\n break label89;\n }\n }\n\n ++var5;\n }\n\n ++var14;\n } while(var14 < 0);\n\n var5 += var8;\n var4 += var9;\n var12 += var10;\n } else {\n var5 += var8;\n var4 += var9;\n var12 += var10;\n }\n } else {\n do {\n label69: {\n var3 = var2[var4++];\n if(var3 != 0) {\n var1[var5++] = var3;\n if(!var15) {\n break label69;\n }\n }\n\n ++var5;\n }\n\n label63: {\n var3 = var2[var4++];\n if(var3 != 0) {\n var1[var5++] = var3;\n if(!var15) {\n break label63;\n }\n }\n\n ++var5;\n }\n\n label57: {\n var3 = var2[var4++];\n if(var3 != 0) {\n var1[var5++] = var3;\n if(!var15) {\n break label57;\n }\n }\n\n ++var5;\n }\n\n label51: {\n var3 = var2[var4++];\n if(var3 != 0) {\n var1[var5++] = var3;\n if(!var15) {\n break label51;\n }\n }\n\n ++var5;\n }\n\n ++var13;\n } while(var13 < 0);\n\n var14 = var6;\n if(var15 || var6 < 0) {\n do {\n label34: {\n var3 = var2[var4++];\n if(var3 != 0) {\n var1[var5++] = var3;\n if(!var15) {\n break label34;\n }\n }\n\n ++var5;\n }\n\n ++var14;\n } while(var14 < 0);\n\n var5 += var8;\n var4 += var9;\n var12 += var10;\n } else {\n var5 += var8;\n var4 += var9;\n var12 += var10;\n }\n }\n } while(var12 < 0);\n\n }\n }", "public static void main(String[] args) {\n\t\tint[] w = { 1, 4, 3 };\n\t\tint[] val = { 1500, 3000, 2000 };\n\t\tint m = 4;\n\t\tint n = val.length;\n\t\tint[][] v = new int[n + 1][m + 1];\n\t\tint[][] path = new int[n + 1][m + 1];\n\t\tfor (int i = 0; i < v.length; i++) {\n\t\t\tv[i][0] = 0;\n\t\t}\n\t\tfor (int i = 0; i < v[0].length; i++) {\n\t\t\tv[0][i] = 0;\n\t\t}\n\t\tfor (int i = 0; i < v.length; i++) {\n\t\t\tfor (int j = 0; j < v[i].length; j++) {\n\t\t\t\tSystem.out.print(v[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tfor (int i = 1; i < v.length; i++) {\n\t\t\tfor (int j = 1; j < v[i].length; j++) {\n\t\t\t\tif(w[i-1]>j) {\n\t\t\t\t\tv[i][j]=v[i-1][j];\n\t\t\t\t}else {\n\t\t\t\t\tif(v[i-1][j]<val[i-1]+v[i-1][j-w[i-1]]) {\n\t\t\t\t\t\tv[i][j]=val[i-1]+v[i-1][j-w[i-1]];\n\t\t\t\t\t\tpath[i][j]=1;\n\t\t\t\t\t}else {\n\t\t\t\t\t\tv[i][j]=v[i-1][j];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (int[] i:v) {\n\t\t\tSystem.out.println(Arrays.toString(i));\n\t\t}\n\t}", "private static int distance(ArrayList<Integer>[] adj, ArrayList<Integer>[] cost, int s, int t) {\n\n Set<Integer> visited = new HashSet<>(); //option 1\n Map<Integer, Integer> distance = new HashMap<>();\n// Queue<Integer> q = new PriorityQueue<>(11, (o1, o2) -> { //option 0\n// Integer d1 = distance.get(o1); //option 0\n// Integer d2 = distance.get(o2); //option 0\n Queue<Map.Entry<Integer, Integer>> q = new PriorityQueue<>(11, (o1, o2) -> { //option 1\n Integer d1 = o1.getValue(); //option 1\n Integer d2 = o2.getValue(); //option 1\n\n if (Objects.equals(d1, d2)) return 0;\n if (d1 == null) return 1;\n if (d2 == null) return -1;\n\n return d1 - d2;\n });\n\n distance.put(s, 0);\n// q.addAll(IntStream.range(0, adj.length).boxed().collect(Collectors.toList())); //option 0\n q.add(new AbstractMap.SimpleImmutableEntry<>(s, 0)); //option 1\n\n while (!q.isEmpty()) {\n// int u = q.remove(); //option 0\n int u = q.remove().getKey(); //option 1\n\n if (u == t) {\n Integer dist = distance.get(u);\n if (dist == null) return -1;\n return dist;\n }\n\n if (visited.contains(u)) continue; //option 1\n visited.add(u); //option 1\n\n List<Integer> adjList = adj[u];\n List<Integer> costList = cost[u];\n for (int i = 0; i < adjList.size(); i++) {\n int v = adjList.get(i);\n int w = costList.get(i);\n Integer dist = distance.get(v);\n Integer newDist = distance.get(u);\n if (newDist != null) newDist += w;\n\n if (newDist != null && (dist == null || dist > newDist)) {\n //relax\n distance.put(v, newDist);\n// q.remove(v); //option 0\n// q.add(v); //option 0\n q.add(new AbstractMap.SimpleImmutableEntry<>(v, distance.get(v))); //option 1\n }\n }\n }\n\n return -1;\n }", "@Override\r\n\tpublic int challengeFour(int[][] arr) {\n\t\treturn 0;\r\n\t}", "private static void fourSorts(int[] array) {\n\t\tStopWatch1 timer;\n\t\tint[] temp;\n\t\t//Performs insertion sort\n\t\ttimer = new StopWatch1();\n\t\ttemp = copyArray(array);\n\t\ttimer.start();\n\t\tSort.insertionSort(temp);\n\t\ttimer.stop();\n\t\tSystem.out.printf(\"%10d\",timer.getElapsedTime());\n\n\n\t\t//Performs selection sort\n\t\ttimer = new StopWatch1();\n\t\ttemp = copyArray(array);\n\t\ttimer.start();\n\t\tSort.selectionSort(temp);\n\t\ttimer.stop();\n\t\tSystem.out.printf(\"%10d\",timer.getElapsedTime());\n\n\t\t//Performs quick sort\n\t\ttimer = new StopWatch1();\n\t\ttemp = copyArray(array);\n\t\ttimer.start();\n\t\tSort.quickSort(temp);\n\t\ttimer.stop();\n\t\tSystem.out.printf(\"%10d\",timer.getElapsedTime());\n\n\t\t//Performs merge sort\n\t\ttimer = new StopWatch1();\n\t\ttemp = copyArray(array);\n\t\ttimer.start();\n\t\tSort.mergeSort(temp);\n\t\ttimer.stop();\n\t\tSystem.out.printf(\"%10d\",timer.getElapsedTime());\n\n\t}", "public static void main(String[] args) {\n\t\tScanner scn = new Scanner(System.in);\n\t\tint t = scn.nextInt();\n\t\tfor(int i = 0; i<t; i++) {\n\t\t\tn = scn.nextInt();\n\t\t\tdistance = 0;\n\t\t\tdistancesum = 0;\n\t\t\tlist = new LinkedList[n+3];\n\t\t\tfor(int j = 1; j<=n+2; j++) {\n\t\t\t\tlist[j] = new LinkedList<>();\n\t\t\t}\n\t\t\tlist[1].add(scn.nextInt());\n\t\t\tlist[1].add(scn.nextInt());\n\t\t\tlist[n+2].add(scn.nextInt());\n\t\t\tlist[n+2].add(scn.nextInt());\n\t\t\t\n\t\t\tfor(int j = 2; j<n+2; j++) {\n\t\t\t\tlist[j].add(scn.nextInt());\n\t\t\t\tlist[j].add(scn.nextInt());\n\t\t\t}\n\t\t\t\n\t\t\tvisited = new boolean[n+2];\n\t\t\tcnt = 0;\n\t\t\tmin = 10000;\n\t\t\tfindLoot(list,2);\n\t\t\tSystem.out.println(\"#\"+(i+1)+\" \"+min);\n\t\t}\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint arr[] = new int[n];\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tarr[i] = sc.nextInt();\n\t\t}\n\t\tint sum = sc.nextInt();\n\t\tHashMap<Integer,Integer> map = new HashMap<>();\n \t\tArrays.sort(arr);\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tint temp = arr[i];\n\t\t\tint reqSum = sum-temp;\n\t\t\tarr[i]=0;\n\t\t\tint l=0;\n\t\t\tint r = n-1;\n\t\t\twhile(l<r) {\n\t\t\t\t//System.out.println(\"l \" + l + \" r \" + r + \" i = \"+ i);\n\t\t\t\tif(arr[l] + arr[r]==reqSum && arr[l]!=0 && arr[r]!=0 ) {\n\t\t\t\t\tint arr2[] = new int[3];\n\t\t\t\t\tarr2[0] = temp;\n\t\t\t\t\tarr2[1] = arr[l];\n\t\t\t\t\tarr2[2] = arr[r];\n\t\t\t\t\tif(map.containsKey(arr2[0]) || map.containsKey(arr2[1]) || map.containsKey(arr2[2])) {\n\t\t\t\t\t\t\n\t\t\t\t\t}else {\n\t\t\t\t\t\tArrays.sort(arr2);\n\t\t\t\t\t\tSystem.out.println(arr2[0] + \" \" + arr2[1] + \" \" + arr2[2]);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tl++;\n\t\t\t\t}else if(arr[l] + arr[r] < reqSum) {\n\t\t\t\t\tl++;\n\t\t\t\t\t\n\t\t\t\t}else {\n\t\t\t\t\tr--;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tarr[i] = temp;\t\n\t\t\tmap.put(arr[i], 1);\n\t\t}\n\t}", "@Test\n\tpublic void intersection() {\n\n\t\tlong n = 105;\n\t\tlong m = 100;\n\t\tfor(long i = n - 1; i > 1; i--){\n\t\t\tn = n * i;\n\t\t\tfor(long j = getZero(n); j > 0; j--){\n\t\t\t\tm = m * 10;\n\t\t\t}\n\t\t\tn = n % m;\n\t\t\tm = 100;\n\n\t\t\tSystem.out.println(n+\" \"+i);\n\n\t\t}\n\n\n\n\n\n\t}", "private void four1(double data[], int nn, int isign) {\r\n int n,mmax,m,j,istep,i;\r\n double wtemp,wr,wpr,wpi,wi,theta;\r\n double tempr,tempi;\r\n double swap;\r\n\r\n n=2*nn;\r\n j=1;\r\n for (i=1;i<n;i+=2) {\r\n if (j > i) {\r\n swap=data[j];\r\n data[j]=data[i];\r\n data[i]=swap;\r\n\r\n swap=data[j+1];\r\n data[j+1]=data[i+1];\r\n data[i+1]=swap;\r\n }\r\n m=n >> 1;\r\n while (m >= 2 && j > m) {\r\n j -= m;\r\n m >>= 1;\r\n }\r\n j += m;\r\n }\r\n mmax=2;\r\n while (n > mmax) {\r\n istep=2*mmax;\r\n theta=isign*(6.28318530717959/mmax);\r\n wtemp=Math.sin(0.5*theta);\r\n wpr = -2.0*wtemp*wtemp;\r\n wpi=Math.sin(theta);\r\n wr=1.0;\r\n wi=0.0;\r\n for (m=1;m<mmax;m+=2) {\r\n for (i=m;i<=n;i+=istep) {\r\n j=i+mmax;\r\n tempr=wr*data[j]-wi*data[j+1];\r\n tempi=wr*data[j+1]+wi*data[j];\r\n data[j]=data[i]-tempr;\r\n data[j+1]=data[i+1]-tempi;\r\n data[i] += tempr;\r\n data[i+1] += tempi;\r\n }\r\n wr=(wtemp=wr)*wpr-wi*wpi+wr;\r\n wi=wi*wpr+wtemp*wpi+wi;\r\n }\r\n mmax=istep;\r\n }\r\n }", "public static void main(String[] args) {\n\t\tint[] prime= new int[1229]; //only need primes up to 10000\n\t\tint n=1;\n\t\tint index=0;\n\t\tint test=0;\n\t\tfor (int i=2; (i-n)<=1229; i++) {\n\t\t\tfor (int j=2; j<=Math.sqrt(i); j++) {\n\t\t\t\tint k=i%j;\n\t\t\t\tif (k==0) {\n\t\t\t\t\tn++;\n\t\t\t\t\ttest++;\n\t\t\t\t\tj=(int)Math.sqrt(i);\n\t\t\t\t} \n\t\t\t}\n\t\t\tif (test==0) {\n\t\t\t\tprime[index]=i;\n\t\t\t\tindex++;\n\t\t\t}\n\t\t\ttest=0;\n\t\t}\n\t\t\n\t\t//use primes to find prime factorization and sum of divisors\n\t\tint [] divides= new int[1229]; //Number of times each prime divides a number\n\t\tint [] sumOfDivisors= new int[10000]; //Sum of divisors for i at index i\n\t\tint total=0;\n\t\tint sum=1;\n\t\tindex=1;\n\t\tfor (int i=2; i<=10000; i++) {\n\t\t\tint d=i;\n\t\t\tfor (int j=0; j<1229; j++) { //find prime factorization for i\n\t\t\t\twhile (d%prime[j]==0 && d>1) {\n\t\t\t\t\td=d/prime[j];\n\t\t\t\t\tdivides[j]++;\n\t\t\t\t}\t\n\t\t\t}\n\t\t\tfor (int j=0; j<1229; j++) { //use Number theory formula for sum of divisors\n\t\t\t\tsum*=(Math.pow(prime[j], divides[j]+1)-1)/(prime[j]-1);\n\t\t\t}\n\t\t\tif (sum-i<i) { //only check if sum of divisors of i is less than i\n\t\t\t\tif (sumOfDivisors[sum-i-1]==i) { //check if amicable pair\n\t\t\t\t\ttotal=total+i+sum-i; //add both to total (only happens once)\n\t\t\t\t}\n\t\t\t}\n\t\t\tArrays.fill(divides,0); //reset divisors array\n\t\t\tsumOfDivisors[index]=sum-i; //store number of divisors\n\t\t\tsum=1;\n\t\t\tindex++;\n\t\t}\n\t\tSystem.out.print(\"The sum of all amicable numbers less than 10000 is: \");\n\t\tSystem.out.println(total);\n long endTime = System.currentTimeMillis();\n System.out.println(\"It took \" + (endTime - startTime) + \" milliseconds.\");\n\n\t}", "private static int insertOrdered(char[] paramArrayOfChar, int paramInt1, int paramInt2, int paramInt3, char paramChar1, char paramChar2, int paramInt4)\n/* */ {\n/* 656 */ int n = paramInt4;\n/* */ \n/* 658 */ if ((paramInt1 < paramInt2) && (paramInt4 != 0)) {\n/* */ int i;\n/* 660 */ int j = i = paramInt2;\n/* 661 */ PrevArgs localPrevArgs = new PrevArgs(null);\n/* 662 */ localPrevArgs.current = paramInt2;\n/* 663 */ localPrevArgs.start = paramInt1;\n/* 664 */ localPrevArgs.src = paramArrayOfChar;\n/* */ \n/* 666 */ int m = getPrevCC(localPrevArgs);\n/* 667 */ j = localPrevArgs.current;\n/* */ \n/* 669 */ if (paramInt4 < m)\n/* */ {\n/* 671 */ n = m;\n/* 672 */ i = j;\n/* 673 */ while (paramInt1 < j) {\n/* 674 */ m = getPrevCC(localPrevArgs);\n/* 675 */ j = localPrevArgs.current;\n/* 676 */ if (paramInt4 >= m) {\n/* */ break;\n/* */ }\n/* 679 */ i = j;\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 690 */ int k = paramInt3;\n/* */ do {\n/* 692 */ paramArrayOfChar[(--k)] = paramArrayOfChar[(--paramInt2)];\n/* 693 */ } while (i != paramInt2);\n/* */ }\n/* */ }\n/* */ \n/* */ \n/* 698 */ paramArrayOfChar[paramInt2] = paramChar1;\n/* 699 */ if (paramChar2 != 0) {\n/* 700 */ paramArrayOfChar[(paramInt2 + 1)] = paramChar2;\n/* */ }\n/* */ \n/* */ \n/* 704 */ return n;\n/* */ }", "private static void reduceMonty(int[] x, int[] m, int mDash) // mDash = -m^(-1) mod b\n {\n\n int n = m.length;\n\n for (int i = n - 1; i >= 0; --i)\n {\n int x0 = x[n - 1];\n\n long t = (x0 * mDash) & IMASK;\n\n long carry = t * (m[n - 1] & IMASK) + (x0 & IMASK);\n// assert (int)carry == 0;\n carry >>>= 32;\n\n for (int j = n - 2; j >= 0; --j)\n {\n carry += t * (m[j] & IMASK) + (x[j] & IMASK);\n x[j + 1] = (int)carry;\n carry >>>= 32;\n }\n\n x[0] = (int)carry;\n// assert carry >>> 32 == 0;\n }\n\n if (compareTo(0, x, 0, m) >= 0)\n {\n subtract(0, x, 0, m);\n }\n }", "public void k()\r\n/* 238: */ {\r\n/* 239:258 */ for (int i = 0; i < this.a.length; i++) {\r\n/* 240:259 */ if (this.a[i] != null) {\r\n/* 241:260 */ this.a[i].a(this.d.o, this.d, i, this.c == i);\r\n/* 242: */ }\r\n/* 243: */ }\r\n/* 244: */ }", "public static boolean checkPath(int[][] bs, int i) {\n ArrayList<Integer> temp_cP = new ArrayList<Integer>();\r\n Set<Integer> temp_setcP = new HashSet<Integer>();\r\n boolean denoter = true;\r\n while (i == 3) {\r\n for (int k = 0; k < i; k++) {\r\n for (int e = 0; e < 3; e++) {\r\n temp_cP.add(e, bs[k][e]);\r\n }\r\n }\r\n temp_setcP = new HashSet<Integer>(temp_cP);\r\n if (temp_cP.size() > temp_setcP.size()) {\r\n denoter = false;\r\n break;\r\n\r\n } else {\r\n temp_cP.clear();\r\n temp_setcP.clear();\r\n\r\n for (int k = 0; k < i; k++) {\r\n for (int e = 3; e < 6; e++) {\r\n temp_cP.add(bs[k][e]);\r\n }\r\n }\r\n temp_setcP = new HashSet<Integer>(temp_cP);\r\n if (temp_cP.size() > temp_setcP.size()) {\r\n denoter = false;\r\n break;\r\n\r\n } else {\r\n break;\r\n }\r\n }\r\n }\r\n while (i == 6) {\r\n\r\n for (int k = 3; k < i; k++) {\r\n for (int e = 0; e < 3; e++) {\r\n temp_cP.add(e, bs[k][e]);\r\n }\r\n }\r\n temp_setcP = new HashSet<Integer>(temp_cP);\r\n if (temp_cP.size() > temp_setcP.size()) {\r\n denoter = false;\r\n break;\r\n\r\n } else {\r\n temp_cP.clear();\r\n temp_setcP.clear();\r\n\r\n for (int k = 3; k < i; k++) {\r\n for (int e = 3; e < 6; e++) {\r\n temp_cP.add(bs[k][e]);\r\n }\r\n }\r\n temp_setcP = new HashSet<Integer>(temp_cP);\r\n if (temp_cP.size() > temp_setcP.size()) {\r\n denoter = false;\r\n break;\r\n\r\n } else {\r\n break;\r\n }\r\n }\r\n\r\n }\r\n return denoter;\r\n }", "@Override\r\n public long problem1(int size) {\r\n StringBuilder sb = new StringBuilder();\r\n long start = System.currentTimeMillis();\r\n for (int i=0; i<size; i++) {\r\n sb.append(i);\r\n }\r\n long end = System.currentTimeMillis();\r\n return end - start;\r\n }", "public static void main(String[] args) \n\t{\n\t \n\t\tlong startTimer = System.currentTimeMillis();\n\t\t//mrethod 1\n\t\tint res=Utility.binarySearchWord();\n\t\tif(res==-1)\n\t\t\tSystem.out.println(\"your word not found\");\n\t\t else\n\t\t System.out.println(\"your word found at index:\"+res);\n\t\tlong first=System.currentTimeMillis();\n\t\tSystem.out.println((first-startTimer)/1000+\"seconds\");\n\t \n\t\t//method 2\n\t\tint res1=Utility.binarySearchForInteger();\n\t\tif(res1==-1)\n\t\t\tSystem.out.println(\"your no. not found\");\n\t\t else\n\t\t System.out.println(\"your no.found at index:\"+res1);\n\t\tlong second=System.currentTimeMillis();\n\t\tSystem.out.println((second-first)/1000+\"seconds\");\n\t\t\n\t\t//method 3\n\t\tint res3[]=Utility.bubbleSortForIntegers();\n\t\tfor(int i=0;i<res3.length;i++)\n\t\t\tSystem.out.println(res3[i]);\n\t\tlong third=System.currentTimeMillis();\n\t\tSystem.out.println((third-second)/1000+\"seconds\");\n\t\t\n\t\t//method 4\n\t\tString res4[]=Utility.bubbleSortForStrings();\n\t\tfor(int i=0;i<res4.length;i++)\n\t\t\tSystem.out.println(res4[i]);\n\t\tlong fourth=System.currentTimeMillis();\n\t\tSystem.out.println((fourth-third)/1000+\"seconds\");\n\t\t\n\t\t//method 5\n\t\tint res5[]=Utility.insertionSortForInteger();\n\t\tfor(int i=0;i<res5.length;i++)\n\t\t\tSystem.out.println(res5[i]);\n\t\tlong fifth=System.currentTimeMillis();\n\t\tSystem.out.println((fifth-fourth)/1000+\"seconds\");\n\t\t\n\t\t//method 6\n\t\tString res6[]=Utility.insertionSortForString();\n\t\tfor(int i=0;i<res6.length;i++)\n\t\t\tSystem.out.println(res6[i]);\n\t\tlong sixth=System.currentTimeMillis();\n\t\tSystem.out.println((sixth-fifth)/1000+\"seconds\");\n\t}", "public static int example3(int[] arr) { // O(n)\r\n\t\tint n = arr.length, total = 0; // O(1)\r\n\t\tfor (int j = 0; j < n; j++) // loop from 0 to n-1 // O(n^2)\r\n\t\t\tfor (int k = 0; k <= j; k++) // loop from 0 to j\r\n\t\t\t\ttotal += arr[j];\r\n\t\treturn total;\r\n\r\n\t\t/*\r\n\t\t * Explanation: Since we have nested for loop which dominates here and it is\r\n\t\t * O(n^2) and we always take the maximum. so the answer is quadratic time O(n^2)\r\n\t\t * \r\n\t\t */\r\n\t}", "public static void main(String[] args) {\n\t\tScanner sc =new Scanner(System.in);\n\t\tBigInteger n=sc.nextBigInteger();\n\t\tBigInteger k=sc.nextBigInteger();\n\t\t\n\t\ttriangle task3=new triangle(n,k);\n\t\tdouble s = System.currentTimeMillis();\n\t\tBigInteger r =task3.recurse(n, k);\n\t\tdouble e = System.currentTimeMillis();\n\t\tdouble totalTime3 = e - s;\n\t\t\n\t\tForkJoinPool pool=new ForkJoinPool(1);\n\t\ttriangle task=new triangle(n,k);\n\t\tdouble shuru = System.currentTimeMillis();\n\t\tBigInteger yo=pool.invoke(task);\n\t\tdouble khatam = System.currentTimeMillis();\n\t\tdouble yolo = khatam - shuru;\n\t\t\n\t\tSystem.out.println(yolo/totalTime3);\n\t\tSystem.out.println(yo);\n\t\t\n\t\tForkJoinPool pooll=new ForkJoinPool(2);\n\t\ttriangle taskk=new triangle(n,k);\n\t\tdouble shuruu = System.currentTimeMillis();\n\t\tBigInteger yoo=pooll.invoke(taskk);\n\t\tdouble khatamm = System.currentTimeMillis();\n\t\tdouble yoloo = khatamm - shuruu;\n\t\t\n\t\tSystem.out.println(yoloo/totalTime3);\n\t\tSystem.out.println(yoo);\n\t\t\n\t\tForkJoinPool poolll=new ForkJoinPool(3);\n\t\ttriangle taskkk=new triangle(n,k);\n\t\tdouble shuruuu = System.currentTimeMillis();\n\t\tBigInteger yooo=poolll.invoke(taskkk);\n\t\tdouble khatammm = System.currentTimeMillis();\n\t\tdouble yolooo = khatammm - shuruuu;\n\t\t\n\t\tSystem.out.println(yolooo/totalTime3);\n\t\tSystem.out.println(yooo);\n\t\t\n\t\tSystem.out.println(\"Ratio of time for 2nd by 1st Thread pool-\");\n\t\tSystem.out.println(yoloo/yolo);\n\t\t\n\t\tSystem.out.println(\"Ratio of time for 3rd by 1st Thread pool-\");\n\t\tSystem.out.println(yolooo/yolo);\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tint A[]= new int[100000000];\n\t\tfor(int i = 0; i < 100000000; i++) {\n\t\t A[i] = (int)(Math.random() * 100) + 1;\n }\n double duration = 0;\n long end = 0;\n long start = 0;\n start = System.currentTimeMillis();\n System.out.println(start);\n MinValueIndex(A, 6);\n end = System.currentTimeMillis();\n\t\tduration = end-start;\n\t\tSystem.out.println(end); \n\t\tduration = duration / 5;\n\t\tSystem.out.println(duration);\n\t}", "void mo54409a(int i, int i2, int i3, long j);", "int compFunction(int code) {\n return Math.abs(((3 * code + 8) % largePrime) % buckets.length);\n }", "private static void task03333(int nUMS, SplayTree<Integer> j) {\n\n\t\tlong start = System.nanoTime();\n\t System.out.println( \"Deletion in the table...\" );\n\t int count=0;\n\t\tfor( int i = 1; i <= nUMS; i++)\n\t\t{\n\t\t\tif(j.isEmpty() == false)\n\t\t\t{\n\t\t\t\n\t\t\tj.remove(i);\n\t\t\t\n\t\t\t}\n//\t\t\tSystem.out.println(GenerateInt.generateNumber());\n\n\t\t}\n\t\tSystem.out.println(\"Total Size \" + count);\n\t\tSystem.out.println(\"Is it empty \" + j.isEmpty());\n\t\tlong end = System.nanoTime();;\n\t\tlong elapsedTime = end - start;\n\t\tSystem.out.println(elapsedTime + \" NanoSeconds\");\n\t\tSystem.out.println(\"Average Time \" + elapsedTime/nUMS);\n\t}", "public static void main(String[] args) {\n \tlong[] fact = new long[MAXDOMINOES+1];\r\n \tfact[0] = 1;\r\n \tfor (int i=1; i<=MAXDOMINOES; i++)\r\n \t\tfact[i] = (fact[i-1]*i)%MOD;\r\n\r\n Scanner stdin = new Scanner(System.in);\r\n int numCases = stdin.nextInt();\r\n\r\n // Process each case.\r\n for (int loop=0; loop<numCases; loop++) {\r\n\r\n // Read in this case.\r\n n = stdin.nextInt();\r\n list = new int[n][2];\r\n for (int i=0; i<n; i++)\r\n for (int j=0; j<2; j++)\r\n list[i][j] = stdin.nextInt();\r\n\r\n // Special case - if all the dominoes are the same, all orderings work.\r\n if (same(list)) {\r\n \tSystem.out.println(fact[n]);\r\n \tcontinue;\r\n }\r\n\r\n // dp[mask][last][orientation] will store the number of permutations using the dominoes indicated by\r\n // mask, with the last domino last facing in the direction dictated by orientation. If orientation is 0,\r\n // this is the original input orientation, if it is 1, it's flipped.\r\n long[][][] dp = new long[1<<n][n][2];\r\n\r\n // Always 1 way to place one domino in a fixed orientation.\r\n for (int i=0; i<n; i++) {\r\n dp[1<<i][i][0] = 1;\r\n dp[1<<i][i][1] = 1;\r\n }\r\n\r\n // Outer DP loop, solve all problem instances for each subset of dominoes.\r\n for (int mask=3; mask<(1<<n); mask++) {\r\n\r\n // Now, try each domino as the last domino in mask.\r\n for (int last=0; last<n; last++) {\r\n\r\n // Not a valid state.\r\n if ((mask&(1<<last)) == 0) continue;\r\n\r\n int prevmask = mask - (1<<last);\r\n\r\n for (int i=0; i<n; i++) {\r\n\r\n if ((prevmask&(1<<i)) == 0) continue;\r\n\r\n // Both i and last are in regular orientation.\r\n if (list[i][1] == list[last][0])\r\n dp[mask][last][0] = (dp[mask][last][0]+dp[prevmask][i][0])%MOD;\r\n\r\n // Here i is flipped and last is regular.\r\n else if (list[i][0] == list[last][0])\r\n dp[mask][last][0] = (dp[mask][last][0]+dp[prevmask][i][1])%MOD;\r\n\r\n // i is regular but last is flipped.\r\n if (list[i][1] == list[last][1])\r\n dp[mask][last][1] = (dp[mask][last][1]+dp[prevmask][i][0])%MOD;\r\n\r\n // Both i and last are flipped.\r\n else if (list[i][0] == list[last][1])\r\n dp[mask][last][1] = (dp[mask][last][1]+dp[prevmask][i][1])%MOD;\r\n }\r\n } // end last loop\r\n } // end mask loop\r\n\r\n // Sum up result - all ways to place all dominoes over all possible last dominoes in either orientation.\r\n // Since we screened out our special case, no over-counting will occur here.\r\n long res = 0L;\r\n for (int last=0; last<n; last++) {\r\n \tres = (res + dp[(1<<n)-1][last][0])%MOD;\r\n \tif (list[last][0] != list[last][1])\r\n \t\tres = (res + dp[(1<<n)-1][last][1])%MOD;\r\n }\r\n System.out.println(res);\r\n }\r\n }", "static int[] OnepassSol1(int[]a, int n){\r\n Map<Integer, Integer> map = new HashMap<>();\r\n for (int i = 0; i < a.length; i++) {\r\n int complement = n - a[i];\r\n if (map.containsKey(complement)) {\r\n return new int[] { map.get(complement), i };\r\n }\r\n map.put(a[i], i);\r\n }\r\n int[] ans = {-1,-1};\r\n return ans;\r\n }", "public int fourSumCount(int[] nums1, int[] nums2, int[] nums3, int[] nums4) {\n\n int sum = 0;\n HashMap<Integer, Integer> complementsSum34Count = new HashMap<>();\n\n for (int num3 : nums3) {\n for (int num4 : nums4) {\n int sum34 = num3 + num4;\n if (!complementsSum34Count.containsKey(-sum34)) complementsSum34Count.put(-sum34, 0);\n complementsSum34Count.put(-sum34, complementsSum34Count.get(-sum34) + 1);\n }\n }\n\n for (int num1 : nums1) {\n for (int num2 : nums2) {\n int sum12 = num1 + num2;\n if (complementsSum34Count.containsKey(sum12))\n sum += complementsSum34Count.get(sum12);\n }\n }\n\n return sum;\n }", "void merge_lo(int pa, int na, int pb, int nb) {\n getmem(na);\n System.arraycopy(this.data, pa, this.a, 0, na);\n int dest = pa;\n pa = 0;\n \n this.data[dest++] = this.data[pb++];\n --nb;\n if (nb == 0)\n return;\n if (na == 1) {\n // CopyB;\n System.arraycopy(this.data, pb, this.data, dest, nb);\n this.data[dest + nb] = this.a[pa];\n return;\n }\n \n try {\n for (;;) {\n int acount = 0; /* # of time A won in a row */\n int bcount = 0; /* # of time B won in a row */\n \n /* Do the straightforward thing until (if ever) one run\n * appears to win consistently.\n */\n for (;;) {\n boolean k = iflt(this.data[pb], this.a[pa]);\n if (k) {\n this.data[dest++] = this.data[pb++];\n ++bcount;\n acount = 0;\n --nb;\n if (nb == 0)\n return;\n if (bcount >= MIN_GALLOP)\n break;\n } else {\n this.data[dest++] = this.a[pa++];\n ++acount;\n bcount = 0;\n --na;\n if (na == 1) {\n // CopyB;\n System.arraycopy(this.data, pb, this.data, dest, nb);\n this.data[dest + nb] = this.a[pa];\n na = 0;\n return;\n }\n if (acount >= MIN_GALLOP)\n break;\n }\n }\n \n /* One run is winning so consistently that galloping may\n * be a huge win. So try that, and continue galloping until\n * (if ever) neither run appears to be winning consistently\n * anymore.\n */\n do {\n int k = gallop_right(this.data[pb], this.a, pa, na, 0);\n acount = k;\n if (k != 0) {\n System.arraycopy(this.a, pa, this.data, dest, k);\n dest += k;\n pa += k;\n na -= k;\n if (na == 1) {\n // CopyB\n System.arraycopy(this.data, pb, this.data, dest, nb);\n this.data[dest + nb] = this.a[pa];\n na = 0;\n return;\n }\n /* na==0 is impossible now if the comparison\n * function is consistent, but we can't assume\n * that it is.\n */\n if (na == 0)\n return;\n }\n \n this.data[dest++] = this.data[pb++];\n --nb;\n if (nb == 0)\n return;\n \n k = gallop_left(this.a[pa], this.data, pb, nb, 0);\n bcount = k;\n if (k != 0) {\n System.arraycopy(this.data, pb, this.data, dest, k);\n dest += k;\n pb += k;\n nb -= k;\n if (nb == 0)\n return;\n }\n this.data[dest++] = this.a[pa++];\n --na;\n if (na == 1) {\n // CopyB;\n System.arraycopy(this.data, pb, this.data, dest, nb);\n this.data[dest + nb] = this.a[pa];\n na = 0;\n return;\n }\n } while (acount >= MIN_GALLOP || bcount >= MIN_GALLOP);\n }\n } finally {\n if (na != 0)\n System.arraycopy(this.a, pa, this.data, dest, na);\n \n //dump_data(\"result\", origpa, cnt);\n }\n }", "private static int mergeOrdered(char[] paramArrayOfChar1, int paramInt1, int paramInt2, char[] paramArrayOfChar2, int paramInt3, int paramInt4, boolean paramBoolean)\n/* */ {\n/* 738 */ int k = 0;\n/* */ \n/* */ \n/* 741 */ int m = paramInt2 == paramInt3 ? 1 : 0;\n/* 742 */ NextCCArgs localNextCCArgs = new NextCCArgs(null);\n/* 743 */ localNextCCArgs.source = paramArrayOfChar2;\n/* 744 */ localNextCCArgs.next = paramInt3;\n/* 745 */ localNextCCArgs.limit = paramInt4;\n/* */ \n/* 747 */ if ((paramInt1 != paramInt2) || (!paramBoolean))\n/* */ {\n/* 749 */ while (localNextCCArgs.next < localNextCCArgs.limit) {\n/* 750 */ int j = getNextCC(localNextCCArgs);\n/* 751 */ if (j == 0)\n/* */ {\n/* 753 */ k = 0;\n/* 754 */ if (m != 0) {\n/* 755 */ paramInt2 = localNextCCArgs.next;\n/* */ } else {\n/* 757 */ paramArrayOfChar2[(paramInt2++)] = localNextCCArgs.c;\n/* 758 */ if (localNextCCArgs.c2 != 0) {\n/* 759 */ paramArrayOfChar2[(paramInt2++)] = localNextCCArgs.c2;\n/* */ }\n/* */ }\n/* 762 */ if (paramBoolean) {\n/* */ break;\n/* */ }\n/* 765 */ paramInt1 = paramInt2;\n/* */ }\n/* */ else {\n/* 768 */ int i = paramInt2 + (localNextCCArgs.c2 == 0 ? 1 : 2);\n/* 769 */ k = insertOrdered(paramArrayOfChar1, paramInt1, paramInt2, i, localNextCCArgs.c, localNextCCArgs.c2, j);\n/* */ \n/* 771 */ paramInt2 = i;\n/* */ }\n/* */ }\n/* */ }\n/* */ \n/* 776 */ if (localNextCCArgs.next == localNextCCArgs.limit)\n/* */ {\n/* 778 */ return k;\n/* */ }\n/* 780 */ if (m == 0)\n/* */ {\n/* */ do {\n/* 783 */ paramArrayOfChar1[(paramInt2++)] = paramArrayOfChar2[(localNextCCArgs.next++)];\n/* 784 */ } while (localNextCCArgs.next != localNextCCArgs.limit);\n/* 785 */ localNextCCArgs.limit = paramInt2;\n/* */ }\n/* 787 */ PrevArgs localPrevArgs = new PrevArgs(null);\n/* 788 */ localPrevArgs.src = paramArrayOfChar2;\n/* 789 */ localPrevArgs.start = paramInt1;\n/* 790 */ localPrevArgs.current = localNextCCArgs.limit;\n/* 791 */ return getPrevCC(localPrevArgs);\n/* */ }", "@Override\r\n public long problem2() {\r\n ArrayList<String> arrList = new ArrayList<>();\r\n long start = System.currentTimeMillis(); \r\n for(int i = 0; i<1234567; i++){\r\n arrList.add(Integer.toString(i));\r\n }\r\n long end = System.currentTimeMillis(); \r\n return end - start; \r\n }", "private static void task03(int nUMS, AVLTree<Integer> h) {\n\t\t long start = System.nanoTime();\n\t\t System.out.println( \"Deletion in the table...\" );\n\t\t int count=0;\n\t\t\tfor( int i = 1; i <= nUMS; i++)\n\t\t\t{\n\t\t\t\tif(h.isEmpty() == false)\n\t\t\t\t{\n\t\t\t\t\n\t\t\t\th.remove(i);\n\t\t\t\t\n\t\t\t\t}\n//\t\t\t\tSystem.out.println(GenerateInt.generateNumber());\n\n\t\t\t}\n\t\t\tSystem.out.println(\"Total Size \" + count);\n\t\t\tSystem.out.println(\"Is it empty \" + h.isEmpty());\n\t\t\tlong end = System.nanoTime();;\n\t\t\tlong elapsedTime = end - start;\n\t\t\tSystem.out.println(elapsedTime + \" NanoSeconds\");\n\t\t\tSystem.out.println(\"Average Time \" + elapsedTime/nUMS);\n\n\t\t\n\t}", "public static void twoSumForFourSum(int[] nums, int target, int low, int high, ArrayList<List<Integer>> fourSumList,\n int z1, int z2) {\n\n if (low >= high)\n return;\n\n if (2 * nums[low] > target || 2 * nums[high] < target)\n return;\n\n int i = low, j = high, sum, x;\n while (i < j) {\n sum = nums[i] + nums[j];\n if (sum == target) {\n fourSumList.add(Arrays.asList(z1, z2, nums[i], nums[j]));\n\n x = nums[i];\n while (++i < j && x == nums[i]) // avoid duplicate\n ;\n x = nums[j];\n while (i < --j && x == nums[j]) // avoid duplicate\n ;\n }\n if (sum < target)\n i++;\n if (sum > target)\n j--;\n }\n return;\n}", "public static void main(String[] args){\n int MIN = Integer.parseInt(args[0]);\n MAX = Integer.parseInt(args[1]);\n cutoffs = new int[args.length - 2];\n cache = new ArrayList<IndexedArrayList<SuperSavvyTrieHelper2>>();\n for (int i = 2; i < args.length; i++){\n cutoffs[i - 2] = Integer.parseInt(args[i]);\n cache.add(new IndexedArrayList<SuperSavvyTrieHelper2>());\n }\n for (int i = 0; i < cutoffs.length / 2; i++){\n int temp = cutoffs[i];\n cutoffs[i] = cutoffs[cutoffs.length - 1 - i];\n cutoffs[cutoffs.length - 1 - i] = temp;\n }\n multiplicitiesUsed = new boolean[MAX + 1];\n basesUsed = new DoublyLinkedArray(MAX + 1);\n SuperSavvyTrieHelper2.setCorrespondance(basesUsed);\n /*\n long count1 = lowerRecursion(MAX, 0);\n long count2 = middleRecursion(MAX, 0);\n long count3 = upperRecursion(MAX, 0);\n long total = count1 + count2 + count3;\n System.out.printf(\"%d + %d + %d = %d\\n\", count1, count2, count3, total);\n */\n hitCounts = new long[cutoffs.length];\n missCounts = new long[cutoffs.length];\n statCollector = new StatCollector(cutoffs);\n\n long startTime = System.nanoTime();\n long[] values = new long[MAX - MIN + 1];\n for (int i = MIN; i <= MAX; i++) {\n values[i - MIN] = upperRecursionWrapper(i);\n }\n //long[] testValues = new long[] {1752443,1911046, 2067456,2249444,2429337, 2647532,2852449,3101167,3350292,3632299,3916575};\n for (int i = 0; i < values.length; i++){\n //if (testValues[i] != values[i]){\n System.out.printf(\"%d: %d\\n\", i + MIN, values[i]);\n //}\n }\n long endTime = System.nanoTime();\n System.out.printf(\"%f,\", (double)(endTime - startTime) / 1000000000.0);\n long totalMissCounts = 0;\n long totalMissWeight1 = 0;\n long totalMissWeight2 = 0;\n long totalMissWeight3 = 0;\n /*\n for (int i = 0; i < cutoffs.length; i++){\n long totalCounts = hitCounts[i] + missCounts[i];\n totalMissCounts += missCounts[i];\n totalMissWeight1 += missCounts[i] * cutoffs[i];\n totalMissWeight2 += (hitCounts[i] / missCounts[i]) * cutoffs[i];\n totalMissWeight3 += (hitCounts[i] - missCounts[i]) * cutoffs[i] * cutoffs[i];\n System.out.printf(\"\\tCache %d: %d/%d/%d (%.5f%%)\", cutoffs[i], hitCounts[i], missCounts[i], totalCounts, (double) hitCounts[i] / totalCounts);\n }\n System.out.printf(\"\\t\\tMissCounts: %d, weighted: %d, ratio: %d, diff^2: %d\\n\", totalMissCounts, totalMissWeight1, totalMissWeight2, totalMissWeight3);\n */\n statCollector.printAll();\n }", "public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n int n = in.nextInt();\n int k = in.nextInt();\n int q = in.nextInt();\n\n int a[] = new int[n];\n for(int a_i=0; a_i < n; a_i++){\n a[a_i] = in.nextInt();\n }\n\n int fist;\n int last;\n\n //brute force will get timeout\n for(int i = 0; i< k; i++){\n fist = a[0];\n last = a[n-1];\n a[0] = last;\n for (int j = 1; j<n; j++){\n last = a[j];\n a[j] = fist;\n fist = last;\n }\n }\n\n for(int a0 = 0; a0 < q; a0++){\n System.out.println(a[in.nextInt()]);\n }\n\n\n }", "private static int f(int n, int complete, int other, int[] arr) {\n if(n<=0)\n return 0;\n int res=0;\n ArrayList<Integer>list=new ArrayList<Integer>();\n for(int a:arr)\n if(a>0)\n list.add(a);\n int brr[]=new int[list.size()];\n for(int i=0;i<brr.length;i++)\n brr[i]=list.get(i);\n while(brr.length!=0){\n int index=0;\n for(int i=1;i<brr.length;i++)\n if(brr[index]<brr[i])\n index=i;\n for(int i=0;i<brr.length;i++){\n if(index==i)\n brr[i]-=complete;\n else\n brr[i]-=other;\n }\n list=new ArrayList<Integer>();\n for(int a:brr)\n if(a>0)\n list.add(a);\n brr=new int[list.size()];\n for(int i=0;i<brr.length;i++)\n brr[i]=list.get(i);\n res++;\n }\n return res;\n }", "@Test\n public void testSolution() {\n assertArrayEquals(new int[]{3,2,1} , new Task().reverse3( new int[]{1, 2, 3}));\n assertArrayEquals(new int[]{5, 11, 9} , new Task().reverse3( new int[]{9, 11, 5}));\n assertArrayEquals(new int[]{7, 0, 0} , new Task().reverse3( new int[]{0, 0, 7}));\n assertArrayEquals(new int[]{2, 1, 2} , new Task().reverse3( new int[]{2, 1, 2}));\n assertArrayEquals(new int[]{1, 2, 1} , new Task().reverse3( new int[]{1, 2, 1}));\n assertArrayEquals(new int[]{2, 11, 3} , new Task().reverse3( new int[]{3, 11, 2}));\n assertArrayEquals(new int[]{7, 2, 3} , new Task().reverse3( new int[]{3, 2, 7}));\n\n }", "void merge_hi(int pa, int na, int pb, int nb) {\n getmem(nb);\n int dest = pb + nb - 1;\n int basea = pa;\n System.arraycopy(this.data, pb, this.a, 0, nb);\n \n pb = nb - 1;\n pa += na - 1;\n \n this.data[dest--] = this.data[pa--];\n --na;\n if (na == 0)\n return;\n if (nb == 1) {\n // CopyA;\n dest -= na;\n pa -= na;\n System.arraycopy(this.data, pa+1, this.data, dest+1, na);\n this.data[dest] = this.a[pb];\n nb = 0;\n return;\n }\n \n try {\n for (;;) {\n int acount = 0; /* # of time A won in a row */\n int bcount = 0; /* # of time B won in a row */\n \n /* Do the straightforward thing until (if ever) one run\n * appears to win consistently.\n */\n for (;;) {\n boolean k = iflt(this.a[pb], this.data[pa]);\n if (k) {\n this.data[dest--] = this.data[pa--];\n ++acount;\n bcount = 0;\n --na;\n if (na == 0)\n return;\n if (acount >= MIN_GALLOP)\n break;\n } else {\n this.data[dest--] = this.a[pb--];\n ++bcount;\n acount = 0;\n --nb;\n if (nb == 1) {\n // CopyA\n dest -= na;\n pa -= na;\n System.arraycopy(this.data, pa+1, this.data, dest+1, na);\n this.data[dest] = this.a[pb];\n nb = 0;\n return;\n }\n if (bcount >= MIN_GALLOP)\n break;\n }\n }\n \n /* One run is winning so consistently that galloping may\n * be a huge win. So try that, and continue galloping until\n * (if ever) neither run appears to be winning consistently\n * anymore.\n */\n do {\n int k = gallop_right(this.a[pb], this.data, basea, na, na-1);\n acount = k = na - k;\n if (k != 0) {\n dest -= k;\n pa -= k;\n System.arraycopy(this.data, pa+1, this.data, dest+1, k);\n na -= k;\n if (na == 0)\n return;\n }\n \n this.data[dest--] = this.a[pb--];\n --nb;\n if (nb == 1) {\n // CopyA\n dest -= na;\n pa -= na;\n System.arraycopy(this.data, pa+1, this.data, dest+1, na);\n this.data[dest] = this.a[pb];\n nb = 0;\n return;\n }\n \n k = gallop_left(this.data[pa], this.a, 0, nb, nb-1);\n bcount = k = nb - k;\n if (k != 0) {\n dest -= k;\n pb -= k;\n System.arraycopy(this.a, pb+1, this.data, dest+1, k);\n nb -= k;\n if (nb == 1) {\n // CopyA\n dest -= na;\n pa -= na;\n System.arraycopy(this.data, pa+1, this.data, dest+1, na);\n this.data[dest] = this.a[pb];\n nb = 0;\n return;\n }\n /* nb==0 is impossible now if the comparison\n * function is consistent, but we can't assume\n * that it is.\n */\n if (nb == 0)\n return;\n }\n this.data[dest--] = this.data[pa--];\n --na;\n if (na == 0)\n return;\n } while (acount >= MIN_GALLOP || bcount >= MIN_GALLOP);\n }\n } finally {\n if (nb != 0)\n System.arraycopy(this.a, 0, this.data, dest-(nb-1), nb);\n \n //dump_data(\"result\", origpa, cnt);\n }\n }", "public List<List<Integer>> fourSum_LeetCode(int[] nums, int target) {\n \tList<List<Integer>> res = new ArrayList<List<Integer>>();\n \tint len = nums.length;\n \tif(len < 4)\n \t return res;\n \t\n //Using the hashMap to store sum and corresponding 2 elements\n \tHashMap<Integer, Index> h = new HashMap<Integer, Index>();\n \t\n \tfor(int i = 0; i < len-1; i++) {\n \t\tfor(int j = i+1; j < len; j++) {\n \t\t\tint sum = nums[i] + nums[j];\n \t\t\tif(h.containsKey(target-sum)) {\n \t\t\t\t//then get the elements of the existing sum stored in hashmap\n \t\t\t\tIndex indx = h.get(target-sum);\n \t\t\t\tint exI = indx.getI();\n \t\t\t\tint exJ = indx.getJ();\n \t\t\t\tif(res.size() == 0) {\n \t\t\t\t\tList<Integer> l = new ArrayList<Integer>();\n\t \t\t\t\tl.add(exI);\n\t \t\t\t\tl.add(exJ);\n\t \t\t\t\tl.add(nums[i]);\n\t \t\t\t\tl.add(nums[j]);\n\t \t\t\t\tCollections.sort(l);\n\t \t\t\t\tres.add(l);\n \t\t\t\t} else {\n\t \t\t\t\tif((exI != nums[i]) && (exJ != nums[j])) {\n\t \t\t\t\t\tList<Integer> l = new ArrayList<Integer>();\n\t\t \t\t\t\tl.add(exI);\n\t\t \t\t\t\tl.add(exJ);\n\t\t \t\t\t\tl.add(nums[i]);\n\t\t \t\t\t\tl.add(nums[j]);\n\n\t\t \t\t\t\tCollections.sort(l);\n\t\t \t\t\t\tfor(List<Integer> ll : res) {\n\t\t \t\t\t\t\tif(!ll.equals(l))\n\t\t \t\t\t\t\t\tres.add(l);\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} else\n \t\t\t\th.put(sum, new Index(nums[i], nums[j]));\n \t\t}\n \t}\n \treturn res;\n }", "public ArrayList<ArrayList<Integer>> fourSum_02(ArrayList<Integer> a, int b) {\n\t\t//List to store the result\n\t\tArrayList<ArrayList<Integer>> res = new ArrayList<ArrayList<Integer>>();\n \tint len = a.size();\n \tif(len < 4)\n \t return res;\n \t\n //Using the hashMap to store sum and corresponding 2 elements\n \tHashMap<Integer, Index> h = new HashMap<Integer, Index>();\n \t\n \tfor(int i = 0; i < len-1; i++) {\n \t\tfor(int j = i+1; j < len; j++) {\n \t\t\tint sum = a.get(i) + a.get(j);\n \t\t\tif(h.containsKey(b-sum)) {\n \t\t\t\t//then get the elements of the existing sum stored in hashmap\n \t\t\t\tIndex indx = h.get(b-sum);\n \t\t\t\tint exI = indx.getI();\n \t\t\t\tint exJ = indx.getJ();\n \t\t\t\tif(res.size() == 0) {\n \t\t\t\t\tArrayList<Integer> l = new ArrayList<Integer>();\n\t \t\t\t\tl.add(exI);\n\t \t\t\t\tl.add(exJ);\n\t \t\t\t\tl.add( a.get(i));\n\t \t\t\t\tl.add( a.get(j));\n\t \t\t\t\tCollections.sort(l);\n\t \t\t\t\tres.add(l);\n \t\t\t\t} else {\n\t \t\t\t\tif((exI != a.get(i)) && (exJ != a.get(j))) {\n\t \t\t\t\t\tArrayList<Integer> l = new ArrayList<Integer>();\n\t\t \t\t\t\tl.add(exI);\n\t\t \t\t\t\tl.add(exJ);\n\t\t \t\t\t\tl.add(a.get(i));\n\t\t \t\t\t\tl.add(a.get(j));\n\n\t\t \t\t\t\tCollections.sort(l);\n\t\t \t\t\t\tboolean flag = true;\n\t\t \t\t\t\t\n\t\t \t\t\t\tfor(ArrayList<Integer> ll : res) {\n\t\t \t\t\t\t\tif(ll.equals(l)) {\n\t\t \t\t\t\t\t\tflag = false;\n\t\t \t\t\t\t\t\tbreak;\n\t\t \t\t\t\t\t}\n\t\t \t\t\t\t}\n\t\t \t\t\t\tif(flag == true)\n\t\t \t\t\t\t\tres.add(l);\n\t\t \t\t\t\t\n\t \t\t\t\t}\n \t\t\t\t}\n \t\t\t} else\n \t\t\t\th.put(sum, new Index(a.get(i), a.get(j)));\n \t\t}\n \t}\n \treturn res;\n\t}" ]
[ "0.60769004", "0.58962506", "0.5826095", "0.57471436", "0.564394", "0.5643363", "0.56391907", "0.5626346", "0.56199795", "0.5591683", "0.55422413", "0.5525774", "0.5525542", "0.55214757", "0.5514189", "0.5504412", "0.5476177", "0.5460131", "0.5437553", "0.54373896", "0.54333717", "0.5420806", "0.5395638", "0.5395278", "0.5381805", "0.5360584", "0.5353915", "0.53485304", "0.53431076", "0.5341522", "0.5338812", "0.5338049", "0.53293645", "0.5325581", "0.53236675", "0.5290101", "0.527607", "0.52675754", "0.5256155", "0.52546537", "0.52542377", "0.5241651", "0.5235887", "0.5234093", "0.5232984", "0.522664", "0.522002", "0.52021635", "0.5201427", "0.5200393", "0.5196897", "0.5191772", "0.5191617", "0.51913357", "0.51821834", "0.5180537", "0.5173183", "0.5168095", "0.51649296", "0.51602006", "0.5157627", "0.5156712", "0.5152877", "0.5151049", "0.51496255", "0.5146988", "0.514665", "0.51426643", "0.5139129", "0.51369095", "0.5134484", "0.5126781", "0.51237", "0.5123187", "0.5119025", "0.5117461", "0.5114163", "0.510366", "0.51034826", "0.51013136", "0.5099983", "0.50943464", "0.50899804", "0.5088791", "0.50877625", "0.50861526", "0.5084358", "0.50834763", "0.50788647", "0.50781333", "0.50710166", "0.50709444", "0.5068141", "0.50616753", "0.5061536", "0.5060958", "0.50598294", "0.5059325", "0.50521094", "0.5051208", "0.50496304" ]
0.0
-1
// mission 5 O(1)//
public double getDensity() { double widthX = this.maxx.getData().getX()-this.minx.getData().getX(); double widthY = this.maxy.getData().getY()-this.miny.getData().getY(); return (this.size)/(widthX * widthY); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int e(amj paramamj)\r\n/* 202: */ {\r\n/* 203:221 */ alq localalq = paramamj.b();\r\n/* 204:222 */ int i = paramamj.b;\r\n/* 205: */ \r\n/* 206:224 */ int j = d(paramamj);\r\n/* 207:225 */ if (j < 0) {\r\n/* 208:226 */ j = j();\r\n/* 209: */ }\r\n/* 210:228 */ if (j < 0) {\r\n/* 211:229 */ return i;\r\n/* 212: */ }\r\n/* 213:231 */ if (this.a[j] == null)\r\n/* 214: */ {\r\n/* 215:232 */ this.a[j] = new amj(localalq, 0, paramamj.i());\r\n/* 216:233 */ if (paramamj.n()) {\r\n/* 217:234 */ this.a[j].d((fn)paramamj.o().b());\r\n/* 218: */ }\r\n/* 219: */ }\r\n/* 220:238 */ int k = i;\r\n/* 221:239 */ if (k > this.a[j].c() - this.a[j].b) {\r\n/* 222:240 */ k = this.a[j].c() - this.a[j].b;\r\n/* 223: */ }\r\n/* 224:242 */ if (k > p_() - this.a[j].b) {\r\n/* 225:243 */ k = p_() - this.a[j].b;\r\n/* 226: */ }\r\n/* 227:246 */ if (k == 0) {\r\n/* 228:247 */ return i;\r\n/* 229: */ }\r\n/* 230:250 */ i -= k;\r\n/* 231:251 */ this.a[j].b += k;\r\n/* 232:252 */ this.a[j].c = 5;\r\n/* 233: */ \r\n/* 234:254 */ return i;\r\n/* 235: */ }", "public static void main(String[] args) {\n\n pairsSum();\n\n printAllSubArrays();\n\n tripletZero();\n\n // int[][] sub = subsets();\n\n PairsSum sum = new PairsSum();\n int[] arr = { 10, 1, 2, 3, 4, 5, 6, 1 };\n boolean flag = sum.almostIncreasingSequence(arr);\n System.out.println(flag);\n\n String s = \"\";\n for (int i = 0; i < 100000; i++) {\n // s += \"CodefightsIsAwesome\";\n }\n long start = System.currentTimeMillis();\n // int k = subStr(s, \"IsA\");\n System.out.println(System.currentTimeMillis() - start);\n // System.out.println(k);\n\n String[] a = { \"aba\", \"aa\", \"ad\", \"vcd\", \"aba\" };\n String[] b = sum.allLongestStrings(a);\n System.out.println(Arrays.deepToString(b));\n\n List<String> al = new ArrayList<>();\n al.toArray();\n\n Map<Integer, Integer> map = new HashMap<>();\n Set<Integer> keySet = map.keySet();\n for (Integer integer : keySet) {\n\n }\n\n String st = reverseBracksStack(\"a(bc(de)f)g\");\n System.out.println(st);\n\n int[] A = { 1, 2, 3, 2, 2, 3, 3, 33 };\n int[] B = { 1, 2, 2, 2, 2, 3, 2, 33 };\n\n System.out.println(sum.isIPv4Address(\"2.2.34\"));\n\n Integer[] AR = { 5, 3, 6, 7, 9 };\n int h = sum.avoidObstacles(AR);\n System.out.println(h);\n\n int[][] image = { { 36, 0, 18, 9 }, { 27, 54, 9, 0 }, { 81, 63, 72, 45 } };\n int[][] im = { { 7, 4, 0, 1 }, { 5, 6, 2, 2 }, { 6, 10, 7, 8 }, { 1, 4, 2, 0 } };\n int[][] res = sum.boxBlur(im);\n\n for (int i = 0; i < res.length; i++) {\n for (int j = 0; j < res[0].length; j++) {\n System.out.print(res[i][j] + \" \");\n }\n System.out.println();\n }\n\n boolean[][] ms = { { true, false, false, true }, { false, false, true, false }, { true, true, false, true } };\n int[][] mines = sum.minesweeper(ms);\n for (int i = 0; i < mines.length; i++) {\n for (int j = 0; j < mines[0].length; j++) {\n System.out.print(mines[i][j] + \" \");\n }\n System.out.println();\n }\n\n System.out.println(sum.variableName(\"var_1__Int\"));\n\n System.out.println(sum.chessBoard());\n\n System.out.println(sum.depositProfit(100, 20, 170));\n\n String[] inputArray = { \"abc\", \"abx\", \"axx\", \"abx\", \"abc\" };\n System.out.println(sum.stringsRearrangement(inputArray));\n\n int[][] queens = { { 1, 1 }, { 3, 2 } };\n int[][] queries = { { 1, 1 }, { 0, 3 }, { 0, 4 }, { 3, 4 }, { 2, 0 }, { 4, 3 }, { 4, 0 } };\n boolean[] r = sum.queensUnderAttack(5, queens, queries);\n\n }", "public void a()\r\n/* 49: */ {\r\n/* 50: 64 */ HashSet<BlockPosition> localHashSet = Sets.newHashSet();\r\n/* 51: */ \r\n/* 52: 66 */ int m = 16;\r\n/* 53: 67 */ for (int n = 0; n < 16; n++) {\r\n/* 54: 68 */ for (int i1 = 0; i1 < 16; i1++) {\r\n/* 55: 69 */ for (int i2 = 0; i2 < 16; i2++) {\r\n/* 56: 70 */ if ((n == 0) || (n == 15) || (i1 == 0) || (i1 == 15) || (i2 == 0) || (i2 == 15))\r\n/* 57: */ {\r\n/* 58: 74 */ double d1 = n / 15.0F * 2.0F - 1.0F;\r\n/* 59: 75 */ double d2 = i1 / 15.0F * 2.0F - 1.0F;\r\n/* 60: 76 */ double d3 = i2 / 15.0F * 2.0F - 1.0F;\r\n/* 61: 77 */ double d4 = Math.sqrt(d1 * d1 + d2 * d2 + d3 * d3);\r\n/* 62: */ \r\n/* 63: 79 */ d1 /= d4;\r\n/* 64: 80 */ d2 /= d4;\r\n/* 65: 81 */ d3 /= d4;\r\n/* 66: */ \r\n/* 67: 83 */ float f2 = this.i * (0.7F + this.d.rng.nextFloat() * 0.6F);\r\n/* 68: 84 */ double d6 = this.e;\r\n/* 69: 85 */ double d8 = this.f;\r\n/* 70: 86 */ double d10 = this.g;\r\n/* 71: */ \r\n/* 72: 88 */ float f3 = 0.3F;\r\n/* 73: 89 */ while (f2 > 0.0F)\r\n/* 74: */ {\r\n/* 75: 90 */ BlockPosition localdt = new BlockPosition(d6, d8, d10);\r\n/* 76: 91 */ Block localbec = this.d.getBlock(localdt);\r\n/* 77: 93 */ if (localbec.getType().getMaterial() != Material.air)\r\n/* 78: */ {\r\n/* 79: 94 */ float f4 = this.h != null ? this.h.a(this, this.d, localdt, localbec) : localbec.getType().a((Entity)null);\r\n/* 80: 95 */ f2 -= (f4 + 0.3F) * 0.3F;\r\n/* 81: */ }\r\n/* 82: 98 */ if ((f2 > 0.0F) && ((this.h == null) || (this.h.a(this, this.d, localdt, localbec, f2)))) {\r\n/* 83: 99 */ localHashSet.add(localdt);\r\n/* 84: */ }\r\n/* 85:102 */ d6 += d1 * 0.300000011920929D;\r\n/* 86:103 */ d8 += d2 * 0.300000011920929D;\r\n/* 87:104 */ d10 += d3 * 0.300000011920929D;\r\n/* 88:105 */ f2 -= 0.225F;\r\n/* 89: */ }\r\n/* 90: */ }\r\n/* 91: */ }\r\n/* 92: */ }\r\n/* 93: */ }\r\n/* 94:111 */ this.j.addAll(localHashSet);\r\n/* 95: */ \r\n/* 96:113 */ float f1 = this.i * 2.0F;\r\n/* 97: */ \r\n/* 98:115 */ int i1 = MathUtils.floor(this.e - f1 - 1.0D);\r\n/* 99:116 */ int i2 = MathUtils.floor(this.e + f1 + 1.0D);\r\n/* 100:117 */ int i3 = MathUtils.floor(this.f - f1 - 1.0D);\r\n/* 101:118 */ int i4 = MathUtils.floor(this.f + f1 + 1.0D);\r\n/* 102:119 */ int i5 = MathUtils.floor(this.g - f1 - 1.0D);\r\n/* 103:120 */ int i6 = MathUtils.floor(this.g + f1 + 1.0D);\r\n/* 104:121 */ List<Entity> localList = this.d.b(this.h, new AABB(i1, i3, i5, i2, i4, i6));\r\n/* 105:122 */ Vec3 localbrw = new Vec3(this.e, this.f, this.g);\r\n/* 106:124 */ for (int i7 = 0; i7 < localList.size(); i7++)\r\n/* 107: */ {\r\n/* 108:125 */ Entity localwv = (Entity)localList.get(i7);\r\n/* 109:126 */ if (!localwv.aV())\r\n/* 110: */ {\r\n/* 111:129 */ double d5 = localwv.f(this.e, this.f, this.g) / f1;\r\n/* 112:131 */ if (d5 <= 1.0D)\r\n/* 113: */ {\r\n/* 114:132 */ double d7 = localwv.xPos - this.e;\r\n/* 115:133 */ double d9 = localwv.yPos + localwv.getEyeHeight() - this.f;\r\n/* 116:134 */ double d11 = localwv.zPos - this.g;\r\n/* 117: */ \r\n/* 118:136 */ double d12 = MathUtils.sqrt(d7 * d7 + d9 * d9 + d11 * d11);\r\n/* 119:137 */ if (d12 != 0.0D)\r\n/* 120: */ {\r\n/* 121:141 */ d7 /= d12;\r\n/* 122:142 */ d9 /= d12;\r\n/* 123:143 */ d11 /= d12;\r\n/* 124: */ \r\n/* 125:145 */ double d13 = this.d.a(localbrw, localwv.getAABB());\r\n/* 126:146 */ double d14 = (1.0D - d5) * d13;\r\n/* 127:147 */ localwv.receiveDamage(DamageSource.a(this), (int)((d14 * d14 + d14) / 2.0D * 8.0D * f1 + 1.0D));\r\n/* 128: */ \r\n/* 129:149 */ double d15 = EnchantmentProtection.a(localwv, d14);\r\n/* 130:150 */ localwv.xVelocity += d7 * d15;\r\n/* 131:151 */ localwv.yVelocity += d9 * d15;\r\n/* 132:152 */ localwv.zVelocity += d11 * d15;\r\n/* 133:154 */ if ((localwv instanceof EntityPlayer)) {\r\n/* 134:155 */ this.k.put((EntityPlayer)localwv, new Vec3(d7 * d14, d9 * d14, d11 * d14));\r\n/* 135: */ }\r\n/* 136: */ }\r\n/* 137: */ }\r\n/* 138: */ }\r\n/* 139: */ }\r\n/* 140: */ }", "public void solution() {\n\t\t\n\t}", "private void cpu_jogada(){\n\n for(i=0;i<8;i++){\n for(j=0;j<8;j++){\n if(matriz[i][j] == jd2){\n // verificarAtaque(i,j,jd2);\n //verificarAtaque as posssibilidades de\n // ataque : defesa : aleatorio\n //ataque tem prioridade 1 - ve se tem como comer quem ataca\n //defesa tem prioridade 2 - ou movimenta a peca que esta sob ataque ou movimenta a outa para ajudar\n //aleatorio nao tem prioridade -- caso nao esteja sob ataque ou defesa\n }\n }\n }\n }", "public void mo21877s() {\n }", "public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\n\t\tint a[] = {2,1,3,-4,-2};\n\t\t//int a[] = {1 ,2, 3, 7, 5};\n\t\tboolean found = false;\n\t\t\n\t\t//this will solve in o n^2\n\t\tfor(int i = 0 ; i < a.length ; i++){\n\t\t\tint sum = 0;\n\t\t\tfor(int j = i ; j< a.length ; j++){\n\t\t\t\tsum += a[j] ;\n\t\t\t\tif(sum == 0){\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tif(found)\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t\n\t\t// link : https://www.youtube.com/watch?v=PSpuM9cimxA&list=PLKKfKV1b9e8ps6dD3QA5KFfHdiWj9cB1s&index=49\n\t\tSystem.out.println(found + \" found\");\n\t\tfound = false;\n\t\t//solving with O of N with the help sets\n\t\t// x + 0 = y\n\t\tSet<Integer> set = new HashSet<>();\n\t\tint sum = 0;\n\t\tfor(int element : a){\n\t\t\tset.add(sum);\n\t\t\tsum += element;\n\t\t\tif(set.contains(sum)){\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\tSystem.out.println(set);\n\t\t\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t\tfound = false;\n\t\t// when the sum of subarray is K\n\t\t\n\t\t//solving with O of N with the help sets\n\t\t//x + k = y >>>\n\t\tSet<Integer> set1 = new HashSet<>();\n\t\tint k = 12;\n\t\tint summ = 0;\n\t\tfor(int element : a){\n\t\t\tset1.add(summ);\n\t\t\tsumm += element;\n\t\t\tif(set1.contains(summ - k)){ // y - k = x(alredy presnt or not)\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(set1);\n\t\tSystem.out.println();\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t}", "private final int m()\n\t { int n = 0;\n\t int i = 0;\n\t while(true)\n\t { if (i > j) return n;\n\t if (! cons(i)) break; i++;\n\t }\n\t i++;\n\t while(true)\n\t { while(true)\n\t { if (i > j) return n;\n\t if (cons(i)) break;\n\t i++;\n\t }\n\t i++;\n\t n++;\n\t while(true)\n\t { if (i > j) return n;\n\t if (! cons(i)) break;\n\t i++;\n\t }\n\t i++;\n\t }\n\t }", "public int[] a(int paramInt1, int paramInt2, int paramInt3, int paramInt4)\r\n/* 11: */ {\r\n/* 12:13 */ int i = paramInt1 - 1;\r\n/* 13:14 */ int j = paramInt2 - 1;\r\n/* 14:15 */ int k = paramInt3 + 2;\r\n/* 15:16 */ int m = paramInt4 + 2;\r\n/* 16:17 */ int[] arrayOfInt1 = this.a.a(i, j, k, m);\r\n/* 17: */ \r\n/* 18:19 */ int[] arrayOfInt2 = boy.a(paramInt3 * paramInt4);\r\n/* 19:20 */ for (int n = 0; n < paramInt4; n++) {\r\n/* 20:21 */ for (int i1 = 0; i1 < paramInt3; i1++)\r\n/* 21: */ {\r\n/* 22:22 */ int i2 = c(arrayOfInt1[(i1 + 0 + (n + 1) * k)]);\r\n/* 23:23 */ int i3 = c(arrayOfInt1[(i1 + 2 + (n + 1) * k)]);\r\n/* 24:24 */ int i4 = c(arrayOfInt1[(i1 + 1 + (n + 0) * k)]);\r\n/* 25:25 */ int i5 = c(arrayOfInt1[(i1 + 1 + (n + 2) * k)]);\r\n/* 26:26 */ int i6 = c(arrayOfInt1[(i1 + 1 + (n + 1) * k)]);\r\n/* 27:27 */ if ((i6 != i2) || (i6 != i4) || (i6 != i3) || (i6 != i5)) {\r\n/* 28:28 */ arrayOfInt2[(i1 + n * paramInt3)] = arm.w.az;\r\n/* 29: */ } else {\r\n/* 30:30 */ arrayOfInt2[(i1 + n * paramInt3)] = -1;\r\n/* 31: */ }\r\n/* 32: */ }\r\n/* 33: */ }\r\n/* 34:35 */ return arrayOfInt2;\r\n/* 35: */ }", "public static int f5(int N) { \n int x = 0;\n // log(n)\n for(int i = N; i > 0; i = i/2)\n // O(n) + O(n/2) + O(n/4)\n x += f1(i);\n \n return x; \n \n }", "public void mo442d() {\n long j;\n long j2;\n int i;\n long j3;\n boolean z;\n C0245a[] aVarArr;\n int i2;\n int i3;\n C3683c<? super U> cVar = this.f472a;\n int i4 = 1;\n while (!mo443e()) {\n C0211f<U> fVar = this.f477f;\n long j4 = this.f482m.get();\n boolean z2 = j4 == Long.MAX_VALUE;\n if (fVar != null) {\n j = 0;\n while (true) {\n long j5 = 0;\n Object obj = null;\n while (true) {\n if (j4 == 0) {\n break;\n }\n Object e_ = fVar.mo386e_();\n if (!mo443e()) {\n if (e_ == null) {\n obj = e_;\n break;\n }\n cVar.onNext(e_);\n j++;\n j5++;\n j4--;\n obj = e_;\n } else {\n return;\n }\n }\n if (j5 != 0) {\n if (z2) {\n j4 = Long.MAX_VALUE;\n } else {\n j4 = this.f482m.addAndGet(-j5);\n }\n }\n if (j4 == 0 || obj == null) {\n break;\n }\n }\n } else {\n j = 0;\n }\n boolean z3 = this.f478g;\n C0211f<U> fVar2 = this.f477f;\n C0245a[] aVarArr2 = (C0245a[]) this.f481j.get();\n int length = aVarArr2.length;\n if (!z3 || ((fVar2 != null && !fVar2.mo384b()) || length != 0)) {\n if (length != 0) {\n i = i4;\n long j6 = this.f485p;\n int i5 = this.f486q;\n if (length <= i5 || aVarArr2[i5].f462a != j6) {\n if (length <= i5) {\n i5 = 0;\n }\n int i6 = i5;\n for (int i7 = 0; i7 < length && aVarArr2[i6].f462a != j6; i7++) {\n i6++;\n if (i6 == length) {\n i6 = 0;\n }\n }\n this.f486q = i6;\n this.f485p = aVarArr2[i6].f462a;\n i5 = i6;\n }\n int i8 = i5;\n z = false;\n int i9 = 0;\n while (true) {\n if (i9 >= length) {\n aVarArr = aVarArr2;\n break;\n } else if (!mo443e()) {\n C0245a aVar = aVarArr2[i8];\n Object obj2 = null;\n while (!mo443e()) {\n C0212g<U> gVar = aVar.f467f;\n if (gVar == null) {\n aVarArr = aVarArr2;\n i2 = length;\n } else {\n aVarArr = aVarArr2;\n i2 = length;\n long j7 = 0;\n while (j2 != 0) {\n try {\n obj2 = gVar.mo386e_();\n if (obj2 == null) {\n break;\n }\n cVar.onNext(obj2);\n if (!mo443e()) {\n j2--;\n j7++;\n } else {\n return;\n }\n } catch (Throwable th) {\n Throwable th2 = th;\n C0171b.m584b(th2);\n aVar.dispose();\n this.f479h.mo516a(th2);\n if (!this.f474c) {\n this.f483n.mo407a();\n }\n if (!mo443e()) {\n mo439b(aVar);\n i9++;\n i3 = i2;\n z = true;\n } else {\n return;\n }\n }\n }\n if (j7 != 0) {\n j2 = !z2 ? this.f482m.addAndGet(-j7) : Long.MAX_VALUE;\n aVar.mo433a(j7);\n }\n if (!(j2 == 0 || obj2 == null)) {\n aVarArr2 = aVarArr;\n length = i2;\n }\n }\n boolean z4 = aVar.f466e;\n C0212g<U> gVar2 = aVar.f467f;\n if (z4 && (gVar2 == null || gVar2.mo384b())) {\n mo439b(aVar);\n if (!mo443e()) {\n j++;\n z = true;\n } else {\n return;\n }\n }\n if (j2 == 0) {\n break;\n }\n int i10 = i8 + 1;\n i3 = i2;\n i8 = i10 == i3 ? 0 : i10;\n i9++;\n length = i3;\n aVarArr2 = aVarArr;\n }\n return;\n } else {\n return;\n }\n }\n this.f486q = i8;\n this.f485p = aVarArr[i8].f462a;\n j3 = j;\n } else {\n i = i4;\n j3 = j;\n z = false;\n }\n if (j3 != 0 && !this.f480i) {\n this.f483n.mo408a(j3);\n }\n if (z) {\n i4 = i;\n } else {\n i4 = addAndGet(-i);\n if (i4 == 0) {\n return;\n }\n }\n } else {\n Throwable a = this.f479h.mo515a();\n if (a != C0315e.f669a) {\n if (a == null) {\n cVar.onComplete();\n } else {\n cVar.onError(a);\n }\n }\n return;\n }\n }\n }", "public static int f1(int N) {\n int x = 0; //O(1)\n for(int i = 0; i < N; i++) // O(n) \n x++; \n return x; \n \n }", "public void mo21795T() {\n }", "private int m5278d(int pos, int cmd) {\n int end;\n int start;\n for (int i = this.f3533c.size() - 1; i >= 0; i--) {\n C1070b postponed = (C1070b) this.f3533c.get(i);\n int i2 = postponed.f3539a;\n if (i2 == 8) {\n if (postponed.f3540b < postponed.f3542d) {\n start = postponed.f3540b;\n end = postponed.f3542d;\n } else {\n start = postponed.f3542d;\n end = postponed.f3540b;\n }\n if (pos < start || pos > end) {\n int i3 = postponed.f3540b;\n if (pos < i3) {\n if (cmd == 1) {\n postponed.f3540b = i3 + 1;\n postponed.f3542d++;\n } else if (cmd == 2) {\n postponed.f3540b = i3 - 1;\n postponed.f3542d--;\n }\n }\n } else {\n int i4 = postponed.f3540b;\n if (start == i4) {\n if (cmd == 1) {\n postponed.f3542d++;\n } else if (cmd == 2) {\n postponed.f3542d--;\n }\n pos++;\n } else {\n if (cmd == 1) {\n postponed.f3540b = i4 + 1;\n } else if (cmd == 2) {\n postponed.f3540b = i4 - 1;\n }\n pos--;\n }\n }\n } else {\n int i5 = postponed.f3540b;\n if (i5 <= pos) {\n if (i2 == 1) {\n pos -= postponed.f3542d;\n } else if (i2 == 2) {\n pos += postponed.f3542d;\n }\n } else if (cmd == 1) {\n postponed.f3540b = i5 + 1;\n } else if (cmd == 2) {\n postponed.f3540b = i5 - 1;\n }\n }\n }\n for (int i6 = this.f3533c.size() - 1; i6 >= 0; i6--) {\n C1070b op = (C1070b) this.f3533c.get(i6);\n if (op.f3539a == 8) {\n int i7 = op.f3542d;\n if (i7 == op.f3540b || i7 < 0) {\n this.f3533c.remove(i6);\n mo8470a(op);\n }\n } else if (op.f3542d <= 0) {\n this.f3533c.remove(i6);\n mo8470a(op);\n }\n }\n return pos;\n }", "public static void main(String[] args) {\n long startTime = System.nanoTime();\n Board b = new Board();\n b.board = InitialPositions.kiwiPeteBoard; // perft test\n\n int p2 = 0;\n int p3 = 0;\n int p4 = 0;\n int p5 = 0;\n\n List<Move> p1Moves = b.validMoves();\n int p1 = p1Moves.size();\n for (Move m : p1Moves){\n b.makeMove(m);\n List<Move> p2Moves = b.validMoves();\n p2 += p2Moves.size();\n for (Move n : p2Moves){\n b.makeMove(n);\n List<Move> p3Moves = b.validMoves();\n for (Move m3 : p3Moves){\n b.makeMove(m3);\n List<Move> moves4 = b.validMoves();\n p4 += moves4.size();\n for (Move m4 : moves4){\n b.makeMove(m4);\n p5 += b.validMoves().size();\n b.undoMove(m4);\n }\n b.undoMove(m3);\n }\n p3 += p3Moves.size();\n b.undoMove(n);\n }\n b.undoMove(m);\n }\n System.out.println();\n System.out.println(p1);\n System.out.println(p2);\n System.out.println(p3);\n System.out.println(p4);\n System.out.println(p5); // 193690690\n System.out.println(\"Time taken: \"+(System.nanoTime()-startTime)); // with int castles : 35003485400\n }", "void mo30275a(long j);", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int T = sc.nextInt();\n for(int i = 0 ; i < T; i++) {\n int n = sc.nextInt();\n int a = sc.nextInt();\n int b = sc.nextInt();\n PriorityQueue<Integer> queue = new PriorityQueue<Integer>();\n int[][] m = new int[n][n];\n //n^2 * log(n)\n for(int row = 0; row < n; row++) {\n for(int col = 0; col < n; col++) {\n if(row == 0 && col == 0 && n != 1) {\n continue;\n }else if(row == 0) {\n m[row][col] = m[row][col - 1] + a;\n }else if(col == 0) {\n m[row][col] = m[row-1][col] + b;\n }else {\n m[row][col] = m[row-1][col-1] + a + b;\n }\n\n if(row + col == (n -1)) {\n pool.add(m[row][col]); //log(n)\n }\n }\n }\n //O(n*log(n))\n for (Integer item:pool) {\n queue.add(item); //O(logn)\n }\n while(!queue.isEmpty()) {\n System.out.print(queue.poll() + \" \"); //O(1)\n }\n System.out.println();\n queue.clear();\n pool.clear();\n }\n }", "public static void main(String[] args) throws IOException {\n BufferedReader bufferedReader = new BufferedReader(new FileReader(UFTest.class.getResource(\"/\").getPath()+\"1.5/largeUF.txt\"));\n String str = bufferedReader.readLine();\n UFLJWQU uf = new UFLJWQU(Integer.parseInt(str));\n long beginTime =System.currentTimeMillis();\n while ((str = bufferedReader.readLine())!=null){\n String[] array = str.split(\" \");\n int p = Integer.parseInt(array[0]);\n int q = Integer.parseInt(array[1]);\n if(uf.connected(p,q)) continue;\n uf.union(p,q);\n// System.out.println(p+\" -- \"+q);\n }\n System.out.println(uf.count());\n System.out.println(\"cost time :\"+(System.currentTimeMillis() - beginTime));\n }", "public static int f2(int N) { \n int x = 0; //O(1)\n for(int i = 0; i < N; i++) // O(n)\n // O(n)`\n for(int j = 0; j < i; j++) \n x++;\n return x;\n }", "public static void main(String[] args) \n {\n int[] numOfPoints = { 1000, 10000, 7000, 10000, 13000 };\n for(int count = 0; count < numOfPoints.length; count++)\n {\n List<Point> pointsTobeUsed = new ArrayList<Point>();\n int current = numOfPoints[count];\n int inc = 0;\n \n //creating list of points to be used\n for(int x = 0; x <= current; x++)\n {\n \n if(x <= current/2)\n {\n pointsTobeUsed.add(new Point(x,x));\n \n }\n else\n {\n pointsTobeUsed.add(new Point(x, x - (1 + 2*(inc)) ) );\n inc++;\n }\n }\n \n //n logn implementation of Pareto optimal\n long timeStart = System.currentTimeMillis();\n \n // n logn quicksort\n pointsTobeUsed = quickSort(pointsTobeUsed, 0, pointsTobeUsed.size() -1 );\n \n \n \n ParetoOptimal(pointsTobeUsed);\n \n \n long timeEnd = System.currentTimeMillis();\n System.out.println(\"final:\" + \" exper: \" + (timeEnd - timeStart) + \" N: \" + current ); \n }\n }", "private void method_4325(int var1, int var2) {\r\n byte var4 = 64;\r\n String[] var3 = class_752.method_4253();\r\n class_482.field_2258 = true;\r\n byte var5 = 4;\r\n int var6 = var4 - 1;\r\n\r\n int var10000;\r\n label95:\r\n while(true) {\r\n var10000 = var6;\r\n\r\n label92:\r\n while(var10000 <= var4 + 32) {\r\n var10000 = var1 - var5;\r\n if(var3 == null) {\r\n break label95;\r\n }\r\n\r\n int var7 = var10000;\r\n\r\n label89:\r\n do {\r\n var10000 = var7;\r\n\r\n label86:\r\n while(true) {\r\n if(var10000 > var1 + var5) {\r\n break label89;\r\n }\r\n\r\n var10000 = var2 - var5;\r\n if(var3 == null) {\r\n continue label92;\r\n }\r\n\r\n int var8 = var10000;\r\n\r\n while(true) {\r\n if(var8 > var2 + var5) {\r\n break label86;\r\n }\r\n\r\n double var9 = (double)(var7 - var1);\r\n double var11 = (double)(var8 - var2);\r\n double var13 = var9 * var9 + var11 * var11;\r\n if(var3 != null) {\r\n double var15;\r\n var10000 = (var15 = var13 - ((double)var5 - 0.5D) * ((double)var5 - 0.5D)) == 0.0D?0:(var15 < 0.0D?-1:1);\r\n if(var3 == null) {\r\n break;\r\n }\r\n\r\n if(var10000 <= 0) {\r\n label105: {\r\n label106: {\r\n var10000 = var6;\r\n byte var10001 = var4;\r\n if(var3 != null) {\r\n if(var6 < var4) {\r\n double var16;\r\n var10000 = (var16 = var13 - ((double)(var5 - 1) - 0.5D) * ((double)(var5 - 1) - 0.5D)) == 0.0D?0:(var16 < 0.0D?-1:1);\r\n if(var3 != null) {\r\n if(var10000 > 0) {\r\n break label105;\r\n }\r\n\r\n this.field_2990.method_2058(var7, var6, var8, class_1192.field_6032);\r\n }\r\n\r\n if(var3 != null) {\r\n break label105;\r\n }\r\n }\r\n\r\n var10000 = var6;\r\n if(var3 == null) {\r\n break label106;\r\n }\r\n\r\n var10001 = var4;\r\n }\r\n\r\n if(var10000 > var10001) {\r\n this.field_2990.method_2058(var7, var6, var8, class_1192.field_6025);\r\n if(var3 != null) {\r\n break label105;\r\n }\r\n }\r\n\r\n double var17;\r\n var10000 = (var17 = var13 - ((double)(var5 - 1) - 0.5D) * ((double)(var5 - 1) - 0.5D)) == 0.0D?0:(var17 < 0.0D?-1:1);\r\n }\r\n\r\n if(var3 != null) {\r\n label59: {\r\n if(var10000 > 0) {\r\n this.field_2990.method_2058(var7, var6, var8, class_1192.field_6032);\r\n if(var3 != null) {\r\n break label59;\r\n }\r\n }\r\n\r\n this.field_2990.method_2058(var7, var6, var8, class_1192.field_6143);\r\n }\r\n }\r\n }\r\n }\r\n\r\n ++var8;\r\n }\r\n\r\n if(var3 == null) {\r\n break label86;\r\n }\r\n }\r\n }\r\n\r\n ++var7;\r\n } while(var3 != null);\r\n\r\n ++var6;\r\n if(var3 != null) {\r\n continue label95;\r\n }\r\n break;\r\n }\r\n\r\n this.field_2990.method_2058(var1, var4 + 0, var2, class_1192.field_6032);\r\n this.field_2990.method_2058(var1, var4 + 1, var2, class_1192.field_6032);\r\n this.field_2990.method_2058(var1, var4 + 2, var2, class_1192.field_6032);\r\n this.field_2990.method_2058(var1 - 1, var4 + 2, var2, class_1192.field_6077);\r\n this.field_2990.method_2058(var1 + 1, var4 + 2, var2, class_1192.field_6077);\r\n this.field_2990.method_2058(var1, var4 + 2, var2 - 1, class_1192.field_6077);\r\n this.field_2990.method_2058(var1, var4 + 2, var2 + 1, class_1192.field_6077);\r\n this.field_2990.method_2058(var1, var4 + 3, var2, class_1192.field_6032);\r\n this.field_2990.method_2058(var1, var4 + 4, var2, class_1192.field_6146);\r\n var10000 = 0;\r\n break;\r\n }\r\n\r\n class_482.field_2258 = (boolean)var10000;\r\n }", "public void s_()\r\n/* 117: */ {\r\n/* 118:128 */ this.P = this.s;\r\n/* 119:129 */ this.Q = this.t;\r\n/* 120:130 */ this.R = this.u;\r\n/* 121:131 */ super.s_();\r\n/* 122:133 */ if (this.b > 0) {\r\n/* 123:134 */ this.b -= 1;\r\n/* 124: */ }\r\n/* 125:137 */ if (this.a)\r\n/* 126: */ {\r\n/* 127:138 */ if (this.o.p(new dt(this.c, this.d, this.e)).c() == this.f)\r\n/* 128: */ {\r\n/* 129:139 */ this.i += 1;\r\n/* 130:140 */ if (this.i == 1200) {\r\n/* 131:141 */ J();\r\n/* 132: */ }\r\n/* 133:143 */ return;\r\n/* 134: */ }\r\n/* 135:145 */ this.a = false;\r\n/* 136: */ \r\n/* 137:147 */ this.v *= this.V.nextFloat() * 0.2F;\r\n/* 138:148 */ this.w *= this.V.nextFloat() * 0.2F;\r\n/* 139:149 */ this.x *= this.V.nextFloat() * 0.2F;\r\n/* 140:150 */ this.i = 0;\r\n/* 141:151 */ this.ap = 0;\r\n/* 142: */ }\r\n/* 143: */ else\r\n/* 144: */ {\r\n/* 145:154 */ this.ap += 1;\r\n/* 146: */ }\r\n/* 147:157 */ brw localbrw1 = new brw(this.s, this.t, this.u);\r\n/* 148:158 */ brw localbrw2 = new brw(this.s + this.v, this.t + this.w, this.u + this.x);\r\n/* 149:159 */ bru localbru1 = this.o.a(localbrw1, localbrw2);\r\n/* 150: */ \r\n/* 151:161 */ localbrw1 = new brw(this.s, this.t, this.u);\r\n/* 152:162 */ localbrw2 = new brw(this.s + this.v, this.t + this.w, this.u + this.x);\r\n/* 153:163 */ if (localbru1 != null) {\r\n/* 154:164 */ localbrw2 = new brw(localbru1.c.a, localbru1.c.b, localbru1.c.c);\r\n/* 155: */ }\r\n/* 156:167 */ if (!this.o.D)\r\n/* 157: */ {\r\n/* 158:168 */ Object localObject = null;\r\n/* 159:169 */ List localList = this.o.b(this, aQ().a(this.v, this.w, this.x).b(1.0D, 1.0D, 1.0D));\r\n/* 160:170 */ double d1 = 0.0D;\r\n/* 161:171 */ xm localxm = n();\r\n/* 162:172 */ for (int k = 0; k < localList.size(); k++)\r\n/* 163: */ {\r\n/* 164:173 */ wv localwv = (wv)localList.get(k);\r\n/* 165:174 */ if ((localwv.ad()) && ((localwv != localxm) || (this.ap >= 5)))\r\n/* 166: */ {\r\n/* 167:178 */ float f5 = 0.3F;\r\n/* 168:179 */ brt localbrt = localwv.aQ().b(f5, f5, f5);\r\n/* 169:180 */ bru localbru2 = localbrt.a(localbrw1, localbrw2);\r\n/* 170:181 */ if (localbru2 != null)\r\n/* 171: */ {\r\n/* 172:182 */ double d2 = localbrw1.f(localbru2.c);\r\n/* 173:183 */ if ((d2 < d1) || (d1 == 0.0D))\r\n/* 174: */ {\r\n/* 175:184 */ localObject = localwv;\r\n/* 176:185 */ d1 = d2;\r\n/* 177: */ }\r\n/* 178: */ }\r\n/* 179: */ }\r\n/* 180: */ }\r\n/* 181:190 */ if (localObject != null) {\r\n/* 182:191 */ localbru1 = new bru(localObject);\r\n/* 183: */ }\r\n/* 184: */ }\r\n/* 185:195 */ if (localbru1 != null) {\r\n/* 186:196 */ if ((localbru1.a == brv.b) && (this.o.p(localbru1.a()).c() == aty.aY)) {\r\n/* 187:197 */ aq();\r\n/* 188: */ } else {\r\n/* 189:199 */ a(localbru1);\r\n/* 190: */ }\r\n/* 191: */ }\r\n/* 192:202 */ this.s += this.v;\r\n/* 193:203 */ this.t += this.w;\r\n/* 194:204 */ this.u += this.x;\r\n/* 195: */ \r\n/* 196:206 */ float f1 = uv.a(this.v * this.v + this.x * this.x);\r\n/* 197:207 */ this.y = ((float)(Math.atan2(this.v, this.x) * 180.0D / 3.141592741012573D));\r\n/* 198:208 */ this.z = ((float)(Math.atan2(this.w, f1) * 180.0D / 3.141592741012573D));\r\n/* 199:210 */ while (this.z - this.B < -180.0F) {\r\n/* 200:211 */ this.B -= 360.0F;\r\n/* 201: */ }\r\n/* 202:213 */ while (this.z - this.B >= 180.0F) {\r\n/* 203:214 */ this.B += 360.0F;\r\n/* 204: */ }\r\n/* 205:217 */ while (this.y - this.A < -180.0F) {\r\n/* 206:218 */ this.A -= 360.0F;\r\n/* 207: */ }\r\n/* 208:220 */ while (this.y - this.A >= 180.0F) {\r\n/* 209:221 */ this.A += 360.0F;\r\n/* 210: */ }\r\n/* 211:224 */ this.z = (this.B + (this.z - this.B) * 0.2F);\r\n/* 212:225 */ this.y = (this.A + (this.y - this.A) * 0.2F);\r\n/* 213: */ \r\n/* 214:227 */ float f2 = 0.99F;\r\n/* 215:228 */ float f3 = m();\r\n/* 216:230 */ if (V())\r\n/* 217: */ {\r\n/* 218:231 */ for (int j = 0; j < 4; j++)\r\n/* 219: */ {\r\n/* 220:232 */ float f4 = 0.25F;\r\n/* 221:233 */ this.o.a(ew.e, this.s - this.v * f4, this.t - this.w * f4, this.u - this.x * f4, this.v, this.w, this.x, new int[0]);\r\n/* 222: */ }\r\n/* 223:235 */ f2 = 0.8F;\r\n/* 224: */ }\r\n/* 225:238 */ this.v *= f2;\r\n/* 226:239 */ this.w *= f2;\r\n/* 227:240 */ this.x *= f2;\r\n/* 228:241 */ this.w -= f3;\r\n/* 229: */ \r\n/* 230:243 */ b(this.s, this.t, this.u);\r\n/* 231: */ }", "public void method_4270() {}", "void mo5017a();", "private static int lucas_cost(int n, double v) {\r\n\t\tint c, d, e, r;\r\n\r\n\t\td = n;\r\n\t\tr = (int) ((double) d / v + 0.5);\r\n\t\tif (r >= n)\r\n\t\t\treturn (ADD * n);\r\n\t\td = n - r;\r\n\t\te = 2 * r - n;\r\n\t\tc = DUP + ADD; /* initial duplicate and final addition */\r\n\t\twhile (d != e) {\r\n\t\t\tif (d < e) {\r\n\t\t\t\tr = d;\r\n\t\t\t\td = e;\r\n\t\t\t\te = r;\r\n\t\t\t}\r\n\t\t\tif (4 * d <= 5 * e && ((d + e) % 3) == 0) { /* condition 1 */\r\n\t\t\t\tr = (2 * d - e) / 3;\r\n\t\t\t\te = (2 * e - d) / 3;\r\n\t\t\t\td = r;\r\n\t\t\t\tc += 3 * ADD; /* 3 additions */\r\n\t\t\t} else if (4 * d <= 5 * e && (d - e) % 6 == 0) { /* condition 2 */\r\n\t\t\t\td = (d - e) / 2;\r\n\t\t\t\tc += ADD + DUP; /* one addition, one duplicate */\r\n\t\t\t} else if (d <= (4 * e)) { /* condition 3 */\r\n\t\t\t\td -= e;\r\n\t\t\t\tc += ADD; /* one addition */\r\n\t\t\t} else if ((d + e) % 2 == 0) { /* condition 4 */\r\n\t\t\t\td = (d - e) / 2;\r\n\t\t\t\tc += ADD + DUP; /* one addition, one duplicate */\r\n\t\t\t} else if (d % 2 == 0) { /* condition 5 */\r\n\t\t\t\td /= 2;\r\n\t\t\t\tc += ADD + DUP; /* one addition, one duplicate */\r\n\t\t\t} else if (d % 3 == 0) { /* condition 6 */\r\n\t\t\t\td = d / 3 - e;\r\n\t\t\t\tc += 3 * ADD + DUP; /* three additions, one duplicate */\r\n\t\t\t} else if ((d + e) % 3 == 0) { /* condition 7 */\r\n\t\t\t\td = (d - 2 * e) / 3;\r\n\t\t\t\tc += 3 * ADD + DUP; /* three additions, one duplicate */\r\n\t\t\t} else if ((d - e) % 3 == 0) { /* condition 8 */\r\n\t\t\t\td = (d - e) / 3;\r\n\t\t\t\tc += 3 * ADD + DUP; /* three additions, one duplicate */\r\n\t\t\t} else if (e % 2 == 0) { /* condition 9 */\r\n\t\t\t\te /= 2;\r\n\t\t\t\tc += ADD + DUP; /* one addition, one duplicate */\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn (c);\r\n\t}", "void mo25957a(long j, long j2);", "private void kk12() {\n\n\t}", "public static void main(String[] args) {\n\t\tArrayList<Integer> primelist = sieve(7071);\n\t\tArrayList<Double> second = new ArrayList<Double>();\n\t\tfor(int one : primelist) \n\t\t\tsecond.add(Math.pow(one, 2));\n\t\tArrayList<Double> third = new ArrayList<Double>();\n\t\tprimelist = sieve(368);\n\t\tfor(int one : primelist)\n\t\t\tthird.add(Math.pow(one, 3));\n\t\tArrayList<Double> fourth = new ArrayList<Double>();\n\t\tprimelist = sieve(84);\n\t\tfor(int one : primelist)\n\t\t\tfourth.add(Math.pow(one, 4));\n\n\t\tArrayList<Double> possibilities = new ArrayList<Double>();\n\t\tfor (int k = fourth.size() - 1; k >=0 ; k--) {\n\t\t\tfor (int j = 0; j < third.size(); j++) {\n\t\t\t\tdouble sum = fourth.get(k) + third.get(j);\n\t\t\t\tif (sum > 50000000)\n\t\t\t\t\tbreak;\n\t\t\t\telse {\n\t\t\t\t\tfor (int i = 0; i < second.size(); i++) {\n\t\t\t\t\t\tdouble nextsum = sum + second.get(i);\n\t\t\t\t\t\tif (nextsum > 50000000)\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// I am not sure whether it can be proved that the sum is unique.\n\t\t\t\t\t\t\tif (!possibilities.contains(nextsum))\n\t\t\t\t\t\t\t\tpossibilities.add(nextsum);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tint totalcount = possibilities.size();\n\t\tSystem.out.println(totalcount);\n\t}", "public static int Main()\n\t{\n\t\tint s = 0;\n\t\tint t = 0;\n\t\tint[] a = new int[100000];\n\t\tint n;\n\t\tint i;\n\t\tint j;\n\t\tint k;\n\n\t\tn = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\n\t\tfor (i = 1;i <= n;i++)\n\t\t{\n\t\t\ta[i - 1] = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\t}\n\n\t\tk = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\n\t\tfor (j = 1;j <= n;j++) //?for??????????k??????\n\t\t{\n\t\t\tif (a[j - 1] != k)\n\t\t\t{\n\t\t\t\tt++; //?t?????k???????????????????????\n\t\t\t}\n\t\t}\n\t\tfor (j = 1;j <= n;j++)\n\t\t{\n\t\t\tif (a[j - 1] != k) //???k?????\n\t\t\t{\n\t\t\t\ts++;\n\t\t\t\tif (s <= t - 1) //?????????k???s?t????????????\n\t\t\t\t{\n\t\t\t\t\tSystem.out.print(a[j - 1]);\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\telse //??????????????\n\t\t\t\t{\n\t\t\t\tSystem.out.print(a[j - 1]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}", "public void mo21792Q() {\n }", "public boolean a(amj paramamj)\r\n/* 268: */ {\r\n/* 269:293 */ if ((paramamj == null) || (paramamj.b == 0) || (paramamj.b() == null)) {\r\n/* 270:294 */ return false;\r\n/* 271: */ }\r\n/* 272: */ try\r\n/* 273: */ {\r\n/* 274:298 */ if (!paramamj.g())\r\n/* 275: */ {\r\n/* 276: */ do\r\n/* 277: */ {\r\n/* 278:301 */ i = paramamj.b;\r\n/* 279:302 */ paramamj.b = e(paramamj);\r\n/* 280:303 */ } while ((paramamj.b > 0) && (paramamj.b < i));\r\n/* 281:304 */ if ((paramamj.b == i) && (this.d.by.d))\r\n/* 282: */ {\r\n/* 283:306 */ paramamj.b = 0;\r\n/* 284:307 */ return true;\r\n/* 285: */ }\r\n/* 286:309 */ return paramamj.b < i;\r\n/* 287: */ }\r\n/* 288:312 */ int i = j();\r\n/* 289:313 */ if (i >= 0)\r\n/* 290: */ {\r\n/* 291:314 */ this.a[i] = amj.b(paramamj);\r\n/* 292:315 */ this.a[i].c = 5;\r\n/* 293:316 */ paramamj.b = 0;\r\n/* 294:317 */ return true;\r\n/* 295: */ }\r\n/* 296:318 */ if (this.d.by.d)\r\n/* 297: */ {\r\n/* 298:320 */ paramamj.b = 0;\r\n/* 299:321 */ return true;\r\n/* 300: */ }\r\n/* 301:323 */ return false;\r\n/* 302: */ }\r\n/* 303: */ catch (Throwable localThrowable)\r\n/* 304: */ {\r\n/* 305:325 */ b localb = b.a(localThrowable, \"Adding item to inventory\");\r\n/* 306:326 */ j localj = localb.a(\"Item being added\");\r\n/* 307: */ \r\n/* 308:328 */ localj.a(\"Item ID\", Integer.valueOf(alq.b(paramamj.b())));\r\n/* 309:329 */ localj.a(\"Item data\", Integer.valueOf(paramamj.i()));\r\n/* 310:330 */ localj.a(\"Item name\", new ahc(this, paramamj));\r\n/* 311: */ \r\n/* 312: */ \r\n/* 313: */ \r\n/* 314: */ \r\n/* 315: */ \r\n/* 316: */ \r\n/* 317:337 */ throw new u(localb);\r\n/* 318: */ }\r\n/* 319: */ }", "@Override public short getComplexity() {\n return 0;\n }", "@Test\n\tpublic void intersection() {\n\n\t\tlong n = 105;\n\t\tlong m = 100;\n\t\tfor(long i = n - 1; i > 1; i--){\n\t\t\tn = n * i;\n\t\t\tfor(long j = getZero(n); j > 0; j--){\n\t\t\t\tm = m * 10;\n\t\t\t}\n\t\t\tn = n % m;\n\t\t\tm = 100;\n\n\t\t\tSystem.out.println(n+\" \"+i);\n\n\t\t}\n\n\n\n\n\n\t}", "int run(char t, boolean o) {\n return !o & ++total > bench ? t == 'e' ? notOks.add(total) ? t : d : ++ok\n : t == 's' & bench++ <= total ? ++s + ++ok\n : t == 'a' ? ++a + ++ok\n : t < 'c' & notOks.add(total) ? ++b + ++ok\n : t > 'b' && t <= 'd' ? ++d\n : s;\n }", "public static void main(String[] args) {\n\t\tint a[]= {15,3,7,1,9,2};\n\t\tsubarraysum(a,11);//Time complexity O(n^2) space O(1)\n\n\t\tsubarraysum_reducecomplexity(a,11,a.length); //Time complexity O(n) space O(1)\n\n\t}", "public void mo21789N() {\n }", "public com.google.cX a(com.google.cM r5) {\n /*\n r4 = this;\n r0 = 0;\n r1 = com.google.bA.b;\n r2 = com.google.cM.k();\n if (r5 != r2) goto L_0x000a;\n L_0x0009:\n return r4;\n L_0x000a:\n r2 = r4.h;\n if (r2 != 0) goto L_0x003f;\n L_0x000e:\n r2 = com.google.cM.a(r5);\n r2 = r2.isEmpty();\n if (r2 != 0) goto L_0x0079;\n L_0x0018:\n r2 = r4.g;\n r2 = r2.isEmpty();\n if (r2 == 0) goto L_0x002e;\n L_0x0020:\n r2 = com.google.cM.a(r5);\n r4.g = r2;\n r2 = r4.f;\n r2 = r2 & -2;\n r4.f = r2;\n if (r1 == 0) goto L_0x003a;\n L_0x002e:\n r4.j();\n r2 = r4.g;\n r3 = com.google.cM.a(r5);\n r2.addAll(r3);\n L_0x003a:\n r4.g();\n if (r1 == 0) goto L_0x0079;\n L_0x003f:\n r2 = com.google.cM.a(r5);\n r2 = r2.isEmpty();\n if (r2 != 0) goto L_0x0079;\n L_0x0049:\n r2 = r4.h;\n r2 = r2.i();\n if (r2 == 0) goto L_0x0070;\n L_0x0051:\n r2 = r4.h;\n r2.b();\n r4.h = r0;\n r2 = com.google.cM.a(r5);\n r4.g = r2;\n r2 = r4.f;\n r2 = r2 & -2;\n r4.f = r2;\n r2 = com.google.bL.d;\n if (r2 == 0) goto L_0x006c;\n L_0x0068:\n r0 = r4.b();\n L_0x006c:\n r4.h = r0;\n if (r1 == 0) goto L_0x0079;\n L_0x0070:\n r0 = r4.h;\n r1 = com.google.cM.a(r5);\n r0.a(r1);\n L_0x0079:\n r4.a(r5);\n r0 = r5.getUnknownFields();\n r4.a(r0);\n goto L_0x0009;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.cX.a(com.google.cM):com.google.cX\");\n }", "public static void main(String[] args) {\n\t\t\n\t\tint A[]= new int[100000000];\n\t\tfor(int i = 0; i < 100000000; i++) {\n\t\t A[i] = (int)(Math.random() * 100) + 1;\n }\n double duration = 0;\n long end = 0;\n long start = 0;\n start = System.currentTimeMillis();\n System.out.println(start);\n MinValueIndex(A, 6);\n end = System.currentTimeMillis();\n\t\tduration = end-start;\n\t\tSystem.out.println(end); \n\t\tduration = duration / 5;\n\t\tSystem.out.println(duration);\n\t}", "private int m3423z(int i, int i2) {\n int i3;\n int i4;\n for (int size = this.f4373c.size() - 1; size >= 0; size--) {\n C0933b bVar = this.f4373c.get(size);\n int i5 = bVar.f4379a;\n if (i5 == 8) {\n int i6 = bVar.f4380b;\n int i7 = bVar.f4382d;\n if (i6 < i7) {\n i4 = i6;\n i3 = i7;\n } else {\n i3 = i6;\n i4 = i7;\n }\n if (i < i4 || i > i3) {\n if (i < i6) {\n if (i2 == 1) {\n bVar.f4380b = i6 + 1;\n bVar.f4382d = i7 + 1;\n } else if (i2 == 2) {\n bVar.f4380b = i6 - 1;\n bVar.f4382d = i7 - 1;\n }\n }\n } else if (i4 == i6) {\n if (i2 == 1) {\n bVar.f4382d = i7 + 1;\n } else if (i2 == 2) {\n bVar.f4382d = i7 - 1;\n }\n i++;\n } else {\n if (i2 == 1) {\n bVar.f4380b = i6 + 1;\n } else if (i2 == 2) {\n bVar.f4380b = i6 - 1;\n }\n i--;\n }\n } else {\n int i8 = bVar.f4380b;\n if (i8 <= i) {\n if (i5 == 1) {\n i -= bVar.f4382d;\n } else if (i5 == 2) {\n i += bVar.f4382d;\n }\n } else if (i2 == 1) {\n bVar.f4380b = i8 + 1;\n } else if (i2 == 2) {\n bVar.f4380b = i8 - 1;\n }\n }\n }\n for (int size2 = this.f4373c.size() - 1; size2 >= 0; size2--) {\n C0933b bVar2 = this.f4373c.get(size2);\n if (bVar2.f4379a == 8) {\n int i9 = bVar2.f4382d;\n if (i9 == bVar2.f4380b || i9 < 0) {\n this.f4373c.remove(size2);\n mo7620a(bVar2);\n }\n } else if (bVar2.f4382d <= 0) {\n this.f4373c.remove(size2);\n mo7620a(bVar2);\n }\n }\n return i;\n }", "public void mo21787L() {\n }", "public abstract int mo9754s();", "@Override\r\n public long problem1(int size) {\r\n StringBuilder sb = new StringBuilder();\r\n long start = System.currentTimeMillis();\r\n for (int i=0; i<size; i++) {\r\n sb.append(i);\r\n }\r\n long end = System.currentTimeMillis();\r\n return end - start;\r\n }", "void mo119581a();", "private void level5() {\n }", "public int a(alq paramalq, int paramInt1, int paramInt2, fn paramfn)\r\n/* 120: */ {\r\n/* 121:137 */ int i = 0;\r\n/* 122: */ amj localamj;\r\n/* 123: */ int k;\r\n/* 124:138 */ for (int j = 0; j < this.a.length; j++)\r\n/* 125: */ {\r\n/* 126:139 */ localamj = this.a[j];\r\n/* 127:140 */ if (localamj != null) {\r\n/* 128:143 */ if ((paramalq == null) || (localamj.b() == paramalq)) {\r\n/* 129:146 */ if ((paramInt1 <= -1) || (localamj.i() == paramInt1)) {\r\n/* 130:149 */ if ((paramfn == null) || (cy.a(paramfn, localamj.o(), true)))\r\n/* 131: */ {\r\n/* 132:153 */ k = paramInt2 <= 0 ? localamj.b : Math.min(paramInt2 - i, localamj.b);\r\n/* 133:154 */ i += k;\r\n/* 134:155 */ if (paramInt2 != 0)\r\n/* 135: */ {\r\n/* 136:156 */ this.a[j].b -= k;\r\n/* 137:157 */ if (this.a[j].b == 0) {\r\n/* 138:158 */ this.a[j] = null;\r\n/* 139: */ }\r\n/* 140:160 */ if ((paramInt2 > 0) && (i >= paramInt2)) {\r\n/* 141:161 */ return i;\r\n/* 142: */ }\r\n/* 143: */ }\r\n/* 144: */ }\r\n/* 145: */ }\r\n/* 146: */ }\r\n/* 147: */ }\r\n/* 148: */ }\r\n/* 149:165 */ for (j = 0; j < this.b.length; j++)\r\n/* 150: */ {\r\n/* 151:166 */ localamj = this.b[j];\r\n/* 152:167 */ if (localamj != null) {\r\n/* 153:170 */ if ((paramalq == null) || (localamj.b() == paramalq)) {\r\n/* 154:173 */ if ((paramInt1 <= -1) || (localamj.i() == paramInt1)) {\r\n/* 155:176 */ if ((paramfn == null) || (cy.a(paramfn, localamj.o(), false)))\r\n/* 156: */ {\r\n/* 157:180 */ k = paramInt2 <= 0 ? localamj.b : Math.min(paramInt2 - i, localamj.b);\r\n/* 158:181 */ i += k;\r\n/* 159:182 */ if (paramInt2 != 0)\r\n/* 160: */ {\r\n/* 161:183 */ this.b[j].b -= k;\r\n/* 162:184 */ if (this.b[j].b == 0) {\r\n/* 163:185 */ this.b[j] = null;\r\n/* 164: */ }\r\n/* 165:187 */ if ((paramInt2 > 0) && (i >= paramInt2)) {\r\n/* 166:188 */ return i;\r\n/* 167: */ }\r\n/* 168: */ }\r\n/* 169: */ }\r\n/* 170: */ }\r\n/* 171: */ }\r\n/* 172: */ }\r\n/* 173: */ }\r\n/* 174:193 */ if (this.f != null)\r\n/* 175: */ {\r\n/* 176:194 */ if ((paramalq != null) && (this.f.b() != paramalq)) {\r\n/* 177:195 */ return i;\r\n/* 178: */ }\r\n/* 179:197 */ if ((paramInt1 > -1) && (this.f.i() != paramInt1)) {\r\n/* 180:198 */ return i;\r\n/* 181: */ }\r\n/* 182:200 */ if ((paramfn != null) && (!cy.a(paramfn, this.f.o(), false))) {\r\n/* 183:201 */ return i;\r\n/* 184: */ }\r\n/* 185:204 */ j = paramInt2 <= 0 ? this.f.b : Math.min(paramInt2 - i, this.f.b);\r\n/* 186:205 */ i += j;\r\n/* 187:206 */ if (paramInt2 != 0)\r\n/* 188: */ {\r\n/* 189:207 */ this.f.b -= j;\r\n/* 190:208 */ if (this.f.b == 0) {\r\n/* 191:209 */ this.f = null;\r\n/* 192: */ }\r\n/* 193:211 */ if ((paramInt2 > 0) && (i >= paramInt2)) {\r\n/* 194:212 */ return i;\r\n/* 195: */ }\r\n/* 196: */ }\r\n/* 197: */ }\r\n/* 198:217 */ return i;\r\n/* 199: */ }", "protected void method_4160() {\r\n String[] var10000 = class_752.method_4253();\r\n ++this.field_3416;\r\n String[] var1 = var10000;\r\n int var7 = this.field_3416;\r\n if(var1 != null) {\r\n label96: {\r\n if(this.field_3416 >= 180) {\r\n var7 = this.field_3416;\r\n if(var1 == null) {\r\n break label96;\r\n }\r\n\r\n if(this.field_3416 <= 200) {\r\n float var2 = (this.field_3028.nextFloat() - 0.5F) * 8.0F;\r\n float var3 = (this.field_3028.nextFloat() - 0.5F) * 4.0F;\r\n float var4 = (this.field_3028.nextFloat() - 0.5F) * 8.0F;\r\n String[] var10001 = field_3418;\r\n this.field_2990.method_2087(\"hugeexplosion\", this.field_2994 + (double)var2, this.field_2995 + 2.0D + (double)var3, this.field_2996 + (double)var4, 0.0D, 0.0D, 0.0D);\r\n }\r\n }\r\n\r\n var7 = this.field_2990.field_1832;\r\n }\r\n }\r\n\r\n int var5;\r\n int var6;\r\n class_715 var9;\r\n ahb var10;\r\n label101: {\r\n short var8;\r\n label102: {\r\n if(var1 != null) {\r\n label85: {\r\n if(var7 == 0) {\r\n var7 = this.field_3416;\r\n var8 = 150;\r\n if(var1 != null) {\r\n label80: {\r\n if(this.field_3416 > 150) {\r\n var7 = this.field_3416 % 5;\r\n if(var1 == null) {\r\n break label80;\r\n }\r\n\r\n if(var7 == 0) {\r\n var5 = 1000;\r\n\r\n while(var5 > 0) {\r\n var6 = class_715.method_4090(var5);\r\n var5 -= var6;\r\n var10 = this.field_2990;\r\n var9 = new class_715;\r\n var9.method_4087(this.field_2990, this.field_2994, this.field_2995, this.field_2996, var6);\r\n var10.method_2089(var9);\r\n if(var1 == null) {\r\n break label85;\r\n }\r\n\r\n if(var1 == null) {\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n var7 = this.field_3416;\r\n }\r\n\r\n var8 = 1;\r\n }\r\n\r\n if(var1 == null) {\r\n break label102;\r\n }\r\n\r\n if(var7 == var8) {\r\n this.field_2990.method_2209(1018, (int)this.field_2994, (int)this.field_2995, (int)this.field_2996, 0);\r\n }\r\n }\r\n\r\n this.method_3864(0.0D, 0.10000000149011612D, 0.0D);\r\n this.field_3330 = this.field_3000 += 20.0F;\r\n }\r\n\r\n var7 = this.field_3416;\r\n }\r\n\r\n if(var1 == null) {\r\n break label101;\r\n }\r\n\r\n var8 = 200;\r\n }\r\n\r\n if(var7 != var8) {\r\n return;\r\n }\r\n\r\n var7 = this.field_2990.field_1832;\r\n }\r\n\r\n if(var1 != null) {\r\n if(var7 != 0) {\r\n return;\r\n }\r\n\r\n var7 = 2000;\r\n }\r\n\r\n var5 = var7;\r\n\r\n while(true) {\r\n if(var5 > 0) {\r\n var6 = class_715.method_4090(var5);\r\n var5 -= var6;\r\n var10 = this.field_2990;\r\n var9 = new class_715;\r\n var9.method_4087(this.field_2990, this.field_2994, this.field_2995, this.field_2996, var6);\r\n var10.method_2089(var9);\r\n if(var1 == null) {\r\n break;\r\n }\r\n\r\n if(var1 != null) {\r\n continue;\r\n }\r\n }\r\n\r\n this.method_4325(class_1715.method_9561(this.field_2994), class_1715.method_9561(this.field_2996));\r\n break;\r\n }\r\n\r\n this.method_3851();\r\n }", "void mo57277b();", "public void mo21785J() {\n }", "public static void main(String[] args) throws IOException {\n\t\tbr = new BufferedReader(new FileReader(new File(\"input.txt\")));\r\n\t\tSystem.setOut(new PrintStream(new File(\"output.txt\")));\r\n\t\tint T = readInt();\r\n\t\t\r\n\t\tfor (int ind = 1; ind<=T; ind++) {\r\n\t\t\tSystem.out.print(\"Case #\" + ind + \": \");\r\n\t\t\t\r\n\t\t\tint N = readInt();\r\n\t\t\tint[] ar = readIntArr();\r\n\t\t\tfor (int i = 0; i < N; i++)ar[i]--;\r\n\t\t\tboolean used[] = new boolean[N];\r\n\t\t\tint ans = 0;\r\n\t\t\tint pairMax = 0;\r\n\t\t\tint cycleMax = 0;\r\n\t\t\tint cyclePair = 0;\r\n\t\t\tint pair = 0;\r\n\t\t\tfor (int i = 0; i < N; i++) {\r\n\t\t\t\tif (!used[i]) {\r\n\t\t\t\t\tList<Integer> list = new LinkedList<Integer>();\r\n\t\t\t\t\tlist.add(i);\r\n\t\t\t\t\tused[i] = true;\r\n\t\t\t\t\tint j = ar[i];\r\n\t\t\t\t\twhile(!list.contains(j) && !used[j]) {\r\n\t\t\t\t\t\tlist.add(j);\r\n\t\t\t\t\t\tused[j] = true;\r\n\t\t\t\t\t\tj = ar[j];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!list.contains(j))continue;\r\n\t\t\t\t\tif (list.size() == 2)pair++;\r\n\t\t\t\t\tboolean removed = false;\r\n\t\t\t\t\twhile(list.get(0) != j){list.remove(0);removed = true;}\r\n\t\t\t\t\tif (list.size() > 2 && list.size() > cycleMax) cycleMax = list.size();\r\n\t\t\t\t\tif (list.size() == 2) {\r\n\t\t\t\t\t\tint a = list.remove(0);\r\n\t\t\t\t\t\tint b = list.remove(0);\r\n\t\t\t\t\t\tint tmp = 2;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tboolean us[] = new boolean[N];\r\n\t\t\t\t\t\t\tus[a] = true;\r\n\t\t\t\t\t\t\tus[b] = true;\r\n\t\t\t\t\t\t\t//System.out.println(\" test \" + a + b);\r\n\t\t\t\t\t\t\tSet<Integer> set = new HashSet<Integer>();\r\n\t\t\t\t\t\t\tset.add(a);\r\n\t\t\t\t\t\t\twhile (true) {\r\n\t\t\t\t\t\t\t\tboolean found = false;\r\n\t\t\t\t\t\t\t\tSet<Integer> tSet = new HashSet<Integer>();\r\n\t\t\t\t\t\t\t\tfor (int ii = 0; ii < N; ii++) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif (!us[ii] && set.contains(ar[ii])) {\r\n\t\t\t\t\t\t\t\t\t\tus[ii] = true;\r\n\t\t\t\t\t\t\t\t\t\tfound = true;\r\n\t\t\t\t\t\t\t\t\t\ttSet.add(ii);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (found)tmp++;\r\n\t\t\t\t\t\t\t\tif (!found)break;\r\n\t\t\t\t\t\t\t\tset.addAll(tSet);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tset = new HashSet<Integer>();\r\n\t\t\t\t\t\t\tset.add(b);\r\n\t\t\t\t\t\t\twhile (true) {\r\n\t\t\t\t\t\t\t\tboolean found = false;\r\n\t\t\t\t\t\t\t\tSet<Integer> tSet = new HashSet<Integer>();\r\n\t\t\t\t\t\t\t\tfor (int ii = 0; ii < N; ii++) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif (!us[ii] && set.contains(ar[ii])) {\r\n\t\t\t\t\t\t\t\t\t\tus[ii] = true;\r\n\t\t\t\t\t\t\t\t\t\tfound = true;\r\n\t\t\t\t\t\t\t\t\t\ttSet.add(ii);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif(found)tmp++;\r\n\t\t\t\t\t\t\t\tif (!found)break;\r\n\t\t\t\t\t\t\t\tset.addAll(tSet);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//if (removed) {\r\n\t\t\t\t\t\t//\tif (tmp > cyclePair)cyclePair = tmp;\r\n\t\t\t\t\t\t//} else {\r\n\t\t\t\t\t\t pairMax += tmp;\r\n\t\t\t\t\t\t//}\r\n\t\t\t\t\t} else {\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\r\n\t\t\t//cyclePair += 2 * pair;\r\n\t\t\t//if (pair > 1) pairMax += 2 * (pair - 1);\r\n\t\t\tans = Math.max(cyclePair, pairMax);\r\n\t\t\tans = Math.max(cycleMax, ans);\r\n\t\t\tSystem.out.println(ans);\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\r\n\t}", "public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new FileReader(\"superbull.in\"));\n PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter(\"superbull.out\")));\n //Only in a tree is the winner condition(as stated in problem) satisfied\n int N = Integer.parseInt(br.readLine());\n \n long ret = 0;\n \n int[] nums = new int[N];\n for(int i = 0; i<N; i++) nums[i] = Integer.parseInt(br.readLine());\n int[] prims = new int[N]; //for dense graphs: N edges each. Loop thru edges anyways, so selection sort remove log factor\n Arrays.fill(prims, Integer.MIN_VALUE);\n prims[0] = -1;\n int curr = 0;\n \n for(int i = 0; i<N-1; i++){\n int max = Integer.MIN_VALUE;\n int next = -1;\n for(int j = 0; j<N; j++){\n if(prims[j] == -1) continue;\n \n int xor = nums[curr]^nums[j];\n prims[j] = Math.max(prims[j], xor);\n \n if(prims[j] > max){\n next = j;\n max = prims[j];\n }\n }\n ret += max;\n prims[next] = -1;\n curr = next;\n }\n pw.println(ret);\n pw.close();\n br.close();\n }", "private boolean kcss(int[] i, long[] e, long y) {\n int I = i.length;\n long[] x = new long[I];\n while (true) {\n x[0] = ll(i[0]); // 1\n snapshot(i, 1, I, x); // 2\n if (Arrays.compare(x, e) != 0) { // 3\n sc(i[0], x[0]); // 3a\n return false; // 3a\n }\n if (sc(i[0], y)) return true; // 3b\n } // 3c\n }", "void mo54452q(int i);", "public void mo21786K() {\n }", "public static void main(String... args) {\n\n Set<Long> As = new HashSet<>();\n int N = 100;\n for (long p = -N; p <= N; ++p) {\n for (long q = -N; q <= p; ++q) {\n for (long r = -N; r <= q; ++r) {\n if (r==0 || p==0 || q==0)\n continue;\n\n long nom = r*p*q;\n long den = r*p + r*q + p*q;\n\n if (den != 0 && nom % den==0 && (nom^den)>=0) {\n long A = nom/den;\n\n if (A==nom) {\n As.add(A);\n System.out.printf(\"A=%d (p=%d, q=%d, r=%d)\\n\", A, p, q, r);\n }\n }\n }\n }\n }\n Long[] aa = As.toArray(new Long[As.size()]);\n Arrays.sort(aa);\n System.out.printf(\"============\\n\");\n System.out.printf(\"A(%d)=%s\\n\", aa.length, Arrays.toString(aa));\n\n for (long a = 1; a < 100; ++a) {\n if (isAlexandrian(a))\n System.out.printf(\"A=%dn\", a);\n }\n }", "private int d(amj paramamj)\r\n/* 50: */ {\r\n/* 51: 70 */ for (int i = 0; i < this.a.length; i++) {\r\n/* 52: 71 */ if ((this.a[i] != null) && (this.a[i].b() == paramamj.b()) && (this.a[i].d()) && (this.a[i].b < this.a[i].c()) && (this.a[i].b < p_()) && ((!this.a[i].f()) || (this.a[i].i() == paramamj.i())) && (amj.a(this.a[i], paramamj))) {\r\n/* 53: 72 */ return i;\r\n/* 54: */ }\r\n/* 55: */ }\r\n/* 56: 75 */ return -1;\r\n/* 57: */ }", "public void mo21794S() {\n }", "public void mo21878t() {\n }", "public abstract void mo4363a(int i, long j);", "public static void main(String[] args) throws IOException{\n Reader sc = new Reader();\n \n int n=sc.nextInt();\n int m=sc.nextInt();\n \n int ans[]=new int[n];\n \n for(int i=0;i<m;i++)\n {\n int l=sc.nextInt();\n int r=sc.nextInt();\n // indexing is 1 based.\n l--;\n r--;\n \n ans[l]++;\n if(r!=n-1)\n {\n ans[r+1]--;\n \n } \n \n }\n \n int s=0;\n int max=0;\n for(int i=0;i<n;i++)\n {\n s+=ans[i];\n ans[i]=s;\n if(s>max)\n {\n max=s;\n }\n }\n \n int brr[]=new int[max+1];\n for(int i=0;i<n;i++)\n {\n brr[ans[i]]++;\n \n }\n \n s=0;\n for(int i=max;i>=0;i--)\n {\n s+=brr[i];\n brr[i]=s;\n \n }\n \n int q=sc.nextInt();\n for(int i=0;i<q;i++)\n {\n int x=sc.nextInt();\n if(x>max)\n {\n System.out.println(0);\n }\n else\n \tSystem.out.println(brr[x]);\n }\n \n\t}", "public static void main(String args[] ) throws Exception {\n Scanner scanner = new Scanner(System.in);\n int n = scanner.nextInt();\n int[] seqArray = new int[n];\n for (int i = 0; i < n; i++) {\n seqArray[i] = scanner.nextInt();\n }\n // getSeqValue(seqArray); //this method is an accepted one on Hackerrank but time complexity is not order n; i.e. !O(n);\n getLinearOrderY(seqArray); // trying to get O(n) time complexity;\n }", "@Override\r\n\tpublic int challengeFive(Comparable[] arr, Comparable query) {\n\t\treturn 0;\r\n\t}", "public String run() {\r\n\t// divisorSum[n] is the sum of all the proper divisors of n\r\n int divisorSum[]= new int[LIMIT+1];\r\n for(int i=1;i<=LIMIT;i++)\r\n {\r\n for(int j=i+i;j<=LIMIT;j+=i)\r\n divisorSum[j]+=i;\r\n }\r\n // Analyze the amicable chain length for each number in ascending order\r\n int maxChainLen=0;\r\n int minChainElem=-1;\r\n for(int i=0;i<=LIMIT;i++){\r\n Set<Integer> visited=new HashSet<>();\r\n for(int count=1,cur=i;;count++){\r\n visited.add(cur);\r\n int next=divisorSum[cur];\r\n if(next==i)\r\n {\r\n if(count>maxChainLen){\r\n minChainElem=i;\r\n maxChainLen=count;\r\n \r\n }\r\n break;\r\n }\r\n // Exceeds limit or not a chain (a rho shape instead)\r\n else if(next>LIMIT || visited.contains(next))\r\n break;\r\n else\r\n cur=next;\r\n }\r\n }\r\n return Integer.toString(minChainElem);\r\n }", "private int d(@Nullable K ☃) {\r\n/* 127 */ return (xq.f(System.identityHashCode(☃)) & Integer.MAX_VALUE) % this.b.length;\r\n/* */ }\r\n/* */ private int b(@Nullable K ☃, int i) {\r\n/* */ int j;\r\n/* 131 */ for (j = i; j < this.b.length; j++) {\r\n/* 132 */ if (this.b[j] == ☃) {\r\n/* 133 */ return j;\r\n/* */ }\r\n/* 135 */ if (this.b[j] == a) {\r\n/* 136 */ return -1;\r\n/* */ }\r\n/* */ }", "public static int example4(int[] arr) { // O(1)\r\n\t\tint n = arr.length, prefix = 0, total = 0; // O(1), O(1), (1)\r\n\t\tfor (int j = 0; j < n; j++) { // loop from 0 to n-1 // O(n)\r\n\t\t\tprefix += arr[j];\r\n\t\t\ttotal += prefix;\r\n\t\t}\r\n\t\treturn total;\r\n\r\n\t\t/*\r\n\t\t * Explanation: The method contains a (for) loop and it runs (n) times.This loop\r\n\t\t * dominates the runtime.We always aim for the worse-case and maximum time. The\r\n\t\t * answer is it is linear time of O(n) notation.\r\n\t\t * \r\n\t\t */\r\n\t}", "public abstract int mo9749n();", "public static void main(String[] args) {\n List<Integer> pr = new ArrayList<>();\n out:\n for (int p = 2; p <= 100; p++) {\n for (int q : pr) {\n if (p % q == 0) {\n continue out;\n }\n }\n pr.add(p);\n }\n Set<List<Integer>> s = new HashSet<>();\n for (int a = 2; a <= 100; a++) {\n List<Integer> l = new ArrayList<>();\n for (int p : pr) {\n int e = 0;\n for (int c = a; c % p == 0; c /= p) {\n e++;\n }\n l.add(e);\n }\n for (int b = 2; b <= 100; b++) {\n List<Integer> m = new ArrayList<>();\n for (int e : l) {\n m.add(b * e);\n }\n s.add(m);\n }\n }\n System.out.println(s.size());\n }", "public static void main(String[] args) {\n\n long a_i3 = 3;\n long a_i2 = 4;\n long a_i1 = 10;\n\n int MOD = 1000_000_000 + 7;\n\n for (int i = 4; i < 30; i++) {\n long a_i = (a_i1 + 2 * a_i2 + 4 * a_i3) % MOD;\n System.out.println(\"N: \" + i + \" --> \" + a_i);\n\n a_i3 = a_i2;\n a_i2 = a_i1;\n a_i1 = a_i;\n }\n\n old1();\n }", "public com.google.cr a(com.google.ca r5) {\n /*\n r4 = this;\n r0 = 0;\n r1 = com.google.bA.b;\n r2 = com.google.ca.d();\n if (r5 != r2) goto L_0x000a;\n L_0x0009:\n return r4;\n L_0x000a:\n r2 = r4.f;\n if (r2 != 0) goto L_0x003f;\n L_0x000e:\n r2 = com.google.ca.b(r5);\n r2 = r2.isEmpty();\n if (r2 != 0) goto L_0x0079;\n L_0x0018:\n r2 = r4.g;\n r2 = r2.isEmpty();\n if (r2 == 0) goto L_0x002e;\n L_0x0020:\n r2 = com.google.ca.b(r5);\n r4.g = r2;\n r2 = r4.h;\n r2 = r2 & -2;\n r4.h = r2;\n if (r1 == 0) goto L_0x003a;\n L_0x002e:\n r4.d();\n r2 = r4.g;\n r3 = com.google.ca.b(r5);\n r2.addAll(r3);\n L_0x003a:\n r4.g();\n if (r1 == 0) goto L_0x0079;\n L_0x003f:\n r2 = com.google.ca.b(r5);\n r2 = r2.isEmpty();\n if (r2 != 0) goto L_0x0079;\n L_0x0049:\n r2 = r4.f;\n r2 = r2.i();\n if (r2 == 0) goto L_0x0070;\n L_0x0051:\n r2 = r4.f;\n r2.b();\n r4.f = r0;\n r2 = com.google.ca.b(r5);\n r4.g = r2;\n r2 = r4.h;\n r2 = r2 & -2;\n r4.h = r2;\n r2 = com.google.bL.d;\n if (r2 == 0) goto L_0x006c;\n L_0x0068:\n r0 = r4.k();\n L_0x006c:\n r4.f = r0;\n if (r1 == 0) goto L_0x0079;\n L_0x0070:\n r0 = r4.f;\n r1 = com.google.ca.b(r5);\n r0.a(r1);\n L_0x0079:\n r4.a(r5);\n r0 = r5.getUnknownFields();\n r4.a(r0);\n goto L_0x0009;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.cr.a(com.google.ca):com.google.cr\");\n }", "void h(List<List<Integer>> r, List<Integer> t, int n, int s){ \n for(int i = s; i*i <= n; i++){\n if(n % i != 0) continue; \n t.add(i);\n t.add(n / i);\n r.add(new ArrayList<>(t));\n t.remove(t.size() - 1);\n h(r, t, n/i, i);\n t.remove(t.size() - 1);\n }\n }", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int q = sc.nextInt();\n\n for(int k = 0; k < q; k++) {\n int m = sc.nextInt();\n int n = sc.nextInt();\n\n // indicate number of pieces\n long x = 1;\n long y = 1;\n \n ArrayList<Long> c_y = new ArrayList<Long>();\n for(int i = 0; i < m - 1; i++) {\n c_y.add(sc.nextLong());\n }\n \n ArrayList<Long> c_x = new ArrayList<Long>();\n for(int i = 0; i < n - 1; i++) {\n c_x.add(sc.nextLong());\n }\n\n Collections.sort(c_y, Collections.reverseOrder());\n Collections.sort(c_x, Collections.reverseOrder());\n\n // cut: most expensive = cut first\n int index_X = 0;\n int index_Y = 0;\n long totalCost = 0;\n\n while(!(x == n && y == m)) {\n if(x < n && y < m) {\n // compare cost to decide whether cut horizontally or vertically\n if(c_y.get(index_Y) >= c_x.get(index_X)) {\n totalCost += c_y.get(index_Y) * x;\n y++;\n index_Y++;\n } else if(c_y.get(index_Y) < c_x.get(index_X)) {\n totalCost += c_x.get(index_X) * y;\n x++;\n index_X++; \n }\n } else if(x == n && y < m) {\n totalCost += c_y.get(index_Y) * x;\n index_Y++;\n y++;\n } else if(x < n && y == m) {\n totalCost += c_x.get(index_X) * y;\n index_X++;\n x++;\n }\n }\n\n totalCost = totalCost % (long)(Math.pow(10, 9) + 7);\n System.out.println(totalCost );\n }\n }", "public abstract void mo9801a(int i, long j);", "public void verliesLeven() {\r\n\t\t\r\n\t}", "public static int Main()\n\t {\n\t\t int x;\n\t\t int j;\n\t\t int[] a = new int[16];\n\t\t x = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\t int i = 1;\n\t\t int k = 0;\n\t\t while (x != -1)\n\t\t {\n\t\t\ta[i] = x;\n\t\t\ti++;\n\t\t if (x != 0)\n\t\t {\n\t\t\t k = i;\n\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\tint sum = 0;\n\t\t\t for (i = 1;i <= k;i++)\n\t\t\t {\n\t\t\t\t for (j = 1;j <= k ;j++)\n\t\t\t\t {\n\t\t\t\t if (a[i] == 2 * a[j])\n\t\t\t\t {\n\t\t\t\t\t sum++;\n\t\t\t\t }\n\t\t\t\t }\n\t\t\t }\n\t\t\t\t\tSystem.out.print((sum - 1));\n\t\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t\t\ti = 1;\n\t\t\t }\n\t\t\tx = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\t }\n\t\t\treturn 0;\n\t }", "public static void main(String[] args) throws Exception {\n\t\tScanner scn = new Scanner(System.in);\r\n\t\tint tc = scn.nextInt();\r\n\t\tfor(int t=1; t<=tc; t++) {\r\n\t\t\tint n = scn.nextInt();\r\n\t\t\tint k = scn.nextInt();\r\n\t\t\tString str = scn.next();\r\n\t\t\tString arr[] = new String[n];\r\n\t\t\tarr = str.split(\"\");\r\n\t\t\tLinkedList<String> list = new LinkedList<>();\r\n\t\t\tLinkedList<Integer> result = new LinkedList<>();\r\n\t\t\tfor(int i=0; i<n; i++) {\r\n\t\t\t\tlist.add(arr[i]);\r\n\t\t\t}\r\n\t\t\tint comeback = 0;\r\n\t\t\twhile(comeback<4) {\r\n\t\t\t\tint cnt = 0;\r\n\t\t\t\tcomeback = 0;\r\n\t\t\t\tString st = \"\";\r\n\t\t\t\tfor(int i=0; i<n; i++) {\r\n\t\t\t\t\tif(cnt==(n/4)-1) {\r\n\t\t\t\t\t\tcnt = 0;\r\n\t\t\t\t\t\tst += list.get(i);\r\n\t\t\t\t\t\tint tmp = Integer.parseInt(st, 16);\r\n\t\t\t\t\t\tif(!isHave(result,tmp) && (result.size()>0)) {\r\n\t\t\t\t\t\t\tresult.add(tmp);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if(result.size() == 0){\r\n\t\t\t\t\t\t\tresult.add(tmp);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tcomeback++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tst = \"\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tst+= list.get(i);\r\n\t\t\t\t\t\tcnt++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\trotate(list);\r\n\t\t\t}\r\n\t\t\tCollections.sort(result);\r\n\t\t\tint cnt = 0;\r\n\t\t\tSystem.out.println(\"#\"+t+\" \"+result.get(result.size()-k));\t\t\t\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\t\tScanner scn = new Scanner(System.in);\n\t\tint t = scn.nextInt();\n\t\tfor(int i = 0; i<t; i++) {\n\t\t\tn = scn.nextInt();\n\t\t\tdistance = 0;\n\t\t\tdistancesum = 0;\n\t\t\tlist = new LinkedList[n+3];\n\t\t\tfor(int j = 1; j<=n+2; j++) {\n\t\t\t\tlist[j] = new LinkedList<>();\n\t\t\t}\n\t\t\tlist[1].add(scn.nextInt());\n\t\t\tlist[1].add(scn.nextInt());\n\t\t\tlist[n+2].add(scn.nextInt());\n\t\t\tlist[n+2].add(scn.nextInt());\n\t\t\t\n\t\t\tfor(int j = 2; j<n+2; j++) {\n\t\t\t\tlist[j].add(scn.nextInt());\n\t\t\t\tlist[j].add(scn.nextInt());\n\t\t\t}\n\t\t\t\n\t\t\tvisited = new boolean[n+2];\n\t\t\tcnt = 0;\n\t\t\tmin = 10000;\n\t\t\tfindLoot(list,2);\n\t\t\tSystem.out.println(\"#\"+(i+1)+\" \"+min);\n\t\t}\n\t\t\n\t}", "public void mo21782G() {\n }", "void mo41083a();", "@Override\r\n public long problem2() {\r\n ArrayList<String> arrList = new ArrayList<>();\r\n long start = System.currentTimeMillis(); \r\n for(int i = 0; i<1234567; i++){\r\n arrList.add(Integer.toString(i));\r\n }\r\n long end = System.currentTimeMillis(); \r\n return end - start; \r\n }", "public abstract long mo20901UQ();", "void mo13371a(int i, long j);", "private void m50366E() {\n }", "public abstract long mo9755t();", "public static void main(String args[] ) throws Exception {\n String l[] = br.readLine().split(\" \");\n long N = Long.parseLong(l[0]);\n long S = Long.parseLong(l[1]);\n long E = Long.parseLong(l[2]);\n TreeMap<Long,Long> t1 = new TreeMap<Long,Long>();\n TreeMap<Long,Long> t2 = new TreeMap<Long,Long>();\n for(int i=0;i<N;i++) {\n String s[] = br.readLine().split(\" \");\n long x = Long.parseLong(s[0]);\n long p = Long.parseLong(s[1]);\n t1.put((x-p),(x+p));\n }\n ArrayList<Long> l1 = new ArrayList<Long>(t1.keySet());\n ArrayList<Long> l2 = new ArrayList<Long>(t1.values());\n long c = l1.get(0);\n long d = l2.get(0);\n for(int i=1;i<t1.size();i++)\n {\n if(l1.get(i)<=d)\n d = Math.max(d,l2.get(i));\n else\n {\n \n t2.put(c,d);\n c = l1.get(i);\n d = l2.get(i);\n }\n \n }\n t2.put(c,d);\n int i;\n long ans = 0;\n l1=new ArrayList<Long>(t2.keySet());\n l2=new ArrayList<Long>(t2.values());\n \n \n for(i=0;i<l1.size();i++)\n {\n if(S>=E)\n {\n S=E;\n break;\n }\n if(l1.get(i)<=S && S<=l2.get(i))\n S = l2.get(i);\n \n else if(S<=l1.get(i) && E>=l2.get(i))\n {\n ans+=l1.get(i)-S;\n S = l2.get(i);\n \n }\n else if(S<=l1.get(i) && E>=l1.get(i) && E<=l2.get(i))\n {\n ans+=l1.get(i)-S;\n S = E;\n }\n else if(S<=l1.get(i) && E<=l1.get(i))\n {\n ans+=E-S;\n S = E;\n }\n }\n if(S<E)\n ans+=E-S;\n pw.println(ans);\n \n pw.close();\n }", "public static void main(String[] args){\n\t\t\n\t\tfor (int i = 0; i<999999;i++) results.add(0);\t\n\n\t\tsetChain(1L);\n\t\tboolean switcher = true;\n\t\t//while switch=true ... and once chain length is added to, switch = false\n \t\tlong best = 0L;\n\t\tint index=0;\n\t\t\t\n\t\tfor (long j = 1L; j < 1000000L; j++) {\n\n\t\t\tsetCur((int)j);\n\n\t\t\tfindChain(j);//} catch(Exception e){System.out.println(\"stackOverFlow :D\");}\n\t\t\tif (getChain() > best) {best = getChain(); index=getCur();}\n\t\t\t//now store results for later use if we come across that number.\n\t\t\tresults.set(getCur()-1, (int)getChain());\t\n\t\t\tsetChain(1L); //reset\n\t\t\t/* \t\n\t\t\tswitcher=true;\n\t\t\tint i = j;\n\t\t\twhile (switcher) {\n\n\t\t\t\tif (i==1) {//results.add(chainLength); \n\t\t\t\t\tif (chainLength > best) { best=chainLength; index = j;}\n\t\t\t \tchainLength=1; switcher=false;}\n\t\n\t\t\t\telse { i=recurse(i); chainLength++; }\t\n\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t*/\n//\t\t }\n\t\t}\n\t\tSystem.out.println(index);\n\t}", "void mo119582b();", "public int[] fix34(int[] nums) {\r\n\tint i=0; // O(1)\r\n while(i<nums.length && nums[i]!=3) // O(n)\r\n i++; // n+1\r\n int j=i; // O(1)\r\n while(j+1<nums.length && nums[j+1]!=4) // O(n)\r\n j++; // n+1\r\n while(i<nums.length){ // O(n)\r\n if(nums[i]==3){ // O(1)\r\n int temp=nums[i+1]; // O(1)\r\n nums[i+1]=nums[j+1]; //O(1)\r\n nums[j+1]=temp; // O(1)\r\n while(j+1<nums.length && nums[j+1] != 4) //O(n)\r\n j++; // n+1\r\n }\r\n i++; // n+1\r\n }\r\n return nums; //O(1)\r\n}", "public void mo5382o() {\n }", "void mo1507n();", "public p207() {\n double target = 1/12345.0;\n double log2 = Math.log(2);\n\n for (int x = 2; x < 2000000; x++){\n double a = Math.floor(Math.log(x) / log2) / (x-1);\n if (a < target){\n System.out.println(x*(x-1L));\n break;\n }\n }\n }", "private static void cajas() {\n\t\t\n\t}", "public static void main(String[] args) \n\t{\n\t\t int i=20, j=40;\n\t\t int k=0;\n\t\t ArrayList<Integer> l1=new ArrayList<Integer>();\n\t\t ArrayList<Integer> l2=new ArrayList<Integer>();\n\t\t for(int a=i;a<=j;a++){\n\t\t int count=0;\n\t\t for(int b=2;b<a;b++)\n\t\t if(a%b==0)\n\t\t count++;\n\t\t if(count==0)\n\t\t l1.add(a); }\n\t\t for(int e=i;e<=j;e++)\n\t\t l2.add(e);\n\t\t l2.removeAll(l1);\n\t\t for(int d=0;d<l2.size();d++)\n\t\t k=k+l2.get(d);\n\t\t \n\t\tSystem.out.println(k);\n\t}", "public abstract long mo9750o();", "private void go(int i) {\n\t\tcol[i] = 1;\r\n\t\tint j = f[i];\r\n\t\tint cnt = 0;\r\n\t\tint delAll = 0;\r\n\t\tint[][] cd = new int[1000][3];\r\n\t\tint sa = 0;\r\n\t\tint sb = 0;\r\n\t\tint m1 = Integer.MAX_VALUE;\r\n\t\tint m2 = Integer.MAX_VALUE;\r\n\t\tint m1a = 0;\r\n\t\tint m2a = 0;\r\n\t\tint m1b = 0;\r\n\t\tint m2b = 0;\r\n\t\twhile (j != -1) {\r\n\t\t\tif (col[e[j]] == 0) {\r\n\t\t\t\tgo(e[j]);\r\n\t\t\t\tdelAll += a[e[j]];\r\n\t\t\t\tint dif = b[e[j]] - a[e[j]];\r\n\t\t\t\tif (dif < m1) {\r\n\t\t\t\t\tm2 = m1;\r\n\t\t\t\t\tm2b = m1b;\r\n\t\t\t\t\tm2a = m1a;\r\n\t\t\t\t\tm1 = dif;\r\n\t\t\t\t\tm1a = a[e[j]];\r\n\t\t\t\t\tm1b = b[e[j]];\r\n\t\t\t\t} else if (dif < m2) {\r\n\t\t\t\t\tm2 = dif;\r\n\t\t\t\t\tm2a = a[e[j]];\r\n\t\t\t\t\tm2b = b[e[j]];\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tsa += a[e[j]];\r\n\t\t\t\tsb += a[e[j]];\r\n\t\t\t\tcd[cnt][0] = a[e[j]];\r\n\t\t\t\tcd[cnt][1] = b[e[j]];\r\n\t\t\t\tcd[cnt][2] = b[e[j]] - a[e[j]];\r\n\t\t\t\tcnt++;\r\n\t\t\t}\r\n\t\t\tj = next[j];\r\n\t\t}\r\n\t\tif (cnt == 0) {\r\n\t\t\ta[i] = 1;\r\n\t\t\tb[i] = 0;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tArrays.sort(cd, new Comparator<int[]>() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic int compare(int[] o1, int[] o2) {\r\n\t\t\t\t// TODO Auto-generated method stub\t\t\t\t\r\n\t\t\t\treturn o1[2] - o2[2];\r\n\t\t\t}\r\n\t\t});\r\n\t\ta[i] = delAll + 1;\r\n\t\t//leave 0 or 2\r\n\t\tint cost1 = 0;\r\n\t\tint cost = 0;\r\n\t\tfor (j = 2; j < cnt; j++)\r\n\t\t\tcost1 += cd[j][0];\r\n\t\tif (cnt >= 2) {\r\n\t\t\tcost += m1b + m2b + sa - m1a - m2a;\r\n\t\t\tcost1 += cd[0][1] + cd[1][1];\r\n\t\t} else {\r\n\t\t\tcost += sa;\r\n\t\t\tcost1 += cd[0][0];\r\n\t\t}\r\n\t\tif (cost1 != cost)\r\n\t\t\tSystem.err.println(\"FUCK\");\r\n\t\tb[i] = cost;\r\n\t}", "private void method_259(int[] var1, int[] var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9, int var10, int var11, int var12, int var13, int var14, int var15) {\n boolean var28 = field_759;\n int var19 = var12 >> 16 & 255;\n int var20 = var12 >> 8 & 255;\n int var21 = var12 & 255;\n\n try {\n int var22 = var4;\n int var23 = -var8;\n if(var28 || var23 < 0) {\n do {\n int var24 = (var5 >> 16) * var11;\n int var25 = var13 >> 16;\n int var26 = var7;\n int var27;\n if(var25 < this.field_745) {\n var27 = this.field_745 - var25;\n var26 = var7 - var27;\n var25 = this.field_745;\n var4 += var9 * var27;\n }\n\n if(var25 + var26 >= this.field_746) {\n var27 = var25 + var26 - this.field_746;\n var26 -= var27;\n }\n\n var15 = 1 - var15;\n if(var15 != 0) {\n var27 = var25;\n if(var28 || var25 < var25 + var26) {\n do {\n var3 = var2[(var4 >> 16) + var24];\n if(var3 != 0) {\n label33: {\n int var16 = var3 >> 16 & 255;\n int var17 = var3 >> 8 & 255;\n int var18 = var3 & 255;\n if(var16 == var17 && var17 == var18) {\n var1[var27 + var6] = (var16 * var19 >> 8 << 16) + (var17 * var20 >> 8 << 8) + (var18 * var21 >> 8);\n if(!var28) {\n break label33;\n }\n }\n\n var1[var27 + var6] = var3;\n }\n }\n\n var4 += var9;\n ++var27;\n } while(var27 < var25 + var26);\n }\n }\n\n var5 += var10;\n var4 = var22;\n var6 += this.field_723;\n var13 += var14;\n ++var23;\n } while(var23 < 0);\n\n }\n } catch (Exception var29) {\n System.out.println(\"error in transparent sprite plot routine\"); // authentic System.out.println\n }\n }", "public static void main(String[] aArg) {\n int j = 1214740;\n int i;\n int z = 0;\n \n \n while (j > 5) {\n i = j;\n j--;\n Console.write(\"Badum\"); // + j +\"\\n\");\n \n \n while (i > 5) {\n if ((i % 2) == 0) {\n i = i / 2;\n } else {\n i = 1 + (i * 3);\n z++;\n }\n }\n \n \n }\n //System.out.println(z);\n if (z == 52591218)\n Console.write(\"Yahy!\");\n else\n Console.write(\"Nahy!\");\n }", "public abstract long mo9746k();", "public static void main(String[] args) throws IOException {\n\t\tbr = new BufferedReader(new InputStreamReader(System.in));\r\n\t\tout = new PrintWriter(System.out);\r\n\t\tsc = new StringTokenizer(\"\");\r\n\t\twhile(true){\r\n\t\t\tn = nxtInt();\r\n\t\t\tif(n == 0)\r\n\t\t\t\tbreak;\r\n\t\t\tm = nxtInt();\r\n\t\t\tvis = new int[n];\r\n\t\t\tvisited = new boolean[n];\r\n\t\t\tfor (int i = 0; i < n; i++) {\r\n\t\t\t\tgr[i] = new ArrayList<Integer>();\r\n\t\t\t\ttr[i] = new ArrayList<Integer>();\r\n\t\t\t\tvisited[i] = false;\r\n\t\t\t}\r\n\t\t\tint i = 0;\r\n\t\t\twhile(i < m){\r\n\t\t\t\tint f = nxtInt()-1;\r\n\t\t\t\tint to = nxtInt()-1;\r\n\t\t\t\tint p = nxtInt();\r\n\t\t\t\tgr[f].add(to);\r\n\t\t\t\ttr[to].add(f);\r\n\t\t\t\tif(p == 2){\r\n\t\t\t\t\tgr[to].add(f);\r\n\t\t\t\t\ttr[f].add(to);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t\tif(check()){\r\n\t\t\t\tSystem.out.println(1);\r\n\t\t\t}else{\r\n\t\t\t\tSystem.out.println(0);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public int n_()\r\n/* 429: */ {\r\n/* 430:442 */ return this.a.length + 4;\r\n/* 431: */ }", "public abstract void mo4383c(long j);", "public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int T = scanner.nextInt();\n assert T >=1;\n assert T<=100000;\n long []numArr = new long[T];\n for(int i=0; i<T; i++) {\n numArr[i] = scanner.nextLong ();\n assert numArr[i]>=1;\n assert numArr[i]<=1000000000;\n }\n\n for (long num : numArr) {\n int i=1;\n long sum=0;\n while(i*3<num) {\n sum +=i*3;\n if(i*5<num && i%3!=0)\n sum +=i*5;\n i++;\n }\n System.out.println(sum);\n }\n }", "public static void main(String[] args) {\n /* *************** */\n /* * QUESTION 7 * */\n /* *************** */\n /* *************** */\n\n for(double p=0; p<1; p+=0.1){\n for(double q=0; q<1; q+=0.1){\n int res_1 = 0;\n int res_2 = 0;\n for(int i=0; i<100; i++){\n Graph graph_1 = new Graph();\n graph_1.generate_full_symmetric(p, q, 100);\n //graph_2.setVertices(new ArrayList<>(graph_1.getVertices()));\n Graph graph_2 = (Graph) deepCopy(graph_1);\n res_1+=graph_1.resolve_heuristic_v1().size();\n res_2+=graph_2.resolve_heuristic_v2();\n }\n res_1/=100;\n System.out.format(\"V1 - f( %.1f ; %.1f) = %s \\n\", p, q, res_1);\n res_2/=100;\n System.out.format(\"V2 - f( %.1f ; %.1f) = %s \\n\", p, q, res_2);\n }\n }\n\n }" ]
[ "0.62750584", "0.59749866", "0.5870791", "0.57973725", "0.5751836", "0.57138026", "0.5643832", "0.56160057", "0.55788326", "0.5560758", "0.55513334", "0.55231345", "0.5503651", "0.5502847", "0.5496296", "0.5481784", "0.54813325", "0.54794115", "0.5468744", "0.5459127", "0.5458051", "0.545709", "0.54474235", "0.5442079", "0.54399234", "0.54371727", "0.54341984", "0.5432272", "0.54152817", "0.54141957", "0.5410629", "0.54104567", "0.54089266", "0.53905404", "0.53805035", "0.53685164", "0.53624266", "0.53610027", "0.53600764", "0.53525156", "0.5350503", "0.53475577", "0.5346661", "0.5342038", "0.5340314", "0.5340243", "0.53401136", "0.53311014", "0.5331003", "0.53281695", "0.53221977", "0.53178537", "0.5312895", "0.5311601", "0.53080904", "0.5305947", "0.53023106", "0.52984667", "0.5297797", "0.5296681", "0.5288104", "0.5281223", "0.52754444", "0.52723604", "0.526989", "0.52657336", "0.5264526", "0.5264145", "0.525974", "0.5257856", "0.5257797", "0.52577317", "0.5255752", "0.52555454", "0.5251492", "0.5246993", "0.52465224", "0.52461517", "0.52399296", "0.5239008", "0.52342916", "0.52316654", "0.5231603", "0.5230974", "0.5230599", "0.5228499", "0.5228013", "0.5225371", "0.5222869", "0.52173054", "0.5216983", "0.5215131", "0.52126044", "0.52112126", "0.5209594", "0.52058136", "0.5203309", "0.5202579", "0.52005976", "0.5199103", "0.519724" ]
0.0
-1
// mission 6 O(|A|),A is the numbers of points to erase//
public void narrowRange(int min, int max, Boolean axis) { int counter=0; // how much points we erasing total ? boolean erasingAll=false; // if we eventually erasing all the database // by axis X-----------------------------------------// if (axis){ this.current = this.minx; while (!erasingAll && this.current.getData().getX()<min){ narrowOppPoint(this.current,axis); // deleting this point in y axis this.current = this.current.getNextX(); counter++; if (this.current==null) //if we get to the edge of the DS erasingAll=true; } if (!erasingAll) this.current.setPrevX(null); this.minx = this.current; // the actual erasing //---// this.current = this.maxx; while (!erasingAll && this.current.getData().getX() > max){ narrowOppPoint(this.current,axis); this.current = this.current.getPrevX(); counter++; if (this.current==null) //if we get to the edge of the DS erasingAll=true; } if (!erasingAll) this.current.setNextX(null); this.maxx = this.current; //the actual erasing } // by axis Y -----------------------------------------------------------// else{ this.current = this.miny; while (!erasingAll && this.current.getData().getY()<min){ narrowOppPoint(this.current,axis); this.current = this.current.getNextY(); counter++; if (this.current==null) //if we get to the edge of the DS erasingAll=true; } if (!erasingAll) this.current.setPrevY(null); this.miny = this.current; //the actual erasing //--// this.current = this.maxy; while (!erasingAll && this.current.getData().getY() > max){ narrowOppPoint(this.current,axis); this.current = this.current.getPrevY(); counter++; if (this.current==null) //if we get to the edge of the DS erasingAll=true; } if (!erasingAll) this.current.setNextY(null); this.maxy = this.current; //the actual erasing } this.size = this.size - counter; // Update the size of the DS }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void erase();", "synchronized protected void removePoint(final int index) {\n \t\t// check preconditions:\n \t\tif (index < 0) {\n \t\t\treturn;\n \t\t} else if (n_points - 1 == index) {\n \t\t\t//last point out\n \t\t\tn_points--;\n \t\t} else {\n \t\t\t//one point out (but not the last)\n \t\t\t--n_points;\n \n \t\t\t// shift all points after 'index' one position to the left:\n \t\t\tfor (int i=index; i<n_points; i++) {\n \t\t\t\tp[0][i] = p[0][i+1];\t\t//the +1 doesn't fail ever because the n_points has been adjusted above, but the arrays are still the same size. The case of deleting the last point is taken care above.\n \t\t\t\tp[1][i] = p[1][i+1];\n \t\t\t\tp_layer[i] = p_layer[i+1];\n \t\t\t}\n \t\t}\n \n \t\t// Reset or fix autotracing records\n \t\tif (index < last_autotrace_start && n_points > 0) {\n \t\t\tlast_autotrace_start--;\n \t\t} else last_autotrace_start = -1;\n \n \t\t//update in database\n \t\tupdateInDatabase(\"points\");\n \t}", "public Point2D removePoint(int i);", "@Override\r\n\tpublic void erase() {\n\t\t\r\n\t}", "public void removeMissiles(){\n nunMissiles--;\n }", "private void removeOldestPoint() {\n PathPoint p = points.get(points.size() - length - 1);\n // if points has 5 points (0-4), length=3, then remove points(5-3-1)=points(1) leaving 2-4 which is correct\n float t = p.t - firstTimestamp;\n st -= t;\n sx -= p.x;\n sy -= p.y;\n stt -= t * t;\n sxt -= p.x * t;\n syt -= p.y * t;\n }", "private void eraseAt(PointF p) {\n lastEraseTrace.add(sheet.toSheet(p));\n }", "public void RemovePoint(int index) {\n if (index > PointArray.length - 1 || index < 0) {\n return;\n }\n double temp[] = new double[PointArray.length - 2];\n for (int i = 0; i <= PointArray.length - 1; i += 2) {\n if (i / 2 == index) {\n continue;\n }\n temp[i] = PointArray[i];\n temp[i + 1] = PointArray[i + 1];\n }\n }", "private static int removeStatPoints(int statPoints){\r\n statPoints--;\r\n return statPoints;\r\n }", "void removeNearbyPixels(Stroke theStroke){\n\t\tint index;\n\t\tint CurvIndex;\n\t\tint SpeedIndex;\n\t\tVector ptList = theStroke.getM_ptList();\n\t\tfor(index=0; index < CommonSegmentPts.size(); index++){\n\t\t\tPoint CommonPt = (PixelInfo)ptList.get((Integer)CommonSegmentPts.get(index));\n\t\t\tfor(CurvIndex = 0; CurvIndex < CurvVector.size(); CurvIndex++){\n\t\t\t\tPoint CurvPt = (PixelInfo)ptList.get((Integer)CurvVector.get(CurvIndex));\n\t\t\t\tif(CommonPt.distance(CurvPt) <= TolerantDistance){\n\t\t\t\t\tCurvVector.remove(CurvIndex--);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(SpeedIndex = 0; SpeedIndex < SpeedVector.size(); SpeedIndex++){\n\t\t\t\tPoint SpeedPt = (PixelInfo)ptList.get((Integer)SpeedVector.get(SpeedIndex));\n\t\t\t\tif(CommonPt.distance(SpeedPt) <= TolerantDistance){\n\t\t\t\t\tSpeedVector.remove(SpeedIndex--);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "void removeScans(int i);", "public void clearA(){\n for (int i = 0; i < I+1; i++){\n for (int j = 0; j < I+1; j++){\n a[i][j][I] = 0.0;\n }\n }\n\t }", "void removeNeighbors();", "public abstract void eraseRange(int index, int count, int validSize);", "abstract public void deleteAfterBetaReduction();", "public static void main(String[] args) {\n\tLeetCodeNonOverLappingIntervals me = new LeetCodeNonOverLappingIntervals();\n\t\n\tint[][] testcase1 = { {1,2}, {2,3}, {3,4}, {1,3} }; // 1. remove {1,3}\n\tint[][] testcase2 = { {1,2}, {1,2}, {1,2} }; // 2.. remove 2 {1,2}\n\tint[][] testcase3 = { {1,2}, {2,3}}; // 0.. remove nothing\n\tint[][] testcase4 = { {1,4}}; // 0.. remove nothing\n\t\n\tlong startTime = System.currentTimeMillis();\n\n\tSystem.out.println(me.eraseOverlapIntervals(testcase1)); // 1\n\tSystem.out.println(me.eraseOverlapIntervals(testcase2)); // 2\n\tSystem.out.println(me.eraseOverlapIntervals(testcase3)); // 0\n\tSystem.out.println(me.eraseOverlapIntervals(testcase4)); // 0\n\t\n\tSystem.out.println(\"Time taken \" + (System.currentTimeMillis() - startTime));\n\t\n\n}", "public void erasePolylines() {\n for (Polyline line : polylines) {\n line.remove(); ////removing each lines\n\n }\n polylines.clear(); ////clearing the polylines array\n }", "void removeContactMeans(int i);", "public void removeVerticalSeam(int[] a) {\n // Check there are seams to remove\n if (current.width() <= 1)\n throw new IllegalArgumentException(\"Current width <= 1\");\n // Check the seam is of height length and inside bounds\n if (a.length != current.height())\n throw new IllegalArgumentException(\"Seam is not complete\");\n for (int i = 0; i < a.length; i++) {\n if (a[i] < 0 || a[i] >= current.width()) {\n throw new IllegalArgumentException(\"Seam out of bounds\");\n }\n }\n // Check the seam elements have distance of one\n for (int i = 1; i < a.length; i++) {\n if (Math.abs(a[i - 1] - a[i]) > 1)\n throw new IllegalArgumentException(\n \"Too much distance in the seam\");\n }\n\n Picture newPicture = new Picture(current.width() - 1, current.height());\n for (int j = 0; j < current.height(); j++) {\n int removedX = a[j];\n int posX = 0;\n for (int i = 0; i < current.width(); i++) {\n if (i != removedX) {\n newPicture.set(posX, j, current.get(i, j));\n posX++;\n }\n }\n }\n\n current = newPicture;\n }", "public void remove(int index) {\n\t\tpoints.remove(index);\n\t}", "private void removePointFromIntersections(List<Coordinate> intersectionPoints, Coordinate toRemove) {\r\n\t\tif (intersectionPoints != null) {\r\n\t\t\tif (intersectionPoints.size() == 1) {\r\n\t\t\t\tif (intersectionPoints.get(0).equals2D(toRemove)) {\r\n\t\t\t\t\tintersectionPoints.remove(0);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif ( intersectionPoints.contains(toRemove)) {\r\n\t\t\t\t\tint removeIndex = intersectionPoints.indexOf(toRemove);\r\n\t\t\t\t\tintersectionPoints.remove(removeIndex);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t\r\n\t}", "void removeRoadside(int i);", "private static void task3333(int nUMS, SplayTree<Integer> j) {\n\t\t// TODO Auto-generated method stub\n\t\tdouble search_start = 0, search_end = 0;\n\n\t System.out.println(\"SPLAY DELETION Started...\");\n\t search_start = System.nanoTime();\n\t int count = 0;\n\t \t\n\t for (int z = 0; z < nUMS; z++) {\n\t \tint checker= GenerateInt.generateNumber();\n//\t \tSystem.out.println(GenerateStrings.getAlphaNumericString(limit));\n\t if (j.contains(checker)) {\n\t j.remove(checker);\n//\t System.out.println(\"INT Removed\");\n\t count++;\n\t }\n\t }\n\t search_end = System.nanoTime();\n\t System.out.println(\"Average time for each deletion: \" + (search_end - search_start) / nUMS + \" nanoseconds\");\n\t \n\t System.out.println(\"TOTAL REMOVES\" + count);\n\n\t\t\n\t}", "public static void debucketize(Integer[] A)\n\t{int i = 0;//Index of next element in A\n\t //Inv: elements in buckets[0..bucket[ctr]] are debucketized && ctr = bucket.size() \n\t //&& A[i] = elements in vector \n\t for(int ctr = 0; ctr < buckets.size(); ctr++)\n\t\t{//Inv: elements in buckets[0..bucket[ctr]-1] are debucketized && ctr < bucket.size() \n\t\t //&& A[i]-1 = elements in vector\n\t\t i += buckets.get(ctr).toArray(A, i);\n\t\t//Inv: elements in buckets[0..bucket[ctr]] are debucketized && ctr = bucket.size() \n\t\t//&& A[i] = elements in vector\t \n\t\t}\n\t //Termination: the counter begins at 0 and increments every time by 1 until it finally reaches \n\t //the size of the buckets and it finally terminates. \n\t}", "@Override\n\tpublic void eliminar() {\n\t\t\n\t}", "private void removeALakeTile(Game game) {\n\t\tLakeTile[][] board = game.getPlayArea().getLakeTilesOnBoard();\n\t\tArrayList<Position> positions = new ArrayList<Position>();\n\t\tfor (int y = 0; y < board.length; y++) {\n\t\t\tfor (int x = 0; x < board[y].length; x++) {\n\t\t\t\tLakeTile laketile = board[x][y];\n\t\t\t\tif (laketile != null) {\n\t\t\t\t\tint connect_laketile = 4;\n\t\t\t\t\tif (x + 1 < board.length && board[x + 1][y] == null)\n\t\t\t\t\t\tconnect_laketile -= 1;\n\t\t\t\t\tif (y + 1 < board.length && board[x][y + 1] == null)\n\t\t\t\t\t\tconnect_laketile -= 1;\n\t\t\t\t\tif (x - 1 >= 0 && board[x - 1][y] == null)\n\t\t\t\t\t\tconnect_laketile -= 1;\n\t\t\t\t\tif (y - 1 >= 0 && board[x][y - 1] == null)\n\t\t\t\t\t\tconnect_laketile -= 1;\n\t\t\t\t\tif (connect_laketile == 1) {\n\t\t\t\t\t\tPosition p = new Position(x, y);\n\t\t\t\t\t\tpositions.add(p);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (countLakeTileOnBoard(board) != 0 && positions.size() == 0) {\n\t\t\tpositions = getAllLakeTilePositionOnBoard(board);\n\t\t}\n\t\tCollections.shuffle(positions);\n\t\tPosition pos = positions.get(0);\n\t\tint x = pos.getX();\n\t\tint y = pos.getY();\n\t\tremoved_laketile.add(board[x][y]);\n\t\tremoved_position.add(pos);\n\t\tboard[x][y] = null;\n\t}", "public final void erase()\n\t{\n\t\t for(int i=0;i<itsData.length;i++) itsData[i] = 0;\n\t\t clear();\n\t}", "private void remove_arrow(int i, int j){\n\t\tint k;\n\t\tfor(k = j; k < enemy_arrow_num[i]-1;k++){\n\t\t\tenemy_arrows[i][k][0] = enemy_arrows[i][k+1][0];\n\t\t\tenemy_arrows[i][k][1] = enemy_arrows[i][k+1][1];\n\t\t}\n\t\tenemy_arrows[i][k][0] = 0;\n\t\tenemy_arrows[i][k][1] = 0;\n\t\tenemy_arrow_num[i] --;\n\t}", "void removeDecisionSightDistance(int i);", "private static void task4(int nUMS, BinarySearchTree<Integer> t) {\n\t\t\n\t\tdouble search_start = 0, search_end = 0;\n\n\t System.out.println(\"SPLAY DELETION Started...\");\n\t search_start = System.nanoTime();\n\t int count = 0;\n\t \t\n\t for (int z = 0; z < nUMS; z++) {\n\t \tint checker= GenerateInt.generateNumber();\n//\t \tSystem.out.println(GenerateStrings.getAlphaNumericString(limit));\n\t if (t.contains(checker)) {\n\t t.remove(checker);\n//\t System.out.println(\"INT Removed\");\n\t count++;\n\t }\n\t }\n\t search_end = System.nanoTime();\n\t System.out.println(\"Average time for each deletion: \" + (search_end - search_start) / nUMS + \" nanoseconds\");\n\t \n\t System.out.println(\"TOTAL REMOVES\" + count);\n\n\t\t\n\t\t\n\t}", "int numberOfBlocksToRemove();", "public void remove_transfered_points(int points) {\n\t\tthis.balance = this.balance - points;\n\t\tif(this.balance < 10000) this.status = \"Bronze\";\n\t\telse if(this.balance >= 10000) this.status = \"Silver\";\n\t\t\n\t}", "public void removeDeadVampires() {\n\n for (int i = 0; i < Vampiro.getNumVamp(); i++) {\n if (lista[i].getVida() <= 0)\n delVampire(i);\n }\n }", "@Test\r\n\tpublic void fieldToDeleteTest() {\n\t\tArrayList<Point> fieldToDelete = boardService.getGameRules().fieldToDelete(board.field[11][10]); //we invoke this on the one of the black stones\r\n\t\t//should return arraylist of a size that is same as whites amount\r\n\t\tint counter = 0;\r\n\t\t\r\n\t\tfor(Point point : fieldToDelete)\r\n\t\t\tfor(int i = 11; i <= 15; i++)\r\n\t\t\t\tfor(int j = 11; j <= 15; j++) {\r\n\t\t\t\t\tif(point.getX() == i && point.getY() == j)\r\n\t\t\t\t\t\tcounter++; \r\n//we increase counter, only when we meet point with the same coordiantes, then when counter == size of returned array, then test is passed\r\n\t\t\t\t}\r\n\t\tassertEquals(counter, fieldToDelete.size());\r\n\t}", "public void minusPoint_action()\r\n/* */ {\r\n/* 87 */ this.points_action -= 1;\r\n/* */ }", "private void d() {\n Queue<c> queue;\n Queue<c> queue2 = queue = i;\n synchronized (queue2) {\n long l2 = System.currentTimeMillis();\n Iterator iterator = i.iterator();\n while (iterator.hasNext()) {\n if (l2 - ((c)iterator.next()).a < 60000L) continue;\n iterator.remove();\n }\n if (i.size() >= 15) {\n for (int i2 = 0; i2 < 5; ++i2) {\n i.remove();\n }\n }\n return;\n }\n }", "public void eraseLines() {\n for (int i = 0; i < segments.size() - 1; i++) {\n paintLine((Point2D) (segments.elementAt(i)),\n (Point2D) (segments.elementAt(i + 1)));\n }\n }", "@Override\r\n\t\t\tpublic void eliminar() {\n\r\n\t\t\t}", "@Override\n\tpublic void eliminar() {\n\n\t}", "private static void remove(int[]data,int size){\n int temp = data[0];\n data[0] = data[size-1];\n data[size-1] = temp;\n pushDown(data, size-1, 0);\n }", "public void eraseOnClick(View view){\n mMap.clear();//clears the map\r\n points = new ArrayList<LatLng>();//resets the markers holder\r\n }", "private static void task333(int nUMS, RedBlackBST<Integer, Integer> i) {\n\t\tdouble search_start = 0, search_end = 0;\n\n\t System.out.println(\"RED BLAST BST DELETION Started...\");\n\t search_start = System.nanoTime();\n\t int count = 0;\n\t \t\n\t for (int z = 0; z < nUMS; z++) {\n\t \tint checker= GenerateInt.generateNumber();\n//\t \tSystem.out.println(GenerateStrings.getAlphaNumericString(limit));\n\t if (i.contains(checker)) {\n\t i.delete(checker);\n//\t System.out.println(\"INT Removed\");\n\t count++;\n\t }\n\t }\n\t search_end = System.nanoTime();\n\t System.out.println(\"Average time for each deletion: \" + (search_end - search_start) / nUMS + \" nanoseconds\");\n\t \n\t System.out.println(\"TOTAL REMOVES\" + count);\n\n\t\t\n\t}", "private static void task33(int nUMS, AVLTree<Integer> h) {\n\t\t\n\t double search_start = 0, search_end = 0;\n\n\t System.out.println(\"AVL DELETION Started...\");\n\t search_start = System.nanoTime();\n\t int count = 0;\n\t \t\n\t for (int z = 0; z < nUMS; z++) {\n\t \tint checker= GenerateInt.generateNumber();\n//\t \tSystem.out.println(GenerateStrings.getAlphaNumericString(limit));\n\t if (h.contains(checker)) {\n\t h.remove(checker);\n//\t System.out.println(\"INT Removed\");\n\t count++;\n\t }\n\t }\n\t search_end = System.nanoTime();\n\t System.out.println(\"Average time for each deletion: \" + (search_end - search_start) / nUMS + \" nanoseconds\");\n\t \n\t System.out.println(\"TOTAL REMOVES\" + count);\n\t\t \n\t}", "public void removerFinal() {\n switch (totalElementos()) {\n case 0:\n System.out.println(\"lista esta vazia\");\n break;\n case 1:\n this.primeiro = this.ultimo = null;\n this.total--;\n break;\n default:\n ElementoLista elementoTemporarioAnteriorAtual = this.primeiro;\n ElementoLista elementoTemporarioAtual = this.primeiro.irParaProximo();\n for (int i = 1; i < totalElementos(); i++) {\n elementoTemporarioAnteriorAtual = elementoTemporarioAtual;\n elementoTemporarioAtual = elementoTemporarioAtual.irParaProximo();\n }\n\n this.ultimo = elementoTemporarioAnteriorAtual;\n this.ultimo.definirProximo(null);\n this.total--;\n }\n //this.ultimo = this.ultimo.irParaAnterior();\n //this.ultimo.definirProximo(null);\n }", "private static void task03(int nUMS, AVLTree<Integer> h) {\n\t\t long start = System.nanoTime();\n\t\t System.out.println( \"Deletion in the table...\" );\n\t\t int count=0;\n\t\t\tfor( int i = 1; i <= nUMS; i++)\n\t\t\t{\n\t\t\t\tif(h.isEmpty() == false)\n\t\t\t\t{\n\t\t\t\t\n\t\t\t\th.remove(i);\n\t\t\t\t\n\t\t\t\t}\n//\t\t\t\tSystem.out.println(GenerateInt.generateNumber());\n\n\t\t\t}\n\t\t\tSystem.out.println(\"Total Size \" + count);\n\t\t\tSystem.out.println(\"Is it empty \" + h.isEmpty());\n\t\t\tlong end = System.nanoTime();;\n\t\t\tlong elapsedTime = end - start;\n\t\t\tSystem.out.println(elapsedTime + \" NanoSeconds\");\n\t\t\tSystem.out.println(\"Average Time \" + elapsedTime/nUMS);\n\n\t\t\n\t}", "private static void task03333(int nUMS, SplayTree<Integer> j) {\n\n\t\tlong start = System.nanoTime();\n\t System.out.println( \"Deletion in the table...\" );\n\t int count=0;\n\t\tfor( int i = 1; i <= nUMS; i++)\n\t\t{\n\t\t\tif(j.isEmpty() == false)\n\t\t\t{\n\t\t\t\n\t\t\tj.remove(i);\n\t\t\t\n\t\t\t}\n//\t\t\tSystem.out.println(GenerateInt.generateNumber());\n\n\t\t}\n\t\tSystem.out.println(\"Total Size \" + count);\n\t\tSystem.out.println(\"Is it empty \" + j.isEmpty());\n\t\tlong end = System.nanoTime();;\n\t\tlong elapsedTime = end - start;\n\t\tSystem.out.println(elapsedTime + \" NanoSeconds\");\n\t\tSystem.out.println(\"Average Time \" + elapsedTime/nUMS);\n\t}", "public void supprimerEpsilonProd(){\n grammaireCleaner.supprimer_epsilon_prod();\n setChanged();\n notifyObservers(\"4\");\n }", "public void removePoint(Point2D p);", "public void removeDuplicates()\n\t{\n\t\tComparator<Point> comp = new Comparator<Point>() \n\t\t{\n @Override\n public int compare(Point p, Point q) \n {\n \t return p.compareTo(q);\n }\n };\n\t\tquicksorter.quickSort(comp);\n\t\tquicksorter.getSortedPoints(points);\n\t\t\n\t\tArrayList<Point> pts = new ArrayList<Point>();\n\t\tfor(int a = 0; a < points.length; a++) //copy points into temp array\n\t\t{\n\t\t\tif(!pts.contains(points[a]))\n\t\t\t{\n\t\t\t\tpts.add(points[a]);\n\t\t\t}\n\t\t}\n\t\tpointsNoDuplicate = new Point[pts.size()]; //insert into pointsNoDuplicate\n\t\tfor(int i = 0; i < pts.size(); i++)\n\t\t{\n\t\t\tpointsNoDuplicate[i] = pts.get(i);\n\t\t}\n\t}", "public void removeAllPieces()\n\t{\n\t\t/* iterate over the rows and columns */\n\t\tfor (int i = 0; i < m_rows; i++) {\n\t\t\tfor (int j = 0; j < m_cols; j++) {\n\t\t\t\tremovePiece(i, j);\n\t\t\t}\n\t\t}\n\t}", "public void supprimerCases(){ \r\n \r\n for(int del=0; del<nVides; del++) {\r\n \tint i = (int) Math.floor((Math.random()*N));\r\n \tint j = (int) Math.floor((Math.random()*N));\r\n\r\n if (tab[i][j] == 0) //si la case est vide, on ne peut pas la supprimer donc on remet increment pas del\r\n \tdel--; \r\n else //sinon, on efface la case\r\n \ttab[i][j] = 0;\r\n } \r\n }", "void removeBall(Coordinates at);", "public int deleteAndEarn(int[] nums) {\n \n if(nums==null || nums.length==0) return 0;\n int max = 0;\n //find max number\n for(int num : nums){\n max = Math.max(max, num);\n }\n \n int[] completeArray = new int[max+1];\n \n for(int i=0; i< nums.length; i++)\n {\n completeArray[nums[i]] += nums[i];\n }\n \n int skip = 0, take = completeArray[0];\n \n for(int i=1; i<completeArray.length; i++){\n int tempSkip = skip;\n skip = Math.max(skip,take);\n take = tempSkip + completeArray[i];\n }\n return Math.max(skip, take);\n }", "public void removeCutVertices() {\n boolean found;\n LinkedList<Integer> isolated = new LinkedList<>();\n do {\n found = false;\n for (Map.Entry<Integer, Set<Integer>> entry : adjacencyMap.entrySet()) {\n// System.out.println(\"adjacency print key: \" + entry.getKey() + \"value: \" +\n// entry.getValue() + \"set size: \" + entry.getValue().size());\n if (entry.getValue().size() == 1) {\n// System.out.println(\"found cut vertex\");\n found = true; // loop yielded a cut vertex\n // get the only vertex in the set\n for (Integer integer : entry.getValue()) {\n// System.out.println(\"started set iterator\" + integer);\n int removalSet = integer; // take the value of the set element\n // create a temp set\n Set<Integer> tempSet = adjacencyMap.get(removalSet);\n tempSet.remove(entry.getKey()); // remove the cut vertex from this set\n adjacencyMap.replace(removalSet, tempSet); // put the smaller set in place\n }\n isolated.add(entry.getKey());\n\n\n }\n\n }\n // remove isolated vertices\n for (Integer vert : isolated) {\n adjacencyMap.remove(vert);\n }\n isolated.clear();\n } while (found);\n }", "public void erase(Graphics g, int a, int b)\n {\n g.setColor(Color.BLACK);\n g.fillRect(a,b,15,15); \n \n \n Color transGray = new Color(55,55,55);\n g.setColor(transGray);\n \n g.drawLine(a,b,a,b+15);\n g.drawLine(a,b,a+15,b);\n g.drawLine(a+15,b,a+15,b+15);\n g.drawLine(a,b+15,a+15,b+15); \n }", "public boolean removePoint(Point p);", "private static void task033(int nUMS, RedBlackBST<Integer, Integer> i) {\n\t\t\n\t\tlong start = System.nanoTime();\n\t System.out.println( \"Deletion in the table...\" );\n\t int count=0;\n\t\tfor( int j = 1; j <= nUMS; j++)\n\t\t{\n\t\t\tif(i.isEmpty() == false)\n\t\t\t{\n\t\t\t\n\t\t\ti.delete(j);\n\t\t\t\n\t\t\t}\n//\t\t\tSystem.out.println(GenerateInt.generateNumber());\n\n\t\t}\n\t\tSystem.out.println(\"Total Size \" + count);\n\t\tSystem.out.println(\"Is it empty \" + i.isEmpty());\n\t\tlong end = System.nanoTime();;\n\t\tlong elapsedTime = end - start;\n\t\tSystem.out.println(elapsedTime + \" NanoSeconds\");\n\t\tSystem.out.println(\"Average Time \" + elapsedTime/nUMS);\n\n\n\t\t\n\t}", "public static LinkedList2 removeOneCamera(char[][] Matrix){\n\t \n\t\n\t\n\t\n\t LinkedList2 AfterRemoving= new LinkedList2();\n\n\n\n\t int arraySize=countNmberOfCameras(Matrix);\n\t \n\t\n\t \n\t if(arraySize<=1) {//why\n\t\t AfterRemoving.insert(matrix, calculateOpjectiveFunction(matrix));\n\t\t return AfterRemoving ;\n\t\t \n\t }\n\n\n\t \n\t int[] Ipositions= new int [arraySize];\n\t int[] Jpositions= new int [arraySize];\n\t \n\t int[] NEWIpositions= new int [arraySize]; \n\t int[] NEWJpositions= new int [arraySize];\n\t \n\t int index=0;\n\n\t for(int k=0; k<size ; k++) {\n\t \tfor(int r=0 ; r<size ; r++) {\n\t \t\t\n\t if(Matrix[k][r] == 'c' ) {\n\t \t\t\t\n\t \t\t\t Ipositions[index]=k;\n\t \t\t\t Jpositions[index]=r;\n\t \t\t\t \n\t \t\t\tNEWIpositions[index]=k;\n\t \t\t NEWJpositions[index]=r;\n\t \t\t\t \n\t \t\t\t index++;\n\t \t\t\t \n\t \t\t}\n\t \t}\n\t }\n\t \n\t \n\t boolean[] haveBeenRemoved= new boolean [arraySize];\n\t \n\t //the original matrix because i want the o too\n\t \n\t \n\t for(int i =0 ; i< arraySize ; i++) {\n\t \t \n\t \t \tchar[][] newMatrix= new char[size][size];\n\t \t \t\n\t \t for(int k=0 ; k< size ; k++)\n\t \t \t for(int r=0 ; r<size ; r++)\n\t \t \t\t newMatrix[k][r]=matrix[k][r];\n\t \t \n\n\t \t if( ! haveBeenRemoved[i] ) {\n\t for(int k=0 ; k<arraySize ;k++) {\n\t \t \n\t \t if(i==k) //\n\t \t\t continue;\n\t \t \n\t \t if(NEWIpositions[k]!=-1 || NEWJpositions[k]!=-1) {\n\t \t newMatrix[Ipositions[k]][Jpositions[k]]='c';\n\t \n\t \n\t updateVisibility(Ipositions[k], Jpositions[k], newMatrix);\n\t \t \n\t \tNEWIpositions[k]=-1;\n\t \tNEWJpositions[k]=-1;\n\t \t\n\t }\n\t \t \n\t }\n\t \n\t for(int m=0; m<arraySize ;m++ ) {\n\t \t\tNEWIpositions[m]= Ipositions[m];\n\t \tNEWJpositions[m]=Jpositions[m];\n\t }\n\t \n\t haveBeenRemoved[i]=true;\n\t AfterRemoving.insert(newMatrix, calculateOpjectiveFunction(newMatrix));\n\t }\n\t }\n\t return AfterRemoving;\n}", "private void finishErasing() {\n synchronized (lastEraseTrace) {\n if (lastEraseTrace.size() > 0) {\n ArrayList<Shape> t = new ArrayList<Shape>();\n t.add(new EraseTrace(lastEraseTrace, sheet.toSheet(eraserRadius)));\n sheet.doAction(new AddShapes(t));\n lastEraseTrace.clear();\n }\n }\n }", "protected void deleteSelectedControlPoints() {\n\t\tfor (int i = 0; i < selectedPoints.size(); ++i) {\n\t\t\tif (i == 0)\n\t\t\t\tpush();\n\n\t\t\tfor (int j = 0; j < selectedCurves.size(); ++j) {\n\t\t\t\tint temp;\n\t\t\t\t// Als het controlepunt tot de curve behoort --> het punt uit\n\t\t\t\t// die curve verwijderen.\n\t\t\t\twhile ((temp = selectedCurves.elementAt(j).containsInputPointi(\n\t\t\t\t\t\tselectedPoints.elementAt(i))) != -1) {\n\t\t\t\t\tselectedCurves.elementAt(j).getInput().remove(temp);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Het punt ook uit de container halen.\n\t\t\tselectionTool.deleteControlPoint(selectedPoints.elementAt(i).X(),\n\t\t\t\t\tselectedPoints.elementAt(i).Y());\n\t\t}\n\n\t\t// Indien curves nu leeg blijken te zijn --> die curves verwijderen.\n\t\tfor (int j = 0; j < selectedCurves.size(); ++j) {\n\t\t\tif (selectedCurves.elementAt(j).getNbInputPoints() == 0) {\n\t\t\t\tselectionTool.deleteCurve(selectedCurves.elementAt(j));\n\t\t\t\tselectedCurves.remove(j--);\n\t\t\t}\n\t\t}\n\n\t\trecalculateSelectedCurves(); // De curves herberekenen.\n\t\tcurves.addAll(selectedCurves); // De curves deselecteren.\n\t\tselectedCurves.clear();\n\t\tselectedPoints.clear();\n\t\tpushNew();\n\t}", "void removeGuide(int i);", "private void deleteAttacks(){\n while(!attacksToDelete.isEmpty()){\n attacks.remove(attacksToDelete.remove());\n }\n }", "@Override\r\n\tpublic void eliminar(IndicadorActividadEscala iae) {\n\r\n\t}", "public void clearOld(int p_turn)\n {\n HashSet<Integer> toR = new HashSet<>();\n for (Integer i : this.e.keySet())\n if (this.e.get(i).turn < p_turn)\n toR.add(i);\n this.e.keySet().removeAll(toR);\n\n toR.clear();\n // Clear captured data (unupdated)\n for (Integer i : this.d.keySet())\n if (this.d.get(i).turn < p_turn)\n toR.add(i);\n this.d.keySet().removeAll(toR);\n\n this.moveToData = State.clustering(this.d, CLUSTER_DIST);\n // this.moveToEnnemies = WizState.clustering(this.e, CLUSTER_DIST);\n }", "public void removeLines() {\n int compLines = 0;\n int cont2 = 0;\n\n for(cont2=20; cont2>0; cont2--) {\n while(completeLines[compLines] == cont2) {\n cont2--; compLines++;\n }\n this.copyLine(cont2, cont2+compLines);\n }\n\n lines += compLines;\n score += 10*(level+1)*compLines;\n level = lines/20;\n if(level>9) level=9;\n\n for(cont2=1; cont2<compLines+1; cont2++) copyLine(0,cont2);\n for(cont2=0; cont2<5; cont2++) completeLines[cont2] = -1;\n }", "private void removePosition(Point p) {\n\t\tfor(Point point : occupiedPositions) {\n\t\t\tif(p.x == point.x && p.y == point.y) {\n\t\t\t\toccupiedPositions.remove(point);\n\t\t\t}\n\t\t}\n\t}", "private void deleteCheck(int hash){\r\n for(int i = 1; i < M; i++){ //Doesn't consider the index of the removed pair\r\n if(hash + i < M){\r\n \tif(keys[hash + i] == null) continue;\r\n \tif(hash == hash(keys[hash + i])){\r\n \tmove(hash, hash + i);\r\n \tbreak;\r\n }\r\n }else{\r\n if(keys[hash + i - M] == null) continue;\r\n if(hash == hash(keys[hash + i - M])){\r\n \tmove(hash, hash + i - M);\r\n \tbreak;\r\n }\r\n }\r\n }\r\n }", "private Proof sumEraseN(Expression s, Expression t, int n, Proof p) {\n if (n == 0) {\n return equalityShuffle(faxm6Gen(t), equalityRightConvert(faxm6Gen(s), p));\n }\n n = n - 1;\n Proof eqSubL = equalityRightConvert(faxm5Gen(s, intToLit(n)), p);\n Proof eqSubR = equalityShuffle(faxm5Gen(t, intToLit(n)), eqSubL);\n return sumEraseN(s, t, n, faxm3Convert(eqSubR));\n }", "public void clear() {\n sumX = 0d;\n sumXX = 0d;\n sumY = 0d;\n sumYY = 0d;\n sumXY = 0d;\n n = 0;\n }", "public void undo(){\n if(!isFreeDraw) { //in waypoint mode delete the last point\n int size = mMapInterface.getPathFrame().size();\n if (size >= 1) {\n isPathReady=false;\n mMapInterface.getPathFrame().remove(size - 1);\n pointsCounter--;\n googleMap.clear();\n drawLine();\n }\n }\n else{ //in continu mode delete all path\n deletePath();\n drawFree();\n }\n }", "private void aretes_aO(){\n\t\tthis.cube[40] = this.cube[7]; \n\t\tthis.cube[7] = this.cube[25];\n\t\tthis.cube[25] = this.cube[46];\n\t\tthis.cube[46] = this.cube[34];\n\t\tthis.cube[34] = this.cube[40];\n\t}", "void removeNoPassingZone(int i);", "public void removeHorizontalSeam(int[] a) {\n // Check there are seams to remove\n if (current.height() <= 1)\n throw new IllegalArgumentException(\"Current height <= 1\");\n // Check the seam is of height length and inside bounds\n if (a.length != current.width())\n throw new IllegalArgumentException(\"Seam is not complete\");\n for (int i = 0; i < a.length; i++) {\n if (a[i] < 0 || a[i] >= current.height()) {\n throw new IllegalArgumentException(\"Seam out of bounds\");\n }\n }\n // Check the seam elements have distance of one\n for (int i = 1; i < a.length; i++) {\n if (Math.abs(a[i - 1] - a[i]) > 1)\n throw new IllegalArgumentException(\n \"Too much distance in the seam\");\n }\n\n Picture newPicture = new Picture(current.width(), current.height() - 1);\n for (int i = 0; i < current.width(); i++) {\n int removedY = a[i];\n int posY = 0;\n for (int j = 0; j < current.height(); j++) {\n if (j != removedY) {\n newPicture.set(i, posY, current.get(i, j));\n posY++;\n }\n }\n }\n\n current = newPicture;\n }", "public static void InverseA(double pos_x1, double pos_x2, double pos_x3, double pos_y1, double pos_y2, double pos_y3, double fX, double fY, double fZ,\n double tX, double tY, double tZ, double h11, double h21, double k1, double h12, double h22, double k2, double h13, double h23,\n double k3, YoDouble fx1, YoDouble fz1, YoDouble fx2, YoDouble fy2, YoDouble fz2, YoDouble fz3)\n\n {\n double s42, s44, s45, s46, s51, s52;\n double s53, s55, s56, s61, s63, s64;\n\n double t11, t12, t16;\n double t21, t22, t23, t24, t25, t26;\n double t31, t32, t36;\n double t42;\n double t51, t52, t53, t54, t55, t56;\n double t61, t62, t63, t64, t65, t66;\n\n double cd;\n\n s42 = (pos_y1 + AgileHexapodRobot.LEN * Math.cos(h21) * (Math.sin(h11 + k1) + Math.sin(h11)));\n s44 = (-2.0 * AgileHexapodRobot.LEN * Math.sin(h11) * Math.sin(k1) - AgileHexapodRobot.LEN * Math.sin(h12) * Math.sin(k2)\n - AgileHexapodRobot.LEN * Math.sin(h13) * Math.sin(k3) + AgileHexapodRobot.LEN * Math.cos(h12) * (Math.cos(k2) + 1)\n + AgileHexapodRobot.LEN * Math.cos(h13) * (Math.cos(k3) + 1) + 2.0 * AgileHexapodRobot.LEN * Math.cos(h11) * (Math.cos(k1) + 1));\n s45 = (pos_y2 + AgileHexapodRobot.LEN * Math.cos(h22) * (Math.sin(h12 + k2) + Math.sin(h12)));\n s46 = (pos_y3 + AgileHexapodRobot.LEN * Math.cos(h23) * (Math.sin(h13 + k3) + Math.sin(h13)));\n s51 = (-AgileHexapodRobot.LEN * Math.cos(h11 + k1) - AgileHexapodRobot.LEN * Math.cos(h11));\n s52 = (-pos_x1 + AgileHexapodRobot.LEN * Math.sin(h21) * (Math.sin(h11 + k1) + Math.sin(h11)));\n s53 = (AgileHexapodRobot.LEN * Math.cos(h12) * (-Math.cos(k2) - 1) + AgileHexapodRobot.LEN * Math.cos(h13) * (-Math.cos(k3) - 1)\n + AgileHexapodRobot.LEN * Math.sin(h12) * Math.sin(k2) + AgileHexapodRobot.LEN * Math.sin(h13) * Math.sin(k3));\n s55 = (-pos_x2 + AgileHexapodRobot.LEN * Math.sin(h22) * (Math.sin(h12) * (Math.cos(k2) + 1) + Math.cos(h12) * Math.sin(k2)));\n s56 = (-pos_x3 + AgileHexapodRobot.LEN * Math.sin(h23) * (Math.sin(h13 + k3) + Math.sin(h13)));\n s61 = (-pos_y1 - AgileHexapodRobot.LEN * Math.cos(h21) * (Math.sin(h11 + k1) + Math.sin(h11)));\n s63 = (-pos_y2 - pos_y3 - AgileHexapodRobot.LEN * Math.cos(h22) * (Math.sin(h12 + k2) + Math.sin(h12))\n - AgileHexapodRobot.LEN * Math.cos(h23) * (Math.sin(h13 + k3) + Math.sin(h13)));\n s64 = (2.0 * pos_x1 + pos_x2 + pos_x3 - 2.0 * AgileHexapodRobot.LEN * Math.sin(h21) * (Math.sin(h11 + k1) + Math.sin(h11))\n - AgileHexapodRobot.LEN * Math.sin(h22) * (Math.sin(h12 + k2) + Math.sin(h12))\n - AgileHexapodRobot.LEN * Math.sin(h23) * (Math.sin(h13 + k3) + Math.sin(h13)));\n\n DET.set((4.0 * s63 - 8.0 * s61) * (s42 * (s55 - s56) + s45 * (-s52 + s56) + s46 * (s52 - s55)));\n\n if ((DET.getDoubleValue() > -0.001) && (DET.getDoubleValue() < 0.0))\n DET.set(-0.001);\n if ((DET.getDoubleValue() < 0.001) && (DET.getDoubleValue() > 0.0))\n DET.set(0.001);\n\n cd = 4.0 * s63 - 8.0 * s61;\n\n t11 = (4.0 * s63 * DET.getDoubleValue()) / (cd);\n t12 = (2.0 * s64 * DET.getDoubleValue()) / (cd);\n t16 = (-8.0 * DET.getDoubleValue()) / (cd);\n\n t21 = 4.0 * (s53 * s61 - s51 * s63) * (s46 - s45);\n t22 = s51 * s64 * (-2.0 * s46 + 2.0 * s45) + s53 * s64 * (-s45 + s46) + s55 * s44 * (-s63 + 2.0 * s61) + s56 * s44 * (-2.0 * s61 + s63);\n t23 = cd * (s45 * s56 - s46 * s55);\n t24 = cd * (s55 - s56);\n t25 = cd * (-s45 + s46);\n t26 = (4.0 * s53 - 8.0 * s51) * (s45 - s46);\n\n t31 = (-4.0 * s61 * DET.getDoubleValue()) / (cd);\n t32 = (-s64 * DET.getDoubleValue()) / (cd);\n t36 = (4.0 * DET.getDoubleValue()) / (cd);\n\n t42 = DET.getDoubleValue() / 4.0;\n\n t51 = 4.0 * (s46 - s42) * (s51 * s63 - s61 * s53);\n t52 = (2.0 * s51 - s53) * (-s42 * s64 + s46 * s64) + (2.0 * s61 - s63) * (s56 * s44 - s52 * s44);\n t53 = cd * (-s42 * s56 + s46 * s52);\n t54 = cd * (s56 - s52);\n t55 = cd * (-s46 + s42);\n t56 = (4.0 * s53 - 8.0 * s51) * (s46 - s42);\n\n t61 = 4.0 * (s63 * s51 - s61 * s53) * (s42 - s45);\n t62 = (2.0 * s51 - s53) * (-s45 * s64 + s42 * s64) + (2.0 * s61 - s63) * (s52 * s44 - s55 * s44);\n t63 = cd * (s42 * s55 - s45 * s52);\n t64 = cd * (s52 - s55);\n t65 = cd * (s45 - s42);\n t66 = (8.0 * s51 - 4.0 * s53) * (s45 - s42);\n\n\n fx1.set((1.0 / DET.getDoubleValue()) * (t11 * fX + t12 * fY + t16 * tZ));\n fz1.set((1.0 / DET.getDoubleValue()) * (t21 * fX + t22 * fY + t23 * fZ + t24 * tX + t25 * tY + t26 * tZ));\n fx2.set((1.0 / DET.getDoubleValue()) * (t31 * fX + t32 * fY + t36 * tZ));\n fy2.set((1.0 / DET.getDoubleValue()) * (t42 * fY));\n fz2.set((1.0 / DET.getDoubleValue()) * (t51 * fX + t52 * fY + t53 * fZ + t54 * tX + t55 * tY + t56 * tZ));\n fz3.set((1.0 / DET.getDoubleValue()) * (t61 * fX + t62 * fY + t63 * fZ + t64 * tX + t65 * tY + t66 * tZ));\n\n\n /* test it */\n\n /*\n * ls.sminv_err_1 = (*fx1) + 2.0* (*fx2) - fX;\n * ls.sminv_err_2 = 4.0 * (*fy2) - fY;\n * ls.sminv_err_3 = (*fz1) + (*fz2) + (*fz3) - fZ;\n *\n * ls.sminv_err_4 = s42*(*fz1) + s44*(*fy2) + s45*(*fz2) + s46*(*fz3) - tX;\n * ls.sminv_err_5 = s51*(*fx1) + s52*(*fz1) + s53*(*fx2) + s55*(*fz2) + s56*(*fz3) - tY;\n * ls.sminv_err_6 = s61*(*fx1) + s63*(*fx2) + s64*(*fy2) - tZ;\n */\n\n }", "public void wipeZeros() {\n Set<T> objToBeRemoved = new HashSet<T>();\n for (T obj : objToSums.keySet()) {\n if (shouldBeRemoved(obj)) {\n objToBeRemoved.add(obj);\n }\n }\n for (T obj : objToBeRemoved) {\n objToSums.remove(obj);\n }\n }", "private void m72697hn() {\n int size = this.aep.size() - this.aes;\n if (size > 0) {\n this.aev = true;\n for (int i = 0; i < size; i++) {\n this.aep.remove(0);\n }\n }\n }", "public void clearPieces(){\n for(int i =0; i<WIDTH;i++){\n for(int j = 0 ; j<HEIGHT;j++){\n piecesToSwap[i][j]=null;\n }\n }\n }", "void B_time()\n {\n System.out.println(\"Ghost current position: ( \"+X+\",\"+Y+\")\");\n double[][] dup = new double[n][n];\n //int temp = rand.nextInt(10);\n for (int i = 0; i < n; i++)\n {\n for (int j = 0; j < n; j++)\n {\n double x = 0;\n //*****SIDEWAYS****\n\n if( (j-1 >= 0) && (j-1 < n))\n {\n double a = side_neighbour(i,j-1);\n x += arr[i][j-1] * sw * (1.0/a);\n }\n if( (j+1 >= 0) && (j+1 < n))\n {\n double a = side_neighbour(i,j+1);\n x += arr[i][j+1] * sw * (1.0/a);\n }\n if( (i-1 >= 0) && (i-1 < n))\n {\n double a = side_neighbour(i-1,j);\n x += arr[i-1][j] * sw * (1.0/a);\n }\n if( (i+1 >= 0) && (i+1 < n))\n {\n double a = side_neighbour(i+1,j);\n x += arr[i+1][j] * sw * (1.0/a);\n }\n\n //*****CORNERS****\n if( (i-1 >= 0) && (i-1 < n) && (j-1 >= 0) && (j-1 < n))\n {\n double a = corner_neighbours(i-1,j-1);\n x += arr[i-1][j-1] * c *(1.0/a);\n }\n if( (i+1 >= 0) && (i+1 < n) && (j+1 >= 0) && (j+1 < n))\n {\n double a = corner_neighbours(i+1,j+1);\n x += arr[i+1][j+1] * c *(1.0/a);\n }\n if( (i-1 >= 0) && (i-1 < n) && (j+1 >= 0) && (j+1 < n))\n {\n double a = corner_neighbours(i-1,j+1);\n x += arr[i-1][j+1] * c * (1.0/a);\n }\n if( (i+1 >= 0) && (i+1 < n) && (j-1 >= 0) && (j-1 < n))\n {\n double a = corner_neighbours(i+1,j-1);\n x += arr[i+1][j-1] * c * (1.0/a);\n }\n\n double a = corner_neighbours(i,j);\n x += arr[i][j] * c * (1.0/a);\n\n //arr[i][j] = x;\n dup[i][j] = x;\n }\n }\n\n\n\n arr = dup;\n B_print();\n curr_pos(X,Y);\n\n }", "void unsetStraight();", "void prune() {\n\n }", "private void removeEnemy(int e_num){\n\t\tint i;\n\t\tfor(i=e_num;i<enemy_num-1;i++){\n\t\t\tenemy[i][0] = enemy[i+1][0];\n\t\t\tenemy[i][1] = enemy[i+1][1];\n\t\t\tenemy[i][2] = enemy[i+1][2];\n\t\t\tenemy_arrow_num[i] = enemy_arrow_num[i+1];\n\t\t\tenemy_arrows[i] = enemy_arrows[i+1];\n\t\t}\n\t\tenemy_num -= 1;\n\t\tenemy[i][0] = 0;\n\t\tenemy[i][1] = 0;\n\t\tenemy[i][2] = 0;\n\t\tenemy_arrow_num[i] = 0;\n\t\t\n\t\t\n\t\n\t}", "public static void clearXY()\r\n{\r\n\tx = 0;\r\n\ty = 0; \r\n\t\r\n}", "private void deductGamePoints(List<Integer> prevGamePoints) {\n for (int i = 0; i < numAlive; i++) {\n int playerTrickPoints = trickPoints.get(i);\n if (playerTrickPoints < 0) {\n int prevPoints = prevGamePoints.get(i);\n int newPoints = prevPoints + playerTrickPoints;\n \n if (newPoints < 0) {\n // Cannot have negative points\n gamePoints.set(i, 0);\n } else {\n gamePoints.set(i, newPoints);\n }\n }\n }\n }", "public void eraseCircle() {\n paintCircle(rPoint1, rPoint2);\n }", "private void clean() {\n Iterable<Long> v = vertices();\n Iterator<Long> iter = v.iterator();\n while (iter.hasNext()) {\n Long n = iter.next();\n if (world.get(n).adj.size() == 0) {\n iter.remove();\n }\n }\n }", "private void eliminarDisparosE(int num) {\n\t\t\n\t\tnumDisparosE--;\n\t\tfor(int i=num;i<numDisparosE;i++)\n\t\t\tdisparosE[i]=disparosE[i+1];\n\t\t\tdisparosE[numDisparosE]=null;\n\n\t}", "public void eliminarCelulaPosicion(int fila, int columna) {\r\n\t\tsuperficie[fila][columna] = null;\r\n\t\t\r\n\t\t// Eliminamos las posiciones de esa celula de los arrays de las posiciones de las celulas.\r\n\t\teliminarPosicionesDeLaCelulaEnLosArraysDeCelulas(fila, columna);\r\n\t\tnumeroDeCelulasEnSuperficie--;\r\n\t}", "private void eliminarAsteroide(int num){\n\t\t\n\t\tnumAsteroides--;\n\t\t\n\t\tfor(int i=num;i<numAsteroides;i++){\n\t\t\tasteroides[i]=asteroides[i+1];\n\t\t}\n\t\tasteroides[numAsteroides]=null;\n\t}", "public void RemoveRowsIfStackedTooHigh() {\n \t\t\n while (rowHasBlocks(Parameters.RemoveBiggestPartialRowIfBlockInRow)) {\n int NoOfPiecesRemoved = \n eraseBiggestRowGreaterThan(Parameters.RemoveBiggestPartialRowIfBlockInRow);\n //remove points for each empty square\n ComputeScoreAndDelay(-(COLUMNS - NoOfPiecesRemoved) * Parameters.PointsSubtractedPerEmptySpaceFromPartialRow);\n \n }\n game_grid.repaint();\n LogEvent(\"row_removed\");\n }", "private void undoLastPoint() {\n \t\tif ( this.markers.isEmpty() ) {\n \t\t\treturn;\n \t\t}\n \n \t\tthis.markers.remove( this.markers.size() - 1 ).remove();\n \t\tthis.commitPolygon();\n \n \t\tif ( this.markers.size() > 1 ) {\n \t\t\tthis.moveCameraToPolygon( true );\n \t\t}\n \n \t\tthis.disableIfDissatisfied();\n \t}", "void remove(Coordinates coords) throws IOException;", "public void erase()\n {\n canvas.eraseCircle(xPosition, yPosition, diameter);\n }", "public void compact() {\n\t\tint n = vertices.size();\n\t\t// ids utilizados de 1 a n\n\t\tint[] small = new int[n + 1];\n\t\tVertice[] big = new Vertice[n];\n\n\t\tint qbig = 0;\n\t\tfor (Vertice v1 : vertices.values()) {\n\t\t\tif (v1.id <= n)\n\t\t\t\tsmall[v1.id] = 1;\n\t\t\telse\n\t\t\t\tbig[qbig++] = v1;\n\t\t}\n\n\t\tint i = 1;\n\t\tfor (int pairs = 0; pairs < qbig; i++) {\n\t\t\tif (small[i] == 0)\n\t\t\t\tsmall[pairs++] = i;\n\t\t}\n\n\t\tfor (i = 0; i < qbig; i++) {\n\t\t\tint old_id = big[i].id;\n\t\t\tbig[i].id = small[i];\n\n\t\t\tvertices.remove(old_id);\n\t\t\tvertices.put(big[i].id, big[i]);\n\n\t\t\tfor (Vertice v1 : vertices.values()) {\n\t\t\t\tif (v1.vizinhos.get(old_id) != null) {\n\t\t\t\t\tv1.vizinhos.remove(old_id);\n\t\t\t\t\tv1.vizinhos.put(big[i].id, big[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void remove(int index){\r\n \tkeys[index] = null;\r\n \tvals[index] = null;\r\n deleteCheck(index);\r\n }", "void unsetProbables();", "int removeObstacle(int numRows, int numColumns, List<List<Integer>> lot)\r\n {\r\n \tint m = 0;\r\n \tint n = 0;\r\n \tfor(List<Integer> rowList: lot) {\r\n \t\tfor(Integer num: rowList) {\r\n \t\t\tif(num == 9 ) {\r\n \t\t\t\tbreak;\r\n \t\t\t}\r\n \t\t\tn++;\r\n \t\t}\r\n \t\tm++;\r\n \t}\r\n \t// to store min cells required to be \r\n // covered to reach a particular cell \r\n int dp[][] = new int[numRows][numColumns]; \r\n \r\n // initially no cells can be reached \r\n for (int i = 0; i < numRows; i++) \r\n for (int j = 0; j < numColumns; j++) \r\n dp[i][j] = Integer.MAX_VALUE; \r\n \r\n // base case \r\n dp[0][0] = 1; \r\n \r\n for (int i = 0; i < lot.size(); i++) {\r\n \tList<Integer> columnList = lot.get(i);\r\n for (int j = 0; j < columnList.size(); j++) { \r\n \r\n // dp[i][j] != INT_MAX denotes that cell \r\n // (i, j) can be reached from cell (0, 0) \r\n // and the other half of the condition \r\n // finds the cell on the right that can \r\n // be reached from (i, j) \r\n if (dp[i][j] != Integer.MAX_VALUE && \r\n (j + columnList.get(j)) < numColumns && (dp[i][j] + 1) \r\n < dp[i][j + columnList.get(j)]\r\n \t\t && columnList.get(j) != 0) \r\n dp[i][j + columnList.get(j)] = dp[i][j] + 1; \r\n \r\n if (dp[i][j] != Integer.MAX_VALUE && \r\n (i + columnList.get(j)) < numRows && (dp[i][j] + 1) \r\n < dp[i + columnList.get(j)][j] && columnList.get(j) != 0) \r\n dp[i + columnList.get(j)][j] = dp[i][j] + 1; \r\n } \r\n } \r\n \r\n if (dp[m - 1][n - 1] != Integer.MAX_VALUE) \r\n return dp[m - 1][n - 1]; \r\n \r\n return -1; \r\n }", "public static double RemovePassengers(double inPassengers) \r\n {\r\n if (inPassengers < 0) \r\n {\r\n return -1;\r\n }\r\n else if (curPassengers - inPassengers < 0)\r\n {\r\n double surplus = inPassengers - curPassengers;\r\n curPassengers = 0;\r\n return surplus;\r\n } \n else\n {\n curPassengers -= inPassengers;\n return 0;\n }\r\n\r\n }", "public void removeEdge() {\n Graph GO = new Graph(nbOfVertex + 1);\n Value.clear();\n for (int i = 0; i < x.length; i++) {\n for (int j : x[i].getDomain()) {\n Value.add(j);\n if (MaxMatch[i] == Map.get(j)) {\n GO.addEdge(Map.get(j), i);\n } else {\n GO.addEdge(i, Map.get(j));\n }\n }\n }\n\n for (int i : V2) {\n for (int j : Value) {\n if (!V2.contains(j)) {\n GO.addEdge(i, j);\n }\n }\n }\n //System.out.println(\"GO : \");\n //System.out.println(GO);\n int[] map2Node = GO.findStrongConnectedComponent();\n //GO.printSCC();\n\n ArrayList<Integer>[] toRemove = new ArrayList[n];\n for (int i = 0; i < n; i++) {\n toRemove[i] = new ArrayList<Integer>();\n }\n for (int i = 0; i < n; i++) {\n for (int j : x[i].getDomain()) {\n ////System.out.println(i + \" \" + j);\n if (map2Node[i] != map2Node[Map.get(j)] && MaxMatch[i] != Map.get(j)) {\n toRemove[i].add(j);\n if (debug == 1) System.out.println(\"Remove arc : \" + i + \" => \" + j);\n }\n }\n }\n for (int i = 0; i < n; i++) {\n for (int j : toRemove[i]) {\n x[i].removeValue(j);\n }\n }\n }", "private void removeArea() {\n \t\tthis.set.remove( this.area );\n \t\tthis.finish();\n \t}", "protected void removeLine(int row) {\n\t\t// clear out the true values from row/filled blocks\n\t\tfor(int j = 0; j < blockMatrix[row].length; j++) { \n\t\t\tblockMatrix[row][j] = false; \n\t\t}\n\t}", "void removeSpeeds(int i);" ]
[ "0.6384145", "0.6053335", "0.59204835", "0.5826101", "0.5751348", "0.5745018", "0.55886936", "0.55694276", "0.55619186", "0.5560873", "0.5545191", "0.5526922", "0.55241853", "0.550532", "0.54843885", "0.54773366", "0.5473004", "0.54663235", "0.54356056", "0.54215527", "0.541864", "0.5416795", "0.5415696", "0.54038", "0.53989774", "0.5375926", "0.5369994", "0.5367833", "0.53609085", "0.53571343", "0.5327198", "0.5325637", "0.5324548", "0.5321963", "0.53145057", "0.53011906", "0.53008145", "0.5297847", "0.52951545", "0.52842444", "0.52770346", "0.52703077", "0.52640617", "0.5258362", "0.52523816", "0.5235916", "0.5234295", "0.5224934", "0.5219513", "0.51968473", "0.51967376", "0.51870495", "0.5185762", "0.5184272", "0.5182823", "0.51715934", "0.51674354", "0.51668346", "0.5165469", "0.51639295", "0.51635826", "0.5163286", "0.5162371", "0.5159008", "0.51584196", "0.51548404", "0.5153129", "0.51510936", "0.51407415", "0.5140556", "0.51351535", "0.5123816", "0.5118169", "0.51169294", "0.5115992", "0.5103393", "0.50998664", "0.50993556", "0.5087594", "0.5082936", "0.5080217", "0.50777906", "0.50755143", "0.50719446", "0.5071767", "0.5071501", "0.5069576", "0.50649256", "0.5064828", "0.50635844", "0.50627303", "0.50620246", "0.50583637", "0.5057583", "0.50570637", "0.50568014", "0.505386", "0.5051412", "0.5050681", "0.50471556", "0.50463593" ]
0.0
-1
// mission 7 O(1)//
public Boolean getLargestAxis() { double widthX = this.maxx.getData().getX()-this.minx.getData().getX(); double widthY = this.maxy.getData().getY()-this.miny.getData().getY(); return (widthX > widthY); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int e(amj paramamj)\r\n/* 202: */ {\r\n/* 203:221 */ alq localalq = paramamj.b();\r\n/* 204:222 */ int i = paramamj.b;\r\n/* 205: */ \r\n/* 206:224 */ int j = d(paramamj);\r\n/* 207:225 */ if (j < 0) {\r\n/* 208:226 */ j = j();\r\n/* 209: */ }\r\n/* 210:228 */ if (j < 0) {\r\n/* 211:229 */ return i;\r\n/* 212: */ }\r\n/* 213:231 */ if (this.a[j] == null)\r\n/* 214: */ {\r\n/* 215:232 */ this.a[j] = new amj(localalq, 0, paramamj.i());\r\n/* 216:233 */ if (paramamj.n()) {\r\n/* 217:234 */ this.a[j].d((fn)paramamj.o().b());\r\n/* 218: */ }\r\n/* 219: */ }\r\n/* 220:238 */ int k = i;\r\n/* 221:239 */ if (k > this.a[j].c() - this.a[j].b) {\r\n/* 222:240 */ k = this.a[j].c() - this.a[j].b;\r\n/* 223: */ }\r\n/* 224:242 */ if (k > p_() - this.a[j].b) {\r\n/* 225:243 */ k = p_() - this.a[j].b;\r\n/* 226: */ }\r\n/* 227:246 */ if (k == 0) {\r\n/* 228:247 */ return i;\r\n/* 229: */ }\r\n/* 230:250 */ i -= k;\r\n/* 231:251 */ this.a[j].b += k;\r\n/* 232:252 */ this.a[j].c = 5;\r\n/* 233: */ \r\n/* 234:254 */ return i;\r\n/* 235: */ }", "public static void main(String[] args) {\n\n pairsSum();\n\n printAllSubArrays();\n\n tripletZero();\n\n // int[][] sub = subsets();\n\n PairsSum sum = new PairsSum();\n int[] arr = { 10, 1, 2, 3, 4, 5, 6, 1 };\n boolean flag = sum.almostIncreasingSequence(arr);\n System.out.println(flag);\n\n String s = \"\";\n for (int i = 0; i < 100000; i++) {\n // s += \"CodefightsIsAwesome\";\n }\n long start = System.currentTimeMillis();\n // int k = subStr(s, \"IsA\");\n System.out.println(System.currentTimeMillis() - start);\n // System.out.println(k);\n\n String[] a = { \"aba\", \"aa\", \"ad\", \"vcd\", \"aba\" };\n String[] b = sum.allLongestStrings(a);\n System.out.println(Arrays.deepToString(b));\n\n List<String> al = new ArrayList<>();\n al.toArray();\n\n Map<Integer, Integer> map = new HashMap<>();\n Set<Integer> keySet = map.keySet();\n for (Integer integer : keySet) {\n\n }\n\n String st = reverseBracksStack(\"a(bc(de)f)g\");\n System.out.println(st);\n\n int[] A = { 1, 2, 3, 2, 2, 3, 3, 33 };\n int[] B = { 1, 2, 2, 2, 2, 3, 2, 33 };\n\n System.out.println(sum.isIPv4Address(\"2.2.34\"));\n\n Integer[] AR = { 5, 3, 6, 7, 9 };\n int h = sum.avoidObstacles(AR);\n System.out.println(h);\n\n int[][] image = { { 36, 0, 18, 9 }, { 27, 54, 9, 0 }, { 81, 63, 72, 45 } };\n int[][] im = { { 7, 4, 0, 1 }, { 5, 6, 2, 2 }, { 6, 10, 7, 8 }, { 1, 4, 2, 0 } };\n int[][] res = sum.boxBlur(im);\n\n for (int i = 0; i < res.length; i++) {\n for (int j = 0; j < res[0].length; j++) {\n System.out.print(res[i][j] + \" \");\n }\n System.out.println();\n }\n\n boolean[][] ms = { { true, false, false, true }, { false, false, true, false }, { true, true, false, true } };\n int[][] mines = sum.minesweeper(ms);\n for (int i = 0; i < mines.length; i++) {\n for (int j = 0; j < mines[0].length; j++) {\n System.out.print(mines[i][j] + \" \");\n }\n System.out.println();\n }\n\n System.out.println(sum.variableName(\"var_1__Int\"));\n\n System.out.println(sum.chessBoard());\n\n System.out.println(sum.depositProfit(100, 20, 170));\n\n String[] inputArray = { \"abc\", \"abx\", \"axx\", \"abx\", \"abc\" };\n System.out.println(sum.stringsRearrangement(inputArray));\n\n int[][] queens = { { 1, 1 }, { 3, 2 } };\n int[][] queries = { { 1, 1 }, { 0, 3 }, { 0, 4 }, { 3, 4 }, { 2, 0 }, { 4, 3 }, { 4, 0 } };\n boolean[] r = sum.queensUnderAttack(5, queens, queries);\n\n }", "public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\n\t\tint a[] = {2,1,3,-4,-2};\n\t\t//int a[] = {1 ,2, 3, 7, 5};\n\t\tboolean found = false;\n\t\t\n\t\t//this will solve in o n^2\n\t\tfor(int i = 0 ; i < a.length ; i++){\n\t\t\tint sum = 0;\n\t\t\tfor(int j = i ; j< a.length ; j++){\n\t\t\t\tsum += a[j] ;\n\t\t\t\tif(sum == 0){\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tif(found)\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t\n\t\t// link : https://www.youtube.com/watch?v=PSpuM9cimxA&list=PLKKfKV1b9e8ps6dD3QA5KFfHdiWj9cB1s&index=49\n\t\tSystem.out.println(found + \" found\");\n\t\tfound = false;\n\t\t//solving with O of N with the help sets\n\t\t// x + 0 = y\n\t\tSet<Integer> set = new HashSet<>();\n\t\tint sum = 0;\n\t\tfor(int element : a){\n\t\t\tset.add(sum);\n\t\t\tsum += element;\n\t\t\tif(set.contains(sum)){\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\tSystem.out.println(set);\n\t\t\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t\tfound = false;\n\t\t// when the sum of subarray is K\n\t\t\n\t\t//solving with O of N with the help sets\n\t\t//x + k = y >>>\n\t\tSet<Integer> set1 = new HashSet<>();\n\t\tint k = 12;\n\t\tint summ = 0;\n\t\tfor(int element : a){\n\t\t\tset1.add(summ);\n\t\t\tsumm += element;\n\t\t\tif(set1.contains(summ - k)){ // y - k = x(alredy presnt or not)\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(set1);\n\t\tSystem.out.println();\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t}", "public void solution() {\n\t\t\n\t}", "public void a()\r\n/* 49: */ {\r\n/* 50: 64 */ HashSet<BlockPosition> localHashSet = Sets.newHashSet();\r\n/* 51: */ \r\n/* 52: 66 */ int m = 16;\r\n/* 53: 67 */ for (int n = 0; n < 16; n++) {\r\n/* 54: 68 */ for (int i1 = 0; i1 < 16; i1++) {\r\n/* 55: 69 */ for (int i2 = 0; i2 < 16; i2++) {\r\n/* 56: 70 */ if ((n == 0) || (n == 15) || (i1 == 0) || (i1 == 15) || (i2 == 0) || (i2 == 15))\r\n/* 57: */ {\r\n/* 58: 74 */ double d1 = n / 15.0F * 2.0F - 1.0F;\r\n/* 59: 75 */ double d2 = i1 / 15.0F * 2.0F - 1.0F;\r\n/* 60: 76 */ double d3 = i2 / 15.0F * 2.0F - 1.0F;\r\n/* 61: 77 */ double d4 = Math.sqrt(d1 * d1 + d2 * d2 + d3 * d3);\r\n/* 62: */ \r\n/* 63: 79 */ d1 /= d4;\r\n/* 64: 80 */ d2 /= d4;\r\n/* 65: 81 */ d3 /= d4;\r\n/* 66: */ \r\n/* 67: 83 */ float f2 = this.i * (0.7F + this.d.rng.nextFloat() * 0.6F);\r\n/* 68: 84 */ double d6 = this.e;\r\n/* 69: 85 */ double d8 = this.f;\r\n/* 70: 86 */ double d10 = this.g;\r\n/* 71: */ \r\n/* 72: 88 */ float f3 = 0.3F;\r\n/* 73: 89 */ while (f2 > 0.0F)\r\n/* 74: */ {\r\n/* 75: 90 */ BlockPosition localdt = new BlockPosition(d6, d8, d10);\r\n/* 76: 91 */ Block localbec = this.d.getBlock(localdt);\r\n/* 77: 93 */ if (localbec.getType().getMaterial() != Material.air)\r\n/* 78: */ {\r\n/* 79: 94 */ float f4 = this.h != null ? this.h.a(this, this.d, localdt, localbec) : localbec.getType().a((Entity)null);\r\n/* 80: 95 */ f2 -= (f4 + 0.3F) * 0.3F;\r\n/* 81: */ }\r\n/* 82: 98 */ if ((f2 > 0.0F) && ((this.h == null) || (this.h.a(this, this.d, localdt, localbec, f2)))) {\r\n/* 83: 99 */ localHashSet.add(localdt);\r\n/* 84: */ }\r\n/* 85:102 */ d6 += d1 * 0.300000011920929D;\r\n/* 86:103 */ d8 += d2 * 0.300000011920929D;\r\n/* 87:104 */ d10 += d3 * 0.300000011920929D;\r\n/* 88:105 */ f2 -= 0.225F;\r\n/* 89: */ }\r\n/* 90: */ }\r\n/* 91: */ }\r\n/* 92: */ }\r\n/* 93: */ }\r\n/* 94:111 */ this.j.addAll(localHashSet);\r\n/* 95: */ \r\n/* 96:113 */ float f1 = this.i * 2.0F;\r\n/* 97: */ \r\n/* 98:115 */ int i1 = MathUtils.floor(this.e - f1 - 1.0D);\r\n/* 99:116 */ int i2 = MathUtils.floor(this.e + f1 + 1.0D);\r\n/* 100:117 */ int i3 = MathUtils.floor(this.f - f1 - 1.0D);\r\n/* 101:118 */ int i4 = MathUtils.floor(this.f + f1 + 1.0D);\r\n/* 102:119 */ int i5 = MathUtils.floor(this.g - f1 - 1.0D);\r\n/* 103:120 */ int i6 = MathUtils.floor(this.g + f1 + 1.0D);\r\n/* 104:121 */ List<Entity> localList = this.d.b(this.h, new AABB(i1, i3, i5, i2, i4, i6));\r\n/* 105:122 */ Vec3 localbrw = new Vec3(this.e, this.f, this.g);\r\n/* 106:124 */ for (int i7 = 0; i7 < localList.size(); i7++)\r\n/* 107: */ {\r\n/* 108:125 */ Entity localwv = (Entity)localList.get(i7);\r\n/* 109:126 */ if (!localwv.aV())\r\n/* 110: */ {\r\n/* 111:129 */ double d5 = localwv.f(this.e, this.f, this.g) / f1;\r\n/* 112:131 */ if (d5 <= 1.0D)\r\n/* 113: */ {\r\n/* 114:132 */ double d7 = localwv.xPos - this.e;\r\n/* 115:133 */ double d9 = localwv.yPos + localwv.getEyeHeight() - this.f;\r\n/* 116:134 */ double d11 = localwv.zPos - this.g;\r\n/* 117: */ \r\n/* 118:136 */ double d12 = MathUtils.sqrt(d7 * d7 + d9 * d9 + d11 * d11);\r\n/* 119:137 */ if (d12 != 0.0D)\r\n/* 120: */ {\r\n/* 121:141 */ d7 /= d12;\r\n/* 122:142 */ d9 /= d12;\r\n/* 123:143 */ d11 /= d12;\r\n/* 124: */ \r\n/* 125:145 */ double d13 = this.d.a(localbrw, localwv.getAABB());\r\n/* 126:146 */ double d14 = (1.0D - d5) * d13;\r\n/* 127:147 */ localwv.receiveDamage(DamageSource.a(this), (int)((d14 * d14 + d14) / 2.0D * 8.0D * f1 + 1.0D));\r\n/* 128: */ \r\n/* 129:149 */ double d15 = EnchantmentProtection.a(localwv, d14);\r\n/* 130:150 */ localwv.xVelocity += d7 * d15;\r\n/* 131:151 */ localwv.yVelocity += d9 * d15;\r\n/* 132:152 */ localwv.zVelocity += d11 * d15;\r\n/* 133:154 */ if ((localwv instanceof EntityPlayer)) {\r\n/* 134:155 */ this.k.put((EntityPlayer)localwv, new Vec3(d7 * d14, d9 * d14, d11 * d14));\r\n/* 135: */ }\r\n/* 136: */ }\r\n/* 137: */ }\r\n/* 138: */ }\r\n/* 139: */ }\r\n/* 140: */ }", "private int d(@Nullable K ☃) {\r\n/* 127 */ return (xq.f(System.identityHashCode(☃)) & Integer.MAX_VALUE) % this.b.length;\r\n/* */ }\r\n/* */ private int b(@Nullable K ☃, int i) {\r\n/* */ int j;\r\n/* 131 */ for (j = i; j < this.b.length; j++) {\r\n/* 132 */ if (this.b[j] == ☃) {\r\n/* 133 */ return j;\r\n/* */ }\r\n/* 135 */ if (this.b[j] == a) {\r\n/* 136 */ return -1;\r\n/* */ }\r\n/* */ }", "public static int f2(int N) { \n int x = 0; //O(1)\n for(int i = 0; i < N; i++) // O(n)\n // O(n)`\n for(int j = 0; j < i; j++) \n x++;\n return x;\n }", "public static int f1(int N) {\n int x = 0; //O(1)\n for(int i = 0; i < N; i++) // O(n) \n x++; \n return x; \n \n }", "public void mo442d() {\n long j;\n long j2;\n int i;\n long j3;\n boolean z;\n C0245a[] aVarArr;\n int i2;\n int i3;\n C3683c<? super U> cVar = this.f472a;\n int i4 = 1;\n while (!mo443e()) {\n C0211f<U> fVar = this.f477f;\n long j4 = this.f482m.get();\n boolean z2 = j4 == Long.MAX_VALUE;\n if (fVar != null) {\n j = 0;\n while (true) {\n long j5 = 0;\n Object obj = null;\n while (true) {\n if (j4 == 0) {\n break;\n }\n Object e_ = fVar.mo386e_();\n if (!mo443e()) {\n if (e_ == null) {\n obj = e_;\n break;\n }\n cVar.onNext(e_);\n j++;\n j5++;\n j4--;\n obj = e_;\n } else {\n return;\n }\n }\n if (j5 != 0) {\n if (z2) {\n j4 = Long.MAX_VALUE;\n } else {\n j4 = this.f482m.addAndGet(-j5);\n }\n }\n if (j4 == 0 || obj == null) {\n break;\n }\n }\n } else {\n j = 0;\n }\n boolean z3 = this.f478g;\n C0211f<U> fVar2 = this.f477f;\n C0245a[] aVarArr2 = (C0245a[]) this.f481j.get();\n int length = aVarArr2.length;\n if (!z3 || ((fVar2 != null && !fVar2.mo384b()) || length != 0)) {\n if (length != 0) {\n i = i4;\n long j6 = this.f485p;\n int i5 = this.f486q;\n if (length <= i5 || aVarArr2[i5].f462a != j6) {\n if (length <= i5) {\n i5 = 0;\n }\n int i6 = i5;\n for (int i7 = 0; i7 < length && aVarArr2[i6].f462a != j6; i7++) {\n i6++;\n if (i6 == length) {\n i6 = 0;\n }\n }\n this.f486q = i6;\n this.f485p = aVarArr2[i6].f462a;\n i5 = i6;\n }\n int i8 = i5;\n z = false;\n int i9 = 0;\n while (true) {\n if (i9 >= length) {\n aVarArr = aVarArr2;\n break;\n } else if (!mo443e()) {\n C0245a aVar = aVarArr2[i8];\n Object obj2 = null;\n while (!mo443e()) {\n C0212g<U> gVar = aVar.f467f;\n if (gVar == null) {\n aVarArr = aVarArr2;\n i2 = length;\n } else {\n aVarArr = aVarArr2;\n i2 = length;\n long j7 = 0;\n while (j2 != 0) {\n try {\n obj2 = gVar.mo386e_();\n if (obj2 == null) {\n break;\n }\n cVar.onNext(obj2);\n if (!mo443e()) {\n j2--;\n j7++;\n } else {\n return;\n }\n } catch (Throwable th) {\n Throwable th2 = th;\n C0171b.m584b(th2);\n aVar.dispose();\n this.f479h.mo516a(th2);\n if (!this.f474c) {\n this.f483n.mo407a();\n }\n if (!mo443e()) {\n mo439b(aVar);\n i9++;\n i3 = i2;\n z = true;\n } else {\n return;\n }\n }\n }\n if (j7 != 0) {\n j2 = !z2 ? this.f482m.addAndGet(-j7) : Long.MAX_VALUE;\n aVar.mo433a(j7);\n }\n if (!(j2 == 0 || obj2 == null)) {\n aVarArr2 = aVarArr;\n length = i2;\n }\n }\n boolean z4 = aVar.f466e;\n C0212g<U> gVar2 = aVar.f467f;\n if (z4 && (gVar2 == null || gVar2.mo384b())) {\n mo439b(aVar);\n if (!mo443e()) {\n j++;\n z = true;\n } else {\n return;\n }\n }\n if (j2 == 0) {\n break;\n }\n int i10 = i8 + 1;\n i3 = i2;\n i8 = i10 == i3 ? 0 : i10;\n i9++;\n length = i3;\n aVarArr2 = aVarArr;\n }\n return;\n } else {\n return;\n }\n }\n this.f486q = i8;\n this.f485p = aVarArr[i8].f462a;\n j3 = j;\n } else {\n i = i4;\n j3 = j;\n z = false;\n }\n if (j3 != 0 && !this.f480i) {\n this.f483n.mo408a(j3);\n }\n if (z) {\n i4 = i;\n } else {\n i4 = addAndGet(-i);\n if (i4 == 0) {\n return;\n }\n }\n } else {\n Throwable a = this.f479h.mo515a();\n if (a != C0315e.f669a) {\n if (a == null) {\n cVar.onComplete();\n } else {\n cVar.onError(a);\n }\n }\n return;\n }\n }\n }", "private final int m()\n\t { int n = 0;\n\t int i = 0;\n\t while(true)\n\t { if (i > j) return n;\n\t if (! cons(i)) break; i++;\n\t }\n\t i++;\n\t while(true)\n\t { while(true)\n\t { if (i > j) return n;\n\t if (cons(i)) break;\n\t i++;\n\t }\n\t i++;\n\t n++;\n\t while(true)\n\t { if (i > j) return n;\n\t if (! cons(i)) break;\n\t i++;\n\t }\n\t i++;\n\t }\n\t }", "public int[] fix34(int[] nums) {\r\n\tint i=0; // O(1)\r\n while(i<nums.length && nums[i]!=3) // O(n)\r\n i++; // n+1\r\n int j=i; // O(1)\r\n while(j+1<nums.length && nums[j+1]!=4) // O(n)\r\n j++; // n+1\r\n while(i<nums.length){ // O(n)\r\n if(nums[i]==3){ // O(1)\r\n int temp=nums[i+1]; // O(1)\r\n nums[i+1]=nums[j+1]; //O(1)\r\n nums[j+1]=temp; // O(1)\r\n while(j+1<nums.length && nums[j+1] != 4) //O(n)\r\n j++; // n+1\r\n }\r\n i++; // n+1\r\n }\r\n return nums; //O(1)\r\n}", "private void cpu_jogada(){\n\n for(i=0;i<8;i++){\n for(j=0;j<8;j++){\n if(matriz[i][j] == jd2){\n // verificarAtaque(i,j,jd2);\n //verificarAtaque as posssibilidades de\n // ataque : defesa : aleatorio\n //ataque tem prioridade 1 - ve se tem como comer quem ataca\n //defesa tem prioridade 2 - ou movimenta a peca que esta sob ataque ou movimenta a outa para ajudar\n //aleatorio nao tem prioridade -- caso nao esteja sob ataque ou defesa\n }\n }\n }\n }", "public static void main(String[] args) {\n\t\tint a[]= {15,3,7,1,9,2};\n\t\tsubarraysum(a,11);//Time complexity O(n^2) space O(1)\n\n\t\tsubarraysum_reducecomplexity(a,11,a.length); //Time complexity O(n) space O(1)\n\n\t}", "public static void main(String[] args) {\n\t\tArrayList<Integer> primelist = sieve(7071);\n\t\tArrayList<Double> second = new ArrayList<Double>();\n\t\tfor(int one : primelist) \n\t\t\tsecond.add(Math.pow(one, 2));\n\t\tArrayList<Double> third = new ArrayList<Double>();\n\t\tprimelist = sieve(368);\n\t\tfor(int one : primelist)\n\t\t\tthird.add(Math.pow(one, 3));\n\t\tArrayList<Double> fourth = new ArrayList<Double>();\n\t\tprimelist = sieve(84);\n\t\tfor(int one : primelist)\n\t\t\tfourth.add(Math.pow(one, 4));\n\n\t\tArrayList<Double> possibilities = new ArrayList<Double>();\n\t\tfor (int k = fourth.size() - 1; k >=0 ; k--) {\n\t\t\tfor (int j = 0; j < third.size(); j++) {\n\t\t\t\tdouble sum = fourth.get(k) + third.get(j);\n\t\t\t\tif (sum > 50000000)\n\t\t\t\t\tbreak;\n\t\t\t\telse {\n\t\t\t\t\tfor (int i = 0; i < second.size(); i++) {\n\t\t\t\t\t\tdouble nextsum = sum + second.get(i);\n\t\t\t\t\t\tif (nextsum > 50000000)\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// I am not sure whether it can be proved that the sum is unique.\n\t\t\t\t\t\t\tif (!possibilities.contains(nextsum))\n\t\t\t\t\t\t\t\tpossibilities.add(nextsum);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tint totalcount = possibilities.size();\n\t\tSystem.out.println(totalcount);\n\t}", "@Override public short getComplexity() {\n return 0;\n }", "void mo30275a(long j);", "public static int example4(int[] arr) { // O(1)\r\n\t\tint n = arr.length, prefix = 0, total = 0; // O(1), O(1), (1)\r\n\t\tfor (int j = 0; j < n; j++) { // loop from 0 to n-1 // O(n)\r\n\t\t\tprefix += arr[j];\r\n\t\t\ttotal += prefix;\r\n\t\t}\r\n\t\treturn total;\r\n\r\n\t\t/*\r\n\t\t * Explanation: The method contains a (for) loop and it runs (n) times.This loop\r\n\t\t * dominates the runtime.We always aim for the worse-case and maximum time. The\r\n\t\t * answer is it is linear time of O(n) notation.\r\n\t\t * \r\n\t\t */\r\n\t}", "public static void main(String[] args) throws IOException {\n BufferedReader bufferedReader = new BufferedReader(new FileReader(UFTest.class.getResource(\"/\").getPath()+\"1.5/largeUF.txt\"));\n String str = bufferedReader.readLine();\n UFLJWQU uf = new UFLJWQU(Integer.parseInt(str));\n long beginTime =System.currentTimeMillis();\n while ((str = bufferedReader.readLine())!=null){\n String[] array = str.split(\" \");\n int p = Integer.parseInt(array[0]);\n int q = Integer.parseInt(array[1]);\n if(uf.connected(p,q)) continue;\n uf.union(p,q);\n// System.out.println(p+\" -- \"+q);\n }\n System.out.println(uf.count());\n System.out.println(\"cost time :\"+(System.currentTimeMillis() - beginTime));\n }", "private void level7() {\n }", "public p207() {\n double target = 1/12345.0;\n double log2 = Math.log(2);\n\n for (int x = 2; x < 2000000; x++){\n double a = Math.floor(Math.log(x) / log2) / (x-1);\n if (a < target){\n System.out.println(x*(x-1L));\n break;\n }\n }\n }", "void mo25957a(long j, long j2);", "private static int betterSolution(int n) {\n return n*n*n;\n }", "protected static void endPartial(long[] h) {\n h[11] += h[1]; \n h[2] ^= h[11]; \n h[1] = (h[1] << 44) | (h[1] >>> 20);\n h[0] += h[2]; \n h[3] ^= h[0]; \n h[2] = (h[2] << 15) | (h[2] >>> 49);\n h[1] += h[3]; \n h[4] ^= h[1]; \n h[3] = (h[3] << 34) | (h[3] >>> 30);\n h[2] += h[4]; \n h[5] ^= h[2]; \n h[4] = (h[4] << 21) | (h[4] >>> 43);\n h[3] += h[5]; \n h[6] ^= h[3]; \n h[5] = (h[5] << 38) | (h[5] >>> 26);\n h[4] += h[6]; \n h[7] ^= h[4]; \n h[6] = (h[6] << 33) | (h[6] >>> 31);\n h[5] += h[7]; \n h[8] ^= h[5]; \n h[7] = (h[7] << 10) | (h[7] >>> 54);\n h[6] += h[8]; \n h[9] ^= h[6]; \n h[8] = (h[8] << 13) | (h[8] >>> 51);\n h[7] += h[9]; \n h[10] ^= h[7]; \n h[9] = (h[9] << 38) | (h[9] >>> 26);\n h[8] += h[10]; \n h[11] ^= h[8]; \n h[10] = (h[10] << 53) | (h[10] >>> 11);\n h[9] += h[11]; \n h[0] ^= h[9]; \n h[11] = (h[11] << 42) | (h[11] >>> 22);\n h[10] += h[0]; \n h[1] ^= h[10]; \n h[0] = (h[0] << 54) | (h[0] >>> 10);\t\t\n\t}", "public static void main(String... args) {\n\n Set<Long> As = new HashSet<>();\n int N = 100;\n for (long p = -N; p <= N; ++p) {\n for (long q = -N; q <= p; ++q) {\n for (long r = -N; r <= q; ++r) {\n if (r==0 || p==0 || q==0)\n continue;\n\n long nom = r*p*q;\n long den = r*p + r*q + p*q;\n\n if (den != 0 && nom % den==0 && (nom^den)>=0) {\n long A = nom/den;\n\n if (A==nom) {\n As.add(A);\n System.out.printf(\"A=%d (p=%d, q=%d, r=%d)\\n\", A, p, q, r);\n }\n }\n }\n }\n }\n Long[] aa = As.toArray(new Long[As.size()]);\n Arrays.sort(aa);\n System.out.printf(\"============\\n\");\n System.out.printf(\"A(%d)=%s\\n\", aa.length, Arrays.toString(aa));\n\n for (long a = 1; a < 100; ++a) {\n if (isAlexandrian(a))\n System.out.printf(\"A=%dn\", a);\n }\n }", "public boolean a(amj paramamj)\r\n/* 268: */ {\r\n/* 269:293 */ if ((paramamj == null) || (paramamj.b == 0) || (paramamj.b() == null)) {\r\n/* 270:294 */ return false;\r\n/* 271: */ }\r\n/* 272: */ try\r\n/* 273: */ {\r\n/* 274:298 */ if (!paramamj.g())\r\n/* 275: */ {\r\n/* 276: */ do\r\n/* 277: */ {\r\n/* 278:301 */ i = paramamj.b;\r\n/* 279:302 */ paramamj.b = e(paramamj);\r\n/* 280:303 */ } while ((paramamj.b > 0) && (paramamj.b < i));\r\n/* 281:304 */ if ((paramamj.b == i) && (this.d.by.d))\r\n/* 282: */ {\r\n/* 283:306 */ paramamj.b = 0;\r\n/* 284:307 */ return true;\r\n/* 285: */ }\r\n/* 286:309 */ return paramamj.b < i;\r\n/* 287: */ }\r\n/* 288:312 */ int i = j();\r\n/* 289:313 */ if (i >= 0)\r\n/* 290: */ {\r\n/* 291:314 */ this.a[i] = amj.b(paramamj);\r\n/* 292:315 */ this.a[i].c = 5;\r\n/* 293:316 */ paramamj.b = 0;\r\n/* 294:317 */ return true;\r\n/* 295: */ }\r\n/* 296:318 */ if (this.d.by.d)\r\n/* 297: */ {\r\n/* 298:320 */ paramamj.b = 0;\r\n/* 299:321 */ return true;\r\n/* 300: */ }\r\n/* 301:323 */ return false;\r\n/* 302: */ }\r\n/* 303: */ catch (Throwable localThrowable)\r\n/* 304: */ {\r\n/* 305:325 */ b localb = b.a(localThrowable, \"Adding item to inventory\");\r\n/* 306:326 */ j localj = localb.a(\"Item being added\");\r\n/* 307: */ \r\n/* 308:328 */ localj.a(\"Item ID\", Integer.valueOf(alq.b(paramamj.b())));\r\n/* 309:329 */ localj.a(\"Item data\", Integer.valueOf(paramamj.i()));\r\n/* 310:330 */ localj.a(\"Item name\", new ahc(this, paramamj));\r\n/* 311: */ \r\n/* 312: */ \r\n/* 313: */ \r\n/* 314: */ \r\n/* 315: */ \r\n/* 316: */ \r\n/* 317:337 */ throw new u(localb);\r\n/* 318: */ }\r\n/* 319: */ }", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int T = sc.nextInt();\n for(int i = 0 ; i < T; i++) {\n int n = sc.nextInt();\n int a = sc.nextInt();\n int b = sc.nextInt();\n PriorityQueue<Integer> queue = new PriorityQueue<Integer>();\n int[][] m = new int[n][n];\n //n^2 * log(n)\n for(int row = 0; row < n; row++) {\n for(int col = 0; col < n; col++) {\n if(row == 0 && col == 0 && n != 1) {\n continue;\n }else if(row == 0) {\n m[row][col] = m[row][col - 1] + a;\n }else if(col == 0) {\n m[row][col] = m[row-1][col] + b;\n }else {\n m[row][col] = m[row-1][col-1] + a + b;\n }\n\n if(row + col == (n -1)) {\n pool.add(m[row][col]); //log(n)\n }\n }\n }\n //O(n*log(n))\n for (Integer item:pool) {\n queue.add(item); //O(logn)\n }\n while(!queue.isEmpty()) {\n System.out.print(queue.poll() + \" \"); //O(1)\n }\n System.out.println();\n queue.clear();\n pool.clear();\n }\n }", "public static void main(String[] args) {\n /* *************** */\n /* * QUESTION 7 * */\n /* *************** */\n /* *************** */\n\n for(double p=0; p<1; p+=0.1){\n for(double q=0; q<1; q+=0.1){\n int res_1 = 0;\n int res_2 = 0;\n for(int i=0; i<100; i++){\n Graph graph_1 = new Graph();\n graph_1.generate_full_symmetric(p, q, 100);\n //graph_2.setVertices(new ArrayList<>(graph_1.getVertices()));\n Graph graph_2 = (Graph) deepCopy(graph_1);\n res_1+=graph_1.resolve_heuristic_v1().size();\n res_2+=graph_2.resolve_heuristic_v2();\n }\n res_1/=100;\n System.out.format(\"V1 - f( %.1f ; %.1f) = %s \\n\", p, q, res_1);\n res_2/=100;\n System.out.format(\"V2 - f( %.1f ; %.1f) = %s \\n\", p, q, res_2);\n }\n }\n\n }", "void mo13371a(int i, long j);", "public void mo21877s() {\n }", "long mo25071a(long j);", "private int m3423z(int i, int i2) {\n int i3;\n int i4;\n for (int size = this.f4373c.size() - 1; size >= 0; size--) {\n C0933b bVar = this.f4373c.get(size);\n int i5 = bVar.f4379a;\n if (i5 == 8) {\n int i6 = bVar.f4380b;\n int i7 = bVar.f4382d;\n if (i6 < i7) {\n i4 = i6;\n i3 = i7;\n } else {\n i3 = i6;\n i4 = i7;\n }\n if (i < i4 || i > i3) {\n if (i < i6) {\n if (i2 == 1) {\n bVar.f4380b = i6 + 1;\n bVar.f4382d = i7 + 1;\n } else if (i2 == 2) {\n bVar.f4380b = i6 - 1;\n bVar.f4382d = i7 - 1;\n }\n }\n } else if (i4 == i6) {\n if (i2 == 1) {\n bVar.f4382d = i7 + 1;\n } else if (i2 == 2) {\n bVar.f4382d = i7 - 1;\n }\n i++;\n } else {\n if (i2 == 1) {\n bVar.f4380b = i6 + 1;\n } else if (i2 == 2) {\n bVar.f4380b = i6 - 1;\n }\n i--;\n }\n } else {\n int i8 = bVar.f4380b;\n if (i8 <= i) {\n if (i5 == 1) {\n i -= bVar.f4382d;\n } else if (i5 == 2) {\n i += bVar.f4382d;\n }\n } else if (i2 == 1) {\n bVar.f4380b = i8 + 1;\n } else if (i2 == 2) {\n bVar.f4380b = i8 - 1;\n }\n }\n }\n for (int size2 = this.f4373c.size() - 1; size2 >= 0; size2--) {\n C0933b bVar2 = this.f4373c.get(size2);\n if (bVar2.f4379a == 8) {\n int i9 = bVar2.f4382d;\n if (i9 == bVar2.f4380b || i9 < 0) {\n this.f4373c.remove(size2);\n mo7620a(bVar2);\n }\n } else if (bVar2.f4382d <= 0) {\n this.f4373c.remove(size2);\n mo7620a(bVar2);\n }\n }\n return i;\n }", "public void verliesLeven() {\r\n\t\t\r\n\t}", "static int[] OnepassSol1(int[]a, int n){\r\n Map<Integer, Integer> map = new HashMap<>();\r\n for (int i = 0; i < a.length; i++) {\r\n int complement = n - a[i];\r\n if (map.containsKey(complement)) {\r\n return new int[] { map.get(complement), i };\r\n }\r\n map.put(a[i], i);\r\n }\r\n int[] ans = {-1,-1};\r\n return ans;\r\n }", "private boolean kcss(int[] i, long[] e, long y) {\n int I = i.length;\n long[] x = new long[I];\n while (true) {\n x[0] = ll(i[0]); // 1\n snapshot(i, 1, I, x); // 2\n if (Arrays.compare(x, e) != 0) { // 3\n sc(i[0], x[0]); // 3a\n return false; // 3a\n }\n if (sc(i[0], y)) return true; // 3b\n } // 3c\n }", "static int[] find2(int a[]){\r\n int sum = a[0];\r\n int pro = a[0];\r\n for(int i=1;i<a.length;i++){\r\n sum += a[i];\r\n pro += a[i]*a[i];\r\n }\r\n int s = (n*(n+1))/2 - sum;\r\n int p = (n*(n+1)*(2*n+1))/6 - pro;\r\n return solveSP(s, p);\r\n }", "@Test\n\tpublic void intersection() {\n\n\t\tlong n = 105;\n\t\tlong m = 100;\n\t\tfor(long i = n - 1; i > 1; i--){\n\t\t\tn = n * i;\n\t\t\tfor(long j = getZero(n); j > 0; j--){\n\t\t\t\tm = m * 10;\n\t\t\t}\n\t\t\tn = n % m;\n\t\t\tm = 100;\n\n\t\t\tSystem.out.println(n+\" \"+i);\n\n\t\t}\n\n\n\n\n\n\t}", "public static void main(String[] args) {\n long startTime = System.nanoTime();\n Board b = new Board();\n b.board = InitialPositions.kiwiPeteBoard; // perft test\n\n int p2 = 0;\n int p3 = 0;\n int p4 = 0;\n int p5 = 0;\n\n List<Move> p1Moves = b.validMoves();\n int p1 = p1Moves.size();\n for (Move m : p1Moves){\n b.makeMove(m);\n List<Move> p2Moves = b.validMoves();\n p2 += p2Moves.size();\n for (Move n : p2Moves){\n b.makeMove(n);\n List<Move> p3Moves = b.validMoves();\n for (Move m3 : p3Moves){\n b.makeMove(m3);\n List<Move> moves4 = b.validMoves();\n p4 += moves4.size();\n for (Move m4 : moves4){\n b.makeMove(m4);\n p5 += b.validMoves().size();\n b.undoMove(m4);\n }\n b.undoMove(m3);\n }\n p3 += p3Moves.size();\n b.undoMove(n);\n }\n b.undoMove(m);\n }\n System.out.println();\n System.out.println(p1);\n System.out.println(p2);\n System.out.println(p3);\n System.out.println(p4);\n System.out.println(p5); // 193690690\n System.out.println(\"Time taken: \"+(System.nanoTime()-startTime)); // with int castles : 35003485400\n }", "private void method_247(int[] var1, int[] var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9, int var10) {\n boolean var15 = field_759;\n int var11 = -(var6 >> 2);\n var6 = -(var6 & 3);\n int var12 = -var7;\n if(var15 || var12 < 0) {\n do {\n int var13 = var11;\n int var14;\n if(!var15 && var11 >= 0) {\n var14 = var6;\n if(var15 || var6 < 0) {\n do {\n label89: {\n var3 = var2[var4++];\n if(var3 != 0) {\n var1[var5++] = var3;\n if(!var15) {\n break label89;\n }\n }\n\n ++var5;\n }\n\n ++var14;\n } while(var14 < 0);\n\n var5 += var8;\n var4 += var9;\n var12 += var10;\n } else {\n var5 += var8;\n var4 += var9;\n var12 += var10;\n }\n } else {\n do {\n label69: {\n var3 = var2[var4++];\n if(var3 != 0) {\n var1[var5++] = var3;\n if(!var15) {\n break label69;\n }\n }\n\n ++var5;\n }\n\n label63: {\n var3 = var2[var4++];\n if(var3 != 0) {\n var1[var5++] = var3;\n if(!var15) {\n break label63;\n }\n }\n\n ++var5;\n }\n\n label57: {\n var3 = var2[var4++];\n if(var3 != 0) {\n var1[var5++] = var3;\n if(!var15) {\n break label57;\n }\n }\n\n ++var5;\n }\n\n label51: {\n var3 = var2[var4++];\n if(var3 != 0) {\n var1[var5++] = var3;\n if(!var15) {\n break label51;\n }\n }\n\n ++var5;\n }\n\n ++var13;\n } while(var13 < 0);\n\n var14 = var6;\n if(var15 || var6 < 0) {\n do {\n label34: {\n var3 = var2[var4++];\n if(var3 != 0) {\n var1[var5++] = var3;\n if(!var15) {\n break label34;\n }\n }\n\n ++var5;\n }\n\n ++var14;\n } while(var14 < 0);\n\n var5 += var8;\n var4 += var9;\n var12 += var10;\n } else {\n var5 += var8;\n var4 += var9;\n var12 += var10;\n }\n }\n } while(var12 < 0);\n\n }\n }", "public static void main(String[] args) {\n List<Integer> pr = new ArrayList<>();\n out:\n for (int p = 2; p <= 100; p++) {\n for (int q : pr) {\n if (p % q == 0) {\n continue out;\n }\n }\n pr.add(p);\n }\n Set<List<Integer>> s = new HashSet<>();\n for (int a = 2; a <= 100; a++) {\n List<Integer> l = new ArrayList<>();\n for (int p : pr) {\n int e = 0;\n for (int c = a; c % p == 0; c /= p) {\n e++;\n }\n l.add(e);\n }\n for (int b = 2; b <= 100; b++) {\n List<Integer> m = new ArrayList<>();\n for (int e : l) {\n m.add(b * e);\n }\n s.add(m);\n }\n }\n System.out.println(s.size());\n }", "private int d(amj paramamj)\r\n/* 50: */ {\r\n/* 51: 70 */ for (int i = 0; i < this.a.length; i++) {\r\n/* 52: 71 */ if ((this.a[i] != null) && (this.a[i].b() == paramamj.b()) && (this.a[i].d()) && (this.a[i].b < this.a[i].c()) && (this.a[i].b < p_()) && ((!this.a[i].f()) || (this.a[i].i() == paramamj.i())) && (amj.a(this.a[i], paramamj))) {\r\n/* 53: 72 */ return i;\r\n/* 54: */ }\r\n/* 55: */ }\r\n/* 56: 75 */ return -1;\r\n/* 57: */ }", "private void method_4325(int var1, int var2) {\r\n byte var4 = 64;\r\n String[] var3 = class_752.method_4253();\r\n class_482.field_2258 = true;\r\n byte var5 = 4;\r\n int var6 = var4 - 1;\r\n\r\n int var10000;\r\n label95:\r\n while(true) {\r\n var10000 = var6;\r\n\r\n label92:\r\n while(var10000 <= var4 + 32) {\r\n var10000 = var1 - var5;\r\n if(var3 == null) {\r\n break label95;\r\n }\r\n\r\n int var7 = var10000;\r\n\r\n label89:\r\n do {\r\n var10000 = var7;\r\n\r\n label86:\r\n while(true) {\r\n if(var10000 > var1 + var5) {\r\n break label89;\r\n }\r\n\r\n var10000 = var2 - var5;\r\n if(var3 == null) {\r\n continue label92;\r\n }\r\n\r\n int var8 = var10000;\r\n\r\n while(true) {\r\n if(var8 > var2 + var5) {\r\n break label86;\r\n }\r\n\r\n double var9 = (double)(var7 - var1);\r\n double var11 = (double)(var8 - var2);\r\n double var13 = var9 * var9 + var11 * var11;\r\n if(var3 != null) {\r\n double var15;\r\n var10000 = (var15 = var13 - ((double)var5 - 0.5D) * ((double)var5 - 0.5D)) == 0.0D?0:(var15 < 0.0D?-1:1);\r\n if(var3 == null) {\r\n break;\r\n }\r\n\r\n if(var10000 <= 0) {\r\n label105: {\r\n label106: {\r\n var10000 = var6;\r\n byte var10001 = var4;\r\n if(var3 != null) {\r\n if(var6 < var4) {\r\n double var16;\r\n var10000 = (var16 = var13 - ((double)(var5 - 1) - 0.5D) * ((double)(var5 - 1) - 0.5D)) == 0.0D?0:(var16 < 0.0D?-1:1);\r\n if(var3 != null) {\r\n if(var10000 > 0) {\r\n break label105;\r\n }\r\n\r\n this.field_2990.method_2058(var7, var6, var8, class_1192.field_6032);\r\n }\r\n\r\n if(var3 != null) {\r\n break label105;\r\n }\r\n }\r\n\r\n var10000 = var6;\r\n if(var3 == null) {\r\n break label106;\r\n }\r\n\r\n var10001 = var4;\r\n }\r\n\r\n if(var10000 > var10001) {\r\n this.field_2990.method_2058(var7, var6, var8, class_1192.field_6025);\r\n if(var3 != null) {\r\n break label105;\r\n }\r\n }\r\n\r\n double var17;\r\n var10000 = (var17 = var13 - ((double)(var5 - 1) - 0.5D) * ((double)(var5 - 1) - 0.5D)) == 0.0D?0:(var17 < 0.0D?-1:1);\r\n }\r\n\r\n if(var3 != null) {\r\n label59: {\r\n if(var10000 > 0) {\r\n this.field_2990.method_2058(var7, var6, var8, class_1192.field_6032);\r\n if(var3 != null) {\r\n break label59;\r\n }\r\n }\r\n\r\n this.field_2990.method_2058(var7, var6, var8, class_1192.field_6143);\r\n }\r\n }\r\n }\r\n }\r\n\r\n ++var8;\r\n }\r\n\r\n if(var3 == null) {\r\n break label86;\r\n }\r\n }\r\n }\r\n\r\n ++var7;\r\n } while(var3 != null);\r\n\r\n ++var6;\r\n if(var3 != null) {\r\n continue label95;\r\n }\r\n break;\r\n }\r\n\r\n this.field_2990.method_2058(var1, var4 + 0, var2, class_1192.field_6032);\r\n this.field_2990.method_2058(var1, var4 + 1, var2, class_1192.field_6032);\r\n this.field_2990.method_2058(var1, var4 + 2, var2, class_1192.field_6032);\r\n this.field_2990.method_2058(var1 - 1, var4 + 2, var2, class_1192.field_6077);\r\n this.field_2990.method_2058(var1 + 1, var4 + 2, var2, class_1192.field_6077);\r\n this.field_2990.method_2058(var1, var4 + 2, var2 - 1, class_1192.field_6077);\r\n this.field_2990.method_2058(var1, var4 + 2, var2 + 1, class_1192.field_6077);\r\n this.field_2990.method_2058(var1, var4 + 3, var2, class_1192.field_6032);\r\n this.field_2990.method_2058(var1, var4 + 4, var2, class_1192.field_6146);\r\n var10000 = 0;\r\n break;\r\n }\r\n\r\n class_482.field_2258 = (boolean)var10000;\r\n }", "public static void main(String args[]){\n\t\tProblem7 p7 = new Problem7(1000000);\n\t\t//p7.slow_check_if_prime(7919);\n\t\tp7.solve();\n\t}", "private void f(java.lang.String r8) {\n /*\n r7 = this;\n r6 = 1;\n r2 = F;\n r7.y = r8;\n r0 = r7.m;\n r0 = r0.entrySet();\n r3 = r0.iterator();\n L_0x000f:\n r0 = r3.hasNext();\n if (r0 == 0) goto L_0x004a;\n L_0x0015:\n r0 = r3.next();\n r0 = (java.util.Map.Entry) r0;\n r1 = r0.getValue();\n r1 = (java.util.List) r1;\n r4 = r1.size();\t Catch:{ RuntimeException -> 0x0077 }\n if (r4 != r6) goto L_0x0043;\n L_0x0027:\n r4 = J;\t Catch:{ RuntimeException -> 0x0079 }\n r5 = 28;\n r4 = r4[r5];\t Catch:{ RuntimeException -> 0x0079 }\n r5 = 0;\n r5 = r1.get(r5);\t Catch:{ RuntimeException -> 0x0079 }\n r4 = r4.equals(r5);\t Catch:{ RuntimeException -> 0x0079 }\n if (r4 == 0) goto L_0x0043;\n L_0x0038:\n r4 = r7.e;\t Catch:{ RuntimeException -> 0x007b }\n r0 = r0.getKey();\t Catch:{ RuntimeException -> 0x007b }\n r4.add(r0);\t Catch:{ RuntimeException -> 0x007b }\n if (r2 == 0) goto L_0x0048;\n L_0x0043:\n r0 = r7.x;\t Catch:{ RuntimeException -> 0x007b }\n r0.addAll(r1);\t Catch:{ RuntimeException -> 0x007b }\n L_0x0048:\n if (r2 == 0) goto L_0x000f;\n L_0x004a:\n r0 = r7.x;\t Catch:{ RuntimeException -> 0x007d }\n r1 = J;\t Catch:{ RuntimeException -> 0x007d }\n r2 = 29;\n r1 = r1[r2];\t Catch:{ RuntimeException -> 0x007d }\n r0 = r0.remove(r1);\t Catch:{ RuntimeException -> 0x007d }\n if (r0 == 0) goto L_0x0065;\n L_0x0058:\n r0 = B;\t Catch:{ RuntimeException -> 0x007d }\n r1 = java.util.logging.Level.WARNING;\t Catch:{ RuntimeException -> 0x007d }\n r2 = J;\t Catch:{ RuntimeException -> 0x007d }\n r3 = 30;\n r2 = r2[r3];\t Catch:{ RuntimeException -> 0x007d }\n r0.log(r1, r2);\t Catch:{ RuntimeException -> 0x007d }\n L_0x0065:\n r1 = r7.G;\n r0 = r7.m;\n r2 = java.lang.Integer.valueOf(r6);\n r0 = r0.get(r2);\n r0 = (java.util.Collection) r0;\n r1.addAll(r0);\n return;\n L_0x0077:\n r0 = move-exception;\n throw r0;\t Catch:{ RuntimeException -> 0x0079 }\n L_0x0079:\n r0 = move-exception;\n throw r0;\t Catch:{ RuntimeException -> 0x007b }\n L_0x007b:\n r0 = move-exception;\n throw r0;\n L_0x007d:\n r0 = move-exception;\n throw r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.e2.f(java.lang.String):void\");\n }", "public int[] a(int paramInt1, int paramInt2, int paramInt3, int paramInt4)\r\n/* 11: */ {\r\n/* 12:13 */ int i = paramInt1 - 1;\r\n/* 13:14 */ int j = paramInt2 - 1;\r\n/* 14:15 */ int k = paramInt3 + 2;\r\n/* 15:16 */ int m = paramInt4 + 2;\r\n/* 16:17 */ int[] arrayOfInt1 = this.a.a(i, j, k, m);\r\n/* 17: */ \r\n/* 18:19 */ int[] arrayOfInt2 = boy.a(paramInt3 * paramInt4);\r\n/* 19:20 */ for (int n = 0; n < paramInt4; n++) {\r\n/* 20:21 */ for (int i1 = 0; i1 < paramInt3; i1++)\r\n/* 21: */ {\r\n/* 22:22 */ int i2 = c(arrayOfInt1[(i1 + 0 + (n + 1) * k)]);\r\n/* 23:23 */ int i3 = c(arrayOfInt1[(i1 + 2 + (n + 1) * k)]);\r\n/* 24:24 */ int i4 = c(arrayOfInt1[(i1 + 1 + (n + 0) * k)]);\r\n/* 25:25 */ int i5 = c(arrayOfInt1[(i1 + 1 + (n + 2) * k)]);\r\n/* 26:26 */ int i6 = c(arrayOfInt1[(i1 + 1 + (n + 1) * k)]);\r\n/* 27:27 */ if ((i6 != i2) || (i6 != i4) || (i6 != i3) || (i6 != i5)) {\r\n/* 28:28 */ arrayOfInt2[(i1 + n * paramInt3)] = arm.w.az;\r\n/* 29: */ } else {\r\n/* 30:30 */ arrayOfInt2[(i1 + n * paramInt3)] = -1;\r\n/* 31: */ }\r\n/* 32: */ }\r\n/* 33: */ }\r\n/* 34:35 */ return arrayOfInt2;\r\n/* 35: */ }", "private static int lucas_cost(int n, double v) {\r\n\t\tint c, d, e, r;\r\n\r\n\t\td = n;\r\n\t\tr = (int) ((double) d / v + 0.5);\r\n\t\tif (r >= n)\r\n\t\t\treturn (ADD * n);\r\n\t\td = n - r;\r\n\t\te = 2 * r - n;\r\n\t\tc = DUP + ADD; /* initial duplicate and final addition */\r\n\t\twhile (d != e) {\r\n\t\t\tif (d < e) {\r\n\t\t\t\tr = d;\r\n\t\t\t\td = e;\r\n\t\t\t\te = r;\r\n\t\t\t}\r\n\t\t\tif (4 * d <= 5 * e && ((d + e) % 3) == 0) { /* condition 1 */\r\n\t\t\t\tr = (2 * d - e) / 3;\r\n\t\t\t\te = (2 * e - d) / 3;\r\n\t\t\t\td = r;\r\n\t\t\t\tc += 3 * ADD; /* 3 additions */\r\n\t\t\t} else if (4 * d <= 5 * e && (d - e) % 6 == 0) { /* condition 2 */\r\n\t\t\t\td = (d - e) / 2;\r\n\t\t\t\tc += ADD + DUP; /* one addition, one duplicate */\r\n\t\t\t} else if (d <= (4 * e)) { /* condition 3 */\r\n\t\t\t\td -= e;\r\n\t\t\t\tc += ADD; /* one addition */\r\n\t\t\t} else if ((d + e) % 2 == 0) { /* condition 4 */\r\n\t\t\t\td = (d - e) / 2;\r\n\t\t\t\tc += ADD + DUP; /* one addition, one duplicate */\r\n\t\t\t} else if (d % 2 == 0) { /* condition 5 */\r\n\t\t\t\td /= 2;\r\n\t\t\t\tc += ADD + DUP; /* one addition, one duplicate */\r\n\t\t\t} else if (d % 3 == 0) { /* condition 6 */\r\n\t\t\t\td = d / 3 - e;\r\n\t\t\t\tc += 3 * ADD + DUP; /* three additions, one duplicate */\r\n\t\t\t} else if ((d + e) % 3 == 0) { /* condition 7 */\r\n\t\t\t\td = (d - 2 * e) / 3;\r\n\t\t\t\tc += 3 * ADD + DUP; /* three additions, one duplicate */\r\n\t\t\t} else if ((d - e) % 3 == 0) { /* condition 8 */\r\n\t\t\t\td = (d - e) / 3;\r\n\t\t\t\tc += 3 * ADD + DUP; /* three additions, one duplicate */\r\n\t\t\t} else if (e % 2 == 0) { /* condition 9 */\r\n\t\t\t\te /= 2;\r\n\t\t\t\tc += ADD + DUP; /* one addition, one duplicate */\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn (c);\r\n\t}", "public static void main(String[] arrr){\n\t\tlong mod = 10000000011L;\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint[] arr = new int[n];\n\t\tfor (int i = 0; i < arr.length; i++) {\n\t\t\tarr[i]=sc.nextInt();\n\t\t}\n\t\tlong total=0;\n\t\tfor (int i = 0; i < arr.length; i++) {\n\t\t\ttotal = (total+((long)Math.pow((countBit(arr[i])),(i+1))%mod))%mod;\n\t\t}\n\t\tSystem.out.println(total);\n\t}", "public static void main(String args[] ) throws Exception {\n Scanner scanner = new Scanner(System.in);\n int n = scanner.nextInt();\n int[] seqArray = new int[n];\n for (int i = 0; i < n; i++) {\n seqArray[i] = scanner.nextInt();\n }\n // getSeqValue(seqArray); //this method is an accepted one on Hackerrank but time complexity is not order n; i.e. !O(n);\n getLinearOrderY(seqArray); // trying to get O(n) time complexity;\n }", "public int a(alq paramalq, int paramInt1, int paramInt2, fn paramfn)\r\n/* 120: */ {\r\n/* 121:137 */ int i = 0;\r\n/* 122: */ amj localamj;\r\n/* 123: */ int k;\r\n/* 124:138 */ for (int j = 0; j < this.a.length; j++)\r\n/* 125: */ {\r\n/* 126:139 */ localamj = this.a[j];\r\n/* 127:140 */ if (localamj != null) {\r\n/* 128:143 */ if ((paramalq == null) || (localamj.b() == paramalq)) {\r\n/* 129:146 */ if ((paramInt1 <= -1) || (localamj.i() == paramInt1)) {\r\n/* 130:149 */ if ((paramfn == null) || (cy.a(paramfn, localamj.o(), true)))\r\n/* 131: */ {\r\n/* 132:153 */ k = paramInt2 <= 0 ? localamj.b : Math.min(paramInt2 - i, localamj.b);\r\n/* 133:154 */ i += k;\r\n/* 134:155 */ if (paramInt2 != 0)\r\n/* 135: */ {\r\n/* 136:156 */ this.a[j].b -= k;\r\n/* 137:157 */ if (this.a[j].b == 0) {\r\n/* 138:158 */ this.a[j] = null;\r\n/* 139: */ }\r\n/* 140:160 */ if ((paramInt2 > 0) && (i >= paramInt2)) {\r\n/* 141:161 */ return i;\r\n/* 142: */ }\r\n/* 143: */ }\r\n/* 144: */ }\r\n/* 145: */ }\r\n/* 146: */ }\r\n/* 147: */ }\r\n/* 148: */ }\r\n/* 149:165 */ for (j = 0; j < this.b.length; j++)\r\n/* 150: */ {\r\n/* 151:166 */ localamj = this.b[j];\r\n/* 152:167 */ if (localamj != null) {\r\n/* 153:170 */ if ((paramalq == null) || (localamj.b() == paramalq)) {\r\n/* 154:173 */ if ((paramInt1 <= -1) || (localamj.i() == paramInt1)) {\r\n/* 155:176 */ if ((paramfn == null) || (cy.a(paramfn, localamj.o(), false)))\r\n/* 156: */ {\r\n/* 157:180 */ k = paramInt2 <= 0 ? localamj.b : Math.min(paramInt2 - i, localamj.b);\r\n/* 158:181 */ i += k;\r\n/* 159:182 */ if (paramInt2 != 0)\r\n/* 160: */ {\r\n/* 161:183 */ this.b[j].b -= k;\r\n/* 162:184 */ if (this.b[j].b == 0) {\r\n/* 163:185 */ this.b[j] = null;\r\n/* 164: */ }\r\n/* 165:187 */ if ((paramInt2 > 0) && (i >= paramInt2)) {\r\n/* 166:188 */ return i;\r\n/* 167: */ }\r\n/* 168: */ }\r\n/* 169: */ }\r\n/* 170: */ }\r\n/* 171: */ }\r\n/* 172: */ }\r\n/* 173: */ }\r\n/* 174:193 */ if (this.f != null)\r\n/* 175: */ {\r\n/* 176:194 */ if ((paramalq != null) && (this.f.b() != paramalq)) {\r\n/* 177:195 */ return i;\r\n/* 178: */ }\r\n/* 179:197 */ if ((paramInt1 > -1) && (this.f.i() != paramInt1)) {\r\n/* 180:198 */ return i;\r\n/* 181: */ }\r\n/* 182:200 */ if ((paramfn != null) && (!cy.a(paramfn, this.f.o(), false))) {\r\n/* 183:201 */ return i;\r\n/* 184: */ }\r\n/* 185:204 */ j = paramInt2 <= 0 ? this.f.b : Math.min(paramInt2 - i, this.f.b);\r\n/* 186:205 */ i += j;\r\n/* 187:206 */ if (paramInt2 != 0)\r\n/* 188: */ {\r\n/* 189:207 */ this.f.b -= j;\r\n/* 190:208 */ if (this.f.b == 0) {\r\n/* 191:209 */ this.f = null;\r\n/* 192: */ }\r\n/* 193:211 */ if ((paramInt2 > 0) && (i >= paramInt2)) {\r\n/* 194:212 */ return i;\r\n/* 195: */ }\r\n/* 196: */ }\r\n/* 197: */ }\r\n/* 198:217 */ return i;\r\n/* 199: */ }", "public static void main(String[] args) \n {\n int[] numOfPoints = { 1000, 10000, 7000, 10000, 13000 };\n for(int count = 0; count < numOfPoints.length; count++)\n {\n List<Point> pointsTobeUsed = new ArrayList<Point>();\n int current = numOfPoints[count];\n int inc = 0;\n \n //creating list of points to be used\n for(int x = 0; x <= current; x++)\n {\n \n if(x <= current/2)\n {\n pointsTobeUsed.add(new Point(x,x));\n \n }\n else\n {\n pointsTobeUsed.add(new Point(x, x - (1 + 2*(inc)) ) );\n inc++;\n }\n }\n \n //n logn implementation of Pareto optimal\n long timeStart = System.currentTimeMillis();\n \n // n logn quicksort\n pointsTobeUsed = quickSort(pointsTobeUsed, 0, pointsTobeUsed.size() -1 );\n \n \n \n ParetoOptimal(pointsTobeUsed);\n \n \n long timeEnd = System.currentTimeMillis();\n System.out.println(\"final:\" + \" exper: \" + (timeEnd - timeStart) + \" N: \" + current ); \n }\n }", "private static void eval7(){\n int z = 0;\n for(int i = 0; i < 46; i++){\n for(int j = i + 1; j < 47; j++){\n for(int k = j + 1; k < 48; k++){\n for(int l = k + 1; l < 49; l++){\n for(int m = l + 1; m < 50; m++){\n for(int n = m + 1; n < 51; n++){\n for(int o = n + 1; o < 52; o++){\n Evaluator.evaluate(i, j, k, l, m, n, o);\n }\n }\n }\n }\n }\n }\n }\n }", "public abstract int mo9754s();", "void h(List<List<Integer>> r, List<Integer> t, int n, int s){ \n for(int i = s; i*i <= n; i++){\n if(n % i != 0) continue; \n t.add(i);\n t.add(n / i);\n r.add(new ArrayList<>(t));\n t.remove(t.size() - 1);\n h(r, t, n/i, i);\n t.remove(t.size() - 1);\n }\n }", "private void method_259(int[] var1, int[] var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9, int var10, int var11, int var12, int var13, int var14, int var15) {\n boolean var28 = field_759;\n int var19 = var12 >> 16 & 255;\n int var20 = var12 >> 8 & 255;\n int var21 = var12 & 255;\n\n try {\n int var22 = var4;\n int var23 = -var8;\n if(var28 || var23 < 0) {\n do {\n int var24 = (var5 >> 16) * var11;\n int var25 = var13 >> 16;\n int var26 = var7;\n int var27;\n if(var25 < this.field_745) {\n var27 = this.field_745 - var25;\n var26 = var7 - var27;\n var25 = this.field_745;\n var4 += var9 * var27;\n }\n\n if(var25 + var26 >= this.field_746) {\n var27 = var25 + var26 - this.field_746;\n var26 -= var27;\n }\n\n var15 = 1 - var15;\n if(var15 != 0) {\n var27 = var25;\n if(var28 || var25 < var25 + var26) {\n do {\n var3 = var2[(var4 >> 16) + var24];\n if(var3 != 0) {\n label33: {\n int var16 = var3 >> 16 & 255;\n int var17 = var3 >> 8 & 255;\n int var18 = var3 & 255;\n if(var16 == var17 && var17 == var18) {\n var1[var27 + var6] = (var16 * var19 >> 8 << 16) + (var17 * var20 >> 8 << 8) + (var18 * var21 >> 8);\n if(!var28) {\n break label33;\n }\n }\n\n var1[var27 + var6] = var3;\n }\n }\n\n var4 += var9;\n ++var27;\n } while(var27 < var25 + var26);\n }\n }\n\n var5 += var10;\n var4 = var22;\n var6 += this.field_723;\n var13 += var14;\n ++var23;\n } while(var23 < 0);\n\n }\n } catch (Exception var29) {\n System.out.println(\"error in transparent sprite plot routine\"); // authentic System.out.println\n }\n }", "public boolean method_2511(ahb var1, int var2, int var3, int var4, int var5, int var6) {\r\n String[] var7 = class_752.method_4253();\r\n int var10000 = var1.field_1832;\r\n if(var7 != null) {\r\n label157: {\r\n if(!var1.field_1832) {\r\n byte var8 = this.method_2685(var1, var2, var3, var4, var6);\r\n var10000 = var8;\r\n if(var7 != null) {\r\n label147: {\r\n if(var8 != 0) {\r\n var10000 = var5;\r\n if(var7 == null) {\r\n break label147;\r\n }\r\n\r\n if(var5 == 1) {\r\n var1.method_2055(var2, var3, var4, var6 | 8, 2);\r\n return false;\r\n }\r\n }\r\n\r\n var10000 = var8;\r\n }\r\n }\r\n\r\n if(var7 == null) {\r\n break label157;\r\n }\r\n\r\n if(var10000 == 0) {\r\n var10000 = var5;\r\n if(var7 == null) {\r\n break label157;\r\n }\r\n\r\n if(var5 == 0) {\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n var10000 = var5;\r\n }\r\n }\r\n\r\n label162: {\r\n double var10001;\r\n double var10002;\r\n double var10003;\r\n boolean var20;\r\n if(var7 != null) {\r\n if(var10000 == 0) {\r\n var20 = this.method_2691(var1, var2, var3, var4, var6);\r\n if(var7 != null) {\r\n if(!var20) {\r\n return false;\r\n }\r\n\r\n var1.method_2055(var2, var3, var4, var6 | 8, 2);\r\n }\r\n\r\n var10001 = (double)var2 + 0.5D;\r\n var10002 = (double)var3 + 0.5D;\r\n var10003 = (double)var4 + 0.5D;\r\n String[] var17 = field_2148;\r\n var1.method_2084(var10001, var10002, var10003, \"tile.piston.out\", 0.5F, var1.field_1819.nextFloat() * 0.25F + 0.6F);\r\n if(var7 != null) {\r\n break label162;\r\n }\r\n }\r\n\r\n var10000 = var5;\r\n }\r\n\r\n if(var7 == null) {\r\n return (boolean)var10000;\r\n }\r\n\r\n if(var10000 == 1) {\r\n class_580 var18 = var1.method_31(var2 + class_1707.field_8947[var6], var3 + class_1707.field_8948[var6], var4 + class_1707.field_8949[var6]);\r\n var20 = var18 instanceof class_598;\r\n if(var7 != null) {\r\n if(var20) {\r\n ((class_598)var18).method_3196();\r\n }\r\n\r\n var1.method_2054(var2, var3, var4, class_1192.field_6063, var6, 3);\r\n var1.method_2131(var2, var3, var4, class_474.method_2823(this, var6, var6, false, true));\r\n var20 = this.field_2143;\r\n }\r\n\r\n if(var7 != null) {\r\n label125: {\r\n if(var20) {\r\n int var9;\r\n int var10;\r\n int var11;\r\n aji var12;\r\n int var13;\r\n byte var14;\r\n label119: {\r\n var9 = var2 + class_1707.field_8947[var6] * 2;\r\n var10 = var3 + class_1707.field_8948[var6] * 2;\r\n var11 = var4 + class_1707.field_8949[var6] * 2;\r\n var12 = var1.getBlock(var9, var10, var11);\r\n var13 = var1.method_33(var9, var10, var11);\r\n var14 = 0;\r\n if(var12 == class_1192.field_6063) {\r\n class_580 var15 = var1.method_31(var9, var10, var11);\r\n var10000 = var15 instanceof class_598;\r\n if(var7 == null) {\r\n break label119;\r\n }\r\n\r\n if(var10000 != 0) {\r\n class_598 var16 = (class_598)var15;\r\n var10000 = var16.method_3189();\r\n if(var7 == null) {\r\n break label119;\r\n }\r\n\r\n if(var10000 == var6) {\r\n var10000 = var16.method_3188();\r\n if(var7 == null) {\r\n break label119;\r\n }\r\n\r\n if(var10000 != 0) {\r\n var16.method_3196();\r\n var12 = var16.method_3187();\r\n var13 = var16.getBlock96();\r\n var14 = 1;\r\n }\r\n }\r\n }\r\n }\r\n\r\n var10000 = var14;\r\n }\r\n\r\n label165: {\r\n if(var7 != null) {\r\n label106: {\r\n if(var10000 == 0) {\r\n label166: {\r\n aji var21 = var12;\r\n if(var7 != null) {\r\n if(var12.method_2424() == awt.field_4170) {\r\n break label166;\r\n }\r\n\r\n var21 = var12;\r\n }\r\n\r\n var10000 = method_2689(var21, var1, var9, var10, var11, false);\r\n if(var7 == null) {\r\n break label106;\r\n }\r\n\r\n if(var10000 != 0) {\r\n label95: {\r\n var10000 = var12.method_2514();\r\n if(var7 != null) {\r\n if(var10000 != 0) {\r\n label91: {\r\n var21 = var12;\r\n class_420 var19 = class_1192.field_6060;\r\n if(var7 != null) {\r\n if(var12 == class_1192.field_6060) {\r\n break label91;\r\n }\r\n\r\n var21 = var12;\r\n var19 = class_1192.field_6056;\r\n }\r\n\r\n if(var21 != var19) {\r\n break label95;\r\n }\r\n }\r\n }\r\n\r\n var2 += class_1707.field_8947[var6];\r\n var3 += class_1707.field_8948[var6];\r\n var4 += class_1707.field_8949[var6];\r\n var1.method_2054(var2, var3, var4, class_1192.field_6063, var13, 3);\r\n var1.method_2131(var2, var3, var4, class_474.method_2823(var12, var13, var6, false, false));\r\n var1.method_2056(var9, var10, var11);\r\n }\r\n\r\n if(var7 != null) {\r\n break label165;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n var10000 = var14;\r\n }\r\n }\r\n\r\n if(var7 != null && var10000 == 0) {\r\n var1.method_2056(var2 + class_1707.field_8947[var6], var3 + class_1707.field_8948[var6], var4 + class_1707.field_8949[var6]);\r\n }\r\n }\r\n\r\n if(var7 != null) {\r\n break label125;\r\n }\r\n }\r\n\r\n var1.method_2056(var2 + class_1707.field_8947[var6], var3 + class_1707.field_8948[var6], var4 + class_1707.field_8949[var6]);\r\n }\r\n }\r\n\r\n var10001 = (double)var2 + 0.5D;\r\n var10002 = (double)var3 + 0.5D;\r\n var10003 = (double)var4 + 0.5D;\r\n String[] var10004 = field_2148;\r\n var1.method_2084(var10001, var10002, var10003, \"tile.piston.in\", 0.5F, var1.field_1819.nextFloat() * 0.15F + 0.6F);\r\n }\r\n }\r\n\r\n var10000 = 1;\r\n return (boolean)var10000;\r\n }", "@Override\r\n public long problem2() {\r\n ArrayList<String> arrList = new ArrayList<>();\r\n long start = System.currentTimeMillis(); \r\n for(int i = 0; i<1234567; i++){\r\n arrList.add(Integer.toString(i));\r\n }\r\n long end = System.currentTimeMillis(); \r\n return end - start; \r\n }", "public static void main(String[] args){\n\t\t\n\t\tfor (int i = 0; i<999999;i++) results.add(0);\t\n\n\t\tsetChain(1L);\n\t\tboolean switcher = true;\n\t\t//while switch=true ... and once chain length is added to, switch = false\n \t\tlong best = 0L;\n\t\tint index=0;\n\t\t\t\n\t\tfor (long j = 1L; j < 1000000L; j++) {\n\n\t\t\tsetCur((int)j);\n\n\t\t\tfindChain(j);//} catch(Exception e){System.out.println(\"stackOverFlow :D\");}\n\t\t\tif (getChain() > best) {best = getChain(); index=getCur();}\n\t\t\t//now store results for later use if we come across that number.\n\t\t\tresults.set(getCur()-1, (int)getChain());\t\n\t\t\tsetChain(1L); //reset\n\t\t\t/* \t\n\t\t\tswitcher=true;\n\t\t\tint i = j;\n\t\t\twhile (switcher) {\n\n\t\t\t\tif (i==1) {//results.add(chainLength); \n\t\t\t\t\tif (chainLength > best) { best=chainLength; index = j;}\n\t\t\t \tchainLength=1; switcher=false;}\n\t\n\t\t\t\telse { i=recurse(i); chainLength++; }\t\n\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t*/\n//\t\t }\n\t\t}\n\t\tSystem.out.println(index);\n\t}", "public abstract long mo9746k();", "public static void main(String[] args) {\n\r\n\t\tint n,i,j;\r\n\t\tScanner sc=new Scanner(System.in);\r\n\t\tn=sc.nextInt();\r\n\t\t//System.out.println(\"n is: \"+n);\r\n\t\tBigInteger [] arr=new BigInteger[n];\r\n\t\tBeast be=new Beast();\r\n\t\tfor( i=0;i<n;i++)\r\n\t\t{arr[i]=BigInteger.valueOf(0);\r\n\t\t\tint h=sc.nextInt();\r\n\t\t\tif(h<3)\r\n\t\t\t{\r\n\t\t\t\tarr[i]=new BigInteger(\"-1\");\r\n\t\t\t}\r\n\t\t\telse if((h%3)==0)\r\n\t\t\t{\r\n\t\t\t\tfor(j=0;j<h;j++)\r\n\t\t\t\t{\r\n\t\t\t\t\tlong x=5*(be.power(10,j));\r\n\t\t\t\t\tarr[i]=arr[i].add(BigInteger.valueOf(x));\r\n\t\t\t\t//\tSystem.out.println(arr[i]);\r\n\t\t\t\t}\r\n\t\t\t\t//System.out.println(arr[i]);\r\n\t\t\t}\r\n\t\t\telse if((h%5)==0)\r\n\t\t\t{\r\n\t\t\t\tfor(j=0;j<h;j++)\r\n\t\t\t\t{\r\n\t\t\t\t\tlong x=3*(be.power(10,j));\r\n\t\t\t\t\tarr[i]=arr[i].add(BigInteger.valueOf(x));\r\n\t\t\t\t//\tSystem.out.println(arr[i]);\r\n\t\t\t\t}\r\n\t\t\t\t//System.out.println(arr[i]);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tint o=3;\r\n\t\t\t\twhile(o<h)\r\n\t\t\t\t{\r\n\t\t\t\t\tif((h-o)%5==0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t//System.out.println(\"O is:\"+o+\"\\nH is:\"+h);\r\n\t\t\t\t\t\tfor(j=h;j>h-o;j--)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tlong x=5*(be.power(10,j-1));\r\n\t\t\t\t\t\t\tarr[i]=arr[i].add(BigInteger.valueOf(x));\r\n\t\t\t\t\t\t//\tSystem.out.println(\"array is:\"+arr[i]);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tfor(j=h-o-1;j>=0;j--)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tlong x=3*(be.power(10,j));\r\n\t\t\t\t\t\t\tarr[i]=arr[i].add(BigInteger.valueOf(x));\r\n\t\t\t\t\t\t//\tSystem.out.println(\"array is:\"+arr[i]);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\to=h;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\to=o+3;}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(i=0;i<n;i++)\r\n\t\t{\r\n\t\t\tSystem.out.println(arr[i]);\r\n\t\t}\r\n\t\t\r\n\t}", "public void s_()\r\n/* 117: */ {\r\n/* 118:128 */ this.P = this.s;\r\n/* 119:129 */ this.Q = this.t;\r\n/* 120:130 */ this.R = this.u;\r\n/* 121:131 */ super.s_();\r\n/* 122:133 */ if (this.b > 0) {\r\n/* 123:134 */ this.b -= 1;\r\n/* 124: */ }\r\n/* 125:137 */ if (this.a)\r\n/* 126: */ {\r\n/* 127:138 */ if (this.o.p(new dt(this.c, this.d, this.e)).c() == this.f)\r\n/* 128: */ {\r\n/* 129:139 */ this.i += 1;\r\n/* 130:140 */ if (this.i == 1200) {\r\n/* 131:141 */ J();\r\n/* 132: */ }\r\n/* 133:143 */ return;\r\n/* 134: */ }\r\n/* 135:145 */ this.a = false;\r\n/* 136: */ \r\n/* 137:147 */ this.v *= this.V.nextFloat() * 0.2F;\r\n/* 138:148 */ this.w *= this.V.nextFloat() * 0.2F;\r\n/* 139:149 */ this.x *= this.V.nextFloat() * 0.2F;\r\n/* 140:150 */ this.i = 0;\r\n/* 141:151 */ this.ap = 0;\r\n/* 142: */ }\r\n/* 143: */ else\r\n/* 144: */ {\r\n/* 145:154 */ this.ap += 1;\r\n/* 146: */ }\r\n/* 147:157 */ brw localbrw1 = new brw(this.s, this.t, this.u);\r\n/* 148:158 */ brw localbrw2 = new brw(this.s + this.v, this.t + this.w, this.u + this.x);\r\n/* 149:159 */ bru localbru1 = this.o.a(localbrw1, localbrw2);\r\n/* 150: */ \r\n/* 151:161 */ localbrw1 = new brw(this.s, this.t, this.u);\r\n/* 152:162 */ localbrw2 = new brw(this.s + this.v, this.t + this.w, this.u + this.x);\r\n/* 153:163 */ if (localbru1 != null) {\r\n/* 154:164 */ localbrw2 = new brw(localbru1.c.a, localbru1.c.b, localbru1.c.c);\r\n/* 155: */ }\r\n/* 156:167 */ if (!this.o.D)\r\n/* 157: */ {\r\n/* 158:168 */ Object localObject = null;\r\n/* 159:169 */ List localList = this.o.b(this, aQ().a(this.v, this.w, this.x).b(1.0D, 1.0D, 1.0D));\r\n/* 160:170 */ double d1 = 0.0D;\r\n/* 161:171 */ xm localxm = n();\r\n/* 162:172 */ for (int k = 0; k < localList.size(); k++)\r\n/* 163: */ {\r\n/* 164:173 */ wv localwv = (wv)localList.get(k);\r\n/* 165:174 */ if ((localwv.ad()) && ((localwv != localxm) || (this.ap >= 5)))\r\n/* 166: */ {\r\n/* 167:178 */ float f5 = 0.3F;\r\n/* 168:179 */ brt localbrt = localwv.aQ().b(f5, f5, f5);\r\n/* 169:180 */ bru localbru2 = localbrt.a(localbrw1, localbrw2);\r\n/* 170:181 */ if (localbru2 != null)\r\n/* 171: */ {\r\n/* 172:182 */ double d2 = localbrw1.f(localbru2.c);\r\n/* 173:183 */ if ((d2 < d1) || (d1 == 0.0D))\r\n/* 174: */ {\r\n/* 175:184 */ localObject = localwv;\r\n/* 176:185 */ d1 = d2;\r\n/* 177: */ }\r\n/* 178: */ }\r\n/* 179: */ }\r\n/* 180: */ }\r\n/* 181:190 */ if (localObject != null) {\r\n/* 182:191 */ localbru1 = new bru(localObject);\r\n/* 183: */ }\r\n/* 184: */ }\r\n/* 185:195 */ if (localbru1 != null) {\r\n/* 186:196 */ if ((localbru1.a == brv.b) && (this.o.p(localbru1.a()).c() == aty.aY)) {\r\n/* 187:197 */ aq();\r\n/* 188: */ } else {\r\n/* 189:199 */ a(localbru1);\r\n/* 190: */ }\r\n/* 191: */ }\r\n/* 192:202 */ this.s += this.v;\r\n/* 193:203 */ this.t += this.w;\r\n/* 194:204 */ this.u += this.x;\r\n/* 195: */ \r\n/* 196:206 */ float f1 = uv.a(this.v * this.v + this.x * this.x);\r\n/* 197:207 */ this.y = ((float)(Math.atan2(this.v, this.x) * 180.0D / 3.141592741012573D));\r\n/* 198:208 */ this.z = ((float)(Math.atan2(this.w, f1) * 180.0D / 3.141592741012573D));\r\n/* 199:210 */ while (this.z - this.B < -180.0F) {\r\n/* 200:211 */ this.B -= 360.0F;\r\n/* 201: */ }\r\n/* 202:213 */ while (this.z - this.B >= 180.0F) {\r\n/* 203:214 */ this.B += 360.0F;\r\n/* 204: */ }\r\n/* 205:217 */ while (this.y - this.A < -180.0F) {\r\n/* 206:218 */ this.A -= 360.0F;\r\n/* 207: */ }\r\n/* 208:220 */ while (this.y - this.A >= 180.0F) {\r\n/* 209:221 */ this.A += 360.0F;\r\n/* 210: */ }\r\n/* 211:224 */ this.z = (this.B + (this.z - this.B) * 0.2F);\r\n/* 212:225 */ this.y = (this.A + (this.y - this.A) * 0.2F);\r\n/* 213: */ \r\n/* 214:227 */ float f2 = 0.99F;\r\n/* 215:228 */ float f3 = m();\r\n/* 216:230 */ if (V())\r\n/* 217: */ {\r\n/* 218:231 */ for (int j = 0; j < 4; j++)\r\n/* 219: */ {\r\n/* 220:232 */ float f4 = 0.25F;\r\n/* 221:233 */ this.o.a(ew.e, this.s - this.v * f4, this.t - this.w * f4, this.u - this.x * f4, this.v, this.w, this.x, new int[0]);\r\n/* 222: */ }\r\n/* 223:235 */ f2 = 0.8F;\r\n/* 224: */ }\r\n/* 225:238 */ this.v *= f2;\r\n/* 226:239 */ this.w *= f2;\r\n/* 227:240 */ this.x *= f2;\r\n/* 228:241 */ this.w -= f3;\r\n/* 229: */ \r\n/* 230:243 */ b(this.s, this.t, this.u);\r\n/* 231: */ }", "public void method_4270() {}", "public static void main(String[] args){\n int MIN = Integer.parseInt(args[0]);\n MAX = Integer.parseInt(args[1]);\n cutoffs = new int[args.length - 2];\n cache = new ArrayList<IndexedArrayList<SuperSavvyTrieHelper2>>();\n for (int i = 2; i < args.length; i++){\n cutoffs[i - 2] = Integer.parseInt(args[i]);\n cache.add(new IndexedArrayList<SuperSavvyTrieHelper2>());\n }\n for (int i = 0; i < cutoffs.length / 2; i++){\n int temp = cutoffs[i];\n cutoffs[i] = cutoffs[cutoffs.length - 1 - i];\n cutoffs[cutoffs.length - 1 - i] = temp;\n }\n multiplicitiesUsed = new boolean[MAX + 1];\n basesUsed = new DoublyLinkedArray(MAX + 1);\n SuperSavvyTrieHelper2.setCorrespondance(basesUsed);\n /*\n long count1 = lowerRecursion(MAX, 0);\n long count2 = middleRecursion(MAX, 0);\n long count3 = upperRecursion(MAX, 0);\n long total = count1 + count2 + count3;\n System.out.printf(\"%d + %d + %d = %d\\n\", count1, count2, count3, total);\n */\n hitCounts = new long[cutoffs.length];\n missCounts = new long[cutoffs.length];\n statCollector = new StatCollector(cutoffs);\n\n long startTime = System.nanoTime();\n long[] values = new long[MAX - MIN + 1];\n for (int i = MIN; i <= MAX; i++) {\n values[i - MIN] = upperRecursionWrapper(i);\n }\n //long[] testValues = new long[] {1752443,1911046, 2067456,2249444,2429337, 2647532,2852449,3101167,3350292,3632299,3916575};\n for (int i = 0; i < values.length; i++){\n //if (testValues[i] != values[i]){\n System.out.printf(\"%d: %d\\n\", i + MIN, values[i]);\n //}\n }\n long endTime = System.nanoTime();\n System.out.printf(\"%f,\", (double)(endTime - startTime) / 1000000000.0);\n long totalMissCounts = 0;\n long totalMissWeight1 = 0;\n long totalMissWeight2 = 0;\n long totalMissWeight3 = 0;\n /*\n for (int i = 0; i < cutoffs.length; i++){\n long totalCounts = hitCounts[i] + missCounts[i];\n totalMissCounts += missCounts[i];\n totalMissWeight1 += missCounts[i] * cutoffs[i];\n totalMissWeight2 += (hitCounts[i] / missCounts[i]) * cutoffs[i];\n totalMissWeight3 += (hitCounts[i] - missCounts[i]) * cutoffs[i] * cutoffs[i];\n System.out.printf(\"\\tCache %d: %d/%d/%d (%.5f%%)\", cutoffs[i], hitCounts[i], missCounts[i], totalCounts, (double) hitCounts[i] / totalCounts);\n }\n System.out.printf(\"\\t\\tMissCounts: %d, weighted: %d, ratio: %d, diff^2: %d\\n\", totalMissCounts, totalMissWeight1, totalMissWeight2, totalMissWeight3);\n */\n statCollector.printAll();\n }", "public static String solution() {\r\n\t\treturn \"73162890\";\r\n\t}", "public final void a() {\n /*\n r25 = this;\n r1 = r25\n int r0 = r25.getAndIncrement()\n if (r0 == 0) goto L_0x0009\n return\n L_0x0009:\n java.util.concurrent.atomic.AtomicReference<io.reactivex.internal.operators.flowable.cq$b<T>[]> r2 = r1.e\n java.lang.Object r0 = r2.get()\n io.reactivex.internal.operators.flowable.cq$b[] r0 = (io.reactivex.internal.operators.flowable.cq.b[]) r0\n r3 = 1\n r4 = r0\n r5 = 1\n L_0x0014:\n java.lang.Object r0 = r1.h\n io.reactivex.internal.b.j<T> r6 = r1.j\n if (r6 == 0) goto L_0x0023\n boolean r8 = r6.isEmpty()\n if (r8 == 0) goto L_0x0021\n goto L_0x0023\n L_0x0021:\n r8 = 0\n goto L_0x0024\n L_0x0023:\n r8 = 1\n L_0x0024:\n boolean r0 = r1.a(r0, r8)\n if (r0 == 0) goto L_0x002b\n return\n L_0x002b:\n if (r8 != 0) goto L_0x0156\n int r0 = r4.length\n int r9 = r4.length\n r12 = 0\n r13 = 0\n r14 = 9223372036854775807(0x7fffffffffffffff, double:NaN)\n L_0x0036:\n r16 = -9223372036854775808\n if (r12 >= r9) goto L_0x0053\n r7 = r4[r12]\n long r18 = r7.get()\n int r20 = (r18 > r16 ? 1 : (r18 == r16 ? 0 : -1))\n if (r20 == 0) goto L_0x004e\n long r10 = r7.c\n long r10 = r18 - r10\n long r10 = java.lang.Math.min(r14, r10)\n r14 = r10\n goto L_0x0050\n L_0x004e:\n int r13 = r13 + 1\n L_0x0050:\n int r12 = r12 + 1\n goto L_0x0036\n L_0x0053:\n r9 = 1\n if (r0 != r13) goto L_0x0093\n java.lang.Object r0 = r1.h\n java.lang.Object r7 = r6.poll() // Catch:{ all -> 0x005e }\n goto L_0x0075\n L_0x005e:\n r0 = move-exception\n r6 = r0\n io.reactivex.c.b.throwIfFatal(r6)\n java.util.concurrent.atomic.AtomicReference<org.b.d> r0 = r1.g\n java.lang.Object r0 = r0.get()\n org.b.d r0 = (org.b.d) r0\n r0.cancel()\n java.lang.Object r0 = io.reactivex.internal.util.NotificationLite.error(r6)\n r1.h = r0\n r7 = 0\n L_0x0075:\n if (r7 != 0) goto L_0x0079\n r6 = 1\n goto L_0x007a\n L_0x0079:\n r6 = 0\n L_0x007a:\n boolean r0 = r1.a(r0, r6)\n if (r0 == 0) goto L_0x0081\n return\n L_0x0081:\n int r0 = r1.i\n if (r0 == r3) goto L_0x0090\n java.util.concurrent.atomic.AtomicReference<org.b.d> r0 = r1.g\n java.lang.Object r0 = r0.get()\n org.b.d r0 = (org.b.d) r0\n r0.request(r9)\n L_0x0090:\n r6 = 1\n goto L_0x0165\n L_0x0093:\n r0 = r8\n r8 = 0\n L_0x0095:\n long r11 = (long) r8\n int r13 = (r11 > r14 ? 1 : (r11 == r14 ? 0 : -1))\n if (r13 >= 0) goto L_0x0139\n java.lang.Object r0 = r1.h\n java.lang.Object r13 = r6.poll() // Catch:{ all -> 0x00a1 }\n goto L_0x00b8\n L_0x00a1:\n r0 = move-exception\n r13 = r0\n io.reactivex.c.b.throwIfFatal(r13)\n java.util.concurrent.atomic.AtomicReference<org.b.d> r0 = r1.g\n java.lang.Object r0 = r0.get()\n org.b.d r0 = (org.b.d) r0\n r0.cancel()\n java.lang.Object r0 = io.reactivex.internal.util.NotificationLite.error(r13)\n r1.h = r0\n r13 = 0\n L_0x00b8:\n if (r13 != 0) goto L_0x00bc\n r7 = 1\n goto L_0x00bd\n L_0x00bc:\n r7 = 0\n L_0x00bd:\n boolean r0 = r1.a(r0, r7)\n if (r0 == 0) goto L_0x00c4\n return\n L_0x00c4:\n if (r7 != 0) goto L_0x0135\n java.lang.Object r0 = io.reactivex.internal.util.NotificationLite.getValue(r13)\n int r11 = r4.length\n r12 = 0\n r13 = 0\n L_0x00cd:\n if (r12 >= r11) goto L_0x0103\n r3 = r4[r12]\n long r22 = r3.get()\n int r24 = (r22 > r16 ? 1 : (r22 == r16 ? 0 : -1))\n if (r24 == 0) goto L_0x00f1\n r20 = 9223372036854775807(0x7fffffffffffffff, double:NaN)\n int r24 = (r22 > r20 ? 1 : (r22 == r20 ? 0 : -1))\n r22 = r6\n r23 = r7\n if (r24 == 0) goto L_0x00eb\n long r6 = r3.c\n long r6 = r6 + r9\n r3.c = r6\n L_0x00eb:\n org.b.c<? super T> r3 = r3.f8109a\n r3.onNext(r0)\n goto L_0x00fb\n L_0x00f1:\n r22 = r6\n r23 = r7\n r20 = 9223372036854775807(0x7fffffffffffffff, double:NaN)\n r13 = 1\n L_0x00fb:\n int r12 = r12 + 1\n r6 = r22\n r7 = r23\n r3 = 1\n goto L_0x00cd\n L_0x0103:\n r22 = r6\n r23 = r7\n r20 = 9223372036854775807(0x7fffffffffffffff, double:NaN)\n int r8 = r8 + 1\n java.lang.Object r0 = r2.get()\n io.reactivex.internal.operators.flowable.cq$b[] r0 = (io.reactivex.internal.operators.flowable.cq.b[]) r0\n if (r13 != 0) goto L_0x0120\n if (r0 == r4) goto L_0x0119\n goto L_0x0120\n L_0x0119:\n r6 = r22\n r0 = r23\n r3 = 1\n goto L_0x0095\n L_0x0120:\n if (r8 == 0) goto L_0x0133\n int r3 = r1.i\n r4 = 1\n if (r3 == r4) goto L_0x0133\n java.util.concurrent.atomic.AtomicReference<org.b.d> r3 = r1.g\n java.lang.Object r3 = r3.get()\n org.b.d r3 = (org.b.d) r3\n long r6 = (long) r8\n r3.request(r6)\n L_0x0133:\n r4 = r0\n goto L_0x0165\n L_0x0135:\n r23 = r7\n r0 = r23\n L_0x0139:\n if (r8 == 0) goto L_0x014c\n int r3 = r1.i\n r6 = 1\n if (r3 == r6) goto L_0x014d\n java.util.concurrent.atomic.AtomicReference<org.b.d> r3 = r1.g\n java.lang.Object r3 = r3.get()\n org.b.d r3 = (org.b.d) r3\n r3.request(r11)\n goto L_0x014d\n L_0x014c:\n r6 = 1\n L_0x014d:\n r7 = 0\n int r3 = (r14 > r7 ? 1 : (r14 == r7 ? 0 : -1))\n if (r3 == 0) goto L_0x0157\n if (r0 == 0) goto L_0x0165\n goto L_0x0157\n L_0x0156:\n r6 = 1\n L_0x0157:\n int r0 = -r5\n int r5 = r1.addAndGet(r0)\n if (r5 == 0) goto L_0x0168\n java.lang.Object r0 = r2.get()\n r4 = r0\n io.reactivex.internal.operators.flowable.cq$b[] r4 = (io.reactivex.internal.operators.flowable.cq.b[]) r4\n L_0x0165:\n r3 = 1\n goto L_0x0014\n L_0x0168:\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: io.reactivex.internal.operators.flowable.cq.c.a():void\");\n }", "public abstract long mo20901UQ();", "public static void main(String args[] ) throws Exception {\n String l[] = br.readLine().split(\" \");\n long N = Long.parseLong(l[0]);\n long S = Long.parseLong(l[1]);\n long E = Long.parseLong(l[2]);\n TreeMap<Long,Long> t1 = new TreeMap<Long,Long>();\n TreeMap<Long,Long> t2 = new TreeMap<Long,Long>();\n for(int i=0;i<N;i++) {\n String s[] = br.readLine().split(\" \");\n long x = Long.parseLong(s[0]);\n long p = Long.parseLong(s[1]);\n t1.put((x-p),(x+p));\n }\n ArrayList<Long> l1 = new ArrayList<Long>(t1.keySet());\n ArrayList<Long> l2 = new ArrayList<Long>(t1.values());\n long c = l1.get(0);\n long d = l2.get(0);\n for(int i=1;i<t1.size();i++)\n {\n if(l1.get(i)<=d)\n d = Math.max(d,l2.get(i));\n else\n {\n \n t2.put(c,d);\n c = l1.get(i);\n d = l2.get(i);\n }\n \n }\n t2.put(c,d);\n int i;\n long ans = 0;\n l1=new ArrayList<Long>(t2.keySet());\n l2=new ArrayList<Long>(t2.values());\n \n \n for(i=0;i<l1.size();i++)\n {\n if(S>=E)\n {\n S=E;\n break;\n }\n if(l1.get(i)<=S && S<=l2.get(i))\n S = l2.get(i);\n \n else if(S<=l1.get(i) && E>=l2.get(i))\n {\n ans+=l1.get(i)-S;\n S = l2.get(i);\n \n }\n else if(S<=l1.get(i) && E>=l1.get(i) && E<=l2.get(i))\n {\n ans+=l1.get(i)-S;\n S = E;\n }\n else if(S<=l1.get(i) && E<=l1.get(i))\n {\n ans+=E-S;\n S = E;\n }\n }\n if(S<E)\n ans+=E-S;\n pw.println(ans);\n \n pw.close();\n }", "static int[] m11868m(Object[] r10, int r11, int r12, int r13) {\n /*\n r0 = 1\n if (r11 != r0) goto L_0x000e\n r11 = r10[r13]\n r12 = r13 ^ 1\n r10 = r10[r12]\n p067c.p068a.p134b.p136b.CollectPreconditions.m11785a(r11, r10)\n r10 = 0\n return r10\n L_0x000e:\n int r1 = r12 + -1\n int[] r12 = new int[r12]\n r2 = -1\n java.util.Arrays.fill(r12, r2)\n r3 = 0\n L_0x0017:\n if (r3 >= r11) goto L_0x0077\n int r4 = r3 * 2\n int r5 = r4 + r13\n r6 = r10[r5]\n r7 = r13 ^ 1\n int r4 = r4 + r7\n r4 = r10[r4]\n p067c.p068a.p134b.p136b.CollectPreconditions.m11785a(r6, r4)\n int r7 = r6.hashCode()\n int r7 = p067c.p068a.p134b.p136b.Hashing.m11897b(r7)\n L_0x002f:\n r7 = r7 & r1\n r8 = r12[r7]\n if (r8 != r2) goto L_0x0039\n r12[r7] = r5\n int r3 = r3 + 1\n goto L_0x0017\n L_0x0039:\n r9 = r10[r8]\n boolean r9 = r9.equals(r6)\n if (r9 != 0) goto L_0x0044\n int r7 = r7 + 1\n goto L_0x002f\n L_0x0044:\n java.lang.IllegalArgumentException r11 = new java.lang.IllegalArgumentException\n java.lang.StringBuilder r12 = new java.lang.StringBuilder\n r12.<init>()\n java.lang.String r13 = \"Multiple entries with same key: \"\n r12.append(r13)\n r12.append(r6)\n java.lang.String r13 = \"=\"\n r12.append(r13)\n r12.append(r4)\n java.lang.String r1 = \" and \"\n r12.append(r1)\n r1 = r10[r8]\n r12.append(r1)\n r12.append(r13)\n r13 = r8 ^ 1\n r10 = r10[r13]\n r12.append(r10)\n java.lang.String r10 = r12.toString()\n r11.<init>(r10)\n throw r11\n L_0x0077:\n return r12\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p067c.p068a.p134b.p136b.RegularImmutableMap.m11868m(java.lang.Object[], int, int, int):int[]\");\n }", "public amj h()\r\n/* 17: */ {\r\n/* 18: 41 */ if ((this.c < 9) && (this.c >= 0)) {\r\n/* 19: 42 */ return this.a[this.c];\r\n/* 20: */ }\r\n/* 21: 44 */ return null;\r\n/* 22: */ }", "public abstract Integer gethourNeed();", "public void k()\r\n/* 238: */ {\r\n/* 239:258 */ for (int i = 0; i < this.a.length; i++) {\r\n/* 240:259 */ if (this.a[i] != null) {\r\n/* 241:260 */ this.a[i].a(this.d.o, this.d, i, this.c == i);\r\n/* 242: */ }\r\n/* 243: */ }\r\n/* 244: */ }", "public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new FileReader(\"superbull.in\"));\n PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter(\"superbull.out\")));\n //Only in a tree is the winner condition(as stated in problem) satisfied\n int N = Integer.parseInt(br.readLine());\n \n long ret = 0;\n \n int[] nums = new int[N];\n for(int i = 0; i<N; i++) nums[i] = Integer.parseInt(br.readLine());\n int[] prims = new int[N]; //for dense graphs: N edges each. Loop thru edges anyways, so selection sort remove log factor\n Arrays.fill(prims, Integer.MIN_VALUE);\n prims[0] = -1;\n int curr = 0;\n \n for(int i = 0; i<N-1; i++){\n int max = Integer.MIN_VALUE;\n int next = -1;\n for(int j = 0; j<N; j++){\n if(prims[j] == -1) continue;\n \n int xor = nums[curr]^nums[j];\n prims[j] = Math.max(prims[j], xor);\n \n if(prims[j] > max){\n next = j;\n max = prims[j];\n }\n }\n ret += max;\n prims[next] = -1;\n curr = next;\n }\n pw.println(ret);\n pw.close();\n br.close();\n }", "static void pregenFact() \n\t{ \n\t\tfact[0] = fact[1] = 1; \n\t\tfor (int i = 1; i <= 1000000; ++i) \n\t\t{ \n\t\t\tfact[i] = (int) ((long) fact[i - 1] * i % mod); \n\t\t} \n\t}", "void mo24142a(long j);", "public int optimizedCom() {\n\tint b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0;\n\tint a = 1;\n\n\tb = 65;\n\tc = b;\n\n\tif (a != 0) {\n\t b = (b * 100) + 100000;\n\t c = b + 17000;\n\t}\n\n\t// at this point:\n\t// a == 1\n\t// b == 106500\n\t// c == 123500\n\n\t// outer loop terminates when b == c\n\t// c never changes, serves as termination condition\n\t// b only gets +17 added for every execution of the outer loop\n\n\tdo {\n\t f = 1;\n\t d = 2;\n\t do { // jnz g -13\n\t\te = 2;\n\n\t\tdo { // jnz g - 8\n\t\t g = (d * e) - b;\n\n\t\t if (g == 0)\n\t\t\tf = 0;\n\n\t\t e++;\n\n\t\t g = e - b;\n\t\t} while (g != 0);\n\n\t\td++;\n\n\t\tg = d - b;\n\t } while (g != 0);\n\n\t // increments h if register b contains a non-prime number (checked by printing all values)\n\t if (f == 0) {\n\t\th++;\n\t\tSystem.out.println(\"b: \" + b + \" c: \" + c + \" d: \" + d + \" e: \" + e + \" f: \" + f + \" g: \" + g);\n\t }\n\n\t // c does not change, b only gets increased by 17\n\t // if b == c, the method returns h which is the number of non-prime numbers encountered in the loop\n\t g = b - c;\n\n\t if (g == 0)\n\t\treturn h;\n\n\t b += 17;\n\n\t} while (true);\n }", "public void m21278OooO00o(int i, int i2) {\n int i3 = i >>> 5;\n int i4 = i & 31;\n int i5 = 32 - i4;\n int i6 = i - i2;\n int i7 = i6 >>> 5;\n int i8 = 32 - (i6 & 31);\n int i9 = ((i << 1) - 2) >>> 5;\n while (i9 > i3) {\n int[] iArr = this.f22759OooO00o;\n long j = 4294967295L & ((long) iArr[i9]);\n int i10 = i9 - i3;\n int i11 = i10 - 1;\n iArr[i11] = iArr[i11] ^ ((int) (j << i5));\n iArr[i10] = (int) (((long) iArr[i10]) ^ (j >>> (32 - i5)));\n int i12 = i9 - i7;\n int i13 = i12 - 1;\n iArr[i13] = iArr[i13] ^ ((int) (j << i8));\n iArr[i12] = (int) ((j >>> (32 - i8)) ^ ((long) iArr[i12]));\n iArr[i9] = 0;\n i9--;\n i3 = i3;\n }\n int[] iArr2 = this.f22759OooO00o;\n long j2 = (4294967295 << i4) & ((long) iArr2[i3]) & 4294967295L;\n iArr2[0] = (int) (((long) iArr2[0]) ^ (j2 >>> (32 - i5)));\n int i14 = i3 - i7;\n int i15 = i14 - 1;\n if (i15 >= 0) {\n iArr2[i15] = iArr2[i15] ^ ((int) (j2 << i8));\n }\n int[] iArr3 = this.f22759OooO00o;\n iArr3[i14] = (int) ((j2 >>> (32 - i8)) ^ ((long) iArr3[i14]));\n iArr3[i3] = iArr3[i3] & OooO0OO[i4];\n this.f22760OooO0O0 = ((i - 1) >>> 5) + 1;\n this.f22758OooO00o = i;\n }", "public void mo21792Q() {\n }", "public int n_()\r\n/* 429: */ {\r\n/* 430:442 */ return this.a.length + 4;\r\n/* 431: */ }", "public static void main(String[] args) {\n\t\tScanner s=new Scanner(System.in);\n\t\tlong min=s.nextLong(),max=s.nextLong(),sum=0;\n\t\tboolean[] arr=new boolean[(int)(max-min+1)];\n\t\tfor(int i=2;;i++) {\n\t\t\tlong p=(long) Math.pow(i, 2),add=p;\n\t\t\tif((p-min)>=arr.length) break;\n\t\t\t//\t\t\tif((p-min)<0) continue;\n\t\t\t//\t\t\tif(p==1) continue;\n\t\t\twhile((p-min)<arr.length) {\n\t\t\t\t//\t\t\t\tSystem.out.println(p);\n\t\t\t\tif(!((p-min)<0)) arr[(int)(p-min)]=true;\n\t\t\t\tp+=add;\n\t\t\t}\n\t\t}\n\t\t//\t\tSystem.out.println(Arrays.toString(arr));\n\t\tfor(int i=0;i<arr.length;i++) if(!arr[i]) sum++;\n\t\tSystem.out.println(sum);\n\t}", "public static int Main()\n\t {\n\t\t int x;\n\t\t int j;\n\t\t int[] a = new int[16];\n\t\t x = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\t int i = 1;\n\t\t int k = 0;\n\t\t while (x != -1)\n\t\t {\n\t\t\ta[i] = x;\n\t\t\ti++;\n\t\t if (x != 0)\n\t\t {\n\t\t\t k = i;\n\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\tint sum = 0;\n\t\t\t for (i = 1;i <= k;i++)\n\t\t\t {\n\t\t\t\t for (j = 1;j <= k ;j++)\n\t\t\t\t {\n\t\t\t\t if (a[i] == 2 * a[j])\n\t\t\t\t {\n\t\t\t\t\t sum++;\n\t\t\t\t }\n\t\t\t\t }\n\t\t\t }\n\t\t\t\t\tSystem.out.print((sum - 1));\n\t\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t\t\ti = 1;\n\t\t\t }\n\t\t\tx = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\t }\n\t\t\treturn 0;\n\t }", "public static int f5(int N) { \n int x = 0;\n // log(n)\n for(int i = N; i > 0; i = i/2)\n // O(n) + O(n/2) + O(n/4)\n x += f1(i);\n \n return x; \n \n }", "static int countWaysUtil(int n, int m) \n\t { \n\t int res[] = new int[n]; \n\t res[0] = 1; res[1] = 1; \n\t for (int i=2; i<n; i++) \n\t { \n\t res[i] = 0; \n\t for (int j=1; j<=m && j<=i; j++) \n\t res[i] += res[i-j]; \n\t } \n\t return res[n-1]; \n\t }", "public static void main(String[] args) {\n\n long a_i3 = 3;\n long a_i2 = 4;\n long a_i1 = 10;\n\n int MOD = 1000_000_000 + 7;\n\n for (int i = 4; i < 30; i++) {\n long a_i = (a_i1 + 2 * a_i2 + 4 * a_i3) % MOD;\n System.out.println(\"N: \" + i + \" --> \" + a_i);\n\n a_i3 = a_i2;\n a_i2 = a_i1;\n a_i1 = a_i;\n }\n\n old1();\n }", "public static int Main()\n\t{\n\t\tint s = 0;\n\t\tint t = 0;\n\t\tint[] a = new int[100000];\n\t\tint n;\n\t\tint i;\n\t\tint j;\n\t\tint k;\n\n\t\tn = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\n\t\tfor (i = 1;i <= n;i++)\n\t\t{\n\t\t\ta[i - 1] = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\t}\n\n\t\tk = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\n\t\tfor (j = 1;j <= n;j++) //?for??????????k??????\n\t\t{\n\t\t\tif (a[j - 1] != k)\n\t\t\t{\n\t\t\t\tt++; //?t?????k???????????????????????\n\t\t\t}\n\t\t}\n\t\tfor (j = 1;j <= n;j++)\n\t\t{\n\t\t\tif (a[j - 1] != k) //???k?????\n\t\t\t{\n\t\t\t\ts++;\n\t\t\t\tif (s <= t - 1) //?????????k???s?t????????????\n\t\t\t\t{\n\t\t\t\t\tSystem.out.print(a[j - 1]);\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\telse //??????????????\n\t\t\t\t{\n\t\t\t\tSystem.out.print(a[j - 1]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}", "public static int calculate()\n {\n final List<Integer> oneToNine = IntStream.iterate(1, n -> n + 1)\n .limit(9)\n .boxed()\n .collect(toList());\n final List<List<Integer>> permutations = HeapPermutations.of(oneToNine);\n\n // System.out.println(permutations.size());\n //2- for each permutation\n // a. find all breaking 2 points to break\n // b. check first two sections' third is equal to the last section\n // c. if yes, add combintion to result, otherwise skip\n\n return permutations.stream()\n .flatMap(toTriples()) //find all combinations xx X yy = zz\n .filter(isPandigital()) // allow pandigital tripes through\n .map(Triple::getThird) // get the product\n .distinct() // get distinct products only given the problem statement does not allow repetition (see hint)\n .mapToInt(i -> i) // convert to primitive\n .sum(); // and finally get the sum\n }", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tint arr[] = new int[n];\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tarr[i] = sc.nextInt();\n\t\t}\n\t\tint sum = sc.nextInt();\n\t\tHashMap<Integer,Integer> map = new HashMap<>();\n \t\tArrays.sort(arr);\n\t\tfor(int i=0;i<n;i++) {\n\t\t\tint temp = arr[i];\n\t\t\tint reqSum = sum-temp;\n\t\t\tarr[i]=0;\n\t\t\tint l=0;\n\t\t\tint r = n-1;\n\t\t\twhile(l<r) {\n\t\t\t\t//System.out.println(\"l \" + l + \" r \" + r + \" i = \"+ i);\n\t\t\t\tif(arr[l] + arr[r]==reqSum && arr[l]!=0 && arr[r]!=0 ) {\n\t\t\t\t\tint arr2[] = new int[3];\n\t\t\t\t\tarr2[0] = temp;\n\t\t\t\t\tarr2[1] = arr[l];\n\t\t\t\t\tarr2[2] = arr[r];\n\t\t\t\t\tif(map.containsKey(arr2[0]) || map.containsKey(arr2[1]) || map.containsKey(arr2[2])) {\n\t\t\t\t\t\t\n\t\t\t\t\t}else {\n\t\t\t\t\t\tArrays.sort(arr2);\n\t\t\t\t\t\tSystem.out.println(arr2[0] + \" \" + arr2[1] + \" \" + arr2[2]);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tl++;\n\t\t\t\t}else if(arr[l] + arr[r] < reqSum) {\n\t\t\t\t\tl++;\n\t\t\t\t\t\n\t\t\t\t}else {\n\t\t\t\t\tr--;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tarr[i] = temp;\t\n\t\t\tmap.put(arr[i], 1);\n\t\t}\n\t}", "public void n()\r\n/* 515: */ {\r\n/* 516:523 */ for (int i = 0; i < this.a.length; i++) {\r\n/* 517:524 */ if (this.a[i] != null)\r\n/* 518: */ {\r\n/* 519:525 */ this.d.a(this.a[i], true, false);\r\n/* 520:526 */ this.a[i] = null;\r\n/* 521: */ }\r\n/* 522: */ }\r\n/* 523:529 */ for (i = 0; i < this.b.length; i++) {\r\n/* 524:530 */ if (this.b[i] != null)\r\n/* 525: */ {\r\n/* 526:531 */ this.d.a(this.b[i], true, false);\r\n/* 527:532 */ this.b[i] = null;\r\n/* 528: */ }\r\n/* 529: */ }\r\n/* 530: */ }", "public static long journeyToMoon(int n, List<List<Integer>> astronaut) {\n // Write your code here\n Map<Integer, Node<Integer>> countryMap = new HashMap<>();\n for(List<Integer> pairs: astronaut) {\n Node<Integer> node1 = countryMap.computeIfAbsent(pairs.get(0), Node::new);\n Node<Integer> node2 = countryMap.computeIfAbsent(pairs.get(1), Node::new);\n node1.connected.add(node2);\n node2.connected.add(node1);\n }\n\n List<Integer> countryCluster = new ArrayList<>();\n for(Node<Integer> node: countryMap.values()) {\n if(node.connected.size() == 0) {\n countryCluster.add(1);\n } else if(!node.visited){\n countryCluster.add(getNodeCount3(node));\n }\n }\n List<Integer> countryNodes = countryMap.values().stream().map(nn -> nn.value).collect(Collectors.toList());\n List<Integer> missingNodes = new ArrayList<>();\n for(int i=0; i < n; i++) {\n if(!countryNodes.contains(i))\n missingNodes.add(i);\n }\n\n for(int i=0; i < missingNodes.size(); i++) {\n countryCluster.add(1);\n }\n\n long ans = 0;\n //For one country we cannot pair with any other astronauts\n if(countryCluster.size() >= 2) {\n ans = (long) countryCluster.get(0) * countryCluster.get(1);\n if(countryCluster.size() > 2) {\n int sum = countryCluster.get(0) + countryCluster.get(1);\n for(int i=2; i < countryCluster.size(); i++) {\n ans += (long) sum * countryCluster.get(i);\n sum += countryCluster.get(i);\n }\n }\n }\n\n /*\n permutation of two set with size A and B = AxB\n permutation of three set with size A,B,C = AxB + AxC + BxC = AxB + (A+B)xC\n permutation of four set with size A,B,C,D = AxB + AxC + AxD + BxC + BxD + CxD = AxB + (A+B)xC + (A+B+C)xD\n */\n /*\n if(keys.length == 1) {\n ans = keys[0].size();\n } else {\n ans = keys[0].size() * keys[1].size();\n if(keys.length > 2) {\n int sum = keys[0].size() + keys[1].size();\n for (int i = 2; i < keys.length; i++) {\n ans += sum * keys[i].size();\n sum += keys[i].size();\n }\n }\n }\n */\n return ans;\n }", "public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\t int a = 0;\n\t\t a=scan.nextInt();\n\t\t int [] arr=new int[a+1];\n\t\t arr[1]=arr[2]=1;\n\t\t for(int i=3;i<arr.length;i++){\n\t\t arr[i]=(arr[i-1]+arr[i-2])%10007;//对每一个斐波那契数列进行取余数\n\t\t }\n\t\t System.out.println(arr[a]);\n\t\t }", "public long a() {\n long l2;\n long l3;\n if (this.c()) {\n a.i.a a2 = this.l;\n a.i.a a4 = a.i.a.b;\n boolean bl = false;\n if (a2 == a4) {\n bl = true;\n }\n long l4 = bl ? this.m * (long)this.k : (long)Math.scalb((float)this.m, (int)(this.k - 1));\n l2 = this.n;\n l3 = Math.min((long)18000000L, (long)l4);\n do {\n return l3 + l2;\n break;\n } while (true);\n }\n boolean bl = this.d();\n long l5 = 0L;\n if (bl) {\n long l6 = System.currentTimeMillis();\n long l7 = this.n;\n if (l7 == l5) {\n l7 = l6 + this.g;\n }\n long l8 = this.i LCMP this.h;\n boolean bl2 = false;\n if (l8 != false) {\n bl2 = true;\n }\n if (bl2) {\n if (this.n != l5) return l5 + (l7 + this.h);\n l5 = -1L * this.i;\n return l5 + (l7 + this.h);\n }\n if (this.n == l5) return l7 + l5;\n l5 = this.h;\n return l7 + l5;\n }\n l3 = this.n;\n if (l3 == l5) {\n l3 = System.currentTimeMillis();\n }\n l2 = this.g;\n return l3 + l2;\n }", "public void sum2(int n){\n int sum =0; //1\n for (int j = 0; j < n; j++) //2n+2\n for (int k = 0; k < n; k++) //2n+2\n sum += k + j; //1\n for (int l = 0; l < n; l++) //2n+2\n sum += l; //1\n }", "private boolean method_2685(ahb var1, int var2, int var3, int var4, int var5) {\r\n String[] var6 = class_752.method_4253();\r\n int var10000 = var5;\r\n boolean var7;\r\n if(var6 != null) {\r\n label148: {\r\n if(var5 != 0) {\r\n var10000 = var1.method_2170(var2, var3 - 1, var4, 0);\r\n if(var6 == null) {\r\n break label148;\r\n }\r\n\r\n if(var10000 != 0) {\r\n var7 = true;\r\n return var7;\r\n }\r\n }\r\n\r\n var10000 = var5;\r\n }\r\n }\r\n\r\n byte var10001 = 1;\r\n if(var6 != null) {\r\n label138: {\r\n if(var10000 != 1) {\r\n var10000 = var1.method_2170(var2, var3 + 1, var4, 1);\r\n if(var6 == null) {\r\n break label138;\r\n }\r\n\r\n if(var10000 != 0) {\r\n var7 = true;\r\n return var7;\r\n }\r\n }\r\n\r\n var10000 = var5;\r\n }\r\n\r\n var10001 = 2;\r\n }\r\n\r\n if(var6 != null) {\r\n label128: {\r\n if(var10000 != var10001) {\r\n var10000 = var1.method_2170(var2, var3, var4 - 1, 2);\r\n if(var6 == null) {\r\n break label128;\r\n }\r\n\r\n if(var10000 != 0) {\r\n var7 = true;\r\n return var7;\r\n }\r\n }\r\n\r\n var10000 = var5;\r\n }\r\n\r\n var10001 = 3;\r\n }\r\n\r\n if(var6 != null) {\r\n label118: {\r\n if(var10000 != var10001) {\r\n var10000 = var1.method_2170(var2, var3, var4 + 1, 3);\r\n if(var6 == null) {\r\n break label118;\r\n }\r\n\r\n if(var10000 != 0) {\r\n var7 = true;\r\n return var7;\r\n }\r\n }\r\n\r\n var10000 = var5;\r\n }\r\n\r\n var10001 = 5;\r\n }\r\n\r\n label153: {\r\n if(var6 != null) {\r\n label104: {\r\n if(var10000 != var10001) {\r\n var10000 = var1.method_2170(var2 + 1, var3, var4, 5);\r\n if(var6 == null) {\r\n break label104;\r\n }\r\n\r\n if(var10000 != 0) {\r\n var7 = true;\r\n return var7;\r\n }\r\n }\r\n\r\n var10000 = var5;\r\n }\r\n\r\n if(var6 == null) {\r\n break label153;\r\n }\r\n\r\n var10001 = 4;\r\n }\r\n\r\n if(var10000 != var10001) {\r\n var10000 = var1.method_2170(var2 - 1, var3, var4, 4);\r\n if(var6 == null) {\r\n break label153;\r\n }\r\n\r\n if(var10000 != 0) {\r\n var7 = true;\r\n return var7;\r\n }\r\n }\r\n\r\n var10000 = var1.method_2170(var2, var3, var4, 0);\r\n }\r\n\r\n if(var6 != null) {\r\n if(var10000 != 0) {\r\n var7 = true;\r\n return var7;\r\n }\r\n\r\n var10000 = var1.method_2170(var2, var3 + 2, var4, 1);\r\n }\r\n\r\n if(var6 != null) {\r\n if(var10000 != 0) {\r\n var7 = true;\r\n return var7;\r\n }\r\n\r\n var10000 = var1.method_2170(var2, var3 + 1, var4 - 1, 2);\r\n }\r\n\r\n if(var6 != null) {\r\n if(var10000 != 0) {\r\n var7 = true;\r\n return var7;\r\n }\r\n\r\n var10000 = var1.method_2170(var2, var3 + 1, var4 + 1, 3);\r\n }\r\n\r\n int var8;\r\n ahb var9;\r\n int var10002;\r\n int var10003;\r\n byte var10004;\r\n label155: {\r\n if(var6 != null) {\r\n if(var10000 != 0) {\r\n var7 = true;\r\n return var7;\r\n }\r\n\r\n var9 = var1;\r\n var8 = var2 - 1;\r\n var10002 = var3 + 1;\r\n var10003 = var4;\r\n var10004 = 4;\r\n if(var6 == null) {\r\n break label155;\r\n }\r\n\r\n var10000 = var1.method_2170(var8, var10002, var4, 4);\r\n }\r\n\r\n if(var10000 != 0) {\r\n var7 = true;\r\n return var7;\r\n }\r\n\r\n var9 = var1;\r\n var8 = var2 + 1;\r\n var10002 = var3 + 1;\r\n var10003 = var4;\r\n var10004 = 5;\r\n }\r\n\r\n var7 = var9.method_2170(var8, var10002, var10003, var10004);\r\n return var7;\r\n }", "protected void method_4160() {\r\n String[] var10000 = class_752.method_4253();\r\n ++this.field_3416;\r\n String[] var1 = var10000;\r\n int var7 = this.field_3416;\r\n if(var1 != null) {\r\n label96: {\r\n if(this.field_3416 >= 180) {\r\n var7 = this.field_3416;\r\n if(var1 == null) {\r\n break label96;\r\n }\r\n\r\n if(this.field_3416 <= 200) {\r\n float var2 = (this.field_3028.nextFloat() - 0.5F) * 8.0F;\r\n float var3 = (this.field_3028.nextFloat() - 0.5F) * 4.0F;\r\n float var4 = (this.field_3028.nextFloat() - 0.5F) * 8.0F;\r\n String[] var10001 = field_3418;\r\n this.field_2990.method_2087(\"hugeexplosion\", this.field_2994 + (double)var2, this.field_2995 + 2.0D + (double)var3, this.field_2996 + (double)var4, 0.0D, 0.0D, 0.0D);\r\n }\r\n }\r\n\r\n var7 = this.field_2990.field_1832;\r\n }\r\n }\r\n\r\n int var5;\r\n int var6;\r\n class_715 var9;\r\n ahb var10;\r\n label101: {\r\n short var8;\r\n label102: {\r\n if(var1 != null) {\r\n label85: {\r\n if(var7 == 0) {\r\n var7 = this.field_3416;\r\n var8 = 150;\r\n if(var1 != null) {\r\n label80: {\r\n if(this.field_3416 > 150) {\r\n var7 = this.field_3416 % 5;\r\n if(var1 == null) {\r\n break label80;\r\n }\r\n\r\n if(var7 == 0) {\r\n var5 = 1000;\r\n\r\n while(var5 > 0) {\r\n var6 = class_715.method_4090(var5);\r\n var5 -= var6;\r\n var10 = this.field_2990;\r\n var9 = new class_715;\r\n var9.method_4087(this.field_2990, this.field_2994, this.field_2995, this.field_2996, var6);\r\n var10.method_2089(var9);\r\n if(var1 == null) {\r\n break label85;\r\n }\r\n\r\n if(var1 == null) {\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n var7 = this.field_3416;\r\n }\r\n\r\n var8 = 1;\r\n }\r\n\r\n if(var1 == null) {\r\n break label102;\r\n }\r\n\r\n if(var7 == var8) {\r\n this.field_2990.method_2209(1018, (int)this.field_2994, (int)this.field_2995, (int)this.field_2996, 0);\r\n }\r\n }\r\n\r\n this.method_3864(0.0D, 0.10000000149011612D, 0.0D);\r\n this.field_3330 = this.field_3000 += 20.0F;\r\n }\r\n\r\n var7 = this.field_3416;\r\n }\r\n\r\n if(var1 == null) {\r\n break label101;\r\n }\r\n\r\n var8 = 200;\r\n }\r\n\r\n if(var7 != var8) {\r\n return;\r\n }\r\n\r\n var7 = this.field_2990.field_1832;\r\n }\r\n\r\n if(var1 != null) {\r\n if(var7 != 0) {\r\n return;\r\n }\r\n\r\n var7 = 2000;\r\n }\r\n\r\n var5 = var7;\r\n\r\n while(true) {\r\n if(var5 > 0) {\r\n var6 = class_715.method_4090(var5);\r\n var5 -= var6;\r\n var10 = this.field_2990;\r\n var9 = new class_715;\r\n var9.method_4087(this.field_2990, this.field_2994, this.field_2995, this.field_2996, var6);\r\n var10.method_2089(var9);\r\n if(var1 == null) {\r\n break;\r\n }\r\n\r\n if(var1 != null) {\r\n continue;\r\n }\r\n }\r\n\r\n this.method_4325(class_1715.method_9561(this.field_2994), class_1715.method_9561(this.field_2996));\r\n break;\r\n }\r\n\r\n this.method_3851();\r\n }", "public static int[] exe1(int[] arr){ // Solution O(n) in time and constant in Memory\n int nzeros=0;\n\n for (int i=0; i<arr.length; i++) {\n arr[i-nzeros] = arr[i];\n if (arr[i] == 0) {\n nzeros++;\n }\n }\n for (int i=arr.length-1; i>arr.length-nzeros-1; i--) {\n arr[i] = 0;\n }\n\n return arr;\n }", "public static void main(String[] args){\n int s = 80;\n int n = (int) Math.pow(10, 7);\n Integer[] a = new Integer[n];\n Random rand = new Random();\n for (int i = 0; i < n; i++){\n a[i] = (int) (n*rand.nextDouble());\n }\n double binTime = binSearchT(s, a);\n double linTime = linSearchT(s, a);\n System.out.println(\"binTime: \"+ binTime);\n System.out.println(\"linTime: \"+ linTime);\n\n }", "private void m15513b(long j) {\n if (mo9140c() != null) {\n this.f13396d.f11688z = System.currentTimeMillis();\n int intValue = ((Integer) this.f13396d.get(\"data_pk_anchor_score\")).intValue();\n int intValue2 = ((Integer) this.f13396d.get(\"data_pk_guest_score\")).intValue();\n if (intValue > intValue2) {\n this.f13396d.lambda$put$1$DataCenter(\"data_pk_result\", PkResult.LEFT_WON);\n } else if (intValue < intValue2) {\n this.f13396d.lambda$put$1$DataCenter(\"data_pk_result\", PkResult.RIGHT_WON);\n } else {\n this.f13396d.lambda$put$1$DataCenter(\"data_pk_result\", PkResult.EVEN);\n }\n this.f13396d.lambda$put$1$DataCenter(\"data_pk_state\", PkState.PENAL);\n if (j <= 0) {\n this.f13396d.lambda$put$1$DataCenter(\"data_pk_state\", PkState.FINISHED);\n }\n int i = (int) (j / 1000);\n int i2 = (int) (j % 1000);\n if (this.f13399i != null) {\n this.f13399i.dispose();\n this.f13399i = null;\n }\n this.f13399i = C9057b.m27050a(0, 1, TimeUnit.SECONDS).mo19305c((long) (i + 1)).mo19320e((long) i2, TimeUnit.MILLISECONDS).mo19317d((C7327h<? super T, ? extends R>) new C4703fw<Object,Object>(i)).mo19294a(C47549a.m148327a()).mo19280a((C7326g<? super T>) new C4704fx<Object>(this), (C7326g<? super Throwable>) new C4705fy<Object>(this));\n }\n }", "private int first_leaf() { return n/2; }", "@Override\n public String solve() {\n int LIMIT = 50 * NumericHelper.ONE_MILLION_INT;\n int[] nCount = new int[LIMIT+1];\n for(long y = 1; y<= LIMIT; y++) {\n for(long d= (y+3)/4; d<y; d++) { // +3 is to make d atleast 1\n long xSq = (y+d) * (y+d);\n long ySq = y * y;\n long zSq = (y-d) * (y-d);\n\n long n = xSq - ySq - zSq;\n\n if(n<0) {\n continue;\n }\n\n if(n>=LIMIT) {\n break;\n }\n\n\n nCount[(int)n]++;\n\n }\n }\n\n int ans = 0;\n for(int i = 1; i<LIMIT; i++) {\n if(nCount[i] == 1) {\n //System.out.print(i +\",\");\n ans++;\n }\n }\n\n return Integer.toString(ans);\n }", "public int findDuplicate(int[] nums) {\n if(nums == null || nums.length == 0) return 0;\n\n int slow = nums[0];\n int fast = nums[nums[0]];\n\n while(slow != fast) {\n slow = nums[slow];\n fast = nums[nums[fast]];\n }\n\n fast = 0;\n while(slow != fast) {\n slow = nums[slow];\n fast = nums[fast];\n }\n\n return slow;\n}", "public int[] squareUp(int n) {\r\n int[]arreglo=new int[(n*n)]; // O(1)\r\n if(n==0){ // O(1)\r\n return arreglo; // O(1)\r\n }\r\n for(int i=n-1;i<arreglo.length;i=i+n){ // O(n)\r\n for (int j=i;j>=i-(i/n);j--){ // O(1)\r\n arreglo[j]=1+(i-j); // O(1)\r\n }\r\n }\r\n return arreglo; // O(1)\r\n}", "public static void main(String[] args) throws IOException {\n\t\tbr = new BufferedReader(new FileReader(new File(\"input.txt\")));\r\n\t\tSystem.setOut(new PrintStream(new File(\"output.txt\")));\r\n\t\tint T = readInt();\r\n\t\t\r\n\t\tfor (int ind = 1; ind<=T; ind++) {\r\n\t\t\tSystem.out.print(\"Case #\" + ind + \": \");\r\n\t\t\t\r\n\t\t\tint N = readInt();\r\n\t\t\tint[] ar = readIntArr();\r\n\t\t\tfor (int i = 0; i < N; i++)ar[i]--;\r\n\t\t\tboolean used[] = new boolean[N];\r\n\t\t\tint ans = 0;\r\n\t\t\tint pairMax = 0;\r\n\t\t\tint cycleMax = 0;\r\n\t\t\tint cyclePair = 0;\r\n\t\t\tint pair = 0;\r\n\t\t\tfor (int i = 0; i < N; i++) {\r\n\t\t\t\tif (!used[i]) {\r\n\t\t\t\t\tList<Integer> list = new LinkedList<Integer>();\r\n\t\t\t\t\tlist.add(i);\r\n\t\t\t\t\tused[i] = true;\r\n\t\t\t\t\tint j = ar[i];\r\n\t\t\t\t\twhile(!list.contains(j) && !used[j]) {\r\n\t\t\t\t\t\tlist.add(j);\r\n\t\t\t\t\t\tused[j] = true;\r\n\t\t\t\t\t\tj = ar[j];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!list.contains(j))continue;\r\n\t\t\t\t\tif (list.size() == 2)pair++;\r\n\t\t\t\t\tboolean removed = false;\r\n\t\t\t\t\twhile(list.get(0) != j){list.remove(0);removed = true;}\r\n\t\t\t\t\tif (list.size() > 2 && list.size() > cycleMax) cycleMax = list.size();\r\n\t\t\t\t\tif (list.size() == 2) {\r\n\t\t\t\t\t\tint a = list.remove(0);\r\n\t\t\t\t\t\tint b = list.remove(0);\r\n\t\t\t\t\t\tint tmp = 2;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tboolean us[] = new boolean[N];\r\n\t\t\t\t\t\t\tus[a] = true;\r\n\t\t\t\t\t\t\tus[b] = true;\r\n\t\t\t\t\t\t\t//System.out.println(\" test \" + a + b);\r\n\t\t\t\t\t\t\tSet<Integer> set = new HashSet<Integer>();\r\n\t\t\t\t\t\t\tset.add(a);\r\n\t\t\t\t\t\t\twhile (true) {\r\n\t\t\t\t\t\t\t\tboolean found = false;\r\n\t\t\t\t\t\t\t\tSet<Integer> tSet = new HashSet<Integer>();\r\n\t\t\t\t\t\t\t\tfor (int ii = 0; ii < N; ii++) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif (!us[ii] && set.contains(ar[ii])) {\r\n\t\t\t\t\t\t\t\t\t\tus[ii] = true;\r\n\t\t\t\t\t\t\t\t\t\tfound = true;\r\n\t\t\t\t\t\t\t\t\t\ttSet.add(ii);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (found)tmp++;\r\n\t\t\t\t\t\t\t\tif (!found)break;\r\n\t\t\t\t\t\t\t\tset.addAll(tSet);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tset = new HashSet<Integer>();\r\n\t\t\t\t\t\t\tset.add(b);\r\n\t\t\t\t\t\t\twhile (true) {\r\n\t\t\t\t\t\t\t\tboolean found = false;\r\n\t\t\t\t\t\t\t\tSet<Integer> tSet = new HashSet<Integer>();\r\n\t\t\t\t\t\t\t\tfor (int ii = 0; ii < N; ii++) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif (!us[ii] && set.contains(ar[ii])) {\r\n\t\t\t\t\t\t\t\t\t\tus[ii] = true;\r\n\t\t\t\t\t\t\t\t\t\tfound = true;\r\n\t\t\t\t\t\t\t\t\t\ttSet.add(ii);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif(found)tmp++;\r\n\t\t\t\t\t\t\t\tif (!found)break;\r\n\t\t\t\t\t\t\t\tset.addAll(tSet);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//if (removed) {\r\n\t\t\t\t\t\t//\tif (tmp > cyclePair)cyclePair = tmp;\r\n\t\t\t\t\t\t//} else {\r\n\t\t\t\t\t\t pairMax += tmp;\r\n\t\t\t\t\t\t//}\r\n\t\t\t\t\t} else {\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\r\n\t\t\t//cyclePair += 2 * pair;\r\n\t\t\t//if (pair > 1) pairMax += 2 * (pair - 1);\r\n\t\t\tans = Math.max(cyclePair, pairMax);\r\n\t\t\tans = Math.max(cycleMax, ans);\r\n\t\t\tSystem.out.println(ans);\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\r\n\t}", "public static void main(String[] args) {\n Scanner scan=new Scanner(System.in);\n int t= scan.nextInt();\n int min[] = new int[10001];\n Arrays.fill(min,89898);\n min[0] = 0;\n int pn[] = new int[10001];\n boolean p[] = new boolean[10001];\n for(int i=2;i<101;++i)\n {\n if(!p[i])\n for(int j=i*i;j<10001;j+=i)\n p[j] = true;\n }\n int index = 0;\n for(int i=2;i<10001;++i)\n if(!p[i])\n pn[index++] = i;\n int last = index-1;\n for(int i=0;i<=last;++i)\n {\n int temp = (int)Math.pow(pn[i], pn[i]);\n if(temp<10001)\n pn[index++] = temp;\n else break;\n }\n pn[index++] = 898989;\n Arrays.sort(pn,0,index);\n for(int i=2;i<10001;++i)\n {\n for(int j=0;pn[j]<=i;++j)\n if(min[i]>1+min[i-pn[j]])\n min[i] = 1+min[i-pn[j]];\n }\n\n StringBuilder sb = new StringBuilder(\"\");\n while(t-->0)\n {\n sb.append(min[scan.nextInt()]+\"\\n\");\n }\n System.out.println(sb);\n }", "public abstract long mo9229aD();" ]
[ "0.6238564", "0.61389905", "0.59912705", "0.59226453", "0.58908445", "0.5878164", "0.5793167", "0.57386255", "0.5705054", "0.57037485", "0.56654197", "0.56287295", "0.56252605", "0.56233007", "0.56138843", "0.56085974", "0.55992347", "0.55688804", "0.55630255", "0.55549055", "0.5545987", "0.5530166", "0.55188006", "0.54990023", "0.5497378", "0.54965585", "0.548848", "0.54779285", "0.54759", "0.5463707", "0.54633725", "0.54590285", "0.5454978", "0.54503024", "0.5444145", "0.5438263", "0.5433158", "0.5425837", "0.54201543", "0.5418608", "0.5415315", "0.54028696", "0.5390092", "0.5388842", "0.5381584", "0.5372199", "0.5369065", "0.53637564", "0.53579295", "0.5355153", "0.53525984", "0.5345236", "0.5338984", "0.5335081", "0.53311694", "0.5330284", "0.5328004", "0.53268427", "0.5325662", "0.53239954", "0.53223544", "0.5317762", "0.5314999", "0.53139883", "0.53136176", "0.5309376", "0.530785", "0.53071773", "0.53060293", "0.52964723", "0.5296421", "0.52821034", "0.5279827", "0.5275149", "0.52742493", "0.52719605", "0.52715933", "0.5268736", "0.5262416", "0.5261678", "0.5261252", "0.5260616", "0.5259686", "0.525938", "0.52591276", "0.5256383", "0.5255582", "0.525152", "0.5249395", "0.5248944", "0.5246675", "0.5244651", "0.52439356", "0.52434456", "0.5242721", "0.5241532", "0.5237447", "0.52361363", "0.52358896", "0.52343476", "0.5232814" ]
0.0
-1
// mission 8 O(n)//
public Container getMedian(Boolean axis) { int Number = (this.size)/2 ; if (axis){ this.current = this.minx; while (Number>0){ this.current=this.current.getNextX(); Number--; } } else{ this.current = this.miny; while (Number>0){ this.current=this.current.getNextY(); Number--; } } return this.current; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int f2(int N) { \n int x = 0; //O(1)\n for(int i = 0; i < N; i++) // O(n)\n // O(n)`\n for(int j = 0; j < i; j++) \n x++;\n return x;\n }", "public static int f1(int N) {\n int x = 0; //O(1)\n for(int i = 0; i < N; i++) // O(n) \n x++; \n return x; \n \n }", "public int[] squareUp(int n) {\r\n int[]arreglo=new int[(n*n)]; // O(1)\r\n if(n==0){ // O(1)\r\n return arreglo; // O(1)\r\n }\r\n for(int i=n-1;i<arreglo.length;i=i+n){ // O(n)\r\n for (int j=i;j>=i-(i/n);j--){ // O(1)\r\n arreglo[j]=1+(i-j); // O(1)\r\n }\r\n }\r\n return arreglo; // O(1)\r\n}", "public static int example4(int[] arr) { // O(1)\r\n\t\tint n = arr.length, prefix = 0, total = 0; // O(1), O(1), (1)\r\n\t\tfor (int j = 0; j < n; j++) { // loop from 0 to n-1 // O(n)\r\n\t\t\tprefix += arr[j];\r\n\t\t\ttotal += prefix;\r\n\t\t}\r\n\t\treturn total;\r\n\r\n\t\t/*\r\n\t\t * Explanation: The method contains a (for) loop and it runs (n) times.This loop\r\n\t\t * dominates the runtime.We always aim for the worse-case and maximum time. The\r\n\t\t * answer is it is linear time of O(n) notation.\r\n\t\t * \r\n\t\t */\r\n\t}", "private int d(@Nullable K ☃) {\r\n/* 127 */ return (xq.f(System.identityHashCode(☃)) & Integer.MAX_VALUE) % this.b.length;\r\n/* */ }\r\n/* */ private int b(@Nullable K ☃, int i) {\r\n/* */ int j;\r\n/* 131 */ for (j = i; j < this.b.length; j++) {\r\n/* 132 */ if (this.b[j] == ☃) {\r\n/* 133 */ return j;\r\n/* */ }\r\n/* 135 */ if (this.b[j] == a) {\r\n/* 136 */ return -1;\r\n/* */ }\r\n/* */ }", "public int[] fix34(int[] nums) {\r\n\tint i=0; // O(1)\r\n while(i<nums.length && nums[i]!=3) // O(n)\r\n i++; // n+1\r\n int j=i; // O(1)\r\n while(j+1<nums.length && nums[j+1]!=4) // O(n)\r\n j++; // n+1\r\n while(i<nums.length){ // O(n)\r\n if(nums[i]==3){ // O(1)\r\n int temp=nums[i+1]; // O(1)\r\n nums[i+1]=nums[j+1]; //O(1)\r\n nums[j+1]=temp; // O(1)\r\n while(j+1<nums.length && nums[j+1] != 4) //O(n)\r\n j++; // n+1\r\n }\r\n i++; // n+1\r\n }\r\n return nums; //O(1)\r\n}", "private final int m()\n\t { int n = 0;\n\t int i = 0;\n\t while(true)\n\t { if (i > j) return n;\n\t if (! cons(i)) break; i++;\n\t }\n\t i++;\n\t while(true)\n\t { while(true)\n\t { if (i > j) return n;\n\t if (cons(i)) break;\n\t i++;\n\t }\n\t i++;\n\t n++;\n\t while(true)\n\t { if (i > j) return n;\n\t if (! cons(i)) break;\n\t i++;\n\t }\n\t i++;\n\t }\n\t }", "static int[] OnepassSol1(int[]a, int n){\r\n Map<Integer, Integer> map = new HashMap<>();\r\n for (int i = 0; i < a.length; i++) {\r\n int complement = n - a[i];\r\n if (map.containsKey(complement)) {\r\n return new int[] { map.get(complement), i };\r\n }\r\n map.put(a[i], i);\r\n }\r\n int[] ans = {-1,-1};\r\n return ans;\r\n }", "public static void main(String[] args) {\n\n pairsSum();\n\n printAllSubArrays();\n\n tripletZero();\n\n // int[][] sub = subsets();\n\n PairsSum sum = new PairsSum();\n int[] arr = { 10, 1, 2, 3, 4, 5, 6, 1 };\n boolean flag = sum.almostIncreasingSequence(arr);\n System.out.println(flag);\n\n String s = \"\";\n for (int i = 0; i < 100000; i++) {\n // s += \"CodefightsIsAwesome\";\n }\n long start = System.currentTimeMillis();\n // int k = subStr(s, \"IsA\");\n System.out.println(System.currentTimeMillis() - start);\n // System.out.println(k);\n\n String[] a = { \"aba\", \"aa\", \"ad\", \"vcd\", \"aba\" };\n String[] b = sum.allLongestStrings(a);\n System.out.println(Arrays.deepToString(b));\n\n List<String> al = new ArrayList<>();\n al.toArray();\n\n Map<Integer, Integer> map = new HashMap<>();\n Set<Integer> keySet = map.keySet();\n for (Integer integer : keySet) {\n\n }\n\n String st = reverseBracksStack(\"a(bc(de)f)g\");\n System.out.println(st);\n\n int[] A = { 1, 2, 3, 2, 2, 3, 3, 33 };\n int[] B = { 1, 2, 2, 2, 2, 3, 2, 33 };\n\n System.out.println(sum.isIPv4Address(\"2.2.34\"));\n\n Integer[] AR = { 5, 3, 6, 7, 9 };\n int h = sum.avoidObstacles(AR);\n System.out.println(h);\n\n int[][] image = { { 36, 0, 18, 9 }, { 27, 54, 9, 0 }, { 81, 63, 72, 45 } };\n int[][] im = { { 7, 4, 0, 1 }, { 5, 6, 2, 2 }, { 6, 10, 7, 8 }, { 1, 4, 2, 0 } };\n int[][] res = sum.boxBlur(im);\n\n for (int i = 0; i < res.length; i++) {\n for (int j = 0; j < res[0].length; j++) {\n System.out.print(res[i][j] + \" \");\n }\n System.out.println();\n }\n\n boolean[][] ms = { { true, false, false, true }, { false, false, true, false }, { true, true, false, true } };\n int[][] mines = sum.minesweeper(ms);\n for (int i = 0; i < mines.length; i++) {\n for (int j = 0; j < mines[0].length; j++) {\n System.out.print(mines[i][j] + \" \");\n }\n System.out.println();\n }\n\n System.out.println(sum.variableName(\"var_1__Int\"));\n\n System.out.println(sum.chessBoard());\n\n System.out.println(sum.depositProfit(100, 20, 170));\n\n String[] inputArray = { \"abc\", \"abx\", \"axx\", \"abx\", \"abc\" };\n System.out.println(sum.stringsRearrangement(inputArray));\n\n int[][] queens = { { 1, 1 }, { 3, 2 } };\n int[][] queries = { { 1, 1 }, { 0, 3 }, { 0, 4 }, { 3, 4 }, { 2, 0 }, { 4, 3 }, { 4, 0 } };\n boolean[] r = sum.queensUnderAttack(5, queens, queries);\n\n }", "public static int[] exe1(int[] arr){ // Solution O(n) in time and constant in Memory\n int nzeros=0;\n\n for (int i=0; i<arr.length; i++) {\n arr[i-nzeros] = arr[i];\n if (arr[i] == 0) {\n nzeros++;\n }\n }\n for (int i=arr.length-1; i>arr.length-nzeros-1; i--) {\n arr[i] = 0;\n }\n\n return arr;\n }", "static long nPolyNTime(int[] n) {\n int temp = n.length;\n long sum = 0;\n if(n == null || n.length == 0) return -1;\n for(int i = 0; i < n.length; ++i) {\n while(temp --> 0) {\n for(int j = 0; j < n.length; ++j) {\n sum += n[i] + n[j];\n }\n }\n }\n return sum;\n }", "public static int example3(int[] arr) { // O(n)\r\n\t\tint n = arr.length, total = 0; // O(1)\r\n\t\tfor (int j = 0; j < n; j++) // loop from 0 to n-1 // O(n^2)\r\n\t\t\tfor (int k = 0; k <= j; k++) // loop from 0 to j\r\n\t\t\t\ttotal += arr[j];\r\n\t\treturn total;\r\n\r\n\t\t/*\r\n\t\t * Explanation: Since we have nested for loop which dominates here and it is\r\n\t\t * O(n^2) and we always take the maximum. so the answer is quadratic time O(n^2)\r\n\t\t * \r\n\t\t */\r\n\t}", "public static int example2(int[] arr) { // O(1)\r\n\t\tint n = arr.length, total = 0; // O(1)\r\n\t\tfor (int j = 0; j < n; j += 2) // note the increment of 2 // O(1)\r\n\t\t\ttotal += arr[j];\r\n\t\treturn total;\r\n\r\n\t\t/*\r\n\t\t * Explanation: Once Again, we have a (for) loop and it runs (n) times and this\r\n\t\t * for loop dominates the runtime.So this is linear time and the answer is O(n).\r\n\t\t * \r\n\t\t */\r\n\t}", "static int[] sol1(int[]a, int n){\r\n\t\tMap <Integer,Integer> map= new HashMap();\r\n\t\tfor (int i = 0; i< a.length; i++){\r\n\t\t\tmap.put(a[i],i);\r\n\t\t}\r\n\t\tArrays.sort(a);\r\n\t\tint i = 0; \r\n\t\tint j = a.length -1;\r\n\t\twhile (i <= j){\r\n\t\t\tif(a[i]+a[j]>n) j--;\r\n\t\t\telse if (a[i]+a[j]<n) i++;\r\n\t\t\telse break;\r\n\t\t}\r\n\t\tint[] ans= {map.get(a[i]),map.get(a[j])};\r\n\t\treturn ans;\r\n\t}", "int minOperations(int[] arr) {\n // Write your code here\n Set<String> set = new HashSet<>();//store visited string\n Queue<String> queue = new LinkedList<>(); // store next strs\n int counter = 0;\n\n queue.offer(getKey(arr));\n set.add(getKey(arr));\n\n while (!queue.isEmpty()) {\n int size = queue.size();\n List<String> curs = new ArrayList<>();\n while (size > 0) {\n curs.add(queue.poll());\n size--;\n }\n\n for(String cur : curs) {\n if (isIncreasing(cur)) {\n return counter;\n }\n\n for(int i = 0; i < cur.length(); i++) {\n String next = reverseString(cur, i);\n if (!set.contains(next)) {\n set.add(next);\n queue.offer(next);\n }\n }\n }\n\n counter++;\n }\n\n return counter;\n }", "public int findDuplicate(int[] nums) {\n if(nums == null || nums.length == 0) return 0;\n\n int slow = nums[0];\n int fast = nums[nums[0]];\n\n while(slow != fast) {\n slow = nums[slow];\n fast = nums[nums[fast]];\n }\n\n fast = 0;\n while(slow != fast) {\n slow = nums[slow];\n fast = nums[fast];\n }\n\n return slow;\n}", "public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\n\t\tint a[] = {2,1,3,-4,-2};\n\t\t//int a[] = {1 ,2, 3, 7, 5};\n\t\tboolean found = false;\n\t\t\n\t\t//this will solve in o n^2\n\t\tfor(int i = 0 ; i < a.length ; i++){\n\t\t\tint sum = 0;\n\t\t\tfor(int j = i ; j< a.length ; j++){\n\t\t\t\tsum += a[j] ;\n\t\t\t\tif(sum == 0){\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tif(found)\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t\n\t\t// link : https://www.youtube.com/watch?v=PSpuM9cimxA&list=PLKKfKV1b9e8ps6dD3QA5KFfHdiWj9cB1s&index=49\n\t\tSystem.out.println(found + \" found\");\n\t\tfound = false;\n\t\t//solving with O of N with the help sets\n\t\t// x + 0 = y\n\t\tSet<Integer> set = new HashSet<>();\n\t\tint sum = 0;\n\t\tfor(int element : a){\n\t\t\tset.add(sum);\n\t\t\tsum += element;\n\t\t\tif(set.contains(sum)){\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\tSystem.out.println(set);\n\t\t\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t\tfound = false;\n\t\t// when the sum of subarray is K\n\t\t\n\t\t//solving with O of N with the help sets\n\t\t//x + k = y >>>\n\t\tSet<Integer> set1 = new HashSet<>();\n\t\tint k = 12;\n\t\tint summ = 0;\n\t\tfor(int element : a){\n\t\t\tset1.add(summ);\n\t\t\tsumm += element;\n\t\t\tif(set1.contains(summ - k)){ // y - k = x(alredy presnt or not)\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(set1);\n\t\tSystem.out.println();\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t}", "public static void main(String args[] ) throws Exception {\n Scanner scanner = new Scanner(System.in);\n int n = scanner.nextInt();\n int[] seqArray = new int[n];\n for (int i = 0; i < n; i++) {\n seqArray[i] = scanner.nextInt();\n }\n // getSeqValue(seqArray); //this method is an accepted one on Hackerrank but time complexity is not order n; i.e. !O(n);\n getLinearOrderY(seqArray); // trying to get O(n) time complexity;\n }", "public boolean linearIn(int[] outer, int[] inner) {\r\n int comp=0; // O(1)\r\n int count=0; // O(1)\r\n if(inner.length==0) // O(1)\r\n return true; // O(1)\r\n for(int i=0; i<outer.length; i++) { // O(n)\r\n if(outer[i]==inner[count]) { // O(1)\r\n comp++; // O(1)\r\n count++; // O(1)\r\n } else if(outer[i]>inner[count]) // O(1)\r\n return false; // O(1)\r\n if (comp==inner.length) // O(1)\r\n return true; // O(1)\r\n }\r\n return false; // O(1)\r\n}", "public static int example1(int[] arr) { // O(1)\r\n\t\tint n = arr.length, total = 0; // O(1)\r\n\t\tfor (int j = 0; j < n; j++) // loop from 0 to n-1 // O(n)\r\n\t\t\ttotal += arr[j];\r\n\t\treturn total;\r\n\t}", "static int gen(int n)\n{ \n int []S = new int [n + 1];\n \n S[0] = 0;\n if(n != 0)\n S[1] = 1;\n \n for (int i = 2; i <= n; i++)\n { \n \n // S(2 * n) = 4 * S(n)\n if (i % 2 == 0)\n S[i] = 4 * S[i / 2];\n \n // S(2 * n + 1) = 4 * S(n) + 1\n else\n S[i] = 4 * S[i/2] + 1;\n }\n \n return S[n];\n}", "private static int betterSolution(int n) {\n return n*n*n;\n }", "static int getMissingByAvoidingOverflow(int a[], int n)\n\t {\n\t int total = 2;\n\t for (int i = 3; i <= (n + 1); i++)\n\t {\n\t total =total+ i -a[i - 2];\n\t //total =total- a[i - 2];\n\t }\n\t return total;\n\t }", "void h(List<List<Integer>> r, List<Integer> t, int n, int s){ \n for(int i = s; i*i <= n; i++){\n if(n % i != 0) continue; \n t.add(i);\n t.add(n / i);\n r.add(new ArrayList<>(t));\n t.remove(t.size() - 1);\n h(r, t, n/i, i);\n t.remove(t.size() - 1);\n }\n }", "static long findSum(int N)\n\t{\n\t\tif(N==0) return 0;\n\t\treturn (long)((N+1)>>1)*((N+1)>>1)+findSum((int)N>>1);\n\t\t\n\t}", "private static void get4ElementsSumCountFastest(String inputLine, int target) {\n String[] arr = inputLine.split(\" \");\n if (arr.length < 3) {\n System.out.println(0);\n return;\n }\n\n Map<Integer, Set<String>> pairSumMap = new HashMap<>();\n List<Integer> list = new ArrayList<>(arr.length);\n for (String s : arr) {\n list.add(Integer.parseInt(s.trim()));\n }\n\n int sum = 0, diff = 0;\n for (int i = 0; i < arr.length; i++) {\n for (int j = i + 1; j < arr.length; j++) {\n sum = list.get(i) + list.get(j);\n if (sum < target) {\n pairSumMap.putIfAbsent(sum, new HashSet<>());\n pairSumMap.get(sum).add(i + \"-\" + j);\n }\n }\n }\n\n for (Map.Entry<Integer, Set<String>> mk : pairSumMap.entrySet()) {\n diff = target - mk.getKey();\n if (pairSumMap.containsKey(diff)) {\n Set<String> indexesList = mk.getValue();\n for (String index : indexesList) {\n int indexOrgX = Integer.parseInt(index.split(\"-\")[0]);\n int indexOrgY = Integer.parseInt(index.split(\"-\")[1]);\n for (String newIdx : pairSumMap.get(diff)) {\n int indexNewX = Integer.parseInt(newIdx.split(\"-\")[0]);\n int indexNewY = Integer.parseInt(newIdx.split(\"-\")[1]);\n if (indexOrgX != indexNewX && indexOrgX != indexNewY && indexOrgY != indexNewX && indexOrgY != indexNewY) {\n System.out.println(1);\n return;\n }\n }\n }\n }\n }\n System.out.println(0);\n }", "public static int f5(int N) { \n int x = 0;\n // log(n)\n for(int i = N; i > 0; i = i/2)\n // O(n) + O(n/2) + O(n/4)\n x += f1(i);\n \n return x; \n \n }", "private int e(amj paramamj)\r\n/* 202: */ {\r\n/* 203:221 */ alq localalq = paramamj.b();\r\n/* 204:222 */ int i = paramamj.b;\r\n/* 205: */ \r\n/* 206:224 */ int j = d(paramamj);\r\n/* 207:225 */ if (j < 0) {\r\n/* 208:226 */ j = j();\r\n/* 209: */ }\r\n/* 210:228 */ if (j < 0) {\r\n/* 211:229 */ return i;\r\n/* 212: */ }\r\n/* 213:231 */ if (this.a[j] == null)\r\n/* 214: */ {\r\n/* 215:232 */ this.a[j] = new amj(localalq, 0, paramamj.i());\r\n/* 216:233 */ if (paramamj.n()) {\r\n/* 217:234 */ this.a[j].d((fn)paramamj.o().b());\r\n/* 218: */ }\r\n/* 219: */ }\r\n/* 220:238 */ int k = i;\r\n/* 221:239 */ if (k > this.a[j].c() - this.a[j].b) {\r\n/* 222:240 */ k = this.a[j].c() - this.a[j].b;\r\n/* 223: */ }\r\n/* 224:242 */ if (k > p_() - this.a[j].b) {\r\n/* 225:243 */ k = p_() - this.a[j].b;\r\n/* 226: */ }\r\n/* 227:246 */ if (k == 0) {\r\n/* 228:247 */ return i;\r\n/* 229: */ }\r\n/* 230:250 */ i -= k;\r\n/* 231:251 */ this.a[j].b += k;\r\n/* 232:252 */ this.a[j].c = 5;\r\n/* 233: */ \r\n/* 234:254 */ return i;\r\n/* 235: */ }", "@Override\r\n public long problem2() {\r\n ArrayList<String> arrList = new ArrayList<>();\r\n long start = System.currentTimeMillis(); \r\n for(int i = 0; i<1234567; i++){\r\n arrList.add(Integer.toString(i));\r\n }\r\n long end = System.currentTimeMillis(); \r\n return end - start; \r\n }", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int T = sc.nextInt();\n for(int i = 0 ; i < T; i++) {\n int n = sc.nextInt();\n int a = sc.nextInt();\n int b = sc.nextInt();\n PriorityQueue<Integer> queue = new PriorityQueue<Integer>();\n int[][] m = new int[n][n];\n //n^2 * log(n)\n for(int row = 0; row < n; row++) {\n for(int col = 0; col < n; col++) {\n if(row == 0 && col == 0 && n != 1) {\n continue;\n }else if(row == 0) {\n m[row][col] = m[row][col - 1] + a;\n }else if(col == 0) {\n m[row][col] = m[row-1][col] + b;\n }else {\n m[row][col] = m[row-1][col-1] + a + b;\n }\n\n if(row + col == (n -1)) {\n pool.add(m[row][col]); //log(n)\n }\n }\n }\n //O(n*log(n))\n for (Integer item:pool) {\n queue.add(item); //O(logn)\n }\n while(!queue.isEmpty()) {\n System.out.print(queue.poll() + \" \"); //O(1)\n }\n System.out.println();\n queue.clear();\n pool.clear();\n }\n }", "protected static void endPartial(long[] h) {\n h[11] += h[1]; \n h[2] ^= h[11]; \n h[1] = (h[1] << 44) | (h[1] >>> 20);\n h[0] += h[2]; \n h[3] ^= h[0]; \n h[2] = (h[2] << 15) | (h[2] >>> 49);\n h[1] += h[3]; \n h[4] ^= h[1]; \n h[3] = (h[3] << 34) | (h[3] >>> 30);\n h[2] += h[4]; \n h[5] ^= h[2]; \n h[4] = (h[4] << 21) | (h[4] >>> 43);\n h[3] += h[5]; \n h[6] ^= h[3]; \n h[5] = (h[5] << 38) | (h[5] >>> 26);\n h[4] += h[6]; \n h[7] ^= h[4]; \n h[6] = (h[6] << 33) | (h[6] >>> 31);\n h[5] += h[7]; \n h[8] ^= h[5]; \n h[7] = (h[7] << 10) | (h[7] >>> 54);\n h[6] += h[8]; \n h[9] ^= h[6]; \n h[8] = (h[8] << 13) | (h[8] >>> 51);\n h[7] += h[9]; \n h[10] ^= h[7]; \n h[9] = (h[9] << 38) | (h[9] >>> 26);\n h[8] += h[10]; \n h[11] ^= h[8]; \n h[10] = (h[10] << 53) | (h[10] >>> 11);\n h[9] += h[11]; \n h[0] ^= h[9]; \n h[11] = (h[11] << 42) | (h[11] >>> 22);\n h[10] += h[0]; \n h[1] ^= h[10]; \n h[0] = (h[0] << 54) | (h[0] >>> 10);\t\t\n\t}", "private int first_leaf() { return n/2; }", "public static void main(String[] args) {\n\t\tint a[]= {15,3,7,1,9,2};\n\t\tsubarraysum(a,11);//Time complexity O(n^2) space O(1)\n\n\t\tsubarraysum_reducecomplexity(a,11,a.length); //Time complexity O(n) space O(1)\n\n\t}", "public static int degreeOfArray(List<Integer> arr) { arr.length = n\n // num of Keys = k\n // O(n + k)\n // max value count = m\n //\n PriorityQueue<Node> pq = new PriorityQueue<>((i, j)-> j.count - i.count);\n Map<Integer, NodePosition> posMap = new HashMap<>();\n Map<Integer, Node> countMap = new HashMap<>();\n // [1, 2, 3, 4, 5, 6]\n for (int i = 0; i < arr.size(); i++) {\n int cur = arr.get(i);\n\n if (!countMap.containsKey(cur)) {\n countMap.put(cur, new Node(cur, 1));\n } else {\n Node curNode = countMap.get(cur);\n curNode.count++;\n countMap.put(cur, curNode);\n }\n\n if (!posMap.containsKey(cur)) {\n posMap.put(cur, new NodePosition(i, i));\n } else {\n NodePosition curNodePos = posMap.get(cur);\n curNodePos.endIndex = i;\n posMap.put(cur, curNodePos);\n }\n }\n //Iterator<Map.Entry<Integer, Node> it = new Iterator<>(countMap);\n for (Map.Entry<Integer, Node> e : countMap.entrySet()) {\n pq.add(e.getValue());\n }\n\n // [1, 2, 1, 3 ,2]\n // 1 , 2 , 3\n Node curNode = pq.remove();\n int maxCount = curNode.count;\n\n int minRange = posMap.get(curNode.num).endIndex - posMap.get(curNode.num).startIndex;\n\n while (!pq.isEmpty() && maxCount == pq.peek().count) {\n curNode = pq.remove();\n NodePosition nPos = posMap.get(curNode.num);\n minRange = Math.min(minRange, nPos.endIndex - nPos.startIndex);\n }\n\n return minRange + 1;\n }", "public static int solveEfficient(int n) {\n if (n == 0 || n == 1)\n return 1;\n\n int n1 = 1;\n int n2 = 1;\n int sum = 0;\n\n for (int i = 2; i <= n; i++) {\n sum = n1 + n2;\n n1 = n2;\n n2 = sum;\n }\n return sum;\n }", "public static int ulam(int n) {\n\n List<Integer> list = new ArrayList<>();\n list.add(1);\n list.add(2);\n\n int i = 3;\n while (list.size() < n) {\n\n int count = 0;\n for (int j = 0; j < list.size() - 1; j++) {\n\n for (int k = j + 1; k < list.size(); k++) {\n if (list.get(j) + list.get(k) == i)\n count++;\n if (count > 1)\n break;\n }\n if (count > 1)\n break;\n }\n if (count == 1)\n list.add(i);\n i++;\n }\n return list.get(n - 1);\n }", "public static int[] decomposeToBECC(int[][] g) {\n// this part of code is taken from uwi submissions\n int n = g.length;\n boolean[] visited = new boolean[n];\n int[] ord = new int[n];\n int[] low = new int[n];\n\n int[] ids = new int[n];\n int[] inds = new int[n];\n int[] parct = new int[n];\n int pos = 0;\n for (int i = 0; i < n; i++) {\n if (!visited[i]) {\n ids[0] = i;\n inds[0] = 0;\n int sp = 1;\n while (sp > 0) {\n int cur = ids[sp - 1];\n if (inds[sp - 1] == 0) {\n visited[cur] = true;\n ord[cur] = low[cur] = pos++;\n parct[sp - 1] = 0;\n }\n if (inds[sp - 1] == g[cur].length) {\n if (sp - 2 >= 0) {\n low[ids[sp - 2]] = Math.min(low[ids[sp - 2]], low[cur]);\n }\n sp--;\n continue;\n }\n int next = g[cur][inds[sp - 1]];\n if (!visited[next]) {\n ids[sp] = next;\n inds[sp] = 0;\n inds[sp - 1]++;\n sp++;\n continue;\n } else if (sp - 2 >= 0 && (next != ids[sp - 2] || ++parct[sp - 1] >= 2)) {\n low[cur] = Math.min(low[cur], ord[next]);\n }\n inds[sp - 1]++;\n }\n }\n }\n\n int[] clus = new int[n];\n Arrays.fill(clus, -1);\n int[] q = new int[n];\n int cnum = 0;\n for (int i = 0; i < n; i++) {\n if (clus[i] == -1) {\n int p = 0;\n q[p++] = i;\n clus[i] = cnum++;\n for (int r = 0; r < p; r++) {\n int cur = q[r];\n for (int next : g[cur]) {\n if (clus[next] == -1) {\n clus[next] = ord[cur] < low[next] ? cnum++ : clus[cur];\n q[p++] = next;\n }\n }\n }\n }\n }\n return clus;\n }", "private static int f(int n, int complete, int other, int[] arr) {\n if(n<=0)\n return 0;\n int res=0;\n ArrayList<Integer>list=new ArrayList<Integer>();\n for(int a:arr)\n if(a>0)\n list.add(a);\n int brr[]=new int[list.size()];\n for(int i=0;i<brr.length;i++)\n brr[i]=list.get(i);\n while(brr.length!=0){\n int index=0;\n for(int i=1;i<brr.length;i++)\n if(brr[index]<brr[i])\n index=i;\n for(int i=0;i<brr.length;i++){\n if(index==i)\n brr[i]-=complete;\n else\n brr[i]-=other;\n }\n list=new ArrayList<Integer>();\n for(int a:brr)\n if(a>0)\n list.add(a);\n brr=new int[list.size()];\n for(int i=0;i<brr.length;i++)\n brr[i]=list.get(i);\n res++;\n }\n return res;\n }", "private boolean kcss(int[] i, long[] e, long y) {\n int I = i.length;\n long[] x = new long[I];\n while (true) {\n x[0] = ll(i[0]); // 1\n snapshot(i, 1, I, x); // 2\n if (Arrays.compare(x, e) != 0) { // 3\n sc(i[0], x[0]); // 3a\n return false; // 3a\n }\n if (sc(i[0], y)) return true; // 3b\n } // 3c\n }", "private static int solution2(String s) {\r\n int n = s.length();\r\n int ans = 0;\r\n for (int i = 0; i < n; i++)\r\n for (int j = i + 1; j <= n; j++)\r\n if (allUnique(s, i, j)) ans = Math.max(ans, j - i);\r\n return ans;\r\n }", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\r\n\t\tint n = sc.nextInt();\r\n\t\tint[] a = new int[n];\r\n\t\tfor(int i = 0; i < n; i++){\r\n\t\t\ta[i] = sc.nextInt();\r\n\t\t}\r\n\t\tint res = 0, p = 0, t = 0;\r\n\t\twhile(true){\r\n\t\t\tp = 0; t = 0;\r\n\t\t\tfor(int i = 0; i < a.length; i++){\r\n\t\t\t\t\r\n\t\t\t\tif(i == a.length-1){\r\n\t\t\t\t\ta[i] /= 2;\r\n\t\t\t\t\tt = a[i];\r\n\t\t\t\t\ta[i] += p;\r\n\t\t\t\t\tp = t;\r\n\t\t\t\t\ta[0] += p;\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\ta[i] /= 2;\r\n\t\t\t\t\tt = a[i];\r\n\t\t\t\t\ta[i] += p;\r\n\t\t\t\t\tp = t;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tboolean flag = true;\r\n\t\t\tint temp = a[0];\r\n\t\t\tfor(int j = 1; j < a.length; j++){\r\n\t\t\t\tif(a[j] != temp){\r\n\t\t\t\t\tflag = false;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(flag){\r\n\t\t\t\tSystem.out.println(res);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tfor(int j = 0; j < a.length; j++){\r\n\t\t\t\tif(a[j] % 2 != 0){\r\n\t\t\t\t\ta[j] += 1;\r\n\t\t\t\t\tres++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private static long find_fast(long u)\n {\n long a, b, r;\n long maxUInt = 4294967295L;\n\n u += 0xe91aaa35;\n u = maxUInt % u;\n u ^= u >> 16;\n u = maxUInt % u;\n u += u << 8;\n u = maxUInt % u;\n u ^= u >> 4;\n u = maxUInt % u;\n b = (u >> 8) & 0x1ff;\n b = maxUInt % b;\n a = (u + (u << 2)) >> 19;\n a = maxUInt % a;\n r = a ^ hash_adjust[(int)b];\n r = maxUInt % r;\n return r;\n }", "public void a()\r\n/* 49: */ {\r\n/* 50: 64 */ HashSet<BlockPosition> localHashSet = Sets.newHashSet();\r\n/* 51: */ \r\n/* 52: 66 */ int m = 16;\r\n/* 53: 67 */ for (int n = 0; n < 16; n++) {\r\n/* 54: 68 */ for (int i1 = 0; i1 < 16; i1++) {\r\n/* 55: 69 */ for (int i2 = 0; i2 < 16; i2++) {\r\n/* 56: 70 */ if ((n == 0) || (n == 15) || (i1 == 0) || (i1 == 15) || (i2 == 0) || (i2 == 15))\r\n/* 57: */ {\r\n/* 58: 74 */ double d1 = n / 15.0F * 2.0F - 1.0F;\r\n/* 59: 75 */ double d2 = i1 / 15.0F * 2.0F - 1.0F;\r\n/* 60: 76 */ double d3 = i2 / 15.0F * 2.0F - 1.0F;\r\n/* 61: 77 */ double d4 = Math.sqrt(d1 * d1 + d2 * d2 + d3 * d3);\r\n/* 62: */ \r\n/* 63: 79 */ d1 /= d4;\r\n/* 64: 80 */ d2 /= d4;\r\n/* 65: 81 */ d3 /= d4;\r\n/* 66: */ \r\n/* 67: 83 */ float f2 = this.i * (0.7F + this.d.rng.nextFloat() * 0.6F);\r\n/* 68: 84 */ double d6 = this.e;\r\n/* 69: 85 */ double d8 = this.f;\r\n/* 70: 86 */ double d10 = this.g;\r\n/* 71: */ \r\n/* 72: 88 */ float f3 = 0.3F;\r\n/* 73: 89 */ while (f2 > 0.0F)\r\n/* 74: */ {\r\n/* 75: 90 */ BlockPosition localdt = new BlockPosition(d6, d8, d10);\r\n/* 76: 91 */ Block localbec = this.d.getBlock(localdt);\r\n/* 77: 93 */ if (localbec.getType().getMaterial() != Material.air)\r\n/* 78: */ {\r\n/* 79: 94 */ float f4 = this.h != null ? this.h.a(this, this.d, localdt, localbec) : localbec.getType().a((Entity)null);\r\n/* 80: 95 */ f2 -= (f4 + 0.3F) * 0.3F;\r\n/* 81: */ }\r\n/* 82: 98 */ if ((f2 > 0.0F) && ((this.h == null) || (this.h.a(this, this.d, localdt, localbec, f2)))) {\r\n/* 83: 99 */ localHashSet.add(localdt);\r\n/* 84: */ }\r\n/* 85:102 */ d6 += d1 * 0.300000011920929D;\r\n/* 86:103 */ d8 += d2 * 0.300000011920929D;\r\n/* 87:104 */ d10 += d3 * 0.300000011920929D;\r\n/* 88:105 */ f2 -= 0.225F;\r\n/* 89: */ }\r\n/* 90: */ }\r\n/* 91: */ }\r\n/* 92: */ }\r\n/* 93: */ }\r\n/* 94:111 */ this.j.addAll(localHashSet);\r\n/* 95: */ \r\n/* 96:113 */ float f1 = this.i * 2.0F;\r\n/* 97: */ \r\n/* 98:115 */ int i1 = MathUtils.floor(this.e - f1 - 1.0D);\r\n/* 99:116 */ int i2 = MathUtils.floor(this.e + f1 + 1.0D);\r\n/* 100:117 */ int i3 = MathUtils.floor(this.f - f1 - 1.0D);\r\n/* 101:118 */ int i4 = MathUtils.floor(this.f + f1 + 1.0D);\r\n/* 102:119 */ int i5 = MathUtils.floor(this.g - f1 - 1.0D);\r\n/* 103:120 */ int i6 = MathUtils.floor(this.g + f1 + 1.0D);\r\n/* 104:121 */ List<Entity> localList = this.d.b(this.h, new AABB(i1, i3, i5, i2, i4, i6));\r\n/* 105:122 */ Vec3 localbrw = new Vec3(this.e, this.f, this.g);\r\n/* 106:124 */ for (int i7 = 0; i7 < localList.size(); i7++)\r\n/* 107: */ {\r\n/* 108:125 */ Entity localwv = (Entity)localList.get(i7);\r\n/* 109:126 */ if (!localwv.aV())\r\n/* 110: */ {\r\n/* 111:129 */ double d5 = localwv.f(this.e, this.f, this.g) / f1;\r\n/* 112:131 */ if (d5 <= 1.0D)\r\n/* 113: */ {\r\n/* 114:132 */ double d7 = localwv.xPos - this.e;\r\n/* 115:133 */ double d9 = localwv.yPos + localwv.getEyeHeight() - this.f;\r\n/* 116:134 */ double d11 = localwv.zPos - this.g;\r\n/* 117: */ \r\n/* 118:136 */ double d12 = MathUtils.sqrt(d7 * d7 + d9 * d9 + d11 * d11);\r\n/* 119:137 */ if (d12 != 0.0D)\r\n/* 120: */ {\r\n/* 121:141 */ d7 /= d12;\r\n/* 122:142 */ d9 /= d12;\r\n/* 123:143 */ d11 /= d12;\r\n/* 124: */ \r\n/* 125:145 */ double d13 = this.d.a(localbrw, localwv.getAABB());\r\n/* 126:146 */ double d14 = (1.0D - d5) * d13;\r\n/* 127:147 */ localwv.receiveDamage(DamageSource.a(this), (int)((d14 * d14 + d14) / 2.0D * 8.0D * f1 + 1.0D));\r\n/* 128: */ \r\n/* 129:149 */ double d15 = EnchantmentProtection.a(localwv, d14);\r\n/* 130:150 */ localwv.xVelocity += d7 * d15;\r\n/* 131:151 */ localwv.yVelocity += d9 * d15;\r\n/* 132:152 */ localwv.zVelocity += d11 * d15;\r\n/* 133:154 */ if ((localwv instanceof EntityPlayer)) {\r\n/* 134:155 */ this.k.put((EntityPlayer)localwv, new Vec3(d7 * d14, d9 * d14, d11 * d14));\r\n/* 135: */ }\r\n/* 136: */ }\r\n/* 137: */ }\r\n/* 138: */ }\r\n/* 139: */ }\r\n/* 140: */ }", "public static int solution(int[] arr) {\n int n = arr.length;\n for (int i = 0; i < n; i++) {\n while (arr[i] != i + 1 && arr[i] < n && arr[i] > 0) {\n int temp = arr[i];\n if (temp == arr[temp - 1])\n break;\n arr[i] = arr[temp - 1];\n arr[temp - 1] = temp;\n }\n }\n for (int i = 0; i < n; i++)\n if (arr[i] != i + 1)\n return i + 1;\n return n + 1;\n }", "public List<List<Integer>> threeSum(int[] nums) {\n List<List<Integer>> result = new ArrayList<>(nums.length);\n\n // Prepare\n Arrays.sort(nums);\n// int firstPositiveIndex = 0;\n// int negativeLength = 0;\n// List<Integer> numsFiltered = new ArrayList<>();\n// for (int i = 0; i < nums.length; i++) {\n// if (i == 0 || i == 1 || nums[i] == 0 || (nums[i] != nums[i-2])) {\n// numsFiltered.add(nums[i]);\n// if ((nums[i] >= 0) && (firstPositiveIndex == 0)) {\n// firstPositiveIndex = numsFiltered.size() - 1;\n// }\n// if ((nums[i] <= 0)) {\n// negativeLength = numsFiltered.size();\n// }\n// }\n// }\n// nums = numsFiltered.stream().mapToInt(i->i).toArray();\n\n // Func\n\n for(int i=0; (i < nums.length) && (nums[i] <= 0); i++) {\n if (i != 0 && nums[i] == nums[i-1]) {\n continue;\n }\n for(int j=i+1; j<nums.length; j++) {\n if (j != i+1 && nums[j] == nums[j-1]) {\n continue;\n }\n for(int k=nums.length-1; (k>j) && nums[k] >= 0; k--) {\n if (k != nums.length-1 && nums[k] == nums[k+1]) {\n continue;\n }\n int sum = nums[i]+nums[j]+nums[k];\n if (sum > 0) {\n continue;\n } else if (sum < 0) {\n break;\n }\n\n List<Integer> ok = new ArrayList<>();\n ok.add(nums[i]);\n ok.add(nums[j]);\n ok.add(nums[k]);\n result.add(ok);\n break;\n }\n }\n }\n\n// System.out.println(\"Finish time = \" + (System.nanoTime() - start) / 1_000_000);\n// System.out.println(\"result size = \" + result.size());\n\n return result;\n }", "public int get_odd_occurences_optimal_v2(int[] a) {\n\t\tint result = 0;\n\t\tfor (int i = 0; i < a.length; i++) {\n\t\t\tresult ^= i;\n\t\t}\n\t\treturn result;\n\t}", "public void sum2(int n){\n int sum =0; //1\n for (int j = 0; j < n; j++) //2n+2\n for (int k = 0; k < n; k++) //2n+2\n sum += k + j; //1\n for (int l = 0; l < n; l++) //2n+2\n sum += l; //1\n }", "public static boolean canThreePartsEqualSum(int[] arr) {\n int sum=0;\n int cumulative[]=new int[arr.length];\n for(int i=0;i<arr.length;i++){\n sum+=arr[i];\n cumulative[i]=sum;\n }\n for(int i=0;i<cumulative.length;i++){\n for(int j=i+1;j<cumulative.length;j++){\n if(cumulative[i]==cumulative[j]-cumulative[i]){\n if(cumulative[i]==cumulative[cumulative.length-1]-cumulative[j] && (cumulative.length-1) !=j){\n return true;\n }\n }\n }\n }\n return false;\n}", "private int m3423z(int i, int i2) {\n int i3;\n int i4;\n for (int size = this.f4373c.size() - 1; size >= 0; size--) {\n C0933b bVar = this.f4373c.get(size);\n int i5 = bVar.f4379a;\n if (i5 == 8) {\n int i6 = bVar.f4380b;\n int i7 = bVar.f4382d;\n if (i6 < i7) {\n i4 = i6;\n i3 = i7;\n } else {\n i3 = i6;\n i4 = i7;\n }\n if (i < i4 || i > i3) {\n if (i < i6) {\n if (i2 == 1) {\n bVar.f4380b = i6 + 1;\n bVar.f4382d = i7 + 1;\n } else if (i2 == 2) {\n bVar.f4380b = i6 - 1;\n bVar.f4382d = i7 - 1;\n }\n }\n } else if (i4 == i6) {\n if (i2 == 1) {\n bVar.f4382d = i7 + 1;\n } else if (i2 == 2) {\n bVar.f4382d = i7 - 1;\n }\n i++;\n } else {\n if (i2 == 1) {\n bVar.f4380b = i6 + 1;\n } else if (i2 == 2) {\n bVar.f4380b = i6 - 1;\n }\n i--;\n }\n } else {\n int i8 = bVar.f4380b;\n if (i8 <= i) {\n if (i5 == 1) {\n i -= bVar.f4382d;\n } else if (i5 == 2) {\n i += bVar.f4382d;\n }\n } else if (i2 == 1) {\n bVar.f4380b = i8 + 1;\n } else if (i2 == 2) {\n bVar.f4380b = i8 - 1;\n }\n }\n }\n for (int size2 = this.f4373c.size() - 1; size2 >= 0; size2--) {\n C0933b bVar2 = this.f4373c.get(size2);\n if (bVar2.f4379a == 8) {\n int i9 = bVar2.f4382d;\n if (i9 == bVar2.f4380b || i9 < 0) {\n this.f4373c.remove(size2);\n mo7620a(bVar2);\n }\n } else if (bVar2.f4382d <= 0) {\n this.f4373c.remove(size2);\n mo7620a(bVar2);\n }\n }\n return i;\n }", "private static long f(long m) {\n\t\tlong k = 1;\r\n\t\tfor (long i=1; i<=m; i++){\r\n\t\t\tk *= i;\r\n\t\t}\r\n\t\treturn k;\r\n\t}", "static int countWaysUtil(int n, int m) \n\t { \n\t int res[] = new int[n]; \n\t res[0] = 1; res[1] = 1; \n\t for (int i=2; i<n; i++) \n\t { \n\t res[i] = 0; \n\t for (int j=1; j<=m && j<=i; j++) \n\t res[i] += res[i-j]; \n\t } \n\t return res[n-1]; \n\t }", "static int[] find2(int a[]){\r\n int sum = a[0];\r\n int pro = a[0];\r\n for(int i=1;i<a.length;i++){\r\n sum += a[i];\r\n pro += a[i]*a[i];\r\n }\r\n int s = (n*(n+1))/2 - sum;\r\n int p = (n*(n+1)*(2*n+1))/6 - pro;\r\n return solveSP(s, p);\r\n }", "static int countSubarrWithEqualZeroAndOne(int arr[], int n)\n {\n int count=0;\n int currentSum=0;\n HashMap<Integer,Integer> mp=new HashMap<>();\n for(int i=0;i<arr.length;i++)\n {\n if(arr[i]==0)\n arr[i]=-1;\n currentSum+=arr[i];\n \n if(currentSum==0)\n count++;\n if(mp.containsKey(currentSum))\n count+=mp.get(currentSum);\n if(!mp.containsKey(currentSum))\n mp.put(currentSum,1);\n else\n mp.put(currentSum,mp.get(currentSum)+1);\n \n \n }\n return count;\n }", "public ArrayList<Edge> Prim (String s){\n Node Start = nodeMap.get(s);\n mst = new ArrayList<>();\n HashMap<String, String> inserted = new HashMap<String, String>();\n ArrayList<Edge> failed = new ArrayList<Edge>();\n PriorityQueue<Edge> pq = new PriorityQueue<Edge>();\n ArrayList<Edge> ed = new ArrayList<Edge>(edgeMap.values());\n Edge first = ed.get(0);\n mst.add(first);\n inserted.put(first.w, first.w);\n inserted.put(first.v, first.v);\n\n priorityEdgeInsert(pq, first);\n\n while (inserted.size() <= edges() && pq.size() != 0){ //O(E log(V))\n //runs for E checking the possible V, where the number of V is devided each time, or log(V), giving ELog(V)\n Edge e = pq.poll();\n String w = inserted.get(e.w);\n String v = inserted.get(e.v);\n\n if ((w == null) ^ (v == null)){\n priorityEdgeInsert(pq, e);\n for(Edge f : failed){\n if(f.v == e.v || f.v == e.w || f.w == e.v || f.w == e.w){\n\n }\n else{\n pq.add(f);\n }\n }\n failed.clear();\n mst.add(e);\n inserted.put(e.w, e.w); //only puts one, the null one is hashed to a meaningless spot\n inserted.put(e.v, e.v);\n }\n else if ((w == null) && (v == null) ){\n failed.add(e);\n }\n else if (!(w == null) && !(v == null) ){\n failed.remove(e);\n pq.remove(e);\n }\n else if (e == null){\n System.out.println(\"HOW?\"); //should never happen.\n }\n }\n return mst;\n }", "@Test\n\tpublic void intersection() {\n\n\t\tlong n = 105;\n\t\tlong m = 100;\n\t\tfor(long i = n - 1; i > 1; i--){\n\t\t\tn = n * i;\n\t\t\tfor(long j = getZero(n); j > 0; j--){\n\t\t\t\tm = m * 10;\n\t\t\t}\n\t\t\tn = n % m;\n\t\t\tm = 100;\n\n\t\t\tSystem.out.println(n+\" \"+i);\n\n\t\t}\n\n\n\n\n\n\t}", "private static int[] p2(int[] ar, int n) {\n int[] p2 = new int[n];\n Arrays.fill(p2, n);\n Stack<Integer> st = new Stack<>();\n for (int i = 0; i < n; i++) {\n while (st.size() != 0 && ar[i] < ar[st.peek()]) {\n p2[st.peek()] = i;\n st.pop();\n }\n st.push(i);\n }\n return p2;\n }", "public static void main(String[] args) throws IOException {\n int max = 100000;\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\n N = Integer.parseInt(br.readLine());\n\n int arr[] = new int[max+1];\n\n for (int p=2; p<=99999; p++)\n {\n if (arr[p] == 0)\n { arr[p] = 1;\n for (int i=p*2; i<=max; i += p) {\n arr[i]++;\n }\n }\n }\n\n int mat[][] = new int[6][max+1];\n// for (int i = 2; i < arr.length; i++) {\n// mat[arr[i]][i] = 1;\n// }\n\n for (int i = 1; i < 6; i++) {\n for (int j = 2; j < mat[0].length; j++) {\n if(arr[j] == i) {\n mat[i][j] = mat[i][j - 1]+1;\n } else {\n mat[i][j] = mat[i][j - 1];\n }\n }\n }\n\n\n for (int i = 0; i < N; i++) {\n String str[] = br.readLine().split(\" \");\n int a = Integer.parseInt(str[0]);\n int b = Integer.parseInt(str[1]);\n int k = Integer.parseInt(str[2]);\n int ans = mat[k][b]-mat[k][a-1];\n System.out.println(ans);\n }\n }", "private int rs(final int x) {\n assert(! leaf(x));\n return Math.min(2*x+2, n);\n }", "public static boolean find3Numbers(int A[], int n, int X) { \n \n // Your code \n for(int i=0;i<n-2;i++)\n {\n HashSet<Integer> set = new HashSet<>();\n int toFind=X-A[i];\n for(int j=i+1;j<n;j++)\n {\n if(set.contains(toFind-A[j]))\n {\n return true;\n }\n set.add(A[j]);\n }\n }\n return false;\n }", "private static int solve(int[] arr, int length) {\n\tint i =0,j;\n\tint extremum = 0;\n\t\n\tfor(j=i;j<length;){\n\t\tif(arr[i]==arr[j]){\n\t\t\tif((j==length-1) && ((arr[j]>arr[i-1])||(arr[j]<arr[i-1])))\n\t\t\t\textremum++;\n\t\t\tj++;\n\t\t\tcontinue;\n\t\t}\n\t\t\t\n\t\telse if((i==0 && ((arr[j]>arr[i])||(arr[j]<arr[i])))){\n\t\t\textremum ++;\n\t\t}\n\t\t\t\n\t\telse if((arr[i-1]>arr[i])&&(arr[j]>arr[j-1])){\n\t\t\textremum++;\n\t\t}\n\t\t\t\n\t\telse if((arr[i-1]<arr[i])&&(arr[j]<arr[j-1])){\n extremum++;\n\t\t}\n\t\t\n\t i = j;\n\t\t\t\n\t}\n\t\n\treturn extremum;\n}", "static int solve(int n) \n\t{ \n\t // base case \n\t if (n < 0) \n\t return 0; \n\t if (n == 0) \n\t return 1; \n\t \n\t return solve(n-1) + solve(n-3) + solve(n-5); \n\t}", "public static ArrayList<ArrayList<Integer>> fourSum(ArrayList<Integer> a, int k) {\n Collections.sort(a);\n System.out.println(a);\n LinkedHashMap<Integer, List<List<Integer>>> m = new LinkedHashMap<Integer, List<List<Integer>>>();\n for (int i = 0; i <= a.size() - 3; i++) {\n for (int j = i + 1; j <= a.size() - 2; j++) {\n if (m.get(a.get(i) + a.get(j)) == null) {\n ArrayList<List<Integer>> v = new ArrayList<List<Integer>>();\n List<Integer> c = new ArrayList<Integer>();\n c.add(i);\n c.add(j);\n v.add(c);\n m.put(a.get(i) + a.get(j), v);\n } else {\n List<List<Integer>> v = m.get(a.get(i) + a.get(j));\n List<Integer> c = new ArrayList<Integer>();\n c.add(i);\n c.add(j);\n v.add(c);\n m.put(a.get(i) + a.get(j), v);\n }\n\n }\n }\n LinkedHashSet<ArrayList<Integer>> res = new LinkedHashSet<ArrayList<Integer>>();\n for (int i = 2; i <= a.size() - 1; i++) {\n for (int j = i + 1; j < a.size(); j++) {\n List<List<Integer>> v = m.get(k - (a.get(i) + a.get(j)));\n if (v != null && v.size() >= 1) {\n for (List<Integer> l : v) {\n\n if (l.get(0) < l.get(1) && l.get(1) < i && l.get(1) < j) {\n //System.out.println(l.get(0) + \" \" + l.get(1) + \" \" + i + \" \" + j);\n ArrayList<Integer> out = new ArrayList<Integer>();\n out.add(a.get(l.get(0)));\n out.add(a.get(l.get(1)));\n out.add(a.get(i));\n out.add(a.get(j));\n Collections.sort(out);\n //System.out.println(out);\n res.add(out);\n }\n }\n }\n }\n }\n return new ArrayList<ArrayList<Integer>>(res);\n }", "public static void main(String[] args){\n int s = 80;\n int n = (int) Math.pow(10, 7);\n Integer[] a = new Integer[n];\n Random rand = new Random();\n for (int i = 0; i < n; i++){\n a[i] = (int) (n*rand.nextDouble());\n }\n double binTime = binSearchT(s, a);\n double linTime = linSearchT(s, a);\n System.out.println(\"binTime: \"+ binTime);\n System.out.println(\"linTime: \"+ linTime);\n\n }", "private int bepaalByes(int[] arr, int n) {\r\n\t\tint tot = 0;\r\n\t\tfor (int v : arr)\r\n\t\t\ttot += v;\r\n\t\treturn (tot - n);\r\n\t}", "static int LCS(int arr[])\n {\n int size = arr.length;\n int max_so_far = Integer.MIN_VALUE, max_ending_here = 0;\n\n for (int i = 0; i < size; i++)\n {\n max_ending_here = max_ending_here + arr[i];\n if (max_so_far < max_ending_here)\n max_so_far = max_ending_here;\n if (max_ending_here < 0)\n max_ending_here = 0;\n }\n return max_so_far;\n }", "private int hashFunc2(String word) {\n int hashVal = word.hashCode();\n hashVal = hashVal % arraySize;\n\n if (hashVal < 0) {\n hashVal += arraySize;\n }\n\n // Research shows that you can use a Prime number Less than the array size to calculate the step value.\n // Prime Number 3 arbitrarily chosen.\n return 3 - hashVal % 3;\n }", "static int[] productExceptSelfSpaceOptimized(int[] nums) {\n int n = nums.length;\n int[] result = new int[n];\n Arrays.fill(result, 1);\n int curr = 1;\n\n for (int i = 0; i < n; i++) {\n result[i] *= curr;\n curr *= nums[i];\n }\n\n curr = 1;\n for (int i = n - 1; i >= 0; i--) {\n result[i] *= curr;\n curr *= nums[i];\n }\n\n return result;\n }", "public int findLatestStep(int[] arr, int m) {\n int last = -1 ;\n Set<Integer> list = new HashSet<>();\n int n = arr.length;\n int num = 1;\n for (int i = 0; i < n; i++) {\n num <<= 1;\n }\n for (int i = 0; i < arr.length; i++) {\n int tmp = arr[i];\n\n int con = move(tmp);\n num = num|con;\n\n int copy = num;\n\n list = check(copy,n);\n\n for (int x :\n list) {\n if (x == m)\n last = i+1;\n }\n\n\n }\n return last;\n\n }", "public int findLHSWithHashtable(int[] nums) {\n if (nums.length < 2)\n return 0;\n int ans = 0;\n Map<Integer, Integer> map = new HashMap<>();\n for (int i = 0; i < nums.length; i++) {\n map.put(nums[i], map.getOrDefault(nums[i], 0) + 1);\n }\n for (int key : map.keySet()) {\n if (map.containsKey(key - 1))\n ans = ans < map.get(key) + map.get(key - 1) ? map.get(key) + map.get(key - 1) : ans;\n if (map.containsKey(key + 1))\n ans = ans < map.get(key) + map.get(key + 1) ? map.get(key) + map.get(key + 1) : ans;\n }\n return ans;\n }", "public static long solve(long[] data, long k) {\n int n = data.length;\n\n Buffer<Interval> buffer = new Buffer<>(Interval::new, x -> {}, n * 2);\n\n Randomized.shuffle(data);\n Arrays.sort(data);\n\n List<Interval> lastLevel = new ArrayList<>(n);\n List<Interval> curLevel = new ArrayList<>(n);\n lastLevel.add(newInterval(buffer, 0, n - 1));\n int level = Log2.floorLog(data[n - 1]);\n long mask = 0;\n for (; level >= 0; level--) {\n curLevel.clear();\n for (Interval interval : lastLevel) {\n int l = interval.l;\n int r = interval.r;\n int m = r;\n while (m >= l && Bits.get(data[m], level) == 1) {\n m--;\n }\n interval.m = m;\n }\n long total = 0;\n for (Interval interval : lastLevel) {\n total += (long) (interval.m - interval.l + 1) * (interval.relative.m - interval.relative.l + 1);\n total += (long) (interval.r - interval.m) * (interval.relative.r - interval.relative.m);\n }\n if (total < k) {\n k -= total;\n mask = Bits.set(mask, level, true);\n for (Interval interval : lastLevel) {\n if (interval.relative == interval) {\n if (interval.l <= interval.m && interval.m < interval.r) {\n Interval a = newInterval(buffer, interval.l, interval.m);\n Interval b = newInterval(buffer, interval.m + 1, interval.r);\n a.relative = b;\n b.relative = a;\n curLevel.add(a);\n curLevel.add(b);\n }\n } else if (interval.r >= interval.relative.r) {\n if (interval.l <= interval.m && interval.relative.r > interval.relative.m) {\n Interval a = newInterval(buffer, interval.l, interval.m);\n Interval b = newInterval(buffer, interval.relative.m + 1, interval.relative.r);\n a.relative = b;\n b.relative = a;\n curLevel.add(a);\n curLevel.add(b);\n }\n if (interval.m < interval.r && interval.relative.m >= interval.relative.l) {\n Interval a = newInterval(buffer, interval.m + 1, interval.r);\n Interval b = newInterval(buffer, interval.relative.l, interval.relative.m);\n a.relative = b;\n b.relative = a;\n curLevel.add(a);\n curLevel.add(b);\n }\n }\n }\n } else {\n for (Interval interval : lastLevel) {\n if (interval.relative == interval) {\n if (interval.l <= interval.m) {\n Interval a = newInterval(buffer, interval.l, interval.m);\n a.relative = a;\n curLevel.add(a);\n }\n if (interval.m < interval.r) {\n Interval a = newInterval(buffer, interval.m + 1, interval.r);\n a.relative = a;\n curLevel.add(a);\n }\n } else if (interval.r >= interval.relative.r) {\n if (interval.l <= interval.m && interval.relative.l <= interval.relative.m) {\n Interval a = newInterval(buffer, interval.l, interval.m);\n Interval b = newInterval(buffer, interval.relative.l, interval.relative.m);\n a.relative = b;\n b.relative = a;\n curLevel.add(a);\n curLevel.add(b);\n }\n if (interval.m < interval.r && interval.relative.m < interval.relative.r) {\n Interval a = newInterval(buffer, interval.m + 1, interval.r);\n Interval b = newInterval(buffer, interval.relative.m + 1, interval.relative.r);\n a.relative = b;\n b.relative = a;\n curLevel.add(a);\n curLevel.add(b);\n }\n }\n }\n }\n\n for (Interval interval : lastLevel) {\n buffer.release(interval);\n }\n\n List<Interval> tmp = curLevel;\n curLevel = lastLevel;\n lastLevel = tmp;\n }\n\n return mask;\n }", "public static boolean addUpToFast(int[] array, int n){\n\t\tHashSet<Integer> hs = new HashSet<Integer>();\n\t\tfor(int i = 0; i < array.length; i++){\n\t\t\tif(hs.contains(n-array[i]))\n\t\t\t\treturn true;\n\t\t\ths.add(array[i]);\n\t\t}\n\t\treturn false;\n\t}", "private int getIndex2(int val){\n return val/bucket;\n }", "public static int f3(int N) {\n \n // O(1)\n if (N == 0) return 1;\n else{ \n \n int x = 0;\n // O(N)\n for(int i = 0; i < N; i++)\n x += f3(N-1);\n return x;\n }\n }", "private void start(Substring sub) {\n\t\tint i=0,j=0,k=0,l=0,m=0,n=0,sum=sub.n;\n\t\tfor(i=1;i<sub.n;i++)\n\t\t{\n\t\t\tfor(j=0,l=i;l<sub.n;j++,l++)\n\t\t\t{\n\t\t\t\t//HashMap<Integer,Integer> map=new HashMap<Integer,Integer>();\n\t\t\t\tint[]count=new int[10000];\n\t\t\t\t\t\tfor(m=j;m<=l;m++) {\n\t\t\t\t\t\t\tcount[sub.arr[m]]++;\n\t\t\t\t\t\t\tif(count[sub.arr[m]]<=1) {continue;}\n\t\t\t\t\t\t\telse break;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\tif(m==l+1)sum=sum+i+1;\t\t\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t\t\n\t}", "public int singles(int [] arr){\n HashMap<Integer, Integer> hm = new HashMap<>();\n long s1 = 0, s2 = 0;\n for(int x = 0; x < arr.length; x++){\n if(!hm.containsKey(arr[x])){\n s1 += arr[x];\n hm.put(arr[x], 1);\n }\n s2 += arr[x];\n }\n return (int)(2* s1 - s2);\n }", "public static long sb(long a[], long n, long x) {\n long len = Long.MAX_VALUE;\n int p1 = 0;\n int p2 = 0;\n long sum = 0l;\n while(p1<=p2 && p2<n) {\n sum = sum + a[p2];\n p2++;\n while(sum >= x) {\n len = len > (p2-p1) ? (p2-p1) : len;\n sum = sum - a[p1];\n p1++;\n }\n }\n return len == Long.MAX_VALUE ? -1 : len;\n }", "private static boolean judge(int[] a) {\n\t\tint st = 1;\r\n\t\tint ed = a.length-2;\r\n\t\tint sa = 0;\r\n\t\tint sb = 0;\r\n\t\twhile (st<=ed) {\r\n\t\t\tif(a[st]>a[ed]){\r\n\t\t\t\tsa+=a[st];\r\n\t\t\t\tst++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tsa+=a[ed];\r\n\t\t\t\ted--;\r\n\t\t\t}\r\n\t\t\tif(st>ed)break;\r\n\t\t\tif(a[st]>a[ed]){\r\n\t\t\t\tsb+=a[st];\r\n\t\t\t\tst++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tsb+=a[ed];\r\n\t\t\t\ted--;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tif(sa>=sb)return true;\r\n\t\treturn false;\r\n\t}", "void solve() throws IOException {\n int[] nk = ril(2);\n int n = nk[0];\n int k = nk[1];\n int[] p = ril(n);\n int[] b = ril(k);\n for (int i = 0; i < n; i++) p[i]--;\n for (int i = 0; i < k; i++) b[i]--;\n\n int[] numToIdx = new int[n];\n for (int i = 0; i < n; i++) numToIdx[p[i]] = i;\n\n boolean[] remove = new boolean[n];\n Arrays.fill(remove, true);\n for (int bi : b) remove[bi] = false;\n List<Integer> toRemove = new ArrayList<>(n - k);\n for (int i = 0; i < n; i++) if (remove[i]) toRemove.add(i);\n Collections.sort(toRemove);\n\n int[] prevSmaller = new int[n];\n prevSmaller[0] = -1;\n int prevIdx = remove[p[0]] ? -1 : 0;\n for (int i = 1; i < n; i++) {\n int j = prevIdx;\n while (j != -1 && p[i] < p[j]) j = prevSmaller[j];\n prevSmaller[i] = j;\n if (!remove[p[i]]) prevIdx = i;\n }\n int[] nextSmaller = new int[n];\n nextSmaller[n-1] = n;\n prevIdx = remove[p[n-1]] ? n : n-1;\n for (int i = n-2; i >= 0; i--) {\n int j = prevIdx;\n while (j != n && p[i] < p[j]) j = nextSmaller[j];\n nextSmaller[i] = j;\n if (!remove[p[i]]) prevIdx = i;\n }\n\n int[] init = new int[n];\n Arrays.fill(init, 1);\n SegmentTree st = new SegmentTree(init);\n long ans = 0;\n for (int x : toRemove) {\n int idx = numToIdx[x];\n int l = prevSmaller[idx] + 1;\n int r = nextSmaller[idx] - 1;\n ans += st.query(l, r+1);\n st.modify(idx, 0);\n }\n pw.println(ans);\n }", "public static void main(String[] args) {\nScanner s=new Scanner(System.in);\nint n=s.nextInt();\nint a[]=new int[n];\nint x=0;\nfor(int i=1;i<=n;i++)\n{\n\tif(i%2!=0)\n\t{\n\t\ta[x++]=i;\n\t}\n}\nint sum=0;\nsum=a[0];\nfor(int i=0;i<x;i++)\n{\n\tif((i+1)<x)\n\t{\n\tif(i%2==0)\n\t\tsum=sum+a[i+1];\n\telse\n\t\tsum=sum-a[i+1];\n\t}\n}\nSystem.out.println(sum);\n\t}", "public static void main(String[] args){\n int MIN = Integer.parseInt(args[0]);\n MAX = Integer.parseInt(args[1]);\n cutoffs = new int[args.length - 2];\n cache = new ArrayList<IndexedArrayList<SuperSavvyTrieHelper2>>();\n for (int i = 2; i < args.length; i++){\n cutoffs[i - 2] = Integer.parseInt(args[i]);\n cache.add(new IndexedArrayList<SuperSavvyTrieHelper2>());\n }\n for (int i = 0; i < cutoffs.length / 2; i++){\n int temp = cutoffs[i];\n cutoffs[i] = cutoffs[cutoffs.length - 1 - i];\n cutoffs[cutoffs.length - 1 - i] = temp;\n }\n multiplicitiesUsed = new boolean[MAX + 1];\n basesUsed = new DoublyLinkedArray(MAX + 1);\n SuperSavvyTrieHelper2.setCorrespondance(basesUsed);\n /*\n long count1 = lowerRecursion(MAX, 0);\n long count2 = middleRecursion(MAX, 0);\n long count3 = upperRecursion(MAX, 0);\n long total = count1 + count2 + count3;\n System.out.printf(\"%d + %d + %d = %d\\n\", count1, count2, count3, total);\n */\n hitCounts = new long[cutoffs.length];\n missCounts = new long[cutoffs.length];\n statCollector = new StatCollector(cutoffs);\n\n long startTime = System.nanoTime();\n long[] values = new long[MAX - MIN + 1];\n for (int i = MIN; i <= MAX; i++) {\n values[i - MIN] = upperRecursionWrapper(i);\n }\n //long[] testValues = new long[] {1752443,1911046, 2067456,2249444,2429337, 2647532,2852449,3101167,3350292,3632299,3916575};\n for (int i = 0; i < values.length; i++){\n //if (testValues[i] != values[i]){\n System.out.printf(\"%d: %d\\n\", i + MIN, values[i]);\n //}\n }\n long endTime = System.nanoTime();\n System.out.printf(\"%f,\", (double)(endTime - startTime) / 1000000000.0);\n long totalMissCounts = 0;\n long totalMissWeight1 = 0;\n long totalMissWeight2 = 0;\n long totalMissWeight3 = 0;\n /*\n for (int i = 0; i < cutoffs.length; i++){\n long totalCounts = hitCounts[i] + missCounts[i];\n totalMissCounts += missCounts[i];\n totalMissWeight1 += missCounts[i] * cutoffs[i];\n totalMissWeight2 += (hitCounts[i] / missCounts[i]) * cutoffs[i];\n totalMissWeight3 += (hitCounts[i] - missCounts[i]) * cutoffs[i] * cutoffs[i];\n System.out.printf(\"\\tCache %d: %d/%d/%d (%.5f%%)\", cutoffs[i], hitCounts[i], missCounts[i], totalCounts, (double) hitCounts[i] / totalCounts);\n }\n System.out.printf(\"\\t\\tMissCounts: %d, weighted: %d, ratio: %d, diff^2: %d\\n\", totalMissCounts, totalMissWeight1, totalMissWeight2, totalMissWeight3);\n */\n statCollector.printAll();\n }", "private int getCondensedIndex(int n, int i, int j) {\n if (i < j) {\n return n * i - (i * (i + 1) / 2) + (j - i - 1);\n }\n else if (i > j) {\n return n * j - (j * (j + 1) / 2) + (i - j - 1);\n }\n else{\n return 0;\n }\n }", "private int helper(int[] a, int s, int e) {\n if (s == e) return a[s];\n int c1 = a[s] - helper(a, s + 1, e);\n int c2 = a[e] - helper(a, s, e - 1);\n return Math.max(c1, c2);\n }", "public static int distinctPaths4(int n) {\n\t\tint[][] mem = new int[n+1][n+1];\n\t\tfor(int j = 1; j <= n; ++j) {\n\t\t\tmem[1][j] = 1;\n\t\t\tmem[j][1] = 1;\n\t\t}\n\t\tfor(int i = 2; i <= n; ++i) {\n\t\t\tfor(int j = 2; j <= n; ++j) {\n\t\t\t\tmem[i][j] = mem[i-1][j] + mem[i][j-1];\n\t\t\t}\n\t\t}\n\t\treturn mem[n][n];\n\t}", "private static long calc1()\n {\n final int min = 1000;\n final int max = 10000;\n\n // initialize\n List<List<Integer>> m = new ArrayList<>();\n for (int k = 0; k < end; k++) {\n List<Integer> list = new ArrayList<Integer>();\n int n = 1;\n while (k >= start) {\n int p = pkn(k, n);\n if (p >= max) {\n break;\n }\n if (p >= min) {\n list.add(p);\n }\n n++;\n }\n m.add(list);\n }\n\n boolean[] arr = new boolean[end];\n arr[start] = true;\n\n List<Integer> solutions = new ArrayList<>();\n List<Integer> list = m.get(start);\n for (Integer first : list) {\n LinkedList<Integer> values = new LinkedList<>();\n values.add(first);\n f(m, arr, values, 1, solutions);\n // we stop at the first solution found\n if (!solutions.isEmpty()) {\n break;\n }\n }\n\n // solutions.stream().forEach(System.out::println);\n int res = solutions.stream().reduce(0, Integer::sum);\n return res;\n }", "private void go(int i) {\n\t\tcol[i] = 1;\r\n\t\tint j = f[i];\r\n\t\tint cnt = 0;\r\n\t\tint delAll = 0;\r\n\t\tint[][] cd = new int[1000][3];\r\n\t\tint sa = 0;\r\n\t\tint sb = 0;\r\n\t\tint m1 = Integer.MAX_VALUE;\r\n\t\tint m2 = Integer.MAX_VALUE;\r\n\t\tint m1a = 0;\r\n\t\tint m2a = 0;\r\n\t\tint m1b = 0;\r\n\t\tint m2b = 0;\r\n\t\twhile (j != -1) {\r\n\t\t\tif (col[e[j]] == 0) {\r\n\t\t\t\tgo(e[j]);\r\n\t\t\t\tdelAll += a[e[j]];\r\n\t\t\t\tint dif = b[e[j]] - a[e[j]];\r\n\t\t\t\tif (dif < m1) {\r\n\t\t\t\t\tm2 = m1;\r\n\t\t\t\t\tm2b = m1b;\r\n\t\t\t\t\tm2a = m1a;\r\n\t\t\t\t\tm1 = dif;\r\n\t\t\t\t\tm1a = a[e[j]];\r\n\t\t\t\t\tm1b = b[e[j]];\r\n\t\t\t\t} else if (dif < m2) {\r\n\t\t\t\t\tm2 = dif;\r\n\t\t\t\t\tm2a = a[e[j]];\r\n\t\t\t\t\tm2b = b[e[j]];\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tsa += a[e[j]];\r\n\t\t\t\tsb += a[e[j]];\r\n\t\t\t\tcd[cnt][0] = a[e[j]];\r\n\t\t\t\tcd[cnt][1] = b[e[j]];\r\n\t\t\t\tcd[cnt][2] = b[e[j]] - a[e[j]];\r\n\t\t\t\tcnt++;\r\n\t\t\t}\r\n\t\t\tj = next[j];\r\n\t\t}\r\n\t\tif (cnt == 0) {\r\n\t\t\ta[i] = 1;\r\n\t\t\tb[i] = 0;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tArrays.sort(cd, new Comparator<int[]>() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic int compare(int[] o1, int[] o2) {\r\n\t\t\t\t// TODO Auto-generated method stub\t\t\t\t\r\n\t\t\t\treturn o1[2] - o2[2];\r\n\t\t\t}\r\n\t\t});\r\n\t\ta[i] = delAll + 1;\r\n\t\t//leave 0 or 2\r\n\t\tint cost1 = 0;\r\n\t\tint cost = 0;\r\n\t\tfor (j = 2; j < cnt; j++)\r\n\t\t\tcost1 += cd[j][0];\r\n\t\tif (cnt >= 2) {\r\n\t\t\tcost += m1b + m2b + sa - m1a - m2a;\r\n\t\t\tcost1 += cd[0][1] + cd[1][1];\r\n\t\t} else {\r\n\t\t\tcost += sa;\r\n\t\t\tcost1 += cd[0][0];\r\n\t\t}\r\n\t\tif (cost1 != cost)\r\n\t\t\tSystem.err.println(\"FUCK\");\r\n\t\tb[i] = cost;\r\n\t}", "private int gameV(int i, int j, int x) {\n int count = 2;\n for (int ii = 0; ii < i; ii++) {\n for (int jj = ii + 1; jj < n; jj++) {\n if (ii != x && jj != x) count++;\n }\n }\n for (int jj = i + 1; jj < j; jj++) {\n if (jj != x) count++;\n }\n return count;\n }", "public boolean containsNearbyAlmostDuplicate(int[] nums, int k, int t) {\n if (t < 0) return false;\n TreeSet<Long> set = new TreeSet<>();\n for (int i = 0; i < nums.length; ++i) {\n long num = (long)nums[i];\n Long floor = set.floor(num), ceiling = set.ceiling(num);\n if (floor != null && num - floor <= t || ceiling != null && ceiling - num <= t) return true;\n set.add(num);\n if (i >= k) set.remove((long)nums[i - k]);\n }\n return false;\n}", "public static long journeyToMoon(int n, List<List<Integer>> astronaut) {\n // Write your code here\n Map<Integer, Node<Integer>> countryMap = new HashMap<>();\n for(List<Integer> pairs: astronaut) {\n Node<Integer> node1 = countryMap.computeIfAbsent(pairs.get(0), Node::new);\n Node<Integer> node2 = countryMap.computeIfAbsent(pairs.get(1), Node::new);\n node1.connected.add(node2);\n node2.connected.add(node1);\n }\n\n List<Integer> countryCluster = new ArrayList<>();\n for(Node<Integer> node: countryMap.values()) {\n if(node.connected.size() == 0) {\n countryCluster.add(1);\n } else if(!node.visited){\n countryCluster.add(getNodeCount3(node));\n }\n }\n List<Integer> countryNodes = countryMap.values().stream().map(nn -> nn.value).collect(Collectors.toList());\n List<Integer> missingNodes = new ArrayList<>();\n for(int i=0; i < n; i++) {\n if(!countryNodes.contains(i))\n missingNodes.add(i);\n }\n\n for(int i=0; i < missingNodes.size(); i++) {\n countryCluster.add(1);\n }\n\n long ans = 0;\n //For one country we cannot pair with any other astronauts\n if(countryCluster.size() >= 2) {\n ans = (long) countryCluster.get(0) * countryCluster.get(1);\n if(countryCluster.size() > 2) {\n int sum = countryCluster.get(0) + countryCluster.get(1);\n for(int i=2; i < countryCluster.size(); i++) {\n ans += (long) sum * countryCluster.get(i);\n sum += countryCluster.get(i);\n }\n }\n }\n\n /*\n permutation of two set with size A and B = AxB\n permutation of three set with size A,B,C = AxB + AxC + BxC = AxB + (A+B)xC\n permutation of four set with size A,B,C,D = AxB + AxC + AxD + BxC + BxD + CxD = AxB + (A+B)xC + (A+B+C)xD\n */\n /*\n if(keys.length == 1) {\n ans = keys[0].size();\n } else {\n ans = keys[0].size() * keys[1].size();\n if(keys.length > 2) {\n int sum = keys[0].size() + keys[1].size();\n for (int i = 2; i < keys.length; i++) {\n ans += sum * keys[i].size();\n sum += keys[i].size();\n }\n }\n }\n */\n return ans;\n }", "public int sget2(int n) {\n\t\tint res = get(n);\n\t\tint top = 1 << (n - 1);\n\t\tif ((res & top) != 0) {\n\t\t\tint mask = top - 1;\n\t\t\tif ((res & mask) == 0) {\n\t\t\t\tint res2 = sget2(n);\n\t\t\t\tres = (~mask | res) + 1 + res2;\n\t\t\t} else {\n\t\t\t\tres = ~mask | res;\n\t\t\t}\n\t\t}\n\t\treturn res;\n\t}", "private int find(int p){\n while(p!=id[p]){\n p=id[p];\n eachDoUnionArrayAccessTimes+=2; //遍历读取某个元素算一次,设置值也算一次,所以加2次\n }\n eachDoUnionArrayAccessTimes++; //查询p的时候依然会读取一次\n return p;\n }", "static int recursiva1(int n)\n\t\t{\n\t\tif (n==0)\n\t\t\treturn 10; \n\t\tif (n==1)\n\t\t\treturn 20; \n\t\treturn recursiva1(n-1) - recursiva1 (n-2);\t\t\n\t\t}", "static long arrayManipulation(int n, int[][] queries) {\r\n long result = 0, sum = 0;\r\n long[] arr = new long[n];\r\n for(int i = 0; i < queries.length; i++){\r\n int firstIndex = queries[i][0] - 1;\r\n int lastIndex = queries[i][1] - 1;\r\n long numberToAdd = queries[i][2];\r\n arr[firstIndex] += numberToAdd;\r\n if (lastIndex+1 < n)\r\n arr[lastIndex+1] -= numberToAdd;\r\n }\r\n\r\n for(long l : arr){\r\n sum += l;\r\n if(sum > result)\r\n result = sum;\r\n }\r\n\r\n return result;\r\n }", "public static void func(){\n\t\tHashMap<Integer,Integer> map = new HashMap<Integer,Integer>();\n\t\tint limit = 1000;\n\t\tboolean psb[] = generatePrime(limit);\n\t\t\n\t\tint ps[] = MathTool.generatePrime(100000);\n\t\tfor (int i = 1; ps[i]<1000; i++) {\n\t\t\t//System.out.println(ps[i]);\n\t\t}\n\t\tint max=0;\n\t\tfor (int i = 0; ps[i] < limit; i++) {\n\t\t\tint n = ps[i];\n\t\t\tint j=i;\n\t\t\twhile(n<limit){\n\t\t\t\tif(!psb[n]){\n\t\t\t\t\tint num =j-i+1;\n\t\t\t\t\tif(map.containsKey(n)){\n\t\t\t\t\t\tif(map.get(new Integer(n)) < num){\n\t\t\t\t\t\t\tmap.put(n, num);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmap.put(n, num);\n\t\t\t\t\t}\n\t\t\t\t\tif(num > max){\n\t\t\t\t\t\tmax=num;\n\t\t\t\t\t\tSystem.out.println(num+\" \"+n+\" \"+i+\" \"+j);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tj++;\n\t\t\t\tn+=ps[j];\n\t\t\t}\n\t\t}\n\t\t\n\t}", "private boolean calculateMaximumLengthBitonicSubarray() {\n\n boolean found = false; // does any BSA found\n\n boolean directionChange = false; //does direction numberOfWays increase to decrease\n\n int countOfChange = 0;\n\n int i = 0;\n directionChange = false;\n int start = i;\n i++;\n for (; i < input.length; i++) {\n if (countOfChange != 0 && countOfChange % 2 == 0) {\n if (this.length < (i - 2 - start + 1)) {\n this.i = start;\n this.j = i - 2;\n this.length = this.j - this.i + 1;\n }\n start = i - 2;\n countOfChange = 0;\n }\n\n if (input[i] > input[i - 1]) {\n if (directionChange == true) {\n countOfChange++;\n }\n directionChange = false;\n }\n if (input[i] < input[i - 1]) {\n if (directionChange == false) {\n countOfChange++;\n }\n directionChange = true;\n }\n\n\n }\n\n if (directionChange == true) {\n if (this.length < (i - 1 - start + 1)) {\n this.i = start;\n this.j = i - 1;\n this.length = this.j - this.i + 1;\n }\n }\n return directionChange;\n }", "public static int getBetterApproach(int n){\n\t\t\n\t\tint t[] = new int[n+1];\n\t\t\n if(n<=2)\n return n;\n \n\t\tt[0] = 0;\n\t\tt[1] = 1;\n\t\tt[2] = 2;\n\t\tfor(int i = 3;i<=n;i++){\n\t\t\tt[i] = t[i-1] + t[i-2];\n\t\t}\n\t\treturn t[n];\n\t}", "static\nint\ncountSeq(\nint\nn, \nint\ndiff) \n{ \n\n// We can't cover difference of more \n\n// than n with 2n bits \n\nif\n(Math.abs(diff) > n) \n\nreturn\n0\n; \n\n\n// n == 1, i.e., 2 bit long sequences \n\nif\n(n == \n1\n&& diff == \n0\n) \n\nreturn\n2\n; \n\nif\n(n == \n1\n&& Math.abs(diff) == \n1\n) \n\nreturn\n1\n; \n\n\nint\nres = \n// First bit is 0 & last bit is 1 \n\ncountSeq(n-\n1\n, diff+\n1\n) + \n\n\n// First and last bits are same \n\n2\n*countSeq(n-\n1\n, diff) + \n\n\n// First bit is 1 & last bit is 0 \n\ncountSeq(n-\n1\n, diff-\n1\n); \n\n\nreturn\nres; \n}", "public int[] findAnyPairIndexesWhileLCMMinimized() {\n if (seq.length < 2) {\n return null;\n }\n int size = 0;\n for (int i = 1; i <= m; i++) {\n size += m / i;\n }\n\n IntegerMultiWayDeque deque = new IntegerMultiWayDeque(m + 1, size);\n for (int i = 1; i <= m; i++) {\n for (int j = i; j <= m; j += i) {\n if (!indexesOfSeq.isEmpty(j)) {\n deque.addLast(i, j / i);\n }\n }\n }\n\n long lcm = INF;\n int v1 = 0;\n int v2 = 0;\n\n for (int i = 1; i <= m; i++) {\n if (!indexesOfSeq.isEmpty(i) && indexesOfSeq.peekFirst(i) != indexesOfSeq.peekLast(i)) {\n lcm = v1 = v2 = i;\n break;\n }\n }\n\n IntegerVersionArray iva = new IntegerVersionArray(m + 1);\n IntegerDequeImpl stack = new IntegerDequeImpl(m);\n for (int i = 1; i <= m; i++) {\n iva.clear();\n stack.clear();\n while (!deque.isEmpty(i)) {\n int last = deque.removeFirst(i);\n factorize(last);\n int total = ie(iva, allFactors.size() - 1, 1, 0);\n if (total > 0) {\n int pop = 0;\n while (total > 0) {\n pop = stack.removeLast();\n if (GCDs.gcd(pop, last) == 1) {\n total--;\n }\n add(iva, pop, -1);\n }\n long l = LCMs.lcm(last, pop) * i;\n if (l < lcm) {\n lcm = l;\n v1 = last * i;\n v2 = pop * i;\n }\n }\n add(iva, last, 1);\n stack.addLast(last);\n }\n }\n\n return new int[]{indexesOfSeq.peekFirst(v1), indexesOfSeq.peekLast(v2)};\n }", "int merge_compute_minrun(int localN) {\n int r = 0; // becomes 1 if any 1 bits are shifted off\n \n //assert_(n >= 0);\n while (localN >= 64) {\n r |= localN & 1;\n localN >>= 1;\n }\n return localN + r;\n }", "public static void main(String[] args) {\n\t\tboolean[] primes = new boolean[1000000];\r\n\t\tArrayList<Integer> consecutivePrimeSums = new ArrayList<>();\r\n\t\tfor (int i = 0; i < primes.length; i++) {\r\n\t\t\tprimes[i] = true;\r\n\t\t}\r\n\t\tprimes[0] = false;//1 is not prime number\r\n\t\tfor (int p = 2; p*p <= 1000000; p++) {\r\n\t\t\tif (primes[p-1] == true) {\r\n\t\t\t\tfor (int q = p*p; q <= 1000000; q += p) {\r\n\t\t\t\t\tprimes[q-1] = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Store the consecutive prime sums as we iterate through the boolean array\r\n\t\tconsecutivePrimeSums.add(0);\r\n\t\tint currentIndex = 1;\r\n\t\tfor (int j = 0; j < primes.length; j++) {\r\n\t\t\tif (primes[j] == true) {\r\n\t\t\t\tconsecutivePrimeSums.add(consecutivePrimeSums.get(currentIndex-1) + (j+1));\r\n\t\t\t\tcurrentIndex++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Now we use 2 nested for loops to loop through all possible consecutive prime sums\r\n\t\tint maxLength = 0;\r\n\t\tint ans = 0;\r\n\t\tfor (int k = consecutivePrimeSums.size()-1; k >= 2; k--) {\r\n\t\t\tfor (int m = k-2; m >= 0; m--) {\r\n\t\t\t\tint currentSum = consecutivePrimeSums.get(k) - consecutivePrimeSums.get(m);\r\n\t\t\t\tif (currentSum >= 1000000)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tif (primes[currentSum-1] == true && (k-m) > maxLength) {\r\n\t\t\t\t\tans = currentSum;\r\n\t\t\t\t\tmaxLength = k-m;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(ans);\r\n\t\t/*long endTime = System.nanoTime();\r\n\t\tlong timeElapsed = endTime - startTime;\r\n\t\tSystem.out.println(timeElapsed/1000000 + \" ms\");*/\r\n\t}", "static long solve(long[] d) {\n int len = d.length;\n long[] dp = new long[len];\n\n Set<Long> set = new HashSet<>();\n\n for (int index1 = len - 1; index1 >= 0; index1--) {\n int count = 0;\n for (int index2 = index1 + 1; index2 < len; index2++) {\n if (d[index2] > d[index1]) {\n if( set.contains(d[index2] ) )continue;\n set.add(d[index2]);\n count++;\n }\n }\n set = new HashSet<>();\n dp[index1] = count;\n }\n\n long res = 0;\n Set<Long> distinct = new HashSet<>();\n for (int index1 = 0; index1 < len; index1++) {\n long curr = d[index1];\n if (distinct.contains(curr)) {\n continue;\n } else distinct.add(curr);\n for (int index2 = index1 + 1; index2 < len; index2++) {\n if (d[index2] > curr) {\n if (set.contains(d[index2])) continue;\n res += dp[index2];\n set.add(d[index2]);\n }\n }\n set = new HashSet<>();\n }\n\n return res;\n\n }", "public static void main(String[] args) {\n int N = 100, i, j, min;\n System.out.println(\"Value of N: \" + N);\n\n for (i = 1; i <= N; i++)\n {\n for (j = 1; j <= N; j++)\n {\n min = i < j ? i : j;\n System.out.print(N - min + 1);\n }\n System.out.println();\n\n\n\n\n }\n}" ]
[ "0.665431", "0.6478027", "0.6263234", "0.62300843", "0.6183434", "0.6161432", "0.6010909", "0.59628373", "0.5912911", "0.5821763", "0.5781815", "0.5779863", "0.5766134", "0.56854767", "0.5682253", "0.5674304", "0.56674445", "0.5603618", "0.5594077", "0.55774456", "0.55641735", "0.55641025", "0.5536159", "0.5532557", "0.5531076", "0.5528046", "0.5523653", "0.55156976", "0.5490392", "0.5486966", "0.5481836", "0.545625", "0.54475254", "0.54249257", "0.5424885", "0.5418309", "0.54116696", "0.5404269", "0.5381217", "0.5352667", "0.5334515", "0.53329664", "0.5331618", "0.53272897", "0.53272605", "0.5309406", "0.528967", "0.5288307", "0.5284674", "0.528428", "0.52828056", "0.5280276", "0.52697456", "0.52638733", "0.5258068", "0.525734", "0.5252717", "0.5251182", "0.52511716", "0.5237059", "0.52331936", "0.52293396", "0.5229004", "0.52287334", "0.522695", "0.5222542", "0.5206909", "0.5204867", "0.5199691", "0.5197151", "0.51948977", "0.51926154", "0.5191393", "0.51910883", "0.51832396", "0.51787066", "0.5177678", "0.51762766", "0.51739776", "0.51665837", "0.51647806", "0.5154767", "0.5153888", "0.5149636", "0.5148461", "0.5148267", "0.51473933", "0.5146898", "0.51439154", "0.51434857", "0.5139356", "0.5136291", "0.51330054", "0.513251", "0.513172", "0.51305", "0.5130111", "0.5128029", "0.5124561", "0.51236403", "0.5117382" ]
0.0
-1
// mission 9 //
public Point[] nearestPairInStrip(Container container, double width, Boolean axis) { double leftGap,rightGap; int minIndex; int numInStrip = 0; this.current = container; Point currentData = this.current.getData(); if (axis){ //width of the strip by axis leftGap = currentData.getX() + (width/2); rightGap = currentData.getX() - (width/2);} else{ leftGap = container.getData().getY() + (width/2); rightGap = container.getData().getY() - (width/2);} // we count the number of points in the strip with aid function Point[] setup = {new Point(0, 0)}; Point[] strip = NumInStripAxis(container,rightGap,leftGap,axis,setup); // return in strip[0].getX() the num of points in the strip numInStrip = strip[0].getX(); // number of points in the strip minIndex = numInStrip - strip[0].getY(); // index in the array that we will find the min there, later on Point[] insert = new Point[numInStrip]; // build array in this size // insert the right points to the array if (numInStrip>=2){ insert[0] = new Point(numInStrip, 1); // to insert points to the array we need thus values in [0] strip = NumInStripAxis(container,rightGap,leftGap,axis,insert); // O(numInStrip) - the array is not sorted yet }else return null; // there is less then 2 points in the strip // now we sort the "strip" array if (numInStrip*Math.log10(numInStrip)/Math.log10(2)<this.size){// sort by O(numInStrip*log(numInStrip)) if (axis) {Arrays.sort(strip, new CompareY());} // if the strip width is axis x then sort by Y else {Arrays.sort(strip, new CompareX());} }else{ // sort by O(n) int min,max; if (axis){//X if (numInStrip==this.size){ min = this.minx.getData().getX(); max = this.maxx.getData().getX();} else{// if we don't have this.size points in our strip min = strip[minIndex].getX(); max = strip[0].getX();} // when we build the array the max point in the axis will be in the 0 index } else{ //Y if (numInStrip==this.size){ min = this.miny.getData().getY(); max = this.maxy.getData().getY();} else{// if we don't have all the data structure in our strip min = strip[minIndex].getY(); max = strip[0].getY(); // when we build the array the max point in the axis will be in the 0 index } } strip = getPointsInRangeOppAxis(min, max, axis); // O(n) - to sorted this "strip" array } // now we want to know which of the points is the nearest points in the "strip" array if (strip.length>=2) return nearestPointInArray(strip); else return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void mo21877s() {\n }", "void mo41083a();", "void mo310e();", "public void mo21795T() {\n }", "void mo119581a();", "private void kk12() {\n\n\t}", "void mo37810a();", "public void mo21791P() {\n }", "public void mo21878t() {\n }", "void mo17012c();", "public void mo21794S() {\n }", "public void mo12930a() {\n }", "void mo21072c();", "public void mo3376r() {\n }", "void mo41086b();", "void mo1507n();", "public void mo21793R() {\n }", "public void mo21785J() {\n }", "public void mo38117a() {\n }", "void mo28306a();", "void mo57278c();", "public void mo21782G() {\n }", "private static void cajas() {\n\t\t\n\t}", "void mo21073d();", "void mo38026a();", "public void mo4359a() {\n }", "void mo67924c();", "void mo21076g();", "void mo60893b();", "public void mo21789N() {\n }", "void mo9693a();", "void mo57277b();", "void mo22249a();", "void mo17013d();", "public void mo21787L() {\n }", "void mo21074e();", "@Override\n\tpublic void challenge9() {\n\n\t}", "void mo17023d();", "void mo2311a();", "void mo98969a();", "public void mo21783H() {\n }", "void mo1637a();", "void mo12143a();", "void mo17021c();", "void mo7350a();", "void mo72114c();", "void mo10148a();", "public void mo21792Q() {\n }", "public void mo21788M() {\n }", "public abstract void mo2624j();", "void mo72113b();", "void mo3311a();", "void mo60892a();", "public void mo6081a() {\n }", "public void mo23813b() {\n }", "void mo119582b();", "void mo57275a();", "void mo88524c();", "void mo1501h();", "void mo12638c();", "void mo1493c();", "void mo54405a();", "void mo71b();", "public void mo44053a() {\n }", "void mo4833b();", "void mo72111a();", "public void mo21779D() {\n }", "void mo80457c();", "public void mo21780E() {\n }", "public abstract int mo8526p();", "public void mo21825b() {\n }", "public void mo21786K() {\n }", "void mo21070b();", "void mo5017a();", "public void mo9137b() {\n }", "void mo13368a();", "void mo1943l();", "public void mo6944a() {\n }", "Mission createMission();", "public void method_4270() {}", "void mo80452a();", "void mo88521a();", "void mo1941j();", "public void mo97908d() {\n }", "public void mo115188a() {\n }", "public void mo21879u() {\n }", "int mo1503j();", "public void mo21784I() {\n }", "void mo84655a();", "public void mo97906c() {\n }", "void mo28194a();", "void mo27575a();", "public void mo3749d() {\n }", "public void mo9241ay() {\n }", "public void mo2471e() {\n }", "void mo80455b();", "void mo67920a();", "public void mo1531a() {\n }", "public void skystonePos6() {\n }", "public void mo55254a() {\n }", "public void mo3370l() {\n }" ]
[ "0.63093895", "0.6296552", "0.62288725", "0.6193015", "0.6189889", "0.61892146", "0.61822665", "0.61693984", "0.61672705", "0.61655", "0.6143048", "0.6129655", "0.61274403", "0.6118696", "0.6116993", "0.610924", "0.61073405", "0.60935706", "0.60934174", "0.6090066", "0.6086699", "0.60850185", "0.6083106", "0.6069505", "0.6068483", "0.60644704", "0.6063342", "0.606029", "0.6056535", "0.6055059", "0.605441", "0.6049614", "0.6046428", "0.6039855", "0.60374177", "0.6027881", "0.60212034", "0.6020119", "0.6019404", "0.6019193", "0.60162234", "0.6003879", "0.60032475", "0.6002839", "0.6002356", "0.5991007", "0.598728", "0.59838843", "0.5981245", "0.596914", "0.59661776", "0.5957149", "0.5953424", "0.595334", "0.59524626", "0.59494954", "0.59484667", "0.5937476", "0.59315693", "0.5930452", "0.5926103", "0.59257054", "0.5920093", "0.59113693", "0.5909733", "0.58989334", "0.58957255", "0.5895636", "0.5891067", "0.5890576", "0.58898145", "0.5877481", "0.58693177", "0.58631873", "0.5863082", "0.5861739", "0.58611417", "0.5856632", "0.58564144", "0.58561623", "0.5848517", "0.58456767", "0.58444256", "0.58426124", "0.5840439", "0.5833056", "0.5832819", "0.5828495", "0.5825012", "0.58235204", "0.5819838", "0.5819513", "0.58124435", "0.58114684", "0.58013344", "0.57995963", "0.57863396", "0.5784663", "0.57840276", "0.5782234", "0.577959" ]
0.0
-1
Aid Function calculate the nearest point O(sizeOftheArray) ,min sizeOftheArray=2 //
private Point[] nearestPointInArray(Point[] strip){ int j = 1; // with each point we measure the distance with the following 6 point's Point[] currentMinPoints = {strip[0],strip[1]}; double currentMinDistance = Distance(currentMinPoints[0], currentMinPoints[1]); double currentDistance; for (int i=0; i< strip.length; i++){ while (j<8 && i+j < strip.length){ currentDistance = Distance(strip[i], strip[i+j]); if (currentDistance<currentMinDistance){ currentMinDistance = currentDistance; currentMinPoints[0] = strip[i]; currentMinPoints[1] = strip[i+j]; } j++; } j=1; } return currentMinPoints; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Point[] nearestPair() {\n\t\t\tPoint[] Answer = new Point[2];\n\t\t\tif (this.size<2)\treturn null; //step 1\n\t\t\tif (this.size==2){\n\t\t\t\tAnswer[0]=this.minx.getData();\n\t\t\t\tAnswer[1]=this.maxx.getData();\n\t\t\t\treturn Answer;\t\t\t\n\t\t\t}\n\t\t\tdouble MinDistance=-1; // for sure it will be change in the next section, just for avoid warrning.\n\t\t\tdouble MinDistanceInStrip=-1;\n\t\t\tPoint[] MinPointsLeft = new Point[2];\n\t\t\tPoint[] MinPointsRight = new Point[2];\n\t\t\tPoint[] MinPointsInStrip = new Point[2]; // around the median\n\t\t\tboolean LargestAxis = getLargestAxis(); //step 2\n\t\t\tContainer median = getMedian(LargestAxis); //step 3\n\t\t\tif (LargestAxis){// step 4 - calling the recursive function nearestPairRec\n\t\t\t\tMinPointsLeft = nearestPairRec(getPointsInRangeRegAxis(this.minx.getData().getX(), median.getData().getX(),LargestAxis), LargestAxis);\n\t\t\t\tMinPointsRight =nearestPairRec(getPointsInRangeRegAxis(median.getNextX().getData().getX(), this.maxx.getData().getX(),LargestAxis), LargestAxis);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tMinPointsLeft = nearestPairRec(getPointsInRangeRegAxis(this.miny.getData().getY(), median.getData().getY(),LargestAxis), LargestAxis);\n\t\t\t\tMinPointsRight =nearestPairRec(getPointsInRangeRegAxis(median.getNextY().getData().getY(), this.maxy.getData().getY(),LargestAxis), LargestAxis);\n\t\t\t}\n\t\t\t//step 5\n\t\t\tif (MinPointsLeft!=null && MinPointsRight!=null){\n\t\t\t\tif (Distance(MinPointsLeft[0], MinPointsLeft[1]) > Distance(MinPointsRight[0], MinPointsRight[1])){\n\t\t\t\t\tMinDistance = Distance(MinPointsRight[0], MinPointsRight[1]);\n\t\t\t\t\tAnswer = MinPointsRight;\n\t\t\t\t}else{\n\t\t\t\t\tMinDistance = Distance(MinPointsLeft[0], MinPointsLeft[1]);\n\t\t\t\t\tAnswer = MinPointsLeft;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (MinPointsLeft!=null) {\n\t\t\t\tMinDistance = Distance(MinPointsLeft[0], MinPointsLeft[1]);\n\t\t\t\tAnswer = MinPointsLeft;\n\t\t\t}\n\t\t\telse if (MinPointsRight!=null){\n\t\t\t\tMinDistance = Distance(MinPointsRight[0], MinPointsRight[1]);\n\t\t\t\tAnswer = MinPointsRight;\n\t\t\t}\n\t\t\t//step 6 - nearest point around the median\n\t\t\tif (MinDistance==-1) MinDistance=0;\n\t\t\tMinPointsInStrip = nearestPairInStrip(median, MinDistance*2, LargestAxis);\n\t\t\tif (MinPointsInStrip != null){\n\t\t\t\tMinDistanceInStrip = Distance(MinPointsInStrip[0], MinPointsInStrip[1]);\n\t\t\t\tif (MinDistanceInStrip < MinDistance) return MinPointsInStrip;\n\t\t\t}\n\t\t\treturn Answer;\n\t\t}", "private static void findClosestElement(int[] a, int element) {\n int low = 0, high = a.length - 1;\n\n\n // Corner cases\n if (a[high] < element) {\n System.out.println(a[high]);\n return;\n }\n\n if (element < a[low]) {\n System.out.println(a[low]);\n return;\n }\n\n while (low <= high) {\n\n int mid = low + (high - low) / 2;\n\n // element == mid\n if (a[mid] == element) {\n\n int leftDiff = Integer.MAX_VALUE;\n int rightDiff = Integer.MAX_VALUE;\n\n if (mid > 0) {\n leftDiff = element - a[mid - 1];\n }\n\n if (mid < a.length - 1) {\n rightDiff = a[mid + 1] - element;\n }\n\n\n if (leftDiff != Integer.MAX_VALUE && leftDiff < rightDiff) {\n System.out.println(a[mid - 1]);\n } else if (rightDiff != Integer.MAX_VALUE) {\n System.out.println(a[mid + 1]);\n }\n return;\n }\n\n // element < mid\n if (element < a[mid]) {\n\n if (low <= mid - 1 && a[mid - 1] < element) { // Cross over point is mid-1 to mid\n System.out.println(getClosest(element, a[mid - 1], a[mid]));\n return;\n } else\n high = mid;\n } else {\n if (mid + 1 <= high && element < a[mid + 1]) { // Cross over point is mid to mid+1\n System.out.println(getClosest(element, a[mid], a[mid + 1]));\n return;\n } else\n low = mid + 1;\n }\n }\n\n }", "public static double closestPair(Point[] sortedX) {\n if (sortedX.length <= 1) {\n return Double.MAX_VALUE;\n }\n double mid = sortedX[(sortedX.length) / 2].getX();\n double firstHalf = closestPair(Arrays.copyOfRange(sortedX, 0, (sortedX.length) / 2));\n double secondHalf = closestPair(Arrays.copyOfRange(sortedX, (sortedX.length) / 2, sortedX.length));\n double min = Math.min(firstHalf, secondHalf);\n ArrayList<Point> close = new ArrayList<Point>();\n for (int i = 0; i < sortedX.length; i++) {\n double dis = Math.abs(sortedX[i].getX() - mid);\n if (dis < min) {\n close.add(sortedX[i]);\n }\n }\n // sort by Y coordinates\n Collections.sort(close, new Comparator<Point>() {\n public int compare(Point obj1, Point obj2) {\n return (int) (obj1.getY() - obj2.getY());\n }\n });\n Point[] near = close.toArray(new Point[close.size()]);\n\n for (int i = 0; i < near.length; i++) {\n int k = 1;\n while (i + k < near.length && near[i + k].getY() < near[i].getY() + min) {\n if (min > near[i].distance(near[i + k])) {\n min = near[i].distance(near[i + k]);\n System.out.println(\"near \" + near[i].distance(near[i + k]));\n System.out.println(\"best \" + best);\n\n if (near[i].distance(near[i + k]) < best) {\n best = near[i].distance(near[i + k]);\n arr[0] = near[i];\n arr[1] = near[i + k];\n // System.out.println(arr[0].getX());\n // System.out.println(arr[1].getX());\n\n }\n }\n k++;\n }\n }\n return min;\n }", "private double calcNearestNeighborIndex(ArrayList<Point> pts) {\n int width = layoutPanel.getLayoutSize().width;\n int height = layoutPanel.getLayoutSize().height;\n\n // calculate average nearest neighbor\n double avgNN = 0;\n int n = pts.size();\n for (int i = 0; i < n; i++) {\n double minDist = Float.MAX_VALUE;\n for (int j = 0; j < n; j++) {\n if (i != j) {\n Point pti = pts.get(i);\n Point ptj = pts.get(j);\n double dist = Point2D\n .distanceSq(pti.x, pti.y, ptj.x, ptj.y);\n if (minDist > dist) {\n minDist = dist;\n }\n }\n }\n avgNN += Math.sqrt(minDist);\n }\n avgNN = avgNN / (double) n;\n\n // calculate estimated average neighbor\n double estANN = 1.0 / (2.0 * Math.sqrt((double) n\n / (double) (width * height)));\n\n return avgNN / estANN;\n }", "private Point[] nearestPairRec(Point[] range, boolean axis) {\n\t\t\tPoint[] Answer = new Point[2];\n\t\t\tif (range.length < 4) return nearestPair3Points(range);\n\t\t\tPoint[] MinPointsLeft = new Point[2];\n\t\t\tPoint[] MinPointsRight = new Point[2];\n\t\t\tPoint[] MinPointsInStrip = new Point[2];\n\t\t\tdouble MinDistance = -1; //it will be change for sure, because we pass the array only if it containes 4 points and above.\n\t\t\tdouble MinDistanceInStrip;\n\t\t\t//step 4\n\t\t\tif (axis){\n\t\t\t\tMinPointsLeft = nearestPairRec(getPointsInRangeRegAxis(range[0].getX(), range[(range.length)/2].getX(), axis), axis);\n\t\t\t\tMinPointsRight =nearestPairRec(getPointsInRangeRegAxis(range[((range.length)/2)+1].getX(), range[range.length-1].getX() ,axis), axis);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tMinPointsLeft = nearestPairRec(getPointsInRangeRegAxis(range[0].getY(), range[(range.length)/2].getY(), axis), axis);\n\t\t\t\tMinPointsRight =nearestPairRec(getPointsInRangeRegAxis(range[((range.length)/2)+1].getY(), range[range.length-1].getY() ,axis), axis);\n\t\t\t}\n\t\t\t//step 5\n\t\t\tif (MinPointsLeft!=null && MinPointsRight!=null){\n\t\t\t\tif (Distance(MinPointsLeft[0], MinPointsLeft[1]) > Distance(MinPointsRight[0], MinPointsRight[1])){\n\t\t\t\t\tMinDistance = Distance(MinPointsRight[0], MinPointsRight[1]);\n\t\t\t\t\tAnswer = MinPointsRight;\n\t\t\t\t}else{\n\t\t\t\t\tMinDistance = Distance(MinPointsLeft[0], MinPointsLeft[1]);\n\t\t\t\t\tAnswer = MinPointsLeft;\n\t\t\t\t}\n\t\t\t}else if (MinPointsLeft!=null && MinPointsRight==null) {\n\t\t\t\tMinDistance = Distance(MinPointsLeft[0], MinPointsLeft[1]);\n\t\t\t\tAnswer = MinPointsLeft;\n\t\t\t}else if (MinPointsRight!=null && MinPointsLeft==null){\n\t\t\t\tMinDistance = Distance(MinPointsRight[0], MinPointsRight[1]);\n\t\t\t\tAnswer = MinPointsRight;\n\t\t\t}\n\t\t\t//step 6 find the nearest point around the median\n\t\t\tint upper;\n\t\t\tint lower;\n\t\t\tif (MinDistance==-1) MinDistance = 0;\n\t\t\tif (axis){\n\t\t\t\tupper = (int) (range[(range.length)/2].getX()+MinDistance);\n\t\t\t\tlower = (int) (range[(range.length)/2].getX()-MinDistance);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tupper = (int) (range[(range.length)/2].getY()+MinDistance);\n\t\t\t\tlower = (int) (range[(range.length)/2].getY()-MinDistance);\n\t\t\t}\n\t\t\trange = getPointsInRangeOppAxis(lower, upper, axis);\n\t\t\tif (range.length>=2) MinPointsInStrip = nearestPointInArray(range);\n\t\t\tif (MinPointsInStrip[0]!=null){\n\t\t\t\tMinDistanceInStrip = Distance(MinPointsInStrip[0], MinPointsInStrip[1]);\n\t\t\t\tif (MinDistanceInStrip < MinDistance) return MinPointsInStrip;\n\t\t\t}\n\t\t\treturn Answer;\n\t\t}", "public static void findClosestPair(XYPoint points[], boolean print)\n\t{\n\t\tif(points.length==1){\n\t\t\treturn;\n\t\t}\n\t\tdouble mindist = INF;\n\t\tdouble dist = 0.0;\n\t\tint npoints=points.length;\n\t\tXYPoint point1 = new XYPoint();\n\t\tXYPoint point2 = new XYPoint();\n\t\tint i=0;\n\t\twhile(i<npoints-1){ //XYPoint[i]\n\t\t\t\tint k = i+1;\n\t\t\t\twhile (k<npoints){ //XYPoint[j]\n\t\t\t\t\tdist=points[i].dist(points[k]);\n\t\t\t\t\tif(dist<mindist){\n\t\t\t\t\t\tmindist=dist;\n\t\t\t\t\t\tpoint1=points[i];\n\t\t\t\t\t\tpoint2=points[k];\n\t\t\t\t\t}\n\t\t\t\t\tk++;\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t}\n\t\tif (print){\n\t\t\tSystem.out.println(\"NAIVE \" + point1+\" \"+point2+\" \"+mindist);\n\t\t}\n\n\t}", "int[][] Naive(int m, Pointd[] points){\n int[][] tours = new int[m][];\n for(int i=0; i<m; i++){\n if(i<points.length%m) tours[i] = new int[points.length/m+1];\n else tours[i] = new int[points.length/m];\n }\n\n //Select the first point, find the next closest point, find the next closest point to that etc\n boolean[] alreadyInTour = new boolean[points.length];\n double minDistance;\n double distance;\n Pointd pointA;\n Pointd pointB;\n int index = 0;\n int n;\n\n for(int k=0; k<m; k++){\n //Each row of tours, first find a node that isn't in a tour\n n = 0;\n while(alreadyInTour[n]) n++;\n pointA = points[n];\n tours[k][0] = n;\n alreadyInTour[n] = true;\n\n int iterate = 0;\n int j=1;\n while(j<tours[k].length){\n if(!alreadyInTour[iterate]){\n minDistance = Double.MAX_VALUE;\n //Find next closest point to pointA\n for(int i=0; i<points.length; i++){\n pointB = points[i];\n if(!alreadyInTour[i]){\n distance = Math.sqrt( Math.pow(pointA.x - pointB.x, 2) + Math.pow(pointA.y - pointB.y, 2) );\n if(distance < minDistance){\n minDistance = distance;\n index = i;\n }\n }\n }\n //System.out.println(index);\n tours[k][j] = index;\n alreadyInTour[index] = true;\n j++;\n }\n iterate++;\n if(iterate >= points.length) iterate = 0;\n }\n }\n for(int i=0; i<tours.length; i++){\n //System.out.println(Arrays.toString(tours[i]));\n }\n return tours;\n }", "public abstract double calculateDistance(double[] x1, double[] x2);", "public static void main(String[] args) {\n Random r = new Random();\n// r.setSeed(1982);\n int R = 500;\n int L = 100000;\n\n int start = -500;\n int end = 500;\n HashSet<Point> hi3 = new HashSet<>();\n List<Point> hi5 = new ArrayList<>();\n Stopwatch sw = new Stopwatch();\n for (int i = 0; i < L; i += 1) {\n double ran = r.nextDouble();\n double x = start + (ran * (end - start));\n ran = r.nextDouble();\n double y = start + (ran * (end - start));\n Point temp = new Point(x, y);\n hi5.add(temp);\n\n }\n KDTree speedTest = new KDTree(hi5);\n NaivePointSet speedTest2 = new NaivePointSet(hi5);\n\n// for (int i = 0; i < 1000; i++) {\n// double ran = r.nextDouble();\n// double x2 = start + (ran *(end - start));\n// ran = r.nextDouble();\n// double y2 = start + (ran *(end - start));\n// assertEquals(speedTest2.nearest(x2, y2), speedTest.nearest(x2, y2 ));\n// }\n// assertEquals(speedTest2.nearest(r.nextInt(R + 1 - 500) + 500,\n// r.nextInt(R + 1 - 500) + 100), speedTest.nearest(427.535670, -735.656403));\n\n System.out.println(\"elapsed time1: \" + sw.elapsedTime());\n\n int R2 = 100;\n int L2 = 10000;\n Stopwatch sw2 = new Stopwatch();\n for (int i = 0; i < L2; i += 1) {\n\n speedTest2.nearest(r.nextDouble(), r.nextDouble());\n }\n\n System.out.println(\"elapsed time: \" + sw2.elapsedTime());\n }", "static int minimumDistances(int[] a) {\n int l = a.length;\n Map<Integer, List<Integer>> map = new HashMap<>();\n for (int i = 0; i <l ; i++) {\n List<Integer> val = map.get(a[i]);\n if(val == null){\n val = new ArrayList<>();\n }\n val.add(i);\n map.put(a[i], val);\n }\n int min = Integer.MAX_VALUE;\n for (List<Integer> value:\n map.values()) {\n int c = value.size();\n if(c>1){\n for (int i = 0; i < c-1 ; i++) {\n min = Math.min(min, value.get(i+1)- value.get(i));\n }\n }\n }\n if(min == Integer.MAX_VALUE) min = -1;\n return min;\n\n\n }", "private int calculateIndexOfClosestPoint(Position[] smoothedPath) {\n double[] distances = new double[smoothedPath.length];\n for (int i = 0/*lastClosestPointIndex*/; i < smoothedPath.length; i++) {\n distances[i] = Functions.Positions.subtract(smoothedPath[i], currentCoord).getMagnitude();\n }\n\n // calculates the index of value in the array with the smallest value and returns that index\n lastClosestPointIndex = Functions.calculateIndexOfSmallestValue(distances);\n return lastClosestPointIndex;\n }", "public abstract double getDistance(int[] end);", "public int shortestBridge(int[][] A) {\n for(int i = 0; i < A.length; i++) {\n if(found) {\n break;\n }\n for(int j = 0; j < A[0].length; j++) {\n if(A[i][j] == 1) {\n helper(A, i, j);\n found = true;\n break;\n }\n }\n }\n // Put all '2' into queue as candidate initial start points\n Queue<int[]> q = new LinkedList<int[]>();\n for(int i = 0; i < A.length; i++) {\n for(int j = 0; j < A[0].length; j++) {\n if(A[i][j] == 2) {\n q.offer(new int[] {i, j});\n }\n }\n }\n int distance = 0;\n while(!q.isEmpty()) {\n int size = q.size();\n for(int i = 0; i < size; i++) {\n int[] cur = q.poll();\n for(int j = 0; j < 4; j++) {\n int new_x = cur[0] + dx[j];\n int new_y = cur[1] + dy[j];\n if(new_x >= 0 && new_x < A.length && new_y >= 0 && new_y < A[0].length) {\n if(A[new_x][new_y] == 1) {\n return distance;\n } else if(A[new_x][new_y] == 0) {\n // Update from 0 to 2 which means expand first island boundary\n // which also avoid using visited to check\n A[new_x][new_y] = 2;\n q.offer(new int[] {new_x, new_y});\n }\n }\n }\n }\n distance++;\n }\n return distance;\n }", "public int shortestBridge(int[][] A) {\n for(int i = 0; i < A.length && !found; i++) {\n for(int j = 0; j < A[0].length && !found; j++) {\n if(A[i][j] == 1) {\n helper(A, i, j);\n found = true;\n }\n }\n }\n // Put all '2' into queue as candidate initial start points\n Queue<int[]> q = new LinkedList<int[]>();\n for(int i = 0; i < A.length; i++) {\n for(int j = 0; j < A[0].length; j++) {\n if(A[i][j] == 2) {\n q.offer(new int[] {i, j});\n }\n }\n }\n int distance = 0;\n while(!q.isEmpty()) {\n int size = q.size();\n for(int i = 0; i < size; i++) {\n int[] cur = q.poll();\n for(int j = 0; j < 4; j++) {\n int new_x = cur[0] + dx[j];\n int new_y = cur[1] + dy[j];\n if(new_x >= 0 && new_x < A.length && new_y >= 0 && new_y < A[0].length) {\n if(A[new_x][new_y] == 1) {\n return distance;\n } else if(A[new_x][new_y] == 0) {\n // Update from 0 to 2 which means expand first island boundary\n // which also avoid using visited to check\n A[new_x][new_y] = 2;\n q.offer(new int[] {new_x, new_y});\n }\n }\n }\n }\n distance++;\n }\n return distance;\n }", "public int getOptimalNumNearest();", "private static double divideAndConquer(ArrayList<Point> X, ArrayList<Point> Y) {\n\n\t\t//Assigns size of array\n\t\tint size = X.size();\n\n\t\t//If less than 3 points, efficiency is better by brute force\n\t\tif (size <= 3) {\n\t\t\treturn BruteForceClosestPairs(X);\n\t\t}\n\t\t\n\t\t//Ceiling of array size / 2\n\t\tint ceil = (int) Math.ceil(size / 2);\n\t\t//Floor of array size / 2\n\t\tint floor = (int) Math.floor(size / 2);\n\t\t\n\t\t//Array list for x & y values left of midpoint\n\t\tArrayList<Point> xL = new ArrayList<Point>();\t\n\t\tArrayList<Point> yL = new ArrayList<Point>();\n\t\t\n\t\t//for [0 ... ceiling of array / 2]\n\t\t//add the points onto the new arrays\n\t\tfor (int i = 0; i < ceil; i++) {\n\t\t\t\n\t\t\txL.add(X.get(i));\n\t\t\tyL.add(Y.get(i));\n\t\t}\n\t\t\n\t\t// Array list for x & y values right of midpoint\n\t\tArrayList<Point> xR = new ArrayList<Point>();\n\t\tArrayList<Point> yR = new ArrayList<Point>();\n\t\t\n\t\t//for [floor of array / 2 ... size of array]\n\t\t//add the points onto the new arrays\n\t\tfor (int i = floor; i < size - 1; i++) {\n\n\t\t xR.add(X.get(i));\n\t\t\tyR.add(Y.get(i));\n\t\t}\n\t\t\n\t\t//Recursively find the shortest distance\n\t\tdouble distanceL = divideAndConquer(xL, yL);\n\t\tdouble distanceR = divideAndConquer(xR, xL);\n\t\t//Smaller of both distances\n\t\tdouble distance = Math.min(distanceL, distanceR);\n\t\t//Mid-line\n\t\tdouble mid = X.get(ceil - 1).getX();\n\n\t\tArrayList<Point> S = new ArrayList<Point>();\n\n\t\t//copy all the points of Y for which |x - m| < d into S[0..num - 1]\n\t\tfor (int i = 0; i < Y.size() - 1; i++) {\n\n\t\t\tif (Math.abs(X.get(i).getX() - mid) < distance) {\n\t\t\t\tS.add(Y.get(i));\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Square minimum distance\n\t\tdouble dminsq = distance * distance;\n\t\t//Counter\n\t\tint k = 0;\n\t\tint num = S.size();\n\n\t\tfor (int i = 0; i < num - 2; i++) {\n\t\t\t\n\t\t\tk = i + 1;\n\t\t\t\n\t\t\twhile (k <= num - 1 && (Math.pow((S.get(k).getY() - S.get(i).getY()), 2) < dminsq)) {\n\n\t\t\t\t//Find distance between points and find the minimum compared to dminsq\n\t\t\t\tdminsq = Math.min(Math.pow(S.get(k).getX() - S.get(i).getX(), 2) \n\t\t\t\t\t\t\t\t+ Math.pow(S.get(k).getY() - S.get(i).getY(), 2), dminsq);\n\n\t\t\t\tk = k + 1;\n\t\t\t}\n\t\t}\n\n\t\treturn Math.sqrt(dminsq);\n\t}", "@Test\n public void basicTest() {\n Point myPoint;\n\n// myPoint = pointSet.nearest(2, 2);\n// System.out.println(myPoint.toString());\n// myPoint = pointSet.nearest(2, -2);\n// System.out.println(myPoint.toString());\n// myPoint = pointSet.nearest(1, 4);\n// System.out.println(myPoint.toString());\n// myPoint = pointSet.nearest(3, -100);\n// System.out.println(myPoint.toString());\n// myPoint = pointSet.nearest(0, 0);\n// System.out.println(myPoint.toString());\n//\n// myPoint = kdPointSet.nearest(2, 2); //THIS ONE DOES NOT MATCH NAIVE!\n// System.out.println(myPoint.toString());\n// myPoint = kdPointSet.nearest(2, -2);\n// System.out.println(myPoint.toString());\n// myPoint = kdPointSet.nearest(1, 4);\n// System.out.println(myPoint.toString());\n// myPoint = kdPointSet.nearest(3, -100);\n// System.out.println(myPoint.toString());\n// myPoint = kdPointSet.nearest(0, 0);\n// System.out.println(myPoint.toString());\n\n\n\n\n\n\n }", "public static Point[] closestPair(double[] x, double[]y) throws Exception\r\n {\r\n /*if x-coordinates dont match y-coordinates*/\r\n if(x.length != y.length)\r\n {\r\n System.out.println(\"Can't compute closest pair. Input lengths mismatch!\");\r\n throw new Exception();\r\n }\r\n /*if there is one or less points*/\r\n if(x.length <2 || y.length <2)\r\n {\r\n System.out.println(\"Can't compute closest pair. Fewer inputs!\");\r\n throw new Exception();\r\n }\r\n /*if there are two points*/\r\n if(x.length == 2)\r\n {\r\n Point[] closest = {new Point(x[0],y[0]), new Point(x[1],y[1])};\r\n return closest;\r\n }\r\n /*if there are three points*/\r\n if(x.length == 3)\r\n {\r\n double cx1 = x[0], cy1 = y[0], cx2 = x[1], cy2 = y[1];\r\n //P0 and P1\r\n double cdist = Math.pow((cx1-cx2),2) + Math.pow((cy1-cy2),2); //ignoring square root to reduce computation time\r\n //P1 and P2\r\n double dist = Math.pow((x[0]-x[2]),2) + Math.pow((y[0]-y[2]),2);\r\n if(dist<cdist)\r\n {\r\n cx1 = x[0]; cy1 = y[0]; cx2 = x[2]; cy2 = y[2]; cdist = dist;\r\n }\r\n //P2 and P3\r\n dist = Math.pow((x[1]-x[2]),2) + Math.pow((y[1]-y[2]),2);\r\n if(dist<cdist)\r\n {\r\n cx1 = x[1]; cy1 = y[1]; cx2 = x[2]; cy2 = y[2]; cdist = dist;\r\n }\r\n Point[] closest = {new Point(cx1,cy1), new Point(cx2,cy2)};\r\n return closest;\r\n }\r\n \r\n //sorting based on x values\r\n int i=0;\r\n double z,zz;\r\n while (i < x.length) \r\n \t{\r\n \t\tif (i == 0 || x[i-1] <= x[i])\r\n \t\t\ti++;\r\n \t\telse \r\n \t\t{\r\n \t\t\tz = x[i];\r\n \t\t\tzz = y[i];\r\n \t\t\tx[i] = x[i-1];\r\n \t\t\ty[i] = y[i-1];\r\n \t\t\tx[--i] = z;\r\n \t\t\ty[i] = zz;\r\n \t\t}\r\n \t}\r\n \r\n //finding left closest pair\r\n Point[] closestL = closestPair(Arrays.copyOfRange(x, 0, x.length/2),Arrays.copyOfRange(y, 0, y.length/2));\r\n //finding right closest pair\r\n Point[] closestR = closestPair(Arrays.copyOfRange(x, x.length/2, x.length),Arrays.copyOfRange(y, y.length/2, y.length));\r\n \r\n double distLsq = Math.pow((closestL[0].getX() - closestL[1].getX()),2) + Math.pow((closestL[0].getY() - closestL[1].getY()),2);\r\n double distRsq = Math.pow((closestR[0].getX() - closestR[1].getX()),2) + Math.pow((closestR[0].getY() - closestR[1].getY()),2);\r\n \r\n double minD;\r\n Point[] closest;\r\n if(distLsq<distRsq)\r\n {\r\n minD = distLsq;\r\n closest = closestL;\r\n }\r\n else \r\n {\r\n minD = distRsq;\r\n closest = closestR;\r\n }\r\n \r\n double midLine = ((x[x.length/2-1]) + (x[x.length/2]))/2;\r\n \r\n //System.out.println(Arrays.toString(x));\r\n //System.out.println(\"midline... x = \" + midLine);\r\n \r\n /*looking at points at a horizontal distance of minD from the mid line*/\r\n for(i = 0; i < x.length/2; i++)\r\n {\r\n if(midLine - x[i] < minD)\r\n {\r\n for(int j = x.length/2; j < x.length; j++)\r\n {\r\n /*looking at points at a vertical and horizontal distance of minD from the current point*/\r\n if((x[j] - midLine < minD) && (y[j] - y [i] < minD || y[i] - y [j] < minD))\r\n {\r\n if(Math.pow((x[i] - x[j]),2) + Math.pow((y[i] - y[j]),2) < minD)\r\n {\r\n closest = new Point[]{new Point(x[i],y[i]), new Point(x[j],y[j])};\r\n minD = Math.pow((x[i] - x[j]),2) + Math.pow((y[i] - y[j]),2);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return closest;\r\n \r\n }", "Execution getClosestDistance();", "private Vector<Integer> matchCheckPoint(List<Point> a) {\t\t\t\n\t\tVector<Integer> iDS= new Vector<>();\n\t\tfor(Point p :a) {\n\t\t\tif(!getAsphalt(p.x, p.y,this.trk).isIdDefalt()) {\n\t\t\t\tiDS.add(getAsphalt(p.x, p.y,this.trk).getId());\n\t\t\t}\n\t\t}\n\t\treturn iDS;\n\t}", "private Point[] nearestPair3Points(Point[] range) {\n\t\t\tif (range.length < 2)\treturn null; \n\t\t\tif (range.length == 2)\treturn range; \n\t\t\t//else - its mean that we have 3 points in the array\n\t\t\tPoint[] Answer = new Point[2];\n\t\t\tdouble currentMinDistance = Distance(range[0], range[1]);\n\t\t\tAnswer[0]= range[0];\n\t\t\tAnswer[1]= range[1];\n\t\t\tif (Distance(range[0], range[2]) < currentMinDistance){\n\t\t\t\tcurrentMinDistance = Distance(range[0], range[2]);\n\t\t\t\tAnswer[0]= range[0];\n\t\t\t\tAnswer[1]= range[2];\n\t\t\t}\n\t\t\tif (Distance(range[1], range[2]) < currentMinDistance){\n\t\t\t\tAnswer[0]= range[1];\n\t\t\t\tAnswer[1]= range[2];\n\t\t\t}\n\t\t\treturn Answer;\n\t\t}", "synchronized protected int findNearestPoint(final int x_p, final int y_p, final long layer_id) {\n \t\tint index = -1;\n \t\tdouble min_dist = Double.MAX_VALUE;\n \t\tfor (int i=0; i<n_points; i++) {\n \t\t\tif (layer_id != p_layer[i]) continue;\n \t\t\tdouble sq_dist = Math.pow(p[0][i] - x_p, 2) + Math.pow(p[1][i] - y_p, 2);\n \t\t\tif (sq_dist < min_dist) {\n \t\t\t\tindex = i;\n \t\t\t\tmin_dist = sq_dist;\n \t\t\t}\n \t\t}\n \t\treturn index;\n \t}", "@Override\r\n public Point nearest(double x, double y) {\r\n Point input = new Point(x, y);\r\n Point ans = points.get(0);\r\n double dist = Point.distance(ans, input);\r\n for (Point point : points) {\r\n if (Point.distance(point, input) < dist) {\r\n ans = point;\r\n dist = Point.distance(ans, input);\r\n }\r\n }\r\n return ans;\r\n }", "private int closest(double [] v){\n \t\tdouble mindist = dist(v, nCentroids[0]);\n \t\tint label =0;\n \t\tfor (int i=1; i<nClusters; i++){\n \t\t\tdouble t = dist(v, nCentroids[i]);\n \t\t\tif (mindist>t){\n \t\t\t\tmindist = t;\n \t\t\t\tlabel = i;\n \t\t\t}\n \t\t}\n \t\treturn label;\n \t}", "public static void main(String[] args) {\n MaxDistance max = new MaxDistance();\n //int arr[] = {9, 2, 3, 4, 5, 6, 7, 8, 18, 0};\n\n //int arr[] = {3, 5, 4, 2};\n //int arr[] = {3,2,1};\n //int arr[] = {1,10};\n int arr[] = {100, 100, 100}; //return 0, not checking equal value\n \n //int arr[] = { 83564666, 2976674, 46591497, 24720696, 16376995, 63209921, 25486800, 49369261, 20465079, 64068560, 7453256, 14180682, 65396173, 45808477, 10172062, 28790225, 82942061, 88180229, 62446590, 77573854, 79342753, 2472968, 74250054, 17223599, 47790265, 24757250, 40512339, 24505824, 30067250, 82972321, 32482714, 76111054, 74399050, 65518880, 94248755, 76948016, 76621901, 46454881, 40376566, 13867770, 76060951, 71404732, 21608002, 26893621, 27370182, 35088766, 64827587, 67610608, 90182899, 66469061, 67277958, 92926221, 58156218, 44648845, 37817595, 46518269, 44972058, 27607545, 99404748, 39262620, 98825772, 89950732, 69937719, 78068362, 78924300, 91679939, 52530444, 71773429, 57678430, 75699274, 5835797, 74160501, 51193131, 47950620, 4572042, 85251576, 49493188, 77502342, 3244395, 51211050, 44229120, 2135351, 47258209, 77312779, 37416880, 59038338, 96069936, 20766025, 35497532, 67316276, 38312269, 38357645, 41600875, 58590177, 99257528, 99136750, 4796996, 84369137, 54237155, 64368327, 94789440, 40718847, 12226041, 80504660, 8177227, 85151842, 36165763, 72764013, 36326808, 80969323, 22947547, 76322099, 7536094, 18346503, 65759149, 45879388, 53114170, 92521723, 15492250, 42479923, 20668783, 64053151, 68778592, 3669297, 73903133, 28973293, 73195487, 64588362, 62227726, 17909010, 70683505, 86982984, 64191987, 71505285, 45949516, 28244755, 33863602, 18256044, 25110337, 23997763, 81020611, 10135495, 925679, 98158797, 73400633, 27282156, 45863518, 49288993, 52471826, 30553639, 76174500, 28828417, 41628693, 80019078, 64260962, 5577578, 50920883, 16864714, 54950300, 9267396, 56454292, 40872286, 33819401, 75369837, 6552946, 26963596, 22368984, 43723768, 39227673, 98188566, 1054037, 28292455, 18763814, 72776850, 47192134, 58393410, 14487674, 4852891, 44100801, 9755253, 37231060, 42836447, 38104756, 77865902, 67635663, 43494238, 76484257, 80555820, 8632145, 3925993, 81317956, 12645616, 23438120, 48241610, 20578077, 75133501, 46214776, 35621790, 15258257, 20145132, 32680983, 94521866, 43456056, 19341117, 29693292, 38935734, 62721977, 31340268, 91841822, 22303667, 96935307, 29160182, 61869130, 33436979, 32438444, 87945655, 43629909, 88918708, 85650550, 4201421, 11958347, 74203607, 37964292, 56174257, 20894491, 33858970, 45292153, 22249182, 77695201, 34240048, 36320401, 64890030, 81514017, 58983774, 88785054, 93832841, 12338671, 46297822, 26489779, 85959340 };\n\n //int arr[] = { 46158044, 9306314, 51157916, 93803496, 20512678, 55668109, 488932, 24018019, 91386538, 68676911, 92581441, 66802896, 10401330, 57053542, 42836847, 24523157, 50084224, 16223673, 18392448, 61771874, 75040277, 30393366, 1248593, 71015899, 20545868, 75781058, 2819173, 37183571, 94307760, 88949450, 9352766, 26990547, 4035684, 57106547, 62393125, 74101466, 87693129, 84620455, 98589753, 8374427, 59030017, 69501866, 47507712, 84139250, 97401195, 32307123, 41600232, 52669409, 61249959, 88263327, 3194185, 10842291, 37741683, 14638221, 61808847, 86673222, 12380549, 39609235, 98726824, 81436765, 48701855, 42166094, 88595721, 11566537, 63715832, 21604701, 83321269, 34496410, 48653819, 77422556, 51748960, 83040347, 12893783, 57429375, 13500426, 49447417, 50826659, 22709813, 33096541, 55283208, 31924546, 54079534, 38900717, 94495657, 6472104, 47947703, 50659890, 33719501, 57117161, 20478224, 77975153, 52822862, 13155282, 6481416, 67356400, 36491447, 4084060, 5884644, 91621319, 43488994, 71554661, 41611278, 28547265, 26692589, 82826028, 72214268, 98604736, 60193708, 95417547, 73177938, 50713342, 6283439, 79043764, 52027740, 17648022, 33730552, 42851318, 13232185, 95479426, 70580777, 24710823, 48306195, 31248704, 24224431, 99173104, 31216940, 66551773, 94516629, 67345352, 62715266, 8776225, 18603704, 7611906 };\n\n int n = arr.length;\n int maxDiff = max.maxIndexDiff(arr, n);\n System.out.println(maxDiff);\n }", "private int getDistanceIndex(int point) {\n switch (point) {\n case 0:\n return -1; /* no start for point 0 */\n case 1:\n return 0;\n default:\n int n = point - 1;\n return ((n * n) + n) / 2;\n }\n }", "@Override\n public Point nearest(double x, double y) {\n double distance = Double.POSITIVE_INFINITY;\n Point nearestPoint = new Point(0, 0);\n Point targetPoint = new Point(x, y);\n\n for (Point p : pointsList) {\n double tempdist = Point.distance(p, targetPoint);\n if (tempdist < distance) {\n distance = tempdist;\n nearestPoint = p;\n }\n }\n\n return nearestPoint;\n }", "public int startPointRow(Array a){\n\t\tint max = a.getFirstDimension();\n\t\tRandom rand = new Random();\n\t\tint random = Math.abs(rand.nextInt()) % max;\n\t\tint startPoint = random;\n\t\treturn startPoint;\n\t}", "private void findLargestNNIPointsIndexPair(float ratioInh, float ratioAct) {\n ArrayList<Point> pts0 = new ArrayList<Point>();\n ArrayList<Point> pts1 = new ArrayList<Point>();\n Dimension dim = layoutPanel.getLayoutSize();\n int height = dim.height;\n int width = dim.width;\n int size = height * width;\n int newNListSize;\n if (ratioInh > ratioAct) {\n newNListSize = (int) (size * ratioInh);\n pts0 = cnvIndexList2Points(layoutPanel.activeNList);\n pts1 = cnvIndexList2Points(layoutPanel.inhNList);\n } else {\n newNListSize = (int) (size * ratioAct);\n pts0 = cnvIndexList2Points(layoutPanel.inhNList);\n pts1 = cnvIndexList2Points(layoutPanel.activeNList);\n }\n double len = Math.sqrt((double) size / (double) newNListSize);\n\n ArrayList<Point> union = new ArrayList<Point>(pts0);\n union.addAll(pts1);\n double maxNNI = calcNearestNeighborIndex(union);\n ArrayList<Point> maxPts0 = pts0;\n ArrayList<Point> maxPts1 = pts1;\n for (int xShift = (int) Math.floor(-len / 2); xShift <= Math\n .ceil(len / 2); xShift++) {\n for (int yShift = (int) Math.floor(-len / 2); yShift <= Math\n .ceil(len / 2); yShift++) {\n if (xShift == 0 && yShift == 0) {\n continue;\n }\n int xShift0 = (int) Math.ceil((double) xShift / 2);\n int xShift1 = (int) Math.ceil((double) -xShift / 2);\n int yShift0 = (int) Math.ceil((double) yShift / 2);\n int yShift1 = (int) Math.ceil((double) -yShift / 2);\n // System.out.println(\"xShift = \" + xShift + \", xShift0 = \" +\n // xShift0 + \", xShift1 = \" + xShift1);\n ArrayList<Point> sftPts0 = getShiftedPoints(pts0, xShift0,\n yShift0);\n ArrayList<Point> sftPts1 = getShiftedPoints(pts1, xShift1,\n yShift1);\n union = new ArrayList<Point>(sftPts0);\n union.addAll(sftPts1);\n double nni = calcNearestNeighborIndex(union);\n if (nni > maxNNI) {\n maxNNI = nni;\n maxPts0 = sftPts0;\n maxPts1 = sftPts1;\n }\n }\n }\n\n if (ratioInh > ratioAct) {\n layoutPanel.activeNList = cnvPoints2IndexList(maxPts0);\n layoutPanel.inhNList = cnvPoints2IndexList(maxPts1);\n } else {\n layoutPanel.inhNList = cnvPoints2IndexList(maxPts0);\n layoutPanel.activeNList = cnvPoints2IndexList(maxPts1);\n }\n }", "private int distance(int[] a, int[] b) {\n return Math.abs(a[0] - b[0]) + Math.abs(a[1] - b[1]);\n }", "private Point calcLocation(String tagID){\t\t\t\n\t\tDate now = new Date();\n\t\tclass referenceDist implements Comparable<referenceDist>{\n\t\t\tString referenceID;\n\t\t\tDouble inverseDistance;\n\t\t\t\n\t\t\tpublic referenceDist(String id, double distance){\n\t\t\t\tthis.referenceID = id;\n\t\t\t\tthis.inverseDistance = new Double(distance);\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic int compareTo(referenceDist o) {\n\t\t\t\t\n\t\t\t\treturn o.inverseDistance.compareTo(this.inverseDistance);\n\t\t\t}\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tArrayList<referenceDist> referenceList = new ArrayList<referenceDist>();\t\t\n\t\tfor (int i = 0 ; i < (referenceTags.size()); i++){\n\t\t\tString referenceID = referenceTags.get(i);\n\t\t\t//System.err.printf(\"Comparing tag %s with readings: %s\\r\\n\", tagID, tags.get(tagID).toString());\n\t\t\tint distance = tags.get(tagID).calcDiff(tags.get(referenceID));\n\t\t\t//System.err.printf(\"Reference tag %s with readings: %s\\r\\n\", referenceID, tags.get(referenceID).toString());\n\t\t\tdouble power = 0;\n\t\t\tif (distance == 0){\n\t\t\t\tpower = 10;\n\t\t\t} else {\n\t\t\t\tpower = 1.0/distance;\n\t\t\t}\n\t\t\t\n\t\t\treferenceList.add(new referenceDist(referenceID, power));\n\t\t}\n\t\t\n\t\tCollections.sort(referenceList);\n//\t\tIterator<referenceDist> iter = referenceList.iterator();\n//\t\tSystem.out.printf(\"START\\r\\n\");\n//\t\twhile(iter.hasNext()){\n//\t\t\treferenceDist dist = iter.next();\n//\t\t System.out.printf(\"'%s : %s'\", dist.referenceID, dist.inverseDistance.toString());\n//\t\t}\n//\t\tSystem.out.printf(\"\\r\\nEND\\r\\n\");\n\t\tint neighbours = Math.min(maxNeighbours, referenceList.size());\n\t\tdouble total = 0;\n\t\tdouble x = 0;\n\t\tdouble y = 0;\n\t\tdouble diff = 0;\n\t\tfor (int i = 1; i <= neighbours; i++){\n\t\t\ttotal += referenceList.get(i).inverseDistance;\n\t\t}\n\t\tfor (int i = 1; i <= neighbours; i++){\n\t\t\tPoint current = tags.get(referenceList.get(i).referenceID).getLoc();\n\t\t\tx += (referenceList.get(i).inverseDistance / total) * current.getX();\n\t\t\ty += (referenceList.get(i).inverseDistance / total) * current.getY();\n\t\t}\n\t\tif (tagID.equals(\"03BD\")){\n\t\t\tdiff = Math.sqrt(Math.pow((x-345),2) + Math.pow((y-200),2));\n\t\t} else if (tagID.equals(\"03B8\")){\n\t\t\tdiff = Math.sqrt(Math.pow((x-345),2) + Math.pow((y-300),2));\n\t\t} else if (tagID.equals(\"03D3\")){\n\t\t\tdiff = Math.sqrt(Math.pow((x-345),2) + Math.pow((y-400),2));\n\t\t}\n\t\tlog(String.valueOf(diff)+ \"\\r\\n\", tagID+ \"_4.log\");\t\t\n\t\t\t\n\n\t\tPoint location = new Point((int )x, (int)y);\n\t\tlog(String.valueOf(now.getTime()) + \"\\r\\n\", \"time.log\");\t\t\t\n\n\t//\tlog(String.valueOf(now.getTime()) + \": Tag=\"+ tagID + \" x=\" + String.valueOf(x) + \" y=\"+String.valueOf(y)+\"\\r\\n\", \"tagLocationLogfile.log\");\n\t\t\n\t\treturn location;\n\t}", "private Point getClosestPoint(Point[] mapPoints, Point newPoint) {\n for (int i = 0; i < mapPoints.length; i++) {\n if (ShortestPath.distance(newPoint, mapPoints[i]) < 30) {\n newPoint.x = mapPoints[i].x + 10;\n newPoint.y = mapPoints[i].y + 10;\n return newPoint;\n }\n }\n return null;\n }", "private static int distClosestNumbers(int[] numbers) {\n // try to implement it!\n if (numbers.length < 2) {\n return 0;\n }\n // O(n log(n))\n Arrays.sort(numbers);\n var preLastEl = numbers[numbers.length - 2];\n var lastEl = numbers[numbers.length - 1];\n return lastEl - preLastEl;\n }", "static int[] closestNumbers(int[] arr) {\n\t\t\n \tList<Integer> res = new ArrayList<Integer>();\n \tArrays.sort(arr);\n \tint min=arr[1]-arr[0];\n \tres.add(arr[0]);\n \tres.add(arr[1]);\n \tfor(int i=2;i<arr.length;i++) {\n \t\tint nMin = arr[i]-arr[i-1];\n \t\tif(nMin<min) {\n \t\t\tres.clear();\n \t\t\tres.add(arr[i-1]);\n \t\t\tres.add(arr[i]);\n \t\t\tmin=nMin;\n \t\t}else if(nMin==min) {\n \t\t\tres.add(arr[i-1]);\n \t\t\tres.add(arr[i]);\n \t\t}\n \t}\n \tint res_f [] = new int[res.size()];\n \tfor(int j=0; j<res_f.length; j++) {\n \t\tres_f[j]=res.get(j);\n \t} \n \treturn res_f;\n }", "private void calculateDistances(int point) {\n int start = getDistanceIndex(point);\n\n for (int i = 0; i < point; i++) {\n distances[start + i] = getDistance(ntree.get(point), ntree.get(i));\n }\n\n int numPoints = getNumPoints();\n\n for (int i = point + 1; i < numPoints; i++) {\n start = getDistanceIndex(i);\n distances[start + point] = getDistance(ntree.get(point),\n ntree.get(i));\n }\n }", "public int[] getClosestInput(int[] input) {\n\t\tint minDist = input.length;\n\t\tint minIndex = 0;\n\t\tfor(int i = 0 ; i < this.inputs.size() ; i++) {\n\t\t\tint d = this.hammingDistance(input, this.inputs.get(i));\n\t\t\tif(d < minDist) {\n\t\t\t\tminDist = d;\n\t\t\t\tminIndex = i;\n\t\t\t}\n\t\t}\n\t\treturn this.inputs.get(minIndex);\n\t}", "public Point2D nearest(Point2D p) {\n \n if (p == null)\n throw new IllegalArgumentException(\"Got null object in nearest()\");\n \n double rmin = 2.;\n Point2D pmin = null;\n \n for (Point2D q : point2DSET) {\n \n double r = q.distanceTo(p);\n if (r < rmin) {\n \n rmin = r;\n pmin = q;\n }\n }\n return pmin;\n }", "public Point2D nearest(Point2D p) {\n if (isEmpty()) {\n return null;\n }\n double minDistance = Double.POSITIVE_INFINITY;\n Point2D nearest = null;\n for (Point2D i : pointsSet) {\n if (i.distanceTo(p) < minDistance) {\n nearest = i;\n minDistance = i.distanceTo(p);\n }\n }\n return nearest;\n\n }", "private Point findFront(Point[] points) {\n\t\t// Loop through the passed points.\n\t\tdouble[] dists = new double[3];\n\t\tfor (int i = 0; i < 3; i++) {\n\t\t\t// Get outer-loop point.\n\t\t\tPoint a = points[i];\n\t\t\t\n\t\t\t// Loop through rest of points.\n\t\t\tfor (int k = 0; k < 3; k++) {\n\t\t\t\t// Continue if current outer.\n\t\t\t\tif (i == k) continue;\n\t\t\t\t\n\t\t\t\t// Get inner-loop point.\n\t\t\t\tPoint b = points[k];\n\t\t\t\t\n\t\t\t\t// Add distance between out and inner.\n\t\t\t\tdists[i] += Math.sqrt(\n\t\t\t\t\tMath.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Prepare index and largest holder.\n\t\tint index = 0;\n\t\tdouble largest = 0;\n\t\t\n\t\t// Loop through the found distances.\n\t\tfor (int i = 0; i < 3; i++) {\n\t\t\t// Skip if dist is lower than largest.\n\t\t\tif (dists[i] < largest) continue;\n\t\t\t\n\t\t\t// Save the index and largest value.\n\t\t\tindex = i;\n\t\t\tlargest = dists[i];\n\t\t}\n\t\t\n\t\t// Return the largest point index.\n\t\treturn points[index];\n\t}", "private static Pair closest_pair(ArrayList<Point> pointset){\n\t\treturn null;\n\t}", "static double minimalDistance(int[] x, int y[]) {\n Point[] points = new Point[x.length];\n for (int i = 0; i < x.length; i++) {\n points[i] = new Point(x[i], y[i]);\n }\n\n Arrays.sort(points, (a, b) -> a.x == b.x ? Long.signum(a.y - b.y) : Long.signum(a.y - b.y));\n\n PairPoint minPointsDistance = getMinPointsDistance(points, 0, x.length);\n return minPointsDistance == null ? -1 : minPointsDistance.distance;\n }", "private GeoPoint getClosestPoint(List<GeoPoint> points) {\r\n\t\tGeoPoint closestPoint = null;\r\n\t\tdouble distance = Double.MAX_VALUE;\r\n\r\n\t\tPoint3D P0 = _scene.get_camera().get_p0();\r\n\r\n\t\tfor (GeoPoint i : points) {\r\n\t\t\tdouble tempDistance = i.point.distance(P0);\r\n\t\t\tif (tempDistance < distance) {\r\n\t\t\t\tclosestPoint = i;\r\n\t\t\t\tdistance = tempDistance;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn closestPoint;\r\n\r\n\t}", "private void findPoints(int[] xPoints,int[]yPoints,int x,int y,int x2,int h){\r\n xPoints[0]=x;\r\n xPoints[1]=x2;\r\n xPoints[2]=x;\r\n yPoints[0]=y;\r\n yPoints[1]=y+h/2;\r\n yPoints[2]=y+h; \r\n }", "private static int arrayDpHopper(int[] array) {\n\t\tint[] jumps = new int[array.length];\n\t\tif(array[0]==0||array.length==0){\n\t\t\treturn Integer.MAX_VALUE;\n\t\t}\n\t\tjumps[0]=0;\n\t\tfor(int i=1;i<array.length;i++){\n\t\t\tjumps[i]=Integer.MAX_VALUE;\n\t\t\tfor(int j=0;j<i;j++){\n\t\t\t\tif(i<=j + array[j] && jumps[j]!=Integer.MAX_VALUE){\n\t\t\t\t\tjumps[i] = arrayHopper.getMin(jumps[i],jumps[j]+1);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn jumps[array.length-1];\n\t}", "public double getDistFromOthers(int[] point) {\n\t\tdouble minDist = Double.MAX_VALUE;\n\t\tfor (int[] current : points) {\n\t\t\tdouble dist = distance(point, current);\n\t\t\tif (dist < minDist) {\n\t\t\t\tminDist = dist;\n\t\t\t}\n\t\t}\n\t\treturn minDist;\n\t}", "public static double closestDistance2(Point[] points) {\n double closest = points[0].distance(points[1]);\n for (int i = 0; i < points.length; i++) {\n for (int j = i + 1; j < points.length; j++) {\n double dist = points[i].distance(points[j]);\n closest = Math.min(closest, dist);\n }\n }\n return closest;\n }", "public Coordinates closestPointA() {\n return closestPointA;\n }", "static double sol4(int[] a,int[] b){\r\n \tint mid1=0,mid2= 0;\r\n \tif((a.length+b.length)%2==0) {\r\n \t\tmid1 = (a.length+b.length)/2 -1;\r\n \t\tmid2 = mid1 + 1;\r\n \t\t}else {\r\n \t\t\tmid1 = mid2 = (a.length+b.length)/2;\r\n \t\t}\r\n \t\tint[] ab = new int[a.length+b.length];\r\n \t\tint i=0,j=0,count=0;\r\n\t\twhile (i<a.length && j<b.length){\r\n\t\t\tif (a[i]<b[j]){ \r\n\t\t\t\tab[count++]=a[i++];\r\n\t\t\t}else{\r\n\t\t\t\tab[count++]=b[j++];\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (i==a.length){\r\n\t\t\twhile (j<b.length){\r\n\t\t\t\tab[count++]=b[j++];\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\twhile (i<a.length){\r\n\t\t\t\tab[count++]=a[i++];\r\n\t\t\t}\r\n\t\t}\r\n\t\t//for (int n =0; n< ab.length;n++){\r\n\t\t//\tSystem.out.println(ab[n]);\r\n\t\t//}\r\n\t\tdouble ans = -1;\r\n\t\tif (mid1 == mid2){\r\n\t\t\tans = (double) ab[mid1];\r\n\t\t\treturn ans;\r\n\t\t}\r\n\t\tans = (double) (ab[mid1]+ab[mid2])/2;\r\n\t\treturn ans;\r\n\r\n }", "public int findPeak(int[] A) {\n // write your code here\n int start = 0, end = A.length - 1;\n while (start + 1 < end) {\n int mid = start + (end - start) / 2;\n if (A[mid] < A[mid + 1]) {\n start = mid;\n }\n else {\n end = mid;\n }\n }\n return A[start] > A[end] ? start : end;\n }", "void findLeadrsInArray1(int[] a){\n\t\tint n = a.length;\n\t\tboolean flag = true;\n\t\tfor(int i =0;i<n;i++){\n\t\t\tfor(int j=i+1;j<n;j++){\n\t\t\t\tif(a[i] < a[j]){\n\t\t\t\t\tflag = false; \n\t\t\t\t}\n\t\t\t}\n\t\t\tif(flag != false){\n\t\t\t\tSystem.out.println(a[i]);\n\t\t\t}\n\t\t}\n\t}", "Point findNearestActualPoint(Point a, Point b) {\n\t\tPoint left = new Point(a.x-this.delta/3,a.y);\n\t\tPoint right = new Point(a.x+this.delta/3,a.y);\n\t\tPoint down = new Point(a.x,a.y-this.delta/3);\n\t\tPoint up = new Point(a.x,a.y+this.delta/3);\n\t\tPoint a_neighbor = left;\n\t\tif (distance(right,b) < distance(a_neighbor,b)) a_neighbor = right;\n\t\tif (distance(down,b) < distance(a_neighbor,b)) a_neighbor = down;\n\t\tif (distance(up,b) < distance(a_neighbor,b)) a_neighbor = up;\n\n\t\treturn a_neighbor;\n\t}", "private int annaEtaisyys(int x1, int y1, int x2, int y2)\n\t{\n\t\tdouble a = x1 - x2;\n\t\tdouble b = y1 - y2;\n\t\t\n\t\treturn (int) Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2));\n\t}", "static boolean findBridge(Triangulator triRef, int ind, int i, int start,\n\t\t\t int[] ind1, int[] i1) {\n\tint i0, i2, j, numDist = 0;\n\tint ind0, ind2;\n\tBBox bb;\n\tDistance old[] = null;\n\tboolean convex, coneOk;\n\n\t// sort the points according to their distance from start.\n\tind1[0] = ind;\n\ti1[0] = i;\n\tif (i1[0] == start) return true;\n\tif (numDist >= triRef.maxNumDist) {\n\t // System.out.println(\"(1) Expanding distances array ...\");\n\t triRef.maxNumDist += triRef.INC_DIST_BK;\n\t old = triRef.distances;\n\t triRef.distances = new Distance[triRef.maxNumDist];\n\t System.arraycopy(old, 0, triRef.distances, 0, old.length);\n\t for (int k = old.length; k < triRef.maxNumDist; k++)\n\t\ttriRef.distances[k] = new Distance();\n\t}\n\n\ttriRef.distances[numDist].dist = Numerics.baseLength(triRef.points[start],\n\t\t\t\t\t\t\t triRef.points[i1[0]]);\n\ttriRef.distances[numDist].ind = ind1[0];\n\t++numDist;\n\n\n\tind1[0] = triRef.fetchNextData(ind1[0]);\n\ti1[0] = triRef.fetchData(ind1[0]);\n\twhile (ind1[0] != ind) {\n\t if (i1[0] == start) return true;\n\t if (numDist >= triRef.maxNumDist) {\n\t\t// System.out.println(\"(2) Expanding distances array ...\");\n\t\ttriRef.maxNumDist += triRef.INC_DIST_BK;\n\t\told = triRef.distances;\n\t\ttriRef.distances = new Distance[triRef.maxNumDist];\n\t\tSystem.arraycopy(old, 0, triRef.distances, 0, old.length);\n\t\tfor (int k = old.length; k < triRef.maxNumDist; k++)\n\t\t triRef.distances[k] = new Distance();\n\t }\n\n\t triRef.distances[numDist].dist = Numerics.baseLength(triRef.points[start],\n\t\t\t\t\t\t\t\t triRef.points[i1[0]]);\n\t triRef.distances[numDist].ind = ind1[0];\n\t ++numDist;\n\t ind1[0] = triRef.fetchNextData(ind1[0]);\n\t i1[0] = triRef.fetchData(ind1[0]);\n\t}\n\n\t// qsort(distances, num_dist, sizeof(distance), &d_comp);\n\tsortDistance(triRef.distances, numDist);\n\n\t// find a valid diagonal. note that no node with index i1 > start can\n\t// be feasible!\n\tfor (j = 0; j < numDist; ++j) {\n\t ind1[0] = triRef.distances[j].ind;\n\t i1[0] = triRef.fetchData(ind1[0]);\n\t if (i1[0] <= start) {\n\t\tind0 = triRef.fetchPrevData(ind1[0]);\n\t\ti0 = triRef.fetchData(ind0);\n\t\tind2 = triRef.fetchNextData(ind1[0]);\n\t\ti2 = triRef.fetchData(ind2);\n\t\tconvex = triRef.getAngle(ind1[0]) > 0;\n\n\t\tconeOk = Numerics.isInCone(triRef, i0, i1[0], i2, start, convex);\n\t\tif (coneOk) {\n\t\t bb = new BBox(triRef, i1[0], start);\n\t\t if (!NoHash.noHashEdgeIntersectionExists(triRef, bb, -1, -1, ind1[0], -1))\n\t\t\treturn true;\n\t\t}\n\t }\n\t}\n\n\t// the left-most point of the hole does not lie within the outer\n\t// boundary! what is the best bridge in this case??? I make a\n\t// brute-force decision... perhaps this should be refined during a\n\t// revision of the code...\n\tfor (j = 0; j < numDist; ++j) {\n\t ind1[0] = triRef.distances[j].ind;\n\t i1[0] = triRef.fetchData(ind1[0]);\n\t ind0 = triRef.fetchPrevData(ind1[0]);\n\t i0 = triRef.fetchData(ind0);\n\t ind2 = triRef.fetchNextData(ind1[0]);\n\t i2 = triRef.fetchData(ind2);\n\t bb = new BBox(triRef, i1[0], start);\n\t if (!NoHash.noHashEdgeIntersectionExists(triRef, bb, -1, -1, ind1[0], -1))\n\t\treturn true;\n\t}\n\n\t// still no diagonal??? yikes! oh well, this polygon is messed up badly!\n\tind1[0] = ind;\n\ti1[0] = i;\n\n\treturn false;\n }", "static float stripClosest(ArrayList<Point> strip, float d) \n\t{ \n\t float min = d; // Initialize the minimum distance as d \n\t \n\t //This loop runs at most 7 times \n\t for (int i = 0; i < strip.size(); ++i) \n\t for (int j = i+1; j < strip.size() && (strip.get(j).y - strip.get(i).y) < min; ++j) \n\t if (Dist(strip.get(i),strip.get(j)) < min) \n\t min = Dist(strip.get(i), strip.get(j)); \n\t \n\t return min; \n\t}", "private static int findDuplicateIdeaFour(int[] array) {\n\t\tint index = 0;\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tindex = Math.abs(array[i]);\n\t\t\tif (array[index] < 0) {\n\t\t\t\treturn index;\n\t\t\t} else {\n\t\t\t\tarray[index] = -array[index];\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Not Found\");\n\t\treturn -1;\n\t}", "double getDistance(Point p);", "public Point2D nearest(Point2D p) {\n if (bst.isEmpty()) {\n return null;\n }\n\n Point2D nearest = null;\n double nearestDist = Double.POSITIVE_INFINITY;\n \n \n for (Point2D point: bst.keys()) {\n\n if (nearest == null \n || point != null \n && (nearestDist > point.distanceSquaredTo(p)\n && (!point.equals(p)))) {\n nearest = point;\n nearestDist = point.distanceSquaredTo(p);\n }\n \n }\n return nearest;\n }", "private void computeDistances() {\n for (int i = 0; i < groundTruthInstant.size(); ++i)\n for (int j = 0; j < estimatedInstant.size(); ++j) {\n float currentDist = groundTruthInstant.get(i).getDistanceTo(estimatedInstant.get(j).getPos());\n if (currentDist < distToClosestEstimate[i][0]) {\n distToClosestEstimate[i][0] = currentDist;\n distToClosestEstimate[i][1] = j;\n }\n }\n }", "synchronized protected int findClosestSegment(final int x_p, final int y_p, final long layer_id, final double mag) {\n\t\tif (1 == n_points) return -1;\n \t\tif (0 == n_points) return -1;\n \t\tint index = -1;\n \t\tdouble d = (10.0D / mag);\n \t\tif (d < 2) d = 2;\n \t\tdouble sq_d = d*d;\n \t\tdouble min_sq_dist = Double.MAX_VALUE;\n \t\tfinal Calibration cal = layer_set.getCalibration();\n \t\tfinal double z = layer_set.getLayer(layer_id).getZ() * cal.pixelWidth;\n \n \t\tdouble x2 = p[0][0] * cal.pixelWidth;\n \t\tdouble y2 = p[1][0] * cal.pixelHeight;\n \t\tdouble z2 = layer_set.getLayer(p_layer[0]).getZ() * cal.pixelWidth;\n \t\tdouble x1, y1, z1;\n \n \t\tfor (int i=1; i<n_points; i++) {\n \t\t\tx1 = x2;\n \t\t\ty1 = y2;\n \t\t\tz1 = z2;\n \t\t\tx2 = p[0][i] * cal.pixelWidth;\n \t\t\ty2 = p[1][i] * cal.pixelHeight;\n \t\t\tz2 = layer_set.getLayer(p_layer[i]).getZ() * cal.pixelWidth;\n \n \t\t\tdouble sq_dist = M.distancePointToSegmentSq(x_p * cal.pixelWidth, y_p * cal.pixelHeight, z,\n \t\t\t\t\t x1, y1, z1,\n \t\t\t\t\t\t\t\t x2, y2, z2);\n \n \t\t\tif (sq_dist < sq_d && sq_dist < min_sq_dist) {\n \t\t\t\tmin_sq_dist = sq_dist;\n \t\t\t\tindex = i-1; // previous\n \t\t\t}\n \t\t}\n \t\treturn index;\n \t}", "public Point2D nearest(Point2D p) {\n if (p == null) {\n throw new IllegalArgumentException();\n }\n if (isEmpty()) return null;\n\n Point2D nearestPoint = null;\n double distance = Double.NEGATIVE_INFINITY;\n for (Point2D point : points) {\n if (nearestPoint == null) {\n nearestPoint = point;\n distance = point.distanceSquaredTo(p);\n } else {\n double newDistance = point.distanceSquaredTo(p);\n if (newDistance < distance) {\n nearestPoint = point;\n distance = newDistance;\n }\n }\n }\n return nearestPoint;\n }", "public int startPointColumn(Array a){\n\t\tint max = a.getFirstDimension();\n\t\tRandom rand = new Random();\n\t\tint random = Math.abs(rand.nextInt()) % max;\n\t\tint startPoint = random;\n\t\treturn startPoint;\n\t}", "double distanceSq (IPoint p);", "public Point2D nearest(Point2D p) {\n Point2D nearest = null;\n double nearestDistance = Double.MAX_VALUE;\n for (Point2D cur: mPoints) {\n double distance = cur.distanceTo(p);\n if (nearestDistance > distance) {\n nearest = cur;\n nearestDistance = distance;\n }\n }\n return nearest;\n }", "private static double nearestNeighbour(List<Point> points, Point startPoint, Point endPoint) {\n double tentative_distance; // to evaluate nearest neighbour\n double cummulative_distance = 0; // cummulative distance of tour\n double dist; // temporary variable\n Point current = startPoint;\n //System.out.println(\"start at: #\" + current.getId());\n\n int indexToRemove = 0;\n int numberOfLoops = points.size() - 1;\n\n for (int i = 0; i <= numberOfLoops; i++) {\n //System.out.println(\"outerloop #\" + i);\n tentative_distance = Double.MAX_VALUE;\n // evaluate nearest neighbour\n for (int j = 0; j < points.size(); j++) {\n dist = getDistance(points.get(j), current);\n if (dist < tentative_distance) {\n tentative_distance = dist;\n indexToRemove = j;\n }\n }\n //System.out.println(\"next point: #\" + points.get(indexToRemove).getId());\n cummulative_distance += getDistance(points.get(indexToRemove), current);\n current = points.remove(indexToRemove);\n }\n // add distance to endpoint\n cummulative_distance += getDistance(current, endPoint);\n return cummulative_distance;\n }", "public abstract double distanceFrom(double x, double y);", "public static void main(String[] args) {\n int [] array1 = {30,12,5,9,2,20,33,1};\n int [] array2 = {18,25,41,47,17,36,14,19};\n int a=array1.length;\n int b=array2.length;\n System.out.println(\"The lowest differenc between two array is :\"+findLowestDiff(array1,array2,a,b));\n\n\n\n\n }", "void find_aoa_of_min_drag_slow () {\n recomp_all_parts();\n\n double min_drag = total_drag();\n double min_drag_aoa = craft_pitch;\n for (double p = aoa_min/2; p < aoa_max; p += 0.1) {\n craft_pitch = p;\n //computeFlowAndRegenPlotAndAdjust();\n recomp_all_parts();\n if (total_drag() < min_drag)\n min_drag_aoa = craft_pitch;\n }\n craft_pitch = min_drag_aoa;\n //computeFlowAndRegenPlotAndAdjust();\n recomp_all_parts();\n }", "static long closer(int arr[], int n, long x)\n {\n int index = binarySearch(arr,0,n-1,(int)x); \n return (long) index;\n }", "private double distanceResult(double preLng, double preLat, double nextLng, double nextLat) {\n\t\treturn Math.sqrt((preLng - nextLng) * (preLng - nextLng) + (preLat - nextLat) * (preLat - nextLat));\n\t}", "List<CoordinateDistance> getNearestCoordinates(Point coordinate, int n);", "private static List<Point> genererPointsAlea(int nbPoints) {\n /*List<Point> points = new ArrayList<>();\n Random rand = new Random(0);\n for(int i=0; i<nbPoints; i++) {\n Point p = new Point(rand.nextDouble(), rand.nextDouble());\n points.add(p);\n }\n return points;*/\n return null;\n }", "public int findLHSOrigin(int[] nums) {\n if (nums.length < 2)\n return 0;\n\n Map<Double, Integer> map = new HashMap<>();\n Set<Integer> set = new HashSet<>();\n for (int i = 0; i < nums.length; i++) {\n map.put(nums[i] - 0.5, map.getOrDefault(nums[i] - 0.5, 0) + 1);\n map.put(nums[i] + 0.5, map.getOrDefault(nums[i] + 0.5, 0) + 1);\n set.add(nums[i]);\n }\n\n int ans = 0;\n for (Double d : map.keySet()) {\n// System.out.println(d +\" \"+ map.get(d));\n if (set.contains((int) (d - 0.5)) && set.contains((int) (d + 0.5))) {\n ans = ans < map.get(d) ? map.get(d) : ans;\n }\n }\n return ans;\n }", "public Point2D nearest(Point2D p) \r\n\t{\r\n\t\treturn nearest(p, null, root, new RectHV(0,0,1,1));\r\n\t}", "int absoluteValuesSumMinimization(int[] a) {\n return a[(a.length-1)/2];\n }", "static void kClosestPoints(int x[], int y[], \n int n, int k) \n{ \n // Create a priority queue \n PriorityQueue<Pair> pq = new PriorityQueue<Pair>(); \n\n // Pushing all the points \n // in the queue \n for(int i = 0; i < n; i++) \n { \n pq.add(new Pair(x[i], y[i])); \n } \n\n // Print the first K elements \n // of the queue \n for(int i = 0; i < k; i++) \n { \n\n // Remove the top of the queue \n // and store in a temporary pair \n Pair p = pq.poll(); \n\n // Print the first (x) \n // and second (y) of pair \n System.out.println(p.first + \n \" \" + p.second); \n } \n}", "public List<Integer> findClosestElements2(int[] arr, int k, int x) {\r\n List<Integer> res = new LinkedList<>();\r\n int i=0, j=arr.length-k;\r\n while (i<j){\r\n int m = i + (j-i)/2;\r\n if (x-arr[m]>arr[m+k]-x){\r\n i=m+1;\r\n }\r\n else j=m;\r\n }\r\n // System.out.println(i);\r\n while (k>0){\r\n res.add(arr[i++]);\r\n k--;\r\n }\r\n return res;\r\n }", "public int[] kClosest(int[] array, int target, int k) {\n if (array.length==0){\n return new int[] {-1};\n }\n int left=0;\n int right=array.length-1;\n int[] result=new int[k];\n while(left<right-1){\n int mid = left+(right-left)/2;\n if (array[mid]==target){\n left=mid;\n right=mid;\n }else if (array[mid]>target){\n right = mid;\n }else{\n left = mid;\n }\n }\n //post processing\n for(int i=0;i<k;i++){ //逻辑运算符按顺序计算,如果先计算array【left】就有可能出界报错\n if( left<0 || (right<=array.length-1 && Math.abs(array[left]-target)>=Math.abs(array[right]-target))){\n result[i]=array[right];\n right++;\n }else{\n result[i]=array[left];\n left--;\n }\n }\n return result;\n }", "private static final int[] getPoint(int point) {\n int[] ret = new int[2];\n if (point >= firstPoint && point <= endPoint) {\n ret = getPoint(ruteData[point + 2]);//ruteData[point + 2]);\n }\n return ret;\n }", "@Override\n public List<STPoint> nearestNeighbor(STPoint needle, STPoint boundValues, int n, int dim) {\n\n STPoint min = new STPoint(needle.getX()-boundValues.getX(), needle.getY()-boundValues.getY(), needle.getT()-boundValues.getT());\n STPoint max = new STPoint(needle.getX()+boundValues.getX(), needle.getY()+boundValues.getY(), needle.getT()+boundValues.getT());\n\n STRegion range = new STRegion(min, max);\n List<STPoint> allPoints = range(range);\n\n Quicksort qs = new Quicksort();\n\n qs.sortNearPoints(needle, allPoints, 0, allPoints.size() - 1, dim);\n\n allPoints.remove(0);//remove itself\n while(allPoints.size() > n){\n allPoints.remove(allPoints.size()-1);\n }\n\n if(allPoints.size()< 1){return null;}////\n\n return allPoints;\n }", "public Coordinates midPoint(Coordinates a, Coordinates b);", "private double[] getGoalPointAtLookaheadDistance(\n double[] initialPointOfLine, double[] finalPointOfLine, double[] nearestPoint) {\n\n // TODO: use lookahead distance proportional to robot max speed -> 0.5 * getRobotMaxSpeed()\n return Geometry.getPointAtDistance(\n initialPointOfLine, finalPointOfLine, nearestPoint, lookaheadDistance);\n }", "@SuppressWarnings(\"unused\")\r\n private double[] getSeedPoint(double[] center) {\r\n double lowIntensity = -50;\r\n double highIntensity = 50;\r\n \r\n int originalX = (int)center[0], currentX = (int)center[0];\r\n int originalY = (int)center[1], currentY = (int)center[1];\r\n \r\n boolean pointFound = false;\r\n \r\n while(!pointFound && currentX < xDim) {\r\n if(srcImage.get(currentX, currentY, (int)center[2]).doubleValue() < highIntensity &&\r\n srcImage.get(currentX, currentY, (int)center[2]).doubleValue() > lowIntensity) {\r\n pointFound = true;\r\n break;\r\n }\r\n if(currentX - originalX > currentY - originalY)\r\n currentY++;\r\n else\r\n currentX++;\r\n }\r\n \r\n if(pointFound) {\r\n center[0] = currentX;\r\n center[1] = currentY;\r\n }\r\n \r\n return center;\r\n \r\n }", "public static int findClosest(int[] array, int value){\n if(value < array[0]) return array[0];\n if(value > array[array.length-1]) return array[array.length-1];\n\n int low = 0;\n int high = array.length -1;\n\n while(low <= high){\n int mid = (low+high)/2;\n if(array[mid] == value) return array[mid];\n else if(array[mid] < value) low = mid+1;\n else high = mid-1;\n }\n\n return ((array[low] - value) < (value - array[high])) ? array[low] : array[high];\n }", "public double calDistance()\n {\n double closest = poly[0].getD();\n\n for(int i = 1; i < sides; i++)\n {\n if(closest > poly[i].getD())\n {\n closest = poly[i].getD();\n }\n }\n this.distance = closest;\n\n return closest;\n }", "private double findDistance(int[] pos1, int[] pos2) {\n return sqrt((pos1[0]-pos2[0])*(pos1[0]-pos2[0])+\n (pos1[1]-pos2[1])*(pos1[1]-pos2[1]));\n }", "synchronized protected int findPoint(final int x_p, final int y_p, final long layer_id, final double mag) {\n \t\tint index = -1;\n \t\tdouble d = (10.0D / mag);\n \t\tif (d < 2) d = 2;\n \t\tdouble min_dist = Double.MAX_VALUE;\n \t\tfor (int i=0; i<n_points; i++) {\n \t\t\tdouble dist = Math.abs(x_p - p[0][i]) + Math.abs(y_p - p[1][i]);\n \t\t\tif (layer_id == p_layer[i] && dist <= d && dist <= min_dist) {\n \t\t\t\tmin_dist = dist;\n \t\t\t\tindex = i;\n \t\t\t}\n \t\t}\n \t\treturn index;\n \t}", "private static double calculDistanceTourneeAlea(List<Point> points, Random rand) {\n double distance = 0;\n Collections.shuffle(points, rand);\n Point courant = points.get(0);\n Point suivant;\n for(int i=1; i<points.size(); i++) {\n suivant = points.get(i);\n distance += courant.getDistance(suivant);\n courant = suivant;\n }\n suivant = points.get(0);\n distance += courant.getDistance(suivant);\n return distance;\n }", "public Point getClosest(){\n\t\t\tdouble distance;\n\t\t\tdouble distanceMax = 0.0;\n\t\t\tPoint centroid = centroid();\n\t\t\tPoint furthermost = new Point();\n\t\t\tfor(Point p : clusterPointsList){\n\t\t\t\tdistance = p.dist(centroid);\t\t\t\n\t\t\t\tif(distance > distanceMax){\n\t\t\t\t\tdistanceMax = distance;\n\t\t\t\t\tfurthermost = p;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn furthermost;\n\t\t}", "public int FindNearbyPts(Vector CurvData, int Eleindex, Stroke theStroke){\n\t\tint index;\n\t\tVector WinElements = new Vector();\n\t\tint CurvEleIndex;\n\t\tDouble minDistance = 999.0; // initialized to some larger value say 999.0\n\t\tDouble Distance;\n\t\tint ReturnIndex = -1;\n\t\tint min = Eleindex - PixelIndexWindow;\n\t\tint max = Eleindex + PixelIndexWindow;\n\t\tfor(index=0;index<CurvData.size(); index++){\n\t\t\tCurvEleIndex = (Integer)CurvData.elementAt(index);\n\t\t\tif(CurvEleIndex >= min && CurvEleIndex <= max){\n\t\t\t\t\tVector ptList = theStroke.getM_ptList();\n\t\t\t\t\tPoint CurvPt = ((PixelInfo) ptList.get(CurvEleIndex));\n\t\t\t\t\tPoint SpeedPt = ((PixelInfo)ptList.get(Eleindex));\n\t\t\t\t\tif((Distance = SpeedPt.distance(CurvPt)) < TolerantDistance){\n\t\t\t\t\t\tif(minDistance > Distance){\n\t\t\t\t\t\t\tminDistance = Distance;\n\t\t\t\t\t\t\tReturnIndex = index;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn ReturnIndex;\n\t}", "public MapLocation findNearestArchon() {\n MapLocation origin = rc.getLocation();\n MapLocation nearestAction = null;\n float nearestDistance = 9999f;\n\n for (int i = 0; i < enemyArchonCount; ++i) {\n ArchonLocation loc = archonLocations[i];\n if (loc.isDead()) continue;\n float distance = loc.location.distanceSquaredTo(origin);\n if (nearestAction == null || distance < nearestDistance) {\n nearestAction = loc.location;\n nearestDistance = distance;\n }\n }\n\n return nearestAction;\n }", "public int a(alq paramalq, int paramInt1, int paramInt2, fn paramfn)\r\n/* 120: */ {\r\n/* 121:137 */ int i = 0;\r\n/* 122: */ amj localamj;\r\n/* 123: */ int k;\r\n/* 124:138 */ for (int j = 0; j < this.a.length; j++)\r\n/* 125: */ {\r\n/* 126:139 */ localamj = this.a[j];\r\n/* 127:140 */ if (localamj != null) {\r\n/* 128:143 */ if ((paramalq == null) || (localamj.b() == paramalq)) {\r\n/* 129:146 */ if ((paramInt1 <= -1) || (localamj.i() == paramInt1)) {\r\n/* 130:149 */ if ((paramfn == null) || (cy.a(paramfn, localamj.o(), true)))\r\n/* 131: */ {\r\n/* 132:153 */ k = paramInt2 <= 0 ? localamj.b : Math.min(paramInt2 - i, localamj.b);\r\n/* 133:154 */ i += k;\r\n/* 134:155 */ if (paramInt2 != 0)\r\n/* 135: */ {\r\n/* 136:156 */ this.a[j].b -= k;\r\n/* 137:157 */ if (this.a[j].b == 0) {\r\n/* 138:158 */ this.a[j] = null;\r\n/* 139: */ }\r\n/* 140:160 */ if ((paramInt2 > 0) && (i >= paramInt2)) {\r\n/* 141:161 */ return i;\r\n/* 142: */ }\r\n/* 143: */ }\r\n/* 144: */ }\r\n/* 145: */ }\r\n/* 146: */ }\r\n/* 147: */ }\r\n/* 148: */ }\r\n/* 149:165 */ for (j = 0; j < this.b.length; j++)\r\n/* 150: */ {\r\n/* 151:166 */ localamj = this.b[j];\r\n/* 152:167 */ if (localamj != null) {\r\n/* 153:170 */ if ((paramalq == null) || (localamj.b() == paramalq)) {\r\n/* 154:173 */ if ((paramInt1 <= -1) || (localamj.i() == paramInt1)) {\r\n/* 155:176 */ if ((paramfn == null) || (cy.a(paramfn, localamj.o(), false)))\r\n/* 156: */ {\r\n/* 157:180 */ k = paramInt2 <= 0 ? localamj.b : Math.min(paramInt2 - i, localamj.b);\r\n/* 158:181 */ i += k;\r\n/* 159:182 */ if (paramInt2 != 0)\r\n/* 160: */ {\r\n/* 161:183 */ this.b[j].b -= k;\r\n/* 162:184 */ if (this.b[j].b == 0) {\r\n/* 163:185 */ this.b[j] = null;\r\n/* 164: */ }\r\n/* 165:187 */ if ((paramInt2 > 0) && (i >= paramInt2)) {\r\n/* 166:188 */ return i;\r\n/* 167: */ }\r\n/* 168: */ }\r\n/* 169: */ }\r\n/* 170: */ }\r\n/* 171: */ }\r\n/* 172: */ }\r\n/* 173: */ }\r\n/* 174:193 */ if (this.f != null)\r\n/* 175: */ {\r\n/* 176:194 */ if ((paramalq != null) && (this.f.b() != paramalq)) {\r\n/* 177:195 */ return i;\r\n/* 178: */ }\r\n/* 179:197 */ if ((paramInt1 > -1) && (this.f.i() != paramInt1)) {\r\n/* 180:198 */ return i;\r\n/* 181: */ }\r\n/* 182:200 */ if ((paramfn != null) && (!cy.a(paramfn, this.f.o(), false))) {\r\n/* 183:201 */ return i;\r\n/* 184: */ }\r\n/* 185:204 */ j = paramInt2 <= 0 ? this.f.b : Math.min(paramInt2 - i, this.f.b);\r\n/* 186:205 */ i += j;\r\n/* 187:206 */ if (paramInt2 != 0)\r\n/* 188: */ {\r\n/* 189:207 */ this.f.b -= j;\r\n/* 190:208 */ if (this.f.b == 0) {\r\n/* 191:209 */ this.f = null;\r\n/* 192: */ }\r\n/* 193:211 */ if ((paramInt2 > 0) && (i >= paramInt2)) {\r\n/* 194:212 */ return i;\r\n/* 195: */ }\r\n/* 196: */ }\r\n/* 197: */ }\r\n/* 198:217 */ return i;\r\n/* 199: */ }", "public int a(PathPoint[] var0, PathPoint var1) {\n/* 53 */ int var2 = 0;\n/* 54 */ int var3 = 1;\n/* */ \n/* 56 */ BlockPosition var4 = new BlockPosition(var1.a, var1.b, var1.c);\n/* 57 */ double var5 = b(var4);\n/* */ \n/* 59 */ PathPoint var7 = a(var1.a, var1.b, var1.c + 1, 1, var5);\n/* 60 */ PathPoint var8 = a(var1.a - 1, var1.b, var1.c, 1, var5);\n/* 61 */ PathPoint var9 = a(var1.a + 1, var1.b, var1.c, 1, var5);\n/* 62 */ PathPoint var10 = a(var1.a, var1.b, var1.c - 1, 1, var5);\n/* 63 */ PathPoint var11 = a(var1.a, var1.b + 1, var1.c, 0, var5);\n/* 64 */ PathPoint var12 = a(var1.a, var1.b - 1, var1.c, 1, var5);\n/* */ \n/* 66 */ if (var7 != null && !var7.i) {\n/* 67 */ var0[var2++] = var7;\n/* */ }\n/* 69 */ if (var8 != null && !var8.i) {\n/* 70 */ var0[var2++] = var8;\n/* */ }\n/* 72 */ if (var9 != null && !var9.i) {\n/* 73 */ var0[var2++] = var9;\n/* */ }\n/* 75 */ if (var10 != null && !var10.i) {\n/* 76 */ var0[var2++] = var10;\n/* */ }\n/* 78 */ if (var11 != null && !var11.i) {\n/* 79 */ var0[var2++] = var11;\n/* */ }\n/* 81 */ if (var12 != null && !var12.i) {\n/* 82 */ var0[var2++] = var12;\n/* */ }\n/* */ \n/* 85 */ boolean var13 = (var10 == null || var10.l == PathType.OPEN || var10.k != 0.0F);\n/* 86 */ boolean var14 = (var7 == null || var7.l == PathType.OPEN || var7.k != 0.0F);\n/* 87 */ boolean var15 = (var9 == null || var9.l == PathType.OPEN || var9.k != 0.0F);\n/* 88 */ boolean var16 = (var8 == null || var8.l == PathType.OPEN || var8.k != 0.0F);\n/* */ \n/* 90 */ if (var13 && var16) {\n/* 91 */ PathPoint var17 = a(var1.a - 1, var1.b, var1.c - 1, 1, var5);\n/* 92 */ if (var17 != null && !var17.i) {\n/* 93 */ var0[var2++] = var17;\n/* */ }\n/* */ } \n/* 96 */ if (var13 && var15) {\n/* 97 */ PathPoint var17 = a(var1.a + 1, var1.b, var1.c - 1, 1, var5);\n/* 98 */ if (var17 != null && !var17.i) {\n/* 99 */ var0[var2++] = var17;\n/* */ }\n/* */ } \n/* 102 */ if (var14 && var16) {\n/* 103 */ PathPoint var17 = a(var1.a - 1, var1.b, var1.c + 1, 1, var5);\n/* 104 */ if (var17 != null && !var17.i) {\n/* 105 */ var0[var2++] = var17;\n/* */ }\n/* */ } \n/* 108 */ if (var14 && var15) {\n/* 109 */ PathPoint var17 = a(var1.a + 1, var1.b, var1.c + 1, 1, var5);\n/* 110 */ if (var17 != null && !var17.i) {\n/* 111 */ var0[var2++] = var17;\n/* */ }\n/* */ } \n/* */ \n/* 115 */ return var2;\n/* */ }", "public static void main(String args[]){\n\t\tint a[]={4,3,5,2,1,3,2,3};\n\t\t\n\t\t//Missed 1 part::\n\t\t//Need to skip the equals, as they don't satisfy the condition, a[i] < a[j] \n\t\tSystem.out.println(maxDistance(a));\t\n\t\t\n\t}", "public static int[] getMinKthNearestN(double[][] pts, int k){\n if(k>= pts.length){\n int[] indexs = new int[k];\n for(int i = 0;i<indexs.length;i++){\n indexs[i] = i;\n }\n return indexs;\n }\n\n double[][] distanceTo = new double[pts.length][pts.length];\n int[][] indexs = new int[pts.length][pts.length];\n for(int i = 0; i<pts.length;i++){\n for(int j = 0; j<pts.length;j++){\n indexs[i][j] = j;\n distanceTo[i][j] = Math.pow(pts[i][0] - pts[j][0],2)+Math.pow(pts[i][1] - pts[j][1],2);\n }\n }\n\n\n for(int i = 0; i<pts.length;i++){\n iSort(indexs[i],distanceTo[i]);\n }\n\n double minKthNearestN = Double.POSITIVE_INFINITY;\n int pos = -1;\n for(int i = 0; i<pts.length;i++){\n if(distanceTo[i][k] < minKthNearestN){\n minKthNearestN = distanceTo[i][k];\n pos = i;\n }\n }\n int[] space = new int[k+1];\n for(int i = 0; i<=k; i++){\n space[i] = indexs[pos][i];\n }\n\n return space;\n }", "private double getNearestAEnergy() {\n\t\tdouble value = getInitialEnergy();\n\t\tdouble ret = value;\n\t\twhile (value < getaEnergy()) {\n\t\t\tdouble step = getPreEdgeStep();\n\t\t\t// avoid infinite loop\n\t\t\tif (step <= 0.0)\n\t\t\t\tstep = 1.0;\n\t\t\tvalue += step;\n\t\t\tif (value > getaEnergy())\n\t\t\t\tbreak;\n\t\t\tret = value;\n\t\t}\n\t\treturn ret;\n\t}", "protected int bestDirection(int _y, int _x)\n {\n int sX = -1, sY = -1;\n for (int i = 0; i < m; i++) {\n boolean breakable = false;\n for (int j = 0; j < n; j++) {\n if (map[i][j] == 'p' || map[i][j] == '5') {\n sX = i;\n sY = j;\n breakable = true;\n break;\n }\n }\n if(breakable) break;\n sX =0; sY = 0;\n }\n Pair s = new Pair(sX, sY);\n Queue<Pair> queue = new Queue<Pair>();\n int[][] distance = new int[m][n];\n for (int i = 0; i < m; i++)\n for (int j = 0; j < n; j++)\n distance[i][j] = -1;\n distance[sX][sY] = 0;\n queue.add(s);\n /*\n System.out.println(\"DEBUG TIME!!!!\");\n for(int i = 0; i < m; i++)\n {\n for(int j = 0; j < n; j++)\n System.out.print(map[i][j]);\n System.out.println();\n }\n System.out.println();\n */\n while (!queue.isEmpty())\n {\n Pair u = queue.remove();\n for (int i = 0; i < 4; i++)\n {\n int x = u.getX() + hX[i];\n int y = u.getY() + hY[i];\n if (!validate(x, y)) continue;\n if (distance[x][y] != -1) continue;\n if (!canGo.get(map[x][y])) continue;\n distance[x][y] = distance[u.getX()][u.getY()] + 1;\n queue.add(new Pair(x, y));\n }\n }\n\n //slove if this enemy in danger\n //System.out.println(_x + \" \" + _y);\n if (inDanger[_x][_y])\n {\n int direction = -1;\n boolean canAlive = false;\n int curDistance = dangerDistance[_x][_y];\n int distanceToBomber = m * n;\n if (curDistance == -1) return 0;\n for (int i = 0; i < 4; i++)\n {\n int x = _x + hX[i];\n int y = _y + hY[i];\n if (!validate(x, y)) continue;\n if (dangerDistance[x][y] == -1) continue;\n if (dangerDistance[x][y] < curDistance)\n {\n curDistance = dangerDistance[x][y];\n direction = i;\n distanceToBomber = distance[x][y];\n } else if (dangerDistance[x][y] == curDistance)\n {\n if (distanceToBomber == -1 || distanceToBomber > distance[x][y])\n {\n direction = i;\n distanceToBomber = distance[x][y];\n }\n }\n }\n if (direction == -1) direction = random.nextInt(4);\n allowSpeedUp = true;\n return direction;\n }\n // or not, it will try to catch bomber\n else\n {\n /*\n System.out.println(\"x = \" + _x + \"y = \" + _y);\n for(int i = 0; i < n; i++) System.out.printf(\"%2d \",i);\n System.out.println();\n for(int i = 0; i < m; i++)\n {\n for(int j = 0; j < n; j++)\n System.out.printf(\"%2d \",distance[i][j]);\n System.out.println();\n }\n System.out.println();\n System.out.println();\n */\n int direction = -1;\n int[] die = new int[4];\n for (int i = 0; i < 4; i++)\n die[i] = 0;\n int curDistance = distance[_x][_y];\n for (int i = 0; i < 4; i++)\n {\n int x = _x + hX[i];\n int y = _y + hY[i];\n if (!validate(x, y))\n {\n die[i] = 1;\n continue;\n }\n ;\n if (inDanger[x][y])\n {\n die[i] = 2;\n continue;\n }\n if (distance[x][y] == -1) continue;\n if (distance[x][y] < curDistance)\n {\n curDistance = distance[x][y];\n direction = i;\n }\n }\n if(curDistance < 4) allowSpeedUp = true;\n else allowSpeedUp = false; //TODO: TEST :))\n if (direction == -1)\n {\n for (int i = 0; i < 4; i++)\n if (die[i] == 0) return i;\n for (int i = 0; i < 4; i++)\n if (die[i] == 1) return i;\n return 0;\n } else return direction;\n }\n }", "protected Coordinates intersectionFromClosestPoints() {\n if (closestPointA != null && closestPointB != null\n && geometry.almostEqual(closestPointA, closestPointB)) {\n return closestPointA;\n } else {\n return null;\n }\n }", "public Point2D nearest(Point2D p) {\n if (p == null) throw new IllegalArgumentException(\"nearest: Point2D is null\");\n mindist = Double.POSITIVE_INFINITY;\n nearestSearch(p, root);\n return nearest;\n }", "double distance (IPoint p);", "public int serachMaxOrMinPoint(int [] A){\r\n\t\r\n\tint mid, first=0,last=A.length-1;\r\n\t\r\n\twhile( first <= last){\r\n\t\tif(first == last){\r\n\t\t\treturn A[first];\r\n\t\t}\r\n\t\telse if(first == last-1){\r\n\t\t\treturn Math.max(A[first], A[last]);\r\n\t\t\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\tmid= first + (last-first)/2;\r\n\t\t\t\r\n\t\t\tif(A[mid]>A[mid-1] && A[mid]>A[mid+1])\r\n\t\t\t\treturn A[mid];\r\n\t\t\telse if(A[mid]>A[mid-1] && A[mid]<A[mid+1])\r\n\t\t\t\tfirst=mid+1;\r\n\t\t\telse if(A[mid]<A[mid-1] && A[mid]>A[mid+1])\r\n\t\t\t\tlast=mid-1;\r\n\t\t\telse return -1;\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n\treturn -1;\r\n\t\r\n}" ]
[ "0.6635072", "0.61888695", "0.6142773", "0.6098727", "0.60667753", "0.59069383", "0.58801174", "0.5865531", "0.58468115", "0.5839513", "0.5808318", "0.58025277", "0.5791157", "0.5777135", "0.57690144", "0.57616043", "0.57563424", "0.57332885", "0.571779", "0.5686548", "0.5684588", "0.5684218", "0.56195897", "0.559799", "0.5595261", "0.55543774", "0.55451626", "0.5538241", "0.5537446", "0.5524193", "0.5521013", "0.5503815", "0.5499347", "0.54976445", "0.5494295", "0.5486427", "0.54673344", "0.54523724", "0.54471207", "0.544505", "0.544369", "0.54067785", "0.54011023", "0.5400421", "0.5400063", "0.5387686", "0.53762805", "0.53723955", "0.536761", "0.53663903", "0.5365328", "0.5347811", "0.53455585", "0.53295124", "0.5314769", "0.53051776", "0.52969784", "0.52851313", "0.528243", "0.52774864", "0.52767986", "0.52726865", "0.526722", "0.5266538", "0.5265773", "0.52585435", "0.5255186", "0.5252801", "0.52418435", "0.52360797", "0.52359235", "0.52356815", "0.52265644", "0.5216046", "0.52131504", "0.5212259", "0.5201992", "0.5188517", "0.51861095", "0.51794803", "0.5173204", "0.515937", "0.5151511", "0.51511496", "0.5143181", "0.5136793", "0.51305926", "0.5129418", "0.5126259", "0.5125025", "0.5123939", "0.51206636", "0.51190144", "0.51161355", "0.5104669", "0.51004475", "0.509948", "0.5098734", "0.5089749", "0.50855607" ]
0.6417323
1
Aid Function calculate the Distance between 2 point O(1)//
private double Distance(Point first, Point second){ // distance between two points return Math.sqrt(Math.pow(second.getY()-first.getY(),2) + Math.pow(second.getX()-first.getX(),2)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int distance(Coord coord1, Coord coord2);", "public static double getDist(int id1, int id2) {\n\t\tArrayList<Double> gA1 = geneAttributes.get(id1);\n\t\tArrayList<Double> gA2 = geneAttributes.get(id2);\n\t\tdouble dist = 0;\n\t\tfor(int i=0;i<gA1.size();i++) {\n\t\t\tdist += ( (gA1.get(i) - gA2.get(i)) * (gA1.get(i) - gA2.get(i)) );\n\t\t}\n\t\tdist = Math.sqrt(dist);\n\t\treturn dist;\n\t}", "public abstract double calculateDistance(double[] x1, double[] x2);", "private static int dist(int x1, int y1, int x2, int y2) {\n\t\treturn (int) Math.sqrt(Math.abs(((x2-x1) * (x2-x1)) + ((y2-y1) * (y2-y1))));\n\t}", "private double getDistance(float x, float y, float x1, float y1) {\n double distanceX = Math.abs(x - x1);\n double distanceY = Math.abs(y - y1);\n return Math.sqrt(distanceX * distanceX + distanceY * distanceY);\n }", "private int distance(int[] a, int[] b) {\n return Math.abs(a[0] - b[0]) + Math.abs(a[1] - b[1]);\n }", "private double distance (double lata, double lona, double latb, double lonb) { \r\n return Math.acos(Math.sin(lata)*Math.sin(latb)+Math.cos(lata)*Math.cos(latb)*Math.cos(lonb-lona))*6371;\r\n }", "double distance(double x1, double y1, double x2, double y2) {\r\n return Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));\r\n }", "private double distance(Point a, Point b) {\n\t\tDouble xdist = new Double( a.x - b.x );\n\t\tDouble ydist = new Double( a.y - b.y );\n\t\treturn Math.sqrt( Math.pow(xdist, 2.0) + Math.pow(ydist, 2.0) );\n\t}", "private double d(Point a, Point b){\n\t\treturn Math.sqrt(Math.pow(b.getX()-a.getX(),2) + Math.pow(a.getY() - b.getY(), 2));\r\n\t}", "private double DistancePoint(Point a, Point b) {\n\t\tdouble ab = Math.sqrt( \n\t\t\t\tMath.pow( (b.getX() - a.getX()) , 2) +\n\t\t\t\tMath.pow( (b.getY() - a.getY()) , 2)\n\t\t);\n\t\treturn ab;\n\t}", "static Number160 distance(final Number160 id1, final Number160 id2) {\n return id1.xor(id2);\n }", "static double distance(double x1, double y1, double x2, double y2)\n {\n double x_dist = x2 - x1;\n double y_dist = y2 - y1;\n double dist = Math.sqrt(Math.pow(x_dist, 2) + Math.pow(y_dist, 2));\n return dist;\n }", "private int annaEtaisyys(int x1, int y1, int x2, int y2)\n\t{\n\t\tdouble a = x1 - x2;\n\t\tdouble b = y1 - y2;\n\t\t\n\t\treturn (int) Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2));\n\t}", "private static double getDistance(final WayNodeOSM a, final WayNodeOSM b) {\n \t\tdouble latA = a.getLatitude()/180*Math.PI;\n \t\tdouble latB = b.getLatitude()/180*Math.PI;\n \t\tdouble lonDif = (b.getLongitude() - a.getLongitude())/180*Math.PI;\n \t\treturn (Math.acos((Math.sin(latA) * Math.sin(latB)) + (Math.cos(latA) * Math.cos(latB) * Math.cos(lonDif))) * 6367500);\n \t}", "public int calculateDistance(GraphNodeAL<MapPoint> l1, GraphNodeAL<MapPoint> l2){\n double x1 = l1.data.getxCo();\n double y1 = l1.data.getyCo();\n double x2 = l2.data.getxCo();\n double y2 = l2.data.getyCo();\n double dist = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));\n return (int) dist;\n }", "public static S1Angle getDistance(S2Point x, S2Point a, S2Point b) {\n Preconditions.checkArgument(S2.isUnitLength(x), \"S2Point not normalized: %s\", x);\n Preconditions.checkArgument(S2.isUnitLength(a), \"S2Point not normalized: %s\", a);\n Preconditions.checkArgument(S2.isUnitLength(b), \"S2Point not normalized: %s\", b);\n return S1Angle.radians(getDistanceRadians(x, a, b, S2.robustCrossProd(a, b)));\n }", "static double distance(Point a, Point b) {\n\t\tint xDiff = a.x - b.x;\n\t\tint yDiff = a.y - b.y;\n\t\treturn Math.sqrt((xDiff * xDiff) + (yDiff * yDiff));\n\t}", "Integer distance(PathFindingNode a, PathFindingNode b);", "public static double mahnattan(InputSpacePoint a , InputSpacePoint b) {\n double sum = 0.0;\n for(String s : a.getKeysAsCollection()) {\n sum += Math.abs(a.getValue(s) - b.getValue(s));\n }\n return sum;\n }", "private static double angulo(Point2D.Double p2,Point2D.Double p1){\n \t\n return Math.atan2(p2.x - p1.x, p2.y - p1.y);\n }", "public final double calcDistance( Point a, Point b )\r\n {\r\n return( Math.sqrt( (Math.pow(a.y - b.y, 2)) +\r\n (Math.pow(a.x - b.x, 2)) ) );\r\n }", "private static double distance(double x, double y, double x1, double x2,\n\t\t\tdouble y1, double y2) {\n\t\tPoint p = new Point(x, y);\n\t\tPoint p1 = new Point(x1, y1);\n\t\tPoint p2 = new Point(x2, y2);\n\t\treturn p.distance(p1, p2);\n\t}", "public abstract double distanceFrom(double x, double y);", "private double findDistance(int[] pos1, int[] pos2) {\n return sqrt((pos1[0]-pos2[0])*(pos1[0]-pos2[0])+\n (pos1[1]-pos2[1])*(pos1[1]-pos2[1]));\n }", "private double distance(Point A, Point B) {\n\t\tdouble dX = A.x - B.x;\n\t\tdouble dY = A.y - B.y;\n\t\treturn Math.sqrt(dX * dX + dY * dY);\n\t}", "public static String distance(String x1, String x2){\n\n }", "private static double get_distance ( String one, String two){\n String temp[] = one.split(\" \");\n double lat1 = Double.parseDouble(temp[0]);\n double long1 = Double.parseDouble(temp[1]);\n\n String temp2[] = two.split(\" \");\n double lat2 = Double.parseDouble(temp2[0]);\n double long2 = Double.parseDouble(temp2[1]);\n\n// Get distance between two lats and two lans\n double latDistance = Math.toRadians(lat1 - lat2);\n double lngDistance = Math.toRadians(long1 - long2);\n\n// Step 1\n double a = (Math.sin ( latDistance / 2 ) * Math.sin (latDistance / 2)) +\n (Math.cos ( Math.toRadians(lat1)) * Math.cos(Math.toRadians(lat2)) )\n * ( Math.sin (lngDistance /2 ) * Math.sin(lngDistance / 2) );\n// Step 2\n double c = ( 2 * (Math.atan2( Math.sqrt(a), Math.sqrt(1-a))));\n// Step 3\n double d = ( EARTH_RADIUS * c );\n return d;\n }", "public double distance(double x, double y);", "public abstract double getDistance(T o1, T o2) throws Exception;", "private double calculateDis(double lata, double lona, double latb, double lonb){\n\t\tdouble lon2latRatio = Math.cos(lata * 3.14159 / 180.0);\n\t\tdouble milesperDegreeLat = 69.0;\n\t\tdouble milesperDegreeLon = milesperDegreeLat * lon2latRatio;\n\t\tdouble distance = 0.0;\n\t\tdistance = Math.sqrt((milesperDegreeLat * (latb - lata))\n\t\t\t\t* (milesperDegreeLat * (latb - lata))\n\t\t\t\t+ (milesperDegreeLon * (lonb - lona))\n\t\t\t\t* (milesperDegreeLon * (lonb - lona)));\n\t\treturn distance;\n\t}", "double dist(pair p1){\n\t\tdouble dx=(p1.x-centre.x);\n\t\tdouble dy=(p1.y-centre.y);\n\t\tcount++;\n\t\treturn java.lang.Math.sqrt((dx*dx)+(dy*dy));\n\t}", "private double calcSide(int x1,int y1, int x2, int y2){\n \n double distance1 = Math.sqrt(Math.pow(x2 - x1,2) + Math.pow(y2-y1,2));\n \n return distance1;\n \n \n \n }", "public static double getDistance(int x1, int y1, int x2, int y2)\n {\n double dx = x2 - x1;\n double dy = y2 - y1;\n\n // return Math.hypot(x2 - x1, y2 - y1); // Extremely slow\n // return Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2)); // 20 times faster than hypot\n return Math.sqrt(dx * dx + dy * dy); // 10 times faster then previous line\n }", "private int distance(Point p1, Point p2) {\n return (int) Math.sqrt(Math.pow(p1.getCenterX() - p2.getCenterX(), 2) + Math.pow(p1.getCenterY() - p2.getCenterY(), 2));\n }", "private double calculateDistance(int sourceX, int sourceY, int targetX, int targetY){\n int xLength = targetX - sourceX;\n int yLength = targetY - sourceY;\n return Math.sqrt((xLength*xLength)+(yLength*yLength)); \n }", "public double distance(double x1, double y1, double x2, double y2)\n {\n return Math.sqrt(Math.pow((x2 - x1), 2) + Math.pow(y2 - y1, 2));\n }", "private static double calculateDistance(Position A, Position B) {\n\t\tdouble x = (B.m_dLongitude - A.m_dLongitude) * Math.cos( (A.m_dLatitude + B.m_dLatitude) / 2.0d);\n\t\tdouble y = B.m_dLatitude - A.m_dLatitude;\n\t\treturn Math.sqrt(Math.pow(x, 2.0d) + Math.pow(y, 2.0d)) * 6371;\n\t}", "static private double dist(double[] a, double[] b) {\n\t\treturn new gov.pnnl.jac.geom.distance.Euclidean().distanceBetween(a, b);\n }", "double distance(Point p1,Point p2){\n\t\tdouble dx = p1.x - p2.x;\n\t\tdouble dy = p1.y - p2.y;\n\t\treturn Math.sqrt(dx*dx+dy*dy);\n\t}", "double getDistance();", "public double calculateDistance(MapLocation a, MapLocation b) {\r\n\t\treturn Math.sqrt((double) ( Math.pow((b.x - a.x),2) + Math.pow((b.y - a.y),2) ));\r\n\t}", "public static double distancia(Entidade e1,Entidade e2){\r\n\t\tdouble dx = e1.getPosicaoX() - e2.getPosicaoX();\r\n\t\tdouble dy = e1.getPosicaoY() - e2.getPosicaoY();\r\n\t\tdouble d = Math.sqrt(dx*dx + dy*dy);\r\n\t\treturn d;\r\n\t}", "private double distance(double lat1, double lon1, double lat2, double lon2) {\r\n double theta = lon1 - lon2;\r\n double dist = Math.sin(deg2rad(lat1))\r\n * Math.sin(deg2rad(lat2))\r\n + Math.cos(deg2rad(lat1))\r\n * Math.cos(deg2rad(lat2))\r\n * Math.cos(deg2rad(theta));\r\n dist = Math.acos(dist);\r\n dist = rad2deg(dist);\r\n dist = dist * 60 * 1.1515;\r\n return (dist);\r\n }", "public double arcDistance(double lat1, double lon1, double lat2, double lon2) {\n return UmxSloppyMath.haversinMeters(lat1, lon1, lat2, lon2);\n }", "double getDistance(Point p);", "public static EquationExpression dist2(final EquationPoint a, final EquationPoint b) {\n EquationExpression x = diff(a.getXExpression(), b.getXExpression());\n EquationExpression y = diff(a.getYExpression(), b.getYExpression());\n return sum(times(x,x), times(y,y));\n }", "private static double getA(Point p_p1, Point p_p2, Point q_p1, Point q_p2){\n\t\tdouble a1, a2;\n\t\ta1 = q_p2.coordinate[0] - q_p1.coordinate[0] - \n\t\t\t p_p2.coordinate[0] + p_p1.coordinate[0];\t\t\n\t\ta2 = q_p2.coordinate[1] - q_p1.coordinate[1] - \n\t\t\t p_p2.coordinate[1] + p_p1.coordinate[1];\n\t\t\t\t\n\t\tdouble a = Math.pow(a1,2) + Math.pow(a2,2);\n\t\t\n\t\treturn a;\n\t}", "private double calculateDistance(Circle point1, Circle point2) {\r\n double x = point1.getCenterX() - point2.getCenterX();\r\n double y = point1.getCenterY() - point2.getCenterY();\r\n\r\n return Math.sqrt(x*x + y*y);\r\n }", "public double distancia2(GPS a2,GPS a3){\n return this.distancia(a2)+a2.distancia(a3);\n }", "public static double getDistance( GameObject one, GameObject two )\n {\n double deltaX = getDeltaX( one, two );\n double deltaY = getDeltaY( one, two );\n return Math.sqrt( deltaX * deltaX + deltaY * deltaY );\n }", "public double calculateDistance(double latitude1, double longitude1, double latitude2, double longitude2)\n {\n latitude1 = Math.toRadians(latitude1);\n longitude1 = Math.toRadians(longitude1);\n latitude2 = Math.toRadians(latitude2);\n longitude2 = Math.toRadians(longitude2);\n\n double dlon = longitude2 - longitude1;\n double dlat = latitude2 - latitude1;\n\n double a = Math.pow((Math.sin(dlat/2)),2) + Math.cos(latitude1) * Math.cos(latitude2) * Math.pow(Math.sin(dlon/2),2);\n\n double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));\n //System.out.println(\"a: \" + a + \";c: \" + c + \";result: \" + (r*c));\n return r * c;\n }", "public double distance(V a, V b);", "public static double absoluteDistance(Prototype one, Prototype two)\r\n {\r\n double[] oneInputs = one.getInputs();\r\n double[] twoInputs = two.getInputs();\r\n //int _size = one.numberOfInputs();\r\n double acc = 0.0;\r\n for (int i = 0; i < numberOfInputs; ++i)\r\n {\r\n acc += Math.abs(oneInputs[i] - twoInputs[i]);\r\n }\r\n\r\n return acc;\r\n }", "public int distanceApart(int[] move1, int[] move2) {\r\n\t\treturn 1;\r\n\t}", "double distance (IPoint p);", "public static double getDistance(GPSCoordinates point1, GPSCoordinates point2) {\r\n\t\t\r\n\t\treturn EARTH_RADIUS * 2 * Math.atan2( Math.sqrt( getHaversinePart(point1, point2)), Math.sqrt( getHaversinePart(point1, point2) ) );\r\n\t}", "private double calculateDistance(int pointA, int pointB) {\n if (pointA <= pointB) {\n throw new IllegalArgumentException(\n \"pointA must be greater than pointB - A: \" + pointA\n + \" B: \" + pointB);\n }\n\n int start = getDistanceIndex(pointA);\n\n double distance = getDistance(ntree.get(pointA), ntree.get(pointB));\n distances[start + pointB] = distance;\n\n return distance;\n }", "private Integer getDistance(double lat1, double lon1, double lat2, double lon2) {\n Location locationA = new Location(\"Source\");\n locationA.setLatitude(lat1);\n locationA.setLongitude(lon1);\n Location locationB = new Location(\"Destination\");\n locationB.setLatitude(lat2);\n locationB.setLongitude(lon2);\n distance = Math.round(locationA.distanceTo(locationB));\n return distance;\n }", "public static double eucleidian(InputSpacePoint a, InputSpacePoint b) {\n double sum =0.0;\n for(String s : a.getKeysAsCollection()) {\n sum += Math.pow(a.getValue(s)-b.getValue(s), 2);\n }\n return Math.sqrt(sum);\n }", "public static double distance(double x1, double y1, double x2, double y2) {\n\t\tdouble r1 = x2 - x1;\n\t\tdouble r2 = y2 - y1;\n\t\treturn Math.sqrt(r1 * r1 + r2 * r2);\n\t}", "static double distance(Point p1, Point p2) {\n\t\treturn Math.sqrt((p2.x - p1.x)*(p2.x - p1.x) + (p2.y - p1.y)*(p2.y - p1.y));\n\t}", "private float angleDistance(float from, float to) {\n float d = to - from;\n if (d > Math.PI) {\n return d - (float) Math.PI;\n }\n if (d < -Math.PI) {\n return d + (float) Math.PI;\n }\n return d;\n }", "public double distance(Point a, Point b) {\n\t\tdouble dx = a.x - b.x;\n\t\tdouble dy = a.y - b.y;\n\t\treturn Math.sqrt(dx * dx + dy * dy);\n\t}", "@Override\n public float distanceAdjacent(int x1, int y1, int x2, int y2) {\n float duration = 0;\n\n if (x1 == x2 || y1 == y2) {\n MapTile.Instance fromTile = getTileData(x1, y1);\n MapTile.Instance toTile = getTileData(x2, y2);\n assert fromTile != null && toTile != null;\n\n Direction move = Direction.get(x2 - x1, y2 - y1);\n\n int fromHeight = fromTile.heightOf(move);\n int toHeight = toTile.heightOf(move.inverse());\n\n // steepness\n float t1inc = (fromHeight - fromTile.getHeight()) / (TILE_SIZE / 2);\n float t2inc = (toHeight - toTile.getHeight()) / (TILE_SIZE / 2);\n\n // actual duration of walking\n float walkSpeedT1 = (1f / hypoLength(t1inc)) * walkSpeed;\n float walkSpeedT2 = (1f / hypoLength(t2inc)) * walkSpeed;\n\n // duration += walkspeed(steepness_1) * dist + walkspeed(steepness_2) * dist\n duration += (walkSpeedT1 + walkSpeedT2) * TILE_SIZE;\n\n // height difference on the sides of the tiles\n float cliffHeight = (toHeight - fromHeight) * TILE_SIZE_Z;\n\n // climbing if more than 'an acceptable height'\n if (cliffHeight > 0) {\n duration += (cliffHeight / climbSpeed);\n }\n\n } else {\n // TODO allow diagonal tracing\n Logger.WARN.print(String.format(\n \"Pathfinding (%s) asked for non-adjacent tiles (%d, %d) (%d, %d)\",\n getClass(), x1, y1, x2, y2\n ));\n\n return Float.POSITIVE_INFINITY;\n }\n\n return duration;\n }", "public static double GetDistance(double lat1, double lon1, double lat2, double lon2) {\n double radLat1 = rad(lat1);\n double radLat2 = rad(lat2);\n double a = radLat1 - radLat2;\n double b = rad(lon1) - rad(lon2);\n double s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) +\n Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2)));\n s = s * EARTH_RADIUS;//km\n// Log.e(\"s\", \"s=\" + s);\n return s;\n }", "public static EquationExpression dist2(final EquationPoint a,\n\t\t\tfinal EquationPoint b) {\n\t\tEquationExpression x = diff(a.getXExpression(), b.getXExpression());\n\t\tEquationExpression y = diff(a.getYExpression(), b.getYExpression());\n\t\treturn sum(times(x, x), times(y, y));\n\t}", "public static double getDistancia(Punto puntoA, Punto puntoB) {\r\n return Math.sqrt(Math.pow(puntoB.getX() - puntoA.getX(), 2) + Math.pow(puntoB.getY() - puntoA.getY(), 2));\r\n }", "double distance (double px, double py);", "private double calculateDistance(Example first, Example second) {\n\t\tdouble distance = 0;\n\t\tfor (Attribute attribute : first.getAttributes()) {\n\t\t\tdouble diff = first.getValue(attribute) - second.getValue(attribute);\n\t\t\tdistance += diff * diff;\n\t\t}\n\t\treturn Math.sqrt(distance);\n\t}", "private float distanceTo(BasicEvent event) {\n final float dx = event.x - location.x;\n final float dy = event.y - location.y;\n// return Math.abs(dx)+Math.abs(dy);\n return distanceMetric(dx, dy);\n// dx*=dx;\n// dy*=dy;\n// float distance=(float)Math.sqrt(dx+dy);\n// return distance;\n }", "public double Angle2D(double x1, double y1, double x2, double y2)\n {\n double dtheta,theta1,theta2;\n\n theta1 = Math.atan2(y1,x1);\n theta2 = Math.atan2(y2,x2);\n dtheta = theta2 - theta1;\n while (dtheta > Math.PI)\n dtheta -= 2*Math.PI;\n while (dtheta < -Math.PI)\n dtheta += 2*Math.PI;\n\n return(dtheta);\n}", "public double adicao (double numero1, double numero2){\n\t}", "protected double getDistance(Point p1, Point p2) {\n\t\treturn Math.sqrt((p1.getX()-p2.getX())*(p1.getX()-p2.getX()) + (p1.getY()-p2.getY())*(p1.getY()-p2.getY())); \n\t}", "public static double distance(double lat1, double lon1, double lat2, double lon2) {\n\n\n float[] dist = new float[1];\n Location.distanceBetween(lat1, lon1, lat2, lon2, dist);\n //Log.d(\"*******dist\", \":\" + dist[0]);\n return (dist[0]);\n //\n // double theta = lon1 - lon2;\n // double dist = Math.sin(deg2rad(lat1)) * Math.sin(deg2rad(lat2))\n // + Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2))\n // * Math.cos(deg2rad(theta));\n // dist = Math.acos(dist);\n // dist = rad2deg(dist);\n // dist = dist * 60; // 60 nautical miles per degree of seperation\n // dist = dist * 1852; // 1852 meters per nautical mile\n // return (dist);\n //\n }", "public int distance(String nounA, String nounB) {\n\t\tif (nounA == null || nounB == null)\n\t\t\tthrow new IllegalArgumentException();\n\t\treturn sap.length(nounToId.get(nounA), nounToId.get(nounB));\n\t}", "public double LengthA(){\n\t\treturn Math.abs(x2 - x1);\n\t}", "void calculateDistance()\t{\n\t\t\t\t\t\t\t\t\t\n\t\tfor (String substringOne : setOne)\t{\n\t\t\t\tif (setTwo.contains(substringOne))\n\t\t\t\t\toverlapSubstringCount++;\n\t\t}\t\t\t\t\t\t\t\n\n\t\tsubstringCount = (length1 - q) + (length2 - q) + 2 - overlapSubstringCount; \n\t\tdistance = (double)overlapSubstringCount/(substringCount - overlapSubstringCount);\t\n\t}", "public static double dist (Vertex a, Vertex b){\n return Math.sqrt((b.y-a.y)*(b.y-a.y) + (b.x-a.x)*(b.x-a.x));\n }", "private double distance(double lat1, double lon1, double lat2, double lon2) {\n double theta = lon1 - lon2;\r\n double dist = Math.sin(deg2rad(lat1)) * Math.sin(deg2rad(lat2)) + Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) * Math.cos(deg2rad(theta));\r\n dist = Math.acos(dist);\r\n dist = rad2deg(dist);\r\n dist = dist * 60 * 1.1515;\r\n dist = dist * 1.609344;\r\n return (dist); // return distance in kilometers\r\n }", "private static double calculaDistancia(double[] param1, double[] param2){\n\t\tdouble res1= Math.pow((param1[0]-param2[0]), 2);\n\t\tdouble res2= Math.pow((param1[1]-param2[1]), 2);\n\t\tdouble res3= Math.pow((param1[2]-param2[2]), 2);\n\t\tdouble res4= res1 + res2 + res3;\n\t\tdouble res5= res4/3;\n\t\tdouble res6= Math.sqrt(res5);\n\t\treturn res6;\n\t}", "public static double angularDistance(double a1, double a2) {\n return floorMod((a2 - a1 + Math.PI), PI2) - Math.PI;\n }", "public int distance(String nounA, String nounB){\n\n\n\n return 0;\n }", "private double distFrom(double lat1, double lng1, double lat2, double lng2) {\n\t\tdouble dist = Math.pow(lat1 - lat2, 2) + Math.pow(lng1 - lng2, 2);\n\n\t\treturn dist;\n\t}", "private static double distance(double lat1, double lat2, double lon1, double lon2,\n\t double el1, double el2) {\n\n\t final int R = 6371; // Radius of the earth\n\n\t Double latDistance = deg2rad(lat2 - lat1);\n\t Double lonDistance = deg2rad(lon2 - lon1);\n\t Double a = Math.sin(latDistance / 2) * Math.sin(latDistance / 2)\n\t + Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2))\n\t * Math.sin(lonDistance / 2) * Math.sin(lonDistance / 2);\n\t Double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n\t double distance = R * c * 1000; // convert to meters\n\n\t double height = el1 - el2;\n\t distance = Math.pow(distance, 2) + Math.pow(height, 2);\n\t return Math.sqrt(distance);\n\t}", "public static float getDistance(float x1, float y1, float x2, float y2)\r\n\t{\r\n\t\treturn (float) Math.sqrt(getSquareDistance(x1, y1, x2, y2));\r\n\t}", "public static int distanceBetweenNodes(Node node, int d1, int d2){\r\n ArrayList<Integer> path1 = nodeToRootPath(node, d1);\r\n ArrayList<Integer> path2 = nodeToRootPath(node, d2);\r\n \r\n //Traverse from behind to avoid time complexity\r\n int i = path1.size() - 1;\r\n int j = path2.size() - 1;\r\n \r\n //Check for valid iterations and till the time data is common, first occurence of diff data in arraulist is the time to stop\r\n while(i>=0 && j>=0 && path1.get(i) == path2.get(j)){\r\n i--; j--;\r\n }\r\n \r\n //Here returning i+1 and j+1 means there are i+1 elements left and j+1 elements left which are not common in \r\n //both ArrayList so answer will be addition of these, it will give us the distance between two nodes\r\n //+1 is two times for two edges between i to LCA and j to LCA\r\n return (i+1) + (j+1);\r\n }", "public static double distanceCalculator(Point a, Point b) {\n double distSquared = (Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2) + Math.pow(a.z - b.z, 2));\n return Math.sqrt(distSquared);\n }", "public float calculateAngle(float x1, float y1, float x2, float y2) {\n float difX = x1 - x2;\n float difY = y1 - y2;\n float angle = (float)(180.0 / Math.PI * Math.atan2(difY, difX));\n if(angle < 0) {\n return 360 + angle;\n }\n return angle;\n }", "private double distance(Position pos1, Position pos2)\r\n {\r\n assert pos1 != null;\r\n assert pos2 != null;\r\n\r\n int x = Math.abs(pos1.column() - pos2.column());\r\n int y = Math.abs(pos1.line() - pos2.line());\r\n\r\n return Math.sqrt(x * x + y * y);\r\n }", "public int findDistance(int p1X, int p1Y, int p2X, int p2Y) {\n\t\tint distance = (int) (Math.sqrt(Math.pow((p2X - p1X), 2) + Math.pow((p2Y - p1Y), 2)));\n\t\treturn distance;\n\n\t}", "public static S1Angle getDistance(S2Point x, S2Point a, S2Point b, S2Point aCrossB) {\n Preconditions.checkArgument(S2.isUnitLength(x), \"S2Point not normalized: %s\", x);\n Preconditions.checkArgument(S2.isUnitLength(a), \"S2Point not normalized: %s\", a);\n Preconditions.checkArgument(S2.isUnitLength(b), \"S2Point not normalized: %s\", b);\n return S1Angle.radians(getDistanceRadians(x, a, b, aCrossB));\n }", "@Override\r\n\tpublic double getTwoDiseaseSimilarity(String omimId1, String omimId2) {\r\n\t\tdouble similarity = (1 - alpha) * firstDiseaseSimilarity.getTwoDiseaseSimilarity(omimId1, omimId2);\r\n\t\tsimilarity += alpha * secondDiseaseSimilarity.getTwoDiseaseSimilarity(omimId1, omimId2);\r\n\t\t\r\n\t\treturn similarity;\r\n\t}", "public double distance(DataInstance d1, DataInstance d2, List<Attribute> attributeList);", "private static final double l2Distance (final double[] p0,\n final double[] p1) {\n assert p0.length == p1.length;\n double s = 0.0;\n double c = 0.0;\n for (int i=0;i<p0.length;i++) {\n final double dp = p0[i] - p1[i];\n final double zi = dp*dp - c;\n final double t = s + zi;\n c = (t - s) - zi;\n s = t; }\n return Math.sqrt(s); }", "private double eculidean(double x, double x1, double y, double y1) {\n\t\treturn Math.sqrt(Math.pow((x - x1), 2) + Math.pow((y - y1), 2));\n\t}", "private double dist(Point a,Point b)//to find distance between the new entry to predict and the male or female cluster mean positions.\n { double d;\n d=Math.sqrt( Math.pow((a.ht-b.ht),2) + Math.pow((a.wt-b.wt),2));\n return d;\n }", "private double dist(double [] v1, double [] v2){\n \t\tdouble sum=0;\n \t\tfor (int i=0; i<nDimensions; i++){\n \t\t\tdouble d = v1[i]-v2[i];\n \t\t\tsum += d*d;\n \t\t}\n \t\treturn Math.sqrt(sum);\n \t}", "private Double euclidean(LatitudeLongitude point1, LatitudeLongitude point2) {\n return Double.valueOf(Math.sqrt(Math.pow(point1.getLatitude() - point2.getLatitude(), 2)\n + Math.pow(point1.getLongitude() - point2.getLongitude(), 2)));\n }", "final public static int dist(float lat1, float lon1,\n \t\tfloat lat2, float lon2) {\n \tdouble latSin = Math.sin((lat2-lat1)/2d);\n \tdouble longSin = Math.sin((lon2-lon1)/2d);\n \tdouble a = (latSin * latSin) + (Math.cos(lat1)*Math.cos(lat2)*longSin*longSin);\n \tdouble c = 2d * atan2(Math.sqrt(a),Math.sqrt(1d-a));\n \treturn (int)(PLANET_RADIUS_D * (c + 0.5d));\n }" ]
[ "0.69384915", "0.6927092", "0.6844633", "0.68221384", "0.67649156", "0.6743448", "0.6743139", "0.66938716", "0.6669573", "0.66636485", "0.6648481", "0.66471577", "0.66119236", "0.65966773", "0.65924066", "0.6566044", "0.65622336", "0.6551025", "0.654481", "0.6537926", "0.65326005", "0.6495273", "0.64935946", "0.6480462", "0.6479478", "0.6449784", "0.6411736", "0.64063036", "0.6404505", "0.6362225", "0.63579506", "0.6351882", "0.63496566", "0.6343531", "0.63197315", "0.63161933", "0.6303954", "0.6303935", "0.62975335", "0.6260053", "0.6250222", "0.6225625", "0.61947477", "0.6189458", "0.6177658", "0.6175542", "0.6168624", "0.6166681", "0.6162805", "0.616269", "0.6152092", "0.61479205", "0.61466885", "0.6136927", "0.6134405", "0.6125084", "0.6112324", "0.60999924", "0.6097639", "0.6081383", "0.60804814", "0.6074502", "0.60730124", "0.60663235", "0.6063223", "0.60600424", "0.6051438", "0.6050096", "0.604323", "0.6028652", "0.6026706", "0.6023055", "0.6018511", "0.60159415", "0.6009211", "0.6009127", "0.600197", "0.6000892", "0.59843767", "0.5978855", "0.59738344", "0.5970977", "0.59589803", "0.59569776", "0.59567344", "0.59444636", "0.5943821", "0.59434056", "0.5941494", "0.59404457", "0.5940346", "0.59392875", "0.59320503", "0.59301335", "0.5926755", "0.59226197", "0.59220946", "0.59192044", "0.59188306", "0.59177196" ]
0.6753979
5
Aid Function build an array with the points in the strip O(numInStrip)//
private Point[] NumInStripAxis(Container container,double min, double max, Boolean axis, Point[] strip){ int counter = strip[0].getX(); int insert = strip[0].getY(); // the parameter tell us if we want to count the number of the points or insert them. int minIndex; // for later on, we want to know the index of the min point in the axis if (axis){ //axis x this.current=container; while (this.current!=null && this.current.getData().getX()>min){ if (insert==1){ strip[counter-1]=this.current.getData(); counter--; } else counter++; this.current=this.current.getPrevX(); } minIndex=counter; this.current=container.getNextX(); while (this.current!=null && this.current.getData().getX()<max){ if (insert==1){ strip [counter-1]=this.current.getData(); counter--; } else counter++; this.current=this.current.getNextX(); } } else { //axis y this.current=container; while (this.current!=null && this.current.getData().getY()>min){ if (insert==1){ strip [counter-1]=this.current.getData(); counter--; } else counter++; this.current=this.current.getPrevY(); } minIndex=counter; this.current=container.getNextY(); while (this.current!=null && this.current.getData().getY()<max){ if (insert==1){ strip [counter-1]=this.current.getData(); counter--; } else counter++; this.current=this.current.getNextY(); } } if (insert!=1) //we count the number of points in the strip and calculate the min index for later strip[0]=new Point(counter,minIndex); return strip; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int[] makeIndicesForTriangleStrip() {\n int[] indices = new int[getNoOfIndices()];\n int index = 0;\n for (int vIndex = 1; vIndex <= verticalResolution; vIndex++)\n for (int hIndex = 0; hIndex < horizontalResolution; hIndex++) {\n indices[index] = ((vIndex-1) * horizontalResolution) + hIndex;\n index++;\n indices[index] = ((vIndex) * horizontalResolution) + hIndex;\n index++;\n }\n\n return indices;\n }", "public Point[] nearestPairInStrip(Container container, double width, Boolean axis) {\n\t\tdouble leftGap,rightGap;\n\t\tint minIndex;\n\t\tint numInStrip = 0;\n\t\tthis.current = container;\n\t\tPoint currentData = this.current.getData();\n\t\tif (axis){ \t//width of the strip by axis\n\t\t\t leftGap = currentData.getX() + (width/2);\n\t\t \t rightGap = currentData.getX() - (width/2);}\n\t\telse{ leftGap = container.getData().getY() + (width/2);\n\t\t\t rightGap = container.getData().getY() - (width/2);}\t\n\t\t\n\t\t// we count the number of points in the strip with aid function\n\t\tPoint[] setup = {new Point(0, 0)}; \n\t\tPoint[] strip = NumInStripAxis(container,rightGap,leftGap,axis,setup); // return in strip[0].getX() the num of points in the strip\n\t\tnumInStrip = strip[0].getX(); // number of points in the strip\n\t\tminIndex = numInStrip - strip[0].getY(); // index in the array that we will find the min there, later on\n\t\tPoint[] insert = new Point[numInStrip]; // build array in this size\n\t\t// insert the right points to the array\n\t\tif (numInStrip>=2){\n\t\t\tinsert[0] = new Point(numInStrip, 1); // to insert points to the array we need thus values in [0]\n\t\t\tstrip = NumInStripAxis(container,rightGap,leftGap,axis,insert); // O(numInStrip) - the array is not sorted yet\n\t\t}else return null; // there is less then 2 points in the strip\n\t\t\n\t\t// now we sort the \"strip\" array\t\n\t\tif (numInStrip*Math.log10(numInStrip)/Math.log10(2)<this.size){// sort by O(numInStrip*log(numInStrip))\n\t\t\tif (axis) {Arrays.sort(strip, new CompareY());} // if the strip width is axis x then sort by Y\n\t\t\telse \t {Arrays.sort(strip, new CompareX());}\n\t\t}else{ // sort by O(n)\n\t\t\tint min,max;\n\t\t\tif (axis){//X\n\t\t\t\tif (numInStrip==this.size){\n\t\t\t\t\tmin = this.minx.getData().getX();\n\t\t\t\t\tmax = this.maxx.getData().getX();}\n\t\t\t\telse{// if we don't have this.size points in our strip\n\t\t\t\t\tmin = strip[minIndex].getX();\n\t\t\t\t\tmax = strip[0].getX();} // when we build the array the max point in the axis will be in the 0 index\n\t\t\t}\n\t\t\telse{ //Y\n\t\t\t\tif (numInStrip==this.size){\n\t\t\t\t\tmin = this.miny.getData().getY();\n\t\t\t\t\tmax = this.maxy.getData().getY();}\n\t\t\t\telse{// if we don't have all the data structure in our strip\n\t\t\t\t\tmin = strip[minIndex].getY();\n\t\t\t\t\tmax = strip[0].getY(); // when we build the array the max point in the axis will be in the 0 index\n\t\t\t\t}\n\t\t\t}\n\t\t\tstrip = getPointsInRangeOppAxis(min, max, axis); // O(n) - to sorted this \"strip\" array\n\t\t}\n\t\t// now we want to know which of the points is the nearest points in the \"strip\" array\n\t\tif (strip.length>=2) return nearestPointInArray(strip);\n\t\telse return null;\n\t}", "private Point[] nearestPointInArray(Point[] strip){\n\t\tint j = 1; // with each point we measure the distance with the following 6 point's\n\t\tPoint[] currentMinPoints = {strip[0],strip[1]};\n\t\tdouble currentMinDistance = Distance(currentMinPoints[0], currentMinPoints[1]);\n\t\tdouble currentDistance;\t\n\t\tfor (int i=0; i< strip.length; i++){\n\t\t\twhile (j<8 && i+j < strip.length){\n\t\t\t\tcurrentDistance = Distance(strip[i], strip[i+j]);\n\t\t\t\tif (currentDistance<currentMinDistance){\n\t\t\t\t\tcurrentMinDistance = currentDistance;\n\t\t\t\t\tcurrentMinPoints[0] = strip[i];\n\t\t\t\t\tcurrentMinPoints[1] = strip[i+j];\n\t\t\t\t}\n\t\t\t\tj++;\n\t\t\t}\n\t\t\tj=1;\n\t\t}\n\t\treturn currentMinPoints;\n\t}", "public abstract int[] getCoords();", "abstract int[] crossOver();", "public LinkedList<Point> segmentsToDraw() {\n LinkedList<Point> segmentCoordinates = new LinkedList<Point>();\n for (int segment = 1; segment <= snakeSize; segment++) {\n //search array for each segment number\n for (int x = 0; x < maxX; x++) {\n for (int y = 0; y < maxY; y++) {\n if (snakeSquares[x][y] == segment) {\n //make a Point for this segment's coordinates and add to list\n Point p = new Point(x * SnakeGame.getSquareSize(), y * SnakeGame.getSquareSize());\n segmentCoordinates.add(p);\n }\n }\n }\n }\n return segmentCoordinates;\n\n }", "private Data[] getInts(double value, int npoints, int nattributes)\n\t{\n\t\tData[] data = new Data[npoints];\n\t\tint val = (int) (value * Integer.MAX_VALUE);\n\t\tfor (int i = 0; i < npoints; i++)\n\t\t\tdata[i] = nattributes == 1 ? new DataInt(val)\n\t\t: new DataArrayOfInts(new int[] { val, val });\n\t\t\treturn data;\n\t}", "public List<Point> getAsphaltArray(List<Point> pointList){\n\t\tList<Point> ss = new ArrayList<>();\n\t\tfor(Point a : pointList) {\n\t\t\tss.add(getAsphalt(a.x,a.y,this.trk));\n\t\t}\n\t\treturn ss;\n\t}", "private int [] createXArray(){\r\n\t\tint [] xCoord = {\r\n\t\t\t\txStart,\r\n\t\t\t\txStart + 50,\r\n\t\t\t\txStart + 65,\r\n\t\t\t\txStart + 65,\r\n\t\t\t\txStart + 50, \r\n\t\t\t\txStart,\r\n\t\t\t\txStart,\r\n\t\t\t\txStart + 50,\r\n\t\t\t\txStart + 50,\r\n\t\t\t\txStart,\r\n\t\t\t\txStart\r\n\t\t};\r\n\t\treturn xCoord;\r\n\t}", "private Vector<Integer> matchCheckPoint(List<Point> a) {\t\t\t\n\t\tVector<Integer> iDS= new Vector<>();\n\t\tfor(Point p :a) {\n\t\t\tif(!getAsphalt(p.x, p.y,this.trk).isIdDefalt()) {\n\t\t\t\tiDS.add(getAsphalt(p.x, p.y,this.trk).getId());\n\t\t\t}\n\t\t}\n\t\treturn iDS;\n\t}", "public double [] plot(double from, double to, int size) \n{\n\tdouble increment = Math.abs((to-from)/size);\n\t\n\tdouble [] temp = new double [size];\n\n\tfor(int i=0; i<size; i++)\n\t\ttemp[i]=this.fuzzify(from+increment*i);\n\t\n\treturn temp;\n}", "private int[] getAveragedVals(int x, int y, int n, int m) {\n\t\tint[] rtn = new int[NUM_TRIANGLE_SIDES];\n\t\tint avgRed = 0;\n\t\tint avgGreen = 0;\n\t\tint avgBlue = 0;\n\t\tint totalPixels = 0;\n\n\t\tfor (int i = x; i < (x+n); i++) {\n\t\t\tfor (int j = y; j < (y+m); j++) {\n\t\t\t\tif (j < this.getPictureHeight() && i < this.getPictureWidth()) {\n\t\t\t\t\tavgRed += this.image.getPixelRed(i,j);\n\t\t\t\t\tavgGreen += this.image.getPixelGreen(i,j);\n\t\t\t\t\tavgBlue += this.image.getPixelBlue(i,j);\n\t\t\t\t\ttotalPixels++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (totalPixels == 0) {\n\t\t\trtn[0] = 255;\t\t\n\t\t\trtn[1] = 255;\n\t\t\trtn[2] = 255;\n\t\t\treturn rtn;\n\t\t}\n\n\t\trtn[0] = avgRed / totalPixels;\t\t\n\t\trtn[1] = avgGreen / totalPixels;\n\t\trtn[2] = avgBlue / totalPixels;\n\t\treturn rtn;\n\t}", "public Transition[] computeDistances(){\n\t\tSystem.out.println(\"Computing Transitions...\");\n\t\tTransition[] instanceTransitions = new Transition[nbBd*(nbBd-1)*4];\n\t\t//i sera l'indice de la cellule du tableau\n\t\tint i=0;\n\t\tfor (Strip aStrip : tabStrips){\n\t\t\tfor (Strip anotherStrip : tabStrips)\n\t\t\t\tif (aStrip != anotherStrip){\n\t\t\t\t\tdouble dist = Math.sqrt(Math.pow(anotherStrip.getX0() - aStrip.getX0(), 2) + Math.pow(aStrip.getY0() - anotherStrip.getY0(), 2));\n\t\t\t\t\tdist = 2*(Math.atan(dist/((double)2000*indAltitude)));\n\t\t\t\t\tinstanceTransitions[i] = new Transition(aStrip.getInd(), false, anotherStrip.getInd(), false, (int)((indDMin + (dist / indVr))*1000), i);\n\t\t\t\t\ti++;\n\t\t\t\t\tdist = Math.sqrt(Math.pow(anotherStrip.getX1() - aStrip.getX0(), 2) + Math.pow(aStrip.getY0() - anotherStrip.getY1(), 2));\n\t\t\t\t\tdist = 2*(Math.atan(dist/((double)2000*indAltitude)));\n\t\t\t\t\tinstanceTransitions[i] = new Transition(aStrip.getInd(), false, anotherStrip.getInd(), true, (int)((indDMin + (dist / indVr))*1000), i);\n\t\t\t\t\ti++;\n\t\t\t\t\tdist = Math.sqrt(Math.pow(anotherStrip.getX0() - aStrip.getX1(), 2) + Math.pow(aStrip.getY1() - anotherStrip.getY0(), 2));\n\t\t\t\t\tdist = 2*(Math.atan(dist/((double)2000*indAltitude)));\n\t\t\t\t\tinstanceTransitions[i] = new Transition(aStrip.getInd(), true, anotherStrip.getInd(), false, (int)((indDMin + (dist / indVr))*1000), i);\n\t\t\t\t\ti++;\n\t\t\t\t\tdist = Math.sqrt(Math.pow(anotherStrip.getX1() - aStrip.getX1(), 2) + Math.pow(aStrip.getY1() - anotherStrip.getY1(), 2));\n\t\t\t\t\tdist = 2*(Math.atan(dist/((double)2000*indAltitude)));\n\t\t\t\t\tinstanceTransitions[i] = new Transition(aStrip.getInd(), true, anotherStrip.getInd(), true, (int)((indDMin + (dist / indVr))*1000), i);\n\t\t\t\t\ti++;\n\t\t\t\t}//i != j\n\t\t\t//calcul de indMiddleTMin au fur et a mesure en utilisant des coefficients \n\t\t\t//pour eviter de depasser la taille maximale des int \n\t\t\tint divider = ((2*i) / ((nbBd-1) * 4));\n\t\t\tindMiddleTMin = ((indMiddleTMin * (divider - 2)) + (aStrip.indTMin0 + aStrip.indTMin1)) / divider;\n\t\t}//for\n\t\treturn instanceTransitions;\n\t}", "private static List<Point> genererPointsAlea(int nbPoints) {\n /*List<Point> points = new ArrayList<>();\n Random rand = new Random(0);\n for(int i=0; i<nbPoints; i++) {\n Point p = new Point(rand.nextDouble(), rand.nextDouble());\n points.add(p);\n }\n return points;*/\n return null;\n }", "com.bagnet.nettracer.ws.core.pojo.xsd.WSScanPoints getScansArray(int i);", "public ArrayList<String> transportLinePathIDs()\r\n {\r\n Coordinate next_street1 = null;\r\n Coordinate next_street2 = null;\r\n Street next_street = null;\r\n ArrayList<String> line_coordinates_ids = new ArrayList<String>();\r\n\r\n for (int i = 0; i < getStreetsMap().size(); i++)\r\n {\r\n Street s = getStreetsMap().get(i);\r\n Coordinate this_street1 = s.getCoordinates().get(0);\r\n Coordinate this_street2 = s.getCoordinates().get(2);\r\n\r\n if (i + 1 < getStreetsMap().size())\r\n {\r\n next_street = getStreetsMap().get(i+1);\r\n next_street1 = next_street.getCoordinates().get(0);\r\n next_street2 = next_street.getCoordinates().get(2);\r\n }\r\n else\r\n {\r\n break;\r\n }\r\n\r\n for (Stop stop : getStopsMap())\r\n {\r\n if (stop.getStreet().equals(s))\r\n {\r\n line_coordinates_ids.add(stop.getId());\r\n }\r\n }\r\n\r\n if (s.getCoordinates().get(1) != null)\r\n {\r\n line_coordinates_ids.add(s.getId());\r\n }\r\n\r\n //11\r\n if (this_street1.getX() == next_street1.getX() && this_street1.getY() == next_street1.getY())\r\n {\r\n line_coordinates_ids.add(s.getId());\r\n }\r\n //12\r\n else if (this_street1.getX() == next_street2.getX() && this_street1.getY() == next_street2.getY())\r\n {\r\n line_coordinates_ids.add(s.getId());\r\n }\r\n // 21\r\n else if (this_street2.getX() == next_street1.getX() && this_street2.getY() == next_street1.getY())\r\n {\r\n line_coordinates_ids.add(s.getId());\r\n }\r\n //22\r\n else if (this_street2.getX() == next_street2.getX() && this_street2.getY() == next_street2.getY())\r\n {\r\n line_coordinates_ids.add(s.getId());\r\n }\r\n }\r\n\r\n line_coordinates_ids.add(getStopsMap().get(getStopsMap().size()-1).getId());\r\n return line_coordinates_ids;\r\n }", "public void getSeriesForPoints(){\n\n int lenght = cluster_polygon_coordinates.length;\n\n x_latitude = new Number[lenght];\n y_longitude = new Number[lenght];\n\n //x_latitude[lenght-1] = cluster_polygon_coordinates[0].x;\n //y_longitude[lenght-1] = cluster_polygon_coordinates[0].y;\n for (int i=0;i<lenght;i++) {\n\n x_latitude[i] = cluster_polygon_coordinates[i].x;\n y_longitude[i] = cluster_polygon_coordinates[i].y;\n// Log.d(TAG, Double.toString(cluster_polygon_coordinates[i].x));\n// Log.d(TAG, Double.toString(cluster_polygon_coordinates[i].y));\n// Log.d(TAG, Double.toString(cluster_polygon_coordinates[i].z));\n }\n\n }", "protected abstract int[] getPathElements();", "public static int[] buildZ(char[] a) {\n int n = a.length;\n int[] z = new int[n];\n if (n == 0) return z;\n z[0] = n;\n int l = 0, r = 0;\n for (int i = 1; i < n; i++) {\n if (i > r) {\n l = r = i;\n while (r < n && a[r - l] == a[r]) {\n r++;\n }\n z[i] = r - l;\n r--;\n } else {\n int k = i - l;\n if (z[k] < r - i + 1) {\n z[i] = z[k];\n } else {\n l = i;\n while (r < n && a[r - l] == a[r]) {\n r++;\n }\n z[i] = r - l;\n r--;\n }\n }\n }\n return z;\n }", "public void makeArray() {\r\n for (int i = 0; i < A.length; i++) {\r\n A[i] = i;\r\n }\r\n }", "@SuppressWarnings(\"unused\")\r\n private void findAbdomenVOI() {\r\n \r\n // find the center of mass of the single label object in the sliceBuffer (abdomenImage)\r\n findAbdomenCM();\r\n int xcm = centerOfMass[0];\r\n int ycm = centerOfMass[1];\r\n\r\n ArrayList<Integer> xValsAbdomenVOI = new ArrayList<Integer>();\r\n ArrayList<Integer> yValsAbdomenVOI = new ArrayList<Integer>();\r\n\r\n // angle in radians\r\n double angleRad;\r\n \r\n for (int angle = 39; angle < 45; angle += 3) {\r\n int x, y, yOffset;\r\n double scaleFactor; // reduces the number of trig operations that must be performed\r\n \r\n angleRad = Math.PI * angle / 180.0;\r\n if (angle > 315 || angle <= 45) {\r\n scaleFactor = Math.tan(angleRad);\r\n x = xDim;\r\n y = ycm;\r\n yOffset = y * xDim;\r\n while (x > xcm && sliceBuffer[yOffset + x] != abdomenTissueLabel) {\r\n x--;\r\n y = ycm - (int)((x - xcm) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n } else if (angle > 45 && angle <= 135) {\r\n scaleFactor = (Math.tan((Math.PI / 2.0) - angleRad));\r\n x = xcm;\r\n y = 0;\r\n yOffset = y * xDim;\r\n while (y < ycm && sliceBuffer[yOffset + x] != abdomenTissueLabel) {\r\n y++;\r\n x = xcm + (int)((ycm - y) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n } else if (angle > 135 && angle <= 225) {\r\n scaleFactor = Math.tan(Math.PI - angleRad);\r\n x = 0;\r\n y = ycm;\r\n yOffset = y * xDim;\r\n while (x < xcm && sliceBuffer[yOffset + x] != abdomenTissueLabel) {\r\n x++;\r\n y = ycm - (int)((xcm - x) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n } else if (angle > 225 && angle <= 315) {\r\n scaleFactor = Math.tan((3.0 * Math.PI / 2.0) - angleRad);\r\n x = xcm;\r\n y = yDim;\r\n yOffset = y * xDim;\r\n while (y < yDim && sliceBuffer[yOffset + x] == abdomenTissueLabel) {\r\n y--;\r\n x = xcm - (int)((y - ycm) * scaleFactor);\r\n yOffset = y * xDim;\r\n }\r\n xValsAbdomenVOI.add(x);\r\n yValsAbdomenVOI.add(y);\r\n \r\n }\r\n } // end for (angle = 0; ...\r\n \r\n int[] x1 = new int[xValsAbdomenVOI.size()];\r\n int[] y1 = new int[xValsAbdomenVOI.size()];\r\n int[] z1 = new int[xValsAbdomenVOI.size()];\r\n for(int idx = 0; idx < xValsAbdomenVOI.size(); idx++) {\r\n x1[idx] = xValsAbdomenVOI.get(idx);\r\n y1[idx] = xValsAbdomenVOI.get(idx);\r\n z1[idx] = 0;\r\n }\r\n\r\n // make the VOI's and add the points to them\r\n abdomenVOI = new VOI((short)0, \"Abdomen\");\r\n abdomenVOI.importCurve(x1, y1, z1);\r\n\r\n\r\n }", "private HelicalTrackStrip makeDigiStrip(SiTrackerHitStrip1D h) {\n\n SiTrackerHitStrip1D local = h.getTransformedHit(TrackerHitType.CoordinateSystem.SENSOR);\n SiTrackerHitStrip1D global = h.getTransformedHit(TrackerHitType.CoordinateSystem.GLOBAL);\n\n ITransform3D trans = local.getLocalToGlobal();\n Hep3Vector org = trans.transformed(_orgloc);\n Hep3Vector u = global.getMeasuredCoordinate();\n Hep3Vector v = global.getUnmeasuredCoordinate();\n\n double umeas = local.getPosition()[0];\n double vmin = VecOp.dot(local.getUnmeasuredCoordinate(), local.getHitSegment().getStartPoint());\n double vmax = VecOp.dot(local.getUnmeasuredCoordinate(), local.getHitSegment().getEndPoint());\n double du = Math.sqrt(local.getCovarianceAsMatrix().diagonal(0));\n\n IDetectorElement de = h.getSensor();\n String det = _ID.getName(de);\n int lyr = _ID.getLayer(de);\n BarrelEndcapFlag be = _ID.getBarrelEndcapFlag(de);\n\n double dEdx = h.getdEdx();\n double time = h.getTime();\n List<RawTrackerHit> rawhits = h.getRawHits();\n HelicalTrackStrip strip = new HelicalTrackStrip(org, u, v, umeas, du, vmin, vmax, dEdx, time, rawhits, det, lyr, be);\n\n return strip;\n }", "@Override\n public int[] visit(Allosaur allosaur) {\n return new int[] {10, 0};\n }", "public LineStrip2D(List<Point2D> points) {\n this.points = new ArrayList<Point2D>(points);\n }", "private LineSegment[] findSegments() {\n List<LineSegment> segmentList = new ArrayList<>();\n int N = points.length;\n for (int i = 0; i < N; i++) {\n for (int j = i+1; j < N; j++) {\n Double slopePQ = points[i].slopeTo(points[j]);\n for (int k = j+1; k < N; k++) {\n Double slopePR = points[i].slopeTo(points[k]);\n if (slopePQ.equals(slopePR)) {\n for (int l = k + 1; l < N; l++) {\n Double slopePS = points[i].slopeTo(points[l]);\n if (slopePQ.equals(slopePS)) {\n LineSegment lineSegment = new LineSegment(points[i], points[l]);\n segmentList.add(lineSegment);\n }\n }\n }\n }\n }\n }\n return segmentList.toArray(new LineSegment[segmentList.size()]);\n }", "public int[] getArticulationVertices() {\n int[] xs = new int[set.cardinality()];\n for (int x = set.nextSetBit(0), i = 0;\n x >= 0;\n x = set.nextSetBit(x + 1), i++) {\n xs[i] = x;\n }\n return xs;\n }", "private float[] getCoords(double x, double y) {\n\t\tdouble angleXY = x * increment;\n\t\tdouble angleZ = y * increment;\n\t\tint zCoord = (int) (EYE_RADIUS * Math.cos(Math.toRadians(angleZ)));\n\t\t\n\t\tdouble ZRadiusScale = EYE_RADIUS * Math.sin(Math.toRadians(angleZ));\n\t\t\n\t\t\n\t\tint xCoord = (int) (ZRadiusScale*Math.cos(Math.toRadians(angleXY)));\n\t\tint yCoord = (int) (ZRadiusScale*Math.sin(Math.toRadians(angleXY)));\n\t\t\n\n\t\t\n\t\tfloat addMe[] = {xCoord, yCoord, zCoord};\n\t\t\n\t\treturn addMe;\n\t}", "int[] neighborPointsFromLine(int sourceLineId) {\n\t\t// http://i.imgur.com/3nWXfwA.jpg\n\t\tint neighborLeft;\n\t\tif (sourceLineId == amount - 1)\n\t\t\tneighborLeft = 0; // amount - 1 in quad means line[3] aka the last\n\t\t\t\t\t\t\t\t// line in quad/polygon\n\t\telse\n\t\t\tneighborLeft = sourceLineId + 1; // otherwise left neigbor is always\n\t\t\t\t\t\t\t\t\t\t\t\t// id+1; i.e. if line[2] then\n\t\t\t\t\t\t\t\t\t\t\t\t// left neigbor is point[3], see\n\t\t\t\t\t\t\t\t\t\t\t\t// drawing:\n\t\t\t\t\t\t\t\t\t\t\t\t// http://i.imgur.com/iyZVj78.jpg\n\n\t\tint neighborRight = sourceLineId; // right neighbor id is alwas the same\n\t\t\t\t\t\t\t\t\t\t\t// as line id, check drawing:\n\t\t\t\t\t\t\t\t\t\t\t// http://i.imgur.com/iyZVj78.jpg\n\t\tint[] neighbors = { neighborLeft, neighborRight };\n\t\treturn neighbors;\n\t}", "public XYSeries getXYSeries(String serie_name){ \n XYSeries serie = new XYSeries(serie_name); \n Point2D[] points_bezier = getPoint2DArray(); \n for(int j = 0 ; j < points_bezier.length; j++){ \n \n serie.add(points_bezier[j].getX(),points_bezier[j].getY()); \n } \n return serie; \n}", "public abstract double[] roughOffsets();", "public List<int[]> getCoords(Board lev){\n \tint[][] coords;\n \tColumn c = lev.getColumns().get(col);\n \tint[] p1 = c.getFrontPoint1();\n \tint[] p2 = c.getFrontPoint2();\n\n \tif (isPod && z < Board.BOARD_DEPTH) {\n \t\tint cx = p1[0] + (p2[0]-p1[0])/2;\n \t\tint cy = p1[1] + (p2[1]-p1[1])/2;\n\n \t\t// define outer and inner diamonds\n \t\tint[][] outer = new int[4][3];\n \t\tint[][] inner = new int[4][3];\n \t\touter[0][0] = cx;\n \t\touter[0][1] = cy - PODSIZE;\n \t\touter[0][2] = (int)z;\n \t\touter[1][0] = cx + PODSIZE;\n \t\touter[1][1] = cy;\n \t\touter[1][2] = (int) z;\n \t\touter[2][0] = cx;\n \t\touter[2][1] = cy + PODSIZE;\n \t\touter[2][2] = (int) z;\n \t\touter[3][0] = cx - PODSIZE;\n \t\touter[3][1] = cy;\n \t\touter[3][2] = (int) z;\n \t\tinner[0][0] = cx;\n \t\tinner[0][1] = cy - PODSIZE/3;\n \t\tinner[0][2] = (int) z;\n \t\tinner[1][0] = cx + PODSIZE/3;\n \t\tinner[1][1] = cy;\n \t\tinner[1][2] = (int) z;\n \t\tinner[2][0] = cx;\n \t\tinner[2][1] = cy + PODSIZE/3;\n \t\tinner[2][2] = (int) z;\n \t\tinner[3][0] = cx - PODSIZE/3;\n \t\tinner[3][1] = cy;\n \t\tinner[3][2] = (int) z;\n\n \t\t// define line path through those diamonds:\n \t\tcoords = new int[17][3];\n \t\tcoords[0] = outer[0];\n \t\tcoords[1] = outer[1];\n \t\tcoords[2] = inner[1];\n \t\tcoords[3] = inner [0];\n \t\tcoords[4] = outer[1];\n \t\tcoords[5] = outer[2];\n \t\tcoords[6] = inner[2];\n \t\tcoords[7] = inner[1];\n \t\tcoords[8] = outer[2];\n \t\tcoords[9] = outer[3];\n \t\tcoords[10]= inner[3];\n \t\tcoords[11]= inner[2];\n \t\tcoords[12]= outer[3];\n \t\tcoords[13]= outer[0];\n \t\tcoords[14]= inner[0];\n \t\tcoords[15]= inner[3];\n \t\tcoords[16]= outer[0];\n \t}\n \telse { \n \t\tcoords = new int[7][3];\n \t\tswitch (s) {\n \t\tcase STRAIGHT:\n \t\t\tcoords[0][0] = p1[0];\n \t\t\tcoords[0][1] = p1[1];\n \t\t\tcoords[0][2] = (int) (z-EXHEIGHT_H);\n \t\t\tcoords[1][0] = p2[0];\n \t\t\tcoords[1][1] = p2[1];\n \t\t\tcoords[1][2] = (int) (z+EXHEIGHT_H);\n \t\t\tcoords[2][0] = p2[0] - (p2[0]-p1[0])/3;\n \t\t\tcoords[2][1] = p2[1] - (p2[1]-p1[1])/3;\n \t\t\tcoords[2][2] = (int) z;\n \t\t\tcoords[3][0] = p2[0];\n \t\t\tcoords[3][1] = p2[1];\n \t\t\tcoords[3][2] = (int) (z-EXHEIGHT_H);\n \t\t\tcoords[4][0] = p1[0];\n \t\t\tcoords[4][1] = p1[1];\n \t\t\tcoords[4][2] = (int) (z+EXHEIGHT_H);\n \t\t\tcoords[5][0] = p1[0] + (p2[0]-p1[0])/3;\n \t\t\tcoords[5][1] = p1[1] + (p2[1]-p1[1])/3;\n \t\t\tcoords[5][2] = (int) z;\n \t\t\tcoords[6][0] = p1[0];\n \t\t\tcoords[6][1] = p1[1];\n \t\t\tcoords[6][2] = (int) (z-EXHEIGHT_H);\n \t\t\tbreak;\n\n \t\tcase JUMPRIGHT1:\n \t\tcase LANDRIGHT2:\n \t\t\tcoords[0][0] = p1[0] + (p2[0]-p1[0])/4;\n \t\t\tcoords[0][1] = p1[1] + (p2[1]-p1[1])/4;\n \t\t\tcoords[0][2] = (int) (z+EXHEIGHT_H*2);\n \t\t\tcoords[1][0] = p2[0] + (p2[0]-p1[0])/4;\n \t\t\tcoords[1][1] = p2[1] + (p2[1]-p1[1])/4;\n \t\t\tcoords[1][2] = (int) (z+EXHEIGHT_H*2);\n \t\t\tcoords[2][0] = p2[0] - (p2[0]-p1[0])/11;\n \t\t\tcoords[2][1] = p2[1] - (p2[1]-p1[1])/11;\n \t\t\tcoords[2][2] = (int) (z+EXHEIGHT_H*1.8);\n \t\t\tcoords[3][0] = p2[0];\n \t\t\tcoords[3][1] = p2[1];\n \t\t\tcoords[3][2] = (int) z;\n \t\t\tcoords[4][0] = (int) (p1[0] + (p2[0]-p1[0])/2);\n \t\t\tcoords[4][1] = (int) (p1[1] + (p2[1]-p1[1])/2);\n \t\t\tcoords[4][2] = (int) (z+ EXHEIGHT_H*5);\n \t\t\tcoords[5][0] = (int) (p2[0] - (p2[0]-p1[0])/2.5);\n \t\t\tcoords[5][1] = (int) (p2[1] - (p2[1]-p1[1])/2.5);\n \t\t\tcoords[5][2] = (int) (z+EXHEIGHT_H *2.6);\n \t\t\tcoords[6] = coords[0];\n \t\t\tbreak;\n\n \t\tcase JUMPLEFT1:\n \t\tcase LANDLEFT2:\n \t\t\tcoords[0][0] = p1[0];\n \t\t\tcoords[0][1] = p1[1];\n \t\t\tcoords[0][2] = (int) z;\n \t\t\tcoords[1][0] = (int) (p1[0] + (p2[0]-p1[0])/2);\n \t\t\tcoords[1][1] = (int) (p1[1] + (p2[1]-p1[1])/2);\n \t\t\tcoords[1][2] = (int) (z+ EXHEIGHT_H*5);\n \t\t\tcoords[2][0] = (int) (p1[0] + (p2[0]-p1[0])/2.5);\n \t\t\tcoords[2][1] = (int) (p1[1] + (p2[1]-p1[1])/2.5);\n \t\t\tcoords[2][2] = (int) (z+EXHEIGHT_H *2.6);\n \t\t\tcoords[3][0] = p2[0] - (p2[0]-p1[0])/4;\n \t\t\tcoords[3][1] = p2[1] - (p2[1]-p1[1])/4;\n \t\t\tcoords[3][2] = (int) (z+EXHEIGHT_H*2);\n \t\t\tcoords[4][0] = p1[0] - (p2[0]-p1[0])/4;\n \t\t\tcoords[4][1] = p1[1] - (p2[1]-p1[1])/4;\n \t\t\tcoords[4][2] = (int) (z+EXHEIGHT_H*2);\n \t\t\tcoords[5][0] = p1[0] + (p2[0]-p1[0])/11;\n \t\t\tcoords[5][1] = p1[1] + (p2[1]-p1[1])/11;\n \t\t\tcoords[5][2] = (int) (z+EXHEIGHT_H*1.8);\n \t\t\tcoords[6] = coords[0];\n \t\t\tbreak;\n\n \t\tcase JUMPLEFT2:\n \t\tcase LANDLEFT1:\n \t\t\tcoords[0][0] = p1[0];\n \t\t\tcoords[0][1] = p1[1];\n \t\t\tcoords[0][2] = (int) z;\n \t\t\tcoords[1][0] = (int) (p1[0] + (p2[0]-p1[0])/4.5);\n \t\t\tcoords[1][1] = (int) (p1[1] + (p2[1]-p1[1])/4.5);\n \t\t\tcoords[1][2] = (int) (z+ EXHEIGHT_H*8);\n \t\t\tcoords[2][0] = (int) (p1[0] + (p2[0]-p1[0])/4.5);\n \t\t\tcoords[2][1] = (int) (p1[1] + (p2[1]-p1[1])/4.5);\n \t\t\tcoords[2][2] = (int) (z+EXHEIGHT_H *4);\n \t\t\tcoords[3][0] = p2[0] - (p2[0]-p1[0])/2;\n \t\t\tcoords[3][1] = p2[1] - (p2[1]-p1[1])/2;\n \t\t\tcoords[3][2] = (int) (z+EXHEIGHT_H*4);\n \t\t\tcoords[4][0] = (int) (p1[0] - (p2[0]-p1[0])/3.5);\n \t\t\tcoords[4][1] = (int) (p1[1] - (p2[1]-p1[1])/3.5);\n \t\t\tcoords[4][2] = (int) (z+EXHEIGHT_H*1.8);\n \t\t\tcoords[5][0] = p1[0];// - (p2[0]-p1[0])/15;\n \t\t\tcoords[5][1] = p1[1];// - (p2[1]-p1[1])/15;\n \t\t\tcoords[5][2] = (int) (z+EXHEIGHT_H*1.8);\n \t\t\tcoords[6] = coords[0];\n \t\t\tbreak;\n\n \t\tcase JUMPRIGHT2:\n \t\tcase LANDRIGHT1:\n \t\t\tcoords[0][0] = p2[0] - (p2[0]-p1[0])/2;\n \t\t\tcoords[0][1] = p2[1] - (p2[1]-p1[1])/2;\n \t\t\tcoords[0][2] = (int) (z+EXHEIGHT_H*4);\n \t\t\tcoords[1][0] = (int) (p2[0] + (p2[0]-p1[0])/3.5);\n \t\t\tcoords[1][1] = (int) (p2[1] + (p2[1]-p1[1])/3.5);\n \t\t\tcoords[1][2] = (int) (z+EXHEIGHT_H*1.8);\n \t\t\tcoords[2][0] = p2[0];// - (p2[0]-p1[0])/15;\n \t\t\tcoords[2][1] = p2[1];// - (p2[1]-p1[1])/15;\n \t\t\tcoords[2][2] = (int) (z+EXHEIGHT_H*1.8);\n \t\t\tcoords[3][0] = p2[0];\n \t\t\tcoords[3][1] = p2[1];\n \t\t\tcoords[3][2] = (int) z;\n \t\t\tcoords[4][0] = (int) (p2[0] - (p2[0]-p1[0])/4.5);\n \t\t\tcoords[4][1] = (int) (p2[1] - (p2[1]-p1[1])/4.5);\n \t\t\tcoords[4][2] = (int) (z+ EXHEIGHT_H*8);\n \t\t\tcoords[5][0] = (int) (p2[0] - (p2[0]-p1[0])/4.5);\n \t\t\tcoords[5][1] = (int) (p2[1] - (p2[1]-p1[1])/4.5);\n \t\t\tcoords[5][2] = (int) (z+EXHEIGHT_H *4);\n \t\t\tcoords[6] = coords[0];\n \t\t\tbreak;\n \t\t}\n \t}\n\n \treturn Arrays.asList(coords);\n }", "public static int[] lineColor(int anz, int pos){\n anz++;\n pos++;\n int[] res = new int[3];\n int max = 510;\n int intervall = max/anz;\n int x = pos*intervall;\n if(x < 255){\n res[0] = 255;\n res[1] = x;\n } else {\n x = -x + 510;\n res[0] = x;\n res[1] = 255;\n }\n return res;\n }", "public static int[] getIDs() {\n int[] res = new int[crossbows.length];\n for (int i = 0; i < crossbows.length; i++) {\n res[i] = (int)crossbows[i][0];\n }\n return res;\n }", "private int [] createYArray(){\r\n\t\tint [] yCoord = {\r\n\t\t\t\tyStart,\r\n\t\t\t\tyStart,\r\n\t\t\t\tyStart + Constants.FLOOR_HEIGHT,\r\n\t\t\t\tyStart,\r\n\t\t\t\tyStart - Constants.FLOOR_HEIGHT,\r\n\t\t\t\tyStart - Constants.FLOOR_HEIGHT,\r\n\t\t\t\tyStart,\r\n\t\t\t\tyStart,\r\n\t\t\t\tyStart - Constants.FLOOR_HEIGHT,\r\n\t\t\t\tyStart - Constants.FLOOR_HEIGHT,\r\n\t\t\t\tyStart\r\n\t\t};\r\n\t\treturn yCoord;\r\n\t}", "private static int[] post4(int[] input) {\n int indexFor = 0;\n for (int i = input.length - 1; i >= 0; i--) {\n if (input[i] == 4) {\n indexFor = i;\n break;\n }\n }\n // 1. done\n int size = input.length - indexFor - 1;\n // 2. done\n int[] output = new int[size];\n // 2.5. done\n /* for (int i = size - 1; i >= 0; i--) {\n output[i] = input[input.length + i - size];\n }*/\n for (int i = 0; i < size; i++) {\n output[i] = input[i + indexFor + 1];\n }\n // 3. done\n return output;\n }", "private int[][][] readData(int startElement, int startLine, int endElement, int endLine) throws AreaFileException {\r\n// int[][][]myData = new int[numBands][dir[AD_NUMLINES]][dir[AD_NUMELEMS]];\r\n int numLines = endLine - startLine;\r\n int numEles = endElement - startElement;\r\n// System.out.println(\"linePrefixLength: \" + linePrefixLength);\r\n int[][][] myData = new int[numBands][numLines][numEles];\r\n \r\n if (! fileok) {\r\n throw new AreaFileException(\"Error reading AreaFile data\");\r\n }\r\n\r\n short shdata;\r\n int intdata;\r\n boolean isBrit = \r\n areaDirectory.getCalibrationType().equalsIgnoreCase(\"BRIT\"); \r\n long newPos = 0;\r\n\r\n for (int i = 0; i<numLines; i++) {\r\n newPos = datLoc + linePrefixLength + lineLength * (i + startLine) + startElement * dir[AD_DATAWIDTH];\r\n position = newPos;\r\n// System.out.println(position);\r\n try {\r\n af.seek(newPos);\r\n } catch (IOException e1) {\r\n e1.printStackTrace();\r\n }\r\n \r\n for (int k=0; k<numEles; k++) {\r\n for (int j = 0; j<numBands; j++) {\r\n try {\r\n if (dir[AD_DATAWIDTH] == 1) {\r\n myData[j][i][k] = (int)af.readByte();\r\n if (myData[j][i][k] < 0 && isBrit) {\r\n myData[j][i][k] += 256;\r\n } \r\n// position = position + 1;\r\n } else \r\n\r\n if (dir[AD_DATAWIDTH] == 2) {\r\n shdata = af.readShort();\r\n if (flipwords) {\r\n myData[j][i][k] = (int) ( ((shdata >> 8) & 0xff) | \r\n ((shdata << 8) & 0xff00) );\r\n } else {\r\n myData[j][i][k] = (int) (shdata);\r\n }\r\n// position = position + 2;\r\n } else \r\n\r\n if (dir[AD_DATAWIDTH] == 4) {\r\n intdata = af.readInt();\r\n if (flipwords) {\r\n myData[j][i][k] = ( (intdata >>> 24) & 0xff) | \r\n ( (intdata >>> 8) & 0xff00) | \r\n ( (intdata & 0xff) << 24 ) | \r\n ( (intdata & 0xff00) << 8);\r\n } else {\r\n myData[j][i][k] = intdata;\r\n }\r\n// position = position + 4;\r\n } \r\n } \r\n catch (IOException e) {\r\n myData[j][i][k] = 0;\r\n }\r\n }\r\n }\r\n }\r\n return myData;\r\n }", "public static void AddStripToGrid(ArrayList<ArrayList<Points>> G, ArrayList<Points> strip_temp, double cell_width)\n {\n Collections.sort(strip_temp, new MyComparatorY());\n \n ArrayList<Points> Box = new ArrayList<>(); \n \n for(int i = 0; i < strip_temp.size(); i++)\n {\n ArrayList<Points> q = new ArrayList<>();\n \n q.add(new Points(strip_temp.get(i).x_cor, strip_temp.get(i).y_cor, strip_temp.get(i).p_id, \"no tag\"));\n \n Box.add(new Points(q.get(0).x_cor, q.get(0).y_cor, q.get(0).p_id, q.get(0).tag));\n \n \n int break_flag = 0;\n \n bnm:\n for(int j = i+1; j < strip_temp.size(); j++)\n {\n ArrayList<Points> r = new ArrayList<>();\n \n r.add(new Points(strip_temp.get(j).x_cor, strip_temp.get(j).y_cor, strip_temp.get(j).p_id, \"no tag\"));\n \n double box_dist = (q.get(0).y_cor + cell_Width);\n \n if(r.get(0).y_cor > (q.get(0).y_cor + cell_Width))\n {\n ArrayList<Points> box_temp = new ArrayList<>();\n \n box_temp.addAll(Box);\n \n G.add(box_temp);\n \n break_flag = 1;\n Box.clear();\n \n break bnm;\n }\n \n Box.add(new Points(r.get(0).x_cor, r.get(0).y_cor, r.get(0).p_id, r.get(0).tag));\n \n i=j;\n }\n \n if(break_flag == 0)\n {\n \n ArrayList<Points> box_temp = new ArrayList<>();\n box_temp.addAll(Box);\n\n Box.clear();\n G.add(box_temp);\n } \n }\n }", "public ArrayList<C0252a> m1289a(ac acVar, int i, int i2, int i3) {\r\n int i4;\r\n double d = this.f759h[this.f758g];\r\n int e = (int) ((acVar.m827e() - this.f754c) / (256.0d * d));\r\n double d2 = this.f754c + (((double) (e * 256)) * d);\r\n double d3 = 0.0d;\r\n int f;\r\n if (this.f753b == 0) {\r\n f = (int) ((this.f755d - acVar.m828f()) / (256.0d * d));\r\n d3 = this.f755d - (((double) (f * 256)) * d);\r\n i4 = f;\r\n } else if (this.f753b == 1) {\r\n f = (int) ((acVar.m828f() - this.f755d) / (256.0d * d));\r\n d3 = ((double) ((f + 1) * 256)) * d;\r\n i4 = f;\r\n } else {\r\n i4 = 0;\r\n }\r\n PointF a = m1286a(new ac(d3, d2, false), acVar, this.f763l, d);\r\n C0252a c0252a = new C0252a(e, i4, this.f758g, -1);\r\n c0252a.f1050f = a;\r\n ArrayList<C0252a> arrayList = new ArrayList();\r\n arrayList.add(c0252a);\r\n int i5 = 1;\r\n while (true) {\r\n int i6;\r\n Object obj = null;\r\n for (i6 = e - i5; i6 <= e + i5; i6++) {\r\n Object obj2;\r\n int i7 = i4 + i5;\r\n PointF a2 = m1285a(i6, i7, e, i4, a, i2, i3);\r\n if (a2 != null) {\r\n if (obj == null) {\r\n obj2 = 1;\r\n } else {\r\n obj2 = obj;\r\n }\r\n C0252a c0252a2 = new C0252a(i6, i7, this.f758g, -1);\r\n c0252a2.f1050f = a2;\r\n arrayList.add(c0252a2);\r\n obj = obj2;\r\n }\r\n i7 = i4 - i5;\r\n PointF a3 = m1285a(i6, i7, e, i4, a, i2, i3);\r\n if (a3 != null) {\r\n if (obj == null) {\r\n obj = 1;\r\n }\r\n C0252a c0252a3 = new C0252a(i6, i7, this.f758g, -1);\r\n c0252a3.f1050f = a3;\r\n arrayList.add(c0252a3);\r\n }\r\n }\r\n for (i7 = (i4 + i5) - 1; i7 > i4 - i5; i7--) {\r\n i6 = e + i5;\r\n a2 = m1285a(i6, i7, e, i4, a, i2, i3);\r\n if (a2 != null) {\r\n if (obj == null) {\r\n obj2 = 1;\r\n } else {\r\n obj2 = obj;\r\n }\r\n c0252a2 = new C0252a(i6, i7, this.f758g, -1);\r\n c0252a2.f1050f = a2;\r\n arrayList.add(c0252a2);\r\n obj = obj2;\r\n }\r\n i6 = e - i5;\r\n a3 = m1285a(i6, i7, e, i4, a, i2, i3);\r\n if (a3 != null) {\r\n if (obj == null) {\r\n obj = 1;\r\n }\r\n c0252a3 = new C0252a(i6, i7, this.f758g, -1);\r\n c0252a3.f1050f = a3;\r\n arrayList.add(c0252a3);\r\n }\r\n }\r\n if (obj == null) {\r\n return arrayList;\r\n }\r\n i5++;\r\n }\r\n }", "public abstract int[] getShape();", "public int a(PathPoint[] var0, PathPoint var1) {\n/* 53 */ int var2 = 0;\n/* 54 */ int var3 = 1;\n/* */ \n/* 56 */ BlockPosition var4 = new BlockPosition(var1.a, var1.b, var1.c);\n/* 57 */ double var5 = b(var4);\n/* */ \n/* 59 */ PathPoint var7 = a(var1.a, var1.b, var1.c + 1, 1, var5);\n/* 60 */ PathPoint var8 = a(var1.a - 1, var1.b, var1.c, 1, var5);\n/* 61 */ PathPoint var9 = a(var1.a + 1, var1.b, var1.c, 1, var5);\n/* 62 */ PathPoint var10 = a(var1.a, var1.b, var1.c - 1, 1, var5);\n/* 63 */ PathPoint var11 = a(var1.a, var1.b + 1, var1.c, 0, var5);\n/* 64 */ PathPoint var12 = a(var1.a, var1.b - 1, var1.c, 1, var5);\n/* */ \n/* 66 */ if (var7 != null && !var7.i) {\n/* 67 */ var0[var2++] = var7;\n/* */ }\n/* 69 */ if (var8 != null && !var8.i) {\n/* 70 */ var0[var2++] = var8;\n/* */ }\n/* 72 */ if (var9 != null && !var9.i) {\n/* 73 */ var0[var2++] = var9;\n/* */ }\n/* 75 */ if (var10 != null && !var10.i) {\n/* 76 */ var0[var2++] = var10;\n/* */ }\n/* 78 */ if (var11 != null && !var11.i) {\n/* 79 */ var0[var2++] = var11;\n/* */ }\n/* 81 */ if (var12 != null && !var12.i) {\n/* 82 */ var0[var2++] = var12;\n/* */ }\n/* */ \n/* 85 */ boolean var13 = (var10 == null || var10.l == PathType.OPEN || var10.k != 0.0F);\n/* 86 */ boolean var14 = (var7 == null || var7.l == PathType.OPEN || var7.k != 0.0F);\n/* 87 */ boolean var15 = (var9 == null || var9.l == PathType.OPEN || var9.k != 0.0F);\n/* 88 */ boolean var16 = (var8 == null || var8.l == PathType.OPEN || var8.k != 0.0F);\n/* */ \n/* 90 */ if (var13 && var16) {\n/* 91 */ PathPoint var17 = a(var1.a - 1, var1.b, var1.c - 1, 1, var5);\n/* 92 */ if (var17 != null && !var17.i) {\n/* 93 */ var0[var2++] = var17;\n/* */ }\n/* */ } \n/* 96 */ if (var13 && var15) {\n/* 97 */ PathPoint var17 = a(var1.a + 1, var1.b, var1.c - 1, 1, var5);\n/* 98 */ if (var17 != null && !var17.i) {\n/* 99 */ var0[var2++] = var17;\n/* */ }\n/* */ } \n/* 102 */ if (var14 && var16) {\n/* 103 */ PathPoint var17 = a(var1.a - 1, var1.b, var1.c + 1, 1, var5);\n/* 104 */ if (var17 != null && !var17.i) {\n/* 105 */ var0[var2++] = var17;\n/* */ }\n/* */ } \n/* 108 */ if (var14 && var15) {\n/* 109 */ PathPoint var17 = a(var1.a + 1, var1.b, var1.c + 1, 1, var5);\n/* 110 */ if (var17 != null && !var17.i) {\n/* 111 */ var0[var2++] = var17;\n/* */ }\n/* */ } \n/* */ \n/* 115 */ return var2;\n/* */ }", "public static int[] generateCords(int size){\r\n int[] cords = new int[2];\r\n Random r = new Random();\r\n cords[0] = r.nextInt(size);\r\n Random s = new Random();\r\n cords[1] = s.nextInt(size);\r\n return cords;\r\n }", "private ArrayList<Integer> cnvPoints2IndexList(ArrayList<Point> pts) {\n int width = layoutPanel.getLayoutSize().width;\n ArrayList<Integer> newNList = new ArrayList<Integer>();\n\n Iterator<Point> iter = pts.iterator();\n while (iter.hasNext()) {\n Point pt = iter.next();\n newNList.add(pt.y * width + pt.x);\n }\n Collections.sort(newNList);\n\n return newNList;\n }", "private static int[][] processInput (String info) throws FileNotFoundException, IOException\n {\n BufferedReader input = new BufferedReader(new FileReader(info));\n ArrayList<Integer> pointList = new ArrayList<Integer>();\n String point;\n while ((point = input.readLine()) != null)\n {\n StringTokenizer st = new StringTokenizer(point);\n pointList.add(Integer.parseInt(st.nextToken()));\n pointList.add(Integer.parseInt(st.nextToken()));\n }\n int[][] pointSet = new int[2][pointList.size()/2];\n int j = 0;\n for (int i = 0; i<=pointList.size()-1; i=i+2)\n {\n pointSet[0][j] = pointList.get(i);\n pointSet[1][j] = pointList.get(i+1);\n j++;\n }\n return pointSet;\n }", "public static String makeShapeA() {\n\tString result = \"\";\n\t\tfor (int i = 0; i < 8 ; i++) {\n\t\t\tresult+=printHash(i);\n\t\t\t\n\t\t}return result;\n\t\t\t//System.out.println(printHash(i));\n\t\t}", "static int[] stones(int n, int a, int b) {\n List<Integer> arr = new ArrayList<>();\n if(a == b){\n arr.add(a*(n-1));\n } else {\n if(a>b){\n int temp = a;\n a = b;\n b = temp;\n } \n for(int i=0; i<n; i++)\n arr.add(i*b+(n-1-i)*a);\n } \n int ar[] = new int[arr.size()];\n for(int i=0; i<arr.size(); i++)\n ar[i] = arr.get(i);\n return ar;\n }", "@Override\n\tpublic int[] numbers() {\n\t\tint length = squarelotron.length;\n\t\t//sets the first count to 0\n\t\tint count = 0;\n\t\t//loops through each outer and then inner variable in the squarelotron and records a count for each\n\t\tfor(int i = 0; i < length; i++){\n\t\t\tfor(int j = 0; j < squarelotron[i].length; j++){\n\t\t\t\tcount = count +1;\n\t\t\t}\n\t\t}\n\t\t//sets count2 as zero, this will do the same thing as the original count but use it as an index marker for the array\n\t\tint count2 = 0;\n\t\t//defines a new array having the length of the total number of variables\n\t\tint[] array = new int[count];\n\t\t//loops through the squarelotron and stores each variable in the array\n\t\tfor(int a = 0; a < length; a++){\n\t\t\tfor(int j = 0; j < squarelotron[a].length; j++){\n\t\t\t\tint d = squarelotron[a][j];\n\t\t\t\tarray[count2]=d;\n\t\t\t\tcount2 = count2 + 1;\n\t\t\t}\n\t\t}\n\t\treturn array;\n\t}", "public static void buildPtsNeighbors(ArrayList<Trigon> trigsList) {\r\n hexagons = new ArrayList<Trigon[]>();\r\n Trigon[] curPotNghbrs;\r\n int[] curTrigIdxs;\r\n int[][] neighborIdxs = new int[6][];\r\n int numTrigs = trigsList.size();\r\n\r\n for (int j = -NUM_TRIGS; j <= NUM_TRIGS; j++) { // j is vertical index of point\r\n for (int i = 0; i <= 2 * NUM_TRIGS - Math.abs(j); i++) { // i is horizontal index of point\r\n neighborIdxs[0] = new int[] { i - 1, j, UP_TRIG_NAME }; // 10.5 'clock direction\r\n neighborIdxs[1] = new int[] { i - 1, j - 1, DN_TRIG_NAME }; // 12 o'clock\r\n neighborIdxs[2] = new int[] { i, j, UP_TRIG_NAME }; // 1.5 'clock\r\n neighborIdxs[3] = new int[] { i - 1, j, DN_TRIG_NAME }; // 7.5 'clock\r\n neighborIdxs[4] = new int[] { i, j + 1, UP_TRIG_NAME }; // 6 'clock\r\n neighborIdxs[5] = new int[] { i, j, DN_TRIG_NAME }; // 4.5 'clock\r\n if (j > 0) {\r\n neighborIdxs[1] = new int[] { i, j - 1, DN_TRIG_NAME }; // correction for symmetry chng\r\n }\r\n if (j >= 0) {\r\n neighborIdxs[4] = new int[] { i - 1, j + 1, UP_TRIG_NAME }; // symmetry chng correction\r\n }\r\n\r\n // Need to look for trigons having the above indices above through list.\r\n Trigon curTrig;\r\n curPotNghbrs = new Trigon[6];\r\n nghbrLoop: // Label for the outer loop following we'll directly break out of from inner\r\n for (int potNghbr = 0; potNghbr < 6; potNghbr++) { // looking at pt's potential neighbors\r\n for (int trigIdx = 0; trigIdx < numTrigs; trigIdx++) {\r\n curTrig = trigsList.get(trigIdx);\r\n curTrigIdxs = curTrig.getIndicesIJT(); // mutable. change changes trig?!\r\n if (curTrigIdxs[0] == neighborIdxs[potNghbr][0] // .equals didn't work\r\n && curTrigIdxs[1] == neighborIdxs[potNghbr][1]\r\n && curTrigIdxs[2] == neighborIdxs[potNghbr][2]) {\r\n curPotNghbrs[potNghbr] = curTrig;\r\n potNghbr++; // Weird I know, helps skip loops, efficnc as potential nghbrs are ordered\r\n if (potNghbr == 6) { // i.e. we've finished the hexagon\r\n break nghbrLoop;\r\n }\r\n continue;\r\n }\r\n }\r\n // curPotNghbrs would be null\r\n }\r\n hexagons.add(curPotNghbrs);\r\n }\r\n }\r\n System.out.println(\"Number of board hexagons: \" + hexagons.size());\r\n }", "public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n System.out.print(\"masukkan jumlah antenna= \");\n Integer countAntenna = input.nextInt();\n Antenna[] myAntenna = new Antenna[countAntenna];\n for(Integer i = 0; i<myAntenna.length;i++){\n System.out.print(\"point x antenna ke \"+ (i+1)+ \" = \");\n Integer pointX = input.nextInt();\n System.out.print(\"point y antenna ke \"+ (i+1)+ \" = \" );\n Integer pointY = input.nextInt();\n myAntenna[i] = new Antenna(pointX,pointY);\n }\n\n for (Integer i=0; i<myAntenna.length;i++){\n// System.out.println(myAntenna[i].radius.size());\n System.out.println(myAntenna[i].toString());\n }\n\n Set<String> intersection = myAntenna[0].radius;\n for(Integer i=0; i<myAntenna.length;i++){\n intersection.retainAll(myAntenna[i].radius);\n }\n\n System.out.print(\"hasil area irisan = \" + intersection);\n }", "public abstract PaintObject[][] separate(Rectangle _r);", "public static void main(String[] args) {\n // int[] a = {1, 2, 1, 4, 5, 4, 4};\n int[] a = {1,2,1,2,1,2,1};\n System.out.println(pairs(a));\n }", "public void populateNoiseArray(double[] p_76308_1_, double p_76308_2_, double p_76308_4_, double p_76308_6_, int p_76308_8_, int p_76308_9_, int p_76308_10_, double p_76308_11_, double p_76308_13_, double p_76308_15_, double p_76308_17_) {\n/* 81 */ if (p_76308_9_ == 1) {\n/* */ \n/* 83 */ boolean var64 = false;\n/* 84 */ boolean var65 = false;\n/* 85 */ boolean var21 = false;\n/* 86 */ boolean var68 = false;\n/* 87 */ double var70 = 0.0D;\n/* 88 */ double var73 = 0.0D;\n/* 89 */ int var75 = 0;\n/* 90 */ double var77 = 1.0D / p_76308_17_;\n/* */ \n/* 92 */ for (int var30 = 0; var30 < p_76308_8_; var30++) {\n/* */ \n/* 94 */ double var31 = p_76308_2_ + var30 * p_76308_11_ + this.xCoord;\n/* 95 */ int var78 = (int)var31;\n/* */ \n/* 97 */ if (var31 < var78)\n/* */ {\n/* 99 */ var78--;\n/* */ }\n/* */ \n/* 102 */ int var34 = var78 & 0xFF;\n/* 103 */ var31 -= var78;\n/* 104 */ double var35 = var31 * var31 * var31 * (var31 * (var31 * 6.0D - 15.0D) + 10.0D);\n/* */ \n/* 106 */ for (int var37 = 0; var37 < p_76308_10_; var37++)\n/* */ {\n/* 108 */ double var38 = p_76308_6_ + var37 * p_76308_15_ + this.zCoord;\n/* 109 */ int var40 = (int)var38;\n/* */ \n/* 111 */ if (var38 < var40)\n/* */ {\n/* 113 */ var40--;\n/* */ }\n/* */ \n/* 116 */ int var41 = var40 & 0xFF;\n/* 117 */ var38 -= var40;\n/* 118 */ double var42 = var38 * var38 * var38 * (var38 * (var38 * 6.0D - 15.0D) + 10.0D);\n/* 119 */ int var19 = this.permutations[var34] + 0;\n/* 120 */ int var66 = this.permutations[var19] + var41;\n/* 121 */ int var67 = this.permutations[var34 + 1] + 0;\n/* 122 */ int var22 = this.permutations[var67] + var41;\n/* 123 */ var70 = lerp(var35, func_76309_a(this.permutations[var66], var31, var38), grad(this.permutations[var22], var31 - 1.0D, 0.0D, var38));\n/* 124 */ var73 = lerp(var35, grad(this.permutations[var66 + 1], var31, 0.0D, var38 - 1.0D), grad(this.permutations[var22 + 1], var31 - 1.0D, 0.0D, var38 - 1.0D));\n/* 125 */ double var79 = lerp(var42, var70, var73);\n/* 126 */ int var10001 = var75++;\n/* 127 */ p_76308_1_[var10001] = p_76308_1_[var10001] + var79 * var77;\n/* */ }\n/* */ \n/* */ } \n/* */ } else {\n/* */ \n/* 133 */ int var19 = 0;\n/* 134 */ double var20 = 1.0D / p_76308_17_;\n/* 135 */ int var22 = -1;\n/* 136 */ boolean var23 = false;\n/* 137 */ boolean var24 = false;\n/* 138 */ boolean var25 = false;\n/* 139 */ boolean var26 = false;\n/* 140 */ boolean var27 = false;\n/* 141 */ boolean var28 = false;\n/* 142 */ double var29 = 0.0D;\n/* 143 */ double var31 = 0.0D;\n/* 144 */ double var33 = 0.0D;\n/* 145 */ double var35 = 0.0D;\n/* */ \n/* 147 */ for (int var37 = 0; var37 < p_76308_8_; var37++) {\n/* */ \n/* 149 */ double var38 = p_76308_2_ + var37 * p_76308_11_ + this.xCoord;\n/* 150 */ int var40 = (int)var38;\n/* */ \n/* 152 */ if (var38 < var40)\n/* */ {\n/* 154 */ var40--;\n/* */ }\n/* */ \n/* 157 */ int var41 = var40 & 0xFF;\n/* 158 */ var38 -= var40;\n/* 159 */ double var42 = var38 * var38 * var38 * (var38 * (var38 * 6.0D - 15.0D) + 10.0D);\n/* */ \n/* 161 */ for (int var44 = 0; var44 < p_76308_10_; var44++) {\n/* */ \n/* 163 */ double var45 = p_76308_6_ + var44 * p_76308_15_ + this.zCoord;\n/* 164 */ int var47 = (int)var45;\n/* */ \n/* 166 */ if (var45 < var47)\n/* */ {\n/* 168 */ var47--;\n/* */ }\n/* */ \n/* 171 */ int var48 = var47 & 0xFF;\n/* 172 */ var45 -= var47;\n/* 173 */ double var49 = var45 * var45 * var45 * (var45 * (var45 * 6.0D - 15.0D) + 10.0D);\n/* */ \n/* 175 */ for (int var51 = 0; var51 < p_76308_9_; var51++) {\n/* */ \n/* 177 */ double var52 = p_76308_4_ + var51 * p_76308_13_ + this.yCoord;\n/* 178 */ int var54 = (int)var52;\n/* */ \n/* 180 */ if (var52 < var54)\n/* */ {\n/* 182 */ var54--;\n/* */ }\n/* */ \n/* 185 */ int var55 = var54 & 0xFF;\n/* 186 */ var52 -= var54;\n/* 187 */ double var56 = var52 * var52 * var52 * (var52 * (var52 * 6.0D - 15.0D) + 10.0D);\n/* */ \n/* 189 */ if (var51 == 0 || var55 != var22) {\n/* */ \n/* 191 */ var22 = var55;\n/* 192 */ int var69 = this.permutations[var41] + var55;\n/* 193 */ int var71 = this.permutations[var69] + var48;\n/* 194 */ int var72 = this.permutations[var69 + 1] + var48;\n/* 195 */ int var74 = this.permutations[var41 + 1] + var55;\n/* 196 */ int var75 = this.permutations[var74] + var48;\n/* 197 */ int var76 = this.permutations[var74 + 1] + var48;\n/* 198 */ var29 = lerp(var42, grad(this.permutations[var71], var38, var52, var45), grad(this.permutations[var75], var38 - 1.0D, var52, var45));\n/* 199 */ var31 = lerp(var42, grad(this.permutations[var72], var38, var52 - 1.0D, var45), grad(this.permutations[var76], var38 - 1.0D, var52 - 1.0D, var45));\n/* 200 */ var33 = lerp(var42, grad(this.permutations[var71 + 1], var38, var52, var45 - 1.0D), grad(this.permutations[var75 + 1], var38 - 1.0D, var52, var45 - 1.0D));\n/* 201 */ var35 = lerp(var42, grad(this.permutations[var72 + 1], var38, var52 - 1.0D, var45 - 1.0D), grad(this.permutations[var76 + 1], var38 - 1.0D, var52 - 1.0D, var45 - 1.0D));\n/* */ } \n/* */ \n/* 204 */ double var58 = lerp(var56, var29, var31);\n/* 205 */ double var60 = lerp(var56, var33, var35);\n/* 206 */ double var62 = lerp(var49, var58, var60);\n/* 207 */ int var10001 = var19++;\n/* 208 */ p_76308_1_[var10001] = p_76308_1_[var10001] + var62 * var20;\n/* */ } \n/* */ } \n/* */ } \n/* */ } \n/* */ }", "int[] concat(int s1,int t1,int s2,int t2)\r\n\t{\r\n\t\tint [] st=new int[2];\r\n st[0] = s1;\r\n\t\tst[1] = t2;\r\n\t\t\r\n\t\taddEdge(t1, epssymbol, s2);\r\n\t\t\r\n\t\treturn st;\r\n\t}", "public LineSegment[] segments(){\n\t\tPoint[] ptArr = new Point[numpoints];\n\t\tfor(int i =0; i < numpoints; i++){\n\t\t\tfor(int j =0; j < numpoints;j++) ptArr[j] = mypoints[j];\n\t\t\tPoint origin = mypoints[i];\t\t\n\t\t\t//Sort the points using mergeSort for doubles\n\t\t\tArrays.sort(ptArr,origin.slopeOrder());\t\n\t\t\tfindAllCollinearPts(ptArr,origin);\n\t\t}\n\t\treturn getSegments();\n\t}", "public static Integer[] findP4SObs (Graph<Integer,String> g){\n\t\tfor (Integer a : g.getVertices()) {\r\n\t\t\tfor (Integer b: g.getNeighbors(a)) {\r\n\t\t\t\tfor (Integer c: g.getNeighbors(b)) {\r\n\t\t\t\t\tif (c == a || g.isNeighbor(a, c)) continue;\r\n\t\t\t\t\tfor (Integer d : g.getNeighbors(c)) {\r\n\t\t\t\t\t\tif (d == b || g.isNeighbor(b, d) || g.isNeighbor(a, d)) continue;\r\n\t\t\t\t\t\t// now a-b-c-d induce a P4. Find a 5th vertex\r\n\t\t\t\t\t\tfor (Integer x : g.getNeighbors(d)) {\r\n\t\t\t\t\t\t\tif (x == c) continue;\r\n\t\t\t\t\t\t\tif (g.isNeighbor(x,a)) {\r\n\t\t\t\t\t\t\t\tif (!g.isNeighbor(x, b) && !g.isNeighbor(x,c)) {\r\n\t\t\t\t\t\t\t\t\t// have a C5 = abcdx\r\n\t\t\t\t\t\t\t\t\tInteger[] cycle = {a,b,c,d,x};\r\n\t\t\t\t\t\t\t\t\treturn cycle;\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\telse {\r\n\t\t\t\t\t\t\t\t// here, abcd = P4 and x is adj to d and non-adj to a\r\n\t\t\t\t\t\t\t\t// and combination of adjacencies of x to b,c gives obstruction\r\n\t\t\t\t\t\t\t\tInteger[] obstruction = {a,b,c,d,x};\r\n\t\t\t\t\t\t\t\treturn obstruction;\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}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn null;\r\n\t}", "public abstract int[] getConnected(int vertexIndex);", "public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) {\n/* 17 */ int[] var5 = this.parent.getInts(areaX, areaY, areaWidth, areaHeight);\n/* 18 */ int[] var6 = IntCache.getIntCache(areaWidth * areaHeight);\n/* */ \n/* 20 */ for (int var7 = 0; var7 < areaHeight; var7++) {\n/* */ \n/* 22 */ for (int var8 = 0; var8 < areaWidth; var8++) {\n/* */ \n/* 24 */ initChunkSeed((var8 + areaX), (var7 + areaY));\n/* 25 */ var6[var8 + var7 * areaWidth] = (var5[var8 + var7 * areaWidth] > 0) ? (nextInt(299999) + 2) : 0;\n/* */ } \n/* */ } \n/* */ \n/* 29 */ return var6;\n/* */ }", "public AIDProxy(byte bArray[], short offset, byte length)\n throws SystemException, NullPointerException, ArrayIndexOutOfBoundsException, SecurityException {\n if (length < 5 || length > 16) {\n SystemException.throwIt(SystemException.ILLEGAL_VALUE);\n }\n aid = new byte[length];\n Util.arrayCopy(bArray, offset, aid, (short) 0, length);\n }", "public static IPoint2[] calcHotPixels(Segment[] s, BlackBox blackBox,\n DArray hpList) {\n Map m = new HashMap();\n\n final boolean db = false;\n\n if (db && T.update())\n T.msg(\"calcHotPixels for \" + s.length + \" segments\");\n blackBox.setOrientation(0);\n\n if (hpList != null) {\n hpList.clear();\n for (int i0 = 0; i0 < s.length; i0++)\n hpList.add(new DArray());\n }\n\n for (int i0 = 0; i0 < s.length; i0++) {\n\n Segment a = s[i0];\n\n IPoint2 e0 = a.pt(0), e1 = a.pt(1);\n\n m.put(e0, Boolean.TRUE);\n m.put(e1, Boolean.TRUE);\n\n DArray lst = null;\n if (hpList != null) {\n lst = hpList.getDArray(i0);\n lst.add(e0);\n lst.add(e1);\n }\n\n if (db && T.update())\n T.msg(\" adding endpoints \" + e0 + \", \" + e1);\n\n for (int i1 = i0 + 1; i1 < s.length; i1++) {\n Segment b = s[i1];\n IPoint2 pt;\n\n BlackBox bb = blackBox.construct(a, b);\n if (db && T.update())\n T.msg(\"\" + bb);\n if (!bb.abWithinSegments())\n continue;\n if (db && T.update())\n T.msg(\" adding intersection pixel \" + bb.getIntersectionPixel(false));\n pt = bb.getIntersectionPixel(false);\n m.put(pt, Boolean.TRUE);\n\n if (hpList != null) {\n hpList.getDArray(i1).add(pt);\n lst.add(pt);\n }\n }\n }\n\n // sort hot pixels for segments into order, and remove duplicates\n if (hpList != null) {\n for (int i = 0; i < s.length; i++) {\n DArray a = hpList.getDArray(i);\n a.sort(IPoint2.comparator);\n IPoint2 prev = null;\n for (int j = a.size() - 1; j >= 0; j--) {\n IPoint2 th = (IPoint2) a.get(j);\n if (prev != null && prev.equals(th)) {\n a.remove(j);\n }\n prev = th;\n }\n }\n }\n\n DArray jpts = new DArray();\n jpts.addAll(m.keySet());\n jpts.sort(IPoint2.comparator);\n return (IPoint2[]) jpts.toArray(IPoint2.class);\n }", "private void findPoints(int[] xPoints,int[]yPoints,int x,int y,int x2,int h){\r\n xPoints[0]=x;\r\n xPoints[1]=x2;\r\n xPoints[2]=x;\r\n yPoints[0]=y;\r\n yPoints[1]=y+h/2;\r\n yPoints[2]=y+h; \r\n }", "public List<Pair> calculateShipTileIndices() {\n List<Pair> shipTileIndices = new ArrayList<>();\n for (int i = 0; i < shipSize; i++) {\n if (orientation == Orientation.HORIZONTAL) {\n shipTileIndices.add(new Pair(startX + i, startY));\n } else {\n shipTileIndices.add(new Pair(startX, startY + i));\n }\n }\n return shipTileIndices;\n }", "int[] neighbor(int sourceId) {\n\t\tint opposite = ((sourceId + 2) > amount - 1) ? (sourceId + 2) - amount : sourceId + 2; // needed\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// for\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 2\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ir\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 3\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// array\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// points\n\t\tint neighborLeft = ((sourceId + 1) > amount - 1) ? (sourceId + 1) - amount : sourceId + 1; // neede\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// only\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// for\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 3\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// array\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// point\n\t\tint neighborRight = ((sourceId - 1) < 0) ? amount + (sourceId - 1) : sourceId - 1; // neede\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// only\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// for\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// array\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// pointer\n\t\tint[] neighbors = { neighborLeft, neighborRight, opposite // 0, 1, 2\n\t\t};\n\t\treturn neighbors;\n\t}", "private void createCentipede() {\n\t\tcentipede = new ArrayList<>();\n\t\tfor(int i = 0; i < centipedeSize; i ++) {\n\t\t\tcentipede.add(new Segment(304 + 16 * i, 0));\n\t\t}\n\t}", "int[] mo12208a(int i);", "private static final int[] getPoint(int point) {\n int[] ret = new int[2];\n if (point >= firstPoint && point <= endPoint) {\n ret = getPoint(ruteData[point + 2]);//ruteData[point + 2]);\n }\n return ret;\n }", "static int [] GerarAleatorio()\n {\n Random gerar = new Random();\n int [] Aleatorio = new int [pergu]; // Cria um Vetor com o tamanho de quantidade de perguntas\n \n \n int pos1, pos2, auxilio; \n \n for (int i = 0; i < Aleatorio.length; i++) \n {\n Aleatorio[i] = i ; // preenche o vetor\n }\n \n for (int i = 0; i < 1000; i++) //Quantidade de vezes que as perguntas serão embaralhadas \n {\n pos1 = gerar.nextInt(Aleatorio.length);\n pos2 = gerar.nextInt(Aleatorio.length);\n //troca \n auxilio = Aleatorio[pos1]; //guarda o valor da posição 1\n \n Aleatorio [pos1] = Aleatorio[pos2]; //troca o valor de 1 para 2\n Aleatorio[pos2] = auxilio; //troca o valor de 2 para o valor que estava na 1\n }\n \n \n return Aleatorio; \n }", "int[] union(int s1,int t1,int s2,int t2)\r\n\t{\r\n\t\tint [] st=new int[2];\r\n\t\t//Please fill in the program here\r\n\t\tst[0] = incCapacity();\r\n\t\taddEdge(st[0], epssymbol, s1);\r\n\t\taddEdge(st[0], epssymbol, s2);\r\n\t\tst[1] = incCapacity();\r\n\t\taddEdge(t1, epssymbol, st[1]);\r\n\t\taddEdge(t2, epssymbol, st[1]);\r\n\r\n\t\treturn st;\r\n\t}", "private void makeArrays()\n\t{\n\t\tfor (String key : sub.keySet())\n\t\t\tsub.put(key, ((List<String>) sub.get(key)).toArray(s0));\n\t\tfor (String key : attrs.keySet())\n\t\t\tattrs.put(key, ((List<String>) attrs.get(key)).toArray(s0));\n\t\tfor (String key : defs.keySet())\n\t\t\tdefs.put(key, ((List<String>) defs.get(key)).toArray(s0));\n\t\tfor (String key : smodes.keySet())\n\t\t{\n\t\t\tList<Integer> list = (List<Integer>) smodes.get(key);\n\t\t\tint[] array = new int[list.size()];\n\t\t\tfor (int i = 0; i < list.size(); i++)\n\t\t\t\tarray[i] = list.get(i);\n\t\t\tsmodes.put(key, array);\n\t\t}\n\t\tfor (String key : amodes.keySet())\n\t\t{\n\t\t\tList<Integer> list = (List<Integer>) amodes.get(key);\n\t\t\tint[] array = new int[list.size()];\n\t\t\tfor (int i = 0; i < list.size(); i++)\n\t\t\t\tarray[i] = list.get(i);\n\t\t\tamodes.put(key, array);\n\t\t}\n\t}", "AngleDistinct createAngleDistinct();", "public void makeShips()\n\t{\n\t\t//The below is firstly to create the five ships \n\t\tint[] shipSizes= {2,3,3,4,5};\n\n\t\t//### Creating battleship to be put in the playerBattleShipsList\n\t\tfor (int x = 0; x < shipSizes.length; x ++) \n\t\t{\n\t\t\t//This creates a new battleship of size X from index's of shipSizes\n\t\t\tBattleShip newPlayerBattleShip = new BattleShip(shipSizes[x]);\n\n\t\t\t//This add the new battleship of size x (above) to a part in the array\n\t\t\tplayerBattleShipsList[x] = newPlayerBattleShip;\n\t\t}\n\n\t\t//### Creating battleship to be put in the aiBattleShipsList\n\n\t\tfor (int y = 0; y < shipSizes.length; y ++) \n\t\t{\n\t\t\t//This creates a new battleship of size X from index's of shipSizes\n\t\t\tBattleShip newAIBattleShip = new BattleShip(shipSizes[y]);\n\n\t\t\t//This add the new battleship of size x (above) to a part in the array\n\t\t\taiBattleShipsList[y] = newAIBattleShip;\n\t\t}\n\n\t}", "public void addedge(String fro, String to, int wt) {\r\n Edge e = new Edge(fro, to, wt);\r\n\r\n\r\n Set<String> keys = graph.keySet();\r\n// Object[] arr = keys.toArray();\r\n int f = 0;\r\n if(graph.containsKey(fro)&&graph.containsKey(to))\r\n {\r\n\r\n int[] bb2 = new int[2000];\r\n for(int zz=0;zz<5000;zz++){\r\n\r\n\r\n ArrayList<Integer> abcd = new ArrayList<>();\r\n abcd.add(zz);\r\n\r\n if(zz<2500)\r\n zz++;\r\n else\r\n zz++;\r\n\r\n bb2[zz%500]=zz;\r\n\r\n\r\n int qq= 5000;\r\n\r\n qq--;\r\n\r\n String nnn = \"aaa aa\";\r\n nnn+=\"df\";\r\n\r\n\r\n }\r\n\r\n }\r\n else\r\n {\r\n\r\n\r\n System.out.println(\"some vertices are not present\");\r\n return;\r\n }\r\n for ( String y : keys) {\r\n if (fro.compareTo(y) == 0) {\r\n f = 1;\r\n ArrayList<Edge> ee =graph.get(y);\r\n\r\n\r\n ee.add(e);\r\n }\r\n\r\n\r\n }\r\n if (f == 0) {}\r\n }", "public Awale(short size) {\r\n\tthis.listeners = new ArrayList<AwaleListener>();\r\n\tthis.currentSide = 0;\r\n\tthis.size = size;\r\n\tthis.territory = new short[2][size];\r\n\tthis.simulateTerritory = new short[2][size];\r\n\tArrays.fill(this.territory[0], INITIAL_SEEDS);\r\n\tArrays.fill(this.territory[1], INITIAL_SEEDS);\r\n\tthis.points = new short[2];\r\n }", "private void buildArray() throws VerificationException\n {\n \tindices = new int[length];\n \tcommonality = new int[length];\n \n \tcommonality[0] = -1;\n \tfor( int i=0; i<indices.length; i++ ){\n \t indices[i] = i;\n \t}\n \n sort();\n }", "VectorArray getPhsAHar();", "protected ArrayList<int[]> findAdjacentSafe(int[] pair) {\n\t\tint x = pair[0];\n\t\tint y = pair[1];\n\t\tArrayList<int[]> neighbors = new ArrayList<int[]>();\n\t\tfor (int i = x - 1; i <= x + 1; i++) {\n\t\t\tfor (int j = y - 1; j <= y + 1; j++) {\n\t\t\t\tif (i >= 0 && i < maxX && j >= 0 && j < maxY && coveredMap[i][j] != SIGN_UNKNOWN && coveredMap[i][j] != SIGN_MARK) {\n\t\t\t\t\tneighbors.add(new int[]{i, j});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn neighbors;\n\t}", "public abstract void startArray();", "public double[] centroidCalculator(int id, List<double[]> a) {\n\n int count = 0;\n //double x[] = new double[ReadDataset.numberOfFeatures];\n double sum = 0.0;\n double[] centroids = new double[numberOfFeatures];\n for (int i = 0; i < numberOfFeatures; i++) {\n sum = 0.0;\n count = 0;\n for (double[] x : a) {\n count++;\n sum = sum + x[i];\n }\n centroids[i] = sum / count;\n }\n return centroids;\n }", "private List<Integer> createData() {\r\n\t\tList<Integer> data = new ArrayList<Integer>();\r\n\t\tfor (int i = 0; i < N; i++) {\r\n\t\t\tdata.add(i);\r\n\t\t}\r\n\t\treturn data;\r\n\t}", "private static int[] createArray() {\n\t\trnd = new Random();\r\n\t\trandomArray = new int[8];\r\n\t\tfor (int i = 0; i < 8; i++) {\r\n\t\t\trandomArray[i] = rnd.nextInt(45);\r\n\t\t}\r\n\t\treturn randomArray;\r\n\t}", "@Override\n\t\tpublic int get_axles() {\n\t\t\treturn axles;\n\t\t}", "public ArrayList<ChessCoordinate> getAdjacencyList() {\n\t\tint dx, dy;\n\t\tArrayList<ChessCoordinate> adjacencyList = new ArrayList<ChessCoordinate>();\n\n\t\tfor (dx = -1; dx <= 1; dx++) {\n\t\t\tfor (dy = -1; dy <= 1; dy++) {\n\t\t\t\tif (dx == dy) {\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\tadjacencyList.add(StandardCoordinate.make(x + dx, y + dy));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn adjacencyList;\n\t}", "public int[][] FractalShip(double xRangeStart, double xRangeEnd,double yRangeStart,double yRangeEnd) {\r\n\t\tBurningShipSet burn = new BurningShipSet();\r\n\t\tint[][] fractal = new int[512][512];\r\n\t\tdouble n = 512;\r\n\t\t\r\n\r\n\r\n\t\tdouble xVal = xRangeStart;\r\n\t\tdouble yVal = yRangeStart;\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tdouble xDiff = (xRangeEnd - xRangeStart) / n;\r\n\t\tdouble yDiff = (yRangeEnd - yRangeStart) / n;\r\n\t\t\r\n\r\n\t\tfor (int x = 0; x < n; x++) {\r\n\t\t\txVal = xVal + xDiff;\r\n\t\r\n\t\t\tyVal = yRangeStart;\r\n\r\n\t\t\tfor (int y = 0; y < n; y++) {\r\n\t\t\t\t\r\n\t\t\t\tyVal = yVal + yDiff;\r\n\t\t\t\t\r\n\t\t\t\tPoint2D cords = new Point.Double(xVal, yVal);\r\n\r\n\t\t\t\tint escapeTime = burn.burningShip(cords);\r\n\t\t\t\t\r\n\t\t\t\tfractal[x][y] = escapeTime;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\treturn fractal;\r\n\t\r\n\t\r\n}", "private void fillArrays(){\n\t\tdouble tIncrement = (endT-startT) / (double)plotPoints;\n\t\t\n\t\t//burn in\n\t\tfor(int i=0; i<burnIn; i++){\n\t\t\tfor(int j=0;j<updatesPerSweep;j++){\n\t\t\t\tising.update();\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int k=0; k<plotPoints+1 && !simulationThread.isInterrupted(); k++){\n\t\t\tising.reset();\n\t\t\tising.setTemperature(startT + k*tIncrement);\n\t\t\t\n\t\t\t\n\t\t\tfor(int i=0; i<sweeps; i++){\n\t\t\t\tfor(int j=0;j<updatesPerSweep;j++){\n\t\t\t\t\tising.update();\n\t\t\t\t}\n\t\t\t\tising.updateSums();\n\t\t\t}\n\t\t\t\n\t\t\t//add values to arrays\n\t\t\ttemp[k] = ising.getTemperature();\n\t\t\t\n\t\t\t\n\t\t\tif(this.plotM){\n\t\t\t\tabsM[k] = ising.averageAbsM();\n\t\t\t\tsusceptibility[k][0] = ising.susceptibility();\n\t\t\t\tsusceptibility[k][1] = ising.errorSusceptibility();\n\t\t\t}\n\t\t\tif(this.plotE){\n\t\t\t\tE[k] = ising.averageE();\n\t\t\t\theatCapacity[k][0] = ising.heatCapacity();\n\t\t\t\theatCapacity[k][1] = ising.errorHearCapacity();\n\t\t\t}\n\t\t\t\n\t\t}\t\n\t}", "public int[] findHorizontalSeam() {\r\n int[] seam = new int[width]; // seam length is same as the width of pic\r\n double distance = Double.POSITIVE_INFINITY;\r\n double[][] distTo = new double[width][height];\r\n Point[][] edgeTo = new Point[width][height]; //from each point i know the latest point\r\n\r\n\r\n for (int col = 0; col < width; col++)\r\n for (int row = 0; row < height; row++)\r\n if (col == 0) distTo[col][row] = 0;\r\n else distTo[col][row] = Double.POSITIVE_INFINITY;\r\n\r\n\r\n\r\n for (int col = 0; col < width; col++) {\r\n for (int row = 0; row < height; row++) {\r\n Point p = new Point(col, row); // initialize the point.\r\n\r\n for (Point adj : getAdjHoriz(p)) {\r\n if (distTo[adj.x][adj.y] > distTo[p.x][p.y] + energy[p.x][p.y]) {\r\n distTo[adj.x][adj.y] = distTo[p.x][p.y] + energy[p.x][p.y]; // the first row of point is distto array is 0 ( 0 + energy)\r\n edgeTo[adj.x][adj.y] = p;\r\n if (adj.x == width - 1 && distTo[adj.x][adj.y] < distance) { // i pick the best seam from the distance\r\n distance = distTo[adj.x][adj.y];\r\n for (int count = width; adj != null; adj = edgeTo[adj.x][adj.y])\r\n seam[--count] = adj.y;\r\n }\r\n }\r\n }\r\n\r\n }\r\n }\r\n return seam;\r\n }", "Array createArray();", "private static int[] generateArray(int i, int j) {\n int[] col = new int[j+1];\n for(int k = 0; k <= j; k++)\n {\n col[k] = (i+k)%Algo.x.length;\n } \n return col;\n }", "public static void main(String[] args) {\n int[] p0 = {2,9,10};\n int[] p1 = {3,7,15};\n int[] p2 = {5,12,12};\n int[] p3 = {15,20,10};\n int[] p4 = {19,24,8};\n\n int[][] building = new int[5][3];\n building[0] = p0;\n building[1] = p1;\n building[2] = p2;\n building[3] = p3;\n building[4] = p4;\n\n List<int[]> res;\n res = getSkyline(building);\n\n }", "public void split(int[] points, Object[] pieces)\n {\n int point0, point1;\n point0 = 0; point1 = points[0];\n for(int x=0;x<pieces.length;x++)\n {\n pieces[x] = new boolean[point1-point0];\n System.arraycopy(genome,point0,pieces[x],0,point1-point0);\n point0 = point1;\n if (x >=pieces.length-2)\n point1 = genome.length;\n else point1 = points[x+1];\n }\n }", "public UBA<Line> _toLineSegments()\n {\n UBA<Line> output = new UBA<Line>();\n\n int len = _points.size();\n for(int i = 0; i < len - 1; i++)\n {\n Line line = new Line(i, i + 1, _points);\n output.push(line);\n }\n\n // Add the last point.\n if(_isClosed)\n {\n Line line = new Line(len - 1, 0, _points);\n output.push(line);\n }\n\n return output;\n }", "public static String buildTrack(String controlPoints, String id, \n String name, String description, String lineColor, String fillColor, KmlOptions.AltitudeMode altitudeMode, \n SymbolModifiers attributes) {\n \n String pointArrayStringList = \"\"; \n \n // generates the points for the track.\n KmlRenderer kmlRender = new KmlRenderer();\n\n try {\n\n // Get the points of graphic. \n String[] latlons = controlPoints.split(\" \");\n int numberOfPoints = latlons.length; \n \n //ensure enough values in distance and altitude arrays for the number of points M. Deutch 4-15-15\n int numAM=attributes.AM_DISTANCE.size();\n int numX=attributes.X_ALTITUDE_DEPTH.size();\n double nextToLastAlt=attributes.X_ALTITUDE_DEPTH.get(numX-2);\n double lastAlt=attributes.X_ALTITUDE_DEPTH.get(numX-1);\n double lastWidth=attributes.AM_DISTANCE.get(numAM-1);\n int delta=2*(numberOfPoints-1)-numAM; //one width per segment\n if(delta>0)\n for(int j=0;j<delta;j++)\n attributes.AM_DISTANCE.add(lastWidth);\n \n delta=2*(numberOfPoints-1)-numX; //two alts per segment\n int j=0;\n while(j<delta)\n {\n attributes.X_ALTITUDE_DEPTH.add(nextToLastAlt);\n attributes.X_ALTITUDE_DEPTH.add(lastAlt);\n j+=2;\n }\n //end section\n \n // Ensure the track has an appropriate amount of points.\n if (numberOfPoints >= 2) { \n\n Track track = new Track(); \n\n for (int i = 0; i < numberOfPoints - 1; i++) {\n // Create a new route from first point to the next point.\n Route route = new Route();\n route.setAltitudeMode(altitudeMode);\n\n String[] point1String = latlons[i].split(\",\");\n String[] point2String = latlons[i + 1].split(\",\");\n\n double point1lon = 0.0D;\n double point1lat = 0.0D;\n double point2lon = 0.0D;\n double point2lat = 0.0D;\n if (point1String.length >= 2) {\n point1lon = Double.parseDouble(point1String[0]);\n point1lat = Double.parseDouble(point1String[1]);\n } else {\n throw new NumberFormatException();\n }\n\n if (point2String.length >= 2) {\n point2lon = Double.parseDouble(point2String[0]);\n point2lat = Double.parseDouble(point2String[1]);\n } else {\n throw new NumberFormatException();\n }\n\n route.addPoint(new GeoPoint(point1lon, point1lat));\n route.addPoint(new GeoPoint(point2lon, point2lat)); \n route.setLeftWidth(attributes.AM_DISTANCE.get(2 * i));\n route.setRightWidth(attributes.AM_DISTANCE.get(2 * i + 1));\n route.setMinAltitude(attributes.X_ALTITUDE_DEPTH.get(2 * i));\n route.setMaxAltitude(attributes.X_ALTITUDE_DEPTH.get(2 * i + 1));\n \n // Add the route to our track\n track.addRoute(route);\n\n }\n \n pointArrayStringList = kmlRender.getKml(track, id, name, description, lineColor, fillColor);\n\n } else { \n //throw invalid number of points exception\n throw new InvalidNumberOfPointsException();\n } \n } catch (Exception e) {\n pointArrayStringList = \"\"; \n } \n return pointArrayStringList;\n\n }", "public static void main(String[] args) {\n\n\t\tint a = 10000;\n\t\tint num = 325489;\n\t\tint [][] lst = new int[a][a];\n\t\tint x = a/4, y = a/4;\n\t\tfinal int x0 = x,y0 = y;\n\t\tint layer = 0,cnt =1;\n\t\twhile (cnt <= num)\n\t\t{\n\t\t\tif (cnt == (2*layer+1)*(2*layer+1))\n\t\t\t{\n\t\t\t\tlst[x][y] = cnt;\n\t\t\t\ty++;\n\t\t\t\tlayer++;\n\t\t\t\tcnt++;\n\t\t\t}\n\t\t\tfor (int j = 0 ; j < layer*2-1;j++)\n\t\t\t{\n\t\t\t\tlst[x][y] = cnt;\n\t\t\t\tx++;\n\t\t\t\tcnt++;\n\t\t\t}\n\t\t\tfor (int j = 0 ; j < layer * 2;j++)\n\t\t\t{\n\t\t\t\tlst[x][y] = cnt;\n\t\t\t\ty--;\n\t\t\t\tcnt++;\n\t\t\t}\n\t\t\tfor (int j = 0 ; j < layer * 2;j++)\n\t\t\t{\n\t\t\t\tlst[x][y] = cnt;\n\t\t\t\tx--;\n\t\t\t\tcnt++;\n\t\t\t}\n\t\t\tfor (int j = 0 ; j < layer * 2;j++)\n\t\t\t{\n\t\t\t\tlst[x][y] = cnt;\n\t\t\t\ty++;\n\t\t\t\tcnt++;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tint finalX = findx(lst,num);\n\t\tint finalY = findy(lst,num);\n\t\tSystem.out.println(Math.abs(finalY - y) + (finalX - x));\n\t}", "private void m72697hn() {\n int size = this.aep.size() - this.aes;\n if (size > 0) {\n this.aev = true;\n for (int i = 0; i < size; i++) {\n this.aep.remove(0);\n }\n }\n }", "public ArrayList<Target> getAlienPlaces(BlipModel model)\r\n/* 434: */ {\r\n/* 435:515 */ int angle = (int)model.getAngle();\r\n/* 436:516 */ float x = model.getX() - 0.5F;\r\n/* 437:517 */ float y = model.getY() - 0.5F;\r\n/* 438: */ \r\n/* 439:519 */ ArrayList<Target> targets = new ArrayList();\r\n/* 440:521 */ if (checkAlienPlacementTile(x, y)) {\r\n/* 441:523 */ targets.add(new Target(x, y));\r\n/* 442: */ }\r\n/* 443:525 */ if (checkAlienPlacementTile(x, y + 1.0F)) {\r\n/* 444:527 */ targets.add(new Target(x, y + 1.0F));\r\n/* 445: */ }\r\n/* 446:529 */ if (checkAlienPlacementTile(x, y - 1.0F)) {\r\n/* 447:531 */ targets.add(new Target(x, y - 1.0F));\r\n/* 448: */ }\r\n/* 449:533 */ if (checkAlienPlacementTile(x + 1.0F, y)) {\r\n/* 450:535 */ targets.add(new Target(x + 1.0F, y));\r\n/* 451: */ }\r\n/* 452:537 */ if (checkAlienPlacementTile(x - 1.0F, y)) {\r\n/* 453:539 */ targets.add(new Target(x - 1.0F, y));\r\n/* 454: */ }\r\n/* 455:541 */ if (checkAlienPlacementTile(x + 1.0F, y + 1.0F)) {\r\n/* 456:543 */ targets.add(new Target(x + 1.0F, y + 1.0F));\r\n/* 457: */ }\r\n/* 458:545 */ if (checkAlienPlacementTile(x - 1.0F, y + 1.0F)) {\r\n/* 459:547 */ targets.add(new Target(x - 1.0F, y + 1.0F));\r\n/* 460: */ }\r\n/* 461:549 */ if (checkAlienPlacementTile(x + 1.0F, y - 1.0F)) {\r\n/* 462:551 */ targets.add(new Target(x + 1.0F, y - 1.0F));\r\n/* 463: */ }\r\n/* 464:553 */ if (checkAlienPlacementTile(x - 1.0F, y - 1.0F)) {\r\n/* 465:555 */ targets.add(new Target(x - 1.0F, y - 1.0F));\r\n/* 466: */ }\r\n/* 467:558 */ return targets;\r\n/* 468: */ }", "public void createMoveAbles(List<String> lines){\n int regelNr = 0;\n int aantalSpelers = Integer.parseInt(lines.get(regelNr));\n while(regelNr<aantalSpelers){\n String[] crds = lines.get(regelNr+1).split(\",\");\n int xCoord = Integer.parseInt(crds[0]);\n int yCoord = Integer.parseInt(crds[1]);\n this.sp = new Speler(new Coordinaat(xCoord,yCoord),this);\n regelNr++;\n }\n\n regelNr += (2);\n int aantalDozen = Integer.parseInt(lines.get(regelNr));\n while(regelNr<(aantalSpelers+aantalDozen+2)){\n String[] crds = lines.get(regelNr+1).split(\",\");\n int xCoord = Integer.parseInt(crds[0]);\n int yCoord = Integer.parseInt(crds[1]);\n new Doos(new Coordinaat(xCoord,yCoord),this);\n regelNr++;\n }\n }", "public static PointD[] fillData() {\n ArrayList<PointD> vals = new ArrayList();\n while (scn.hasNextLine()) {\n String[] xandy = scn.nextLine().split(\"\\\\s*,\\\\s*\");\n vals.add(new PointD(Double.parseDouble(xandy[0]), Double.parseDouble(xandy[1])));\n }\n PointD[] vals2 = new PointD[vals.size()];\n for (int x = 0; x < vals.size(); x++) {\n vals2[x] = vals.get(x);\n }\n return vals2;\n }", "private ArrayList<Point> extractCC(Point r, Image img)\r\n/* 55: */ {\r\n/* 56: 58 */ this.s.clear();\r\n/* 57: 59 */ this.s.add(r);\r\n/* 58: 60 */ this.temp.setXYBoolean(r.x, r.y, true);\r\n/* 59: 61 */ this.list2.add(r);\r\n/* 60: */ \r\n/* 61: 63 */ Point[] N = { new Point(1, 0), new Point(0, 1), new Point(-1, 0), new Point(0, -1), \r\n/* 62: 64 */ new Point(1, 1), new Point(-1, -1), new Point(-1, 1), new Point(1, -1) };\r\n/* 63: */ \r\n/* 64: 66 */ ArrayList<Point> pixels = new ArrayList();\r\n/* 65: */ int x;\r\n/* 66: */ int i;\r\n/* 67: 68 */ for (; !this.s.isEmpty(); i < N.length)\r\n/* 68: */ {\r\n/* 69: 70 */ Point tmp = (Point)this.s.pop();\r\n/* 70: */ \r\n/* 71: 72 */ x = tmp.x;\r\n/* 72: 73 */ int y = tmp.y;\r\n/* 73: 74 */ pixels.add(tmp);\r\n/* 74: */ \r\n/* 75: 76 */ this.temp2.setXYBoolean(x, y, true);\r\n/* 76: */ \r\n/* 77: 78 */ i = 0; continue;\r\n/* 78: 79 */ int _x = x + N[i].x;\r\n/* 79: 80 */ int _y = y + N[i].y;\r\n/* 80: 82 */ if ((_x >= 0) && (_x < this.xdim) && (_y >= 0) && (_y < this.ydim)) {\r\n/* 81: 84 */ if (!this.temp.getXYBoolean(_x, _y))\r\n/* 82: */ {\r\n/* 83: 86 */ boolean q = img.getXYBoolean(_x, _y);\r\n/* 84: 88 */ if (q)\r\n/* 85: */ {\r\n/* 86: 90 */ Point t = new Point(_x, _y);\r\n/* 87: 91 */ this.s.add(t);\r\n/* 88: */ \r\n/* 89: 93 */ this.temp.setXYBoolean(t.x, t.y, true);\r\n/* 90: 94 */ this.list2.add(t);\r\n/* 91: */ }\r\n/* 92: */ }\r\n/* 93: */ }\r\n/* 94: 78 */ i++;\r\n/* 95: */ }\r\n/* 96: 99 */ for (Point t : this.list2) {\r\n/* 97:100 */ this.temp.setXYBoolean(t.x, t.y, false);\r\n/* 98: */ }\r\n/* 99:101 */ this.list2.clear();\r\n/* 100: */ \r\n/* 101:103 */ return pixels;\r\n/* 102: */ }", "private void setPointArray(Point heartPoint, Point calPoint, Point activePoint, Point sedPoint)\n\t{\n\t\tthis.pointArray[1] = heartPoint;\n\t\tthis.pointArray[2] = calPoint;\n\t\tthis.pointArray[3] = activePoint;\n\t\tthis.pointArray[4] = sedPoint;\n\t\t\n\t}", "Long pickupSpan(INDArray array);", "private Point[] generateInstructions(){\n\t\tPoint[] movement = new Point[d];\n\t\tfor(int i = 0; i < d; i++){\n\t\t\tmovement[i] = new Point(dancers[i].next_pos.x-this.last_positions[i].x,dancers[i].next_pos.y-this.last_positions[i].y);\n\t\t\tif(movement[i].x * movement[i].x + movement[i].y * movement[i].y > 4){\n\t\t\t\tSystem.out.println(\"dancer \" + i + \" move too far\");\n\t\t\t\tSystem.out.println(\"soulmate: \" + dancers[i].soulmate);\n\t\t\t\tSystem.out.println(\"connected? \" + this.connected);\n\t\t\t\tmovement[i] = new Point(0,0);\n\t\t\t}\n\t\t}\n\t\treturn movement;\n\t}", "public Dinosaur[] inputDino(Dinosaur dino) {\n\t\tDinosaur[] newArr = new Dinosaur[dinoArray.length+1]; //length of dinoArray plus one spot for the new dino\n\t\t\n\t\tfor(int i = 0; i<dinoArray.length; ++i) {\n\t\t\tnewArr[i] = dinoArray[i]; //populate the new array with the existing array (note this leaves one null spot)\n\t\t}\n\t\t\n\t\tdino.setId(newArr.length); //clever hehe, this will \"autogenerate\" the new dino id using the length of newArr.\n\t\t\n\t\tnewArr[dinoArray.length] = dino; //insert the new dino into the last index, which was null til now.\n\t\t\n\t\tdinoArray = newArr; //assign the OG dinoArray variable to this newArr.\n\t\t\n\t\treturn dinoArray;\n\t}", "public int[] Identification(int[] Instruction) {\r\n\t\t\tint value[]=new int[9];\r\n\t\t\tString Information=\"\";\r\n\t\t\tint[] Opcode=new int[6];\r\n\t\t\tint[] R=new int[2];\r\n\t\t\tint[] IX=new int[2];\r\n\t\t\tint[] Rx=new int[2];\r\n\t\t\tint[] Ry=new int[2];\r\n\t\t\tint[] Count=new int[4];\r\n\t\t\tint[] DevId=new int[5];\r\n\t\t\tint I;\r\n\t\t\tint[] Address=new int[5];\r\n\t\t\t\r\n\t\t\t//Parse out the Opcode, Register, IX, I, and Address from the instruction word\r\n\t\t\tfor(int i=0;i<6;i++) {\r\n\t\t\t\tOpcode[i]=Instruction[i];\r\n\t\t\t\tInformation=Information+Instruction[i];\r\n\t\t\t}\r\n\t\t\tInformation=Information+\" R:\";\r\n\t\t\tfor(int i=0;i<2;i++) {\r\n\t\t\t\tR[i]=Instruction[i+6];\r\n\t\t\t\tInformation=Information+Instruction[i+6];\r\n\t\t\t}\r\n\t\t\tInformation=Information+\" IX:\";\r\n\t\t\tfor(int i=0;i<2;i++) {\r\n\t\t\t\tIX[i]=Instruction[i+8];\r\n\t\t\t\tInformation=Information+Instruction[i+8];\r\n\t\t\t}\r\n\t\t\tInformation=Information+\" Address:\";\r\n\t\t\tfor(int i=0;i<5;i++) {\r\n\t\t\t\tAddress[i]=Instruction[i+11];\r\n\t\t\t\tInformation=Information+Instruction[i+11];\r\n\t\t\t}\r\n\t\t\tInformation=Information+\" Rx:\";\r\n\t\t\tfor(int i=0;i<2;i++) {\r\n\t\t\t\tRx[i]=Instruction[i+6];\r\n\t\t\t\tInformation=Information+Instruction[i+6];\r\n\t\t\t}\r\n\t\t\tInformation=Information+\" Ry:\";\r\n\t\t\tfor(int i=0;i<2;i++) {\r\n\t\t\t\tRy[i]=Instruction[i+8];\r\n\t\t\t\tInformation=Information+Instruction[i+8];\r\n\t\t\t}\r\n\t\t\tInformation=Information+\" AL:\";\r\n\t\t\tint decAL = Instruction[8];\r\n\t\t\tInformation=Information+Instruction[8];\r\n\t\t\tInformation=Information+\" LR:\";\r\n\t\t\tint decLR = Instruction[9];\r\n\t\t\tInformation=Information+Instruction[9];\r\n\t\t\tInformation=Information+\" Count:\";\r\n\t\t\tfor(int i=0;i<4;i++) {\r\n\t\t\t\tCount[i]=Instruction[i+12];\r\n\t\t\t\tInformation=Information+Instruction[i+12];\r\n\t\t\t}\r\n\t\t\tInformation=Information+\" DevId:\";\r\n\t\t\tfor(int i=0;i<5;i++) {\r\n\t\t\t\tDevId[i]=Instruction[i+11];\r\n\t\t\t\tInformation=Information+Instruction[i+11];\r\n\t\t\t}\r\n\t\t\tInformation=Information+\" DevId:\";\r\n\t\t\tI=Instruction[10];\r\n\t\t\tInformation=Information+Instruction[10];\r\n\t\t\t\r\n\t\t\tInformation=Information+\"\\n\";\r\n\t\t\t\r\n\t\t\t//Convert parsed values to easier to user INTEGER value (base 10)\r\n\t\t\tint decOpcode=Binary_to_dec(Opcode);\r\n\t\t\tvalue[0]=decOpcode;\r\n\t\t\tint decR=Binary_to_dec(R);\r\n\t\t\tvalue[1]=decR;\r\n\t\t\tint decIX=Binary_to_dec(IX);\r\n\t\t\tvalue[2]=decIX;\r\n\t\t\tint decAddress=Binary_to_dec(Address);\r\n\t\t\tvalue[3]=decAddress;\r\n\t\t\tint decRx=Binary_to_dec(Rx);\r\n\t\t\tvalue[4]=decRx;\r\n\t\t\tint decRy=Binary_to_dec(Ry);\r\n\t\t\tvalue[5]=decRy;\r\n\t\t\tint decCount=Binary_to_dec(Count);\r\n\t\t\tvalue[6]=decCount;\r\n\t\t\tint decDevId=Binary_to_dec(DevId);\r\n\t\t\tvalue[7]=decDevId;\r\n\t\t\tvalue[8]=I;\r\n\t\t\treturn value;\r\n\t\t}" ]
[ "0.5750628", "0.5666743", "0.54876655", "0.5126647", "0.50980264", "0.5082301", "0.5035888", "0.50358737", "0.49519736", "0.49361452", "0.49088386", "0.4903456", "0.4858342", "0.48358923", "0.48279396", "0.48261014", "0.48232424", "0.48206806", "0.47991073", "0.47911933", "0.47477576", "0.4742528", "0.4725134", "0.47192812", "0.4717088", "0.47108778", "0.47081956", "0.47052917", "0.47038254", "0.4695799", "0.4674607", "0.46526098", "0.46431112", "0.46427143", "0.46122143", "0.46087956", "0.46079907", "0.45985913", "0.458912", "0.45818433", "0.45785558", "0.45749915", "0.45746958", "0.4572158", "0.4565321", "0.45598912", "0.4555921", "0.455289", "0.45514968", "0.45513538", "0.4547204", "0.45431536", "0.45384997", "0.45379", "0.45346773", "0.453415", "0.4532642", "0.45319307", "0.4530551", "0.45290086", "0.4527564", "0.45237845", "0.45215505", "0.4520704", "0.45199987", "0.45124412", "0.45087108", "0.45040807", "0.45018923", "0.44988596", "0.4497532", "0.44969735", "0.44930616", "0.44858363", "0.44842345", "0.44725475", "0.4468582", "0.4466956", "0.44570592", "0.44529355", "0.4451291", "0.44478974", "0.44403484", "0.4437849", "0.44339293", "0.4433787", "0.44308814", "0.4429199", "0.44280732", "0.4427495", "0.44248927", "0.44239238", "0.4421794", "0.44212297", "0.44194886", "0.44177732", "0.44150895", "0.44112206", "0.44101328", "0.44099644" ]
0.5550075
2
// mission 10 //
public Point[] nearestPair() { Point[] Answer = new Point[2]; if (this.size<2) return null; //step 1 if (this.size==2){ Answer[0]=this.minx.getData(); Answer[1]=this.maxx.getData(); return Answer; } double MinDistance=-1; // for sure it will be change in the next section, just for avoid warrning. double MinDistanceInStrip=-1; Point[] MinPointsLeft = new Point[2]; Point[] MinPointsRight = new Point[2]; Point[] MinPointsInStrip = new Point[2]; // around the median boolean LargestAxis = getLargestAxis(); //step 2 Container median = getMedian(LargestAxis); //step 3 if (LargestAxis){// step 4 - calling the recursive function nearestPairRec MinPointsLeft = nearestPairRec(getPointsInRangeRegAxis(this.minx.getData().getX(), median.getData().getX(),LargestAxis), LargestAxis); MinPointsRight =nearestPairRec(getPointsInRangeRegAxis(median.getNextX().getData().getX(), this.maxx.getData().getX(),LargestAxis), LargestAxis); } else{ MinPointsLeft = nearestPairRec(getPointsInRangeRegAxis(this.miny.getData().getY(), median.getData().getY(),LargestAxis), LargestAxis); MinPointsRight =nearestPairRec(getPointsInRangeRegAxis(median.getNextY().getData().getY(), this.maxy.getData().getY(),LargestAxis), LargestAxis); } //step 5 if (MinPointsLeft!=null && MinPointsRight!=null){ if (Distance(MinPointsLeft[0], MinPointsLeft[1]) > Distance(MinPointsRight[0], MinPointsRight[1])){ MinDistance = Distance(MinPointsRight[0], MinPointsRight[1]); Answer = MinPointsRight; }else{ MinDistance = Distance(MinPointsLeft[0], MinPointsLeft[1]); Answer = MinPointsLeft; } } else if (MinPointsLeft!=null) { MinDistance = Distance(MinPointsLeft[0], MinPointsLeft[1]); Answer = MinPointsLeft; } else if (MinPointsRight!=null){ MinDistance = Distance(MinPointsRight[0], MinPointsRight[1]); Answer = MinPointsRight; } //step 6 - nearest point around the median if (MinDistance==-1) MinDistance=0; MinPointsInStrip = nearestPairInStrip(median, MinDistance*2, LargestAxis); if (MinPointsInStrip != null){ MinDistanceInStrip = Distance(MinPointsInStrip[0], MinPointsInStrip[1]); if (MinDistanceInStrip < MinDistance) return MinPointsInStrip; } return Answer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Mission createMission();", "void mo310e();", "void mo37810a();", "public void mo21877s() {\n }", "void mo41083a();", "public void mo21795T() {\n }", "void mo119581a();", "void mo17012c();", "public static void createMissions() {\n allMissions.addMission(airport, \"Find your boardingpass\");\n allMissions.addMission(airport, \"Picking up first item\");\n allMissions.addMission(beach, \"Pick up food\");\n allMissions.addMission(jungle, \"Find survivors\");\n allMissions.addMission(cave, \"Eat the shrooms\");\n allMissions.addMission(camp, \"Escape the island\");\n }", "public void mo21878t() {\n }", "private void kk12() {\n\n\t}", "void mo1507n();", "void mo21072c();", "public void mo21791P() {\n }", "void mo28306a();", "void mo41086b();", "void mo22249a();", "void mo10148a();", "public void mo12930a() {\n }", "void mo7350a();", "void mo2311a();", "boolean hasMission();", "public void mo21794S() {\n }", "private static void cajas() {\n\t\t\n\t}", "void mo21073d();", "void mo67924c();", "void mo17013d();", "void mo21076g();", "void mo12143a();", "void mo1637a();", "void mo60893b();", "void mo57278c();", "void mo17023d();", "void mo38026a();", "public void mo21793R() {\n }", "void mo21074e();", "void mo3311a();", "public void mo38117a() {\n }", "void mo1501h();", "public void mo3376r() {\n }", "void mo98969a();", "boolean getMission();", "public void mo21789N() {\n }", "public void mo4359a() {\n }", "public void mo21788M() {\n }", "void mo21070b();", "@Override\n\tpublic void challenge10() {\n\n\t}", "void mo17021c();", "public void onMissionStart() {\n\n }", "void mo60892a();", "public void mo5099c() {\n }", "void mo57277b();", "public void mo21782G() {\n }", "void mo72114c();", "void mo1940i();", "void mo9693a();", "void mo54405a();", "void legalCommand();", "public void mo21785J() {\n }", "void mo119582b();", "void mo5017a();", "public void mo21787L() {\n }", "void mo13368a();", "void mo57275a();", "void mo67920a();", "void mo88524c();", "public void mo21786K() {\n }", "int mo302a();", "public void mo6081a() {\n }", "void mo1493c();", "public void mo21792Q() {\n }", "void mo72113b();", "void mo12638c();", "int mo1503j();", "void mo84655a();", "public void mo44053a() {\n }", "public void mo21780E() {\n }", "void mo72111a();", "public void think_blocking()\r\n/* 37: */ {\r\n/* 38: 33 */ Scanner in = new Scanner(System.in);\r\n/* 39: */ Object localObject;\r\n/* 40:143 */ for (;; ((Iterator)localObject).hasNext())\r\n/* 41: */ {\r\n/* 42: 38 */ System.out.print(\"Next action ([move|land|attk] id; list; exit): \");\r\n/* 43: */ \r\n/* 44: 40 */ String[] cmd = in.nextLine().split(\" \");\r\n/* 45: */ \r\n/* 46: 42 */ System.out.print(\"Processing command... \");\r\n/* 47: 43 */ System.out.flush();\r\n/* 48: */ \r\n/* 49: 45 */ this.game.updateSimFrame();\r\n/* 50: */ \r\n/* 51: */ \r\n/* 52: */ \r\n/* 53: */ \r\n/* 54: */ \r\n/* 55: */ \r\n/* 56: 52 */ MapView<Integer, Base.BasicView> bases = this.game.getAllBases();\r\n/* 57: 53 */ MapView<Integer, Plane.FullView> planes = this.game.getMyPlanes();\r\n/* 58: 54 */ MapView<Integer, Plane.BasicView> ennemy_planes = this.game.getEnnemyPlanes();\r\n/* 59: */ \r\n/* 60: 56 */ List<Command> coms = new ArrayList();\r\n/* 61: */ try\r\n/* 62: */ {\r\n/* 63: 59 */ boolean recognized = true;\r\n/* 64: 60 */ switch ((localObject = cmd[0]).hashCode())\r\n/* 65: */ {\r\n/* 66: */ case 3004906: \r\n/* 67: 60 */ if (((String)localObject).equals(\"attk\")) {}\r\n/* 68: */ break;\r\n/* 69: */ case 3127582: \r\n/* 70: 60 */ if (((String)localObject).equals(\"exit\")) {\r\n/* 71: */ break label914;\r\n/* 72: */ }\r\n/* 73: */ break;\r\n/* 74: */ case 3314155: \r\n/* 75: 60 */ if (((String)localObject).equals(\"land\")) {\r\n/* 76: */ break;\r\n/* 77: */ }\r\n/* 78: */ break;\r\n/* 79: */ case 3322014: \r\n/* 80: 60 */ if (((String)localObject).equals(\"list\")) {}\r\n/* 81: */ case 3357649: \r\n/* 82: 60 */ if ((goto 793) && (((String)localObject).equals(\"move\")))\r\n/* 83: */ {\r\n/* 84: 64 */ if (cmd.length != 2) {\r\n/* 85: */ break label804;\r\n/* 86: */ }\r\n/* 87: 66 */ int id = Integer.parseInt(cmd[1]);\r\n/* 88: 67 */ Base.BasicView b = (Base.BasicView)bases.get(Integer.valueOf(id));\r\n/* 89: 68 */ Coord.View c = null;\r\n/* 90: 70 */ if (b == null)\r\n/* 91: */ {\r\n/* 92: 71 */ if (this.game.getCountry().id() != id)\r\n/* 93: */ {\r\n/* 94: 73 */ System.err.println(\"This id isn't corresponding neither to a base nor your country\");\r\n/* 95: */ break label804;\r\n/* 96: */ }\r\n/* 97: 77 */ c = this.game.getCountry().position();\r\n/* 98: */ }\r\n/* 99: */ else\r\n/* 100: */ {\r\n/* 101: 79 */ c = b.position();\r\n/* 102: */ }\r\n/* 103: 81 */ for (Plane.FullView p : planes.valuesView()) {\r\n/* 104: 82 */ coms.add(new MoveCommand(p, c));\r\n/* 105: */ }\r\n/* 106: */ break label804;\r\n/* 107: 87 */ int id = Integer.parseInt(cmd[1]);\r\n/* 108: 88 */ Base.BasicView b = (Base.BasicView)bases.get(Integer.valueOf(id));\r\n/* 109: 89 */ AbstractBase.View c = null;\r\n/* 110: 91 */ if (b == null)\r\n/* 111: */ {\r\n/* 112: 92 */ if (this.game.getCountry().id() != id)\r\n/* 113: */ {\r\n/* 114: 94 */ System.err.println(\"You can't see this base, move around it before you land\");\r\n/* 115: */ break label804;\r\n/* 116: */ }\r\n/* 117: 98 */ c = this.game.getCountry();\r\n/* 118: */ }\r\n/* 119: */ else\r\n/* 120: */ {\r\n/* 121:100 */ c = b;\r\n/* 122: */ }\r\n/* 123:102 */ for (Plane.FullView p : planes.valuesView()) {\r\n/* 124:103 */ coms.add(new LandCommand(p, c));\r\n/* 125: */ }\r\n/* 126: */ break label804;\r\n/* 127:108 */ Plane.BasicView ep = (Plane.BasicView)ennemy_planes.get(Integer.valueOf(Integer.parseInt(cmd[1])));\r\n/* 128:109 */ if (ep == null)\r\n/* 129: */ {\r\n/* 130:111 */ System.err.println(\"Bad id, this plane does not exists\");\r\n/* 131: */ }\r\n/* 132: */ else\r\n/* 133: */ {\r\n/* 134:114 */ for (Plane.FullView p : planes.valuesView()) {\r\n/* 135:115 */ coms.add(new AttackCommand(p, ep));\r\n/* 136: */ }\r\n/* 137: */ break label804;\r\n/* 138:118 */ System.out.println();\r\n/* 139:119 */ System.out.println(\">> My planes:\");\r\n/* 140:120 */ for (Plane.FullView p : planes.valuesView()) {\r\n/* 141:121 */ System.out.println(p);\r\n/* 142: */ }\r\n/* 143:122 */ System.out.println(\">> Ennemy planes:\");\r\n/* 144:123 */ for (Plane.BasicView p : ennemy_planes.valuesView()) {\r\n/* 145:124 */ System.out.println(p);\r\n/* 146: */ }\r\n/* 147:125 */ System.out.println(\">> Visible bases :\");\r\n/* 148:126 */ for (Base.FullView b : this.game.getVisibleBase().valuesView()) {\r\n/* 149:127 */ System.out.println(b);\r\n/* 150: */ }\r\n/* 151:128 */ System.out.println(\">> Your Country\");\r\n/* 152:129 */ System.out.println(this.game.getCountry());\r\n/* 153: */ }\r\n/* 154: */ }\r\n/* 155:130 */ break;\r\n/* 156: */ }\r\n/* 157:132 */ recognized = false;\r\n/* 158:133 */ System.err.println(\"Unrecognized command!\");\r\n/* 159: */ label804:\r\n/* 160:135 */ if (recognized) {\r\n/* 161:136 */ System.out.println(\"Processed\");\r\n/* 162: */ }\r\n/* 163: */ }\r\n/* 164: */ catch (IllegalArgumentException e)\r\n/* 165: */ {\r\n/* 166:139 */ System.out.println(\"Command failed: \" + e);\r\n/* 167:140 */ System.err.println(\"Command failed: \" + e);\r\n/* 168: */ }\r\n/* 169:143 */ localObject = coms.iterator(); continue;Command c = (Command)((Iterator)localObject).next();\r\n/* 170:144 */ this.game.sendCommand(c);\r\n/* 171: */ }\r\n/* 172: */ label914:\r\n/* 173:148 */ in.close();\r\n/* 174:149 */ this.game.quit(0);\r\n/* 175: */ }", "public void mo115188a() {\n }", "public void mo21880v() {\n }", "void mo4833b();", "void mo28194a();", "public abstract void mo2624j();", "public void mo21783H() {\n }", "void mo88521a();", "void mo80457c();", "public abstract int mo8526p();", "public void mo21825b() {\n }", "void mo1943l();", "public void mo55254a() {\n }", "void mo71b();", "public void mo23813b() {\n }", "void kiemTraThangHopLi() {\n }", "void mo105476a();", "public void commissionRunway(String id);", "public void travaille();", "void mo54435d();", "public void mo21779D() {\n }", "public void mo3370l() {\n }", "void pramitiTechTutorials() {\n\t\n}" ]
[ "0.6220456", "0.60012305", "0.59437615", "0.5940899", "0.5885935", "0.588389", "0.58160317", "0.57945824", "0.57730865", "0.57676786", "0.57596856", "0.57574105", "0.5748787", "0.57356036", "0.57189536", "0.5714192", "0.5710568", "0.5689444", "0.56810206", "0.5678759", "0.5669411", "0.5664563", "0.56639946", "0.56601113", "0.56567043", "0.5652998", "0.56411886", "0.56346613", "0.5633505", "0.56301343", "0.56255203", "0.562273", "0.5622109", "0.56214684", "0.5617393", "0.560513", "0.5604713", "0.5604164", "0.55983484", "0.559605", "0.55959755", "0.5593296", "0.5589292", "0.55887455", "0.55797017", "0.55794555", "0.5578541", "0.55765915", "0.55698776", "0.5563274", "0.5559947", "0.5552211", "0.55465114", "0.5526671", "0.55216277", "0.5521403", "0.5515189", "0.5514507", "0.5510321", "0.5498813", "0.54972446", "0.54957664", "0.5488139", "0.5487958", "0.54856724", "0.54802114", "0.54709625", "0.54702836", "0.5470058", "0.5465053", "0.5464524", "0.5464158", "0.5464097", "0.5462974", "0.5461295", "0.5457343", "0.5446243", "0.5438517", "0.54373515", "0.5436785", "0.5433633", "0.5428596", "0.54253393", "0.5419504", "0.54103345", "0.5410169", "0.54095775", "0.5409208", "0.54082173", "0.5404728", "0.5402901", "0.5401528", "0.538883", "0.53867257", "0.53857356", "0.53844833", "0.5381411", "0.53798354", "0.5374007", "0.5368359", "0.5368057" ]
0.0
-1
Aid Function Recursive //
private Point[] nearestPairRec(Point[] range, boolean axis) { Point[] Answer = new Point[2]; if (range.length < 4) return nearestPair3Points(range); Point[] MinPointsLeft = new Point[2]; Point[] MinPointsRight = new Point[2]; Point[] MinPointsInStrip = new Point[2]; double MinDistance = -1; //it will be change for sure, because we pass the array only if it containes 4 points and above. double MinDistanceInStrip; //step 4 if (axis){ MinPointsLeft = nearestPairRec(getPointsInRangeRegAxis(range[0].getX(), range[(range.length)/2].getX(), axis), axis); MinPointsRight =nearestPairRec(getPointsInRangeRegAxis(range[((range.length)/2)+1].getX(), range[range.length-1].getX() ,axis), axis); } else{ MinPointsLeft = nearestPairRec(getPointsInRangeRegAxis(range[0].getY(), range[(range.length)/2].getY(), axis), axis); MinPointsRight =nearestPairRec(getPointsInRangeRegAxis(range[((range.length)/2)+1].getY(), range[range.length-1].getY() ,axis), axis); } //step 5 if (MinPointsLeft!=null && MinPointsRight!=null){ if (Distance(MinPointsLeft[0], MinPointsLeft[1]) > Distance(MinPointsRight[0], MinPointsRight[1])){ MinDistance = Distance(MinPointsRight[0], MinPointsRight[1]); Answer = MinPointsRight; }else{ MinDistance = Distance(MinPointsLeft[0], MinPointsLeft[1]); Answer = MinPointsLeft; } }else if (MinPointsLeft!=null && MinPointsRight==null) { MinDistance = Distance(MinPointsLeft[0], MinPointsLeft[1]); Answer = MinPointsLeft; }else if (MinPointsRight!=null && MinPointsLeft==null){ MinDistance = Distance(MinPointsRight[0], MinPointsRight[1]); Answer = MinPointsRight; } //step 6 find the nearest point around the median int upper; int lower; if (MinDistance==-1) MinDistance = 0; if (axis){ upper = (int) (range[(range.length)/2].getX()+MinDistance); lower = (int) (range[(range.length)/2].getX()-MinDistance); } else{ upper = (int) (range[(range.length)/2].getY()+MinDistance); lower = (int) (range[(range.length)/2].getY()-MinDistance); } range = getPointsInRangeOppAxis(lower, upper, axis); if (range.length>=2) MinPointsInStrip = nearestPointInArray(range); if (MinPointsInStrip[0]!=null){ MinDistanceInStrip = Distance(MinPointsInStrip[0], MinPointsInStrip[1]); if (MinDistanceInStrip < MinDistance) return MinPointsInStrip; } return Answer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getAid();", "private int root(int i) {\n while(id[i]!=i){\n i = id[i];\n }\n return i;\n }", "void id(int id, id id, int id) {}", "private int root(int i) {\n while (i != id[i]) {\n i = id[i];\n }\n return i;\n }", "int getAId();", "public void inOrderTraverseRecursive();", "private int root(int i) {\n validate(i);\n while(i != id[i]) {\n i = id[i];\n }\n return i;\n }", "private int find(int[] roots , int id){\n\n if (roots[id] == id) return id;\n roots[id] = find(roots, roots[id]);\n return roots[id];\n }", "public static int rec(int[] arr, int amount, int id) {\n\t\tif(amount < 0|| id >= arr.length) {\n\t\t\treturn 0;\n\t\t}\n\t\tif(amount == 0 || id == arr.length -1) {\n\t\t\treturn 1;\n\t\t}\n\t\tint start = arr[id];\n\t\tint res=0;\n\t\tfor(int i = start;i < amount;i++) {\n\t\t\tres += rec(arr, amount - start, id+1);\n\t\t}\n\t\tSystem.out.println(res);\n\t\treturn res;\n\t}", "public int a(IBlockAccess paramard, BlockPosition paramdt, int paramInt)\r\n/* 34: */ {\r\n/* 35: 49 */ return art.a(paramard, paramdt);\r\n/* 36: */ }", "private static int nextID() {\r\n\t\treturn ID++;\r\n\t}", "protected abstract long getNextID(long ID);", "public abstract ID nextId();", "String getIdNode2();", "private int a(alq paramalq, int paramInt)\r\n/* 40: */ {\r\n/* 41: 61 */ for (int i = 0; i < this.a.length; i++) {\r\n/* 42: 62 */ if ((this.a[i] != null) && (this.a[i].b() == paramalq) && (this.a[i].i() == paramInt)) {\r\n/* 43: 63 */ return i;\r\n/* 44: */ }\r\n/* 45: */ }\r\n/* 46: 66 */ return -1;\r\n/* 47: */ }", "boolean isRecursive();", "static int recursiva1(int n)\n\t\t{\n\t\tif (n==0)\n\t\t\treturn 10; \n\t\tif (n==1)\n\t\t\treturn 20; \n\t\treturn recursiva1(n-1) - recursiva1 (n-2);\t\t\n\t\t}", "public abstract void alimentarse();", "public abstract void bepaalGrootte();", "public void inOrderTraverseIterative();", "static int APUtil(ArrayList<Arista>[] adj, int u, boolean visited[], int disc[], int low[], int parent[], int ap[]){\n\n // Count of children in DFS Tree\n int children = 0;\n\n // Mark the current node as visited\n visited[u] = true;\n\n // Initialize discovery time and low value\n disc[u] = low[u] = ++time;\n\n // Go through all vertices aadjacent to this\n for (Arista arista : adj[u]) {\n int v = arista.to; // v is current adjacent of u\n\n // If v is not visited yet, then make it a child of u\n // in DFS tree and recur for it\n if (!visited[v]) {\n children++;\n parent[v] = u;\n sol = APUtil(adj, v, visited, disc, low, parent, ap);\n\n // Check if the subtree rooted with v has a connection to\n // one of the ancestors of u\n low[u] = Math.min(low[u], low[v]);\n\n // u is an articulation point in following cases\n\n // (1) u is root of DFS tree and has two or more chilren.\n if (parent[u] == -1 && children > 1){\n ap[u]++;\n if((ap[u] > ap[sol]) || (ap[u] == ap[sol] && u < sol))\n sol = u;\n }\n\n\n // (2) If u is not root and low value of one of its child\n // is more than discovery value of u.\n if (parent[u] != -1 && low[v] >= disc[u]){\n ap[u]++;\n if((ap[u] > ap[sol]) || (ap[u] == ap[sol] && u < sol))\n sol = u;\n }\n\n }\n\n // Update low value of u for parent function calls.\n else if (v != parent[u])\n low[u] = Math.min(low[u], disc[v]);\n }\n\n return sol;\n }", "String getIdNode1();", "public void ids (String input, int limit)\r\n\t\t{\r\n\t\t\tNode root_ids= new Node (input);\r\n\t\t\tNode current = new Node(root_ids.getState());\r\n\t\t\t\r\n\t\t\tArrayList<String> visited = new ArrayList<String>();\r\n\t\t\tArrayList<String> children = new ArrayList<String>();\r\n\t\t\tStack<Node> stack_dfs = new Stack<Node>();\r\n\t\t\t\r\n\t\t\tint nodes_popped = 0;\r\n\t\t\tint stack_max_size = 0;\r\n\t\t\tint stack_max_total = 0;\r\n\t\t\tint depth = 0;\r\n\t\t\t\r\n\t\t\tcurrent.cost = 0;\r\n\t\t\tcurrent.depth = 0;\r\n\t\t\t\r\n\t\t\tgoal_ids = isGoal(current.getState());\r\n\t\t\t\r\n\t\t\twhile(depth <= limit)\r\n\t\t\t{\r\n\t\t\t\tif (goal_ids == true)\r\n\t\t\t\t{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Clear the visited array for backtracking purposes\r\n\t\t\t\tvisited.clear();\r\n\t\t\t\t\r\n\t\t\t\twhile(!goal_ids)\r\n\t\t\t\t{\r\n\t\t\t\t\tvisited.add(current.getState());\r\n\t\t\t\t\tchildren = Successor.findChildren(current.getState());\r\n\t\t\t\t\r\n\t\t\t\t\t// Depth limit check. This loop never runs if the node depth is greater then the limit\r\n\t\t\t\t\tif (current.getDepth() < limit)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tfor (String a : children)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (visited.contains(a))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tNode nino = new Node(a);\r\n\t\t\t\t\t\t\tcurrent.children_nodes.add(nino);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tint cost = isCost(current.getState(), nino.getState());\r\n\t\t\t\t\t\t\tnino.cost = cost;\r\n\t\t\t\t\t\t\tnino.parent = current;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// Repeated state check\r\n\t\t\t\t\t\t\tif (!stack_dfs.contains(nino))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tstack_dfs.add(nino);\r\n\t\t\t\t\t\t\t\tstack_max_size++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (current.getDepth() >= limit - 1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tint copy = stack_max_size;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (copy > stack_max_total)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tstack_max_total = copy;\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\tdepth++;\r\n\t\t\t\t\t\r\n\t\t\t\t\t// If there is no solution found at the depth limit, return no solution\r\n\t\t\t\t\tif (stack_dfs.empty() == true)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSolution.noSolution(limit);\t\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tcurrent = stack_dfs.pop();\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Set depth of node so it can be checked in next iteration\r\n\t\t\t\t\tcurrent.setDepth(current.parent.getDepth() + 1);\r\n\t\t\t\t\tnodes_popped++;\r\n\t\t\t\t\tstack_max_size--;\r\n\t\t\t\t\tgoal_ids = isGoal(current.getState());\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tgoal_ids = false;\r\n\t\t\tSystem.out.println(\"IDS Solved!!\");\r\n\t\t\t\r\n\t\t\tif (stack_max_total > stack_max_size)\r\n\t\t\t{\r\n\t\t\t\tstack_max_size = stack_max_total;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tSolution.performSolution(current, root_ids, nodes_popped, stack_max_size);\r\n\t\t}", "String getOuter_id();", "private static void drawNumDiamondRec(int h) {\n double hd = h;\r\n boolean odd = hd % 2 == 1;\r\n int middle = (int) Math.ceil(hd / 2);\r\n\r\n actual_recursion(h, middle, odd, 1, 0);\r\n\r\n }", "void atterir();", "protected int sumRecursive(int a, int b){\n if (b == 0){\n return a;\n } else {\n if (b > 0){\n return sumRecursive(a + 1, b - 1);\n } else {\n return sumRecursive(a - 1, b + 1);\n }\n }\n }", "void id(int id) {}", "public int a(alq paramalq, int paramInt1, int paramInt2, fn paramfn)\r\n/* 120: */ {\r\n/* 121:137 */ int i = 0;\r\n/* 122: */ amj localamj;\r\n/* 123: */ int k;\r\n/* 124:138 */ for (int j = 0; j < this.a.length; j++)\r\n/* 125: */ {\r\n/* 126:139 */ localamj = this.a[j];\r\n/* 127:140 */ if (localamj != null) {\r\n/* 128:143 */ if ((paramalq == null) || (localamj.b() == paramalq)) {\r\n/* 129:146 */ if ((paramInt1 <= -1) || (localamj.i() == paramInt1)) {\r\n/* 130:149 */ if ((paramfn == null) || (cy.a(paramfn, localamj.o(), true)))\r\n/* 131: */ {\r\n/* 132:153 */ k = paramInt2 <= 0 ? localamj.b : Math.min(paramInt2 - i, localamj.b);\r\n/* 133:154 */ i += k;\r\n/* 134:155 */ if (paramInt2 != 0)\r\n/* 135: */ {\r\n/* 136:156 */ this.a[j].b -= k;\r\n/* 137:157 */ if (this.a[j].b == 0) {\r\n/* 138:158 */ this.a[j] = null;\r\n/* 139: */ }\r\n/* 140:160 */ if ((paramInt2 > 0) && (i >= paramInt2)) {\r\n/* 141:161 */ return i;\r\n/* 142: */ }\r\n/* 143: */ }\r\n/* 144: */ }\r\n/* 145: */ }\r\n/* 146: */ }\r\n/* 147: */ }\r\n/* 148: */ }\r\n/* 149:165 */ for (j = 0; j < this.b.length; j++)\r\n/* 150: */ {\r\n/* 151:166 */ localamj = this.b[j];\r\n/* 152:167 */ if (localamj != null) {\r\n/* 153:170 */ if ((paramalq == null) || (localamj.b() == paramalq)) {\r\n/* 154:173 */ if ((paramInt1 <= -1) || (localamj.i() == paramInt1)) {\r\n/* 155:176 */ if ((paramfn == null) || (cy.a(paramfn, localamj.o(), false)))\r\n/* 156: */ {\r\n/* 157:180 */ k = paramInt2 <= 0 ? localamj.b : Math.min(paramInt2 - i, localamj.b);\r\n/* 158:181 */ i += k;\r\n/* 159:182 */ if (paramInt2 != 0)\r\n/* 160: */ {\r\n/* 161:183 */ this.b[j].b -= k;\r\n/* 162:184 */ if (this.b[j].b == 0) {\r\n/* 163:185 */ this.b[j] = null;\r\n/* 164: */ }\r\n/* 165:187 */ if ((paramInt2 > 0) && (i >= paramInt2)) {\r\n/* 166:188 */ return i;\r\n/* 167: */ }\r\n/* 168: */ }\r\n/* 169: */ }\r\n/* 170: */ }\r\n/* 171: */ }\r\n/* 172: */ }\r\n/* 173: */ }\r\n/* 174:193 */ if (this.f != null)\r\n/* 175: */ {\r\n/* 176:194 */ if ((paramalq != null) && (this.f.b() != paramalq)) {\r\n/* 177:195 */ return i;\r\n/* 178: */ }\r\n/* 179:197 */ if ((paramInt1 > -1) && (this.f.i() != paramInt1)) {\r\n/* 180:198 */ return i;\r\n/* 181: */ }\r\n/* 182:200 */ if ((paramfn != null) && (!cy.a(paramfn, this.f.o(), false))) {\r\n/* 183:201 */ return i;\r\n/* 184: */ }\r\n/* 185:204 */ j = paramInt2 <= 0 ? this.f.b : Math.min(paramInt2 - i, this.f.b);\r\n/* 186:205 */ i += j;\r\n/* 187:206 */ if (paramInt2 != 0)\r\n/* 188: */ {\r\n/* 189:207 */ this.f.b -= j;\r\n/* 190:208 */ if (this.f.b == 0) {\r\n/* 191:209 */ this.f = null;\r\n/* 192: */ }\r\n/* 193:211 */ if ((paramInt2 > 0) && (i >= paramInt2)) {\r\n/* 194:212 */ return i;\r\n/* 195: */ }\r\n/* 196: */ }\r\n/* 197: */ }\r\n/* 198:217 */ return i;\r\n/* 199: */ }", "int expand();", "public int a(int r12, androidx.recyclerview.widget.RecyclerView.u r13) {\n /*\n r11 = this;\n e.m.a.g r0 = r11.A\n int r0 = r0.a()\n r1 = 0\n if (r0 != 0) goto L_0x000a\n return r1\n L_0x000a:\n e.m.a.b r0 = e.m.a.b.c(r12)\n int r2 = r11.f8992j\n r3 = 1\n if (r2 == 0) goto L_0x0019\n int r2 = java.lang.Math.abs(r2)\n goto L_0x0088\n L_0x0019:\n int r2 = r11.f8991i\n int r2 = r0.a(r2)\n if (r2 <= 0) goto L_0x0023\n r2 = r3\n goto L_0x0024\n L_0x0023:\n r2 = r1\n L_0x0024:\n e.m.a.b r4 = e.m.a.b.START\n if (r0 != r4) goto L_0x003d\n int r4 = r11.k\n if (r4 != 0) goto L_0x003d\n int r2 = r11.f8991i\n if (r2 != 0) goto L_0x0032\n r2 = r3\n goto L_0x0033\n L_0x0032:\n r2 = r1\n L_0x0033:\n if (r2 == 0) goto L_0x0036\n goto L_0x0055\n L_0x0036:\n int r4 = r11.f8991i\n int r4 = java.lang.Math.abs(r4)\n goto L_0x0075\n L_0x003d:\n e.m.a.b r4 = e.m.a.b.END\n if (r0 != r4) goto L_0x005e\n int r4 = r11.k\n e.m.a.g r5 = r11.A\n int r5 = r5.c()\n int r5 = r5 - r3\n if (r4 != r5) goto L_0x005e\n int r2 = r11.f8991i\n if (r2 != 0) goto L_0x0052\n r2 = r3\n goto L_0x0053\n L_0x0052:\n r2 = r1\n L_0x0053:\n if (r2 == 0) goto L_0x0057\n L_0x0055:\n r4 = r1\n goto L_0x0075\n L_0x0057:\n int r4 = r11.f8991i\n int r4 = java.lang.Math.abs(r4)\n goto L_0x0075\n L_0x005e:\n if (r2 == 0) goto L_0x006a\n int r2 = r11.f8989g\n int r4 = r11.f8991i\n int r4 = java.lang.Math.abs(r4)\n int r2 = r2 - r4\n goto L_0x0073\n L_0x006a:\n int r2 = r11.f8989g\n int r4 = r11.f8991i\n int r4 = java.lang.Math.abs(r4)\n int r2 = r2 + r4\n L_0x0073:\n r4 = r2\n r2 = r1\n L_0x0075:\n e.m.a.c$c r5 = r11.y\n com.yarolegovich.discretescrollview.DiscreteScrollView$d r5 = (com.yarolegovich.discretescrollview.DiscreteScrollView.d) r5\n com.yarolegovich.discretescrollview.DiscreteScrollView r5 = com.yarolegovich.discretescrollview.DiscreteScrollView.this\n boolean r6 = r5.f3982d\n if (r6 == 0) goto L_0x0087\n if (r2 == 0) goto L_0x0083\n r2 = r1\n goto L_0x0084\n L_0x0083:\n r2 = 2\n L_0x0084:\n r5.setOverScrollMode(r2)\n L_0x0087:\n r2 = r4\n L_0x0088:\n if (r2 > 0) goto L_0x008b\n return r1\n L_0x008b:\n int r12 = java.lang.Math.abs(r12)\n int r12 = java.lang.Math.min(r2, r12)\n int r12 = r0.a(r12)\n int r0 = r11.f8991i\n int r0 = r0 + r12\n r11.f8991i = r0\n int r0 = r11.f8992j\n if (r0 == 0) goto L_0x00a3\n int r0 = r0 - r12\n r11.f8992j = r0\n L_0x00a3:\n e.m.a.a$c r0 = r11.n\n int r1 = -r12\n e.m.a.g r2 = r11.A\n r0.a(r1, r2)\n e.m.a.a$c r0 = r11.n\n boolean r0 = r0.a(r11)\n if (r0 == 0) goto L_0x00b6\n r11.a(r13)\n L_0x00b6:\n int r13 = r11.l\n r0 = -1\n if (r13 == r0) goto L_0x00c5\n int r13 = r11.f8991i\n int r1 = r11.f8992j\n int r13 = r13 + r1\n int r13 = java.lang.Math.abs(r13)\n goto L_0x00c7\n L_0x00c5:\n int r13 = r11.f8989g\n L_0x00c7:\n float r13 = (float) r13\n r1 = -1082130432(0xffffffffbf800000, float:-1.0)\n int r2 = r11.f8991i\n float r2 = (float) r2\n float r2 = r2 / r13\n float r13 = java.lang.Math.max(r1, r2)\n r1 = 1065353216(0x3f800000, float:1.0)\n float r13 = java.lang.Math.min(r13, r1)\n float r13 = -r13\n e.m.a.c$c r1 = r11.y\n com.yarolegovich.discretescrollview.DiscreteScrollView$d r1 = (com.yarolegovich.discretescrollview.DiscreteScrollView.d) r1\n com.yarolegovich.discretescrollview.DiscreteScrollView r2 = com.yarolegovich.discretescrollview.DiscreteScrollView.this\n java.util.List<com.yarolegovich.discretescrollview.DiscreteScrollView$c> r2 = r2.f3980b\n boolean r2 = r2.isEmpty()\n if (r2 == 0) goto L_0x00e8\n goto L_0x0133\n L_0x00e8:\n com.yarolegovich.discretescrollview.DiscreteScrollView r2 = com.yarolegovich.discretescrollview.DiscreteScrollView.this\n int r2 = r2.getCurrentItem()\n com.yarolegovich.discretescrollview.DiscreteScrollView r4 = com.yarolegovich.discretescrollview.DiscreteScrollView.this\n e.m.a.c r4 = r4.f3979a\n int r5 = r4.f8991i\n if (r5 != 0) goto L_0x00f9\n int r0 = r4.k\n goto L_0x010a\n L_0x00f9:\n int r6 = r4.l\n if (r6 == r0) goto L_0x00ff\n r0 = r6\n goto L_0x010a\n L_0x00ff:\n int r0 = r4.k\n e.m.a.b r4 = e.m.a.b.c(r5)\n int r3 = r4.a(r3)\n int r0 = r0 + r3\n L_0x010a:\n if (r2 == r0) goto L_0x0133\n com.yarolegovich.discretescrollview.DiscreteScrollView r3 = com.yarolegovich.discretescrollview.DiscreteScrollView.this\n androidx.recyclerview.widget.RecyclerView$d0 r10 = r3.a(r2)\n com.yarolegovich.discretescrollview.DiscreteScrollView r1 = com.yarolegovich.discretescrollview.DiscreteScrollView.this\n androidx.recyclerview.widget.RecyclerView$d0 r1 = r1.a(r0)\n java.util.List<com.yarolegovich.discretescrollview.DiscreteScrollView$c> r3 = r3.f3980b\n java.util.Iterator r3 = r3.iterator()\n L_0x011e:\n boolean r4 = r3.hasNext()\n if (r4 == 0) goto L_0x0133\n java.lang.Object r4 = r3.next()\n com.yarolegovich.discretescrollview.DiscreteScrollView$c r4 = (com.yarolegovich.discretescrollview.DiscreteScrollView.c) r4\n r5 = r13\n r6 = r2\n r7 = r0\n r8 = r10\n r9 = r1\n r4.a(r5, r6, r7, r8, r9)\n goto L_0x011e\n L_0x0133:\n r11.a()\n return r12\n */\n throw new UnsupportedOperationException(\"Method not decompiled: e.m.a.c.a(int, androidx.recyclerview.widget.RecyclerView$u):int\");\n }", "int nextId();", "private int rightChild(int i){return 2*i+2;}", "public int antall();", "private void calcNextAuthPath(){\n int treeIndex = 1;\r\n SparseFractalSubTree nodeTree = subTrees[0];\r\n long nodeIndex;\r\n //calc tau (first level on which auth path changes from right to left node) (or first bit in index where a 0 changes to a 1 on a +1)\r\n int tau = 0;\r\n for (nodeIndex = leaveIndex;(nodeIndex & 1) == 0; nodeIndex >>>= 1){\r\n if(tau++ >= nodeTree.getMaxLevel()) nodeTree = subTrees[treeIndex++]; //track the subtree in which tau is in\r\n }\r\n assert (nodeIndex == leaveIndex >>> tau);\r\n\r\n calcLeftNodes(tau, nodeIndex, nodeTree); //calc the new left auth nodes\r\n measureDynamicSpace(); //measure\r\n releaseRight(tau, treeIndex, nodeIndex, nodeTree); //release no longer needed right nodes\r\n measureDynamicSpace(); //measure\r\n calcRightNodes(tau); //calc the new right auth nodes\r\n\r\n }", "void nest();", "static void idlize() throws IOException {\r\n\t\t/**give mid who has name a id, for other mid, keep using mid to identify them*/\r\n\t\t//\t\tHashMap<String, Integer> namedmid2name = new HashMap<String, Integer>(20000000);\r\n\t\t//\t\tHashMap<String, Integer> relationname2id = new HashMap<String, Integer>(1000000);\r\n\t\t//\t\tDelimitedWriter dw = new DelimitedWriter(Main.dir + \"/visible_idize\");\r\n\t\t//\t\tDelimitedWriter dw_debug = new DelimitedWriter(Main.dir + \"/visible_debug\");\r\n\t\t//\t\t{\r\n\t\t//\t\t\tDelimitedReader dr = new DelimitedReader(Main.file_fbenglishname);\r\n\t\t//\t\t\tString[] l;\r\n\t\t//\t\t\twhile ((l = dr.read()) != null) {\r\n\t\t//\t\t\t\tnamedmid2name.put(l[0], namedmid2name.size());\r\n\t\t//\t\t\t}\r\n\t\t//\t\t\tD.p(\"load mid2name finished\");\r\n\t\t//\t\t\tdr.close();\r\n\t\t//\t\t}\r\n\t\t//\t\t{\r\n\t\t//\t\t\tDelimitedReader dr = new DelimitedReader(Main.file_visible_str);\r\n\t\t//\t\t\tString[] l;\r\n\t\t//\t\t\twhile ((l = dr.read()) != null) {\r\n\t\t//\t\t\t\tString mid = l[0];\r\n\t\t//\t\t\t\tInteger gid = namedmid2name.get(mid);\r\n\t\t//\t\t\t\tif (gid == null) {\r\n\t\t//\t\t\t\t\tdw_debug.write(l);\r\n\t\t//\t\t\t\t\tcontinue;\r\n\t\t//\t\t\t\t}\r\n\t\t//\t\t\t\tString relationname = l[2];\r\n\t\t//\t\t\t\tif (!relationname2id.containsKey(relationname)) {\r\n\t\t//\t\t\t\t\trelationname2id.put(relationname, relationname2id.size());\r\n\t\t//\t\t\t\t}\r\n\t\t//\t\t\t\tint relid = relationname2id.get(relationname);\r\n\t\t//\t\t\t\tdw.write(l[1], gid, relid, l[3]);\r\n\t\t//\t\t\t}\r\n\t\t//\t\t\tdr.close();\r\n\t\t//\t\t}\r\n\t\t//\t\t{\r\n\t\t//\t\t\tDelimitedReader dr = new DelimitedReader(Main.file_visible_str);\r\n\t\t//\t\t\tString[] l;\r\n\t\t//\t\t\twhile ((l = dr.read()) != null) {\r\n\t\t//\t\t\t\tString mid1 = l[0];\r\n\t\t//\t\t\t\tString mid2 = l[3];\r\n\t\t//\t\t\t\tInteger gid1 = namedmid2name.get(mid1);\r\n\t\t//\t\t\t\tInteger gid2 = namedmid2name.get(mid2);\r\n\t\t//\t\t\t\tif (gid1 == null || gid2 == null) {\r\n\t\t//\t\t\t\t\tdw_debug.write(l);\r\n\t\t//\t\t\t\t\tcontinue;\r\n\t\t//\t\t\t\t}\r\n\t\t//\t\t\t\tString relationname = l[2];\r\n\t\t//\t\t\t\tif (!relationname2id.containsKey(relationname)) {\r\n\t\t//\t\t\t\t\trelationname2id.put(relationname, relationname2id.size());\r\n\t\t//\t\t\t\t}\r\n\t\t//\t\t\t\tint relid = relationname2id.get(relationname);\r\n\t\t//\t\t\t\tdw.write(l[1], gid1, relid, gid2, l[3]);\r\n\t\t//\t\t\t}\r\n\t\t//\t\t\tdr.close();\r\n\t\t//\t\t}\r\n\t\t//\t\tdw.close();\r\n\t\t//\t\t{\r\n\t\t//\t\t\tDelimitedWriter dwrel = new DelimitedWriter(Main.dir + \"/visible_relations.temp\");\r\n\t\t//\t\t\tfor (Entry<String, Integer> e : relationname2id.entrySet()) {\r\n\t\t//\t\t\t\tdwrel.write(e.getValue(), e.getKey());\r\n\t\t//\t\t\t}\r\n\t\t//\t\t\tdwrel.close();\r\n\t\t//\t\t\tSort.sort(Main.dir + \"/visible_relations.temp\", Main.dir + \"/visible_relations\", Main.dir,\r\n\t\t//\t\t\t\t\tnew Comparator<String[]>() {\r\n\t\t//\t\t\t\t\t\t@Override\r\n\t\t//\t\t\t\t\t\tpublic int compare(String[] o1, String[] o2) {\r\n\t\t//\t\t\t\t\t\t\t// TODO Auto-generated method stub\r\n\t\t//\t\t\t\t\t\t\treturn Integer.parseInt(o1[0]) - Integer.parseInt(o2[0]);\r\n\t\t//\t\t\t\t\t\t}\r\n\t\t//\r\n\t\t//\t\t\t\t\t});\r\n\t\t//\t\t}\r\n\t\t//\t\t{\r\n\t\t//\t\t\tDelimitedWriter dwmid = new DelimitedWriter(Main.dir + \"/visible_mid2gid.temp\");\r\n\t\t//\t\t\tfor (Entry<String, Integer> e : namedmid2name.entrySet()) {\r\n\t\t//\t\t\t\tdwmid.write(e.getValue(), e.getKey());\r\n\t\t//\t\t\t}\r\n\t\t//\t\t\tdwmid.close();\r\n\t\t//\t\t\tSort.sort(Main.dir + \"/visible_mid2gid.temp\", Main.dir + \"/visible_mid2gid\", Main.dir,\r\n\t\t//\t\t\t\t\tnew Comparator<String[]>() {\r\n\t\t//\t\t\t\t\t\t@Override\r\n\t\t//\t\t\t\t\t\tpublic int compare(String[] o1, String[] o2) {\r\n\t\t//\t\t\t\t\t\t\t// TODO Auto-generated method stub\r\n\t\t//\t\t\t\t\t\t\treturn Integer.parseInt(o1[0]) - Integer.parseInt(o2[0]);\r\n\t\t//\t\t\t\t\t\t}\r\n\t\t//\r\n\t\t//\t\t\t\t\t});\r\n\t\t//\t\t}\r\n\t}", "private void a() {\n if (this.a == null && this.c == null) {\n return;\n }\n xh xh2 = (xh)this.g.get();\n if (!this.i && this.a != null && xh2 != null) {\n xh2.a(this);\n this.i = true;\n }\n if (this.f != null) {\n this.b(this.f);\n return;\n }\n if (this.d == null) return;\n this.d.a(this);\n }", "private boolean itsRepeated(BTreeNode<T> currentNode, I id) {\n\n for (int i = 0; i < 5; i++) {\n if (currentNode.getKey(i) != null) {\n if (comparator.compare(currentNode.getKey(i), id) == 0) {\n return true;\n }\n }\n }\n\n return false;\n }", "public void dfs(int root, int at, int parent) {\n if (parent == root) rootNodeOutComingEdgeCount ++;//base case\r\n visited[at] = true;\r\n lowLinkValues[at] = ids[at] = id ++;//assign a new id at each recursion\r\n List<Integer> edges = graph.get(at);//wills store all neighbors of current node\r\n for (Integer neighbor : edges) {//for each neighbor current node has\r\n if (neighbor == parent) continue;//base case\r\n if (!visited[neighbor]) {//if it is not visited\r\n dfs(root, neighbor, at);//recurse and explore its neighbors\r\n lowLinkValues[at] = Math.min(lowLinkValues[at], lowLinkValues[neighbor]);//update lowLInkValue\r\n if (ids[at] <= lowLinkValues[neighbor]) {//if id of current node < lowLInk of neighbor\r\n isArticulationPoint[at] = true;//it is an AP\r\n }\r\n else {//if lowLinkValue is greater than id number\r\n lowLinkValues[at] = Math.min(lowLinkValues[at], ids[neighbor]);//update and minimize lowLinkValue\r\n }\r\n }\r\n }\r\n }", "private int parent(int i){return (i-1)/2;}", "private int leftChild(int i){return 2*i+1;}", "protected int find(int id) \n\t{\n\t //Check the current pair is the root of the tree\n if (parents[id] == id)\n {\n //Return the id of the current pair as if it is its own parent\n return id;\n }\n \n //Set the parent of the current pair to the parent of its parent\n int res = find(parents[id]);\n parents[id] = res;\n \n //Return the root of the tree\n\t\treturn res;\n\t}", "public void caseAIdBasic(AIdBasic node)\n {\n String id = node.getId().getText();\n\n ARegExp resolved = helpers.get(id);\n if (resolved == null)\n throw new RuntimeException(\"Unknown helper '\" + id + \"'\");\n\n resolved.apply(this);\n }", "public static void print_recursion(int a){\r\n if(a<2){\r\n array.add(a);\r\n for(int i=1;i<=array.size();i++){\r\n System.out.print(array.get(array.size()-i));\r\n }\r\n System.out.println(\"\");\r\n }\r\n else{\r\n array.add(a%2);\r\n print_recursion(a/2);\r\n }\r\n }", "id(int id, id id, int id) {}", "private int d(amj paramamj)\r\n/* 50: */ {\r\n/* 51: 70 */ for (int i = 0; i < this.a.length; i++) {\r\n/* 52: 71 */ if ((this.a[i] != null) && (this.a[i].b() == paramamj.b()) && (this.a[i].d()) && (this.a[i].b < this.a[i].c()) && (this.a[i].b < p_()) && ((!this.a[i].f()) || (this.a[i].i() == paramamj.i())) && (amj.a(this.a[i], paramamj))) {\r\n/* 53: 72 */ return i;\r\n/* 54: */ }\r\n/* 55: */ }\r\n/* 56: 75 */ return -1;\r\n/* 57: */ }", "@Override\n public Iterable<Id> depthIdIterable() {\n return idDag.depthIdIterable();\n }", "private static void iddfs(State curr, int depth) {\n for(int i = 0; i <= depth; i++) {\r\n\r\n if(curr.isGoalState()) \r\n System.out.println(i+\":\"+curr.getOrderedPair()+\" Goal\");//initial is goal state\r\n else\r\n System.out.println(i+\":\"+curr.getOrderedPair());//initial\r\n\r\n curr.close.add(curr);\r\n State currState = curr;\r\n while(!currState.isGoalState()) {\r\n if(currState.depth < i)\r\n curr.buildStack(currState.getSuccessors(currState));\r\n System.out.print(i+\":\");\r\n curr.printHelp(currState, 5);\r\n if(!curr.open.isEmpty()) {\r\n currState = curr.open.get(curr.open.size()-1);\r\n curr.close.add(curr.open.remove(curr.open.size()-1));\r\n } else {\r\n break;\r\n }\r\n }\r\n\r\n if(currState.isGoalState()) {\r\n System.out.println(i+\":\"+currState.getOrderedPair() + \" Goal\");\r\n curr.printPath(currState);\r\n return;\r\n }\r\n curr.open.clear(); curr.close.clear();\r\n }\r\n }", "public int a(String paramString)\r\n/* 454: */ {\r\n/* 455:451 */ if (paramString == null) {\r\n/* 456:452 */ return 0;\r\n/* 457: */ }\r\n/* 458:454 */ int i1 = 0;\r\n/* 459:455 */ int i2 = 0;\r\n/* 460:457 */ for (int i3 = 0; i3 < paramString.length(); i3++)\r\n/* 461: */ {\r\n/* 462:458 */ char c1 = paramString.charAt(i3);\r\n/* 463: */ \r\n/* 464:460 */ int i4 = a(c1);\r\n/* 465:461 */ if ((i4 < 0) && (i3 < paramString.length() - 1))\r\n/* 466: */ {\r\n/* 467:462 */ c1 = paramString.charAt(++i3);\r\n/* 468:464 */ if ((c1 == 'l') || (c1 == 'L')) {\r\n/* 469:465 */ i2 = 1;\r\n/* 470:466 */ } else if ((c1 == 'r') || (c1 == 'R')) {\r\n/* 471:467 */ i2 = 0;\r\n/* 472: */ }\r\n/* 473:469 */ i4 = 0;\r\n/* 474: */ }\r\n/* 475:471 */ i1 += i4;\r\n/* 476:472 */ if ((i2 != 0) && (i4 > 0)) {\r\n/* 477:473 */ i1++;\r\n/* 478: */ }\r\n/* 479: */ }\r\n/* 480:477 */ return i1;\r\n/* 481: */ }", "public void inorder()\n {\n inorderRec(root);\n }", "public void setAid(Integer aid) {\n this.aid = aid;\n }", "private int e(amj paramamj)\r\n/* 202: */ {\r\n/* 203:221 */ alq localalq = paramamj.b();\r\n/* 204:222 */ int i = paramamj.b;\r\n/* 205: */ \r\n/* 206:224 */ int j = d(paramamj);\r\n/* 207:225 */ if (j < 0) {\r\n/* 208:226 */ j = j();\r\n/* 209: */ }\r\n/* 210:228 */ if (j < 0) {\r\n/* 211:229 */ return i;\r\n/* 212: */ }\r\n/* 213:231 */ if (this.a[j] == null)\r\n/* 214: */ {\r\n/* 215:232 */ this.a[j] = new amj(localalq, 0, paramamj.i());\r\n/* 216:233 */ if (paramamj.n()) {\r\n/* 217:234 */ this.a[j].d((fn)paramamj.o().b());\r\n/* 218: */ }\r\n/* 219: */ }\r\n/* 220:238 */ int k = i;\r\n/* 221:239 */ if (k > this.a[j].c() - this.a[j].b) {\r\n/* 222:240 */ k = this.a[j].c() - this.a[j].b;\r\n/* 223: */ }\r\n/* 224:242 */ if (k > p_() - this.a[j].b) {\r\n/* 225:243 */ k = p_() - this.a[j].b;\r\n/* 226: */ }\r\n/* 227:246 */ if (k == 0) {\r\n/* 228:247 */ return i;\r\n/* 229: */ }\r\n/* 230:250 */ i -= k;\r\n/* 231:251 */ this.a[j].b += k;\r\n/* 232:252 */ this.a[j].c = 5;\r\n/* 233: */ \r\n/* 234:254 */ return i;\r\n/* 235: */ }", "public String a(String paramString, int paramInt)\r\n/* 512: */ {\r\n/* 513:512 */ return a(paramString, paramInt, false);\r\n/* 514: */ }", "void addId(String root);", "void id() {}", "int id();", "private int a(String paramString, int paramInt1, int paramInt2, int paramInt3, int paramInt4, boolean paramBoolean)\r\n/* 416: */ {\r\n/* 417:413 */ if (this.l)\r\n/* 418: */ {\r\n/* 419:414 */ int i1 = a(c(paramString));\r\n/* 420:415 */ paramInt1 = paramInt1 + paramInt3 - i1;\r\n/* 421: */ }\r\n/* 422:417 */ return b(paramString, paramInt1, paramInt2, paramInt4, paramBoolean);\r\n/* 423: */ }", "public abstract void cambiarA(int i);", "public ArrayList<Integer> recursafisare(Nod n) {\n\n\t\tArrayList<Integer> total = new ArrayList<Integer>();\n\t\treturn afisare(n, total);\n\n\t}", "private static int recursion(int x) {\n\t\tif(x == 1) return 0;\n\n\t\tif(dp[x] != -1) return dp[x];\n\t\tint result = Integer.MAX_VALUE;\n\n\t\tif(x % 3 == 0) result = Math.min(recursion(x / 3), result);\n\t\tif(x % 2 == 0) result = Math.min(recursion(x >> 1), result);\n\t\tif(x >= 1) result = Math.min(recursion(x - 1), result);\n\n\t\treturn dp[x] = result + 1;\n\t}", "public boolean a(ahb paramahb, Random paramRandom, asv paramasv)\n/* */ {\n/* 684 */ if (a(paramahb, paramasv)) {\n/* 685 */ return false;\n/* */ }\n/* */ \n/* */ \n/* 689 */ a(paramahb, paramasv, 0, 5, 0, 2, 7, 1, ajn.a, ajn.a, false);\n/* */ \n/* 691 */ a(paramahb, paramasv, 0, 0, 7, 2, 2, 8, ajn.a, ajn.a, false);\n/* */ \n/* 693 */ for (int i = 0; i < 5; i++) {\n/* 694 */ a(paramahb, paramasv, 0, 5 - i - (i < 4 ? 1 : 0), 2 + i, 2, 7 - i, 2 + i, ajn.a, ajn.a, false);\n/* */ }\n/* */ \n/* 697 */ return true;\n/* */ }", "public int find(int a) {\n if (father[a] == a) {\n return a;\n }\n return father[a] = find(father[a]); // path compression for O(1)\n }", "long buscarAnterior(long id);", "void calculating(int depth);", "public static long nextIdAlergia() {\r\n long ret = 0;\r\n for (int i = 0; i < Utilidades.ALERGIAS.length; i++) {\r\n if (Utilidades.ALERGIAS[i].id > ret);\r\n ret = Utilidades.ALERGIAS[i].id;\r\n }\r\n return ret + 1;\r\n }", "void mo1639a(ayl ayl);", "private void enumterateAnagramsUnderEHelper(String whatsLeft,\n\t\t\tString parent, Set<String> returnSet,\n\t\t\tTreeNode dictPointer, TreeNode myParent) {\n\t\tif (whatsLeft.length() == 0 && dictPointer.getIsWord()) {\n\t\t\treturnSet.add(parent);\n\t\t} else {\n\t\t\tHashSet<Character> iveTriedSoFar = new HashSet<Character>();\n\t\t\tfor (int i = 0; i < whatsLeft.length(); i++) {\n\t\t\t\t// Make move\n\t\t\t\t// For each chracter left in whats left, remove that character\n\t\t\t\t// from whats left, and append it to the end of parent\n\t\t\t\tString moveMadeWhatsLeft = whatsLeft;\n\t\t\t\tif (i == 0) {\n\t\t\t\t\tmoveMadeWhatsLeft = moveMadeWhatsLeft.substring(1,\n\t\t\t\t\t\t\tmoveMadeWhatsLeft.length());\n\t\t\t\t} else if (i == moveMadeWhatsLeft.length() - 1) {\n\t\t\t\t\tmoveMadeWhatsLeft = moveMadeWhatsLeft.substring(0,\n\t\t\t\t\t\t\tmoveMadeWhatsLeft.length() - 1);\n\t\t\t\t} else {\n\t\t\t\t\tmoveMadeWhatsLeft = moveMadeWhatsLeft.substring(0, i)\n\t\t\t\t\t\t\t+ moveMadeWhatsLeft.substring(i + 1,\n\t\t\t\t\t\t\t\t\tmoveMadeWhatsLeft.length());\n\t\t\t\t}\n\t\t\t\tString moveMadeParent = parent + whatsLeft.charAt(i);\n\n\t\t\t\t// call recursive\n\t\t\t\tif (dictPointer.getChildContaining(whatsLeft.charAt(i)) != null\n\t\t\t\t\t\t&& !iveTriedSoFar.contains(whatsLeft.charAt(i))) {\n\t\t\t\t\tiveTriedSoFar.add(whatsLeft.charAt(i));\n\t\t\t\t\tenumterateAnagramsUnderEHelper(\n\t\t\t\t\t\t\tmoveMadeWhatsLeft,\n\t\t\t\t\t\t\tmoveMadeParent,\n\t\t\t\t\t\t\treturnSet,\n\t\t\t\t\t\t\tdictPointer.getChildContaining(whatsLeft.charAt(i)),\n\t\t\t\t\t\t\tdictPointer);\n\t\t\t\t} else {\n\t\t\t\t\t// Do not call method (skip that subtree) PRUNING! .. like a\n\t\t\t\t\t// boss\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "public abstract int selfExplodingKittenDrawn();", "private synchronized long nextId() {\n\t\treturn ++curID;\n\t}", "private int find(int z, int[] parent) {\n if(parent[z] == -1) {\n return z;\n }\n // System.out.println(parent[z]+\" \"+ z);\n parent[z] = find(parent[z], parent);\n\n return parent[z];\n }", "public int caseA(AVLNode node, AVLNode parent) {\n\t\tif (node.getKey() > parent.getKey()) {\n\t\t\tparent.setRight(node);\n\t\t\tnode.setParent(parent);\n\t\t} else {\n\t\t\tparent.setLeft(node);\n\t\t\tnode.setParent(parent);\n\t\t}\n\t\tparent.setSize();\n\t\tparent.setHeight(parent.getHeight() + 1);\n\t\tif (parent.parentSide() == 'N') {\n\t\t\treturn 1;\n\t\t}\n\t\tchar sideOfNode = node.parentSide();\n\t\tint bottomLeftEdge;\n\t\tif (sideOfNode == 'L') {\n\t\t\tbottomLeftEdge = 1;\n\t\t} else { // side of node is 'R'\n\t\t\tbottomLeftEdge = 2;\n\t\t}\n\t\treturn 1 + this.case1((AVLNode) parent, bottomLeftEdge);\n\t}", "private int nextValidID() {\n return nextId++;\n }", "private void recursiveTryItinerary(String destinationCode, int depth, Time arrivalTime, List<Flight> checkFlights, List<Itinerary> existingItineraries, List<String> visitedAirports, List<Flight> currentFlights, int cid) {\n\n\t\t// this method does nothing if there are no flights so\n\t\tif (checkFlights.size() == 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tString nextOrigin = \"\";\n\t\tString currentOrigin = checkFlights.get(0).getOrigin();\n\t\tboolean recurse;\n\t\tint layoverTime = -1;\n\t\tvisitedAirports.add(currentOrigin);\n\t\tfor (Flight f : checkFlights) {\n\n\t\t\t// get a reference to the current departure time\n\t\t\tTime depTime = f.getDepartureTime();\n\n\t\t\tif (arrivalTime != null) {\n\t\t\t\tlayoverTime = adb.getLayoverTime(f.getOrigin(), cid);\n\t\t\t}\n\n\t\t\t// determine if the thing needs to recurse\n\t\t\tif (currentFlights.size() == 0 || layoverTime == -1) {\n\t\t\t\trecurse = true;\n\t\t\t} else if (arrivalTime.stillBefore(depTime, layoverTime)) {\n\t\t\t\trecurse = true;\n\t\t\t} else {\n\t\t\t\trecurse = false;\n\t\t\t}\n\n\t\t\t// print debug, and add f to all the guacamole\n\t\t\tnextOrigin = f.getDestination();\n\t\t\tcurrentFlights.add(f);\n\n\t\t\t// determine whether to recurse or\n\t\t\tif (f.getDestination().equals(destinationCode)) {\n\t\t\t\t// add a newly created itinerary whose flights are a copy of the current set of flights.\n\t\t\t\tif (((arrivalTime != null) && arrivalTime.stillBefore(depTime, layoverTime)) || layoverTime == -1) {\n\t\t\t\t\texistingItineraries.add(createItinerary(copyFlights(currentFlights)));\n\t\t\t\t}\n\t\t\t} else if (depth > 0 && !(visitedAirports.contains(nextOrigin)) && recurse) {\n\t\t\t\trecursiveTryItinerary(destinationCode, depth - 1, f.getDepartureTime(), getFlightsFromOrigin(nextOrigin), existingItineraries, visitedAirports, currentFlights, cid);\n\t\t\t}\n\n\t\t\t// remove f from all the guacamole\n\t\t\tcurrentFlights.remove(f);\n\t\t}\n\t\tvisitedAirports.remove(currentOrigin);\n\t}", "public int getAid() {\n\t\treturn aid;\n\t}", "public abstract int mo12585RY(int i);", "public String nextAvalibleID()\r\n\t{\r\n\t\t//creates a blank string as all Id's have to be 3 digits and if it was an itger it would remove the leading 0's\r\n\t\tString id = \"\";\r\n\t\t//If the pointer is 0 then the id needs to be 001\r\n\t\tif(nextPatientLocation == 0)\r\n\t\t{\r\n\t\t\tid = \"001\";\r\n\t\t}\r\n\t\t//otherwise it is the existing length + howver many 0's needed to make it 3 digits + the pointer data + 1 to make the first one not overlap any leaing id's\r\n\t\telse if(nextPatientLocation < 10)\r\n\t\t{\r\n\t\t\tid = \"00\"+(nextPatientLocation+1);\r\n\t\t}\r\n\t\telse if(nextPatientLocation < 100)\r\n\t\t{\r\n\t\t\tid = \"0\"+(nextPatientLocation+1);\r\n\t\t}\r\n\t\telse if(nextPatientLocation < 999)\r\n\t\t{\r\n\t\t\tid = \"\"+(nextPatientLocation+1);\r\n\t\t}\r\n\t\treturn id;//Id is returned\r\n\t}", "@Test\n @Ignore\n public void testTraverseAncestors() {\n System.out.println(\"testTraverseAncestors\");\n List<Person> people = dao.listAncestors(\"KWCB-HZV\", 10, \"\", false);\n assertIdsEqual(ancestors, people);\n }", "public abstract void mo3994a();", "static int recursiva2(int n)\n\t\t{\n\t\t\tif (n==0)\n\t\t\treturn 10; \n\t\t\tif (n==1)\n\t\t\treturn 20;\n\t\t\tif (n==2)\n\t\t\treturn 30;\n\t\t\t\n\t\t\treturn recursiva2(n-1) + recursiva2 (n-2) * recursiva2 (n-3); \n\t\t}", "static void lifting(int node,int par)\r\n\t{\r\n\t\tparent[node][0] = par;// 2^0 th parent of the node = 1st parent = par;\r\n\r\n\t\tfor(int i=1;i<5;i++)\r\n\t\t{\r\n\t\t\tif(parent[node][i-1]!=-1)//means if possible\r\n\t\t\t{\r\n\t\t\t\tparent[node][i] = parent[ parent[node][i-1] ][i-1]; //2^nth parent = 2^(n-1)th parent's 2^(n-1)th parent.\r\n\t\t\t}else parent[node][i-1] = -1;\r\n\t\t}\r\n\r\n\t\tfor(int child:al.get(node))\r\n\t\t\tlifting(child,node);\r\n\t}", "private int root(int i){\n\t\twhile ( i != id[i].getVertexLabel())\n\t\t\ti = id[i].getVertexLabel();\n\t\treturn i;\n\t}", "static void p(){\n System.out.println(\"My recursion example 1\");\n p();\n }", "public static void main(String[] args) {\n// System.out.println(anagram1());\n// System.out.println(anagram2());\n// System.out.println(anagram3());\n System.out.println(anagram4());\n\n }", "public abstract void afvuren();", "private void enumerateAnagramsUnderBagEHelper(String targetDoNotChange,\n\t\t\tString whatsLeft, HashMap<String, Integer> parent,\n\t\t\tSet<Map<String, Integer>> ret, int runningTotal) {\n\t\tif (whatsLeft.length() == 0\n\t\t\t\t&& runningTotal == targetDoNotChange.length()) {\n\t\t\tret.add(parent);\n\t\t\treturn;\n\t\t} else {\n\t\t\tSet<String> toIter = generateSubwords(whatsLeft);\n\t\t\tfor (String subWord : toIter) {\n\t\t\t\t// Do some pruning\n\t\t\t\tif (runningTotal + subWord.length() <= targetDoNotChange\n\t\t\t\t\t\t.length()) {\n\t\t\t\t\tString moveMadeWhatsLeft = null;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tmoveMadeWhatsLeft = cutOutSubWord(whatsLeft, subWord);\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\n\t\t\t\t\tHashMap<String, Integer> mapCopy = new HashMap<String, Integer>();\n\t\t\t\t\tfor (String s : parent.keySet()) {\n\t\t\t\t\t\tmapCopy.put(s, parent.get(s));\n\t\t\t\t\t}\n\t\t\t\t\t// Make move\n\t\t\t\t\tif (mapCopy.containsKey(subWord)) {\n\t\t\t\t\t\tmapCopy.put(subWord,\n\t\t\t\t\t\t\t\tmapCopy.get(subWord).intValue() + 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmapCopy.put(subWord, 1);\n\t\t\t\t\t}\n\t\t\t\t\tenumerateAnagramsUnderBagEHelper(targetDoNotChange,\n\t\t\t\t\t\t\tmoveMadeWhatsLeft, mapCopy, ret, runningTotal\n\t\t\t\t\t\t\t\t\t+ subWord.length());\n\n\t\t\t\t} else {\n\t\t\t\t\t// Do nothing.. too long PRUNING\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "boolean hasRecursive();", "private boolean inAnonymusFunc(Node node, Node upper_bound) {\n Optional<Node> parentNode = node.getParentNode();\n if(!parentNode.isPresent()){\n return false;\n }\n Node parent = parentNode.get();\n //If upper bound reached\n if(parent.equals(upper_bound)){\n return false;\n }\n\n Class parentClazz = parent.getClass();\n if(parentClazz != ObjectCreationExpr.class){\n //Maybe the grandparent is an anonymous class expression\n return inAnonymusFunc(parent, upper_bound);\n }\n\n ObjectCreationExpr anonymousClassExpr = (ObjectCreationExpr) parent;\n if(anonymousClassExpr.getAnonymousClassBody().isPresent()){\n return true;\n }else{\n return inAnonymusFunc(parent,upper_bound);\n }\n }", "static long factorialRecurse(int n) {\r\n if (n == 0 || n == 1) {\r\n return 1;\r\n }\r\n return factorialRecurse(n - 1) * n;\r\n }", "private void VisitChildren(AST root){\n for (AST child : root.children) {\n try {\n String switchValue;\n switchValue = (child.GetValue() != null) ? child.GetValue() : ((IdExpr) child).ID;\n visitValue.Visit(switchValue, child);\n } catch (ClassCastException e){\n }\n }\n }", "public abstract void mo90486a(C9515Ad ad);", "public abstract void mo4361a(int i);", "private static int returnItself(int itself, int dummy) {\r\n return itself;\r\n }", "public int getExtendedID()\r\n/* 50: */ {\r\n/* 51: 39 */ return 0;\r\n/* 52: */ }", "public int root(int i) {\n\t\twhile ( i != id[i] ) {\n\t\t\ti = id[i];\n\t\t}\n\t\treturn i;\n\t}", "public Item a(Block parambec, Random paramRandom, int paramInt)\r\n/* 62: */ {\r\n/* 63: 78 */ return BlockList.dirt.a(BlockList.dirt.instance().setData(BlockDirt.a, avd.a), paramRandom, paramInt);\r\n/* 64: */ }", "II addId();", "static void perform_adi(String passed){\n\t\tint type = type_of_adi(passed);\n\t\tswitch(type){\n\t\tcase 1:\n\t\t\tadi_data_with_acc(passed);\n\t\t\tbreak;\n\t\t}\n\t}", "abstract int pregnancy();", "public int getExtendedID()\r\n/* 12: */ {\r\n/* 13:17 */ return 10;\r\n/* 14: */ }", "int getParentIdCount();" ]
[ "0.5752261", "0.55906713", "0.5569327", "0.5437755", "0.5358243", "0.53217286", "0.5250887", "0.52422035", "0.5228659", "0.5160622", "0.51552117", "0.5145885", "0.5125668", "0.5117902", "0.5110255", "0.5086806", "0.50854164", "0.50768536", "0.50503916", "0.50308645", "0.50217474", "0.50159657", "0.5009409", "0.4994881", "0.49900043", "0.4989152", "0.49712008", "0.49672514", "0.495844", "0.4929683", "0.4896014", "0.48848802", "0.48770535", "0.48637292", "0.48637217", "0.48609892", "0.4859304", "0.48497224", "0.48480365", "0.4838967", "0.48332885", "0.4831068", "0.48301128", "0.48232323", "0.48218983", "0.48187053", "0.4808663", "0.48023808", "0.47992688", "0.47992525", "0.47953853", "0.47904012", "0.47754723", "0.47748482", "0.47736004", "0.47723073", "0.47692764", "0.47558662", "0.473654", "0.47354442", "0.47325027", "0.472893", "0.47270414", "0.47235808", "0.47211376", "0.47160134", "0.4705635", "0.46903294", "0.46833375", "0.46739635", "0.46684575", "0.4664567", "0.4652672", "0.46519843", "0.4636663", "0.463469", "0.46308124", "0.4626058", "0.46233147", "0.46200156", "0.46126127", "0.46121004", "0.46098602", "0.46092522", "0.46070686", "0.460554", "0.459885", "0.45967507", "0.45935062", "0.4589056", "0.45861623", "0.45848337", "0.45785743", "0.45762038", "0.45757148", "0.4571801", "0.45694256", "0.4567992", "0.45648336", "0.45604888", "0.4556601" ]
0.0
-1
Aid Function return the nearest points in max 3 point//
private Point[] nearestPair3Points(Point[] range) { if (range.length < 2) return null; if (range.length == 2) return range; //else - its mean that we have 3 points in the array Point[] Answer = new Point[2]; double currentMinDistance = Distance(range[0], range[1]); Answer[0]= range[0]; Answer[1]= range[1]; if (Distance(range[0], range[2]) < currentMinDistance){ currentMinDistance = Distance(range[0], range[2]); Answer[0]= range[0]; Answer[1]= range[2]; } if (Distance(range[1], range[2]) < currentMinDistance){ Answer[0]= range[1]; Answer[1]= range[2]; } return Answer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private GeoPoint getClosestPoint(List<GeoPoint> points) {\r\n\t\tGeoPoint closestPoint = null;\r\n\t\tdouble distance = Double.MAX_VALUE;\r\n\r\n\t\tPoint3D P0 = _scene.get_camera().get_p0();\r\n\r\n\t\tfor (GeoPoint i : points) {\r\n\t\t\tdouble tempDistance = i.point.distance(P0);\r\n\t\t\tif (tempDistance < distance) {\r\n\t\t\t\tclosestPoint = i;\r\n\t\t\t\tdistance = tempDistance;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn closestPoint;\r\n\r\n\t}", "public Coordinates closestPointA() {\n return closestPointA;\n }", "static int getAnchor(int a){\n return a-((a-1)%3);\n }", "public Point getClosest(){\n\t\t\tdouble distance;\n\t\t\tdouble distanceMax = 0.0;\n\t\t\tPoint centroid = centroid();\n\t\t\tPoint furthermost = new Point();\n\t\t\tfor(Point p : clusterPointsList){\n\t\t\t\tdistance = p.dist(centroid);\t\t\t\n\t\t\t\tif(distance > distanceMax){\n\t\t\t\t\tdistanceMax = distance;\n\t\t\t\t\tfurthermost = p;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn furthermost;\n\t\t}", "private GeoPoint getClosestPoint(List<GeoPoint> intersectionPoints) {\n Point3D p0 = scene.getCamera().getSpo();//the point location of the camera.\n double minDist = Double.MAX_VALUE;//(meatchelim ldistance hamaximily)\n double currentDistance = 0;\n GeoPoint pt = null;\n for (GeoPoint geoPoint : intersectionPoints) {\n currentDistance = p0.distance(geoPoint.getPoint());//checks the distance from camera to point\n if (currentDistance < minDist) {\n minDist = currentDistance;\n pt = geoPoint;\n }\n }\n return pt;\n }", "public int getOptimalNumNearest();", "private static Pair closest_pair(ArrayList<Point> pointset){\n\t\treturn null;\n\t}", "private Vector<Integer> matchCheckPoint(List<Point> a) {\t\t\t\n\t\tVector<Integer> iDS= new Vector<>();\n\t\tfor(Point p :a) {\n\t\t\tif(!getAsphalt(p.x, p.y,this.trk).isIdDefalt()) {\n\t\t\t\tiDS.add(getAsphalt(p.x, p.y,this.trk).getId());\n\t\t\t}\n\t\t}\n\t\treturn iDS;\n\t}", "private double calcNearestNeighborIndex(ArrayList<Point> pts) {\n int width = layoutPanel.getLayoutSize().width;\n int height = layoutPanel.getLayoutSize().height;\n\n // calculate average nearest neighbor\n double avgNN = 0;\n int n = pts.size();\n for (int i = 0; i < n; i++) {\n double minDist = Float.MAX_VALUE;\n for (int j = 0; j < n; j++) {\n if (i != j) {\n Point pti = pts.get(i);\n Point ptj = pts.get(j);\n double dist = Point2D\n .distanceSq(pti.x, pti.y, ptj.x, ptj.y);\n if (minDist > dist) {\n minDist = dist;\n }\n }\n }\n avgNN += Math.sqrt(minDist);\n }\n avgNN = avgNN / (double) n;\n\n // calculate estimated average neighbor\n double estANN = 1.0 / (2.0 * Math.sqrt((double) n\n / (double) (width * height)));\n\n return avgNN / estANN;\n }", "public Tuple3d getClosestPoint(final Tuple3d point) {\n // A' = A - (A . n) * n\n final Vector3d aprime = new Vector3d(point);\n final double adotn = TupleMath.dot(point, this.normal);\n final Vector3d scaledNormal = new Vector3d(this.normal);\n scaledNormal.scale(adotn);\n aprime.subtract(scaledNormal);\n\n return aprime;\n }", "private Map<Geometry, Point3D> getClosestPoint(Map<Geometry, List<Point3D>> intersectionPoints) {\n\n double distance = Double.MAX_VALUE;\n Map<Geometry, Point3D> closestPoint = new HashMap<Geometry, Point3D>();\n Point3D P0 = _scene.getCamera().getP0();\n Map.Entry<Geometry, List<Point3D>> entry;\n Iterator<Entry<Geometry, List<Point3D>>> it = intersectionPoints.entrySet().iterator();\n while (it.hasNext())\n {\n entry = it.next();\n for (Point3D point: intersectionPoints.get(entry.getKey())) {\n if (P0.distance(point) < distance) {\n closestPoint = new HashMap<Geometry, Point3D>();\n closestPoint.put(entry.getKey(), point);\n distance = P0.distance(point);\n }\n }\n }\n return closestPoint;\n }", "public Point3D findClosestPoint(List<Point3D> pointsList) {\n /**\n * the near point\n */\n Point3D result = null;\n /**\n * initialize with a big number that we sure it will change\n */\n double closestDistance = Double.MAX_VALUE;\n\n /**\n * if the point equals to null, it`s mean there\n * is no point that close to it\n */\n if (pointsList == null) {\n return null;\n }\n\n for (Point3D p : pointsList) {\n double temp = p.distance(_p0);\n if (temp < closestDistance) {\n closestDistance = temp;\n result = p;\n }\n }\n\n return result;\n }", "private static List<Point> genererPointsAlea(int nbPoints) {\n /*List<Point> points = new ArrayList<>();\n Random rand = new Random(0);\n for(int i=0; i<nbPoints; i++) {\n Point p = new Point(rand.nextDouble(), rand.nextDouble());\n points.add(p);\n }\n return points;*/\n return null;\n }", "private Point findFront(Point[] points) {\n\t\t// Loop through the passed points.\n\t\tdouble[] dists = new double[3];\n\t\tfor (int i = 0; i < 3; i++) {\n\t\t\t// Get outer-loop point.\n\t\t\tPoint a = points[i];\n\t\t\t\n\t\t\t// Loop through rest of points.\n\t\t\tfor (int k = 0; k < 3; k++) {\n\t\t\t\t// Continue if current outer.\n\t\t\t\tif (i == k) continue;\n\t\t\t\t\n\t\t\t\t// Get inner-loop point.\n\t\t\t\tPoint b = points[k];\n\t\t\t\t\n\t\t\t\t// Add distance between out and inner.\n\t\t\t\tdists[i] += Math.sqrt(\n\t\t\t\t\tMath.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Prepare index and largest holder.\n\t\tint index = 0;\n\t\tdouble largest = 0;\n\t\t\n\t\t// Loop through the found distances.\n\t\tfor (int i = 0; i < 3; i++) {\n\t\t\t// Skip if dist is lower than largest.\n\t\t\tif (dists[i] < largest) continue;\n\t\t\t\n\t\t\t// Save the index and largest value.\n\t\t\tindex = i;\n\t\t\tlargest = dists[i];\n\t\t}\n\t\t\n\t\t// Return the largest point index.\n\t\treturn points[index];\n\t}", "public Point[] nearestPair() {\n\t\t\tPoint[] Answer = new Point[2];\n\t\t\tif (this.size<2)\treturn null; //step 1\n\t\t\tif (this.size==2){\n\t\t\t\tAnswer[0]=this.minx.getData();\n\t\t\t\tAnswer[1]=this.maxx.getData();\n\t\t\t\treturn Answer;\t\t\t\n\t\t\t}\n\t\t\tdouble MinDistance=-1; // for sure it will be change in the next section, just for avoid warrning.\n\t\t\tdouble MinDistanceInStrip=-1;\n\t\t\tPoint[] MinPointsLeft = new Point[2];\n\t\t\tPoint[] MinPointsRight = new Point[2];\n\t\t\tPoint[] MinPointsInStrip = new Point[2]; // around the median\n\t\t\tboolean LargestAxis = getLargestAxis(); //step 2\n\t\t\tContainer median = getMedian(LargestAxis); //step 3\n\t\t\tif (LargestAxis){// step 4 - calling the recursive function nearestPairRec\n\t\t\t\tMinPointsLeft = nearestPairRec(getPointsInRangeRegAxis(this.minx.getData().getX(), median.getData().getX(),LargestAxis), LargestAxis);\n\t\t\t\tMinPointsRight =nearestPairRec(getPointsInRangeRegAxis(median.getNextX().getData().getX(), this.maxx.getData().getX(),LargestAxis), LargestAxis);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tMinPointsLeft = nearestPairRec(getPointsInRangeRegAxis(this.miny.getData().getY(), median.getData().getY(),LargestAxis), LargestAxis);\n\t\t\t\tMinPointsRight =nearestPairRec(getPointsInRangeRegAxis(median.getNextY().getData().getY(), this.maxy.getData().getY(),LargestAxis), LargestAxis);\n\t\t\t}\n\t\t\t//step 5\n\t\t\tif (MinPointsLeft!=null && MinPointsRight!=null){\n\t\t\t\tif (Distance(MinPointsLeft[0], MinPointsLeft[1]) > Distance(MinPointsRight[0], MinPointsRight[1])){\n\t\t\t\t\tMinDistance = Distance(MinPointsRight[0], MinPointsRight[1]);\n\t\t\t\t\tAnswer = MinPointsRight;\n\t\t\t\t}else{\n\t\t\t\t\tMinDistance = Distance(MinPointsLeft[0], MinPointsLeft[1]);\n\t\t\t\t\tAnswer = MinPointsLeft;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (MinPointsLeft!=null) {\n\t\t\t\tMinDistance = Distance(MinPointsLeft[0], MinPointsLeft[1]);\n\t\t\t\tAnswer = MinPointsLeft;\n\t\t\t}\n\t\t\telse if (MinPointsRight!=null){\n\t\t\t\tMinDistance = Distance(MinPointsRight[0], MinPointsRight[1]);\n\t\t\t\tAnswer = MinPointsRight;\n\t\t\t}\n\t\t\t//step 6 - nearest point around the median\n\t\t\tif (MinDistance==-1) MinDistance=0;\n\t\t\tMinPointsInStrip = nearestPairInStrip(median, MinDistance*2, LargestAxis);\n\t\t\tif (MinPointsInStrip != null){\n\t\t\t\tMinDistanceInStrip = Distance(MinPointsInStrip[0], MinPointsInStrip[1]);\n\t\t\t\tif (MinDistanceInStrip < MinDistance) return MinPointsInStrip;\n\t\t\t}\n\t\t\treturn Answer;\n\t\t}", "synchronized protected int findNearestPoint(final int x_p, final int y_p, final long layer_id) {\n \t\tint index = -1;\n \t\tdouble min_dist = Double.MAX_VALUE;\n \t\tfor (int i=0; i<n_points; i++) {\n \t\t\tif (layer_id != p_layer[i]) continue;\n \t\t\tdouble sq_dist = Math.pow(p[0][i] - x_p, 2) + Math.pow(p[1][i] - y_p, 2);\n \t\t\tif (sq_dist < min_dist) {\n \t\t\t\tindex = i;\n \t\t\t\tmin_dist = sq_dist;\n \t\t\t}\n \t\t}\n \t\treturn index;\n \t}", "public Point getFurthermost(){\n\t\t\tdouble distance;\n\t\t\tdouble distanceMin = Double.MAX_VALUE;\n\t\t\tPoint centroid = centroid();\n\t\t\tPoint closest = new Point();\n\t\t\tfor(Point p : clusterPointsList){\n\t\t\t\tdistance = p.dist(centroid);\t\t\t\n\t\t\t\tif(distance < distanceMin){\n\t\t\t\t\tdistanceMin = distance;\n\t\t\t\t\tclosest = p;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn closest;\n\t\t}", "private static double calculDistanceTourneeAlea(List<Point> points, Random rand) {\n double distance = 0;\n Collections.shuffle(points, rand);\n Point courant = points.get(0);\n Point suivant;\n for(int i=1; i<points.size(); i++) {\n suivant = points.get(i);\n distance += courant.getDistance(suivant);\n courant = suivant;\n }\n suivant = points.get(0);\n distance += courant.getDistance(suivant);\n return distance;\n }", "public int best(){\n List<Integer> points = count();\n Integer max = 0;\n for (Integer p: points){\n if (p <= 21 && max < p){\n max = p;\n }\n }\n return max;\n }", "private void findLargestNNIPointsIndexPair(float ratioInh, float ratioAct) {\n ArrayList<Point> pts0 = new ArrayList<Point>();\n ArrayList<Point> pts1 = new ArrayList<Point>();\n Dimension dim = layoutPanel.getLayoutSize();\n int height = dim.height;\n int width = dim.width;\n int size = height * width;\n int newNListSize;\n if (ratioInh > ratioAct) {\n newNListSize = (int) (size * ratioInh);\n pts0 = cnvIndexList2Points(layoutPanel.activeNList);\n pts1 = cnvIndexList2Points(layoutPanel.inhNList);\n } else {\n newNListSize = (int) (size * ratioAct);\n pts0 = cnvIndexList2Points(layoutPanel.inhNList);\n pts1 = cnvIndexList2Points(layoutPanel.activeNList);\n }\n double len = Math.sqrt((double) size / (double) newNListSize);\n\n ArrayList<Point> union = new ArrayList<Point>(pts0);\n union.addAll(pts1);\n double maxNNI = calcNearestNeighborIndex(union);\n ArrayList<Point> maxPts0 = pts0;\n ArrayList<Point> maxPts1 = pts1;\n for (int xShift = (int) Math.floor(-len / 2); xShift <= Math\n .ceil(len / 2); xShift++) {\n for (int yShift = (int) Math.floor(-len / 2); yShift <= Math\n .ceil(len / 2); yShift++) {\n if (xShift == 0 && yShift == 0) {\n continue;\n }\n int xShift0 = (int) Math.ceil((double) xShift / 2);\n int xShift1 = (int) Math.ceil((double) -xShift / 2);\n int yShift0 = (int) Math.ceil((double) yShift / 2);\n int yShift1 = (int) Math.ceil((double) -yShift / 2);\n // System.out.println(\"xShift = \" + xShift + \", xShift0 = \" +\n // xShift0 + \", xShift1 = \" + xShift1);\n ArrayList<Point> sftPts0 = getShiftedPoints(pts0, xShift0,\n yShift0);\n ArrayList<Point> sftPts1 = getShiftedPoints(pts1, xShift1,\n yShift1);\n union = new ArrayList<Point>(sftPts0);\n union.addAll(sftPts1);\n double nni = calcNearestNeighborIndex(union);\n if (nni > maxNNI) {\n maxNNI = nni;\n maxPts0 = sftPts0;\n maxPts1 = sftPts1;\n }\n }\n }\n\n if (ratioInh > ratioAct) {\n layoutPanel.activeNList = cnvPoints2IndexList(maxPts0);\n layoutPanel.inhNList = cnvPoints2IndexList(maxPts1);\n } else {\n layoutPanel.inhNList = cnvPoints2IndexList(maxPts0);\n layoutPanel.activeNList = cnvPoints2IndexList(maxPts1);\n }\n }", "List<CoordinateDistance> getNearestCoordinates(Point coordinate, int n);", "private Point getClosestPoint(Point[] mapPoints, Point newPoint) {\n for (int i = 0; i < mapPoints.length; i++) {\n if (ShortestPath.distance(newPoint, mapPoints[i]) < 30) {\n newPoint.x = mapPoints[i].x + 10;\n newPoint.y = mapPoints[i].y + 10;\n return newPoint;\n }\n }\n return null;\n }", "Execution getClosestDistance();", "@Override\r\n public Point nearest(double x, double y) {\r\n Point input = new Point(x, y);\r\n Point ans = points.get(0);\r\n double dist = Point.distance(ans, input);\r\n for (Point point : points) {\r\n if (Point.distance(point, input) < dist) {\r\n ans = point;\r\n dist = Point.distance(ans, input);\r\n }\r\n }\r\n return ans;\r\n }", "@Test\n public void basicTest() {\n Point myPoint;\n\n// myPoint = pointSet.nearest(2, 2);\n// System.out.println(myPoint.toString());\n// myPoint = pointSet.nearest(2, -2);\n// System.out.println(myPoint.toString());\n// myPoint = pointSet.nearest(1, 4);\n// System.out.println(myPoint.toString());\n// myPoint = pointSet.nearest(3, -100);\n// System.out.println(myPoint.toString());\n// myPoint = pointSet.nearest(0, 0);\n// System.out.println(myPoint.toString());\n//\n// myPoint = kdPointSet.nearest(2, 2); //THIS ONE DOES NOT MATCH NAIVE!\n// System.out.println(myPoint.toString());\n// myPoint = kdPointSet.nearest(2, -2);\n// System.out.println(myPoint.toString());\n// myPoint = kdPointSet.nearest(1, 4);\n// System.out.println(myPoint.toString());\n// myPoint = kdPointSet.nearest(3, -100);\n// System.out.println(myPoint.toString());\n// myPoint = kdPointSet.nearest(0, 0);\n// System.out.println(myPoint.toString());\n\n\n\n\n\n\n }", "public Point3 getPoint(int pointNr);", "public BeyondarObject getNearestARObject(List<BeyondarObject> list)\n {\n int nearestDistance = 10000;\n BeyondarObject nearest = null;\n for (BeyondarObject beyondarObject : list) {\n if (beyondarObject.getDistanceFromUser() < nearestDistance) {\n nearestDistance = (int) beyondarObject.getDistanceFromUser();\n nearest = beyondarObject;\n }\n }\n return nearest;\n }", "int[][] Naive(int m, Pointd[] points){\n int[][] tours = new int[m][];\n for(int i=0; i<m; i++){\n if(i<points.length%m) tours[i] = new int[points.length/m+1];\n else tours[i] = new int[points.length/m];\n }\n\n //Select the first point, find the next closest point, find the next closest point to that etc\n boolean[] alreadyInTour = new boolean[points.length];\n double minDistance;\n double distance;\n Pointd pointA;\n Pointd pointB;\n int index = 0;\n int n;\n\n for(int k=0; k<m; k++){\n //Each row of tours, first find a node that isn't in a tour\n n = 0;\n while(alreadyInTour[n]) n++;\n pointA = points[n];\n tours[k][0] = n;\n alreadyInTour[n] = true;\n\n int iterate = 0;\n int j=1;\n while(j<tours[k].length){\n if(!alreadyInTour[iterate]){\n minDistance = Double.MAX_VALUE;\n //Find next closest point to pointA\n for(int i=0; i<points.length; i++){\n pointB = points[i];\n if(!alreadyInTour[i]){\n distance = Math.sqrt( Math.pow(pointA.x - pointB.x, 2) + Math.pow(pointA.y - pointB.y, 2) );\n if(distance < minDistance){\n minDistance = distance;\n index = i;\n }\n }\n }\n //System.out.println(index);\n tours[k][j] = index;\n alreadyInTour[index] = true;\n j++;\n }\n iterate++;\n if(iterate >= points.length) iterate = 0;\n }\n }\n for(int i=0; i<tours.length; i++){\n //System.out.println(Arrays.toString(tours[i]));\n }\n return tours;\n }", "@Override\n public Point nearest(double x, double y) {\n double distance = Double.POSITIVE_INFINITY;\n Point nearestPoint = new Point(0, 0);\n Point targetPoint = new Point(x, y);\n\n for (Point p : pointsList) {\n double tempdist = Point.distance(p, targetPoint);\n if (tempdist < distance) {\n distance = tempdist;\n nearestPoint = p;\n }\n }\n\n return nearestPoint;\n }", "Point findNearestActualPoint(Point a, Point b) {\n\t\tPoint left = new Point(a.x-this.delta/3,a.y);\n\t\tPoint right = new Point(a.x+this.delta/3,a.y);\n\t\tPoint down = new Point(a.x,a.y-this.delta/3);\n\t\tPoint up = new Point(a.x,a.y+this.delta/3);\n\t\tPoint a_neighbor = left;\n\t\tif (distance(right,b) < distance(a_neighbor,b)) a_neighbor = right;\n\t\tif (distance(down,b) < distance(a_neighbor,b)) a_neighbor = down;\n\t\tif (distance(up,b) < distance(a_neighbor,b)) a_neighbor = up;\n\n\t\treturn a_neighbor;\n\t}", "long closest(double lon, double lat) {\n double smallestDist = Double.MAX_VALUE;\n long smallestId = 0;\n Iterable<Node> v = world.values();\n for (Node n : v) {\n double tempLat = n.getLat();\n double tempLon = n.getLon();\n double tempDist = distance(lon, lat, tempLon, tempLat);\n if (tempDist < smallestDist) {\n smallestDist = tempDist;\n smallestId = n.getId();\n }\n }\n return smallestId;\n }", "public Point2D nearest(Point2D p) {\n \n if (p == null)\n throw new IllegalArgumentException(\"Got null object in nearest()\");\n \n double rmin = 2.;\n Point2D pmin = null;\n \n for (Point2D q : point2DSET) {\n \n double r = q.distanceTo(p);\n if (r < rmin) {\n \n rmin = r;\n pmin = q;\n }\n }\n return pmin;\n }", "int getAptitudeId();", "public PolytopeTriangle findClosest(){\n\t\t//OPTIMIZATION MOVE THIS TO THE ADD FUNCTION AND HAVE IT BE THE RETURN VALUE\n\t\tfloat maxDist = faces.get(0).getDistance();\n\t\tint index = 0;\n\t\tfor(int curIndex = 1; curIndex < faces.size(); curIndex++){\n\t\t\tfloat distance = faces.get(curIndex).getDistance();\n\t\t\tif(distance < maxDist){\n\t\t\t\tindex = curIndex;\n\t\t\t\tmaxDist = distance;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn faces.get(index);\n\t}", "private static Point getNearest(Collection<Point> centers, Point p) {\n\t\tdouble min = 0;\n\t\tPoint minPoint = null;\n\t\tfor(Point c : centers){\n\t\t\tif(minPoint == null || c.distance(p) < min){\n\t\t\t\tmin = c.distance(p);\n\t\t\t\tminPoint = c;\n\t\t\t}\n\t\t}\n\t\treturn minPoint;\n\t}", "private int closest(double [] v){\n \t\tdouble mindist = dist(v, nCentroids[0]);\n \t\tint label =0;\n \t\tfor (int i=1; i<nClusters; i++){\n \t\t\tdouble t = dist(v, nCentroids[i]);\n \t\t\tif (mindist>t){\n \t\t\t\tmindist = t;\n \t\t\t\tlabel = i;\n \t\t\t}\n \t\t}\n \t\treturn label;\n \t}", "private GeoPoint getClosestPoint(List<GeoPoint> points, Ray ray) {\r\n\t\tGeoPoint close = points.get(0);\r\n\t\tdouble dist;\r\n\t\tfor (GeoPoint p : points) {\r\n\t\t\tdist = ray.get_p0().distance(p.point);\r\n\t\t\tif (dist < ray.get_p0().distance(close.point))\r\n\t\t\t\tclose = p;\r\n\t\t}\r\n\t\treturn close;\r\n\t}", "public Point2D nearest(Point2D p) {\n if (isEmpty()) {\n return null;\n }\n double minDistance = Double.POSITIVE_INFINITY;\n Point2D nearest = null;\n for (Point2D i : pointsSet) {\n if (i.distanceTo(p) < minDistance) {\n nearest = i;\n minDistance = i.distanceTo(p);\n }\n }\n return nearest;\n\n }", "protected Coordinates intersectionFromClosestPoints() {\n if (closestPointA != null && closestPointB != null\n && geometry.almostEqual(closestPointA, closestPointB)) {\n return closestPointA;\n } else {\n return null;\n }\n }", "public Point2D nearest(Point2D p) {\n if (p == null) throw new NullPointerException();\n Point2D champion = pointSet.first();\n if (champion == null) return null;\n \n for (Point2D point : pointSet) {\n if (point.distanceSquaredTo(p) < champion.distanceSquaredTo(p)) {\n champion = point;\n }\n }\n return champion;\n }", "Execution getFarthestDistance();", "public Point2D nearest(Point2D p) {\n Point2D nearest = null;\n double nearestDistance = Double.MAX_VALUE;\n for (Point2D cur: mPoints) {\n double distance = cur.distanceTo(p);\n if (nearestDistance > distance) {\n nearest = cur;\n nearestDistance = distance;\n }\n }\n return nearest;\n }", "private static double dynamically_select_epsilon(ArrayList<Point> pointset){\n\t\tPair closestPair = closest_pair(pointset);\n\t\t\n\t\t// Calculate Chebyshev distance between nearest pair\n\t\tdouble distance = chebyshev_distance(closestPair.getFirst(), closestPair.getSecond());\n\t\t\n\t\t// Divide by 8 to fit 8e box constraint set in Gabe's paper\n\t\treturn distance / 8.0;\n\t}", "private Point derivePoint(int[] minMaxLatLon, Point edge, GeoPoint p){\n \tint y = (int)((minMaxLatLon[1] - p.getLatitude()) /\n \t\t\t((double)(minMaxLatLon[1] - minMaxLatLon[0])) *\n \t\t\t(edge.getY()));\n \t\n \tint x = (int)((p.getLongitude() - minMaxLatLon[2]) /\n \t\t\t((double)(minMaxLatLon[3] - minMaxLatLon[2])) *\n \t\t\t(edge.getX()));\n \t\n \treturn new Point(x, y);\n }", "public static Point minmax (int[] a) {\n int n = a.length;\n Point mm = new Point (a[0], a[0]);\n\n for (int i=1; i<n; i++) {\n if (a[i] > mm.x) mm.x = a[i];\n if (a[i] < mm.y) mm.y = a[i];\n }\n return mm;\n }", "public static void main(String[] args) {\n MaxDistance max = new MaxDistance();\n //int arr[] = {9, 2, 3, 4, 5, 6, 7, 8, 18, 0};\n\n //int arr[] = {3, 5, 4, 2};\n //int arr[] = {3,2,1};\n //int arr[] = {1,10};\n int arr[] = {100, 100, 100}; //return 0, not checking equal value\n \n //int arr[] = { 83564666, 2976674, 46591497, 24720696, 16376995, 63209921, 25486800, 49369261, 20465079, 64068560, 7453256, 14180682, 65396173, 45808477, 10172062, 28790225, 82942061, 88180229, 62446590, 77573854, 79342753, 2472968, 74250054, 17223599, 47790265, 24757250, 40512339, 24505824, 30067250, 82972321, 32482714, 76111054, 74399050, 65518880, 94248755, 76948016, 76621901, 46454881, 40376566, 13867770, 76060951, 71404732, 21608002, 26893621, 27370182, 35088766, 64827587, 67610608, 90182899, 66469061, 67277958, 92926221, 58156218, 44648845, 37817595, 46518269, 44972058, 27607545, 99404748, 39262620, 98825772, 89950732, 69937719, 78068362, 78924300, 91679939, 52530444, 71773429, 57678430, 75699274, 5835797, 74160501, 51193131, 47950620, 4572042, 85251576, 49493188, 77502342, 3244395, 51211050, 44229120, 2135351, 47258209, 77312779, 37416880, 59038338, 96069936, 20766025, 35497532, 67316276, 38312269, 38357645, 41600875, 58590177, 99257528, 99136750, 4796996, 84369137, 54237155, 64368327, 94789440, 40718847, 12226041, 80504660, 8177227, 85151842, 36165763, 72764013, 36326808, 80969323, 22947547, 76322099, 7536094, 18346503, 65759149, 45879388, 53114170, 92521723, 15492250, 42479923, 20668783, 64053151, 68778592, 3669297, 73903133, 28973293, 73195487, 64588362, 62227726, 17909010, 70683505, 86982984, 64191987, 71505285, 45949516, 28244755, 33863602, 18256044, 25110337, 23997763, 81020611, 10135495, 925679, 98158797, 73400633, 27282156, 45863518, 49288993, 52471826, 30553639, 76174500, 28828417, 41628693, 80019078, 64260962, 5577578, 50920883, 16864714, 54950300, 9267396, 56454292, 40872286, 33819401, 75369837, 6552946, 26963596, 22368984, 43723768, 39227673, 98188566, 1054037, 28292455, 18763814, 72776850, 47192134, 58393410, 14487674, 4852891, 44100801, 9755253, 37231060, 42836447, 38104756, 77865902, 67635663, 43494238, 76484257, 80555820, 8632145, 3925993, 81317956, 12645616, 23438120, 48241610, 20578077, 75133501, 46214776, 35621790, 15258257, 20145132, 32680983, 94521866, 43456056, 19341117, 29693292, 38935734, 62721977, 31340268, 91841822, 22303667, 96935307, 29160182, 61869130, 33436979, 32438444, 87945655, 43629909, 88918708, 85650550, 4201421, 11958347, 74203607, 37964292, 56174257, 20894491, 33858970, 45292153, 22249182, 77695201, 34240048, 36320401, 64890030, 81514017, 58983774, 88785054, 93832841, 12338671, 46297822, 26489779, 85959340 };\n\n //int arr[] = { 46158044, 9306314, 51157916, 93803496, 20512678, 55668109, 488932, 24018019, 91386538, 68676911, 92581441, 66802896, 10401330, 57053542, 42836847, 24523157, 50084224, 16223673, 18392448, 61771874, 75040277, 30393366, 1248593, 71015899, 20545868, 75781058, 2819173, 37183571, 94307760, 88949450, 9352766, 26990547, 4035684, 57106547, 62393125, 74101466, 87693129, 84620455, 98589753, 8374427, 59030017, 69501866, 47507712, 84139250, 97401195, 32307123, 41600232, 52669409, 61249959, 88263327, 3194185, 10842291, 37741683, 14638221, 61808847, 86673222, 12380549, 39609235, 98726824, 81436765, 48701855, 42166094, 88595721, 11566537, 63715832, 21604701, 83321269, 34496410, 48653819, 77422556, 51748960, 83040347, 12893783, 57429375, 13500426, 49447417, 50826659, 22709813, 33096541, 55283208, 31924546, 54079534, 38900717, 94495657, 6472104, 47947703, 50659890, 33719501, 57117161, 20478224, 77975153, 52822862, 13155282, 6481416, 67356400, 36491447, 4084060, 5884644, 91621319, 43488994, 71554661, 41611278, 28547265, 26692589, 82826028, 72214268, 98604736, 60193708, 95417547, 73177938, 50713342, 6283439, 79043764, 52027740, 17648022, 33730552, 42851318, 13232185, 95479426, 70580777, 24710823, 48306195, 31248704, 24224431, 99173104, 31216940, 66551773, 94516629, 67345352, 62715266, 8776225, 18603704, 7611906 };\n\n int n = arr.length;\n int maxDiff = max.maxIndexDiff(arr, n);\n System.out.println(maxDiff);\n }", "protected Instance nearestValidNeighbor(Instance inst, int a,\r\n\t\t\tInstanceAttributes atts) {\r\n\t\tdouble distance = Double.POSITIVE_INFINITY;\r\n\t\tInstance inst2;\r\n\t\tint nn = 0;\r\n\r\n\t\tfor (int i = 0; i < IS.getNumInstances(); i++) {\r\n\t\t\tinst2 = IS.getInstance(i);\r\n\t\t\tif (inst != inst2 && !inst2.getInputMissingValues(a)\r\n\t\t\t\t\t&& distance(inst, inst2, atts) < distance) {\r\n\t\t\t\tdistance = distance(inst, inst2, atts);\r\n\t\t\t\tnn = i;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\treturn IS.getInstance(nn);\r\n\t}", "private Point[] nearestPointInArray(Point[] strip){\n\t\tint j = 1; // with each point we measure the distance with the following 6 point's\n\t\tPoint[] currentMinPoints = {strip[0],strip[1]};\n\t\tdouble currentMinDistance = Distance(currentMinPoints[0], currentMinPoints[1]);\n\t\tdouble currentDistance;\t\n\t\tfor (int i=0; i< strip.length; i++){\n\t\t\twhile (j<8 && i+j < strip.length){\n\t\t\t\tcurrentDistance = Distance(strip[i], strip[i+j]);\n\t\t\t\tif (currentDistance<currentMinDistance){\n\t\t\t\t\tcurrentMinDistance = currentDistance;\n\t\t\t\t\tcurrentMinPoints[0] = strip[i];\n\t\t\t\t\tcurrentMinPoints[1] = strip[i+j];\n\t\t\t\t}\n\t\t\t\tj++;\n\t\t\t}\n\t\t\tj=1;\n\t\t}\n\t\treturn currentMinPoints;\n\t}", "public Point3D getA() {\r\n return a;\r\n }", "public static void findClosestPair(XYPoint points[], boolean print)\n\t{\n\t\tif(points.length==1){\n\t\t\treturn;\n\t\t}\n\t\tdouble mindist = INF;\n\t\tdouble dist = 0.0;\n\t\tint npoints=points.length;\n\t\tXYPoint point1 = new XYPoint();\n\t\tXYPoint point2 = new XYPoint();\n\t\tint i=0;\n\t\twhile(i<npoints-1){ //XYPoint[i]\n\t\t\t\tint k = i+1;\n\t\t\t\twhile (k<npoints){ //XYPoint[j]\n\t\t\t\t\tdist=points[i].dist(points[k]);\n\t\t\t\t\tif(dist<mindist){\n\t\t\t\t\t\tmindist=dist;\n\t\t\t\t\t\tpoint1=points[i];\n\t\t\t\t\t\tpoint2=points[k];\n\t\t\t\t\t}\n\t\t\t\t\tk++;\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t}\n\t\tif (print){\n\t\t\tSystem.out.println(\"NAIVE \" + point1+\" \"+point2+\" \"+mindist);\n\t\t}\n\n\t}", "int getMapPointID();", "public static double closestPair(Point[] sortedX) {\n if (sortedX.length <= 1) {\n return Double.MAX_VALUE;\n }\n double mid = sortedX[(sortedX.length) / 2].getX();\n double firstHalf = closestPair(Arrays.copyOfRange(sortedX, 0, (sortedX.length) / 2));\n double secondHalf = closestPair(Arrays.copyOfRange(sortedX, (sortedX.length) / 2, sortedX.length));\n double min = Math.min(firstHalf, secondHalf);\n ArrayList<Point> close = new ArrayList<Point>();\n for (int i = 0; i < sortedX.length; i++) {\n double dis = Math.abs(sortedX[i].getX() - mid);\n if (dis < min) {\n close.add(sortedX[i]);\n }\n }\n // sort by Y coordinates\n Collections.sort(close, new Comparator<Point>() {\n public int compare(Point obj1, Point obj2) {\n return (int) (obj1.getY() - obj2.getY());\n }\n });\n Point[] near = close.toArray(new Point[close.size()]);\n\n for (int i = 0; i < near.length; i++) {\n int k = 1;\n while (i + k < near.length && near[i + k].getY() < near[i].getY() + min) {\n if (min > near[i].distance(near[i + k])) {\n min = near[i].distance(near[i + k]);\n System.out.println(\"near \" + near[i].distance(near[i + k]));\n System.out.println(\"best \" + best);\n\n if (near[i].distance(near[i + k]) < best) {\n best = near[i].distance(near[i + k]);\n arr[0] = near[i];\n arr[1] = near[i + k];\n // System.out.println(arr[0].getX());\n // System.out.println(arr[1].getX());\n\n }\n }\n k++;\n }\n }\n return min;\n }", "private int clickOnWaypoint(int a_x, int a_y)\n {\n Vector2d click = new Vector2d(a_x,a_y);\n int drawRadius = Ship.SHIP_RADIUS * Waypoint.RADIUS;\n for(int i = 0; i < m_waypoints.size(); ++i)\n {\n Vector2d v = m_waypoints.get(i);\n if(click.dist(v) < drawRadius * 0.5)\n {\n return i;\n }\n\n }\n return -1;\n }", "public FullPositionVector getAnchorPoint()\n {\n\treturn this.anchorPoint;\n }", "public static Point[] closestPair(double[] x, double[]y) throws Exception\r\n {\r\n /*if x-coordinates dont match y-coordinates*/\r\n if(x.length != y.length)\r\n {\r\n System.out.println(\"Can't compute closest pair. Input lengths mismatch!\");\r\n throw new Exception();\r\n }\r\n /*if there is one or less points*/\r\n if(x.length <2 || y.length <2)\r\n {\r\n System.out.println(\"Can't compute closest pair. Fewer inputs!\");\r\n throw new Exception();\r\n }\r\n /*if there are two points*/\r\n if(x.length == 2)\r\n {\r\n Point[] closest = {new Point(x[0],y[0]), new Point(x[1],y[1])};\r\n return closest;\r\n }\r\n /*if there are three points*/\r\n if(x.length == 3)\r\n {\r\n double cx1 = x[0], cy1 = y[0], cx2 = x[1], cy2 = y[1];\r\n //P0 and P1\r\n double cdist = Math.pow((cx1-cx2),2) + Math.pow((cy1-cy2),2); //ignoring square root to reduce computation time\r\n //P1 and P2\r\n double dist = Math.pow((x[0]-x[2]),2) + Math.pow((y[0]-y[2]),2);\r\n if(dist<cdist)\r\n {\r\n cx1 = x[0]; cy1 = y[0]; cx2 = x[2]; cy2 = y[2]; cdist = dist;\r\n }\r\n //P2 and P3\r\n dist = Math.pow((x[1]-x[2]),2) + Math.pow((y[1]-y[2]),2);\r\n if(dist<cdist)\r\n {\r\n cx1 = x[1]; cy1 = y[1]; cx2 = x[2]; cy2 = y[2]; cdist = dist;\r\n }\r\n Point[] closest = {new Point(cx1,cy1), new Point(cx2,cy2)};\r\n return closest;\r\n }\r\n \r\n //sorting based on x values\r\n int i=0;\r\n double z,zz;\r\n while (i < x.length) \r\n \t{\r\n \t\tif (i == 0 || x[i-1] <= x[i])\r\n \t\t\ti++;\r\n \t\telse \r\n \t\t{\r\n \t\t\tz = x[i];\r\n \t\t\tzz = y[i];\r\n \t\t\tx[i] = x[i-1];\r\n \t\t\ty[i] = y[i-1];\r\n \t\t\tx[--i] = z;\r\n \t\t\ty[i] = zz;\r\n \t\t}\r\n \t}\r\n \r\n //finding left closest pair\r\n Point[] closestL = closestPair(Arrays.copyOfRange(x, 0, x.length/2),Arrays.copyOfRange(y, 0, y.length/2));\r\n //finding right closest pair\r\n Point[] closestR = closestPair(Arrays.copyOfRange(x, x.length/2, x.length),Arrays.copyOfRange(y, y.length/2, y.length));\r\n \r\n double distLsq = Math.pow((closestL[0].getX() - closestL[1].getX()),2) + Math.pow((closestL[0].getY() - closestL[1].getY()),2);\r\n double distRsq = Math.pow((closestR[0].getX() - closestR[1].getX()),2) + Math.pow((closestR[0].getY() - closestR[1].getY()),2);\r\n \r\n double minD;\r\n Point[] closest;\r\n if(distLsq<distRsq)\r\n {\r\n minD = distLsq;\r\n closest = closestL;\r\n }\r\n else \r\n {\r\n minD = distRsq;\r\n closest = closestR;\r\n }\r\n \r\n double midLine = ((x[x.length/2-1]) + (x[x.length/2]))/2;\r\n \r\n //System.out.println(Arrays.toString(x));\r\n //System.out.println(\"midline... x = \" + midLine);\r\n \r\n /*looking at points at a horizontal distance of minD from the mid line*/\r\n for(i = 0; i < x.length/2; i++)\r\n {\r\n if(midLine - x[i] < minD)\r\n {\r\n for(int j = x.length/2; j < x.length; j++)\r\n {\r\n /*looking at points at a vertical and horizontal distance of minD from the current point*/\r\n if((x[j] - midLine < minD) && (y[j] - y [i] < minD || y[i] - y [j] < minD))\r\n {\r\n if(Math.pow((x[i] - x[j]),2) + Math.pow((y[i] - y[j]),2) < minD)\r\n {\r\n closest = new Point[]{new Point(x[i],y[i]), new Point(x[j],y[j])};\r\n minD = Math.pow((x[i] - x[j]),2) + Math.pow((y[i] - y[j]),2);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return closest;\r\n \r\n }", "private Position getGoalItemPosition(Set<Item> items) {\n Vector closest = new Vector(0, 0);\n double distance = Double.MAX_VALUE;\n Iterator<Item> it = items.iterator();\n while (it.hasNext()) {\n Item item = it.next();\n Vector center = item.center();\n double currDistance = center.distance(player.center());\n if (currDistance < distance) {\n distance = currDistance;\n closest = center;\n goalItem = item;\n }\n }\n return new Position(closest.x, closest.y);\n }", "private double dynamically_select_epsilon(ArrayList<Point> pointset) {\n\t\tPair closestPair = closest_pair(pointset);\n\n\t\t// Calculate Chebyshev distance between nearest pair\n\t\tdouble distance = chebyshev_distance(closestPair);\n\n\t\t// Divide by 16 to fit 8e box constraint set in Gabe's paper\n\t\treturn distance / 16.0;\n\t}", "protected IgniteBiTuple<Integer, Double> findClosest(Vector[] centers, Vector pnt) {\n double bestDistance = Double.POSITIVE_INFINITY;\n int bestInd = 0;\n\n for (int i = 0; i < centers.length; i++) {\n double dist = distance(centers[i], pnt);\n if (dist < bestDistance) {\n bestDistance = dist;\n bestInd = i;\n }\n }\n\n return new IgniteBiTuple<>(bestInd, bestDistance);\n }", "protected MappedPosition nearestMappedCoordinate(DirectPosition dp,\r\n List <MappedPosition> vertices) {\r\n DirectPosition2D x = new DirectPosition2D(dp);\r\n\r\n // Assert.isTrue(vectors.size() > 0);\r\n MappedPosition nearestOne = (MappedPosition) vertices.get(0);\r\n\r\n for (Iterator <MappedPosition> i = vertices.iterator(); i.hasNext();) {\r\n MappedPosition candidate = (MappedPosition) i.next();\r\n\r\n if (((DirectPosition2D) candidate.getSource()).distance(\r\n x.toPoint2D()) < ((DirectPosition2D) nearestOne\r\n .getSource()).distance(x.toPoint2D())) {\r\n nearestOne = candidate;\r\n }\r\n }\r\n\r\n return nearestOne;\r\n }", "public double getPositionToP3()\r\n\t{\r\n\t\tdouble max = 0;\r\n\t\tfor(Unit u : units)\r\n\t\t{\r\n\t\t\tif(u instanceof Gate)\r\n\t\t\t\tcontinue;\r\n\t\t\tdouble d = u.getPositionAlongCurve() + u.getRadius()/owner.getLength();\r\n\t\t\tif(d > max)\r\n\t\t\t\tmax = d;\r\n\t\t}\r\n\t\tif(max < 0)\r\n\t\t\tmax = 0;\r\n\t\tif(max > 1)\r\n\t\t\tmax = 1;\r\n\t\treturn 1 - max;\r\n\t}", "public double getClosestDistance(){\n\t\t\tdouble distance;\n\t\t\tdouble distanceMin = Double.MAX_VALUE;\n\t\t\tPoint centroid = centroid();\n\t\t\tfor(Point p : clusterPointsList){\n\t\t\t\tdistance = p.dist(centroid);\t\t\t\n\t\t\t\tif(distance < distanceMin){\n\t\t\t\t\tdistanceMin = distance;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn distanceMin;\n\t\t}", "public ArrayList<Record> near()\n {\n int count = 0;\n ArrayList<Record> closest = new ArrayList<>();\n System.out.println(\"Community Centres that are 5km or less to your location are: \");\n for(Record i: cCentres)\n {\n //latitude and longitude for each centre\n double lat2 = Double.parseDouble(i.getValue(4));\n double lon2 = Double.parseDouble(i.getValue(3));\n ;\n //distance\n double dist = calcDist(lat2, lon2, cCentres);\n if(dist<=5)\n {\n System.out.println(i + \", Distance: \" + dist + \" km\");\n closest.add(i);\n }\n }\n return closest;\n }", "private int findMaxPt(ArrayList<Point> s, Point p1, Point p2) {\n double maxPt = 0;\n int maxIndex = 0;\n for(int i = 1; i < s.size()-2; i++){\n if(p1.x*p2.y + s.get(i).x*p1.y + p2.x*s.get(i).y - s.get(i).x*p2.y - p2.x*p1.y - p1.x*s.get(i).y > maxPt) {\n maxPt = p1.x*p2.y + s.get(i).x*p1.y + p2.x*s.get(i).y - s.get(i).x*p2.y - p2.x*p1.y - p1.x*s.get(i).y;\n maxIndex = i;\n }\n }\n return maxIndex;\n }", "static int minimumDistances(int[] a) {\n int l = a.length;\n Map<Integer, List<Integer>> map = new HashMap<>();\n for (int i = 0; i <l ; i++) {\n List<Integer> val = map.get(a[i]);\n if(val == null){\n val = new ArrayList<>();\n }\n val.add(i);\n map.put(a[i], val);\n }\n int min = Integer.MAX_VALUE;\n for (List<Integer> value:\n map.values()) {\n int c = value.size();\n if(c>1){\n for (int i = 0; i < c-1 ; i++) {\n min = Math.min(min, value.get(i+1)- value.get(i));\n }\n }\n }\n if(min == Integer.MAX_VALUE) min = -1;\n return min;\n\n\n }", "public Resource findNearestResource(){\n\t\tResource nearestResource = null;\n\t\tfloat distanceToCurrentResource = 0f;\n\t\tfor (Resource resource : MapData.getInstance().getResources()) {\n\t\t\tif(resource.isResourceMaxed()) continue;\n\t\t\tif (resource.getCenter().dst2(getCenter()) < 4000000) {\n\t\t\t\tif (nearestResource == null) {\n\t\t\t\t\tnearestResource = resource;\n\t\t\t\t\tdistanceToCurrentResource = nearestResource\n\t\t\t\t\t\t\t.getCenter().dst2(this.getCenter());\n\t\t\t\t} else {\n\t\t\t\t\tfloat distanceToNewResource = resource.getCenter()\n\t\t\t\t\t\t\t.dst2(this.getCenter());\n\t\t\t\t\tnearestResource = (distanceToNewResource < distanceToCurrentResource) ? resource\n\t\t\t\t\t\t\t: nearestResource;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn nearestResource;\n\t}", "private PanImageEntry findPanImageEntryClosestToCenter() {\n\t\tfindProjectedZs();\n\t\t\n\t\tPanImageEntry closestEntry = null;\n\t\tfor (int n=0; n<panImageList.length; n++) {\n\t\t\tPanImageEntry entry = panImageList[n];\n\t\t\tif (entry.draw) {\n\t\t\t\tif (closestEntry == null) {\n\t\t\t\t\tclosestEntry = entry;\n\t\t\t\t}\n\t\t\t\telse if (entry.projectedZ > closestEntry.projectedZ) {\n\t\t\t\t\tclosestEntry = entry;\n\t\t\t\t}\n\t\t\t\telse if (entry.projectedZ == closestEntry.projectedZ) {\n\t\t\t\t\tif (isSuperiorImageCat(entry.imageListEntry.getImageCategory(), closestEntry.imageListEntry.getImageCategory())) {\n\t\t\t\t\t\tclosestEntry = entry;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (selectedPanImageEntry != null) {\n\t\t\tdouble dAz = closestEntry.imageListEntry.getImageMetadataEntry().inst_az_rover - \n\t\t\tselectedPanImageEntry.imageListEntry.getImageMetadataEntry().inst_az_rover;\n\t\t\tdouble dEl = closestEntry.imageListEntry.getImageMetadataEntry().inst_el_rover - \n\t\t\tselectedPanImageEntry.imageListEntry.getImageMetadataEntry().inst_el_rover;\n\t\t\tif ((selectedPanImageEntry.imageListEntry.getImageMetadataEntry().inst_el_rover < -85.0 \n\t\t\t\t\t&& closestEntry.imageListEntry.getImageMetadataEntry().inst_el_rover < 85.0)\n\t\t\t\t\t|| (selectedPanImageEntry.imageListEntry.getImageMetadataEntry().inst_el_rover > 85\n\t\t\t\t\t\t&& closestEntry.imageListEntry.getImageMetadataEntry().inst_el_rover > 85)\t\n\t\t\t\t\t) {\n\t\t\t\t// this is a fix because the distance computation doesn't work right at high or low elevations...\n\t\t\t\t// in fact, the whole thing is pretty messed up\n\t\t\t\tclosestEntry = selectedPanImageEntry;\t\t\t\t\n\t\t\t}\n\t\t\telse if ((Math.abs(dAz) < selectTolerance) && (Math.abs(dEl) < selectTolerance)) {\n\t\t\t\tclosestEntry = selectedPanImageEntry;\n\t\t\t}\n\t\t}\n\t\treturn closestEntry;\n\t}", "public int getMaximumPoints();", "private Point calcLocation(String tagID){\t\t\t\n\t\tDate now = new Date();\n\t\tclass referenceDist implements Comparable<referenceDist>{\n\t\t\tString referenceID;\n\t\t\tDouble inverseDistance;\n\t\t\t\n\t\t\tpublic referenceDist(String id, double distance){\n\t\t\t\tthis.referenceID = id;\n\t\t\t\tthis.inverseDistance = new Double(distance);\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic int compareTo(referenceDist o) {\n\t\t\t\t\n\t\t\t\treturn o.inverseDistance.compareTo(this.inverseDistance);\n\t\t\t}\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tArrayList<referenceDist> referenceList = new ArrayList<referenceDist>();\t\t\n\t\tfor (int i = 0 ; i < (referenceTags.size()); i++){\n\t\t\tString referenceID = referenceTags.get(i);\n\t\t\t//System.err.printf(\"Comparing tag %s with readings: %s\\r\\n\", tagID, tags.get(tagID).toString());\n\t\t\tint distance = tags.get(tagID).calcDiff(tags.get(referenceID));\n\t\t\t//System.err.printf(\"Reference tag %s with readings: %s\\r\\n\", referenceID, tags.get(referenceID).toString());\n\t\t\tdouble power = 0;\n\t\t\tif (distance == 0){\n\t\t\t\tpower = 10;\n\t\t\t} else {\n\t\t\t\tpower = 1.0/distance;\n\t\t\t}\n\t\t\t\n\t\t\treferenceList.add(new referenceDist(referenceID, power));\n\t\t}\n\t\t\n\t\tCollections.sort(referenceList);\n//\t\tIterator<referenceDist> iter = referenceList.iterator();\n//\t\tSystem.out.printf(\"START\\r\\n\");\n//\t\twhile(iter.hasNext()){\n//\t\t\treferenceDist dist = iter.next();\n//\t\t System.out.printf(\"'%s : %s'\", dist.referenceID, dist.inverseDistance.toString());\n//\t\t}\n//\t\tSystem.out.printf(\"\\r\\nEND\\r\\n\");\n\t\tint neighbours = Math.min(maxNeighbours, referenceList.size());\n\t\tdouble total = 0;\n\t\tdouble x = 0;\n\t\tdouble y = 0;\n\t\tdouble diff = 0;\n\t\tfor (int i = 1; i <= neighbours; i++){\n\t\t\ttotal += referenceList.get(i).inverseDistance;\n\t\t}\n\t\tfor (int i = 1; i <= neighbours; i++){\n\t\t\tPoint current = tags.get(referenceList.get(i).referenceID).getLoc();\n\t\t\tx += (referenceList.get(i).inverseDistance / total) * current.getX();\n\t\t\ty += (referenceList.get(i).inverseDistance / total) * current.getY();\n\t\t}\n\t\tif (tagID.equals(\"03BD\")){\n\t\t\tdiff = Math.sqrt(Math.pow((x-345),2) + Math.pow((y-200),2));\n\t\t} else if (tagID.equals(\"03B8\")){\n\t\t\tdiff = Math.sqrt(Math.pow((x-345),2) + Math.pow((y-300),2));\n\t\t} else if (tagID.equals(\"03D3\")){\n\t\t\tdiff = Math.sqrt(Math.pow((x-345),2) + Math.pow((y-400),2));\n\t\t}\n\t\tlog(String.valueOf(diff)+ \"\\r\\n\", tagID+ \"_4.log\");\t\t\n\t\t\t\n\n\t\tPoint location = new Point((int )x, (int)y);\n\t\tlog(String.valueOf(now.getTime()) + \"\\r\\n\", \"time.log\");\t\t\t\n\n\t//\tlog(String.valueOf(now.getTime()) + \": Tag=\"+ tagID + \" x=\" + String.valueOf(x) + \" y=\"+String.valueOf(y)+\"\\r\\n\", \"tagLocationLogfile.log\");\n\t\t\n\t\treturn location;\n\t}", "public int[][] kClosest3(int[][] points, int K) {\n Arrays.sort(points, (w1, w2) ->\n (w2[0]*w2[0] + w2[1]*w2[1]) - (w1[0]*w1[0] + w1[1]*w1[1]));\n\n return Arrays.copyOfRange(points, 0, K);\n }", "public Coordinates closestPoint() {\n return closestPoint;\n }", "long closest(double lon, double lat) {\n double closet = Double.MAX_VALUE;\n long vertex = 0;\n\n for (Long v : vertices()) {\n double nodeLon = getNode(v).Lon;\n double nodeLat = getNode(v).Lat;\n double lonDist = nodeLon - lon;\n double latDist = nodeLat - lat;\n double dist = Math.sqrt(lonDist * lonDist + latDist * latDist);\n if (dist < closet) {\n vertex = v;\n closet = dist;\n }\n }\n return vertex;\n }", "private float findDistance(Balloon balloons) {\r\n\t\tfloat xDistance = Math.abs(balloons.getX() - x);\r\n\t\tfloat yDistance = Math.abs(balloons.getY() - y);\r\n\t\treturn xDistance + yDistance;\r\n\t}", "public static Location locateLargest(double[][] a){\n Location answer = new Location(a);\n return answer;\n }", "long closest(double lon, double lat) {\n return kdTreeForNearestNeighbor.nearest(lon, lat);\n }", "double rightmost_alien_x() {\n double max_x = 0;\n for (Alien alien : aliens) {\n if (alien.x_position > max_x) {\n max_x = alien.x_position;\n }\n }\n return max_x;\n }", "private double distance (double lata, double lona, double latb, double lonb) { \r\n return Math.acos(Math.sin(lata)*Math.sin(latb)+Math.cos(lata)*Math.cos(latb)*Math.cos(lonb-lona))*6371;\r\n }", "private double getNearestAEnergy() {\n\t\tdouble value = getInitialEnergy();\n\t\tdouble ret = value;\n\t\twhile (value < getaEnergy()) {\n\t\t\tdouble step = getPreEdgeStep();\n\t\t\t// avoid infinite loop\n\t\t\tif (step <= 0.0)\n\t\t\t\tstep = 1.0;\n\t\t\tvalue += step;\n\t\t\tif (value > getaEnergy())\n\t\t\t\tbreak;\n\t\t\tret = value;\n\t\t}\n\t\treturn ret;\n\t}", "protected static Marker getLowestPoint(List<Marker> points) {\n\n Marker lowest = points.get(0);\n\n for(int i = 1; i < points.size(); i++) {\n\n Marker temp = points.get(i);\n\n if(temp.getPosition().latitude < lowest.getPosition().latitude || (temp.getPosition().latitude == lowest.getPosition().latitude && temp.getPosition().longitude < lowest.getPosition().longitude)) {\n lowest = temp;\n }\n }\n\n return lowest;\n }", "private int getNearestNode(LatLng vic) {\n\t\tint node = 0;\n\t\tfor(int j=0; j<nodeList.size()-1; j++){\n\t\t\tdouble dist1 = getWeight(vic, nodeList.get(node));\n\t\t\tdouble dist2 = getWeight(vic, nodeList.get(j));\n\t\t\tif(dist1 > dist2){\n\t\t\t\tnode = j;\n\t\t\t}\n\t\t}\n\t\treturn node;\n\t}", "private Cluster getNearestCluster(BasicEvent event) {\n float minDistance = Float.MAX_VALUE;\n Cluster closest = null;\n float currentDistance = 0;\n for (Cluster c : clusters) {\n float rX = c.radiusX;\n float rY = c.radiusY; // this is surround region for purposes of dynamicSize scaling of cluster size or aspect ratio\n if (dynamicSizeEnabled) {\n rX *= surround;\n rY *= surround; // the event is captured even when it is in \"invisible surround\"\n }\n float dx, dy;\n if ((dx = c.distanceToX(event)) < rX && (dy = c.distanceToY(event)) < rY) { // needs instantaneousAngle metric\n currentDistance = dx + dy;\n if (currentDistance < minDistance) {\n closest = c;\n minDistance = currentDistance;\n c.distanceToLastEvent = minDistance;\n c.xDistanceToLastEvent = dx;\n c.yDistanceToLastEvent = dy;\n }\n }\n }\n return closest;\n }", "public Point centeroid ()\r\n {\r\n return new Point ((v1.getX()+v2.getX()+v3.getX())/3,(v1.getY()+v2.getY()+v3.getY())/3);\r\n }", "public MapLocation findNearestArchon() {\n MapLocation origin = rc.getLocation();\n MapLocation nearestAction = null;\n float nearestDistance = 9999f;\n\n for (int i = 0; i < enemyArchonCount; ++i) {\n ArchonLocation loc = archonLocations[i];\n if (loc.isDead()) continue;\n float distance = loc.location.distanceSquaredTo(origin);\n if (nearestAction == null || distance < nearestDistance) {\n nearestAction = loc.location;\n nearestDistance = distance;\n }\n }\n\n return nearestAction;\n }", "int findVertex(Point2D.Float p) {\n double close = 5*scale;\n for (int i = 0; i < points.size(); ++i) {\n if (points.get(i).distance(p) < close) {\n return i;\n }\n }\n return -1;\n }", "public Point2D nearest(Point2D p) {\n if (p == null) {\n throw new IllegalArgumentException();\n }\n if (isEmpty()) return null;\n\n Point2D nearestPoint = null;\n double distance = Double.NEGATIVE_INFINITY;\n for (Point2D point : points) {\n if (nearestPoint == null) {\n nearestPoint = point;\n distance = point.distanceSquaredTo(p);\n } else {\n double newDistance = point.distanceSquaredTo(p);\n if (newDistance < distance) {\n nearestPoint = point;\n distance = newDistance;\n }\n }\n }\n return nearestPoint;\n }", "public Id GetNearestNode(Coordinate coord, int cz){\n\t\tfloat distsq = Float.MAX_VALUE;\n\t\tfloat cx = coord.getX();\n\t\tfloat cy = coord.getY();\n\t\tId nearest = null;\n\t\tfor(Node n : listOfNodes){\n\t\t\tif(n == null) continue;\n\t\t\tfloat mx = n.getCoordinate().getX() - cx;\n\t\t\tfloat my = n.getCoordinate().getY() - cy;\n\t\t\tfloat mz = n.getCoordinate().getZ() - cz;\n\t\t\tfloat mydistsq = mx * mx + my * my;\n\t\t\tif(mydistsq < distsq && mz == 0){\n\t\t\t\tdistsq = mydistsq;\n\t\t\t\tnearest = n.getId();\n\t\t\t}\n\t\t}\n\t\treturn nearest;\n\t}", "public int threeSumClosest(int[] A, int B) {\n Arrays.sort(A);\n int n = A.length;\n int closest = Integer.MAX_VALUE;\n int temp =0 ;\n for(int i=0 ; i<n-2;i++)\n {\n int sec = i+1;\n int thr = n-1;\n while(sec < thr) // need to find all poss triplet for a part i.\n {\n int sum = A[i] + A[sec] + A[thr];\n if(Math.abs(sum-B) ==0) return B; // closest sum ever ie. equal to B\n if(Math.abs(sum-B) < closest) // we want sum closest to target. so best way is to check whose differnce is lesser.\n {\n closest=Math.abs(sum-B);\n temp=sum;\n }\n\n // two ptr\n if(sum > B) // need to decrease sum - >lower down the high ptr\n thr--;\n\n else\n sec++;\n }\n }\n return temp;\n }", "public Point2D nearest(Point2D p) \r\n\t{\r\n\t\treturn nearest(p, null, root, new RectHV(0,0,1,1));\r\n\t}", "private Point[] nearestPairRec(Point[] range, boolean axis) {\n\t\t\tPoint[] Answer = new Point[2];\n\t\t\tif (range.length < 4) return nearestPair3Points(range);\n\t\t\tPoint[] MinPointsLeft = new Point[2];\n\t\t\tPoint[] MinPointsRight = new Point[2];\n\t\t\tPoint[] MinPointsInStrip = new Point[2];\n\t\t\tdouble MinDistance = -1; //it will be change for sure, because we pass the array only if it containes 4 points and above.\n\t\t\tdouble MinDistanceInStrip;\n\t\t\t//step 4\n\t\t\tif (axis){\n\t\t\t\tMinPointsLeft = nearestPairRec(getPointsInRangeRegAxis(range[0].getX(), range[(range.length)/2].getX(), axis), axis);\n\t\t\t\tMinPointsRight =nearestPairRec(getPointsInRangeRegAxis(range[((range.length)/2)+1].getX(), range[range.length-1].getX() ,axis), axis);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tMinPointsLeft = nearestPairRec(getPointsInRangeRegAxis(range[0].getY(), range[(range.length)/2].getY(), axis), axis);\n\t\t\t\tMinPointsRight =nearestPairRec(getPointsInRangeRegAxis(range[((range.length)/2)+1].getY(), range[range.length-1].getY() ,axis), axis);\n\t\t\t}\n\t\t\t//step 5\n\t\t\tif (MinPointsLeft!=null && MinPointsRight!=null){\n\t\t\t\tif (Distance(MinPointsLeft[0], MinPointsLeft[1]) > Distance(MinPointsRight[0], MinPointsRight[1])){\n\t\t\t\t\tMinDistance = Distance(MinPointsRight[0], MinPointsRight[1]);\n\t\t\t\t\tAnswer = MinPointsRight;\n\t\t\t\t}else{\n\t\t\t\t\tMinDistance = Distance(MinPointsLeft[0], MinPointsLeft[1]);\n\t\t\t\t\tAnswer = MinPointsLeft;\n\t\t\t\t}\n\t\t\t}else if (MinPointsLeft!=null && MinPointsRight==null) {\n\t\t\t\tMinDistance = Distance(MinPointsLeft[0], MinPointsLeft[1]);\n\t\t\t\tAnswer = MinPointsLeft;\n\t\t\t}else if (MinPointsRight!=null && MinPointsLeft==null){\n\t\t\t\tMinDistance = Distance(MinPointsRight[0], MinPointsRight[1]);\n\t\t\t\tAnswer = MinPointsRight;\n\t\t\t}\n\t\t\t//step 6 find the nearest point around the median\n\t\t\tint upper;\n\t\t\tint lower;\n\t\t\tif (MinDistance==-1) MinDistance = 0;\n\t\t\tif (axis){\n\t\t\t\tupper = (int) (range[(range.length)/2].getX()+MinDistance);\n\t\t\t\tlower = (int) (range[(range.length)/2].getX()-MinDistance);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tupper = (int) (range[(range.length)/2].getY()+MinDistance);\n\t\t\t\tlower = (int) (range[(range.length)/2].getY()-MinDistance);\n\t\t\t}\n\t\t\trange = getPointsInRangeOppAxis(lower, upper, axis);\n\t\t\tif (range.length>=2) MinPointsInStrip = nearestPointInArray(range);\n\t\t\tif (MinPointsInStrip[0]!=null){\n\t\t\t\tMinDistanceInStrip = Distance(MinPointsInStrip[0], MinPointsInStrip[1]);\n\t\t\t\tif (MinDistanceInStrip < MinDistance) return MinPointsInStrip;\n\t\t\t}\n\t\t\treturn Answer;\n\t\t}", "public static double closestDistance2(Point[] points) {\n double closest = points[0].distance(points[1]);\n for (int i = 0; i < points.length; i++) {\n for (int j = i + 1; j < points.length; j++) {\n double dist = points[i].distance(points[j]);\n closest = Math.min(closest, dist);\n }\n }\n return closest;\n }", "public Node closestPrecedingNode(int id);", "public static void main(String[] args) {\n //[-1,2,1,-4]\n //1\n //[1,2,4,8,16,32,64,128]\n //82\n //[-1,2,1,-4]\n //1\n ThreeSumClosest tsc = new ThreeSumClosest();\n int[] nums = {0,2,1,-3};\n System.out.println(tsc.threeSumClosest(nums , 1));\n\n }", "public Set<? extends Position> findNearest(Position position, int k);", "private static void findClosestElement(int[] a, int element) {\n int low = 0, high = a.length - 1;\n\n\n // Corner cases\n if (a[high] < element) {\n System.out.println(a[high]);\n return;\n }\n\n if (element < a[low]) {\n System.out.println(a[low]);\n return;\n }\n\n while (low <= high) {\n\n int mid = low + (high - low) / 2;\n\n // element == mid\n if (a[mid] == element) {\n\n int leftDiff = Integer.MAX_VALUE;\n int rightDiff = Integer.MAX_VALUE;\n\n if (mid > 0) {\n leftDiff = element - a[mid - 1];\n }\n\n if (mid < a.length - 1) {\n rightDiff = a[mid + 1] - element;\n }\n\n\n if (leftDiff != Integer.MAX_VALUE && leftDiff < rightDiff) {\n System.out.println(a[mid - 1]);\n } else if (rightDiff != Integer.MAX_VALUE) {\n System.out.println(a[mid + 1]);\n }\n return;\n }\n\n // element < mid\n if (element < a[mid]) {\n\n if (low <= mid - 1 && a[mid - 1] < element) { // Cross over point is mid-1 to mid\n System.out.println(getClosest(element, a[mid - 1], a[mid]));\n return;\n } else\n high = mid;\n } else {\n if (mid + 1 <= high && element < a[mid + 1]) { // Cross over point is mid to mid+1\n System.out.println(getClosest(element, a[mid], a[mid + 1]));\n return;\n } else\n low = mid + 1;\n }\n }\n\n }", "Point getRandomPoint() {\n\t\t\t\t\tdouble val = Math.random() * 3;\n\t\t\t\t\tif (val >=0.0 && val <1.0)\n\t\t\t\t\t\treturn p1;\n\t\t\t\t\telse if (val >=1.0 && val <2.0)\n\t\t\t\t\t\t\treturn p2;\n\t\t\t\t\telse\n\t\t\t\t\t\t\treturn p3;\n\t\t\t\t\t}", "public Point getClosestPoint(Point p) {\n\t\t// If the node is not diveded and there are no points then we \n\t\t// cant return anything\n\t\tif (!divided && points.keySet().size() == 0) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// Loop through all the points and find the one that is the\n\t\t// closest to the point p\n\t\tdouble smallestDistance = Double.MAX_VALUE;\n\t\tPoint closest = null;\n\t\t\n\t\tfor (Point c : points.keySet()) {\n\t\t\tif (closest == null) {\n\t\t\t\tclosest = c;\n\t\t\t\tsmallestDistance = p.distance(c);\n\t\t\t} else if (p.distance(c) < smallestDistance) {\n\t\t\t\tsmallestDistance = p.distance(c);\n\t\t\t\tclosest = c;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn closest;\n\t}", "@Override\n protected int selectNextClusterIndex(\n final double[] minDistances,\n final boolean[] selected)\n {\n double maxMinDistance = Double.MAX_VALUE;\n int maxIndex = 0;\n\n final int elementCount = minDistances.length;\n for (int i = 0; i < elementCount; i++)\n {\n if (selected[i])\n {\n // Skip clusters we've already selected.\n continue;\n }\n\n // Get the current minimum distance for the element.\n double minDistance = minDistances[i];\n\n if (maxIndex == 0 || minDistance > maxMinDistance)\n {\n // This is the minium seen so far, so keep track of\n // it.\n maxIndex = i;\n maxMinDistance = minDistance;\n }\n }\n\n if (maxMinDistance <= 0.0)\n {\n // There are not enough points to prevent selecting two\n // that are on top of each other.\n return -1;\n }\n else\n {\n return maxIndex;\n }\n }", "public double getFurthermostDistance(){\n\t\t\tdouble distance;\n\t\t\tdouble distanceMax = 0.0;\n\t\t\tPoint centroid = centroid();\n\t\t\tfor(Point p : clusterPointsList){\n\t\t\t\tdistance = p.dist(centroid);\t\t\t\n\t\t\t\tif(distance > distanceMax){\n\t\t\t\t\tdistanceMax = distance;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn distanceMax;\n\t\t}", "public int shortestBridge(int[][] A) {\n for(int i = 0; i < A.length && !found; i++) {\n for(int j = 0; j < A[0].length && !found; j++) {\n if(A[i][j] == 1) {\n helper(A, i, j);\n found = true;\n }\n }\n }\n // Put all '2' into queue as candidate initial start points\n Queue<int[]> q = new LinkedList<int[]>();\n for(int i = 0; i < A.length; i++) {\n for(int j = 0; j < A[0].length; j++) {\n if(A[i][j] == 2) {\n q.offer(new int[] {i, j});\n }\n }\n }\n int distance = 0;\n while(!q.isEmpty()) {\n int size = q.size();\n for(int i = 0; i < size; i++) {\n int[] cur = q.poll();\n for(int j = 0; j < 4; j++) {\n int new_x = cur[0] + dx[j];\n int new_y = cur[1] + dy[j];\n if(new_x >= 0 && new_x < A.length && new_y >= 0 && new_y < A[0].length) {\n if(A[new_x][new_y] == 1) {\n return distance;\n } else if(A[new_x][new_y] == 0) {\n // Update from 0 to 2 which means expand first island boundary\n // which also avoid using visited to check\n A[new_x][new_y] = 2;\n q.offer(new int[] {new_x, new_y});\n }\n }\n }\n }\n distance++;\n }\n return distance;\n }", "private int annaEtaisyys(int x1, int y1, int x2, int y2)\n\t{\n\t\tdouble a = x1 - x2;\n\t\tdouble b = y1 - y2;\n\t\t\n\t\treturn (int) Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2));\n\t}", "public Vector2 getAnchorA(Vector2 out_a) {\n float[] floats4 = getFloats4();\n JniConstraintType.pinJointGetAnchorA(nativeAddress, floats4);\n return out_a.set(floats4[0], floats4[1]);\n }" ]
[ "0.61878496", "0.58817744", "0.580779", "0.566227", "0.5630367", "0.5605174", "0.5602393", "0.55880713", "0.55682623", "0.55344236", "0.55286413", "0.55230755", "0.55149126", "0.55052716", "0.54715765", "0.5437966", "0.54154545", "0.5411211", "0.5371219", "0.53674966", "0.5359819", "0.53343177", "0.528618", "0.5251044", "0.52239037", "0.5211668", "0.5208193", "0.51901525", "0.5182776", "0.51750696", "0.5171339", "0.51683074", "0.5153922", "0.51445925", "0.5136573", "0.5096261", "0.50828403", "0.5077802", "0.5074015", "0.5072131", "0.5062677", "0.5061634", "0.5061228", "0.5059298", "0.50540125", "0.5052078", "0.50445634", "0.5042154", "0.5034544", "0.5024964", "0.5020937", "0.50143343", "0.50140786", "0.50102574", "0.5007137", "0.498701", "0.49847353", "0.49791935", "0.4978795", "0.49761644", "0.4974244", "0.4968275", "0.49560532", "0.49331936", "0.49296945", "0.49208122", "0.49160525", "0.49056742", "0.49049035", "0.48885334", "0.48855814", "0.48678192", "0.48667446", "0.48627585", "0.4853403", "0.4853127", "0.4833334", "0.4826804", "0.48266032", "0.48234552", "0.48234135", "0.48198667", "0.48189536", "0.48162514", "0.48094118", "0.48077688", "0.48070484", "0.4802936", "0.47995892", "0.47983477", "0.47971308", "0.47965345", "0.4787862", "0.4787841", "0.47859296", "0.47709176", "0.47664273", "0.47651884", "0.47623393", "0.47617802" ]
0.6021589
1
Get all the fotografias.
Page<Fotografia> findAll(Pageable pageable);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@GET\n @Path(\"/mostrarOrdenadasFS\")\n @Produces({\"application/json\"})\n public List<Fotografia> fotoUsuarioOrdenadaFS(){\n int idUser = 1;\n return fotografiaEJB.FotoUsuarioOrdenadasFS(idUser);\n }", "@GetMapping(\"/familles\")\n public List<FamilleDTO> getAllFamilles() {\n log.debug(\"REST request to get all Familles\");\n return familleService.findAll();\n }", "@GET\n @Path(\"/mostrarOrdenadasFT\")\n @Produces({\"application/json\"})\n public List<Fotografia> fotoUsuarioOrdenadaFT(){\n int idUser = 1;\n return fotografiaEJB.FotoUsuarioOrdenadasFT(idUser);\n }", "@Override\n\tpublic List<Provincia> fiindAll() {\n\t\treturn provincieRepository.findAllByOrderByNameAsc();\n\t}", "public List<Filme> listar() {\r\n\r\n //Pegando o gerenciador de acesso ao BD\r\n EntityManager gerenciador = JPAUtil.getGerenciador();\r\n\r\n //Criando a consulta ao BD\r\n TypedQuery consulta = gerenciador.createQuery(\r\n \"Select f from Filme f\", Filme.class);\r\n\r\n //Retornar a lista de atores\r\n return consulta.getResultList();\r\n\r\n }", "public ArrayList<Fila> listarFilas() throws IOException{\n\t\treturn dao.listarFilas();\n\t}", "public List<Factura> getAllFacturas(){\n return facturaFacade.findAll();\n }", "@Override\r\n\tpublic List<Factura> findAllFacturas() {\n\t\ttry {\r\n\t\t\treturn facturaDao.findAllFacturas();\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "@Override\n\tpublic List<Factura> findAllFacturas() {\n\t\treturn facturaDao.findAll();\n\t}", "@Override\n\tpublic ArrayList<VOFactura> getAllFacturas() {\n\t\t\n\t\tDBConnection con = null;\n\t\tStatement stm = null;\n\t\tString sql = null;\n\t\tResultSet res = null;\n\t\t\n\t\tVOFactura factura;\n\t\tArrayList<VOFactura> listaFacturas = new ArrayList<VOFactura>();\n\t\t\n\t\t try {\n\t\t\tcon = new DBConnection(\"root\",\"walkirias84\");\n\t\t\tstm = con.getConnection().createStatement();\n\t\t\tsql = \"SELECT * FROM factura fac ORDER BY fac.facnumero\";\n\t\t\tres = stm.executeQuery(sql);\n\t\t\t\n\t\t\twhile(res.next()) {\n\t\t\t\tfactura = new VOFactura();\n\t\t\t\tfactura.setId(res.getInt(1));\n\t\t\t\tfactura.setNumero(res.getInt(2));\n\t\t\t\tfactura.setIdCliente(res.getInt(3));\n\t\t\t\tCalendar fecha = Calendar.getInstance();\n\t\t\t\tfecha.setTimeInMillis(res.getDate(4).getTime());\n\t\t\t\tfactura.setFecha(fecha);\n\t\t\t\tfactura.setValorNeto(res.getBigDecimal(5));\n\t\t\t\tfactura.setValorIva(res.getBigDecimal(6));\n\t\t\t\tfactura.setValorTotal(res.getBigDecimal(7));\n\t\t\t\t\n\t\t\t\tlistaFacturas.add(factura);\n\t\t\t}\n\t\t\t\n\t\t\treturn listaFacturas;\n\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(e);\n\t\t} finally {\n\t if (res != null) try { res.close(); } catch (SQLException logOrIgnore) {}\n\t if (stm != null) try { stm.close(); } catch (SQLException logOrIgnore) {}\n\t if (con != null) try { con.getConnection().close(); } catch (SQLException logOrIgnore) {}\n\t }\n\t\t\n\t\treturn null;\n\t}", "@Override\n\tpublic List<Fournisseur> findAll() {\n\t\treturn null;\n\t}", "@Override\n\tpublic List<Factura> findAll() {\n\t\treturn facturaRepository.findAll();\n\t}", "public static List<Fattura> tutteLeFatture() {\n\t\tEntityManager em = JPAUtil.getInstance().getEmf().createEntityManager();\n\t\tList<Fattura> _return = em.createQuery(\"SELECT f FROM Fattura f\", Fattura.class).getResultList();\n\t\tem.close();\n\t\treturn _return;\n\t}", "public List<FacturaEntity> getFacturas() {\n LOGGER.info(\"Inicia proceso de consultar todos los facturas\");\n List<FacturaEntity> factura = facturaPersistence.findAll();\n LOGGER.info(\"Termina proceso de consultar todos los facturas\");\n return factura;\n }", "@Override\r\n public List<Filme> getListaFilmes(){\r\n return listaFilme;\r\n }", "public List<ArticulosFactura> getArticulosFactura(Factura f){\n return f.getArticulosFacturaList();\n }", "public List<Fuente> obtenerListaFuentes() {\n\t\tString etiqueta = \"\";\n\t\tint id = 0;\n\t\tList<Fuente> listaFuentes = new ArrayList<Fuente>();\n\n\t\ttry {\n\n\t\t\trs = stmt.executeQuery(\"SELECT IDFUENTE, NOMBRE FROM FUENTE\");\n\t\t\twhile (rs.next()) {\n\n\t\t\t\tid = rs.getInt(\"IDFUENTE\");\n\t\t\t\tetiqueta = rs.getString(\"NOMBRE\");\n\t\t\t\tFuente f = new Fuente(etiqueta, id, \"\", \"\");\n\t\t\t\tlistaFuentes.add(f);\n\n\t\t\t}\n\n\t\t} catch (SQLException e) {\n\t\t\tSystem.err.println(\"No es posible recuperar la lista de fuentes\");\n\n\t\t}\n\n\t\treturn listaFuentes;\n\t}", "public ArrayList<Film> displayAllFilms() {\n return filmEdit.displayAllFilms();\n }", "@Override\n public ArrayList<byte[]> getFotografias(String id) throws SQLException {\n ArrayList<byte[]> resultado = new ArrayList<byte[]>();\n resultado = (ArrayList<byte[]>) bdPropiedad.getFotografias(id);\n return resultado;\n }", "public ArrayList<Fichier> getFichierAll() throws SQLException {\n\t\tString query = SQLQueries.GET_FICHIER_ALL_QUERY;\n\t\tResultSet rs = null;\n\t\tArrayList<Fichier> fichiers = new ArrayList<Fichier>();\n\t\ttry {\n\t\t\tconnection = Connector.getConnection();\n\t\t\tstatement = connection.createStatement();\n\t\t\trs = statement.executeQuery(query);\n\t\t\twhile (rs.next()) {\n\t\t\t\tFichier fichier = new Fichier();\n\t\t\t\tfichier.setNom_fichier(rs.getString(\"nom_fichier\"));\n\t\t\t\tfichier.setDate_fichier(rs.getDate(\"date_fichier\"));\n\t\t\t\tfichier.setCommentaire(rs.getString(\"commentaire\"));\n\t\t\t\tfichier.setId_matiere(rs.getInt(\"id_matiere\"));\n\t\t\t\tfichier.setFichier(rs.getBytes(\"fichier\"));\n\t\t\t\tfichiers.add(fichier);\n\t\t\t}\n\t\t} finally {\n\t\t\tif (statement != null)\n\t\t\t\tstatement.close();\n\t\t\tif (rs != null)\n\t\t\t\trs.close();\n\t\t\tconnection.close();\n\t\t}\n\t\treturn fichiers;\n\t}", "@Override\r\n\tpublic List<Fournisseur> getListFournisseur() {\n\t\treturn this.sessionFactory.getCurrentSession().createQuery(\"from fournisseur\").list();\r\n\t}", "@Override\r\n\tpublic List<Film> findAllFilms() {\n\t\treturn filmRepository.findAll();\r\n\t}", "@Override\n @Transactional(readOnly = true)\n public List<FonctionsDTO> findAll() {\n log.debug(\"Request to get all Fonctions\");\n return fonctionsRepository.findAll().stream()\n .map(fonctionsMapper::toDto)\n .collect(Collectors.toCollection(LinkedList::new));\n }", "public List<Campeonato> getAllCampeonato(){\n\t\treturn new ArrayList<Campeonato>();\n\t}", "private List<RhFuncionario> getFuncionariosMedicos()\n {\n System.out.println(\"supiEscalaFacade.findMedicos():\"+supiEscalaFacade.findMedicos());\n return supiEscalaFacade.findMedicos();\n }", "public List<Filme> getAll(String filtro) throws SQLException {\r\n\t\tString sql = \"SELECT F.*, G.Descricao as genero FROM filme F\"\r\n\t\t\t\t+ \" JOIN genero G on f.idGenero = g.idGenero \";\r\n\r\n\t\tif (filtro != null)\r\n\t\t\tsql += \"WHERE nome LIKE '%\" + filtro + \"%'\";\r\n\t\tsql += \" ORDER BY F.idFilme \";\r\n\r\n\t\tPreparedStatement stmt = Conexao.getConexao().prepareStatement(sql);\r\n\t\tResultSet rs = stmt.executeQuery();\r\n\r\n\t\tList<Filme> result = new ArrayList<Filme>();\r\n\r\n\t\twhile (rs.next()) {\r\n\t\t\tFilme dados = criaFilme(rs);\r\n\t\t\tresult.add(dados);\r\n\t\t}\r\n\t\trs.close();\r\n\t\tstmt.close();\r\n\t\treturn result;\r\n\t}", "public List<Funcionario> readAll() {\r\n\t\t\tConnection con = ConnectionFactory.getConnection();\r\n\t\t\tPreparedStatement stmt = null;\r\n\t\t\tResultSet rs = null;\r\n\r\n\t\t\tString sql = \" select * from funcionario\";\r\n\t\t\tList<Funcionario> funcionarios = new ArrayList<Funcionario>();\r\n\r\n\t\t\ttry {\r\n\t\t\t\tstmt = con.prepareStatement(sql);\r\n\t\t\t\trs = stmt.executeQuery();\r\n\r\n\t\t\t\twhile (rs.next()) {\r\n\t\t\t\t\tFuncionario func = new Funcionario();\r\n\t\t\t\t\tfunc.setCodigo(rs.getString(\"Codigo\"));\r\n\t\t\t\t\tfunc.setCargo(rs.getString(\"Cargo\"));\r\n\t\t\t\t\tfunc.setNome(rs.getString(\"Nome\"));\r\n\t\t\t\t\tfunc.setCpf(rs.getString(\"Cpf\"));\r\n\t\t\t\t\tfunc.setEndereco(rs.getString(\"Endereco\"));\r\n\t\t\t\t\tfunc.setCidade(rs.getString(\"Cidade\"));\r\n\t\t\t\t\tfunc.setEstado(rs.getString(\"Estado\"));\r\n\t\t\t\t\tfunc.setTelefone(rs.getString(\"Telefone\"));\r\n\t\t\t\t\tfunc.setEmail(rs.getString(\"Email\"));\r\n\r\n\r\n\t\t\t\t\tfuncionarios.add(func);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t} \r\n\t\t\tcatch (SQLException e) { e.printStackTrace();\r\n\t\t\t\tSystem.out.println(\"Erro ao tentar ler tabela funcionario\");\r\n\t\t\t} finally {\r\n\t\t\t\tConnectionFactory.closeConnection(con, stmt);\r\n\t\t\t}\r\n\r\n\t\t\treturn funcionarios;\r\n\t\t}", "public List<Funcionario> findAll() {\r\n\t\tList<Funcionario> result = new ArrayList<Funcionario>();\r\n\t\tPreparedStatement prepStmt = null;\r\n\t\tConnection con = null;\r\n\t\ttry {\r\n\t\t\tcon = jdbcUtil.getConnection();\r\n\t\t\tprepStmt = con.prepareStatement(\"SELECT * FROM Funcionario ORDER BY nome ASC\");\r\n\t\t\tResultSet rs = prepStmt.executeQuery();\r\n\t\t\twhile (rs.next()) {\r\n\t\t\t\tlong id = rs.getLong(\"id_funcionario\");\r\n\t\t\t\tString nome = rs.getString(\"nome\");\r\n\t\t\t\tDate nascimento = rs.getDate(\"nascimento\");\r\n\t\t\t\tString lotacao = rs.getString(\"lotacao\");\r\n\t\t\t\tresult.add(new Funcionario(id, nome, nascimento, lotacao));\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\tthrow new EscolaException(ErrorMessage.FUNCIONARIO_005, e);\r\n\t\t} finally {\r\n\t\t\tcloseStatement(prepStmt);\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public List<FornecedorResource> getListaFornecedores()\r\n {\r\n return fornecedorBusiness.listarFornecedores();\r\n }", "@Override\n\tpublic List<UploadDF> getAll() {\n\t\tSession session = factory.openSession();\n\t\ttry{\n\t\t\tsession.beginTransaction();\n\t\t\tList<UploadDF> list = session.createCriteria(UploadDF.class).addOrder(Order.desc(\"id\")).list();\n\t\t\tsession.getTransaction().commit();\n\t\t\treturn list;\n\t\t}catch(HibernateException exception){\n\t\t\tsession.getTransaction().rollback();\n\t\t\tthrow exception;\n\t\t}finally{\n\t\t\tsession.close();\n\t\t}\n\t}", "private List<RhFuncionario> getFuncionarios()\n {\n System.out.println(\"supiEscalaFacade.findEnfermeiros():\"+supiEscalaFacade.findEnfermeiros());\n return supiEscalaFacade.findEnfermeiros();\n }", "@Override\n\tpublic List<File> getAll() {\n\t\t return getSession().\n\t createQuery(\"from File f\", File.class).\n\t getResultList();\n\t}", "@Override\n @Transactional(readOnly = true)\n public List<FileDTO> findAll() {\n log.debug(\"Request to get all Files\");\n return fileRepository.findAll().stream().map(FileMapper::toDto)\n .collect(Collectors.toCollection(LinkedList::new));\n }", "public List<Medico> findAll() {\n\t\treturn medicoMapper.findAll();\n\t}", "@Override\n\tpublic List<Fournisseur> getFourniseur() {\n\t\treturn dao.getFourniseur();\n\t}", "public List<Food> getAllFood() {\n\t\t\n\t\treturn foodDao.getAllFood();\n\t\t\n\t}", "@Transactional\n\n\t@Override\n\tpublic Collection<FileModel> getAll() {\n\t\treturn fm.findAll();\n\t}", "public FilialResponse fetchAllFilialFilial(Request request);", "public List<File> findAll() {\n\t\treturn files;\n\t}", "public List<Fortaleza> listarFortalezas(){\r\n return cVista.listarFortalezas();\r\n }", "@Override\n\tpublic List<MedioPago> getall() {\n\t\treturn (List<MedioPago>) iMedioPagoDao.findAll();\t\t\n\t}", "public List<Gasto> findAll(){\n\t\treturn (List<Gasto>) gastoModel.findAll();\n\t}", "public void filtrarOfertas() {\n\n List<OfertaDisciplina> ofertas;\n \n ofertas = ofertaDisciplinaFacade.filtrarEixoCursoTurnoCampusQuad(getFiltrosSelecEixos(), getFiltrosSelecCursos(), turno, campus, quadrimestre);\n\n dataModel = new OfertaDisciplinaDataModel(ofertas);\n \n //Após filtrar volta os parametros para os valores default\n setFiltrosSelecEixos(null);\n setFiltrosSelecCursos(null);\n turno = \"\";\n quadrimestre = 0;\n campus = \"\";\n }", "public List<Food> findAllfood() {\n\t\treturn foodDao.findAllfood();\r\n\t}", "public List<Ejemplar> getAll();", "@RequestMapping(value = \"/films\", //\n\t\t\t\t\tmethod = RequestMethod.GET, //\n\t\t\t\t\tproduces = {MediaType.APPLICATION_JSON_VALUE})\n\t@ResponseBody\n\tpublic List<Film> getFilms() {\n\t\tList<Film> list = filmService.recupererTout();\n\t\treturn list;\n\t}", "@Override\n\tpublic List<Dispositivo> getAll() {\n\t\treturn (List<Dispositivo>) dispositivoDao.findAll();\n\t}", "@Override\r\n\tpublic List<Strumento> getAll() throws StrumentoNotFoundException {\n\t\treturn strumentoRepository.findAll();\r\n\t}", "public List getAll() throws FileNotFoundException, IOException;", "@Override\n\tpublic List<MetodoPagamento> findAllOcupados() {\n\t\treturn null;\n\t}", "@Override\r\n\tpublic List<FileMetaDataEntity> getAllFiles() {\n\t\treturn null;\r\n\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic List<Film> findAllFilms() {\n\n\t\treturn (List<Film>) getSession().createCriteria(Film.class).list();\n\t}", "public List<FavoriteLocation> queryAllLocations() {\n\t\tArrayList<FavoriteLocation> fls = new ArrayList<FavoriteLocation>(); \n\t\tCursor c = queryTheCursorLocation(); \n\t\twhile(c.moveToNext()){\n\t\t\tFavoriteLocation fl = new FavoriteLocation();\n\t\t\tfl._id = c.getInt(c.getColumnIndex(\"_id\"));\n\t\t\tfl.description = c.getString(c.getColumnIndex(DBEntryContract.LocationEntry.COLUMN_NAME_DES));\n\t\t\tfl.latitude = c.getDouble(c.getColumnIndex(DBEntryContract.LocationEntry.COLUMN_NAME_GEO_LAT));\n\t\t\tfl.longitude = c.getDouble(c.getColumnIndex(DBEntryContract.LocationEntry.COLUMN_NAME_GEO_LON));\n\t\t\tfl.street_info = c.getString(c.getColumnIndex(DBEntryContract.LocationEntry.COLUMN_NAME_STREET));\n\t\t\tfl.type = c.getInt(c.getColumnIndex(DBEntryContract.LocationEntry.COLUMN_NAME_CATEGORY));\n\t\t\tbyte[] image_byte = c.getBlob(c.getColumnIndex(DBEntryContract.LocationEntry.COLUMN_NAME_PIC)); \n\t\t\tfl.image = BitmapArrayConverter.convertByteArrayToBitmap(image_byte);\n\t\t\tfl.title = c.getString(c.getColumnIndex(DBEntryContract.LocationEntry.COLUMN_NAME_TITLE));\n\t\t\tfls.add(fl);\n\t\t}\n\t\t// close the cursor\n\t\tc.close();\n\t\treturn fls;\n\t}", "public List<SistemaFazendaModel> listaTudo(){\n\t\treturn this.session.createCriteria(SistemaFazendaModel.class).list();\n\t}", "public List<Poruke> getAllPoruke(){\r\n return porukeBeanLocal.getAllPoruke();\r\n }", "@GET\n\t@Path(\"/getallfriends\")\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic List getAllFriends() {\n\t\tList allfrnds = fcs.getAllFriends();\n\n\t\t// for (int i = 0; i < allfrnds.size(); i++) {\n\t\t// Friend f=(Friend)allfrnds.get(i);\n\t\t// System.out.println(f.id+\"===>\"+f.name);\n\t\t// }\n\n\t\treturn allfrnds;\n\t}", "public List<MunicipioDTO> listaUF() throws ClassNotFoundException, SQLException{\n\n\t\t// ativa conexão com BD\n\t\tConnection connection = ConexaoUtil.getInstance().getConnection();\n \n\t\tPreparedStatement statement = null;\n ResultSet rs = null;\n\n List<MunicipioDTO> ufs = new ArrayList<>();\n\n try {\n \t\n\t\t\tString sql = \"SELECT DISTINCT Uf FROM Municipio ORDER BY Uf\";\n\t\t\t// realiza uma ponte entre o java e o BD\n\t\t\tstatement = connection.prepareStatement(sql); \t\n \t\n //stmt = connection.prepareStatement(\"SELECT * FROM topicos\");\n rs = statement.executeQuery();\n\n while (rs.next()) {\n\n \tMunicipioDTO uf = new MunicipioDTO();\n \t\t\n \t//recupera valores de acordo com as colunas do BD\n \tuf.setUf(rs.getString(\"Uf\"));\n \t//adiciona o municipio na lista de municipios\n \tufs.add(uf);\n }\n\n } catch (SQLException ex) {\n Logger.getLogger(MunicipioDAO.class.getName()).log(Level.SEVERE, null, ex);\n } finally {\n //ConnectionFactory.closeConnection(con, stmt, rs);\n \tstatement.close();\n }\n\n return ufs;\n\n }", "public static List<Groupe> getAll() {\n\n // Creation de l'entity manager\n EntityManager em = GestionFactory.factory.createEntityManager();\n\n // Recherche\n @SuppressWarnings(\"unchecked\")\n List<Groupe> list = em.createQuery(\"SELECT e FROM Groupe e\").getResultList();\n\n return list;\n }", "@Override\n\t\tpublic List<Carrera> getAll() {\n\t\t\t\treturn null;\n\t\t}", "@Override\n public List<Patente> getAllPatente() {\n return this.getDaoPatente().takeAll();\n }", "@GET()\n\t@Produces(\"application/json\")\n\tpublic List<Pizzerias> getAllPizzerias() {\n\t\tArrayList<Pizzerias> allPizzeriasList = new ArrayList<Pizzerias>();\n\t\tSystem.out.println(\"Hi..\");\n\t\tMongoCollection pizzerias = dbConnection.getCollection();\n\t\tMongoCursor<Document> cursor = pizzerias.find().iterator();\n\t\ttry {\n\t\t\twhile (cursor.hasNext()) {\n\t\t\t\tallPizzeriasList.add(this.populatePizzeriasInformation(cursor.next()));\n\t\t\t}\n\t\t} finally {\n\t\t\tcursor.close();\n\t\t}\n\n\t\treturn allPizzeriasList;\n\t}", "public List<CXPFactura> buscarFacturasPendientes(){\r\n\t\treturn getFacturaDao().buscarFacturasPendientes();\r\n\t}", "public Set<Frage> getAlleFragen() {\r\n Set<Frage> result = new HashSet<Frage>();\r\n Set<FrageDTO> fragen = dataStore.getAlleFragen();\r\n for (FrageDTO dto : fragen) {\r\n int frageId = dto.getId();\r\n List<String> antworten = dataStore.getAntwortenById(frageId);\r\n List<Integer> votes = dataStore.getVotings(frageId);\r\n Frage frage = new Frage(dto.getId(), dto.getText(),\r\n dto.getStatus(), antworten, votes);\r\n result.add(frage);\r\n }\r\n return result;\r\n }", "@Override\n\tpublic List<FoodType> FindAllType() {\n\t\treturn ftb.FindAllType();\n\t}", "public List<Rota> findAll() {\n try {\r\n EntityManager entityManager = getEntityManager();\r\n Query query = entityManager.createQuery(\"SELECT e FROM Rota e\");// em SELECT e FROM Rota e \"Rota\" precisa representar o mesmo nome da classe\r\n List<Rota> rotas = query.getResultList();\r\n entityManager.close();\r\n return rotas;\r\n }catch(Exception e) {\r\n e.printStackTrace();\r\n return null;\r\n }\r\n }", "@RequestMapping(value = {\"/fpost/list\"}, method = RequestMethod.GET)\r\n\tpublic ResponseEntity<List<Fpost>> fetchAllFposts() {\r\n\t\tSystem.out.println(\"fetching list of all fposts\");\r\n\t\tList<Fpost> fpost = fpostDAO.list();\r\n\t\treturn new ResponseEntity<List<Fpost>>(fpost, HttpStatus.OK);\r\n\t}", "@Override\n\tpublic List<Oeuvre> findAll() {\n\t\treturn oeuvreDao.findAll();\n\t}", "@Override\n\tpublic List<ItemFactura> findAllItemFacturas() {\n\t\treturn itemFacturaDao.findAll();\n\t}", "public List<Registro> findAll() {\n SQLiteDatabase db = banco.getReadableDatabase();\n try {\n\n Cursor c = db.query(TABELA, null, null, null, null, null, null, null);\n\n return toList(c);\n } finally {\n db.close();\n }\n }", "public LiveData<List<FoodEntity>> getAllFoods() {\n return mDb.foodDAO().getAll();\n }", "@RequestMapping(value = \"/funcionarios\",\n method = RequestMethod.GET,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public List<Funcionario> getAllFuncionarios() {\n log.debug(\"REST request to get all Funcionarios\");\n return funcionarioService.findAllByCondominioAtual();\n }", "@Override\n @Transactional(readOnly = true)\n public List<FicheroByteDTO> findAll() {\n log.debug(\"Request to get all FicheroBytes\");\n return ficheroByteRepository.findAll().stream()\n .map(ficheroByteMapper::toDto)\n .collect(Collectors.toCollection(LinkedList::new));\n }", "@Override\r\n\tpublic List<Producto> getAll() throws Exception {\n\t\treturn productRepository.buscar();\r\n\t}", "public static Result findAllFileGroups() {\n \tList<FileGroup> fgs = new FileGroup().findAllFileGroups();\n \treturn ok(Json.toJson(fgs));\n }", "@GetMapping(\"/all\")\r\n\tpublic List<FileModel> getListFiles() {\r\n\t\treturn fileRepository.findAll();\r\n\t}", "@Transactional(readOnly = true)\n public FilasPacientesDTO listar() {\n List<Color> lc = colorRepository.findAll();\n lc.forEach(color -> {\n List<Paciente> listaPorColor = pacienteRepository.findByColorIdOrderByDateAsc(color.getId());\n seleccionarFila(listaPorColor, color.getColor());\n });\n return filas;\n }", "@Override\n\tpublic List<FicheSante> listFicheSante() {\n\t\treturn daofichesante.listFicheSante();\n\t}", "@Override\n\tpublic List<CorsoDiLaurea> findAll() {\n\t\treturn null;\n\t}", "@Override\n\tpublic List<HumanFile> findHumanFileAll() {\n\t\treturn HumanFileMapper.findHumanFileAll();\n\t}", "public List<String> nomsFactures() {\n File folder = new File(\"factures/\");\n File[] listOfFiles = folder.listFiles();\n List<String> noms = new ArrayList<String>();\n\n for (int i = 0; i < listOfFiles.length; i++) {\n if (listOfFiles[i].isFile()) {\n noms.add(listOfFiles[i].getName());\n }\n }\n return noms;\n }", "@Override\n\tpublic List<MyFoodDTO> selectAll() {\n\t\tString sql = \" SELECT * FROM view_식품정보 \";\n\t\tPreparedStatement pStr = null;\n\t\ttry {\n\t\t\tpStr = dbConn.prepareStatement(sql);\n\t\t\tList<MyFoodDTO> brList = this.select(pStr);\n\t\t\tpStr.close();\n\t\t\treturn brList;\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\t}", "@Override\n\tpublic List<TiposUsuario> findAllTipoUsuarios() {\n\t\treturn (List<TiposUsuario>) iUsuarios.findAllTipoGastos();\n\t}", "private List<String> getDataFromApi() throws IOException {\n // Get a list of up to 10 files.\n List<String> fileInfo = new ArrayList<String>();\n FileList result = mService.files().list()\n .setMaxResults(10)\n .execute();\n List<File> files = result.getItems();\n if (files != null) {\n for (File file : files) {\n fileInfo.add(String.format(\"%s (%s)\\n\",\n file.getTitle(), file.getId()));\n }\n }\n return fileInfo;\n }", "@Override\r\n\tpublic List<Film> getFilms(int offset, int count) {\n\t\treturn mFilmDao.getFilms(offset, count);\r\n\t}", "@Override\n\tpublic Iterable<Oglas> findAll() {\n\t\treturn repository.findAll();\n\t}", "public void getFkp() throws SQLException{\n \n ResultSet rset = dh.getPerson();\n \n fkp = new ArrayList<>();\n \n int i = 0;\n while(rset.next()){\n fkp.add(new Person(rset.getString(\"Nome\")));\n }\n }", "List<Receta> getAllWithUSer();", "public Collection<OrdemServicoFotoOcorrencia> listarOSFoto(OrdemServicoFotoOcorrencia osFoto) throws ErroRepositorioException{\n\n\t\tSession session = HibernateUtil.getSession();\n\t\ttry{\n\t\t\tCriteria criteria = session.createCriteria(OrdemServicoFotoOcorrencia.class);\n\n\t\t\tif(osFoto.getId() != null){\n\t\t\t\tcriteria.add(Restrictions.eq(\"id\", osFoto.getId()));\n\t\t\t}\n\t\t\tif(osFoto.getIdOrdemServico() != null){\n\t\t\t\tcriteria.add(Restrictions.eq(\"idOrdemServico\", osFoto.getIdOrdemServico()));\n\t\t\t}\n\t\t\tif(osFoto.getIdOrdemServicoProgramacao() != null){\n\t\t\t\tcriteria.add(Restrictions.eq(\"idOrdemServicoProgramacao\", osFoto.getIdOrdemServicoProgramacao()));\n\t\t\t}\n\t\t\tif(osFoto.getNumeroSequenciaFoto() != null){\n\t\t\t\tcriteria.add(Restrictions.eq(\"numeroSequenciaFoto\", osFoto.getNumeroSequenciaFoto()));\n\t\t\t}\n\n\t\t\treturn criteria.list();\n\n\t\t}catch(HibernateException e){\n\t\t\tthrow new ErroRepositorioException(e, \"Erro no Hibernate\");\n\t\t}finally{\n\t\t\tHibernateUtil.closeSession(session);\n\t\t}\n\t}", "public QuerySet<Perfil> getPerfilSet() {\n QuerySet<Perfil> perfilList = new QuerySet<Perfil>();\n Perfil perfil = null;\n for (Privilegio privilegio : getPrivilegioSet()) {\n perfil = Perfil.objects.<Perfil>get(\"id\", privilegio.getPerfil().getId());\n perfil.getPermissoes();\n perfilList.add(perfil);\n }\n return perfilList;\n }", "@Override\n\tpublic List<flightmodel> getflights() {\n\t\t\n\t\tSystem.out.println(\"heloo\"+repo.findAll());\n\t\treturn repo.findAll();\n\t}", "List<OIDataFile> getOIDataFileList() {\n return this.userCollection.getFiles();\n }", "@GetMapping(\"/receta/all\")\t\n\tpublic List<Receta> listarReceta(){\n\t\t\treturn this.recetaService.findAll();\n\t}", "@NotNull\n @Override\n public List<Faction> getFactions() {\n return FactionColl.get().getAll()\n .stream().map(MassiveCoreFactionsFaction::new).collect(Collectors.toList());\n }", "@SuppressWarnings(\"unchecked\")\r\n\tpublic List<Profilo> getAll() {\r\n\t\t//Recupero la sessione da Hibernate\r\n\t\tSession session = sessionFactory.getCurrentSession();\r\n\t\t\t\r\n\t\t//Creo la query usando il linguaggio HQL (Hibernate Query Language)\r\n\t\tQuery query = session.createQuery(\"FROM Vocelicenza\");\r\n\t\t\t\r\n\t\t//Restituisco la lista di Profili\r\n\t\treturn query.list();\r\n\t}", "public static List getAllImgs() {\n List polovniautomobili = new ArrayList<>();\n try {\n CONNECTION = DriverManager.getConnection(URL, USERNAME, PASSWORD);\n String query = \"SELECT imgUrl FROM polovni\";\n try (PreparedStatement ps = CONNECTION.prepareStatement(query)) {\n ResultSet result = ps.executeQuery();\n while (result.next()) {\n String imgUrl = result.getString(\"imgUrl\");\n polovniautomobili.add(imgUrl);\n }\n\n ps.close();\n CONNECTION.close();\n }\n CONNECTION.close();\n } catch (SQLException ex) {\n Logger.getLogger(Register.class.getName()).log(Level.SEVERE, null, ex);\n }\n return polovniautomobili;\n }", "@Override\n public List<UfficioTecnico> getAll() throws SQLException {\n final Connection connection = connectionManager.getConnection();\n try {\n final PreparedStatement preparedStatement = connection\n .prepareStatement(SELECT_ALL);\n final ResultSet rs = preparedStatement.executeQuery();\n final List<UfficioTecnico> uffici = new ArrayList<UfficioTecnico>();\n while (rs.next()) {\n final UfficioTecnico uff = new UfficioTecnico();\n uff.setId(rs.getInt(\"Id\"));\n uff.setNome(rs.getString(\"nome\"));\n uff.setTel(rs.getString(\"tel\"));\n uff.setEmail(rs.getString(\"email\"));\n uff.setUbicazione(rs.getString(\"ubicazione\"));\n uffici.add(uff);\n }\n return uffici;\n } finally {\n connectionManager.freeConnection(connection);\n }\n }", "public void index() {\n\t\t\n\t\tList<Filme> preferencias = new ArrayList<Filme>();\n\t\tfor( Map.Entry<Key, Integer> entry : session.getUsuario().getPreferencias().entrySet()){\n\t\t\tFilme tmp = filmeDao.getById(entry.getKey());\n\t\t\ttmp.setVotos(entry.getValue());\n\t\t\tpreferencias.add(tmp);\n\t\t}\n\t\t\n\t\t// passando todos os filmes, o usuário e as preferencias dele\n\t\tresult.include(\"filmes\", filmeDao.getAllInOrder() );\n\t\tresult.include(\"usuario\", session.getUsuario() );\n\t\tresult.include(\"preferencias\", preferencias);\n\t}", "public List<MedioDePagoEntity> findAll() {\n LOGGER.log(Level.INFO, \"Consultando todos los medios de pago\");\n TypedQuery query = em.createQuery(\"select u from MedioDePagoEntity u\", MedioDePagoEntity.class);\n return query.getResultList();\n }", "public List<Medico> getAllMedicos() {\n List<Medico> medicos = new ArrayList<Medico>();\n try {\n PreparedStatement pstm = null;\n ResultSet rs = null;\n String query = \"SELECT *FROM medico\";\n pstm = con.prepareStatement(query);\n rs = pstm.executeQuery();\n while (rs.next()) {\n Medico medico = new Medico();\n medico.setId(rs.getInt(\"id_medico\"));\n medico.setArea(rs.getString(\"area\"));\n medico.setNombre(rs.getString(\"nombre\"));\n medico.setAp_pat(rs.getString(\"apell_pat\"));\n medico.setAp_mat(rs.getString(\"apell_mat\"));\n medico.setDireccion(rs.getString(\"direccion\"));\n medico.setEmail(rs.getString(\"email\"));\n medico.setTel(rs.getString(\"tel\"));\n medico.setHora_inc(rs.getString(\"hora_inic\"));\n medico.setHora_fin(rs.getString(\"hora_fin\"));\n medicos.add(medico);\n }\n\n } catch (SQLException e) {\n e.printStackTrace();\n }\n return medicos;\n }", "public List<Perfil> perfilListar() {\r\n\r\n try {\r\n ControladorPerfil ctrlperfil = new ControladorPerfil();\r\n return ctrlperfil.getListaPerfil();\r\n } catch (Exception ex) {\r\n ex.printStackTrace();\r\n return new ArrayList<>();\r\n }\r\n }" ]
[ "0.7002351", "0.67218024", "0.6680692", "0.66763836", "0.6532965", "0.64726615", "0.6457687", "0.6400378", "0.6365489", "0.63409644", "0.63188833", "0.63034266", "0.62960184", "0.62678856", "0.6202135", "0.61823314", "0.61759746", "0.61641705", "0.61468524", "0.6141856", "0.6141517", "0.6105648", "0.60850686", "0.6060771", "0.603842", "0.60279757", "0.6000334", "0.59975994", "0.59824336", "0.59797305", "0.5973032", "0.59680736", "0.59571874", "0.5950436", "0.5937032", "0.59236604", "0.5923462", "0.5902433", "0.5900991", "0.5882409", "0.5815482", "0.5814337", "0.5807527", "0.580237", "0.57948273", "0.57820046", "0.5781377", "0.57782876", "0.5772415", "0.576856", "0.5766418", "0.57652074", "0.57539463", "0.57400215", "0.5739955", "0.57365865", "0.57324064", "0.5727842", "0.5716327", "0.57120836", "0.5698354", "0.5692239", "0.56908834", "0.5687911", "0.56877136", "0.56776834", "0.5675977", "0.5665178", "0.5658255", "0.5653308", "0.5636987", "0.56340295", "0.56112564", "0.5608038", "0.55982685", "0.55973387", "0.5591272", "0.55908066", "0.5575571", "0.5567208", "0.55658144", "0.556455", "0.5562566", "0.55623573", "0.55566", "0.55425394", "0.55421895", "0.553686", "0.5535239", "0.55270356", "0.5525981", "0.55197114", "0.5519162", "0.5512914", "0.5510057", "0.5509956", "0.5499681", "0.54995024", "0.54992306", "0.5498903" ]
0.62001234
15
Get all the fotografias with eager load of manytomany relationships.
Page<Fotografia> findAllWithEagerRelationships(Pageable pageable);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic List<Film> findAllFilms() {\n\t\treturn filmRepository.findAll();\r\n\t}", "Page<Fotografia> findAll(Pageable pageable);", "public List<Medico> findAll() {\n\t\treturn medicoMapper.findAll();\n\t}", "@Override\n\tpublic List<Provincia> fiindAll() {\n\t\treturn provincieRepository.findAllByOrderByNameAsc();\n\t}", "public Set<Frage> getAlleFragen() {\r\n Set<Frage> result = new HashSet<Frage>();\r\n Set<FrageDTO> fragen = dataStore.getAlleFragen();\r\n for (FrageDTO dto : fragen) {\r\n int frageId = dto.getId();\r\n List<String> antworten = dataStore.getAntwortenById(frageId);\r\n List<Integer> votes = dataStore.getVotings(frageId);\r\n Frage frage = new Frage(dto.getId(), dto.getText(),\r\n dto.getStatus(), antworten, votes);\r\n result.add(frage);\r\n }\r\n return result;\r\n }", "public List<RelationMention> getAllRelations(RelationMentionFactory factory) {\n List<RelationMention> allRelations = new ArrayList<RelationMention>(relationMentions);\n allRelations.addAll(getAllUnrelatedRelations(factory));\n return allRelations;\n }", "@Override\n\tpublic List<Factura> findAllFacturas() {\n\t\treturn facturaDao.findAll();\n\t}", "@Override\n\tpublic List<Factura> findAll() {\n\t\treturn facturaRepository.findAll();\n\t}", "@Override\r\n\tpublic List<Factura> findAllFacturas() {\n\t\ttry {\r\n\t\t\treturn facturaDao.findAllFacturas();\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic List<Film> findAllFilms() {\n\n\t\treturn (List<Film>) getSession().createCriteria(Film.class).list();\n\t}", "@Override\n\tpublic Iterable<Oglas> findAll() {\n\t\treturn repository.findAll();\n\t}", "@Override\n\tpublic List<Fournisseur> findAll() {\n\t\treturn null;\n\t}", "public List<FacturaEntity> getFacturas() {\n LOGGER.info(\"Inicia proceso de consultar todos los facturas\");\n List<FacturaEntity> factura = facturaPersistence.findAll();\n LOGGER.info(\"Termina proceso de consultar todos los facturas\");\n return factura;\n }", "@Transactional(readOnly=true)\n\tpublic List<Film> getFilmInfoModelviaLazyLoading() {\n\t\tList<Film> films = filmRepository.findAll();\n\t\t\t\t\n\t\t// Do some business logic here\n\t\t\n\t\t\n\t\t// Because the filmActors is configured as lazy loading\n\t\t// we need to iterate each film, call getFilmActors() methods\n\t\t// and iterate the FilmActors list inside the service class. \n\t\t// If not, the caller calling the getFilmActors() method\n\t\t// outside the service class will get \"could not initialize proxy - no Session\" error\n\t\tfor(Film film : films) {\n\t\t\t// call the getter to load the data to cache\n\t\t\tfor(FilmActor actor : film.getFilmActors()) {\n\t\t\t\t// do nothing here\n\t \t}\n\t\t}\n\t\t\t\t\n\t\t// return the data \n\t\treturn films;\n\t}", "public List<Factura> getAllFacturas(){\n return facturaFacade.findAll();\n }", "@GetMapping(\"/familles\")\n public List<FamilleDTO> getAllFamilles() {\n log.debug(\"REST request to get all Familles\");\n return familleService.findAll();\n }", "@Transactional\n\n\t@Override\n\tpublic Collection<FileModel> getAll() {\n\t\treturn fm.findAll();\n\t}", "@Override\n @Transactional(readOnly = true)\n public List<FonctionsDTO> findAll() {\n log.debug(\"Request to get all Fonctions\");\n return fonctionsRepository.findAll().stream()\n .map(fonctionsMapper::toDto)\n .collect(Collectors.toCollection(LinkedList::new));\n }", "public QuerySet<Perfil> getPerfilSet() {\n QuerySet<Perfil> perfilList = new QuerySet<Perfil>();\n Perfil perfil = null;\n for (Privilegio privilegio : getPrivilegioSet()) {\n perfil = Perfil.objects.<Perfil>get(\"id\", privilegio.getPerfil().getId());\n perfil.getPermissoes();\n perfilList.add(perfil);\n }\n return perfilList;\n }", "public Iterable<Relationship> getRelationships();", "@GET\n @Path(\"/mostrarOrdenadasFS\")\n @Produces({\"application/json\"})\n public List<Fotografia> fotoUsuarioOrdenadaFS(){\n int idUser = 1;\n return fotografiaEJB.FotoUsuarioOrdenadasFS(idUser);\n }", "public List<MedioDePagoEntity> findAll() {\n LOGGER.log(Level.INFO, \"Consultando todos los medios de pago\");\n TypedQuery query = em.createQuery(\"select u from MedioDePagoEntity u\", MedioDePagoEntity.class);\n return query.getResultList();\n }", "@Transactional(readOnly=true)\n\tpublic List<FilmInfoDTO> getFilmInfoDTOviaLazyLoading() {\n\t\tList<Film> films = filmRepository.findAll();\n\t\t\t\t\t\t\n\t\t// Method 1: Do some business logic here\n\t\tList<FilmInfoDTO> result = new ArrayList<FilmInfoDTO>();\n\t\tfor(Film film : films) {\n\t\t\t// map film to filmInfoDTO\n\t\t\tFilmInfoDTO filmInfoDTO = modelMapperEx.map(film, FilmInfoDTO.class);\n\t\t\tresult.add(filmInfoDTO);\n\t\t\t\n\t\t\t/*\n\t\t\t * This section for mapping the set property and list property is no longer needed \n\t\t\t * The converter logic is added in the in modelMapperEx \n\t\t\t \n\t\t\t// iterate the actor list\n\t\t\tList<ActorDTO> actorsDTO = new ArrayList<ActorDTO>();\n\t\t\tfilmInfoDTO.setFilmActors(actorsDTO);\n\t\t\tfor(FilmActor actor : film.getFilmActors()) {\n\t\t\t\tActorDTO actorDTO = modelMapperEx.map(actor.getActor(), ActorDTO.class);\n\t\t\t\tactorsDTO.add(actorDTO);\n\t \t}\n\t \t*/\n\t\t}\t\n\t\t\t\t\n\t\t// return the data \n\t\treturn result;\n\t}", "public ArrayList<Film> displayAllFilms() {\n return filmEdit.displayAllFilms();\n }", "@Query(\"select classe from Classe classe join fetch classe.ecole\")\n public Iterable<Classe> findAll();", "public List<Filme> listar() {\r\n\r\n //Pegando o gerenciador de acesso ao BD\r\n EntityManager gerenciador = JPAUtil.getGerenciador();\r\n\r\n //Criando a consulta ao BD\r\n TypedQuery consulta = gerenciador.createQuery(\r\n \"Select f from Filme f\", Filme.class);\r\n\r\n //Retornar a lista de atores\r\n return consulta.getResultList();\r\n\r\n }", "public List<ArticulosFactura> getArticulosFactura(Factura f){\n return f.getArticulosFacturaList();\n }", "@Override\n\tpublic List<MedioPago> getall() {\n\t\treturn (List<MedioPago>) iMedioPagoDao.findAll();\t\t\n\t}", "private List<RhFuncionario> getFuncionariosMedicos()\n {\n System.out.println(\"supiEscalaFacade.findMedicos():\"+supiEscalaFacade.findMedicos());\n return supiEscalaFacade.findMedicos();\n }", "@Transactional(readOnly = true)\n public List<MuseumResource> findAllMuseums() {\n List<MuseumResource> museums = new ArrayList<>();\n\n List<Museum> museumList = museumRepository.findAll();\n\n for (Museum item : museumList) {\n MuseumResource museum = new MuseumResource();\n populateMuseum(item, museum);\n museums.add(museum);\n }\n\n return museums;\n }", "public static List<Fattura> tutteLeFatture() {\n\t\tEntityManager em = JPAUtil.getInstance().getEmf().createEntityManager();\n\t\tList<Fattura> _return = em.createQuery(\"SELECT f FROM Fattura f\", Fattura.class).getResultList();\n\t\tem.close();\n\t\treturn _return;\n\t}", "public List<Gasto> findAll(){\n\t\treturn (List<Gasto>) gastoModel.findAll();\n\t}", "@Override\n\tpublic List<MetodoPagamento> findAllOcupados() {\n\t\treturn null;\n\t}", "@GET\n\t@Path(\"/getallfriends\")\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic List getAllFriends() {\n\t\tList allfrnds = fcs.getAllFriends();\n\n\t\t// for (int i = 0; i < allfrnds.size(); i++) {\n\t\t// Friend f=(Friend)allfrnds.get(i);\n\t\t// System.out.println(f.id+\"===>\"+f.name);\n\t\t// }\n\n\t\treturn allfrnds;\n\t}", "public List<MediaRelation> loadMediaRelations();", "public Page<Faculty> findAllWithEagerRelationships(Pageable pageable) {\n return facultyRepository.findAllWithEagerRelationships(pageable);\n }", "@Override\n @Transactional(readOnly = true)\n public List<MuseumDTO> findAll() {\n log.debug(\"Request to get all Museums\");\n return museumRepository.findAll().stream()\n .map(museumMapper::toDto)\n .collect(Collectors.toCollection(LinkedList::new));\n }", "@Override\n\tpublic List<UploadDF> getAll() {\n\t\tSession session = factory.openSession();\n\t\ttry{\n\t\t\tsession.beginTransaction();\n\t\t\tList<UploadDF> list = session.createCriteria(UploadDF.class).addOrder(Order.desc(\"id\")).list();\n\t\t\tsession.getTransaction().commit();\n\t\t\treturn list;\n\t\t}catch(HibernateException exception){\n\t\t\tsession.getTransaction().rollback();\n\t\t\tthrow exception;\n\t\t}finally{\n\t\t\tsession.close();\n\t\t}\n\t}", "void readAssociations() {\n // proxy the collections for lazy loading\n Class c = getClass();\n for (Field f : c.getDeclaredFields()) {\n for (Annotation a : f.getAnnotations()) {\n if (a.annotationType().equals(HasMany.class)) {\n HasManyProxy proxyHandler = new HasManyProxy(this, f, (HasMany) a);\n associationProxies.add(proxyHandler);\n Classes.setFieldValue(this, f.getName(), Proxy.newProxyInstance(List.class.getClassLoader(),\n new Class[]{List.class}, proxyHandler));\n } else if (a.annotationType().equals(HasAndBelongsToMany.class)) {\n // TODO implement\n } else if (a.annotationType().equals(HasOne.class)) {\n // TODO implement\n } else if (a.annotationType().equals(BelongsTo.class)) {\n BelongsTo belongsTo = (BelongsTo) a;\n if (!(f.getGenericType() instanceof Class))\n throw new IllegalAnnotationException(\"@BelongsTo can only be applied to non-generic fields\");\n ActiveRecord ar = (ActiveRecord) Classes.newInstance(f.getGenericType());\n String fk = ActiveRecords.foriegnKey(f.getGenericType());\n if (!belongsTo.foreignKey().equals(\"\")) fk = belongsTo.foreignKey();\n System.out.println(\"foriegn key = \" + fk);\n Object fkValue = Classes.getFieldValue(this, fk);\n if (fkValue != null) {\n ar.read(fkValue);\n Classes.setFieldValue(this, f.getName(), ar);\n }\n }\n }\n }\n }", "public List<Campeonato> getAllCampeonato(){\n\t\treturn new ArrayList<Campeonato>();\n\t}", "public List<Food> getAllFood() {\n\t\t\n\t\treturn foodDao.getAllFood();\n\t\t\n\t}", "public Page<Avistamiento> findAllWithEagerRelationships(Pageable pageable) {\n return avistamientoRepository.findAllWithEagerRelationships(pageable);\n }", "@Override\r\n public List<Filme> getListaFilmes(){\r\n return listaFilme;\r\n }", "public List<? extends IFlexoOntologyFeatureAssociation<TA>> getBehaviouralFeatureAssociations();", "public List<Imobiliaria> findAll(){\r\n\t\treturn this.imobiliariaRepository.findAll();\r\n\t}", "@Override\r\n\tpublic List<Fournisseur> getListFournisseur() {\n\t\treturn this.sessionFactory.getCurrentSession().createQuery(\"from fournisseur\").list();\r\n\t}", "@Override\n\t\tpublic Iterable<Relationship> getRelationships() {\n\t\t\treturn null;\n\t\t}", "public ArrayList<Fila> listarFilas() throws IOException{\n\t\treturn dao.listarFilas();\n\t}", "public List<Food> findAllfood() {\n\t\treturn foodDao.findAllfood();\r\n\t}", "@GET\n @Path(\"/mostrarOrdenadasFT\")\n @Produces({\"application/json\"})\n public List<Fotografia> fotoUsuarioOrdenadaFT(){\n int idUser = 1;\n return fotografiaEJB.FotoUsuarioOrdenadasFT(idUser);\n }", "Page<RequestOtherNiazsanjiDTO> findAllWithEagerRelationships(Pageable pageable);", "public List<Filme> getAll(String filtro) throws SQLException {\r\n\t\tString sql = \"SELECT F.*, G.Descricao as genero FROM filme F\"\r\n\t\t\t\t+ \" JOIN genero G on f.idGenero = g.idGenero \";\r\n\r\n\t\tif (filtro != null)\r\n\t\t\tsql += \"WHERE nome LIKE '%\" + filtro + \"%'\";\r\n\t\tsql += \" ORDER BY F.idFilme \";\r\n\r\n\t\tPreparedStatement stmt = Conexao.getConexao().prepareStatement(sql);\r\n\t\tResultSet rs = stmt.executeQuery();\r\n\r\n\t\tList<Filme> result = new ArrayList<Filme>();\r\n\r\n\t\twhile (rs.next()) {\r\n\t\t\tFilme dados = criaFilme(rs);\r\n\t\t\tresult.add(dados);\r\n\t\t}\r\n\t\trs.close();\r\n\t\tstmt.close();\r\n\t\treturn result;\r\n\t}", "@NotNull\n @Override\n public List<Faction> getFactions() {\n return FactionColl.get().getAll()\n .stream().map(MassiveCoreFactionsFaction::new).collect(Collectors.toList());\n }", "public List<Rota> findAll() {\n try {\r\n EntityManager entityManager = getEntityManager();\r\n Query query = entityManager.createQuery(\"SELECT e FROM Rota e\");// em SELECT e FROM Rota e \"Rota\" precisa representar o mesmo nome da classe\r\n List<Rota> rotas = query.getResultList();\r\n entityManager.close();\r\n return rotas;\r\n }catch(Exception e) {\r\n e.printStackTrace();\r\n return null;\r\n }\r\n }", "@Override\r\n\tpublic List<FileMetaDataEntity> getAllFiles() {\n\t\treturn null;\r\n\t}", "@Override\n\tpublic List<FoodType> FindAllType() {\n\t\treturn ftb.FindAllType();\n\t}", "@Override\n\tpublic List<CorsoDiLaurea> findAll() {\n\t\treturn null;\n\t}", "@Override\n @Transactional(readOnly = true)\n public List<PermisoDTO> findAll() {\n log.debug(\"Request to get all Permisos\");\n List<PermisoDTO> result = permisoRepository.findAll().stream()\n .map(permisoMapper::permisoToPermisoDTO)\n .collect(Collectors.toCollection(LinkedList::new));\n\n return result;\n }", "public TreeSet<HerbierPic> getPicsCascade() {\n\t\tTreeSet<HerbierPic> result = new TreeSet<>();\n\t\tresult.addAll(pics);\n\t\tfor (Taxon child : children) {\n\t\t\tresult.addAll(child.getPicsCascade());\n\t\t}\n\t\treturn result;\n\t}", "public List<Automotor> getAll()\n {\n\n CriteriaQuery<Automotor> criteria = this.entityManager.getCriteriaBuilder().createQuery(Automotor.class);\n return this.entityManager.createQuery(criteria.select(criteria.from(Automotor.class))).getResultList();\n }", "@Override\n\tpublic List<Oeuvre> findAll() {\n\t\treturn oeuvreDao.findAll();\n\t}", "Page<AlbumDTO> findAllWithEagerRelationships(Pageable pageable);", "public LiveData<List<FoodEntity>> getAllFoods() {\n return mDb.foodDAO().getAll();\n }", "public List<FornecedorResource> getListaFornecedores()\r\n {\r\n return fornecedorBusiness.listarFornecedores();\r\n }", "public List<Fuente> obtenerListaFuentes() {\n\t\tString etiqueta = \"\";\n\t\tint id = 0;\n\t\tList<Fuente> listaFuentes = new ArrayList<Fuente>();\n\n\t\ttry {\n\n\t\t\trs = stmt.executeQuery(\"SELECT IDFUENTE, NOMBRE FROM FUENTE\");\n\t\t\twhile (rs.next()) {\n\n\t\t\t\tid = rs.getInt(\"IDFUENTE\");\n\t\t\t\tetiqueta = rs.getString(\"NOMBRE\");\n\t\t\t\tFuente f = new Fuente(etiqueta, id, \"\", \"\");\n\t\t\t\tlistaFuentes.add(f);\n\n\t\t\t}\n\n\t\t} catch (SQLException e) {\n\t\t\tSystem.err.println(\"No es posible recuperar la lista de fuentes\");\n\n\t\t}\n\n\t\treturn listaFuentes;\n\t}", "public List<PedidoMaterialModel> findAll(){\n \n List<PedidoMaterialModel> pedidosM = new ArrayList<>();\n \n return pedidosM = pedidoMaterialConverter.entitiesToModels(pedidoMaterialRepository.findAll());\n }", "public List<Tipousr> findAllTipos(){\n\t\t List<Tipousr> listado;\n\t\t Query q;\n\t\t em.getTransaction().begin();\n\t\t q=em.createQuery(\"SELECT u FROM Tipousr u ORDER BY u.idTipousr\");\n\t\t listado= q.getResultList();\n\t\t em.getTransaction().commit();\n\t\t return listado;\n\t\t \n\t\t}", "public Cursor getAllRelationships() {\n SQLiteDatabase relationshipDatabase = relationshipDbHelper.getReadableDatabase();\n return relationshipDatabase.rawQuery(\n \"SELECT * FROM \" + RelationshipEntry.TABLE_NAME, null);\n }", "@Override\n\tpublic List<Dispositivo> getAll() {\n\t\treturn (List<Dispositivo>) dispositivoDao.findAll();\n\t}", "public RelacionConceptoEmbalaje[] findAll() throws RelacionConceptoEmbalajeDaoException;", "public static List<Groupe> getAll() {\n\n // Creation de l'entity manager\n EntityManager em = GestionFactory.factory.createEntityManager();\n\n // Recherche\n @SuppressWarnings(\"unchecked\")\n List<Groupe> list = em.createQuery(\"SELECT e FROM Groupe e\").getResultList();\n\n return list;\n }", "public List<FilmeAtor> buscarFilmesAtoresPeloNomeFilmeOuNomeAtor(String nomeFilmeOuAtor) {\n EntityManager gerenciador = JPAUtil.getGerenciador();\r\n\r\n //Criando a consulta ao BD\r\n TypedQuery<FilmeAtor> consulta = gerenciador.createQuery(\r\n \"SELECT new dados.dto.FilmeAtor(f, a) FROM Filme f JOIN f.atores a WHERE f.nome like :nomeFilme or a.nome like :nomeAtor\",\r\n FilmeAtor.class);\r\n\r\n consulta.setParameter(\"nomeFilme\", nomeFilmeOuAtor + \"%\");\r\n consulta.setParameter(\"nomeAtor\", nomeFilmeOuAtor + \"%\");\r\n \r\n return consulta.getResultList();\r\n\r\n }", "public Set<Medicine> loadMedicines();", "@Override\n\tpublic ArrayList<VOFactura> getAllFacturas() {\n\t\t\n\t\tDBConnection con = null;\n\t\tStatement stm = null;\n\t\tString sql = null;\n\t\tResultSet res = null;\n\t\t\n\t\tVOFactura factura;\n\t\tArrayList<VOFactura> listaFacturas = new ArrayList<VOFactura>();\n\t\t\n\t\t try {\n\t\t\tcon = new DBConnection(\"root\",\"walkirias84\");\n\t\t\tstm = con.getConnection().createStatement();\n\t\t\tsql = \"SELECT * FROM factura fac ORDER BY fac.facnumero\";\n\t\t\tres = stm.executeQuery(sql);\n\t\t\t\n\t\t\twhile(res.next()) {\n\t\t\t\tfactura = new VOFactura();\n\t\t\t\tfactura.setId(res.getInt(1));\n\t\t\t\tfactura.setNumero(res.getInt(2));\n\t\t\t\tfactura.setIdCliente(res.getInt(3));\n\t\t\t\tCalendar fecha = Calendar.getInstance();\n\t\t\t\tfecha.setTimeInMillis(res.getDate(4).getTime());\n\t\t\t\tfactura.setFecha(fecha);\n\t\t\t\tfactura.setValorNeto(res.getBigDecimal(5));\n\t\t\t\tfactura.setValorIva(res.getBigDecimal(6));\n\t\t\t\tfactura.setValorTotal(res.getBigDecimal(7));\n\t\t\t\t\n\t\t\t\tlistaFacturas.add(factura);\n\t\t\t}\n\t\t\t\n\t\t\treturn listaFacturas;\n\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(e);\n\t\t} finally {\n\t if (res != null) try { res.close(); } catch (SQLException logOrIgnore) {}\n\t if (stm != null) try { stm.close(); } catch (SQLException logOrIgnore) {}\n\t if (con != null) try { con.getConnection().close(); } catch (SQLException logOrIgnore) {}\n\t }\n\t\t\n\t\treturn null;\n\t}", "public XIterable<ArticleX> relateds() {\n\t\tfinal IteratorList<ReadNode> relateds = node().refChildren(\"related\").iterator() ;\n\t\treturn XIterable.create(domain(), relateds.toList(), MapUtil.<String, String>newMap(), ArticleX.class) ;\n\t}", "public ArrayList<Moto> getMotos()\r\n {\r\n return motos;\r\n }", "@Override\n public List<Part> findAll() {\n List<Part> resultList = new ArrayList<>();\n repositoryPart.findAll().iterator().forEachRemaining(resultList::add);\n return resultList;\n }", "public List<CategoriaEntity> findAll() {\n LOGGER.log(Level.INFO, \"Consultando todas las categorias\");\n // Se crea un query para buscar todas las categorias en la base de datos.\n TypedQuery query = em.createQuery(\"select u from CategoriaEntity u\", CategoriaEntity.class);\n // Note que en el query se hace uso del método getResultList() que obtiene una lista de categorias.\n return query.getResultList();\n }", "public List<MovieDetails> getAllFavoriteMovies() {\n SQLiteDatabase database = this.getWritableDatabase();\n List<MovieDetails> movieDetailses = new ArrayList<>();\n List<Integer> favoritesMovieId = new ArrayList<>();\n String selectQuery = \"SELECT * FROM \" + FavoriteMoviesEntry.TABLE_NAME;\n Cursor cursor = database.rawQuery(selectQuery, null);\n if (cursor.moveToFirst()) {\n do {\n int id = getIdFromCursor(cursor);\n String selectFavoriteMovieQuery = \"SELECT * FROM \" + MoviesDetailsEntry.TABLE_NAME + \"WHERE \" + MoviesDetailsEntry._ID + \"= \" + id;\n Cursor movieCursor = database.rawQuery(selectFavoriteMovieQuery, null);\n if (movieCursor.moveToFirst()) {\n do {\n MovieDetails movieDetails = getMovieDetailsFromCursor(movieCursor);\n movieDetailses.add(movieDetails);\n } while (movieCursor.moveToNext());\n }\n } while (cursor.moveToNext());\n }\n database.close();\n\n return movieDetailses;\n }", "Set<Art> getAllArt();", "@Override\n\tpublic List<TiposGastos> findAllTiposGasto() {\n\t\treturn (List<TiposGastos>) gastoModel.findAllTiposGasto();\n\t}", "@Override\n\tpublic List<InstituteFormation> allFormations() {\n\t\treturn dao.allFormation();\n\t}", "public Map<String, HasFormAssociation> fetchFormAssociations();", "public List<Medico> getAllMedicos() {\n List<Medico> medicos = new ArrayList<Medico>();\n try {\n PreparedStatement pstm = null;\n ResultSet rs = null;\n String query = \"SELECT *FROM medico\";\n pstm = con.prepareStatement(query);\n rs = pstm.executeQuery();\n while (rs.next()) {\n Medico medico = new Medico();\n medico.setId(rs.getInt(\"id_medico\"));\n medico.setArea(rs.getString(\"area\"));\n medico.setNombre(rs.getString(\"nombre\"));\n medico.setAp_pat(rs.getString(\"apell_pat\"));\n medico.setAp_mat(rs.getString(\"apell_mat\"));\n medico.setDireccion(rs.getString(\"direccion\"));\n medico.setEmail(rs.getString(\"email\"));\n medico.setTel(rs.getString(\"tel\"));\n medico.setHora_inc(rs.getString(\"hora_inic\"));\n medico.setHora_fin(rs.getString(\"hora_fin\"));\n medicos.add(medico);\n }\n\n } catch (SQLException e) {\n e.printStackTrace();\n }\n return medicos;\n }", "private void getAllFavorite(){\n\n\n MainViewModel viewModel = ViewModelProviders.of(this).get(MainViewModel.class);\n viewModel.getFavorite().observe(this, new Observer<List<FavoriteEntry>>() {\n @Override\n public void onChanged(@Nullable List<FavoriteEntry> imageEntries) {\n List<Movie> movies = new ArrayList<>();\n for (FavoriteEntry entry : imageEntries){\n Movie movie = new Movie();\n movie.setId(entry.getMovieid());\n movie.setOverview(entry.getOverview());\n movie.setOriginalTitle(entry.getTitle());\n movie.setPosterPath(entry.getPosterpath());\n movie.setVoteAverage(entry.getUserrating());\n movie.setReleaseDate(entry.getReleasedate());\n movies.add(movie);\n }\n\n adapter.setMovies(movies);\n }\n });\n }", "@Override\n\tpublic List<ImageEntity> getAll() {\n\t\treturn DatabaseContext.findAll(ImageEntity.class);\n\t}", "@Override\n\tpublic List<ItemFactura> findAllItemFacturas() {\n\t\treturn itemFacturaDao.findAll();\n\t}", "@Override\n public ArrayList<byte[]> getFotografias(String id) throws SQLException {\n ArrayList<byte[]> resultado = new ArrayList<byte[]>();\n resultado = (ArrayList<byte[]>) bdPropiedad.getFotografias(id);\n return resultado;\n }", "public ObservableList<Part> getAllAssociatedParts() {\n return associatedParts;\n }", "public ObservableList<Part> getAllAssociatedParts() {\n return associatedParts;\n }", "public void llenarListas(PaseoEntity entity) {\r\n ofertas = new ArrayList<OfertaDTO>();\r\n List<OfertaEntity> ofertasEntities = entity.getOfertas();\r\n if (ofertasEntities == null) {\r\n return;\r\n }\r\n for (OfertaEntity of : ofertasEntities) {\r\n ofertas.add(new OfertaDTO(of));\r\n }\r\n fotos = new ArrayList<FotoDTO>();\r\n if (entity.getOfertas() == null || entity.getOfertas().isEmpty() || entity.getOfertas().get(0) == null) {\r\n return;\r\n }\r\n if (entity.getOfertas().get(0).getVisitas() == null || entity.getOfertas().get(0).getVisitas().isEmpty()) {\r\n\r\n return;\r\n }\r\n List<FotoEntity> lista = entity.getOfertas().get(0).getVisitas().get(0).getFotos();\r\n if (lista != null) {\r\n\r\n for (FotoEntity fotoEntity : lista) {\r\n fotos.add(new FotoDTO(fotoEntity));\r\n }\r\n }\r\n }", "@Override\n\tpublic List<Opcion> findAll() throws Exception {\n\t\treturn opcionRepository.findAll();\n\t}", "public Iterable<Content> findAllFeaturedContent(){\n\n return contentRepository.findByIsFeatured(true);\n }", "@Transactional\n\tpublic ArrayList<Friend> getAllFriend() {\n\t\tSession session = sessionFactory.openSession();\n\t\tArrayList<Friend> Allfriends=(ArrayList<Friend>)session.createQuery(\"from Friend\").list();\n\t\tsession.close();\n\t\treturn Allfriends;\n\t\t\n\t}", "public List<FeatureDataBean> getAllFeatures() throws GenericDatabaseException {\n List<String> ids = new ArrayList<>();\n ids.add(UMFeatureDao.PARENT);\n \n Map<String,Object> equals=new HashMap<>();\n equals.put(UMFeatureDao.IS_ACTIVE, Boolean.TRUE);\n \n Map<QueryOperators, Object> criteria = new HashMap<>();\n criteria.put(QueryOperators.IS_NULL, ids);\n criteria.put(QueryOperators.EQUAL, equals);\n \n return (convertFeatureDataBeanToFeatureModel(featureService.retrieveFeatures(null, criteria, null)));\n }", "public void fetchFavoritedMovies() {\n favoritesSelected = true;\n Cursor cursor =\n getActivity().getContentResolver().query(MovieContract.FavoriteMovieEntry.CONTENT_URI,\n null,\n null,\n null,\n null);\n ArrayList<MovieModel> movieModels = new ArrayList<>();\n if (cursor != null) {\n while (cursor.moveToNext()) {\n MovieModel movieModel = new MovieModel(getActivity(), cursor);\n // Get the trailers and reviews\n String movieId = cursor.getString(cursor.getColumnIndex(MovieContract.FavoriteMovieEntry._ID));\n Cursor trailerCursor =\n getActivity().getContentResolver().query(MovieContract.TrailerEntry.CONTENT_URI,\n null,\n MovieContract.TrailerEntry.COLUMN_MOVIE_KEY + \" = ?\",\n new String[]{movieId},\n null);\n Cursor reviewCursor =\n getActivity().getContentResolver().query(MovieContract.ReviewEntry.CONTENT_URI,\n null,\n MovieContract.ReviewEntry.COLUMN_MOVIE_KEY + \" = ?\",\n new String[]{movieId},\n null);\n ArrayList<MovieTrailerModel> movieTrailerModels = new ArrayList<>();\n ArrayList<MovieReviewModel> movieReviewModels = new ArrayList<>();\n if (trailerCursor != null) {\n while (trailerCursor.moveToNext()) {\n movieTrailerModels.add(new MovieTrailerModel(getActivity(), trailerCursor));\n }\n trailerCursor.close();\n }\n if (reviewCursor != null) {\n while (reviewCursor.moveToNext()) {\n movieReviewModels.add(new MovieReviewModel(getActivity(), reviewCursor));\n }\n reviewCursor.close();\n }\n movieModel.setReviews(movieReviewModels);\n movieModel.setTrailers(movieTrailerModels);\n movieModels.add(movieModel);\n }\n cursor.close();\n }\n movieGridAdapter.setMovieModels(movieModels);\n }", "@Override\n\tpublic List<Fee_Entity> get_all_fee() {\n\t\treturn fee.get_all_fee();\n\t}", "fotos(){}", "@Override\n @Transactional(readOnly = true)\n public List<FileDTO> findAll() {\n log.debug(\"Request to get all Files\");\n return fileRepository.findAll().stream().map(FileMapper::toDto)\n .collect(Collectors.toCollection(LinkedList::new));\n }", "@Override\n @Transactional(readOnly = true)\n public List<PomocniMaterijal> findAll() {\n log.debug(\"Request to get all PomocniMaterijals\");\n return pomocniMaterijalRepository.findAll();\n }" ]
[ "0.5733244", "0.5564955", "0.5508136", "0.54690206", "0.5410369", "0.5398999", "0.5385024", "0.53801006", "0.5362727", "0.5361579", "0.5342562", "0.53385925", "0.53123164", "0.53000647", "0.52777106", "0.5261997", "0.5255466", "0.5242534", "0.52176875", "0.520907", "0.5185945", "0.5179571", "0.5173995", "0.5126868", "0.5090268", "0.508626", "0.50834286", "0.50784004", "0.50594133", "0.5017264", "0.5011305", "0.50083536", "0.497353", "0.49714476", "0.4967356", "0.49662396", "0.4965706", "0.49576443", "0.49433187", "0.49316338", "0.49299532", "0.4916221", "0.49095935", "0.4901016", "0.48894507", "0.48856005", "0.48841336", "0.48817793", "0.48785877", "0.4878238", "0.48718196", "0.48712227", "0.48583844", "0.48475417", "0.48413453", "0.48410177", "0.48378506", "0.48310053", "0.4823971", "0.4815837", "0.48147282", "0.4810309", "0.48081595", "0.48073336", "0.4805409", "0.4803659", "0.4799517", "0.47962236", "0.4792013", "0.47920007", "0.47909117", "0.47847185", "0.47837898", "0.47830662", "0.47825953", "0.47821993", "0.47812787", "0.47795585", "0.47794625", "0.4777253", "0.47747636", "0.47591916", "0.47572988", "0.47553238", "0.47495553", "0.47366732", "0.47340515", "0.47301406", "0.4730039", "0.4730039", "0.47286975", "0.4707199", "0.47051463", "0.47002673", "0.46933582", "0.4685698", "0.46824571", "0.46811992", "0.4681178", "0.4672189" ]
0.6834874
0
Get the "id" fotografia.
Optional<Fotografia> findOne(Long id);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getID();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getID();", "String getID();", "String getID();", "String getID();", "Object getId();", "public String getId()\r\n\t{\n\t\treturn id.substring(2, 5);\r\n\t}", "Short getId();", "Integer getID();", "Integer getID();", "String getIdNumber();", "Integer getId();", "Integer getId();", "Integer getId();", "public int getId() {\n // some code goes here\n int id = f.getAbsoluteFile().hashCode();\n //System.out.println(id);\n return id;\n }", "public String id() {\n return definition.getString(ID);\n }", "public int getId() {\n // some code goes here\n \treturn m_f.getAbsoluteFile().hashCode();\n }", "public static String id()\n {\n return _id;\n }", "public java.lang.Long getId_tecnico();", "java.lang.String getAoisId();", "public int getId() {\n return oid ;\n }", "long getId();", "long getId();", "long getId();", "long getId();", "long getId();", "long getId();", "long getId();", "long getId();", "long getId();", "long getId();", "long getId();", "long getId();", "long getId();", "long getId();", "long getId();", "long getId();", "long getId();", "long getId();" ]
[ "0.74847764", "0.74847764", "0.74847764", "0.74847764", "0.74847764", "0.74847764", "0.74847764", "0.74847764", "0.74847764", "0.74847764", "0.74847764", "0.74847764", "0.74847764", "0.74847764", "0.74847764", "0.74847764", "0.74847764", "0.74847764", "0.74847764", "0.7412225", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.7363172", "0.72824055", "0.72824055", "0.72824055", "0.72824055", "0.7277094", "0.717703", "0.7137856", "0.71048963", "0.71048963", "0.70756006", "0.707041", "0.707041", "0.707041", "0.7001958", "0.6933883", "0.69324243", "0.6912998", "0.69104636", "0.6883184", "0.68574643", "0.6838416", "0.6838416", "0.6838416", "0.6838416", "0.6838416", "0.6838416", "0.6838416", "0.6838416", "0.6838416", "0.6838416", "0.6838416", "0.6838416", "0.6838416", "0.6838416", "0.6838416", "0.6838416", "0.6838416", "0.6838416" ]
0.0
-1
Delete the "id" fotografia.
void delete(Long id);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void delete(String id);", "public void delete(String id);", "public void delete(String id);", "public void delete(String id);", "public void delete(String id);", "public void deleteById(String id);", "public void delete(Integer id);", "public void delete(Integer id);", "public void delete(Integer id);", "public void delete(int id);", "void deleteById(String id);", "void deleteById(String id);", "void deleteById(String id);", "void deleteById(String id);", "void deleteById(String id);", "void deleteById(String id);", "void deleteById(String id);", "void deleteById(String id);", "void deleteById(String id);", "void deleteById(String id);", "@Override\r\n\tpublic void delete(int idStrumento) {\n\t\tstrumentoRepository.delete(idStrumento);\r\n\t}", "@Override\r\n\tpublic void delete(String id) {\n\t\t\r\n\t}", "void deleteMataKuliah (int id);", "@Override\n public void delete(Long id) {\n log.debug(\"Request to delete Sintoma : {}\", id);\n sintomaRepository.delete(id);\n }", "void delete(String id);", "void delete(String id);", "void delete(String id);", "void delete(String id);", "void delete(String id);", "void delete(String id);", "@Override\n public void delete(Long id) {\n log.debug(\"Request to delete Fonctions : {}\", id);\n fonctionsRepository.deleteById(id);\n }", "public void delete(Long id);", "public void delete(Long id);", "public void delete(Long id);", "public void delete(Long id);", "public void delete(Long id);", "void deleteById(int id);", "@Override\r\n\tpublic void delete(int id) {\n\t\t\r\n\t}", "void deleteById(final String id);", "@Override\n\tpublic void delete(String id) {\n\n\t}", "@Override\n\tpublic void deleteById(String id) {\n\t\t\n\t}", "@Override\n\tpublic void delete(String id) {\n\t\t\n\t}", "@Override\n\tpublic void delete(String id) {\n\t\t\n\t}", "public void delete(int id) {\n\n\t}", "public void eliminar(Long id) throws AppException;", "public void deleteById(Long id);", "public void delete(Integer id) {\n\r\n\t}", "void delete(final Long id);", "void delete( Integer id );", "@Override\n\tpublic void delete(String id) throws Exception {\n\n\t}", "void delete(Integer id);", "void delete(Integer id);", "void deleteById(Integer id);", "void deleteById(Integer id);", "void delete( Long id );", "@Override\n\tpublic void deleteById(int id) {\n\t\t\n\t}", "@Override\n\tpublic void delete(Integer id) {\n\n\t}", "public void deleteById(Integer id) {\n\n\t}", "@Override\n public void deletePartida(String idPartida) {\n template.opsForHash().delete(idPartida, \"jugador1\");\n template.opsForHash().delete(idPartida, \"jugador2\");\n template.opsForSet().remove(\"partidas\",idPartida);\n }", "public void delete(String idAvion)\n\t{\n\t}", "@Override\r\n\tpublic void delete(String id) {\n\r\n\t}", "@Override\r\n\tpublic void delete(Long id) {\n\t\t\r\n\t}", "@Override\n\tpublic void deleteById(String id) throws Exception {\n\t\t\n\t}", "@Override\r\n\tpublic void del(Integer id) {\n\t\t\r\n\t}", "@Override\n\tpublic void deleteById(Integer id) {\n\t\t\n\t}", "@Override\n\tpublic void delete(Integer id) {\n\t\t\n\t}", "public void delete(Long id) {\n\r\n\t}", "@Override\n\tpublic void delete(int id) {\n\t}", "public boolean delete(String id);", "public boolean delete(String id);", "@Override\r\n\tpublic void delete(int id) {\n\t\tlibroRepository.deleteById(id);\r\n\t}", "@Override\n public void delete(int id) {\n }", "@Override\r\n\tpublic Result delete(int id) {\n\t\treturn null;\r\n\t}", "@Override\n\tpublic void deletebyid(Integer id) {\n\t\t\n\t}", "public void deleteById(long id) {\n\t\t\n\t}", "@Override\n\tpublic void delete(Long id) {\n\t}", "@Override\n\tpublic void delete(int id) {\n\t\t\n\t}", "@Override\n\tpublic void delete(int id) {\n\t\t\n\t}", "@Override\n\tpublic void delete(int id) {\n\t\t\n\t}", "@Override\n\tpublic void delete(int id) {\n\t\t\n\t}", "@Override\n\tpublic void delete(Long id) {\n\n\t}", "@Override\n\tpublic void delete(Long id) {\n\n\t}", "void deleteById(Long id);", "void deleteById(Long id);", "void deleteById(Long id);", "void deleteById(Long id);", "@Override\n\tpublic void deleteById(Integer id) {\n\t\tfacturaRepository.deleteById(id);\n\t\t\n\t}", "@Override\n\tpublic void deleteById(Long id) {\n\n\t}", "@Override\n public void delete(int id) {\n repr.delete(id);\n }", "void deleteById(long id);", "@Override\r\n\tpublic void delete(Integer id) {\n\r\n\t}", "@Override\r\n\tpublic void deleteFilm(int id) {\n\r\n\t}" ]
[ "0.77795", "0.77795", "0.77795", "0.77795", "0.77795", "0.7708823", "0.7688643", "0.7688643", "0.7688643", "0.7664635", "0.76206714", "0.76206714", "0.76206714", "0.76206714", "0.76206714", "0.76206714", "0.76206714", "0.76206714", "0.76206714", "0.76206714", "0.761965", "0.760965", "0.75708574", "0.7550588", "0.75500774", "0.75500774", "0.75500774", "0.75500774", "0.75500774", "0.75500774", "0.7549959", "0.75445175", "0.75445175", "0.75445175", "0.75445175", "0.75445175", "0.7517855", "0.7511301", "0.75045353", "0.7499524", "0.7495505", "0.7487938", "0.7487938", "0.74857366", "0.74817955", "0.7480446", "0.7478987", "0.7468998", "0.7461663", "0.7455137", "0.7454592", "0.7454592", "0.74513566", "0.74513566", "0.7447898", "0.7447454", "0.743082", "0.7430009", "0.742965", "0.7423759", "0.7423004", "0.7421197", "0.74130607", "0.74077624", "0.740466", "0.7399736", "0.73990375", "0.7390998", "0.7387053", "0.7387053", "0.7380748", "0.73774743", "0.73748714", "0.73741555", "0.73686457", "0.7366688", "0.73615915", "0.73615915", "0.73615915", "0.73615915", "0.73559916", "0.73559916", "0.7352228", "0.7352228", "0.7352228", "0.7352228", "0.7351949", "0.7347651", "0.7346256", "0.7342673", "0.7337869", "0.733734" ]
0.0
-1
This method was generated by MyBatis Generator. This method corresponds to the database table core.report_metadata
public ReportMetadataExample() { oredCriteria = new ArrayList<Criteria>(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "TableReportMetadata getReportMetadata(String reportId);", "public abstract List<ColumnSpecification> metadata();", "@Override\r\n\t\tpublic DatabaseMetaData getMetaData() throws SQLException {\n\t\t\treturn null;\r\n\t\t}", "@Override\n\tpublic JDBCMetaData getMetaData() throws SQLException {\n\t\treturn null;\n\t}", "private void writeMetaData(ResultSet resultSet) throws SQLException {\n\t System.out.println(\"The columns in the table are: \");\r\n\t System.out.println(\"Table: \" + resultSet.getMetaData().getTableName(1));\r\n\t for (int i = 1; i<= resultSet.getMetaData().getColumnCount(); i++){\r\n\t System.out.println(\"Column \" +i + \" \"+ resultSet.getMetaData().getColumnName(i));\r\n\t }\r\n\t }", "public interface TableMetaData {\n\n\t/** Adds normal column. */\n\tpublic void addColumn(final ColumnMetaData column);\n\n\t/** Adds primary key column. */\n\tpublic void addPrimaryKey(final ColumnMetaData column);\n\n\t/** Returns map of column meta data, keyed by the column label (the alias if provided in the query, otherwise the name). */\n\tpublic Map<String, ColumnMetaData> getColumns();\n\n\t/** Returns database name. */\n\tpublic String getDatabaseName();\n\n\t/** Returns ordered list of columns that are primary keys. */\n\tpublic List<ColumnMetaData> getPrimaryKeys();\n\n\t/**\n\t * Returns fully qualified table name in database-specific form for use in SQL statements. MySQL uses the form\n\t * <code>database.table</code>, for example <code>sakila.film</code>. PostgreSQL uses the form\n\t * <code>database.schema.table</code>, for example <code>sakila.public.film</code>.\n\t */\n\tpublic String getQualifiedTableName();\n\n\t/** Returns row alias. */\n\tpublic String getRowAlias();\n\t\n\t/** Returns row set alias. */\n\tpublic String getRowSetAlias();\n\t\n\t/**\n\t * Returns row alias.\n\t * \n * @deprecated As of 0.8.11 use {@link #getRowAlias()}\n\t */\n\t@Deprecated\n\tpublic String getTableAlias();\n\n\t/** Returns table name. */\n\tpublic String getTableName();\n\n\t/** Returns role of table in the SQL Resource. */\n\tpublic TableRole getTableRole();\n\n\t/** Returns true if the SQL Resource role is child. */\n\tpublic boolean isChild();\n\n\t/** Returns true if the SQL Resource role is parent. */\n\tpublic boolean isParent();\n\n\t/** Sets all the row and row set aliases. */\n\tpublic void setAliases(final String alias, final String rowAlias, final String rowSetAlias);\n\n\t/** Sets attributes. */\n\tpublic void setAttributes(final String tableName, final String qualifedTableName,\n\t\t\tfinal String databaseName, final TableRole tableRole);\n\n\t/**\n\t * Sets table alias.\n\t * \n * @deprecated As of 0.8.11 use {@link #setAliases(String, String, String)}\n\t */\n\t@Deprecated\n\tpublic void setTableAlias(final String tableAlias);\n\t\n\t/** Represents all of the roles a table may plan in a SQL Resource. */\n\t@XmlType(namespace = \"http://restsql.org/schema\")\n\tpublic enum TableRole {\n\t\tChild, ChildExtension, Join, Parent, ParentExtension, Unknown;\n\t}\n}", "public abstract List<String> newReportColumns();", "ResultSetMetaData getMetaData() throws SQLException;", "public DBMetaDataSet getMetaData()\n\t{\n\t\treturn _MetaData;\n\t}", "public interface SqlResourceMetaData {\r\n\r\n\tpublic List<ColumnMetaData> getAllReadColumns();\r\n\r\n\tpublic TableMetaData getChild();\r\n\r\n\tpublic List<TableMetaData> getChildPlusExtTables();\r\n\r\n\tpublic List<ColumnMetaData> getChildReadColumns();\r\n\r\n\tpublic TableMetaData getJoin();\r\n\r\n\tpublic List<TableMetaData> getJoinList();\r\n\r\n\tpublic int getNumberTables();\r\n\r\n\tpublic TableMetaData getParent();\r\n\r\n\tpublic List<TableMetaData> getParentPlusExtTables();\r\n\r\n\tpublic List<ColumnMetaData> getParentReadColumns();\r\n\r\n\tpublic Map<String, TableMetaData> getTableMap();\r\n\r\n\tpublic List<TableMetaData> getTables();\r\n\r\n\tpublic List<TableMetaData> getWriteTables(final Type requestType, final boolean doParent);\r\n\r\n\tpublic boolean hasJoinTable();\r\n\r\n\tpublic boolean hasMultipleDatabases();\r\n\r\n\tpublic boolean isHierarchical();\r\n\r\n\tpublic void init(final String sqlResourceName, final SqlResourceDefinition definition, final SqlBuilder sqlBuilder)\r\n\t\t\tthrows SqlResourceException;\r\n\r\n\tpublic String toHtml();\r\n\r\n\tpublic String toXml();\r\n}", "public void addColumnPathReportId() {\n addColumnInPath(ColumnMetaData.KEY_PATH_ID);\n }", "public ResultSetMetaData getMetaData() throws SQLException {\n\n try {\n int id = getNextId(TraceObject.RESULT_SET_META_DATA);\n if (isDebugEnabled()) {\n debugCodeAssign(\"ResultSetMetaData\", TraceObject.RESULT_SET_META_DATA, id, \"getMetaData()\");\n }\n checkClosed();\n String catalog = conn.getCatalog();\n JdbcResultSetMetaData meta = new JdbcResultSetMetaData(this, null, result, catalog, conn.getSession().getTrace(), id);\n return meta;\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "public MetaData getMetaData();", "@Override\n public DatabaseMetaData getMetaData() throws SQLException\n {\n logger.debug(\n \" public DatabaseMetaData getMetaData() throws SQLException\");\n\n return new SnowflakeDatabaseMetaData(this);\n }", "public DataSetMetaData getMetaData() {\n return this.metadata;\n }", "@Test\n public void metaDataExample1() throws SQLException {\n Connection connection = DriverManager.getConnection(dbUrl, dbUsername, dbPassword);\n // 2. Create statement\n Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);\n // Run sql query and get the result in resultSet object\n String sqlQuery= \"Select * From departments\";\n //String sqlQuery= \"Select first_name, last_name, salary From employees\";\n ResultSet resultSet = statement.executeQuery(sqlQuery);\n\n // we use resultSet metadata to get information about the tables\n // get the resultSet object metadata\n ResultSetMetaData rsMetadata = resultSet.getMetaData();\n\n // List for keeping all rows as a map\n List<Map<String, Object>> queryData = new ArrayList<>();\n\n // while(resultSet.next()) helps to iterate through columns\n while (resultSet.next()) {\n // key(columns) will be string but value can be any type of data. That's why we choose <String, Object>\n Map<String, Object> row = new HashMap<>(); // creating empty Map\n // number of columns\n int colCount = rsMetadata.getColumnCount();\n // for loop helps to iterate through columns\n for (int i = 1; i <= colCount; i++) {\n row.put(rsMetadata.getColumnName(i), resultSet.getObject(i));\n }\n\n queryData.add(row); // adding a Map to the List of Maps\n }\n\n // Printing the rows\n for (Map<String, Object> row: queryData) {\n System.out.println(row.toString());\n\n }\n\n\n\n\n // close all connections\n resultSet.close();\n statement.close();\n connection.close();\n }", "@Override\n\tpublic DBMetadata getMetadata() {\n\t\treturn null;\n\t}", "public MetaData getMetaData() {\r\n \treturn metaData;\r\n }", "@Override\n public SystemMetadata mapRow(ResultSet resultSet, int rowNumber) throws SQLException {\n\n // resultSet contains guid, serialVersion, date_modified, and archived column data\n SystemMetadata systemMetadata = new SystemMetadata();\n ReplicationPolicy replPolicy = new ReplicationPolicy();\n AccessPolicy accessPolicy = new AccessPolicy();\n\n // add guid\n Identifier pid = new Identifier();\n pid.setValue(resultSet.getString(\"guid\"));\n systemMetadata.setIdentifier(pid);\n \n // add seriesId\n Identifier seriesId = new Identifier();\n seriesId.setValue(resultSet.getString(\"series_id\"));\n systemMetadata.setSeriesId(seriesId);\n\n // add serialVersion\n BigInteger serialVersion = new BigInteger(resultSet.getString(\"serial_version\"));\n systemMetadata.setSerialVersion(serialVersion);\n\n // add date_modified\n Date dateSystemMetadataLastModified = resultSet.getTimestamp(\"date_modified\");\n systemMetadata.setDateSysMetadataModified(dateSystemMetadataLastModified);\n\n // add archived value, if it was stored\n boolean archived = resultSet.getBoolean(\"archived\"); // getBoolean returns false for null results\n if (!resultSet.wasNull())\n systemMetadata.setArchived(new Boolean(archived));\n\n // add date_uploaded\n Date dateUploaded = resultSet.getTimestamp(\"date_uploaded\");\n systemMetadata.setDateUploaded(dateUploaded);\n\n // add rights_holder\n Subject rightsHolderSubject = new Subject();\n String rightsHolder = resultSet.getString(\"rights_holder\");\n rightsHolderSubject.setValue(rightsHolder);\n systemMetadata.setRightsHolder(rightsHolderSubject);\n\n // add checksum, checksum_algorithm\n String checksum = resultSet.getString(\"checksum\");\n String checksumAlgorithm = resultSet.getString(\"checksum_algorithm\");\n Checksum checksumObject = new Checksum();\n checksumObject.setValue(checksum);\n checksumObject.setAlgorithm(checksumAlgorithm);\n systemMetadata.setChecksum(checksumObject);\n\n // add origin_member_node\n String originMemberNode = resultSet.getString(\"origin_member_node\");\n if (originMemberNode != null) {\n NodeReference omn = new NodeReference();\n omn.setValue(originMemberNode);\n systemMetadata.setOriginMemberNode(omn);\n }\n\n // add authoritive_member_node\n String authoritativeMemberNode = resultSet.getString(\"authoritive_member_node\");\n if (originMemberNode != null) {\n NodeReference amn = new NodeReference();\n amn.setValue(authoritativeMemberNode);\n systemMetadata.setAuthoritativeMemberNode(amn);\n }\n\n // add submitter\n String submitter = resultSet.getString(\"submitter\");\n if (submitter != null) {\n Subject submitterSubject = new Subject();\n submitterSubject.setValue(submitter);\n systemMetadata.setSubmitter(submitterSubject);\n }\n\n // add object_format\n String fmtidStr = resultSet.getString(\"object_format\");\n ObjectFormatIdentifier fmtid = new ObjectFormatIdentifier();\n fmtid.setValue(fmtidStr);\n systemMetadata.setFormatId(fmtid);\n\n // add size\n String size = resultSet.getString(\"size\");\n systemMetadata.setSize(new BigInteger(size));\n\n // add obsoletes\n String obsoletes = resultSet.getString(\"obsoletes\");\n if (obsoletes != null) {\n Identifier obsoletesId = new Identifier();\n obsoletesId.setValue(obsoletes);\n systemMetadata.setObsoletes(obsoletesId);\n }\n // add obsoleted_by\n String obsoletedBy = resultSet.getString(\"obsoleted_by\");\n if (obsoletedBy != null) {\n Identifier obsoletedById = new Identifier();\n obsoletedById.setValue(obsoletedBy);\n systemMetadata.setObsoletedBy(obsoletedById);\n }\n\n // potentially build a ReplicationPolicy\n \n // add replication_allowed, if it was persisted\n boolean replAllowed = resultSet.getBoolean(\"replication_allowed\"); // getBoolean returns false for null results\n \n if (!resultSet.wasNull()) {\n // populate and add ReplicationPolicy\n ReplicationPolicy replicationPolicy = new ReplicationPolicy();\n \n replicationPolicy.setReplicationAllowed(new Boolean(replAllowed));\n\n // add number_replicas\n int numberOfReplicas = resultSet.getInt(\"number_replicas\"); // getInt returns 0 for null values\n if (numberOfReplicas > 0) {\n replicationPolicy.setNumberReplicas(new Integer(numberOfReplicas));\n\n }\n\n // add preferred and blocked lists\n List<ReplicationPolicyEntry> replPolicies = new ArrayList<ReplicationPolicyEntry>();\n List<NodeReference> preferredNodes = new ArrayList<NodeReference>();\n List<NodeReference> blockedNodes = new ArrayList<NodeReference>();\n\n replPolicies = listReplicationPolicies(pid, localTableMap);\n\n for (ReplicationPolicyEntry policy : replPolicies) {\n Identifier id = policy.getPid();\n String entryPolicy = policy.getPolicy();\n NodeReference node = policy.getMemberNode();\n\n if (entryPolicy.equals(\"preferred\")) {\n preferredNodes.add(node);\n\n } else if (entryPolicy.equals(\"blocked\")) {\n blockedNodes.add(node);\n\n }\n }\n\n replicationPolicy.setPreferredMemberNodeList(preferredNodes);\n replicationPolicy.setBlockedMemberNodeList(blockedNodes);\n\n systemMetadata.setReplicationPolicy(replicationPolicy);\n } else {\n systemMetadata.setReplicationPolicy(null);\n }\n\n // populate and add replicas list\n\n List<Replica> replicas = new ArrayList<Replica>();\n replicas = listReplicaEntries(pid, localTableMap);\n systemMetadata.setReplicaList(replicas);\n\n // populate and add AccessPolicy\n List<AccessRule> accessRules = new ArrayList<AccessRule>();\n accessRules = listAccessRules(pid, localTableMap);\n accessPolicy.setAllowList(accessRules);\n systemMetadata.setAccessPolicy(accessPolicy);\n\n // Validate the system metadata in debug mode using TypeMarshaller\n if (log.isDebugEnabled()) {\n try {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n TypeMarshaller.marshalTypeToOutputStream(systemMetadata, baos);\n log.debug(\"SystemMetadata for pid \" + pid.getValue() + \" is: \"\n + baos.toString());\n\n } catch (MarshallingException e) {\n e.printStackTrace();\n\n } catch (IOException e) {\n e.printStackTrace();\n\n }\n }\n return systemMetadata;\n }", "public MetaData getMetaData() {\n return metaData;\n }", "public ResultSetMetaData getMetaData() throws SQLException\n {\n return m_rs.getMetaData();\n }", "public ShowTableMetadataResponse showTableMetadata(ShowTableMetadataRequest request) throws GPUdbException {\n ShowTableMetadataResponse actualResponse_ = new ShowTableMetadataResponse();\n submitRequest(\"/show/table/metadata\", request, actualResponse_, false);\n return actualResponse_;\n }", "SQLServerResultSetMetaData(SQLServerConnection con, SQLServerResultSet rs) \n {\n traceID = \" SQLServerResultSetMetaData:\" + nextInstanceID();\n this.con = con;\n this.rs =rs;\n assert rs !=null;\n if(logger.isLoggable(java.util.logging.Level.FINE))\n {\n logger.fine(toString() + \" created by (\" + rs.toString() + \")\");\n }\n }", "@Override\n public RavenJObject getMetadata() {\n return metadata;\n }", "@Override\n\tpublic List<Map<String, String>> selectReportInfo(String appId) {\n\t\treturn getSqlMap().queryForList(NAMESPACES + \"queryReportInfo\", appId);\n\t}", "void processMetaData(ResultSet rs) throws SQLException;", "public interface ColumnMetaData {\n\n\t/**\n\t * The uniqueness level of a column data type.\n\t */\n\tenum Uniqueness {\n\t\t/**\n\t\t * No limitations. Multiple instances of a single column meta data type can be attached to a table or even a\n\t\t * single column.\n\t\t */\n\t\tNONE,\n\n\t\t/**\n\t\t * Multiple instances of a single column meta data type can be attached to a table but at most one per column.\n\t\t */\n\t\tCOLUMN,\n\n\t\t/**\n\t\t * At most one instance of the column meta data type can be attached to a table.\n\t\t */\n\t\tTABLE\n\t}\n\n\t/**\n\t * The unique type id of the column meta data.\n\t *\n\t * @return the type id\n\t */\n\tString type();\n\n\t/**\n\t * The uniqueness level of the meta data. Defaults to {@link Uniqueness#NONE} (no restrictions).\n\t *\n\t * @return the uniqueness level\n\t */\n\tdefault Uniqueness uniqueness() {\n\t\treturn Uniqueness.NONE;\n\t}\n\n}", "public HashMap getMetaData() ;", "Metadata getMetaData();", "@Override\n public SystemMetadataStatus mapRow(ResultSet resultSet, int rowNumber) throws SQLException {\n\n // resultSet contains guid, serialVersion, date_modified, and archived column data\n SystemMetadataStatus systemMetadataStatus = new SystemMetadataStatus();\n\n // add guid\n Identifier pid = new Identifier();\n pid.setValue(resultSet.getString(\"guid\"));\n systemMetadataStatus.setPid(pid);\n\n // add serialVersion\n BigInteger serialVersion = new BigInteger(resultSet.getString(\"serial_version\"));\n systemMetadataStatus.setSerialVersion(serialVersion);\n\n // add date_modified\n Date dateSystemMetadataLastModified = resultSet.getTimestamp(\"date_modified\");\n systemMetadataStatus\n .setLastSystemMetadataModificationDate(dateSystemMetadataLastModified);\n\n // add archived\n boolean archived = resultSet.getBoolean(\"archived\"); // getBoolean returns false for null results\n systemMetadataStatus.setDeleted(new Boolean(archived));\n\n return systemMetadataStatus;\n }", "@Override\n public String toString() {\n return \"Report{\" +\n \"reportId=\" + reportId +\n \", reportOpId=\" + reportOp +\n \", date='\" + date + '\\'' +\n \", reportedUserId=\" + reportedUser +\n \", userId=\" + user +\n \", status=\" + status +\n '}';\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}", "CustomReport selectByPrimaryKey(BigDecimal reportId);", "public ResultSetMetaData getMetaData() throws SQLException {\n return currentPreparedStatement.getMetaData();\n }", "public ReportTable(TableView<Report> reportTable) {\n this.reportTable = reportTable;\n }", "public void analizeQueryResultMetaData(ResultSetMetaData rsMetaData, String[] decimalColumns){\n\t\tArrayList<Integer> decimalColumnResultsetIndexes = new ArrayList<Integer>();\n\t\t//if ( decimalColumns==null||decimalColumns.length==0)\n\t\t//\treturn ; \n\t\ttry {\n\t\t\t\n\t\t\t\n\t\t\t//IObjectToStringConverter[] converters = new IObjectToStringConverter[rsMetaData.getColumnCount()] ;\n\t\t\tOuputDataType[] dataTypes = new OuputDataType[rsMetaData.getColumnCount()] ;\n\t\t\tjobContext.put(ExportEngineConstant.COLUMN_CONVERTER_KEY, dataTypes);\n\t\t\tfor ( int i=1 ; i <= rsMetaData.getColumnCount(); i++){\n\t\t\t\tboolean isDecimal = false ; \n\t\t\t\tString nama = rsMetaData.getColumnName(i).toUpperCase();\n\t\t\t\tif ( decimalColumns!=null){\n\t\t\t\t\tfor ( String scn : decimalColumns){\n\t\t\t\t\t\tif ( nama.equalsIgnoreCase(scn)){\n\t\t\t\t\t\t\tdecimalColumnResultsetIndexes.add(i-1);\n\t\t\t\t\t\t\tisDecimal = true ;\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.money; \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\tif( !isDecimal){\n\t\t\t\t\tString tipeCol = rsMetaData.getColumnClassName(i) ;\n\t\t\t\t\tboolean isDate = false ; \n\t\t\t\t\tfor ( String scn : DATE_DATA_TYPES){\n\t\t\t\t\t\tif ( tipeCol.equals(scn)){\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.date; \n\t\t\t\t\t\t\tisDate = true ; \n\t\t\t\t\t\t\tbreak ; \n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( !isDate){\n\t\t\t\t\t\tif (String.class.getName().equals(tipeCol)){\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.string;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.commonToString;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfor ( OuputDataType scn : dataTypes ){\n\t\t\t\tSystem.out.println(\"converter : \" + scn);\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"gagal membaca data column unutk membuat converter object array. error message :\" + e.getMessage() , e); \n\t\t}\n\t\t\n\t\t\n\t}", "private static void writeColumnMetaData(JsonGenerator jg, ColumnMetaData mdt) throws JsonGenerationException, IOException {\n\t\tjg.writeStartObject();\n\t\tjg.writeStringField(\"name\", mdt.columnName);\n\t\tjg.writeStringField(\"type\", mdt.columnType);\n\t\tjg.writeEndObject();;\n\t}", "private String metadata() {\n\t\tStringBuilder s = new StringBuilder();\n\t\ts.append(\"#######################################\");\n\t\ts.append(\"\\n# Metadata of query set\");\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Queries\");\n\t\ts.append(\"\\n# \\tTotal: \" + this.num_queries);\n\t\ts.append(\"\\n# \\tPoint: \" + this.num_pt_queries + \" (\" + 100 * ((double) this.num_pt_queries/this.num_queries) +\"%)\");\n\t\ts.append(\"\\n# \\tRange: \" + this.num_range_queries + \" (\" + 100 * ((double) this.num_range_queries/this.num_queries) +\"%)\");\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Operators\");\n\t\ts.append(\"\\n# \\tTotal: \" + (this.num_and_ops + this.num_or_ops) + \" (\" + ((double) (this.num_and_ops + this.num_or_ops)/this.num_queries) +\" per query)\");\n\t\ts.append(\"\\n# \\tAND: \" + this.num_and_ops);\n\t\ts.append(\"\\n# \\tOR: \" + this.num_or_ops);\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Attributes\");\n\t\ts.append(\"\\n# \\tTotal queried: \" + this.num_attributes);\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Bins\");\n\t\ts.append(\"\\n# \\tTotal queried: \" + this.num_bins);\n\t\ts.append(\"\\n# \\tPer query: \" + ((double) this.num_bins/this.num_queries));\n\t\ts.append(\"\\n#######################################\\n\");\n\t\treturn s.toString();\n\t}", "public List<Map<String, Object>> getDatewiseUpdateData(String columnName) {\n\t\tList<Map<String, Object>> reportData = new ArrayList<>();\n\n\t\tswitch (columnName) {\n\t\tcase \"LASTUPDATED\":\n\t\t\treportData = getLastUpdatedReport();\n\t\t\tbreak;\n\t\tcase \"CREATEDON\":\n\t\t\treportData = getCreatedOnReport();\n\t\t\tbreak;\n\t\tcase \"READON\":\n\t\t\treportData = getReadOnReport();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tSystem.out.println(\"Invalid column name\");\n\t\t}\n\t\treturn reportData;\n\t}", "public Map<String, Object> getMetaData() {\n\t\treturn metaData;\n\t}", "public MetadataArtifactDownloadReport getReport() {\n return report;\n }", "public Map<String, ColumnMetaData> getColumns();", "public abstract String metadata(String property);", "@Override\n\tpublic IColumns createColumns() {\n\t\treturn new WaybillforauditColumns();\n\t}", "@Schema(description = \"`status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Binary general-info: The input information used to assemble the report that can be on-going, periodic and actual and projected \")\n public Object getAssessmentInstanceReportRecord() {\n return assessmentInstanceReportRecord;\n }", "public AlterTableMetadataResponse alterTableMetadata(AlterTableMetadataRequest request) throws GPUdbException {\n AlterTableMetadataResponse actualResponse_ = new AlterTableMetadataResponse();\n submitRequest(\"/alter/table/metadata\", request, actualResponse_, false);\n return actualResponse_;\n }", "public Long getReportId() {\n return reportId;\n }", "@Schema(description = \"`status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Binary general-info: The external report in any suitable form including selection filters where appropriate \")\n public Object getAssessmentInstanceReport() {\n return assessmentInstanceReport;\n }", "@SuppressWarnings(\"all\")\npublic interface I_I_BankDataJP \n{\n\n /** TableName=I_BankDataJP */\n public static final String Table_Name = \"I_BankDataJP\";\n\n /** AD_Table_ID=1000307 */\n public static final int Table_ID = MTable.getTable_ID(Table_Name);\n\n KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);\n\n /** AccessLevel = 3 - Client - Org \n */\n BigDecimal accessLevel = BigDecimal.valueOf(3);\n\n /** Load Meta Data */\n\n /** Column name AD_Client_ID */\n public static final String COLUMNNAME_AD_Client_ID = \"AD_Client_ID\";\n\n\t/** Get Tenant.\n\t * Tenant for this installation.\n\t */\n\tpublic int getAD_Client_ID();\n\n /** Column name AD_OrgTrx_ID */\n public static final String COLUMNNAME_AD_OrgTrx_ID = \"AD_OrgTrx_ID\";\n\n\t/** Set Trx Organization.\n\t * Performing or initiating organization\n\t */\n\tpublic void setAD_OrgTrx_ID (int AD_OrgTrx_ID);\n\n\t/** Get Trx Organization.\n\t * Performing or initiating organization\n\t */\n\tpublic int getAD_OrgTrx_ID();\n\n /** Column name AD_Org_ID */\n public static final String COLUMNNAME_AD_Org_ID = \"AD_Org_ID\";\n\n\t/** Set Organization.\n\t * Organizational entity within tenant\n\t */\n\tpublic void setAD_Org_ID (int AD_Org_ID);\n\n\t/** Get Organization.\n\t * Organizational entity within tenant\n\t */\n\tpublic int getAD_Org_ID();\n\n /** Column name AccountNo */\n public static final String COLUMNNAME_AccountNo = \"AccountNo\";\n\n\t/** Set Account No.\n\t * Account Number\n\t */\n\tpublic void setAccountNo (String AccountNo);\n\n\t/** Get Account No.\n\t * Account Number\n\t */\n\tpublic String getAccountNo();\n\n /** Column name BankAccountType */\n public static final String COLUMNNAME_BankAccountType = \"BankAccountType\";\n\n\t/** Set Bank Account Type.\n\t * Bank Account Type\n\t */\n\tpublic void setBankAccountType (String BankAccountType);\n\n\t/** Get Bank Account Type.\n\t * Bank Account Type\n\t */\n\tpublic String getBankAccountType();\n\n /** Column name C_BankAccount_ID */\n public static final String COLUMNNAME_C_BankAccount_ID = \"C_BankAccount_ID\";\n\n\t/** Set Bank Account.\n\t * Account at the Bank\n\t */\n\tpublic void setC_BankAccount_ID (int C_BankAccount_ID);\n\n\t/** Get Bank Account.\n\t * Account at the Bank\n\t */\n\tpublic int getC_BankAccount_ID();\n\n\tpublic org.compiere.model.I_C_BankAccount getC_BankAccount() throws RuntimeException;\n\n /** Column name C_Bank_ID */\n public static final String COLUMNNAME_C_Bank_ID = \"C_Bank_ID\";\n\n\t/** Set Bank.\n\t * Bank\n\t */\n\tpublic void setC_Bank_ID (int C_Bank_ID);\n\n\t/** Get Bank.\n\t * Bank\n\t */\n\tpublic int getC_Bank_ID();\n\n\tpublic org.compiere.model.I_C_Bank getC_Bank() throws RuntimeException;\n\n /** Column name Created */\n public static final String COLUMNNAME_Created = \"Created\";\n\n\t/** Get Created.\n\t * Date this record was created\n\t */\n\tpublic Timestamp getCreated();\n\n /** Column name CreatedBy */\n public static final String COLUMNNAME_CreatedBy = \"CreatedBy\";\n\n\t/** Get Created By.\n\t * User who created this records\n\t */\n\tpublic int getCreatedBy();\n\n /** Column name DateAcct */\n public static final String COLUMNNAME_DateAcct = \"DateAcct\";\n\n\t/** Set Account Date.\n\t * Accounting Date\n\t */\n\tpublic void setDateAcct (Timestamp DateAcct);\n\n\t/** Get Account Date.\n\t * Accounting Date\n\t */\n\tpublic Timestamp getDateAcct();\n\n /** Column name I_BankDataJP_ID */\n public static final String COLUMNNAME_I_BankDataJP_ID = \"I_BankDataJP_ID\";\n\n\t/** Set I_BankDataJP.\n\t * JPIERE-0595:JPBP\n\t */\n\tpublic void setI_BankDataJP_ID (int I_BankDataJP_ID);\n\n\t/** Get I_BankDataJP.\n\t * JPIERE-0595:JPBP\n\t */\n\tpublic int getI_BankDataJP_ID();\n\n /** Column name I_BankDataJP_UU */\n public static final String COLUMNNAME_I_BankDataJP_UU = \"I_BankDataJP_UU\";\n\n\t/** Set I_BankDataJP_UU\t */\n\tpublic void setI_BankDataJP_UU (String I_BankDataJP_UU);\n\n\t/** Get I_BankDataJP_UU\t */\n\tpublic String getI_BankDataJP_UU();\n\n /** Column name I_ErrorMsg */\n public static final String COLUMNNAME_I_ErrorMsg = \"I_ErrorMsg\";\n\n\t/** Set Import Error Message.\n\t * Messages generated from import process\n\t */\n\tpublic void setI_ErrorMsg (String I_ErrorMsg);\n\n\t/** Get Import Error Message.\n\t * Messages generated from import process\n\t */\n\tpublic String getI_ErrorMsg();\n\n /** Column name I_IsImported */\n public static final String COLUMNNAME_I_IsImported = \"I_IsImported\";\n\n\t/** Set Imported.\n\t * Has this import been processed\n\t */\n\tpublic void setI_IsImported (boolean I_IsImported);\n\n\t/** Get Imported.\n\t * Has this import been processed\n\t */\n\tpublic boolean isI_IsImported();\n\n /** Column name IsActive */\n public static final String COLUMNNAME_IsActive = \"IsActive\";\n\n\t/** Set Active.\n\t * The record is active in the system\n\t */\n\tpublic void setIsActive (boolean IsActive);\n\n\t/** Get Active.\n\t * The record is active in the system\n\t */\n\tpublic boolean isActive();\n\n /** Column name JP_A_Name */\n public static final String COLUMNNAME_JP_A_Name = \"JP_A_Name\";\n\n\t/** Set Account Name\t */\n\tpublic void setJP_A_Name (String JP_A_Name);\n\n\t/** Get Account Name\t */\n\tpublic String getJP_A_Name();\n\n /** Column name JP_A_Name_Kana */\n public static final String COLUMNNAME_JP_A_Name_Kana = \"JP_A_Name_Kana\";\n\n\t/** Set Account Name(Kana)\t */\n\tpublic void setJP_A_Name_Kana (String JP_A_Name_Kana);\n\n\t/** Get Account Name(Kana)\t */\n\tpublic String getJP_A_Name_Kana();\n\n /** Column name JP_AcctDate */\n public static final String COLUMNNAME_JP_AcctDate = \"JP_AcctDate\";\n\n\t/** Set Date of Account Date\t */\n\tpublic void setJP_AcctDate (String JP_AcctDate);\n\n\t/** Get Date of Account Date\t */\n\tpublic String getJP_AcctDate();\n\n /** Column name JP_AcctMonth */\n public static final String COLUMNNAME_JP_AcctMonth = \"JP_AcctMonth\";\n\n\t/** Set Month of Account Date\t */\n\tpublic void setJP_AcctMonth (String JP_AcctMonth);\n\n\t/** Get Month of Account Date\t */\n\tpublic String getJP_AcctMonth();\n\n /** Column name JP_BankAccountType */\n public static final String COLUMNNAME_JP_BankAccountType = \"JP_BankAccountType\";\n\n\t/** Set Bank Account Type\t */\n\tpublic void setJP_BankAccountType (String JP_BankAccountType);\n\n\t/** Get Bank Account Type\t */\n\tpublic String getJP_BankAccountType();\n\n /** Column name JP_BankAccount_Value */\n public static final String COLUMNNAME_JP_BankAccount_Value = \"JP_BankAccount_Value\";\n\n\t/** Set Bank Account(Search Key)\t */\n\tpublic void setJP_BankAccount_Value (String JP_BankAccount_Value);\n\n\t/** Get Bank Account(Search Key)\t */\n\tpublic String getJP_BankAccount_Value();\n\n /** Column name JP_BankDataCustomerCode1 */\n public static final String COLUMNNAME_JP_BankDataCustomerCode1 = \"JP_BankDataCustomerCode1\";\n\n\t/** Set Bank Data Customer Code1\t */\n\tpublic void setJP_BankDataCustomerCode1 (String JP_BankDataCustomerCode1);\n\n\t/** Get Bank Data Customer Code1\t */\n\tpublic String getJP_BankDataCustomerCode1();\n\n /** Column name JP_BankDataCustomerCode2 */\n public static final String COLUMNNAME_JP_BankDataCustomerCode2 = \"JP_BankDataCustomerCode2\";\n\n\t/** Set Bank Data Customer Code2\t */\n\tpublic void setJP_BankDataCustomerCode2 (String JP_BankDataCustomerCode2);\n\n\t/** Get Bank Data Customer Code2\t */\n\tpublic String getJP_BankDataCustomerCode2();\n\n /** Column name JP_BankDataLine_ID */\n public static final String COLUMNNAME_JP_BankDataLine_ID = \"JP_BankDataLine_ID\";\n\n\t/** Set Import Bank Data Line\t */\n\tpublic void setJP_BankDataLine_ID (int JP_BankDataLine_ID);\n\n\t/** Get Import Bank Data Line\t */\n\tpublic int getJP_BankDataLine_ID();\n\n\tpublic I_JP_BankDataLine getJP_BankDataLine() throws RuntimeException;\n\n /** Column name JP_BankData_EDI_Info */\n public static final String COLUMNNAME_JP_BankData_EDI_Info = \"JP_BankData_EDI_Info\";\n\n\t/** Set BankData EDI Info\t */\n\tpublic void setJP_BankData_EDI_Info (String JP_BankData_EDI_Info);\n\n\t/** Get BankData EDI Info\t */\n\tpublic String getJP_BankData_EDI_Info();\n\n /** Column name JP_BankData_ID */\n public static final String COLUMNNAME_JP_BankData_ID = \"JP_BankData_ID\";\n\n\t/** Set Import Bank Data\t */\n\tpublic void setJP_BankData_ID (int JP_BankData_ID);\n\n\t/** Get Import Bank Data\t */\n\tpublic int getJP_BankData_ID();\n\n\tpublic I_JP_BankData getJP_BankData() throws RuntimeException;\n\n /** Column name JP_BankData_ReferenceNo */\n public static final String COLUMNNAME_JP_BankData_ReferenceNo = \"JP_BankData_ReferenceNo\";\n\n\t/** Set Bank Data ReferenceNo\t */\n\tpublic void setJP_BankData_ReferenceNo (String JP_BankData_ReferenceNo);\n\n\t/** Get Bank Data ReferenceNo\t */\n\tpublic String getJP_BankData_ReferenceNo();\n\n /** Column name JP_BankName_Kana */\n public static final String COLUMNNAME_JP_BankName_Kana = \"JP_BankName_Kana\";\n\n\t/** Set Bank Name(Kana)\t */\n\tpublic void setJP_BankName_Kana (String JP_BankName_Kana);\n\n\t/** Get Bank Name(Kana)\t */\n\tpublic String getJP_BankName_Kana();\n\n /** Column name JP_BankName_Kana_Line */\n public static final String COLUMNNAME_JP_BankName_Kana_Line = \"JP_BankName_Kana_Line\";\n\n\t/** Set Bank Name(Kana) Line\t */\n\tpublic void setJP_BankName_Kana_Line (String JP_BankName_Kana_Line);\n\n\t/** Get Bank Name(Kana) Line\t */\n\tpublic String getJP_BankName_Kana_Line();\n\n /** Column name JP_Bank_Name */\n public static final String COLUMNNAME_JP_Bank_Name = \"JP_Bank_Name\";\n\n\t/** Set Bank Name\t */\n\tpublic void setJP_Bank_Name (String JP_Bank_Name);\n\n\t/** Get Bank Name\t */\n\tpublic String getJP_Bank_Name();\n\n /** Column name JP_BranchCode */\n public static final String COLUMNNAME_JP_BranchCode = \"JP_BranchCode\";\n\n\t/** Set Branch Code\t */\n\tpublic void setJP_BranchCode (String JP_BranchCode);\n\n\t/** Get Branch Code\t */\n\tpublic String getJP_BranchCode();\n\n /** Column name JP_BranchName */\n public static final String COLUMNNAME_JP_BranchName = \"JP_BranchName\";\n\n\t/** Set Branch Name\t */\n\tpublic void setJP_BranchName (String JP_BranchName);\n\n\t/** Get Branch Name\t */\n\tpublic String getJP_BranchName();\n\n /** Column name JP_BranchName_Kana */\n public static final String COLUMNNAME_JP_BranchName_Kana = \"JP_BranchName_Kana\";\n\n\t/** Set Branch Name(Kana)\t */\n\tpublic void setJP_BranchName_Kana (String JP_BranchName_Kana);\n\n\t/** Get Branch Name(Kana)\t */\n\tpublic String getJP_BranchName_Kana();\n\n /** Column name JP_BranchName_Kana_Line */\n public static final String COLUMNNAME_JP_BranchName_Kana_Line = \"JP_BranchName_Kana_Line\";\n\n\t/** Set Branch Name(Kana) Line\t */\n\tpublic void setJP_BranchName_Kana_Line (String JP_BranchName_Kana_Line);\n\n\t/** Get Branch Name(Kana) Line\t */\n\tpublic String getJP_BranchName_Kana_Line();\n\n /** Column name JP_Date */\n public static final String COLUMNNAME_JP_Date = \"JP_Date\";\n\n\t/** Set Date.\n\t * Date\n\t */\n\tpublic void setJP_Date (String JP_Date);\n\n\t/** Get Date.\n\t * Date\n\t */\n\tpublic String getJP_Date();\n\n /** Column name JP_Line_Description */\n public static final String COLUMNNAME_JP_Line_Description = \"JP_Line_Description\";\n\n\t/** Set Line Description\t */\n\tpublic void setJP_Line_Description (String JP_Line_Description);\n\n\t/** Get Line Description\t */\n\tpublic String getJP_Line_Description();\n\n /** Column name JP_Month */\n public static final String COLUMNNAME_JP_Month = \"JP_Month\";\n\n\t/** Set Month\t */\n\tpublic void setJP_Month (String JP_Month);\n\n\t/** Get Month\t */\n\tpublic String getJP_Month();\n\n /** Column name JP_OrgTrx_Value */\n public static final String COLUMNNAME_JP_OrgTrx_Value = \"JP_OrgTrx_Value\";\n\n\t/** Set Trx Organization(Search Key)\t */\n\tpublic void setJP_OrgTrx_Value (String JP_OrgTrx_Value);\n\n\t/** Get Trx Organization(Search Key)\t */\n\tpublic String getJP_OrgTrx_Value();\n\n /** Column name JP_Org_Value */\n public static final String COLUMNNAME_JP_Org_Value = \"JP_Org_Value\";\n\n\t/** Set Organization(Search Key)\t */\n\tpublic void setJP_Org_Value (String JP_Org_Value);\n\n\t/** Get Organization(Search Key)\t */\n\tpublic String getJP_Org_Value();\n\n /** Column name JP_RequesterName */\n public static final String COLUMNNAME_JP_RequesterName = \"JP_RequesterName\";\n\n\t/** Set Requester Name\t */\n\tpublic void setJP_RequesterName (String JP_RequesterName);\n\n\t/** Get Requester Name\t */\n\tpublic String getJP_RequesterName();\n\n /** Column name JP_SalesRep_EMail */\n public static final String COLUMNNAME_JP_SalesRep_EMail = \"JP_SalesRep_EMail\";\n\n\t/** Set Sales Rep(E-Mail)\t */\n\tpublic void setJP_SalesRep_EMail (String JP_SalesRep_EMail);\n\n\t/** Get Sales Rep(E-Mail)\t */\n\tpublic String getJP_SalesRep_EMail();\n\n /** Column name JP_SalesRep_Name */\n public static final String COLUMNNAME_JP_SalesRep_Name = \"JP_SalesRep_Name\";\n\n\t/** Set Sales Rep(Name)\t */\n\tpublic void setJP_SalesRep_Name (String JP_SalesRep_Name);\n\n\t/** Get Sales Rep(Name)\t */\n\tpublic String getJP_SalesRep_Name();\n\n /** Column name JP_SalesRep_Value */\n public static final String COLUMNNAME_JP_SalesRep_Value = \"JP_SalesRep_Value\";\n\n\t/** Set Sales Rep(Search Key)\t */\n\tpublic void setJP_SalesRep_Value (String JP_SalesRep_Value);\n\n\t/** Get Sales Rep(Search Key)\t */\n\tpublic String getJP_SalesRep_Value();\n\n /** Column name Processed */\n public static final String COLUMNNAME_Processed = \"Processed\";\n\n\t/** Set Processed.\n\t * The document has been processed\n\t */\n\tpublic void setProcessed (boolean Processed);\n\n\t/** Get Processed.\n\t * The document has been processed\n\t */\n\tpublic boolean isProcessed();\n\n /** Column name Processing */\n public static final String COLUMNNAME_Processing = \"Processing\";\n\n\t/** Set Process Now\t */\n\tpublic void setProcessing (boolean Processing);\n\n\t/** Get Process Now\t */\n\tpublic boolean isProcessing();\n\n /** Column name RoutingNo */\n public static final String COLUMNNAME_RoutingNo = \"RoutingNo\";\n\n\t/** Set Routing No.\n\t * Bank Routing Number\n\t */\n\tpublic void setRoutingNo (String RoutingNo);\n\n\t/** Get Routing No.\n\t * Bank Routing Number\n\t */\n\tpublic String getRoutingNo();\n\n /** Column name SalesRep_ID */\n public static final String COLUMNNAME_SalesRep_ID = \"SalesRep_ID\";\n\n\t/** Set Sales Rep.\n\t * Sales Representative or Company Agent\n\t */\n\tpublic void setSalesRep_ID (int SalesRep_ID);\n\n\t/** Get Sales Rep.\n\t * Sales Representative or Company Agent\n\t */\n\tpublic int getSalesRep_ID();\n\n\tpublic org.compiere.model.I_AD_User getSalesRep() throws RuntimeException;\n\n /** Column name StatementDate */\n public static final String COLUMNNAME_StatementDate = \"StatementDate\";\n\n\t/** Set Statement date.\n\t * Date of the statement\n\t */\n\tpublic void setStatementDate (Timestamp StatementDate);\n\n\t/** Get Statement date.\n\t * Date of the statement\n\t */\n\tpublic Timestamp getStatementDate();\n\n /** Column name StmtAmt */\n public static final String COLUMNNAME_StmtAmt = \"StmtAmt\";\n\n\t/** Set Statement amount.\n\t * Statement Amount\n\t */\n\tpublic void setStmtAmt (BigDecimal StmtAmt);\n\n\t/** Get Statement amount.\n\t * Statement Amount\n\t */\n\tpublic BigDecimal getStmtAmt();\n\n /** Column name TrxAmt */\n public static final String COLUMNNAME_TrxAmt = \"TrxAmt\";\n\n\t/** Set Transaction Amount.\n\t * Amount of a transaction\n\t */\n\tpublic void setTrxAmt (BigDecimal TrxAmt);\n\n\t/** Get Transaction Amount.\n\t * Amount of a transaction\n\t */\n\tpublic BigDecimal getTrxAmt();\n\n /** Column name Updated */\n public static final String COLUMNNAME_Updated = \"Updated\";\n\n\t/** Get Updated.\n\t * Date this record was updated\n\t */\n\tpublic Timestamp getUpdated();\n\n /** Column name UpdatedBy */\n public static final String COLUMNNAME_UpdatedBy = \"UpdatedBy\";\n\n\t/** Get Updated By.\n\t * User who updated this records\n\t */\n\tpublic int getUpdatedBy();\n}", "Map<String, Object> getAllMetadata();", "public static JasperReportBuilder generateReport(ExportData metaData,HttpServletRequest request){\n session = request.getSession(false);\n report = report(); // Creer le rapport\n \n //Logo\n// logoImg = cmp.image(inImg).setStyle(DynamicReports.stl.style().setHorizontalAlignment(HorizontalAlignment.LEFT)); \n //logoImg.setDimension(80,80); \n \n //Definit le style des colonnes d'entàte\n report.setColumnTitleStyle(getHeaderStyle(metaData));\n \n \n \n LinkedHashMap <String,String> criteria = metaData.getCriteria(); \n //Ajout la date d'àdition au critere d'impression\n String valDateProperty = getDateTxt(metaData.getLang()) ;\n String keyDateProperty = \"\" ;\n if ( session.getAttribute(\"activedLocale\").equals(\"fr\") ) {\n keyDateProperty = \"Edité le \" ;\n }\n else {\n keyDateProperty = \"Printed on \" ;\n }\n criteria.put(keyDateProperty,valDateProperty);\n \n StyleBuilder titleStyle = stl.style(boldStyle).setFontSize(16).setForegroundColor(new Color(0, 0, 0)).setHorizontalAlignment(HorizontalAlignment.RIGHT).setRightIndent(20);\n ComponentBuilder<?, ?> logoComponent = cmp.horizontalList(\n //cmp.image(Templates.class.getResource(\"/logopalm.png\")).setFixedDimension(150, 50).setStyle(stl.style().setLeftIndent(20)),\n cmp.verticalList(\n cmp.text(metaData.getTitle()).setStyle(titleStyle)\n )\n ).newRow()\n .add(cmp.horizontalList().add(cmp.hListCell(createCriteriaComponent(criteria,metaData)).heightFixedOnTop()))\n .newRow(); \n \n report.noData(logoComponent, cmp.text(\"Aucun enregistrement trouvà\").setStyle(stl.style().setHorizontalAlignment(HorizontalAlignment.CENTER).setTopPadding(30)));\n\n \n \n lblStyle = stl.style(Templates.columnStyle).setForegroundColor(new Color(60, 91, 31)); // Couleur du text \n colStyle = stl.style(Templates.columnStyle).setHorizontalAlignment(HorizontalAlignment.CENTER);\n \n groupStyle = stl.style().setForegroundColor(new Color(60, 91, 31)) \n .setBold(Boolean.TRUE)\n .setPadding(5)\n .setFontSize(13)\n .setHorizontalAlignment(HorizontalAlignment.CENTER); \n \n\n \n if(metaData.getTitle().equals(ITitle.PARCEL)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PARCEL_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SECTOR)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SECTOR_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BLOCK)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BLOCK_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ATTACK_PHYTO)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TREATMENT)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TREATMENT_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVEST)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVEST_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SERVICING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SERVICING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_PLANTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_PLANTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.FERTILIZATION)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.FERTILIZATION_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.CONTROL_PHYTO)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.CONTROL_PHYTO_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_FOLDING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_FOLDING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.MORTALITY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.MORTALITY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVESTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVESTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BUDGET)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.REPLACEMENT)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.REPLACEMENT_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.METEOROLOGY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.METEOROLOGY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_MATERIAL)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_MATERIAL_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLUVIOMETRY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLUVIOMETRY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ETP)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ETP_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HYGROMETRY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HYGROMETRY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TEMPERATURE)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TEMPERATURE_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.INSULATION)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.INSULATION_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.WORK)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.WORK_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }\n \n \n drColumns = new HashMap<String, TextColumnBuilder>(); \n groups = new ArrayList<String>();\n subtotals = new ArrayList<String>();\n \n //Definit la liste des colonnes du rapport\n ExportGenerator.getColumns(metaData); \n //Definit la liste des sous-totaux du rapport\n ExportGenerator.getSubTotals(metaData);\n \n \n //Genration des sous totaux\n for (String group : groups) {\n ColumnGroupBuilder group2 = grp.group(drColumns.get(group));\n report.groupBy(group2);\n for (String subtotal : subtotals) {\n report.subtotalsAtGroupFooter(group2,sbt.sum(drColumns.get(subtotal)));\n }\n }\n\n for (String subtotal : subtotals) {\n report.subtotalsAtSummary(sbt.sum(drColumns.get(subtotal))); \n }\n \n /*if(ExportGenerator.getColumnByNameField(\"plantingName\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL \"), ExportGenerator.getColumnByNameField(\"plantingName\"), Calculation.NOTHING));\n }*//*else if(ExportGenerator.getColumnByNameField(\"invoiceCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"invoiceCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"planterCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL\"), ExportGenerator.getColumnByNameField(\"planterCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"transportTicket\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"transportTicket\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"deliveryDate\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"deliveryDate\"), Calculation.NOTHING));\n }\n else if(ExportGenerator.getColumnByNameField(\"arroundPlantingTicketNumber\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"arroundPlantingTicketNumber\"), Calculation.NOTHING));\n }\n else if(ExportGenerator.getColumnByNameField(\"planterNumber\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"planterNumber\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"startPaymentDate\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"startPaymentDate\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"sectorCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"sectorCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"month\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL \"), ExportGenerator.getColumnByNameField(\"month\"), Calculation.NOTHING));\n }*/\n \n\n \n \n //Genere la source de donnàes du rapport\n report.setDataSource(metaData.getData());\n \n report.highlightDetailEvenRows(); \n \n \n // Definition de l'entete : valable uniquement pour la 1ere page\n HorizontalListBuilder hlb= null;\n \n hlb = cmp.horizontalList().add(\n cmp.hListCell(createCriteriaComponent(criteria,metaData)).heightFixedOnTop()\n );\n\n \n report.title(\n createCustomTitleComponent(metaData.getTitle()), // Titre\n hlb,// Liste Horizontal des Critàres \n cmp.verticalGap(12) // Marge de 12 px entre chaque critàre\n ); \n \n \n \n report.setPageMargin(DynamicReports.margin().setLeft(15).setTop(30).setRight(15).setBottom(30));\n report.setPageFormat(PageType.A3, PageOrientation.LANDSCAPE);\n report.pageFooter(DynamicReports.cmp.pageXslashY());\n return report;\n \n }", "public interface IReportDao extends IBaseDao<Report, Integer> {\n\t\n\t/**\n\t * 添加举报信息\n\t * @param report\n\t */\n\tpublic boolean addReport(Report report);\n\t\n\t/**\n\t * 修改举报信息\n\t * @param report\n\t * @return\n\t */\n\tpublic boolean updateReport(Report report);\n\t\n//\t/**\n//\t * 是否已经举报\n//\t * @param getReportGto\n//\t * @return\n//\t */\n//\tpublic boolean isHouseInfoReported(GetReportGto getReportGto);\n\t\n\t/**\n\t * 获取我与某条房源的举报信息\n\t * @param getReportGto\n\t * @return\n\t */\n\tpublic List<Report> getMyReport(GetReportGto getReportGto);\n}", "public interface TableDetailMapper {\n\n @Select(\"select * from dxh_sys.tabledetail where vendorId=0 and tableName='skuProfitDayReport'\")\n List<Map<String, Object>> list();\n\n}", "public Report getReport();", "BoltResultSetMetaData(List<Type> types, List<String> keys) {\n\t\tsuper(keys);\n\t\tthis.columnType = types.toArray(new Type[this.keys.size() + 1]);\n\n\t\t// we init columnType with the first record\n\t\t// in case first == last record\n\t\t/*for (int i = 1; i <= this.keys.size(); i++) {\n\t\t\tcolumnType[i] = this.getColumnDriverTypeOrDefault(i, InternalTypeSystem.TYPE_SYSTEM.STRING());\n\t\t}*/\n\t}", "@Override\r\n\tpublic Map<String, Object> getMetadata() {\n\t\treturn null;\r\n\t}", "@Select({\n \"select\",\n \"JNLNO, TRANDATE, ACCOUNTDATE, CHECKTYPE, STATUS, DONETIME, FILENAME\",\n \"from B_UMB_CHECKING_LOG\",\n \"where JNLNO = #{jnlno,jdbcType=VARCHAR}\"\n })\n @Results({\n @Result(column=\"JNLNO\", property=\"jnlno\", jdbcType=JdbcType.VARCHAR, id=true),\n @Result(column=\"TRANDATE\", property=\"trandate\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"ACCOUNTDATE\", property=\"accountdate\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"CHECKTYPE\", property=\"checktype\", jdbcType=JdbcType.CHAR),\n @Result(column=\"STATUS\", property=\"status\", jdbcType=JdbcType.CHAR),\n @Result(column=\"DONETIME\", property=\"donetime\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"FILENAME\", property=\"filename\", jdbcType=JdbcType.VARCHAR)\n })\n BUMBCheckingLog selectByPrimaryKey(BUMBCheckingLogKey key);", "@SqlQuery(\"select * from PLAYERSTATS\")\n List<PlayerStats> getAll();", "protected String getMetadataName() {\r\n\t\treturn METADATA_NAME;\r\n\t}", "public abstract String getSummaryForDatabase();", "private interface ReportColumnCallback\n {\n void handleReportColumn(DashboardReport report, String columnName) throws MojoExecutionException;\n }", "@Override\r\n \tpublic MetaData getMetaData(HttpHeaders headers) {\n \t\ttry {\r\n \t\t\treturn MetaDataUtil.getMetaData(new ViewListeEleve(), new HashMap<String, MetaData>(),new ArrayList<String>());\r\n \t\t} catch (Exception e) {\r\n \t\t\t// TODO Auto-generated catch block\r\n \t\t\tthrow new WebApplicationException(Response.serverError().entity(new String(\"MetaData parse error\")).build());\r\n \t\t} \r\n \t}", "public DefaultMetaData getMetaData() {\n\t\treturn this.metaData;\n\t}", "Report createReport();", "@Override\n public Map<String, String> createFieldToPropertyMapping() {\n final Map<String, String> mapping = super.createFieldToPropertyMapping();\n mapping.put(this.tableName + \".rsres_id\", \"id\");\n mapping.put(this.tableName + \".resource_id\", \"resourceId\");\n mapping.put(this.tableName + \".quantity\", QUANTITY);\n mapping.put(this.tableName + \".cost_rsres\", \"cost\");\n\n return mapping;\n }", "public String getReportsToBeGenerated(String reportType) {\r\n\t\tString query = \"\";\r\n\t\t\r\n\t\ttry (Connection connection = DatabaseConnection.getMySQLConnection();\r\n\t\t\t PreparedStatement stmt = connection.prepareStatement(query);) {\r\n\t\t\tResultSet result = stmt.executeQuery();\r\n\t\t\tStringJoiner reports = new StringJoiner(\",,\");\r\n\t\t\twhile (result.next()) {\r\n\t\t\t\treports.add(result.getString(\"REPORT_NAME\"));\r\n\t\t\t}\r\n\t\t\treturn reports.toString();\r\n\t\t} catch (SQLException e) {\r\n\t\t\tthrow new ReportGenerationException(\"An error occurred while retrieving reports to be generated.\", e);\r\n\t\t}\r\n\t}", "public String getMetaDataFileName() {\n return null;\n }", "public JDBCRawSqlQueryMetaData(Method method) {\n this.method = method;\n }", "public Map getMetadata() {\n return metadata;\n }", "public DatabaseMetaData(Statement s) {\n\t\t_stmt = s; // SQL-Connection\n\t\t_buffer = new StringBuffer(); // Output goes here\n\t\t_tables = new ArrayList<String>(); // List of tables\n\t\t\n\t\ttry {\n\t\t\t// Put table names in `_tables`\n\t\t\textractTableNames(_stmt.executeQuery(composeTableNamesQuery()));\n\n\t\t\t// fetch the string representation of each tables meta-data\n\t\t\tfor (String name : _tables)\n\t\t\t\t_buffer.append(new TableMeta(name)); \n\t\t} catch (SQLException e) { _error = true;}\n\t}", "private Builder() {\n super(net.explorys.samhat.z12.r837.X837Ins_2320_MOA_MedicareOutpatientAdjudicationInformation.SCHEMA$);\n }", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "public String toString() {\n return \"[JDBCRawSqlQueryMetaData : method=\" + method + \"]\";\n }", "Report selectByPrimaryKey(Integer id);", "java.lang.String getMetadata(int index);", "java.lang.String getMetadata(int index);", "public Integer getReportId() {\n return reportId;\n }", "@Schema(description = \"`status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Code general-info: The type of external report available \")\n public String getAssessmentInstanceReportType() {\n return assessmentInstanceReportType;\n }", "@Override\r\n\tpublic List<ReportAndSummary> findAll() {\n\t\tList<ReportAndSummary> result = reportAndSummaryDao.findAll();\r\n\t\treturn result;\r\n\t}", "private static Map<String, ColumnMetaData> buildColumnMetadataMap(ResultSet rs) {\n\t\t/*\n\t\t * LinkedHashmap to preserve key traversal order.\n\t\t * Important as we output rows as arrays of values where the index position in\n\t\t * the row implicitly corresponds to the entry order of the column map.\n\t\t * Reason for this is performance. \n\t\t */\n\t\tMap<String, ColumnMetaData> columnMap = Maps.newLinkedHashMap();\n\t\ttry {\n\t\t\tResultSetMetaData rmd = rs.getMetaData();\n\t\t\tfor (int i=1; i<= rmd.getColumnCount(); i++) {\n\t\t\t\tColumnMetaData cmd = \n\t\t\t\t\tnew ColumnMetaData(rmd.getColumnName(i), rmd.getColumnTypeName(i));\n\t\t\t\tcolumnMap.put(cmd.columnName, cmd);\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\tThrowables.propagate(e);\n\t\t}\n\t\treturn columnMap;\n\t}", "protected String getSqlTable() {\n\t\treturn \"Project\";\n\t}", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "public interface I_IHC_JobDataChange \n{\n\n /** TableName=IHC_JobDataChange */\n public static final String Table_Name = \"IHC_JobDataChange\";\n\n /** AD_Table_ID=1100135 */\n public static final int Table_ID = MTable.getTable_ID(Table_Name);\n\n KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);\n\n /** AccessLevel = 3 - Client - Org \n */\n BigDecimal accessLevel = BigDecimal.valueOf(3);\n\n /** Load Meta Data */\n\n /** Column name AD_Client_ID */\n public static final String COLUMNNAME_AD_Client_ID = \"AD_Client_ID\";\n\n\t/** Get Client.\n\t * Client/Tenant for this installation.\n\t */\n\tpublic int getAD_Client_ID();\n\n /** Column name AD_Org_ID */\n public static final String COLUMNNAME_AD_Org_ID = \"AD_Org_ID\";\n\n\t/** Set Organization.\n\t * Organizational entity within client\n\t */\n\tpublic void setAD_Org_ID (int AD_Org_ID);\n\n\t/** Get Organization.\n\t * Organizational entity within client\n\t */\n\tpublic int getAD_Org_ID();\n\n /** Column name BPJSRegistrationDate */\n public static final String COLUMNNAME_BPJSRegistrationDate = \"BPJSRegistrationDate\";\n\n\t/** Set BPJS Registration Date\t */\n\tpublic void setBPJSRegistrationDate (Timestamp BPJSRegistrationDate);\n\n\t/** Get BPJS Registration Date\t */\n\tpublic Timestamp getBPJSRegistrationDate();\n\n /** Column name Created */\n public static final String COLUMNNAME_Created = \"Created\";\n\n\t/** Get Created.\n\t * Date this record was created\n\t */\n\tpublic Timestamp getCreated();\n\n /** Column name CreatedBy */\n public static final String COLUMNNAME_CreatedBy = \"CreatedBy\";\n\n\t/** Get Created By.\n\t * User who created this records\n\t */\n\tpublic int getCreatedBy();\n\n /** Column name Description */\n public static final String COLUMNNAME_Description = \"Description\";\n\n\t/** Set Description.\n\t * Optional short description of the record\n\t */\n\tpublic void setDescription (String Description);\n\n\t/** Get Description.\n\t * Optional short description of the record\n\t */\n\tpublic String getDescription();\n\n /** Column name DescriptionNew */\n public static final String COLUMNNAME_DescriptionNew = \"DescriptionNew\";\n\n\t/** Set Description New\t */\n\tpublic void setDescriptionNew (String DescriptionNew);\n\n\t/** Get Description New\t */\n\tpublic String getDescriptionNew();\n\n /** Column name HC_Compensation1 */\n public static final String COLUMNNAME_HC_Compensation1 = \"HC_Compensation1\";\n\n\t/** Set Compensation 1\t */\n\tpublic void setHC_Compensation1 (BigDecimal HC_Compensation1);\n\n\t/** Get Compensation 1\t */\n\tpublic BigDecimal getHC_Compensation1();\n\n /** Column name HC_Compensation2 */\n public static final String COLUMNNAME_HC_Compensation2 = \"HC_Compensation2\";\n\n\t/** Set Compensation 2\t */\n\tpublic void setHC_Compensation2 (BigDecimal HC_Compensation2);\n\n\t/** Get Compensation 2\t */\n\tpublic BigDecimal getHC_Compensation2();\n\n /** Column name HC_Compensation3 */\n public static final String COLUMNNAME_HC_Compensation3 = \"HC_Compensation3\";\n\n\t/** Set Compensation 3\t */\n\tpublic void setHC_Compensation3 (BigDecimal HC_Compensation3);\n\n\t/** Get Compensation 3\t */\n\tpublic BigDecimal getHC_Compensation3();\n\n /** Column name HC_Compensation4 */\n public static final String COLUMNNAME_HC_Compensation4 = \"HC_Compensation4\";\n\n\t/** Set Compensation 4\t */\n\tpublic void setHC_Compensation4 (BigDecimal HC_Compensation4);\n\n\t/** Get Compensation 4\t */\n\tpublic BigDecimal getHC_Compensation4();\n\n /** Column name HC_EffectiveSeq */\n public static final String COLUMNNAME_HC_EffectiveSeq = \"HC_EffectiveSeq\";\n\n\t/** Set Effective Sequence\t */\n\tpublic void setHC_EffectiveSeq (int HC_EffectiveSeq);\n\n\t/** Get Effective Sequence\t */\n\tpublic int getHC_EffectiveSeq();\n\n /** Column name HC_Employee_ID */\n public static final String COLUMNNAME_HC_Employee_ID = \"HC_Employee_ID\";\n\n\t/** Set Employee Data\t */\n\tpublic void setHC_Employee_ID (int HC_Employee_ID);\n\n\t/** Get Employee Data\t */\n\tpublic int getHC_Employee_ID();\n\n\tpublic I_HC_Employee getHC_Employee() throws RuntimeException;\n\n /** Column name HC_EmployeeGrade_ID */\n public static final String COLUMNNAME_HC_EmployeeGrade_ID = \"HC_EmployeeGrade_ID\";\n\n\t/** Set Employee Grade\t */\n\tpublic void setHC_EmployeeGrade_ID (int HC_EmployeeGrade_ID);\n\n\t/** Get Employee Grade\t */\n\tpublic int getHC_EmployeeGrade_ID();\n\n\tpublic I_HC_EmployeeGrade getHC_EmployeeGrade() throws RuntimeException;\n\n /** Column name HC_EmployeeGrade2_ID */\n public static final String COLUMNNAME_HC_EmployeeGrade2_ID = \"HC_EmployeeGrade2_ID\";\n\n\t/** Set Employee Grade To\t */\n\tpublic void setHC_EmployeeGrade2_ID (int HC_EmployeeGrade2_ID);\n\n\t/** Get Employee Grade To\t */\n\tpublic int getHC_EmployeeGrade2_ID();\n\n\tpublic I_HC_EmployeeGrade getHC_EmployeeGrade2() throws RuntimeException;\n\n /** Column name HC_EmployeeJob_ID */\n public static final String COLUMNNAME_HC_EmployeeJob_ID = \"HC_EmployeeJob_ID\";\n\n\t/** Set Employee Job Data\t */\n\tpublic void setHC_EmployeeJob_ID (int HC_EmployeeJob_ID);\n\n\t/** Get Employee Job Data\t */\n\tpublic int getHC_EmployeeJob_ID();\n\n\tpublic I_HC_EmployeeJob getHC_EmployeeJob() throws RuntimeException;\n\n /** Column name HC_Job_ID */\n public static final String COLUMNNAME_HC_Job_ID = \"HC_Job_ID\";\n\n\t/** Set Job\t */\n\tpublic void setHC_Job_ID (int HC_Job_ID);\n\n\t/** Get Job\t */\n\tpublic int getHC_Job_ID();\n\n\tpublic I_HC_Job getHC_Job() throws RuntimeException;\n\n /** Column name HC_JobAction */\n public static final String COLUMNNAME_HC_JobAction = \"HC_JobAction\";\n\n\t/** Set Job Action\t */\n\tpublic void setHC_JobAction (String HC_JobAction);\n\n\t/** Get Job Action\t */\n\tpublic String getHC_JobAction();\n\n /** Column name HC_JobDataChange_ID */\n public static final String COLUMNNAME_HC_JobDataChange_ID = \"HC_JobDataChange_ID\";\n\n\t/** Set Job Data Change\t */\n\tpublic void setHC_JobDataChange_ID (int HC_JobDataChange_ID);\n\n\t/** Get Job Data Change\t */\n\tpublic int getHC_JobDataChange_ID();\n\n\tpublic I_HC_JobDataChange getHC_JobDataChange() throws RuntimeException;\n\n /** Column name HC_Manager_ID */\n public static final String COLUMNNAME_HC_Manager_ID = \"HC_Manager_ID\";\n\n\t/** Set Manager Name\t */\n\tpublic void setHC_Manager_ID (int HC_Manager_ID);\n\n\t/** Get Manager Name\t */\n\tpublic int getHC_Manager_ID();\n\n\tpublic I_HC_Employee getHC_Manager() throws RuntimeException;\n\n /** Column name HC_ManagerTo_ID */\n public static final String COLUMNNAME_HC_ManagerTo_ID = \"HC_ManagerTo_ID\";\n\n\t/** Set Manager To ID\t */\n\tpublic void setHC_ManagerTo_ID (int HC_ManagerTo_ID);\n\n\t/** Get Manager To ID\t */\n\tpublic int getHC_ManagerTo_ID();\n\n\tpublic I_HC_Employee getHC_ManagerTo() throws RuntimeException;\n\n /** Column name HC_Org_ID */\n public static final String COLUMNNAME_HC_Org_ID = \"HC_Org_ID\";\n\n\t/** Set HC Organization\t */\n\tpublic void setHC_Org_ID (int HC_Org_ID);\n\n\t/** Get HC Organization\t */\n\tpublic int getHC_Org_ID();\n\n\tpublic I_HC_Org getHC_Org() throws RuntimeException;\n\n /** Column name HC_Org2_ID */\n public static final String COLUMNNAME_HC_Org2_ID = \"HC_Org2_ID\";\n\n\t/** Set HC Organization To\t */\n\tpublic void setHC_Org2_ID (int HC_Org2_ID);\n\n\t/** Get HC Organization To\t */\n\tpublic int getHC_Org2_ID();\n\n\tpublic I_HC_Org getHC_Org2() throws RuntimeException;\n\n /** Column name HC_PayGroup_ID */\n public static final String COLUMNNAME_HC_PayGroup_ID = \"HC_PayGroup_ID\";\n\n\t/** Set Payroll Group\t */\n\tpublic void setHC_PayGroup_ID (int HC_PayGroup_ID);\n\n\t/** Get Payroll Group\t */\n\tpublic int getHC_PayGroup_ID();\n\n\tpublic I_HC_PayGroup getHC_PayGroup() throws RuntimeException;\n\n /** Column name HC_PreviousJob_ID */\n public static final String COLUMNNAME_HC_PreviousJob_ID = \"HC_PreviousJob_ID\";\n\n\t/** Set Job Sekarang\t */\n\tpublic void setHC_PreviousJob_ID (int HC_PreviousJob_ID);\n\n\t/** Get Job Sekarang\t */\n\tpublic int getHC_PreviousJob_ID();\n\n\tpublic I_HC_Job getHC_PreviousJob() throws RuntimeException;\n\n /** Column name HC_Reason_ID */\n public static final String COLUMNNAME_HC_Reason_ID = \"HC_Reason_ID\";\n\n\t/** Set HC Reason\t */\n\tpublic void setHC_Reason_ID (int HC_Reason_ID);\n\n\t/** Get HC Reason\t */\n\tpublic int getHC_Reason_ID();\n\n\tpublic I_HC_Reason getHC_Reason() throws RuntimeException;\n\n /** Column name HC_Status */\n public static final String COLUMNNAME_HC_Status = \"HC_Status\";\n\n\t/** Set HC Status\t */\n\tpublic void setHC_Status (String HC_Status);\n\n\t/** Get HC Status\t */\n\tpublic String getHC_Status();\n\n /** Column name HC_WorkEndDate */\n public static final String COLUMNNAME_HC_WorkEndDate = \"HC_WorkEndDate\";\n\n\t/** Set Work End Date\t */\n\tpublic void setHC_WorkEndDate (Timestamp HC_WorkEndDate);\n\n\t/** Get Work End Date\t */\n\tpublic Timestamp getHC_WorkEndDate();\n\n /** Column name HC_WorkPeriodDate */\n public static final String COLUMNNAME_HC_WorkPeriodDate = \"HC_WorkPeriodDate\";\n\n\t/** Set WorkPeriodDate\t */\n\tpublic void setHC_WorkPeriodDate (String HC_WorkPeriodDate);\n\n\t/** Get WorkPeriodDate\t */\n\tpublic String getHC_WorkPeriodDate();\n\n /** Column name HC_WorkStartDate */\n public static final String COLUMNNAME_HC_WorkStartDate = \"HC_WorkStartDate\";\n\n\t/** Set WorkStartDate\t */\n\tpublic void setHC_WorkStartDate (Timestamp HC_WorkStartDate);\n\n\t/** Get WorkStartDate\t */\n\tpublic Timestamp getHC_WorkStartDate();\n\n /** Column name HC_WorkStartDate2 */\n public static final String COLUMNNAME_HC_WorkStartDate2 = \"HC_WorkStartDate2\";\n\n\t/** Set Work Start Date Baru\t */\n\tpublic void setHC_WorkStartDate2 (Timestamp HC_WorkStartDate2);\n\n\t/** Get Work Start Date Baru\t */\n\tpublic Timestamp getHC_WorkStartDate2();\n\n /** Column name IHC_JobDataChange_ID */\n public static final String COLUMNNAME_IHC_JobDataChange_ID = \"IHC_JobDataChange_ID\";\n\n\t/** Set IHC_JobDayaChange\t */\n\tpublic void setIHC_JobDataChange_ID (int IHC_JobDataChange_ID);\n\n\t/** Get IHC_JobDayaChange\t */\n\tpublic int getIHC_JobDataChange_ID();\n\n /** Column name IHC_JobDataChange_UU */\n public static final String COLUMNNAME_IHC_JobDataChange_UU = \"IHC_JobDataChange_UU\";\n\n\t/** Set IHC_JobDataChange_UU\t */\n\tpublic void setIHC_JobDataChange_UU (String IHC_JobDataChange_UU);\n\n\t/** Get IHC_JobDataChange_UU\t */\n\tpublic String getIHC_JobDataChange_UU();\n\n /** Column name IsActive */\n public static final String COLUMNNAME_IsActive = \"IsActive\";\n\n\t/** Set Active.\n\t * The record is active in the system\n\t */\n\tpublic void setIsActive (boolean IsActive);\n\n\t/** Get Active.\n\t * The record is active in the system\n\t */\n\tpublic boolean isActive();\n\n /** Column name IsCancelled */\n public static final String COLUMNNAME_IsCancelled = \"IsCancelled\";\n\n\t/** Set Cancelled.\n\t * The transaction was cancelled\n\t */\n\tpublic void setIsCancelled (boolean IsCancelled);\n\n\t/** Get Cancelled.\n\t * The transaction was cancelled\n\t */\n\tpublic boolean isCancelled();\n\n /** Column name NomorSK */\n public static final String COLUMNNAME_NomorSK = \"NomorSK\";\n\n\t/** Set Nomor SK\t */\n\tpublic void setNomorSK (String NomorSK);\n\n\t/** Get Nomor SK\t */\n\tpublic String getNomorSK();\n\n /** Column name NomorSK2 */\n public static final String COLUMNNAME_NomorSK2 = \"NomorSK2\";\n\n\t/** Set Nomor SK Baru\t */\n\tpublic void setNomorSK2 (String NomorSK2);\n\n\t/** Get Nomor SK Baru\t */\n\tpublic String getNomorSK2();\n\n /** Column name OriginalServiceData */\n public static final String COLUMNNAME_OriginalServiceData = \"OriginalServiceData\";\n\n\t/** Set Original Service Date\t */\n\tpublic void setOriginalServiceData (Timestamp OriginalServiceData);\n\n\t/** Get Original Service Date\t */\n\tpublic Timestamp getOriginalServiceData();\n\n /** Column name Processed */\n public static final String COLUMNNAME_Processed = \"Processed\";\n\n\t/** Set Processed.\n\t * The document has been processed\n\t */\n\tpublic void setProcessed (boolean Processed);\n\n\t/** Get Processed.\n\t * The document has been processed\n\t */\n\tpublic boolean isProcessed();\n\n /** Column name SeqNo */\n public static final String COLUMNNAME_SeqNo = \"SeqNo\";\n\n\t/** Set Sequence.\n\t * Method of ordering records;\n lowest number comes first\n\t */\n\tpublic void setSeqNo (int SeqNo);\n\n\t/** Get Sequence.\n\t * Method of ordering records;\n lowest number comes first\n\t */\n\tpublic int getSeqNo();\n\n /** Column name Updated */\n public static final String COLUMNNAME_Updated = \"Updated\";\n\n\t/** Get Updated.\n\t * Date this record was updated\n\t */\n\tpublic Timestamp getUpdated();\n\n /** Column name UpdatedBy */\n public static final String COLUMNNAME_UpdatedBy = \"UpdatedBy\";\n\n\t/** Get Updated By.\n\t * User who updated this records\n\t */\n\tpublic int getUpdatedBy();\n}" ]
[ "0.720387", "0.60612166", "0.5897073", "0.5817371", "0.58169", "0.5653088", "0.5575094", "0.5565293", "0.5523116", "0.55214834", "0.5424825", "0.5421459", "0.5377486", "0.534678", "0.5342339", "0.53190213", "0.5239825", "0.5236659", "0.5227619", "0.513109", "0.5122094", "0.5114957", "0.5110571", "0.5092275", "0.50793064", "0.50710756", "0.50666755", "0.50432736", "0.50225407", "0.5009165", "0.5007035", "0.49747992", "0.49714422", "0.49305487", "0.4928956", "0.49114767", "0.49047396", "0.4894513", "0.488628", "0.48804012", "0.48787948", "0.4848689", "0.4836264", "0.4834436", "0.48120287", "0.4810927", "0.4800393", "0.4796319", "0.4796208", "0.47960824", "0.47906667", "0.4782785", "0.47692993", "0.47681826", "0.47613847", "0.47506967", "0.4746286", "0.47449973", "0.4743577", "0.47416592", "0.47313273", "0.47218567", "0.47168458", "0.47161394", "0.47148344", "0.47092924", "0.47078082", "0.4703429", "0.46990865", "0.46964943", "0.46792674", "0.4675461", "0.4675461", "0.4675461", "0.4675461", "0.4675461", "0.46668383", "0.4666713", "0.46600732", "0.46600732", "0.4655324", "0.46417722", "0.46361163", "0.46348158", "0.46313247", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.4627627" ]
0.47236001
61
This method was generated by MyBatis Generator. This method corresponds to the database table core.report_metadata
public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "TableReportMetadata getReportMetadata(String reportId);", "public abstract List<ColumnSpecification> metadata();", "@Override\r\n\t\tpublic DatabaseMetaData getMetaData() throws SQLException {\n\t\t\treturn null;\r\n\t\t}", "@Override\n\tpublic JDBCMetaData getMetaData() throws SQLException {\n\t\treturn null;\n\t}", "private void writeMetaData(ResultSet resultSet) throws SQLException {\n\t System.out.println(\"The columns in the table are: \");\r\n\t System.out.println(\"Table: \" + resultSet.getMetaData().getTableName(1));\r\n\t for (int i = 1; i<= resultSet.getMetaData().getColumnCount(); i++){\r\n\t System.out.println(\"Column \" +i + \" \"+ resultSet.getMetaData().getColumnName(i));\r\n\t }\r\n\t }", "public interface TableMetaData {\n\n\t/** Adds normal column. */\n\tpublic void addColumn(final ColumnMetaData column);\n\n\t/** Adds primary key column. */\n\tpublic void addPrimaryKey(final ColumnMetaData column);\n\n\t/** Returns map of column meta data, keyed by the column label (the alias if provided in the query, otherwise the name). */\n\tpublic Map<String, ColumnMetaData> getColumns();\n\n\t/** Returns database name. */\n\tpublic String getDatabaseName();\n\n\t/** Returns ordered list of columns that are primary keys. */\n\tpublic List<ColumnMetaData> getPrimaryKeys();\n\n\t/**\n\t * Returns fully qualified table name in database-specific form for use in SQL statements. MySQL uses the form\n\t * <code>database.table</code>, for example <code>sakila.film</code>. PostgreSQL uses the form\n\t * <code>database.schema.table</code>, for example <code>sakila.public.film</code>.\n\t */\n\tpublic String getQualifiedTableName();\n\n\t/** Returns row alias. */\n\tpublic String getRowAlias();\n\t\n\t/** Returns row set alias. */\n\tpublic String getRowSetAlias();\n\t\n\t/**\n\t * Returns row alias.\n\t * \n * @deprecated As of 0.8.11 use {@link #getRowAlias()}\n\t */\n\t@Deprecated\n\tpublic String getTableAlias();\n\n\t/** Returns table name. */\n\tpublic String getTableName();\n\n\t/** Returns role of table in the SQL Resource. */\n\tpublic TableRole getTableRole();\n\n\t/** Returns true if the SQL Resource role is child. */\n\tpublic boolean isChild();\n\n\t/** Returns true if the SQL Resource role is parent. */\n\tpublic boolean isParent();\n\n\t/** Sets all the row and row set aliases. */\n\tpublic void setAliases(final String alias, final String rowAlias, final String rowSetAlias);\n\n\t/** Sets attributes. */\n\tpublic void setAttributes(final String tableName, final String qualifedTableName,\n\t\t\tfinal String databaseName, final TableRole tableRole);\n\n\t/**\n\t * Sets table alias.\n\t * \n * @deprecated As of 0.8.11 use {@link #setAliases(String, String, String)}\n\t */\n\t@Deprecated\n\tpublic void setTableAlias(final String tableAlias);\n\t\n\t/** Represents all of the roles a table may plan in a SQL Resource. */\n\t@XmlType(namespace = \"http://restsql.org/schema\")\n\tpublic enum TableRole {\n\t\tChild, ChildExtension, Join, Parent, ParentExtension, Unknown;\n\t}\n}", "public abstract List<String> newReportColumns();", "ResultSetMetaData getMetaData() throws SQLException;", "public DBMetaDataSet getMetaData()\n\t{\n\t\treturn _MetaData;\n\t}", "public interface SqlResourceMetaData {\r\n\r\n\tpublic List<ColumnMetaData> getAllReadColumns();\r\n\r\n\tpublic TableMetaData getChild();\r\n\r\n\tpublic List<TableMetaData> getChildPlusExtTables();\r\n\r\n\tpublic List<ColumnMetaData> getChildReadColumns();\r\n\r\n\tpublic TableMetaData getJoin();\r\n\r\n\tpublic List<TableMetaData> getJoinList();\r\n\r\n\tpublic int getNumberTables();\r\n\r\n\tpublic TableMetaData getParent();\r\n\r\n\tpublic List<TableMetaData> getParentPlusExtTables();\r\n\r\n\tpublic List<ColumnMetaData> getParentReadColumns();\r\n\r\n\tpublic Map<String, TableMetaData> getTableMap();\r\n\r\n\tpublic List<TableMetaData> getTables();\r\n\r\n\tpublic List<TableMetaData> getWriteTables(final Type requestType, final boolean doParent);\r\n\r\n\tpublic boolean hasJoinTable();\r\n\r\n\tpublic boolean hasMultipleDatabases();\r\n\r\n\tpublic boolean isHierarchical();\r\n\r\n\tpublic void init(final String sqlResourceName, final SqlResourceDefinition definition, final SqlBuilder sqlBuilder)\r\n\t\t\tthrows SqlResourceException;\r\n\r\n\tpublic String toHtml();\r\n\r\n\tpublic String toXml();\r\n}", "public void addColumnPathReportId() {\n addColumnInPath(ColumnMetaData.KEY_PATH_ID);\n }", "public ResultSetMetaData getMetaData() throws SQLException {\n\n try {\n int id = getNextId(TraceObject.RESULT_SET_META_DATA);\n if (isDebugEnabled()) {\n debugCodeAssign(\"ResultSetMetaData\", TraceObject.RESULT_SET_META_DATA, id, \"getMetaData()\");\n }\n checkClosed();\n String catalog = conn.getCatalog();\n JdbcResultSetMetaData meta = new JdbcResultSetMetaData(this, null, result, catalog, conn.getSession().getTrace(), id);\n return meta;\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "public MetaData getMetaData();", "@Override\n public DatabaseMetaData getMetaData() throws SQLException\n {\n logger.debug(\n \" public DatabaseMetaData getMetaData() throws SQLException\");\n\n return new SnowflakeDatabaseMetaData(this);\n }", "public DataSetMetaData getMetaData() {\n return this.metadata;\n }", "@Test\n public void metaDataExample1() throws SQLException {\n Connection connection = DriverManager.getConnection(dbUrl, dbUsername, dbPassword);\n // 2. Create statement\n Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);\n // Run sql query and get the result in resultSet object\n String sqlQuery= \"Select * From departments\";\n //String sqlQuery= \"Select first_name, last_name, salary From employees\";\n ResultSet resultSet = statement.executeQuery(sqlQuery);\n\n // we use resultSet metadata to get information about the tables\n // get the resultSet object metadata\n ResultSetMetaData rsMetadata = resultSet.getMetaData();\n\n // List for keeping all rows as a map\n List<Map<String, Object>> queryData = new ArrayList<>();\n\n // while(resultSet.next()) helps to iterate through columns\n while (resultSet.next()) {\n // key(columns) will be string but value can be any type of data. That's why we choose <String, Object>\n Map<String, Object> row = new HashMap<>(); // creating empty Map\n // number of columns\n int colCount = rsMetadata.getColumnCount();\n // for loop helps to iterate through columns\n for (int i = 1; i <= colCount; i++) {\n row.put(rsMetadata.getColumnName(i), resultSet.getObject(i));\n }\n\n queryData.add(row); // adding a Map to the List of Maps\n }\n\n // Printing the rows\n for (Map<String, Object> row: queryData) {\n System.out.println(row.toString());\n\n }\n\n\n\n\n // close all connections\n resultSet.close();\n statement.close();\n connection.close();\n }", "@Override\n\tpublic DBMetadata getMetadata() {\n\t\treturn null;\n\t}", "public MetaData getMetaData() {\r\n \treturn metaData;\r\n }", "@Override\n public SystemMetadata mapRow(ResultSet resultSet, int rowNumber) throws SQLException {\n\n // resultSet contains guid, serialVersion, date_modified, and archived column data\n SystemMetadata systemMetadata = new SystemMetadata();\n ReplicationPolicy replPolicy = new ReplicationPolicy();\n AccessPolicy accessPolicy = new AccessPolicy();\n\n // add guid\n Identifier pid = new Identifier();\n pid.setValue(resultSet.getString(\"guid\"));\n systemMetadata.setIdentifier(pid);\n \n // add seriesId\n Identifier seriesId = new Identifier();\n seriesId.setValue(resultSet.getString(\"series_id\"));\n systemMetadata.setSeriesId(seriesId);\n\n // add serialVersion\n BigInteger serialVersion = new BigInteger(resultSet.getString(\"serial_version\"));\n systemMetadata.setSerialVersion(serialVersion);\n\n // add date_modified\n Date dateSystemMetadataLastModified = resultSet.getTimestamp(\"date_modified\");\n systemMetadata.setDateSysMetadataModified(dateSystemMetadataLastModified);\n\n // add archived value, if it was stored\n boolean archived = resultSet.getBoolean(\"archived\"); // getBoolean returns false for null results\n if (!resultSet.wasNull())\n systemMetadata.setArchived(new Boolean(archived));\n\n // add date_uploaded\n Date dateUploaded = resultSet.getTimestamp(\"date_uploaded\");\n systemMetadata.setDateUploaded(dateUploaded);\n\n // add rights_holder\n Subject rightsHolderSubject = new Subject();\n String rightsHolder = resultSet.getString(\"rights_holder\");\n rightsHolderSubject.setValue(rightsHolder);\n systemMetadata.setRightsHolder(rightsHolderSubject);\n\n // add checksum, checksum_algorithm\n String checksum = resultSet.getString(\"checksum\");\n String checksumAlgorithm = resultSet.getString(\"checksum_algorithm\");\n Checksum checksumObject = new Checksum();\n checksumObject.setValue(checksum);\n checksumObject.setAlgorithm(checksumAlgorithm);\n systemMetadata.setChecksum(checksumObject);\n\n // add origin_member_node\n String originMemberNode = resultSet.getString(\"origin_member_node\");\n if (originMemberNode != null) {\n NodeReference omn = new NodeReference();\n omn.setValue(originMemberNode);\n systemMetadata.setOriginMemberNode(omn);\n }\n\n // add authoritive_member_node\n String authoritativeMemberNode = resultSet.getString(\"authoritive_member_node\");\n if (originMemberNode != null) {\n NodeReference amn = new NodeReference();\n amn.setValue(authoritativeMemberNode);\n systemMetadata.setAuthoritativeMemberNode(amn);\n }\n\n // add submitter\n String submitter = resultSet.getString(\"submitter\");\n if (submitter != null) {\n Subject submitterSubject = new Subject();\n submitterSubject.setValue(submitter);\n systemMetadata.setSubmitter(submitterSubject);\n }\n\n // add object_format\n String fmtidStr = resultSet.getString(\"object_format\");\n ObjectFormatIdentifier fmtid = new ObjectFormatIdentifier();\n fmtid.setValue(fmtidStr);\n systemMetadata.setFormatId(fmtid);\n\n // add size\n String size = resultSet.getString(\"size\");\n systemMetadata.setSize(new BigInteger(size));\n\n // add obsoletes\n String obsoletes = resultSet.getString(\"obsoletes\");\n if (obsoletes != null) {\n Identifier obsoletesId = new Identifier();\n obsoletesId.setValue(obsoletes);\n systemMetadata.setObsoletes(obsoletesId);\n }\n // add obsoleted_by\n String obsoletedBy = resultSet.getString(\"obsoleted_by\");\n if (obsoletedBy != null) {\n Identifier obsoletedById = new Identifier();\n obsoletedById.setValue(obsoletedBy);\n systemMetadata.setObsoletedBy(obsoletedById);\n }\n\n // potentially build a ReplicationPolicy\n \n // add replication_allowed, if it was persisted\n boolean replAllowed = resultSet.getBoolean(\"replication_allowed\"); // getBoolean returns false for null results\n \n if (!resultSet.wasNull()) {\n // populate and add ReplicationPolicy\n ReplicationPolicy replicationPolicy = new ReplicationPolicy();\n \n replicationPolicy.setReplicationAllowed(new Boolean(replAllowed));\n\n // add number_replicas\n int numberOfReplicas = resultSet.getInt(\"number_replicas\"); // getInt returns 0 for null values\n if (numberOfReplicas > 0) {\n replicationPolicy.setNumberReplicas(new Integer(numberOfReplicas));\n\n }\n\n // add preferred and blocked lists\n List<ReplicationPolicyEntry> replPolicies = new ArrayList<ReplicationPolicyEntry>();\n List<NodeReference> preferredNodes = new ArrayList<NodeReference>();\n List<NodeReference> blockedNodes = new ArrayList<NodeReference>();\n\n replPolicies = listReplicationPolicies(pid, localTableMap);\n\n for (ReplicationPolicyEntry policy : replPolicies) {\n Identifier id = policy.getPid();\n String entryPolicy = policy.getPolicy();\n NodeReference node = policy.getMemberNode();\n\n if (entryPolicy.equals(\"preferred\")) {\n preferredNodes.add(node);\n\n } else if (entryPolicy.equals(\"blocked\")) {\n blockedNodes.add(node);\n\n }\n }\n\n replicationPolicy.setPreferredMemberNodeList(preferredNodes);\n replicationPolicy.setBlockedMemberNodeList(blockedNodes);\n\n systemMetadata.setReplicationPolicy(replicationPolicy);\n } else {\n systemMetadata.setReplicationPolicy(null);\n }\n\n // populate and add replicas list\n\n List<Replica> replicas = new ArrayList<Replica>();\n replicas = listReplicaEntries(pid, localTableMap);\n systemMetadata.setReplicaList(replicas);\n\n // populate and add AccessPolicy\n List<AccessRule> accessRules = new ArrayList<AccessRule>();\n accessRules = listAccessRules(pid, localTableMap);\n accessPolicy.setAllowList(accessRules);\n systemMetadata.setAccessPolicy(accessPolicy);\n\n // Validate the system metadata in debug mode using TypeMarshaller\n if (log.isDebugEnabled()) {\n try {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n TypeMarshaller.marshalTypeToOutputStream(systemMetadata, baos);\n log.debug(\"SystemMetadata for pid \" + pid.getValue() + \" is: \"\n + baos.toString());\n\n } catch (MarshallingException e) {\n e.printStackTrace();\n\n } catch (IOException e) {\n e.printStackTrace();\n\n }\n }\n return systemMetadata;\n }", "public MetaData getMetaData() {\n return metaData;\n }", "public ResultSetMetaData getMetaData() throws SQLException\n {\n return m_rs.getMetaData();\n }", "public ShowTableMetadataResponse showTableMetadata(ShowTableMetadataRequest request) throws GPUdbException {\n ShowTableMetadataResponse actualResponse_ = new ShowTableMetadataResponse();\n submitRequest(\"/show/table/metadata\", request, actualResponse_, false);\n return actualResponse_;\n }", "SQLServerResultSetMetaData(SQLServerConnection con, SQLServerResultSet rs) \n {\n traceID = \" SQLServerResultSetMetaData:\" + nextInstanceID();\n this.con = con;\n this.rs =rs;\n assert rs !=null;\n if(logger.isLoggable(java.util.logging.Level.FINE))\n {\n logger.fine(toString() + \" created by (\" + rs.toString() + \")\");\n }\n }", "@Override\n public RavenJObject getMetadata() {\n return metadata;\n }", "@Override\n\tpublic List<Map<String, String>> selectReportInfo(String appId) {\n\t\treturn getSqlMap().queryForList(NAMESPACES + \"queryReportInfo\", appId);\n\t}", "void processMetaData(ResultSet rs) throws SQLException;", "public interface ColumnMetaData {\n\n\t/**\n\t * The uniqueness level of a column data type.\n\t */\n\tenum Uniqueness {\n\t\t/**\n\t\t * No limitations. Multiple instances of a single column meta data type can be attached to a table or even a\n\t\t * single column.\n\t\t */\n\t\tNONE,\n\n\t\t/**\n\t\t * Multiple instances of a single column meta data type can be attached to a table but at most one per column.\n\t\t */\n\t\tCOLUMN,\n\n\t\t/**\n\t\t * At most one instance of the column meta data type can be attached to a table.\n\t\t */\n\t\tTABLE\n\t}\n\n\t/**\n\t * The unique type id of the column meta data.\n\t *\n\t * @return the type id\n\t */\n\tString type();\n\n\t/**\n\t * The uniqueness level of the meta data. Defaults to {@link Uniqueness#NONE} (no restrictions).\n\t *\n\t * @return the uniqueness level\n\t */\n\tdefault Uniqueness uniqueness() {\n\t\treturn Uniqueness.NONE;\n\t}\n\n}", "public HashMap getMetaData() ;", "Metadata getMetaData();", "@Override\n public SystemMetadataStatus mapRow(ResultSet resultSet, int rowNumber) throws SQLException {\n\n // resultSet contains guid, serialVersion, date_modified, and archived column data\n SystemMetadataStatus systemMetadataStatus = new SystemMetadataStatus();\n\n // add guid\n Identifier pid = new Identifier();\n pid.setValue(resultSet.getString(\"guid\"));\n systemMetadataStatus.setPid(pid);\n\n // add serialVersion\n BigInteger serialVersion = new BigInteger(resultSet.getString(\"serial_version\"));\n systemMetadataStatus.setSerialVersion(serialVersion);\n\n // add date_modified\n Date dateSystemMetadataLastModified = resultSet.getTimestamp(\"date_modified\");\n systemMetadataStatus\n .setLastSystemMetadataModificationDate(dateSystemMetadataLastModified);\n\n // add archived\n boolean archived = resultSet.getBoolean(\"archived\"); // getBoolean returns false for null results\n systemMetadataStatus.setDeleted(new Boolean(archived));\n\n return systemMetadataStatus;\n }", "@Override\n public String toString() {\n return \"Report{\" +\n \"reportId=\" + reportId +\n \", reportOpId=\" + reportOp +\n \", date='\" + date + '\\'' +\n \", reportedUserId=\" + reportedUser +\n \", userId=\" + user +\n \", status=\" + status +\n '}';\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}", "CustomReport selectByPrimaryKey(BigDecimal reportId);", "public ResultSetMetaData getMetaData() throws SQLException {\n return currentPreparedStatement.getMetaData();\n }", "public ReportTable(TableView<Report> reportTable) {\n this.reportTable = reportTable;\n }", "public void analizeQueryResultMetaData(ResultSetMetaData rsMetaData, String[] decimalColumns){\n\t\tArrayList<Integer> decimalColumnResultsetIndexes = new ArrayList<Integer>();\n\t\t//if ( decimalColumns==null||decimalColumns.length==0)\n\t\t//\treturn ; \n\t\ttry {\n\t\t\t\n\t\t\t\n\t\t\t//IObjectToStringConverter[] converters = new IObjectToStringConverter[rsMetaData.getColumnCount()] ;\n\t\t\tOuputDataType[] dataTypes = new OuputDataType[rsMetaData.getColumnCount()] ;\n\t\t\tjobContext.put(ExportEngineConstant.COLUMN_CONVERTER_KEY, dataTypes);\n\t\t\tfor ( int i=1 ; i <= rsMetaData.getColumnCount(); i++){\n\t\t\t\tboolean isDecimal = false ; \n\t\t\t\tString nama = rsMetaData.getColumnName(i).toUpperCase();\n\t\t\t\tif ( decimalColumns!=null){\n\t\t\t\t\tfor ( String scn : decimalColumns){\n\t\t\t\t\t\tif ( nama.equalsIgnoreCase(scn)){\n\t\t\t\t\t\t\tdecimalColumnResultsetIndexes.add(i-1);\n\t\t\t\t\t\t\tisDecimal = true ;\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.money; \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\tif( !isDecimal){\n\t\t\t\t\tString tipeCol = rsMetaData.getColumnClassName(i) ;\n\t\t\t\t\tboolean isDate = false ; \n\t\t\t\t\tfor ( String scn : DATE_DATA_TYPES){\n\t\t\t\t\t\tif ( tipeCol.equals(scn)){\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.date; \n\t\t\t\t\t\t\tisDate = true ; \n\t\t\t\t\t\t\tbreak ; \n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( !isDate){\n\t\t\t\t\t\tif (String.class.getName().equals(tipeCol)){\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.string;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.commonToString;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfor ( OuputDataType scn : dataTypes ){\n\t\t\t\tSystem.out.println(\"converter : \" + scn);\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"gagal membaca data column unutk membuat converter object array. error message :\" + e.getMessage() , e); \n\t\t}\n\t\t\n\t\t\n\t}", "private static void writeColumnMetaData(JsonGenerator jg, ColumnMetaData mdt) throws JsonGenerationException, IOException {\n\t\tjg.writeStartObject();\n\t\tjg.writeStringField(\"name\", mdt.columnName);\n\t\tjg.writeStringField(\"type\", mdt.columnType);\n\t\tjg.writeEndObject();;\n\t}", "private String metadata() {\n\t\tStringBuilder s = new StringBuilder();\n\t\ts.append(\"#######################################\");\n\t\ts.append(\"\\n# Metadata of query set\");\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Queries\");\n\t\ts.append(\"\\n# \\tTotal: \" + this.num_queries);\n\t\ts.append(\"\\n# \\tPoint: \" + this.num_pt_queries + \" (\" + 100 * ((double) this.num_pt_queries/this.num_queries) +\"%)\");\n\t\ts.append(\"\\n# \\tRange: \" + this.num_range_queries + \" (\" + 100 * ((double) this.num_range_queries/this.num_queries) +\"%)\");\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Operators\");\n\t\ts.append(\"\\n# \\tTotal: \" + (this.num_and_ops + this.num_or_ops) + \" (\" + ((double) (this.num_and_ops + this.num_or_ops)/this.num_queries) +\" per query)\");\n\t\ts.append(\"\\n# \\tAND: \" + this.num_and_ops);\n\t\ts.append(\"\\n# \\tOR: \" + this.num_or_ops);\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Attributes\");\n\t\ts.append(\"\\n# \\tTotal queried: \" + this.num_attributes);\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Bins\");\n\t\ts.append(\"\\n# \\tTotal queried: \" + this.num_bins);\n\t\ts.append(\"\\n# \\tPer query: \" + ((double) this.num_bins/this.num_queries));\n\t\ts.append(\"\\n#######################################\\n\");\n\t\treturn s.toString();\n\t}", "public List<Map<String, Object>> getDatewiseUpdateData(String columnName) {\n\t\tList<Map<String, Object>> reportData = new ArrayList<>();\n\n\t\tswitch (columnName) {\n\t\tcase \"LASTUPDATED\":\n\t\t\treportData = getLastUpdatedReport();\n\t\t\tbreak;\n\t\tcase \"CREATEDON\":\n\t\t\treportData = getCreatedOnReport();\n\t\t\tbreak;\n\t\tcase \"READON\":\n\t\t\treportData = getReadOnReport();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tSystem.out.println(\"Invalid column name\");\n\t\t}\n\t\treturn reportData;\n\t}", "public Map<String, Object> getMetaData() {\n\t\treturn metaData;\n\t}", "public MetadataArtifactDownloadReport getReport() {\n return report;\n }", "public Map<String, ColumnMetaData> getColumns();", "public abstract String metadata(String property);", "@Override\n\tpublic IColumns createColumns() {\n\t\treturn new WaybillforauditColumns();\n\t}", "@Schema(description = \"`status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Binary general-info: The input information used to assemble the report that can be on-going, periodic and actual and projected \")\n public Object getAssessmentInstanceReportRecord() {\n return assessmentInstanceReportRecord;\n }", "public AlterTableMetadataResponse alterTableMetadata(AlterTableMetadataRequest request) throws GPUdbException {\n AlterTableMetadataResponse actualResponse_ = new AlterTableMetadataResponse();\n submitRequest(\"/alter/table/metadata\", request, actualResponse_, false);\n return actualResponse_;\n }", "public Long getReportId() {\n return reportId;\n }", "@Schema(description = \"`status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Binary general-info: The external report in any suitable form including selection filters where appropriate \")\n public Object getAssessmentInstanceReport() {\n return assessmentInstanceReport;\n }", "@SuppressWarnings(\"all\")\npublic interface I_I_BankDataJP \n{\n\n /** TableName=I_BankDataJP */\n public static final String Table_Name = \"I_BankDataJP\";\n\n /** AD_Table_ID=1000307 */\n public static final int Table_ID = MTable.getTable_ID(Table_Name);\n\n KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);\n\n /** AccessLevel = 3 - Client - Org \n */\n BigDecimal accessLevel = BigDecimal.valueOf(3);\n\n /** Load Meta Data */\n\n /** Column name AD_Client_ID */\n public static final String COLUMNNAME_AD_Client_ID = \"AD_Client_ID\";\n\n\t/** Get Tenant.\n\t * Tenant for this installation.\n\t */\n\tpublic int getAD_Client_ID();\n\n /** Column name AD_OrgTrx_ID */\n public static final String COLUMNNAME_AD_OrgTrx_ID = \"AD_OrgTrx_ID\";\n\n\t/** Set Trx Organization.\n\t * Performing or initiating organization\n\t */\n\tpublic void setAD_OrgTrx_ID (int AD_OrgTrx_ID);\n\n\t/** Get Trx Organization.\n\t * Performing or initiating organization\n\t */\n\tpublic int getAD_OrgTrx_ID();\n\n /** Column name AD_Org_ID */\n public static final String COLUMNNAME_AD_Org_ID = \"AD_Org_ID\";\n\n\t/** Set Organization.\n\t * Organizational entity within tenant\n\t */\n\tpublic void setAD_Org_ID (int AD_Org_ID);\n\n\t/** Get Organization.\n\t * Organizational entity within tenant\n\t */\n\tpublic int getAD_Org_ID();\n\n /** Column name AccountNo */\n public static final String COLUMNNAME_AccountNo = \"AccountNo\";\n\n\t/** Set Account No.\n\t * Account Number\n\t */\n\tpublic void setAccountNo (String AccountNo);\n\n\t/** Get Account No.\n\t * Account Number\n\t */\n\tpublic String getAccountNo();\n\n /** Column name BankAccountType */\n public static final String COLUMNNAME_BankAccountType = \"BankAccountType\";\n\n\t/** Set Bank Account Type.\n\t * Bank Account Type\n\t */\n\tpublic void setBankAccountType (String BankAccountType);\n\n\t/** Get Bank Account Type.\n\t * Bank Account Type\n\t */\n\tpublic String getBankAccountType();\n\n /** Column name C_BankAccount_ID */\n public static final String COLUMNNAME_C_BankAccount_ID = \"C_BankAccount_ID\";\n\n\t/** Set Bank Account.\n\t * Account at the Bank\n\t */\n\tpublic void setC_BankAccount_ID (int C_BankAccount_ID);\n\n\t/** Get Bank Account.\n\t * Account at the Bank\n\t */\n\tpublic int getC_BankAccount_ID();\n\n\tpublic org.compiere.model.I_C_BankAccount getC_BankAccount() throws RuntimeException;\n\n /** Column name C_Bank_ID */\n public static final String COLUMNNAME_C_Bank_ID = \"C_Bank_ID\";\n\n\t/** Set Bank.\n\t * Bank\n\t */\n\tpublic void setC_Bank_ID (int C_Bank_ID);\n\n\t/** Get Bank.\n\t * Bank\n\t */\n\tpublic int getC_Bank_ID();\n\n\tpublic org.compiere.model.I_C_Bank getC_Bank() throws RuntimeException;\n\n /** Column name Created */\n public static final String COLUMNNAME_Created = \"Created\";\n\n\t/** Get Created.\n\t * Date this record was created\n\t */\n\tpublic Timestamp getCreated();\n\n /** Column name CreatedBy */\n public static final String COLUMNNAME_CreatedBy = \"CreatedBy\";\n\n\t/** Get Created By.\n\t * User who created this records\n\t */\n\tpublic int getCreatedBy();\n\n /** Column name DateAcct */\n public static final String COLUMNNAME_DateAcct = \"DateAcct\";\n\n\t/** Set Account Date.\n\t * Accounting Date\n\t */\n\tpublic void setDateAcct (Timestamp DateAcct);\n\n\t/** Get Account Date.\n\t * Accounting Date\n\t */\n\tpublic Timestamp getDateAcct();\n\n /** Column name I_BankDataJP_ID */\n public static final String COLUMNNAME_I_BankDataJP_ID = \"I_BankDataJP_ID\";\n\n\t/** Set I_BankDataJP.\n\t * JPIERE-0595:JPBP\n\t */\n\tpublic void setI_BankDataJP_ID (int I_BankDataJP_ID);\n\n\t/** Get I_BankDataJP.\n\t * JPIERE-0595:JPBP\n\t */\n\tpublic int getI_BankDataJP_ID();\n\n /** Column name I_BankDataJP_UU */\n public static final String COLUMNNAME_I_BankDataJP_UU = \"I_BankDataJP_UU\";\n\n\t/** Set I_BankDataJP_UU\t */\n\tpublic void setI_BankDataJP_UU (String I_BankDataJP_UU);\n\n\t/** Get I_BankDataJP_UU\t */\n\tpublic String getI_BankDataJP_UU();\n\n /** Column name I_ErrorMsg */\n public static final String COLUMNNAME_I_ErrorMsg = \"I_ErrorMsg\";\n\n\t/** Set Import Error Message.\n\t * Messages generated from import process\n\t */\n\tpublic void setI_ErrorMsg (String I_ErrorMsg);\n\n\t/** Get Import Error Message.\n\t * Messages generated from import process\n\t */\n\tpublic String getI_ErrorMsg();\n\n /** Column name I_IsImported */\n public static final String COLUMNNAME_I_IsImported = \"I_IsImported\";\n\n\t/** Set Imported.\n\t * Has this import been processed\n\t */\n\tpublic void setI_IsImported (boolean I_IsImported);\n\n\t/** Get Imported.\n\t * Has this import been processed\n\t */\n\tpublic boolean isI_IsImported();\n\n /** Column name IsActive */\n public static final String COLUMNNAME_IsActive = \"IsActive\";\n\n\t/** Set Active.\n\t * The record is active in the system\n\t */\n\tpublic void setIsActive (boolean IsActive);\n\n\t/** Get Active.\n\t * The record is active in the system\n\t */\n\tpublic boolean isActive();\n\n /** Column name JP_A_Name */\n public static final String COLUMNNAME_JP_A_Name = \"JP_A_Name\";\n\n\t/** Set Account Name\t */\n\tpublic void setJP_A_Name (String JP_A_Name);\n\n\t/** Get Account Name\t */\n\tpublic String getJP_A_Name();\n\n /** Column name JP_A_Name_Kana */\n public static final String COLUMNNAME_JP_A_Name_Kana = \"JP_A_Name_Kana\";\n\n\t/** Set Account Name(Kana)\t */\n\tpublic void setJP_A_Name_Kana (String JP_A_Name_Kana);\n\n\t/** Get Account Name(Kana)\t */\n\tpublic String getJP_A_Name_Kana();\n\n /** Column name JP_AcctDate */\n public static final String COLUMNNAME_JP_AcctDate = \"JP_AcctDate\";\n\n\t/** Set Date of Account Date\t */\n\tpublic void setJP_AcctDate (String JP_AcctDate);\n\n\t/** Get Date of Account Date\t */\n\tpublic String getJP_AcctDate();\n\n /** Column name JP_AcctMonth */\n public static final String COLUMNNAME_JP_AcctMonth = \"JP_AcctMonth\";\n\n\t/** Set Month of Account Date\t */\n\tpublic void setJP_AcctMonth (String JP_AcctMonth);\n\n\t/** Get Month of Account Date\t */\n\tpublic String getJP_AcctMonth();\n\n /** Column name JP_BankAccountType */\n public static final String COLUMNNAME_JP_BankAccountType = \"JP_BankAccountType\";\n\n\t/** Set Bank Account Type\t */\n\tpublic void setJP_BankAccountType (String JP_BankAccountType);\n\n\t/** Get Bank Account Type\t */\n\tpublic String getJP_BankAccountType();\n\n /** Column name JP_BankAccount_Value */\n public static final String COLUMNNAME_JP_BankAccount_Value = \"JP_BankAccount_Value\";\n\n\t/** Set Bank Account(Search Key)\t */\n\tpublic void setJP_BankAccount_Value (String JP_BankAccount_Value);\n\n\t/** Get Bank Account(Search Key)\t */\n\tpublic String getJP_BankAccount_Value();\n\n /** Column name JP_BankDataCustomerCode1 */\n public static final String COLUMNNAME_JP_BankDataCustomerCode1 = \"JP_BankDataCustomerCode1\";\n\n\t/** Set Bank Data Customer Code1\t */\n\tpublic void setJP_BankDataCustomerCode1 (String JP_BankDataCustomerCode1);\n\n\t/** Get Bank Data Customer Code1\t */\n\tpublic String getJP_BankDataCustomerCode1();\n\n /** Column name JP_BankDataCustomerCode2 */\n public static final String COLUMNNAME_JP_BankDataCustomerCode2 = \"JP_BankDataCustomerCode2\";\n\n\t/** Set Bank Data Customer Code2\t */\n\tpublic void setJP_BankDataCustomerCode2 (String JP_BankDataCustomerCode2);\n\n\t/** Get Bank Data Customer Code2\t */\n\tpublic String getJP_BankDataCustomerCode2();\n\n /** Column name JP_BankDataLine_ID */\n public static final String COLUMNNAME_JP_BankDataLine_ID = \"JP_BankDataLine_ID\";\n\n\t/** Set Import Bank Data Line\t */\n\tpublic void setJP_BankDataLine_ID (int JP_BankDataLine_ID);\n\n\t/** Get Import Bank Data Line\t */\n\tpublic int getJP_BankDataLine_ID();\n\n\tpublic I_JP_BankDataLine getJP_BankDataLine() throws RuntimeException;\n\n /** Column name JP_BankData_EDI_Info */\n public static final String COLUMNNAME_JP_BankData_EDI_Info = \"JP_BankData_EDI_Info\";\n\n\t/** Set BankData EDI Info\t */\n\tpublic void setJP_BankData_EDI_Info (String JP_BankData_EDI_Info);\n\n\t/** Get BankData EDI Info\t */\n\tpublic String getJP_BankData_EDI_Info();\n\n /** Column name JP_BankData_ID */\n public static final String COLUMNNAME_JP_BankData_ID = \"JP_BankData_ID\";\n\n\t/** Set Import Bank Data\t */\n\tpublic void setJP_BankData_ID (int JP_BankData_ID);\n\n\t/** Get Import Bank Data\t */\n\tpublic int getJP_BankData_ID();\n\n\tpublic I_JP_BankData getJP_BankData() throws RuntimeException;\n\n /** Column name JP_BankData_ReferenceNo */\n public static final String COLUMNNAME_JP_BankData_ReferenceNo = \"JP_BankData_ReferenceNo\";\n\n\t/** Set Bank Data ReferenceNo\t */\n\tpublic void setJP_BankData_ReferenceNo (String JP_BankData_ReferenceNo);\n\n\t/** Get Bank Data ReferenceNo\t */\n\tpublic String getJP_BankData_ReferenceNo();\n\n /** Column name JP_BankName_Kana */\n public static final String COLUMNNAME_JP_BankName_Kana = \"JP_BankName_Kana\";\n\n\t/** Set Bank Name(Kana)\t */\n\tpublic void setJP_BankName_Kana (String JP_BankName_Kana);\n\n\t/** Get Bank Name(Kana)\t */\n\tpublic String getJP_BankName_Kana();\n\n /** Column name JP_BankName_Kana_Line */\n public static final String COLUMNNAME_JP_BankName_Kana_Line = \"JP_BankName_Kana_Line\";\n\n\t/** Set Bank Name(Kana) Line\t */\n\tpublic void setJP_BankName_Kana_Line (String JP_BankName_Kana_Line);\n\n\t/** Get Bank Name(Kana) Line\t */\n\tpublic String getJP_BankName_Kana_Line();\n\n /** Column name JP_Bank_Name */\n public static final String COLUMNNAME_JP_Bank_Name = \"JP_Bank_Name\";\n\n\t/** Set Bank Name\t */\n\tpublic void setJP_Bank_Name (String JP_Bank_Name);\n\n\t/** Get Bank Name\t */\n\tpublic String getJP_Bank_Name();\n\n /** Column name JP_BranchCode */\n public static final String COLUMNNAME_JP_BranchCode = \"JP_BranchCode\";\n\n\t/** Set Branch Code\t */\n\tpublic void setJP_BranchCode (String JP_BranchCode);\n\n\t/** Get Branch Code\t */\n\tpublic String getJP_BranchCode();\n\n /** Column name JP_BranchName */\n public static final String COLUMNNAME_JP_BranchName = \"JP_BranchName\";\n\n\t/** Set Branch Name\t */\n\tpublic void setJP_BranchName (String JP_BranchName);\n\n\t/** Get Branch Name\t */\n\tpublic String getJP_BranchName();\n\n /** Column name JP_BranchName_Kana */\n public static final String COLUMNNAME_JP_BranchName_Kana = \"JP_BranchName_Kana\";\n\n\t/** Set Branch Name(Kana)\t */\n\tpublic void setJP_BranchName_Kana (String JP_BranchName_Kana);\n\n\t/** Get Branch Name(Kana)\t */\n\tpublic String getJP_BranchName_Kana();\n\n /** Column name JP_BranchName_Kana_Line */\n public static final String COLUMNNAME_JP_BranchName_Kana_Line = \"JP_BranchName_Kana_Line\";\n\n\t/** Set Branch Name(Kana) Line\t */\n\tpublic void setJP_BranchName_Kana_Line (String JP_BranchName_Kana_Line);\n\n\t/** Get Branch Name(Kana) Line\t */\n\tpublic String getJP_BranchName_Kana_Line();\n\n /** Column name JP_Date */\n public static final String COLUMNNAME_JP_Date = \"JP_Date\";\n\n\t/** Set Date.\n\t * Date\n\t */\n\tpublic void setJP_Date (String JP_Date);\n\n\t/** Get Date.\n\t * Date\n\t */\n\tpublic String getJP_Date();\n\n /** Column name JP_Line_Description */\n public static final String COLUMNNAME_JP_Line_Description = \"JP_Line_Description\";\n\n\t/** Set Line Description\t */\n\tpublic void setJP_Line_Description (String JP_Line_Description);\n\n\t/** Get Line Description\t */\n\tpublic String getJP_Line_Description();\n\n /** Column name JP_Month */\n public static final String COLUMNNAME_JP_Month = \"JP_Month\";\n\n\t/** Set Month\t */\n\tpublic void setJP_Month (String JP_Month);\n\n\t/** Get Month\t */\n\tpublic String getJP_Month();\n\n /** Column name JP_OrgTrx_Value */\n public static final String COLUMNNAME_JP_OrgTrx_Value = \"JP_OrgTrx_Value\";\n\n\t/** Set Trx Organization(Search Key)\t */\n\tpublic void setJP_OrgTrx_Value (String JP_OrgTrx_Value);\n\n\t/** Get Trx Organization(Search Key)\t */\n\tpublic String getJP_OrgTrx_Value();\n\n /** Column name JP_Org_Value */\n public static final String COLUMNNAME_JP_Org_Value = \"JP_Org_Value\";\n\n\t/** Set Organization(Search Key)\t */\n\tpublic void setJP_Org_Value (String JP_Org_Value);\n\n\t/** Get Organization(Search Key)\t */\n\tpublic String getJP_Org_Value();\n\n /** Column name JP_RequesterName */\n public static final String COLUMNNAME_JP_RequesterName = \"JP_RequesterName\";\n\n\t/** Set Requester Name\t */\n\tpublic void setJP_RequesterName (String JP_RequesterName);\n\n\t/** Get Requester Name\t */\n\tpublic String getJP_RequesterName();\n\n /** Column name JP_SalesRep_EMail */\n public static final String COLUMNNAME_JP_SalesRep_EMail = \"JP_SalesRep_EMail\";\n\n\t/** Set Sales Rep(E-Mail)\t */\n\tpublic void setJP_SalesRep_EMail (String JP_SalesRep_EMail);\n\n\t/** Get Sales Rep(E-Mail)\t */\n\tpublic String getJP_SalesRep_EMail();\n\n /** Column name JP_SalesRep_Name */\n public static final String COLUMNNAME_JP_SalesRep_Name = \"JP_SalesRep_Name\";\n\n\t/** Set Sales Rep(Name)\t */\n\tpublic void setJP_SalesRep_Name (String JP_SalesRep_Name);\n\n\t/** Get Sales Rep(Name)\t */\n\tpublic String getJP_SalesRep_Name();\n\n /** Column name JP_SalesRep_Value */\n public static final String COLUMNNAME_JP_SalesRep_Value = \"JP_SalesRep_Value\";\n\n\t/** Set Sales Rep(Search Key)\t */\n\tpublic void setJP_SalesRep_Value (String JP_SalesRep_Value);\n\n\t/** Get Sales Rep(Search Key)\t */\n\tpublic String getJP_SalesRep_Value();\n\n /** Column name Processed */\n public static final String COLUMNNAME_Processed = \"Processed\";\n\n\t/** Set Processed.\n\t * The document has been processed\n\t */\n\tpublic void setProcessed (boolean Processed);\n\n\t/** Get Processed.\n\t * The document has been processed\n\t */\n\tpublic boolean isProcessed();\n\n /** Column name Processing */\n public static final String COLUMNNAME_Processing = \"Processing\";\n\n\t/** Set Process Now\t */\n\tpublic void setProcessing (boolean Processing);\n\n\t/** Get Process Now\t */\n\tpublic boolean isProcessing();\n\n /** Column name RoutingNo */\n public static final String COLUMNNAME_RoutingNo = \"RoutingNo\";\n\n\t/** Set Routing No.\n\t * Bank Routing Number\n\t */\n\tpublic void setRoutingNo (String RoutingNo);\n\n\t/** Get Routing No.\n\t * Bank Routing Number\n\t */\n\tpublic String getRoutingNo();\n\n /** Column name SalesRep_ID */\n public static final String COLUMNNAME_SalesRep_ID = \"SalesRep_ID\";\n\n\t/** Set Sales Rep.\n\t * Sales Representative or Company Agent\n\t */\n\tpublic void setSalesRep_ID (int SalesRep_ID);\n\n\t/** Get Sales Rep.\n\t * Sales Representative or Company Agent\n\t */\n\tpublic int getSalesRep_ID();\n\n\tpublic org.compiere.model.I_AD_User getSalesRep() throws RuntimeException;\n\n /** Column name StatementDate */\n public static final String COLUMNNAME_StatementDate = \"StatementDate\";\n\n\t/** Set Statement date.\n\t * Date of the statement\n\t */\n\tpublic void setStatementDate (Timestamp StatementDate);\n\n\t/** Get Statement date.\n\t * Date of the statement\n\t */\n\tpublic Timestamp getStatementDate();\n\n /** Column name StmtAmt */\n public static final String COLUMNNAME_StmtAmt = \"StmtAmt\";\n\n\t/** Set Statement amount.\n\t * Statement Amount\n\t */\n\tpublic void setStmtAmt (BigDecimal StmtAmt);\n\n\t/** Get Statement amount.\n\t * Statement Amount\n\t */\n\tpublic BigDecimal getStmtAmt();\n\n /** Column name TrxAmt */\n public static final String COLUMNNAME_TrxAmt = \"TrxAmt\";\n\n\t/** Set Transaction Amount.\n\t * Amount of a transaction\n\t */\n\tpublic void setTrxAmt (BigDecimal TrxAmt);\n\n\t/** Get Transaction Amount.\n\t * Amount of a transaction\n\t */\n\tpublic BigDecimal getTrxAmt();\n\n /** Column name Updated */\n public static final String COLUMNNAME_Updated = \"Updated\";\n\n\t/** Get Updated.\n\t * Date this record was updated\n\t */\n\tpublic Timestamp getUpdated();\n\n /** Column name UpdatedBy */\n public static final String COLUMNNAME_UpdatedBy = \"UpdatedBy\";\n\n\t/** Get Updated By.\n\t * User who updated this records\n\t */\n\tpublic int getUpdatedBy();\n}", "Map<String, Object> getAllMetadata();", "public static JasperReportBuilder generateReport(ExportData metaData,HttpServletRequest request){\n session = request.getSession(false);\n report = report(); // Creer le rapport\n \n //Logo\n// logoImg = cmp.image(inImg).setStyle(DynamicReports.stl.style().setHorizontalAlignment(HorizontalAlignment.LEFT)); \n //logoImg.setDimension(80,80); \n \n //Definit le style des colonnes d'entàte\n report.setColumnTitleStyle(getHeaderStyle(metaData));\n \n \n \n LinkedHashMap <String,String> criteria = metaData.getCriteria(); \n //Ajout la date d'àdition au critere d'impression\n String valDateProperty = getDateTxt(metaData.getLang()) ;\n String keyDateProperty = \"\" ;\n if ( session.getAttribute(\"activedLocale\").equals(\"fr\") ) {\n keyDateProperty = \"Edité le \" ;\n }\n else {\n keyDateProperty = \"Printed on \" ;\n }\n criteria.put(keyDateProperty,valDateProperty);\n \n StyleBuilder titleStyle = stl.style(boldStyle).setFontSize(16).setForegroundColor(new Color(0, 0, 0)).setHorizontalAlignment(HorizontalAlignment.RIGHT).setRightIndent(20);\n ComponentBuilder<?, ?> logoComponent = cmp.horizontalList(\n //cmp.image(Templates.class.getResource(\"/logopalm.png\")).setFixedDimension(150, 50).setStyle(stl.style().setLeftIndent(20)),\n cmp.verticalList(\n cmp.text(metaData.getTitle()).setStyle(titleStyle)\n )\n ).newRow()\n .add(cmp.horizontalList().add(cmp.hListCell(createCriteriaComponent(criteria,metaData)).heightFixedOnTop()))\n .newRow(); \n \n report.noData(logoComponent, cmp.text(\"Aucun enregistrement trouvà\").setStyle(stl.style().setHorizontalAlignment(HorizontalAlignment.CENTER).setTopPadding(30)));\n\n \n \n lblStyle = stl.style(Templates.columnStyle).setForegroundColor(new Color(60, 91, 31)); // Couleur du text \n colStyle = stl.style(Templates.columnStyle).setHorizontalAlignment(HorizontalAlignment.CENTER);\n \n groupStyle = stl.style().setForegroundColor(new Color(60, 91, 31)) \n .setBold(Boolean.TRUE)\n .setPadding(5)\n .setFontSize(13)\n .setHorizontalAlignment(HorizontalAlignment.CENTER); \n \n\n \n if(metaData.getTitle().equals(ITitle.PARCEL)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PARCEL_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SECTOR)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SECTOR_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BLOCK)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BLOCK_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ATTACK_PHYTO)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TREATMENT)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TREATMENT_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVEST)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVEST_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SERVICING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SERVICING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_PLANTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_PLANTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.FERTILIZATION)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.FERTILIZATION_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.CONTROL_PHYTO)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.CONTROL_PHYTO_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_FOLDING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_FOLDING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.MORTALITY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.MORTALITY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVESTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVESTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BUDGET)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.REPLACEMENT)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.REPLACEMENT_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.METEOROLOGY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.METEOROLOGY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_MATERIAL)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_MATERIAL_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLUVIOMETRY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLUVIOMETRY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ETP)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ETP_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HYGROMETRY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HYGROMETRY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TEMPERATURE)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TEMPERATURE_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.INSULATION)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.INSULATION_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.WORK)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.WORK_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }\n \n \n drColumns = new HashMap<String, TextColumnBuilder>(); \n groups = new ArrayList<String>();\n subtotals = new ArrayList<String>();\n \n //Definit la liste des colonnes du rapport\n ExportGenerator.getColumns(metaData); \n //Definit la liste des sous-totaux du rapport\n ExportGenerator.getSubTotals(metaData);\n \n \n //Genration des sous totaux\n for (String group : groups) {\n ColumnGroupBuilder group2 = grp.group(drColumns.get(group));\n report.groupBy(group2);\n for (String subtotal : subtotals) {\n report.subtotalsAtGroupFooter(group2,sbt.sum(drColumns.get(subtotal)));\n }\n }\n\n for (String subtotal : subtotals) {\n report.subtotalsAtSummary(sbt.sum(drColumns.get(subtotal))); \n }\n \n /*if(ExportGenerator.getColumnByNameField(\"plantingName\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL \"), ExportGenerator.getColumnByNameField(\"plantingName\"), Calculation.NOTHING));\n }*//*else if(ExportGenerator.getColumnByNameField(\"invoiceCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"invoiceCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"planterCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL\"), ExportGenerator.getColumnByNameField(\"planterCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"transportTicket\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"transportTicket\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"deliveryDate\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"deliveryDate\"), Calculation.NOTHING));\n }\n else if(ExportGenerator.getColumnByNameField(\"arroundPlantingTicketNumber\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"arroundPlantingTicketNumber\"), Calculation.NOTHING));\n }\n else if(ExportGenerator.getColumnByNameField(\"planterNumber\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"planterNumber\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"startPaymentDate\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"startPaymentDate\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"sectorCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"sectorCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"month\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL \"), ExportGenerator.getColumnByNameField(\"month\"), Calculation.NOTHING));\n }*/\n \n\n \n \n //Genere la source de donnàes du rapport\n report.setDataSource(metaData.getData());\n \n report.highlightDetailEvenRows(); \n \n \n // Definition de l'entete : valable uniquement pour la 1ere page\n HorizontalListBuilder hlb= null;\n \n hlb = cmp.horizontalList().add(\n cmp.hListCell(createCriteriaComponent(criteria,metaData)).heightFixedOnTop()\n );\n\n \n report.title(\n createCustomTitleComponent(metaData.getTitle()), // Titre\n hlb,// Liste Horizontal des Critàres \n cmp.verticalGap(12) // Marge de 12 px entre chaque critàre\n ); \n \n \n \n report.setPageMargin(DynamicReports.margin().setLeft(15).setTop(30).setRight(15).setBottom(30));\n report.setPageFormat(PageType.A3, PageOrientation.LANDSCAPE);\n report.pageFooter(DynamicReports.cmp.pageXslashY());\n return report;\n \n }", "public interface IReportDao extends IBaseDao<Report, Integer> {\n\t\n\t/**\n\t * 添加举报信息\n\t * @param report\n\t */\n\tpublic boolean addReport(Report report);\n\t\n\t/**\n\t * 修改举报信息\n\t * @param report\n\t * @return\n\t */\n\tpublic boolean updateReport(Report report);\n\t\n//\t/**\n//\t * 是否已经举报\n//\t * @param getReportGto\n//\t * @return\n//\t */\n//\tpublic boolean isHouseInfoReported(GetReportGto getReportGto);\n\t\n\t/**\n\t * 获取我与某条房源的举报信息\n\t * @param getReportGto\n\t * @return\n\t */\n\tpublic List<Report> getMyReport(GetReportGto getReportGto);\n}", "public interface TableDetailMapper {\n\n @Select(\"select * from dxh_sys.tabledetail where vendorId=0 and tableName='skuProfitDayReport'\")\n List<Map<String, Object>> list();\n\n}", "public Report getReport();", "BoltResultSetMetaData(List<Type> types, List<String> keys) {\n\t\tsuper(keys);\n\t\tthis.columnType = types.toArray(new Type[this.keys.size() + 1]);\n\n\t\t// we init columnType with the first record\n\t\t// in case first == last record\n\t\t/*for (int i = 1; i <= this.keys.size(); i++) {\n\t\t\tcolumnType[i] = this.getColumnDriverTypeOrDefault(i, InternalTypeSystem.TYPE_SYSTEM.STRING());\n\t\t}*/\n\t}", "@Override\r\n\tpublic Map<String, Object> getMetadata() {\n\t\treturn null;\r\n\t}", "@Select({\n \"select\",\n \"JNLNO, TRANDATE, ACCOUNTDATE, CHECKTYPE, STATUS, DONETIME, FILENAME\",\n \"from B_UMB_CHECKING_LOG\",\n \"where JNLNO = #{jnlno,jdbcType=VARCHAR}\"\n })\n @Results({\n @Result(column=\"JNLNO\", property=\"jnlno\", jdbcType=JdbcType.VARCHAR, id=true),\n @Result(column=\"TRANDATE\", property=\"trandate\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"ACCOUNTDATE\", property=\"accountdate\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"CHECKTYPE\", property=\"checktype\", jdbcType=JdbcType.CHAR),\n @Result(column=\"STATUS\", property=\"status\", jdbcType=JdbcType.CHAR),\n @Result(column=\"DONETIME\", property=\"donetime\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"FILENAME\", property=\"filename\", jdbcType=JdbcType.VARCHAR)\n })\n BUMBCheckingLog selectByPrimaryKey(BUMBCheckingLogKey key);", "@SqlQuery(\"select * from PLAYERSTATS\")\n List<PlayerStats> getAll();", "protected String getMetadataName() {\r\n\t\treturn METADATA_NAME;\r\n\t}", "public abstract String getSummaryForDatabase();", "private interface ReportColumnCallback\n {\n void handleReportColumn(DashboardReport report, String columnName) throws MojoExecutionException;\n }", "public ReportMetadataExample() {\n\t\toredCriteria = new ArrayList<Criteria>();\n\t}", "@Override\r\n \tpublic MetaData getMetaData(HttpHeaders headers) {\n \t\ttry {\r\n \t\t\treturn MetaDataUtil.getMetaData(new ViewListeEleve(), new HashMap<String, MetaData>(),new ArrayList<String>());\r\n \t\t} catch (Exception e) {\r\n \t\t\t// TODO Auto-generated catch block\r\n \t\t\tthrow new WebApplicationException(Response.serverError().entity(new String(\"MetaData parse error\")).build());\r\n \t\t} \r\n \t}", "public DefaultMetaData getMetaData() {\n\t\treturn this.metaData;\n\t}", "Report createReport();", "@Override\n public Map<String, String> createFieldToPropertyMapping() {\n final Map<String, String> mapping = super.createFieldToPropertyMapping();\n mapping.put(this.tableName + \".rsres_id\", \"id\");\n mapping.put(this.tableName + \".resource_id\", \"resourceId\");\n mapping.put(this.tableName + \".quantity\", QUANTITY);\n mapping.put(this.tableName + \".cost_rsres\", \"cost\");\n\n return mapping;\n }", "public String getReportsToBeGenerated(String reportType) {\r\n\t\tString query = \"\";\r\n\t\t\r\n\t\ttry (Connection connection = DatabaseConnection.getMySQLConnection();\r\n\t\t\t PreparedStatement stmt = connection.prepareStatement(query);) {\r\n\t\t\tResultSet result = stmt.executeQuery();\r\n\t\t\tStringJoiner reports = new StringJoiner(\",,\");\r\n\t\t\twhile (result.next()) {\r\n\t\t\t\treports.add(result.getString(\"REPORT_NAME\"));\r\n\t\t\t}\r\n\t\t\treturn reports.toString();\r\n\t\t} catch (SQLException e) {\r\n\t\t\tthrow new ReportGenerationException(\"An error occurred while retrieving reports to be generated.\", e);\r\n\t\t}\r\n\t}", "public String getMetaDataFileName() {\n return null;\n }", "public JDBCRawSqlQueryMetaData(Method method) {\n this.method = method;\n }", "public Map getMetadata() {\n return metadata;\n }", "public DatabaseMetaData(Statement s) {\n\t\t_stmt = s; // SQL-Connection\n\t\t_buffer = new StringBuffer(); // Output goes here\n\t\t_tables = new ArrayList<String>(); // List of tables\n\t\t\n\t\ttry {\n\t\t\t// Put table names in `_tables`\n\t\t\textractTableNames(_stmt.executeQuery(composeTableNamesQuery()));\n\n\t\t\t// fetch the string representation of each tables meta-data\n\t\t\tfor (String name : _tables)\n\t\t\t\t_buffer.append(new TableMeta(name)); \n\t\t} catch (SQLException e) { _error = true;}\n\t}", "private Builder() {\n super(net.explorys.samhat.z12.r837.X837Ins_2320_MOA_MedicareOutpatientAdjudicationInformation.SCHEMA$);\n }", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "public String toString() {\n return \"[JDBCRawSqlQueryMetaData : method=\" + method + \"]\";\n }", "Report selectByPrimaryKey(Integer id);", "java.lang.String getMetadata(int index);", "java.lang.String getMetadata(int index);", "public Integer getReportId() {\n return reportId;\n }", "@Schema(description = \"`status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Code general-info: The type of external report available \")\n public String getAssessmentInstanceReportType() {\n return assessmentInstanceReportType;\n }", "@Override\r\n\tpublic List<ReportAndSummary> findAll() {\n\t\tList<ReportAndSummary> result = reportAndSummaryDao.findAll();\r\n\t\treturn result;\r\n\t}", "private static Map<String, ColumnMetaData> buildColumnMetadataMap(ResultSet rs) {\n\t\t/*\n\t\t * LinkedHashmap to preserve key traversal order.\n\t\t * Important as we output rows as arrays of values where the index position in\n\t\t * the row implicitly corresponds to the entry order of the column map.\n\t\t * Reason for this is performance. \n\t\t */\n\t\tMap<String, ColumnMetaData> columnMap = Maps.newLinkedHashMap();\n\t\ttry {\n\t\t\tResultSetMetaData rmd = rs.getMetaData();\n\t\t\tfor (int i=1; i<= rmd.getColumnCount(); i++) {\n\t\t\t\tColumnMetaData cmd = \n\t\t\t\t\tnew ColumnMetaData(rmd.getColumnName(i), rmd.getColumnTypeName(i));\n\t\t\t\tcolumnMap.put(cmd.columnName, cmd);\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\tThrowables.propagate(e);\n\t\t}\n\t\treturn columnMap;\n\t}", "protected String getSqlTable() {\n\t\treturn \"Project\";\n\t}", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "public interface I_IHC_JobDataChange \n{\n\n /** TableName=IHC_JobDataChange */\n public static final String Table_Name = \"IHC_JobDataChange\";\n\n /** AD_Table_ID=1100135 */\n public static final int Table_ID = MTable.getTable_ID(Table_Name);\n\n KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);\n\n /** AccessLevel = 3 - Client - Org \n */\n BigDecimal accessLevel = BigDecimal.valueOf(3);\n\n /** Load Meta Data */\n\n /** Column name AD_Client_ID */\n public static final String COLUMNNAME_AD_Client_ID = \"AD_Client_ID\";\n\n\t/** Get Client.\n\t * Client/Tenant for this installation.\n\t */\n\tpublic int getAD_Client_ID();\n\n /** Column name AD_Org_ID */\n public static final String COLUMNNAME_AD_Org_ID = \"AD_Org_ID\";\n\n\t/** Set Organization.\n\t * Organizational entity within client\n\t */\n\tpublic void setAD_Org_ID (int AD_Org_ID);\n\n\t/** Get Organization.\n\t * Organizational entity within client\n\t */\n\tpublic int getAD_Org_ID();\n\n /** Column name BPJSRegistrationDate */\n public static final String COLUMNNAME_BPJSRegistrationDate = \"BPJSRegistrationDate\";\n\n\t/** Set BPJS Registration Date\t */\n\tpublic void setBPJSRegistrationDate (Timestamp BPJSRegistrationDate);\n\n\t/** Get BPJS Registration Date\t */\n\tpublic Timestamp getBPJSRegistrationDate();\n\n /** Column name Created */\n public static final String COLUMNNAME_Created = \"Created\";\n\n\t/** Get Created.\n\t * Date this record was created\n\t */\n\tpublic Timestamp getCreated();\n\n /** Column name CreatedBy */\n public static final String COLUMNNAME_CreatedBy = \"CreatedBy\";\n\n\t/** Get Created By.\n\t * User who created this records\n\t */\n\tpublic int getCreatedBy();\n\n /** Column name Description */\n public static final String COLUMNNAME_Description = \"Description\";\n\n\t/** Set Description.\n\t * Optional short description of the record\n\t */\n\tpublic void setDescription (String Description);\n\n\t/** Get Description.\n\t * Optional short description of the record\n\t */\n\tpublic String getDescription();\n\n /** Column name DescriptionNew */\n public static final String COLUMNNAME_DescriptionNew = \"DescriptionNew\";\n\n\t/** Set Description New\t */\n\tpublic void setDescriptionNew (String DescriptionNew);\n\n\t/** Get Description New\t */\n\tpublic String getDescriptionNew();\n\n /** Column name HC_Compensation1 */\n public static final String COLUMNNAME_HC_Compensation1 = \"HC_Compensation1\";\n\n\t/** Set Compensation 1\t */\n\tpublic void setHC_Compensation1 (BigDecimal HC_Compensation1);\n\n\t/** Get Compensation 1\t */\n\tpublic BigDecimal getHC_Compensation1();\n\n /** Column name HC_Compensation2 */\n public static final String COLUMNNAME_HC_Compensation2 = \"HC_Compensation2\";\n\n\t/** Set Compensation 2\t */\n\tpublic void setHC_Compensation2 (BigDecimal HC_Compensation2);\n\n\t/** Get Compensation 2\t */\n\tpublic BigDecimal getHC_Compensation2();\n\n /** Column name HC_Compensation3 */\n public static final String COLUMNNAME_HC_Compensation3 = \"HC_Compensation3\";\n\n\t/** Set Compensation 3\t */\n\tpublic void setHC_Compensation3 (BigDecimal HC_Compensation3);\n\n\t/** Get Compensation 3\t */\n\tpublic BigDecimal getHC_Compensation3();\n\n /** Column name HC_Compensation4 */\n public static final String COLUMNNAME_HC_Compensation4 = \"HC_Compensation4\";\n\n\t/** Set Compensation 4\t */\n\tpublic void setHC_Compensation4 (BigDecimal HC_Compensation4);\n\n\t/** Get Compensation 4\t */\n\tpublic BigDecimal getHC_Compensation4();\n\n /** Column name HC_EffectiveSeq */\n public static final String COLUMNNAME_HC_EffectiveSeq = \"HC_EffectiveSeq\";\n\n\t/** Set Effective Sequence\t */\n\tpublic void setHC_EffectiveSeq (int HC_EffectiveSeq);\n\n\t/** Get Effective Sequence\t */\n\tpublic int getHC_EffectiveSeq();\n\n /** Column name HC_Employee_ID */\n public static final String COLUMNNAME_HC_Employee_ID = \"HC_Employee_ID\";\n\n\t/** Set Employee Data\t */\n\tpublic void setHC_Employee_ID (int HC_Employee_ID);\n\n\t/** Get Employee Data\t */\n\tpublic int getHC_Employee_ID();\n\n\tpublic I_HC_Employee getHC_Employee() throws RuntimeException;\n\n /** Column name HC_EmployeeGrade_ID */\n public static final String COLUMNNAME_HC_EmployeeGrade_ID = \"HC_EmployeeGrade_ID\";\n\n\t/** Set Employee Grade\t */\n\tpublic void setHC_EmployeeGrade_ID (int HC_EmployeeGrade_ID);\n\n\t/** Get Employee Grade\t */\n\tpublic int getHC_EmployeeGrade_ID();\n\n\tpublic I_HC_EmployeeGrade getHC_EmployeeGrade() throws RuntimeException;\n\n /** Column name HC_EmployeeGrade2_ID */\n public static final String COLUMNNAME_HC_EmployeeGrade2_ID = \"HC_EmployeeGrade2_ID\";\n\n\t/** Set Employee Grade To\t */\n\tpublic void setHC_EmployeeGrade2_ID (int HC_EmployeeGrade2_ID);\n\n\t/** Get Employee Grade To\t */\n\tpublic int getHC_EmployeeGrade2_ID();\n\n\tpublic I_HC_EmployeeGrade getHC_EmployeeGrade2() throws RuntimeException;\n\n /** Column name HC_EmployeeJob_ID */\n public static final String COLUMNNAME_HC_EmployeeJob_ID = \"HC_EmployeeJob_ID\";\n\n\t/** Set Employee Job Data\t */\n\tpublic void setHC_EmployeeJob_ID (int HC_EmployeeJob_ID);\n\n\t/** Get Employee Job Data\t */\n\tpublic int getHC_EmployeeJob_ID();\n\n\tpublic I_HC_EmployeeJob getHC_EmployeeJob() throws RuntimeException;\n\n /** Column name HC_Job_ID */\n public static final String COLUMNNAME_HC_Job_ID = \"HC_Job_ID\";\n\n\t/** Set Job\t */\n\tpublic void setHC_Job_ID (int HC_Job_ID);\n\n\t/** Get Job\t */\n\tpublic int getHC_Job_ID();\n\n\tpublic I_HC_Job getHC_Job() throws RuntimeException;\n\n /** Column name HC_JobAction */\n public static final String COLUMNNAME_HC_JobAction = \"HC_JobAction\";\n\n\t/** Set Job Action\t */\n\tpublic void setHC_JobAction (String HC_JobAction);\n\n\t/** Get Job Action\t */\n\tpublic String getHC_JobAction();\n\n /** Column name HC_JobDataChange_ID */\n public static final String COLUMNNAME_HC_JobDataChange_ID = \"HC_JobDataChange_ID\";\n\n\t/** Set Job Data Change\t */\n\tpublic void setHC_JobDataChange_ID (int HC_JobDataChange_ID);\n\n\t/** Get Job Data Change\t */\n\tpublic int getHC_JobDataChange_ID();\n\n\tpublic I_HC_JobDataChange getHC_JobDataChange() throws RuntimeException;\n\n /** Column name HC_Manager_ID */\n public static final String COLUMNNAME_HC_Manager_ID = \"HC_Manager_ID\";\n\n\t/** Set Manager Name\t */\n\tpublic void setHC_Manager_ID (int HC_Manager_ID);\n\n\t/** Get Manager Name\t */\n\tpublic int getHC_Manager_ID();\n\n\tpublic I_HC_Employee getHC_Manager() throws RuntimeException;\n\n /** Column name HC_ManagerTo_ID */\n public static final String COLUMNNAME_HC_ManagerTo_ID = \"HC_ManagerTo_ID\";\n\n\t/** Set Manager To ID\t */\n\tpublic void setHC_ManagerTo_ID (int HC_ManagerTo_ID);\n\n\t/** Get Manager To ID\t */\n\tpublic int getHC_ManagerTo_ID();\n\n\tpublic I_HC_Employee getHC_ManagerTo() throws RuntimeException;\n\n /** Column name HC_Org_ID */\n public static final String COLUMNNAME_HC_Org_ID = \"HC_Org_ID\";\n\n\t/** Set HC Organization\t */\n\tpublic void setHC_Org_ID (int HC_Org_ID);\n\n\t/** Get HC Organization\t */\n\tpublic int getHC_Org_ID();\n\n\tpublic I_HC_Org getHC_Org() throws RuntimeException;\n\n /** Column name HC_Org2_ID */\n public static final String COLUMNNAME_HC_Org2_ID = \"HC_Org2_ID\";\n\n\t/** Set HC Organization To\t */\n\tpublic void setHC_Org2_ID (int HC_Org2_ID);\n\n\t/** Get HC Organization To\t */\n\tpublic int getHC_Org2_ID();\n\n\tpublic I_HC_Org getHC_Org2() throws RuntimeException;\n\n /** Column name HC_PayGroup_ID */\n public static final String COLUMNNAME_HC_PayGroup_ID = \"HC_PayGroup_ID\";\n\n\t/** Set Payroll Group\t */\n\tpublic void setHC_PayGroup_ID (int HC_PayGroup_ID);\n\n\t/** Get Payroll Group\t */\n\tpublic int getHC_PayGroup_ID();\n\n\tpublic I_HC_PayGroup getHC_PayGroup() throws RuntimeException;\n\n /** Column name HC_PreviousJob_ID */\n public static final String COLUMNNAME_HC_PreviousJob_ID = \"HC_PreviousJob_ID\";\n\n\t/** Set Job Sekarang\t */\n\tpublic void setHC_PreviousJob_ID (int HC_PreviousJob_ID);\n\n\t/** Get Job Sekarang\t */\n\tpublic int getHC_PreviousJob_ID();\n\n\tpublic I_HC_Job getHC_PreviousJob() throws RuntimeException;\n\n /** Column name HC_Reason_ID */\n public static final String COLUMNNAME_HC_Reason_ID = \"HC_Reason_ID\";\n\n\t/** Set HC Reason\t */\n\tpublic void setHC_Reason_ID (int HC_Reason_ID);\n\n\t/** Get HC Reason\t */\n\tpublic int getHC_Reason_ID();\n\n\tpublic I_HC_Reason getHC_Reason() throws RuntimeException;\n\n /** Column name HC_Status */\n public static final String COLUMNNAME_HC_Status = \"HC_Status\";\n\n\t/** Set HC Status\t */\n\tpublic void setHC_Status (String HC_Status);\n\n\t/** Get HC Status\t */\n\tpublic String getHC_Status();\n\n /** Column name HC_WorkEndDate */\n public static final String COLUMNNAME_HC_WorkEndDate = \"HC_WorkEndDate\";\n\n\t/** Set Work End Date\t */\n\tpublic void setHC_WorkEndDate (Timestamp HC_WorkEndDate);\n\n\t/** Get Work End Date\t */\n\tpublic Timestamp getHC_WorkEndDate();\n\n /** Column name HC_WorkPeriodDate */\n public static final String COLUMNNAME_HC_WorkPeriodDate = \"HC_WorkPeriodDate\";\n\n\t/** Set WorkPeriodDate\t */\n\tpublic void setHC_WorkPeriodDate (String HC_WorkPeriodDate);\n\n\t/** Get WorkPeriodDate\t */\n\tpublic String getHC_WorkPeriodDate();\n\n /** Column name HC_WorkStartDate */\n public static final String COLUMNNAME_HC_WorkStartDate = \"HC_WorkStartDate\";\n\n\t/** Set WorkStartDate\t */\n\tpublic void setHC_WorkStartDate (Timestamp HC_WorkStartDate);\n\n\t/** Get WorkStartDate\t */\n\tpublic Timestamp getHC_WorkStartDate();\n\n /** Column name HC_WorkStartDate2 */\n public static final String COLUMNNAME_HC_WorkStartDate2 = \"HC_WorkStartDate2\";\n\n\t/** Set Work Start Date Baru\t */\n\tpublic void setHC_WorkStartDate2 (Timestamp HC_WorkStartDate2);\n\n\t/** Get Work Start Date Baru\t */\n\tpublic Timestamp getHC_WorkStartDate2();\n\n /** Column name IHC_JobDataChange_ID */\n public static final String COLUMNNAME_IHC_JobDataChange_ID = \"IHC_JobDataChange_ID\";\n\n\t/** Set IHC_JobDayaChange\t */\n\tpublic void setIHC_JobDataChange_ID (int IHC_JobDataChange_ID);\n\n\t/** Get IHC_JobDayaChange\t */\n\tpublic int getIHC_JobDataChange_ID();\n\n /** Column name IHC_JobDataChange_UU */\n public static final String COLUMNNAME_IHC_JobDataChange_UU = \"IHC_JobDataChange_UU\";\n\n\t/** Set IHC_JobDataChange_UU\t */\n\tpublic void setIHC_JobDataChange_UU (String IHC_JobDataChange_UU);\n\n\t/** Get IHC_JobDataChange_UU\t */\n\tpublic String getIHC_JobDataChange_UU();\n\n /** Column name IsActive */\n public static final String COLUMNNAME_IsActive = \"IsActive\";\n\n\t/** Set Active.\n\t * The record is active in the system\n\t */\n\tpublic void setIsActive (boolean IsActive);\n\n\t/** Get Active.\n\t * The record is active in the system\n\t */\n\tpublic boolean isActive();\n\n /** Column name IsCancelled */\n public static final String COLUMNNAME_IsCancelled = \"IsCancelled\";\n\n\t/** Set Cancelled.\n\t * The transaction was cancelled\n\t */\n\tpublic void setIsCancelled (boolean IsCancelled);\n\n\t/** Get Cancelled.\n\t * The transaction was cancelled\n\t */\n\tpublic boolean isCancelled();\n\n /** Column name NomorSK */\n public static final String COLUMNNAME_NomorSK = \"NomorSK\";\n\n\t/** Set Nomor SK\t */\n\tpublic void setNomorSK (String NomorSK);\n\n\t/** Get Nomor SK\t */\n\tpublic String getNomorSK();\n\n /** Column name NomorSK2 */\n public static final String COLUMNNAME_NomorSK2 = \"NomorSK2\";\n\n\t/** Set Nomor SK Baru\t */\n\tpublic void setNomorSK2 (String NomorSK2);\n\n\t/** Get Nomor SK Baru\t */\n\tpublic String getNomorSK2();\n\n /** Column name OriginalServiceData */\n public static final String COLUMNNAME_OriginalServiceData = \"OriginalServiceData\";\n\n\t/** Set Original Service Date\t */\n\tpublic void setOriginalServiceData (Timestamp OriginalServiceData);\n\n\t/** Get Original Service Date\t */\n\tpublic Timestamp getOriginalServiceData();\n\n /** Column name Processed */\n public static final String COLUMNNAME_Processed = \"Processed\";\n\n\t/** Set Processed.\n\t * The document has been processed\n\t */\n\tpublic void setProcessed (boolean Processed);\n\n\t/** Get Processed.\n\t * The document has been processed\n\t */\n\tpublic boolean isProcessed();\n\n /** Column name SeqNo */\n public static final String COLUMNNAME_SeqNo = \"SeqNo\";\n\n\t/** Set Sequence.\n\t * Method of ordering records;\n lowest number comes first\n\t */\n\tpublic void setSeqNo (int SeqNo);\n\n\t/** Get Sequence.\n\t * Method of ordering records;\n lowest number comes first\n\t */\n\tpublic int getSeqNo();\n\n /** Column name Updated */\n public static final String COLUMNNAME_Updated = \"Updated\";\n\n\t/** Get Updated.\n\t * Date this record was updated\n\t */\n\tpublic Timestamp getUpdated();\n\n /** Column name UpdatedBy */\n public static final String COLUMNNAME_UpdatedBy = \"UpdatedBy\";\n\n\t/** Get Updated By.\n\t * User who updated this records\n\t */\n\tpublic int getUpdatedBy();\n}" ]
[ "0.720387", "0.60612166", "0.5897073", "0.5817371", "0.58169", "0.5653088", "0.5575094", "0.5565293", "0.5523116", "0.55214834", "0.5424825", "0.5421459", "0.5377486", "0.534678", "0.5342339", "0.53190213", "0.5239825", "0.5236659", "0.5227619", "0.513109", "0.5122094", "0.5114957", "0.5110571", "0.5092275", "0.50793064", "0.50710756", "0.50666755", "0.50432736", "0.50225407", "0.5009165", "0.5007035", "0.49747992", "0.49714422", "0.49305487", "0.4928956", "0.49114767", "0.49047396", "0.4894513", "0.488628", "0.48804012", "0.48787948", "0.4848689", "0.4836264", "0.4834436", "0.48120287", "0.4810927", "0.4800393", "0.4796319", "0.4796208", "0.47960824", "0.47906667", "0.4782785", "0.47692993", "0.47681826", "0.47613847", "0.47506967", "0.4746286", "0.47449973", "0.4743577", "0.47416592", "0.47313273", "0.47236001", "0.47218567", "0.47168458", "0.47161394", "0.47148344", "0.47092924", "0.47078082", "0.4703429", "0.46990865", "0.46964943", "0.46792674", "0.4675461", "0.4675461", "0.4675461", "0.4675461", "0.4675461", "0.46668383", "0.4666713", "0.46600732", "0.46600732", "0.4655324", "0.46417722", "0.46361163", "0.46348158", "0.46313247", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.4627627" ]
0.0
-1
This method was generated by MyBatis Generator. This method corresponds to the database table core.report_metadata
public String getOrderByClause() { return orderByClause; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "TableReportMetadata getReportMetadata(String reportId);", "public abstract List<ColumnSpecification> metadata();", "@Override\r\n\t\tpublic DatabaseMetaData getMetaData() throws SQLException {\n\t\t\treturn null;\r\n\t\t}", "@Override\n\tpublic JDBCMetaData getMetaData() throws SQLException {\n\t\treturn null;\n\t}", "private void writeMetaData(ResultSet resultSet) throws SQLException {\n\t System.out.println(\"The columns in the table are: \");\r\n\t System.out.println(\"Table: \" + resultSet.getMetaData().getTableName(1));\r\n\t for (int i = 1; i<= resultSet.getMetaData().getColumnCount(); i++){\r\n\t System.out.println(\"Column \" +i + \" \"+ resultSet.getMetaData().getColumnName(i));\r\n\t }\r\n\t }", "public interface TableMetaData {\n\n\t/** Adds normal column. */\n\tpublic void addColumn(final ColumnMetaData column);\n\n\t/** Adds primary key column. */\n\tpublic void addPrimaryKey(final ColumnMetaData column);\n\n\t/** Returns map of column meta data, keyed by the column label (the alias if provided in the query, otherwise the name). */\n\tpublic Map<String, ColumnMetaData> getColumns();\n\n\t/** Returns database name. */\n\tpublic String getDatabaseName();\n\n\t/** Returns ordered list of columns that are primary keys. */\n\tpublic List<ColumnMetaData> getPrimaryKeys();\n\n\t/**\n\t * Returns fully qualified table name in database-specific form for use in SQL statements. MySQL uses the form\n\t * <code>database.table</code>, for example <code>sakila.film</code>. PostgreSQL uses the form\n\t * <code>database.schema.table</code>, for example <code>sakila.public.film</code>.\n\t */\n\tpublic String getQualifiedTableName();\n\n\t/** Returns row alias. */\n\tpublic String getRowAlias();\n\t\n\t/** Returns row set alias. */\n\tpublic String getRowSetAlias();\n\t\n\t/**\n\t * Returns row alias.\n\t * \n * @deprecated As of 0.8.11 use {@link #getRowAlias()}\n\t */\n\t@Deprecated\n\tpublic String getTableAlias();\n\n\t/** Returns table name. */\n\tpublic String getTableName();\n\n\t/** Returns role of table in the SQL Resource. */\n\tpublic TableRole getTableRole();\n\n\t/** Returns true if the SQL Resource role is child. */\n\tpublic boolean isChild();\n\n\t/** Returns true if the SQL Resource role is parent. */\n\tpublic boolean isParent();\n\n\t/** Sets all the row and row set aliases. */\n\tpublic void setAliases(final String alias, final String rowAlias, final String rowSetAlias);\n\n\t/** Sets attributes. */\n\tpublic void setAttributes(final String tableName, final String qualifedTableName,\n\t\t\tfinal String databaseName, final TableRole tableRole);\n\n\t/**\n\t * Sets table alias.\n\t * \n * @deprecated As of 0.8.11 use {@link #setAliases(String, String, String)}\n\t */\n\t@Deprecated\n\tpublic void setTableAlias(final String tableAlias);\n\t\n\t/** Represents all of the roles a table may plan in a SQL Resource. */\n\t@XmlType(namespace = \"http://restsql.org/schema\")\n\tpublic enum TableRole {\n\t\tChild, ChildExtension, Join, Parent, ParentExtension, Unknown;\n\t}\n}", "public abstract List<String> newReportColumns();", "ResultSetMetaData getMetaData() throws SQLException;", "public DBMetaDataSet getMetaData()\n\t{\n\t\treturn _MetaData;\n\t}", "public interface SqlResourceMetaData {\r\n\r\n\tpublic List<ColumnMetaData> getAllReadColumns();\r\n\r\n\tpublic TableMetaData getChild();\r\n\r\n\tpublic List<TableMetaData> getChildPlusExtTables();\r\n\r\n\tpublic List<ColumnMetaData> getChildReadColumns();\r\n\r\n\tpublic TableMetaData getJoin();\r\n\r\n\tpublic List<TableMetaData> getJoinList();\r\n\r\n\tpublic int getNumberTables();\r\n\r\n\tpublic TableMetaData getParent();\r\n\r\n\tpublic List<TableMetaData> getParentPlusExtTables();\r\n\r\n\tpublic List<ColumnMetaData> getParentReadColumns();\r\n\r\n\tpublic Map<String, TableMetaData> getTableMap();\r\n\r\n\tpublic List<TableMetaData> getTables();\r\n\r\n\tpublic List<TableMetaData> getWriteTables(final Type requestType, final boolean doParent);\r\n\r\n\tpublic boolean hasJoinTable();\r\n\r\n\tpublic boolean hasMultipleDatabases();\r\n\r\n\tpublic boolean isHierarchical();\r\n\r\n\tpublic void init(final String sqlResourceName, final SqlResourceDefinition definition, final SqlBuilder sqlBuilder)\r\n\t\t\tthrows SqlResourceException;\r\n\r\n\tpublic String toHtml();\r\n\r\n\tpublic String toXml();\r\n}", "public void addColumnPathReportId() {\n addColumnInPath(ColumnMetaData.KEY_PATH_ID);\n }", "public ResultSetMetaData getMetaData() throws SQLException {\n\n try {\n int id = getNextId(TraceObject.RESULT_SET_META_DATA);\n if (isDebugEnabled()) {\n debugCodeAssign(\"ResultSetMetaData\", TraceObject.RESULT_SET_META_DATA, id, \"getMetaData()\");\n }\n checkClosed();\n String catalog = conn.getCatalog();\n JdbcResultSetMetaData meta = new JdbcResultSetMetaData(this, null, result, catalog, conn.getSession().getTrace(), id);\n return meta;\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "public MetaData getMetaData();", "@Override\n public DatabaseMetaData getMetaData() throws SQLException\n {\n logger.debug(\n \" public DatabaseMetaData getMetaData() throws SQLException\");\n\n return new SnowflakeDatabaseMetaData(this);\n }", "public DataSetMetaData getMetaData() {\n return this.metadata;\n }", "@Test\n public void metaDataExample1() throws SQLException {\n Connection connection = DriverManager.getConnection(dbUrl, dbUsername, dbPassword);\n // 2. Create statement\n Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);\n // Run sql query and get the result in resultSet object\n String sqlQuery= \"Select * From departments\";\n //String sqlQuery= \"Select first_name, last_name, salary From employees\";\n ResultSet resultSet = statement.executeQuery(sqlQuery);\n\n // we use resultSet metadata to get information about the tables\n // get the resultSet object metadata\n ResultSetMetaData rsMetadata = resultSet.getMetaData();\n\n // List for keeping all rows as a map\n List<Map<String, Object>> queryData = new ArrayList<>();\n\n // while(resultSet.next()) helps to iterate through columns\n while (resultSet.next()) {\n // key(columns) will be string but value can be any type of data. That's why we choose <String, Object>\n Map<String, Object> row = new HashMap<>(); // creating empty Map\n // number of columns\n int colCount = rsMetadata.getColumnCount();\n // for loop helps to iterate through columns\n for (int i = 1; i <= colCount; i++) {\n row.put(rsMetadata.getColumnName(i), resultSet.getObject(i));\n }\n\n queryData.add(row); // adding a Map to the List of Maps\n }\n\n // Printing the rows\n for (Map<String, Object> row: queryData) {\n System.out.println(row.toString());\n\n }\n\n\n\n\n // close all connections\n resultSet.close();\n statement.close();\n connection.close();\n }", "@Override\n\tpublic DBMetadata getMetadata() {\n\t\treturn null;\n\t}", "public MetaData getMetaData() {\r\n \treturn metaData;\r\n }", "@Override\n public SystemMetadata mapRow(ResultSet resultSet, int rowNumber) throws SQLException {\n\n // resultSet contains guid, serialVersion, date_modified, and archived column data\n SystemMetadata systemMetadata = new SystemMetadata();\n ReplicationPolicy replPolicy = new ReplicationPolicy();\n AccessPolicy accessPolicy = new AccessPolicy();\n\n // add guid\n Identifier pid = new Identifier();\n pid.setValue(resultSet.getString(\"guid\"));\n systemMetadata.setIdentifier(pid);\n \n // add seriesId\n Identifier seriesId = new Identifier();\n seriesId.setValue(resultSet.getString(\"series_id\"));\n systemMetadata.setSeriesId(seriesId);\n\n // add serialVersion\n BigInteger serialVersion = new BigInteger(resultSet.getString(\"serial_version\"));\n systemMetadata.setSerialVersion(serialVersion);\n\n // add date_modified\n Date dateSystemMetadataLastModified = resultSet.getTimestamp(\"date_modified\");\n systemMetadata.setDateSysMetadataModified(dateSystemMetadataLastModified);\n\n // add archived value, if it was stored\n boolean archived = resultSet.getBoolean(\"archived\"); // getBoolean returns false for null results\n if (!resultSet.wasNull())\n systemMetadata.setArchived(new Boolean(archived));\n\n // add date_uploaded\n Date dateUploaded = resultSet.getTimestamp(\"date_uploaded\");\n systemMetadata.setDateUploaded(dateUploaded);\n\n // add rights_holder\n Subject rightsHolderSubject = new Subject();\n String rightsHolder = resultSet.getString(\"rights_holder\");\n rightsHolderSubject.setValue(rightsHolder);\n systemMetadata.setRightsHolder(rightsHolderSubject);\n\n // add checksum, checksum_algorithm\n String checksum = resultSet.getString(\"checksum\");\n String checksumAlgorithm = resultSet.getString(\"checksum_algorithm\");\n Checksum checksumObject = new Checksum();\n checksumObject.setValue(checksum);\n checksumObject.setAlgorithm(checksumAlgorithm);\n systemMetadata.setChecksum(checksumObject);\n\n // add origin_member_node\n String originMemberNode = resultSet.getString(\"origin_member_node\");\n if (originMemberNode != null) {\n NodeReference omn = new NodeReference();\n omn.setValue(originMemberNode);\n systemMetadata.setOriginMemberNode(omn);\n }\n\n // add authoritive_member_node\n String authoritativeMemberNode = resultSet.getString(\"authoritive_member_node\");\n if (originMemberNode != null) {\n NodeReference amn = new NodeReference();\n amn.setValue(authoritativeMemberNode);\n systemMetadata.setAuthoritativeMemberNode(amn);\n }\n\n // add submitter\n String submitter = resultSet.getString(\"submitter\");\n if (submitter != null) {\n Subject submitterSubject = new Subject();\n submitterSubject.setValue(submitter);\n systemMetadata.setSubmitter(submitterSubject);\n }\n\n // add object_format\n String fmtidStr = resultSet.getString(\"object_format\");\n ObjectFormatIdentifier fmtid = new ObjectFormatIdentifier();\n fmtid.setValue(fmtidStr);\n systemMetadata.setFormatId(fmtid);\n\n // add size\n String size = resultSet.getString(\"size\");\n systemMetadata.setSize(new BigInteger(size));\n\n // add obsoletes\n String obsoletes = resultSet.getString(\"obsoletes\");\n if (obsoletes != null) {\n Identifier obsoletesId = new Identifier();\n obsoletesId.setValue(obsoletes);\n systemMetadata.setObsoletes(obsoletesId);\n }\n // add obsoleted_by\n String obsoletedBy = resultSet.getString(\"obsoleted_by\");\n if (obsoletedBy != null) {\n Identifier obsoletedById = new Identifier();\n obsoletedById.setValue(obsoletedBy);\n systemMetadata.setObsoletedBy(obsoletedById);\n }\n\n // potentially build a ReplicationPolicy\n \n // add replication_allowed, if it was persisted\n boolean replAllowed = resultSet.getBoolean(\"replication_allowed\"); // getBoolean returns false for null results\n \n if (!resultSet.wasNull()) {\n // populate and add ReplicationPolicy\n ReplicationPolicy replicationPolicy = new ReplicationPolicy();\n \n replicationPolicy.setReplicationAllowed(new Boolean(replAllowed));\n\n // add number_replicas\n int numberOfReplicas = resultSet.getInt(\"number_replicas\"); // getInt returns 0 for null values\n if (numberOfReplicas > 0) {\n replicationPolicy.setNumberReplicas(new Integer(numberOfReplicas));\n\n }\n\n // add preferred and blocked lists\n List<ReplicationPolicyEntry> replPolicies = new ArrayList<ReplicationPolicyEntry>();\n List<NodeReference> preferredNodes = new ArrayList<NodeReference>();\n List<NodeReference> blockedNodes = new ArrayList<NodeReference>();\n\n replPolicies = listReplicationPolicies(pid, localTableMap);\n\n for (ReplicationPolicyEntry policy : replPolicies) {\n Identifier id = policy.getPid();\n String entryPolicy = policy.getPolicy();\n NodeReference node = policy.getMemberNode();\n\n if (entryPolicy.equals(\"preferred\")) {\n preferredNodes.add(node);\n\n } else if (entryPolicy.equals(\"blocked\")) {\n blockedNodes.add(node);\n\n }\n }\n\n replicationPolicy.setPreferredMemberNodeList(preferredNodes);\n replicationPolicy.setBlockedMemberNodeList(blockedNodes);\n\n systemMetadata.setReplicationPolicy(replicationPolicy);\n } else {\n systemMetadata.setReplicationPolicy(null);\n }\n\n // populate and add replicas list\n\n List<Replica> replicas = new ArrayList<Replica>();\n replicas = listReplicaEntries(pid, localTableMap);\n systemMetadata.setReplicaList(replicas);\n\n // populate and add AccessPolicy\n List<AccessRule> accessRules = new ArrayList<AccessRule>();\n accessRules = listAccessRules(pid, localTableMap);\n accessPolicy.setAllowList(accessRules);\n systemMetadata.setAccessPolicy(accessPolicy);\n\n // Validate the system metadata in debug mode using TypeMarshaller\n if (log.isDebugEnabled()) {\n try {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n TypeMarshaller.marshalTypeToOutputStream(systemMetadata, baos);\n log.debug(\"SystemMetadata for pid \" + pid.getValue() + \" is: \"\n + baos.toString());\n\n } catch (MarshallingException e) {\n e.printStackTrace();\n\n } catch (IOException e) {\n e.printStackTrace();\n\n }\n }\n return systemMetadata;\n }", "public MetaData getMetaData() {\n return metaData;\n }", "public ResultSetMetaData getMetaData() throws SQLException\n {\n return m_rs.getMetaData();\n }", "public ShowTableMetadataResponse showTableMetadata(ShowTableMetadataRequest request) throws GPUdbException {\n ShowTableMetadataResponse actualResponse_ = new ShowTableMetadataResponse();\n submitRequest(\"/show/table/metadata\", request, actualResponse_, false);\n return actualResponse_;\n }", "SQLServerResultSetMetaData(SQLServerConnection con, SQLServerResultSet rs) \n {\n traceID = \" SQLServerResultSetMetaData:\" + nextInstanceID();\n this.con = con;\n this.rs =rs;\n assert rs !=null;\n if(logger.isLoggable(java.util.logging.Level.FINE))\n {\n logger.fine(toString() + \" created by (\" + rs.toString() + \")\");\n }\n }", "@Override\n public RavenJObject getMetadata() {\n return metadata;\n }", "@Override\n\tpublic List<Map<String, String>> selectReportInfo(String appId) {\n\t\treturn getSqlMap().queryForList(NAMESPACES + \"queryReportInfo\", appId);\n\t}", "void processMetaData(ResultSet rs) throws SQLException;", "public interface ColumnMetaData {\n\n\t/**\n\t * The uniqueness level of a column data type.\n\t */\n\tenum Uniqueness {\n\t\t/**\n\t\t * No limitations. Multiple instances of a single column meta data type can be attached to a table or even a\n\t\t * single column.\n\t\t */\n\t\tNONE,\n\n\t\t/**\n\t\t * Multiple instances of a single column meta data type can be attached to a table but at most one per column.\n\t\t */\n\t\tCOLUMN,\n\n\t\t/**\n\t\t * At most one instance of the column meta data type can be attached to a table.\n\t\t */\n\t\tTABLE\n\t}\n\n\t/**\n\t * The unique type id of the column meta data.\n\t *\n\t * @return the type id\n\t */\n\tString type();\n\n\t/**\n\t * The uniqueness level of the meta data. Defaults to {@link Uniqueness#NONE} (no restrictions).\n\t *\n\t * @return the uniqueness level\n\t */\n\tdefault Uniqueness uniqueness() {\n\t\treturn Uniqueness.NONE;\n\t}\n\n}", "public HashMap getMetaData() ;", "Metadata getMetaData();", "@Override\n public SystemMetadataStatus mapRow(ResultSet resultSet, int rowNumber) throws SQLException {\n\n // resultSet contains guid, serialVersion, date_modified, and archived column data\n SystemMetadataStatus systemMetadataStatus = new SystemMetadataStatus();\n\n // add guid\n Identifier pid = new Identifier();\n pid.setValue(resultSet.getString(\"guid\"));\n systemMetadataStatus.setPid(pid);\n\n // add serialVersion\n BigInteger serialVersion = new BigInteger(resultSet.getString(\"serial_version\"));\n systemMetadataStatus.setSerialVersion(serialVersion);\n\n // add date_modified\n Date dateSystemMetadataLastModified = resultSet.getTimestamp(\"date_modified\");\n systemMetadataStatus\n .setLastSystemMetadataModificationDate(dateSystemMetadataLastModified);\n\n // add archived\n boolean archived = resultSet.getBoolean(\"archived\"); // getBoolean returns false for null results\n systemMetadataStatus.setDeleted(new Boolean(archived));\n\n return systemMetadataStatus;\n }", "@Override\n public String toString() {\n return \"Report{\" +\n \"reportId=\" + reportId +\n \", reportOpId=\" + reportOp +\n \", date='\" + date + '\\'' +\n \", reportedUserId=\" + reportedUser +\n \", userId=\" + user +\n \", status=\" + status +\n '}';\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}", "CustomReport selectByPrimaryKey(BigDecimal reportId);", "public ResultSetMetaData getMetaData() throws SQLException {\n return currentPreparedStatement.getMetaData();\n }", "public ReportTable(TableView<Report> reportTable) {\n this.reportTable = reportTable;\n }", "public void analizeQueryResultMetaData(ResultSetMetaData rsMetaData, String[] decimalColumns){\n\t\tArrayList<Integer> decimalColumnResultsetIndexes = new ArrayList<Integer>();\n\t\t//if ( decimalColumns==null||decimalColumns.length==0)\n\t\t//\treturn ; \n\t\ttry {\n\t\t\t\n\t\t\t\n\t\t\t//IObjectToStringConverter[] converters = new IObjectToStringConverter[rsMetaData.getColumnCount()] ;\n\t\t\tOuputDataType[] dataTypes = new OuputDataType[rsMetaData.getColumnCount()] ;\n\t\t\tjobContext.put(ExportEngineConstant.COLUMN_CONVERTER_KEY, dataTypes);\n\t\t\tfor ( int i=1 ; i <= rsMetaData.getColumnCount(); i++){\n\t\t\t\tboolean isDecimal = false ; \n\t\t\t\tString nama = rsMetaData.getColumnName(i).toUpperCase();\n\t\t\t\tif ( decimalColumns!=null){\n\t\t\t\t\tfor ( String scn : decimalColumns){\n\t\t\t\t\t\tif ( nama.equalsIgnoreCase(scn)){\n\t\t\t\t\t\t\tdecimalColumnResultsetIndexes.add(i-1);\n\t\t\t\t\t\t\tisDecimal = true ;\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.money; \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\tif( !isDecimal){\n\t\t\t\t\tString tipeCol = rsMetaData.getColumnClassName(i) ;\n\t\t\t\t\tboolean isDate = false ; \n\t\t\t\t\tfor ( String scn : DATE_DATA_TYPES){\n\t\t\t\t\t\tif ( tipeCol.equals(scn)){\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.date; \n\t\t\t\t\t\t\tisDate = true ; \n\t\t\t\t\t\t\tbreak ; \n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( !isDate){\n\t\t\t\t\t\tif (String.class.getName().equals(tipeCol)){\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.string;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.commonToString;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfor ( OuputDataType scn : dataTypes ){\n\t\t\t\tSystem.out.println(\"converter : \" + scn);\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"gagal membaca data column unutk membuat converter object array. error message :\" + e.getMessage() , e); \n\t\t}\n\t\t\n\t\t\n\t}", "private static void writeColumnMetaData(JsonGenerator jg, ColumnMetaData mdt) throws JsonGenerationException, IOException {\n\t\tjg.writeStartObject();\n\t\tjg.writeStringField(\"name\", mdt.columnName);\n\t\tjg.writeStringField(\"type\", mdt.columnType);\n\t\tjg.writeEndObject();;\n\t}", "private String metadata() {\n\t\tStringBuilder s = new StringBuilder();\n\t\ts.append(\"#######################################\");\n\t\ts.append(\"\\n# Metadata of query set\");\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Queries\");\n\t\ts.append(\"\\n# \\tTotal: \" + this.num_queries);\n\t\ts.append(\"\\n# \\tPoint: \" + this.num_pt_queries + \" (\" + 100 * ((double) this.num_pt_queries/this.num_queries) +\"%)\");\n\t\ts.append(\"\\n# \\tRange: \" + this.num_range_queries + \" (\" + 100 * ((double) this.num_range_queries/this.num_queries) +\"%)\");\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Operators\");\n\t\ts.append(\"\\n# \\tTotal: \" + (this.num_and_ops + this.num_or_ops) + \" (\" + ((double) (this.num_and_ops + this.num_or_ops)/this.num_queries) +\" per query)\");\n\t\ts.append(\"\\n# \\tAND: \" + this.num_and_ops);\n\t\ts.append(\"\\n# \\tOR: \" + this.num_or_ops);\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Attributes\");\n\t\ts.append(\"\\n# \\tTotal queried: \" + this.num_attributes);\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Bins\");\n\t\ts.append(\"\\n# \\tTotal queried: \" + this.num_bins);\n\t\ts.append(\"\\n# \\tPer query: \" + ((double) this.num_bins/this.num_queries));\n\t\ts.append(\"\\n#######################################\\n\");\n\t\treturn s.toString();\n\t}", "public List<Map<String, Object>> getDatewiseUpdateData(String columnName) {\n\t\tList<Map<String, Object>> reportData = new ArrayList<>();\n\n\t\tswitch (columnName) {\n\t\tcase \"LASTUPDATED\":\n\t\t\treportData = getLastUpdatedReport();\n\t\t\tbreak;\n\t\tcase \"CREATEDON\":\n\t\t\treportData = getCreatedOnReport();\n\t\t\tbreak;\n\t\tcase \"READON\":\n\t\t\treportData = getReadOnReport();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tSystem.out.println(\"Invalid column name\");\n\t\t}\n\t\treturn reportData;\n\t}", "public Map<String, Object> getMetaData() {\n\t\treturn metaData;\n\t}", "public MetadataArtifactDownloadReport getReport() {\n return report;\n }", "public Map<String, ColumnMetaData> getColumns();", "public abstract String metadata(String property);", "@Override\n\tpublic IColumns createColumns() {\n\t\treturn new WaybillforauditColumns();\n\t}", "@Schema(description = \"`status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Binary general-info: The input information used to assemble the report that can be on-going, periodic and actual and projected \")\n public Object getAssessmentInstanceReportRecord() {\n return assessmentInstanceReportRecord;\n }", "public AlterTableMetadataResponse alterTableMetadata(AlterTableMetadataRequest request) throws GPUdbException {\n AlterTableMetadataResponse actualResponse_ = new AlterTableMetadataResponse();\n submitRequest(\"/alter/table/metadata\", request, actualResponse_, false);\n return actualResponse_;\n }", "public Long getReportId() {\n return reportId;\n }", "@Schema(description = \"`status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Binary general-info: The external report in any suitable form including selection filters where appropriate \")\n public Object getAssessmentInstanceReport() {\n return assessmentInstanceReport;\n }", "@SuppressWarnings(\"all\")\npublic interface I_I_BankDataJP \n{\n\n /** TableName=I_BankDataJP */\n public static final String Table_Name = \"I_BankDataJP\";\n\n /** AD_Table_ID=1000307 */\n public static final int Table_ID = MTable.getTable_ID(Table_Name);\n\n KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);\n\n /** AccessLevel = 3 - Client - Org \n */\n BigDecimal accessLevel = BigDecimal.valueOf(3);\n\n /** Load Meta Data */\n\n /** Column name AD_Client_ID */\n public static final String COLUMNNAME_AD_Client_ID = \"AD_Client_ID\";\n\n\t/** Get Tenant.\n\t * Tenant for this installation.\n\t */\n\tpublic int getAD_Client_ID();\n\n /** Column name AD_OrgTrx_ID */\n public static final String COLUMNNAME_AD_OrgTrx_ID = \"AD_OrgTrx_ID\";\n\n\t/** Set Trx Organization.\n\t * Performing or initiating organization\n\t */\n\tpublic void setAD_OrgTrx_ID (int AD_OrgTrx_ID);\n\n\t/** Get Trx Organization.\n\t * Performing or initiating organization\n\t */\n\tpublic int getAD_OrgTrx_ID();\n\n /** Column name AD_Org_ID */\n public static final String COLUMNNAME_AD_Org_ID = \"AD_Org_ID\";\n\n\t/** Set Organization.\n\t * Organizational entity within tenant\n\t */\n\tpublic void setAD_Org_ID (int AD_Org_ID);\n\n\t/** Get Organization.\n\t * Organizational entity within tenant\n\t */\n\tpublic int getAD_Org_ID();\n\n /** Column name AccountNo */\n public static final String COLUMNNAME_AccountNo = \"AccountNo\";\n\n\t/** Set Account No.\n\t * Account Number\n\t */\n\tpublic void setAccountNo (String AccountNo);\n\n\t/** Get Account No.\n\t * Account Number\n\t */\n\tpublic String getAccountNo();\n\n /** Column name BankAccountType */\n public static final String COLUMNNAME_BankAccountType = \"BankAccountType\";\n\n\t/** Set Bank Account Type.\n\t * Bank Account Type\n\t */\n\tpublic void setBankAccountType (String BankAccountType);\n\n\t/** Get Bank Account Type.\n\t * Bank Account Type\n\t */\n\tpublic String getBankAccountType();\n\n /** Column name C_BankAccount_ID */\n public static final String COLUMNNAME_C_BankAccount_ID = \"C_BankAccount_ID\";\n\n\t/** Set Bank Account.\n\t * Account at the Bank\n\t */\n\tpublic void setC_BankAccount_ID (int C_BankAccount_ID);\n\n\t/** Get Bank Account.\n\t * Account at the Bank\n\t */\n\tpublic int getC_BankAccount_ID();\n\n\tpublic org.compiere.model.I_C_BankAccount getC_BankAccount() throws RuntimeException;\n\n /** Column name C_Bank_ID */\n public static final String COLUMNNAME_C_Bank_ID = \"C_Bank_ID\";\n\n\t/** Set Bank.\n\t * Bank\n\t */\n\tpublic void setC_Bank_ID (int C_Bank_ID);\n\n\t/** Get Bank.\n\t * Bank\n\t */\n\tpublic int getC_Bank_ID();\n\n\tpublic org.compiere.model.I_C_Bank getC_Bank() throws RuntimeException;\n\n /** Column name Created */\n public static final String COLUMNNAME_Created = \"Created\";\n\n\t/** Get Created.\n\t * Date this record was created\n\t */\n\tpublic Timestamp getCreated();\n\n /** Column name CreatedBy */\n public static final String COLUMNNAME_CreatedBy = \"CreatedBy\";\n\n\t/** Get Created By.\n\t * User who created this records\n\t */\n\tpublic int getCreatedBy();\n\n /** Column name DateAcct */\n public static final String COLUMNNAME_DateAcct = \"DateAcct\";\n\n\t/** Set Account Date.\n\t * Accounting Date\n\t */\n\tpublic void setDateAcct (Timestamp DateAcct);\n\n\t/** Get Account Date.\n\t * Accounting Date\n\t */\n\tpublic Timestamp getDateAcct();\n\n /** Column name I_BankDataJP_ID */\n public static final String COLUMNNAME_I_BankDataJP_ID = \"I_BankDataJP_ID\";\n\n\t/** Set I_BankDataJP.\n\t * JPIERE-0595:JPBP\n\t */\n\tpublic void setI_BankDataJP_ID (int I_BankDataJP_ID);\n\n\t/** Get I_BankDataJP.\n\t * JPIERE-0595:JPBP\n\t */\n\tpublic int getI_BankDataJP_ID();\n\n /** Column name I_BankDataJP_UU */\n public static final String COLUMNNAME_I_BankDataJP_UU = \"I_BankDataJP_UU\";\n\n\t/** Set I_BankDataJP_UU\t */\n\tpublic void setI_BankDataJP_UU (String I_BankDataJP_UU);\n\n\t/** Get I_BankDataJP_UU\t */\n\tpublic String getI_BankDataJP_UU();\n\n /** Column name I_ErrorMsg */\n public static final String COLUMNNAME_I_ErrorMsg = \"I_ErrorMsg\";\n\n\t/** Set Import Error Message.\n\t * Messages generated from import process\n\t */\n\tpublic void setI_ErrorMsg (String I_ErrorMsg);\n\n\t/** Get Import Error Message.\n\t * Messages generated from import process\n\t */\n\tpublic String getI_ErrorMsg();\n\n /** Column name I_IsImported */\n public static final String COLUMNNAME_I_IsImported = \"I_IsImported\";\n\n\t/** Set Imported.\n\t * Has this import been processed\n\t */\n\tpublic void setI_IsImported (boolean I_IsImported);\n\n\t/** Get Imported.\n\t * Has this import been processed\n\t */\n\tpublic boolean isI_IsImported();\n\n /** Column name IsActive */\n public static final String COLUMNNAME_IsActive = \"IsActive\";\n\n\t/** Set Active.\n\t * The record is active in the system\n\t */\n\tpublic void setIsActive (boolean IsActive);\n\n\t/** Get Active.\n\t * The record is active in the system\n\t */\n\tpublic boolean isActive();\n\n /** Column name JP_A_Name */\n public static final String COLUMNNAME_JP_A_Name = \"JP_A_Name\";\n\n\t/** Set Account Name\t */\n\tpublic void setJP_A_Name (String JP_A_Name);\n\n\t/** Get Account Name\t */\n\tpublic String getJP_A_Name();\n\n /** Column name JP_A_Name_Kana */\n public static final String COLUMNNAME_JP_A_Name_Kana = \"JP_A_Name_Kana\";\n\n\t/** Set Account Name(Kana)\t */\n\tpublic void setJP_A_Name_Kana (String JP_A_Name_Kana);\n\n\t/** Get Account Name(Kana)\t */\n\tpublic String getJP_A_Name_Kana();\n\n /** Column name JP_AcctDate */\n public static final String COLUMNNAME_JP_AcctDate = \"JP_AcctDate\";\n\n\t/** Set Date of Account Date\t */\n\tpublic void setJP_AcctDate (String JP_AcctDate);\n\n\t/** Get Date of Account Date\t */\n\tpublic String getJP_AcctDate();\n\n /** Column name JP_AcctMonth */\n public static final String COLUMNNAME_JP_AcctMonth = \"JP_AcctMonth\";\n\n\t/** Set Month of Account Date\t */\n\tpublic void setJP_AcctMonth (String JP_AcctMonth);\n\n\t/** Get Month of Account Date\t */\n\tpublic String getJP_AcctMonth();\n\n /** Column name JP_BankAccountType */\n public static final String COLUMNNAME_JP_BankAccountType = \"JP_BankAccountType\";\n\n\t/** Set Bank Account Type\t */\n\tpublic void setJP_BankAccountType (String JP_BankAccountType);\n\n\t/** Get Bank Account Type\t */\n\tpublic String getJP_BankAccountType();\n\n /** Column name JP_BankAccount_Value */\n public static final String COLUMNNAME_JP_BankAccount_Value = \"JP_BankAccount_Value\";\n\n\t/** Set Bank Account(Search Key)\t */\n\tpublic void setJP_BankAccount_Value (String JP_BankAccount_Value);\n\n\t/** Get Bank Account(Search Key)\t */\n\tpublic String getJP_BankAccount_Value();\n\n /** Column name JP_BankDataCustomerCode1 */\n public static final String COLUMNNAME_JP_BankDataCustomerCode1 = \"JP_BankDataCustomerCode1\";\n\n\t/** Set Bank Data Customer Code1\t */\n\tpublic void setJP_BankDataCustomerCode1 (String JP_BankDataCustomerCode1);\n\n\t/** Get Bank Data Customer Code1\t */\n\tpublic String getJP_BankDataCustomerCode1();\n\n /** Column name JP_BankDataCustomerCode2 */\n public static final String COLUMNNAME_JP_BankDataCustomerCode2 = \"JP_BankDataCustomerCode2\";\n\n\t/** Set Bank Data Customer Code2\t */\n\tpublic void setJP_BankDataCustomerCode2 (String JP_BankDataCustomerCode2);\n\n\t/** Get Bank Data Customer Code2\t */\n\tpublic String getJP_BankDataCustomerCode2();\n\n /** Column name JP_BankDataLine_ID */\n public static final String COLUMNNAME_JP_BankDataLine_ID = \"JP_BankDataLine_ID\";\n\n\t/** Set Import Bank Data Line\t */\n\tpublic void setJP_BankDataLine_ID (int JP_BankDataLine_ID);\n\n\t/** Get Import Bank Data Line\t */\n\tpublic int getJP_BankDataLine_ID();\n\n\tpublic I_JP_BankDataLine getJP_BankDataLine() throws RuntimeException;\n\n /** Column name JP_BankData_EDI_Info */\n public static final String COLUMNNAME_JP_BankData_EDI_Info = \"JP_BankData_EDI_Info\";\n\n\t/** Set BankData EDI Info\t */\n\tpublic void setJP_BankData_EDI_Info (String JP_BankData_EDI_Info);\n\n\t/** Get BankData EDI Info\t */\n\tpublic String getJP_BankData_EDI_Info();\n\n /** Column name JP_BankData_ID */\n public static final String COLUMNNAME_JP_BankData_ID = \"JP_BankData_ID\";\n\n\t/** Set Import Bank Data\t */\n\tpublic void setJP_BankData_ID (int JP_BankData_ID);\n\n\t/** Get Import Bank Data\t */\n\tpublic int getJP_BankData_ID();\n\n\tpublic I_JP_BankData getJP_BankData() throws RuntimeException;\n\n /** Column name JP_BankData_ReferenceNo */\n public static final String COLUMNNAME_JP_BankData_ReferenceNo = \"JP_BankData_ReferenceNo\";\n\n\t/** Set Bank Data ReferenceNo\t */\n\tpublic void setJP_BankData_ReferenceNo (String JP_BankData_ReferenceNo);\n\n\t/** Get Bank Data ReferenceNo\t */\n\tpublic String getJP_BankData_ReferenceNo();\n\n /** Column name JP_BankName_Kana */\n public static final String COLUMNNAME_JP_BankName_Kana = \"JP_BankName_Kana\";\n\n\t/** Set Bank Name(Kana)\t */\n\tpublic void setJP_BankName_Kana (String JP_BankName_Kana);\n\n\t/** Get Bank Name(Kana)\t */\n\tpublic String getJP_BankName_Kana();\n\n /** Column name JP_BankName_Kana_Line */\n public static final String COLUMNNAME_JP_BankName_Kana_Line = \"JP_BankName_Kana_Line\";\n\n\t/** Set Bank Name(Kana) Line\t */\n\tpublic void setJP_BankName_Kana_Line (String JP_BankName_Kana_Line);\n\n\t/** Get Bank Name(Kana) Line\t */\n\tpublic String getJP_BankName_Kana_Line();\n\n /** Column name JP_Bank_Name */\n public static final String COLUMNNAME_JP_Bank_Name = \"JP_Bank_Name\";\n\n\t/** Set Bank Name\t */\n\tpublic void setJP_Bank_Name (String JP_Bank_Name);\n\n\t/** Get Bank Name\t */\n\tpublic String getJP_Bank_Name();\n\n /** Column name JP_BranchCode */\n public static final String COLUMNNAME_JP_BranchCode = \"JP_BranchCode\";\n\n\t/** Set Branch Code\t */\n\tpublic void setJP_BranchCode (String JP_BranchCode);\n\n\t/** Get Branch Code\t */\n\tpublic String getJP_BranchCode();\n\n /** Column name JP_BranchName */\n public static final String COLUMNNAME_JP_BranchName = \"JP_BranchName\";\n\n\t/** Set Branch Name\t */\n\tpublic void setJP_BranchName (String JP_BranchName);\n\n\t/** Get Branch Name\t */\n\tpublic String getJP_BranchName();\n\n /** Column name JP_BranchName_Kana */\n public static final String COLUMNNAME_JP_BranchName_Kana = \"JP_BranchName_Kana\";\n\n\t/** Set Branch Name(Kana)\t */\n\tpublic void setJP_BranchName_Kana (String JP_BranchName_Kana);\n\n\t/** Get Branch Name(Kana)\t */\n\tpublic String getJP_BranchName_Kana();\n\n /** Column name JP_BranchName_Kana_Line */\n public static final String COLUMNNAME_JP_BranchName_Kana_Line = \"JP_BranchName_Kana_Line\";\n\n\t/** Set Branch Name(Kana) Line\t */\n\tpublic void setJP_BranchName_Kana_Line (String JP_BranchName_Kana_Line);\n\n\t/** Get Branch Name(Kana) Line\t */\n\tpublic String getJP_BranchName_Kana_Line();\n\n /** Column name JP_Date */\n public static final String COLUMNNAME_JP_Date = \"JP_Date\";\n\n\t/** Set Date.\n\t * Date\n\t */\n\tpublic void setJP_Date (String JP_Date);\n\n\t/** Get Date.\n\t * Date\n\t */\n\tpublic String getJP_Date();\n\n /** Column name JP_Line_Description */\n public static final String COLUMNNAME_JP_Line_Description = \"JP_Line_Description\";\n\n\t/** Set Line Description\t */\n\tpublic void setJP_Line_Description (String JP_Line_Description);\n\n\t/** Get Line Description\t */\n\tpublic String getJP_Line_Description();\n\n /** Column name JP_Month */\n public static final String COLUMNNAME_JP_Month = \"JP_Month\";\n\n\t/** Set Month\t */\n\tpublic void setJP_Month (String JP_Month);\n\n\t/** Get Month\t */\n\tpublic String getJP_Month();\n\n /** Column name JP_OrgTrx_Value */\n public static final String COLUMNNAME_JP_OrgTrx_Value = \"JP_OrgTrx_Value\";\n\n\t/** Set Trx Organization(Search Key)\t */\n\tpublic void setJP_OrgTrx_Value (String JP_OrgTrx_Value);\n\n\t/** Get Trx Organization(Search Key)\t */\n\tpublic String getJP_OrgTrx_Value();\n\n /** Column name JP_Org_Value */\n public static final String COLUMNNAME_JP_Org_Value = \"JP_Org_Value\";\n\n\t/** Set Organization(Search Key)\t */\n\tpublic void setJP_Org_Value (String JP_Org_Value);\n\n\t/** Get Organization(Search Key)\t */\n\tpublic String getJP_Org_Value();\n\n /** Column name JP_RequesterName */\n public static final String COLUMNNAME_JP_RequesterName = \"JP_RequesterName\";\n\n\t/** Set Requester Name\t */\n\tpublic void setJP_RequesterName (String JP_RequesterName);\n\n\t/** Get Requester Name\t */\n\tpublic String getJP_RequesterName();\n\n /** Column name JP_SalesRep_EMail */\n public static final String COLUMNNAME_JP_SalesRep_EMail = \"JP_SalesRep_EMail\";\n\n\t/** Set Sales Rep(E-Mail)\t */\n\tpublic void setJP_SalesRep_EMail (String JP_SalesRep_EMail);\n\n\t/** Get Sales Rep(E-Mail)\t */\n\tpublic String getJP_SalesRep_EMail();\n\n /** Column name JP_SalesRep_Name */\n public static final String COLUMNNAME_JP_SalesRep_Name = \"JP_SalesRep_Name\";\n\n\t/** Set Sales Rep(Name)\t */\n\tpublic void setJP_SalesRep_Name (String JP_SalesRep_Name);\n\n\t/** Get Sales Rep(Name)\t */\n\tpublic String getJP_SalesRep_Name();\n\n /** Column name JP_SalesRep_Value */\n public static final String COLUMNNAME_JP_SalesRep_Value = \"JP_SalesRep_Value\";\n\n\t/** Set Sales Rep(Search Key)\t */\n\tpublic void setJP_SalesRep_Value (String JP_SalesRep_Value);\n\n\t/** Get Sales Rep(Search Key)\t */\n\tpublic String getJP_SalesRep_Value();\n\n /** Column name Processed */\n public static final String COLUMNNAME_Processed = \"Processed\";\n\n\t/** Set Processed.\n\t * The document has been processed\n\t */\n\tpublic void setProcessed (boolean Processed);\n\n\t/** Get Processed.\n\t * The document has been processed\n\t */\n\tpublic boolean isProcessed();\n\n /** Column name Processing */\n public static final String COLUMNNAME_Processing = \"Processing\";\n\n\t/** Set Process Now\t */\n\tpublic void setProcessing (boolean Processing);\n\n\t/** Get Process Now\t */\n\tpublic boolean isProcessing();\n\n /** Column name RoutingNo */\n public static final String COLUMNNAME_RoutingNo = \"RoutingNo\";\n\n\t/** Set Routing No.\n\t * Bank Routing Number\n\t */\n\tpublic void setRoutingNo (String RoutingNo);\n\n\t/** Get Routing No.\n\t * Bank Routing Number\n\t */\n\tpublic String getRoutingNo();\n\n /** Column name SalesRep_ID */\n public static final String COLUMNNAME_SalesRep_ID = \"SalesRep_ID\";\n\n\t/** Set Sales Rep.\n\t * Sales Representative or Company Agent\n\t */\n\tpublic void setSalesRep_ID (int SalesRep_ID);\n\n\t/** Get Sales Rep.\n\t * Sales Representative or Company Agent\n\t */\n\tpublic int getSalesRep_ID();\n\n\tpublic org.compiere.model.I_AD_User getSalesRep() throws RuntimeException;\n\n /** Column name StatementDate */\n public static final String COLUMNNAME_StatementDate = \"StatementDate\";\n\n\t/** Set Statement date.\n\t * Date of the statement\n\t */\n\tpublic void setStatementDate (Timestamp StatementDate);\n\n\t/** Get Statement date.\n\t * Date of the statement\n\t */\n\tpublic Timestamp getStatementDate();\n\n /** Column name StmtAmt */\n public static final String COLUMNNAME_StmtAmt = \"StmtAmt\";\n\n\t/** Set Statement amount.\n\t * Statement Amount\n\t */\n\tpublic void setStmtAmt (BigDecimal StmtAmt);\n\n\t/** Get Statement amount.\n\t * Statement Amount\n\t */\n\tpublic BigDecimal getStmtAmt();\n\n /** Column name TrxAmt */\n public static final String COLUMNNAME_TrxAmt = \"TrxAmt\";\n\n\t/** Set Transaction Amount.\n\t * Amount of a transaction\n\t */\n\tpublic void setTrxAmt (BigDecimal TrxAmt);\n\n\t/** Get Transaction Amount.\n\t * Amount of a transaction\n\t */\n\tpublic BigDecimal getTrxAmt();\n\n /** Column name Updated */\n public static final String COLUMNNAME_Updated = \"Updated\";\n\n\t/** Get Updated.\n\t * Date this record was updated\n\t */\n\tpublic Timestamp getUpdated();\n\n /** Column name UpdatedBy */\n public static final String COLUMNNAME_UpdatedBy = \"UpdatedBy\";\n\n\t/** Get Updated By.\n\t * User who updated this records\n\t */\n\tpublic int getUpdatedBy();\n}", "Map<String, Object> getAllMetadata();", "public static JasperReportBuilder generateReport(ExportData metaData,HttpServletRequest request){\n session = request.getSession(false);\n report = report(); // Creer le rapport\n \n //Logo\n// logoImg = cmp.image(inImg).setStyle(DynamicReports.stl.style().setHorizontalAlignment(HorizontalAlignment.LEFT)); \n //logoImg.setDimension(80,80); \n \n //Definit le style des colonnes d'entàte\n report.setColumnTitleStyle(getHeaderStyle(metaData));\n \n \n \n LinkedHashMap <String,String> criteria = metaData.getCriteria(); \n //Ajout la date d'àdition au critere d'impression\n String valDateProperty = getDateTxt(metaData.getLang()) ;\n String keyDateProperty = \"\" ;\n if ( session.getAttribute(\"activedLocale\").equals(\"fr\") ) {\n keyDateProperty = \"Edité le \" ;\n }\n else {\n keyDateProperty = \"Printed on \" ;\n }\n criteria.put(keyDateProperty,valDateProperty);\n \n StyleBuilder titleStyle = stl.style(boldStyle).setFontSize(16).setForegroundColor(new Color(0, 0, 0)).setHorizontalAlignment(HorizontalAlignment.RIGHT).setRightIndent(20);\n ComponentBuilder<?, ?> logoComponent = cmp.horizontalList(\n //cmp.image(Templates.class.getResource(\"/logopalm.png\")).setFixedDimension(150, 50).setStyle(stl.style().setLeftIndent(20)),\n cmp.verticalList(\n cmp.text(metaData.getTitle()).setStyle(titleStyle)\n )\n ).newRow()\n .add(cmp.horizontalList().add(cmp.hListCell(createCriteriaComponent(criteria,metaData)).heightFixedOnTop()))\n .newRow(); \n \n report.noData(logoComponent, cmp.text(\"Aucun enregistrement trouvà\").setStyle(stl.style().setHorizontalAlignment(HorizontalAlignment.CENTER).setTopPadding(30)));\n\n \n \n lblStyle = stl.style(Templates.columnStyle).setForegroundColor(new Color(60, 91, 31)); // Couleur du text \n colStyle = stl.style(Templates.columnStyle).setHorizontalAlignment(HorizontalAlignment.CENTER);\n \n groupStyle = stl.style().setForegroundColor(new Color(60, 91, 31)) \n .setBold(Boolean.TRUE)\n .setPadding(5)\n .setFontSize(13)\n .setHorizontalAlignment(HorizontalAlignment.CENTER); \n \n\n \n if(metaData.getTitle().equals(ITitle.PARCEL)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PARCEL_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SECTOR)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SECTOR_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BLOCK)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BLOCK_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ATTACK_PHYTO)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TREATMENT)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TREATMENT_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVEST)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVEST_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SERVICING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SERVICING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_PLANTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_PLANTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.FERTILIZATION)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.FERTILIZATION_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.CONTROL_PHYTO)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.CONTROL_PHYTO_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_FOLDING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_FOLDING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.MORTALITY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.MORTALITY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVESTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVESTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BUDGET)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.REPLACEMENT)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.REPLACEMENT_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.METEOROLOGY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.METEOROLOGY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_MATERIAL)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_MATERIAL_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLUVIOMETRY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLUVIOMETRY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ETP)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ETP_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HYGROMETRY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HYGROMETRY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TEMPERATURE)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TEMPERATURE_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.INSULATION)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.INSULATION_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.WORK)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.WORK_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }\n \n \n drColumns = new HashMap<String, TextColumnBuilder>(); \n groups = new ArrayList<String>();\n subtotals = new ArrayList<String>();\n \n //Definit la liste des colonnes du rapport\n ExportGenerator.getColumns(metaData); \n //Definit la liste des sous-totaux du rapport\n ExportGenerator.getSubTotals(metaData);\n \n \n //Genration des sous totaux\n for (String group : groups) {\n ColumnGroupBuilder group2 = grp.group(drColumns.get(group));\n report.groupBy(group2);\n for (String subtotal : subtotals) {\n report.subtotalsAtGroupFooter(group2,sbt.sum(drColumns.get(subtotal)));\n }\n }\n\n for (String subtotal : subtotals) {\n report.subtotalsAtSummary(sbt.sum(drColumns.get(subtotal))); \n }\n \n /*if(ExportGenerator.getColumnByNameField(\"plantingName\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL \"), ExportGenerator.getColumnByNameField(\"plantingName\"), Calculation.NOTHING));\n }*//*else if(ExportGenerator.getColumnByNameField(\"invoiceCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"invoiceCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"planterCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL\"), ExportGenerator.getColumnByNameField(\"planterCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"transportTicket\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"transportTicket\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"deliveryDate\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"deliveryDate\"), Calculation.NOTHING));\n }\n else if(ExportGenerator.getColumnByNameField(\"arroundPlantingTicketNumber\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"arroundPlantingTicketNumber\"), Calculation.NOTHING));\n }\n else if(ExportGenerator.getColumnByNameField(\"planterNumber\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"planterNumber\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"startPaymentDate\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"startPaymentDate\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"sectorCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"sectorCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"month\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL \"), ExportGenerator.getColumnByNameField(\"month\"), Calculation.NOTHING));\n }*/\n \n\n \n \n //Genere la source de donnàes du rapport\n report.setDataSource(metaData.getData());\n \n report.highlightDetailEvenRows(); \n \n \n // Definition de l'entete : valable uniquement pour la 1ere page\n HorizontalListBuilder hlb= null;\n \n hlb = cmp.horizontalList().add(\n cmp.hListCell(createCriteriaComponent(criteria,metaData)).heightFixedOnTop()\n );\n\n \n report.title(\n createCustomTitleComponent(metaData.getTitle()), // Titre\n hlb,// Liste Horizontal des Critàres \n cmp.verticalGap(12) // Marge de 12 px entre chaque critàre\n ); \n \n \n \n report.setPageMargin(DynamicReports.margin().setLeft(15).setTop(30).setRight(15).setBottom(30));\n report.setPageFormat(PageType.A3, PageOrientation.LANDSCAPE);\n report.pageFooter(DynamicReports.cmp.pageXslashY());\n return report;\n \n }", "public interface IReportDao extends IBaseDao<Report, Integer> {\n\t\n\t/**\n\t * 添加举报信息\n\t * @param report\n\t */\n\tpublic boolean addReport(Report report);\n\t\n\t/**\n\t * 修改举报信息\n\t * @param report\n\t * @return\n\t */\n\tpublic boolean updateReport(Report report);\n\t\n//\t/**\n//\t * 是否已经举报\n//\t * @param getReportGto\n//\t * @return\n//\t */\n//\tpublic boolean isHouseInfoReported(GetReportGto getReportGto);\n\t\n\t/**\n\t * 获取我与某条房源的举报信息\n\t * @param getReportGto\n\t * @return\n\t */\n\tpublic List<Report> getMyReport(GetReportGto getReportGto);\n}", "public interface TableDetailMapper {\n\n @Select(\"select * from dxh_sys.tabledetail where vendorId=0 and tableName='skuProfitDayReport'\")\n List<Map<String, Object>> list();\n\n}", "public Report getReport();", "BoltResultSetMetaData(List<Type> types, List<String> keys) {\n\t\tsuper(keys);\n\t\tthis.columnType = types.toArray(new Type[this.keys.size() + 1]);\n\n\t\t// we init columnType with the first record\n\t\t// in case first == last record\n\t\t/*for (int i = 1; i <= this.keys.size(); i++) {\n\t\t\tcolumnType[i] = this.getColumnDriverTypeOrDefault(i, InternalTypeSystem.TYPE_SYSTEM.STRING());\n\t\t}*/\n\t}", "@Override\r\n\tpublic Map<String, Object> getMetadata() {\n\t\treturn null;\r\n\t}", "@Select({\n \"select\",\n \"JNLNO, TRANDATE, ACCOUNTDATE, CHECKTYPE, STATUS, DONETIME, FILENAME\",\n \"from B_UMB_CHECKING_LOG\",\n \"where JNLNO = #{jnlno,jdbcType=VARCHAR}\"\n })\n @Results({\n @Result(column=\"JNLNO\", property=\"jnlno\", jdbcType=JdbcType.VARCHAR, id=true),\n @Result(column=\"TRANDATE\", property=\"trandate\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"ACCOUNTDATE\", property=\"accountdate\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"CHECKTYPE\", property=\"checktype\", jdbcType=JdbcType.CHAR),\n @Result(column=\"STATUS\", property=\"status\", jdbcType=JdbcType.CHAR),\n @Result(column=\"DONETIME\", property=\"donetime\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"FILENAME\", property=\"filename\", jdbcType=JdbcType.VARCHAR)\n })\n BUMBCheckingLog selectByPrimaryKey(BUMBCheckingLogKey key);", "@SqlQuery(\"select * from PLAYERSTATS\")\n List<PlayerStats> getAll();", "protected String getMetadataName() {\r\n\t\treturn METADATA_NAME;\r\n\t}", "public abstract String getSummaryForDatabase();", "private interface ReportColumnCallback\n {\n void handleReportColumn(DashboardReport report, String columnName) throws MojoExecutionException;\n }", "public ReportMetadataExample() {\n\t\toredCriteria = new ArrayList<Criteria>();\n\t}", "@Override\r\n \tpublic MetaData getMetaData(HttpHeaders headers) {\n \t\ttry {\r\n \t\t\treturn MetaDataUtil.getMetaData(new ViewListeEleve(), new HashMap<String, MetaData>(),new ArrayList<String>());\r\n \t\t} catch (Exception e) {\r\n \t\t\t// TODO Auto-generated catch block\r\n \t\t\tthrow new WebApplicationException(Response.serverError().entity(new String(\"MetaData parse error\")).build());\r\n \t\t} \r\n \t}", "public DefaultMetaData getMetaData() {\n\t\treturn this.metaData;\n\t}", "Report createReport();", "@Override\n public Map<String, String> createFieldToPropertyMapping() {\n final Map<String, String> mapping = super.createFieldToPropertyMapping();\n mapping.put(this.tableName + \".rsres_id\", \"id\");\n mapping.put(this.tableName + \".resource_id\", \"resourceId\");\n mapping.put(this.tableName + \".quantity\", QUANTITY);\n mapping.put(this.tableName + \".cost_rsres\", \"cost\");\n\n return mapping;\n }", "public String getReportsToBeGenerated(String reportType) {\r\n\t\tString query = \"\";\r\n\t\t\r\n\t\ttry (Connection connection = DatabaseConnection.getMySQLConnection();\r\n\t\t\t PreparedStatement stmt = connection.prepareStatement(query);) {\r\n\t\t\tResultSet result = stmt.executeQuery();\r\n\t\t\tStringJoiner reports = new StringJoiner(\",,\");\r\n\t\t\twhile (result.next()) {\r\n\t\t\t\treports.add(result.getString(\"REPORT_NAME\"));\r\n\t\t\t}\r\n\t\t\treturn reports.toString();\r\n\t\t} catch (SQLException e) {\r\n\t\t\tthrow new ReportGenerationException(\"An error occurred while retrieving reports to be generated.\", e);\r\n\t\t}\r\n\t}", "public String getMetaDataFileName() {\n return null;\n }", "public JDBCRawSqlQueryMetaData(Method method) {\n this.method = method;\n }", "public Map getMetadata() {\n return metadata;\n }", "public DatabaseMetaData(Statement s) {\n\t\t_stmt = s; // SQL-Connection\n\t\t_buffer = new StringBuffer(); // Output goes here\n\t\t_tables = new ArrayList<String>(); // List of tables\n\t\t\n\t\ttry {\n\t\t\t// Put table names in `_tables`\n\t\t\textractTableNames(_stmt.executeQuery(composeTableNamesQuery()));\n\n\t\t\t// fetch the string representation of each tables meta-data\n\t\t\tfor (String name : _tables)\n\t\t\t\t_buffer.append(new TableMeta(name)); \n\t\t} catch (SQLException e) { _error = true;}\n\t}", "private Builder() {\n super(net.explorys.samhat.z12.r837.X837Ins_2320_MOA_MedicareOutpatientAdjudicationInformation.SCHEMA$);\n }", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "public String toString() {\n return \"[JDBCRawSqlQueryMetaData : method=\" + method + \"]\";\n }", "Report selectByPrimaryKey(Integer id);", "java.lang.String getMetadata(int index);", "java.lang.String getMetadata(int index);", "public Integer getReportId() {\n return reportId;\n }", "@Schema(description = \"`status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Code general-info: The type of external report available \")\n public String getAssessmentInstanceReportType() {\n return assessmentInstanceReportType;\n }", "@Override\r\n\tpublic List<ReportAndSummary> findAll() {\n\t\tList<ReportAndSummary> result = reportAndSummaryDao.findAll();\r\n\t\treturn result;\r\n\t}", "private static Map<String, ColumnMetaData> buildColumnMetadataMap(ResultSet rs) {\n\t\t/*\n\t\t * LinkedHashmap to preserve key traversal order.\n\t\t * Important as we output rows as arrays of values where the index position in\n\t\t * the row implicitly corresponds to the entry order of the column map.\n\t\t * Reason for this is performance. \n\t\t */\n\t\tMap<String, ColumnMetaData> columnMap = Maps.newLinkedHashMap();\n\t\ttry {\n\t\t\tResultSetMetaData rmd = rs.getMetaData();\n\t\t\tfor (int i=1; i<= rmd.getColumnCount(); i++) {\n\t\t\t\tColumnMetaData cmd = \n\t\t\t\t\tnew ColumnMetaData(rmd.getColumnName(i), rmd.getColumnTypeName(i));\n\t\t\t\tcolumnMap.put(cmd.columnName, cmd);\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\tThrowables.propagate(e);\n\t\t}\n\t\treturn columnMap;\n\t}", "protected String getSqlTable() {\n\t\treturn \"Project\";\n\t}", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "public interface I_IHC_JobDataChange \n{\n\n /** TableName=IHC_JobDataChange */\n public static final String Table_Name = \"IHC_JobDataChange\";\n\n /** AD_Table_ID=1100135 */\n public static final int Table_ID = MTable.getTable_ID(Table_Name);\n\n KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);\n\n /** AccessLevel = 3 - Client - Org \n */\n BigDecimal accessLevel = BigDecimal.valueOf(3);\n\n /** Load Meta Data */\n\n /** Column name AD_Client_ID */\n public static final String COLUMNNAME_AD_Client_ID = \"AD_Client_ID\";\n\n\t/** Get Client.\n\t * Client/Tenant for this installation.\n\t */\n\tpublic int getAD_Client_ID();\n\n /** Column name AD_Org_ID */\n public static final String COLUMNNAME_AD_Org_ID = \"AD_Org_ID\";\n\n\t/** Set Organization.\n\t * Organizational entity within client\n\t */\n\tpublic void setAD_Org_ID (int AD_Org_ID);\n\n\t/** Get Organization.\n\t * Organizational entity within client\n\t */\n\tpublic int getAD_Org_ID();\n\n /** Column name BPJSRegistrationDate */\n public static final String COLUMNNAME_BPJSRegistrationDate = \"BPJSRegistrationDate\";\n\n\t/** Set BPJS Registration Date\t */\n\tpublic void setBPJSRegistrationDate (Timestamp BPJSRegistrationDate);\n\n\t/** Get BPJS Registration Date\t */\n\tpublic Timestamp getBPJSRegistrationDate();\n\n /** Column name Created */\n public static final String COLUMNNAME_Created = \"Created\";\n\n\t/** Get Created.\n\t * Date this record was created\n\t */\n\tpublic Timestamp getCreated();\n\n /** Column name CreatedBy */\n public static final String COLUMNNAME_CreatedBy = \"CreatedBy\";\n\n\t/** Get Created By.\n\t * User who created this records\n\t */\n\tpublic int getCreatedBy();\n\n /** Column name Description */\n public static final String COLUMNNAME_Description = \"Description\";\n\n\t/** Set Description.\n\t * Optional short description of the record\n\t */\n\tpublic void setDescription (String Description);\n\n\t/** Get Description.\n\t * Optional short description of the record\n\t */\n\tpublic String getDescription();\n\n /** Column name DescriptionNew */\n public static final String COLUMNNAME_DescriptionNew = \"DescriptionNew\";\n\n\t/** Set Description New\t */\n\tpublic void setDescriptionNew (String DescriptionNew);\n\n\t/** Get Description New\t */\n\tpublic String getDescriptionNew();\n\n /** Column name HC_Compensation1 */\n public static final String COLUMNNAME_HC_Compensation1 = \"HC_Compensation1\";\n\n\t/** Set Compensation 1\t */\n\tpublic void setHC_Compensation1 (BigDecimal HC_Compensation1);\n\n\t/** Get Compensation 1\t */\n\tpublic BigDecimal getHC_Compensation1();\n\n /** Column name HC_Compensation2 */\n public static final String COLUMNNAME_HC_Compensation2 = \"HC_Compensation2\";\n\n\t/** Set Compensation 2\t */\n\tpublic void setHC_Compensation2 (BigDecimal HC_Compensation2);\n\n\t/** Get Compensation 2\t */\n\tpublic BigDecimal getHC_Compensation2();\n\n /** Column name HC_Compensation3 */\n public static final String COLUMNNAME_HC_Compensation3 = \"HC_Compensation3\";\n\n\t/** Set Compensation 3\t */\n\tpublic void setHC_Compensation3 (BigDecimal HC_Compensation3);\n\n\t/** Get Compensation 3\t */\n\tpublic BigDecimal getHC_Compensation3();\n\n /** Column name HC_Compensation4 */\n public static final String COLUMNNAME_HC_Compensation4 = \"HC_Compensation4\";\n\n\t/** Set Compensation 4\t */\n\tpublic void setHC_Compensation4 (BigDecimal HC_Compensation4);\n\n\t/** Get Compensation 4\t */\n\tpublic BigDecimal getHC_Compensation4();\n\n /** Column name HC_EffectiveSeq */\n public static final String COLUMNNAME_HC_EffectiveSeq = \"HC_EffectiveSeq\";\n\n\t/** Set Effective Sequence\t */\n\tpublic void setHC_EffectiveSeq (int HC_EffectiveSeq);\n\n\t/** Get Effective Sequence\t */\n\tpublic int getHC_EffectiveSeq();\n\n /** Column name HC_Employee_ID */\n public static final String COLUMNNAME_HC_Employee_ID = \"HC_Employee_ID\";\n\n\t/** Set Employee Data\t */\n\tpublic void setHC_Employee_ID (int HC_Employee_ID);\n\n\t/** Get Employee Data\t */\n\tpublic int getHC_Employee_ID();\n\n\tpublic I_HC_Employee getHC_Employee() throws RuntimeException;\n\n /** Column name HC_EmployeeGrade_ID */\n public static final String COLUMNNAME_HC_EmployeeGrade_ID = \"HC_EmployeeGrade_ID\";\n\n\t/** Set Employee Grade\t */\n\tpublic void setHC_EmployeeGrade_ID (int HC_EmployeeGrade_ID);\n\n\t/** Get Employee Grade\t */\n\tpublic int getHC_EmployeeGrade_ID();\n\n\tpublic I_HC_EmployeeGrade getHC_EmployeeGrade() throws RuntimeException;\n\n /** Column name HC_EmployeeGrade2_ID */\n public static final String COLUMNNAME_HC_EmployeeGrade2_ID = \"HC_EmployeeGrade2_ID\";\n\n\t/** Set Employee Grade To\t */\n\tpublic void setHC_EmployeeGrade2_ID (int HC_EmployeeGrade2_ID);\n\n\t/** Get Employee Grade To\t */\n\tpublic int getHC_EmployeeGrade2_ID();\n\n\tpublic I_HC_EmployeeGrade getHC_EmployeeGrade2() throws RuntimeException;\n\n /** Column name HC_EmployeeJob_ID */\n public static final String COLUMNNAME_HC_EmployeeJob_ID = \"HC_EmployeeJob_ID\";\n\n\t/** Set Employee Job Data\t */\n\tpublic void setHC_EmployeeJob_ID (int HC_EmployeeJob_ID);\n\n\t/** Get Employee Job Data\t */\n\tpublic int getHC_EmployeeJob_ID();\n\n\tpublic I_HC_EmployeeJob getHC_EmployeeJob() throws RuntimeException;\n\n /** Column name HC_Job_ID */\n public static final String COLUMNNAME_HC_Job_ID = \"HC_Job_ID\";\n\n\t/** Set Job\t */\n\tpublic void setHC_Job_ID (int HC_Job_ID);\n\n\t/** Get Job\t */\n\tpublic int getHC_Job_ID();\n\n\tpublic I_HC_Job getHC_Job() throws RuntimeException;\n\n /** Column name HC_JobAction */\n public static final String COLUMNNAME_HC_JobAction = \"HC_JobAction\";\n\n\t/** Set Job Action\t */\n\tpublic void setHC_JobAction (String HC_JobAction);\n\n\t/** Get Job Action\t */\n\tpublic String getHC_JobAction();\n\n /** Column name HC_JobDataChange_ID */\n public static final String COLUMNNAME_HC_JobDataChange_ID = \"HC_JobDataChange_ID\";\n\n\t/** Set Job Data Change\t */\n\tpublic void setHC_JobDataChange_ID (int HC_JobDataChange_ID);\n\n\t/** Get Job Data Change\t */\n\tpublic int getHC_JobDataChange_ID();\n\n\tpublic I_HC_JobDataChange getHC_JobDataChange() throws RuntimeException;\n\n /** Column name HC_Manager_ID */\n public static final String COLUMNNAME_HC_Manager_ID = \"HC_Manager_ID\";\n\n\t/** Set Manager Name\t */\n\tpublic void setHC_Manager_ID (int HC_Manager_ID);\n\n\t/** Get Manager Name\t */\n\tpublic int getHC_Manager_ID();\n\n\tpublic I_HC_Employee getHC_Manager() throws RuntimeException;\n\n /** Column name HC_ManagerTo_ID */\n public static final String COLUMNNAME_HC_ManagerTo_ID = \"HC_ManagerTo_ID\";\n\n\t/** Set Manager To ID\t */\n\tpublic void setHC_ManagerTo_ID (int HC_ManagerTo_ID);\n\n\t/** Get Manager To ID\t */\n\tpublic int getHC_ManagerTo_ID();\n\n\tpublic I_HC_Employee getHC_ManagerTo() throws RuntimeException;\n\n /** Column name HC_Org_ID */\n public static final String COLUMNNAME_HC_Org_ID = \"HC_Org_ID\";\n\n\t/** Set HC Organization\t */\n\tpublic void setHC_Org_ID (int HC_Org_ID);\n\n\t/** Get HC Organization\t */\n\tpublic int getHC_Org_ID();\n\n\tpublic I_HC_Org getHC_Org() throws RuntimeException;\n\n /** Column name HC_Org2_ID */\n public static final String COLUMNNAME_HC_Org2_ID = \"HC_Org2_ID\";\n\n\t/** Set HC Organization To\t */\n\tpublic void setHC_Org2_ID (int HC_Org2_ID);\n\n\t/** Get HC Organization To\t */\n\tpublic int getHC_Org2_ID();\n\n\tpublic I_HC_Org getHC_Org2() throws RuntimeException;\n\n /** Column name HC_PayGroup_ID */\n public static final String COLUMNNAME_HC_PayGroup_ID = \"HC_PayGroup_ID\";\n\n\t/** Set Payroll Group\t */\n\tpublic void setHC_PayGroup_ID (int HC_PayGroup_ID);\n\n\t/** Get Payroll Group\t */\n\tpublic int getHC_PayGroup_ID();\n\n\tpublic I_HC_PayGroup getHC_PayGroup() throws RuntimeException;\n\n /** Column name HC_PreviousJob_ID */\n public static final String COLUMNNAME_HC_PreviousJob_ID = \"HC_PreviousJob_ID\";\n\n\t/** Set Job Sekarang\t */\n\tpublic void setHC_PreviousJob_ID (int HC_PreviousJob_ID);\n\n\t/** Get Job Sekarang\t */\n\tpublic int getHC_PreviousJob_ID();\n\n\tpublic I_HC_Job getHC_PreviousJob() throws RuntimeException;\n\n /** Column name HC_Reason_ID */\n public static final String COLUMNNAME_HC_Reason_ID = \"HC_Reason_ID\";\n\n\t/** Set HC Reason\t */\n\tpublic void setHC_Reason_ID (int HC_Reason_ID);\n\n\t/** Get HC Reason\t */\n\tpublic int getHC_Reason_ID();\n\n\tpublic I_HC_Reason getHC_Reason() throws RuntimeException;\n\n /** Column name HC_Status */\n public static final String COLUMNNAME_HC_Status = \"HC_Status\";\n\n\t/** Set HC Status\t */\n\tpublic void setHC_Status (String HC_Status);\n\n\t/** Get HC Status\t */\n\tpublic String getHC_Status();\n\n /** Column name HC_WorkEndDate */\n public static final String COLUMNNAME_HC_WorkEndDate = \"HC_WorkEndDate\";\n\n\t/** Set Work End Date\t */\n\tpublic void setHC_WorkEndDate (Timestamp HC_WorkEndDate);\n\n\t/** Get Work End Date\t */\n\tpublic Timestamp getHC_WorkEndDate();\n\n /** Column name HC_WorkPeriodDate */\n public static final String COLUMNNAME_HC_WorkPeriodDate = \"HC_WorkPeriodDate\";\n\n\t/** Set WorkPeriodDate\t */\n\tpublic void setHC_WorkPeriodDate (String HC_WorkPeriodDate);\n\n\t/** Get WorkPeriodDate\t */\n\tpublic String getHC_WorkPeriodDate();\n\n /** Column name HC_WorkStartDate */\n public static final String COLUMNNAME_HC_WorkStartDate = \"HC_WorkStartDate\";\n\n\t/** Set WorkStartDate\t */\n\tpublic void setHC_WorkStartDate (Timestamp HC_WorkStartDate);\n\n\t/** Get WorkStartDate\t */\n\tpublic Timestamp getHC_WorkStartDate();\n\n /** Column name HC_WorkStartDate2 */\n public static final String COLUMNNAME_HC_WorkStartDate2 = \"HC_WorkStartDate2\";\n\n\t/** Set Work Start Date Baru\t */\n\tpublic void setHC_WorkStartDate2 (Timestamp HC_WorkStartDate2);\n\n\t/** Get Work Start Date Baru\t */\n\tpublic Timestamp getHC_WorkStartDate2();\n\n /** Column name IHC_JobDataChange_ID */\n public static final String COLUMNNAME_IHC_JobDataChange_ID = \"IHC_JobDataChange_ID\";\n\n\t/** Set IHC_JobDayaChange\t */\n\tpublic void setIHC_JobDataChange_ID (int IHC_JobDataChange_ID);\n\n\t/** Get IHC_JobDayaChange\t */\n\tpublic int getIHC_JobDataChange_ID();\n\n /** Column name IHC_JobDataChange_UU */\n public static final String COLUMNNAME_IHC_JobDataChange_UU = \"IHC_JobDataChange_UU\";\n\n\t/** Set IHC_JobDataChange_UU\t */\n\tpublic void setIHC_JobDataChange_UU (String IHC_JobDataChange_UU);\n\n\t/** Get IHC_JobDataChange_UU\t */\n\tpublic String getIHC_JobDataChange_UU();\n\n /** Column name IsActive */\n public static final String COLUMNNAME_IsActive = \"IsActive\";\n\n\t/** Set Active.\n\t * The record is active in the system\n\t */\n\tpublic void setIsActive (boolean IsActive);\n\n\t/** Get Active.\n\t * The record is active in the system\n\t */\n\tpublic boolean isActive();\n\n /** Column name IsCancelled */\n public static final String COLUMNNAME_IsCancelled = \"IsCancelled\";\n\n\t/** Set Cancelled.\n\t * The transaction was cancelled\n\t */\n\tpublic void setIsCancelled (boolean IsCancelled);\n\n\t/** Get Cancelled.\n\t * The transaction was cancelled\n\t */\n\tpublic boolean isCancelled();\n\n /** Column name NomorSK */\n public static final String COLUMNNAME_NomorSK = \"NomorSK\";\n\n\t/** Set Nomor SK\t */\n\tpublic void setNomorSK (String NomorSK);\n\n\t/** Get Nomor SK\t */\n\tpublic String getNomorSK();\n\n /** Column name NomorSK2 */\n public static final String COLUMNNAME_NomorSK2 = \"NomorSK2\";\n\n\t/** Set Nomor SK Baru\t */\n\tpublic void setNomorSK2 (String NomorSK2);\n\n\t/** Get Nomor SK Baru\t */\n\tpublic String getNomorSK2();\n\n /** Column name OriginalServiceData */\n public static final String COLUMNNAME_OriginalServiceData = \"OriginalServiceData\";\n\n\t/** Set Original Service Date\t */\n\tpublic void setOriginalServiceData (Timestamp OriginalServiceData);\n\n\t/** Get Original Service Date\t */\n\tpublic Timestamp getOriginalServiceData();\n\n /** Column name Processed */\n public static final String COLUMNNAME_Processed = \"Processed\";\n\n\t/** Set Processed.\n\t * The document has been processed\n\t */\n\tpublic void setProcessed (boolean Processed);\n\n\t/** Get Processed.\n\t * The document has been processed\n\t */\n\tpublic boolean isProcessed();\n\n /** Column name SeqNo */\n public static final String COLUMNNAME_SeqNo = \"SeqNo\";\n\n\t/** Set Sequence.\n\t * Method of ordering records;\n lowest number comes first\n\t */\n\tpublic void setSeqNo (int SeqNo);\n\n\t/** Get Sequence.\n\t * Method of ordering records;\n lowest number comes first\n\t */\n\tpublic int getSeqNo();\n\n /** Column name Updated */\n public static final String COLUMNNAME_Updated = \"Updated\";\n\n\t/** Get Updated.\n\t * Date this record was updated\n\t */\n\tpublic Timestamp getUpdated();\n\n /** Column name UpdatedBy */\n public static final String COLUMNNAME_UpdatedBy = \"UpdatedBy\";\n\n\t/** Get Updated By.\n\t * User who updated this records\n\t */\n\tpublic int getUpdatedBy();\n}" ]
[ "0.720387", "0.60612166", "0.5897073", "0.5817371", "0.58169", "0.5653088", "0.5575094", "0.5565293", "0.5523116", "0.55214834", "0.5424825", "0.5421459", "0.5377486", "0.534678", "0.5342339", "0.53190213", "0.5239825", "0.5236659", "0.5227619", "0.513109", "0.5122094", "0.5114957", "0.5110571", "0.5092275", "0.50793064", "0.50710756", "0.50666755", "0.50432736", "0.50225407", "0.5009165", "0.5007035", "0.49747992", "0.49714422", "0.49305487", "0.4928956", "0.49114767", "0.49047396", "0.4894513", "0.488628", "0.48804012", "0.48787948", "0.4848689", "0.4836264", "0.4834436", "0.48120287", "0.4810927", "0.4800393", "0.4796319", "0.4796208", "0.47960824", "0.47906667", "0.4782785", "0.47692993", "0.47681826", "0.47613847", "0.47506967", "0.4746286", "0.47449973", "0.4743577", "0.47416592", "0.47313273", "0.47236001", "0.47218567", "0.47168458", "0.47161394", "0.47148344", "0.47092924", "0.47078082", "0.4703429", "0.46990865", "0.46964943", "0.46792674", "0.4675461", "0.4675461", "0.4675461", "0.4675461", "0.4675461", "0.46668383", "0.4666713", "0.46600732", "0.46600732", "0.4655324", "0.46417722", "0.46361163", "0.46348158", "0.46313247", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.4627627" ]
0.0
-1
This method was generated by MyBatis Generator. This method corresponds to the database table core.report_metadata
public void setDistinct(boolean distinct) { this.distinct = distinct; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "TableReportMetadata getReportMetadata(String reportId);", "public abstract List<ColumnSpecification> metadata();", "@Override\r\n\t\tpublic DatabaseMetaData getMetaData() throws SQLException {\n\t\t\treturn null;\r\n\t\t}", "@Override\n\tpublic JDBCMetaData getMetaData() throws SQLException {\n\t\treturn null;\n\t}", "private void writeMetaData(ResultSet resultSet) throws SQLException {\n\t System.out.println(\"The columns in the table are: \");\r\n\t System.out.println(\"Table: \" + resultSet.getMetaData().getTableName(1));\r\n\t for (int i = 1; i<= resultSet.getMetaData().getColumnCount(); i++){\r\n\t System.out.println(\"Column \" +i + \" \"+ resultSet.getMetaData().getColumnName(i));\r\n\t }\r\n\t }", "public interface TableMetaData {\n\n\t/** Adds normal column. */\n\tpublic void addColumn(final ColumnMetaData column);\n\n\t/** Adds primary key column. */\n\tpublic void addPrimaryKey(final ColumnMetaData column);\n\n\t/** Returns map of column meta data, keyed by the column label (the alias if provided in the query, otherwise the name). */\n\tpublic Map<String, ColumnMetaData> getColumns();\n\n\t/** Returns database name. */\n\tpublic String getDatabaseName();\n\n\t/** Returns ordered list of columns that are primary keys. */\n\tpublic List<ColumnMetaData> getPrimaryKeys();\n\n\t/**\n\t * Returns fully qualified table name in database-specific form for use in SQL statements. MySQL uses the form\n\t * <code>database.table</code>, for example <code>sakila.film</code>. PostgreSQL uses the form\n\t * <code>database.schema.table</code>, for example <code>sakila.public.film</code>.\n\t */\n\tpublic String getQualifiedTableName();\n\n\t/** Returns row alias. */\n\tpublic String getRowAlias();\n\t\n\t/** Returns row set alias. */\n\tpublic String getRowSetAlias();\n\t\n\t/**\n\t * Returns row alias.\n\t * \n * @deprecated As of 0.8.11 use {@link #getRowAlias()}\n\t */\n\t@Deprecated\n\tpublic String getTableAlias();\n\n\t/** Returns table name. */\n\tpublic String getTableName();\n\n\t/** Returns role of table in the SQL Resource. */\n\tpublic TableRole getTableRole();\n\n\t/** Returns true if the SQL Resource role is child. */\n\tpublic boolean isChild();\n\n\t/** Returns true if the SQL Resource role is parent. */\n\tpublic boolean isParent();\n\n\t/** Sets all the row and row set aliases. */\n\tpublic void setAliases(final String alias, final String rowAlias, final String rowSetAlias);\n\n\t/** Sets attributes. */\n\tpublic void setAttributes(final String tableName, final String qualifedTableName,\n\t\t\tfinal String databaseName, final TableRole tableRole);\n\n\t/**\n\t * Sets table alias.\n\t * \n * @deprecated As of 0.8.11 use {@link #setAliases(String, String, String)}\n\t */\n\t@Deprecated\n\tpublic void setTableAlias(final String tableAlias);\n\t\n\t/** Represents all of the roles a table may plan in a SQL Resource. */\n\t@XmlType(namespace = \"http://restsql.org/schema\")\n\tpublic enum TableRole {\n\t\tChild, ChildExtension, Join, Parent, ParentExtension, Unknown;\n\t}\n}", "public abstract List<String> newReportColumns();", "ResultSetMetaData getMetaData() throws SQLException;", "public DBMetaDataSet getMetaData()\n\t{\n\t\treturn _MetaData;\n\t}", "public interface SqlResourceMetaData {\r\n\r\n\tpublic List<ColumnMetaData> getAllReadColumns();\r\n\r\n\tpublic TableMetaData getChild();\r\n\r\n\tpublic List<TableMetaData> getChildPlusExtTables();\r\n\r\n\tpublic List<ColumnMetaData> getChildReadColumns();\r\n\r\n\tpublic TableMetaData getJoin();\r\n\r\n\tpublic List<TableMetaData> getJoinList();\r\n\r\n\tpublic int getNumberTables();\r\n\r\n\tpublic TableMetaData getParent();\r\n\r\n\tpublic List<TableMetaData> getParentPlusExtTables();\r\n\r\n\tpublic List<ColumnMetaData> getParentReadColumns();\r\n\r\n\tpublic Map<String, TableMetaData> getTableMap();\r\n\r\n\tpublic List<TableMetaData> getTables();\r\n\r\n\tpublic List<TableMetaData> getWriteTables(final Type requestType, final boolean doParent);\r\n\r\n\tpublic boolean hasJoinTable();\r\n\r\n\tpublic boolean hasMultipleDatabases();\r\n\r\n\tpublic boolean isHierarchical();\r\n\r\n\tpublic void init(final String sqlResourceName, final SqlResourceDefinition definition, final SqlBuilder sqlBuilder)\r\n\t\t\tthrows SqlResourceException;\r\n\r\n\tpublic String toHtml();\r\n\r\n\tpublic String toXml();\r\n}", "public void addColumnPathReportId() {\n addColumnInPath(ColumnMetaData.KEY_PATH_ID);\n }", "public ResultSetMetaData getMetaData() throws SQLException {\n\n try {\n int id = getNextId(TraceObject.RESULT_SET_META_DATA);\n if (isDebugEnabled()) {\n debugCodeAssign(\"ResultSetMetaData\", TraceObject.RESULT_SET_META_DATA, id, \"getMetaData()\");\n }\n checkClosed();\n String catalog = conn.getCatalog();\n JdbcResultSetMetaData meta = new JdbcResultSetMetaData(this, null, result, catalog, conn.getSession().getTrace(), id);\n return meta;\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "public MetaData getMetaData();", "@Override\n public DatabaseMetaData getMetaData() throws SQLException\n {\n logger.debug(\n \" public DatabaseMetaData getMetaData() throws SQLException\");\n\n return new SnowflakeDatabaseMetaData(this);\n }", "public DataSetMetaData getMetaData() {\n return this.metadata;\n }", "@Test\n public void metaDataExample1() throws SQLException {\n Connection connection = DriverManager.getConnection(dbUrl, dbUsername, dbPassword);\n // 2. Create statement\n Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);\n // Run sql query and get the result in resultSet object\n String sqlQuery= \"Select * From departments\";\n //String sqlQuery= \"Select first_name, last_name, salary From employees\";\n ResultSet resultSet = statement.executeQuery(sqlQuery);\n\n // we use resultSet metadata to get information about the tables\n // get the resultSet object metadata\n ResultSetMetaData rsMetadata = resultSet.getMetaData();\n\n // List for keeping all rows as a map\n List<Map<String, Object>> queryData = new ArrayList<>();\n\n // while(resultSet.next()) helps to iterate through columns\n while (resultSet.next()) {\n // key(columns) will be string but value can be any type of data. That's why we choose <String, Object>\n Map<String, Object> row = new HashMap<>(); // creating empty Map\n // number of columns\n int colCount = rsMetadata.getColumnCount();\n // for loop helps to iterate through columns\n for (int i = 1; i <= colCount; i++) {\n row.put(rsMetadata.getColumnName(i), resultSet.getObject(i));\n }\n\n queryData.add(row); // adding a Map to the List of Maps\n }\n\n // Printing the rows\n for (Map<String, Object> row: queryData) {\n System.out.println(row.toString());\n\n }\n\n\n\n\n // close all connections\n resultSet.close();\n statement.close();\n connection.close();\n }", "@Override\n\tpublic DBMetadata getMetadata() {\n\t\treturn null;\n\t}", "public MetaData getMetaData() {\r\n \treturn metaData;\r\n }", "@Override\n public SystemMetadata mapRow(ResultSet resultSet, int rowNumber) throws SQLException {\n\n // resultSet contains guid, serialVersion, date_modified, and archived column data\n SystemMetadata systemMetadata = new SystemMetadata();\n ReplicationPolicy replPolicy = new ReplicationPolicy();\n AccessPolicy accessPolicy = new AccessPolicy();\n\n // add guid\n Identifier pid = new Identifier();\n pid.setValue(resultSet.getString(\"guid\"));\n systemMetadata.setIdentifier(pid);\n \n // add seriesId\n Identifier seriesId = new Identifier();\n seriesId.setValue(resultSet.getString(\"series_id\"));\n systemMetadata.setSeriesId(seriesId);\n\n // add serialVersion\n BigInteger serialVersion = new BigInteger(resultSet.getString(\"serial_version\"));\n systemMetadata.setSerialVersion(serialVersion);\n\n // add date_modified\n Date dateSystemMetadataLastModified = resultSet.getTimestamp(\"date_modified\");\n systemMetadata.setDateSysMetadataModified(dateSystemMetadataLastModified);\n\n // add archived value, if it was stored\n boolean archived = resultSet.getBoolean(\"archived\"); // getBoolean returns false for null results\n if (!resultSet.wasNull())\n systemMetadata.setArchived(new Boolean(archived));\n\n // add date_uploaded\n Date dateUploaded = resultSet.getTimestamp(\"date_uploaded\");\n systemMetadata.setDateUploaded(dateUploaded);\n\n // add rights_holder\n Subject rightsHolderSubject = new Subject();\n String rightsHolder = resultSet.getString(\"rights_holder\");\n rightsHolderSubject.setValue(rightsHolder);\n systemMetadata.setRightsHolder(rightsHolderSubject);\n\n // add checksum, checksum_algorithm\n String checksum = resultSet.getString(\"checksum\");\n String checksumAlgorithm = resultSet.getString(\"checksum_algorithm\");\n Checksum checksumObject = new Checksum();\n checksumObject.setValue(checksum);\n checksumObject.setAlgorithm(checksumAlgorithm);\n systemMetadata.setChecksum(checksumObject);\n\n // add origin_member_node\n String originMemberNode = resultSet.getString(\"origin_member_node\");\n if (originMemberNode != null) {\n NodeReference omn = new NodeReference();\n omn.setValue(originMemberNode);\n systemMetadata.setOriginMemberNode(omn);\n }\n\n // add authoritive_member_node\n String authoritativeMemberNode = resultSet.getString(\"authoritive_member_node\");\n if (originMemberNode != null) {\n NodeReference amn = new NodeReference();\n amn.setValue(authoritativeMemberNode);\n systemMetadata.setAuthoritativeMemberNode(amn);\n }\n\n // add submitter\n String submitter = resultSet.getString(\"submitter\");\n if (submitter != null) {\n Subject submitterSubject = new Subject();\n submitterSubject.setValue(submitter);\n systemMetadata.setSubmitter(submitterSubject);\n }\n\n // add object_format\n String fmtidStr = resultSet.getString(\"object_format\");\n ObjectFormatIdentifier fmtid = new ObjectFormatIdentifier();\n fmtid.setValue(fmtidStr);\n systemMetadata.setFormatId(fmtid);\n\n // add size\n String size = resultSet.getString(\"size\");\n systemMetadata.setSize(new BigInteger(size));\n\n // add obsoletes\n String obsoletes = resultSet.getString(\"obsoletes\");\n if (obsoletes != null) {\n Identifier obsoletesId = new Identifier();\n obsoletesId.setValue(obsoletes);\n systemMetadata.setObsoletes(obsoletesId);\n }\n // add obsoleted_by\n String obsoletedBy = resultSet.getString(\"obsoleted_by\");\n if (obsoletedBy != null) {\n Identifier obsoletedById = new Identifier();\n obsoletedById.setValue(obsoletedBy);\n systemMetadata.setObsoletedBy(obsoletedById);\n }\n\n // potentially build a ReplicationPolicy\n \n // add replication_allowed, if it was persisted\n boolean replAllowed = resultSet.getBoolean(\"replication_allowed\"); // getBoolean returns false for null results\n \n if (!resultSet.wasNull()) {\n // populate and add ReplicationPolicy\n ReplicationPolicy replicationPolicy = new ReplicationPolicy();\n \n replicationPolicy.setReplicationAllowed(new Boolean(replAllowed));\n\n // add number_replicas\n int numberOfReplicas = resultSet.getInt(\"number_replicas\"); // getInt returns 0 for null values\n if (numberOfReplicas > 0) {\n replicationPolicy.setNumberReplicas(new Integer(numberOfReplicas));\n\n }\n\n // add preferred and blocked lists\n List<ReplicationPolicyEntry> replPolicies = new ArrayList<ReplicationPolicyEntry>();\n List<NodeReference> preferredNodes = new ArrayList<NodeReference>();\n List<NodeReference> blockedNodes = new ArrayList<NodeReference>();\n\n replPolicies = listReplicationPolicies(pid, localTableMap);\n\n for (ReplicationPolicyEntry policy : replPolicies) {\n Identifier id = policy.getPid();\n String entryPolicy = policy.getPolicy();\n NodeReference node = policy.getMemberNode();\n\n if (entryPolicy.equals(\"preferred\")) {\n preferredNodes.add(node);\n\n } else if (entryPolicy.equals(\"blocked\")) {\n blockedNodes.add(node);\n\n }\n }\n\n replicationPolicy.setPreferredMemberNodeList(preferredNodes);\n replicationPolicy.setBlockedMemberNodeList(blockedNodes);\n\n systemMetadata.setReplicationPolicy(replicationPolicy);\n } else {\n systemMetadata.setReplicationPolicy(null);\n }\n\n // populate and add replicas list\n\n List<Replica> replicas = new ArrayList<Replica>();\n replicas = listReplicaEntries(pid, localTableMap);\n systemMetadata.setReplicaList(replicas);\n\n // populate and add AccessPolicy\n List<AccessRule> accessRules = new ArrayList<AccessRule>();\n accessRules = listAccessRules(pid, localTableMap);\n accessPolicy.setAllowList(accessRules);\n systemMetadata.setAccessPolicy(accessPolicy);\n\n // Validate the system metadata in debug mode using TypeMarshaller\n if (log.isDebugEnabled()) {\n try {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n TypeMarshaller.marshalTypeToOutputStream(systemMetadata, baos);\n log.debug(\"SystemMetadata for pid \" + pid.getValue() + \" is: \"\n + baos.toString());\n\n } catch (MarshallingException e) {\n e.printStackTrace();\n\n } catch (IOException e) {\n e.printStackTrace();\n\n }\n }\n return systemMetadata;\n }", "public MetaData getMetaData() {\n return metaData;\n }", "public ResultSetMetaData getMetaData() throws SQLException\n {\n return m_rs.getMetaData();\n }", "public ShowTableMetadataResponse showTableMetadata(ShowTableMetadataRequest request) throws GPUdbException {\n ShowTableMetadataResponse actualResponse_ = new ShowTableMetadataResponse();\n submitRequest(\"/show/table/metadata\", request, actualResponse_, false);\n return actualResponse_;\n }", "SQLServerResultSetMetaData(SQLServerConnection con, SQLServerResultSet rs) \n {\n traceID = \" SQLServerResultSetMetaData:\" + nextInstanceID();\n this.con = con;\n this.rs =rs;\n assert rs !=null;\n if(logger.isLoggable(java.util.logging.Level.FINE))\n {\n logger.fine(toString() + \" created by (\" + rs.toString() + \")\");\n }\n }", "@Override\n public RavenJObject getMetadata() {\n return metadata;\n }", "@Override\n\tpublic List<Map<String, String>> selectReportInfo(String appId) {\n\t\treturn getSqlMap().queryForList(NAMESPACES + \"queryReportInfo\", appId);\n\t}", "void processMetaData(ResultSet rs) throws SQLException;", "public interface ColumnMetaData {\n\n\t/**\n\t * The uniqueness level of a column data type.\n\t */\n\tenum Uniqueness {\n\t\t/**\n\t\t * No limitations. Multiple instances of a single column meta data type can be attached to a table or even a\n\t\t * single column.\n\t\t */\n\t\tNONE,\n\n\t\t/**\n\t\t * Multiple instances of a single column meta data type can be attached to a table but at most one per column.\n\t\t */\n\t\tCOLUMN,\n\n\t\t/**\n\t\t * At most one instance of the column meta data type can be attached to a table.\n\t\t */\n\t\tTABLE\n\t}\n\n\t/**\n\t * The unique type id of the column meta data.\n\t *\n\t * @return the type id\n\t */\n\tString type();\n\n\t/**\n\t * The uniqueness level of the meta data. Defaults to {@link Uniqueness#NONE} (no restrictions).\n\t *\n\t * @return the uniqueness level\n\t */\n\tdefault Uniqueness uniqueness() {\n\t\treturn Uniqueness.NONE;\n\t}\n\n}", "public HashMap getMetaData() ;", "Metadata getMetaData();", "@Override\n public SystemMetadataStatus mapRow(ResultSet resultSet, int rowNumber) throws SQLException {\n\n // resultSet contains guid, serialVersion, date_modified, and archived column data\n SystemMetadataStatus systemMetadataStatus = new SystemMetadataStatus();\n\n // add guid\n Identifier pid = new Identifier();\n pid.setValue(resultSet.getString(\"guid\"));\n systemMetadataStatus.setPid(pid);\n\n // add serialVersion\n BigInteger serialVersion = new BigInteger(resultSet.getString(\"serial_version\"));\n systemMetadataStatus.setSerialVersion(serialVersion);\n\n // add date_modified\n Date dateSystemMetadataLastModified = resultSet.getTimestamp(\"date_modified\");\n systemMetadataStatus\n .setLastSystemMetadataModificationDate(dateSystemMetadataLastModified);\n\n // add archived\n boolean archived = resultSet.getBoolean(\"archived\"); // getBoolean returns false for null results\n systemMetadataStatus.setDeleted(new Boolean(archived));\n\n return systemMetadataStatus;\n }", "@Override\n public String toString() {\n return \"Report{\" +\n \"reportId=\" + reportId +\n \", reportOpId=\" + reportOp +\n \", date='\" + date + '\\'' +\n \", reportedUserId=\" + reportedUser +\n \", userId=\" + user +\n \", status=\" + status +\n '}';\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}", "CustomReport selectByPrimaryKey(BigDecimal reportId);", "public ResultSetMetaData getMetaData() throws SQLException {\n return currentPreparedStatement.getMetaData();\n }", "public ReportTable(TableView<Report> reportTable) {\n this.reportTable = reportTable;\n }", "public void analizeQueryResultMetaData(ResultSetMetaData rsMetaData, String[] decimalColumns){\n\t\tArrayList<Integer> decimalColumnResultsetIndexes = new ArrayList<Integer>();\n\t\t//if ( decimalColumns==null||decimalColumns.length==0)\n\t\t//\treturn ; \n\t\ttry {\n\t\t\t\n\t\t\t\n\t\t\t//IObjectToStringConverter[] converters = new IObjectToStringConverter[rsMetaData.getColumnCount()] ;\n\t\t\tOuputDataType[] dataTypes = new OuputDataType[rsMetaData.getColumnCount()] ;\n\t\t\tjobContext.put(ExportEngineConstant.COLUMN_CONVERTER_KEY, dataTypes);\n\t\t\tfor ( int i=1 ; i <= rsMetaData.getColumnCount(); i++){\n\t\t\t\tboolean isDecimal = false ; \n\t\t\t\tString nama = rsMetaData.getColumnName(i).toUpperCase();\n\t\t\t\tif ( decimalColumns!=null){\n\t\t\t\t\tfor ( String scn : decimalColumns){\n\t\t\t\t\t\tif ( nama.equalsIgnoreCase(scn)){\n\t\t\t\t\t\t\tdecimalColumnResultsetIndexes.add(i-1);\n\t\t\t\t\t\t\tisDecimal = true ;\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.money; \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\tif( !isDecimal){\n\t\t\t\t\tString tipeCol = rsMetaData.getColumnClassName(i) ;\n\t\t\t\t\tboolean isDate = false ; \n\t\t\t\t\tfor ( String scn : DATE_DATA_TYPES){\n\t\t\t\t\t\tif ( tipeCol.equals(scn)){\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.date; \n\t\t\t\t\t\t\tisDate = true ; \n\t\t\t\t\t\t\tbreak ; \n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( !isDate){\n\t\t\t\t\t\tif (String.class.getName().equals(tipeCol)){\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.string;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.commonToString;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfor ( OuputDataType scn : dataTypes ){\n\t\t\t\tSystem.out.println(\"converter : \" + scn);\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"gagal membaca data column unutk membuat converter object array. error message :\" + e.getMessage() , e); \n\t\t}\n\t\t\n\t\t\n\t}", "private static void writeColumnMetaData(JsonGenerator jg, ColumnMetaData mdt) throws JsonGenerationException, IOException {\n\t\tjg.writeStartObject();\n\t\tjg.writeStringField(\"name\", mdt.columnName);\n\t\tjg.writeStringField(\"type\", mdt.columnType);\n\t\tjg.writeEndObject();;\n\t}", "private String metadata() {\n\t\tStringBuilder s = new StringBuilder();\n\t\ts.append(\"#######################################\");\n\t\ts.append(\"\\n# Metadata of query set\");\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Queries\");\n\t\ts.append(\"\\n# \\tTotal: \" + this.num_queries);\n\t\ts.append(\"\\n# \\tPoint: \" + this.num_pt_queries + \" (\" + 100 * ((double) this.num_pt_queries/this.num_queries) +\"%)\");\n\t\ts.append(\"\\n# \\tRange: \" + this.num_range_queries + \" (\" + 100 * ((double) this.num_range_queries/this.num_queries) +\"%)\");\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Operators\");\n\t\ts.append(\"\\n# \\tTotal: \" + (this.num_and_ops + this.num_or_ops) + \" (\" + ((double) (this.num_and_ops + this.num_or_ops)/this.num_queries) +\" per query)\");\n\t\ts.append(\"\\n# \\tAND: \" + this.num_and_ops);\n\t\ts.append(\"\\n# \\tOR: \" + this.num_or_ops);\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Attributes\");\n\t\ts.append(\"\\n# \\tTotal queried: \" + this.num_attributes);\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Bins\");\n\t\ts.append(\"\\n# \\tTotal queried: \" + this.num_bins);\n\t\ts.append(\"\\n# \\tPer query: \" + ((double) this.num_bins/this.num_queries));\n\t\ts.append(\"\\n#######################################\\n\");\n\t\treturn s.toString();\n\t}", "public List<Map<String, Object>> getDatewiseUpdateData(String columnName) {\n\t\tList<Map<String, Object>> reportData = new ArrayList<>();\n\n\t\tswitch (columnName) {\n\t\tcase \"LASTUPDATED\":\n\t\t\treportData = getLastUpdatedReport();\n\t\t\tbreak;\n\t\tcase \"CREATEDON\":\n\t\t\treportData = getCreatedOnReport();\n\t\t\tbreak;\n\t\tcase \"READON\":\n\t\t\treportData = getReadOnReport();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tSystem.out.println(\"Invalid column name\");\n\t\t}\n\t\treturn reportData;\n\t}", "public Map<String, Object> getMetaData() {\n\t\treturn metaData;\n\t}", "public MetadataArtifactDownloadReport getReport() {\n return report;\n }", "public Map<String, ColumnMetaData> getColumns();", "public abstract String metadata(String property);", "@Override\n\tpublic IColumns createColumns() {\n\t\treturn new WaybillforauditColumns();\n\t}", "public AlterTableMetadataResponse alterTableMetadata(AlterTableMetadataRequest request) throws GPUdbException {\n AlterTableMetadataResponse actualResponse_ = new AlterTableMetadataResponse();\n submitRequest(\"/alter/table/metadata\", request, actualResponse_, false);\n return actualResponse_;\n }", "@Schema(description = \"`status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Binary general-info: The input information used to assemble the report that can be on-going, periodic and actual and projected \")\n public Object getAssessmentInstanceReportRecord() {\n return assessmentInstanceReportRecord;\n }", "Map<String, Object> getAllMetadata();", "@SuppressWarnings(\"all\")\npublic interface I_I_BankDataJP \n{\n\n /** TableName=I_BankDataJP */\n public static final String Table_Name = \"I_BankDataJP\";\n\n /** AD_Table_ID=1000307 */\n public static final int Table_ID = MTable.getTable_ID(Table_Name);\n\n KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);\n\n /** AccessLevel = 3 - Client - Org \n */\n BigDecimal accessLevel = BigDecimal.valueOf(3);\n\n /** Load Meta Data */\n\n /** Column name AD_Client_ID */\n public static final String COLUMNNAME_AD_Client_ID = \"AD_Client_ID\";\n\n\t/** Get Tenant.\n\t * Tenant for this installation.\n\t */\n\tpublic int getAD_Client_ID();\n\n /** Column name AD_OrgTrx_ID */\n public static final String COLUMNNAME_AD_OrgTrx_ID = \"AD_OrgTrx_ID\";\n\n\t/** Set Trx Organization.\n\t * Performing or initiating organization\n\t */\n\tpublic void setAD_OrgTrx_ID (int AD_OrgTrx_ID);\n\n\t/** Get Trx Organization.\n\t * Performing or initiating organization\n\t */\n\tpublic int getAD_OrgTrx_ID();\n\n /** Column name AD_Org_ID */\n public static final String COLUMNNAME_AD_Org_ID = \"AD_Org_ID\";\n\n\t/** Set Organization.\n\t * Organizational entity within tenant\n\t */\n\tpublic void setAD_Org_ID (int AD_Org_ID);\n\n\t/** Get Organization.\n\t * Organizational entity within tenant\n\t */\n\tpublic int getAD_Org_ID();\n\n /** Column name AccountNo */\n public static final String COLUMNNAME_AccountNo = \"AccountNo\";\n\n\t/** Set Account No.\n\t * Account Number\n\t */\n\tpublic void setAccountNo (String AccountNo);\n\n\t/** Get Account No.\n\t * Account Number\n\t */\n\tpublic String getAccountNo();\n\n /** Column name BankAccountType */\n public static final String COLUMNNAME_BankAccountType = \"BankAccountType\";\n\n\t/** Set Bank Account Type.\n\t * Bank Account Type\n\t */\n\tpublic void setBankAccountType (String BankAccountType);\n\n\t/** Get Bank Account Type.\n\t * Bank Account Type\n\t */\n\tpublic String getBankAccountType();\n\n /** Column name C_BankAccount_ID */\n public static final String COLUMNNAME_C_BankAccount_ID = \"C_BankAccount_ID\";\n\n\t/** Set Bank Account.\n\t * Account at the Bank\n\t */\n\tpublic void setC_BankAccount_ID (int C_BankAccount_ID);\n\n\t/** Get Bank Account.\n\t * Account at the Bank\n\t */\n\tpublic int getC_BankAccount_ID();\n\n\tpublic org.compiere.model.I_C_BankAccount getC_BankAccount() throws RuntimeException;\n\n /** Column name C_Bank_ID */\n public static final String COLUMNNAME_C_Bank_ID = \"C_Bank_ID\";\n\n\t/** Set Bank.\n\t * Bank\n\t */\n\tpublic void setC_Bank_ID (int C_Bank_ID);\n\n\t/** Get Bank.\n\t * Bank\n\t */\n\tpublic int getC_Bank_ID();\n\n\tpublic org.compiere.model.I_C_Bank getC_Bank() throws RuntimeException;\n\n /** Column name Created */\n public static final String COLUMNNAME_Created = \"Created\";\n\n\t/** Get Created.\n\t * Date this record was created\n\t */\n\tpublic Timestamp getCreated();\n\n /** Column name CreatedBy */\n public static final String COLUMNNAME_CreatedBy = \"CreatedBy\";\n\n\t/** Get Created By.\n\t * User who created this records\n\t */\n\tpublic int getCreatedBy();\n\n /** Column name DateAcct */\n public static final String COLUMNNAME_DateAcct = \"DateAcct\";\n\n\t/** Set Account Date.\n\t * Accounting Date\n\t */\n\tpublic void setDateAcct (Timestamp DateAcct);\n\n\t/** Get Account Date.\n\t * Accounting Date\n\t */\n\tpublic Timestamp getDateAcct();\n\n /** Column name I_BankDataJP_ID */\n public static final String COLUMNNAME_I_BankDataJP_ID = \"I_BankDataJP_ID\";\n\n\t/** Set I_BankDataJP.\n\t * JPIERE-0595:JPBP\n\t */\n\tpublic void setI_BankDataJP_ID (int I_BankDataJP_ID);\n\n\t/** Get I_BankDataJP.\n\t * JPIERE-0595:JPBP\n\t */\n\tpublic int getI_BankDataJP_ID();\n\n /** Column name I_BankDataJP_UU */\n public static final String COLUMNNAME_I_BankDataJP_UU = \"I_BankDataJP_UU\";\n\n\t/** Set I_BankDataJP_UU\t */\n\tpublic void setI_BankDataJP_UU (String I_BankDataJP_UU);\n\n\t/** Get I_BankDataJP_UU\t */\n\tpublic String getI_BankDataJP_UU();\n\n /** Column name I_ErrorMsg */\n public static final String COLUMNNAME_I_ErrorMsg = \"I_ErrorMsg\";\n\n\t/** Set Import Error Message.\n\t * Messages generated from import process\n\t */\n\tpublic void setI_ErrorMsg (String I_ErrorMsg);\n\n\t/** Get Import Error Message.\n\t * Messages generated from import process\n\t */\n\tpublic String getI_ErrorMsg();\n\n /** Column name I_IsImported */\n public static final String COLUMNNAME_I_IsImported = \"I_IsImported\";\n\n\t/** Set Imported.\n\t * Has this import been processed\n\t */\n\tpublic void setI_IsImported (boolean I_IsImported);\n\n\t/** Get Imported.\n\t * Has this import been processed\n\t */\n\tpublic boolean isI_IsImported();\n\n /** Column name IsActive */\n public static final String COLUMNNAME_IsActive = \"IsActive\";\n\n\t/** Set Active.\n\t * The record is active in the system\n\t */\n\tpublic void setIsActive (boolean IsActive);\n\n\t/** Get Active.\n\t * The record is active in the system\n\t */\n\tpublic boolean isActive();\n\n /** Column name JP_A_Name */\n public static final String COLUMNNAME_JP_A_Name = \"JP_A_Name\";\n\n\t/** Set Account Name\t */\n\tpublic void setJP_A_Name (String JP_A_Name);\n\n\t/** Get Account Name\t */\n\tpublic String getJP_A_Name();\n\n /** Column name JP_A_Name_Kana */\n public static final String COLUMNNAME_JP_A_Name_Kana = \"JP_A_Name_Kana\";\n\n\t/** Set Account Name(Kana)\t */\n\tpublic void setJP_A_Name_Kana (String JP_A_Name_Kana);\n\n\t/** Get Account Name(Kana)\t */\n\tpublic String getJP_A_Name_Kana();\n\n /** Column name JP_AcctDate */\n public static final String COLUMNNAME_JP_AcctDate = \"JP_AcctDate\";\n\n\t/** Set Date of Account Date\t */\n\tpublic void setJP_AcctDate (String JP_AcctDate);\n\n\t/** Get Date of Account Date\t */\n\tpublic String getJP_AcctDate();\n\n /** Column name JP_AcctMonth */\n public static final String COLUMNNAME_JP_AcctMonth = \"JP_AcctMonth\";\n\n\t/** Set Month of Account Date\t */\n\tpublic void setJP_AcctMonth (String JP_AcctMonth);\n\n\t/** Get Month of Account Date\t */\n\tpublic String getJP_AcctMonth();\n\n /** Column name JP_BankAccountType */\n public static final String COLUMNNAME_JP_BankAccountType = \"JP_BankAccountType\";\n\n\t/** Set Bank Account Type\t */\n\tpublic void setJP_BankAccountType (String JP_BankAccountType);\n\n\t/** Get Bank Account Type\t */\n\tpublic String getJP_BankAccountType();\n\n /** Column name JP_BankAccount_Value */\n public static final String COLUMNNAME_JP_BankAccount_Value = \"JP_BankAccount_Value\";\n\n\t/** Set Bank Account(Search Key)\t */\n\tpublic void setJP_BankAccount_Value (String JP_BankAccount_Value);\n\n\t/** Get Bank Account(Search Key)\t */\n\tpublic String getJP_BankAccount_Value();\n\n /** Column name JP_BankDataCustomerCode1 */\n public static final String COLUMNNAME_JP_BankDataCustomerCode1 = \"JP_BankDataCustomerCode1\";\n\n\t/** Set Bank Data Customer Code1\t */\n\tpublic void setJP_BankDataCustomerCode1 (String JP_BankDataCustomerCode1);\n\n\t/** Get Bank Data Customer Code1\t */\n\tpublic String getJP_BankDataCustomerCode1();\n\n /** Column name JP_BankDataCustomerCode2 */\n public static final String COLUMNNAME_JP_BankDataCustomerCode2 = \"JP_BankDataCustomerCode2\";\n\n\t/** Set Bank Data Customer Code2\t */\n\tpublic void setJP_BankDataCustomerCode2 (String JP_BankDataCustomerCode2);\n\n\t/** Get Bank Data Customer Code2\t */\n\tpublic String getJP_BankDataCustomerCode2();\n\n /** Column name JP_BankDataLine_ID */\n public static final String COLUMNNAME_JP_BankDataLine_ID = \"JP_BankDataLine_ID\";\n\n\t/** Set Import Bank Data Line\t */\n\tpublic void setJP_BankDataLine_ID (int JP_BankDataLine_ID);\n\n\t/** Get Import Bank Data Line\t */\n\tpublic int getJP_BankDataLine_ID();\n\n\tpublic I_JP_BankDataLine getJP_BankDataLine() throws RuntimeException;\n\n /** Column name JP_BankData_EDI_Info */\n public static final String COLUMNNAME_JP_BankData_EDI_Info = \"JP_BankData_EDI_Info\";\n\n\t/** Set BankData EDI Info\t */\n\tpublic void setJP_BankData_EDI_Info (String JP_BankData_EDI_Info);\n\n\t/** Get BankData EDI Info\t */\n\tpublic String getJP_BankData_EDI_Info();\n\n /** Column name JP_BankData_ID */\n public static final String COLUMNNAME_JP_BankData_ID = \"JP_BankData_ID\";\n\n\t/** Set Import Bank Data\t */\n\tpublic void setJP_BankData_ID (int JP_BankData_ID);\n\n\t/** Get Import Bank Data\t */\n\tpublic int getJP_BankData_ID();\n\n\tpublic I_JP_BankData getJP_BankData() throws RuntimeException;\n\n /** Column name JP_BankData_ReferenceNo */\n public static final String COLUMNNAME_JP_BankData_ReferenceNo = \"JP_BankData_ReferenceNo\";\n\n\t/** Set Bank Data ReferenceNo\t */\n\tpublic void setJP_BankData_ReferenceNo (String JP_BankData_ReferenceNo);\n\n\t/** Get Bank Data ReferenceNo\t */\n\tpublic String getJP_BankData_ReferenceNo();\n\n /** Column name JP_BankName_Kana */\n public static final String COLUMNNAME_JP_BankName_Kana = \"JP_BankName_Kana\";\n\n\t/** Set Bank Name(Kana)\t */\n\tpublic void setJP_BankName_Kana (String JP_BankName_Kana);\n\n\t/** Get Bank Name(Kana)\t */\n\tpublic String getJP_BankName_Kana();\n\n /** Column name JP_BankName_Kana_Line */\n public static final String COLUMNNAME_JP_BankName_Kana_Line = \"JP_BankName_Kana_Line\";\n\n\t/** Set Bank Name(Kana) Line\t */\n\tpublic void setJP_BankName_Kana_Line (String JP_BankName_Kana_Line);\n\n\t/** Get Bank Name(Kana) Line\t */\n\tpublic String getJP_BankName_Kana_Line();\n\n /** Column name JP_Bank_Name */\n public static final String COLUMNNAME_JP_Bank_Name = \"JP_Bank_Name\";\n\n\t/** Set Bank Name\t */\n\tpublic void setJP_Bank_Name (String JP_Bank_Name);\n\n\t/** Get Bank Name\t */\n\tpublic String getJP_Bank_Name();\n\n /** Column name JP_BranchCode */\n public static final String COLUMNNAME_JP_BranchCode = \"JP_BranchCode\";\n\n\t/** Set Branch Code\t */\n\tpublic void setJP_BranchCode (String JP_BranchCode);\n\n\t/** Get Branch Code\t */\n\tpublic String getJP_BranchCode();\n\n /** Column name JP_BranchName */\n public static final String COLUMNNAME_JP_BranchName = \"JP_BranchName\";\n\n\t/** Set Branch Name\t */\n\tpublic void setJP_BranchName (String JP_BranchName);\n\n\t/** Get Branch Name\t */\n\tpublic String getJP_BranchName();\n\n /** Column name JP_BranchName_Kana */\n public static final String COLUMNNAME_JP_BranchName_Kana = \"JP_BranchName_Kana\";\n\n\t/** Set Branch Name(Kana)\t */\n\tpublic void setJP_BranchName_Kana (String JP_BranchName_Kana);\n\n\t/** Get Branch Name(Kana)\t */\n\tpublic String getJP_BranchName_Kana();\n\n /** Column name JP_BranchName_Kana_Line */\n public static final String COLUMNNAME_JP_BranchName_Kana_Line = \"JP_BranchName_Kana_Line\";\n\n\t/** Set Branch Name(Kana) Line\t */\n\tpublic void setJP_BranchName_Kana_Line (String JP_BranchName_Kana_Line);\n\n\t/** Get Branch Name(Kana) Line\t */\n\tpublic String getJP_BranchName_Kana_Line();\n\n /** Column name JP_Date */\n public static final String COLUMNNAME_JP_Date = \"JP_Date\";\n\n\t/** Set Date.\n\t * Date\n\t */\n\tpublic void setJP_Date (String JP_Date);\n\n\t/** Get Date.\n\t * Date\n\t */\n\tpublic String getJP_Date();\n\n /** Column name JP_Line_Description */\n public static final String COLUMNNAME_JP_Line_Description = \"JP_Line_Description\";\n\n\t/** Set Line Description\t */\n\tpublic void setJP_Line_Description (String JP_Line_Description);\n\n\t/** Get Line Description\t */\n\tpublic String getJP_Line_Description();\n\n /** Column name JP_Month */\n public static final String COLUMNNAME_JP_Month = \"JP_Month\";\n\n\t/** Set Month\t */\n\tpublic void setJP_Month (String JP_Month);\n\n\t/** Get Month\t */\n\tpublic String getJP_Month();\n\n /** Column name JP_OrgTrx_Value */\n public static final String COLUMNNAME_JP_OrgTrx_Value = \"JP_OrgTrx_Value\";\n\n\t/** Set Trx Organization(Search Key)\t */\n\tpublic void setJP_OrgTrx_Value (String JP_OrgTrx_Value);\n\n\t/** Get Trx Organization(Search Key)\t */\n\tpublic String getJP_OrgTrx_Value();\n\n /** Column name JP_Org_Value */\n public static final String COLUMNNAME_JP_Org_Value = \"JP_Org_Value\";\n\n\t/** Set Organization(Search Key)\t */\n\tpublic void setJP_Org_Value (String JP_Org_Value);\n\n\t/** Get Organization(Search Key)\t */\n\tpublic String getJP_Org_Value();\n\n /** Column name JP_RequesterName */\n public static final String COLUMNNAME_JP_RequesterName = \"JP_RequesterName\";\n\n\t/** Set Requester Name\t */\n\tpublic void setJP_RequesterName (String JP_RequesterName);\n\n\t/** Get Requester Name\t */\n\tpublic String getJP_RequesterName();\n\n /** Column name JP_SalesRep_EMail */\n public static final String COLUMNNAME_JP_SalesRep_EMail = \"JP_SalesRep_EMail\";\n\n\t/** Set Sales Rep(E-Mail)\t */\n\tpublic void setJP_SalesRep_EMail (String JP_SalesRep_EMail);\n\n\t/** Get Sales Rep(E-Mail)\t */\n\tpublic String getJP_SalesRep_EMail();\n\n /** Column name JP_SalesRep_Name */\n public static final String COLUMNNAME_JP_SalesRep_Name = \"JP_SalesRep_Name\";\n\n\t/** Set Sales Rep(Name)\t */\n\tpublic void setJP_SalesRep_Name (String JP_SalesRep_Name);\n\n\t/** Get Sales Rep(Name)\t */\n\tpublic String getJP_SalesRep_Name();\n\n /** Column name JP_SalesRep_Value */\n public static final String COLUMNNAME_JP_SalesRep_Value = \"JP_SalesRep_Value\";\n\n\t/** Set Sales Rep(Search Key)\t */\n\tpublic void setJP_SalesRep_Value (String JP_SalesRep_Value);\n\n\t/** Get Sales Rep(Search Key)\t */\n\tpublic String getJP_SalesRep_Value();\n\n /** Column name Processed */\n public static final String COLUMNNAME_Processed = \"Processed\";\n\n\t/** Set Processed.\n\t * The document has been processed\n\t */\n\tpublic void setProcessed (boolean Processed);\n\n\t/** Get Processed.\n\t * The document has been processed\n\t */\n\tpublic boolean isProcessed();\n\n /** Column name Processing */\n public static final String COLUMNNAME_Processing = \"Processing\";\n\n\t/** Set Process Now\t */\n\tpublic void setProcessing (boolean Processing);\n\n\t/** Get Process Now\t */\n\tpublic boolean isProcessing();\n\n /** Column name RoutingNo */\n public static final String COLUMNNAME_RoutingNo = \"RoutingNo\";\n\n\t/** Set Routing No.\n\t * Bank Routing Number\n\t */\n\tpublic void setRoutingNo (String RoutingNo);\n\n\t/** Get Routing No.\n\t * Bank Routing Number\n\t */\n\tpublic String getRoutingNo();\n\n /** Column name SalesRep_ID */\n public static final String COLUMNNAME_SalesRep_ID = \"SalesRep_ID\";\n\n\t/** Set Sales Rep.\n\t * Sales Representative or Company Agent\n\t */\n\tpublic void setSalesRep_ID (int SalesRep_ID);\n\n\t/** Get Sales Rep.\n\t * Sales Representative or Company Agent\n\t */\n\tpublic int getSalesRep_ID();\n\n\tpublic org.compiere.model.I_AD_User getSalesRep() throws RuntimeException;\n\n /** Column name StatementDate */\n public static final String COLUMNNAME_StatementDate = \"StatementDate\";\n\n\t/** Set Statement date.\n\t * Date of the statement\n\t */\n\tpublic void setStatementDate (Timestamp StatementDate);\n\n\t/** Get Statement date.\n\t * Date of the statement\n\t */\n\tpublic Timestamp getStatementDate();\n\n /** Column name StmtAmt */\n public static final String COLUMNNAME_StmtAmt = \"StmtAmt\";\n\n\t/** Set Statement amount.\n\t * Statement Amount\n\t */\n\tpublic void setStmtAmt (BigDecimal StmtAmt);\n\n\t/** Get Statement amount.\n\t * Statement Amount\n\t */\n\tpublic BigDecimal getStmtAmt();\n\n /** Column name TrxAmt */\n public static final String COLUMNNAME_TrxAmt = \"TrxAmt\";\n\n\t/** Set Transaction Amount.\n\t * Amount of a transaction\n\t */\n\tpublic void setTrxAmt (BigDecimal TrxAmt);\n\n\t/** Get Transaction Amount.\n\t * Amount of a transaction\n\t */\n\tpublic BigDecimal getTrxAmt();\n\n /** Column name Updated */\n public static final String COLUMNNAME_Updated = \"Updated\";\n\n\t/** Get Updated.\n\t * Date this record was updated\n\t */\n\tpublic Timestamp getUpdated();\n\n /** Column name UpdatedBy */\n public static final String COLUMNNAME_UpdatedBy = \"UpdatedBy\";\n\n\t/** Get Updated By.\n\t * User who updated this records\n\t */\n\tpublic int getUpdatedBy();\n}", "public Long getReportId() {\n return reportId;\n }", "@Schema(description = \"`status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Binary general-info: The external report in any suitable form including selection filters where appropriate \")\n public Object getAssessmentInstanceReport() {\n return assessmentInstanceReport;\n }", "public static JasperReportBuilder generateReport(ExportData metaData,HttpServletRequest request){\n session = request.getSession(false);\n report = report(); // Creer le rapport\n \n //Logo\n// logoImg = cmp.image(inImg).setStyle(DynamicReports.stl.style().setHorizontalAlignment(HorizontalAlignment.LEFT)); \n //logoImg.setDimension(80,80); \n \n //Definit le style des colonnes d'entàte\n report.setColumnTitleStyle(getHeaderStyle(metaData));\n \n \n \n LinkedHashMap <String,String> criteria = metaData.getCriteria(); \n //Ajout la date d'àdition au critere d'impression\n String valDateProperty = getDateTxt(metaData.getLang()) ;\n String keyDateProperty = \"\" ;\n if ( session.getAttribute(\"activedLocale\").equals(\"fr\") ) {\n keyDateProperty = \"Edité le \" ;\n }\n else {\n keyDateProperty = \"Printed on \" ;\n }\n criteria.put(keyDateProperty,valDateProperty);\n \n StyleBuilder titleStyle = stl.style(boldStyle).setFontSize(16).setForegroundColor(new Color(0, 0, 0)).setHorizontalAlignment(HorizontalAlignment.RIGHT).setRightIndent(20);\n ComponentBuilder<?, ?> logoComponent = cmp.horizontalList(\n //cmp.image(Templates.class.getResource(\"/logopalm.png\")).setFixedDimension(150, 50).setStyle(stl.style().setLeftIndent(20)),\n cmp.verticalList(\n cmp.text(metaData.getTitle()).setStyle(titleStyle)\n )\n ).newRow()\n .add(cmp.horizontalList().add(cmp.hListCell(createCriteriaComponent(criteria,metaData)).heightFixedOnTop()))\n .newRow(); \n \n report.noData(logoComponent, cmp.text(\"Aucun enregistrement trouvà\").setStyle(stl.style().setHorizontalAlignment(HorizontalAlignment.CENTER).setTopPadding(30)));\n\n \n \n lblStyle = stl.style(Templates.columnStyle).setForegroundColor(new Color(60, 91, 31)); // Couleur du text \n colStyle = stl.style(Templates.columnStyle).setHorizontalAlignment(HorizontalAlignment.CENTER);\n \n groupStyle = stl.style().setForegroundColor(new Color(60, 91, 31)) \n .setBold(Boolean.TRUE)\n .setPadding(5)\n .setFontSize(13)\n .setHorizontalAlignment(HorizontalAlignment.CENTER); \n \n\n \n if(metaData.getTitle().equals(ITitle.PARCEL)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PARCEL_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SECTOR)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SECTOR_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BLOCK)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BLOCK_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ATTACK_PHYTO)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TREATMENT)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TREATMENT_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVEST)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVEST_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SERVICING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SERVICING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_PLANTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_PLANTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.FERTILIZATION)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.FERTILIZATION_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.CONTROL_PHYTO)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.CONTROL_PHYTO_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_FOLDING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_FOLDING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.MORTALITY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.MORTALITY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVESTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVESTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BUDGET)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.REPLACEMENT)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.REPLACEMENT_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.METEOROLOGY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.METEOROLOGY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_MATERIAL)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_MATERIAL_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLUVIOMETRY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLUVIOMETRY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ETP)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ETP_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HYGROMETRY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HYGROMETRY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TEMPERATURE)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TEMPERATURE_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.INSULATION)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.INSULATION_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.WORK)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.WORK_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }\n \n \n drColumns = new HashMap<String, TextColumnBuilder>(); \n groups = new ArrayList<String>();\n subtotals = new ArrayList<String>();\n \n //Definit la liste des colonnes du rapport\n ExportGenerator.getColumns(metaData); \n //Definit la liste des sous-totaux du rapport\n ExportGenerator.getSubTotals(metaData);\n \n \n //Genration des sous totaux\n for (String group : groups) {\n ColumnGroupBuilder group2 = grp.group(drColumns.get(group));\n report.groupBy(group2);\n for (String subtotal : subtotals) {\n report.subtotalsAtGroupFooter(group2,sbt.sum(drColumns.get(subtotal)));\n }\n }\n\n for (String subtotal : subtotals) {\n report.subtotalsAtSummary(sbt.sum(drColumns.get(subtotal))); \n }\n \n /*if(ExportGenerator.getColumnByNameField(\"plantingName\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL \"), ExportGenerator.getColumnByNameField(\"plantingName\"), Calculation.NOTHING));\n }*//*else if(ExportGenerator.getColumnByNameField(\"invoiceCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"invoiceCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"planterCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL\"), ExportGenerator.getColumnByNameField(\"planterCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"transportTicket\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"transportTicket\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"deliveryDate\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"deliveryDate\"), Calculation.NOTHING));\n }\n else if(ExportGenerator.getColumnByNameField(\"arroundPlantingTicketNumber\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"arroundPlantingTicketNumber\"), Calculation.NOTHING));\n }\n else if(ExportGenerator.getColumnByNameField(\"planterNumber\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"planterNumber\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"startPaymentDate\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"startPaymentDate\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"sectorCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"sectorCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"month\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL \"), ExportGenerator.getColumnByNameField(\"month\"), Calculation.NOTHING));\n }*/\n \n\n \n \n //Genere la source de donnàes du rapport\n report.setDataSource(metaData.getData());\n \n report.highlightDetailEvenRows(); \n \n \n // Definition de l'entete : valable uniquement pour la 1ere page\n HorizontalListBuilder hlb= null;\n \n hlb = cmp.horizontalList().add(\n cmp.hListCell(createCriteriaComponent(criteria,metaData)).heightFixedOnTop()\n );\n\n \n report.title(\n createCustomTitleComponent(metaData.getTitle()), // Titre\n hlb,// Liste Horizontal des Critàres \n cmp.verticalGap(12) // Marge de 12 px entre chaque critàre\n ); \n \n \n \n report.setPageMargin(DynamicReports.margin().setLeft(15).setTop(30).setRight(15).setBottom(30));\n report.setPageFormat(PageType.A3, PageOrientation.LANDSCAPE);\n report.pageFooter(DynamicReports.cmp.pageXslashY());\n return report;\n \n }", "public interface IReportDao extends IBaseDao<Report, Integer> {\n\t\n\t/**\n\t * 添加举报信息\n\t * @param report\n\t */\n\tpublic boolean addReport(Report report);\n\t\n\t/**\n\t * 修改举报信息\n\t * @param report\n\t * @return\n\t */\n\tpublic boolean updateReport(Report report);\n\t\n//\t/**\n//\t * 是否已经举报\n//\t * @param getReportGto\n//\t * @return\n//\t */\n//\tpublic boolean isHouseInfoReported(GetReportGto getReportGto);\n\t\n\t/**\n\t * 获取我与某条房源的举报信息\n\t * @param getReportGto\n\t * @return\n\t */\n\tpublic List<Report> getMyReport(GetReportGto getReportGto);\n}", "public interface TableDetailMapper {\n\n @Select(\"select * from dxh_sys.tabledetail where vendorId=0 and tableName='skuProfitDayReport'\")\n List<Map<String, Object>> list();\n\n}", "public Report getReport();", "BoltResultSetMetaData(List<Type> types, List<String> keys) {\n\t\tsuper(keys);\n\t\tthis.columnType = types.toArray(new Type[this.keys.size() + 1]);\n\n\t\t// we init columnType with the first record\n\t\t// in case first == last record\n\t\t/*for (int i = 1; i <= this.keys.size(); i++) {\n\t\t\tcolumnType[i] = this.getColumnDriverTypeOrDefault(i, InternalTypeSystem.TYPE_SYSTEM.STRING());\n\t\t}*/\n\t}", "@Override\r\n\tpublic Map<String, Object> getMetadata() {\n\t\treturn null;\r\n\t}", "@Select({\n \"select\",\n \"JNLNO, TRANDATE, ACCOUNTDATE, CHECKTYPE, STATUS, DONETIME, FILENAME\",\n \"from B_UMB_CHECKING_LOG\",\n \"where JNLNO = #{jnlno,jdbcType=VARCHAR}\"\n })\n @Results({\n @Result(column=\"JNLNO\", property=\"jnlno\", jdbcType=JdbcType.VARCHAR, id=true),\n @Result(column=\"TRANDATE\", property=\"trandate\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"ACCOUNTDATE\", property=\"accountdate\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"CHECKTYPE\", property=\"checktype\", jdbcType=JdbcType.CHAR),\n @Result(column=\"STATUS\", property=\"status\", jdbcType=JdbcType.CHAR),\n @Result(column=\"DONETIME\", property=\"donetime\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"FILENAME\", property=\"filename\", jdbcType=JdbcType.VARCHAR)\n })\n BUMBCheckingLog selectByPrimaryKey(BUMBCheckingLogKey key);", "@SqlQuery(\"select * from PLAYERSTATS\")\n List<PlayerStats> getAll();", "protected String getMetadataName() {\r\n\t\treturn METADATA_NAME;\r\n\t}", "public abstract String getSummaryForDatabase();", "private interface ReportColumnCallback\n {\n void handleReportColumn(DashboardReport report, String columnName) throws MojoExecutionException;\n }", "public ReportMetadataExample() {\n\t\toredCriteria = new ArrayList<Criteria>();\n\t}", "@Override\r\n \tpublic MetaData getMetaData(HttpHeaders headers) {\n \t\ttry {\r\n \t\t\treturn MetaDataUtil.getMetaData(new ViewListeEleve(), new HashMap<String, MetaData>(),new ArrayList<String>());\r\n \t\t} catch (Exception e) {\r\n \t\t\t// TODO Auto-generated catch block\r\n \t\t\tthrow new WebApplicationException(Response.serverError().entity(new String(\"MetaData parse error\")).build());\r\n \t\t} \r\n \t}", "public DefaultMetaData getMetaData() {\n\t\treturn this.metaData;\n\t}", "@Override\n public Map<String, String> createFieldToPropertyMapping() {\n final Map<String, String> mapping = super.createFieldToPropertyMapping();\n mapping.put(this.tableName + \".rsres_id\", \"id\");\n mapping.put(this.tableName + \".resource_id\", \"resourceId\");\n mapping.put(this.tableName + \".quantity\", QUANTITY);\n mapping.put(this.tableName + \".cost_rsres\", \"cost\");\n\n return mapping;\n }", "Report createReport();", "public String getMetaDataFileName() {\n return null;\n }", "public JDBCRawSqlQueryMetaData(Method method) {\n this.method = method;\n }", "public String getReportsToBeGenerated(String reportType) {\r\n\t\tString query = \"\";\r\n\t\t\r\n\t\ttry (Connection connection = DatabaseConnection.getMySQLConnection();\r\n\t\t\t PreparedStatement stmt = connection.prepareStatement(query);) {\r\n\t\t\tResultSet result = stmt.executeQuery();\r\n\t\t\tStringJoiner reports = new StringJoiner(\",,\");\r\n\t\t\twhile (result.next()) {\r\n\t\t\t\treports.add(result.getString(\"REPORT_NAME\"));\r\n\t\t\t}\r\n\t\t\treturn reports.toString();\r\n\t\t} catch (SQLException e) {\r\n\t\t\tthrow new ReportGenerationException(\"An error occurred while retrieving reports to be generated.\", e);\r\n\t\t}\r\n\t}", "public Map getMetadata() {\n return metadata;\n }", "public DatabaseMetaData(Statement s) {\n\t\t_stmt = s; // SQL-Connection\n\t\t_buffer = new StringBuffer(); // Output goes here\n\t\t_tables = new ArrayList<String>(); // List of tables\n\t\t\n\t\ttry {\n\t\t\t// Put table names in `_tables`\n\t\t\textractTableNames(_stmt.executeQuery(composeTableNamesQuery()));\n\n\t\t\t// fetch the string representation of each tables meta-data\n\t\t\tfor (String name : _tables)\n\t\t\t\t_buffer.append(new TableMeta(name)); \n\t\t} catch (SQLException e) { _error = true;}\n\t}", "private Builder() {\n super(net.explorys.samhat.z12.r837.X837Ins_2320_MOA_MedicareOutpatientAdjudicationInformation.SCHEMA$);\n }", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "public String toString() {\n return \"[JDBCRawSqlQueryMetaData : method=\" + method + \"]\";\n }", "Report selectByPrimaryKey(Integer id);", "java.lang.String getMetadata(int index);", "java.lang.String getMetadata(int index);", "public Integer getReportId() {\n return reportId;\n }", "@Schema(description = \"`status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Code general-info: The type of external report available \")\n public String getAssessmentInstanceReportType() {\n return assessmentInstanceReportType;\n }", "private static Map<String, ColumnMetaData> buildColumnMetadataMap(ResultSet rs) {\n\t\t/*\n\t\t * LinkedHashmap to preserve key traversal order.\n\t\t * Important as we output rows as arrays of values where the index position in\n\t\t * the row implicitly corresponds to the entry order of the column map.\n\t\t * Reason for this is performance. \n\t\t */\n\t\tMap<String, ColumnMetaData> columnMap = Maps.newLinkedHashMap();\n\t\ttry {\n\t\t\tResultSetMetaData rmd = rs.getMetaData();\n\t\t\tfor (int i=1; i<= rmd.getColumnCount(); i++) {\n\t\t\t\tColumnMetaData cmd = \n\t\t\t\t\tnew ColumnMetaData(rmd.getColumnName(i), rmd.getColumnTypeName(i));\n\t\t\t\tcolumnMap.put(cmd.columnName, cmd);\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\tThrowables.propagate(e);\n\t\t}\n\t\treturn columnMap;\n\t}", "@Override\r\n\tpublic List<ReportAndSummary> findAll() {\n\t\tList<ReportAndSummary> result = reportAndSummaryDao.findAll();\r\n\t\treturn result;\r\n\t}", "protected String getSqlTable() {\n\t\treturn \"Project\";\n\t}", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "public interface I_IHC_JobDataChange \n{\n\n /** TableName=IHC_JobDataChange */\n public static final String Table_Name = \"IHC_JobDataChange\";\n\n /** AD_Table_ID=1100135 */\n public static final int Table_ID = MTable.getTable_ID(Table_Name);\n\n KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);\n\n /** AccessLevel = 3 - Client - Org \n */\n BigDecimal accessLevel = BigDecimal.valueOf(3);\n\n /** Load Meta Data */\n\n /** Column name AD_Client_ID */\n public static final String COLUMNNAME_AD_Client_ID = \"AD_Client_ID\";\n\n\t/** Get Client.\n\t * Client/Tenant for this installation.\n\t */\n\tpublic int getAD_Client_ID();\n\n /** Column name AD_Org_ID */\n public static final String COLUMNNAME_AD_Org_ID = \"AD_Org_ID\";\n\n\t/** Set Organization.\n\t * Organizational entity within client\n\t */\n\tpublic void setAD_Org_ID (int AD_Org_ID);\n\n\t/** Get Organization.\n\t * Organizational entity within client\n\t */\n\tpublic int getAD_Org_ID();\n\n /** Column name BPJSRegistrationDate */\n public static final String COLUMNNAME_BPJSRegistrationDate = \"BPJSRegistrationDate\";\n\n\t/** Set BPJS Registration Date\t */\n\tpublic void setBPJSRegistrationDate (Timestamp BPJSRegistrationDate);\n\n\t/** Get BPJS Registration Date\t */\n\tpublic Timestamp getBPJSRegistrationDate();\n\n /** Column name Created */\n public static final String COLUMNNAME_Created = \"Created\";\n\n\t/** Get Created.\n\t * Date this record was created\n\t */\n\tpublic Timestamp getCreated();\n\n /** Column name CreatedBy */\n public static final String COLUMNNAME_CreatedBy = \"CreatedBy\";\n\n\t/** Get Created By.\n\t * User who created this records\n\t */\n\tpublic int getCreatedBy();\n\n /** Column name Description */\n public static final String COLUMNNAME_Description = \"Description\";\n\n\t/** Set Description.\n\t * Optional short description of the record\n\t */\n\tpublic void setDescription (String Description);\n\n\t/** Get Description.\n\t * Optional short description of the record\n\t */\n\tpublic String getDescription();\n\n /** Column name DescriptionNew */\n public static final String COLUMNNAME_DescriptionNew = \"DescriptionNew\";\n\n\t/** Set Description New\t */\n\tpublic void setDescriptionNew (String DescriptionNew);\n\n\t/** Get Description New\t */\n\tpublic String getDescriptionNew();\n\n /** Column name HC_Compensation1 */\n public static final String COLUMNNAME_HC_Compensation1 = \"HC_Compensation1\";\n\n\t/** Set Compensation 1\t */\n\tpublic void setHC_Compensation1 (BigDecimal HC_Compensation1);\n\n\t/** Get Compensation 1\t */\n\tpublic BigDecimal getHC_Compensation1();\n\n /** Column name HC_Compensation2 */\n public static final String COLUMNNAME_HC_Compensation2 = \"HC_Compensation2\";\n\n\t/** Set Compensation 2\t */\n\tpublic void setHC_Compensation2 (BigDecimal HC_Compensation2);\n\n\t/** Get Compensation 2\t */\n\tpublic BigDecimal getHC_Compensation2();\n\n /** Column name HC_Compensation3 */\n public static final String COLUMNNAME_HC_Compensation3 = \"HC_Compensation3\";\n\n\t/** Set Compensation 3\t */\n\tpublic void setHC_Compensation3 (BigDecimal HC_Compensation3);\n\n\t/** Get Compensation 3\t */\n\tpublic BigDecimal getHC_Compensation3();\n\n /** Column name HC_Compensation4 */\n public static final String COLUMNNAME_HC_Compensation4 = \"HC_Compensation4\";\n\n\t/** Set Compensation 4\t */\n\tpublic void setHC_Compensation4 (BigDecimal HC_Compensation4);\n\n\t/** Get Compensation 4\t */\n\tpublic BigDecimal getHC_Compensation4();\n\n /** Column name HC_EffectiveSeq */\n public static final String COLUMNNAME_HC_EffectiveSeq = \"HC_EffectiveSeq\";\n\n\t/** Set Effective Sequence\t */\n\tpublic void setHC_EffectiveSeq (int HC_EffectiveSeq);\n\n\t/** Get Effective Sequence\t */\n\tpublic int getHC_EffectiveSeq();\n\n /** Column name HC_Employee_ID */\n public static final String COLUMNNAME_HC_Employee_ID = \"HC_Employee_ID\";\n\n\t/** Set Employee Data\t */\n\tpublic void setHC_Employee_ID (int HC_Employee_ID);\n\n\t/** Get Employee Data\t */\n\tpublic int getHC_Employee_ID();\n\n\tpublic I_HC_Employee getHC_Employee() throws RuntimeException;\n\n /** Column name HC_EmployeeGrade_ID */\n public static final String COLUMNNAME_HC_EmployeeGrade_ID = \"HC_EmployeeGrade_ID\";\n\n\t/** Set Employee Grade\t */\n\tpublic void setHC_EmployeeGrade_ID (int HC_EmployeeGrade_ID);\n\n\t/** Get Employee Grade\t */\n\tpublic int getHC_EmployeeGrade_ID();\n\n\tpublic I_HC_EmployeeGrade getHC_EmployeeGrade() throws RuntimeException;\n\n /** Column name HC_EmployeeGrade2_ID */\n public static final String COLUMNNAME_HC_EmployeeGrade2_ID = \"HC_EmployeeGrade2_ID\";\n\n\t/** Set Employee Grade To\t */\n\tpublic void setHC_EmployeeGrade2_ID (int HC_EmployeeGrade2_ID);\n\n\t/** Get Employee Grade To\t */\n\tpublic int getHC_EmployeeGrade2_ID();\n\n\tpublic I_HC_EmployeeGrade getHC_EmployeeGrade2() throws RuntimeException;\n\n /** Column name HC_EmployeeJob_ID */\n public static final String COLUMNNAME_HC_EmployeeJob_ID = \"HC_EmployeeJob_ID\";\n\n\t/** Set Employee Job Data\t */\n\tpublic void setHC_EmployeeJob_ID (int HC_EmployeeJob_ID);\n\n\t/** Get Employee Job Data\t */\n\tpublic int getHC_EmployeeJob_ID();\n\n\tpublic I_HC_EmployeeJob getHC_EmployeeJob() throws RuntimeException;\n\n /** Column name HC_Job_ID */\n public static final String COLUMNNAME_HC_Job_ID = \"HC_Job_ID\";\n\n\t/** Set Job\t */\n\tpublic void setHC_Job_ID (int HC_Job_ID);\n\n\t/** Get Job\t */\n\tpublic int getHC_Job_ID();\n\n\tpublic I_HC_Job getHC_Job() throws RuntimeException;\n\n /** Column name HC_JobAction */\n public static final String COLUMNNAME_HC_JobAction = \"HC_JobAction\";\n\n\t/** Set Job Action\t */\n\tpublic void setHC_JobAction (String HC_JobAction);\n\n\t/** Get Job Action\t */\n\tpublic String getHC_JobAction();\n\n /** Column name HC_JobDataChange_ID */\n public static final String COLUMNNAME_HC_JobDataChange_ID = \"HC_JobDataChange_ID\";\n\n\t/** Set Job Data Change\t */\n\tpublic void setHC_JobDataChange_ID (int HC_JobDataChange_ID);\n\n\t/** Get Job Data Change\t */\n\tpublic int getHC_JobDataChange_ID();\n\n\tpublic I_HC_JobDataChange getHC_JobDataChange() throws RuntimeException;\n\n /** Column name HC_Manager_ID */\n public static final String COLUMNNAME_HC_Manager_ID = \"HC_Manager_ID\";\n\n\t/** Set Manager Name\t */\n\tpublic void setHC_Manager_ID (int HC_Manager_ID);\n\n\t/** Get Manager Name\t */\n\tpublic int getHC_Manager_ID();\n\n\tpublic I_HC_Employee getHC_Manager() throws RuntimeException;\n\n /** Column name HC_ManagerTo_ID */\n public static final String COLUMNNAME_HC_ManagerTo_ID = \"HC_ManagerTo_ID\";\n\n\t/** Set Manager To ID\t */\n\tpublic void setHC_ManagerTo_ID (int HC_ManagerTo_ID);\n\n\t/** Get Manager To ID\t */\n\tpublic int getHC_ManagerTo_ID();\n\n\tpublic I_HC_Employee getHC_ManagerTo() throws RuntimeException;\n\n /** Column name HC_Org_ID */\n public static final String COLUMNNAME_HC_Org_ID = \"HC_Org_ID\";\n\n\t/** Set HC Organization\t */\n\tpublic void setHC_Org_ID (int HC_Org_ID);\n\n\t/** Get HC Organization\t */\n\tpublic int getHC_Org_ID();\n\n\tpublic I_HC_Org getHC_Org() throws RuntimeException;\n\n /** Column name HC_Org2_ID */\n public static final String COLUMNNAME_HC_Org2_ID = \"HC_Org2_ID\";\n\n\t/** Set HC Organization To\t */\n\tpublic void setHC_Org2_ID (int HC_Org2_ID);\n\n\t/** Get HC Organization To\t */\n\tpublic int getHC_Org2_ID();\n\n\tpublic I_HC_Org getHC_Org2() throws RuntimeException;\n\n /** Column name HC_PayGroup_ID */\n public static final String COLUMNNAME_HC_PayGroup_ID = \"HC_PayGroup_ID\";\n\n\t/** Set Payroll Group\t */\n\tpublic void setHC_PayGroup_ID (int HC_PayGroup_ID);\n\n\t/** Get Payroll Group\t */\n\tpublic int getHC_PayGroup_ID();\n\n\tpublic I_HC_PayGroup getHC_PayGroup() throws RuntimeException;\n\n /** Column name HC_PreviousJob_ID */\n public static final String COLUMNNAME_HC_PreviousJob_ID = \"HC_PreviousJob_ID\";\n\n\t/** Set Job Sekarang\t */\n\tpublic void setHC_PreviousJob_ID (int HC_PreviousJob_ID);\n\n\t/** Get Job Sekarang\t */\n\tpublic int getHC_PreviousJob_ID();\n\n\tpublic I_HC_Job getHC_PreviousJob() throws RuntimeException;\n\n /** Column name HC_Reason_ID */\n public static final String COLUMNNAME_HC_Reason_ID = \"HC_Reason_ID\";\n\n\t/** Set HC Reason\t */\n\tpublic void setHC_Reason_ID (int HC_Reason_ID);\n\n\t/** Get HC Reason\t */\n\tpublic int getHC_Reason_ID();\n\n\tpublic I_HC_Reason getHC_Reason() throws RuntimeException;\n\n /** Column name HC_Status */\n public static final String COLUMNNAME_HC_Status = \"HC_Status\";\n\n\t/** Set HC Status\t */\n\tpublic void setHC_Status (String HC_Status);\n\n\t/** Get HC Status\t */\n\tpublic String getHC_Status();\n\n /** Column name HC_WorkEndDate */\n public static final String COLUMNNAME_HC_WorkEndDate = \"HC_WorkEndDate\";\n\n\t/** Set Work End Date\t */\n\tpublic void setHC_WorkEndDate (Timestamp HC_WorkEndDate);\n\n\t/** Get Work End Date\t */\n\tpublic Timestamp getHC_WorkEndDate();\n\n /** Column name HC_WorkPeriodDate */\n public static final String COLUMNNAME_HC_WorkPeriodDate = \"HC_WorkPeriodDate\";\n\n\t/** Set WorkPeriodDate\t */\n\tpublic void setHC_WorkPeriodDate (String HC_WorkPeriodDate);\n\n\t/** Get WorkPeriodDate\t */\n\tpublic String getHC_WorkPeriodDate();\n\n /** Column name HC_WorkStartDate */\n public static final String COLUMNNAME_HC_WorkStartDate = \"HC_WorkStartDate\";\n\n\t/** Set WorkStartDate\t */\n\tpublic void setHC_WorkStartDate (Timestamp HC_WorkStartDate);\n\n\t/** Get WorkStartDate\t */\n\tpublic Timestamp getHC_WorkStartDate();\n\n /** Column name HC_WorkStartDate2 */\n public static final String COLUMNNAME_HC_WorkStartDate2 = \"HC_WorkStartDate2\";\n\n\t/** Set Work Start Date Baru\t */\n\tpublic void setHC_WorkStartDate2 (Timestamp HC_WorkStartDate2);\n\n\t/** Get Work Start Date Baru\t */\n\tpublic Timestamp getHC_WorkStartDate2();\n\n /** Column name IHC_JobDataChange_ID */\n public static final String COLUMNNAME_IHC_JobDataChange_ID = \"IHC_JobDataChange_ID\";\n\n\t/** Set IHC_JobDayaChange\t */\n\tpublic void setIHC_JobDataChange_ID (int IHC_JobDataChange_ID);\n\n\t/** Get IHC_JobDayaChange\t */\n\tpublic int getIHC_JobDataChange_ID();\n\n /** Column name IHC_JobDataChange_UU */\n public static final String COLUMNNAME_IHC_JobDataChange_UU = \"IHC_JobDataChange_UU\";\n\n\t/** Set IHC_JobDataChange_UU\t */\n\tpublic void setIHC_JobDataChange_UU (String IHC_JobDataChange_UU);\n\n\t/** Get IHC_JobDataChange_UU\t */\n\tpublic String getIHC_JobDataChange_UU();\n\n /** Column name IsActive */\n public static final String COLUMNNAME_IsActive = \"IsActive\";\n\n\t/** Set Active.\n\t * The record is active in the system\n\t */\n\tpublic void setIsActive (boolean IsActive);\n\n\t/** Get Active.\n\t * The record is active in the system\n\t */\n\tpublic boolean isActive();\n\n /** Column name IsCancelled */\n public static final String COLUMNNAME_IsCancelled = \"IsCancelled\";\n\n\t/** Set Cancelled.\n\t * The transaction was cancelled\n\t */\n\tpublic void setIsCancelled (boolean IsCancelled);\n\n\t/** Get Cancelled.\n\t * The transaction was cancelled\n\t */\n\tpublic boolean isCancelled();\n\n /** Column name NomorSK */\n public static final String COLUMNNAME_NomorSK = \"NomorSK\";\n\n\t/** Set Nomor SK\t */\n\tpublic void setNomorSK (String NomorSK);\n\n\t/** Get Nomor SK\t */\n\tpublic String getNomorSK();\n\n /** Column name NomorSK2 */\n public static final String COLUMNNAME_NomorSK2 = \"NomorSK2\";\n\n\t/** Set Nomor SK Baru\t */\n\tpublic void setNomorSK2 (String NomorSK2);\n\n\t/** Get Nomor SK Baru\t */\n\tpublic String getNomorSK2();\n\n /** Column name OriginalServiceData */\n public static final String COLUMNNAME_OriginalServiceData = \"OriginalServiceData\";\n\n\t/** Set Original Service Date\t */\n\tpublic void setOriginalServiceData (Timestamp OriginalServiceData);\n\n\t/** Get Original Service Date\t */\n\tpublic Timestamp getOriginalServiceData();\n\n /** Column name Processed */\n public static final String COLUMNNAME_Processed = \"Processed\";\n\n\t/** Set Processed.\n\t * The document has been processed\n\t */\n\tpublic void setProcessed (boolean Processed);\n\n\t/** Get Processed.\n\t * The document has been processed\n\t */\n\tpublic boolean isProcessed();\n\n /** Column name SeqNo */\n public static final String COLUMNNAME_SeqNo = \"SeqNo\";\n\n\t/** Set Sequence.\n\t * Method of ordering records;\n lowest number comes first\n\t */\n\tpublic void setSeqNo (int SeqNo);\n\n\t/** Get Sequence.\n\t * Method of ordering records;\n lowest number comes first\n\t */\n\tpublic int getSeqNo();\n\n /** Column name Updated */\n public static final String COLUMNNAME_Updated = \"Updated\";\n\n\t/** Get Updated.\n\t * Date this record was updated\n\t */\n\tpublic Timestamp getUpdated();\n\n /** Column name UpdatedBy */\n public static final String COLUMNNAME_UpdatedBy = \"UpdatedBy\";\n\n\t/** Get Updated By.\n\t * User who updated this records\n\t */\n\tpublic int getUpdatedBy();\n}" ]
[ "0.7202898", "0.60632956", "0.58984065", "0.58183134", "0.5817594", "0.56543213", "0.5574047", "0.5565886", "0.5524865", "0.55226165", "0.5423179", "0.5421737", "0.5379457", "0.5348147", "0.5343479", "0.5319976", "0.5241551", "0.5238874", "0.5229574", "0.5133239", "0.5122431", "0.51177025", "0.51117975", "0.50930023", "0.50780755", "0.50722116", "0.50675434", "0.50449616", "0.50247383", "0.5010279", "0.5003492", "0.49746117", "0.49696276", "0.49307886", "0.49275762", "0.4912492", "0.49052197", "0.48956972", "0.4885308", "0.488236", "0.48762375", "0.48499364", "0.48376077", "0.48360834", "0.48132738", "0.48091698", "0.4798098", "0.47974053", "0.4796658", "0.4792996", "0.47886494", "0.47818476", "0.47707915", "0.47644812", "0.47628173", "0.47527128", "0.47466338", "0.474518", "0.4744774", "0.47409937", "0.47307655", "0.47233862", "0.4722756", "0.4717715", "0.47149938", "0.47131443", "0.47092754", "0.47054762", "0.4705152", "0.47009587", "0.46984246", "0.4680089", "0.46766418", "0.46766418", "0.46766418", "0.46766418", "0.46766418", "0.46676517", "0.4664517", "0.46610156", "0.46610156", "0.46514818", "0.46382514", "0.4636637", "0.46333814", "0.46316957", "0.46309724", "0.46309724", "0.46309724", "0.46309724", "0.46309724", "0.46309724", "0.46309724", "0.46309724", "0.46309724", "0.46309724", "0.46309724", "0.46309724", "0.46309724", "0.46309724", "0.46286348" ]
0.0
-1
This method was generated by MyBatis Generator. This method corresponds to the database table core.report_metadata
public boolean isDistinct() { return distinct; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "TableReportMetadata getReportMetadata(String reportId);", "public abstract List<ColumnSpecification> metadata();", "@Override\r\n\t\tpublic DatabaseMetaData getMetaData() throws SQLException {\n\t\t\treturn null;\r\n\t\t}", "@Override\n\tpublic JDBCMetaData getMetaData() throws SQLException {\n\t\treturn null;\n\t}", "private void writeMetaData(ResultSet resultSet) throws SQLException {\n\t System.out.println(\"The columns in the table are: \");\r\n\t System.out.println(\"Table: \" + resultSet.getMetaData().getTableName(1));\r\n\t for (int i = 1; i<= resultSet.getMetaData().getColumnCount(); i++){\r\n\t System.out.println(\"Column \" +i + \" \"+ resultSet.getMetaData().getColumnName(i));\r\n\t }\r\n\t }", "public interface TableMetaData {\n\n\t/** Adds normal column. */\n\tpublic void addColumn(final ColumnMetaData column);\n\n\t/** Adds primary key column. */\n\tpublic void addPrimaryKey(final ColumnMetaData column);\n\n\t/** Returns map of column meta data, keyed by the column label (the alias if provided in the query, otherwise the name). */\n\tpublic Map<String, ColumnMetaData> getColumns();\n\n\t/** Returns database name. */\n\tpublic String getDatabaseName();\n\n\t/** Returns ordered list of columns that are primary keys. */\n\tpublic List<ColumnMetaData> getPrimaryKeys();\n\n\t/**\n\t * Returns fully qualified table name in database-specific form for use in SQL statements. MySQL uses the form\n\t * <code>database.table</code>, for example <code>sakila.film</code>. PostgreSQL uses the form\n\t * <code>database.schema.table</code>, for example <code>sakila.public.film</code>.\n\t */\n\tpublic String getQualifiedTableName();\n\n\t/** Returns row alias. */\n\tpublic String getRowAlias();\n\t\n\t/** Returns row set alias. */\n\tpublic String getRowSetAlias();\n\t\n\t/**\n\t * Returns row alias.\n\t * \n * @deprecated As of 0.8.11 use {@link #getRowAlias()}\n\t */\n\t@Deprecated\n\tpublic String getTableAlias();\n\n\t/** Returns table name. */\n\tpublic String getTableName();\n\n\t/** Returns role of table in the SQL Resource. */\n\tpublic TableRole getTableRole();\n\n\t/** Returns true if the SQL Resource role is child. */\n\tpublic boolean isChild();\n\n\t/** Returns true if the SQL Resource role is parent. */\n\tpublic boolean isParent();\n\n\t/** Sets all the row and row set aliases. */\n\tpublic void setAliases(final String alias, final String rowAlias, final String rowSetAlias);\n\n\t/** Sets attributes. */\n\tpublic void setAttributes(final String tableName, final String qualifedTableName,\n\t\t\tfinal String databaseName, final TableRole tableRole);\n\n\t/**\n\t * Sets table alias.\n\t * \n * @deprecated As of 0.8.11 use {@link #setAliases(String, String, String)}\n\t */\n\t@Deprecated\n\tpublic void setTableAlias(final String tableAlias);\n\t\n\t/** Represents all of the roles a table may plan in a SQL Resource. */\n\t@XmlType(namespace = \"http://restsql.org/schema\")\n\tpublic enum TableRole {\n\t\tChild, ChildExtension, Join, Parent, ParentExtension, Unknown;\n\t}\n}", "public abstract List<String> newReportColumns();", "ResultSetMetaData getMetaData() throws SQLException;", "public DBMetaDataSet getMetaData()\n\t{\n\t\treturn _MetaData;\n\t}", "public interface SqlResourceMetaData {\r\n\r\n\tpublic List<ColumnMetaData> getAllReadColumns();\r\n\r\n\tpublic TableMetaData getChild();\r\n\r\n\tpublic List<TableMetaData> getChildPlusExtTables();\r\n\r\n\tpublic List<ColumnMetaData> getChildReadColumns();\r\n\r\n\tpublic TableMetaData getJoin();\r\n\r\n\tpublic List<TableMetaData> getJoinList();\r\n\r\n\tpublic int getNumberTables();\r\n\r\n\tpublic TableMetaData getParent();\r\n\r\n\tpublic List<TableMetaData> getParentPlusExtTables();\r\n\r\n\tpublic List<ColumnMetaData> getParentReadColumns();\r\n\r\n\tpublic Map<String, TableMetaData> getTableMap();\r\n\r\n\tpublic List<TableMetaData> getTables();\r\n\r\n\tpublic List<TableMetaData> getWriteTables(final Type requestType, final boolean doParent);\r\n\r\n\tpublic boolean hasJoinTable();\r\n\r\n\tpublic boolean hasMultipleDatabases();\r\n\r\n\tpublic boolean isHierarchical();\r\n\r\n\tpublic void init(final String sqlResourceName, final SqlResourceDefinition definition, final SqlBuilder sqlBuilder)\r\n\t\t\tthrows SqlResourceException;\r\n\r\n\tpublic String toHtml();\r\n\r\n\tpublic String toXml();\r\n}", "public void addColumnPathReportId() {\n addColumnInPath(ColumnMetaData.KEY_PATH_ID);\n }", "public ResultSetMetaData getMetaData() throws SQLException {\n\n try {\n int id = getNextId(TraceObject.RESULT_SET_META_DATA);\n if (isDebugEnabled()) {\n debugCodeAssign(\"ResultSetMetaData\", TraceObject.RESULT_SET_META_DATA, id, \"getMetaData()\");\n }\n checkClosed();\n String catalog = conn.getCatalog();\n JdbcResultSetMetaData meta = new JdbcResultSetMetaData(this, null, result, catalog, conn.getSession().getTrace(), id);\n return meta;\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "public MetaData getMetaData();", "@Override\n public DatabaseMetaData getMetaData() throws SQLException\n {\n logger.debug(\n \" public DatabaseMetaData getMetaData() throws SQLException\");\n\n return new SnowflakeDatabaseMetaData(this);\n }", "public DataSetMetaData getMetaData() {\n return this.metadata;\n }", "@Test\n public void metaDataExample1() throws SQLException {\n Connection connection = DriverManager.getConnection(dbUrl, dbUsername, dbPassword);\n // 2. Create statement\n Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);\n // Run sql query and get the result in resultSet object\n String sqlQuery= \"Select * From departments\";\n //String sqlQuery= \"Select first_name, last_name, salary From employees\";\n ResultSet resultSet = statement.executeQuery(sqlQuery);\n\n // we use resultSet metadata to get information about the tables\n // get the resultSet object metadata\n ResultSetMetaData rsMetadata = resultSet.getMetaData();\n\n // List for keeping all rows as a map\n List<Map<String, Object>> queryData = new ArrayList<>();\n\n // while(resultSet.next()) helps to iterate through columns\n while (resultSet.next()) {\n // key(columns) will be string but value can be any type of data. That's why we choose <String, Object>\n Map<String, Object> row = new HashMap<>(); // creating empty Map\n // number of columns\n int colCount = rsMetadata.getColumnCount();\n // for loop helps to iterate through columns\n for (int i = 1; i <= colCount; i++) {\n row.put(rsMetadata.getColumnName(i), resultSet.getObject(i));\n }\n\n queryData.add(row); // adding a Map to the List of Maps\n }\n\n // Printing the rows\n for (Map<String, Object> row: queryData) {\n System.out.println(row.toString());\n\n }\n\n\n\n\n // close all connections\n resultSet.close();\n statement.close();\n connection.close();\n }", "@Override\n\tpublic DBMetadata getMetadata() {\n\t\treturn null;\n\t}", "public MetaData getMetaData() {\r\n \treturn metaData;\r\n }", "@Override\n public SystemMetadata mapRow(ResultSet resultSet, int rowNumber) throws SQLException {\n\n // resultSet contains guid, serialVersion, date_modified, and archived column data\n SystemMetadata systemMetadata = new SystemMetadata();\n ReplicationPolicy replPolicy = new ReplicationPolicy();\n AccessPolicy accessPolicy = new AccessPolicy();\n\n // add guid\n Identifier pid = new Identifier();\n pid.setValue(resultSet.getString(\"guid\"));\n systemMetadata.setIdentifier(pid);\n \n // add seriesId\n Identifier seriesId = new Identifier();\n seriesId.setValue(resultSet.getString(\"series_id\"));\n systemMetadata.setSeriesId(seriesId);\n\n // add serialVersion\n BigInteger serialVersion = new BigInteger(resultSet.getString(\"serial_version\"));\n systemMetadata.setSerialVersion(serialVersion);\n\n // add date_modified\n Date dateSystemMetadataLastModified = resultSet.getTimestamp(\"date_modified\");\n systemMetadata.setDateSysMetadataModified(dateSystemMetadataLastModified);\n\n // add archived value, if it was stored\n boolean archived = resultSet.getBoolean(\"archived\"); // getBoolean returns false for null results\n if (!resultSet.wasNull())\n systemMetadata.setArchived(new Boolean(archived));\n\n // add date_uploaded\n Date dateUploaded = resultSet.getTimestamp(\"date_uploaded\");\n systemMetadata.setDateUploaded(dateUploaded);\n\n // add rights_holder\n Subject rightsHolderSubject = new Subject();\n String rightsHolder = resultSet.getString(\"rights_holder\");\n rightsHolderSubject.setValue(rightsHolder);\n systemMetadata.setRightsHolder(rightsHolderSubject);\n\n // add checksum, checksum_algorithm\n String checksum = resultSet.getString(\"checksum\");\n String checksumAlgorithm = resultSet.getString(\"checksum_algorithm\");\n Checksum checksumObject = new Checksum();\n checksumObject.setValue(checksum);\n checksumObject.setAlgorithm(checksumAlgorithm);\n systemMetadata.setChecksum(checksumObject);\n\n // add origin_member_node\n String originMemberNode = resultSet.getString(\"origin_member_node\");\n if (originMemberNode != null) {\n NodeReference omn = new NodeReference();\n omn.setValue(originMemberNode);\n systemMetadata.setOriginMemberNode(omn);\n }\n\n // add authoritive_member_node\n String authoritativeMemberNode = resultSet.getString(\"authoritive_member_node\");\n if (originMemberNode != null) {\n NodeReference amn = new NodeReference();\n amn.setValue(authoritativeMemberNode);\n systemMetadata.setAuthoritativeMemberNode(amn);\n }\n\n // add submitter\n String submitter = resultSet.getString(\"submitter\");\n if (submitter != null) {\n Subject submitterSubject = new Subject();\n submitterSubject.setValue(submitter);\n systemMetadata.setSubmitter(submitterSubject);\n }\n\n // add object_format\n String fmtidStr = resultSet.getString(\"object_format\");\n ObjectFormatIdentifier fmtid = new ObjectFormatIdentifier();\n fmtid.setValue(fmtidStr);\n systemMetadata.setFormatId(fmtid);\n\n // add size\n String size = resultSet.getString(\"size\");\n systemMetadata.setSize(new BigInteger(size));\n\n // add obsoletes\n String obsoletes = resultSet.getString(\"obsoletes\");\n if (obsoletes != null) {\n Identifier obsoletesId = new Identifier();\n obsoletesId.setValue(obsoletes);\n systemMetadata.setObsoletes(obsoletesId);\n }\n // add obsoleted_by\n String obsoletedBy = resultSet.getString(\"obsoleted_by\");\n if (obsoletedBy != null) {\n Identifier obsoletedById = new Identifier();\n obsoletedById.setValue(obsoletedBy);\n systemMetadata.setObsoletedBy(obsoletedById);\n }\n\n // potentially build a ReplicationPolicy\n \n // add replication_allowed, if it was persisted\n boolean replAllowed = resultSet.getBoolean(\"replication_allowed\"); // getBoolean returns false for null results\n \n if (!resultSet.wasNull()) {\n // populate and add ReplicationPolicy\n ReplicationPolicy replicationPolicy = new ReplicationPolicy();\n \n replicationPolicy.setReplicationAllowed(new Boolean(replAllowed));\n\n // add number_replicas\n int numberOfReplicas = resultSet.getInt(\"number_replicas\"); // getInt returns 0 for null values\n if (numberOfReplicas > 0) {\n replicationPolicy.setNumberReplicas(new Integer(numberOfReplicas));\n\n }\n\n // add preferred and blocked lists\n List<ReplicationPolicyEntry> replPolicies = new ArrayList<ReplicationPolicyEntry>();\n List<NodeReference> preferredNodes = new ArrayList<NodeReference>();\n List<NodeReference> blockedNodes = new ArrayList<NodeReference>();\n\n replPolicies = listReplicationPolicies(pid, localTableMap);\n\n for (ReplicationPolicyEntry policy : replPolicies) {\n Identifier id = policy.getPid();\n String entryPolicy = policy.getPolicy();\n NodeReference node = policy.getMemberNode();\n\n if (entryPolicy.equals(\"preferred\")) {\n preferredNodes.add(node);\n\n } else if (entryPolicy.equals(\"blocked\")) {\n blockedNodes.add(node);\n\n }\n }\n\n replicationPolicy.setPreferredMemberNodeList(preferredNodes);\n replicationPolicy.setBlockedMemberNodeList(blockedNodes);\n\n systemMetadata.setReplicationPolicy(replicationPolicy);\n } else {\n systemMetadata.setReplicationPolicy(null);\n }\n\n // populate and add replicas list\n\n List<Replica> replicas = new ArrayList<Replica>();\n replicas = listReplicaEntries(pid, localTableMap);\n systemMetadata.setReplicaList(replicas);\n\n // populate and add AccessPolicy\n List<AccessRule> accessRules = new ArrayList<AccessRule>();\n accessRules = listAccessRules(pid, localTableMap);\n accessPolicy.setAllowList(accessRules);\n systemMetadata.setAccessPolicy(accessPolicy);\n\n // Validate the system metadata in debug mode using TypeMarshaller\n if (log.isDebugEnabled()) {\n try {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n TypeMarshaller.marshalTypeToOutputStream(systemMetadata, baos);\n log.debug(\"SystemMetadata for pid \" + pid.getValue() + \" is: \"\n + baos.toString());\n\n } catch (MarshallingException e) {\n e.printStackTrace();\n\n } catch (IOException e) {\n e.printStackTrace();\n\n }\n }\n return systemMetadata;\n }", "public MetaData getMetaData() {\n return metaData;\n }", "public ResultSetMetaData getMetaData() throws SQLException\n {\n return m_rs.getMetaData();\n }", "public ShowTableMetadataResponse showTableMetadata(ShowTableMetadataRequest request) throws GPUdbException {\n ShowTableMetadataResponse actualResponse_ = new ShowTableMetadataResponse();\n submitRequest(\"/show/table/metadata\", request, actualResponse_, false);\n return actualResponse_;\n }", "SQLServerResultSetMetaData(SQLServerConnection con, SQLServerResultSet rs) \n {\n traceID = \" SQLServerResultSetMetaData:\" + nextInstanceID();\n this.con = con;\n this.rs =rs;\n assert rs !=null;\n if(logger.isLoggable(java.util.logging.Level.FINE))\n {\n logger.fine(toString() + \" created by (\" + rs.toString() + \")\");\n }\n }", "@Override\n public RavenJObject getMetadata() {\n return metadata;\n }", "@Override\n\tpublic List<Map<String, String>> selectReportInfo(String appId) {\n\t\treturn getSqlMap().queryForList(NAMESPACES + \"queryReportInfo\", appId);\n\t}", "void processMetaData(ResultSet rs) throws SQLException;", "public interface ColumnMetaData {\n\n\t/**\n\t * The uniqueness level of a column data type.\n\t */\n\tenum Uniqueness {\n\t\t/**\n\t\t * No limitations. Multiple instances of a single column meta data type can be attached to a table or even a\n\t\t * single column.\n\t\t */\n\t\tNONE,\n\n\t\t/**\n\t\t * Multiple instances of a single column meta data type can be attached to a table but at most one per column.\n\t\t */\n\t\tCOLUMN,\n\n\t\t/**\n\t\t * At most one instance of the column meta data type can be attached to a table.\n\t\t */\n\t\tTABLE\n\t}\n\n\t/**\n\t * The unique type id of the column meta data.\n\t *\n\t * @return the type id\n\t */\n\tString type();\n\n\t/**\n\t * The uniqueness level of the meta data. Defaults to {@link Uniqueness#NONE} (no restrictions).\n\t *\n\t * @return the uniqueness level\n\t */\n\tdefault Uniqueness uniqueness() {\n\t\treturn Uniqueness.NONE;\n\t}\n\n}", "public HashMap getMetaData() ;", "Metadata getMetaData();", "@Override\n public SystemMetadataStatus mapRow(ResultSet resultSet, int rowNumber) throws SQLException {\n\n // resultSet contains guid, serialVersion, date_modified, and archived column data\n SystemMetadataStatus systemMetadataStatus = new SystemMetadataStatus();\n\n // add guid\n Identifier pid = new Identifier();\n pid.setValue(resultSet.getString(\"guid\"));\n systemMetadataStatus.setPid(pid);\n\n // add serialVersion\n BigInteger serialVersion = new BigInteger(resultSet.getString(\"serial_version\"));\n systemMetadataStatus.setSerialVersion(serialVersion);\n\n // add date_modified\n Date dateSystemMetadataLastModified = resultSet.getTimestamp(\"date_modified\");\n systemMetadataStatus\n .setLastSystemMetadataModificationDate(dateSystemMetadataLastModified);\n\n // add archived\n boolean archived = resultSet.getBoolean(\"archived\"); // getBoolean returns false for null results\n systemMetadataStatus.setDeleted(new Boolean(archived));\n\n return systemMetadataStatus;\n }", "@Override\n public String toString() {\n return \"Report{\" +\n \"reportId=\" + reportId +\n \", reportOpId=\" + reportOp +\n \", date='\" + date + '\\'' +\n \", reportedUserId=\" + reportedUser +\n \", userId=\" + user +\n \", status=\" + status +\n '}';\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}", "CustomReport selectByPrimaryKey(BigDecimal reportId);", "public ResultSetMetaData getMetaData() throws SQLException {\n return currentPreparedStatement.getMetaData();\n }", "public ReportTable(TableView<Report> reportTable) {\n this.reportTable = reportTable;\n }", "public void analizeQueryResultMetaData(ResultSetMetaData rsMetaData, String[] decimalColumns){\n\t\tArrayList<Integer> decimalColumnResultsetIndexes = new ArrayList<Integer>();\n\t\t//if ( decimalColumns==null||decimalColumns.length==0)\n\t\t//\treturn ; \n\t\ttry {\n\t\t\t\n\t\t\t\n\t\t\t//IObjectToStringConverter[] converters = new IObjectToStringConverter[rsMetaData.getColumnCount()] ;\n\t\t\tOuputDataType[] dataTypes = new OuputDataType[rsMetaData.getColumnCount()] ;\n\t\t\tjobContext.put(ExportEngineConstant.COLUMN_CONVERTER_KEY, dataTypes);\n\t\t\tfor ( int i=1 ; i <= rsMetaData.getColumnCount(); i++){\n\t\t\t\tboolean isDecimal = false ; \n\t\t\t\tString nama = rsMetaData.getColumnName(i).toUpperCase();\n\t\t\t\tif ( decimalColumns!=null){\n\t\t\t\t\tfor ( String scn : decimalColumns){\n\t\t\t\t\t\tif ( nama.equalsIgnoreCase(scn)){\n\t\t\t\t\t\t\tdecimalColumnResultsetIndexes.add(i-1);\n\t\t\t\t\t\t\tisDecimal = true ;\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.money; \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\tif( !isDecimal){\n\t\t\t\t\tString tipeCol = rsMetaData.getColumnClassName(i) ;\n\t\t\t\t\tboolean isDate = false ; \n\t\t\t\t\tfor ( String scn : DATE_DATA_TYPES){\n\t\t\t\t\t\tif ( tipeCol.equals(scn)){\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.date; \n\t\t\t\t\t\t\tisDate = true ; \n\t\t\t\t\t\t\tbreak ; \n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( !isDate){\n\t\t\t\t\t\tif (String.class.getName().equals(tipeCol)){\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.string;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.commonToString;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfor ( OuputDataType scn : dataTypes ){\n\t\t\t\tSystem.out.println(\"converter : \" + scn);\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"gagal membaca data column unutk membuat converter object array. error message :\" + e.getMessage() , e); \n\t\t}\n\t\t\n\t\t\n\t}", "private static void writeColumnMetaData(JsonGenerator jg, ColumnMetaData mdt) throws JsonGenerationException, IOException {\n\t\tjg.writeStartObject();\n\t\tjg.writeStringField(\"name\", mdt.columnName);\n\t\tjg.writeStringField(\"type\", mdt.columnType);\n\t\tjg.writeEndObject();;\n\t}", "private String metadata() {\n\t\tStringBuilder s = new StringBuilder();\n\t\ts.append(\"#######################################\");\n\t\ts.append(\"\\n# Metadata of query set\");\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Queries\");\n\t\ts.append(\"\\n# \\tTotal: \" + this.num_queries);\n\t\ts.append(\"\\n# \\tPoint: \" + this.num_pt_queries + \" (\" + 100 * ((double) this.num_pt_queries/this.num_queries) +\"%)\");\n\t\ts.append(\"\\n# \\tRange: \" + this.num_range_queries + \" (\" + 100 * ((double) this.num_range_queries/this.num_queries) +\"%)\");\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Operators\");\n\t\ts.append(\"\\n# \\tTotal: \" + (this.num_and_ops + this.num_or_ops) + \" (\" + ((double) (this.num_and_ops + this.num_or_ops)/this.num_queries) +\" per query)\");\n\t\ts.append(\"\\n# \\tAND: \" + this.num_and_ops);\n\t\ts.append(\"\\n# \\tOR: \" + this.num_or_ops);\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Attributes\");\n\t\ts.append(\"\\n# \\tTotal queried: \" + this.num_attributes);\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Bins\");\n\t\ts.append(\"\\n# \\tTotal queried: \" + this.num_bins);\n\t\ts.append(\"\\n# \\tPer query: \" + ((double) this.num_bins/this.num_queries));\n\t\ts.append(\"\\n#######################################\\n\");\n\t\treturn s.toString();\n\t}", "public List<Map<String, Object>> getDatewiseUpdateData(String columnName) {\n\t\tList<Map<String, Object>> reportData = new ArrayList<>();\n\n\t\tswitch (columnName) {\n\t\tcase \"LASTUPDATED\":\n\t\t\treportData = getLastUpdatedReport();\n\t\t\tbreak;\n\t\tcase \"CREATEDON\":\n\t\t\treportData = getCreatedOnReport();\n\t\t\tbreak;\n\t\tcase \"READON\":\n\t\t\treportData = getReadOnReport();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tSystem.out.println(\"Invalid column name\");\n\t\t}\n\t\treturn reportData;\n\t}", "public Map<String, Object> getMetaData() {\n\t\treturn metaData;\n\t}", "public MetadataArtifactDownloadReport getReport() {\n return report;\n }", "public Map<String, ColumnMetaData> getColumns();", "public abstract String metadata(String property);", "@Override\n\tpublic IColumns createColumns() {\n\t\treturn new WaybillforauditColumns();\n\t}", "@Schema(description = \"`status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Binary general-info: The input information used to assemble the report that can be on-going, periodic and actual and projected \")\n public Object getAssessmentInstanceReportRecord() {\n return assessmentInstanceReportRecord;\n }", "public AlterTableMetadataResponse alterTableMetadata(AlterTableMetadataRequest request) throws GPUdbException {\n AlterTableMetadataResponse actualResponse_ = new AlterTableMetadataResponse();\n submitRequest(\"/alter/table/metadata\", request, actualResponse_, false);\n return actualResponse_;\n }", "public Long getReportId() {\n return reportId;\n }", "@Schema(description = \"`status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Binary general-info: The external report in any suitable form including selection filters where appropriate \")\n public Object getAssessmentInstanceReport() {\n return assessmentInstanceReport;\n }", "@SuppressWarnings(\"all\")\npublic interface I_I_BankDataJP \n{\n\n /** TableName=I_BankDataJP */\n public static final String Table_Name = \"I_BankDataJP\";\n\n /** AD_Table_ID=1000307 */\n public static final int Table_ID = MTable.getTable_ID(Table_Name);\n\n KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);\n\n /** AccessLevel = 3 - Client - Org \n */\n BigDecimal accessLevel = BigDecimal.valueOf(3);\n\n /** Load Meta Data */\n\n /** Column name AD_Client_ID */\n public static final String COLUMNNAME_AD_Client_ID = \"AD_Client_ID\";\n\n\t/** Get Tenant.\n\t * Tenant for this installation.\n\t */\n\tpublic int getAD_Client_ID();\n\n /** Column name AD_OrgTrx_ID */\n public static final String COLUMNNAME_AD_OrgTrx_ID = \"AD_OrgTrx_ID\";\n\n\t/** Set Trx Organization.\n\t * Performing or initiating organization\n\t */\n\tpublic void setAD_OrgTrx_ID (int AD_OrgTrx_ID);\n\n\t/** Get Trx Organization.\n\t * Performing or initiating organization\n\t */\n\tpublic int getAD_OrgTrx_ID();\n\n /** Column name AD_Org_ID */\n public static final String COLUMNNAME_AD_Org_ID = \"AD_Org_ID\";\n\n\t/** Set Organization.\n\t * Organizational entity within tenant\n\t */\n\tpublic void setAD_Org_ID (int AD_Org_ID);\n\n\t/** Get Organization.\n\t * Organizational entity within tenant\n\t */\n\tpublic int getAD_Org_ID();\n\n /** Column name AccountNo */\n public static final String COLUMNNAME_AccountNo = \"AccountNo\";\n\n\t/** Set Account No.\n\t * Account Number\n\t */\n\tpublic void setAccountNo (String AccountNo);\n\n\t/** Get Account No.\n\t * Account Number\n\t */\n\tpublic String getAccountNo();\n\n /** Column name BankAccountType */\n public static final String COLUMNNAME_BankAccountType = \"BankAccountType\";\n\n\t/** Set Bank Account Type.\n\t * Bank Account Type\n\t */\n\tpublic void setBankAccountType (String BankAccountType);\n\n\t/** Get Bank Account Type.\n\t * Bank Account Type\n\t */\n\tpublic String getBankAccountType();\n\n /** Column name C_BankAccount_ID */\n public static final String COLUMNNAME_C_BankAccount_ID = \"C_BankAccount_ID\";\n\n\t/** Set Bank Account.\n\t * Account at the Bank\n\t */\n\tpublic void setC_BankAccount_ID (int C_BankAccount_ID);\n\n\t/** Get Bank Account.\n\t * Account at the Bank\n\t */\n\tpublic int getC_BankAccount_ID();\n\n\tpublic org.compiere.model.I_C_BankAccount getC_BankAccount() throws RuntimeException;\n\n /** Column name C_Bank_ID */\n public static final String COLUMNNAME_C_Bank_ID = \"C_Bank_ID\";\n\n\t/** Set Bank.\n\t * Bank\n\t */\n\tpublic void setC_Bank_ID (int C_Bank_ID);\n\n\t/** Get Bank.\n\t * Bank\n\t */\n\tpublic int getC_Bank_ID();\n\n\tpublic org.compiere.model.I_C_Bank getC_Bank() throws RuntimeException;\n\n /** Column name Created */\n public static final String COLUMNNAME_Created = \"Created\";\n\n\t/** Get Created.\n\t * Date this record was created\n\t */\n\tpublic Timestamp getCreated();\n\n /** Column name CreatedBy */\n public static final String COLUMNNAME_CreatedBy = \"CreatedBy\";\n\n\t/** Get Created By.\n\t * User who created this records\n\t */\n\tpublic int getCreatedBy();\n\n /** Column name DateAcct */\n public static final String COLUMNNAME_DateAcct = \"DateAcct\";\n\n\t/** Set Account Date.\n\t * Accounting Date\n\t */\n\tpublic void setDateAcct (Timestamp DateAcct);\n\n\t/** Get Account Date.\n\t * Accounting Date\n\t */\n\tpublic Timestamp getDateAcct();\n\n /** Column name I_BankDataJP_ID */\n public static final String COLUMNNAME_I_BankDataJP_ID = \"I_BankDataJP_ID\";\n\n\t/** Set I_BankDataJP.\n\t * JPIERE-0595:JPBP\n\t */\n\tpublic void setI_BankDataJP_ID (int I_BankDataJP_ID);\n\n\t/** Get I_BankDataJP.\n\t * JPIERE-0595:JPBP\n\t */\n\tpublic int getI_BankDataJP_ID();\n\n /** Column name I_BankDataJP_UU */\n public static final String COLUMNNAME_I_BankDataJP_UU = \"I_BankDataJP_UU\";\n\n\t/** Set I_BankDataJP_UU\t */\n\tpublic void setI_BankDataJP_UU (String I_BankDataJP_UU);\n\n\t/** Get I_BankDataJP_UU\t */\n\tpublic String getI_BankDataJP_UU();\n\n /** Column name I_ErrorMsg */\n public static final String COLUMNNAME_I_ErrorMsg = \"I_ErrorMsg\";\n\n\t/** Set Import Error Message.\n\t * Messages generated from import process\n\t */\n\tpublic void setI_ErrorMsg (String I_ErrorMsg);\n\n\t/** Get Import Error Message.\n\t * Messages generated from import process\n\t */\n\tpublic String getI_ErrorMsg();\n\n /** Column name I_IsImported */\n public static final String COLUMNNAME_I_IsImported = \"I_IsImported\";\n\n\t/** Set Imported.\n\t * Has this import been processed\n\t */\n\tpublic void setI_IsImported (boolean I_IsImported);\n\n\t/** Get Imported.\n\t * Has this import been processed\n\t */\n\tpublic boolean isI_IsImported();\n\n /** Column name IsActive */\n public static final String COLUMNNAME_IsActive = \"IsActive\";\n\n\t/** Set Active.\n\t * The record is active in the system\n\t */\n\tpublic void setIsActive (boolean IsActive);\n\n\t/** Get Active.\n\t * The record is active in the system\n\t */\n\tpublic boolean isActive();\n\n /** Column name JP_A_Name */\n public static final String COLUMNNAME_JP_A_Name = \"JP_A_Name\";\n\n\t/** Set Account Name\t */\n\tpublic void setJP_A_Name (String JP_A_Name);\n\n\t/** Get Account Name\t */\n\tpublic String getJP_A_Name();\n\n /** Column name JP_A_Name_Kana */\n public static final String COLUMNNAME_JP_A_Name_Kana = \"JP_A_Name_Kana\";\n\n\t/** Set Account Name(Kana)\t */\n\tpublic void setJP_A_Name_Kana (String JP_A_Name_Kana);\n\n\t/** Get Account Name(Kana)\t */\n\tpublic String getJP_A_Name_Kana();\n\n /** Column name JP_AcctDate */\n public static final String COLUMNNAME_JP_AcctDate = \"JP_AcctDate\";\n\n\t/** Set Date of Account Date\t */\n\tpublic void setJP_AcctDate (String JP_AcctDate);\n\n\t/** Get Date of Account Date\t */\n\tpublic String getJP_AcctDate();\n\n /** Column name JP_AcctMonth */\n public static final String COLUMNNAME_JP_AcctMonth = \"JP_AcctMonth\";\n\n\t/** Set Month of Account Date\t */\n\tpublic void setJP_AcctMonth (String JP_AcctMonth);\n\n\t/** Get Month of Account Date\t */\n\tpublic String getJP_AcctMonth();\n\n /** Column name JP_BankAccountType */\n public static final String COLUMNNAME_JP_BankAccountType = \"JP_BankAccountType\";\n\n\t/** Set Bank Account Type\t */\n\tpublic void setJP_BankAccountType (String JP_BankAccountType);\n\n\t/** Get Bank Account Type\t */\n\tpublic String getJP_BankAccountType();\n\n /** Column name JP_BankAccount_Value */\n public static final String COLUMNNAME_JP_BankAccount_Value = \"JP_BankAccount_Value\";\n\n\t/** Set Bank Account(Search Key)\t */\n\tpublic void setJP_BankAccount_Value (String JP_BankAccount_Value);\n\n\t/** Get Bank Account(Search Key)\t */\n\tpublic String getJP_BankAccount_Value();\n\n /** Column name JP_BankDataCustomerCode1 */\n public static final String COLUMNNAME_JP_BankDataCustomerCode1 = \"JP_BankDataCustomerCode1\";\n\n\t/** Set Bank Data Customer Code1\t */\n\tpublic void setJP_BankDataCustomerCode1 (String JP_BankDataCustomerCode1);\n\n\t/** Get Bank Data Customer Code1\t */\n\tpublic String getJP_BankDataCustomerCode1();\n\n /** Column name JP_BankDataCustomerCode2 */\n public static final String COLUMNNAME_JP_BankDataCustomerCode2 = \"JP_BankDataCustomerCode2\";\n\n\t/** Set Bank Data Customer Code2\t */\n\tpublic void setJP_BankDataCustomerCode2 (String JP_BankDataCustomerCode2);\n\n\t/** Get Bank Data Customer Code2\t */\n\tpublic String getJP_BankDataCustomerCode2();\n\n /** Column name JP_BankDataLine_ID */\n public static final String COLUMNNAME_JP_BankDataLine_ID = \"JP_BankDataLine_ID\";\n\n\t/** Set Import Bank Data Line\t */\n\tpublic void setJP_BankDataLine_ID (int JP_BankDataLine_ID);\n\n\t/** Get Import Bank Data Line\t */\n\tpublic int getJP_BankDataLine_ID();\n\n\tpublic I_JP_BankDataLine getJP_BankDataLine() throws RuntimeException;\n\n /** Column name JP_BankData_EDI_Info */\n public static final String COLUMNNAME_JP_BankData_EDI_Info = \"JP_BankData_EDI_Info\";\n\n\t/** Set BankData EDI Info\t */\n\tpublic void setJP_BankData_EDI_Info (String JP_BankData_EDI_Info);\n\n\t/** Get BankData EDI Info\t */\n\tpublic String getJP_BankData_EDI_Info();\n\n /** Column name JP_BankData_ID */\n public static final String COLUMNNAME_JP_BankData_ID = \"JP_BankData_ID\";\n\n\t/** Set Import Bank Data\t */\n\tpublic void setJP_BankData_ID (int JP_BankData_ID);\n\n\t/** Get Import Bank Data\t */\n\tpublic int getJP_BankData_ID();\n\n\tpublic I_JP_BankData getJP_BankData() throws RuntimeException;\n\n /** Column name JP_BankData_ReferenceNo */\n public static final String COLUMNNAME_JP_BankData_ReferenceNo = \"JP_BankData_ReferenceNo\";\n\n\t/** Set Bank Data ReferenceNo\t */\n\tpublic void setJP_BankData_ReferenceNo (String JP_BankData_ReferenceNo);\n\n\t/** Get Bank Data ReferenceNo\t */\n\tpublic String getJP_BankData_ReferenceNo();\n\n /** Column name JP_BankName_Kana */\n public static final String COLUMNNAME_JP_BankName_Kana = \"JP_BankName_Kana\";\n\n\t/** Set Bank Name(Kana)\t */\n\tpublic void setJP_BankName_Kana (String JP_BankName_Kana);\n\n\t/** Get Bank Name(Kana)\t */\n\tpublic String getJP_BankName_Kana();\n\n /** Column name JP_BankName_Kana_Line */\n public static final String COLUMNNAME_JP_BankName_Kana_Line = \"JP_BankName_Kana_Line\";\n\n\t/** Set Bank Name(Kana) Line\t */\n\tpublic void setJP_BankName_Kana_Line (String JP_BankName_Kana_Line);\n\n\t/** Get Bank Name(Kana) Line\t */\n\tpublic String getJP_BankName_Kana_Line();\n\n /** Column name JP_Bank_Name */\n public static final String COLUMNNAME_JP_Bank_Name = \"JP_Bank_Name\";\n\n\t/** Set Bank Name\t */\n\tpublic void setJP_Bank_Name (String JP_Bank_Name);\n\n\t/** Get Bank Name\t */\n\tpublic String getJP_Bank_Name();\n\n /** Column name JP_BranchCode */\n public static final String COLUMNNAME_JP_BranchCode = \"JP_BranchCode\";\n\n\t/** Set Branch Code\t */\n\tpublic void setJP_BranchCode (String JP_BranchCode);\n\n\t/** Get Branch Code\t */\n\tpublic String getJP_BranchCode();\n\n /** Column name JP_BranchName */\n public static final String COLUMNNAME_JP_BranchName = \"JP_BranchName\";\n\n\t/** Set Branch Name\t */\n\tpublic void setJP_BranchName (String JP_BranchName);\n\n\t/** Get Branch Name\t */\n\tpublic String getJP_BranchName();\n\n /** Column name JP_BranchName_Kana */\n public static final String COLUMNNAME_JP_BranchName_Kana = \"JP_BranchName_Kana\";\n\n\t/** Set Branch Name(Kana)\t */\n\tpublic void setJP_BranchName_Kana (String JP_BranchName_Kana);\n\n\t/** Get Branch Name(Kana)\t */\n\tpublic String getJP_BranchName_Kana();\n\n /** Column name JP_BranchName_Kana_Line */\n public static final String COLUMNNAME_JP_BranchName_Kana_Line = \"JP_BranchName_Kana_Line\";\n\n\t/** Set Branch Name(Kana) Line\t */\n\tpublic void setJP_BranchName_Kana_Line (String JP_BranchName_Kana_Line);\n\n\t/** Get Branch Name(Kana) Line\t */\n\tpublic String getJP_BranchName_Kana_Line();\n\n /** Column name JP_Date */\n public static final String COLUMNNAME_JP_Date = \"JP_Date\";\n\n\t/** Set Date.\n\t * Date\n\t */\n\tpublic void setJP_Date (String JP_Date);\n\n\t/** Get Date.\n\t * Date\n\t */\n\tpublic String getJP_Date();\n\n /** Column name JP_Line_Description */\n public static final String COLUMNNAME_JP_Line_Description = \"JP_Line_Description\";\n\n\t/** Set Line Description\t */\n\tpublic void setJP_Line_Description (String JP_Line_Description);\n\n\t/** Get Line Description\t */\n\tpublic String getJP_Line_Description();\n\n /** Column name JP_Month */\n public static final String COLUMNNAME_JP_Month = \"JP_Month\";\n\n\t/** Set Month\t */\n\tpublic void setJP_Month (String JP_Month);\n\n\t/** Get Month\t */\n\tpublic String getJP_Month();\n\n /** Column name JP_OrgTrx_Value */\n public static final String COLUMNNAME_JP_OrgTrx_Value = \"JP_OrgTrx_Value\";\n\n\t/** Set Trx Organization(Search Key)\t */\n\tpublic void setJP_OrgTrx_Value (String JP_OrgTrx_Value);\n\n\t/** Get Trx Organization(Search Key)\t */\n\tpublic String getJP_OrgTrx_Value();\n\n /** Column name JP_Org_Value */\n public static final String COLUMNNAME_JP_Org_Value = \"JP_Org_Value\";\n\n\t/** Set Organization(Search Key)\t */\n\tpublic void setJP_Org_Value (String JP_Org_Value);\n\n\t/** Get Organization(Search Key)\t */\n\tpublic String getJP_Org_Value();\n\n /** Column name JP_RequesterName */\n public static final String COLUMNNAME_JP_RequesterName = \"JP_RequesterName\";\n\n\t/** Set Requester Name\t */\n\tpublic void setJP_RequesterName (String JP_RequesterName);\n\n\t/** Get Requester Name\t */\n\tpublic String getJP_RequesterName();\n\n /** Column name JP_SalesRep_EMail */\n public static final String COLUMNNAME_JP_SalesRep_EMail = \"JP_SalesRep_EMail\";\n\n\t/** Set Sales Rep(E-Mail)\t */\n\tpublic void setJP_SalesRep_EMail (String JP_SalesRep_EMail);\n\n\t/** Get Sales Rep(E-Mail)\t */\n\tpublic String getJP_SalesRep_EMail();\n\n /** Column name JP_SalesRep_Name */\n public static final String COLUMNNAME_JP_SalesRep_Name = \"JP_SalesRep_Name\";\n\n\t/** Set Sales Rep(Name)\t */\n\tpublic void setJP_SalesRep_Name (String JP_SalesRep_Name);\n\n\t/** Get Sales Rep(Name)\t */\n\tpublic String getJP_SalesRep_Name();\n\n /** Column name JP_SalesRep_Value */\n public static final String COLUMNNAME_JP_SalesRep_Value = \"JP_SalesRep_Value\";\n\n\t/** Set Sales Rep(Search Key)\t */\n\tpublic void setJP_SalesRep_Value (String JP_SalesRep_Value);\n\n\t/** Get Sales Rep(Search Key)\t */\n\tpublic String getJP_SalesRep_Value();\n\n /** Column name Processed */\n public static final String COLUMNNAME_Processed = \"Processed\";\n\n\t/** Set Processed.\n\t * The document has been processed\n\t */\n\tpublic void setProcessed (boolean Processed);\n\n\t/** Get Processed.\n\t * The document has been processed\n\t */\n\tpublic boolean isProcessed();\n\n /** Column name Processing */\n public static final String COLUMNNAME_Processing = \"Processing\";\n\n\t/** Set Process Now\t */\n\tpublic void setProcessing (boolean Processing);\n\n\t/** Get Process Now\t */\n\tpublic boolean isProcessing();\n\n /** Column name RoutingNo */\n public static final String COLUMNNAME_RoutingNo = \"RoutingNo\";\n\n\t/** Set Routing No.\n\t * Bank Routing Number\n\t */\n\tpublic void setRoutingNo (String RoutingNo);\n\n\t/** Get Routing No.\n\t * Bank Routing Number\n\t */\n\tpublic String getRoutingNo();\n\n /** Column name SalesRep_ID */\n public static final String COLUMNNAME_SalesRep_ID = \"SalesRep_ID\";\n\n\t/** Set Sales Rep.\n\t * Sales Representative or Company Agent\n\t */\n\tpublic void setSalesRep_ID (int SalesRep_ID);\n\n\t/** Get Sales Rep.\n\t * Sales Representative or Company Agent\n\t */\n\tpublic int getSalesRep_ID();\n\n\tpublic org.compiere.model.I_AD_User getSalesRep() throws RuntimeException;\n\n /** Column name StatementDate */\n public static final String COLUMNNAME_StatementDate = \"StatementDate\";\n\n\t/** Set Statement date.\n\t * Date of the statement\n\t */\n\tpublic void setStatementDate (Timestamp StatementDate);\n\n\t/** Get Statement date.\n\t * Date of the statement\n\t */\n\tpublic Timestamp getStatementDate();\n\n /** Column name StmtAmt */\n public static final String COLUMNNAME_StmtAmt = \"StmtAmt\";\n\n\t/** Set Statement amount.\n\t * Statement Amount\n\t */\n\tpublic void setStmtAmt (BigDecimal StmtAmt);\n\n\t/** Get Statement amount.\n\t * Statement Amount\n\t */\n\tpublic BigDecimal getStmtAmt();\n\n /** Column name TrxAmt */\n public static final String COLUMNNAME_TrxAmt = \"TrxAmt\";\n\n\t/** Set Transaction Amount.\n\t * Amount of a transaction\n\t */\n\tpublic void setTrxAmt (BigDecimal TrxAmt);\n\n\t/** Get Transaction Amount.\n\t * Amount of a transaction\n\t */\n\tpublic BigDecimal getTrxAmt();\n\n /** Column name Updated */\n public static final String COLUMNNAME_Updated = \"Updated\";\n\n\t/** Get Updated.\n\t * Date this record was updated\n\t */\n\tpublic Timestamp getUpdated();\n\n /** Column name UpdatedBy */\n public static final String COLUMNNAME_UpdatedBy = \"UpdatedBy\";\n\n\t/** Get Updated By.\n\t * User who updated this records\n\t */\n\tpublic int getUpdatedBy();\n}", "Map<String, Object> getAllMetadata();", "public static JasperReportBuilder generateReport(ExportData metaData,HttpServletRequest request){\n session = request.getSession(false);\n report = report(); // Creer le rapport\n \n //Logo\n// logoImg = cmp.image(inImg).setStyle(DynamicReports.stl.style().setHorizontalAlignment(HorizontalAlignment.LEFT)); \n //logoImg.setDimension(80,80); \n \n //Definit le style des colonnes d'entàte\n report.setColumnTitleStyle(getHeaderStyle(metaData));\n \n \n \n LinkedHashMap <String,String> criteria = metaData.getCriteria(); \n //Ajout la date d'àdition au critere d'impression\n String valDateProperty = getDateTxt(metaData.getLang()) ;\n String keyDateProperty = \"\" ;\n if ( session.getAttribute(\"activedLocale\").equals(\"fr\") ) {\n keyDateProperty = \"Edité le \" ;\n }\n else {\n keyDateProperty = \"Printed on \" ;\n }\n criteria.put(keyDateProperty,valDateProperty);\n \n StyleBuilder titleStyle = stl.style(boldStyle).setFontSize(16).setForegroundColor(new Color(0, 0, 0)).setHorizontalAlignment(HorizontalAlignment.RIGHT).setRightIndent(20);\n ComponentBuilder<?, ?> logoComponent = cmp.horizontalList(\n //cmp.image(Templates.class.getResource(\"/logopalm.png\")).setFixedDimension(150, 50).setStyle(stl.style().setLeftIndent(20)),\n cmp.verticalList(\n cmp.text(metaData.getTitle()).setStyle(titleStyle)\n )\n ).newRow()\n .add(cmp.horizontalList().add(cmp.hListCell(createCriteriaComponent(criteria,metaData)).heightFixedOnTop()))\n .newRow(); \n \n report.noData(logoComponent, cmp.text(\"Aucun enregistrement trouvà\").setStyle(stl.style().setHorizontalAlignment(HorizontalAlignment.CENTER).setTopPadding(30)));\n\n \n \n lblStyle = stl.style(Templates.columnStyle).setForegroundColor(new Color(60, 91, 31)); // Couleur du text \n colStyle = stl.style(Templates.columnStyle).setHorizontalAlignment(HorizontalAlignment.CENTER);\n \n groupStyle = stl.style().setForegroundColor(new Color(60, 91, 31)) \n .setBold(Boolean.TRUE)\n .setPadding(5)\n .setFontSize(13)\n .setHorizontalAlignment(HorizontalAlignment.CENTER); \n \n\n \n if(metaData.getTitle().equals(ITitle.PARCEL)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PARCEL_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SECTOR)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SECTOR_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BLOCK)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BLOCK_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ATTACK_PHYTO)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TREATMENT)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TREATMENT_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVEST)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVEST_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SERVICING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SERVICING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_PLANTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_PLANTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.FERTILIZATION)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.FERTILIZATION_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.CONTROL_PHYTO)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.CONTROL_PHYTO_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_FOLDING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_FOLDING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.MORTALITY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.MORTALITY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVESTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVESTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BUDGET)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.REPLACEMENT)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.REPLACEMENT_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.METEOROLOGY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.METEOROLOGY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_MATERIAL)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_MATERIAL_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLUVIOMETRY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLUVIOMETRY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ETP)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ETP_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HYGROMETRY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HYGROMETRY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TEMPERATURE)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TEMPERATURE_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.INSULATION)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.INSULATION_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.WORK)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.WORK_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }\n \n \n drColumns = new HashMap<String, TextColumnBuilder>(); \n groups = new ArrayList<String>();\n subtotals = new ArrayList<String>();\n \n //Definit la liste des colonnes du rapport\n ExportGenerator.getColumns(metaData); \n //Definit la liste des sous-totaux du rapport\n ExportGenerator.getSubTotals(metaData);\n \n \n //Genration des sous totaux\n for (String group : groups) {\n ColumnGroupBuilder group2 = grp.group(drColumns.get(group));\n report.groupBy(group2);\n for (String subtotal : subtotals) {\n report.subtotalsAtGroupFooter(group2,sbt.sum(drColumns.get(subtotal)));\n }\n }\n\n for (String subtotal : subtotals) {\n report.subtotalsAtSummary(sbt.sum(drColumns.get(subtotal))); \n }\n \n /*if(ExportGenerator.getColumnByNameField(\"plantingName\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL \"), ExportGenerator.getColumnByNameField(\"plantingName\"), Calculation.NOTHING));\n }*//*else if(ExportGenerator.getColumnByNameField(\"invoiceCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"invoiceCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"planterCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL\"), ExportGenerator.getColumnByNameField(\"planterCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"transportTicket\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"transportTicket\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"deliveryDate\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"deliveryDate\"), Calculation.NOTHING));\n }\n else if(ExportGenerator.getColumnByNameField(\"arroundPlantingTicketNumber\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"arroundPlantingTicketNumber\"), Calculation.NOTHING));\n }\n else if(ExportGenerator.getColumnByNameField(\"planterNumber\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"planterNumber\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"startPaymentDate\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"startPaymentDate\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"sectorCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"sectorCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"month\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL \"), ExportGenerator.getColumnByNameField(\"month\"), Calculation.NOTHING));\n }*/\n \n\n \n \n //Genere la source de donnàes du rapport\n report.setDataSource(metaData.getData());\n \n report.highlightDetailEvenRows(); \n \n \n // Definition de l'entete : valable uniquement pour la 1ere page\n HorizontalListBuilder hlb= null;\n \n hlb = cmp.horizontalList().add(\n cmp.hListCell(createCriteriaComponent(criteria,metaData)).heightFixedOnTop()\n );\n\n \n report.title(\n createCustomTitleComponent(metaData.getTitle()), // Titre\n hlb,// Liste Horizontal des Critàres \n cmp.verticalGap(12) // Marge de 12 px entre chaque critàre\n ); \n \n \n \n report.setPageMargin(DynamicReports.margin().setLeft(15).setTop(30).setRight(15).setBottom(30));\n report.setPageFormat(PageType.A3, PageOrientation.LANDSCAPE);\n report.pageFooter(DynamicReports.cmp.pageXslashY());\n return report;\n \n }", "public interface IReportDao extends IBaseDao<Report, Integer> {\n\t\n\t/**\n\t * 添加举报信息\n\t * @param report\n\t */\n\tpublic boolean addReport(Report report);\n\t\n\t/**\n\t * 修改举报信息\n\t * @param report\n\t * @return\n\t */\n\tpublic boolean updateReport(Report report);\n\t\n//\t/**\n//\t * 是否已经举报\n//\t * @param getReportGto\n//\t * @return\n//\t */\n//\tpublic boolean isHouseInfoReported(GetReportGto getReportGto);\n\t\n\t/**\n\t * 获取我与某条房源的举报信息\n\t * @param getReportGto\n\t * @return\n\t */\n\tpublic List<Report> getMyReport(GetReportGto getReportGto);\n}", "public interface TableDetailMapper {\n\n @Select(\"select * from dxh_sys.tabledetail where vendorId=0 and tableName='skuProfitDayReport'\")\n List<Map<String, Object>> list();\n\n}", "public Report getReport();", "BoltResultSetMetaData(List<Type> types, List<String> keys) {\n\t\tsuper(keys);\n\t\tthis.columnType = types.toArray(new Type[this.keys.size() + 1]);\n\n\t\t// we init columnType with the first record\n\t\t// in case first == last record\n\t\t/*for (int i = 1; i <= this.keys.size(); i++) {\n\t\t\tcolumnType[i] = this.getColumnDriverTypeOrDefault(i, InternalTypeSystem.TYPE_SYSTEM.STRING());\n\t\t}*/\n\t}", "@Override\r\n\tpublic Map<String, Object> getMetadata() {\n\t\treturn null;\r\n\t}", "@Select({\n \"select\",\n \"JNLNO, TRANDATE, ACCOUNTDATE, CHECKTYPE, STATUS, DONETIME, FILENAME\",\n \"from B_UMB_CHECKING_LOG\",\n \"where JNLNO = #{jnlno,jdbcType=VARCHAR}\"\n })\n @Results({\n @Result(column=\"JNLNO\", property=\"jnlno\", jdbcType=JdbcType.VARCHAR, id=true),\n @Result(column=\"TRANDATE\", property=\"trandate\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"ACCOUNTDATE\", property=\"accountdate\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"CHECKTYPE\", property=\"checktype\", jdbcType=JdbcType.CHAR),\n @Result(column=\"STATUS\", property=\"status\", jdbcType=JdbcType.CHAR),\n @Result(column=\"DONETIME\", property=\"donetime\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"FILENAME\", property=\"filename\", jdbcType=JdbcType.VARCHAR)\n })\n BUMBCheckingLog selectByPrimaryKey(BUMBCheckingLogKey key);", "@SqlQuery(\"select * from PLAYERSTATS\")\n List<PlayerStats> getAll();", "protected String getMetadataName() {\r\n\t\treturn METADATA_NAME;\r\n\t}", "public abstract String getSummaryForDatabase();", "private interface ReportColumnCallback\n {\n void handleReportColumn(DashboardReport report, String columnName) throws MojoExecutionException;\n }", "public ReportMetadataExample() {\n\t\toredCriteria = new ArrayList<Criteria>();\n\t}", "@Override\r\n \tpublic MetaData getMetaData(HttpHeaders headers) {\n \t\ttry {\r\n \t\t\treturn MetaDataUtil.getMetaData(new ViewListeEleve(), new HashMap<String, MetaData>(),new ArrayList<String>());\r\n \t\t} catch (Exception e) {\r\n \t\t\t// TODO Auto-generated catch block\r\n \t\t\tthrow new WebApplicationException(Response.serverError().entity(new String(\"MetaData parse error\")).build());\r\n \t\t} \r\n \t}", "public DefaultMetaData getMetaData() {\n\t\treturn this.metaData;\n\t}", "Report createReport();", "@Override\n public Map<String, String> createFieldToPropertyMapping() {\n final Map<String, String> mapping = super.createFieldToPropertyMapping();\n mapping.put(this.tableName + \".rsres_id\", \"id\");\n mapping.put(this.tableName + \".resource_id\", \"resourceId\");\n mapping.put(this.tableName + \".quantity\", QUANTITY);\n mapping.put(this.tableName + \".cost_rsres\", \"cost\");\n\n return mapping;\n }", "public String getReportsToBeGenerated(String reportType) {\r\n\t\tString query = \"\";\r\n\t\t\r\n\t\ttry (Connection connection = DatabaseConnection.getMySQLConnection();\r\n\t\t\t PreparedStatement stmt = connection.prepareStatement(query);) {\r\n\t\t\tResultSet result = stmt.executeQuery();\r\n\t\t\tStringJoiner reports = new StringJoiner(\",,\");\r\n\t\t\twhile (result.next()) {\r\n\t\t\t\treports.add(result.getString(\"REPORT_NAME\"));\r\n\t\t\t}\r\n\t\t\treturn reports.toString();\r\n\t\t} catch (SQLException e) {\r\n\t\t\tthrow new ReportGenerationException(\"An error occurred while retrieving reports to be generated.\", e);\r\n\t\t}\r\n\t}", "public String getMetaDataFileName() {\n return null;\n }", "public JDBCRawSqlQueryMetaData(Method method) {\n this.method = method;\n }", "public Map getMetadata() {\n return metadata;\n }", "public DatabaseMetaData(Statement s) {\n\t\t_stmt = s; // SQL-Connection\n\t\t_buffer = new StringBuffer(); // Output goes here\n\t\t_tables = new ArrayList<String>(); // List of tables\n\t\t\n\t\ttry {\n\t\t\t// Put table names in `_tables`\n\t\t\textractTableNames(_stmt.executeQuery(composeTableNamesQuery()));\n\n\t\t\t// fetch the string representation of each tables meta-data\n\t\t\tfor (String name : _tables)\n\t\t\t\t_buffer.append(new TableMeta(name)); \n\t\t} catch (SQLException e) { _error = true;}\n\t}", "private Builder() {\n super(net.explorys.samhat.z12.r837.X837Ins_2320_MOA_MedicareOutpatientAdjudicationInformation.SCHEMA$);\n }", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "public String toString() {\n return \"[JDBCRawSqlQueryMetaData : method=\" + method + \"]\";\n }", "Report selectByPrimaryKey(Integer id);", "java.lang.String getMetadata(int index);", "java.lang.String getMetadata(int index);", "public Integer getReportId() {\n return reportId;\n }", "@Schema(description = \"`status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Code general-info: The type of external report available \")\n public String getAssessmentInstanceReportType() {\n return assessmentInstanceReportType;\n }", "@Override\r\n\tpublic List<ReportAndSummary> findAll() {\n\t\tList<ReportAndSummary> result = reportAndSummaryDao.findAll();\r\n\t\treturn result;\r\n\t}", "private static Map<String, ColumnMetaData> buildColumnMetadataMap(ResultSet rs) {\n\t\t/*\n\t\t * LinkedHashmap to preserve key traversal order.\n\t\t * Important as we output rows as arrays of values where the index position in\n\t\t * the row implicitly corresponds to the entry order of the column map.\n\t\t * Reason for this is performance. \n\t\t */\n\t\tMap<String, ColumnMetaData> columnMap = Maps.newLinkedHashMap();\n\t\ttry {\n\t\t\tResultSetMetaData rmd = rs.getMetaData();\n\t\t\tfor (int i=1; i<= rmd.getColumnCount(); i++) {\n\t\t\t\tColumnMetaData cmd = \n\t\t\t\t\tnew ColumnMetaData(rmd.getColumnName(i), rmd.getColumnTypeName(i));\n\t\t\t\tcolumnMap.put(cmd.columnName, cmd);\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\tThrowables.propagate(e);\n\t\t}\n\t\treturn columnMap;\n\t}", "protected String getSqlTable() {\n\t\treturn \"Project\";\n\t}", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "public interface I_IHC_JobDataChange \n{\n\n /** TableName=IHC_JobDataChange */\n public static final String Table_Name = \"IHC_JobDataChange\";\n\n /** AD_Table_ID=1100135 */\n public static final int Table_ID = MTable.getTable_ID(Table_Name);\n\n KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);\n\n /** AccessLevel = 3 - Client - Org \n */\n BigDecimal accessLevel = BigDecimal.valueOf(3);\n\n /** Load Meta Data */\n\n /** Column name AD_Client_ID */\n public static final String COLUMNNAME_AD_Client_ID = \"AD_Client_ID\";\n\n\t/** Get Client.\n\t * Client/Tenant for this installation.\n\t */\n\tpublic int getAD_Client_ID();\n\n /** Column name AD_Org_ID */\n public static final String COLUMNNAME_AD_Org_ID = \"AD_Org_ID\";\n\n\t/** Set Organization.\n\t * Organizational entity within client\n\t */\n\tpublic void setAD_Org_ID (int AD_Org_ID);\n\n\t/** Get Organization.\n\t * Organizational entity within client\n\t */\n\tpublic int getAD_Org_ID();\n\n /** Column name BPJSRegistrationDate */\n public static final String COLUMNNAME_BPJSRegistrationDate = \"BPJSRegistrationDate\";\n\n\t/** Set BPJS Registration Date\t */\n\tpublic void setBPJSRegistrationDate (Timestamp BPJSRegistrationDate);\n\n\t/** Get BPJS Registration Date\t */\n\tpublic Timestamp getBPJSRegistrationDate();\n\n /** Column name Created */\n public static final String COLUMNNAME_Created = \"Created\";\n\n\t/** Get Created.\n\t * Date this record was created\n\t */\n\tpublic Timestamp getCreated();\n\n /** Column name CreatedBy */\n public static final String COLUMNNAME_CreatedBy = \"CreatedBy\";\n\n\t/** Get Created By.\n\t * User who created this records\n\t */\n\tpublic int getCreatedBy();\n\n /** Column name Description */\n public static final String COLUMNNAME_Description = \"Description\";\n\n\t/** Set Description.\n\t * Optional short description of the record\n\t */\n\tpublic void setDescription (String Description);\n\n\t/** Get Description.\n\t * Optional short description of the record\n\t */\n\tpublic String getDescription();\n\n /** Column name DescriptionNew */\n public static final String COLUMNNAME_DescriptionNew = \"DescriptionNew\";\n\n\t/** Set Description New\t */\n\tpublic void setDescriptionNew (String DescriptionNew);\n\n\t/** Get Description New\t */\n\tpublic String getDescriptionNew();\n\n /** Column name HC_Compensation1 */\n public static final String COLUMNNAME_HC_Compensation1 = \"HC_Compensation1\";\n\n\t/** Set Compensation 1\t */\n\tpublic void setHC_Compensation1 (BigDecimal HC_Compensation1);\n\n\t/** Get Compensation 1\t */\n\tpublic BigDecimal getHC_Compensation1();\n\n /** Column name HC_Compensation2 */\n public static final String COLUMNNAME_HC_Compensation2 = \"HC_Compensation2\";\n\n\t/** Set Compensation 2\t */\n\tpublic void setHC_Compensation2 (BigDecimal HC_Compensation2);\n\n\t/** Get Compensation 2\t */\n\tpublic BigDecimal getHC_Compensation2();\n\n /** Column name HC_Compensation3 */\n public static final String COLUMNNAME_HC_Compensation3 = \"HC_Compensation3\";\n\n\t/** Set Compensation 3\t */\n\tpublic void setHC_Compensation3 (BigDecimal HC_Compensation3);\n\n\t/** Get Compensation 3\t */\n\tpublic BigDecimal getHC_Compensation3();\n\n /** Column name HC_Compensation4 */\n public static final String COLUMNNAME_HC_Compensation4 = \"HC_Compensation4\";\n\n\t/** Set Compensation 4\t */\n\tpublic void setHC_Compensation4 (BigDecimal HC_Compensation4);\n\n\t/** Get Compensation 4\t */\n\tpublic BigDecimal getHC_Compensation4();\n\n /** Column name HC_EffectiveSeq */\n public static final String COLUMNNAME_HC_EffectiveSeq = \"HC_EffectiveSeq\";\n\n\t/** Set Effective Sequence\t */\n\tpublic void setHC_EffectiveSeq (int HC_EffectiveSeq);\n\n\t/** Get Effective Sequence\t */\n\tpublic int getHC_EffectiveSeq();\n\n /** Column name HC_Employee_ID */\n public static final String COLUMNNAME_HC_Employee_ID = \"HC_Employee_ID\";\n\n\t/** Set Employee Data\t */\n\tpublic void setHC_Employee_ID (int HC_Employee_ID);\n\n\t/** Get Employee Data\t */\n\tpublic int getHC_Employee_ID();\n\n\tpublic I_HC_Employee getHC_Employee() throws RuntimeException;\n\n /** Column name HC_EmployeeGrade_ID */\n public static final String COLUMNNAME_HC_EmployeeGrade_ID = \"HC_EmployeeGrade_ID\";\n\n\t/** Set Employee Grade\t */\n\tpublic void setHC_EmployeeGrade_ID (int HC_EmployeeGrade_ID);\n\n\t/** Get Employee Grade\t */\n\tpublic int getHC_EmployeeGrade_ID();\n\n\tpublic I_HC_EmployeeGrade getHC_EmployeeGrade() throws RuntimeException;\n\n /** Column name HC_EmployeeGrade2_ID */\n public static final String COLUMNNAME_HC_EmployeeGrade2_ID = \"HC_EmployeeGrade2_ID\";\n\n\t/** Set Employee Grade To\t */\n\tpublic void setHC_EmployeeGrade2_ID (int HC_EmployeeGrade2_ID);\n\n\t/** Get Employee Grade To\t */\n\tpublic int getHC_EmployeeGrade2_ID();\n\n\tpublic I_HC_EmployeeGrade getHC_EmployeeGrade2() throws RuntimeException;\n\n /** Column name HC_EmployeeJob_ID */\n public static final String COLUMNNAME_HC_EmployeeJob_ID = \"HC_EmployeeJob_ID\";\n\n\t/** Set Employee Job Data\t */\n\tpublic void setHC_EmployeeJob_ID (int HC_EmployeeJob_ID);\n\n\t/** Get Employee Job Data\t */\n\tpublic int getHC_EmployeeJob_ID();\n\n\tpublic I_HC_EmployeeJob getHC_EmployeeJob() throws RuntimeException;\n\n /** Column name HC_Job_ID */\n public static final String COLUMNNAME_HC_Job_ID = \"HC_Job_ID\";\n\n\t/** Set Job\t */\n\tpublic void setHC_Job_ID (int HC_Job_ID);\n\n\t/** Get Job\t */\n\tpublic int getHC_Job_ID();\n\n\tpublic I_HC_Job getHC_Job() throws RuntimeException;\n\n /** Column name HC_JobAction */\n public static final String COLUMNNAME_HC_JobAction = \"HC_JobAction\";\n\n\t/** Set Job Action\t */\n\tpublic void setHC_JobAction (String HC_JobAction);\n\n\t/** Get Job Action\t */\n\tpublic String getHC_JobAction();\n\n /** Column name HC_JobDataChange_ID */\n public static final String COLUMNNAME_HC_JobDataChange_ID = \"HC_JobDataChange_ID\";\n\n\t/** Set Job Data Change\t */\n\tpublic void setHC_JobDataChange_ID (int HC_JobDataChange_ID);\n\n\t/** Get Job Data Change\t */\n\tpublic int getHC_JobDataChange_ID();\n\n\tpublic I_HC_JobDataChange getHC_JobDataChange() throws RuntimeException;\n\n /** Column name HC_Manager_ID */\n public static final String COLUMNNAME_HC_Manager_ID = \"HC_Manager_ID\";\n\n\t/** Set Manager Name\t */\n\tpublic void setHC_Manager_ID (int HC_Manager_ID);\n\n\t/** Get Manager Name\t */\n\tpublic int getHC_Manager_ID();\n\n\tpublic I_HC_Employee getHC_Manager() throws RuntimeException;\n\n /** Column name HC_ManagerTo_ID */\n public static final String COLUMNNAME_HC_ManagerTo_ID = \"HC_ManagerTo_ID\";\n\n\t/** Set Manager To ID\t */\n\tpublic void setHC_ManagerTo_ID (int HC_ManagerTo_ID);\n\n\t/** Get Manager To ID\t */\n\tpublic int getHC_ManagerTo_ID();\n\n\tpublic I_HC_Employee getHC_ManagerTo() throws RuntimeException;\n\n /** Column name HC_Org_ID */\n public static final String COLUMNNAME_HC_Org_ID = \"HC_Org_ID\";\n\n\t/** Set HC Organization\t */\n\tpublic void setHC_Org_ID (int HC_Org_ID);\n\n\t/** Get HC Organization\t */\n\tpublic int getHC_Org_ID();\n\n\tpublic I_HC_Org getHC_Org() throws RuntimeException;\n\n /** Column name HC_Org2_ID */\n public static final String COLUMNNAME_HC_Org2_ID = \"HC_Org2_ID\";\n\n\t/** Set HC Organization To\t */\n\tpublic void setHC_Org2_ID (int HC_Org2_ID);\n\n\t/** Get HC Organization To\t */\n\tpublic int getHC_Org2_ID();\n\n\tpublic I_HC_Org getHC_Org2() throws RuntimeException;\n\n /** Column name HC_PayGroup_ID */\n public static final String COLUMNNAME_HC_PayGroup_ID = \"HC_PayGroup_ID\";\n\n\t/** Set Payroll Group\t */\n\tpublic void setHC_PayGroup_ID (int HC_PayGroup_ID);\n\n\t/** Get Payroll Group\t */\n\tpublic int getHC_PayGroup_ID();\n\n\tpublic I_HC_PayGroup getHC_PayGroup() throws RuntimeException;\n\n /** Column name HC_PreviousJob_ID */\n public static final String COLUMNNAME_HC_PreviousJob_ID = \"HC_PreviousJob_ID\";\n\n\t/** Set Job Sekarang\t */\n\tpublic void setHC_PreviousJob_ID (int HC_PreviousJob_ID);\n\n\t/** Get Job Sekarang\t */\n\tpublic int getHC_PreviousJob_ID();\n\n\tpublic I_HC_Job getHC_PreviousJob() throws RuntimeException;\n\n /** Column name HC_Reason_ID */\n public static final String COLUMNNAME_HC_Reason_ID = \"HC_Reason_ID\";\n\n\t/** Set HC Reason\t */\n\tpublic void setHC_Reason_ID (int HC_Reason_ID);\n\n\t/** Get HC Reason\t */\n\tpublic int getHC_Reason_ID();\n\n\tpublic I_HC_Reason getHC_Reason() throws RuntimeException;\n\n /** Column name HC_Status */\n public static final String COLUMNNAME_HC_Status = \"HC_Status\";\n\n\t/** Set HC Status\t */\n\tpublic void setHC_Status (String HC_Status);\n\n\t/** Get HC Status\t */\n\tpublic String getHC_Status();\n\n /** Column name HC_WorkEndDate */\n public static final String COLUMNNAME_HC_WorkEndDate = \"HC_WorkEndDate\";\n\n\t/** Set Work End Date\t */\n\tpublic void setHC_WorkEndDate (Timestamp HC_WorkEndDate);\n\n\t/** Get Work End Date\t */\n\tpublic Timestamp getHC_WorkEndDate();\n\n /** Column name HC_WorkPeriodDate */\n public static final String COLUMNNAME_HC_WorkPeriodDate = \"HC_WorkPeriodDate\";\n\n\t/** Set WorkPeriodDate\t */\n\tpublic void setHC_WorkPeriodDate (String HC_WorkPeriodDate);\n\n\t/** Get WorkPeriodDate\t */\n\tpublic String getHC_WorkPeriodDate();\n\n /** Column name HC_WorkStartDate */\n public static final String COLUMNNAME_HC_WorkStartDate = \"HC_WorkStartDate\";\n\n\t/** Set WorkStartDate\t */\n\tpublic void setHC_WorkStartDate (Timestamp HC_WorkStartDate);\n\n\t/** Get WorkStartDate\t */\n\tpublic Timestamp getHC_WorkStartDate();\n\n /** Column name HC_WorkStartDate2 */\n public static final String COLUMNNAME_HC_WorkStartDate2 = \"HC_WorkStartDate2\";\n\n\t/** Set Work Start Date Baru\t */\n\tpublic void setHC_WorkStartDate2 (Timestamp HC_WorkStartDate2);\n\n\t/** Get Work Start Date Baru\t */\n\tpublic Timestamp getHC_WorkStartDate2();\n\n /** Column name IHC_JobDataChange_ID */\n public static final String COLUMNNAME_IHC_JobDataChange_ID = \"IHC_JobDataChange_ID\";\n\n\t/** Set IHC_JobDayaChange\t */\n\tpublic void setIHC_JobDataChange_ID (int IHC_JobDataChange_ID);\n\n\t/** Get IHC_JobDayaChange\t */\n\tpublic int getIHC_JobDataChange_ID();\n\n /** Column name IHC_JobDataChange_UU */\n public static final String COLUMNNAME_IHC_JobDataChange_UU = \"IHC_JobDataChange_UU\";\n\n\t/** Set IHC_JobDataChange_UU\t */\n\tpublic void setIHC_JobDataChange_UU (String IHC_JobDataChange_UU);\n\n\t/** Get IHC_JobDataChange_UU\t */\n\tpublic String getIHC_JobDataChange_UU();\n\n /** Column name IsActive */\n public static final String COLUMNNAME_IsActive = \"IsActive\";\n\n\t/** Set Active.\n\t * The record is active in the system\n\t */\n\tpublic void setIsActive (boolean IsActive);\n\n\t/** Get Active.\n\t * The record is active in the system\n\t */\n\tpublic boolean isActive();\n\n /** Column name IsCancelled */\n public static final String COLUMNNAME_IsCancelled = \"IsCancelled\";\n\n\t/** Set Cancelled.\n\t * The transaction was cancelled\n\t */\n\tpublic void setIsCancelled (boolean IsCancelled);\n\n\t/** Get Cancelled.\n\t * The transaction was cancelled\n\t */\n\tpublic boolean isCancelled();\n\n /** Column name NomorSK */\n public static final String COLUMNNAME_NomorSK = \"NomorSK\";\n\n\t/** Set Nomor SK\t */\n\tpublic void setNomorSK (String NomorSK);\n\n\t/** Get Nomor SK\t */\n\tpublic String getNomorSK();\n\n /** Column name NomorSK2 */\n public static final String COLUMNNAME_NomorSK2 = \"NomorSK2\";\n\n\t/** Set Nomor SK Baru\t */\n\tpublic void setNomorSK2 (String NomorSK2);\n\n\t/** Get Nomor SK Baru\t */\n\tpublic String getNomorSK2();\n\n /** Column name OriginalServiceData */\n public static final String COLUMNNAME_OriginalServiceData = \"OriginalServiceData\";\n\n\t/** Set Original Service Date\t */\n\tpublic void setOriginalServiceData (Timestamp OriginalServiceData);\n\n\t/** Get Original Service Date\t */\n\tpublic Timestamp getOriginalServiceData();\n\n /** Column name Processed */\n public static final String COLUMNNAME_Processed = \"Processed\";\n\n\t/** Set Processed.\n\t * The document has been processed\n\t */\n\tpublic void setProcessed (boolean Processed);\n\n\t/** Get Processed.\n\t * The document has been processed\n\t */\n\tpublic boolean isProcessed();\n\n /** Column name SeqNo */\n public static final String COLUMNNAME_SeqNo = \"SeqNo\";\n\n\t/** Set Sequence.\n\t * Method of ordering records;\n lowest number comes first\n\t */\n\tpublic void setSeqNo (int SeqNo);\n\n\t/** Get Sequence.\n\t * Method of ordering records;\n lowest number comes first\n\t */\n\tpublic int getSeqNo();\n\n /** Column name Updated */\n public static final String COLUMNNAME_Updated = \"Updated\";\n\n\t/** Get Updated.\n\t * Date this record was updated\n\t */\n\tpublic Timestamp getUpdated();\n\n /** Column name UpdatedBy */\n public static final String COLUMNNAME_UpdatedBy = \"UpdatedBy\";\n\n\t/** Get Updated By.\n\t * User who updated this records\n\t */\n\tpublic int getUpdatedBy();\n}" ]
[ "0.720387", "0.60612166", "0.5897073", "0.5817371", "0.58169", "0.5653088", "0.5575094", "0.5565293", "0.5523116", "0.55214834", "0.5424825", "0.5421459", "0.5377486", "0.534678", "0.5342339", "0.53190213", "0.5239825", "0.5236659", "0.5227619", "0.513109", "0.5122094", "0.5114957", "0.5110571", "0.5092275", "0.50793064", "0.50710756", "0.50666755", "0.50432736", "0.50225407", "0.5009165", "0.5007035", "0.49747992", "0.49714422", "0.49305487", "0.4928956", "0.49114767", "0.49047396", "0.4894513", "0.488628", "0.48804012", "0.48787948", "0.4848689", "0.4836264", "0.4834436", "0.48120287", "0.4810927", "0.4800393", "0.4796319", "0.4796208", "0.47960824", "0.47906667", "0.4782785", "0.47692993", "0.47681826", "0.47613847", "0.47506967", "0.4746286", "0.47449973", "0.4743577", "0.47416592", "0.47313273", "0.47236001", "0.47218567", "0.47168458", "0.47161394", "0.47148344", "0.47092924", "0.47078082", "0.4703429", "0.46990865", "0.46964943", "0.46792674", "0.4675461", "0.4675461", "0.4675461", "0.4675461", "0.4675461", "0.46668383", "0.4666713", "0.46600732", "0.46600732", "0.4655324", "0.46417722", "0.46361163", "0.46348158", "0.46313247", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.4627627" ]
0.0
-1
This method was generated by MyBatis Generator. This method corresponds to the database table core.report_metadata
public List<Criteria> getOredCriteria() { return oredCriteria; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "TableReportMetadata getReportMetadata(String reportId);", "public abstract List<ColumnSpecification> metadata();", "@Override\r\n\t\tpublic DatabaseMetaData getMetaData() throws SQLException {\n\t\t\treturn null;\r\n\t\t}", "@Override\n\tpublic JDBCMetaData getMetaData() throws SQLException {\n\t\treturn null;\n\t}", "private void writeMetaData(ResultSet resultSet) throws SQLException {\n\t System.out.println(\"The columns in the table are: \");\r\n\t System.out.println(\"Table: \" + resultSet.getMetaData().getTableName(1));\r\n\t for (int i = 1; i<= resultSet.getMetaData().getColumnCount(); i++){\r\n\t System.out.println(\"Column \" +i + \" \"+ resultSet.getMetaData().getColumnName(i));\r\n\t }\r\n\t }", "public interface TableMetaData {\n\n\t/** Adds normal column. */\n\tpublic void addColumn(final ColumnMetaData column);\n\n\t/** Adds primary key column. */\n\tpublic void addPrimaryKey(final ColumnMetaData column);\n\n\t/** Returns map of column meta data, keyed by the column label (the alias if provided in the query, otherwise the name). */\n\tpublic Map<String, ColumnMetaData> getColumns();\n\n\t/** Returns database name. */\n\tpublic String getDatabaseName();\n\n\t/** Returns ordered list of columns that are primary keys. */\n\tpublic List<ColumnMetaData> getPrimaryKeys();\n\n\t/**\n\t * Returns fully qualified table name in database-specific form for use in SQL statements. MySQL uses the form\n\t * <code>database.table</code>, for example <code>sakila.film</code>. PostgreSQL uses the form\n\t * <code>database.schema.table</code>, for example <code>sakila.public.film</code>.\n\t */\n\tpublic String getQualifiedTableName();\n\n\t/** Returns row alias. */\n\tpublic String getRowAlias();\n\t\n\t/** Returns row set alias. */\n\tpublic String getRowSetAlias();\n\t\n\t/**\n\t * Returns row alias.\n\t * \n * @deprecated As of 0.8.11 use {@link #getRowAlias()}\n\t */\n\t@Deprecated\n\tpublic String getTableAlias();\n\n\t/** Returns table name. */\n\tpublic String getTableName();\n\n\t/** Returns role of table in the SQL Resource. */\n\tpublic TableRole getTableRole();\n\n\t/** Returns true if the SQL Resource role is child. */\n\tpublic boolean isChild();\n\n\t/** Returns true if the SQL Resource role is parent. */\n\tpublic boolean isParent();\n\n\t/** Sets all the row and row set aliases. */\n\tpublic void setAliases(final String alias, final String rowAlias, final String rowSetAlias);\n\n\t/** Sets attributes. */\n\tpublic void setAttributes(final String tableName, final String qualifedTableName,\n\t\t\tfinal String databaseName, final TableRole tableRole);\n\n\t/**\n\t * Sets table alias.\n\t * \n * @deprecated As of 0.8.11 use {@link #setAliases(String, String, String)}\n\t */\n\t@Deprecated\n\tpublic void setTableAlias(final String tableAlias);\n\t\n\t/** Represents all of the roles a table may plan in a SQL Resource. */\n\t@XmlType(namespace = \"http://restsql.org/schema\")\n\tpublic enum TableRole {\n\t\tChild, ChildExtension, Join, Parent, ParentExtension, Unknown;\n\t}\n}", "public abstract List<String> newReportColumns();", "ResultSetMetaData getMetaData() throws SQLException;", "public DBMetaDataSet getMetaData()\n\t{\n\t\treturn _MetaData;\n\t}", "public interface SqlResourceMetaData {\r\n\r\n\tpublic List<ColumnMetaData> getAllReadColumns();\r\n\r\n\tpublic TableMetaData getChild();\r\n\r\n\tpublic List<TableMetaData> getChildPlusExtTables();\r\n\r\n\tpublic List<ColumnMetaData> getChildReadColumns();\r\n\r\n\tpublic TableMetaData getJoin();\r\n\r\n\tpublic List<TableMetaData> getJoinList();\r\n\r\n\tpublic int getNumberTables();\r\n\r\n\tpublic TableMetaData getParent();\r\n\r\n\tpublic List<TableMetaData> getParentPlusExtTables();\r\n\r\n\tpublic List<ColumnMetaData> getParentReadColumns();\r\n\r\n\tpublic Map<String, TableMetaData> getTableMap();\r\n\r\n\tpublic List<TableMetaData> getTables();\r\n\r\n\tpublic List<TableMetaData> getWriteTables(final Type requestType, final boolean doParent);\r\n\r\n\tpublic boolean hasJoinTable();\r\n\r\n\tpublic boolean hasMultipleDatabases();\r\n\r\n\tpublic boolean isHierarchical();\r\n\r\n\tpublic void init(final String sqlResourceName, final SqlResourceDefinition definition, final SqlBuilder sqlBuilder)\r\n\t\t\tthrows SqlResourceException;\r\n\r\n\tpublic String toHtml();\r\n\r\n\tpublic String toXml();\r\n}", "public void addColumnPathReportId() {\n addColumnInPath(ColumnMetaData.KEY_PATH_ID);\n }", "public ResultSetMetaData getMetaData() throws SQLException {\n\n try {\n int id = getNextId(TraceObject.RESULT_SET_META_DATA);\n if (isDebugEnabled()) {\n debugCodeAssign(\"ResultSetMetaData\", TraceObject.RESULT_SET_META_DATA, id, \"getMetaData()\");\n }\n checkClosed();\n String catalog = conn.getCatalog();\n JdbcResultSetMetaData meta = new JdbcResultSetMetaData(this, null, result, catalog, conn.getSession().getTrace(), id);\n return meta;\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "public MetaData getMetaData();", "@Override\n public DatabaseMetaData getMetaData() throws SQLException\n {\n logger.debug(\n \" public DatabaseMetaData getMetaData() throws SQLException\");\n\n return new SnowflakeDatabaseMetaData(this);\n }", "public DataSetMetaData getMetaData() {\n return this.metadata;\n }", "@Test\n public void metaDataExample1() throws SQLException {\n Connection connection = DriverManager.getConnection(dbUrl, dbUsername, dbPassword);\n // 2. Create statement\n Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);\n // Run sql query and get the result in resultSet object\n String sqlQuery= \"Select * From departments\";\n //String sqlQuery= \"Select first_name, last_name, salary From employees\";\n ResultSet resultSet = statement.executeQuery(sqlQuery);\n\n // we use resultSet metadata to get information about the tables\n // get the resultSet object metadata\n ResultSetMetaData rsMetadata = resultSet.getMetaData();\n\n // List for keeping all rows as a map\n List<Map<String, Object>> queryData = new ArrayList<>();\n\n // while(resultSet.next()) helps to iterate through columns\n while (resultSet.next()) {\n // key(columns) will be string but value can be any type of data. That's why we choose <String, Object>\n Map<String, Object> row = new HashMap<>(); // creating empty Map\n // number of columns\n int colCount = rsMetadata.getColumnCount();\n // for loop helps to iterate through columns\n for (int i = 1; i <= colCount; i++) {\n row.put(rsMetadata.getColumnName(i), resultSet.getObject(i));\n }\n\n queryData.add(row); // adding a Map to the List of Maps\n }\n\n // Printing the rows\n for (Map<String, Object> row: queryData) {\n System.out.println(row.toString());\n\n }\n\n\n\n\n // close all connections\n resultSet.close();\n statement.close();\n connection.close();\n }", "@Override\n\tpublic DBMetadata getMetadata() {\n\t\treturn null;\n\t}", "public MetaData getMetaData() {\r\n \treturn metaData;\r\n }", "@Override\n public SystemMetadata mapRow(ResultSet resultSet, int rowNumber) throws SQLException {\n\n // resultSet contains guid, serialVersion, date_modified, and archived column data\n SystemMetadata systemMetadata = new SystemMetadata();\n ReplicationPolicy replPolicy = new ReplicationPolicy();\n AccessPolicy accessPolicy = new AccessPolicy();\n\n // add guid\n Identifier pid = new Identifier();\n pid.setValue(resultSet.getString(\"guid\"));\n systemMetadata.setIdentifier(pid);\n \n // add seriesId\n Identifier seriesId = new Identifier();\n seriesId.setValue(resultSet.getString(\"series_id\"));\n systemMetadata.setSeriesId(seriesId);\n\n // add serialVersion\n BigInteger serialVersion = new BigInteger(resultSet.getString(\"serial_version\"));\n systemMetadata.setSerialVersion(serialVersion);\n\n // add date_modified\n Date dateSystemMetadataLastModified = resultSet.getTimestamp(\"date_modified\");\n systemMetadata.setDateSysMetadataModified(dateSystemMetadataLastModified);\n\n // add archived value, if it was stored\n boolean archived = resultSet.getBoolean(\"archived\"); // getBoolean returns false for null results\n if (!resultSet.wasNull())\n systemMetadata.setArchived(new Boolean(archived));\n\n // add date_uploaded\n Date dateUploaded = resultSet.getTimestamp(\"date_uploaded\");\n systemMetadata.setDateUploaded(dateUploaded);\n\n // add rights_holder\n Subject rightsHolderSubject = new Subject();\n String rightsHolder = resultSet.getString(\"rights_holder\");\n rightsHolderSubject.setValue(rightsHolder);\n systemMetadata.setRightsHolder(rightsHolderSubject);\n\n // add checksum, checksum_algorithm\n String checksum = resultSet.getString(\"checksum\");\n String checksumAlgorithm = resultSet.getString(\"checksum_algorithm\");\n Checksum checksumObject = new Checksum();\n checksumObject.setValue(checksum);\n checksumObject.setAlgorithm(checksumAlgorithm);\n systemMetadata.setChecksum(checksumObject);\n\n // add origin_member_node\n String originMemberNode = resultSet.getString(\"origin_member_node\");\n if (originMemberNode != null) {\n NodeReference omn = new NodeReference();\n omn.setValue(originMemberNode);\n systemMetadata.setOriginMemberNode(omn);\n }\n\n // add authoritive_member_node\n String authoritativeMemberNode = resultSet.getString(\"authoritive_member_node\");\n if (originMemberNode != null) {\n NodeReference amn = new NodeReference();\n amn.setValue(authoritativeMemberNode);\n systemMetadata.setAuthoritativeMemberNode(amn);\n }\n\n // add submitter\n String submitter = resultSet.getString(\"submitter\");\n if (submitter != null) {\n Subject submitterSubject = new Subject();\n submitterSubject.setValue(submitter);\n systemMetadata.setSubmitter(submitterSubject);\n }\n\n // add object_format\n String fmtidStr = resultSet.getString(\"object_format\");\n ObjectFormatIdentifier fmtid = new ObjectFormatIdentifier();\n fmtid.setValue(fmtidStr);\n systemMetadata.setFormatId(fmtid);\n\n // add size\n String size = resultSet.getString(\"size\");\n systemMetadata.setSize(new BigInteger(size));\n\n // add obsoletes\n String obsoletes = resultSet.getString(\"obsoletes\");\n if (obsoletes != null) {\n Identifier obsoletesId = new Identifier();\n obsoletesId.setValue(obsoletes);\n systemMetadata.setObsoletes(obsoletesId);\n }\n // add obsoleted_by\n String obsoletedBy = resultSet.getString(\"obsoleted_by\");\n if (obsoletedBy != null) {\n Identifier obsoletedById = new Identifier();\n obsoletedById.setValue(obsoletedBy);\n systemMetadata.setObsoletedBy(obsoletedById);\n }\n\n // potentially build a ReplicationPolicy\n \n // add replication_allowed, if it was persisted\n boolean replAllowed = resultSet.getBoolean(\"replication_allowed\"); // getBoolean returns false for null results\n \n if (!resultSet.wasNull()) {\n // populate and add ReplicationPolicy\n ReplicationPolicy replicationPolicy = new ReplicationPolicy();\n \n replicationPolicy.setReplicationAllowed(new Boolean(replAllowed));\n\n // add number_replicas\n int numberOfReplicas = resultSet.getInt(\"number_replicas\"); // getInt returns 0 for null values\n if (numberOfReplicas > 0) {\n replicationPolicy.setNumberReplicas(new Integer(numberOfReplicas));\n\n }\n\n // add preferred and blocked lists\n List<ReplicationPolicyEntry> replPolicies = new ArrayList<ReplicationPolicyEntry>();\n List<NodeReference> preferredNodes = new ArrayList<NodeReference>();\n List<NodeReference> blockedNodes = new ArrayList<NodeReference>();\n\n replPolicies = listReplicationPolicies(pid, localTableMap);\n\n for (ReplicationPolicyEntry policy : replPolicies) {\n Identifier id = policy.getPid();\n String entryPolicy = policy.getPolicy();\n NodeReference node = policy.getMemberNode();\n\n if (entryPolicy.equals(\"preferred\")) {\n preferredNodes.add(node);\n\n } else if (entryPolicy.equals(\"blocked\")) {\n blockedNodes.add(node);\n\n }\n }\n\n replicationPolicy.setPreferredMemberNodeList(preferredNodes);\n replicationPolicy.setBlockedMemberNodeList(blockedNodes);\n\n systemMetadata.setReplicationPolicy(replicationPolicy);\n } else {\n systemMetadata.setReplicationPolicy(null);\n }\n\n // populate and add replicas list\n\n List<Replica> replicas = new ArrayList<Replica>();\n replicas = listReplicaEntries(pid, localTableMap);\n systemMetadata.setReplicaList(replicas);\n\n // populate and add AccessPolicy\n List<AccessRule> accessRules = new ArrayList<AccessRule>();\n accessRules = listAccessRules(pid, localTableMap);\n accessPolicy.setAllowList(accessRules);\n systemMetadata.setAccessPolicy(accessPolicy);\n\n // Validate the system metadata in debug mode using TypeMarshaller\n if (log.isDebugEnabled()) {\n try {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n TypeMarshaller.marshalTypeToOutputStream(systemMetadata, baos);\n log.debug(\"SystemMetadata for pid \" + pid.getValue() + \" is: \"\n + baos.toString());\n\n } catch (MarshallingException e) {\n e.printStackTrace();\n\n } catch (IOException e) {\n e.printStackTrace();\n\n }\n }\n return systemMetadata;\n }", "public MetaData getMetaData() {\n return metaData;\n }", "public ResultSetMetaData getMetaData() throws SQLException\n {\n return m_rs.getMetaData();\n }", "public ShowTableMetadataResponse showTableMetadata(ShowTableMetadataRequest request) throws GPUdbException {\n ShowTableMetadataResponse actualResponse_ = new ShowTableMetadataResponse();\n submitRequest(\"/show/table/metadata\", request, actualResponse_, false);\n return actualResponse_;\n }", "SQLServerResultSetMetaData(SQLServerConnection con, SQLServerResultSet rs) \n {\n traceID = \" SQLServerResultSetMetaData:\" + nextInstanceID();\n this.con = con;\n this.rs =rs;\n assert rs !=null;\n if(logger.isLoggable(java.util.logging.Level.FINE))\n {\n logger.fine(toString() + \" created by (\" + rs.toString() + \")\");\n }\n }", "@Override\n public RavenJObject getMetadata() {\n return metadata;\n }", "@Override\n\tpublic List<Map<String, String>> selectReportInfo(String appId) {\n\t\treturn getSqlMap().queryForList(NAMESPACES + \"queryReportInfo\", appId);\n\t}", "void processMetaData(ResultSet rs) throws SQLException;", "public interface ColumnMetaData {\n\n\t/**\n\t * The uniqueness level of a column data type.\n\t */\n\tenum Uniqueness {\n\t\t/**\n\t\t * No limitations. Multiple instances of a single column meta data type can be attached to a table or even a\n\t\t * single column.\n\t\t */\n\t\tNONE,\n\n\t\t/**\n\t\t * Multiple instances of a single column meta data type can be attached to a table but at most one per column.\n\t\t */\n\t\tCOLUMN,\n\n\t\t/**\n\t\t * At most one instance of the column meta data type can be attached to a table.\n\t\t */\n\t\tTABLE\n\t}\n\n\t/**\n\t * The unique type id of the column meta data.\n\t *\n\t * @return the type id\n\t */\n\tString type();\n\n\t/**\n\t * The uniqueness level of the meta data. Defaults to {@link Uniqueness#NONE} (no restrictions).\n\t *\n\t * @return the uniqueness level\n\t */\n\tdefault Uniqueness uniqueness() {\n\t\treturn Uniqueness.NONE;\n\t}\n\n}", "public HashMap getMetaData() ;", "Metadata getMetaData();", "@Override\n public SystemMetadataStatus mapRow(ResultSet resultSet, int rowNumber) throws SQLException {\n\n // resultSet contains guid, serialVersion, date_modified, and archived column data\n SystemMetadataStatus systemMetadataStatus = new SystemMetadataStatus();\n\n // add guid\n Identifier pid = new Identifier();\n pid.setValue(resultSet.getString(\"guid\"));\n systemMetadataStatus.setPid(pid);\n\n // add serialVersion\n BigInteger serialVersion = new BigInteger(resultSet.getString(\"serial_version\"));\n systemMetadataStatus.setSerialVersion(serialVersion);\n\n // add date_modified\n Date dateSystemMetadataLastModified = resultSet.getTimestamp(\"date_modified\");\n systemMetadataStatus\n .setLastSystemMetadataModificationDate(dateSystemMetadataLastModified);\n\n // add archived\n boolean archived = resultSet.getBoolean(\"archived\"); // getBoolean returns false for null results\n systemMetadataStatus.setDeleted(new Boolean(archived));\n\n return systemMetadataStatus;\n }", "@Override\n public String toString() {\n return \"Report{\" +\n \"reportId=\" + reportId +\n \", reportOpId=\" + reportOp +\n \", date='\" + date + '\\'' +\n \", reportedUserId=\" + reportedUser +\n \", userId=\" + user +\n \", status=\" + status +\n '}';\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}", "CustomReport selectByPrimaryKey(BigDecimal reportId);", "public ResultSetMetaData getMetaData() throws SQLException {\n return currentPreparedStatement.getMetaData();\n }", "public ReportTable(TableView<Report> reportTable) {\n this.reportTable = reportTable;\n }", "public void analizeQueryResultMetaData(ResultSetMetaData rsMetaData, String[] decimalColumns){\n\t\tArrayList<Integer> decimalColumnResultsetIndexes = new ArrayList<Integer>();\n\t\t//if ( decimalColumns==null||decimalColumns.length==0)\n\t\t//\treturn ; \n\t\ttry {\n\t\t\t\n\t\t\t\n\t\t\t//IObjectToStringConverter[] converters = new IObjectToStringConverter[rsMetaData.getColumnCount()] ;\n\t\t\tOuputDataType[] dataTypes = new OuputDataType[rsMetaData.getColumnCount()] ;\n\t\t\tjobContext.put(ExportEngineConstant.COLUMN_CONVERTER_KEY, dataTypes);\n\t\t\tfor ( int i=1 ; i <= rsMetaData.getColumnCount(); i++){\n\t\t\t\tboolean isDecimal = false ; \n\t\t\t\tString nama = rsMetaData.getColumnName(i).toUpperCase();\n\t\t\t\tif ( decimalColumns!=null){\n\t\t\t\t\tfor ( String scn : decimalColumns){\n\t\t\t\t\t\tif ( nama.equalsIgnoreCase(scn)){\n\t\t\t\t\t\t\tdecimalColumnResultsetIndexes.add(i-1);\n\t\t\t\t\t\t\tisDecimal = true ;\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.money; \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\tif( !isDecimal){\n\t\t\t\t\tString tipeCol = rsMetaData.getColumnClassName(i) ;\n\t\t\t\t\tboolean isDate = false ; \n\t\t\t\t\tfor ( String scn : DATE_DATA_TYPES){\n\t\t\t\t\t\tif ( tipeCol.equals(scn)){\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.date; \n\t\t\t\t\t\t\tisDate = true ; \n\t\t\t\t\t\t\tbreak ; \n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( !isDate){\n\t\t\t\t\t\tif (String.class.getName().equals(tipeCol)){\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.string;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.commonToString;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfor ( OuputDataType scn : dataTypes ){\n\t\t\t\tSystem.out.println(\"converter : \" + scn);\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"gagal membaca data column unutk membuat converter object array. error message :\" + e.getMessage() , e); \n\t\t}\n\t\t\n\t\t\n\t}", "private static void writeColumnMetaData(JsonGenerator jg, ColumnMetaData mdt) throws JsonGenerationException, IOException {\n\t\tjg.writeStartObject();\n\t\tjg.writeStringField(\"name\", mdt.columnName);\n\t\tjg.writeStringField(\"type\", mdt.columnType);\n\t\tjg.writeEndObject();;\n\t}", "private String metadata() {\n\t\tStringBuilder s = new StringBuilder();\n\t\ts.append(\"#######################################\");\n\t\ts.append(\"\\n# Metadata of query set\");\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Queries\");\n\t\ts.append(\"\\n# \\tTotal: \" + this.num_queries);\n\t\ts.append(\"\\n# \\tPoint: \" + this.num_pt_queries + \" (\" + 100 * ((double) this.num_pt_queries/this.num_queries) +\"%)\");\n\t\ts.append(\"\\n# \\tRange: \" + this.num_range_queries + \" (\" + 100 * ((double) this.num_range_queries/this.num_queries) +\"%)\");\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Operators\");\n\t\ts.append(\"\\n# \\tTotal: \" + (this.num_and_ops + this.num_or_ops) + \" (\" + ((double) (this.num_and_ops + this.num_or_ops)/this.num_queries) +\" per query)\");\n\t\ts.append(\"\\n# \\tAND: \" + this.num_and_ops);\n\t\ts.append(\"\\n# \\tOR: \" + this.num_or_ops);\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Attributes\");\n\t\ts.append(\"\\n# \\tTotal queried: \" + this.num_attributes);\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Bins\");\n\t\ts.append(\"\\n# \\tTotal queried: \" + this.num_bins);\n\t\ts.append(\"\\n# \\tPer query: \" + ((double) this.num_bins/this.num_queries));\n\t\ts.append(\"\\n#######################################\\n\");\n\t\treturn s.toString();\n\t}", "public List<Map<String, Object>> getDatewiseUpdateData(String columnName) {\n\t\tList<Map<String, Object>> reportData = new ArrayList<>();\n\n\t\tswitch (columnName) {\n\t\tcase \"LASTUPDATED\":\n\t\t\treportData = getLastUpdatedReport();\n\t\t\tbreak;\n\t\tcase \"CREATEDON\":\n\t\t\treportData = getCreatedOnReport();\n\t\t\tbreak;\n\t\tcase \"READON\":\n\t\t\treportData = getReadOnReport();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tSystem.out.println(\"Invalid column name\");\n\t\t}\n\t\treturn reportData;\n\t}", "public Map<String, Object> getMetaData() {\n\t\treturn metaData;\n\t}", "public MetadataArtifactDownloadReport getReport() {\n return report;\n }", "public Map<String, ColumnMetaData> getColumns();", "public abstract String metadata(String property);", "@Override\n\tpublic IColumns createColumns() {\n\t\treturn new WaybillforauditColumns();\n\t}", "@Schema(description = \"`status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Binary general-info: The input information used to assemble the report that can be on-going, periodic and actual and projected \")\n public Object getAssessmentInstanceReportRecord() {\n return assessmentInstanceReportRecord;\n }", "public AlterTableMetadataResponse alterTableMetadata(AlterTableMetadataRequest request) throws GPUdbException {\n AlterTableMetadataResponse actualResponse_ = new AlterTableMetadataResponse();\n submitRequest(\"/alter/table/metadata\", request, actualResponse_, false);\n return actualResponse_;\n }", "public Long getReportId() {\n return reportId;\n }", "@Schema(description = \"`status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Binary general-info: The external report in any suitable form including selection filters where appropriate \")\n public Object getAssessmentInstanceReport() {\n return assessmentInstanceReport;\n }", "@SuppressWarnings(\"all\")\npublic interface I_I_BankDataJP \n{\n\n /** TableName=I_BankDataJP */\n public static final String Table_Name = \"I_BankDataJP\";\n\n /** AD_Table_ID=1000307 */\n public static final int Table_ID = MTable.getTable_ID(Table_Name);\n\n KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);\n\n /** AccessLevel = 3 - Client - Org \n */\n BigDecimal accessLevel = BigDecimal.valueOf(3);\n\n /** Load Meta Data */\n\n /** Column name AD_Client_ID */\n public static final String COLUMNNAME_AD_Client_ID = \"AD_Client_ID\";\n\n\t/** Get Tenant.\n\t * Tenant for this installation.\n\t */\n\tpublic int getAD_Client_ID();\n\n /** Column name AD_OrgTrx_ID */\n public static final String COLUMNNAME_AD_OrgTrx_ID = \"AD_OrgTrx_ID\";\n\n\t/** Set Trx Organization.\n\t * Performing or initiating organization\n\t */\n\tpublic void setAD_OrgTrx_ID (int AD_OrgTrx_ID);\n\n\t/** Get Trx Organization.\n\t * Performing or initiating organization\n\t */\n\tpublic int getAD_OrgTrx_ID();\n\n /** Column name AD_Org_ID */\n public static final String COLUMNNAME_AD_Org_ID = \"AD_Org_ID\";\n\n\t/** Set Organization.\n\t * Organizational entity within tenant\n\t */\n\tpublic void setAD_Org_ID (int AD_Org_ID);\n\n\t/** Get Organization.\n\t * Organizational entity within tenant\n\t */\n\tpublic int getAD_Org_ID();\n\n /** Column name AccountNo */\n public static final String COLUMNNAME_AccountNo = \"AccountNo\";\n\n\t/** Set Account No.\n\t * Account Number\n\t */\n\tpublic void setAccountNo (String AccountNo);\n\n\t/** Get Account No.\n\t * Account Number\n\t */\n\tpublic String getAccountNo();\n\n /** Column name BankAccountType */\n public static final String COLUMNNAME_BankAccountType = \"BankAccountType\";\n\n\t/** Set Bank Account Type.\n\t * Bank Account Type\n\t */\n\tpublic void setBankAccountType (String BankAccountType);\n\n\t/** Get Bank Account Type.\n\t * Bank Account Type\n\t */\n\tpublic String getBankAccountType();\n\n /** Column name C_BankAccount_ID */\n public static final String COLUMNNAME_C_BankAccount_ID = \"C_BankAccount_ID\";\n\n\t/** Set Bank Account.\n\t * Account at the Bank\n\t */\n\tpublic void setC_BankAccount_ID (int C_BankAccount_ID);\n\n\t/** Get Bank Account.\n\t * Account at the Bank\n\t */\n\tpublic int getC_BankAccount_ID();\n\n\tpublic org.compiere.model.I_C_BankAccount getC_BankAccount() throws RuntimeException;\n\n /** Column name C_Bank_ID */\n public static final String COLUMNNAME_C_Bank_ID = \"C_Bank_ID\";\n\n\t/** Set Bank.\n\t * Bank\n\t */\n\tpublic void setC_Bank_ID (int C_Bank_ID);\n\n\t/** Get Bank.\n\t * Bank\n\t */\n\tpublic int getC_Bank_ID();\n\n\tpublic org.compiere.model.I_C_Bank getC_Bank() throws RuntimeException;\n\n /** Column name Created */\n public static final String COLUMNNAME_Created = \"Created\";\n\n\t/** Get Created.\n\t * Date this record was created\n\t */\n\tpublic Timestamp getCreated();\n\n /** Column name CreatedBy */\n public static final String COLUMNNAME_CreatedBy = \"CreatedBy\";\n\n\t/** Get Created By.\n\t * User who created this records\n\t */\n\tpublic int getCreatedBy();\n\n /** Column name DateAcct */\n public static final String COLUMNNAME_DateAcct = \"DateAcct\";\n\n\t/** Set Account Date.\n\t * Accounting Date\n\t */\n\tpublic void setDateAcct (Timestamp DateAcct);\n\n\t/** Get Account Date.\n\t * Accounting Date\n\t */\n\tpublic Timestamp getDateAcct();\n\n /** Column name I_BankDataJP_ID */\n public static final String COLUMNNAME_I_BankDataJP_ID = \"I_BankDataJP_ID\";\n\n\t/** Set I_BankDataJP.\n\t * JPIERE-0595:JPBP\n\t */\n\tpublic void setI_BankDataJP_ID (int I_BankDataJP_ID);\n\n\t/** Get I_BankDataJP.\n\t * JPIERE-0595:JPBP\n\t */\n\tpublic int getI_BankDataJP_ID();\n\n /** Column name I_BankDataJP_UU */\n public static final String COLUMNNAME_I_BankDataJP_UU = \"I_BankDataJP_UU\";\n\n\t/** Set I_BankDataJP_UU\t */\n\tpublic void setI_BankDataJP_UU (String I_BankDataJP_UU);\n\n\t/** Get I_BankDataJP_UU\t */\n\tpublic String getI_BankDataJP_UU();\n\n /** Column name I_ErrorMsg */\n public static final String COLUMNNAME_I_ErrorMsg = \"I_ErrorMsg\";\n\n\t/** Set Import Error Message.\n\t * Messages generated from import process\n\t */\n\tpublic void setI_ErrorMsg (String I_ErrorMsg);\n\n\t/** Get Import Error Message.\n\t * Messages generated from import process\n\t */\n\tpublic String getI_ErrorMsg();\n\n /** Column name I_IsImported */\n public static final String COLUMNNAME_I_IsImported = \"I_IsImported\";\n\n\t/** Set Imported.\n\t * Has this import been processed\n\t */\n\tpublic void setI_IsImported (boolean I_IsImported);\n\n\t/** Get Imported.\n\t * Has this import been processed\n\t */\n\tpublic boolean isI_IsImported();\n\n /** Column name IsActive */\n public static final String COLUMNNAME_IsActive = \"IsActive\";\n\n\t/** Set Active.\n\t * The record is active in the system\n\t */\n\tpublic void setIsActive (boolean IsActive);\n\n\t/** Get Active.\n\t * The record is active in the system\n\t */\n\tpublic boolean isActive();\n\n /** Column name JP_A_Name */\n public static final String COLUMNNAME_JP_A_Name = \"JP_A_Name\";\n\n\t/** Set Account Name\t */\n\tpublic void setJP_A_Name (String JP_A_Name);\n\n\t/** Get Account Name\t */\n\tpublic String getJP_A_Name();\n\n /** Column name JP_A_Name_Kana */\n public static final String COLUMNNAME_JP_A_Name_Kana = \"JP_A_Name_Kana\";\n\n\t/** Set Account Name(Kana)\t */\n\tpublic void setJP_A_Name_Kana (String JP_A_Name_Kana);\n\n\t/** Get Account Name(Kana)\t */\n\tpublic String getJP_A_Name_Kana();\n\n /** Column name JP_AcctDate */\n public static final String COLUMNNAME_JP_AcctDate = \"JP_AcctDate\";\n\n\t/** Set Date of Account Date\t */\n\tpublic void setJP_AcctDate (String JP_AcctDate);\n\n\t/** Get Date of Account Date\t */\n\tpublic String getJP_AcctDate();\n\n /** Column name JP_AcctMonth */\n public static final String COLUMNNAME_JP_AcctMonth = \"JP_AcctMonth\";\n\n\t/** Set Month of Account Date\t */\n\tpublic void setJP_AcctMonth (String JP_AcctMonth);\n\n\t/** Get Month of Account Date\t */\n\tpublic String getJP_AcctMonth();\n\n /** Column name JP_BankAccountType */\n public static final String COLUMNNAME_JP_BankAccountType = \"JP_BankAccountType\";\n\n\t/** Set Bank Account Type\t */\n\tpublic void setJP_BankAccountType (String JP_BankAccountType);\n\n\t/** Get Bank Account Type\t */\n\tpublic String getJP_BankAccountType();\n\n /** Column name JP_BankAccount_Value */\n public static final String COLUMNNAME_JP_BankAccount_Value = \"JP_BankAccount_Value\";\n\n\t/** Set Bank Account(Search Key)\t */\n\tpublic void setJP_BankAccount_Value (String JP_BankAccount_Value);\n\n\t/** Get Bank Account(Search Key)\t */\n\tpublic String getJP_BankAccount_Value();\n\n /** Column name JP_BankDataCustomerCode1 */\n public static final String COLUMNNAME_JP_BankDataCustomerCode1 = \"JP_BankDataCustomerCode1\";\n\n\t/** Set Bank Data Customer Code1\t */\n\tpublic void setJP_BankDataCustomerCode1 (String JP_BankDataCustomerCode1);\n\n\t/** Get Bank Data Customer Code1\t */\n\tpublic String getJP_BankDataCustomerCode1();\n\n /** Column name JP_BankDataCustomerCode2 */\n public static final String COLUMNNAME_JP_BankDataCustomerCode2 = \"JP_BankDataCustomerCode2\";\n\n\t/** Set Bank Data Customer Code2\t */\n\tpublic void setJP_BankDataCustomerCode2 (String JP_BankDataCustomerCode2);\n\n\t/** Get Bank Data Customer Code2\t */\n\tpublic String getJP_BankDataCustomerCode2();\n\n /** Column name JP_BankDataLine_ID */\n public static final String COLUMNNAME_JP_BankDataLine_ID = \"JP_BankDataLine_ID\";\n\n\t/** Set Import Bank Data Line\t */\n\tpublic void setJP_BankDataLine_ID (int JP_BankDataLine_ID);\n\n\t/** Get Import Bank Data Line\t */\n\tpublic int getJP_BankDataLine_ID();\n\n\tpublic I_JP_BankDataLine getJP_BankDataLine() throws RuntimeException;\n\n /** Column name JP_BankData_EDI_Info */\n public static final String COLUMNNAME_JP_BankData_EDI_Info = \"JP_BankData_EDI_Info\";\n\n\t/** Set BankData EDI Info\t */\n\tpublic void setJP_BankData_EDI_Info (String JP_BankData_EDI_Info);\n\n\t/** Get BankData EDI Info\t */\n\tpublic String getJP_BankData_EDI_Info();\n\n /** Column name JP_BankData_ID */\n public static final String COLUMNNAME_JP_BankData_ID = \"JP_BankData_ID\";\n\n\t/** Set Import Bank Data\t */\n\tpublic void setJP_BankData_ID (int JP_BankData_ID);\n\n\t/** Get Import Bank Data\t */\n\tpublic int getJP_BankData_ID();\n\n\tpublic I_JP_BankData getJP_BankData() throws RuntimeException;\n\n /** Column name JP_BankData_ReferenceNo */\n public static final String COLUMNNAME_JP_BankData_ReferenceNo = \"JP_BankData_ReferenceNo\";\n\n\t/** Set Bank Data ReferenceNo\t */\n\tpublic void setJP_BankData_ReferenceNo (String JP_BankData_ReferenceNo);\n\n\t/** Get Bank Data ReferenceNo\t */\n\tpublic String getJP_BankData_ReferenceNo();\n\n /** Column name JP_BankName_Kana */\n public static final String COLUMNNAME_JP_BankName_Kana = \"JP_BankName_Kana\";\n\n\t/** Set Bank Name(Kana)\t */\n\tpublic void setJP_BankName_Kana (String JP_BankName_Kana);\n\n\t/** Get Bank Name(Kana)\t */\n\tpublic String getJP_BankName_Kana();\n\n /** Column name JP_BankName_Kana_Line */\n public static final String COLUMNNAME_JP_BankName_Kana_Line = \"JP_BankName_Kana_Line\";\n\n\t/** Set Bank Name(Kana) Line\t */\n\tpublic void setJP_BankName_Kana_Line (String JP_BankName_Kana_Line);\n\n\t/** Get Bank Name(Kana) Line\t */\n\tpublic String getJP_BankName_Kana_Line();\n\n /** Column name JP_Bank_Name */\n public static final String COLUMNNAME_JP_Bank_Name = \"JP_Bank_Name\";\n\n\t/** Set Bank Name\t */\n\tpublic void setJP_Bank_Name (String JP_Bank_Name);\n\n\t/** Get Bank Name\t */\n\tpublic String getJP_Bank_Name();\n\n /** Column name JP_BranchCode */\n public static final String COLUMNNAME_JP_BranchCode = \"JP_BranchCode\";\n\n\t/** Set Branch Code\t */\n\tpublic void setJP_BranchCode (String JP_BranchCode);\n\n\t/** Get Branch Code\t */\n\tpublic String getJP_BranchCode();\n\n /** Column name JP_BranchName */\n public static final String COLUMNNAME_JP_BranchName = \"JP_BranchName\";\n\n\t/** Set Branch Name\t */\n\tpublic void setJP_BranchName (String JP_BranchName);\n\n\t/** Get Branch Name\t */\n\tpublic String getJP_BranchName();\n\n /** Column name JP_BranchName_Kana */\n public static final String COLUMNNAME_JP_BranchName_Kana = \"JP_BranchName_Kana\";\n\n\t/** Set Branch Name(Kana)\t */\n\tpublic void setJP_BranchName_Kana (String JP_BranchName_Kana);\n\n\t/** Get Branch Name(Kana)\t */\n\tpublic String getJP_BranchName_Kana();\n\n /** Column name JP_BranchName_Kana_Line */\n public static final String COLUMNNAME_JP_BranchName_Kana_Line = \"JP_BranchName_Kana_Line\";\n\n\t/** Set Branch Name(Kana) Line\t */\n\tpublic void setJP_BranchName_Kana_Line (String JP_BranchName_Kana_Line);\n\n\t/** Get Branch Name(Kana) Line\t */\n\tpublic String getJP_BranchName_Kana_Line();\n\n /** Column name JP_Date */\n public static final String COLUMNNAME_JP_Date = \"JP_Date\";\n\n\t/** Set Date.\n\t * Date\n\t */\n\tpublic void setJP_Date (String JP_Date);\n\n\t/** Get Date.\n\t * Date\n\t */\n\tpublic String getJP_Date();\n\n /** Column name JP_Line_Description */\n public static final String COLUMNNAME_JP_Line_Description = \"JP_Line_Description\";\n\n\t/** Set Line Description\t */\n\tpublic void setJP_Line_Description (String JP_Line_Description);\n\n\t/** Get Line Description\t */\n\tpublic String getJP_Line_Description();\n\n /** Column name JP_Month */\n public static final String COLUMNNAME_JP_Month = \"JP_Month\";\n\n\t/** Set Month\t */\n\tpublic void setJP_Month (String JP_Month);\n\n\t/** Get Month\t */\n\tpublic String getJP_Month();\n\n /** Column name JP_OrgTrx_Value */\n public static final String COLUMNNAME_JP_OrgTrx_Value = \"JP_OrgTrx_Value\";\n\n\t/** Set Trx Organization(Search Key)\t */\n\tpublic void setJP_OrgTrx_Value (String JP_OrgTrx_Value);\n\n\t/** Get Trx Organization(Search Key)\t */\n\tpublic String getJP_OrgTrx_Value();\n\n /** Column name JP_Org_Value */\n public static final String COLUMNNAME_JP_Org_Value = \"JP_Org_Value\";\n\n\t/** Set Organization(Search Key)\t */\n\tpublic void setJP_Org_Value (String JP_Org_Value);\n\n\t/** Get Organization(Search Key)\t */\n\tpublic String getJP_Org_Value();\n\n /** Column name JP_RequesterName */\n public static final String COLUMNNAME_JP_RequesterName = \"JP_RequesterName\";\n\n\t/** Set Requester Name\t */\n\tpublic void setJP_RequesterName (String JP_RequesterName);\n\n\t/** Get Requester Name\t */\n\tpublic String getJP_RequesterName();\n\n /** Column name JP_SalesRep_EMail */\n public static final String COLUMNNAME_JP_SalesRep_EMail = \"JP_SalesRep_EMail\";\n\n\t/** Set Sales Rep(E-Mail)\t */\n\tpublic void setJP_SalesRep_EMail (String JP_SalesRep_EMail);\n\n\t/** Get Sales Rep(E-Mail)\t */\n\tpublic String getJP_SalesRep_EMail();\n\n /** Column name JP_SalesRep_Name */\n public static final String COLUMNNAME_JP_SalesRep_Name = \"JP_SalesRep_Name\";\n\n\t/** Set Sales Rep(Name)\t */\n\tpublic void setJP_SalesRep_Name (String JP_SalesRep_Name);\n\n\t/** Get Sales Rep(Name)\t */\n\tpublic String getJP_SalesRep_Name();\n\n /** Column name JP_SalesRep_Value */\n public static final String COLUMNNAME_JP_SalesRep_Value = \"JP_SalesRep_Value\";\n\n\t/** Set Sales Rep(Search Key)\t */\n\tpublic void setJP_SalesRep_Value (String JP_SalesRep_Value);\n\n\t/** Get Sales Rep(Search Key)\t */\n\tpublic String getJP_SalesRep_Value();\n\n /** Column name Processed */\n public static final String COLUMNNAME_Processed = \"Processed\";\n\n\t/** Set Processed.\n\t * The document has been processed\n\t */\n\tpublic void setProcessed (boolean Processed);\n\n\t/** Get Processed.\n\t * The document has been processed\n\t */\n\tpublic boolean isProcessed();\n\n /** Column name Processing */\n public static final String COLUMNNAME_Processing = \"Processing\";\n\n\t/** Set Process Now\t */\n\tpublic void setProcessing (boolean Processing);\n\n\t/** Get Process Now\t */\n\tpublic boolean isProcessing();\n\n /** Column name RoutingNo */\n public static final String COLUMNNAME_RoutingNo = \"RoutingNo\";\n\n\t/** Set Routing No.\n\t * Bank Routing Number\n\t */\n\tpublic void setRoutingNo (String RoutingNo);\n\n\t/** Get Routing No.\n\t * Bank Routing Number\n\t */\n\tpublic String getRoutingNo();\n\n /** Column name SalesRep_ID */\n public static final String COLUMNNAME_SalesRep_ID = \"SalesRep_ID\";\n\n\t/** Set Sales Rep.\n\t * Sales Representative or Company Agent\n\t */\n\tpublic void setSalesRep_ID (int SalesRep_ID);\n\n\t/** Get Sales Rep.\n\t * Sales Representative or Company Agent\n\t */\n\tpublic int getSalesRep_ID();\n\n\tpublic org.compiere.model.I_AD_User getSalesRep() throws RuntimeException;\n\n /** Column name StatementDate */\n public static final String COLUMNNAME_StatementDate = \"StatementDate\";\n\n\t/** Set Statement date.\n\t * Date of the statement\n\t */\n\tpublic void setStatementDate (Timestamp StatementDate);\n\n\t/** Get Statement date.\n\t * Date of the statement\n\t */\n\tpublic Timestamp getStatementDate();\n\n /** Column name StmtAmt */\n public static final String COLUMNNAME_StmtAmt = \"StmtAmt\";\n\n\t/** Set Statement amount.\n\t * Statement Amount\n\t */\n\tpublic void setStmtAmt (BigDecimal StmtAmt);\n\n\t/** Get Statement amount.\n\t * Statement Amount\n\t */\n\tpublic BigDecimal getStmtAmt();\n\n /** Column name TrxAmt */\n public static final String COLUMNNAME_TrxAmt = \"TrxAmt\";\n\n\t/** Set Transaction Amount.\n\t * Amount of a transaction\n\t */\n\tpublic void setTrxAmt (BigDecimal TrxAmt);\n\n\t/** Get Transaction Amount.\n\t * Amount of a transaction\n\t */\n\tpublic BigDecimal getTrxAmt();\n\n /** Column name Updated */\n public static final String COLUMNNAME_Updated = \"Updated\";\n\n\t/** Get Updated.\n\t * Date this record was updated\n\t */\n\tpublic Timestamp getUpdated();\n\n /** Column name UpdatedBy */\n public static final String COLUMNNAME_UpdatedBy = \"UpdatedBy\";\n\n\t/** Get Updated By.\n\t * User who updated this records\n\t */\n\tpublic int getUpdatedBy();\n}", "Map<String, Object> getAllMetadata();", "public static JasperReportBuilder generateReport(ExportData metaData,HttpServletRequest request){\n session = request.getSession(false);\n report = report(); // Creer le rapport\n \n //Logo\n// logoImg = cmp.image(inImg).setStyle(DynamicReports.stl.style().setHorizontalAlignment(HorizontalAlignment.LEFT)); \n //logoImg.setDimension(80,80); \n \n //Definit le style des colonnes d'entàte\n report.setColumnTitleStyle(getHeaderStyle(metaData));\n \n \n \n LinkedHashMap <String,String> criteria = metaData.getCriteria(); \n //Ajout la date d'àdition au critere d'impression\n String valDateProperty = getDateTxt(metaData.getLang()) ;\n String keyDateProperty = \"\" ;\n if ( session.getAttribute(\"activedLocale\").equals(\"fr\") ) {\n keyDateProperty = \"Edité le \" ;\n }\n else {\n keyDateProperty = \"Printed on \" ;\n }\n criteria.put(keyDateProperty,valDateProperty);\n \n StyleBuilder titleStyle = stl.style(boldStyle).setFontSize(16).setForegroundColor(new Color(0, 0, 0)).setHorizontalAlignment(HorizontalAlignment.RIGHT).setRightIndent(20);\n ComponentBuilder<?, ?> logoComponent = cmp.horizontalList(\n //cmp.image(Templates.class.getResource(\"/logopalm.png\")).setFixedDimension(150, 50).setStyle(stl.style().setLeftIndent(20)),\n cmp.verticalList(\n cmp.text(metaData.getTitle()).setStyle(titleStyle)\n )\n ).newRow()\n .add(cmp.horizontalList().add(cmp.hListCell(createCriteriaComponent(criteria,metaData)).heightFixedOnTop()))\n .newRow(); \n \n report.noData(logoComponent, cmp.text(\"Aucun enregistrement trouvà\").setStyle(stl.style().setHorizontalAlignment(HorizontalAlignment.CENTER).setTopPadding(30)));\n\n \n \n lblStyle = stl.style(Templates.columnStyle).setForegroundColor(new Color(60, 91, 31)); // Couleur du text \n colStyle = stl.style(Templates.columnStyle).setHorizontalAlignment(HorizontalAlignment.CENTER);\n \n groupStyle = stl.style().setForegroundColor(new Color(60, 91, 31)) \n .setBold(Boolean.TRUE)\n .setPadding(5)\n .setFontSize(13)\n .setHorizontalAlignment(HorizontalAlignment.CENTER); \n \n\n \n if(metaData.getTitle().equals(ITitle.PARCEL)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PARCEL_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SECTOR)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SECTOR_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BLOCK)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BLOCK_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ATTACK_PHYTO)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TREATMENT)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TREATMENT_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVEST)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVEST_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SERVICING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SERVICING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_PLANTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_PLANTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.FERTILIZATION)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.FERTILIZATION_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.CONTROL_PHYTO)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.CONTROL_PHYTO_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_FOLDING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_FOLDING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.MORTALITY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.MORTALITY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVESTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVESTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BUDGET)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.REPLACEMENT)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.REPLACEMENT_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.METEOROLOGY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.METEOROLOGY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_MATERIAL)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_MATERIAL_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLUVIOMETRY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLUVIOMETRY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ETP)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ETP_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HYGROMETRY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HYGROMETRY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TEMPERATURE)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TEMPERATURE_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.INSULATION)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.INSULATION_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.WORK)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.WORK_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }\n \n \n drColumns = new HashMap<String, TextColumnBuilder>(); \n groups = new ArrayList<String>();\n subtotals = new ArrayList<String>();\n \n //Definit la liste des colonnes du rapport\n ExportGenerator.getColumns(metaData); \n //Definit la liste des sous-totaux du rapport\n ExportGenerator.getSubTotals(metaData);\n \n \n //Genration des sous totaux\n for (String group : groups) {\n ColumnGroupBuilder group2 = grp.group(drColumns.get(group));\n report.groupBy(group2);\n for (String subtotal : subtotals) {\n report.subtotalsAtGroupFooter(group2,sbt.sum(drColumns.get(subtotal)));\n }\n }\n\n for (String subtotal : subtotals) {\n report.subtotalsAtSummary(sbt.sum(drColumns.get(subtotal))); \n }\n \n /*if(ExportGenerator.getColumnByNameField(\"plantingName\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL \"), ExportGenerator.getColumnByNameField(\"plantingName\"), Calculation.NOTHING));\n }*//*else if(ExportGenerator.getColumnByNameField(\"invoiceCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"invoiceCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"planterCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL\"), ExportGenerator.getColumnByNameField(\"planterCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"transportTicket\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"transportTicket\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"deliveryDate\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"deliveryDate\"), Calculation.NOTHING));\n }\n else if(ExportGenerator.getColumnByNameField(\"arroundPlantingTicketNumber\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"arroundPlantingTicketNumber\"), Calculation.NOTHING));\n }\n else if(ExportGenerator.getColumnByNameField(\"planterNumber\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"planterNumber\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"startPaymentDate\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"startPaymentDate\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"sectorCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"sectorCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"month\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL \"), ExportGenerator.getColumnByNameField(\"month\"), Calculation.NOTHING));\n }*/\n \n\n \n \n //Genere la source de donnàes du rapport\n report.setDataSource(metaData.getData());\n \n report.highlightDetailEvenRows(); \n \n \n // Definition de l'entete : valable uniquement pour la 1ere page\n HorizontalListBuilder hlb= null;\n \n hlb = cmp.horizontalList().add(\n cmp.hListCell(createCriteriaComponent(criteria,metaData)).heightFixedOnTop()\n );\n\n \n report.title(\n createCustomTitleComponent(metaData.getTitle()), // Titre\n hlb,// Liste Horizontal des Critàres \n cmp.verticalGap(12) // Marge de 12 px entre chaque critàre\n ); \n \n \n \n report.setPageMargin(DynamicReports.margin().setLeft(15).setTop(30).setRight(15).setBottom(30));\n report.setPageFormat(PageType.A3, PageOrientation.LANDSCAPE);\n report.pageFooter(DynamicReports.cmp.pageXslashY());\n return report;\n \n }", "public interface IReportDao extends IBaseDao<Report, Integer> {\n\t\n\t/**\n\t * 添加举报信息\n\t * @param report\n\t */\n\tpublic boolean addReport(Report report);\n\t\n\t/**\n\t * 修改举报信息\n\t * @param report\n\t * @return\n\t */\n\tpublic boolean updateReport(Report report);\n\t\n//\t/**\n//\t * 是否已经举报\n//\t * @param getReportGto\n//\t * @return\n//\t */\n//\tpublic boolean isHouseInfoReported(GetReportGto getReportGto);\n\t\n\t/**\n\t * 获取我与某条房源的举报信息\n\t * @param getReportGto\n\t * @return\n\t */\n\tpublic List<Report> getMyReport(GetReportGto getReportGto);\n}", "public interface TableDetailMapper {\n\n @Select(\"select * from dxh_sys.tabledetail where vendorId=0 and tableName='skuProfitDayReport'\")\n List<Map<String, Object>> list();\n\n}", "public Report getReport();", "BoltResultSetMetaData(List<Type> types, List<String> keys) {\n\t\tsuper(keys);\n\t\tthis.columnType = types.toArray(new Type[this.keys.size() + 1]);\n\n\t\t// we init columnType with the first record\n\t\t// in case first == last record\n\t\t/*for (int i = 1; i <= this.keys.size(); i++) {\n\t\t\tcolumnType[i] = this.getColumnDriverTypeOrDefault(i, InternalTypeSystem.TYPE_SYSTEM.STRING());\n\t\t}*/\n\t}", "@Override\r\n\tpublic Map<String, Object> getMetadata() {\n\t\treturn null;\r\n\t}", "@Select({\n \"select\",\n \"JNLNO, TRANDATE, ACCOUNTDATE, CHECKTYPE, STATUS, DONETIME, FILENAME\",\n \"from B_UMB_CHECKING_LOG\",\n \"where JNLNO = #{jnlno,jdbcType=VARCHAR}\"\n })\n @Results({\n @Result(column=\"JNLNO\", property=\"jnlno\", jdbcType=JdbcType.VARCHAR, id=true),\n @Result(column=\"TRANDATE\", property=\"trandate\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"ACCOUNTDATE\", property=\"accountdate\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"CHECKTYPE\", property=\"checktype\", jdbcType=JdbcType.CHAR),\n @Result(column=\"STATUS\", property=\"status\", jdbcType=JdbcType.CHAR),\n @Result(column=\"DONETIME\", property=\"donetime\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"FILENAME\", property=\"filename\", jdbcType=JdbcType.VARCHAR)\n })\n BUMBCheckingLog selectByPrimaryKey(BUMBCheckingLogKey key);", "@SqlQuery(\"select * from PLAYERSTATS\")\n List<PlayerStats> getAll();", "protected String getMetadataName() {\r\n\t\treturn METADATA_NAME;\r\n\t}", "public abstract String getSummaryForDatabase();", "private interface ReportColumnCallback\n {\n void handleReportColumn(DashboardReport report, String columnName) throws MojoExecutionException;\n }", "public ReportMetadataExample() {\n\t\toredCriteria = new ArrayList<Criteria>();\n\t}", "@Override\r\n \tpublic MetaData getMetaData(HttpHeaders headers) {\n \t\ttry {\r\n \t\t\treturn MetaDataUtil.getMetaData(new ViewListeEleve(), new HashMap<String, MetaData>(),new ArrayList<String>());\r\n \t\t} catch (Exception e) {\r\n \t\t\t// TODO Auto-generated catch block\r\n \t\t\tthrow new WebApplicationException(Response.serverError().entity(new String(\"MetaData parse error\")).build());\r\n \t\t} \r\n \t}", "public DefaultMetaData getMetaData() {\n\t\treturn this.metaData;\n\t}", "Report createReport();", "@Override\n public Map<String, String> createFieldToPropertyMapping() {\n final Map<String, String> mapping = super.createFieldToPropertyMapping();\n mapping.put(this.tableName + \".rsres_id\", \"id\");\n mapping.put(this.tableName + \".resource_id\", \"resourceId\");\n mapping.put(this.tableName + \".quantity\", QUANTITY);\n mapping.put(this.tableName + \".cost_rsres\", \"cost\");\n\n return mapping;\n }", "public String getReportsToBeGenerated(String reportType) {\r\n\t\tString query = \"\";\r\n\t\t\r\n\t\ttry (Connection connection = DatabaseConnection.getMySQLConnection();\r\n\t\t\t PreparedStatement stmt = connection.prepareStatement(query);) {\r\n\t\t\tResultSet result = stmt.executeQuery();\r\n\t\t\tStringJoiner reports = new StringJoiner(\",,\");\r\n\t\t\twhile (result.next()) {\r\n\t\t\t\treports.add(result.getString(\"REPORT_NAME\"));\r\n\t\t\t}\r\n\t\t\treturn reports.toString();\r\n\t\t} catch (SQLException e) {\r\n\t\t\tthrow new ReportGenerationException(\"An error occurred while retrieving reports to be generated.\", e);\r\n\t\t}\r\n\t}", "public String getMetaDataFileName() {\n return null;\n }", "public JDBCRawSqlQueryMetaData(Method method) {\n this.method = method;\n }", "public Map getMetadata() {\n return metadata;\n }", "public DatabaseMetaData(Statement s) {\n\t\t_stmt = s; // SQL-Connection\n\t\t_buffer = new StringBuffer(); // Output goes here\n\t\t_tables = new ArrayList<String>(); // List of tables\n\t\t\n\t\ttry {\n\t\t\t// Put table names in `_tables`\n\t\t\textractTableNames(_stmt.executeQuery(composeTableNamesQuery()));\n\n\t\t\t// fetch the string representation of each tables meta-data\n\t\t\tfor (String name : _tables)\n\t\t\t\t_buffer.append(new TableMeta(name)); \n\t\t} catch (SQLException e) { _error = true;}\n\t}", "private Builder() {\n super(net.explorys.samhat.z12.r837.X837Ins_2320_MOA_MedicareOutpatientAdjudicationInformation.SCHEMA$);\n }", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "public String toString() {\n return \"[JDBCRawSqlQueryMetaData : method=\" + method + \"]\";\n }", "Report selectByPrimaryKey(Integer id);", "java.lang.String getMetadata(int index);", "java.lang.String getMetadata(int index);", "public Integer getReportId() {\n return reportId;\n }", "@Schema(description = \"`status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Code general-info: The type of external report available \")\n public String getAssessmentInstanceReportType() {\n return assessmentInstanceReportType;\n }", "@Override\r\n\tpublic List<ReportAndSummary> findAll() {\n\t\tList<ReportAndSummary> result = reportAndSummaryDao.findAll();\r\n\t\treturn result;\r\n\t}", "private static Map<String, ColumnMetaData> buildColumnMetadataMap(ResultSet rs) {\n\t\t/*\n\t\t * LinkedHashmap to preserve key traversal order.\n\t\t * Important as we output rows as arrays of values where the index position in\n\t\t * the row implicitly corresponds to the entry order of the column map.\n\t\t * Reason for this is performance. \n\t\t */\n\t\tMap<String, ColumnMetaData> columnMap = Maps.newLinkedHashMap();\n\t\ttry {\n\t\t\tResultSetMetaData rmd = rs.getMetaData();\n\t\t\tfor (int i=1; i<= rmd.getColumnCount(); i++) {\n\t\t\t\tColumnMetaData cmd = \n\t\t\t\t\tnew ColumnMetaData(rmd.getColumnName(i), rmd.getColumnTypeName(i));\n\t\t\t\tcolumnMap.put(cmd.columnName, cmd);\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\tThrowables.propagate(e);\n\t\t}\n\t\treturn columnMap;\n\t}", "protected String getSqlTable() {\n\t\treturn \"Project\";\n\t}", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "public interface I_IHC_JobDataChange \n{\n\n /** TableName=IHC_JobDataChange */\n public static final String Table_Name = \"IHC_JobDataChange\";\n\n /** AD_Table_ID=1100135 */\n public static final int Table_ID = MTable.getTable_ID(Table_Name);\n\n KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);\n\n /** AccessLevel = 3 - Client - Org \n */\n BigDecimal accessLevel = BigDecimal.valueOf(3);\n\n /** Load Meta Data */\n\n /** Column name AD_Client_ID */\n public static final String COLUMNNAME_AD_Client_ID = \"AD_Client_ID\";\n\n\t/** Get Client.\n\t * Client/Tenant for this installation.\n\t */\n\tpublic int getAD_Client_ID();\n\n /** Column name AD_Org_ID */\n public static final String COLUMNNAME_AD_Org_ID = \"AD_Org_ID\";\n\n\t/** Set Organization.\n\t * Organizational entity within client\n\t */\n\tpublic void setAD_Org_ID (int AD_Org_ID);\n\n\t/** Get Organization.\n\t * Organizational entity within client\n\t */\n\tpublic int getAD_Org_ID();\n\n /** Column name BPJSRegistrationDate */\n public static final String COLUMNNAME_BPJSRegistrationDate = \"BPJSRegistrationDate\";\n\n\t/** Set BPJS Registration Date\t */\n\tpublic void setBPJSRegistrationDate (Timestamp BPJSRegistrationDate);\n\n\t/** Get BPJS Registration Date\t */\n\tpublic Timestamp getBPJSRegistrationDate();\n\n /** Column name Created */\n public static final String COLUMNNAME_Created = \"Created\";\n\n\t/** Get Created.\n\t * Date this record was created\n\t */\n\tpublic Timestamp getCreated();\n\n /** Column name CreatedBy */\n public static final String COLUMNNAME_CreatedBy = \"CreatedBy\";\n\n\t/** Get Created By.\n\t * User who created this records\n\t */\n\tpublic int getCreatedBy();\n\n /** Column name Description */\n public static final String COLUMNNAME_Description = \"Description\";\n\n\t/** Set Description.\n\t * Optional short description of the record\n\t */\n\tpublic void setDescription (String Description);\n\n\t/** Get Description.\n\t * Optional short description of the record\n\t */\n\tpublic String getDescription();\n\n /** Column name DescriptionNew */\n public static final String COLUMNNAME_DescriptionNew = \"DescriptionNew\";\n\n\t/** Set Description New\t */\n\tpublic void setDescriptionNew (String DescriptionNew);\n\n\t/** Get Description New\t */\n\tpublic String getDescriptionNew();\n\n /** Column name HC_Compensation1 */\n public static final String COLUMNNAME_HC_Compensation1 = \"HC_Compensation1\";\n\n\t/** Set Compensation 1\t */\n\tpublic void setHC_Compensation1 (BigDecimal HC_Compensation1);\n\n\t/** Get Compensation 1\t */\n\tpublic BigDecimal getHC_Compensation1();\n\n /** Column name HC_Compensation2 */\n public static final String COLUMNNAME_HC_Compensation2 = \"HC_Compensation2\";\n\n\t/** Set Compensation 2\t */\n\tpublic void setHC_Compensation2 (BigDecimal HC_Compensation2);\n\n\t/** Get Compensation 2\t */\n\tpublic BigDecimal getHC_Compensation2();\n\n /** Column name HC_Compensation3 */\n public static final String COLUMNNAME_HC_Compensation3 = \"HC_Compensation3\";\n\n\t/** Set Compensation 3\t */\n\tpublic void setHC_Compensation3 (BigDecimal HC_Compensation3);\n\n\t/** Get Compensation 3\t */\n\tpublic BigDecimal getHC_Compensation3();\n\n /** Column name HC_Compensation4 */\n public static final String COLUMNNAME_HC_Compensation4 = \"HC_Compensation4\";\n\n\t/** Set Compensation 4\t */\n\tpublic void setHC_Compensation4 (BigDecimal HC_Compensation4);\n\n\t/** Get Compensation 4\t */\n\tpublic BigDecimal getHC_Compensation4();\n\n /** Column name HC_EffectiveSeq */\n public static final String COLUMNNAME_HC_EffectiveSeq = \"HC_EffectiveSeq\";\n\n\t/** Set Effective Sequence\t */\n\tpublic void setHC_EffectiveSeq (int HC_EffectiveSeq);\n\n\t/** Get Effective Sequence\t */\n\tpublic int getHC_EffectiveSeq();\n\n /** Column name HC_Employee_ID */\n public static final String COLUMNNAME_HC_Employee_ID = \"HC_Employee_ID\";\n\n\t/** Set Employee Data\t */\n\tpublic void setHC_Employee_ID (int HC_Employee_ID);\n\n\t/** Get Employee Data\t */\n\tpublic int getHC_Employee_ID();\n\n\tpublic I_HC_Employee getHC_Employee() throws RuntimeException;\n\n /** Column name HC_EmployeeGrade_ID */\n public static final String COLUMNNAME_HC_EmployeeGrade_ID = \"HC_EmployeeGrade_ID\";\n\n\t/** Set Employee Grade\t */\n\tpublic void setHC_EmployeeGrade_ID (int HC_EmployeeGrade_ID);\n\n\t/** Get Employee Grade\t */\n\tpublic int getHC_EmployeeGrade_ID();\n\n\tpublic I_HC_EmployeeGrade getHC_EmployeeGrade() throws RuntimeException;\n\n /** Column name HC_EmployeeGrade2_ID */\n public static final String COLUMNNAME_HC_EmployeeGrade2_ID = \"HC_EmployeeGrade2_ID\";\n\n\t/** Set Employee Grade To\t */\n\tpublic void setHC_EmployeeGrade2_ID (int HC_EmployeeGrade2_ID);\n\n\t/** Get Employee Grade To\t */\n\tpublic int getHC_EmployeeGrade2_ID();\n\n\tpublic I_HC_EmployeeGrade getHC_EmployeeGrade2() throws RuntimeException;\n\n /** Column name HC_EmployeeJob_ID */\n public static final String COLUMNNAME_HC_EmployeeJob_ID = \"HC_EmployeeJob_ID\";\n\n\t/** Set Employee Job Data\t */\n\tpublic void setHC_EmployeeJob_ID (int HC_EmployeeJob_ID);\n\n\t/** Get Employee Job Data\t */\n\tpublic int getHC_EmployeeJob_ID();\n\n\tpublic I_HC_EmployeeJob getHC_EmployeeJob() throws RuntimeException;\n\n /** Column name HC_Job_ID */\n public static final String COLUMNNAME_HC_Job_ID = \"HC_Job_ID\";\n\n\t/** Set Job\t */\n\tpublic void setHC_Job_ID (int HC_Job_ID);\n\n\t/** Get Job\t */\n\tpublic int getHC_Job_ID();\n\n\tpublic I_HC_Job getHC_Job() throws RuntimeException;\n\n /** Column name HC_JobAction */\n public static final String COLUMNNAME_HC_JobAction = \"HC_JobAction\";\n\n\t/** Set Job Action\t */\n\tpublic void setHC_JobAction (String HC_JobAction);\n\n\t/** Get Job Action\t */\n\tpublic String getHC_JobAction();\n\n /** Column name HC_JobDataChange_ID */\n public static final String COLUMNNAME_HC_JobDataChange_ID = \"HC_JobDataChange_ID\";\n\n\t/** Set Job Data Change\t */\n\tpublic void setHC_JobDataChange_ID (int HC_JobDataChange_ID);\n\n\t/** Get Job Data Change\t */\n\tpublic int getHC_JobDataChange_ID();\n\n\tpublic I_HC_JobDataChange getHC_JobDataChange() throws RuntimeException;\n\n /** Column name HC_Manager_ID */\n public static final String COLUMNNAME_HC_Manager_ID = \"HC_Manager_ID\";\n\n\t/** Set Manager Name\t */\n\tpublic void setHC_Manager_ID (int HC_Manager_ID);\n\n\t/** Get Manager Name\t */\n\tpublic int getHC_Manager_ID();\n\n\tpublic I_HC_Employee getHC_Manager() throws RuntimeException;\n\n /** Column name HC_ManagerTo_ID */\n public static final String COLUMNNAME_HC_ManagerTo_ID = \"HC_ManagerTo_ID\";\n\n\t/** Set Manager To ID\t */\n\tpublic void setHC_ManagerTo_ID (int HC_ManagerTo_ID);\n\n\t/** Get Manager To ID\t */\n\tpublic int getHC_ManagerTo_ID();\n\n\tpublic I_HC_Employee getHC_ManagerTo() throws RuntimeException;\n\n /** Column name HC_Org_ID */\n public static final String COLUMNNAME_HC_Org_ID = \"HC_Org_ID\";\n\n\t/** Set HC Organization\t */\n\tpublic void setHC_Org_ID (int HC_Org_ID);\n\n\t/** Get HC Organization\t */\n\tpublic int getHC_Org_ID();\n\n\tpublic I_HC_Org getHC_Org() throws RuntimeException;\n\n /** Column name HC_Org2_ID */\n public static final String COLUMNNAME_HC_Org2_ID = \"HC_Org2_ID\";\n\n\t/** Set HC Organization To\t */\n\tpublic void setHC_Org2_ID (int HC_Org2_ID);\n\n\t/** Get HC Organization To\t */\n\tpublic int getHC_Org2_ID();\n\n\tpublic I_HC_Org getHC_Org2() throws RuntimeException;\n\n /** Column name HC_PayGroup_ID */\n public static final String COLUMNNAME_HC_PayGroup_ID = \"HC_PayGroup_ID\";\n\n\t/** Set Payroll Group\t */\n\tpublic void setHC_PayGroup_ID (int HC_PayGroup_ID);\n\n\t/** Get Payroll Group\t */\n\tpublic int getHC_PayGroup_ID();\n\n\tpublic I_HC_PayGroup getHC_PayGroup() throws RuntimeException;\n\n /** Column name HC_PreviousJob_ID */\n public static final String COLUMNNAME_HC_PreviousJob_ID = \"HC_PreviousJob_ID\";\n\n\t/** Set Job Sekarang\t */\n\tpublic void setHC_PreviousJob_ID (int HC_PreviousJob_ID);\n\n\t/** Get Job Sekarang\t */\n\tpublic int getHC_PreviousJob_ID();\n\n\tpublic I_HC_Job getHC_PreviousJob() throws RuntimeException;\n\n /** Column name HC_Reason_ID */\n public static final String COLUMNNAME_HC_Reason_ID = \"HC_Reason_ID\";\n\n\t/** Set HC Reason\t */\n\tpublic void setHC_Reason_ID (int HC_Reason_ID);\n\n\t/** Get HC Reason\t */\n\tpublic int getHC_Reason_ID();\n\n\tpublic I_HC_Reason getHC_Reason() throws RuntimeException;\n\n /** Column name HC_Status */\n public static final String COLUMNNAME_HC_Status = \"HC_Status\";\n\n\t/** Set HC Status\t */\n\tpublic void setHC_Status (String HC_Status);\n\n\t/** Get HC Status\t */\n\tpublic String getHC_Status();\n\n /** Column name HC_WorkEndDate */\n public static final String COLUMNNAME_HC_WorkEndDate = \"HC_WorkEndDate\";\n\n\t/** Set Work End Date\t */\n\tpublic void setHC_WorkEndDate (Timestamp HC_WorkEndDate);\n\n\t/** Get Work End Date\t */\n\tpublic Timestamp getHC_WorkEndDate();\n\n /** Column name HC_WorkPeriodDate */\n public static final String COLUMNNAME_HC_WorkPeriodDate = \"HC_WorkPeriodDate\";\n\n\t/** Set WorkPeriodDate\t */\n\tpublic void setHC_WorkPeriodDate (String HC_WorkPeriodDate);\n\n\t/** Get WorkPeriodDate\t */\n\tpublic String getHC_WorkPeriodDate();\n\n /** Column name HC_WorkStartDate */\n public static final String COLUMNNAME_HC_WorkStartDate = \"HC_WorkStartDate\";\n\n\t/** Set WorkStartDate\t */\n\tpublic void setHC_WorkStartDate (Timestamp HC_WorkStartDate);\n\n\t/** Get WorkStartDate\t */\n\tpublic Timestamp getHC_WorkStartDate();\n\n /** Column name HC_WorkStartDate2 */\n public static final String COLUMNNAME_HC_WorkStartDate2 = \"HC_WorkStartDate2\";\n\n\t/** Set Work Start Date Baru\t */\n\tpublic void setHC_WorkStartDate2 (Timestamp HC_WorkStartDate2);\n\n\t/** Get Work Start Date Baru\t */\n\tpublic Timestamp getHC_WorkStartDate2();\n\n /** Column name IHC_JobDataChange_ID */\n public static final String COLUMNNAME_IHC_JobDataChange_ID = \"IHC_JobDataChange_ID\";\n\n\t/** Set IHC_JobDayaChange\t */\n\tpublic void setIHC_JobDataChange_ID (int IHC_JobDataChange_ID);\n\n\t/** Get IHC_JobDayaChange\t */\n\tpublic int getIHC_JobDataChange_ID();\n\n /** Column name IHC_JobDataChange_UU */\n public static final String COLUMNNAME_IHC_JobDataChange_UU = \"IHC_JobDataChange_UU\";\n\n\t/** Set IHC_JobDataChange_UU\t */\n\tpublic void setIHC_JobDataChange_UU (String IHC_JobDataChange_UU);\n\n\t/** Get IHC_JobDataChange_UU\t */\n\tpublic String getIHC_JobDataChange_UU();\n\n /** Column name IsActive */\n public static final String COLUMNNAME_IsActive = \"IsActive\";\n\n\t/** Set Active.\n\t * The record is active in the system\n\t */\n\tpublic void setIsActive (boolean IsActive);\n\n\t/** Get Active.\n\t * The record is active in the system\n\t */\n\tpublic boolean isActive();\n\n /** Column name IsCancelled */\n public static final String COLUMNNAME_IsCancelled = \"IsCancelled\";\n\n\t/** Set Cancelled.\n\t * The transaction was cancelled\n\t */\n\tpublic void setIsCancelled (boolean IsCancelled);\n\n\t/** Get Cancelled.\n\t * The transaction was cancelled\n\t */\n\tpublic boolean isCancelled();\n\n /** Column name NomorSK */\n public static final String COLUMNNAME_NomorSK = \"NomorSK\";\n\n\t/** Set Nomor SK\t */\n\tpublic void setNomorSK (String NomorSK);\n\n\t/** Get Nomor SK\t */\n\tpublic String getNomorSK();\n\n /** Column name NomorSK2 */\n public static final String COLUMNNAME_NomorSK2 = \"NomorSK2\";\n\n\t/** Set Nomor SK Baru\t */\n\tpublic void setNomorSK2 (String NomorSK2);\n\n\t/** Get Nomor SK Baru\t */\n\tpublic String getNomorSK2();\n\n /** Column name OriginalServiceData */\n public static final String COLUMNNAME_OriginalServiceData = \"OriginalServiceData\";\n\n\t/** Set Original Service Date\t */\n\tpublic void setOriginalServiceData (Timestamp OriginalServiceData);\n\n\t/** Get Original Service Date\t */\n\tpublic Timestamp getOriginalServiceData();\n\n /** Column name Processed */\n public static final String COLUMNNAME_Processed = \"Processed\";\n\n\t/** Set Processed.\n\t * The document has been processed\n\t */\n\tpublic void setProcessed (boolean Processed);\n\n\t/** Get Processed.\n\t * The document has been processed\n\t */\n\tpublic boolean isProcessed();\n\n /** Column name SeqNo */\n public static final String COLUMNNAME_SeqNo = \"SeqNo\";\n\n\t/** Set Sequence.\n\t * Method of ordering records;\n lowest number comes first\n\t */\n\tpublic void setSeqNo (int SeqNo);\n\n\t/** Get Sequence.\n\t * Method of ordering records;\n lowest number comes first\n\t */\n\tpublic int getSeqNo();\n\n /** Column name Updated */\n public static final String COLUMNNAME_Updated = \"Updated\";\n\n\t/** Get Updated.\n\t * Date this record was updated\n\t */\n\tpublic Timestamp getUpdated();\n\n /** Column name UpdatedBy */\n public static final String COLUMNNAME_UpdatedBy = \"UpdatedBy\";\n\n\t/** Get Updated By.\n\t * User who updated this records\n\t */\n\tpublic int getUpdatedBy();\n}" ]
[ "0.720387", "0.60612166", "0.5897073", "0.5817371", "0.58169", "0.5653088", "0.5575094", "0.5565293", "0.5523116", "0.55214834", "0.5424825", "0.5421459", "0.5377486", "0.534678", "0.5342339", "0.53190213", "0.5239825", "0.5236659", "0.5227619", "0.513109", "0.5122094", "0.5114957", "0.5110571", "0.5092275", "0.50793064", "0.50710756", "0.50666755", "0.50432736", "0.50225407", "0.5009165", "0.5007035", "0.49747992", "0.49714422", "0.49305487", "0.4928956", "0.49114767", "0.49047396", "0.4894513", "0.488628", "0.48804012", "0.48787948", "0.4848689", "0.4836264", "0.4834436", "0.48120287", "0.4810927", "0.4800393", "0.4796319", "0.4796208", "0.47960824", "0.47906667", "0.4782785", "0.47692993", "0.47681826", "0.47613847", "0.47506967", "0.4746286", "0.47449973", "0.4743577", "0.47416592", "0.47313273", "0.47236001", "0.47218567", "0.47168458", "0.47161394", "0.47148344", "0.47092924", "0.47078082", "0.4703429", "0.46990865", "0.46964943", "0.46792674", "0.4675461", "0.4675461", "0.4675461", "0.4675461", "0.4675461", "0.46668383", "0.4666713", "0.46600732", "0.46600732", "0.4655324", "0.46417722", "0.46361163", "0.46348158", "0.46313247", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.4627627" ]
0.0
-1
This method was generated by MyBatis Generator. This method corresponds to the database table core.report_metadata
public void or(Criteria criteria) { oredCriteria.add(criteria); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "TableReportMetadata getReportMetadata(String reportId);", "public abstract List<ColumnSpecification> metadata();", "@Override\r\n\t\tpublic DatabaseMetaData getMetaData() throws SQLException {\n\t\t\treturn null;\r\n\t\t}", "@Override\n\tpublic JDBCMetaData getMetaData() throws SQLException {\n\t\treturn null;\n\t}", "private void writeMetaData(ResultSet resultSet) throws SQLException {\n\t System.out.println(\"The columns in the table are: \");\r\n\t System.out.println(\"Table: \" + resultSet.getMetaData().getTableName(1));\r\n\t for (int i = 1; i<= resultSet.getMetaData().getColumnCount(); i++){\r\n\t System.out.println(\"Column \" +i + \" \"+ resultSet.getMetaData().getColumnName(i));\r\n\t }\r\n\t }", "public interface TableMetaData {\n\n\t/** Adds normal column. */\n\tpublic void addColumn(final ColumnMetaData column);\n\n\t/** Adds primary key column. */\n\tpublic void addPrimaryKey(final ColumnMetaData column);\n\n\t/** Returns map of column meta data, keyed by the column label (the alias if provided in the query, otherwise the name). */\n\tpublic Map<String, ColumnMetaData> getColumns();\n\n\t/** Returns database name. */\n\tpublic String getDatabaseName();\n\n\t/** Returns ordered list of columns that are primary keys. */\n\tpublic List<ColumnMetaData> getPrimaryKeys();\n\n\t/**\n\t * Returns fully qualified table name in database-specific form for use in SQL statements. MySQL uses the form\n\t * <code>database.table</code>, for example <code>sakila.film</code>. PostgreSQL uses the form\n\t * <code>database.schema.table</code>, for example <code>sakila.public.film</code>.\n\t */\n\tpublic String getQualifiedTableName();\n\n\t/** Returns row alias. */\n\tpublic String getRowAlias();\n\t\n\t/** Returns row set alias. */\n\tpublic String getRowSetAlias();\n\t\n\t/**\n\t * Returns row alias.\n\t * \n * @deprecated As of 0.8.11 use {@link #getRowAlias()}\n\t */\n\t@Deprecated\n\tpublic String getTableAlias();\n\n\t/** Returns table name. */\n\tpublic String getTableName();\n\n\t/** Returns role of table in the SQL Resource. */\n\tpublic TableRole getTableRole();\n\n\t/** Returns true if the SQL Resource role is child. */\n\tpublic boolean isChild();\n\n\t/** Returns true if the SQL Resource role is parent. */\n\tpublic boolean isParent();\n\n\t/** Sets all the row and row set aliases. */\n\tpublic void setAliases(final String alias, final String rowAlias, final String rowSetAlias);\n\n\t/** Sets attributes. */\n\tpublic void setAttributes(final String tableName, final String qualifedTableName,\n\t\t\tfinal String databaseName, final TableRole tableRole);\n\n\t/**\n\t * Sets table alias.\n\t * \n * @deprecated As of 0.8.11 use {@link #setAliases(String, String, String)}\n\t */\n\t@Deprecated\n\tpublic void setTableAlias(final String tableAlias);\n\t\n\t/** Represents all of the roles a table may plan in a SQL Resource. */\n\t@XmlType(namespace = \"http://restsql.org/schema\")\n\tpublic enum TableRole {\n\t\tChild, ChildExtension, Join, Parent, ParentExtension, Unknown;\n\t}\n}", "public abstract List<String> newReportColumns();", "ResultSetMetaData getMetaData() throws SQLException;", "public DBMetaDataSet getMetaData()\n\t{\n\t\treturn _MetaData;\n\t}", "public interface SqlResourceMetaData {\r\n\r\n\tpublic List<ColumnMetaData> getAllReadColumns();\r\n\r\n\tpublic TableMetaData getChild();\r\n\r\n\tpublic List<TableMetaData> getChildPlusExtTables();\r\n\r\n\tpublic List<ColumnMetaData> getChildReadColumns();\r\n\r\n\tpublic TableMetaData getJoin();\r\n\r\n\tpublic List<TableMetaData> getJoinList();\r\n\r\n\tpublic int getNumberTables();\r\n\r\n\tpublic TableMetaData getParent();\r\n\r\n\tpublic List<TableMetaData> getParentPlusExtTables();\r\n\r\n\tpublic List<ColumnMetaData> getParentReadColumns();\r\n\r\n\tpublic Map<String, TableMetaData> getTableMap();\r\n\r\n\tpublic List<TableMetaData> getTables();\r\n\r\n\tpublic List<TableMetaData> getWriteTables(final Type requestType, final boolean doParent);\r\n\r\n\tpublic boolean hasJoinTable();\r\n\r\n\tpublic boolean hasMultipleDatabases();\r\n\r\n\tpublic boolean isHierarchical();\r\n\r\n\tpublic void init(final String sqlResourceName, final SqlResourceDefinition definition, final SqlBuilder sqlBuilder)\r\n\t\t\tthrows SqlResourceException;\r\n\r\n\tpublic String toHtml();\r\n\r\n\tpublic String toXml();\r\n}", "public void addColumnPathReportId() {\n addColumnInPath(ColumnMetaData.KEY_PATH_ID);\n }", "public ResultSetMetaData getMetaData() throws SQLException {\n\n try {\n int id = getNextId(TraceObject.RESULT_SET_META_DATA);\n if (isDebugEnabled()) {\n debugCodeAssign(\"ResultSetMetaData\", TraceObject.RESULT_SET_META_DATA, id, \"getMetaData()\");\n }\n checkClosed();\n String catalog = conn.getCatalog();\n JdbcResultSetMetaData meta = new JdbcResultSetMetaData(this, null, result, catalog, conn.getSession().getTrace(), id);\n return meta;\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "public MetaData getMetaData();", "@Override\n public DatabaseMetaData getMetaData() throws SQLException\n {\n logger.debug(\n \" public DatabaseMetaData getMetaData() throws SQLException\");\n\n return new SnowflakeDatabaseMetaData(this);\n }", "public DataSetMetaData getMetaData() {\n return this.metadata;\n }", "@Test\n public void metaDataExample1() throws SQLException {\n Connection connection = DriverManager.getConnection(dbUrl, dbUsername, dbPassword);\n // 2. Create statement\n Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);\n // Run sql query and get the result in resultSet object\n String sqlQuery= \"Select * From departments\";\n //String sqlQuery= \"Select first_name, last_name, salary From employees\";\n ResultSet resultSet = statement.executeQuery(sqlQuery);\n\n // we use resultSet metadata to get information about the tables\n // get the resultSet object metadata\n ResultSetMetaData rsMetadata = resultSet.getMetaData();\n\n // List for keeping all rows as a map\n List<Map<String, Object>> queryData = new ArrayList<>();\n\n // while(resultSet.next()) helps to iterate through columns\n while (resultSet.next()) {\n // key(columns) will be string but value can be any type of data. That's why we choose <String, Object>\n Map<String, Object> row = new HashMap<>(); // creating empty Map\n // number of columns\n int colCount = rsMetadata.getColumnCount();\n // for loop helps to iterate through columns\n for (int i = 1; i <= colCount; i++) {\n row.put(rsMetadata.getColumnName(i), resultSet.getObject(i));\n }\n\n queryData.add(row); // adding a Map to the List of Maps\n }\n\n // Printing the rows\n for (Map<String, Object> row: queryData) {\n System.out.println(row.toString());\n\n }\n\n\n\n\n // close all connections\n resultSet.close();\n statement.close();\n connection.close();\n }", "@Override\n\tpublic DBMetadata getMetadata() {\n\t\treturn null;\n\t}", "public MetaData getMetaData() {\r\n \treturn metaData;\r\n }", "@Override\n public SystemMetadata mapRow(ResultSet resultSet, int rowNumber) throws SQLException {\n\n // resultSet contains guid, serialVersion, date_modified, and archived column data\n SystemMetadata systemMetadata = new SystemMetadata();\n ReplicationPolicy replPolicy = new ReplicationPolicy();\n AccessPolicy accessPolicy = new AccessPolicy();\n\n // add guid\n Identifier pid = new Identifier();\n pid.setValue(resultSet.getString(\"guid\"));\n systemMetadata.setIdentifier(pid);\n \n // add seriesId\n Identifier seriesId = new Identifier();\n seriesId.setValue(resultSet.getString(\"series_id\"));\n systemMetadata.setSeriesId(seriesId);\n\n // add serialVersion\n BigInteger serialVersion = new BigInteger(resultSet.getString(\"serial_version\"));\n systemMetadata.setSerialVersion(serialVersion);\n\n // add date_modified\n Date dateSystemMetadataLastModified = resultSet.getTimestamp(\"date_modified\");\n systemMetadata.setDateSysMetadataModified(dateSystemMetadataLastModified);\n\n // add archived value, if it was stored\n boolean archived = resultSet.getBoolean(\"archived\"); // getBoolean returns false for null results\n if (!resultSet.wasNull())\n systemMetadata.setArchived(new Boolean(archived));\n\n // add date_uploaded\n Date dateUploaded = resultSet.getTimestamp(\"date_uploaded\");\n systemMetadata.setDateUploaded(dateUploaded);\n\n // add rights_holder\n Subject rightsHolderSubject = new Subject();\n String rightsHolder = resultSet.getString(\"rights_holder\");\n rightsHolderSubject.setValue(rightsHolder);\n systemMetadata.setRightsHolder(rightsHolderSubject);\n\n // add checksum, checksum_algorithm\n String checksum = resultSet.getString(\"checksum\");\n String checksumAlgorithm = resultSet.getString(\"checksum_algorithm\");\n Checksum checksumObject = new Checksum();\n checksumObject.setValue(checksum);\n checksumObject.setAlgorithm(checksumAlgorithm);\n systemMetadata.setChecksum(checksumObject);\n\n // add origin_member_node\n String originMemberNode = resultSet.getString(\"origin_member_node\");\n if (originMemberNode != null) {\n NodeReference omn = new NodeReference();\n omn.setValue(originMemberNode);\n systemMetadata.setOriginMemberNode(omn);\n }\n\n // add authoritive_member_node\n String authoritativeMemberNode = resultSet.getString(\"authoritive_member_node\");\n if (originMemberNode != null) {\n NodeReference amn = new NodeReference();\n amn.setValue(authoritativeMemberNode);\n systemMetadata.setAuthoritativeMemberNode(amn);\n }\n\n // add submitter\n String submitter = resultSet.getString(\"submitter\");\n if (submitter != null) {\n Subject submitterSubject = new Subject();\n submitterSubject.setValue(submitter);\n systemMetadata.setSubmitter(submitterSubject);\n }\n\n // add object_format\n String fmtidStr = resultSet.getString(\"object_format\");\n ObjectFormatIdentifier fmtid = new ObjectFormatIdentifier();\n fmtid.setValue(fmtidStr);\n systemMetadata.setFormatId(fmtid);\n\n // add size\n String size = resultSet.getString(\"size\");\n systemMetadata.setSize(new BigInteger(size));\n\n // add obsoletes\n String obsoletes = resultSet.getString(\"obsoletes\");\n if (obsoletes != null) {\n Identifier obsoletesId = new Identifier();\n obsoletesId.setValue(obsoletes);\n systemMetadata.setObsoletes(obsoletesId);\n }\n // add obsoleted_by\n String obsoletedBy = resultSet.getString(\"obsoleted_by\");\n if (obsoletedBy != null) {\n Identifier obsoletedById = new Identifier();\n obsoletedById.setValue(obsoletedBy);\n systemMetadata.setObsoletedBy(obsoletedById);\n }\n\n // potentially build a ReplicationPolicy\n \n // add replication_allowed, if it was persisted\n boolean replAllowed = resultSet.getBoolean(\"replication_allowed\"); // getBoolean returns false for null results\n \n if (!resultSet.wasNull()) {\n // populate and add ReplicationPolicy\n ReplicationPolicy replicationPolicy = new ReplicationPolicy();\n \n replicationPolicy.setReplicationAllowed(new Boolean(replAllowed));\n\n // add number_replicas\n int numberOfReplicas = resultSet.getInt(\"number_replicas\"); // getInt returns 0 for null values\n if (numberOfReplicas > 0) {\n replicationPolicy.setNumberReplicas(new Integer(numberOfReplicas));\n\n }\n\n // add preferred and blocked lists\n List<ReplicationPolicyEntry> replPolicies = new ArrayList<ReplicationPolicyEntry>();\n List<NodeReference> preferredNodes = new ArrayList<NodeReference>();\n List<NodeReference> blockedNodes = new ArrayList<NodeReference>();\n\n replPolicies = listReplicationPolicies(pid, localTableMap);\n\n for (ReplicationPolicyEntry policy : replPolicies) {\n Identifier id = policy.getPid();\n String entryPolicy = policy.getPolicy();\n NodeReference node = policy.getMemberNode();\n\n if (entryPolicy.equals(\"preferred\")) {\n preferredNodes.add(node);\n\n } else if (entryPolicy.equals(\"blocked\")) {\n blockedNodes.add(node);\n\n }\n }\n\n replicationPolicy.setPreferredMemberNodeList(preferredNodes);\n replicationPolicy.setBlockedMemberNodeList(blockedNodes);\n\n systemMetadata.setReplicationPolicy(replicationPolicy);\n } else {\n systemMetadata.setReplicationPolicy(null);\n }\n\n // populate and add replicas list\n\n List<Replica> replicas = new ArrayList<Replica>();\n replicas = listReplicaEntries(pid, localTableMap);\n systemMetadata.setReplicaList(replicas);\n\n // populate and add AccessPolicy\n List<AccessRule> accessRules = new ArrayList<AccessRule>();\n accessRules = listAccessRules(pid, localTableMap);\n accessPolicy.setAllowList(accessRules);\n systemMetadata.setAccessPolicy(accessPolicy);\n\n // Validate the system metadata in debug mode using TypeMarshaller\n if (log.isDebugEnabled()) {\n try {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n TypeMarshaller.marshalTypeToOutputStream(systemMetadata, baos);\n log.debug(\"SystemMetadata for pid \" + pid.getValue() + \" is: \"\n + baos.toString());\n\n } catch (MarshallingException e) {\n e.printStackTrace();\n\n } catch (IOException e) {\n e.printStackTrace();\n\n }\n }\n return systemMetadata;\n }", "public MetaData getMetaData() {\n return metaData;\n }", "public ResultSetMetaData getMetaData() throws SQLException\n {\n return m_rs.getMetaData();\n }", "public ShowTableMetadataResponse showTableMetadata(ShowTableMetadataRequest request) throws GPUdbException {\n ShowTableMetadataResponse actualResponse_ = new ShowTableMetadataResponse();\n submitRequest(\"/show/table/metadata\", request, actualResponse_, false);\n return actualResponse_;\n }", "SQLServerResultSetMetaData(SQLServerConnection con, SQLServerResultSet rs) \n {\n traceID = \" SQLServerResultSetMetaData:\" + nextInstanceID();\n this.con = con;\n this.rs =rs;\n assert rs !=null;\n if(logger.isLoggable(java.util.logging.Level.FINE))\n {\n logger.fine(toString() + \" created by (\" + rs.toString() + \")\");\n }\n }", "@Override\n public RavenJObject getMetadata() {\n return metadata;\n }", "@Override\n\tpublic List<Map<String, String>> selectReportInfo(String appId) {\n\t\treturn getSqlMap().queryForList(NAMESPACES + \"queryReportInfo\", appId);\n\t}", "void processMetaData(ResultSet rs) throws SQLException;", "public interface ColumnMetaData {\n\n\t/**\n\t * The uniqueness level of a column data type.\n\t */\n\tenum Uniqueness {\n\t\t/**\n\t\t * No limitations. Multiple instances of a single column meta data type can be attached to a table or even a\n\t\t * single column.\n\t\t */\n\t\tNONE,\n\n\t\t/**\n\t\t * Multiple instances of a single column meta data type can be attached to a table but at most one per column.\n\t\t */\n\t\tCOLUMN,\n\n\t\t/**\n\t\t * At most one instance of the column meta data type can be attached to a table.\n\t\t */\n\t\tTABLE\n\t}\n\n\t/**\n\t * The unique type id of the column meta data.\n\t *\n\t * @return the type id\n\t */\n\tString type();\n\n\t/**\n\t * The uniqueness level of the meta data. Defaults to {@link Uniqueness#NONE} (no restrictions).\n\t *\n\t * @return the uniqueness level\n\t */\n\tdefault Uniqueness uniqueness() {\n\t\treturn Uniqueness.NONE;\n\t}\n\n}", "public HashMap getMetaData() ;", "Metadata getMetaData();", "@Override\n public SystemMetadataStatus mapRow(ResultSet resultSet, int rowNumber) throws SQLException {\n\n // resultSet contains guid, serialVersion, date_modified, and archived column data\n SystemMetadataStatus systemMetadataStatus = new SystemMetadataStatus();\n\n // add guid\n Identifier pid = new Identifier();\n pid.setValue(resultSet.getString(\"guid\"));\n systemMetadataStatus.setPid(pid);\n\n // add serialVersion\n BigInteger serialVersion = new BigInteger(resultSet.getString(\"serial_version\"));\n systemMetadataStatus.setSerialVersion(serialVersion);\n\n // add date_modified\n Date dateSystemMetadataLastModified = resultSet.getTimestamp(\"date_modified\");\n systemMetadataStatus\n .setLastSystemMetadataModificationDate(dateSystemMetadataLastModified);\n\n // add archived\n boolean archived = resultSet.getBoolean(\"archived\"); // getBoolean returns false for null results\n systemMetadataStatus.setDeleted(new Boolean(archived));\n\n return systemMetadataStatus;\n }", "@Override\n public String toString() {\n return \"Report{\" +\n \"reportId=\" + reportId +\n \", reportOpId=\" + reportOp +\n \", date='\" + date + '\\'' +\n \", reportedUserId=\" + reportedUser +\n \", userId=\" + user +\n \", status=\" + status +\n '}';\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}", "CustomReport selectByPrimaryKey(BigDecimal reportId);", "public ResultSetMetaData getMetaData() throws SQLException {\n return currentPreparedStatement.getMetaData();\n }", "public ReportTable(TableView<Report> reportTable) {\n this.reportTable = reportTable;\n }", "public void analizeQueryResultMetaData(ResultSetMetaData rsMetaData, String[] decimalColumns){\n\t\tArrayList<Integer> decimalColumnResultsetIndexes = new ArrayList<Integer>();\n\t\t//if ( decimalColumns==null||decimalColumns.length==0)\n\t\t//\treturn ; \n\t\ttry {\n\t\t\t\n\t\t\t\n\t\t\t//IObjectToStringConverter[] converters = new IObjectToStringConverter[rsMetaData.getColumnCount()] ;\n\t\t\tOuputDataType[] dataTypes = new OuputDataType[rsMetaData.getColumnCount()] ;\n\t\t\tjobContext.put(ExportEngineConstant.COLUMN_CONVERTER_KEY, dataTypes);\n\t\t\tfor ( int i=1 ; i <= rsMetaData.getColumnCount(); i++){\n\t\t\t\tboolean isDecimal = false ; \n\t\t\t\tString nama = rsMetaData.getColumnName(i).toUpperCase();\n\t\t\t\tif ( decimalColumns!=null){\n\t\t\t\t\tfor ( String scn : decimalColumns){\n\t\t\t\t\t\tif ( nama.equalsIgnoreCase(scn)){\n\t\t\t\t\t\t\tdecimalColumnResultsetIndexes.add(i-1);\n\t\t\t\t\t\t\tisDecimal = true ;\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.money; \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\tif( !isDecimal){\n\t\t\t\t\tString tipeCol = rsMetaData.getColumnClassName(i) ;\n\t\t\t\t\tboolean isDate = false ; \n\t\t\t\t\tfor ( String scn : DATE_DATA_TYPES){\n\t\t\t\t\t\tif ( tipeCol.equals(scn)){\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.date; \n\t\t\t\t\t\t\tisDate = true ; \n\t\t\t\t\t\t\tbreak ; \n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( !isDate){\n\t\t\t\t\t\tif (String.class.getName().equals(tipeCol)){\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.string;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.commonToString;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfor ( OuputDataType scn : dataTypes ){\n\t\t\t\tSystem.out.println(\"converter : \" + scn);\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"gagal membaca data column unutk membuat converter object array. error message :\" + e.getMessage() , e); \n\t\t}\n\t\t\n\t\t\n\t}", "private static void writeColumnMetaData(JsonGenerator jg, ColumnMetaData mdt) throws JsonGenerationException, IOException {\n\t\tjg.writeStartObject();\n\t\tjg.writeStringField(\"name\", mdt.columnName);\n\t\tjg.writeStringField(\"type\", mdt.columnType);\n\t\tjg.writeEndObject();;\n\t}", "private String metadata() {\n\t\tStringBuilder s = new StringBuilder();\n\t\ts.append(\"#######################################\");\n\t\ts.append(\"\\n# Metadata of query set\");\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Queries\");\n\t\ts.append(\"\\n# \\tTotal: \" + this.num_queries);\n\t\ts.append(\"\\n# \\tPoint: \" + this.num_pt_queries + \" (\" + 100 * ((double) this.num_pt_queries/this.num_queries) +\"%)\");\n\t\ts.append(\"\\n# \\tRange: \" + this.num_range_queries + \" (\" + 100 * ((double) this.num_range_queries/this.num_queries) +\"%)\");\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Operators\");\n\t\ts.append(\"\\n# \\tTotal: \" + (this.num_and_ops + this.num_or_ops) + \" (\" + ((double) (this.num_and_ops + this.num_or_ops)/this.num_queries) +\" per query)\");\n\t\ts.append(\"\\n# \\tAND: \" + this.num_and_ops);\n\t\ts.append(\"\\n# \\tOR: \" + this.num_or_ops);\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Attributes\");\n\t\ts.append(\"\\n# \\tTotal queried: \" + this.num_attributes);\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Bins\");\n\t\ts.append(\"\\n# \\tTotal queried: \" + this.num_bins);\n\t\ts.append(\"\\n# \\tPer query: \" + ((double) this.num_bins/this.num_queries));\n\t\ts.append(\"\\n#######################################\\n\");\n\t\treturn s.toString();\n\t}", "public List<Map<String, Object>> getDatewiseUpdateData(String columnName) {\n\t\tList<Map<String, Object>> reportData = new ArrayList<>();\n\n\t\tswitch (columnName) {\n\t\tcase \"LASTUPDATED\":\n\t\t\treportData = getLastUpdatedReport();\n\t\t\tbreak;\n\t\tcase \"CREATEDON\":\n\t\t\treportData = getCreatedOnReport();\n\t\t\tbreak;\n\t\tcase \"READON\":\n\t\t\treportData = getReadOnReport();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tSystem.out.println(\"Invalid column name\");\n\t\t}\n\t\treturn reportData;\n\t}", "public Map<String, Object> getMetaData() {\n\t\treturn metaData;\n\t}", "public MetadataArtifactDownloadReport getReport() {\n return report;\n }", "public Map<String, ColumnMetaData> getColumns();", "public abstract String metadata(String property);", "@Override\n\tpublic IColumns createColumns() {\n\t\treturn new WaybillforauditColumns();\n\t}", "@Schema(description = \"`status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Binary general-info: The input information used to assemble the report that can be on-going, periodic and actual and projected \")\n public Object getAssessmentInstanceReportRecord() {\n return assessmentInstanceReportRecord;\n }", "public AlterTableMetadataResponse alterTableMetadata(AlterTableMetadataRequest request) throws GPUdbException {\n AlterTableMetadataResponse actualResponse_ = new AlterTableMetadataResponse();\n submitRequest(\"/alter/table/metadata\", request, actualResponse_, false);\n return actualResponse_;\n }", "public Long getReportId() {\n return reportId;\n }", "@Schema(description = \"`status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Binary general-info: The external report in any suitable form including selection filters where appropriate \")\n public Object getAssessmentInstanceReport() {\n return assessmentInstanceReport;\n }", "@SuppressWarnings(\"all\")\npublic interface I_I_BankDataJP \n{\n\n /** TableName=I_BankDataJP */\n public static final String Table_Name = \"I_BankDataJP\";\n\n /** AD_Table_ID=1000307 */\n public static final int Table_ID = MTable.getTable_ID(Table_Name);\n\n KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);\n\n /** AccessLevel = 3 - Client - Org \n */\n BigDecimal accessLevel = BigDecimal.valueOf(3);\n\n /** Load Meta Data */\n\n /** Column name AD_Client_ID */\n public static final String COLUMNNAME_AD_Client_ID = \"AD_Client_ID\";\n\n\t/** Get Tenant.\n\t * Tenant for this installation.\n\t */\n\tpublic int getAD_Client_ID();\n\n /** Column name AD_OrgTrx_ID */\n public static final String COLUMNNAME_AD_OrgTrx_ID = \"AD_OrgTrx_ID\";\n\n\t/** Set Trx Organization.\n\t * Performing or initiating organization\n\t */\n\tpublic void setAD_OrgTrx_ID (int AD_OrgTrx_ID);\n\n\t/** Get Trx Organization.\n\t * Performing or initiating organization\n\t */\n\tpublic int getAD_OrgTrx_ID();\n\n /** Column name AD_Org_ID */\n public static final String COLUMNNAME_AD_Org_ID = \"AD_Org_ID\";\n\n\t/** Set Organization.\n\t * Organizational entity within tenant\n\t */\n\tpublic void setAD_Org_ID (int AD_Org_ID);\n\n\t/** Get Organization.\n\t * Organizational entity within tenant\n\t */\n\tpublic int getAD_Org_ID();\n\n /** Column name AccountNo */\n public static final String COLUMNNAME_AccountNo = \"AccountNo\";\n\n\t/** Set Account No.\n\t * Account Number\n\t */\n\tpublic void setAccountNo (String AccountNo);\n\n\t/** Get Account No.\n\t * Account Number\n\t */\n\tpublic String getAccountNo();\n\n /** Column name BankAccountType */\n public static final String COLUMNNAME_BankAccountType = \"BankAccountType\";\n\n\t/** Set Bank Account Type.\n\t * Bank Account Type\n\t */\n\tpublic void setBankAccountType (String BankAccountType);\n\n\t/** Get Bank Account Type.\n\t * Bank Account Type\n\t */\n\tpublic String getBankAccountType();\n\n /** Column name C_BankAccount_ID */\n public static final String COLUMNNAME_C_BankAccount_ID = \"C_BankAccount_ID\";\n\n\t/** Set Bank Account.\n\t * Account at the Bank\n\t */\n\tpublic void setC_BankAccount_ID (int C_BankAccount_ID);\n\n\t/** Get Bank Account.\n\t * Account at the Bank\n\t */\n\tpublic int getC_BankAccount_ID();\n\n\tpublic org.compiere.model.I_C_BankAccount getC_BankAccount() throws RuntimeException;\n\n /** Column name C_Bank_ID */\n public static final String COLUMNNAME_C_Bank_ID = \"C_Bank_ID\";\n\n\t/** Set Bank.\n\t * Bank\n\t */\n\tpublic void setC_Bank_ID (int C_Bank_ID);\n\n\t/** Get Bank.\n\t * Bank\n\t */\n\tpublic int getC_Bank_ID();\n\n\tpublic org.compiere.model.I_C_Bank getC_Bank() throws RuntimeException;\n\n /** Column name Created */\n public static final String COLUMNNAME_Created = \"Created\";\n\n\t/** Get Created.\n\t * Date this record was created\n\t */\n\tpublic Timestamp getCreated();\n\n /** Column name CreatedBy */\n public static final String COLUMNNAME_CreatedBy = \"CreatedBy\";\n\n\t/** Get Created By.\n\t * User who created this records\n\t */\n\tpublic int getCreatedBy();\n\n /** Column name DateAcct */\n public static final String COLUMNNAME_DateAcct = \"DateAcct\";\n\n\t/** Set Account Date.\n\t * Accounting Date\n\t */\n\tpublic void setDateAcct (Timestamp DateAcct);\n\n\t/** Get Account Date.\n\t * Accounting Date\n\t */\n\tpublic Timestamp getDateAcct();\n\n /** Column name I_BankDataJP_ID */\n public static final String COLUMNNAME_I_BankDataJP_ID = \"I_BankDataJP_ID\";\n\n\t/** Set I_BankDataJP.\n\t * JPIERE-0595:JPBP\n\t */\n\tpublic void setI_BankDataJP_ID (int I_BankDataJP_ID);\n\n\t/** Get I_BankDataJP.\n\t * JPIERE-0595:JPBP\n\t */\n\tpublic int getI_BankDataJP_ID();\n\n /** Column name I_BankDataJP_UU */\n public static final String COLUMNNAME_I_BankDataJP_UU = \"I_BankDataJP_UU\";\n\n\t/** Set I_BankDataJP_UU\t */\n\tpublic void setI_BankDataJP_UU (String I_BankDataJP_UU);\n\n\t/** Get I_BankDataJP_UU\t */\n\tpublic String getI_BankDataJP_UU();\n\n /** Column name I_ErrorMsg */\n public static final String COLUMNNAME_I_ErrorMsg = \"I_ErrorMsg\";\n\n\t/** Set Import Error Message.\n\t * Messages generated from import process\n\t */\n\tpublic void setI_ErrorMsg (String I_ErrorMsg);\n\n\t/** Get Import Error Message.\n\t * Messages generated from import process\n\t */\n\tpublic String getI_ErrorMsg();\n\n /** Column name I_IsImported */\n public static final String COLUMNNAME_I_IsImported = \"I_IsImported\";\n\n\t/** Set Imported.\n\t * Has this import been processed\n\t */\n\tpublic void setI_IsImported (boolean I_IsImported);\n\n\t/** Get Imported.\n\t * Has this import been processed\n\t */\n\tpublic boolean isI_IsImported();\n\n /** Column name IsActive */\n public static final String COLUMNNAME_IsActive = \"IsActive\";\n\n\t/** Set Active.\n\t * The record is active in the system\n\t */\n\tpublic void setIsActive (boolean IsActive);\n\n\t/** Get Active.\n\t * The record is active in the system\n\t */\n\tpublic boolean isActive();\n\n /** Column name JP_A_Name */\n public static final String COLUMNNAME_JP_A_Name = \"JP_A_Name\";\n\n\t/** Set Account Name\t */\n\tpublic void setJP_A_Name (String JP_A_Name);\n\n\t/** Get Account Name\t */\n\tpublic String getJP_A_Name();\n\n /** Column name JP_A_Name_Kana */\n public static final String COLUMNNAME_JP_A_Name_Kana = \"JP_A_Name_Kana\";\n\n\t/** Set Account Name(Kana)\t */\n\tpublic void setJP_A_Name_Kana (String JP_A_Name_Kana);\n\n\t/** Get Account Name(Kana)\t */\n\tpublic String getJP_A_Name_Kana();\n\n /** Column name JP_AcctDate */\n public static final String COLUMNNAME_JP_AcctDate = \"JP_AcctDate\";\n\n\t/** Set Date of Account Date\t */\n\tpublic void setJP_AcctDate (String JP_AcctDate);\n\n\t/** Get Date of Account Date\t */\n\tpublic String getJP_AcctDate();\n\n /** Column name JP_AcctMonth */\n public static final String COLUMNNAME_JP_AcctMonth = \"JP_AcctMonth\";\n\n\t/** Set Month of Account Date\t */\n\tpublic void setJP_AcctMonth (String JP_AcctMonth);\n\n\t/** Get Month of Account Date\t */\n\tpublic String getJP_AcctMonth();\n\n /** Column name JP_BankAccountType */\n public static final String COLUMNNAME_JP_BankAccountType = \"JP_BankAccountType\";\n\n\t/** Set Bank Account Type\t */\n\tpublic void setJP_BankAccountType (String JP_BankAccountType);\n\n\t/** Get Bank Account Type\t */\n\tpublic String getJP_BankAccountType();\n\n /** Column name JP_BankAccount_Value */\n public static final String COLUMNNAME_JP_BankAccount_Value = \"JP_BankAccount_Value\";\n\n\t/** Set Bank Account(Search Key)\t */\n\tpublic void setJP_BankAccount_Value (String JP_BankAccount_Value);\n\n\t/** Get Bank Account(Search Key)\t */\n\tpublic String getJP_BankAccount_Value();\n\n /** Column name JP_BankDataCustomerCode1 */\n public static final String COLUMNNAME_JP_BankDataCustomerCode1 = \"JP_BankDataCustomerCode1\";\n\n\t/** Set Bank Data Customer Code1\t */\n\tpublic void setJP_BankDataCustomerCode1 (String JP_BankDataCustomerCode1);\n\n\t/** Get Bank Data Customer Code1\t */\n\tpublic String getJP_BankDataCustomerCode1();\n\n /** Column name JP_BankDataCustomerCode2 */\n public static final String COLUMNNAME_JP_BankDataCustomerCode2 = \"JP_BankDataCustomerCode2\";\n\n\t/** Set Bank Data Customer Code2\t */\n\tpublic void setJP_BankDataCustomerCode2 (String JP_BankDataCustomerCode2);\n\n\t/** Get Bank Data Customer Code2\t */\n\tpublic String getJP_BankDataCustomerCode2();\n\n /** Column name JP_BankDataLine_ID */\n public static final String COLUMNNAME_JP_BankDataLine_ID = \"JP_BankDataLine_ID\";\n\n\t/** Set Import Bank Data Line\t */\n\tpublic void setJP_BankDataLine_ID (int JP_BankDataLine_ID);\n\n\t/** Get Import Bank Data Line\t */\n\tpublic int getJP_BankDataLine_ID();\n\n\tpublic I_JP_BankDataLine getJP_BankDataLine() throws RuntimeException;\n\n /** Column name JP_BankData_EDI_Info */\n public static final String COLUMNNAME_JP_BankData_EDI_Info = \"JP_BankData_EDI_Info\";\n\n\t/** Set BankData EDI Info\t */\n\tpublic void setJP_BankData_EDI_Info (String JP_BankData_EDI_Info);\n\n\t/** Get BankData EDI Info\t */\n\tpublic String getJP_BankData_EDI_Info();\n\n /** Column name JP_BankData_ID */\n public static final String COLUMNNAME_JP_BankData_ID = \"JP_BankData_ID\";\n\n\t/** Set Import Bank Data\t */\n\tpublic void setJP_BankData_ID (int JP_BankData_ID);\n\n\t/** Get Import Bank Data\t */\n\tpublic int getJP_BankData_ID();\n\n\tpublic I_JP_BankData getJP_BankData() throws RuntimeException;\n\n /** Column name JP_BankData_ReferenceNo */\n public static final String COLUMNNAME_JP_BankData_ReferenceNo = \"JP_BankData_ReferenceNo\";\n\n\t/** Set Bank Data ReferenceNo\t */\n\tpublic void setJP_BankData_ReferenceNo (String JP_BankData_ReferenceNo);\n\n\t/** Get Bank Data ReferenceNo\t */\n\tpublic String getJP_BankData_ReferenceNo();\n\n /** Column name JP_BankName_Kana */\n public static final String COLUMNNAME_JP_BankName_Kana = \"JP_BankName_Kana\";\n\n\t/** Set Bank Name(Kana)\t */\n\tpublic void setJP_BankName_Kana (String JP_BankName_Kana);\n\n\t/** Get Bank Name(Kana)\t */\n\tpublic String getJP_BankName_Kana();\n\n /** Column name JP_BankName_Kana_Line */\n public static final String COLUMNNAME_JP_BankName_Kana_Line = \"JP_BankName_Kana_Line\";\n\n\t/** Set Bank Name(Kana) Line\t */\n\tpublic void setJP_BankName_Kana_Line (String JP_BankName_Kana_Line);\n\n\t/** Get Bank Name(Kana) Line\t */\n\tpublic String getJP_BankName_Kana_Line();\n\n /** Column name JP_Bank_Name */\n public static final String COLUMNNAME_JP_Bank_Name = \"JP_Bank_Name\";\n\n\t/** Set Bank Name\t */\n\tpublic void setJP_Bank_Name (String JP_Bank_Name);\n\n\t/** Get Bank Name\t */\n\tpublic String getJP_Bank_Name();\n\n /** Column name JP_BranchCode */\n public static final String COLUMNNAME_JP_BranchCode = \"JP_BranchCode\";\n\n\t/** Set Branch Code\t */\n\tpublic void setJP_BranchCode (String JP_BranchCode);\n\n\t/** Get Branch Code\t */\n\tpublic String getJP_BranchCode();\n\n /** Column name JP_BranchName */\n public static final String COLUMNNAME_JP_BranchName = \"JP_BranchName\";\n\n\t/** Set Branch Name\t */\n\tpublic void setJP_BranchName (String JP_BranchName);\n\n\t/** Get Branch Name\t */\n\tpublic String getJP_BranchName();\n\n /** Column name JP_BranchName_Kana */\n public static final String COLUMNNAME_JP_BranchName_Kana = \"JP_BranchName_Kana\";\n\n\t/** Set Branch Name(Kana)\t */\n\tpublic void setJP_BranchName_Kana (String JP_BranchName_Kana);\n\n\t/** Get Branch Name(Kana)\t */\n\tpublic String getJP_BranchName_Kana();\n\n /** Column name JP_BranchName_Kana_Line */\n public static final String COLUMNNAME_JP_BranchName_Kana_Line = \"JP_BranchName_Kana_Line\";\n\n\t/** Set Branch Name(Kana) Line\t */\n\tpublic void setJP_BranchName_Kana_Line (String JP_BranchName_Kana_Line);\n\n\t/** Get Branch Name(Kana) Line\t */\n\tpublic String getJP_BranchName_Kana_Line();\n\n /** Column name JP_Date */\n public static final String COLUMNNAME_JP_Date = \"JP_Date\";\n\n\t/** Set Date.\n\t * Date\n\t */\n\tpublic void setJP_Date (String JP_Date);\n\n\t/** Get Date.\n\t * Date\n\t */\n\tpublic String getJP_Date();\n\n /** Column name JP_Line_Description */\n public static final String COLUMNNAME_JP_Line_Description = \"JP_Line_Description\";\n\n\t/** Set Line Description\t */\n\tpublic void setJP_Line_Description (String JP_Line_Description);\n\n\t/** Get Line Description\t */\n\tpublic String getJP_Line_Description();\n\n /** Column name JP_Month */\n public static final String COLUMNNAME_JP_Month = \"JP_Month\";\n\n\t/** Set Month\t */\n\tpublic void setJP_Month (String JP_Month);\n\n\t/** Get Month\t */\n\tpublic String getJP_Month();\n\n /** Column name JP_OrgTrx_Value */\n public static final String COLUMNNAME_JP_OrgTrx_Value = \"JP_OrgTrx_Value\";\n\n\t/** Set Trx Organization(Search Key)\t */\n\tpublic void setJP_OrgTrx_Value (String JP_OrgTrx_Value);\n\n\t/** Get Trx Organization(Search Key)\t */\n\tpublic String getJP_OrgTrx_Value();\n\n /** Column name JP_Org_Value */\n public static final String COLUMNNAME_JP_Org_Value = \"JP_Org_Value\";\n\n\t/** Set Organization(Search Key)\t */\n\tpublic void setJP_Org_Value (String JP_Org_Value);\n\n\t/** Get Organization(Search Key)\t */\n\tpublic String getJP_Org_Value();\n\n /** Column name JP_RequesterName */\n public static final String COLUMNNAME_JP_RequesterName = \"JP_RequesterName\";\n\n\t/** Set Requester Name\t */\n\tpublic void setJP_RequesterName (String JP_RequesterName);\n\n\t/** Get Requester Name\t */\n\tpublic String getJP_RequesterName();\n\n /** Column name JP_SalesRep_EMail */\n public static final String COLUMNNAME_JP_SalesRep_EMail = \"JP_SalesRep_EMail\";\n\n\t/** Set Sales Rep(E-Mail)\t */\n\tpublic void setJP_SalesRep_EMail (String JP_SalesRep_EMail);\n\n\t/** Get Sales Rep(E-Mail)\t */\n\tpublic String getJP_SalesRep_EMail();\n\n /** Column name JP_SalesRep_Name */\n public static final String COLUMNNAME_JP_SalesRep_Name = \"JP_SalesRep_Name\";\n\n\t/** Set Sales Rep(Name)\t */\n\tpublic void setJP_SalesRep_Name (String JP_SalesRep_Name);\n\n\t/** Get Sales Rep(Name)\t */\n\tpublic String getJP_SalesRep_Name();\n\n /** Column name JP_SalesRep_Value */\n public static final String COLUMNNAME_JP_SalesRep_Value = \"JP_SalesRep_Value\";\n\n\t/** Set Sales Rep(Search Key)\t */\n\tpublic void setJP_SalesRep_Value (String JP_SalesRep_Value);\n\n\t/** Get Sales Rep(Search Key)\t */\n\tpublic String getJP_SalesRep_Value();\n\n /** Column name Processed */\n public static final String COLUMNNAME_Processed = \"Processed\";\n\n\t/** Set Processed.\n\t * The document has been processed\n\t */\n\tpublic void setProcessed (boolean Processed);\n\n\t/** Get Processed.\n\t * The document has been processed\n\t */\n\tpublic boolean isProcessed();\n\n /** Column name Processing */\n public static final String COLUMNNAME_Processing = \"Processing\";\n\n\t/** Set Process Now\t */\n\tpublic void setProcessing (boolean Processing);\n\n\t/** Get Process Now\t */\n\tpublic boolean isProcessing();\n\n /** Column name RoutingNo */\n public static final String COLUMNNAME_RoutingNo = \"RoutingNo\";\n\n\t/** Set Routing No.\n\t * Bank Routing Number\n\t */\n\tpublic void setRoutingNo (String RoutingNo);\n\n\t/** Get Routing No.\n\t * Bank Routing Number\n\t */\n\tpublic String getRoutingNo();\n\n /** Column name SalesRep_ID */\n public static final String COLUMNNAME_SalesRep_ID = \"SalesRep_ID\";\n\n\t/** Set Sales Rep.\n\t * Sales Representative or Company Agent\n\t */\n\tpublic void setSalesRep_ID (int SalesRep_ID);\n\n\t/** Get Sales Rep.\n\t * Sales Representative or Company Agent\n\t */\n\tpublic int getSalesRep_ID();\n\n\tpublic org.compiere.model.I_AD_User getSalesRep() throws RuntimeException;\n\n /** Column name StatementDate */\n public static final String COLUMNNAME_StatementDate = \"StatementDate\";\n\n\t/** Set Statement date.\n\t * Date of the statement\n\t */\n\tpublic void setStatementDate (Timestamp StatementDate);\n\n\t/** Get Statement date.\n\t * Date of the statement\n\t */\n\tpublic Timestamp getStatementDate();\n\n /** Column name StmtAmt */\n public static final String COLUMNNAME_StmtAmt = \"StmtAmt\";\n\n\t/** Set Statement amount.\n\t * Statement Amount\n\t */\n\tpublic void setStmtAmt (BigDecimal StmtAmt);\n\n\t/** Get Statement amount.\n\t * Statement Amount\n\t */\n\tpublic BigDecimal getStmtAmt();\n\n /** Column name TrxAmt */\n public static final String COLUMNNAME_TrxAmt = \"TrxAmt\";\n\n\t/** Set Transaction Amount.\n\t * Amount of a transaction\n\t */\n\tpublic void setTrxAmt (BigDecimal TrxAmt);\n\n\t/** Get Transaction Amount.\n\t * Amount of a transaction\n\t */\n\tpublic BigDecimal getTrxAmt();\n\n /** Column name Updated */\n public static final String COLUMNNAME_Updated = \"Updated\";\n\n\t/** Get Updated.\n\t * Date this record was updated\n\t */\n\tpublic Timestamp getUpdated();\n\n /** Column name UpdatedBy */\n public static final String COLUMNNAME_UpdatedBy = \"UpdatedBy\";\n\n\t/** Get Updated By.\n\t * User who updated this records\n\t */\n\tpublic int getUpdatedBy();\n}", "Map<String, Object> getAllMetadata();", "public static JasperReportBuilder generateReport(ExportData metaData,HttpServletRequest request){\n session = request.getSession(false);\n report = report(); // Creer le rapport\n \n //Logo\n// logoImg = cmp.image(inImg).setStyle(DynamicReports.stl.style().setHorizontalAlignment(HorizontalAlignment.LEFT)); \n //logoImg.setDimension(80,80); \n \n //Definit le style des colonnes d'entàte\n report.setColumnTitleStyle(getHeaderStyle(metaData));\n \n \n \n LinkedHashMap <String,String> criteria = metaData.getCriteria(); \n //Ajout la date d'àdition au critere d'impression\n String valDateProperty = getDateTxt(metaData.getLang()) ;\n String keyDateProperty = \"\" ;\n if ( session.getAttribute(\"activedLocale\").equals(\"fr\") ) {\n keyDateProperty = \"Edité le \" ;\n }\n else {\n keyDateProperty = \"Printed on \" ;\n }\n criteria.put(keyDateProperty,valDateProperty);\n \n StyleBuilder titleStyle = stl.style(boldStyle).setFontSize(16).setForegroundColor(new Color(0, 0, 0)).setHorizontalAlignment(HorizontalAlignment.RIGHT).setRightIndent(20);\n ComponentBuilder<?, ?> logoComponent = cmp.horizontalList(\n //cmp.image(Templates.class.getResource(\"/logopalm.png\")).setFixedDimension(150, 50).setStyle(stl.style().setLeftIndent(20)),\n cmp.verticalList(\n cmp.text(metaData.getTitle()).setStyle(titleStyle)\n )\n ).newRow()\n .add(cmp.horizontalList().add(cmp.hListCell(createCriteriaComponent(criteria,metaData)).heightFixedOnTop()))\n .newRow(); \n \n report.noData(logoComponent, cmp.text(\"Aucun enregistrement trouvà\").setStyle(stl.style().setHorizontalAlignment(HorizontalAlignment.CENTER).setTopPadding(30)));\n\n \n \n lblStyle = stl.style(Templates.columnStyle).setForegroundColor(new Color(60, 91, 31)); // Couleur du text \n colStyle = stl.style(Templates.columnStyle).setHorizontalAlignment(HorizontalAlignment.CENTER);\n \n groupStyle = stl.style().setForegroundColor(new Color(60, 91, 31)) \n .setBold(Boolean.TRUE)\n .setPadding(5)\n .setFontSize(13)\n .setHorizontalAlignment(HorizontalAlignment.CENTER); \n \n\n \n if(metaData.getTitle().equals(ITitle.PARCEL)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PARCEL_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SECTOR)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SECTOR_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BLOCK)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BLOCK_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ATTACK_PHYTO)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TREATMENT)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TREATMENT_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVEST)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVEST_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SERVICING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SERVICING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_PLANTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_PLANTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.FERTILIZATION)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.FERTILIZATION_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.CONTROL_PHYTO)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.CONTROL_PHYTO_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_FOLDING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_FOLDING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.MORTALITY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.MORTALITY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVESTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVESTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BUDGET)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.REPLACEMENT)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.REPLACEMENT_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.METEOROLOGY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.METEOROLOGY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_MATERIAL)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_MATERIAL_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLUVIOMETRY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLUVIOMETRY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ETP)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ETP_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HYGROMETRY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HYGROMETRY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TEMPERATURE)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TEMPERATURE_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.INSULATION)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.INSULATION_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.WORK)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.WORK_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }\n \n \n drColumns = new HashMap<String, TextColumnBuilder>(); \n groups = new ArrayList<String>();\n subtotals = new ArrayList<String>();\n \n //Definit la liste des colonnes du rapport\n ExportGenerator.getColumns(metaData); \n //Definit la liste des sous-totaux du rapport\n ExportGenerator.getSubTotals(metaData);\n \n \n //Genration des sous totaux\n for (String group : groups) {\n ColumnGroupBuilder group2 = grp.group(drColumns.get(group));\n report.groupBy(group2);\n for (String subtotal : subtotals) {\n report.subtotalsAtGroupFooter(group2,sbt.sum(drColumns.get(subtotal)));\n }\n }\n\n for (String subtotal : subtotals) {\n report.subtotalsAtSummary(sbt.sum(drColumns.get(subtotal))); \n }\n \n /*if(ExportGenerator.getColumnByNameField(\"plantingName\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL \"), ExportGenerator.getColumnByNameField(\"plantingName\"), Calculation.NOTHING));\n }*//*else if(ExportGenerator.getColumnByNameField(\"invoiceCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"invoiceCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"planterCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL\"), ExportGenerator.getColumnByNameField(\"planterCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"transportTicket\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"transportTicket\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"deliveryDate\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"deliveryDate\"), Calculation.NOTHING));\n }\n else if(ExportGenerator.getColumnByNameField(\"arroundPlantingTicketNumber\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"arroundPlantingTicketNumber\"), Calculation.NOTHING));\n }\n else if(ExportGenerator.getColumnByNameField(\"planterNumber\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"planterNumber\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"startPaymentDate\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"startPaymentDate\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"sectorCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"sectorCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"month\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL \"), ExportGenerator.getColumnByNameField(\"month\"), Calculation.NOTHING));\n }*/\n \n\n \n \n //Genere la source de donnàes du rapport\n report.setDataSource(metaData.getData());\n \n report.highlightDetailEvenRows(); \n \n \n // Definition de l'entete : valable uniquement pour la 1ere page\n HorizontalListBuilder hlb= null;\n \n hlb = cmp.horizontalList().add(\n cmp.hListCell(createCriteriaComponent(criteria,metaData)).heightFixedOnTop()\n );\n\n \n report.title(\n createCustomTitleComponent(metaData.getTitle()), // Titre\n hlb,// Liste Horizontal des Critàres \n cmp.verticalGap(12) // Marge de 12 px entre chaque critàre\n ); \n \n \n \n report.setPageMargin(DynamicReports.margin().setLeft(15).setTop(30).setRight(15).setBottom(30));\n report.setPageFormat(PageType.A3, PageOrientation.LANDSCAPE);\n report.pageFooter(DynamicReports.cmp.pageXslashY());\n return report;\n \n }", "public interface IReportDao extends IBaseDao<Report, Integer> {\n\t\n\t/**\n\t * 添加举报信息\n\t * @param report\n\t */\n\tpublic boolean addReport(Report report);\n\t\n\t/**\n\t * 修改举报信息\n\t * @param report\n\t * @return\n\t */\n\tpublic boolean updateReport(Report report);\n\t\n//\t/**\n//\t * 是否已经举报\n//\t * @param getReportGto\n//\t * @return\n//\t */\n//\tpublic boolean isHouseInfoReported(GetReportGto getReportGto);\n\t\n\t/**\n\t * 获取我与某条房源的举报信息\n\t * @param getReportGto\n\t * @return\n\t */\n\tpublic List<Report> getMyReport(GetReportGto getReportGto);\n}", "public interface TableDetailMapper {\n\n @Select(\"select * from dxh_sys.tabledetail where vendorId=0 and tableName='skuProfitDayReport'\")\n List<Map<String, Object>> list();\n\n}", "public Report getReport();", "BoltResultSetMetaData(List<Type> types, List<String> keys) {\n\t\tsuper(keys);\n\t\tthis.columnType = types.toArray(new Type[this.keys.size() + 1]);\n\n\t\t// we init columnType with the first record\n\t\t// in case first == last record\n\t\t/*for (int i = 1; i <= this.keys.size(); i++) {\n\t\t\tcolumnType[i] = this.getColumnDriverTypeOrDefault(i, InternalTypeSystem.TYPE_SYSTEM.STRING());\n\t\t}*/\n\t}", "@Override\r\n\tpublic Map<String, Object> getMetadata() {\n\t\treturn null;\r\n\t}", "@Select({\n \"select\",\n \"JNLNO, TRANDATE, ACCOUNTDATE, CHECKTYPE, STATUS, DONETIME, FILENAME\",\n \"from B_UMB_CHECKING_LOG\",\n \"where JNLNO = #{jnlno,jdbcType=VARCHAR}\"\n })\n @Results({\n @Result(column=\"JNLNO\", property=\"jnlno\", jdbcType=JdbcType.VARCHAR, id=true),\n @Result(column=\"TRANDATE\", property=\"trandate\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"ACCOUNTDATE\", property=\"accountdate\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"CHECKTYPE\", property=\"checktype\", jdbcType=JdbcType.CHAR),\n @Result(column=\"STATUS\", property=\"status\", jdbcType=JdbcType.CHAR),\n @Result(column=\"DONETIME\", property=\"donetime\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"FILENAME\", property=\"filename\", jdbcType=JdbcType.VARCHAR)\n })\n BUMBCheckingLog selectByPrimaryKey(BUMBCheckingLogKey key);", "@SqlQuery(\"select * from PLAYERSTATS\")\n List<PlayerStats> getAll();", "protected String getMetadataName() {\r\n\t\treturn METADATA_NAME;\r\n\t}", "public abstract String getSummaryForDatabase();", "private interface ReportColumnCallback\n {\n void handleReportColumn(DashboardReport report, String columnName) throws MojoExecutionException;\n }", "public ReportMetadataExample() {\n\t\toredCriteria = new ArrayList<Criteria>();\n\t}", "@Override\r\n \tpublic MetaData getMetaData(HttpHeaders headers) {\n \t\ttry {\r\n \t\t\treturn MetaDataUtil.getMetaData(new ViewListeEleve(), new HashMap<String, MetaData>(),new ArrayList<String>());\r\n \t\t} catch (Exception e) {\r\n \t\t\t// TODO Auto-generated catch block\r\n \t\t\tthrow new WebApplicationException(Response.serverError().entity(new String(\"MetaData parse error\")).build());\r\n \t\t} \r\n \t}", "public DefaultMetaData getMetaData() {\n\t\treturn this.metaData;\n\t}", "Report createReport();", "@Override\n public Map<String, String> createFieldToPropertyMapping() {\n final Map<String, String> mapping = super.createFieldToPropertyMapping();\n mapping.put(this.tableName + \".rsres_id\", \"id\");\n mapping.put(this.tableName + \".resource_id\", \"resourceId\");\n mapping.put(this.tableName + \".quantity\", QUANTITY);\n mapping.put(this.tableName + \".cost_rsres\", \"cost\");\n\n return mapping;\n }", "public String getReportsToBeGenerated(String reportType) {\r\n\t\tString query = \"\";\r\n\t\t\r\n\t\ttry (Connection connection = DatabaseConnection.getMySQLConnection();\r\n\t\t\t PreparedStatement stmt = connection.prepareStatement(query);) {\r\n\t\t\tResultSet result = stmt.executeQuery();\r\n\t\t\tStringJoiner reports = new StringJoiner(\",,\");\r\n\t\t\twhile (result.next()) {\r\n\t\t\t\treports.add(result.getString(\"REPORT_NAME\"));\r\n\t\t\t}\r\n\t\t\treturn reports.toString();\r\n\t\t} catch (SQLException e) {\r\n\t\t\tthrow new ReportGenerationException(\"An error occurred while retrieving reports to be generated.\", e);\r\n\t\t}\r\n\t}", "public String getMetaDataFileName() {\n return null;\n }", "public JDBCRawSqlQueryMetaData(Method method) {\n this.method = method;\n }", "public Map getMetadata() {\n return metadata;\n }", "public DatabaseMetaData(Statement s) {\n\t\t_stmt = s; // SQL-Connection\n\t\t_buffer = new StringBuffer(); // Output goes here\n\t\t_tables = new ArrayList<String>(); // List of tables\n\t\t\n\t\ttry {\n\t\t\t// Put table names in `_tables`\n\t\t\textractTableNames(_stmt.executeQuery(composeTableNamesQuery()));\n\n\t\t\t// fetch the string representation of each tables meta-data\n\t\t\tfor (String name : _tables)\n\t\t\t\t_buffer.append(new TableMeta(name)); \n\t\t} catch (SQLException e) { _error = true;}\n\t}", "private Builder() {\n super(net.explorys.samhat.z12.r837.X837Ins_2320_MOA_MedicareOutpatientAdjudicationInformation.SCHEMA$);\n }", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "public String toString() {\n return \"[JDBCRawSqlQueryMetaData : method=\" + method + \"]\";\n }", "Report selectByPrimaryKey(Integer id);", "java.lang.String getMetadata(int index);", "java.lang.String getMetadata(int index);", "public Integer getReportId() {\n return reportId;\n }", "@Schema(description = \"`status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Code general-info: The type of external report available \")\n public String getAssessmentInstanceReportType() {\n return assessmentInstanceReportType;\n }", "@Override\r\n\tpublic List<ReportAndSummary> findAll() {\n\t\tList<ReportAndSummary> result = reportAndSummaryDao.findAll();\r\n\t\treturn result;\r\n\t}", "private static Map<String, ColumnMetaData> buildColumnMetadataMap(ResultSet rs) {\n\t\t/*\n\t\t * LinkedHashmap to preserve key traversal order.\n\t\t * Important as we output rows as arrays of values where the index position in\n\t\t * the row implicitly corresponds to the entry order of the column map.\n\t\t * Reason for this is performance. \n\t\t */\n\t\tMap<String, ColumnMetaData> columnMap = Maps.newLinkedHashMap();\n\t\ttry {\n\t\t\tResultSetMetaData rmd = rs.getMetaData();\n\t\t\tfor (int i=1; i<= rmd.getColumnCount(); i++) {\n\t\t\t\tColumnMetaData cmd = \n\t\t\t\t\tnew ColumnMetaData(rmd.getColumnName(i), rmd.getColumnTypeName(i));\n\t\t\t\tcolumnMap.put(cmd.columnName, cmd);\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\tThrowables.propagate(e);\n\t\t}\n\t\treturn columnMap;\n\t}", "protected String getSqlTable() {\n\t\treturn \"Project\";\n\t}", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "public interface I_IHC_JobDataChange \n{\n\n /** TableName=IHC_JobDataChange */\n public static final String Table_Name = \"IHC_JobDataChange\";\n\n /** AD_Table_ID=1100135 */\n public static final int Table_ID = MTable.getTable_ID(Table_Name);\n\n KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);\n\n /** AccessLevel = 3 - Client - Org \n */\n BigDecimal accessLevel = BigDecimal.valueOf(3);\n\n /** Load Meta Data */\n\n /** Column name AD_Client_ID */\n public static final String COLUMNNAME_AD_Client_ID = \"AD_Client_ID\";\n\n\t/** Get Client.\n\t * Client/Tenant for this installation.\n\t */\n\tpublic int getAD_Client_ID();\n\n /** Column name AD_Org_ID */\n public static final String COLUMNNAME_AD_Org_ID = \"AD_Org_ID\";\n\n\t/** Set Organization.\n\t * Organizational entity within client\n\t */\n\tpublic void setAD_Org_ID (int AD_Org_ID);\n\n\t/** Get Organization.\n\t * Organizational entity within client\n\t */\n\tpublic int getAD_Org_ID();\n\n /** Column name BPJSRegistrationDate */\n public static final String COLUMNNAME_BPJSRegistrationDate = \"BPJSRegistrationDate\";\n\n\t/** Set BPJS Registration Date\t */\n\tpublic void setBPJSRegistrationDate (Timestamp BPJSRegistrationDate);\n\n\t/** Get BPJS Registration Date\t */\n\tpublic Timestamp getBPJSRegistrationDate();\n\n /** Column name Created */\n public static final String COLUMNNAME_Created = \"Created\";\n\n\t/** Get Created.\n\t * Date this record was created\n\t */\n\tpublic Timestamp getCreated();\n\n /** Column name CreatedBy */\n public static final String COLUMNNAME_CreatedBy = \"CreatedBy\";\n\n\t/** Get Created By.\n\t * User who created this records\n\t */\n\tpublic int getCreatedBy();\n\n /** Column name Description */\n public static final String COLUMNNAME_Description = \"Description\";\n\n\t/** Set Description.\n\t * Optional short description of the record\n\t */\n\tpublic void setDescription (String Description);\n\n\t/** Get Description.\n\t * Optional short description of the record\n\t */\n\tpublic String getDescription();\n\n /** Column name DescriptionNew */\n public static final String COLUMNNAME_DescriptionNew = \"DescriptionNew\";\n\n\t/** Set Description New\t */\n\tpublic void setDescriptionNew (String DescriptionNew);\n\n\t/** Get Description New\t */\n\tpublic String getDescriptionNew();\n\n /** Column name HC_Compensation1 */\n public static final String COLUMNNAME_HC_Compensation1 = \"HC_Compensation1\";\n\n\t/** Set Compensation 1\t */\n\tpublic void setHC_Compensation1 (BigDecimal HC_Compensation1);\n\n\t/** Get Compensation 1\t */\n\tpublic BigDecimal getHC_Compensation1();\n\n /** Column name HC_Compensation2 */\n public static final String COLUMNNAME_HC_Compensation2 = \"HC_Compensation2\";\n\n\t/** Set Compensation 2\t */\n\tpublic void setHC_Compensation2 (BigDecimal HC_Compensation2);\n\n\t/** Get Compensation 2\t */\n\tpublic BigDecimal getHC_Compensation2();\n\n /** Column name HC_Compensation3 */\n public static final String COLUMNNAME_HC_Compensation3 = \"HC_Compensation3\";\n\n\t/** Set Compensation 3\t */\n\tpublic void setHC_Compensation3 (BigDecimal HC_Compensation3);\n\n\t/** Get Compensation 3\t */\n\tpublic BigDecimal getHC_Compensation3();\n\n /** Column name HC_Compensation4 */\n public static final String COLUMNNAME_HC_Compensation4 = \"HC_Compensation4\";\n\n\t/** Set Compensation 4\t */\n\tpublic void setHC_Compensation4 (BigDecimal HC_Compensation4);\n\n\t/** Get Compensation 4\t */\n\tpublic BigDecimal getHC_Compensation4();\n\n /** Column name HC_EffectiveSeq */\n public static final String COLUMNNAME_HC_EffectiveSeq = \"HC_EffectiveSeq\";\n\n\t/** Set Effective Sequence\t */\n\tpublic void setHC_EffectiveSeq (int HC_EffectiveSeq);\n\n\t/** Get Effective Sequence\t */\n\tpublic int getHC_EffectiveSeq();\n\n /** Column name HC_Employee_ID */\n public static final String COLUMNNAME_HC_Employee_ID = \"HC_Employee_ID\";\n\n\t/** Set Employee Data\t */\n\tpublic void setHC_Employee_ID (int HC_Employee_ID);\n\n\t/** Get Employee Data\t */\n\tpublic int getHC_Employee_ID();\n\n\tpublic I_HC_Employee getHC_Employee() throws RuntimeException;\n\n /** Column name HC_EmployeeGrade_ID */\n public static final String COLUMNNAME_HC_EmployeeGrade_ID = \"HC_EmployeeGrade_ID\";\n\n\t/** Set Employee Grade\t */\n\tpublic void setHC_EmployeeGrade_ID (int HC_EmployeeGrade_ID);\n\n\t/** Get Employee Grade\t */\n\tpublic int getHC_EmployeeGrade_ID();\n\n\tpublic I_HC_EmployeeGrade getHC_EmployeeGrade() throws RuntimeException;\n\n /** Column name HC_EmployeeGrade2_ID */\n public static final String COLUMNNAME_HC_EmployeeGrade2_ID = \"HC_EmployeeGrade2_ID\";\n\n\t/** Set Employee Grade To\t */\n\tpublic void setHC_EmployeeGrade2_ID (int HC_EmployeeGrade2_ID);\n\n\t/** Get Employee Grade To\t */\n\tpublic int getHC_EmployeeGrade2_ID();\n\n\tpublic I_HC_EmployeeGrade getHC_EmployeeGrade2() throws RuntimeException;\n\n /** Column name HC_EmployeeJob_ID */\n public static final String COLUMNNAME_HC_EmployeeJob_ID = \"HC_EmployeeJob_ID\";\n\n\t/** Set Employee Job Data\t */\n\tpublic void setHC_EmployeeJob_ID (int HC_EmployeeJob_ID);\n\n\t/** Get Employee Job Data\t */\n\tpublic int getHC_EmployeeJob_ID();\n\n\tpublic I_HC_EmployeeJob getHC_EmployeeJob() throws RuntimeException;\n\n /** Column name HC_Job_ID */\n public static final String COLUMNNAME_HC_Job_ID = \"HC_Job_ID\";\n\n\t/** Set Job\t */\n\tpublic void setHC_Job_ID (int HC_Job_ID);\n\n\t/** Get Job\t */\n\tpublic int getHC_Job_ID();\n\n\tpublic I_HC_Job getHC_Job() throws RuntimeException;\n\n /** Column name HC_JobAction */\n public static final String COLUMNNAME_HC_JobAction = \"HC_JobAction\";\n\n\t/** Set Job Action\t */\n\tpublic void setHC_JobAction (String HC_JobAction);\n\n\t/** Get Job Action\t */\n\tpublic String getHC_JobAction();\n\n /** Column name HC_JobDataChange_ID */\n public static final String COLUMNNAME_HC_JobDataChange_ID = \"HC_JobDataChange_ID\";\n\n\t/** Set Job Data Change\t */\n\tpublic void setHC_JobDataChange_ID (int HC_JobDataChange_ID);\n\n\t/** Get Job Data Change\t */\n\tpublic int getHC_JobDataChange_ID();\n\n\tpublic I_HC_JobDataChange getHC_JobDataChange() throws RuntimeException;\n\n /** Column name HC_Manager_ID */\n public static final String COLUMNNAME_HC_Manager_ID = \"HC_Manager_ID\";\n\n\t/** Set Manager Name\t */\n\tpublic void setHC_Manager_ID (int HC_Manager_ID);\n\n\t/** Get Manager Name\t */\n\tpublic int getHC_Manager_ID();\n\n\tpublic I_HC_Employee getHC_Manager() throws RuntimeException;\n\n /** Column name HC_ManagerTo_ID */\n public static final String COLUMNNAME_HC_ManagerTo_ID = \"HC_ManagerTo_ID\";\n\n\t/** Set Manager To ID\t */\n\tpublic void setHC_ManagerTo_ID (int HC_ManagerTo_ID);\n\n\t/** Get Manager To ID\t */\n\tpublic int getHC_ManagerTo_ID();\n\n\tpublic I_HC_Employee getHC_ManagerTo() throws RuntimeException;\n\n /** Column name HC_Org_ID */\n public static final String COLUMNNAME_HC_Org_ID = \"HC_Org_ID\";\n\n\t/** Set HC Organization\t */\n\tpublic void setHC_Org_ID (int HC_Org_ID);\n\n\t/** Get HC Organization\t */\n\tpublic int getHC_Org_ID();\n\n\tpublic I_HC_Org getHC_Org() throws RuntimeException;\n\n /** Column name HC_Org2_ID */\n public static final String COLUMNNAME_HC_Org2_ID = \"HC_Org2_ID\";\n\n\t/** Set HC Organization To\t */\n\tpublic void setHC_Org2_ID (int HC_Org2_ID);\n\n\t/** Get HC Organization To\t */\n\tpublic int getHC_Org2_ID();\n\n\tpublic I_HC_Org getHC_Org2() throws RuntimeException;\n\n /** Column name HC_PayGroup_ID */\n public static final String COLUMNNAME_HC_PayGroup_ID = \"HC_PayGroup_ID\";\n\n\t/** Set Payroll Group\t */\n\tpublic void setHC_PayGroup_ID (int HC_PayGroup_ID);\n\n\t/** Get Payroll Group\t */\n\tpublic int getHC_PayGroup_ID();\n\n\tpublic I_HC_PayGroup getHC_PayGroup() throws RuntimeException;\n\n /** Column name HC_PreviousJob_ID */\n public static final String COLUMNNAME_HC_PreviousJob_ID = \"HC_PreviousJob_ID\";\n\n\t/** Set Job Sekarang\t */\n\tpublic void setHC_PreviousJob_ID (int HC_PreviousJob_ID);\n\n\t/** Get Job Sekarang\t */\n\tpublic int getHC_PreviousJob_ID();\n\n\tpublic I_HC_Job getHC_PreviousJob() throws RuntimeException;\n\n /** Column name HC_Reason_ID */\n public static final String COLUMNNAME_HC_Reason_ID = \"HC_Reason_ID\";\n\n\t/** Set HC Reason\t */\n\tpublic void setHC_Reason_ID (int HC_Reason_ID);\n\n\t/** Get HC Reason\t */\n\tpublic int getHC_Reason_ID();\n\n\tpublic I_HC_Reason getHC_Reason() throws RuntimeException;\n\n /** Column name HC_Status */\n public static final String COLUMNNAME_HC_Status = \"HC_Status\";\n\n\t/** Set HC Status\t */\n\tpublic void setHC_Status (String HC_Status);\n\n\t/** Get HC Status\t */\n\tpublic String getHC_Status();\n\n /** Column name HC_WorkEndDate */\n public static final String COLUMNNAME_HC_WorkEndDate = \"HC_WorkEndDate\";\n\n\t/** Set Work End Date\t */\n\tpublic void setHC_WorkEndDate (Timestamp HC_WorkEndDate);\n\n\t/** Get Work End Date\t */\n\tpublic Timestamp getHC_WorkEndDate();\n\n /** Column name HC_WorkPeriodDate */\n public static final String COLUMNNAME_HC_WorkPeriodDate = \"HC_WorkPeriodDate\";\n\n\t/** Set WorkPeriodDate\t */\n\tpublic void setHC_WorkPeriodDate (String HC_WorkPeriodDate);\n\n\t/** Get WorkPeriodDate\t */\n\tpublic String getHC_WorkPeriodDate();\n\n /** Column name HC_WorkStartDate */\n public static final String COLUMNNAME_HC_WorkStartDate = \"HC_WorkStartDate\";\n\n\t/** Set WorkStartDate\t */\n\tpublic void setHC_WorkStartDate (Timestamp HC_WorkStartDate);\n\n\t/** Get WorkStartDate\t */\n\tpublic Timestamp getHC_WorkStartDate();\n\n /** Column name HC_WorkStartDate2 */\n public static final String COLUMNNAME_HC_WorkStartDate2 = \"HC_WorkStartDate2\";\n\n\t/** Set Work Start Date Baru\t */\n\tpublic void setHC_WorkStartDate2 (Timestamp HC_WorkStartDate2);\n\n\t/** Get Work Start Date Baru\t */\n\tpublic Timestamp getHC_WorkStartDate2();\n\n /** Column name IHC_JobDataChange_ID */\n public static final String COLUMNNAME_IHC_JobDataChange_ID = \"IHC_JobDataChange_ID\";\n\n\t/** Set IHC_JobDayaChange\t */\n\tpublic void setIHC_JobDataChange_ID (int IHC_JobDataChange_ID);\n\n\t/** Get IHC_JobDayaChange\t */\n\tpublic int getIHC_JobDataChange_ID();\n\n /** Column name IHC_JobDataChange_UU */\n public static final String COLUMNNAME_IHC_JobDataChange_UU = \"IHC_JobDataChange_UU\";\n\n\t/** Set IHC_JobDataChange_UU\t */\n\tpublic void setIHC_JobDataChange_UU (String IHC_JobDataChange_UU);\n\n\t/** Get IHC_JobDataChange_UU\t */\n\tpublic String getIHC_JobDataChange_UU();\n\n /** Column name IsActive */\n public static final String COLUMNNAME_IsActive = \"IsActive\";\n\n\t/** Set Active.\n\t * The record is active in the system\n\t */\n\tpublic void setIsActive (boolean IsActive);\n\n\t/** Get Active.\n\t * The record is active in the system\n\t */\n\tpublic boolean isActive();\n\n /** Column name IsCancelled */\n public static final String COLUMNNAME_IsCancelled = \"IsCancelled\";\n\n\t/** Set Cancelled.\n\t * The transaction was cancelled\n\t */\n\tpublic void setIsCancelled (boolean IsCancelled);\n\n\t/** Get Cancelled.\n\t * The transaction was cancelled\n\t */\n\tpublic boolean isCancelled();\n\n /** Column name NomorSK */\n public static final String COLUMNNAME_NomorSK = \"NomorSK\";\n\n\t/** Set Nomor SK\t */\n\tpublic void setNomorSK (String NomorSK);\n\n\t/** Get Nomor SK\t */\n\tpublic String getNomorSK();\n\n /** Column name NomorSK2 */\n public static final String COLUMNNAME_NomorSK2 = \"NomorSK2\";\n\n\t/** Set Nomor SK Baru\t */\n\tpublic void setNomorSK2 (String NomorSK2);\n\n\t/** Get Nomor SK Baru\t */\n\tpublic String getNomorSK2();\n\n /** Column name OriginalServiceData */\n public static final String COLUMNNAME_OriginalServiceData = \"OriginalServiceData\";\n\n\t/** Set Original Service Date\t */\n\tpublic void setOriginalServiceData (Timestamp OriginalServiceData);\n\n\t/** Get Original Service Date\t */\n\tpublic Timestamp getOriginalServiceData();\n\n /** Column name Processed */\n public static final String COLUMNNAME_Processed = \"Processed\";\n\n\t/** Set Processed.\n\t * The document has been processed\n\t */\n\tpublic void setProcessed (boolean Processed);\n\n\t/** Get Processed.\n\t * The document has been processed\n\t */\n\tpublic boolean isProcessed();\n\n /** Column name SeqNo */\n public static final String COLUMNNAME_SeqNo = \"SeqNo\";\n\n\t/** Set Sequence.\n\t * Method of ordering records;\n lowest number comes first\n\t */\n\tpublic void setSeqNo (int SeqNo);\n\n\t/** Get Sequence.\n\t * Method of ordering records;\n lowest number comes first\n\t */\n\tpublic int getSeqNo();\n\n /** Column name Updated */\n public static final String COLUMNNAME_Updated = \"Updated\";\n\n\t/** Get Updated.\n\t * Date this record was updated\n\t */\n\tpublic Timestamp getUpdated();\n\n /** Column name UpdatedBy */\n public static final String COLUMNNAME_UpdatedBy = \"UpdatedBy\";\n\n\t/** Get Updated By.\n\t * User who updated this records\n\t */\n\tpublic int getUpdatedBy();\n}" ]
[ "0.720387", "0.60612166", "0.5897073", "0.5817371", "0.58169", "0.5653088", "0.5575094", "0.5565293", "0.5523116", "0.55214834", "0.5424825", "0.5421459", "0.5377486", "0.534678", "0.5342339", "0.53190213", "0.5239825", "0.5236659", "0.5227619", "0.513109", "0.5122094", "0.5114957", "0.5110571", "0.5092275", "0.50793064", "0.50710756", "0.50666755", "0.50432736", "0.50225407", "0.5009165", "0.5007035", "0.49747992", "0.49714422", "0.49305487", "0.4928956", "0.49114767", "0.49047396", "0.4894513", "0.488628", "0.48804012", "0.48787948", "0.4848689", "0.4836264", "0.4834436", "0.48120287", "0.4810927", "0.4800393", "0.4796319", "0.4796208", "0.47960824", "0.47906667", "0.4782785", "0.47692993", "0.47681826", "0.47613847", "0.47506967", "0.4746286", "0.47449973", "0.4743577", "0.47416592", "0.47313273", "0.47236001", "0.47218567", "0.47168458", "0.47161394", "0.47148344", "0.47092924", "0.47078082", "0.4703429", "0.46990865", "0.46964943", "0.46792674", "0.4675461", "0.4675461", "0.4675461", "0.4675461", "0.4675461", "0.46668383", "0.4666713", "0.46600732", "0.46600732", "0.4655324", "0.46417722", "0.46361163", "0.46348158", "0.46313247", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.4627627" ]
0.0
-1
This method was generated by MyBatis Generator. This method corresponds to the database table core.report_metadata
public Criteria or() { Criteria criteria = createCriteriaInternal(); oredCriteria.add(criteria); return criteria; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "TableReportMetadata getReportMetadata(String reportId);", "public abstract List<ColumnSpecification> metadata();", "@Override\r\n\t\tpublic DatabaseMetaData getMetaData() throws SQLException {\n\t\t\treturn null;\r\n\t\t}", "@Override\n\tpublic JDBCMetaData getMetaData() throws SQLException {\n\t\treturn null;\n\t}", "private void writeMetaData(ResultSet resultSet) throws SQLException {\n\t System.out.println(\"The columns in the table are: \");\r\n\t System.out.println(\"Table: \" + resultSet.getMetaData().getTableName(1));\r\n\t for (int i = 1; i<= resultSet.getMetaData().getColumnCount(); i++){\r\n\t System.out.println(\"Column \" +i + \" \"+ resultSet.getMetaData().getColumnName(i));\r\n\t }\r\n\t }", "public interface TableMetaData {\n\n\t/** Adds normal column. */\n\tpublic void addColumn(final ColumnMetaData column);\n\n\t/** Adds primary key column. */\n\tpublic void addPrimaryKey(final ColumnMetaData column);\n\n\t/** Returns map of column meta data, keyed by the column label (the alias if provided in the query, otherwise the name). */\n\tpublic Map<String, ColumnMetaData> getColumns();\n\n\t/** Returns database name. */\n\tpublic String getDatabaseName();\n\n\t/** Returns ordered list of columns that are primary keys. */\n\tpublic List<ColumnMetaData> getPrimaryKeys();\n\n\t/**\n\t * Returns fully qualified table name in database-specific form for use in SQL statements. MySQL uses the form\n\t * <code>database.table</code>, for example <code>sakila.film</code>. PostgreSQL uses the form\n\t * <code>database.schema.table</code>, for example <code>sakila.public.film</code>.\n\t */\n\tpublic String getQualifiedTableName();\n\n\t/** Returns row alias. */\n\tpublic String getRowAlias();\n\t\n\t/** Returns row set alias. */\n\tpublic String getRowSetAlias();\n\t\n\t/**\n\t * Returns row alias.\n\t * \n * @deprecated As of 0.8.11 use {@link #getRowAlias()}\n\t */\n\t@Deprecated\n\tpublic String getTableAlias();\n\n\t/** Returns table name. */\n\tpublic String getTableName();\n\n\t/** Returns role of table in the SQL Resource. */\n\tpublic TableRole getTableRole();\n\n\t/** Returns true if the SQL Resource role is child. */\n\tpublic boolean isChild();\n\n\t/** Returns true if the SQL Resource role is parent. */\n\tpublic boolean isParent();\n\n\t/** Sets all the row and row set aliases. */\n\tpublic void setAliases(final String alias, final String rowAlias, final String rowSetAlias);\n\n\t/** Sets attributes. */\n\tpublic void setAttributes(final String tableName, final String qualifedTableName,\n\t\t\tfinal String databaseName, final TableRole tableRole);\n\n\t/**\n\t * Sets table alias.\n\t * \n * @deprecated As of 0.8.11 use {@link #setAliases(String, String, String)}\n\t */\n\t@Deprecated\n\tpublic void setTableAlias(final String tableAlias);\n\t\n\t/** Represents all of the roles a table may plan in a SQL Resource. */\n\t@XmlType(namespace = \"http://restsql.org/schema\")\n\tpublic enum TableRole {\n\t\tChild, ChildExtension, Join, Parent, ParentExtension, Unknown;\n\t}\n}", "public abstract List<String> newReportColumns();", "ResultSetMetaData getMetaData() throws SQLException;", "public DBMetaDataSet getMetaData()\n\t{\n\t\treturn _MetaData;\n\t}", "public interface SqlResourceMetaData {\r\n\r\n\tpublic List<ColumnMetaData> getAllReadColumns();\r\n\r\n\tpublic TableMetaData getChild();\r\n\r\n\tpublic List<TableMetaData> getChildPlusExtTables();\r\n\r\n\tpublic List<ColumnMetaData> getChildReadColumns();\r\n\r\n\tpublic TableMetaData getJoin();\r\n\r\n\tpublic List<TableMetaData> getJoinList();\r\n\r\n\tpublic int getNumberTables();\r\n\r\n\tpublic TableMetaData getParent();\r\n\r\n\tpublic List<TableMetaData> getParentPlusExtTables();\r\n\r\n\tpublic List<ColumnMetaData> getParentReadColumns();\r\n\r\n\tpublic Map<String, TableMetaData> getTableMap();\r\n\r\n\tpublic List<TableMetaData> getTables();\r\n\r\n\tpublic List<TableMetaData> getWriteTables(final Type requestType, final boolean doParent);\r\n\r\n\tpublic boolean hasJoinTable();\r\n\r\n\tpublic boolean hasMultipleDatabases();\r\n\r\n\tpublic boolean isHierarchical();\r\n\r\n\tpublic void init(final String sqlResourceName, final SqlResourceDefinition definition, final SqlBuilder sqlBuilder)\r\n\t\t\tthrows SqlResourceException;\r\n\r\n\tpublic String toHtml();\r\n\r\n\tpublic String toXml();\r\n}", "public void addColumnPathReportId() {\n addColumnInPath(ColumnMetaData.KEY_PATH_ID);\n }", "public ResultSetMetaData getMetaData() throws SQLException {\n\n try {\n int id = getNextId(TraceObject.RESULT_SET_META_DATA);\n if (isDebugEnabled()) {\n debugCodeAssign(\"ResultSetMetaData\", TraceObject.RESULT_SET_META_DATA, id, \"getMetaData()\");\n }\n checkClosed();\n String catalog = conn.getCatalog();\n JdbcResultSetMetaData meta = new JdbcResultSetMetaData(this, null, result, catalog, conn.getSession().getTrace(), id);\n return meta;\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "public MetaData getMetaData();", "@Override\n public DatabaseMetaData getMetaData() throws SQLException\n {\n logger.debug(\n \" public DatabaseMetaData getMetaData() throws SQLException\");\n\n return new SnowflakeDatabaseMetaData(this);\n }", "public DataSetMetaData getMetaData() {\n return this.metadata;\n }", "@Test\n public void metaDataExample1() throws SQLException {\n Connection connection = DriverManager.getConnection(dbUrl, dbUsername, dbPassword);\n // 2. Create statement\n Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);\n // Run sql query and get the result in resultSet object\n String sqlQuery= \"Select * From departments\";\n //String sqlQuery= \"Select first_name, last_name, salary From employees\";\n ResultSet resultSet = statement.executeQuery(sqlQuery);\n\n // we use resultSet metadata to get information about the tables\n // get the resultSet object metadata\n ResultSetMetaData rsMetadata = resultSet.getMetaData();\n\n // List for keeping all rows as a map\n List<Map<String, Object>> queryData = new ArrayList<>();\n\n // while(resultSet.next()) helps to iterate through columns\n while (resultSet.next()) {\n // key(columns) will be string but value can be any type of data. That's why we choose <String, Object>\n Map<String, Object> row = new HashMap<>(); // creating empty Map\n // number of columns\n int colCount = rsMetadata.getColumnCount();\n // for loop helps to iterate through columns\n for (int i = 1; i <= colCount; i++) {\n row.put(rsMetadata.getColumnName(i), resultSet.getObject(i));\n }\n\n queryData.add(row); // adding a Map to the List of Maps\n }\n\n // Printing the rows\n for (Map<String, Object> row: queryData) {\n System.out.println(row.toString());\n\n }\n\n\n\n\n // close all connections\n resultSet.close();\n statement.close();\n connection.close();\n }", "@Override\n\tpublic DBMetadata getMetadata() {\n\t\treturn null;\n\t}", "public MetaData getMetaData() {\r\n \treturn metaData;\r\n }", "@Override\n public SystemMetadata mapRow(ResultSet resultSet, int rowNumber) throws SQLException {\n\n // resultSet contains guid, serialVersion, date_modified, and archived column data\n SystemMetadata systemMetadata = new SystemMetadata();\n ReplicationPolicy replPolicy = new ReplicationPolicy();\n AccessPolicy accessPolicy = new AccessPolicy();\n\n // add guid\n Identifier pid = new Identifier();\n pid.setValue(resultSet.getString(\"guid\"));\n systemMetadata.setIdentifier(pid);\n \n // add seriesId\n Identifier seriesId = new Identifier();\n seriesId.setValue(resultSet.getString(\"series_id\"));\n systemMetadata.setSeriesId(seriesId);\n\n // add serialVersion\n BigInteger serialVersion = new BigInteger(resultSet.getString(\"serial_version\"));\n systemMetadata.setSerialVersion(serialVersion);\n\n // add date_modified\n Date dateSystemMetadataLastModified = resultSet.getTimestamp(\"date_modified\");\n systemMetadata.setDateSysMetadataModified(dateSystemMetadataLastModified);\n\n // add archived value, if it was stored\n boolean archived = resultSet.getBoolean(\"archived\"); // getBoolean returns false for null results\n if (!resultSet.wasNull())\n systemMetadata.setArchived(new Boolean(archived));\n\n // add date_uploaded\n Date dateUploaded = resultSet.getTimestamp(\"date_uploaded\");\n systemMetadata.setDateUploaded(dateUploaded);\n\n // add rights_holder\n Subject rightsHolderSubject = new Subject();\n String rightsHolder = resultSet.getString(\"rights_holder\");\n rightsHolderSubject.setValue(rightsHolder);\n systemMetadata.setRightsHolder(rightsHolderSubject);\n\n // add checksum, checksum_algorithm\n String checksum = resultSet.getString(\"checksum\");\n String checksumAlgorithm = resultSet.getString(\"checksum_algorithm\");\n Checksum checksumObject = new Checksum();\n checksumObject.setValue(checksum);\n checksumObject.setAlgorithm(checksumAlgorithm);\n systemMetadata.setChecksum(checksumObject);\n\n // add origin_member_node\n String originMemberNode = resultSet.getString(\"origin_member_node\");\n if (originMemberNode != null) {\n NodeReference omn = new NodeReference();\n omn.setValue(originMemberNode);\n systemMetadata.setOriginMemberNode(omn);\n }\n\n // add authoritive_member_node\n String authoritativeMemberNode = resultSet.getString(\"authoritive_member_node\");\n if (originMemberNode != null) {\n NodeReference amn = new NodeReference();\n amn.setValue(authoritativeMemberNode);\n systemMetadata.setAuthoritativeMemberNode(amn);\n }\n\n // add submitter\n String submitter = resultSet.getString(\"submitter\");\n if (submitter != null) {\n Subject submitterSubject = new Subject();\n submitterSubject.setValue(submitter);\n systemMetadata.setSubmitter(submitterSubject);\n }\n\n // add object_format\n String fmtidStr = resultSet.getString(\"object_format\");\n ObjectFormatIdentifier fmtid = new ObjectFormatIdentifier();\n fmtid.setValue(fmtidStr);\n systemMetadata.setFormatId(fmtid);\n\n // add size\n String size = resultSet.getString(\"size\");\n systemMetadata.setSize(new BigInteger(size));\n\n // add obsoletes\n String obsoletes = resultSet.getString(\"obsoletes\");\n if (obsoletes != null) {\n Identifier obsoletesId = new Identifier();\n obsoletesId.setValue(obsoletes);\n systemMetadata.setObsoletes(obsoletesId);\n }\n // add obsoleted_by\n String obsoletedBy = resultSet.getString(\"obsoleted_by\");\n if (obsoletedBy != null) {\n Identifier obsoletedById = new Identifier();\n obsoletedById.setValue(obsoletedBy);\n systemMetadata.setObsoletedBy(obsoletedById);\n }\n\n // potentially build a ReplicationPolicy\n \n // add replication_allowed, if it was persisted\n boolean replAllowed = resultSet.getBoolean(\"replication_allowed\"); // getBoolean returns false for null results\n \n if (!resultSet.wasNull()) {\n // populate and add ReplicationPolicy\n ReplicationPolicy replicationPolicy = new ReplicationPolicy();\n \n replicationPolicy.setReplicationAllowed(new Boolean(replAllowed));\n\n // add number_replicas\n int numberOfReplicas = resultSet.getInt(\"number_replicas\"); // getInt returns 0 for null values\n if (numberOfReplicas > 0) {\n replicationPolicy.setNumberReplicas(new Integer(numberOfReplicas));\n\n }\n\n // add preferred and blocked lists\n List<ReplicationPolicyEntry> replPolicies = new ArrayList<ReplicationPolicyEntry>();\n List<NodeReference> preferredNodes = new ArrayList<NodeReference>();\n List<NodeReference> blockedNodes = new ArrayList<NodeReference>();\n\n replPolicies = listReplicationPolicies(pid, localTableMap);\n\n for (ReplicationPolicyEntry policy : replPolicies) {\n Identifier id = policy.getPid();\n String entryPolicy = policy.getPolicy();\n NodeReference node = policy.getMemberNode();\n\n if (entryPolicy.equals(\"preferred\")) {\n preferredNodes.add(node);\n\n } else if (entryPolicy.equals(\"blocked\")) {\n blockedNodes.add(node);\n\n }\n }\n\n replicationPolicy.setPreferredMemberNodeList(preferredNodes);\n replicationPolicy.setBlockedMemberNodeList(blockedNodes);\n\n systemMetadata.setReplicationPolicy(replicationPolicy);\n } else {\n systemMetadata.setReplicationPolicy(null);\n }\n\n // populate and add replicas list\n\n List<Replica> replicas = new ArrayList<Replica>();\n replicas = listReplicaEntries(pid, localTableMap);\n systemMetadata.setReplicaList(replicas);\n\n // populate and add AccessPolicy\n List<AccessRule> accessRules = new ArrayList<AccessRule>();\n accessRules = listAccessRules(pid, localTableMap);\n accessPolicy.setAllowList(accessRules);\n systemMetadata.setAccessPolicy(accessPolicy);\n\n // Validate the system metadata in debug mode using TypeMarshaller\n if (log.isDebugEnabled()) {\n try {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n TypeMarshaller.marshalTypeToOutputStream(systemMetadata, baos);\n log.debug(\"SystemMetadata for pid \" + pid.getValue() + \" is: \"\n + baos.toString());\n\n } catch (MarshallingException e) {\n e.printStackTrace();\n\n } catch (IOException e) {\n e.printStackTrace();\n\n }\n }\n return systemMetadata;\n }", "public MetaData getMetaData() {\n return metaData;\n }", "public ResultSetMetaData getMetaData() throws SQLException\n {\n return m_rs.getMetaData();\n }", "public ShowTableMetadataResponse showTableMetadata(ShowTableMetadataRequest request) throws GPUdbException {\n ShowTableMetadataResponse actualResponse_ = new ShowTableMetadataResponse();\n submitRequest(\"/show/table/metadata\", request, actualResponse_, false);\n return actualResponse_;\n }", "SQLServerResultSetMetaData(SQLServerConnection con, SQLServerResultSet rs) \n {\n traceID = \" SQLServerResultSetMetaData:\" + nextInstanceID();\n this.con = con;\n this.rs =rs;\n assert rs !=null;\n if(logger.isLoggable(java.util.logging.Level.FINE))\n {\n logger.fine(toString() + \" created by (\" + rs.toString() + \")\");\n }\n }", "@Override\n public RavenJObject getMetadata() {\n return metadata;\n }", "@Override\n\tpublic List<Map<String, String>> selectReportInfo(String appId) {\n\t\treturn getSqlMap().queryForList(NAMESPACES + \"queryReportInfo\", appId);\n\t}", "void processMetaData(ResultSet rs) throws SQLException;", "public interface ColumnMetaData {\n\n\t/**\n\t * The uniqueness level of a column data type.\n\t */\n\tenum Uniqueness {\n\t\t/**\n\t\t * No limitations. Multiple instances of a single column meta data type can be attached to a table or even a\n\t\t * single column.\n\t\t */\n\t\tNONE,\n\n\t\t/**\n\t\t * Multiple instances of a single column meta data type can be attached to a table but at most one per column.\n\t\t */\n\t\tCOLUMN,\n\n\t\t/**\n\t\t * At most one instance of the column meta data type can be attached to a table.\n\t\t */\n\t\tTABLE\n\t}\n\n\t/**\n\t * The unique type id of the column meta data.\n\t *\n\t * @return the type id\n\t */\n\tString type();\n\n\t/**\n\t * The uniqueness level of the meta data. Defaults to {@link Uniqueness#NONE} (no restrictions).\n\t *\n\t * @return the uniqueness level\n\t */\n\tdefault Uniqueness uniqueness() {\n\t\treturn Uniqueness.NONE;\n\t}\n\n}", "public HashMap getMetaData() ;", "Metadata getMetaData();", "@Override\n public SystemMetadataStatus mapRow(ResultSet resultSet, int rowNumber) throws SQLException {\n\n // resultSet contains guid, serialVersion, date_modified, and archived column data\n SystemMetadataStatus systemMetadataStatus = new SystemMetadataStatus();\n\n // add guid\n Identifier pid = new Identifier();\n pid.setValue(resultSet.getString(\"guid\"));\n systemMetadataStatus.setPid(pid);\n\n // add serialVersion\n BigInteger serialVersion = new BigInteger(resultSet.getString(\"serial_version\"));\n systemMetadataStatus.setSerialVersion(serialVersion);\n\n // add date_modified\n Date dateSystemMetadataLastModified = resultSet.getTimestamp(\"date_modified\");\n systemMetadataStatus\n .setLastSystemMetadataModificationDate(dateSystemMetadataLastModified);\n\n // add archived\n boolean archived = resultSet.getBoolean(\"archived\"); // getBoolean returns false for null results\n systemMetadataStatus.setDeleted(new Boolean(archived));\n\n return systemMetadataStatus;\n }", "@Override\n public String toString() {\n return \"Report{\" +\n \"reportId=\" + reportId +\n \", reportOpId=\" + reportOp +\n \", date='\" + date + '\\'' +\n \", reportedUserId=\" + reportedUser +\n \", userId=\" + user +\n \", status=\" + status +\n '}';\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}", "CustomReport selectByPrimaryKey(BigDecimal reportId);", "public ResultSetMetaData getMetaData() throws SQLException {\n return currentPreparedStatement.getMetaData();\n }", "public ReportTable(TableView<Report> reportTable) {\n this.reportTable = reportTable;\n }", "public void analizeQueryResultMetaData(ResultSetMetaData rsMetaData, String[] decimalColumns){\n\t\tArrayList<Integer> decimalColumnResultsetIndexes = new ArrayList<Integer>();\n\t\t//if ( decimalColumns==null||decimalColumns.length==0)\n\t\t//\treturn ; \n\t\ttry {\n\t\t\t\n\t\t\t\n\t\t\t//IObjectToStringConverter[] converters = new IObjectToStringConverter[rsMetaData.getColumnCount()] ;\n\t\t\tOuputDataType[] dataTypes = new OuputDataType[rsMetaData.getColumnCount()] ;\n\t\t\tjobContext.put(ExportEngineConstant.COLUMN_CONVERTER_KEY, dataTypes);\n\t\t\tfor ( int i=1 ; i <= rsMetaData.getColumnCount(); i++){\n\t\t\t\tboolean isDecimal = false ; \n\t\t\t\tString nama = rsMetaData.getColumnName(i).toUpperCase();\n\t\t\t\tif ( decimalColumns!=null){\n\t\t\t\t\tfor ( String scn : decimalColumns){\n\t\t\t\t\t\tif ( nama.equalsIgnoreCase(scn)){\n\t\t\t\t\t\t\tdecimalColumnResultsetIndexes.add(i-1);\n\t\t\t\t\t\t\tisDecimal = true ;\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.money; \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\tif( !isDecimal){\n\t\t\t\t\tString tipeCol = rsMetaData.getColumnClassName(i) ;\n\t\t\t\t\tboolean isDate = false ; \n\t\t\t\t\tfor ( String scn : DATE_DATA_TYPES){\n\t\t\t\t\t\tif ( tipeCol.equals(scn)){\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.date; \n\t\t\t\t\t\t\tisDate = true ; \n\t\t\t\t\t\t\tbreak ; \n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( !isDate){\n\t\t\t\t\t\tif (String.class.getName().equals(tipeCol)){\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.string;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.commonToString;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfor ( OuputDataType scn : dataTypes ){\n\t\t\t\tSystem.out.println(\"converter : \" + scn);\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"gagal membaca data column unutk membuat converter object array. error message :\" + e.getMessage() , e); \n\t\t}\n\t\t\n\t\t\n\t}", "private static void writeColumnMetaData(JsonGenerator jg, ColumnMetaData mdt) throws JsonGenerationException, IOException {\n\t\tjg.writeStartObject();\n\t\tjg.writeStringField(\"name\", mdt.columnName);\n\t\tjg.writeStringField(\"type\", mdt.columnType);\n\t\tjg.writeEndObject();;\n\t}", "private String metadata() {\n\t\tStringBuilder s = new StringBuilder();\n\t\ts.append(\"#######################################\");\n\t\ts.append(\"\\n# Metadata of query set\");\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Queries\");\n\t\ts.append(\"\\n# \\tTotal: \" + this.num_queries);\n\t\ts.append(\"\\n# \\tPoint: \" + this.num_pt_queries + \" (\" + 100 * ((double) this.num_pt_queries/this.num_queries) +\"%)\");\n\t\ts.append(\"\\n# \\tRange: \" + this.num_range_queries + \" (\" + 100 * ((double) this.num_range_queries/this.num_queries) +\"%)\");\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Operators\");\n\t\ts.append(\"\\n# \\tTotal: \" + (this.num_and_ops + this.num_or_ops) + \" (\" + ((double) (this.num_and_ops + this.num_or_ops)/this.num_queries) +\" per query)\");\n\t\ts.append(\"\\n# \\tAND: \" + this.num_and_ops);\n\t\ts.append(\"\\n# \\tOR: \" + this.num_or_ops);\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Attributes\");\n\t\ts.append(\"\\n# \\tTotal queried: \" + this.num_attributes);\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Bins\");\n\t\ts.append(\"\\n# \\tTotal queried: \" + this.num_bins);\n\t\ts.append(\"\\n# \\tPer query: \" + ((double) this.num_bins/this.num_queries));\n\t\ts.append(\"\\n#######################################\\n\");\n\t\treturn s.toString();\n\t}", "public List<Map<String, Object>> getDatewiseUpdateData(String columnName) {\n\t\tList<Map<String, Object>> reportData = new ArrayList<>();\n\n\t\tswitch (columnName) {\n\t\tcase \"LASTUPDATED\":\n\t\t\treportData = getLastUpdatedReport();\n\t\t\tbreak;\n\t\tcase \"CREATEDON\":\n\t\t\treportData = getCreatedOnReport();\n\t\t\tbreak;\n\t\tcase \"READON\":\n\t\t\treportData = getReadOnReport();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tSystem.out.println(\"Invalid column name\");\n\t\t}\n\t\treturn reportData;\n\t}", "public Map<String, Object> getMetaData() {\n\t\treturn metaData;\n\t}", "public MetadataArtifactDownloadReport getReport() {\n return report;\n }", "public Map<String, ColumnMetaData> getColumns();", "public abstract String metadata(String property);", "@Override\n\tpublic IColumns createColumns() {\n\t\treturn new WaybillforauditColumns();\n\t}", "public AlterTableMetadataResponse alterTableMetadata(AlterTableMetadataRequest request) throws GPUdbException {\n AlterTableMetadataResponse actualResponse_ = new AlterTableMetadataResponse();\n submitRequest(\"/alter/table/metadata\", request, actualResponse_, false);\n return actualResponse_;\n }", "@Schema(description = \"`status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Binary general-info: The input information used to assemble the report that can be on-going, periodic and actual and projected \")\n public Object getAssessmentInstanceReportRecord() {\n return assessmentInstanceReportRecord;\n }", "Map<String, Object> getAllMetadata();", "@SuppressWarnings(\"all\")\npublic interface I_I_BankDataJP \n{\n\n /** TableName=I_BankDataJP */\n public static final String Table_Name = \"I_BankDataJP\";\n\n /** AD_Table_ID=1000307 */\n public static final int Table_ID = MTable.getTable_ID(Table_Name);\n\n KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);\n\n /** AccessLevel = 3 - Client - Org \n */\n BigDecimal accessLevel = BigDecimal.valueOf(3);\n\n /** Load Meta Data */\n\n /** Column name AD_Client_ID */\n public static final String COLUMNNAME_AD_Client_ID = \"AD_Client_ID\";\n\n\t/** Get Tenant.\n\t * Tenant for this installation.\n\t */\n\tpublic int getAD_Client_ID();\n\n /** Column name AD_OrgTrx_ID */\n public static final String COLUMNNAME_AD_OrgTrx_ID = \"AD_OrgTrx_ID\";\n\n\t/** Set Trx Organization.\n\t * Performing or initiating organization\n\t */\n\tpublic void setAD_OrgTrx_ID (int AD_OrgTrx_ID);\n\n\t/** Get Trx Organization.\n\t * Performing or initiating organization\n\t */\n\tpublic int getAD_OrgTrx_ID();\n\n /** Column name AD_Org_ID */\n public static final String COLUMNNAME_AD_Org_ID = \"AD_Org_ID\";\n\n\t/** Set Organization.\n\t * Organizational entity within tenant\n\t */\n\tpublic void setAD_Org_ID (int AD_Org_ID);\n\n\t/** Get Organization.\n\t * Organizational entity within tenant\n\t */\n\tpublic int getAD_Org_ID();\n\n /** Column name AccountNo */\n public static final String COLUMNNAME_AccountNo = \"AccountNo\";\n\n\t/** Set Account No.\n\t * Account Number\n\t */\n\tpublic void setAccountNo (String AccountNo);\n\n\t/** Get Account No.\n\t * Account Number\n\t */\n\tpublic String getAccountNo();\n\n /** Column name BankAccountType */\n public static final String COLUMNNAME_BankAccountType = \"BankAccountType\";\n\n\t/** Set Bank Account Type.\n\t * Bank Account Type\n\t */\n\tpublic void setBankAccountType (String BankAccountType);\n\n\t/** Get Bank Account Type.\n\t * Bank Account Type\n\t */\n\tpublic String getBankAccountType();\n\n /** Column name C_BankAccount_ID */\n public static final String COLUMNNAME_C_BankAccount_ID = \"C_BankAccount_ID\";\n\n\t/** Set Bank Account.\n\t * Account at the Bank\n\t */\n\tpublic void setC_BankAccount_ID (int C_BankAccount_ID);\n\n\t/** Get Bank Account.\n\t * Account at the Bank\n\t */\n\tpublic int getC_BankAccount_ID();\n\n\tpublic org.compiere.model.I_C_BankAccount getC_BankAccount() throws RuntimeException;\n\n /** Column name C_Bank_ID */\n public static final String COLUMNNAME_C_Bank_ID = \"C_Bank_ID\";\n\n\t/** Set Bank.\n\t * Bank\n\t */\n\tpublic void setC_Bank_ID (int C_Bank_ID);\n\n\t/** Get Bank.\n\t * Bank\n\t */\n\tpublic int getC_Bank_ID();\n\n\tpublic org.compiere.model.I_C_Bank getC_Bank() throws RuntimeException;\n\n /** Column name Created */\n public static final String COLUMNNAME_Created = \"Created\";\n\n\t/** Get Created.\n\t * Date this record was created\n\t */\n\tpublic Timestamp getCreated();\n\n /** Column name CreatedBy */\n public static final String COLUMNNAME_CreatedBy = \"CreatedBy\";\n\n\t/** Get Created By.\n\t * User who created this records\n\t */\n\tpublic int getCreatedBy();\n\n /** Column name DateAcct */\n public static final String COLUMNNAME_DateAcct = \"DateAcct\";\n\n\t/** Set Account Date.\n\t * Accounting Date\n\t */\n\tpublic void setDateAcct (Timestamp DateAcct);\n\n\t/** Get Account Date.\n\t * Accounting Date\n\t */\n\tpublic Timestamp getDateAcct();\n\n /** Column name I_BankDataJP_ID */\n public static final String COLUMNNAME_I_BankDataJP_ID = \"I_BankDataJP_ID\";\n\n\t/** Set I_BankDataJP.\n\t * JPIERE-0595:JPBP\n\t */\n\tpublic void setI_BankDataJP_ID (int I_BankDataJP_ID);\n\n\t/** Get I_BankDataJP.\n\t * JPIERE-0595:JPBP\n\t */\n\tpublic int getI_BankDataJP_ID();\n\n /** Column name I_BankDataJP_UU */\n public static final String COLUMNNAME_I_BankDataJP_UU = \"I_BankDataJP_UU\";\n\n\t/** Set I_BankDataJP_UU\t */\n\tpublic void setI_BankDataJP_UU (String I_BankDataJP_UU);\n\n\t/** Get I_BankDataJP_UU\t */\n\tpublic String getI_BankDataJP_UU();\n\n /** Column name I_ErrorMsg */\n public static final String COLUMNNAME_I_ErrorMsg = \"I_ErrorMsg\";\n\n\t/** Set Import Error Message.\n\t * Messages generated from import process\n\t */\n\tpublic void setI_ErrorMsg (String I_ErrorMsg);\n\n\t/** Get Import Error Message.\n\t * Messages generated from import process\n\t */\n\tpublic String getI_ErrorMsg();\n\n /** Column name I_IsImported */\n public static final String COLUMNNAME_I_IsImported = \"I_IsImported\";\n\n\t/** Set Imported.\n\t * Has this import been processed\n\t */\n\tpublic void setI_IsImported (boolean I_IsImported);\n\n\t/** Get Imported.\n\t * Has this import been processed\n\t */\n\tpublic boolean isI_IsImported();\n\n /** Column name IsActive */\n public static final String COLUMNNAME_IsActive = \"IsActive\";\n\n\t/** Set Active.\n\t * The record is active in the system\n\t */\n\tpublic void setIsActive (boolean IsActive);\n\n\t/** Get Active.\n\t * The record is active in the system\n\t */\n\tpublic boolean isActive();\n\n /** Column name JP_A_Name */\n public static final String COLUMNNAME_JP_A_Name = \"JP_A_Name\";\n\n\t/** Set Account Name\t */\n\tpublic void setJP_A_Name (String JP_A_Name);\n\n\t/** Get Account Name\t */\n\tpublic String getJP_A_Name();\n\n /** Column name JP_A_Name_Kana */\n public static final String COLUMNNAME_JP_A_Name_Kana = \"JP_A_Name_Kana\";\n\n\t/** Set Account Name(Kana)\t */\n\tpublic void setJP_A_Name_Kana (String JP_A_Name_Kana);\n\n\t/** Get Account Name(Kana)\t */\n\tpublic String getJP_A_Name_Kana();\n\n /** Column name JP_AcctDate */\n public static final String COLUMNNAME_JP_AcctDate = \"JP_AcctDate\";\n\n\t/** Set Date of Account Date\t */\n\tpublic void setJP_AcctDate (String JP_AcctDate);\n\n\t/** Get Date of Account Date\t */\n\tpublic String getJP_AcctDate();\n\n /** Column name JP_AcctMonth */\n public static final String COLUMNNAME_JP_AcctMonth = \"JP_AcctMonth\";\n\n\t/** Set Month of Account Date\t */\n\tpublic void setJP_AcctMonth (String JP_AcctMonth);\n\n\t/** Get Month of Account Date\t */\n\tpublic String getJP_AcctMonth();\n\n /** Column name JP_BankAccountType */\n public static final String COLUMNNAME_JP_BankAccountType = \"JP_BankAccountType\";\n\n\t/** Set Bank Account Type\t */\n\tpublic void setJP_BankAccountType (String JP_BankAccountType);\n\n\t/** Get Bank Account Type\t */\n\tpublic String getJP_BankAccountType();\n\n /** Column name JP_BankAccount_Value */\n public static final String COLUMNNAME_JP_BankAccount_Value = \"JP_BankAccount_Value\";\n\n\t/** Set Bank Account(Search Key)\t */\n\tpublic void setJP_BankAccount_Value (String JP_BankAccount_Value);\n\n\t/** Get Bank Account(Search Key)\t */\n\tpublic String getJP_BankAccount_Value();\n\n /** Column name JP_BankDataCustomerCode1 */\n public static final String COLUMNNAME_JP_BankDataCustomerCode1 = \"JP_BankDataCustomerCode1\";\n\n\t/** Set Bank Data Customer Code1\t */\n\tpublic void setJP_BankDataCustomerCode1 (String JP_BankDataCustomerCode1);\n\n\t/** Get Bank Data Customer Code1\t */\n\tpublic String getJP_BankDataCustomerCode1();\n\n /** Column name JP_BankDataCustomerCode2 */\n public static final String COLUMNNAME_JP_BankDataCustomerCode2 = \"JP_BankDataCustomerCode2\";\n\n\t/** Set Bank Data Customer Code2\t */\n\tpublic void setJP_BankDataCustomerCode2 (String JP_BankDataCustomerCode2);\n\n\t/** Get Bank Data Customer Code2\t */\n\tpublic String getJP_BankDataCustomerCode2();\n\n /** Column name JP_BankDataLine_ID */\n public static final String COLUMNNAME_JP_BankDataLine_ID = \"JP_BankDataLine_ID\";\n\n\t/** Set Import Bank Data Line\t */\n\tpublic void setJP_BankDataLine_ID (int JP_BankDataLine_ID);\n\n\t/** Get Import Bank Data Line\t */\n\tpublic int getJP_BankDataLine_ID();\n\n\tpublic I_JP_BankDataLine getJP_BankDataLine() throws RuntimeException;\n\n /** Column name JP_BankData_EDI_Info */\n public static final String COLUMNNAME_JP_BankData_EDI_Info = \"JP_BankData_EDI_Info\";\n\n\t/** Set BankData EDI Info\t */\n\tpublic void setJP_BankData_EDI_Info (String JP_BankData_EDI_Info);\n\n\t/** Get BankData EDI Info\t */\n\tpublic String getJP_BankData_EDI_Info();\n\n /** Column name JP_BankData_ID */\n public static final String COLUMNNAME_JP_BankData_ID = \"JP_BankData_ID\";\n\n\t/** Set Import Bank Data\t */\n\tpublic void setJP_BankData_ID (int JP_BankData_ID);\n\n\t/** Get Import Bank Data\t */\n\tpublic int getJP_BankData_ID();\n\n\tpublic I_JP_BankData getJP_BankData() throws RuntimeException;\n\n /** Column name JP_BankData_ReferenceNo */\n public static final String COLUMNNAME_JP_BankData_ReferenceNo = \"JP_BankData_ReferenceNo\";\n\n\t/** Set Bank Data ReferenceNo\t */\n\tpublic void setJP_BankData_ReferenceNo (String JP_BankData_ReferenceNo);\n\n\t/** Get Bank Data ReferenceNo\t */\n\tpublic String getJP_BankData_ReferenceNo();\n\n /** Column name JP_BankName_Kana */\n public static final String COLUMNNAME_JP_BankName_Kana = \"JP_BankName_Kana\";\n\n\t/** Set Bank Name(Kana)\t */\n\tpublic void setJP_BankName_Kana (String JP_BankName_Kana);\n\n\t/** Get Bank Name(Kana)\t */\n\tpublic String getJP_BankName_Kana();\n\n /** Column name JP_BankName_Kana_Line */\n public static final String COLUMNNAME_JP_BankName_Kana_Line = \"JP_BankName_Kana_Line\";\n\n\t/** Set Bank Name(Kana) Line\t */\n\tpublic void setJP_BankName_Kana_Line (String JP_BankName_Kana_Line);\n\n\t/** Get Bank Name(Kana) Line\t */\n\tpublic String getJP_BankName_Kana_Line();\n\n /** Column name JP_Bank_Name */\n public static final String COLUMNNAME_JP_Bank_Name = \"JP_Bank_Name\";\n\n\t/** Set Bank Name\t */\n\tpublic void setJP_Bank_Name (String JP_Bank_Name);\n\n\t/** Get Bank Name\t */\n\tpublic String getJP_Bank_Name();\n\n /** Column name JP_BranchCode */\n public static final String COLUMNNAME_JP_BranchCode = \"JP_BranchCode\";\n\n\t/** Set Branch Code\t */\n\tpublic void setJP_BranchCode (String JP_BranchCode);\n\n\t/** Get Branch Code\t */\n\tpublic String getJP_BranchCode();\n\n /** Column name JP_BranchName */\n public static final String COLUMNNAME_JP_BranchName = \"JP_BranchName\";\n\n\t/** Set Branch Name\t */\n\tpublic void setJP_BranchName (String JP_BranchName);\n\n\t/** Get Branch Name\t */\n\tpublic String getJP_BranchName();\n\n /** Column name JP_BranchName_Kana */\n public static final String COLUMNNAME_JP_BranchName_Kana = \"JP_BranchName_Kana\";\n\n\t/** Set Branch Name(Kana)\t */\n\tpublic void setJP_BranchName_Kana (String JP_BranchName_Kana);\n\n\t/** Get Branch Name(Kana)\t */\n\tpublic String getJP_BranchName_Kana();\n\n /** Column name JP_BranchName_Kana_Line */\n public static final String COLUMNNAME_JP_BranchName_Kana_Line = \"JP_BranchName_Kana_Line\";\n\n\t/** Set Branch Name(Kana) Line\t */\n\tpublic void setJP_BranchName_Kana_Line (String JP_BranchName_Kana_Line);\n\n\t/** Get Branch Name(Kana) Line\t */\n\tpublic String getJP_BranchName_Kana_Line();\n\n /** Column name JP_Date */\n public static final String COLUMNNAME_JP_Date = \"JP_Date\";\n\n\t/** Set Date.\n\t * Date\n\t */\n\tpublic void setJP_Date (String JP_Date);\n\n\t/** Get Date.\n\t * Date\n\t */\n\tpublic String getJP_Date();\n\n /** Column name JP_Line_Description */\n public static final String COLUMNNAME_JP_Line_Description = \"JP_Line_Description\";\n\n\t/** Set Line Description\t */\n\tpublic void setJP_Line_Description (String JP_Line_Description);\n\n\t/** Get Line Description\t */\n\tpublic String getJP_Line_Description();\n\n /** Column name JP_Month */\n public static final String COLUMNNAME_JP_Month = \"JP_Month\";\n\n\t/** Set Month\t */\n\tpublic void setJP_Month (String JP_Month);\n\n\t/** Get Month\t */\n\tpublic String getJP_Month();\n\n /** Column name JP_OrgTrx_Value */\n public static final String COLUMNNAME_JP_OrgTrx_Value = \"JP_OrgTrx_Value\";\n\n\t/** Set Trx Organization(Search Key)\t */\n\tpublic void setJP_OrgTrx_Value (String JP_OrgTrx_Value);\n\n\t/** Get Trx Organization(Search Key)\t */\n\tpublic String getJP_OrgTrx_Value();\n\n /** Column name JP_Org_Value */\n public static final String COLUMNNAME_JP_Org_Value = \"JP_Org_Value\";\n\n\t/** Set Organization(Search Key)\t */\n\tpublic void setJP_Org_Value (String JP_Org_Value);\n\n\t/** Get Organization(Search Key)\t */\n\tpublic String getJP_Org_Value();\n\n /** Column name JP_RequesterName */\n public static final String COLUMNNAME_JP_RequesterName = \"JP_RequesterName\";\n\n\t/** Set Requester Name\t */\n\tpublic void setJP_RequesterName (String JP_RequesterName);\n\n\t/** Get Requester Name\t */\n\tpublic String getJP_RequesterName();\n\n /** Column name JP_SalesRep_EMail */\n public static final String COLUMNNAME_JP_SalesRep_EMail = \"JP_SalesRep_EMail\";\n\n\t/** Set Sales Rep(E-Mail)\t */\n\tpublic void setJP_SalesRep_EMail (String JP_SalesRep_EMail);\n\n\t/** Get Sales Rep(E-Mail)\t */\n\tpublic String getJP_SalesRep_EMail();\n\n /** Column name JP_SalesRep_Name */\n public static final String COLUMNNAME_JP_SalesRep_Name = \"JP_SalesRep_Name\";\n\n\t/** Set Sales Rep(Name)\t */\n\tpublic void setJP_SalesRep_Name (String JP_SalesRep_Name);\n\n\t/** Get Sales Rep(Name)\t */\n\tpublic String getJP_SalesRep_Name();\n\n /** Column name JP_SalesRep_Value */\n public static final String COLUMNNAME_JP_SalesRep_Value = \"JP_SalesRep_Value\";\n\n\t/** Set Sales Rep(Search Key)\t */\n\tpublic void setJP_SalesRep_Value (String JP_SalesRep_Value);\n\n\t/** Get Sales Rep(Search Key)\t */\n\tpublic String getJP_SalesRep_Value();\n\n /** Column name Processed */\n public static final String COLUMNNAME_Processed = \"Processed\";\n\n\t/** Set Processed.\n\t * The document has been processed\n\t */\n\tpublic void setProcessed (boolean Processed);\n\n\t/** Get Processed.\n\t * The document has been processed\n\t */\n\tpublic boolean isProcessed();\n\n /** Column name Processing */\n public static final String COLUMNNAME_Processing = \"Processing\";\n\n\t/** Set Process Now\t */\n\tpublic void setProcessing (boolean Processing);\n\n\t/** Get Process Now\t */\n\tpublic boolean isProcessing();\n\n /** Column name RoutingNo */\n public static final String COLUMNNAME_RoutingNo = \"RoutingNo\";\n\n\t/** Set Routing No.\n\t * Bank Routing Number\n\t */\n\tpublic void setRoutingNo (String RoutingNo);\n\n\t/** Get Routing No.\n\t * Bank Routing Number\n\t */\n\tpublic String getRoutingNo();\n\n /** Column name SalesRep_ID */\n public static final String COLUMNNAME_SalesRep_ID = \"SalesRep_ID\";\n\n\t/** Set Sales Rep.\n\t * Sales Representative or Company Agent\n\t */\n\tpublic void setSalesRep_ID (int SalesRep_ID);\n\n\t/** Get Sales Rep.\n\t * Sales Representative or Company Agent\n\t */\n\tpublic int getSalesRep_ID();\n\n\tpublic org.compiere.model.I_AD_User getSalesRep() throws RuntimeException;\n\n /** Column name StatementDate */\n public static final String COLUMNNAME_StatementDate = \"StatementDate\";\n\n\t/** Set Statement date.\n\t * Date of the statement\n\t */\n\tpublic void setStatementDate (Timestamp StatementDate);\n\n\t/** Get Statement date.\n\t * Date of the statement\n\t */\n\tpublic Timestamp getStatementDate();\n\n /** Column name StmtAmt */\n public static final String COLUMNNAME_StmtAmt = \"StmtAmt\";\n\n\t/** Set Statement amount.\n\t * Statement Amount\n\t */\n\tpublic void setStmtAmt (BigDecimal StmtAmt);\n\n\t/** Get Statement amount.\n\t * Statement Amount\n\t */\n\tpublic BigDecimal getStmtAmt();\n\n /** Column name TrxAmt */\n public static final String COLUMNNAME_TrxAmt = \"TrxAmt\";\n\n\t/** Set Transaction Amount.\n\t * Amount of a transaction\n\t */\n\tpublic void setTrxAmt (BigDecimal TrxAmt);\n\n\t/** Get Transaction Amount.\n\t * Amount of a transaction\n\t */\n\tpublic BigDecimal getTrxAmt();\n\n /** Column name Updated */\n public static final String COLUMNNAME_Updated = \"Updated\";\n\n\t/** Get Updated.\n\t * Date this record was updated\n\t */\n\tpublic Timestamp getUpdated();\n\n /** Column name UpdatedBy */\n public static final String COLUMNNAME_UpdatedBy = \"UpdatedBy\";\n\n\t/** Get Updated By.\n\t * User who updated this records\n\t */\n\tpublic int getUpdatedBy();\n}", "public Long getReportId() {\n return reportId;\n }", "@Schema(description = \"`status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Binary general-info: The external report in any suitable form including selection filters where appropriate \")\n public Object getAssessmentInstanceReport() {\n return assessmentInstanceReport;\n }", "public static JasperReportBuilder generateReport(ExportData metaData,HttpServletRequest request){\n session = request.getSession(false);\n report = report(); // Creer le rapport\n \n //Logo\n// logoImg = cmp.image(inImg).setStyle(DynamicReports.stl.style().setHorizontalAlignment(HorizontalAlignment.LEFT)); \n //logoImg.setDimension(80,80); \n \n //Definit le style des colonnes d'entàte\n report.setColumnTitleStyle(getHeaderStyle(metaData));\n \n \n \n LinkedHashMap <String,String> criteria = metaData.getCriteria(); \n //Ajout la date d'àdition au critere d'impression\n String valDateProperty = getDateTxt(metaData.getLang()) ;\n String keyDateProperty = \"\" ;\n if ( session.getAttribute(\"activedLocale\").equals(\"fr\") ) {\n keyDateProperty = \"Edité le \" ;\n }\n else {\n keyDateProperty = \"Printed on \" ;\n }\n criteria.put(keyDateProperty,valDateProperty);\n \n StyleBuilder titleStyle = stl.style(boldStyle).setFontSize(16).setForegroundColor(new Color(0, 0, 0)).setHorizontalAlignment(HorizontalAlignment.RIGHT).setRightIndent(20);\n ComponentBuilder<?, ?> logoComponent = cmp.horizontalList(\n //cmp.image(Templates.class.getResource(\"/logopalm.png\")).setFixedDimension(150, 50).setStyle(stl.style().setLeftIndent(20)),\n cmp.verticalList(\n cmp.text(metaData.getTitle()).setStyle(titleStyle)\n )\n ).newRow()\n .add(cmp.horizontalList().add(cmp.hListCell(createCriteriaComponent(criteria,metaData)).heightFixedOnTop()))\n .newRow(); \n \n report.noData(logoComponent, cmp.text(\"Aucun enregistrement trouvà\").setStyle(stl.style().setHorizontalAlignment(HorizontalAlignment.CENTER).setTopPadding(30)));\n\n \n \n lblStyle = stl.style(Templates.columnStyle).setForegroundColor(new Color(60, 91, 31)); // Couleur du text \n colStyle = stl.style(Templates.columnStyle).setHorizontalAlignment(HorizontalAlignment.CENTER);\n \n groupStyle = stl.style().setForegroundColor(new Color(60, 91, 31)) \n .setBold(Boolean.TRUE)\n .setPadding(5)\n .setFontSize(13)\n .setHorizontalAlignment(HorizontalAlignment.CENTER); \n \n\n \n if(metaData.getTitle().equals(ITitle.PARCEL)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PARCEL_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SECTOR)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SECTOR_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BLOCK)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BLOCK_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ATTACK_PHYTO)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TREATMENT)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TREATMENT_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVEST)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVEST_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SERVICING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SERVICING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_PLANTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_PLANTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.FERTILIZATION)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.FERTILIZATION_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.CONTROL_PHYTO)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.CONTROL_PHYTO_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_FOLDING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_FOLDING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.MORTALITY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.MORTALITY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVESTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVESTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BUDGET)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.REPLACEMENT)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.REPLACEMENT_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.METEOROLOGY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.METEOROLOGY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_MATERIAL)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_MATERIAL_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLUVIOMETRY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLUVIOMETRY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ETP)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ETP_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HYGROMETRY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HYGROMETRY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TEMPERATURE)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TEMPERATURE_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.INSULATION)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.INSULATION_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.WORK)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.WORK_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }\n \n \n drColumns = new HashMap<String, TextColumnBuilder>(); \n groups = new ArrayList<String>();\n subtotals = new ArrayList<String>();\n \n //Definit la liste des colonnes du rapport\n ExportGenerator.getColumns(metaData); \n //Definit la liste des sous-totaux du rapport\n ExportGenerator.getSubTotals(metaData);\n \n \n //Genration des sous totaux\n for (String group : groups) {\n ColumnGroupBuilder group2 = grp.group(drColumns.get(group));\n report.groupBy(group2);\n for (String subtotal : subtotals) {\n report.subtotalsAtGroupFooter(group2,sbt.sum(drColumns.get(subtotal)));\n }\n }\n\n for (String subtotal : subtotals) {\n report.subtotalsAtSummary(sbt.sum(drColumns.get(subtotal))); \n }\n \n /*if(ExportGenerator.getColumnByNameField(\"plantingName\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL \"), ExportGenerator.getColumnByNameField(\"plantingName\"), Calculation.NOTHING));\n }*//*else if(ExportGenerator.getColumnByNameField(\"invoiceCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"invoiceCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"planterCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL\"), ExportGenerator.getColumnByNameField(\"planterCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"transportTicket\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"transportTicket\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"deliveryDate\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"deliveryDate\"), Calculation.NOTHING));\n }\n else if(ExportGenerator.getColumnByNameField(\"arroundPlantingTicketNumber\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"arroundPlantingTicketNumber\"), Calculation.NOTHING));\n }\n else if(ExportGenerator.getColumnByNameField(\"planterNumber\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"planterNumber\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"startPaymentDate\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"startPaymentDate\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"sectorCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"sectorCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"month\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL \"), ExportGenerator.getColumnByNameField(\"month\"), Calculation.NOTHING));\n }*/\n \n\n \n \n //Genere la source de donnàes du rapport\n report.setDataSource(metaData.getData());\n \n report.highlightDetailEvenRows(); \n \n \n // Definition de l'entete : valable uniquement pour la 1ere page\n HorizontalListBuilder hlb= null;\n \n hlb = cmp.horizontalList().add(\n cmp.hListCell(createCriteriaComponent(criteria,metaData)).heightFixedOnTop()\n );\n\n \n report.title(\n createCustomTitleComponent(metaData.getTitle()), // Titre\n hlb,// Liste Horizontal des Critàres \n cmp.verticalGap(12) // Marge de 12 px entre chaque critàre\n ); \n \n \n \n report.setPageMargin(DynamicReports.margin().setLeft(15).setTop(30).setRight(15).setBottom(30));\n report.setPageFormat(PageType.A3, PageOrientation.LANDSCAPE);\n report.pageFooter(DynamicReports.cmp.pageXslashY());\n return report;\n \n }", "public interface IReportDao extends IBaseDao<Report, Integer> {\n\t\n\t/**\n\t * 添加举报信息\n\t * @param report\n\t */\n\tpublic boolean addReport(Report report);\n\t\n\t/**\n\t * 修改举报信息\n\t * @param report\n\t * @return\n\t */\n\tpublic boolean updateReport(Report report);\n\t\n//\t/**\n//\t * 是否已经举报\n//\t * @param getReportGto\n//\t * @return\n//\t */\n//\tpublic boolean isHouseInfoReported(GetReportGto getReportGto);\n\t\n\t/**\n\t * 获取我与某条房源的举报信息\n\t * @param getReportGto\n\t * @return\n\t */\n\tpublic List<Report> getMyReport(GetReportGto getReportGto);\n}", "public interface TableDetailMapper {\n\n @Select(\"select * from dxh_sys.tabledetail where vendorId=0 and tableName='skuProfitDayReport'\")\n List<Map<String, Object>> list();\n\n}", "public Report getReport();", "BoltResultSetMetaData(List<Type> types, List<String> keys) {\n\t\tsuper(keys);\n\t\tthis.columnType = types.toArray(new Type[this.keys.size() + 1]);\n\n\t\t// we init columnType with the first record\n\t\t// in case first == last record\n\t\t/*for (int i = 1; i <= this.keys.size(); i++) {\n\t\t\tcolumnType[i] = this.getColumnDriverTypeOrDefault(i, InternalTypeSystem.TYPE_SYSTEM.STRING());\n\t\t}*/\n\t}", "@Override\r\n\tpublic Map<String, Object> getMetadata() {\n\t\treturn null;\r\n\t}", "@Select({\n \"select\",\n \"JNLNO, TRANDATE, ACCOUNTDATE, CHECKTYPE, STATUS, DONETIME, FILENAME\",\n \"from B_UMB_CHECKING_LOG\",\n \"where JNLNO = #{jnlno,jdbcType=VARCHAR}\"\n })\n @Results({\n @Result(column=\"JNLNO\", property=\"jnlno\", jdbcType=JdbcType.VARCHAR, id=true),\n @Result(column=\"TRANDATE\", property=\"trandate\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"ACCOUNTDATE\", property=\"accountdate\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"CHECKTYPE\", property=\"checktype\", jdbcType=JdbcType.CHAR),\n @Result(column=\"STATUS\", property=\"status\", jdbcType=JdbcType.CHAR),\n @Result(column=\"DONETIME\", property=\"donetime\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"FILENAME\", property=\"filename\", jdbcType=JdbcType.VARCHAR)\n })\n BUMBCheckingLog selectByPrimaryKey(BUMBCheckingLogKey key);", "@SqlQuery(\"select * from PLAYERSTATS\")\n List<PlayerStats> getAll();", "protected String getMetadataName() {\r\n\t\treturn METADATA_NAME;\r\n\t}", "public abstract String getSummaryForDatabase();", "private interface ReportColumnCallback\n {\n void handleReportColumn(DashboardReport report, String columnName) throws MojoExecutionException;\n }", "public ReportMetadataExample() {\n\t\toredCriteria = new ArrayList<Criteria>();\n\t}", "@Override\r\n \tpublic MetaData getMetaData(HttpHeaders headers) {\n \t\ttry {\r\n \t\t\treturn MetaDataUtil.getMetaData(new ViewListeEleve(), new HashMap<String, MetaData>(),new ArrayList<String>());\r\n \t\t} catch (Exception e) {\r\n \t\t\t// TODO Auto-generated catch block\r\n \t\t\tthrow new WebApplicationException(Response.serverError().entity(new String(\"MetaData parse error\")).build());\r\n \t\t} \r\n \t}", "public DefaultMetaData getMetaData() {\n\t\treturn this.metaData;\n\t}", "@Override\n public Map<String, String> createFieldToPropertyMapping() {\n final Map<String, String> mapping = super.createFieldToPropertyMapping();\n mapping.put(this.tableName + \".rsres_id\", \"id\");\n mapping.put(this.tableName + \".resource_id\", \"resourceId\");\n mapping.put(this.tableName + \".quantity\", QUANTITY);\n mapping.put(this.tableName + \".cost_rsres\", \"cost\");\n\n return mapping;\n }", "Report createReport();", "public String getMetaDataFileName() {\n return null;\n }", "public JDBCRawSqlQueryMetaData(Method method) {\n this.method = method;\n }", "public String getReportsToBeGenerated(String reportType) {\r\n\t\tString query = \"\";\r\n\t\t\r\n\t\ttry (Connection connection = DatabaseConnection.getMySQLConnection();\r\n\t\t\t PreparedStatement stmt = connection.prepareStatement(query);) {\r\n\t\t\tResultSet result = stmt.executeQuery();\r\n\t\t\tStringJoiner reports = new StringJoiner(\",,\");\r\n\t\t\twhile (result.next()) {\r\n\t\t\t\treports.add(result.getString(\"REPORT_NAME\"));\r\n\t\t\t}\r\n\t\t\treturn reports.toString();\r\n\t\t} catch (SQLException e) {\r\n\t\t\tthrow new ReportGenerationException(\"An error occurred while retrieving reports to be generated.\", e);\r\n\t\t}\r\n\t}", "public Map getMetadata() {\n return metadata;\n }", "public DatabaseMetaData(Statement s) {\n\t\t_stmt = s; // SQL-Connection\n\t\t_buffer = new StringBuffer(); // Output goes here\n\t\t_tables = new ArrayList<String>(); // List of tables\n\t\t\n\t\ttry {\n\t\t\t// Put table names in `_tables`\n\t\t\textractTableNames(_stmt.executeQuery(composeTableNamesQuery()));\n\n\t\t\t// fetch the string representation of each tables meta-data\n\t\t\tfor (String name : _tables)\n\t\t\t\t_buffer.append(new TableMeta(name)); \n\t\t} catch (SQLException e) { _error = true;}\n\t}", "private Builder() {\n super(net.explorys.samhat.z12.r837.X837Ins_2320_MOA_MedicareOutpatientAdjudicationInformation.SCHEMA$);\n }", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "public String toString() {\n return \"[JDBCRawSqlQueryMetaData : method=\" + method + \"]\";\n }", "Report selectByPrimaryKey(Integer id);", "java.lang.String getMetadata(int index);", "java.lang.String getMetadata(int index);", "public Integer getReportId() {\n return reportId;\n }", "@Schema(description = \"`status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Code general-info: The type of external report available \")\n public String getAssessmentInstanceReportType() {\n return assessmentInstanceReportType;\n }", "private static Map<String, ColumnMetaData> buildColumnMetadataMap(ResultSet rs) {\n\t\t/*\n\t\t * LinkedHashmap to preserve key traversal order.\n\t\t * Important as we output rows as arrays of values where the index position in\n\t\t * the row implicitly corresponds to the entry order of the column map.\n\t\t * Reason for this is performance. \n\t\t */\n\t\tMap<String, ColumnMetaData> columnMap = Maps.newLinkedHashMap();\n\t\ttry {\n\t\t\tResultSetMetaData rmd = rs.getMetaData();\n\t\t\tfor (int i=1; i<= rmd.getColumnCount(); i++) {\n\t\t\t\tColumnMetaData cmd = \n\t\t\t\t\tnew ColumnMetaData(rmd.getColumnName(i), rmd.getColumnTypeName(i));\n\t\t\t\tcolumnMap.put(cmd.columnName, cmd);\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\tThrowables.propagate(e);\n\t\t}\n\t\treturn columnMap;\n\t}", "@Override\r\n\tpublic List<ReportAndSummary> findAll() {\n\t\tList<ReportAndSummary> result = reportAndSummaryDao.findAll();\r\n\t\treturn result;\r\n\t}", "protected String getSqlTable() {\n\t\treturn \"Project\";\n\t}", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "public interface I_IHC_JobDataChange \n{\n\n /** TableName=IHC_JobDataChange */\n public static final String Table_Name = \"IHC_JobDataChange\";\n\n /** AD_Table_ID=1100135 */\n public static final int Table_ID = MTable.getTable_ID(Table_Name);\n\n KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);\n\n /** AccessLevel = 3 - Client - Org \n */\n BigDecimal accessLevel = BigDecimal.valueOf(3);\n\n /** Load Meta Data */\n\n /** Column name AD_Client_ID */\n public static final String COLUMNNAME_AD_Client_ID = \"AD_Client_ID\";\n\n\t/** Get Client.\n\t * Client/Tenant for this installation.\n\t */\n\tpublic int getAD_Client_ID();\n\n /** Column name AD_Org_ID */\n public static final String COLUMNNAME_AD_Org_ID = \"AD_Org_ID\";\n\n\t/** Set Organization.\n\t * Organizational entity within client\n\t */\n\tpublic void setAD_Org_ID (int AD_Org_ID);\n\n\t/** Get Organization.\n\t * Organizational entity within client\n\t */\n\tpublic int getAD_Org_ID();\n\n /** Column name BPJSRegistrationDate */\n public static final String COLUMNNAME_BPJSRegistrationDate = \"BPJSRegistrationDate\";\n\n\t/** Set BPJS Registration Date\t */\n\tpublic void setBPJSRegistrationDate (Timestamp BPJSRegistrationDate);\n\n\t/** Get BPJS Registration Date\t */\n\tpublic Timestamp getBPJSRegistrationDate();\n\n /** Column name Created */\n public static final String COLUMNNAME_Created = \"Created\";\n\n\t/** Get Created.\n\t * Date this record was created\n\t */\n\tpublic Timestamp getCreated();\n\n /** Column name CreatedBy */\n public static final String COLUMNNAME_CreatedBy = \"CreatedBy\";\n\n\t/** Get Created By.\n\t * User who created this records\n\t */\n\tpublic int getCreatedBy();\n\n /** Column name Description */\n public static final String COLUMNNAME_Description = \"Description\";\n\n\t/** Set Description.\n\t * Optional short description of the record\n\t */\n\tpublic void setDescription (String Description);\n\n\t/** Get Description.\n\t * Optional short description of the record\n\t */\n\tpublic String getDescription();\n\n /** Column name DescriptionNew */\n public static final String COLUMNNAME_DescriptionNew = \"DescriptionNew\";\n\n\t/** Set Description New\t */\n\tpublic void setDescriptionNew (String DescriptionNew);\n\n\t/** Get Description New\t */\n\tpublic String getDescriptionNew();\n\n /** Column name HC_Compensation1 */\n public static final String COLUMNNAME_HC_Compensation1 = \"HC_Compensation1\";\n\n\t/** Set Compensation 1\t */\n\tpublic void setHC_Compensation1 (BigDecimal HC_Compensation1);\n\n\t/** Get Compensation 1\t */\n\tpublic BigDecimal getHC_Compensation1();\n\n /** Column name HC_Compensation2 */\n public static final String COLUMNNAME_HC_Compensation2 = \"HC_Compensation2\";\n\n\t/** Set Compensation 2\t */\n\tpublic void setHC_Compensation2 (BigDecimal HC_Compensation2);\n\n\t/** Get Compensation 2\t */\n\tpublic BigDecimal getHC_Compensation2();\n\n /** Column name HC_Compensation3 */\n public static final String COLUMNNAME_HC_Compensation3 = \"HC_Compensation3\";\n\n\t/** Set Compensation 3\t */\n\tpublic void setHC_Compensation3 (BigDecimal HC_Compensation3);\n\n\t/** Get Compensation 3\t */\n\tpublic BigDecimal getHC_Compensation3();\n\n /** Column name HC_Compensation4 */\n public static final String COLUMNNAME_HC_Compensation4 = \"HC_Compensation4\";\n\n\t/** Set Compensation 4\t */\n\tpublic void setHC_Compensation4 (BigDecimal HC_Compensation4);\n\n\t/** Get Compensation 4\t */\n\tpublic BigDecimal getHC_Compensation4();\n\n /** Column name HC_EffectiveSeq */\n public static final String COLUMNNAME_HC_EffectiveSeq = \"HC_EffectiveSeq\";\n\n\t/** Set Effective Sequence\t */\n\tpublic void setHC_EffectiveSeq (int HC_EffectiveSeq);\n\n\t/** Get Effective Sequence\t */\n\tpublic int getHC_EffectiveSeq();\n\n /** Column name HC_Employee_ID */\n public static final String COLUMNNAME_HC_Employee_ID = \"HC_Employee_ID\";\n\n\t/** Set Employee Data\t */\n\tpublic void setHC_Employee_ID (int HC_Employee_ID);\n\n\t/** Get Employee Data\t */\n\tpublic int getHC_Employee_ID();\n\n\tpublic I_HC_Employee getHC_Employee() throws RuntimeException;\n\n /** Column name HC_EmployeeGrade_ID */\n public static final String COLUMNNAME_HC_EmployeeGrade_ID = \"HC_EmployeeGrade_ID\";\n\n\t/** Set Employee Grade\t */\n\tpublic void setHC_EmployeeGrade_ID (int HC_EmployeeGrade_ID);\n\n\t/** Get Employee Grade\t */\n\tpublic int getHC_EmployeeGrade_ID();\n\n\tpublic I_HC_EmployeeGrade getHC_EmployeeGrade() throws RuntimeException;\n\n /** Column name HC_EmployeeGrade2_ID */\n public static final String COLUMNNAME_HC_EmployeeGrade2_ID = \"HC_EmployeeGrade2_ID\";\n\n\t/** Set Employee Grade To\t */\n\tpublic void setHC_EmployeeGrade2_ID (int HC_EmployeeGrade2_ID);\n\n\t/** Get Employee Grade To\t */\n\tpublic int getHC_EmployeeGrade2_ID();\n\n\tpublic I_HC_EmployeeGrade getHC_EmployeeGrade2() throws RuntimeException;\n\n /** Column name HC_EmployeeJob_ID */\n public static final String COLUMNNAME_HC_EmployeeJob_ID = \"HC_EmployeeJob_ID\";\n\n\t/** Set Employee Job Data\t */\n\tpublic void setHC_EmployeeJob_ID (int HC_EmployeeJob_ID);\n\n\t/** Get Employee Job Data\t */\n\tpublic int getHC_EmployeeJob_ID();\n\n\tpublic I_HC_EmployeeJob getHC_EmployeeJob() throws RuntimeException;\n\n /** Column name HC_Job_ID */\n public static final String COLUMNNAME_HC_Job_ID = \"HC_Job_ID\";\n\n\t/** Set Job\t */\n\tpublic void setHC_Job_ID (int HC_Job_ID);\n\n\t/** Get Job\t */\n\tpublic int getHC_Job_ID();\n\n\tpublic I_HC_Job getHC_Job() throws RuntimeException;\n\n /** Column name HC_JobAction */\n public static final String COLUMNNAME_HC_JobAction = \"HC_JobAction\";\n\n\t/** Set Job Action\t */\n\tpublic void setHC_JobAction (String HC_JobAction);\n\n\t/** Get Job Action\t */\n\tpublic String getHC_JobAction();\n\n /** Column name HC_JobDataChange_ID */\n public static final String COLUMNNAME_HC_JobDataChange_ID = \"HC_JobDataChange_ID\";\n\n\t/** Set Job Data Change\t */\n\tpublic void setHC_JobDataChange_ID (int HC_JobDataChange_ID);\n\n\t/** Get Job Data Change\t */\n\tpublic int getHC_JobDataChange_ID();\n\n\tpublic I_HC_JobDataChange getHC_JobDataChange() throws RuntimeException;\n\n /** Column name HC_Manager_ID */\n public static final String COLUMNNAME_HC_Manager_ID = \"HC_Manager_ID\";\n\n\t/** Set Manager Name\t */\n\tpublic void setHC_Manager_ID (int HC_Manager_ID);\n\n\t/** Get Manager Name\t */\n\tpublic int getHC_Manager_ID();\n\n\tpublic I_HC_Employee getHC_Manager() throws RuntimeException;\n\n /** Column name HC_ManagerTo_ID */\n public static final String COLUMNNAME_HC_ManagerTo_ID = \"HC_ManagerTo_ID\";\n\n\t/** Set Manager To ID\t */\n\tpublic void setHC_ManagerTo_ID (int HC_ManagerTo_ID);\n\n\t/** Get Manager To ID\t */\n\tpublic int getHC_ManagerTo_ID();\n\n\tpublic I_HC_Employee getHC_ManagerTo() throws RuntimeException;\n\n /** Column name HC_Org_ID */\n public static final String COLUMNNAME_HC_Org_ID = \"HC_Org_ID\";\n\n\t/** Set HC Organization\t */\n\tpublic void setHC_Org_ID (int HC_Org_ID);\n\n\t/** Get HC Organization\t */\n\tpublic int getHC_Org_ID();\n\n\tpublic I_HC_Org getHC_Org() throws RuntimeException;\n\n /** Column name HC_Org2_ID */\n public static final String COLUMNNAME_HC_Org2_ID = \"HC_Org2_ID\";\n\n\t/** Set HC Organization To\t */\n\tpublic void setHC_Org2_ID (int HC_Org2_ID);\n\n\t/** Get HC Organization To\t */\n\tpublic int getHC_Org2_ID();\n\n\tpublic I_HC_Org getHC_Org2() throws RuntimeException;\n\n /** Column name HC_PayGroup_ID */\n public static final String COLUMNNAME_HC_PayGroup_ID = \"HC_PayGroup_ID\";\n\n\t/** Set Payroll Group\t */\n\tpublic void setHC_PayGroup_ID (int HC_PayGroup_ID);\n\n\t/** Get Payroll Group\t */\n\tpublic int getHC_PayGroup_ID();\n\n\tpublic I_HC_PayGroup getHC_PayGroup() throws RuntimeException;\n\n /** Column name HC_PreviousJob_ID */\n public static final String COLUMNNAME_HC_PreviousJob_ID = \"HC_PreviousJob_ID\";\n\n\t/** Set Job Sekarang\t */\n\tpublic void setHC_PreviousJob_ID (int HC_PreviousJob_ID);\n\n\t/** Get Job Sekarang\t */\n\tpublic int getHC_PreviousJob_ID();\n\n\tpublic I_HC_Job getHC_PreviousJob() throws RuntimeException;\n\n /** Column name HC_Reason_ID */\n public static final String COLUMNNAME_HC_Reason_ID = \"HC_Reason_ID\";\n\n\t/** Set HC Reason\t */\n\tpublic void setHC_Reason_ID (int HC_Reason_ID);\n\n\t/** Get HC Reason\t */\n\tpublic int getHC_Reason_ID();\n\n\tpublic I_HC_Reason getHC_Reason() throws RuntimeException;\n\n /** Column name HC_Status */\n public static final String COLUMNNAME_HC_Status = \"HC_Status\";\n\n\t/** Set HC Status\t */\n\tpublic void setHC_Status (String HC_Status);\n\n\t/** Get HC Status\t */\n\tpublic String getHC_Status();\n\n /** Column name HC_WorkEndDate */\n public static final String COLUMNNAME_HC_WorkEndDate = \"HC_WorkEndDate\";\n\n\t/** Set Work End Date\t */\n\tpublic void setHC_WorkEndDate (Timestamp HC_WorkEndDate);\n\n\t/** Get Work End Date\t */\n\tpublic Timestamp getHC_WorkEndDate();\n\n /** Column name HC_WorkPeriodDate */\n public static final String COLUMNNAME_HC_WorkPeriodDate = \"HC_WorkPeriodDate\";\n\n\t/** Set WorkPeriodDate\t */\n\tpublic void setHC_WorkPeriodDate (String HC_WorkPeriodDate);\n\n\t/** Get WorkPeriodDate\t */\n\tpublic String getHC_WorkPeriodDate();\n\n /** Column name HC_WorkStartDate */\n public static final String COLUMNNAME_HC_WorkStartDate = \"HC_WorkStartDate\";\n\n\t/** Set WorkStartDate\t */\n\tpublic void setHC_WorkStartDate (Timestamp HC_WorkStartDate);\n\n\t/** Get WorkStartDate\t */\n\tpublic Timestamp getHC_WorkStartDate();\n\n /** Column name HC_WorkStartDate2 */\n public static final String COLUMNNAME_HC_WorkStartDate2 = \"HC_WorkStartDate2\";\n\n\t/** Set Work Start Date Baru\t */\n\tpublic void setHC_WorkStartDate2 (Timestamp HC_WorkStartDate2);\n\n\t/** Get Work Start Date Baru\t */\n\tpublic Timestamp getHC_WorkStartDate2();\n\n /** Column name IHC_JobDataChange_ID */\n public static final String COLUMNNAME_IHC_JobDataChange_ID = \"IHC_JobDataChange_ID\";\n\n\t/** Set IHC_JobDayaChange\t */\n\tpublic void setIHC_JobDataChange_ID (int IHC_JobDataChange_ID);\n\n\t/** Get IHC_JobDayaChange\t */\n\tpublic int getIHC_JobDataChange_ID();\n\n /** Column name IHC_JobDataChange_UU */\n public static final String COLUMNNAME_IHC_JobDataChange_UU = \"IHC_JobDataChange_UU\";\n\n\t/** Set IHC_JobDataChange_UU\t */\n\tpublic void setIHC_JobDataChange_UU (String IHC_JobDataChange_UU);\n\n\t/** Get IHC_JobDataChange_UU\t */\n\tpublic String getIHC_JobDataChange_UU();\n\n /** Column name IsActive */\n public static final String COLUMNNAME_IsActive = \"IsActive\";\n\n\t/** Set Active.\n\t * The record is active in the system\n\t */\n\tpublic void setIsActive (boolean IsActive);\n\n\t/** Get Active.\n\t * The record is active in the system\n\t */\n\tpublic boolean isActive();\n\n /** Column name IsCancelled */\n public static final String COLUMNNAME_IsCancelled = \"IsCancelled\";\n\n\t/** Set Cancelled.\n\t * The transaction was cancelled\n\t */\n\tpublic void setIsCancelled (boolean IsCancelled);\n\n\t/** Get Cancelled.\n\t * The transaction was cancelled\n\t */\n\tpublic boolean isCancelled();\n\n /** Column name NomorSK */\n public static final String COLUMNNAME_NomorSK = \"NomorSK\";\n\n\t/** Set Nomor SK\t */\n\tpublic void setNomorSK (String NomorSK);\n\n\t/** Get Nomor SK\t */\n\tpublic String getNomorSK();\n\n /** Column name NomorSK2 */\n public static final String COLUMNNAME_NomorSK2 = \"NomorSK2\";\n\n\t/** Set Nomor SK Baru\t */\n\tpublic void setNomorSK2 (String NomorSK2);\n\n\t/** Get Nomor SK Baru\t */\n\tpublic String getNomorSK2();\n\n /** Column name OriginalServiceData */\n public static final String COLUMNNAME_OriginalServiceData = \"OriginalServiceData\";\n\n\t/** Set Original Service Date\t */\n\tpublic void setOriginalServiceData (Timestamp OriginalServiceData);\n\n\t/** Get Original Service Date\t */\n\tpublic Timestamp getOriginalServiceData();\n\n /** Column name Processed */\n public static final String COLUMNNAME_Processed = \"Processed\";\n\n\t/** Set Processed.\n\t * The document has been processed\n\t */\n\tpublic void setProcessed (boolean Processed);\n\n\t/** Get Processed.\n\t * The document has been processed\n\t */\n\tpublic boolean isProcessed();\n\n /** Column name SeqNo */\n public static final String COLUMNNAME_SeqNo = \"SeqNo\";\n\n\t/** Set Sequence.\n\t * Method of ordering records;\n lowest number comes first\n\t */\n\tpublic void setSeqNo (int SeqNo);\n\n\t/** Get Sequence.\n\t * Method of ordering records;\n lowest number comes first\n\t */\n\tpublic int getSeqNo();\n\n /** Column name Updated */\n public static final String COLUMNNAME_Updated = \"Updated\";\n\n\t/** Get Updated.\n\t * Date this record was updated\n\t */\n\tpublic Timestamp getUpdated();\n\n /** Column name UpdatedBy */\n public static final String COLUMNNAME_UpdatedBy = \"UpdatedBy\";\n\n\t/** Get Updated By.\n\t * User who updated this records\n\t */\n\tpublic int getUpdatedBy();\n}" ]
[ "0.7202898", "0.60632956", "0.58984065", "0.58183134", "0.5817594", "0.56543213", "0.5574047", "0.5565886", "0.5524865", "0.55226165", "0.5423179", "0.5421737", "0.5379457", "0.5348147", "0.5343479", "0.5319976", "0.5241551", "0.5238874", "0.5229574", "0.5133239", "0.5122431", "0.51177025", "0.51117975", "0.50930023", "0.50780755", "0.50722116", "0.50675434", "0.50449616", "0.50247383", "0.5010279", "0.5003492", "0.49746117", "0.49696276", "0.49307886", "0.49275762", "0.4912492", "0.49052197", "0.48956972", "0.4885308", "0.488236", "0.48762375", "0.48499364", "0.48376077", "0.48360834", "0.48132738", "0.48091698", "0.4798098", "0.47974053", "0.4796658", "0.4792996", "0.47886494", "0.47818476", "0.47707915", "0.47644812", "0.47628173", "0.47527128", "0.47466338", "0.474518", "0.4744774", "0.47409937", "0.47307655", "0.47233862", "0.4722756", "0.4717715", "0.47149938", "0.47131443", "0.47092754", "0.47054762", "0.4705152", "0.47009587", "0.46984246", "0.4680089", "0.46766418", "0.46766418", "0.46766418", "0.46766418", "0.46766418", "0.46676517", "0.4664517", "0.46610156", "0.46610156", "0.46514818", "0.46382514", "0.4636637", "0.46333814", "0.46316957", "0.46309724", "0.46309724", "0.46309724", "0.46309724", "0.46309724", "0.46309724", "0.46309724", "0.46309724", "0.46309724", "0.46309724", "0.46309724", "0.46309724", "0.46309724", "0.46309724", "0.46286348" ]
0.0
-1
This method was generated by MyBatis Generator. This method corresponds to the database table core.report_metadata
public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); if (oredCriteria.size() == 0) { oredCriteria.add(criteria); } return criteria; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "TableReportMetadata getReportMetadata(String reportId);", "public abstract List<ColumnSpecification> metadata();", "@Override\r\n\t\tpublic DatabaseMetaData getMetaData() throws SQLException {\n\t\t\treturn null;\r\n\t\t}", "@Override\n\tpublic JDBCMetaData getMetaData() throws SQLException {\n\t\treturn null;\n\t}", "private void writeMetaData(ResultSet resultSet) throws SQLException {\n\t System.out.println(\"The columns in the table are: \");\r\n\t System.out.println(\"Table: \" + resultSet.getMetaData().getTableName(1));\r\n\t for (int i = 1; i<= resultSet.getMetaData().getColumnCount(); i++){\r\n\t System.out.println(\"Column \" +i + \" \"+ resultSet.getMetaData().getColumnName(i));\r\n\t }\r\n\t }", "public interface TableMetaData {\n\n\t/** Adds normal column. */\n\tpublic void addColumn(final ColumnMetaData column);\n\n\t/** Adds primary key column. */\n\tpublic void addPrimaryKey(final ColumnMetaData column);\n\n\t/** Returns map of column meta data, keyed by the column label (the alias if provided in the query, otherwise the name). */\n\tpublic Map<String, ColumnMetaData> getColumns();\n\n\t/** Returns database name. */\n\tpublic String getDatabaseName();\n\n\t/** Returns ordered list of columns that are primary keys. */\n\tpublic List<ColumnMetaData> getPrimaryKeys();\n\n\t/**\n\t * Returns fully qualified table name in database-specific form for use in SQL statements. MySQL uses the form\n\t * <code>database.table</code>, for example <code>sakila.film</code>. PostgreSQL uses the form\n\t * <code>database.schema.table</code>, for example <code>sakila.public.film</code>.\n\t */\n\tpublic String getQualifiedTableName();\n\n\t/** Returns row alias. */\n\tpublic String getRowAlias();\n\t\n\t/** Returns row set alias. */\n\tpublic String getRowSetAlias();\n\t\n\t/**\n\t * Returns row alias.\n\t * \n * @deprecated As of 0.8.11 use {@link #getRowAlias()}\n\t */\n\t@Deprecated\n\tpublic String getTableAlias();\n\n\t/** Returns table name. */\n\tpublic String getTableName();\n\n\t/** Returns role of table in the SQL Resource. */\n\tpublic TableRole getTableRole();\n\n\t/** Returns true if the SQL Resource role is child. */\n\tpublic boolean isChild();\n\n\t/** Returns true if the SQL Resource role is parent. */\n\tpublic boolean isParent();\n\n\t/** Sets all the row and row set aliases. */\n\tpublic void setAliases(final String alias, final String rowAlias, final String rowSetAlias);\n\n\t/** Sets attributes. */\n\tpublic void setAttributes(final String tableName, final String qualifedTableName,\n\t\t\tfinal String databaseName, final TableRole tableRole);\n\n\t/**\n\t * Sets table alias.\n\t * \n * @deprecated As of 0.8.11 use {@link #setAliases(String, String, String)}\n\t */\n\t@Deprecated\n\tpublic void setTableAlias(final String tableAlias);\n\t\n\t/** Represents all of the roles a table may plan in a SQL Resource. */\n\t@XmlType(namespace = \"http://restsql.org/schema\")\n\tpublic enum TableRole {\n\t\tChild, ChildExtension, Join, Parent, ParentExtension, Unknown;\n\t}\n}", "public abstract List<String> newReportColumns();", "ResultSetMetaData getMetaData() throws SQLException;", "public DBMetaDataSet getMetaData()\n\t{\n\t\treturn _MetaData;\n\t}", "public interface SqlResourceMetaData {\r\n\r\n\tpublic List<ColumnMetaData> getAllReadColumns();\r\n\r\n\tpublic TableMetaData getChild();\r\n\r\n\tpublic List<TableMetaData> getChildPlusExtTables();\r\n\r\n\tpublic List<ColumnMetaData> getChildReadColumns();\r\n\r\n\tpublic TableMetaData getJoin();\r\n\r\n\tpublic List<TableMetaData> getJoinList();\r\n\r\n\tpublic int getNumberTables();\r\n\r\n\tpublic TableMetaData getParent();\r\n\r\n\tpublic List<TableMetaData> getParentPlusExtTables();\r\n\r\n\tpublic List<ColumnMetaData> getParentReadColumns();\r\n\r\n\tpublic Map<String, TableMetaData> getTableMap();\r\n\r\n\tpublic List<TableMetaData> getTables();\r\n\r\n\tpublic List<TableMetaData> getWriteTables(final Type requestType, final boolean doParent);\r\n\r\n\tpublic boolean hasJoinTable();\r\n\r\n\tpublic boolean hasMultipleDatabases();\r\n\r\n\tpublic boolean isHierarchical();\r\n\r\n\tpublic void init(final String sqlResourceName, final SqlResourceDefinition definition, final SqlBuilder sqlBuilder)\r\n\t\t\tthrows SqlResourceException;\r\n\r\n\tpublic String toHtml();\r\n\r\n\tpublic String toXml();\r\n}", "public void addColumnPathReportId() {\n addColumnInPath(ColumnMetaData.KEY_PATH_ID);\n }", "public ResultSetMetaData getMetaData() throws SQLException {\n\n try {\n int id = getNextId(TraceObject.RESULT_SET_META_DATA);\n if (isDebugEnabled()) {\n debugCodeAssign(\"ResultSetMetaData\", TraceObject.RESULT_SET_META_DATA, id, \"getMetaData()\");\n }\n checkClosed();\n String catalog = conn.getCatalog();\n JdbcResultSetMetaData meta = new JdbcResultSetMetaData(this, null, result, catalog, conn.getSession().getTrace(), id);\n return meta;\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "public MetaData getMetaData();", "@Override\n public DatabaseMetaData getMetaData() throws SQLException\n {\n logger.debug(\n \" public DatabaseMetaData getMetaData() throws SQLException\");\n\n return new SnowflakeDatabaseMetaData(this);\n }", "public DataSetMetaData getMetaData() {\n return this.metadata;\n }", "@Test\n public void metaDataExample1() throws SQLException {\n Connection connection = DriverManager.getConnection(dbUrl, dbUsername, dbPassword);\n // 2. Create statement\n Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);\n // Run sql query and get the result in resultSet object\n String sqlQuery= \"Select * From departments\";\n //String sqlQuery= \"Select first_name, last_name, salary From employees\";\n ResultSet resultSet = statement.executeQuery(sqlQuery);\n\n // we use resultSet metadata to get information about the tables\n // get the resultSet object metadata\n ResultSetMetaData rsMetadata = resultSet.getMetaData();\n\n // List for keeping all rows as a map\n List<Map<String, Object>> queryData = new ArrayList<>();\n\n // while(resultSet.next()) helps to iterate through columns\n while (resultSet.next()) {\n // key(columns) will be string but value can be any type of data. That's why we choose <String, Object>\n Map<String, Object> row = new HashMap<>(); // creating empty Map\n // number of columns\n int colCount = rsMetadata.getColumnCount();\n // for loop helps to iterate through columns\n for (int i = 1; i <= colCount; i++) {\n row.put(rsMetadata.getColumnName(i), resultSet.getObject(i));\n }\n\n queryData.add(row); // adding a Map to the List of Maps\n }\n\n // Printing the rows\n for (Map<String, Object> row: queryData) {\n System.out.println(row.toString());\n\n }\n\n\n\n\n // close all connections\n resultSet.close();\n statement.close();\n connection.close();\n }", "@Override\n\tpublic DBMetadata getMetadata() {\n\t\treturn null;\n\t}", "public MetaData getMetaData() {\r\n \treturn metaData;\r\n }", "@Override\n public SystemMetadata mapRow(ResultSet resultSet, int rowNumber) throws SQLException {\n\n // resultSet contains guid, serialVersion, date_modified, and archived column data\n SystemMetadata systemMetadata = new SystemMetadata();\n ReplicationPolicy replPolicy = new ReplicationPolicy();\n AccessPolicy accessPolicy = new AccessPolicy();\n\n // add guid\n Identifier pid = new Identifier();\n pid.setValue(resultSet.getString(\"guid\"));\n systemMetadata.setIdentifier(pid);\n \n // add seriesId\n Identifier seriesId = new Identifier();\n seriesId.setValue(resultSet.getString(\"series_id\"));\n systemMetadata.setSeriesId(seriesId);\n\n // add serialVersion\n BigInteger serialVersion = new BigInteger(resultSet.getString(\"serial_version\"));\n systemMetadata.setSerialVersion(serialVersion);\n\n // add date_modified\n Date dateSystemMetadataLastModified = resultSet.getTimestamp(\"date_modified\");\n systemMetadata.setDateSysMetadataModified(dateSystemMetadataLastModified);\n\n // add archived value, if it was stored\n boolean archived = resultSet.getBoolean(\"archived\"); // getBoolean returns false for null results\n if (!resultSet.wasNull())\n systemMetadata.setArchived(new Boolean(archived));\n\n // add date_uploaded\n Date dateUploaded = resultSet.getTimestamp(\"date_uploaded\");\n systemMetadata.setDateUploaded(dateUploaded);\n\n // add rights_holder\n Subject rightsHolderSubject = new Subject();\n String rightsHolder = resultSet.getString(\"rights_holder\");\n rightsHolderSubject.setValue(rightsHolder);\n systemMetadata.setRightsHolder(rightsHolderSubject);\n\n // add checksum, checksum_algorithm\n String checksum = resultSet.getString(\"checksum\");\n String checksumAlgorithm = resultSet.getString(\"checksum_algorithm\");\n Checksum checksumObject = new Checksum();\n checksumObject.setValue(checksum);\n checksumObject.setAlgorithm(checksumAlgorithm);\n systemMetadata.setChecksum(checksumObject);\n\n // add origin_member_node\n String originMemberNode = resultSet.getString(\"origin_member_node\");\n if (originMemberNode != null) {\n NodeReference omn = new NodeReference();\n omn.setValue(originMemberNode);\n systemMetadata.setOriginMemberNode(omn);\n }\n\n // add authoritive_member_node\n String authoritativeMemberNode = resultSet.getString(\"authoritive_member_node\");\n if (originMemberNode != null) {\n NodeReference amn = new NodeReference();\n amn.setValue(authoritativeMemberNode);\n systemMetadata.setAuthoritativeMemberNode(amn);\n }\n\n // add submitter\n String submitter = resultSet.getString(\"submitter\");\n if (submitter != null) {\n Subject submitterSubject = new Subject();\n submitterSubject.setValue(submitter);\n systemMetadata.setSubmitter(submitterSubject);\n }\n\n // add object_format\n String fmtidStr = resultSet.getString(\"object_format\");\n ObjectFormatIdentifier fmtid = new ObjectFormatIdentifier();\n fmtid.setValue(fmtidStr);\n systemMetadata.setFormatId(fmtid);\n\n // add size\n String size = resultSet.getString(\"size\");\n systemMetadata.setSize(new BigInteger(size));\n\n // add obsoletes\n String obsoletes = resultSet.getString(\"obsoletes\");\n if (obsoletes != null) {\n Identifier obsoletesId = new Identifier();\n obsoletesId.setValue(obsoletes);\n systemMetadata.setObsoletes(obsoletesId);\n }\n // add obsoleted_by\n String obsoletedBy = resultSet.getString(\"obsoleted_by\");\n if (obsoletedBy != null) {\n Identifier obsoletedById = new Identifier();\n obsoletedById.setValue(obsoletedBy);\n systemMetadata.setObsoletedBy(obsoletedById);\n }\n\n // potentially build a ReplicationPolicy\n \n // add replication_allowed, if it was persisted\n boolean replAllowed = resultSet.getBoolean(\"replication_allowed\"); // getBoolean returns false for null results\n \n if (!resultSet.wasNull()) {\n // populate and add ReplicationPolicy\n ReplicationPolicy replicationPolicy = new ReplicationPolicy();\n \n replicationPolicy.setReplicationAllowed(new Boolean(replAllowed));\n\n // add number_replicas\n int numberOfReplicas = resultSet.getInt(\"number_replicas\"); // getInt returns 0 for null values\n if (numberOfReplicas > 0) {\n replicationPolicy.setNumberReplicas(new Integer(numberOfReplicas));\n\n }\n\n // add preferred and blocked lists\n List<ReplicationPolicyEntry> replPolicies = new ArrayList<ReplicationPolicyEntry>();\n List<NodeReference> preferredNodes = new ArrayList<NodeReference>();\n List<NodeReference> blockedNodes = new ArrayList<NodeReference>();\n\n replPolicies = listReplicationPolicies(pid, localTableMap);\n\n for (ReplicationPolicyEntry policy : replPolicies) {\n Identifier id = policy.getPid();\n String entryPolicy = policy.getPolicy();\n NodeReference node = policy.getMemberNode();\n\n if (entryPolicy.equals(\"preferred\")) {\n preferredNodes.add(node);\n\n } else if (entryPolicy.equals(\"blocked\")) {\n blockedNodes.add(node);\n\n }\n }\n\n replicationPolicy.setPreferredMemberNodeList(preferredNodes);\n replicationPolicy.setBlockedMemberNodeList(blockedNodes);\n\n systemMetadata.setReplicationPolicy(replicationPolicy);\n } else {\n systemMetadata.setReplicationPolicy(null);\n }\n\n // populate and add replicas list\n\n List<Replica> replicas = new ArrayList<Replica>();\n replicas = listReplicaEntries(pid, localTableMap);\n systemMetadata.setReplicaList(replicas);\n\n // populate and add AccessPolicy\n List<AccessRule> accessRules = new ArrayList<AccessRule>();\n accessRules = listAccessRules(pid, localTableMap);\n accessPolicy.setAllowList(accessRules);\n systemMetadata.setAccessPolicy(accessPolicy);\n\n // Validate the system metadata in debug mode using TypeMarshaller\n if (log.isDebugEnabled()) {\n try {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n TypeMarshaller.marshalTypeToOutputStream(systemMetadata, baos);\n log.debug(\"SystemMetadata for pid \" + pid.getValue() + \" is: \"\n + baos.toString());\n\n } catch (MarshallingException e) {\n e.printStackTrace();\n\n } catch (IOException e) {\n e.printStackTrace();\n\n }\n }\n return systemMetadata;\n }", "public MetaData getMetaData() {\n return metaData;\n }", "public ResultSetMetaData getMetaData() throws SQLException\n {\n return m_rs.getMetaData();\n }", "public ShowTableMetadataResponse showTableMetadata(ShowTableMetadataRequest request) throws GPUdbException {\n ShowTableMetadataResponse actualResponse_ = new ShowTableMetadataResponse();\n submitRequest(\"/show/table/metadata\", request, actualResponse_, false);\n return actualResponse_;\n }", "SQLServerResultSetMetaData(SQLServerConnection con, SQLServerResultSet rs) \n {\n traceID = \" SQLServerResultSetMetaData:\" + nextInstanceID();\n this.con = con;\n this.rs =rs;\n assert rs !=null;\n if(logger.isLoggable(java.util.logging.Level.FINE))\n {\n logger.fine(toString() + \" created by (\" + rs.toString() + \")\");\n }\n }", "@Override\n public RavenJObject getMetadata() {\n return metadata;\n }", "@Override\n\tpublic List<Map<String, String>> selectReportInfo(String appId) {\n\t\treturn getSqlMap().queryForList(NAMESPACES + \"queryReportInfo\", appId);\n\t}", "void processMetaData(ResultSet rs) throws SQLException;", "public interface ColumnMetaData {\n\n\t/**\n\t * The uniqueness level of a column data type.\n\t */\n\tenum Uniqueness {\n\t\t/**\n\t\t * No limitations. Multiple instances of a single column meta data type can be attached to a table or even a\n\t\t * single column.\n\t\t */\n\t\tNONE,\n\n\t\t/**\n\t\t * Multiple instances of a single column meta data type can be attached to a table but at most one per column.\n\t\t */\n\t\tCOLUMN,\n\n\t\t/**\n\t\t * At most one instance of the column meta data type can be attached to a table.\n\t\t */\n\t\tTABLE\n\t}\n\n\t/**\n\t * The unique type id of the column meta data.\n\t *\n\t * @return the type id\n\t */\n\tString type();\n\n\t/**\n\t * The uniqueness level of the meta data. Defaults to {@link Uniqueness#NONE} (no restrictions).\n\t *\n\t * @return the uniqueness level\n\t */\n\tdefault Uniqueness uniqueness() {\n\t\treturn Uniqueness.NONE;\n\t}\n\n}", "public HashMap getMetaData() ;", "Metadata getMetaData();", "@Override\n public SystemMetadataStatus mapRow(ResultSet resultSet, int rowNumber) throws SQLException {\n\n // resultSet contains guid, serialVersion, date_modified, and archived column data\n SystemMetadataStatus systemMetadataStatus = new SystemMetadataStatus();\n\n // add guid\n Identifier pid = new Identifier();\n pid.setValue(resultSet.getString(\"guid\"));\n systemMetadataStatus.setPid(pid);\n\n // add serialVersion\n BigInteger serialVersion = new BigInteger(resultSet.getString(\"serial_version\"));\n systemMetadataStatus.setSerialVersion(serialVersion);\n\n // add date_modified\n Date dateSystemMetadataLastModified = resultSet.getTimestamp(\"date_modified\");\n systemMetadataStatus\n .setLastSystemMetadataModificationDate(dateSystemMetadataLastModified);\n\n // add archived\n boolean archived = resultSet.getBoolean(\"archived\"); // getBoolean returns false for null results\n systemMetadataStatus.setDeleted(new Boolean(archived));\n\n return systemMetadataStatus;\n }", "@Override\n public String toString() {\n return \"Report{\" +\n \"reportId=\" + reportId +\n \", reportOpId=\" + reportOp +\n \", date='\" + date + '\\'' +\n \", reportedUserId=\" + reportedUser +\n \", userId=\" + user +\n \", status=\" + status +\n '}';\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}", "CustomReport selectByPrimaryKey(BigDecimal reportId);", "public ResultSetMetaData getMetaData() throws SQLException {\n return currentPreparedStatement.getMetaData();\n }", "public ReportTable(TableView<Report> reportTable) {\n this.reportTable = reportTable;\n }", "public void analizeQueryResultMetaData(ResultSetMetaData rsMetaData, String[] decimalColumns){\n\t\tArrayList<Integer> decimalColumnResultsetIndexes = new ArrayList<Integer>();\n\t\t//if ( decimalColumns==null||decimalColumns.length==0)\n\t\t//\treturn ; \n\t\ttry {\n\t\t\t\n\t\t\t\n\t\t\t//IObjectToStringConverter[] converters = new IObjectToStringConverter[rsMetaData.getColumnCount()] ;\n\t\t\tOuputDataType[] dataTypes = new OuputDataType[rsMetaData.getColumnCount()] ;\n\t\t\tjobContext.put(ExportEngineConstant.COLUMN_CONVERTER_KEY, dataTypes);\n\t\t\tfor ( int i=1 ; i <= rsMetaData.getColumnCount(); i++){\n\t\t\t\tboolean isDecimal = false ; \n\t\t\t\tString nama = rsMetaData.getColumnName(i).toUpperCase();\n\t\t\t\tif ( decimalColumns!=null){\n\t\t\t\t\tfor ( String scn : decimalColumns){\n\t\t\t\t\t\tif ( nama.equalsIgnoreCase(scn)){\n\t\t\t\t\t\t\tdecimalColumnResultsetIndexes.add(i-1);\n\t\t\t\t\t\t\tisDecimal = true ;\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.money; \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\tif( !isDecimal){\n\t\t\t\t\tString tipeCol = rsMetaData.getColumnClassName(i) ;\n\t\t\t\t\tboolean isDate = false ; \n\t\t\t\t\tfor ( String scn : DATE_DATA_TYPES){\n\t\t\t\t\t\tif ( tipeCol.equals(scn)){\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.date; \n\t\t\t\t\t\t\tisDate = true ; \n\t\t\t\t\t\t\tbreak ; \n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( !isDate){\n\t\t\t\t\t\tif (String.class.getName().equals(tipeCol)){\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.string;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.commonToString;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfor ( OuputDataType scn : dataTypes ){\n\t\t\t\tSystem.out.println(\"converter : \" + scn);\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"gagal membaca data column unutk membuat converter object array. error message :\" + e.getMessage() , e); \n\t\t}\n\t\t\n\t\t\n\t}", "private static void writeColumnMetaData(JsonGenerator jg, ColumnMetaData mdt) throws JsonGenerationException, IOException {\n\t\tjg.writeStartObject();\n\t\tjg.writeStringField(\"name\", mdt.columnName);\n\t\tjg.writeStringField(\"type\", mdt.columnType);\n\t\tjg.writeEndObject();;\n\t}", "private String metadata() {\n\t\tStringBuilder s = new StringBuilder();\n\t\ts.append(\"#######################################\");\n\t\ts.append(\"\\n# Metadata of query set\");\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Queries\");\n\t\ts.append(\"\\n# \\tTotal: \" + this.num_queries);\n\t\ts.append(\"\\n# \\tPoint: \" + this.num_pt_queries + \" (\" + 100 * ((double) this.num_pt_queries/this.num_queries) +\"%)\");\n\t\ts.append(\"\\n# \\tRange: \" + this.num_range_queries + \" (\" + 100 * ((double) this.num_range_queries/this.num_queries) +\"%)\");\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Operators\");\n\t\ts.append(\"\\n# \\tTotal: \" + (this.num_and_ops + this.num_or_ops) + \" (\" + ((double) (this.num_and_ops + this.num_or_ops)/this.num_queries) +\" per query)\");\n\t\ts.append(\"\\n# \\tAND: \" + this.num_and_ops);\n\t\ts.append(\"\\n# \\tOR: \" + this.num_or_ops);\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Attributes\");\n\t\ts.append(\"\\n# \\tTotal queried: \" + this.num_attributes);\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Bins\");\n\t\ts.append(\"\\n# \\tTotal queried: \" + this.num_bins);\n\t\ts.append(\"\\n# \\tPer query: \" + ((double) this.num_bins/this.num_queries));\n\t\ts.append(\"\\n#######################################\\n\");\n\t\treturn s.toString();\n\t}", "public List<Map<String, Object>> getDatewiseUpdateData(String columnName) {\n\t\tList<Map<String, Object>> reportData = new ArrayList<>();\n\n\t\tswitch (columnName) {\n\t\tcase \"LASTUPDATED\":\n\t\t\treportData = getLastUpdatedReport();\n\t\t\tbreak;\n\t\tcase \"CREATEDON\":\n\t\t\treportData = getCreatedOnReport();\n\t\t\tbreak;\n\t\tcase \"READON\":\n\t\t\treportData = getReadOnReport();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tSystem.out.println(\"Invalid column name\");\n\t\t}\n\t\treturn reportData;\n\t}", "public Map<String, Object> getMetaData() {\n\t\treturn metaData;\n\t}", "public MetadataArtifactDownloadReport getReport() {\n return report;\n }", "public Map<String, ColumnMetaData> getColumns();", "public abstract String metadata(String property);", "@Override\n\tpublic IColumns createColumns() {\n\t\treturn new WaybillforauditColumns();\n\t}", "@Schema(description = \"`status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Binary general-info: The input information used to assemble the report that can be on-going, periodic and actual and projected \")\n public Object getAssessmentInstanceReportRecord() {\n return assessmentInstanceReportRecord;\n }", "public AlterTableMetadataResponse alterTableMetadata(AlterTableMetadataRequest request) throws GPUdbException {\n AlterTableMetadataResponse actualResponse_ = new AlterTableMetadataResponse();\n submitRequest(\"/alter/table/metadata\", request, actualResponse_, false);\n return actualResponse_;\n }", "public Long getReportId() {\n return reportId;\n }", "@Schema(description = \"`status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Binary general-info: The external report in any suitable form including selection filters where appropriate \")\n public Object getAssessmentInstanceReport() {\n return assessmentInstanceReport;\n }", "@SuppressWarnings(\"all\")\npublic interface I_I_BankDataJP \n{\n\n /** TableName=I_BankDataJP */\n public static final String Table_Name = \"I_BankDataJP\";\n\n /** AD_Table_ID=1000307 */\n public static final int Table_ID = MTable.getTable_ID(Table_Name);\n\n KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);\n\n /** AccessLevel = 3 - Client - Org \n */\n BigDecimal accessLevel = BigDecimal.valueOf(3);\n\n /** Load Meta Data */\n\n /** Column name AD_Client_ID */\n public static final String COLUMNNAME_AD_Client_ID = \"AD_Client_ID\";\n\n\t/** Get Tenant.\n\t * Tenant for this installation.\n\t */\n\tpublic int getAD_Client_ID();\n\n /** Column name AD_OrgTrx_ID */\n public static final String COLUMNNAME_AD_OrgTrx_ID = \"AD_OrgTrx_ID\";\n\n\t/** Set Trx Organization.\n\t * Performing or initiating organization\n\t */\n\tpublic void setAD_OrgTrx_ID (int AD_OrgTrx_ID);\n\n\t/** Get Trx Organization.\n\t * Performing or initiating organization\n\t */\n\tpublic int getAD_OrgTrx_ID();\n\n /** Column name AD_Org_ID */\n public static final String COLUMNNAME_AD_Org_ID = \"AD_Org_ID\";\n\n\t/** Set Organization.\n\t * Organizational entity within tenant\n\t */\n\tpublic void setAD_Org_ID (int AD_Org_ID);\n\n\t/** Get Organization.\n\t * Organizational entity within tenant\n\t */\n\tpublic int getAD_Org_ID();\n\n /** Column name AccountNo */\n public static final String COLUMNNAME_AccountNo = \"AccountNo\";\n\n\t/** Set Account No.\n\t * Account Number\n\t */\n\tpublic void setAccountNo (String AccountNo);\n\n\t/** Get Account No.\n\t * Account Number\n\t */\n\tpublic String getAccountNo();\n\n /** Column name BankAccountType */\n public static final String COLUMNNAME_BankAccountType = \"BankAccountType\";\n\n\t/** Set Bank Account Type.\n\t * Bank Account Type\n\t */\n\tpublic void setBankAccountType (String BankAccountType);\n\n\t/** Get Bank Account Type.\n\t * Bank Account Type\n\t */\n\tpublic String getBankAccountType();\n\n /** Column name C_BankAccount_ID */\n public static final String COLUMNNAME_C_BankAccount_ID = \"C_BankAccount_ID\";\n\n\t/** Set Bank Account.\n\t * Account at the Bank\n\t */\n\tpublic void setC_BankAccount_ID (int C_BankAccount_ID);\n\n\t/** Get Bank Account.\n\t * Account at the Bank\n\t */\n\tpublic int getC_BankAccount_ID();\n\n\tpublic org.compiere.model.I_C_BankAccount getC_BankAccount() throws RuntimeException;\n\n /** Column name C_Bank_ID */\n public static final String COLUMNNAME_C_Bank_ID = \"C_Bank_ID\";\n\n\t/** Set Bank.\n\t * Bank\n\t */\n\tpublic void setC_Bank_ID (int C_Bank_ID);\n\n\t/** Get Bank.\n\t * Bank\n\t */\n\tpublic int getC_Bank_ID();\n\n\tpublic org.compiere.model.I_C_Bank getC_Bank() throws RuntimeException;\n\n /** Column name Created */\n public static final String COLUMNNAME_Created = \"Created\";\n\n\t/** Get Created.\n\t * Date this record was created\n\t */\n\tpublic Timestamp getCreated();\n\n /** Column name CreatedBy */\n public static final String COLUMNNAME_CreatedBy = \"CreatedBy\";\n\n\t/** Get Created By.\n\t * User who created this records\n\t */\n\tpublic int getCreatedBy();\n\n /** Column name DateAcct */\n public static final String COLUMNNAME_DateAcct = \"DateAcct\";\n\n\t/** Set Account Date.\n\t * Accounting Date\n\t */\n\tpublic void setDateAcct (Timestamp DateAcct);\n\n\t/** Get Account Date.\n\t * Accounting Date\n\t */\n\tpublic Timestamp getDateAcct();\n\n /** Column name I_BankDataJP_ID */\n public static final String COLUMNNAME_I_BankDataJP_ID = \"I_BankDataJP_ID\";\n\n\t/** Set I_BankDataJP.\n\t * JPIERE-0595:JPBP\n\t */\n\tpublic void setI_BankDataJP_ID (int I_BankDataJP_ID);\n\n\t/** Get I_BankDataJP.\n\t * JPIERE-0595:JPBP\n\t */\n\tpublic int getI_BankDataJP_ID();\n\n /** Column name I_BankDataJP_UU */\n public static final String COLUMNNAME_I_BankDataJP_UU = \"I_BankDataJP_UU\";\n\n\t/** Set I_BankDataJP_UU\t */\n\tpublic void setI_BankDataJP_UU (String I_BankDataJP_UU);\n\n\t/** Get I_BankDataJP_UU\t */\n\tpublic String getI_BankDataJP_UU();\n\n /** Column name I_ErrorMsg */\n public static final String COLUMNNAME_I_ErrorMsg = \"I_ErrorMsg\";\n\n\t/** Set Import Error Message.\n\t * Messages generated from import process\n\t */\n\tpublic void setI_ErrorMsg (String I_ErrorMsg);\n\n\t/** Get Import Error Message.\n\t * Messages generated from import process\n\t */\n\tpublic String getI_ErrorMsg();\n\n /** Column name I_IsImported */\n public static final String COLUMNNAME_I_IsImported = \"I_IsImported\";\n\n\t/** Set Imported.\n\t * Has this import been processed\n\t */\n\tpublic void setI_IsImported (boolean I_IsImported);\n\n\t/** Get Imported.\n\t * Has this import been processed\n\t */\n\tpublic boolean isI_IsImported();\n\n /** Column name IsActive */\n public static final String COLUMNNAME_IsActive = \"IsActive\";\n\n\t/** Set Active.\n\t * The record is active in the system\n\t */\n\tpublic void setIsActive (boolean IsActive);\n\n\t/** Get Active.\n\t * The record is active in the system\n\t */\n\tpublic boolean isActive();\n\n /** Column name JP_A_Name */\n public static final String COLUMNNAME_JP_A_Name = \"JP_A_Name\";\n\n\t/** Set Account Name\t */\n\tpublic void setJP_A_Name (String JP_A_Name);\n\n\t/** Get Account Name\t */\n\tpublic String getJP_A_Name();\n\n /** Column name JP_A_Name_Kana */\n public static final String COLUMNNAME_JP_A_Name_Kana = \"JP_A_Name_Kana\";\n\n\t/** Set Account Name(Kana)\t */\n\tpublic void setJP_A_Name_Kana (String JP_A_Name_Kana);\n\n\t/** Get Account Name(Kana)\t */\n\tpublic String getJP_A_Name_Kana();\n\n /** Column name JP_AcctDate */\n public static final String COLUMNNAME_JP_AcctDate = \"JP_AcctDate\";\n\n\t/** Set Date of Account Date\t */\n\tpublic void setJP_AcctDate (String JP_AcctDate);\n\n\t/** Get Date of Account Date\t */\n\tpublic String getJP_AcctDate();\n\n /** Column name JP_AcctMonth */\n public static final String COLUMNNAME_JP_AcctMonth = \"JP_AcctMonth\";\n\n\t/** Set Month of Account Date\t */\n\tpublic void setJP_AcctMonth (String JP_AcctMonth);\n\n\t/** Get Month of Account Date\t */\n\tpublic String getJP_AcctMonth();\n\n /** Column name JP_BankAccountType */\n public static final String COLUMNNAME_JP_BankAccountType = \"JP_BankAccountType\";\n\n\t/** Set Bank Account Type\t */\n\tpublic void setJP_BankAccountType (String JP_BankAccountType);\n\n\t/** Get Bank Account Type\t */\n\tpublic String getJP_BankAccountType();\n\n /** Column name JP_BankAccount_Value */\n public static final String COLUMNNAME_JP_BankAccount_Value = \"JP_BankAccount_Value\";\n\n\t/** Set Bank Account(Search Key)\t */\n\tpublic void setJP_BankAccount_Value (String JP_BankAccount_Value);\n\n\t/** Get Bank Account(Search Key)\t */\n\tpublic String getJP_BankAccount_Value();\n\n /** Column name JP_BankDataCustomerCode1 */\n public static final String COLUMNNAME_JP_BankDataCustomerCode1 = \"JP_BankDataCustomerCode1\";\n\n\t/** Set Bank Data Customer Code1\t */\n\tpublic void setJP_BankDataCustomerCode1 (String JP_BankDataCustomerCode1);\n\n\t/** Get Bank Data Customer Code1\t */\n\tpublic String getJP_BankDataCustomerCode1();\n\n /** Column name JP_BankDataCustomerCode2 */\n public static final String COLUMNNAME_JP_BankDataCustomerCode2 = \"JP_BankDataCustomerCode2\";\n\n\t/** Set Bank Data Customer Code2\t */\n\tpublic void setJP_BankDataCustomerCode2 (String JP_BankDataCustomerCode2);\n\n\t/** Get Bank Data Customer Code2\t */\n\tpublic String getJP_BankDataCustomerCode2();\n\n /** Column name JP_BankDataLine_ID */\n public static final String COLUMNNAME_JP_BankDataLine_ID = \"JP_BankDataLine_ID\";\n\n\t/** Set Import Bank Data Line\t */\n\tpublic void setJP_BankDataLine_ID (int JP_BankDataLine_ID);\n\n\t/** Get Import Bank Data Line\t */\n\tpublic int getJP_BankDataLine_ID();\n\n\tpublic I_JP_BankDataLine getJP_BankDataLine() throws RuntimeException;\n\n /** Column name JP_BankData_EDI_Info */\n public static final String COLUMNNAME_JP_BankData_EDI_Info = \"JP_BankData_EDI_Info\";\n\n\t/** Set BankData EDI Info\t */\n\tpublic void setJP_BankData_EDI_Info (String JP_BankData_EDI_Info);\n\n\t/** Get BankData EDI Info\t */\n\tpublic String getJP_BankData_EDI_Info();\n\n /** Column name JP_BankData_ID */\n public static final String COLUMNNAME_JP_BankData_ID = \"JP_BankData_ID\";\n\n\t/** Set Import Bank Data\t */\n\tpublic void setJP_BankData_ID (int JP_BankData_ID);\n\n\t/** Get Import Bank Data\t */\n\tpublic int getJP_BankData_ID();\n\n\tpublic I_JP_BankData getJP_BankData() throws RuntimeException;\n\n /** Column name JP_BankData_ReferenceNo */\n public static final String COLUMNNAME_JP_BankData_ReferenceNo = \"JP_BankData_ReferenceNo\";\n\n\t/** Set Bank Data ReferenceNo\t */\n\tpublic void setJP_BankData_ReferenceNo (String JP_BankData_ReferenceNo);\n\n\t/** Get Bank Data ReferenceNo\t */\n\tpublic String getJP_BankData_ReferenceNo();\n\n /** Column name JP_BankName_Kana */\n public static final String COLUMNNAME_JP_BankName_Kana = \"JP_BankName_Kana\";\n\n\t/** Set Bank Name(Kana)\t */\n\tpublic void setJP_BankName_Kana (String JP_BankName_Kana);\n\n\t/** Get Bank Name(Kana)\t */\n\tpublic String getJP_BankName_Kana();\n\n /** Column name JP_BankName_Kana_Line */\n public static final String COLUMNNAME_JP_BankName_Kana_Line = \"JP_BankName_Kana_Line\";\n\n\t/** Set Bank Name(Kana) Line\t */\n\tpublic void setJP_BankName_Kana_Line (String JP_BankName_Kana_Line);\n\n\t/** Get Bank Name(Kana) Line\t */\n\tpublic String getJP_BankName_Kana_Line();\n\n /** Column name JP_Bank_Name */\n public static final String COLUMNNAME_JP_Bank_Name = \"JP_Bank_Name\";\n\n\t/** Set Bank Name\t */\n\tpublic void setJP_Bank_Name (String JP_Bank_Name);\n\n\t/** Get Bank Name\t */\n\tpublic String getJP_Bank_Name();\n\n /** Column name JP_BranchCode */\n public static final String COLUMNNAME_JP_BranchCode = \"JP_BranchCode\";\n\n\t/** Set Branch Code\t */\n\tpublic void setJP_BranchCode (String JP_BranchCode);\n\n\t/** Get Branch Code\t */\n\tpublic String getJP_BranchCode();\n\n /** Column name JP_BranchName */\n public static final String COLUMNNAME_JP_BranchName = \"JP_BranchName\";\n\n\t/** Set Branch Name\t */\n\tpublic void setJP_BranchName (String JP_BranchName);\n\n\t/** Get Branch Name\t */\n\tpublic String getJP_BranchName();\n\n /** Column name JP_BranchName_Kana */\n public static final String COLUMNNAME_JP_BranchName_Kana = \"JP_BranchName_Kana\";\n\n\t/** Set Branch Name(Kana)\t */\n\tpublic void setJP_BranchName_Kana (String JP_BranchName_Kana);\n\n\t/** Get Branch Name(Kana)\t */\n\tpublic String getJP_BranchName_Kana();\n\n /** Column name JP_BranchName_Kana_Line */\n public static final String COLUMNNAME_JP_BranchName_Kana_Line = \"JP_BranchName_Kana_Line\";\n\n\t/** Set Branch Name(Kana) Line\t */\n\tpublic void setJP_BranchName_Kana_Line (String JP_BranchName_Kana_Line);\n\n\t/** Get Branch Name(Kana) Line\t */\n\tpublic String getJP_BranchName_Kana_Line();\n\n /** Column name JP_Date */\n public static final String COLUMNNAME_JP_Date = \"JP_Date\";\n\n\t/** Set Date.\n\t * Date\n\t */\n\tpublic void setJP_Date (String JP_Date);\n\n\t/** Get Date.\n\t * Date\n\t */\n\tpublic String getJP_Date();\n\n /** Column name JP_Line_Description */\n public static final String COLUMNNAME_JP_Line_Description = \"JP_Line_Description\";\n\n\t/** Set Line Description\t */\n\tpublic void setJP_Line_Description (String JP_Line_Description);\n\n\t/** Get Line Description\t */\n\tpublic String getJP_Line_Description();\n\n /** Column name JP_Month */\n public static final String COLUMNNAME_JP_Month = \"JP_Month\";\n\n\t/** Set Month\t */\n\tpublic void setJP_Month (String JP_Month);\n\n\t/** Get Month\t */\n\tpublic String getJP_Month();\n\n /** Column name JP_OrgTrx_Value */\n public static final String COLUMNNAME_JP_OrgTrx_Value = \"JP_OrgTrx_Value\";\n\n\t/** Set Trx Organization(Search Key)\t */\n\tpublic void setJP_OrgTrx_Value (String JP_OrgTrx_Value);\n\n\t/** Get Trx Organization(Search Key)\t */\n\tpublic String getJP_OrgTrx_Value();\n\n /** Column name JP_Org_Value */\n public static final String COLUMNNAME_JP_Org_Value = \"JP_Org_Value\";\n\n\t/** Set Organization(Search Key)\t */\n\tpublic void setJP_Org_Value (String JP_Org_Value);\n\n\t/** Get Organization(Search Key)\t */\n\tpublic String getJP_Org_Value();\n\n /** Column name JP_RequesterName */\n public static final String COLUMNNAME_JP_RequesterName = \"JP_RequesterName\";\n\n\t/** Set Requester Name\t */\n\tpublic void setJP_RequesterName (String JP_RequesterName);\n\n\t/** Get Requester Name\t */\n\tpublic String getJP_RequesterName();\n\n /** Column name JP_SalesRep_EMail */\n public static final String COLUMNNAME_JP_SalesRep_EMail = \"JP_SalesRep_EMail\";\n\n\t/** Set Sales Rep(E-Mail)\t */\n\tpublic void setJP_SalesRep_EMail (String JP_SalesRep_EMail);\n\n\t/** Get Sales Rep(E-Mail)\t */\n\tpublic String getJP_SalesRep_EMail();\n\n /** Column name JP_SalesRep_Name */\n public static final String COLUMNNAME_JP_SalesRep_Name = \"JP_SalesRep_Name\";\n\n\t/** Set Sales Rep(Name)\t */\n\tpublic void setJP_SalesRep_Name (String JP_SalesRep_Name);\n\n\t/** Get Sales Rep(Name)\t */\n\tpublic String getJP_SalesRep_Name();\n\n /** Column name JP_SalesRep_Value */\n public static final String COLUMNNAME_JP_SalesRep_Value = \"JP_SalesRep_Value\";\n\n\t/** Set Sales Rep(Search Key)\t */\n\tpublic void setJP_SalesRep_Value (String JP_SalesRep_Value);\n\n\t/** Get Sales Rep(Search Key)\t */\n\tpublic String getJP_SalesRep_Value();\n\n /** Column name Processed */\n public static final String COLUMNNAME_Processed = \"Processed\";\n\n\t/** Set Processed.\n\t * The document has been processed\n\t */\n\tpublic void setProcessed (boolean Processed);\n\n\t/** Get Processed.\n\t * The document has been processed\n\t */\n\tpublic boolean isProcessed();\n\n /** Column name Processing */\n public static final String COLUMNNAME_Processing = \"Processing\";\n\n\t/** Set Process Now\t */\n\tpublic void setProcessing (boolean Processing);\n\n\t/** Get Process Now\t */\n\tpublic boolean isProcessing();\n\n /** Column name RoutingNo */\n public static final String COLUMNNAME_RoutingNo = \"RoutingNo\";\n\n\t/** Set Routing No.\n\t * Bank Routing Number\n\t */\n\tpublic void setRoutingNo (String RoutingNo);\n\n\t/** Get Routing No.\n\t * Bank Routing Number\n\t */\n\tpublic String getRoutingNo();\n\n /** Column name SalesRep_ID */\n public static final String COLUMNNAME_SalesRep_ID = \"SalesRep_ID\";\n\n\t/** Set Sales Rep.\n\t * Sales Representative or Company Agent\n\t */\n\tpublic void setSalesRep_ID (int SalesRep_ID);\n\n\t/** Get Sales Rep.\n\t * Sales Representative or Company Agent\n\t */\n\tpublic int getSalesRep_ID();\n\n\tpublic org.compiere.model.I_AD_User getSalesRep() throws RuntimeException;\n\n /** Column name StatementDate */\n public static final String COLUMNNAME_StatementDate = \"StatementDate\";\n\n\t/** Set Statement date.\n\t * Date of the statement\n\t */\n\tpublic void setStatementDate (Timestamp StatementDate);\n\n\t/** Get Statement date.\n\t * Date of the statement\n\t */\n\tpublic Timestamp getStatementDate();\n\n /** Column name StmtAmt */\n public static final String COLUMNNAME_StmtAmt = \"StmtAmt\";\n\n\t/** Set Statement amount.\n\t * Statement Amount\n\t */\n\tpublic void setStmtAmt (BigDecimal StmtAmt);\n\n\t/** Get Statement amount.\n\t * Statement Amount\n\t */\n\tpublic BigDecimal getStmtAmt();\n\n /** Column name TrxAmt */\n public static final String COLUMNNAME_TrxAmt = \"TrxAmt\";\n\n\t/** Set Transaction Amount.\n\t * Amount of a transaction\n\t */\n\tpublic void setTrxAmt (BigDecimal TrxAmt);\n\n\t/** Get Transaction Amount.\n\t * Amount of a transaction\n\t */\n\tpublic BigDecimal getTrxAmt();\n\n /** Column name Updated */\n public static final String COLUMNNAME_Updated = \"Updated\";\n\n\t/** Get Updated.\n\t * Date this record was updated\n\t */\n\tpublic Timestamp getUpdated();\n\n /** Column name UpdatedBy */\n public static final String COLUMNNAME_UpdatedBy = \"UpdatedBy\";\n\n\t/** Get Updated By.\n\t * User who updated this records\n\t */\n\tpublic int getUpdatedBy();\n}", "Map<String, Object> getAllMetadata();", "public static JasperReportBuilder generateReport(ExportData metaData,HttpServletRequest request){\n session = request.getSession(false);\n report = report(); // Creer le rapport\n \n //Logo\n// logoImg = cmp.image(inImg).setStyle(DynamicReports.stl.style().setHorizontalAlignment(HorizontalAlignment.LEFT)); \n //logoImg.setDimension(80,80); \n \n //Definit le style des colonnes d'entàte\n report.setColumnTitleStyle(getHeaderStyle(metaData));\n \n \n \n LinkedHashMap <String,String> criteria = metaData.getCriteria(); \n //Ajout la date d'àdition au critere d'impression\n String valDateProperty = getDateTxt(metaData.getLang()) ;\n String keyDateProperty = \"\" ;\n if ( session.getAttribute(\"activedLocale\").equals(\"fr\") ) {\n keyDateProperty = \"Edité le \" ;\n }\n else {\n keyDateProperty = \"Printed on \" ;\n }\n criteria.put(keyDateProperty,valDateProperty);\n \n StyleBuilder titleStyle = stl.style(boldStyle).setFontSize(16).setForegroundColor(new Color(0, 0, 0)).setHorizontalAlignment(HorizontalAlignment.RIGHT).setRightIndent(20);\n ComponentBuilder<?, ?> logoComponent = cmp.horizontalList(\n //cmp.image(Templates.class.getResource(\"/logopalm.png\")).setFixedDimension(150, 50).setStyle(stl.style().setLeftIndent(20)),\n cmp.verticalList(\n cmp.text(metaData.getTitle()).setStyle(titleStyle)\n )\n ).newRow()\n .add(cmp.horizontalList().add(cmp.hListCell(createCriteriaComponent(criteria,metaData)).heightFixedOnTop()))\n .newRow(); \n \n report.noData(logoComponent, cmp.text(\"Aucun enregistrement trouvà\").setStyle(stl.style().setHorizontalAlignment(HorizontalAlignment.CENTER).setTopPadding(30)));\n\n \n \n lblStyle = stl.style(Templates.columnStyle).setForegroundColor(new Color(60, 91, 31)); // Couleur du text \n colStyle = stl.style(Templates.columnStyle).setHorizontalAlignment(HorizontalAlignment.CENTER);\n \n groupStyle = stl.style().setForegroundColor(new Color(60, 91, 31)) \n .setBold(Boolean.TRUE)\n .setPadding(5)\n .setFontSize(13)\n .setHorizontalAlignment(HorizontalAlignment.CENTER); \n \n\n \n if(metaData.getTitle().equals(ITitle.PARCEL)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PARCEL_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SECTOR)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SECTOR_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BLOCK)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BLOCK_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ATTACK_PHYTO)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TREATMENT)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TREATMENT_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVEST)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVEST_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SERVICING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SERVICING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_PLANTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_PLANTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.FERTILIZATION)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.FERTILIZATION_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.CONTROL_PHYTO)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.CONTROL_PHYTO_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_FOLDING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_FOLDING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.MORTALITY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.MORTALITY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVESTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVESTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BUDGET)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.REPLACEMENT)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.REPLACEMENT_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.METEOROLOGY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.METEOROLOGY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_MATERIAL)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_MATERIAL_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLUVIOMETRY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLUVIOMETRY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ETP)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ETP_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HYGROMETRY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HYGROMETRY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TEMPERATURE)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TEMPERATURE_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.INSULATION)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.INSULATION_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.WORK)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.WORK_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }\n \n \n drColumns = new HashMap<String, TextColumnBuilder>(); \n groups = new ArrayList<String>();\n subtotals = new ArrayList<String>();\n \n //Definit la liste des colonnes du rapport\n ExportGenerator.getColumns(metaData); \n //Definit la liste des sous-totaux du rapport\n ExportGenerator.getSubTotals(metaData);\n \n \n //Genration des sous totaux\n for (String group : groups) {\n ColumnGroupBuilder group2 = grp.group(drColumns.get(group));\n report.groupBy(group2);\n for (String subtotal : subtotals) {\n report.subtotalsAtGroupFooter(group2,sbt.sum(drColumns.get(subtotal)));\n }\n }\n\n for (String subtotal : subtotals) {\n report.subtotalsAtSummary(sbt.sum(drColumns.get(subtotal))); \n }\n \n /*if(ExportGenerator.getColumnByNameField(\"plantingName\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL \"), ExportGenerator.getColumnByNameField(\"plantingName\"), Calculation.NOTHING));\n }*//*else if(ExportGenerator.getColumnByNameField(\"invoiceCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"invoiceCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"planterCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL\"), ExportGenerator.getColumnByNameField(\"planterCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"transportTicket\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"transportTicket\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"deliveryDate\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"deliveryDate\"), Calculation.NOTHING));\n }\n else if(ExportGenerator.getColumnByNameField(\"arroundPlantingTicketNumber\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"arroundPlantingTicketNumber\"), Calculation.NOTHING));\n }\n else if(ExportGenerator.getColumnByNameField(\"planterNumber\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"planterNumber\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"startPaymentDate\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"startPaymentDate\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"sectorCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"sectorCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"month\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL \"), ExportGenerator.getColumnByNameField(\"month\"), Calculation.NOTHING));\n }*/\n \n\n \n \n //Genere la source de donnàes du rapport\n report.setDataSource(metaData.getData());\n \n report.highlightDetailEvenRows(); \n \n \n // Definition de l'entete : valable uniquement pour la 1ere page\n HorizontalListBuilder hlb= null;\n \n hlb = cmp.horizontalList().add(\n cmp.hListCell(createCriteriaComponent(criteria,metaData)).heightFixedOnTop()\n );\n\n \n report.title(\n createCustomTitleComponent(metaData.getTitle()), // Titre\n hlb,// Liste Horizontal des Critàres \n cmp.verticalGap(12) // Marge de 12 px entre chaque critàre\n ); \n \n \n \n report.setPageMargin(DynamicReports.margin().setLeft(15).setTop(30).setRight(15).setBottom(30));\n report.setPageFormat(PageType.A3, PageOrientation.LANDSCAPE);\n report.pageFooter(DynamicReports.cmp.pageXslashY());\n return report;\n \n }", "public interface IReportDao extends IBaseDao<Report, Integer> {\n\t\n\t/**\n\t * 添加举报信息\n\t * @param report\n\t */\n\tpublic boolean addReport(Report report);\n\t\n\t/**\n\t * 修改举报信息\n\t * @param report\n\t * @return\n\t */\n\tpublic boolean updateReport(Report report);\n\t\n//\t/**\n//\t * 是否已经举报\n//\t * @param getReportGto\n//\t * @return\n//\t */\n//\tpublic boolean isHouseInfoReported(GetReportGto getReportGto);\n\t\n\t/**\n\t * 获取我与某条房源的举报信息\n\t * @param getReportGto\n\t * @return\n\t */\n\tpublic List<Report> getMyReport(GetReportGto getReportGto);\n}", "public interface TableDetailMapper {\n\n @Select(\"select * from dxh_sys.tabledetail where vendorId=0 and tableName='skuProfitDayReport'\")\n List<Map<String, Object>> list();\n\n}", "public Report getReport();", "BoltResultSetMetaData(List<Type> types, List<String> keys) {\n\t\tsuper(keys);\n\t\tthis.columnType = types.toArray(new Type[this.keys.size() + 1]);\n\n\t\t// we init columnType with the first record\n\t\t// in case first == last record\n\t\t/*for (int i = 1; i <= this.keys.size(); i++) {\n\t\t\tcolumnType[i] = this.getColumnDriverTypeOrDefault(i, InternalTypeSystem.TYPE_SYSTEM.STRING());\n\t\t}*/\n\t}", "@Override\r\n\tpublic Map<String, Object> getMetadata() {\n\t\treturn null;\r\n\t}", "@Select({\n \"select\",\n \"JNLNO, TRANDATE, ACCOUNTDATE, CHECKTYPE, STATUS, DONETIME, FILENAME\",\n \"from B_UMB_CHECKING_LOG\",\n \"where JNLNO = #{jnlno,jdbcType=VARCHAR}\"\n })\n @Results({\n @Result(column=\"JNLNO\", property=\"jnlno\", jdbcType=JdbcType.VARCHAR, id=true),\n @Result(column=\"TRANDATE\", property=\"trandate\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"ACCOUNTDATE\", property=\"accountdate\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"CHECKTYPE\", property=\"checktype\", jdbcType=JdbcType.CHAR),\n @Result(column=\"STATUS\", property=\"status\", jdbcType=JdbcType.CHAR),\n @Result(column=\"DONETIME\", property=\"donetime\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"FILENAME\", property=\"filename\", jdbcType=JdbcType.VARCHAR)\n })\n BUMBCheckingLog selectByPrimaryKey(BUMBCheckingLogKey key);", "@SqlQuery(\"select * from PLAYERSTATS\")\n List<PlayerStats> getAll();", "protected String getMetadataName() {\r\n\t\treturn METADATA_NAME;\r\n\t}", "public abstract String getSummaryForDatabase();", "private interface ReportColumnCallback\n {\n void handleReportColumn(DashboardReport report, String columnName) throws MojoExecutionException;\n }", "public ReportMetadataExample() {\n\t\toredCriteria = new ArrayList<Criteria>();\n\t}", "@Override\r\n \tpublic MetaData getMetaData(HttpHeaders headers) {\n \t\ttry {\r\n \t\t\treturn MetaDataUtil.getMetaData(new ViewListeEleve(), new HashMap<String, MetaData>(),new ArrayList<String>());\r\n \t\t} catch (Exception e) {\r\n \t\t\t// TODO Auto-generated catch block\r\n \t\t\tthrow new WebApplicationException(Response.serverError().entity(new String(\"MetaData parse error\")).build());\r\n \t\t} \r\n \t}", "public DefaultMetaData getMetaData() {\n\t\treturn this.metaData;\n\t}", "Report createReport();", "@Override\n public Map<String, String> createFieldToPropertyMapping() {\n final Map<String, String> mapping = super.createFieldToPropertyMapping();\n mapping.put(this.tableName + \".rsres_id\", \"id\");\n mapping.put(this.tableName + \".resource_id\", \"resourceId\");\n mapping.put(this.tableName + \".quantity\", QUANTITY);\n mapping.put(this.tableName + \".cost_rsres\", \"cost\");\n\n return mapping;\n }", "public String getReportsToBeGenerated(String reportType) {\r\n\t\tString query = \"\";\r\n\t\t\r\n\t\ttry (Connection connection = DatabaseConnection.getMySQLConnection();\r\n\t\t\t PreparedStatement stmt = connection.prepareStatement(query);) {\r\n\t\t\tResultSet result = stmt.executeQuery();\r\n\t\t\tStringJoiner reports = new StringJoiner(\",,\");\r\n\t\t\twhile (result.next()) {\r\n\t\t\t\treports.add(result.getString(\"REPORT_NAME\"));\r\n\t\t\t}\r\n\t\t\treturn reports.toString();\r\n\t\t} catch (SQLException e) {\r\n\t\t\tthrow new ReportGenerationException(\"An error occurred while retrieving reports to be generated.\", e);\r\n\t\t}\r\n\t}", "public String getMetaDataFileName() {\n return null;\n }", "public JDBCRawSqlQueryMetaData(Method method) {\n this.method = method;\n }", "public Map getMetadata() {\n return metadata;\n }", "public DatabaseMetaData(Statement s) {\n\t\t_stmt = s; // SQL-Connection\n\t\t_buffer = new StringBuffer(); // Output goes here\n\t\t_tables = new ArrayList<String>(); // List of tables\n\t\t\n\t\ttry {\n\t\t\t// Put table names in `_tables`\n\t\t\textractTableNames(_stmt.executeQuery(composeTableNamesQuery()));\n\n\t\t\t// fetch the string representation of each tables meta-data\n\t\t\tfor (String name : _tables)\n\t\t\t\t_buffer.append(new TableMeta(name)); \n\t\t} catch (SQLException e) { _error = true;}\n\t}", "private Builder() {\n super(net.explorys.samhat.z12.r837.X837Ins_2320_MOA_MedicareOutpatientAdjudicationInformation.SCHEMA$);\n }", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "public String toString() {\n return \"[JDBCRawSqlQueryMetaData : method=\" + method + \"]\";\n }", "Report selectByPrimaryKey(Integer id);", "java.lang.String getMetadata(int index);", "java.lang.String getMetadata(int index);", "public Integer getReportId() {\n return reportId;\n }", "@Schema(description = \"`status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Code general-info: The type of external report available \")\n public String getAssessmentInstanceReportType() {\n return assessmentInstanceReportType;\n }", "@Override\r\n\tpublic List<ReportAndSummary> findAll() {\n\t\tList<ReportAndSummary> result = reportAndSummaryDao.findAll();\r\n\t\treturn result;\r\n\t}", "private static Map<String, ColumnMetaData> buildColumnMetadataMap(ResultSet rs) {\n\t\t/*\n\t\t * LinkedHashmap to preserve key traversal order.\n\t\t * Important as we output rows as arrays of values where the index position in\n\t\t * the row implicitly corresponds to the entry order of the column map.\n\t\t * Reason for this is performance. \n\t\t */\n\t\tMap<String, ColumnMetaData> columnMap = Maps.newLinkedHashMap();\n\t\ttry {\n\t\t\tResultSetMetaData rmd = rs.getMetaData();\n\t\t\tfor (int i=1; i<= rmd.getColumnCount(); i++) {\n\t\t\t\tColumnMetaData cmd = \n\t\t\t\t\tnew ColumnMetaData(rmd.getColumnName(i), rmd.getColumnTypeName(i));\n\t\t\t\tcolumnMap.put(cmd.columnName, cmd);\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\tThrowables.propagate(e);\n\t\t}\n\t\treturn columnMap;\n\t}", "protected String getSqlTable() {\n\t\treturn \"Project\";\n\t}", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "public interface I_IHC_JobDataChange \n{\n\n /** TableName=IHC_JobDataChange */\n public static final String Table_Name = \"IHC_JobDataChange\";\n\n /** AD_Table_ID=1100135 */\n public static final int Table_ID = MTable.getTable_ID(Table_Name);\n\n KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);\n\n /** AccessLevel = 3 - Client - Org \n */\n BigDecimal accessLevel = BigDecimal.valueOf(3);\n\n /** Load Meta Data */\n\n /** Column name AD_Client_ID */\n public static final String COLUMNNAME_AD_Client_ID = \"AD_Client_ID\";\n\n\t/** Get Client.\n\t * Client/Tenant for this installation.\n\t */\n\tpublic int getAD_Client_ID();\n\n /** Column name AD_Org_ID */\n public static final String COLUMNNAME_AD_Org_ID = \"AD_Org_ID\";\n\n\t/** Set Organization.\n\t * Organizational entity within client\n\t */\n\tpublic void setAD_Org_ID (int AD_Org_ID);\n\n\t/** Get Organization.\n\t * Organizational entity within client\n\t */\n\tpublic int getAD_Org_ID();\n\n /** Column name BPJSRegistrationDate */\n public static final String COLUMNNAME_BPJSRegistrationDate = \"BPJSRegistrationDate\";\n\n\t/** Set BPJS Registration Date\t */\n\tpublic void setBPJSRegistrationDate (Timestamp BPJSRegistrationDate);\n\n\t/** Get BPJS Registration Date\t */\n\tpublic Timestamp getBPJSRegistrationDate();\n\n /** Column name Created */\n public static final String COLUMNNAME_Created = \"Created\";\n\n\t/** Get Created.\n\t * Date this record was created\n\t */\n\tpublic Timestamp getCreated();\n\n /** Column name CreatedBy */\n public static final String COLUMNNAME_CreatedBy = \"CreatedBy\";\n\n\t/** Get Created By.\n\t * User who created this records\n\t */\n\tpublic int getCreatedBy();\n\n /** Column name Description */\n public static final String COLUMNNAME_Description = \"Description\";\n\n\t/** Set Description.\n\t * Optional short description of the record\n\t */\n\tpublic void setDescription (String Description);\n\n\t/** Get Description.\n\t * Optional short description of the record\n\t */\n\tpublic String getDescription();\n\n /** Column name DescriptionNew */\n public static final String COLUMNNAME_DescriptionNew = \"DescriptionNew\";\n\n\t/** Set Description New\t */\n\tpublic void setDescriptionNew (String DescriptionNew);\n\n\t/** Get Description New\t */\n\tpublic String getDescriptionNew();\n\n /** Column name HC_Compensation1 */\n public static final String COLUMNNAME_HC_Compensation1 = \"HC_Compensation1\";\n\n\t/** Set Compensation 1\t */\n\tpublic void setHC_Compensation1 (BigDecimal HC_Compensation1);\n\n\t/** Get Compensation 1\t */\n\tpublic BigDecimal getHC_Compensation1();\n\n /** Column name HC_Compensation2 */\n public static final String COLUMNNAME_HC_Compensation2 = \"HC_Compensation2\";\n\n\t/** Set Compensation 2\t */\n\tpublic void setHC_Compensation2 (BigDecimal HC_Compensation2);\n\n\t/** Get Compensation 2\t */\n\tpublic BigDecimal getHC_Compensation2();\n\n /** Column name HC_Compensation3 */\n public static final String COLUMNNAME_HC_Compensation3 = \"HC_Compensation3\";\n\n\t/** Set Compensation 3\t */\n\tpublic void setHC_Compensation3 (BigDecimal HC_Compensation3);\n\n\t/** Get Compensation 3\t */\n\tpublic BigDecimal getHC_Compensation3();\n\n /** Column name HC_Compensation4 */\n public static final String COLUMNNAME_HC_Compensation4 = \"HC_Compensation4\";\n\n\t/** Set Compensation 4\t */\n\tpublic void setHC_Compensation4 (BigDecimal HC_Compensation4);\n\n\t/** Get Compensation 4\t */\n\tpublic BigDecimal getHC_Compensation4();\n\n /** Column name HC_EffectiveSeq */\n public static final String COLUMNNAME_HC_EffectiveSeq = \"HC_EffectiveSeq\";\n\n\t/** Set Effective Sequence\t */\n\tpublic void setHC_EffectiveSeq (int HC_EffectiveSeq);\n\n\t/** Get Effective Sequence\t */\n\tpublic int getHC_EffectiveSeq();\n\n /** Column name HC_Employee_ID */\n public static final String COLUMNNAME_HC_Employee_ID = \"HC_Employee_ID\";\n\n\t/** Set Employee Data\t */\n\tpublic void setHC_Employee_ID (int HC_Employee_ID);\n\n\t/** Get Employee Data\t */\n\tpublic int getHC_Employee_ID();\n\n\tpublic I_HC_Employee getHC_Employee() throws RuntimeException;\n\n /** Column name HC_EmployeeGrade_ID */\n public static final String COLUMNNAME_HC_EmployeeGrade_ID = \"HC_EmployeeGrade_ID\";\n\n\t/** Set Employee Grade\t */\n\tpublic void setHC_EmployeeGrade_ID (int HC_EmployeeGrade_ID);\n\n\t/** Get Employee Grade\t */\n\tpublic int getHC_EmployeeGrade_ID();\n\n\tpublic I_HC_EmployeeGrade getHC_EmployeeGrade() throws RuntimeException;\n\n /** Column name HC_EmployeeGrade2_ID */\n public static final String COLUMNNAME_HC_EmployeeGrade2_ID = \"HC_EmployeeGrade2_ID\";\n\n\t/** Set Employee Grade To\t */\n\tpublic void setHC_EmployeeGrade2_ID (int HC_EmployeeGrade2_ID);\n\n\t/** Get Employee Grade To\t */\n\tpublic int getHC_EmployeeGrade2_ID();\n\n\tpublic I_HC_EmployeeGrade getHC_EmployeeGrade2() throws RuntimeException;\n\n /** Column name HC_EmployeeJob_ID */\n public static final String COLUMNNAME_HC_EmployeeJob_ID = \"HC_EmployeeJob_ID\";\n\n\t/** Set Employee Job Data\t */\n\tpublic void setHC_EmployeeJob_ID (int HC_EmployeeJob_ID);\n\n\t/** Get Employee Job Data\t */\n\tpublic int getHC_EmployeeJob_ID();\n\n\tpublic I_HC_EmployeeJob getHC_EmployeeJob() throws RuntimeException;\n\n /** Column name HC_Job_ID */\n public static final String COLUMNNAME_HC_Job_ID = \"HC_Job_ID\";\n\n\t/** Set Job\t */\n\tpublic void setHC_Job_ID (int HC_Job_ID);\n\n\t/** Get Job\t */\n\tpublic int getHC_Job_ID();\n\n\tpublic I_HC_Job getHC_Job() throws RuntimeException;\n\n /** Column name HC_JobAction */\n public static final String COLUMNNAME_HC_JobAction = \"HC_JobAction\";\n\n\t/** Set Job Action\t */\n\tpublic void setHC_JobAction (String HC_JobAction);\n\n\t/** Get Job Action\t */\n\tpublic String getHC_JobAction();\n\n /** Column name HC_JobDataChange_ID */\n public static final String COLUMNNAME_HC_JobDataChange_ID = \"HC_JobDataChange_ID\";\n\n\t/** Set Job Data Change\t */\n\tpublic void setHC_JobDataChange_ID (int HC_JobDataChange_ID);\n\n\t/** Get Job Data Change\t */\n\tpublic int getHC_JobDataChange_ID();\n\n\tpublic I_HC_JobDataChange getHC_JobDataChange() throws RuntimeException;\n\n /** Column name HC_Manager_ID */\n public static final String COLUMNNAME_HC_Manager_ID = \"HC_Manager_ID\";\n\n\t/** Set Manager Name\t */\n\tpublic void setHC_Manager_ID (int HC_Manager_ID);\n\n\t/** Get Manager Name\t */\n\tpublic int getHC_Manager_ID();\n\n\tpublic I_HC_Employee getHC_Manager() throws RuntimeException;\n\n /** Column name HC_ManagerTo_ID */\n public static final String COLUMNNAME_HC_ManagerTo_ID = \"HC_ManagerTo_ID\";\n\n\t/** Set Manager To ID\t */\n\tpublic void setHC_ManagerTo_ID (int HC_ManagerTo_ID);\n\n\t/** Get Manager To ID\t */\n\tpublic int getHC_ManagerTo_ID();\n\n\tpublic I_HC_Employee getHC_ManagerTo() throws RuntimeException;\n\n /** Column name HC_Org_ID */\n public static final String COLUMNNAME_HC_Org_ID = \"HC_Org_ID\";\n\n\t/** Set HC Organization\t */\n\tpublic void setHC_Org_ID (int HC_Org_ID);\n\n\t/** Get HC Organization\t */\n\tpublic int getHC_Org_ID();\n\n\tpublic I_HC_Org getHC_Org() throws RuntimeException;\n\n /** Column name HC_Org2_ID */\n public static final String COLUMNNAME_HC_Org2_ID = \"HC_Org2_ID\";\n\n\t/** Set HC Organization To\t */\n\tpublic void setHC_Org2_ID (int HC_Org2_ID);\n\n\t/** Get HC Organization To\t */\n\tpublic int getHC_Org2_ID();\n\n\tpublic I_HC_Org getHC_Org2() throws RuntimeException;\n\n /** Column name HC_PayGroup_ID */\n public static final String COLUMNNAME_HC_PayGroup_ID = \"HC_PayGroup_ID\";\n\n\t/** Set Payroll Group\t */\n\tpublic void setHC_PayGroup_ID (int HC_PayGroup_ID);\n\n\t/** Get Payroll Group\t */\n\tpublic int getHC_PayGroup_ID();\n\n\tpublic I_HC_PayGroup getHC_PayGroup() throws RuntimeException;\n\n /** Column name HC_PreviousJob_ID */\n public static final String COLUMNNAME_HC_PreviousJob_ID = \"HC_PreviousJob_ID\";\n\n\t/** Set Job Sekarang\t */\n\tpublic void setHC_PreviousJob_ID (int HC_PreviousJob_ID);\n\n\t/** Get Job Sekarang\t */\n\tpublic int getHC_PreviousJob_ID();\n\n\tpublic I_HC_Job getHC_PreviousJob() throws RuntimeException;\n\n /** Column name HC_Reason_ID */\n public static final String COLUMNNAME_HC_Reason_ID = \"HC_Reason_ID\";\n\n\t/** Set HC Reason\t */\n\tpublic void setHC_Reason_ID (int HC_Reason_ID);\n\n\t/** Get HC Reason\t */\n\tpublic int getHC_Reason_ID();\n\n\tpublic I_HC_Reason getHC_Reason() throws RuntimeException;\n\n /** Column name HC_Status */\n public static final String COLUMNNAME_HC_Status = \"HC_Status\";\n\n\t/** Set HC Status\t */\n\tpublic void setHC_Status (String HC_Status);\n\n\t/** Get HC Status\t */\n\tpublic String getHC_Status();\n\n /** Column name HC_WorkEndDate */\n public static final String COLUMNNAME_HC_WorkEndDate = \"HC_WorkEndDate\";\n\n\t/** Set Work End Date\t */\n\tpublic void setHC_WorkEndDate (Timestamp HC_WorkEndDate);\n\n\t/** Get Work End Date\t */\n\tpublic Timestamp getHC_WorkEndDate();\n\n /** Column name HC_WorkPeriodDate */\n public static final String COLUMNNAME_HC_WorkPeriodDate = \"HC_WorkPeriodDate\";\n\n\t/** Set WorkPeriodDate\t */\n\tpublic void setHC_WorkPeriodDate (String HC_WorkPeriodDate);\n\n\t/** Get WorkPeriodDate\t */\n\tpublic String getHC_WorkPeriodDate();\n\n /** Column name HC_WorkStartDate */\n public static final String COLUMNNAME_HC_WorkStartDate = \"HC_WorkStartDate\";\n\n\t/** Set WorkStartDate\t */\n\tpublic void setHC_WorkStartDate (Timestamp HC_WorkStartDate);\n\n\t/** Get WorkStartDate\t */\n\tpublic Timestamp getHC_WorkStartDate();\n\n /** Column name HC_WorkStartDate2 */\n public static final String COLUMNNAME_HC_WorkStartDate2 = \"HC_WorkStartDate2\";\n\n\t/** Set Work Start Date Baru\t */\n\tpublic void setHC_WorkStartDate2 (Timestamp HC_WorkStartDate2);\n\n\t/** Get Work Start Date Baru\t */\n\tpublic Timestamp getHC_WorkStartDate2();\n\n /** Column name IHC_JobDataChange_ID */\n public static final String COLUMNNAME_IHC_JobDataChange_ID = \"IHC_JobDataChange_ID\";\n\n\t/** Set IHC_JobDayaChange\t */\n\tpublic void setIHC_JobDataChange_ID (int IHC_JobDataChange_ID);\n\n\t/** Get IHC_JobDayaChange\t */\n\tpublic int getIHC_JobDataChange_ID();\n\n /** Column name IHC_JobDataChange_UU */\n public static final String COLUMNNAME_IHC_JobDataChange_UU = \"IHC_JobDataChange_UU\";\n\n\t/** Set IHC_JobDataChange_UU\t */\n\tpublic void setIHC_JobDataChange_UU (String IHC_JobDataChange_UU);\n\n\t/** Get IHC_JobDataChange_UU\t */\n\tpublic String getIHC_JobDataChange_UU();\n\n /** Column name IsActive */\n public static final String COLUMNNAME_IsActive = \"IsActive\";\n\n\t/** Set Active.\n\t * The record is active in the system\n\t */\n\tpublic void setIsActive (boolean IsActive);\n\n\t/** Get Active.\n\t * The record is active in the system\n\t */\n\tpublic boolean isActive();\n\n /** Column name IsCancelled */\n public static final String COLUMNNAME_IsCancelled = \"IsCancelled\";\n\n\t/** Set Cancelled.\n\t * The transaction was cancelled\n\t */\n\tpublic void setIsCancelled (boolean IsCancelled);\n\n\t/** Get Cancelled.\n\t * The transaction was cancelled\n\t */\n\tpublic boolean isCancelled();\n\n /** Column name NomorSK */\n public static final String COLUMNNAME_NomorSK = \"NomorSK\";\n\n\t/** Set Nomor SK\t */\n\tpublic void setNomorSK (String NomorSK);\n\n\t/** Get Nomor SK\t */\n\tpublic String getNomorSK();\n\n /** Column name NomorSK2 */\n public static final String COLUMNNAME_NomorSK2 = \"NomorSK2\";\n\n\t/** Set Nomor SK Baru\t */\n\tpublic void setNomorSK2 (String NomorSK2);\n\n\t/** Get Nomor SK Baru\t */\n\tpublic String getNomorSK2();\n\n /** Column name OriginalServiceData */\n public static final String COLUMNNAME_OriginalServiceData = \"OriginalServiceData\";\n\n\t/** Set Original Service Date\t */\n\tpublic void setOriginalServiceData (Timestamp OriginalServiceData);\n\n\t/** Get Original Service Date\t */\n\tpublic Timestamp getOriginalServiceData();\n\n /** Column name Processed */\n public static final String COLUMNNAME_Processed = \"Processed\";\n\n\t/** Set Processed.\n\t * The document has been processed\n\t */\n\tpublic void setProcessed (boolean Processed);\n\n\t/** Get Processed.\n\t * The document has been processed\n\t */\n\tpublic boolean isProcessed();\n\n /** Column name SeqNo */\n public static final String COLUMNNAME_SeqNo = \"SeqNo\";\n\n\t/** Set Sequence.\n\t * Method of ordering records;\n lowest number comes first\n\t */\n\tpublic void setSeqNo (int SeqNo);\n\n\t/** Get Sequence.\n\t * Method of ordering records;\n lowest number comes first\n\t */\n\tpublic int getSeqNo();\n\n /** Column name Updated */\n public static final String COLUMNNAME_Updated = \"Updated\";\n\n\t/** Get Updated.\n\t * Date this record was updated\n\t */\n\tpublic Timestamp getUpdated();\n\n /** Column name UpdatedBy */\n public static final String COLUMNNAME_UpdatedBy = \"UpdatedBy\";\n\n\t/** Get Updated By.\n\t * User who updated this records\n\t */\n\tpublic int getUpdatedBy();\n}" ]
[ "0.720387", "0.60612166", "0.5897073", "0.5817371", "0.58169", "0.5653088", "0.5575094", "0.5565293", "0.5523116", "0.55214834", "0.5424825", "0.5421459", "0.5377486", "0.534678", "0.5342339", "0.53190213", "0.5239825", "0.5236659", "0.5227619", "0.513109", "0.5122094", "0.5114957", "0.5110571", "0.5092275", "0.50793064", "0.50710756", "0.50666755", "0.50432736", "0.50225407", "0.5009165", "0.5007035", "0.49747992", "0.49714422", "0.49305487", "0.4928956", "0.49114767", "0.49047396", "0.4894513", "0.488628", "0.48804012", "0.48787948", "0.4848689", "0.4836264", "0.4834436", "0.48120287", "0.4810927", "0.4800393", "0.4796319", "0.4796208", "0.47960824", "0.47906667", "0.4782785", "0.47692993", "0.47681826", "0.47613847", "0.47506967", "0.4746286", "0.47449973", "0.4743577", "0.47416592", "0.47313273", "0.47236001", "0.47218567", "0.47168458", "0.47161394", "0.47148344", "0.47092924", "0.47078082", "0.4703429", "0.46990865", "0.46964943", "0.46792674", "0.4675461", "0.4675461", "0.4675461", "0.4675461", "0.4675461", "0.46668383", "0.4666713", "0.46600732", "0.46600732", "0.4655324", "0.46417722", "0.46361163", "0.46348158", "0.46313247", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.4627627" ]
0.0
-1
This method was generated by MyBatis Generator. This method corresponds to the database table core.report_metadata
protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); return criteria; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "TableReportMetadata getReportMetadata(String reportId);", "public abstract List<ColumnSpecification> metadata();", "@Override\r\n\t\tpublic DatabaseMetaData getMetaData() throws SQLException {\n\t\t\treturn null;\r\n\t\t}", "@Override\n\tpublic JDBCMetaData getMetaData() throws SQLException {\n\t\treturn null;\n\t}", "private void writeMetaData(ResultSet resultSet) throws SQLException {\n\t System.out.println(\"The columns in the table are: \");\r\n\t System.out.println(\"Table: \" + resultSet.getMetaData().getTableName(1));\r\n\t for (int i = 1; i<= resultSet.getMetaData().getColumnCount(); i++){\r\n\t System.out.println(\"Column \" +i + \" \"+ resultSet.getMetaData().getColumnName(i));\r\n\t }\r\n\t }", "public interface TableMetaData {\n\n\t/** Adds normal column. */\n\tpublic void addColumn(final ColumnMetaData column);\n\n\t/** Adds primary key column. */\n\tpublic void addPrimaryKey(final ColumnMetaData column);\n\n\t/** Returns map of column meta data, keyed by the column label (the alias if provided in the query, otherwise the name). */\n\tpublic Map<String, ColumnMetaData> getColumns();\n\n\t/** Returns database name. */\n\tpublic String getDatabaseName();\n\n\t/** Returns ordered list of columns that are primary keys. */\n\tpublic List<ColumnMetaData> getPrimaryKeys();\n\n\t/**\n\t * Returns fully qualified table name in database-specific form for use in SQL statements. MySQL uses the form\n\t * <code>database.table</code>, for example <code>sakila.film</code>. PostgreSQL uses the form\n\t * <code>database.schema.table</code>, for example <code>sakila.public.film</code>.\n\t */\n\tpublic String getQualifiedTableName();\n\n\t/** Returns row alias. */\n\tpublic String getRowAlias();\n\t\n\t/** Returns row set alias. */\n\tpublic String getRowSetAlias();\n\t\n\t/**\n\t * Returns row alias.\n\t * \n * @deprecated As of 0.8.11 use {@link #getRowAlias()}\n\t */\n\t@Deprecated\n\tpublic String getTableAlias();\n\n\t/** Returns table name. */\n\tpublic String getTableName();\n\n\t/** Returns role of table in the SQL Resource. */\n\tpublic TableRole getTableRole();\n\n\t/** Returns true if the SQL Resource role is child. */\n\tpublic boolean isChild();\n\n\t/** Returns true if the SQL Resource role is parent. */\n\tpublic boolean isParent();\n\n\t/** Sets all the row and row set aliases. */\n\tpublic void setAliases(final String alias, final String rowAlias, final String rowSetAlias);\n\n\t/** Sets attributes. */\n\tpublic void setAttributes(final String tableName, final String qualifedTableName,\n\t\t\tfinal String databaseName, final TableRole tableRole);\n\n\t/**\n\t * Sets table alias.\n\t * \n * @deprecated As of 0.8.11 use {@link #setAliases(String, String, String)}\n\t */\n\t@Deprecated\n\tpublic void setTableAlias(final String tableAlias);\n\t\n\t/** Represents all of the roles a table may plan in a SQL Resource. */\n\t@XmlType(namespace = \"http://restsql.org/schema\")\n\tpublic enum TableRole {\n\t\tChild, ChildExtension, Join, Parent, ParentExtension, Unknown;\n\t}\n}", "public abstract List<String> newReportColumns();", "ResultSetMetaData getMetaData() throws SQLException;", "public DBMetaDataSet getMetaData()\n\t{\n\t\treturn _MetaData;\n\t}", "public interface SqlResourceMetaData {\r\n\r\n\tpublic List<ColumnMetaData> getAllReadColumns();\r\n\r\n\tpublic TableMetaData getChild();\r\n\r\n\tpublic List<TableMetaData> getChildPlusExtTables();\r\n\r\n\tpublic List<ColumnMetaData> getChildReadColumns();\r\n\r\n\tpublic TableMetaData getJoin();\r\n\r\n\tpublic List<TableMetaData> getJoinList();\r\n\r\n\tpublic int getNumberTables();\r\n\r\n\tpublic TableMetaData getParent();\r\n\r\n\tpublic List<TableMetaData> getParentPlusExtTables();\r\n\r\n\tpublic List<ColumnMetaData> getParentReadColumns();\r\n\r\n\tpublic Map<String, TableMetaData> getTableMap();\r\n\r\n\tpublic List<TableMetaData> getTables();\r\n\r\n\tpublic List<TableMetaData> getWriteTables(final Type requestType, final boolean doParent);\r\n\r\n\tpublic boolean hasJoinTable();\r\n\r\n\tpublic boolean hasMultipleDatabases();\r\n\r\n\tpublic boolean isHierarchical();\r\n\r\n\tpublic void init(final String sqlResourceName, final SqlResourceDefinition definition, final SqlBuilder sqlBuilder)\r\n\t\t\tthrows SqlResourceException;\r\n\r\n\tpublic String toHtml();\r\n\r\n\tpublic String toXml();\r\n}", "public void addColumnPathReportId() {\n addColumnInPath(ColumnMetaData.KEY_PATH_ID);\n }", "public ResultSetMetaData getMetaData() throws SQLException {\n\n try {\n int id = getNextId(TraceObject.RESULT_SET_META_DATA);\n if (isDebugEnabled()) {\n debugCodeAssign(\"ResultSetMetaData\", TraceObject.RESULT_SET_META_DATA, id, \"getMetaData()\");\n }\n checkClosed();\n String catalog = conn.getCatalog();\n JdbcResultSetMetaData meta = new JdbcResultSetMetaData(this, null, result, catalog, conn.getSession().getTrace(), id);\n return meta;\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "public MetaData getMetaData();", "@Override\n public DatabaseMetaData getMetaData() throws SQLException\n {\n logger.debug(\n \" public DatabaseMetaData getMetaData() throws SQLException\");\n\n return new SnowflakeDatabaseMetaData(this);\n }", "public DataSetMetaData getMetaData() {\n return this.metadata;\n }", "@Test\n public void metaDataExample1() throws SQLException {\n Connection connection = DriverManager.getConnection(dbUrl, dbUsername, dbPassword);\n // 2. Create statement\n Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);\n // Run sql query and get the result in resultSet object\n String sqlQuery= \"Select * From departments\";\n //String sqlQuery= \"Select first_name, last_name, salary From employees\";\n ResultSet resultSet = statement.executeQuery(sqlQuery);\n\n // we use resultSet metadata to get information about the tables\n // get the resultSet object metadata\n ResultSetMetaData rsMetadata = resultSet.getMetaData();\n\n // List for keeping all rows as a map\n List<Map<String, Object>> queryData = new ArrayList<>();\n\n // while(resultSet.next()) helps to iterate through columns\n while (resultSet.next()) {\n // key(columns) will be string but value can be any type of data. That's why we choose <String, Object>\n Map<String, Object> row = new HashMap<>(); // creating empty Map\n // number of columns\n int colCount = rsMetadata.getColumnCount();\n // for loop helps to iterate through columns\n for (int i = 1; i <= colCount; i++) {\n row.put(rsMetadata.getColumnName(i), resultSet.getObject(i));\n }\n\n queryData.add(row); // adding a Map to the List of Maps\n }\n\n // Printing the rows\n for (Map<String, Object> row: queryData) {\n System.out.println(row.toString());\n\n }\n\n\n\n\n // close all connections\n resultSet.close();\n statement.close();\n connection.close();\n }", "@Override\n\tpublic DBMetadata getMetadata() {\n\t\treturn null;\n\t}", "public MetaData getMetaData() {\r\n \treturn metaData;\r\n }", "@Override\n public SystemMetadata mapRow(ResultSet resultSet, int rowNumber) throws SQLException {\n\n // resultSet contains guid, serialVersion, date_modified, and archived column data\n SystemMetadata systemMetadata = new SystemMetadata();\n ReplicationPolicy replPolicy = new ReplicationPolicy();\n AccessPolicy accessPolicy = new AccessPolicy();\n\n // add guid\n Identifier pid = new Identifier();\n pid.setValue(resultSet.getString(\"guid\"));\n systemMetadata.setIdentifier(pid);\n \n // add seriesId\n Identifier seriesId = new Identifier();\n seriesId.setValue(resultSet.getString(\"series_id\"));\n systemMetadata.setSeriesId(seriesId);\n\n // add serialVersion\n BigInteger serialVersion = new BigInteger(resultSet.getString(\"serial_version\"));\n systemMetadata.setSerialVersion(serialVersion);\n\n // add date_modified\n Date dateSystemMetadataLastModified = resultSet.getTimestamp(\"date_modified\");\n systemMetadata.setDateSysMetadataModified(dateSystemMetadataLastModified);\n\n // add archived value, if it was stored\n boolean archived = resultSet.getBoolean(\"archived\"); // getBoolean returns false for null results\n if (!resultSet.wasNull())\n systemMetadata.setArchived(new Boolean(archived));\n\n // add date_uploaded\n Date dateUploaded = resultSet.getTimestamp(\"date_uploaded\");\n systemMetadata.setDateUploaded(dateUploaded);\n\n // add rights_holder\n Subject rightsHolderSubject = new Subject();\n String rightsHolder = resultSet.getString(\"rights_holder\");\n rightsHolderSubject.setValue(rightsHolder);\n systemMetadata.setRightsHolder(rightsHolderSubject);\n\n // add checksum, checksum_algorithm\n String checksum = resultSet.getString(\"checksum\");\n String checksumAlgorithm = resultSet.getString(\"checksum_algorithm\");\n Checksum checksumObject = new Checksum();\n checksumObject.setValue(checksum);\n checksumObject.setAlgorithm(checksumAlgorithm);\n systemMetadata.setChecksum(checksumObject);\n\n // add origin_member_node\n String originMemberNode = resultSet.getString(\"origin_member_node\");\n if (originMemberNode != null) {\n NodeReference omn = new NodeReference();\n omn.setValue(originMemberNode);\n systemMetadata.setOriginMemberNode(omn);\n }\n\n // add authoritive_member_node\n String authoritativeMemberNode = resultSet.getString(\"authoritive_member_node\");\n if (originMemberNode != null) {\n NodeReference amn = new NodeReference();\n amn.setValue(authoritativeMemberNode);\n systemMetadata.setAuthoritativeMemberNode(amn);\n }\n\n // add submitter\n String submitter = resultSet.getString(\"submitter\");\n if (submitter != null) {\n Subject submitterSubject = new Subject();\n submitterSubject.setValue(submitter);\n systemMetadata.setSubmitter(submitterSubject);\n }\n\n // add object_format\n String fmtidStr = resultSet.getString(\"object_format\");\n ObjectFormatIdentifier fmtid = new ObjectFormatIdentifier();\n fmtid.setValue(fmtidStr);\n systemMetadata.setFormatId(fmtid);\n\n // add size\n String size = resultSet.getString(\"size\");\n systemMetadata.setSize(new BigInteger(size));\n\n // add obsoletes\n String obsoletes = resultSet.getString(\"obsoletes\");\n if (obsoletes != null) {\n Identifier obsoletesId = new Identifier();\n obsoletesId.setValue(obsoletes);\n systemMetadata.setObsoletes(obsoletesId);\n }\n // add obsoleted_by\n String obsoletedBy = resultSet.getString(\"obsoleted_by\");\n if (obsoletedBy != null) {\n Identifier obsoletedById = new Identifier();\n obsoletedById.setValue(obsoletedBy);\n systemMetadata.setObsoletedBy(obsoletedById);\n }\n\n // potentially build a ReplicationPolicy\n \n // add replication_allowed, if it was persisted\n boolean replAllowed = resultSet.getBoolean(\"replication_allowed\"); // getBoolean returns false for null results\n \n if (!resultSet.wasNull()) {\n // populate and add ReplicationPolicy\n ReplicationPolicy replicationPolicy = new ReplicationPolicy();\n \n replicationPolicy.setReplicationAllowed(new Boolean(replAllowed));\n\n // add number_replicas\n int numberOfReplicas = resultSet.getInt(\"number_replicas\"); // getInt returns 0 for null values\n if (numberOfReplicas > 0) {\n replicationPolicy.setNumberReplicas(new Integer(numberOfReplicas));\n\n }\n\n // add preferred and blocked lists\n List<ReplicationPolicyEntry> replPolicies = new ArrayList<ReplicationPolicyEntry>();\n List<NodeReference> preferredNodes = new ArrayList<NodeReference>();\n List<NodeReference> blockedNodes = new ArrayList<NodeReference>();\n\n replPolicies = listReplicationPolicies(pid, localTableMap);\n\n for (ReplicationPolicyEntry policy : replPolicies) {\n Identifier id = policy.getPid();\n String entryPolicy = policy.getPolicy();\n NodeReference node = policy.getMemberNode();\n\n if (entryPolicy.equals(\"preferred\")) {\n preferredNodes.add(node);\n\n } else if (entryPolicy.equals(\"blocked\")) {\n blockedNodes.add(node);\n\n }\n }\n\n replicationPolicy.setPreferredMemberNodeList(preferredNodes);\n replicationPolicy.setBlockedMemberNodeList(blockedNodes);\n\n systemMetadata.setReplicationPolicy(replicationPolicy);\n } else {\n systemMetadata.setReplicationPolicy(null);\n }\n\n // populate and add replicas list\n\n List<Replica> replicas = new ArrayList<Replica>();\n replicas = listReplicaEntries(pid, localTableMap);\n systemMetadata.setReplicaList(replicas);\n\n // populate and add AccessPolicy\n List<AccessRule> accessRules = new ArrayList<AccessRule>();\n accessRules = listAccessRules(pid, localTableMap);\n accessPolicy.setAllowList(accessRules);\n systemMetadata.setAccessPolicy(accessPolicy);\n\n // Validate the system metadata in debug mode using TypeMarshaller\n if (log.isDebugEnabled()) {\n try {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n TypeMarshaller.marshalTypeToOutputStream(systemMetadata, baos);\n log.debug(\"SystemMetadata for pid \" + pid.getValue() + \" is: \"\n + baos.toString());\n\n } catch (MarshallingException e) {\n e.printStackTrace();\n\n } catch (IOException e) {\n e.printStackTrace();\n\n }\n }\n return systemMetadata;\n }", "public MetaData getMetaData() {\n return metaData;\n }", "public ResultSetMetaData getMetaData() throws SQLException\n {\n return m_rs.getMetaData();\n }", "public ShowTableMetadataResponse showTableMetadata(ShowTableMetadataRequest request) throws GPUdbException {\n ShowTableMetadataResponse actualResponse_ = new ShowTableMetadataResponse();\n submitRequest(\"/show/table/metadata\", request, actualResponse_, false);\n return actualResponse_;\n }", "SQLServerResultSetMetaData(SQLServerConnection con, SQLServerResultSet rs) \n {\n traceID = \" SQLServerResultSetMetaData:\" + nextInstanceID();\n this.con = con;\n this.rs =rs;\n assert rs !=null;\n if(logger.isLoggable(java.util.logging.Level.FINE))\n {\n logger.fine(toString() + \" created by (\" + rs.toString() + \")\");\n }\n }", "@Override\n public RavenJObject getMetadata() {\n return metadata;\n }", "@Override\n\tpublic List<Map<String, String>> selectReportInfo(String appId) {\n\t\treturn getSqlMap().queryForList(NAMESPACES + \"queryReportInfo\", appId);\n\t}", "void processMetaData(ResultSet rs) throws SQLException;", "public interface ColumnMetaData {\n\n\t/**\n\t * The uniqueness level of a column data type.\n\t */\n\tenum Uniqueness {\n\t\t/**\n\t\t * No limitations. Multiple instances of a single column meta data type can be attached to a table or even a\n\t\t * single column.\n\t\t */\n\t\tNONE,\n\n\t\t/**\n\t\t * Multiple instances of a single column meta data type can be attached to a table but at most one per column.\n\t\t */\n\t\tCOLUMN,\n\n\t\t/**\n\t\t * At most one instance of the column meta data type can be attached to a table.\n\t\t */\n\t\tTABLE\n\t}\n\n\t/**\n\t * The unique type id of the column meta data.\n\t *\n\t * @return the type id\n\t */\n\tString type();\n\n\t/**\n\t * The uniqueness level of the meta data. Defaults to {@link Uniqueness#NONE} (no restrictions).\n\t *\n\t * @return the uniqueness level\n\t */\n\tdefault Uniqueness uniqueness() {\n\t\treturn Uniqueness.NONE;\n\t}\n\n}", "public HashMap getMetaData() ;", "Metadata getMetaData();", "@Override\n public SystemMetadataStatus mapRow(ResultSet resultSet, int rowNumber) throws SQLException {\n\n // resultSet contains guid, serialVersion, date_modified, and archived column data\n SystemMetadataStatus systemMetadataStatus = new SystemMetadataStatus();\n\n // add guid\n Identifier pid = new Identifier();\n pid.setValue(resultSet.getString(\"guid\"));\n systemMetadataStatus.setPid(pid);\n\n // add serialVersion\n BigInteger serialVersion = new BigInteger(resultSet.getString(\"serial_version\"));\n systemMetadataStatus.setSerialVersion(serialVersion);\n\n // add date_modified\n Date dateSystemMetadataLastModified = resultSet.getTimestamp(\"date_modified\");\n systemMetadataStatus\n .setLastSystemMetadataModificationDate(dateSystemMetadataLastModified);\n\n // add archived\n boolean archived = resultSet.getBoolean(\"archived\"); // getBoolean returns false for null results\n systemMetadataStatus.setDeleted(new Boolean(archived));\n\n return systemMetadataStatus;\n }", "@Override\n public String toString() {\n return \"Report{\" +\n \"reportId=\" + reportId +\n \", reportOpId=\" + reportOp +\n \", date='\" + date + '\\'' +\n \", reportedUserId=\" + reportedUser +\n \", userId=\" + user +\n \", status=\" + status +\n '}';\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}", "CustomReport selectByPrimaryKey(BigDecimal reportId);", "public ResultSetMetaData getMetaData() throws SQLException {\n return currentPreparedStatement.getMetaData();\n }", "public ReportTable(TableView<Report> reportTable) {\n this.reportTable = reportTable;\n }", "public void analizeQueryResultMetaData(ResultSetMetaData rsMetaData, String[] decimalColumns){\n\t\tArrayList<Integer> decimalColumnResultsetIndexes = new ArrayList<Integer>();\n\t\t//if ( decimalColumns==null||decimalColumns.length==0)\n\t\t//\treturn ; \n\t\ttry {\n\t\t\t\n\t\t\t\n\t\t\t//IObjectToStringConverter[] converters = new IObjectToStringConverter[rsMetaData.getColumnCount()] ;\n\t\t\tOuputDataType[] dataTypes = new OuputDataType[rsMetaData.getColumnCount()] ;\n\t\t\tjobContext.put(ExportEngineConstant.COLUMN_CONVERTER_KEY, dataTypes);\n\t\t\tfor ( int i=1 ; i <= rsMetaData.getColumnCount(); i++){\n\t\t\t\tboolean isDecimal = false ; \n\t\t\t\tString nama = rsMetaData.getColumnName(i).toUpperCase();\n\t\t\t\tif ( decimalColumns!=null){\n\t\t\t\t\tfor ( String scn : decimalColumns){\n\t\t\t\t\t\tif ( nama.equalsIgnoreCase(scn)){\n\t\t\t\t\t\t\tdecimalColumnResultsetIndexes.add(i-1);\n\t\t\t\t\t\t\tisDecimal = true ;\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.money; \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\tif( !isDecimal){\n\t\t\t\t\tString tipeCol = rsMetaData.getColumnClassName(i) ;\n\t\t\t\t\tboolean isDate = false ; \n\t\t\t\t\tfor ( String scn : DATE_DATA_TYPES){\n\t\t\t\t\t\tif ( tipeCol.equals(scn)){\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.date; \n\t\t\t\t\t\t\tisDate = true ; \n\t\t\t\t\t\t\tbreak ; \n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( !isDate){\n\t\t\t\t\t\tif (String.class.getName().equals(tipeCol)){\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.string;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.commonToString;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfor ( OuputDataType scn : dataTypes ){\n\t\t\t\tSystem.out.println(\"converter : \" + scn);\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"gagal membaca data column unutk membuat converter object array. error message :\" + e.getMessage() , e); \n\t\t}\n\t\t\n\t\t\n\t}", "private static void writeColumnMetaData(JsonGenerator jg, ColumnMetaData mdt) throws JsonGenerationException, IOException {\n\t\tjg.writeStartObject();\n\t\tjg.writeStringField(\"name\", mdt.columnName);\n\t\tjg.writeStringField(\"type\", mdt.columnType);\n\t\tjg.writeEndObject();;\n\t}", "private String metadata() {\n\t\tStringBuilder s = new StringBuilder();\n\t\ts.append(\"#######################################\");\n\t\ts.append(\"\\n# Metadata of query set\");\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Queries\");\n\t\ts.append(\"\\n# \\tTotal: \" + this.num_queries);\n\t\ts.append(\"\\n# \\tPoint: \" + this.num_pt_queries + \" (\" + 100 * ((double) this.num_pt_queries/this.num_queries) +\"%)\");\n\t\ts.append(\"\\n# \\tRange: \" + this.num_range_queries + \" (\" + 100 * ((double) this.num_range_queries/this.num_queries) +\"%)\");\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Operators\");\n\t\ts.append(\"\\n# \\tTotal: \" + (this.num_and_ops + this.num_or_ops) + \" (\" + ((double) (this.num_and_ops + this.num_or_ops)/this.num_queries) +\" per query)\");\n\t\ts.append(\"\\n# \\tAND: \" + this.num_and_ops);\n\t\ts.append(\"\\n# \\tOR: \" + this.num_or_ops);\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Attributes\");\n\t\ts.append(\"\\n# \\tTotal queried: \" + this.num_attributes);\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Bins\");\n\t\ts.append(\"\\n# \\tTotal queried: \" + this.num_bins);\n\t\ts.append(\"\\n# \\tPer query: \" + ((double) this.num_bins/this.num_queries));\n\t\ts.append(\"\\n#######################################\\n\");\n\t\treturn s.toString();\n\t}", "public List<Map<String, Object>> getDatewiseUpdateData(String columnName) {\n\t\tList<Map<String, Object>> reportData = new ArrayList<>();\n\n\t\tswitch (columnName) {\n\t\tcase \"LASTUPDATED\":\n\t\t\treportData = getLastUpdatedReport();\n\t\t\tbreak;\n\t\tcase \"CREATEDON\":\n\t\t\treportData = getCreatedOnReport();\n\t\t\tbreak;\n\t\tcase \"READON\":\n\t\t\treportData = getReadOnReport();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tSystem.out.println(\"Invalid column name\");\n\t\t}\n\t\treturn reportData;\n\t}", "public Map<String, Object> getMetaData() {\n\t\treturn metaData;\n\t}", "public MetadataArtifactDownloadReport getReport() {\n return report;\n }", "public Map<String, ColumnMetaData> getColumns();", "public abstract String metadata(String property);", "@Override\n\tpublic IColumns createColumns() {\n\t\treturn new WaybillforauditColumns();\n\t}", "@Schema(description = \"`status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Binary general-info: The input information used to assemble the report that can be on-going, periodic and actual and projected \")\n public Object getAssessmentInstanceReportRecord() {\n return assessmentInstanceReportRecord;\n }", "public AlterTableMetadataResponse alterTableMetadata(AlterTableMetadataRequest request) throws GPUdbException {\n AlterTableMetadataResponse actualResponse_ = new AlterTableMetadataResponse();\n submitRequest(\"/alter/table/metadata\", request, actualResponse_, false);\n return actualResponse_;\n }", "public Long getReportId() {\n return reportId;\n }", "@Schema(description = \"`status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Binary general-info: The external report in any suitable form including selection filters where appropriate \")\n public Object getAssessmentInstanceReport() {\n return assessmentInstanceReport;\n }", "@SuppressWarnings(\"all\")\npublic interface I_I_BankDataJP \n{\n\n /** TableName=I_BankDataJP */\n public static final String Table_Name = \"I_BankDataJP\";\n\n /** AD_Table_ID=1000307 */\n public static final int Table_ID = MTable.getTable_ID(Table_Name);\n\n KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);\n\n /** AccessLevel = 3 - Client - Org \n */\n BigDecimal accessLevel = BigDecimal.valueOf(3);\n\n /** Load Meta Data */\n\n /** Column name AD_Client_ID */\n public static final String COLUMNNAME_AD_Client_ID = \"AD_Client_ID\";\n\n\t/** Get Tenant.\n\t * Tenant for this installation.\n\t */\n\tpublic int getAD_Client_ID();\n\n /** Column name AD_OrgTrx_ID */\n public static final String COLUMNNAME_AD_OrgTrx_ID = \"AD_OrgTrx_ID\";\n\n\t/** Set Trx Organization.\n\t * Performing or initiating organization\n\t */\n\tpublic void setAD_OrgTrx_ID (int AD_OrgTrx_ID);\n\n\t/** Get Trx Organization.\n\t * Performing or initiating organization\n\t */\n\tpublic int getAD_OrgTrx_ID();\n\n /** Column name AD_Org_ID */\n public static final String COLUMNNAME_AD_Org_ID = \"AD_Org_ID\";\n\n\t/** Set Organization.\n\t * Organizational entity within tenant\n\t */\n\tpublic void setAD_Org_ID (int AD_Org_ID);\n\n\t/** Get Organization.\n\t * Organizational entity within tenant\n\t */\n\tpublic int getAD_Org_ID();\n\n /** Column name AccountNo */\n public static final String COLUMNNAME_AccountNo = \"AccountNo\";\n\n\t/** Set Account No.\n\t * Account Number\n\t */\n\tpublic void setAccountNo (String AccountNo);\n\n\t/** Get Account No.\n\t * Account Number\n\t */\n\tpublic String getAccountNo();\n\n /** Column name BankAccountType */\n public static final String COLUMNNAME_BankAccountType = \"BankAccountType\";\n\n\t/** Set Bank Account Type.\n\t * Bank Account Type\n\t */\n\tpublic void setBankAccountType (String BankAccountType);\n\n\t/** Get Bank Account Type.\n\t * Bank Account Type\n\t */\n\tpublic String getBankAccountType();\n\n /** Column name C_BankAccount_ID */\n public static final String COLUMNNAME_C_BankAccount_ID = \"C_BankAccount_ID\";\n\n\t/** Set Bank Account.\n\t * Account at the Bank\n\t */\n\tpublic void setC_BankAccount_ID (int C_BankAccount_ID);\n\n\t/** Get Bank Account.\n\t * Account at the Bank\n\t */\n\tpublic int getC_BankAccount_ID();\n\n\tpublic org.compiere.model.I_C_BankAccount getC_BankAccount() throws RuntimeException;\n\n /** Column name C_Bank_ID */\n public static final String COLUMNNAME_C_Bank_ID = \"C_Bank_ID\";\n\n\t/** Set Bank.\n\t * Bank\n\t */\n\tpublic void setC_Bank_ID (int C_Bank_ID);\n\n\t/** Get Bank.\n\t * Bank\n\t */\n\tpublic int getC_Bank_ID();\n\n\tpublic org.compiere.model.I_C_Bank getC_Bank() throws RuntimeException;\n\n /** Column name Created */\n public static final String COLUMNNAME_Created = \"Created\";\n\n\t/** Get Created.\n\t * Date this record was created\n\t */\n\tpublic Timestamp getCreated();\n\n /** Column name CreatedBy */\n public static final String COLUMNNAME_CreatedBy = \"CreatedBy\";\n\n\t/** Get Created By.\n\t * User who created this records\n\t */\n\tpublic int getCreatedBy();\n\n /** Column name DateAcct */\n public static final String COLUMNNAME_DateAcct = \"DateAcct\";\n\n\t/** Set Account Date.\n\t * Accounting Date\n\t */\n\tpublic void setDateAcct (Timestamp DateAcct);\n\n\t/** Get Account Date.\n\t * Accounting Date\n\t */\n\tpublic Timestamp getDateAcct();\n\n /** Column name I_BankDataJP_ID */\n public static final String COLUMNNAME_I_BankDataJP_ID = \"I_BankDataJP_ID\";\n\n\t/** Set I_BankDataJP.\n\t * JPIERE-0595:JPBP\n\t */\n\tpublic void setI_BankDataJP_ID (int I_BankDataJP_ID);\n\n\t/** Get I_BankDataJP.\n\t * JPIERE-0595:JPBP\n\t */\n\tpublic int getI_BankDataJP_ID();\n\n /** Column name I_BankDataJP_UU */\n public static final String COLUMNNAME_I_BankDataJP_UU = \"I_BankDataJP_UU\";\n\n\t/** Set I_BankDataJP_UU\t */\n\tpublic void setI_BankDataJP_UU (String I_BankDataJP_UU);\n\n\t/** Get I_BankDataJP_UU\t */\n\tpublic String getI_BankDataJP_UU();\n\n /** Column name I_ErrorMsg */\n public static final String COLUMNNAME_I_ErrorMsg = \"I_ErrorMsg\";\n\n\t/** Set Import Error Message.\n\t * Messages generated from import process\n\t */\n\tpublic void setI_ErrorMsg (String I_ErrorMsg);\n\n\t/** Get Import Error Message.\n\t * Messages generated from import process\n\t */\n\tpublic String getI_ErrorMsg();\n\n /** Column name I_IsImported */\n public static final String COLUMNNAME_I_IsImported = \"I_IsImported\";\n\n\t/** Set Imported.\n\t * Has this import been processed\n\t */\n\tpublic void setI_IsImported (boolean I_IsImported);\n\n\t/** Get Imported.\n\t * Has this import been processed\n\t */\n\tpublic boolean isI_IsImported();\n\n /** Column name IsActive */\n public static final String COLUMNNAME_IsActive = \"IsActive\";\n\n\t/** Set Active.\n\t * The record is active in the system\n\t */\n\tpublic void setIsActive (boolean IsActive);\n\n\t/** Get Active.\n\t * The record is active in the system\n\t */\n\tpublic boolean isActive();\n\n /** Column name JP_A_Name */\n public static final String COLUMNNAME_JP_A_Name = \"JP_A_Name\";\n\n\t/** Set Account Name\t */\n\tpublic void setJP_A_Name (String JP_A_Name);\n\n\t/** Get Account Name\t */\n\tpublic String getJP_A_Name();\n\n /** Column name JP_A_Name_Kana */\n public static final String COLUMNNAME_JP_A_Name_Kana = \"JP_A_Name_Kana\";\n\n\t/** Set Account Name(Kana)\t */\n\tpublic void setJP_A_Name_Kana (String JP_A_Name_Kana);\n\n\t/** Get Account Name(Kana)\t */\n\tpublic String getJP_A_Name_Kana();\n\n /** Column name JP_AcctDate */\n public static final String COLUMNNAME_JP_AcctDate = \"JP_AcctDate\";\n\n\t/** Set Date of Account Date\t */\n\tpublic void setJP_AcctDate (String JP_AcctDate);\n\n\t/** Get Date of Account Date\t */\n\tpublic String getJP_AcctDate();\n\n /** Column name JP_AcctMonth */\n public static final String COLUMNNAME_JP_AcctMonth = \"JP_AcctMonth\";\n\n\t/** Set Month of Account Date\t */\n\tpublic void setJP_AcctMonth (String JP_AcctMonth);\n\n\t/** Get Month of Account Date\t */\n\tpublic String getJP_AcctMonth();\n\n /** Column name JP_BankAccountType */\n public static final String COLUMNNAME_JP_BankAccountType = \"JP_BankAccountType\";\n\n\t/** Set Bank Account Type\t */\n\tpublic void setJP_BankAccountType (String JP_BankAccountType);\n\n\t/** Get Bank Account Type\t */\n\tpublic String getJP_BankAccountType();\n\n /** Column name JP_BankAccount_Value */\n public static final String COLUMNNAME_JP_BankAccount_Value = \"JP_BankAccount_Value\";\n\n\t/** Set Bank Account(Search Key)\t */\n\tpublic void setJP_BankAccount_Value (String JP_BankAccount_Value);\n\n\t/** Get Bank Account(Search Key)\t */\n\tpublic String getJP_BankAccount_Value();\n\n /** Column name JP_BankDataCustomerCode1 */\n public static final String COLUMNNAME_JP_BankDataCustomerCode1 = \"JP_BankDataCustomerCode1\";\n\n\t/** Set Bank Data Customer Code1\t */\n\tpublic void setJP_BankDataCustomerCode1 (String JP_BankDataCustomerCode1);\n\n\t/** Get Bank Data Customer Code1\t */\n\tpublic String getJP_BankDataCustomerCode1();\n\n /** Column name JP_BankDataCustomerCode2 */\n public static final String COLUMNNAME_JP_BankDataCustomerCode2 = \"JP_BankDataCustomerCode2\";\n\n\t/** Set Bank Data Customer Code2\t */\n\tpublic void setJP_BankDataCustomerCode2 (String JP_BankDataCustomerCode2);\n\n\t/** Get Bank Data Customer Code2\t */\n\tpublic String getJP_BankDataCustomerCode2();\n\n /** Column name JP_BankDataLine_ID */\n public static final String COLUMNNAME_JP_BankDataLine_ID = \"JP_BankDataLine_ID\";\n\n\t/** Set Import Bank Data Line\t */\n\tpublic void setJP_BankDataLine_ID (int JP_BankDataLine_ID);\n\n\t/** Get Import Bank Data Line\t */\n\tpublic int getJP_BankDataLine_ID();\n\n\tpublic I_JP_BankDataLine getJP_BankDataLine() throws RuntimeException;\n\n /** Column name JP_BankData_EDI_Info */\n public static final String COLUMNNAME_JP_BankData_EDI_Info = \"JP_BankData_EDI_Info\";\n\n\t/** Set BankData EDI Info\t */\n\tpublic void setJP_BankData_EDI_Info (String JP_BankData_EDI_Info);\n\n\t/** Get BankData EDI Info\t */\n\tpublic String getJP_BankData_EDI_Info();\n\n /** Column name JP_BankData_ID */\n public static final String COLUMNNAME_JP_BankData_ID = \"JP_BankData_ID\";\n\n\t/** Set Import Bank Data\t */\n\tpublic void setJP_BankData_ID (int JP_BankData_ID);\n\n\t/** Get Import Bank Data\t */\n\tpublic int getJP_BankData_ID();\n\n\tpublic I_JP_BankData getJP_BankData() throws RuntimeException;\n\n /** Column name JP_BankData_ReferenceNo */\n public static final String COLUMNNAME_JP_BankData_ReferenceNo = \"JP_BankData_ReferenceNo\";\n\n\t/** Set Bank Data ReferenceNo\t */\n\tpublic void setJP_BankData_ReferenceNo (String JP_BankData_ReferenceNo);\n\n\t/** Get Bank Data ReferenceNo\t */\n\tpublic String getJP_BankData_ReferenceNo();\n\n /** Column name JP_BankName_Kana */\n public static final String COLUMNNAME_JP_BankName_Kana = \"JP_BankName_Kana\";\n\n\t/** Set Bank Name(Kana)\t */\n\tpublic void setJP_BankName_Kana (String JP_BankName_Kana);\n\n\t/** Get Bank Name(Kana)\t */\n\tpublic String getJP_BankName_Kana();\n\n /** Column name JP_BankName_Kana_Line */\n public static final String COLUMNNAME_JP_BankName_Kana_Line = \"JP_BankName_Kana_Line\";\n\n\t/** Set Bank Name(Kana) Line\t */\n\tpublic void setJP_BankName_Kana_Line (String JP_BankName_Kana_Line);\n\n\t/** Get Bank Name(Kana) Line\t */\n\tpublic String getJP_BankName_Kana_Line();\n\n /** Column name JP_Bank_Name */\n public static final String COLUMNNAME_JP_Bank_Name = \"JP_Bank_Name\";\n\n\t/** Set Bank Name\t */\n\tpublic void setJP_Bank_Name (String JP_Bank_Name);\n\n\t/** Get Bank Name\t */\n\tpublic String getJP_Bank_Name();\n\n /** Column name JP_BranchCode */\n public static final String COLUMNNAME_JP_BranchCode = \"JP_BranchCode\";\n\n\t/** Set Branch Code\t */\n\tpublic void setJP_BranchCode (String JP_BranchCode);\n\n\t/** Get Branch Code\t */\n\tpublic String getJP_BranchCode();\n\n /** Column name JP_BranchName */\n public static final String COLUMNNAME_JP_BranchName = \"JP_BranchName\";\n\n\t/** Set Branch Name\t */\n\tpublic void setJP_BranchName (String JP_BranchName);\n\n\t/** Get Branch Name\t */\n\tpublic String getJP_BranchName();\n\n /** Column name JP_BranchName_Kana */\n public static final String COLUMNNAME_JP_BranchName_Kana = \"JP_BranchName_Kana\";\n\n\t/** Set Branch Name(Kana)\t */\n\tpublic void setJP_BranchName_Kana (String JP_BranchName_Kana);\n\n\t/** Get Branch Name(Kana)\t */\n\tpublic String getJP_BranchName_Kana();\n\n /** Column name JP_BranchName_Kana_Line */\n public static final String COLUMNNAME_JP_BranchName_Kana_Line = \"JP_BranchName_Kana_Line\";\n\n\t/** Set Branch Name(Kana) Line\t */\n\tpublic void setJP_BranchName_Kana_Line (String JP_BranchName_Kana_Line);\n\n\t/** Get Branch Name(Kana) Line\t */\n\tpublic String getJP_BranchName_Kana_Line();\n\n /** Column name JP_Date */\n public static final String COLUMNNAME_JP_Date = \"JP_Date\";\n\n\t/** Set Date.\n\t * Date\n\t */\n\tpublic void setJP_Date (String JP_Date);\n\n\t/** Get Date.\n\t * Date\n\t */\n\tpublic String getJP_Date();\n\n /** Column name JP_Line_Description */\n public static final String COLUMNNAME_JP_Line_Description = \"JP_Line_Description\";\n\n\t/** Set Line Description\t */\n\tpublic void setJP_Line_Description (String JP_Line_Description);\n\n\t/** Get Line Description\t */\n\tpublic String getJP_Line_Description();\n\n /** Column name JP_Month */\n public static final String COLUMNNAME_JP_Month = \"JP_Month\";\n\n\t/** Set Month\t */\n\tpublic void setJP_Month (String JP_Month);\n\n\t/** Get Month\t */\n\tpublic String getJP_Month();\n\n /** Column name JP_OrgTrx_Value */\n public static final String COLUMNNAME_JP_OrgTrx_Value = \"JP_OrgTrx_Value\";\n\n\t/** Set Trx Organization(Search Key)\t */\n\tpublic void setJP_OrgTrx_Value (String JP_OrgTrx_Value);\n\n\t/** Get Trx Organization(Search Key)\t */\n\tpublic String getJP_OrgTrx_Value();\n\n /** Column name JP_Org_Value */\n public static final String COLUMNNAME_JP_Org_Value = \"JP_Org_Value\";\n\n\t/** Set Organization(Search Key)\t */\n\tpublic void setJP_Org_Value (String JP_Org_Value);\n\n\t/** Get Organization(Search Key)\t */\n\tpublic String getJP_Org_Value();\n\n /** Column name JP_RequesterName */\n public static final String COLUMNNAME_JP_RequesterName = \"JP_RequesterName\";\n\n\t/** Set Requester Name\t */\n\tpublic void setJP_RequesterName (String JP_RequesterName);\n\n\t/** Get Requester Name\t */\n\tpublic String getJP_RequesterName();\n\n /** Column name JP_SalesRep_EMail */\n public static final String COLUMNNAME_JP_SalesRep_EMail = \"JP_SalesRep_EMail\";\n\n\t/** Set Sales Rep(E-Mail)\t */\n\tpublic void setJP_SalesRep_EMail (String JP_SalesRep_EMail);\n\n\t/** Get Sales Rep(E-Mail)\t */\n\tpublic String getJP_SalesRep_EMail();\n\n /** Column name JP_SalesRep_Name */\n public static final String COLUMNNAME_JP_SalesRep_Name = \"JP_SalesRep_Name\";\n\n\t/** Set Sales Rep(Name)\t */\n\tpublic void setJP_SalesRep_Name (String JP_SalesRep_Name);\n\n\t/** Get Sales Rep(Name)\t */\n\tpublic String getJP_SalesRep_Name();\n\n /** Column name JP_SalesRep_Value */\n public static final String COLUMNNAME_JP_SalesRep_Value = \"JP_SalesRep_Value\";\n\n\t/** Set Sales Rep(Search Key)\t */\n\tpublic void setJP_SalesRep_Value (String JP_SalesRep_Value);\n\n\t/** Get Sales Rep(Search Key)\t */\n\tpublic String getJP_SalesRep_Value();\n\n /** Column name Processed */\n public static final String COLUMNNAME_Processed = \"Processed\";\n\n\t/** Set Processed.\n\t * The document has been processed\n\t */\n\tpublic void setProcessed (boolean Processed);\n\n\t/** Get Processed.\n\t * The document has been processed\n\t */\n\tpublic boolean isProcessed();\n\n /** Column name Processing */\n public static final String COLUMNNAME_Processing = \"Processing\";\n\n\t/** Set Process Now\t */\n\tpublic void setProcessing (boolean Processing);\n\n\t/** Get Process Now\t */\n\tpublic boolean isProcessing();\n\n /** Column name RoutingNo */\n public static final String COLUMNNAME_RoutingNo = \"RoutingNo\";\n\n\t/** Set Routing No.\n\t * Bank Routing Number\n\t */\n\tpublic void setRoutingNo (String RoutingNo);\n\n\t/** Get Routing No.\n\t * Bank Routing Number\n\t */\n\tpublic String getRoutingNo();\n\n /** Column name SalesRep_ID */\n public static final String COLUMNNAME_SalesRep_ID = \"SalesRep_ID\";\n\n\t/** Set Sales Rep.\n\t * Sales Representative or Company Agent\n\t */\n\tpublic void setSalesRep_ID (int SalesRep_ID);\n\n\t/** Get Sales Rep.\n\t * Sales Representative or Company Agent\n\t */\n\tpublic int getSalesRep_ID();\n\n\tpublic org.compiere.model.I_AD_User getSalesRep() throws RuntimeException;\n\n /** Column name StatementDate */\n public static final String COLUMNNAME_StatementDate = \"StatementDate\";\n\n\t/** Set Statement date.\n\t * Date of the statement\n\t */\n\tpublic void setStatementDate (Timestamp StatementDate);\n\n\t/** Get Statement date.\n\t * Date of the statement\n\t */\n\tpublic Timestamp getStatementDate();\n\n /** Column name StmtAmt */\n public static final String COLUMNNAME_StmtAmt = \"StmtAmt\";\n\n\t/** Set Statement amount.\n\t * Statement Amount\n\t */\n\tpublic void setStmtAmt (BigDecimal StmtAmt);\n\n\t/** Get Statement amount.\n\t * Statement Amount\n\t */\n\tpublic BigDecimal getStmtAmt();\n\n /** Column name TrxAmt */\n public static final String COLUMNNAME_TrxAmt = \"TrxAmt\";\n\n\t/** Set Transaction Amount.\n\t * Amount of a transaction\n\t */\n\tpublic void setTrxAmt (BigDecimal TrxAmt);\n\n\t/** Get Transaction Amount.\n\t * Amount of a transaction\n\t */\n\tpublic BigDecimal getTrxAmt();\n\n /** Column name Updated */\n public static final String COLUMNNAME_Updated = \"Updated\";\n\n\t/** Get Updated.\n\t * Date this record was updated\n\t */\n\tpublic Timestamp getUpdated();\n\n /** Column name UpdatedBy */\n public static final String COLUMNNAME_UpdatedBy = \"UpdatedBy\";\n\n\t/** Get Updated By.\n\t * User who updated this records\n\t */\n\tpublic int getUpdatedBy();\n}", "Map<String, Object> getAllMetadata();", "public static JasperReportBuilder generateReport(ExportData metaData,HttpServletRequest request){\n session = request.getSession(false);\n report = report(); // Creer le rapport\n \n //Logo\n// logoImg = cmp.image(inImg).setStyle(DynamicReports.stl.style().setHorizontalAlignment(HorizontalAlignment.LEFT)); \n //logoImg.setDimension(80,80); \n \n //Definit le style des colonnes d'entàte\n report.setColumnTitleStyle(getHeaderStyle(metaData));\n \n \n \n LinkedHashMap <String,String> criteria = metaData.getCriteria(); \n //Ajout la date d'àdition au critere d'impression\n String valDateProperty = getDateTxt(metaData.getLang()) ;\n String keyDateProperty = \"\" ;\n if ( session.getAttribute(\"activedLocale\").equals(\"fr\") ) {\n keyDateProperty = \"Edité le \" ;\n }\n else {\n keyDateProperty = \"Printed on \" ;\n }\n criteria.put(keyDateProperty,valDateProperty);\n \n StyleBuilder titleStyle = stl.style(boldStyle).setFontSize(16).setForegroundColor(new Color(0, 0, 0)).setHorizontalAlignment(HorizontalAlignment.RIGHT).setRightIndent(20);\n ComponentBuilder<?, ?> logoComponent = cmp.horizontalList(\n //cmp.image(Templates.class.getResource(\"/logopalm.png\")).setFixedDimension(150, 50).setStyle(stl.style().setLeftIndent(20)),\n cmp.verticalList(\n cmp.text(metaData.getTitle()).setStyle(titleStyle)\n )\n ).newRow()\n .add(cmp.horizontalList().add(cmp.hListCell(createCriteriaComponent(criteria,metaData)).heightFixedOnTop()))\n .newRow(); \n \n report.noData(logoComponent, cmp.text(\"Aucun enregistrement trouvà\").setStyle(stl.style().setHorizontalAlignment(HorizontalAlignment.CENTER).setTopPadding(30)));\n\n \n \n lblStyle = stl.style(Templates.columnStyle).setForegroundColor(new Color(60, 91, 31)); // Couleur du text \n colStyle = stl.style(Templates.columnStyle).setHorizontalAlignment(HorizontalAlignment.CENTER);\n \n groupStyle = stl.style().setForegroundColor(new Color(60, 91, 31)) \n .setBold(Boolean.TRUE)\n .setPadding(5)\n .setFontSize(13)\n .setHorizontalAlignment(HorizontalAlignment.CENTER); \n \n\n \n if(metaData.getTitle().equals(ITitle.PARCEL)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PARCEL_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SECTOR)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SECTOR_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BLOCK)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BLOCK_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ATTACK_PHYTO)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TREATMENT)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TREATMENT_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVEST)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVEST_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SERVICING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SERVICING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_PLANTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_PLANTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.FERTILIZATION)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.FERTILIZATION_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.CONTROL_PHYTO)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.CONTROL_PHYTO_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_FOLDING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_FOLDING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.MORTALITY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.MORTALITY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVESTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVESTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BUDGET)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.REPLACEMENT)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.REPLACEMENT_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.METEOROLOGY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.METEOROLOGY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_MATERIAL)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_MATERIAL_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLUVIOMETRY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLUVIOMETRY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ETP)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ETP_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HYGROMETRY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HYGROMETRY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TEMPERATURE)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TEMPERATURE_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.INSULATION)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.INSULATION_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.WORK)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.WORK_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }\n \n \n drColumns = new HashMap<String, TextColumnBuilder>(); \n groups = new ArrayList<String>();\n subtotals = new ArrayList<String>();\n \n //Definit la liste des colonnes du rapport\n ExportGenerator.getColumns(metaData); \n //Definit la liste des sous-totaux du rapport\n ExportGenerator.getSubTotals(metaData);\n \n \n //Genration des sous totaux\n for (String group : groups) {\n ColumnGroupBuilder group2 = grp.group(drColumns.get(group));\n report.groupBy(group2);\n for (String subtotal : subtotals) {\n report.subtotalsAtGroupFooter(group2,sbt.sum(drColumns.get(subtotal)));\n }\n }\n\n for (String subtotal : subtotals) {\n report.subtotalsAtSummary(sbt.sum(drColumns.get(subtotal))); \n }\n \n /*if(ExportGenerator.getColumnByNameField(\"plantingName\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL \"), ExportGenerator.getColumnByNameField(\"plantingName\"), Calculation.NOTHING));\n }*//*else if(ExportGenerator.getColumnByNameField(\"invoiceCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"invoiceCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"planterCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL\"), ExportGenerator.getColumnByNameField(\"planterCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"transportTicket\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"transportTicket\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"deliveryDate\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"deliveryDate\"), Calculation.NOTHING));\n }\n else if(ExportGenerator.getColumnByNameField(\"arroundPlantingTicketNumber\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"arroundPlantingTicketNumber\"), Calculation.NOTHING));\n }\n else if(ExportGenerator.getColumnByNameField(\"planterNumber\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"planterNumber\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"startPaymentDate\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"startPaymentDate\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"sectorCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"sectorCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"month\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL \"), ExportGenerator.getColumnByNameField(\"month\"), Calculation.NOTHING));\n }*/\n \n\n \n \n //Genere la source de donnàes du rapport\n report.setDataSource(metaData.getData());\n \n report.highlightDetailEvenRows(); \n \n \n // Definition de l'entete : valable uniquement pour la 1ere page\n HorizontalListBuilder hlb= null;\n \n hlb = cmp.horizontalList().add(\n cmp.hListCell(createCriteriaComponent(criteria,metaData)).heightFixedOnTop()\n );\n\n \n report.title(\n createCustomTitleComponent(metaData.getTitle()), // Titre\n hlb,// Liste Horizontal des Critàres \n cmp.verticalGap(12) // Marge de 12 px entre chaque critàre\n ); \n \n \n \n report.setPageMargin(DynamicReports.margin().setLeft(15).setTop(30).setRight(15).setBottom(30));\n report.setPageFormat(PageType.A3, PageOrientation.LANDSCAPE);\n report.pageFooter(DynamicReports.cmp.pageXslashY());\n return report;\n \n }", "public interface IReportDao extends IBaseDao<Report, Integer> {\n\t\n\t/**\n\t * 添加举报信息\n\t * @param report\n\t */\n\tpublic boolean addReport(Report report);\n\t\n\t/**\n\t * 修改举报信息\n\t * @param report\n\t * @return\n\t */\n\tpublic boolean updateReport(Report report);\n\t\n//\t/**\n//\t * 是否已经举报\n//\t * @param getReportGto\n//\t * @return\n//\t */\n//\tpublic boolean isHouseInfoReported(GetReportGto getReportGto);\n\t\n\t/**\n\t * 获取我与某条房源的举报信息\n\t * @param getReportGto\n\t * @return\n\t */\n\tpublic List<Report> getMyReport(GetReportGto getReportGto);\n}", "public interface TableDetailMapper {\n\n @Select(\"select * from dxh_sys.tabledetail where vendorId=0 and tableName='skuProfitDayReport'\")\n List<Map<String, Object>> list();\n\n}", "public Report getReport();", "BoltResultSetMetaData(List<Type> types, List<String> keys) {\n\t\tsuper(keys);\n\t\tthis.columnType = types.toArray(new Type[this.keys.size() + 1]);\n\n\t\t// we init columnType with the first record\n\t\t// in case first == last record\n\t\t/*for (int i = 1; i <= this.keys.size(); i++) {\n\t\t\tcolumnType[i] = this.getColumnDriverTypeOrDefault(i, InternalTypeSystem.TYPE_SYSTEM.STRING());\n\t\t}*/\n\t}", "@Override\r\n\tpublic Map<String, Object> getMetadata() {\n\t\treturn null;\r\n\t}", "@Select({\n \"select\",\n \"JNLNO, TRANDATE, ACCOUNTDATE, CHECKTYPE, STATUS, DONETIME, FILENAME\",\n \"from B_UMB_CHECKING_LOG\",\n \"where JNLNO = #{jnlno,jdbcType=VARCHAR}\"\n })\n @Results({\n @Result(column=\"JNLNO\", property=\"jnlno\", jdbcType=JdbcType.VARCHAR, id=true),\n @Result(column=\"TRANDATE\", property=\"trandate\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"ACCOUNTDATE\", property=\"accountdate\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"CHECKTYPE\", property=\"checktype\", jdbcType=JdbcType.CHAR),\n @Result(column=\"STATUS\", property=\"status\", jdbcType=JdbcType.CHAR),\n @Result(column=\"DONETIME\", property=\"donetime\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"FILENAME\", property=\"filename\", jdbcType=JdbcType.VARCHAR)\n })\n BUMBCheckingLog selectByPrimaryKey(BUMBCheckingLogKey key);", "@SqlQuery(\"select * from PLAYERSTATS\")\n List<PlayerStats> getAll();", "protected String getMetadataName() {\r\n\t\treturn METADATA_NAME;\r\n\t}", "public abstract String getSummaryForDatabase();", "private interface ReportColumnCallback\n {\n void handleReportColumn(DashboardReport report, String columnName) throws MojoExecutionException;\n }", "public ReportMetadataExample() {\n\t\toredCriteria = new ArrayList<Criteria>();\n\t}", "@Override\r\n \tpublic MetaData getMetaData(HttpHeaders headers) {\n \t\ttry {\r\n \t\t\treturn MetaDataUtil.getMetaData(new ViewListeEleve(), new HashMap<String, MetaData>(),new ArrayList<String>());\r\n \t\t} catch (Exception e) {\r\n \t\t\t// TODO Auto-generated catch block\r\n \t\t\tthrow new WebApplicationException(Response.serverError().entity(new String(\"MetaData parse error\")).build());\r\n \t\t} \r\n \t}", "public DefaultMetaData getMetaData() {\n\t\treturn this.metaData;\n\t}", "Report createReport();", "@Override\n public Map<String, String> createFieldToPropertyMapping() {\n final Map<String, String> mapping = super.createFieldToPropertyMapping();\n mapping.put(this.tableName + \".rsres_id\", \"id\");\n mapping.put(this.tableName + \".resource_id\", \"resourceId\");\n mapping.put(this.tableName + \".quantity\", QUANTITY);\n mapping.put(this.tableName + \".cost_rsres\", \"cost\");\n\n return mapping;\n }", "public String getReportsToBeGenerated(String reportType) {\r\n\t\tString query = \"\";\r\n\t\t\r\n\t\ttry (Connection connection = DatabaseConnection.getMySQLConnection();\r\n\t\t\t PreparedStatement stmt = connection.prepareStatement(query);) {\r\n\t\t\tResultSet result = stmt.executeQuery();\r\n\t\t\tStringJoiner reports = new StringJoiner(\",,\");\r\n\t\t\twhile (result.next()) {\r\n\t\t\t\treports.add(result.getString(\"REPORT_NAME\"));\r\n\t\t\t}\r\n\t\t\treturn reports.toString();\r\n\t\t} catch (SQLException e) {\r\n\t\t\tthrow new ReportGenerationException(\"An error occurred while retrieving reports to be generated.\", e);\r\n\t\t}\r\n\t}", "public String getMetaDataFileName() {\n return null;\n }", "public JDBCRawSqlQueryMetaData(Method method) {\n this.method = method;\n }", "public Map getMetadata() {\n return metadata;\n }", "public DatabaseMetaData(Statement s) {\n\t\t_stmt = s; // SQL-Connection\n\t\t_buffer = new StringBuffer(); // Output goes here\n\t\t_tables = new ArrayList<String>(); // List of tables\n\t\t\n\t\ttry {\n\t\t\t// Put table names in `_tables`\n\t\t\textractTableNames(_stmt.executeQuery(composeTableNamesQuery()));\n\n\t\t\t// fetch the string representation of each tables meta-data\n\t\t\tfor (String name : _tables)\n\t\t\t\t_buffer.append(new TableMeta(name)); \n\t\t} catch (SQLException e) { _error = true;}\n\t}", "private Builder() {\n super(net.explorys.samhat.z12.r837.X837Ins_2320_MOA_MedicareOutpatientAdjudicationInformation.SCHEMA$);\n }", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "public String toString() {\n return \"[JDBCRawSqlQueryMetaData : method=\" + method + \"]\";\n }", "Report selectByPrimaryKey(Integer id);", "java.lang.String getMetadata(int index);", "java.lang.String getMetadata(int index);", "public Integer getReportId() {\n return reportId;\n }", "@Schema(description = \"`status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Code general-info: The type of external report available \")\n public String getAssessmentInstanceReportType() {\n return assessmentInstanceReportType;\n }", "@Override\r\n\tpublic List<ReportAndSummary> findAll() {\n\t\tList<ReportAndSummary> result = reportAndSummaryDao.findAll();\r\n\t\treturn result;\r\n\t}", "private static Map<String, ColumnMetaData> buildColumnMetadataMap(ResultSet rs) {\n\t\t/*\n\t\t * LinkedHashmap to preserve key traversal order.\n\t\t * Important as we output rows as arrays of values where the index position in\n\t\t * the row implicitly corresponds to the entry order of the column map.\n\t\t * Reason for this is performance. \n\t\t */\n\t\tMap<String, ColumnMetaData> columnMap = Maps.newLinkedHashMap();\n\t\ttry {\n\t\t\tResultSetMetaData rmd = rs.getMetaData();\n\t\t\tfor (int i=1; i<= rmd.getColumnCount(); i++) {\n\t\t\t\tColumnMetaData cmd = \n\t\t\t\t\tnew ColumnMetaData(rmd.getColumnName(i), rmd.getColumnTypeName(i));\n\t\t\t\tcolumnMap.put(cmd.columnName, cmd);\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\tThrowables.propagate(e);\n\t\t}\n\t\treturn columnMap;\n\t}", "protected String getSqlTable() {\n\t\treturn \"Project\";\n\t}", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "public interface I_IHC_JobDataChange \n{\n\n /** TableName=IHC_JobDataChange */\n public static final String Table_Name = \"IHC_JobDataChange\";\n\n /** AD_Table_ID=1100135 */\n public static final int Table_ID = MTable.getTable_ID(Table_Name);\n\n KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);\n\n /** AccessLevel = 3 - Client - Org \n */\n BigDecimal accessLevel = BigDecimal.valueOf(3);\n\n /** Load Meta Data */\n\n /** Column name AD_Client_ID */\n public static final String COLUMNNAME_AD_Client_ID = \"AD_Client_ID\";\n\n\t/** Get Client.\n\t * Client/Tenant for this installation.\n\t */\n\tpublic int getAD_Client_ID();\n\n /** Column name AD_Org_ID */\n public static final String COLUMNNAME_AD_Org_ID = \"AD_Org_ID\";\n\n\t/** Set Organization.\n\t * Organizational entity within client\n\t */\n\tpublic void setAD_Org_ID (int AD_Org_ID);\n\n\t/** Get Organization.\n\t * Organizational entity within client\n\t */\n\tpublic int getAD_Org_ID();\n\n /** Column name BPJSRegistrationDate */\n public static final String COLUMNNAME_BPJSRegistrationDate = \"BPJSRegistrationDate\";\n\n\t/** Set BPJS Registration Date\t */\n\tpublic void setBPJSRegistrationDate (Timestamp BPJSRegistrationDate);\n\n\t/** Get BPJS Registration Date\t */\n\tpublic Timestamp getBPJSRegistrationDate();\n\n /** Column name Created */\n public static final String COLUMNNAME_Created = \"Created\";\n\n\t/** Get Created.\n\t * Date this record was created\n\t */\n\tpublic Timestamp getCreated();\n\n /** Column name CreatedBy */\n public static final String COLUMNNAME_CreatedBy = \"CreatedBy\";\n\n\t/** Get Created By.\n\t * User who created this records\n\t */\n\tpublic int getCreatedBy();\n\n /** Column name Description */\n public static final String COLUMNNAME_Description = \"Description\";\n\n\t/** Set Description.\n\t * Optional short description of the record\n\t */\n\tpublic void setDescription (String Description);\n\n\t/** Get Description.\n\t * Optional short description of the record\n\t */\n\tpublic String getDescription();\n\n /** Column name DescriptionNew */\n public static final String COLUMNNAME_DescriptionNew = \"DescriptionNew\";\n\n\t/** Set Description New\t */\n\tpublic void setDescriptionNew (String DescriptionNew);\n\n\t/** Get Description New\t */\n\tpublic String getDescriptionNew();\n\n /** Column name HC_Compensation1 */\n public static final String COLUMNNAME_HC_Compensation1 = \"HC_Compensation1\";\n\n\t/** Set Compensation 1\t */\n\tpublic void setHC_Compensation1 (BigDecimal HC_Compensation1);\n\n\t/** Get Compensation 1\t */\n\tpublic BigDecimal getHC_Compensation1();\n\n /** Column name HC_Compensation2 */\n public static final String COLUMNNAME_HC_Compensation2 = \"HC_Compensation2\";\n\n\t/** Set Compensation 2\t */\n\tpublic void setHC_Compensation2 (BigDecimal HC_Compensation2);\n\n\t/** Get Compensation 2\t */\n\tpublic BigDecimal getHC_Compensation2();\n\n /** Column name HC_Compensation3 */\n public static final String COLUMNNAME_HC_Compensation3 = \"HC_Compensation3\";\n\n\t/** Set Compensation 3\t */\n\tpublic void setHC_Compensation3 (BigDecimal HC_Compensation3);\n\n\t/** Get Compensation 3\t */\n\tpublic BigDecimal getHC_Compensation3();\n\n /** Column name HC_Compensation4 */\n public static final String COLUMNNAME_HC_Compensation4 = \"HC_Compensation4\";\n\n\t/** Set Compensation 4\t */\n\tpublic void setHC_Compensation4 (BigDecimal HC_Compensation4);\n\n\t/** Get Compensation 4\t */\n\tpublic BigDecimal getHC_Compensation4();\n\n /** Column name HC_EffectiveSeq */\n public static final String COLUMNNAME_HC_EffectiveSeq = \"HC_EffectiveSeq\";\n\n\t/** Set Effective Sequence\t */\n\tpublic void setHC_EffectiveSeq (int HC_EffectiveSeq);\n\n\t/** Get Effective Sequence\t */\n\tpublic int getHC_EffectiveSeq();\n\n /** Column name HC_Employee_ID */\n public static final String COLUMNNAME_HC_Employee_ID = \"HC_Employee_ID\";\n\n\t/** Set Employee Data\t */\n\tpublic void setHC_Employee_ID (int HC_Employee_ID);\n\n\t/** Get Employee Data\t */\n\tpublic int getHC_Employee_ID();\n\n\tpublic I_HC_Employee getHC_Employee() throws RuntimeException;\n\n /** Column name HC_EmployeeGrade_ID */\n public static final String COLUMNNAME_HC_EmployeeGrade_ID = \"HC_EmployeeGrade_ID\";\n\n\t/** Set Employee Grade\t */\n\tpublic void setHC_EmployeeGrade_ID (int HC_EmployeeGrade_ID);\n\n\t/** Get Employee Grade\t */\n\tpublic int getHC_EmployeeGrade_ID();\n\n\tpublic I_HC_EmployeeGrade getHC_EmployeeGrade() throws RuntimeException;\n\n /** Column name HC_EmployeeGrade2_ID */\n public static final String COLUMNNAME_HC_EmployeeGrade2_ID = \"HC_EmployeeGrade2_ID\";\n\n\t/** Set Employee Grade To\t */\n\tpublic void setHC_EmployeeGrade2_ID (int HC_EmployeeGrade2_ID);\n\n\t/** Get Employee Grade To\t */\n\tpublic int getHC_EmployeeGrade2_ID();\n\n\tpublic I_HC_EmployeeGrade getHC_EmployeeGrade2() throws RuntimeException;\n\n /** Column name HC_EmployeeJob_ID */\n public static final String COLUMNNAME_HC_EmployeeJob_ID = \"HC_EmployeeJob_ID\";\n\n\t/** Set Employee Job Data\t */\n\tpublic void setHC_EmployeeJob_ID (int HC_EmployeeJob_ID);\n\n\t/** Get Employee Job Data\t */\n\tpublic int getHC_EmployeeJob_ID();\n\n\tpublic I_HC_EmployeeJob getHC_EmployeeJob() throws RuntimeException;\n\n /** Column name HC_Job_ID */\n public static final String COLUMNNAME_HC_Job_ID = \"HC_Job_ID\";\n\n\t/** Set Job\t */\n\tpublic void setHC_Job_ID (int HC_Job_ID);\n\n\t/** Get Job\t */\n\tpublic int getHC_Job_ID();\n\n\tpublic I_HC_Job getHC_Job() throws RuntimeException;\n\n /** Column name HC_JobAction */\n public static final String COLUMNNAME_HC_JobAction = \"HC_JobAction\";\n\n\t/** Set Job Action\t */\n\tpublic void setHC_JobAction (String HC_JobAction);\n\n\t/** Get Job Action\t */\n\tpublic String getHC_JobAction();\n\n /** Column name HC_JobDataChange_ID */\n public static final String COLUMNNAME_HC_JobDataChange_ID = \"HC_JobDataChange_ID\";\n\n\t/** Set Job Data Change\t */\n\tpublic void setHC_JobDataChange_ID (int HC_JobDataChange_ID);\n\n\t/** Get Job Data Change\t */\n\tpublic int getHC_JobDataChange_ID();\n\n\tpublic I_HC_JobDataChange getHC_JobDataChange() throws RuntimeException;\n\n /** Column name HC_Manager_ID */\n public static final String COLUMNNAME_HC_Manager_ID = \"HC_Manager_ID\";\n\n\t/** Set Manager Name\t */\n\tpublic void setHC_Manager_ID (int HC_Manager_ID);\n\n\t/** Get Manager Name\t */\n\tpublic int getHC_Manager_ID();\n\n\tpublic I_HC_Employee getHC_Manager() throws RuntimeException;\n\n /** Column name HC_ManagerTo_ID */\n public static final String COLUMNNAME_HC_ManagerTo_ID = \"HC_ManagerTo_ID\";\n\n\t/** Set Manager To ID\t */\n\tpublic void setHC_ManagerTo_ID (int HC_ManagerTo_ID);\n\n\t/** Get Manager To ID\t */\n\tpublic int getHC_ManagerTo_ID();\n\n\tpublic I_HC_Employee getHC_ManagerTo() throws RuntimeException;\n\n /** Column name HC_Org_ID */\n public static final String COLUMNNAME_HC_Org_ID = \"HC_Org_ID\";\n\n\t/** Set HC Organization\t */\n\tpublic void setHC_Org_ID (int HC_Org_ID);\n\n\t/** Get HC Organization\t */\n\tpublic int getHC_Org_ID();\n\n\tpublic I_HC_Org getHC_Org() throws RuntimeException;\n\n /** Column name HC_Org2_ID */\n public static final String COLUMNNAME_HC_Org2_ID = \"HC_Org2_ID\";\n\n\t/** Set HC Organization To\t */\n\tpublic void setHC_Org2_ID (int HC_Org2_ID);\n\n\t/** Get HC Organization To\t */\n\tpublic int getHC_Org2_ID();\n\n\tpublic I_HC_Org getHC_Org2() throws RuntimeException;\n\n /** Column name HC_PayGroup_ID */\n public static final String COLUMNNAME_HC_PayGroup_ID = \"HC_PayGroup_ID\";\n\n\t/** Set Payroll Group\t */\n\tpublic void setHC_PayGroup_ID (int HC_PayGroup_ID);\n\n\t/** Get Payroll Group\t */\n\tpublic int getHC_PayGroup_ID();\n\n\tpublic I_HC_PayGroup getHC_PayGroup() throws RuntimeException;\n\n /** Column name HC_PreviousJob_ID */\n public static final String COLUMNNAME_HC_PreviousJob_ID = \"HC_PreviousJob_ID\";\n\n\t/** Set Job Sekarang\t */\n\tpublic void setHC_PreviousJob_ID (int HC_PreviousJob_ID);\n\n\t/** Get Job Sekarang\t */\n\tpublic int getHC_PreviousJob_ID();\n\n\tpublic I_HC_Job getHC_PreviousJob() throws RuntimeException;\n\n /** Column name HC_Reason_ID */\n public static final String COLUMNNAME_HC_Reason_ID = \"HC_Reason_ID\";\n\n\t/** Set HC Reason\t */\n\tpublic void setHC_Reason_ID (int HC_Reason_ID);\n\n\t/** Get HC Reason\t */\n\tpublic int getHC_Reason_ID();\n\n\tpublic I_HC_Reason getHC_Reason() throws RuntimeException;\n\n /** Column name HC_Status */\n public static final String COLUMNNAME_HC_Status = \"HC_Status\";\n\n\t/** Set HC Status\t */\n\tpublic void setHC_Status (String HC_Status);\n\n\t/** Get HC Status\t */\n\tpublic String getHC_Status();\n\n /** Column name HC_WorkEndDate */\n public static final String COLUMNNAME_HC_WorkEndDate = \"HC_WorkEndDate\";\n\n\t/** Set Work End Date\t */\n\tpublic void setHC_WorkEndDate (Timestamp HC_WorkEndDate);\n\n\t/** Get Work End Date\t */\n\tpublic Timestamp getHC_WorkEndDate();\n\n /** Column name HC_WorkPeriodDate */\n public static final String COLUMNNAME_HC_WorkPeriodDate = \"HC_WorkPeriodDate\";\n\n\t/** Set WorkPeriodDate\t */\n\tpublic void setHC_WorkPeriodDate (String HC_WorkPeriodDate);\n\n\t/** Get WorkPeriodDate\t */\n\tpublic String getHC_WorkPeriodDate();\n\n /** Column name HC_WorkStartDate */\n public static final String COLUMNNAME_HC_WorkStartDate = \"HC_WorkStartDate\";\n\n\t/** Set WorkStartDate\t */\n\tpublic void setHC_WorkStartDate (Timestamp HC_WorkStartDate);\n\n\t/** Get WorkStartDate\t */\n\tpublic Timestamp getHC_WorkStartDate();\n\n /** Column name HC_WorkStartDate2 */\n public static final String COLUMNNAME_HC_WorkStartDate2 = \"HC_WorkStartDate2\";\n\n\t/** Set Work Start Date Baru\t */\n\tpublic void setHC_WorkStartDate2 (Timestamp HC_WorkStartDate2);\n\n\t/** Get Work Start Date Baru\t */\n\tpublic Timestamp getHC_WorkStartDate2();\n\n /** Column name IHC_JobDataChange_ID */\n public static final String COLUMNNAME_IHC_JobDataChange_ID = \"IHC_JobDataChange_ID\";\n\n\t/** Set IHC_JobDayaChange\t */\n\tpublic void setIHC_JobDataChange_ID (int IHC_JobDataChange_ID);\n\n\t/** Get IHC_JobDayaChange\t */\n\tpublic int getIHC_JobDataChange_ID();\n\n /** Column name IHC_JobDataChange_UU */\n public static final String COLUMNNAME_IHC_JobDataChange_UU = \"IHC_JobDataChange_UU\";\n\n\t/** Set IHC_JobDataChange_UU\t */\n\tpublic void setIHC_JobDataChange_UU (String IHC_JobDataChange_UU);\n\n\t/** Get IHC_JobDataChange_UU\t */\n\tpublic String getIHC_JobDataChange_UU();\n\n /** Column name IsActive */\n public static final String COLUMNNAME_IsActive = \"IsActive\";\n\n\t/** Set Active.\n\t * The record is active in the system\n\t */\n\tpublic void setIsActive (boolean IsActive);\n\n\t/** Get Active.\n\t * The record is active in the system\n\t */\n\tpublic boolean isActive();\n\n /** Column name IsCancelled */\n public static final String COLUMNNAME_IsCancelled = \"IsCancelled\";\n\n\t/** Set Cancelled.\n\t * The transaction was cancelled\n\t */\n\tpublic void setIsCancelled (boolean IsCancelled);\n\n\t/** Get Cancelled.\n\t * The transaction was cancelled\n\t */\n\tpublic boolean isCancelled();\n\n /** Column name NomorSK */\n public static final String COLUMNNAME_NomorSK = \"NomorSK\";\n\n\t/** Set Nomor SK\t */\n\tpublic void setNomorSK (String NomorSK);\n\n\t/** Get Nomor SK\t */\n\tpublic String getNomorSK();\n\n /** Column name NomorSK2 */\n public static final String COLUMNNAME_NomorSK2 = \"NomorSK2\";\n\n\t/** Set Nomor SK Baru\t */\n\tpublic void setNomorSK2 (String NomorSK2);\n\n\t/** Get Nomor SK Baru\t */\n\tpublic String getNomorSK2();\n\n /** Column name OriginalServiceData */\n public static final String COLUMNNAME_OriginalServiceData = \"OriginalServiceData\";\n\n\t/** Set Original Service Date\t */\n\tpublic void setOriginalServiceData (Timestamp OriginalServiceData);\n\n\t/** Get Original Service Date\t */\n\tpublic Timestamp getOriginalServiceData();\n\n /** Column name Processed */\n public static final String COLUMNNAME_Processed = \"Processed\";\n\n\t/** Set Processed.\n\t * The document has been processed\n\t */\n\tpublic void setProcessed (boolean Processed);\n\n\t/** Get Processed.\n\t * The document has been processed\n\t */\n\tpublic boolean isProcessed();\n\n /** Column name SeqNo */\n public static final String COLUMNNAME_SeqNo = \"SeqNo\";\n\n\t/** Set Sequence.\n\t * Method of ordering records;\n lowest number comes first\n\t */\n\tpublic void setSeqNo (int SeqNo);\n\n\t/** Get Sequence.\n\t * Method of ordering records;\n lowest number comes first\n\t */\n\tpublic int getSeqNo();\n\n /** Column name Updated */\n public static final String COLUMNNAME_Updated = \"Updated\";\n\n\t/** Get Updated.\n\t * Date this record was updated\n\t */\n\tpublic Timestamp getUpdated();\n\n /** Column name UpdatedBy */\n public static final String COLUMNNAME_UpdatedBy = \"UpdatedBy\";\n\n\t/** Get Updated By.\n\t * User who updated this records\n\t */\n\tpublic int getUpdatedBy();\n}" ]
[ "0.720387", "0.60612166", "0.5897073", "0.5817371", "0.58169", "0.5653088", "0.5575094", "0.5565293", "0.5523116", "0.55214834", "0.5424825", "0.5421459", "0.5377486", "0.534678", "0.5342339", "0.53190213", "0.5239825", "0.5236659", "0.5227619", "0.513109", "0.5122094", "0.5114957", "0.5110571", "0.5092275", "0.50793064", "0.50710756", "0.50666755", "0.50432736", "0.50225407", "0.5009165", "0.5007035", "0.49747992", "0.49714422", "0.49305487", "0.4928956", "0.49114767", "0.49047396", "0.4894513", "0.488628", "0.48804012", "0.48787948", "0.4848689", "0.4836264", "0.4834436", "0.48120287", "0.4810927", "0.4800393", "0.4796319", "0.4796208", "0.47960824", "0.47906667", "0.4782785", "0.47692993", "0.47681826", "0.47613847", "0.47506967", "0.4746286", "0.47449973", "0.4743577", "0.47416592", "0.47313273", "0.47236001", "0.47218567", "0.47168458", "0.47161394", "0.47148344", "0.47092924", "0.47078082", "0.4703429", "0.46990865", "0.46964943", "0.46792674", "0.4675461", "0.4675461", "0.4675461", "0.4675461", "0.4675461", "0.46668383", "0.4666713", "0.46600732", "0.46600732", "0.4655324", "0.46417722", "0.46361163", "0.46348158", "0.46313247", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.4627627" ]
0.0
-1
This method was generated by MyBatis Generator. This method corresponds to the database table core.report_metadata
public void clear() { oredCriteria.clear(); orderByClause = null; distinct = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "TableReportMetadata getReportMetadata(String reportId);", "public abstract List<ColumnSpecification> metadata();", "@Override\r\n\t\tpublic DatabaseMetaData getMetaData() throws SQLException {\n\t\t\treturn null;\r\n\t\t}", "@Override\n\tpublic JDBCMetaData getMetaData() throws SQLException {\n\t\treturn null;\n\t}", "private void writeMetaData(ResultSet resultSet) throws SQLException {\n\t System.out.println(\"The columns in the table are: \");\r\n\t System.out.println(\"Table: \" + resultSet.getMetaData().getTableName(1));\r\n\t for (int i = 1; i<= resultSet.getMetaData().getColumnCount(); i++){\r\n\t System.out.println(\"Column \" +i + \" \"+ resultSet.getMetaData().getColumnName(i));\r\n\t }\r\n\t }", "public interface TableMetaData {\n\n\t/** Adds normal column. */\n\tpublic void addColumn(final ColumnMetaData column);\n\n\t/** Adds primary key column. */\n\tpublic void addPrimaryKey(final ColumnMetaData column);\n\n\t/** Returns map of column meta data, keyed by the column label (the alias if provided in the query, otherwise the name). */\n\tpublic Map<String, ColumnMetaData> getColumns();\n\n\t/** Returns database name. */\n\tpublic String getDatabaseName();\n\n\t/** Returns ordered list of columns that are primary keys. */\n\tpublic List<ColumnMetaData> getPrimaryKeys();\n\n\t/**\n\t * Returns fully qualified table name in database-specific form for use in SQL statements. MySQL uses the form\n\t * <code>database.table</code>, for example <code>sakila.film</code>. PostgreSQL uses the form\n\t * <code>database.schema.table</code>, for example <code>sakila.public.film</code>.\n\t */\n\tpublic String getQualifiedTableName();\n\n\t/** Returns row alias. */\n\tpublic String getRowAlias();\n\t\n\t/** Returns row set alias. */\n\tpublic String getRowSetAlias();\n\t\n\t/**\n\t * Returns row alias.\n\t * \n * @deprecated As of 0.8.11 use {@link #getRowAlias()}\n\t */\n\t@Deprecated\n\tpublic String getTableAlias();\n\n\t/** Returns table name. */\n\tpublic String getTableName();\n\n\t/** Returns role of table in the SQL Resource. */\n\tpublic TableRole getTableRole();\n\n\t/** Returns true if the SQL Resource role is child. */\n\tpublic boolean isChild();\n\n\t/** Returns true if the SQL Resource role is parent. */\n\tpublic boolean isParent();\n\n\t/** Sets all the row and row set aliases. */\n\tpublic void setAliases(final String alias, final String rowAlias, final String rowSetAlias);\n\n\t/** Sets attributes. */\n\tpublic void setAttributes(final String tableName, final String qualifedTableName,\n\t\t\tfinal String databaseName, final TableRole tableRole);\n\n\t/**\n\t * Sets table alias.\n\t * \n * @deprecated As of 0.8.11 use {@link #setAliases(String, String, String)}\n\t */\n\t@Deprecated\n\tpublic void setTableAlias(final String tableAlias);\n\t\n\t/** Represents all of the roles a table may plan in a SQL Resource. */\n\t@XmlType(namespace = \"http://restsql.org/schema\")\n\tpublic enum TableRole {\n\t\tChild, ChildExtension, Join, Parent, ParentExtension, Unknown;\n\t}\n}", "public abstract List<String> newReportColumns();", "ResultSetMetaData getMetaData() throws SQLException;", "public DBMetaDataSet getMetaData()\n\t{\n\t\treturn _MetaData;\n\t}", "public interface SqlResourceMetaData {\r\n\r\n\tpublic List<ColumnMetaData> getAllReadColumns();\r\n\r\n\tpublic TableMetaData getChild();\r\n\r\n\tpublic List<TableMetaData> getChildPlusExtTables();\r\n\r\n\tpublic List<ColumnMetaData> getChildReadColumns();\r\n\r\n\tpublic TableMetaData getJoin();\r\n\r\n\tpublic List<TableMetaData> getJoinList();\r\n\r\n\tpublic int getNumberTables();\r\n\r\n\tpublic TableMetaData getParent();\r\n\r\n\tpublic List<TableMetaData> getParentPlusExtTables();\r\n\r\n\tpublic List<ColumnMetaData> getParentReadColumns();\r\n\r\n\tpublic Map<String, TableMetaData> getTableMap();\r\n\r\n\tpublic List<TableMetaData> getTables();\r\n\r\n\tpublic List<TableMetaData> getWriteTables(final Type requestType, final boolean doParent);\r\n\r\n\tpublic boolean hasJoinTable();\r\n\r\n\tpublic boolean hasMultipleDatabases();\r\n\r\n\tpublic boolean isHierarchical();\r\n\r\n\tpublic void init(final String sqlResourceName, final SqlResourceDefinition definition, final SqlBuilder sqlBuilder)\r\n\t\t\tthrows SqlResourceException;\r\n\r\n\tpublic String toHtml();\r\n\r\n\tpublic String toXml();\r\n}", "public void addColumnPathReportId() {\n addColumnInPath(ColumnMetaData.KEY_PATH_ID);\n }", "public ResultSetMetaData getMetaData() throws SQLException {\n\n try {\n int id = getNextId(TraceObject.RESULT_SET_META_DATA);\n if (isDebugEnabled()) {\n debugCodeAssign(\"ResultSetMetaData\", TraceObject.RESULT_SET_META_DATA, id, \"getMetaData()\");\n }\n checkClosed();\n String catalog = conn.getCatalog();\n JdbcResultSetMetaData meta = new JdbcResultSetMetaData(this, null, result, catalog, conn.getSession().getTrace(), id);\n return meta;\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "public MetaData getMetaData();", "@Override\n public DatabaseMetaData getMetaData() throws SQLException\n {\n logger.debug(\n \" public DatabaseMetaData getMetaData() throws SQLException\");\n\n return new SnowflakeDatabaseMetaData(this);\n }", "public DataSetMetaData getMetaData() {\n return this.metadata;\n }", "@Test\n public void metaDataExample1() throws SQLException {\n Connection connection = DriverManager.getConnection(dbUrl, dbUsername, dbPassword);\n // 2. Create statement\n Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);\n // Run sql query and get the result in resultSet object\n String sqlQuery= \"Select * From departments\";\n //String sqlQuery= \"Select first_name, last_name, salary From employees\";\n ResultSet resultSet = statement.executeQuery(sqlQuery);\n\n // we use resultSet metadata to get information about the tables\n // get the resultSet object metadata\n ResultSetMetaData rsMetadata = resultSet.getMetaData();\n\n // List for keeping all rows as a map\n List<Map<String, Object>> queryData = new ArrayList<>();\n\n // while(resultSet.next()) helps to iterate through columns\n while (resultSet.next()) {\n // key(columns) will be string but value can be any type of data. That's why we choose <String, Object>\n Map<String, Object> row = new HashMap<>(); // creating empty Map\n // number of columns\n int colCount = rsMetadata.getColumnCount();\n // for loop helps to iterate through columns\n for (int i = 1; i <= colCount; i++) {\n row.put(rsMetadata.getColumnName(i), resultSet.getObject(i));\n }\n\n queryData.add(row); // adding a Map to the List of Maps\n }\n\n // Printing the rows\n for (Map<String, Object> row: queryData) {\n System.out.println(row.toString());\n\n }\n\n\n\n\n // close all connections\n resultSet.close();\n statement.close();\n connection.close();\n }", "@Override\n\tpublic DBMetadata getMetadata() {\n\t\treturn null;\n\t}", "public MetaData getMetaData() {\r\n \treturn metaData;\r\n }", "@Override\n public SystemMetadata mapRow(ResultSet resultSet, int rowNumber) throws SQLException {\n\n // resultSet contains guid, serialVersion, date_modified, and archived column data\n SystemMetadata systemMetadata = new SystemMetadata();\n ReplicationPolicy replPolicy = new ReplicationPolicy();\n AccessPolicy accessPolicy = new AccessPolicy();\n\n // add guid\n Identifier pid = new Identifier();\n pid.setValue(resultSet.getString(\"guid\"));\n systemMetadata.setIdentifier(pid);\n \n // add seriesId\n Identifier seriesId = new Identifier();\n seriesId.setValue(resultSet.getString(\"series_id\"));\n systemMetadata.setSeriesId(seriesId);\n\n // add serialVersion\n BigInteger serialVersion = new BigInteger(resultSet.getString(\"serial_version\"));\n systemMetadata.setSerialVersion(serialVersion);\n\n // add date_modified\n Date dateSystemMetadataLastModified = resultSet.getTimestamp(\"date_modified\");\n systemMetadata.setDateSysMetadataModified(dateSystemMetadataLastModified);\n\n // add archived value, if it was stored\n boolean archived = resultSet.getBoolean(\"archived\"); // getBoolean returns false for null results\n if (!resultSet.wasNull())\n systemMetadata.setArchived(new Boolean(archived));\n\n // add date_uploaded\n Date dateUploaded = resultSet.getTimestamp(\"date_uploaded\");\n systemMetadata.setDateUploaded(dateUploaded);\n\n // add rights_holder\n Subject rightsHolderSubject = new Subject();\n String rightsHolder = resultSet.getString(\"rights_holder\");\n rightsHolderSubject.setValue(rightsHolder);\n systemMetadata.setRightsHolder(rightsHolderSubject);\n\n // add checksum, checksum_algorithm\n String checksum = resultSet.getString(\"checksum\");\n String checksumAlgorithm = resultSet.getString(\"checksum_algorithm\");\n Checksum checksumObject = new Checksum();\n checksumObject.setValue(checksum);\n checksumObject.setAlgorithm(checksumAlgorithm);\n systemMetadata.setChecksum(checksumObject);\n\n // add origin_member_node\n String originMemberNode = resultSet.getString(\"origin_member_node\");\n if (originMemberNode != null) {\n NodeReference omn = new NodeReference();\n omn.setValue(originMemberNode);\n systemMetadata.setOriginMemberNode(omn);\n }\n\n // add authoritive_member_node\n String authoritativeMemberNode = resultSet.getString(\"authoritive_member_node\");\n if (originMemberNode != null) {\n NodeReference amn = new NodeReference();\n amn.setValue(authoritativeMemberNode);\n systemMetadata.setAuthoritativeMemberNode(amn);\n }\n\n // add submitter\n String submitter = resultSet.getString(\"submitter\");\n if (submitter != null) {\n Subject submitterSubject = new Subject();\n submitterSubject.setValue(submitter);\n systemMetadata.setSubmitter(submitterSubject);\n }\n\n // add object_format\n String fmtidStr = resultSet.getString(\"object_format\");\n ObjectFormatIdentifier fmtid = new ObjectFormatIdentifier();\n fmtid.setValue(fmtidStr);\n systemMetadata.setFormatId(fmtid);\n\n // add size\n String size = resultSet.getString(\"size\");\n systemMetadata.setSize(new BigInteger(size));\n\n // add obsoletes\n String obsoletes = resultSet.getString(\"obsoletes\");\n if (obsoletes != null) {\n Identifier obsoletesId = new Identifier();\n obsoletesId.setValue(obsoletes);\n systemMetadata.setObsoletes(obsoletesId);\n }\n // add obsoleted_by\n String obsoletedBy = resultSet.getString(\"obsoleted_by\");\n if (obsoletedBy != null) {\n Identifier obsoletedById = new Identifier();\n obsoletedById.setValue(obsoletedBy);\n systemMetadata.setObsoletedBy(obsoletedById);\n }\n\n // potentially build a ReplicationPolicy\n \n // add replication_allowed, if it was persisted\n boolean replAllowed = resultSet.getBoolean(\"replication_allowed\"); // getBoolean returns false for null results\n \n if (!resultSet.wasNull()) {\n // populate and add ReplicationPolicy\n ReplicationPolicy replicationPolicy = new ReplicationPolicy();\n \n replicationPolicy.setReplicationAllowed(new Boolean(replAllowed));\n\n // add number_replicas\n int numberOfReplicas = resultSet.getInt(\"number_replicas\"); // getInt returns 0 for null values\n if (numberOfReplicas > 0) {\n replicationPolicy.setNumberReplicas(new Integer(numberOfReplicas));\n\n }\n\n // add preferred and blocked lists\n List<ReplicationPolicyEntry> replPolicies = new ArrayList<ReplicationPolicyEntry>();\n List<NodeReference> preferredNodes = new ArrayList<NodeReference>();\n List<NodeReference> blockedNodes = new ArrayList<NodeReference>();\n\n replPolicies = listReplicationPolicies(pid, localTableMap);\n\n for (ReplicationPolicyEntry policy : replPolicies) {\n Identifier id = policy.getPid();\n String entryPolicy = policy.getPolicy();\n NodeReference node = policy.getMemberNode();\n\n if (entryPolicy.equals(\"preferred\")) {\n preferredNodes.add(node);\n\n } else if (entryPolicy.equals(\"blocked\")) {\n blockedNodes.add(node);\n\n }\n }\n\n replicationPolicy.setPreferredMemberNodeList(preferredNodes);\n replicationPolicy.setBlockedMemberNodeList(blockedNodes);\n\n systemMetadata.setReplicationPolicy(replicationPolicy);\n } else {\n systemMetadata.setReplicationPolicy(null);\n }\n\n // populate and add replicas list\n\n List<Replica> replicas = new ArrayList<Replica>();\n replicas = listReplicaEntries(pid, localTableMap);\n systemMetadata.setReplicaList(replicas);\n\n // populate and add AccessPolicy\n List<AccessRule> accessRules = new ArrayList<AccessRule>();\n accessRules = listAccessRules(pid, localTableMap);\n accessPolicy.setAllowList(accessRules);\n systemMetadata.setAccessPolicy(accessPolicy);\n\n // Validate the system metadata in debug mode using TypeMarshaller\n if (log.isDebugEnabled()) {\n try {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n TypeMarshaller.marshalTypeToOutputStream(systemMetadata, baos);\n log.debug(\"SystemMetadata for pid \" + pid.getValue() + \" is: \"\n + baos.toString());\n\n } catch (MarshallingException e) {\n e.printStackTrace();\n\n } catch (IOException e) {\n e.printStackTrace();\n\n }\n }\n return systemMetadata;\n }", "public MetaData getMetaData() {\n return metaData;\n }", "public ResultSetMetaData getMetaData() throws SQLException\n {\n return m_rs.getMetaData();\n }", "public ShowTableMetadataResponse showTableMetadata(ShowTableMetadataRequest request) throws GPUdbException {\n ShowTableMetadataResponse actualResponse_ = new ShowTableMetadataResponse();\n submitRequest(\"/show/table/metadata\", request, actualResponse_, false);\n return actualResponse_;\n }", "SQLServerResultSetMetaData(SQLServerConnection con, SQLServerResultSet rs) \n {\n traceID = \" SQLServerResultSetMetaData:\" + nextInstanceID();\n this.con = con;\n this.rs =rs;\n assert rs !=null;\n if(logger.isLoggable(java.util.logging.Level.FINE))\n {\n logger.fine(toString() + \" created by (\" + rs.toString() + \")\");\n }\n }", "@Override\n public RavenJObject getMetadata() {\n return metadata;\n }", "@Override\n\tpublic List<Map<String, String>> selectReportInfo(String appId) {\n\t\treturn getSqlMap().queryForList(NAMESPACES + \"queryReportInfo\", appId);\n\t}", "void processMetaData(ResultSet rs) throws SQLException;", "public interface ColumnMetaData {\n\n\t/**\n\t * The uniqueness level of a column data type.\n\t */\n\tenum Uniqueness {\n\t\t/**\n\t\t * No limitations. Multiple instances of a single column meta data type can be attached to a table or even a\n\t\t * single column.\n\t\t */\n\t\tNONE,\n\n\t\t/**\n\t\t * Multiple instances of a single column meta data type can be attached to a table but at most one per column.\n\t\t */\n\t\tCOLUMN,\n\n\t\t/**\n\t\t * At most one instance of the column meta data type can be attached to a table.\n\t\t */\n\t\tTABLE\n\t}\n\n\t/**\n\t * The unique type id of the column meta data.\n\t *\n\t * @return the type id\n\t */\n\tString type();\n\n\t/**\n\t * The uniqueness level of the meta data. Defaults to {@link Uniqueness#NONE} (no restrictions).\n\t *\n\t * @return the uniqueness level\n\t */\n\tdefault Uniqueness uniqueness() {\n\t\treturn Uniqueness.NONE;\n\t}\n\n}", "public HashMap getMetaData() ;", "Metadata getMetaData();", "@Override\n public SystemMetadataStatus mapRow(ResultSet resultSet, int rowNumber) throws SQLException {\n\n // resultSet contains guid, serialVersion, date_modified, and archived column data\n SystemMetadataStatus systemMetadataStatus = new SystemMetadataStatus();\n\n // add guid\n Identifier pid = new Identifier();\n pid.setValue(resultSet.getString(\"guid\"));\n systemMetadataStatus.setPid(pid);\n\n // add serialVersion\n BigInteger serialVersion = new BigInteger(resultSet.getString(\"serial_version\"));\n systemMetadataStatus.setSerialVersion(serialVersion);\n\n // add date_modified\n Date dateSystemMetadataLastModified = resultSet.getTimestamp(\"date_modified\");\n systemMetadataStatus\n .setLastSystemMetadataModificationDate(dateSystemMetadataLastModified);\n\n // add archived\n boolean archived = resultSet.getBoolean(\"archived\"); // getBoolean returns false for null results\n systemMetadataStatus.setDeleted(new Boolean(archived));\n\n return systemMetadataStatus;\n }", "@Override\n public String toString() {\n return \"Report{\" +\n \"reportId=\" + reportId +\n \", reportOpId=\" + reportOp +\n \", date='\" + date + '\\'' +\n \", reportedUserId=\" + reportedUser +\n \", userId=\" + user +\n \", status=\" + status +\n '}';\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}", "CustomReport selectByPrimaryKey(BigDecimal reportId);", "public ResultSetMetaData getMetaData() throws SQLException {\n return currentPreparedStatement.getMetaData();\n }", "public ReportTable(TableView<Report> reportTable) {\n this.reportTable = reportTable;\n }", "public void analizeQueryResultMetaData(ResultSetMetaData rsMetaData, String[] decimalColumns){\n\t\tArrayList<Integer> decimalColumnResultsetIndexes = new ArrayList<Integer>();\n\t\t//if ( decimalColumns==null||decimalColumns.length==0)\n\t\t//\treturn ; \n\t\ttry {\n\t\t\t\n\t\t\t\n\t\t\t//IObjectToStringConverter[] converters = new IObjectToStringConverter[rsMetaData.getColumnCount()] ;\n\t\t\tOuputDataType[] dataTypes = new OuputDataType[rsMetaData.getColumnCount()] ;\n\t\t\tjobContext.put(ExportEngineConstant.COLUMN_CONVERTER_KEY, dataTypes);\n\t\t\tfor ( int i=1 ; i <= rsMetaData.getColumnCount(); i++){\n\t\t\t\tboolean isDecimal = false ; \n\t\t\t\tString nama = rsMetaData.getColumnName(i).toUpperCase();\n\t\t\t\tif ( decimalColumns!=null){\n\t\t\t\t\tfor ( String scn : decimalColumns){\n\t\t\t\t\t\tif ( nama.equalsIgnoreCase(scn)){\n\t\t\t\t\t\t\tdecimalColumnResultsetIndexes.add(i-1);\n\t\t\t\t\t\t\tisDecimal = true ;\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.money; \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\tif( !isDecimal){\n\t\t\t\t\tString tipeCol = rsMetaData.getColumnClassName(i) ;\n\t\t\t\t\tboolean isDate = false ; \n\t\t\t\t\tfor ( String scn : DATE_DATA_TYPES){\n\t\t\t\t\t\tif ( tipeCol.equals(scn)){\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.date; \n\t\t\t\t\t\t\tisDate = true ; \n\t\t\t\t\t\t\tbreak ; \n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( !isDate){\n\t\t\t\t\t\tif (String.class.getName().equals(tipeCol)){\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.string;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tdataTypes[i-1] = OuputDataType.commonToString;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfor ( OuputDataType scn : dataTypes ){\n\t\t\t\tSystem.out.println(\"converter : \" + scn);\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"gagal membaca data column unutk membuat converter object array. error message :\" + e.getMessage() , e); \n\t\t}\n\t\t\n\t\t\n\t}", "private static void writeColumnMetaData(JsonGenerator jg, ColumnMetaData mdt) throws JsonGenerationException, IOException {\n\t\tjg.writeStartObject();\n\t\tjg.writeStringField(\"name\", mdt.columnName);\n\t\tjg.writeStringField(\"type\", mdt.columnType);\n\t\tjg.writeEndObject();;\n\t}", "private String metadata() {\n\t\tStringBuilder s = new StringBuilder();\n\t\ts.append(\"#######################################\");\n\t\ts.append(\"\\n# Metadata of query set\");\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Queries\");\n\t\ts.append(\"\\n# \\tTotal: \" + this.num_queries);\n\t\ts.append(\"\\n# \\tPoint: \" + this.num_pt_queries + \" (\" + 100 * ((double) this.num_pt_queries/this.num_queries) +\"%)\");\n\t\ts.append(\"\\n# \\tRange: \" + this.num_range_queries + \" (\" + 100 * ((double) this.num_range_queries/this.num_queries) +\"%)\");\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Operators\");\n\t\ts.append(\"\\n# \\tTotal: \" + (this.num_and_ops + this.num_or_ops) + \" (\" + ((double) (this.num_and_ops + this.num_or_ops)/this.num_queries) +\" per query)\");\n\t\ts.append(\"\\n# \\tAND: \" + this.num_and_ops);\n\t\ts.append(\"\\n# \\tOR: \" + this.num_or_ops);\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Attributes\");\n\t\ts.append(\"\\n# \\tTotal queried: \" + this.num_attributes);\n\t\ts.append(\"\\n#\");\n\t\ts.append(\"\\n# Bins\");\n\t\ts.append(\"\\n# \\tTotal queried: \" + this.num_bins);\n\t\ts.append(\"\\n# \\tPer query: \" + ((double) this.num_bins/this.num_queries));\n\t\ts.append(\"\\n#######################################\\n\");\n\t\treturn s.toString();\n\t}", "public List<Map<String, Object>> getDatewiseUpdateData(String columnName) {\n\t\tList<Map<String, Object>> reportData = new ArrayList<>();\n\n\t\tswitch (columnName) {\n\t\tcase \"LASTUPDATED\":\n\t\t\treportData = getLastUpdatedReport();\n\t\t\tbreak;\n\t\tcase \"CREATEDON\":\n\t\t\treportData = getCreatedOnReport();\n\t\t\tbreak;\n\t\tcase \"READON\":\n\t\t\treportData = getReadOnReport();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tSystem.out.println(\"Invalid column name\");\n\t\t}\n\t\treturn reportData;\n\t}", "public Map<String, Object> getMetaData() {\n\t\treturn metaData;\n\t}", "public MetadataArtifactDownloadReport getReport() {\n return report;\n }", "public Map<String, ColumnMetaData> getColumns();", "public abstract String metadata(String property);", "@Override\n\tpublic IColumns createColumns() {\n\t\treturn new WaybillforauditColumns();\n\t}", "@Schema(description = \"`status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Binary general-info: The input information used to assemble the report that can be on-going, periodic and actual and projected \")\n public Object getAssessmentInstanceReportRecord() {\n return assessmentInstanceReportRecord;\n }", "public AlterTableMetadataResponse alterTableMetadata(AlterTableMetadataRequest request) throws GPUdbException {\n AlterTableMetadataResponse actualResponse_ = new AlterTableMetadataResponse();\n submitRequest(\"/alter/table/metadata\", request, actualResponse_, false);\n return actualResponse_;\n }", "public Long getReportId() {\n return reportId;\n }", "@Schema(description = \"`status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Binary general-info: The external report in any suitable form including selection filters where appropriate \")\n public Object getAssessmentInstanceReport() {\n return assessmentInstanceReport;\n }", "@SuppressWarnings(\"all\")\npublic interface I_I_BankDataJP \n{\n\n /** TableName=I_BankDataJP */\n public static final String Table_Name = \"I_BankDataJP\";\n\n /** AD_Table_ID=1000307 */\n public static final int Table_ID = MTable.getTable_ID(Table_Name);\n\n KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);\n\n /** AccessLevel = 3 - Client - Org \n */\n BigDecimal accessLevel = BigDecimal.valueOf(3);\n\n /** Load Meta Data */\n\n /** Column name AD_Client_ID */\n public static final String COLUMNNAME_AD_Client_ID = \"AD_Client_ID\";\n\n\t/** Get Tenant.\n\t * Tenant for this installation.\n\t */\n\tpublic int getAD_Client_ID();\n\n /** Column name AD_OrgTrx_ID */\n public static final String COLUMNNAME_AD_OrgTrx_ID = \"AD_OrgTrx_ID\";\n\n\t/** Set Trx Organization.\n\t * Performing or initiating organization\n\t */\n\tpublic void setAD_OrgTrx_ID (int AD_OrgTrx_ID);\n\n\t/** Get Trx Organization.\n\t * Performing or initiating organization\n\t */\n\tpublic int getAD_OrgTrx_ID();\n\n /** Column name AD_Org_ID */\n public static final String COLUMNNAME_AD_Org_ID = \"AD_Org_ID\";\n\n\t/** Set Organization.\n\t * Organizational entity within tenant\n\t */\n\tpublic void setAD_Org_ID (int AD_Org_ID);\n\n\t/** Get Organization.\n\t * Organizational entity within tenant\n\t */\n\tpublic int getAD_Org_ID();\n\n /** Column name AccountNo */\n public static final String COLUMNNAME_AccountNo = \"AccountNo\";\n\n\t/** Set Account No.\n\t * Account Number\n\t */\n\tpublic void setAccountNo (String AccountNo);\n\n\t/** Get Account No.\n\t * Account Number\n\t */\n\tpublic String getAccountNo();\n\n /** Column name BankAccountType */\n public static final String COLUMNNAME_BankAccountType = \"BankAccountType\";\n\n\t/** Set Bank Account Type.\n\t * Bank Account Type\n\t */\n\tpublic void setBankAccountType (String BankAccountType);\n\n\t/** Get Bank Account Type.\n\t * Bank Account Type\n\t */\n\tpublic String getBankAccountType();\n\n /** Column name C_BankAccount_ID */\n public static final String COLUMNNAME_C_BankAccount_ID = \"C_BankAccount_ID\";\n\n\t/** Set Bank Account.\n\t * Account at the Bank\n\t */\n\tpublic void setC_BankAccount_ID (int C_BankAccount_ID);\n\n\t/** Get Bank Account.\n\t * Account at the Bank\n\t */\n\tpublic int getC_BankAccount_ID();\n\n\tpublic org.compiere.model.I_C_BankAccount getC_BankAccount() throws RuntimeException;\n\n /** Column name C_Bank_ID */\n public static final String COLUMNNAME_C_Bank_ID = \"C_Bank_ID\";\n\n\t/** Set Bank.\n\t * Bank\n\t */\n\tpublic void setC_Bank_ID (int C_Bank_ID);\n\n\t/** Get Bank.\n\t * Bank\n\t */\n\tpublic int getC_Bank_ID();\n\n\tpublic org.compiere.model.I_C_Bank getC_Bank() throws RuntimeException;\n\n /** Column name Created */\n public static final String COLUMNNAME_Created = \"Created\";\n\n\t/** Get Created.\n\t * Date this record was created\n\t */\n\tpublic Timestamp getCreated();\n\n /** Column name CreatedBy */\n public static final String COLUMNNAME_CreatedBy = \"CreatedBy\";\n\n\t/** Get Created By.\n\t * User who created this records\n\t */\n\tpublic int getCreatedBy();\n\n /** Column name DateAcct */\n public static final String COLUMNNAME_DateAcct = \"DateAcct\";\n\n\t/** Set Account Date.\n\t * Accounting Date\n\t */\n\tpublic void setDateAcct (Timestamp DateAcct);\n\n\t/** Get Account Date.\n\t * Accounting Date\n\t */\n\tpublic Timestamp getDateAcct();\n\n /** Column name I_BankDataJP_ID */\n public static final String COLUMNNAME_I_BankDataJP_ID = \"I_BankDataJP_ID\";\n\n\t/** Set I_BankDataJP.\n\t * JPIERE-0595:JPBP\n\t */\n\tpublic void setI_BankDataJP_ID (int I_BankDataJP_ID);\n\n\t/** Get I_BankDataJP.\n\t * JPIERE-0595:JPBP\n\t */\n\tpublic int getI_BankDataJP_ID();\n\n /** Column name I_BankDataJP_UU */\n public static final String COLUMNNAME_I_BankDataJP_UU = \"I_BankDataJP_UU\";\n\n\t/** Set I_BankDataJP_UU\t */\n\tpublic void setI_BankDataJP_UU (String I_BankDataJP_UU);\n\n\t/** Get I_BankDataJP_UU\t */\n\tpublic String getI_BankDataJP_UU();\n\n /** Column name I_ErrorMsg */\n public static final String COLUMNNAME_I_ErrorMsg = \"I_ErrorMsg\";\n\n\t/** Set Import Error Message.\n\t * Messages generated from import process\n\t */\n\tpublic void setI_ErrorMsg (String I_ErrorMsg);\n\n\t/** Get Import Error Message.\n\t * Messages generated from import process\n\t */\n\tpublic String getI_ErrorMsg();\n\n /** Column name I_IsImported */\n public static final String COLUMNNAME_I_IsImported = \"I_IsImported\";\n\n\t/** Set Imported.\n\t * Has this import been processed\n\t */\n\tpublic void setI_IsImported (boolean I_IsImported);\n\n\t/** Get Imported.\n\t * Has this import been processed\n\t */\n\tpublic boolean isI_IsImported();\n\n /** Column name IsActive */\n public static final String COLUMNNAME_IsActive = \"IsActive\";\n\n\t/** Set Active.\n\t * The record is active in the system\n\t */\n\tpublic void setIsActive (boolean IsActive);\n\n\t/** Get Active.\n\t * The record is active in the system\n\t */\n\tpublic boolean isActive();\n\n /** Column name JP_A_Name */\n public static final String COLUMNNAME_JP_A_Name = \"JP_A_Name\";\n\n\t/** Set Account Name\t */\n\tpublic void setJP_A_Name (String JP_A_Name);\n\n\t/** Get Account Name\t */\n\tpublic String getJP_A_Name();\n\n /** Column name JP_A_Name_Kana */\n public static final String COLUMNNAME_JP_A_Name_Kana = \"JP_A_Name_Kana\";\n\n\t/** Set Account Name(Kana)\t */\n\tpublic void setJP_A_Name_Kana (String JP_A_Name_Kana);\n\n\t/** Get Account Name(Kana)\t */\n\tpublic String getJP_A_Name_Kana();\n\n /** Column name JP_AcctDate */\n public static final String COLUMNNAME_JP_AcctDate = \"JP_AcctDate\";\n\n\t/** Set Date of Account Date\t */\n\tpublic void setJP_AcctDate (String JP_AcctDate);\n\n\t/** Get Date of Account Date\t */\n\tpublic String getJP_AcctDate();\n\n /** Column name JP_AcctMonth */\n public static final String COLUMNNAME_JP_AcctMonth = \"JP_AcctMonth\";\n\n\t/** Set Month of Account Date\t */\n\tpublic void setJP_AcctMonth (String JP_AcctMonth);\n\n\t/** Get Month of Account Date\t */\n\tpublic String getJP_AcctMonth();\n\n /** Column name JP_BankAccountType */\n public static final String COLUMNNAME_JP_BankAccountType = \"JP_BankAccountType\";\n\n\t/** Set Bank Account Type\t */\n\tpublic void setJP_BankAccountType (String JP_BankAccountType);\n\n\t/** Get Bank Account Type\t */\n\tpublic String getJP_BankAccountType();\n\n /** Column name JP_BankAccount_Value */\n public static final String COLUMNNAME_JP_BankAccount_Value = \"JP_BankAccount_Value\";\n\n\t/** Set Bank Account(Search Key)\t */\n\tpublic void setJP_BankAccount_Value (String JP_BankAccount_Value);\n\n\t/** Get Bank Account(Search Key)\t */\n\tpublic String getJP_BankAccount_Value();\n\n /** Column name JP_BankDataCustomerCode1 */\n public static final String COLUMNNAME_JP_BankDataCustomerCode1 = \"JP_BankDataCustomerCode1\";\n\n\t/** Set Bank Data Customer Code1\t */\n\tpublic void setJP_BankDataCustomerCode1 (String JP_BankDataCustomerCode1);\n\n\t/** Get Bank Data Customer Code1\t */\n\tpublic String getJP_BankDataCustomerCode1();\n\n /** Column name JP_BankDataCustomerCode2 */\n public static final String COLUMNNAME_JP_BankDataCustomerCode2 = \"JP_BankDataCustomerCode2\";\n\n\t/** Set Bank Data Customer Code2\t */\n\tpublic void setJP_BankDataCustomerCode2 (String JP_BankDataCustomerCode2);\n\n\t/** Get Bank Data Customer Code2\t */\n\tpublic String getJP_BankDataCustomerCode2();\n\n /** Column name JP_BankDataLine_ID */\n public static final String COLUMNNAME_JP_BankDataLine_ID = \"JP_BankDataLine_ID\";\n\n\t/** Set Import Bank Data Line\t */\n\tpublic void setJP_BankDataLine_ID (int JP_BankDataLine_ID);\n\n\t/** Get Import Bank Data Line\t */\n\tpublic int getJP_BankDataLine_ID();\n\n\tpublic I_JP_BankDataLine getJP_BankDataLine() throws RuntimeException;\n\n /** Column name JP_BankData_EDI_Info */\n public static final String COLUMNNAME_JP_BankData_EDI_Info = \"JP_BankData_EDI_Info\";\n\n\t/** Set BankData EDI Info\t */\n\tpublic void setJP_BankData_EDI_Info (String JP_BankData_EDI_Info);\n\n\t/** Get BankData EDI Info\t */\n\tpublic String getJP_BankData_EDI_Info();\n\n /** Column name JP_BankData_ID */\n public static final String COLUMNNAME_JP_BankData_ID = \"JP_BankData_ID\";\n\n\t/** Set Import Bank Data\t */\n\tpublic void setJP_BankData_ID (int JP_BankData_ID);\n\n\t/** Get Import Bank Data\t */\n\tpublic int getJP_BankData_ID();\n\n\tpublic I_JP_BankData getJP_BankData() throws RuntimeException;\n\n /** Column name JP_BankData_ReferenceNo */\n public static final String COLUMNNAME_JP_BankData_ReferenceNo = \"JP_BankData_ReferenceNo\";\n\n\t/** Set Bank Data ReferenceNo\t */\n\tpublic void setJP_BankData_ReferenceNo (String JP_BankData_ReferenceNo);\n\n\t/** Get Bank Data ReferenceNo\t */\n\tpublic String getJP_BankData_ReferenceNo();\n\n /** Column name JP_BankName_Kana */\n public static final String COLUMNNAME_JP_BankName_Kana = \"JP_BankName_Kana\";\n\n\t/** Set Bank Name(Kana)\t */\n\tpublic void setJP_BankName_Kana (String JP_BankName_Kana);\n\n\t/** Get Bank Name(Kana)\t */\n\tpublic String getJP_BankName_Kana();\n\n /** Column name JP_BankName_Kana_Line */\n public static final String COLUMNNAME_JP_BankName_Kana_Line = \"JP_BankName_Kana_Line\";\n\n\t/** Set Bank Name(Kana) Line\t */\n\tpublic void setJP_BankName_Kana_Line (String JP_BankName_Kana_Line);\n\n\t/** Get Bank Name(Kana) Line\t */\n\tpublic String getJP_BankName_Kana_Line();\n\n /** Column name JP_Bank_Name */\n public static final String COLUMNNAME_JP_Bank_Name = \"JP_Bank_Name\";\n\n\t/** Set Bank Name\t */\n\tpublic void setJP_Bank_Name (String JP_Bank_Name);\n\n\t/** Get Bank Name\t */\n\tpublic String getJP_Bank_Name();\n\n /** Column name JP_BranchCode */\n public static final String COLUMNNAME_JP_BranchCode = \"JP_BranchCode\";\n\n\t/** Set Branch Code\t */\n\tpublic void setJP_BranchCode (String JP_BranchCode);\n\n\t/** Get Branch Code\t */\n\tpublic String getJP_BranchCode();\n\n /** Column name JP_BranchName */\n public static final String COLUMNNAME_JP_BranchName = \"JP_BranchName\";\n\n\t/** Set Branch Name\t */\n\tpublic void setJP_BranchName (String JP_BranchName);\n\n\t/** Get Branch Name\t */\n\tpublic String getJP_BranchName();\n\n /** Column name JP_BranchName_Kana */\n public static final String COLUMNNAME_JP_BranchName_Kana = \"JP_BranchName_Kana\";\n\n\t/** Set Branch Name(Kana)\t */\n\tpublic void setJP_BranchName_Kana (String JP_BranchName_Kana);\n\n\t/** Get Branch Name(Kana)\t */\n\tpublic String getJP_BranchName_Kana();\n\n /** Column name JP_BranchName_Kana_Line */\n public static final String COLUMNNAME_JP_BranchName_Kana_Line = \"JP_BranchName_Kana_Line\";\n\n\t/** Set Branch Name(Kana) Line\t */\n\tpublic void setJP_BranchName_Kana_Line (String JP_BranchName_Kana_Line);\n\n\t/** Get Branch Name(Kana) Line\t */\n\tpublic String getJP_BranchName_Kana_Line();\n\n /** Column name JP_Date */\n public static final String COLUMNNAME_JP_Date = \"JP_Date\";\n\n\t/** Set Date.\n\t * Date\n\t */\n\tpublic void setJP_Date (String JP_Date);\n\n\t/** Get Date.\n\t * Date\n\t */\n\tpublic String getJP_Date();\n\n /** Column name JP_Line_Description */\n public static final String COLUMNNAME_JP_Line_Description = \"JP_Line_Description\";\n\n\t/** Set Line Description\t */\n\tpublic void setJP_Line_Description (String JP_Line_Description);\n\n\t/** Get Line Description\t */\n\tpublic String getJP_Line_Description();\n\n /** Column name JP_Month */\n public static final String COLUMNNAME_JP_Month = \"JP_Month\";\n\n\t/** Set Month\t */\n\tpublic void setJP_Month (String JP_Month);\n\n\t/** Get Month\t */\n\tpublic String getJP_Month();\n\n /** Column name JP_OrgTrx_Value */\n public static final String COLUMNNAME_JP_OrgTrx_Value = \"JP_OrgTrx_Value\";\n\n\t/** Set Trx Organization(Search Key)\t */\n\tpublic void setJP_OrgTrx_Value (String JP_OrgTrx_Value);\n\n\t/** Get Trx Organization(Search Key)\t */\n\tpublic String getJP_OrgTrx_Value();\n\n /** Column name JP_Org_Value */\n public static final String COLUMNNAME_JP_Org_Value = \"JP_Org_Value\";\n\n\t/** Set Organization(Search Key)\t */\n\tpublic void setJP_Org_Value (String JP_Org_Value);\n\n\t/** Get Organization(Search Key)\t */\n\tpublic String getJP_Org_Value();\n\n /** Column name JP_RequesterName */\n public static final String COLUMNNAME_JP_RequesterName = \"JP_RequesterName\";\n\n\t/** Set Requester Name\t */\n\tpublic void setJP_RequesterName (String JP_RequesterName);\n\n\t/** Get Requester Name\t */\n\tpublic String getJP_RequesterName();\n\n /** Column name JP_SalesRep_EMail */\n public static final String COLUMNNAME_JP_SalesRep_EMail = \"JP_SalesRep_EMail\";\n\n\t/** Set Sales Rep(E-Mail)\t */\n\tpublic void setJP_SalesRep_EMail (String JP_SalesRep_EMail);\n\n\t/** Get Sales Rep(E-Mail)\t */\n\tpublic String getJP_SalesRep_EMail();\n\n /** Column name JP_SalesRep_Name */\n public static final String COLUMNNAME_JP_SalesRep_Name = \"JP_SalesRep_Name\";\n\n\t/** Set Sales Rep(Name)\t */\n\tpublic void setJP_SalesRep_Name (String JP_SalesRep_Name);\n\n\t/** Get Sales Rep(Name)\t */\n\tpublic String getJP_SalesRep_Name();\n\n /** Column name JP_SalesRep_Value */\n public static final String COLUMNNAME_JP_SalesRep_Value = \"JP_SalesRep_Value\";\n\n\t/** Set Sales Rep(Search Key)\t */\n\tpublic void setJP_SalesRep_Value (String JP_SalesRep_Value);\n\n\t/** Get Sales Rep(Search Key)\t */\n\tpublic String getJP_SalesRep_Value();\n\n /** Column name Processed */\n public static final String COLUMNNAME_Processed = \"Processed\";\n\n\t/** Set Processed.\n\t * The document has been processed\n\t */\n\tpublic void setProcessed (boolean Processed);\n\n\t/** Get Processed.\n\t * The document has been processed\n\t */\n\tpublic boolean isProcessed();\n\n /** Column name Processing */\n public static final String COLUMNNAME_Processing = \"Processing\";\n\n\t/** Set Process Now\t */\n\tpublic void setProcessing (boolean Processing);\n\n\t/** Get Process Now\t */\n\tpublic boolean isProcessing();\n\n /** Column name RoutingNo */\n public static final String COLUMNNAME_RoutingNo = \"RoutingNo\";\n\n\t/** Set Routing No.\n\t * Bank Routing Number\n\t */\n\tpublic void setRoutingNo (String RoutingNo);\n\n\t/** Get Routing No.\n\t * Bank Routing Number\n\t */\n\tpublic String getRoutingNo();\n\n /** Column name SalesRep_ID */\n public static final String COLUMNNAME_SalesRep_ID = \"SalesRep_ID\";\n\n\t/** Set Sales Rep.\n\t * Sales Representative or Company Agent\n\t */\n\tpublic void setSalesRep_ID (int SalesRep_ID);\n\n\t/** Get Sales Rep.\n\t * Sales Representative or Company Agent\n\t */\n\tpublic int getSalesRep_ID();\n\n\tpublic org.compiere.model.I_AD_User getSalesRep() throws RuntimeException;\n\n /** Column name StatementDate */\n public static final String COLUMNNAME_StatementDate = \"StatementDate\";\n\n\t/** Set Statement date.\n\t * Date of the statement\n\t */\n\tpublic void setStatementDate (Timestamp StatementDate);\n\n\t/** Get Statement date.\n\t * Date of the statement\n\t */\n\tpublic Timestamp getStatementDate();\n\n /** Column name StmtAmt */\n public static final String COLUMNNAME_StmtAmt = \"StmtAmt\";\n\n\t/** Set Statement amount.\n\t * Statement Amount\n\t */\n\tpublic void setStmtAmt (BigDecimal StmtAmt);\n\n\t/** Get Statement amount.\n\t * Statement Amount\n\t */\n\tpublic BigDecimal getStmtAmt();\n\n /** Column name TrxAmt */\n public static final String COLUMNNAME_TrxAmt = \"TrxAmt\";\n\n\t/** Set Transaction Amount.\n\t * Amount of a transaction\n\t */\n\tpublic void setTrxAmt (BigDecimal TrxAmt);\n\n\t/** Get Transaction Amount.\n\t * Amount of a transaction\n\t */\n\tpublic BigDecimal getTrxAmt();\n\n /** Column name Updated */\n public static final String COLUMNNAME_Updated = \"Updated\";\n\n\t/** Get Updated.\n\t * Date this record was updated\n\t */\n\tpublic Timestamp getUpdated();\n\n /** Column name UpdatedBy */\n public static final String COLUMNNAME_UpdatedBy = \"UpdatedBy\";\n\n\t/** Get Updated By.\n\t * User who updated this records\n\t */\n\tpublic int getUpdatedBy();\n}", "Map<String, Object> getAllMetadata();", "public static JasperReportBuilder generateReport(ExportData metaData,HttpServletRequest request){\n session = request.getSession(false);\n report = report(); // Creer le rapport\n \n //Logo\n// logoImg = cmp.image(inImg).setStyle(DynamicReports.stl.style().setHorizontalAlignment(HorizontalAlignment.LEFT)); \n //logoImg.setDimension(80,80); \n \n //Definit le style des colonnes d'entàte\n report.setColumnTitleStyle(getHeaderStyle(metaData));\n \n \n \n LinkedHashMap <String,String> criteria = metaData.getCriteria(); \n //Ajout la date d'àdition au critere d'impression\n String valDateProperty = getDateTxt(metaData.getLang()) ;\n String keyDateProperty = \"\" ;\n if ( session.getAttribute(\"activedLocale\").equals(\"fr\") ) {\n keyDateProperty = \"Edité le \" ;\n }\n else {\n keyDateProperty = \"Printed on \" ;\n }\n criteria.put(keyDateProperty,valDateProperty);\n \n StyleBuilder titleStyle = stl.style(boldStyle).setFontSize(16).setForegroundColor(new Color(0, 0, 0)).setHorizontalAlignment(HorizontalAlignment.RIGHT).setRightIndent(20);\n ComponentBuilder<?, ?> logoComponent = cmp.horizontalList(\n //cmp.image(Templates.class.getResource(\"/logopalm.png\")).setFixedDimension(150, 50).setStyle(stl.style().setLeftIndent(20)),\n cmp.verticalList(\n cmp.text(metaData.getTitle()).setStyle(titleStyle)\n )\n ).newRow()\n .add(cmp.horizontalList().add(cmp.hListCell(createCriteriaComponent(criteria,metaData)).heightFixedOnTop()))\n .newRow(); \n \n report.noData(logoComponent, cmp.text(\"Aucun enregistrement trouvà\").setStyle(stl.style().setHorizontalAlignment(HorizontalAlignment.CENTER).setTopPadding(30)));\n\n \n \n lblStyle = stl.style(Templates.columnStyle).setForegroundColor(new Color(60, 91, 31)); // Couleur du text \n colStyle = stl.style(Templates.columnStyle).setHorizontalAlignment(HorizontalAlignment.CENTER);\n \n groupStyle = stl.style().setForegroundColor(new Color(60, 91, 31)) \n .setBold(Boolean.TRUE)\n .setPadding(5)\n .setFontSize(13)\n .setHorizontalAlignment(HorizontalAlignment.CENTER); \n \n\n \n if(metaData.getTitle().equals(ITitle.PARCEL)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PARCEL_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SECTOR)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SECTOR_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BLOCK)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BLOCK_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ATTACK_PHYTO)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TREATMENT)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TREATMENT_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVEST)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVEST_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SERVICING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SERVICING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_PLANTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_PLANTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.FERTILIZATION)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.FERTILIZATION_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.CONTROL_PHYTO)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.CONTROL_PHYTO_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_FOLDING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_FOLDING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.MORTALITY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.MORTALITY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVESTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVESTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BUDGET)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.REPLACEMENT)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.REPLACEMENT_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.METEOROLOGY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.METEOROLOGY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_MATERIAL)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_MATERIAL_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLUVIOMETRY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLUVIOMETRY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ETP)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ETP_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HYGROMETRY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HYGROMETRY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TEMPERATURE)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TEMPERATURE_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.INSULATION)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.INSULATION_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.WORK)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.WORK_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }\n \n \n drColumns = new HashMap<String, TextColumnBuilder>(); \n groups = new ArrayList<String>();\n subtotals = new ArrayList<String>();\n \n //Definit la liste des colonnes du rapport\n ExportGenerator.getColumns(metaData); \n //Definit la liste des sous-totaux du rapport\n ExportGenerator.getSubTotals(metaData);\n \n \n //Genration des sous totaux\n for (String group : groups) {\n ColumnGroupBuilder group2 = grp.group(drColumns.get(group));\n report.groupBy(group2);\n for (String subtotal : subtotals) {\n report.subtotalsAtGroupFooter(group2,sbt.sum(drColumns.get(subtotal)));\n }\n }\n\n for (String subtotal : subtotals) {\n report.subtotalsAtSummary(sbt.sum(drColumns.get(subtotal))); \n }\n \n /*if(ExportGenerator.getColumnByNameField(\"plantingName\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL \"), ExportGenerator.getColumnByNameField(\"plantingName\"), Calculation.NOTHING));\n }*//*else if(ExportGenerator.getColumnByNameField(\"invoiceCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"invoiceCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"planterCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL\"), ExportGenerator.getColumnByNameField(\"planterCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"transportTicket\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"transportTicket\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"deliveryDate\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"deliveryDate\"), Calculation.NOTHING));\n }\n else if(ExportGenerator.getColumnByNameField(\"arroundPlantingTicketNumber\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"arroundPlantingTicketNumber\"), Calculation.NOTHING));\n }\n else if(ExportGenerator.getColumnByNameField(\"planterNumber\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"planterNumber\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"startPaymentDate\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"startPaymentDate\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"sectorCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"sectorCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"month\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL \"), ExportGenerator.getColumnByNameField(\"month\"), Calculation.NOTHING));\n }*/\n \n\n \n \n //Genere la source de donnàes du rapport\n report.setDataSource(metaData.getData());\n \n report.highlightDetailEvenRows(); \n \n \n // Definition de l'entete : valable uniquement pour la 1ere page\n HorizontalListBuilder hlb= null;\n \n hlb = cmp.horizontalList().add(\n cmp.hListCell(createCriteriaComponent(criteria,metaData)).heightFixedOnTop()\n );\n\n \n report.title(\n createCustomTitleComponent(metaData.getTitle()), // Titre\n hlb,// Liste Horizontal des Critàres \n cmp.verticalGap(12) // Marge de 12 px entre chaque critàre\n ); \n \n \n \n report.setPageMargin(DynamicReports.margin().setLeft(15).setTop(30).setRight(15).setBottom(30));\n report.setPageFormat(PageType.A3, PageOrientation.LANDSCAPE);\n report.pageFooter(DynamicReports.cmp.pageXslashY());\n return report;\n \n }", "public interface IReportDao extends IBaseDao<Report, Integer> {\n\t\n\t/**\n\t * 添加举报信息\n\t * @param report\n\t */\n\tpublic boolean addReport(Report report);\n\t\n\t/**\n\t * 修改举报信息\n\t * @param report\n\t * @return\n\t */\n\tpublic boolean updateReport(Report report);\n\t\n//\t/**\n//\t * 是否已经举报\n//\t * @param getReportGto\n//\t * @return\n//\t */\n//\tpublic boolean isHouseInfoReported(GetReportGto getReportGto);\n\t\n\t/**\n\t * 获取我与某条房源的举报信息\n\t * @param getReportGto\n\t * @return\n\t */\n\tpublic List<Report> getMyReport(GetReportGto getReportGto);\n}", "public interface TableDetailMapper {\n\n @Select(\"select * from dxh_sys.tabledetail where vendorId=0 and tableName='skuProfitDayReport'\")\n List<Map<String, Object>> list();\n\n}", "public Report getReport();", "BoltResultSetMetaData(List<Type> types, List<String> keys) {\n\t\tsuper(keys);\n\t\tthis.columnType = types.toArray(new Type[this.keys.size() + 1]);\n\n\t\t// we init columnType with the first record\n\t\t// in case first == last record\n\t\t/*for (int i = 1; i <= this.keys.size(); i++) {\n\t\t\tcolumnType[i] = this.getColumnDriverTypeOrDefault(i, InternalTypeSystem.TYPE_SYSTEM.STRING());\n\t\t}*/\n\t}", "@Override\r\n\tpublic Map<String, Object> getMetadata() {\n\t\treturn null;\r\n\t}", "@Select({\n \"select\",\n \"JNLNO, TRANDATE, ACCOUNTDATE, CHECKTYPE, STATUS, DONETIME, FILENAME\",\n \"from B_UMB_CHECKING_LOG\",\n \"where JNLNO = #{jnlno,jdbcType=VARCHAR}\"\n })\n @Results({\n @Result(column=\"JNLNO\", property=\"jnlno\", jdbcType=JdbcType.VARCHAR, id=true),\n @Result(column=\"TRANDATE\", property=\"trandate\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"ACCOUNTDATE\", property=\"accountdate\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"CHECKTYPE\", property=\"checktype\", jdbcType=JdbcType.CHAR),\n @Result(column=\"STATUS\", property=\"status\", jdbcType=JdbcType.CHAR),\n @Result(column=\"DONETIME\", property=\"donetime\", jdbcType=JdbcType.VARCHAR),\n @Result(column=\"FILENAME\", property=\"filename\", jdbcType=JdbcType.VARCHAR)\n })\n BUMBCheckingLog selectByPrimaryKey(BUMBCheckingLogKey key);", "@SqlQuery(\"select * from PLAYERSTATS\")\n List<PlayerStats> getAll();", "protected String getMetadataName() {\r\n\t\treturn METADATA_NAME;\r\n\t}", "public abstract String getSummaryForDatabase();", "private interface ReportColumnCallback\n {\n void handleReportColumn(DashboardReport report, String columnName) throws MojoExecutionException;\n }", "public ReportMetadataExample() {\n\t\toredCriteria = new ArrayList<Criteria>();\n\t}", "@Override\r\n \tpublic MetaData getMetaData(HttpHeaders headers) {\n \t\ttry {\r\n \t\t\treturn MetaDataUtil.getMetaData(new ViewListeEleve(), new HashMap<String, MetaData>(),new ArrayList<String>());\r\n \t\t} catch (Exception e) {\r\n \t\t\t// TODO Auto-generated catch block\r\n \t\t\tthrow new WebApplicationException(Response.serverError().entity(new String(\"MetaData parse error\")).build());\r\n \t\t} \r\n \t}", "public DefaultMetaData getMetaData() {\n\t\treturn this.metaData;\n\t}", "Report createReport();", "@Override\n public Map<String, String> createFieldToPropertyMapping() {\n final Map<String, String> mapping = super.createFieldToPropertyMapping();\n mapping.put(this.tableName + \".rsres_id\", \"id\");\n mapping.put(this.tableName + \".resource_id\", \"resourceId\");\n mapping.put(this.tableName + \".quantity\", QUANTITY);\n mapping.put(this.tableName + \".cost_rsres\", \"cost\");\n\n return mapping;\n }", "public String getReportsToBeGenerated(String reportType) {\r\n\t\tString query = \"\";\r\n\t\t\r\n\t\ttry (Connection connection = DatabaseConnection.getMySQLConnection();\r\n\t\t\t PreparedStatement stmt = connection.prepareStatement(query);) {\r\n\t\t\tResultSet result = stmt.executeQuery();\r\n\t\t\tStringJoiner reports = new StringJoiner(\",,\");\r\n\t\t\twhile (result.next()) {\r\n\t\t\t\treports.add(result.getString(\"REPORT_NAME\"));\r\n\t\t\t}\r\n\t\t\treturn reports.toString();\r\n\t\t} catch (SQLException e) {\r\n\t\t\tthrow new ReportGenerationException(\"An error occurred while retrieving reports to be generated.\", e);\r\n\t\t}\r\n\t}", "public String getMetaDataFileName() {\n return null;\n }", "public JDBCRawSqlQueryMetaData(Method method) {\n this.method = method;\n }", "public Map getMetadata() {\n return metadata;\n }", "public DatabaseMetaData(Statement s) {\n\t\t_stmt = s; // SQL-Connection\n\t\t_buffer = new StringBuffer(); // Output goes here\n\t\t_tables = new ArrayList<String>(); // List of tables\n\t\t\n\t\ttry {\n\t\t\t// Put table names in `_tables`\n\t\t\textractTableNames(_stmt.executeQuery(composeTableNamesQuery()));\n\n\t\t\t// fetch the string representation of each tables meta-data\n\t\t\tfor (String name : _tables)\n\t\t\t\t_buffer.append(new TableMeta(name)); \n\t\t} catch (SQLException e) { _error = true;}\n\t}", "private Builder() {\n super(net.explorys.samhat.z12.r837.X837Ins_2320_MOA_MedicareOutpatientAdjudicationInformation.SCHEMA$);\n }", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "io.dstore.engine.MetaInformation getMetaInformation(int index);", "public String toString() {\n return \"[JDBCRawSqlQueryMetaData : method=\" + method + \"]\";\n }", "Report selectByPrimaryKey(Integer id);", "java.lang.String getMetadata(int index);", "java.lang.String getMetadata(int index);", "public Integer getReportId() {\n return reportId;\n }", "@Schema(description = \"`status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Code general-info: The type of external report available \")\n public String getAssessmentInstanceReportType() {\n return assessmentInstanceReportType;\n }", "@Override\r\n\tpublic List<ReportAndSummary> findAll() {\n\t\tList<ReportAndSummary> result = reportAndSummaryDao.findAll();\r\n\t\treturn result;\r\n\t}", "private static Map<String, ColumnMetaData> buildColumnMetadataMap(ResultSet rs) {\n\t\t/*\n\t\t * LinkedHashmap to preserve key traversal order.\n\t\t * Important as we output rows as arrays of values where the index position in\n\t\t * the row implicitly corresponds to the entry order of the column map.\n\t\t * Reason for this is performance. \n\t\t */\n\t\tMap<String, ColumnMetaData> columnMap = Maps.newLinkedHashMap();\n\t\ttry {\n\t\t\tResultSetMetaData rmd = rs.getMetaData();\n\t\t\tfor (int i=1; i<= rmd.getColumnCount(); i++) {\n\t\t\t\tColumnMetaData cmd = \n\t\t\t\t\tnew ColumnMetaData(rmd.getColumnName(i), rmd.getColumnTypeName(i));\n\t\t\t\tcolumnMap.put(cmd.columnName, cmd);\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\tThrowables.propagate(e);\n\t\t}\n\t\treturn columnMap;\n\t}", "protected String getSqlTable() {\n\t\treturn \"Project\";\n\t}", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "org.apache.calcite.avatica.proto.Responses.RpcMetadata getMetadata();", "public interface I_IHC_JobDataChange \n{\n\n /** TableName=IHC_JobDataChange */\n public static final String Table_Name = \"IHC_JobDataChange\";\n\n /** AD_Table_ID=1100135 */\n public static final int Table_ID = MTable.getTable_ID(Table_Name);\n\n KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);\n\n /** AccessLevel = 3 - Client - Org \n */\n BigDecimal accessLevel = BigDecimal.valueOf(3);\n\n /** Load Meta Data */\n\n /** Column name AD_Client_ID */\n public static final String COLUMNNAME_AD_Client_ID = \"AD_Client_ID\";\n\n\t/** Get Client.\n\t * Client/Tenant for this installation.\n\t */\n\tpublic int getAD_Client_ID();\n\n /** Column name AD_Org_ID */\n public static final String COLUMNNAME_AD_Org_ID = \"AD_Org_ID\";\n\n\t/** Set Organization.\n\t * Organizational entity within client\n\t */\n\tpublic void setAD_Org_ID (int AD_Org_ID);\n\n\t/** Get Organization.\n\t * Organizational entity within client\n\t */\n\tpublic int getAD_Org_ID();\n\n /** Column name BPJSRegistrationDate */\n public static final String COLUMNNAME_BPJSRegistrationDate = \"BPJSRegistrationDate\";\n\n\t/** Set BPJS Registration Date\t */\n\tpublic void setBPJSRegistrationDate (Timestamp BPJSRegistrationDate);\n\n\t/** Get BPJS Registration Date\t */\n\tpublic Timestamp getBPJSRegistrationDate();\n\n /** Column name Created */\n public static final String COLUMNNAME_Created = \"Created\";\n\n\t/** Get Created.\n\t * Date this record was created\n\t */\n\tpublic Timestamp getCreated();\n\n /** Column name CreatedBy */\n public static final String COLUMNNAME_CreatedBy = \"CreatedBy\";\n\n\t/** Get Created By.\n\t * User who created this records\n\t */\n\tpublic int getCreatedBy();\n\n /** Column name Description */\n public static final String COLUMNNAME_Description = \"Description\";\n\n\t/** Set Description.\n\t * Optional short description of the record\n\t */\n\tpublic void setDescription (String Description);\n\n\t/** Get Description.\n\t * Optional short description of the record\n\t */\n\tpublic String getDescription();\n\n /** Column name DescriptionNew */\n public static final String COLUMNNAME_DescriptionNew = \"DescriptionNew\";\n\n\t/** Set Description New\t */\n\tpublic void setDescriptionNew (String DescriptionNew);\n\n\t/** Get Description New\t */\n\tpublic String getDescriptionNew();\n\n /** Column name HC_Compensation1 */\n public static final String COLUMNNAME_HC_Compensation1 = \"HC_Compensation1\";\n\n\t/** Set Compensation 1\t */\n\tpublic void setHC_Compensation1 (BigDecimal HC_Compensation1);\n\n\t/** Get Compensation 1\t */\n\tpublic BigDecimal getHC_Compensation1();\n\n /** Column name HC_Compensation2 */\n public static final String COLUMNNAME_HC_Compensation2 = \"HC_Compensation2\";\n\n\t/** Set Compensation 2\t */\n\tpublic void setHC_Compensation2 (BigDecimal HC_Compensation2);\n\n\t/** Get Compensation 2\t */\n\tpublic BigDecimal getHC_Compensation2();\n\n /** Column name HC_Compensation3 */\n public static final String COLUMNNAME_HC_Compensation3 = \"HC_Compensation3\";\n\n\t/** Set Compensation 3\t */\n\tpublic void setHC_Compensation3 (BigDecimal HC_Compensation3);\n\n\t/** Get Compensation 3\t */\n\tpublic BigDecimal getHC_Compensation3();\n\n /** Column name HC_Compensation4 */\n public static final String COLUMNNAME_HC_Compensation4 = \"HC_Compensation4\";\n\n\t/** Set Compensation 4\t */\n\tpublic void setHC_Compensation4 (BigDecimal HC_Compensation4);\n\n\t/** Get Compensation 4\t */\n\tpublic BigDecimal getHC_Compensation4();\n\n /** Column name HC_EffectiveSeq */\n public static final String COLUMNNAME_HC_EffectiveSeq = \"HC_EffectiveSeq\";\n\n\t/** Set Effective Sequence\t */\n\tpublic void setHC_EffectiveSeq (int HC_EffectiveSeq);\n\n\t/** Get Effective Sequence\t */\n\tpublic int getHC_EffectiveSeq();\n\n /** Column name HC_Employee_ID */\n public static final String COLUMNNAME_HC_Employee_ID = \"HC_Employee_ID\";\n\n\t/** Set Employee Data\t */\n\tpublic void setHC_Employee_ID (int HC_Employee_ID);\n\n\t/** Get Employee Data\t */\n\tpublic int getHC_Employee_ID();\n\n\tpublic I_HC_Employee getHC_Employee() throws RuntimeException;\n\n /** Column name HC_EmployeeGrade_ID */\n public static final String COLUMNNAME_HC_EmployeeGrade_ID = \"HC_EmployeeGrade_ID\";\n\n\t/** Set Employee Grade\t */\n\tpublic void setHC_EmployeeGrade_ID (int HC_EmployeeGrade_ID);\n\n\t/** Get Employee Grade\t */\n\tpublic int getHC_EmployeeGrade_ID();\n\n\tpublic I_HC_EmployeeGrade getHC_EmployeeGrade() throws RuntimeException;\n\n /** Column name HC_EmployeeGrade2_ID */\n public static final String COLUMNNAME_HC_EmployeeGrade2_ID = \"HC_EmployeeGrade2_ID\";\n\n\t/** Set Employee Grade To\t */\n\tpublic void setHC_EmployeeGrade2_ID (int HC_EmployeeGrade2_ID);\n\n\t/** Get Employee Grade To\t */\n\tpublic int getHC_EmployeeGrade2_ID();\n\n\tpublic I_HC_EmployeeGrade getHC_EmployeeGrade2() throws RuntimeException;\n\n /** Column name HC_EmployeeJob_ID */\n public static final String COLUMNNAME_HC_EmployeeJob_ID = \"HC_EmployeeJob_ID\";\n\n\t/** Set Employee Job Data\t */\n\tpublic void setHC_EmployeeJob_ID (int HC_EmployeeJob_ID);\n\n\t/** Get Employee Job Data\t */\n\tpublic int getHC_EmployeeJob_ID();\n\n\tpublic I_HC_EmployeeJob getHC_EmployeeJob() throws RuntimeException;\n\n /** Column name HC_Job_ID */\n public static final String COLUMNNAME_HC_Job_ID = \"HC_Job_ID\";\n\n\t/** Set Job\t */\n\tpublic void setHC_Job_ID (int HC_Job_ID);\n\n\t/** Get Job\t */\n\tpublic int getHC_Job_ID();\n\n\tpublic I_HC_Job getHC_Job() throws RuntimeException;\n\n /** Column name HC_JobAction */\n public static final String COLUMNNAME_HC_JobAction = \"HC_JobAction\";\n\n\t/** Set Job Action\t */\n\tpublic void setHC_JobAction (String HC_JobAction);\n\n\t/** Get Job Action\t */\n\tpublic String getHC_JobAction();\n\n /** Column name HC_JobDataChange_ID */\n public static final String COLUMNNAME_HC_JobDataChange_ID = \"HC_JobDataChange_ID\";\n\n\t/** Set Job Data Change\t */\n\tpublic void setHC_JobDataChange_ID (int HC_JobDataChange_ID);\n\n\t/** Get Job Data Change\t */\n\tpublic int getHC_JobDataChange_ID();\n\n\tpublic I_HC_JobDataChange getHC_JobDataChange() throws RuntimeException;\n\n /** Column name HC_Manager_ID */\n public static final String COLUMNNAME_HC_Manager_ID = \"HC_Manager_ID\";\n\n\t/** Set Manager Name\t */\n\tpublic void setHC_Manager_ID (int HC_Manager_ID);\n\n\t/** Get Manager Name\t */\n\tpublic int getHC_Manager_ID();\n\n\tpublic I_HC_Employee getHC_Manager() throws RuntimeException;\n\n /** Column name HC_ManagerTo_ID */\n public static final String COLUMNNAME_HC_ManagerTo_ID = \"HC_ManagerTo_ID\";\n\n\t/** Set Manager To ID\t */\n\tpublic void setHC_ManagerTo_ID (int HC_ManagerTo_ID);\n\n\t/** Get Manager To ID\t */\n\tpublic int getHC_ManagerTo_ID();\n\n\tpublic I_HC_Employee getHC_ManagerTo() throws RuntimeException;\n\n /** Column name HC_Org_ID */\n public static final String COLUMNNAME_HC_Org_ID = \"HC_Org_ID\";\n\n\t/** Set HC Organization\t */\n\tpublic void setHC_Org_ID (int HC_Org_ID);\n\n\t/** Get HC Organization\t */\n\tpublic int getHC_Org_ID();\n\n\tpublic I_HC_Org getHC_Org() throws RuntimeException;\n\n /** Column name HC_Org2_ID */\n public static final String COLUMNNAME_HC_Org2_ID = \"HC_Org2_ID\";\n\n\t/** Set HC Organization To\t */\n\tpublic void setHC_Org2_ID (int HC_Org2_ID);\n\n\t/** Get HC Organization To\t */\n\tpublic int getHC_Org2_ID();\n\n\tpublic I_HC_Org getHC_Org2() throws RuntimeException;\n\n /** Column name HC_PayGroup_ID */\n public static final String COLUMNNAME_HC_PayGroup_ID = \"HC_PayGroup_ID\";\n\n\t/** Set Payroll Group\t */\n\tpublic void setHC_PayGroup_ID (int HC_PayGroup_ID);\n\n\t/** Get Payroll Group\t */\n\tpublic int getHC_PayGroup_ID();\n\n\tpublic I_HC_PayGroup getHC_PayGroup() throws RuntimeException;\n\n /** Column name HC_PreviousJob_ID */\n public static final String COLUMNNAME_HC_PreviousJob_ID = \"HC_PreviousJob_ID\";\n\n\t/** Set Job Sekarang\t */\n\tpublic void setHC_PreviousJob_ID (int HC_PreviousJob_ID);\n\n\t/** Get Job Sekarang\t */\n\tpublic int getHC_PreviousJob_ID();\n\n\tpublic I_HC_Job getHC_PreviousJob() throws RuntimeException;\n\n /** Column name HC_Reason_ID */\n public static final String COLUMNNAME_HC_Reason_ID = \"HC_Reason_ID\";\n\n\t/** Set HC Reason\t */\n\tpublic void setHC_Reason_ID (int HC_Reason_ID);\n\n\t/** Get HC Reason\t */\n\tpublic int getHC_Reason_ID();\n\n\tpublic I_HC_Reason getHC_Reason() throws RuntimeException;\n\n /** Column name HC_Status */\n public static final String COLUMNNAME_HC_Status = \"HC_Status\";\n\n\t/** Set HC Status\t */\n\tpublic void setHC_Status (String HC_Status);\n\n\t/** Get HC Status\t */\n\tpublic String getHC_Status();\n\n /** Column name HC_WorkEndDate */\n public static final String COLUMNNAME_HC_WorkEndDate = \"HC_WorkEndDate\";\n\n\t/** Set Work End Date\t */\n\tpublic void setHC_WorkEndDate (Timestamp HC_WorkEndDate);\n\n\t/** Get Work End Date\t */\n\tpublic Timestamp getHC_WorkEndDate();\n\n /** Column name HC_WorkPeriodDate */\n public static final String COLUMNNAME_HC_WorkPeriodDate = \"HC_WorkPeriodDate\";\n\n\t/** Set WorkPeriodDate\t */\n\tpublic void setHC_WorkPeriodDate (String HC_WorkPeriodDate);\n\n\t/** Get WorkPeriodDate\t */\n\tpublic String getHC_WorkPeriodDate();\n\n /** Column name HC_WorkStartDate */\n public static final String COLUMNNAME_HC_WorkStartDate = \"HC_WorkStartDate\";\n\n\t/** Set WorkStartDate\t */\n\tpublic void setHC_WorkStartDate (Timestamp HC_WorkStartDate);\n\n\t/** Get WorkStartDate\t */\n\tpublic Timestamp getHC_WorkStartDate();\n\n /** Column name HC_WorkStartDate2 */\n public static final String COLUMNNAME_HC_WorkStartDate2 = \"HC_WorkStartDate2\";\n\n\t/** Set Work Start Date Baru\t */\n\tpublic void setHC_WorkStartDate2 (Timestamp HC_WorkStartDate2);\n\n\t/** Get Work Start Date Baru\t */\n\tpublic Timestamp getHC_WorkStartDate2();\n\n /** Column name IHC_JobDataChange_ID */\n public static final String COLUMNNAME_IHC_JobDataChange_ID = \"IHC_JobDataChange_ID\";\n\n\t/** Set IHC_JobDayaChange\t */\n\tpublic void setIHC_JobDataChange_ID (int IHC_JobDataChange_ID);\n\n\t/** Get IHC_JobDayaChange\t */\n\tpublic int getIHC_JobDataChange_ID();\n\n /** Column name IHC_JobDataChange_UU */\n public static final String COLUMNNAME_IHC_JobDataChange_UU = \"IHC_JobDataChange_UU\";\n\n\t/** Set IHC_JobDataChange_UU\t */\n\tpublic void setIHC_JobDataChange_UU (String IHC_JobDataChange_UU);\n\n\t/** Get IHC_JobDataChange_UU\t */\n\tpublic String getIHC_JobDataChange_UU();\n\n /** Column name IsActive */\n public static final String COLUMNNAME_IsActive = \"IsActive\";\n\n\t/** Set Active.\n\t * The record is active in the system\n\t */\n\tpublic void setIsActive (boolean IsActive);\n\n\t/** Get Active.\n\t * The record is active in the system\n\t */\n\tpublic boolean isActive();\n\n /** Column name IsCancelled */\n public static final String COLUMNNAME_IsCancelled = \"IsCancelled\";\n\n\t/** Set Cancelled.\n\t * The transaction was cancelled\n\t */\n\tpublic void setIsCancelled (boolean IsCancelled);\n\n\t/** Get Cancelled.\n\t * The transaction was cancelled\n\t */\n\tpublic boolean isCancelled();\n\n /** Column name NomorSK */\n public static final String COLUMNNAME_NomorSK = \"NomorSK\";\n\n\t/** Set Nomor SK\t */\n\tpublic void setNomorSK (String NomorSK);\n\n\t/** Get Nomor SK\t */\n\tpublic String getNomorSK();\n\n /** Column name NomorSK2 */\n public static final String COLUMNNAME_NomorSK2 = \"NomorSK2\";\n\n\t/** Set Nomor SK Baru\t */\n\tpublic void setNomorSK2 (String NomorSK2);\n\n\t/** Get Nomor SK Baru\t */\n\tpublic String getNomorSK2();\n\n /** Column name OriginalServiceData */\n public static final String COLUMNNAME_OriginalServiceData = \"OriginalServiceData\";\n\n\t/** Set Original Service Date\t */\n\tpublic void setOriginalServiceData (Timestamp OriginalServiceData);\n\n\t/** Get Original Service Date\t */\n\tpublic Timestamp getOriginalServiceData();\n\n /** Column name Processed */\n public static final String COLUMNNAME_Processed = \"Processed\";\n\n\t/** Set Processed.\n\t * The document has been processed\n\t */\n\tpublic void setProcessed (boolean Processed);\n\n\t/** Get Processed.\n\t * The document has been processed\n\t */\n\tpublic boolean isProcessed();\n\n /** Column name SeqNo */\n public static final String COLUMNNAME_SeqNo = \"SeqNo\";\n\n\t/** Set Sequence.\n\t * Method of ordering records;\n lowest number comes first\n\t */\n\tpublic void setSeqNo (int SeqNo);\n\n\t/** Get Sequence.\n\t * Method of ordering records;\n lowest number comes first\n\t */\n\tpublic int getSeqNo();\n\n /** Column name Updated */\n public static final String COLUMNNAME_Updated = \"Updated\";\n\n\t/** Get Updated.\n\t * Date this record was updated\n\t */\n\tpublic Timestamp getUpdated();\n\n /** Column name UpdatedBy */\n public static final String COLUMNNAME_UpdatedBy = \"UpdatedBy\";\n\n\t/** Get Updated By.\n\t * User who updated this records\n\t */\n\tpublic int getUpdatedBy();\n}" ]
[ "0.720387", "0.60612166", "0.5897073", "0.5817371", "0.58169", "0.5653088", "0.5575094", "0.5565293", "0.5523116", "0.55214834", "0.5424825", "0.5421459", "0.5377486", "0.534678", "0.5342339", "0.53190213", "0.5239825", "0.5236659", "0.5227619", "0.513109", "0.5122094", "0.5114957", "0.5110571", "0.5092275", "0.50793064", "0.50710756", "0.50666755", "0.50432736", "0.50225407", "0.5009165", "0.5007035", "0.49747992", "0.49714422", "0.49305487", "0.4928956", "0.49114767", "0.49047396", "0.4894513", "0.488628", "0.48804012", "0.48787948", "0.4848689", "0.4836264", "0.4834436", "0.48120287", "0.4810927", "0.4800393", "0.4796319", "0.4796208", "0.47960824", "0.47906667", "0.4782785", "0.47692993", "0.47681826", "0.47613847", "0.47506967", "0.4746286", "0.47449973", "0.4743577", "0.47416592", "0.47313273", "0.47236001", "0.47218567", "0.47168458", "0.47161394", "0.47148344", "0.47092924", "0.47078082", "0.4703429", "0.46990865", "0.46964943", "0.46792674", "0.4675461", "0.4675461", "0.4675461", "0.4675461", "0.4675461", "0.46668383", "0.4666713", "0.46600732", "0.46600732", "0.4655324", "0.46417722", "0.46361163", "0.46348158", "0.46313247", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.46286967", "0.4627627" ]
0.0
-1
Constructor for the c lass
public MultiThreadController(IWarehouse w, Map<IGridRobot, GridCell> map, IPathPlanner p){ this.robot2dest = map; this.warehouse = w; this.pathplanner = p; if(this.robot2dest == null || this.warehouse == null || this.pathplanner == null){ throw new IllegalArgumentException(); } this.c = new Counter<IWarehouse>(this); this.warehouse.subscribe(c); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Constructor() {\r\n\t\t \r\n\t }", "public Constructor(){\n\t\t\n\t}", "public Cgg_jur_anticipo(){}", "public Coche() {\n super();\n }", "public CyanSus() {\n\n }", "public Clade() {}", "public Cohete() {\n\n\t}", "public CSSTidier() {\n\t}", "public Chauffeur() {\r\n\t}", "public PSRelation()\n {\n }", "public Curso() {\r\n }", "public Crate(){}", "public Catelog() {\n super();\n }", "public Ctacliente() {\n\t}", "public Carrera(){\n }", "private CZ()\n {\n }", "public Ov_Chipkaart() {\n\t\t\n\t}", "public Carrinho() {\n\t\tsuper();\n\t}", "public CianetoClass() {\r\n this.cianetoMethods = new Hashtable<String, Object>();\r\n this.cianetoAttributes = new Hashtable<String, Object>();\r\n }", "public Classe() {\r\n }", "public mapper3c() { super(); }", "private TMCourse() {\n\t}", "public Cable() {\r\n }", "defaultConstructor(){}", "public ChaCha()\n\t{\n\t\tsuper();\n\t}", "public CD(){\r\n\t\t\r\n\t}", "public CD() {}", "public CTime() {\n\t\n}", "public ContasCorrentes(){\n this(0,\"\",0.0,0.0,0);\n }", "private Cat() {\n\t\t\n\t}", "public Chick() {\n\t}", "public CuerpoCeleste() {\n\t\t// Start of user code constructor for CuerpoCeleste)\n\t\tsuper();\n\t\t// End of user code\n\t}", "private void __sep__Constructors__() {}", "protected abstract void construct();", "public Lanceur() {\n\t}", "public Pasien() {\r\n }", "Composite() {\n\n\t}", "ClassC initClassC(ClassC iClassC)\n {\n iClassC.updateElementValue(\"ClassC\");\n return iClassC;\n }", "public _355() {\n\n }", "Cab(){\n\t\tSystem.out.println(\"Cab Object Constructed..\");\n\t}", "public CCuenta()\n {\n }", "private Composite() {\n }", "public Supercar() {\r\n\t\t\r\n\t}", "public CMN() {\n\t}", "private ATCres() {\r\n // prevent to instantiate this class\r\n }", "private Constructor getConstructor() throws Exception {\r\n return type.getConstructor(Contact.class, label, Format.class);\r\n }", "public ClassTemplate() {\n\t}", "public Pitonyak_09_02() {\r\n }", "public Phl() {\n }", "public Cbuilding() { }", "public c(Object obj) {\n super(1);\n this.a = obj;\n }", "public OVChipkaart() {\n\n }", "public CalccustoRequest()\r\n\t{\r\n\t}", "public AvaliacaoRisco() {\n }", "public OOP_207(){\n\n }", "a(c cVar) {\n super(0);\n this.this$0 = cVar;\n }", "public Cat(){\n\t\tsuper();\n\t}", "public CrlSeries()\n {\n super();\n }", "public b3(){\n super();\n }", "public Achterbahn() {\n }", "private Instantiation(){}", "public Libro() {\r\n }", "public Caso_de_uso () {\n }", "public contrustor(){\r\n\t}", "public AncFile() {\n }", "public Tbdtokhaihq3() {\n super();\n }", "zzcl(zzcm zzcm, Class cls) {\n super(cls);\n this.zza = zzcm;\n }", "public Customer(){\n\t \n }", "public ConStructorInheritance(){\r\n\t\t\r\n\t\tSystem.out.println(\"Parent Class Constructor\");\r\n\t\t\r\n\t\t\r\n\t}", "public TCubico(){}", "public Corso() {\n\n }", "public AntrianPasien() {\r\n\r\n }", "protected IPCGCallDetailCreator()\r\n {\r\n // empty\r\n }", "public ctq(File paramFile, String paramString, oa paramoa, ckh paramckh)\r\n/* 22: */ {\r\n/* 23: 33 */ super(paramoa);\r\n/* 24: 34 */ this.i = paramFile;\r\n/* 25: 35 */ this.j = paramString;\r\n/* 26: 36 */ this.k = paramckh;\r\n/* 27: */ }", "public MonHoc() {\n }", "public HLCPaymentDetails() { }", "public Excellon ()\n {}", "b(c cVar) {\n super(0);\n this.this$0 = cVar;\n }", "public Soil()\n\t{\n\n\t}", "public Corrida(){\n\n }", "public Anschrift() {\r\n }", "public Zjcclims() {\n\t\tsuper();\n\t}", "public MetricCalculator(JavaClass jc){\r\n\t\tjavaclass = jc;\r\n\t\tmccabe = new McCabeCyclomaticComplexity(jc);\r\n\t\tinherit = new Inheritance(jc);\r\n\t\tclassStat = new ClassStatistic(jc);\r\n\t\tresponseFC = new ResponseForClass(jc);\r\n\t}", "public Course() {\n\n\t}", "public Chant(){}", "public ControlClass(String expID){\r\n \tinitialize(expID,null,null,null); \t\r\n }", "public Car(){\n\t\t\n\t}", "public Demo3() {}", "c(a aVar) {\n super(0);\n this.this$0 = aVar;\n }", "public Alojamiento() {\r\n\t}", "public CircleCADTool() {\r\n }", "public Competence() {\r\n\t\tsuper();\r\n\t}", "public TTau() {}", "public BacInfo() {\n }", "public Complex(){\r\n\t this(0,0);\r\n\t}", "Customer() \n\t{\n\t}", "private SingleObject()\r\n {\r\n }", "public CasterSite() {\n\t}", "private HSBC() {\n\t\t\n\t\t\n\t}", "public Basic() {}", "public Orbiter() {\n }" ]
[ "0.8074113", "0.78651935", "0.75311315", "0.75268525", "0.73410815", "0.72299063", "0.7089077", "0.7079425", "0.70634925", "0.7044512", "0.6971069", "0.6961904", "0.6924417", "0.6906384", "0.6881015", "0.6878406", "0.68781674", "0.6876841", "0.6872309", "0.6868231", "0.68489605", "0.6840209", "0.6830693", "0.68243074", "0.68213314", "0.6784166", "0.67766225", "0.67749447", "0.67740387", "0.67693645", "0.6737937", "0.67369735", "0.67293054", "0.67243177", "0.6711724", "0.670485", "0.6703693", "0.6686607", "0.66811484", "0.666334", "0.663632", "0.6630097", "0.6627732", "0.65945923", "0.6594227", "0.6583617", "0.65750927", "0.65734386", "0.65671784", "0.65585047", "0.65562725", "0.65486354", "0.6542724", "0.6537601", "0.65270376", "0.65227413", "0.6515895", "0.65142363", "0.65106875", "0.6507065", "0.65008277", "0.65008", "0.64906806", "0.6487641", "0.64860773", "0.6481058", "0.64758223", "0.6475118", "0.64688027", "0.646821", "0.6465427", "0.64569575", "0.6451679", "0.6446654", "0.64393246", "0.6438241", "0.64380825", "0.6436191", "0.64346176", "0.6428733", "0.64285547", "0.64279354", "0.6425517", "0.64243776", "0.64235204", "0.6417237", "0.64111006", "0.6402858", "0.63951004", "0.63865036", "0.63853925", "0.6377051", "0.6375954", "0.63606614", "0.6359588", "0.6347207", "0.63449615", "0.6344791", "0.63420933", "0.6341781", "0.6341701" ]
0.0
-1
Moves all robots to their destinations and returns the number of total steps taken
public int startMoving() throws RobotCrashException{ //holds direction to step in Direction direction; //holds the robot about to move IGridRobot robot; //holds the return of pathplanner Entry<IGridRobot, Direction> toMove; //The task that will be run in a new thread Task runnable; //Pool of threads ExecutorService es = new ScheduledThreadPoolExecutor(this.robot2dest.size()); //Holds the gridcell a robot is about to step to GridCell newCell; //A map of currently moving robots Map<IGridRobot, Direction> movingBots; int steps = 0; //Keep moving robots until the number that reached the destination //is equal to the number of robots we are moving while(this.c.getCount() < this.robot2dest.size()){ toMove = this.pathplanner.nextStep(this.warehouse, this.robot2dest); if(toMove != null){ robot = toMove.getKey(); direction = toMove.getValue(); newCell = GridRobot.oneCellOver(robot.getLocation(), direction); //Check if the robot is about to crash into another robot for(IGridRobot r : this.robot2dest.keySet()){ if(newCell.equals(r.getLocation())){ throw new RobotCrashException(); } } //Check if they are stepping onto where another robot is stepping movingBots = warehouse.getRobotsInMotion(); for(IGridRobot r : movingBots.keySet()){ if(GridRobot.oneCellOver(r.getLocation(), movingBots.get(r)).equals(newCell)){ throw new RobotCrashException(); } } //Move the robot in a new thread this.warehouse.addMovingRobot(robot, direction); steps++; runnable = new Task(robot, direction); CompletableFuture.runAsync(runnable, es); } } return steps; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int totalSteps() {\n return moves.size();\n }", "private void StepForRobot() { \r\n\r\n\t\tIterator<Robot> itr = rob.iterator();\r\n\t\twhile(itr.hasNext()) {\r\n\r\n\t\t\tRobot r = itr.next();\r\n\t\t\tFruit fDest = null;\r\n\t\t\tdouble maxSum = 0;\r\n\t\t\tnode_data v = null;\r\n\t\t\tIterator<Fruit> it = fru.iterator();\r\n\t\t\twhile(it.hasNext()) {\r\n\r\n\r\n\t\t\t\tFruit f = it.next();\r\n\t\t\t\tdouble sum =0;\r\n\t\t\t\tint dest = f.e.getSrc();\r\n\t\t\t\tList<node_data> list = Algo.shortestPath(r.src, dest);\r\n\t\t\t\tlist.add(dgraph.getNode(f.e.getDest()));\r\n\r\n\r\n\r\n\t\t\t\tfor(int i = 0;i<list.size()-1;i++)\r\n\t\t\t\t\tsum += dgraph.getEdge(list.get(i).getKey(), list.get(i+1).getKey()).getWeight();\r\n\t\t\t\tsum = f.getValue() / sum;\r\n\r\n\t\t\t\tif(sum > maxSum && !f.isDest) {\r\n\r\n\r\n\t\t\t\t\tmaxSum = sum;\r\n\t\t\t\t\tv = list.get(1); \r\n\t\t\t\t\tfDest = f;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(fDest != null) {\r\n\r\n\r\n\r\n\t\t\t\tfDest.setDest(true);\r\n\t\t\t\tgame.chooseNextEdge(r.id, v.getKey());\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}", "void move(int steps);", "int movesMade() {\n return _moves.size();\n }", "public int TakeStep()\n\t\t{\n\t\t// the eventual movement command is placed here\n\t\tVec2\tresult = new Vec2(0,0);\n\n\t\t// get the current time for timestamps\n\t\tlong\tcurr_time = abstract_robot.getTime();\n\n\n\t\t/*--- Get some sensor data ---*/\n\t\t// get vector to the ball\n\t\tVec2 ball = abstract_robot.getBall(curr_time);\n\n\t\t// get vector to our and their goal\n\t\tVec2 ourgoal = abstract_robot.getOurGoal(curr_time);\n\t\tVec2 theirgoal = abstract_robot.getOpponentsGoal(curr_time);\n\n\t\t// get a list of the positions of our teammates\n\t\tVec2[] teammates = abstract_robot.getTeammates(curr_time);\n\n\t\t// find the closest teammate\n\t\tVec2 closestteammate = new Vec2(99999,0);\n\t\tfor (int i=0; i< teammates.length; i++)\n\t\t\t{\n\t\t\tif (teammates[i].r < closestteammate.r)\n\t\t\t\tclosestteammate = teammates[i];\n\t\t\t}\n\n\n\t\t/*--- now compute some strategic places to go ---*/\n\t\t// compute a point one robot radius\n\t\t// behind the ball.\n\t\tVec2 kickspot = new Vec2(ball.x, ball.y);\n\t\tkickspot.sub(theirgoal);\n\t\tkickspot.setr(abstract_robot.RADIUS);\n\t\tkickspot.add(ball);\n\n\t\t// compute a point three robot radii\n\t\t// behind the ball.\n\t\tVec2 backspot = new Vec2(ball.x, ball.y);\n\t\tbackspot.sub(theirgoal);\n\t\tbackspot.setr(abstract_robot.RADIUS*5);\n\t\tbackspot.add(ball);\n\n\t\t// compute a north and south spot\n\t\tVec2 northspot = new Vec2(backspot.x,backspot.y+0.7);\n\t\tVec2 southspot = new Vec2(backspot.x,backspot.y-0.7);\n\n\t\t// compute a position between the ball and defended goal\n\t\tVec2 goaliepos = new Vec2(ourgoal.x + ball.x,\n\t\t\t\tourgoal.y + ball.y);\n\t\tgoaliepos.setr(goaliepos.r*0.5);\n\n\t\t// a direction away from the closest teammate.\n\t\tVec2 awayfromclosest = new Vec2(closestteammate.x,\n\t\t\t\tclosestteammate.y);\n\t\tawayfromclosest.sett(awayfromclosest.t + Math.PI);\n\n\n\t\t/*--- go to one of the places depending on player num ---*/\n\t\tint mynum = abstract_robot.getPlayerNumber(curr_time);\n\n\t\t/*--- Goalie ---*/\n\t\tif (mynum == 0)\n\t\t\t{\n\t\t\t// go to the goalie position if far from the ball\n\t\t\tif (ball.r > 0.5) \n\t\t\t\tresult = goaliepos;\n\t\t\t// otherwise go to kick it\n\t\t\telse if (ball.r > 0.1) \n\t\t\t\tresult = kickspot;\n\t\t\telse \n\t\t\t\tresult = ball;\n\t\t\t// keep away from others\n\t\t\tif (closestteammate.r < 0.3)\n\t\t\t\t{\n\t\t\t\tresult = awayfromclosest;\n\t\t\t\t}\n\t\t\t}\n\n\t\t/*--- midback ---*/\n\t\telse if (mynum == 1)\n\t\t\t{\n\t\t\t// go to a midback position if far from the ball\n\t\t\tif (ball.r > 0.5) \n\t\t\t\tresult = backspot;\n\t\t\t// otherwise go to kick it\n\t\t\telse if (ball.r > 0.30) \n\t\t\t\tresult = kickspot;\n\t\t\telse \n\t\t\t\tresult = ball;\n\t\t\t// keep away from others\n\t\t\tif (closestteammate.r < 0.3)\n\t\t\t\t{\n\t\t\t\tresult = awayfromclosest;\n\t\t\t\t}\n\t\t\t}\n\n\t\telse if (mynum == 2)\n\t\t\t{\n\t\t\t// go to a the northspot position if far from the ball\n\t\t\tif (ball.r > 0.5) \n\t\t\t\tresult = northspot;\n\t\t\t// otherwise go to kick it\n\t\t\telse if (ball.r > 0.30) \n\t\t\t\tresult = kickspot;\n\t\t\telse \n\t\t\t\tresult = ball;\n\t\t\t// keep away from others\n\t\t\tif (closestteammate.r < 0.3)\n\t\t\t\t{\n\t\t\t\tresult = awayfromclosest;\n\t\t\t\t}\n\t\t\t}\n\n\t\telse if (mynum == 4)\n\t\t\t{\n\t\t\t// go to a the northspot position if far from the ball\n\t\t\tif (ball.r > 0.5) \n\t\t\t\tresult = southspot;\n\t\t\t// otherwise go to kick it\n\t\t\telse if (ball.r > 0.3 )\n\t\t\t\tresult = kickspot;\n\t\t\telse \n\t\t\t\tresult = ball;\n\t\t\t// keep away from others\n\t\t\tif (closestteammate.r < 0.3)\n\t\t\t\t{\n\t\t\t\tresult = awayfromclosest;\n\t\t\t\t}\n\t\t\t}\n\n\t\t/*---Lead Forward ---*/\n\t\telse if (mynum == 3)\n\t\t\t{\n\t\t\t// if we are more than 4cm away from the ball\n\t\t\tif (ball.r > .3)\n\t\t\t\t// go to a good kicking position\n\t\t\t\tresult = kickspot;\n\t\t\telse\n\t\t\t\t// go to the ball\n\t\t\t\tresult = ball;\n\t\t\t}\n\n\n\t\t/*--- Send commands to actuators ---*/\n\t\t// set the heading\n\t\tabstract_robot.setSteerHeading(curr_time, result.t);\n\n\t\t// set speed at maximum\n\t\tabstract_robot.setSpeed(curr_time, 1.0);\n\n\t\t// kick it if we can\n\t\tif (abstract_robot.canKick(curr_time))\n\t\t\tabstract_robot.kick(curr_time);\n\n\t\t/*--- Send message to other robot ---*/\n\t\t// COMMUNICATION\n\t\t// if I can kick\n\t\tif (abstract_robot.canKick(curr_time))\n\t\t\t{\n\t\t\t// and I am robot #3\n\t\t\tif ((mynum==3))\n\t\t\t\t{\n\t\t\t\t// construct a message\n\t\t\t\tStringMessage m = new StringMessage();\n\t\t\t\tm.val = (new Integer(mynum)).toString();\n\t\t\t\tm.val = m.val.concat(\" can kick\");\n\n\t\t\t\t// send the message to robot 2\n\t\t\t\t// note: broadcast and multicast are also\n\t\t\t\t// available.\n\t\t\t\ttry{abstract_robot.unicast(2,m);}\n\t\t\t\tcatch(CommunicationException e){}\n\t\t\t\t}\n\t\t\t}\n\n\t\t/*--- Look for incoming messages ---*/\n\t\t//COMMUNICATION\n\t\twhile (messagesin.hasMoreElements())\n\t\t\t{\n\t\t\tStringMessage recvd = \n\t\t\t\t(StringMessage)messagesin.nextElement();\n\t\t\tSystem.out.println(mynum + \" received:\\n\" + recvd);\n\t\t\t}\n\n\t\t// tell the parent we're OK\n\t\treturn(CSSTAT_OK);\n\t\t}", "public int getNumMoving() {\n int numMoving = 0;\n for (BaseSingle single : aliveTroopsMap.keySet()) {\n if (single.getState() == SingleState.MOVING ||\n single.getState() == SingleState.CATCHING_UP ||\n single.getState() == SingleState.ROUTING) {\n numMoving += 1;\n }\n }\n return numMoving;\n }", "int simulateAnts() {\r\n\t\tint k;\r\n\t\tint moving = 0;\r\n\r\n\t\tfor (k = 0; k < ants.length; k++) {\r\n\t\t\t\r\n\t\t\tAnt ant = ants[k];\r\n\t\t\t\r\n\t\t\t// ensure this ant still has cities to visit\r\n\t\t\tif (ant.pathIndex < cities.length) {\r\n\t\t\t\tant.nextCity = selectNextCity(ant);\r\n\t\t\t\tant.tabu[ant.nextCity] = 1;\r\n\t\t\t\tant.path[ant.pathIndex++] = ant.nextCity;\r\n\t\t\t\tant.tourLength += distance[ant.curCity][ant.nextCity];\r\n\r\n\t\t\t\t// Handle the final case (last city to first)\r\n\t\t\t\tif (ant.pathIndex == cities.length) {\r\n\t\t\t\t\tant.tourLength += distance[ant.path[cities.length - 1]][ant.path[0]];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tant.curCity = ant.nextCity;\r\n\r\n\t\t\t\tmoving++;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn moving;\r\n\t}", "public void moveAllRobotsOneStep(Map<IGridRobot, GridCell> robot2dest){\n\t\t// If the passed map were contained GridRobots, we could count the longest delay and sleep this thread\n\t\t// But I'm not doing it to stay consistent with all the other methods (and to stay flexible)\n\t\t// This requires the tests to sleep themselves\n\t\t//long longestDelay = 0;\n\t\tPathPlanner planner = new PathPlanner();\n\t\tfor (Map.Entry<IGridRobot, GridCell> entry: robot2dest.entrySet()){\n\t\t\tEntry<IGridRobot, Direction> dir = planner.nextStepOneRobot(this, entry);\n\t\t\tif (dir != null){\n\t\t\t\tdir.getKey().step(dir.getValue());\n\t\t\t}\n\t\t}\n\t}", "public int getNumberOfMoves();", "public int moves() {\n return solution.size() - 1;\n }", "public int pacmanMoves(List<Integer> target){\n int numOfmoves = 0;\n //counts the steps to get to the target\n for(int i=target.get(0);i>0;i--){\n numOfmoves++;\n }\n for(int i=target.get(1);i>0;i--){\n numOfmoves++;\n }\n return numOfmoves;\n }", "public void incrementNumMoves() {\n\t\tthis.moveMade = true;\n\t\tthis.numMoves++;\n\t}", "public int numberOfSteps() {\t\r\n\t\treturn steps.size();\r\n\t}", "public void move() {\r\n\t\tmoveCount++;\r\n\t}", "@Override\n\tprotected boolean moveRobot(boolean printEachStep) {\n\t\tboolean move=true;\n\t\tint incOrDecR = destRow > curRow ? 1 : -1, \n\t\t\tincOrDecC = destCol > curCol ? 1 : -1, \n\t\t\tcount = diagonalCount();\n\t\t\t// Move diagonally as close to the destination it can get to\n\t\t\tfor(int i=0; i<count; ++i) {\n\t\t\t\tif(move=grid.moveFromTo(this, curRow, curCol, \n\t\t\t\t\t\tblockedRow=curRow+incOrDecR, \n\t\t\t\t\t\tblockedCol=curCol+incOrDecC)) { \n\t\t\t\t\tcurRow+=incOrDecR; \n\t\t\t\t\tcurCol+=incOrDecC;\n\t\t\t\t\t--energyUnits;\n\t\t\t\t\tif(printEachStep)\n\t\t\t\t\t\tgrid.printGrid();\n\t\t\t\t} else {\n\t\t\t\t\treturn move; \n\t\t\t\t}\n\t\t\t}\n\t\tmove=super.moveRobot(printEachStep);\n\t\treturn move;\n\t}", "public int moves() {\n\t\tif (!isSolvable())\n\t\t\treturn -1;\n\t\telse\n\t\t\treturn result.size() - 1;\n\t}", "public int moves() {\n return goal == null ? -1 : goal.numMoves;\n }", "public int moves()\n {\n return numberOfMoves;\n }", "public int moves() {\n\n return initialSolvable ? solutionNode.numberOfMovesMade : -1;\n }", "public int moves() {\n\t\tif (goal == null)\n\t\t\treturn -1;\n\t\telse\n\t\t\treturn goal.moves;\n\t}", "public int getNumMoves() {\n\t\treturn numMoves;\n\t}", "public int moves() {\r\n if (solution != null) {\r\n return solution.size() - 1;\r\n } else {\r\n return -1;\r\n }\r\n }", "public void moveAll()\n\t{\n\t\tmoveOutput = \"\";\n\t\tfor (int i = 0; i < 20; i++)\n\t\t{\n\t\t\tif (river[i] != null)\n\t\t\t{\n\t\t\t\triver[i].move(i);\n\t\t\t}\n\t\t}\n\t}", "public int moves()\n {\n\n if (goalNode!=null && goalNode.board.isGoal()){\n return goalNode.moves;\n }\n return -1;\n }", "public int getNumberOfMoves() {\r\n return numberOfMoves;\r\n }", "int moveCount() {\r\n return _moveCount;\r\n }", "public void incrementMoves()\n {\n moves ++;\n }", "@Test\n\t\t\tpublic void testTargetsFourSteps() {\n\t\t\t\t//Using random walkway space\n\t\t\t\tboard.calcTargets(5, 18, 3);\n\t\t\t\tSet<BoardCell> targets= board.getTargets();\n\t\t\t\tboard.clearTargets();\n\t\t\t\tassertEquals(10, targets.size());\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(5, 21)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(6, 20)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(4, 20)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(5, 19)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(3, 17)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(6, 16)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(4, 16)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(5, 17)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(4, 18)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(6, 18)));\n\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t}", "public int moves() {\r\n if (!isSolvable) return -1;\r\n return goal.previousMoves;\r\n }", "abstract int steps();", "@Test\n\t\t\tpublic void testTargetsThreeSteps() {\n\t\t\t\t//Using walkway space that will go near a door with the wrong direction\n\t\t\t\tboard.calcTargets(8, 16, 2);\n\t\t\t\tSet<BoardCell> targets= board.getTargets();\n\t\t\t\tboard.clearTargets();\n\t\t\t\tassertEquals(4, targets.size());\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(6, 16)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(10, 16)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(7, 15)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(9, 15)));\n\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t}", "public int moves() {\n if (!isSolvable()) return -1;\n return realMoves;\n }", "public int length() {\n return steps.size();\n }", "@Override\n public void calculateMove() {\n int xa = 0, ya = 0;\n if (steps <= 0) {\n direction = ep.calculateDirection();\n steps = MAX_STEPS;\n }\n if (direction == 0) {\n ya--;\n }\n if (direction == 2) {\n ya++;\n }\n if (direction == 3) {\n xa--;\n }\n if (direction == 1) {\n xa++;\n }\n if (canMove(xa, ya)) {\n steps -= 1 + rest;\n move(xa * speed, ya * speed);\n moving = true;\n } else {\n steps = 0;\n moving = false;\n }\n }", "public void updateMoves(){\r\n\t\tthis.moves = getMoves() + 1;\r\n\t}", "@Test\r\n\tpublic void testTargetsFourSteps() {\r\n\t\tboard.calcTargets(24, 0, 4);\r\n\t\tSet<BoardCell> targets= board.getTargets();\r\n\t\tassertEquals(4, targets.size());\r\n\t\tassertTrue(targets.contains(board.getCellAt(24, 4)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(23, 3)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(24, 2)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(23, 1)));\r\n\t\t\r\n\t\tboard.calcTargets(0, 20, 4);\r\n\t\ttargets = board.getTargets();\r\n\t\tassertEquals(4, targets.size());\r\n\t\tassertTrue(targets.contains(board.getCellAt(1, 19)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(2, 20)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(3, 19)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(4, 20)));\r\n\t\t\r\n\t\t// Includes a path that doesn't have enough length plus one door\r\n\t\tboard.calcTargets(9, 0, 4);\r\n\t\ttargets= board.getTargets();\r\n\t\tassertEquals(8, targets.size());\r\n\t\tassertTrue(targets.contains(board.getCellAt(9, 4)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(9, 2)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(10, 3)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(10, 1)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(11, 2)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(12, 1)));\t\r\n\t\tassertTrue(targets.contains(board.getCellAt(8, 2)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(11, 0)));\t\r\n\t}", "@Test\n\tpublic void testGetPathLength() {\n\t\tController control = new Controller();\n\t\tBasicRobot robot = new BasicRobot();\n\t\tExplorer explorer = new Explorer();\n\t\tcontrol.setBuilder(Order.Builder.DFS);\n\t\tcontrol.setRobotAndDriver(robot, explorer);\n\t\trobot.setMaze(control);\n\t\tcontrol.turnOffGraphics();\n\t\tcontrol.setSkillLevel(0);\n\t\tcontrol.switchFromTitleToGenerating(0);\n\t\tcontrol.waitForPlayingState();\n\t\texplorer.setRobot(robot);\n\t\tassertTrue(explorer.getPathLength() == 0);\n\t\t// moving the robot one unit and checking the odometer\n\t\tif(robot.distanceToObstacle(Direction.FORWARD) > 0) {\n\t\t\trobot.move(1, false);\n\t\t\tassertTrue(explorer.getPathLength() == 1);\n\t\t}\n\t\telse if(robot.distanceToObstacle(Direction.RIGHT) > 0) {\n\t\t\trobot.rotate(Turn.RIGHT);\n\t\t\trobot.move(1, false);\n\t\t\tassertTrue(explorer.getPathLength() == 1);\n\t\t}\n\t\telse if(robot.distanceToObstacle(Direction.LEFT) > 0) {\n\t\t\trobot.rotate(Turn.LEFT);\n\t\t\trobot.move(1, false);\n\t\t\tassertTrue(explorer.getPathLength() == 1);\n\t\t}\n\t\telse if(robot.distanceToObstacle(Direction.BACKWARD) > 0) {\n\t\t\trobot.rotate(Turn.AROUND);\n\t\t\trobot.move(1, false);\n\t\t\tassertTrue(explorer.getPathLength() == 1);\n\t\t}\n\t\tassertTrue(explorer.getPathLength() > 0);\n\t\t\n\t\t// moving the robot again to get a reading of 2\n\t\tif(robot.distanceToObstacle(Direction.FORWARD) > 0) {\n\t\t\trobot.move(1, false);\n\t\t\tassertTrue(explorer.getPathLength() == 2);\n\t\t}\n\t\telse if(robot.distanceToObstacle(Direction.RIGHT) > 0) {\n\t\t\trobot.rotate(Turn.RIGHT);\n\t\t\trobot.move(1, false);\n\t\t\tassertTrue(explorer.getPathLength() == 2);\n\t\t}\n\t\telse if(robot.distanceToObstacle(Direction.LEFT) > 0) {\n\t\t\trobot.rotate(Turn.LEFT);\n\t\t\trobot.move(1, false);\n\t\t\tassertTrue(explorer.getPathLength() == 2);\n\t\t}\n\t\telse if(robot.distanceToObstacle(Direction.BACKWARD) > 0) {\n\t\t\trobot.rotate(Turn.AROUND);\n\t\t\trobot.move(1, false);\n\t\t\tassertTrue(explorer.getPathLength() == 2);\n\t\t}\n\t\t\n\t\t\n\t\t// moving the robot a third time to make sure that the odometer is updating correctly\n\t\tif(robot.distanceToObstacle(Direction.FORWARD) > 0) {\n\t\t\trobot.move(1, false);\n\t\t\tassertTrue(explorer.getPathLength() == 3);\n\t\t}\n\t\telse if(robot.distanceToObstacle(Direction.RIGHT) > 0) {\n\t\t\trobot.rotate(Turn.RIGHT);\n\t\t\trobot.move(1, false);\n\t\t\tassertTrue(explorer.getPathLength() == 3);\n\t\t}\n\t\telse if(robot.distanceToObstacle(Direction.LEFT) > 0) {\n\t\t\trobot.rotate(Turn.LEFT);\n\t\t\trobot.move(1, false);\n\t\t\tassertTrue(explorer.getPathLength() == 3);\n\t\t}\n\t\telse if(robot.distanceToObstacle(Direction.BACKWARD) > 0) {\n\t\t\trobot.rotate(Turn.AROUND);\n\t\t\trobot.move(1, false);\n\t\t\tassertTrue(explorer.getPathLength() == 3);\n\t\t}\n\t}", "public int getMoveCount() {\r\n\t\treturn moveCount;\r\n\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 }", "public int moves() {\n return isSolvable() ? finalMove.moves : -1;\n }", "private void moveRobots() {\n\t\tfor(Player p : playerList) {\n\t\t\tif(p.getType() == Player.PlayerType.Robot) {\n\t\t\t\tPoint old = new Point(p.getX(), p.getY());\n\t\t\t\tPoint newPoint = new Point(p.getX(), p.getY());\n\t\t\t\t\n\t\t\t\toccupiedPositions.remove(old);\n\t\t\t\t\n\t\t\t\tint playerX = p.getPlayerToFollow().getX();\n\t\t\t\tint playerY = p.getPlayerToFollow().getY();\n\t\t\t\t\n\t\t\t\t//move towards the agent\n\t\t\t\tif(p.getX() < playerX)\n\t\t\t\t\tnewPoint.x += 1;\n\t\t\t\telse if(p.getX() > playerX)\n\t\t\t\t\tnewPoint.x -= 1;\n\t\t\t\t\n\t\t\t\tif(p.getY() < playerY)\n\t\t\t\t\tnewPoint.y += 1;\n\t\t\t\telse if(p.getY() > playerY)\n\t\t\t\t\tnewPoint.y -= 1;\n\t\t\t\t\n\t\t\t\tp.setPosition(newPoint);\n\t\t\t\t\n\t\t\t\t//check if the robot has moved on to something\n\t\t\t\tif(occupiedPositions.contains(newPoint)) { \t\t// check if the position is occupied\n\t\t\t\t\tfor(Player p2 : playerList) { \t\t\t\n\t\t\t\t\t\tif(!p.getName().equals(p2.getName())) {\t// check so it not is the robot itself\n\t\t\t\t\t\t\tif(newPoint.equals(p2.getPosition())) {\n\t\t\t\t\t\t\t\tif(p2.getType() == PlayerType.Robot) { // if it is a robot, both should be rubble\n\t\t\t\t\t\t\t\t\tp2.setType(PlayerType.Rubble);\n\t\t\t\t\t\t\t\t\tp2.getPlayerToFollow().decreaseRobotsFollowing();\n\t\t\t\t\t\t\t\t\tp.setType(PlayerType.Rubble);\n\t\t\t\t\t\t\t\t\tp.getPlayerToFollow().decreaseRobotsFollowing();\n\t\t\t\t\t\t\t\t\tHandleCommunication.broadcastToClient(null, server.getConnectedClientList(), SendSetting.ChangedType, p.getName(), p2.getName());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(p2.getType() == PlayerType.Rubble) { // if it is rubble\n\t\t\t\t\t\t\t\t\tp.setType(PlayerType.Rubble);\n\t\t\t\t\t\t\t\t\tp.getPlayerToFollow().decreaseRobotsFollowing();\n\t\t\t\t\t\t\t\t\tHandleCommunication.broadcastToClient(null, server.getConnectedClientList(), SendSetting.ChangedType, p.getName(), p2.getName());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if(p2.getType() == PlayerType.Agent) {\n\t\t\t\t\t\t\t\t\tString send = generateSendableHighscoreList();\n\t\t\t\t\t\t\t\t\tserver.sendMessageToClient(p2.getName(), \"@132@\" + highscore.size() + \"@\" + send);\n\t\t\t\t\t\t\t\t\tserver.addTextToLoggingWindow(\"Robot killed player (\" + p2.getName() + \")\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\toccupiedPositions.add(newPoint);\n\t\t\t\tserver.broadcastToClient(p.getName(), SendSetting.PlayerMoved, old, newPoint);\n\t\t\t}\t\n\t\t}\n\t\t\n\t\t//send that it is agents turn again\n\t\tserver.broadcastToClient(null, SendSetting.AgentsTurnToMove, null, null);\n\t}", "public int getMoveCount() {\r\n return this.moveCount;\r\n }", "@Test\n\t\t\tpublic void testTargetOneStep()\n\t\t\t{\n\t\t\t\t//Test one step and check for the right space\n\t\t\t\tboard.calcTargets(0, 7, 1);\n\t\t\t\tSet<BoardCell> targets= board.getTargets();\n\t\t\t\tboard.clearTargets();\n\t\t\t\tassertEquals(1, targets.size());\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(1, 7)));\n\n\t\t\t\t// Test one step near a door with the incorrect direction\n\t\t\t\tboard.calcTargets(13, 6, 1);\n\t\t\t\ttargets= board.getTargets();\n\t\t\t\tboard.clearTargets();\n\t\t\t\tassertEquals(3, targets.size());\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(14, 6)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(13, 5)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(13, 7)));\n\t\t\t\t\n\t\t\t\t\n\t\t\t}", "public int getMoveCount() {\n\t\treturn moveCount;\n\t}", "int stepsToGo();", "public int moves() {\n if (isSolvable())\n return _moves;\n else\n return -1;\n }", "public int moves() {\n \tif (!isSolvable) return -1;\n \treturn solutionNode.getMoves();\n }", "public int moves() {\n return moves;\n }", "public int moves() {\n return moves;\n }", "public int ghostMoves(List<Integer> pacmanLocaytarget, List<Integer> ghostLocay){\n int numOfmoves = 0;\n //counts the steps to get to the target\n for(int i=ghostLocay.get(0);i>pacmanLocaytarget.get(0);i--){\n numOfmoves++;\n }\n for(int i=ghostLocay.get(1);i>pacmanLocaytarget.get(1);i--){\n numOfmoves++;\n }\n return numOfmoves;\n\n }", "protected int[] calculateNumAttackingEnemyDirs() throws GameActionException {\n if (cachedNumAttackingEnemyDirs == null) {\n cachedNumAttackingEnemyDirs = new int[9];\n RobotInfo[] visibleEnemies = Cache.getEngagementEnemies();\n for (int i = visibleEnemies.length; i-- > 0;) {\n MapLocation enemyLoc = visibleEnemies[i].location;\n int[] attackedDirs = Util.ATTACK_NOTES[Util.RANGE_TYPE_MAP[visibleEnemies[i].type.ordinal()]][5 + enemyLoc.x - curLoc.x][5 + enemyLoc.y - curLoc.y];\n for (int j = attackedDirs.length; j-- > 0;) {\n cachedNumAttackingEnemyDirs[attackedDirs[j]]++;\n }\n }\n }\n return cachedNumAttackingEnemyDirs;\n }", "@Test\n\tpublic void testStep() {\n\t\tsimulator.step();\n\t\tassertEquals(0, (int)simulator.averageWaitTime());\n\t\tassertEquals(0, (int)simulator.averageProcessTime());\n\t\tassertEquals(false, simulator.packageLeftSimulation());\n\t\tassertEquals(0, simulator.getCurrentIndex());\n\t\tassertEquals(true, simulator.moreSteps());\n\n\t\tfor (int i = 0; i < 28; i++) {\n\t\t\tsimulator.step();\n\t\t}\n\t\tassertEquals(287, (int)(simulator.averageWaitTime() * 100));\n\t\tassertEquals(1525, (int)(100 * simulator.averageProcessTime()));\n\t\tassertEquals(false, simulator.packageLeftSimulation());\n\t\tassertEquals(0, simulator.getCurrentIndex());\n\t\tassertEquals(true, simulator.moreSteps());\n\t\t\n\t\tfor (int i = 0; i < 15; i++) {\n\t\t\tsimulator.step();\n\t\t}\n\t\tassertEquals(614, (int)(simulator.averageWaitTime() * 100));\n\t\tassertEquals(1457, (int)(100 * simulator.averageProcessTime()));\n\t\tassertEquals(true, simulator.packageLeftSimulation());\n\t\tassertEquals(0, simulator.getCurrentIndex());\n\t\tassertEquals(true, simulator.moreSteps());\n\t\tfor (int i = 0; i < 16; i++) {\n\t\t\tsimulator.step();\n\t\t}\n\t\tassertEquals(false, simulator.moreSteps());\t\n\t}", "protected void execute() {\n \tRobot.drive.driveWithTarget(target);\n \tSmartDashboard.putNumber(\"Desired target\", target);\n \tSmartDashboard.putNumber(\"current left position\", Robot.drive.left.motor1.getSelectedSensorPosition(0));\n \tSmartDashboard.putNumber(\"current right position\", Robot.drive.right.motor1.getSelectedSensorPosition(0));\n \tSmartDashboard.putNumber(\"Left sped\", Robot.drive.left.motor1.getSelectedSensorVelocity(0));\n \tSmartDashboard.putNumber(\"count\", count);\n \tif (Math.abs(target - Robot.drive.left.getEncoderTicks()) < tolerance) {\n \t\tcount++;\n \t}\n }", "public void moveObjsToGoals() {\n\t\tMap<Integer, MovingFObject> map = sc.getInitPos();\r\n\t\tfor(int i = 0; i < map.size(); i++) {\r\n\t\t\tMovingFObject temp = map.get(i);\r\n\t\t\tsc.moveAtVelAtTimeToLoc(i, sc.getMaxVelocity(), 0, (Location)temp.getGoal());\r\n\t\t}\r\n\t}", "void moveVehicles() {\n for (int i = roads.size() - 1; i >= 0; i--) {\n roads.get(i).moveVehicles();\n checkTurns(i);\n\n\n }\n\n }", "public int countSteps(List<Step> steps) {\n return strategy.countSteps(steps);\n }", "@Test\n\t\t\tpublic void testTargetsTwoSteps() {\n\t\t\t\t//Length of 2\n\t\t\t\tboard.calcTargets(8, 16, 2);\n\t\t\t\tSet<BoardCell> targets= board.getTargets();\n\t\t\t\tboard.clearTargets();\n\t\t\t\tassertEquals(4, targets.size());\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(6, 16)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(10, 16)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(7, 15)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(9, 15)));\n\t\t\t\t//Length of 2\n\t\t\t\tboard.calcTargets(15, 15, 2);\n\t\t\t\ttargets= board.getTargets();\n\t\t\t\tboard.clearTargets();\n\t\t\t\tassertEquals(4, targets.size());\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(13, 15)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(17, 15)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(14, 16)));\n\t\t\t\tassertTrue(targets.contains(board.getCellAt(15, 17)));\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t}", "private static int countPathsRecursion(int steps) {\n\n if (steps < 0)\n return 0;\n else if (steps == 0)\n return 1;\n\n return countPathsRecursion(steps - 1) + countPathsRecursion(steps - 2) + countPathsRecursion(steps - 3);\n\n\n }", "@Override\n\tpublic boolean drive2Exit() throws Exception {\n\t\tint[][] timesVisited = new int[width][height];\n\t\tfor (int i = 0; i < timesVisited.length; i++) {\n\t\t\tfor (int j = 0; j < timesVisited[0].length; j++) {\n\t\t\t\ttimesVisited[i][j] = 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\twhile (robot.isAtExit() == false) {\n\t\t\t/* start a list of potential positions to move to. */\n\t\t\tLinkedList<CardinalDirectionNumVisitsPair> possibleDirections = new LinkedList<CardinalDirectionNumVisitsPair>();\n\t\t\t\n\t\t\t/* get the directions and number of visits to all accessible adjacent spaces. */\n\t\t\tint robotX = robot.getCurrentPosition()[0];\n\t\t\tint robotY = robot.getCurrentPosition()[1];\n\t\t\taddCardinalDirectionNumVisitsPairIfValid(robotX + 1, robotY, CardinalDirection.East, possibleDirections, timesVisited);\n\t\t\taddCardinalDirectionNumVisitsPairIfValid(robotX - 1, robotY, CardinalDirection.West, possibleDirections, timesVisited);\n\t\t\taddCardinalDirectionNumVisitsPairIfValid(robotX, robotY + 1, CardinalDirection.North, possibleDirections, timesVisited);\n\t\t\taddCardinalDirectionNumVisitsPairIfValid(robotX, robotY - 1, CardinalDirection.South, possibleDirections, timesVisited);\n\t\t\t\n\t\t\t/* find the minimum number of visits. */\n\t\t\tint minVisits = Integer.MAX_VALUE;\n\t\t\tfor (CardinalDirectionNumVisitsPair pair : possibleDirections) {\n\t\t\t\tif (pair.numVisits < minVisits) {\n\t\t\t\t\tminVisits = pair.numVisits;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/* remove all pairs that do NOT have minVisits visits from the list. */\n\t\t\tfor (Iterator<CardinalDirectionNumVisitsPair> iterator = possibleDirections.listIterator(); iterator.hasNext(); ) {\n\t\t\t CardinalDirectionNumVisitsPair pair = iterator.next();\n\t\t\t if (pair.numVisits != minVisits) {\n\t\t\t iterator.remove();\n\t\t\t }\n\t\t\t}\n\t\t\t\n\t\t\t/* the list now contains only spaces that have the minimum number of visits. */\n\t\t\t/* pick randomly from the list. */\n\t\t\tint randomIndex = (int) Math.floor(Math.random() * possibleDirections.size());\n\t\t\tCardinalDirectionNumVisitsPair randomPair = possibleDirections.get(randomIndex);\n\t\t\t\n\t\t\t/* turn to face that direction. */\n\t\t\trobot.turnToDirection(randomPair.cardinalDirection);\n\t\t\t\n\t\t\t/* move. */\n\t\t\trobot.move(1, false);\n\t\t\t\n\t\t\t/* update the numVisits array. */\n\t\t\ttimesVisited[robot.getCurrentPosition()[0]][robot.getCurrentPosition()[1]]++;\n\t\t}\n\t\t\n\t\treturn robot.stepOutOfExit();\n\t}", "public int tourSize() {\n return tour.size();\n }", "@Test(timeout=2000) public void testMovesToReach(){\r\n GameStateSpace states = new GameStateSpace(this.initial);\r\n // For every target state based on the initial game look at a\r\n // target and calculate the moves to reach it\r\n for(int target=0; target<this.targetGameMoves.size(); target++){\r\n GameAndMoves gm = this.targetGameMoves.get(target);\r\n ZombieTrapGame targetGame = gm.game;\r\n List<String> expectMoves = gm.moves;\r\n List<String> actualMoves = states.movesToReach(targetGame);\r\n StringBuilder sb = new StringBuilder(this.name+\"\\n\");\r\n sb.append(\"TARGET GAME NUMBER \"+target+\"\\n\");\r\n \r\n // Check if the moves are equal to the expectation\r\n if(expectMoves==null && actualMoves==null){\r\n continue;\r\n }\r\n else if(expectMoves !=null && expectMoves.equals(actualMoves)){\r\n continue;\r\n }\r\n else if(expectMoves!=null && actualMoves==null){\r\n sb.append(\"State misidentified as NOT reachable\\n\");\r\n sb.append(String.format(\"Expect sequence: %s\\n\",expectMoves));\r\n sb.append(String.format(\"Actual sequence: %s\\n\",actualMoves));\r\n sb.append(String.format(\"Target Game:\\n%s\",targetGame));\r\n sb.append(this.toString());\r\n appendAllStates(states, sb);\r\n fail(sb.toString());\r\n }\r\n\r\n // ALREADY THERE\r\n // If equal length do they produce the correct board: could be\r\n // alternate paths to the same state\r\n ZombieTrapGame game = this.initial.copy();\r\n for(String move : actualMoves){\r\n doShift(game,move);\r\n }\r\n\r\n // ADD THIS CODE to fix a bug in the original test cases\r\n if(expectMoves==null && actualMoves!=null){\r\n sb.append(\"State misidentified as IS reachable\\n\");\r\n sb.append(String.format(\"Expect sequence: %s\\n\",expectMoves));\r\n sb.append(String.format(\"Actual sequence: %s\\n\",actualMoves));\r\n sb.append(String.format(\"Target Game:\\n%s\",targetGame));\r\n sb.append(String.format(\"Actual End Game:\\n%s\",game));\r\n sb.append(this.toString());\r\n appendAllStates(states, sb);\r\n fail(sb.toString());\r\n }\r\n\r\n // ALREADY THERE\r\n if(!game.equals(targetGame)){ // Moves don't lead to target state\r\n sb.append(\"Actual move sequence does not lead to target state\\n\");\r\n sb.append(String.format(\"Expect sequence (length %s): %s\\n\",expectMoves.size(),expectMoves));\r\n sb.append(String.format(\"Target Game:\\n%s\",targetGame));\r\n sb.append(String.format(\"Actual sequence (length %s): %s\\n\",actualMoves.size(),actualMoves));\r\n sb.append(String.format(\"Actual End Game:\\n%s\",game));\r\n } \r\n // Different path but same length, not an error\r\n else if(actualMoves.size() == expectMoves.size()){\r\n continue;\r\n }\r\n // Check if the moves are longer than the expected\r\n else if(actualMoves.size() > expectMoves.size()){\r\n sb.append(\"Actual move sequence is longer than the expected move sequence\\n\");\r\n sb.append(String.format(\"Expect sequence (length %s): %s\\n\",expectMoves.size(),expectMoves));\r\n sb.append(String.format(\"Actual sequence (length %s): %s\\n\",actualMoves.size(),actualMoves));\r\n sb.append(String.format(\"Target Game:\\n%s\",targetGame));\r\n }\r\n // A shorter path!?\r\n else {\r\n sb.append(\"Actual move sequence is SHORTER than the expected move sequence\\n\");\r\n sb.append(\"YOU HAVE DISCOVERED A BUG IN THE TEST CASES: NOTIFY THE COURSE INSTRUCTOR\\n\");\r\n sb.append(String.format(\"Expect sequence (length %s): %s\\n\",expectMoves.size(),expectMoves));\r\n sb.append(String.format(\"Actual sequence (length %s): %s\\n\",actualMoves.size(),actualMoves));\r\n sb.append(String.format(\"Target Game:\\n%s\",targetGame));\r\n }\r\n sb.append(this.toString());\r\n appendAllStates(states, sb);\r\n fail(sb.toString());\r\n }\r\n }", "public long getStepCount(){\r\n\t\treturn steps;\r\n\t}", "public void goToLoopCounter() throws EndTaskException {\n\t\tgoToOrigin();\n\t\tturnAround();\n\t\tmove();//lane 2\n\t\tmove();\n\t}", "@Override\n public void timePassed() {\n moveOneStep();\n }", "private void moveAnts() {\n IntStream.range(currentIndex, numberOfCities - 1)\n .forEach(i -> {\n ants.forEach(ant -> ant.visitCity(currentIndex, selectNextCity(ant)));\n currentIndex++;\n });\n }", "public abstract int drive(int journeyDistance);", "public int moves()\n {\n return moves;\n }", "@Test\r\n\tpublic void testTargetsTwoSteps() {\r\n\t\tboard.calcTargets(10, 1, 2);\r\n\t\tSet<BoardCell> targets= board.getTargets();\r\n\t\tassertEquals(6, targets.size());\r\n\t\tassertTrue(targets.contains(board.getCellAt(9, 0)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(11, 2)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(11, 0)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(9, 2)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(12, 1)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(10, 3)));\r\n\t\t\r\n\t\tboard.calcTargets(17, 13, 2);\r\n\t\ttargets= board.getTargets();\r\n\t\tassertEquals(5, targets.size());\r\n\t\tassertTrue(targets.contains(board.getCellAt(17, 15)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(18, 14)));\t\r\n\t\tassertTrue(targets.contains(board.getCellAt(16, 14)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(16, 12)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(15, 13)));\r\n\t}", "public void calcSteps(int stepCount) {\n\t\tif (stepCount <= 0) {\n\t\t\tfollowTargets = false;\n\t\t} else {\n\t\t\ttargets = new PVector[stepCount];\n\t\t\tPVector p1 = new PVector(p.random(-p.width, p.width), p.random(\n\t\t\t\t\t-p.height, p.height));\n\t\t\tPVector p2 = new PVector(p.random(-p.width, p.width), p.random(\n\t\t\t\t\t-p.height, p.height));\n\t\t\tPVector s = this.location;\n\t\t\tPVector f = p.level.warriors[0].location;\n\t\t\tp.curveTightness(p.random(-1, 2));\n\t\t\tfor (int i = 0; i < stepCount; ++i) {\n\t\t\t\tfloat t = i / (float) stepCount;\n\t\t\t\tfloat x = p.curvePoint(p1.x, s.x, f.x, p2.x, t);\n\t\t\t\tfloat y = p.curvePoint(p1.y, s.y, f.y, p2.y, t);\n\t\t\t\ttargets[i] = new PVector(x, y);\n\n\t\t\t\tif (p.debug) {\n\t\t\t\t\tp.curve(p1.x, p1.y, s.x, s.y, f.x, f.y, p2.x, p2.y);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public int countTroopToCarrierMoves(Spaceship aCarrier){\r\n\t int count = 0;\r\n\t for (TroopToCarrierMovement aTroopToCarrierMove : troopToCarrierMoves) {\r\n\t\t if (aTroopToCarrierMove.isThisDestination(aCarrier)){\r\n\t\t\t count++;\r\n\t\t }\r\n\t }\r\n\t return count;\r\n }", "public abstract void calculateMoves();", "@Override\n public Long getNumberOfWalkers() {\n return walkerRepo.countById();\n }", "@Override\n\tpublic int takeStep() {\n\t\tif (porteroDerecho){\n\t\t\t\n\t\t\t// Si me alejor de la porteria, volver\n\t\t\tif (myRobotAPI.getPosition().x < 0.9)\n\t\t\t\tmyRobotAPI.setSteerHeading(myRobotAPI.getOpponentsGoal().t);\n\t\t\t// Sino, ir a bloquear al portero\n\t\t\telse{\n\t\t\t\tmyRobotAPI.setSteerHeading(myRobotAPI.getClosestOpponent().t);\n\t\t\t\t//myRobotAPI.blockGoalKeeper(); // JA! No bloquea, solo marea los robots!\n\t\t\t\t\n\t\t\t\t// Aņadido para que si tiene la pelota cerca, deje de bloquear e intente chutar\n\t\t\t\tif (myRobotAPI.closestToBall()){\n\t\t\t\t\tmyRobotAPI.setSteerHeading(balon.t);\n\t\t\t\t\tmyRobotAPI.setBehindBall(myRobotAPI.getOpponentsGoal());\n\t\t\t\t\tif (myRobotAPI.alignedToBallandGoal())\n\t\t\t\t\t\tmyRobotAPI.kick();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t// Sino, el portero a bloquear es el del campo izquierdo...\n\t\telse {\n\t\t\t// Si me alejor de la porteria, volver\n\t\t\tif (myRobotAPI.getPosition().x > -0.9)\n\t\t\t\tmyRobotAPI.setSteerHeading(myRobotAPI.getOpponentsGoal().t);\n\t\t\t// Sino, ir a bloquear al portero\n\t\t\telse {\n\t\t\t\tmyRobotAPI.setSteerHeading(myRobotAPI.getClosestOpponent().t);\n\t\t\t\t//myRobotAPI.blockGoalKeeper(); // JA! No bloquea, solo marea los robots!\n\t\t\t\t\n\t\t\t\t// Aņadido para que si tiene la pelota cerca, deje de bloquear e intente chutar\n\t\t\t\tif (myRobotAPI.closestToBall()){\n\t\t\t\t\tmyRobotAPI.setSteerHeading(balon.t);\n\t\t\t\t\tmyRobotAPI.setBehindBall(myRobotAPI.getOpponentsGoal());\n\t\t\t\t\tif (myRobotAPI.alignedToBallandGoal())\n\t\t\t\t\t\tmyRobotAPI.kick();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tmyRobotAPI.setSpeed(1.0);\t\t// Empotramos para bloquear xD\n\t\t\n\t\treturn 0;\n\t}", "public long getStepCount(){\n return steps;\n }", "public void Move(){\n for(int i = 0; i < moveList.length; i++){\n playerString = \"\";\n switch(moveList[i]) {\n case 1: {\n //TODO: Visited points to others\n System.out.println(\"Moving up!\");\n //Logic for fitness score might need to be moved\n if(!(game.mazeArray[game.playerPosition.getPlayerY() -1][game.playerPosition.getPlayerX()] == 1)){\n playerString.concat(\"game.playerPosition.getPlayerY() - 1 + game.playerPosition.getPlayerX()\");\n if(vistedMoves.contains(playerString)){\n vistedPoints += 2;\n } else {\n freedomPoints += 5;\n vistedMoves.add(playerString);\n }\n } else {\n System.out.println(\"Stuck\");\n wallHugs += 10;\n }\n game.moveUp();\n if(game.checkWin()){\n freedomPoints += 200;\n }\n break;\n }\n case 2: {\n System.out.println(\"Moving left!\");\n if(!(game.mazeArray[game.playerPosition.getPlayerY()][game.playerPosition.getPlayerX() -1] == 1)){\n playerString.concat(\"game.playerPosition.getPlayerY() + game.playerPosition.getPlayerX() -1\");\n if(vistedMoves.contains(playerString)){\n vistedPoints += 2;\n } else {\n freedomPoints += 5;\n vistedMoves.add(playerString);\n }\n } else {\n System.out.println(\"Stuck\");\n wallHugs += 1;\n }\n game.moveLeft();\n if(game.checkWin()){\n freedomPoints += 200;\n }\n break;\n }\n case 3: {\n System.out.println(\"Moving right!\");\n if(!(game.mazeArray[game.playerPosition.getPlayerY()][game.playerPosition.getPlayerX() +1] == 1)){\n playerString.concat(\"game.playerPosition.getPlayerY() + game.playerPosition.getPlayerX() +1\");\n if(vistedMoves.contains(playerString)){\n vistedPoints += 2;\n } else {\n freedomPoints += 5;\n vistedMoves.add(playerString);\n }\n } else {\n System.out.println(\"Stuck\");\n wallHugs += 1;\n }\n game.moveRight();\n if(game.checkWin()){\n freedomPoints += 200;\n }\n break;\n }\n case 4: {\n System.out.println(\"Moving down!\");\n if(!(game.mazeArray[game.playerPosition.getPlayerY() +1][game.playerPosition.getPlayerX()] == 1)){\n playerString.concat(\"game.playerPosition.getPlayerY() + 1 + game.playerPosition.getPlayerX()\");\n if(vistedMoves.contains(playerString)){\n vistedPoints += 2;\n } else {\n freedomPoints += 5;\n vistedMoves.add(playerString);\n }\n freedomPoints += 1;\n } else {\n System.out.println(\"Stuck\");\n wallHugs += 1;\n }\n game.moveDown();\n if(game.checkWin()){\n freedomPoints += 200;\n }\n break;\n }\n default: {\n System.out.println(\"End of line\");\n break;\n //You shouldn't be here mate.\n }\n }\n }\n\n }", "@Override\n public void runMovingTest() {\n long now;\n int count, search;\n elapsedTime.clear();\n expandedCells.clear();\n GraphPath<Integer,DefaultWeightedEdge> agentPath=null;\n GraphPath<Integer,DefaultWeightedEdge> targetPath=null;\n //Integer agentNode, targetNode;\n List<Integer> pathToFollow = null;\n for(Point[] p : points){\n pathfinder = new LazyMovingTargetAdaptiveAStarShortestPath<Integer, DefaultWeightedEdge>(map);\n count=0;\n search=0;\n agentNode = p[0].toNode();\n targetNode = p[1].toNode();\n LinkedList<Integer> movingExpCell = new LinkedList<>();\n LinkedList<Long> movingElapsTime = new LinkedList<>();\n targetThread r = new targetThread();\n evadeThread = new Thread(r);\n evadeThread.start();\n while(!agentNode.equals(targetNode)){\n if(pathToFollow==null || !agentPath.getEndVertex().equals(targetNode)) {\n agentPath = pathfinder.getShortestPath(agentNode, targetNode, new OctileDistance());\n if(pathfinder.getElapsedTime() > Long.valueOf(1900))\n continue;\n movingElapsTime.add(pathfinder.getElapsedTime());\n movingExpCell.add(pathfinder.getNumberOfExpandedNodes());\n search++;\n }\n Integer targetNext = null;\n Integer agentNext = null;\n if(count%2==0) {\n /*targetPath = new Trailmax<Integer,DefaultWeightedEdge>(map).getShortestPath(agentNode,targetNode,null);\n pathToFollow = Graphs.getPathVertexList(targetPath);\n if (!pathToFollow.isEmpty()) targetNext = pathToFollow.remove(0);\n if (targetNext.equals(targetNode) && !pathToFollow.isEmpty()) targetNext = pathToFollow.remove(0);\n targetNode = targetNext;*/\n synchronized(moveTarget) {\n moveTarget = new Boolean(true);\n }\n\n try {\n Thread.sleep(12);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n pathToFollow=Graphs.getPathVertexList(agentPath);\n if(!pathToFollow.isEmpty()){\n int i = pathToFollow.lastIndexOf(agentNode);\n agentNext=pathToFollow.remove(i+1);\n }\n agentNode = agentNext;\n count++;\n //System.out.println(agentNode+\",\"+targetNode);\n\n }\n\n r.terminate();\n try {\n evadeThread.join();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n pathToFollow=null;\n movingElapsedTime.put(p, movingElapsTime);\n movingExpandedCells.put(p, movingExpCell);\n movesMap.put(p, count);\n searchesMap.put(p, search);\n if(verbose) {\n Long totElaps = Long.valueOf(0);\n Integer totExp = 0;\n for (Long l : movingElapsTime) totElaps += l;\n for (Integer i : movingExpCell) totExp += i;\n System.out.println(\"total elapsed: \" + totElaps + \" total expanded \" + totExp);\n }\n }\n }", "public void moveAllAgents() {\n\t\tPoint moveTo \t\t= null;\n\t\tGameClient client \t= null;\n\t\t\n\t\tfor(Player p : playerList) {\n\t\t\tif(p.getType() == PlayerType.Agent) {\n\t\t\t\tclient = HandleCommunication.findClient(p.getName(), server.getConnectedClientList());\n\t\t\t\tmoveTo = getSafeTeleportPosition();\n\t\t\t\tmovePlayer(p.getName(), p.getPosition(), moveTo, false);\n\t\t\t\tserver.sendMessageToClient(client.getClientSocket(), \"@124@\" + moveTo.x + \"@\" + moveTo.y + \"@\");\n\t\t\t}\n\t\t}\n\t}", "public void performCheckAfterPlayerMove() {\n\t\tagentsMoved += 1;\n\t\t\n\t\tif(agentsMoved == agents) {\n\t\t\troundsPlayed += 1;\n\t\t\tmoveRobots();\n\t\t\tagentsMoved = 0;\n\t\t\t\n\t\t\t//restart game at new level after the robots has moved\n\t\t\tif(roundsPlayed > server.getRoundsPerLevel()) {\n\t\t\t\tHandleCommunication.broadcastToClient(null, server.getConnectedClientList(), SendSetting.NextLevel, server, null);\n\t\t\t\troundsPlayed = 0;\n\t\t\t}\n\t\t}\n\t}", "static void moving() throws GameActionException {\n\n\t\tcheckLumberjack();\n\n\t\trc.setIndicatorLine(myLocation, myLocation.add(robotDirection), 0, 0, 0);\n\n\t\tif (rc.canBuildRobot(RobotType.SCOUT, robotDirection)\n\t\t\t\t&& rc.readBroadcast(Channels.COUNT_SCOUT) < Constants.MAX_COUNT_SCOUT) {\n\t\t\trc.buildRobot(RobotType.SCOUT, robotDirection);\n\t\t\tCommunication.countMe(RobotType.SCOUT);\n\t\t\treturn;\n\t\t}\n\t\t// } else if (rc.canBuildRobot(RobotType.SOLDIER, buildDirection) &&\n\t\t// rc.readBroadcast(Channels.COUNT_SOLDIER) <\n\t\t// Constants.MAX_COUNT_SOLDIER) {\n\t\t// rc.buildRobot(RobotType.SOLDIER, buildDirection);\n\t\t// Communication.countMe(RobotType.SOLDIER);\n\t\t// return;\n\t\t// }\n\n\t}", "public double calcDistBetweenStops(){\n List<Location> locs = destinations.getLocationList();\r\n double totalDist = 0;\r\n for (int i = 0; i < (locs.size() - 1); i++){\r\n double distance = locs.get(i).DistanceTo(locs.get(i+1));\r\n totalDist += distance;\r\n }\r\n return totalDist;\r\n }", "@Test\n\tpublic void testTargetsTwoSteps() {\n\t\tboard.calcTargets(7, 6, 2);\n\t\tSet<BoardCell> targets= board.getTargets();\n\t\tassertEquals(7, targets.size());\n\t\tassertTrue(targets.contains(board.getCellAt(5, 6)));\n\t\tassertTrue(targets.contains(board.getCellAt(6, 7)));\n\t\tassertTrue(targets.contains(board.getCellAt(6, 5)));\n\t\tassertTrue(targets.contains(board.getCellAt(8, 7)));\n\t\tassertTrue(targets.contains(board.getCellAt(8, 5)));\n\t\tassertTrue(targets.contains(board.getCellAt(9, 6)));\n\t\tassertTrue(targets.contains(board.getCellAt(7, 4)));\n\t\tboard.calcTargets(14, 24, 2);\n\t\ttargets= board.getTargets();\n\t\tassertEquals(3, targets.size());\n\t\tassertTrue(targets.contains(board.getCellAt(14, 22)));\n\t\tassertTrue(targets.contains(board.getCellAt(15, 23)));\t\n\t\tassertTrue(targets.contains(board.getCellAt(16, 24)));\t\t\t\n\t}", "@Test\n\tpublic void testTargetsOneStep() {\n\t\tboard.calcTargets(7, 6, 1);\n\t\tSet<BoardCell> targets= board.getTargets();\n\t\tassertEquals(4, targets.size());\n\t\tassertTrue(targets.contains(board.getCellAt(7, 7)));\n\t\tassertTrue(targets.contains(board.getCellAt(7, 5)));\t\n\t\tassertTrue(targets.contains(board.getCellAt(6, 6)));\t\n\t\tassertTrue(targets.contains(board.getCellAt(8, 6)));\t\n\n\n\t\tboard.calcTargets(14, 24, 1);\n\t\ttargets= board.getTargets();\n\t\tassertEquals(2, targets.size());\n\t\tassertTrue(targets.contains(board.getCellAt(15, 24)));\n\t\tassertTrue(targets.contains(board.getCellAt(14, 23)));\t\t\t\n\t}", "int moves() {\n return moves;\n }", "private void recalculateAllRoutes() {\n robotModels.parallelStream().forEach(m -> m.recalculateRoute(target, obstacles));\n }", "public void timePassed() {\n this.moveOneStep();\n }", "public void move()\n {\n move(WALKING_SPEED);\n }", "@Test\n\tpublic void testNumberOfDoorways() \n\t{\n\t\tint numDoors = 0;\n\t\tfor (int row=0; row<board.getNumRows(); row++)\n\t\t\tfor (int col=0; col<board.getNumColumns(); col++) {\n\t\t\t\tBoardCell cell = board.getCellAt(row, col);\n\t\t\t\tif (cell.isDoorway())\n\t\t\t\t\tnumDoors++;\n\t\t\t}\n\t\tAssert.assertEquals(14, numDoors);\n\t}", "public void step() {\r\n\t\tif (location == Location.SAFARI) {\r\n\t\t\tstepCount--;\r\n\t\t}\r\n\t}", "public void act() {\n\n\tif (0 == stepCount) {\n\n\t ArrayList<Location> node = new ArrayList<Location>();\n\t node.add(getLocation());\n\t crossLocation.push(node);\n\t}\n\n\tboolean willMove = canMove();\n\tif (isEnd == true) {\n\t //to show step count when reach the goal\t\t\n\t if (hasShown == false) {\n\t\tString msg = stepCount.toString() + \" steps\";\n\t\tJOptionPane.showMessageDialog(null, msg);\n\t\thasShown = true;\n\t }\n\t} else if (willMove) {\n\t\n\t move();\n\t //increase step count when move \n\t stepCount++;\n\t} else {\n\t \n\t back();\n\t stepCount++;\n\t}\n\n }", "public int dispatchTrucks(){\r\n for(int i = 0; i < trucks.size(); i++){\r\n System.out.println(\" Truck \" + (i + 1) + \" dispatched from Warehouse at (\" + x + \", \" + y + \"):\");\r\n totalDistance += trucks.get(i).planRoute();\r\n }\r\n return totalDistance;\r\n }", "public int Simulate()\r\n {\r\n return town.planRoute();\r\n }", "public AgentAction getNextMove(GameTile [][] visibleMap) {\r\n\t\t//Possible things to add to your moves\r\n//\t\tnextMove = AgentAction.doNothing;\r\n//\t\tnextMove = AgentAction.moveDown;\r\n//\t\tnextMove = AgentAction.moveUp;\r\n//\t\tnextMove = AgentAction.moveUp;\r\n//\t\tnextMove = AgentAction.moveLeft;\r\n//\t\tnextMove = AgentAction.pickupSomething;\r\n//\t\tnextMove = AgentAction.declareVictory;\r\n//\r\n//\t\tnextMove = AgentAction.shootArrowNorth;\r\n//\t\tnextMove = AgentAction.shootArrowSouth;\r\n//\t\tnextMove = AgentAction.shootArrowEast;\r\n//\t\tnextMove = AgentAction.shootArrowWest;\r\n//\t\tnextMove = AgentAction.quit\r\n\t\t\r\n\t\t\r\n\r\n\t\t//Ideally you would remove all this code, but I left it in so the keylistener would work\r\n\t\tif(keyboardPlayOnly) {\r\n\t\t\tif(nextMove == null) {\r\n\t\t\t\treturn AgentAction.doNothing;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tAgentAction tmp = nextMove;\r\n\t\t\t\tnextMove = null;\r\n\t\t\t\treturn tmp;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\telse {\r\n\t\t\t//This code plays 5 \"games\" and then quits\r\n\t\t\t//Just does random things\r\n\t\t\tif(numGamesPlayed > 19) {\r\n\t\t\t\treturn AgentAction.quit;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif(nextMoves.isEmpty()) {\r\n\t\t\t\t\tsetStartingPosition(visibleMap);\r\n//\t\t\t\t\tfindWumpus(visibleMap);\r\n//\t\t\t\t\tfindWumpus(visibleMap);\r\n//\t\t\t\t\tWumpusState currentState = huntTheWumpus(visibleMap);\r\n//\t\t\t\t\tSystem.out.println(wumpusHunted);\r\n//\t\t\t\t\tif(wumpusHunted) {\r\n//\t\t\t\t\t\tcurrentState.setParent(null);\r\n//\t\t\t\t\t\taddToNextMoves(currentState);\r\n//\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t//this is the code to collect the gold\r\n//\t\t\t\t\tcurrentState.setParent(null);\r\n//\t\t\t\t\tcurrentState = findTheGold(currentState);\r\n//\t\t\t\t\tif(currentState.getGoldCollected()) {\r\n//\t\t\t\t\t\tcurrentState.setParent(null);\r\n//\t\t\t\t\t\taddToNextMoves(currentState);\r\n//\t\t\t\t\t}\r\n\t\t\t\t\tif(!goldCollected) {\r\n\t\t\t\t\t\twellItsDarkNow(visibleMap);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(goldCollected) {\r\n//\t\t\t\t\t\tcurrentState.setParent(null);\r\n\t\t\t\t\t\taddToNextMoves(visibleMap);\r\n//\t\t\t\t\t\tgoldCollected = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tif(!nextMoves.isEmpty()) {\r\n\t\t\t\t\tSystem.out.println(nextMoves.peek());\r\n\t\t\t\t\tsetNextMove(nextMoves.remove());\r\n//\t\t\t\t\tSystem.out.println(nextMove);\r\n//\t\t\t\t\treturn nextMove;\r\n\t\t\t\t}\r\n\t\t\t\treturn nextMove;\r\n//\t\t\t\tcurrentNumMoves++;\r\n//\t\t\t\tif(currentNumMoves < 20) {\r\n//\t\t\t\t\treturn AgentAction.randomAction();\r\n//\t\t\t\t}\r\n//\t\t\t\telse {\r\n//\t\t\t\t\treturn AgentAction.declareVictory;\r\n//\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "Integer getTotalStepCount();", "@Override\n\tpublic Direction nextMove(State state)\n\t{\n\t\t\n\t\tthis.direction = Direction.STAY;\n\t\tthis.hero = state.hero();\n\t\tthis.position = new Point( this.hero.position.right, this.hero.position.left ); //x and y are reversed, really\n\t\t\n\t\tthis.pathMap = new PathMap( state, this.position.x, this.position.y );\n\n\t\t//find the richest hero\n\t\tHero richestHero = state.game.heroes.get(0);\n\t\tif( richestHero == this.hero ) { richestHero = state.game.heroes.get(1); } //just grab another hero if we are #0\n\t\t\n\t\tfor( Hero hero : state.game.heroes )\n\t\t{\n\t\t\tif( hero != this.hero && hero.gold > richestHero.gold )\n\t\t\t{\n\t\t\t\trichestHero = hero;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//get all interesting sites\n\t\tList<TileInfo> minesInRange = this.pathMap.getSitesInRange( TileType.FREE_MINE, 20 );\t//mines in vicinity\n\t\tList<TileInfo> takenMinesInRange = this.pathMap.getSitesInRange( TileType.TAKEN_MINE, (100-richestHero.life)/2 );\t//mines in vicinity\n\t\tList<TileInfo> pubsInRange = this.pathMap.getSitesInRange( TileType.TAVERN, (int)(Math.pow(100-this.hero.life,2)*state.game.board.size/5000) );\t\t//pubs in vicinity\n\t\t\n\t\t//first visit pubs (apparently we need it)\n\t\tif( pubsInRange.size() != 0 )\n\t\t{\n\t\t\tthis.direction = this.pathMap.getDirectionTo( pubsInRange.get(0) );\n\t\t}\n\t\t\n\t\t//then visit the mines\n\t\telse if( minesInRange.size() != 0 )\n\t\t{\n\t\t\tthis.direction = this.pathMap.getDirectionTo( minesInRange.get(0) );\n\t\t}\n\t\t\n\t\t//then visit taken mines\n\t\telse if( takenMinesInRange.size() != 0 )\n\t\t{\n\t\t\tthis.direction = this.pathMap.getDirectionTo( takenMinesInRange.get(0) );\n\t\t}\n\t\t\n\t\t//then hunt for players\n\t\telse\n\t\t{\n\t\t\t//kill the richest hero! (but first full health)\n\t\t\tif( this.hero.life > 85 )\n\t\t\t{\n\t\t\t\tthis.direction = this.pathMap.getDirectionTo( richestHero.position.right, richestHero.position.left );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//run away!!!\n\t\t\t\tthis.direction = intToDir( (int)(Math.random()*4) );\n\t\t\t}\n\t\t}\n\t\t\n\t\t//VisualPathMap.getInstance( pathMap );\n\t\t\n\t\treturn this.direction;\n\t}", "public void UpNumberOfVisitedNodes() {\n NumberOfVisitedNodes++;\n }", "@Override\r\n\tpublic void stepn(Robot robot, int n)\r\n\t{\r\n\t\trobot.runProgramStep(n);\r\n\t}", "private int countPossibleRoutes(){\n\tint totPossRoutes =0;\n\tfor(int i=0;i<ConditionTree.length;i++){\n\t\tif(ConditionTree[i][5].equals(\"Y\")){\n\t\t\ttotPossRoutes++;\n\t\t}\n\t}\n\t\n\treturn totPossRoutes;\n}", "@Test\n public void moreThanOneCheckerOnToLocation() {\n\n assertTrue(game.move(Location.R1, Location.R2));\n assertTrue(game.move(Location.R1, Location.R3));\n game.nextTurn();\n // to der gerne skulle vaere lovlige og stemme med terningerne\n assertTrue(game.move(Location.R6, Location.R5));\n assertTrue(game.move(Location.R8, Location.R6));\n game.nextTurn();\n assertTrue(game.move(Location.R2, Location.R5));\n assertTrue(game.move(Location.R3, Location.R7));\n game.nextTurn();\n // der staar nu to sorte paa R4\n assertFalse(game.move(Location.R6, Location.R3));\n }", "@Test\r\n\tpublic void testTargetsSixSteps() {\r\n\t\tboard.calcTargets(24, 17, 6);\r\n\t\tSet<BoardCell> targets= board.getTargets();\r\n\t\tassertEquals(8, targets.size());\r\n\t\tassertTrue(targets.contains(board.getCellAt(18, 17)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(20, 17)));\t\r\n\t\tassertTrue(targets.contains(board.getCellAt(22, 17)));\t\r\n\t\tassertTrue(targets.contains(board.getCellAt(19, 18)));\t\r\n\t\tassertTrue(targets.contains(board.getCellAt(21, 18)));\t\r\n\t\tassertTrue(targets.contains(board.getCellAt(23, 18)));\t\r\n\t\tassertTrue(targets.contains(board.getCellAt(22, 19)));\r\n\t\tassertTrue(targets.contains(board.getCellAt(22, 17)));\r\n\t\t\r\n\t}", "public int stepsUntilReturn(){\n int count = 0;\n int oldX = x;\n int oldY = y;\n move();\n count++;\n while ((oldX!=x)||(oldY!=y)){\n move();\n count++;\n if(count>=safeguard){\n break;\n }\n }\n return count;\n }" ]
[ "0.7029393", "0.6312764", "0.62660044", "0.6235145", "0.6185689", "0.61645675", "0.6123366", "0.60798717", "0.6046514", "0.5960815", "0.59380805", "0.5931586", "0.5922367", "0.58945596", "0.58928007", "0.58893883", "0.58270025", "0.5826163", "0.57929623", "0.57906705", "0.5782424", "0.5734158", "0.57331586", "0.57091093", "0.57069635", "0.56971085", "0.56891346", "0.5647689", "0.56405324", "0.56357443", "0.5630497", "0.5606747", "0.5585043", "0.55762607", "0.55621487", "0.5559696", "0.55380577", "0.55289525", "0.5525428", "0.55038065", "0.55011135", "0.5497363", "0.54954946", "0.5483751", "0.5467841", "0.5458826", "0.54575366", "0.5449068", "0.5449068", "0.54406494", "0.54197174", "0.54180986", "0.54149014", "0.54089093", "0.54018295", "0.53878933", "0.5384277", "0.537783", "0.5377402", "0.53653973", "0.5364139", "0.5363919", "0.53613335", "0.534869", "0.53457344", "0.53431004", "0.5341802", "0.5331195", "0.5325154", "0.53152347", "0.5295013", "0.529175", "0.5290616", "0.528904", "0.5286373", "0.52709574", "0.5265408", "0.52623355", "0.5246838", "0.5243823", "0.52331465", "0.5228049", "0.52279526", "0.5223101", "0.521283", "0.5210668", "0.5206404", "0.51936644", "0.5188992", "0.5174941", "0.5168015", "0.516669", "0.5166613", "0.5145727", "0.51375574", "0.5133464", "0.51248896", "0.5121896", "0.5120986", "0.5115722" ]
0.5980031
9
A getter for the warehouse
public IWarehouse getWarehouse(){ return this.warehouse; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getWarehouseid() {\n return warehouseid;\n }", "public String getWarehouseID() {\r\n\t\treturn this.name;\r\n\t}", "public Integer getWarehouseid() {\n return warehouseid;\n }", "public Integer getWarehousesnumber() {\n return warehousesnumber;\n }", "@Override\n\tpublic Warehouse selectWarehouse(int wid) {\n\t\ttry {\n\t\t\treturn (Warehouse) getSqlMapClientTemplate().queryForObject(\n\t\t\t\t\t\"Warehouse.selectWarehouse\", wid);\n\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "@GET\n\t\t\t@Path(\"/{id}/record\")\n\t\t\t@Produces({\"application/xml\"})\n\t\t\tpublic Rows getWarehouseRecord() {\n\t\t\t\tRows rows = null;\n\t\t\t\ttry {\n\t\t\t\t\trows=new WarehouseDao(uriInfo,header).getWarehouseRows();\n\t\t\t\t} catch (AuthenticationException e) {\n\t\t\t\t\t rows=new TemplateUtility().getFailedMessage(e.getMessage());\n\t\t\t\t\t e.printStackTrace();\n\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\t logger.info( \"Error calling getWarehouseRecord()\"+ ex.getMessage());\n\t\t\t\t\t ex.printStackTrace();\n\t\t\t\t}\n\t\t\t\treturn rows;\n\t\t\t}", "java.lang.String getWarehouseUuid();", "@Override\n\tpublic Warehouse selectwarehouse(int warehouse_id) {\n\t\ttry {\n \t\t\treturn (Warehouse)getSqlMapClientTemplate().queryForObject(\"Warehouse.selectwarehouse\",warehouse_id);\n \t\t\t\n\t} catch (Exception ex) {\n\t\tex.printStackTrace();\n\t}\n\t\treturn null;\n\t}", "public List<Warehouse> findWarehouseAll() {\n\t\t return warehouseDAO.findWarehouseAll();\r\n\t}", "@GET\n\t\t\t@Path(\"/rows\")\n\t\t\t@Produces({\"application/xml\"})\n\t\t\tpublic Rows getWarehouseRows() {\n\t\t\t\tRows rows = null;\n\t\t\t\ttry {\n\t\t\t\t\trows=new WarehouseDao(uriInfo,header).getWarehouseRows();\n\t\t\t\t} catch (AuthenticationException e) {\n\t\t\t\t\t rows=new TemplateUtility().getFailedMessage(e.getMessage());\n\t\t\t\t\t e.printStackTrace();\n\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\t logger.info( \"Error calling getWarehouseRows()\"+ ex.getMessage());\n\t\t\t\t\t ex.printStackTrace();\n\t\t\t\t}\n\t\t\t\treturn rows;\n\t\t\t}", "@Override\r\n\tpublic String getId() {\n\t\treturn mWarehouseId;\r\n\t}", "public ArrayList<Warehouse> getUserWarehouses(){\r\n try{\r\n ArrayList<Warehouse> mWarehouses = new ArrayList<Warehouse>();\r\n UserManager mydb= new UserManager(activity);\r\n String[] allColumns = { DBManager.Warehouse_Key, DBManager.Warehouse_LABEL };\r\n\r\n mydb.open();\r\n Cursor cursor = mydb.getDb().query(DBManager.Warehouse_TABLE_NAME,\r\n allColumns, null, null, null, null, null);\r\n\r\n cursor.moveToFirst();\r\n while (!cursor.isAfterLast()) {\r\n Warehouse dp = new Warehouse(cursor.getString(0),cursor.getString(1));\r\n mWarehouses.add(dp);\r\n cursor.moveToNext();\r\n }\r\n // closing the cursor\r\n cursor.close();\r\n mydb.close();\r\n\r\n return mWarehouses;\r\n } catch (Exception e) {\r\n return null;\r\n }\r\n }", "public Warehouse find(Integer id) {\n\t\t return warehouseDAO.find(id);\r\n\t\t\r\n\t}", "public int getM_Warehouse_ID() {\n\t\tInteger ii = (Integer) get_Value(\"M_Warehouse_ID\");\n\t\tif (ii == null)\n\t\t\treturn 0;\n\t\treturn ii.intValue();\n\t}", "public int getM_Warehouse_ID() {\n\t\tInteger ii = (Integer) get_Value(\"M_Warehouse_ID\");\n\t\tif (ii == null)\n\t\t\treturn 0;\n\t\treturn ii.intValue();\n\t}", "public int getM_Warehouse_ID() {\n\t\tInteger ii = (Integer) get_Value(\"M_Warehouse_ID\");\n\t\tif (ii == null)\n\t\t\treturn 0;\n\t\treturn ii.intValue();\n\t}", "@GET\n\t\t\t@Path(\"/{id}/summary\")\n\t\t\t@Produces({\"application/xml\"})\n\t\t\tpublic Rows getWarehouseSummaryRows() {\n\t\t\t\tRows rows = null;\n\t\t\t\ttry {\n\t\t\t\t\trows=new WarehouseDao(uriInfo,header).getWarehouseSummaryRows();\n\t\t\t\t} catch (AuthenticationException e) {\n\t\t\t\t\t rows=new TemplateUtility().getFailedMessage(e.getMessage());\n\t\t\t\t\t e.printStackTrace();\n\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\tlogger.info( \"Error calling getWarehouseRows()\"+ ex.getMessage());\n\t\t\t\t\t ex.printStackTrace();\n\t\t\t\t}\n\t\t\t\treturn rows;\n\t\t\t}", "@GET\n\t\t\t@Path(\"/filter\")\n\t\t\t@Produces({\"application/xml\"})\n\t\t\tpublic Rows getWarehouseRowsByFilter() {\n\t\t\t\tRows rows = null;\n\t\t\t\ttry {\n\t\t\t\t\trows=new WarehouseDao(uriInfo,header).getWarehouseByFilter();\n\t\t\t\t} catch (AuthenticationException e) {\n\t\t\t\t\t rows=new TemplateUtility().getFailedMessage(e.getMessage());\n\t\t\t\t\t e.printStackTrace();\n\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\t logger.info( \"Error calling getWarehouseRowsByFilter()\"+ ex.getMessage());\n\t\t\t\t\t ex.printStackTrace();\n\t\t\t\t}\n\t\t\t\treturn rows;\n\t\t\t}", "@Override\r\n\tpublic Warehouse findById(int id) {\n\t\treturn warehouseDao.findById(id);\r\n\t}", "public Kitchen getKitchen() {\r\n return this.kitchen;\r\n }", "protected Warehouse() {\n super();\n }", "@Override\n\tpublic String findLastWarehouseCode() {\n\t\treturn null;\n\t}", "public List<StockItem> loadWarehouseState(StockTableModel warehouse) {\n\t\t\n\t\tSession session = HibernateUtil.currentSession();\n\t\t\n\t\tQuery fromDB = session.createQuery(\"from StockItem\");\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tList<StockItem> wareHouseItems = fromDB.list();\n\t\t\n\t\treturn wareHouseItems;\n\t}", "public WarehousesResource() {\n ws = new WarehouseWebService();\n }", "public ArrayList<ArrayList<Product>> getProductsFromEachWarehouse() {\n ArrayList<ArrayList<Product>> allProducts = new ArrayList<>();\n for (int i = 1; i <= db.maxWarehouses(); i++) {\n allProducts.add(getProducts(i));\n }\n return allProducts;\n }", "public void setWarehouseid(Integer warehouseid) {\n this.warehouseid = warehouseid;\n }", "@Override\r\n\tpublic List<Warehouse_itemInformation> selectWarehouseOrder_itemInformation() {\n\t\treturn who_iif.selectWarehouse_itemInformation();\r\n\t}", "com.google.protobuf.ByteString\n getWarehouseUuidBytes();", "public interface WarehouseManipulator {\n int newWarehouseRequest(String s, NewWarehouseModalBottomSheet mbs);\n int editWarehouseRequest(Warehouse w,String newName, EditWarehouseModalBottomSheet mbs);\n int removeWarehouseRequest(Warehouse w);\n List<Warehouse> getWarehouses(String role);\n int showEditModalBottomSheet(EditWarehouseModalBottomSheet mbs);\n int openWarehouse(Warehouse w);\n}", "public interface WarehouseService {\n\n /**\n * This method returns all warehouses data from database by calling respective repository methods.\n *\n * @return set of {@link Warehouse}s\n */\n Set<Warehouse> getAllWarehouses();\n\n}", "public ArrayList<Product> getProducts(int warehouseNumber) { return db.retrieve_warehouse(warehouseNumber); }", "@GET\n\t\t\t@Path(\"/{id}/warehouseline\")\n\t\t\t@Produces({\"application/xml\"})\n\t\t\tpublic Rows getWarehouselineRows(@Context UriInfo uriInfo,@Context HttpHeaders header) {\n\t\t\t\tRows rows = null;\n\t\t\t\ttry {\n\t\t\t\t\trows=new WarehouseDao(uriInfo,header).getWarehouselineRows();\n\t\t\t\t} catch (AuthenticationException e) {\n\t\t\t\t\t rows=new TemplateUtility().getFailedMessage(e.getMessage());\n\t\t\t\t\t e.printStackTrace();\n\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\tlogger.info( \"Error calling getWarehouselineRows()\"+ ex.getMessage());\n\t\t\t\t}\n\t\t\t\treturn rows;\n\t\t\t}", "@GET\n @Path(\"{id : \\\\d+}\")\n @Produces(\"application/json\")\n public GetWarehouseResponse getWarehouse(@PathParam(\"id\") String id,\n @QueryParam(\"token\") String token) {\n GetWarehouseRequest request = new GetWarehouseRequest();\n request.setId(BigInteger.valueOf(Integer.parseInt(id)));\n request.setToken(token);\n return ws.getWarehouse(request);\n }", "@GET\n\t\t\t@Path(\"/{id}/delete\")\n\t\t\t@Produces({\"application/xml\"})\n\t\t\tpublic Rows getWarehouseRowDeleted() {\n\t\t\t\tRows rows = null;\n\t\t\t\ttry {\n\t\t\t\t\trows=new WarehouseDao(uriInfo,header).getWarehouseRowDeleted();\n\t\t\t\t} catch (AuthenticationException e) {\n\t\t\t\t\t rows=new TemplateUtility().getFailedMessage(e.getMessage());\n\t\t\t\t\t e.printStackTrace();\n\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\tlogger.info( \"Error calling getWarehouseRowDeleted()\"+ ex.getMessage());\n\t\t\t\t\t ex.printStackTrace();\n\t\t\t\t}\n\t\t\t\treturn rows;\n\t\t\t}", "public Washer getWasher() {\r\n\t\treturn washer;\r\n\t}", "public StorageSku storagesku() {\n return this.storagesku;\n }", "public Weet getWeet(int wid) {\n return array.getWeetFromStore(wid);\n }", "public String getWareHouseName()\n\t{\n\t\treturn getValue(WareHouse.WAREHOUSENAME).toString();\n\t}", "public String getWashingPlant() {\n return (String) getAttributeInternal(WASHINGPLANT);\n }", "String getStockName();", "public Dimension getDimensionPack() {\n return dimensionPacker.getFilledArea();\n }", "public int getStock(){\n\t\treturn Stock; // Return the product's stock\n\t}", "public String getJobWelfare() {\r\n return jobWelfare;\r\n }", "public int getM_Warehouse_ID() \n{\nInteger ii = (Integer)get_Value(\"M_Warehouse_ID\");\nif (ii == null) return 0;\nreturn ii.intValue();\n}", "public int getWood(){\r\n\t\treturn wood;\r\n\t}", "@Override\n\tpublic List<Warehouse> selectAll() {\n\t\tList<Warehouse> userlist = null;\n\t\ttry {\n\t\t\treturn getSqlMapClientTemplate().queryForList(\"Warehouse.selectAllWarehouse\");\n\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t\treturn null;\n\n\t\t\n\t}", "public String getWash() {\n return (String)getAttributeInternal(WASH);\n }", "public String getDatabaseProduct();", "public double getWage() {\r\n return wage;\r\n }", "Object getProduct();", "public String getPzwh() {\n return pzwh;\n }", "public Getter reqGetBathWaterVolumeSetting() {\n\t\t\taddProperty(EPC_BATH_WATER_VOLUME_SETTING);\n\t\t\treturn this;\n\t\t}", "@Override\r\n\tpublic List<Warehouse> selectAll() {\n\t\treturn warehouseDao.selectAll();\r\n\t}", "private String getStock() {\n\t\treturn stock;\n\t}", "protected String getStore() {\n return store;\n }", "public StorageUnit getStorageUnit() {\n\t\t// find the StorageUnit for the destination container\n\t\tStorageUnit storageUnit = null;\n\t\tProductContainer parentContainer = this;\n\t\twhile (storageUnit == null) {\n\t\t\tif (parentContainer.getClass() == StorageUnit.class) {\n\t\t\t\tstorageUnit = (StorageUnit) parentContainer;\n\t\t\t} else {\n\t\t\t\tparentContainer = ((ProductGroup) parentContainer)\n\t\t\t\t\t\t.getParent();\n\t\t\t}\n\t\t}\n\t\treturn storageUnit;\n\t}", "public Integer getWarehousingid() {\n return warehousingid;\n }", "TradingProduct getTradingProduct();", "public Shop getShop()\n\t{\n\t\treturn m_currentShop;\n\t}", "public java.lang.String getWoolieName(){return this.woolieName;}", "@XmlTransient\n\tpublic Wuerfel getWuerfel() {\n\t\t\n\t\tSystem.out.println(this.getName()+\" hat die zahl \"+wuerfel+\" gewuerfelt\");\n\t\treturn wuerfel;\n\t}", "public WorkObject getWorkObject()\n {\n throw new UnsupportedOperationException(\n \"This method is not supported. Use getLevelObjectType() and getLevelObjectId()\");\n }", "@Override\n\tpublic Datastore getDatastore() {\n\t\treturn SKBeanUtils.getDatastore();\n\t}", "public THING get() {\n return directlyGet();\n }", "public java.lang.Integer getStoredem() throws java.rmi.RemoteException;", "public Getter reqGetWaterHeaterStatus() {\n\t\t\taddProperty(EPC_WATER_HEATER_STATUS);\n\t\t\treturn this;\n\t\t}", "public jkt.hms.masters.business.MasStoreSupplier getSupplier () {\n\t\treturn supplier;\n\t}", "public String getBestSeller ()\n {\n return (bestSeller);\n }", "public String getStockName() {\n return stockName;\n }", "@Override\r\n\tpublic List prodStockseach() {\n\t\treturn adminDAO.seachProdStock();\r\n\t}", "public String getStock() {\n return stock;\n }", "public String getStock() {\n return stock;\n }", "public Warehouse() {\n this.addMouseListener(new MouseAdapter() {\n @Override\n public void mousePressed(MouseEvent e) {\n for (Transporter t : warehouseModel.TRANSPORTERS) {\n if (t.isClicked(e.getPoint())) {\n clickedObject = t;\n return;\n }\n }\n for (Shelf s : warehouseModel.SHELVES) {\n if (s.isClicked(e.getPoint())) {\n clickedObject = s;\n return;\n }\n }\n clickedObject = null;\n }\n });\n }", "public PgStatGetWalSenders call() {\n return new PgStatGetWalSenders(DSL.name(getName()), null, new Field[] { \n });\n }", "public Name getShopperName() {\n return shopperName;\n }", "public WebMarket getMarket() {\r\n return market;\r\n }", "public String getStoreName() {\n return (String) get(\"store_name\");\n }", "public Dimension getClientDimension ()\n\t{\n\t\treturn dimension;\n\t}", "public int getStock() {\n return stock;\n }", "public double getWest() {\n return west;\n }", "public String getStockName() {\r\n return stockName;\r\n }", "public int getDailyWorkload(){\r\n return dailyWorkload;\r\n }", "@JsonIgnore\n public WV getWV() {\n if (wvm == null || wvm == WVM.Microversion) {\n return null;\n }\n switch (wvm) {\n case Workspace:\n return WV.Workspace;\n default:\n return WV.Version;\n }\n }", "@Override\n\tpublic String getWinkel(){\n\t\tString pName= ctx.getCallerPrincipal().getName();\n\t\tPerson p=userEJB.findPerson(pName);\n\t\tString w=p.getWinkel();\n\t\treturn w;\n\t}", "public int getKiloWatts(){\n\treturn kiloWatts;\n}", "public Long getThreemerchant() {\n return threemerchant;\n }", "public Product getProduct(int warehouseNumber, String productName) {\n Product productToReturn = null; // productToReturn = null if not there\n for (Product product : getProducts(warehouseNumber)) {\n if (product.getName().equals(productName)) {\n productToReturn = product;\n }\n }\n return productToReturn;\n }", "@Override\r\n\tpublic long getTotalRows() {\n\t\treturn warehouseDao.getTotalRows();\r\n\t}", "private Integer obtainWarehouseId(Invoice invoice) {\r\n\t\ttry {\r\n\t\t\tIManagerBean invoiceDetailBean = BeanManager.getManagerBean(InvoiceDetail.class);\r\n\t\t\tCriteria criteria = new Criteria();\r\n\t\t\tcriteria.addEqualExpression(invoiceDetailBean.getFieldName(IFinanceAlias.INVOICE_DETAIL_INVOICE_ID), invoice.getId());\r\n\t\t\tcriteria.addEqualExpression(invoiceDetailBean.getFieldName(IFinanceAlias.INVOICE_DETAIL_SOURCE), InvoiceSource.DIRECT_PURCHASE);\r\n\t\t\tIterator iter = invoiceDetailBean.getList(criteria, 0, 1).iterator();\r\n\t\t\tIncomeDetail incomeDetail = null;\r\n\t\t\tif(iter.hasNext()){\r\n\t\t\t\tInvoiceDetail invoiceDetail = (InvoiceDetail)iter.next();\r\n\t\t\t\tincomeDetail = obtainIncomeDetail(invoiceDetail.getDeliveryDetail());\r\n\t\t\t}else{\r\n\t\t\t\tcriteria = new Criteria();\r\n\t\t\t\tcriteria.addEqualExpression(invoiceDetailBean.getFieldName(IFinanceAlias.INVOICE_DETAIL_INVOICE_ID), invoice.getId());\r\n\t\t\t\titer = invoiceDetailBean.getList(criteria, 0, 1).iterator();\r\n\t\t\t\tif(iter.hasNext()){\r\n\t\t\t\t\tInvoiceDetail invoiceDetail = (InvoiceDetail)iter.next();\r\n\t\t\t\t\tincomeDetail = obtainIncomeDetail(invoiceDetail.getDeliveryDetail());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(incomeDetail != null){\r\n\t\t\t\treturn incomeDetail.getWarehouse().getId();\r\n\t\t\t}\r\n\t\t} catch (ManagerBeanException e) {\r\n\t\t\tLOGGER.log(Level.SEVERE, \"Error obtaining warehouse for invoice with id= \" + invoice.getId(), e);\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public Workspace getWorkspace() {\n return workspace;\n }", "com.unitedtote.schema.totelink._2008._06.program.ExchangeWagers xgetExchange();", "String getStorageVendor();", "public Workspace getWorkspace() {\n return this.workspace;\n }", "public double getHourlyWage()\r\n {\r\n return hourlyWage;\r\n }", "String getProduct();", "public String getStore_location()\n {\n \treturn store_location;\n }", "public double getWage(){\r\n return wage; \r\n }", "@Accessor(qualifier = \"report\", type = Accessor.Type.GETTER)\n\tpublic ReportModel getReport()\n\t{\n\t\treturn getPersistenceContext().getPropertyValue(REPORT);\n\t}", "@Override\n\tpublic PartnerUsageSummary get()\n\t{\n\t\treturn this.getPartner().getServiceClient().get(\n\t\t\tthis.getPartner(),\n\t\t\tnew TypeReference<PartnerUsageSummary>(){}, \n\t\t\tPartnerService.getInstance().getConfiguration().getApis().get(\"GetPartnerUsageSummary\").getPath());\n\t}", "public RowSet getWashTypeVO1() {\n return (RowSet)getAttributeInternal(WASHTYPEVO1);\n }" ]
[ "0.7691885", "0.74666", "0.7438418", "0.7113794", "0.7060306", "0.7013395", "0.6928033", "0.68249345", "0.68130577", "0.6793522", "0.6771546", "0.64760184", "0.64537984", "0.6403153", "0.6403153", "0.6403153", "0.62867695", "0.6244369", "0.61683476", "0.61401415", "0.6006341", "0.6000469", "0.59693766", "0.5926271", "0.5917878", "0.5824937", "0.57739127", "0.57681966", "0.5753215", "0.5752356", "0.5751129", "0.5743948", "0.5708143", "0.5701348", "0.5642927", "0.56390035", "0.56387097", "0.5631114", "0.56181747", "0.55892766", "0.5579058", "0.55547273", "0.55432737", "0.55345774", "0.5533001", "0.5522357", "0.5506268", "0.550067", "0.5499725", "0.54984885", "0.54837364", "0.5477964", "0.5475367", "0.546578", "0.54586524", "0.5455751", "0.5452392", "0.544158", "0.5438805", "0.5429493", "0.5413884", "0.54129076", "0.54076326", "0.54042524", "0.5400789", "0.5388116", "0.5386502", "0.5382746", "0.5374827", "0.53717715", "0.53672", "0.53672", "0.5354235", "0.5348217", "0.5345138", "0.53380364", "0.53375494", "0.53334105", "0.532962", "0.5324191", "0.5322618", "0.53218794", "0.5319555", "0.53135455", "0.53098017", "0.5302106", "0.5301834", "0.53015804", "0.53008366", "0.5298323", "0.5298061", "0.5288398", "0.5287983", "0.5285937", "0.5285246", "0.52833265", "0.5280774", "0.5280047", "0.5279337", "0.52777684" ]
0.85849625
0
A getter for the robot2dest
public Map<IGridRobot, GridCell> getRobot2Dest(){ return this.robot2dest; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Destination getDestination();", "public Room getDestination() {\n return toRoom;\n }", "String getDest();", "public Coordinate getDestination() {\n return cDestination;\n }", "@Override\n\tpublic String getDest() {\n\t\treturn dest;\n\t}", "public Object getDestination() {\n/* 339 */ return this.peer.getTarget();\n/* */ }", "@Override\n public String getDestination() {\n return this.dest;\n }", "public java.lang.String getDestination(){return this.destination;}", "String getRouteDest();", "public Object getDestination() { return this.d; }", "int getDestination();", "public int getDest(){\r\n\t\treturn this.dest;\r\n\t}", "public Location getDestination()\r\n\t{ return this.destination; }", "public String getDestination() {\r\n return this.destination;\r\n }", "public Location getDestination() {\r\n return destination;\r\n }", "public Reference destination() {\n return getObject(Reference.class, FhirPropertyNames.PROPERTY_DESTINATION);\n }", "@Override\n public Point3D getDestination() {\n return myMovable.getDestination();\n }", "public String getDestination() {\n return this.destination;\n }", "public Location getDestination(){\n\t\treturn destination;\n\t}", "public String getDestination() {\r\n return destination;\r\n }", "public Location getDest() {\n return ticketsCalculator.getDest();\n }", "public Sommet destination() {\n return destination;\n }", "public java.lang.String getDestination()\n {\n return this._destination;\n }", "public Town getDestination() {\r\n\t\treturn this.destination;\r\n\t}", "public String getDestination() {\r\n\t\treturn this.destination;\r\n\t}", "@Override\n public Location getDestination() {\n return _destinationLocation != null ? _destinationLocation : getOrigin();\n }", "public String getDestination() {\n return destination;\n }", "public java.lang.String getDestination() {\n return destination;\n }", "public String getDestination(){\r\n\t\treturn route.getDestination();\r\n\t}", "public IAirport getDestination();", "public String getDestLocation() {\r\n return this.destPath.getText();\r\n }", "public String getDestination() {\r\n\t\treturn destination;\r\n\t}", "public int getDestination() {\r\n\t\treturn destination;\r\n\t}", "public String destination() {\n return this.destination;\n }", "public String getRouteDest() {\n Object ref = routeDest_;\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 routeDest_ = s;\n }\n return s;\n } else {\n return (String) ref;\n }\n }", "public String getRouteDest() {\n Object ref = routeDest_;\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 routeDest_ = s;\n }\n return s;\n }\n }", "public String getDestination() {\n\t\treturn destination;\n\t}", "public Weather getDestinationWeather() {\r\n return destinationWeather;\r\n }", "public Node getDestination() {\n return this.destination;\n }", "public Location getTransportDestination() {\n Tile target = (hasTools())\n ? ((!checkTileImprovementPlan(tileImprovementPlan)) ? null\n : tileImprovementPlan.getTarget())\n : ((!checkColonyForTools(getAIUnit(), colonyWithTools)) ? null\n : colonyWithTools.getTile());\n return (shouldTakeTransportToTile(target)) ? target : null;\n }", "public Actor getDestination()\r\n\t{\r\n\t\treturn destinationActor;\t\r\n\t}", "public LatLng getDestination () {\n return destination;\n }", "public Point2D.Double getMotionMagicDestinationCoordinates(){\n return null;\n }", "public int getDestination() {\n\t\treturn finalDestination;\n\t}", "public java.lang.String getMWNDest() {\n return MWNDest;\n }", "public ITransferObject getTo() {\r\n return getController().getTo();\r\n }", "public Integer getDestination() {\n\t\treturn new Integer(destination);\n\t}", "public Square destination() {\n return destination;\n }", "@java.lang.Override\n public POGOProtos.Rpc.HoloPokemonMove getMove2() {\n @SuppressWarnings(\"deprecation\")\n POGOProtos.Rpc.HoloPokemonMove result = POGOProtos.Rpc.HoloPokemonMove.valueOf(move2_);\n return result == null ? POGOProtos.Rpc.HoloPokemonMove.UNRECOGNIZED : result;\n }", "@java.lang.Override public POGOProtos.Rpc.HoloPokemonMove getMove2() {\n @SuppressWarnings(\"deprecation\")\n POGOProtos.Rpc.HoloPokemonMove result = POGOProtos.Rpc.HoloPokemonMove.valueOf(move2_);\n return result == null ? POGOProtos.Rpc.HoloPokemonMove.UNRECOGNIZED : result;\n }", "String getDest_typ();", "public java.lang.String getDestination() {\n java.lang.Object ref = destination_;\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 destination_ = s;\n return s;\n }\n }", "public String getToStation();", "public java.lang.String getDirection2() {\r\n return direction2;\r\n }", "public String panoramaServer2() {\n return this.panoramaServer2;\n }", "public String getDestination()\n\t{\n\t\treturn notification.getString(Attribute.Request.DESTINATION);\n\t}", "public NameValue<String, String> getDestURL() {\n return getDestURL(false);\n }", "public String getdDestinationcity() {\n return dDestinationcity;\n }", "public java.lang.String getDestination() {\n java.lang.Object ref = destination_;\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 destination_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "godot.wire.Wire.Vector2 getOrigin();", "public Vertex getDestination() {\n return destination;\n }", "public String getWriteString() {\r\n\t\t\treturn \"Dest \"+name+\" \"+x+\" \"+y+\" \"+z;\r\n\t}", "public float getYDest()\n {\n return yDest;\n }", "String getDestination() {\n if (isSeparateFolder()) {\n return destination.getText();\n } else {\n return null;\n }\n }", "public Player getToTeleportTo(){\n\t\treturn toTeleportTo;\n\t}", "public java.lang.String getUDP2() {\n return UDP2;\n }", "String getDest_id();", "public InetSocketAddress getDestination () {\n\t\treturn origin;\n\t}", "@Override\n public double getDestinationY() {\n return myMovable.getDestinationY();\n }", "int getDestinationPort();", "int getDestinationPort();", "public Station station2() {\n return station2;\n }", "io.opencannabis.schema.commerce.OrderDelivery.DeliveryDestination getDestination();", "com.google.protobuf.ByteString\n getRouteDestBytes();", "public int getDestinationFloor(){\n return destinationFloor;\n }", "public boolean get_destination() {\r\n return (final_destination);\r\n }", "@java.lang.Override public int getMove2Value() {\n return move2_;\n }", "int getDestinationPort() {\n return this.resolvedDestination.destinationPort;\n }", "public int destination(){\n\t\treturn this.des;\n\t}", "public Direction getCorrectRobotDirection();", "public String getAddr2() {\r\n return addr2;\r\n }", "public com.google.protobuf.ByteString\n getRouteDestBytes() {\n Object ref = routeDest_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n routeDest_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public V getDestination() {\r\n\r\n\t\tV result = null;\r\n\t\tif ((counter <= links.size()) && (counter > 0)) {\r\n\t\t\tresult = succNodes.get(counter - 1);\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public Point2D getPoint2() {\n return this.point2;\n }", "@java.lang.Override public int getMove2Value() {\n return move2_;\n }", "public com.google.protobuf.ByteString\n getRouteDestBytes() {\n Object ref = routeDest_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n routeDest_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public Point getRobotLocation();", "public Location getCompassTarget ( ) {\n\t\treturn extract ( handle -> handle.getCompassTarget ( ) );\n\t}", "public Vector2 getPos2() {\n\t\treturn pos2;\n\t}", "public TCSObjectReference<Point> getDestinationPoint() {\n if (hops.isEmpty()) {\n return null;\n }\n else {\n return hops.get(hops.size() - 1);\n }\n }", "@Basic\r\n\tpublic Robot getRobot()\r\n\t{\r\n\t\treturn this.robot;\r\n\t}", "public RobotID getRobot() {\n return robot;\n }", "public String getDestinationId()\n {\n return destinationId; // Field is final; no need to sync.\n }", "@Override\n public Location getLocation() {\n if (type == TeleportType.TPA) {\n return target.getPlayerReference(Player.class).getLocation();\n } else if (type == TeleportType.TPHERE) {\n return toTeleport.getPlayerReference(Player.class).getLocation();\n }\n\n return null;\n }", "public BusStop getDestinationBusStop() {\r\n return destinationBusStop;\r\n }", "public abstract String getRobotUri();", "public void getMove(){\n\t\t\n\t}", "String getDestIpAddress() {\n return destIpAddress;\n }", "public Long getDestinationNumber() {\n return this.destinationNumber;\n }", "@gw.internal.gosu.parser.ExtendedProperty\n public java.lang.String getReference2() {\n return (java.lang.String)__getInternalInterface().getFieldValueForCodegen(REFERENCE2_PROP.get());\n }" ]
[ "0.66289634", "0.6605907", "0.65203965", "0.64711154", "0.64440113", "0.6434345", "0.6421757", "0.6381867", "0.6380403", "0.63483274", "0.6345102", "0.63162655", "0.63060355", "0.6280355", "0.6251337", "0.6208025", "0.6207595", "0.6199655", "0.6189937", "0.6166031", "0.6151783", "0.61483955", "0.6144593", "0.6140549", "0.6113054", "0.6104082", "0.60812837", "0.60501546", "0.6045482", "0.60383725", "0.5999823", "0.5970266", "0.5970164", "0.5955956", "0.59463084", "0.59353256", "0.59008604", "0.5882197", "0.5880917", "0.58740973", "0.585925", "0.58476067", "0.58384216", "0.5833189", "0.5831059", "0.58291405", "0.5788935", "0.57525533", "0.5743683", "0.5741171", "0.5735577", "0.57234836", "0.5722667", "0.5718732", "0.5715126", "0.5697524", "0.56953675", "0.5692653", "0.56896275", "0.5688857", "0.5684927", "0.56831795", "0.5678198", "0.5671692", "0.5667375", "0.5661054", "0.5657012", "0.56444347", "0.5637561", "0.5635919", "0.5635919", "0.56222415", "0.5617792", "0.56144387", "0.5603247", "0.560087", "0.55992633", "0.5598168", "0.55963004", "0.5582569", "0.55766195", "0.5574512", "0.5568869", "0.55642843", "0.5537548", "0.55312437", "0.5523971", "0.5518416", "0.5509875", "0.5498841", "0.549406", "0.54913527", "0.54880005", "0.5485214", "0.5484574", "0.5475478", "0.5464623", "0.54643923", "0.54621565", "0.5458454" ]
0.7369565
0
Obtiene el nombre del proyecto
public String getNombre() { return nombre; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getProjectName();", "String getProjectName();", "public static String getName() {\n\t\treturn ProjectMain._name;\n\t}", "private String getSimplicityProjectName() {\n return properties.getProperty(\"simplicity.starter.projectName\");\n }", "public String getProjectName() { return DBCurrent.getInstance().projectName(); }", "public String getProjectName() { return DBCurrent.getInstance().projectName(); }", "@Override\r\n\tString getProjectName();", "public String getProjectName(){\n return projectModel.getProjectName();\n }", "public String getNiceName()\n {\n String name = getBuildFile().getName();\n\n return Utility.replaceBadChars(name);\n }", "private static String nameOf(GitHubProject project) {\n return String.format(\"[%s/%s](%s)\",\n project.organization().name(), project.name(), project.scm().toString());\n }", "public static String name(){\n return \"10.Schneiderman.Lorenzo\"; \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}", "@Override\n\tpublic String getName() {\n\t\treturn nombre;\n\t}", "public static String getActiveProjectName() {\r\n Project project = ProjectPlugin.getPlugin().getProjectRegistry().getCurrentProject();\r\n \r\n if (project == null)\r\n project = ProjectPlugin.getPlugin().getProjectRegistry().getDefaultProject();\r\n \r\n return project.getName();\r\n }", "String getName() ;", "public String getNamePro() {\n return namePro;\n }", "public static String getAppName(){\r\n return getProperty(\"name\", \"Jin\");\r\n }", "@Override\n\tpublic String getResProjectName() {\n\t\treturn applCenter;\n\t}", "public java.lang.String getRndProjectName() {\n return rndProjectName;\n }", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();" ]
[ "0.69750535", "0.68752605", "0.68371063", "0.6778379", "0.6546513", "0.6546513", "0.65101445", "0.6500836", "0.6358117", "0.63520074", "0.6309388", "0.63090366", "0.6301331", "0.6248439", "0.6150765", "0.6140678", "0.61084044", "0.6098592", "0.6095646", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734", "0.6093734" ]
0.0
-1