query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Gets the PlayerCode of this GameMove.
public PlayerCode getPlayerCode(){ return this.playerCode; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getPlayerNumber() {\n\t\tif(this.player == null) return 0;\n\t\telse return this.player.number;\n\t}", "public int getPlayerNumber() {\n\t\treturn playerNumber;\n\t}", "public int getPlayerNumber() {\n\t\treturn playerNumber;\n\t}", "public int getPlayer() {\r\n\t\treturn myPlayer;\r\n\t}", "public int getPlayer() {\r\n\t\treturn player;\r\n\t}", "public int getPlayerNumber() {\n\t\tint playerNumber=super.getPlayerNumber();\n\t\treturn playerNumber;\n\t}", "public int getWhoseMove() {\n\t\treturn playerToMove;\n\t}", "public int getPlayerNumber() {\n return this.playerNumber;\n }", "public PlayerNumber whoseTurn() {\n\t\tif (isGameOver()) {\n\t\t\treturn Game.GAME_OVER;\n\t\t}\n\t\treturn nextPlayer;\n\t}", "public int playerTurn() {\n\t\treturn partita.getPlayerTurnNumber();\n\t}", "public int getMyPlayerNumber() {\n if (gameStatus == null || userId == null) return -1;\n if (userId.equals(gameStatus.getPlayerOne())) return 1;\n if (userId.equals(gameStatus.getPlayerTwo())) return 2;\n return -2;\n }", "public java.lang.String getPlayerId() {\n java.lang.Object ref = playerId_;\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 playerId_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public int getIdPlayer() {\n\t\treturn idPlayer;\n\t}", "public byte getPlayerId() {\n return playerId;\n }", "public int getPlayerNumber() {\n return playerNumber;\n }", "@java.lang.Override\n public java.lang.String getPlayerId() {\n java.lang.Object ref = playerId_;\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 playerId_ = s;\n return s;\n }\n }", "public final int getPlayerIndex() {\r\n return this.playerIndex;\r\n }", "public String getPositionCode() {\n\t\treturn positionCode;\n\t}", "public long getPlayerId() {\n return playerId_;\n }", "public int getPlayerId() {\r\n\t\treturn playerId;\r\n\t}", "public int getComMove() {\n\n int move;\n\n // Checks if a computer played a move in that spot\n for (int i = 0; i < getBoardSize(); i++) {\n if (playBoard[i] != REAL_PLAYER && playBoard[i] != COM_PLAYER) {\n char currPlace = playBoard[i];\n playBoard[i] = COM_PLAYER;\n\n if (winCheck() == 3) {\n setMove(COM_PLAYER, i);\n return i;\n }\n else {\n playBoard[i] = currPlace;\n }\n }\n }\n\n // Check to block human player from winning\n for (int i = 0; i < getBoardSize(); i++) {\n if (playBoard[i] != REAL_PLAYER && playBoard[i] != COM_PLAYER) {\n char currPlace = playBoard[i];\n playBoard[i] = REAL_PLAYER;\n\n if (winCheck() == 2) {\n setMove(COM_PLAYER, i);\n return i;\n }\n else {\n playBoard[i] = currPlace;\n }\n }\n }\n\n // If play spot is empty, then make move\n do {\n move = randMove.nextInt(getBoardSize());\n } while (playBoard[move] == REAL_PLAYER || playBoard[move] == COM_PLAYER);\n setMove(COM_PLAYER, move);\n\n return move;\n }", "public int getPlayerID() {\r\n\t\treturn playerID;\r\n\t}", "public int getPlayerID() {\r\n\t\treturn playerID;\r\n\t}", "public String getPlayerId() {\n\t\treturn playerId;\n\t}", "public int getPlayerID() {\n\t\treturn playerID;\n\t}", "public PlayerID getPlayer(){\n\t\treturn this.player;\n\t}", "public int getBoardCode() {\r\n\t\treturn boardCode;\r\n\t}", "public Integer getPlayerId() {\n return PlayerId;\n }", "public long getPlayerId() {\n return playerId_;\n }", "public int getPlayerTurn() {\r\n\t\treturn this.playerTurn;\r\n\t}", "public int getPlayer()\n {\n return this.player;\n }", "public int getCurrentPlayer() {\n\t\treturn player;\n\t}", "public int getPlayerPosition(int player)\n {\n return players[player];\n }", "public String getCurrentPlayer() {\r\n return this.playerIds[this.currentPlayer];\r\n }", "GameCode getGameCode(Long gameId);", "public Position getPlayerPiecePosition(int playerNum) {\n return playerPiecePositions[playerNum];\n }", "public int getComputerMove()\n {\n int move;\n\n // First see if there's a move O can make to win\n for (int i = 0; i < BOARD_SIZE; i++) {\n if (mBoard[i] != HUMAN_PLAYER && mBoard[i] != COMPUTER_PLAYER) {\n char curr = mBoard[i];\n mBoard[i] = COMPUTER_PLAYER;\n if (checkForWinner() == 3) {\n mBoard[i] = curr;\n return i;\n }\n else\n mBoard[i] = curr;\n }\n }\n\n // See if there's a move O can make to block X from winning\n for (int i = 0; i < BOARD_SIZE; i++) {\n if (mBoard[i] != HUMAN_PLAYER && mBoard[i] != COMPUTER_PLAYER) {\n char curr = mBoard[i]; // Save the current number\n mBoard[i] = HUMAN_PLAYER;\n if (checkForWinner() == 2) {\n //mBoard[i] = COMPUTER_PLAYER;\n mBoard[i] = curr;\n return i;\n }\n else\n mBoard[i] = curr;\n }\n }\n\n // Generate random move\n do\n {\n move = mRand.nextInt(BOARD_SIZE);\n } while (mBoard[move] == HUMAN_PLAYER || mBoard[move] == COMPUTER_PLAYER);\n\n return move;\n }", "public int getCurrentPlayer() {\n return player;\n }", "public Player getFromPlayer()\n {\n // RETURN the CardMessage's fromPlayer\n return this.fromPlayer;\n }", "public int getPlayerToken() {\n\t\treturn playerToken;\n\t}", "public Byte getPacketCode() {\n return packetCode;\n }", "public POGOProtos.Rpc.CombatProto.CombatPlayerProto getPlayer() {\n if (playerBuilder_ == null) {\n return player_ == null ? POGOProtos.Rpc.CombatProto.CombatPlayerProto.getDefaultInstance() : player_;\n } else {\n return playerBuilder_.getMessage();\n }\n }", "@Override\n public Player getWinningPlayer() {\n return wonGame ? currentPlayer : null;\n }", "public int getPlayerID() {\r\n return playerID;\r\n }", "@Override\n public int getWinner()\n {\n return currentPlayer;\n }", "public java.lang.String getPosCode () {\r\n\t\treturn posCode;\r\n\t}", "public final int getGameKey() {\n\t\treturn mGameKey;\n\t}", "java.lang.String getPlayerId();", "@java.lang.Override\n public POGOProtos.Rpc.CombatProto.CombatPlayerProto getPlayer() {\n return player_ == null ? POGOProtos.Rpc.CombatProto.CombatPlayerProto.getDefaultInstance() : player_;\n }", "public int activePlayer() {\n return this.activePlayer;\n }", "public int getPlayerID() {\n return playerID;\n }", "public short getPlayerID() {\n\n return m_playerID;\n }", "public char getPlayer() {\n return player;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getPlayerIdBytes() {\n java.lang.Object ref = playerId_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n playerId_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public String getPlayerID() {\n return playerID;\n }", "GameCode getGameCode(String gameCode);", "@Override\n public int getPlayerHashID() {\n return this.hashID;\n }", "@Override\n\tpublic java.lang.String getPositionCode() {\n\t\treturn _dmGTShipPosition.getPositionCode();\n\t}", "public Player getPlayerToMove()\n {\n return playerToMove;\n }", "public String getId() {\n\t\treturn this.playerid;\n\t}", "public com.google.protobuf.ByteString\n getPlayerIdBytes() {\n java.lang.Object ref = playerId_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n playerId_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public int getPlayerPosition(String playerName) throws Exception {\n\n if (listaJogadoresFalidos.contains(playerName)) {\n throw new Exception(\"Player no longer in the game\");\n }\n\n int Id = this.getJogadorByName(playerName).getId();\n return posicoes[Id];\n }", "public int getCode() {\n return code_;\n }", "public int getCode() {\n return code_;\n }", "public Player getPlayer() {\n\t\t\treturn player;\n\t\t}", "public String getPlayer() {\r\n return player;\r\n }", "public int getId() {\n return playerId;\n }", "public Player getPlayer() {\n\t\treturn this.player;\n\t}", "public Sprite getPlayer() {\n\t\treturn player;\n\t}", "public int getCode() {\n return code_;\n }", "public int getCode() {\n return code_;\n }", "public String getPlayer() {\n return p;\n }", "@Override\n\tpublic int getPlayerTurn() {\n\t\treturn super.getPlayerTurn();\n\t}", "public final Player getPlayer() {\n return player;\n }", "public int getPlayersPiece() {\n return playersPiece;\n }", "public int getPlayerID(){\n\t\treturn 0;\n\t\t/*\n\t\ttry{\n\t\t\tint player_id=-1;\t\t\t//save player_id, start with -1 as unknown\n\t\t\tString request = \"{\\\"jsonrpc\\\": \\\"2.0\\\", \\\"method\\\": \\\"Player.GetActivePlayers\\\", \\\"id\\\": 1}\";\n\t\t\tString url = kodiURL + URLEncoder.encode(request, \"UTF-8\");\n\t\t\t//send request\n\t\t\tJSONObject result = Connectors.httpGET_JSON(url.trim());\n\t\t\tSystem.out.println(\"result: \" + result);\t\t//debug\n\t\t\t//connection error\n\t\t\tif (result.toJSONString().trim().matches(\".*<connection error>.*\")){\n\t\t\t\treturn -2;\n\t\t\t}\n\t\t\tplayer_id = Integer.parseInt(result.get(\"id\").toString());\n\t\t\treturn player_id;\t\t//return ID if found\n\t\t\t\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn -1;\n\t\t}\n\t\t*/\n\t}", "public char getCurrentPlayer() {\n\t\treturn currentPlayer;\n\t}", "int getPlayerLocation(Player p) {\n\t\t\treturn playerLocationRepo.get(p);\n\t\t}", "public String getCurrentPlayer() {\n\t\treturn _currentPlayer;\n\t}", "public int getPlace(Player player) {\r\n\t\tif (player != null) {\r\n\t\t\tfor (Entry<Integer, Player> e : players.entrySet()) {\r\n\t\t\t\tif (player.getId() == e.getValue().getId())\r\n\t\t\t\t\treturn e.getKey();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn -1;\r\n\t}", "public int getPlayerX() {\n return playerX;\n }", "public int returnAndUsePlayerNumber() {\r\n\t\tfor (int no = 1; no < this.playerNumbers.length; no++) {\r\n\t\t\tif (!this.playerNumbers[no]) {\r\n\t\t\t\tthis.playerNumbers[no] = true;\r\n\t\t\t\treturn no;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn -1;\r\n\t}", "public int getCurrentPlayer(){\n return this.currentPlayer;\n }", "public static int currentPlayerIndex() {\n return turn-1;\n }", "public Player getPlayer() {\n\t\treturn this.player;\r\n\t}", "public String getCode() {\n return (String) get(\"code\");\n }", "public int getActivePlayer() {\n return activePlayer;\n }", "com.google.protobuf.ByteString\n getPlayerIdBytes();", "public int getCode() {\n\t\treturn this.code;\n\t}", "public Player getPlayer() {\n\t\treturn player;\n\t}", "public Player getPlayer() {\n\t\treturn player;\n\t}", "public Player getPlayer() {\n\t\treturn player;\n\t}", "public Player getPlayer() {\n\t\treturn player;\n\t}", "public Player getPlayer() {\n\t\treturn player;\n\t}", "public Player getPlayer() {\n\t\treturn player;\n\t}", "public Player getPlayer() {\n\t\treturn player;\n\t}", "public int getWhoseTurn() {\n if (gameStatus == null || gameStatus.getActivePlayer() == null) return -1;\n if (gameStatus.getActivePlayer().equals(gameStatus.getPlayerOne())) return 1;\n if (gameStatus.getActivePlayer().equals(gameStatus.getPlayerTwo())) return 2;\n return -2;\n }", "public int getCode() {\r\n\t\t\treturn code;\r\n\t\t}", "int getPlayerId();", "int getPlayerId();" ]
[ "0.66078186", "0.6392881", "0.6392881", "0.63839763", "0.6370088", "0.63690597", "0.6359564", "0.6352533", "0.62754697", "0.624726", "0.6206425", "0.6177825", "0.61598855", "0.6155457", "0.61507076", "0.6139695", "0.61277884", "0.6123063", "0.61227953", "0.6107058", "0.6089031", "0.60881317", "0.60881317", "0.60695", "0.60580426", "0.60505754", "0.6029421", "0.6028927", "0.6015544", "0.60091305", "0.6001699", "0.5995284", "0.59833425", "0.59784085", "0.5951538", "0.59342533", "0.5932733", "0.59210855", "0.58927643", "0.5876108", "0.58677584", "0.586614", "0.58522946", "0.58314705", "0.5828136", "0.582204", "0.5816426", "0.58152777", "0.5814614", "0.5811637", "0.5811529", "0.5808486", "0.5807024", "0.5805891", "0.58022565", "0.58003795", "0.5788354", "0.57849723", "0.5760969", "0.57485425", "0.57478696", "0.57294774", "0.5697865", "0.5697865", "0.5689802", "0.56893307", "0.5678118", "0.5667132", "0.5650865", "0.5642061", "0.5642061", "0.5639681", "0.56272715", "0.56222695", "0.5619833", "0.56185406", "0.56113505", "0.5611012", "0.5609926", "0.56094044", "0.5608142", "0.5607761", "0.5606131", "0.5603192", "0.5598828", "0.55839866", "0.55711526", "0.55692524", "0.5568315", "0.55595917", "0.55595917", "0.55595917", "0.55595917", "0.55595917", "0.55595917", "0.55595917", "0.5551978", "0.5541858", "0.5539015", "0.5539015" ]
0.7680016
0
Interface for callback invocation when wifi direct info changed.
public interface IWifiP2pListener { void onWiFiStateChange(int state); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t\t\t\t\tpublic void onNotifyWifiConnected()\n\t\t\t\t\t{\n\t\t\t\t\t\tLog.v(TAG, \"have connected success!\");\n\t\t\t\t\t\tLog.v(TAG, \"###############################\");\n\t\t\t\t\t}", "@Override\n\t\t\t\t\tpublic void onNotifyWifiConnectFailed()\n\t\t\t\t\t{\n\t\t\t\t\t\tLog.v(TAG, \"have connected failed!\");\n\t\t\t\t\t\tLog.v(TAG, \"###############################\");\n\t\t\t\t\t}", "public interface ActWifiListener {\n\n\n void neighbourWIFI(NearbyWifi responseObj);\n void userInfo(UserInfoResponse userInfoResponseObj);\n void deviceStatus(DeviceStatusResponse responseObj);\n void deviceInfo(DeviceInfoResponse responseObj);\n void getSSID(GetSSIDResponse responseObj);\n void connectedDevices(ConnectedDeviceResponse responseObj);\n void allJsonResponse(String responseObj);\n void updateDetails(UpdateDetailsResponse responseObj);\n void deviceReboot(DeviceRebootResponse responseObj);\n\n\n}", "@Override\n\tpublic void onConnectionInfoAvailable(WifiP2pInfo info) {\n\t}", "public void handleStatusUpdated() {\n copyWifiStates();\n notifyListenersIfNecessary();\n }", "@Override\r\n\tprotected void processInWifiEvent(InWifiEvent arg0) {\n\t\t\r\n\t}", "public interface OnConnectivityChangedListener {\n void onConnectivityChanged(NetworkMonitor.State state);\n}", "private void updateConnectedFlags() {\n ConnectivityManager connMgr =\n (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);\n\n NetworkInfo activeInfo = connMgr.getActiveNetworkInfo();\n if (activeInfo != null && activeInfo.isConnected()) {\n wifiConnected = activeInfo.getType() == ConnectivityManager.TYPE_WIFI;\n mobileConnected = activeInfo.getType() == ConnectivityManager.TYPE_MOBILE;\n } else {\n wifiConnected = false;\n mobileConnected = false;\n }\n wifiConnected = true;\n mobileConnected = true;\n System.out.println(\"Change 3\");\n }", "public interface WifiInfoDataSource {\n interface LoadWifiInfoCallback{\n void onWifiInfoLoaded(WiFiInfo wifiInfo);\n void onDataNotFound();\n }\n interface LoadWifiInfoListCallback{\n void onWifiInfoLoaded(List<WiFiInfo> wifiInfoList);\n void onDataNotFound();\n }\n //insert WifiInfo\n void insertWifiInfo(WiFiInfo wifiInfo);\n\n //List<WiFiInfo>\n void queryWifiInfoListInfo(LoadWifiInfoListCallback loadWifiInfoListCallback);\n\n //<WifiInfo> from ssid\n void queryWifiInfo(String ssid,LoadWifiInfoCallback loadWifiInfoCallback);\n\n //delete WiFiInfo\n void deleteWiFiInfo(WiFiInfo wiFiInfo);\n}", "public void onLocationChanged(Location location) {\n Log.i( \"wifiMonitor\", location.toString() );\n\n }", "@Override\n public void onSuccess() {\n Toast.makeText(getApplicationContext(), \"Connect WiFI Direct.\",\n Toast.LENGTH_SHORT).show();\n\n startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));\n }", "@Override\n public void musicPlayerInfo(WifiP2pInfo info) {\n\n }", "public interface OnNetworkScanTypeListener {\n void onNetworkScanTypeChanged(int type);\n }", "@Override\r\n public void onDeviceStatusChange(GenericDevice dev, PDeviceHolder devh,\r\n PHolderSetter status) {\n\r\n }", "@Override\n\tpublic void onDeviceChangeInfoSuccess(FunDevice funDevice) {\n\n\t}", "public interface WifiConnectionStateInterface {\n void checkSocketConnection();\n}", "@Override\n public void onReceive(Context context, Intent intent) {\n String currentLatitude = \"unknown\", currentLongitude = \"unknown\";\n String action = intent.getAction();\n if (action.equals(WifiManager.NETWORK_STATE_CHANGED_ACTION)) {\n NetworkInfo networkInfo = (NetworkInfo)intent.getParcelableExtra(WifiManager.EXTRA_NETWORK_INFO);\n if (networkInfo.getState().equals(NetworkInfo.State.CONNECTED)) {\n wardrivingActivity.updateConnectionInfo(\"CONNECTED\");\n } else if (networkInfo.getState().equals(NetworkInfo.State.CONNECTING)) {\n wardrivingActivity.updateConnectionInfo(\"CONNECTING...\");\n } else if (networkInfo.getState().equals(NetworkInfo.State.DISCONNECTED)) {\n wardrivingActivity.updateConnectionInfo(\"DISCONNECTED\");\n } else if (networkInfo.getState().equals(NetworkInfo.State.DISCONNECTING)) {\n wardrivingActivity.updateConnectionInfo(\"DISCONNECTING\");\n } else if (networkInfo.getState().equals(NetworkInfo.State.SUSPENDED)) {\n wardrivingActivity.updateConnectionInfo(\"SUSPENDED\");\n } else {\n wardrivingActivity.updateConnectionInfo(\"UNKNOWN\");\n }\n } else if (action.equals(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION)) {\n List<ScanResult> scanResults = wifiManager.getScanResults();\n for (ScanResult result : scanResults) {\n //prefsEditor.putString(String.valueOf(System.currentTimeMillis()), result.BSSID);\n writeToFile(context, result.BSSID, result.frequency, result.level);\n currentLatitude = getCurrentLatitude(context);\n currentLongitude = getCurrentLongitude(context);\n wardrivingActivity.updateDatabase(result.BSSID, currentLatitude, currentLongitude, \n result.SSID, result.capabilities, result.frequency, result.level);\n }\n //prefsEditor.commit();\n \n // update last scan in the main page:\n Date now = new Date();\n String lastTimeScan = DateFormat.getDateTimeInstance().format(now);\n wardrivingActivity.updateLastScan(lastTimeScan);\n \n wardrivingActivity.stopWapMonitorAndLocationUpdate();\n wardrivingActivity.setSleep(true);\n \n boolean shouldWakeUp = wardrivingActivity.shouldWakeUp();\n if (shouldWakeUp) {\n \n \n SharedPreferences app_preferences = PreferenceManager.getDefaultSharedPreferences(context);\n long sleepInterval = 0;\n \n try {\n sleepInterval = Long.valueOf(app_preferences.getString(\"settings_sleepInterval\", \"30000\")) * 1000;\n } catch (NumberFormatException e) {\n Editor sleepIntervalPref = app_preferences.edit();\n sleepIntervalPref.putString(\"settings_sleepInterval\", \"180\");\n sleepIntervalPref.commit();\n }\n \n Handler handler = new Handler(); \n handler.postDelayed(new Runnable() {\n public void run() { \n wardrivingActivity.startWapMonitorAndLocationUpdate();\n wardrivingActivity.setWakeUp(true);\n } \n }, sleepInterval);\n \n wardrivingActivity.setWakeUp(false);\n }\n \n } else {\n Log.v(DEBUG, \"EORROR. Check WapMonitor.\");\n }\n \n \n }", "public interface Wifi {\n\n\t/**\n\t * Activar el WIFI\n\t */\n\tpublic void activarWifi();\n\t/**\n\t * Desactivar el WIFI\n\t */\n\tpublic void desactivarWifi();\n\t/**\n\t * Verificar si estamos en modo avion\n\t * @return\n\t */\n\tpublic boolean estaEnModoAvion();\n\t\n}", "public interface NetworkStateChangeObserver {\n /**\n * 网络状态消失时\n */\n void onNetworkDisconnected();\n\n /**\n * 当Wifi连接时\n */\n void onWifiConnected();\n\n /**\n * 当移动网络连接时\n */\n void onMobileDataTrafficConnected();\n\n /**\n * 当4G连接时\n */\n void on4GConnected();\n\n\n /**\n * 网络可用的情况(可能是Wifi,流量,蓝牙等网络可用)\n */\n void onNetworkAvailable();\n\n /**\n * 网络完全不可用的情况(Wifi,流量,蓝牙等网络都不可用)\n */\n void onNetworkNotAvailable();\n\n /**\n * 蜂窝网络可用的情况\n */\n void onCellularAvailable();\n\n /**\n * WIFI网络可用的情况\n */\n void onWIFIAvailable();\n\n /**\n * 蓝牙网络可用的情况\n */\n void onBluetoothAvailable();\n\n /**\n * 以太网络可用的情况\n */\n void onEthernetAvailable();\n\n /**\n * VPN网络可用的情况\n */\n void onVPNAvailable();\n\n /**\n * 6LoWPAN 网络可用的情况\n */\n void onLOWPANAvailable();\n}", "private void onConnectivityChanged(NetworkInfo info, boolean isSticky) throws SameThreadException {\n // We only care about the default network, and getActiveNetworkInfo()\n // is the only way to distinguish them. However, as broadcasts are\n // delivered asynchronously, we might miss DISCONNECTED events from\n // getActiveNetworkInfo(), which is critical to our SIP stack. To\n // solve this, if it is a DISCONNECTED event to our current network,\n // respect it. Otherwise get a new one from getActiveNetworkInfo().\n if (info == null || info.isConnected() ||\n !info.getTypeName().equals(mNetworkType)) {\n ConnectivityManager cm = (ConnectivityManager) service.getSystemService(Context.CONNECTIVITY_SERVICE);\n info = cm.getActiveNetworkInfo();\n }\n\n boolean connected = (info != null && info.isConnected() && service.isConnectivityValid());\n String networkType = connected ? info.getTypeName() : \"null\";\n String currentRoutes = dumpRoutes();\n String oldRoutes;\n synchronized (mRoutes) {\n oldRoutes = mRoutes;\n }\n \n // Ignore the event if the current active network is not changed.\n if (connected == mConnected && networkType.equals(mNetworkType) && currentRoutes.equals(oldRoutes)) {\n return;\n }\n if(Log.getLogLevel() >= 4) {\n if(!networkType.equals(mNetworkType)) {\n Log.d(THIS_FILE, \"onConnectivityChanged(): \" + mNetworkType +\n \" -> \" + networkType);\n }else {\n Log.d(THIS_FILE, \"Route changed : \"+ mRoutes+\" -> \"+currentRoutes);\n }\n }\n // Now process the event\n synchronized (mRoutes) {\n mRoutes = currentRoutes;\n }\n mConnected = connected;\n mNetworkType = networkType;\n\n if(!isSticky) {\n if (connected) {\n service.restartSipStack();\n } else {\n Log.d(THIS_FILE, \"We are not connected, stop\");\n if(service.stopSipStack()) {\n service.stopSelf();\n }\n }\n }\n }", "void onGetWifiStateAndDateCursor(Cursor cursor);", "public void onAuthenWifiHotspot(String networkPass, int position) {\n Fragment childFragment = getChildFragmentManager().findFragmentByTag(Constant.TAG_CHILD_SCAN_WIFI_FRAGMENT);\n if (childFragment instanceof WifiChildScanFragment) {\n WifiLocationModel wifiScanWifiModel = ((WifiChildScanFragment) childFragment).getWifiSsidAndPass(position);\n\n String networkSSID = wifiScanWifiModel.getSsid();\n String encryption = wifiScanWifiModel.getEncryption();\n String networkBSSID = wifiScanWifiModel.getBssid();\n\n // Add a new network description to the set of configured networks.\n WifiConfiguration conf = new WifiConfiguration();\n conf.SSID = \"\\\"\" + networkSSID + \"\\\"\";\n\n if (encryption.equals(Constant.WIFI_WEP)) {\n conf.wepKeys[0] = \"\\\"\" + networkPass + \"\\\"\";\n conf.wepTxKeyIndex = 0;\n conf.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);\n conf.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.WEP40);\n } else if (encryption.equals(Constant.WIFI_WPA)) {\n conf.preSharedKey = \"\\\"\" + networkPass + \"\\\"\";\n } else if (encryption.equals(Constant.WIFI_OPEN)) {\n conf.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);\n } else if (encryption.equals(Constant.WIFI_WPA2)) {\n conf.preSharedKey = \"\\\"\" + networkPass + \"\\\"\";\n }\n\n WifiManager wifiManager = (WifiManager) getContext().getSystemService(Context.WIFI_SERVICE);\n int networkId = wifiManager.addNetwork(conf);\n if (networkId != -1) {\n wifiManager.enableNetwork(networkId, true);\n // Use this to permanently save this network\n // Otherwise, it will disappear after a reboot\n wifiManager.saveConfiguration();\n }\n\n // if connect to that wifi hotspot success, we will have state change in wifi.\n // so to listen for state change in wifi, call a broadcast recever\n mListenStateChangeBroadcastReceiver = new ListenStateChangeBroadcastReceiver(this, networkSSID, networkPass, encryption, networkBSSID);\n getContext().registerReceiver(mListenStateChangeBroadcastReceiver, new IntentFilter(WifiManager.NETWORK_STATE_CHANGED_ACTION));\n }\n }", "@Override\n public void onTrafficStatusUpdate() {\n\n }", "public void dispatchNetworkStateChange(NetworkInfo networkInfo) {\n this.handler.sendMessage(this.handler.obtainMessage(9, networkInfo));\n }", "public abstract void onNetworkStateChange(@NonNull State newState);", "@Override\n public void musicPlayerDetails(WifiP2pDevice device) {\n\n }", "void onConnectToNetByIPSucces();", "@Override\n public void onEnabled() {\n mDiscovery.startDiscovery(mEvents, mWifiStateManager.getWifiManager());\n updateList();\n }", "private void onApnChanged() {\n boolean isConnected;\n\n isConnected = (state != State.IDLE && state != State.FAILED);\n\n // TODO: It'd be nice to only do this if the changed entrie(s)\n // match the current operator.\n createAllApnList();\n if (state != State.DISCONNECTING) {\n cleanUpConnection(isConnected, Phone.REASON_APN_CHANGED);\n if (!isConnected) {\n trySetupData(Phone.REASON_APN_CHANGED);\n }\n }\n }", "@Override\n\tprotected void onNetworkConnected(NetType type) {\n\n\t}", "public interface onDeviceIsOnline {\n void onDeviceIsOnline(boolean isOnline);\n}", "void onDeviceProfileChanged(DeviceProfile dp);", "@Override\n\tpublic void onTrafficStatusUpdate() {\n\n\t}", "protected abstract void onConnect();", "public void OnConnectSuccess();", "private void sendUpdateConnectionInfo() {\n\n }", "@Override\r\n public boolean connectedWifi() {\r\n return NMDeviceState.NM_DEVICE_STATE_ACTIVATED.equals(nwmDevice.getState().intValue());\r\n }", "public interface OnConnectListener {\n void onSuccess(AWSIotDevice device);\n\n void onFail();\n\n}", "public abstract void onConnect();", "@Override\r\n\tpublic void onNetChange(boolean isNetConnected) {\n\t\tif (isNetConnected) {\r\n\t\t\tShowToast(R.string.network_error_not_connected);\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic void onTrafficStatusUpdate() {\n\r\n\t}", "void notifyConnectionStateChanged(State state);", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tWifiManager wm=(WifiManager)getSystemService(WIFI_SERVICE);\n\t\t\t\tif(wm.isWifiEnabled())\n\t\t\t\t{\n\t\t\t\t\tToast.makeText(MainActivity.this,\"WIFI:ON\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\tWifiInfo wi=wm.getConnectionInfo();\n\t\t\t\t\tif(wi.getNetworkId()==-1)\n\t\t\t\t\t{\n\t\t\t\t\t\tToast.makeText(MainActivity.this,\"WIFI IS NOT CONNECT TO ANY DEVICE\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tToast.makeText(MainActivity.this,\"WIFI IS CONNECTED\", Toast.LENGTH_SHORT).show();\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\tToast.makeText(getApplicationContext(), \"WIFI IS OFF\", Toast.LENGTH_SHORT).show();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}", "public void wifiState(Context context, Intent intent) {\n switch (intent.getIntExtra(\"wifi_state\", 0)) {\n case 1:\n LogUtil.d(Tag, \"Wifi State: Disabled\");\n return;\n case 3:\n LogUtil.d(Tag, \"Wifi State: Enabled\");\n MsgHandlerCenter.dispatchMessageDelay((int) CommonParams.fq, 1000);\n return;\n default:\n return;\n }\n }", "@Override\n public void onWifiNetworkChanged(boolean connected, boolean isFailover) {\n // check Internet connection and notify observers\n mBeaconingManager.notifyInternetCallbacks();\n\n if (connected && mWifiBeaconingState == WifiBeaconingState.CONNECTING) {\n // we were connecting\n // update beaconing state\n mWifiBeaconingState = WifiBeaconingState.CONNECTED;\n // we are connect, act accordingly\n onNetworkConnected();\n } else if (!connected && mWifiBeaconingState == WifiBeaconingState.CONNECTED) {\n // we were disconnected\n // stop receivers\n mBeaconingManager.stopWifiReceiver();\n\n if (NetworkManager.isFindSSID(mVisitedNetworks.peek()) && mBeaconingManager.mIsDesignatedAp\n && startApModeIfPossible()) {\n // previous AP node went offline, and we are supposed to take over, which is what\n // we're doing\n return;\n }\n\n // if not becoming AP, scan for other networks to connect to\n mWifiBeaconingState = WifiBeaconingState.SCANNING;\n mNetManager.initiateWifiScan();\n }\n }", "public abstract void notifyScanResult(int distancesToWallsInEachDirection);", "public abstract void communicationContextChange(long ms, \n\t\t\tContextDescription.Communication.WirelessAccessType wirelessAccessType,\n\t\t\tString accessPointName,\n\t\t\tint signalStrength,\n\t\t\tint receivedDataThroughput,\n\t\t\tint sentDataThroughput,\n\t\t\tint rtt,\n\t\t\tint srt\t);", "void onInternetConnectionLost();", "@Override\n public void onReceive(Context context, Intent intent) {\n OnNetworkStateChangedListener callback = mListener.get();\n if(callback == null) {\n return;\n }\n\n final NetworkState networkState = NetworkDetector.INSTANCE.getNetworkState(context);\n\n /*\n calls callback methods according to the currently active network state\n */\n switch (networkState) {\n case OFFLINE:\n Log.d(TAG, \"network state has changed to : \" + networkState.name());\n callback.onNetworkDisconnected();\n break;\n\n case WIFI_AVAILABLE:\n case MOBILE_AVAILABLE:\n Log.d(TAG, \"network state has changed to : \" + networkState.name());\n callback.onNetworkAvailable();\n break;\n\n case WIFI_CONNECTED:\n case MOBILE_CONNECTED:\n Log.d(TAG, \"network state has changed to : \" + networkState.name());\n callback.onNetworkConnected();\n break;\n }\n }", "@Override\r\n public void onDeviceConnecting(GenericDevice mDeviceHolder,\r\n PDeviceHolder innerDevice) {\n\r\n }", "public void onNetDisConnect() {\n\n\t}", "@Override\r\n\tpublic void onPeersAvailable(WifiP2pDeviceList peers) {\n\t\t\r\n\t}", "@Override\n public void onGetDataAfterScanWifi(ArrayList<WifiLocationModel> wifiScanList) {\n Fragment childFragment = getChildFragmentManager().findFragmentByTag(Constant.TAG_CHILD_SCAN_WIFI_FRAGMENT);\n if (childFragment instanceof WifiChildScanFragment) {\n ((WifiChildScanFragment) childFragment).addWifiHotSpotToRcv(wifiScanList);\n }\n }", "public void driverBaseDataReceivedProxy(PeripheralHardwareDataEvent oEvent);", "@Override\n public void onDeviceStateChange(VirtualDevice virtualDevice, int returncode) {\n\n }", "@Override\n\t public void onReceive(Context context, Intent intent) {\n\t if (intent.getAction().equals(WifiManager.WIFI_STATE_CHANGED_ACTION)) {\n\t int message = intent.getIntExtra(WifiManager.EXTRA_WIFI_STATE, -1);\n//\t Log.d(TAG, \"liusl wifi onReceive msg=\" + message);\n\t switch (message) {\n\t case WifiManager.WIFI_STATE_DISABLED:\n//\t Log.d(TAG, \"WIFI_STATE_DISABLED\");\n\t break;\n\t case WifiManager.WIFI_STATE_DISABLING:\n//\t Log.d(TAG, \"WIFI_STATE_DISABLING\");\n\t break;\n\t case WifiManager.WIFI_STATE_ENABLED:\n//\t Log.d(TAG, \"WIFI_STATE_ENABLED\");\n\n/*\t mWifiManager = (WifiManager)getSystemService(WIFI_SERVICE);\n\t DhcpInfo dhcpinfo = mWifiManager.getDhcpInfo();\n\t address= mWifiAdmin.intToIp(dhcpinfo.serverAddress);\n\t returnToPreviousActivity(address);\n\t unregisterReceiver(mWifiConnectReceiver);*/\n\t break;\n\t case WifiManager.WIFI_STATE_ENABLING:\n//\t Log.d(TAG, \"WIFI_STATE_ENABLING\");\n\t break;\n\t case WifiManager.WIFI_STATE_UNKNOWN:\n//\t Log.d(TAG, \"WIFI_STATE_UNKNOWN\");\n\t break;\n\t default:\n\t break;\n\t }\n\t }\n\t }", "@Override\n public void linkStatusChanged(String connectorId, boolean connected) {\n }", "@Override\n public void updateConnectState(boolean connected){\n if(connected){\n if(DBG) Log.i(DEBUG_TAG, \"Activity received connected notification\");\n setupTopics();\n }else{\n resetTopics();\n if(DBG) Log.i(DEBUG_TAG, \"Activity received disconnect notification\");\n }\n\n }", "@Override\n public void onFailure(int reasonCode) {\n Toast.makeText(getApplicationContext(), \"Please turn on WiFi. Error Code \" + reasonCode,\n Toast.LENGTH_SHORT).show();\n }", "void onConnectedAsServer(String deviceName);", "@Override\n public void onBlockedStatusChanged(Network network, boolean blocked) {\n ProvisionLogger.logd(\"NetworkMonitor.onBlockedStatusChanged: \" + network\n + \" blocked=\" + blocked);\n if (blocked) {\n return;\n }\n synchronized (NetworkMonitor.this) {\n if (mCallback != null) {\n mCallback.onNetworkConnected();\n }\n }\n }", "protected void onConnect() {}", "void onApPowerStateChange(PowerState state);", "void onConnect( );", "@Override\n public void onDnsSdServiceAvailable(String instanceName, String registrationType, WifiP2pDevice sourceDevice) {\n Log.i(TAG, \"BonjourServiceAvailable: \\ninstanceName: \" + instanceName + \"\\n \" + sourceDevice.toString());\n }", "public interface OnRSSISuccessListener {\r\n public void onSuccess(int rssi);\r\n}", "private void checkWifi() {\n\t\tConnectivityManager manger = (ConnectivityManager) context\n\t\t\t\t.getSystemService(Context.CONNECTIVITY_SERVICE);\n\t\tNetworkInfo info = manger.getActiveNetworkInfo();\n\t\tboolean flag = (info != null && info.isConnected());\n\t\tif (!flag) {\n\t\t\tToast.makeText(context, R.string.communication, Toast.LENGTH_LONG)\n\t\t\t\t\t.show();\n\t\t\tnew Handler().postDelayed(new Runnable() {\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tcheckWifi();\n\t\t\t\t}\n\t\t\t}, 4000);\n\t\t} else {\n\t\t\tRegisterActivity.REGISTER_FLAG = true;\n\t\t}\n\t}", "@Override\r\n\t\tpublic void onGetNetworkState(int iError) {\n\t\t\tToast.makeText(NearActivity.this, \"您的网络出错啦!\", Toast.LENGTH_LONG).show();\r\n\t\t}", "public void turnOnWifi() {\n WifiManager wifi = (WifiManager) getActivity().getApplicationContext().getSystemService(Context.WIFI_SERVICE);\n wifi.setWifiEnabled(true);\n showScanWifiAround();\n }", "public void onIBeaconServiceConnect();", "void onDownloadsChanged();", "void onDownloadsChanged();", "private void updateConnectedState() {\n NetworkInfo activeNetworkInfo = this.mConnectivityManager.getActiveNetworkInfo();\n this.mIsNetworkConnected = activeNetworkInfo != null && activeNetworkInfo.isConnected();\n }", "public interface OnBluetoothWriteListener {\n\t\tvoid onWrite();\n\t}", "void onConnect();", "@Override\n public void onConnect(int i) {\n addLog(\"init MSDPService done\");\n // Get Virtual Device Service Instance\n mVirtualDeviceManager = (VirtualDeviceManager) DvKit.getInstance().getKitService(VIRTUAL_DEVICE_CLASS);\n // Register virtual appliance observer\n mVirtualDeviceManager.subscribe(EnumSet.of(VIRTUALDEVICE), observer);\n }", "abstract void onConnect();", "@Override\n public void onReceive(Context arg0, Intent arg1) {\n refreshNetStatus();\n updateFromProvider();\n }", "void onIceConnectionChange(boolean connected);", "public interface NetworkConnectedCallback {\n void onNetworkConnected();\n }", "public interface IWifiManager {\n\n\n\n\n /* *********************************************************************************************\n * WIFI\n * *********************************************************************************************\n */\n\n\n boolean isWifiConnected();\n\n String getSSID();\n\n String getBSSID();\n\n String getIpAddress();\n\n int getRSSI();\n\n int getFrequency();\n\n int getLinkSpeed();\n\n int getNetworkId();\n\n String getNetmask();\n\n String getServerAddress();\n\n String getDNS1();\n\n String getDNS2();\n\n\n /* *********************************************************************************************\n * CONNECTED DEVICES\n * *********************************************************************************************\n */\n\n\n boolean isReachable(InetAddress addr);\n\n String getMAC(InetAddress addr);\n\n String getName(InetAddress addr);\n\n String getBrand(InetAddress addr);\n\n\n\n}", "public LowLevelNetworkHandler setCallback(Callback callback);", "void onDiscoverPeersSuccess();", "public void onNetConnected(AbNetUtils.NetType type) {\n\n\t}", "@Override\n\t\t\tpublic void onReceive(Context context, Intent intent) {\n\t\t\t\tnotifyNetworkStateChanged();\n\t\t\t}", "private ConnectivityManager.NetworkCallback getNetworkCallback() {\n return new NetworkRequestCallback();\n }", "@Override\r\n public void onGpsStatusChanged(int event) {\n\r\n }", "@Override\n\t\t\tpublic void fDisConnect(NativeLong loginID, String devIP, long devPor, long user) {\n\t\t\t\tSystem.out.println(\"回调成功\");\n\t\t\t}", "public interface OnConnectListener {\n void onStatusConnection(AndroidDevice androidDevice, boolean connected);\n void onConnected(AndroidDevice androidDevice);\n void onDisconnected(AndroidDevice androidDevice);\n void onTryConnect(AndroidDevice androidDevice);\n}", "@Override\n public void onArrivedWayPoint(int arg0) {\n\n }", "void onConfigChanged(ConfigUpdate update);", "@Override\n public void onInernetConnectionStateChanged(Intent intent) {\n if (NETWORK_CUSTOM_AVAILABILITY_INTENT.equals(intent.getAction())) {\n\n if (intent.getIntExtra(\"STATUS\", NETWORK_NOT_AVAILABLE) == NETWORK_AVAILABLE) {\n\n if (firstResponsePassed) {\n onInternetConnectionResume();\n } else {\n\n Log.d(TAG, \"Internet available first intent recieved\");\n\n firstResponsePassed = true;\n internetAvailable = true;\n }\n\n\n } else if (intent.getIntExtra(\"STATUS\", NETWORK_NOT_AVAILABLE) == NETWORK_NOT_AVAILABLE) {\n\n onInternetConnectionLost();\n Log.d(TAG, \"Change Detected. Not Avaiable -1\");\n\n }\n\n //Received on requesting only\n }\n\n// else if (NETWORK_CUSTOM_AVAILABILITY_ASYNC_RESPONSE_INTENT.equals(intent.getAction())) {\n//\n// if (intent.getIntExtra(\"STATUS\", NETWORK_NOT_AVAILABLE) == NETWORK_AVAILABLE) {\n//\n// //Internet availabale\n//\n// if (firstResponsePassed) {\n//\n// Log.d(TAG, \"Response Detected. Available 1 but as first <negleced> \");\n// onInternetConnectionResume();\n//\n// } else {\n//\n// Log.d(TAG, \"Response Detected. Available 1\");\n//\n// firstResponsePassed = true;\n// internetAvaiable = true;\n// }\n//\n// } else if (intent.getIntExtra(\"STATUS\", NETWORK_NOT_AVAILABLE) == NETWORK_NOT_AVAILABLE) {\n//\n// //Interner not avaiable\n// Log.d(TAG, \"Response Detected. unAvailable -1\");\n// onInternetConnectionLost();\n//\n// }\n// }\n }", "@Override\n\t\tpublic void onReceive(Context context, Intent intent) {\n\n\t\t\tif (intent.getAction().equals(\n\t\t\t\t\tWifiManager.NETWORK_STATE_CHANGED_ACTION)) {\n\t\t\t\tNetworkInfo info = intent\n\t\t\t\t\t\t.getParcelableExtra(WifiManager.EXTRA_NETWORK_INFO);\n\t\t\t\tif (info.getState().equals(NetworkInfo.State.DISCONNECTED)) {\n\t\t\t\t\twifiIpState.setText(getResources().getString(\n\t\t\t\t\t\t\tR.string.connect_state_non));\n\t\t\t\t\twifiIpState.setTextColor(getResources().getColor(\n\t\t\t\t\t\t\tR.color.red));\n\t\t\t\t} else if (info.getState().equals(NetworkInfo.State.CONNECTED)) {\n\t\t\t\t\tif (Utils.isWiFiActive(getApplicationContext())) {\n\t\t\t\t\t\twifiIpState.setText(Utils\n\t\t\t\t\t\t\t\t.getWiFiIp(getApplicationContext()));\n\t\t\t\t\t\twifiIpState.setTextColor(getResources().getColor(\n\t\t\t\t\t\t\t\tR.color.black));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "@Override\r\n public void onDeviceUpdate(GenericDevice dev, PDeviceHolder devh,\r\n DeviceUpdate paramFitnessHwApiDeviceFeedback) {\n\r\n }", "public void onServiceConnected() {\r\n\t\tapiEnabled = true;\r\n\r\n\t\t// Display the list of calls\r\n\t\tupdateList();\r\n }", "@Override\n\tpublic void onDataConnectionStateChanged(int state) {\n\t\tLog.v(\"FMT\", \"Connection Listener appelé. State : \"+state);\n\t\tsuper.onDataConnectionStateChanged(state);\n\t}", "@Subscribe(threadMode = ThreadMode.MAIN)\n public void onNetworkInfoReceived(OnReceiverNetInfoEvent event){\n\n WifiP2pInfo info = event.getInfo();\n\n // InetAddress from WifiP2pInfo struc.\n groupOwnerAddress = info.groupOwnerAddress.getHostAddress();\n // String port = \"8888\";\n\n\n // After the group negotiation, we can determine the group owner\n // (server).\n if(info.groupFormed && info.isGroupOwner){\n Toast.makeText(getContext(), \"Group formed. Host\", Toast.LENGTH_SHORT).show();\n if(peersDialog.isShowing())peersDialog.dismiss();\n\n // starting a data thread with the latest connected device\n Wifip2pService mService = new Wifip2pService(getContext(), mHandler,port, true, groupOwnerAddress);\n // assign the name of the latest connect device to this thread so we keep track\n mService.deviceName = devicesConnected.get(devicesConnected.size() - 1);\n connectionThreads.add(mService);\n\n\n // One common case is creating a group owner thread and accepting\n // incoming connections.\n } else if(info.groupFormed){\n Toast.makeText(getContext(), \"Connected as Peer\", Toast.LENGTH_SHORT).show();\n if(peersDialog.isShowing())peersDialog.dismiss();\n\n // starting a data thread with the owner\n Wifip2pService mService = new Wifip2pService(getContext(), mHandler, port, false, groupOwnerAddress);\n mService.deviceName = devicesConnected.get(devicesConnected.size() - 1);\n connectionThreads.add(mService);\n\n }\n\n }", "@Override\n\tpublic void configureWifi(String ssid, String pwd) throws RemoteException {\n\t model.execute(\"CONNECT\", ssid, pwd);\n\t}", "@Override\r\n\tpublic void update(Observable observable, Object data) {\n\t\tfinal int eventID = ((NotificationInfoObject) data).actionID;\r\n\r\n\t\tif ((nwrap.getApplicationState() == ApplicationState.IDLE) || (nwrap.getApplicationState() == ApplicationState.INST_SERVICE)) {\r\n\r\n\t\t\tswitch (eventID) {\r\n\t\t\tcase EventIDs.EVENT_INST_STARTED:\r\n\t\t\t\tLog.d(TAG, \"EVENT_INST_STARTED \");\r\n\t\t\t\tbroadcastIntent(\"org.droidtv.euinstallertc.CHANNEL_INSTALL_START\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase EventIDs.EVENT_INST_STOPPED:\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase EventIDs.EVENT_INST_COMPLETED:\r\n\t\t\t\tLog.d(TAG, \"EVENT_INST_COMPLETED \");\r\n\t\t\t\t// check if channels added /removed\r\n\t\t\t\tnwrap.commitDatabaseToTvProvider(false);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase EventIDs.EVENT_NETWORK_UPDATE_DETECTED:\r\n\t\t\t\tLog.d(TAG, \"EVENT_NETWORK_UPDATE_DETECTED \");\r\n\t\t\t\t// The Update dialog is only needed for UPC operator : CR AN-717\r\n\t\t\t\tLog.d(TAG, \"Current Operator\" + nwrap.getOperatorFromMW());\r\n\t\t\t\tif (nwrap.getOperatorFromMW() == NativeAPIEnums.Operators.UPC){\r\n\t\t\t\t\tLog.d(TAG, \"UPC operator or APMEAbackgroundNWupdateDVBT\\n\");\r\n\t\t\t\t\tif (mContext != null) {\r\n\t\t\t\t\t\t// unregister service from notification framework\r\n\t\t\t\t\t\tntf.unregisterForNotification(thisInstance);\r\n\t\t\t\t\t\tLog.d(TAG, \"service context not null\");\r\n\t\t\t\t\t\t// stop installation if in progress\r\n\t\t\t\t\t\t// nwrap.stopInstallation(false); instead of doing this\r\n\t\t\t\t\t\t// we\r\n\t\t\t\t\t\t// will call stop-restart api in nativeapiwrapper\r\n\t\t\t\t\t\tif (nwrap.ifNetworkChangeDetected() == false) { // AN-49771\r\n\t\t\t\t\t\t\tIntent l_intent = new Intent(mContext, NetworkUpdateDialogActivity.class);\r\n\t\t\t\t\t\t\tl_intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\r\n\t\t\t\t\t\t\tmContext.startActivity(l_intent);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tLog.d(TAG, \"User has already selected Later\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if(nwrap.IsAPMEAbackgroundNWupdate() && (DVBTOrDVBC.DVBT == nwrap.getSelectedDVBTOrDVBCFromTVS())){\r\n\t\t\t\t\tLog.d(TAG,\"APMEA network update\");\r\n\t\t\t\t\t// requirement APMEA Smitha TF515PHIALLMTK01-17521\r\n\t\t\t\t\tif (nwrap.ifNetworkChangeDetected() == false) {\r\n\t\t\t\t\t\tnwrap.showTVNofification(mContext, mContext.getString(org.droidtv.ui.strings.R.string.MAIN_MSG_CHANNEL_UPDATE_NEEDED));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tnwrap.networkChangeDetected(true);\r\n\t\t\t\t}else {\r\n\t\t\t\t\t// for all other non UPC countries\r\n\t\t\t\t\tnwrap.networkChangeDetected(true);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase EventIDs.EVENT_DIGIT_CH_FOUND:\r\n\t\t\t\tLog.d(TAG, \"EventIDs.EVENT_DIGIT_CH_FOUND\");\r\n\t\t\t\t// query mw for digital channel count\r\n\t\t\t\t// update digit channels count\r\n\t\t\t\tnwrap.getDigitalChannelCount();\r\n\t\t\t\tbreak;\r\n\t\t\tcase EventIDs.EVENT_DIGIT_CH_ADDED:\r\n\t\t\t\tLog.d(TAG, \"EventIDs.EVENT_DIGIT_CH_ADDED\");\r\n\t\t\t\tnwrap.getDigitalChannelCount();\r\n\t\t\t\tbreak;\r\n\t\t\tcase EventIDs.EVENT_DIGIT_CH_REMOVED:\r\n\t\t\t\tLog.d(TAG, \"EventIDs.EVENT_DIGIT_CH_REMOVED\");\r\n\t\t\t\tnwrap.getDigitalChannelsRemoved();\r\n\t\t\t\tbreak;\r\n\t\t\tcase EventIDs.EVENT_MAJORVERSION_UPDATE:\r\n\t\t\t\tLog.d(TAG, \"EventIDs.EVENT_MAJORVERSION_UPDATE\");\r\n\t\t\t\tnwrap.setMajorVersion();\r\n\t\t\t\tbreak;\r\n\t\t\tcase EventIDs.EVENT_NEWPRESETNUMBER:\r\n\t\t\t\tint presetNum = -1;\r\n\t\t\t\tString l_msg1 = (String) ((NotificationInfoObject) data).message; \r\n\t\t\t\tpresetNum = Integer.parseInt(l_msg1);\r\n presetAfterBackgroundUpdate = presetNum;\r\n\t\t\t\tbreak;\t\t\t\t\r\n\t\t\tcase EventIDs.EVENT_COMMIT_FINISHED:\r\n\t\t\t\tnwrap.startLogoAssociation(nwrap.getSelectedDVBTOrDVBCFromTVS(), null);\r\n\t\t\t\tbroadcastIntent(\"org.droidtv.euinstallertc.CHANNEL_INSTALL_COMPLETE\");\r\n \tif (presetAfterBackgroundUpdate != -1) { \r\n\t\t\t\t nwrap.HandleTuneToLowestPreset (presetAfterBackgroundUpdate);\r\n }\r\n\t\t\t\tbreak;\r\n\t\t\tcase EventIDs.EVENT_TELENET_NAME_UPDATE:\r\n\t\t\t\tint presetNbr = -1, CABLE_MEDIUM = 1;\r\n\t\t\t\tString l_msg2 = (String) ((NotificationInfoObject) data).message; \r\n\t\t\t\tpresetNbr = Integer.parseInt(l_msg2);\r\n\t\t\t\t/* Currently this will happen only for Telenet */\r\n nwrap.SyncSingleChannelToDatabase (CABLE_MEDIUM, presetNbr);\r\n\t\t\t\tbreak;\r\n\t\t\tcase EventIDs.EVENT_TELENET_MAJOR_VERSION_UPDATE:\r\n\t\t\t\tnwrap.mUpdateDatabaseVersion(true);\r\n\t\t\t\tbroadcastIntent(\"org.droidtv.euinstallertc.CHANNEL_INSTALL_COMPLETE\");\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "void onNetworkCredentialsRequested();" ]
[ "0.72045594", "0.67250156", "0.66877866", "0.6465145", "0.64345247", "0.63670164", "0.6338014", "0.6177378", "0.6158477", "0.61454976", "0.6031254", "0.5981428", "0.5966317", "0.5962803", "0.59499717", "0.59388393", "0.5874587", "0.58388287", "0.58240473", "0.58236235", "0.57825476", "0.5755169", "0.57477117", "0.57458174", "0.5717646", "0.5714055", "0.5709172", "0.57016844", "0.569593", "0.568451", "0.567931", "0.56575644", "0.5651415", "0.56460595", "0.56364626", "0.5634605", "0.5623363", "0.5619756", "0.5609667", "0.5591793", "0.55896", "0.55879474", "0.5567583", "0.5538993", "0.5531507", "0.55227554", "0.5508047", "0.5502424", "0.55023026", "0.54951596", "0.54887354", "0.5476835", "0.54761696", "0.5473175", "0.5466451", "0.546453", "0.5461261", "0.5454443", "0.54478836", "0.5447431", "0.5419367", "0.5416979", "0.5412096", "0.5411328", "0.5409253", "0.54003185", "0.54001194", "0.53999233", "0.5394158", "0.53936344", "0.53862536", "0.53862536", "0.5384679", "0.5376046", "0.53724104", "0.5369471", "0.5368264", "0.5366217", "0.53660977", "0.5360422", "0.53575325", "0.5356414", "0.5354803", "0.5350448", "0.5342589", "0.5339369", "0.5329928", "0.5328588", "0.5327783", "0.532767", "0.5323475", "0.53203416", "0.5320228", "0.5317801", "0.53172076", "0.5308984", "0.5302214", "0.5299602", "0.52995646", "0.528463" ]
0.625969
7
Update the fragment without causing navigator to change view
private void setFragmentParameter(String productId) { String fragmentParameter; if (productId == null || productId.isEmpty()) { fragmentParameter = ""; } else { fragmentParameter = productId; } Page page = MyUI.get().getPage(); page.setUriFragment("!" + JobsView.VIEW_NAME + "/" + fragmentParameter, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void refreshFragment() {\n }", "public abstract void updateFragmentUI();", "private void updateFragment() {\n Fragment fragment = getSupportFragmentManager().findFragmentByTag(CURRENT_FRAGMENT);\n if (fragment != null) {\n FragmentTransaction ft = getSupportFragmentManager().beginTransaction();\n ft.detach(fragment).attach(fragment).commit();\n }\n }", "public void refresh(){\n // close loading dialogs if they are open\n Fragment dialog = getSupportFragmentManager().findFragmentByTag(\"loading\");\n if (dialog != null) {\n loadingDialog.dismiss();\n }\n\n // update timestamp\n if (timestamp != null) {\n TextView time = findViewById(R.id.result_time_text);\n time.setText(getString(R.string.last_result, timestamp));\n }\n\n // destroy and recreate fragments with latest data\n Fragment loadedFragment = getSupportFragmentManager().findFragmentById(R.id.fragment_container);\n Fragment newFragment;\n FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();\n\n if (loadedFragment instanceof PsiFragment) {\n newFragment = PsiFragment.newInstance(psiValues);\n }\n else if (loadedFragment instanceof Pm25Fragment) {\n newFragment = Pm25Fragment.newInstance(pm25Values);\n }\n else{\n newFragment = HomeFragment.newInstance(psiValues,pm25Values);\n }\n transaction.replace(R.id.fragment_container, newFragment);\n transaction.commit();\n }", "public void refreshFragment() {\n currentUser = ((HomeActivity)getActivity()).getCurrentUser();\n stock = ((HomeActivity)getActivity()).getTransferStock();\n selectAll(ORDER_NAME);\n }", "private void setViewFragment(Fragment fragment) {\n currentFragment = fragment;\n FragmentManager manager = getFragmentManager();\n FragmentTransaction transaction = manager.beginTransaction();\n transaction.replace(R.id.container, fragment);\n transaction.commit();\n }", "@AfterViews\n void syncViews() {\n\n setSupportActionBar(mToolbar);\n\n if (mFragmentNumber == REPOS_FRAGMENT_NUMBER) {\n currentFragment = RepoDataFragment_.instantiate(this, RepoDataFragment_.class.getName());\n }\n\n changeFrament(currentFragment);\n\n //mBottomBar = BottomBar.attachShy(mMainCoordinator, mNestedScrollView, getIntent().getExtras());\n\n mBottomBar = BottomBar.attach(this, getIntent().getExtras());\n\n mBottomBar.setItemsFromMenu(R.menu.main_bottom_menu, this);\n }", "void updateView();", "void updateView();", "@Override\n public void onEstadoCambiado() {\n fragment = new ListadoPeticionesRecibidasVista();\n getFragmentManager().beginTransaction().replace(R.id.content_main, fragment ).commit();\n\n }", "private void refreshFragmentAfterdownloadedData() {\n Fragment fragmentToday = new FragmentToday();\n FragmentTransaction ft = getSupportFragmentManager().beginTransaction();\n ft.replace(R.id.fragmentToday, fragmentToday, \"FragmentToday\");\n ft.commit();\n\n Fragment fragment5days = new Fragment5days();\n FragmentTransaction ft5days = getSupportFragmentManager().beginTransaction();\n ft5days.replace(R.id.fragment5days, fragment5days, \"Fragment5days\");\n ft5days.commit();\n }", "@Override\r\n public void changeFragment() {\r\n fm.beginTransaction()\r\n .replace(R.id.fragmentContainer, new ListWonderFragment())\r\n .commit();\r\n }", "private void fragmentChange(){\n HCFragment newFragment = new HCFragment();\n FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();\n\n // Replace whatever is in the fragment_container view with this fragment,\n // and add the transaction to the back stack if needed\n transaction.replace(R.id.hc_layout, newFragment);\n transaction.addToBackStack(null);\n\n // Commit the transaction\n transaction.commit();\n }", "private void changeFragment() {\n TeacherAddNotificationFragment fragment = new TeacherAddNotificationFragment();\n // Put classIds to bundle and set bundle to fragment\n Bundle bundle = new Bundle();\n bundle.putString(\"ListIDs\", classesIds);\n fragment.setArguments(bundle);\n\n // Replace fragment\n getFragmentManager().beginTransaction().replace(R.id.main, fragment)\n .addToBackStack(null)\n .commit();\n }", "private void fillUpFragment() {\n try {\n FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();\n sensorFragment = getSensorFragment();\n transaction.replace(R.id.sensor_frame, sensorFragment, getSensorName());\n transaction.commit();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "@Override\n public void onListFragmentInteraction(Game game) {\n changeFragment(game);\n }", "@Override\n\tpublic void refreshView() {\n\n\t}", "@Override\n public void onViewSelected (int wordPosition) {\n // replace the fragment\n replaceFragment(wordPosition);\n }", "public void updateFragment(int CAT_ID){\n ViewContentFragment f_c_s=new ViewContentFragment();\n if(CAT_ID>0){\n f_c_s.setCat_id(CAT_ID);\n }else{\n f_c_s.setCat_id(1);\n }\n // replace the fragment with the new fragment and add it to BackStack,\n // then pop it from BackStack to get to the old fragment without overlapping the\n // old fragments...\n\n getFragmentManager().beginTransaction().replace(R.id.content_Layout,f_c_s).\n addToBackStack(String.valueOf(CAT_ID)).commit();\n getFragmentManager().popBackStack();\n }", "public abstract void refreshView();", "@Override\n public void onClick(View v) {\n android.app.Fragment onjF = null;\n onjF = new BlankFragment();\n FragmentManager fragmentManager = getFragmentManager();\n fragmentManager.beginTransaction().replace(R.id.fragment,onjF).commit();\n }", "@Override\n\tpublic void OnUpdateNavigation( ) {\n\t\t\n\t\tCalendar calendar1 = Calendar.getInstance();\n\t\tcalendar1.set(Calendar.HOUR_OF_DAY, 0);\n\t\tcalendar1.set(Calendar.MINUTE, 0);\n\t\tcalendar1.set(Calendar.SECOND, 0);\n\t\tcalendar1.set(Calendar.MILLISECOND, 0);\n\t\tthis.selectedDate = calendar1.getTimeInMillis();\n\t\t\n\t\toverviewFragment = new OverviewFragment();\n\t\tBundle bundle = new Bundle();\n\t\tbundle.putLong(\"selectedDate\", this.selectedDate);\n\t\toverviewFragment.setArguments(bundle);\n\n\t\tFragmentTransaction fragmentTransaction1 = this.getSupportFragmentManager().beginTransaction();\n\t\tfragmentTransaction1.replace(R.id.content_frame,\n\t\t\t\toverviewFragment);\n\t\tfragmentTransaction1.commit();\n\t\t\n\t\toverViewNavigationListAdapter.setChoosed(0);\n\t\toverViewNavigationListAdapter.setSubTitle(turnToDate(this.selectedDate));\n\t\toverViewNavigationListAdapter.notifyDataSetChanged();\n\t\t\n\t}", "@Override\n public void run() {\n Fragment fragment = getHomeFragment();\n FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();\n fragmentTransaction.setCustomAnimations(android.R.anim.fade_in,\n android.R.anim.fade_out);\n fragmentTransaction.replace(R.id.frame, fragment, CURRENT_TAG);\n fragmentTransaction.commitAllowingStateLoss();\n }", "@Override\n public void run() {\n Fragment fragment = getHomeFragment();\n FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();\n fragmentTransaction.setCustomAnimations(android.R.anim.fade_in,\n android.R.anim.fade_out);\n fragmentTransaction.replace(R.id.frame, fragment, CURRENT_TAG);\n fragmentTransaction.commitAllowingStateLoss();\n }", "@Override\n public void run() {\n Fragment fragment = getHomeFragment();\n FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();\n fragmentTransaction.setCustomAnimations(android.R.anim.fade_in,\n android.R.anim.fade_out);\n fragmentTransaction.replace(R.id.frame, fragment, CURRENT_TAG);\n fragmentTransaction.commitAllowingStateLoss();\n }", "@Override\n public void run() {\n Fragment fragment = getHomeFragment();\n FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();\n fragmentTransaction.setCustomAnimations(android.R.anim.fade_in,\n android.R.anim.fade_out);\n fragmentTransaction.replace(R.id.frame, fragment, CURRENT_TAG);\n fragmentTransaction.commitAllowingStateLoss();\n }", "@Override\n public void run() {\n Fragment fragment = getHomeFragment();\n FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();\n fragmentTransaction.setCustomAnimations(android.R.anim.fade_in,\n android.R.anim.fade_out);\n fragmentTransaction.replace(R.id.frame, fragment, CURRENT_TAG);\n fragmentTransaction.commitAllowingStateLoss();\n }", "@Override\n public void run() {\n Fragment fragment = getHomeFragment();\n FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();\n fragmentTransaction.setCustomAnimations(android.R.anim.fade_in,\n android.R.anim.fade_out);\n fragmentTransaction.replace(R.id.frame, fragment, CURRENT_TAG);\n fragmentTransaction.commitAllowingStateLoss();\n }", "private void changeFragment(Fragment fragment) {\n FragmentTransaction fragmentTransaction = mFragmentManager.beginTransaction();\n fragmentTransaction.replace(R.id.flContainer, fragment);\n fragmentTransaction.commit();\n closeDrawer();\n }", "@Override\n public void run() {\n Fragment fragment = getHomeFragment();\n FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();\n fragmentTransaction.setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out);\n fragmentTransaction.replace(R.id.frame, fragment, CURRENT_TAG);\n fragmentTransaction.commitAllowingStateLoss();\n }", "@Override\n\tprotected void refreshView() {\n\t\t\n\t}", "@Override\n\tprotected void RefreshView() {\n\t\t\n\t}", "private void showHome(){\n fragment = new HomeFragment();\n FragmentManager fragmentManager = getSupportFragmentManager();\n fragmentManager.beginTransaction().replace(R.id.mainLayout, fragment, fragment.getTag()).commit();\n }", "@Override\n public void gonearbypage() {\n getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container_home,new NearbyFragment()).addToBackStack(\"Homepage\").commit();\n }", "private void resetFragment() {\n\t\tFragment fragment = hMapTabs.get(mSelectedTab).get(0);\n\t\thMapTabs.get(mSelectedTab).clear();\n\t\thMapTabs.get(mSelectedTab).add(fragment);\n\t\tFragmentManager manager = getSupportFragmentManager();\n\t\tFragmentTransaction ft = manager.beginTransaction();\n\t\tft.setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out);\n\t\tft.replace(R.id.realtabcontent, fragment);\n\t\tft.commit();\n\n\t\tshouldDisplayHomeUp();\n\n\t}", "private void updateFragmentUI() {\n ((AppCompatActivity) getActivity()).getSupportActionBar().setTitle(\"Shift Id: \" + mShift.getId());\n ((TextView) mRootView.findViewById(R.id.shift_starttime)).setText(TimeUtil.convertTimeStampToGenericString(mShift.getStartTimeStamp()));\n ((TextView) mRootView.findViewById(R.id.shift_startaddress)).setText((mShift.getStartLatitude() + \" , \" + mShift.getStartLongitude()));\n if (mShift.getEndTimestamp() == 0) {\n ((TextView) mRootView.findViewById(R.id.shift_endtime)).setText(R.string.shift_in_progress);\n ((TextView) mRootView.findViewById(R.id.shift_endaddress)).setText(R.string.shift_in_progress);\n } else {\n ((TextView) mRootView.findViewById(R.id.shift_endtime)).setText(TimeUtil.convertTimeStampToGenericString(mShift.getEndTimestamp()));\n ((TextView) mRootView.findViewById(R.id.shift_endaddress)).setText((mShift.getEndLatitude() + \" , \" + mShift.getEndLongitude()));\n }\n }", "@Override\n public void updateView(Intent intent)\n {\n \n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_student_profile, container, false);\n ButterKnife.bind(this, view);\n ((App) activity.getApplication()).getNetComponent().inject(this);\n profilePojo = new Profile();\n activity.toolbar.setTitle(getString(R.string.my_profile));\n getProfileDetails();\n bUpdate.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n StudentProfileUpdateFragment fragment = new StudentProfileUpdateFragment();\n Bundle args = new Bundle();\n args.putSerializable(Constants.PROFILE, profilePojo);\n fragment.setArguments(args);\n new FragmentUtils(getActivity()).navigateToFragment(R.id.content_main, fragment, StudentProfileUpdateFragment.TAG);\n }\n });\n return view;\n }", "@Override\n public void run() {\n confirmImage.setVisibility(View.GONE);\n activity.replaceFragment(new Fragment_Buyer_Orders());\n\n }", "private void displayCareerFragment() {\n getSupportFragmentManager().beginTransaction().replace(R.id.container, UserProfileCareerFragment.getInstance()).commit();\n\n }", "private void loadFragment(Fragment fragment){\n FragmentTransaction trans = getSupportFragmentManager().beginTransaction();\n trans.replace(R.id.frame_event, fragment);\n trans.commit();\n\n appbar.setExpanded(true);\n }", "public void loadFragment(Fragment fragment) { Animation connectingAnimation = AnimationUtils.loadAnimation(getContext(), R.anim.slide_up);\n//\n FragmentTransaction transaction = getActivity().getSupportFragmentManager().beginTransaction();\n transaction.replace(R.id.nowShowingFrame, fragment);\n transaction.addToBackStack(null);\n transaction.commit();\n }", "private void replaceFragment(int pos) {\n Fragment fragment = null;\n switch (pos) {\n case 0:\n //mis tarjetas\n fragment = new CardsActivity();\n break;\n case 1:\n //buscador online\n fragment = new CardsActivityOnline();\n break;\n case 2:\n //active camera\n Intent it = new Intent(this, com.google.zxing.client.android.CaptureActivity.class);\n startActivityForResult(it, 0);\n break;\n case 3:\n ParseUser.getCurrentUser().logOut();\n finish();\n onBackPressed();\n break;\n default:\n //fragment = new CardsActivity();\n break;\n }\n\n if(null!=fragment) {\n FragmentManager fragmentManager = getSupportFragmentManager();\n FragmentTransaction transaction = fragmentManager.beginTransaction();\n transaction.replace(R.id.main_content, fragment);\n transaction.addToBackStack(null);\n transaction.commit();\n }\n }", "private void recreate_fragments(){\n GoogleMapsUtils google_maps_utils = new GoogleMapsUtils(getApplicationContext(), this, mToolbar_navig_utils);\n google_maps_utils.getLocationPermission();\n\n if(getPageAdapter()!=null)\n getPageAdapter().getMapsFragment().getMapView().removeAllViews();\n\n // Launch progressBar\n if(mProgressBar!=null) {\n runOnUiThread(() -> mProgressBar.setVisibility(View.VISIBLE));\n }\n }", "@Override\n public void onRefresh() {\n synchronizeContent();\n }", "public void updateViews() {\n updateViews(null);\n }", "@Override\n public void onComplete(@NonNull Task<Void> task) {\n ((MainActivity) getActivity()).replaceFragmentsAndReset(new AppointmentListFragment());\n }", "protected void refreshView() {\r\n\t\tFacesContext context = FacesContext.getCurrentInstance();\r\n\t\tApplication application = context.getApplication();\r\n\t\tViewHandler viewHandler = application.getViewHandler();\r\n\t\tUIViewRoot viewRoot = viewHandler.createView(context, context.getViewRoot().getViewId());\r\n\t\tcontext.setViewRoot(viewRoot);\r\n\t\tcontext.renderResponse();\r\n\t}", "private void loadFragment(Fragment fragment) {\n FragmentManager fragmentManager = getSupportFragmentManager();\n FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();\n fragmentTransaction.replace(com.limkee1.R.id.flContent, fragment);\n fragmentTransaction.commit();\n\n }", "void doRefreshContent();", "private void setFragment(Fragment fragment) {\n FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();\n fragmentTransaction.replace(R.id.frame, fragment);\n fragmentTransaction.commit();\n\n }", "private void switchFragment(Fragment fragment, Bundle arguments) {\n // replace the current showed fragment\n Fragment current = getSupportFragmentManager().findFragmentByTag(CURRENT_FRAGMENT);\n if (current != fragment) {\n fragment.setArguments(arguments);\n getSupportFragmentManager().beginTransaction().\n replace(R.id.frame_layout, fragment, CURRENT_FRAGMENT).commit();\n }\n }", "private void getFragment(Fragment fragment) {\n // create a FragmentManager\n FragmentManager fm = getFragmentManager();\n // create a FragmentTransaction to begin the transaction and replace the Fragment\n FragmentTransaction fragmentTransaction = fm.beginTransaction();\n // replace the FrameLayout with new Fragment\n fragmentTransaction.replace(R.id.fragment_layout, fragment);\n // save the changes\n fragmentTransaction.commit();\n }", "@Override\n public void onBoomButtonClick(int index) {\n fragment = null;\n fragmentClass = HorlogeAtomiqueFragment.class;\n ((AppCompatActivity)getActivity()).getSupportActionBar().setTitle(\"Horloge\");\n ((AppCompatActivity)getActivity()).getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.parseColor(\"#660099\")));\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n Window window = getActivity().getWindow();\n window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);\n window.setStatusBarColor(Color.parseColor(\"#660099\"));\n }\n mNavigationView = (NavigationView)getActivity().findViewById(R.id.nvView);\n Menu nv = mNavigationView.getMenu();\n MenuItem item = nv.findItem(R.id.nav_horloge_atomique_fragment);\n item.setChecked(true);\n try {\n fragment = (Fragment) fragmentClass.newInstance();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n // Insert the fragment by replacing any existing fragment\n FragmentManager fragmentManager = getActivity().getSupportFragmentManager();\n fragmentManager.beginTransaction().replace(R.id.flContent, fragment).commit();\n }", "public void refreshView(){\n\t\tView v = getView();\n\t\tif(v != null){\n\t\t\tv.invalidate();\n\t\t}\n\t}", "@Override\n public void setUpdateFragment(DataServices.Account account) {\n setTitle(R.string.update_account);\n getSupportFragmentManager().beginTransaction()\n .addToBackStack(null)\n .replace(R.id.containerView, UpdateFragment.newInstance(account))\n .commit();\n }", "private void setFragment(Fragment fragment) {\n FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();\n fragmentTransaction.replace(R.id.frame_layout, fragment);\n fragmentTransaction.commit();\n\n }", "@Override\n public void onClick(View v) {\n\n if (v == thigsfrag1){\n\n thingstodonear = Sessiondata.getInstance().getThingsfrontdatanear();\n thingstodonear.get(0).setCtm(newtrip);\n Sessiondata.getInstance().setSnocreatenewtrip(thingstodonear.get(0).getSno());\n Sessiondata.getInstance().setUpdateresult(0);\n Sessiondata.getInstance().setFtplistval(7);\n\n Fragment fr = new NewUiView_itemInfo_Fragment();\n Bundle bundle = new Bundle();\n bundle.putSerializable(EXTRATRIPINFO, thingstodonear.get(0));\n fr.setArguments(bundle);\n FragmentChangeListener fc = (FragmentChangeListener) getActivity();\n fc.replaceFragment(fr);\n\n }\n\n else if (v == foodsfrag1){\n\n\n foodnear = Sessiondata.getInstance().getFoodfrontdatanear();\n foodnear.get(0).setCtm(newtrip);\n Sessiondata.getInstance().setSnocreatenewtrip(foodnear.get(0).getSno());\n Sessiondata.getInstance().setUpdateresult(0);\n Sessiondata.getInstance().setFtplistval(7);\n\n Fragment fr = new NewUiView_itemInfo_Fragment();\n Bundle bundle = new Bundle();\n bundle.putSerializable(EXTRATRIPINFO, foodnear.get(0));\n fr.setArguments(bundle);\n FragmentChangeListener fc = (FragmentChangeListener) getActivity();\n fc.replaceFragment(fr);\n }\nelse if (v == prayerfirst) {\n\n\n prayernear = Sessiondata.getInstance().getPrayerfrontdatanear();\n prayernear.get(0).setCtm(newtrip);\n Sessiondata.getInstance().setSnocreatenewtrip(prayernear.get(0).getSno());\n Sessiondata.getInstance().setUpdateresult(0);\n Sessiondata.getInstance().setFtplistval(7);\n\n Fragment fr = new NewUiView_itemInfo_Fragment();\n Bundle bundle = new Bundle();\n bundle.putSerializable(EXTRATRIPINFO, prayernear.get(0));\n fr.setArguments(bundle);\n FragmentChangeListener fc = (FragmentChangeListener) getActivity();\n fc.replaceFragment(fr);\n }\n\n\n else if(v == thingstodo){\n\n NearByelementsModel n = (NearByelementsModel) v.getTag();\n CreatedTripModel cc = C.getCtm();\n cc.setCategoryID(\"3\");\n cc.setCategorytype(\"Things to do info\");\n cc.setN(n);\n showguideFragment(cc);\n }\n\n }", "private void setFragment(Fragment fragment) {\n FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();\n fragmentTransaction.replace(R.id.main_frame, fragment);\n// fragmentTransaction.addToBackStack(null);\n fragmentTransaction.commit();\n }", "private void showFragment(Fragment fragment) {\n Log.d(TAG, \"showFragment: Run selected fragment\");\n FragmentManager fragmentManager = getSupportFragmentManager();\n fragmentManager.beginTransaction()\n .replace(R.id.content_frame, fragment)\n .commit();\n }", "@Override\r\n public void onRefresh() {\n\r\n refreshContent();\r\n\r\n }", "private void loadHomeFragment() {\n // selecting appropriate nav menu item\n selectNavMenu();\n\n // if user select the current navigation menu again, don't do anything\n // just close the navigation drawer\n if (getSupportFragmentManager().findFragmentByTag(CURRENT_TAG) != null) {\n drawer.closeDrawers();\n\n return;\n }\n // Sometimes, when fragment has huge data, screen seems hanging\n // when switching between navigation menus\n // So using runnable, the fragment is loaded with cross fade effect\n Runnable mPendingRunnable = new Runnable() {\n @Override\n public void run() {\n // update the main content by replacing fragments\n Fragment fragment = getHomeFragment();\n FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();\n fragmentTransaction.setCustomAnimations(android.R.anim.fade_in,\n android.R.anim.fade_out);\n fragmentTransaction.replace(R.id.frame, fragment, CURRENT_TAG);\n fragmentTransaction.commitAllowingStateLoss();\n }\n };\n\n // If mPendingRunnable is not null, then add to the message queue\n if (mPendingRunnable != null) {\n mHandler.post(mPendingRunnable);\n }\n }", "private void setFragment(Fragment fragment) {\n Log.d(\"setFragments\", \"setFragments: start\");\n fragmentTransaction = getSupportFragmentManager().beginTransaction();\n Log.d(\"setFragments\", \"setFragments: begin\");\n Fragment hideFragment = getLast();\n fragmentTransaction.hide(hideFragment);\n fragmentTransaction.show(fragment);\n if (userHomeFragment.equals(fragment)) {\n lastFragment = \"userHomeFragment\";\n } else if (scheduleFragment.equals(fragment)) {\n lastFragment = \"scheduleFragment\";\n } else if (medicineFragment.equals(fragment)) {\n lastFragment = \"medicineFragment\";\n } else {\n lastFragment = \"calendarFragment\";\n }\n fragmentTransaction.commit();\n }", "private void displayView(int position) {\n\t\t// update the main content by replacing fragments\n\t\tFragment fragment = null;\n\t\tswitch (position) {\n\t\tcase 0:\n\t\t\tfragment = new getLocation();\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tfragment = new UserInput();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\n\t\tif (fragment != null) {\n\t\t\tFragmentManager fragmentManager = getFragmentManager();\n\t\t\tfragmentManager.beginTransaction()\n\t\t\t\t\t.replace(R.id.frame_container, fragment).commit();\n\n\t\t\t// update selected item and title, then close the drawer\n\t\t\tmDrawerList.setItemChecked(position, true);\n\t\t\tmDrawerList.setSelection(position);\n\t\t\tsetTitle(navMenuTitles[position]);\n\t\t\tmDrawerLayout.closeDrawer(mDrawerList);\n\t\t} else {\n\t\t\t// error in creating fragment\n\t\t\tLog.e(\"MainActivity\", \"Error in creating fragment\");\n\t\t}\n\t}", "@Override\n public void onFragmentVisible() {\n db = LegendsDatabase.getInstance(getContext());\n\n refreshCursor();\n\n if (emptyView.isShown()) {\n Crossfader.crossfadeView(emptyView, loadingView);\n }\n else {\n Crossfader.crossfadeView(listView, loadingView);\n }\n }", "public void changeFragment(Fragment nextFragment) {\n actualFragment = nextFragment;\n FragmentManager fragmentManager = getSupportFragmentManager();\n FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();\n fragmentTransaction.replace(R.id.mainActivityFrameLayout, nextFragment, nextFragment.getClass()\n .getSimpleName());\n fragmentTransaction.commitAllowingStateLoss();\n }", "@Override\n public void onClick(View v) {\n switch (v.getId()) {\n case R.id.btn_add:\n Log.i(\"pressing this button\", \"pressing it\");\n AddFragment frg2=new AddFragment();//create the fragment instance for the bottom fragment\n\n FragmentManager manager= getActivity().getSupportFragmentManager();//create an instance of fragment manager\n\n FragmentTransaction transaction=manager.beginTransaction();//create an instance of Fragment-transaction\n\n transaction.add(R.id.container2, frg2, \"Frag_Bot\");\n\n transaction.addToBackStack(null);\n\n transaction.commit();\n\n break;\n\n case R.id.btn_list:\n Log.i(\"pressing this button\", \"Pressing list\");\n EventItemFragment ilfragment = new EventItemFragment();\n\n Bundle username = new Bundle();\n username.putString(\"username\", mUsername);\n\n ilfragment.setArguments(username);\n\n FragmentManager manager2= getActivity().getSupportFragmentManager();//create an instance of fragment manager\n\n FragmentTransaction transaction2=manager2.beginTransaction();//create an instance of Fragment-transaction\n\n transaction2.replace(R.id.container2, ilfragment, \"Frag_Bot\");\n\n transaction2.addToBackStack(null);\n\n transaction2.commit();\n\n break;\n\n case R.id.btn_refresh:\n Log.i(\"clicking refresh\", \"work pls\");\n getActivity().finish();\n startActivity(getActivity().getIntent());\n break;\n\n }\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n // Inflate the layout for this fragment\n Log.i(\"INFO\", \"Creating view for profile fragment ...\");\n view = inflater.inflate(R.layout.mainpages_myprofile_fragment, container, false);\n //this.viewModel.setFragment(this);\n username = view.findViewById(R.id.profile_name);\n newPostBtn = view.findViewById(R.id.newPostBtn);\n profilePic = view.findViewById(R.id.post_profile);\n followingNumber = view.findViewById(R.id.followingsNumber);\n followerNumber = view.findViewById(R.id.follwersNumber);\n location = view.findViewById(R.id.profile_location);\n toolbar = view.findViewById(R.id.myProfile_toolbar).findViewById(R.id.toolbar);\n miniProfilePic = view.findViewById(R.id.mini_post_profile_picture);\n\n profile_navigation_bar = view.findViewById(R.id.profile_navigation_bar);\n profile_navigation_bar.setSelectedItemId(this.selected);\n\n /*\n enables/disables username and location, so that the user cannot edit any information if he is not at Info_Profile_Fragment\n Tests, if any basic user information is edited. If so, an alert pops up to ask user if he wants to continue and discard all changes or not.\n */\n profile_navigation_bar.setOnNavigationItemSelectedListener(item -> {\n selected = item.getItemId();\n if (item.getItemId() == R.id.profile_info_item){\n getChildFragmentManager().beginTransaction().replace(R.id.profile_sub_fragment, infoFragment).commit();\n username.setEnabled(true);\n location.setEnabled(true);\n }\n else if(mViewModel.isUserEdited() && item.getItemId() == R.id.profile_photo_item)\n getFragmentChangeAlertBuilder().show();\n else{\n location.setEnabled(false);\n username.setEnabled(false);\n getChildFragmentManager().beginTransaction().replace(R.id.profile_sub_fragment, imageFragment).commit();\n\n }\n return true;\n });\n setupFullscreen();\n return view;\n }", "protected abstract void fragmentTrigger(Fragment fragment);", "public void refresh() { \r\n FacesContext context = FacesContext.getCurrentInstance(); \r\n Application application = context.getApplication(); \r\n ViewHandler viewHandler = application.getViewHandler(); \r\n UIViewRoot viewRoot = viewHandler.createView(context, context.getViewRoot().getViewId()); \r\n context.setViewRoot(viewRoot); \r\n context.renderResponse(); \r\n }", "private void setFragmentMovie(Fragment fragmentMovie){\n getActivity().getSupportFragmentManager().beginTransaction()\n .replace(R.id.frame_fav, fragmentMovie)\n .addToBackStack(null)\n .commit();\n }", "@Override\n public void onNavigationDrawerItemSelected(int position) {\n FragmentManager fragmentManager = getFragmentManager();\n fragmentManager.beginTransaction()\n .replace(R.id.container, PlaceholderFragment.newInstance(position + 1))\n .commit();\n }", "@Override\n public void onNavigationDrawerItemSelected(int position) {\n FragmentManager fragmentManager = getFragmentManager();\n fragmentManager.beginTransaction()\n .replace(R.id.container, PlaceholderFragment.newInstance(position + 1))\n .commit();\n }", "@Override\n public void onNavigationDrawerItemSelected(int position) {\n FragmentManager fragmentManager = getSupportFragmentManager();\n fragmentManager.beginTransaction()\n .replace(R.id.container, createFragment(position + 1))\n .commit();\n }", "public void onClick(View v) {\n\n ProductFragment itemListFragment = ((MainActivity)getActivity()).getItemListFragment();\n itemListFragment.subtractFromTotalWeight(quantity, weight); //subtracting old weight before adding new weight\n itemListFragment.subtractFromTotalPrice(quantity, price); //subtracting old price before adding new price\n\n Integer newQuantity = (Integer.parseInt((String) ((TextView) singleProductDescrView.findViewById(R.id.updatingQuantityDescr)).getText()));\n quantity = newQuantity;\n android.support.v4.app.FragmentManager fm = getFragmentManager();\n FragmentTransaction ft = fm.beginTransaction();\n updateItemInList();\n ft.replace(R.id.container, ((MainActivity)getActivity()).getItemListFragment(), \"List\");\n ft.commit();\n\n\n }", "@Override\n public void onBoomButtonClick(int index) {\n fragment = null;\n fragmentClass = TvShowFragment.class;\n ((AppCompatActivity)getActivity()).getSupportActionBar().setTitle(\"TV Show\");\n ((AppCompatActivity)getActivity()).getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.parseColor(\"#660099\")));\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n Window window = getActivity().getWindow();\n window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);\n window.setStatusBarColor(Color.parseColor(\"#660099\"));\n }\n mNavigationView = (NavigationView)getActivity().findViewById(R.id.nvView);\n Menu nv = mNavigationView.getMenu();\n MenuItem item = nv.findItem(R.id.nav_horloge_atomique_fragment);\n item.setChecked(true);\n try {\n fragment = (Fragment) fragmentClass.newInstance();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n // Insert the fragment by replacing any existing fragment\n FragmentManager fragmentManager = getActivity().getSupportFragmentManager();\n fragmentManager.beginTransaction().replace(R.id.flContent, fragment).commit();\n }", "@Override\n public void onEditHat() {\n\n moveToFragment(0);\n }", "private void displayView(int position) {\r\n\t\t// update the main content by replacing fragments\r\n\t\tFragment fragment = null;\r\n\t\tString id = null;\r\n\t\tswitch (position) {\r\n\t\tcase 0:\r\n\t\t\tif (mSharedPrefs.getDeviceMode() == -1) {\r\n\t\t\t\tid = \"SetupFragment\";\r\n\t\t\t}\r\n\r\n\t\t\tif (mSharedPrefs.getDeviceMode() == 0) {\r\n\t\t\t\tid = \"OverviewFragment\";\r\n\t\t\t}\r\n\t\t\tif (mSharedPrefs.getDeviceMode() == 1) {\r\n\t\t\t\tid = \"BabyMonitorFragment\";\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase 1:\r\n\t\t\tif (mSharedPrefs.getDeviceMode() == -1) {\r\n\t\t\t\tid = \"Settings\";\r\n\t\t\t}\r\n\t\t\tif (mSharedPrefs.getDeviceMode() == 0) {\r\n\t\t\t\tloadStoredSetupOptions();\r\n\t\t\t\tid = \"SetupFragment\";\r\n\t\t\t}\r\n\t\t\tif (mSharedPrefs.getDeviceMode() == 1) {\r\n\t\t\t\tid = \"AbsenceFragment\";\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase 2:\r\n\t\t\tif (mSharedPrefs.getDeviceMode() == 0) {\r\n\t\t\t\tid = \"Settings\";\r\n\t\t\t}\r\n\t\t\tif (mSharedPrefs.getDeviceMode() == 1) {\r\n\t\t\t\tloadStoredSetupOptions();\r\n\t\t\t\tid = \"SetupFragment\";\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase 3:\r\n\t\t\tif (mSharedPrefs.getDeviceMode() == 1) {\r\n\t\t\t\tid = \"Settings\";\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\r\n\t\tdefault:\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tfragment = mFragmentMap.get(id);\r\n\t\tif (fragment == null) {\r\n\t\t\tfragment = createFragmentById(id);\r\n\t\t}\r\n\r\n\t\tif (fragment != null) {\r\n\t\t\tFragmentManager fragmentManager = getSupportFragmentManager();\r\n\t\t\tfragmentManager.beginTransaction().replace(R.id.frame_container, fragment).commit();\r\n\t\t\tsetTitle(navMenuTitles[position]);\r\n\t\t\t// update selected item and title, then close the drawer\r\n\t\t\tmDrawerList.setItemChecked(position, true);\r\n\t\t\tmDrawerList.setSelection(position);\r\n\t\t\tinitNavigationDrawer();\r\n\t\t\tmDrawerLayout.closeDrawer(mDrawerList);\r\n\t\t} else {\r\n\t\t\t// error in creating fragment\r\n\t\t}\r\n\t}", "private void loadHomeFragment() {\n selectNavMenu();\n // set toolbar title\n setToolbarTitle();\n // if user select the current navigation menu again, don't do anything\n // just close the navigation drawer\n if (getSupportFragmentManager().findFragmentByTag(CURRENT_TAG) != null) {\n drawer.closeDrawers();\n return;\n }\n Runnable mPendingRunnable = new Runnable() {\n @Override\n public void run() {\n // update the main content by replacing fragments\n Fragment fragment = getHomeFragment();\n FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();\n fragmentTransaction.setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out);\n fragmentTransaction.replace(R.id.frame, fragment, CURRENT_TAG);\n fragmentTransaction.commitAllowingStateLoss();\n }\n };\n\n // If mPendingRunnable is not null, then add to the message queue\n if (mPendingRunnable != null) {\n mHandler.post(mPendingRunnable);\n }\n //Closing drawer on item click\n drawer.closeDrawers();\n // refresh toolbar menu\n invalidateOptionsMenu();\n }", "public void onUPP()\r\n {\r\n Fragment frag = getSupportFragmentManager().findFragmentById(R.id.fragmentSad);\r\n// //android.app.FragmentManager fm = getFragmentManager();\r\n// FragmentTransaction ft = getFragmentManager().beginTransaction();\r\n// ft.remove(frag);\r\n// ft.commit();\r\n//}\r\n\r\n FragmentManager fm = getSupportFragmentManager();\r\n fm.beginTransaction()\r\n .setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out)\r\n .show(frag)\r\n .commit();\r\n\r\n }", "private void loadHomeFragment() {\n selectNavMenu();\n setToolbarTitle();\n // if user select the current navigation menu again, don't do anything\n // just close the navigation drawer\n if (getSupportFragmentManager().findFragmentByTag(CURRENT_TAG) != null) {\n drawer_layout.closeDrawers();\n return;\n }\n\n Runnable mPendingRunnable = new Runnable() {\n @Override\n public void run() {\n // update the main content by replacing fragments\n Fragment fragment = getHomeFragment();\n FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();\n fragmentTransaction.setCustomAnimations(android.R.anim.fade_in,\n android.R.anim.fade_out);\n fragmentTransaction.replace(R.id.frame, fragment, CURRENT_TAG);\n fragmentTransaction.commitAllowingStateLoss();\n }\n };\n\n // If mPendingRunnable is not null, then add to the message queue\n mHandler.postDelayed(mPendingRunnable, DELAY_TIME_OUT);\n drawer_layout.closeDrawers();\n invalidateOptionsMenu();\n }", "void switchToFragment(Fragment newFrag) {\n getSupportFragmentManager().beginTransaction()\n .replace(R.id.fragment, newFrag)\n .addToBackStack(null)\n .commit();\n }", "@Override\n public void gofavouritepage() {\n getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container_home,new FavouriteFragment()).addToBackStack(\"Homepage\").commit();\n }", "@Override\n public void onNavigationDrawerItemSelected(int position) {\n FragmentManager fragmentManager = getSupportFragmentManager();\n fragmentManager.beginTransaction()\n .replace(R.id.container, PlaceholderFragment.newInstance(position + 1))\n .commit();\n }", "protected void switchContent(Fragment to) {\n if (mFragment != to) {\n FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();\n transaction.replace(R.id.activity_my_movie_content,to).commitAllowingStateLoss();\n mFragment = to;\n }\n }", "public void updateUI() {\n List<Animal> animals;\n\n String searchQuery = LexiconPreferences.getSearchQuery(getActivity());\n\n // Check if there's a search query present\n if (searchQuery != null) {\n ArrayList<String> whereArgs = new ArrayList<>();\n whereArgs.add(LexiconPreferences.getFilterValue(getActivity()));\n\n animals = mAnimalManager.searchAnimals(\n mAnimalManager.createWhereClauseFromFilter(LexiconPreferences.getFilterKey(getActivity())),\n whereArgs,\n searchQuery\n );\n } else {\n animals = mAnimalManager.getAnimals(\n mAnimalManager.createWhereClauseFromFilter(LexiconPreferences.getFilterKey(getActivity())),\n new String[]{LexiconPreferences.getFilterValue(getActivity())}\n );\n }\n\n if (animals.size() > 0) {\n // If the fragment is already running, update the data in case something changed (some animal)\n if (mAnimalAdapter == null) {\n mAnimalAdapter = new AnimalAdapter(animals);\n mAnimalRecyclerView.setAdapter(mAnimalAdapter);\n } else {\n mAnimalAdapter.setAnimals(animals);\n mAnimalAdapter.notifyDataSetChanged();\n }\n } else {\n RelativeLayout emptyList = (RelativeLayout) mView.findViewById(R.id.list_empty);\n emptyList.setVisibility(View.VISIBLE);\n }\n }", "public void returnFromFragment(View v) {\n blankFrag.setVisibility(View.VISIBLE);\n itemFrag.setVisibility(View.INVISIBLE);\n userFrag.setVisibility(View.INVISIBLE);\n Toast.makeText(AdminActivity.this, \"Back\", Toast.LENGTH_SHORT).show();\n }", "public interface UpdataCurrentFragment {\n void update(Bundle bundle);\n}", "private void refreshView() {\n this.view.updateRobots();\n }", "@Override\n public void onResultViewFinished() {\n MainFragment mainFragment = new MainFragment();\n\n createTransactionAndReplaceFragment(mainFragment, getString(R.string.frg_tag_main));\n }", "private void switchToProgress() {\n FragmentManager fm = getFragmentManager();\n FragmentTransaction transaction = fm.beginTransaction();\n exerciseProgressFragment.setCurrentExercise(currentExercise);\n transaction.replace(R.id.exerciseFragmentLayout, exerciseProgressFragment);\n transaction.commit();\n }", "private void loadFragment(String name) {\n FragmentTransaction fragmentTransaction = MainActivity.fm.beginTransaction();\n // replace the FrameLayout with the new Fragment\n fragmentTransaction.replace(R.id.mainFrameLayout, MainActivity.currentFragment);\n fragmentTransaction.addToBackStack(name);\n fragmentTransaction.commit();\n }", "@Override\n public void onNavigationDrawerItemSelected(int position) {\n final Fragment[] fragments = {MapListFragment.newInstance(0), MyProfile.newInstance()};\n FragmentManager fragmentManager = getSupportFragmentManager();\n fragmentManager.beginTransaction()\n .replace(R.id.container, fragments[position])\n .commit();\n }", "@Override\n public void onNavigationDrawerItemSelected(int position) {\n FragmentManager fragmentManager = getSupportFragmentManager();\n if(position==0) {\n a=0;\n fragmentManager.beginTransaction()\n .replace(R.id.container, PlaceholderFragment.newInstance(position + 1))\n .commit();\n }else if (position==1){\n a=1;\n fragmentManager.beginTransaction()\n .replace(R.id.container, PlaceholderFragment.newInstance(position + 1))\n .commit();\n }\n }", "private void updateCurrentFragment(Fragment newFragment, String tag) {\n FragmentTransaction ft = fm.beginTransaction();\n\n // remove current fragment\n if (currentFragment != null) {\n ft.remove(currentFragment);\n }\n\n // set, add and commit new fragment\n currentFragment = newFragment;\n ft.add(currentFragment, tag).commit();\n }", "@Override\n\tpublic void OnHomeUpdateFinished() {\n\t\tif (!Frag_Paused) {\n\t\t\t// supportRequestWindowFeature(WindowCompat.FEATURE_ACTION_BAR);\n\t\t\tgetSupportActionBar().show();\n\n\t\t\t\n\n\t\t\t\n\n\t\t\t\n\t\t\tPending_Refresh = false;\n\t\t} else {\n\t\t\tPending_Refresh = true;\n\t\t}\n\t}", "@Override\n public void onBoomButtonClick(int index) {\n fragment = null;\n fragmentClass = InfosDeviceFragment.class;\n ((AppCompatActivity)getActivity()).getSupportActionBar().setTitle(\"Infos Device\");\n ((AppCompatActivity)getActivity()).getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.parseColor(\"#660099\")));\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n Window window = getActivity().getWindow();\n window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);\n window.setStatusBarColor(Color.parseColor(\"#660099\"));\n }\n mNavigationView = (NavigationView)getActivity().findViewById(R.id.nvView);\n Menu nv = mNavigationView.getMenu();\n MenuItem item = nv.findItem(R.id.nav_infos_device_fragment);\n item.setChecked(true);\n try {\n fragment = (Fragment) fragmentClass.newInstance();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n // Insert the fragment by replacing any existing fragment\n FragmentManager fragmentManager = getActivity().getSupportFragmentManager();\n fragmentManager.beginTransaction().replace(R.id.flContent, fragment).commit();\n }", "private void setFragment(Fragment fragment){\n FragmentTransaction fragmentTransaction = getActivity().getSupportFragmentManager().beginTransaction();\n fragmentTransaction.setCustomAnimations(R.anim.slide_from_right,R.anim.slideout_from_left);\n fragmentTransaction.replace(parentFrameLayout.getId(),fragment);\n fragmentTransaction.commit();\n }", "@Override\n public void onFragmentAttached() {\n }", "@Override\n public void onItemSelected(int position) {\n Toast.makeText(getBaseContext(), \"SecondActivity.onItemSelected()\", Toast.LENGTH_SHORT).show();\n\n if (landscape) {\n // If the device is in the landscape mode updates detail fragment's content.\n DetailedFragment detailFragment = (DetailedFragment) getFragmentManager().findFragmentById(R.id.detail_view);\n detailFragment.updateContent(position);\n } else {\n // If the device is in the portrait mode sets detail fragment's content and replaces master fragment with detail fragment in a fragment transaction.\n DetailedFragment detailFragment = new DetailedFragment();\n detailFragment.setContent(position);\n FragmentTransaction ft = getFragmentManager().beginTransaction();\n ft.replace(R.id.master_view, detailFragment, \"Detail_Fragment_2\");\n ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);\n ft.addToBackStack(null);\n ft.commit();\n }\n }", "@Override\n public void onClick(View view) {\n Fragment fragment = null;\n fragment = new CommentPeopleDetail();\n Bundle bundle = new Bundle();\n bundle.putString(\"queid\", details.getQueId());\n\n if (fragment != null) {\n fragment.setArguments(bundle);\n FragmentManager fm = ((FragmentActivity) context).getSupportFragmentManager();\n FragmentTransaction transaction = fm.beginTransaction();\n transaction.replace(R.id.frame_contain_layout, fragment);\n transaction.commit();\n }\n }" ]
[ "0.7945681", "0.76372206", "0.74247545", "0.6891522", "0.68804944", "0.6824228", "0.6781206", "0.6771332", "0.6771332", "0.6746143", "0.6743942", "0.6661346", "0.6653398", "0.6602207", "0.657735", "0.64764357", "0.64381486", "0.64090115", "0.6404367", "0.6388122", "0.63860184", "0.6385667", "0.6377855", "0.6377855", "0.6377855", "0.6377855", "0.6377855", "0.6377855", "0.6368091", "0.63637394", "0.6362293", "0.63285905", "0.63034016", "0.6293321", "0.6293107", "0.62928164", "0.62584215", "0.6239582", "0.62297237", "0.6227292", "0.6187822", "0.6186087", "0.6185776", "0.6180966", "0.6176795", "0.61738217", "0.61657107", "0.61601937", "0.6149945", "0.6139887", "0.61333215", "0.6132404", "0.6130749", "0.61153984", "0.6104769", "0.6104182", "0.6100294", "0.6077911", "0.6076124", "0.6075797", "0.6075481", "0.6071499", "0.60702574", "0.6069778", "0.6069204", "0.60645306", "0.6062686", "0.60556966", "0.60547423", "0.6045323", "0.6041544", "0.6032845", "0.6032845", "0.6032771", "0.6028002", "0.60264885", "0.6022762", "0.60217905", "0.6021092", "0.6018027", "0.6017359", "0.60156137", "0.6014145", "0.6003315", "0.6002343", "0.60020965", "0.5998551", "0.5996306", "0.5995811", "0.5976648", "0.59740573", "0.59704906", "0.59658945", "0.5964672", "0.59644103", "0.5962432", "0.5958691", "0.5953754", "0.5952608", "0.59508955", "0.594914" ]
0.0
-1
adds new user to the database
public void register (String username, String password) throws JSONException { view.showProgressBar(); model.signUp(username, password); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void addNewUser(User user) {\n\t\tSystem.out.println(\"BirdersRepo. Adding new user to DB: \" + user.getUsername());\n\t\tDocument document = Document.parse(gson.toJson(user));\n\t\tcollection.insertOne(document);\n\t}", "public void insertUser() {}", "void addUser(User user);", "void addUser(User user);", "void add(User user) throws SQLException;", "public void addUser(User user);", "public void addUser(UserModel user);", "public void addUser(User user) {\n\t\t\r\n\t}", "public void addUser(User user){\n loginDAO.saveUser(user.getId(),user.getName(),user.getPassword());\n }", "public void registerUser(User newUser) {\r\n userRepo.save(newUser);\r\n }", "public void addNewUser(User user) throws SQLException {\n PreparedStatement pr = connection.prepareStatement(Queries.insertNewUser);\n pr.setString(1, user.getUserFullName());\n pr.setString(2, user.getUserEmail());\n pr.setInt(3, user.getPhoneNumber());\n pr.setString(4, user.getUserLoginName());\n pr.setString(5, user.getUserPassword());\n pr.execute();\n pr.close();\n }", "void addNewUser(User user, int roleId) throws DAOException;", "public void addUser(User user){\n SQLiteDatabase db = this.getWritableDatabase();\n\n ContentValues values = new ContentValues();\n values.put(USER_NAME,user.getName());\n values.put(USER_PASSWORD,user.getPassword());\n db.insert(TABLE_USER,null,values);\n db.close();\n }", "Boolean registerNewUser(User user);", "@Override\n public void addUser(User u) {\n Session session = this.sessionFactory.getCurrentSession();\n session.persist(u);\n logger.info(\"User saved successfully, User Details=\"+u);\n }", "public void createUser(User user) {\n\n\t}", "public void newUser(User user) {\n users.add(user);\n }", "private void addUser(){\r\n\t\ttry{\r\n\t\t\tSystem.out.println(\"Adding a new user\");\r\n\r\n\t\t\tfor(int i = 0; i < commandList.size(); i++){//go through command list\r\n\t\t\t\tSystem.out.print(commandList.get(i) + \"\\t\");//print out the command and params\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\r\n\t\t\t//build SQL statement\r\n\t\t\tString sqlCmd = \"INSERT INTO users VALUES ('\" + commandList.get(1) + \"', '\"\r\n\t\t\t\t\t+ commandList.get(2) + \"', '\" + commandList.get(3) + \"', '\"\r\n\t\t\t\t\t+ commandList.get(4) + \"', '\" + commandList.get(5) + \"', '\"\r\n\t\t\t\t\t+ commandList.get(6) + \"');\";\r\n\t\t\tSystem.out.println(\"sending command:\" + sqlCmd);//print SQL command to console\r\n\t\t\tstmt.executeUpdate(sqlCmd);//send command\r\n\r\n\t\t} catch(SQLException se){\r\n\t\t\t//Handle errors for JDBC\r\n\t\t\terror = true;\r\n\t\t\tse.printStackTrace();\r\n\t\t\tout.println(se.getMessage());//return error message\r\n\t\t} catch(Exception e){\r\n\t\t\t//general error case, Class.forName\r\n\t\t\terror = true;\r\n\t\t\te.printStackTrace();\r\n\t\t\tout.println(e.getMessage());\r\n\t\t} \r\n\t\tif(error == false)\r\n\t\t\tout.println(\"true\");//end try\r\n\t}", "public boolean addNewUser(UserDetails ud) {\n try {\n con = (Connection) DriverManager.getConnection(url, this.usernamel, this.passwordl);\n String query = \"INSERT INTO user VALUES(?,?,?,?,?,?,?,?)\";\n pst = (com.mysql.jdbc.PreparedStatement) con.prepareStatement(query);\n pst.setInt(1, ud.getEmpID());\n pst.setString(2, ud.getEmployeeType());\n pst.setString(3, ud.getName());\n pst.setString(4, ud.getAddress());\n pst.setInt(5, ud.getMobile());\n pst.setString(6, ud.getNic());\n pst.setString(7, ud.getUsername());\n pst.setString(8, ud.getPassword());\n pst.executeUpdate();\n return true;\n } catch (Exception ex) {\n //System.out.print(ex);\n return false;\n } finally {\n try {\n if (pst != null) {\n pst.close();\n }\n if (con != null) {\n con.close();\n }\n } catch (Exception e) {\n }\n }\n }", "public void addUser(User user) {\n try (PreparedStatement pst = this.conn.prepareStatement(\"INSERT INTO users (name, login, email, createDate)\"\n + \"VALUES (?, ?, ?, ?)\")) {\n pst.setString(1, user.getName());\n pst.setString(2, user.getLogin());\n pst.setString(3, user.getEmail());\n pst.setTimestamp(4, user.getCreateDate());\n pst.executeUpdate();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "public void createUser() {\r\n\t\tif(validateUser()) {\r\n\t\t\t\r\n\t\t\tcdb=new Connectiondb();\r\n\t\t\tcon=cdb.createConnection();\r\n\t\t\ttry {\r\n\t\t\t\tps=con.prepareStatement(\"INSERT INTO t_user (nom,prenom,userName,pass,tel,type,status) values(?,?,?,?,?,?,?)\");\r\n\t\t\t\tps.setString(1, this.getNom());\r\n\t\t\t\tps.setString(2, this.getPrenom());\r\n\t\t\t\tps.setString(3, this.getUserName());\r\n\t\t\t\tps.setString(4, this.getPassword());\r\n\t\t\t\tps.setInt(5, Integer.parseInt(this.getTel().trim()));\r\n\t\t\t\tps.setString(6, this.getType());\r\n\t\t\t\tps.setBoolean(7, true);\r\n\t\t\t\tps.executeUpdate();\r\n\t\t\t\tnew Message().error(\"Fin d'ajout d'utilisateur\");\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\tnew Message().error(\"Echec d'ajout d'utilisateur\");\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}finally {\r\n\t\t\t\tcdb.closePrepareStatement(ps);\r\n\t\t\t\tcdb.closeConnection(con);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "void createUser() throws SQLException {\n String name = regName.getText();\n String birthdate = regAge.getText();\n String username = regUserName.getText();\n String password = regPassword.getText();\n String query = \" insert into users (name, birthdate, username, password)\"\n + \" values (?, ?, ?, ?)\";\n\n DB.registerUser(name, birthdate, username, password, query);\n }", "public int insertUser(final User user);", "public void addUser(User user) {\n SQLiteDatabase db = dbHelper.getWritableDatabase();\n ContentValues values = new ContentValues();\n values.put(UserDBHelper.COLUMN_NAME, user.getName());\n values.put(UserDBHelper.COLUMN_SURNAME, user.getSurname());\n values.put(UserDBHelper.COLUMN_EMAIL, user.getEmail());\n values.put(UserDBHelper.COLUMN_PASS, user.getPass());\n db.insert(UserDBHelper.TABLE_NAME, \"\", values); // Prevent from -1 exception\n db.close();\n }", "public void createUser() {\n try {\n conn = dao.getConnection();\n\n ps = conn.prepareStatement(\"INSERT INTO Users(username, password) VALUES(?, ?)\");\n ps.setString(1, this.username);\n ps.setString(2, this.password);\n\n ps.execute();\n\n ps.close();\n conn.close();\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "void registerUser(User newUser);", "private void insert() {//将数据录入数据库\n\t\tUser eb = new User();\n\t\tUserDao ed = new UserDao();\n\t\teb.setUsername(username.getText().toString().trim());\n\t\tString pass = new String(this.pass.getPassword());\n\t\teb.setPassword(pass);\n\t\teb.setName(name.getText().toString().trim());\n\t\teb.setSex(sex1.isSelected() ? sex1.getText().toString().trim(): sex2.getText().toString().trim());\t\n\t\teb.setAddress(addr.getText().toString().trim());\n\t\teb.setTel(tel.getText().toString().trim());\n\t\teb.setType(role.getSelectedIndex()+\"\");\n\t\teb.setState(\"1\");\n\t\t\n\t\tif (ed.addUser(eb) == 1) {\n\t\t\teb=ed.queryUserone(eb);\n\t\t\tJOptionPane.showMessageDialog(null, \"帐号为\" + eb.getUsername()\n\t\t\t\t\t+ \"的客户信息,录入成功\");\n\t\t\tclear();\n\t\t}\n\n\t}", "@Override\r\n\tpublic void add(User1 user) {\n\t\tSession session = sessionFactory.getCurrentSession();\r\n\t\tsession.save(user);\r\n\t}", "public void createUser(User user);", "public Boolean addUser(User user) throws ApplicationException;", "public User add(User u) {\n LOGGER.debug(\"adding user to db\");\n getSession().save(u);\n return u;\n }", "public int insertUser(User newUser) {\r\n\r\n try {\r\n BusTrackerDB = this.getWritableDatabase();\r\n\r\n ContentValues values = new ContentValues();\r\n values.put(\"username\", newUser.getUsername());\r\n values.put(\"password\", newUser.getPassword());\r\n\r\n BusTrackerDB.insert(\"user\", null, values);\r\n } catch (SQLiteException e) { return 0; }\r\n\r\n BusTrackerDB.close();\r\n\r\n return 1;\r\n }", "@Override\r\n\tpublic boolean addNewUser(User user) {\n\t\treturn false;\r\n\t}", "public static boolean addUser(UserDetails newUser){\n\t\t\t\t\t\t\n\t\t//getting attributes of UserDetails class with relevant data\n\t\t int id = newUser.getId();\n\t\t String name = newUser.getName(); \n\t\t String email = newUser.getEmail();\n\t\t String address = newUser.getAddress();\n\t\t String phone = newUser.getPhone(); \n\t\t String username = newUser.getUsername(); \n\t\t String password = newUser.getPassword();\n\t\t\t\n\t\ttry {\n\t\t\n\t\t\t //connecting to DB\n\t\t c = DatabaseConnection.getConnection();\n\t\t\t stmt = c.createStatement();\n\t\t\t String sqlStatement = \"insert into user values('\"+id+\"','\"+name+\"','\"+email+\"','\"+address+\"','\"+phone+\"','\"+username+\"','\"+password+\"')\";\n\t\t\t rsI = stmt.executeUpdate(sqlStatement);\n\t\t\t\t\n\t\t\t if(rsI>0) {\n\t\t\t\t status = true;\n\t\t\t }\n\t\t\t\n\t\t\t else {\n\t\t\t\t status = false;\t\n\t\t\t }\n\t\t\t\t\t\n\t\t}catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\t\n\t\treturn status;\n\t}", "public boolean addUser(User newUser) {\n boolean addResult = false;\n\tString sql = \"INSERT INTO users\"\n + \"(user_name, hashed_password, email, hashed_answer, is_activated, pubkey) VALUES\"\n + \"(? , ? , ? , ? , ?, ?)\";\n \ttry {\t\t\t\n this.statement = connection.prepareStatement(sql);\n this.statement.setString(1, newUser.getUserName());\n this.statement.setString(2, newUser.getHashedPassword());\n this.statement.setString(3, newUser.getEmail()); \n this.statement.setString(4, newUser.getHashedAnswer()); \n this.statement.setInt(5, newUser.getIsActivated()); \n this.statement.setString(6, \"\");\n this.statement.executeUpdate();\n addResult = true;\n this.statement.close();\n\t}\n catch(SQLException ex) {\n Logger.getLogger(UserDBManager.class.getName()).log(Level.SEVERE, null, ex);\n }\n return addResult; \n }", "@Override\n\tpublic User addUser(User user) {\n\t\treturn userDatabase.put(user.getEmail(), user);\n\t}", "public void registerNew(User newuser){\r\n\r\n\t\tString query=\" insert into user (email,fname,lname,phone,passord)\"\t\t\r\n\t\t\t\t+ \" values (?,?,?,?,?)\";\r\n\t\ttry \r\n\t\t{\t\t\r\n\t\t\tmyConnection = DriverManager.getConnection(db,user,password);\r\n\t\t\tPreparedStatement statement = myConnection.prepareStatement(query);\r\n\r\n\t\t\tstatement.setString(1,newuser.getEmail());\r\n\t\t\tstatement.setString(2,newuser.getfName());\r\n\t\t\tstatement.setString(3,newuser.getlName());\r\n\t\t\tstatement.setString(4,newuser.getPhone());\r\n\t\t\tstatement.setString(5,newuser.getPass());\r\n\t\t\tstatement.execute();\r\n\t\t}\r\n\t\tcatch (SQLException e )\r\n\t\t{\r\n\t\t\tSystem.out.println(\"something went wrong writting to DB\");\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t}", "public void insertUser(User user) {\n mUserDAO.insertUser(user);\n }", "public void addUser(User user) {\n SQLiteDatabase db = this.getWritableDatabase();\n\n ContentValues values = new ContentValues();\n values.put(COLUMN_USER_NAME, user.getName());\n values.put(COLUMN_USER_EMAIL, user.getEmail());\n values.put(COLUMN_USER_IMAGE, \"\");\n values.put(COLUMN_USER_PASSWORD, user.getPassword());\n values.put(COLUMN_USER_CURRMONTH_ID, -16);\n\n // Inserting Row\n db.insert(TABLE_USER, null, values);\n db.close();\n }", "@Override\n\tpublic void insertUser(User user) {\n\t\t\n\t}", "public void addUser(user user) {\n SQLiteDatabase db = this.getWritableDatabase();\n\n ContentValues values = new ContentValues();\n values.put(COLUMN_USER_NAME, user.getName());\n values.put(COLUMN_USER_EMAIL, user.getEmail());\n values.put(COLUMN_USER_PASSWORD, user.getPassword());\n\n // Inserting Row\n db.insert(TABLE_NAME, null, values);\n db.close();\n }", "@Test\n\tpublic void newUser() {\n\n\t\tUser user = new User(\"moviewatcher\", \"$2a$10$37jGlxDwJK4mRpYqYvPmyu8mqQJfeQJVSdsyFY5UNAm9ckThf2Zqa\", \"USER\");\n\t\tuserRepository.save(user);\n\n\t\tassertThat(user).isNotNull();\n\t\tassertThat(user).hasFieldOrPropertyWithValue(\"username\", \"moviewatcher\");\n\t}", "@Override\n\tpublic void addNewUser(User user) {\n\t\tusersHashtable.put(user.getAccount(),user);\n\t}", "boolean addUser(int employeeId, String name, String password, String role);", "public void insert(User user);", "public String create() {\r\n\t\tuserService.create(userAdd);\r\n\t\tusers.setWrappedData(userService.list());\r\n\t\treturn \"create\";\r\n\t}", "public void addUser() {\n\t\tUser user = dataManager.findCurrentUser();\r\n\t\tif (user != null) {\r\n\t\t\tframeManager.addUser(user);\r\n\t\t\tpesquisar();\r\n\t\t} else {\r\n\t\t\tAlertUtils.alertSemPrivelegio();\r\n\t\t}\r\n\t}", "@RequestMapping(value = \"/addUser\", method = RequestMethod.POST)\n\tpublic String addNewUser(@RequestParam(\"userName\") String userName, @RequestParam(\"password\") String password,\n\t\t\t@RequestParam(\"password1\") String password1, Model model) {\n\t\tUser user = userDao.getUser(userName);\n\t\tif (user == null) {\n\t\t\t// passwords need to be equal\n\t\t\tif (password.equals(password1)) {\n\n\t\t\t\tuser = new User(userName, password);\n\t\t\t\tuser.encryptPassword();\n\n\t\t\t\tUserRole userRole = userRoleDao.getRole(\"ROLE_USER\");\n\n\t\t\t\tuser.addUserRole(userRole);\n\t\t\t\tuserDao.merge(user);\n\t\t\t\tmodel.addAttribute(\"message\", \"Welcome \" + user.getUserName() + \", we hope you'll have fun.\");\n\n\t\t\t} else {\n\t\t\t\tmodel.addAttribute(\"errorMessage\", \"Error: Passwords do not match!\");\n\t\t\t\treturn \"signUp\";\n\t\t\t}\n\n\t\t} else {\n\t\t\tmodel.addAttribute(\"errorMessage\", \"Error: User already exists!\");\n\t\t\treturn \"signUp\";\n\t\t}\n\n\t\treturn \"login\";\n\t}", "public void newUser(User user);", "@GetMapping(\"/addUser\")\n public String home() {\n User user = new User();\n user.setUserName(\"Gitika\");\n user.setPassword(passwordEncoder.encode(\"saurabh321\"));\n user.setActive(true);\n user.setRoles(\"Role_Admin\");\n userRepository.save(user);\n return \"User created successfully\";\n }", "private void register_user() {\n\n\t\tHttpRegister post = new HttpRegister();\n\t\tpost.execute(Config.URL + \"/api/newuser\");\n\n\t}", "@Override\r\n\tpublic boolean addUser(user user) {\n\t\tif(userdao.insert(user)==1){\r\n\t\t\treturn true;}else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t}", "public void addUser(String name,String password) {\n SQLiteDatabase db = this.getWritableDatabase();\n\n ContentValues values = new ContentValues();\n values.put(KEY_USERNAME, name); // UserName\n values.put(KEY_PASSWORD,password);\n // Inserting Row\n long id = db.insert(TABLE_USER, null, values);\n //db.close(); // Closing database connection\n\n Log.d(TAG, \"New user inserted into sqlite: \" + id);\n }", "public void addUser(User user) {\n\t\tuserDao.addUser(user);\r\n\r\n\t}", "public void addUser(User user) {\n\t\tuserDao.insert(user);\n\t}", "@Override\n\tpublic int create(Users user) {\n\t\tSystem.out.println(\"service:creating new user...\");\n\t\treturn userDAO.create(user);\n\t}", "void addUser(User user) {\n SQLiteDatabase db = this.getWritableDatabase();\n ContentValues values = new ContentValues();\n values.put(KEY_utilizador, user.getUser()); // Contact Name\n values.put(KEY_pass, user.getPass()); // Contact Phone\n values.put(KEY_Escola, user.getEscola());\n db.insert(tabela, null, values);\n db.close(); // Closing database connection\n }", "public void addUser(User user) {\n update(\"INSERT INTO user \" +\n \"(role_id, given_name, family_name, username, email, password, phone) \" +\n \"values (?, ?, ?, ?, ?, ?, ?)\",\n new Object[] {user.getRoleId(), user.getGivenName(), user.getFamilyName(),\n user.getUsername(), user.getEmail(), user.getPassword(), user.getPhone()});\n }", "User create(final User user) throws DatabaseException;", "public void addUser(IndividualUser u) {\n try {\n PreparedStatement s = sql.prepareStatement(\"INSERT INTO Users (userName, firstName, lastName, friends) VALUES (?,?,?,?);\");\n s.setString(1, u.getId());\n s.setString(2, u.getFirstName());\n s.setString(3, u.getLastName());\n s.setString(4, u.getFriends().toString());\n s.execute();\n s.close();\n\n } catch (SQLException e) {\n sqlException(e);\n }\n }", "@Override\r\n\tpublic void add(User user) {\n\r\n\t}", "private void signUpNewUserToDB(){\n dbAuthentication.createUserWithEmailAndPassword(this.newUser.getEmail(), this.newUser.getPassword())\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if(task.isSuccessful()){\n /**signUp success, will update realTime DB ant firebase Authentication*/\n FirebaseUser currentUser = dbAuthentication.getCurrentUser();\n addToRealDB(currentUser.getUid());\n /**will send verification email to the user from Firebase Authentication*/\n currentUser.sendEmailVerification().addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n }\n });\n }else{isBadEmail = true;}\n }\n });\n }", "public void addUser(User user){\r\n users.add(user);\r\n }", "@Override\n\tpublic void addUser(ERSUser user) {\n\t\tuserDao.insertUser(user);\n\t}", "@POST(\"/AddUser\")\n\tint addUser(@Body User user);", "public void addUser(User user) {\n\t\tuserMapper.insert(user);\n\n\t}", "public void addUser(String username, String password) {\n\t\t// Connect to database\n\t\tPreparedStatement ps = null;\n\t\tResultSet rs = null;\n\t\t\n\t\t// Create new entry\n\t\tString newEntryString = \"INSERT INTO User (username, password, winNum, loseNum) VALUES (?, ?, 0, 0)\";\n\t\t\n\t\ttry {\n\t\t\tps = conn.prepareStatement(newEntryString);\n\t\t\tps.setString(1, username);\n\t\t\tps.setString(2, password);\n\t\t\tps.executeUpdate();\n\t\t}\n\t\tcatch(SQLException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\tfinally {\n\t\t\t// Close connections\n\t\t\ttry {\n\t\t\t\tif(rs != null)\n\t\t\t\t{\n\t\t\t\t\trs.close();\n\t\t\t\t}\n\t\t\t\tif(ps != null)\n\t\t\t\t{\n\t\t\t\t\tps.close();\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(SQLException sqle)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"sqle: \" + sqle.getMessage());\n\t\t\t}\n\t\t}\n\t\t\n\t}", "@Override\n\tpublic boolean addUser(User user) {\n\t\tObject object = null;\n\t\tboolean flag = false;\n\t\ttry {\n\t\t\tobject = client.insert(\"addUser\", user);\n\t\t\tSystem.out.println(\"添加学生信息的返回值:\" + object);\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tif (object != null) {\n\t\t\tflag = true;\n\t\t}\n\t\treturn flag;\n\t}", "private void addNewUser() throws Exception, UnitException {\n String firstNameInput = firstName.getText();\n String lastNameInput = lastName.getText();\n String unitInput = unitID.getText();\n String accountInput = accountTypeValue;\n String passwordInput = password.getText();\n User newUserInfo;\n\n // Create user type based on the commandbox input\n switch (accountInput) {\n case \"Employee\":\n newUserInfo = new Employee(firstNameInput, lastNameInput, unitInput, passwordInput);\n break;\n case \"Lead\":\n newUserInfo = new Lead(firstNameInput, lastNameInput, unitInput, passwordInput);\n break;\n case \"Admin\":\n newUserInfo = new Admin(firstNameInput, lastNameInput, unitInput, passwordInput);\n break;\n default:\n throw new IllegalStateException(\"Unexpected value: \" + accountInput);\n }\n\n // Try adding this new user information to the database, if successful will return success prompt\n try {\n Admin.addUserToDatabase(newUserInfo);\n\n // If successful, output message dialog\n String msg = \"New User \" + firstNameInput + \" \" + lastNameInput + \" with UserID \"\n + newUserInfo.returnUserID() + \" successfully created\";\n JOptionPane.showMessageDialog(null, msg);\n\n // Reset Values\n firstName.setText(\"\");\n lastName.setText(\"\");\n unitID.setText(\"\");\n password.setText(\"\");\n } catch (UserException e) {\n JOptionPane.showMessageDialog(null, e.getMessage());\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, e.getMessage());\n }\n }", "@PostMapping(\"/add\")\n\tpublic User addUser( @Valid @RequestBody User user) {\n\t\tcontrollerLogger.info(\"new user sign up\");\n\t\treturn service.signUp(user);\n\t}", "@Override\n\tpublic boolean addNewUser() {\n\t\treturn false;\n\t}", "@Override\n\tpublic void add(UserModel um) throws Exception {\n\t\tuserMapper.insert(um);\n\t}", "@Override\n public boolean userRegister(User user) \n { \n Connection conn = null;\n Statement stmt = null;\n try \n {\n db_controller.setClass();\n conn = db_controller.getConnection();\n stmt = conn.createStatement();\n String sql;\n \n sql = \"INSERT INTO users (firstname,lastname,username,password,city,number) \"\n + \"values ('\"+ user.getFirstname()+\"',\" \n + \"'\" + user.getLastname() + \"',\" \n + \"'\" + user.getUsername() + \"',\" \n + \"'\" + user.getPassword() + \"',\" \n + \"'\" + user.getCity() + \"',\"\n + \"'\" + user.getNumber() + \"')\";\n int result = stmt.executeUpdate(sql);\n \n stmt.close();\n conn.close();\n if(result == 1) return true;\n else return false;\n } \n catch (SQLException ex) { ex.printStackTrace(); return false;} \n catch (ClassNotFoundException ex) { ex.printStackTrace(); return false;} \n }", "@Override\n public void registerUser(User user) {\n userDAO.createUser(user);\n }", "public int createUser(Users user) {\n\t\t int result = getTemplate().update(INSERT_users_RECORD,user.getUsername(),user.getPassword(),user.getFirstname(),user.getLastname(),user.getMobilenumber());\n\t\t\treturn result;\n\t\t\n\t\n\t}", "private void writeNewUser(String userId, String name, String email) {\n User user = new User(name, email);\n\n mDatabase.child(\"users\")\n .child(userId)\n .child(\"Name\").setValue(name);\n\n mDatabase.child(\"users\")\n .child(userId)\n .child(\"Email\").setValue(email);\n\n\n }", "@Override\r\n\tpublic boolean add(User u) {\r\n\t\treturn executeAndIsModified(INSERT_INTO_USERS, u.getTax_code(),\r\n\t\t\t\tu.getName(),\r\n\t\t\t\tu.getSurname(),\r\n\t\t\t\tu.getPhone(),\r\n\t\t\t\tu.getAddress(),\r\n\t\t\t\tu.getEmail(),\r\n\t\t\t\tu.getPassword(),\r\n\t\t\t\tu.getRole());\r\n\r\n\t}", "public String add() {\r\n\t\tuserAdd = new User();\r\n\t\treturn \"add\";\r\n\t}", "@Override\n public boolean addUser(User user) {\n return controller.addUser(user);\n }", "public void addUser(User user) throws Exception {\n try (SQLiteDatabase db = this.getWritableDatabase()) {\n ContentValues values = new ContentValues();\n\n values.put(USERS_ID_COLUMN, user.getUserID());\n values.put(USERS_NAME_COLUMN, user.getUserName());\n values.put(USERS_LASTNAME_COLUMN, user.getUserLastname());\n\n db.insert(USERS_TABLE_NAME, null, values);\n }\n }", "@Override\n\tpublic int insertUser(String username, String password) {\n\t\treturn userMapper.insertUser(username, password);\n\t}", "public int add(User user) {\n\t\treturn this.userDao.insert(user);\r\n\t}", "public void Adduser(User u1) {\n\t\tUserDao ua=new UserDao();\n\t\tua.adduser(u1);\n\t\t\n\t}", "@Override\n\tpublic int addUser(TbUser user) {\n\t\treturn new userDaoImpl().addUser(user);\n\t}", "public Boolean addUser( User user){\n\t\tConnection connection = db.getConnection();\n\t\tPreparedStatement stmt = null;\n\t\ttry { \n\t\t\tString sql = \"INSERT INTO USER\" +\n\t\t\t\t\t\"(username, password, firstname, lastname, email, recordsindexed, batchid)\" + \n\t\t\t\t\t\"\t\t\t\t\t\tVALUES (?, ?, ?, ?, ?, ?, ?)\";\n\t\t\tstmt = connection.prepareStatement(sql); \n\t\t\tstmt.setString(1, user.getUsername()); \n\t\t\tstmt.setString(2, user.getPassword()); \n\t\t\tstmt.setString(3, user.getFirstname()); \n\t\t\tstmt.setString(4, user.getLastname()); \n\t\t\tstmt.setString(5, user.getEmail());\n\t\t\tstmt.setInt(6, user.getNumIndexedRecords());\n\t\t\tstmt.setInt(7, user.getCurBatchId());\n\n\t\t\tstmt.executeUpdate();\t\n\t\t\tstmt.close();\n\t\t} \n\t\tcatch (SQLException e) { \n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t} \n\t\treturn true;\n\t}", "@PostMapping(\"/users\")\n public UsersResponse createNewUser(@RequestBody NewUserRequest request) {\n User user = new User();\n user.setName(request.getName());\n user.setAge(request.getAge());\n user = userRepository.save(user);\n return new UsersResponse(user.getId(), user.getName() + user.getAge());\n }", "@Override\n\tpublic int addUser(User user) {\n\t\treturn userDao.addUser(user);\n\t}", "public boolean addUser(User user) {\n\t\t\r\n\t\tuser.setEnabled(true);\r\n\t\tuser.setAuthority(\"user\");\r\n\t\tuser.setPassword(new BCryptPasswordEncoder().encode(user.getPassword()));\r\n\t\t\r\n\tsessionFactory.getCurrentSession().save(user);\r\n\treturn true;\r\n \r\n\t}", "@Override\r\n\tpublic int register(User user) {\n\t\treturn dao.addUser(user);\r\n\t}", "public void addNewUser(String email) {\n String userName = email.split(\"@\")[0];\n mUsersRef.child(userName).setValue(userName);\n userRef = db.getReference(\"users/\" + getUsername());\n userRef.child(\"email\").setValue(email);\n userSigns = new HashMap<String, UserSign>();\n }", "public void addUser(String name, String email, String uid, String created_at,String address,String number) {\n SQLiteDatabase db = this.getWritableDatabase();\n\n ContentValues values = new ContentValues();\n values.put(KEY_NAME, name); // Name\n values.put(KEY_EMAIL, email); // Email\n values.put(KEY_UID, uid); // Email\n values.put(KEY_CREATED_AT, created_at); // Created At\n values.put(KEY_ADDRESS, address);\n values.put(KEY_NUMBER, number);\n\n // Inserting Row\n long id = db.insert(TABLE_USER, null, values);\n db.close(); // Closing database connection\n\n Log.d(TAG, \"New user inserted into sqlite: \" + id);\n }", "public void add(User user) {\n\t\tuserDao.add(user);\n\t}", "boolean create(User user) throws Exception;", "public void addusers(User user){\n SQLiteDatabase db = this.getReadableDatabase();\n ContentValues values=new ContentValues();\n\n values.put(KEY_NAME, user.getName());\n values.put(KEY_PASS,user.getPasscode());\n values.put(KEY_PHOTO, user.getImage() );\n\n\n db.insert(TABLE_USERS, null, values);\n db.close();\n }", "@Override\n\tpublic void addUser(User user) {\n\t\tiUserDao.addUser(user);\n\t}", "public static boolean addUser(UserDetailspojo user) throws SQLException {\n Connection conn=DBConnection.getConnection();\n String qry=\"insert into users1 values(?,?,?,?,?)\";\n System.out.println(user);\n PreparedStatement ps=conn.prepareStatement(qry);\n ps.setString(1,user.getUserid());\n ps.setString(4,user.getPassword());\n ps.setString(5,user.getUserType());\n ps.setString(3,user.getEmpid());\n ps.setString(2,user.getUserName());\n //ResultSet rs=ps.executeQuery();\n int rs=ps.executeUpdate();\n return rs==1;\n //String username=null;\n }", "@Override\r\n\tpublic int saveUser(User user) {\n\t\tString sql = \"insert into user values(?,?,?,?)\";\r\n\t\treturn this.update(sql,user.getId(), user.getUsername(),user.getPassword(),user.getEmail());\r\n\t}", "public void createUser() throws ServletException, IOException {\n\t\tString fullname = request.getParameter(\"fullname\");\n\t\tString password = request.getParameter(\"password\");\n\t\tString email = request.getParameter(\"email\");\n\t\tUsers getUserByEmail = productDao.findUsersByEmail(email);\n\t\t\n\t\tif(getUserByEmail != null) {\n\t\t\tString errorMessage = \"we already have this email in database\";\n\t\t\trequest.setAttribute(\"message\", errorMessage);\n\t\t\t\n\t\t\tString messagePage = \"message.jsp\";\n\t\t\tRequestDispatcher requestDispatcher = request.getRequestDispatcher(messagePage);\n\t\t\trequestDispatcher.forward(request, response);\n\t\t}\n\t\t// create a new instance of users class;\n\t\telse {\n\t\t\tUsers user = new Users();\n\t\t\tuser.setPassword(password);\n\t\t\tuser.setFullName(fullname);\n\t\t\tuser.setEmail(email);\n\t\t\tproductDao.Create(user);\n\t\t\tlistAll(\"the user was created\");\n\t\t}\n\n\t\t\n\t}", "public int add(Userinfo user) {\n\t\treturn userDAO.AddUser(user);\r\n\t}", "@Override\n\tpublic void createUser(User user) {\n\t\tSystem.out.println(\"INSIDE create user function\");\n\t\tem.persist(user);\n\t\t\t\n\t}", "public void ajouterUser(Utilisateur user) {\n SQLiteDatabase db = this.getWritableDatabase(); // On veut écrire dans la BD\n ContentValues values = new ContentValues();\n values.put(USER_NOM, user.getNom());\n values.put(USER_AGE, user.getAge());\n values.put(USER_SEX, user.getSex());\n// Insérer le nouvel enregistrement\n long id = db.insert(TABLE_USER, null, values);\n db.close(); // Fermer la connexion\n }" ]
[ "0.777886", "0.77638316", "0.7699927", "0.7699927", "0.7669148", "0.76644623", "0.76597023", "0.7647305", "0.7611081", "0.7544655", "0.7544395", "0.74726564", "0.74714464", "0.7457184", "0.7448959", "0.744743", "0.7423399", "0.738042", "0.7371733", "0.73660374", "0.7362831", "0.7344023", "0.73391896", "0.7330965", "0.73292583", "0.7318156", "0.73177457", "0.73099566", "0.7307962", "0.7294964", "0.729147", "0.7291202", "0.72666335", "0.72360075", "0.7228707", "0.7226851", "0.7221849", "0.72143817", "0.7213266", "0.7184549", "0.71375906", "0.71339804", "0.7132637", "0.71267307", "0.7122992", "0.7109506", "0.7100066", "0.70974326", "0.70906025", "0.7089104", "0.70882404", "0.70855176", "0.70761305", "0.7075586", "0.70755553", "0.7067681", "0.7056953", "0.70560586", "0.70499825", "0.70488787", "0.7048767", "0.70427185", "0.7042232", "0.7037524", "0.7020608", "0.7010234", "0.70034385", "0.6992621", "0.69920886", "0.69907755", "0.6988827", "0.69817835", "0.69800234", "0.6979518", "0.69793195", "0.69759476", "0.69702804", "0.6952745", "0.69392085", "0.6939107", "0.6934509", "0.69339097", "0.69278145", "0.6926443", "0.69227505", "0.69226533", "0.6915913", "0.69135725", "0.6911619", "0.6910318", "0.6904159", "0.6902646", "0.689813", "0.68948567", "0.68896824", "0.68833005", "0.6882472", "0.68768495", "0.6874082", "0.6870165", "0.6869069" ]
0.0
-1
Updates a String with the returned json object that is in string format
@Override public void onSuccess(String JSONObject_String) { view.hideProgressBar(); view.updateUserInfoTextView(JSONObject_String); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public String toString() {\n return jsonString;\n }", "@JsonIgnore\n\tpublic String getJsonUpdateString() {\n\t\ttry {\n\t\t\treturn mapper.writeValueAsString(this);\n\t\t} catch (JsonProcessingException e) {\n\t\t\treturn (\"Failed to serialize statement update to JSON: \" + e.toString());\n\t\t}\n\t}", "public abstract String toJsonString();", "public static Value makeJSONStr() {\n return theJSONStr;\n }", "public static String formatJSONStringFromResponse(String apiString) {\n String remove_new_line = apiString.replace(\"\\\\n\", \"\\\\\");\n String remove_begin_slash = remove_new_line.replace(\"\\\"{\", \"{\");\n String remove_end_slash = remove_begin_slash.replace(\"}\\\"\", \"}\");\n String remove_extra_slashes = remove_end_slash.replace(\"\\\\\", \"\");\n return remove_extra_slashes;\n }", "public JSONString(String stringIn)\n {\n this.string = stringIn;\n }", "public synchronized String getJSONString() {\n\n return getJSONObject().toString();\n }", "public String renderJsonString(Object model) {\r\n \r\n StringBuffer buffer = new StringBuffer();\r\n jsonSerializer.deepSerialize(model, buffer);\r\n StringBuilder jsonResponse = new StringBuilder();\r\n jsonResponse.append(buffer);\r\n \r\n //Pattern.compile(regex).matcher(str).replaceAll(repl)\r\n String s = pattrenEscapedBackquote.matcher(jsonResponse.toString()).replaceAll(\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\");\r\n //String s = jsonResponse.toString().replaceAll(\"\\\\\\\\\\\\\\\\\", \"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\");\r\n s = pattrenEscapedQuoubleQuotePrefixedwithBackquote.matcher(s).replaceAll(\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\");\r\n //s = s.replaceAll(\"\\\\\\\\\\\\\\\"\", \"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\");\r\n s = pattrenForDoubleQuote.matcher(s).replaceAll(\"$1\\\\\\\\\\\"\");\r\n s = pattrenEscapedQuoubleQuoteNotPrefixedwithBackquote.matcher(s).replaceAll(\"$1\\\\\\\\\\\"\");\r\n //s = s.replaceAll(\"([^\\\\\\\\])\\\"\", \"$1\\\\\\\\\\\"\");\r\n \r\n return (\"\\\"\" + s + \"\\\"\");\r\n }", "void mo59932a(String str, JSONObject jSONObject);", "public String convertToString() {\n return mJSONObject.toString();\n }", "public static String getJson() {\n\t\treturn jsonString;\n\t}", "static String getStringJsonEscaped(String str) {\n JsonStringEncoder e = JsonStringEncoder.getInstance();\n StringBuilder sb = new StringBuilder();\n e.quoteAsString(str, sb);\n return sb.toString();\n }", "void mo16412a(String str, JSONObject jSONObject);", "void mo26099a(String str, JSONObject jSONObject);", "public static String reParseJson(String old){\n int start = old.indexOf(\"{\");\n int end = old.lastIndexOf(\"}\");\n return old.substring(start,end+1);\n\n }", "public String toJson(final String object) {\n if (object != null && (object.startsWith(\"[\") || object.startsWith(\"{\")\n || (object.startsWith(\"\\\"[\") || object.startsWith(\"\\\"{\")))) {\n return object;\n } else\n return \"{\\\"\" + \"{\\\"success\\\" : 1}\" + \"\\\":\\\"\" + object + \"\\\"}\";\n }", "public static String GetJSONString(String resourceString) {\n String retVal = \"\";\n resourceString = resourceString.replaceAll(\"<API_.*?>\", \"\").replaceAll(\"</API_.*?>\", \"\");\n try {\n String json = XML.toJSONObject(resourceString).toString();\n json = \"{\" + json.substring(1, json.length() - 1).replaceAll(\"\\\\{\", \"\\\\[{\").replaceAll(\"\\\\}\", \"\\\\]}\") + \"}\";\n retVal = json;\n } catch (Exception ex) {\n ApiLog.One.WriteException(ex);\n }\n return retVal;\n }", "String getJson();", "String getJson();", "String getJson();", "public String toJsonString() {\n String str;\n String str2;\n try {\n if (this.lifetime == null) {\n str = \"null\";\n } else {\n str = \"\\\"\" + this.lifetime.toString() + \"\\\"\";\n }\n if (this.frequency == null) {\n str2 = \"\";\n } else {\n str2 = \",\\\"frequency\\\":\" + this.frequency;\n }\n return \"{\\\"enabled\\\":\" + this.enabled + str2 + \",\\\"lifetime\\\":\" + str + \"}\";\n } catch (Exception e) {\n C3490e3.m663c(e.getMessage());\n return \"\";\n }\n }", "public String getJsonAsString() {\n\t\treturn this.flodJsonObject.toString();\n\t}", "public String toJsonString() {\n return JsonUtils.getGson().toJson(toJson());\n }", "String toJSON();", "public abstract String toJson();", "public static String getString(Object object){\n return JSON.toJSONString(object);\n }", "public String getJson() {\n Object ref = json_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n json_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }", "public String getJson() {\n Object ref = json_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n json_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }", "public String getJson() {\n Object ref = json_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n json_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }", "public void putString (JSONObject target , String key , String value ){\r\n\t\tif ( value==null){\r\n\t\t\ttarget.put(key, JSONNull.getInstance());\r\n\t\t\treturn ; \r\n\t\t}\r\n\t\ttarget.put(key, new JSONString(value)); \r\n\t}", "public String getJson();", "String getJSON();", "public String getJson() {\n Object ref = json_;\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 json_ = s;\n return s;\n }\n }", "public String getJson() {\n Object ref = json_;\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 json_ = s;\n return s;\n }\n }", "public String getJson() {\n Object ref = json_;\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 json_ = s;\n return s;\n }\n }", "public final void mo39814b(String str, JSONObject jSONObject) {\n if (jSONObject == null) {\n jSONObject = new JSONObject();\n }\n String jSONObject2 = jSONObject.toString();\n StringBuilder sb = new StringBuilder(String.valueOf(str).length() + 3 + String.valueOf(jSONObject2).length());\n sb.append(str);\n sb.append(\"(\");\n sb.append(jSONObject2);\n sb.append(\");\");\n m46527f(sb.toString());\n }", "public static String JsonToString(JsonObject jso, String param, String defaulx) {\n try {\n JsonElement res = securGetJSON(jso, param);\n if (res != null) {\n String result = res.getAsString();\n result = result.trim().replace(\"\\n\", \"\\\\n\").replace(\"\\t\", \"\\\\t\").replace(\"'\", \"''\");\n return result;\n } else {\n return defaulx;\n }\n } catch (Exception e) {\n// System.out.println(\"erro json a string\");\n return defaulx;\n }\n }", "public String toJsonString() {\n JSONObject jsonObject = new JSONObject();\n try {\n jsonObject.put(\"from\", from);\n jsonObject.put(\"domain\", domain);\n jsonObject.put(\"provider\", provider);\n jsonObject.put(\"action\", action);\n\n try {\n JSONObject jsonData = new JSONObject();\n for (Map.Entry<String, String> entry : data.entrySet()) {\n jsonData.put(entry.getKey(), entry.getValue());\n }\n jsonObject.put(\"data\", jsonData);\n } catch (Exception e) {\n e.printStackTrace();\n jsonObject.put(\"data\", \"{}\");\n }\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n return jsonObject.toString();\n }", "public static void setJsonString(String jsonString) {\n\t\tMockSocket.jsonString = jsonString;\n\t}", "@Override\n public void update(String string) {\n }", "JsonNode updateData(String data);", "public String serializeJSON () {\n ObjectMapper mapper = new ObjectMapper();\n String jsonString = null;\n \n try {\n jsonString = mapper.writeValueAsString(this);\n } catch (JsonProcessingException e) {\n e.printStackTrace();\n }\n return jsonString;\n }", "org.hl7.fhir.String addNewValueString();", "@Override\r\n\tprotected GuardarSustentoResponse responseText(String json) {\n\t\tGuardarSustentoResponse guardarSustentoResponse = JSONHelper.desSerializar(json, GuardarSustentoResponse.class);\r\n\t\treturn guardarSustentoResponse;\r\n\t}", "public JSONResponse(String jsonString) {\n this.jsonString = jsonString;\n }", "String toJson() throws IOException;", "public String createJsonObject() {\n JSONObject jsonObject = new JSONObject();\n\n try {\n if (!vslaId.equalsIgnoreCase(\"-1\")) {\n // editing existing information\n jsonObject.put(\"VslaId\", vslaId);\n }\n jsonObject.put(\"GroupSupport\", grpSupportType);\n jsonObject.put(\"VslaName\", vslaName);\n jsonObject.put(\"grpPhoneNumber\", grpPhoneNumber);\n jsonObject.put(\"PhysicalAddress\", physAddress);\n jsonObject.put(\"GpsLocation\", locCoordinates);\n jsonObject.put(\"representativeName\", representativeName);\n jsonObject.put(\"representativePosition\", representativePost);\n jsonObject.put(\"GroupAccountNumber\", grpBankAccount);\n jsonObject.put(\"repPhoneNumber\", repPhoneNumber);\n jsonObject.put(\"RegionName\", regionName);\n jsonObject.put(\"tTrainerId\", tTrainerId);\n jsonObject.put(\"Status\", \"2\");\n jsonObject.put(\"numberOfCycles\", numberOfCycles);\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n return jsonObject.toString();\n }", "public String toJSON() throws JSONException;", "public String getStringRepresentation() {\n JSONObject obj = new JSONObject();\n obj.put(\"title\", title);\n obj.put(\"authors\", authors);\n return obj.toString();\n }", "static public Json wrapString(String string, QName type) {\n JsonObject json = new JsonObject();\n json.put(Manager.XP_VALUE.toString(), string);\n json.put(Manager.XP_TYPE.toString(), type.toString());\n return json;\n }", "@Override\n public String encode() {\n JsonObject tmp = new JsonObject();\n addIfSet(tmp, \"id\", id);\n addIfSet(tmp, \"courseId\", courseId);\n addIfSet(tmp, \"sheetId\", sheetId);\n addIfSet(tmp, \"maxPoints\", maxPoints);\n addIfSet(tmp, \"type\", type);\n addIfSet(tmp, \"link\", link);\n addIfSet(tmp, \"bonus\", bonus);\n addIfSet(tmp, \"linkName\", linkName);\n addIfSet(tmp, \"submittable\", submittable);\n addIfSet(tmp, \"resultVisibility\", resultVisibility);\n tmp = super.encodeToObject(tmp);\n return tmp.toString();\n }", "public String putJSON(String urlStr, String putStr) throws Exception{ \n \t/*\n \tURL url = new URL(urlStr);\n \tHttpURLConnection httpCon = (HttpURLConnection) url.openConnection();\n \thttpCon.setDoOutput(true);\n \thttpCon.setRequestMethod(\"PUT\");\n \tOutputStreamWriter out = new OutputStreamWriter(httpCon.getOutputStream());\n \tout.write(putStr);\n \tout.close();\n \t*/\n HttpClient httpClient = new DefaultHttpClient();\n HttpResponse response;\n HttpPut put=new HttpPut();\n HttpEntity httpEntity;\n StringEntity stringEntity=new StringEntity(putStr);\n stringEntity.setContentEncoding(new BasicHeader(HTTP.CONTENT_TYPE, \"application/json\"));\n httpEntity=stringEntity;\n put.setEntity(httpEntity);\n put.setURI(new URI(urlStr));\n put.setHeader(\"Content-type\", \"application/json\");\n response=httpClient.execute(put);\n return parseHttpResponse(response);\n \n }", "public void setStringInternal(FastJsonResponse.Field<?, ?> field, String str, String str2) {\n zab(field);\n SafeParcelWriter.writeString(this.zarb, field.getSafeParcelableFieldId(), str2, true);\n }", "public String toJsonString() {\n\t\tString json = null;\n\t\t\n\t\tObjectMapper mapper = new ObjectMapper();\n\t\tmapper.setSerializationInclusion(Include.NON_NULL);\n\t\tmapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true);\n\t\ttry {\n\t\t\tjson = mapper.writeValueAsString(this);\n\t\t} catch (JsonProcessingException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn json;\n\t}", "private static String asJsonString(final Object obj) {\n try {\n return new ObjectMapper().writeValueAsString(obj);\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n }", "public final native String toJson() /*-{\n // Safari 4.0.5 appears not to honor the replacer argument, so we can't do this:\n \n // var replacer = function(key, value) {\n // if (key == '__key') {\n // return;\n // }\n // return value;\n // }\n // return $wnd.JSON.stringify(this, replacer);\n \n var key = this.__key;\n delete this.__key;\n var rf = this.__rf;\n delete this.__rf;\n var gwt = this.__gwt_ObjectId;\n delete this.__gwt_ObjectId;\n // TODO verify that the stringify() from json2.js works on IE\n var rtn = $wnd.JSON.stringify(this);\n this.__key = key;\n this.__rf = rf;\n this.__gwt_ObjectId = gwt;\n return rtn;\n }-*/;", "public static JSONObject put(JSONObject object, String string, String value) {\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\tobject.put(string, value);\n\t\t} \n\t\tcatch (JSONException e) {\n\t\t\t\n\t\t\tLOGGER.error(\"Could not put json in json object\", e);\n\t\t}\n\t\treturn object;\n\t}", "public static String getJsonString(Object obj) {\n\t\tString res = \"{}\";\n\t\tStringWriter out = new StringWriter();\n\t\ttry {\n\t\t\tJSONValue.writeJSONString(obj, out);\n\t\t\tres = out.toString();\n\t\t} catch (IOException e) {\n\t\t\tLOGGER.error(\"Error converting obj to string\", e);\n\t\t}\n\t\treturn res;\n\t}", "@Override\n\tpublic String putObjectCore(Object object) {\n\t\treturn JSON.encode(object);\n\t}", "private String stringify(Object object) throws JsonProcessingException {\n return new ObjectMapper().writeValueAsString(object);\n }", "public void putJSON(final String key, String value) {\n value = JSONObject.quote(value);\n value = value.substring(1, value.length() - 1);\n put(key, value);\n }", "public String toJson()\n\t{\n\t\tJsonStringEncoder encoder = JsonStringEncoder.getInstance();\n\n\t\tStringBuilder builder = new StringBuilder();\n\t\tbuilder.append('{');\n\n\t\tboolean needComma = true;\n\t\tif (m_Message != null)\n\t\t{\n\t\t\tchar [] message = encoder.quoteAsString(m_Message.toString());\n\t\t\tbuilder.append(\"\\n \\\"message\\\" : \\\"\").append(message).append('\"').append(',');\n\t\t\tneedComma = false;\n\t\t}\n\n\t\tif (m_ErrorCode != null)\n\t\t{\n\t\t\tbuilder.append(\"\\n \\\"errorCode\\\" : \").append(m_ErrorCode.getValueString());\n\t\t\tneedComma = true;\n\t\t}\n\n\t\tif (m_Cause != null)\n\t\t{\n\t\t\tif (needComma)\n\t\t\t{\n\t\t\t\tbuilder.append(',');\n\t\t\t}\n\t\t\tchar [] cause = encoder.quoteAsString(m_Cause.toString());\n\t\t\tbuilder.append(\"\\n \\\"cause\\\" : \\\"\").append(cause).append('\"');\n\t\t}\n\n\t\tbuilder.append(\"\\n}\\n\");\n\n\t\treturn builder.toString();\n\t}", "public String toJSon() {\n File jsonFile = new File(context.getFilesDir(), \"data.json\");\n String previousJson = null;\n if (jsonFile.exists()) {\n previousJson = readFromFile(jsonFile);\n } else {\n previousJson = \"{}\";\n }\n\n // create new \"complex\" object\n JSONObject mO = null;\n try {\n mO = new JSONObject(previousJson);\n\n JSONArray arr;\n if (!mO.has(getIntent().getStringExtra(\"date\"))) {\n arr = new JSONArray();\n }\n else{\n arr = mO.getJSONArray(getIntent().getStringExtra(\"date\"));\n }\n JSONObject jo = new JSONObject();\n jo.put(\"title\", titleField.getText().toString());\n jo.put(\"minute\", minute);\n jo.put(\"hour\", hour);\n jo.put(\"description\", descriptionField.getText().toString());\n jo.put(\"location\", locationField.getText().toString());\n\n arr.put(jo);\n\n mO.put(getIntent().getStringExtra(\"date\"), arr);\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n // generate string from the object\n String jsonString = null;\n try {\n jsonString = mO.toString(4);\n return jsonString;\n } catch (JSONException e) {\n e.printStackTrace();\n }\n return null;\n\n }", "public String toJson() { return new Gson().toJson(this); }", "public static JSONObject put(JSONObject object, String string, JSONArray jsonArray) {\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\tobject.put(string, jsonArray);\n\t\t} \n\t\tcatch (JSONException e) {\n\t\t\t\n\t\t\tLOGGER.error(\"Could not put json in json object\", e);\n\t\t}\n\t\t\n\t\treturn object;\n\t}", "public static void main(String[] args) {\n String jsonText = \"{'name': 'Yuki', 'feedback': 'OK'}\";\r\n jsonText = jsonText.replaceAll(\"(')\", \"\\\"\");\r\n\r\n System.out.println(jsonText);\r\n }", "@Override\n\tprotected String toJSON()\n\t{\n\t\treturn getJSON(null);\n\t}", "void testFormatter(String s){\n\t\tInputStream istream = new java.io.ByteArrayInputStream(s.getBytes());\n\t\tMessageContext mc = new MessageContext();\n\t\tJSONOMBuilder ob = new JSONOMBuilder();\n\t\tOMSourcedElement omse;\n\t\ttry {\n\t\t\tomse = (OMSourcedElement) ob.processDocument(istream, \"application/json\", mc);\n\t\t} catch (AxisFault e) {\n\t\t\te.printStackTrace();\n\t\t\treturn;\n\t\t}\n // go for the formatte\n\t\tJSONMessageFormatter of = new JSONMessageFormatter();\n\t\tmc.setDoingREST(true);\n\t\tOMDataSource datasource = omse.getDataSource();\n\t\tString str = of.getStringToWrite(datasource);\n\t\tSystem.out.println(str);\n\t}", "String toJSONString(Object data);", "public String toJson() {\n try{\n return new JsonSerializer().getObjectMapper().writeValueAsString(this);\n } catch (IOException e){\n throw new RuntimeException(e);\n }\n }", "public static JSONObject put(JSONObject object, String string, JSONObject jsonObject) {\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\tobject.put(string, jsonObject);\n\t\t} \n\t\tcatch (JSONException e) {\n\t\t\t\n\t\t\tLOGGER.error(\"Could not put json in json object\", e);\n\t\t}\n\t\treturn object;\n\t}", "public String stringApiValue() {\n return cyclifyWithEscapeChars();\n }", "private JSONObject serializeJson(String text){\n try {\n JSONObject jsonObject = new JSONObject(text);\n return jsonObject;\n }catch (JSONException err){\n return null;\n }\n }", "public static JSONObject strToJson(String jsonstring) {\n JSONParser parser = new JSONParser();\n JSONObject json = null;\n try {\n json = (JSONObject) parser.parse(jsonstring);\n } catch (ParseException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n return json;\n }", "private static String jsonToString(final Object obj) throws JsonProcessingException {\n String result;\n try {\n final ObjectMapper mapper = new ObjectMapper();\n final String jsonContent = mapper.writeValueAsString(obj);\n result = jsonContent;\n } catch (JsonProcessingException e) {\n result = \"Json processing error\";\n }\n return result;\n }", "public String toJsonfrmObject(Object object) {\n try {\n ObjectMapper mapper = new ObjectMapper();\n mapper.setDateFormat(simpleDateFormat);\n return mapper.writeValueAsString(object);\n } catch (IOException e) {\n logger.error(\"Invalid JSON!\", e);\n }\n return \"\";\n }", "public static String m5900a(JSONObject jSONObject, String str, String str2) {\n try {\n jSONObject = (!jSONObject.has(str) || jSONObject.isNull(str)) ? null : jSONObject.getString(str);\n return jSONObject;\n } catch (JSONObject jSONObject2) {\n jSONObject2.printStackTrace();\n return str2;\n }\n }", "public String transform(String json) throws JsonSyntaxException {\n var jsonObject = new Gson().fromJson(json, JsonObject.class);\n var transformed = new Gson().toJson(only(jsonObject, keys));\n return decoratedJson.transform(transformed);\n }", "@Override\n\tpublic String toString() {\n\t\treturn Json.pretty( this );\n\t}", "@SuppressWarnings(\"unchecked\")\n public String convertToMetadataString() {\n JSONObject meta = new JSONObject();\n // TODO: check if this still works under json.simple\n meta.put(\"meta\", mJSONObject);\n\n return meta.toString();\n }", "@Override\r\n\tpublic void updateJSON(JSONObject json, String key, Object value) {\r\n\r\n\t\ttry {\r\n\t\t\tjson.put(key, value);\r\n\t\t} catch (JSONException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public String toJson() {\n if (text.length() != 0) {\n JsonBuilder result = new JsonBuilder();\n result.add(\"text\", text.toString());\n result.add(\"color\", chatColor.asBungee().getName());\n\n result.add(\"bold\", bold);\n result.add(\"italic\", italic);\n result.add(\"underlined\", underlined);\n result.add(\"strikethrough\", strikethrough);\n result.add(\"obfuscated\", obfuscated);\n\n if (!clickEvent.equals(ClickAction.NONE)) {\n if (customClickEvent) {\n result.addCustomClickEvent(clickEvent, clickEventValue);\n } else {\n result.addClickEvent(clickEvent, clickEventValue);\n }\n }\n\n if (!hoverEvent.equals(HoverAction.NONE)) {\n if (customHoverEvent) {\n result.addCustomHoverEvent(hoverEvent, hoverEventValue);\n } else {\n result.addHoverEvent(hoverEvent, hoverEventValue);\n }\n }\n\n return result.get();\n\n } else {\n return \"\";\n }\n }", "public String jsonify() {\n return gson.toJson(this);\n }", "@Override\r\n\tpublic String toJsonString() {\n\t\treturn null;\r\n\t}", "public static Example stringToJSON(String s){\n Gson gson = new Gson();\n JsonReader reader = new JsonReader(new StringReader(s));\n reader.setLenient(true);\n\n Example ex = gson.fromJson(reader, Example.class);\n\n return ex;\n }", "public static String getJsonString(Object o) {\n\n\t\ttry {\n\t\t\tObjectMapper om = new ObjectMapper();\n\t\t\treturn om.writeValueAsString(o);\n\t\t} catch (JsonProcessingException e) {\n\t\t\treturn \"\";\n\t\t}\n\t}", "private void serializeString(final String string, final StringBuffer buffer)\n {\n String decoded = Unserializer.decode(string, charset);\n\n buffer.append(\"s:\");\n buffer.append(decoded.length());\n buffer.append(\":\\\"\");\n buffer.append(string);\n buffer.append(\"\\\";\");\n }", "public Builder setJson(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n json_ = value;\n onChanged();\n return this;\n }", "public Builder setJson(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n json_ = value;\n onChanged();\n return this;\n }", "public Builder setJson(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n json_ = value;\n onChanged();\n return this;\n }", "@Override\n\tpublic String toString() {\n\t\t\n\t\treturn \"{\\\"a\\\":\"+a+\", \\\"B\\\":\\\"\"+B+\"\\\"}\";\n\t}", "JsonObject raw();", "@Override\r\n\tprotected ActualizarClienteResponse responseText(String json) {\n\t\tActualizarClienteResponse actualizarClienteResponse = JSONHelper.desSerializar(json, ActualizarClienteResponse.class);\r\n\t\treturn actualizarClienteResponse;\r\n\t}", "public String loadJSONFromAsset() {\n String json = null;\n try {\n json = new String(buffer, \"UTF-8\");\n } catch (UnsupportedEncodingException e1) {\n e1.printStackTrace();\n }\n\n return json;\n }", "public static JsonElement stringToJSON2(String json) {\n try {\n JsonElement parser = new JsonPrimitive(json);\n System.out.println(parser.getAsString());\n //JsonObject Jso = new JsonObject();\n //Jso = (JsonObject) parser.p(json);\n return parser;\n } catch (Exception e) {\n return new JsonObject();\n }\n }", "public EditAPISourceResponse editAPISource(String jsonString) throws ImporterException {\n\n HttpHeaders requestHeaders = new HttpHeaders();\n requestHeaders.setContentType(MediaType.APPLICATION_JSON);\n\n ObjectMapper mapper = new ObjectMapper();\n mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, false); //root name of class, same root value of json\n mapper.configure(SerializationFeature.EAGER_SERIALIZER_FETCH, true);\n\n HttpEntity<String> request;\n request = new HttpEntity<>(jsonString ,requestHeaders);\n //String jsonResponse = restTemplate.postForObject(\"http://Import-Service/Import/updateAPI\", request, String.class);\n\n ResponseEntity<?> importResponse = null;\n //importResponse = restTemplate.exchange(\"http://Import-Service/Import/updateAPI\",HttpMethod.POST,request,new ParameterizedTypeReference<ServiceErrorResponse>() {});\n\n if(importResponse != null && importResponse.getBody().getClass() == ServiceErrorResponse.class) {\n ServiceErrorResponse serviceErrorResponse = (ServiceErrorResponse) importResponse.getBody();\n if(serviceErrorResponse.getErrors() != null) {\n String errors = serviceErrorResponse.getErrors().get(0);\n for(int i=1; i < serviceErrorResponse.getErrors().size(); i++){\n errors = \"; \" + errors;\n }\n\n throw new ImporterException(errors);\n }\n }\n\n importResponse = restTemplate.exchange(\"http://Import-Service/Import/updateAPI\",HttpMethod.POST,request,new ParameterizedTypeReference<EditAPISourceResponse>() {});\n return (EditAPISourceResponse) importResponse.getBody();\n }", "public JSONObject updateContext(String results)\r\n {\r\n return new JSONObject(results);\r\n }", "@Test(timeout = 4000)\n public void test002() throws Throwable {\n String string0 = JSONObject.quote(\",\\n\");\n assertEquals(\"\\\",\\\\n\\\"\", string0);\n \n HashMap<Integer, String> hashMap0 = new HashMap<Integer, String>();\n JSONObject jSONObject0 = new JSONObject((Map) hashMap0);\n Integer integer0 = new Integer(2526);\n hashMap0.replace(integer0, \"\\\",\\n\\\"\", \"\\\",\\n\\\"\");\n String string1 = jSONObject0.toString(545, 1230);\n assertEquals(\"{}\", string1);\n }", "public String getAsJson() {\n StringBuffer sb = new StringBuffer();\n sb.append(\"{\\\"code\\\": \\\"\").append(this.code).append(\"\\\", \");\n sb.append(\"\\\"color\\\": \\\"\").append(this.color).append(\"\\\", \");\n\n /* Append a size only if the product has a Size */\n if (this.size.getClass() != NoSize.class) {\n sb.append(\"\\\"size\\\": \\\"\").append(this.size).append(\"\\\", \");\n }\n\n sb.append(\"\\\"price\\\": \").append(this.price).append(\", \");\n sb.append(\"\\\"currency\\\": \\\"\").append(this.currency).append(\"\\\"}, \");\n\n return sb.toString();\n }", "@Override\n public String toJson() {\n return \"{'content':'\" + this.content + \"'}\";\n }", "public String toJSON(){\n Gson gson = new Gson();\n return gson.toJson(this);\n }" ]
[ "0.6695776", "0.66910285", "0.66691226", "0.6632751", "0.6570232", "0.6568631", "0.65050495", "0.62978846", "0.62885827", "0.62669253", "0.61927223", "0.61823094", "0.6175886", "0.61497515", "0.60998905", "0.6062921", "0.60132897", "0.59764385", "0.59764385", "0.59764385", "0.5949817", "0.59187955", "0.58946204", "0.5888868", "0.5886042", "0.58847874", "0.5882201", "0.5882201", "0.5882201", "0.58628964", "0.5846369", "0.58457947", "0.58208025", "0.58208025", "0.58208025", "0.58191353", "0.5799672", "0.57927954", "0.57844365", "0.5783043", "0.57617885", "0.5738534", "0.5726942", "0.5721698", "0.57195145", "0.5686972", "0.5663364", "0.5652828", "0.5614585", "0.5613618", "0.56054026", "0.5602504", "0.55824614", "0.5574879", "0.5574391", "0.5564916", "0.5552741", "0.5541064", "0.5536436", "0.5528331", "0.5523491", "0.5520019", "0.5511264", "0.5510803", "0.5500493", "0.54991204", "0.54838246", "0.547701", "0.54609096", "0.5442361", "0.54386413", "0.54381824", "0.54283667", "0.54219556", "0.5419699", "0.54041356", "0.5403815", "0.5401531", "0.53985316", "0.5389875", "0.5381965", "0.5379741", "0.5378267", "0.5372956", "0.53558433", "0.5350313", "0.53399485", "0.5321144", "0.5321144", "0.5321144", "0.53179777", "0.5315232", "0.53083235", "0.5298948", "0.5291401", "0.52738136", "0.5273151", "0.5266361", "0.52628756", "0.5258878", "0.52587384" ]
0.0
-1
SQLite connection string String url = "jdbc:sqlite:C://sqlite/db/tests.db"; SQL statement for creating a new table
public static void createNewTable(String fileName) { connect(fileName); String sqlUrl = "CREATE TABLE IF NOT EXISTS urls (\n" + " id integer PRIMARY KEY AUTOINCREMENT,\n" + " url text NOT NULL\n" + ");"; String sqlDesc = "CREATE TABLE IF NOT EXISTS descriptions (\n" + " id integer,\n" + " shifts text NOT NULL\n" + ");"; try (Statement stmt = conn.createStatement()) { // create a new table stmt.execute(sqlUrl); stmt.execute(sqlDesc); } catch (SQLException e) { System.out.println(e.getMessage()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void createDB(){\r\n\t\t\r\n\t\t Connection connection = null;\r\n\t try\r\n\t {\r\n\t // create a database connection\r\n\t connection = DriverManager.getConnection(\"jdbc:sqlite:project.sqlite\");\r\n\t Statement statement = connection.createStatement();\r\n\t statement.setQueryTimeout(30); // set timeout to 30 sec.\r\n\r\n\t statement.executeUpdate(\"drop table if exists task\");\r\n\t statement.executeUpdate(\"create table task (taskId integer primary key asc, description string, status string, createDate datetime default current_timestamp)\");\r\n\t statement.executeUpdate(\"insert into task values(1, 'leo', 'Active', null)\");\r\n\t statement.executeUpdate(\"insert into task values(2, 'yui', 'Complete', null)\");\r\n\t }\r\n\t catch(SQLException ex){\r\n\t \tthrow new RuntimeException(ex);\r\n\t }\r\n\t\t\r\n\t}", "public void createDB() {\n String url = \"jdbc:sqlite:stats.db\";\n Statement stmt = null;\n try (Connection conn = DriverManager.getConnection(url)) {\n stmt = conn.createStatement();\n String query = \"CREATE TABLE IF NOT EXISTS games \"\n + \"(ownships int, \"\n + \"ownremaining int, \"\n + \"aiships int,\"\n + \"airemaining int, \"\n + \"turns int)\";\n\n stmt.executeUpdate(query);\n\n } catch (SQLException ex) {\n System.out.println(ex.getMessage());\n }\n }", "private void testSQLite() {\n\t\tConnection conn=null;\n\t\ttry {\n\t\t\tClass.forName(\"org.sqlite.JDBC\");\n\n\t\t\tconn = DriverManager.getConnection(DATABASE_CONNECTION);\n\t\t\t// 建立事务机制,禁止自动提交,设置回滚点\n\t\t\tconn.setAutoCommit(false);\n\n\t\t\tStatement stat = conn.createStatement();\n\t\t\t// User{weibo=null, id=2438418282, name='心情慵懒',\n\t\t\t// screenName='心情慵懒', location='甘肃 陇南', description='',\n\t\t\t// profileImageUrl='http://tp3.sinaimg.cn/2438418282/50/5612515360/1',\n\t\t\t// province='62', city='26', domain ='', gender ='m',\n\t\t\t// url='',\n\t\t\t// allowAllActMsg=false,\n\t\t\t// followersCount=1,\n\t\t\t// friendsCount=40, createdAt=Sun Oct 02 00:00:00 CST 2011,\n\t\t\t// favouritesCount=0, following=false, statusesCount=0,\n\t\t\t// geoEnabled=false,\n\t\t\t// voiderified=false,\n\t\t\t// status=null}\n\n\t\t\tstat.executeUpdate(\"create table userInfo (\"\n\t\t\t\t\t+ \"id PRIMARY KEY NOT NULL,\"// 用户UID\",主键\n\t\t\t\t\t+ \"screenName,\"// 微博昵称\n\t\t\t\t\t+ \"name,\"// 友好显示名称,同微博昵称\n\t\t\t\t\t+ \"province,\"// 省份编码(参考省份编码表)\n\t\t\t\t\t+ \"city,\"// 城市编码(参考城市编码表)\n\t\t\t\t\t+ \"location,\"// 地址\n\t\t\t\t\t+ \"description,\"// 个人描述\n\t\t\t\t\t+ \"url,\"// 用户博客地址\n\t\t\t\t\t+ \"profileImageUrl,\"// 自定义图像\n\t\t\t\t\t+ \"domain,\"// 用户个性化URL\n\t\t\t\t\t+ \"gender,\"// 性别,m--男,f--女,n--未知\n\t\t\t\t\t+ \"followersCount,\"// 粉丝数\n\t\t\t\t\t+ \"friendsCount,\"// 关注数\n\t\t\t\t\t+ \"statusesCount,\"// 微博数\n\t\t\t\t\t+ \"favouritesCount,\"// 收藏数\n\t\t\t\t\t+ \"createdAt,\"// 创建时间\n\t\t\t\t\t+ \"following,\"// 是否已关注(此特性暂不支持)\n\t\t\t\t\t+ \"verified,\"// 加V标示,是否微博认证用户\n\t\t\t\t\t+ \"status,\"// 状态,由取回的字符中提取,意义不明\n\t\t\t\t\t+ \"geoEnabled,\"// 地理状态信息\n\t\t\t\t\t+ \"allowAllActMsg,\"// 由取回的字符中提取,意义不明\n\t\t\t\t\t+ \"weibo,\"// 由取回的字符中提取,意义不明\n\t\t\t\t\t+ \"access_token,\"// 访问Token\n\t\t\t\t\t+ \"access_secret)\");// 访问密钥\n\n\t\t\t// [createdAt=Sat Oct 01 23:51:54 CST 2011,\n\t\t\t// id=3363835379243442, text=养生之道,首在养气。,\n\t\t\t// source=<a href=\"http://mail.sina.com.cn\"\n\t\t\t// rel=\"nofollow\">新浪免费邮箱</a>,\n\t\t\t// isTruncated=false, inReplyToStatusId=-1, inReplyToUserId=-1,\n\t\t\t// isFavorited=false, inReplyToScreenName=,\n\t\t\t// latitude=-1.0,\n\t\t\t// longitude=-1.0,\n\t\t\t// thumbnail_pic=, bmiddle_pic=,\n\t\t\t// original_pic=,\n\t\t\t// mid=3363835379243442,\n\t\t\t// user=null,\n\t\t\t// retweeted_status=null]}\n\n\t\t\tstat.executeUpdate(\"create table statusInfo (\" + \"created_at,\"// 创建时间\n\t\t\t\t\t+ \"id PRIMARY KEY NOT NULL,\"// 微博ID,主键\n\t\t\t\t\t+ \"text,\"// 微博信息内容\n\t\t\t\t\t+ \"source,\"// 微博来源\n\t\t\t\t\t+ \"favorited,\"// 是否已收藏\n\t\t\t\t\t+ \"truncated,\"// 是否被截断\n\t\t\t\t\t+ \"in_reply_to_status_id,\"// 回复ID\n\t\t\t\t\t+ \"in_reply_to_user_id,\"// 回复人UID\n\t\t\t\t\t+ \"in_reply_to_screen_name,\"// 回复人昵称\n\t\t\t\t\t+ \"thumbnail_pic,\"// 缩略图\n\t\t\t\t\t+ \"bmiddle_pic,\"// 中型图片\n\t\t\t\t\t+ \"original_pic,\"// 原始图片\n\t\t\t\t\t+ \"user,\"// 作者信息\n\t\t\t\t\t+ \"retweeted_status)\");// 转发的博文,内容为status,如果不是转发,则没有此字段\n\t\t\tconn.commit();\n\t\t\tconn.close();\n\t\t} catch (ClassNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\"create table error\");\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tconn.close();\n\t\t\t} catch (SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public void createNewDataBase() {\n try (Connection conn = DriverManager.getConnection(url)) {\n if (conn != null) {\n DatabaseMetaData meta = conn.getMetaData();\n createNewTable();\n }\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }", "private void setupDb(){\n try {\n openConnection();\n s.executeUpdate(\"CREATE TABLE IF NOT EXISTS LIB (NAME text UNIQUE , TYPE text, LANGUAGE text, INTRUSIVE text, OPENSOURCE text)\");\n }catch (SQLException e) {\n System.err.println(e.getMessage());\n }finally {\n if (c != null){\n close(c);\n }\n }\n }", "public void createNewTable(){\n Connection conn = null;\n Statement stmt = null;\n try{\n //STEP 2: Register JDBC driver\n System.out.println(\"Registered JDBC driver...\");\n Class.forName(\"com.mysql.jdbc.Driver\");\n\n //STEP 3: Open a connection\n System.out.println(\"Connecting to database...\");\n conn = DriverManager.getConnection(DB_URL);//acceses the database specified by the url through entering in the username and password\n System.out.println(\"Creating statement...\");\n stmt = conn.createStatement(); //access the database server and manipulate data in database\n String sql = \"CREATE TABLE EXPERIENCE_\"+gameNumber+\n \" (Id INT PRIMARY KEY AUTO_INCREMENT,\"+\n \"player VARCHAR(255), \" +\n \" bigsquare INTEGER, \" + \n \" smallsquare INTEGER)\";\n System.out.println(\"SUCCCESSS!\"+gameNumber+ \" yayyyY!\");\n stmt.executeUpdate(sql);\n System.out.println(\"sweeeeeeeeeet....\");\n stmt.close();\n conn.close(); \n }catch(SQLException se){\n //Handle errors for JDBC\n se.printStackTrace();\n }catch(Exception e){\n //Handle errors for Class.forName\n e.printStackTrace();\n }finally{\n //finally block used to close resources\n try{\n if(stmt!=null)\n stmt.close();\n }catch(SQLException se2){\n }// nothing we can do\n try{\n if(conn!=null)\n conn.close();\n }catch(SQLException se){\n se.printStackTrace();\n }//end finally try\n }//end try\n \n \n }", "private void createDB() {\n try {\n Statement stat = conn.createStatement();\n stat.execute(\"CREATE TABLE settings (name TEXT, state);\");\n stat.execute(\"CREATE TABLE expressions (id INTEGER PRIMARY KEY ASC AUTOINCREMENT, expression TEXT);\");\n stat.execute(\"CREATE TABLE summaries (id INTEGER PRIMARY KEY ASC, expression_id INTEGER, title TEXT, abstract TEXT);\");\n stat.execute(\"CREATE TABLE history (id INTEGER PRIMARY KEY ASC AUTOINCREMENT, expression TEXT);\");\n } catch (SQLException e) {\n System.err.println(e.getClass().getName() + \": \" + e.getMessage());\n System.exit(0);\n }\n }", "public static void main(String[] args) {\n\t\t Connection c = null;\n\t\t Statement stmt = null;\n\t\t try {\n\t\t Class.forName(\"org.sqlite.JDBC\");\n\t\t c = DriverManager.getConnection(\"jdbc:sqlite:test.db\");\n\t\t \n\t\t stmt = c.createStatement();\n\t\t String sql = \"CREATE TABLE IF NOT EXISTS PEOPLE \" +\n\t\t \"(ID \t\t\tINT ,\" +\n\t\t \" NAME TEXT, \" + \n\t\t \" SURENAME TEXT, \" + \n\t\t \" BIRTHDATE TEXT, \" + \n\t\t \" DEATHDATE TEXT, \" + \n\t\t \" SEX TEXT)\"; \n\t\t stmt.executeUpdate(sql);\n\t\t \n\t\t /*sql = \"INSERT INTO PEOPLE (ID,NAME,SURENAME,BIRTHDATE,DEATHDATE,SEX) \" +\n\t \"VALUES (1, 'Kamil', 'Wyrzykowski', '19820515','' ,'M' );\"; \n\t\t stmt.executeUpdate(sql);\n\t\t \n\t\t sql = \"INSERT INTO PEOPLE (ID,NAME,SURENAME,BIRTHDATE,DEATHDATE,SEX) \" +\n\t \"VALUES (1, 'Pawel', 'zRembertowa', '19890328','' ,'M' );\"; \n\t\t stmt.executeUpdate(sql);\n\t\t \n\t\t sql = \"INSERT INTO PEOPLE (ID,NAME,SURENAME,BIRTHDATE,DEATHDATE,SEX) \" +\n\t \"VALUES (1, 'Michal', 'JamCiTo', '19860922','' ,'M' );\"; \n\t\t stmt.executeUpdate(sql);\n\t\t */\n\t\t stmt.close();\n\t\t c.close();\n\t\t \n\t\t } catch ( Exception e ) {\n\t\t System.err.println( e.getClass().getName() + \": \" + e.getMessage() );\n\t\t System.exit(0);\n\t\t }\n\t\t System.out.println(\"Opened database successfully\");\n\t}", "public void createDB(String filename) throws SQLException {\n //System.out.printf(\"Connecting to the database %s.%n\", filename);\n /* \n * Connect to the database (file). If the file does not exist, create it.\n */\n Connection db_connection = DriverManager.getConnection(SQLITEDBPATH + filename);\n this.createTables(db_connection);\n this.initTableCities(db_connection);\n this.initTableTeams(db_connection);\n //System.out.printf(\"Connection to the database has been established.%n\");\n db_connection.close();\n //System.out.printf(\"Connection to the database has been closed.%n\");\n }", "public String createTable(){\r\n return \"CREATE TABLE Doctor \" +\r\n \"(idDoctor decimal primary key, \" +\r\n \"firstNameDoctor char(14), \" +\r\n \"lastNameDoctor char(14), \" +\r\n \"costPerVisit integer,\" +\r\n \"qualification varchar(32))\";\r\n }", "public static void createNewDatabase(String fileName) {\n\n String url = \"jdbc:sqlite:C:/sqlite/db/\" + fileName;\n\n try (Connection conn = DriverManager.getConnection(url)) {\n if (conn != null) {\n DatabaseMetaData meta = conn.getMetaData();\n System.out.println(\"The driver name is \" + meta.getDriverName());\n System.out.println(\"A new database has been created.\");\n }\n\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }", "public void setupDB()\r\n\t{\n\tjdbcTemplateObject.execute(\"DROP TABLE IF EXISTS employee1 \");\r\n\r\n\tjdbcTemplateObject.\r\n\texecute(\"CREATE TABLE employee1\"\r\n\t+ \"(\" + \"name VARCHAR(255), id SERIAL)\");\r\n\t}", "public static void createNewTable(int i) {\n // SQLite connection string\n// String url = \"jdbc:sqlite:C://sqlite/db/file\" + i +\".db\";\n String url = \"jdbc:sqlite:F:\\\\splitespace\\\\fileinfo\" + i + \".db\";\n // SQL statement for creating a new table\n String sql = \"CREATE TABLE IF NOT EXISTS FileInfo (\\n\"\n + \"\tid integer PRIMARY KEY,\\n\"\n + \"\tpath VARCHAR(255) NOT NULL,\\n\"\n + \"\tscantime BIGINT\\n\"\n + \");\";\n\n String sql2 = \"CREATE TABLE IF NOT EXISTS FileInfo (\\n\"\n + \"\tid integer PRIMARY KEY,\\n\"\n + \"\tpid integer,\\n\"\n + \"\tpath VARCHAR(255) NOT NULL,\\n\"\n + \" isParent VARCHAR(11),\\n\"\n + \" abpath VARCHAR(255),\\n\"\n + \" abppath VARCHAR(255)\\n\"\n + \");\";\n\n try (Connection conn = DriverManager.getConnection(url);\n Statement stmt = conn.createStatement()) {\n // create a new table\n stmt.execute(sql2);\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }", "private void createTable() throws Exception{\n Statement stm = this.con.createStatement();\n\n String query = \"CREATE TABLE IF NOT EXISTS \" + tableName +\n \"(name VARCHAR( 15 ) CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL ,\" +\n \" city VARCHAR( 15 ) CHARACTER SET utf8 COLLATE utf8_persian_ci NOT NULL ,\" +\n \" phone VARCHAR( 15 ) NOT NULL, \" +\n \"PRIMARY KEY (phone) )\";\n stm.execute(query);\n }", "private void createDatabase() throws SQLException\r\n {\r\n myStmt.executeUpdate(\"create database \" + dbname);\r\n }", "public void createNewTable() {\n // SQL statement for creating a new table\n String sql = \"CREATE TABLE IF NOT EXISTS card (\\n\"\n + \" id INTEGER PRIMARY KEY AUTOINCREMENT,\\n\"\n + \" number TEXT,\\n\"\n + \" pin TEXT,\\n\"\n + \" balance INTEGER DEFAULT 0\\n\"\n + \");\";\n\n try (Connection conn = DriverManager.getConnection(url);\n Statement stmt = conn.createStatement()) {\n // create a new table\n stmt.execute(sql);\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }", "public void createTable() {\n\t\tString QUERY = \"CREATE TABLE person (id INT PRIMARY KEY, name VARCHAR(32) NOT NULL, phoneNumber VARCHAR(18) NOT NULL)\";\n\t\ttry (Connection con = DriverManager.getConnection(URL, USER, PASSWORD);\n\t\t\t\tStatement stmt = con.createStatement();) {\n\t\t\tstmt.executeUpdate(QUERY);\n\t\t} catch (SQLException e) {\n\t\t\tSystem.err.println(\"SQL Exception\");\n\t\t}\n\n\t}", "public 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 void initDb() {\n String createVac = \"create table if not exists vacancies(id serial primary key,\"\n + \"name varchar(1500) NOT NULL UNIQUE, url varchar (1500), description text, dateVac timestamp);\";\n try (Statement st = connection.createStatement()) {\n st.execute(createVac);\n } catch (SQLException e) {\n LOG.error(e.getMessage());\n }\n }", "DatabaseTable_DataSource(SQLiteDatabase db) {\n createIfNotExists(db);\n }", "@Override\n public void setUp() throws SQLException {\n connection.createStatement().executeUpdate(\n \"CREATE TABLE IF NOT EXISTS \\\"ENTRY\\\" (\" +\n \"\\\"SHARED_ID\\\" SERIAL PRIMARY KEY, \" +\n \"\\\"TYPE\\\" VARCHAR, \" +\n \"\\\"VERSION\\\" INTEGER DEFAULT 1)\");\n\n connection.createStatement().executeUpdate(\n \"CREATE TABLE IF NOT EXISTS \\\"FIELD\\\" (\" +\n \"\\\"ENTRY_SHARED_ID\\\" INTEGER REFERENCES \\\"ENTRY\\\"(\\\"SHARED_ID\\\") ON DELETE CASCADE, \" +\n \"\\\"NAME\\\" VARCHAR, \" +\n \"\\\"VALUE\\\" TEXT)\");\n\n connection.createStatement().executeUpdate(\n \"CREATE TABLE IF NOT EXISTS \\\"METADATA\\\" (\"\n + \"\\\"KEY\\\" VARCHAR,\"\n + \"\\\"VALUE\\\" TEXT)\");\n }", "private void CreatTable() {\n String sql = \"CREATE TABLE IF NOT EXISTS \" + TABLE_NAME\n + \" (name varchar(30) primary key,password varchar(30));\";\n try{\n db.execSQL(sql);\n }catch(SQLException ex){}\n }", "public static Connection connectToDB(){\n Connection c = null;\n try {\n Class.forName(\"org.sqlite.JDBC\");\n c = DriverManager.getConnection(\"jdbc:sqlite:C:\\\\Users\\\\abbas\\\\Documents\\\\NetBeansProjects\\\\Plookify\\\\build\\\\classes\\\\Abbas\\\\plookifyDB.sqlite\");\n c.setAutoCommit(false);\n System.out.println(\"Opened database successfully\");\n } catch ( Exception e ) {\n System.err.println( e.getClass().getName() + \": \" + e.getMessage() );\n }\n //System.out.println(\"Opened database successfully\");\n return c;\n }", "private SQLite sqLiteConnect(DatabaseConfig config){\n SQLite result;\n String filePath = String.format(\"database\\\\%s.db\", config.getSqlName());\n result = new SQLite(filePath);\n\n if(result.connect())\n ItemBox.getLogger().info(\"[Database] connect successful \" + filePath);\n\n else{\n ItemBox.getLogger().severe(\"[Database] connect fail \" + filePath);\n return null;\n }\n\n SQLiteTable sqLiteTable = convertToSQLiteTable(config);\n SQLite.Status sqLiteResult = result.createTable(sqLiteTable);\n\n if(sqLiteResult == SQLite.Status.SUCCESS){\n ItemBox.getLogger().info(String.format(\"[Database] add table \\\"%s\\\" to %s\", config.getTableName(), filePath));\n }else{\n ItemBox.getLogger().info(String.format(\"[Database] found table \\\"%s\\\" from %s\", config.getTableName(), filePath));\n }\n\n ItemBox.getLogger().info(String.format(\"[Database] sql \\\"%s\\\" connected\", config.getSqlName()));\n return result;\n }", "@Override\r\n public void createTable() {\n String sql = \"create table \" + TABLE_NAME + \"(\";\r\n sql += ID + \" INTEGER primary key,\";\r\n sql += NAME + \" VARCHAR(50),\";\r\n sql += LON + \" FLOAT(10,6),\";\r\n sql += LAT + \" FLOAT(10,6)\";\r\n sql += \")\";\r\n database.execSQL(sql);\r\n }", "public void test() throws SQLException{\n /*try {\n Class.forName(\"org.sqlite.JDBC\");\n //DriverManager.registerDriver(new org.sqlite.JDBC());\n\n String dbURL=\"JDBC:sqlite://data/data/com.example.boris.myandroidapp/databases/myapp\";\n Connection conn=DriverManager.getConnection(dbURL);\n if(conn!=null){\n System.out.println(\"Connected to the database\");\n DatabaseMetaData dm=(DatabaseMetaData)conn.getMetaData();\n System.out.println(\"Driver name: \"+dm.getDriverName());\n System.out.println(\"Driver version: \"+dm.getDriverVersion());\n System.out.println(\"Product name: \"+dm.getDatabaseProductName());\n System.out.println(\"Product version: \"+dm.getDatabaseProductVersion());\n conn.close();\n }\n }\n catch (ClassNotFoundException e) {\n e.printStackTrace();}\n catch(SQLException ex){\n ex.printStackTrace();\n }*/\n\n }", "public void createNewTable() {\n String dropOld = \"DROP TABLE IF EXISTS card;\";\n\n // SQL statement for creating a new table\n String sql = \"CREATE TABLE IF NOT EXISTS card (\\n\"\n + \"id INTEGER PRIMARY KEY AUTOINCREMENT, \\n\"\n + \"number TEXT, \\n\"\n + \"pin TEXT,\\n\"\n + \"balance INTEGER DEFAULT 0\"\n + \");\";\n\n try (Connection connection = connect();\n Statement stmt = connection.createStatement()) {\n\n //drop old table\n stmt.execute(dropOld);\n\n //create a new table\n stmt.execute(sql);\n } catch (SQLException e) {\n System.out.println(\"Exception3: \" + e.getMessage());\n }\n }", "public static void createEmployees() {\n Connection con = getConnection();\n\n String createString;\n createString = \"create table Employees (\" +\n \"Employee_ID INTEGER, \" +\n \"Name VARCHAR(30))\";\n try {\n stmt = con.createStatement();\n stmt.executeUpdate(createString);\n stmt.close();\n con.close();\n\n } catch (SQLException ex) {\n System.err.println(\"SQLException: \" + ex.getMessage());\n }\n JOptionPane.showMessageDialog(null, \"Employees Table Created\");\n }", "public static void main(String[] args) throws SQLException, ClassNotFoundException {\r\n\t\t\r\n\t\tClass.forName(\"org.sqlite.JDBC\");\r\n\t\tString url = \"jdbc:sqlite:D://SampleDatabase.db\";\r\n\t\tConnection conn = DriverManager.getConnection(url);\r\n\t\tSystem.out.println(\"Connection Established Successfully\");\r\n\t\t\r\n\t\t// Select record from a table\r\n\t\tString sql = \"SELECT * FROM AddNewPayee\";\r\n\t\tStatement stmt = conn.createStatement();\r\n\t ResultSet rs = stmt.executeQuery(sql);\r\n\t // by column name\r\n\t while (rs.next()) {\r\n System.out.println(rs.getString(\"name\")+\" \"+rs.getString(\"address\")+\" \"+rs.getString(\"account\")+\" \"+rs.getString(\"details\"));\r\n\t }\r\n\t \r\n\t // by column index\r\n\t ResultSetMetaData rsmd = rs.getMetaData();\r\n\t System.out.println(rsmd.getColumnCount());\r\n\t while(rs.next())\r\n\t {\r\n\t \tfor(int i=1;i<=rsmd.getColumnCount();i++)\r\n\t \t{\r\n\t \t\tSystem.out.print(rs.getString(i));\r\n\t \t}\r\n\t }\r\n\t \r\n\t // Insert a new record\r\n\t sql = \"INSERT INTO AddNewPayee (name,address,account,details) VALUES('somi','krishnagiri','7516546365','Friend')\";\r\n\t stmt.executeUpdate(sql);\r\n\t \r\n\t // Update a existing record\r\n\t sql = \"UPDATE AddNewPayee SET address='Delhi' where name='somi'\";\r\n\t stmt.executeUpdate(sql);\r\n\t \r\n\t // Delete a record\r\n\t sql = \"DELETE From AddNewPayee Where name='prem'\";\r\n\t stmt.executeUpdate(sql);\r\n\t \r\n\t}", "private void initDatabase() {\n\n String sql = \"CREATE TABLE IF NOT EXISTS books (\\n\"\n + \"\tISBN integer PRIMARY KEY,\\n\"\n + \"\tBookName text NOT NULL,\\n\"\n + \" AuthorName text NOT NULL, \\n\"\n + \"\tPrice integer\\n\"\n + \");\";\n\n try (Connection conn = DriverManager.getConnection(urlPath);\n Statement stmt = conn.createStatement()) {\n System.out.println(\"Database connected\");\n stmt.execute(sql);\n\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }", "@Override\n\tpublic void onCreate(SQLiteDatabase db, ConnectionSource source) {\n\n\t\ttry {\n\t\t\tTableUtils.createTable(source, Priority.class);\n\t\t\tTableUtils.createTable(source, Category.class);\n\t\t\tTableUtils.createTable(source, Task.class);\n\t\t} catch (SQLException ex) {\n\t\t\tLog.e(LOG, \"error creating tables\", ex);\n\t\t}\n\n\t}", "public static String AssetRef_CreateTable()\n\t{\n\t\tString str = \"create table assetref (\" \n\t\t\t\t+ \"id INTEGER PRIMARY KEY,\"\n\t\t\t\t+ \"uniqueId string,\"\n\t\t\t\t+ \"path string,\"\n\t\t\t\t+ \"name string,\"\n\t\t\t\t+ \"size int,\"\n\t\t\t\t+ \"lastChanged time\"\n\t\t\t\t+ \")\";\n\t\treturn str;\t\n\t}", "Database createDatabase();", "public void testCreateTable3() throws Exception {\n Properties props = new Properties();\n props.setProperty(LockssRepositoryImpl.PARAM_CACHE_LOCATION, tempDirPath);\n props\n\t.setProperty(ConfigManager.PARAM_PLATFORM_DISK_SPACE_LIST, tempDirPath);\n props.setProperty(SqlDbManager.PARAM_DATASOURCE_CLASSNAME,\n\t\t \"org.apache.derby.jdbc.ClientDataSource\");\n ConfigurationUtil.setCurrentConfigFromProps(props);\n\n createTable();\n }", "private Connection createConnection() {\r\n\tConnection result = null;\r\n\r\n\ttry {\r\n\t Class.forName(\"org.sqlite.JDBC\");\r\n\t result = DriverManager.getConnection(\"jdbc:sqlite:\" + fileName);\r\n\t} catch (Exception e) {\r\n\t result = null;\r\n\t}\r\n\r\n\treturn result;\r\n }", "public void create(Connection db) throws SQLException {\n if (tableName == null) {\n throw new SQLException(\"Table Name not specified\");\n }\n\n Statement st = db.createStatement();\n\n if (dbType == DatabaseUtils.POSTGRESQL) {\n if (hasSequence()) {\n st.executeUpdate(\"CREATE SEQUENCE \" + sequenceName);\n }\n }\n\n StringBuffer sql = new StringBuffer();\n sql.append(\"CREATE TABLE \" + tableName + \" (\");\n\n String primaryKey = \"\";\n Iterator fields = columns.iterator();\n while (fields.hasNext()) {\n DatabaseColumn thisColumn = (DatabaseColumn) fields.next();\n if (thisColumn.isPrimaryKey()) {\n primaryKey = thisColumn.getName();\n sql.append(thisColumn.getCreateSQL(dbType, sequenceName));\n } else {\n sql.append(thisColumn.getCreateSQL(dbType));\n }\n if (fields.hasNext()) {\n sql.append(\",\");\n }\n }\n if (dbType == DatabaseUtils.ORACLE) {\n sql.append(\", PRIMARY KEY (\" + primaryKey + \")\");\n }\n sql.append(\");\");\n st.executeUpdate(sql.toString());\n st.close();\n }", "@Override\n\tpublic void onCreate(SQLiteDatabase db, ConnectionSource connectionSource) {\n\t\ttry {\n\t\t\tLog.i(DatabaseHelper.class.getName(), \"onCreate\");\n\t\t\tTableUtils.createTable(connectionSource, Place.class);\n\t\t\tTableUtils.createTable(connectionSource, Lock.class);\n\t\t\tTableUtils.createTable(connectionSource, User.class);\n\t\t\tTableUtils.createTable(connectionSource, Locator.class);\n\t\t} catch (SQLException e) {\n\t\t\tLog.e(DatabaseHelper.class.getName(), \"Can't create database\", e);\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t}", "public void createDB() {\n\t\ttry {\n\t\t\tBufferedReader br= new BufferedReader(new FileReader(\"db_schema.txt\"));\n\t\t\tString line= null;\n\t\t\tStringBuilder sb= new StringBuilder();\n\t\t\twhile ((line=br.readLine())!=null){\n\t\t\t\tsb.append(line);\n\t\t\t\tif(sb.length()>0 && sb.charAt(sb.length()-1)==';'){//see if it is the end of one line of command\n\t\t\t\t\tstatement.executeUpdate(sb.toString());\n\t\t\t\t\tsb= new StringBuilder();\n\t\t\t\t}\n\t\t\t}\n\t\t\tbr.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void createTable() {\n try (Statement st = this.conn.createStatement()) {\n st.execute(\"CREATE TABLE IF NOT EXISTS users (user_id SERIAL PRIMARY KEY, name VARCHAR(100) NOT NULL, \"\n + \"login VARCHAR(100) UNIQUE NOT NULL, email VARCHAR(100) NOT NULL, createDate TIMESTAMP NOT NULL);\");\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "@Override\n\tpublic void onCreate(SQLiteDatabase db, ConnectionSource connectionSource) {\n\t\tthis.connectionSource = connectionSource;\n\t\tcreateTable();\n\t}", "public void createTables()\n {\n String[] sqlStrings = createTablesStatementStrings();\n String sqlString;\n Statement statement;\n\n System.out.println(\"Creating table(s):\" +\n Arrays.toString(tableNames));\n for (int i=0; i<sqlStrings.length; i++)\n try\n {\n statement = connect.createStatement();\n\n sqlString = sqlStrings[i];\n\n System.out.println(\"SQL: \" + sqlString);\n\n statement.executeUpdate(sqlString);\n }\n catch (SQLException ex)\n {\n System.out.println(\"Error creating table: \" + ex);\n Logger.getLogger(DatabaseManagementDAO.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "protected void createTable() throws Exception {\n startService();\n assertEquals(true, sqlDbManager.isReady());\n\n Connection conn = sqlDbManager.getConnection();\n assertNotNull(conn);\n assertFalse(sqlDbManager.tableExists(conn, \"testtable\"));\n assertTrue(sqlDbManager.createTableIfMissing(conn, \"testtable\",\n\t\t\t\t\t TABLE_CREATE_SQL));\n assertTrue(sqlDbManager.tableExists(conn, \"testtable\"));\n sqlDbManager.logTableSchema(conn, \"testtable\");\n assertFalse(sqlDbManager.createTableIfMissing(conn, \"testtable\",\n\t\t\t\t\t TABLE_CREATE_SQL));\n }", "public static void createTable(SQLiteDatabase db, Class<?> clz) {\n// StringBuilder builder=new StringBuilder();\n// Field[] fields=clz.getDeclaredFields();\n// for (int i=0;i<fields.length;i++){\n// Field field=fields[i];\n// builder.append(getOneColumnStmt(field));\n// if (i!=fields.length-1)\n// builder.append(\",\");\n// }\n// String sql=\"create table \"+getTableName(clz)+\"(\"+builder+\")\";\n// db.execSQL(sql);\n ArrayList<String> stmts=getCreateTableStmt(clz);\n for (String stmt:stmts) {\n db.execSQL(stmt);\n }\n }", "public void createTable(){\r\n String tableStudent = \"CREATE TABLE tableStudent (\"+\r\n \"studentId INT primary key,\"+\"studentName TEXT,\"+\r\n \"className TEXT)\";\r\n db.execSQL(tableStudent);\r\n }", "public static void connect() {\n\t\tString url = \"jdbc:sqlite:C:/sqlite/db/sample.db\";\r\n\t\ttry {\r\n\t\t\tconn= DriverManager.getConnection(url);\r\n\t\t\tSystem.out.println(\"연결성공!!!\");\r\n\t\t\t\r\n//\t\t\tPreparedStatement psmt = conn.prepareStatement(\"select * from person\");\r\n//\t\t\tResultSet rs =psmt.executeQuery();\r\n//\t\t\t\r\n//\t\t\twhile(rs.next()) {\r\n//\t\t\t\tSystem.out.printf(\"id: %3d, name: %4s, age: %2d, phone: %10s\",rs.getInt(\"id\"),rs.getString(\"name\"),rs.getInt(\"age\"),rs.getString(\"phone\"));\r\n//\t\t\t\tSystem.out.println();//줄바꿈\r\n//\t\t\t}\r\n\t\t\t\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n//\t\t\tfinally {\r\n//\t\t\tif(conn!=null) {\r\n//\t\t\t\ttry {\r\n//\t\t\t\t\tconn.close();\r\n//\t\t\t\t} catch (SQLException e) {\r\n//\t\t\t\t\te.printStackTrace();\r\n//\t\t\t\t}\r\n//\t\t\t}\r\n//\t\t}\r\n\t}", "public void createTable(String tableName) {\n db.execSQL(\"create table if not exists '\" + tableName.replaceAll(\"\\\\s\", \"_\") + \"' (\"\n + KEY_ROWID + \" integer primary key autoincrement, \"\n + KEY_QUESTION + \" string not null, \"\n + KEY_ANSWER + \" string not null);\");\n }", "private void createTables(Connection db_connection) throws SQLException {\n /*\n * Use Statement to execute SQL.\n */\n Statement statement = db_connection.createStatement();\n /*\n * Clear the *cities* table and create it according to the schema.\n */\n statement.executeUpdate(\"DROP TABLE IF EXISTS cities;\");\n //System.out.printf(\"Creating table *cities*.%n\");\n statement.executeUpdate(\"CREATE TABLE cities (\"\n + \"city_id_pk INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\"\n + \"city_name TEXT NOT NULL,\"\n + \"city_state TEXT NOT NULL);\");\n //System.out.printf(\"Table *cities* has been created.%n\");\n /*\n * Enforce foreign keys.\n * https://sqlite.org/pragma.html\n */\n statement.execute(\"PRAGMA foreign_keys = ON;\");\n /*\n * Clear the *teams* table and create it according to the schema.\n */\n statement.executeUpdate(\"DROP TABLE IF EXISTS teams;\");\n //System.out.printf(\"Creating table *teams*.%n\");\n statement.executeUpdate(\"CREATE TABLE teams (\"\n + \"team_id_pk INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\"\n + \"team_name TEXT NOT NULL,\"\n + \"team_conference TEXT NOT NULL,\"\n + \"team_division TEXT NOT NULL,\"\n + \"team_site TEXT NOT NULL,\"\n + \"city_id,\"\n + \"FOREIGN KEY (city_id) REFERENCES cities(city_id_pk));\");\n //System.out.printf(\"Table *teams* has been created.%n\");\n }", "public DB(String db) throws ClassNotFoundException, SQLException {\n // Set up a connection and store it in a field\n Class.forName(\"org.sqlite.JDBC\");\n String url = \"jdbc:sqlite:\" + db;\n\n // stop conn from creating a file if does not exists\n SQLiteConfig config = new SQLiteConfig();\n config.resetOpenMode(SQLiteOpenMode.CREATE);\n\n //connect to the file\n conn = DriverManager.getConnection(url, config.toProperties());\n try (Statement stat = conn.createStatement();) {\n stat.executeUpdate(\"PRAGMA foreign_keys = ON;\");\n }\n }", "public synchronized void criarTabela(){\n \n String sql = \"CREATE TABLE IF NOT EXISTS CPF(\\n\"\n + \"id integer PRIMARY KEY AUTOINCREMENT,\\n\"//Autoincrement\n// + \"codDocumento integer,\\n\"\n + \"numCPF integer\\n\"\n + \");\";\n \n try (Connection c = ConexaoJDBC.getInstance();\n Statement stmt = c.createStatement()) {\n // create a new table\n stmt.execute(sql);\n stmt.close();\n c.close();\n } catch (SQLException e) {\n System.err.println(e.getClass().getName() + \": \" + e.getMessage()); \n// System.out.println(e.getMessage());\n }\n System.out.println(\"Table created successfully\");\n }", "@Override\n\tpublic void onCreate(SQLiteDatabase db) {\n\t\tString sql=\"create table table_notes \" +\n\t\t\t\t\"(\" +\n\t\t\t\t\"_id integer primary key autoincrement, \" +\n\t\t\t\t\"Title text, \" +\n\t\t\t\t\"Description text\" +\n\t\t\t\t\")\";\n\t\tdb.execSQL(sql);\n\t\t\n\t}", "private createSingletonDatabase()\n\t{\n\t\tConnection conn = createDatabase();\n\t\tcreateTable();\n\t\tString filename = \"Summer expereince survey 2016 for oliver.csv\"; \n\t\timportData(conn, filename);\n\t}", "public void createNewTable(String dbName, String tableName) {\r\n\t\t// SQL statement for creating a new table\r\n\t\tString sql = \"CREATE TABLE IF NOT EXISTS \" + tableName + \" (\\n\"\r\n\t\t\t\t+ \"id integer PRIMARY KEY,\\n\"\r\n\t\t\t\t+ \"first_name VARCHAR(20) NOT NULL,\\n\"\r\n\t\t\t\t+ \"last_name VARCHAR(20) NOT NULL,\\n\"\r\n\t\t\t\t+ \"manager_id integer NOT NULL,\\n\"\r\n\t\t\t\t+ \"join_date DATE NOT NULL,\\n\"\r\n\t\t\t\t+ \"billable_hours double NOT NULL);\";\r\n\t\t\r\n\t\ttry {\r\n\t\t\tConnection conn = this.connect(dbName);\t\t\t// open connection\r\n\t\t\t\r\n\t\t\tStatement stmt = conn.createStatement();\r\n\t\t\t\r\n\t\t\t// create a new table using prepared sql statement\r\n\t\t\tstmt.execute(sql);\r\n\t\t\tSystem.out.println(\"Executed create table statement\");\r\n\t\t\t\r\n\t\t\tconn.close();\t\t\t\t\t\t\t\t\t// close connection\r\n\t\t} catch (SQLException e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t}", "@Override\n\tpublic void onCreate(SQLiteDatabase db) {\n\t\tStringBuffer sb = new StringBuffer(\"create table fileinfo ( \");\n\t\tsb.append(\"id integer primary key autoincrement , \");\n\t\tsb.append(\"name varchar(20) , \");\n\t\tsb.append(\"fileurl varchar(60) ,\");\n\t\tsb.append(\"path varchar(60) , \");\n\t\tsb.append(\"size varchar(30) , \");\n\t\tsb.append(\"time varchar(30)\");\n\t\tsb.append(\")\");\n\t\ttry {\n\t\t\tdb.execSQL(sb.toString());\n\t\t\tLog.d(\"TAG\", \"创建数据库表成功\");\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t}", "public void createTableUser(){\r\n Statement stmt;\r\n try {\r\n stmt = this.getConn().createStatement();\r\n ///////////////*********remember to retrieve*************/////////////\r\n //stmt.executeUpdate(\"create table user(username VARCHAR(40),email VARCHAR(40), password int);\");\r\n //stmt.executeUpdate(\"INSERT INTO user VALUES('A','pit@gmail.com',12344);\");\r\n //stmt.executeUpdate(\"INSERT INTO user VALUES('CC','pit234@gmail.com',3231);\");\r\n } catch (SQLException e) { e.printStackTrace();}\r\n }", "@Override\n public void onCreate(SQLiteDatabase db) {\n Log.d(TAG, \"onCreate: Creating Database\");\n db.execSQL(SQL_CREATE_TABLE); //This statement will execute anything in SQL.\n }", "@Override\n public void onCreate(SQLiteDatabase db) {\n String query = MessageFormat.format(\"CREATE TABLE {0} (\" +\n \"_id INTEGER PRIMARY KEY AUTOINCREMENT, \" +\n \"{1}, \" +\n \"{2}, \" +\n \"{3}, \" +\n \"{4}, \" +\n \"{5} \" +\n \")\",\n CrimeDbSchema.CrimeTable.NAME,\n CrimeDbSchema.CrimeTable.Cols.UUID,\n CrimeDbSchema.CrimeTable.Cols.TITLE,\n CrimeDbSchema.CrimeTable.Cols.DATE,\n CrimeDbSchema.CrimeTable.Cols.SOLVED,\n CrimeDbSchema.CrimeTable.Cols.REQ_POLICE\n );\n db.execSQL(query);\n }", "public void onCreate(SQLiteDatabase sqliteDB) \n \t\t{\n \t\t\tsqliteDB.execSQL(sqlStatement_CreateTable); // creates a table\n \t\t\tLog.e(\"pigtail\",\"CREATING TABLE\");\n \t\t}", "public static void connect() {\n\n\t\t/* Where the last part is the name of the database file */\n\t\tString database = \"jdbc:sqlite:plugins/PvPTeleport/PvPTeleport.sqlite\";\n\n\t\ttry {\n\t\t\tClass.forName(\"org.sqlite.JDBC\");\n\t\t\tconn = DriverManager.getConnection(database);\n\n\t\t\tStatement st = conn.createStatement();\n\n\t\t\t/* Get database version */\n\t\t\tResultSet rs = st.executeQuery(\"PRAGMA user_version;\");\n\n\t\t\trs.next();\n\t\t\tint user_version = rs.getInt(\"user_version\");\n\n\t\t\trs.close();\n\n\t\t\tswitch (user_version) {\n\n\t\t\t/* Database is brand new. Create tables */\n\t\t\tcase 0: {\n\t\t\t\tPvPTeleport.instance.getLogger().info(\"Database not yet created. Creating ...\");\n\t\t\t\tString query = \"CREATE TABLE worldlocs \" // Player locations in the 'world' world. Used when players teleport to both deathban world and pvpworld\n\t\t\t\t\t\t+ \"(id INTEGER PRIMARY KEY AUTOINCREMENT,\"\n\t\t\t\t\t\t+ \"uuid BLOB,\"\n\t\t\t\t\t\t+ \"x INT,\"\n\t\t\t\t\t\t+ \"y INT,\"\n\t\t\t\t\t\t+ \"z INT);\"\n\n\t\t\t\t\t\t+ \"CREATE TABLE deathbanlocs\" // Player locations in the deathban world. Used when players teleport out of deathban world.\n\t\t\t\t\t\t+ \"(id INTEGER PRIMARY KEY AUTOINCREMENT,\"\n\t\t\t\t\t\t+ \"uuid BLOB,\"\n\t\t\t\t\t\t+ \"x INT,\"\n\t\t\t\t\t\t+ \"y INT,\"\n\t\t\t\t\t\t+ \"z INT);\"\n\n\t\t\t\t\t\t+ \"CREATE TABLE deathbandata\" // Data for each player in the current deathban tournament.\n\t\t\t\t\t\t+ \"(id INTEGER PRIMARY KEY AUTOINCREMENT,\"\n\t\t\t\t\t\t+ \"uuid BLOB,\"\n\t\t\t\t\t\t+ \"points INT,\" // 1 point = 1 kill.\n\t\t\t\t\t\t+ \"status INT);\"; // 0 = not dead. 1 = dead.\n\t\t\t\tst.executeUpdate(query);\n\t\t\t\tquery = \"PRAGMA user_version = 1;\";\n\t\t\t\tst.executeUpdate(query);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t}\n\n\t\t\tst.close();\n\n\t\t} catch ( Exception e ) {\n\t\t\tPvPTeleport.instance.getLogger().info(e.getMessage() );\n\t\t\treturn;\n\t\t}\n\n\t}", "private void createDatabase() throws Exception{\n Statement stm = this.con.createStatement();\n stm.execute(\"CREATE DATABASE IF NOT EXISTS \" + database +\n \" DEFAULT CHARACTER SET utf8 COLLATE utf8_persian_ci\");\n }", "@Test\n public void testPrueba() {\n try {\n conn.createStatement().executeQuery(\"SELECT * FROM prueba\");\n System.out.println(Colors.toGreen(\"[OK]\") + \" Table prueba exists.\");\n } catch (SQLException e) {\n System.out.println(Colors.toYellow(\"[WARNING]\") + \" Table 'prueba' does not exist, needed by ServerTest!!\");\n System.out.println(Colors.toBlue(\"[INFO]\") + \" Table prueba will be created.\");\n try {\n conn.createStatement().executeUpdate(\"CREATE TABLE prueba (id INT AUTO_INCREMENT PRIMARY KEY, nombre VARCHAR(255))\");\n System.out.println(Colors.toGreen(\"[OK]\") + \" Table prueba created.\");\n } catch (SQLException e1) {\n System.out.println(Colors.toRed(\"[FAIL]\") + \" Table prueba could not be created.\");\n System.out.println(Colors.toBlue(\"[INFO]\") + \" Create it manually by running: CREATE TABLE prueba (id INT AUTO_INCREMENT PRIMARY KEY, nombre VARCHAR(255))\");\n Assert.fail(e1.getMessage());\n }\n }\n }", "public static void createTable(SQLiteDatabase db) {\n String sql = \"CREATE TABLE \" + TABLE_NAME + \"(\"\n + _ID + \" INTEGER PRIMARY KEY, \"\n + COL_DATE + \" DATETIME, \"\n + COL_RESULT + \" TEXT, \"\n + COL_UNIT + \" TEXT, \"\n + COL_ROW + \" TEXT\"\n + \");\";\n\n db.execSQL(sql);\n }", "private Connection createTable() {\n\t\tSystem.out.println(\"We are creating a table\");\n\t\ttry (\n\t\t\t\t// Step 1: Allocate a database \"Connection\" object\n\t\t\t\tConnection conn = DriverManager.getConnection(\"jdbc:mysql://localhost:\" + PORT_NUMBER + \"/experiences?user=root&password=root\"); // MySQL\n\t\t\t\t// Step 2: Allocate a \"Statement\" object in the Connection\n\t\t\t\tStatement stmt = conn.createStatement();\n\t\t\t\t) {\n\t\t\t// Step 3 - create our database\n\t\t\tString sql2 = \"CREATE TABLE IF NOT EXISTS t1 ( \" +\n\t\t\t\t\t\"question1 varchar(500), \" +\n\t\t\t\t\t\"question2 varchar(500), \" +\n\t\t\t\t\t\"question3 varchar(500), \" +\n\t\t\t\t\t\"question4 varchar(500), \" +\n\t\t\t\t\t\"question5 varchar(500), \" +\n\t\t\t\t\t\"question6 varchar(500), \" +\n\t\t\t\t\t\"question7 varchar(500), \" +\n\t\t\t\t\t\"question8 varchar(500), \" +\n\t\t\t\t\t\"question9 varchar(500));\";\n\t\t\tstmt.execute(sql2);\n\t\t\treturn conn;\n\t\t\t\n\t\t\t\n\n\t\t} catch(SQLException ex) {\n\t\t\tex.printStackTrace();\n\t\t\treturn null;}\n\t\t}", "private void setupDatabase()\n {\n try\n {\n Class.forName(\"com.mysql.jdbc.Driver\");\n }\n catch (ClassNotFoundException e)\n {\n simpleEconomy.getLogger().severe(\"Could not load database driver.\");\n simpleEconomy.getServer().getPluginManager().disablePlugin(simpleEconomy);\n e.printStackTrace();\n }\n\n try\n {\n connection = DriverManager\n .getConnection(String.format(\"jdbc:mysql://%s/%s?user=%s&password=%s\",\n simpleEconomy.getConfig().getString(\"db.host\"),\n simpleEconomy.getConfig().getString(\"db.database\"),\n simpleEconomy.getConfig().getString(\"db.username\"),\n simpleEconomy.getConfig().getString(\"db.password\")\n ));\n\n // Loads the ddl from the jar and commits it to the database.\n InputStream input = getClass().getResourceAsStream(\"/ddl.sql\");\n try\n {\n String s = IOUtils.toString(input);\n connection.createStatement().execute(s);\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n finally\n {\n try\n {\n input.close();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n }\n }\n catch (SQLException e)\n {\n simpleEconomy.getLogger().severe(\"Could not connect to database.\");\n simpleEconomy.getServer().getPluginManager().disablePlugin(simpleEconomy);\n e.printStackTrace();\n }\n }", "public void creatDataBase(String dbName);", "private static Connection connect(){\n Connection conn = null;\n try{\n Class.forName(\"org.sqlite.JDBC\");\n conn = DriverManager.getConnection(\"jdbc:sqlite:devices.db\");\n } catch (ClassNotFoundException | SQLException e){\n System.out.println(e.toString());\n }\n return conn;\n }", "public void createTable(Class<?> clz) {\n\t\tcreateTable(getWritableDatabase(), clz);\n\t}", "public void createTable(Database database) throws SQLException{\n\t\tdatabase.createTable(PEOPLE_TABLE_NAME, PEOPLE_TABLE_CREATION_ARGS);\n\t}", "public void dbConnection()\n {\n\t try {\n\t \t\tClass.forName(\"org.sqlite.JDBC\");\n // userName=rpanel.getUserName();\n String dbName=userName+\".db\";\n c = DriverManager.getConnection(\"jdbc:sqlite:database/\"+dbName);\n }\n //catch the exception\n catch ( Exception e ) \n { \n System.err.println( \"error in catch\"+e.getClass().getName() + \": \" + e.getMessage() );\n System.exit(0);\n }\n\t if(c!=null)\n\t {\n System.out.println(\"Opened database successfully\");\n\t System.out.println(c);\n createData();\n\t}\n }", "@Override\n\tpublic void onCreate(SQLiteDatabase db) {\n\t\tdb.execSQL(\"create table \" + TABLE_NAME + \"(id integer primary key autoincrement,uname text,name text)\");\n\t}", "public void testCreateDb() throws Throwable {\n final HashSet<String> tableNameHashSet = new HashSet<String>();\n tableNameHashSet.add(MovieContract.MovieEntry.TABLE_NAME);\n tableNameHashSet.add(MovieContract.TrailerEntry.TABLE_NAME);\n\n mContext.deleteDatabase(MovieDBHelper.DATABASE_NAME);\n SQLiteDatabase db = new MovieDBHelper(\n this.mContext).getWritableDatabase();\n assertEquals(true, db.isOpen());\n\n // have we created the tables we want?\n Cursor c = db.rawQuery(\"SELECT name FROM sqlite_master WHERE type='table'\", null);\n\n assertTrue(\"Error: This means that the database has not been created correctly\",\n c.moveToFirst());\n\n // verify that the tables have been created\n do {\n tableNameHashSet.remove(c.getString(0));\n } while (c.moveToNext());\n\n // if this fails, it means that your database doesn't contain both the location entry\n // and weather entry tables\n assertTrue(\"Error: Your database was created without both the location entry and weather entry tables\",\n tableNameHashSet.isEmpty());\n\n // now, do our tables contain the correct columns?\n c = db.rawQuery(\"PRAGMA table_info(\" + MovieContract.MovieEntry.TABLE_NAME + \")\",\n null);\n\n assertTrue(\"Error: This means that we were unable to query the database for table information.\",\n c.moveToFirst());\n\n // Build a HashSet of all of the column names we want to look for\n final HashSet<String> movieColumnHashSet = new HashSet<String>();\n movieColumnHashSet.add(MovieContract.MovieEntry._ID);\n movieColumnHashSet.add(MovieContract.MovieEntry.COLUMN_MOVIE_ID);\n movieColumnHashSet.add(MovieContract.MovieEntry.COLUMN_MOVIE_TITLE);\n movieColumnHashSet.add(MovieContract.MovieEntry.COLUMN_MOVIE_POSTER);\n movieColumnHashSet.add(MovieContract.MovieEntry.COLUMN_PLOT_SYNOPSIS);\n movieColumnHashSet.add(MovieContract.MovieEntry.COLUMN_RELEASE_YEAR);\n movieColumnHashSet.add(MovieContract.MovieEntry.COLUMN_USER_RATING);\n movieColumnHashSet.add(MovieContract.MovieEntry.COLUMN_LENGTH);\n\n int columnNameIndex = c.getColumnIndex(\"name\");\n do {\n String columnName = c.getString(columnNameIndex);\n movieColumnHashSet.remove(columnName);\n } while (c.moveToNext());\n\n // if this fails, it means that your database doesn't contain all of the required location\n // entry columns\n assertTrue(\"Error: The database doesn't contain all of the required location entry columns\",\n movieColumnHashSet.isEmpty());\n db.close();\n }", "@Override\n\t\tpublic void onCreate(SQLiteDatabase database) {\n\t\t\tcreateTable(database);\n\n\t\t}", "public void testCreateDb() throws Throwable {\n final HashSet<String> tableNameHashSet = new HashSet<String>();\n tableNameHashSet.add(MoviesContract.MovieEntry.TABLE_NAME);\n //Add all the remaining tables\n\n //mContext.deleteDatabase(MoviesDbHelper.DATABASE_NAME);\n SQLiteDatabase db = new MoviesDbHelper(\n this.mContext).getWritableDatabase();\n assertEquals(true, db.isOpen());\n\n // have we created the tables we want?\n Cursor c = db.rawQuery(\"SELECT name FROM sqlite_master WHERE type='table'\", null);\n\n assertTrue(\"Error: This means that the database has not been created correctly\",\n c.moveToFirst());\n\n // verify that the tables have been created\n do {\n tableNameHashSet.remove(c.getString(0));\n } while( c.moveToNext() );\n\n // if this fails, it means that your database doesn't contain both the movie entry\n // and weather entry tables\n assertTrue(\"Error: Your database was created without the movie entry tables\",\n tableNameHashSet.isEmpty());\n\n // now, do our tables contain the correct columns?\n c = db.rawQuery(\"PRAGMA table_info(\" + MoviesContract.MovieEntry.TABLE_NAME + \")\",\n null);\n\n assertTrue(\"Error: This means that we were unable to query the database for table information.\",\n c.moveToFirst());\n\n // Build a HashSet of all of the column names we want to look for\n final HashSet<String> movieColumnHashSet = new HashSet<String>();\n movieColumnHashSet.add(MoviesContract.MovieEntry._ID);\n movieColumnHashSet.add(MoviesContract.MovieEntry.COLUMN_THEMOVIEDB_ID);\n movieColumnHashSet.add(MoviesContract.MovieEntry.COLUMN_SORTBY_SETTING);\n movieColumnHashSet.add(MoviesContract.MovieEntry.COLUMN_ORIGINAL_TITLE);\n movieColumnHashSet.add(MoviesContract.MovieEntry.COLUMN_POSTER_PATH);\n movieColumnHashSet.add(MoviesContract.MovieEntry.COLUMN_OVERVIEW);\n movieColumnHashSet.add(MoviesContract.MovieEntry.COLUMN_VOTE_AVERAGE);\n movieColumnHashSet.add(MoviesContract.MovieEntry.COLUMN_RELEASE_DATE);\n\n int columnNameIndex = c.getColumnIndex(\"name\");\n do {\n String columnName = c.getString(columnNameIndex);\n movieColumnHashSet.remove(columnName);\n } while(c.moveToNext());\n\n // if this fails, it means that your database doesn't contain all of the required movie\n // entry columns\n assertTrue(\"Error: The database doesn't contain all of the required movie entry columns\",\n movieColumnHashSet.isEmpty());\n db.close();\n }", "private void createUploadTable(SQLiteDatabase db) {\n // SQL statement to create upload table\n String CREATE_UPLOAD_TABLE = \"CREATE TABLE IF NOT EXISTS \" + UPLOAD_TABLE_NAME + \" (\" +\n NAME_ID + \" INTEGER PRIMARY KEY,\" +\n NAME_SIZE + \" INTEGER,\" +\n NAME_MD5 + \" TEXT,\" +\n NAME_STATUS + \" TEXT,\" +\n NAME_DOWNLOADS + \" INTEGER,\" +\n NAME_DOWNLOAD_LINK + \" TEXT\" +\n \")\";\n // create upload table\n db.execSQL(CREATE_UPLOAD_TABLE);\n }", "@Override\n public void onCreate(SQLiteDatabase db) {\n db.execSQL(\n \"create table notes \" +\n \"(id integer primary key autoincrement, \" +\n \"unit text,version interger,content blob)\"\n );\n }", "public void CreateTable(String nameTable) throws SQLException {\n\n String FEATURE_DB_SQL = \"CREATE TABLE IF NOT EXISTS \" + nameTable + \"(id INT NOT NULL AUTO_INCREMENT, \"\n + FEATURE_DB_TEXTFEATURE + \" VARCHAR(255), \" + FEATURE_DB_ELO + \" INT, \" + FEATURE_DB_MMR + \" INT,\"\n + FEATURE_DB_AUTHOR + \" VARCHAR(255),\"\n +\" PRIMARY KEY ( id ))\";\n\n statement = conn.createStatement();\n statement.executeUpdate(FEATURE_DB_SQL);\n }", "public static void createDatabase() throws SQLException {\n\t\tSystem.out.println(\"DROP database IF EXISTS project02;\");\n\t\tstatement = connection.prepareStatement(\"DROP database IF EXISTS project02;\");\n\t\tstatement.executeUpdate();\n\t\tSystem.out.println(\"CREATE database project02;\");\n\t\tstatement = connection.prepareStatement(\"CREATE database project02;\");\n\t\tstatement.executeUpdate();\n\t\tSystem.out.println(\"USE project02;\");\n\t\tstatement = connection.prepareStatement(\"USE project02;\");\n\t\tstatement.executeUpdate();\n\t}", "public void createDatabase(String sDBName) throws SQLException{\n\t\tloadDriver();\n\t\tConnection conn = DriverManager.getConnection(protocol + dbName\n + \";create=true\", new Properties());\n\t\tcloseJDBCResources(conn);\t\t\n\t}", "@Override\n public void onCreate(SQLiteDatabase db) {\n\n String createTableStatement = \"CREATE TABLE \" + pass_store +\n \" (SID INTEGER PRIMARY KEY AUTOINCREMENT, \" +\n column_url + \" TEXT, \" +\n column_password + \" TEXT, \" +\n column_status + \" BOOLEAN )\";\n\n db.execSQL(createTableStatement);\n\n }", "private static void criarTabela(Connection connection) throws IOException, SQLException {\n final Path sqlFile = Paths.get(\"coursera.sql\");\n String sqlData = new String(Files.readAllBytes(sqlFile));\n Statement statement = connection.createStatement();\n statement.executeUpdate(sqlData);\n statement.close();\n connection.close();\n }", "public static void SetupDB() {\n\t\tdb.execSQL(\"CREATE TABLE IF NOT EXISTS User(email TEXT,name TEXT, displayPic BLOB);\");\n\t\tdb.execSQL(\"CREATE TABLE IF NOT EXISTS FriendList(ID INTEGER PRIMARY KEY, email TEXT,name TEXT, displayPic BLOB);\");\n\t\tdb.execSQL(\"CREATE TABLE IF NOT EXISTS Category(ID INTEGER PRIMARY KEY,name TEXT);\");\n\t}", "@Override\n public void onCreate(SQLiteDatabase sqLiteDatabase){\n\n /*\n * The raw SQL statement to create the user favorite table.\n */\n final String SQL_CREATET_TABLE_USER_FAV =\n \"CREATE TABLE \" + UserFavoriteContract.UserFavEntry.TABLE_NAME + \" (\" +\n \"_id INTEGER PRIMARY KEY ASC, \" +\n UserFavoriteContract.UserFavEntry.COLUMN_MOVIE_ID + \" INTEGER, \" +\n UserFavoriteContract.UserFavEntry.COLUMN_POSTER_URL + \" TEXT, \" +\n UserFavoriteContract.UserFavEntry.COLUMN_INSERT_TIMESTAMP + \" INTEGER ); \";\n\n sqLiteDatabase.execSQL(SQL_CREATET_TABLE_USER_FAV);\n }", "public Connection createConnection() {\n Connection c = null;\n try {\n Class.forName(\"org.sqlite.JDBC\");\n c = DriverManager.getConnection(\"jdbc:sqlite:ase_i3.db\");\n } catch (Exception e) {\n System.err.println(e.getClass().getName() + \": \" + e.getMessage());\n return null;\n }\n System.out.println(\"Database connection succeed.\");\n return c;\n }", "@Test(timeout = 4000)\n public void test112() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable(\"O\\\"6T\");\n File file0 = MockFile.createTempFile(\"<*kYz\", \"BLOB\");\n MockPrintWriter mockPrintWriter0 = new MockPrintWriter(file0);\n NameSpec nameSpec0 = NameSpec.ALWAYS;\n SQLUtil.renderCreateTable(defaultDBTable0, true, nameSpec0, mockPrintWriter0);\n assertNull(defaultDBTable0.getDoc());\n }", "public void create_table(String table_name, List<String> attributes) {\n //throw error if table already exists\n if (get_table_names().contains(table_name) && !table_name.equals(\"relationship\")) {\n throw new RuntimeException(\"Table with this name already exists.\");\n }\n //throw error if no name is given\n if (table_name.isEmpty()) {\n throw new RuntimeException(\"Table name can not be empty.\");\n }\n //throw error if no attributes are given\n if (attributes.isEmpty()) {\n throw new RuntimeException(\"Table needs at least one attribute.\");\n }\n\n StringBuilder stringBuilder = new StringBuilder(\"create table if not exists \");\n stringBuilder.append(table_name);\n //autoincrement handles the correct incrementation of the primary key\n stringBuilder.append(\" (id integer primary key autoincrement, \");\n for (String attribute : attributes) {\n stringBuilder.append(attribute);\n stringBuilder.append(\" varchar, \"); //values are varchar since the user inputs text\n }\n stringBuilder.delete(stringBuilder.length() - 2, stringBuilder.length());\n stringBuilder.append(\")\");\n\n String sql = stringBuilder.toString();\n\n execute_statement(sql, false);\n }", "public static void main(String[] args) {\n\t\tStringBuilder sb = new StringBuilder(\"create table Books(\");\r\n\t\tsb.append(\"id integer, \");\r\n\t\tsb.append(\"title varchar(25), \");\r\n\t\tsb.append(\"author varchar(25), \");\r\n\t\tsb.append(\"publication date, \");\r\n\t\tsb.append(\"price float, \");\r\n\t\tsb.append(\"quantity integer, \");\r\n\t\tsb.append(\"rating float)\");\r\n\r\n\t\tString sql = sb.toString();\r\n\t\tSystem.out.println(sql);\r\n\r\n\t\t// 2. set the db url\r\n//\t\tString url = \"jdbc:derby://localhost:1527/db1\";\r\n\t\tString url = \"jdbc:sqlserver://localhost:1433;databaseName=db1;user=eldar1;password=pass1\";\r\n\r\n\t\t// 3. establish connection\r\n\t\ttry (Connection con = DriverManager.getConnection(url + \";create=true\");) {\r\n\t\t\t// 4. get a statement object from the connection\r\n\t\t\tStatement stmt = con.createStatement();\r\n\r\n\t\t\t// 5. execute the sql\r\n\t\t\tstmt.executeUpdate(sql);\r\n\t\t\tSystem.out.println(\"table created\");\r\n\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t}", "public void setup() throws SQLException {\n // Create ACARS table\n final String createTableSQL = \"CREATE TABLE IF NOT EXISTS ACARS (\"\n + \"date DATE, time TIME, frequency CHAR(7), \"\n + \"registration VARCHAR(7), flight CHAR(6), \"\n + \"mode CHAR, label CHAR(2), blockId CHAR, msgId CHAR(4), \"\n + \"text VARCHAR(255), \"\n + \"PRIMARY KEY (date, registration, flight, mode, label, blockId, msgId), \"\n + \"INDEX datetime_idx (date, time), \"\n + \"INDEX registration_idx (registration), \"\n + \"INDEX flight_idx (flight)\"\n + \")\";\n\n final Statement createTableStmt = connection.createStatement();\n createTableStmt.execute(createTableSQL);\n }", "public Connection DbConnection() throws Exception {\n Class.forName(\"com.mysql.jdbc.Driver\");\n\n // Creating a new connection\n // String myDB = \"jdbc:sqlite:C:\\\\Users\\\\kapersky\\\\Documents\\\\NetBeansProjects\\\\Library Management System\\\\src\\\\librarydb.db\";\n String myDB = \"jdbc:mysql://localhost:3306/librarydb\";\n con = DriverManager.getConnection(myDB, \"root\", \"\");\n return con;\n\n }", "DataBase createDataBase();", "public void testCreateDb() throws Throwable {\n // build a HashSet of all of the table names we wish to look for\n // Note that there will be another table in the DB that stores the\n // Android metadata (db version information)\n final HashSet<String> tableNameHashSet = new HashSet<String>();\n tableNameHashSet.add(MediaContract.MediaEntry.TABLE_NAME);\n\n mContext.deleteDatabase(MediaDbHelper.DATABASE_NAME);\n SQLiteDatabase db = new MediaDbHelper(\n this.mContext).getWritableDatabase();\n assertEquals(true, db.isOpen());\n\n // have we created the tables we want?\n Cursor c = db.rawQuery(\"SELECT name FROM sqlite_master WHERE type='table'\", null);\n\n assertTrue(\"Error: This means that the database has not been created correctly\",\n c.moveToFirst());\n\n // verify that the tables have been created\n do {\n tableNameHashSet.remove(c.getString(0));\n } while( c.moveToNext() );\n\n // if this fails, it means that your database doesn't contain both the location entry\n // and weather entry tables\n assertTrue(\"Error: Your database was created without both the location entry and weather entry tables\",\n tableNameHashSet.isEmpty());\n\n // now, do our tables contain the correct columns?\n c = db.rawQuery(\"PRAGMA table_info(\" + MediaContract.MediaEntry.TABLE_NAME + \")\",\n null);\n\n assertTrue(\"Error: This means that we were unable to query the database for table information.\",\n c.moveToFirst());\n\n // Build a HashSet of all of the column names we want to look for\n final HashSet<String> mediaColumnHashSet = new HashSet<String>();\n mediaColumnHashSet.add(MediaContract.MediaEntry._ID);\n mediaColumnHashSet.add(MediaContract.MediaEntry.COLUMN_AUTHOR);\n mediaColumnHashSet.add(MediaContract.MediaEntry.COLUMN_COMPLETION);\n mediaColumnHashSet.add(MediaContract.MediaEntry.COLUMN_DATE);\n mediaColumnHashSet.add(MediaContract.MediaEntry.COLUMN_DESCRIPTION);\n mediaColumnHashSet.add(MediaContract.MediaEntry.COLUMN_RATING);\n mediaColumnHashSet.add(MediaContract.MediaEntry.COLUMN_TITLE);\n mediaColumnHashSet.add(MediaContract.MediaEntry.COLUMN_TYPE);\n mediaColumnHashSet.add(MediaContract.MediaEntry.COLUMN_URL);\n\n int columnNameIndex = c.getColumnIndex(\"name\");\n do {\n String columnName = c.getString(columnNameIndex);\n mediaColumnHashSet.remove(columnName);\n } while(c.moveToNext());\n\n // if this fails, it means that your database doesn't contain all of the required media\n // entry columns\n assertTrue(\"Error: The database doesn't contain all of the required media entry columns\",\n mediaColumnHashSet.isEmpty());\n db.close();\n }", "public void createTable(String database, String tableName, String [][] parameters)\n\t{\n\n\t\ttry\n\t\t{\n\t\t\tStatement createTableStatement = databaseConnection.createStatement();\n\t\t\tString parameterInfo = parsePerameterArray(parameters);\n\t\t\t\n\t\t\tString createString = \"CREATE TABLE IF NOT EXISTS `\" + database + \"`.`\" + tableName + \"`\" + \"(\" + parameterInfo + \") ENGINE + INNODB;\";\n\t\t\tcreateTableStatement.close();\n\t\t}\n\t\tcatch (SQLException currentSQLError)\n\t\t{\n\t\t\tdisplaySQLErrors(currentSQLError);\n\t\t}\n\t\t\n\t}", "public static Connection getConnection() {\n if(connection == null) {\n Statement statement = null;\n try {\n Class.forName(\"org.sqlite.JDBC\");\n connection = DriverManager.getConnection(\"jdbc:sqlite::memory:\");\n \n statement = connection.createStatement();\n \n BufferedReader input = new BufferedReader(new FileReader(\"db/schema.sql\"));\n String contents;\n String sql = \"\";\n while((contents = input.readLine()) != null) {\n sql += contents;\n }\n input.close();\n \n statement.executeUpdate(sql);\n }\n catch (Exception e) \n { \n e.printStackTrace(); \n }\n finally {\n try {\n statement.close();\n }\n catch (Exception e) \n { \n e.printStackTrace(); \n }\n }\n }\n return connection;\n }", "@Override\n public void onCreate(SQLiteDatabase db) {\n String CREATE_LOCATIONS_Table = \"CREATE TABLE IF NOT EXISTS \" +\n TBL_locations + \"(\"\n + COL_ID + \"INTEGER PRIMARY KEY,\"\n + COL_place + \"TEXT,\"\n + COL_URL + \"TEXT\" + \")\";\n db.execSQL(CREATE_LOCATIONS_Table);\n }", "void createDb(String dbName);", "@Override\n public void onCreate(SQLiteDatabase sqLiteDatabase) {\n sqLiteDatabase.execSQL(\"create table \" + TABLE_NAME + \" (\" + COL_NAME + \" varchar(30), \" + COL_MOBILE + \" long(10) , \" + COL_PASSWORD + \" varchar(15), \" + COL_STATE + \" varchar(20),\" + COL_EMAIL + \" varchar(35) primary key);\");\n }", "private void createVersionTable(SQLiteDatabase db) {\n // SQL statement to create version table\n String CREATE_VERSION_TABLE = \"CREATE TABLE IF NOT EXISTS \" + VERSION_TABLE_NAME + \" (\" +\n NAME_ID + \" INTEGER PRIMARY KEY,\" +\n NAME_FULL_NAME + \" TEXT,\" +\n NAME_SLUG + \" TEXT,\" +\n NAME_ANDROID_VERSION + \" TEXT,\" +\n NAME_CHANGELOG + \" TEXT,\" +\n NAME_CREATED_AT + \" TEXT,\" +\n NAME_PUBLISHED_AT + \" TEXT,\" +\n NAME_DOWNLOADS + \" INTEGER,\" +\n NAME_VERSION_NUMBER + \" INTEGER,\" +\n NAME_FULL_ID + \" INTEGER,\" +\n NAME_DELTA_ID + \" INTEGER\" +\n \")\";\n // create version table\n db.execSQL(CREATE_VERSION_TABLE);\n }", "@Override\n public void onCreate(SQLiteDatabase database, ConnectionSource connectionSource) {\n\n try {\n TableUtils.createTableIfNotExists(connectionSource, MessageBoard.class);\n TableUtils.createTableIfNotExists(connectionSource, User.class);\n TableUtils.createTableIfNotExists(connectionSource, ChatServerBean.class);\n\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "@Override\n\tpublic void onCreate(SQLiteDatabase db) {\n\t\n\t\t\n\t\tdb.execSQL(\"CREATE TABLE \"+TABLE+\" (\"+QID+\" TEXT, \"+\n\t\t\t\tQNAME+\" TEXT, \"+OPTIONA+\" TEXT,\"+OPTIONB+\" TEXT,\"+OPTIONC+\" TEXT,\"+OPTIOND+\" TEXT,\"+ANS+\" TEXT) ;\");\n\t\t\n\t//\tdb.execSQL(\"insert into \"+TestTable+\"values('10','Grace period for the renewal of a permanent Driving License','a)Nill','b)30days','C)60days','D)90days');\");\n\t\t\n\t}", "@Override\n\tpublic void onCreate(SQLiteDatabase db) {\n\t\ttry {\n\t\t\tString createTable = \"CREATE TABLE \" + TABLE_NAME + \" (_id INTEGER PRIMARY KEY AUTOINCREMENT, content VARCHAR(1000), date DATETIME DEFAULT CURRENT_TIMESTAMP)\";\n\t\t\tdb.execSQL(createTable);\n\t\t}catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void createNewDatabase(String dbName) {\r\n\t\t// connects to given database - relative path points to inside project folder\r\n\t\ttry {\r\n\t\t\tConnection conn = this.connect(dbName);\t\t\t\t\t\t// open connection\r\n\t\t\tif (conn != null) {\r\n\t\t\t\tDatabaseMetaData meta = conn.getMetaData();\r\n\t\t\t\tSystem.out.println(\"The driver name is \" + meta.getDriverName());\r\n\t\t\t\tSystem.out.println(\"A new database has been created.\");\r\n\t\t\t}\r\n\t\t\tconn.close(); \t\t\t\t\t\t\t\t\t\t\t\t// close connection\r\n\t\t} catch (SQLException e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t}", "public SQLite(String dbLocation) {\n this.dbLocation = dbLocation;\n }" ]
[ "0.79048854", "0.7333986", "0.7216897", "0.7140312", "0.7057256", "0.6934611", "0.68819815", "0.68420243", "0.68166196", "0.67894804", "0.67608696", "0.674289", "0.67369837", "0.67141914", "0.6691525", "0.66673946", "0.6650351", "0.663476", "0.6609408", "0.66045743", "0.6571425", "0.6563811", "0.6561868", "0.65533596", "0.65494585", "0.65399987", "0.652347", "0.65137213", "0.6496376", "0.64739424", "0.6462259", "0.6460821", "0.6439922", "0.6438775", "0.6438508", "0.6419042", "0.64060986", "0.6395558", "0.6386134", "0.6385625", "0.63830054", "0.63770765", "0.6357047", "0.6345337", "0.63336736", "0.63066953", "0.6301972", "0.62903666", "0.62773466", "0.6270267", "0.6269277", "0.62621397", "0.6258182", "0.6221553", "0.6221017", "0.62076813", "0.62074894", "0.62017006", "0.61996424", "0.6191085", "0.6189306", "0.6187947", "0.6186811", "0.61867785", "0.6186697", "0.61862195", "0.61855054", "0.61709857", "0.6170824", "0.61669964", "0.61636776", "0.6160089", "0.61516905", "0.61409104", "0.61405754", "0.614025", "0.6138614", "0.6134632", "0.6127404", "0.61005753", "0.6099448", "0.6096949", "0.6093501", "0.60929376", "0.6091937", "0.6089929", "0.6085506", "0.60839194", "0.6082602", "0.6081929", "0.60790896", "0.6078427", "0.60783714", "0.60722554", "0.6069362", "0.6068778", "0.60657847", "0.60655195", "0.60488844", "0.60478777" ]
0.673359
13
Insert a new row into the warehouses table
public void insert(String name, String fileName) { connect(fileName); String sql = "INSERT INTO urls(url) VALUES(?)"; try (PreparedStatement pstmt = conn.prepareStatement(sql)) { pstmt.setString(1, name); pstmt.executeUpdate(); } catch (SQLException e) { System.out.println(e.getMessage()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic int Insert(Warehouse ware) {\n\t\ttry {\n\t\t\t\n\t\t\t System.out.println(\"WarehouseDAOManager is working\");\n\t\t\t success=0;\n\t\t\t success=1;\n\t\t\t return (int)getSqlMapClientTemplate().insert(\"Warehouse.insertWarehouse\", ware);\n\t\t\t\n\t\t} catch (Exception ex) {\n\t\t\t\n\t\t\tex.printStackTrace();\n\t\t\tSystem.out.println(\"WarehouseDAOManager is not working\");\n\t\t\tsuccess=0;\n\n\t\t}\n\t\treturn 0;\n\t}", "public void insertIntoProduct() {\n\t\ttry {\n\t\t\tPreparedStatement statement = connect.prepareStatement(addProduct);\n\t\t\tstatement.setString(1, productName);\n\t\t\tstatement.setString(2, quantity);\n\t\t\t\n\t\t\tstatement.executeUpdate();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t}", "public void insertRow() throws SQLException\n {\n m_rs.insertRow();\n }", "int insert(Drug_OutWarehouse record);", "public void insert(){\r\n\t\tString query = \"INSERT INTO liveStock(name, eyeColor, sex, type, breed, \"\r\n\t\t\t\t+ \"height, weight, age, furColor, vetNumber) \"\r\n\t\t\t\t+ \"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) \";\r\n\t\t\r\n\t\ttry {\r\n\t\t\tPreparedStatement prepareStatement = conn.prepareStatement(query);\r\n\t\t\t\r\n\t\t\tprepareStatement.setString(1, liveStock.getName());\r\n\t\t\tprepareStatement.setString(2, liveStock.getEyeColor());\r\n\t\t\tprepareStatement.setString(3, liveStock.getSex());\r\n\t\t\tprepareStatement.setString(4, liveStock.getAnimalType());\r\n\t\t\tprepareStatement.setString(5, liveStock.getAnimalBreed());\r\n\t\t\tprepareStatement.setString(6, liveStock.getHeight());\r\n\t\t\tprepareStatement.setString(7, liveStock.getWeight());\r\n\t\t\tprepareStatement.setInt(8, liveStock.getAge());\r\n\t\t\tprepareStatement.setString(9, liveStock.getFurColor());\r\n\t\t\tprepareStatement.setInt(10, liveStock.getVetNumber());\r\n\t\t\t\r\n\t\t\tprepareStatement.execute();\r\n\t\t\t\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}", "public int insert(Listing listing) throws SQLException;", "public void insert() throws SQLException;", "@Override\n public SqlDatabaseTable insertIntoTable(SqlDatabaseTable table, List<String> row) {\n executeSql(getInsertSql(table, Collections.singletonList(row)));\n return table;\n }", "public void insert(DataStoreRow row) {\n\t\tSchema.ensure(row);\n\t\tString insertTarget = SchemaMapper.kindToColumnFamily(row.getKind());\n\t\tStringBuilder query = new StringBuilder();\n\t\tquery.append(\"INSERT INTO \\\"\");\n\t\tquery.append(DataStore.KEYSPACE_NAME);\n\t\tquery.append(\"\\\".\\\"\");\n\t\tquery.append(insertTarget);\n\t\tquery.append(\"\\\"(\");\n\t\t\n\t\tint count = 0;\n\t\tfor (Map.Entry<String, DataStoreColumn> entry : row.getColumns().entrySet()) {\n\t\t\tif (count++ > 0) {\n\t\t\t\tquery.append(\",\");\n\t\t\t}\n\t\t\tquery.append('\"');\n\t\t\tquery.append(entry.getValue().getEncodedName());\n\t\t\tquery.append('\"');\t\t\t\n\t\t}\n\t\t\n\t\tquery.append(\") VALUES(\");\n\t\tList<Object> values = new ArrayList<Object>();\t\t\n\t\tcount = 0;\n\t\tfor (Map.Entry<String, DataStoreColumn> entry : row.getColumns().entrySet()) {\n\t\t\tvalues.add(entry.getValue().getValue());\n\t\t\tif (count++ > 0) {\n\t\t\t\tquery.append(\",\");\n\t\t\t}\n\t\t\tquery.append(\"?\");\n\t\t}\n\t\tquery.append(\");\");\n\t\tthis.query(query.toString(), values.toArray());\t\t\t\n\t}", "public void insert(ZyCorporation record) {\r\n getSqlMapClientTemplate().insert(\"zy_corporation.insertcorporation\", record);\r\n }", "public void insertRow() throws SQLException {\n\n try {\n debugCodeCall(\"insertRow\");\n checkClosed();\n if (insertRow == null) { throw Message.getSQLException(ErrorCode.NOT_ON_UPDATABLE_ROW); }\n getUpdatableRow().insertRow(insertRow);\n insertRow = null;\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "int insert(WizardValuationHistoryEntity record);", "public void insert() throws SQLException {\n Statement stmtIn = DatabaseConnector.getInstance().getStatementIn();\n\n int check = BusinessFacade.getInstance().checkIDinDB(this.productRelation.getID(),\n this.post.getID(), \"goods\", \"product_type_id\", \"post_id\");\n if (check == -1){\n stmtIn.executeUpdate(\"INSERT INTO ngaccount.goods (goods_id , product_type_id, post_id) \" +\n \"VALUES ('\" + this.goodID + \"', '\" + this.productRelation.getID() +\n \"', '\" + this.post.getID() + \"');\");\n }\n }", "void insertOrUpdate(StockList stockList) throws Exception;", "public void addWarehouseStock(String name, int amount);", "public boolean inserRow(String Title, String Artist, String category, int sellingPrice) {\n try {\n resultSet.moveToInsertRow();\n resultSet.updateString(Main.Title, Title);\n resultSet.updateString(Main.Artist, Artist);\n resultSet.updateString(Main.category, category);\n resultSet.updateInt(Main.sellingPrice, sellingPrice);\n resultSet.insertRow();\n resultSet.moveToCurrentRow();\n fireTableDataChanged();\n return true;\n } catch (SQLException e) {\n System.out.println(\"error adding row\");\n System.out.println(e);\n return false;\n }\n\n }", "public void insert(VRpHrStp record) {\r\n getSqlMapClientTemplate().insert(\"V_RP_HR_STP.ibatorgenerated_insert\", record);\r\n }", "void insert(OrderPreferential record) throws SQLException;", "@Override\r\n public void addCloth(Cloth cloth) throws SQLException {\n try {\r\n preparedStatement.setString(1, cloth.getName());\r\n preparedStatement.setDate(2, new java.sql.Date(cloth.getProductionDate().getTime()));\r\n preparedStatement.setDouble(3, cloth.getPrice());\r\n if(cloth.isWaterproof())\r\n preparedStatement.setBoolean(4, true);\r\n else\r\n preparedStatement.setBoolean(4, false);\r\n preparedStatement.executeUpdate();\r\n } catch (SQLException e) {\r\n e.printStackTrace();\r\n }\r\n }", "int insertSelective(Drug_OutWarehouse record);", "int insert(DashboardGoods record);", "public void insert(VRpDyTrxTotal record) {\r\n getSqlMapClientTemplate().insert(\"V_RP_DY_TRX_TOTAL.ibatorgenerated_insert\", record);\r\n }", "private void insert(String sql, long rowId, int runId, int payloadColumns) {\n String nodeId = engine.getEngineName();\n\n Object[] values = new Object[payloadColumns + 3];\n values[0] = rowId;\n values[1] = nodeId;\n values[2] = runId;\n\n for (int c = 3; c < values.length; c++) {\n values[c] = RandomStringUtils.randomAlphanumeric(100);\n }\n\n engine.getSqlTemplate().update(sql, values);\n }", "public void insert() throws LRException\n\t{\n\t\tDataHRecordData myData=(DataHRecordData)getData();\n\t\tgetBackground();\n\t\ttry { myData.record.save(background.getClient()); }\n\t\tcatch (LDBException e) { setStatus(e); }\n\t}", "@Override\n\tpublic void insertIntoSupplierProduct(SupplierProduct supplierproduct) {\n\t String sql=\"INSERT INTO supplier_product \"+\" (supplier_supplier_id, product_product_id, quantity, cost, buy_date,supplier_unique_id ,username) SELECT ?,?,?,?,?,?,?\";\n getJdbcTemplate().update(sql, new Object[] {supplierproduct.getSupplierId(), supplierproduct.getProductId(), supplierproduct.getQuantity(), supplierproduct.getCost(), supplierproduct.getBuyDate(), supplierproduct.getSupplierUniqueId(),supplierproduct.getUsername()});\n\t}", "public void insert(VRpDyHlrforbe record) {\r\n getSqlMapClientTemplate().insert(\"V_RP_DY_HLR_FOR_BE.ibatorgenerated_insert\", record);\r\n }", "public void moveToInsertRow() throws SQLException\n {\n m_rs.moveToInsertRow();\n }", "int insert(Sequipment record);", "int insert(TVmManufacturer record);", "public void AddInDB(Word newWord) throws SQLException {\n String insertQuery = \"INSERT INTO tbltest(word,pronunciation,define) VALUES(?,?,?)\";\r\n ps = con.prepareStatement(insertQuery);\r\n ps.setString(1, newWord.getWord());\r\n ps.setString(2, newWord.getPronunciation());\r\n ps.setString(3, newWord.getDefine());\r\n\r\n ps.executeUpdate();\r\n }", "public void insert(TWorkTrustDetail record) {\n\t\tgetSqlMapClientTemplate().insert(\n\t\t\t\t\"t_work_trust_detail.ibatorgenerated_insert\", record);\n\t}", "int insert(Product record);", "@Writer\n int insert(ProductSellerGoods record);", "int insert(cskaoyan_mall_order_goods record);", "@Override\n\tpublic void insert(Seller obj) {\n\t\tPreparedStatement st = null;\n\t\ttry {\n\t\t\tst = conn.prepareStatement(\n\t\t\t\t\t\"INSERT INTO seller\\r\\n\" +\n\t\t\t\t\t\"(Name, Email, BirthDate,BaseSalary,DepartmentId)\\r\\n\" +\n\t\t\t\t\t\"VALUES\\r\\n\"+ \n\t\t\t\t\t\"(?,?,?,?,?);\", Statement.RETURN_GENERATED_KEYS);\n\t\t\tst.setString(1, obj.getName());\n\t\t\tst.setString(2, obj.getEmail());\n\t\t\tst.setDate(3, new java.sql.Date(obj.getBirthDate().getTime()));\n\t\t\tst.setDouble(4, obj.getBaseSalary());\n\t\t\tst.setInt(5, obj.getDepartment().getId());\n\t\t\tint rowsAffected = st.executeUpdate();\n\t\t\tif(rowsAffected > 0) {\n\t\t\t\tResultSet rst = st.getGeneratedKeys();\n\t\t\t\tif(rst.next()) obj.setId(rst.getInt(1));\n\t\t\t\trst.close();\n\t\t\t}\n\t\t}catch(SQLException e) {\n\t\t\tthrow new DbException(e.getMessage());\n\t\t}finally {\n\t\t\tDb.closeStatement(st);\n\t\t}\n\t}", "int insert(EcsSupplierRebate record);", "int insert(Nutrition record);", "public boolean insertRow(String Title, String Artist, String category, int sellingPrice) {\n try {\n resultSet.moveToInsertRow();\n resultSet.updateString(Main.Title, Title);\n resultSet.updateString(Main.Artist, Artist);\n resultSet.updateString(Main.category, category);\n resultSet.updateInt(Main.sellingPrice, sellingPrice);\n resultSet.insertRow();\n resultSet.moveToCurrentRow();\n fireTableDataChanged();\n return true;\n } catch (SQLException e) {\n System.out.println(\"Error adding row\");\n System.out.println(e);\n return false;\n }\n\n }", "int insert(SupplierInfo record);", "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}", "int insert(TCpySpouse record);", "public void insertRow(int index) {\n\t\tString[] array = new String[getColumnCount()];\n\t\tArrays.fill(array, \"\"); //$NON-NLS-1$\n\t\tinput.add(index, new ArrayList<String>(Arrays.asList(array)));\n\t\ttableViewer.refresh(false);\n\t\tfireTableModified();\n\t}", "int insert(HotelType record);", "public void insert(PaymentSummary object)\n throws SQLException {\n object.doSetId(this.getNextChelseaId());\n this.execute(new ParametricStatement[] {\n new ParametricStatement(insertSql, fromObjectToBean(object).toList())\n });\n }", "int insert(TblMotherSon record);", "public static void insertTreatment(String trtName,int cost,String date,String start,String partner){\r\n\t\ttry{\r\n\t\t\t// this is how you connect\r\n\t\t\tconnection = DriverManager.getConnection(connectionString);\r\n\t\t\tstmt = connection.prepareStatement(\"INSERT INTO Treatment VALUES(?,?,?,?,?);\");\r\n\t\t\tstmt.setString(1, trtName);\r\n\t\t\tstmt.setString(2, String.valueOf(cost));\r\n\t\t\tstmt.setString(3, date);\r\n\t\t\tstmt.setString(4, start);\r\n\t\t\tstmt.setString(5, partner);\r\n\t\t\tstmt.executeUpdate();\r\n\t\t}\r\n\t\tcatch (SQLException ex){\r\n\t\t\tex.printStackTrace();\r\n\t\t}\r\n\t}", "int insert(InspectionAgency record);", "@Test(enabled = false)\n public void testInsertIntoTempTable() throws Exception {\n String tableName = createTable();\n String insertTableName = createTable(false, false, true);\n\n assertTableIsRegistered(DEFAULT_DB, tableName);\n assertTableIsNotRegistered(DEFAULT_DB, insertTableName, true);\n\n String query = \"insert into \" + insertTableName + \" select id, name from \" + tableName;\n\n runCommand(query);\n\n Set<ReadEntity> inputs = getInputs(tableName, Entity.Type.TABLE);\n Set<WriteEntity> outputs = getOutputs(insertTableName, Entity.Type.TABLE);\n\n outputs.iterator().next().setWriteType(WriteEntity.WriteType.INSERT);\n\n HiveEventContext event = constructEvent(query, HiveOperation.QUERY, inputs, outputs);\n AtlasEntity hiveProcess = validateProcess(event);\n AtlasEntity hiveProcessExecution = validateProcessExecution(hiveProcess, event);\n AtlasObjectId process = toAtlasObjectId(hiveProcessExecution.getRelationshipAttribute(\n BaseHiveEvent.ATTRIBUTE_PROCESS));\n Assert.assertEquals(process.getGuid(), hiveProcess.getGuid());\n Assert.assertEquals(numberOfProcessExecutions(hiveProcess), 1);\n\n assertTableIsRegistered(DEFAULT_DB, tableName);\n assertTableIsRegistered(DEFAULT_DB, insertTableName, null, true);\n }", "public void insert(TdiaryArticle obj) throws SQLException {\n\r\n\t}", "int insert(ItemStockDO record);", "int insert(ItemStockDO record);", "@Override\n\tpublic void insertIntoSupplier(Supplier supplier) {\n\t\tString sql=\"INSERT INTO supplier \"+\" (supplier_id, supplier_name, supplier_type, permanent_address, temporary_address, email ,image) SELECT ?,?,?,?,?,?\";\n getJdbcTemplate().update(sql, new Object[] {supplier.getSupplierId(), supplier.getSupplierName(), supplier.getSupplierType(), supplier.getPermanentAddress(), supplier.getTemporaryAddress(),supplier.getEmail() ,supplier.getImage()});\n\t}", "int insert(MedicalOrdersExecutePlan record);", "int insert(EquipmentOrder record);", "void insert(Disproduct record);", "int insert(NjProductTaticsRelation record);", "int insert(SellType record);", "int insert(OpeningRequirement record);", "void insert(BnesBrowsingHis record) throws SQLException;", "@Override\r\n\tpublic int insertNewShop(Shop shop) {\n\t\treturn sm.insert(shop);\r\n\t}", "int insert(FinancialManagement record);", "public void insert(EmployeeEntity entity){\n EmployeeDB.getInstance().insertOrUpdate(entity);\n }", "public int insert(SfMaterialsTransfer record) {\n getSqlMapClientTemplate().insert(\"com.ufgov.zc.server.sf.dao.SfMaterialsTransferMapper.insert\", record);\r\n return 1;\r\n }", "int insert(AdminTab record);", "public void insertShardRow(String tableName, long shardId,\n String minValue, String maxValue) throws SQLException {\n PreparedStatement insertShardRowStatement = null;\n\n try {\n /* resolve this table's internal tableId */\n long tableId = fetchTableId(tableName);\n\n insertShardRowStatement =\n masterNodeConnection.prepareStatement(MASTER_INSERT_SHARD_ROW);\n insertShardRowStatement.setLong(1, tableId);\n insertShardRowStatement.setLong(2, shardId);\n insertShardRowStatement.setString(3, SHARD_STORAGE_TYPE);\n insertShardRowStatement.setString(4, minValue);\n insertShardRowStatement.setString(5, maxValue);\n\n insertShardRowStatement.executeUpdate();\n\n } finally {\n releaseResources(insertShardRowStatement);\n }\n }", "int insert(Assist_table record);", "private void insert(SymObject obj) {\n try {\n table.insert(obj);\n } catch (NameAlreadyExistsExcpetion ex) {\n error(obj.name + \" already declared\");\n }\n }", "int insert(Goods record);", "public void insert(Category record) throws SQLException {\r\n sqlMapClient.insert(\"CATEGORY.abatorgenerated_insert\", record);\r\n }", "public void addRow(String rowName);", "private void insert() {\n\t\tConfiguration conf = new Configuration();\n\t\tconf.configure(\"hibernate.cfg.xml\");\n\t\tSessionFactory sf = conf.buildSessionFactory();\n\t\tSession s = sf.openSession();\n\t\ts.beginTransaction();\n\n\t\tQuery query = s.createQuery(\"insert into OldStudent(id,name,grade) select s.id,s.name,s.grade from Student s\");\n\t\tint count = query.executeUpdate();\n\t\tSystem.out.println(\"Number of Rows inserted in the oldstudent table=\" + count);\n\n\t\ts.getTransaction().commit();\n\t\ts.clear();// s.evict() on all student objects in session\n\t\tsf.close();\n\t}", "int insert(Appraise record);", "public void insert(TbLotteryNum record) {\n getSqlMapClientTemplate().insert(\"tb_lottery_num.ibatorgenerated_insert\", record);\n }", "void insert(W_WORKING_TYPES record);", "public Hoppy insert(Hoppy hoppy, IdGenerateService<Long> idGenerateService) throws DataAccessException;", "int insert(TBBearPer record);", "public void moveToInsertRow() throws SQLException {\n\n try {\n debugCodeCall(\"moveToInsertRow\");\n checkClosed();\n insertRow = new Value[columnCount];\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }", "@Override\n\tpublic void insert(Connection c, Genre v) throws SQLException {\n\n\t}", "int insert(SupplyNeed record);", "int insert(Dish record);", "int addRow(RowData row_data) throws IOException;", "int insert(TbProductAttributes record);", "public int insert(){\n\t\tif (jdbcTemplate==null) createJdbcTemplate();\n\t\t jdbcTemplate.update(insertStatement, ticketId,locationNumber);\n\t\treturn ticketId;\n\t}", "@Override\n\tpublic void insert(RaceZipTbVo vo) throws SQLException {\n\t\t\n\t}", "int insert(Engine record);", "int insert(ParkCurrent record);", "void insert(XdSpxx record);", "public void addCertainRow(String bookname, String ISBN, String author, String description,\n String quantity, String publisher, String category)\n {\n String insertStr;\n try{\n\n insertStr=\"INSERT IGNORE INTO material (bookname, ISBN, author, description, quantity, publisher, category) VALUES(\"\n +quotate(bookname)+\",\"\n +quotate(ISBN)+\",\"\n +quotate(author)+\",\"\n +quotate(publisher)+\",\"\n +quotate(quantity)+\",\"\n +quotate(publisher)+\",\"\n +quotate(category)\n +\")\";\n\n stmt.executeUpdate(insertStr);\n\n } catch(Exception e){\n System.out.println(\"Error occurred in inserting data\");\n }\n return;\n }", "int insert(R_dept_trade record);", "int insert(Powers record);", "public void insert(List<T> entity) throws NoSQLException;", "public void absInsertRowAt(Vector row, int index) {\n if (row == null) {\n row = new Vector(getModel().getColumnCount());\n }\n ((DefaultTableModel) getModel()).insertRow(index, row);\n }", "public void setAddRowStatement(EdaContext xContext) throws IcofException {\n\n\t\t// Define the query.\n\t\tString query = \"insert into \" + TABLE_NAME + \n\t\t \" ( \" + ALL_COLS + \" )\" + \n\t\t \" values( ?, ?, ?, ? )\";\n\n\t\t// Set and prepare the query and statement.\n\t\tsetQuery(xContext, query);\n\n\t}", "int insert(TbFreightTemplate record);", "public void insert(AlManageOnAir record) {\r\n getSqlMapClientTemplate().insert(\"AL_MANAGE_ON_AIR.ibatorgenerated_insert\", record);\r\n }", "public long insertNewRow(){\n ContentValues initialValues = new ContentValues();\n initialValues.put(KEY_PAIN_ASSESSMENT_NUM, \"0\");\n initialValues.put(KEY_ANALGESIC_PRES_NUM, \"0\");\n initialValues.put(KEY_ANALGESIC_ADMIN_NUM, \"0\");\n initialValues.put(KEY_NERVE_BLOCK_NUM, \"0\");\n initialValues.put(KEY_ALTERNATIVE_PAIN_RELIEF_NUM, \"0\");\n long id = db.insert(DATA_TABLE, null, initialValues);\n\n String value = MainActivity.deviceID + \"-\" + id;\n updateFieldData(id, KEY_UNIQUEID, value);\n\n return id;\n }", "int insert(FinMonthlySnapModel record);", "public void insertRow(Vector<Row> _data) {\r\n if(!validTable()){\r\n System.out.println(\"Error:Table:insertRow: table invalid, nothing done\");\r\n return;\r\n }\r\n //inserts a row and updates indexes\r\n if(_data.size() == 0){\r\n System.out.println(\"Error:Table:insertRow: data to be inserted is empty, no data inserted\");\r\n return;\r\n }\r\n if(!rows.isEmpty() && _data.elementAt(0).getData().size() != rows.get(rows.keySet().iterator().next()).getData().size()){\r\n System.out.println(\"Error:Table:insertRow: data to be inserted is a mismatched size to existing data, no data inserted\");\r\n return;\r\n }\r\n for(Row r : _data) {\r\n String key = \"\";\r\n for(int i : primKeyIndexes)\r\n key = key + r.getDataAtIndex(i);\r\n rows.put(key, r);\r\n }\r\n }", "@Override\n\tpublic int insertTrading(TradingVO tvo) {\n\t\treturn sql.insert(\"insertTrading\", tvo);\n\t}", "public void onInsert(Statement insert, Connection cx, SimpleFeatureType featureType) throws SQLException {\r\n }", "@Override\n\tpublic void dbInsert(PreparedStatement pstmt) {\n\t\ttry \n\t\t{\n\t\t\tpstmt.setInt(1, getParent());\n\t\t\tpstmt.setInt(2, getParentType().getValue()); \t\t\t// owner_type\n\t\t\tpstmt.setString(3, this.predefinedPeriod.getKey() ); \t\t\t// period key\n\t\t\tpstmt.setDouble(4, this.getProductiveTime());\t\t\t\t\t\t// productive time\n\t\t\tpstmt.setDouble(5, this.getQtySchedToProduce());\t\t\t\t// Quantity scheduled to produce\n\t\t\tpstmt.setDouble(6, this.getQtyProduced());\t\t\t\t\t\t// Quantity produced\n\t\t\tpstmt.setDouble(7, this.getQtyDefective());\t\t\t\t\t\t// Quantity with rework or considered defective. \n\n\t\t\tpstmt.addBatch();\n\n\t\t} catch (SQLException e) {\n\t\t\tLogger logger = LogManager.getLogger(OverallEquipmentEffectiveness.class.getName());\n\t\t\tlogger.error(e.getMessage());\n\t\t\te.printStackTrace();\n\t\t}\t\t\n\n\t}" ]
[ "0.66590905", "0.64487076", "0.6426128", "0.6424614", "0.63212556", "0.62585485", "0.6244943", "0.6217628", "0.62010294", "0.6150046", "0.61017877", "0.6051438", "0.6046745", "0.6043105", "0.6025511", "0.5973245", "0.59585434", "0.59493893", "0.59400326", "0.5928541", "0.5869628", "0.5858463", "0.5833575", "0.5831095", "0.5819847", "0.58160967", "0.57995814", "0.57981724", "0.5787304", "0.576759", "0.5757405", "0.5744517", "0.57369584", "0.57352364", "0.5729564", "0.57257766", "0.57197833", "0.5718701", "0.57177407", "0.57155156", "0.5713738", "0.57118154", "0.57067657", "0.5704966", "0.5703454", "0.57017034", "0.56974787", "0.5697165", "0.56946003", "0.5687286", "0.5687286", "0.5686485", "0.5685052", "0.5680326", "0.5679776", "0.5674748", "0.56679094", "0.56422013", "0.5638455", "0.5635988", "0.5627294", "0.5626263", "0.561953", "0.5617913", "0.56088597", "0.5606633", "0.56045276", "0.5602088", "0.5601955", "0.56016207", "0.55969673", "0.55945736", "0.5583709", "0.55808854", "0.5577446", "0.5576374", "0.5574267", "0.5571843", "0.5567834", "0.55660117", "0.5565026", "0.55570704", "0.55535835", "0.5547929", "0.5537733", "0.5537215", "0.55351436", "0.55350035", "0.5534374", "0.5532379", "0.55182874", "0.551374", "0.55125606", "0.5512039", "0.55068845", "0.5502371", "0.54970646", "0.5495534", "0.54811335", "0.5479262", "0.5470455" ]
0.0
-1
message that was sent
public String toString() { return "[MessageSentConfirmation] - " + plate + ", " + state + ", " + text; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void messageSent();", "public void sendMsg(){\r\n\t\tsuper.getPPMsg(send);\r\n\t}", "public void messageSent(Message m) {\n\t\t\r\n\t}", "@Override\n\tpublic void sendMessage() {\n\t\t\n\t}", "void sendMessage() {\n\n\t}", "@Override\n\tpublic void send(String msg) {\n\t\t\n\t\t\n\t\n\t}", "public void messageSent(int messageId) {\n\r\n\t}", "protected void sendMessage(String msg) {\n message = msg; \n newMessage = true;\n }", "public void messageSent() {\n\tTrackedMessage.accumulateMap(TrackedMessage.unmapType(\n\t\tTrackedMessage.messagesSent, this.getClass()), this\n\t\t.getMessageType(), 1);\n\tTrackedMessage.accumulateMap(TrackedMessage.unmapType(\n\t\tTrackedMessage.bytesSent, this.getClass()), this\n\t\t.getMessageType(), TrackedMessage.objectSize(this));\n }", "Message getCurrentMessage();", "@Override\r\n\tpublic void sendMessage(String message) {\n\t\t\r\n\t}", "void messageSent(IMSession session, String messageId);", "java.lang.String getUserMessage();", "java.lang.String getMsg();", "@Override\n\tpublic void onSendChatDone(byte arg0) {\n\t\t\n\t}", "public void send(Message msg);", "java.lang.String getSender();", "java.lang.String getSender();", "java.lang.String getSender();", "java.lang.String getSender();", "java.lang.String getSender();", "java.lang.String getSender();", "@Override\n\tpublic void send(String msg) {\n\t}", "void sendMessage(String msg);", "java.lang.String getTheMessage();", "void onSendMessageComplete(String message);", "@Override public void handleMessage(Message msg) {\n super.handleMessage(msg);\n byte[] byteArray = (byte[]) msg.obj;\n int length = msg.arg1;\n byte[] resultArray = length == -1 ? byteArray : new byte[length];\n for (int i = 0; i < byteArray.length && i < length; ++i) {\n resultArray[i] = byteArray[i];\n }\n String text = new String(resultArray, StandardCharsets.UTF_8);\n if (msg.what == BluetoothTalker.MessageConstants.MESSAGE_WRITE) {\n Log.i(TAG, \"we just wrote... [\" + length + \"] '\" + text + \"'\");\n// mIncomingMsgs.onNext(text);\n } else if (msg.what == BluetoothTalker.MessageConstants.MESSAGE_READ) {\n Log.i(TAG, \"we just read... [\" + length + \"] '\" + text + \"'\");\n Log.i(TAG, \" >>r \" + Arrays.toString((byte[]) msg.obj));\n mIncomingMsgs.onNext(text);\n sendMsg(\"I heard you : \" + Math.random() + \"!\");\n// mReadTxt.setText(++ri + \"] \" + text);\n// if (mServerBound && mServerService.isConnected()) {\n// mServerService.sendMsg(\"I heard you : \" + Math.random() + \"!\");\n// } else if (mClientBound && mClientService.isConnected()) {\n// mClientService.sendMsg(\"I heard you : \" + Math.random() + \"!\");\n// }\n// mBluetoothStuff.mTalker.write();\n }\n }", "public boolean SendingMessage() {\n \t\t\treturn false;\n \t\t}", "public boolean message( Who sender, Message msg ) throws Exception;", "String getSender();", "public abstract void message();", "public void send() {\n\t}", "public void sendMessage(String message) {}", "@Override\n\tpublic void sendMsg(String msg) {\n\n\t}", "@Override\n public void send() {\n System.out.println(\"send message by SMS\");\n }", "public String sendMessage(){\n\t\tMessageHandler handler = new MessageHandler();\n\t\tSystem.out.println(this.senderName +\" \"+this.recieverName+ \" \" + this.subject +\" \"+this.message);\n\t\t\n\t\tif((handler.addNewMessage(this.senderName, this.recieverName, this.subject,this.message))){\n\t\t\tFacesContext context = FacesContext.getCurrentInstance();\n\t\t\tcontext.addMessage(null,new FacesMessage(FacesMessage.SEVERITY_INFO, \"Message:Sent\",\"Sent\"));\n\t\t\tcontext.getExternalContext().getFlash().setKeepMessages(true);\n\t\t\treturn mainXhtml;\n\t\t}else{\n\t\t\t FacesContext.getCurrentInstance().addMessage(null,new FacesMessage(FacesMessage.SEVERITY_ERROR, \"Message:Failed to send\",\"Failed to Send\"));\n\t\t\tSystem.out.println(\"Message not sent\");\n\t\t\treturn null;\n\t\t}\n\t\n\t}", "@Override\n\tpublic void onMessageRecieved(Message arg0) {\n\t\t\n\t}", "public void sendMessage()\r\n {\r\n MessageScreen messageScreen = new MessageScreen(_lastMessageSent);\r\n pushScreen(messageScreen);\r\n }", "@Override\n\tpublic void SendMessage() {\n\t\tSystem.out.println( phoneName+\"'s SendMessage.\" );\n\t}", "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 writeMassege() {\n m = ChatClient.message;\n jtaChatHistory.setText(\"You : \" + m);\n //writeMassageServer();\n }", "public String getMsg() { return this.msg; }", "String getRawMessage();", "@Override\n public void handleMessage(Message msg) {\n System.out.println(\"recibe mensajes ...\");\n System.out.println(msg.obj);\n }", "public void sendMessage(String message);", "public void send_message(){\n logical_clock++;\n System.out.println(\"Send Message Clock:\" +logical_clock);\n encrypt(logical_clock);\n\n }", "private String requesttosend() throws IOException {\n\t\tsender.sendMsg(Constants.REQSEND);\r\n\t\t//等待接收的返回状态\r\n\t\treturn sender.getMsg();\r\n\t}", "public String message() {\n return _msg;\n }", "@Override\n\tpublic void messageSent(IoSession arg0, Object arg1) throws Exception {\n\n\t}", "@Override\n\tpublic void messageSent(IoSession arg0, Object arg1) throws Exception {\n\n\t}", "public void afficherMessage();", "@Override\n\tpublic void send() {\n\t\tSystem.out.println(\"this is send\");\n\t}", "public void onRecieve(RoundTimeMessage message) {\n\n\n }", "private void sendMessage(ChatMessage msg) {\n try {\n sOutput.writeObject(msg);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "void send(String message);", "public void sendMsg(Message msg){\n messagesParser.sendMsg(msg);\n }", "private void sendMessage(String content, String room) {\n }", "@Override\n\tpublic void msgAtFrige() {\n\t\t\n\t}", "public abstract void sendMessage(String message);", "public void getMessage() {\n\r\n\t}", "private void viewMessage()\n {\n System.out.println( inbox );\n inbox = \"\";\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 }", "private void sendMsg()\n {\n try {\n spauldingApp.println(\"AckRequest.sendMsg() - sending request to nodeID= \" + node.getNodeID() + \" ...\");\n this.nbrTransmits++;\n //spauldingApp.eventLogger.writeMsgSentPing(fetchReqMsg);\n spauldingApp.getMoteIF().send(node.getNodeID(), requestMsg);\n } catch (Exception e) {\n spauldingApp.println(\"ERROR: Can't send message: \" + e);\n e.printStackTrace();\n }\n }", "public int getMsgType(){\r\n return localMsgType;\r\n }", "public void onChatMessageSent(String message, String errorMessage);", "@Override\r\n public void handleMessage(Message msg) {\n }", "private Message sendMSG(Message message){\n Message reply = null;\n try {\n reply = coms.sendMessage(message);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return reply;\n }", "public String getCommandSent() {\n return commandSent;\n }", "public String message() {\r\n\t\treturn message;\r\n\t}", "@Override\n\tpublic void getMessage(TranObject msg) {\n\n\t}", "@Override\r\n\tpublic boolean send(String msg) {\n \ttry {\r\n \t\tsendMessage(msg);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "@Override\n\tpublic String sendMsg1() {\n\t\treturn null;\n\t}", "@Override\n public void run() {\n Message message = new Message();\n message.what = 4;\n handler.sendMessage(message);\n }", "com.polytech.spik.protocol.SpikMessages.SendMessage getSendMessage();", "Payload getMsg();", "@Override\n\tpublic void messageReceived(Message message) {\n\t\tappend(String.format(\"<%s> %s\",message.getSource().getName(),message.getMessage().toString()));\n\t}", "public long message(User from, String msg) throws RemoteException;", "public abstract void stickerMessage(Message m);", "public void send (final TCNetworkMessage message) {\n if (channelSessionID == ((DSOMessageBase)message).getLocalSessionID()) {\n super.send(message); \n } else {\n logger.info(\"Drop old message: \"+ ((DSOMessageBase)message).getMessageType() + \" Expected \"+ channelSessionID + \" but got \" + ((DSOMessageBase)message).getLocalSessionID());\n }\n }", "void send();", "@Override\n\tpublic void onMessage(Message message) {\n\t\tSystem.out.println(message.getBody());\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 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 String process(String msg) {\n return msg;\n }", "void sendMessage(String msg) {\n\t\ttry {\n\t\t\tout.writeObject(msg);\n\t\t\tout.flush();\n\t\t\tSystem.out.println(\"Sending to server => \" + msg);\n\t\t} catch (IOException ioException) {\n\t\t\tioException.printStackTrace();\n\t\t}\n\t}", "abstract void message(String message);", "@Override\n public String getMessage() {\n String result =\"Audio Message {\\n\";\n result +=\"\\tID: \"+ID+\"\\n\";\n result +=\"\\tBuffer Size: \"+bufferSize+\"\\n\";\n result +=\"}\";\n \n return result;\n }", "public abstract void message(String channel, String message);", "public void send(String msg) {\n msgs.push(msg);\n lastMessageSentAt = game.ticks;\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}", "public boolean isSent(){\t\n\t\treturn sent;\n\t}", "public abstract void messageReceived(String message);", "@Override\n public String getMsg() {\n return this.msg;\n }", "private void send() {\n Toast.makeText(this, getString(R.string.message_sent, mBody, Contact.byId(mContactId).getName()),\n Toast.LENGTH_LONG).show();\n finish(); // back to DirectShareActivity\n }", "@Override\n public boolean sendMessage(ChatMessage chatMessage){\n return true;\n }", "@Override\n public void handleMessage(Message message) {}", "public void sendMessage(String message) {\n try {\n bos.write(message);\n bos.newLine();\n bos.flush();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void processMessage(Chat chat, Message message)\n {\n }", "public void sendMessage(String message){\n pw.print(message);\n pw.flush();\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}", "@Override\r\n\t\t\t\t// here the messageReceived method is implemented\r\n\t\t\t\tpublic void messageReceived(String message) {\n\t\t\t\t\tpublishProgress(message);\r\n\t\t\t\t\t// serverMessage[0] = message;\r\n\r\n\t\t\t\t\tserverMessage[count] = message;\r\n\r\n\t\t\t\t\t// count++;\r\n\t\t\t\t\tLog.i(\"TAG\", count + \"辞獄拭辞 閤精 葵: \" + serverMessage[count]);\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * Log.i(\"TAG\", \"0腰属閤精 葵: \" + serverMessage[0]);\r\n\t\t\t\t\t * Log.i(\"TAG\", \"1腰属 閤精 葵: \" + serverMessage[1]);\r\n\t\t\t\t\t */\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t}" ]
[ "0.7821381", "0.7239182", "0.72121537", "0.7002425", "0.6811376", "0.67827564", "0.6742555", "0.67381823", "0.6704512", "0.6703085", "0.6701124", "0.6684528", "0.6663792", "0.665708", "0.66329753", "0.66194254", "0.6608093", "0.6608093", "0.6608093", "0.6608093", "0.6608093", "0.6608093", "0.65893143", "0.65734935", "0.6556766", "0.65553004", "0.65551126", "0.65465057", "0.65196097", "0.6519054", "0.6515158", "0.6512208", "0.6501259", "0.64970386", "0.6487632", "0.6483505", "0.6480151", "0.6473861", "0.6471664", "0.646879", "0.6465749", "0.6454315", "0.6453271", "0.64152104", "0.6409758", "0.64079916", "0.63935083", "0.63888395", "0.63679945", "0.63679945", "0.6350439", "0.6345537", "0.6334324", "0.63331", "0.63232553", "0.6315414", "0.6299731", "0.6288937", "0.6275706", "0.62690526", "0.6263155", "0.62567055", "0.62553525", "0.625228", "0.6251031", "0.6249715", "0.62429917", "0.6240633", "0.6238567", "0.6238083", "0.6225387", "0.62210894", "0.62109673", "0.6206382", "0.6197522", "0.619536", "0.61949027", "0.61925817", "0.6192313", "0.61905724", "0.61864656", "0.6165658", "0.61648107", "0.61595845", "0.6157318", "0.615079", "0.6145736", "0.61453307", "0.61440545", "0.6143007", "0.6138716", "0.6137507", "0.6125359", "0.6124868", "0.61228323", "0.61215734", "0.611956", "0.6119096", "0.61183286", "0.61155164", "0.6113076" ]
0.0
-1
Leader leader = new Leader(" L 3 4 21 GD Tilly "); System.out.println(leader.getLine());
public static void main(String[] args) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void findLeader(String fileName) {\n\t\ttry {\n\t\t\tBufferedReader br = new BufferedReader(new FileReader(fileName));\n\t\t\tString line;\n\n\t\t\t// Find Reader (1): First instruction of program\n\t\t\tline = br.readLine();\n\t\t\tLeaders.put(lineCount, line);\n\t\t\tlineCount++;\n\n\t\t\twhile ((line = br.readLine()) != null) {\n\t\t\t\t// Find Reader (2): Target instruction of branch\n\t\t\t\tif (line.charAt(0) == '$') {\n\t\t\t\t\tLeaders.put(lineCount, line);\n\n\t\t\t\t}\n\t\t\t\t// Find Reader (3): Next instruction of branch instruction\n\t\t\t\telse if (line.charAt(12) == 'j') {\n\t\t\t\t\tline = br.readLine();\n\t\t\t\t\tlineCount++;\n\t\t\t\t\tLeaders.put(lineCount, line);\n\t\t\t\t}\n\t\t\t\tlineCount++;\n\t\t\t}\n\n\t\t\ttotalLineNum = lineCount - 1;\n\t\t\tlineCount = 1;\n\n\t\t\t// Print Leaders\n\t\t\tSystem.out.println(\"------------------ Leader ------------------\");\n\t\t\tleaderLineNum = new int[Leaders.size() + 1];\n\t\t\tint leaderNumber = 0;\n\t\t\tfor (int i = 1; i <= totalLineNum; i++) {\n\t\t\t\tif (Leaders.containsKey(i)) {\n\t\t\t\t\tSystem.out.printf(\"%3d: %s\\n\", i, Leaders.get(i));\n\t\t\t\t\tleaderLineNum[leaderNumber] = i;\n\t\t\t\t\tleaderNumber++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tleaderLineNum[leaderLineNum.length - 1] = totalLineNum;\n\n\t\t\tbr.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"::: I/O error\");\n\t\t\tSystem.exit(1);\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"::: I/O error\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t}", "public static String lineLeader(String s1, String s2, String s3) {\n\t\tint divider = 0;\n\t\tString name1;\n\t\tString name2;\n\t\tString name3;\n\t\tString leader = null;\n\tfor (int i = 1; i < s1.length(); i++) {\n\t\tif(i!= s1.length()-1) {\n\t\tif(s1.charAt(i)==' ' && s1.charAt(i-1) != ' ' && s1.charAt(i+1) != ' ') {\n\t\t\tdivider=i;\t\n\t\t\t}\n\t\t}\n\t}\t\n\tname1=s1.substring(divider);\n\t\n\tfor (int i = 1; i < s2.length(); i++) {\n\t\tif(i != 0 && i!= s2.length()-1) {\n\t\tif(s2.charAt(i)==' ' && s2.charAt(i-1) != ' ' && s2.charAt(i+1) != ' ') {\n\t\t\t\n\t\t\tdivider=i;\t\n\t\t\t}\n\t\t}\n\t}\t\n\tname2=s2.substring(divider);\n\t\n\tfor (int i = 1; i < s3.length(); i++) {\n\t\tif(i != 0 && i!= s3.length()-1) {\n\t\tif(s3.charAt(i)==' ' && s3.charAt(i-1) != ' ' && s3.charAt(i+1) != ' ') {\n\t\t\t\n\t\t\tdivider=i;\t\n\t\t\t}\n\t\t}\n\t}\t\n\tname3=s3.substring(divider);\n\t\tif(name1.compareTo(name2)<0 && name1.compareTo(name3)<0) {\n\t\t\tleader= s1;\n\t\t} else if(name2.compareTo(name3)<0 && name2.compareTo(name1)<0) {\n\t\t\tleader= s2;\n\t\t} else if(name3.compareTo(name1)<0 && name3.compareTo(name2)<0) {\n\t\t\tleader= s3;\n\t\t} \n leader=leader.trim();\n\t\treturn leader;\n\t}", "public String toString() {\r\n return \"\\n\\nTrainer: \"+ name + \", Wins: \" + win + \", team:\" + team;\r\n }", "private String getLeaderValue() {\n return new StringBuilder(Global.FIXED_LEADER_LENGTH)\n .append(Global.RECORD_STATUS_CODE)\n .append(Global.RECORD_TYPE_CODE)\n .append(Global.BIBLIOGRAPHIC_LEVEL_CODE)\n .append(Global.CONTROL_TYPE_CODE)\n .append(Global.CHARACTER_CODING_SCHEME_CODE)\n .append(Global.FIXED_LEADER_BASE_ADDRESS)\n .append(Global.ENCODING_LEVEL)\n .append(Global.DESCRIPTIVE_CATALOGUING_CODE)\n .append(Global.LINKED_RECORD_CODE)\n .append(Global.FIXED_LEADER_PORTION)\n .toString();\n }", "public static String retrieveLeaderBoard() {\n JSONObject obj = new JSONObject();\n try\n {\n obj.put(\"type\", \"retrieveLeaderBoard\");\n outWriter.println(obj);\n return inReader.readLine().toString();\n }\n catch (Exception exc)\n {\n //TODO: Raise exceptions through the ExceptionHandler class.\n System.out.println(\"Connection check username available error: \" + exc.toString());\n return \"\";\n }\n }", "public Game()\n {\n Scanner userInput = new Scanner(System.in); // Create a Scanner object\n System.out.println(\"Get player name\"); \n playerName = userInput.nextLine(); \n }", "public static String lineLeader(String s1, String s2, String s3) {\n \ts1 = s1.trim();\n \ts2 = s2.trim();\n \ts3 = s3.trim();\n \tString[] t = {s1, s2, s3};\n \tString[] s = t.clone();\n \tfor(int i = 0; i<s.length; i++) {\n \t\ts[i] = s[i].substring(s[i].indexOf(\" \")+1);\n \t}\n \tint index = 0;\n \tfor(int i = 0; i<s.length; i++) {\n \t\tif(s[i].compareTo(s[index])<0) {\n \t\t\tindex = i;\n \t\t}\n \t}\n return t[index];\n }", "String getLine();", "Peer getLeader() {\n return leader;\n }", "public String getLine();", "public static void actName() {\n System.out.println(\"Who is your favorite actor or actress? \");\n String actorName = sc.nextLine();\n }", "public static void main(String[] args){\n SentenceParser sp = new SentenceParser (\"Peas and carrots and potatoes.\");\n System.out.println(sp);\n //then print your results\n \n\n }", "public String toString(){\n return player.toString() + \"\\nGained a new Skill\";\n }", "public String getProjectLeader() {\n return projectLeader;\n }", "public static String lineLeader(String s1, String s2, String s3) {\n\t\t\n\t\tString[] last1 = s1.split(\"\");\n\t\tString[] last2 = s2.split(\"\");\n\t\tString[] last3 = s3.split(\"\");\n\t\t\n\t\t\n\t\tString char1 = null;\n\t\tString char2 = null;\n\t\tString char3 = null;\n\t\t\n\t\tString[] abcs = {\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\",\"L\",\"M\",\"N\",\"O\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\"};\n\t\t\n\t\tfor (int i = 2; i < last1.length; i++) {\n\t\t\tif(!last1[i].equals(\" \") && last1[i - 1].equals(\" \") && !last1[i - 2].equals(\" \")) {\n\t\t\t\tchar1 = last1[i];\n\t\t\t\t//System.out.println(char1);\n\t\t\t}\n\n\t\t}\n\t\tfor (int i = 2; i < last2.length; i++) {\n\n\t\t\tif(!last2[i].equals(\" \") && last2[i - 1].equals(\" \") && !last2[i - 2].equals(\" \")) {\n\t\t\t\tchar2 = last2[i];\n\t\t\t\t//System.out.println(char2);\n\n\t\t\t}\n\n\t\t}\n\t\tfor (int i = 2; i < last3.length; i++) {\n\n\t\t\tif(!last3[i].equals(\" \") && last3[i - 1].equals(\" \") && !last3[i - 2].equals(\" \")) {\n\t\t\t\tchar3 = last3[i];\n\t\t\t\t//System.out.println(char3);\n\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i < abcs.length; i++) {\n\t\t\tif(char1.contains(abcs[i])) {\n\t\t\t\t//System.err.println(s1.replaceAll(\" \", \"\").substring(0, s1.replaceAll(\" \", \"\").length()-1) + \" \" + char1);\n\t\t\t\treturn s1.replaceAll(\" \", \"\").substring(0, s1.replaceAll(\" \", \"\").length()-1) + \" \" + char1;\n\t\t\t}\n\t\t\tif(char2.contains(abcs[i])) {\n\t\t\t\t//System.err.println(s2.replaceAll(\" \", \"\").substring(0, s2.replaceAll(\" \", \"\").length()-1) + \" \" + char2);\n\n\t\t\t\treturn s2.replaceAll(\" \", \"\").substring(0, s2.replaceAll(\" \", \"\").length()-1) + \" \" + char2;\n\t\t\t}\n\t\t\tif(char3.contains(abcs[i])) {\n\t\t\t\t///System.err.println(s3.replaceAll(\" \", \"\").substring(0, s3.replaceAll(\" \", \"\").length()-1) + \" \" + char3);\n\t\t\t\treturn s3.replaceAll(\" \", \"\").substring(0, s3.replaceAll(\" \", \"\").length()-1) + \" \" + char3;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn null;\n\t\t\n\t}", "public String leaderIndex() {\n return leaderIndex;\n }", "public static FeatureNode getPhraseLeader(FeatureNode fn)\n\t{\n\t\tif (fn == null) return null;\n\t\tfn = fn.get(\"phr-head\");\n\t\tif (fn == null) return null;\n\t\tfn = fn.get(\"phr-leader\");\n\t\tif (fn == null) return null;\n\t\tfn = fn.get(\"nameSource\");\n\t\treturn fn;\n\t}", "public void showTrainers(){\r\n System.out.println(\"Trainer: \"+this.lastName.toUpperCase()+\" \"+this.firstName.toUpperCase()+\" ,with subject: \"+\r\n this.subject.getStream().getTitle().toUpperCase());\r\n }", "String getLine (int line);", "public static void main(String[] args) throws IOException {\n\n int scoresCount = scanner.nextInt();\n scanner.skip(\"(\\r\\n|[\\n\\r\\u2028\\u2029\\u0085])?\");\n\n int[] scores = new int[scoresCount];\n\n String[] scoresItems = scanner.nextLine().split(\" \");\n scanner.skip(\"(\\r\\n|[\\n\\r\\u2028\\u2029\\u0085])?\");\n\n for (int i = 0; i < scoresCount; i++) {\n int scoresItem = Integer.parseInt(scoresItems[i]);\n scores[i] = scoresItem;\n }\n\n int aliceCount = scanner.nextInt();\n scanner.skip(\"(\\r\\n|[\\n\\r\\u2028\\u2029\\u0085])?\");\n\n int[] alice = new int[aliceCount];\n\n String[] aliceItems = scanner.nextLine().split(\" \");\n scanner.skip(\"(\\r\\n|[\\n\\r\\u2028\\u2029\\u0085])?\");\n\n for (int i = 0; i < aliceCount; i++) {\n int aliceItem = Integer.parseInt(aliceItems[i]);\n alice[i] = aliceItem;\n }\n\n int[] result = climbingLeaderboard(scores, alice);\n for (int i = 0; i < result.length; i++) {\n \tSystem.out.print(result[i]+\" \");\n }\n\n// for (int i = 0; i < result.length; i++) {\n// bufferedWriter.write(String.valueOf(result[i]));\n//\n// if (i != result.length - 1) {\n// bufferedWriter.write(\"\\n\");\n// }\n// }\n//\n// bufferedWriter.newLine();\n//\n// bufferedWriter.close();\n\n scanner.close();\n }", "String getLine ();", "public String getLine ()\n {\n return line;\n }", "public Athlete()\r\n{\r\n this.def = \"An athlete is said to be running when he/she is accelerating in a certain direction during which his legs and the rest of his body are moving\";\r\n}", "public\nstatic\nvoid\nmain(String[] args) \n\n{ \n\nLeadersInArray lead = \nnew\nLeadersInArray(); \n\nint\narr[] = \nnew\nint\n[]{\n16\n, \n17\n, \n4\n, \n3\n, \n5\n, \n2\n}; \n\nint\nn = arr.length; \n\nlead.printLeaders(arr, n); \n\n}", "private static String getName(){\r\n\t\treturn new StringBuilder(input.next()).substring(0,3);\r\n\t}", "public String getUserDecision(){\n return input.nextLine();\n }", "public NameSurferEntry(String line) {\n\t\tthis.ranksOfName = new int[NDECADES];\n\t\tArrayList<String> parts = split(line);\n\t\tthis.name = parts.get(0);\n\t\t\n\t\tfor(int i = 1; i < parts.size(); i++) {\n\t\t\tString numberString = parts.get(i);\n\t\t\tint number = Integer.parseInt(numberString); \n\t\t\tranksOfName[i - 1] = number;\n\t\t}\n\t}", "public void sentence(){\n \n System.out.println(\"Your first boyfriend's name was \" + getName() + \".\\n\");\n }", "private String getLastName() {\n System.out.println(\"Enter Your Last Name Of First Letter In Capital \");\n return sc.next();\n }", "public static void main(String[] args) {\n \n Profesor a = new Profesor(\"Juan Hernández\",\"Garcia\",\"22-387-11\");\n System.out.println(a);\n \n }", "public static void main(String[] args) {\n Student terrel = new Student(\"Terrel\", 50, 1, 4.0);\n\n// terrel.setName(\"Terrel\");\n// terrel.setGpa(4.0);\n\n System.out.println(terrel.getName() + \" \" + terrel.getNumberOfCredits() + \" \" +terrel.getGpa());\n }", "void setLeader(Genome leader);", "public static void viewLeaderBoard()\n\t{\n\t}", "void convertToLeader() {\n state = InstanceState.LEADER;\n controller = new LeaderController(this, executor, clock, transport);\n }", "public static void main(String[] args) throws IOException {\n//\n// int playerCount = Integer.parseInt(bufferedReader.readLine().trim());\n//\n// List<Integer> player = Stream.of(bufferedReader.readLine().replaceAll(\"\\\\s+$\", \"\").split(\" \"))\n// .map(Integer::parseInt)\n// .collect(toList());\n\n List<Integer> ranked = new ArrayList<>();\n ranked.add(100); ranked.add(90); ranked.add(90); ranked.add(80); ranked.add(75); ranked.add(60);\n List<Integer> player = new ArrayList<>();\n player.add(50); player.add(65); player.add(77); player.add(90); player.add(102);\n\n List<Integer> result = climbingLeaderboard(ranked, player);\n\n// bufferedWriter.write(\n// result.stream()\n// .map(Object::toString)\n// .collect(joining(\"\\n\"))\n// + \"\\n\"\n// );\n//\n// bufferedReader.close();\n// bufferedWriter.close();\n }", "public String printAuthor(){\n System.out.println();\n return author;\n }", "public static void main(String[] args) {\nScanner sc= new Scanner(System.in);\nString name=sc.nextLine();\n\t\tSystem.out.println(\"hello\\n\"+name);\n\t\t\n\t}", "@Override\r\n//displays the property of defensive players to console\r\npublic String toString() {\r\n\t\r\n\tdouble feet = getHeight()/12;\r\n\tdouble inches = getHeight()%12;\r\n\t\r\n\treturn \"\\n\" + \"\\nDefensive Player: \\n\" + getName() \r\n\t+ \"\\nCollege: \" + getCollege() \r\n\t+ \"\\nHighschool: \" + getHighschool() \r\n\t+ \"\\nAge: \" + getAge() \r\n\t+ \"\\nWeight: \" + getWeight() \r\n\t+ \"\\nHeight: \" + feet + \" ft\" + \" \" + inches + \" in\" \r\n\t+ \"\\nTeam Number: \" + getNumber() \r\n\t+ \"\\nExperience: \" + getExperience()\r\n\t+ \"\\nTeam: \" + getTeam() \r\n\t+ \"\\nPosition: \" +getPosition() \r\n\t+ \"\\nTackles : \" + getTackles() \r\n\t+ \"\\nSacks: \" +getSacks() \r\n\t+ \"\\nInterceptions: \" + getInterceptions();\r\n}", "public String getClusterLeader() throws RemoteException;", "public GetMembers(String fn,String ln){\r\n\t\tfname = fn;\r\n\t\tlname = ln;\r\n\t\tmembers ++;\r\n\t\t\r\n\t\tSystem.out.printf(\"Constructor for %s %s, Members in the club %d.\\n\", fname,lname,members);\r\n\t}", "public static void main(String[] args) throws IOException {\n// System.out.println(\"Enter Your Name : \");\r\n// String nm=br.readLine();\r\n// //int a=Integer.valueOf(br.readLine());\r\n// System.out.println(\"Welcome \"+nm);\r\n// \r\n\r\n \r\n }", "public int getLine();", "public int getLine();", "public int getLine();", "public static void leaders(int[] input) {\n\n\t\tfor (int i=0; i < input.length; i++) {\n boolean leader = true;\n int candidate = input[i];\n // check if it's a leader\n int j = i+1;\n while (j<input.length) {\n if (input[j] > input[i]) {\n leader = false;\n break;\n }\n j++;\n }\n if (leader==true) {\n System.out.print(candidate+\" \");\n }\n }\n\t}", "public void showLeaderboard (String identifier) {\n\t\tshowLeaderboard(identifier, GPGLeaderboardTimeScope.GPGLeaderboardTimeScopeAllTime);\n\t}", "public static void userName() {\n System.out.println(\"Please enter your name: \");\n String name = sc.nextLine(); \n System.out.println(\"Hello, \" + name);\n }", "public String getNextRoundLeader(int a_round)\n {\n int i = 0;\n for (; i < m_roundLeaders.size(); i++)\n {\n if (getInitiator().equals(m_roundLeaders.get(i)))\n break;\n }\n int index = (i + a_round) % m_roundLeaders.size();\n String g = (String) m_roundLeaders.get(index);\n return g;\n }", "public static void main(String[] args) {\n\t\tString[] split = fr.nextLine().split(\",\");\n\t\tint budget = fr.nextInt();\n\t\tint p = fr.nextInt();\n\t\tint psize = fr.nextInt();\n\t\tCandidateCode mp = new CandidateCode(split[0], split[1], p, budget);\n\t\tSystem.out.println(mp.start());\n\t}", "public String getPlayername(Player player) {\n System.out.println(\"――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――\");\n System.out.println(\"Merci de d'indiquer le nom du joueur \"+player.getColor().toString(false)+\" : \");\n String name = readInput.nextLine();\n return name;\n }", "public static void main(String[] args) {\n\t\tPerson John = new Person(\"John\",1957);\r\n\t\tJohn.display();\r\n\t\tJohn.Senority();\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "public void display() {\n\tSystem.out.println(\"student id is \"+studentid+\"\\t\"+\"student name is \"+studentName+\"\\t\"+\"marks is \"+marks);\r\n}", "public First()\r\n{\r\n\tScanner in = new Scanner(System.in);\r\n\tSystem.out.println(\"Enter your First Name: \");\r\n\tthis.fname=in.next();\r\n\tSystem.out.println(\"Enter your Last Name: \" );\r\n\tthis.lname=in.next();\t\r\n\tSystem.out.println(\"Enter Your GradeYear :\\n [1]Freshman \\n[2] Sophomore \\n[3] Junior \\n[4] Senior \\n\");\r\n\tthis.gradeyear=in.nextInt();\t\r\n\tsetStudentId();\r\n\tSystem.out.println(\"Name: \"+fname+\" \"+lname+\"\\nGrade-year: \"+gradeyear+\"\\nStudentID: \"+student_id+\"\");\r\n\tSystem.out.print(\"\\nEnter Your Course Name: \");\r\n}", "private String getFirstName() {\n System.out.println(\"Enter Your Last Name Of First Letter In Capital \");\n return sc.next();\n }", "public int getLine() { return cl; }", "public void leaderElection () {\n leaderID++;\n if (leaderID > numServers) {\n leaderID = 1;\n }\n if (isLeader()) {\n leader = new Leader(combine(index, Constants.LEADER), this,\n acceptors, replicas);\n leader.start();\n } else {\n leader = null;\n }\n }", "public void displayLeaderCards() {\n int i = 1;\n for (LeaderCard card : leaderCards) {\n String toDisplay = i + \" \" + card.getName() + \" -> cost: \" +\n card.getActivationCost() +\" : \" + card.getCardCostType();\n if (card.isActivated()) {\n toDisplay += \" activated\";\n }\n this.sOut(toDisplay);\n i++;\n }\n }", "public static void main(String[] args) {\n\n\t\n\tAthlete a1 = new Athlete(\"bob\", 5);\n\t\n\tAthlete a2 = new Athlete(\"randy\", 3);\n\t\n\ta1.raceLocation = \"New Jersey\";\n\t\n\tSystem.out.println(a1.name + \":\" + bibNumber + \", \" + a1.raceLocation);\n\tSystem.out.println(a2.name + \":\" + bibNumber + \", \" + a2.raceLocation);\n\t\n\t\n\t\n}", "public static void main(String[] args) {\n Student ram = new Student();\n \n ram.setRollNumber(202);\n ram.setStudentName(\"Rakshitha\");\n ram.setMarkScored(-98);\n ram.setEmail(\"rakshitha@abc.com\");\n \n \n System.out.println(ram.getMarkScored());\n \n Student shyam = new Student(203,\"Shyam\",97,\"shyam@abc.com\");\n \n System.out.println(shyam.getStudentName());\n System.out.println(shyam.getMarkScored());\n\t}", "public void roar() {\n System.out.print(name + \", age \" + getAge() + \", says: Roar!\");\n }", "int getLine();", "public String getLine(int line) {\n if (line > 14)\n return null;\n if (line < 0)\n return null;\n return getOrCreateTeam(line).getValue();\n }", "private static String authorLine()\n {\n return String.format(STR_FORMAT_1 + STR_FORMAT_2, NAME_STR, NAME);\n }", "public void printAssistants(Player player);", "public Leaderboard() {\n filePath = new File(\"Files\").getAbsolutePath();\n highScores = \"scores\";\n\n topScores = new ArrayList<>();\n topName = new ArrayList<>();\n }", "public static void main(String[] args) \n {\n BaseballStats player1 = new BaseballStats(\"Daeho Kim\",\"Giants\"); \n FootballStats player2 = new FootballStats(\"Doug Baldwin\",\"Seahawks\"); \n \n player1.score();\n player1.hit();\n player1.setError();\n player1.hit();\n player2.score();\n player2.gainYard(10);\n \n System.out.println(player1);\n System.out.println(player2);\n }", "@Override\r\n public void isLeader() {\n }", "public static void main(String[] args) {\nString name;\nScanner s=new Scanner(System.in);\n\tSystem.out.println(\"Please enter your first name: \");\n\tname=s.next();\n\tSystem.out.println(name+\", Welcome\");}", "private static void Firstcommentary() {\n\t\tSystem.out.println(\" Sachin Scored highest Score \");\n\t\t\n\t}", "public CommandLine getLine() {\n return line;\n }", "public static String Editor(String username){\n\t\tString main = username+\" \";\n\t\tScanner input = new Scanner(System.in);\n\t\tSystem.out.println(\"Enter your first and last name(for example: John Lennon):\");\n\t\tmain+=input.nextLine()+\" \";\n\t\tSystem.out.println(\"Enter your date of birth (as MM/DD/YYYY)\");\n\t\tmain+=input.nextLine()+\" \";\n\t\tSystem.out.println(\"Enter your bank name and account number (as BANKOFMARS-10789)\");\n\t\tmain+=input.nextLine()+\" \";\n\t\tSystem.out.println(\"Enter your social security number (as 109382193)\");\n\t\tmain+=input.nextLine();\n\t\tSystem.out.println(\"Your new information has been saved\");\n\t\treturn main;\n\n\t}", "public void makeAnnouncement(){\n String announcement = \"Welcome to BlackJack! Please read the following rules carefully:\" + \"\\n\"\n + \"The min bet is $\" + minBet + \". The max bet is $\" + maxBet + \"!\" + \"\\n\"\n + \"The min required player number is \" + minPlayer + \". The max allowed player number is \" + maxPlayer + \"!\" + \"\\n\"\n + \"Your initial property is $100!\";\n System.out.println(announcement);\n }", "NodeId getLeaderId();", "public static void main(String args[]){\n Student Student1 = new Student (\"Josh\", 80);\n System.out.println(Student1.getGrade());\nSystem.out.println(Student1);\n }", "public static void main(String[] args) {\n\t\t\n\t\tPerson emp3 = new Employee(\"Ram\", 43, \"Male\", \"Hispanic\", 150, \"Engineer\");\n\t\tSystem.out.println((emp3.toString()));\n\t\tSystem.out.println(emp3.getRace());\n\n\t}", "private Creature findLeader(Game game){\n Creature lead = facCreatures.firstElement();\n // App.log(\"Leader of \" + fFaction.getName() + \" is \" + lead);\n return lead;\n }", "private void consoleWelcome()\n {\n welcomePartOne();\n\n Scanner reader = new Scanner(System.in);\n String playerName = reader.nextLine();\n player.playerName = playerName;\n \n welcomePartTwo();\n }", "public String invLine()\n {\n return \" > You are carrying a hot cup of COFFEE ~ Just the thing to wake you up!\";}", "public HighScore (int score)\n {\n this.name = \"P'ngball Grandmaster\";\n this.score = score;\n this.level = \"level 1\";\n }", "public static void main(String[] args) {\n\t\tEncapsulation player1 = new Encapsulation(\"215356\");\n\t\tplayer1.setName(\"cedi\");\n\t\tplayer1.setAge(22);\n\t\t//player1.setIdNum(\"23\");\n\t\t\n\t//System.out.println(String.format(\"%s with id number:%s is %d year old %s\",player1.getName(),player1.getIdNum(),player1.getAge(),player1.getAdress()));\n // System.out.println(player1.age); age is private variable\n\t\t//System.out.println(player1.adress); //adress is not private\n\t}", "public HighScore ()\n {\n this.name = \"P'ngball Grandmaster\";\n this.score = 0;\n this.level = \"level 1\";\n }", "public static void main(String[] args) throws Exception {\n BufferedReader input = new BufferedReader(new InputStreamReader(System.in));\n\n //declare variables\n String roll,name,interest;\n\t\n //accept data\n System.out.println(\"Enter Name: \");\n name = input.readLine();\n\n //accept roll\n System.out.println(\"Enter roll num: \");\n roll = input.readLine();\n\n //accept interest\n System.out.println(\"field of interest: \");\n interest = input.readLine();\n\n //print information\n System.out.println(\"\\nEntered info: \");\n System.out.println(\"My name is \" + name + \" and my roll number is \" + roll + \". My field of interest is \"+ interest);\n\n }", "public static void main(String[] args) {\n Opgave3 u = new Opgave3(\"Anders \", \"\", \"Ulsted\");\n System.out.print(u.getFName());\n System.out.print(u.getMName());\n System.out.println(u.getLName());\n System.out.println(u.getInitials());\n System.out.println(u.getUsername());\n }", "public int getLine() {return _line;}", "@Override\n public ArrayList<Pair<String, Integer>> getLeaderBoard() throws IOException {\n ArrayList<Pair<String, Integer>> leaderboard = new ArrayList<>();\n\n String sql = \"SELECT playernick, max(score) AS score FROM sep2_schema.player_scores GROUP BY playernick ORDER BY score DESC;\";\n ArrayList<Object[]> result;\n String playernick = \"\";\n int score = 0;\n\n try {\n result = db.query(sql);\n\n for (int i = 0; i < result.size(); i++) {\n Object[] row = result.get(i);\n playernick = row[0].toString();\n score = (int) row[1];\n leaderboard.add(new Pair<>(playernick, score));\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n return leaderboard;\n }", "public static void main(String[] args) {\r\n String firstLine = \"Metal Crusader\";\r\n String secondLine = \"Robotics is cool!\";\r\n System.out.println(firstLine);\r\n System.out.println(secondLine);\r\n }", "static String getLastName() {\n\t\tScanner s = new Scanner(System.in);\n\t\tSystem.out.print(\"Enter last name: \");\n\t\tString ln = s.nextLine();\n\t\treturn ln;\n\t}", "@Override\n public String toString()\n {\n return String.format(\"%-20s\\t\\t%-30s%-30s\",number, name, party);\n}", "public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n // System.out.println(\"How many names would like to output: \");\n String linesString = scan.nextLine().trim();\n int lines = Integer.parseInt(linesString);\n String[] names = new String[lines];\n for(int i = 0; i < lines; i++) {\n\t// System.out.println(\"Please enter name \" + (i+1) + \":\");\n names[i] = scan.nextLine();\n }\n for(int i = 0; i < lines; i++) {\n System.out.println(\"Hello, \" + names[i] + \"!\");\n }\n \n\n }", "public static void main(String[] args) {\n\t\tStudent s=new Student();\r\n\t\ts.setRoll_no(2);\r\n\t\ts.setName(\"John\");\r\n\t\tSystem.out.println(\"Roll Number:\"+s.getRoll_no());\r\n\t\tSystem.out.println(\"Name:\"+s.getName());\r\n\t}", "@Override\n public String toString() {\n return firstName + \"\\n\" + lastName + \"\\n\";\n }", "public static void main(String[] args) {\n\trunningrace race = new runningrace();\n\tAthlete sonic = new Athlete(\"Sonic\",999);\n\tAthlete sanic = new Athlete(\"Sonic\",999999999);\n}", "public static void main(String[] args) {\n\t\tScanner ler = new Scanner(System.in);\n\n\t\tString sentence = ler.nextLine();// ate o \\n (enter)\n\t\tString x, y, z;\n\t\tx = ler.next();\n\t\ty = ler.next();\n\t\tz = ler.next();\n\n\t\tSystem.out.println(sentence);\n\t\tSystem.out.println(x);\n\t\tSystem.out.println(y);\n\t\tSystem.out.println(z);\n\n\t\tx = ler.next();\n\t\ty = ler.next();\n\t\tz = ler.next();\n\t\tSystem.out.println(x);\n\t\tSystem.out.println(y);\n\t\tSystem.out.println(z);\n\t\tler.close();\n\t}", "public void startRecord(Leader leader) {\n this.record = new Record();\n record.add(leader);\n }", "public Town getTraleeName1() {\n\t\treturn new Town(\"Tralee Town Park \");\r\n\t}", "public static String createRace() {\n InputStreamReader sr = new InputStreamReader(System.in);\n BufferedReader br = new BufferedReader(sr);\n String race = null;\n try {\n while (true) {\n race = br.readLine();\n if (race.equalsIgnoreCase(\"человек\")) {\n System.out.println(\"Человек так человек\");\n System.out.println(\n \"Описание: и без описаний знаем все минусы и плюсы человеческой расы. Продолжим...\");\n break;\n\n }\n if (race.equalsIgnoreCase(\"эльф\")) {\n System.out.println(\"Вот как? Выбор натуры с тонкой душевной организацией. \");\n System.out.println(\"Описание: снобизм и эстетика. Магия у них в крови. Продолжим...\");\n break;\n\n }\n if (race.equalsIgnoreCase(\"орк\")) {\n System.out.println(\"\\\"LOK'TAR OGAR!\\\" или \\\" WAAAGH!\\\" теперь ваше жизненное кредо. \");\n System.out.println(\n \"Описание: здоровенный, плохо пахнущий и вечно орущий. Мастер владения любым видом холодного оружия. Продолжим...\");\n break;\n\n } else {\n System.out.println(\"- Не то. Выбери из предложенных выше.\");\n\n }\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n return race;\n }", "public static void main(String[] args) {\n \tScanner s = null;\n try{\n s = new Scanner(new File(args[0]));\n }catch (FileNotFoundException e) {\t\t\n \tSystem.out.println(\"File not found!\");\n }catch (Exception e){\t\t\n \tSystem.out.println(\"Something else went wrong!\");\n \te.printStackTrace();\n }\n \t \t\n //Read Line by Line\n s.nextLine();\n while(s.hasNext()){\n\t\t\tString Line=s.nextLine();\n\t\t\tString tokens[] = Line.split(\";\");//4 tokens created(MAIN LINE)\n\t\t\tString personCode=tokens[0];\t\t\n\t\t\tString name[] = tokens[1].split(\", \");//String name created split with comas\t\n\t\t\t\n\t\t\tName personName =new Name (name[0],name[1]);//personName object created under Name class, both name are passed\n\t\t\tSystem.out.println(name[0]);\n\t\t\tpersonName.setFirstName(name[0]);\n \t\tpersonName.setLastName(name[1]);\t\t\t\n \t\tString address[] = tokens[2].split(\",\");\n \t\tAddress personAddress =new Address (address[0],address[1],address[2],address[3],address[4]);\n\t\t\tSystem.out.println(tokens[2]);\t\n\t\t\tif(tokens.length==4) {\n \t\t\tString emailAdress=tokens[3];\n \t\t\tSystem.out.println(tokens[3]);\t\n \n \t\t}\n \n \t}\n\t}", "public void cars_of_my_father(){\n System.out.println(\"Royal Rayce, Maruti Suzuki, Mazda\");\n }", "public void requestLeaderboard() {\r\n connection.requestLeaderboard();\r\n }", "public static void main(String[] args) {\n\tstudent stu= new student();\r\nSystem.out.println(stu.sno+\"\\t\"+stu.sname+\"\\t\"+stu.sfee+\"\\t\"+stu.sresult+\"\\t\"+stu.flag);\r\n }", "private String readPlayerName () {\n String name = \"\";\n while (name == \"\") {\n System.out.print(\"Enter player name: \");\n System.out.flush();\n name = in.next();\n in.nextLine();\n }\n return name;\n }" ]
[ "0.62954473", "0.62214583", "0.6131533", "0.5918629", "0.5829469", "0.58264315", "0.57868385", "0.5771017", "0.57627356", "0.5700154", "0.5667173", "0.56494486", "0.5644532", "0.5636017", "0.5632567", "0.5600676", "0.5597197", "0.5590556", "0.5567791", "0.5561089", "0.55603915", "0.5559866", "0.55154854", "0.5513618", "0.54818386", "0.54778194", "0.5451487", "0.5435159", "0.5420432", "0.5411103", "0.54032385", "0.5390272", "0.53824866", "0.53750414", "0.537307", "0.5362398", "0.535057", "0.5349546", "0.5332753", "0.5323221", "0.5322103", "0.53110784", "0.53110784", "0.53110784", "0.5309679", "0.53046644", "0.5287576", "0.52864677", "0.5283651", "0.52817816", "0.5280537", "0.52777475", "0.5263309", "0.52621555", "0.5254294", "0.5253128", "0.5250882", "0.5245266", "0.52389437", "0.52302456", "0.52286565", "0.52258134", "0.5220708", "0.52200806", "0.5204157", "0.52023935", "0.5194824", "0.5183833", "0.51793355", "0.51743656", "0.5173451", "0.51582915", "0.5154482", "0.51509696", "0.515006", "0.514828", "0.5147381", "0.51442474", "0.5143526", "0.5128798", "0.51270556", "0.51264524", "0.51253605", "0.5122504", "0.51212406", "0.51162434", "0.5112721", "0.51112324", "0.51021224", "0.51012135", "0.50828886", "0.50809103", "0.5072018", "0.5066303", "0.5065356", "0.5065152", "0.50642955", "0.50625825", "0.5060666", "0.50600064", "0.5054359" ]
0.0
-1
Returns the shorthand string of the piece.
public final String pieceToString(final IChessPiece p) { String name = ""; name += p.player().name().charAt(0); name += p.type().charAt(0); return name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String shorthand(String s){\n \tif(s.toUpperCase().indexOf(\"YOU\")>=0){\n \t\ts=s.substring(0, s.toUpperCase().indexOf(\"YOU\"))+\" U \"+s.substring(s.toUpperCase().indexOf(\"YOU\")+3);\n \t\ts=shorthand(s);\n \t}else if(s.toUpperCase().indexOf(\"FOR\")>=0){\n \t\ts=s.substring(0, s.toUpperCase().indexOf(\"FOR\"))+\" 4 \"+s.substring(s.toUpperCase().indexOf(\"FOR\")+3);\n \t\ts=shorthand(s);\n \t}else if(s.toUpperCase().indexOf(\"AND\")>=0){\n \t\ts=s.substring(0, s.toUpperCase().indexOf(\"AND\"))+\" & \"+s.substring(s.toUpperCase().indexOf(\"AND\")+3);\n \t\ts=shorthand(s);\n \t}else if(s.toUpperCase().indexOf(\"TO\")>=0){\n \t\ts=s.substring(0, s.toUpperCase().indexOf(\"TO\"))+\" 2 \"+s.substring(s.toUpperCase().indexOf(\"TO\")+3);\n \t\ts=shorthand(s);\n \t}\n \treturn removeVowels(s);\n }", "public String toShortString ()\r\n {\r\n StringBuilder sb = new StringBuilder();\r\n sb.append(\"[\");\r\n\r\n if (getVoice() != null) {\r\n sb.append(\"Voice#\").append(getVoice().getId());\r\n }\r\n\r\n sb.append(\" Chord#\").append(getId());\r\n\r\n sb.append(\" dur:\");\r\n\r\n if (isWholeDuration()) {\r\n sb.append(\"W\");\r\n } else {\r\n Rational chordDur = getDuration();\r\n\r\n if (chordDur != null) {\r\n sb.append(chordDur);\r\n } else {\r\n sb.append(\"none\");\r\n }\r\n }\r\n\r\n sb.append(\"]\");\r\n\r\n return sb.toString();\r\n }", "public String getShortName() {\n\t\tif(number == 11){\n\t\t\treturn (suit + \"j\");\n\t\t}\n\t\telse if(number == 12) {\n\t\t\treturn (suit + \"q\");\n\t\t}\n\t\telse if(number == 13) {\n\t\t\treturn (suit + \"k\");\n\t\t}\n\t\telse if(number == 14) {\n\t\t\treturn (suit + \"a\");\n\t\t}\n\t\telse {\n\t\t\treturn (suit + String.valueOf(number));\n\t\t}\n\t}", "public String toStringShort() {\n\treturn AbstractFormatter.shape(this);\n}", "public String getShortName() {\n\t\treturn shortName + \"\\\"\";\n\t}", "public abstract String toString_short();", "String getShortName();", "@DerivedProperty\n\tString getShortRepresentation();", "private String processShorthand() {\n line = line.replace(\" \",\"\");\n StringBuilder result = new StringBuilder();\n StringBuilder variable = new StringBuilder();\n StringBuilder value = new StringBuilder();\n //This is to get the shorthand operator used.\n boolean equalToCrossed = false;\n StringBuilder operate = new StringBuilder();\n for(int i=0; i<line.length(); i++) {\n char ch = line.charAt(i);\n //If the character ch is not a letter nor a digit,\n //and equal-to has not been crossed yet, then ch\n //is part of the operator.\n if(!Character.isLetterOrDigit(ch) && !equalToCrossed)\n operate.append(ch);\n //If the character is not part of the operator\n //and equal-to has not been crossed yet, then this\n //is part of the variable name.\n else if(!equalToCrossed)\n variable.append(ch);\n //Else, the character is part of value\n else\n value.append(ch);\n if(ch=='=')\n equalToCrossed = true;\n }\n String operator = operate.toString();\n result.append(variable);\n switch(operator) {\n case \"+=\" : result.append(\" is added with \"); break;\n case \"-=\" : result.append(\" is decreased by \"); break;\n case \"*=\" : result.append(\" is multiplied with \"); break;\n case \"/=\" : result.append(\" is divided by \"); break;\n case \"^=\" : result.append(\" is XOR'ed with \"); break;\n case \"|=\" : result.append(\" is OR'ed with \"); break;\n case \"&=\" : result.append(\" is AND'ed with \"); break;\n case \"<<=\" : result.append(\" is signed left-bit-shifted by \"); break;\n case \">>=\" : result.append(\" is signed right-bit-shifted by \"); break;\n case \">>>=\" : result.append(\" is unsigned right-bit-shifted by \"); break;\n default : result.append(\" \").append(operator).append(\" \"); break;\n }\n if(hasArrayAsMajorValue(value.toString())) {\n value = new StringBuilder(processArrayValue(value.toString()));\n }\n result.append(\"the value given by \").append(value);\n return result.toString();\n }", "public String shortRepr() {\n\t\treturn \"Value of some kind.\";\n\t}", "public String shortcut() {\n\t\tif (CharKey.equals(\"none\"))\n\t\t\treturn \"\";\n\t\tString s = CharKey.toUpperCase();\n\t\tif (Alt)\n\t\t\ts = Global.name(\"shortcut.alt\") + \" \" + s;\n\t\tif (Control)\n\t\t\ts = Global.name(\"shortcut.control\") + \" \" + s;\n\t\tif (Shift)\n\t\t\ts = Global.name(\"shortcut.shift\") + \" \" + s;\n\t\tif (CommandType > 0)\n\t\t\ts = Keyboard.commandShortcut(CommandType) + \" \" + s;\n\t\treturn s;\n\t}", "default String toShortString() {\n return toString().substring(0, 5);\n }", "public String toShortString() {\n if (mShortString == null) {\n StringBuilder sb = new StringBuilder();\n sb.append(powerComponentIdToString(powerComponent));\n if (processState != PROCESS_STATE_UNSPECIFIED) {\n sb.append(':');\n sb.append(processStateToString(processState));\n }\n mShortString = sb.toString();\n }\n return mShortString;\n }", "public String getShortName() { return shortName; }", "public String getShortName() {\n/* 118 */ return this.shortname;\n/* */ }", "default String toHelpString() {\n // Builder\n StringBuilder builder = new StringBuilder();\n // Name\n builder.append(ChatColor.RED).append(getName()).append(\" \");\n // Parameter\n Iterator<PowreedCommandParameter> iterator = this.getParameters().iterator();\n while (iterator.hasNext()) {\n PowreedCommandParameter next = iterator.next();\n\n if (next.isRequired()) {\n builder.append(ChatColor.GOLD).append(\"<\").append(next.getName()).append(\">\");\n } else {\n builder.append(ChatColor.DARK_GRAY).append(\"[\").append(next.getName()).append(\"]\");\n }\n\n if (iterator.hasNext()) {\n builder.append(\" \");\n }\n }\n // Description\n builder.append(ChatColor.RED).append(\": \").append(ChatColor.GRAY).append(getDescription());\n // Return to string\n return builder.toString();\n }", "public String toString()\n {\n return color.charAt(0) + \"Q\";\n }", "public final String getShortname() {\n\t\treturn JsUtils.getNativePropertyString(this, \"shortname\");\n\t}", "public abstract String getShortName();", "public abstract String getShortName();", "public abstract String getShortName();", "public String getShortName() {\n return shortName;\n }", "public String getShortName() {\n return shortName;\n }", "public String getShortName() {\n return shortName;\n }", "@NonNull\n public String toShortString() {\n return toShortString(new StringBuilder(32));\n }", "public char show() {\n\t\treturn 'S';\n\t}", "@Nullable String getShortName();", "final public String getShortDesc()\n {\n return ComponentUtils.resolveString(getProperty(SHORT_DESC_KEY));\n }", "public String getSuitAsString(){\n\t\tString str = \"\";\n\t\tif (suit == 0)\n\t\t\tstr = new String(\"Clubs\");\n\t\telse if (suit == 1)\n\t\t\tstr = new String(\"Diamonds\");\n\t\telse if (suit == 2)\n\t\t\tstr = new String(\"Hearts\");\n\t\telse if (suit == 3)\n\t\t\tstr = new String(\"Spades\");\n\t\treturn str;\n\t}", "public String getShortName()\r\n\t{\r\n\t\treturn shortName;\r\n\t}", "@Override\n public String getShortName() {\n return step.getShortName();\n }", "public String toShortString() {\n LogBuilder lb = new LogBuilder(32);\n lb.add(getModeString(), \" \", transportable);\n Location lt = getTransportTarget();\n lb.add(\" @ \", ((lt == null) ? \"null\" : lt.toShortString()));\n Location ct = getCarrierTarget();\n if (ct != lt) lb.add(\"/\", ct.toShortString());\n return lb.toString();\n }", "public String toString() {\n\t\treturn \"S\";\n\t}", "public String toShortString()\n {\n return \"Id: \" + id + \"\\nNickname: \" + nickName;\n }", "public String getShortContent();", "public String getShortName() {\n\n\t\treturn shortName;\n\t}", "String shortWrite();", "public static final SourceModel.Expr showShort(SourceModel.Expr s) {\n\t\t\treturn \n\t\t\t\tSourceModel.Expr.Application.make(\n\t\t\t\t\tnew SourceModel.Expr[] {SourceModel.Expr.Var.make(Functions.showShort), s});\n\t\t}", "public String toString(){\n\t\tString abbrv = this.name().substring(0,1);\t\t\n\t\treturn abbrv;\n\t}", "public String getShortDes() {\n return shortDes;\n }", "public String getShortName() {\n\t\treturn SHORT_NAME;\n\t}", "@Override\n public String toString() {\n return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);\n }", "public abstract String shortName();", "public String makeString()\n {\n return \"ArcanaDungeonSource\";\n }", "public String print() {\n if (piece == null) {\n return String.valueOf('.');\n } else {\n return piece.print();\n }\n }", "public String getShortExplanation()\r\n\t{\r\n\t\treturn this._shortExplanation;\r\n\t}", "String getShortNameKey();", "String invade(short s) {\n\t\treturn \"a few\";\n\t}", "public String toString()\r\n {\r\n /* write code to return a string representation of a PieceWorker */\r\n return String.format( \"%s %s; %s: $%,.2f; %s: %.0f\", \r\n \"piece worker: \", super.toString(), \r\n \"wage per piece\", getWage(), \r\n \"pieces produced\", getPieces() );\r\n }", "public String toString(){\n\t\tString cheese, ham, pep;\n\t\t\n\t\tif (Cheese == 1)\n\t\t\tcheese =\"\";\n\t\telse if (Cheese == 2)\n\t\t\tcheese = \"double \";\n\t\telse \n\t\t\tcheese = \"triple \";\n\t\tif (Ham == 1)\n\t\t\tham =\"\";\n\t\telse if (Ham == 2)\n\t\t\tham = \"double \";\n\t\telse \n\t\t\tham = \"triple \";\n\t\tif (Pepperoni == 1)\n\t\t\tpep =\"\";\n\t\telse if (Pepperoni == 2)\n\t\t\tpep = \"double \";\n\t\telse \n\t\t\tpep = \"triple \";\n\t\t\t\n\t\tString output = new String();\n\t\tif (Ham >= 1 && Pepperoni >= 1){\n\t\t\toutput = Size + \" pizza, \" + cheese + \"cheese, \" + ham + \"ham, \" + pep \n\t\t\t+ \"pepperoni. Cost: $\" + String.format(\"%2.2f\", getCost()) + \" each.\";}\n\t\telse if (Ham == 0 && Pepperoni == 0)\n\t\t\toutput = Size + \" pizza, \" + cheese + \"cheese only. Cost: $\" + String.format(\"%2.2f\", getCost()) + \" each.\";\n\t\telse if (Ham == 1 && Pepperoni == 0){\n\t\t\toutput = Size + \" pizza, \" + cheese + \"cheese, \" + ham + \"ham. Cost: $\" + String.format(\"%2.2f\", getCost()) + \" each.\";}\n\t\telse if (Ham == 0 && Pepperoni == 1){\n\t\t\toutput = Size + \" pizza, \" + cheese + \"cheese, \" + pep\n\t\t\t\t\t+ \"pepperoni. Cost: $\" + String.format(\"%2.2f\", getCost()) + \" each.\";}\n\t\t\n\t\treturn output;\n\t\t}", "public String getToolString() {\r\n\t\treturn Utility.convertTo4Byte(ScoolConstants.NEW_WHITEBOARD_ACTION);\r\n\t}", "public String getTitleAndShortname() {\n StringBuilder sb = new StringBuilder();\n if (eml != null) {\n sb.append(eml.getTitle());\n if (!shortname.equalsIgnoreCase(eml.getTitle())) {\n sb.append(\" (\").append(shortname).append(\")\");\n }\n }\n return sb.toString();\n }", "public String getWriteString() {\r\n\t\t\treturn \"Dest \"+name+\" \"+x+\" \"+y+\" \"+z;\r\n\t}", "public String getExperimentShortLabel();", "public java.lang.String shortName () { throw new RuntimeException(); }", "char displayHelp(SideType s) {\n switch (s) {\n case IN:\n return SIDE_IN;\n case OUT:\n return SIDE_OUT;\n case FLAT:\n return SIDE_FLAT;\n }\n // in case of a problem\n return '*';\n }", "public String toString() {\n return \"The \" + value + \" of \" + suit;\n }", "private String getSuitName() {\n String result;\n if (this.suit == 0) {\n result = \"Clubs\";\n } else if (this.suit == 1) {\n result = \"Diamonds\";\n } else if (this.suit == 2) {\n result = \"Hearts\";\n } else {\n result = \"Spades\";\n }\n return result;\n }", "public String getSuitString()\n {\n switch (suit)\n {\n case SPADES: return \"SPADES\";\n case CLUBS: return \"CLUBS\";\n case DIAMONDS: return \"DIAMONDS\";\n case HEARTS: return \"HEARTS\";\n default: return \"Invalid\";\n }\n \n }", "public String getExplanation()\n { \n StringBuilder r = new StringBuilder(\"Source \");\n if (porterDuff2.equals(\" \")) r.append(\"clears\");\n if (porterDuff2.equals(\" S\")) r.append(\"overwrites\");\n if (porterDuff2.equals(\"DS\")) r.append(\"blends with\");\n if (porterDuff2.equals(\" D\")) r.append(\"alpha modifies\");\n if (porterDuff2.equals(\"D \")) r.append(\"alpha complement modifies\");\n if (porterDuff2.equals(\"DD\")) r.append(\"does not affect\");\n r.append(\" destination\");\n if (porterDuff1.equals(\" S\")) r.append(\" and overwrites empty pixels\");\n r.append(\".\");\n return r.toString();\n }", "@Override\n public String toString() {\n if(piece instanceof King) return player + 'K';\n if(piece instanceof Queen) return player + 'Q';\n if(piece instanceof Rook) return player + 'R';\n if(piece instanceof Knight) return player + 'N';\n if(piece instanceof Bishop) return player + 'B';\n if(piece instanceof Pawn) return player + 'p';\n else return \" \";\n }", "public String shortName() {\r\n\t\treturn \"F\";\r\n\t}", "public String getPiece(){\n\t\tif(piece!=null){\n\t\t\treturn piece.getPiece();\n\t\t}else{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t}", "public String mo855e() {\n char d = mo853d();\n if (d == 0) {\n return \"\";\n }\n Resources resources = this.f619n.mo810e().getResources();\n StringBuilder sb = new StringBuilder();\n if (ViewConfiguration.get(this.f619n.mo810e()).hasPermanentMenuKey()) {\n sb.append(resources.getString(C3865h.abc_prepend_shortcut_label));\n }\n int i = this.f619n.mo826p() ? this.f616k : this.f614i;\n m848a(sb, i, DateUtils.FORMAT_ABBREV_MONTH, resources.getString(C3865h.abc_menu_meta_shortcut_label));\n m848a(sb, i, 4096, resources.getString(C3865h.abc_menu_ctrl_shortcut_label));\n m848a(sb, i, 2, resources.getString(C3865h.abc_menu_alt_shortcut_label));\n m848a(sb, i, 1, resources.getString(C3865h.abc_menu_shift_shortcut_label));\n m848a(sb, i, 4, resources.getString(C3865h.abc_menu_sym_shortcut_label));\n m848a(sb, i, 8, resources.getString(C3865h.abc_menu_function_shortcut_label));\n if (d == 8) {\n sb.append(resources.getString(C3865h.abc_menu_delete_shortcut_label));\n } else if (d == 10) {\n sb.append(resources.getString(C3865h.abc_menu_enter_shortcut_label));\n } else if (d != ' ') {\n sb.append(d);\n } else {\n sb.append(resources.getString(C3865h.abc_menu_space_shortcut_label));\n }\n return sb.toString();\n }", "@Override\n public String getShortName() {\n return NAME;\n }", "public String getPrefix() {\n return ChatColor.translateAlternateColorCodes('&', Objects.requireNonNull(this.getConfig().getString(\"config.messages.prefix\")));\n }", "public java.lang.String getShortDialProp()\n\t{\n\t\treturn shortDialProp;\n\t}", "String getShortName() throws RemoteException;", "@Override\n\tpublic String toString(){\n\t\treturn PieceType.PAWN.toString();\n\t}", "@Override\n\tpublic String alias() {\n\t\treturn toString();\n\t}", "public String displayShort(){\n return \"\\tId: \" + id + \"\\n\" +\n \"\\tName: \" + name + \"\\n\" +\n \"\\tDescription: \" + description + \"\\n\";\n }", "public String toString(){\n\t\treturn \"HELP\";\n\t}", "public String toStringShort()\n {\n return (denormTemp() + \",\" + denormDO() + \",\" +\n denormPercSat() + \",\" + denormPH() + \",\" +\n denormCond() + \",\" + denormEcoli() + \",\" + clusterId);\n\n }", "public String toString() {\n return (\"A \" + pizzaSize + \" pizza with \" + cheeseToppings + \" cheese topping(s), \" + pepperoniToppings +\n \" pepperoni topping(s), and \" + veggieToppings + \" veggie topping(s) costs $\" + calcCost());\n }", "public String toString() { \n return \"Hi, I'm a Wumpus. Eat me!\";\n }", "@Override\n\tpublic String toString() {\n\t\treturn \"MusicalPiece [title=\" + title + \", composer=\" + composer\n\t\t\t\t+ \", meterNumerator=\" + meterNumerator + \", meterDenominator=\"\n\t\t\t\t+ meterDenominator + \", tempoSpeed=\" + tempoSpeed\n\t\t\t\t+ \", tempoNumerator=\" + tempoNumerator + \", tempoDenominator=\"\n\t\t\t\t+ tempoDenominator + \", phrases=\" + phrases + \"]\";\n\t}", "public String toString()\r\n/* 129: */ {\r\n/* 130:131 */ String str = \"\";\r\n/* 131:132 */ if (getAmplifier() > 0) {\r\n/* 132:133 */ str = getPotionName() + \" x \" + (getAmplifier() + 1) + \", Duration: \" + getDuration();\r\n/* 133: */ } else {\r\n/* 134:135 */ str = getPotionName() + \", Duration: \" + getDuration();\r\n/* 135: */ }\r\n/* 136:137 */ if (this.splash) {\r\n/* 137:138 */ str = str + \", Splash: true\";\r\n/* 138: */ }\r\n/* 139:140 */ if (!this.showParticles) {\r\n/* 140:141 */ str = str + \", Particles: false\";\r\n/* 141: */ }\r\n/* 142:143 */ if (Potion.potionList[this.id].j()) {\r\n/* 143:144 */ return \"(\" + str + \")\";\r\n/* 144: */ }\r\n/* 145:146 */ return str;\r\n/* 146: */ }", "@Override\n public String toString()\n {\n return String.format(\"%s Heat setting:%d Automatic Shutoff:%d\", super.toString(), heat_setting, auto_shutoff);\n }", "public String toString()\n\t{\n\t\treturn String.format(\"Square at x=%d, y=%d with sides %d\", anchor.x, anchor.y, oneside);\n\t}", "protected String getPatchName(Patch p) {\n if (patchNameSize == 0)\n return (\"-\");\n try {\n return new String(p.sysex, patchNameStart, patchNameSize, \"US-ASCII\");\n } catch (UnsupportedEncodingException ex) {\n return \"-\";\n }\n }", "public String toString(){\r\n\t\tif (modifiers == 1) return \"O-O (w)\";\r\n\t\telse if (modifiers == 2) return \"O-O (b)\";\r\n\t\telse if (modifiers == 3) return \"O-O-O (w)\";\r\n\t\telse if (modifiers == 4) return \"O-O-O (b)\";\r\n\t\tString st = \"\";\r\n\t\tst += x88ToString(start_sq);\r\n\t\tst += x88ToString(end_sq);\r\n\t\tif (modifiers == 5) st += \"e.p.\";\r\n\t\telse if (modifiers == 6) st += \"=R\";\r\n\t\telse if (modifiers == 7) st += \"=N\";\r\n\t\telse if (modifiers == 8) st += \"=B\";\r\n\t\telse if (modifiers == 9) st += \"=Q\";\r\n\t\treturn st;\r\n\t}", "@Override\n public String getSprintMPasString() {\n if (hasArmedMASC()) {\n return getRunMPwithoutMASC() + \"(\" + getSprintMP() + \")\";\n }\n return Integer.toString(getSprintMP());\n }", "@NonNull @Unmodifiable Collection<String> resolveShorthand();", "public String toString() {\n\t\tString s = \"\";\n\t\tif(hidden) {\t\t\t\t\t//if hidden, only show the next character\n\t\t\tif(chars<=words.get(0).toString().length()) {\n\t\t\t\ts += (words.get(0).toString()+\" \").substring(0,chars+1);\n\t\t\t}\n\t\t}\n\t\telse {\t\t\t\t\t\t\t\n\t\t\tfor(Word w: words) {\n\t\t\t\ts += w.toString() + \" \";\n\t\t\t}\t\n\t\t}\n\t\treturn s;\n\t}", "@Override\n\tpublic String toString() {\n\t\tString strSuit = suit.toString().substring(0, 1);\n\t\tstrSuit += suit.toString().toLowerCase()\n\t\t\t\t.substring(1, suit.toString().length());\n\n\t\treturn strSuit + value;\t\n\t}", "public String toString() {\nString output = new String();\n\noutput = \"shortName\" + \" : \" + \"\" + shortName +\"\\n\"; \noutput += \"type\" + \" : \" + \"\" + type + \"\\n\";\noutput += \"description\" + \" : \" + \"\" + description + \"\\n\"; \n\nreturn output; \n}", "public String toString() {\r\n\t\tString result = null;\r\n\t\tif (varname != null){\r\n\t\t\tif (isFormal())\r\n\t\t\t\tresult = \"(?)\" + varname;\r\n\t\t\telse\r\n\t\t\t\tresult = \"($)\"+ varname;\t\r\n\t\t} \r\n\t\telse\r\n\t\t\tresult = super.toString();\r\n\t\t\t\r\n\t\treturn result;\r\n\t}", "public String toString() {\n\t URI uri = getURI();\n\t return (uri == null) \n\t \t? \"Anonymous (\" + getAnonID() + \")\"\n\t \t: uri.toString();\n//\t \t: (kb == null)\n//\t \t ? uri.toString() \n//\t \t : kb.getQNames().shortForm(uri);\n\t}", "@Override\n public String toString() {\n return String.valueOf(playerPiece);\n }", "public String toString() {\n\t\t\treturn aliases[0];\n\t\t}", "public String toString() {\n\t\tString s = \"--\";\n\t\tif (this != null) {\n\t\t\tswitch (this) {\n\t\t\tcase FR_FA:\n\t\t\t\ts = \"Freshman Fall\";\n\t\t\t\tbreak;\n\t\t\tcase FR_SP:\n\t\t\t\ts = \"Freshman Spring\";\n\t\t\t\tbreak;\n\t\t\tcase SO_FA:\n\t\t\t\ts = \"Sophmore Fall\";\n\t\t\t\tbreak;\n\t\t\tcase SO_SP:\n\t\t\t\ts = \"Sophmore Spring\";\n\t\t\t\tbreak;\n\t\t\tcase JU_FA:\n\t\t\t\ts = \"Junior Fall\";\n\t\t\t\tbreak;\n\t\t\tcase JU_SP:\n\t\t\t\ts = \"Junior Spring\";\n\t\t\t\tbreak;\n\t\t\tcase SE_FA:\n\t\t\t\ts = \"Senior Fall\";\n\t\t\t\tbreak;\n\t\t\tcase SE_SP:\n\t\t\t\ts = \"Senior Spring\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn s;\n\n\t}", "private String symbol() {\n switch (this.suit) {\n case 1:\n return \"♣\";\n case 2:\n return \"♦\";\n case 3:\n return \"♥\";\n case 4:\n return \"♠\";\n default:\n throw new IllegalArgumentException(\"Invalid Suit\");\n }\n }", "public String toStringAsElement() {\r\n \t\treturn \"?\";\r\n \t}", "public String getPseudo(){return pseudo;}", "public String toShEx() {\n return String.format(\"<%s> .{%s, %s} ,\", properties.get(0), minBound, maxBound);\n }", "public String getAbbreviationLetter() {\n\t\treturn pieceLetter;\n\t}", "public String toString() {\n\t\treturn \"Półka \" + shelfName;\n\t}", "public final String get_configured_primary_as_string () {\n\t\treturn \"P\" + configured_primary;\n\t}", "public String getShort() { \n\t\treturn getShortElement().getValue();\n\t}", "public String toString() {\r\n\t\treturn \"P\";\r\n\t}" ]
[ "0.62594575", "0.6114854", "0.6068639", "0.6026173", "0.6020706", "0.6003421", "0.59909207", "0.5984329", "0.58743674", "0.58564717", "0.5787528", "0.5770076", "0.5744247", "0.573975", "0.5733357", "0.5716642", "0.5714617", "0.5710517", "0.5702135", "0.5702135", "0.5702135", "0.56652933", "0.56652933", "0.56652933", "0.5621797", "0.56041694", "0.55906737", "0.55838066", "0.558082", "0.55780876", "0.5567876", "0.5522311", "0.55136114", "0.55081815", "0.5485716", "0.5478743", "0.54596543", "0.5458222", "0.5447548", "0.5447435", "0.5436062", "0.5427729", "0.5410538", "0.54070276", "0.53919375", "0.5391773", "0.5362035", "0.5351652", "0.53490466", "0.534851", "0.534655", "0.5334335", "0.53326863", "0.5320433", "0.5296725", "0.5292937", "0.5292174", "0.52852046", "0.5283122", "0.5281634", "0.52797955", "0.5277192", "0.5264811", "0.5260671", "0.5258823", "0.52514607", "0.5250558", "0.52488315", "0.5247737", "0.5247708", "0.5244002", "0.52407175", "0.5238053", "0.5237156", "0.52369165", "0.5232372", "0.52279687", "0.52222955", "0.5220363", "0.5219007", "0.5217735", "0.5208513", "0.52068603", "0.51990205", "0.51960516", "0.51935023", "0.5187899", "0.5183103", "0.5178696", "0.5177792", "0.51775354", "0.51739055", "0.5172256", "0.5162207", "0.5158831", "0.51530534", "0.51513577", "0.51491123", "0.5147195", "0.5139361" ]
0.5685096
21
Displays if put self in check.
public final void putSelfInCheck() { out.println("You can't place yourself in check."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void display(){\n System.out.println(\"***************\");\n System.out.println(\"Checking Account\");\n super.display();\n System.out.println(\"Routing Number: \" + routingNumber);\n }", "@Override\r\n public void display() {\n super.display();\r\n System.out.println(\"You can choose one of the correct answers!\");\r\n }", "public final void inCheck() {\n\t\tout.println(\"You have been placed in check!\");\n\t}", "@Override\n\tpublic void display() {\n\t\tSystem.out.println(\"콘텐츠화면이 출력되었습니다\");\n\t}", "void printCheck();", "@Override\r\n\tpublic int displayCheck(CookVO vo) throws Exception {\n\t\treturn session.update(\"com.mapper.cook.display\", vo);\r\n\t}", "public boolean display(Display disp)\r\n\t{\r\n\t\tEditTradeoff ar = new EditTradeoff(disp, this, false);\r\n\t\tString msg = \"Edited tradeoff \" + this.getName() + \" \" + ar.getCanceled();\r\n\t\tDataLog d = DataLog.getHandle();\r\n\t\td.writeData(msg);\r\n\t\treturn ar.getCanceled(); //can I do this?\r\n\t\t\r\n\t}", "private void checks(){\n if (check(true)){\n changeBottomPane(\"White is in check! :(\");\n }\n else if (check(false)){\n changeBottomPane(\"Black is in check!!!!!!!!!!!\");\n }\n else{\n changeBottomPane(\"\");\n }\n }", "private void displayValidity() {\n if (allValid) spnValid.setText(\"All fields are valid!\");\n else spnValid.setText(\"There are invalid fields. Please go back and check these.\");\n }", "@Override\r\n\tpublic void displayLabel() {\n\t\tSystem.out.println(\"Syrup should be handled with care\");\r\n\t}", "@Override\n\tpublic void check() {\n\t\t\n\t}", "@Override\n\tpublic void check() {\n\t\t\n\t}", "@Override\n\t\tpublic void displayMessage() {\n\t\t\tsuper.displayMessage();\n\t\t}", "@Override\r\n\tpublic void display() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void display() {\n\t\t\r\n\t}", "protected void display() {\n\r\n\t}", "public int show(int sit_checker)\n {\n int ret_val = 0;\n for(Room temp : data_set)\n {\n if(temp.get_situation() == sit_checker)\n {\n ++ret_val;\n System.out.print(temp.room_number() + \" - \");\n }\n }\n if(ret_val > 0)\n System.out.println(\"\\n(-1 for cancel operation)\");\n return ret_val;\n }", "private void title() {\n\t\tline();\n\t\tSystem.out.println(CheckFiles.class.getSimpleName());\n\t\tline();\n\t\tif (toCheck == null) {\n\t\t\tSystem.out.println(\"arg1: directory with files to check\");\n\t\t} else {\n\t\t\tSystem.out.println(\"arg1: \" + toCheck);\n\t\t}\n\t\tif (checkIn == null) {\n\t\t\tSystem.out.println(\"arg2: directory with files\");\n\t\t} else {\n\t\t\tSystem.out.println(\"arg2: \" + checkIn);\n\t\t}\n\t\tline();\n\t\tSystem.out.println(\"\");\n\t}", "void displayUserTakenError(){\n error.setVisible(true);\n }", "public abstract void displayMsgBeforeRun();", "@Override\n\tpublic void display() {\n\n\t}", "@Override\n\tpublic void display() {\n\n\t}", "@Override\n\tpublic void display() {\n\n\t}", "@Override\n\tpublic void display() {\n\t\t\n\t}", "@Override\n\tpublic void display() {\n\t\t\n\t}", "@Override\n public void payeeDisplayVisible(boolean yes) {\n\t\n }", "@Override\r\n\tpublic void display() {\n\r\n\t}", "@Override\n\tpublic void printAccountType() {\n\t\tSystem.out.println(\"Checking\");\n\t}", "protected abstract String display();", "public void displayValidityReport() {\r\n\t\tif (this.tuple == null)\r\n\t\t\treturn;\r\n\t\tsetMessage(\"\");\r\n\t\tint row = this.tableView.getSelectedRow();\r\n\t\tif (row < this.tuple.getNumberOfEntries() && row >= 0)\r\n\t\t\tdisplayValidityReport(row);\r\n\t}", "@Override\n\tpublic void display() {\n\t\tSystem.out.println(\"I'm a yellow duck\");\n\t}", "public boolean printOutput(){\n output = \"<html>\";\n output += \"Thank you for your evaluation<br><br>\"; \n output += \"Name: \" + name.getText() + \"<br>\";\n output += \"Matric: \" + matric.getText() + \"<br>\";\n if(code_selection.equals(\"[Select]\") || code.getSelectedItem().equals(\"\") || \n name.getText().equals(\"\") || matric.getText().equals(\"\") || \n rb_selection.equals(\"\") || cb_selection.equals(\"\")){\n \n JOptionPane.showMessageDialog(null, \"All field must be fill, Thank you..\");\n return false;\n }\n output += \"Course: \" + code_selection + \"<br>\";\n output += \"Rating: \" + rb_selection + \"<br>\";\n output += \"Outcome: \" + cb_selection + \"<br>\";\n output += \"</html>\"; \n lbl_output.setText(output);\n jsp.getViewport().revalidate();\n return true;\n }", "public void visKontingenthaandteringMenu ()\r\n {\r\n System.out.println(\"Du har valgt kontingent.\");\r\n System.out.println(\"Hvad oensker du at foretage dig?\");\r\n System.out.println(\"1: Se priser\");\r\n System.out.println(\"2: Se medlemmer i restance\");\r\n System.out.println(\"0: Afslut\");\r\n\r\n }", "@Override\n public void display() {\n\n }", "public static void displayMsg() {\n\t}", "@Override\n protected boolean isAppropriate() {\n return true; // always show\n }", "@Override\n\tpublic String toScreenText() {\n\t\treturn \"if(#node#)\\n{#node#}\";\n\t}", "public void display()\r\n\t{\r\n\t\t\r\n\t}", "@Override\n\tpublic void Examinar() {\n\t\tSystem.out.println(\"\\nEsta preguiça emite o som tec tec tec ao ser examinada\\n\");\t\n\t}", "@Override\n\tpublic void attaquer() {\n\t\tSystem.out.println(\"Je suis \" + this.nom + \", j'ai \" + this.age + \" ans et je cueille le gui !\");\n\t}", "public void v_Verify_Guest1_Displayed(){\n\t}", "public void printChecklist() {\n\t\tfor(String str : checklist.keySet()) {\n\t\t\tMyUtils.Log(\"[Checklist] \"+str+\", \"+checklist.get(str));\n\t\t}\n\t}", "final void show() {\n\t\tSystem.out.println(\">> This is show of CC\");\n\t}", "@Override\n public void actionPerformed(ActionEvent e) {\n JOptionPane.showConfirmDialog(OverCounterForm.this, \"Check this\");\n }", "private void onOK() {\n show.setText(null);\n String s = (new ArithmeticExpressions(text.getText()).checkExpression());\n System.out.println(s);\n show.setText(s);\n }", "@Override\r\n\tpublic void show() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void show() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void show() {\n\t\t\r\n\t}", "public void display() {\n\t\t\n\t}", "public void display() {\n\t\t\n\t}", "public void display() {\n\t\tSystem.out.println(\"none static display() called\");\n\t}", "@Override\n public void run() {\n\t\t\t\t\t\t\tif (!wrapped)\n\t\t\t\t\t\t\t\thexEditor.getEditorSite().getActionBars().getStatusLineManager().setMessage(found == null && matchCount == 0 ? Messages.HexEditorControl_7 : matchCount > 0 ? Messages.HexEditorControl_8 + matchCount + Messages.HexEditorControl_9 : null);\n\t\t\t\t\t\t\tupdateStatusPanel();\n\t\t\t\t\t\t}", "@Override\n\tpublic void display() {\n\t\tSystem.out.println(\"I'm a mallard duck\");\n\t}", "@Override\r\n\tpublic void show() {\n\t\t\r\n\t\t\r\n\t}", "@Override\n\tpublic void show() {\n\t\t\n\t}", "@Override\n\tpublic void show() {\n\t\t\n\t}", "@Override\n\tpublic void show() {\n\t\t\n\t}", "@Override\n\tpublic void show() {\n\t\t\n\t}", "@Override\n\tpublic void show() {\n\t\t\n\t}", "@Override\n\tpublic void show() {\n\t\t\n\t}", "@Override\n\tpublic void show() {\n\t\t\n\t}", "@Override\n\tpublic void show() {\n\t\t\n\t}", "@Override\n\tpublic void show() {\n\t\t\n\t}", "@Override\n\tpublic void show() {\n\t\t\n\t}", "@Override\n\tpublic void show() {\n\t\t\n\t}", "@Override\n\tpublic void show() {\n\t\t\n\t}", "@Override\n\tpublic void show() {\n\t\t\n\t}", "@Override\n\tpublic void show() {\n\t\t\n\t}", "@Override\n\tpublic void show() {\n\t\t\n\t}", "@Override\n protected void display() {\n System.out.println(\"Welcome to team builder tool!\");\n System.out.println(\"Current team: \" + team.getName());\n }", "void displayWhiteboardTakenError(){\n createWhiteboard.setText(\"Whiteboard ID already taken. Select it from below or choose a new integer.\");\n\n }", "protected abstract void showHint();", "public void display () {\n super.display ();\n if (joined == true) {\n System.out.println(\"Staff name: \"+staffName+\n \"\\nSalary: \"+salary+\n \"\\nWorking hour: \"+workingHour+\n \"\\nJoining date: \"+joiningDate+\n \"\\nQualification: \"+qualification+\n \"\\nAppointed by: \"+appointedBy);\n }\n }", "public boolean shown();", "@Override\n\tpublic void shown() {\n\n\t}", "public void showNextMovePrompt() {\n\n if(model.isXTurn()){\n resultLabel.setText(\"X's Turn\");\n }\n else{\n resultLabel.setText(\"O's Turn\");\n }\n }", "private void pleaseCheck() {\n\t\tPrimeFaces.current().executeScript(\"new PNotify({\\r\\n\" + \n\t\t\t\t\"\t\t\ttitle: 'Check this ',\\r\\n\" + \n\t\t\t\t\"\t\t\ttext: 'Please Make sure that the Passwords are the same and not empty!',\\r\\n\" + \n\t\t\t\t\"\t\t\tleft:\\\"2%\\\"\\r\\n\" + \n\t\t\t\t\"\t\t});\");\n\t\t\n\t}", "private void check_displaysError() {\n onView(withId(R.id.title))\n .check(matches(withText(R.string.input_title_error)));\n onView(withId(R.id.subtitle))\n .check(matches(withText(R.string.input_subtitle_error)));\n\n // And the button to be labeled try again\n onView(withId(R.id.hint))\n .check(matches(isDisplayed()))\n .check(matches(withText(R.string.input_hint_error)));\n }", "private boolean checkAction() {\n if (nodes == null || nodes.length > 1) {\r\n return false;\r\n }\r\n // No parent\r\n if (nodes == null || nodes.length != 1) {\r\n JOptionPane.showMessageDialog(JZVNode.this, bundle\r\n .getString(\"dlg.error.updateWithoutParent\"),\r\n bundle.getString(\"dlg.error.title\"),\r\n JOptionPane.ERROR_MESSAGE);\r\n return false;\r\n }\r\n return true;\r\n }", "public void display() {\n\t}", "@Override\r\n\tpublic void display() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tSystem.out.println(\"Im a mallard Duck!\");\r\n\t}", "@Override\n\tpublic void show() {\n\n\t}", "@Override\n\tpublic void show() {\n\n\t}", "@Override\n\tpublic void show() {\n\n\t}", "@Override\n\tpublic void show() {\n\n\t}", "@Override\n\tpublic void show() {\n\n\t}", "@Override\n\tpublic void show() {\n\n\t}", "@Override\n\tpublic void show() {\n\n\t}", "@Override\n\tpublic void show() {\n\n\t}", "public void act() \n {\n checkClicked();\n }", "public void v_Verify_Guest7_Displayed(){\n\t}", "private boolean checkAction() {\n if (nodes == null || nodes.length > 1) {\r\n return false;\r\n }\r\n // Emptry node name\r\n if (jtfChildName.getText().isEmpty()) {\r\n JOptionPane.showMessageDialog(JZVNode.this,\r\n bundle.getString(\"dlg.error.addWithoutName\"),\r\n bundle.getString(\"dlg.error.title\"),\r\n JOptionPane.ERROR_MESSAGE);\r\n return false;\r\n }\r\n // No parent\r\n if (nodes == null || nodes.length != 1) {\r\n JOptionPane.showMessageDialog(JZVNode.this,\r\n bundle.getString(\"dlg.error.addWithoutParent\"),\r\n bundle.getString(\"dlg.error.title\"),\r\n JOptionPane.ERROR_MESSAGE);\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\n\tpublic void show() {\n\t}", "@Override\n\tpublic void show() {\n\t}", "public void v_Verify_Guest3_Displayed(){\n\t}", "protected String validateContents (Component component, Object o) \r\n { \r\n if (advancedBox.isSelected())\r\n {\r\n if (getWizardData(\"blacksaved\") == \"false\")\r\n {\r\n return \"You must save the black list before continuing... \";\r\n }\r\n }\r\n return null;\r\n }", "@Override\r\n\tpublic void show() {\n\t}", "public void display() {\n io.writeLine(\"The correct answer is \" + rightAnswers.get(0));\n }", "public void displayMessage(){//displayMessage body start\n\t\tSystem.out.printf(\"course name = %s\\n\", getCourseName());\n\t}", "@Override\n public boolean showPanel(Issue issue, ApplicationUser remoteUser) {\n\n if (issue.isSubTask()){\n return false;\n }else{\n return true;\n }\n\n }" ]
[ "0.6557584", "0.6452395", "0.63421065", "0.6262594", "0.6146314", "0.6079264", "0.60685873", "0.5902225", "0.5881681", "0.58339936", "0.5823841", "0.5823841", "0.58150935", "0.58121884", "0.58121884", "0.579892", "0.57617384", "0.5760727", "0.5722237", "0.57038367", "0.5703434", "0.5703434", "0.5703434", "0.56623447", "0.56623447", "0.5641539", "0.5622493", "0.5621811", "0.5610225", "0.55827683", "0.5569558", "0.5569247", "0.5557895", "0.5546033", "0.5545971", "0.5545629", "0.55416006", "0.553429", "0.5530694", "0.5515033", "0.5509675", "0.5508708", "0.55064434", "0.5504963", "0.5499517", "0.5499103", "0.5499103", "0.5499103", "0.5492183", "0.5492183", "0.5470952", "0.5468054", "0.54617894", "0.5456289", "0.5444209", "0.5444209", "0.5444209", "0.5444209", "0.5444209", "0.5444209", "0.5444209", "0.5444209", "0.5444209", "0.5444209", "0.5444209", "0.5444209", "0.5444209", "0.5444209", "0.5444209", "0.54370016", "0.54369867", "0.543663", "0.5434034", "0.54320085", "0.54228556", "0.5421596", "0.5421078", "0.5418107", "0.54158753", "0.54140306", "0.5409313", "0.5405372", "0.5405372", "0.5405372", "0.5405372", "0.5405372", "0.5405372", "0.5405372", "0.5405372", "0.54046816", "0.540081", "0.5400495", "0.5400265", "0.5400265", "0.5398864", "0.53969765", "0.539267", "0.5392068", "0.53842366", "0.5382199" ]
0.6736558
0
Displays if player has been placed in check.
public final void inCheck() { out.println("You have been placed in check!"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean showPlayer(){\n\t\t\n\t\tSystem.out.println(\"\\t\"+color+\"\\t \"+playermoney+\"\\t \\t\"+totalminions+\" \\t\"+totalbuildings+\" \\t\\t\"+personalityCard.cardName);\n\t\treturn true;\n\t}", "private void showTurn()\n {\n if( PlayerOneTurn == true )\n {\n if( messageShown == false )\n {\n JOptionPane.showMessageDialog( null, playerOneName + \"it is your turn.\", \"for playerOne\", JOptionPane.PLAIN_MESSAGE );\n \n }\n }\n else\n {\n if( messageShown == false )\n {\n JOptionPane.showMessageDialog( null, playerTwoName + \"it is your turn.\", \"for playerTwo\", JOptionPane.PLAIN_MESSAGE );\n \n }\n }\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 }", "@Override\n public void showPlayerWon() {\n if (isEnglish) {\n Toast.makeText(this, WIN, Toast.LENGTH_SHORT).show();\n } else {\n Toast.makeText(this, WIN_CHINESE, Toast.LENGTH_SHORT).show();\n }\n\n\n //Set visibility for replayButton to visible\n replayButton.setVisibility(View.VISIBLE);\n retryButton.setVisibility(View.VISIBLE);\n scoreboardButton.setVisibility(View.VISIBLE);\n }", "public void print()\n\t{\n\t\tif(gameObj[1].size() > 0)\n\t\t{\n\t\t\tSystem.out.println(\"*********************Player Info*******************************\");\n\t\t\tSystem.out.println(\"[Lives: \" + lives + \"][Score: \" + score + \n\t\t\t\t\t\t\t\"][Time: \" + gameTime + \"]\");\n\t\t\tSystem.out.println(\"*********************Player Info*******************************\");\n\t\t}else\n\t\t\tSystem.out.println(\"Spawn a player ship to view game info\");\n\t}", "public void enterPlayerView(){\n\t\tplayerSeen=true;\r\n\t\tplayerMapped=true;\r\n\t}", "boolean hasPokemonDisplay();", "public void printPlayerStatus() {\n System.out.println(getName() + \" owns \" +\n getOwnedCountries().size() + \" countries and \"\n + getArmyCount() + \" armies.\");\n\n String ownedCountries = \"\";\n for (Country c : getOwnedCountries())\n {\n ownedCountries += c.getCountryName().name() + \": \" + c.getArmyOccupied() + \"\\n\";\n }\n System.out.println (ownedCountries);\n }", "private void promptPlayerTurn(Player player) {\r\n JOptionPane.showMessageDialog(\r\n null,\r\n player.getName() + \", it's your turn!\",\r\n \"Player Confirmation\",\r\n JOptionPane.INFORMATION_MESSAGE);\r\n }", "public void displayWin()\n {\n if(player1 instanceof GameController){\n player1.gameOver(1);\n } else {\n player2.gameOver(1);\n }\n }", "public void checkGameStatus() {\n everyTenthGoalCongrats();\n randomPopUpBecauseICan();\n }", "static void look(Player player) {\n String stuff = player.getLocation().whatStuff();\n if (!stuff.equals(\"\")) {\n System.out.println(\"You see:\\n\" + stuff);\n }\n else {\n System.out.println(\"You see an empty room.\");\n }\n }", "public void notifyTurn(String name) {\n if(name.equals(username) && !(client.getPlayer() instanceof ComputerPlayer)) {\n JOptionPane.showMessageDialog(frame, \"It's your turn!\");\n } else if(!(client.getPlayer() instanceof ComputerPlayer)) {\n JOptionPane.showMessageDialog(frame, \"It's \" + name + \"'s turn!\");\n }\n inventoryArea.append(\"\\n\\nIt's \" + name + \"'s turn\");\n }", "public boolean checkPlays(Player player){\n return true;\n }", "public void onPlayerLoggedIn() {\n\t\tshowPlayerButtons();\n\t}", "public void checkFinished() {\n int check = 0;\n for (int i = 0; i < cards.size(); i++) {\n if (cards.get(i).getTurned() == true) {\n check++;\n }\n }\n if (check == cards.size()) {\n clip.stop();\n resultGUI = new ResultGUI(p1Points, p2Points);\n resultGUI.setSize(700, 500);\n resultGUI.setVisible(true);\n setVisible(false);\n }\n }", "private void displayPlayerMenu () {\n System.out.println();\n System.out.println(\"Player Selection Menu:\");\n System.out.println(\n \"Timid player...........\" + TIMID);\n System.out.println(\n \"Greedy player..........\" + GREEDY);\n System.out.println(\n \"Clever player..........\" + CLEVER);\n System.out.println(\n \"Interactive player.....\" + INTERACTIVE);\n }", "public static void checkResult() {\n\t\tint sum = PlayerBean.PLAYERONE - PlayerBean.PLAYERTWO;\n\n\t\tif (sum == 1 || sum == -2) {\n\t\t\tScoreBean.addWin();\n\t\t\tresult = \"player one wins\";\n\t\t} else {\n\t\t\tScoreBean.addLoss();\n\t\t\tresult = \"player two wins\";\n\t\t}\n\t}", "private boolean isOver() {\r\n return players.size() == 1;\r\n }", "public void displayWinner(Player player) {\n System.out.println(\"Partie terminée !\");\n System.out.println(player.getPlayerName()+\" remporte la partie avec les billes \"+player.getColor().toString(true));\n System.out.println(\"――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――\");\n }", "private void showMatch() {\n System.out.println(\"Player 1\");\n game.getOne().getField().showField();\n System.out.println(\"Player 2\");\n game.getTwo().getField().showField();\n }", "private void displayPlayers() {\n\t\tfor (Player p: game.getPlayers()) {\n\t\t\tview.updateDisplay(p.getId(), p.getDeck().getNumberOfCards());\n\t\t}\n\t}", "@Override\r\n\tpublic void showDoTimeMessage(Player player) {\n\t}", "@Override\r\n\tpublic void showGetPrisonCardMessage(Player player) {\n\t\t\r\n\t}", "public boolean hasPlayerInfo()\n {\n return this.getPlayerInfo() != null;\n }", "@SuppressWarnings(\"deprecation\")\n private void update(Player player) {\n Team team = teams.getTeam(player);\n\n if (team == null) {\n for (Player online : game.getPlayers()) {\n player.showPlayer(online);\n online.showPlayer(player);\n }\n return;\n }\n\n for (Player online : game.getPlayers()) {\n if (team.hasPlayer(online)) {\n player.hidePlayer(online);\n online.hidePlayer(player);\n } else {\n player.showPlayer(online);\n online.showPlayer(player);\n }\n }\n }", "public void checkVisible(Status status) {\n if (status == Status.GAMEOVER) {\n this.exit.setVisible(true);\n this.name.setVisible(true);\n this.score.setVisible(true);\n this.text.setVisible(true);\n this.textField.setVisible(true);\n } else{\n this.exit.setVisible(false);\n this.name.setVisible(false);\n this.score.setVisible(false);\n this.text.setVisible(false);\n this.textField.setVisible(false);\n }\n }", "public void display (Player player) {\n player.setScoreboard(this.bukkitScoreboard);\n }", "@Override\n protected String checkIfGameOver() {\n if(pgs.getP0Score() >= 50){\n return playerNames[0] + \" \" + pgs.getP0Score();\n }else if(pgs.getP1score() >= 50){\n return playerNames[1] + \" \" + pgs.getP1score();\n }\n\n return null;\n }", "public void displayPlayer(Nimsys nimSys, Scanner keyboard,ArrayList<Player> list)throws EventException {\r\n\t\tboolean flag = false;\r\n\t\tIterator<Player> aa = list.iterator();\r\n\t\tCollections.sort(list, new Comparator<Player>(){ //using collection sort to sort the ArrayList by Username\r\n\t\t\tpublic int compare(Player a1, Player a2) {\r\n\t\t\t\treturn a1.getUserName().compareTo(a2.getUserName());\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tif(nimSys.commands.length==1){\r\n\t\t\twhile(aa.hasNext()){\r\n\t\t\t\tPlayer in = aa.next();\r\n\t\t\t\tString information=in.showPlayer();\r\n\t\t\t\tSystem.out.println(information);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\twhile (aa.hasNext()) {\r\n\t\t\t\tPlayer in = aa.next();\r\n\t\t\t\tif(in.getUserName().equals(nimSys.commands[1])){\r\n\t\t\t\t\tSystem.out.println(in.showPlayer());\r\n\t\t\t\t\tflag = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tif(flag=false)\r\n\t\t\t\tSystem.out.println(\"This player don't exist\");\r\n\t\t}\r\n\t}", "public static void PVP(String name){ //for player vs player mode\r\n \r\n welcome.remove(p1first); \r\n welcome.remove(p2first);\r\n welcome.remove(hORt); //reformatting\r\n welcome.updateUI();\r\n \r\n if(name.equals(name1)&&numTurns==0){ //user 1 going first\r\n instructions.setText(\"<html>\" + name1 + \"<html> you are going first! <br><br> Please click the column number you wish to place your checker in. </html>\");\r\n whoseTurn = 1;\r\n welcome.remove(input);\r\n welcome.updateUI();\r\n canGo = true; //now, when the user clicks the column button, a checker may actually be placed\r\n }\r\n if(name.equals(name2)&&numTurns==0){ //user 2 going first\r\n instructions.setText(\"<html>\" + name2 + \"<html> you are going first! <br><br> Please click the column number you wish to place your checker in. </html>\");\r\n whoseTurn = 2;\r\n welcome.remove(input);\r\n welcome.updateUI();\r\n canGo = true;\r\n }\r\n }", "public static void decidedWinner(){\n if(playerOneWon == true ){\n//\n// win.Fill(\"Player One Has Won !\");\n// new WinnerWindow().setVisible(true);\n }\n else if (playerTwoWon == true){\n// win.Fill(\"Player Two Has Won !\");\n// new WinnerWindow().setVisible(true);\n }\n else\n {\n// win.Fill(\"Match Has been Tied !\");\n// new WinnerWindow().setVisible(true);\n }\n }", "private static void showPlayerDeckInfo() {\n }", "public void showTownStatusHere(Player player) {\n\t\ttry {\n\t\t\tTownyWorld world = plugin.getTownyUniverse().getWorld(player.getWorld().getName());\n\t\t\tCoord coord = Coord.parseCoord(player);\n\t\t\tshowTownStatusAtCoord(player, world, coord);\n\t\t} catch (TownyException e) {\n\t\t\tplugin.sendErrorMsg(player, e.getError());\n\t\t}\n\t}", "@Override\r\n\t\tpublic boolean isPlayer() {\n\t\t\treturn state.isPlayer();\r\n\t\t}", "public void showDuplicatePlayerNameMessage() {\n Optional<SelectGameScreen> maybeSelectGameScreen = getSelectGameScreenIfActive();\n if (maybeSelectGameScreen.isPresent()) {\n maybeSelectGameScreen.get().showDuplicatePlayerNameMessage();\n } else {\n showError(\"Player name already exists.\");\n }\n }", "public void updateIsWinning() {\n if(!isOpponentDone && !isUserDone) {\n TextView opponentPosition = (TextView) findViewById(R.id.position_indicator_receiver);\n TextView userPosition = (TextView) findViewById(R.id.position_indicator_sender);\n\n Run opponentRun = ((ChallengeReceiverFragment) receiverFragment).getRun();\n Run userRun = ((ChallengeSenderFragment) senderFragment).getRun();\n\n float opponentDistance = opponentRun.getTrack().getDistance();\n float userDistance = userRun.getTrack().getDistance();\n\n if (opponentDistance == userDistance) {\n opponentPosition.setText(R.string.dash);\n userPosition.setText(R.string.dash);\n } else if (opponentDistance > userDistance) {\n opponentPosition.setText(R.string.first_position);\n userPosition.setText(R.string.second_position);\n } else {\n opponentPosition.setText(R.string.second_position);\n userPosition.setText(R.string.first_position);\n }\n System.out.println(opponentDistance + \" \" + userDistance);\n }\n }", "public void showStatus(){\n\t\tjlMoves.setText(\"\"+moves);\n\t\tjlCorrectMoves.setText(\"\"+correctMoves);\n\t\tjlWrongMoves.setText(\"\"+wrongMoves);\n\t\tjlOpenMoves.setText(\"\"+openMoves);\n\t\tjlNumberGames.setText(\"\"+numberGames);\n\t}", "private void viewPlayer(Command command)\n { if(!command.hasSecondWord()) { \n // if there is no second word, we don't know where to go... \n Logger.Log(\"What do you want to view?\"); \n return; \n } \n \n String thingToView = command.getSecondWord();\n String inventory = \"inventory\";\n String companions = \"companions\";\n \n if (!thingToView.equals(inventory)&&!thingToView.equals(companions)){\n Logger.Log(\"You can only view your inventory or your current companions\");\n }\n else if (thingToView.equals(inventory)&&!player.inventory.isEmpty()) {\n Logger.Log(\"~*\" + player.playerName + \"'s Backpack *~\");\n player.viewInventory();\n Logger.Log(\"~*~*~*~*~*~\");\n }\n else if (thingToView.equals(inventory)&&player.inventory.isEmpty()){\n Logger.Log(\"There is nothing in your backpack...\");\n }\n else if (thingToView.equals(companions)&&!player.friends.isEmpty()) {\n Logger.Log(\"~*\" + player.playerName + \"'s Companions *~\");\n player.viewCompanions();\n Logger.Log(\"~*~*~*~*~*~\");\n }\n else if (thingToView.equals(companions)&&player.friends.isEmpty()) {\n Logger.Log(\"You don't have any companions at the moment :(\");\n }\n \n \n }", "private void displayWinScreen() {\n if (crewState.getShip().getShieldLevel() > 0) {\n new EventPopupWindow(String.format(\"You Won:\\nYou managed to collect all %d parts.\\n\\n\"\n + \"Score: %d\",\n getShipPartsNeededCount(),\n getScore()));\n } else {\n new EventPopupWindow(String.format(\"Although your ship is toast, you technically \"\n + \"still won the game. None of the parts are useful anymore, you will die on \"\n + \"this planet, but according to the job description you did everything that \"\n + \"was required. At least you can say you followed the spec, right?\\n\\n\"\n + \"Score: %d\",\n getShipPartsNeededCount(),\n getScore()));\n }\n }", "public void checkWin(){\n boolean result = false;\n if(game.getTurn() > 3){\n Player currentPlayer = game.getPlayerTurn();\n int playernumber = currentPlayer.getPlayericon();\n result = game.winChecker(game.getBored(),playernumber);\n if(result == true) {\n setWinMsgBox(currentPlayer.getPlayerName() + \" Is victorious :)\",\"WIN\");\n }else if(game.getTurn() == 8 && result == false){\n setWinMsgBox(\"Too bad it is a draw, No one out smarted the other -_-\",\"DRAW\");\n }else{}\n }else{\n result = false;\n }\n }", "@java.lang.Override\n public boolean hasPlayer() {\n return player_ != null;\n }", "public void drawGameCompleteScreen() {\r\n PennDraw.clear();\r\n\r\n if (didPlayerWin()) {\r\n PennDraw.text(width / 2, height / 2, \"You Win!\");\r\n } else if (didPlayerLose()) {\r\n PennDraw.text(width / 2, height / 2, \"You have lost...\");\r\n }\r\n\r\n PennDraw.advance();\r\n }", "private void show() {\n System.out.println(\"...................................................................................................................................................................\");\n System.out.print(Color.RESET.getPrintColor() + \"║\");\n for(int i = 0; i < players.size(); i++) {\n if (state.getTurn() == i) {\n System.out.print(Color.PURPLE.getPrintColor());\n System.out.print((i+1) + \"- \" + players.get(i).toString());\n System.out.print(Color.RESET.getPrintColor() + \"║\");\n }\n else {\n System.out.print(Color.CYAN.getPrintColor());\n System.out.print((i+1) + \"- \" + players.get(i).toString());\n System.out.print(Color.RESET.getPrintColor() + \"║\");\n }\n }\n System.out.println();\n System.out.print(\"Direction: \");\n if (state.getDirection() == +1) {\n System.out.println(Color.PURPLE.getPrintColor() + \"clockwise ↻\");\n }\n else {\n System.out.println(Color.PURPLE.getPrintColor() + \"anticlockwise ↺\");\n }\n System.out.println(Color.RESET.getPrintColor() + \"Turn: \" + Color.PURPLE.getPrintColor() + players.get(state.getTurn()).getName() + Color.RESET.getPrintColor());\n System.out.println(currentCard.currToString());\n if (controls.get(state.getTurn()) instanceof PcControl) {\n System.out.print(players.get(state.getTurn()).backHandToString() + Color.RESET.getPrintColor());\n }\n else {\n System.out.print(players.get(state.getTurn()).handToString() + Color.RESET.getPrintColor());\n }\n }", "@Override\n public boolean isPlayer() {\n return super.isPlayer();\n }", "private void show() {\n System.out.println(team.toString());\n }", "public void printVictoryMessage() { //main playing method\r\n System.out.println(\"Congrats \" + name + \" you won!!!\");\r\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 void showIfMeetsConditions() {\n\n if (!PrefUtils.getStopTrack(mContext) && (checkIfMeetsCondition() || isDebug)) {\n showRatePromptDialog();\n PrefUtils.setStopTrack(true, mContext);\n }\n }", "public void displayResult(View view){\n countPoints();\n String quantity;\n String player;\n boolean checked = ((CheckBox) findViewById(R.id.nickname)).isChecked();\n\n if (checked == true) {\n player = \"Anonymous\";\n } else {\n player = ((EditText) findViewById(R.id.name)).getText().toString();\n }\n /*\n method to show toast message with result\n */\n if (points > 1) {\n quantity = \" points!\";\n } else {\n quantity = \" point!\";\n }\n Toast.makeText(FlagQuiz.this, player + \", your score is: \" + points + quantity, Toast.LENGTH_LONG).show();\n }", "@Override\n\t\t\tpublic void run() \n\t\t\t{\n\t\t\t\tsummaryPanel.updatePlayerStatus(player.getPlayerId());\n\t\t\t}", "boolean isGameSpedUp();", "public void displayPlayerWinnings()\n {\n for(int card = 0; card < playerCardsWon; card++)\n {\n System.out.println(playerWinnings[card].toString());\n }\n }", "private void checks(){\n if (check(true)){\n changeBottomPane(\"White is in check! :(\");\n }\n else if (check(false)){\n changeBottomPane(\"Black is in check!!!!!!!!!!!\");\n }\n else{\n changeBottomPane(\"\");\n }\n }", "@java.lang.Override\n public boolean hasPokemonDisplay() {\n return pokemonDisplay_ != null;\n }", "private void checkMouseClick()\n {\n MouseInfo userClick = Greenfoot.getMouseInfo();\n \n int columnNum;\n int rowNum;\n \n if( Greenfoot.mouseClicked(this) )\n {\n columnNum = userClick.getX() / ( getWidth() / 3 );\n rowNum = userClick.getY() / ( getHeight() / 3 );\n \n if( board[rowNum][columnNum] == \"\" )\n {\n if( PlayerOneTurn == true )\n {\n board[rowNum][columnNum] = \"X\";\n \n PlayerOneTurn = false;\n messageShown = false;\n }\n else\n {\n board[rowNum][columnNum] = \"O\";\n \n PlayerOneTurn = true;\n messageShown = false;\n }\n }\n else\n {\n JOptionPane.showMessageDialog( null, \"you should select a different spot.\", \"Wrong step\", JOptionPane.PLAIN_MESSAGE );\n }\n }\n \n }", "protected void ifWon(){\n canvas.add(titleBorder);\n canvas.add(titleBox);\n Image wonText = new Image(205, 400, \"124-hw4/BreakoutText/wonText.png\");\n canvas.add(wonText);\n }", "public boolean activeFor(String player);", "private void checkGame() {\n if (game.checkWin()) {\n rollButton.setDisable(true);\n undoButton.setDisable(true);\n this.dialogFlag = true;\n if (game.isDraw()) {\n showDrawDialog();\n return;\n }\n if (game.getWinner().getName().equals(\"Computer\")) {\n showLoserDialog();\n return;\n }\n showWinnerDialog(player1);\n }\n }", "public void checkGame() {\n\n\t}", "private void checkVictory()\n {\n if(throne.getEnemyHealth() <= 0)\n {\n System.out.println(\"Congrats! The land is now free from all chaos and destruction. You are now very rich and wealthy. Yay\");\n alive = false;\n }\n }", "boolean hasPlayerBag();", "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}", "public void printPlayerStat(Player player);", "public void show() {\n isVisible = true;\n this.saveBorderColor(playerColor);\n this.setBorderColor(playerColor);\n }", "private void showGameOver()\n {\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n //Todo:\n // step 1. get the winner name using game.getWinner()\n // step 2. put the string player.getName()+\" won the game!\" to the string reference called \"result\"\n Player winner = game.getWinner();\n String result = winner.getName() + \" won the game!\";\n\n // pass the string referred by \"result\" to make an alert window\n // check the bottom of page 9 of the PA description for the appearance of this alert window\n Alert alert = new Alert(AlertType.CONFIRMATION, result, ButtonType.YES, ButtonType.NO);\n alert.showAndWait();\n if (alert.getResult() == ButtonType.YES)\n {\n Platform.exit();\n }\n }\n });\n }", "static void pickup(Player player, String what) {\n if (player.getLocation().contains(what)) {\n Thing thing = player.pickup(what);\n if (thing != null) {\n System.out.println(\"You now have \" + thing);\n }\n else {\n System.out.println(\"You can't carry that. You may need to drop something first.\");\n }\n }\n else {\n System.out.println(\"I don't see a \" + what);\n }\n }", "private void displayReplay() {\n if (isEnglish)\n Toast.makeText(this, REPLAY, Toast.LENGTH_LONG).show();\n else\n Toast.makeText(this, REPLAY_CHINESE, Toast.LENGTH_LONG).show();\n }", "public boolean meWin(){\n return whitePieces.size() > blackPieces.size() && isWhitePlayer;\n }", "@Override\n public void makeVisible(Player viewer) {\n \n }", "public static void interactivePlay() {\r\n\t\tint[][] board = createBoard();\r\n\t\tshowBoard(board);\r\n\r\n\t\tSystem.out.println(\"Welcome to the interactive Checkers Game !\");\r\n\r\n\t\tint strategy = getStrategyChoice();\r\n\t\tSystem.out.println(\"You are the first player (RED discs)\");\r\n\r\n\t\tboolean oppGameOver = false;\r\n\t\twhile (!gameOver(board, RED) && !oppGameOver) {\r\n\t\t\tboard = getPlayerFullMove(board, RED);\r\n\r\n\t\t\toppGameOver = gameOver(board, BLUE);\r\n\t\t\tif (!oppGameOver) {\r\n\t\t\t\tEnglishCheckersGUI.sleep(200);\r\n\r\n\t\t\t\tboard = getStrategyFullMove(board, BLUE, strategy);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tint winner = 0;\r\n\t\tif (playerDiscs(board, RED).length == 0 | playerDiscs(board, BLUE).length == 0){\r\n\t\t\twinner = findTheLeader(board);\r\n\t\t}\r\n\r\n\t\tif (winner == RED) {\r\n\t\t\tSystem.out.println();\r\n\t\t\tSystem.out.println(\"\\t *************************\");\r\n\t\t\tSystem.out.println(\"\\t * You are the winner !! *\");\r\n\t\t\tSystem.out.println(\"\\t *************************\");\r\n\t\t}\r\n\t\telse if (winner == BLUE) {\r\n\t\t\tSystem.out.println(\"\\n======= You lost :( =======\");\r\n\t\t}\r\n\t\telse\r\n\t\t\tSystem.out.println(\"\\n======= DRAW =======\");\r\n\t}", "public void act()\n {\n displayBoard();\n Greenfoot.delay(10);\n \n if( checkPlayerOneWin() == true )\n {\n JOptionPane.showMessageDialog( null, \"Congratulations Player One!\", \"playerOne Win\", JOptionPane.PLAIN_MESSAGE );\n \n Greenfoot.stop();\n }\n \n if( checkPlayerTwoWin() == true )\n {\n JOptionPane.showMessageDialog( null, \"Congratulations Player Two!\", \"plauerTwo Win\",JOptionPane.PLAIN_MESSAGE );\n \n Greenfoot.stop();\n }\n \n if( checkBoardFilled() == true )\n {\n JOptionPane.showMessageDialog( null, \"It is a draw!\", \"Wrong step\", JOptionPane.PLAIN_MESSAGE );\n \n Greenfoot.stop();\n }\n \n if( messageShown == false )\n {\n showTurn();\n \n messageShown = true;\n }\n \n checkMouseClick();\n }", "boolean isVisible(Player player, Entity entity);", "public boolean userStillInGame() {\n return playersInGame.contains(humanPlayer);\n }", "boolean playerExists() {\n return this.game.h != null;\n }", "public void showNextMovePrompt() {\n\n if(model.isXTurn()){\n resultLabel.setText(\"X's Turn\");\n }\n else{\n resultLabel.setText(\"O's Turn\");\n }\n }", "private void reportWinner (Player player) {\n System.out.println();\n System.out.println(\"Player \" + player.name() +\n \" wins.\");\n System.out.println();\n }", "@Override\n\tpublic void show() {\n\t\tsetUpGame();\n\t}", "public boolean needPlayer() {\n\t\treturn false;\n\t}", "public static void checkWinCondition() {\n\t\twin = false;\n\t\tif (curPlayer == 1 && arrContains(2, 4))\n\t\t\twin = true;\n\t\telse if (curPlayer == 2 && arrContains(1, 3))\n\t\t\twin = true;\n\t\tif (curPlayer == 2 && !gameLogic.Logic.arrContains(2, 4))\n\t\t\tP2P.gameLost = true;\n\t\telse if (gameLogic.Logic.curPlayer == 1 && !gameLogic.Logic.arrContains(1, 3))\n\t\t\tP2P.gameLost = true;\n\t\tif (P2P.gameLost == true) {\n\t\t\tif (gameLogic.Logic.curPlayer == 1)\n\t\t\t\tEndScreen.infoWindow.setText(\"<html><center><b><font size=25 color=black> Black player won! </font></b></center></html>\");\n\t\t\telse\n\t\t\t\tEndScreen.infoWindow.setText(\"<html><center><b><font size=25 color=black> Red player won! </font></b></center></html>\");\n\t\t}\n\t\telse\n\t\t\twin = false;\n\t}", "private void showStat() {\n\t\tSystem.out.println(\"=============================\");\n\t\tSystem.out.println(\"Your won! Congrates!\");\n\t\tSystem.out.println(\"The word is:\");\n\t\tSystem.out.println(\"->\\t\" + this.word.toString().replaceAll(\" \", \"\"));\n\t\tSystem.out.println(\"Your found the word with \" \n\t\t\t\t+ this.numOfWrongGuess + \" wrong guesses.\");\n\t}", "@Override\r\n public void mapshow() {\r\n showMap l_showmap = new showMap(d_playerList, d_country);\r\n l_showmap.check();\r\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 }", "public boolean isSetPlayer() {\n return this.player != null;\n }", "public boolean makeVisible(int player) {\n\t\tif (player < 0 || player >= 4) {\n\t\t\treturn false;\n\t\t}\n\t\tshow[player] = true;\n\t\treturn true;\n\t}", "public void showUserTurnMessage() {\n\t\tSystem.out.println(\" \");\n\t\tSystem.out.println(\"dein Zug... (9 drücken um zu speichern)\");\n\t\tSystem.out.println(\"\");\n\t}", "public void lookAround() {\n\t\t\tdisplay(\"The room is full of gold!\");\n\t\t}", "private void showWon( String mark ) {\n\tJOptionPane.showMessageDialog( null, mark + \" won!\" );\t\n }", "@Override\n protected void display() {\n System.out.println(\"Welcome to team builder tool!\");\n System.out.println(\"Current team: \" + team.getName());\n }", "private void checkSnap() {\n\t\tif (turned && view.getInstructions().getHidden())\n\t\t\tfor (PlayerView p: view.getPlayerViewList())\n\t\t\t\tif (playerHasPressed(p)) {\n\t\t\t\t\t// If last card is null, the turned card is the first card in the pile and can't be snap.\n\t\t\t\t\tif(game.getLastCard() != null)\n\t\t\t\t\t\tview.showLastCard(game.getLastCard().getValue());\n\t\t\t\t\tview.showSnapResult(p.getId(), game.snap(game.getPlayer(p.getId()-1)));\n\t\t\t\t\tdisplayPlayers();\n\t\t\t\t\tturned = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t}", "public void printDetailedPlayer(Player player);", "public void play()\n {\n if(board.getNumberOfDisks() == (board.size()*board.size()))\n {\n playing = false;\n message.setText(\"It is a Tie!\");\n }\n else\n {\n message.setFont(new Font(message.getName(), Font.BOLD, 28));\n int status = board.getStatus();\n if(status == 1)\n {\n errorSound();\n message.setText(\"Outside of boundaries location, try again.\");\n }\n else if(status == 2)\n {\n errorSound();\n message.setText(\"Coordinate already used, try again.\");\n }\n else if (status == 3)\n {\n message.setText(\"Congratulations Player 1, you won!\");\n playWinSound();\n playing = false;\n }\n else if(status == 4)\n {\n message.setText(\"Congratulations Player 2, you won!\");\n playWinSound();\n playing = false;\n }\n else if(status == 0)\n {\n diskAddedsound();\n if(board.getNumberOfDisks() % 2 == 0) {message.setText(\"Player 1 please choose a new position!\");}\n else if (board.getNumberOfDisks() % 2 == 1) {message.setText(\"Player 2 please choose a new position!\");}\n }\n }\n }", "public void updatePlayerPanel()\n {\n playerInfoPanel.updateLabel();\n }", "private void statusCheck() {\n\t\tif(status.equals(\"waiting\")) {if(waitingPlayers.size()>1) status = \"ready\";}\n\t\tif(status.equals(\"ready\")) {if(waitingPlayers.size()<2) status = \"waiting\";}\n\t\tif(status.equals(\"start\")) {\n\t\t\tif(players.size()==0) status = \"waiting\";\n\t\t}\n\t\tview.changeStatus(status);\n\t}", "public void checkHealth()\n {\n if(player.getHealth() <= 0)\n {\n System.out.println(\"\\n\" + \"You are dead :(\" + \"\\n\");\n alive = false;\n }\n }", "private void showGameScore() {\n System.out.println(messageProvider.provideMessage(\"score\"));\n System.out.println(settings.getPlayers().get(0).getScore()\n + \" vs \" + settings.getPlayers().get(1).getScore());\n }", "@Override\n public void landedOn(Player player) {}", "private static void displayUserTeam() {\n\t\tif (game.getCurrentRound()==1) {\n\t\t\tfor (int i = 0; i<11; i++) {\n\t\t\t\tplayerNameArray[i].setText(\"Name\");\n\t\t\t\timageArray[i].setIcon(MainGui.getShirt(\"noTeam\"));\n\t\t\t\tbuttonArray[i].setText(\"+\");\n\t\t\t}\n\t\t}\n\t}", "private void display(){\n out.println(\"\\n-STOCK EXCHANGE-\");\n out.println(\"Apple - Share Price: \" + game.apple.getSharePrice() + \" [\" + game.apple.top() + \"]\");\n out.println(\"BP - Share Price: \" + game.bp.getSharePrice() + \" [\" + game.bp.top() + \"]\");\n out.println(\"Cisco - Share Price: \" + game.cisco.getSharePrice() + \" [\" + game.cisco.top() + \"]\");\n out.println(\"Dell - Share Price: \" + game.dell.getSharePrice() + \" [\" + game.dell.top() + \"]\");\n out.println(\"Ericsson - Share Price: \" + game.ericsson.getSharePrice() + \" [\" + game.ericsson.top() + \"]\");\n\n out.println(\"\\n-PLAYERS-\");\n// System.out.println(playerList.toString());\n for (Player e : playerList) {\n if (e.equals(player)) {\n out.println(e.toString() + \" (you)\");\n } else {\n out.println(e.toString());\n }\n }\n }", "public void setWinningText(String player) {\n names.setText(player +\" WINS!!!\");\n }" ]
[ "0.692337", "0.6711084", "0.64252317", "0.64221704", "0.64050883", "0.63626933", "0.63544667", "0.6286927", "0.6271426", "0.6239004", "0.6222229", "0.62200665", "0.621913", "0.6212506", "0.61976063", "0.61880434", "0.61277044", "0.6102494", "0.6100307", "0.6069608", "0.60538584", "0.60486925", "0.6039106", "0.60335857", "0.6027757", "0.6014463", "0.59808266", "0.59621394", "0.5961525", "0.59397596", "0.5934102", "0.5930728", "0.59299237", "0.592489", "0.5924718", "0.59145546", "0.59098077", "0.59054697", "0.5903963", "0.58794767", "0.58709633", "0.5869242", "0.58621055", "0.58609813", "0.5860829", "0.5855202", "0.58534837", "0.58492", "0.58424056", "0.58423454", "0.5841895", "0.5841423", "0.58353204", "0.58239114", "0.5817973", "0.58173233", "0.58148915", "0.58121866", "0.58077824", "0.5804954", "0.58040357", "0.58003867", "0.5787413", "0.57779676", "0.5758894", "0.5757502", "0.5754258", "0.5750312", "0.5745638", "0.5737703", "0.57355386", "0.57350385", "0.57156897", "0.57064503", "0.5704802", "0.57046247", "0.5703635", "0.5694397", "0.569432", "0.56873196", "0.56868875", "0.56861013", "0.5665362", "0.56644124", "0.5662207", "0.56584215", "0.56538945", "0.56537586", "0.5652902", "0.56522095", "0.56455487", "0.5637025", "0.5636081", "0.56341237", "0.56321317", "0.56314206", "0.56258994", "0.56244373", "0.5621001", "0.5611725" ]
0.6753467
1
Displays if invalid input.
public final void invalidInput() { out.println("Command not recognized. Please try again."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void invalid() {\r\n\t\tSystem.out.println(\"Please enter a valid input\");\r\n\t}", "public void showInputError() {\n\n resultLabel.setText(\"Choose another space!\");\n\n }", "private void printErrorMenu() {\n System.out.println(\"Invalid input. Please check inputs and try again.\");\n }", "public void displayInvalid() {\n invalidLabel.setVisible(true);\n }", "public void showBadInputMessage() {\n\t\tJOptionPane.showMessageDialog(frame, \"Vänligen skriv siffror mellan 1 och \" + size);\n\t}", "public static String invalidInput() {\n return \"Invalid input!\";\n }", "public void showError(String errorMessage);", "void showError(String errorMessage);", "private void check_displaysError() {\n onView(withId(R.id.title))\n .check(matches(withText(R.string.input_title_error)));\n onView(withId(R.id.subtitle))\n .check(matches(withText(R.string.input_subtitle_error)));\n\n // And the button to be labeled try again\n onView(withId(R.id.hint))\n .check(matches(isDisplayed()))\n .check(matches(withText(R.string.input_hint_error)));\n }", "private void displayDuplicateInputError(){\n\t\tAlert alert = new Alert(Alert.AlertType.INFORMATION);\n\t\talert.setTitle(\"Duplicate Letter Dialog\");\n\t\talert.setHeaderText(\"Pay Attention!\");\n\t\talert.setContentText(\"You have already tried that letter, please try again\");\n\t\talert.showAndWait();\n\t}", "public void showError(String error);", "@Override\n public void displayInvalidUser() {\n Toast.makeText(this, \"Username cannot be blank or contain $\", Toast.LENGTH_LONG).show();\n }", "void showError(String message);", "void showError(String message);", "public static void printErrorForInvalidCommand(String userInput) {\n System.out.println(\"Aw man! I am unable to \" + userInput + \" yet! Please specify a different function! :D\");\n }", "public void show(Object errorMessage){\n\t\tSystem.out.println(\"Woops, something bad happened\");\n\t\tSystem.out.println(errorMessage);\n\t}", "@Override\n\tprotected String showErrorMessage() {\n\t\treturn \"There has been an error. Payment cannot process at this time. Please check with your credit card compay.\";\n\t}", "void displayErrorMessage(String message);", "public void displayError(String e){\n\t\tJOptionPane.showMessageDialog(null, e, \"Error\", JOptionPane.ERROR_MESSAGE);\n\t}", "@Override\n public void showError() {\n }", "public static void notValidNumberErr(){\n printLine();\n System.out.println(\" Oops! Please enter a valid task number\");\n printLine();\n }", "void displayUserTakenError(){\n error.setVisible(true);\n }", "@Override\n\tpublic void showError(String message) {\n\t\t\n\t}", "private void displayValidity() {\n if (allValid) spnValid.setText(\"All fields are valid!\");\n else spnValid.setText(\"There are invalid fields. Please go back and check these.\");\n }", "private void ImproperFillOutException() {\n JOptionPane.showMessageDialog(null, \"Fill out the form properly\");\n }", "void invalid() {\n\t\tSystem.out.println(\"falsche Eingabe...\");\n\t}", "private static void printErrorMessage() {\n System.out.println(\"Oh no! It looks like I wasn't able to understand the arguments you passed in :(\"\n + \"\\nI can only handle arguments passed in a format like the following: 1/2 * 3/4\\n\");\n }", "public static boolean printErrorMessage() {\n System.out.println(\"Error: Invalid URL entered\");\n return true;\n }", "private void showErrorMessage() {\n // hide the view for the list of movies\n mMoviesRecyclerView.setVisibility(View.INVISIBLE);\n // show the error message\n mErrorMessageDisplay.setVisibility(View.VISIBLE);\n }", "public static void userInputError(int input) //users inputs option that is out of bounds\n\t{\n\t\tSystem.out.println(\"ERROR: Selection Out Of Bounds! \\nOption \" + input + \" Does Not Exist\"); //error message\n\t\tSystem.out.println(\"Press 'Enter' To try Again\"); // prompt to try again\n\t}", "public void showErrorMessage() {\n mErrorMessageDisplay.setVisibility(View.VISIBLE);\n mMoviesList.setVisibility(View.INVISIBLE);\n }", "private void showErrorMessage(String errorMessage)\n {\n JOptionPane.showMessageDialog(null, ERRMSG_NAME_MISSING,\n HERO_ERROR_TITLE, JOptionPane.ERROR_MESSAGE);\n _nameField.requestFocusInWindow();\n }", "void showErrorMsg(String string);", "void showAlertForInvalidNumber();", "public void displayErrorMessage(String errorMessage) {\n JOptionPane.showMessageDialog(this, errorMessage);\n }", "public void unsuccessful()\n {\n inputFundsField.setText(\"An Error Has Occurred\");\n }", "@Override\n public void displayError() {\n Toast.makeText(this, \"Incorrect username or password.\", Toast.LENGTH_LONG).show();\n password.setText(\"\");\n }", "private static void exitAsInvalidInput() {\n\t\tSystem.out.println(\n\t\t\t\t\"You have entered invalid input. Exiting the system now.\");\n\t\tSystem.exit(0);\n\t}", "public void validationErr()\r\n\t{\n\t\tSystem.out.println(\"validation err\");\r\n\t}", "private void displayValidationError() {\n\n\t\tif (null != validationErrorTitle) {\n\t\t\tvalidationErrorParent.toFront();\n\t\t\tAppController.showMessage(validationErrorParent, validationErrorMessage, validationErrorTitle,\n\t\t\t\tvalidationErrorType);\n\t\t}\n\n\t\tclearValidationError();\n\t}", "public void printErrorParse() {\n\t\tSystem.out.println(ConsoleColors.RED + \"Invalid option. Please re-enter a valid option.\" + ConsoleColors.RESET);\n\t\t\n\t}", "public void invalidClubs() {\r\n\t\tJOptionPane.showMessageDialog(null,\r\n\t\t\t\t\"A club can not play against itself\");\r\n\t}", "public void displayErrorMessage(String errorMess)\n {\n JOptionPane.showMessageDialog(this,errorMess);\n }", "public void showErrorMessage() {\n\t\tthis.vm = null;\n\t\tplayButton.setText(\"►\");\n\n\t\tthis.remove(visualizerPanel);\n\t\tvisualizerPanel = new ErrorCard();\n\t\tvisualizerPanel.setPreferredSize(new Dimension(FRAME_WIDTH, FRAME_HEIGHT));\n\t\tthis.add(visualizerPanel);\n\t}", "void displayLoadingErrorMessage();", "private boolean validateUserInputs() {\n ArrayList<String> errors = new ArrayList();\n \n if (this.view.getContent().equals(\"\")) {\n errors.add(\"\\t - Enter a comment\");\n }\n \n if (errors.size() > 0) {\n String errorMsg = \"Unable to save new Asset.\\nDetails:\";\n for (String error : errors) {\n errorMsg += \"\\n\" + error;\n }\n JOptionPane.showMessageDialog(this.view, errorMsg, \"Unable to Save\", JOptionPane.INFORMATION_MESSAGE);\n return false;\n }\n return true;\n }", "protected void validateInput()\r\n\t{\r\n\t\tString errorMessage = null;\r\n\t\tif ( validator != null ) {\r\n\t\t\terrorMessage = validator.isValid(text.getText());\r\n\t\t}\r\n\t\t// Bug 16256: important not to treat \"\" (blank error) the same as null\r\n\t\t// (no error)\r\n\t\tsetErrorMessage(errorMessage);\r\n\t}", "void displayErrorMessage(String errorMessage){\r\n\t\t\r\n\t\tJOptionPane.showMessageDialog(this, errorMessage);\r\n\t\t\r\n\t}", "public void exibeDataNascimentoInvalida() {\n JOptionPane.showMessageDialog(\n null,\n Constantes.GERENCIAR_FUNCIONARIO_DATA_NASCIMENTO_INVALIDA,\n Constantes.GERENCIAR_FUNCIONARIO_TITULO,\n JOptionPane.PLAIN_MESSAGE\n );\n }", "void showError() {\n Toast.makeText(this, \"Please select answers to all questions.\", Toast.LENGTH_SHORT).show();\n }", "private boolean isInputValid() {\r\n String errorMessage = \"\";\r\n\r\n if (errorMessage.length() == 0) {\r\n return true;\r\n } else {\r\n// Show the error message.\r\n Dialogs.create()\r\n .title(\"Invalid Fields\")\r\n .masthead(\"Please correct invalid fields\")\r\n .message(errorMessage)\r\n .showError();\r\n return false;\r\n }\r\n }", "private void showErrorMessage() {\n gridview.setVisibility(View.INVISIBLE);\n // Then, show the error\n errorTextView.setVisibility(View.VISIBLE);\n }", "private void displaySomething() {\n if (userInputValue == null) {\n System.out.println(\"You have not yet entered anything.\");\n } else {\n System.out.println(\"Here's what you entered: \");\n System.out.println(userInputValue);\n }\n }", "public errPopUp(String value) {\n initComponents();\n errorMsg.setText(value);\n this.setVisible(false);\n }", "void displayWhiteboardTakenError(){\n createWhiteboard.setText(\"Whiteboard ID already taken. Select it from below or choose a new integer.\");\n\n }", "public void getMessage() {\r\n // use JOptionPane to have a pop up box informing user of the invalid token\r\n JOptionPane.showMessageDialog(null, \"Invalid Token \" + invalidToken);\r\n }", "private String getGUIErrorMsg(long errorcode) {\n\t\tif (errorcode == 0) {\n\t\t\treturn \"This popup shouldn't have launched!\";\n\t\t} else if (errorcode == 9) {\n\t\t\treturn \"Latitude input format incorrect!\\nValid Latitude values are -90 to 90 with negative values being south Latitude.\";\n\t\t} else if (errorcode == 10) {\n\t\t\treturn \"Longitude input format incorrect!\\nValid Longitude values are -180 to 180 with negative values being west latitude.\";\n\t\t} else if (errorcode == 11) {\n\t\t\treturn \"Date input format incorrect!\\nValid dates go <year>-<month>-<day>\\nValid month values are 1- 12 and valid day values are 1 - 31.\";\n\t\t} else if (errorcode == 12) {\n\t\t\treturn \"Time input format incorrect!\\nValid times go <hour>-<minute>-<second>\\nValid hour values are 0 - 23 and valid minute and second values are 0 - 59\";\n\t\t} else if (errorcode == 1) {\n\t\t\treturn \"Invalid latitude!\\nValid Latitude values are -90 to 90 with negative values being south Latitude.\";\n\t\t} else if (errorcode == 2) {\n\t\t\treturn \"Invalid Longitude!\\nValid Longitude values are -180 to 180 with negative values being west latitude.\";\n\t\t} else if (errorcode == 3) {\n\t\t\treturn \"Invalid Year!\\nValid year values are \" + Integer.MIN_VALUE + \" - \" + Integer.MAX_VALUE + \".\";\n\t\t} else if (errorcode == 4) {\n\t\t\treturn \"Invalid Month!\\nValid month values are 1 - 12\";\n\t\t} else if (errorcode == 5) {\n\t\t\treturn \"Invalid Day!\\nValid day values are 1 - 31\";\n\t\t} else if (errorcode == 6) {\n\t\t\treturn \"Invalid Hour!\\nValid hour values are 0 - 23\";\n\t\t} else if (errorcode == 7) {\n\t\t\treturn \"Invalid Minute!\\nValid minute values are 0 - 59\";\n\t\t} else if (errorcode == 8) {\n\t\t\treturn \"Invalid Second!\\nValid second values are 0 - 59\";\n\t\t} \n\t\treturn \"Undefined Error Message!\";\n\t}", "public static void printIndexInputNotDetectedError() {\n botSpeak(Message.INDEX_INPUT_NOT_DETECTED_ERROR);\n }", "private void displayNoRoomMsg() {\n\t\t \n\t\t //displays error message to user\n\t\t System.out.println(\"Unable to move in that direction.\\n\"\n\t\t\t\t \t\t\t\t+ \"There is no Room in that direction.\\n\");\n\t }", "public void displayInvalidNumberAlert(int i) {\r\n String invalidMessage = \"\";\r\n\r\n if(i == 1)\r\n invalidMessage = \"PLEASE ENTER A VALID NUMBER, 2 OR ABOVE, FOR YOUR AGE!!!\";\r\n else if(i == 2)\r\n invalidMessage = \"PLEASE ENTER A VALID HEIGHT IN INCHES!!!\";\r\n else\r\n invalidMessage = \"PLEASE ENTER A VALID WEIGHT IN POUNDS!!!\";\r\n\r\n //build error box\r\n AlertDialog.Builder newDialog = new AlertDialog.Builder(MainActivity.this);\r\n newDialog.setMessage(invalidMessage).setCancelable(false)\r\n .setPositiveButton(\"GOT IT!\", 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 //create alert box\r\n AlertDialog alert = newDialog.create();\r\n alert.setTitle(\"ERROR\");\r\n alert.show();\r\n }", "void errorBox(String title, String message);", "private void showErrorMessage() {\n /* First, hide the currently visible data */\n mRecyclerView.setVisibility(View.INVISIBLE);\n /* Then, show the error */\n mErrorMessageDisplay.setVisibility(View.VISIBLE);\n mLayout.setVisibility(View.INVISIBLE);\n }", "private boolean isInputValid() {\n String errorMessage = \"\";\n\n if (commentField.getText() == null || commentField.getText().length() == 0) {\n errorMessage += \"Не введен комментарий!\\n\";\n }\n if (timeField.getText() == null || timeField.getText().length() == 0) {\n errorMessage += \"Не введено время выполнения задачи!\\n\";\n }\n if (errorMessage.length() == 0) {\n return true;\n } if (errorMessage.length() == 0) {\n return true;\n } else {\n // Show the error message.\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\n alert.setTitle(\"Не введены все данные!\");\n alert.setHeaderText(null);\n alert.setContentText(\"Пожалуйста, введите все данные!\");\n alert.showAndWait();\n return false;\n }\n }", "public void alertInvalid(){\n Alert alert = new Alert(Alert.AlertType.WARNING);\n alert.setTitle(\"Herencia invalida\");\n alert.setHeaderText(\"Un hijo no puede ser hijo de su padre o un padre no puede ser padre de su padre,\"\n + \"No puede crear herencia con entidades debiles.\");\n alert.showAndWait();\n }", "public void showLoadingError() {\n System.out.println(\"Duke has failed to load properly.\");\n }", "@Override\n public void showEmptyFieldsValidationError() {\n showError(R.string.product_config_empty_fields_validation_error);\n }", "private void catcher() {\n String text;\n\n if (getTextFromEditText(R.id.distanceEdit).equals(\"\")) {\n text = getResourceString(R.string.err_no_distance);\n } else if (getTextFromEditText(R.id.fuelEdit).equals(\"\")) {\n text = getResourceString(R.string.err_no_fuel);\n } else {\n text = getResourceString(R.string.err_wrong_vals);\n }\n\n makeToast(text);\n }", "public void displayErrorMessage(String errorMessage) {\n\t\tJOptionPane.showMessageDialog(this, errorMessage);\n\t}", "private void showInvalidFileFormatError()\n {\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\n alert.setTitle(\"Image Load Error\");\n alert.setHeaderText(null);\n alert.setContentText(\"The file was not recognized as an image file.\");\n\n alert.showAndWait();\n }", "public void invalidMove() {\n JOptionPane.showMessageDialog(frame, \"Invalid move\", \"Invalid move\", JOptionPane.ERROR_MESSAGE);\n }", "public void invalidMovePrompt() {\n\t\tinvalidPrompted = true;\n\t\tSystem.out.println(\"Invalid move. Please try again\");\n\t}", "private void showErrorMessage() {\n /* First, hide the currently visible data */\n mEmptyTextView.setText(\"No Internet Connection\");\n mRecyclerView.setVisibility(View.INVISIBLE);\n /* Then, show the error */\n mEmptyTextView.setVisibility(View.VISIBLE);\n }", "private void displayError(Exception e)\n\t{\n\t\tJOptionPane.showMessageDialog(frame,\n\t\t\t\te.toString(),\n\t\t\t\t\"EXCEPTION\",\n\t\t\t\tJOptionPane.WARNING_MESSAGE);\n\t}", "public abstract void showErrorBox(Throwable error);", "private void showError(String message){\n\t\tsetupErrorState();\n\t\tsynapseAlert.showError(message);\n\t}", "private void errorPopUp() {\n new AlertDialog.Builder(mActivity)\n .setTitle(\"Oops\")\n .setMessage(\"Please choose an emotional state or enter a date and time\")\n .setPositiveButton(\"Ok\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n //Go back without changing anything\n dialogInterface.dismiss();\n }\n })\n .create()\n .show();\n }", "private void invalidTry(){\n setButtons(false);\n setMsgText(\"There are 2 players in game, you cannot join in now.\");\n }", "private void displayError(Exception ex)\n {\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\n alert.setTitle(\"Error dialog\");\n alert.setHeaderText(null);\n alert.setContentText(ex.getMessage());\n\n alert.showAndWait();\n }", "private void showError(String text, String title){\n JOptionPane.showMessageDialog(this,\n text, title, JOptionPane.ERROR_MESSAGE);\n }", "private void showErrorMessage() {\n // First, hide the currently visible data\n mRecyclerView.setVisibility(View.INVISIBLE);\n\n // Then, show the error\n mErrorMessageDisplay.setVisibility(View.VISIBLE);\n }", "private void showErrorMessage() {\n /* First, hide the currently visible data */\n mRecyclerView.setVisibility(View.INVISIBLE);\n /* Then, show the error */\n mErrorMessageDisplay.setVisibility(View.VISIBLE);\n }", "private boolean isInputValid() {\r\n String errorMessage = \"\";\r\n\r\n if (nameField.getText() == null || nameField.getText().length() == 0) {\r\n errorMessage += \"请输入直播名!\\n\";\r\n }\r\n if (urlField.getText() == null || urlField.getText().length() == 0) {\r\n errorMessage += \"请输入直播流!\\n\";\r\n }\r\n\r\n if (errorMessage.length() == 0) {\r\n return true;\r\n } else {\r\n Alert alert = new Alert(Alert.AlertType.ERROR);\r\n alert.setTitle(\"输入错误\");\r\n alert.setContentText(errorMessage);\r\n return false;\r\n }\r\n }", "private void drawNoResultsMessage()\n\t{\n\t\tFont font = new Font(\"Invalid\", Font.BOLD, 30);\t\t\n\t\ttitle.setBounds((super.getWidth()/2) - 380, (super.getHeight()/2) - 70, 800, 50);\n\t\ttitle.setFont(font);\n\t\tthis.add(title);\n\t}", "@Override\n\tpublic void display() {\n\t\tSystem.out.println(\"콘텐츠화면이 출력되었습니다\");\n\t}", "public static void printDateTimeErr() {\n printLine();\n System.out.println(\" Oops! Please enter your date in the yyyy-mm-dd format\\n\");\n printLine();\n }", "private boolean isInputValid() {\n\t\tString errorMessage = \"\";\n\t\t\n\t\tif (dateField.getText() == null || dateField.getText().length() == 0) {\n\t\t\terrorMessage += \"Kein gültiges Datum!\\n\";\n\t\t} else {\n\t\t\tif (!DateUtil.validDate(dateField.getText())) {\n\t\t\t\terrorMessage += \"Kein gültiges Datum. Benutze das dd.mm.yyy Format!\\n\";\n\t\t\t}\n\t\t}\n\t\tString categoryFieldSelection = categoryField.getSelectionModel().getSelectedItem();\n\t\tif (categoryFieldSelection.isEmpty() || categoryFieldSelection.length() == 0) {\n\t\t\terrorMessage += \"Keine gültige Kategorie!\\n\";\n\t\t}\n\t\tif (useField.getText() == null || useField.getText().length() == 0) {\n\t\t\terrorMessage += \"Kein gültiger Verwendungszweck!\\n\";\n\t\t}\n\t\tif (amountField.getText() == null || amountField.getText().length() == 0) {\n\t\t\terrorMessage += \"Kein gültiger Betrag!\\n\";\n\t\t} \n\t\t/**else {\n\t\t\t// try to parse the amount into a double\n\t\t\ttry {\n\t\t\t\tDouble.parseDouble(amountField.getText());\n\t\t\t} catch (NumberFormatException e) {\n\t\t\t\terrorMessage += \"Kein zulässiger Betrag! (Nur Dezimalzahlen erlaubt)\\n\";\n\t\t\t}\n\t\t}**/\n\t\tif (distributionKindField.getText() == null || distributionKindField.getText().length() == 0) {\n\t\t\terrorMessage += \"Keine gültige Ausgabeart!\\n\";\n\t\t}\n\n\t\tif (errorMessage.length() == 0) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\t// Show the error message.\n\t\t\tAlert alert = new Alert(AlertType.ERROR);\n\t\t\talert.initOwner(dialogStage);\n\t\t\talert.setTitle(\"Ungültige Eingaben\");\n\t\t\talert.setHeaderText(\"Bitte korrigieren Sie die Fehler in den Feldern.\");\n\t\t\talert.setContentText(errorMessage);\n\t\t\talert.showAndWait();\n\t\t\treturn false;\n\t\t}\n\t}", "public void showLoadingError() {\n showError(MESSAGE_LOADING_ERROR);\n }", "public void onError(String cadena) {\r\n\t\tJOptionPane.showMessageDialog(null, cadena, \"Movimiento invalido\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\r\n\t}", "@Override\r\n public final void displayError(final String message) {\r\n displayMessage(message, \"Error!\", SWT.ICON_ERROR);\r\n }", "@Override\r\n\tpublic void showErrReq() {\n\t\tdialog.cancel();\r\n\t\tshowNetView(true);\r\n\t}", "void displayLoginError(Boolean display) {\n\t\ttvError.setVisibility(display ? View.VISIBLE : View.INVISIBLE);\n\t}", "private int errorCheckingInt(String display) {\n\n\t\tint tempChoice;\n\t\tScanner input = new Scanner(System.in);\n\n\t\twhile (true) {\n\t\t\tSystem.out.print(\"\\n\" + display);\n\t\t\ttry {\n\t\t\t\ttempChoice = input.nextInt();\n\t\t\t\tif(display.equals(\"Enter number of kids: \")) { //only for kids\n\t\t\t\t\tif(tempChoice < 0)\n\t\t\t\t\t\tthrow new IllegalArgumentException(\"Error input\\n\");\n\t\t\t\t}\n\t\t\t\telse if (tempChoice < 1)\n\t\t\t\t\tthrow new IllegalArgumentException(\"Error input\\n\");\n\t\t\t\tbreak;\n\t\t\t} catch (InputMismatchException e) {\n\t\t\t\tSystem.out.println(\"Error input \\n\");\n\t\t\t\tinput.next();\n\t\t\t} catch (IllegalArgumentException e) {\n\t\t\t\tSystem.out.println(e);\n\t\t\t}\n\t\t}\n\n\t\tinput.nextLine();\n\n\t\treturn tempChoice;\n\t}", "public static void handleInvalidCommandException() {\n System.out.println(\"\\tSorry sir, I do not recognise this command.\");\n Help.execute();\n Duke.jarvis.printDivider();\n }", "private void showError(String msg)\n {\n \tJOptionPane.showMessageDialog(this, msg, \"Error\",\n \t\t\t\t JOptionPane.ERROR_MESSAGE);\n }", "private boolean isInputValid() {\n String errorMessage = \"\";\n\n if (ID.getText() == null || ID.getText().length() == 0) {\n errorMessage += \"No valid id!\\n\";\n System.out.println(\"fl\");\n }\n if (password.getText() == null || password.getText().length() == 0) {\n errorMessage += \"No valid password!\\n\"; \n }\n if (errorMessage.length() == 0) {\n return true;\n } else {\n // Show the error message.\n Dialogs.create()\n .title(\"Invalid Fields\")\n .masthead(\"Please correct invalid fields\")\n .message(errorMessage)\n .showError();\n return false;\n }\n }", "void drawError(String message);", "private boolean checkValidity() {\n if(txtSupplierCode.getText().equals(\"\")) {\n JOptionPane.showMessageDialog(null, \"Please Enter the Supplier Code!!\", \"EMPTY SUPPLIER CODE\", JOptionPane.ERROR_MESSAGE);\n txtSupplierCode.setBackground(Color.RED);\n return false;\n }\n if(txtSupplierName.getText().equals(\"\")) {\n JOptionPane.showMessageDialog(null, \"Please Enter the Supplier Name!!\", \"EMPTY SUPPLIER NAME\", JOptionPane.ERROR_MESSAGE);\n txtSupplierName.setBackground(Color.RED);\n return false;\n }\n return true;\n }", "public void printValidateInformation() {\n\n if(!validateFirstName()){\n System.out.println(\"The first name must be filled in\");\n }\n if(!validateFirstNameLength()){\n System.out.println(\"The first name must be at least 2 characters long.\");\n }\n if(!validateLastName()){\n System.out.println(\"The last name must be filled in\");\n }\n if(!validateLastNameLength()){\n System.out.println(\"The last name must be at least 2 characters long.\");\n }\n if(!validateZipcode()){\n System.out.println(\"The zipcode must be a 5 digit number.\");\n }\n if (!validateEmployeeID()){\n System.out.println(\"The employee ID must be in the format of AA-1234.\");\n }\n\n if(validateFirstName() && validateFirstNameLength() && validateLastName() && validateLastNameLength()\n && validateZipcode() && validateEmployeeID()){\n System.out.println(\"There were no errors found.\");\n }\n }", "public void showError(String message) {\n JOptionPane.showMessageDialog(this, message, \"Error!\", JOptionPane.ERROR_MESSAGE);\n }", "public void showExceptionDialog(Exception InputException)\r\n {\r\n JOptionPane.showMessageDialog(MainFrame,\r\n InputException.getMessage(),\r\n \"Error\",\r\n JOptionPane.ERROR_MESSAGE);\r\n }" ]
[ "0.7649919", "0.7573515", "0.7326641", "0.71421635", "0.70853794", "0.6881642", "0.6794847", "0.6773233", "0.6682939", "0.6650716", "0.66257805", "0.66061366", "0.66032696", "0.66032696", "0.6503743", "0.64883876", "0.6467091", "0.64523846", "0.64071393", "0.6392507", "0.6375379", "0.6366536", "0.63542295", "0.63458824", "0.6337134", "0.6333361", "0.6326773", "0.63233674", "0.63056326", "0.6298019", "0.62571514", "0.62283957", "0.6221106", "0.6220161", "0.6213067", "0.62048304", "0.62039256", "0.6190635", "0.61891484", "0.6187919", "0.6184863", "0.61827826", "0.61694795", "0.61623585", "0.6154724", "0.6147013", "0.61394227", "0.6119665", "0.61004794", "0.6081109", "0.60388625", "0.60365736", "0.60226357", "0.60188586", "0.601013", "0.60070676", "0.5999743", "0.5983492", "0.5979948", "0.596575", "0.5962715", "0.59500533", "0.5936987", "0.59361345", "0.59177715", "0.59172285", "0.5913724", "0.5898493", "0.5893621", "0.58849126", "0.58841616", "0.5879187", "0.58776176", "0.5876197", "0.5866585", "0.58462983", "0.58422494", "0.58415836", "0.5841153", "0.5841064", "0.5840835", "0.58406967", "0.5825623", "0.58198744", "0.5817764", "0.5816536", "0.58113635", "0.57994676", "0.5791989", "0.57824975", "0.57763237", "0.5775394", "0.5770697", "0.5753384", "0.57466584", "0.5741156", "0.5740474", "0.5738102", "0.5732742", "0.5722884" ]
0.65759444
14
The style of the text input, text output and max history entries are updated. This includes foreground color of the output text field (color used to show the user input) font and background color of the output text field color for the returned values in the output text field color and font of the input text field maximum stored history entries
public void updateStyle() { this.textOutput.setForeground(new Color(null, ShellPreference.OUTPUT_COLOR_INPUT.getRGB())); this.textOutput.setBackground(new Color(null, ShellPreference.OUTPUT_BACKGROUND.getRGB())); this.textOutput.setFont(new Font(null, ShellPreference.OUTPUT_FONT.getFontData())); this.colorOuput = new Color(null, ShellPreference.OUTPUT_COLOR_OUTPUT.getRGB()); this.colorError = new Color(null, ShellPreference.OUTPUT_COLOR_ERROR.getRGB()); this.textInput.setForeground(new Color(null, ShellPreference.INPUT_COLOR.getRGB())); this.textInput.setBackground(new Color(null, ShellPreference.INPUT_BACKGROUND.getRGB())); this.textInput.setFont(new Font(null, ShellPreference.INPUT_FONT.getFontData())); this.historyMax = ShellPreference.MAX_HISTORY.getInt(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void updateColors() {\n try {\n text.setBackground(colorScheme[0]); outputText.setBackground(colorScheme[0]); \n //frame.setBackground(colorScheme[0]);\n\n //Determines the color to set the splitter\n if(colorScheme[0].equals(Color.BLACK)) splitter.setBackground(Color.DARK_GRAY.darker());\n else if(colorScheme[0].equals(new Color(35,37,50))) splitter.setBackground(new Color(35,37,50).brighter());\n else if(colorScheme[0].equals(Color.GRAY) || colorScheme[0].equals(Color.LIGHT_GRAY) || colorScheme[0].equals(Color.WHITE)) splitter.setBackground(null);\n else splitter.setBackground(colorScheme[0].darker());\n\n text.getStyledDocument().getForeground(attributeScheme[11]); //Will work, but needs to be refreshed somehow.\n outputText.setForeground(colorScheme[11]); \n } catch (Exception e) {\n System.out.println(\"The error was here!\");\n e.printStackTrace();\n }\n }", "private void update() {\n\t\tColor fColor = fgColorProvider.getCurrentColor();\n\t\tColor bColor = bgColorProvider.getCurrentColor();\n\t\tsetText(String.format(\"Foreground color: (%d, %d, %d), background color: (%d, %d, %d).\", \n\t\t\t\tfColor.getRed(), fColor.getGreen(), fColor.getBlue(),\n\t\t\t\tbColor.getRed(), bColor.getGreen(), bColor.getBlue()));\n\t}", "public void updateGrepStyle()\n\t{\n\t\tgrepStyle.setName(textName.getText());\n\t\tgrepStyle.setBold(cbBold.getSelection());\n\t\tgrepStyle.setItalic(cbItalic.getSelection());\n\t\tgrepStyle.setForeground(cpForeground.getEffectiveColor());\n\t\tgrepStyle.setBackground(cpBackground.getEffectiveColor());\n\t\tgrepStyle.setUnderline(cpUnderline.isChecked());\n\t\tgrepStyle.setUnderlineColor(cpUnderline.getColor()); \n\t\tgrepStyle.setStrikeout(cpStrikethrough.isChecked());\n\t\tgrepStyle.setStrikeoutColor(cpStrikethrough.getColor());\n\t\tgrepStyle.setBorder(cpBorder.isChecked());\n\t\tgrepStyle.setBorderColor(cpBorder.getColor());\n\t}", "protected void updateDisplays() {\n \trecordDisplay.setText(formatField());\n \tif(updated) {\n \t\trecordDisplay.setFont(regularFont);\n \t} else {\n \t\trecordDisplay.setFont(italicFont);\n \t}\n }", "Integer getTxtColor();", "private void changeColors(){\n \n Color vaccanceColor = vaccance.getValue();\n String vaccRGB = getRGB(vaccanceColor);\n databaseHandler.setTermColor(\"vaccance\", vaccRGB);\n \n Color travailColor = travail.getValue();\n String travailRGB = getRGB(travailColor);\n databaseHandler.setTermColor(\"travail\", travailRGB);\n \n Color AnnivColor = anniverssaire.getValue();\n String summerSemRGB = getRGB(AnnivColor);\n databaseHandler.setTermColor(\"annivessaire\", summerSemRGB);\n \n Color formationColor = formation.getValue();\n String formationRGB = getRGB(formationColor);\n databaseHandler.setTermColor(\"formation\", formationRGB);\n \n Color workshopColor = workshop.getValue();\n String workshopRGB = getRGB(workshopColor);\n databaseHandler.setTermColor(\"workshop\", workshopRGB);\n \n Color certifColor = certif.getValue();\n String certifRGB = getRGB(certifColor);\n databaseHandler.setTermColor(\"certif\", certifRGB);\n \n Color importantColor = important.getValue();\n String importantRGB = getRGB(importantColor);\n databaseHandler.setTermColor(\"important\", importantRGB);\n \n Color urgentColor = urgent.getValue();\n String allHolidayRGB = getRGB(urgentColor);\n databaseHandler.setTermColor(\"urgent\", allHolidayRGB);\n \n \n \n }", "@Override\r\n public void focusLost(FocusEvent event) {\r\n if (event.getSource() instanceof TextField) {\r\n int value;\r\n int red = currentColor.getRed();\r\n int green = currentColor.getGreen();\r\n int blue = currentColor.getBlue();\r\n try {\r\n value = Integer.parseInt(((TextField) event.getSource()).getText());\r\n } catch (Exception e) {\r\n value = -1;\r\n }\r\n if (event.getSource() == redInput) {\r\n if (value >= 0 && value < 256)\r\n red = value;\r\n else\r\n redInput.setText(String.valueOf(red));\r\n } else if (event.getSource() == greenInput) {\r\n if (value >= 0 && value < 256)\r\n green = value;\r\n else\r\n greenInput.setText(String.valueOf(green));\r\n } else if (event.getSource() == blueInput) {\r\n if (value >= 0 && value < 256)\r\n blue = value;\r\n else\r\n blueInput.setText(String.valueOf(blue));\r\n }\r\n currentColor = new Color(red, green, blue);\r\n newSwatch.setForeground(currentColor);\r\n colorCanvas.setColor(currentColor);\r\n }\r\n }", "private void logTextColors() {\n // Get ColorStateLists (defines text colors for all possible states that the View can be in)\n ColorStateList cslEditText = mBind.maxWidthEdit.getTextColors();\n ColorStateList cslTextView = mBind.maxWidthLabel.getTextColors();\n\n // The standard Android enabled and disabled states (used in the ColorStateLists)\n int enabledState = android.R.attr.state_enabled;\n int disabledState = -android.R.attr.state_enabled;\n\n // Get the text colours for the enabled and disabled states\n int defaultColor = 0xFFFFFFFF;\n int editTextEnabled = cslEditText.getColorForState(new int[] {enabledState}, defaultColor);\n int editTextDisabled = cslEditText.getColorForState(new int[] {disabledState}, defaultColor);\n int textViewEnabled = cslTextView.getColorForState(new int[] {enabledState}, defaultColor);\n int textViewDisabled = cslTextView.getColorForState(new int[] {disabledState}, defaultColor);\n\n // Output\n Log.v(LOG_TAG, \"Text colour EditText enabled: \" + Integer.toHexString(editTextEnabled));\n Log.v(LOG_TAG, \"Text colour EditText disabled: \" + Integer.toHexString(editTextDisabled));\n Log.v(LOG_TAG, \"Text colour TextView enabled: \" + Integer.toHexString(textViewEnabled));\n Log.v(LOG_TAG, \"Text colour TextView disabled: \" + Integer.toHexString(textViewDisabled));\n\n // Example results on API level 23 with dark text on light background theme\n // (Compare with https://material.google.com/style/color.html#color-color-schemes):\n // EditText enabled: 0xDE000000: black, opacity 222/255 (87.06%) -> primary text\n // EditText disabled: 0x3A000000: black, opacity 58/255 (22.75%) -> 26.1% of primary text\n // TextView enabled: 0x8A000000: black, opacity 138/255 (54.12%) -> secondary text\n // TextView disabled: 0x24000000: black, opacity 36/255 (14.12%) -> 26.1% of secondary text\n }", "public void applyTheme(){\n\t\tColor backgroundColour = new Color(255,255,255);\n\t\tColor buttonText = new Color(255,255,255);\n\t\tColor normalText = new Color(0,0,0);\n\t\tColor buttonColour = new Color(15,169,249);\n\n\t\tfirstAttemptResult.setForeground(new Color(255,0,110));\n\t\tsecondAttemptResult.setForeground(new Color(255,0,0));\n\t\t\n\t\t// background color\n\t\tthis.setBackground(backgroundColour);\n\t\t\n\t\t// normal text\n\t\tspellQuery.setForeground(normalText);\n\t\tdefinitionArea.setForeground(normalText);\n\t\tlblstAttempt.setForeground(normalText);\n\t\tlblndAttempt.setForeground(normalText);\n\t\tfirstAttempt.setForeground(normalText);\n\t\tsecondAttempt.setForeground(normalText);\n\t\tcurrentQuiz.setForeground(normalText);\n\t\tcurrentStreak.setForeground(normalText);\n\t\tlongestStreak.setForeground(normalText);\n\t\tnoOfCorrectSpellings.setForeground(normalText);\n\t\tquizAccuracy.setForeground(normalText);\n\t\tlblNewLabel.setForeground(normalText);\n\t\tlblYouOnlyHave.setForeground(normalText);\n\t\tlblCurrentQuiz.setForeground(normalText);\n\t\tlblCurrentStreak.setForeground(normalText);\n\t\tlblLongeststreak.setForeground(normalText);\n\t\tlblSpelledCorrectly.setForeground(normalText);\n\t\tlblQuizAccuracy.setForeground(normalText);\n\t\t\n\t\t// button text\n\t\tbtnConfirmOrNext.setForeground(buttonText);\n\t\tbtnStop.setForeground(buttonText);\n\t\tbtnListenAgain.setForeground(buttonText);\n\t\t// normal button color\n\t\tbtnConfirmOrNext.setBackground(buttonColour);\n\t\tbtnStop.setBackground(buttonColour);\n\t\tbtnListenAgain.setBackground(buttonColour);\n\t}", "public void refresh()\n\t{\n\t\tif(grepStyle == null)\n\t\t{\n\t\t\ttextName.setText(\"\"); //$NON-NLS-1$\n\t\t\t\n\t\t\tcbBold.setSelection(false);\n\t\t\tcbItalic.setSelection(false);\n\t\t\t\n\t\t\tcpForeground.setColor(null);\n\t\t\tcpBackground.setColor(null);\n\t\t\tcpUnderline.setColor(null);\n\t\t\tcpUnderline.setChecked(false);\n\t\t\tcpStrikethrough.setColor(null);\n\t\t\tcpStrikethrough.setChecked(false);\n\t\t\tcpBorder.setColor(null);\n\t\t\tcpBorder.setChecked(false);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tString name = grepStyle.getName();\n\t\t\ttextName.setText(name == null ? StyleLabelProvider.LABEL_UNNAMED : name);\n\n\t\t\tcbBold.setSelection(grepStyle.isBold());\n\t\t\tcbItalic.setSelection(grepStyle.isItalic());\n\t\t\t\n\t\t\tcpForeground.setColor(grepStyle.getForeground());\n\t\t\tcpBackground.setColor(grepStyle.getBackground());\n\t\t\tcpUnderline.setColor(grepStyle.getUnderlineColor());\n\t\t\tcpUnderline.setChecked(grepStyle.isUnderline());\n\t\t\tcpStrikethrough.setColor(grepStyle.getStrikeoutColor());\n\t\t\tcpStrikethrough.setChecked(grepStyle.isStrikeout());\n\t\t\tcpBorder.setColor(grepStyle.getBorderColor());\n\t\t\tcpBorder.setChecked(grepStyle.isBorder());\n\t\t}\n\t\t\n\t\ttextName.selectAll();\n\t\tupdatePreview();\n\t}", "private void syncColourCodeInputBorders()\n {\n String newStyle = \"-fx-border-style: hidden hidden solid hidden; -fx-border-width: 3; -fx-border-color: \" + colourToRgb(toolColour) + \";-fx-border-radius:4px;\";\n rgbInput.setStyle(newStyle);\n hexInput.setStyle(newStyle);\n }", "private void applyForegroundColor() {\r\n\t\tthis.control.setForeground(PromptSupport.getForeground(this.control));\r\n\t}", "public TextDisplay(){\n // Default values for all TextDisplays \n fontSize = 20.0f;\n fontColor = new Color(0, 0, 0);\n fieldWidth = 100;\n fieldHeight = 30;\n drawStringX = 0;\n drawStringY = 15;\n input = \"\";\n hasBackground = false;\n \n // TextDisplays' TextArea specifics\n borderWidth = 5;\n borderHeight = 5;\n borderColor = new Color(0, 0, 0, 128);\n backgroundColor = new Color (255, 255, 255, 128);\n }", "public void update(){\n y -= 1; // Making the text float up\n // Making the text more transparent\n color = new Color(color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha() - 2);\n }", "private String getAndClrInput(){\n\t\tString theReturn = userInput.getText();\n\t\tuserInput.setText(\"\");\n\t\treturn theReturn;\n\t}", "@Override\r\n public void actionPerformed(ActionEvent event) {\r\n if (event.getSource() == redInput ||\r\n event.getSource() == greenInput ||\r\n event.getSource() == blueInput) {\r\n int value;\r\n int red = currentColor.getRed();\r\n int green = currentColor.getGreen();\r\n int blue = currentColor.getBlue();\r\n try {\r\n value = Integer.parseInt((String) event.getActionCommand());\r\n } catch (Exception e) {\r\n value = -1;\r\n }\r\n if (event.getSource() == redInput) {\r\n if (value >= 0 && value < 256)\r\n red = value;\r\n else\r\n redInput.setText(String.valueOf(red));\r\n } else if (event.getSource() == greenInput) {\r\n if (value >= 0 && value < 256)\r\n green = value;\r\n else\r\n greenInput.setText(String.valueOf(green));\r\n } else if (event.getSource() == blueInput) {\r\n if (value >= 0 && value < 256)\r\n blue = value;\r\n else\r\n blueInput.setText(String.valueOf(blue));\r\n }\r\n currentColor = new Color(red, green, blue);\r\n newSwatch.setForeground(currentColor);\r\n colorCanvas.setColor(currentColor);\r\n } else if (event.getSource() == okButton) {\r\n // Send action event to all color listeners\r\n if (colorListeners != null) {\r\n ActionEvent new_event = new ActionEvent(this,\r\n ActionEvent.ACTION_PERFORMED,\r\n CHANGE_ACTION);\r\n colorListeners.actionPerformed(new_event);\r\n }\r\n setVisible(false);\r\n } else if (event.getSource() == cancelButton) {\r\n if (colorListeners != null) {\r\n ActionEvent new_event = new ActionEvent(this,\r\n ActionEvent.ACTION_PERFORMED,\r\n CANCEL_ACTION);\r\n colorListeners.actionPerformed(new_event);\r\n }\r\n currentColor = null;\r\n setVisible(false);\r\n }\r\n }", "private void updateOutputText() {\r\n UiApplication.getUiApplication().invokeLater(new Runnable() {\r\n public void run() {\r\n _outputText.setText(_output);\r\n }\r\n });\r\n }", "private void colorPickerHander() {\n\t\tboolean validvalues = true;\n\t\tHBox n0000 = (HBox) uicontrols.getChildren().get(5);\n\t\tTextField t0000 = (TextField) n0000.getChildren().get(1);\n\t\tLabel l0000 = (Label) n0000.getChildren().get(3);\n\t\tString txt = t0000.getText();\n\t\tString[] nums = txt.split(\",\");\n\t\tif (nums.length != 4) {\n\t\t\tvalidvalues = false;\n\t\t\tGUIerrorout = new Alert(AlertType.ERROR, \"Invalid Color Format!\\nFormat: <0-255>,<0-255>,<0-255>,<0-1> \\n (red),(green),(blue),(alpha)\");\n\t\t\tGUIerrorout.showAndWait();\n\t\t}\n\t\tif (validvalues) {\n\t\t\tint[] colorvalues = new int[3];\n\t\t\tdouble alphavalue = 1.0;\n\t\t\ttry {\n\t\t\t\tfor(int x = 0; x < 3; x++) {\n\t\t\t\t\tcolorvalues[x] = Integer.parseInt(nums[x]);\n\t\t\t\t}\n\t\t\t\talphavalue = Double.parseDouble(nums[3]);\n\t\t\t} catch(Exception e) {\n\t\t\t\tvalidvalues = false;\n\t\t\t\tGUIerrorout = new Alert(AlertType.ERROR, \"Invalid Color Format!\\nFormat: <0-255>,<0-255>,<0-255>,<0-1> \\n (red),(green),(blue),(alpha)\");\n\t\t\t\tGUIerrorout.showAndWait();\n\t\t\t}\n\t\t\tif (alphavalue <= 1.0 && alphavalue >= 0.0 && colorvalues[0] >= 0 && colorvalues[0] < 256 && colorvalues[1] >= 0 && colorvalues[1] < 256 && colorvalues[2] >= 0 && colorvalues[2] < 256){\n\t\t\t\tif (validvalues) {\n\t\t\t\t\tl0000.setTextFill(Color.rgb(colorvalues[0],colorvalues[1],colorvalues[2],alphavalue));\n\t\t\t\t\tusercolors[colorSetterId] = Color.rgb(colorvalues[0],colorvalues[1],colorvalues[2],alphavalue);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tGUIerrorout = new Alert(AlertType.ERROR, \"Invalid Color Format!\\nFormat: <0-255>,<0-255>,<0-255>,<0-1> \\n (red),(green),(blue),(alpha)\");\n\t\t\t\tGUIerrorout.showAndWait();\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void changeColor(ColorEvent ce) {\n \n txtRed.setText(\"\"+ ce.getColor().getRed());\n txtGreen.setText(\"\"+ ce.getColor().getGreen());\n txtBlue.setText(\"\"+ ce.getColor().getBlue());\n \n \n }", "private void updateViews() {\n String twtText = tweetInput.getText().toString();\n int elapsedLength = MAX_CHAR_COUNT - twtText.length();\n if (elapsedLength >= 0 && elapsedLength < MAX_CHAR_COUNT) {\n btnTweet.setEnabled(true);\n charCounter.setTextColor(getResources().getColor(COLOR_GRAY));\n } else {\n btnTweet.setEnabled(false);\n charCounter.setTextColor(getResources().getColor(COLOR_RED));\n }\n\n charCounter.setText(\"\" + elapsedLength);\n }", "private void _updateField(Color c) {\n if (_isBackgroundColor) {\n _colorField.setBackground(c);\n }\n else {\n _colorField.setForeground(c);\n }\n _colorField.setText(getLabelText() + \" (\"+_option.format(c)+\")\");\n }", "private void updateOutputValues()\n {\n // TODO: You may place code here to update outputY and outputZ\n \t// Drawing code belongs in drawOnTheCanvas\n \t\n // example:\n outputY = inputA && inputC;\n }", "@Override\n public void update() {\n CommandNodeGameState gs = (CommandNodeGameState) state;\n String acc = String.valueOf(gs.getAcc());\n accView.setText(acc);\n String bak = String.valueOf(gs.getBak());\n bakView.setText(bak);\n String last = String.valueOf(gs.getLast());\n lastView.setText(last);\n String mode = String.valueOf(gs.getMode());\n modeView.setText(mode);\n String idle = String.valueOf(0);\n idleView.setText(idle);\n\n StringBuilder builder = new StringBuilder();\n for (int i = 0; i < gs.lineCount(); i++) {\n builder.append(gs.getLine(i).toString());\n builder.append(\"\\n\");\n }\n textArea.setText(builder.toString());\n\n if (state.isActive()) {\n highlightedLine = gs.getSelectedLine();\n } else {\n highlightedLine = null;\n }\n invalidate();\n }", "public void saveColorAndFont()\r\n\t{\r\n\t\tsaveColor();\r\n\t\tsaveFont();\r\n\t}", "private void writeTextArea(){\r\n try\r\n {\r\n //Fill in \"textArea\" with club names and results\r\n textArea.appendText(\"OK: \" + choiceHomeTeam.getValue() + \" - \" + choiceAwayTeam.getValue() + \" \" \r\n + Integer.valueOf(finalTimeHomeScore.getText()) + \":\"\r\n + Integer.valueOf(finalTimeAwayScore.getText()) + \"(\" \r\n + Integer.valueOf(halfTimeHomeScore.getText()) + \":\" \r\n + Integer.valueOf(halfTimeAwayScore.getText()) + \")\\n\");\r\n textArea.setWrapText(true);\r\n //the letters will be green\r\n textArea.setStyle(\"-fx-text-fill: #4F8A10;\"); \r\n }\r\n //Fill in \"textArea\" with erros\r\n catch(NumberFormatException e)\r\n {\r\n textArea.appendText(\"Error: \" + e.getMessage() + \"\\n\");\r\n textArea.setWrapText(true);\r\n //the letters will be red\r\n textArea.setStyle(\"-fx-text-fill: RED;\"); \r\n } \r\n }", "public void run() {\n \tdisposeColor(errorColor);\n \tdisposeColor(inputColor);\n \tdisposeColor(messageColor); \t\n \tdisposeColor(bkgColor); \t\n \tRGB errorRGB = PreferenceConverter.getColor(CUIPlugin.getDefault().getPreferenceStore(), BuildConsolePreferencePage.PREF_BUILDCONSOLE_ERROR_COLOR);\n \tRGB inputRGB = PreferenceConverter.getColor(CUIPlugin.getDefault().getPreferenceStore(), BuildConsolePreferencePage.PREF_BUILDCONSOLE_OUTPUT_COLOR);\n \tRGB messageRGB = PreferenceConverter.getColor(CUIPlugin.getDefault().getPreferenceStore(), BuildConsolePreferencePage.PREF_BUILDCONSOLE_INFO_COLOR);\n \tRGB bkgRGB = PreferenceConverter.getColor(CUIPlugin.getDefault().getPreferenceStore(), BuildConsolePreferencePage.PREF_BUILDCONSOLE_BACKGROUND_COLOR); \t\n \terrorColor = new Color(d, errorRGB);\n \tinputColor = new Color(d, inputRGB);\n \tmessageColor = new Color(d, messageRGB);\n \tbkgColor = new Color(d, bkgRGB);\n error.setColor(errorColor);\n input.setColor(inputColor);\n message.setColor(messageColor);\n console.setBackground(bkgColor);\n }", "public EvenOddRendererEditor() {\n txtContent = new JTextField();\n// txtContent.setText(value);\n txtContent.setFont(new Font(\"Arail\", Font.BOLD, contentFontHeight));\n// txtContent.setBackground(new java.awt.Color(51, 51, 51));\n// txtContent.setForeground(new java.awt.Color(255, 255, 255));\n txtContent.setBorder(new javax.swing.border.LineBorder(new Color(102, 153, 0), 2, false));\n txtContent.setPreferredSize(new java.awt.Dimension(6, 30));\n txtContent.setSelectedTextColor(new java.awt.Color(51, 51, 51));\n txtContent.setSelectionColor(new java.awt.Color(153, 204, 0));\n }", "public void sliderChange(int r, int g, int b)\n {\n String outPutR;\n String outPutG;\n String outPutB;\n \n //************output to binary()*******//\n if(binaryRBtn.isSelected() == true)\n { \n outPutR = Integer.toBinaryString(r);\n outPutG = Integer.toBinaryString(g);\n outPutB = Integer.toBinaryString(b);\n\n messageRed = (\"\" + outPutR); \n messageGreen = (\"\" + outPutG);\n messageBlue = (\"\" + outPutB);\n }\n //********output to hex()************//\n else if(hexDecRBtn.isSelected() == true)\n {\n outPutR = Integer.toHexString(r);\n outPutG = Integer.toHexString(g);\n outPutB = Integer.toHexString(b);\n \n \n messageRed = (\"\" + outPutR);\n messageGreen = (\"\" + outPutG);\n messageBlue = (\"\" + outPutB);\n }\n //**********output to Octal()********//\n else if(octalRBtn.isSelected() == true)\n {\n outPutR = Integer.toOctalString(r);\n outPutG = Integer.toOctalString(g);\n outPutB = Integer.toOctalString(b);\n \n \n messageRed = (\"\" + outPutR);\n messageGreen = (\"\" + outPutG);\n messageBlue = (\"\" + outPutB);\n }\n //*********output to decimal()********//\n else if(decimalRBtn.isSelected() == true)\n {\n outPutR = Integer.toString(r);\n outPutG = Integer.toString(g);\n outPutB = Integer.toString(b);\n \n \n messageRed = (\"\" + outPutR);\n messageGreen = (\"\" + outPutG);\n messageBlue = (\"\" + outPutB);\n }\n \n //******Bar Display rise and fall()******//\n redHeight=1; \n greenHeight=1; \n blueHeight=1;\n \n redHeight += rSliderValue;\n greenHeight += gSliderValue;\n blueHeight += bSliderValue;\n \n redYvalue = 475;\n redYvalue -=rSliderValue;\n \n greenYvalue = 475;\n greenYvalue -=gSliderValue;\n \n blueYvalue = 475;\n blueYvalue -=bSliderValue;\n \n repaint();\n \n }", "@Override\n\t\t\tpublic void update(Observable o, Object arg) {\n\t\t\t\tupdateCurrentLineForeground(Properties.getDefaultProperties().getOptinalColorProperty(currentLineFontForegroundKey, \n\t\t\t\t\t\t\t\t\t\t\tColor.black));\n\t\t\t}", "public void update()\n {\n int screenHeight;\n int screenWidth;\n \n // Only update if the video memory has been updated\n// if (!videocard.vgaMemReqUpdate)\n// return;\n\n // Determine if in graphic/text mode; this is set in graphics register 0x06\n if (videocard.graphicsController.alphaNumDisable != 0)\n {}\n\n // alphaNumDisable == 0; Text mode\n else\n {\n // Cursor attributes\n int cursorXPos; // Cursor column position\n int cursorYPos; // Cursor row position\n int cursorWidth = 8; // 8 or 9 pixel cursor width\n int fullCursorAddress = 162; // Cursor location (byte number in vga memory) \n\n // Screen attributes \n int maxScanLine = 15; // Character height - 1\n int numColumns = 80; // (Char. clocks - 1) + 1 , i.e. number of columns\n int numRows = 25; // Number of text rows in screen \n screenWidth = cursorWidth * numColumns; // Screen width in pixels\n videocard.verticalDisplayEnd = 399;\n screenHeight = videocard.verticalDisplayEnd + 1; // Screen height in pixels\n \n int fullStartAddress = 0; // Upper left character of screen\n\n logger.log(Level.INFO, \"[\" + MODULE_TYPE + \"]\" + \" update() in progress; text mode\");\n \n // Collect text features to be passed to screen update\n textModeAttribs.fullStartAddress = (short) 0; \n textModeAttribs.cursorStartLine = (byte) 14;\n textModeAttribs.cursorEndLine = (byte) 15;\n textModeAttribs.lineOffset = (short) 160;\n textModeAttribs.lineCompare = (short) 1023;\n textModeAttribs.horizPanning = (byte) 0;\n textModeAttribs.vertPanning = (byte) 0;\n textModeAttribs.lineGraphics = 1;\n textModeAttribs.splitHorizPanning = 0;\n \n // Check if the GUI window needs to be resized\n if ((screenWidth != oldScreenWidth) || (screenHeight != oldScreenHeight) || (maxScanLine != oldMaxScanLine))\n {\n screen.updateScreenSize(screenWidth, screenHeight, cursorWidth, maxScanLine + 1);\n oldScreenWidth = screenWidth;\n oldScreenHeight = screenHeight;\n oldMaxScanLine = maxScanLine;\n }\n\n // Determine cursor position in terms of rows and columns\n if (fullCursorAddress < fullStartAddress) // Cursor is not on screen, so set unreachable values\n {\n cursorXPos = 0xFFFF;\n cursorYPos = 0xFFFF;\n }\n else // Cursor is on screen, calculate position\n {\n cursorXPos = ((fullCursorAddress - fullStartAddress) / 2) % (screenWidth / cursorWidth);\n cursorYPos = ((fullCursorAddress - fullStartAddress) / 2) / (screenWidth / cursorWidth);\n }\n \n // Call screen update for text mode\n screen.updateText(0, fullStartAddress, cursorXPos, cursorYPos, textModeAttribs.getAttributes(), numRows);\n \n // Screen has been updated, copy new contents into 'snapshot'\n System.arraycopy(videocard.vgaMemory, fullStartAddress, videocard.textSnapshot, 0, 2 * numColumns * numRows);\n \n videocard.vgaMemReqUpdate = false;\n }\n }", "@Override\r\n public void calculate() {\r\n TextOutput();\r\n }", "private void updateDisplayText(double change) { updateDisplayText(change, null); }", "protected void updateTextChange() {\n \t\t\tfText= fDocumentUndoManager.fTextBuffer.toString();\n \t\t\tfDocumentUndoManager.fTextBuffer.setLength(0);\n \t\t\tfPreservedText= fDocumentUndoManager.fPreservedTextBuffer.toString();\n \t\t\tfDocumentUndoManager.fPreservedTextBuffer.setLength(0);\n \t\t}", "private void updateText()\n\t{\n\t\tlong longResult;\t\t//holds the value of result casted to type long\n\t\tif(result % 1 == 0)\n\t\t{\n\t\t\tlongResult = (long)result;\n\t\t\tupdateText += longResult;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tupdateText += result;\n\t\t}\n\t\tentry.setText (\"\");\n\t\tentry.setText (updateText);\n\t\tupdateText = \"\";\n\t\tentry.grabFocus();\n\t}", "private static void createContents() {\r\n\t\t\r\n\t\tcolorPreview = new Composite(colorUI, SWT.BORDER);\r\n\t\tcolorPreview.setBounds(10, 23, 85, 226);\r\n\t\t\r\n\t\tscRed = new Scale(colorUI, SWT.NONE);\r\n\t\tscRed.setMaximum(255);\r\n\t\tscRed.setMinimum(0);\r\n\t\tscRed.setForeground(SWTResourceManager.getColor(SWT.COLOR_RED));\r\n\t\tscRed.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));\r\n\t\tscRed.setBounds(244, 34, 324, 42);\r\n\t\tscRed.setIncrement(1);\r\n\t\tscRed.setPageIncrement(10);\r\n\t\tscRed.addSelectionListener(new SelectionAdapter(){\r\n\t\t\tpublic void widgetSelected(SelectionEvent e){\r\n\t\t\t\tR = scRed.getSelection();\r\n\t\t\t\tmRed.setText(Integer.toString(scRed.getSelection()));\r\n\t\t\t\tcolorPreview.setBackground(SWTResourceManager.getColor(R, G, B));\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tmRed = new Label(colorUI, SWT.NONE);\r\n\t\tmRed.setAlignment(SWT.RIGHT);\r\n\t\tmRed.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));\r\n\t\tmRed.setBounds(180, 47, 55, 15);\r\n\t\tmRed.setText(\"0\");\r\n\r\n\t\tscGreen = new Scale(colorUI, SWT.NONE);\r\n\t\tscGreen.setMaximum(255);\r\n\t\tscGreen.setMinimum(0);\r\n\t\tscGreen.setForeground(SWTResourceManager.getColor(SWT.COLOR_RED));\r\n\t\tscGreen.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));\r\n\t\tscGreen.setBounds(244, 84, 324, 42);\r\n\t\tscGreen.setIncrement(1);\r\n\t\tscGreen.setPageIncrement(10);\r\n\t\tscGreen.addSelectionListener(new SelectionAdapter(){\r\n\t\t\tpublic void widgetSelected(SelectionEvent e){\r\n\t\t\t\tG = scGreen.getSelection();\r\n\t\t\t\tmGreen.setText(Integer.toString(scGreen.getSelection()));\r\n\t\t\t\tcolorPreview.setBackground(SWTResourceManager.getColor(R, G, B));\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tmGreen = new Label(colorUI, SWT.NONE);\r\n\t\tmGreen.setAlignment(SWT.RIGHT);\r\n\t\tmGreen.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));\r\n\t\tmGreen.setText(\"0\");\r\n\t\tmGreen.setBounds(180, 97, 55, 15);\r\n\t\t\r\n\t\tscBlue = new Scale(colorUI, SWT.NONE);\r\n\t\tscBlue.setMaximum(255);\r\n\t\tscBlue.setMinimum(0);\r\n\t\tscBlue.setForeground(SWTResourceManager.getColor(SWT.COLOR_RED));\r\n\t\tscBlue.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));\r\n\t\tscBlue.setBounds(244, 138, 324, 42);\r\n\t\tscBlue.setIncrement(1);\r\n\t\tscBlue.setPageIncrement(10);\r\n\t\tscBlue.addSelectionListener(new SelectionAdapter(){\r\n\t\t\tpublic void widgetSelected(SelectionEvent e){\r\n\t\t\t\tB = scBlue.getSelection();\r\n\t\t\t\tmBlue.setText(Integer.toString(scBlue.getSelection()));\r\n\t\t\t\tcolorPreview.setBackground(SWTResourceManager.getColor(R, G, B));\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tmBlue = new Label(colorUI, SWT.NONE);\r\n\t\tmBlue.setAlignment(SWT.RIGHT);\r\n\t\tmBlue.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));\r\n\t\tmBlue.setText(\"0\");\r\n\t\tmBlue.setBounds(180, 151, 55, 15);\r\n\t\t\r\n\t\tscAlpha = new Scale(colorUI, SWT.NONE);\r\n\t\tscAlpha.setMaximum(255);\r\n\t\tscAlpha.setMinimum(0);\r\n\t\tscAlpha.setForeground(SWTResourceManager.getColor(SWT.COLOR_RED));\r\n\t\tscAlpha.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));\r\n\t\tscAlpha.setBounds(244, 192, 324, 42);\r\n\t\tscAlpha.setIncrement(1);\r\n\t\tscAlpha.addSelectionListener(new SelectionAdapter(){\r\n\t\t\tpublic void widgetSelected(SelectionEvent e){\r\n\t\t\t\tA = scAlpha.getSelection();\r\n\t\t\t\tmAlpha.setText(Integer.toString(scAlpha.getSelection()));\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tbtnOkay = new Button(colorUI, SWT.NONE);\r\n\t\tbtnOkay.setBounds(300, 261, 80, 30);\r\n\t\tbtnOkay.setText(\"Okay\");\r\n\t\tbtnOkay.addSelectionListener(new SelectionAdapter(){\r\n\t\t\tpublic void widgetSelected(SelectionEvent e){\r\n\t\t\t\tOptions.cr.ColorR = R;\r\n\t\t\t\tOptions.cr.ColorG = G;\r\n\t\t\t\tOptions.cr.ColorB = B;\r\n\t\t\t\tOptions.cr.ColorA = A;\r\n\t\t\t\tOptions.colorPreview.setBackground(SWTResourceManager.getColor(R, G, B));\r\n\t\t\t\tcolorUI.close();\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tbtnCancel = new Button(colorUI, SWT.NONE);\r\n\t\tbtnCancel.setText(\"Cancel\");\r\n\t\tbtnCancel.setBounds(195, 261, 80, 30);\r\n\t\tbtnCancel.addSelectionListener(new SelectionAdapter(){\r\n\t\t\tpublic void widgetSelected(SelectionEvent e){\r\n\t\t\t\tOptions.colorPreview.setBackground(SWTResourceManager.getColor(Options.cr.ColorR, Options.cr.ColorG, Options.cr.ColorB));\r\n\t\t\t\tR = Options.cr.ColorR;\r\n\t\t\t\tG = Options.cr.ColorG;\r\n\t\t\t\tB = Options.cr.ColorB;\r\n\t\t\t\tA = Options.cr.ColorA;\r\n\t\t\t\tcolorUI.close();\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tmAlpha = new Label(colorUI, SWT.NONE);\r\n\t\tmAlpha.setAlignment(SWT.RIGHT);\r\n\t\tmAlpha.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));\r\n\t\tmAlpha.setText(\"0\");\r\n\t\tmAlpha.setBounds(180, 206, 55, 15);\r\n\t\t\r\n\t\tLabel lblRed = new Label(colorUI, SWT.NONE);\r\n\t\tlblRed.setFont(SWTResourceManager.getFont(\"Segoe UI\", 9, SWT.BOLD));\r\n\t\tlblRed.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));\r\n\t\tlblRed.setBounds(123, 47, 55, 15);\r\n\t\tlblRed.setText(\"Red\");\r\n\t\t\r\n\t\tLabel lblGreen = new Label(colorUI, SWT.NONE);\r\n\t\tlblGreen.setFont(SWTResourceManager.getFont(\"Segoe UI\", 9, SWT.BOLD));\r\n\t\tlblGreen.setText(\"Green\");\r\n\t\tlblGreen.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));\r\n\t\tlblGreen.setBounds(123, 97, 55, 15);\r\n\t\t\r\n\t\tLabel lblBlue = new Label(colorUI, SWT.NONE);\r\n\t\tlblBlue.setFont(SWTResourceManager.getFont(\"Segoe UI\", 9, SWT.BOLD));\r\n\t\tlblBlue.setText(\"Blue\");\r\n\t\tlblBlue.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));\r\n\t\tlblBlue.setBounds(123, 151, 55, 15);\r\n\t\t\r\n\t\tLabel lblAlpha = new Label(colorUI, SWT.NONE);\r\n\t\tlblAlpha.setFont(SWTResourceManager.getFont(\"Segoe UI\", 9, SWT.BOLD));\r\n\t\tlblAlpha.setText(\"Alpha\");\r\n\t\tlblAlpha.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));\r\n\t\tlblAlpha.setBounds(123, 206, 55, 15);\r\n\t\t\r\n\t\t\r\n\t}", "public void updateText(String textToDisplay, int textSize, Color textColour, Color backgroundColour)\n {\n GreenfootImage textImage = new GreenfootImage(textToDisplay, textSize, textColour, backgroundColour); // Create and store the corresponding GreenfootImage for the desired text to be displayed\n setImage(textImage);\n }", "public void UpdateTextStyle(ControlStyles style,TextView editText) {\n try {\n if(editText==null) {\n editText = (EditText) base.activeView;\n }\n EditorControl tag= base.GetControlTag(editText);\n if(style==ControlStyles.H1){\n if(base.ContainsStyle(tag._ControlStyles, ControlStyles.H1)) {\n editText.setTextSize(TypedValue.COMPLEX_UNIT_SP, base.NORMALTEXTSIZE);\n tag= base.UpdateTagStyle(tag, ControlStyles.H1, Op.Delete);\n tag= base.UpdateTagStyle(tag, ControlStyles.H2, Op.Delete);\n tag= base.UpdateTagStyle(tag, ControlStyles.NORMAL, Op.Insert);\n }else{\n editText.setTextSize(TypedValue.COMPLEX_UNIT_SP, base.H1TEXTSIZE);\n tag= base.UpdateTagStyle(tag, ControlStyles.H1, Op.Insert);\n tag= base.UpdateTagStyle(tag, ControlStyles.H2, Op.Delete);\n tag= base.UpdateTagStyle(tag, ControlStyles.NORMAL, Op.Delete);\n }\n\n }\n else if(style==ControlStyles.H2){\n if(base.ContainsStyle(tag._ControlStyles, ControlStyles.H2)) {\n editText.setTextSize(TypedValue.COMPLEX_UNIT_SP, base.NORMALTEXTSIZE);\n tag= base.UpdateTagStyle(tag, ControlStyles.H1, Op.Delete);\n tag= base.UpdateTagStyle(tag, ControlStyles.H2, Op.Delete);\n tag= base.UpdateTagStyle(tag, ControlStyles.NORMAL, Op.Insert);\n }else{\n editText.setTextSize(TypedValue.COMPLEX_UNIT_SP, base.H2TEXTSIZE);\n tag= base.UpdateTagStyle(tag, ControlStyles.H1, Op.Delete);\n tag= base.UpdateTagStyle(tag, ControlStyles.H2, Op.Insert);\n tag= base.UpdateTagStyle(tag, ControlStyles.NORMAL, Op.Delete);\n }\n }\n else if(style==ControlStyles.NORMAL){\n editText.setTextSize(TypedValue.COMPLEX_UNIT_SP, base.NORMALTEXTSIZE);\n tag= base.UpdateTagStyle(tag, ControlStyles.H1, Op.Delete);\n tag= base.UpdateTagStyle(tag, ControlStyles.H2, Op.Delete);\n if(!base.ContainsStyle(tag._ControlStyles, ControlStyles.NORMAL)) {\n tag= base.UpdateTagStyle(tag, ControlStyles.NORMAL, Op.Insert);\n }\n }\n else if(style==ControlStyles.BOLD){\n if(base.ContainsStyle(tag._ControlStyles, ControlStyles.BOLD)) {\n tag= base.UpdateTagStyle(tag, ControlStyles.BOLD, Op.Delete);\n editText.setTypeface(null, Typeface.NORMAL);\n }else if(base.ContainsStyle(tag._ControlStyles, ControlStyles.BOLDITALIC)){\n tag= base.UpdateTagStyle(tag, ControlStyles.BOLDITALIC, Op.Delete);\n tag= base.UpdateTagStyle(tag, ControlStyles.ITALIC, Op.Insert);\n editText.setTypeface(null, Typeface.ITALIC);\n }\n else if(base.ContainsStyle(tag._ControlStyles, ControlStyles.ITALIC)){\n tag= base.UpdateTagStyle(tag, ControlStyles.BOLDITALIC, Op.Insert);\n tag= base.UpdateTagStyle(tag, ControlStyles.ITALIC, Op.Delete);\n editText.setTypeface(null, Typeface.BOLD_ITALIC);\n }else{\n tag= base.UpdateTagStyle(tag, ControlStyles.BOLD, Op.Insert);\n editText.setTypeface(null, Typeface.BOLD);\n }\n }\n else if(style==ControlStyles.ITALIC){\n if(base.ContainsStyle(tag._ControlStyles, ControlStyles.ITALIC)) {\n tag= base.UpdateTagStyle(tag, ControlStyles.ITALIC, Op.Delete);\n editText.setTypeface(null, Typeface.NORMAL);\n }else if(base.ContainsStyle(tag._ControlStyles, ControlStyles.BOLDITALIC)){\n tag= base.UpdateTagStyle(tag, ControlStyles.BOLDITALIC, Op.Delete);\n tag= base.UpdateTagStyle(tag, ControlStyles.BOLD, Op.Insert);\n editText.setTypeface(null, Typeface.BOLD);\n }\n else if(base.ContainsStyle(tag._ControlStyles, ControlStyles.BOLD)){\n tag= base.UpdateTagStyle(tag, ControlStyles.BOLDITALIC, Op.Insert);\n tag= base.UpdateTagStyle(tag, ControlStyles.BOLD, Op.Delete);\n editText.setTypeface(null, Typeface.BOLD_ITALIC);\n }else{\n tag= base.UpdateTagStyle(tag, ControlStyles.ITALIC, Op.Insert);\n editText.setTypeface(null, Typeface.ITALIC);\n }\n }\n editText.setTag(tag);\n }\n catch (Exception e){\n\n }\n\n }", "public void update()\n\t{\n\t\tsetFont(attribs.getFont());\n\t\tTextMeshGenerator.generateTextVao(this.text, this.attribs, this.font, this.mesh);\n\t\tsize = new Vector2f(mesh.maxPoint.x(), mesh.maxPoint.y());\n\t}", "private void attachInputListeners() {\n inputTextField.textProperty().addListener((observable, oldValue, newValue) -> {\n if (userInputHistoryPointer == userInputHistory.size()) {\n currentInput = newValue;\n }\n });\n\n inputTextField.addEventHandler(KeyEvent.KEY_PRESSED, keyEvent -> {\n switch (keyEvent.getCode()) {\n case ENTER:\n keyEvent.consume();\n handleUserInput();\n break;\n case UP:\n keyEvent.consume();\n if (userInputHistoryPointer >= 1) {\n userInputHistoryPointer -= 1;\n setText(userInputHistory.get(userInputHistoryPointer));\n }\n break;\n case DOWN:\n keyEvent.consume();\n if (userInputHistoryPointer < userInputHistory.size() - 1) {\n userInputHistoryPointer += 1;\n setText(userInputHistory.get(userInputHistoryPointer));\n } else if (userInputHistoryPointer == userInputHistory.size() - 1) {\n userInputHistoryPointer += 1;\n setText(currentInput);\n }\n break;\n default:\n break;\n }\n });\n }", "protected void updateDisplay() {\r\n setValue(Integer.toString(value.getValue()));\r\n }", "@Override\r\n\t\tpublic void changedUpdate(DocumentEvent e) {\n\t\t\tMessage = t.getText();\r\n\t\t\tcanvas.repaint();\r\n\t\t\t\r\n\t\t}", "public void changeText()\n {\n Double base = 1.0;\n Double exponent = 0.0;\n\n try\n {\n /*get the values of the text inputs and set them to their respective variable, converting them to\n a double*/\n base = Double.parseDouble(txtBase.getText());\n exponent = Double.parseDouble(txtExponent.getText());\n }\n catch (NumberFormatException e) {\n /*On NumberFormatException, do nothing. Suppresses errors in the console which we do not need to\n know about, this is an expected and solved issue.*/\n }\n\n //calculate the new result, based on the current values of exponent and base, then set it to the output.\n Double result = Math.pow(base, exponent);\n lblResult.setText(result.toString());\n }", "public Color update() {\n /*\n * The method GetColor() returns a normalized color value from the sensor and\n * can be Useful if outputting the color to use an RGB LED or similar. To read\n * the raw color, or use GetRawColor().\n *\n * The color sensor works best when within a few inches from an object in well\n * lit conditions (the built in LED is a big help here!). The farther an object\n * is the more light from the surroundings will bleed into the measurements and\n * make it difficult to accurately determine its color.\n */\n edu.wpi.first.wpilibj.util.Color detectedColor = m_ColorSensor.getColor();\n /*\n * Run the color match algorithm on our detected color\n */\n String colorString;\n ColorMatchResult match = m_colorMatcher.matchClosestColor(detectedColor);\n\n if (match.color == kBlueTarget) {\n colorString = \"Blue\";\n mCurrentColor = Color.blue;\n } else if (match.color == kRedTarget) {\n colorString = \"Red\";\n mCurrentColor = Color.red;\n } else if (match.color == kGreenTarget) {\n colorString = \"Green\";\n mCurrentColor = Color.green;\n } else if (match.color == kYellowTarget) {\n colorString = \"Yellow\";\n mCurrentColor = Color.yellow;\n } else {\n colorString = \"Unknown\";\n mCurrentColor = Color.unknown;\n }\n /**\n * Open Smart Dashboard or Shuffleboard to see the color detected by the Sensor.\n */\n SmartDashboard.putNumber(\"Red\", detectedColor.red);\n SmartDashboard.putNumber(\"Green\", detectedColor.green);\n SmartDashboard.putNumber(\"Blue\", detectedColor.blue);\n SmartDashboard.putNumber(\"Confidence\", match.confidence);\n SmartDashboard.putString(\"Detected Color\", colorString);\n return mCurrentColor;\n }", "@Override\n public void handle(ActionEvent t) {\n\n iniciarCalculos();\n\n Text title1 = new Text(\"Parametros\");\n Text title2 = new Text(\"Resultados\");\n Text title3 = new Text(\"Probabilidad de clientes en espera\");\n Text title4 = new Text(\"Resultados W(t)\");\n Text title5 = new Text(\"Resultados W(q)\");\n Text title6 = new Text(\"Grafica de probabilidad de clientes en espera\");\n Text title7 = new Text(\"Grafica de tiempos de espera\");\n //Color blanco de los Label\n title1.setFill(Color.WHITE);\n title2.setFill(Color.WHITE);\n title3.setFill(Color.WHITE);\n title4.setFill(Color.WHITE);\n title5.setFill(Color.WHITE);\n title6.setFill(Color.WHITE);\n title7.setFill(Color.WHITE);\n tLambda.setFill(Color.WHITE);\n tMiu.setFill(Color.WHITE);\n tRho.setFill(Color.WHITE);\n tEficiencia.setFill(Color.WHITE);\n tL.setFill(Color.WHITE);\n tW.setFill(Color.WHITE);\n tLq.setFill(Color.WHITE);\n tWq.setFill(Color.WHITE);\n tPro.setFill(Color.WHITE);\n tClientes.setFill(Color.WHITE);\n tTiempoW.setFill(Color.WHITE);\n tWt.setFill(Color.WHITE);\n tTiempoWq.setFill(Color.WHITE);\n tWqt.setFill(Color.WHITE);\n tc1.setFill(Color.WHITE);\n tc2.setFill(Color.WHITE);\n te1.setFill(Color.WHITE);\n te2.setFill(Color.WHITE);\n\n //Validacion de textField , no permite digitar letras, solo numeros con los digitos del 0-9\n lambda1.setRestrict(\"[0.0-99.0]\");\n miu1.setRestrict(\"[0.0-99.0]\");\n pro.setRestrict(\"[0.0-99.0]\");\n tiempoW.setRestrict(\"[0.0-99.0]\");\n tiempoWq.setRestrict(\"[0.0-99.0]\");\n c1.setRestrict(\"[0.0-99.0]\");\n c2.setRestrict(\"[0.0-99.0]\");\n e1.setRestrict(\"[0.0-99.0]\");\n e2.setRestrict(\"[0.0-99.0]\");\n\n GridPane arriba1 = new GridPane();//panel de separacion\n arriba1.setPadding(new Insets(5));//margen del panel\n arriba1.add(title1, 3, 2);//titulo\n arriba1.add(tLambda, 3, 4);\n arriba1.add(lambda1, 4, 4);\n arriba1.add(tMiu, 3, 5);\n arriba1.add(miu1, 4, 5);\n arriba1.add(btnCalPara, 3, 7);\n arriba1.add(btnBorrarPa, 4, 7);\n\n arriba1.add(title2, 9, 2);//Resultados\n arriba1.add(tRho, 9, 4);\n arriba1.add(tEficiencia, 9, 5);\n arriba1.add(rho, 10, 4);\n arriba1.add(eficiencia, 10, 5);\n arriba1.add(tL, 14, 4);\n arriba1.add(l, 15, 4);\n arriba1.add(tW, 14, 5);\n arriba1.add(w, 15, 5);\n arriba1.add(tLq, 19, 4);\n arriba1.add(lq, 20, 4);\n arriba1.add(tWq, 19, 5);\n arriba1.add(wq, 20, 5);\n arriba1.setAlignment(Pos.CENTER);//central el panel de parametros\n arriba1.setHgap(5);//separacion entre 5 pixeles entre componentes\n arriba1.setVgap(5);//\n\n HBox panelArriba = new HBox(20); //lambda y miu1\n panelArriba.setPadding(new Insets(20));//margen del panel\n panelArriba.getChildren().add(arriba1);\n\n GridPane medio = new GridPane();//gridPane de medio\n medio.add(title3, 3, 2);//probabilidad de clientes en espera\n medio.add(tClientes, 3, 4);\n medio.add(tPro, 3, 5);\n medio.add(pro, 4, 4);\n medio.add(clientes, 4, 5);\n medio.add(btnCalEspe, 3, 7);\n medio.add(btnBorrarEs, 4, 7);\n\n medio.add(title4, 9, 2);//Resultados W(t)\n medio.add(tTiempoW, 9, 4);\n medio.add(tiempoW, 10, 4);\n medio.add(tWt, 9, 5);\n medio.add(wt, 10, 5);\n medio.add(btnCalWt, 9, 7);\n medio.add(btnBorrarWt, 10, 7);\n\n medio.add(title5, 14, 2);//Resultados Wq(t)\n medio.add(tTiempoWq, 14, 4);\n medio.add(tiempoWq, 15, 4);\n medio.add(tWqt, 14, 5);\n medio.add(wqt, 15, 5);\n medio.add(btnCalWq, 14, 7);\n medio.add(btnBorrarWq, 15, 7);\n\n medio.setAlignment(Pos.CENTER);//central el panel de parametros\n medio.setHgap(5);//separacion entre 5 pixeles entre componentes\n medio.setVgap(5);//\n\n HBox panelMedio = new HBox(20); //panel medio\n panelMedio.setPadding(new Insets(20));\n panelMedio.getChildren().add(medio);\n\n GridPane bajo = new GridPane();\n bajo.add(title6, 3, 2);\n bajo.add(tc1, 3, 4);\n bajo.add(c1, 4, 4);\n bajo.add(tc2, 6, 4);\n bajo.add(c2, 7, 4);\n bajo.add(graEsp, 5, 6);\n bajo.add(title7, 3, 9);\n bajo.add(te1, 3, 10);\n bajo.add(e1, 4, 10);\n bajo.add(te2, 6, 10);\n bajo.add(e2, 7, 10);\n bajo.add(graTesp, 5, 12);\n\n bajo.setAlignment(Pos.CENTER);//central el panel \n bajo.setHgap(5);//separacion entre 5 pixeles entre componentes\n bajo.setVgap(5);//\n\n HBox panelBajo = new HBox(10);//servicio\n panelBajo.setPadding(new Insets(20));\n panelBajo.getChildren().add(bajo);\n\n VBox panelB = new VBox();//botones\n panelB.getChildren().add(btnRegresar);\n\n VBox panelP = new VBox(20);// a mostrar Parametros\n panelP.setPadding(new Insets(60));\n\n panelP.getChildren().addAll(panelB, panelArriba, panelMedio, panelBajo);//principal\n\n String image3 = \"multimedia/fondo4.jpg\";\n\n StackPane panel2 = new StackPane();//Crear el contenedor para agregar los layouts(HBox)\n panel2.setStyle(\"-fx-background-image: url('\" + image3 + \"'); \"\n + \"-fx-background-position: center center; \"\n + \"-fx-background-repeat: stretch;\");\n\n panel2.getChildren().add(panelP);//agregar el layout al contenedor\n Scene escena1 = new Scene(panel2);//Crear escenario\n\n primaryStage.setScene(escena1);//A la ventana setearle el escenario\n primaryStage.setTitle(\"Calcular parametros\");//Titulo de la ventana\n primaryStage.setResizable(true);//No permite redimencionar ventana\n primaryStage.show();\n\n }", "public MainDisplay(){\n /*\n Create both label and textfield for the input\n */\n Infix = new JLabel(\"Enter Infix: \");\n inputInfix = new JTextField(10);\n inputInfix.setBackground(Color.YELLOW);\n inputInfix.addActionListener(new textListener());\n add(Infix);\n add(inputInfix);\n\n /*\n Create label for the postfix expression\n */\n postExpression = new JLabel(\"Postfix expression: \");\n outputPostfix = new JLabel();\n add(postExpression);\n add(outputPostfix);\n\n /*\n Create label for the result\n */\n evaluateResult = new JLabel(\"Result: \");\n outputResult = new JLabel();\n add(evaluateResult);\n add(outputResult);\n\n /*\n Create label for the error message\n */\n errorMessage = new JLabel(\"Error Messages: \");\n outputError = new JLabel(\"[]\");\n add(errorMessage);\n add(outputError);\n outputError.setForeground(Color.decode(\"#651200\"));\n\n setLayout(new GridLayout(4,2));\n\n /*\n Set the size and background color\n */\n setPreferredSize(new Dimension(700, 150));\n\n setBackground(Color.GRAY);\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n Object btnOnpress = e.getSource();\n\n // Asignación del color negro\n if (btnOnpress == blackColor) {\n textAreaC.setForeground(Color.BLACK);\n textAreaC.setBackground(Color.WHITE);\n }\n\n // Asignación del color rojo\n if (btnOnpress == redColor) {\n textAreaC.setForeground(Color.RED);\n }\n\n if (btnOnpress == greenColor) {\n textAreaC.setForeground(Color.GREEN);\n }\n\n // Asignación del color amarillo\n if (btnOnpress == yellowColor) {\n textAreaC.setForeground(Color.YELLOW);\n }\n\n // Asignación del color gris oscuro\n if (btnOnpress == darkGrayColor) {\n textAreaC.setForeground(Color.DARK_GRAY);\n }\n\n // Asignación del color gris claro\n if (btnOnpress == lightGrayColor) {\n textAreaC.setForeground(Color.LIGHT_GRAY);\n }\n\n // Asignación del color gris\n if (btnOnpress == grayColor) {\n textAreaC.setForeground(Color.GRAY);\n }\n\n // Asignación del color azul\n if (btnOnpress == blueColor) {\n textAreaC.setForeground(Color.BLUE);\n }\n\n // Asignación del color magenta\n if (btnOnpress == magentaColor) {\n textAreaC.setForeground(Color.MAGENTA);\n }\n\n // Asignación del color blanco\n if (btnOnpress == whiteColor) {\n textAreaC.setForeground(Color.WHITE);\n textAreaC.setBackground(Color.BLACK);\n }\n\n // Asignación del color cyan\n if (btnOnpress == cyanColor) {\n textAreaC.setForeground(Color.CYAN);\n }\n\n // Asignación del color naranaja\n if (btnOnpress == orangeColor) {\n textAreaC.setForeground(Color.ORANGE);\n }\n\n // Asignación del color rosado\n if (btnOnpress == pinkColor) {\n textAreaC.setForeground(Color.PINK);\n }\n\n // Asignación del boton aceptar, la cual hace que la ventana se cierre\n if (btnOnpress == toAccept) {\n dispose();\n }\n\n }", "private void updateTextAreaLenght() {\n //\n }", "public ReadKeyboard() {\n\t\tJLabel jobLabel = new JLabel(\"JOB No.\", JLabel.CENTER);\n\t\tJLabel initLabel = new JLabel(\"Initial Value\", JLabel.CENTER);\n\t\tJLabel endLabel = new JLabel(\"End Value\", JLabel.CENTER);\n\t\t\n\t\tjobLabel.setFont(new Font(\"Arial\", 1, 12));\n\t\tinitLabel.setFont(new Font(\"Arial\", 1, 12));\n\t\tendLabel.setFont(new Font(\"Arial\", 1, 12));\n\n\t\tJPanel topPanel = new JPanel(new GridLayout(0, 3, 20, 0));\n\n\t\ttopPanel.add(jobLabel);\n\t\ttopPanel.add(initLabel);\n\t\ttopPanel.add(endLabel);\n\t\t\n\t\t\n\t\t//job1\n\t\tJFormattedTextField jobField = new JFormattedTextField(NumberFormat.getIntegerInstance());\n\t\tJFormattedTextField initField = new JFormattedTextField(NumberFormat.getIntegerInstance());\n\t\tJFormattedTextField endField = new JFormattedTextField(NumberFormat.getIntegerInstance());\n\t\n\t\tJPanel inputPanel = new JPanel(new GridLayout(0, 3, 15, 0));\n\n\t\tinputPanel.add(jobField);\n\t\tinputPanel.add(initField);\n\t\tinputPanel.add(endField);\n\t\t\n\t\t/*\n\t\t * Enter number in the input box and press \"return\" from keyboard, \n\t\t * then the variable \"jobName\" will get input text\n\t\t */\n\t\tjobField.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tjobName = \"JOB \" + jobField.getText();\n\t\t\t}\n\t\t});\n\t\t\n\t\t/*\n\t\t * Enter number in the input box and press \"return\" from keyboard, \n\t\t * then the variable \"initValue\" will get input value\n\t\t */\n\t\tinitField.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tNumber n1 = (Number)initField.getValue();\n\t\t\t\tinitValue = n1.intValue();\n\t\t\t}\n\t\t});\n\t\t\n\t\t/*\n\t\t * Enter number in the input box and press \"return\" from keyboard, \n\t\t * then the variable \"endValue\" will get input value\n\t\t * After pressing \"return\" from keyboard, \n\t\t * we create a new job since we have got all three arguments we need\n\t\t */\n\t\tendField.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tNumber n2 = (Number)endField.getValue();\n\t\t\t\tendValue = n2.intValue();\n\t\t\t\tnew Task(jobName, new CounterJob(initValue, endValue));\n\t\t\t}\n\t\t});\n\t\t\n\t\t\n\t\t//job2\n\t\tJFormattedTextField jobField2 = new JFormattedTextField(NumberFormat.getIntegerInstance());\n\t\tJFormattedTextField initField2 = new JFormattedTextField(NumberFormat.getIntegerInstance());\n\t\tJFormattedTextField endField2 = new JFormattedTextField(NumberFormat.getIntegerInstance());\n\t\n\t\tJPanel inputPanel2 = new JPanel(new GridLayout(0, 3, 15, 0));\n\n\t\tinputPanel2.add(jobField2);\n\t\tinputPanel2.add(initField2);\n\t\tinputPanel2.add(endField2);\n\t\t\n\t\tjobField2.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tjobName2 = \"JOB \" + jobField2.getText();\n\t\t\t}\n\t\t});\n\t\t\n\t\tinitField2.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tNumber n1 = (Number)initField2.getValue();\n\t\t\t\tinitValue2 = n1.intValue();\n\t\t\t}\n\t\t});\n\t\t\n\t\tendField2.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tNumber n2 = (Number)endField2.getValue();\n\t\t\t\tendValue2 = n2.intValue();\n\t\t\t\tnew Task(jobName2, new CounterJob(initValue2, endValue2));\n\t\t\t}\n\t\t});\n\t\t\n\t\t\n\t\t//job3\n\t\tJFormattedTextField jobField3 = new JFormattedTextField(NumberFormat.getIntegerInstance());\n\t\tJFormattedTextField initField3 = new JFormattedTextField(NumberFormat.getIntegerInstance());\n\t\tJFormattedTextField endField3 = new JFormattedTextField(NumberFormat.getIntegerInstance());\n\t\n\t\tJPanel inputPanel3 = new JPanel(new GridLayout(0, 3, 15, 0));\n\n\t\tinputPanel3.add(jobField3);\n\t\tinputPanel3.add(initField3);\n\t\tinputPanel3.add(endField3);\n\t\t\n\t\tjobField3.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tjobName3 = \"JOB \" + jobField3.getText();\n\t\t\t}\n\t\t});\n\t\t\n\t\tinitField3.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tNumber n1 = (Number)initField3.getValue();\n\t\t\t\tinitValue3 = n1.intValue();\n\t\t\t}\n\t\t});\n\t\t\n\t\tendField3.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tNumber n2 = (Number)endField3.getValue();\n\t\t\t\tendValue3 = n2.intValue();\n\t\t\t\tnew Task(jobName3, new CounterJob(initValue3, endValue3));\n\t\t\t}\n\t\t});\n\t\t\n\t\t\n\t\t//job4\n\t\tJFormattedTextField jobField4 = new JFormattedTextField(NumberFormat.getIntegerInstance());\n\t\tJFormattedTextField initField4 = new JFormattedTextField(NumberFormat.getIntegerInstance());\n\t\tJFormattedTextField endField4 = new JFormattedTextField(NumberFormat.getIntegerInstance());\n\t\n\t\tJPanel inputPanel4 = new JPanel(new GridLayout(0, 3, 15, 0));\n\n\t\tinputPanel4.add(jobField4);\n\t\tinputPanel4.add(initField4);\n\t\tinputPanel4.add(endField4);\n\t\t\n\t\tjobField4.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tjobName4 = \"JOB \" + jobField4.getText();\n\t\t\t}\n\t\t});\n\t\t\n\t\tinitField4.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tNumber n1 = (Number)initField4.getValue();\n\t\t\t\tinitValue4 = n1.intValue();\n\t\t\t}\n\t\t});\n\t\t\n\t\tendField4.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tNumber n2 = (Number)endField4.getValue();\n\t\t\t\tendValue4 = n2.intValue();\n\t\t\t\tnew Task(jobName4, new CounterJob(initValue4, endValue4));\n\t\t\t}\n\t\t});\n\t\t\n\t\t\n\t\t/*\n\t\t//job5\n\t\tJFormattedTextField jobField5 = new JFormattedTextField(NumberFormat.getIntegerInstance());\n\t\tJFormattedTextField initField5 = new JFormattedTextField(NumberFormat.getIntegerInstance());\n\t\tJFormattedTextField endField5 = new JFormattedTextField(NumberFormat.getIntegerInstance());\n\t\n\t\tJPanel inputPanel5 = new JPanel(new GridLayout(0, 3, 15, 0));\n\n\t\tinputPanel5.add(jobField5);\n\t\tinputPanel5.add(initField5);\n\t\tinputPanel5.add(endField5);\n\t\t\n\t\tjobField5.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tjobName5 = \"JOB \" + jobField5.getText();\n\t\t\t}\n\t\t});\n\t\t\n\t\tinitField5.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tNumber n1 = (Number)initField5.getValue();\n\t\t\t\tinitValue5 = n1.intValue();\n\t\t\t}\n\t\t});\n\t\t\n\t\tendField5.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tNumber n2 = (Number)endField5.getValue();\n\t\t\t\tendValue5 = n2.intValue();\n\t\t\t\tnew Task(jobName5, new CounterJob(initValue5, endValue5));\n\t\t\t\t//new Task(jobName5, initValue5, endValue5);\n\t\t\t}\n\t\t});\n\t\t*/\n\t\t\n\t\t\n\t\tJPanel mainPanel = new JPanel(new GridLayout(6, 0, 0, 5));\n\t\tmainPanel.add(topPanel);\n\t\t\n\t\tmainPanel.add(inputPanel);\n\t\tmainPanel.add(inputPanel2);\n\t\tmainPanel.add(inputPanel3);\n\t\tmainPanel.add(inputPanel4);\n\t\t//mainPanel.add(inputPanel5);\n\t\t\n\t\tJFrame window = new JFrame();\n\t\twindow.setContentPane(mainPanel);\n\t\twindow.pack();\n\t\twindow.setTitle(\"Read Keyboard Input\");\n\t\twindow.setSize(330, 270);\n window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n window.setVisible(true);\t\n \n\t}", "@Override\n\t\tpublic void insertUpdate(DocumentEvent e) {\n\t\t\t\n\t\t\tchar[] contraseņa;\n\t\t\tcontraseņa = contraseņa1.getPassword();\n\t\t\tif(contraseņa.length<8||contraseņa.length>12)\n\t\t\t{\n\t\t\t\tcontraseņa1.setBackground(Color.RED);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcontraseņa1.setBackground(Color.WHITE);\n\t\t\t}\n\t\t}", "private void updateBackground() {\n \t\t\t\ttextRed.setText(\"\" + redBar.getProgress());\n \t\t\t\ttextGreen.setText(\"\" + greenBar.getProgress());\n \t\t\t\ttextBlue.setText(\"\" + blueBar.getProgress());\n \t\t\t\ttextAlpha.setText(\"\" + alphaBar.getProgress());\n \t\t\t\tcolorTest.setBackgroundColor(Color.argb(alphaBar.getProgress(), redBar.getProgress(), greenBar.getProgress(), blueBar.getProgress()));\n \t\t\t}", "@Override\r\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\tif(\"colorButton\".equals(e.getActionCommand())){//使颜色按钮\r\n\t\t\t\tString ct = tt.resultTextPane.getSelectedText();\r\n\t\t\t\tif(ct != null&&!\"\".equals(ct.trim())){//判断是否已经选取了文字\r\n\t\t\t\t\tFontColor fc = new FontColor(\"0\",this.tt);\r\n\t\t\t\t\tfc.setResizable(false);\r\n\t\t\t\t\tfc.setTitle(\"颜色编辑器\");\r\n\t\t\t\t\tint end = tt.resultTextPane.getSelectionEnd();\r\n\t\t\t\t\tint begin = tt.resultTextPane.getSelectionStart();\r\n\t\t\t\t\tMap<Integer,Integer> map = tt.numberIndex;\r\n\t\t\t\t\tfc.setBegin(map.get(begin));//选中区域的开始位置\r\n\t\t\t\t\tfc.setEnd(map.get(end));//选中区域的结束位置\r\n\t\t\t\t\tfc.setBounds(250, 200, 255, 265);\r\n\t\t\t\t\t\r\n\t\t\t\t\tDimension d=fc.getSize();\r\n\t\t\t\t\tPoint loc = basePanel.getLocationOnScreen();\r\n\t\t \tloc.translate(d.width/3,0);\r\n\t\t \tfc.setLocation(loc);\r\n\t\t \t\r\n\t\t\t\t\t\r\n\t\t\t\t\tfc.setModal(true);\r\n\t\t\t\t\tfc.setVisible(true);\r\n\t\t\t\t\t\r\n\t\t\t\t} else {//没有选取文字\r\n\t\t\t\t\t\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null,\"请选择要编辑的文字\",\"提示\",1);\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(\"linkButton\".equals(e.getActionCommand())){//是超链接按钮\r\n\t\t\t\tString ct = tt.resultTextPane.getSelectedText();\r\n\t\t\t\tif(ct != null&&!\"\".equals(ct.trim())){//判断是否已经选取了文字\r\n\t\t\t\t\tint end = tt.resultTextPane.getSelectionEnd();\r\n\t\t\t\t\tint begin = tt.resultTextPane.getSelectionStart();\r\n\t\t\t\t\tMap<Integer,Integer> map = tt.numberIndex;\r\n\t\r\n\t\t\t\t\tUnderLine ul = new UnderLine(map.get(begin),map.get(end),tt);\r\n\t\t\t\t\tul.setResizable(false);\r\n\t\t\t\t\tul.setTitle(\"超链接编辑\");\r\n\t\t\t\t\tul.setContentPane(ul.getTotalPanel());\r\n\t\t\t\t\tul.setBounds(250, 200, 255, 265);\r\n\t\t\t\t\t\r\n\t\t\t\t\tDimension d=ul.getSize();\r\n\t\t\t\t\tPoint loc = basePanel.getLocationOnScreen();\r\n\t\t \tloc.translate(d.width/3,0);\r\n\t\t \tul.setLocation(loc);\r\n\t\t\t\t\t\r\n\t\t\t\t\tul.setModal(true);\r\n\t\t\t\t\tul.setVisible(true);\r\n\t\t\t\t\t\r\n\t\t\t\t} else {//没有选择编辑的文字\r\n\t\t\t\t\t\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null,\"请选择要编辑的文字\",\"提示\",1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(\"icoButton\".equals(e.getActionCommand())){//点击了图片选择按钮\r\n//\t\t\t\tSystem.out.println(resultTextPane.get);\r\n\t\t\t\t\r\n\t\t\t\tint end = tt.resultTextPane.getSelectionEnd();\r\n\t\t\t\tint begin = tt.resultTextPane.getSelectionStart();\r\n\t\t\t\tMap<Integer,Integer> map = tt.numberIndex;\r\n\t\t\t\t\r\n\t\t\t\tIco ico = new Ico(tt,map.get(begin));\r\n\t\t\t\tico.setTitle(\"图标编辑\");\r\n\t\t\t\tico.setResizable(false);\r\n\t\t\t\tico.setContentPane(ico.getTotalPanel());\r\n\t\t\t\tico.setBounds(250, 200, 255, 265);\r\n\r\n\t\t\t\tDimension d=ico.getSize();\r\n\t\t\t\tPoint loc = basePanel.getLocationOnScreen();\r\n\t \tloc.translate(d.width/3,0);\r\n\t \tico.setLocation(loc);\r\n\t \t\r\n\t \tico.setModal(true);\r\n\t\t\t\tico.setVisible(true);\r\n\t\t\t}\r\n\r\n\t\t}", "public int textColor() {\n\t\treturn textColor;\n\t}", "private void drawTextValues(boolean clearing) \r\n\t{\n\t\r\n\t\tdouble initalSize = getWidth() > getHeight() ? getHeight() : getWidth();\r\n\t\t\r\n\t\tdouble w = valueCanvas.getWidth();\r\n\t\tdouble h = valueCanvas.getHeight();\r\n\t\t//valueCanvas.setWidth(50);\r\n\t\t//valueCanvas.setHeight(50);\r\n\t\tGraphicsContext gc = valueCanvas.getGraphicsContext2D();\r\n\t\t\r\n\t\tFont font = Font.font(fontBase.getName(), scaleableFontSize.get());\r\n\t\t//Dieses ist dann zu vollziehen, wenn nur der Wert sich geändert hat.\r\n\t\tif(clearing)\r\n\t\t{\r\n\t\t\r\n\t\t\tgc.clearRect(0, 0, w, h);\r\n\t\t}\r\n\t\t\r\n\t\t//TODO raus\r\n\t\tgc.setFill(Color.RED);\r\n\t\tgc.fillRect(0, 0, valueCanvas.getWidth(), valueCanvas.getHeight());\r\n\t\t\t\r\n\t\t//text color\r\n\t\tgc.setFill(Color.web(\"#00000080\"));\r\n\t\t\r\n\t\tif(majorValue != null)\r\n\t\t{\r\n\t\t\t//initial\r\n\t\t\t //Ermittlung nach dem maximal möglichen Zustand\r\n\t\t\t Bounds maxTextAbmasse = this.getMaxTextWidth(font, this.majorValue);\r\n\t\t\t if(maxTextAbmasse.getWidth() < w && maxTextAbmasse.getHeight() < h)\r\n\t\t\t {\r\n\t\t\t\t double tempSize = getGreaterFont(initalSize * 0.12, w, h, majorValue);\r\n\t\t\t\t\tif(tempSize != getFontSize().get())\r\n\t\t\t\t\t\tgetFontSize().set(tempSize);\r\n\t\t\t\t \r\n\t\t\t }\r\n\t\t\t else\r\n\t\t\t {\r\n\t\t\t\t double tempSize = getLesserFont(getFontSize().get(), w, h, majorValue);\r\n\t\t\t\t\tif(tempSize != getFontSize().get())\r\n\t\t\t\t\t\tgetFontSize().set(tempSize);\r\n\t\t\t }\r\n\t\t\t font = Font.font(fontBase.getName(), getFontSize().get());\r\n\t\t}\r\n\t\tgc.setFont(font);\r\n\t\t\r\n\t\tText measuringUnit = new Text();\r\n\t\tif(majorValue == null)\r\n\t\t\tmeasuringUnit.setText(\"\");\r\n\t\telse\r\n\t\t\tmeasuringUnit.setText(\" \"+majorValue.getMeasurementUnit());\r\n\t\tmeasuringUnit.setFont(font);\r\n\t\t\r\n\t\tdouble masseinheitX = w - (measuringUnit.getLayoutBounds().getWidth());// + (gaugeSize * 0.015635));\r\n\t\t\r\n\t\tdouble haelfte = measuringUnit.getLayoutBounds().getHeight() / 2d;\r\n\t\tdouble masseinheitY = h/2d + (haelfte/2d);\r\n\t\tgc.fillText(measuringUnit.getText(), masseinheitX, masseinheitY);\r\n\t\t\t\r\n\t\t\r\n\t\tText valueField = new Text();\r\n\t\t\r\n\t\tif(majorValue == null)\r\n\t\t\tvalueField.setText(\"\");\r\n\t\telse\r\n\t\t\tvalueField.setText(String.format(\"%.1f\", majorValue.getCurrentValue()));\r\n\t\tvalueField.setFont(font);\r\n\t\t\r\n\t\tdouble valueX = masseinheitX - (valueField.getLayoutBounds().getWidth());// + (gaugeSize * 0.015635));\r\n\t\tdouble valueY = masseinheitY;\r\n\t\t\r\n\t\tgc.setFont(font);\r\n\t\tgc.fillText(valueField.getText(), valueX, valueY);\r\n\t\t\r\n\t}", "private void nextHistoryEntry()\n {\n // get next history entry (into input text field)\n if (this.historyPos < this.history.size()) {\n this.historyPos++;\n this.textInput.setText(this.history.get(this.historyPos));\n this.textInput.setSelection(this.history.get(this.historyPos).length());\n // if last index => input text must be cleaned\n } else if (this.historyPos == this.history.size()) {\n this.textInput.setText(\"\"); //$NON-NLS-1$\n this.textInput.setSelection(0);\n }\n }", "protected void saveInput() {\r\n value = valueText.getText();\r\n }", "public void doChanges0() {\n lm.setChangeRecording(true);\n changeMark = lm.getChangeMark();\n ld.externalSizeChangeHappened();\n // > UPDATE CURRENT STATE\n contInterior.put(\"Form\", new Rectangle(0, 0, 400, 300));\n compBounds.put(\"jTextField1\", new Rectangle(0, 0, 400, 20));\n baselinePosition.put(\"jTextField1-400-20\", new Integer(14));\n compBounds.put(\"jRadioButton1\", new Rectangle(0, 22, 93, 23));\n baselinePosition.put(\"jRadioButton1-93-23\", new Integer(15));\n compBounds.put(\"jRadioButton2\", new Rectangle(0, 48, 93, 23));\n baselinePosition.put(\"jRadioButton2-93-23\", new Integer(15));\n compBounds.put(\"jScrollPane1\", new Rectangle(0, 73, 35, 130));\n baselinePosition.put(\"jScrollPane1-35-130\", new Integer(0));\n compBounds.put(\"jLabel1\", new Rectangle(41, 73, 34, 14));\n baselinePosition.put(\"jLabel1-34-14\", new Integer(11));\n compBounds.put(\"jLabel2\", new Rectangle(81, 73, 34, 14));\n baselinePosition.put(\"jLabel2-34-14\", new Integer(11));\n compBounds.put(\"jTextField2\", new Rectangle(41, 93, 59, 20));\n baselinePosition.put(\"jTextField2-59-20\", new Integer(14));\n compPrefSize.put(\"jTextField1\", new Dimension(59, 20));\n compPrefSize.put(\"jRadioButton1\", new Dimension(93, 23));\n compPrefSize.put(\"jRadioButton2\", new Dimension(93, 23));\n compPrefSize.put(\"jScrollPane1\", new Dimension(35, 130));\n compPrefSize.put(\"jLabel1\", new Dimension(34, 14));\n compPrefSize.put(\"jLabel2\", new Dimension(34, 14));\n compPrefSize.put(\"jTextField2\", new Dimension(59, 20));\n contInterior.put(\"Form\", new Rectangle(0, 0, 400, 300));\n compBounds.put(\"jTextField1\", new Rectangle(0, 0, 400, 20));\n baselinePosition.put(\"jTextField1-400-20\", new Integer(14));\n compBounds.put(\"jRadioButton1\", new Rectangle(0, 22, 93, 23));\n baselinePosition.put(\"jRadioButton1-93-23\", new Integer(15));\n compBounds.put(\"jRadioButton2\", new Rectangle(0, 48, 93, 23));\n baselinePosition.put(\"jRadioButton2-93-23\", new Integer(15));\n compBounds.put(\"jScrollPane1\", new Rectangle(0, 73, 35, 130));\n baselinePosition.put(\"jScrollPane1-35-130\", new Integer(0));\n compBounds.put(\"jLabel1\", new Rectangle(41, 73, 34, 14));\n baselinePosition.put(\"jLabel1-34-14\", new Integer(11));\n compBounds.put(\"jLabel2\", new Rectangle(81, 73, 34, 14));\n baselinePosition.put(\"jLabel2-34-14\", new Integer(11));\n compBounds.put(\"jTextField2\", new Rectangle(41, 93, 59, 20));\n baselinePosition.put(\"jTextField2-59-20\", new Integer(14));\n ld.updateCurrentState();\n // < UPDATE CURRENT STATE\n // > START RESIZING\n baselinePosition.put(\"jTextField2-59-20\", new Integer(14));\n compPrefSize.put(\"jTextField2\", new Dimension(59, 20));\n {\n String[] compIds = new String[]{\"jTextField2\"};\n Rectangle[] bounds = new Rectangle[]{new Rectangle(41, 93, 59, 20)};\n Point hotspot = new Point(102, 106);\n int[] resizeEdges = new int[]{1, -1};\n boolean inLayout = true;\n ld.startResizing(compIds, bounds, hotspot, resizeEdges, inLayout);\n }\n // < START RESIZING\n prefPaddingInParent.put(\"Form-jTextField2-0-1\", new Integer(10)); // parentId-compId-dimension-compAlignment\n // > MOVE\n // > MOVE\n // > MOVE\n {\n Point p = new Point(399, 128);\n String containerId = \"Form\";\n boolean autoPositioning = true;\n boolean lockDimension = false;\n Rectangle[] bounds = new Rectangle[]{new Rectangle(41, 93, 359, 20)};\n ld.move(p, containerId, autoPositioning, lockDimension, bounds);\n }\n // < MOVE\n prefPaddingInParent.put(\"Form-jTextField2-0-1\", new Integer(10)); // parentId-compId-dimension-compAlignment\n // > MOVE\n // > MOVE\n // > MOVE\n {\n Point p = new Point(400, 128);\n String containerId = \"Form\";\n boolean autoPositioning = true;\n boolean lockDimension = false;\n Rectangle[] bounds = new Rectangle[]{new Rectangle(41, 93, 359, 20)};\n ld.move(p, containerId, autoPositioning, lockDimension, bounds);\n }\n // < MOVE\n // > END MOVING\n ld.endMoving(true);\n // < END MOVING\n ld.externalSizeChangeHappened();\n // > UPDATE CURRENT STATE\n contInterior.put(\"Form\", new Rectangle(0, 0, 400, 300));\n compBounds.put(\"jTextField1\", new Rectangle(0, 0, 400, 20));\n baselinePosition.put(\"jTextField1-400-20\", new Integer(14));\n compBounds.put(\"jRadioButton1\", new Rectangle(0, 22, 93, 23));\n baselinePosition.put(\"jRadioButton1-93-23\", new Integer(15));\n compBounds.put(\"jRadioButton2\", new Rectangle(0, 48, 93, 23));\n baselinePosition.put(\"jRadioButton2-93-23\", new Integer(15));\n compBounds.put(\"jScrollPane1\", new Rectangle(0, 73, 35, 130));\n baselinePosition.put(\"jScrollPane1-35-130\", new Integer(0));\n compBounds.put(\"jLabel1\", new Rectangle(41, 73, 34, 14));\n baselinePosition.put(\"jLabel1-34-14\", new Integer(11));\n compBounds.put(\"jLabel2\", new Rectangle(81, 73, 34, 14));\n baselinePosition.put(\"jLabel2-34-14\", new Integer(11));\n compBounds.put(\"jTextField2\", new Rectangle(41, 93, 359, 20));\n baselinePosition.put(\"jTextField2-359-20\", new Integer(14));\n prefPaddingInParent.put(\"Form-jRadioButton1-0-1\", new Integer(6)); // parentId-compId-dimension-compAlignment\n prefPaddingInParent.put(\"Form-jRadioButton2-0-1\", new Integer(6)); // parentId-compId-dimension-compAlignment\n compPrefSize.put(\"jTextField1\", new Dimension(59, 20));\n compPrefSize.put(\"jRadioButton1\", new Dimension(93, 23));\n compPrefSize.put(\"jRadioButton2\", new Dimension(93, 23));\n compPrefSize.put(\"jScrollPane1\", new Dimension(35, 130));\n compPrefSize.put(\"jLabel1\", new Dimension(34, 14));\n compPrefSize.put(\"jLabel2\", new Dimension(34, 14));\n compPrefSize.put(\"jTextField2\", new Dimension(59, 20));\n contInterior.put(\"Form\", new Rectangle(0, 0, 400, 300));\n compBounds.put(\"jTextField1\", new Rectangle(0, 0, 400, 20));\n baselinePosition.put(\"jTextField1-400-20\", new Integer(14));\n compBounds.put(\"jRadioButton1\", new Rectangle(0, 22, 93, 23));\n baselinePosition.put(\"jRadioButton1-93-23\", new Integer(15));\n compBounds.put(\"jRadioButton2\", new Rectangle(0, 48, 93, 23));\n baselinePosition.put(\"jRadioButton2-93-23\", new Integer(15));\n compBounds.put(\"jScrollPane1\", new Rectangle(0, 73, 35, 130));\n baselinePosition.put(\"jScrollPane1-35-130\", new Integer(0));\n compBounds.put(\"jLabel1\", new Rectangle(41, 73, 34, 14));\n baselinePosition.put(\"jLabel1-34-14\", new Integer(11));\n compBounds.put(\"jLabel2\", new Rectangle(81, 73, 34, 14));\n baselinePosition.put(\"jLabel2-34-14\", new Integer(11));\n compBounds.put(\"jTextField2\", new Rectangle(41, 93, 359, 20));\n baselinePosition.put(\"jTextField2-359-20\", new Integer(14));\n ld.updateCurrentState();\n // < UPDATE CURRENT STATE\n }", "private void updateText() {\n updateDateText();\n\n TextView weightText = findViewById(R.id.tvWeight);\n TextView lowerBPText = findViewById(R.id.tvLowerBP);\n TextView upperBPText = findViewById(R.id.tvUpperBP);\n\n mUser.weight.sortListByDate();\n mUser.bloodPressure.sortListsByDate();\n\n double weight = mUser.weight.getWeightByDate(mDate.getTime());\n int upperBP = mUser.bloodPressure.getUpperBPByDate(mDate.getTime());\n int lowerBP = mUser.bloodPressure.getLowerBPByDate(mDate.getTime());\n\n weightText.setText(String.format(Locale.getDefault(), \"Paino\\n%.1f\", weight));\n lowerBPText.setText(String.format(Locale.getDefault(), \"AlaP\\n%d\", lowerBP));\n upperBPText.setText(String.format(Locale.getDefault(), \"YläP\\n%d\", upperBP));\n\n ((EditText)findViewById(R.id.etWeight)).setText(\"\");\n ((EditText)findViewById(R.id.etLowerBP)).setText(\"\");\n ((EditText)findViewById(R.id.etUpperBP)).setText(\"\");\n }", "private void storeInitialLook() {\r\n\t\tthis.initialFont = this.control.getFont();\r\n\t\tthis.initialBackgroundColor = this.control.getBackground();\r\n\t\tthis.initialForegroundColor = this.control.getForeground();\r\n\t}", "public void updateDisplay()\n {\n\t Color metal = new Color(153, 153, 153);\n\t Color background = new Color(0, 0, 0);\n\t Color sand = new Color(251, 251, 208);\n\t Color water = new Color(102, 179, 255);\n\t int rows = grid.length;\n\t int cols = grid[0].length;\n\t for(int i = 0; i < rows; i++) {\n\t\t for(int j = 0; j < cols; j++) {\n\t\t\t if(grid[i][j] == METAL) {\n\t\t\t\t //color should be gray or whatever\n\t\t\t\t display.setColor(i, j, metal);\n\t\t\t }\n\t\t\t else if(grid[i][j] == EMPTY) {\n\t\t\t\t display.setColor(i, j, background);\n\t\t\t }\n\t\t\t else if(grid[i][j] == SAND) {\n\t\t\t\t display.setColor(i, j, sand);\n\t\t\t }\n\t\t\t else {\n\t\t\t\t display.setColor(i, j, water);\n\t\t\t }\n\t\t }\n\t }\n }", "public void setTextSettings(){\n\n ArrayList<Text> headlines = new ArrayList<>();\n //Add any text element here\n //headlines.add(this.newText);\n\n Color textColorHeadlines = new Color(0.8,0.8,0.8,1);\n\n for ( Text text : headlines ){\n text.setFont(Font.font(\"verdana\", FontWeight.BOLD, FontPosture.REGULAR, 20));\n text.setFill(textColorHeadlines);\n text.setEffect(new DropShadow(30, Color.BLACK));\n\n }\n\n }", "private void appendText()\n\t{\n\t\tString fieldText = \"\";\n\t\tString newText = \"\";\n\t\tfieldText = entry.getText();\n\t\t\n\t\tif(fieldText.equals (\"0\"))\n\t\t{\n\t\t\tnewText += append;\n\t\t\tfieldText = newText;\n\t\t\tentry.setText (fieldText);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfieldText += append;\n\t\t\tentry.setText (fieldText);\n\t\t}\n\t\t\n\t\tentry.grabFocus ( );\n\t\t\n\t}", "private void makeFormattedTextField(){\n textField = new JTextField(\"\"+ShapeFactory.getRoundness(), 3);\n //add listener that happens after each type and make the field accept only numbers between 0 to 100\n textField.addKeyListener(new KeyAdapter() {\n @Override\n public void keyTyped(KeyEvent e) {\n super.keyTyped(e);\n typeEvent(e);\n }\n });\n }", "@Override\r\n public void afterTextChanged(Editable s) {\n int astart = value3.getSelectionStart();\r\n int aend = value3.getSelectionEnd();\r\n\r\n String FieldValue = s.toString().toUpperCase();\r\n\r\n if (Helper.checkDataHexa(FieldValue) == false) {\r\n value3.setTextKeepState(Helper.checkAndChangeDataHexa(FieldValue));\r\n value3.setSelection(astart - 1, aend - 1);\r\n } else\r\n value3.setSelection(astart, aend);\r\n\r\n if (value3.getText().length() > 0 && value3.getText().length() < 2) {\r\n value3.setTextColor(0xffff0000); //RED color\r\n buttonPresentPassword.setClickable(false);\r\n buttonWritePassword.setClickable(false);\r\n Value3Enable = false;\r\n } else {\r\n value3.setTextColor(0xff000000); //BLACK color\r\n Value3Enable = true;\r\n if (Value1Enable == true &&\r\n Value2Enable == true &&\r\n Value3Enable == true &&\r\n Value4Enable == true) {\r\n buttonPresentPassword.setClickable(true);\r\n buttonWritePassword.setClickable(true);\r\n }\r\n }\r\n\r\n }", "public static int getTextColorFromMagnitude(String input) {\n double magnitude = Double.parseDouble(input);\n if (magnitude >=0 && magnitude <= 3.5) {\n return Color.parseColor(\"#00FF00\");\n } else if (magnitude > 3.5 && magnitude <= 5.5) {\n return Color.parseColor(\"#FF6347\");\n } else {\n return Color.parseColor(\"#FF0000\");\n }\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n mainPanel = new javax.swing.JPanel();\n no_input = new javax.swing.JPanel();\n exp_ip = new javax.swing.JButton();\n compile = new javax.swing.JButton();\n diff = new javax.swing.JButton();\n num_diff = new javax.swing.JButton();\n num_inte = new javax.swing.JButton();\n no_value = new javax.swing.JPanel();\n jLabel1 = new javax.swing.JLabel();\n no_value_input = new javax.swing.JFormattedTextField();\n no_input_ok = new javax.swing.JButton();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n jLabel6 = new javax.swing.JLabel();\n jLabel7 = new javax.swing.JLabel();\n jLabel8 = new javax.swing.JLabel();\n jLabel9 = new javax.swing.JLabel();\n jLabel10 = new javax.swing.JLabel();\n jLabel11 = new javax.swing.JLabel();\n integration_input = new javax.swing.JPanel();\n jLabel12 = new javax.swing.JLabel();\n jLabel13 = new javax.swing.JLabel();\n integral_lower = new javax.swing.JFormattedTextField();\n integral_upper = new javax.swing.JFormattedTextField();\n integral_ok = new javax.swing.JButton();\n jLabel14 = new javax.swing.JLabel();\n output_label = new javax.swing.JTextField();\n menuBar = new javax.swing.JMenuBar();\n javax.swing.JMenu fileMenu = new javax.swing.JMenu();\n javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem();\n javax.swing.JMenu helpMenu = new javax.swing.JMenu();\n javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem();\n statusPanel = new javax.swing.JPanel();\n javax.swing.JSeparator statusPanelSeparator = new javax.swing.JSeparator();\n statusMessageLabel = new javax.swing.JLabel();\n statusAnimationLabel = new javax.swing.JLabel();\n progressBar = new javax.swing.JProgressBar();\n\n org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(differentiation.DifferentiationApp.class).getContext().getResourceMap(DifferentiationView.class);\n mainPanel.setBackground(resourceMap.getColor(\"Calculus.background\")); // NOI18N\n mainPanel.setName(\"Calculus\"); // NOI18N\n\n no_input.setBackground(resourceMap.getColor(\"no_input.background\")); // NOI18N\n no_input.setMaximumSize(new java.awt.Dimension(1500, 900));\n no_input.setMinimumSize(new java.awt.Dimension(1500, 900));\n no_input.setName(\"no_input\"); // NOI18N\n no_input.setPreferredSize(new java.awt.Dimension(1500, 900));\n\n exp_ip.setIcon(resourceMap.getIcon(\"exp_ip.icon\")); // NOI18N\n exp_ip.setText(resourceMap.getString(\"exp_ip.text\")); // NOI18N\n exp_ip.setToolTipText(resourceMap.getString(\"exp_ip.toolTipText\")); // NOI18N\n exp_ip.setName(\"exp_ip\"); // NOI18N\n exp_ip.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n exp_ipMouseClicked(evt);\n }\n });\n\n compile.setIcon(resourceMap.getIcon(\"compile.icon\")); // NOI18N\n compile.setText(resourceMap.getString(\"compile.text\")); // NOI18N\n compile.setToolTipText(resourceMap.getString(\"compile.toolTipText\")); // NOI18N\n compile.setName(\"compile\"); // NOI18N\n compile.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n compileMouseClicked(evt);\n }\n });\n\n diff.setBackground(resourceMap.getColor(\"diff.background\")); // NOI18N\n diff.setIcon(resourceMap.getIcon(\"diff.icon\")); // NOI18N\n diff.setText(resourceMap.getString(\"diff.text\")); // NOI18N\n diff.setToolTipText(resourceMap.getString(\"diff.toolTipText\")); // NOI18N\n diff.setName(\"diff\"); // NOI18N\n diff.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n diffMouseClicked(evt);\n }\n });\n\n num_diff.setIcon(resourceMap.getIcon(\"num_diff.icon\")); // NOI18N\n num_diff.setText(resourceMap.getString(\"num_diff.text\")); // NOI18N\n num_diff.setToolTipText(resourceMap.getString(\"num_diff.toolTipText\")); // NOI18N\n num_diff.setName(\"num_diff\"); // NOI18N\n num_diff.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n num_diffMouseClicked(evt);\n }\n });\n\n num_inte.setIcon(resourceMap.getIcon(\"num_inte.icon\")); // NOI18N\n num_inte.setText(resourceMap.getString(\"num_inte.text\")); // NOI18N\n num_inte.setToolTipText(resourceMap.getString(\"num_inte.toolTipText\")); // NOI18N\n num_inte.setName(\"num_inte\"); // NOI18N\n num_inte.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n num_inteMouseClicked(evt);\n }\n });\n\n no_value.setBackground(resourceMap.getColor(\"no_value.background\")); // NOI18N\n no_value.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));\n no_value.setName(\"no_value\"); // NOI18N\n\n jLabel1.setFont(resourceMap.getFont(\"jLabel1.font\")); // NOI18N\n jLabel1.setText(resourceMap.getString(\"jLabel1.text\")); // NOI18N\n jLabel1.setName(\"jLabel1\"); // NOI18N\n\n no_value_input.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat(\"#0.00\"))));\n no_value_input.setText(resourceMap.getString(\"no_value_input.text\")); // NOI18N\n no_value_input.setName(\"no_value_input\"); // NOI18N\n\n no_input_ok.setIcon(resourceMap.getIcon(\"no_input_ok.icon\")); // NOI18N\n no_input_ok.setText(resourceMap.getString(\"no_input_ok.text\")); // NOI18N\n no_input_ok.setName(\"no_input_ok\"); // NOI18N\n no_input_ok.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n no_input_okMouseClicked(evt);\n }\n });\n\n javax.swing.GroupLayout no_valueLayout = new javax.swing.GroupLayout(no_value);\n no_value.setLayout(no_valueLayout);\n no_valueLayout.setHorizontalGroup(\n no_valueLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, no_valueLayout.createSequentialGroup()\n .addGap(22, 22, 22)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 73, Short.MAX_VALUE)\n .addComponent(no_value_input, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(79, 79, 79))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, no_valueLayout.createSequentialGroup()\n .addContainerGap(172, Short.MAX_VALUE)\n .addComponent(no_input_ok, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(166, 166, 166))\n );\n no_valueLayout.setVerticalGroup(\n no_valueLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(no_valueLayout.createSequentialGroup()\n .addGap(54, 54, 54)\n .addGroup(no_valueLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(no_value_input, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(26, 26, 26)\n .addComponent(no_input_ok, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(34, Short.MAX_VALUE))\n );\n\n jLabel2.setIcon(resourceMap.getIcon(\"jLabel2.icon\")); // NOI18N\n jLabel2.setText(resourceMap.getString(\"jLabel2.text\")); // NOI18N\n jLabel2.setName(\"jLabel2\"); // NOI18N\n\n jLabel3.setText(resourceMap.getString(\"jLabel3.text\")); // NOI18N\n jLabel3.setName(\"jLabel3\"); // NOI18N\n\n jLabel5.setText(resourceMap.getString(\"jLabel5.text\")); // NOI18N\n jLabel5.setName(\"jLabel5\"); // NOI18N\n\n jLabel6.setText(resourceMap.getString(\"jLabel6.text\")); // NOI18N\n jLabel6.setName(\"jLabel6\"); // NOI18N\n\n jLabel7.setText(resourceMap.getString(\"jLabel7.text\")); // NOI18N\n jLabel7.setName(\"jLabel7\"); // NOI18N\n\n jLabel8.setText(resourceMap.getString(\"jLabel8.text\")); // NOI18N\n jLabel8.setName(\"jLabel8\"); // NOI18N\n\n jLabel9.setText(resourceMap.getString(\"jLabel9.text\")); // NOI18N\n jLabel9.setName(\"jLabel9\"); // NOI18N\n\n jLabel10.setText(resourceMap.getString(\"jLabel10.text\")); // NOI18N\n jLabel10.setName(\"jLabel10\"); // NOI18N\n\n jLabel11.setText(resourceMap.getString(\"jLabel11.text\")); // NOI18N\n jLabel11.setName(\"jLabel11\"); // NOI18N\n\n integration_input.setBackground(resourceMap.getColor(\"integration_input.background\")); // NOI18N\n integration_input.setName(\"integration_input\"); // NOI18N\n\n jLabel12.setText(resourceMap.getString(\"jLabel12.text\")); // NOI18N\n jLabel12.setName(\"jLabel12\"); // NOI18N\n\n jLabel13.setText(resourceMap.getString(\"jLabel13.text\")); // NOI18N\n jLabel13.setName(\"jLabel13\"); // NOI18N\n\n integral_lower.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat(\"#0.00\"))));\n integral_lower.setText(resourceMap.getString(\"integral_lower.text\")); // NOI18N\n integral_lower.setName(\"integral_lower\"); // NOI18N\n\n integral_upper.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat(\"#0.00\"))));\n integral_upper.setText(resourceMap.getString(\"integral_upper.text\")); // NOI18N\n integral_upper.setName(\"integral_upper\"); // NOI18N\n\n integral_ok.setIcon(resourceMap.getIcon(\"integral_ok.icon\")); // NOI18N\n integral_ok.setText(resourceMap.getString(\"integral_ok.text\")); // NOI18N\n integral_ok.setName(\"integral_ok\"); // NOI18N\n integral_ok.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n integral_okMouseClicked(evt);\n }\n });\n\n javax.swing.GroupLayout integration_inputLayout = new javax.swing.GroupLayout(integration_input);\n integration_input.setLayout(integration_inputLayout);\n integration_inputLayout.setHorizontalGroup(\n integration_inputLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(integration_inputLayout.createSequentialGroup()\n .addGroup(integration_inputLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(integration_inputLayout.createSequentialGroup()\n .addGap(30, 30, 30)\n .addGroup(integration_inputLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addComponent(jLabel13, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jLabel12, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 94, Short.MAX_VALUE))\n .addGap(79, 79, 79)\n .addGroup(integration_inputLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(integral_upper)\n .addComponent(integral_lower, javax.swing.GroupLayout.DEFAULT_SIZE, 103, Short.MAX_VALUE)))\n .addGroup(integration_inputLayout.createSequentialGroup()\n .addGap(155, 155, 155)\n .addComponent(integral_ok, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap(70, Short.MAX_VALUE))\n );\n integration_inputLayout.setVerticalGroup(\n integration_inputLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(integration_inputLayout.createSequentialGroup()\n .addGap(22, 22, 22)\n .addGroup(integration_inputLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(integral_lower, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(integration_inputLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(integral_upper, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 33, Short.MAX_VALUE)\n .addComponent(integral_ok, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(22, 22, 22))\n );\n\n jLabel14.setFont(resourceMap.getFont(\"jLabel14.font\")); // NOI18N\n jLabel14.setText(resourceMap.getString(\"jLabel14.text\")); // NOI18N\n jLabel14.setName(\"jLabel14\"); // NOI18N\n\n output_label.setText(resourceMap.getString(\"output_label.text\")); // NOI18N\n output_label.setName(\"output_label\"); // NOI18N\n\n javax.swing.GroupLayout no_inputLayout = new javax.swing.GroupLayout(no_input);\n no_input.setLayout(no_inputLayout);\n no_inputLayout.setHorizontalGroup(\n no_inputLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(no_inputLayout.createSequentialGroup()\n .addGroup(no_inputLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(no_inputLayout.createSequentialGroup()\n .addGap(19, 19, 19)\n .addGroup(no_inputLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)\n .addComponent(exp_ip, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel3)\n .addComponent(jLabel11)\n .addComponent(compile, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel5)\n .addComponent(diff)\n .addComponent(jLabel6)\n .addComponent(num_diff, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel7)\n .addComponent(jLabel8)\n .addComponent(num_inte, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel9)\n .addComponent(jLabel10))\n .addGroup(no_inputLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(no_inputLayout.createSequentialGroup()\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 438, Short.MAX_VALUE)\n .addComponent(jLabel2)\n .addGap(324, 324, 324))\n .addGroup(no_inputLayout.createSequentialGroup()\n .addGap(18, 18, 18)\n .addComponent(no_value, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(54, 54, 54)\n .addComponent(integration_input, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addGroup(no_inputLayout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(no_inputLayout.createSequentialGroup()\n .addContainerGap()\n .addComponent(output_label, javax.swing.GroupLayout.PREFERRED_SIZE, 981, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap())\n );\n no_inputLayout.setVerticalGroup(\n no_inputLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(no_inputLayout.createSequentialGroup()\n .addGap(19, 19, 19)\n .addGroup(no_inputLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(no_inputLayout.createSequentialGroup()\n .addComponent(exp_ip, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jLabel3)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jLabel11))\n .addComponent(jLabel2))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(no_inputLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(no_inputLayout.createSequentialGroup()\n .addGap(20, 20, 20)\n .addGroup(no_inputLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addComponent(integration_input, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(no_value, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))\n .addGroup(no_inputLayout.createSequentialGroup()\n .addGap(6, 6, 6)\n .addComponent(compile)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jLabel5)\n .addGap(16, 16, 16)\n .addComponent(diff, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jLabel6)\n .addGap(6, 6, 6)\n .addComponent(num_diff)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jLabel7)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jLabel8)\n .addGap(10, 10, 10)\n .addComponent(num_inte)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jLabel9)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jLabel10)\n .addGap(18, 18, 18)\n .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(output_label, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(29, Short.MAX_VALUE))\n );\n\n javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);\n mainPanel.setLayout(mainPanelLayout);\n mainPanelLayout.setHorizontalGroup(\n mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(mainPanelLayout.createSequentialGroup()\n .addComponent(no_input, javax.swing.GroupLayout.PREFERRED_SIZE, 1010, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n mainPanelLayout.setVerticalGroup(\n mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(mainPanelLayout.createSequentialGroup()\n .addComponent(no_input, javax.swing.GroupLayout.PREFERRED_SIZE, 662, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n menuBar.setName(\"menuBar\"); // NOI18N\n\n fileMenu.setText(resourceMap.getString(\"fileMenu.text\")); // NOI18N\n fileMenu.setName(\"fileMenu\"); // NOI18N\n\n javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(differentiation.DifferentiationApp.class).getContext().getActionMap(DifferentiationView.class, this);\n exitMenuItem.setAction(actionMap.get(\"quit\")); // NOI18N\n exitMenuItem.setName(\"exitMenuItem\"); // NOI18N\n fileMenu.add(exitMenuItem);\n\n menuBar.add(fileMenu);\n\n helpMenu.setText(resourceMap.getString(\"helpMenu.text\")); // NOI18N\n helpMenu.setName(\"helpMenu\"); // NOI18N\n\n aboutMenuItem.setAction(actionMap.get(\"showAboutBox\")); // NOI18N\n aboutMenuItem.setName(\"aboutMenuItem\"); // NOI18N\n helpMenu.add(aboutMenuItem);\n\n menuBar.add(helpMenu);\n\n statusPanel.setName(\"statusPanel\"); // NOI18N\n\n statusPanelSeparator.setName(\"statusPanelSeparator\"); // NOI18N\n\n statusMessageLabel.setName(\"statusMessageLabel\"); // NOI18N\n\n statusAnimationLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);\n statusAnimationLabel.setName(\"statusAnimationLabel\"); // NOI18N\n\n progressBar.setName(\"progressBar\"); // NOI18N\n\n javax.swing.GroupLayout statusPanelLayout = new javax.swing.GroupLayout(statusPanel);\n statusPanel.setLayout(statusPanelLayout);\n statusPanelLayout.setHorizontalGroup(\n statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(statusPanelSeparator, javax.swing.GroupLayout.DEFAULT_SIZE, 1020, Short.MAX_VALUE)\n .addGroup(statusPanelLayout.createSequentialGroup()\n .addContainerGap()\n .addComponent(statusMessageLabel)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 850, Short.MAX_VALUE)\n .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(statusAnimationLabel)\n .addContainerGap())\n );\n statusPanelLayout.setVerticalGroup(\n statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(statusPanelLayout.createSequentialGroup()\n .addComponent(statusPanelSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(statusMessageLabel)\n .addComponent(statusAnimationLabel)\n .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(3, 3, 3))\n );\n\n setComponent(mainPanel);\n setMenuBar(menuBar);\n setStatusBar(statusPanel);\n }", "public void updateText()\r\n\t{\r\n\t\tdouble smallest = Math.min(menu.getController().getWidth(), menu.getController().getHeight());\r\n\t\tdouble equivalent12 = smallest/55;//Equivalent of 12 point font on base dimensions\r\n\t\t\r\n\t\ttextRenderer = new TextRenderer(new Font(fontName, Font.PLAIN, (int)(equivalent12*size)), true, true);\r\n\t}", "@Override\n public void afterTextChanged(Editable s) {\n outputBasedOnText(s);\n }", "public void updateTextViews() {\n // Set the inputs according to the initial input from the entry.\n //TextView dateTextView = (TextView) findViewById(R.id.date_textview);\n //dateTextView.setText(DateUtils.formatDateTime(getApplicationContext(), mEntry.getStart(), DateUtils.FORMAT_SHOW_DATE));\n\n EditText dateEdit = (EditText) findViewById(R.id.date_text_edit);\n dateEdit.setText(DateUtils.formatDateTime(this, mEntry.getStart(), DateUtils.FORMAT_NUMERIC_DATE | DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_SHOW_YEAR | DateUtils.FORMAT_ABBREV_ALL));\n\n EditText startTimeEdit = (EditText) findViewById(R.id.start_time_text_edit);\n startTimeEdit.setText(DateUtils.formatDateTime(this, mEntry.getStart(), DateUtils.FORMAT_SHOW_TIME));\n\n EditText endTimeEdit = (EditText) findViewById(R.id.end_time_text_edit);\n endTimeEdit.setText(DateUtils.formatDateTime(this, mEntry.getEnd(), DateUtils.FORMAT_SHOW_TIME));\n\n\n TextView descriptionView = (TextView) findViewById(R.id.description);\n descriptionView.setText(mEntry.getDescription());\n\n\n enableSendButtonIfPossible();\n }", "@Override\n\tprotected void UpdateUI() {\n\t\tMaxFlowLevelDisplay(MaxFlowLevel);\n\t}", "public void colorText() {\r\n String theColor = textShape.getText();\r\n if (theColor.contains(\"blue\")) {\r\n textShape.setForegroundColor(Color.BLUE);\r\n }\r\n else if (theColor.contains(\"red\")) {\r\n textShape.setForegroundColor(Color.RED);\r\n }\r\n else {\r\n textShape.setForegroundColor(Color.BLACK);\r\n }\r\n }", "@Override\n\tpublic void afterTextChanged(Editable s) {\n\t\tString formattedValue = \"\";\n\t\tint cursorIdexToSet = 0;\n\t\tif (!isFormatting) {\n\t\t\tmLastCursorIndex = mLastStartLocation;\n\t\t\tmLastBeforeText = mBeforeText;\n\t\t\tisFormatting = true;\n\t\t\tformattedValue = formatUsNumber(s);\n\t\t\ttry{\n\t\t\tif (formattedValue != null) {\n\t\t\t\tmWeakEditText.get().setText(formattedValue);\n\t\t\t\tmWeakEditText.get().setTextKeepState(formattedValue.toString());\n\t\t\t}\n\t\t\t\n\t\t\tif(mWeakEditText.get().getText().toString().length() == 5){\n\t\t\t\tcursorIdexToSet = mBeforeText.toString().length();\n\t\t\t}\n\t\t\telse if(mLastBeforeText.toString().length() > mWeakEditText.get().getText().toString().length() &&\n\t\t\t\t\tmLastBeforeText.toString().length() - mWeakEditText.get().getText().toString().length() == 1){\n\t\t\t\tif(mLastBeforeText.toString().indexOf(\",\") == mLastCursorIndex){\n\t\t\t\t\tmLastCursorIndex--;\n\t\t\t\t}\n\t\t\t\tcursorIdexToSet = mLastCursorIndex;\n\t\t\t}\n\t\t\telse if(mLastBeforeText.toString().length() - mWeakEditText.get().getText().toString().length() > 1){\n\t\t\t\tcursorIdexToSet = mWeakEditText.get().getText().length();\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif((mLastCursorIndex + 1) <= mWeakEditText.get().getText().length()){\n\t\t\t\t\tif(mWeakEditText.get().getText().toString().length() - mLastBeforeText.toString().length() > 1){\n\t\t\t\t\t\tmLastCursorIndex += mWeakEditText.get().getText().toString().length() - mLastBeforeText.toString().length();\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tmLastCursorIndex++;\n\t\t\t\t\t}\n\t\t\t\t\tcursorIdexToSet = mLastCursorIndex;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tcursorIdexToSet = mWeakEditText.get().getText().length();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t}catch(IndexOutOfBoundsException e){\n\t\t\t\tisFormatting = false;\n\t\t\t}\n\t\t\tisFormatting = false;\n\t\t}\n\t\tSystem.out.println(\"Lenght : \"+mWeakEditText.get().getText().toString().length());\n\t\tSystem.out.println(\"mLastBeforeText : \"+mLastBeforeText.toString().length());\n\t\tSystem.out.println(\"lastCursorIndex : \"+mLastCursorIndex);\n\t\t\n\t\tSelection.setSelection(mWeakEditText.get().getText(), cursorIdexToSet);\n\t}", "@Override\n public void update() {\n jTextField1.setText(mCalculator.getDisplay());\n }", "public void createTextBox(){\n // Check if theGreenFootImage was set, otherwise create a blanco image\n // with the specific heights.\n if(theGreenfootImage != null){\n image = new GreenfootImage(theGreenfootImage);\n }else{\n image = new GreenfootImage(fieldWidth, fieldHeight);\n }\n \n if(hasBackground){\n if(borderWidth == 0 || borderHeight == 0){\n createAreaWithoutBorder();\n } else{\n createAreaWithBorder(borderWidth, borderHeight);\n }\n }\n \n // Create the default dont with given fontsize and color.\n font = image.getFont();\n font = font.deriveFont(fontSize);\n image.setFont(font);\n image.setColor(fontColor);\n \n // Draw the string in the image with the input, on the given coordinates.\n image.drawString(input, drawStringX, drawStringY);\n \n setImage(image); // Place the image\n }", "private void resetFieldColors() {\r\n userText.setBackgroundColor(ContextCompat.getColor(this, R.color.cleanBackground));\r\n passText.setBackgroundColor(ContextCompat.getColor(this, R.color.cleanBackground));\r\n }", "public Color getForegroundColor()\n {\n return foregroundColor;\n }", "private void updateModel() {\n // Reset the credentials background\n currentPassword.setBackground(Themes.currentTheme.dataEntryBackground());\n\n\n }", "public void cambiarColorCrc() {\r\n R1 = slRCrc.getValue();\r\n G1 = slGCrc.getValue();\r\n B1 = slBCrc.getValue();\r\n jRCr.setText(\"R: \" + R1);\r\n jVCr.setText(\"G: \" + G1);\r\n jACr.setText(\"B: \" + B1);\r\n color = new Color(R1,G1,B1);\r\n btninfCrc.setBackground(color);\r\n btnEditarCrc.setBackground(color);\r\n btnPruebaCrc.setBackground(color);\r\n btnRegresarCrc.setBackground(color);\r\n repaint(); //Metodo que permite que la figura cambie de color en tiempo real\r\n }", "public Color getTextColor(){\r\n return textColor;\r\n }", "@Override\r\n\t\tpublic AbstractFormatter getFormatter(JFormattedTextField field) {\r\n\t\t\tif ( field.hasFocus() ) {\r\n\t\t\t\tif ( mEditorFormatter == null ) {\r\n\t\t\t\t\tmEditorFormatter = new TextFieldFormatter(new MovieFormatter(true));\r\n\t\t\t\t}\r\n\t\t\t\treturn (mEditorFormatter);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif ( mDisplayFormatter == null ) {\r\n\t\t\t\t\tmDisplayFormatter = new TextFieldFormatter(new MovieFormatter(false));\r\n\t\t\t\t}\r\n\t\t\t\treturn (mDisplayFormatter);\r\n\t\t\t}\t\r\n\t\t}", "public static void main(String[] args)\n {\n JFrame f = new JFrame(\"Test for TextRangeUI\");\n f.setBounds(0,0,200,150);\n final TextRangeUI range_ui = new TextRangeUI( \"TOF\", 0, 1000);\n\n f.getContentPane().setLayout( new GridLayout(2,1) );\n f.getContentPane().add(range_ui);\n\n range_ui.addActionListener( new ActionListener()\n {\n public void actionPerformed(ActionEvent e)\n {\n System.out.println(\"Entered: \" + range_ui.getText() );\n System.out.println(\"Min = \" + range_ui.getMin() );\n System.out.println(\"Max = \" + range_ui.getMax() );\n }\n });\n\n final TextRangeUI range_ui_2 = new TextRangeUI( \"TOF\", 0, 1000);\n f.getContentPane().add(range_ui_2);\n range_ui_2.setLabel( \"NEW LABEL\" );\n range_ui_2.setMin( 1.0f );\n range_ui_2.setMax( 2.0f );\n\n range_ui_2.addActionListener( new ActionListener()\n {\n public void actionPerformed(ActionEvent e)\n {\n System.out.println(\"Entered: \" + range_ui_2.getText() );\n System.out.println(\"Min = \" + range_ui_2.getMin() );\n System.out.println(\"Max = \" + range_ui_2.getMax() );\n }\n });\n\n f.setVisible(true);\n }", "private void refresh(int width, int height) {\n Integer numUnexposed = mainField.numUnexposed();\n nonminesLabel.setText(numUnexposed.toString());\n Integer numMarked = mainField.numMarked();\n if (numMarked < 0) {\n cellsUnmarked.setText(\"Too Many Marked!\");\n }\n else {\n cellsUnmarked.setText(numMarked.toString());\n }\n // iterate through all the buttons and update the text if it's an exposed cell\n for (int i = 0;i < width;i++) {\n for (int j = 0;j < height;j++) {\n int cellState = mainField.getCellState(i,j);\n if (cellState == mainField.EXPOSED) {\n Integer numValue = mainField.getValue(i,j);\n if (numValue == -1) {\n btArray[i][j].setText(\"B\");\n btArray[i][j].setStyle(\"-fx-background-color: #FF0000;\");\n }\n else if (numValue == 0) {\n btArray[i][j].setStyle(\"-fx-background-color: #CCCCCC;\");\n }\n else {\n btArray[i][j].setText(numValue.toString());\n btArray[i][j].setStyle(\"-fx-background-color: #CCCCCC;\");\n }\n }\n }\n }\n }", "private void updateFieldValues(){\r\n \tgenChainLengthField.setText(String.valueOf(settings.genChainLength));\r\n \tgenChainLengthFluxField.setText(String.valueOf(settings.genChainLengthFlux));\r\n \tstepGenDistanceField.setText(String.valueOf(settings.stepGenDistance));\r\n \trowsField.setText(String.valueOf(settings.rows));\r\n \tcolsField.setText(String.valueOf(settings.cols));\r\n \tcellWidthField.setText(String.valueOf(settings.cellWidth));\r\n \tstartRowField.setText(String.valueOf(settings.startRow));\r\n \tstartColField.setText(String.valueOf(settings.startCol));\r\n \tendRowField.setText(String.valueOf(settings.endRow));\r\n \tendColField.setText(String.valueOf(settings.endCol));\r\n \tprogRevealRadiusField.setText(String.valueOf(settings.progRevealRadius));\r\n \tprogDrawCB.setSelected(settings.progDraw);\r\n \tprogDrawSpeedField.setText(String.valueOf(settings.progDrawSpeed));\r\n }", "private void changeCurrentValue()\n {\n String theText = textBox.toString();\n\n // find the first newline\n int index = theText.indexOf(\"\\n\");\n assert index != -1;\n\n // insert new stuff\n StringBuilder newText = new StringBuilder();\n newText.append(currentTag);\n newText.append(\": \");\n newText.append(currentValue);\n newText.append(\"\\n\");\n\n textBox.replaceTextRange(0, index, newText.toString());\n }", "@Override\n public String getType() {\n return \"Color change\";\n }", "private void createContents(Shell shell) \r\n\t{\r\n\t\tshell.setLayout(new FillLayout());\r\n\r\n\t\t// Create the StyledText\r\n\t\tfinal StyledText styledText = new StyledText(shell, SWT.BORDER);\r\n\r\n\t\t// Add the syntax coloring handler\r\n\t\tstyledText.addExtendedModifyListener(new ExtendedModifyListener() \r\n\t\t{\r\n\t\t\tpublic void modifyText(ExtendedModifyEvent event) \r\n\t\t\t{\r\n\t\t\t\t// Determine the ending offset\r\n\t\t\t\tint end = event.start + event.length - 1;\r\n\r\n\t\t\t\t// If they typed something, get it\r\n\t\t\t\tif (event.start <= end) \r\n\t\t\t\t{\r\n\t\t\t\t\t// Get the text\r\n\t\t\t\t\tString text = styledText.getText(event.start, end);\r\n\r\n\t\t\t\t\t// Create a collection to hold the StyleRanges\r\n\t\t\t\t\tjava.util.List ranges = new java.util.ArrayList();\r\n\r\n\t\t\t\t\t// Turn any punctuation red\r\n\t\t\t\t\tfor (int i = 0, n = text.length(); i < n; i++) \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (PUNCTUATION.indexOf(text.charAt(i)) > -1) \r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tranges.add(new StyleRange(event.start + i, 1, red, null, SWT.BOLD));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// If we have any ranges to set, set them\r\n\t\t\t\t\tif (!ranges.isEmpty()) \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tstyledText.replaceStyleRanges(event.start, event.length,(StyleRange[]) ranges.toArray(new StyleRange[0]));\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 updateErrorText()\n {\n mErrorText.clear();\n mErrorText.clearSpans();\n final int length = mTextInputLayout.getText().length();\n if(length >= 0){\n mErrorText.append(String.valueOf(length));\n mErrorText.append(\" / \");\n mErrorText.append(String.valueOf(mMaxLen));\n mErrorText.setSpan(mAlignmentSpan, 0, mErrorText.length(),\n Spanned.SPAN_INCLUSIVE_EXCLUSIVE);\n if(hasValidLength()){\n mErrorText.setSpan(mNormalTextAppearance, 0, mErrorText.length(),\n Spanned.SPAN_INCLUSIVE_EXCLUSIVE);\n }\n }\n mCharacterLimit.setText(mErrorText);\n }", "private void feedback_output(){\r\n\t\tif(up){controller_computer.gui_computer.PressedBorderUp();}\r\n\t\tif(down){controller_computer.gui_computer.PressedBorderDown();}\r\n\t\tif(right){controller_computer.gui_computer.PressedBorderRight();}\r\n\t\tif(left){controller_computer.gui_computer.PressedBorderLeft();}\r\n\t}", "private void updateTextColor() {\n if (mLauncher == null) {\n return;\n }\n ItemInfo info = (ItemInfo) getTag();\n if (info == null || mSupportCard) {\n return;\n }\n int color = getDyncTitleColor(info);\n mIconTitleColor = color;\n setPaintShadowLayer(color);\n if (getPaint().getColor() != color) {\n setTextColor(color);\n }\n\n }", "public void doChanges3() {\n lm.undo(changeMark, lm.getChangeMark());\n // > UPDATE CURRENT STATE\n contInterior.put(\"Form\", new Rectangle(0, 0, 400, 300));\n compBounds.put(\"jTextField1\", new Rectangle(0, 0, 400, 20));\n baselinePosition.put(\"jTextField1-400-20\", new Integer(14));\n compBounds.put(\"jRadioButton1\", new Rectangle(0, 22, 93, 23));\n baselinePosition.put(\"jRadioButton1-93-23\", new Integer(15));\n compBounds.put(\"jRadioButton2\", new Rectangle(0, 48, 93, 23));\n baselinePosition.put(\"jRadioButton2-93-23\", new Integer(15));\n compBounds.put(\"jScrollPane1\", new Rectangle(0, 73, 35, 130));\n baselinePosition.put(\"jScrollPane1-35-130\", new Integer(0));\n compBounds.put(\"jLabel1\", new Rectangle(39, 73, 34, 14));\n baselinePosition.put(\"jLabel1-34-14\", new Integer(11));\n compBounds.put(\"jLabel2\", new Rectangle(79, 73, 34, 14));\n baselinePosition.put(\"jLabel2-34-14\", new Integer(11));\n compBounds.put(\"jTextField2\", new Rectangle(77, 113, 59, 20));\n baselinePosition.put(\"jTextField2-59-20\", new Integer(14));\n compBounds.put(\"jLabel3\", new Rectangle(39, 93, 34, 14));\n baselinePosition.put(\"jLabel3-34-14\", new Integer(11));\n compBounds.put(\"jLabel4\", new Rectangle(39, 116, 34, 14));\n baselinePosition.put(\"jLabel4-34-14\", new Integer(11));\n ld.updateCurrentState();\n // < UPDATE CURRENT STATE\n lc = new LayoutComponent(\"jLabel5\", false);\n // > START ADDING\n baselinePosition.put(\"jLabel5-34-14\", new Integer(11));\n {\n LayoutComponent[] comps = new LayoutComponent[]{lc};\n Rectangle[] bounds = new Rectangle[]{new Rectangle(0, 0, 34, 14)};\n String defaultContId = null;\n Point hotspot = new Point(13, 7);\n ld.startAdding(comps, bounds, hotspot, defaultContId);\n }\n // < START ADDING\n prefPaddingInParent.put(\"Form-jLabel5-1-0\", new Integer(11)); // parentId-compId-dimension-compAlignment\n prefPaddingInParent.put(\"Form-jLabel5-1-1\", new Integer(11)); // parentId-compId-dimension-compAlignment\n prefPadding.put(\"jTextField1-jLabel5-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel5-jTextField1-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel5-jTextField1-1-0-1\", new Integer(11)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel5-jTextField1-1-0-2\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel5-jTextField1-1-0-3\", new Integer(18)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jRadioButton1-jLabel5-1-0-1\", new Integer(7)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel5-jRadioButton1-1-0-0\", new Integer(2)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jRadioButton2-jLabel5-1-0-0\", new Integer(2)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel5-jRadioButton2-1-0-1\", new Integer(7)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel1-jLabel5-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel2-jLabel5-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel5-jLabel1-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel5-jLabel2-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel3-jLabel5-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel5-jLabel3-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jLabel5-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jLabel5-1-0-1\", new Integer(11)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jLabel5-1-0-2\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jLabel5-1-0-3\", new Integer(18)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel4-jLabel5-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel4-jLabel5-1-0-1\", new Integer(11)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel4-jLabel5-1-0-2\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel4-jLabel5-1-0-3\", new Integer(18)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel5-jTextField2-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel5-jLabel4-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPaddingInParent.put(\"Form-jLabel5-0-0\", new Integer(10)); // parentId-compId-dimension-compAlignment\n prefPaddingInParent.put(\"Form-jLabel5-0-1\", new Integer(10)); // parentId-compId-dimension-compAlignment\n prefPadding.put(\"jScrollPane1-jLabel5-0-0-0\", new Integer(4)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel5-jScrollPane1-0-0-0\", new Integer(4)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel5-jScrollPane1-0-0-1\", new Integer(10)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel5-jScrollPane1-0-0-2\", new Integer(10)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel5-jScrollPane1-0-0-3\", new Integer(18)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel4-jLabel5-0-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel5-jLabel4-0-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jLabel5-0-0-0\", new Integer(4)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jLabel5-0-0-1\", new Integer(10)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jLabel5-0-0-2\", new Integer(10)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jLabel5-0-0-3\", new Integer(18)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel5-jTextField2-0-0-0\", new Integer(4)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel3-jLabel5-0-0-2\", new Integer(10)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n // > MOVE\n // > MOVE\n // > MOVE\n {\n Point p = new Point(72, 125);\n String containerId = \"Form\";\n boolean autoPositioning = true;\n boolean lockDimension = false;\n Rectangle[] bounds = new Rectangle[]{new Rectangle(59, 116, 34, 14)};\n ld.move(p, containerId, autoPositioning, lockDimension, bounds);\n }\n // < MOVE\n prefPaddingInParent.put(\"Form-jLabel5-1-0\", new Integer(11)); // parentId-compId-dimension-compAlignment\n prefPaddingInParent.put(\"Form-jLabel5-1-1\", new Integer(11)); // parentId-compId-dimension-compAlignment\n prefPadding.put(\"jTextField1-jLabel5-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel5-jTextField1-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel5-jTextField1-1-0-1\", new Integer(11)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel5-jTextField1-1-0-2\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel5-jTextField1-1-0-3\", new Integer(18)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jRadioButton1-jLabel5-1-0-1\", new Integer(7)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel5-jRadioButton1-1-0-0\", new Integer(2)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jRadioButton2-jLabel5-1-0-0\", new Integer(2)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel5-jRadioButton2-1-0-1\", new Integer(7)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel1-jLabel5-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel2-jLabel5-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel5-jLabel1-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel5-jLabel2-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel3-jLabel5-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel5-jLabel3-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jLabel5-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jLabel5-1-0-1\", new Integer(11)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jLabel5-1-0-2\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jLabel5-1-0-3\", new Integer(18)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel4-jLabel5-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel4-jLabel5-1-0-1\", new Integer(11)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel4-jLabel5-1-0-2\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel4-jLabel5-1-0-3\", new Integer(18)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel5-jTextField2-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel5-jLabel4-1-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPaddingInParent.put(\"Form-jLabel5-0-0\", new Integer(10)); // parentId-compId-dimension-compAlignment\n prefPaddingInParent.put(\"Form-jLabel5-0-1\", new Integer(10)); // parentId-compId-dimension-compAlignment\n prefPadding.put(\"jScrollPane1-jLabel5-0-0-0\", new Integer(4)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel5-jScrollPane1-0-0-0\", new Integer(4)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel5-jScrollPane1-0-0-1\", new Integer(10)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel5-jScrollPane1-0-0-2\", new Integer(10)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel5-jScrollPane1-0-0-3\", new Integer(18)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel4-jLabel5-0-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel5-jLabel4-0-0-0\", new Integer(6)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jLabel5-0-0-0\", new Integer(4)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jLabel5-0-0-1\", new Integer(10)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jLabel5-0-0-2\", new Integer(10)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jTextField2-jLabel5-0-0-3\", new Integer(18)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel5-jTextField2-0-0-0\", new Integer(4)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n prefPadding.put(\"jLabel3-jLabel5-0-0-2\", new Integer(10)); // comp1Id-comp2Id-dimension-comp2Alignment-paddingType\n // > MOVE\n // > MOVE\n // > MOVE\n {\n Point p = new Point(73, 125);\n String containerId = \"Form\";\n boolean autoPositioning = true;\n boolean lockDimension = false;\n Rectangle[] bounds = new Rectangle[]{new Rectangle(60, 116, 34, 14)};\n ld.move(p, containerId, autoPositioning, lockDimension, bounds);\n }\n // < MOVE\n // > END MOVING\n compPrefSize.put(\"jLabel5\", new Dimension(34, 14));\n ld.endMoving(true);\n // < END MOVING\n ld.externalSizeChangeHappened();\n // > UPDATE CURRENT STATE\n contInterior.put(\"Form\", new Rectangle(0, 0, 400, 300));\n compBounds.put(\"jTextField1\", new Rectangle(0, 0, 400, 20));\n baselinePosition.put(\"jTextField1-400-20\", new Integer(14));\n compBounds.put(\"jRadioButton1\", new Rectangle(0, 22, 93, 23));\n baselinePosition.put(\"jRadioButton1-93-23\", new Integer(15));\n compBounds.put(\"jRadioButton2\", new Rectangle(0, 48, 93, 23));\n baselinePosition.put(\"jRadioButton2-93-23\", new Integer(15));\n compBounds.put(\"jScrollPane1\", new Rectangle(0, 73, 35, 130));\n baselinePosition.put(\"jScrollPane1-35-130\", new Integer(0));\n compBounds.put(\"jLabel1\", new Rectangle(39, 73, 34, 14));\n baselinePosition.put(\"jLabel1-34-14\", new Integer(11));\n compBounds.put(\"jLabel2\", new Rectangle(79, 73, 34, 14));\n baselinePosition.put(\"jLabel2-34-14\", new Integer(11));\n compBounds.put(\"jTextField2\", new Rectangle(117, 113, 59, 20));\n baselinePosition.put(\"jTextField2-59-20\", new Integer(14));\n compBounds.put(\"jLabel3\", new Rectangle(39, 93, 34, 14));\n baselinePosition.put(\"jLabel3-34-14\", new Integer(11));\n compBounds.put(\"jLabel4\", new Rectangle(39, 116, 34, 14));\n baselinePosition.put(\"jLabel4-34-14\", new Integer(11));\n compBounds.put(\"jLabel5\", new Rectangle(79, 116, 34, 14));\n baselinePosition.put(\"jLabel5-34-14\", new Integer(11));\n prefPaddingInParent.put(\"Form-jRadioButton1-0-1\", new Integer(6)); // parentId-compId-dimension-compAlignment\n prefPaddingInParent.put(\"Form-jRadioButton2-0-1\", new Integer(6)); // parentId-compId-dimension-compAlignment\n prefPaddingInParent.put(\"Form-jLabel3-0-1\", new Integer(10)); // parentId-compId-dimension-compAlignment\n prefPaddingInParent.put(\"Form-jLabel2-0-1\", new Integer(10)); // parentId-compId-dimension-compAlignment\n prefPaddingInParent.put(\"Form-jTextField2-0-1\", new Integer(10)); // parentId-compId-dimension-compAlignment\n compPrefSize.put(\"jTextField1\", new Dimension(59, 20));\n compPrefSize.put(\"jRadioButton1\", new Dimension(93, 23));\n compPrefSize.put(\"jRadioButton2\", new Dimension(93, 23));\n compPrefSize.put(\"jScrollPane1\", new Dimension(35, 130));\n compPrefSize.put(\"jLabel1\", new Dimension(34, 14));\n compPrefSize.put(\"jLabel2\", new Dimension(34, 14));\n compPrefSize.put(\"jTextField2\", new Dimension(59, 20));\n compPrefSize.put(\"jLabel3\", new Dimension(34, 14));\n compPrefSize.put(\"jLabel4\", new Dimension(34, 14));\n compPrefSize.put(\"jLabel5\", new Dimension(34, 14));\n contInterior.put(\"Form\", new Rectangle(0, 0, 400, 300));\n compBounds.put(\"jTextField1\", new Rectangle(0, 0, 400, 20));\n baselinePosition.put(\"jTextField1-400-20\", new Integer(14));\n compBounds.put(\"jRadioButton1\", new Rectangle(0, 22, 93, 23));\n baselinePosition.put(\"jRadioButton1-93-23\", new Integer(15));\n compBounds.put(\"jRadioButton2\", new Rectangle(0, 48, 93, 23));\n baselinePosition.put(\"jRadioButton2-93-23\", new Integer(15));\n compBounds.put(\"jScrollPane1\", new Rectangle(0, 73, 35, 130));\n baselinePosition.put(\"jScrollPane1-35-130\", new Integer(0));\n compBounds.put(\"jLabel1\", new Rectangle(39, 73, 34, 14));\n baselinePosition.put(\"jLabel1-34-14\", new Integer(11));\n compBounds.put(\"jLabel2\", new Rectangle(79, 73, 34, 14));\n baselinePosition.put(\"jLabel2-34-14\", new Integer(11));\n compBounds.put(\"jTextField2\", new Rectangle(117, 113, 59, 20));\n baselinePosition.put(\"jTextField2-59-20\", new Integer(14));\n compBounds.put(\"jLabel3\", new Rectangle(39, 93, 34, 14));\n baselinePosition.put(\"jLabel3-34-14\", new Integer(11));\n compBounds.put(\"jLabel4\", new Rectangle(39, 116, 34, 14));\n baselinePosition.put(\"jLabel4-34-14\", new Integer(11));\n compBounds.put(\"jLabel5\", new Rectangle(79, 116, 34, 14));\n baselinePosition.put(\"jLabel5-34-14\", new Integer(11));\n ld.updateCurrentState();\n // < UPDATE CURRENT STATE\n // > START RESIZING\n baselinePosition.put(\"jTextField2-59-20\", new Integer(14));\n compPrefSize.put(\"jTextField2\", new Dimension(59, 20));\n {\n String[] compIds = new String[]{\"jTextField2\"};\n Rectangle[] bounds = new Rectangle[]{new Rectangle(117, 113, 59, 20)};\n Point hotspot = new Point(175, 125);\n int[] resizeEdges = new int[]{1, -1};\n boolean inLayout = true;\n ld.startResizing(compIds, bounds, hotspot, resizeEdges, inLayout);\n }\n // < START RESIZING\n prefPaddingInParent.put(\"Form-jTextField2-0-1\", new Integer(10)); // parentId-compId-dimension-compAlignment\n // > MOVE\n // > MOVE\n // > MOVE\n {\n Point p = new Point(398, 137);\n String containerId = \"Form\";\n boolean autoPositioning = true;\n boolean lockDimension = false;\n Rectangle[] bounds = new Rectangle[]{new Rectangle(117, 113, 283, 20)};\n ld.move(p, containerId, autoPositioning, lockDimension, bounds);\n }\n // < MOVE\n prefPaddingInParent.put(\"Form-jTextField2-0-1\", new Integer(10)); // parentId-compId-dimension-compAlignment\n // > MOVE\n // > MOVE\n // > MOVE\n {\n Point p = new Point(399, 137);\n String containerId = \"Form\";\n boolean autoPositioning = true;\n boolean lockDimension = false;\n Rectangle[] bounds = new Rectangle[]{new Rectangle(117, 113, 283, 20)};\n ld.move(p, containerId, autoPositioning, lockDimension, bounds);\n }\n // < MOVE\n // > END MOVING\n ld.endMoving(true);\n // < END MOVING\n ld.externalSizeChangeHappened();\n // > UPDATE CURRENT STATE\n contInterior.put(\"Form\", new Rectangle(0, 0, 400, 300));\n compBounds.put(\"jTextField1\", new Rectangle(0, 0, 400, 20));\n baselinePosition.put(\"jTextField1-400-20\", new Integer(14));\n compBounds.put(\"jRadioButton1\", new Rectangle(0, 22, 93, 23));\n baselinePosition.put(\"jRadioButton1-93-23\", new Integer(15));\n compBounds.put(\"jRadioButton2\", new Rectangle(0, 48, 93, 23));\n baselinePosition.put(\"jRadioButton2-93-23\", new Integer(15));\n compBounds.put(\"jScrollPane1\", new Rectangle(0, 73, 35, 130));\n baselinePosition.put(\"jScrollPane1-35-130\", new Integer(0));\n compBounds.put(\"jLabel1\", new Rectangle(39, 73, 34, 14));\n baselinePosition.put(\"jLabel1-34-14\", new Integer(11));\n compBounds.put(\"jLabel2\", new Rectangle(79, 73, 34, 14));\n baselinePosition.put(\"jLabel2-34-14\", new Integer(11));\n compBounds.put(\"jTextField2\", new Rectangle(117, 113, 283, 20));\n baselinePosition.put(\"jTextField2-283-20\", new Integer(14));\n compBounds.put(\"jLabel3\", new Rectangle(39, 93, 34, 14));\n baselinePosition.put(\"jLabel3-34-14\", new Integer(11));\n compBounds.put(\"jLabel4\", new Rectangle(39, 116, 34, 14));\n baselinePosition.put(\"jLabel4-34-14\", new Integer(11));\n compBounds.put(\"jLabel5\", new Rectangle(79, 116, 34, 14));\n baselinePosition.put(\"jLabel5-34-14\", new Integer(11));\n prefPaddingInParent.put(\"Form-jRadioButton1-0-1\", new Integer(6)); // parentId-compId-dimension-compAlignment\n prefPaddingInParent.put(\"Form-jRadioButton2-0-1\", new Integer(6)); // parentId-compId-dimension-compAlignment\n compPrefSize.put(\"jTextField1\", new Dimension(59, 20));\n compPrefSize.put(\"jRadioButton1\", new Dimension(93, 23));\n compPrefSize.put(\"jRadioButton2\", new Dimension(93, 23));\n compPrefSize.put(\"jScrollPane1\", new Dimension(35, 130));\n compPrefSize.put(\"jLabel1\", new Dimension(34, 14));\n compPrefSize.put(\"jLabel2\", new Dimension(34, 14));\n compPrefSize.put(\"jTextField2\", new Dimension(59, 20));\n compPrefSize.put(\"jLabel3\", new Dimension(34, 14));\n compPrefSize.put(\"jLabel4\", new Dimension(34, 14));\n compPrefSize.put(\"jLabel5\", new Dimension(34, 14));\n contInterior.put(\"Form\", new Rectangle(0, 0, 400, 300));\n compBounds.put(\"jTextField1\", new Rectangle(0, 0, 400, 20));\n baselinePosition.put(\"jTextField1-400-20\", new Integer(14));\n compBounds.put(\"jRadioButton1\", new Rectangle(0, 22, 93, 23));\n baselinePosition.put(\"jRadioButton1-93-23\", new Integer(15));\n compBounds.put(\"jRadioButton2\", new Rectangle(0, 48, 93, 23));\n baselinePosition.put(\"jRadioButton2-93-23\", new Integer(15));\n compBounds.put(\"jScrollPane1\", new Rectangle(0, 73, 35, 130));\n baselinePosition.put(\"jScrollPane1-35-130\", new Integer(0));\n compBounds.put(\"jLabel1\", new Rectangle(39, 73, 34, 14));\n baselinePosition.put(\"jLabel1-34-14\", new Integer(11));\n compBounds.put(\"jLabel2\", new Rectangle(79, 73, 34, 14));\n baselinePosition.put(\"jLabel2-34-14\", new Integer(11));\n compBounds.put(\"jTextField2\", new Rectangle(117, 113, 283, 20));\n baselinePosition.put(\"jTextField2-283-20\", new Integer(14));\n compBounds.put(\"jLabel3\", new Rectangle(39, 93, 34, 14));\n baselinePosition.put(\"jLabel3-34-14\", new Integer(11));\n compBounds.put(\"jLabel4\", new Rectangle(39, 116, 34, 14));\n baselinePosition.put(\"jLabel4-34-14\", new Integer(11));\n compBounds.put(\"jLabel5\", new Rectangle(79, 116, 34, 14));\n baselinePosition.put(\"jLabel5-34-14\", new Integer(11));\n ld.updateCurrentState();\n // < UPDATE CURRENT STATE\n }", "public void setFontColor(int red, int green, int blue, int alpha){\n if(isTheColorInputCorrect(red, green, blue, alpha)){\n fontColor = new Color(red, green, blue); \n }\n }", "private void updateAndAlertListener() {\n\n\t\teditText.setText(getRoundedValue(value));\n\n\t\tif (changeListener != null) {\n\t\t\tchangeListener.onValueChange(this, value);\n\t\t}\n\t}", "public static void main (String[] args) {\n System.out.printf (\"%s%20s%s\\n\",\"\\033[42m\",\"\",\"\\033[40m\");\n System.out.printf (\"%s%20s%s\\n\",\"\\033[42m\",\"\",\"\\033[40m\");\n System.out.printf (\"%s%20s%s\\n\",\"\\033[107m\",\"\",\"\\033[40m\");\n System.out.printf (\"%s%20s%s\\n\",\"\\033[107m\\033[90m\",\"ANDALUCÍA \",\"\\033[40m\");\n //System.out.printf (\"%s%20s%s\\n\",\"\\033[107m\",\"ANDALUCÍA \",\"\\033[40m\");\n System.out.printf (\"%s%20s%s\\n\",\"\\033[107m\",\"\",\"\\033[40m\");\n System.out.printf (\"%s%20s%s\\n\",\"\\033[42m\",\"\",\"\\033[40m\");\n System.out.printf (\"%s%20s%s\\n\",\"\\033[42m\",\"\",\"\\033[40m\"); \n \n \n }", "@FXML\r\n void fontAction() {\r\n // default css code for each characteristics of the text\r\n String textFont = \"-fx-font-family: \";\r\n String textSize = \"-fx-font-size: \";\r\n String textStyle = \"\";\r\n\r\n // Create and take the input from the Font dialog\r\n Dialog<Font> fontSelector = new FontSelectorDialog(null);\r\n Optional<Font> result = fontSelector.showAndWait();\r\n\r\n // add changes to the default CSS code above based on the users\r\n if (result.isPresent()) {\r\n Font newFont = result.get();\r\n textFont += \"\\\"\" + newFont.getFamily() + \"\\\";\";\r\n textSize += newFont.getSize() + \"px;\";\r\n\r\n // some basics CSS font characteristics\r\n String style = newFont.getStyle();\r\n String style_italic = \"-fx-font-style: italic;\";\r\n String style_regular = \"-fx-font-weight: normal ;\";\r\n String style_bold = \"-fx-font-weight: bold;\";\r\n switch (style) {\r\n case \"Bold Italic\":\r\n textStyle += style_bold + \"\\n\" + style_italic;\r\n case \"Italic\":\r\n textStyle += style_italic;\r\n case \"Regular\":\r\n textStyle += style_regular;\r\n case \"Regular Italic\":\r\n textStyle += style_italic;\r\n default:\r\n textStyle += style_bold;\r\n }\r\n\r\n // Add all characteristic to a single string\r\n String finalText = textFont + \"\\n\" + textSize;\r\n finalText += \"\\n\" + textStyle;\r\n // Display options and set that options to the text\r\n defOutput.setStyle(finalText);\r\n }\r\n }", "public ColorController createForeground(ControllerCore genCode) {\n\t\tforegroundTXT = new ColorController(\"foreground\", getParentController(controlItemSCSCLC), genCode) {\n\t\t\t@Override\n\t\t\tpublic void initialize() {\n\t\t\t\tsetLinkedController(foreground$1LBL);\n\t\t\t\tsetProperty(\"foreground\");\n\t\t\t\tsuper.initialize();\n\t\t\t}\n\t\t\t@Override\n\t\t\tpublic void createControl() {\n\t\t\t\tsuper.createControl();\n\t\t\t\tif (isValid()) {\n\t\t\t\t\tif (null != fieldBindManager)\n\t\t\t\t\t\tfieldBindManager = new XjcFieldBindingManager(this);\n\t\t\t\t\tgetControl().addFocusListener(new XjcFocusListener(this));\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\treturn foregroundTXT;\n\t}", "public void displayCurrentValues() {\n currentX.setText(_DF.format(deltaX));\n currentY.setText(_DF.format(deltaY));\n currentZ.setText(_DF.format(deltaZ));\n }", "@Override\n public void onTextChanged(CharSequence s, int start, int before, int count) {\n if (s.toString().equalsIgnoreCase(\"\")) {\n mTextTarget.setTextColor(getResources().getColor(R.color.black));\n mTextTarget.setEnabled(false);\n } else {\n //Not sure what this color is exactly doing\n //mTextTarget.setTextColor(getResources().getColorStateList(R.color.text_field_back_color));\n mTextTarget.setEnabled(true);\n }\n\n }", "public void update(){\n \tSystem.out.println(model.toString());\n\t\tnumberofsteps.setText(model.toString());\n\t\tint selectedColor = model.getCurrentSelectedColor();\n\t\t\n\t\t// Update dots\n\t\tfor (int i = 0; i < size; i++){\n\t\t\tfor (int j = 0; j < size; j++){\n\t\t\t\t// Assign captured dots to correct colour\n\t\t\t\tif (model.isCaptured(i, j))\n\t\t\t\t\tdots[i][j].setColor(selectedColor);\n\t\t\t}\n\t\t}\n\t\t\n }", "private void highlightText(Text text){\r\n\t text.changeColor(AnimalScript.COLORCHANGE_COLOR, Color.RED, new TicksTiming(0), new TicksTiming(0));\r\n\t }", "private void updateWeightTextFieldToStored(String errorMsg)\n {\n SpriteGrader spriteGrader = (SpriteGrader) context\n .getComponent(SpriteGrader.MODULE_NAME);\n if (spriteGrader != null)\n {\n // update the weight text box\n weightTextField.setText(String.format(\"%5.3f\",\n spriteGrader.getWeightFrom0To1()));\n }\n else\n {\n System.out.println(\"Cannot open the Sprite Grader \"\n + \"Weighted Component in gui.\");\n\n weightTextField.setText(errorMsg);\n }\n }", "private void checkTexts() {\n EditText firstText = (EditText) findViewById(R.id.txt_FirstNum);\n EditText secText = (EditText) findViewById(R.id.txt_SecondNum);\n EditText thirdText = (EditText) findViewById(R.id.txt_ThirdNum);\n EditText fourthText = (EditText) findViewById(R.id.txt_FourthNum);\n\n EditText[] allInputTextField = {firstText, secText, thirdText, fourthText};\n inputNum.clear();\n\n try {\n for (int i = 0; i < 4; i++) {\n Integer number = Integer.parseInt(allInputTextField[i].getText().toString());\n inputNum.add(number);\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n if (randomNums.size() > 0 && inputNum.size() == 4) {\n for (int i = 0; i < randomNums.size(); i++) {\n int colorID;\n if (inputNum.get(i).equals(randomNums.get(i))) {\n colorID = R.color.green;\n } else if (inputNum.get(i) > 4) {\n colorID = R.color.red;\n } else {\n colorID = R.color.blue;\n }\n allInputTextField[i].setTextColor(getResources().getColor(colorID));\n }\n }\n }" ]
[ "0.6672265", "0.6192933", "0.56591153", "0.56461257", "0.56371146", "0.55782086", "0.5566505", "0.55624765", "0.55357707", "0.5516852", "0.55006343", "0.54506785", "0.54493433", "0.53179306", "0.5315021", "0.52874184", "0.52546996", "0.5253322", "0.52470046", "0.5209848", "0.5185427", "0.5132981", "0.51308936", "0.5125456", "0.5113154", "0.5109506", "0.50971407", "0.509383", "0.5087615", "0.50862193", "0.5084155", "0.5048083", "0.5039078", "0.5035916", "0.5032659", "0.49896315", "0.49696392", "0.49516192", "0.49473044", "0.49381334", "0.4929277", "0.492822", "0.49198958", "0.49157193", "0.49032527", "0.48884064", "0.48812395", "0.4876031", "0.48687539", "0.48675397", "0.4865368", "0.4848891", "0.48293754", "0.48225376", "0.4822243", "0.4818645", "0.48011443", "0.48001334", "0.47949573", "0.47892252", "0.47825006", "0.47771716", "0.47747177", "0.4757815", "0.47540307", "0.47471523", "0.47453803", "0.4743683", "0.47331443", "0.4729676", "0.47212824", "0.4712886", "0.4706841", "0.47065544", "0.47014445", "0.46991253", "0.4693163", "0.4692412", "0.46902955", "0.46888173", "0.46820888", "0.4679776", "0.4672497", "0.46686998", "0.46663883", "0.46663", "0.46655706", "0.46613294", "0.4658507", "0.46572807", "0.4654164", "0.46500275", "0.46493983", "0.46442616", "0.46397817", "0.4638108", "0.46316156", "0.4630397", "0.4630327", "0.4624727" ]
0.7722504
0
Updates after a property change the shell styles.
public void propertyChange(final PropertyChangeEvent _event) { this.updateStyle(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void updateStyle()\n {\n this.textOutput.setForeground(new Color(null, ShellPreference.OUTPUT_COLOR_INPUT.getRGB()));\n this.textOutput.setBackground(new Color(null, ShellPreference.OUTPUT_BACKGROUND.getRGB()));\n this.textOutput.setFont(new Font(null, ShellPreference.OUTPUT_FONT.getFontData()));\n this.colorOuput = new Color(null, ShellPreference.OUTPUT_COLOR_OUTPUT.getRGB());\n this.colorError = new Color(null, ShellPreference.OUTPUT_COLOR_ERROR.getRGB());\n\n this.textInput.setForeground(new Color(null, ShellPreference.INPUT_COLOR.getRGB()));\n this.textInput.setBackground(new Color(null, ShellPreference.INPUT_BACKGROUND.getRGB()));\n this.textInput.setFont(new Font(null, ShellPreference.INPUT_FONT.getFontData()));\n\n this.historyMax = ShellPreference.MAX_HISTORY.getInt();\n }", "void onStyleModify() {\n\t\tif (mergedStyleSheet != null) {\n\t\t\tmergedStyleSheet = null;\n\t\t\tsheets.setNeedsUpdate(true);\n\t\t} else if (sheets != null) {\n\t\t\tsheets.setNeedsUpdate(true);\n\t\t}\n\t}", "void setStatusProperty(String property, Double value);", "@Override\n\tpublic void propertyChange() {\n\t\tthis.apply();\n\t}", "public void updateGrepStyle()\n\t{\n\t\tgrepStyle.setName(textName.getText());\n\t\tgrepStyle.setBold(cbBold.getSelection());\n\t\tgrepStyle.setItalic(cbItalic.getSelection());\n\t\tgrepStyle.setForeground(cpForeground.getEffectiveColor());\n\t\tgrepStyle.setBackground(cpBackground.getEffectiveColor());\n\t\tgrepStyle.setUnderline(cpUnderline.isChecked());\n\t\tgrepStyle.setUnderlineColor(cpUnderline.getColor()); \n\t\tgrepStyle.setStrikeout(cpStrikethrough.isChecked());\n\t\tgrepStyle.setStrikeoutColor(cpStrikethrough.getColor());\n\t\tgrepStyle.setBorder(cpBorder.isChecked());\n\t\tgrepStyle.setBorderColor(cpBorder.getColor());\n\t}", "@Override\n protected void updateProperties() {\n }", "protected void propertyChange(PropertyChangeEvent evt) {\n if (evt.getPropertyName().equals(\"editable\") ||\n evt.getPropertyName().equals(\"enabled\")) {\n\n updateBackground((JTextComponent)evt.getSource());\n } else if (evt.getPropertyName().equals(\"caretWidth\")) {\n Object value = evt.getNewValue();\n if (value instanceof Number) {\n int width = ((Number) value).intValue();\n if (width >= 0) caretMargin = width;\n }\n }\n }", "private static void updateColors() {\n try {\n text.setBackground(colorScheme[0]); outputText.setBackground(colorScheme[0]); \n //frame.setBackground(colorScheme[0]);\n\n //Determines the color to set the splitter\n if(colorScheme[0].equals(Color.BLACK)) splitter.setBackground(Color.DARK_GRAY.darker());\n else if(colorScheme[0].equals(new Color(35,37,50))) splitter.setBackground(new Color(35,37,50).brighter());\n else if(colorScheme[0].equals(Color.GRAY) || colorScheme[0].equals(Color.LIGHT_GRAY) || colorScheme[0].equals(Color.WHITE)) splitter.setBackground(null);\n else splitter.setBackground(colorScheme[0].darker());\n\n text.getStyledDocument().getForeground(attributeScheme[11]); //Will work, but needs to be refreshed somehow.\n outputText.setForeground(colorScheme[11]); \n } catch (Exception e) {\n System.out.println(\"The error was here!\");\n e.printStackTrace();\n }\n }", "@Override\n public void updateProperties() {\n // unneeded\n }", "void\t\tsetCommandPropertyValue(String command, String propertyName, String propertyValue);", "@Override\r\n\tpublic void setProperty(Properties prop) {\n\t}", "@Override\n\t\t\tpublic void update(Observable o, Object arg) {\n\t\t\t\tupdateCurrentLineForeground(Properties.getDefaultProperties().getOptinalColorProperty(currentLineFontForegroundKey, \n\t\t\t\t\t\t\t\t\t\t\tColor.black));\n\t\t\t}", "void setStyle(String style);", "public void doRefresh() {\n\t\tArrayList<SystemProperty> props = new ArrayList<>();\n\t\t\n\t\tfor (Entry<Object, Object> entry: System.getProperties().entrySet()) {\n\t\t\tprops.add(new SystemProperty(entry.getKey().toString(), entry.getValue().toString()));\n\t\t}\n\t\tCollections.sort(props);\n\t\tthis.properties = props;\n\t}", "@Override\n\t\t\t\tpublic void propertyChange(PropertyChangeEvent evt) {\n\t\t\t\t\tswitch (evt.getPropertyName()) {\n\n\t\t\t\t\t// propertyName progress tells us progress value\n\t\t\t\t\tcase \"progress\":\n\t\t\t\t\t\twindow.setScalingProgressBar((Integer) evt.getNewValue());\n\t\t\t\t\t}\n\n\t\t\t\t}", "public void notifyChanged(final Notification msg) {\r\n\t super.notifyChanged(msg);\r\n\t \r\n\t if(msg.getFeature() == PropertiesPackage.Literals.PROPERTY__VALUE) {\r\n\t \tsetGUIAttributes();\r\n\t }\r\n\t }", "public final void setProperty(String key, Object value) {\n/* 57 */ Launch.blackboard.put(key, value);\n/* */ }", "public void updateSyntaxStyles() {\n }", "private void applyStyle() {\n\t\tmenu.getStyleClass().add(menuColor);\n\t}", "private void storComponentProperties(){\n\t\t//IPreferenceStore prefStore = JFacePreferences.getPreferenceStore();\n\t\t//PreferenceStore prefStore = mOyster2.getPreferenceStore();\n\t\tProperties mprop = mOyster2.getProperties();\n\t\tint count = mprop.getInteger(Constants.NUMBER_OF_COLUMNS);\n\t\tfor(int i=0; i<count; i++){\n\t\t\tmprop.setString(Constants.COLUMN_TYPE+i, mprop.getDefaultString(Constants.COLUMN_TYPE+i));\n\t\t\tmprop.setString(Constants.COLUMN_NAME+i, mprop.getDefaultString(Constants.COLUMN_NAME+i));\n\t\t\tmprop.setString(Constants.COLUMN_WIDTH+i, mprop.getDefaultString(Constants.COLUMN_WIDTH+i));\n\t\t\t/*\n\t\t\tprefStore.setToDefault(Constants.COLUMN_TYPE+i);\n\t\t\tprefStore.setToDefault(Constants.COLUMN_NAME+i);\n\t\t\tprefStore.setToDefault(Constants.COLUMN_WIDTH+i);\n\t\t\t*/\n\t\t}\n\t\tmprop.setString(Constants.NUMBER_OF_COLUMNS, \"\"+columns.size());\n\t\tfor(int i=0; i<columns.size(); i++){\n\t\t\tResultViewerColumnInfo colInf = getColumnInfo(i);\n\t\t\tmprop.setString(Constants.COLUMN_NAME + i, colInf.getColumnName());\n\t\t\tmprop.setString(Constants.COLUMN_TYPE + i, colInf.getColumnType());\n\t\t\tmprop.setString(Constants.COLUMN_WIDTH + i, \"\"+colInf.getWidth());\n\t\t}\n\t\ttry{\n\t\t\tmprop.storeOn();\n\t\t\t//prefStore.save();\n\t\t}\n\t\tcatch(Exception IO){\n\t\t\tSystem.out.println(\"couldnt save properties\");\n\t\t}\n\t\t\n\t}", "public void setProperty(String property) {\n }", "public void propertyChange(PropertyChangeEvent event)\n {\n \t\tif(event.getProperty().equals(\"tabsAsSpaces\") \n \t\t\t|| event.getProperty().equals(\"tabWidth\"))\n \t\t{\n \t\t//System.out.println(\n \t\t\t\t//\"Tab preferences have changed. Resetting the editor.\"\n \t\t\t//);\n \t\t\tISourceViewer sourceViewer = getSourceViewer();\n \t\t\tsourceViewer.getTextWidget().setTabs(\n \t\t\t\tconfiguration.getTabWidth(sourceViewer)\n \t\t\t);\n }\n }", "public void applyCurrentStyle()\n\t{\n\t\tthis.getCurrentStyleTree().saveCurrentStyle();\n\t\tthis.guiController.rebuildStyle();\n\n\t\tThreadService.executeOnEDT(new Runnable()\n\t\t{\n\t\t\t@Override\n\t\t\tpublic void run()\n\t\t\t{\n\t\t\t\tgetCurrentStyleTree().repaint();\n\t\t\t}\n\t\t});\n\t}", "public abstract BossBar setStyle(BossStyle style);", "void updatedProperty(TestResult tr, String name, String value);", "public final synchronized void setStyle(int style){\n this.style = style;\n\n if (isLoggedIn()){\n sendCommand(\"$set style \"+style);\n filterLine(\"Style \"+style+\" set.\");\n }\n }", "protected void configureShell(Shell shell) {\n super.configureShell(shell);\n shell.setText(Messages.getString(\"EditAction.Edit\") + getPropertyLabel()); //$NON-NLS-1$\n }", "public synchronized void resetStyle() {\n \t\tstyleInitialized = false;\n \t}", "private void processProperty(String name, Object value)\n\t{\n\t\tfinal TableViewProxy tableViewProxy = getTableViewProxy();\n\n\t\tif (name.equals(TiC.PROPERTY_SELECTED_BACKGROUND_COLOR)) {\n\t\t\tLog.w(TAG, \"selectedBackgroundColor is deprecated, use backgroundSelectedColor instead.\");\n\t\t\tsetProperty(TiC.PROPERTY_BACKGROUND_SELECTED_COLOR, value);\n\t\t}\n\t\tif (name.equals(TiC.PROPERTY_SELECTED_BACKGROUND_IMAGE)) {\n\t\t\tLog.w(TAG, \"selectedBackgroundImage is deprecated, use backgroundSelectedImage instead.\");\n\t\t\tsetProperty(TiC.PROPERTY_BACKGROUND_SELECTED_IMAGE, value);\n\t\t}\n\n\t\t// TableViewRow.header and TableViewRow.footer have been deprecated.\n\t\tif (name.equals(TiC.PROPERTY_HEADER)) {\n\t\t\theaderDeprecationLog();\n\t\t}\n\t\tif (name.equals(TiC.PROPERTY_FOOTER)) {\n\t\t\tfooterDeprecationLog();\n\t\t}\n\n\t\t// Set selected color from selection style.\n\t\tif (!hasPropertyAndNotNull(TiC.PROPERTY_BACKGROUND_SELECTED_COLOR)\n\t\t\t&& name.equals(TiC.PROPERTY_SELECTION_STYLE)\n\t\t\t&& value instanceof Integer) {\n\t\t\tString selectionColor = null;\n\n\t\t\tswitch ((Integer) value) {\n\t\t\t\tcase UIModule.SELECTION_STYLE_NONE:\n\t\t\t\t\tselectionColor = \"transparent\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tsetProperty(TiC.PROPERTY_BACKGROUND_SELECTED_COLOR, selectionColor);\n\t\t\tinvalidate();\n\t\t}\n\n\t\tif (name.equals(TiC.PROPERTY_LEFT_IMAGE)\n\t\t\t|| name.equals(TiC.PROPERTY_RIGHT_IMAGE)\n\t\t\t|| name.equals(TiC.PROPERTY_HAS_CHECK)\n\t\t\t|| name.equals(TiC.PROPERTY_HAS_CHILD)\n\t\t\t|| name.equals(TiC.PROPERTY_HAS_DETAIL)\n\t\t\t|| name.equals(TiC.PROPERTY_BACKGROUND_COLOR)\n\t\t\t|| name.equals(TiC.PROPERTY_BACKGROUND_IMAGE)\n\t\t\t|| name.equals(TiC.PROPERTY_SELECTED_BACKGROUND_COLOR)\n\t\t\t|| name.equals(TiC.PROPERTY_BACKGROUND_SELECTED_COLOR)\n\t\t\t|| name.equals(TiC.PROPERTY_SELECTED_BACKGROUND_IMAGE)\n\t\t\t|| name.equals(TiC.PROPERTY_BACKGROUND_SELECTED_IMAGE)\n\t\t\t|| name.equals(TiC.PROPERTY_TITLE)\n\t\t\t|| name.equals(TiC.PROPERTY_COLOR)\n\t\t\t|| name.equals(TiC.PROPERTY_FONT)\n\t\t\t|| name.equals(TiC.PROPERTY_LEFT)\n\t\t\t|| name.equals(TiC.PROPERTY_RIGHT)\n\t\t\t|| name.equals(TiC.PROPERTY_TOP)\n\t\t\t|| name.equals(TiC.PROPERTY_BOTTOM)\n\t\t\t|| name.equals(TiC.PROPERTY_MOVABLE)) {\n\n\t\t\t// Force re-bind of row.\n\t\t\tinvalidate();\n\t\t}\n\t}", "private void endProperty()\n {\n\n }", "public void propertiesChanged(String property, String value) {\n\t\tif(property != null) {\n \t\t\tFComponent comp = mainFrame.getSelectedComponent().getComponent();\n \t\t\tif(comp.getLabel() == null || !comp.getLabel().equals(value)) {\n \t\t\t\tcomp.setLabel(value);\n \t\t\t\tmainFrame.refreshPreview();\t\t\t\t\n \t\t\t}\n \t\t}\n \t}", "public void modify( CellStyle style );", "public void redoProjectProperties()\n\t{\n\t\tprojectProperties.revalidate();\n projectProperties.repaint();\n\t}", "public void propertyChange(PropertyChangeEvent e) {\n String prop = e.getPropertyName();\n\n if (isVisible()\n && (e.getSource() == optionPane)\n && (JOptionPane.VALUE_PROPERTY.equals(prop) ||\n JOptionPane.INPUT_VALUE_PROPERTY.equals(prop))) {\n Object value = optionPane.getValue();\n if (value == JOptionPane.UNINITIALIZED_VALUE)\n return;\n optionPane.setValue(JOptionPane.UNINITIALIZED_VALUE);\n\n if (btnString1.equals(value)) {\n \tint charsPerLine = (int)widthField.getValue();\n \tBufferedImage image = getFontImage(charsPerLine);\n \t\ttry {\n \t\t File file = new File(\"fontx.png\");\n \t\t ImageIO.write(image, \"png\", file);\n \t\t} catch (IOException ioe) {}\n \t\t}\n\t\t\tsetVisible(false);\n }\n\t}", "public void updateStyles()\n\t{\n\t\tIterator<StyleEditorTree> trees = this.getStyleTrees();\n\t\tStyleEditorTree current;\n\n\t\twhile (trees.hasNext())\n\t\t{\n\t\t\tcurrent = trees.next();\n\t\t\tcurrent.updateTreeRendering();\n\t\t}\n\t}", "void setCommandProperties(String commandID, AttributeList properties);", "public void propertyChange(final PropertyChangeEvent event) {\n RGB newColor = colorSelector.getColorValue();\n setBackgroundViewColor(newColor);\n _plot.getModelSpaceCanvas().setGridLineProperties(LineStyle.NONE, newColor, 0);\n }", "public void propertyChange(PropertyChangeEvent evt) {\n\t\t/*\n\t\t * String prop = evt.getPropertyName();\n\t\t * if(prop.equals(ConceptSelector.CONCEPT_SELECTED) && evt.getNewValue()\n\t\t * != null){ ReportDocument doc =\n\t\t * caseAuthor.getReportPanel().getReportDocument();\n\t\t * doc.clearBackground(); ConceptEntry entry = (ConceptEntry)\n\t\t * evt.getNewValue(); for(ConceptLabel lbl: entry.getLabels()){\n\t\t * lbl.setBackgroundColor(Color.yellow); lbl.update(doc); } }\n\t\t */\n\t}", "public void setStyle(String st){\n style = st;\n }", "public void changePropery(String property, String newValueExpr) {\n \t\n\n \n\t}", "protected void updateProperties() {\n HomeEnvironment homeEnvironment = this.home.getEnvironment();\n setGroundColor(homeEnvironment.getGroundColor());\n HomeTexture groundTexture = homeEnvironment.getGroundTexture();\n getGroundTextureController().setTexture(groundTexture);\n if (groundTexture != null) {\n setGroundPaint(EnvironmentPaint.TEXTURED);\n } else {\n setGroundPaint(EnvironmentPaint.COLORED);\n }\n setSkyColor(homeEnvironment.getSkyColor());\n HomeTexture skyTexture = homeEnvironment.getSkyTexture();\n getSkyTextureController().setTexture(skyTexture);\n if (skyTexture != null) {\n setSkyPaint(EnvironmentPaint.TEXTURED);\n } else {\n setSkyPaint(EnvironmentPaint.COLORED);\n }\n setLightColor(homeEnvironment.getLightColor());\n setWallsAlpha(homeEnvironment.getWallsAlpha());\n }", "@Override\n public void update(ViewerCell cell) {\n\n StyledString styledString =\n format(cell.getItem(), cell.getElement(), LinkableStyledString.ignoring(theme)).getString();\n String newText = styledString.toString();\n\n StyleRange[] oldStyleRanges = cell.getStyleRanges();\n StyleRange[] newStyleRanges = styledString.getStyleRanges();\n\n if (!Arrays.equals(oldStyleRanges, newStyleRanges)) {\n cell.setStyleRanges(newStyleRanges);\n if (cell.getText().equals(newText)) {\n cell.setText(\"\");\n }\n }\n Color bgcolor = getBackgroundColor(cell.getElement());\n if (bgcolor != null) {\n cell.setBackground(bgcolor);\n }\n cell.setImage(getImage(cell.getElement()));\n cell.setText(newText);\n }", "Properties modifyProperties(Properties properties);", "public void changeProperty(String property, String newValueExpr) {\n \t\n\t\tif(NAME_PROPERTY.equals(property)){\n\t\t\tchangeNameProperty(newValueExpr);\n\t\t}\n\t\tif(CODE_PROPERTY.equals(property)){\n\t\t\tchangeCodeProperty(newValueExpr);\n\t\t}\n\t\tif(FOOTER_TAB_PROPERTY.equals(property)){\n\t\t\tchangeFooterTabProperty(newValueExpr);\n\t\t}\n\n \n\t}", "private void restoreStyle() {\n if(this.backedup) {\n this.backedup = false;\n\n this.currentFillColor = this.lastFillColor;\n DOM.setStyleAttribute(fill.getElement(), \"backgroundColor\",currentFillColor.toCss(false));\n this.fillOpacity.setValue(this.lastFillOpacity);\n this.currentFillColor.setAlpha(this.fillOpacity.getValue());\n\n this.currentStrokeColor = this.lastStrokeColor;\n DOM.setStyleAttribute(stroke.getElement(), \"backgroundColor\",currentStrokeColor.toCss(false));\n this.strokeOpacity.setValue(this.lastStrokeOpacity);\n this.currentStrokeColor.setAlpha(this.strokeOpacity.getValue());\n\n this.currentStrokeSize.setValue(this.lastStrokeSize);\n }\n }", "private PaletteSwitch() {\n \n propertySupport = new PropertyChangeSupport( this );\n }", "public void setUIComponentValue(Object newValue) {\n if (newValue instanceof Color) {\n lastValue = (Color) newValue;\n setBackground(lastValue);\n }\n }", "@Override\n \tpublic void propertyChange(PropertyChangeEvent arg0) {\n \t\t\n \t}", "private void applyForegroundColor() {\r\n\t\tthis.control.setForeground(PromptSupport.getForeground(this.control));\r\n\t}", "private void backupStyle() {\n if(!this.backedup) {\n this.backedup = true;\n this.lastFillColor = this.currentFillColor;\n this.lastFillOpacity = this.fillOpacity.getValue();\n this.lastStrokeColor = this.currentStrokeColor;\n this.lastStrokeOpacity = this.strokeOpacity.getValue();\n this.lastStrokeSize = this.currentStrokeSize.getValue();\n }\n }", "@Override\n\tpublic void propertyChange(PropertyChangeEvent arg0) {\n\t\t\n\t}", "public void style() {\n\n\t\tfinal ArrayList<String> cssClasses = new ArrayList<>();\n\t\tif (!this.styles.isEmpty()) {\n\t\t\tthis.styles.forEach(s -> {\n\t\t\t\tcssClasses.add(s.getCss());\n\t\t\t});\n\t\t}\n\n\t\t// replace the cell styles with the new set\n\t\tthis.add(AttributeModifier.replace(\"class\", StringUtils.join(cssClasses, \" \")));\n\t}", "public void refresh()\n\t{\n\t\tif(grepStyle == null)\n\t\t{\n\t\t\ttextName.setText(\"\"); //$NON-NLS-1$\n\t\t\t\n\t\t\tcbBold.setSelection(false);\n\t\t\tcbItalic.setSelection(false);\n\t\t\t\n\t\t\tcpForeground.setColor(null);\n\t\t\tcpBackground.setColor(null);\n\t\t\tcpUnderline.setColor(null);\n\t\t\tcpUnderline.setChecked(false);\n\t\t\tcpStrikethrough.setColor(null);\n\t\t\tcpStrikethrough.setChecked(false);\n\t\t\tcpBorder.setColor(null);\n\t\t\tcpBorder.setChecked(false);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tString name = grepStyle.getName();\n\t\t\ttextName.setText(name == null ? StyleLabelProvider.LABEL_UNNAMED : name);\n\n\t\t\tcbBold.setSelection(grepStyle.isBold());\n\t\t\tcbItalic.setSelection(grepStyle.isItalic());\n\t\t\t\n\t\t\tcpForeground.setColor(grepStyle.getForeground());\n\t\t\tcpBackground.setColor(grepStyle.getBackground());\n\t\t\tcpUnderline.setColor(grepStyle.getUnderlineColor());\n\t\t\tcpUnderline.setChecked(grepStyle.isUnderline());\n\t\t\tcpStrikethrough.setColor(grepStyle.getStrikeoutColor());\n\t\t\tcpStrikethrough.setChecked(grepStyle.isStrikeout());\n\t\t\tcpBorder.setColor(grepStyle.getBorderColor());\n\t\t\tcpBorder.setChecked(grepStyle.isBorder());\n\t\t}\n\t\t\n\t\ttextName.selectAll();\n\t\tupdatePreview();\n\t}", "public void changeProperty(String property, String newValueExpr) {\n \t\n\t\tif(TITLE_PROPERTY.equals(property)){\n\t\t\tchangeTitleProperty(newValueExpr);\n\t\t}\n\t\tif(BRIEF_PROPERTY.equals(property)){\n\t\t\tchangeBriefProperty(newValueExpr);\n\t\t}\n\t\tif(ICON_PROPERTY.equals(property)){\n\t\t\tchangeIconProperty(newValueExpr);\n\t\t}\n\t\tif(DISPLAY_ORDER_PROPERTY.equals(property)){\n\t\t\tchangeDisplayOrderProperty(newValueExpr);\n\t\t}\n\t\tif(VIEW_GROUP_PROPERTY.equals(property)){\n\t\t\tchangeViewGroupProperty(newValueExpr);\n\t\t}\n\t\tif(LINK_TO_URL_PROPERTY.equals(property)){\n\t\t\tchangeLinkToUrlProperty(newValueExpr);\n\t\t}\n\n \n\t}", "protected void refreshShell() {\n shell.layout();\n }", "void setStatusColour(Color colour);", "@Override\r\n\tpublic void propertyChange(PropertyChangeEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void propertyChange(PropertyChangeEvent arg0) {\n\t\t\r\n\t}", "protected abstract void apply(Property prop, View view, Object newValue);", "@Override\n\tpublic void propertyChange(PropertyChangeEvent evt) {\n\t\t\n\t}", "public void setStyleNew(String value) {\n setAttributeInternal(STYLENEW, value);\n }", "public void edit()\n {\n openProperties(getHighlightedActors());\n }", "@Override\n public void propertyChange(final PropertyChangeEvent theEvt) {\n if (theEvt.getPropertyName().equals(PaintTool.PROPERTY_END)) {\n myUndo.setEnabled(true);\n }\n if (\"undone\".equals(theEvt.getPropertyName())) {\n myUndo.setEnabled(false);\n }\n }", "@Override\n public void setStrokeStyle(Style style) {\n Object nativeStrokeStyle = graphicsEnvironmentImpl.setStrokeStyle(canvas, style, style.getCached());\n style.cache(nativeStrokeStyle);\n }", "private void setStyleToIndicateCommandFailure() {\n //override style and disable syntax highlighting\n commandTextField.overrideStyle(ERROR_STYLE_CLASS);\n }", "public void afterPropertiesSet() {\r\n\t}", "void set(String group, String name, String style);", "@Override\n\tpublic void propertyChange(PropertyChangeEvent arg0)\n\t{\n\t\t\n\t}", "@Override\n\t\t\tpublic void update(Observable o, Object arg) {\n\t\t\t\tupdateCurrentLineFontSize(Properties.getDefaultProperties().getIntProperty(currentLineFontSizeKey));\n\t\t\t}", "private void setScreenProperty(boolean on) throws DeviceNotAvailableException {\n CLog.d(\"set svc power stay on \" + on);\n mTestDevice.executeShellCommand(\"svc power stayon \" + on);\n }", "void addPropertyCB(int property) {\n properties_[property].logNum++;\n properties_[property].logTotal++;\n }", "@Override\n public void undo()\n {\n PointsBinding.setScaling(false);\n property.setValue(orig_points);\n property.getWidget().setPropertyValue(propX, orig_x);\n property.getWidget().setPropertyValue(propY, orig_y);\n property.getWidget().setPropertyValue(propWidth, orig_width);\n property.getWidget().setPropertyValue(propHeight, orig_height);\n PointsBinding.setScaling(true);\n }", "@Override\r\n\tpublic void propertyChange(PropertyChangeEvent arg0) {\n\r\n\t}", "@objid (\"1b87bc09-5e33-11e2-b81d-002564c97630\")\n @Override\n public void propertyChange(final PropertyChangeEvent evt) {\n if (evt.getPropertyName().equals(BackgroundModel.CONTENT)) {\n // Compute the layout offsets based on the nodes size for horizontal layout.\n BackgroundEditPart.HORIZONTAL_LAYOUT_RANK_BASE = GraphNode.WIDTH * 75 / 100;\n BackgroundEditPart.HORIZONTAL_LAYOUT_OFFSET_SPACING = GraphNode.HEIGHT * 175 / 100;\n \n // Compute the layout offsets based on the nodes size for vertical layout.\n BackgroundEditPart.VERTICAL_LAYOUT_RANK_BASE = -GraphNode.HEIGHT * 125 / 100;\n BackgroundEditPart.VERTICAL_LAYOUT_OFFSET_SPACING = GraphNode.WIDTH * 125 / 100;\n \n refreshChildren();\n refreshVisuals();\n }\n \n if (evt.getPropertyName().equals(EDIT_MODE)) {\n refreshVisuals();\n }\n }", "@Override\n\tpublic void updateStatus(DeliveryCake cake) {\n\t\tSystem.out.println(\"Cake Theme Decoration done\");\n cake.setCurrentState(OrderCompleted.order());\n\t\t\n\t}", "public void enablePropertyFade()\n {\n iPropertyFade = new PropertyInt(new ParameterInt(\"Fade\"));\n addProperty(iPropertyFade);\n }", "public void afterPropertiesSet() {\n\t}", "public void afterPropertiesSet() {\n\t}", "public void afterPropertiesSet() {\n\t}", "public void afterPropertiesSet() {\n\t}", "public void afterPropertiesSet() {\n\t}", "public void afterPropertiesSet() {\n\t}", "public void afterPropertiesSet() {\n\t}", "public void afterPropertiesSet() {\n\t}", "public void setHover(String aString)\n{\n if(RMUtils.equals(aString, getHover())) return; // If value already set, just return\n Object oldValue = put(\"Hover\", RMStringUtils.min(aString)); // Cache old value\n firePropertyChange(\"Hover\", oldValue, aString, -1); // Set new value and fire PropertyChange\n}", "public void setSimulateStyle(boolean value) {\n this.simulateStyle = value;\n }", "private void setReleasedStyle() {\n this.setStyle(BUTTON_FREE);\n this.setPrefHeight(47);\n this.setLayoutY(getLayoutY() - 4);\n }", "protected void tidy(final CSSStyleDeclaration cssStyleDeclaration) {\n\t\tfor(int propertyIndex = 0; propertyIndex < cssStyleDeclaration.getLength();) { //look at each property, checking the number of properties each time because we might delete one, thereby decreasing the number of properties\n\t\t\tfinal String propertyName = cssStyleDeclaration.item(propertyIndex); //get the name of this property\n\t\t\tif(shouldRemoveProperty(cssStyleDeclaration, propertyName)) { //if we should remove this property\n\t\t\t\tgetLogger().trace(\"we should remove property\");\n\t\t\t\tcssStyleDeclaration.removeProperty(propertyName); //remove this property\n\t\t\t\tcontinue; //continue without increasing the index, since the next property is now at this index\n\t\t\t}\n\t\t\t//if we should make font sizes relative, and this is a font size\n\t\t\telse if(isMakeFontSizesRelative() && CSS_PROP_FONT_SIZE.equals(propertyName)) {\n\t\t\t\t//TODO del if not needed\t\t\t\tif(baseFontSizeCSSValue!=null) //if we know the base font size\n\t\t\t\tif(baseFontSizeValue != -1) { //if we know the base font size TODO use a constant or something more robust, maybe\n\t\t\t\t\tfinal CSSPrimitiveValue propertyCSSValue = (CSSPrimitiveValue)cssStyleDeclaration.getPropertyCSSValue(propertyName); //get the property with this name TODO we shouldn't really assume this is a primitive value\n\t\t\t\t\t///TODO del when works\t\t\t\t if(baseFontSizeCSSValue.getCssValueType()==propertyCSSValue.getCssValueType()) //if both value types are the same\n\t\t\t\t\tif(baseFontSizeCssValueType == propertyCSSValue.getCssValueType()) { //if both value types are the same\n\t\t\t\t\t\t//TODO del when works\t\t\t\t\t\tfinal float baseFontSize=baseFontSizeCSSValue.getFloatValue(baseFontSizeCSSValue.getCssValueType()); //get the base font size\n\t\t\t\t\t\tfinal float fontSizeValue = propertyCSSValue.getFloatValue(propertyCSSValue.getCssValueType()); //get the current font size\n\t\t\t\t\t\tfinal float relativeSize = Math.round(fontSizeValue / baseFontSizeValue * 100); //get the relative size convert it to a percentage by multiplying by 100, rounding the value TODO use a constant here\n\t\t\t\t\t\tpropertyCSSValue.setFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE, relativeSize); //change the value to a relative size\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t++propertyIndex; //look at the next property\n\t\t}\n\t}", "static private void change_do(BSUIWindow ui) {\n\t\tui.getPanel().removeAll();\n\t\tui.getPanel().setBackground(background);\n\t\tui.getPanel().setForeground(text);\n\t\tui.getPanel().setLayout(new SpringLayout());\n\t\tui.init();\n\t\tui.getPanel().validate();\n\t\twindow.setVisible(true);\n\t}", "protected void afterPropertiesSetInternal() {\n\t\t// override this method\n\t}", "void editProperty(String requestedProperty, Object newValue) {\n properties.editProperty(requestedProperty, newValue); // <-- The replace() method automatically checks for null\n }", "public void setStyle(String style) {\r\n this.style = style;\r\n }", "public void setStyle(String style) {\r\n this.style = style;\r\n }", "private void syncColourCodeInputBorders()\n {\n String newStyle = \"-fx-border-style: hidden hidden solid hidden; -fx-border-width: 3; -fx-border-color: \" + colourToRgb(toolColour) + \";-fx-border-radius:4px;\";\n rgbInput.setStyle(newStyle);\n hexInput.setStyle(newStyle);\n }", "@Override\r\n\tvoid setProperty(BoundedShape anObject, Point aNewValue) {\n\t\tRectangle newBounds = new Rectangle (aNewValue.x, aNewValue.y, anObject.getWidth(), anObject.getHeight());\r\n\t\tanObject.setBounds(newBounds);\r\n\t}", "@Override\n\tpublic void setProperty(String propertyName, Object value) {\n\t\t\n\t}", "public final void setLineEndingStyle(String style) {\n/* 401 */ getCOSObject().setName(COSName.LE, style);\n/* */ }", "public void setColor(String property, Color color) {\r\n Color oldValue = calendarTable.getColor(property);\r\n if (color == oldValue) {\r\n return;\r\n }\r\n calendarTable.setColor(property, color);\r\n if (property.equals(COLOR_PREFIX + \"Controls\" + BACKGROUND_SUFFIX)) {\r\n for(int i = 0, n = controlsPanel.getComponentCount(); i < n; i++) {\r\n controlsPanel.getComponent(i).setBackground(color);\r\n }\r\n } else if (property.equals(COLOR_PREFIX + \"Controls\" + FOREGROUND_SUFFIX)) {\r\n for(int i = 0, n = controlsPanel.getComponentCount(); i < n; i++) {\r\n controlsPanel.getComponent(i).setForeground(color);\r\n }\r\n }\r\n firePropertyChange(\"Color.\" + property, oldValue, color);\r\n }", "public void update()\n\t{\n\t\tJPanel panel = getPanel();\n\n\t\tif (panel instanceof StylePanel)\n\t\t\t((StylePanel) panel).updatePanel();\n\t}", "private void updateProperties(){\n loadProperties();\n GameModel gameModel = GameModel.getInstance();\n int level = gameModel.getCurrentLevelIndex();\n //int health = gameModel.getPlayer().getLives();\n //int ammo = gameModel.getPlayer().getAmmunition();\n int highestReachedLevel = getHighestLevelFromProperties();\n\n //checks if player has reached a higher level than before\n if (level>=highestReachedLevel){\n properties.setProperty(\"highestReachedLevel\", Integer.toString(level));\n gameModel.setHighestCompletedLevel(level); //gives model the new highest completed level\n } else {\n properties.setProperty(\"highestReachedLevel\", Integer.toString(highestReachedLevel));\n gameModel.setHighestCompletedLevel(highestReachedLevel);\n }\n\n System.out.println(\"Saved Highest reached levl: \"+properties.getProperty(\"highestReachedLevel\"));\n\n properties.setProperty(\"level\", Integer.toString(level));\n //properties.setProperty(\"health\", Integer.toString(health));\n //properties.setProperty(\"ammo\", Integer.toString(ammo));\n }" ]
[ "0.70598215", "0.59726506", "0.5950546", "0.573019", "0.5716871", "0.5696283", "0.5622972", "0.56104016", "0.5580664", "0.5577236", "0.5568987", "0.5505337", "0.54989696", "0.5494299", "0.54874754", "0.5486673", "0.54630136", "0.54492396", "0.54269856", "0.54091924", "0.5405756", "0.539931", "0.5397054", "0.5373043", "0.5370663", "0.5361819", "0.53485966", "0.5337571", "0.53058594", "0.5305334", "0.5277289", "0.52712387", "0.52711236", "0.52691746", "0.523417", "0.5229951", "0.5228934", "0.5227517", "0.52273524", "0.5190666", "0.5187766", "0.5185961", "0.518119", "0.51589304", "0.51512307", "0.51504755", "0.5114409", "0.5098614", "0.509353", "0.5089488", "0.50735027", "0.50716525", "0.5070693", "0.5066699", "0.50638014", "0.50386274", "0.50350785", "0.50350785", "0.5029332", "0.5026072", "0.5018817", "0.5016959", "0.50114995", "0.5006592", "0.4994946", "0.49911204", "0.4983282", "0.49825516", "0.49795544", "0.49768132", "0.49703565", "0.4970286", "0.49702543", "0.49653503", "0.49640018", "0.49635836", "0.49597687", "0.49597687", "0.49597687", "0.49597687", "0.49597687", "0.49597687", "0.49597687", "0.49597687", "0.4952781", "0.49409863", "0.4939484", "0.4932664", "0.49314228", "0.49299604", "0.49271205", "0.49265662", "0.49265662", "0.49227053", "0.49220055", "0.49067897", "0.48968786", "0.48941574", "0.4887611", "0.48875028" ]
0.55795443
9
If the shell gets focus, the text input field must get the focus.
@Override public void setFocus() { this.textInput.setFocus(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void requestInputFocus(){\n\t\tuserInput.requestFocus();\n\t}", "@Override\n public void requestFocus() {\n\tif (term != null) {\n\t //term.requestActive(); // Not implemented yet\n\t // TEMPORARY\n\t // boolean result = term.requestFocusInWindow();\n\t term.requestFocus();\n\t}\n }", "public void setFocus();", "public void requestFocus()\n {\n super.requestFocus();\n field.requestFocus();\n }", "public void focus() {}", "@Override\r\n\tpublic void setFocus() {\r\n\t}", "public void requestFocus(){\n\t\tusername.requestFocusInWindow();\n\t}", "@Override\n\tpublic void setFocus() {\n\t\t\n\t}", "@Override\n\tpublic void setFocus() {\n\t\t\n\t}", "@Override\n\tpublic void setFocus() {\n\t\t\n\t}", "@Override\n\tpublic void setFocus() {\n\t\t\n\t}", "@Override\n\tpublic void setFocus() {\n\t\t\n\t}", "@Override\n public void setFocus() {\n }", "public void setFocus() {\n\t}", "public void setFocus() {\n }", "@Override\n\tpublic void setFocus() {\n\t}", "@Override\r\n\tpublic void setFocus() {\n\t\t\r\n\t}", "@Override\n\tpublic void setFocus() {\n\n\t}", "@Override\n\tpublic void setFocus() {\n\n\t}", "@Override\n\tpublic void setFocus() {\n\n\t}", "@Override\n\tpublic void setFocus() {\n\n\t}", "void setFocus();", "@Override\r\n\tpublic void setFocus() {\n\r\n\t}", "@Override\r\n\tpublic void setFocus() {\n\r\n\t}", "@Override\r\n\tpublic void setFocus() {\n\r\n\t}", "@Override\r\n\tpublic void setFocus() {\n\r\n\t}", "@Override\r\n\tpublic void setFocus() {\n\r\n\t}", "@Override\r\n\tpublic void setFocus() {\n\r\n\t}", "@Override\r\n\tpublic void setFocus() {\n\r\n\t}", "protected void doSetFocus() {\n\t\t// Ignore\n\t}", "public void setFocus() {\n \t\tex.setFocus();\n \t}", "public void Focus() {\n }", "boolean hasFocus() {\n\t\t\tif (text == null || text.isDisposed()) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn text.getShell().isFocusControl() || text.isFocusControl();\n\t\t}", "public void requestFocusTextFieldUsername(){\n \t\tthis.textFieldUsername.requestFocus();\n }", "protected void doSetFocus() {\n \t\tif (getText() != null) {\n \t\t\tgetText().selectAll();\n \t\t\tgetText().setFocus();\n \t\t\tcheckSelection();\n \t\t\tcheckDeleteable();\n \t\t\tcheckSelectable();\n \t\t}\n \t}", "void focus();", "void focus();", "@Override\r\n\tpublic void setFocus() {\r\n\t\tif (getControl() != null)\r\n\t\t\tgetControl().setFocus();\r\n\t}", "public void requestFocus() {\n // Not supported for MenuComponents\n }", "@Override\r\n\tpublic boolean isFocused() {\n\t\treturn false;\r\n\t}", "protected void onFocusGained()\n {\n ; // do nothing. \n }", "public void tryLockFocus() {\n }", "public void requestFocus() {\n\n if (MyTextArea != null)\n MyTextArea.requestFocus();\n\n }", "public void focus() {\n\t\tJWLC.nativeHandler().wlc_output_focus(this.to());\n\t}", "@Override\r\n\t\t\tpublic void ancestorAdded(AncestorEvent event) {\n\t\t\t\tSwingUtilities.invokeLater(new Runnable() {\r\n\t\t @Override\r\n\t\t public void run() {\r\n\t\t \ttextField_transaction_input.requestFocusInWindow();\r\n\t\t }\r\n\t\t\t\t});\r\n\t\t\t}", "void addFocus();", "@Override\n public void focusGained(FocusEvent arg0) {\n if(jtxt_username.getText().contains(\"Type in your username...\")){\n jtxt_username.setText(\"\");\n }\n }", "@Override\n\tprotected void handleFocus (Context context, boolean focus) {\n\t\tif (focus) context.requestFocus();\n\t}", "public void setFocus() {\n\t\tui.setFocus();\n\t}", "@Override\n public boolean isFocusable() {\n return false;\n }", "boolean isTestAlwaysFocus();", "@Override\r\n public boolean shouldYieldFocus(JComponent input) {\r\n this.field = (JFormattedTextField) input;\r\n if (verify(input)) {\r\n field.setValue(value);\r\n //this.btn.setEnabled(true);\r\n return true;\r\n } else { \r\n return false;\r\n }\r\n }", "public boolean isFocusable() {\r\n\t\treturn true;\r\n\t}", "public abstract void requestFocusToTernaryPhone();", "public void setFocus(){\n\t\ttxtText.setFocus(true);\n\t\ttxtText.selectAll();\n\t}", "public abstract void requestFocusToPrimaryPhone();", "public void setFocus() {\n \t\tviewer.getControl().setFocus();\n \t}", "@Override\r\n\t\t\tpublic void ancestorAdded(AncestorEvent event) {\n\t\t\t\tSwingUtilities.invokeLater(new Runnable() {\r\n\t\t @Override\r\n\t\t public void run() {\r\n\t\t textField_productID_input.requestFocusInWindow();\r\n\t\t }\r\n\t\t });\r\n\t\t\t}", "private void jtxtwarehouse_codeFocusGained(java.awt.event.FocusEvent evt) {\n jtxtwarehouse_code.setSelectionStart(0);\n jtxtwarehouse_code.setSelectionEnd(jtxtwarehouse_code.getText().length());\n}", "private void jtxtbrand_code_toFocusGained(java.awt.event.FocusEvent evt) {\n jtxtbrand_code_to.setSelectionStart(0);\n jtxtbrand_code_to.setSelectionEnd(jtxtbrand_code_to.getText().length());\n}", "@Override\r\n\t\t\t\t\t\t\tpublic void ancestorAdded(AncestorEvent event) {\n\t\t\t\t\t\t\tSwingUtilities.invokeLater(new Runnable() {\r\n\t\t\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t\t\t\ttextField_search_input.requestFocusInWindow();\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}", "public boolean hasFocus() {\n return hasFocus;\n }", "public void mo3285a() {\n if (StringUtils.m10803a(this.f7348a.getText().toString())) {\n this.f7348a.requestFocus();\n } else if (StringUtils.m10803a(this.f7349b.getText().toString())) {\n this.f7349b.requestFocus();\n }\n this.f7348a.requestFocus();\n }", "private void jtxtbrand_code_frFocusGained(java.awt.event.FocusEvent evt) {\n jtxtbrand_code_fr.setSelectionStart(0);\n jtxtbrand_code_fr.setSelectionEnd(jtxtbrand_code_fr.getText().length());\n}", "public boolean isFocused() {\n/* 807 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "void requestFocus() {\n if (this.fieldRate != null) {\n this.fieldRate.requestFocus();\n }\n }", "@Override\r\n\tpublic void focus() {\r\n\t\tactivate();\r\n\t\ttoFront();\r\n\t}", "@Override\n public void focusGained(FocusEvent arg0) {\n if(jTextField_Create_Savings_Acc_pass.getPassword().equals(\"xxx\")){\n jTextField_Create_Savings_Acc_pass.setText(\"\");\n }\n }", "public void setFocus() {\n\t\tviewer.getControl().setFocus();\n\t}", "public void setFocus() {\n\t\tviewer.getControl().setFocus();\n\t}", "public void setFocus() {\n\t\tviewer.getControl().setFocus();\n\t}", "@Override\n public void focusGained(FocusEvent arg0) {\n if(jtxt_createCurrentAccPIN.getText().contains(\"xxx\")){\n jtxt_createCurrentAccPIN.setText(\"\");\n }\n }", "public void setFocus() {\n\t\tthis.viewer.getControl().setFocus();\n\t}", "@Override\n public void focus(FieldEvents.FocusEvent event) {\n TextField tf = (TextField) event.getSource();\n tf.setCursorPosition(tf.getValue().length());\n }", "public void setFocus() {\n\t\tcompositeQueryTree.setFocus();\n\t}", "@Override\n public void focusGained(FocusEvent arg0) {\n if(jpassword.getPassword().equals(\"password\")){\n jpassword.setText(\"\");\n }\n }", "public void setFocus() {\n \t\t// set initial focus to the URL text combo\n \t\turlCombo.setFocus();\n \t}", "public void focus() {\n getRoot().requestFocus();\n }", "@Override\n\tpublic void enter(ViewChangeEvent event) {\n\t\tuserTextField.focus();\n\t}", "@Override\n\tpublic void focusGained(FocusEvent arg0) {\n\t\t\n\t}", "@Override\n\tpublic void focusGained(FocusEvent arg0) {\n\t\t\n\t}", "@JSProperty\n boolean isAutofocus();", "private void jtxttotal_adm_qtyFocusGained(java.awt.event.FocusEvent evt) {\n jtxttotal_adm_qty.setSelectionStart(0);\n jtxttotal_adm_qty.setSelectionEnd(jtxttotal_adm_qty.getText().length());\n}", "@Override\n public void focusGained(FocusEvent arg0) {\n if(jTextField_Create_Savings_Acc_accnum.getText().contains(\"xxx\")){\n jTextField_Create_Savings_Acc_accnum.setText(\"\");\n }\n }", "@Override\n\t\tpublic void focusGained(FocusEvent arg0) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void focusGained(FocusEvent arg0) {\n\t\t\t\n\t\t}", "@Override\n public void focusGained(FocusEvent arg0) {\n if(jtxt_userName.getText().contains(\"xxx\")){\n jtxt_userName.setText(\"\");\n }\n }", "public abstract void requestFocusToSecondaryPhone();", "@Override\n\t\tpublic void focusGained(FocusEvent arg0) {\n\t\t\tSystem.out.println(\"Btn F gaing\");\t\n\t\t}", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent arg0) {\r\n\t\t\t\tif (arg0.getKeyCode()==arg0.VK_ENTER) {\r\n\t\t\t\t\ttxtFornecedor.requestFocus();\r\n\t\t\t\t}\r\n\t\t\t}", "B disableTextInput();", "@Override\n public void focusGained(FocusEvent arg0) {\n if(jtxt_accno.getText().contains(\"xxx\")){\n jtxt_accno.setText(\"\");\n }\n }", "ChatTarget getFocus();", "@Override\n public void onWindowFocusChanged(boolean hasFocus) {\n }", "@Override\n public void focusGained(FocusEvent arg0) {\n if(jpw_createCurrentAccPw.getPassword().equals(\"xxx\")){\n jpw_createCurrentAccPw.setText(\"\");\n }\n }", "@Override\n\t\t\t\t\t\tpublic void focusGained(FocusEvent arg0) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void focusGained(FocusEvent arg0) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void focusGained(FocusEvent arg0) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void focusGained(FocusEvent arg0) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void focusGained(FocusEvent arg0) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}" ]
[ "0.75173026", "0.7337038", "0.7087799", "0.7067733", "0.7044274", "0.7043026", "0.7035105", "0.7031514", "0.7031514", "0.7031514", "0.7031514", "0.7031514", "0.6997945", "0.69844866", "0.6977467", "0.6977037", "0.69591844", "0.6935366", "0.6935366", "0.6935366", "0.6935366", "0.6934361", "0.68908656", "0.68908656", "0.68908656", "0.68908656", "0.68908656", "0.68908656", "0.68908656", "0.6840309", "0.67446995", "0.6724077", "0.67073184", "0.67072767", "0.6703612", "0.669796", "0.669796", "0.66766816", "0.6669107", "0.66521204", "0.66206414", "0.65563977", "0.6553151", "0.65240175", "0.64821863", "0.6466446", "0.6462656", "0.64396316", "0.64394826", "0.64037436", "0.64012474", "0.63379514", "0.63204694", "0.6315458", "0.63099295", "0.63062525", "0.6286749", "0.6263023", "0.6249739", "0.6247095", "0.6228342", "0.61947167", "0.6191901", "0.6185129", "0.6184814", "0.615545", "0.6155431", "0.6153559", "0.6153164", "0.6153164", "0.6153164", "0.61379075", "0.6132238", "0.6131883", "0.6116719", "0.61027914", "0.61020935", "0.6096355", "0.6080322", "0.60733116", "0.60733116", "0.60702366", "0.6065927", "0.60383564", "0.6037283", "0.6037283", "0.60363966", "0.60221547", "0.6018429", "0.6006953", "0.599535", "0.598555", "0.5982184", "0.5976964", "0.59748757", "0.59723717", "0.59723717", "0.59723717", "0.59723717", "0.59723717" ]
0.7543827
0
Shows previous entry of the history in the input text field.
private void prevHistoryEntry() { if (this.historyPos > 0) { this.historyPos--; this.textInput.setText(this.history.get(this.historyPos)); this.textInput.setSelection(this.history.get(this.historyPos).length()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void nextHistoryEntry()\n {\n // get next history entry (into input text field)\n if (this.historyPos < this.history.size()) {\n this.historyPos++;\n this.textInput.setText(this.history.get(this.historyPos));\n this.textInput.setSelection(this.history.get(this.historyPos).length());\n // if last index => input text must be cleaned\n } else if (this.historyPos == this.history.size()) {\n this.textInput.setText(\"\"); //$NON-NLS-1$\n this.textInput.setSelection(0);\n }\n }", "public void prev()\n {\n if (mHistoryIdx == 0) {\n return;\n }\n\n mCommandList.get(--mHistoryIdx).undo();\n this.setChanged();\n this.notifyObservers(mHistoryIdx);\n }", "@Override\r\n\tpublic String prev() {\n\t\tString pre;\r\n\r\n\t\tpre = p.getPrev();\r\n\r\n\t\tif (pre != null) {\r\n\t\t\tthisPrevious = true;\r\n\t\t\tinput(pre);\r\n\t\t}\r\n\t\treturn pre;\r\n\t}", "public void previous() {\n if (hasPrevious()) {\n setPosition(position - 1);\n }\n }", "public static void previous() {\n\t\tsendMessage(PREVIOUS_COMMAND);\n\t}", "public void previous();", "public void displayPreviousRecord(){\r\n\r\n // dec in recordNumber to display previous person info, already stored in personsList during search \r\n\trecordNumber--;\r\n\r\n\tif(recordNumber < 0 )\r\n\t{\r\n JOptionPane.showMessageDialog(null, \"You have reached at begining of search results\"); \r\n\r\n\t\t/*if user has reached the begining of results, disable back button*/\r\n\t\tbForward.setEnabled(true);\r\n\t\tbBack.setEnabled(false);\r\n\r\n // inc by one to counter last dec\r\n recordNumber++;\r\n\t}\r\n\telse\r\n\t{\r\n\t\tbForward.setEnabled(true);\r\n\t\tPersonInfo person = (PersonInfo) personsList.get(recordNumber);\r\n\r\n // displaying search record in text fields \r\n\t\ttfName.setText(person.getName());\r\n\t\ttfAddress.setText(person.getAddress());\r\n\t\ttfPhone.setText(\"\"+person.getPhone());\r\n\t\ttfEmail.setText(person.getEmail());\r\n\t}\r\n\r\n }", "private void previous() {\n Timeline currentTimeline = simpleExoPlayerView.getPlayer().getCurrentTimeline();\n if (currentTimeline.isEmpty()) {\n return;\n }\n int currentWindowIndex = simpleExoPlayerView.getPlayer().getCurrentWindowIndex();\n\n Timeline.Window currentWindow = currentTimeline.getWindow(currentWindowIndex, new Timeline.Window());\n if (currentWindowIndex > 0 && (player.getCurrentPosition() <= MAX_POSITION_FOR_SEEK_TO_PREVIOUS\n || (currentWindow.isDynamic && !currentWindow.isSeekable))) {\n player.seekTo(currentWindowIndex - 1, C.TIME_UNSET);\n } else {\n player.seekTo(0);\n }\n }", "public String getPrevCommandString() {\n if (this.history.size() == 0) {\n return \"\";\n }\n\n if (this.currIndex <= 0) {\n return this.history.get(0);\n }\n\n this.currIndex -= 1;\n return this.history.get(this.currIndex);\n }", "public void back () {\r\n if (backHistory.size() > 1) {\r\n forwardHistory.addFirst(current);\r\n current = backHistory.getLast();\r\n backHistory.removeLast();\r\n }\r\n }", "private void previousButtonMouseClicked(java.awt.event.MouseEvent evt) {\n if(previousButton.isEnabled() == false || checkUpdateInventoryError() == true) return;\n recordChanged();\n current --;\n displayCurrentStock();\n }", "public void previous()\n {\n if (size != 0)\n {\n current = current.previous();\n }\n\n }", "public void inputPrev() {\n --this.currentIndex;\n this.currentUnit = getUnit(this.currentIndex);\n this.currentChName = this.currentUnit.chName;\n }", "private void displayPrevious() {\n SharedPreferences filterSetting = getSharedPreferences(\"filterSetting\",0);\n myMostRecentWeekCheckbox.setChecked(filterSetting.getBoolean(\"myMostRecent\",false));\n myDisplayAllCheckbox.setChecked(filterSetting.getBoolean(\"myDisplayAll\",false));\n foMostRecentWeekCheckbox.setChecked(filterSetting.getBoolean(\"foMostRecent\",false));\n foDisplayAllCheckbox.setChecked(filterSetting.getBoolean(\"foDisplayAll\",false));\n myReasonEditText.setText(filterSetting.getString(\"myReason\",null));\n foReasonEditText.setText(filterSetting.getString(\"foReason\",null));\n int mySpinner = filterSetting.getInt(\"mySpinner\",0);\n if (mySpinner != 0){\n myEmotionalStateSpinner.setSelection(mySpinner);\n }\n int foSpinner = filterSetting.getInt(\"foSpinner\",0);\n if (foSpinner != 0){\n foEmotionalStateSpinner.setSelection(foSpinner);\n }\n }", "public void previous() {\n if (highlight.getMatchCount() > 0) {\n Point point = highlight.getPreviousMatch(cursor.getY(), cursor.getX());\n if (point != null) {\n cursor.moveTo(point);\n }\n return;\n }\n Point point = file.getPreviousModifiedPoint(cursor.getY(), cursor.getX());\n if (point != null) {\n cursor.moveTo(point);\n }\n }", "private void previousQuestion() {\n if (mCurrentIndex > 0) {\n mCurrentIndex = (mCurrentIndex - 1) % questions.length;\n }\n else\n mCurrentIndex = questions.length - 1;\n int question = questions[mCurrentIndex].getTextResId();\n mText.setText(question);\n }", "public ExtremeEntry previous() {\n\n\t\tsetLastReturned(getLastReturned().getPrevious());\n//\t\tnextIndex--;\n\t\tcheckForComodification();\n\t\treturn getLastReturned();\n\t}", "String getPrevious();", "public final void undo() {\n\t\tthis.historyManager.undo();\n\t}", "public void setPrev(String prev){\n\t\tthis.prev = prev;\n\t}", "public void prev();", "private void displayPrevious() {\r\n\t\ti--;\r\n\t\tdisplayCurrentPicture();\r\n\t}", "public void back() {\n //noinspection ResultOfMethodCallIgnored\n previous();\n }", "public JHistoryTextField()\n {\n this(true);\n }", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tupdateHistoryButtonText(\"\"); \n\t}", "public void previousRecord( View v){\n// \tClear out the display first\n \tclearBtn( v );\n \tLog.i(\"in prev record\", \"this sheep ID is \" + String.valueOf(thissheep_id));\n \tcursor.moveToPrevious();\n \tLog.i(\"in prev record\", \"after moving the cursor \");\n \tthissheep_id = cursor.getInt(0);\n \tLog.i(\"in prev record\", \"this sheep ID is \" + String.valueOf(thissheep_id));\n \trecNo -= 1;\n \tfindTagsShowAlert(v, thissheep_id);\n\t\t// I've moved back so enable the next record button\n\t\tButton btn2 = (Button) findViewById( R.id.next_rec_btn );\n\t\tbtn2.setEnabled(true); \t\t\n \tif (recNo == 1) {\n \t\t// at beginning so disable prev record button\n \t\tButton btn3 = (Button) findViewById( R.id.prev_rec_btn );\n \tbtn3.setEnabled(false); \t\t\n \t}\n }", "public void setPreviousValue(final String previousValue);", "protected void showPreviousPage() {\n\t\tshowPage(currPageIndex - 1, Direction.BACKWARD);\n\n\t}", "void previous() throws NoSuchRecordException;", "public String getBack() {\n index--;\n return (String) history.get(index);\n }", "private void backButton() {\n navigate.goPrev(this.getClass(), stage);\n }", "@FXML\n private void handlePreviousCommandTextPrevious() {\n commandBox.selectPreviousCommandTextPrevious();\n }", "public void switchToHistory() {\r\n\t\thistoryPane.addEditTabs(editTabs);\r\n\t\tlayout.show(this, \"historyPane\");\r\n\t\trevalidate();\r\n\t\trepaint();\r\n\t}", "private void prevPage()\n {\n if(currentPage - 1 >= 1)\n {\n nextPageButton.setEnabled(true);\n if(currentPage -2 < 1)\n prevPageButton.setEnabled(false);\n \n paginate(--currentPage, getResultsPerPage());\n updatePageLabel(currentPage, maxPage);\n }\n }", "public static Result prev() {\r\n\t\tMap<String, String> requestData = Form.form().bindFromRequest().data();\r\n\t\tString idCurrentNode = requestData.get(RequestParams.CURRENT_NODE);\r\n\t\tString formName = ChangeOrderForm.NAME;\r\n\t\tString username = CMSSession.getEmployeeName();\r\n\r\n\t\tDecision previousDecision = CMSGuidedFormFill.getPreviousDecision(\r\n\t\t\t\tformName, username, idCurrentNode);\r\n\r\n\t\treturn ok(backdrop.render(previousDecision));\r\n\t}", "public void switchPreviousTabulator() {\r\n\t\tCTabItem[] tabItems = this.displayTab.getItems();\r\n\t\tfor (int i = 0; i < tabItems.length; i++) {\r\n\t\t\tCTabItem tabItem = tabItems[i];\r\n\t\t\tif (tabItem.getControl().isVisible()) {\r\n\t\t\t\tif (i - 1 >= 0)\r\n\t\t\t\t\ttabItem.getParent().setSelection(i - 1);\r\n\t\t\t\telse\r\n\t\t\t\t\ttabItem.getParent().setSelection(tabItems.length - 1);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void previousButtonActionPerformed(ActionEvent e) {\n // TODO add your code here\n if(this.page == 0){\n Warning.run(\"No previous page here.\");\n }\n else{\n this.page--;\n this.update();\n }\n }", "@UiHandler(\"history\")\n public void showHistory (ClickEvent event){\n \tshowHistory();\n }", "public void showHistory(){\n \tif (historyExample==null) historyExample = new HistoryExample();\n setWidgetAsExample(historyExample);\n }", "@Override\n public final char previous() {\n if (--index >= lower) {\n return text.charAt(index);\n }\n index = lower;\n return DONE;\n }", "@Override\n public void onBackPressed() {\n showUnsavedChangesDialog();\n }", "public void MovePrevious()\r\n {\r\n\r\n \t try{\r\n \t\t if(!rsTution.previous())rsTution.first();\r\n \t\t Display();\r\n\r\n\r\n \t }catch(SQLException sqle)\r\n \t {System.out.println(\"MovePrevious Error:\"+sqle);}\r\n }", "public String returnToPreviousPage() {\n if (datasetVersion.isDraft()) {\n return \"/dataset.xhtml?persistentId=\" +\n datasetVersion.getDataset().getGlobalId().asString() + \"&version=DRAFT&faces-redirect=true\";\n }\n return \"/dataset.xhtml?persistentId=\"\n + datasetVersion.getDataset().getGlobalId().asString()\n + \"&faces-redirect=true&version=\"\n + datasetVersion.getVersionNumber() + \".\" + datasetVersion.getMinorVersionNumber();\n }", "public void Prev();", "@Override\r\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\tfinal WebHistory history=engine.getHistory();\r\n\t\t ObservableList<WebHistory.Entry> entryList=history.getEntries();\r\n\t\t int currentIndex=history.getCurrentIndex();\r\n//\t\t Out(\"currentIndex = \"+currentIndex);\r\n//\t\t Out(entryList.toString().replace(\"],\",\"]\\n\"));\r\n\t\t\t if(history.getCurrentIndex()<entryList.size()-1){\r\n\t\t\t \r\n\t\t Platform.runLater(new Runnable() { public void run() { history.go(1); } });\r\n\t\t System.out.println(entryList.get(currentIndex<entryList.size()-1?currentIndex+1:currentIndex).getUrl());\r\n\t\t\t}\r\n\t\t}", "@Override\n public void onHistoryItemClicked(String history_item) {\n editText.setText(history_item);\n editText.setCursorVisible(false);\n editTextMode = false;\n\n previousSearchTerm = editText.getText().toString();\n\n InputMethodManager inputManager = (InputMethodManager) getSystemService\n (Context.INPUT_METHOD_SERVICE);\n inputManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(),\n InputMethodManager.HIDE_NOT_ALWAYS);\n searchHistoryView.setVisibility(View.INVISIBLE);\n mCursor = utils.queryCombinedArticleLists(editText.getText().toString());\n\n LinearLayoutManager linearLayoutManager = new LinearLayoutManager(SearchActivity.this);\n SearchArticlesAdapter adapter = new SearchArticlesAdapter(SearchActivity.this, SEARCH_ACTIVITY);\n adapter.setCursor(mCursor);\n mRecyclerView.setAdapter(adapter);\n mRecyclerView.setLayoutManager(linearLayoutManager);\n }", "public void showHistorySwitchAction() {\n\t\tanimalsListPanel.switchToPast();\n\t}", "public String getForward() {\n index++;\n return (String) history.get(index);\n }", "public void buttonBack(View v) {\n if (expression.equals(\"\"))\n return;\n\n /* Remove the last character put in the expression. */\n expression = expression.substring(0, expression.length()-1);\n TextView expressionText = (TextView) findViewById(R.id.expressionText);\n expressionText.setText(expression);\n }", "private void storeUserInputHistory(String input) {\n if (userInputHistoryPointer != userInputHistory.size() - 1\n || (userInputHistoryPointer == userInputHistory.size() - 1\n && !input.equals(userInputHistory.get(userInputHistoryPointer)))) {\n userInputHistory.add(input);\n }\n userInputHistoryPointer = userInputHistory.size();\n currentInput = null;\n }", "public String getHistory () {\r\n\t\treturn history;\r\n\t}", "public String getHistory () {\r\n\t\treturn history;\r\n\t}", "public void previousBtnClicked(View v){\n\t\tresetSelection();\r\n\t\tnextQuestion(-1);\r\n\t\tshowQuesAndAnswers();\r\n\t}", "public void goBack() {\n setEditor(currentEditor.getParentEditor());\n }", "private Token previous() {\n return tokens.get(current-1);\n }", "public Index previous() {\n return Index.valueOf(value - 1);\n }", "private void moveToPreviousCard() {\r\n\t\t// This is simple enough: Move the card set to the previous\r\n\t\t// card and update the label and database. If we're now on\r\n\t\t// the first card, disable the Previous button and make sure\r\n\t\t// the Next button is always enabled. Then rebuild the card\r\n\t\t// itself so the correct passcodes are displayed.\r\n \tif (cardSet.getLastCard() != Cardset.FIRST_CARD) {\r\n\t\t\tcardSet.previousCard();\r\n\t btnNext.setEnabled(true);\r\n\t\t\tif (cardSet.getLastCard() == Cardset.FIRST_CARD)\r\n\t\t\t\tbtnPrevious.setEnabled(false);\r\n\t\t\t// Save the card set to the database:\r\n\t\t\tDBHelper.saveCardset(cardSet);\r\n\t\t\trebuildCard();\r\n\t lblCardNumber.setText(getResources().getString(R.string.cardview_card_num_prompt).replace(getResources().getString(R.string.meta_replace_token), String.valueOf(cardSet.getLastCard())));\r\n \t}\r\n }", "void onHistoryButtonClicked();", "public void pgr_D_Prev(ActionEvent e) throws Exception\n\t{\n\t\t//#CM5134\n\t\t// Store listbox to the Session\n\t\tSessionDeadStockListRet listbox =\n\t\t\t(SessionDeadStockListRet) this.getSession().getAttribute(\"LISTBOX\");\n\t\tsetList(listbox, \"previous\");\n\t}", "@Override\n\tpublic Menu previousMenu() {\n\t\treturn prevMenu;\n\t}", "public void setPrevHashValue(String prevHashValue) {\n this.prevHashValue = prevHashValue;\n }", "public String getHistory () {\n\t\treturn history;\n\t}", "public boolean hasPrevious()\n {\n // TODO: implement this method\n return false;\n }", "public void undo() {\n if (!history.isEmpty()) {\n Command c = history.get(0);\n c.undo();\n history.remove(0);\n future.add(0, c);\n }\n }", "@Nullable\n WizardPage flipToPrevious();", "@ActionTrigger(action=\"KEY-PRVREC\", function=KeyFunction.PREVIOUS_RECORD)\n\t\tpublic void spriden_PreviousRecord()\n\t\t{\n\t\t\t\n\t\t\t\tpreviousRecord();\n\t\t\t\t// \n\t\t\t\t\n\t\t\t\ttry { \n\t\t\t\t\tMessageServices.setMessageLevel(OracleMessagesLevel.decodeMessageLevel(5));\n\t\t\t\t// \n\t\t\t\tnextBlock();\n\t\t\t\tnextBlock();\n\t\t\t\texecuteQuery();\n\t\t\t\tnextBlock();\n\t\t\t\texecuteQuery();\n\t\t\t\tnextBlock();\n\t\t\t\texecuteQuery();\n\t\t\t\tpreviousBlock();\n\t\t\t\tpreviousBlock();\n\t\t\t\tpreviousBlock();\n\t\t\t\tpreviousBlock();\n\t\t\t\t// \n\t\t\t\t\n\t\t\t\t} finally {\n\t\t\t\t\t\t\t\n\t\t\t\t\tMessageServices.setMessageLevel(OracleMessagesLevel.decodeMessageLevel(0));\n\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t}", "protected JButton getPrevious()\n {\n return previous;\n }", "Object previous();", "@Nonnull\n public Optional<ENTITY> previous()\n {\n currentItem = Optional.of(items.get(--index));\n update();\n return currentItem;\n }", "public int previousIndex() {\r\n \treturn index - 1; \r\n }", "public void setPrevious(ListElement previous)\n\t {\n\t this.previous = previous;\n\t }", "@Override\r\n public int previousIndex() {\r\n if (previous == null) {\r\n return -1;\r\n }\r\n return previousIndex;\r\n }", "private void previous() {\n if (position > 0) {\n Player.getInstance().stop();\n\n // Set a new position:w\n --position;\n\n ibSkipNextTrack.setImageDrawable(getResources()\n .getDrawable(R.drawable.ic_skip_next_track_on));\n\n try {\n Player.getInstance().play(tracks.get(position));\n } catch (IOException playerException) {\n playerException.printStackTrace();\n }\n\n setImageDrawable(ibPlayOrPauseTrack, R.drawable.ic_pause_track);\n setCover(Player.getInstance().getCover(tracks.get(position), this));\n\n tvTrack.setText(tracks.get(position).getName());\n tvTrackEndTime.setText(playerUtils.toMinutes(Player.getInstance().getTrackEndTime()));\n }\n\n if (position == 0) {\n setImageDrawable(ibSkipPreviousTrack, R.drawable.ic_skip_previous_track_off);\n }\n }", "@Override\n\t\tpublic int previousIndex() {\n\t\t\treturn 0;\n\t\t}", "public void setPrev(Level previous) {\n\t\tthis.prev = previous;\n\t}", "private void previousBtnActionPerformed(java.awt.event.ActionEvent evt) {\n}", "public ListElement getPrevious()\n\t {\n\t return this.previous;\n\t }", "private Tab getPrevTab() {\n int pos = mTabControl.getCurrentPosition() - 1;\n if (pos < 0) {\n pos = mTabControl.getTabCount() - 1;\n }\n return mTabControl.getTab(pos);\n }", "public static void showPreviousOptions() {\r\n\t\tGameOptions.bagValue.select(Main.bagValue);\r\n\t\tGameOptions.nilValueTextField.setText(Main.nilValue);\r\n\t\tGameOptions.doubleNilValueTextField.setText(Main.doubleNilValue);\r\n\t\tGameOptions.winScoreTextField.setText(Main.winScore);\r\n\t\tGameOptions.loseScoreTextField.setText(Main.loseScore);\r\n\t}", "public void prev() {\r\n\t\tif (curr == head)\r\n\t\t\treturn; // No previous element\r\n\t\tLink<E> temp = head;\r\n\t\t// March down list until we find the previous element\r\n\t\twhile (temp.next() != curr)\r\n\t\t\ttemp = temp.next();\r\n\t\tcurr = temp;\r\n\t}", "@Override\n protected void onRestoreInstanceState(Bundle savedInstanceState) {\n super.onRestoreInstanceState(savedInstanceState);\n\n history.setText(savedInstanceState.getString(\"HISTORY\"));\n }", "@Override\r\n\t\tpublic E previous() {\n\t\t\tcaret = caret.prev();\r\n\t\t\tif (caret == null)\r\n\t\t\t\tthrow new NoSuchElementException();\r\n\t\t\tnextIndex--;\r\n\t\t\treturn caret.n.data[caret.idx];\r\n\t\t}", "public int previousIndex()\n {\n // TODO: implement this method\n return -1;\n }", "public StringBuilder getHistory() {\r\n\t\treturn history;\r\n\t}", "private String undo() {\n if (!undos.isEmpty()) {\n History history = undos.pop();\n this.redos.push(History.copy(this));\n pasteHistory(history);\n }\n\n //return sb.toString();\n return printList();\n }", "void previousPage() throws IndexOutOfBoundsException;", "public void outputPrev() {\n --this.currentIndex;\n this.currentChName = this.operOutHeaders.get(this.currentIndex);\n }", "@NotNull\n @JsonProperty(\"previousValue\")\n public String getPreviousValue();", "private void previous()\r\n {\r\n if(currentCard != 0) // if we are not at the first card\r\n {\r\n currentCard--; // make the previous card the current card\r\n \r\n // move through the cards: show the current card, hide the others\r\n for(int i = 0; i <= stack.getChildren().size()- 1; i++)\r\n {\r\n if(i == currentCard)\r\n {\r\n stack.getChildren().get(i).setVisible(true);\r\n }\r\n else\r\n {\r\n stack.getChildren().get(i).setVisible(false);\r\n }\r\n }\r\n }\r\n }", "void movePrev()\n\t{\n\t\tif (cursor != null) \n\t\t{\n\t\t\tif (cursor == front) \n\t\t\t{\n\t\t\t\tcursor = null;\n index = -1; //added this because i kept failing the test cases on the grading script\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcursor = cursor.prev; //moves cursor toward front of the list\n index--; //added this because i kept failing the test cases on the grading script\n\t\t\t}\n\t\t}\n\t}", "public void prevSlide() {\n\t\tif (currentSlideNumber > 0) {\n\t\t\tsetSlideNumber(currentSlideNumber - 1);\n\t }\n\t}", "public void back() {\n\t\tstate.back();\n\t}", "public void previousPage() {\n\t\tthis.skipEntries -= NUM_PER_PAGE;\n\t\tif (this.skipEntries < 1) {\n\t\t\tskipEntries = 1;\n\t\t}\n\t\tloadEntries();\n\t}", "@Override\r\n\tpublic void onBackPressed()\r\n\t{\r\n\t\tif (flipper.getDisplayedChild() != 0)\r\n\t\t{\r\n\t\t\tflipper.showPrevious();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tsuper.onBackPressed();\r\n\t\t}\r\n\t}", "@Override\r\n\t\tpublic boolean hasPrevious() {\n\t\t\treturn false;\r\n\t\t}", "public Node getPrevious() {\n return previous;\n }", "public String getPrevDate() \n\t{\n\t\tm_calendar.set (Calendar.DAY_OF_MONTH, getDayOfMonth() -1);\n\t\treturn getTodayDate();\n\t}", "public node getPrevious() {\n\t\t\treturn previous;\n\t\t}", "public synchronized void back ()\n\t// one move up\n\t{\n\t\tState = 1;\n\t\tgetinformation();\n\t\tgoback();\n\t\tshowinformation();\n\t\tcopy();\n\t}", "@AutoGUIAnnotation(\r\n DescriptionForUser = \"<html>Displays the result of the previous Script command<br>if it is of ype float.</html>\",\r\n ParameterNames = {},\r\n DefaultValues = {},\r\n ToolTips = {})\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"DisplayPreviousResult\">\r\n public void DisplayPreviousResult() \r\n throws ScriptException {\r\n\r\n // build the string\r\n String str = \"The result of the previous Script command was: \";\r\n\r\n // check if the type was float\r\n if (m_LastReturnValue instanceof Number) {\r\n str += m_LastReturnValue.toString() + \"\\n\";\r\n } else {\r\n str = \"The data type of the return value of the previous script command\\n\"\r\n + \"is not of type Number as expected.\\n\";\r\n throw new ScriptException(str);\r\n }\r\n\r\n\r\n // display the previous result as Status Text\r\n m_GUI.DisplayStatusMessage(str, false);\r\n }" ]
[ "0.754141", "0.7192169", "0.6794337", "0.676742", "0.66804016", "0.6621354", "0.6574873", "0.64633805", "0.6387667", "0.63075924", "0.622516", "0.6224195", "0.62118167", "0.62090486", "0.6207611", "0.62067884", "0.6168503", "0.6163724", "0.6132133", "0.6082677", "0.6075228", "0.603292", "0.60174876", "0.60009235", "0.59900236", "0.597294", "0.59522194", "0.59432495", "0.5913331", "0.5913183", "0.58999354", "0.58355445", "0.58337075", "0.58221465", "0.58209753", "0.5820658", "0.5814468", "0.5807042", "0.58059335", "0.57989836", "0.57965386", "0.5783071", "0.57730895", "0.57632", "0.57486176", "0.57328224", "0.5720696", "0.5713798", "0.5703336", "0.5686853", "0.5661619", "0.5661619", "0.56571585", "0.56552213", "0.564954", "0.56481665", "0.56457055", "0.5632615", "0.56305414", "0.5605946", "0.5604787", "0.55941546", "0.5590385", "0.5551529", "0.5549802", "0.55479044", "0.55450857", "0.55286574", "0.55231", "0.55211353", "0.55167913", "0.55137056", "0.55048776", "0.55015427", "0.54840726", "0.5474928", "0.547247", "0.54659474", "0.5465737", "0.54644495", "0.546424", "0.54539734", "0.5452292", "0.54462874", "0.54432625", "0.54417443", "0.5441083", "0.5433729", "0.5427129", "0.5426024", "0.5417849", "0.5414958", "0.5414257", "0.5412024", "0.54113495", "0.5404902", "0.53992844", "0.5390714", "0.5390331", "0.53893685" ]
0.8687755
0
Shows next entry of the history in the input text field.
private void nextHistoryEntry() { // get next history entry (into input text field) if (this.historyPos < this.history.size()) { this.historyPos++; this.textInput.setText(this.history.get(this.historyPos)); this.textInput.setSelection(this.history.get(this.historyPos).length()); // if last index => input text must be cleaned } else if (this.historyPos == this.history.size()) { this.textInput.setText(""); //$NON-NLS-1$ this.textInput.setSelection(0); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void prevHistoryEntry()\n {\n if (this.historyPos > 0) {\n this.historyPos--;\n this.textInput.setText(this.history.get(this.historyPos));\n this.textInput.setSelection(this.history.get(this.historyPos).length());\n }\n }", "@Override\r\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\tfinal WebHistory history=engine.getHistory();\r\n\t\t ObservableList<WebHistory.Entry> entryList=history.getEntries();\r\n\t\t int currentIndex=history.getCurrentIndex();\r\n//\t\t Out(\"currentIndex = \"+currentIndex);\r\n//\t\t Out(entryList.toString().replace(\"],\",\"]\\n\"));\r\n\t\t\t if(history.getCurrentIndex()<entryList.size()-1){\r\n\t\t\t \r\n\t\t Platform.runLater(new Runnable() { public void run() { history.go(1); } });\r\n\t\t System.out.println(entryList.get(currentIndex<entryList.size()-1?currentIndex+1:currentIndex).getUrl());\r\n\t\t\t}\r\n\t\t}", "public void next()\n {\n if (mHistoryIdx == mCommandList.size()) {\n return;\n }\n\n mCommandList.get(mHistoryIdx++).redo();\n this.setChanged();\n this.notifyObservers(mHistoryIdx);\n }", "public void showNext()\n {\n String nexts = beanitems.get(position+1).getAddtime();\n\n String time = nexts.substring(0,10);\n\n switcher.setText(time);\n\n\n }", "public void displayNextRecord(){\r\n\r\n // inc in recordNumber to display next person info, already stored in personsList during search \r\n\trecordNumber++;\r\n\r\n\tif(recordNumber >= personsList.size())\r\n\t{\r\n JOptionPane.showMessageDialog(null, \"You have reached at end of search results\"); \r\n\r\n\t\t/*if user has reached the end of results, disable froward button*/\r\n\t\tbForward.setEnabled(false);\r\n\t\tbBack.setEnabled(true);\r\n\r\n // dec by one to counter last inc\r\n recordNumber -- ; \r\n\t}\r\n\telse\r\n\t{\r\n\t\tbBack.setEnabled(true);\r\n\t\tPersonInfo person = (PersonInfo) personsList.get(recordNumber);\r\n\r\n // displaying search record in text fields \r\n\t\ttfName.setText(person.getName());\r\n\t\ttfAddress.setText(person.getAddress());\r\n\t\ttfPhone.setText(\"\"+person.getPhone());\r\n\t\ttfEmail.setText(person.getEmail());\r\n\t}\r\n}", "public void displayPreviousRecord(){\r\n\r\n // dec in recordNumber to display previous person info, already stored in personsList during search \r\n\trecordNumber--;\r\n\r\n\tif(recordNumber < 0 )\r\n\t{\r\n JOptionPane.showMessageDialog(null, \"You have reached at begining of search results\"); \r\n\r\n\t\t/*if user has reached the begining of results, disable back button*/\r\n\t\tbForward.setEnabled(true);\r\n\t\tbBack.setEnabled(false);\r\n\r\n // inc by one to counter last dec\r\n recordNumber++;\r\n\t}\r\n\telse\r\n\t{\r\n\t\tbForward.setEnabled(true);\r\n\t\tPersonInfo person = (PersonInfo) personsList.get(recordNumber);\r\n\r\n // displaying search record in text fields \r\n\t\ttfName.setText(person.getName());\r\n\t\ttfAddress.setText(person.getAddress());\r\n\t\ttfPhone.setText(\"\"+person.getPhone());\r\n\t\ttfEmail.setText(person.getEmail());\r\n\t}\r\n\r\n }", "public String getNextCommandString() {\n if (this.history.size() == 0) {\n return \"\";\n }\n\n if ((this.currIndex + 1) >= this.history.size()) {\n this.currIndex = this.history.size();\n return \"\";\n }\n\n this.currIndex += 1;\n return this.history.get(this.currIndex);\n }", "public void actionPerformed(ActionEvent ae){\n sbCommandHistory.append(\"\\n\");\r\n sbCommandHistory.append(\">>\");\r\n sbCommandHistory.append(jtfConsole.getText());\r\n sbCommandHistory.append(\"\\n\");\r\n\r\n //Execute the command\r\n parseCommand(jtfConsole.getText());\r\n\r\n //Reset the text field\r\n jtfConsole.setText(\"\");\r\n }", "@FXML\n private void handlePreviousCommandTextNext() {\n commandBox.selectPreviousCommandTextNext();\n }", "@Override\n public void onHistoryItemClicked(String history_item) {\n editText.setText(history_item);\n editText.setCursorVisible(false);\n editTextMode = false;\n\n previousSearchTerm = editText.getText().toString();\n\n InputMethodManager inputManager = (InputMethodManager) getSystemService\n (Context.INPUT_METHOD_SERVICE);\n inputManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(),\n InputMethodManager.HIDE_NOT_ALWAYS);\n searchHistoryView.setVisibility(View.INVISIBLE);\n mCursor = utils.queryCombinedArticleLists(editText.getText().toString());\n\n LinearLayoutManager linearLayoutManager = new LinearLayoutManager(SearchActivity.this);\n SearchArticlesAdapter adapter = new SearchArticlesAdapter(SearchActivity.this, SEARCH_ACTIVITY);\n adapter.setCursor(mCursor);\n mRecyclerView.setAdapter(adapter);\n mRecyclerView.setLayoutManager(linearLayoutManager);\n }", "public void showHistorySwitchAction() {\n\t\tanimalsListPanel.switchToPast();\n\t}", "public void prev()\n {\n if (mHistoryIdx == 0) {\n return;\n }\n\n mCommandList.get(--mHistoryIdx).undo();\n this.setChanged();\n this.notifyObservers(mHistoryIdx);\n }", "public String getForward() {\n index++;\n return (String) history.get(index);\n }", "public JHistoryTextField()\n {\n this(true);\n }", "@UiHandler(\"history\")\n public void showHistory (ClickEvent event){\n \tshowHistory();\n }", "public void showHistory(){\n \tif (historyExample==null) historyExample = new HistoryExample();\n setWidgetAsExample(historyExample);\n }", "public void handleEvent(Event event) {\n if ((currentTextReports != null)\n && (currentTextReports.size() > currentTextIndex + 1)) {\n String dispStr = removeCR((String) currentTextReports\n .get(currentTextIndex + 1)[0]);\n\t\t\t\t\tString curText = text.getText();\n\t\t\t\t\tint endIndex = curText.indexOf(\"----\");\n if (endIndex != -1) {\n curText = curText.substring(0, endIndex + 4);\n text.setText(curText + \"\\n\" + dispStr);\n } else\n\t\t\t\t\t\ttext.setText(dispStr);\n\t\t\t\t\t\n\t\t\t\t\tnextBtn.setEnabled(true);\n\t\t\t\t\tcurrentTextIndex++;\n if (currentTextReports.size() <= currentTextIndex + 1) {\n prevBtn.setEnabled(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "public void showNextNumber(){\r\n int maximumNumberToDisplay = 1000;\r\n this.numberToDisplay++;\r\n resetIfNecessary(maximumNumberToDisplay);\r\n }", "void run() {\n System.out.println(\"Enter a date (MM/DD/YY): \");\n Scanner scan = new Scanner(System.in);\n String date = scan.next();\n ArrayList<Order> orders = Screen.state.getOrdersByOrderDate(date);\n int index = 0;\n if (orders.size() != 0) {\n while (true) {\n System.out.print(orders.get(index).toString());\n System.out.println(\"Press n for Next, p for Previous\");\n scan = new Scanner(System.in);\n String key = scan.next();\n if (key.equalsIgnoreCase(\"n\")) {\n if (index == orders.size() - 1) {\n index = 0;\n } \n else {\n index++;\n }\n } \n else if (key.equalsIgnoreCase(\"p\")) {\n if (index == 0) {\n index = orders.size() - 1;\n } \n else {\n index--;\n }\n } \n else {\n break;\n }\n }\n } \n else {\n System.out.println(\"No such order\");\n System.out.println(\"Press any key to continue\");\n scan = new Scanner(System.in);\n scan.next();\n }\n this.prev.run();\n }", "public void switchToHistory() {\r\n\t\thistoryPane.addEditTabs(editTabs);\r\n\t\tlayout.show(this, \"historyPane\");\r\n\t\trevalidate();\r\n\t\trepaint();\r\n\t}", "protected void enter() {\n \tresult.setForeground(red);\n \tif (entered == true) {\n \t\tshow(current);\n \t}\n \tentered = true;\n \tstack.add(current);\n \tcurrent = 0;\n }", "public void clickNextButton() {\n if (editSummaryFragment.isActive()) {\n //we're showing the custom edit summary window, so close it and\n //apply the provided summary.\n editSummaryFragment.hide();\n editPreviewFragment.setCustomSummary(editSummaryFragment.getSummary());\n } else if (editPreviewFragment.isActive()) {\n //we're showing the Preview window, which means that the next step is to save it!\n if (abusefilterEditResult != null) {\n //if the user was already shown an AbuseFilter warning, and they're ignoring it:\n funnel.logAbuseFilterWarningIgnore(abusefilterEditResult.getCode());\n }\n getEditTokenThenSave(false);\n funnel.logSaveAttempt();\n } else {\n //we must be showing the editing window, so show the Preview.\n hideSoftKeyboard(this);\n editPreviewFragment.showPreview(title, sectionText.getText().toString());\n funnel.logPreview();\n }\n }", "public void inputPrev() {\n --this.currentIndex;\n this.currentUnit = getUnit(this.currentIndex);\n this.currentChName = this.currentUnit.chName;\n }", "private void next() {\n Timeline currentTimeline = simpleExoPlayerView.getPlayer().getCurrentTimeline();\n if (currentTimeline.isEmpty()) {\n return;\n }\n int currentWindowIndex = simpleExoPlayerView.getPlayer().getCurrentWindowIndex();\n if (currentWindowIndex < currentTimeline.getWindowCount() - 1) {\n player.seekTo(currentWindowIndex + 1, C.TIME_UNSET);\n } else if (currentTimeline.getWindow(currentWindowIndex, new Timeline.Window(), false).isDynamic) {\n player.seekTo(currentWindowIndex, C.TIME_UNSET);\n }\n }", "public void actionPerformed(ActionEvent e)\n\t\t{\n\t\t\tnextButton.setText(\"NEXT >> \");\n\t\t\tint index = tabbedPane.getSelectedIndex();\n\t\t\tif (index != 0)\n\t\t\t{\n\t\t\t\ttabbedPane.setSelectedIndex(index - 1);\n\t\t\t}\n\t\t\tif (index - 1 == 0)\n\t\t\t{\n\t\t\t\tbackButton.setEnabled(false);\n\t\t\t}\n\t\t}", "public void printHistory(int n) {\n EquationList p_eqn = eqn;\n while (n > 0) {\n System.out.println(p_eqn.equation + \" + \" + Integer.toString(p_eqn.result));\n p_eqn = p_eqn.next;\n n = n -1;\n }\n }", "@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tupdateHistoryButtonText(\"\"); \n\t}", "@Override\n public void onNextPressed() {\n }", "public void handleEvent(Event event) {\n if ((currentTextReports != null)\n && (currentTextReports.size() > currentTextIndex)\n && (currentTextIndex >= 1)) {\n String dispStr = removeCR((String) currentTextReports\n .get(currentTextIndex - 1)[0]);\n\t\t\t\t\tString curText = text.getText();\n\t\t\t\t\tint endIndex = curText.indexOf(\"----\");\n if (endIndex != -1) {\n curText = curText.substring(0, endIndex + 4);\n text.setText(curText + \"\\n\" + dispStr);\n } else\n\t\t\t\t\t\ttext.setText(dispStr);\n\t\t\t\t\tprevBtn.setEnabled(true);\n\t\t\t\t\tcurrentTextIndex--;\n if (currentTextIndex == 0) {\n\t\t\t\t\t\tnextBtn.setEnabled(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}", "private void attachInputListeners() {\n inputTextField.textProperty().addListener((observable, oldValue, newValue) -> {\n if (userInputHistoryPointer == userInputHistory.size()) {\n currentInput = newValue;\n }\n });\n\n inputTextField.addEventHandler(KeyEvent.KEY_PRESSED, keyEvent -> {\n switch (keyEvent.getCode()) {\n case ENTER:\n keyEvent.consume();\n handleUserInput();\n break;\n case UP:\n keyEvent.consume();\n if (userInputHistoryPointer >= 1) {\n userInputHistoryPointer -= 1;\n setText(userInputHistory.get(userInputHistoryPointer));\n }\n break;\n case DOWN:\n keyEvent.consume();\n if (userInputHistoryPointer < userInputHistory.size() - 1) {\n userInputHistoryPointer += 1;\n setText(userInputHistory.get(userInputHistoryPointer));\n } else if (userInputHistoryPointer == userInputHistory.size() - 1) {\n userInputHistoryPointer += 1;\n setText(currentInput);\n }\n break;\n default:\n break;\n }\n });\n }", "private void appendText()\n\t{\n\t\tString fieldText = \"\";\n\t\tString newText = \"\";\n\t\tfieldText = entry.getText();\n\t\t\n\t\tif(fieldText.equals (\"0\"))\n\t\t{\n\t\t\tnewText += append;\n\t\t\tfieldText = newText;\n\t\t\tentry.setText (fieldText);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfieldText += append;\n\t\t\tentry.setText (fieldText);\n\t\t}\n\t\t\n\t\tentry.grabFocus ( );\n\t\t\n\t}", "public void showNextQuestion() {\n currentQuiz++;\n gui.setUp();\n if (currentQuiz <= VocabularyQuizList.MAX_NUMBER_QUIZ) {\n showQuestion(currentQuiz);\n } else {\n result();\n }\n gui.getFrame().setVisible(true);\n }", "private void displayNextQuestion() {\n\n if (quizIterator.hasNext()){\n question = quizIterator.next();\n qTextView.setText(question.getQuestion());\n setBtnUsability(true);\n }\n else\n {\n setBtnUsability(false);\n qTextView.setText(\"Great job! You're a stack star!\");\n }\n\n }", "public void openHistory() {\n usingHistoryScreen = true;\n myActivity.setContentView(R.layout.history);\n Button historyButtonToGame = myActivity.findViewById(R.id.button8);\n TextView historyText = myActivity.findViewById(R.id.textView46);\n historyText.setText(state.getHistory());\n historyText.setMovementMethod(new ScrollingMovementMethod());\n gui.invalidate();\n historyButtonToGame.setOnClickListener(\n new View.OnClickListener() {\n public void onClick(View v) {\n ShogiHumanPlayer.this.setAsGui(myActivity);\n usingHistoryScreen = false;\n if (state != null) {\n receiveInfo(state);\n }\n }\n });\n }", "private void changeCurrentValue()\n {\n String theText = textBox.toString();\n\n // find the first newline\n int index = theText.indexOf(\"\\n\");\n assert index != -1;\n\n // insert new stuff\n StringBuilder newText = new StringBuilder();\n newText.append(currentTag);\n newText.append(\": \");\n newText.append(currentValue);\n newText.append(\"\\n\");\n\n textBox.replaceTextRange(0, index, newText.toString());\n }", "public void printAllHistory() {\n EquationList p_eqn = eqn;\n while (p_eqn != null) {\n System.out.println(p_eqn.equation + \" + \" + Integer.toString(p_eqn.result));\n p_eqn = p_eqn.next;\n }\n }", "private void goToInputtedRow() {\n if (mGoToEditText.getText() != null && !mGoToEditText.getText().toString().isEmpty()) {\n int listPosition = Integer.parseInt(mGoToEditText.getText().toString()) - 1;\n\n if (listPosition <= mAdapter.getCount()) {\n mAdapter.setSelectedListItem(listPosition);\n mAdapter.notifyDataSetChanged();\n mPiListView.setSelection(listPosition);\n } else {\n Toast toast = Toast.makeText(getApplicationContext(), String.format(getString(R.string.only_d_rows_available_message), mAdapter.getCount()), Toast.LENGTH_SHORT);\n toast.show();\n }\n }\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tString input = e.getActionCommand();\n\t\t\t\tif(start) {\n\t\t\t\t\tdisplay.setText(\"\");\n\t\t\t\t\tstart = false;\n\t\t\t\t}\n\t\t\t\tdisplay.setText(display.getText() + input);\n\t\t\t}", "public void inputNext() {\n ++this.currentIndex;\n this.currentUnit = getUnit(this.currentIndex);\n this.currentChName = this.currentUnit.chName;\n }", "public void nextButtonClicked()\r\n {\n manager = sond.getManager();\r\n String insertSearchDelete = sond.getInsertSearchDelete();\r\n AnimatorThread animThread = model.getThread();\r\n\r\n // falls der Thread pausiert ist, wird er beim betätigen des\r\n // next-Buttons aufgeweckt\r\n if (button.getPlay() && animThread != null && animThread.isAlive())\r\n {\r\n if (!animThread.getWait())\r\n {\r\n animThread.interrupt();\r\n }\r\n else\r\n {\r\n animThread.wake();\r\n }\r\n }\r\n // Redo muss vor den weiteren if Anweisungen stehen, damit erst alle\r\n // Redo ausgeführt werden, bevor neue Aktionen dem manager hinzugefuegt\r\n // werden\r\n else if (manager.canRedo())\r\n {\r\n manager.redo();\r\n }\r\n else if (!sond.getArrayPosition() && insertSearchDelete.equals(\"insert\"))\r\n {\r\n sond.nextInsertPosition();\r\n UndoRedoSetAnimation command = new UndoRedoSetAnimation(sond);\r\n manager.addEdit(command);\r\n }\r\n else if (!sond.getArrayPosition() && insertSearchDelete.equals(\"search\"))\r\n {\r\n sond.nextSearchPosition();\r\n UndoRedoSetAnimation command = new UndoRedoSetAnimation(sond);\r\n manager.addEdit(command);\r\n }\r\n else if (!sond.getArrayPosition() && insertSearchDelete.equals(\"delete\"))\r\n {\r\n sond.nextSearchPosition();\r\n UndoRedoSetAnimation command = new UndoRedoSetAnimation(sond);\r\n manager.addEdit(command);\r\n }\r\n }", "public void switchNextTabulator() {\r\n\t\tCTabItem[] tabItems = this.displayTab.getItems();\r\n\t\tfor (int i = 0; i < tabItems.length; i++) {\r\n\t\t\tCTabItem tabItem = tabItems[i];\r\n\t\t\tif (tabItem.getControl().isVisible()) {\r\n\t\t\t\tif (i + 1 <= tabItems.length - 1)\r\n\t\t\t\t\ttabItem.getParent().setSelection(i + 1);\r\n\t\t\t\telse\r\n\t\t\t\t\ttabItem.getParent().setSelection(0);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void displayNext() {\r\n\t\ti++;\r\n\t\tdisplayCurrentPicture();\r\n\t}", "private void nextFocusedField(KeyEvent ke) {\r\n Gui.sumFieldFocused(); //Aumenta el contador\r\n //Si el foco esta en algun nodo del formulario \r\n if(Gui.getFieldFocused() < Gui.getFieldsSize()){\r\n //Se Enfoca el nuevo nodo correspondiente\r\n Gui.getFields()[Gui.getFieldFocused()].requestFocus(); \r\n }else{ //Sino\r\n// botonGuardar(); //Guardar los datos\r\n } \r\n }", "public void nextInput(View v1) {\n\t\t//Toast.makeText(this, \"Next\", Toast.LENGTH_SHORT).show();\n\t\t\n\t\t// Take the info from the input fields and make a claim; add it to the claimList\n\t\tEditText userInput1 = (EditText) findViewById(R.id.addNewClaimEditText1);\n\t\tEditText userInput2 = (EditText) findViewById(R.id.addNewClaimEditText);\n\t\tClaimListController clc = new ClaimListController();\n\t\tClaim c = new Claim(userInput1.getText().toString(), userInput2.getText().toString(), null, null);\n\t\tclc.addClaim(c);\n\t\t\n\t\tIntent intent = new Intent(AddNewClaimActivity.this, AddNewClaimNextActivity.class);\n\t\t// http://stackoverflow.com/questions/2091465/how-do-i-pass-data-between-activities-in-android [Feb. 1, 2015]\n\t\tintent.putExtra(\"claimName\", userInput1.getText().toString());\n\t\tintent.putExtra(\"claimDes\", userInput2.getText().toString());\n\t\t\n\t\tstartActivity(intent);\n\t}", "private void showResult(final String textToShow) {\n // Run on UI thread as we'll updating our app UI\n runOnUiThread(\n () -> {\n // Append the result to the UI.\n resultTextView.append(textToShow);\n\n // Clear the input text.\n inputEditText.getText().clear();\n\n // Scroll to the bottom to show latest entry's classification result.\n scrollView.post(() -> scrollView.fullScroll(View.FOCUS_DOWN));\n });\n }", "@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tinput(input.getText().toString());\n\t\t\t\tshow.setText(output.toString());\n\t\t\t}", "public void showNextMovePrompt() {\n\n if(model.isXTurn()){\n resultLabel.setText(\"X's Turn\");\n }\n else{\n resultLabel.setText(\"O's Turn\");\n }\n }", "void onHistoryButtonClicked();", "public void setNextFocus(LnwWidget widget) {\n\t\tnextFocus = widget;\n\t}", "private void nextQuestion() {\n mCurrentIndex = (mCurrentIndex + 1) % questions.length;\n int question = questions[mCurrentIndex].getTextResId();\n mText.setText(question);\n }", "@Override\r\n\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\tgoNext();\r\n\t\t\t\t}", "private void historyButtonListener() {\n JButton historyButton = gui.getHistory_Button();\n\n ActionListener actionListener = (ActionEvent actionEvent) -> {\n gui.getHistory_TextArea().setText(\"\");\n gui.getFrame_History().setVisible(true);\n gui.getFrame_History().setSize(415, 250);\n gui.getHistory_TextArea().setEditable(false);\n for (int key : requestsAnswered.keySet()) {\n gui.getHistory_TextArea().append(requestsAnswered.get(key).getFormattedRequest());\n }\n for (int key : processingRequests.keySet()) {\n gui.getHistory_TextArea().append(processingRequests.get(key).getFormattedRequest());\n }\n };\n historyButton.addActionListener(actionListener);\n }", "private void storeUserInputHistory(String input) {\n if (userInputHistoryPointer != userInputHistory.size() - 1\n || (userInputHistoryPointer == userInputHistory.size() - 1\n && !input.equals(userInputHistory.get(userInputHistoryPointer)))) {\n userInputHistory.add(input);\n }\n userInputHistoryPointer = userInputHistory.size();\n currentInput = null;\n }", "private void nextButtonActionPerformed(ActionEvent e) {\n // TODO add your code here\n int remainItem = this.list.size() - 6 * (this.page + 1);\n\n if(remainItem <= 0){\n Warning.run(\"No more page here.\");\n }\n else{\n this.page++;\n this.update();\n }\n }", "public void advance() {\n\t\tif(isFinalFrame(current)) {\n\t\t\tthrow new IllegalStateException(\"Invalid Entry\"); // input sanitization if last frame (cant advance further )\n\t\t\t\n\t\t}\n\t\tif (!current.movesFinished()) { // input sanitization -- cant advance if the user hasnt exercised all the frames moves\n\t\t\tthrow new IllegalStateException(\"Invalid Entry\");\n\t\t}\n\t\telse current = frames.get(frames.indexOf(current) + 1); // else updates the current frame to frame at next index. \n\t}", "private String redo() {\n this.undos.push(History.copy(this));\n if (!redos.isEmpty()) {\n History history = redos.pop();\n this.undos.push(History.copy(this));\n pasteHistory(history);\n }\n\n //return sb.toString();\n return printList();\n }", "public void ClickNext() {\r\n\t\tnext.click();\r\n\t\t\tLog(\"Clicked the \\\"Next\\\" button on the Birthdays page\");\r\n\t}", "public void advance() {\r\n this.command = in.nextLine();\r\n }", "public void addText(String text) {\n this.historyTextLog.append(text);\n }", "public void addNext()\r\n\t{\r\n\t\tnext = new JButton(\"Next\");\r\n\t\tnext.addActionListener(new ActionListener()\r\n\t\t{\r\n\t\t\t@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e)\r\n\t\t\t{\r\n\t\t\t\tif (state.getTurn() == 1)\r\n\t\t\t\t{\r\n\t\t\t\t\tstate.setPlayerTwoTurn();\r\n\t\t\t\t}\r\n\t\t\t\telse if (state.getTurn() == 2)\r\n\t\t\t\t{\r\n\t\t\t\t\tstate.setPlayerOneTurn();\r\n\t\t\t\t}\r\n\t\t\t\tremoveNext();\r\n\t\t\t\t\r\n\t\t\t\tstate.setWaiting(false);\r\n\t\t\t}\r\n\t\t});\r\n\t\tadd(next);\r\n\t\t\r\n\t\trevalidate();\r\n\t\trepaint();\r\n\t}", "@Override\n public void showCurrentNumber(String number) {\n Platform.runLater(() -> currentNumberTextView.setText(number));\n\n }", "@FXML\n private void handlePreviousCommandTextPrevious() {\n commandBox.selectPreviousCommandTextPrevious();\n }", "public static void next() {\n\t\tsendMessage(NEXT_COMMAND);\n\t}", "private void displayPrevious() {\r\n\t\ti--;\r\n\t\tdisplayCurrentPicture();\r\n\t}", "public static void previous() {\n\t\tsendMessage(PREVIOUS_COMMAND);\n\t}", "private void previousQuestion() {\n if (mCurrentIndex > 0) {\n mCurrentIndex = (mCurrentIndex - 1) % questions.length;\n }\n else\n mCurrentIndex = questions.length - 1;\n int question = questions[mCurrentIndex].getTextResId();\n mText.setText(question);\n }", "private void showNextButton(){\n\t\tif(nextButton != null){\n\t\t\thideSubmitBtn();\n\t\t\tmainWindow.addLayer(nextButton, BUTTON_LAYER, submitBtnX, submitBtnY);\n\t\t}\n\t}", "public String getPrevCommandString() {\n if (this.history.size() == 0) {\n return \"\";\n }\n\n if (this.currIndex <= 0) {\n return this.history.get(0);\n }\n\n this.currIndex -= 1;\n return this.history.get(this.currIndex);\n }", "public void previous();", "@Override\n protected List<CharSequence> getNextInput() {\n if (!mInputIterator.hasNext())\n // No more input, so we're done.\n return null;\n else {\n // Start a new cycle.\n incrementCycle();\n\n // Return a list containing character sequences to search.\n return mInputIterator.next();\n }\n }", "private void userViewStep() {\n textUser.requestFocus();\n textUser.postDelayed(\n new Runnable() {\n public void run() {\n InputMethodManager inputMethodManager = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);\n inputMethodManager.showSoftInput(textUser, 0);\n }\n }, 200);\n EventBus.getDefault().postSticky(new EventOnboardingChanges(EventOnboardingChanges.ChangeType.REGISTER_CHANGE_TITLE, getResources().getString(R.string.tact_username_title)));\n }", "private void pressUpFromCLI() {\n\t\tupLastPressed = true;\n\t\tif (commandIterator.hasNext()) {\n\t\t\ttextInput.setText(commandIterator.next());\n\t\t}\n\t\tif (downLastPressed) {\n\t\t\ttextInput.setText(commandIterator.next());\n\t\t\tdownLastPressed = false;\n\t\t}\n\t}", "public void nextQuestion() {\n if (currentq<questionbank.size()-1)\n {\n currentq++;\n }\n else\n {\n currentq=0;\n finished=true;\n\n Intent i = new Intent(MainActivity.this, ScorecardActivity.class);\n //Intent(coming from, where to go)\n i.putExtra(EXTRAMESSAGE1, Integer.toString(score));\n startActivity(i);\n\n }\n question.setText(questionbank.get(currentq).getQuestionText());\n\n\n }", "public void back () {\r\n if (backHistory.size() > 1) {\r\n forwardHistory.addFirst(current);\r\n current = backHistory.getLast();\r\n backHistory.removeLast();\r\n }\r\n }", "public void nextRecord( View v)\n {\n \t//\tClear out the display first\n \tclearBtn( v );\n \t//\tGo get the sheep id of this record\n \tLog.i(\"in next record\", \"this sheep ID is \" + String.valueOf(thissheep_id));\n \tcursor.moveToNext();\n \tLog.i(\"in next record\", \"after moving the cursor \");\n \tthissheep_id = cursor.getInt(0);\n \tthissheep_name = cursor.getString(1);\n \tLog.i(\"in next record\", \"this sheep ID is \" + String.valueOf(thissheep_id));\n \tLog.i(\"in next record\", \"this sheep name is \" + thissheep_name);\n \trecNo += 1;\n \tfindTagsShowAlert(v, thissheep_id);\n//\t\t// I've moved forward so I need to enable the previous record button\n\t\tButton btn3 = (Button) findViewById( R.id.prev_rec_btn );\n\t\tbtn3.setEnabled(true);\t \t\n \tif (recNo == (nRecs)) {\n \t\t// at end so disable next record button\n \t\tButton btn2 = (Button) findViewById( R.id.next_rec_btn );\n \tbtn2.setEnabled(false); \t\t\n \t}\n }", "public String previewNextToken() {\r\n matcher.find();\r\n String nextOne = matcher.group();\r\n updateMatcher(); // Return matcher to its previous state\r\n return nextOne;\r\n }", "private void addHistory(String s) {\r\n\t\tcurrentPlayer.getHistory().add(s);\r\n\t\tif (currentPlayer.getHistory().size() > 6) currentPlayer.getHistory().remove(0);\r\n\t\t//updatePlayArea(currentPlayer, false);\r\n\t}", "void addFocus();", "public void showNext(View v){\n\n //create our database for the tasks\n TasksDBHelper tasksDBHelper = new TasksDBHelper(getApplicationContext());\n //Set DB repository in write mode\n SQLiteDatabase db = tasksDBHelper.getWritableDatabase();\n\n\n\n //capture the text that is entered for tasks 1 to 3.\n EditText task1 = (EditText)findViewById(R.id.task1);\n EditText task2 = (EditText)findViewById(R.id.task2);\n EditText task3 = (EditText)findViewById(R.id.task3);\n\n //Convert the tasks to a string to write to the DB\n //need to convert editText to a string\n String myTask1 = task1.getText().toString();\n String myTask2 = task2.getText().toString();\n String myTask3 = task3.getText().toString();\n\n\n\n\n\n //Adding the tasks to the DB to be set and read later\n ContentValues tasks = new ContentValues();\n tasks.put(TasksDBHelper.FIELD_REWARD, myTask1);\n tasks.put(TasksDBHelper.FIELD_REWARD_1, myTask2);\n tasks.put(TasksDBHelper.FIELD_REWARD_2, myTask3);\n db.insert(TasksDBHelper.TABLE_NAME, null, tasks);\n\n //use intent to move us to next screen\n // Take us to enter the time\n Intent mainIntent = new Intent(this, MainActivity.class);\n startActivity(mainIntent);\n\n }", "@FXML\n public void onEnter() {\n String userInput = inputField.getText();\n String response = duke.getResponse(userInput);\n lastCommandLabel.setText(response);\n ExpenseList expenseList = duke.expenseList;\n updateExpenseListView();\n inputField.clear();\n updateTotalSpentLabel();\n }", "protected void stopEnterText()\n\t{ if (text.getText().length() > 0) text.setText(text.getText().substring(0, text.getText().length() - 1)); }", "protected void handleNext(ActionEvent event) {\n\t}", "public int getInputPositionIncrement () { return 1; }", "public void goToNext()\n {\n if (current != null)\n {\n previous = current;\n current = current.nLink;\n } // end if\n else if (head != null)\n {\n System.out.println(\"Iteration reached end of line.\");\n System.exit(0);\n } // else if\n else\n {\n System.out.println(\"You can't iterate an empty list.\");\n System.exit(0);\n }\n }", "public void MoveNext()\r\n \t{\r\n\r\n\t try{\r\n\t\t if(!rsTution.next())rsTution.last();\r\n\t\t Display();\r\n\r\n\r\n\t }catch(SQLException sqle)\r\n\t {System.out.println(\"Move Next Error:\"+sqle);}\r\n \t}", "@Override\n public void focus(FieldEvents.FocusEvent event) {\n TextField tf = (TextField) event.getSource();\n tf.setCursorPosition(tf.getValue().length());\n }", "public void switchPreviousTabulator() {\r\n\t\tCTabItem[] tabItems = this.displayTab.getItems();\r\n\t\tfor (int i = 0; i < tabItems.length; i++) {\r\n\t\t\tCTabItem tabItem = tabItems[i];\r\n\t\t\tif (tabItem.getControl().isVisible()) {\r\n\t\t\t\tif (i - 1 >= 0)\r\n\t\t\t\t\ttabItem.getParent().setSelection(i - 1);\r\n\t\t\t\telse\r\n\t\t\t\t\ttabItem.getParent().setSelection(tabItems.length - 1);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public final void redo() {\n\t\tthis.historyManager.redo();\n\t}", "void urlFieldEnterKeyPressed();", "public void btnNextClicked(){\n\n fname = etFName.getText().toString();\n lname = etLName.getText().toString();\n country = spcountry.getSelectedItem().toString();\n description = etDescription.getText().toString();\n phone = etPhone.getText().toString();\n\n controller.setData(fname,lname,country,description,phone);\n\n controller.putStringData(this);\n\n /*editorPreferences.putString(\"First Name: \",user.getFirstName());\n editorPreferences.putString(\"Last Name: \",user.getLastName());\n editorPreferences.putString(\"Country : \",user.getCountry());\n editorPreferences.putString(\"Description : \",user.getDescription());\n editorPreferences.putString(\"Phone Number : \",user.getPhone());\n editorPreferences.apply();*/\n\n }", "public void next() {\n if (highlight.getMatchCount() > 0) {\n Point point = highlight.getNextMatch(cursor.getY(), cursor.getX());\n if (point != null) {\n cursor.moveTo(point);\n }\n return;\n }\n Point point = file.getNextModifiedPoint(cursor.getY(), cursor.getX());\n if (point != null) {\n cursor.moveTo(point);\n }\n }", "String getPrevious();", "public void previous() {\n if (hasPrevious()) {\n setPosition(position - 1);\n }\n }", "public void displayFrwd() {\n\t\tSystem.out.print(\"Displaying in forward direction [first--->last] : \");\n\t\tNode tempDisplay = first; // start at the beginning of linkedList\n\t\twhile (tempDisplay != null) { // Executes until we don't find end of\n\t\t\t\t\t\t\t\t\t\t// list.\n\t\t\ttempDisplay.displayNode();\n\t\t\ttempDisplay = tempDisplay.next; // move to next Node\n\t\t}\n\t\tSystem.out.println(\"\");\n\t}", "public void actionPerformed(ActionEvent event){\n cl.next(content);\n }", "public IWizardPage getNextPage();", "protected void enterPressed()\n\t{\n\t\t// Call the enter method if the enter key was pressed\n\t\tif (showCaret)\n\t\t\tonSubmit(text.getText().substring(0, text.getText().length() - 1));\n\t\telse onSubmit(text.getText());\n\t}", "public void jumpToNextLine() {\n int currentLineNo = getCurrentLineByCursor();\n if (currentLineNo == textBuffer.getMaxLine()-1) {\n textBuffer.setCurToTail();\n return;\n }\n int curX = round(cursor.getX());\n textBuffer.setCurToTargetNo(currentLineNo+1);\n lineJumpHelper(curX);\n }", "private void updateUi() {\n int index = mCurrentPage.getIndex();\n int pageCount = mPdfRenderer.getPageCount();\n mButtonPrevious.setEnabled(0 != index);\n mButtonNext.setEnabled(index + 1 < pageCount);\n getActivity().setTitle(getString(R.string.app_name_with_index, index + 1, pageCount));\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n String text = tweetInsertTextBox.getText();\n if (text != null && text.length() > 0) {\n jTextAreaTweets.setText(jTextAreaTweets.getText() + text + \"\\n\");\n tweetInsertTextBox.setText(\"\");\n jTextAreaTweets.setRows(jTextAreaTweets.getLineCount());\n tweetList.add(text);\n //f1.validate();\n }\n }" ]
[ "0.7230929", "0.6441304", "0.6081629", "0.6068448", "0.6013066", "0.60027933", "0.5826967", "0.56967664", "0.5658827", "0.5637143", "0.5575596", "0.5572783", "0.55724937", "0.5567776", "0.55649716", "0.5562032", "0.55602616", "0.5555334", "0.5541779", "0.5499741", "0.5469877", "0.5435288", "0.5423033", "0.5390702", "0.5389318", "0.5383732", "0.5382758", "0.53658396", "0.5361685", "0.5360853", "0.53340304", "0.53339154", "0.5331264", "0.5321757", "0.5318817", "0.531494", "0.5293082", "0.5280202", "0.5273307", "0.52609175", "0.5258372", "0.52192825", "0.51998097", "0.519402", "0.51640636", "0.51596373", "0.51552355", "0.5141301", "0.5135653", "0.51294905", "0.511648", "0.51110834", "0.51098996", "0.51066595", "0.5090378", "0.5087394", "0.5084691", "0.50814164", "0.50786257", "0.50740254", "0.50645506", "0.5060839", "0.5048835", "0.5041603", "0.50412905", "0.5034549", "0.50318146", "0.5025496", "0.502107", "0.50115305", "0.5004322", "0.5000721", "0.4985336", "0.49801847", "0.4975517", "0.49732476", "0.49714917", "0.49704728", "0.4970306", "0.4966444", "0.4965879", "0.49657807", "0.49627563", "0.49599877", "0.49569377", "0.49525768", "0.49523", "0.49490944", "0.49422798", "0.492542", "0.49216026", "0.49190956", "0.4908072", "0.49053276", "0.49013224", "0.48960024", "0.48949727", "0.48936853", "0.4893125", "0.4881567" ]
0.85822225
0
If the shell is closed this instance must be removed as listener from workspace preference change events.
@Override public void dispose() { ShellPreference.removeListener(this); super.dispose(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n protected void componentClosed() {\n WindowManager.getDefault().getRegistry().removePropertyChangeListener(this);\n }", "public void connectionClosed(ShellLaunchEvent ev);", "@Override\n protected void onDestroy() {\n super.onDestroy();\n PreferenceManager.getDefaultSharedPreferences(this).unregisterOnSharedPreferenceChangeListener(this);\n }", "@Override\n protected void onDestroy() {\n super.onDestroy();\n sharedPreferences.unregisterOnSharedPreferenceChangeListener(this);\n }", "@Override\n\t\t\t\t\tpublic void windowClosed(WindowEvent e) {\n\t\t\t\t\t\tsetStillRunning(false);\n\t\t\t\t\t}", "@Override\n\t\t\t\t\tpublic void windowClosing(WindowEvent e) {\n\t\t\t\t\t\tsetStillRunning(false);\n\t\t\t\t\t}", "@Override\n public void projectClosed() {\n ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);\n toolWindowManager.unregisterToolWindow(TOOL_WINDOW_ID);\n }", "public void dispose() {\n\t\tResourcesPlugin.getWorkspace().removeResourceChangeListener(this);\n\t\tsuper.dispose();\n\t}", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\n\t\tSystem.out.println(\"!!!!!!!!!!!!!!!onDestroy\");\n\t\tLanguageConvertPreferenceClass.loadLocale(getApplicationContext());\n\t}", "@Override\n public void widgetSelected(SelectionEvent selectionEvent) {\n shell.close();\n\n }", "@Override\n public void onDestroy() {\n unregisterReceiver(mNoisyAudioStreamReceiver);\n\n // Cancel our Notification\n mNotificationManager.cancel(NotificationTarget.NOTIFICATION_ID);\n\n // Set preference to indication not playing.\n PreferenceManager.getDefaultSharedPreferences(getApplicationContext())\n .edit()\n .putBoolean(MainActivity.PREF_IS_PLAYING, false)\n .commit();\n\n super.onDestroy();\n }", "@Override\n\t\t\t\t\tpublic void closing() {\n\t\t\t\t\t\tSystem.out.println(xmlData.get(\"topic\") + \" window has been closed\");\n\t\t\t\t\t\tliveTopics.remove(xmlData.get(\"topic\"));\n\t\t\t\t\t}", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tdismissWindow();\n\t}", "@Override\n protected void onPause() {\n SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);\n sp.unregisterOnSharedPreferenceChangeListener(this);\n super.onPause();\n }", "@Override\n protected void onPause() {\n SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);\n sp.unregisterOnSharedPreferenceChangeListener(this);\n super.onPause();\n }", "@Override\n\tpublic void windowClosed(WindowEvent e) {\n\t}", "@Override\n\tpublic void windowClosed(WindowEvent arg0) {\n\t\t\n\t}", "@Override\n\tpublic void windowClosed(WindowEvent arg0) {\n\t\t\n\t}", "@Override\n\tpublic void windowClosed(WindowEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void windowClosed(WindowEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void windowClosed(WindowEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void windowClosed(WindowEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void windowClosed(WindowEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void windowClosed(WindowEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void windowClosed(WindowEvent e) {\n\t\t\n\t}", "@Override\n public void onDestroy(boolean isChangingConfiguration) {\n\n }", "@Override\n public void windowClosed(WindowEvent we) {\n }", "@Override\n\t\t\tpublic void windowClosed(WindowEvent arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void windowClosed(WindowEvent arg0) {\n\t\t\t\t\n\t\t\t}", "@Override\n public void windowClosed(WindowEvent arg0) {\n\n }", "public void dispose() {\n parent.removeListener(listener);\n PlatformUI.getWorkbench().getDisplay().asyncExec(displayRunnable);\n }", "@Override\r\n\t\t\tpublic void windowClosed(WindowEvent arg0) {\n\t\t\t\t\r\n\t\t\t}", "@Override\n\tpublic void windowClosed(WindowEvent arg0) {\n\n\t}", "@Override\n protected void onDestroy() {\n \tsuper.onDestroy();\n \ttry {\n\t\t\tm.unRegisteredPropListener(mMyPropListener);\n\t\t} catch (RemoteException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n }", "@Override\n public void onTerminate() {\n super.onTerminate();\n /*2012-8-3, add by bvq783 for plugin*/\n if (mModel != null && mModel.getPluginHost() != null)\n mModel.getPluginHost().onModelDestroy();\n /*2012-8-3, add end*/\n unregisterReceiver(mModel);\n\n ContentResolver resolver = getContentResolver();\n resolver.unregisterContentObserver(mFavoritesObserver);\n }", "@Override\r\n\tpublic void windowClosed(WindowEvent e) {\n\r\n\t}", "public void dispose()\n {\n PerlEditorPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(this);\n \n uninstallAnnotationListener();\n \n try\n {\n if (sourceViewer instanceof ITextViewerExtension &&\n bracketInserter != null)\n {\n ((ITextViewerExtension) sourceViewer).removeVerifyKeyListener(\n bracketInserter);\n }\n if (validationThread != null) validationThread.dispose();\n if (idleTimer != null) idleTimer.dispose();\n \n String[] actionIds = PerlEditorActionIds.getEditorActions();\n for (int i = 0; i < actionIds.length; i++)\n {\n IAction action = getAction(actionIds[i]);\n if (action instanceof PerlEditorAction)\n ((PerlEditorAction) action).dispose();\n }\n \n super.dispose();\n }\n catch (InterruptedException e)\n {\n e.printStackTrace(); // TODO log it\n }\n }", "@Override\n\t\tpublic void windowClosed(WindowEvent e) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void windowClosed(WindowEvent e) {\n\t\t\t\n\t\t}", "@Override\r\n\tpublic void windowClosed(WindowEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void windowClosed(WindowEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void windowClosed(WindowEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void windowClosed(WindowEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void windowClosed(WindowEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void windowClosed(WindowEvent arg0) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void windowClosed(WindowEvent arg0) {\n\t\t\r\n\t}", "@Override\n\t\t\tpublic void windowClosed(WindowEvent arg0) {\n\n\t\t\t}", "private AutoCloseImpl() {\n AutoCloseOptions.getDefault().addPropertyChangeListener(this);\n timestamps = new WeakHashMap();\n timestamps.putAll(AutoCloseOptions.getDefault().getTimestampMap());\n loadSettings();\n }", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tpopupWindowDismiss();\n\t\tif(receiver!=null)\n\t\t\tunregisterReceiver(receiver);\n\t}", "@Override\n\tpublic void windowClosed(WindowEvent arg0)\n\t{\n\t\t\n\t}", "@Override\n\tpublic void windowClosed(WindowEvent arg0)\n\t{\n\t\t\n\t}", "@Override\r\n\tpublic void windowClosed(WindowEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void windowClosed(WindowEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void windowClosed(WindowEvent e) {\n\t\t\r\n\t}", "@Override\n\tpublic void windowClosed(WindowEvent e) {\n\n\t}", "@Override\n\tpublic void windowClosed(WindowEvent e) {\n\n\t}", "@Override\n\tpublic void windowClosed(WindowEvent e) {\n\n\t}", "@Override\n\tpublic void windowClosed(WindowEvent e) {\n\n\t}", "@Override\n\tpublic void windowClosed(WindowEvent e) {\n\n\t}", "@Override\n\tpublic void windowClosed(WindowEvent e) {\n\n\t}", "@Override\n\tpublic void windowClosed(WindowEvent e) {\n\n\t}", "@Override\n\t\t\tpublic void windowClosed(WindowEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void windowClosed(WindowEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void windowClosed(WindowEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void windowClosed(WindowEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\r\n\t\t\tpublic void windowClosed(WindowEvent e) {\n\t\t\t\t\r\n\t\t\t}", "@Override\n\t\t\tpublic void windowClosed(WindowEvent e) {\n\t\t\t}", "@Override\r\n\t\tpublic void windowClosed(WindowEvent e) {\n\t\t}", "@Override\r\n\t\t\tpublic void onClosed() {\n\t\t\t\t\r\n\t\t\t}", "@Override\n protected void onDestroy() {\n SharedPreferences sharedPreferences = MainActivity.this.getSharedPreferences(KEY_SHAREDPREF_FILE,Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(KEY_SHARED_PREF_NOTIF, notificationPreferences);\n editor.apply();\n\n this.unbindService(spotifyServiceConnection);\n\n super.onDestroy();\n }", "public void deinitPreference() {\n mContext.unregisterReceiver(mIntentReceiver);\n }", "public void close() {\n saveConfigurationSettings();\n removeAllLogHandlers();\n try {\n Constants.PREFS.flush();\n }\n catch ( Exception e ) {\n e.printStackTrace();\n }\n }", "@Override\n protected void onPause() {\n getPreferenceScreen().getSharedPreferences().unregisterOnSharedPreferenceChangeListener(this);\n \n super.onPause();\n }", "@Override\n\t\t\tpublic void windowClosed(WindowEvent e) {\n\n\t\t\t}", "@Override\n\tpublic void windowClosed (WindowEvent e)\n\t{\n\t}", "public void close(){\n PropertyEditor.checkRestrictions.remove();\r\n // removed current value for xml converterContext\r\n ConverterContext.remove();\r\n }", "@Override\n public void closeSettings() {\n \n }", "public void onWindowClosing(Window.ClosingEvent event) {\n VTextField.flushChangesFromFocusedTextField();\n \n // Send the closing state to server\n connection.updateVariable(id, \"close\", true, false);\n connection.sendPendingVariableChangesSync();\n }", "@Override\n\tpublic void onGuiClosed() {\n\t\tfield_154330_a.removed();\n\t\tsuper.onGuiClosed();\n\t}", "@PreDestroy\n public void onClose() {\n progSpin.progressProperty().unbind();\n progLabel.textProperty().unbind();\n processButton.disableProperty().unbind();\n }", "@Override\n public void windowClosing(WindowEvent e) {\n }", "@Override\n public void windowClosing(WindowEvent e) {\n }", "@Override\n public void windowClosing(WindowEvent e) {\n }", "@Override\n public void windowClosing(WindowEvent e) {\n }", "@Override\n public void windowClosing(WindowEvent e) {\n }", "@Override\n public void windowClosing(WindowEvent e) {\n }", "@Override\n public void windowClosing(WindowEvent e) {\n }", "@Override\n public void windowClosing(WindowEvent e) {\n }", "@Override\n public void windowClosing(WindowEvent e) {\n }", "@Override\n public void windowClosing(WindowEvent e) {\n }", "@Override\n public void windowClosing(WindowEvent e) {\n }", "@Override\n public void windowClosing(WindowEvent e) {\n }", "@Override\n public void windowClosing(WindowEvent e) {\n }", "@Override\n public void windowClosing(WindowEvent e) {\n }", "@Override\n public void windowClosing(WindowEvent e) {\n }", "@Override\n public void windowClosing(WindowEvent e) {\n }", "@Override\n public void windowClosing(WindowEvent e) {\n }", "@Override\n public void windowClosing(WindowEvent e) {\n }", "@Override\n public void windowClosing(WindowEvent e) {\n }", "@Override\n public void windowClosing(WindowEvent e) {\n }" ]
[ "0.6298727", "0.6293062", "0.6201542", "0.618487", "0.59730625", "0.5794069", "0.57929707", "0.5721132", "0.5664826", "0.5634318", "0.5616508", "0.5603801", "0.55885917", "0.5565001", "0.5565001", "0.55463046", "0.5508145", "0.5508145", "0.5498934", "0.5498934", "0.5498934", "0.5498934", "0.5498934", "0.5498934", "0.5498934", "0.5498887", "0.5497895", "0.5489407", "0.5489407", "0.5485153", "0.54807276", "0.54795057", "0.54743195", "0.5472924", "0.54709315", "0.5466084", "0.5465578", "0.54561", "0.54561", "0.5451409", "0.5451409", "0.5451409", "0.5451409", "0.5451409", "0.5451409", "0.5451409", "0.5450258", "0.5448518", "0.54419875", "0.54411024", "0.54411024", "0.54367906", "0.54367906", "0.54367906", "0.5435108", "0.5435108", "0.5435108", "0.5435108", "0.5435108", "0.5435108", "0.5435108", "0.54209507", "0.54209507", "0.54209507", "0.54209507", "0.54185784", "0.5418413", "0.5415372", "0.5406069", "0.54046017", "0.54018337", "0.540143", "0.53959894", "0.537696", "0.5364608", "0.5364005", "0.5351245", "0.53423595", "0.5338379", "0.53147864", "0.5295549", "0.5295549", "0.5295549", "0.5295549", "0.5295549", "0.5295549", "0.5295549", "0.5295549", "0.5295549", "0.5295549", "0.5295549", "0.5295549", "0.5295549", "0.5295549", "0.5295549", "0.5295549", "0.5295549", "0.5295549", "0.5295549", "0.5295549" ]
0.7381761
0
Increment the gcelapsedtime counter.
private void incrementGcCounter() { if (null == PSAgentContext.get().getMetrics()) { return; // nothing to do. } long elapsedGc = getElapsedGc(); long totalGc = 0; String gc_time = PSAgentContext.get().getMetrics().get(AngelCounter.GC_TIME_MILLIS); if (gc_time != null) { totalGc = elapsedGc + Long.parseLong(gc_time); } else { totalGc = elapsedGc; } PSAgentContext.get().getMetrics().put(AngelCounter.GC_TIME_MILLIS, Long.toString(totalGc)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public synchronized static void incrementTime() {\n\t\ttime += 1;\n\t}", "public void IncTimeInProc() {\n this.TimeInProc++;\n }", "public long timeIncrement(long reps) {\n long result = 0;\n for (; result < reps; result++) {\n }\n return result;\n }", "public void IncWaitTime() {\n this.WaitTime++;\n }", "public void increment() {\n long cnt = this.count.incrementAndGet();\n if (cnt > max) {\n max = cnt;\n // Remove this after refactoring to Timer Impl. This is inefficient\n }\n this.lastSampleTime.set(getSampleTime ());\n }", "public void timeTick()\r\n\t{\r\n\t\tnumberDisplay1.increment();\r\n\t}", "private static void increment_time()\n\t{\n\t\ttime_of_day = time_of_day + 1;\n\t\tif(time_of_day>=120)\n\t\t{\n\t\t\ttime_of_day=time_of_day-120;\n\t\t}\n\t}", "public static void increment() {\n\t\tcount.incrementAndGet();\n//\t\tcount++;\n\t}", "private void incrementCounter()\r\n\t{\r\n\t\tthis.counter++;\r\n\t}", "public /*synchronized*/ void increment() {\n counter++;\n }", "private void plusTime(){\n\n if(totalTimeCountInMilliseconds < 10000)\n {\n countDownTimer.cancel();\n countDownTimer = new MyCountDown(totalTimeCountInMilliseconds + 3000, 50);// give extra 3000 milliseconds if they get the answer right\n }\n else\n {\n countDownTimer.cancel();\n countDownTimer = new MyCountDown(10000, 50);// set the timer to 10000 millisec if totalTimeCountInMilliseconds + 3000 > 10000\n }\n\n countDownTimer.start();\n\n\n }", "public void IncrementCounter()\r\n {\r\n \tsetCurrentValue( currentValue.add(BigInteger.ONE)); \r\n \r\n log.debug(\"counter now: \" + currentValue.intValue() );\r\n \r\n }", "public void incrementTimesPlayed() {\r\n\t\ttimesPlayed++;\r\n\t}", "public static synchronized void increment() {\n counter++;\n }", "public void step() {\n \tinternaltime ++;\n \n }", "public void increment() {\n\t\tsynchronized (this) {\n\t\t\tCounter.count++;\n\t\t\tSystem.out.print(Counter.count + \" \");\n\t\t}\n\t\n\t}", "public void tick(){\r\n if(timer != 0)\r\n timer++;\r\n }", "@Test\n public void testInc(){\n CountDownTimer s1 = new CountDownTimer(1, 49, 30);\n \tfor(int i = 0; i < 15000; i++){\n \t\ts1.inc();\n }\n assertEquals(s1.toString(), \"5:59:30\");\n }", "public void increment() {\n sync.increment();\n }", "private void increment() {\n for (int i=0; i < 10000; i++) {\n count++;\n }\n }", "public void incCounter()\n {\n counter++;\n }", "void incrementAddedCount() {\n addedCount.incrementAndGet();\n }", "public synchronized static void incrementTimeBy(int ticks) {\n\t\tif (ticks > 0) {\n\t\t\ttime += ticks;\n\t\t}\n\t}", "private void reactMain_region_digitalwatch_Time_counting_Counting() {\n\t\tif (timeEvents[0]) {\n\t\t\tnextStateIndex = 0;\n\t\t\tstateVector[0] = State.$NullState$;\n\n\t\t\ttimer.unsetTimer(this, 0);\n\n\t\t\ttimer.setTimer(this, 0, 1 * 1000, false);\n\n\t\t\tsCILogicUnit.operationCallback.increaseTimeByOne();\n\n\t\t\tnextStateIndex = 0;\n\t\t\tstateVector[0] = State.main_region_digitalwatch_Time_counting_Counting;\n\t\t}\n\t}", "public static synchronized void increment() {\r\n\t\tcount++;\r\n\t}", "private void countTime()\n {\n time--;\n showTime();\n if (time == 0)\n {\n showEndMessage();\n Greenfoot.stop();\n }\n }", "private synchronized void increment() {\n ++count;\n }", "public void timer()\n {\n timer += .1; \n }", "private long increment() {\n\t\tlong ts = latestTimestamp.incrementAndGet();\n\t\treturn ts;\n\t}", "public static void increase(){\n c++;\n }", "public void incrementDelayCounter(int increment) {\n delayCounter += increment;\n }", "public void increaseHour() {\n\t\tthis.total++;\n\t}", "private void incrementeDate() {\n dateSimulation++;\n }", "public void countTimer() {\n\t\t\n\t\ttimerEnd = System.currentTimeMillis();\n\t}", "public void incCounter(){\n counter++;\n }", "public void act() \n {\n updateTimerDisplay();\n if(timeCounter < 3600){\n timeCounter++;\n \n }else{\n timeElapsed++;\n timeCounter = 0;\n }\n checkHighScore();\n checkRegScore();\n\n }", "private synchronized void incrementCount()\n\t{\n\t\tcount++;\n\t}", "public static synchronized void inccount()\r\n\t{\r\n\t\tcount++;\r\n\t}", "public void trackTime()\n {\n frames += 1;\n\n // Every second (roughly) reduce the time left\n if (frames % 60 == 0)\n {\n time += 1;\n showTime();\n }\n }", "public void increaseEntered() {\n numTimesEntered++;\n }", "private void incrementCounters() {\n // update score by 5 every second\n ++scoreTimer;\n if (scoreTimer > scoreInterval) {\n score += 5;\n scoreTimer = 0;\n }\n\n // update speed by 100% every second\n ++speedTimer;\n if (speedTimer > speedInterval) {\n currentSpeed *= speedFactor;\n ++gameLevel;\n speedTimer = 0;\n }\n\n // increment rock timer (we create a new rock every 2 seconds)\n ++rockTimer;\n }", "public static synchronized void increment(){\n count++;\n }", "@Override\n public synchronized void increment() {\n count++;\n }", "public void increase() {\r\n\t\t\tsynchronized (activity.getTaskTracker()) {\r\n\t\t\t\tactivity.getTaskTracker().count++;\r\n\t\t\t\tLog.d(LOGTAG, \"Incremented task count to \" + count);\r\n\t\t\t}\r\n\t\t}", "void incrementCount();", "public void incrementCount() {\n\t\tcount++;\n\t}", "public void actionPerformed(ActionEvent evt) {\n\n timeElapsed = timeElapsed + 1;\n\n }", "private void advanceTime(){\n\t minute++;\n\t while (minute > 59) {\n\t minute -= 60;\n\t hour++;\n\t }\n\t while (hour > 23) {\n\t hour -= 24;\n\t day++;\n\t }\n\t while (day > 6) {\n\t day -= 7;\n\t }\n\n\t }", "public void buyIncreaseSafeTime() {\n this.increaseSafeTime++;\n }", "private synchronized void increment() {\n count++;\n atomicInteger.incrementAndGet();\n }", "public void incrementCount(){\n count+=1;\n }", "synchronized public String get_and_increment_timestamp()\n {\n return String.format(CLOCK_FORMAT_STRING,++counter);\n }", "public void incrementWaitCounter() {\n ticksWaitingToBeAssigned++;\n }", "private void updateTime()\n {\n time++;\n this.timeTextField.setText(\"\" + time);\n }", "public void increment(User u) {\n\t\tif(this.clock.containsKey(u)){\n\t\t\tthis.clock.put(u, this.clock.get(u)+1L);\n\t\t}else {\n\t\t\tthis.clock.put(u, 1L);\n\t\t}\n\t}", "void incrementTick();", "@Override\n\tpublic void count(float time) {\n\t\tfinal ICounter counter = currnet();\n\t\tcounter.count(time);\n\t\tif(counter.isDead()){\n\t\t\tthis.mCounters.removeFirst();\n\t\t\tcounter.reset();\n\t\t\tthis.mCounters.addLast(counter);\n\t\t\tmRemainedCounters--;\n\t\t}\n\t}", "public void increment() {\n increment(1);\n }", "public void incrementDelayCounter() {\n\t\tthis.delayCounter++;\n\t}", "public void increment() {\n\t\tif (m_bYear) {\n\t\t\tm_value++;\n\t\t\tif (m_value > 9999)\n\t\t\t\tm_value = 0;\n\t\t} else {\n\t\t\tm_value++;\n\t\t\tif (m_value > 11)\n\t\t\t\tm_value = 0;\n\n\t\t}\n\t\trepaint();\n\t}", "public void increment(long delta) {\n long cnt = this.count.addAndGet(delta);\n if(cnt > max) {\n max = cnt;\n }\n this.lastSampleTime.set(getSampleTime());\n }", "private void trackerTimer() {\n\n Thread timer;\n timer = new Thread() {\n\n @Override\n public void run() {\n while (true) {\n\n if (Var.timerStart) {\n try {\n Var.sec++;\n if (Var.sec == 59) {\n Var.sec = 0;\n Var.minutes++;\n }\n if (Var.minutes == 59) {\n Var.minutes = 0;\n Var.hours++;\n }\n Thread.sleep(1000);\n } catch (Exception cool) {\n System.out.println(cool.getMessage());\n }\n\n }\n timerText.setText(Var.hours + \":\" + Var.minutes + \":\" + Var.sec);\n }\n\n }\n };\n\n timer.start();\n }", "public void incrementTotalOfTime(TypeOfGames type, int totalOfTime) {\n statistics.get(type).incrementTotalOfTime(totalOfTime);\n }", "public void incrementCount() {\n count++;\n }", "@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tcounter.increment();\n\t\t\t\t}", "public void incrementDeathTicks() {\n this.deathTicks++;\n }", "private void startCountTime() {\n\t\tRunnable timerRunnable = () -> {\n\t\t\tinitTimer();\n\t\t\tlong millisWaitTime = 1000/CALCULATIONS_PER_SECOND;\n\t\t\tlong currT, nextT;\n\t\t\t//previous time\n\t\t\tlong prevT = System.nanoTime();\n\t\t\twhile (this.keepRunning) {\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(millisWaitTime);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t}\n\t\t\t\tcurrT = System.nanoTime();\n\t\t\t\tthis.time = (double)(currT - prevT) * 0.000000001;\n\t\t\t\tprevT = currT;\n\t\t\t\tnextT = prevT + 1000000000 / CALCULATIONS_PER_SECOND;\n\t\t\t\tthis.gameLogic.updateGame(time);\n\t\t\t\t// stop the timer game if the player lose\n\t\t\t\tif(this.gameLogic.playerLose()) {\n\t\t\t\t\tthis.stopCountTime();\n\t\t\t\t}\n\t\t\t\tlong timeWait = Math.max(nextT - System.nanoTime(),0);\n\t\t\t\ttimeWait += INCREASE_WAIT;\n\t\t\t\tmillisWaitTime = timeWait / 1000000;\n\t\t\t}\n\t\t};\n\t\tgameTimeThread = new Thread(timerRunnable);\n\t\tgameTimeThread.start();\n\t}", "public int getIncTimeout();", "@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tcounter.accumulate(1);\n\t\t\t\t}", "public void tick() {\r\n tick++;\r\n }", "public void incCount() { }", "public void addBonusTime(int time) {\n if (time == 0) {\n System.out.println(\"No bonus time was added to the timer.\");\n printTimeRemaining();\n } else {\n System.out.println(time + \" seconds were added to the timer!\");\n time = time * 1000; //convert to milliseconds\n bonusTime += time;\n printTimeRemaining();\n }\n }", "public void setIncTimeout(int seconds);", "public void increaseScore(){\n this.inc.seekTo(0);\n this.inc.start();\n this.currentScore++;\n }", "public void timePasses(){\n crtClock++;\n if(crtClock==25)crtClock=1; // If end of day, reset to 1\n if(crtClock<=opHours)tellMeterToConsumeUnits(unitsPerHr);\n }", "long ctime() {\n return ctime;\n }", "public void increment() {\n mNewNotificationCount.setValue(mNewNotificationCount.getValue() + 1);\n }", "public void increase() {\r\n\r\n\t\tincrease(1);\r\n\r\n\t}", "public void incrementLoopCount() {\n this.loopCount++;\n }", "int time()\n\t{\n\t\treturn totalTick;\n\t}", "private void puntuacion(){\n timer++;\n if(timer == 10){\n contador++;\n timer = 0;\n }\n }", "public void moveForward() {\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t // 2\n\t\tseconds += tic;\n\t\tif (seconds >= 60.0) {\n\t\t\tseconds -= 60.0;\n\t\t\tminutes++;\n\t\t\tif (minutes == 60) {\n\t\t\t\tminutes = 0;\n\t\t\t\thours++;\n\t\t\t}\n\t\t}\n\t}", "private void advanceTime() {\r\n myCurrentTimeLabel.setText(DateFormat.getDateTimeInstance().format(new Date()));\r\n }", "public void inc() {\n inc(1);\n }", "public void increment(long value) {\n mCount.getAndIncrement();\n mTotal.getAndAdd(value);\n }", "public void incEts() {\n ets++;\n }", "public void timePassed() {\r\n }", "public void timePassed() {\r\n }", "public void inc(){\n this.current += 1;\n }", "public void incClock(byte[] id) {\n\tif(vclock == null) { // Create a new clock.\n\t vclock = new VectorClock(id, 0);\n\t}\n\tvclock = vclock.inc();\n }", "public void timePassed() {\r\n\r\n }", "public static void ComienzaTimer(){\n timer = System.nanoTime();\n }", "public void update(int time);", "public void IncrementCounter()\r\n {\r\n \tif (startAtUsed==false\r\n \t\t\t|| (!counter.encounteredAlready)) {\r\n \t\t// Defer setting the startValue until the list\r\n \t\t// is actually encountered in the main document part,\r\n \t\t// since otherwise earlier numbering (using the\r\n \t\t// same abstract number) would use this startValue\r\n \tcounter.setCurrentValue(this.startValue); \r\n \tlog.debug(\"not encounteredAlready; set to startValue \" + startValue);\r\n \tcounter.encounteredAlready = true;\r\n \tstartAtUsed = true;\r\n \t}\r\n counter.IncrementCounter();\r\n }", "public synchronized void tick(){\r\n\t\ttime++;\r\n\t\tnotifyAll();\r\n\t}", "@Override\r\n public void timePassed(double dt) {\r\n\r\n }", "@Override\r\n public void timePassed(double dt) {\r\n\r\n }", "public boolean incrementTimeTaken() {\n try {\n int timeTakenByBuilding = this.getTreeNode().getBuilding().getTotalTimeTaken();\n this.getTreeNode().getBuilding().setTotalTimeTaken(timeTakenByBuilding+1);\n return true;\n }\n catch (Exception e) {\n e.printStackTrace();\n return false;\n }\n }", "private void updateTime() {\n timer.update();\n frametime = timer.getTimePerFrame();\n }", "public static void calTime() {\n time = new Date().getTime() - start;\n }" ]
[ "0.7501085", "0.6635549", "0.6427003", "0.6402084", "0.6364263", "0.631706", "0.63020086", "0.62721246", "0.6247416", "0.6169251", "0.6150908", "0.61263806", "0.61010635", "0.60933024", "0.6078851", "0.6073767", "0.6064377", "0.6030418", "0.60149556", "0.60077137", "0.5993193", "0.5986213", "0.59654325", "0.5940675", "0.59192884", "0.5902024", "0.58874536", "0.58595717", "0.5845806", "0.5841061", "0.5834964", "0.5833417", "0.5823824", "0.5820382", "0.58190525", "0.57925713", "0.57893664", "0.5786919", "0.57750374", "0.57721704", "0.5768256", "0.57662845", "0.5754343", "0.5754028", "0.5747804", "0.57045835", "0.5682541", "0.56786853", "0.5663783", "0.56637245", "0.5657582", "0.56560826", "0.56490785", "0.5646066", "0.5637733", "0.5634018", "0.5632617", "0.5631228", "0.56298363", "0.5623217", "0.56134367", "0.5607796", "0.5604983", "0.56017965", "0.55792904", "0.55683285", "0.5562146", "0.55573237", "0.55333656", "0.55321443", "0.5521165", "0.5517254", "0.5515653", "0.54926497", "0.54865545", "0.54834014", "0.54744565", "0.5431889", "0.5430396", "0.54266757", "0.54242164", "0.54238427", "0.54190546", "0.5418363", "0.5409495", "0.5407624", "0.53958774", "0.53958774", "0.53941375", "0.53866124", "0.5380258", "0.5369452", "0.5355551", "0.5349048", "0.5347562", "0.5343506", "0.5343506", "0.53128165", "0.53122103", "0.53036463" ]
0.719631
1
Update generic resource counters
@SuppressWarnings("deprecation") private void updateResourceCounters() { updateHeapUsageCounter(); // Updating resources specified in ResourceCalculatorProcessTree if (pTree == null) { return; } pTree.updateProcessTree(); long cpuTime = pTree.getCumulativeCpuTime(); long pMem = pTree.getCumulativeRssmem(); long vMem = pTree.getCumulativeVmem(); // Remove the CPU time consumed previously by JVM reuse cpuTime -= initCpuCumulativeTime; PSAgentContext.get().getMetrics().put(AngelCounter.CPU_MILLISECONDS, Long.toString(cpuTime)); PSAgentContext.get().getMetrics().put(AngelCounter.PHYSICAL_MEMORY_BYTES, Long.toString(pMem)); PSAgentContext.get().getMetrics().put(AngelCounter.VIRTUAL_MEMORY_BYTES, Long.toString(vMem)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void updateResourceInformation() {\n\t}", "@Override\n\tpublic void updateResourceInformation() {\n\t}", "@Override\r\n\tpublic void increaseAmount(ResourceType resource) {\n\t\t\r\n\t}", "IntegerResource tracking();", "@Override\r\n\tpublic void update(Resources resources) {\n\t\t\r\n\t}", "private void incrementUsageCount() {\n usageCount++;\n }", "@Override\n public synchronized void release(long delta) {\n if (delta < 0) {\n throw new IllegalArgumentException(\"resource counter delta must be >= 0\");\n }\n long prev = count;\n count+= delta;\n if (prev <= 0 && count > 0 ) {\n turnOn();\n }\n }", "public void updateResources(int r) {\n\t\t_resources.setText(\"Resources: \"+r);\n\t\tvalidate();\n\t\trepaint();\n\t}", "public void useResources(Type type, int count) {\n \t\tresources[type.ordinal()] -= count;\n \t}", "@Override\n public void updateProductCounter() {\n\n }", "public void addResources(Type type, int count) {\n \t\tresources[type.ordinal()] += count;\n \t}", "@Override\r\n\tpublic int updateResources(Resources resources) {\n\t\treturn resourcesDao.updateResources(resources);\r\n\t}", "public void updateResources(List<Resource> resources) {\n\t\t\n\t}", "public void setResourceCount(java.lang.Integer resourceCount) {\n this.resourceCount = resourceCount;\n }", "private void add(EResource resource) {\n switch (resource) {\n case BRICK:\n brick++;\n break;\n case GRAIN:\n grain++;\n break;\n case LUMBER:\n lumber++;\n break;\n case ORE:\n ore++;\n break;\n case WOOL:\n wool++;\n break;\n }\n }", "@Override\n public int getResourceCount() {\n for (Employee employee: employeesList){\n this.resourceCount += employee.getResourceCount();\n }\n return this.resourceCount+1;\n }", "private void updateResorce() {\n }", "@Override\r\n\tpublic void updateCounter(CounterModel cm) {\n\t\thomedao.updateCounter(cm);\r\n\t}", "public void defaultUpdateCount(AcProperty e)\n {\n }", "@Override\n public void refreshResources() {\n\n }", "public void incrementNumModifyRequests() {\n this.numModifyRequests.incrementAndGet();\n }", "public static void updateResources(){\n for(int i = 0 ; i < releaseArr.length; i ++){\n resourceArr[i] += releaseArr[i];\n }\n }", "public void incCount() { }", "private static void updateCounters() {\n\t\tongoingProjectsLabel.setText(\"Ongoing Projects (\" + portfolio.getOngoingCount() + \")\");\n\t\tfinishedProjectsLabel.setText(\"Finished Projects (\" + portfolio.getFinishedCount() + \")\");\n\t}", "public BasicUpdate(Short counter)\n {\n this.counter = counter;\n }", "long getUpdateCount();", "private void increaseReconcileCount(final boolean isSuccess) {\n final SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DATE_AND_TIME_FORMAT);\n InstanceIdentifier<ReconcileCounter> instanceIdentifier = InstanceIdentifier\n .builder(ReconciliationCounter.class).child(ReconcileCounter.class,\n new ReconcileCounterKey(nodeId)).build();\n ReadWriteTransaction tx = broker.newReadWriteTransaction();\n Optional<ReconcileCounter> count = getReconciliationCount(tx, instanceIdentifier);\n ReconcileCounterBuilder counterBuilder = new ReconcileCounterBuilder()\n .withKey(new ReconcileCounterKey(nodeId))\n .setLastRequestTime(new DateAndTime(simpleDateFormat.format(new Date())));\n\n if (isSuccess) {\n if (count.isPresent()) {\n long successCount = count.orElseThrow().getSuccessCount().toJava();\n counterBuilder.setSuccessCount(Uint32.valueOf(++successCount));\n LOG.debug(\"Reconcile success count {} for the node: {} \", successCount, nodeId);\n } else {\n counterBuilder.setSuccessCount(Uint32.ONE);\n }\n } else if (count.isPresent()) {\n long failureCount = count.orElseThrow().getFailureCount().toJava();\n counterBuilder.setFailureCount(Uint32.valueOf(++failureCount));\n LOG.debug(\"Reconcile failure count {} for the node: {} \", failureCount, nodeId);\n } else {\n counterBuilder.setFailureCount(Uint32.ONE);\n }\n try {\n tx.mergeParentStructureMerge(LogicalDatastoreType.OPERATIONAL, instanceIdentifier,\n counterBuilder.build());\n tx.commit().get();\n } catch (InterruptedException | ExecutionException e) {\n LOG.error(\"Exception while submitting counter for {}\", nodeId, e);\n }\n }", "@Override\n\tpublic void updateStatisticCounts(long topicCoutn, long postCount)\n\t\t\tthrows Exception {\n\n\t}", "void incrementCount();", "@Override\r\n\tpublic int resourcesCount(Map<String, Object> map) {\n\t\treturn resourcesDao.resourcesCount(map);\r\n\t}", "public void defaultUpdateCount(AcBatchFlight e)\n {\n }", "@Override\n\t\t\tprotected void onProgressUpdate(Integer... values) {\n\t\t\t\tsuper.onProgressUpdate(values);\n\t\t\t\tiCounterCallback.counter(values[0]);\n\t\t\t}", "void updateFrequencyCount() {\n //Always increments by 1 so there is no need for a parameter to specify a number\n this.count++;\n }", "void incrementAccessCounter();", "private void incrementCounter()\r\n\t{\r\n\t\tthis.counter++;\r\n\t}", "@Override\r\n\tpublic void increaseDomesticTradeResourceAmount(ResourceType resource) {\n\t\t\r\n\t}", "@Test(groups = \"heartbeat\", dataProvider = \"resourceNameProvider\")\n public void connectToCountResource(String resourceName, Integer expectedStatus) {\n String url = prefix + resourceName + \"/_count\";\n WebResource resource = client.resource(url);\n ClientResponse response = resource.get(ClientResponse.class);\n Integer status = response.getStatus();\n Assert.assertEquals(status, expectedStatus);\n }", "protected void updateSummaries() { }", "protected void updateSummaries() { }", "public int getUpdateCount();", "int getUpdateCountsCount();", "public void incrementCount() {\n count++;\n }", "protected synchronized void acquire(long delta) {\n if (delta <= 0) {\n throw new IllegalArgumentException(\"resource counter delta must be > 0\");\n }\n long prev = count;\n count -= delta;\n if (prev > 0 && count <= 0 ) {\n turnOff();\n }\n }", "public java.lang.Integer getResourceCount() {\n return resourceCount;\n }", "public int getResourceCount() {\n \t\tint sum = 0;\n \t\tfor (int i = 0; i < resources.length; i++)\n \t\t\tsum += resources[i];\n \t\treturn sum;\n \t}", "public void incrementActiveRequests() \n {\n ++requests;\n }", "public void setUpdateOften(int i){\n countNum = i;\n }", "public void incrementCount() {\n\t\tcount++;\n\t}", "private void _updateCount(int classType) {\n int subClass, superClass;\n\n instances_[classType].count++;\n subClass = classType;\n while ( (superClass = CLASS_INFO[subClass][INDEX_SUPER]) != CS_C_NULL) {\n instances_[superClass].count++;\n subClass = superClass;\n }\n }", "private synchronized void incrementCount()\n\t{\n\t\tcount++;\n\t}", "public void counter(MetricCounter<Integer> metric, int value);", "Update withReplicaCount(int count);", "@Override\n public synchronized void increment() {\n count++;\n }", "void incrementAddedCount() {\n addedCount.incrementAndGet();\n }", "interface Update extends\n Appliable<SearchService>,\n Resource.UpdateWithTags<Update>,\n UpdateStages.WithReplicaCount,\n UpdateStages.WithPartitionCount {\n }", "public void incrementCount(){\n count+=1;\n }", "long getUpdateCounts(int index);", "public void increaseCount(){\n myCount++;\n }", "private static void setCounter() {++counter;}", "public int getResourceCount() {\n\t\t\treturn resourceCount;\n\t\t}", "@Override\r\n\tpublic void decreaseAmount(ResourceType resource) {\n\t\t\r\n\t}", "public interface ResourceListener {\n\n\tpublic void update(ResourceList resource);\n}", "void incCount() {\n ++refCount;\n }", "interface WithReplicaCount {\n /**\n * Specifies the replicas count of the Search service.\n *\n * @param count the replicas count; replicas distribute workloads across the service. You need 2 or more to support high availability (applies to Basic and Standard tiers only)\n * @return the next stage of the definition\n */\n Update withReplicaCount(int count);\n }", "@Test\n public void testAvailableResources() {\n MetricValue mv = new MetricValue.Builder().load(50).add();\n\n Set<String> diskSet = ImmutableSet.of(\"disk1\", \"disk2\");\n\n diskSet.forEach(disk -> DISK_METRICS.forEach(cmt ->\n testUpdateMetricWithResource(cmt, mv, disk)));\n\n Set<String> networkSet = ImmutableSet.of(\"eth0\", \"eth1\");\n\n networkSet.forEach(network -> NETWORK_METRICS.forEach(cmt ->\n testUpdateMetricWithResource(cmt, mv, network)));\n\n assertThat(monitor.availableResourcesSync(nodeId, Type.DISK), is(diskSet));\n assertThat(monitor.availableResourcesSync(nodeId, Type.NETWORK), is(networkSet));\n }", "public void incCounter(){\n counter++;\n }", "public abstract void setTotalBlockTimeForNextBlock(int resourceNum);", "private void resetCounter() {\n // Obtain the most recent changelist available on the client\n String depot = parent.getDepot();\n Client client = Client.getClient();\n Changelist toChange = Changelist.getChange(depot, client);\n\n // Reset the Perforce counter value\n String counterName = parent.getCounter();\n Counter.setCounter(counterName, toChange.getNumber());\n }", "@PUT\n @Path(UPDATE_RESOURCES_PATH)\n public void updateUsedResources(@PathParam(DATACENTER) final Integer datacenterId)\n {\n Datacenter datacenter = service.getDatacenter(datacenterId);\n List<Rack> racks = service.getRacks(datacenter);\n for (Rack rack : racks)\n {\n List<Machine> machines = infraService.getMachines(rack);\n for (Machine machine : machines)\n {\n infraService.updateUsedResourcesByMachine(machine);\n }\n }\n\n }", "public void incCounter()\n {\n counter++;\n }", "public final void addToPendingCount(int paramInt)\n/* */ {\n/* 526 */ U.getAndAddInt(this, PENDING, paramInt);\n/* */ }", "abstract public String updateData(String userId, String resourceName, long lastUpdate) throws IOException;", "private void updateMetrics(ContainerStatus status) {\n if (status != null) {\n switch (status.getExitStatus()) {\n case SUCCESS:\n componentMetrics.containersSucceeded.incr();\n scheduler.getServiceMetrics().containersSucceeded.incr();\n return;\n case PREEMPTED:\n componentMetrics.containersPreempted.incr();\n scheduler.getServiceMetrics().containersPreempted.incr();\n break;\n case DISKS_FAILED:\n componentMetrics.containersDiskFailure.incr();\n scheduler.getServiceMetrics().containersDiskFailure.incr();\n break;\n default:\n break;\n }\n }\n\n // containersFailed include preempted, disks_failed etc.\n componentMetrics.containersFailed.incr();\n scheduler.getServiceMetrics().containersFailed.incr();\n\n if (status != null && Apps.shouldCountTowardsNodeBlacklisting(\n status.getExitStatus())) {\n String host = scheduler.getLiveInstances().get(status.getContainerId())\n .getNodeId().getHost();\n failureTracker.incNodeFailure(host);\n currentContainerFailure.getAndIncrement();\n }\n }", "@Override\r\n\tpublic int update() throws Exception {\n\t\treturn 0;\r\n\t}", "public void createCounters() {\n // COUNTERS CREATION //\n //create a new counter for the blocks.\n this.blockCounter = new Counter();\n //create a new counter for the blocks.\n this.ballCounter = new Counter();\n }", "@Override\n public void onResourcesChanged(int resources) {\n }", "public synchronized void tally(CrawlURI curi, Stage stage) {\n switch(stage) {\n case SCHEDULED:\n totalScheduled++;\n break;\n case RETRIED:\n if(curi.getFetchStatus()<=0) {\n fetchNonResponses++;\n }\n break;\n case SUCCEEDED:\n fetchSuccesses++;\n fetchResponses++;\n totalBytes += curi.getContentSize();\n successBytes += curi.getContentSize();\n \n if (curi.getFetchStatus() == HttpStatus.SC_NOT_MODIFIED) {\n notModifiedBytes += curi.getContentSize();\n notModifiedUrls++;\n } else if (IdenticalDigestDecideRule.hasIdenticalDigest(curi)) {\n dupByHashBytes += curi.getContentSize();\n dupByHashUrls++;\n } else if (curi.getAnnotations().contains(\"warcRevisit:uriAgnosticDigest\")) {\n dupByHashBytes += curi.getContentSize();\n dupByHashUrls++;\n } else {\n novelBytes += curi.getContentSize();\n novelUrls++;\n } \n \n lastSuccessTime = curi.getFetchCompletedTime();\n break;\n case DISREGARDED:\n fetchDisregards++;\n if(curi.getFetchStatus()==S_ROBOTS_PRECLUDED) {\n robotsDenials++;\n }\n break;\n case FAILED:\n if(curi.getFetchStatus()<=0) {\n fetchNonResponses++;\n } else {\n fetchResponses++;\n totalBytes += curi.getContentSize();\n \n if (curi.getFetchStatus() == HttpStatus.SC_NOT_MODIFIED) { \n notModifiedBytes += curi.getContentSize();\n notModifiedUrls++;\n } else if (IdenticalDigestDecideRule.\n hasIdenticalDigest(curi)) {\n dupByHashBytes += curi.getContentSize();\n dupByHashUrls++;\n } else {\n novelBytes += curi.getContentSize();\n novelUrls++;\n } \n \n }\n fetchFailures++;\n break;\n }\n }", "public void incrementNumExtendedRequests() {\n this.numExtendedRequests.incrementAndGet();\n }", "public void setResource(int newResource) throws java.rmi.RemoteException;", "public void incrementNumModifyDNRequests() {\n this.numModifyDNRequests.incrementAndGet();\n }", "public void incrementNumCompareRequests() {\n this.numCompareRequests.incrementAndGet();\n }", "public void increaseCourseCount(){}", "public void changeCount(final int c) {\n\t\tcount += c;\n\t}", "private void updateCounts() {\n // Update connected components count\n ((Labeled) ((HBox) statsBox.getChildren().get(1)).getChildren().get(1))\n .setText(String.valueOf(socialNetwork.getConnectedComponents().size()));\n // Update total users count\n ((Labeled) ((HBox) statsBox.getChildren().get(2)).getChildren().get(1))\n .setText(String.valueOf(socialNetwork.getTotalUsers()));\n // Update total friends count\n ((Labeled) ((HBox) statsBox.getChildren().get(3)).getChildren().get(1))\n .setText(String.valueOf(socialNetwork.getTotalFriends()));\n // Update active user's name and friend count\n if (activeUser == null) {\n ((Labeled) ((HBox) statsBox.getChildren().get(4)).getChildren().get(0))\n .setText(\"User's Total Friends: \");\n ((Labeled) ((HBox) statsBox.getChildren().get(4)).getChildren().get(1)).setText(\"\");\n } else {\n ((Labeled) ((HBox) statsBox.getChildren().get(4)).getChildren().get(0))\n .setText(activeUser.getName() + \"'s Total Friends: \");\n ((Labeled) ((HBox) statsBox.getChildren().get(4)).getChildren().get(1))\n .setText(String.valueOf(activeUser.getFriends().size()));\n }\n }", "private void updateCounter(int currentQuestionNumber){\n\t\tString labelText = \"Question: \" + currentQuestionNumber + \" / \" + maxNumQuestions;\n\t\tJLabel label = new JLabel(\"<HTML><div align=\\\"right\\\">\" + labelText + \"</div><HTML>\");\n\t\tlabel.setForeground(Color.BLACK);\n\t\tlabel.setFont(counterFont);\n\t\tlabel.setAlignmentX(Component.RIGHT_ALIGNMENT);\n\t\tint xOrigin = ((questionCounter.getSize().width - label.getPreferredSize().width) / 2);\n\t\tint yOrigin = ((questionCounter.getSize().height - label.getPreferredSize().height) / 2);\n\t\tquestionCounter.removeAll();\n\t\tquestionCounter.addComponent(label, xOrigin, yOrigin);\n\t\tquestionCounter.reDraw();\n\t}", "public int updateByPK(Resourcesvalue record){\n \tif(record==null||record.getRescvalueid()==null)\n \t\treturn 0;\n\t\tint rows = super.update(\"Resourcesvalue.updateByPK\", record);\n\t\treturn rows;\n }", "@Override\n\tpublic void count() {\n\t\t\n\t}", "public void updateCounts() {\n\n Map<Feel, Integer> counts_of = new HashMap<>();\n\n for (Feel feeling : Feel.values()) {\n counts_of.put(feeling, 0);\n }\n\n for (FeelingRecord record : this.records) {\n counts_of.put(record.getFeeling(), counts_of.get(record.getFeeling()) + 1);\n }\n\n this.angry_count.setText(\"Anger: \" + counts_of.get(Feel.ANGER).toString());\n this.fear_count.setText(\"Fear: \" + counts_of.get(Feel.FEAR).toString());\n this.joyful_count.setText(\"Joy: \" + counts_of.get(Feel.JOY).toString());\n this.love_count.setText(\"Love: \" + counts_of.get(Feel.LOVE).toString());\n this.sad_count.setText(\"Sad:\" + counts_of.get(Feel.SADNESS).toString());\n this.suprise_count.setText(\"Suprise: \" + counts_of.get(Feel.SURPRISE).toString());\n }", "public void addCount()\n {\n \tcount++;\n }", "public void incrementRefusals() {\n\t}", "void onUpdate(long diskUsageSample);", "void recount();", "void setAccessCounter(int cnt);", "private void updateCpuStats() {\n\t\tmNumStatsUpdated = 0;\n\t\tList<String> stats = ShellHelper.getProc(CPU_STAT_PROC);\n\t\tif (stats == null || stats.isEmpty()) return;\n\t\t\n\t\tString[] parts = null;\n\t\tString line = null;\n\t\tfor (int i = 0; i < stats.size(); ++i) {\n\t\t\tline = stats.get(i);\n\t\t\tif (line.startsWith(\"cpu\")) { //TODO if 0% usage the cpu is omitted\n\t\t\t\tparts = line.split(\"\\\\s+\");\t\t\t\t\n\t\t\t\tif (parts[0].endsWith(String.valueOf(i - 1))) {\n\t\t\t\t\tif (mLogicalCpus.size() >= i &&\n\t\t\t\t\t\t\tmLogicalCpus.get(i - 1).getCpuStat().update(parts)) {\t\t\t\t\t\n\t\t\t\t\t\t++mNumStatsUpdated;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (mCpuStat.update(parts)) {\n\t\t\t\t\t++mNumStatsUpdated;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void incrRefCounter() {\n\t\tthis.refCounter++;\n\t}", "public void increasecounter() {\n\t\tmPref.edit().putInt(PREF_CONVERTED, counter + 1).commit();\r\n\t}", "private void updateNumberOfConnections(int delta)\n\t{\n\t\tint count = numberOfConnections.addAndGet(delta);\t\t\n\t\tLOG.debug(\"Active connections count = {}\", count);\n\t}", "private void incrementCounters() {\n // update score by 5 every second\n ++scoreTimer;\n if (scoreTimer > scoreInterval) {\n score += 5;\n scoreTimer = 0;\n }\n\n // update speed by 100% every second\n ++speedTimer;\n if (speedTimer > speedInterval) {\n currentSpeed *= speedFactor;\n ++gameLevel;\n speedTimer = 0;\n }\n\n // increment rock timer (we create a new rock every 2 seconds)\n ++rockTimer;\n }", "private void updateStatsCAE(){\n\t\tupdateQueueSize();\n\t}", "public final void setPendingCount(int paramInt)\n/* */ {\n/* 517 */ this.pending = paramInt;\n/* */ }" ]
[ "0.6657983", "0.6651649", "0.6484497", "0.64453566", "0.64173037", "0.5984122", "0.5981027", "0.5961253", "0.59451073", "0.5892365", "0.5883167", "0.58618265", "0.5820195", "0.5818474", "0.5786116", "0.5769103", "0.5765238", "0.5747957", "0.5737181", "0.5715037", "0.5712374", "0.5697771", "0.56943434", "0.5687915", "0.5679885", "0.5668793", "0.5641912", "0.5641792", "0.5634184", "0.5633752", "0.5615988", "0.5605768", "0.5604127", "0.55858046", "0.55735224", "0.5537682", "0.5529999", "0.55110544", "0.55110544", "0.5505239", "0.54913026", "0.54851896", "0.5475417", "0.54726267", "0.5458284", "0.5451539", "0.54362166", "0.5427556", "0.5423534", "0.5420547", "0.5415054", "0.54072607", "0.5398005", "0.53909063", "0.53822595", "0.53782314", "0.53744847", "0.53731334", "0.5372601", "0.53703725", "0.5364162", "0.5350879", "0.53405935", "0.5332928", "0.5325601", "0.5315823", "0.53154796", "0.5308869", "0.5302864", "0.52847433", "0.52838063", "0.52812135", "0.5275859", "0.5274889", "0.52743983", "0.5273529", "0.5265414", "0.5258683", "0.52583873", "0.5249837", "0.5249279", "0.5242068", "0.52315325", "0.52296764", "0.52275777", "0.5223451", "0.5222777", "0.52182066", "0.5216206", "0.5214009", "0.5213032", "0.5207275", "0.52068585", "0.52059025", "0.5198748", "0.51888955", "0.5182841", "0.5176587", "0.5175289", "0.51722366" ]
0.72976387
0
Created by Long on 10/5/2016.
public interface ResumeHolderFactory { BaseViewHolder createHolder(int type, View view); int getType(RepoVM repoVM); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "public final void mo51373a() {\n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "private stendhal() {\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "public void mo38117a() {\n }", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "private void m50366E() {\n }", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\n public int describeContents() { return 0; }", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n public void init() {\n\n }", "protected boolean func_70814_o() { return true; }", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n protected void initialize() {\n\n \n }", "@Override\n public void init() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "private void poetries() {\n\n\t}", "@Override\n public int retroceder() {\n return 0;\n }", "@Override\n void init() {\n }", "@Override\n protected void initialize() \n {\n \n }", "@Override\n public void init() {}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void init() {}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\n protected void init() {\n }", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "public void mo12930a() {\n }", "@Override\n public int getSize() {\n return 1;\n }", "public void mo21877s() {\n }", "public void mo12628c() {\n }", "public void m23075a() {\n }", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "public final void mo91715d() {\n }", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void mo6081a() {\n }", "protected MetadataUGWD() {/* intentionally empty block */}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\n\tpublic int mettreAJour() {\n\t\treturn 0;\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "public void mo21779D() {\n }", "private Rekenhulp()\n\t{\n\t}", "public void method_4270() {}", "@Override public int describeContents() { return 0; }", "private MetallicityUtils() {\n\t\t\n\t}", "public void mo55254a() {\n }", "private void init() {\n\n\t}", "private void kk12() {\n\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\n public void memoria() {\n \n }", "@Override\n\tpublic void init() {\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n public void initialize() { \n }", "@Override\n\tpublic void nghe() {\n\n\t}" ]
[ "0.5990709", "0.59514517", "0.5778579", "0.57671875", "0.57384014", "0.57275265", "0.57106656", "0.5698785", "0.5698785", "0.5684802", "0.56297714", "0.56283534", "0.560129", "0.5566152", "0.5556229", "0.55524737", "0.5547621", "0.55363566", "0.5528607", "0.5526256", "0.55213547", "0.5521084", "0.55075216", "0.55027544", "0.5490926", "0.54879344", "0.54870003", "0.54792345", "0.54792345", "0.54792345", "0.54792345", "0.54792345", "0.5454365", "0.5454365", "0.545409", "0.545409", "0.545409", "0.545409", "0.545409", "0.545409", "0.545409", "0.5449976", "0.5447614", "0.54436874", "0.54436874", "0.54436874", "0.54436874", "0.54436874", "0.54436874", "0.54291296", "0.54263866", "0.5415326", "0.5414743", "0.5407786", "0.54008305", "0.53976244", "0.5394654", "0.53908694", "0.53774387", "0.5376783", "0.5368271", "0.5368264", "0.53673995", "0.5363077", "0.5352301", "0.5351067", "0.5350424", "0.5349909", "0.5347227", "0.5347227", "0.5347227", "0.534452", "0.534452", "0.53435093", "0.5343257", "0.5343257", "0.5343257", "0.53398097", "0.5334258", "0.53307474", "0.5325262", "0.5325262", "0.5325262", "0.53196555", "0.53092796", "0.53092796", "0.53054655", "0.53006554", "0.52997637", "0.5297203", "0.52963424", "0.52915025", "0.5289677", "0.52872616", "0.5282596", "0.5282471", "0.5280682", "0.52773064", "0.527704", "0.52753484", "0.527341" ]
0.0
-1
private dS = PixShooter.downScale();
public DebugOverlay(SpriteBatch sb) { viewport = new FitViewport(PixClient.V_WIDTH, PixClient.V_HEIGHT, new OrthographicCamera()); labels = new Label[labelCount]; stage = new Stage(viewport, sb); Table table = new Table(); table.bottom().right(); table.setHeight(300); table.setWidth(200); table.setPosition(Gdx.graphics.getWidth() - table.getWidth(), 0); for(int i = 0; i < labelCount; i++) { labels[i] = new Label("", new Label.LabelStyle(new BitmapFont(), Color.WHITE)); table.add(labels[i]).right(); table.row(); } Pixmap pixmap = new Pixmap(1, 1, Pixmap.Format.RGBA8888); pixmap.setColor(0, 0, 0, 0.75f); pixmap.fill(); table.setBackground(new TextureRegionDrawable(new TextureRegion(new Texture(pixmap) ) ) ); stage.addActor(table); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private ScaleEntityDownAction(){\r\n\t\tscaleFactor = 0.1f;\r\n\t}", "public double getScaleY() { return _rss==null? 1 : _rss.scaleY; }", "int getScale();", "public int getScale(){\n return scale;\n }", "public void updateScale()\n {\n // get scale from world presenter\n s2 = (cam.getScale());\n //Convert to English Miles if appropriate\n if( !SettingsScreen.getUnits() ) s2 *= 0.60934;\n s1 = s2/2;\n repaint();\n }", "public int getScale() {\n return scale_;\n }", "public void up() {dy = -SPEED;}", "public void rescale()\r\n\t{\n\t}", "public float spiderScaleAmount()\n {\nreturn 1F;\n }", "public double getScale() {\n return scale;\n }", "public void scaleAnimetion(SpriteBatch batch){\n }", "public int getDmg(){\r\n return enemyDmg;\r\n }", "public int getScale() {\r\n return scale;\r\n }", "public Image getSemiquaverDown();", "public double getScaleY() {\n return 1.0;\n }", "public void onShutter() {\n \n }", "void draw() {\n scsw.draw();\n \n}", "public float getScale();", "public final float getScale() {\n\treturn svd(null);\n }", "public void changeSpeedD() {\n speedX *= -1;\n }", "public interface ScalingUtils$StatefulScaleType {\n Object m21594a();\n}", "public double getScale(){\n\t\treturn scale;\n\t}", "@Override public void update(float dt)\n\t{\n\t\tthis.setScale((this.getScale().getX() + 0.1f) * 0.99f, (this.getScale().getY() + 0.1f) * 0.99f);\n\n\n\t}", "public Scale getScale() {\n return this.scale;\n }", "public double getScaleX() { return _rss==null? 1 : _rss.scaleX; }", "static int getVelocity(){return currentVelocity;}", "public double getScale() {\r\n return scale;\r\n }", "public Integer getScale() {\n return _scale;\n }", "public Integer getScale() {\n return _scale;\n }", "int getWrongScale();", "ScaleType getScale();", "public float getDscale() {\r\n\t\treturn dscale;\r\n\t}", "@Override\n public void onShutter() {\n }", "public double getScale() {\n return scale;\n }", "float getScaler();", "public double getScale() {\n return this.scale;\n }", "public void resetDX(){dx = 0;}", "public float xScreen2Data(float x);", "float distTo(Sprite s) {\n return dist(_x, _y, s._x, s._y);\n }", "public float getScale() {\n \t\treturn scale;\n \t}", "public void onUpReleased(){\n// player.getSprite().setFitHeight(50);\n shipSoundPlayer.stop();\n if(GameEngine.isPlaying)\n player.setSprite(\"Sprites\\\\spaceship_new.png\");\n }", "public Image getQuaverDown();", "public Shooter() {\n servo.set(ShooterConstants.Servo_Down);\n \n \n }", "public float getSizeY(){return sy;}", "private Float scale(Float datapoint){\n\n float range = (float)(20 * (max / Math.log(max)));\n range-=min;\n float scalar = DisplayImage.IMAGE_SIZE_SCALAR / range;\n\n if(nightMode){\n datapoint = (float) (100 * (datapoint / Math.log(datapoint)));\n datapoint *= scalar*5;\n }else {\n datapoint = (float) (20* (datapoint / Math.log(datapoint)));\n datapoint *= scalar;\n }\n\n return datapoint;\n }", "public Vector2 getDrawScale() {\n \tscaleCache.set(drawScale);\n \treturn scaleCache; \n }", "@Override\n public void onShutter() {\n }", "public void onShutter() {\n }", "public boolean hasScale() { return hasScale; }", "@Override\n\t\tpublic void onShutter() {\n\n\t\t}", "public void scale(double s);", "void onShutter();", "public double getScale() {\n\t\treturn 0;\n\t}", "public void death(){\n setCoordinate(super.getGameImage().getCoordInit());\n diminueVies();\n super.initAnimation();\n\n }", "public void setScaleY(double aValue)\n{\n if(aValue==getScaleY()) return;\n repaint();\n firePropertyChange(\"ScaleY\", getRSS().scaleY, getRSS().scaleY = aValue, -1);\n}", "public void setScale(double s){\n\t\tsetParameters(location, s);\n\t}", "public Image getMinimDown();", "private void setScale() {\n this.particleScale = (1 - ((float) slowTime / 50)) * (1.5f * (float) offset);\n }", "void Death(){\r\n if (vie==0){\r\n this.plateau[this.x][this.y]='0';\r\n }\r\n }", "public int getScaleValue() {\r\n return ScaleValue;\r\n }", "public double getScale(\n )\n {return scale;}", "@Override\r\n\tpublic void render(float delta) {\n\t\tGdx.gl.glClearColor(0.3f, 0.3f, 0.3f, 1);\r\n\t\tGdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);\r\n\t\tsokoban.batch.begin();\r\n\t\tsokoban.batch.draw(SplashScreen.loader.loadLevelsImage(), 0, 0, Gdx.graphics.getWidth(),\r\n\t\t\t\tGdx.graphics.getHeight());\r\n\r\n\t\tsokoban.batch.end();\r\n\r\n\t\tif (Gdx.input.isButtonPressed(Input.Buttons.LEFT) && Gdx.input.getX() > 15 && Gdx.input.getX() < 115\r\n\t\t\t\t&& Gdx.input.getY() > 487 && Gdx.input.getY() < 587)\r\n\t\t\tsokoban.swap(2); // Tasto UNDO\r\n\r\n\t\tif (Gdx.input.justTouched() && Gdx.input.getX() > 144 && Gdx.input.getX() < 294\r\n\t\t\t\t&& Gdx.input.getY() > 49 && Gdx.input.getY() < 199)\r\n\t\t\t{\r\n\t\t\t\tsokoban.setLivelloScelto(1);\r\n\t\t\t\tsokoban.swap(1);\r\n\t\t\t}\r\n\r\n\t\tif (Gdx.input.justTouched() && Gdx.input.getX() > 326 && Gdx.input.getX() < 476\r\n\t\t\t\t&& Gdx.input.getY() > 49 && Gdx.input.getY() < 199)\r\n\t\t{\r\n\t\t\tsokoban.setLivelloScelto(2);\r\n\t\t\tsokoban.swap(1);\r\n\t\t}\r\n\t\t\r\n\t\tif (Gdx.input.justTouched() && Gdx.input.getX() > 506 && Gdx.input.getX() < 656\r\n\t\t\t\t&& Gdx.input.getY() > 49 && Gdx.input.getY() < 199)\r\n\t\t{\r\n\t\t\tsokoban.setLivelloScelto(3);\r\n\t\t\tsokoban.swap(1);\r\n\t\t}\r\n\r\n\t\tif (Gdx.input.justTouched() && Gdx.input.getX() > 144 && Gdx.input.getX() < 294\r\n\t\t\t\t&& Gdx.input.getY() > 225 && Gdx.input.getY() < 375)\r\n\t\t{\r\n\t\t\tsokoban.setLivelloScelto(4);\r\n\t\t\tsokoban.swap(1);\r\n\t\t}\r\n\r\n\t\tif (Gdx.input.justTouched() && Gdx.input.getX() > 326 && Gdx.input.getX() < 476\r\n\t\t\t\t&& Gdx.input.getY() > 225 && Gdx.input.getY() < 375)\r\n\t\t{\r\n\t\t\tsokoban.setLivelloScelto(5);\r\n\t\t\tsokoban.swap(1);\r\n\t\t}\r\n\r\n\t\tif (Gdx.input.justTouched() && Gdx.input.getX() > 506 && Gdx.input.getX() < 656\r\n\t\t\t\t&& Gdx.input.getY() > 225 && Gdx.input.getY() < 375)\r\n\t\t{\r\n\t\t\tsokoban.setLivelloScelto(6);\r\n\t\t\tsokoban.swap(1);\r\n\t\t}\r\n\r\n\t\tif (Gdx.input.justTouched() && Gdx.input.getX() > 144 && Gdx.input.getX() < 294\r\n\t\t\t\t&& Gdx.input.getY() > 401 && Gdx.input.getY() < 551)\r\n\t\t{\r\n\t\t\tsokoban.setLivelloScelto(7);\r\n\t\t\tsokoban.swap(1);\r\n\t\t}\r\n\r\n\t\tif (Gdx.input.justTouched() && Gdx.input.getX() > 326 && Gdx.input.getX() < 476\r\n\t\t\t\t&& Gdx.input.getY() > 401 && Gdx.input.getY() < 551)\r\n\t\t{\r\n\t\t\tsokoban.setLivelloScelto(8);\r\n\t\t\tsokoban.swap(1);\r\n\t\t}\r\n\r\n\t\tif (Gdx.input.justTouched() && Gdx.input.getX() > 506 && Gdx.input.getX() < 656\r\n\t\t\t\t&& Gdx.input.getY() > 401 && Gdx.input.getY() < 551)\r\n\t\t{\r\n\t\t\tsokoban.setLivelloScelto(9);\r\n\t\t\tsokoban.swap(1);\r\n\t\t}\r\n\r\n\t}", "public float getScale()\n\t{\n\t\treturn scale;\n\t}", "private void updateImageScale() {\r\n\t\t//Check which dimension is larger and store it in this variable.\r\n\t\tint numHexLargestDimension = this.numHexRow;\r\n\t\tif (this.totalHexWidth > this.totalHexHeight) {\r\n\t\t\tnumHexLargestDimension = this.numHexCol;\r\n\t\t}\r\n\t\t\r\n\t\tif (numHexLargestDimension < 35) {\r\n\t\t\tif (this.zoomer.getZoomScale() * (this.numHexCol / 2) > 16.5) {\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.LARGE;\r\n\t\t\t} else if (this.zoomer.getZoomScale() * (this.numHexCol / 2) > 7){\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.MEDIUM;\r\n\t\t\t} else {\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.SMALL;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (numHexLargestDimension < 70) {\r\n\t\t\tif (this.zoomer.getZoomScale() * (this.numHexCol / 2) > 22.2) {\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.LARGE;\r\n\t\t\t} else if (this.zoomer.getZoomScale() \r\n\t\t\t\t\t* (this.numHexCol / 2) > 14.5){\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.MEDIUM;\r\n\t\t\t} else {\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.SMALL;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (numHexLargestDimension < 105) {\r\n\t\t\tif (this.zoomer.getZoomScale() * (this.numHexCol / 2) > 32.6) {\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.LARGE;\r\n\t\t\t} else if (this.zoomer.getZoomScale() * (this.numHexCol / 2) > 21){\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.MEDIUM;\r\n\t\t\t} else {\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.SMALL;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (this.zoomer.getZoomScale() * (this.numHexCol / 2) > 44.4) {\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.LARGE;\r\n\t\t\t} else if (this.zoomer.getZoomScale() * (this.numHexCol / 2) > 28){\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.MEDIUM;\r\n\t\t\t} else {\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.SMALL;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n public float getScale() {\n return scale;\n }", "@Override\n\tpublic double getMountedYOffset() {\n\t\treturn (isSitting() ? 1.7f : 2.2f) * getScale();\n\t}", "protected void func_77041_b(EntityLivingBase par1EntityLiving, float par2)\n/* */ {\n/* 87 */ scaleSpider((EntityTaintSpider)par1EntityLiving, par2);\n/* */ }", "public ImageScale getScale() {\n return this.scale;\n }", "private double scaleValue(double input) {\n if(type == SIMPLE_SIN2D_IN_X || type == SIMPLE_SIN2D_IN_Y || type == SIMPLE_MULT2D) {\n // SINE = -1 to 1\n // SCALE to 0 to 255\n // (SINE + 1) * 128\n return (input + 1) * (255.0 / 2.0);\n }\n if(type == SIMPLE_PLUS2D)\n {\n return (input + 2) * (255.0 / 4.0);\n }\n else\n return 0;\n }", "public void swim() {\r\n\t\tif(super.getPosition()[0] == Ocean.getInstance().getWidth()-71){\r\n\t\t\tinvX = true;\r\n\t\t} else if(super.getPosition()[0] == 0){\r\n\t\t\tinvX = false;\r\n\t\t}\r\n\t\tif(super.getPosition()[1] == Ocean.getInstance().getDepth()-71){\r\n\t\t\tinvY = true;\r\n\t\t} else if(super.getPosition()[1] == 0){\r\n\t\t\tinvY = false;\r\n\t\t}\r\n\t\tif(invX){\r\n\t\t\tsuper.getPosition()[0]-=1;\r\n\t\t} else {\r\n\t\t\tsuper.getPosition()[0]+=1;\r\n\t\t}\r\n\t\tif(invY){\r\n\t\t\tsuper.getPosition()[1]-=1;\r\n\t\t} else {\r\n\t\t\tsuper.getPosition()[1]+=1;\r\n\t\t}\r\n\t}", "public Vector330Class scale(double s){\n return new Vector330Class(this.x * s, this.y * s);\n }", "public float getScale() {\n return this.scale;\n }", "public double getScale() {\r\n\t\treturn scale;\r\n\t}", "float getD();", "public Shooter() {\n fire1 = new Solenoid(1);\n fire2 = new Solenoid(4);\n returnValve = new Solenoid(3);\n latchSolenoid = new Solenoid(2);\n FFM = true;\n m_enabled = true;\n shooting = false;\n reloading = false;\n initShooter();\n }", "public void setScale(float scale);", "public void scale(double sx, double sy)\r\n\t{\r\n\t\t// System.out.println(\"scale\");\r\n\t}", "private class <init> extends android.view.ScaleGestureListener\n{\n\n final TouchImageView this$0;\n\n public boolean onScale(ScaleGestureDetector scalegesturedetector)\n {\n TouchImageView.access$20(TouchImageView.this, scalegesturedetector.getScaleFactor(), scalegesturedetector.getFocusX(), scalegesturedetector.getFocusY(), true);\n if (TouchImageView.access$19(TouchImageView.this) != null)\n {\n TouchImageView.access$19(TouchImageView.this).onMove();\n }\n return true;\n }", "int getD();", "public double getScale() {\n\t\treturn disp.getScale();\n\t}", "public void setSd(double sd) {\n this.sd = sd;\n }", "private int getScale(){\n Display display = ((WindowManager) Objects.requireNonNull(getContext())\n .getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();\n\n int width = display.getWidth();\n Double val = (double) width / 360d;\n val = val * 100d;\n return val.intValue();\n }", "private void updateScale() {\n target.setScaleX(scaleValue);\n target.setScaleY(scaleValue);\n }", "void initScale(){\n samplingScale = getScaleAdaptive(x);\n }", "public float getGlobalScale() {\n // per convenzione se la scala deve essere su tutti e tre gli assi\n // allora si considera scale.x() per tutti gli assi\n return (float) scale.x();\n }", "public double getSd() {\n return sd;\n }", "public Point2F scale(float s)\r\n {return new Point2F(x*s, y*s);}", "public void shoot() {\n\r\n switch (shootstate) {\r\n case down:\r\n tempbutton = Components.shootsinglespeed;\r\n templimit = islimitshooterup();\r\n\r\n if (Components.shootsinglespeed && islimitshooterup() && Components.DownPickupLimit.get()) {\r\n try {\r\n Components.shootermotorleft.setX(singlespeed);\r\n Components.shootermotorleft2.setX(singlespeed);\r\n Components.shootermotorright.setX(-singlespeed);\r\n Components.shootermotorright2.setX(-singlespeed);\r\n\r\n } catch (CANTimeoutException ex) {\r\n ex.printStackTrace();\r\n\r\n }\r\n shootpothigh = shootsinglepot;\r\n shootstate = movingup;\r\n } else if (Components.trusshp == true && islimitshooterup() == true && Components.DownPickupLimit.get()) {\r\n try {\r\n Components.shootermotorleft.setX(trusshpspeed);\r\n Components.shootermotorleft2.setX(trusshpspeed);\r\n Components.shootermotorright.setX(-trusshpspeed);\r\n Components.shootermotorright2.setX(-trusshpspeed);\r\n } catch (CANTimeoutException ex) {\r\n ex.printStackTrace();\r\n }\r\n shootpothigh = trusshppothigh;\r\n shootstate = movingup;\r\n }else if (Components.truss == true && islimitshooterup() == true && Components.DownPickupLimit.get()) {\r\n try {\r\n Components.shootermotorleft.setX(trussspeed);\r\n Components.shootermotorleft2.setX(trussspeed);\r\n Components.shootermotorright.setX(-trussspeed);\r\n Components.shootermotorright2.setX(-trussspeed);\r\n } catch (CANTimeoutException ex) {\r\n ex.printStackTrace();\r\n }\r\n shootpothigh = trusspothigh;\r\n shootstate = movingup;\r\n } else if (Components.pass == true && islimitshooterup() == true && Components.DownPickupLimit.get()) {\r\n try {\r\n Components.shootermotorleft.setX(passspeed);\r\n Components.shootermotorleft2.setX(passspeed);\r\n Components.shootermotorright.setX(-passspeed);\r\n Components.shootermotorright2.setX(-passspeed);\r\n } catch (CANTimeoutException ex) {\r\n ex.printStackTrace();\r\n }\r\n shootpothigh = passpot;\r\n shootstate = movingup;\r\n } else if (Components.longdistanceshoot == true && islimitshooterup() == true && Components.DownPickupLimit.get()) {\r\n try {\r\n Components.shootermotorleft.setX(longdistancespeed);\r\n Components.shootermotorleft2.setX(longdistancespeed);\r\n Components.shootermotorright.setX(-longdistancespeed);\r\n Components.shootermotorright2.setX(-longdistancespeed);\r\n } catch (CANTimeoutException ex) {\r\n ex.printStackTrace();\r\n }\r\n shootpothigh = longdistancepot;\r\n shootstate = movingup;\r\n }\r\n else if (Components.shoot == true && islimitshooterup() == true && Components.DownPickupLimit.get()) {\r\n try {\r\n Components.shootermotorleft.setX(shooterspeed);\r\n Components.shootermotorleft2.setX(shooterspeed);\r\n Components.shootermotorright.setX(-shooterspeed);\r\n Components.shootermotorright2.setX(-shooterspeed);\r\n } catch (CANTimeoutException ex) {\r\n ex.printStackTrace();\r\n }\r\n shootpothigh = shootpot;\r\n shootstate = movingup;\r\n }else if (Components.slowmovingshoot == true && islimitshooterup() == true && Components.DownPickupLimit.get()) {\r\n try {\r\n Components.shootermotorleft.setX(slowmovingspeed);\r\n Components.shootermotorleft2.setX(slowmovingspeed);\r\n Components.shootermotorright.setX(-slowmovingspeed);\r\n Components.shootermotorright2.setX(-slowmovingspeed);\r\n } catch (CANTimeoutException ex) {\r\n ex.printStackTrace();\r\n }\r\n slowmovingpot = shootpot;\r\n shootstate = movingup;\r\n }\r\n else if (Components.fastmovingshoot == true && islimitshooterup() == true && Components.DownPickupLimit.get()) {\r\n try {\r\n Components.shootermotorleft.setX(fastmovingspeed);\r\n Components.shootermotorleft2.setX(fastmovingspeed);\r\n Components.shootermotorright.setX(-fastmovingspeed);\r\n Components.shootermotorright2.setX(-fastmovingspeed);\r\n } catch (CANTimeoutException ex) {\r\n ex.printStackTrace();\r\n }\r\n fastmovingpot = shootpot;\r\n\r\n }\r\n case movingup:\r\n if (islimitshooterup() == false || Components.potvalue >= shootpothigh) {\r\n shootstate = stopped;\r\n oldTime = DS.getMatchTime();\r\n try {\r\n Components.shootermotorleft.setX(0);\r\n Components.shootermotorleft2.setX(0);\r\n } catch (CANTimeoutException ex) {\r\n ex.printStackTrace();\r\n }\r\n try {\r\n Components.shootermotorright.setX(0);\r\n Components.shootermotorright2.setX(0);\r\n } catch (CANTimeoutException ex) {\r\n ex.printStackTrace();\r\n }\r\n }\r\n break;\r\n\r\n case stopped:\r\n try {\r\n if (/*Components.shooterdown && */time - oldTime > .2 && islimitshooterdown() == true && Components.DownPickupLimit.get()) {\r\n\r\n Components.shootermotorleft.setX(shootdownspeed);\r\n Components.shootermotorleft2.setX(shootdownspeed);\r\n\r\n Components.shootermotorright.setX(-shootdownspeed);\r\n Components.shootermotorright2.setX(-shootdownspeed);\r\n\r\n shootstate = movingdown;\r\n }\r\n } catch (CANTimeoutException ex) {\r\n ex.printStackTrace();\r\n }\r\n break;\r\n\r\n case movingdown:\r\n if ((islimitshooterdown() == false) || (Components.potvalue < shootpotdown)) {\r\n\r\n try {\r\n Components.shootermotorleft.setX(0);\r\n Components.shootermotorleft2.setX(0);\r\n } catch (CANTimeoutException ex) {\r\n ex.printStackTrace();\r\n }\r\n try {\r\n Components.shootermotorright.setX(0);\r\n Components.shootermotorright2.setX(0);\r\n } catch (CANTimeoutException ex) {\r\n ex.printStackTrace();\r\n }\r\n shootstate = down;\r\n }\r\n }\r\n }", "void object_calculations_touch_ground(){\n\n if (down_angle < 0 && up_angle > 0)//base case\n {\n double temp = up_angle;\n up_angle = down_angle;\n down_angle = temp;\n base_case();\n } else if ((down_angle > 0 && up_angle > 0) && (down_angle < up_angle))//smaller object\n {\n double temp = up_angle;\n up_angle = down_angle;\n down_angle = temp;\n measure_small_object();\n } else if (up_angle < 0 && down_angle > 0)//base case\n base_case();\n else //smaller object\n measure_small_object();\n }", "public float yScreen2Data(float y);", "double motor_y () { return strut.span + DRIVING_FORCE_HEIGHT; }", "public Integer getScdx() {\n return scdx;\n }", "void setScale(ScaleSelector sensor, int scaleNo);", "public void skystonePos2() {\n }", "void sharpen();", "void sharpen();", "public int getDY(){\n \treturn dy;\n }", "public int getTempDmg(){\r\n return tDmg;\r\n }", "public void go_to_scale_position() {\n stop_hold_arm();\n Dispatcher.get_instance().add_job(new JMoveArm(RobotMap.Arm.pot_value_scale, 0.9, 0.7, 0.7, 0.2, 0.8, false, false));\n hold_arm();\n }", "private float getScale(Entity entity) {\n \tif (entity instanceof EntityPlayer) {\n \t\t//return ???\n \t}\n \treturn isChild ? 2 : 1;\n }", "public int getHeightScreen(){\n return heightScreen ;\n }" ]
[ "0.64877874", "0.6306889", "0.6135062", "0.608738", "0.5968652", "0.5923094", "0.5921222", "0.590204", "0.5897427", "0.58567995", "0.58197933", "0.57783026", "0.5726461", "0.57256436", "0.5702567", "0.5697677", "0.56770223", "0.5674809", "0.5667699", "0.56655115", "0.5654143", "0.56525713", "0.5651194", "0.5643142", "0.5615756", "0.56082845", "0.56056356", "0.56034106", "0.56034106", "0.56002456", "0.55969924", "0.5594951", "0.5574341", "0.5574175", "0.557201", "0.5564118", "0.5553339", "0.55441093", "0.5542264", "0.55306035", "0.5516432", "0.5516387", "0.55107087", "0.54947233", "0.54856366", "0.5483314", "0.547936", "0.5474571", "0.5467796", "0.54628056", "0.54598063", "0.5459466", "0.54573834", "0.5452624", "0.54489803", "0.5445453", "0.5441435", "0.54399425", "0.54363656", "0.5434905", "0.5428527", "0.542047", "0.5419305", "0.54182756", "0.541294", "0.54023814", "0.5399734", "0.5390007", "0.5388954", "0.5382438", "0.53808856", "0.53791463", "0.53790385", "0.5375363", "0.53682035", "0.53649366", "0.53640723", "0.5359091", "0.5358742", "0.5358123", "0.5355554", "0.53522885", "0.5349393", "0.53464955", "0.5343976", "0.53438425", "0.5340008", "0.5339766", "0.5339395", "0.5338622", "0.5338135", "0.5335663", "0.5334525", "0.5326904", "0.53224397", "0.53224397", "0.53183997", "0.53138334", "0.5313684", "0.53122663", "0.531189" ]
0.0
-1
/ Copy constructor (deep copy)
public WGraph_DS(WGraph_DS other) { nodes = new HashMap<>(); for(node_info n: other.getNodes().values()) { this.getNodes().put(n.getKey(), n); } this.edge_size = other.edge_size; this.mc = other.mc; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void copyConstructor(){\n\t}", "Prototype makeCopy();", "Component deepClone();", "public T cloneDeep();", "public Clone() {}", "Object clone();", "Object clone();", "protected Factorization copy(){\n Factorization newFactor = new Factorization(this.mdc);\n //shallow copy\n newFactor.setRecipes(recipes);\n newFactor.setIngredients(ingredients);\n newFactor.setUserMap(userMap);\n newFactor.setUserMapReversed(userMap_r);\n newFactor.setRecipeMap(recipeMap);\n newFactor.setRecipeMapReversed(recipeMap_r);\n newFactor.setIngredientMap(ingredientMap);\n newFactor.setIngredientMapReversed(ingredientMap_r);\n \n //deep copy\n List<User> userCopy = new ArrayList<User>();\n for(User curr: this.users){\n userCopy.add(new User(curr.getId()));\n }\n newFactor.setUsers(userCopy);\n newFactor.setDataset(dataset.copy());\n newFactor.updateInitialSpace();\n return newFactor;\n }", "Nda<V> shallowCopy();", "public Complex makeDeepCopy() {\r\n Complex complex2 = new Complex(this.getReal(), this.getImaginary());\r\n return complex2;\r\n }", "public abstract INodo copy();", "public Function clone();", "public CMObject copyOf();", "T copy();", "private Shop deepCopy() {\n BookShop obj = null;\n try {\n obj = (BookShop) super.clone();\n List<Book> books = new ArrayList<>();\n Iterator<Book> iterator = this.getBooks().iterator();\n while(iterator.hasNext()){\n\n books.add((Book) iterator.next().clone());\n }\n obj.setBooks(books);\n } catch (CloneNotSupportedException exc) {\n exc.printStackTrace();\n }\n return obj;\n }", "public abstract Object clone() ;", "private Instances deepCopy(Instances data) {\n Instances newInst = new Instances(data);\n\n newInst.clear();\n\n for (int i = 0; i < data.size(); i++) {\n Instance ni = new DenseInstance(data.numAttributes());\n for (int j = 0; j < data.numAttributes(); j++) {\n ni.setValue(newInst.attribute(j), data.instance(i).value(data.attribute(j)));\n }\n newInst.add(ni);\n }\n\n return newInst;\n }", "public Object clone();", "public Object clone();", "public Object clone();", "public Object clone();", "public abstract B copy();", "public void copy() {\n\n\t}", "Model copy();", "private Shop shallowCopy() {\n BookShop obj = null;\n try {\n obj = (BookShop) super.clone();\n } catch (CloneNotSupportedException exc) {\n exc.printStackTrace();\n }\n return obj;\n }", "public abstract Object clone();", "public Object clone() {\n // No problems cloning here since private variables are immutable\n return super.clone();\n }", "public abstract Node copy();", "Nda<V> deepCopy();", "public CFExp deepCopy(){\r\n return this;\r\n }", "default C cloneFlat() {\n\t\treturn clone(FieldGraph.of(getFields()));\n\t}", "public SceneLabelObjectState copy(){\n\n\t\t//get a copy of the generic data from the supertype\n\t\tSceneDivObjectState genericCopy = super.copy(); \n\n\t\t//then generate a copy of this specific data using it (which is easier then specifying all the fields\n\t\t//Separately like we used too)\n\t\tSceneLabelObjectState newObject = new SceneLabelObjectState(\n\t\t\t\tgenericCopy,\n\t\t\t\tObjectsCurrentText,\t\t\n\t\t\t\tCSSname,\n\t\t\t\tcursorVisible,\n\t\t\t\tTypedText,\n\t\t\t\tCustom_Key_Beep,\n\t\t\t\tCustom_Space_Beep);\n\n\t\treturn newObject;\n\n\n\t}", "public Tree<K, V> copy() {\n\t\tTree<K, V> copy = EmptyTree.getInstance(), t = this;\n\t\treturn copy(t, copy);\n\t}", "public directed_weighted_graph deepCopy() {\n DWGraph_DS copyGraph = new DWGraph_DS(this); //create a new graph with the original graph data (only primitives)\n HashMap<Integer, node_data> copyNodesMap = new HashMap<>(); //create a new nodes HashMap for the new graph\n for (node_data node : nodes.values()) { //loop through all nodes in the original graph\n copyNodesMap.put(node.getKey(), new NodeData((NodeData) node)); //makes a duplicate of the original HashMap\n }\n copyGraph.nodes = copyNodesMap; //set the new graph nodes to the new HashMap we made.\n return copyGraph;\n }", "@Override\n\t\tpublic ImmutableSequentialGraph copy() {\n\t\t\treturn new ComposedGraph( g0, g1.copy() );\n\t\t}", "public CopyBuilder copy() {\n return new CopyBuilder(this);\n }", "public abstract TreeNode copy();", "@Override\r\n\tprotected Object clone() throws CloneNotSupportedException { // semi-copy\r\n\t\tthrow new CloneNotSupportedException();\r\n\t}", "@Test\n\tpublic void testCopyConstructor() {\n\t\tItem copy = new Item(item);\n\t\t\n\t\tassertTrue(\"Item copied using copy constructor: \",item.equals(copy)); \n\t\tassertNotSame(\"Item copied is not a reference to the same item: \",item, copy);\n\t}", "@Override\n public Object clone() {\n return super.clone();\n }", "@Override\n public weighted_graph copy() {\n weighted_graph copy = new WGraph_DS(this.ga);//create the copy graph via copy constructor\n return copy;\n }", "public Picture(Picture copyPicture)\n {\n // let the parent class do the copy\n super(copyPicture);\n }", "public Picture(Picture copyPicture)\n {\n // let the parent class do the copy\n super(copyPicture);\n }", "public Query copy() {\r\n\tQuery queryCopy = new Query();\r\n\tqueryCopy.terms = (LinkedList<String>) terms.clone();\r\n\tqueryCopy.weights = (LinkedList<Double>) weights.clone();\r\n\treturn queryCopy;\r\n }", "public ProcessedDynamicData deepCopy( ) {\r\n\r\n ProcessedDynamicData copy = new ProcessedDynamicData( this.channelId );\r\n\r\n copy.channelId = this.channelId;\r\n copy.dateTimeStamp = new java.util.Date( this.dateTimeStamp.getTime() );\r\n copy.samplingRate = this.samplingRate;\r\n copy.eu = this.eu;\r\n\r\n copy.min = this.min;\r\n copy.max = this.max;\r\n\r\n copy.measurementType = this.measurementType;\r\n copy.measurementUnit = this.measurementUnit;\r\n\r\n // data and labels\r\n List<Double> dataCopy = new Vector<Double>();\r\n for( int i = 0; i < this.data.size(); i++ ) {\r\n dataCopy.add( new Double( this.data.get( i ) ) );\r\n }\r\n copy.setData( dataCopy );\r\n\r\n List<Double> dataLabels = new Vector<Double>();\r\n for( int i = 0; i < this.dataLabels.size(); i++ ) {\r\n dataLabels.add( new Double( this.dataLabels.get( i ) ) );\r\n }\r\n copy.setDataLabels( dataLabels );\r\n\r\n // create a deep copy of overalls\r\n if( overalls != null ) {\r\n copy.overalls = new OverallLevels( this.overalls.getChannelId() );\r\n copy.overalls.setDateTimeStampMillis( this.getDateTimeStampMillis() );\r\n Vector<String> overallKeys = this.overalls.getKeys();\r\n for( int i = 0; i < overallKeys.size(); i++ ) {\r\n copy.overalls.addOverall( new String( overallKeys.elementAt( i ) ),\r\n new Double( this.overalls.getOverall( overallKeys.elementAt( i ) ) ) );\r\n }\r\n }\r\n\r\n copy.xEUnit = this.xEUnit;\r\n copy.yEUnit = this.yEUnit;\r\n\r\n copy.xSymbol = this.xSymbol;\r\n copy.ySymbol = this.ySymbol;\r\n copy.xPhysDomain = this.xPhysDomain;\r\n copy.yPhysDomain = this.yPhysDomain;\r\n \r\n copy.noOfAppendedZeros = this.noOfAppendedZeros;\r\n\r\n return copy;\r\n }", "@Override\n\tprotected void copy(Object source, Object dest) {\n\t\t\n\t}", "public Object clone() {\n return this.copy();\n }", "public Card copy(){\n return new Card(Suits, Value);\n }", "@Override\n\tpublic function copy() {\n\t\tMonom M=new Monom(this.get_coefficient(),this.get_power());\n\t\t\n\t\treturn M;\n\t}", "private Path(Path other){\n\t\t\n\t\tthis.source = other.source;\n\t\tthis.destination = other.destination;\n\t\tthis.cities = other.cities;\n\t\t\n\t\tthis.cost = other.cost;\n\t\tthis.destination = other.destination;\n\t\t\n\t\tthis.connections = new LinkedList<Connection>();\n\t\t\n\t\tfor (Connection c : other.connections){\n\t\t\tthis.connections.add((Connection) c.clone());\n\t\t}\n\t\t\n\t}", "public Object clone(){\n \t\n \treturn this;\n \t\n }", "public JsonFactory copy()\n/* */ {\n/* 324 */ _checkInvalidCopy(JsonFactory.class);\n/* */ \n/* 326 */ return new JsonFactory(this, null);\n/* */ }", "@Override\n public AbstractRelic makeCopy() {\n return new Compendium();\n }", "protected Shingle copy() {\n return new Shingle(this);\n }", "public ConfabulatorObject getCopy() {\n\t\tConfabulatorObject copy = new ConfabulatorObject(getMessenger());\n\t\tlockMe(this);\n\t\tint maxD = maxLinkDistance;\n\t\tint maxC = maxLinkCount;\n\t\tList<Link> linksCopy = new ArrayList<Link>();\n\t\tfor (Link lnk: links) {\n\t\t\tlinksCopy.add(lnk.getCopy());\n\t\t}\n\t\tunlockMe(this);\n\t\tcopy.initialize(maxD,maxC,linksCopy);\n\t\treturn copy;\n\t}", "public Punch getShallowCopy(){\n Punch p = new Punch();\n p.id = id;\n p.time = time;\n //p.taskId = punchTask.getID();\n return p;\n }", "public T copy() {\n T ret = createLike();\n ret.getMatrix().setTo(this.getMatrix());\n return ret;\n }", "public DessertVO clone() {\r\n return (DessertVO) super.clone();\r\n }", "@Override\n public ExpressionNode deepCopy(BsjNodeFactory factory);", "public abstract Pessoa clone();", "public Object clone() throws CloneNotSupportedException { return super.clone(); }", "public Object clone()\n/* */ {\n/* 835 */ return super.clone();\n/* */ }", "public Object clone() {\n \ttry {\n \tMyClass1 result = (MyClass1) super.clone();\n \tresult.Some2Ob = (Some2)Some2Ob.clone(); ///IMPORTANT: Some2 clone method called for deep copy without calling this Some2.x will be = 12\n \t\n \treturn result;\n \t} catch (CloneNotSupportedException e) {\n \treturn null; \n \t}\n\t}", "public Object clone()\n {\n PSRelation copy = new PSRelation(new PSCollection(m_keyNames.iterator()),\n new PSCollection(m_keyValues.iterator()));\n \n copy.m_componentState = m_componentState;\n copy.m_databaseComponentId = m_databaseComponentId;\n copy.m_id = m_id;\n\n return copy;\n }", "@Override\n public TopicObject copy() {\n return new TopicObject(this);\n }", "public BufferTWeak cloneMe() {\r\n BufferTWeak ib = new BufferTWeak(uc);\r\n ib.increment = increment;\r\n ib.set(new Object[objects.length]);\r\n for (int i = 0; i < objects.length; i++) {\r\n ib.objects[i] = this.objects[i];\r\n }\r\n ib.offset = this.offset;\r\n ib.count = this.count;\r\n return ib;\r\n }", "public d clone() {\n ArrayList arrayList = this.e;\n int size = this.e.size();\n c[] cVarArr = new c[size];\n for (int i = 0; i < size; i++) {\n cVarArr[i] = ((c) arrayList.get(i)).clone();\n }\n return new d(cVarArr);\n }", "@Override\r\n\tprotected A clone() throws CloneNotSupportedException {\r\n\t\tA clone = (A)super.clone();\r\n//\t\tclone.b = new B();\r\n\t\treturn clone;\r\n\t}", "public Chord duplicate ()\r\n {\r\n // Beams are not copied\r\n Chord clone = new Chord(getMeasure(), slot);\r\n clone.stem = stem;\r\n stem.addTranslation(clone);\r\n\r\n // Notes (we make a deep copy of each note)\r\n List<TreeNode> notesCopy = new ArrayList<>();\r\n notesCopy.addAll(getNotes());\r\n\r\n for (TreeNode node : notesCopy) {\r\n Note note = (Note) node;\r\n new Note(clone, note);\r\n }\r\n\r\n clone.tupletFactor = tupletFactor;\r\n\r\n clone.dotsNumber = dotsNumber;\r\n clone.flagsNumber = flagsNumber; // Not sure TODO\r\n\r\n // Insure correct ordering of chords within their container\r\n ///Collections.sort(getParent().getChildren(), chordComparator);\r\n\r\n return clone;\r\n }", "@Override\n\tpublic graph copy() {\n\t\tgraph copy = new DGraph();\n\t\tCollection<node_data> nColl = this.GA.getV();\n\t\tfor (node_data node : nColl) {\n\t\t\tnode_data temp = new Node((Node) node );\n\t\t\tcopy.addNode(node);\n\t\t}\n\t\tCollection<node_data> nColl2 = this.GA.getV();\n\t\tfor (node_data node1 : nColl2) {\n\t\t\tCollection<edge_data> eColl = this.GA.getE(node1.getKey());\n\t\t\tif (eColl!=null) {\n\t\t\t\tfor (edge_data edge : eColl) {\n\t\t\t\t\tcopy.connect(edge.getSrc(), edge.getDest(), edge.getWeight());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn copy;\n\t}", "public void testCopyConstructor() throws EdmException {\n entity = new EdmEntity(\"example.edl\");\n EdmAttribute a1 = setupAttribute(val1);\n EdmAttribute a2 = setupAttribute(val2);\n entity.addAttribute(id1, a1);\n entity.addAttribute(id2, a2);\n // add subEntity\n EdmEntity subE = new EdmEntity(\"SUBexample.edl\");\n EdmAttribute a3 = setupAttribute(val3);\n subE.addAttribute(id3, a3);\n entity.addSubEntity(subE);\n\n assertEquals(\"example.edl\", entity.getType());\n assertEquals(2, entity.getAttributeCount());\n assertEquals(a1, entity.getAttribute(id1));\n assertEquals(a2, entity.getAttribute(id2));\n\n assertEquals(1, entity.getSubEntityCount());\n assertEquals(\"SUBexample.edl\", entity.getSubEntity(0).getType());\n assertEquals(1, entity.getSubEntity(0).getAttributeCount());\n assertEquals(0, entity.getSubEntity(0).getSubEntityCount());\n assertEquals(a3, entity.getSubEntity(0).getAttribute(id3));\n\n\n EdmEntity copy = new EdmEntity(entity);\n\n assertEquals(entity.getType(), copy.getType());\n assertEquals(entity.getAttributeCount(), copy.getAttributeCount());\n for (String key : copy.getAttributeIdSet())\n assertEquals(entity.getAttribute(key), copy.getAttribute(key));\n\n assertEquals(entity.getSubEntityCount(), copy.getSubEntityCount());\n for (int i = 0; i < copy.getSubEntityCount(); i++) {\n assertEquals(entity.getSubEntity(i).getType(), copy.getSubEntity(i).getType());\n assertEquals(entity.getSubEntity(i).getAttributeCount(),\n copy.getSubEntity(i).getAttributeCount());\n for (String key : copy.getSubEntity(i).getAttributeIdSet())\n assertEquals(entity.getSubEntity(i).getAttribute(key),\n copy.getSubEntity(i).getAttribute(key));\n }\n }", "public Card makeCopy(){\n return new Card(vimage);\n }", "@Override\n public FieldEntity copy()\n {\n return state.copy();\n }", "private ImmutablePerson(ImmutablePerson other) {\n firstName = other.firstName;\n middleName = other.middleName;\n lastName = other.lastName;\n nickNames = new ArrayList<>(other.nickNames);\n }", "@Override\r\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\r\n\t}", "@Override\r\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\r\n\t}", "@Override\r\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\r\n\t}", "public abstract Pattern copy();", "@Override\n public Object clone() throws CloneNotSupportedException {\n throw new CloneNotSupportedException();\n }", "@Override\r\n public NumericObjectArrayList makeDeepCopy() {\r\n NumericObjectArrayList list = new NumericObjectArrayList();\r\n for (int i = 0; i < this.getCount(); i++) {\r\n try {\r\n list.insert(i, this.getValueAt(i));\r\n } catch (IndexRangeException ex) {\r\n //Shouldn't happen\r\n }\r\n }\r\n return list;\r\n }", "public Object clone()\n {\n try {\n Object newObj = super.clone();\n ((LDAPUrl)newObj).url = (com.github.terefang.jldap.ldap.LDAPUrl)this.url.clone();\n return newObj;\n } catch( CloneNotSupportedException ce) {\n throw new RuntimeException(\"Internal error, cannot create clone\");\n }\n }", "public MossClone() {\n super();\n }", "@Override\n public MetaprogramTargetNode deepCopy(BsjNodeFactory factory);", "@Override\r\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\tthrow new CloneNotSupportedException();\r\n\t}", "public abstract LambdaTerm deepCopy();", "public AST copy()\n {\n return new Implicate(left, right);\n }", "@Override\r\n\tpublic Object clone() throws CloneNotSupportedException {\n\t\t\r\n\t\treturn super.clone();\r\n\t}", "public Coordinates copy() {\n\t\treturn new Coordinates(this);\n\t}", "public /*@ non_null @*/ Object clone() {\n return this;\n }", "@Override\r\n\tprotected B clone() throws CloneNotSupportedException {\r\n\t\tB clone = (B)super.clone();\r\n//\t\tclone.a = new A();\r\n\t\treturn clone;\r\n\t}", "public final Keyword deepClone()\r\n {\r\n Keyword clone;\r\n try\r\n {\r\n clone = (Keyword) super.clone();\r\n if (translations != null) {\r\n clone.setTranslations(new TreeSet<Translation>());\r\n for (Translation translation: translations)\r\n {\r\n clone.addTranslation(translation.deepClone());\r\n }\r\n }\r\n }\r\n catch (CloneNotSupportedException cnse)\r\n {\r\n clone = null;\r\n }\r\n return clone;\r\n }", "public State copy() {\n State that = new State(this.registers.length);\n for (int i=0; i<this.registers.length; ++i) {\n Object a = this.registers[i];\n if (a == null) continue;\n if (!(a instanceof Set))\n that.registers[i] = a;\n else\n that.registers[i] = NodeSet.FACTORY.makeSet((Set)a);\n }\n if(TRACE_REGISTERS) System.out.println(\"Copying state \" + Arrays.asList(that.registers));\n return that;\n }", "@Override\r\n\tpublic Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\r\n\t}", "public Object clone()\n {\n Object o = null;\n try\n {\n o = super.clone();\n }\n catch (CloneNotSupportedException e)\n {\n e.printStackTrace();\n }\n return o;\n}", "private final State copy( State state)\n {\n State copy = new State();\n copy.index = counter++;\n copy.stackOps = Arrays.copyOf( state.stackOps, state.stackOps.length);\n copy.gotos = Arrays.copyOf( state.gotos, state.gotos.length);\n itemSetMap.put( copy, itemSetMap.get( state));\n return copy;\n }", "public final Object clone() throws CloneNotSupportedException {\n throw new CloneNotSupportedException();\n }", "@Override\n public Object clone() throws CloneNotSupportedException{\n return super.clone();\n }", "@SuppressWarnings(\"unchecked\")\n @Override\n public <T extends JsonNode> T deepCopy() { return (T) this; }", "public Object clone() throws CloneNotSupportedException {\r\n\t\tthrow new CloneNotSupportedException();\r\n\t}", "public Expression deepCopy()\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}", "public Object clone()\n\t{\n\t\treturn new Tree();\n\t}" ]
[ "0.78432244", "0.74296844", "0.72933096", "0.7175962", "0.71531576", "0.7105618", "0.7105618", "0.700036", "0.6941321", "0.6786523", "0.6772543", "0.67449045", "0.67390406", "0.67038697", "0.66658545", "0.6641298", "0.6637258", "0.66294056", "0.66294056", "0.66294056", "0.66294056", "0.6600223", "0.6548704", "0.6540513", "0.65315914", "0.6527351", "0.65010804", "0.64988446", "0.6496415", "0.6495144", "0.64939415", "0.64653057", "0.64577264", "0.6441105", "0.64260775", "0.64045936", "0.63782144", "0.6367195", "0.63656217", "0.6363034", "0.63611495", "0.634116", "0.634116", "0.63307124", "0.63132346", "0.6294761", "0.6293946", "0.62909573", "0.6287112", "0.6285074", "0.6253474", "0.6245887", "0.6237449", "0.62365204", "0.6234591", "0.623267", "0.62291044", "0.6216489", "0.621366", "0.620287", "0.6202336", "0.61962515", "0.6183975", "0.6148833", "0.61460745", "0.6129806", "0.61263686", "0.6125933", "0.61218876", "0.6119396", "0.61131084", "0.61013126", "0.6099326", "0.608393", "0.6081227", "0.6081227", "0.6081227", "0.6080267", "0.607674", "0.606925", "0.60657203", "0.606562", "0.60514706", "0.6049938", "0.60425293", "0.60370237", "0.60330397", "0.6032451", "0.60298765", "0.60292023", "0.6028003", "0.60279495", "0.6027283", "0.60247946", "0.6023282", "0.6022092", "0.6018602", "0.60026675", "0.59985846", "0.59958035", "0.59936595" ]
0.0
-1
/ use get method of the HashMap
public node_info getNode(int key) { return getNodes().get(key); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public V get(Object key) { return _map.get(key); }", "@Override\n\tpublic V get(Object key) {\n\t\treturn map.get(key);\n\t}", "public String get(int key){\n\t\treturn(hashMap[key]);\t\t\n\t}", "public static void getHashMapValues() {\n\t\tMap<Integer, String> map = createHashMap();\n\t\t\n\t\t//Get value from key.\n\t\tSystem.out.println(\"Map value for key 1: \" + map.get(1));\n\n\t\t\n\t\t//2. using custom object as key\n\t\tMap<Account, String> accountMap = createAccountMap();\n\t\t\n\t\tAccount account = new Account(\"John\", 1, 100);\n\t\t\n\t\tSystem.out.println(\"**********Get value from Map:*********** \");\n\t\tSystem.out.println(\"Map Value for key as Account: \"\n\t\t\t\t+ accountMap.get(account));\n\t}", "Object get(Object key);", "protected abstract Object _get(String key);", "public Value get(Key key) ;", "@org.junit.Test\n public void get() throws Exception {\n assertEquals(null, hashTable.get(\"savon\"));\n assertEquals(\"camp\", hashTable.get(\"math\"));\n hashTable.put(\"math\", \"club\");\n assertEquals(\"club\", hashTable.get(\"math\"));\n }", "@Override\n public Object get(int k) {\n long startTime = System.currentTimeMillis();\n Object value = super.get(k);\n long endTime = System.currentTimeMillis();\n if (value == null) { //means either no value in spot or wrong value in spot\n startTime = System.currentTimeMillis();\n for (int i = 1; i < super.size() && value == null; i++) {\n int hash = (k + i) % size();\n MapElement me = hashTable[hash];\n if (me == null) {\n value = null;\n } else if (me.getKey() != k) {\n value = null;\n } else {\n value = me.getValue();\n }\n }\n endTime = System.currentTimeMillis();\n }\n if (value == null) {\n System.out.println(\"Value could not be found: \" + k + \", \" + value);\n }\n System.out.println(\"------GET------\");\n System.out.println(\"TIME: \" + (endTime - startTime));\n return value;\n }", "Object get(String key);", "Object get(String key);", "public Object get(String key);", "@Override\n\tpublic V get(K key) {\n\t\tint h = Math.abs(key.hashCode()) % nrb;// calculam hash-ul asociat cheii\n\t\tfor (int i = 0; i < b.get(h).getEntries().size(); i++) {\n\t\t\t// parcurgerea listei de elemente pentru a gasi cheia ceruta si a\n\t\t\t// intoarte valoarea dorita\n\t\t\tif (b.get(h).getEntries().get(i).getKey().equals(key)) {\n\t\t\t\treturn b.get(h).getEntries().get(i).getValue();\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "public int get(int key) {\n int hashedKey = hash(key);\n Entry entry = map.get(hashedKey);\n if (entry.key == -1)\n return -1;\n else if (entry.key == key)\n return entry.value;\n else if (entry.next != null){\n while(entry.next!=null && entry.key != key){\n entry = entry.next;\n }\n if (entry.key == key)\n return entry.value;\n else\n return -1;\n }else\n return -1;\n }", "public Value get(Key key);", "void setHashMap();", "public abstract T get(String key);", "Object get(Object key) throws NullPointerException;", "V get(Object key);", "public String[] get()\n {\n return hashmap;\n }", "protected abstract V get(K key);", "String get(Integer key);", "@Override\n\tpublic void getStat(Map<String, String> map) {\n\t\t\n\t}", "public static void main(String [] args){\n Map m = new HashMap();\n m.put(\"Tim\", 5);\n m.put(\"Joe\", \"x\");\n m.put(\"11\", 999);\n System.out.println(m);\n System.out.println(m.get(\"Tim\"));\n }", "public String get(String key) {\n return this.map.get(key);\n }", "@Override\r\n public V get(Object key) {\r\n return get(key,table);\r\n }", "public abstract V get(K key);", "@Nullable\n/* */ public V get(int key) {\n/* 51 */ V res = (V)super.get(key);\n/* 52 */ if (res == null) {\n/* 53 */ res = (V)this.loader.apply(Integer.valueOf(key));\n/* 54 */ if (res != null) {\n/* 55 */ put(key, res);\n/* */ }\n/* */ } \n/* 58 */ return res;\n/* */ }", "public static int get(int key) {\n\t\t// your code here\n\t\tif (map.containsKey(key)) {\n\t\t\tint value = map.get(key);\n\t\t\tmap.remove(key);\n\t\t\tmap.put(key,value);\n\t\t\treturn map.get(key);\n\t\t} else\n\t\t\treturn -1;\n\t}", "public Object get(String key) {\n \t\treturn this.get(null, key);\n \t}", "@Override\n\tpublic V get(Object key) {\n\t\tfor (int i = 0; i < tabla.size(); i++) {\n\t\t\tint indice = tabla.get(i).keySet().indexOf(key);\n\t\t\tif (indice != -1) {\n\t\t\t\treturn tabla.get(i).valueSet().get(indice);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public final synchronized V get(final K key) {\n\t\treturn map.get(key);\n\t}", "public Collection<V> get(K key) {\r\n \treturn map.get(key);\r\n }", "public synchronized Object get( Object key ) {\n\t\tObject intvalue = mapKeyPos.get(key);\n\t\tif ( intvalue != null ) {\n\t\t\tint pos = ((Integer)intvalue).intValue();\n\t\t\tstatus[pos] = LRU_NEW;\n\t\t\t//System.out.println(\"CountLimiteLRU: get(\"+key+\") = \"+values[pos]);\n\t\t\treturn values[pos];\n\t\t}\n\t\treturn null;\n\t}", "@Override\n\tpublic Map<String, String> get(int id) {\n\t\treturn null;\n\t}", "public Map<String, Object> getInfo();", "public Object get(Object key) {\n CacheEntry entry = (CacheEntry)_hash.get(key);\n if (entry != null) {\n touchEntry(entry);\n return entry.getValue();\n } else {\n return null;\n }\n }", "@Override\r\n public V get(K key){\r\n // Return the value given by overloaded get function\r\n return get(root, key);\r\n }", "@Override\n public V get(Object key) {\n if (key == null) {\n return null;\n } else {\n // Treat the keys to this map by uppercassing the keys\n // Verify that the uppercased key is in the map and return if so\n if (caseInsensitive && key instanceof String && super.get(key.toString().toUpperCase()) != null) {\n return super.get(key.toString().toUpperCase());\n }\n return super.get(key);\n }\n }", "public String get (String key) {\r\n // String gets hashed to become hashed key, which is the index to find the linked list\r\n int arrIndex = hash(key);\r\n\r\n if (hashTableArray[arrIndex] == null) {\r\n hashTableArray[arrIndex] = new LinkedList<>();\r\n }\r\n for (int i = 0; i < hashTableArray[arrIndex].size(); i++) {\r\n // if at i the key in the hashtable is the same as the key that is supplied, return the value\r\n if (hashTableArray[arrIndex].get(i).key.equals(key)){\r\n return hashTableArray[arrIndex].get(i).value;\r\n }\r\n }\r\n return null;\r\n }", "T get(String key);", "public Object get(String key) {\r\n\t\treturn objectMap.get(key);\r\n\t}", "private V get(K key) {\n\t\t\tif (keySet.contains(key)) {\n\t\t\t\treturn valueSet.get(keySet.indexOf(key));\n\t\t\t}\n\t\t\treturn null;\n\t\t}", "@Override\r\n\tpublic V getElement(K key) {\n\t\tif (hashMap.containsKey(key)){\r\n\t\t\tque.remove(key);\r\n\t\t\tque.add(key);\r\n\t\t\treturn hashMap.get(key);\r\n\t\t}\r\n\t\t\r\n\t\treturn null;\r\n\t}", "public V get(K key) {\r\n\t\tint place = hash(key.hashCode());\r\n\t\tif (hashMapArray[place] != null) {\r\n\t\t\tLinkedList<KVPair> temp = hashMapArray[place];\r\n\t\t\tfor (KVPair i : temp) {\r\n\t\t\t\tif (i.getKey().equals(key)) {\r\n\t\t\t\t\treturn i.getValue();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public int get(int key) {\n return 1;\n }", "private void get(String key){\n KeyValueObj obj = this.handler.getObj(key);\n if (obj == null){\n System.out.println(\"[User] value with key \" + key + \" was not found\");\n return;\n }\n System.out.println(obj.toString());\n }", "@Override\n public V get(K key) {\n if(containsKey(key)) {\n LinkedList<Entry<K, V>> pointer = entryArr[Math.floorMod(key.hashCode(), entryArr.length)];\n return pointer.stream().filter(x->x.key.equals(key))\n .collect(Collectors.toList()).get(0).value;\n }\n return null;\n }", "public Object get(Object key) {\n\t\tint index = key.hashCode() % SLOTS;\n\t\t// check if key is already present in that slot/bucket.\n\t\tfor(Pair p:table[index]) {\n\t\t\tif(key.equals(p.key))\n\t\t\t\treturn p.value;\n\t\t}\n\t\t// if not found, return null\n\t\treturn null;\n\t}", "@Override\n public synchronized Object get(Object key) {\n if ((System.currentTimeMillis() - this.lastCheck) > this.CACHE_TIME) {\n update();\n }\n String strkey = key.toString();\n if (this.ignoreCase) {\n strkey = this.keyMap.getProperty(strkey.toLowerCase());\n if (strkey == null)\n return null;\n }\n return super.get(strkey);\n }", "public int get(int key) {\n return store[key]; // get the value for the key\n }", "public Object get(Object oKey)\n {\n Map.Entry entry = getEntry(oKey);\n return (entry == null ? null : entry.getValue());\n }", "public Object get(String key) {\n return objectMap.get(key);\n }", "public String get(String key) {\n return mMap.get(key);\n }", "public int get(int key) {\n newkey = hashfunc(key);\n return arr[newkey];\n \n }", "protected abstract S get(E entry);", "V get(K key);", "V get(K key);", "V get(K key);", "V get(K key);", "V get(K key);", "V get(K key);", "V get(K key);", "public V get(String key);", "@Override\r\n\tpublic Account getAccountHashmap(String accnum) {\n\t\treturn dataMap.get(accnum);\r\n\t}", "java.util.Map<java.lang.Integer, java.lang.Integer>\n getInfoMap();", "public T get(K key);", "public Object get(Map<Prop, Object> map) {\n Object o = map.get(this);\n return o != null ? o : defaultValue;\n }", "@Test\n\tpublic void testHashMap() {\n\n\t\t/*\n\t\t * Creates an empty HashMap object with default initial capacity 16 and default\n\t\t * fill ratio \"0.75\".\n\t\t */\n\t\tHashMap hm = new HashMap();\n\t\thm.put(\"evyaan\", 700);\n\t\thm.put(\"varun\", 100);\n\t\thm.put(\"dolly\", 300);\n\t\thm.put(\"vaishu\", 400);\n\t\thm.put(\"vaishu\", 300);\n\t\thm.put(null, 500);\n\t\thm.put(null, 600);\n\t\t// System.out.println(hm);\n\n\t\tCollection values = hm.values();\n//\t\tSystem.out.println(values);\n\n\t\tSet entrySet = hm.entrySet();\n\t\t// System.out.println(entrySet);\n\n\t\tIterator iterator = entrySet.iterator();\n\t\twhile (iterator.hasNext()) {\n\t\t\tMap.Entry entry = (Map.Entry) iterator.next();\n\t\t\t// System.out.println(entry.getKey()+\":\"+entry.getValue());\n\t\t}\n\n\t}", "public HashMap getMetaData() ;", "private Set<String> getInfo(Map<String, Set<String>> info, String label) {\n\t\treturn (info.containsKey(label)) ? info.get(label)\n\t\t\t\t: new HashSet<String>();\n\t}", "public Object get(String key){ \r\n\t\treturn this.context.getValue(key);\r\n\t}", "@Override\n public T get(Object key) {\n return get(key, null);\n }", "public V get( K key ) {\n WeakReference<V> valueRef = map.get( key );\n return valueRef == null ? null : valueRef.get();\n }", "public HashMap<String, NeonValue> getMap();", "@Override\n\t@TimeComplexity(\"O(log n)\")\n\tpublic V get(K key) {\n\t/* TCJ\n\t * Binary search operation: log n\n\t */\n\t\tint j = findIndex(key);\n\t\tif ( j == size() || key.compareTo(map.get(j).getKey()) != 0 ) { return null; }\n\t\treturn map.get(j).getValue();\n\t}", "public int get(int key) {\r\n if (map.containsKey(key)) {\r\n \t Node node = map.get(key);\r\n \t int value = node.val;\r\n \t if (!node.equals(doubly.last)) {\r\n \t\t doubly.delete(node);\r\n \t\t\tdoubly.insertLast(key, value); \r\n \t\t\tmap.put(key, doubly.last);\r\n \t }\r\n \t return value;\r\n }\r\n else return -1;\r\n \r\n }", "T get(String key) throws IOException;", "public List<S> get(Object key) {\n if (map.containsKey(key))\n return map.get(key);\n else\n return emptyList;\n }", "public MapElement get(long key) {\r\n return (MapElement) getElement(key);\r\n }", "public Value get(Value key) {\n\t\treturn storage.get(key);\n\t}", "public HashMap<String, T> getStorage();", "public V get(K key);", "@Test\n public void testGet()\n {\n SsOhMap m = new SsOhMap();\n m.put(\"a\", \"1\");\n m.put(\"b\", \"2\");\n m.put(\"a\", \"3\");\n\n assertEquals(\"3\", m.get(\"a\"));\n m.free();\n }", "int getInfoOrThrow(\n int key);", "public int get(int key) {\n Node n = map.get(key);\n if(n == null){\n //we do not have the value, return -1\n return -1;\n }\n //we do have the node\n //update the node in the DLL, so that its now in the front\n update(n);\n return n.val;\n }", "public V get(K key)\r\n\t{\r\n\t\tEntry retrieve = data.get(new Entry(key, null));\r\n\t\t\r\n\t\tif(retrieve != null)\r\n\t\t{\r\n\t\t\treturn retrieve.value;\r\n\t\t}\r\n\t\t\r\n\t\treturn null;\r\n\t}", "@Override\n\tpublic Map<Serializable, Serializable> gets(String name, List<Serializable> keys)\n\t\t\tthrows CacheException {\n\t\treturn null;\n\t}", "@Test\n public void mapGet() {\n check(MAPGET);\n query(MAPGET.args(MAPNEW.args(\"()\"), 1), \"\");\n query(MAPGET.args(MAPENTRY.args(1, 2), 1), 2);\n }", "public Pair get()\n {\n return this.MapItr.element;\n }", "public int get(int key) {\n if(hashmap.containsKey(key)){\n Entry e = hashmap.get(key);\n removeNode(e);\n addAtTop(e);\n return e.value;\n }\n return -1;\n }", "V getEntry(K key);", "public String get(int key) {\n String sql = \"SELECT data_val FROM data_map WHERE data_key = ?\";\n\n String value = null;\n try (Connection con = this.connect();\n PreparedStatement pstmt = con.prepareStatement(sql)) {\n pstmt.setInt(1, key);\n ResultSet rs = pstmt.executeQuery();\n\n if (!rs.isClosed()) {\n value = rs.getString(\"data_val\");\n rs.close();\n }\n }\n catch (SQLException e) {\n value = null;\n }\n\n return value;\n }", "@Override\n\t\t\tpublic String get(String key) {\n\t\t\t\treturn null;\n\t\t\t}", "public static void getMapDetails(){\n\t\tmap=new HashMap<String,String>();\r\n\t map.put(getProjName(), getDevID());\r\n\t //System.out.println(\"\\n[TEST Teamwork]: \"+ map.size());\r\n\t \r\n\t // The HashMap is currently empty.\r\n\t\tif (map.isEmpty()) {\r\n\t\t System.out.println(\"It is empty\");\r\n\t\t \r\n\t\t System.out.println(\"Trying Again:\");\r\n\t\t map=new HashMap<String,String>();\r\n\t\t map.put(getProjName(), getDevID());\r\n\t\t \r\n\t\t System.out.println(map.isEmpty());\r\n\t\t}\r\n\t\t \r\n\t\t\r\n\t\t//retrieving values from map\r\n\t Set<String> keys= map.keySet();\r\n\t for(String key : keys){\r\n\t \t//System.out.println(key);\r\n\t System.out.println(key + \": \" + map.get(key));\r\n\t }\r\n\t \r\n\t //searching key on map\r\n\t //System.out.println(\"Map Value: \"+map.containsKey(toStringMap()));\r\n\t System.out.println(\"Map Value: \"+map.get(getProjName()));\r\n\t \r\n\t //searching value on map\r\n\t //System.out.println(\"Map Key: \"+map.containsValue(getDevID()));\r\n\t \r\n\t\t\t\t\t // Put keys into an ArrayList and sort it.\r\n\t\t\t\t\t\t//ArrayList<String> list = new ArrayList<String>();\r\n\t\t\t\t\t\t//list.addAll(keys);\r\n\t\t\t\t\t\t//Collections.sort(list);\r\n\t\t\t\t\r\n\t\t\t\t\t\t// Display sorted keys and their values.\r\n\t\t\t\t\t\t//for (String key : list) {\r\n\t\t\t\t\t\t// System.out.println(key + \": \" + map.get(key));\r\n\t\t\t\t\t\t//}\t\t\t \r\n\t}", "public V forEntry(int i) {\n return HashBiMap.this.values[i];\n }", "public HeaderData get(String key){\r\n\t\treturn map.get(key);\r\n\t}", "@Override\r\n\tpublic V get(Object key) {\r\n\t\tBucket bucket = (Bucket) buckets[key.hashCode() % numBuckets];\r\n\t\treturn bucket.get((K) key);\r\n\t}", "public java.util.Map getMap()\n {\n return __m_Map;\n }", "public static void main(String[] args) {\n HashMap<Integer, String> Hm = new HashMap<Integer, String>();\n Hm.put(0, \"USA\");\n Hm.put(1, \"UK\");\n Hm.put(2, \"India\");\n Hm.put(3, \"Maldives\");\n \n Set sn=Hm.entrySet();\n Iterator i= sn.iterator(); \n while(i.hasNext()) {\n Map.Entry mp=(Map.Entry)i.next();\n System.out.println(mp.getKey());\n System.out.println(mp.getValue());\n }\n \n\t}", "final String get(String key) {\n return get(key,null);\n }" ]
[ "0.73559666", "0.71941084", "0.7073003", "0.689585", "0.682656", "0.68017375", "0.67371583", "0.67180157", "0.6687092", "0.6667486", "0.6667486", "0.6632638", "0.6586656", "0.6529954", "0.646972", "0.63895273", "0.6364163", "0.6354234", "0.635024", "0.6346765", "0.6338576", "0.63049805", "0.6285342", "0.62662274", "0.6262629", "0.6232236", "0.6228515", "0.62084997", "0.6207087", "0.6199641", "0.6191056", "0.61871016", "0.6180496", "0.6173898", "0.6165774", "0.6146364", "0.6143044", "0.61399895", "0.612883", "0.6128755", "0.6122559", "0.6118067", "0.6113054", "0.61086565", "0.61076176", "0.6103425", "0.61027086", "0.60942", "0.6091516", "0.605753", "0.60548437", "0.60339516", "0.60307294", "0.6018413", "0.60156965", "0.60143447", "0.6004463", "0.6004463", "0.6004463", "0.6004463", "0.6004463", "0.6004463", "0.6004463", "0.6000025", "0.59979665", "0.599767", "0.5994682", "0.59804547", "0.59779143", "0.5966526", "0.5965432", "0.5964444", "0.5960374", "0.5956367", "0.59506536", "0.5925", "0.5921894", "0.59198236", "0.59166825", "0.5914955", "0.5908718", "0.59078723", "0.59076935", "0.59016126", "0.5900718", "0.59002703", "0.5896974", "0.5888696", "0.5884117", "0.58807874", "0.5874543", "0.5872319", "0.58690894", "0.58688205", "0.5868396", "0.58541054", "0.5831506", "0.58291113", "0.58286464", "0.58210284", "0.5819433" ]
0.0
-1
/ use hahNi method from Node class , check in the Ni HashMap if the edge exist
public boolean hasEdge(int node1, int node2) { Node s=(Node)this.getNodes().get(node1); return s.hasNi(node2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasNi(int node) {\n return this.neighbors.containsKey(node);\n }", "public boolean hasNi(int nodeKey) {\n return this.neighborEdges.get(nodeKey) != null ? true : false;\n }", "@Test\n\tvoid testIfAdjacentNodeExists() {\n\t\tMap<String, LinkedHashSet<String>> map = new HashMap<String, LinkedHashSet<String>>();\n\t\tLinkedHashSet<String> edges = new LinkedHashSet<String>();\n\t\tedges.add(\"New York\");\n\t\tmap.put(\"Boston\", edges);\n\t\tOptional<LinkedHashSet<String>> vertexOptional = Optional.of(map.get(\"Boston\"));\n\t\tif (vertexOptional.isPresent()) {\n\t\t\tAssertions.assertNotNull(map.get(\"Boston\"));\n\t\t\tAssertions.assertEquals(1, map.get(\"Boston\").size());\n\t\t\tString[] edgesArray = new String[edges.size()];\n\t\t\tedgesArray = edges.toArray(edgesArray);\n\t\t\tAssertions.assertTrue(map.get(\"Boston\").contains(\"New York\"));\n\t\t\tAssertions.assertEquals(\"New York\", edgesArray[0]);\n\t\t}\n\n\t}", "public abstract boolean hasEdge(int from, int to);", "boolean hasNode()\n/* */ {\n/* 473 */ if ((this.bn == null) && (this.mn == null)) return false;\n/* 474 */ if (this.jt == null) return false;\n/* 475 */ return true;\n/* */ }", "@Override\n\tpublic boolean containsEdge(Object src, Object dest)\n\t{\n\t\tif(this.map.containsKey(src))\n\t\t\tif(this.map.get(src).contains(dest))\n\t\t\t\treturn true;\t\t\n\t\treturn false;\n\t}", "public abstract boolean hasMapped(Edge queryEdge);", "@Test\n\tvoid testAdjacentNodes() {\n\t\tLinkedHashSet<String> edges = null;\n\t\tmap.put(\"Boston\", edges);\n\t\tOptional<LinkedHashSet<String>> vertexOptional = Optional.ofNullable(map.get(\"Boston\"));\n\t\t// Boston does not have any adjacent nodes\n\t\tAssertions.assertTrue(vertexOptional.isEmpty());\n\t\t// if connected vertex is null new vertex is created. Now Adjacent nodes will\n\t\t// not have any nodes inside it.\n\t\tif (vertexOptional.isEmpty()) {\n\t\t\tedges = new LinkedHashSet<String>();\n\t\t\tmap.put(\"Boston\", edges);\n\t\t\tAssertions.assertNotNull(map.get(\"Boston\"));\n\t\t\tAssertions.assertEquals(0, map.get(\"Boston\").size());\n\n\t\t}\n\n\t}", "public boolean hasEdge(K u, K v)\n {\n return adjMaps.get(u).containsKey(v);\n }", "public void testContainsEdgeEdge( ) {\n init( );\n\n //TODO Implement containsEdge().\n }", "@Override\n public boolean isConnected() { //i got help from the site https://www.geeksforgeeks.org/shortest-path-unweighted-graph/\n if(this.ga.edgeSize()<this.ga.nodeSize()-1) return false;\n initializeInfo();//initialize all the info fields to be null for the algorithm to work\n if(this.ga.nodeSize()==0||this.ga.nodeSize()==1) return true;//if there is not node or one its connected\n WGraph_DS copy = (WGraph_DS) (copy());//create a copy graph that the algorithm will on it\n LinkedList<node_info> qValues = new LinkedList<>();//create linked list that will storage all nodes that we didn't visit yet\n int firstNodeKey = copy.getV().iterator().next().getKey();//first key for get the first node(its doesnt matter which node\n node_info first = copy.getNode(firstNodeKey);//get the node\n qValues.add(first);//without limiting generality taking the last node added to graph\n int counterVisitedNodes = 0;//counter the times we change info of node to \"visited\"\n while (qValues.size() != 0) {\n node_info current = qValues.removeFirst();\n if (current.getInfo() != null) continue;//if we visit we can skip to the next loop because we have already marked\n current.setInfo(\"visited\");//remark the info\n counterVisitedNodes++;\n\n Collection<node_info> listNeighbors = copy.getV(current.getKey());//create a collection for the neighbors list\n LinkedList<node_info> Neighbors = new LinkedList<>(listNeighbors);//create the neighbors list\n if (Neighbors == null) continue;\n for (node_info n : Neighbors) {\n if (n.getInfo() == null) {//if there is a node we didn't visited it yet, we will insert it to the linkedList\n qValues.add(n);\n }\n }\n }\n if (this.ga.nodeSize() != counterVisitedNodes) return false;//check that we visited all of the nodes\n\n return true;\n }", "@Override\n public boolean hasEdge(V from, V to)\n {\n if (from.equals(null) || to.equals(null)){\n throw new IllegalArgumentException();\n }\n if (!contains(from)){\n return false;\n }\n else{\n Iterator graphIterator = graph.entrySet().iterator();\n Map.Entry graphElement = (Map.Entry) graphIterator.next();\n V vert = (V) graphElement.getKey();\n while (graphIterator.hasNext() && vert != from){\n graphElement = (Map.Entry) graphIterator.next();\n vert = (V)graphElement.getKey();\n }\n\t ArrayList <V> edges = graph.get(vert);\n\t return edges.contains(to);\n\t }\n }", "@Override\n\tpublic boolean containsNode(Object node)\n\t{\n\t\t// This is presumably faster than searching through nodeList\n\t\treturn nodeEdgeMap.containsKey(node);\n\t}", "public boolean containsEdge(Edge e)\n\t{\n\t\tif (e.getOne() == null || e.getTwo() == null)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\treturn this.edges.containsKey(e.hashCode());\n\t}", "@Test\n\tvoid testEdgesNotNull() {\n\t\tmap.put(\"Boston\", new LinkedHashSet<String>());\n\t\tAssertions.assertNotNull(map.get(\"Boston\"));\n\n\t}", "boolean contains(Edge edge);", "public abstract boolean isUsing(Edge graphEdge);", "public void addEdge(String node1, String node2) {\n\r\n LinkedHashSet<String> adjacent = map.get(node1);\r\n// checking to see if adjacent node exist or otherwise is null \r\n if (adjacent == null) {\r\n adjacent = new LinkedHashSet<String>();\r\n map.put(node1, adjacent);\r\n }\r\n adjacent.add(node2); // if exist we add the instance node to adjacency list\r\n }", "boolean hasHasNodeID();", "private boolean edgeExists() {\n for (int i = 1; i < parentMatrix[randomChild][0]; i++) {\n if (parentMatrix[randomChild][i] == randomParent) {\n return true;\n }\n }\n return false;\n }", "@Override\n public boolean containsNodeFor(E item) {\n if(item == null){\n throw new NullPointerException(\"Received null as value.\");\n }\n return graphNodes.containsKey(item);\n }", "public boolean containsEdge(Edge e){\n\t\treturn edges.containsKey(e.hashCode());\n\t}", "@Test\n\tvoid testVerticesExist() {\n\t\tLinkedHashSet<String> edges = new LinkedHashSet<String>();\n\n\t\tedges.add(\"Newark\");\n\t\tedges.add(\"New York\");\n\t\tmap.put(\"Boston\", edges);\n\t\tedges = map.get(\"Boston\");\n\t\tString[] edgesArray = new String[edges.size()];\n\t\tedgesArray = edges.toArray(edgesArray);\n\t\tAssertions.assertTrue(map.containsKey(\"Boston\"));\n\n\t\tedges = new LinkedHashSet<String>();\n\t\tedges.add(\"Philadelphia\");\n\t\tmap.put(\"Newark\", edges);\n\t\tedgesArray = new String[edges.size()];\n\t\tedgesArray = edges.toArray(edgesArray);\n\t\tAssertions.assertTrue(map.containsKey(\"Newark\"));\n\n\t\tedges = new LinkedHashSet<String>();\n\t\tedges.add(\"Albany\");\n\t\tmap.put(\"Trenton\", edges);\n\t\tedgesArray = new String[edges.size()];\n\t\tedgesArray = edges.toArray(edgesArray);\n\t\tAssertions.assertTrue(map.containsKey(\"Trenton\"));\n\t}", "private static boolean putInHashMap(Node head) {\r\n\t\tboolean hasloop = false;\r\n\t\tHashSet<Node> nodeSet = new HashSet();\r\n\t\twhile (head != null) {\r\n\t\t\tif (nodeSet.contains(head)) {\r\n\t\t\t\thasloop = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tnodeSet.add(head);\r\n\t\t\thead = head.next;\r\n\t\t}\r\n\r\n\t\treturn hasloop;\r\n\t}", "boolean hasNeighbor(String descrip) {\n return this.neighbors.containsKey(descrip);\n }", "public boolean DijkstraHelp(int src, int dest) {\n PriorityQueue<Entry>queue=new PriorityQueue();//queue storages the nodes that we will visit by the minimum tag\n //WGraph_DS copy = (WGraph_DS) (copy());//create a copy graph that the algorithm will on it\n initializeTag();\n initializeInfo();\n node_info first=this.ga.getNode(src);\n first.setTag(0);//distance from itself=0\n queue.add(new Entry(first,first.getTag()));\n while(!queue.isEmpty()) {\n Entry pair=queue.poll();\n node_info current= pair.node;\n if (current.getInfo() != null) continue;//if we visit we can skip to the next loop because we have already marked\n current.setInfo(\"visited\");//remark the info\n Collection<node_info> listNeighbors = this.ga.getV(current.getKey());//create a collection for the neighbors list\n LinkedList<node_info> Neighbors = new LinkedList<>(listNeighbors);//create the neighbors list\n if (Neighbors == null) continue;\n for(node_info n:Neighbors) {\n\n if(n.getTag()>ga.getEdge(n.getKey(),current.getKey())+current.getTag())\n {\n n.setTag(current.getTag() + ga.getEdge(n.getKey(), current.getKey()));//compute the new tag\n }\n queue.add(new Entry(n,n.getTag()));\n }\n }\n Iterator<node_info> it=this.ga.getV().iterator();\n while(it.hasNext()){\n if(it.next().getInfo()==null) return false;\n }\n return true;\n }", "public boolean hasEdge(String id1, String id2)\n\t{\n\t\treturn nodes.containsKey(id1) && getNode(id1).hasEdge(id2);\n\t}", "public HashMap<Integer, edge_data> getNi() {\n return neighborEdges;\n }", "@Override\n public boolean isConnected() {\n for (node_data n : G.getV()) {\n bfs(n.getKey());\n for (node_data node : G.getV()) {\n if (node.getTag() == 0)\n return false;\n }\n }\n return true;\n }", "public void testContainsEdge() {\n System.out.println(\"containsEdge\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n if ((i + j) % 2 != 0) {\n Assert.assertFalse(graph.containsEdge(new Integer(i), new Integer(j)));\n } else {\n Assert.assertTrue(graph.containsEdge(new Integer(i), new Integer(j)));\n }\n }\n }\n\n }", "public boolean containsEdge(E edge);", "boolean hasNode();", "boolean hasNode();", "@Override\n\tpublic boolean isConnected() {\n\t\tif(dwg.getV().size()==0) return true;\n\n\t\tIterator<node_data> temp = dwg.getV().iterator();\n\t\twhile(temp.hasNext()) {\n\t\t\tfor(node_data w : dwg.getV()) {\n\t\t\t\tw.setTag(0);\n\t\t\t}\n\t\t\tnode_data n = temp.next();\n\t\t\tQueue<node_data> q = new LinkedBlockingQueue<node_data>();\n\t\t\tn.setTag(1);\n\t\t\tq.add(n);\n\t\t\twhile(!q.isEmpty()) {\n\t\t\t\tnode_data v = q.poll();\n\t\t\t\tCollection<edge_data> arrE = dwg.getE(v.getKey());\n\t\t\t\tfor(edge_data e : arrE) {\n\t\t\t\t\tint keyU = e.getDest();\n\t\t\t\t\tnode_data u = dwg.getNode(keyU);\n\t\t\t\t\tif(u.getTag() == 0) {\n\t\t\t\t\t\tu.setTag(1);\n\t\t\t\t\t\tq.add(u);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tv.setTag(2);\n\t\t\t}\n\t\t\tCollection<node_data> col = dwg.getV();\n\t\t\tfor(node_data n1 : col) {\n\t\t\t\tif(n1.getTag() != 2) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public boolean isAdjacent(int from, int to) {\n//your code here\n// LinkedList<Edge> list = adjLists[from];\n// for (Edge a : list) {\n// if(a.from()==from&&a.to()==to){\n// return true;\n// }\n// };\n// return false;\n return pathExists(from, to);\n }", "public boolean hasEdge(int i,int j){\n return Matrix[i][j];\n }", "public boolean hasEdge(Node k){\n for(int i = 0; i<edges.size(); i++){\n Edge edge = edges.get(i);\n if(edge.end() == k){\n return true;\n }\n }\n return false;\n }", "public boolean contains(Node n) {\n\t\t\n\t\t//Validate n has a value\n\t\tif (n == null) { \n\t\t\treturn false; \n\t\t} \n\t\t\n\t\t//Node not present in hashmap\n\t\tif (!nodes.contains(n)) {\n\t\t\treturn false; \n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "@Override\n\tpublic void addNode(node_data n) {\n\t\tif (Nodes.keySet().contains(n.getKey())) {\n\t\t\tSystem.err.println(\"Err: key already exists, add fail\");\n\t\t\treturn;\n\t\t}\n\t\tif(n.getWeight()<=0)\n\t\t{\n\t\t\tSystem.err.println(\"The weight must be positive! . The node hadn't been added successfully..\");\n\t\t\treturn;\n\t\t}\n\t\tthis.Nodes.put(n.getKey(), n);//n used to be casted into (node)\n\t\tthis.Edges.put(n.getKey(), new HashMap<Integer,edge_data>());\n\t\tMC++;\n\n\t}", "public boolean hasEdge(K u, K v)\n\t{\n \tList<HashMap<K, Integer>> adj = adjLists.get(u);\n\n \t// check for edge already being there\n \tint count=0;\n \tfor (HashMap<K, Integer> A:adj){\n \t\tfor (K vertex:A.keySet()){\n \t\t\tif (!vertex.equals(v))\n \t\t {\n \t\t\t\tcount++;\n\n \t\t }\n \t\t}\n \t\t\n \t}\n \tif (count==adj.size()) return false;\n \treturn true;\n\t}", "private boolean addIfUseful(HashSet visited, HashSet path, Node n) {\n if (path.contains(n)) return true;\n path.add(n);\n if (visited.contains(n)) return nodes.containsKey(n);\n visited.add(n);\n boolean useful = false;\n if (nodes.containsKey(n)) {\n if (TRACE_INTER) out.println(\"Useful: \"+n);\n useful = true;\n }\n if (n instanceof UnknownTypeNode) {\n path.remove(n);\n return true;\n }\n if (n.addedEdges != null) {\n if (TRACE_INTER) out.println(\"Useful because of added edge: \"+n);\n useful = true;\n for (Iterator i = n.getNonEscapingEdgeTargets().iterator(); i.hasNext(); ) {\n addAsUseful(visited, path, (Node) i.next());\n }\n }\n if (n.accessPathEdges != null) {\n for (Iterator i = n.accessPathEdges.entrySet().iterator(); i.hasNext(); ) {\n java.util.Map.Entry e = (java.util.Map.Entry)i.next();\n //jq_Field f = (jq_Field)e.getKey();\n Object o = e.getValue();\n if (o instanceof Node) {\n if (addIfUseful(visited, path, (Node)o)) {\n if (TRACE_INTER && !useful) out.println(\"Useful because outside edge: \"+n+\"->\"+o);\n useful = true;\n } else {\n if (n != o) i.remove();\n }\n } else {\n for (Iterator j=((Set)o).iterator(); j.hasNext(); ) {\n Node n2 = (Node)j.next();\n if (addIfUseful(visited, path, n2)) {\n if (TRACE_INTER && !useful) out.println(\"Useful because outside edge: \"+n+\"->\"+n2);\n useful = true;\n } else {\n if (n != n2) j.remove();\n }\n }\n if (!useful) i.remove();\n }\n }\n }\n if (castPredecessors.contains(n)) {\n for (Iterator i = castMap.entrySet().iterator(); i.hasNext(); ) {\n Map.Entry e = (Map.Entry)i.next();\n Node goestocast = (Node)((Pair)e.getKey()).left;\n CheckCastNode castsucc = (CheckCastNode)e.getValue();\n // Call \"addIfUseful()\" on all successor checkcast nodes, and set the \"useful\" flag if the call returns true.\n if (n == goestocast && addIfUseful(visited, path, castsucc))\n useful = true;\n }\n }\n if (n instanceof ReturnedNode) {\n if (TRACE_INTER && !useful) out.println(\"Useful because ReturnedNode: \"+n);\n useful = true;\n }\n if (n.predecessors != null) {\n useful = true;\n if (TRACE_INTER && !useful) out.println(\"Useful because target of added edge: \"+n);\n for (Iterator i = n.getPredecessorTargets().iterator(); i.hasNext(); ) {\n addAsUseful(visited, path, (Node) i.next());\n }\n }\n if (useful) {\n this.nodes.put(n, n);\n if (n instanceof FieldNode) {\n FieldNode fn = (FieldNode)n;\n for (Iterator i = fn.getAccessPathPredecessors().iterator(); i.hasNext(); ) {\n addAsUseful(visited, path, (Node)i.next());\n }\n }\n if (n instanceof CheckCastNode) {\n // If the \"useful\" flag is true and the node is a checkcast node,\n // call \"addAsUseful()\" on all predecessors.\n Quad thiscast = ((QuadProgramLocation)((CheckCastNode)n).getLocation()).getQuad();\n for (Iterator i = castPredecessors.iterator(); i.hasNext(); ) {\n Node goestocast = (Node)i.next();\n CheckCastNode castsucc = (CheckCastNode)castMap.get(new Pair(goestocast, thiscast));\n if (castsucc != null)\n addAsUseful(visited, path, goestocast);\n }\n }\n }\n if (TRACE_INTER && !useful) out.println(\"Not useful: \"+n);\n path.remove(n);\n return useful;\n }", "public boolean hasNeighbours() {\n\t\tif (this.eltZero != null || this.eltOne != null || this.eltTwo != null)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "boolean containsEdge(V v, V w);", "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 }", "@Override\n\tpublic boolean isConnected() {\n\t\tif(this.GA.nodeSize() ==1 || this.GA.nodeSize()==0) return true;\n\t\tgraph copied = this.copy();\n\t\ttagZero(copied);\n\t\tCollection<node_data> s = copied.getV();\n\t\tIterator it = s.iterator();\n\t\tnode_data temp = (node_data) it.next();\n\t\tDFSUtil(copied,temp);\n\t\tfor (node_data node : s) {\n\t\t\tif (node.getTag() == 0) return false;\n\t\t}\n\t\ttransPose(copied);\n\t\ttagZero(copied);\n\t Collection<node_data> s1 = copied.getV();\n\t\tIterator it1 = s1.iterator();\n\t\tnode_data temp1 = (node_data) it1.next();\n\t\tDFSUtil(copied,temp1);\n\t\tfor (node_data node1 : s1) {\n\t\t\tif (node1.getTag() == 0) return false;\n\t\t}\n\n\t\treturn true;\n\t}", "@Override\n public int hashCode() {\n return Objects.hashCode(nodes(), edgeToIncidentNodes);\n }", "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 }", "boolean hasIsNodeOf();", "public abstract boolean putEdge(Edge incomingEdge);", "default boolean isEdge(int x, int y) {\n return getNeighbors(x).contains(y);\n }", "@Override\r\n public boolean edgeExists(Vertex v1, Vertex v2) {\r\n return adjacencyList.get(v1).contains(v2); //checking if the list of adjacent vertices contains v2\r\n }", "@Test \r\n void create_edge_between_to_nonexisted_vertexes() {\r\n graph.addEdge(\"A\", \"B\");\r\n List<String> adjacentA = graph.getAdjacentVerticesOf(\"A\");\r\n List<String> adjacentB = graph.getAdjacentVerticesOf(\"B\");\r\n if(!adjacentA.contains(\"B\")) { \r\n fail();\r\n }\r\n if(adjacentB.contains(\"A\")) { \r\n fail();\r\n }\r\n }", "boolean hasNodeId();", "public abstract boolean isUsing(Long graphNode);", "public boolean containsEdge(Edge<V> edge);", "boolean hasIsVertexOf();", "@Override\r\n\tprotected final int containsEdge(E edge) {\n\t\tfor(int i = 0; i < getSize(); i++)\r\n\t\t\tif(getEdge(i) == edge)\r\n\t\t\t\treturn i;\r\n\t\t\r\n\t\treturn -1;\r\n\t}", "public boolean unknownEdges(String id)\n\t{\n\t\treturn getNode(id).unknownEdges;\n\t}", "protected boolean hasNode(int ID) {\n\t\treturn nodes.containsKey(ID);\n\t}", "public static strictfp void main(String... args) {\n\t\tArrayList<Vertex> graph = new ArrayList<>();\r\n\t\tHashMap<Character, Vertex> map = new HashMap<>();\r\n\t\t// add vertices\r\n\t\tfor (char c = 'a'; c <= 'i'; c++) {\r\n\t\t\tVertex v = new Vertex(c);\r\n\t\t\tgraph.add(v);\r\n\t\t\tmap.put(c, v);\r\n\t\t}\r\n\t\t// add edges\r\n\t\tfor (Vertex v: graph) {\r\n\t\t\tif (v.getNodeId() == 'a') {\r\n\t\t\t\tv.getAdjacents().add(map.get('b'));\r\n\t\t\t\tv.getAdjacents().add(map.get('h'));\r\n\t\t\t} else if (v.getNodeId() == 'b') {\r\n\t\t\t\tv.getAdjacents().add(map.get('a'));\r\n\t\t\t\tv.getAdjacents().add(map.get('c'));\r\n\t\t\t\tv.getAdjacents().add(map.get('h'));\r\n\t\t\t} else if (v.getNodeId() == 'c') {\r\n\t\t\t\tv.getAdjacents().add(map.get('b'));\r\n\t\t\t\tv.getAdjacents().add(map.get('d'));\r\n\t\t\t\tv.getAdjacents().add(map.get('f'));\r\n\t\t\t\tv.getAdjacents().add(map.get('i'));\r\n\t\t\t} else if (v.getNodeId() == 'd') {\r\n\t\t\t\tv.getAdjacents().add(map.get('c'));\r\n\t\t\t\tv.getAdjacents().add(map.get('e'));\r\n\t\t\t\tv.getAdjacents().add(map.get('f'));\r\n\t\t\t} else if (v.getNodeId() == 'e') {\r\n\t\t\t\tv.getAdjacents().add(map.get('d'));\r\n\t\t\t\tv.getAdjacents().add(map.get('f'));\r\n\t\t\t} else if (v.getNodeId() == 'f') {\r\n\t\t\t\tv.getAdjacents().add(map.get('c'));\r\n\t\t\t\tv.getAdjacents().add(map.get('d'));\r\n\t\t\t\tv.getAdjacents().add(map.get('e'));\r\n\t\t\t\tv.getAdjacents().add(map.get('g'));\r\n\t\t\t} else if (v.getNodeId() == 'g') {\r\n\t\t\t\tv.getAdjacents().add(map.get('f'));\r\n\t\t\t\tv.getAdjacents().add(map.get('h'));\r\n\t\t\t\tv.getAdjacents().add(map.get('i'));\r\n\t\t\t} else if (v.getNodeId() == 'h') {\r\n\t\t\t\tv.getAdjacents().add(map.get('a'));\r\n\t\t\t\tv.getAdjacents().add(map.get('b'));\r\n\t\t\t\tv.getAdjacents().add(map.get('g'));\r\n\t\t\t\tv.getAdjacents().add(map.get('i'));\r\n\t\t\t} else if (v.getNodeId() == 'i') {\r\n\t\t\t\tv.getAdjacents().add(map.get('c'));\r\n\t\t\t\tv.getAdjacents().add(map.get('g'));\r\n\t\t\t\tv.getAdjacents().add(map.get('h'));\r\n\t\t\t}\t\r\n\t\t}\r\n\t\t// graph created\r\n\t\t// create disjoint sets\r\n\t\tDisjointSet S = null, V_S = null;\r\n\t\tfor (Vertex v: graph) {\r\n\t\t\tchar c = v.getNodeId();\r\n\t\t\tif (c == 'a' || c == 'b' || c == 'd' || c == 'e') {\r\n\t\t\t\tif (S == null) {\r\n\t\t\t\t\tS = v.getDisjointSet();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tDisjointSet set = DisjointSet.union(S, v.getDisjointSet());\r\n\t\t\t\t\tv.setDisjointSet(set);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (V_S == null) {\r\n\t\t\t\t\tV_S = v.getDisjointSet();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tDisjointSet set = DisjointSet.union(V_S, v.getDisjointSet());\r\n\t\t\t\t\tv.setDisjointSet(set);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Disjoint sets created\r\n\t\tfor (Vertex u: graph) {\r\n\t\t\tfor (Vertex v: u.getAdjacents()) {\r\n\t\t\t\tif (DisjointSet.findSet((DisjointSet) u.getDisjointSet()) == \r\n\t\t\t\t DisjointSet.findSet((DisjointSet) v.getDisjointSet())) {\r\n\t\t\t\t\tSystem.out.println(\"The cut respects (\" + u.getNodeId() + \", \" + v.getNodeId() + \").\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public boolean hasNeighbour(int index) {\n\t\tswitch (index) {\n\t\tcase 0:\n\t\t\treturn this.eltZero != null;\n\t\tcase 1:\n\t\t\treturn this.eltOne != null;\n\t\tcase 2:\n\t\t\treturn this.eltTwo != null;\n\t\tdefault:\n\t\t\treturn false;\n\t\t}\n\t}", "@Test\n\tvoid testEdgesNull() {\n\t\tmap.put(\"Boston\", null);\n\t\tAssertions.assertNull(map.get(\"Boston\"));\n\n\t}", "boolean addEdge(E edge);", "public boolean isEdge(int s,int d) throws Exception\r\n\t{\r\n\t\tif(s>=0&&s<n&&d>=0&&d<n)\r\n\t\t{\r\n\t\t\tLinkedList l=g.get(s);\r\n\t\t\tNode temp=l.getHead();\r\n\t\t\twhile(temp!=null)\r\n\t\t\t{\r\n\t\t\t\tif(temp.getData()==g.get(d).getHead().getData())\r\n\t\t\t\t{\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\ttemp=temp.getNext();\t\t\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t\tthrow new Exception(\"Vertex is not present\");\r\n\t}", "protected abstract void calculateH(Node node);", "List<GraphEdge> getNeighbors(NodeKey key);", "Node findLoopByHash(Node n){\n Hashtable<Node,Integer> nodes = new Hashtable<Node,Integer>();\n while (n.next != null){\n if (nodes.containsKey(n)) break;\n nodes.put(n,1);\n n=n.next;\n }\n if (n.next != null) return n;\n return null;\n }", "public abstract boolean getEdge(Point a, Point b);", "public abstract void map(Edge queryEdge, Edge graphEdge);", "public boolean inSamePseudoNode(Edge e) {\n\t\tthrow new RuntimeException(\"Unimplemented\");\r\n\t}", "@Test\n\tvoid testEdgesAreEqualForGivenVertice() {\n\t\tLinkedHashSet<String> edges = new LinkedHashSet<String>();\n\n\t\tedges.add(\"Newark\");\n\t\tedges.add(\"New York\");\n\t\tmap.put(\"Boston\", edges);\n\t\tedges = map.get(\"Boston\");\n\t\tString[] edgesArray = new String[edges.size()];\n\t\tedgesArray = edges.toArray(edgesArray);\n\t\tAssertions.assertEquals(\"Newark\", edgesArray[0]);\n\t\tAssertions.assertEquals(\"New York\", edgesArray[1]);\n\n\t\tedges = new LinkedHashSet<String>();\n\t\tedges.add(\"Philadelphia\");\n\t\tmap.put(\"Newark\", edges);\n\t\tedgesArray = new String[edges.size()];\n\t\tedgesArray = edges.toArray(edgesArray);\n\t\tAssertions.assertEquals(\"Philadelphia\", edgesArray[0]);\n\n\t\tedges = new LinkedHashSet<String>();\n\t\tedges.add(\"Albany\");\n\t\tmap.put(\"Trenton\", edges);\n\t\tedgesArray = new String[edges.size()];\n\t\tedgesArray = edges.toArray(edgesArray);\n\t\tAssertions.assertEquals(\"Albany\", edgesArray[0]);\n\t}", "public boolean containsEdge(V source, V target);", "private boolean isEdge(Node node) {\n for (Node n: nodes){\n if(!node.equals(n)) {\n for(Edge e:n.getEdges()){\n if(e.getDestination().equals(node)) {\n return true;\n }\n }\n }\n }\n return false;\n }", "void addNeighborEdge(Edge e) {\n\t\t\t_neighborEdges.put(e,false);\n\t\t}", "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 }", "@Override\n public boolean contains(V vertex)\n {\n if (vertex.equals(null)){\n throw new IllegalArgumentException();\n }\n return graph.containsKey(vertex);\n }", "public interface PathExistsInGraph {\n\n boolean validPath(int n, int[][] edges, int start, int end);\n\n default Map<Integer, Set<Integer>> prepareGraph(final int n, final int[][] edges) {\n Map<Integer, Set<Integer>> graph = new HashMap<>();\n for (int i = 0; i < n; i++) {\n graph.put(i, new HashSet<>());\n }\n for (int[] edge : edges) {\n graph.get(edge[0]).add(edge[1]);\n graph.get(edge[1]).add(edge[0]);\n }\n return graph;\n }\n}", "@Override\n public boolean addEdge(E vertex1, E vertex2) {\n if (vertex1 != null\n && vertex2 != null\n && vertex1 != vertex2\n && dictionary.containsKey(vertex1)\n && dictionary.containsKey(vertex2)) {\n dictionary.get(vertex1).add(vertex2);\n dictionary.get(vertex2).add(vertex1);\n return true;\n } else {\n return false;\n }\n }", "public boolean contains(N node)\r\n/* 56: */ {\r\n/* 57:105 */ assert (checkRep());\r\n/* 58:106 */ return this.map.containsKey(node);\r\n/* 59: */ }", "Set getNi()\n {\n return neighbors.keySet();\n }", "public abstract boolean isConnectedInDirection(N n1, E edgeValue, N n2);", "protected abstract Set<T> findNeighbors(T node, Map<T, T> parentMap);", "public final void connectIfNotFound(N n1, E edge, N n2) {\n if (!isConnected(n1, edge, n2)) {\n connect(n1, edge, n2);\n }\n }", "@Override\n\t/*\n\t * public int checkNodeInDBByCoordinate(Coordinate coordinate) {\n\t * \n\t * ResultSet resultSet = null; int x = coordinate.getX(); int y =\n\t * coordinate.getY(); try {\n\t * \n\t * String checkNodesInDB =\n\t * \"select id from routefinder.node where x=? and y=?\"; pstmt =\n\t * conn.prepareStatement(checkNodesInDB); pstmt.setInt(1, x);\n\t * pstmt.setInt(2, y); resultSet = pstmt.executeQuery(); if\n\t * (resultSet.next()) { return resultSet.getInt(\"id\"); } else {\n\t * System.out.println(\"Cannot find node \" + x + \", \" + y); return -1; } }\n\t * catch (SQLException se) { se.printStackTrace(); return -1; } finally {\n\t * JdbcConnect.resultClose(resultSet, pstmt); } }\n\t */\n\tpublic int checkNodeRelationInDBByNodeRelation(NodeRelation[] nodeRelation) {\n\t\treturn 0;\n\t}", "public int checkEdgeDirection(Object src, Object dest)\n\t{\t\t\n\t\tif(this.map.get(src).contains(dest) && !this.map.get(dest).contains(src))\n\t\t\treturn 1;\n\t\telse if(this.map.get(src).contains(dest) && this.map.get(dest).contains(src))\n\t\t\treturn 2;\n\t\treturn 0;\n\t}", "@Override\n\tpublic edge_data getEdge(int src, int dest) {\n\t\tif(Nodes.containsKey(src) && Nodes.containsKey(dest) && Edges.get(src).containsKey(dest)) {\n\t\t\treturn Edges.get(src).get(dest);\n\t\t}\n\t\treturn null;\n\t}", "boolean hasPathTo(int v)\n\t{\n\t\treturn edgeTo[v].weight()!=Double.POSITIVE_INFINITY;\n\t}", "private void constructHMap() {\n\t\tfor (int i = 0; i < hMap.length; i++) {\n\t\t\tfor (int j = 0; j < hMap[0].length; j++) {\n\t\t\t\tif (hMap[i][j] == 0) {\n\t\t\t\t\tSkiNode head = new SkiNode(map[i][j], i, j, null);\n\t\t\t\t\tbuildSkiTree(head);\n\t\t\t\t\tupdateSkiTreeLevel(head);\n\t\t\t\t\tif (goodHeads.isEmpty()) {\n\t\t\t\t\t\tgoodHeads.add(new SkiNode(head));\n\t\t\t\t\t} else if (goodHeads.getFirst().level == head.level) {\n\t\t\t\t\t\tgoodHeads.add(new SkiNode(head));\n\t\t\t\t\t} else if (goodHeads.getFirst().level < head.level) {\n\t\t\t\t\t\tgoodHeads.clear();\n\t\t\t\t\t\tgoodHeads.add(new SkiNode(head));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private boolean hasANeighbour(Graph<V, E> g, Set<V> set, V v)\n {\n return set.stream().anyMatch(s -> g.containsEdge(s, v));\n }", "@Override\r\n public Collection<edge_data> getE(int node_id) {\r\n return this.neighbors.get(node_id).values(); //o(k)\r\n }", "void parseline(){\n\t\ttry {\n\t\tString currentLine;\n\t\tBufferedReader freader = new BufferedReader(new FileReader(\"C:\\\\wt2g_inlinks.txt\")); //default to dataset\n\t//\tBufferedReader freader = new BufferedReader(new FileReader(\"C:\\\\inlink.txt\")); // Use this for Graph \n\t\tSet<String> ar ;\n\t\t\twhile((currentLine= freader.readLine()) != null){ \n\t\t\t\tSet<String> in_data = new HashSet<>();\n\t\t\t\tStringTokenizer st = new StringTokenizer(currentLine,\" \");\n\t\t\t\tString node = st.nextToken();\n\t\t\t\tif(!inlinks.containsKey(node)){\n\t\t\t\t\tinlinks.put(node, null); // All the nodes are stored in inlinks Map\n\t\t\t\t}\n\t\t\t\t\twhile(st.hasMoreTokens()){\n\t\t\t\t\t\tString edge = st.nextToken();\n\t\t\t\t\t if(!inlinks.containsKey(edge)){\n\t\t\t\t\t \tinlinks.put(edge, null);\n\t\t\t\t\t } \n\t\t\t\t\t if(inlinks.get(node)!=null){\n\t\t\t\t\t \tSet B = inlinks.get(node);\n\t\t\t\t\t \tB.add(edge);\n\t\t\t\t\t \tinlinks.put(node, B);\n\t\t\t\t\t }\n\t\t\t\t\t else{\n\t\t\t\t\t in_data.add(edge);\n\t\t\t\t\t inlinks.put(node, in_data);\n\t\t\t\t\t }\t\t\t\t\t \n\t\t\t\t\t if(!(outlinks.containsKey(edge))){ //Creating the outlinks Map \n\t\t\t\t\t\t Set<String > nd = new HashSet<>();\n\t\t\t\t\t\t nd.add(node);\n\t\t\t\t\t outlinks.put(edge, nd);\n\t\t\t\t\t }\t\n\t\t\t\t\t else{\n\t\t\t\t\t\t ar = outlinks.get(edge);\n\t\t\t\t\t\t ar.add(node);\n\t\t\t\t\t\t outlinks.put(edge, ar);\n\t\t\t\t\t }\n\t\t\t\t\t}\n \t\t\t\t \n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t }\n\t\t\n\t\tSystem.out.println(\"Total Nodes : \" +inlinks.size());\n\t\t\n for(String str : inlinks.keySet()){\n \tSet s1 = inlinks.get(str);\n \tif(s1 != null)\n \tinlinks_count.put(str, s1.size());\n \telse\n \t\tsource++;\n }\n System.out.println(\"Total Source \" +source);\n \n for(String str : outlinks.keySet()){\n \tSet s1 = outlinks.get(str);\n \toutlinks_count.put(str, s1.size());\n }\n\t}", "public int hashCode()\r\n\t{\r\n\t return edgeType.hashCode();\r\n\t}", "protected void processEdge(Edge e) {\n\t}", "@Override\n public E getEdgeIfExists(int pintSourceVertexID, int pintDestinationVertexID) {\n V vertexFrom = getVertex(pintSourceVertexID);\n V vertexTo = getVertex(pintDestinationVertexID);\n for(TimeFrame tf : darrGlobalAdjList.get(pintSourceVertexID).keySet()) {\n for (E e : darrGlobalAdjList.get(pintSourceVertexID).get(tf)) { \n if (e.getOtherEndPoint(vertexFrom).equals(vertexTo)) {\n return e;\n }\n } \n }\n return null;\n }", "@Override\n\tpublic int hashCode()\n\t{\n\t\t// This is really simple, but it works... and prevents a deep hash\n\t\treturn nodeList.size() + edgeList.size() * 23;\n\t}", "public E getEdge(N startNode, N endNode)\r\n/* 90: */ {\r\n/* 91:166 */ assert (checkRep());\r\n/* 92:167 */ if ((contains(startNode)) && (((Map)this.map.get(startNode)).containsKey(endNode))) {\r\n/* 93:168 */ return ((Map)this.map.get(startNode)).get(endNode);\r\n/* 94: */ }\r\n/* 95:170 */ return null;\r\n/* 96: */ }", "public boolean isEdge( VKeyT fromKey, VKeyT toKey )\n throws NoSuchVertexException;", "public void addUndirectedEdge(int v1, int v2, Object edgeInfo) {\n//your code here\n Edge edge1 = new Edge(v1, v2, edgeInfo);\n Edge edge2 = new Edge(v2, v1, edgeInfo);\n if(!adjLists[v1].contains(edge1)){\n adjLists[v1].addLast(edge1);\n }\n if(!adjLists[v2].contains(edge2)){\n adjLists[v2].addLast(edge2);\n }\n }", "@Override\r\n public boolean equals(Object o) {\r\n GraphNode n = (GraphNode) o;\r\n if (n != null && n.getX() == getX() && n.getY() == getY())\r\n return true;\r\n return false;\r\n }", "public boolean addEdge(jq_Field m, Node n) {\n //if (TRACK_REASONS) {\n // if (edgesToReasons == null) edgesToReasons = new HashMap();\n //if (!edgesToReasons.containsKey(Edge.get(this, n, m)))\n // edgesToReasons.put(new Edge(this, n, m), q);\n //}\n n.addPredecessor(m, this);\n if (addedEdges == null) addedEdges = new LinkedHashMap();\n Object o = addedEdges.get(m);\n if (o == null) {\n addedEdges.put(m, n);\n return true;\n }\n if (o instanceof Set) {\n return ((Set)o).add(n);\n }\n if (o == n) {\n return false;\n }\n Set s = NodeSet.FACTORY.makeSet(); s.add(o); s.add(n);\n addedEdges.put(m, s);\n return true;\n }" ]
[ "0.67393225", "0.66660994", "0.65117514", "0.6481158", "0.6338951", "0.6194047", "0.6161394", "0.6158513", "0.61424047", "0.6130135", "0.61249703", "0.61128247", "0.60438174", "0.60423094", "0.60421145", "0.6037614", "0.59757817", "0.59741086", "0.59617233", "0.59339017", "0.59290487", "0.5909758", "0.590013", "0.58929396", "0.5873386", "0.5871885", "0.5867834", "0.5861128", "0.5839159", "0.5836045", "0.5812724", "0.5811502", "0.5811502", "0.5801739", "0.57991517", "0.57718706", "0.57698464", "0.57662433", "0.5759367", "0.5744724", "0.57404107", "0.57356787", "0.57217443", "0.5707806", "0.5701932", "0.5696948", "0.56730515", "0.5672486", "0.56698114", "0.5660764", "0.5654483", "0.5649678", "0.5641038", "0.56201506", "0.5616729", "0.56154823", "0.56085694", "0.5606745", "0.5592551", "0.5591322", "0.55863017", "0.55854404", "0.55766875", "0.5572798", "0.5568516", "0.5567718", "0.5563638", "0.5542099", "0.55364054", "0.5535376", "0.5532719", "0.5518652", "0.55177206", "0.5513944", "0.5513829", "0.54973984", "0.54933935", "0.5482724", "0.54800415", "0.54742765", "0.54703873", "0.54643184", "0.5460564", "0.5457833", "0.5456943", "0.54459476", "0.544025", "0.54338115", "0.5419072", "0.541107", "0.54087377", "0.5407048", "0.5405921", "0.5399967", "0.5394864", "0.53929985", "0.5387325", "0.5372915", "0.53678143", "0.5362758" ]
0.668496
1
/ if the graph contains the node1 and node 2 we can check in Ni of node1 and if his key is node 2 Remember the key of Ni HashMap is the key of the destination node of the edge !
public double getEdge(int node1, int node2) { if(getNodes().containsKey(node1) && getNodes().containsKey(node2)) { Node s=(Node) getNodes().get(node1); if(s.getEdgesOf().containsKey(node2)) { return s.getEdgesOf().get(node2).get_weight(); } } return -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addEdge(String node1, String node2) {\n\r\n LinkedHashSet<String> adjacent = map.get(node1);\r\n// checking to see if adjacent node exist or otherwise is null \r\n if (adjacent == null) {\r\n adjacent = new LinkedHashSet<String>();\r\n map.put(node1, adjacent);\r\n }\r\n adjacent.add(node2); // if exist we add the instance node to adjacency list\r\n }", "public boolean hasEdge(int node1, int node2)\n{\n\tNode s=(Node)this.getNodes().get(node1);\n return s.hasNi(node2);\n\t\n}", "@Override\n public boolean isConnected() { //i got help from the site https://www.geeksforgeeks.org/shortest-path-unweighted-graph/\n if(this.ga.edgeSize()<this.ga.nodeSize()-1) return false;\n initializeInfo();//initialize all the info fields to be null for the algorithm to work\n if(this.ga.nodeSize()==0||this.ga.nodeSize()==1) return true;//if there is not node or one its connected\n WGraph_DS copy = (WGraph_DS) (copy());//create a copy graph that the algorithm will on it\n LinkedList<node_info> qValues = new LinkedList<>();//create linked list that will storage all nodes that we didn't visit yet\n int firstNodeKey = copy.getV().iterator().next().getKey();//first key for get the first node(its doesnt matter which node\n node_info first = copy.getNode(firstNodeKey);//get the node\n qValues.add(first);//without limiting generality taking the last node added to graph\n int counterVisitedNodes = 0;//counter the times we change info of node to \"visited\"\n while (qValues.size() != 0) {\n node_info current = qValues.removeFirst();\n if (current.getInfo() != null) continue;//if we visit we can skip to the next loop because we have already marked\n current.setInfo(\"visited\");//remark the info\n counterVisitedNodes++;\n\n Collection<node_info> listNeighbors = copy.getV(current.getKey());//create a collection for the neighbors list\n LinkedList<node_info> Neighbors = new LinkedList<>(listNeighbors);//create the neighbors list\n if (Neighbors == null) continue;\n for (node_info n : Neighbors) {\n if (n.getInfo() == null) {//if there is a node we didn't visited it yet, we will insert it to the linkedList\n qValues.add(n);\n }\n }\n }\n if (this.ga.nodeSize() != counterVisitedNodes) return false;//check that we visited all of the nodes\n\n return true;\n }", "public boolean isConnected(String node1, String node2) {\r\n\r\n Set<String> adjacent = map.get(node1);\r\n if (adjacent == null) {\r\n return false; // boolean method should return a value; if adjacent node is null then the method return false\r\n }\r\n return adjacent.contains(node2); // if there exist adjacent node then returns adjacency list contains node2 \r\n }", "public abstract boolean isConnectedInDirection(N n1, E edgeValue, N n2);", "public boolean DijkstraHelp(int src, int dest) {\n PriorityQueue<Entry>queue=new PriorityQueue();//queue storages the nodes that we will visit by the minimum tag\n //WGraph_DS copy = (WGraph_DS) (copy());//create a copy graph that the algorithm will on it\n initializeTag();\n initializeInfo();\n node_info first=this.ga.getNode(src);\n first.setTag(0);//distance from itself=0\n queue.add(new Entry(first,first.getTag()));\n while(!queue.isEmpty()) {\n Entry pair=queue.poll();\n node_info current= pair.node;\n if (current.getInfo() != null) continue;//if we visit we can skip to the next loop because we have already marked\n current.setInfo(\"visited\");//remark the info\n Collection<node_info> listNeighbors = this.ga.getV(current.getKey());//create a collection for the neighbors list\n LinkedList<node_info> Neighbors = new LinkedList<>(listNeighbors);//create the neighbors list\n if (Neighbors == null) continue;\n for(node_info n:Neighbors) {\n\n if(n.getTag()>ga.getEdge(n.getKey(),current.getKey())+current.getTag())\n {\n n.setTag(current.getTag() + ga.getEdge(n.getKey(), current.getKey()));//compute the new tag\n }\n queue.add(new Entry(n,n.getTag()));\n }\n }\n Iterator<node_info> it=this.ga.getV().iterator();\n while(it.hasNext()){\n if(it.next().getInfo()==null) return false;\n }\n return true;\n }", "List<GraphEdge> getNeighbors(NodeKey key);", "@Override\n public boolean isAdjacent(E vertex1, E vertex2) {\n if (vertex1 != null\n && vertex2 != null\n && vertex1 != vertex2\n && dictionary.containsKey(vertex1)\n && dictionary.containsKey(vertex2)) {\n return dictionary.get(vertex1).contains(vertex2) && dictionary.get(vertex2).contains(vertex1);\n } else {\n return false;\n }\n }", "@Override\n public boolean addEdge(E vertex1, E vertex2) {\n if (vertex1 != null\n && vertex2 != null\n && vertex1 != vertex2\n && dictionary.containsKey(vertex1)\n && dictionary.containsKey(vertex2)) {\n dictionary.get(vertex1).add(vertex2);\n dictionary.get(vertex2).add(vertex1);\n return true;\n } else {\n return false;\n }\n }", "@Override\n public boolean hasEdge(V from, V to)\n {\n if (from.equals(null) || to.equals(null)){\n throw new IllegalArgumentException();\n }\n if (!contains(from)){\n return false;\n }\n else{\n Iterator graphIterator = graph.entrySet().iterator();\n Map.Entry graphElement = (Map.Entry) graphIterator.next();\n V vert = (V) graphElement.getKey();\n while (graphIterator.hasNext() && vert != from){\n graphElement = (Map.Entry) graphIterator.next();\n vert = (V)graphElement.getKey();\n }\n\t ArrayList <V> edges = graph.get(vert);\n\t return edges.contains(to);\n\t }\n }", "@Override\r\n public void connect(V start, V destination) {\r\n try {\r\n Iterator<Vertex> vertexIterator = map.values().iterator();\r\n Vertex a = null, b = null;\r\n while(vertexIterator.hasNext()) {\r\n Vertex v = vertexIterator.next();\r\n if(start.compareTo(v.vertexName) == 0)\r\n a = v;\r\n if(destination.compareTo(v.vertexName) == 0)\r\n b = v;\r\n }\r\n if(a == null || b == null)\r\n vertexIterator.next();\r\n a.addDestinations(destination);\r\n } catch(NoSuchElementException e) {\r\n throw e;\r\n }\r\n }", "public void connect(int node1, int node2, double w)\n{\n\tif(getNodes().containsKey(node1) && getNodes().containsKey(node2) && (node1 != node2))\n\t{\n\t \tNode n1 = (Node)getNodes().get(node1);\n\t\t Node n2 = (Node)getNodes().get(node2);\n\t\t\n\t\tif(!n1.hasNi(node2)&&!n2.hasNi(node1))\n\t\t{\n\t\t\tEdge e=new Edge(w,node1,node2);\n\t\t\tn1.addEdge(e);\n\t\t\tn2.addEdge(e);\n\t\t\tmc++;//adding an edge\n\t\t\tedge_size++;\n\t\t}\n\t\telse\n\t\t\t// if the edge already exist in the HashMap of the two nodes\n\t\t\t//we want only update the weight of the edge.\n\t\t{\n\t\t\tn1.getEdgesOf().get(node2).set_weight(w);\n\t\t\tn2.getEdgesOf().get(node1).set_weight(w);\n\t\t}\n\t\t\n\t}\n\telse {\n\t\treturn;\n\t\t//System.out.println(\"src or dst doesnt exist OR src equals to dest\");\n\t}\n}", "public boolean isAdjacent(int from, int to) {\n//your code here\n// LinkedList<Edge> list = adjLists[from];\n// for (Edge a : list) {\n// if(a.from()==from&&a.to()==to){\n// return true;\n// }\n// };\n// return false;\n return pathExists(from, to);\n }", "public abstract boolean isConnected(N n1, E e, N n2);", "public HashMap<Integer, Integer> findAugumentPath() {\n if (debug == 1) printFree();\n HashMap<Integer, Integer> Path = new HashMap<>();\n if (V1.isEmpty() || V2.isEmpty()) {\n if (debug == 1) System.out.println(\"V1||V2 is empty\");\n return Path;\n }\n\n GM.clearAllEdge();\n for (int i = 0; i < x.length; i++) {\n for (int j : x[i].getDomain()) {\n GM.addEdge(i, Map.get(j));\n }\n }\n GM.adjList[X].clear();\n for (int i : V1) {\n GM.addEdge(X, i);\n }\n for (int i = 0; i < x.length; i++) {\n if (MaxMatch[i] != 0) GM.addEdge(MaxMatch[i], i);\n }\n if (debug == 1) System.out.println(GM);\n\n // DFS từ X. Gặp 1 đỉnh thuộc V2 thì break\n boolean[] visited = new boolean[nbOfVertex + 10];\n int[] prev = new int[nbOfVertex + 10];\n prev[X] = -1;\n int last = -1;\n\n Stack<Integer> S = new Stack<>();\n S.push(X);\n while (!S.isEmpty() && last == -1) {\n int top = S.pop();\n //System.out.println(\"Popped \" + top);\n if (!visited[top]) {\n visited[top] = true;\n for (int next : GM.adjList[top])\n if (!visited[next]) {\n prev[next] = top;\n if (V2.contains(next)) {\n last = next;\n //System.out.println(\"Here \" + next);\n break;\n }\n S.push(next);\n //System.out.println(\"Pushed \" + next);\n }\n }\n }\n if (last == -1) {\n //System.out.println(\"Cant find any augument path\\n\");\n } else {\n //System.out.println(\"Constructing augument path\");\n //int step = 0;\n while (last != -1) {\n int from = prev[last];\n if (from == X) break;\n Path.put(from, last);\n ////System.out.println(Math.min(from, last) + \" --> \" + Math.max(from, last));\n last = from;\n //step++;\n //if(step>10) break;\n }\n if (debug == 1) System.out.println(\"Construct augument path completed \" + Path.size());\n if (debug == 1) printCurrentAugumentPath(Path);\n }\n //System.out.println(Path.size());\n return Path;\n }", "void parseline(){\n\t\ttry {\n\t\tString currentLine;\n\t\tBufferedReader freader = new BufferedReader(new FileReader(\"C:\\\\wt2g_inlinks.txt\")); //default to dataset\n\t//\tBufferedReader freader = new BufferedReader(new FileReader(\"C:\\\\inlink.txt\")); // Use this for Graph \n\t\tSet<String> ar ;\n\t\t\twhile((currentLine= freader.readLine()) != null){ \n\t\t\t\tSet<String> in_data = new HashSet<>();\n\t\t\t\tStringTokenizer st = new StringTokenizer(currentLine,\" \");\n\t\t\t\tString node = st.nextToken();\n\t\t\t\tif(!inlinks.containsKey(node)){\n\t\t\t\t\tinlinks.put(node, null); // All the nodes are stored in inlinks Map\n\t\t\t\t}\n\t\t\t\t\twhile(st.hasMoreTokens()){\n\t\t\t\t\t\tString edge = st.nextToken();\n\t\t\t\t\t if(!inlinks.containsKey(edge)){\n\t\t\t\t\t \tinlinks.put(edge, null);\n\t\t\t\t\t } \n\t\t\t\t\t if(inlinks.get(node)!=null){\n\t\t\t\t\t \tSet B = inlinks.get(node);\n\t\t\t\t\t \tB.add(edge);\n\t\t\t\t\t \tinlinks.put(node, B);\n\t\t\t\t\t }\n\t\t\t\t\t else{\n\t\t\t\t\t in_data.add(edge);\n\t\t\t\t\t inlinks.put(node, in_data);\n\t\t\t\t\t }\t\t\t\t\t \n\t\t\t\t\t if(!(outlinks.containsKey(edge))){ //Creating the outlinks Map \n\t\t\t\t\t\t Set<String > nd = new HashSet<>();\n\t\t\t\t\t\t nd.add(node);\n\t\t\t\t\t outlinks.put(edge, nd);\n\t\t\t\t\t }\t\n\t\t\t\t\t else{\n\t\t\t\t\t\t ar = outlinks.get(edge);\n\t\t\t\t\t\t ar.add(node);\n\t\t\t\t\t\t outlinks.put(edge, ar);\n\t\t\t\t\t }\n\t\t\t\t\t}\n \t\t\t\t \n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t }\n\t\t\n\t\tSystem.out.println(\"Total Nodes : \" +inlinks.size());\n\t\t\n for(String str : inlinks.keySet()){\n \tSet s1 = inlinks.get(str);\n \tif(s1 != null)\n \tinlinks_count.put(str, s1.size());\n \telse\n \t\tsource++;\n }\n System.out.println(\"Total Source \" +source);\n \n for(String str : outlinks.keySet()){\n \tSet s1 = outlinks.get(str);\n \toutlinks_count.put(str, s1.size());\n }\n\t}", "public final void connectIfNotFound(N n1, E edge, N n2) {\n if (!isConnected(n1, edge, n2)) {\n connect(n1, edge, n2);\n }\n }", "public void removeEdge(int node1, int node2)\n{\n\tif(getNodes().containsKey(node1) && getNodes().containsKey(node2))\n\t{\n\t\tNode n1 = (Node) getNodes().get(node1);\n\t\tNode n2 = (Node) getNodes().get(node2);\n\n\t\tif(n1.getEdgesOf().containsKey(node2))\n\t\t{\n\t\t\tedge_size--;\n\t\t\tmc++;\n\t\t\tn1.getEdgesOf().remove(node2);\n\n\t\t}\n\t\tif(n2.getEdgesOf().containsKey(node1))\n\t\t{\n\t\t\tedge_size--;\n\t\t\tmc++;\n\t\t\tn2.getEdgesOf().remove(node1);\n\n\t\t}\n\t\t\n\t\telse {\n\t\t\t\n\t\t\t//System.out.println(\"Edge doesnt exist\");\n\t\t}\n\t}\n\telse {\n\t\treturn;\n\t\t//System.out.println(\"src or dest doesnt exist\");\n\t}\n}", "public boolean isConnectedTo(Node<A> n) {\n\t\t\n\t\tif (g == null) return false;\n\t\t\n\t\tif (g.contains(n)){\n\t\t\t\n\t\t\tfor (Object o: g.getEdges()) {\n\t\t\t\t\n\t\t\t\tif (((Edge<?>)o).getFrom().equals(this) && ((Edge<?>)o).getTo().equals(n)) {\n\t\t\t\t\treturn true;\n\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\n\t\t}\n\t\treturn false;\n\t}", "void graph2() {\n\t\tconnect(\"1\", \"7\");\n\t\tconnect(\"1\", \"8\");\n\t\tconnect(\"1\", \"9\");\n\t\tconnect(\"9\", \"1\");\n\t\tconnect(\"9\", \"0\");\n\t\tconnect(\"9\", \"4\");\n\t\tconnect(\"4\", \"8\");\n\t\tconnect(\"4\", \"3\");\n\t\tconnect(\"3\", \"4\");\n\t}", "private static <N> ImmutableMap<N, GraphConnections<N, GraphConstants.Presence>> getNodeConnections(Graph<N> paramGraph) {\n }", "@Override\n\tpublic boolean containsEdge(Object src, Object dest)\n\t{\n\t\tif(this.map.containsKey(src))\n\t\t\tif(this.map.get(src).contains(dest))\n\t\t\t\treturn true;\t\t\n\t\treturn false;\n\t}", "private int bfs(String source, String destination, Map<String, List<String>> graph) {\n\n class Node {\n String word;\n int distance = 0;\n\n public Node(String word, int distance) {\n this.word = word;\n this.distance = distance;\n }\n }\n\n final Queue<Node> queue = new LinkedList<>();\n Set<String> visited = new HashSet<>();\n queue.offer(new Node(source, 0)); //distance of source to source is 0\n visited.add(source);\n\n while (!queue.isEmpty()) {\n\n final Node node = queue.poll();\n final int distance = node.distance;\n\n //if we reached the destination node\n if (node.word.equals(destination)) {\n return distance + 1;\n }\n\n //try all word which is 1 weight away\n for (String neighbour : graph.getOrDefault(node.word, new ArrayList<>())) {\n if (!visited.contains(neighbour)) {\n visited.add(neighbour);\n queue.offer(new Node(neighbour, distance + 1));\n }\n }\n\n\n }\n return 0;\n }", "private HashMap<String, Integer> getShortestPath(Node start, Node end){\n if(start.equals(end)) {\n return getShortestPath(start);\n }\n return getShortestPathBetweenDifferentNodes(start,end);\n }", "public static int runBFS(int[][]map, coordinate src1, coordinate src2){\n\t \n boolean visited[][] = new boolean[dim][dim]; //visited boolean 2d array that is the same size as 2d map\n coordinate visit1[][]=new coordinate[dim][dim]; // this is the one used to hold previous location\n coordinate visit2[][]=new coordinate[dim][dim]; // this is the one used to hold previous location\n\t \n\t visit1[0][0]=new coordinate(0,0); //same as BFS\n \n\t visit2[dim-1][dim-1] = new coordinate(dim-1,dim-1);\n\t //marked both the 0,0 and dim-1, dim-1 srcs as visited\n\t \n\t Queue<QueueNode> queue1 = new LinkedList<>(); //queue for src1\n\t Queue<QueueNode> queue2 = new LinkedList<>(); //queue for src2\n\t \n\t QueueNode sn1 = new QueueNode(src1, 0, src1); //src node 1 queue node\n\t QueueNode sn2 = new QueueNode(src2, 0, src2);\n\t \n\t ArrayList<coordinate> pathHold1 = new ArrayList<>(); //for first path\n\t ArrayList<coordinate> pathHold2 = new ArrayList<>(); //for second path \n\t \n\t visited[src1.x][src1.y] = true; //mark the start node as visited inside of the visited boolean 2d array for first src\n\t visited[src2.x][src2.y] = true; //mark the start node as visited inside of the visited boolean 2d array for second src\n\t \n\t System.out.println();\n\t \n\t queue1.add(sn1);\n\t queue2.add(sn2);\n\t //added the start nodes\n\t \n\t QueueNode current1 = null;\n\t QueueNode current2 = null;\n\t //to be used later to hold current node being looked at\n\t coordinate c1 = null;\n\t coordinate c2 = null;\n\t\t//coordinates to be examined\n\t \n\t while(!queue1.isEmpty()&&!queue2.isEmpty()){\n\t //keep iterating so long as queues have items -- but if one becomes empty, check at each iteration\n\t\t\t//to avoid null pointer so we are not dequeuing from empty queue\n int maxFringe = 0;\n\t\t//use this to check max fringe at each time we add to either queue\n if(queue1.size()>maxFringe || queue2.size()>0) {\n \t if(queue1.size()>maxFringe) {\n \t\t maxFringe=queue1.size();\n \t }else {\n \t\t maxFringe=queue2.size();\n \t }\n }\n\t \n\t \tif(!queue1.isEmpty()) { \n\t\t\t\t//while first queue is not empty, pop\n\t \t\t current1 = queue1.peek(); // this is n\n\t c1 = current1.point;\n\t \t\t visited[c1.x][c1.y]=true; //mark this node as visited, will check neighbors later\n\t boolean inFringe = false;\n\t inFringe = compareFringe(c1, queue2); //see if intersect or not\n\t \n\t \n\t // compare current point to the queue2 fringe. If not in fringe\n\t if(inFringe) {\n\t \t //we have found the duplicate \n\t \t System.out.println(\"duplicate\");\n\t \t intersect = c1;\n\t\t System.out.println(\"Intersect is :\"+c1.x+\",\"+c1.y);\n\t\t visit1[c1.x][c1.y]=current1.prev; //set prev node or where we came from\n\t\t \n\t\t System.out.println(\"We have reached our goal!\");\n\t\t \n\t\t if(current2 != null) {\n\t\t\t\t\t //so long as paths have values, add length and return\n\t\t return current1.pathTotal+current2.pathTotal;\n\t\t }else {\n\t\t\t\t\t //else return only one path \n\t\t \t return current1.pathTotal;\n\t\t }\n\t }\n\t\t\t\t//this is getting the neighbors, same as BFS\n\t \n\t int row1 = 0;\n\t int col1 = 0;\n\t \n\t for (int i = 0; i < 4; i++) { \n\t row1= c1.x + rowNum1[i]; \n\t col1 = c1.y + colNum1[i]; \n\t //grab neighbor of current\n\t if (cellValid(row1, col1) && map[row1][col1] == 1 && !visited[row1][col1]){ \n\t \t \n\t // mark cell as visited and enqueue it \n\t visited[row1][col1] = true; //we visited the node so mark it\n\t visit1[row1][col1] = new coordinate(c1.x, c1.y); //set prev as current coord\n\n\t QueueNode Adjcell = new QueueNode(new coordinate(row1, col1), current1.pathTotal + 1, new coordinate(row1-rowNum1[i], col1-colNum1[i])); \n\t queue1.add(Adjcell); //make it a queueNode to add to q1 for first path\n\t }else if(cellValid(row1, col1) && map[row1][col1] == 1 && (visited[row1][col1]&&visit2[row1][col1]!=null)){\n\t \t // System.out.println(\"already visited\"+row1+\",\"+col1); \n\t\t\t\t //check if already visited and valid (not off grid) and = 1 so we can take path -- \n\t\t\t\t //if so, this means we found intersect\n\t\t\t\t //make sure node has been visited in other path to guarantee it is intersect\n\t \t intersect=new coordinate(row1,col1); //set intersect\n\t \t visit1[intersect.x][intersect.y]=new coordinate(c1.x, c1.y); //set where we came from\n\t \t //current1.pathTotal++;\n\t \t printfin(visit1, visit2); //used to print final path -- set map\n \n int nodesExplored1 = 0;\n int nodesExplored2 = 0;\n for(coordinate coor : pathHold1){\n nodesExplored1++;\n }\n for(coordinate coor : pathHold2){\n nodesExplored2++;\n }\n\t\t\t\t \n\t\t\t\t //get number of nodes expanded in each path, add together\n\n int fin = nodesExplored1+nodesExplored2; //this is final explored nodes in each path\n System.out.println(\"Nodes explored: \" + fin);\n \n\t \t return pathsize; //return total pathsize\n\t \t //break;\n\t }\n\t \n\t \n\t } \n\t //once all of the neighbors have been visited, dequeue from queue 1 in path 1\n\t queue1.remove(); \n\t pathHold1.add(c1); //add to explored\n\t \n\t }\n\t \t//now to the same in path2 from (dim-1, dim-1) as src2\n\t \tif(!queue2.isEmpty()) {\n\t \t\t\n\t \t\t current2 = queue2.peek(); // this is n\n\t c2 = current2.point;\n\t \t\t visited[c2.x][c2.y]=true;\n\t boolean inFringe = false;\n\t inFringe = compareFringe(c2, queue1);\n\t \n\t // compare current point to the queue2 fringe. If not in fringe\n\t if(inFringe) {\n\t \t //we have found the duplicate \n\t \t System.out.println(\"duplicate\");\n\t \t intersect = c2;\n\t\t // System.out.println(\"Intersect is :\"+c2.x+\",\"+c2.y);\n\t\t visit2[c2.x][c2.y]=current2.prev;\n\t\t \n\t\t System.out.println(\"We have reached our goal!\");\n\t\t \n\t\t \n\t\t if(current1 != null) {\n\t\t\t return current1.pathTotal+current2.pathTotal;\n\t\t\t }else {\n\t\t\t \t return current2.pathTotal;\n\t\t\t }\n\t }\n\t \n\t \t// get neighbors\n\t int row2 = 0;\n\t int col2 = 0;\n\t \n\t for (int i = 0; i < 4; i++) { \n\t row2= c2.x + rowNum2[i]; \n\t col2 = c2.y + colNum2[i]; \n\t \n\t \n\t if (cellValid(row2, col2) && map[row2][col2] == 1 && !visited[row2][col2]){ \n\t \t \n\t // mark cell as visited and enqueue it \n\t visited[row2][col2] = true; \n\t visit2[row2][col2] = new coordinate(c2.x, c2.y);\n\n\t QueueNode Adjcell2 = new QueueNode(new coordinate(row2, col2), current2.pathTotal + 1, new coordinate(row2-rowNum2[i], col2-colNum2[i])); \n\t queue2.add(Adjcell2);\n\t }else if(cellValid(row2, col2) && map[row2][col2] == 1 && (visited[row2][col2]&&visit1[row2][col2]!=null)){\n\t \t \n\t \t intersect=new coordinate(row2,col2);\n\t \t \n\t \t visit2[intersect.x][intersect.y]=new coordinate(c2.x, c2.y);\n\t \n\t \n\t printfin(visit1, visit2);\n\t int nodesExplored1 = 0;\n int nodesExplored2 = 0;\n for(coordinate coor : pathHold1){\n nodesExplored1++;\n }\n for(coordinate coor : pathHold2){\n nodesExplored2++;\n }\n\n int fin = nodesExplored1+nodesExplored2;\n System.out.println(\"Nodes explored: \" + fin);\n\t \t return pathsize;\n\t \t \n\t }\n\t \n\t } \n\t //once all of the neighbors have been visited, dequeue \n\t queue2.remove(); \n\t pathHold2.add(c2);\n\t \t\t\n\t \t}\n\n\t }\n \n int nodesExplored1 = 0;\n int nodesExplored2 = 0;\n for(coordinate coor : pathHold1){\n nodesExplored1++;\n }\n for(coordinate coor : pathHold2){\n nodesExplored2++;\n }\n\n int fin = nodesExplored1+nodesExplored2;\n System.out.println(\"Nodes explored: \" + fin);\n\t //if here, means no path was found\n\t return -1;\n\t \n\t }", "public abstract boolean hasEdge(int from, int to);", "Graph<Integer, DefaultEdge> buildMap();", "@Override\n public boolean removeEdge(E vertex1, E vertex2) {\n if (vertex1 != null\n && vertex2 != null\n && vertex1 != vertex2\n && dictionary.containsKey(vertex1)\n && dictionary.containsKey(vertex2)\n && dictionary.get(vertex1).contains(vertex2)\n && dictionary.get(vertex2).contains(vertex1)) {\n dictionary.get(vertex1).remove(vertex2);\n dictionary.get(vertex2).remove(vertex1);\n return true;\n } else {\n return false;\n }\n\n }", "public abstract boolean isConnectedInDirection(N n1, N n2);", "@Test\n\tvoid testEdgesAreEqualForGivenVertice() {\n\t\tLinkedHashSet<String> edges = new LinkedHashSet<String>();\n\n\t\tedges.add(\"Newark\");\n\t\tedges.add(\"New York\");\n\t\tmap.put(\"Boston\", edges);\n\t\tedges = map.get(\"Boston\");\n\t\tString[] edgesArray = new String[edges.size()];\n\t\tedgesArray = edges.toArray(edgesArray);\n\t\tAssertions.assertEquals(\"Newark\", edgesArray[0]);\n\t\tAssertions.assertEquals(\"New York\", edgesArray[1]);\n\n\t\tedges = new LinkedHashSet<String>();\n\t\tedges.add(\"Philadelphia\");\n\t\tmap.put(\"Newark\", edges);\n\t\tedgesArray = new String[edges.size()];\n\t\tedgesArray = edges.toArray(edgesArray);\n\t\tAssertions.assertEquals(\"Philadelphia\", edgesArray[0]);\n\n\t\tedges = new LinkedHashSet<String>();\n\t\tedges.add(\"Albany\");\n\t\tmap.put(\"Trenton\", edges);\n\t\tedgesArray = new String[edges.size()];\n\t\tedgesArray = edges.toArray(edgesArray);\n\t\tAssertions.assertEquals(\"Albany\", edgesArray[0]);\n\t}", "private void DFSUtil(graph copy,node_data n) {\n\t\tn.setTag(1);\n\t\tCollection<edge_data> temp = copy.getE(n.getKey());\n\t\tif (temp != null) {\n\t\t\tfor (edge_data edge : temp) {\n\t\t\t\tif (copy.getNode(edge.getDest()) != null && copy.getE(edge.getDest()) != null && copy.getNode(edge.getDest()).getTag() == 0) {\n\t\t\t\t\tDFSUtil(copy,copy.getNode(edge.getDest()));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Test\n\tvoid testAdjacentNodes() {\n\t\tLinkedHashSet<String> edges = null;\n\t\tmap.put(\"Boston\", edges);\n\t\tOptional<LinkedHashSet<String>> vertexOptional = Optional.ofNullable(map.get(\"Boston\"));\n\t\t// Boston does not have any adjacent nodes\n\t\tAssertions.assertTrue(vertexOptional.isEmpty());\n\t\t// if connected vertex is null new vertex is created. Now Adjacent nodes will\n\t\t// not have any nodes inside it.\n\t\tif (vertexOptional.isEmpty()) {\n\t\t\tedges = new LinkedHashSet<String>();\n\t\t\tmap.put(\"Boston\", edges);\n\t\t\tAssertions.assertNotNull(map.get(\"Boston\"));\n\t\t\tAssertions.assertEquals(0, map.get(\"Boston\").size());\n\n\t\t}\n\n\t}", "public abstract void connect(N n1, E edge, N n2);", "@Override\n public Iterable<V> adjacentTo(V from)\n {\n if (from.equals(null)){\n throw new IllegalArgumentException();\n }\n Iterator graphIterator = graph.entrySet().iterator();\n \t Map.Entry graphElement = (Map.Entry) graphIterator.next();\n \t V vert = (V)graphElement.getKey();\n \t while (graphIterator.hasNext() && vert != from){\n \t\tgraphElement = (Map.Entry) graphIterator.next();\n \t\tvert = (V)graphElement.getKey();\n \t }\n \t ArrayList <V> edges = graph.get(vert);\n \t //Iterable <V> e = edges;\n \t return edges;\n }", "@Test\n\tvoid testIfAdjacentNodeExists() {\n\t\tMap<String, LinkedHashSet<String>> map = new HashMap<String, LinkedHashSet<String>>();\n\t\tLinkedHashSet<String> edges = new LinkedHashSet<String>();\n\t\tedges.add(\"New York\");\n\t\tmap.put(\"Boston\", edges);\n\t\tOptional<LinkedHashSet<String>> vertexOptional = Optional.of(map.get(\"Boston\"));\n\t\tif (vertexOptional.isPresent()) {\n\t\t\tAssertions.assertNotNull(map.get(\"Boston\"));\n\t\t\tAssertions.assertEquals(1, map.get(\"Boston\").size());\n\t\t\tString[] edgesArray = new String[edges.size()];\n\t\t\tedgesArray = edges.toArray(edgesArray);\n\t\t\tAssertions.assertTrue(map.get(\"Boston\").contains(\"New York\"));\n\t\t\tAssertions.assertEquals(\"New York\", edgesArray[0]);\n\t\t}\n\n\t}", "public void setEdge(int n1, int n2){\n\t\tif(outOfBounds(n1) || outOfBounds(n2))// if node indexes are bad return\n\t\t\treturn ;\n\t\t\n if((dGraph.getElement(n1, n2)) == 1){\n\t\t\treturn;\n\t}\n\t\tdGraph.setElement(n1, n2, 1); //shows that there is an edge going from n1 to n2\n\t\tdGraphin.setElement(n2, n1, 1);// show the edges going into n2\n\t\toutdegree[n1]++;\n\t\tindegree[n2]++;\n\t\t\n\t}", "HashMap<GamePiece, GamePiece> bfs(GamePiece from) {\n ArrayDeque<GamePiece> worklist = new ArrayDeque<GamePiece>();\n ArrayList<GamePiece> seen = new ArrayList<GamePiece>();\n HashMap<GamePiece, GamePiece> graph = new HashMap<GamePiece, GamePiece>();\n worklist.addFirst(from);\n graph.put(from, from);\n while (worklist.size() > 0) {\n GamePiece next = worklist.removeFirst();\n if (seen.contains(next)) {\n // if seen has the next element, don't do anything with it\n }\n else {\n for (String s : this.directions) {\n if (next.hasNeighbor(s) && next.connected(s)) {\n worklist.addFirst(next.neighbors.get(s));\n graph.put(next.neighbors.get(s), next);\n }\n }\n seen.add(next);\n }\n }\n return graph;\n }", "@Override\n\tpublic boolean isConnected() {\n\t\tif(this.GA.nodeSize() ==1 || this.GA.nodeSize()==0) return true;\n\t\tgraph copied = this.copy();\n\t\ttagZero(copied);\n\t\tCollection<node_data> s = copied.getV();\n\t\tIterator it = s.iterator();\n\t\tnode_data temp = (node_data) it.next();\n\t\tDFSUtil(copied,temp);\n\t\tfor (node_data node : s) {\n\t\t\tif (node.getTag() == 0) return false;\n\t\t}\n\t\ttransPose(copied);\n\t\ttagZero(copied);\n\t Collection<node_data> s1 = copied.getV();\n\t\tIterator it1 = s1.iterator();\n\t\tnode_data temp1 = (node_data) it1.next();\n\t\tDFSUtil(copied,temp1);\n\t\tfor (node_data node1 : s1) {\n\t\t\tif (node1.getTag() == 0) return false;\n\t\t}\n\n\t\treturn true;\n\t}", "public static void main(String args[]) {\n int V = 4;\n Graph g = new Graph(V);\n g.addEdge(0, 1);\n g.addEdge(0, 2);\n g.addEdge(1, 2);\n g.addEdge(2, 0);\n g.addEdge(2, 3);\n g.addEdge(3, 3);\n\n int src = 1;\n int dest = 3;\n boolean[] visited = new boolean[V];\n\n // To store the complete path between source and destination\n Stack<Integer> path1 = new Stack<>();\n\n if (hasPathDFS(g, src, dest, visited, path1)) {\n System.out.println(\"There is a path from \" + src + \" to \" + dest);\n System.out.println(\"The complete path is \" + path1);\n } else System.out.println(\"There is no path from \" + src + \" to \" + dest);\n\n src = 3;\n dest = 1;\n // To store the complete path between source and destination\n Stack<Integer> path2 = new Stack<>();\n\n if (hasPathDFS(g, src, dest, visited, path2)) System.out.println(\"There is a path from \" + src + \" to \" + dest);\n else System.out.println(\"There is no path from \" + src + \" to \" + dest);\n\n // total number of nodes in the graph (labeled from 0 to 7)\n int n = 8;\n\n // List of graph edges as per the above diagram\n Graph g2 = new Graph(n);\n /**\n * There is a path from 1 to 3\n * The complete path is [1, 2, 3]\n * There is no path from 3 to 1\n * There is a path from 0 to 7\n * The complete path is [0, 3, 4, 6, 7]\n */\n\n g2.addEdge(0, 3);\n g2.addEdge(1, 0);\n g2.addEdge(1, 2);\n g2.addEdge(1, 4);\n g2.addEdge(2, 7);\n g2.addEdge(3, 4);\n g2.addEdge(3, 5);\n g2.addEdge(4, 3);\n g2.addEdge(4, 6);\n g2.addEdge(5, 6);\n g2.addEdge(6, 7);\n\n // source and destination vertex\n src = 0;\n dest = 7;\n\n // To store the complete path between source and destination\n Stack<Integer> path = new Stack<>();\n boolean[] visited2 = new boolean[n];\n\n if (hasPathDFS(g2, src, dest, visited2, path)) {\n System.out.println(\"There is a path from \" + src + \" to \" + dest);\n System.out.println(\"The complete path is \" + path);\n } else System.out.println(\"There is no path from \" + src + \" to \" + dest);\n\n\n }", "public abstract void map(Edge queryEdge, Edge graphEdge);", "public static HashMap<Integer,Nodo> Dijkstra(Grafo g,int origen){\n\t\t// Inicialmente S contendrá el vértice origen\n\t\tArrayList<Integer> s = new ArrayList<Integer>();\n \tHashMap<Integer,Integer> costo = new HashMap<Integer,Integer>();\n \tHashMap<Integer,Nodo> padre = new HashMap<Integer,Nodo>();\n\t\ts.add(origen);\n\t\tcosto.put(origen,-100000000);\t\n\t\t// Para cada v en el grafo: \n\t\tfor( Map.Entry<Integer, Nodo> v : g.nodos.entrySet() ){\n\t\t\t// si v no es el origen:\n\t\t\tif( v.getKey() != origen ){\n\t\t\t\tcosto.put(v.getKey(),g.valorArista(v.getKey(),origen));\n\t\t\t\t// Inicialmente, el predecesor de v en el camino mínimo construido hasta el momento es origen\n\t\t\t\tpadre.put(v.getKey(),g.nodos.get(origen));\n\t\t\t} // fin if\n\t\t} // fin for\n\n\t\t// Mientras existan vértices para los cuales no se ha determinado el camino mínimo\n\t\twhile( g.nodos.size() - s.size() > 0 ){\n\t\t\t//\tElegir un vértice w en (V-S) tal que su costo sea el mayor.\n\t\t\tfor(Map.Entry<Integer, Nodo> w : g.nodos.entrySet()){\n\t\t\t\tint mayor = -10000000;\n\t\t\t\tif(!s.contains(w.getKey())){\n\t\t\t\t\tif( mayor < costo.get(w.getKey()) ){\n\t\t\t\t\t\t// Se agrega w al conjunto S\n\t\t\t\t\t\ts.add(w.getKey());\n\t\t\t\t\t\tmayor = costo.get(w.getKey());\n\t\t\t\t\t} // fin if mayor\n\t\t\t\t} // fin if contains\n\t\t\t\t\t\n\t\t\t\t\t//\tPara cada v en (V-S):\n\t\t\t\t\tfor(Map.Entry<Integer, Nodo> v : g.nodos.entrySet()){\n\t\t\t\t\t\tif(!s.contains(v.getKey())){\n\t\t\t\t\t\t\t// Se escoge, entre \n\t\t\t\t\t\t\t// el camino mayor hacia v que se tiene hasta el momento, \n\t\t\t\t\t\t\tint dv = costo.get(v.getKey());\n\t\t\t\t\t\t\tint dw = costo.get(w.getKey());\n\t\t\t\t\t\t\t//y el camino hacia v pasando por w mediante su camino mayor, \n\t\t\t\t\t\t\tint cwv = g.valorArista(w.getKey(),v.getKey());\n\t\t\t\t\t\t\t//el de mayor costo.\n\t\t\t\t\t\t\tint max = Math.max( dv , dw + cwv );\n\t\t\t\t\t\t\tcosto.put(v.getKey(),max);\t\n\n\t\t\t\t\t\t\t// Si max(D[v],D[w]+C[w,v]) = D[w]+C[w,v] entonces P[v] ← w \n\t\t\t\t\t\t\tif( max == dw + cwv ){\n\t\t\t\t\t\t\t\tpadre.put(v.getKey(),w.getValue());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} // fin if contains\n\t\t\t\t\t} // fin for map\n\t\t\t} //fin for map\n\t\t} // fin while\n\t\treturn padre;\n\t}", "public int checkEdgeDirection(Object src, Object dest)\n\t{\t\t\n\t\tif(this.map.get(src).contains(dest) && !this.map.get(dest).contains(src))\n\t\t\treturn 1;\n\t\telse if(this.map.get(src).contains(dest) && this.map.get(dest).contains(src))\n\t\t\treturn 2;\n\t\treturn 0;\n\t}", "@Override\n public boolean isConnected() {\n for (node_data n : G.getV()) {\n bfs(n.getKey());\n for (node_data node : G.getV()) {\n if (node.getTag() == 0)\n return false;\n }\n }\n return true;\n }", "NBLK(int[][] origMap) {\r\n\r\n\t\t\r\n\t\t// suppose it's a matrix for numberlink\r\n\t\tn_row = origMap.length;\r\n\t\tn_col = origMap[0].length;\r\n\t\tlength = n_row * n_col;\r\n\t\tadjaMatrix=new int[length][length];\r\n\t\tStartPoint=new HashMap<Integer, Node>();\r\n\t\tEndPoint=new HashMap<Integer, Node>();\r\n\t\tnowMap= new HashMap<Integer,LinkedList<Integer>>();\r\n\t\t\r\n\t\tpaths=new HashMap<Integer, Stack<Node>>();\r\n\t\tallNodes= new HashMap<Integer,Node>();\r\n\t\t\r\n\t\t\r\n\t\tlastPath=0;\r\n\t\t\r\n\t\tcount=0;\r\n\t\tfor (int i = 0; i < n_row; i++) {\r\n\t\t\tfor (int j = 0; j < n_col; j++) {\r\n\t\t\t\tif (origMap[i][j] > -1) {\r\n\t\t\t\t\t//we can use that point to represent a blocked point (i,j) as matrix[i][j]=-1\r\n\t\t\t\t\tint index = i * n_col + j;\r\n\t\t\t\t\tNode n = new Node(i, j, index, origMap[i][j]);\r\n\t\t\t\t\tallNodes.put(index, n);\r\n\t\t\t\t\tLinkedList<Integer> neibors = new LinkedList<Integer>();\r\n\r\n\t\t\t\t\tif (i > 0 && origMap[i-1][j] > -1) {\r\n\t\t\t\t\t\t//left\r\n\t\t\t\t\t\tadjaMatrix[index][(i - 1) * n_col + j] = 1;\r\n\t\t\t\t\t\tadjaMatrix[(i - 1) * n_col + j][index] = 1;\r\n\t\t\t\t\t\tneibors.addLast((i - 1) * n_col + j);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (i < n_row - 1 && origMap[i+1][j] > -1) {\r\n\t\t\t\t\t\t//right\r\n\t\t\t\t\t\tadjaMatrix[index][(i + 1) * n_col + j] = 1;\r\n\t\t\t\t\t\tadjaMatrix[(i + 1) * n_col + j][index] = 1;\r\n\t\t\t\t\t\tneibors.addLast((i + 1) * n_col + j);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (j > 0 && origMap[i][j-1] > -1) {\r\n\t\t\t\t\t\t//top\r\n\t\t\t\t\t\tadjaMatrix[index][i * n_col + j - 1] = 1;\r\n\t\t\t\t\t\tadjaMatrix[i * n_col + j - 1][index] = 1;\r\n\t\t\t\t\t\tneibors.addLast(i * n_col + j - 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (j < n_col - 1 && origMap[i][j+1] > -1) {\r\n\t\t\t\t\t\t//bottom\r\n\t\t\t\t\t\tadjaMatrix[index][i * n_col + j + 1] = 1;\r\n\t\t\t\t\t\tadjaMatrix[i * n_col + j + 1][index] = 1;\r\n\t\t\t\t\t\tneibors.addLast(i * n_col + j + 1);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tnowMap.put(index, neibors);\r\n\t\t\t\t\tif (origMap[i][j] > 0) {\r\n\r\n\t\t\t\t\t\tif (!StartPoint.containsKey(origMap[i][j])) {\r\n\t\t\t\t\t\t\tStartPoint.put(origMap[i][j], n);\r\n\t\t\t\t\t\t\tStack<Node> tp = new Stack<Node>();\r\n\t\t\t\t\t\t\ttp.push(n);\r\n\t\t\t\t\t\t\tpaths.put(origMap[i][j], tp);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tEndPoint.put(origMap[i][j], n);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public interface PathExistsInGraph {\n\n boolean validPath(int n, int[][] edges, int start, int end);\n\n default Map<Integer, Set<Integer>> prepareGraph(final int n, final int[][] edges) {\n Map<Integer, Set<Integer>> graph = new HashMap<>();\n for (int i = 0; i < n; i++) {\n graph.put(i, new HashSet<>());\n }\n for (int[] edge : edges) {\n graph.get(edge[0]).add(edge[1]);\n graph.get(edge[1]).add(edge[0]);\n }\n return graph;\n }\n}", "private void bfs(int nodeKey) {\n Queue<Integer> q = new LinkedList<>();\n // initialize all the nodes\n for (node_data node : G.getV())\n node.setTag(0);\n\n int currentNode = nodeKey;\n\n // iterate the graph and mark nodes that have been visited\n while (G.getNode(currentNode) != null) {\n for (edge_data edge : G.getE(currentNode)) {\n node_data dest = G.getNode(edge.getDest());\n if (dest.getTag() == 0) {\n q.add(dest.getKey());\n }\n G.getNode(currentNode).setTag(1);\n }\n if(q.peek()==null)\n currentNode=-1;\n else\n currentNode = q.poll();\n }\n }", "public static strictfp void main(String... args) {\n\t\tArrayList<Vertex> graph = new ArrayList<>();\r\n\t\tHashMap<Character, Vertex> map = new HashMap<>();\r\n\t\t// add vertices\r\n\t\tfor (char c = 'a'; c <= 'i'; c++) {\r\n\t\t\tVertex v = new Vertex(c);\r\n\t\t\tgraph.add(v);\r\n\t\t\tmap.put(c, v);\r\n\t\t}\r\n\t\t// add edges\r\n\t\tfor (Vertex v: graph) {\r\n\t\t\tif (v.getNodeId() == 'a') {\r\n\t\t\t\tv.getAdjacents().add(map.get('b'));\r\n\t\t\t\tv.getAdjacents().add(map.get('h'));\r\n\t\t\t} else if (v.getNodeId() == 'b') {\r\n\t\t\t\tv.getAdjacents().add(map.get('a'));\r\n\t\t\t\tv.getAdjacents().add(map.get('c'));\r\n\t\t\t\tv.getAdjacents().add(map.get('h'));\r\n\t\t\t} else if (v.getNodeId() == 'c') {\r\n\t\t\t\tv.getAdjacents().add(map.get('b'));\r\n\t\t\t\tv.getAdjacents().add(map.get('d'));\r\n\t\t\t\tv.getAdjacents().add(map.get('f'));\r\n\t\t\t\tv.getAdjacents().add(map.get('i'));\r\n\t\t\t} else if (v.getNodeId() == 'd') {\r\n\t\t\t\tv.getAdjacents().add(map.get('c'));\r\n\t\t\t\tv.getAdjacents().add(map.get('e'));\r\n\t\t\t\tv.getAdjacents().add(map.get('f'));\r\n\t\t\t} else if (v.getNodeId() == 'e') {\r\n\t\t\t\tv.getAdjacents().add(map.get('d'));\r\n\t\t\t\tv.getAdjacents().add(map.get('f'));\r\n\t\t\t} else if (v.getNodeId() == 'f') {\r\n\t\t\t\tv.getAdjacents().add(map.get('c'));\r\n\t\t\t\tv.getAdjacents().add(map.get('d'));\r\n\t\t\t\tv.getAdjacents().add(map.get('e'));\r\n\t\t\t\tv.getAdjacents().add(map.get('g'));\r\n\t\t\t} else if (v.getNodeId() == 'g') {\r\n\t\t\t\tv.getAdjacents().add(map.get('f'));\r\n\t\t\t\tv.getAdjacents().add(map.get('h'));\r\n\t\t\t\tv.getAdjacents().add(map.get('i'));\r\n\t\t\t} else if (v.getNodeId() == 'h') {\r\n\t\t\t\tv.getAdjacents().add(map.get('a'));\r\n\t\t\t\tv.getAdjacents().add(map.get('b'));\r\n\t\t\t\tv.getAdjacents().add(map.get('g'));\r\n\t\t\t\tv.getAdjacents().add(map.get('i'));\r\n\t\t\t} else if (v.getNodeId() == 'i') {\r\n\t\t\t\tv.getAdjacents().add(map.get('c'));\r\n\t\t\t\tv.getAdjacents().add(map.get('g'));\r\n\t\t\t\tv.getAdjacents().add(map.get('h'));\r\n\t\t\t}\t\r\n\t\t}\r\n\t\t// graph created\r\n\t\t// create disjoint sets\r\n\t\tDisjointSet S = null, V_S = null;\r\n\t\tfor (Vertex v: graph) {\r\n\t\t\tchar c = v.getNodeId();\r\n\t\t\tif (c == 'a' || c == 'b' || c == 'd' || c == 'e') {\r\n\t\t\t\tif (S == null) {\r\n\t\t\t\t\tS = v.getDisjointSet();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tDisjointSet set = DisjointSet.union(S, v.getDisjointSet());\r\n\t\t\t\t\tv.setDisjointSet(set);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (V_S == null) {\r\n\t\t\t\t\tV_S = v.getDisjointSet();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tDisjointSet set = DisjointSet.union(V_S, v.getDisjointSet());\r\n\t\t\t\t\tv.setDisjointSet(set);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Disjoint sets created\r\n\t\tfor (Vertex u: graph) {\r\n\t\t\tfor (Vertex v: u.getAdjacents()) {\r\n\t\t\t\tif (DisjointSet.findSet((DisjointSet) u.getDisjointSet()) == \r\n\t\t\t\t DisjointSet.findSet((DisjointSet) v.getDisjointSet())) {\r\n\t\t\t\t\tSystem.out.println(\"The cut respects (\" + u.getNodeId() + \", \" + v.getNodeId() + \").\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void addUndirectedEdge(int v1, int v2, Object edgeInfo) {\n//your code here\n Edge edge1 = new Edge(v1, v2, edgeInfo);\n Edge edge2 = new Edge(v2, v1, edgeInfo);\n if(!adjLists[v1].contains(edge1)){\n adjLists[v1].addLast(edge1);\n }\n if(!adjLists[v2].contains(edge2)){\n adjLists[v2].addLast(edge2);\n }\n }", "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 }", "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 }", "@Override\n\tpublic boolean traverse(INode startNode, INode destinationNode) {\n\t\tif (isNeighbors(startNode, destinationNode) == true) {\n\t\t\tint zähler = 0;\n\t\t\tString result = \"\";\n\t\t\tMatrixNode startListNode = (MatrixNode) startNode;\n\t\t\tQueue<MatrixNode> queue = new ArrayDeque<>();\n\t\t\tqueue.add(startListNode);\n\t\t\tstartListNode.mark();\n\t\t\twhile (!queue.isEmpty()) { // solange queue nicht leer ist\n\t\t\t\t// erstes Element von der queue nehmen\n\t\t\t\tMatrixNode node = (MatrixNode) queue.poll();\n\t\t\t\tif (node.equals(destinationNode)) {\n\t\t\t\t\tSystem.out.println(\"Zähler: \" + zähler);\n\t\t\t\t\treturn true; // testen, ob Ziel-Knoten gefunden\n\t\t\t\t}\n\t\t\t\tfor (int i = 0; i < nodes.size(); i++) {\n\t\t\t\t\tif (isNeighbors(node, nodes.get(i))) {\n\t\t\t\t\t\tif (!((MatrixNode) nodes.get(i)).getMark()) {\n\t\t\t\t\t\t\tqueue.add((MatrixNode) nodes.get(i));\n\t\t\t\t\t\t\t((MatrixNode) nodes.get(i)).mark();\n\t\t\t\t\t\t\tresult += node.getName() + \"-\" + nodes.get(i).getName();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tzähler++;\n\t\t\t\tSystem.out.println(result + \"||\");\n\t\t\t}\n\t\t}\n\t\treturn false; // Knoten kann nicht erreicht werden\n\t}", "private void addEdge(int from, int to, int cost) {\r\n\t\tif (edges[from] == null)\r\n\t\t\tedges[from] = new HashMap<Integer, Integer>(INITIAL_MAP_SIZE);\r\n\t\tif (edges[from].put(to, cost) == null)\r\n\t\t\tnumEdges++;\r\n\t}", "public abstract boolean isConnected(N n1, N n2);", "private HashMap<String, Integer> getShortestPathBetweenDifferentNodes(Node start, Node end) {\n HashMap<Node, Node> parentChildMap = new HashMap<>();\n parentChildMap.put(start, null);\n\n // Shortest path between nodes\n HashMap<Node, Integer> shortestPathMap = new HashMap<>();\n\n for (Node node : getNodes()) {\n if (node == start)\n shortestPathMap.put(start, 0);\n else shortestPathMap.put(node, Integer.MAX_VALUE);\n }\n\n for (Edge edge : start.getEdges()) {\n shortestPathMap.put(edge.getDestination(), edge.getWeight());\n parentChildMap.put(edge.getDestination(), start);\n }\n\n while (true) {\n Node currentNode = closestUnvisitedNeighbour(shortestPathMap);\n\n if (currentNode == null) {\n return null;\n }\n\n // Save path to nearest unvisited node\n if (currentNode == end) {\n Node child = end;\n String path = end.getName();\n while (true) {\n Node parent = parentChildMap.get(child);\n if (parent == null) {\n break;\n }\n\n // Create path using previous(parent) and current(child) node\n path = parent.getName() + \"\" + path;\n child = parent;\n }\n HashMap<String,Integer> hm= new HashMap<>();\n hm.put(path, shortestPathMap.get(end));\n return hm;\n }\n currentNode.visit();\n\n // Go trough edges and find nearest\n for (Edge edge : currentNode.getEdges()) {\n if (edge.getDestination().isVisited())\n continue;\n\n if (shortestPathMap.get(currentNode) + edge.getWeight() < shortestPathMap.get(edge.getDestination())) {\n shortestPathMap.put(edge.getDestination(), shortestPathMap.get(currentNode) + edge.getWeight());\n parentChildMap.put(edge.getDestination(), currentNode);\n }\n }\n }\n }", "public static <T> boolean routeBetween2NodesBFS(MyGraph<T> graph, MyNode<T> start, MyNode<T> end) {\n if (start == end) return true;\n LinkedList<MyNode<T>> queue = new LinkedList<>();\n queue.add(start);\n while (!queue.isEmpty()) {\n MyNode<T> u = queue.removeFirst();\n if (u != null) {\n for (MyNode<T> node : u.getAdjacent()) {\n if (node.getState() == State.Unvisited) {\n if (node == end) {\n return true;\n } else {\n node.setState(State.Visiting);\n queue.add(node);\n }\n }\n }\n\n }\n }\n return false;\n }", "@Override\n\tpublic boolean isConnected() {\n\t\tif(dwg.getV().size()==0) return true;\n\n\t\tIterator<node_data> temp = dwg.getV().iterator();\n\t\twhile(temp.hasNext()) {\n\t\t\tfor(node_data w : dwg.getV()) {\n\t\t\t\tw.setTag(0);\n\t\t\t}\n\t\t\tnode_data n = temp.next();\n\t\t\tQueue<node_data> q = new LinkedBlockingQueue<node_data>();\n\t\t\tn.setTag(1);\n\t\t\tq.add(n);\n\t\t\twhile(!q.isEmpty()) {\n\t\t\t\tnode_data v = q.poll();\n\t\t\t\tCollection<edge_data> arrE = dwg.getE(v.getKey());\n\t\t\t\tfor(edge_data e : arrE) {\n\t\t\t\t\tint keyU = e.getDest();\n\t\t\t\t\tnode_data u = dwg.getNode(keyU);\n\t\t\t\t\tif(u.getTag() == 0) {\n\t\t\t\t\t\tu.setTag(1);\n\t\t\t\t\t\tq.add(u);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tv.setTag(2);\n\t\t\t}\n\t\t\tCollection<node_data> col = dwg.getV();\n\t\t\tfor(node_data n1 : col) {\n\t\t\t\tif(n1.getTag() != 2) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "ShortestPath(UndirectedWeightedGraph graph, String startNodeId, String endNodeId) throws NotFoundNodeException {\r\n\t\t\r\n\t\tif (!graph.containsNode(startNodeId)) {\r\n\t\t\tthrow new NotFoundNodeException(graph, startNodeId);\r\n\t\t}\t\t\r\n\t\tif (!graph.containsNode(endNodeId)) {\r\n\t\t\tthrow new NotFoundNodeException(graph, endNodeId);\r\n\t\t}\t\r\n\r\n\t\tsrc = startNodeId;\r\n\t\tdst = endNodeId;\r\n\t\t\r\n\t\tif (endNodeId.equals(startNodeId)) {\r\n\t\t\tlength = 0;\r\n\t\t\tnumOfPath = 1;\r\n\t\t\tArrayList<String> path = new ArrayList<String>();\r\n\t\t\tpath.add(startNodeId);\r\n\t\t\tpathList.add(path);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// create a HashMap of updated distance from the starting node to every node\r\n\t\t\t// initially it is 0, inf, inf, inf, ...\r\n\t\t\tHashMap<String, Double> distance = new HashMap<String, Double>();\t\r\n\t\t\tfor (String nodeId : graph.getNodeList().keySet()) {\r\n\t\t\t\tif (nodeId.equals(startNodeId)) {\r\n\t\t\t\t\t// the starting node will always have 0 distance from itself\r\n\t\t\t\t\tdistance.put(nodeId, 0.0);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t// the others have initial distance is infinity\r\n\t\t\t\t\tdistance.put(nodeId, Double.MAX_VALUE);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// a HashMap of preceding node of each node\r\n\t\t\tHashMap<String, HashSet<String>> precedence = new HashMap<String, HashSet<String>>();\r\n\t\t\tfor (String nodeId : graph.getNodeList().keySet()) {\r\n\t\t\t\tif ( nodeId.equals(startNodeId) ) {\r\n\t\t\t\t\tprecedence.put(nodeId, null);\t// the start node will have no preceding node\r\n\t\t\t\t}\r\n\t\t\t\telse { \r\n\t\t\t\t\tprecedence.put(nodeId, new HashSet<String>());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//\r\n\t\t\tSet<String> unvisitedNode = new HashSet<String>();\r\n\t\t\tfor (String nodeId : graph.getNodeList().keySet()) {\r\n\t\t\t\tunvisitedNode.add(nodeId);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdouble minUnvisitedLength;\r\n\t\t\tString minUnvisitedNode;\r\n\t\t\t// run loop while not all node is visited\r\n\t\t\twhile ( unvisitedNode.size() != 0 ) {\r\n\t\t\t\t// find the unvisited node with minimum current distance in distance list\r\n\t\t\t\tminUnvisitedLength = Double.MAX_VALUE;\r\n\t\t\t\tminUnvisitedNode = \"\";\r\n\t\t\t\tfor (String nodeId : unvisitedNode) {\r\n\t\t\t\t\tif (distance.get(nodeId) < minUnvisitedLength) {\r\n\t\t\t\t\t\tminUnvisitedNode = nodeId;\r\n\t\t\t\t\t\tminUnvisitedLength = distance.get(nodeId); \r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// if there are no node that can be visited from the unvisitedNode, break the loop \r\n\t\t\t\tif (minUnvisitedLength == Double.MAX_VALUE) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t// remove the node from unvisitedNode\r\n\t\t\t\tunvisitedNode.remove(minUnvisitedNode);\r\n\t\t\t\t\r\n\t\t\t\t// update the distance of its neighbors\r\n\t\t\t\tfor (Node neighborNode : graph.getNodeList().get(minUnvisitedNode).getNeighbors().keySet()) {\r\n\t\t\t\t\tdouble distanceFromTheMinNode = distance.get(minUnvisitedNode) + graph.getNodeList().get(minUnvisitedNode).getNeighbors().get(neighborNode).getWeight();\r\n\t\t\t\t\t// if the distance of the neighbor can be shorter from the current node, change \r\n\t\t\t\t\t// its details in distance and precedence\r\n\t\t\t\t\tif ( distanceFromTheMinNode < distance.get(neighborNode.getId()) ) {\r\n\t\t\t\t\t\tdistance.replace(neighborNode.getId(), distanceFromTheMinNode);\r\n\t\t\t\t\t\t// renew the precedence of the neighbor node\r\n\t\t\t\t\t\tprecedence.put(neighborNode.getId(), new HashSet<String>());\r\n\t\t\t\t\t\tprecedence.get(neighborNode.getId()).add(minUnvisitedNode);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (distanceFromTheMinNode == distance.get(neighborNode.getId())) {\r\n\t\t\t\t\t\t// unlike dijkstra's algorithm, multiple path should be update into the precedence\r\n\t\t\t\t\t\t// if from another node the distance is the same, add it to the precedence\r\n\t\t\t\t\t\tprecedence.get(neighborNode.getId()).add(minUnvisitedNode);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t// if the current node in the process is the end node, we can stop the while loop here\r\n\t\t\t\tif (minUnvisitedNode == endNodeId) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\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 (distance.get(endNodeId) == Double.MAX_VALUE) {\r\n\t\t\t\t// in case there is no shortest path between the 2 nodes\r\n\t\t\t\tlength = 0;\r\n\t\t\t\tnumOfPath = 0;\r\n\t\t\t\tpathList = null;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// other wise we have these information\r\n\t\t\t\tlength = distance.get(endNodeId);\r\n\t\t\t\t//numOfPath = this.getNumPath(precedence, startNodeId, endNodeId);\r\n\t\t\t\tpathList = this.findPathList(precedence, startNodeId, endNodeId);\r\n\t\t\t\tnumOfPath = pathList.size();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\t// END ELSE\t\t\r\n\t}", "@Override\n public int hashCode() {\n return Objects.hashCode(nodes(), edgeToIncidentNodes);\n }", "private void phaseTwo(){\r\n\r\n\t\tCollections.shuffle(allNodes, random);\r\n\t\tList<Pair<Node, Node>> pairs = new ArrayList<Pair<Node, Node>>();\r\n\t\t\r\n\t\t//For each node in allNode, get all relationshpis and iterate through each relationship.\r\n\t\tfor (Node n1 : allNodes){\r\n\r\n\t\t\ttry (Transaction tx = graphDb.beginTx()){\r\n\t\t\t\t//If a node n1 is related to any other node in allNodes, add those relationships to rels.\r\n\t\t\t\t//Avoid duplication, and self loops.\r\n\t\t\t\tIterable<Relationship> ite = n1.getRelationships(Direction.BOTH);\t\t\t\t\r\n\r\n\t\t\t\tfor (Relationship rel : ite){\r\n\t\t\t\t\tNode n2 = rel.getOtherNode(n1);\t//Get the other node\r\n\t\t\t\t\tif (allNodes.contains(n2) && !n1.equals(n2)){\t\t\t\t\t//If n2 is part of allNodes and n1 != n2\r\n\t\t\t\t\t\tif (!rels.contains(rel)){\t\t\t\t\t\t\t\t\t//If the relationship is not already part of rels\r\n\t\t\t\t\t\t\tPair<Node, Node> pA = new Pair<Node, Node>(n1, n2);\r\n\t\t\t\t\t\t\tPair<Node, Node> pB = new Pair<Node, Node>(n2, n1);\r\n\r\n\t\t\t\t\t\t\tif (!pairs.contains(pA)){\r\n\t\t\t\t\t\t\t\trels.add(rel);\t\t\t\t\t\t\t\t\t\t\t//Add the relationship to the lists.\r\n\t\t\t\t\t\t\t\tpairs.add(pA);\r\n\t\t\t\t\t\t\t\tpairs.add(pB);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\ttx.success();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn;\r\n\t}", "public static void main(String[] args) {\n graph.addEdge(\"Mumbai\",\"Warangal\");\n graph.addEdge(\"Warangal\",\"Pennsylvania\");\n graph.addEdge(\"Pennsylvania\",\"California\");\n //graph.addEdge(\"Montevideo\",\"Jameka\");\n\n\n String sourceNode = \"Pennsylvania\";\n\n if(graph.isGraphConnected(sourceNode)){\n System.out.println(\"Yes\");\n } else {\n System.out.println(\"No\");\n }\n }", "protected abstract Set<T> findNeighbors(T node, Map<T, T> parentMap);", "private boolean isEdge(Node node) {\n for (Node n: nodes){\n if(!node.equals(n)) {\n for(Edge e:n.getEdges()){\n if(e.getDestination().equals(node)) {\n return true;\n }\n }\n }\n }\n return false;\n }", "private static int getClusterCorrespondance(Integer cl1, Integer cl2,\n HashMap<Integer, HashMap<Integer, Integer>> clusterCorresp, int nextId)\n{\n HashMap<Integer, Integer> map = clusterCorresp.get(cl1);\n if (map == null) {\n map = new HashMap<Integer, Integer>();\n map.put(cl2, nextId);\n clusterCorresp.put(cl1, map);\n return nextId;\n }\n Integer corresp = map.get(cl2);\n if (corresp == null) {\n map.put(cl2, nextId);\n return nextId;\n }\n return corresp.intValue();\n}", "public boolean hasEdge(String id1, String id2)\n\t{\n\t\treturn nodes.containsKey(id1) && getNode(id1).hasEdge(id2);\n\t}", "private boolean isBipartiteHelper(GraphNode node,\n HashMap<GraphNode, Integer> visited){\n // base case if this node have been BFS, no need to do it again\n if(visited.containsKey(node)) return true;\n // queue for BFS\n LinkedList<GraphNode> queue = new LinkedList<>();\n queue.offer(node);\n // once it put into queue, it should be marked as visited.\n // record it with it's group\n visited.put(node, 0);\n // BFS loop\n while (!queue.isEmpty()){\n // Get the first node.\n GraphNode currVertex = queue.poll();\n // determine the group for this node\n int curGroup = visited.get(currVertex);\n // the neighbor of current node should be all in different group\n int neiGroup = curGroup == 0? 1 : 0;\n // loop through the neighbors of the current node. they all\n // should be in different group.\n for(GraphNode vertex : currVertex.neighbors){\n // if never seen this neighbor, put it into queue, and record\n // with group number as opposed of current node\n if(!visited.containsKey(vertex)){\n visited.put(vertex,neiGroup);\n queue.offer(vertex);\n }\n // if this neighbor have visited, check it's group. It should\n // be in different group. otherwise it is false.\n else if(visited.get(vertex) != neiGroup) {\n return false;\n } } }\n return true;\n }", "@Test\n public void tr2()\n {\n Graph graph = new Graph(2);\n Set<Integer> sources = new TreeSet<Integer>();\n Set<Integer> targets = new TreeSet<Integer>();\n sources.add(0);\n targets.add(1);\n graph.addEdge(0,1);\n assertTrue(graph.reachable(sources, targets));\n\n\n }", "public int reachableNodes1(int[][] edges, int M, int N) {\n \tif(edges.length == 0)\n \t\treturn 0;\n \tif(M == 0)\n \t\treturn 1;\n \tint nodes = N;\n \tMap<Integer, Set<Integer>> graph = new HashMap<>();\n \tSet<Integer> visited = new HashSet<>();\n \t\n \tfor(int []edge : edges) {\n \t\tint src = edge[0], dest = edge[1], add = edge[2];\n \t\t\n \t\tfor(int i = 1;i <= add;i++) {\n \t\t\tif(!graph.containsKey(src))\n \t\t\t\tgraph.put(src, new HashSet<>());\n \t\t\tif(!graph.containsKey(nodes))\n \t\t\t\tgraph.put(nodes, new HashSet<>());\n \t\t\tgraph.get(src).add(nodes);\n \t\t\tgraph.get(nodes).add(src);\n \t\t\tsrc = nodes++;\n \t\t}\n \t\tif(!graph.containsKey(src))\n\t\t\t\tgraph.put(src, new HashSet<>());\n \t\tif(!graph.containsKey(dest))\n\t\t\t\tgraph.put(dest, new HashSet<>());\n \t\tgraph.get(src).add(dest);\n \t\tgraph.get(dest).add(src);\n \t}\n \treturn count(graph, visited, M);\n }", "@Override\n public E getEdgeIfExists(int pintSourceVertexID, int pintDestinationVertexID) {\n V vertexFrom = getVertex(pintSourceVertexID);\n V vertexTo = getVertex(pintDestinationVertexID);\n for(TimeFrame tf : darrGlobalAdjList.get(pintSourceVertexID).keySet()) {\n for (E e : darrGlobalAdjList.get(pintSourceVertexID).get(tf)) { \n if (e.getOtherEndPoint(vertexFrom).equals(vertexTo)) {\n return e;\n }\n } \n }\n return null;\n }", "public Map<V,List<E>> adjacencyMap(){\n\t\tMap<V,List<E>> ret = new HashMap<V,List<E>>();\n\t\tfor (E e : edges){\n\t\t\tif (virtualEdges.contains(e))\n\t\t\t\tcontinue;\n\t\t\tList<E> list;\n\t\t\tif (!ret.containsKey(e.getOrigin())){\n\t\t\t\tlist = new ArrayList<E>();\n\t\t\t\tret.put(e.getOrigin(), list);\n\t\t\t}\n\t\t\telse\n\t\t\t\tlist = ret.get(e.getOrigin());\n\t\t\tlist.add(e);\n\t\t\t\n\t\t\tif (!ret.containsKey(e.getDestination())){\n\t\t\t\tlist = new ArrayList<E>();\n\t\t\t\tret.put(e.getDestination(), list);\n\t\t\t}\n\t\t\telse\n\t\t\t\tlist = ret.get(e.getDestination());\n\t\t\tlist.add(e);\n\t\t}\n\t\treturn ret;\n\t}", "boolean hasPathTo(int v)\n\t{\n\t\treturn edgeTo[v].weight()!=Double.POSITIVE_INFINITY;\n\t}", "public void edgeMake(int vertex1, int vertex2) {\n addVertex(vertex1); // both vertices added to the set\n addVertex(vertex2);\n adjacencyMap.get(vertex1).add(vertex2); // both vertices receive the edge\n adjacencyMap.get(vertex2).add(vertex1);\n }", "public void addUndirectedEdge(int vertexOne, int vertexTwo) {\n\t\tGraphNode first = nodeList.get(vertexOne - 1);\n\t\tGraphNode second = nodeList.get(vertexTwo - 1);\n\t\tfirst.getNeighbors().add(second);//Neighbour of first is second. Store it.\n\t\tsecond.getNeighbors().add(first);//Neighbour of second is first. Store it.\n\t\tSystem.out.println(first.getNeighbors());\n\t\tSystem.out.println(second.getNeighbors());\n\t}", "public Set<Pair<V,V>> neighbourEdgesOf(V vertex);", "public Edge findEdge(Node n1, Node n2){\r\n for(Edge e: getListEdges()){\r\n if(e.getNode1().getId() == n1.getId() && e.getNode2().getId() == n2.getId())\r\n return e;\r\n if(e.getNode1().getId() == n2.getId() && e.getNode2().getId() == n1.getId())\r\n return e;\r\n }\r\n return null;\r\n }", "public void addNode(int key)\n{\n Node n1 = new Node(key);\n\t\n\tif(!getNodes().containsKey(n1.getKey())) \n\t{\n\tmc++;\n\tthis.getNodes().put(n1.getKey(),n1);\n\t\t\n\t}\n\telse {\n\t\treturn;\n\t\t//System.out.println(\"Node already in the graph\");\n\t}\n}", "@Override\n public void appendEdge(Integer first, Integer second) {\n if (col.containsKey(first) && col.containsKey(second)) {\n col.get(first).add(second);\n col.get(second).add(first); \n }\n }", "boolean hasNi(int node) {\n return this.neighbors.containsKey(node);\n }", "private void connectVertex(IndoorVertex indoorV1, IndoorVertex indoorV2)\n {\n XYPos firstPos = indoorV1.getPosition();\n XYPos secondPos = indoorV2.getPosition();\n\n //Change in only X position means that the vertex's are East/West of eachother\n //Change in only Y position means that the vertex's are North/South of eachother\n if(firstPos.getX() > secondPos.getX() && Math.floor(firstPos.getY() - secondPos.getY()) == 0.0)\n {\n indoorV1.addWestConnection(indoorV2);\n indoorV2.addEastConnection(indoorV1);\n }\n else if(firstPos.getX() < secondPos.getX() && Math.floor(firstPos.getY() - secondPos.getY()) == 0.0)\n {\n indoorV1.addEastConnection(indoorV2);\n indoorV2.addWestConnection(indoorV1);\n }\n else if(firstPos.getY() > secondPos.getY() && Math.floor(firstPos.getX() - secondPos.getX()) == 0.0)\n {\n indoorV1.addSouthConnection(indoorV2);\n indoorV2.addNorthConnection(indoorV1);\n }\n else if(firstPos.getY() < secondPos.getY() && Math.floor(firstPos.getX() - secondPos.getX()) == 0.0)\n {\n indoorV1.addNorthConnection(indoorV2);\n indoorV2.addSouthConnection(indoorV1);\n }\n\n\n indoorV1.addConnection(indoorV2);\n indoorV2.addConnection(indoorV1);\n }", "private void transPose(graph g) {\n\t\tIterator it = g.getV().iterator();\n\t\twhile (it.hasNext()) {\n\t\t\tnode_data temp = (node_data) it.next();\n\t\t\tif(g.getE(temp.getKey())!=null) {\n\t\t\t\tIterator it1 = g.getE(temp.getKey()).iterator();\n\t\t\t\twhile (it1.hasNext()) {\n\t\t\t\t\tedge_data temp1 = (edge_data) it1.next();\n\t\t\t\t\tif (temp1 != null && temp1.getTag() == 0) {\n\t\t\t\t\t\tif (g.getEdge(temp1.getDest(), temp1.getSrc()) != null) {\n\t\t\t\t\t\t\tEdge temps = new Edge((Edge)g.getEdge(temp1.getSrc(),temp1.getDest()));\n\t\t\t\t\t\t\tdouble weight1 = g.getEdge(temp1.getSrc(),temp1.getDest()).getWeight();\n\t\t\t\t\t\t\tdouble weight2 = g.getEdge(temp1.getDest(),temp1.getSrc()).getWeight();\n\t\t\t\t\t\t\tg.connect(temp1.getSrc(),temp1.getDest(),weight2);\n\t\t\t\t\t\t\tg.connect(temps.getDest(),temps.getSrc(),weight1);\n\t\t\t\t\t\t\tg.getEdge(temps.getDest(), temps.getSrc()).setTag(1);\n\t\t\t\t\t\t\tg.getEdge(temps.getSrc(),temps.getDest()).setTag(1);\n\t\t\t\t\t\t\tit1 = g.getE(temp.getKey()).iterator();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tg.connect(temp1.getDest(), temp1.getSrc(), temp1.getWeight());\n\t\t\t\t\t\t\tg.getEdge(temp1.getDest(), temp1.getSrc()).setTag(1);\n\t\t\t\t\t\t\tg.removeEdge(temp1.getSrc(), temp1.getDest());\n\t\t\t\t\t\t\tit1 = g.getE(temp.getKey()).iterator();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic edge_data getEdge(int src, int dest) {\n\t\tif(Nodes.containsKey(src) && Nodes.containsKey(dest) && Edges.get(src).containsKey(dest)) {\n\t\t\treturn Edges.get(src).get(dest);\n\t\t}\n\t\treturn null;\n\t}", "private void buildGraph(String[] words,int indegree[], HashMap<Character, Set<Character>> adjList){\n // initialise the adj list graph with all charac ters in all words\n for(String word:words ){\n for(char c: word.toCharArray()){\n adjList.putIfAbsent(c, new HashSet());\n }\n }// once u fill with init, then u eatblish relationships\n \n // wrt and er \n for(int i=1; i<words.length;i++){\n String first = words[i-1];\n String second = words[i];\n // now compare each char in thos words\n for(int j=0; j< Math.min(first.length(),second.length());j++){\n if(first.charAt(j) != second.charAt(j)){\n // a->b here out=a, in=b\n char out = first.charAt(j);\n char in = second.charAt(j);\n // a->b , so in adj list. we need to insert the valiue if not present\n // if the graph does not contains dependecny, which is in set, u add it else u dont add// since hashset, we can check usinhg contains i guess\n if(! adjList.get(out).contains(in)){\n adjList.get(out).add(in);\n \n indegree[in -'a']++;\n }\n // once it is found , u can break out th e loop\n break;\n \n }// if eqaual we mmove to next char and do the process\n }\n }\n }", "Dijk(){\n grp = new HashMap<>();\n seen = new HashSet<>();\n dlist = new HashMap<>();\n id = new HashMap<>();\n lowlink = new HashMap<>();\n orid = 0;\n }", "public abstract boolean addEdge(Node node1, Node node2, int weight);", "private void initGraph() {\n nodeMap = Maps.newIdentityHashMap();\n stream.forEach(t -> {\n Object sourceKey = sourceId.extractValue(t.get(sourceId.getTableId()));\n Object targetKey = targetId.extractValue(t.get(targetId.getTableId()));\n ClosureNode sourceNode = nodeMap.get(sourceKey);\n ClosureNode targetNode = nodeMap.get(targetKey);\n if (sourceNode == null) {\n sourceNode = new ClosureNode(sourceKey);\n nodeMap.put(sourceKey, sourceNode);\n }\n if (targetNode == null) {\n targetNode = new ClosureNode(targetKey);\n nodeMap.put(targetKey, targetNode);\n }\n sourceNode.next.add(targetNode);\n });\n\n }", "public Map<T, Path> edgesFrom(T node) {\n\t\tif (node == null) {\n\t\t\tthrow new NullPointerException(\"The node should not be null.\");\n\t\t}\n\t\tMap<T, Path> edges = graph.get(node);\n\t\tif (edges == null) {\n\t\t\tthrow new NoSuchElementException(\"Source node does not exist.\");\n\t\t}\n\t\treturn Collections.unmodifiableMap(edges);\n\t}", "private Map<VWBetw, Set<VWBetw>> prepareSourceDestinationMap(\n KeyedGraph<VWBetw, Edge> graph,\n int sourceIndex,\n int destinationIndex) throws DriverException {\n // Initialize the map.\n Map<VWBetw, Set<VWBetw>> map =\n new HashMap<VWBetw, Set<VWBetw>>();\n // Go throught the source-destination table and insert each\n // pair into the map.\n for (int i = 0;\n i < sourceDestinationTable.getRowCount();\n i++) {\n Value[] row = sourceDestinationTable.getRow(i);\n \n VWBetw sourceVertex = graph.getVertex(\n row[sourceIndex].getAsInt());\n VWBetw destinationVertex = graph.getVertex(\n row[destinationIndex].getAsInt());\n \n Set<VWBetw> targets = map.get(sourceVertex);\n // Lazy initialize if the destinations set is null.\n if (targets == null) {\n targets = new HashSet<VWBetw>();\n map.put(sourceVertex, targets);\n }\n // Add the destination.\n targets.add(destinationVertex);\n }\n return map;\n }", "public boolean hasEdge(K u, K v)\n {\n return adjMaps.get(u).containsKey(v);\n }", "@Override\n\tpublic List<node_data> shortestPath(int src, int dest) {\n\t\tList<node_data> ans = new ArrayList<>();\n\t\tthis.shortestPathDist(src, dest);\n\t\tif(this.GA.getNode(src).getWeight() == Integer.MAX_VALUE || this.GA.getNode(dest).getWeight() == Integer.MAX_VALUE){\n\t\t\tSystem.out.print(\"There is not a path between the nodes.\");\n\t\t\treturn null;\n\t\t}\n\t\tgraph copied = this.copy();\n\t\ttransPose(copied);\n\t\tnode_data first = copied.getNode(dest);\n\t\tans.add(first);\n\t\twhile (first.getKey() != src) {\n\t\t\tCollection<edge_data> temp = copied.getE(first.getKey());\n\t\t\tdouble check= first.getWeight();\n\t\t\tif(temp!=null) {\n\t\t\t\tfor (edge_data edge : temp) {\n\t\t\t\t\tif (copied.getNode(edge.getDest()).getWeight() + edge.getWeight() == check) {\n\t\t\t\t\t\tfirst = copied.getNode(edge.getDest());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tans.add(first);\n\t\t}\n\t\tList<node_data> ans2 = new ArrayList<>();\n\t\tfor (int i = ans.size()-1;i>=0;i--){\n\t\t\tans2.add(ans.get(i));\n\t\t}\n\t\treturn ans2;\n\t}", "public boolean hasNi(int nodeKey) {\n return this.neighborEdges.get(nodeKey) != null ? true : false;\n }", "@Override\n\tpublic Set<ET> getAdjacentEdges(N node)\n\t{\n\t\t// implicitly returns null if gn is not in the nodeEdgeMap\n\t\tSet<ET> adjacentEdges = nodeEdgeMap.get(node);\n\t\treturn adjacentEdges == null ? null : new HashSet<ET>(adjacentEdges);\n\t}", "public HashMap<Nodo, Integer> dijkstra() {\r\n\r\n\t\tPriorityQueue<NodoDijkstra> aVisitar = new PriorityQueue<NodoDijkstra>();\r\n\t\tHashMap<Nodo, Integer> distancias = new HashMap<Nodo, Integer>();\r\n\t\tHashMap<Nodo, Integer> retorno = new HashMap<Nodo, Integer>();\r\n\t\tHashSet<Nodo> visitados = new HashSet<Nodo>();\r\n\r\n\t\tNodoDijkstra nodoOrigen = new NodoDijkstra(this, 0);\r\n\t\tnodoOrigen.setCamino(new Camino(this));\r\n\t\taVisitar.add(nodoOrigen);\r\n\t\tdistancias.put(this, new Integer(0));\r\n\t\tretorno.put(this, new Integer(0));\r\n\r\n\t\twhile (!aVisitar.isEmpty()) {\r\n\t\t\tNodoDijkstra dNodo = aVisitar.poll();\r\n\t\t\tNodo actual = dNodo.getNodo();\r\n\t\t\tCamino camino = dNodo.getCamino();\r\n\r\n\t\t\tif (visitados.contains(actual))\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\tvisitados.add(actual);\r\n\r\n\t\t\tfor (CanalOptico canal : actual.canales) {\r\n\t\t\t\tNodo vecino = canal.getOtroExtremo(actual);\r\n\t\t\t\tint costo = canal.getCosto();\r\n\r\n\t\t\t\t/* Restriccion del Dijkstra */\r\n\t\t\t\tif (visitados.contains(vecino))\r\n\t\t\t\t\tcontinue;\r\n\r\n\t\t\t\tif (canal.estaBloqueado())\r\n\t\t\t\t\tcontinue;\r\n\r\n\t\t\t\tif (vecino.estaBloqueado())\r\n\t\t\t\t\tcontinue;\r\n\r\n\t\t\t\tif (distancias.containsKey(vecino)) {\r\n\t\t\t\t\tint dActual = distancias.get(vecino);\r\n\r\n\t\t\t\t\tif (dActual <= dNodo.getDistancia() + costo)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\taVisitar.remove(vecino);\r\n\t\t\t\t\t\tdistancias.remove(vecino);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tNodoDijkstra nuevoNodo = new NodoDijkstra(vecino,\r\n\t\t\t\t\t\tdNodo.getDistancia() + costo);\r\n\t\t\t\tCamino caminoNuevo = new Camino(camino);\r\n\t\t\t\tcaminoNuevo.addSalto(new Salto(camino.getSaltos().size() + 1,\r\n\t\t\t\t\t\tcanal));\r\n\t\t\t\tnuevoNodo.setCamino(caminoNuevo);\r\n\t\t\t\taVisitar.add(nuevoNodo);\r\n\t\t\t\tdistancias.put(nuevoNodo.getNodo(), nuevoNodo.getDistancia());\r\n\t\t\t\tretorno.put(nuevoNodo.getNodo(), nuevoNodo.getDistancia());\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn retorno;\r\n\t}", "@Override public Map<L, Integer> targets(L source) {\r\n \t Map<L, Integer> res= new HashMap <L, Integer>();\r\n \tif(!vertices.contains(source)) {\r\n \t\t//System.out.println(source+\" is not in the graph!\");\r\n \t\treturn res;\r\n \t}\r\n \tIterator<Edge<L>> iter=edges.iterator();\r\n \twhile(iter.hasNext()) {\r\n \t\tEdge<L> tmp=iter.next();\r\n \t\t//if(tmp.getSource()==source)\r\n \t\tif(tmp.getSource().equals(source))\r\n \t\t\tres.put(tmp.getTarget(), tmp.getWeight());\r\n \t\t\r\n \t}\r\n \tcheckRep();\r\n \treturn res;\r\n\r\n }", "private static boolean putInHashMap(Node head) {\r\n\t\tboolean hasloop = false;\r\n\t\tHashSet<Node> nodeSet = new HashSet();\r\n\t\twhile (head != null) {\r\n\t\t\tif (nodeSet.contains(head)) {\r\n\t\t\t\thasloop = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tnodeSet.add(head);\r\n\t\t\thead = head.next;\r\n\t\t}\r\n\r\n\t\treturn hasloop;\r\n\t}", "public boolean leadsToDestination(int n, int[][] edges, int source, int destination) {\n List<Integer>[] G = (List<Integer>[]) new List[n];\n for (int i = 0; i < n; i++) G[i] = new ArrayList();\n for (int[] edge : edges) {\n int s = edge[0], t = edge[1];\n G[s].add(t);\n }\n\n // use dfs to check condition\n Set<Integer> visited = new HashSet();\n if (G[source].size() == 0) return false;\n for (Integer next : G[source]) {\n if (!dfs(next, destination, G, visited, new HashSet()))\n return false;\n }\n return true;\n }", "private void goDeep(int key) {\r\n\t\tSet<Integer> connections = dataModel.getConnections(key);\r\n\t\t//System.out.println(key);\r\n\t\tvisited.add(key);\r\n\t\ttuvPair.add(key);\r\n\r\n\t\tfor (Integer tempKey : connections) {\r\n\t\t\tif (!tuvPair.contains(tempKey)) {\r\n\t\t\t\tgoDeep(tempKey);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}", "public abstract GraphEdge<N, E> getFirstEdge(N n1, N n2);", "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 findDestinations(Graph graph, HashMap<Integer, Tuple> topology) {\n // loops through the entire topology and updates matched list\n // with routers we can route to based on current topology\n for (int i = 0; i < topology.size(); i++) {\n ArrayList checked = new ArrayList();\n Iterator iterator = topology.entrySet().iterator();\n int routerId = 0;\n int routerLink = 0;\n boolean inTesting = false;\n while(iterator.hasNext()) {\n Map.Entry entry = (Map.Entry)iterator.next();\n Tuple tuple = (Tuple) entry.getValue();\n if (!matched.contains(tuple.link_id) && !checked.contains(tuple.link_id) && !inTesting) {\n checked.add(tuple.link_id);\n routerId = tuple.router_id;\n routerLink = tuple.link_id;\n inTesting = true;\n } else if (!matched.contains(tuple.link_id) && tuple.link_id == routerLink) {\n Node n1 = null;\n Node n2 = null;\n for (Node n: graph.nodes) {\n if (n.id == routerId) {\n n1 = n;\n } else if (n.id == tuple.router_id) {\n n2 = n;\n }\n }\n matched.add(routerLink);\n n1.addDestination(n2, tuple.link_cost);\n n2.addDestination(n1, tuple.link_cost);\n }\n }\n }\n }", "public ArrayList<Integer> path2Dest(int s, int t, int k, int method){\n double INFINITY = Double.MAX_VALUE;\n boolean[] SPT = new boolean[intersection];\n double[] d = new double[intersection];\n int[] parent = new int[intersection];\n\n for (int i = 0; i <intersection ; i++) {\n d[i] = INFINITY;\n parent[i] = -1;\n }\n d[s] = 0;\n\n MinHeap minHeap = new MinHeap(k);\n for (int i = 0; i <intersection ; i++) {\n minHeap.add(i,d[i]);\n }\n while(!minHeap.isEmpty()){\n int extractedVertex = minHeap.extractMin();\n\n if(extractedVertex==t) {\n break;\n }\n SPT[extractedVertex] = true;\n\n LinkedList<Edge> list = g.adjacencylist[extractedVertex];\n for (int i = 0; i <list.size() ; i++) {\n Edge edge = list.get(i);\n int destination = edge.destination;\n if(SPT[destination]==false ) {\n double newKey =0;\n double currentKey=0;\n if(method==1) { //method 1\n newKey = d[extractedVertex] + edge.weight;\n currentKey = d[destination];\n }\n else{ //method 2\n newKey = d[extractedVertex] + edge.weight + coor[destination].distTo(coor[t])-coor[extractedVertex].distTo(coor[t]);\n currentKey = d[destination];\n }\n if(currentKey>=newKey){\n if(currentKey==newKey){ //if equal need to compare the value of key\n if(extractedVertex<parent[destination]){\n minHeap.updateKey(newKey, destination, d[destination]);\n parent[destination] = extractedVertex;\n d[destination] = newKey;\n }\n }\n else {\n minHeap.updateKey(newKey, destination, d[destination]);\n parent[destination] = extractedVertex;\n d[destination] = newKey;\n }\n }\n }\n }\n }\n //trace back the path using parent properties\n ArrayList<Integer> path = new ArrayList<>();\n if(parent[t]!=-1){\n path.add(t);\n while(parent[t]!= s) {\n path.add(0,parent[t]);\n t = parent[t];\n }\n path.add(0,s);\n }\n else\n path = null;\n return path;\n }", "public static void printfin(coordinate visit1[][], coordinate visit2[][]) {\n \t //represent one path to be 3s and the other to be 4s, but for now, set both srcs to three\n \t map[dim-1][dim-1]=3;\n \t map[0][0]=3;\n \t int tempx = intersect.x; \n \t int tempy = intersect.y;\n \t map[tempx][tempy] = 3; //will be updated later\n \n \t while(!(tempx==0 && tempy==0)) { //iterate one path until we hit the src1\n coordinate hold = visit1[tempx][tempy];\n\t\t//take current node and mark as visited in path 1 (src1 -- from 0,0 to intersect)\n tempx = hold.x;\n tempy=hold.y;\n\t\t//set these to 3, as visited, and increase pathSize\n pathsize++;\n\n map[tempx][tempy]=3;\n\n tempx = hold.x;\n tempy=hold.y;\n\n map[tempx][tempy]=3;\n \t }\n \t //do the same for second path\n \t tempx = intersect.x;\n \t tempy = intersect.y;\n \t map[tempx][tempy] = 3; \n \t int val=dim-1;\n \n\t //this is for the other path from the second src\n \t while(!(tempx==val && tempy==val)) {\n\t \t coordinate hold = visit2[tempx][tempy];\n\t \t tempx = hold.x;\n\t \t tempy=hold.y;\n\t \t pathsize++;\n\t \t \n\t \t map[tempx][tempy]=3;\n\t \t \n\t \t tempx = hold.x;\n\t \t tempy=hold.y;\n\t \t \n\t \t map[tempx][tempy]=4;\n \t }\n \n }" ]
[ "0.65859205", "0.6505213", "0.6381745", "0.6331321", "0.6295936", "0.609331", "0.60725236", "0.60357153", "0.60342807", "0.6016219", "0.59981793", "0.5983013", "0.59654534", "0.5959874", "0.59580886", "0.59556353", "0.59306043", "0.5920326", "0.5918869", "0.5884705", "0.58801377", "0.58747745", "0.585201", "0.5843046", "0.5842352", "0.5825843", "0.58205914", "0.5814426", "0.5808109", "0.5793886", "0.5788109", "0.5787045", "0.5784515", "0.57834244", "0.5775633", "0.5775618", "0.57591367", "0.5754879", "0.57544315", "0.5751346", "0.5749615", "0.5732152", "0.57312995", "0.57215005", "0.57196176", "0.5715273", "0.5710067", "0.5705672", "0.57044435", "0.5691737", "0.5689999", "0.5682657", "0.56666785", "0.56573564", "0.5652698", "0.56466246", "0.5641647", "0.5640377", "0.56367713", "0.5631819", "0.5622516", "0.56076986", "0.560115", "0.56010586", "0.55995625", "0.55931264", "0.55623543", "0.55622935", "0.5561214", "0.555474", "0.55533075", "0.5552401", "0.555071", "0.5534292", "0.552296", "0.5518528", "0.5516066", "0.55104685", "0.5508422", "0.5498106", "0.5497197", "0.54964405", "0.5494923", "0.54948777", "0.54947144", "0.54908955", "0.54844826", "0.5477235", "0.5476064", "0.5473644", "0.54711425", "0.5470487", "0.5464034", "0.54518074", "0.54509366", "0.54469746", "0.5440642", "0.54366463", "0.5428335", "0.54240316" ]
0.6121648
5
/ Add a vertex to the HashMap (if it not exist)
public void addNode(int key) { Node n1 = new Node(key); if(!getNodes().containsKey(n1.getKey())) { mc++; this.getNodes().put(n1.getKey(),n1); } else { return; //System.out.println("Node already in the graph"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void addVertex(Vertex vertex) {\n if (!this.verticesAndTheirEdges.containsKey(vertex)) {\n this.verticesAndTheirEdges.put(vertex, new LinkedList<>());\n } else {\n System.out.println(\"Vertex already exists in map.\");\n }\n }", "@Override\r\n public void add(V vertexName) {\r\n if(!contains(vertexName))\r\n map.put(vertexName, new Vertex(vertexName));\r\n }", "@Override\n public E addVertex(E vertex) {\n if (vertex == null || dictionary.containsKey(vertex)) {\n return null;\n } else {\n dictionary.put(vertex, new ArrayList<>());\n return vertex;\n }\n }", "public void addVertex(T v) {\n map.put(v, new LinkedList<>());\n }", "public void addVertex(int vertex) {\n if (!adjacencyMap.containsKey(vertex)) {\n adjacencyMap.put(vertex, new HashSet<>());\n }\n }", "void add(Vertex vertex);", "void addVertex(Vertex v);", "public void addVertex( VKeyT key, VDataT data );", "Vertex addVertex(String name){\n\t\t//if graph doesn't already have the key\n\t\tif (!adjlist.containsKey(name)) {\n\t\t\tkeys.add(name); //places keys in list in order they're added\n\t\t\tvertices++; //increases vertex count variable\n\t\t\treturn adjlist.put(name, new Vertex(name)); //adds to hashmap\n\t\t//if graph does already have the key\n\t\t} else {\n\t\t\treturn adjlist.get(name);\n\t\t}\n\t}", "public void addVertex(Vertex vertex){\n \n synchronized(vertexes){\n \n vertexes.put(vertex.getID(),vertex);\n }\n }", "public abstract boolean putVertex(Vertex incomingVertex);", "public void addVertex();", "@Override\n public void addVertex(V vertex)\n {\n if (vertex.equals(null)){\n throw new IllegalArgumentException();\n }\n ArrayList <V> edges = new ArrayList<>();\n\t graph.put(vertex, edges);\n\n }", "public boolean addVertex(V vertex);", "public boolean addVertex(V vertex);", "void add(int vertex);", "public boolean addVertex(Object value) \n\t{\n\t\tthis.map.put(value, new SinglyLinkedList());\n\t\treturn true;\n\t}", "boolean addVertex(V v);", "public void addVertex(Vertex v) {\n\t \tif (!this.vertexes.contains(v)) {\r\n\t \t\tthis.vertexes.add(v);\r\n\t \t}\r\n\t \t//otherwise just ignore, the Graph already has this vertex\r\n\t }", "public V addVertex(V v);", "@Override\r\n public void addVertex(Vertex v) {\r\n adjacencyList.put(v, new ArrayList<>()); //putting v into key, a new LinkedList into value for later use\r\n }", "@Override\r\n\tpublic boolean insertVertex(E e) {\r\n\t\tif(!containsVertex(e)) {\r\n\t\t\tvertices.put(e, new Vertex<E>(e));\r\n\t\t\tadjacencyLists.put(e, new ArrayList<>());\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public void addVertex(String vertexName, E data)\r\n\t{\r\n\t\tif(this.adjacencyMap.containsKey(vertexName))\r\n\t\t{\r\n\t\t\tthrow new IllegalArgumentException(\"Vertex already exists in the graph!\");\r\n\t\t}\r\n\t\t\r\n\t\tthis.dataMap.put(vertexName, data);\r\n\t\tthis.adjacencyMap.put(vertexName, new HashMap<String,Integer>());\r\n\t}", "public boolean addVertex(T vert);", "public void addVertex (E vertex)\n {\n if (!this.containsVertex (vertex))\n {\n // Enlargen the graph if needed\n if (lastIndex == vertices.length - 1)\n this.enlarge ();\n\n lastIndex = lastIndex + 1;\n vertices[lastIndex] = vertex;\n }\n }", "public boolean addVertex(GeographicPoint location)\n\t{\n\t\t// TODO: Implement this method in WEEK 3\n\t\tif (location == null) {\n\t\t\treturn false;\n\t\t}\n\t\telse if (!map.containsKey(location)) {\n\t\t\tmap.put(location, new MapNode(location));\n\t\t\tnumVertices++;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public void addVertex(String vertLabel) {\n\n // Implement me!\n if (indexOf(vertLabel, vertices) != -1) {\n return;\n }\n vertices.put(vertLabel, vertices.size());\n if (weights.length == 0) {\n weights = new int[1][0];\n } else {\n weights = addOneRow(weights);\n }\n\n\n }", "public boolean addVertex(T vertexLabel);", "@Override public boolean add(L vertex) {\r\n \r\n \tif(vertices.contains(vertex)==false)\r\n \t{\r\n \tvertices.add(vertex);\r\n \tcheckRep();\r\n \treturn true;\r\n }\r\n else {\r\n \t\r\n \treturn false;\r\n }\r\n \t\r\n }", "private Vertex getVertex( String vertexName )\n {\n Vertex v = vertexMap.get( vertexName );\n if( v == null )\n {\n v = new Vertex( vertexName );\n vertexMap.put( vertexName, v );\n }\n return v;\n }", "@Override\n public boolean appendVertex(Integer vertex) {\n if (col.containsKey(vertex))\n return false;\n col.put(vertex, new ArrayList<Integer>());\n return true;\n }", "@Override\n public boolean addEdge(E vertex1, E vertex2) {\n if (vertex1 != null\n && vertex2 != null\n && vertex1 != vertex2\n && dictionary.containsKey(vertex1)\n && dictionary.containsKey(vertex2)) {\n dictionary.get(vertex1).add(vertex2);\n dictionary.get(vertex2).add(vertex1);\n return true;\n } else {\n return false;\n }\n }", "public void addVertex(Vertex v) {\n\t\tvertices.put(v.name(), v);\n\t}", "public void addVertex (){\t\t \n\t\tthis.graph.insert( new MyList<Integer>() );\n\t}", "@Override\n\tpublic boolean add(E vertex) {\n\t\treturn vertices.add(vertex);\n\t}", "@Test\n\tvoid testVerticesExist() {\n\t\tLinkedHashSet<String> edges = new LinkedHashSet<String>();\n\n\t\tedges.add(\"Newark\");\n\t\tedges.add(\"New York\");\n\t\tmap.put(\"Boston\", edges);\n\t\tedges = map.get(\"Boston\");\n\t\tString[] edgesArray = new String[edges.size()];\n\t\tedgesArray = edges.toArray(edgesArray);\n\t\tAssertions.assertTrue(map.containsKey(\"Boston\"));\n\n\t\tedges = new LinkedHashSet<String>();\n\t\tedges.add(\"Philadelphia\");\n\t\tmap.put(\"Newark\", edges);\n\t\tedgesArray = new String[edges.size()];\n\t\tedgesArray = edges.toArray(edgesArray);\n\t\tAssertions.assertTrue(map.containsKey(\"Newark\"));\n\n\t\tedges = new LinkedHashSet<String>();\n\t\tedges.add(\"Albany\");\n\t\tmap.put(\"Trenton\", edges);\n\t\tedgesArray = new String[edges.size()];\n\t\tedgesArray = edges.toArray(edgesArray);\n\t\tAssertions.assertTrue(map.containsKey(\"Trenton\"));\n\t}", "private Vertex<String> addLocation(String name) {\n if (!vertices.containsKey(name)) {\n Vertex<String> v = graph.insert(name);\n vertices.put(name, v);\n return v;\n }\n return vertices.get(name);\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 }", "int addVertex(Vector position);", "public void addEdge(V vertex) {\n this.vertices.put(vertex, new HashSet<>());\n }", "@Override\r\n\tpublic void addVertex(Integer vertexID) {\r\n\t\tif (vertexIDs.size() > 0) {\r\n\t\t\tvertexIDs.set(0, vertexID);\r\n\t\t} else {\r\n\t\t\tvertexIDs.add(vertexID);\r\n\t\t}\r\n\t}", "@Override\n\tpublic boolean add(L vertex) {\n\t\tIterator<Vertex<L>> vertexiter = verticelist.iterator();\n\t\twhile (vertexiter.hasNext()) {\n\t\t\tVertex<L> v = vertexiter.next();\n\t\t\tL lab = v.getlabel();\n\t\t\tif (lab.equals(vertex))\n\t\t\t\treturn false;\n\t\t}\n\t\tVertex<L> v = new Vertex<L>(vertex);\n\t\tverticelist.add(v);\n\t\treturn true;\n\t}", "public void tryAddNode(VK nodeKey, VV nodeValue) {\r\n if(!nodes.containsKey(nodeKey)){\r\n \tV vertex = vertexCtor.apply(nodeKey, nodeValue);\r\n nodes.put(nodeKey, vertex);\r\n heads.add(vertex);\r\n }\r\n }", "@Override\n public void addVertex(V pVertex, TimeFrame tf) {\n if (pVertex.getId() < 0) {\n int id = vertexIdGen.getNextAvailableID();\n //System.out.println(\" :: vertex new id = \" + id);\n pVertex.setId(id);\n mapAllVertices.add(id, pVertex);\n if (darrGlobalAdjList.get(id) == null) {\n darrGlobalAdjList.add(id, new HashMap<>());\n }\n }\n //System.out.println(\" darrGlobalAdjList.get(pVertex.getId()) : \" + darrGlobalAdjList.get(pVertex.getId()));\n if (!darrGlobalAdjList.get(pVertex.getId()).containsKey(tf)) {\n darrGlobalAdjList.get((pVertex.getId())).put(tf, new LinkedList<>());\n }\n hmpGraphsAtTimeframes.get(tf).addVertex(pVertex);\n //System.out.println(\" \\t\\t\\t\\t\\t DynamicGraph.addVertex tf = \" + tf.getTimeFrameName() + \" :: \" +this.getGraphTitle());\n //System.out.println(\" \\t\\t\\t\\t\\t DynamicGraph.addVertex mapAllVertices = \" + mapAllVertices.getIds());\n //System.out.println(\" \\t\\t\\t\\t\\t DynamicGraph.addVertex tf = \" + hmpGraphsAtTimeframes.get(tf));\n //System.out.println(\" \\t\\t\\t\\t\\t DynamicGraph.addVertex hmpGraphsAtTimeframes.get(tf) all vertexIds = \" + hmpGraphsAtTimeframes.get(tf).getAllVertexIds());\n }", "public Position insertVertex(Object o);", "public void add (V vertex) {\n if (dag.containsKey(vertex)) return;\n dag.put(vertex, new ArrayList<V>());\n }", "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}", "public Vertex addVertex(String name) {\n Vertex v;\n v = mVertices.get(name);\n if (v == null) {\n v = new Vertex(name);\n mVertices.put(name, v);\n mAdjList.put(v, new TreeSet<Vertex>());\n mNumVertices += 1;\n }\n return v;\n }", "public void add(Vertex vertex) {\n\t\tvertices.add(vertex);\n\t}", "@Test\n\tvoid testAddFirstEdgeForGivenVertex() {\n\t\tmap.put(\"Boston\", null);\n\t\tOptional<LinkedHashSet<String>> vertexOptional = Optional.ofNullable(map.get(\"Boston\"));\n\t\tif (vertexOptional.isEmpty()) {\n\t\t\tLinkedHashSet<String> firstEdge = new LinkedHashSet<String>();\n\t\t\tfirstEdge.add(\"New York\");\n\t\t\tmap.put(\"Boston\", firstEdge);\n\t\t\tAssertions.assertNotNull(map.get(\"Boston\"));\n\t\t\tAssertions.assertTrue(map.get(\"Boston\").contains(\"New York\"));\n\t\t}\n\t}", "@Override\r\n public void add(T value) {\r\n Vertex<T> vertex = new Vertex<>(value);\r\n vertices.put(value, vertex);\r\n }", "@Test\n\tvoid testAddSecondEdgeForGivenVertex() {\n\t\tLinkedHashSet<String> edges = new LinkedHashSet<String>();\n\t\tedges.add(\"New York\");\n\t\tmap.put(\"Boston\", edges);\n\t\tOptional<LinkedHashSet<String>> vertexOptional = Optional.ofNullable(map.get(\"Boston\"));\n\t\tif (vertexOptional.isPresent()) {\n\t\t\tedges.add(\"Newark\");\n\t\t\tAssertions.assertNotNull(map.get(\"Boston\"));\n\t\t\tAssertions.assertTrue(map.get(\"Boston\").contains(\"New York\"));\n\t\t\tAssertions.assertTrue(map.get(\"Boston\").contains(\"Newark\"));\n\t\t}\n\t}", "void addVertex(Vertex v, ArrayList<Vertex> neighbors, ArrayList<Double> weights) throws VertexNotInGraphException;", "@Override\n\tpublic void implementAddVertex() {\n\t\t\n\t}", "public void addVertex(Vertex v)\n {\n this.vertices.add(v);\n connections.put(v, new ArrayList<>());\n }", "@Override\n public boolean contains(V vertex)\n {\n if (vertex.equals(null)){\n throw new IllegalArgumentException();\n }\n return graph.containsKey(vertex);\n }", "public void addVertex(Vertex v) {\r\n if (vertexNum >= maxNum) {\r\n System.out.println(\"Error\");\r\n return;\r\n }\r\n vertexNum += 1;\r\n vertexList.add(v);\r\n }", "public void addVertex(Vertex vertexToAdd) {\r\n\t\tlistVertex.add(vertexToAdd);\r\n\t}", "public boolean addVertex(Vertex vertex)\n\t{\n\t\tVertex current = this.vertices.get(vertex.getLabel());\n\t\tif (current != null)\n\t\t{\n\t\t\tcurrent.visit();//if vertex exists, increment visits\n\t\t\t\n\t\t\t//add edge between vertices\n\t\t\taddEdge(last,current);\n\t\t\t//overwrite last vertex\n\t\t\tlast = current;\n\t\t\t\n\t\t\treturn false;//vertex not added\n\t\t\t\n\t\t}\n\t\tvertices.put(vertex.getLabel(), vertex);\n\t\t//track last vertex to add edge\n\t\tif(last == null)//first vertex?\n\t\t{\n\t\t\tlast = vertex;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//add edge between vertices\n\t\t\taddEdge(last,vertex);\n\t\t\t//overwrite last vertex\n\t\t\tlast = vertex;\n\t\t}\n\t\treturn true;//vertex was added\n\t\t\n\t}", "@Override\n public void addValue(T value) {\n Vertex<T> vertex = new Vertex<>(value);\n vertices.put(value,vertex);\n }", "@Override\n\tpublic boolean containsVertex(Object value) \n\t{\n\t\treturn (this.map.containsKey(value));\n\t}", "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}", "synchronized Vertex<V, E, M> getOrCreateVertex(long id) {\n Vertex<V, E, M> vertex = vertices.get(id);\n if (vertex == null) {\n vertex = new Vertex<>(id, this);\n this.vertices.put(id, vertex);\n }\n\n return vertex;\n }", "void addVertex(SimpleVertex simpleVertex) {\n\t\tallvertices.add(simpleVertex);\n\t}", "@Test\n\tpublic void addVertexTest() {\n\t\tgraph.addVertex(A);\n\t\tgraph.addVertex(B);\n\t\tgraph.addVertex(C);\n\t\tgraph.addVertex(D);\n\t\tassertEquals(4, graph.vertices().size());\n\t\tassertTrue(graph.vertices().contains(A));\n\t\tassertTrue(graph.vertices().contains(B));\n\t\tassertTrue(graph.vertices().contains(D));\n\t\tassertFalse(graph.addVertex(B)); // the graph has already have the vertex B, so assert false here.\n\t}", "@Override\r\n\tpublic boolean containsVertex(E key) {\r\n\t\treturn vertices.containsKey(key);\r\n\t}", "private Vertice getVertex(String name) {\r\n Vertice v = (Vertice) vertices.get(name);\r\n if (v == null) {\r\n v = new Vertice(name);\r\n vertices.put(name, v);\r\n }\r\n return v;\r\n }", "public boolean addVertex(String label, Object value)\n\t{\n\t\tif(!hasVertex(label)) //if edge does not already exist add it\n\t\t{\n\t\t\tDSAGraphVertex v = new DSAGraphVertex(label, value);\n\t\t\tvertices.insertLast(v); //inserts into vertices list at end\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "Vertex createVertex();", "public native VertexList append(VertexNode vertex);", "@Override\n public void put(PairNode<K, V> node) {\n super.put(node);\n keySet.add(node.getKey());\n }", "public boolean addVertex(String label)\n\t{\n\t\tif(!hasVertex(label)) //if edge does not already exist add it\n\t\t{\n\t\t\tDSAGraphVertex v = new DSAGraphVertex(label, null);\n\t\t\tvertices.insertLast(v); //inserts into vertices list at end\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "AdjacencyGraph(){\r\n vertices = new HashMap<>();\r\n }", "@Test\n\tvoid testAdjacentNodes() {\n\t\tLinkedHashSet<String> edges = null;\n\t\tmap.put(\"Boston\", edges);\n\t\tOptional<LinkedHashSet<String>> vertexOptional = Optional.ofNullable(map.get(\"Boston\"));\n\t\t// Boston does not have any adjacent nodes\n\t\tAssertions.assertTrue(vertexOptional.isEmpty());\n\t\t// if connected vertex is null new vertex is created. Now Adjacent nodes will\n\t\t// not have any nodes inside it.\n\t\tif (vertexOptional.isEmpty()) {\n\t\t\tedges = new LinkedHashSet<String>();\n\t\t\tmap.put(\"Boston\", edges);\n\t\t\tAssertions.assertNotNull(map.get(\"Boston\"));\n\t\t\tAssertions.assertEquals(0, map.get(\"Boston\").size());\n\n\t\t}\n\n\t}", "public void addEdge( VKeyT fromKey, VKeyT toKey, EDataT data )\n throws NoSuchVertexException;", "public void putVertexInfoToIndex(String vid, String targetIP);", "GameBoardVertex(GameBoardVertex neighbor){this.neighbors.add(neighbor);}", "public void addVertex(String aName)\r\n\t{\n\t\tif(containsName(aName))\r\n\t\t\treturn;\r\n\t\tVertex v = new Vertex(aName);\r\n\t\tvertices.add(v);\r\n\t\tif(origin == null)\r\n\t\t\torigin = v;\r\n\t\t\r\n\t}", "private int addAgentToVertex(Vertex vertex, Agent ag){\n synchronized (vertexAgentsNumber) {\n if( vertexAgentsNumber.get(vertex) != null)\n vertexAgentsNumber.get(vertex).add(ag);\n else{\n Collection<Agent> colOfAgents = new HashSet();\n colOfAgents.add(ag);\n vertexAgentsNumber.put(vertex,colOfAgents);\n }\n return vertexAgentsNumber.get(vertex).size();\n }\n }", "public void insert(VertexRecord key) {\n throw new UnsupportedOperationException();\n }", "public int addVertex(Model src, int vertexId) {\n\t\tint x = src.vertexX[vertexId];\n\t\tint y = src.vertexY[vertexId];\n\t\tint z = src.vertexZ[vertexId];\n\n\t\tint identical = -1;\n\t\tfor (int v = 0; v < vertexCount; v++) {\n\t\t\tif ((x == vertexX[v]) && (y == vertexY[v]) && (z == vertexZ[v])) {\n\t\t\t\tidentical = v;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// append new one if no matches were found\n\t\tif (identical == -1) {\n\t\t\tvertexX[vertexCount] = x;\n\t\t\tvertexY[vertexCount] = y;\n\t\t\tvertexZ[vertexCount] = z;\n\t\t\tif (src.vertexLabel != null) {\n\t\t\t\tvertexLabel[vertexCount] = src.vertexLabel[vertexId];\n\t\t\t}\n\t\t\tidentical = vertexCount++;\n\t\t}\n\n\t\treturn identical;\n\t}", "@Override\n public void addVertex(List<V> phmapVertices, TimeFrame tf) {\n for (V v : phmapVertices) {\n addVertex(v,tf);\n }\n }", "public void addVertex(int name) {\n\t\tVertex v = new Vertex(name, parent);\n\t\tthis.addVertex(v);\n\t}", "@Override\n public E removeVertex(E vertex) {\n if (vertex == null || !dictionary.containsKey(vertex)) {\n return null;\n } else {\n for (E opposite : getNeighbors(vertex)) {\n dictionary.get(opposite).remove(vertex);\n }\n dictionary.remove(vertex);\n return vertex;\n }\n }", "public void add(final Vector3d vertex) {\n\t\tcurrentRow[rowIndex] = vertex;\n\t\tif (rowIndex > 0 && lastRow != null) {\n\t\t\tfinal Vector3d edge1 = lastRow[rowIndex - 1];\n\t\t\tfinal Vector3d edge2 = lastRow[rowIndex];\n\t\t\tfinal Vector3d edge3 = currentRow[rowIndex];\n\t\t\tfinal Vector3d edge4 = currentRow[rowIndex - 1];\n\t\t\tfinal Triangle t1 = reverseOrder ? makeTriangle(edge1, edge3, edge2)\n\t\t\t\t\t: makeTriangle(edge1, edge2, edge3);\n\t\t\tfinal Triangle t2 = reverseOrder ? makeTriangle(edge1, edge4, edge3)\n\t\t\t\t\t: makeTriangle(edge1, edge3, edge4);\n\t\t\ttriangs.add(t1);\n\t\t\ttriangs.add(t2);\n\t\t}\n\t\trowIndex++;\n\t\tif (rowIndex >= currentRow.length) {\n\t\t\tlastRow = currentRow;\n\t\t\tcurrentRow = new Vector3d[currentRow.length];\n\t\t\trowIndex = 0;\n\t\t}\n\t}", "private void maybeInsertVertex(VerifiedVertex verifiedVertex) {\n\t\ttry {\n\t\t\tthis.vertexStore.insertVertex(verifiedVertex);\n\t\t} catch (MissingParentException e) {\n\t\t\tlog.debug(\"Could not insert timeout vertex: {}\", e.getMessage());\n\t\t}\n\t}", "public void addEdge(String node1, String node2) {\n\r\n LinkedHashSet<String> adjacent = map.get(node1);\r\n// checking to see if adjacent node exist or otherwise is null \r\n if (adjacent == null) {\r\n adjacent = new LinkedHashSet<String>();\r\n map.put(node1, adjacent);\r\n }\r\n adjacent.add(node2); // if exist we add the instance node to adjacency list\r\n }", "private void addOrUpdatePropertiesVertex(GraphTraversalSource g, Vertex vertex, LineageEntity lineageEntity) {\n Map<String, Object> properties = getProperties(lineageEntity);\n g.inject(properties)\n .unfold()\n .as(PROPERTIES)\n .V(vertex.id())\n .as(V)\n .sideEffect(__.select(PROPERTIES)\n .unfold()\n .as(KV)\n .select(V)\n .property(__.select(KV).by(Column.keys), __.select(KV).by(Column.values))).iterate();\n }", "@Test\r\n void test_insert_null_vertex() {\r\n graph.addVertex(null);\r\n vertices = graph.getAllVertices();\r\n \r\n if(vertices.contains(null))\r\n fail();\r\n if(vertices.size() != 0 ||graph.order() != 0) {\r\n fail();\r\n }\r\n\r\n }", "public void addVertex(T vertLabel) {\n\t\tvertCount++;\n\t\tLinkedList[] tempList = new LinkedList[vertCount];\n\t\tLinkedList newVert = new LinkedList((String)vertLabel);\n\t\t\n\t\tif(verts.length==0){\n\t\t\ttempList[0] = newVert;\n\t\t}\n\t\t\n\t\telse{\n\t\t\tfor(int x=0; x<verts.length; x++){\n\t\t\t\t\ttempList[x] = verts[x];\n\t\t\t}\n\t\t\ttempList[verts.length] = newVert;\n\t\t}\n\tverts = tempList;\n }", "@Test\n\tvoid testIfAdjacentNodeExists() {\n\t\tMap<String, LinkedHashSet<String>> map = new HashMap<String, LinkedHashSet<String>>();\n\t\tLinkedHashSet<String> edges = new LinkedHashSet<String>();\n\t\tedges.add(\"New York\");\n\t\tmap.put(\"Boston\", edges);\n\t\tOptional<LinkedHashSet<String>> vertexOptional = Optional.of(map.get(\"Boston\"));\n\t\tif (vertexOptional.isPresent()) {\n\t\t\tAssertions.assertNotNull(map.get(\"Boston\"));\n\t\t\tAssertions.assertEquals(1, map.get(\"Boston\").size());\n\t\t\tString[] edgesArray = new String[edges.size()];\n\t\t\tedgesArray = edges.toArray(edgesArray);\n\t\t\tAssertions.assertTrue(map.get(\"Boston\").contains(\"New York\"));\n\t\t\tAssertions.assertEquals(\"New York\", edgesArray[0]);\n\t\t}\n\n\t}", "public String storeVertex(VertexInfo vdata, EdgeCollectionWritable edata);", "@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 }", "@Test\n public void testAddVertexExisting() throws Exception {\n final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();\n\n Graph<Long, Long, Long> graph =\n Graph.fromDataSet(\n TestGraphUtils.getLongLongVertexData(env),\n TestGraphUtils.getLongLongEdgeData(env),\n env);\n\n graph = graph.addVertex(new Vertex<>(1L, 1L));\n\n DataSet<Vertex<Long, Long>> data = graph.getVertices();\n List<Vertex<Long, Long>> result = data.collect();\n\n expectedResult = \"1,1\\n\" + \"2,2\\n\" + \"3,3\\n\" + \"4,4\\n\" + \"5,5\\n\";\n\n compareResultAsTuples(result, expectedResult);\n }", "public boolean isVertex( VKeyT key );", "public void addAdjVertex(String currentVertex, String connection)\r\n\t{\r\n\t\tAdjVertex newAdjVertex = newAdjVertex(connection);\r\n\t\t// insert this new node to the linked list\r\n\t\tnewAdjVertex.next = myGraph[getId(currentVertex)].adjVertexHead;\r\n\t\tmyGraph[getId(currentVertex)].adjVertexHead = newAdjVertex;\r\n\t}", "public boolean add(K key, V value){\r\n int loc = find(key);\r\n if(needToRehash()){\r\n rehash();\r\n }\r\n Entry<K,V> newEntry = new Entry<>(key,value);\r\n if(hashTable[loc]!= null && hashTable[loc].equals(key))\r\n return false;\r\n else{\r\n hashTable[loc] = newEntry;\r\n size++;\r\n return true;\r\n }\r\n }", "public void addConnection(Vertex v){\n if(v != this){\r\n if(!connections.contains(v)){\r\n connections.add(v);\r\n }\r\n if(!v.getConnections().contains(this)){\r\n v.addConnection(this);\r\n } \r\n }\r\n\r\n \r\n }", "public void insert(T vertex, Point2D pos);", "private void addVerticesToGraph()\n\t{\n\t\tString vertexName;\n\n\t\tMap<Long, IOFSwitch> switches = this.floodlightProvider.getSwitches();\n\t\tfor(IOFSwitch s :switches.values())\n\t\t{\n\t\t\tvertexName =Long.toString(s.getId());\n\t\t\tm_graph.addVertex(vertexName);\t\t\t \t\t\t \n\t\t}\n\t\tSystem.out.println(m_graph);\n\t}", "private void put(PrimitiveEntry entry) {\n int hashIndex = findHashIndex(entry.getKey());\n entries[hashIndex] = entry;\n }" ]
[ "0.8108342", "0.7805506", "0.7747441", "0.7360481", "0.73558617", "0.7211698", "0.7208669", "0.71827924", "0.7153566", "0.7102607", "0.7079414", "0.706782", "0.7038455", "0.7022937", "0.7022937", "0.69479823", "0.68692017", "0.6857767", "0.6813282", "0.6792995", "0.67905456", "0.6649778", "0.659489", "0.65480655", "0.6546817", "0.6515191", "0.6498159", "0.6494973", "0.6485656", "0.6483887", "0.6471605", "0.6465", "0.6456724", "0.645285", "0.644683", "0.64153063", "0.6410754", "0.64026004", "0.63911885", "0.6369493", "0.63255984", "0.6317805", "0.63051444", "0.6286525", "0.62548447", "0.62388873", "0.62226075", "0.6215216", "0.6208747", "0.6192076", "0.61831325", "0.6175222", "0.61542624", "0.6142713", "0.61394984", "0.6102388", "0.6087596", "0.6048563", "0.60311687", "0.59793454", "0.5975166", "0.5966889", "0.59639424", "0.5961609", "0.59515744", "0.59446555", "0.5917958", "0.59134126", "0.5891344", "0.58778036", "0.5849535", "0.5839645", "0.5832168", "0.58134514", "0.5807269", "0.58019394", "0.5764254", "0.5761801", "0.5758144", "0.5758111", "0.5693439", "0.5676779", "0.5671314", "0.56710887", "0.566778", "0.5658652", "0.5635109", "0.5629961", "0.5625471", "0.56247616", "0.5623426", "0.5621328", "0.5614747", "0.56095713", "0.55977494", "0.5556485", "0.55318654", "0.553081", "0.5529635", "0.5522466", "0.55167586" ]
0.0
-1
/ connect and edge between node1 and node2 , with an edge with weight if the edge already exists , the method simply update the weight of the edge.
public void connect(int node1, int node2, double w) { if(getNodes().containsKey(node1) && getNodes().containsKey(node2) && (node1 != node2)) { Node n1 = (Node)getNodes().get(node1); Node n2 = (Node)getNodes().get(node2); if(!n1.hasNi(node2)&&!n2.hasNi(node1)) { Edge e=new Edge(w,node1,node2); n1.addEdge(e); n2.addEdge(e); mc++;//adding an edge edge_size++; } else // if the edge already exist in the HashMap of the two nodes //we want only update the weight of the edge. { n1.getEdgesOf().get(node2).set_weight(w); n2.getEdgesOf().get(node1).set_weight(w); } } else { return; //System.out.println("src or dst doesnt exist OR src equals to dest"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract boolean addEdge(Node node1, Node node2, int weight);", "void addEdge(int source, int destination, int weight);", "public void addEdge(Node n1, Node n2, int weight) {\n\t\tthis.edges.add(new Edge(n1, n2, weight));\n\t\tadjacencyList.get(n1.getIdNode()).add(new NodePair(n2.getIdNode(), weight));\n\n\n\t\tnrOfEdges++;\n\t}", "public void setEdge(int v1, int v2, int weight) {\n LinkedList<Integer> tmp = adjList.elementAt(v1);\n if(adjList.elementAt(v1).contains(v2) == false) {\n tmp.add(v2);\n adjList.set(v1, tmp);\n totalEdges ++;\n LinkedList<Integer> tmp2 = adjWeight.elementAt(v1);\n tmp2.add(weight);\n adjWeight.set(v1, tmp2);\n }\n }", "public void addEdge(int start, int end, double weight);", "public boolean addEdge(String id1, String id2, Integer weight)\n\t{\n\t\t// if its a new edge, or a new edge weight\n\t\tif (!hasEdge(id1, id2) || (weight != null && edgeWeight(id1, id2) == null))\n\t\t{\n\t\t\tNode n1 = getNode(id1);\n\t\t\tNode n2 = getNode(id2);\n\t\t\tn1.addEdge(n2, weight);\n\t\t\tn2.addEdge(n1, weight);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public void addEdge (E vertex1, E vertex2, int edgeWeight) throws IllegalArgumentException\n {\n if(vertex1 == vertex2)\n return;\n \n int index1 = this.indexOf (vertex1);\n if (index1 < 0)\n throw new IllegalArgumentException (vertex1 + \" was not found!\");\n \n int index2 = this.indexOf (vertex2);\n if (index2 < 0)\n throw new IllegalArgumentException (vertex2 + \" was not found!\");\n\n\n if (this.hasEdge (vertex1, vertex2))\n {\n this.removeNode (index1, index2);\n this.removeNode (index2, index1);\n }\n \n Node node = new Node(index2, edgeWeight);\n this.addNode(node, index1);\n node = new Node(index1, edgeWeight);\n this.addNode(node, index2);\n }", "public void setEdgeWeight(Node p_a, Node p_b, double p_weight) {\n\t\t\n\t\t// We need to use the makeEdge method to make a new edge\n\t\t// So we can ensure we generate an edge with consistent hashCodes\n\t\tEdge edge = makeEdge(p_a, p_b);\n\t\tint id = edge.hashCode();\n\t\tweights.put(id, p_weight);\n\t}", "public void connect(Vertex from, Vertex to, int weight)\n {\n Edge edge = new Edge(from, to , weight);\n\n for(Edge current: connections.get(from))\n {\n if(current.other(from) == to)\n {\n return;\n }\n }\n\n connections.get(from).add(edge);\n connections.get(to).add(edge);\n }", "@Override\n public void connect(T value1, T value2, int weight) {\n Vertex<T> from = vertices.get(value1);\n Vertex<T> to = vertices.get(value2);\n from.addNeighbor(to, weight);\n\n }", "@Override\r\n\tpublic void link(E src, E dst, int weight) {\r\n\t\tinsertVertex(src); //Inserts src if not currently in the graph\r\n\t\tinsertVertex(dst); //Inserts dst if not currently in the graph\r\n\t\tEdge<E> newedge1 = new Edge<>(src, dst, weight);\r\n\r\n\t\tArrayList<Edge<E>> sEdges = adjacencyLists.get(src);\r\n\t\tsEdges.remove(newedge1); //if the edge already exists remove it\r\n\t\tsEdges.add(newedge1);\r\n\t\tif(!isDirected) { //Add the additional edge if this graph is undirected\r\n\t\t\tEdge<E> newedge2 = new Edge<>(dst, src, weight);\r\n\r\n\t\t\tArrayList<Edge<E>> dEdges = adjacencyLists.get(dst);\r\n\t\t\tdEdges.remove(newedge2); //if the edge already exists remove it\r\n\t\t\tdEdges.add(newedge2); \r\n\t\t}\r\n\t}", "@Override\n\tpublic void connect(int src, int dest, double w) {\n\t\tif(w<=0)\n\t\t{\n\t\t\tSystem.err.println(\"The weight must be positive! . connect failed\");\n\t\t\treturn;\n\t\t}\n\t\tEdgeData e = new EdgeData(src, dest, w);\n\t\tif (!Nodes.containsKey(src) || !Nodes.containsKey(dest)) {\n\t\t\tSystem.err.println(\"can't connect\");\n\t\t\treturn;\n\t\t}\n\t\tEdges.get(src).put(dest, e);\n\t\tnumOfEdges++;\n\t\tMC++;\n\t}", "private final void addEdge(int v1, int v2, float weight) {\n if (nEdges >= edgeWeights.length) {\n edgeWeights = Arrays.copyOf(edgeWeights, edgeWeights.length*2);\n }\n int edgeIndex = nEdges;\n\n // add edge to v1\n int v1Index;\n {\n v1Index = nOutgoingEdgess[v1];\n if (v1Index >= outgoingEdgess[v1].length) {\n int newLength = outgoingEdgess[v1].length*2;\n outgoingEdgess[v1] = Arrays.copyOf(outgoingEdgess[v1], newLength);\n outgoingEdgeIndexess[v1] = Arrays.copyOf(outgoingEdgeIndexess[v1], newLength);\n outgoingEdgeIsMarkeds[v1] = Arrays.copyOf(outgoingEdgeIsMarkeds[v1], newLength);\n outgoingEdgeOppositeIndexess[v1] = Arrays.copyOf(outgoingEdgeOppositeIndexess[v1], newLength);\n }\n outgoingEdgess[v1][v1Index] = v2;\n outgoingEdgeIndexess[v1][v1Index] = edgeIndex;\n nOutgoingEdgess[v1]++;\n }\n\n // add edge to v2\n int v2Index;\n {\n v2Index = nOutgoingEdgess[v2];\n if (v2Index >= outgoingEdgess[v2].length) {\n int newLength = outgoingEdgess[v2].length*2;\n outgoingEdgess[v2] = Arrays.copyOf(outgoingEdgess[v2], newLength);\n outgoingEdgeIndexess[v2] = Arrays.copyOf(outgoingEdgeIndexess[v2], newLength);\n outgoingEdgeIsMarkeds[v2] = Arrays.copyOf(outgoingEdgeIsMarkeds[v2], newLength);\n outgoingEdgeOppositeIndexess[v2] = Arrays.copyOf(outgoingEdgeOppositeIndexess[v2], newLength);\n }\n outgoingEdgess[v2][v2Index] = v1;\n outgoingEdgeIndexess[v2][v2Index] = edgeIndex;\n nOutgoingEdgess[v2]++;\n }\n\n outgoingEdgeOppositeIndexess[v1][v1Index] = v2Index;\n outgoingEdgeOppositeIndexess[v2][v2Index] = v1Index;\n \n edgeWeights[nEdges] = weight;\n ++nEdges;\n }", "public void addEdge(int v1, int v2, int weight) {\n\t\tedges[v1][v2] = weight;\n\t\tedges[v2][v1] = weight;\n\t\tsize++;\n\n\t}", "@Override\n public void addEdge(V source, V destination, double weight)\n {\n super.addEdge(source, destination, weight);\n super.addEdge(destination, source, weight);\n }", "@Override\r\n public void connect(int src, int dest, double w) {\r\n if(src != dest && !neighbors.get(src).containsKey(dest)){\r\n \t\r\n edge_data edge = new EdgeData(src,dest,w);\r\n neighbors.get(src).put(dest,edge);\r\n \r\n connected_to.get(dest).add(src);\r\n \r\n edgeCounter++;\r\n }\r\n \r\n /*\r\n * we might need to consider updating weight if and edge\r\n * already exists between src and dest.\r\n */\r\n\r\n }", "public void addEdge(Node source, Node destination, int weight) {\n nodes.add(source);\n nodes.add(destination);\n checkEdgeExistance(source, destination, weight);\n\n if (!directed && source != destination) {\n checkEdgeExistance(destination, source, weight);\n }\n }", "public void addEdge(Node n1, Node n2, int weight, boolean twoWay) {\n\t\tthis.edges.add(new Edge(n1, n2, weight, twoWay));\n\t\tnrOfEdges++;\n\t}", "void addEdge(Vertex v1, Vertex v2, Double w) throws VertexNotInGraphException;", "void addEdge(SimpleVertex vertexOne, SimpleVertex vertexTwo, int weight) {\n\n\t\tSimpleEdge edge = new SimpleEdge(vertexOne, vertexTwo);\n\t\tedge.weight = weight;\n\t\t// edgeList.add(edge);\n\t\t// System.out.println(edge);\n\t\tvertexOne.neighborhood.add(edge);\n\n\t}", "private void checkEdgeExistance(Node a, Node b, int weight) {\n for (Edge edge : a.getEdges()) {\n if (edge.getSource() == a && edge.getDestination() == b) {\n edge.setWeight(weight);\n return;\n }\n }\n a.getEdges().add(new Edge(a, b, weight));\n }", "public void edgeMake(int vertex1, int vertex2) {\n addVertex(vertex1); // both vertices added to the set\n addVertex(vertex2);\n adjacencyMap.get(vertex1).add(vertex2); // both vertices receive the edge\n adjacencyMap.get(vertex2).add(vertex1);\n }", "void addEdge(String origin, String destination, double weight){\n\t\tadjlist.get(origin).addEdge(adjlist.get(destination), weight);\n\t\tedges++;\n\t}", "public boolean addEdge(Vertex one,Vertex two,int weight)\n\t{\n\t\tif (one.equals(two)) { return false; }\n\t\t\n\t\t//check that edge is not in graph\n\t\tEdge e = new Edge(one,two,weight);\n\t\t//future location to increment trips along\n\t\t//the same path\n\t\tif (edges.containsKey(e.hashCode()))\n\t\t{\n\t\t\te.addTrip();//does not work\n\t\t\treturn false;\n\t\t}\n\t\t//check that edge is not incident to either vertex\n\t\telse if (one.containsNeighbor(e) || two.containsNeighbor(e))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tedges.put(e.hashCode(), e);\n\t\tone.addNeighbor(e);\n\t\ttwo.addNeighbor(e);\n\t\treturn true;\n\t}", "public void addTwoWayVertex(String node1, String node2) {\r\n addEdge(node1, node2);\r\n addEdge(node2, node1);\r\n }", "protected void addEdge(CyEdge edge, LayoutNode v1, LayoutNode v2) {\n\tLayoutEdge newEdge = new LayoutEdge(edge, v1, v2);\n\tupdateWeights(newEdge);\n\tedgeList.add(newEdge);\n }", "private Edge addEdge(Node source, Node dest, double weight)\r\n\t{\r\n\t final Edge newEdge = new Edge(edgeType, source, dest, weight);\r\n\t if (!eSet.add(newEdge))\r\n\t\tthrow new RuntimeException(\"Edge already exists!\");\r\n\t source.addEdge(newEdge);\n\t return newEdge;\r\n\t}", "public abstract void connect(N n1, E edge, N n2);", "public Edge(Node source, Node sink, Object weight) {\n\t\tthis(source, sink);\n\t\tsetWeight(weight);\n\t}", "public void addEdge(String node1, String node2) {\n\r\n LinkedHashSet<String> adjacent = map.get(node1);\r\n// checking to see if adjacent node exist or otherwise is null \r\n if (adjacent == null) {\r\n adjacent = new LinkedHashSet<String>();\r\n map.put(node1, adjacent);\r\n }\r\n adjacent.add(node2); // if exist we add the instance node to adjacency list\r\n }", "@Override public int set(L source, L target, int weight) {\r\n \r\n \tif(weight>0) {\r\n \t\tboolean flag=false;\r\n \t\tif(!vertices.contains(source)) {\r\n \t\t\tvertices.add(source);\r\n \t\t\tflag=true;\r\n \t\t}\r\n \tif(!vertices.contains(target)) {\r\n \t\tvertices.add(target);\r\n \t\tflag=true;\r\n \t}\r\n \tEdge<L> e=new Edge<L>(source,target,weight);\r\n \tif(flag==true) {//加点,直接把新边写入,\r\n \t\t\r\n \tedges.add(e);\r\n \tcheckRep();\r\n \treturn 0;\r\n \t}\r\n \telse {//点已经在了,可能边已经在了,考虑重复问题\r\n \t\tint n=edges.size();\r\n \t\tif(n==0) {\r\n \t\t\t\r\n \tedges.add(e);\r\n \tcheckRep();\r\n \treturn 0;\r\n \t\t}\r\n \t\telse {\r\n \t\t\tboolean tag=false;\t\r\n \t\t\tfor(int i=0;i<n;i++) {\r\n \t\t\t\t//这一步太关键了,之前一直判断是false\r\n \t\t\t\tif(edges.get(i).getSource().equals(source) && edges.get(i).getTarget().equals(target)) {\r\n \t\t\t//\tif(edges.get(i).getSource()==source && edges.get(i).getTarget()==target) {\r\n \t\t\t\t\tint res=edges.get(i).getWeight();\r\n \t\t\t\t\tedges.set(i,e);\r\n \t\t\t\t\tcheckRep();\r\n \t\t\t\t\ttag=true;\r\n \t\t\t\t\treturn res;//边已经在了,重新写权重\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t\t//边不在里面,直接写入\r\n \t\t\tif(tag==false) {\r\n \t\t\t\tedges.add(e);\r\n \t\t\t\tcheckRep();\r\n \t\t\t\treturn 0;\r\n \t\t\t}\r\n \t\t}\r\n \t}\r\n \t\r\n \t}\r\n \telse if(weight==0) {\r\n \t\tif(!vertices.contains(source)||!vertices.contains(target)) return 0;\r\n \t\tint n=edges.size();\r\n \t\tfor(int i=0;i<n;i++) {\r\n \t\t\t//改了\r\n\t\t\t\tif(edges.get(i).getSource().equals(source) && edges.get(i).getTarget().equals(target)) {\r\n \t\t\t//if(edges.get(i).getSource()==source && edges.get(i).getTarget()==target) {\t\r\n \t\t\t//把已经在的边移除\r\n\t\t\t\t\tint res=edges.get(i).getWeight();\r\n\t\t\t\t\tedges.remove(i);\r\n\t\t\t\t\tcheckRep();\r\n\t\t\t\t\treturn res;\r\n\t\t\t\t}\r\n\t\t\t}\r\n \t\treturn 0;\r\n \t}\r\n \tcheckRep();\r\n \treturn 0;\r\n \t\r\n }", "public boolean addEdge(T begin, T end, int weight);", "void addDirectedEdge(final Node first, final Node second)\n {\n if ( first == second )\n {\n return;\n }\n else if (first.connectedNodes.contains(second))\n return;\n else\n first.connectedNodes.add(second);\n }", "public Edge(Node from, Node to, int weight) {\n this.from = from;\n this.to = to;\n this.weight = weight;\n }", "@Override\n public void connect(int src, int dest, double w) {\n if (src == dest) return; //do nothing if trying to connect a node to itself\n if (w < 0) return; //do nothing if weight is less than 0\n NodeData sourceNode = (NodeData) this.nodes.get(src);\n NodeData destNode = (NodeData) this.nodes.get(dest);\n numOfEdges += sourceNode.hasNi(destNode.getKey()) ? 0 : 1; // add 1 to numOfEdges if there is no connection yet.\n sourceNode.connectEdge(destNode, w); //connect source node to dest node / update weight if already connected.\n modeCount++;\n }", "public Edge(Object vertex1, Object vertex2, int w){\n v1 = vertex1;\n v2 = vertex2;\n weight = w;\n }", "public double getEdge(int node1, int node2)\n{\n\tif(getNodes().containsKey(node1) && getNodes().containsKey(node2))\n\t{\n\t\tNode s=(Node) getNodes().get(node1);\n\t\tif(s.getEdgesOf().containsKey(node2))\n\t\t{\n \t\t\t\t\n\t\treturn s.getEdgesOf().get(node2).get_weight();\n\t\t\t\t\t\t\n\t\t}\n\t}\n\t \n\t return -1;\n\n}", "public void addEdge(Node from, Node to);", "private void addEdge(int node1, int node2, int cost, int bandwidth) throws IllegalArgumentException {\n // We can't add edges between non-existent nodes\n int nodeCount = mGraph.getNodeCount();\n if (node1 >= nodeCount || node2 >= nodeCount) {\n throw new IllegalArgumentException();\n }\n\n // Add forward edge\n int edgeCount = mGraph.getEdgeCount() / 2;\n\n Edge forward = mGraph.addEdge(String.valueOf(edgeCount + \"f\"), node1, node2, true);\n forward.addAttribute(\"ui.label\", String.valueOf(edgeCount));\n forward.addAttribute(\"edge.cluster\", String.valueOf(edgeCount));\n forward.addAttribute(\"cost\", cost);\n\n // Add backward edge\n Edge backward = mGraph.addEdge(String.valueOf(edgeCount + \"b\"), node2, node1, true);\n backward.addAttribute(\"edge.cluster\", String.valueOf(edgeCount));\n backward.addAttribute(\"cost\", cost);\n\n // Add edge to the SimpleEdge list\n mEdgeList.add(new SimpleEdge(node1, node2, cost, bandwidth));\n }", "boolean addEdge(V v, V w, double weight);", "private final void addTemporaryEdge(int v1, int v2, float weight) {\n // We assume that expansion is never needed.\n /*if (nEdges >= edgeWeights.length) {\n edgeWeights = Arrays.copyOf(edgeWeights, edgeWeights.length*2);\n edgeLevels = Arrays.copyOf(edgeLevels, edgeLevels.length*2);\n isMarkedIndex = Arrays.copyOf(isMarkedIndex, isMarkedIndex.length*2);\n }*/\n int edgeIndex = nEdges;\n\n // add edge to v1\n {\n int index = nOutgoingEdgess[v1];\n if (index >= outgoingEdgess[v1].length) {\n int newLength = outgoingEdgess[v1].length*2;\n outgoingEdgess[v1] = Arrays.copyOf(outgoingEdgess[v1], newLength);\n outgoingEdgeIndexess[v1] = Arrays.copyOf(outgoingEdgeIndexess[v1], newLength);\n outgoingEdgeIsMarkeds[v1] = Arrays.copyOf(outgoingEdgeIsMarkeds[v1], newLength);\n }\n outgoingEdgess[v1][index] = v2;\n outgoingEdgeIndexess[v1][index] = edgeIndex;\n nOutgoingEdgess[v1]++;\n }\n\n edgeWeights[edgeIndex] = weight;\n edgeLevels[edgeIndex] = 0;\n isMarked[edgeIndex] = false;\n ++nEdges;\n }", "public void setDirectedEdge(Vertex start, Vertex end, int weight) \n\t{\n\t\ttry {\n\t\t\tint vI = vertices.indexOf(start);\n\t\t\tint uI = vertices.indexOf(end);\n\t\t\tedges[vI][uI] = weight;\n\t\t} \n\t\tcatch (Exception e) {\n\t\t\treturn;\n\t\t}\n\t\t\n\n\t}", "public void addEdge(Graph graph, int source, int destination, double weight){\r\n\r\n Node node = new Node(destination, weight);\r\n LinkedList<Node> list = null;\r\n\r\n //Add an adjacent Node for source\r\n list = adjacencyList.get((double)source);\r\n if (list == null){\r\n list = new LinkedList<Node>();\r\n }\r\n\r\n list.addFirst(node);\r\n adjacencyList.put((double)source, list);\r\n\r\n //Add adjacent node again since graph is undirected\r\n node = new Node(source, weight);\r\n\r\n list = null;\r\n\r\n list = adjacencyList.get((double)destination);\r\n\r\n if (list == null){\r\n list = new LinkedList<Node>();\r\n }\r\n\r\n list.addFirst(node);\r\n adjacencyList.put((double)destination, list);\r\n }", "public Edge addEdge(Node p_a, Node p_b) {\n\t\tEdge edge = makeEdge(p_a, p_b);\n\t\tif(edges.add(edge)) {\n\t\t\t\n\t\t\t// The weight is only updated if the edge was not in the graph\n\t\t\tweights.put(edge.hashCode(), DEFAULT_WEIGHT);\n\t\t}\n\t\treturn edge;\n\t}", "public boolean addEdge(NodeType nodeA, NodeType nodeB, WeightType weight) {\n\n\t\tif ( nodeA == null || nodeB == null )\n\t\t\treturn false;\n\n\t\tif ( !partitionMap.containsKey( nodeA ) ) { \n\t\t\tSystem.out.println(\"partA doesn't contain nodeA \" + nodeA);\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( !partitionMap.containsKey( nodeB ) ) {\n\t\t\tSystem.out.println(\"partB doesn't contain nodeB \" + nodeB);\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( partitionMap.get(nodeA).equals( partitionMap.get(nodeB) ) ){\n\t\t\tSystem.out.println(\"nodeA equals nodeB\");\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn super.addEdge( nodeA, nodeB, weight );\n\t}", "public void addUndirectedEdge(int v1, int v2, Object edgeInfo) {\n//your code here\n Edge edge1 = new Edge(v1, v2, edgeInfo);\n Edge edge2 = new Edge(v2, v1, edgeInfo);\n if(!adjLists[v1].contains(edge1)){\n adjLists[v1].addLast(edge1);\n }\n if(!adjLists[v2].contains(edge2)){\n adjLists[v2].addLast(edge2);\n }\n }", "public void addEdge( String sourceName, String destName , Double distance)\n {\n Vertex v = getVertex( sourceName );\n Vertex w = getVertex( destName );\n v.adjEdge.put(w.name, new Edge(w,distance) );\n \n // v.weightnext.put(w.name,(Double) distance);\n }", "Edge(Node from,Node to, int length){\n this.source=from;\n this.destination=to;\n this.weight=length;\n }", "public void addEdge(String n1, String n2) {\n if (!this.graph.containsKey(n1)) {\n addNode(n1);\n }\n if (!this.graph.containsKey(n2)) {\n addNode(n2);\n }\n Edgeq edge = new Edgeq(n1, n2);\n this.graph.get(n1).add(edge);\n\n edge = new Edgeq(n2, n1);\n this.graph.get(n2).add(edge);\n }", "public int edgeWeight (E vertex1, E vertex2) throws IllegalArgumentException\n {\n int index1 = this.indexOf (vertex1);\n if (index1 < 0)\n throw new IllegalArgumentException (vertex1 + \" was not found!\");\n int index2 = this.indexOf (vertex2);\n if (index2 < 0)\n throw new IllegalArgumentException (vertex2 + \" was not found!\");\n\n Node node = adjacencySequences[index1];\n int edgeWeight = -1;\n while(node != null)\n {\n if (node.neighbourIndex == index2)\n {\n edgeWeight = node.edgeWeight;\n break;\n }\n else\n node = node.nextNode;\n }\n\n return edgeWeight;\n }", "public Edge(int source, int dest, int weight){\n\t\tthis.source = source;\n\t\tthis.dest = dest;\n\t\tthis.weight = weight;\n\t}", "public void connectEdge(NodeData destNode, double w) {\n EdgeData edge = new EdgeData(this.getKey(), destNode.getKey(), w);\n this.neighborEdges.put(destNode.getKey(), edge);\n destNode.edgesConnectedToThisNode.put(this.getKey(), edge);\n }", "public void addEdge(int v1, int v2) {\r\n addEdge(v1, v2, null);\r\n }", "public void addEdge(int i, int j, int weight) {\r\n adjacencyMatrix[i][j] = weight;\r\n if (!isDirected) {\r\n adjacencyMatrix[j][i] = weight;\r\n }\r\n }", "@Override\r\n\tpublic boolean connect(VertexInterface<T> endVertex, double edgeWeight) {\n\t\treturn false;\r\n\t}", "public void connect(ASNode node) {\n\n\t\t/* Create new paths for this node and other node */\n\t\tArrayList<ASNode> newPath1 = new ArrayList<ASNode>();\n\t\tArrayList<ASNode> newPath2 = new ArrayList<ASNode>();\n\t\tnewPath1.add(node);\n\t\tnewPath2.add(this);\n\t\t/* Adds the Node to each others maps to get ready for exchange */\n\t\tMap<Integer, ArrayList<ASNode>> map1 = addNodeToTable(this, paths);\n\t\tMap<Integer, ArrayList<ASNode>> map2 = addNodeToTable(node,\n\t\t\t\tnode.getPaths());\n\n\t\t/* put new path into this node */\n\t\tpaths.put(node.getASNum(), newPath1);\n\t\tmap1.put(this.ASNum, newPath2);\n\t\t/* put new path into other node */\n\t\tnode.setPathsCombine(map1);\n\t\t/* exchange maps and see if any path if shorter, if shorter than adjust */\n\t\tsetPathsCombine(map2);\n\t\t/* Add each other as neighbors */\n\t\tneighbors.add(node);\n\t\tnode.getNeighbors().add(this);\n\t\t\n\t\t/* Announce each other's paths */\n\t\tnode.announce(this);\n\t\tannounce(node);\n\t\t\n\t\t// Exchange IP tables\n\t\tfor (PrefixPair p : IPTable.keySet()) {\n\t\t\tNextPair n = new NextPair(this, IPTable.get(p).length);\n\t\t\tannounceIP(p, n);\n\t\t}\n\t\tfor (PrefixPair p : node.IPTable.keySet()) {\n\t\t\tNextPair n = new NextPair(node, node.IPTable.get(p).length);\n\t\t\tnode.announceIP(p, n);\n\t\t}\n\t\tfor (PrefixPair p : IPTable.keySet()) {\n\t\t\tNextPair n = new NextPair(this, IPTable.get(p).length);\n\t\t\tannounceIP(p, n);\n\t\t}\n\t}", "public void addEdge(Integer id, UNode n1, UNode n2, String edge)\r\n {\r\n UEdge e = new UEdge(id, n1, n2, edge);\r\n n1.addOutEdge(e);\r\n n2.addInEdge(e);\r\n uEdges.put (id, e);\r\n }", "public Edge(int w, Object a, Object b){\n\t\tweight = w;\n\t\tvertices = new VertexPair(a, b);\n\t\tpartner = null;\n\t\tnext = this;\n\t\tprev = this;\n\t}", "void addEdge(int vertex1, int vertex2){\n adjList[vertex1].add(vertex2);\n adjList[vertex2].add(vertex1);\n }", "public void addEdge(int v1, int v2) {\n addEdge(v1, v2, null);\n }", "public void addEdge(int v1, int v2) {\n addEdge(v1, v2, null);\n }", "@Override\n public boolean addConnection(String firstNodeName, String secondNodeName) throws NodeException {\n\n try {\n if (containsNode(getSingleNode(firstNodeName)) && containsNode(getSingleNode(secondNodeName))) {\n getSingleNode(firstNodeName).newNeighbour(getSingleNode(secondNodeName));\n getSingleNode(secondNodeName).newNeighbour(getSingleNode(firstNodeName));\n return true;\n }\n } catch (NodeException e) {\n throw new NodeException(\"Jeden z Vámi zadaných prvků neexistuje!\");\n }\n\n return false;\n }", "public final void connectIfNotFound(N n1, E edge, N n2) {\n if (!isConnected(n1, edge, n2)) {\n connect(n1, edge, n2);\n }\n }", "private void relax(Connection connection) {\n\t\tint v = graph.getIndexOfStationByName(connection.getFrom().getStationName()), w = graph.\n\t\t\t\tgetIndexOfStationByName(connection.getTo().getStationName());\n\t\tif (distTo[w] > distTo[v] + connection.getWeight()) {\n\t\t\tdistTo[w] = distTo[v] + connection.getWeight();\n\t\t\tedgeTo[w] = v;\n\t\t\tif (pq.contains(w)) {\n\t\t\t\tpq.decreaseKey(w, distTo[w]);\n\t\t\t} else {\n\t\t\t\tpq.insert(w, distTo[w]);\n\t\t\t}\n\t\t}\n\t}", "public void updateWeightEdge(String srcLabel, String tarLabel, int weight) {\n // Implement me!\n\n String e = srcLabel + tarLabel;\n if (indexOf(e, edges) < 0) {\n return;\n }\n\n\n int srcInt = indexOf(srcLabel, vertices);\n int tarInt = indexOf(tarLabel, vertices);\n weights[srcInt][edges.get(e)] = weight;\n weights[tarInt][edges.get(e)] = weight * (-1);\n\n if (weight == 0) {\n edges.remove(e);\n return;\n }\n\n\n\n }", "private void addRelationship(String node1, String node2, String relation)\n {\n try (Session session = driver.session())\n {\n // Wrapping Cypher in an explicit transaction provides atomicity\n // and makes handling errors much easier.\n try (Transaction tx = session.beginTransaction())\n {\n tx.run(\"MATCH (j:Node {value: {x}})\\n\" +\n \"MATCH (k:Node {value: {y}})\\n\" +\n \"MERGE (j)-[r:\" + relation + \"]->(k)\", parameters(\"x\", node1, \"y\", node2));\n tx.success(); // Mark this write as successful.\n }\n }\n }", "public Edge addEdge(EdgeType et, Node source, Node dest, double weight)\r\n {\r\n\tfinal String edgeTypeName = et.getName();\r\n Edge existingEdge = getEdge(edgeTypeName, source, dest);\r\n if (existingEdge == null)\r\n {\r\n existingEdge = ethMap.get(edgeTypeName).addEdge(source, dest, weight);\r\n edges = null;\r\n }\r\n else\r\n existingEdge.addWeight(weight);\n return existingEdge;\r\n }", "public void addEdge(int v1, int v2) {\r\n\t\tadjList[v1].add(v2);\r\n\t}", "protected static <V, E extends WeightedEdge> boolean addEgdeWithWeigth(IWeightedGraph<V, E> graph, V firstVertex,\r\n\t\t\tV secondVertex, E edge, double weight) {\r\n\t\ttry {\r\n\t\t\tgraph.addEdge(firstVertex, secondVertex, edge);\r\n\t\t\tgraph.setEdgeWeight(graph.getEdge(firstVertex, secondVertex), weight);\r\n\r\n\t\t\treturn true;\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public void setEdge(int n1, int n2){\n\t\tif(outOfBounds(n1) || outOfBounds(n2))// if node indexes are bad return\n\t\t\treturn ;\n\t\t\n if((dGraph.getElement(n1, n2)) == 1){\n\t\t\treturn;\n\t}\n\t\tdGraph.setElement(n1, n2, 1); //shows that there is an edge going from n1 to n2\n\t\tdGraphin.setElement(n2, n1, 1);// show the edges going into n2\n\t\toutdegree[n1]++;\n\t\tindegree[n2]++;\n\t\t\n\t}", "public void addEdge(int v1, int v2, Object edgeInfo) {\n//your code here\n Edge edge = new Edge(v1, v2, edgeInfo);\n if(adjLists[v1].contains(edge)){\n return;\n }\n adjLists[v1].addLast(edge);\n }", "private void addConnection(Vertex v, Vertex v1, boolean twoway_road) {\n\t\tif(v == null || v1 == null) return;\r\n\t\tv1.addEdge(new Edge(v1, v));\r\n\t\tif (twoway_road)\r\n\t\t\tv1.addEdge(new Edge(v, v1));\r\n\t}", "public void setWeight(int weightIn){\n\t\tthis.edgeWeight = weightIn;\n\t}", "public void addEdge(DijkstraNode dn1, DijkstraNode dn2, int distance) {\n DijkstraEdge de = new DijkstraEdge(dn1, dn2, distance);\n addToMap(dn1,de);\n addToMap(dn2,de);\n }", "public void addEdge(int v1, int v2) {\n\t\tedges[v1][v2] = 1;\n\t\tedges[v2][v1] = 1;\n\t\tsize++;\n\t}", "public Edge(int start, int end, int weight) {\n this.start = start;\n this.end = end;\n this.weight = weight;\n }", "public void addEdge(int v1, int v2, Object edgeInfo) {\n //your code here\n \tfor (Edge e : myAdjLists[v1]) {\n \t\tif (e.to() == v2) {\n \t\t\te.setObjectInfo(edgeInfo);\n \t\t\treturn;\n \t\t}\n \t}\n \tEdge toAdd = new Edge(v1, v2, edgeInfo);\n \tmyAdjLists[v1].add(toAdd);\t\n }", "public void setEdgeWeight(Edge p_edge, double p_weight) {\n\t\tint id = p_edge.hashCode();\n\t\tweights.put(id, p_weight);\n\t}", "public void addEdge(int indexOne, int indexTwo)\n\t{\n\t\tadjacencyMatrix[indexOne][indexTwo] = true;\n\t\tadjacencyMatrix[indexTwo][indexOne] = true;\n\t}", "public Edge(int weight){\n\t\tthis.EDGE_ID = IDToGive;\n\t\tthis.edgeWeight = weight;\n\t\tIDToGive++;\n\t}", "public void addEdge(K u, K v, int weight)\n {\n if (u.equals(v))\n {\n throw new IllegalArgumentException(\"adding self loop\");\n }\n\n\t// get u's adjacency list\n Map<K, Edge> adj = adjMaps.get(u);\n\n\t// check for edge already being there\n if (!adj.containsKey(v))\n {\n\t\t// edge is not already there -- add to both adjacency lists\n Edge e = new Edge(weight);\n adj.put(v, e);\n adjMaps.get(v).put(u, e);\n }\n }", "public Edge(int from, int to, int weight) {\n this.from = from;\n this.to = to;\n this.weight = weight;\n }", "public void addUndirectedEdge(int v1, int v2) {\r\n addUndirectedEdge(v1, v2, null);\r\n }", "void addEdge(int x, int y);", "public void addEdge(Edge edgeToAdd){\n for(int i = 0; i<edges.size(); i++){\n Edge edge = edges.get(i);\n if(edge.end() == edgeToAdd.end()){\n edge.setWeight(edgeToAdd.weight()); // Change weight and return if edge is present\n return;\n }\n }\n this.edges.add(edgeToAdd); // Add edge normally\n }", "public Edge(int from, int to, Integer weight) {\n this.from = from;\n this.to = to;\n this.weight = weight;\n }", "public Double getEdgeWeight(Node p_a, Node p_b) {\n\t\tEdge edge = makeEdge(p_a, p_b);\n\t\tint id = edge.hashCode();\n\t\treturn weights.get(id);\n\t}", "public void addUndirectedEdge(int vertexOne, int vertexTwo) {\n\t\tGraphNode first = nodeList.get(vertexOne - 1);\n\t\tGraphNode second = nodeList.get(vertexTwo - 1);\n\t\tfirst.getNeighbors().add(second);//Neighbour of first is second. Store it.\n\t\tsecond.getNeighbors().add(first);//Neighbour of second is first. Store it.\n\t\tSystem.out.println(first.getNeighbors());\n\t\tSystem.out.println(second.getNeighbors());\n\t}", "public void addUndirectedEdge(int v1, int v2) {\n addUndirectedEdge(v1, v2, null);\n }", "public void addUndirectedEdge(int v1, int v2) {\n addUndirectedEdge(v1, v2, null);\n }", "public void addUndirectedEdge(int v1, int v2, Object edgeInfo) {\n //your code here\n \taddEdge(v1, v2, edgeInfo);\n \taddEdge(v2, v1, edgeInfo);\n \t\n }", "public Edge(int start, int end, int weight) {\n this.startVertex = start;\n this.endVertex = end;\n this.weight = weight;\n }", "private void processLinkWeights(String[] splitMessage)\n\t{\n\t\tString[] splitLinebySpace = null; // holds the lines split by space.\n\t\tString[] node1Info = null; // holds the lines split by ':' of first node getting IP:portnum\n\t\tString[] node2Info = null; // holds the lines split by ':' of second node getting IP:portnum\n\t\t\n\t\tint currentPortnum = 0; // portnum of this node.\n\t\tint otherNodePortnum = 0; // portnum of node we are connected to.\n\t\tint weight = 0; // holds the weight of the node we are connected to.\n\t\t\n\t\t// start at spot 2 as that where the link weights begin.\n\t\tfor(int i = 2; i < splitMessage.length; i++)\n\t\t{\n\t\t\t// split the line up by space, then by ':'.\n\t\t\tsplitLinebySpace = splitMessage[i].split(\" \"); // [0] = IP:portnum of node1, [1] = IP:portnum of node2, [2] = weight between these nodes.\n\t\t\tnode1Info = splitLinebySpace[0].split(\":\"); // gets IP:portnum of node1\n\t\t\tnode2Info = splitLinebySpace[1].split(\":\"); // gets IP:portnum of node2\n\t\t\t\n\t\t\tcurrentPortnum = Integer.parseInt(node1Info[1]); // gets the portnum and converts it to an int.\n\t\t\tweight = Integer.parseInt(splitLinebySpace[2]); // gets the weight associated with the two vertices.\n\t\t\t\n\t\t\t// check to see if we found the info related to this node.\n\t\t\tif(portNum == currentPortnum) // we found info related to this node.\n\t\t\t{\n\t\t\t\totherNodePortnum = Integer.parseInt(node2Info[1]); // get portnum of another node.\n\t\t\t\t\n\t\t\t\t// search through list of nodes storing the match into the new list of link weights.\n\t\t\t\tSystem.out.println(\"otherNodes size is: \" + otherNodes.size()); // for testing.\n\t\t\t\tfor(int j = 0; j < otherNodes.size(); j++)\n\t\t\t\t{\n\t\t\t\t\tif(otherNodePortnum == otherNodes.get(j).getSecond()) // we have found a match.\n\t\t\t\t\t{\n\t\t\t\t\t\tPair<String, Integer> currentNodeInfo = new Pair<String, Integer>(node1Info[0], portNum); // node1Info[0] == IPaddr.\n\t\t\t\t\t\tPair<String, Integer> connectedNodeInfo = new Pair<String, Integer>(node2Info[0], otherNodePortnum); // node2Info[0] == IPaddr.\n\t\t\t\t\t\tTrio<Pair<String, Integer>, Pair<String, Integer>, Integer> link = new Trio<Pair<String, Integer>, Pair<String, Integer>, Integer>();\n\t\t\t\t\t\t\n\t\t\t\t\t\t// store the information associated with these nodes.\n\t\t\t\t\t\tlink.setFirst(currentNodeInfo); // this node.\n\t\t\t\t\t\tlink.setSecond(connectedNodeInfo); // node we are connected to.\n\t\t\t\t\t\tlink.setThird(weight); // the weight that is between these two nodes.\n\t\t\t\t\t\t\n\t\t\t\t\t\tlinkWeights.add(link); // add this link into the list of link weights.\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Link weights are received and processed. Ready to send messages.\"); // needed by HW documents.\n\t\t\n\t\t// run through link weights and print out the details.\n\t\tSystem.out.println(\"linkWeights size is: \" + linkWeights.size());\n\t\tfor(int i = 0; i < linkWeights.size(); i++)\n\t\t{\n\t\t\tSystem.out.println(linkWeights.get(i).getFirst().getSecond() + \" \" \n\t\t\t\t\t+ linkWeights.get(i).getSecond().getSecond() + \" \" + linkWeights.get(i).getThird());\n\t\t\t\n\t\t\t// the above will print node1Portnum node2Portnum weight for each. This will tell me if it is done correctly or not.\n\t\t}\n\t\t\n\t}", "public void setEdgeWeight(double edgeWeight) {\n this.edgeWeight = edgeWeight;\n }", "public Edge(L source,L target,Integer weight) {\r\n \tsou=source;\r\n \ttar=target;\r\n \twei=weight;\r\n \tcheckRep();\r\n }", "public int getEdgeWeight(T vertex1, T vertex2){\n if (isEdge(vertex1, vertex2)){\n return edges[vertexIndex(vertex1)][vertexIndex(vertex2)];\n }\n return NOT_FOUND;\n }", "public void addEdge(int source, int target, Cost w) {\n\t\tedges[source][target] = w;\n\t}", "@Override\n public void appendEdge(Integer first, Integer second) {\n if (col.containsKey(first) && col.containsKey(second)) {\n col.get(first).add(second);\n col.get(second).add(first); \n }\n }", "public void addEdge(int i, int j, double d) {\r\n\t\tWeightedNode first = nodeList.get(i-1);\r\n\t\tWeightedNode second = nodeList.get(j-1);\r\n\t\tfirst.neighbor.add(second);\r\n\t\tsecond.neighbor.add(first);\r\n\t\tfirst.weightMap.put(second,d);\r\n\t\tsecond.weightMap.put(first, d);\r\n\t}", "double getEdgeWeight();" ]
[ "0.79750603", "0.75583583", "0.73807836", "0.72718966", "0.72290236", "0.71487653", "0.7147279", "0.7100703", "0.7053514", "0.7037182", "0.69610524", "0.6942381", "0.6929586", "0.69280106", "0.6917264", "0.6887745", "0.68817955", "0.6879906", "0.68557", "0.6816659", "0.6811375", "0.68108195", "0.6781752", "0.67438316", "0.66844785", "0.6646555", "0.6644124", "0.66010225", "0.6577367", "0.65736973", "0.65725887", "0.65666604", "0.65495384", "0.6545042", "0.6528033", "0.6525408", "0.6480954", "0.64674705", "0.6443704", "0.64404047", "0.6436489", "0.63657254", "0.63458216", "0.6343154", "0.6343026", "0.63258016", "0.6322676", "0.630319", "0.62824446", "0.6260088", "0.6247014", "0.6232663", "0.622897", "0.62174886", "0.62152356", "0.620934", "0.6209099", "0.62079674", "0.6189094", "0.61829174", "0.61829174", "0.6182807", "0.61821336", "0.6174102", "0.6164833", "0.6155912", "0.61521614", "0.61481965", "0.6147527", "0.6144755", "0.61438996", "0.61388445", "0.6128915", "0.61210454", "0.6083378", "0.60488975", "0.60449296", "0.60425913", "0.60357887", "0.60342956", "0.603207", "0.6028402", "0.6027043", "0.60260373", "0.6025797", "0.60083514", "0.6006439", "0.59999084", "0.5999234", "0.5999234", "0.59958524", "0.59923476", "0.59907174", "0.59836733", "0.5965049", "0.5944028", "0.59301484", "0.59296143", "0.5921779", "0.5918451" ]
0.8142787
0
/ Return all the nodes in the HashMap
public Collection<node_info> getV() { return this.getNodes().values(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Collection<Node> getNodes()\r\n\t{\r\n\t return nodeMap.values();\r\n\t}", "java.util.List<com.zibea.recommendations.webserver.core.dao.proto.AttributesMapProto.Map.KeyValue> \n getNodesList();", "public Collection<Node> getNodeList(){\r\n return nodesMap.values();\r\n }", "@Override\n public List<E> allItems() {\n return new ArrayList(graphNodes.keySet());\n }", "public Iterator nodeIterator() { return nodes.keySet().iterator(); }", "public Map<String, Node> nodes() {\n return this.nodes;\n }", "public HashSet<N> getNodes()\r\n/* 99: */ {\r\n/* 100:182 */ assert (checkRep());\r\n/* 101: */ \r\n/* 102:184 */ return new HashSet(this.map.keySet());\r\n/* 103: */ }", "public HashMap<Integer, Node> getNodeList()\n\t{\n\t\treturn nodeManager.getNodes();\n\t}", "public Set<Node<E>> getNodes(){\n return nodes.keySet();\n }", "Collection<Node> allNodes();", "public Set<String> getAllNodes() {\n return this.graph.keySet();\n }", "public HashMap<K,V> listAll();", "protected abstract Node[] getAllNodes();", "public void list() {\r\n\t\tfor (String key : nodeMap.keySet()) {\r\n\t\t\tNodeRef node = nodeMap.get(key);\r\n\t\t\tSystem.out.println(node.getIp() + \" : \" + node.getPort());\r\n\t\t}\t\t\r\n\t}", "public void printNodes(){\n for(int i =0; i<n;i++)\n System.out.print(key[i]+\" \");\n System.out.println(isLeaf);\n if (!isLeaf){\n for(int i =0; i<=n;i++){\n c[i].printNodes();\n }\n }\n }", "@Override\r\n public Iterable<V> vertices() {\r\n LinkedList<V> list = new LinkedList<>();\r\n for(V v : map.keySet())\r\n list.add(v);\r\n return list;\r\n }", "@Override\n public Collection<? extends INode> getNodes() {\n\n return new LinkedList<>(Collections.unmodifiableCollection(this.nodeMap\n .values()));\n }", "public Map<String, INode> getNodeMap() {\n\n return Collections.unmodifiableMap(nodeMap);\n }", "Iterable<Long> vertices() {\n return nodes.keySet();\n }", "private List<String> putKeysInList() {\n List<String> stringList = new LinkedList<>();\n for (String node : registeredNodes.keySet()) {\n stringList.add(node);\n }\n return stringList;\n }", "public List<NeonKey> getKeys();", "List<Node> getNodes();", "public ResultMap<BaseNode> listChildren();", "public List<INode> getAllNodes();", "List<Node> nodes();", "public HashMap<String,SupplyNode> getMap(){\n return t;\n }", "@Override\n\tpublic HashMap<Position, Node> generate(){\n\t\tNode tempNode;\n\t\tPosition tempPosition;\n\t\tif(map != null && map.isEmpty()){\n\t\t\tfor(int y=0; y<numNodesY; y++){\n\t\t\t\tfor(int x=0; x<numNodesX; x++){\n\t\t\t\t\ttempPosition = new Position(x*nodeDistance, \n\t\t\t\t\t\t\ty*nodeDistance);\n\t\t\t\t\ttempNode = new Node(field, tempPosition,\n\t\t\t\t\t\t\tnodeSignalStrength,\n\t\t\t\t\t\t\tagentLife,\n\t\t\t\t\t\t\trequestLife);\n\t\t\t\t\tmap.put(tempPosition, tempNode);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn new HashMap<Position, Node>(map);\n\t}", "List<CommunicationLink> getAllNodes()\n {\n return new ArrayList<>(allNodes.values());\n }", "@Override public IndexKey[] getNodeKeys() {\n return listOfKeys.toArray(new IndexKey[listOfKeys.size()]);\n }", "public List<Node> getNodes();", "public static HashSet<KDNode> RootSet() {\n\t\treturn root_map;\n\t}", "@Override\n public Iterable<E> getAllVertices() {\n return dictionary.keySet();\n }", "@Override\n\tpublic Collection<node_data> getV() {\n\t\treturn Nodes.values();\n\t}", "@Override\n public Collection<node_data> getV() {\n return this.nodes.values();\n }", "Set<Node<K, V>> entrySet();", "@Override\n\tpublic Collection<Eleve> findAll() {\n\t\treturn map.values();\n\t}", "public List<TbNode> getAll() {\n return qureyNodeList(new NodeParam());\n }", "public abstract String[] map() throws TooFewNocNodesException;", "public HashMap<Integer, DagNode> getDagNodes(){\n return nodes;\n }", "public Map<Node, MyNode> extractNodes(int numNodes){\r\n\t\t//If numNodes is less than one or there aren't enough nodes, return null\r\n\t\tif (numNodes < 1 || nodesMap.size() < numNodes){\r\n\t\t\treturn null;\r\n\t\t} \r\n\r\n\t\t//Initialize the result set\r\n\t\tMap<Node, MyNode> result = new HashMap<Node, MyNode>();\r\n\r\n\t\t//Special case: If there are no relationships, then return all nodes.\r\n\t\tif(rels.size() == 0){\r\n\t\t\tfor (Node node : nodesMap.keySet()){\r\n\t\t\t\tresult.put(node, nodesMap.get(node));\r\n\t\t\t}\r\n\r\n\t\t\treturn result;\r\n\t\t}\r\n\r\n\t\t//tempRels (used for crawling through the gp)\r\n\t\tList<Relationship> tempRels = new ArrayList<Relationship>();\r\n\t\ttempRels.addAll(relsMap.keySet());\r\n\r\n\t\t//Shuffle the tempRels list for random order.\r\n\t\tCollections.shuffle(tempRels, random);\r\n\r\n\t\tboolean first = true;\t//flag for first run\r\n\r\n\t\twhile (result.size() < numNodes) {\t//Loop until we have reached the required result size.\r\n\t\t\ttry (Transaction tx = graphDb.beginTx()){\t\t\t\t\r\n\t\t\t\tif (first){\t\t\t//On the first run\r\n\t\t\t\t\tfirst = false;\t//Update flag\r\n\r\n\t\t\t\t\t//Pick a random relationship and extract its nodes\r\n\t\t\t\t\tRelationship rel = tempRels.get(random.nextInt(tempRels.size()));\r\n\t\t\t\t\ttempRels.remove(rel);\r\n\t\t\t\t\tNode src = rel.getStartNode();\r\n\t\t\t\t\tNode tgt = rel.getEndNode();\r\n\r\n\r\n\t\t\t\t\tif (numNodes > 1){\r\n\t\t\t\t\t\t//If numNodes > 1, then add both nodes to result\r\n\t\t\t\t\t\tresult.put(src, nodesMap.get(src));\r\n\t\t\t\t\t\tresult.put(tgt, nodesMap.get(tgt));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t//If numNodes == 1, then randomly pick one of the nodes to add to result\r\n\t\t\t\t\t\tif (random.nextBoolean()){\r\n\t\t\t\t\t\t\tresult.put(src, nodesMap.get(src));\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tresult.put(tgt, nodesMap.get(tgt));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\t//On subsequent runs\r\n\r\n\t\t\t\t\tboolean done = false;\t//Flag to specify we're done with this iteration\r\n\t\t\t\t\tint idx = 0;\t\t\t//Loop index counter\r\n\t\t\t\t\twhile (!done){\r\n\t\t\t\t\t\t//Pick the next relationship in tempRels\r\n\t\t\t\t\t\tRelationship rel = tempRels.get(idx);\r\n\t\t\t\t\t\tidx++;\r\n\t\t\t\t\t\tNode other = null;\r\n\r\n\t\t\t\t\t\tif (result.keySet().contains(rel.getStartNode()) && (!result.keySet().contains(rel.getEndNode()))){\r\n\t\t\t\t\t\t\t//If the startNode of the relationship is already in results, but not the end node\r\n\t\t\t\t\t\t\t//then set other to be the end node\r\n\t\t\t\t\t\t\tother = rel.getEndNode();\r\n\t\t\t\t\t\t\tdone = true;\r\n\t\t\t\t\t\t} else if ((!result.keySet().contains(rel.getStartNode())) && result.keySet().contains(rel.getEndNode())){\r\n\t\t\t\t\t\t\t//If the startNode of the relationship is not in results, but the end node is\r\n\t\t\t\t\t\t\t//then set other to be the start node\r\n\t\t\t\t\t\t\tother = rel.getStartNode();\r\n\t\t\t\t\t\t\tdone = true;\r\n\t\t\t\t\t\t} else if (result.keySet().contains(rel.getStartNode()) && result.keySet().contains(rel.getEndNode())){\r\n\t\t\t\t\t\t\t//If both of the nodes of the relationship are in result, remove it from the list\r\n\t\t\t\t\t\t\ttempRels.remove(rel);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t//If we found a matching relationship\r\n\t\t\t\t\t\tif (done){\r\n\t\t\t\t\t\t\t//Add other to the result, and its corresponding mapping\r\n\t\t\t\t\t\t\tresult.put(other, nodesMap.get(other));\r\n\t\t\t\t\t\t\t//Remove rel from the list\r\n\t\t\t\t\t\t\ttempRels.remove(rel);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t\ttx.success();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "List<GraphEdge> getNeighbors(NodeKey key);", "public Map<OntologyNode, List<OntologyNode>> getHierarchyMap(List<OntologyNode> selectedOntologyNodes) {\n HashMap<OntologyNode, List<OntologyNode>> hierarchyMap = new HashMap<OntologyNode, List<OntologyNode>>();\n for (OntologyNode node : selectedOntologyNodes) {\n hierarchyMap.put(node, getAllChildren(node));\n }\n return hierarchyMap;\n }", "private Map<String, Node> getNodeXmlIdTable() {\n\n if (this.nodeXmlIdTable == null) {\n this.nodeXmlIdTable = new HashMap<String, Node>();\n }\n return this.nodeXmlIdTable;\n }", "@Override\n public Iterator<Node<E>> iterator() {\n return new ArrayList<Node<E>>(graphNodes.values()).iterator();\n }", "public void iterate(){//iterate over all the keys\n\t\tSystem.out.println(\"Keys are :\");\n\t\tSystem.out.println(\"-----------------------\");\n\t\titerate(this.root);\n\t\tSystem.out.println(\"-----------------------\");\n\t}", "public HashSet<Node> getNodes(){\n\t\t\n\t\t//Return nodes hashset\n\t\treturn this.nodes;\n\t\t\n\t}", "public List<Long> getAlleKontonummern() {\n return new LinkedList<>(kontoMap.keySet());\n }", "@Override\n\tpublic Iterator<T> iterator() {\n\t\treturn graph.keySet().iterator();\n\t}", "public Collection<GraphNode> getGraphNodes() {\n\t\treturn graphNodeMap.values();\n\t}", "@Override\r\n public Collection<node_data> getV() {\r\n return this.graph.values();\r\n }", "public List<Node> getAllNodes() {\n return nodeRepository.findAll();\n }", "@Override\n\tpublic Collection<Key> keys() {\n\t\tCollection<Key> c = new ArrayList<Key>();\n\t\tif (!isEmpty()) {\n\t\t\tFork<Key, Value> f = (Fork<Key,Value>) bst;\n\t\t\tEntry<Key, Value> e = new Entry<>(f.getKey().get(), f.getValue().get());\n\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\tEntry<Key, Value>[] a = (Entry<Key, Value>[]) Array.newInstance(e.getClass(), size());\n\t\t\tbst.saveInOrder(a);\n\t\t\tfor (int i = 0; i < a.length; i++) {\n\t\t\t\tc.add(a[i].getKey());\n\t\t\t}\n\t\t}\n\t\treturn c;\n\t}", "protected abstract Set<T> findNeighbors(T node, Map<T, T> parentMap);", "private ArrayList<Integer> getCityEdges(HashMap<Integer,Integer> table){\n ArrayList<Integer> edges = new ArrayList<Integer>();\n edges.addAll(table.keySet());\n return edges;\n }", "public Iterable<HashNode> iterator() {\n\t\treturn bucket;\n\t\t//for(HashTable<Character, Integer>.HashNode x : HT.iterator()) {\n\t}", "public Stack<Entry> readNodeEntries() {\n FileLocation thisNode = null;\n Stack<Entry> nodeEntries = new Stack<Entry>();\n try {\n int port = FileApp.getMyPort();\n thisNode = new FileLocation(port);\n } catch (UnknownHostException ex) {\n System.err.println(\"Mapper.read node entries uknown host exception\");\n }\n Stack<Integer> nodeHashes = FileApp.getHashes();\n while (!nodeHashes.empty()) {\n nodeEntries.push(new Entry(nodeHashes.pop(), thisNode));\n }//while (!nodeHashes.empty()\n printAct(\">scanned my node's files\");\n return nodeEntries;\n }", "List<String> getNodeNames()\n {\n return allNodes.values().stream().map(CommunicationLink::getName).collect(Collectors.toList());\n }", "private int numNodes()\r\n\t{\r\n\t return nodeMap.size();\r\n\t}", "public HashMap<String, NeonValue> getMap();", "@Override\r\n public Collection<edge_data> getE(int node_id) {\r\n return this.neighbors.get(node_id).values(); //o(k)\r\n }", "public List<Node> getAll() throws SQLException {\n var nodes = new ArrayList<Node>();\n var statement = connection.createStatement();\n var result = statement.executeQuery(\"SELECT identifier, x, y, parentx, parenty, status, owner, description FROM nodes\");\n while (result.next()) {\n nodes.add(\n new Node(\n result.getInt(\"identifier\"),\n result.getInt(\"x\"),\n result.getInt(\"y\"),\n result.getInt(\"parentx\"),\n result.getInt(\"parenty\"),\n result.getString(\"status\"),\n result.getString(\"owner\"),\n result.getString(\"description\")\n )\n );\n }\n result.close();\n statement.close();\n return nodes;\n }", "public Iterable<Key> keys() {\n Queue<Key> queue = new Queue<Key>();\n for (Node temp = first; temp != null; temp = temp.next)\n queue.enqueue(temp.key);\n return queue;\n }", "public Node[] getNodes()\r\n {\r\n if(nodes == null)\r\n\t{\r\n\t nodes = new Node[numNodes()];\r\n\t int i = 0;\r\n\t for (final NodeTypeHolder nt : ntMap.values())\r\n\t\tfor (final Node node : nt.getNodes())\r\n\t\t nodes[i++] = node;\r\n\t}\r\n return nodes.clone();\r\n }", "public void iterate() {\n\t\t// iterator\n\t\tQueue<NDLMapEntryNode<T>> nodes = new LinkedList<NDLMapEntryNode<T>>();\n\t\tnodes.add(rootNode);\n\t\twhile(!nodes.isEmpty()) {\n\t\t\t// iterate BFSwise\n\t\t\tNDLMapEntryNode<T> node = nodes.poll();\n\t\t\tif(node.end) {\n\t\t\t\t// end of entry, call processor\n\t\t\t\tif(keyProcessor != null) {\n\t\t\t\t\tkeyProcessor.process(node.data);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(node.keys != null) {\n\t\t\t\t// if available\n\t\t\t\tnodes.addAll(node.keys.values()); // next nodes to traverse\n\t\t\t}\n\t\t}\n\t}", "private TreeMap<Integer, List<NodeInfo>> convertToTreeMap(HashMap<ASTNode, NodeInfo> hashMap) {\n TreeMap<Integer, List<NodeInfo>> map = new TreeMap<>(Collections.reverseOrder());\n for (Map.Entry<ASTNode, NodeInfo> e : hashMap.entrySet()) {\n NodeInfo nodeInfo = e.getValue();\n if (map.containsKey(nodeInfo.subNodes)) {\n List<NodeInfo> list = map.get(nodeInfo.subNodes);\n list.add(nodeInfo);\n\n } else {\n\n // pick only no leaf nodes\n if (nodeInfo.subNodes > 0) {\n List<NodeInfo> list = new ArrayList<>();\n list.add(nodeInfo);\n map.put(nodeInfo.subNodes, list);\n }\n }\n\n }\n return map;\n }", "public ReadOnlyIterator<ContextNode> getAllLeafContextNodes();", "@Override\n public ArrayList<Node> getAllNodes() {\n return getAllNodesRecursive(root);\n\n }", "@Override\n public abstract Collection<? extends GraphNode<N, E>> getNodes();", "public Collection<Vertex> vertices() { \n //return myGraph.keySet(); OLD\n //create a copy of all the vertices in the map to restrict any reference\n //to the interals of this class\n Collection<Vertex> copyOfVertices = new ArrayList<Vertex>();\n copyOfVertices.addAll(myGraph.keySet());\n return copyOfVertices;\n }", "@Override\r\n\tpublic Iterable<Entity> getNodes()\r\n\t{\n\t\treturn null;\r\n\t}", "public List<NodeInfo> getStoredNodes() {\n List<NodeInfo> nodes = new ArrayList<>();\n\n SearchResponse response = client.prepareSearch(\"k8s_*\").setTypes(\"node\").setSize(10000).get();\n\n SearchHit[] hits = response.getHits().getHits();\n log.info(String.format(\"The length of node search hits is [%d]\", hits.length));\n\n ObjectMapper mapper = new ObjectMapper();\n try {\n for (SearchHit hit : hits) {\n// log.info(hit.getSourceAsString());\n NodeInfo node = mapper.readValue(hit.getSourceAsString(), NodeInfo.class);\n nodes.add(node);\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n return nodes;\n }", "public Set<Object> getKeysByServerName(String name) {\n Server server = serverMap.get(name);\n if(server == null) {\n return null;\n }\n Set<Object> keys = new HashSet<Object>();\n Set<Integer> nodes = server.getNodes();\n for(Integer nodeHash : nodes) {\n keys.addAll(nodesMap.get(nodeHash).getEntrySet());\n }\n return keys;\n }", "public static KDNode[] RootBuff() {\n\n\t\t int offset = 0;\n\t\t KDNode[] buff = new KDNode[root_map.size()];\n\t\t for(KDNode k : root_map) {\n\t\t\t buff[offset++] = k;\n\t\t }\n\t\t \n\t\t return buff;\n\t}", "public HashMap<Integer, List<Integer>> getChildren() {\n\t\treturn children;\n\t}", "public ClosableIterator<org.ontoware.rdf2go.model.node.Node> getAllInitialKey_asNode() {\r\n\t\treturn Base.getAll_asNode(this.model, this.getResource(), INITIALKEY);\r\n\t}", "java.util.List<io.netifi.proteus.admin.om.Node> \n getNodesList();", "public HashMap<Integer, edge_data> getEdgesConnectedToThisNode() {\n return this.edgesConnectedToThisNode;\n }", "java.util.List<entities.Torrent.NodeId>\n getNodesList();", "@Override\n\tpublic List<Edge> getAllMapEdges() {\n\n\t\tList<Edge> res = new ArrayList<Edge>();\n\t\tResultSet resultSet = null;\n\n\t\ttry {\n\t\t\tString getAllEdges = \"SELECT node_from, node_to, distance FROM routefinder.maprelations\";\n\t\t\tresultSet = null;\n\t\t\tpstmt = conn.prepareStatement(getAllEdges);\n\t\t\tresultSet = pstmt.executeQuery();\n\t\t\twhile (resultSet.next()) {\n\t\t\t\tEdge edge = new Edge();\n\t\t\t\tedge.setNode1(Database.getNodeFromId(resultSet.getInt(\"node_from\")));\n\t\t\t\tedge.setNode2(Database.getNodeFromId(resultSet.getInt(\"node_to\")));\n\t\t\t\tedge.setDist(resultSet.getDouble(\"distance\"));\n\t\t\t\tres.add(edge);\n\t\t\t}\n\t\t\treturn res;\n\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\tJdbcConnect.resultClose(resultSet, pstmt);\n\t\t}\n\n\t\treturn null;\n\t}", "public Iterable<K> levelOrder() {\n Queue<K> keys = new Queue<>();\n Queue<Node> queue = new Queue<>();\n queue.enqueue(root);\n while (!queue.isEmpty()) {\n Node x = queue.dequeue();\n if (x == null) continue;\n keys.enqueue(x.key);\n queue.enqueue(x.left);\n queue.enqueue(x.right);\n }\n return keys;\n }", "public ArrayList<Integer> getAllKeysOrdered() {\n ArrayList<Integer> keyArrl = new ArrayList<>();\n if(root == null){\n return null;\n }\n Node currNode = root;\n keyArrl.add(currNode.key);\n java.util.LinkedList<Node> queue = new java.util.LinkedList<Node>();\n\n\n // Explores Nodes until the queue is empty.\n while (true) {\n\n // Marks that this Node's children should be explored.\n for (int i = 0; i < getNumChildren(); ++i) {\n if (currNode.children[i] != null) {\n queue.addLast(currNode.children[i]);\n }\n }\n\n // Pops the next Node from the queue.\n if (!queue.isEmpty()) {\n currNode = queue.pop();\n keyArrl.add(currNode.key);\n }\n // If the queue is empty, breaks.\n else break;\n\n }\n\n return keyArrl;\n\n }", "public ArrayList<NodeRef> getDataNodes() {\r\n\t\tArrayList<NodeRef> slaves = new ArrayList<NodeRef>();\r\n\t\tfor (NodeRef node : nodeMap.values()) {\r\n\t\t\tslaves.add(node);\r\n\t\t}\r\n\t\treturn slaves;\r\n\t}", "public Set<String> keysOfMap() {\n Map<String, String> tempMap = createSimpleMap(\"Elevensies\",\"Grapes\");\n\t\tSet<String> keys = hashMap.keySet();\n\t\treturn tempMap.keySet();\n\t}", "public Iterable<Integer> levelOrder() {\n\t\tLinkedList<Integer> keys = new LinkedList<Integer>();\n\t\tLinkedList<Node> queue = new LinkedList<Node>();\n\t\tqueue.add(root);\n\t\twhile (!queue.isEmpty()) {\n\t\t\tNode n = queue.remove();\n\t\t\tif (n == null) continue;\n\t\t\tkeys.add(n.key);\n\t\t\tqueue.add(n.left);\n\t\t\tqueue.add(n.right);\n\t\t}\n\t\treturn keys;\n\t}", "public Iterable<Key> Keys()\n\t{\n\t\tQueue<Key> q=new Queue<>();\n\t\tInorder(root,q);\n\t\treturn q;\n\t}", "public ArrayList<KeyVal> readDHTAll(){\n\t\tArrayList<DHTNode> nodeList = dynamoRing.getAllNodes();\n\t\tHashMap<String, KeyVal> resultMap = new HashMap<String, KeyVal>();\n\t\tArrayList<KeyVal> resultList = new ArrayList<KeyVal>();\n\t\tfor(int i=0;i<nodeList.size();i++){\n\t\t\tArrayList<KeyVal> keyValList = readDHTAllFromNode(nodeList.get(i));\n\t\t\tfor(int j=0;j<keyValList.size();j++){\n\t\t\t\tKeyVal keyVal = keyValList.get(j);\n\t\t\t\tif(resultMap.get(keyVal.getKey())==null){\n\t\t\t\t\tresultMap.put(keyVal.getKey(), keyVal);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tint oldVersion = Integer.parseInt(resultMap.get(keyVal.getKey()).getVersion());\n\t\t\t\t\tint newVersion = Integer.parseInt(keyVal.getVersion());\n\t\t\t\t\tif(newVersion > oldVersion)\n\t\t\t\t\t\tresultMap.put(keyVal.getKey(), keyVal);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tIterator<Entry<String, KeyVal>> resultIterator = resultMap.entrySet().iterator();\n\t\twhile(resultIterator.hasNext()){\n\t\t\tEntry<String, KeyVal> nextEntry = resultIterator.next();\n\t\t\tresultList.add(nextEntry.getValue());\n\t\t}\n\t\treturn resultList;\n\t}", "@Override\r\n\tpublic List<String> getRootKeys() {\n\t\tCacheTreeNode node = (CacheTreeNode)this.getCacheData(SUPER_ROOT_KEY);\r\n\t\tif(node != null){\r\n\t\t\tCollection<CacheTreeNode> rootList = node.getChildren();\r\n\t\t\tList<String> result = new ArrayList<String>(rootList.size());\r\n\t\t\tif(rootList != null){\r\n\t\t\t\tfor(Iterator<CacheTreeNode> i = rootList.iterator(); i.hasNext();)\r\n\t\t\t\t\tresult.add(i.next().getKey());\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public void printGraph()\n {\n Iterator<T> nodeIterator = nodeList.keySet().iterator();\n \n while (nodeIterator.hasNext())\n {\n GraphNode curr = nodeList.get(nodeIterator.next());\n \n while (curr != null)\n {\n System.out.print(curr.nodeId+\"(\"+curr.parentDist+\")\"+\"->\");\n curr = curr.next;\n }\n System.out.print(\"Null\");\n System.out.println();\n }\n }", "public void print(){\n if (isLeaf){\n for(int i =0; i<n;i++)\n System.out.print(key[i]+\" \");\n System.out.println();\n }\n else{\n for(int i =0; i<n;i++){\n c[i].print();\n System.out.print(key[i]+\" \");\n }\n c[n].print();\n }\n }", "Iterable<Long> vertices() {\n //YOUR CODE HERE, this currently returns only an empty list.\n ArrayList<Long> verticesIter = new ArrayList<>();\n verticesIter.addAll(adj.keySet());\n return verticesIter;\n }", "public Collection<node_info> getV(int node_id)\n{\n\tCollection<node_info> list=new ArrayList<node_info>();\n\t\n\t if(getNodes().containsKey(node_id)) \n\t {\n\t Node m=(Node)this.getNodes().get(node_id);\n\t if(!m.getEdgesOf().isEmpty() )\n\t {\n\t for(int key: m.getEdgesOf().keySet())\n\t {\n\t\tnode_info z=getNode( key) ;\n\t list.add(z);\n\t \n\t }\n\t \n\t }\n\t \n\t }\n\t \n\t return list;\t\n}", "public Collection<MyNode> getNeighbors(){\r\n return new ArrayList<>(this.neighbors);\r\n }", "public ArrayList<KeyVal> readAllLocal(){\n\t\tDHTNode myNode = dynamoRing.getNode(MY_ADDRESS);\n\t\treturn readDHTAllFromNode(myNode);\n\t}", "public ArrayList<KeyVal> readDHTAllFromNode(DHTNode node){\n\t\tArrayList<KeyVal> keyValList = new ArrayList<KeyVal>();\n\t\ttry{\n\t\t\tSocket socket = new Socket(InetAddress.getByAddress(new byte[]{10, 0, 2, 2}),\n\t\t\t\t\tnode.getAddress());\n\t\t\tLog.v(TAG, \"Connected with \"+node.getAddress());\n\t\t\tBufferedWriter bw = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));\n\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n\t\t\tMessage msg = new Message();\n\t\t\tmsg.setType(Message.READ);\n\t\t\tmsg.setKey(\"@\");\n\t\t\tString msgStr = msg.toJson();\n\t\t\tbw.write(msgStr+\"\\n\");\n\t\t\tbw.flush();\n\t\t\tString responseStr = br.readLine();\n\t\t\tbw.close();\n\t\t\tbr.close();\n\t\t\tsocket.close();\n\t\t\tMessage response = Message.fromJson(responseStr);\n\t\t\tif(response != null)\n\t\t\t\tkeyValList = response.getKeyValList();\n\t\t\treturn keyValList;\n\t\t\t\n\t\t}\n\t\tcatch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn keyValList;\n\t}", "@Override\n\tpublic List<AbstractNode> getChildren()\n\t{\n\t\treturn new ArrayList<>(pairs.values());\n\t}", "public Lo<K> keys() { return this.entries.map(kvp -> kvp.left); }", "public Set<Node<E>> getNeighbors(Node<E> node){\n Set<Node<E>> result = new HashSet<>();\n result = nodes.get(node);\n return result;\n }", "Iterable<Long> vertices() {\n //YOUR CODE HERE, this currently returns only an empty list.\n return world.keySet();\n }", "public final Node[] headKeys(final int n) {\r\n final Node[] result = new Node[n];\r\n final Stack s = new Stack();\r\n s.push(root.c.get(0));\r\n int numKeys = 0, k = 0;\r\n while (s.size > 0 && numKeys < n) {\r\n final Node<E,V> u = s.pop();\r\n if (u == null) continue;\r\n if (u.c == null) { // u is a leaf\r\n if (u.kcount > 0) { // ignore empty leaves\r\n result[k++] = u;\r\n numKeys += u.kcount;\r\n }\r\n } else { // u is internal\r\n for (int j=0;j<u.c.length();j++) {\r\n s.push(u.c.get(j));\r\n }\r\n }\r\n }\r\n return result;\r\n }", "public List<OSMNode> nodes() {\n return nodes;\n }" ]
[ "0.75570107", "0.73049015", "0.7259343", "0.7149731", "0.7072454", "0.6933952", "0.6922198", "0.6867248", "0.6845555", "0.6836423", "0.68361783", "0.6782311", "0.6639373", "0.66036904", "0.64842516", "0.64825577", "0.6480279", "0.64356107", "0.6434999", "0.64302444", "0.64154994", "0.6413941", "0.6384366", "0.63626117", "0.6332705", "0.6329825", "0.6323431", "0.6319733", "0.6314764", "0.62788486", "0.62588334", "0.62493086", "0.62451714", "0.6243043", "0.6231844", "0.62197053", "0.6197332", "0.61968136", "0.61882704", "0.6182225", "0.6175722", "0.61734194", "0.6168947", "0.61582404", "0.61579496", "0.61507124", "0.6132706", "0.6115421", "0.61137134", "0.6088681", "0.6070032", "0.6051862", "0.6051469", "0.60510373", "0.6042189", "0.6024899", "0.60096806", "0.60085607", "0.5998888", "0.5990687", "0.5982372", "0.5974693", "0.59507394", "0.595068", "0.59479463", "0.59439707", "0.5935832", "0.5925613", "0.59119844", "0.58993703", "0.5893307", "0.5882159", "0.5880833", "0.58792174", "0.58702505", "0.5868762", "0.5866775", "0.586621", "0.5854858", "0.5833682", "0.582948", "0.5809032", "0.58067", "0.58035964", "0.5800793", "0.5779046", "0.5778103", "0.5774033", "0.57710826", "0.57619673", "0.57596534", "0.57468593", "0.57459134", "0.5741409", "0.5730488", "0.57245755", "0.57238185", "0.57209045", "0.5702823", "0.5697646" ]
0.619692
37
/ Return all the node_info that come out from this vertex (using the HashMap of this vertex).
public Collection<node_info> getV(int node_id) { Collection<node_info> list=new ArrayList<node_info>(); if(getNodes().containsKey(node_id)) { Node m=(Node)this.getNodes().get(node_id); if(!m.getEdgesOf().isEmpty() ) { for(int key: m.getEdgesOf().keySet()) { node_info z=getNode( key) ; list.add(z); } } } return list; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.util.List<com.zibea.recommendations.webserver.core.dao.proto.AttributesMapProto.Map.KeyValue> \n getNodesList();", "public void getInfo() {\n System.out.println(\"INFO Node : \"+address+ \" connected to nodes \");\n for(Node node : getConnectedNodes()){\n System.out.print(\"Node :\"+node.getAddress()+\" with edge : \");\n getEdge(this, node).printEdge();\n }\n \n }", "@Override\r\n public Collection<node_data> getV() {\r\n return this.graph.values();\r\n }", "public Collection<node_info> getV()\n{\n\treturn this.getNodes().values();\n}", "Iterable<Long> vertices() {\n return nodes.keySet();\n }", "@Override\n public Collection<node_data> getV() {\n return this.nodes.values();\n }", "@Override\r\n public Collection<edge_data> getE(int node_id) {\r\n return this.neighbors.get(node_id).values(); //o(k)\r\n }", "public Map<String, Node> nodes() {\n return this.nodes;\n }", "private Collection<Node> getNodes()\r\n\t{\r\n\t return nodeMap.values();\r\n\t}", "@Override\r\n public Iterable<V> vertices() {\r\n LinkedList<V> list = new LinkedList<>();\r\n for(V v : map.keySet())\r\n list.add(v);\r\n return list;\r\n }", "@Override\n public List<E> allItems() {\n return new ArrayList(graphNodes.keySet());\n }", "public void list() {\r\n\t\tfor (String key : nodeMap.keySet()) {\r\n\t\t\tNodeRef node = nodeMap.get(key);\r\n\t\t\tSystem.out.println(node.getIp() + \" : \" + node.getPort());\r\n\t\t}\t\t\r\n\t}", "public @NonNull Map<@NonNull String, @NonNull Object> getNodeMeta() {\n return this.nodeMeta;\n }", "public HashMap<Integer, edge_data> getNi() {\n return neighborEdges;\n }", "@Override\n public Iterable<E> getAllVertices() {\n return dictionary.keySet();\n }", "public HashMap<Integer, edge_data> getEdgesConnectedToThisNode() {\n return this.edgesConnectedToThisNode;\n }", "Map<String,String> getNodeData(T node);", "@Override\n\tpublic Collection<node_data> getV() {\n\t\treturn Nodes.values();\n\t}", "public List<byte[]> getAllNodeInfo() {\n // Fetch a node list with protobuf bytes format from GCS.\n synchronized (GlobalStateAccessor.class) {\n validateGlobalStateAccessorPointer();\n return this.nativeGetAllNodeInfo(globalStateAccessorNativePointer);\n }\n }", "public Set<String> getAllNodes() {\n return this.graph.keySet();\n }", "public HashMap<Integer, ArrayList<String>> getInfo() {\n\t\treturn infoList;\n\t}", "public HashMap<Integer, Vertex> getVertices() {\n\t\treturn vertices;\n\t}", "public NodeInfo getNodeInfo() throws RemoteException, Error;", "public Map<String, INode> getNodeMap() {\n\n return Collections.unmodifiableMap(nodeMap);\n }", "public HashMap<Integer, Node> getNodeList()\n\t{\n\t\treturn nodeManager.getNodes();\n\t}", "@Override\n\tpublic HashMap<Position, Node> generate(){\n\t\tNode tempNode;\n\t\tPosition tempPosition;\n\t\tif(map != null && map.isEmpty()){\n\t\t\tfor(int y=0; y<numNodesY; y++){\n\t\t\t\tfor(int x=0; x<numNodesX; x++){\n\t\t\t\t\ttempPosition = new Position(x*nodeDistance, \n\t\t\t\t\t\t\ty*nodeDistance);\n\t\t\t\t\ttempNode = new Node(field, tempPosition,\n\t\t\t\t\t\t\tnodeSignalStrength,\n\t\t\t\t\t\t\tagentLife,\n\t\t\t\t\t\t\trequestLife);\n\t\t\t\t\tmap.put(tempPosition, tempNode);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn new HashMap<Position, Node>(map);\n\t}", "public List<NodeInfo> getStoredNodes() {\n List<NodeInfo> nodes = new ArrayList<>();\n\n SearchResponse response = client.prepareSearch(\"k8s_*\").setTypes(\"node\").setSize(10000).get();\n\n SearchHit[] hits = response.getHits().getHits();\n log.info(String.format(\"The length of node search hits is [%d]\", hits.length));\n\n ObjectMapper mapper = new ObjectMapper();\n try {\n for (SearchHit hit : hits) {\n// log.info(hit.getSourceAsString());\n NodeInfo node = mapper.readValue(hit.getSourceAsString(), NodeInfo.class);\n nodes.add(node);\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n return nodes;\n }", "public Collection<Node> getNodeList(){\r\n return nodesMap.values();\r\n }", "@Override\n public NodeInfo getNodeInfo() {\n NodeInfo nodeInfo = new NodeInfo(this.nodeProbe.isGossipRunning(), this.nodeProbe.isThriftServerRunning(),\n this.nodeProbe.isNativeTransportRunning(), this.nodeProbe.getUptime(),\n this.nodeProbe.getExceptionCount());\n return nodeInfo;\n }", "public Iterator nodeIterator() { return nodes.keySet().iterator(); }", "List<GraphEdge> getNeighbors(NodeKey key);", "@Override\n public Collection<edge_data> getE(int node_id) {\n return ((NodeData) this.nodes.get(node_id)).getNeighborEdges().values();\n }", "public HashMap<Integer, DagNode> getDagNodes(){\n return nodes;\n }", "private Map<String, Node> getNodeXmlIdTable() {\n\n if (this.nodeXmlIdTable == null) {\n this.nodeXmlIdTable = new HashMap<String, Node>();\n }\n return this.nodeXmlIdTable;\n }", "@Override\n public Iterable<E> getNeighbors(E vertex) {\n if (vertex != null && dictionary.containsKey(vertex)) {\n return dictionary.get(vertex);\n } else {\n return null;\n }\n }", "public HashMap<Integer, edge_data> getNeighborEdges() {\n return this.neighborEdges;\n }", "Set getNi()\n {\n return neighbors.keySet();\n }", "public Collection<GraphNode> getGraphNodes() {\n\t\treturn graphNodeMap.values();\n\t}", "public node_info getNode(int key)\n{\n\treturn getNodes().get(key);\n\t\n}", "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 }", "@Override\n public node_data getNode(int key) {\n return nodes.get(key);\n }", "public HashMap<String,SupplyNode> getMap(){\n return t;\n }", "protected abstract Node[] getAllNodes();", "public Set<Node<E>> getNodes(){\n return nodes.keySet();\n }", "public HashMap<String, NeonValue> getMap();", "public Map<String, Object> getInfo();", "public Map<V,List<E>> adjacencyMap(){\n\t\tMap<V,List<E>> ret = new HashMap<V,List<E>>();\n\t\tfor (E e : edges){\n\t\t\tif (virtualEdges.contains(e))\n\t\t\t\tcontinue;\n\t\t\tList<E> list;\n\t\t\tif (!ret.containsKey(e.getOrigin())){\n\t\t\t\tlist = new ArrayList<E>();\n\t\t\t\tret.put(e.getOrigin(), list);\n\t\t\t}\n\t\t\telse\n\t\t\t\tlist = ret.get(e.getOrigin());\n\t\t\tlist.add(e);\n\t\t\t\n\t\t\tif (!ret.containsKey(e.getDestination())){\n\t\t\t\tlist = new ArrayList<E>();\n\t\t\t\tret.put(e.getDestination(), list);\n\t\t\t}\n\t\t\telse\n\t\t\t\tlist = ret.get(e.getDestination());\n\t\t\tlist.add(e);\n\t\t}\n\t\treturn ret;\n\t}", "@Override\n\tpublic String toString()\n\t{\n\t\t/* output looks like this\n\t\t * \n\t\t * 20 - 10, 30 20 has edges with 10 and 30\n\t\t * 40 - 10, 30 \t\t40 has edges with 10 and 30\n\t\t * 10 - 20, 40 \t\t\t10 has edges with 20 and 40\n\t\t * 30 - 20, 40 \t\t\t30 has edges with 20 and 40\n\t\t */\n\t\tString str = new String();\n\t\tfor(Map.Entry<Object, SinglyLinkedList> vertex : map.entrySet())\n\t\t\tstr += vertex.getKey() + \" - \" + vertex.getValue() + '\\n';\t\t\t\t\n\t\treturn str;\n\t}", "public Collection< VDataT > neighborData( VKeyT key )\n throws NoSuchVertexException;", "Iterable<Long> vertices() {\n //YOUR CODE HERE, this currently returns only an empty list.\n return world.keySet();\n }", "public NodeInfo[] dump() { synchronized (this.nodedb) {\n\t\tNodeInfo[] ni = new NodeInfo[this.nodedb.size()];\n\t\tint i = 0;\n\t\tfor (NodeInfo n : this.nodedb.values())\n\t\t\tni[i++] = n;\n\t\treturn ni;\n\t}}", "public Collection<MyNode> getNeighbors(){\r\n return new ArrayList<>(this.neighbors);\r\n }", "public Set<Node<E>> getNeighbors(Node<E> node){\n Set<Node<E>> result = new HashSet<>();\n result = nodes.get(node);\n return result;\n }", "public Collection<Vertex> vertices() { \n //return myGraph.keySet(); OLD\n //create a copy of all the vertices in the map to restrict any reference\n //to the interals of this class\n Collection<Vertex> copyOfVertices = new ArrayList<Vertex>();\n copyOfVertices.addAll(myGraph.keySet());\n return copyOfVertices;\n }", "public NodeData(int key) {\n this.key = key;\n this.neighborEdges = new HashMap<>();\n this.edgesConnectedToThisNode = new HashMap<>();\n this.weight = Double.MAX_VALUE;\n this.info = \"WHITE\";\n this.tag = -1;\n this.location = new Location(0, 0, 0);\n }", "List<String> getNodeNames()\n {\n return allNodes.values().stream().map(CommunicationLink::getName).collect(Collectors.toList());\n }", "@Override\n public Collection<? extends INode> getNodes() {\n\n return new LinkedList<>(Collections.unmodifiableCollection(this.nodeMap\n .values()));\n }", "public List<? super Object> getEdgeValues(Node<A> n) {\n\t\t\n\t\tif (g == null) return null;\n\t\t\n\t\tList<? super Object> s = new LinkedList<>();\n\t\t\n\t\tif(isConnectedTo(n)) {\n\t\t\t\n\t\t\tfor(Object o: g.getEdges()) {\n\t\t\t\tif(((Edge<?>)o).getFrom().equals(this) && ((Edge<?>)o).getTo().equals(n)) {\n\t\t\t\t\ts.add( ((Edge<?>)o).getData() );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n return s;\n\t\n\t}", "public abstract Map<String,? extends Number> nodeFeatures(int n);", "java.util.List<entities.Torrent.NodeId>\n getNodesList();", "public HashMap getMetaData() ;", "private void initializeInfo()\n {\n Iterator<node_info> it=this.ga.getV().iterator();\n while (it.hasNext())\n {\n it.next().setInfo(null);\n }\n }", "@Override\n\tpublic String toString() {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"node:\\n\").append(nodeJo);\n\t\tsb.append(\"\\nedges:\\n\").append(edgesJa);\n\t\treturn sb.toString();\n\t}", "public HashSet<N> getNodes()\r\n/* 99: */ {\r\n/* 100:182 */ assert (checkRep());\r\n/* 101: */ \r\n/* 102:184 */ return new HashSet(this.map.keySet());\r\n/* 103: */ }", "private Point parseNodeInfo() {\n HashMap<String, Object> m = new HashMap<>(dump.parseSourceInfo());\n return new Point((String) m.get(\"code\"),\n Double.parseDouble((String)m.get(\"Latitude\")), Double.parseDouble((String)m.get(\"Longitude\")));\n }", "protected abstract Set<T> findNeighbors(T node, Map<T, T> parentMap);", "@Override public IndexKey[] getNodeKeys() {\n return listOfKeys.toArray(new IndexKey[listOfKeys.size()]);\n }", "public OsmObjectMap getNodes() throws SQLException {\n OsmObjectMap osmObjectMap = new OsmObjectMap();\n ResultSet nodes = databaseStatement.executeQuery(\"SELECT *, ST_X(ST_TRANSFORM(geom,4326)) as xCoord, ST_Y(ST_TRANSFORM(geom,4326)) as yCoord FROM NODES;\");\n while (nodes.next()) { //Mapping nodes\n Map<String, String> tagMap = objectMapper.convertValue(nodes.getObject(\"tags\"), Map.class);\n double unityXValue = coordinateConverter.convertXCoordinate(nodes.getDouble(\"xCoord\"));\n double unityYValue = coordinateConverter.convertYCoordinate(nodes.getDouble(\"yCoord\"));\n OsmNodeObject osmNodeObject = new OsmNodeObject(nodes.getString(\"id\"), tagMap, nodes.getDouble(\"xCoord\"), nodes.getDouble(\"yCoord\"), unityXValue, unityYValue);\n osmObjectMap.addObject(nodes.getString(\"id\"), osmNodeObject);\n }\n return osmObjectMap;\n }", "private ArrayList<Integer> getCityEdges(HashMap<Integer,Integer> table){\n ArrayList<Integer> edges = new ArrayList<Integer>();\n edges.addAll(table.keySet());\n return edges;\n }", "public Map<String, PlainNode> cloneNodeMap(PlainGraph graph) {\n return graphNodeMap.get(graph).entrySet()\n .stream()\n .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));\n }", "@Override\n\tpublic Object getNodeInfo(String path) {\n\t\treentrantReadWriteLock.readLock().lock();\n\t\tObject obj = null;\n\t\ttry {\n\t\t\tbyte[] tmpByteData = zookeeper.getData(path, false,\n\t\t\t\t\tnew Stat());\n\t\t\t\n\t\t\tobj = SomeUtil.byteToJson(tmpByteData);\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tlog.error(\"获取跟节点数据异常!\", e);\n\t\t} finally {\n\t\t\treentrantReadWriteLock.readLock().unlock();\n\t\t}\n\t\treturn obj;\n\t}", "List<CommunicationLink> getAllNodes()\n {\n return new ArrayList<>(allNodes.values());\n }", "Iterable<Long> vertices() {\n //YOUR CODE HERE, this currently returns only an empty list.\n ArrayList<Long> verticesIter = new ArrayList<>();\n verticesIter.addAll(adj.keySet());\n return verticesIter;\n }", "public ArrayList<NodeRef> getDataNodes() {\r\n\t\tArrayList<NodeRef> slaves = new ArrayList<NodeRef>();\r\n\t\tfor (NodeRef node : nodeMap.values()) {\r\n\t\t\tslaves.add(node);\r\n\t\t}\r\n\t\treturn slaves;\r\n\t}", "public List<Node> getAll() throws SQLException {\n var nodes = new ArrayList<Node>();\n var statement = connection.createStatement();\n var result = statement.executeQuery(\"SELECT identifier, x, y, parentx, parenty, status, owner, description FROM nodes\");\n while (result.next()) {\n nodes.add(\n new Node(\n result.getInt(\"identifier\"),\n result.getInt(\"x\"),\n result.getInt(\"y\"),\n result.getInt(\"parentx\"),\n result.getInt(\"parenty\"),\n result.getString(\"status\"),\n result.getString(\"owner\"),\n result.getString(\"description\")\n )\n );\n }\n result.close();\n statement.close();\n return nodes;\n }", "public Stack<Entry> readNodeEntries() {\n FileLocation thisNode = null;\n Stack<Entry> nodeEntries = new Stack<Entry>();\n try {\n int port = FileApp.getMyPort();\n thisNode = new FileLocation(port);\n } catch (UnknownHostException ex) {\n System.err.println(\"Mapper.read node entries uknown host exception\");\n }\n Stack<Integer> nodeHashes = FileApp.getHashes();\n while (!nodeHashes.empty()) {\n nodeEntries.push(new Entry(nodeHashes.pop(), thisNode));\n }//while (!nodeHashes.empty()\n printAct(\">scanned my node's files\");\n return nodeEntries;\n }", "public final TreeMap<String, String> getAllFields() {\n TreeMap<String, String> ret = new TreeMap<>(this);\n ret.remove(USE);\n for (NagPointer c : getChildren(false)) {\n for (Entry<String, String> e : c.item.entrySet()) {\n if (!e.getKey().equals(REGISTER)) {\n if (!ret.containsKey(e.getKey())) {\n ret.put(e.getKey(), e.getValue());\n }\n }\n }\n }\n return ret;\n }", "entities.Torrent.NodeId getNodes(int index);", "@Override\n\tpublic Collection<edge_data> getE(int node_id) {\n\t\t// TODO Auto-generated method stub\n\t\treturn Edges.get(node_id).values();\n\t}", "public Point2D getNodePositionXY () { return n.getXYPositionMap(); }", "@Override\r\n public List<Vertex> getVertices() {\r\n List<Vertex> verticesList = new LinkedList<>(adjacencyList.keySet()); //getting the key set of adjacencyList i.e, a list of all vertices\r\n Collections.sort(verticesList, Comparator.comparing(Vertex::getLabel));\r\n return verticesList;\r\n }", "public HashMap<String, Edge> getEdgeList () {return edgeList;}", "public Nodes nodes() {\n return this.nodes;\n }", "List<Node> getNodes();", "public List<Node> getNodes();", "public HashSet<Town> getVertices() {\r\n\t\treturn (HashSet<Town>) vertices;\r\n\t}", "public SharedMemory infos();", "public Map<String, TemporalElementStats> getVertexStats() {\n return vertexStats;\n }", "public MyArrayList<Node> getNodes() {\n return this.nodes;\n }", "public static LinkedHashMap<String,Class<?>> getNodeAttributesMap() {\r\n\t\tLinkedHashMap<String, Class<?>> map= new LinkedHashMap<String, Class<?>>();\r\n\t\tmap.put(uri, String.class);\r\n//\t\tmap.put(canonicalName, String.class);\r\n//\t\tmap.put(category , String.class);\r\n\t\tmap.put(scope,String.class);\r\n\t\tmap.put(segment,String.class);\r\n//\t\tmap.put(numInteractionEdges,Integer.class);\r\n//\t\tmap.put(numSubsumptionEdges,Integer.class);\r\n\t\tmap.put(timestamp,String.class);\r\n\t\tmap.put(modificationDate,String.class);\r\n\t\tmap.put(marked,Boolean.class);\r\n\t\tmap.put(nodeTypeURI, String.class);\r\n\t\t\r\n\t\tmap.put(GO_BIOLOGICAL_PROCESS, List.class);\r\n\t\tmap.put(GO_CELLULAR_COMPONENT, List.class);\r\n\t\tmap.put(GO_MOLECULAR_FUNCTION, List.class);\r\n\t\t\r\n\t\t//GO\r\n//\t\tmap.put(AddGOAnnotations.GO_BIOLOGICAL_PROCESS, String.class);\r\n//\t\tmap.put(AddGOAnnotations.GO_CELLURAL_COMPONENT, String.class);\r\n//\t\tmap.put(AddGOAnnotations.GO_MOLECULAR_FUNCTION, String.class);\r\n\t\t\r\n\t\treturn map;\r\n\t}", "NodeInformationProvider getNodeInformationProvider();", "public Iterable<K> neighbors(K v)\n {\n \n return adjMaps.get(v).keySet();\n }", "protected HashMap<String, BPTree<Double, FoodItem>> getIndexes(){\n \treturn this.indexes;\n }", "protected abstract List<Integer> getNeighbors(int vertex);", "java.util.List<? extends uk.ac.cam.acr31.features.javac.proto.GraphProtos.FeatureNodeOrBuilder> \n getNodeOrBuilderList();", "public HashSet<Position> getNeighborPos() { return neighborPos; }", "entities.Torrent.NodeIdOrBuilder getNodesOrBuilder(\n int index);", "private Map<String, Object> buildNodeStatus(RemoteProxy proxy) {\r\n\r\n\t\tMap<String, Object> nodeInfos = new HashMap<>();\r\n\t\tnodeInfos.put(\"busy\", proxy.isBusy());\r\n\t\ttry {\r\n\t\t\tnodeInfos.put(\"version\", ((CustomRemoteProxy)proxy).getNodeStatusClient().getStatus().getString(\"version\"));\r\n\t\t} catch (Exception e) {\r\n\t\t\tnodeInfos.put(\"version\", \"unknown\");\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tnodeInfos.put(\"driverVersion\", ((CustomRemoteProxy)proxy).getNodeStatusClient().getStatus().getString(\"driverVersion\"));\r\n\t\t} catch (Exception e) {\r\n\t\t\tnodeInfos.put(\"driverVersion\", \"unknown\");\r\n\t\t}\r\n\t\tnodeInfos.put(\"testSlots\", proxy.getConfig().maxSession);\r\n\t\tnodeInfos.put(\"usedTestSlots\", proxy.getTotalUsed());\r\n\t\t\r\n\t\tlong lastSession = proxy.getLastSessionStart();\r\n\t\tString lastSessionDate = \"never\";\r\n\t\tif (lastSession > 0) {\r\n\t\t\tInstant instant = Instant.ofEpochSecond(lastSession / 1000);\r\n\t\t\tlastSessionDate = ZonedDateTime.ofInstant(instant, ZoneOffset.UTC).toString();\r\n\t\t}\r\n\t\t\r\n\t\tnodeInfos.put(\"lastSessionStart\", lastSessionDate);\r\n\t\ttry {\r\n\t\t\tnodeInfos.put(\"status\", ((CustomRemoteProxy)proxy).getNodeStatusClient().getStatus().getString(\"status\"));\r\n\t\t} catch (Exception e) {\r\n\t\t\tnodeInfos.put(\"status\", GridStatus.UNKNOWN);\r\n\t\t}\r\n\r\n\t\treturn nodeInfos;\r\n\t}", "public interface InformationGraph {\r\n\t\r\n\tpublic int getNVertex();\r\n\tpublic int getDistanza();\r\n\tpublic int getLarghezzaX();\r\n\tpublic int getLarghezzaY();\r\n\tpublic int getWidth();\r\n\tpublic int getHeight();\r\n}", "private Iterable<ModelInfo<Project>> infos() {\n return data.keySet();\n }" ]
[ "0.67436534", "0.6592832", "0.65707016", "0.65593684", "0.6490279", "0.64391255", "0.64111584", "0.62156785", "0.62024397", "0.6196102", "0.6139879", "0.6128344", "0.6087003", "0.6071857", "0.60646003", "0.605723", "0.60562044", "0.605227", "0.60182655", "0.59917045", "0.5970383", "0.59691936", "0.5967585", "0.59250426", "0.5899522", "0.5895043", "0.58654356", "0.58376116", "0.5835407", "0.58264184", "0.58187747", "0.57800406", "0.5775105", "0.5771536", "0.5767761", "0.5758063", "0.5744955", "0.5737784", "0.57309294", "0.5729666", "0.5704059", "0.5702338", "0.56670177", "0.5664632", "0.5663184", "0.5638593", "0.5635985", "0.5630416", "0.56211245", "0.55852896", "0.55785936", "0.5577828", "0.55637324", "0.5558704", "0.55559367", "0.5539496", "0.5519895", "0.5518481", "0.55146754", "0.5512376", "0.55060625", "0.54951817", "0.5489503", "0.5485447", "0.5476961", "0.54761696", "0.54629534", "0.54561436", "0.5454342", "0.5450008", "0.5441155", "0.5431693", "0.5385965", "0.53728026", "0.53683287", "0.5344761", "0.5337978", "0.5332371", "0.53318655", "0.53262746", "0.5323353", "0.5322651", "0.5321463", "0.5311248", "0.5308329", "0.5305825", "0.53043497", "0.5295489", "0.5293378", "0.52923775", "0.5289594", "0.52883005", "0.5285472", "0.5283405", "0.5282987", "0.52819055", "0.52809775", "0.5278281", "0.52754015", "0.5262572" ]
0.63726366
7
/ To remove a node we need to find all edges that connect to it. So the fast way is to check which node is edge of the removeNode and after delete from their hash_map this node. After deleting every edge, we remove the node and update the counters.
public node_info removeNode(int key) { if(getNodes().containsKey(key)) { Node n=(Node)getNode(key); List <Integer> m=n.getNi_k(); if(m!=null) { for(int i=0;i<m.size();i++) { int z=m.get(i); Node h=(Node)getNode(z); h.removeNode(n); edge_size--; mc++; } } n.getEdgesOf().clear(); this.getNodes().remove(key); return n; } else { // System.out.println("key doesnt exist"); return null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n public node_data removeNode(int key) {\r\n// if(this.graph.containsKey(key)){\r\n// //while - all the node toward him\r\n// if(this.neighbors.get(key) != null){\r\n// ArrayList<edge_data> ni = new ArrayList<edge_data>(this.neighbors.get(key).values()); //o(k)\r\n//\r\n// while(ni.size()!= 0) { //o(k)\r\n// int n = ni.get(0).getDest();\r\n// removeEdge(key, n);\r\n// ni.remove(0);\r\n// }\r\n// }\r\n// }\r\n// return null;\r\n \t\r\n \tif (this.graph.containsKey(key)) {\r\n \t\t\r\n \t\t//go to connected remove\r\n \t\t\r\n \t\tfor (Integer v : this.connected_to.get(key)) {\r\n\t\t\t\t\r\n \t\t\tthis.neighbors.get(v).remove(key);\r\n \t\t\t\r\n \t\t\tthis.edgeCounter--;\r\n \t\t\tthis.mc++;\r\n \t\t\t\r\n\t\t\t}\r\n \t\t\r\n \t\t//remove all neighbors\r\n \t\tthis.edgeCounter -= this.neighbors.get(key).size();\r\n \t\tthis.mc += this.neighbors.get(key).size();\r\n\r\n \t\tthis.neighbors.get(key).clear();\r\n \t\t\r\n \t\treturn this.graph.remove(key);\r\n \t\t//return node\r\n \t\t\r\n \t}\r\n \t\r\n \treturn null;\r\n \t\r\n }", "@Override\n\tpublic node_data removeNode(int key) {\n\t\tif (this.Nodes.get(key) == null) {\n\t\t\treturn null;\n\t\t}\n\n\t\tSet<Integer> edgeKeys = Edges.keySet();\n\t\tfor(Integer node: edgeKeys) {\n\t\t\tif(Edges.get(node).containsKey(key)) \n\t\t\t{\n\t\t\t\tEdges.get(node).remove(key);\n\t\t\t\tnumOfEdges--;\n\t\t\t}\n\t\t}\n\n\t\t// remove all edges coming out of key-node.\n\t\tnumOfEdges -= this.Edges.get(key).values().size();\n\t\tthis.Edges.remove(key);\n\n\n\t\tMC++;\n\n\t\treturn this.Nodes.remove(key);\n\n\t}", "@Override\n public node_data removeNode(int key) {\n if (!this.nodes.containsKey(key))\n return null; // return null if the node we wish to remove does not exist in the graph\n\n NodeData nodeToRemove = (NodeData) this.nodes.get(key);\n this.numOfEdges -= nodeToRemove.getNeighborEdges().size();\n this.numOfEdges -= nodeToRemove.getEdgesConnectedToThisNode().size();\n\n Iterator<edge_data> sourceItr = nodeToRemove.getEdgesConnectedToThisNode().values().iterator();\n\n while (sourceItr.hasNext()) { // We are iterating over all edges directed at the node that we want to remove\n EdgeData edgeToRemove = (EdgeData) sourceItr.next();\n ((NodeData) (nodes.get(edgeToRemove.getSrc()))).getNeighborEdges().remove(edgeToRemove.getDest()); // Remove the edge from a node that directs to this node\n this.modeCount++;\n }\n\n Iterator<edge_data> destItr = getE(nodeToRemove.getKey()).iterator();\n\n while (destItr.hasNext()) { //We are iterating over all edges coming from the node that we want to remove\n EdgeData edgeToRemove = (EdgeData) destItr.next();\n NodeData nodeConnectedFromThisNode = (NodeData) nodes.get(edgeToRemove.getDest()); //get the node that the edge is directed at (the destination node)\n nodeConnectedFromThisNode.getEdgesConnectedToThisNode().remove(nodeToRemove.getKey()); //remove the edge from the destination node\n nodeToRemove.getNeighborEdges().remove(edgeToRemove.getDest()); //remove the edge from the source node\n this.modeCount++;\n }\n\n this.modeCount++;\n return this.nodes.remove(key);\n\n }", "public void removeEdge(N startNode, N endNode)\r\n/* 80: */ {\r\n/* 81:151 */ assert (checkRep());\r\n/* 82:152 */ if ((contains(startNode)) && (((Map)this.map.get(startNode)).containsKey(endNode)))\r\n/* 83: */ {\r\n/* 84:153 */ ((Map)this.map.get(startNode)).remove(endNode);\r\n/* 85:154 */ ((Map)this.map.get(endNode)).remove(startNode);\r\n/* 86: */ }\r\n/* 87: */ }", "public void removeNode(N node)\r\n/* 71: */ {\r\n/* 72:135 */ assert (checkRep());\r\n/* 73:137 */ for (N endNode : getSuccessors(node)) {\r\n/* 74:138 */ ((Map)this.map.get(endNode)).remove(node);\r\n/* 75: */ }\r\n/* 76:140 */ this.map.remove(node);\r\n/* 77: */ }", "void removeHasNodeID(Integer oldHasNodeID);", "@SuppressWarnings(\"java:S2445\") // the reference of allNodes is unchanged\n public void removeNode(Node removedNode) {\n if (logger.isDebugEnabled()) {\n logger.debug(\"{}: start to remove node {}\", name, removedNode);\n }\n\n synchronized (allNodes) {\n preRemoveNode(removedNode);\n if (allNodes.contains(removedNode)) {\n // update the group if the deleted node was in it\n allNodes.remove(removedNode);\n peerMap.remove(removedNode);\n if (removedNode.equals(leader.get())) {\n // if the leader is removed, also start an election immediately\n synchronized (term) {\n setCharacter(NodeCharacter.ELECTOR);\n setLeader(null);\n }\n synchronized (getHeartBeatWaitObject()) {\n getHeartBeatWaitObject().notifyAll();\n }\n }\n }\n }\n }", "@Override\n public void remove() {\n deleteFromModel();\n deleteEdgeEndpoints();\n\n setDeleted(true);\n if (!isCached()) {\n HBaseEdge cachedEdge = (HBaseEdge) graph.findEdge(id, false);\n if (cachedEdge != null) cachedEdge.setDeleted(true);\n }\n }", "@Override\n public Node remove() {\n Node temp;\n int x = 0;\n while (isEmpty(x)) {\n x++;\n }\n temp = hashTable[x];\n hashTable[x] = temp.getNext(); \n\n return temp;\n }", "void removeNode(CacheNode<K, V> node) {\n\n\t\tconcurrentList.remove(node); // O(1) operation.\n\n\t}", "public void removeNode(NodeBINE node) {\n statistic.log(Type.REMOVED_NODES);\n if (removedNodeIds.contains(node.getId())) {\n System.err.println(\"Node: \" + node.getId() + \" already removed\");\n } else {\n removedNodeIds.add(node.getId());\n //storeNode(node);\n }\n nodes.remove(node.getId());\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 }", "public void removeEdge(int node1, int node2)\n{\n\tif(getNodes().containsKey(node1) && getNodes().containsKey(node2))\n\t{\n\t\tNode n1 = (Node) getNodes().get(node1);\n\t\tNode n2 = (Node) getNodes().get(node2);\n\n\t\tif(n1.getEdgesOf().containsKey(node2))\n\t\t{\n\t\t\tedge_size--;\n\t\t\tmc++;\n\t\t\tn1.getEdgesOf().remove(node2);\n\n\t\t}\n\t\tif(n2.getEdgesOf().containsKey(node1))\n\t\t{\n\t\t\tedge_size--;\n\t\t\tmc++;\n\t\t\tn2.getEdgesOf().remove(node1);\n\n\t\t}\n\t\t\n\t\telse {\n\t\t\t\n\t\t\t//System.out.println(\"Edge doesnt exist\");\n\t\t}\n\t}\n\telse {\n\t\treturn;\n\t\t//System.out.println(\"src or dest doesnt exist\");\n\t}\n}", "@Override\n\tpublic boolean removeNode(N node)\n\t{\n\t\tif (node == null)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif (!containsNode(node))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t/*\n\t\t * Note: This method is command sequence sensitive.\n\t\t * \n\t\t * First, the remove (from nodeEdgeMap) below is \"guaranteed\" to work,\n\t\t * since the graph must contain the node (test above) and it is assumed\n\t\t * that the addNode method initialized nodeEdgeMap.\n\t\t * \n\t\t * Second, the use of remove is significant, in that it removes the set\n\t\t * of connected edges from the Map. This is important, since removeEdge\n\t\t * is called from within the loop, and removeEdge will alter sets within\n\t\t * nodeEdgeMap. Therefore, the use of get in place of remove for\n\t\t * creation of this Iterator would result in a\n\t\t * ConcurrentModificationException (since the set for GraphNode gn would\n\t\t * be modified by removeEdge while inside this Iterator).\n\t\t */\n\t\tfor (ET edge : nodeEdgeMap.remove(node))\n\t\t{\n\t\t\t// FUTURE Consider Check of return values here to ensure success??\n\t\t\tremoveEdge(edge);\n\t\t}\n\t\t/*\n\t\t * containsNode test means we don't need to check return value of remove\n\t\t * we 'know' it is present (barring an internal error!). This remove\n\t\t * must happen after removeEdge above, as removeEdge may trigger side\n\t\t * effects that will expect this Node to still be present in the Graph.\n\t\t */\n\t\tnodeList.remove(node);\n\t\tgcs.fireGraphNodeChangeEvent(node, NodeChangeEvent.NODE_REMOVED);\n\t\treturn true;\n\t}", "void removeNode(NodeKey key);", "@Override\r\n public edge_data removeEdge(int src, int dest) {\r\n \t\r\n if(src != dest && this.neighbors.get(src).containsKey(dest)){\r\n \t\r\n this.neighbors.get(src).remove(dest);\r\n \r\n this.connected_to.get(dest).remove(src);\r\n \r\n mc++;\r\n edgeCounter--;\r\n }\r\n \r\n return null;\r\n }", "abstract void removeNodeReferences(Node<T> node);", "private static void removeNode(CFG cfg, SDGNode toRemove) {\n\t\tfinal List<SDGEdge> edgesToAdd = new LinkedList<SDGEdge>();\n\t\tfinal List<SDGEdge> edgesToRemove = new LinkedList<SDGEdge>();\n\t\tfor (SDGEdge eIncoming : cfg.getIncomingEdgesOfKind(toRemove, SDGEdge.Kind.CONTROL_FLOW)) {\n\t\t\tfor (SDGEdge eOutgoing : cfg\n\t\t\t\t\t.getOutgoingEdgesOfKind(toRemove, SDGEdge.Kind.CONTROL_FLOW)) {\n\t\t\t\tedgesToAdd.add(new SDGEdge(eIncoming.getSource(), eOutgoing.getTarget(),\n\t\t\t\t\t\tSDGEdge.Kind.CONTROL_FLOW));\n\t\t\t\tedgesToRemove.add(eIncoming);\n\t\t\t\tedgesToRemove.add(eOutgoing);\n\t\t\t}\n\t\t}\n\n\t\tcfg.addAllEdges(edgesToAdd);\n\t\tcfg.removeAllEdges(edgesToRemove);\n\t\tcfg.removeVertex(toRemove);\n\t}", "public void remove(\n\t\t\tMapNode\tmapNode)\n\t\t{\n\t\t\tindices.remove(mapNode);\n\t\t}", "void remove(Edge edge);", "private void delete(DoublyLinkedNode node) {\n DoublyLinkedNode prev = node.prev;\n DoublyLinkedNode next = node.next;\n prev.next = next;\n next.prev = prev;\n map.remove(node.key);\n }", "@Override\n public void removeEdge(E pEdge, TimeFrame pTimeFrame) {\n hmpGraphsAtTimeframes.get(pTimeFrame).removeEdge(pEdge);\n\n darrGlobalAdjList.get(pEdge.getSource().getId()).get(pTimeFrame).remove(pEdge);\n darrGlobalAdjList.get(pEdge.getDestination().getId()).get(pTimeFrame).remove(pEdge);\n \n boolean otherInstances = false;\n for (TimeFrame tf : darrGlobalAdjList.get(pEdge.getSource().getId()).keySet()) {\n if (darrGlobalAdjList.get(pEdge.getSource().getId()).get(tf).contains(pEdge)) {\n otherInstances = true;\n break;\n }\n }\n \n if (!otherInstances) {\n mapAllEdges.remove(pEdge.getId());\n }\n }", "private T remove(Node<T> rm_node) {\n //if(node.previous == null) return removeFirst(); //If its a first node to remove.\n //if(node.next == null) return removeLast(); //If it's last node to remove.\n\n rm_node.next.previous = rm_node.previous; //pointing deleting nodes next element to deleting nodes prev. 3 <--- 4 ---> 5\n rm_node.previous.next = rm_node.next; //pointing deleting nodes prev element to deleting nodes next. deleting 4\n\n T data = rm_node.data; //to return deleted node data.\n\n rm_node.data = null;\n rm_node = rm_node.previous = rm_node.next = null; //Clearing node\n --size;\n\n return data;\n }", "@Override\n public void removeEdge(E pEdge) {\n for (TimeFrame tf : lstTimeFrameOrdering) {\n if (darrGlobalAdjList.get(pEdge.getSource().getId()).get(tf).contains(pEdge)) {\n hmpGraphsAtTimeframes.get(tf).removeEdge(pEdge);\n darrGlobalAdjList.get(pEdge.getSource().getId()).get(tf).remove(pEdge);\n darrGlobalAdjList.get(pEdge.getDestination().getId()).get(tf).remove(pEdge);\n }\n }\n mapAllEdges.remove(pEdge.getId());\n }", "ArrayMap<Integer,DefinedProperty> nodeDelete( long nodeId );", "public void removeNode(Integer nodeID) throws IOException, XMLStreamException {\n if (this.IPmap.containsKey(nodeID)) {\n\n this.IPmap.remove(nodeID);\n this.fileOwnerMap.remove(nodeID);\n if (this.IPmap.size() > 1) {\n //writeToXML();\n for (Map.Entry<Integer, String> entry : IPmap.entrySet()) {\n System.out.println(\"Key: \" + entry.getKey() + \". Value: \" + entry.getValue());\n }\n }\n System.out.printf(\"Node removed\");\n } else System.out.println(\"Node not in system.\");\n }", "public void remove(int key) {\n int hashedKey = hash(key);\n Entry entry = map.get(hashedKey);\n if (entry.key == -1) {\n return;\n } else if (entry.key == key) {\n if (entry.next != null) map.set(hashedKey, entry.next);\n else entry.key = -1;\n } else if (entry.next != null) {\n Entry pre = entry, cur = entry.next;\n while (cur.next != null && cur.key != key) {\n pre = cur;\n cur = cur.next;\n }\n if (cur.key == key) {\n pre.next = cur.next;\n }\n }\n }", "public void removeNode(Node<E> node) {\n super.removeNode(node);\n addNodeToCache(node);\n }", "@Override\n\tpublic void nodeRemoved(TGGraph graph, TGNode node) {\n gLogger.log(TGLogger.TGLevel.Debug, \"Node is removed\");\n removedList.put(((AbstractEntity) node).getVirtualId(), node);\n\t}", "public abstract void removeEdge(int from, int to);", "public void removeNode(T node) {\n\t\tnodes.remove(node);\n\t\tarcs.remove(node);\n\t\tfor(T k: arcs.keySet()) {\n\t\t\tarcs.get(k).remove(node);\n\t\t}\n\t}", "public int deleteFromNodeMap(Node node) {\n try {\n nodeMap.remove(node.getNodeId());\n } catch (Exception e) {\n Logger.log(\"Node with the entered id does not exist.\");\n return -1;\n }\n return 1;\n }", "public boolean remove(E e) {\n if (!contains(e)) {\n return false;\n }\n int i = hash(e);\n if (table[i].data.equals(e)) {\n table[i] = table[i].next;\n } else {\n HashNode<E> current = table[i];\n while (!current.next.data.equals(e)) {\n current = current.next;\n }\n current.next = current.next.next;\n }\n size--;\n return true;\n }", "public void remove(int key) {\n int hashCode = key%nodes.length;\n if (nodes[hashCode]==null) return;\n ListNode pre = findPrev(key);\n pre.next = pre.next.next;\n size--;\n }", "private E remove(Node node) {\n\n\t\tNode q = mHead;\n\n\t\tNode p = mHead.next;\n\n\t\twhile (p != node) {\n\n\t\t\tq = p;\n\t\t\tp = p.next;\n\t\t}\n\n\t\tq.next = p.next;\n\n\t\treturn node.data;\n\t}", "void removeEdge(int x, int y);", "protected void clearEdgeMap() {\n\n for (String id : this.edgeMap.keySet()) {\n\n this.ids.remove(id);\n }\n this.edgeMap.clear();\n }", "private void removeEdge() {\n boolean go = true;\n int lastNode;\n int proxNode;\n int atualNode;\n if ((parentMatrix[randomChild][0] != 1) &&\n (childMatrix[randomParent][0] != 1)) {\n lastNode =\n parentMatrix[randomChild][parentMatrix[randomChild][0] - 1];\n for (int i = (parentMatrix[randomChild][0] - 1); (i > 0 && go); i--)\n { // remove element from parentMatrix\n atualNode = parentMatrix[randomChild][i];\n if (atualNode != randomParent) {\n proxNode = atualNode;\n parentMatrix[randomChild][i] = lastNode;\n lastNode = proxNode;\n }\n else {\n parentMatrix[randomChild][i] = lastNode;\n go = false;\n }\n }\n if ((childMatrix[randomParent][0] != 1) &&\n (childMatrix[randomParent][0] != 1)) {\n lastNode = childMatrix[randomParent][\n childMatrix[randomParent][0] - 1];\n go = true;\n for (int i = (childMatrix[randomParent][0] - 1); (i > 0 &&\n go); i--) { // remove element from childMatrix\n atualNode = childMatrix[randomParent][i];\n if (atualNode != randomChild) {\n proxNode = atualNode;\n childMatrix[randomParent][i] = lastNode;\n lastNode = proxNode;\n }\n else {\n childMatrix[randomParent][i] = lastNode;\n go = false;\n }\n } // end of for\n }\n childMatrix[randomParent][(childMatrix[randomParent][0] - 1)] = -4;\n childMatrix[randomParent][0]--;\n parentMatrix[randomChild][(parentMatrix[randomChild][0] - 1)] = -4;\n parentMatrix[randomChild][0]--;\n }\n }", "@Override\n protected boolean removeChanceNode() {\n\n Node candidateToReduce;\n Node candidateToRemove;\n Node nodeToRemove;\n String operation;\n int i;\n NodeList children;\n Node valueNodeToReduce;\n\n NodeList chancesID;\n boolean removed = false;\n Node nodeUtil = null;\n\n\n\n\n // Obtain the value node \n\n //sv = ((IDWithSVNodes) diag).getTerminalValueNode();\n\n //diag.save(\"debug-mediastinet.elv\");\n\n //List of chance nodes in the diagram\n chancesID = diag.getNodesOfKind(Node.CHANCE);\n\n for (i = 0; (i < chancesID.size()) && removed == false; i++) {\n\n candidateToRemove = chancesID.elementAt(i);\n\n //Check if the candidaToRemove can be removed\n if (isRemovableChance(candidateToRemove)) {\n\n nodeToRemove = candidateToRemove;\n children = nodeToRemove.getChildrenNodes();\n //Reduce value nodes if it's necessary\n\n if (children.size() > 1) {\n //We have to reduce\n candidateToReduce = getCandidateValueNodeToReduceForChanceNode(nodeToRemove);\n\n //valueNodeToReduce =\tobtainValueNodeToReduce(reachableParents);\n valueNodeToReduce = obtainValueNodeToReduce(nodeToRemove, candidateToReduce);\n ReductionAndEvalID.reduceNode(\n (IDWithSVNodes) diag,\n valueNodeToReduce);\n nodeUtil = valueNodeToReduce;\n operation = \"Reduce: \" + nodeUtil.getName() + \" to eliminate: \" + nodeToRemove.getName();\n System.out.println(operation);\n statistics.addOperation(operation);\n\n indexOperation++;\n try {\n diag.save(\"debug-operation-\" + indexOperation + \".elv\");\n } catch (IOException ex) {\n Logger.getLogger(ArcReversalSV.class.getName()).log(Level.SEVERE, null, ex);\n }\n } else {\n //The chance has only one child (utility)\n nodeUtil = children.elementAt(0);\n\n }\n\n\n String auxName = candidateToRemove.getName();\n operation = \"Chance node removal: \" + auxName;\n System.out.println(operation);\n statistics.addOperation(operation);\n\n //Add the name of the node to 'orderOfElimination'\n ((PropagationStatisticsID) statistics).addNameToOrderOfElimination(auxName);\n\n // The relation of the utility node is modified. In this \n // case the parents of the node to remove will be parents \n // of the utility node \n\n modifyUtilityRelation(nodeUtil, nodeToRemove, true);\n\n // Calculate the new expected utility \n getExpectedUtility(nodeUtil, nodeToRemove);\n\n // The node is deleted \n\n diag.removeNodeOnly(nodeToRemove);\n\n//\t\t\t\tStore the size of the diagram\n\n statistics.addSize(diag.calculateSizeOfPotentials());\n\n statistics.addTime(crono.getTime());\n\n indexOperation++;\n try {\n diag.save(\"debug-operation-\" + indexOperation + \".elv\");\n } catch (IOException ex) {\n Logger.getLogger(ArcReversalSV.class.getName()).log(Level.SEVERE, null, ex);\n }\n // Set removed \n removed = true;\n\n }\n }//for\n return removed;\n }", "public boolean remove(int node) {\n\t\tif (!memberHashSet.contains(node))\n\t\t\treturn false;\n\t\t\n\t\t/* Things will change, invalidate the cached values */\n\t\tinvalidateCache();\n\t\t\n\t\t/* First, decrease the internal and the boundary weights with the\n\t\t * appropriate amounts */\n\t\ttotalInternalEdgeWeight -= inWeights[node];\n\t\ttotalBoundaryEdgeWeight -= outWeights[node] - inWeights[node];\n\t\t\n\t\t/* For each edge adjacent to the given node, make some adjustments to inWeights and outWeights */\n\t\tfor (int adjEdge: graph.getAdjacentEdgeIndicesArray(node, Directedness.ALL)) {\n\t\t\tint adjNode = graph.getEdgeEndpoint(adjEdge, node);\n\t\t\tif (adjNode == node)\n\t\t\t\tcontinue;\n\t\t\t\n\t\t\tdouble weight = graph.getEdgeWeight(adjEdge);\n\t\t\tinWeights[adjNode] -= weight;\n\t\t\toutWeights[adjNode] += weight;\n\t\t}\n\t\t\n\t\t/* Remove the node from the nodeset */\n\t\tmemberHashSet.remove(node);\n\t\tmembers.remove(node);\n\t\t\n\t\treturn true;\n\t}", "public void removeEdge(Edge e){\n edgeList.remove(e);\n }", "private int removeTail() {\n DNode node = tail.prev;\n removeNode(node);\n map.remove(node.key, node);\n return node.key;\n }", "void removeNode(Entity entity) {\n\t\tProcessing.nodeSet.remove(entity);\n\t\tProcessing.friendMap.remove(entity);\n\n\t\tSystem.out.println(\"the person was successfully removed from the network.\");\n\t}", "public static void removeSample() {\n Node ll1 = new Node(1, new Node(2, new Node(3, new Node(4, new Node(5, null)))));\n Node ll2 = new Node(1, new Node(2, new Node(3, new Node(4, new Node(5, null)))));\n Node ll3 = new Node(1, new Node(2, new Node(3, new Node(4, new Node(5, null)))));\n Node ll4 = new Node(1, new Node(2, new Node(3, new Node(4, new Node(5, null)))));\n Node ll5 = new Node(1, new Node(2, new Node(3, new Node(4, new Node(5, null)))));\n Node ll6 = new Node(1, new Node(2, new Node(3, new Node(4, new Node(5, null)))));\n\n System.out.println(\"remove 1==\");\n Node r1 = ll1.remove(0);\n r1.printList();\n System.out.println(\"remove 2==\");\n Node r2 = ll2.remove(1);\n r2.printList();\n System.out.println(\"remove 3==\");\n Node r3 = ll3.remove(2);\n r3.printList();\n System.out.println(\"remove 4==\");\n Node r4 = ll4.remove(3);\n r4.printList();\n System.out.println(\"remove 5==\");\n Node r5 = ll5.remove(4);\n r5.printList();\n System.out.println(\"remove 6==\");\n Node r6 = ll6.remove(5);\n r6.printList();\n\n }", "public void remove() {\r\n\t\theadNode.link = headNode.link.link;\r\n\t\tsize--;\r\n\t}", "public void deleteNode(GraphNode node){\n // 1. remove node from list\n graphNodes.remove(node);\n // 2. remove node from all adjacent nodes\n for(GraphNode s: node.getAdjacent()){\n s.removeAdjacent(node);\n }\n }", "public void removed()\n {\n if (prev == null) {\n IBSPColChecker.setNodeForShape(shape, next);\n }\n else {\n prev.next = next;\n }\n\n if (next != null) {\n next.prev = prev;\n }\n }", "public synchronized void removeAllFor(String nodeId) {\n\t/* see if this is a remote node */\n\tRoutesMap rl = forwardTable.remove(nodeId);\n\tif (rl == null) {\n\t /* if not, then see if it's a via node */\n\t Set<String> targets = inverseTable.remove(nodeId);\n\t if (targets != null) {\n\t\tfor (String to : targets) {\n\t\t RoutesMap trl = forwardTable.get(to);\n\t\t if (trl != null) {\n\t\t\ttrl.remove(nodeId);\n\t\t\tif (trl.size() == 0) {\n\t\t\t /* if this was the only route, cleanup */\n\t\t\t forwardTable.remove(to);\n\t\t\t}\n\t\t }\n\t\t}\n\t }\n\t}\n }", "public void onRemoveNode(Node node) {\n\t}", "private void removeNode(Node<E> node) {\n node.prev.next = node.next;\n node.next.prev = node.prev;\n }", "void removeNi(int node) {\n neighbors.remove(node);\n }", "private E removeNode(Node n) {\n \tassert (n != sentinel);\n \tn.succ.pred = n.pred;\n \tn.pred.succ = n.succ;\n \tsize--;\n \treturn n.data;\n }", "protected void clearHyperEdgeMap() {\n\n for (String id : this.hyperEdgeMap.keySet()) {\n\n this.ids.remove(id);\n }\n this.hyperEdgeMap.clear();\n }", "private void remove(Node node) {\n Node next = node.next;\n Node previous = node.previous;\n previous.next = next;\n next.previous = previous;\n }", "private void removeFromEnd(){\n ListNode tailItem = tail.prev;\n removeFromList(tailItem);\n \n //remove the entry from hashtable\n hashtable.remove(tailItem.key);\n --totalCacheItems;\n }", "void nodeRemoveProperty( long nodeId, int propertyKey );", "private E remove(Node<E> node) {\n Node<E> predecessor = node.getPrev();\n Node<E> successor = node.getNext();\n predecessor.setNext(successor);\n successor.setPrev(predecessor);\n size--;\n return node.getElement();\n }", "@org.junit.Test\n public void remove() throws Exception {\n assertEquals(null, hashTable.remove(\"savon\"));\n assertEquals(\"Yuliya\", hashTable.remove(\"Savon\"));\n assertEquals(null, hashTable.remove(\"Savon\"));\n\n for (int i = 0; i < 2_000_000; i++) {\n hashTable.put(Integer.toString(i), Integer.toString(i));\n }\n\n for (int i = 0; i < 2_000_000; i++) {\n String curValue = hashTable.remove(Integer.toString(i));\n assertEquals(Integer.toString(i), curValue);\n }\n }", "public void removeNeighbours(){\n\t\tgetNeighbours().removeAll(getNeighbours());\n\t}", "@PortedFrom(file = \"Taxonomy.h\", name = \"removeNode\")\n public void removeNode(TaxonomyVertex node) {\n graph.remove(node);\n }", "public void nodeRemoved(TreeNode removedNode) {\n\t\t\tdefaultHandle(removedNode);\n\t\t}", "void removeNeighbors();", "public void removeEdge(int start, int end);", "private void removeNode(DNode node) {\n node.prev.next = node.next;\n node.next.prev = node.prev;\n }", "@Override\n public boolean removeEdge(E vertex1, E vertex2) {\n if (vertex1 != null\n && vertex2 != null\n && vertex1 != vertex2\n && dictionary.containsKey(vertex1)\n && dictionary.containsKey(vertex2)\n && dictionary.get(vertex1).contains(vertex2)\n && dictionary.get(vertex2).contains(vertex1)) {\n dictionary.get(vertex1).remove(vertex2);\n dictionary.get(vertex2).remove(vertex1);\n return true;\n } else {\n return false;\n }\n\n }", "public void remove() {\n removeNode(this);\n }", "private void removeNode(DLinkedNode node){\n\t\tDLinkedNode prev = node.prev;\n\t\tDLinkedNode next = node.next;\n\n\t\tprev.next = next;\n\t\tnext.prev = prev;\n\t}", "public void removeVertex(V toRemove){\n if (toRemove.equals(null)){\n throw new IllegalArgumentException();\n }\n if(contains(toRemove)){\n graph.remove(toRemove);\n }\n for (V vertex : graph.keySet()){\n if (graph.get(vertex).contains(toRemove)){\n ArrayList<V> edges = graph.get(vertex);\n edges.remove(toRemove);\n graph.put(vertex, edges);\n }\n }\n }", "void tryRemoveNodes(Collection<Node> nodesToRemove) throws Exception;", "private void removeNodeById(Integer id)\n {\n if (allNodes.size() == 0)\n {\n return;\n }\n nodeIds.remove(id);\n CommunicationLink removedNode = allNodes.remove(id);\n removedNode.close();\n }", "public void remove(Node node) {\n\t\tNode cloneNode = node;\n\t\tint index = indexOf(cloneNode.block);\n\t\tif (index != (-1)){\n\t\t\tgetNode(index - 1).next = cloneNode.next;\n\t\t\tgetNode(index + 1).previous = cloneNode.previous;\n\t\t\tsize--;\n\t\t\t\n\t\t}\n\t}", "void forceRemoveNodesAndExit(Collection<Node> nodesToRemove) throws Exception;", "public void delete(K u) {\n\t\tnodes.remove(u);\n\t\troot = null;\n//\t\tfor (Map.Entry<K, V> entry : nodes.entrySet()) {\n//\t\t K key = entry.getKey();\n//\t\t V value = entry.getValue();\n//\t\t add(key, value);\n//\t\t}\n\t\t\n\t\tIterator<Map.Entry<K, V>> entries = nodes.entrySet().iterator();\n\t\twhile (entries.hasNext()) {\n\t\t Map.Entry<K, V> entry = entries.next();\n\t\t System.out.println(\"Key = \" + entry.getKey() + \", Value = \" + entry.getValue());\n\t\t K key = entry.getKey();\n\t\t V value = entry.getValue();\n\t\t add(key, value);\n\t\t}\n\t}", "private void removePeer(InetAddress peerToRemove) {\n\t\tif(peers.containsKey(peerToRemove)) {\n\t\t\tpeers.remove(peerToRemove);\n\t\t\t//If this NodeManager is shutting down (online == false), no need to remove peers from peers.txt\n\t\t\tif(online) {\n\t\t\t\twritePeers();\n\t\t\t}\n\t\t}\n\t}", "public void remove(K key) {\r\n size--;\r\n int hash = key.hashCode() % data.length;\r\n if (hash < 0){\r\n hash *= -1;\r\n }\r\n if (data[hash] == null) {throw new NullPointerException(\"no such key\");}\r\n if (data[hash].key == key || data[hash].equals(key)){\r\n data[hash] = data[hash].next;\r\n return;\r\n }\r\n Node currentNode = data[hash];\r\n Node targetNode = data[hash].next;\r\n while (targetNode.key != key && !targetNode.key.equals(key)) {\r\n currentNode = currentNode.next;\r\n targetNode = targetNode.next;\r\n }\r\n currentNode.next = targetNode.next;\r\n }", "protected void deleteNode(INode node) {\n\n if (node != null) {\n\n this.ids.remove(node.getID());\n this.nodeMap.remove(node.getID());\n }\n }", "private static void testRendezvousHashing() {\n Map<String, AtomicInteger> HRWNodesMap = Maps.newHashMap();\r\n List<String> HRWNodes = Lists.newArrayList();\r\n for(int i = 0 ; i < nodesCount; i ++) {\r\n HRWNodes.add(\"HRWNode\"+i);\r\n HRWNodesMap.put(\"HRWNode\"+i, new AtomicInteger());\r\n }\r\n RendezvousHashing<String, String> hrw = new RendezvousHashing(charsFunnel, charsFunnel, HRWNodes);\r\n \r\n // insert keys\r\n long startTime = System.currentTimeMillis();\r\n for(int i = 0 ; i < keyCount; i++) {\r\n HRWNodesMap.get(hrw.getHash(\"\"+i)).incrementAndGet();\r\n }\r\n long endTime = System.currentTimeMillis();\r\n long timeElapsed = endTime - startTime;\r\n // System.out.println(\"Execution Time in milliseconds : \" + timeElapsed);\r\n \r\n\r\n // print out distriubution + clear\r\n for(Entry<String, AtomicInteger> entry : HRWNodesMap.entrySet()) {\r\n System.out.println(entry.getKey() + \": \" + entry.getValue().get());\r\n entry.getValue().set(0);\r\n }\r\n\r\n // remove node 3\r\n System.out.println(\"\\n=== After Removing Node 3 ===\");\r\n hrw.removeNode(\"HRWNode3\");\r\n HRWNodesMap.remove(\"HRWNode3\");\r\n\r\n // re-add\r\n for(int i = 0 ; i < keyCount; i++) {\r\n HRWNodesMap.get(hrw.getHash(\"\"+i)).incrementAndGet();\r\n }\r\n\r\n // print out distriubution again\r\n for(Entry<String, AtomicInteger> entry : HRWNodesMap.entrySet()) {\r\n System.out.println(entry.getKey() + \": \" + entry.getValue().get());\r\n }\r\n }", "void removepeer(Node p) {\n\t\tpeers.remove(p);\n\t}", "@Override\n\tpublic edge_data removeEdge(int src, int dest) {\n\t\tif(getEdge(src,dest) == null) {\n\t\t\treturn null;\n\t\t}\n\t\tedge_data e = this.Edges.get(src).get(dest);\n\t\tthis.Edges.get(src).remove(dest);\n\t\tnumOfEdges--;\n\t\tMC++;\n\t\treturn e;\n\t}", "public void removeVertex();", "public synchronized void removeByMatchedNode(ListNode node) {\n\t\tif (head == null)\n\t\t\treturn;\n\t\tif (node.equals(head)) {\n\t\t\thead = head.getNext();\n\t\t\t// reduce the length of the list\n\t\t\tlength -= 1;\n\t\t\treturn;\n\t\t}else{\n\t\t\t\n\t\t\tListNode previousNode = findPrevious(node.getData());\n\t\t\tpreviousNode.setNext(previousNode.getNext().getNext());\n\t\t}\n\t\t\n\t}", "public Node removeFromChain();", "public void removeNode(Runtime runtime) {\n if (runtime == null) {\n LOG.debug(\"Can not remove null node\");\n return;\n }\n\n Iterator<NotificationListener> iter = topologyListeners.iterator();\n while(iter.hasNext()) {\n NotificationListener listener = iter.next();\n // TODO : Do it async...\n // TODO : Generics...\n listener.on(\"remove\", runtime);\n }\n }", "public void nodeRemoved(GraphEvent e);", "@Override\n\tpublic void remove(DuNode s) {\n\t\t\n\t}", "public void streamRemoved(int streamId) {\n Http2PriorityNode node = nodesByID.get(streamId);\n if(node == null) {\n return;\n }\n if(!node.hasDependents()) {\n //add to eviction queue\n int toEvict = evictionQueue[evictionQueuePosition];\n evictionQueue[evictionQueuePosition++] = streamId;\n Http2PriorityNode nodeToEvict = nodesByID.get(toEvict);\n //we don't remove the node if it has since got dependents since it was put into the queue\n //as this is the whole reason we maintain the queue in the first place\n if(nodeToEvict != null && !nodeToEvict.hasDependents()) {\n nodesByID.remove(toEvict);\n }\n }\n\n }", "public void removeLink(int vertexA, int vertexB) {\n\t\ttry {\n\t\t\t// Remove link from A to B\n\t\t\tArrayList<Integer> neighbors = this.adjListMap.get(vertexA);\n\t\t\tneighbors.remove((Integer) vertexB);\n\t\t\tthis.adjListMap.put(vertexA, neighbors);\n\n\t\t\t// Remove a link from B to A\n\t\t\tneighbors = this.adjListMap.get(vertexB);\n\t\t\tneighbors.remove((Integer) vertexA);\n\t\t\tthis.adjListMap.put(vertexB, neighbors);\n\n\t\t\t// Update reachability matrix on every link removal\n\t\t\tbuildReachabilityMatrix(this.adjListMap);\n\t\t} catch (NullPointerException e) {\n\t\t\tSystem.out.println(\"Vertices are out of range. It should be < \" + this.maxNumVertices);\n\t\t}\n\n\t}", "public abstract void removeEdge(Point p, Direction dir);", "@Override\r\n public void remove(V vertexName) {\r\n try {\r\n Vertex a = null;\r\n Iterator<Vertex> vertexIterator = map.values().iterator();\r\n while(vertexIterator.hasNext()) {\r\n Vertex v = vertexIterator.next();\r\n if(vertexName.compareTo(v.vertexName) == 0)\r\n a = v;\r\n }\r\n if(a == null)\r\n vertexIterator.next();\r\n for(Vertex v : map.values()) {\r\n if(v.destinations.contains(a.vertexName))\r\n disconnect(v.vertexName, vertexName);\r\n }\r\n map.remove(a.vertexName, a);\r\n }\r\n catch(NoSuchElementException e) {\r\n throw e;\r\n }\r\n }", "boolean removeNode(N node);", "protected void removeFromChain(\n LogicalOperator nodeToRemove,\n Map<Integer, Integer> projectionMapping)\n throws VisitorException, FrontendException {\n \t\n \tList<LogicalOperator> afterNodes = mPlan.getPredecessors(nodeToRemove);\n \tif (afterNodes.size()!=1)\n \t\tthrow new RuntimeException(\"removeFromChain only valid to remove \" + \n \t\"node has one predecessor.\");\n \tList<LogicalOperator> beforeNodes = mPlan.getSuccessors(nodeToRemove);\n \tif (beforeNodes!=null && beforeNodes.size()!=1)\n \t\tthrow new RuntimeException(\"removeFromChain only valid to remove \" + \n \t\t\"node has one successor.\");\n \t\n \t// Get after and before node\n \tLogicalOperator after = mPlan.getPredecessors(nodeToRemove).get(0);\n \tLogicalOperator before = null;\n \tif (beforeNodes!=null)\n \t\tbefore = mPlan.getSuccessors(nodeToRemove).get(0);\n \t\n // Remove nodeToRemove from plan\n \tmPlan.remove(nodeToRemove);\n \tif (before!=null)\n \t{\n\t \t// Shortcut nodeToRemove.\n\t mPlan.connect(after, before);\n\t\n\t // Visit all the inner plans of before and change their projects to\n\t // connect to after instead of nodeToRemove.\n\t // Find right inner plan(s) to visit\n\t List<LogicalPlan> plans = new ArrayList<LogicalPlan>();\n\t if (before instanceof LOCogroup) {\n\t plans.addAll((((LOCogroup)before).getGroupByPlans()).values());\n\t } else if (before instanceof LOSort) {\n\t plans.addAll(((LOSort)before).getSortColPlans());\n\t } else if (before instanceof LOFilter) {\n\t plans.add(((LOFilter)before).getComparisonPlan());\n\t } else if (before instanceof LOSplitOutput) {\n\t plans.add(((LOSplitOutput)before).getConditionPlan());\n\t } else if (before instanceof LOForEach) {\n\t plans.addAll(((LOForEach)before).getForEachPlans());\n\t }\n\t \n\t for (LogicalPlan lp : plans) {\n\t ProjectFixerUpper pfu =\n\t new ProjectFixerUpper(lp, nodeToRemove, after, projectionMapping);\n\t pfu.visit();\n\t }\n\t\n \t}\n\n \t// Now rebuild the schemas\n // rebuildSchemas();\n }", "public boolean remove(Node n) {\n\t\t\n\t\t//Validate n has a value\n\t\tif (n == null) { \n\t\t\tSystem.out.println(\"Node you entered is invalid\");\n\t\t\treturn false; \n\t\t} \n\t\t\n\t\t//If the node isn't present in the network return\t\t\n\t\tif (!nodes.contains(n)) { \n\t\t\tSystem.out.println(\"Node does not exist\");\n\t\t\treturn false; \n\t\t}\n\t\t\n\t\t//Remove the nodes neighbor links \n\t\tn.removeNeighbors();\n\t\t\n\t\t//remove the node from the HashMap\n\t\tnodes.remove(n);\n\t\t\n\t\t//Successfully removed\n\t\treturn true;\n\t\t\n\t}", "@Override\n\tpublic void clear()\n\t{\n\t\t/*\n\t\t * TODO This doesn't actually notify GraphChangeListeners, is that a\n\t\t * problem? - probably is ... thpr, 6/27/07\n\t\t */\n\t\tnodeEdgeMap.clear();\n\t\tnodeList.clear();\n\t\tedgeList.clear();\n\t}", "E remove(E element) {\n\t\t\tshort index = (short)((element.hashCode() >> 24) & 0x000000FF);\n\t\t\tE obj = nodes[index].remove(this, element.hashCode(), (byte) 1);\n\t\t\tif (obj != null) {\n\t\t\t\tsize--;\n\t\t\t}\n\t\t\treturn obj;\n\t\t}", "public Node<E> remove(E e) {\n Node<E> current = head.getNext();\n while (current != tail) {\n if (current.getValue() == e) {\n current.getPrevious().setNext(current.getNext());\n current.getNext().setPrevious(current.getPrevious());\n current.setNext(null);\n current.setPrevious(null);\n size--;\n return current;\n }\n current = current.getNext();\n }\n return null;\n }", "boolean removeEdge(E edge);", "public void delete(E e) {\n\t\tNode node = getNode(root, e);\n\t\tif (node == null) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tNode parentOfLast = getNode(size >> 1);\n\t\tif (parentOfLast.right != null) {\n\t\t\tnode.data = parentOfLast.right.data;\n\t\t\tparentOfLast.right = null;\n\t\t}\n\t\telse {\n\t\t\tnode.data = parentOfLast.left.data;\n\t\t\tparentOfLast.left = null;\n\t\t}\n\t\tsize--;\n\t}", "@Override\n\tpublic synchronized void removeNode(DirectedGraphNode node) {\n\t\tif (node instanceof Transition) {\n\t\t\tthis.removeTransition((Transition) node);\n\t\t} else if (node instanceof Place) {\n\t\t\tthis.removePlace((Place) node);\n\t\t}\n\t\tthis.graphElementRemoved(node);\n\t}", "public synchronized void remove(E object) {\n Node<E> temp = first;\n while (temp.next != null) {\n if (first.object.equals(object)) {\n first = first.next;\n } else if (temp.object.equals(object)) {\n Node<E> forChangeLinks = temp;\n temp.next.prev = temp.prev;\n temp.prev.next = temp.next;\n }\n temp = temp.next;\n }\n }", "private boolean removeNode(NeuralNode node) {\r\n\t\treturn innerNodes.remove(node);\r\n\t}" ]
[ "0.6846556", "0.66368157", "0.6599232", "0.65549195", "0.64710325", "0.64689964", "0.64305794", "0.63713735", "0.63599586", "0.6333129", "0.6322907", "0.6316201", "0.6191097", "0.61727417", "0.61262363", "0.610431", "0.6074943", "0.6025408", "0.6017604", "0.6000801", "0.5987434", "0.5966232", "0.59302753", "0.5929177", "0.59272534", "0.5882863", "0.58482397", "0.58479285", "0.5843044", "0.5832659", "0.5823322", "0.58206505", "0.5817901", "0.58123386", "0.5811553", "0.57987267", "0.57848346", "0.57586336", "0.57534975", "0.5750678", "0.57361305", "0.57209975", "0.5707195", "0.57028425", "0.56963176", "0.56711423", "0.56699455", "0.5657341", "0.5650121", "0.56472844", "0.56373775", "0.56353426", "0.5630595", "0.5615944", "0.5603907", "0.5594205", "0.5567406", "0.55654234", "0.5563015", "0.55621284", "0.5560737", "0.5551648", "0.55391824", "0.5534278", "0.55074185", "0.55002356", "0.5494772", "0.54860693", "0.54779154", "0.54769826", "0.5462924", "0.5458657", "0.54531753", "0.54464996", "0.54460365", "0.5439626", "0.54395705", "0.54376537", "0.5428807", "0.542373", "0.5422046", "0.5414485", "0.5403648", "0.53971034", "0.53947526", "0.5379658", "0.5371672", "0.53684604", "0.53627956", "0.5361669", "0.53602874", "0.53513265", "0.53490233", "0.5340787", "0.5340635", "0.53371286", "0.5331941", "0.5330598", "0.5330189", "0.5329478" ]
0.62746507
12
/ To remove an edge we need to find the source node and check if contains the destination in it's HashMap of edges node1 = The node of the source node2 = The node of the dest
public void removeEdge(int node1, int node2) { if(getNodes().containsKey(node1) && getNodes().containsKey(node2)) { Node n1 = (Node) getNodes().get(node1); Node n2 = (Node) getNodes().get(node2); if(n1.getEdgesOf().containsKey(node2)) { edge_size--; mc++; n1.getEdgesOf().remove(node2); } if(n2.getEdgesOf().containsKey(node1)) { edge_size--; mc++; n2.getEdgesOf().remove(node1); } else { //System.out.println("Edge doesnt exist"); } } else { return; //System.out.println("src or dest doesnt exist"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void deleteEdge(String source, String dest) {\r\n\t\tVertex v = vertexMap.get(source);\r\n\t\tfor (Iterator i = v.adjacent.iterator(); i.hasNext();) {\r\n\t\t\tEdge edge = (Edge) i.next();\r\n\t\t\tif (edge.getDestination().equals(dest)) {\r\n\t\t\t\tv.adjacent.remove(edge);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\r\n public edge_data removeEdge(int src, int dest) {\r\n \t\r\n if(src != dest && this.neighbors.get(src).containsKey(dest)){\r\n \t\r\n this.neighbors.get(src).remove(dest);\r\n \r\n this.connected_to.get(dest).remove(src);\r\n \r\n mc++;\r\n edgeCounter--;\r\n }\r\n \r\n return null;\r\n }", "public boolean removeEdge(Object src, Object dest, boolean direction) \n\t{\n\t\tif(this.map.containsKey(src) && this.map.containsKey(dest))\n\t\t{\n\t\t\tif(direction)\n\t\t\t\tthis.map.get(src).removeNode(dest);\n\t\t\telse \n\t\t\t{\n\t\t\t\tthis.map.get(src).removeNode(dest);\t\n\t\t\t\tthis.map.get(dest).removeNode(src);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "private Edge removeEdge(Node source, Node dest)\r\n\t{\r\n\t final Edge e = source.removeEdge(edgeType.getName(), dest);\r\n\t if (!eSet.remove(e))\r\n\t\tthrow new RuntimeException(\"No Edge from Node <\"+source.getName()\r\n\t\t\t\t\t +\"> to Node <\"+dest.getName()+\">\");\r\n\t return e;\r\n\t}", "public void removeEdge(N startNode, N endNode)\r\n/* 80: */ {\r\n/* 81:151 */ assert (checkRep());\r\n/* 82:152 */ if ((contains(startNode)) && (((Map)this.map.get(startNode)).containsKey(endNode)))\r\n/* 83: */ {\r\n/* 84:153 */ ((Map)this.map.get(startNode)).remove(endNode);\r\n/* 85:154 */ ((Map)this.map.get(endNode)).remove(startNode);\r\n/* 86: */ }\r\n/* 87: */ }", "@Override\n public boolean removeEdge(E vertex1, E vertex2) {\n if (vertex1 != null\n && vertex2 != null\n && vertex1 != vertex2\n && dictionary.containsKey(vertex1)\n && dictionary.containsKey(vertex2)\n && dictionary.get(vertex1).contains(vertex2)\n && dictionary.get(vertex2).contains(vertex1)) {\n dictionary.get(vertex1).remove(vertex2);\n dictionary.get(vertex2).remove(vertex1);\n return true;\n } else {\n return false;\n }\n\n }", "public void deleteEdge( String sourceName, String destName)\n {\n \tVertex v = vertexMap.get( sourceName );\n Vertex w = vertexMap.get( destName );\n if(v!=null && w!=null)\n \tv.adjEdge.remove(w.name);\n \n // v.weightnext.put(w.name,(Double) distance);\n }", "public abstract void removeEdge(int from, int to);", "void removeEdge(int x, int y);", "public boolean removeEdge(V source, V target);", "private static void RemoveEdge(Point a, Point b)\n {\n //Here we use a lambda expression/predicate to express that we're looking for a match in list\n //Either if (n.A == a && n.B == b) or if (n.A == b && n.B == a)\n edges.removeIf(n -> n.A == a && n.B == b || n.B == a && n.A == b);\n }", "@Override\r\n public void disconnect(V start, V destination) {\r\n try {\r\n Iterator<Vertex> vertexIterator = map.values().iterator();\r\n Vertex a = null, b = null;\r\n while(vertexIterator.hasNext()) {\r\n Vertex v = vertexIterator.next();\r\n if(start.compareTo(v.vertexName) == 0)\r\n a = v;\r\n if(destination.compareTo(v.vertexName) == 0)\r\n b = v;\r\n }\r\n if(a == null || b == null)\r\n vertexIterator.next();\r\n a.removeDestinations(destination);\r\n\r\n } catch(NoSuchElementException e) {\r\n throw e;\r\n }\r\n }", "@Override\r\n\tpublic boolean unlink(E src, E dst) {\r\n\t\tVertex<E> s = vertices.get(src);\r\n\t\tVertex<E> d = vertices.get(dst);\r\n\t\tif(s != null && d != null) {\r\n\t\t\tadjacencyLists.get(src).remove(new Edge<E>(s.getElement(), d.getElement(), 1)); //remove edge (s,d)\r\n\t\t\tif(!isDirected) { //Remove the other edge if this graph is undirected\r\n\t\t\t\tadjacencyLists.get(dst).remove(new Edge<E>(d.getElement(), s.getElement(), 1));\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "@Override\n\tpublic edge_data removeEdge(int src, int dest) {\n\t\tif(getEdge(src,dest) == null) {\n\t\t\treturn null;\n\t\t}\n\t\tedge_data e = this.Edges.get(src).get(dest);\n\t\tthis.Edges.get(src).remove(dest);\n\t\tnumOfEdges--;\n\t\tMC++;\n\t\treturn e;\n\t}", "@Override\n public edge_data removeEdge(int src, int dest) {\n NodeData nodeToRemoveEdgeFrom = (NodeData) this.nodes.get(src);\n if (!nodeToRemoveEdgeFrom.hasNi(dest)) return null; //return null if there is no edge from src to dest\n EdgeData edgeToRemove = (EdgeData) nodeToRemoveEdgeFrom.getEdge(dest);\n NodeData nodeConnectedFromThisNode = (NodeData) nodes.get(edgeToRemove.getDest()); //get the node that the edge is directed at (the destination node)\n nodeConnectedFromThisNode.getEdgesConnectedToThisNode().remove(nodeToRemoveEdgeFrom.getKey()); //remove the edge from the destination node\n nodeToRemoveEdgeFrom.getNeighborEdges().remove(edgeToRemove.getDest()); //remove the edge from the source node\n this.modeCount++;\n this.numOfEdges--;\n return edgeToRemove;\n }", "void removeDirectedEdge(final Node first, final Node second)\n {\n if (first.connectedNodes.contains(second))\n first.connectedNodes.remove(second);\n\n }", "@Override\n public node_data removeNode(int key) {\n if (!this.nodes.containsKey(key))\n return null; // return null if the node we wish to remove does not exist in the graph\n\n NodeData nodeToRemove = (NodeData) this.nodes.get(key);\n this.numOfEdges -= nodeToRemove.getNeighborEdges().size();\n this.numOfEdges -= nodeToRemove.getEdgesConnectedToThisNode().size();\n\n Iterator<edge_data> sourceItr = nodeToRemove.getEdgesConnectedToThisNode().values().iterator();\n\n while (sourceItr.hasNext()) { // We are iterating over all edges directed at the node that we want to remove\n EdgeData edgeToRemove = (EdgeData) sourceItr.next();\n ((NodeData) (nodes.get(edgeToRemove.getSrc()))).getNeighborEdges().remove(edgeToRemove.getDest()); // Remove the edge from a node that directs to this node\n this.modeCount++;\n }\n\n Iterator<edge_data> destItr = getE(nodeToRemove.getKey()).iterator();\n\n while (destItr.hasNext()) { //We are iterating over all edges coming from the node that we want to remove\n EdgeData edgeToRemove = (EdgeData) destItr.next();\n NodeData nodeConnectedFromThisNode = (NodeData) nodes.get(edgeToRemove.getDest()); //get the node that the edge is directed at (the destination node)\n nodeConnectedFromThisNode.getEdgesConnectedToThisNode().remove(nodeToRemove.getKey()); //remove the edge from the destination node\n nodeToRemove.getNeighborEdges().remove(edgeToRemove.getDest()); //remove the edge from the source node\n this.modeCount++;\n }\n\n this.modeCount++;\n return this.nodes.remove(key);\n\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 }", "void remove(Edge edge);", "public void removeEdge(T source, T destination) {\n\t\tif (source == null || destination == null) {\n\t\t\tthrow new NullPointerException(\n\t\t\t\t\t\"Source and Destination, both should be non-null.\");\n\t\t}\n\t\tif (!graph.containsKey(source) || !graph.containsKey(destination)) {\n\t\t\tthrow new NoSuchElementException(\n\t\t\t\t\t\"Source and Destination, both should be part of graph\");\n\t\t}\n\t\tgraph.get(source).remove(destination);\n\t}", "@Override\r\n public node_data removeNode(int key) {\r\n// if(this.graph.containsKey(key)){\r\n// //while - all the node toward him\r\n// if(this.neighbors.get(key) != null){\r\n// ArrayList<edge_data> ni = new ArrayList<edge_data>(this.neighbors.get(key).values()); //o(k)\r\n//\r\n// while(ni.size()!= 0) { //o(k)\r\n// int n = ni.get(0).getDest();\r\n// removeEdge(key, n);\r\n// ni.remove(0);\r\n// }\r\n// }\r\n// }\r\n// return null;\r\n \t\r\n \tif (this.graph.containsKey(key)) {\r\n \t\t\r\n \t\t//go to connected remove\r\n \t\t\r\n \t\tfor (Integer v : this.connected_to.get(key)) {\r\n\t\t\t\t\r\n \t\t\tthis.neighbors.get(v).remove(key);\r\n \t\t\t\r\n \t\t\tthis.edgeCounter--;\r\n \t\t\tthis.mc++;\r\n \t\t\t\r\n\t\t\t}\r\n \t\t\r\n \t\t//remove all neighbors\r\n \t\tthis.edgeCounter -= this.neighbors.get(key).size();\r\n \t\tthis.mc += this.neighbors.get(key).size();\r\n\r\n \t\tthis.neighbors.get(key).clear();\r\n \t\t\r\n \t\treturn this.graph.remove(key);\r\n \t\t//return node\r\n \t\t\r\n \t}\r\n \t\r\n \treturn null;\r\n \t\r\n }", "public void removeEdge(V from, V to){\n if (from.equals(null) || to.equals(null)){\n throw new IllegalArgumentException();\n }\n if (hasEdge(from, to)){\n ArrayList<V> edges = (ArrayList<V>)getEdges(from);\n int i = 1;\n V vertex = edges.get(0);\n while (i < edges.size() && !vertex.equals(to)){\n i++;\n vertex = edges.get(i);\n }\n edges.remove(vertex);\n graph.put(from, edges);\n }\n\n }", "public void removeEdge(int start, int end);", "@Override public boolean remove(L vertex) {\r\n if(!vertices.contains(vertex)) return false;\r\n vertices.remove(vertex);\r\n Iterator<Edge<L>> iter=edges.iterator();\r\n while(iter.hasNext()) {\r\n \t Edge<L> tmp=iter.next();\r\n \t //改了\r\n \t if(tmp.getSource().equals(vertex) || tmp.getTarget().equals(vertex))\r\n \t // if(tmp.getSource()==vertex|| tmp.getTarget()==vertex) \r\n \t\t iter.remove();\r\n \t}\r\n checkRep();\r\n return true;\r\n \r\n \r\n }", "private void edgeDown(String source, String dest) {\r\n\t\tVertex v = vertexMap.get(source);\r\n\t\tfor (Iterator i = v.adjacent.iterator(); i.hasNext();) {\r\n\t\t\tEdge edge = (Edge) i.next();\r\n\t\t\tif (edge.getDestination().equals(dest))\r\n\t\t\t\tedge.setStatus(false);\r\n\t\t}\r\n\t}", "boolean removeEdge(E edge);", "@Override\r\n public void remove(V vertexName) {\r\n try {\r\n Vertex a = null;\r\n Iterator<Vertex> vertexIterator = map.values().iterator();\r\n while(vertexIterator.hasNext()) {\r\n Vertex v = vertexIterator.next();\r\n if(vertexName.compareTo(v.vertexName) == 0)\r\n a = v;\r\n }\r\n if(a == null)\r\n vertexIterator.next();\r\n for(Vertex v : map.values()) {\r\n if(v.destinations.contains(a.vertexName))\r\n disconnect(v.vertexName, vertexName);\r\n }\r\n map.remove(a.vertexName, a);\r\n }\r\n catch(NoSuchElementException e) {\r\n throw e;\r\n }\r\n }", "public abstract void removeEdge(Point p, Direction dir);", "public void removeEdge(String edgeTypeName, Node source, Node dest)\r\n {\r\n\tfinal EdgeTypeHolder eth = ethMap.get(edgeTypeName);\r\n\tif(eth!=null) eth.removeEdge(source, dest);\r\n\t// Invalidate the Edge array cache.\r\n\tedges = null;\r\n }", "void removeEdge(Vertex v1, Vertex v2) throws GraphException;", "public boolean removeEdge(E edge);", "@Test\n\tpublic void removeEdgeTest() {\n\t\tList<Vertex> vertices = new ArrayList<>();\n\t\tvertices.add(C);\n\t\tvertices.add(D);\n\t\tedge_0.addVertices(vertices);\n\t\tList<Vertex> vertices1 = new ArrayList<>();\n\t\tvertices.add(A);\n\t\tvertices.add(B);\n\t\tedge_1.addVertices(vertices1);\n\t\tgraph.addEdge(edge_0);\n\t\tgraph.addEdge(edge_1);\n\t\tassertTrue(graph.removeEdge(edge_0));\n\t\tassertFalse(graph.edges().contains(edge_0));\n\t\tassertTrue(graph.edges().size() == 1);\n\t}", "@Override\n\tpublic boolean containsEdge(Object src, Object dest)\n\t{\n\t\tif(this.map.containsKey(src))\n\t\t\tif(this.map.get(src).contains(dest))\n\t\t\t\treturn true;\t\t\n\t\treturn false;\n\t}", "public void removeEdge(Entity entityFirst, Entity entitySecond) {\n\t\tif(Processing.friendMap.containsKey(entityFirst.getEmail())) {\n\t\t\tif(Processing.friendMap.get(entityFirst.getEmail()).contains(entitySecond.getEmail())) {\n\t\t\t\tProcessing.friendMap.get(entityFirst.getEmail()).remove(entitySecond.getEmail());\n\t\t\t\tSystem.out.println(entitySecond.getEmail()+\" is removed from your Friend list\");\n\t\t\t}\n\t\t\telse{\n\t\t\t\tSystem.out.println(entitySecond.getEmail()+\" is not friend of you\");\n\t\t\t}\n\t\t\t\n\t\t}else {\n\t\t\tSystem.out.println(entityFirst.getEmail()+\" does not exist\");\n\t\t}\n\t}", "public void removeEdge(K u, K v)\n {\n\tList<HashMap<K, Integer>> adj = adjLists.get(u);\n\n\t// check for edge already being there\n\tfor (int i=0;i<adj.size();i++){\n\t\tfor (K vertex:adj.get(i).keySet()){\n\t\t\tif (vertex.equals(v))\n\t\t {\n\t\t\t\tadj.remove(adj.get(i));\n\t\t\t\t\n\n\t\t }\n\t\t}\n\t\t\n\t\t\n\t}\n\t\n\tList<HashMap<K, Integer>> adj2 = adjLists.get(v);\n\n\t// check for edge already being there\n\tfor (int i=0;i<adj2.size();i++){\n\t\tfor (K vertex:adj2.get(i).keySet()){\n\t\t\tif (vertex.equals(u))\n\t\t {\n\t\t\t\tadj2.remove(adj2.get(i));\n\n\t\t }\n\t\t}\n\t\t\n\t\t\n\t}\n\t\n }", "@Test\r\n void test_remove_same_edge_twice() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.removeEdge(\"A\", \"B\");\r\n graph.removeEdge(\"A\", \"B\");\r\n if (graph.size() != 1) {\r\n fail();\r\n }\r\n if (graph.getAdjacentVerticesOf(\"A\").contains(\"B\")) {\r\n fail();\r\n } \r\n }", "public void removeEdge(Edge e){\n edgeList.remove(e);\n }", "private static void removeNode(CFG cfg, SDGNode toRemove) {\n\t\tfinal List<SDGEdge> edgesToAdd = new LinkedList<SDGEdge>();\n\t\tfinal List<SDGEdge> edgesToRemove = new LinkedList<SDGEdge>();\n\t\tfor (SDGEdge eIncoming : cfg.getIncomingEdgesOfKind(toRemove, SDGEdge.Kind.CONTROL_FLOW)) {\n\t\t\tfor (SDGEdge eOutgoing : cfg\n\t\t\t\t\t.getOutgoingEdgesOfKind(toRemove, SDGEdge.Kind.CONTROL_FLOW)) {\n\t\t\t\tedgesToAdd.add(new SDGEdge(eIncoming.getSource(), eOutgoing.getTarget(),\n\t\t\t\t\t\tSDGEdge.Kind.CONTROL_FLOW));\n\t\t\t\tedgesToRemove.add(eIncoming);\n\t\t\t\tedgesToRemove.add(eOutgoing);\n\t\t\t}\n\t\t}\n\n\t\tcfg.addAllEdges(edgesToAdd);\n\t\tcfg.removeAllEdges(edgesToRemove);\n\t\tcfg.removeVertex(toRemove);\n\t}", "private void removeEdgeJointPointDest(Vector<Edge> edges) {\n\t\tfor (Edge e: edges) {\n\t\t\t\tEdge currentEdge = e;\n\t\t\t\tremoveEdge(e);\n\t\t\t\twhile (shapes.contains(currentEdge.getDest()) && currentEdge.getDest() instanceof JoinPoint) {\n\t\t\t\t\tJoinPoint join = (JoinPoint) currentEdge.getDest();\n\t\t\t\t\tshapes.remove(join);\n\t\t\t\t\tcurrentEdge = (Edge) join.getDest();\n\t\t\t\t\tremoveEdge(currentEdge);\n\t\t\t\t}\n\t\t}\n\t}", "public void cleanNodeListToEdges(CircosEdgeList edges){\n\t\tArrayList<CircosNode> tempnodes = new ArrayList<CircosNode>();\n\t\tHashMap<String,String> tempcolors = new HashMap<String,String>();\n\t\t\n\t\tfor(int i = 0; i < nodes.size(); i++){\n\t\t\tif(edges.containsNodeAsSourceOrTarget(nodes.get(i).getID())){\n\t\t\t\ttempnodes.add(nodes.get(i));\n\t\t\t\ttempcolors.put(nodes.get(i).getID(), colors.get(nodes.get(i).getID()));\n\t\t\t}\n\t\t}\n\t\t\t\n\t\tnodes = tempnodes;\n\t\tcolors = tempcolors;\n\t}", "public boolean deleteConnection(GraphNode nodeA, GraphNode nodeB) {\n if (nodeB.getAdjacent().contains(nodeA)) {\n //do the thing\n nodeA.removeAdjacent(nodeB);\n nodeB.removeAdjacent(nodeA);\n return true;\n }\n return false;\n }", "public void removeEdge(Node p_a, Node p_b) {\n\t\tEdge edge = makeEdge(p_a, p_b);\n\t\tedges.remove(edge);\n\t}", "private void removeNoMoreExistingOriginalEdges() {\n for (MirrorEdge mirrorEdge : directEdgeMap.values()) {\n if (!originalGraph.has(mirrorEdge.original)) {\n for (Edge segment : mirrorEdge.segments) {\n mirrorGraph.forcedRemove(segment);\n reverseEdgeMap.remove(segment);\n }\n for (Node bend : mirrorEdge.bends) {\n mirrorGraph.forcedRemove(bend);\n reverseEdgeMap.remove(bend);\n }\n directEdgeMap.remove(mirrorEdge.original);\n }\n }\n }", "@Test\r\n void test_insert_two_vertice_with_one_edge_remove_non_existent_edge() {\r\n // Add three vertices with two edges\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n vertices = graph.getAllVertices();\r\n // B should be an adjacent vertex of A\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // C should be an adjacent vertex of B\r\n if(!graph.getAdjacentVerticesOf(\"B\").contains(\"C\")){\r\n fail();\r\n }\r\n //Check that A,B and C are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")\r\n | !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n // There are two edges in the graph\r\n if(graph.size() != 2) {\r\n fail();\r\n }\r\n // Try are remove edge from A to C\r\n graph.removeEdge(\"A\", \"C\");\r\n graph.removeEdge(\"A\", \"D\");\r\n graph.removeEdge(\"E\", \"F\");\r\n graph.removeEdge(null, \"A\");\r\n graph.removeEdge(\"A\", null);\r\n //Graph should maintain its original shape\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // C should be an adjacent vertex of B\r\n if(!graph.getAdjacentVerticesOf(\"B\").contains(\"C\")){\r\n fail();\r\n }\r\n //Check that A,B and C are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")\r\n | !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n // There are two edges in the graph\r\n if(graph.size() != 2) {\r\n fail();\r\n }\r\n }", "@Override\n public void removeEdge(E pEdge, TimeFrame pTimeFrame) {\n hmpGraphsAtTimeframes.get(pTimeFrame).removeEdge(pEdge);\n\n darrGlobalAdjList.get(pEdge.getSource().getId()).get(pTimeFrame).remove(pEdge);\n darrGlobalAdjList.get(pEdge.getDestination().getId()).get(pTimeFrame).remove(pEdge);\n \n boolean otherInstances = false;\n for (TimeFrame tf : darrGlobalAdjList.get(pEdge.getSource().getId()).keySet()) {\n if (darrGlobalAdjList.get(pEdge.getSource().getId()).get(tf).contains(pEdge)) {\n otherInstances = true;\n break;\n }\n }\n \n if (!otherInstances) {\n mapAllEdges.remove(pEdge.getId());\n }\n }", "private void source_to_dest_path(int source, int dest, int[] forward_dist_tab, int[] list_Prevoius_Node, ArrayList<Integer> del_router)\n\t{\n\t\tif(del_router != null && del_router.contains(dest))\n\t\t\tSystem.out.println(\"Router \"+ (dest+1) +\" is deleted\");\n\t\telse if(del_router != null && del_router.contains(source))\n\t\t\tSystem.out.println(\"Router \"+ (source+1) +\" is deleted\");\n\t\telse\n\t\t{\n\t\t\tint[] prevNodes_List = list_Prevoius_Node;\n\t\t\tint k = dest;\n\t\t\tString path = \"\" + (dest+1);\n\t\t\t\n\t\t\t//Check if node is reachable that if it is connected in the graph then only proceed further\n\t\t\tif(forward_dist_tab[dest] != INFINITE_DIST)\n\t\t\t{\n\t\t\t\twhile(prevNodes_List[k] != source)\n\t\t\t\t{\n\t\t\t\t\tpath += \" >- \" + (prevNodes_List[k] + 1);\n\t\t\t\t\tk = prevNodes_List[k];\n\t\t\t\t}\n\t\t\t\t//for source node\n\t\t\t\tpath += \" >- \" + (source+1);\n\t\t\t\t\n\t\t\t\t//Back traversal is done using the previous node list\n\t\t\t\tString disp_path= new StringBuilder(path).reverse().toString();\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"\\nShortest distance from \"+ (source+1) +\" to \"+ (dest+1) +\":\");\n\t\t\t\tSystem.out.println(\"PATH: \"+ disp_path);\n\t\t\t\tSystem.out.println(\"COST: \" + forward_dist_tab[dest]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tSystem.out.println(\"\\nRouter \"+ (dest+1) +\" is dead or unreachable.\");\n\t\t\t}\n\t\t}\n\t}", "private void edgeUp(String source, String dest) {\r\n\t\tVertex v = vertexMap.get(source);\r\n\t\tfor (Iterator i = v.adjacent.iterator(); i.hasNext();) {\r\n\t\t\tEdge edge = (Edge) i.next();\r\n\t\t\tif (edge.getDestination().equals(dest))\r\n\t\t\t\tedge.setStatus(true);\r\n\t\t}\r\n\t}", "@Override\n public void removeEdge(E pEdge) {\n for (TimeFrame tf : lstTimeFrameOrdering) {\n if (darrGlobalAdjList.get(pEdge.getSource().getId()).get(tf).contains(pEdge)) {\n hmpGraphsAtTimeframes.get(tf).removeEdge(pEdge);\n darrGlobalAdjList.get(pEdge.getSource().getId()).get(tf).remove(pEdge);\n darrGlobalAdjList.get(pEdge.getDestination().getId()).get(tf).remove(pEdge);\n }\n }\n mapAllEdges.remove(pEdge.getId());\n }", "@Test\r\n void remove_null() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n graph.removeVertex(null);\r\n List<String> adjacent;\r\n vertices = graph.getAllVertices(); \r\n // Check that graph has all added vertexes\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"B\")|\r\n !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (!adjacent.contains(\"B\"))\r\n fail();\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.contains(\"C\"))\r\n fail();\r\n \r\n }", "@Override\n\tpublic node_data removeNode(int key) {\n\t\tif (this.Nodes.get(key) == null) {\n\t\t\treturn null;\n\t\t}\n\n\t\tSet<Integer> edgeKeys = Edges.keySet();\n\t\tfor(Integer node: edgeKeys) {\n\t\t\tif(Edges.get(node).containsKey(key)) \n\t\t\t{\n\t\t\t\tEdges.get(node).remove(key);\n\t\t\t\tnumOfEdges--;\n\t\t\t}\n\t\t}\n\n\t\t// remove all edges coming out of key-node.\n\t\tnumOfEdges -= this.Edges.get(key).values().size();\n\t\tthis.Edges.remove(key);\n\n\n\t\tMC++;\n\n\t\treturn this.Nodes.remove(key);\n\n\t}", "void removeNeighbor(IsisNeighbor isisNeighbor);", "public void removeEdge(int s,int d) throws Exception\r\n\t{\r\n\t\tif(s>=0&&s<n&&d>=0&&d<n)\r\n\t\t{\r\n\t\t\tLinkedList l=g.get(s);\r\n\t\t\tl.deleteMatched(g.get(d).getHead());\r\n\t\t\t\r\n\t\t\t//undirected graph\r\n\t\t\tLinkedList l1=g.get(d);\r\n\t\t\tl1.deleteMatched(g.get(s).getHead());\r\n\t\t}\r\n\t}", "public void testRemoveEdge_edge() {\n System.out.println(\"removeEdge\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n if ((i + j) % 2 != 0) {\n continue;\n }\n\n Assert.assertNotNull(\n graph.removeEdge(new UnweightedEdge(new Integer(i), new Integer(j))));\n Assert.assertFalse(graph.containsEdge(new Integer(i), new Integer(j)));\n }\n }\n }", "private void removeEdges()\r\n\t{\r\n\t final String edgeTypeName = edgeType.getName();\r\n\t for (final Edge e : eSet)\r\n\t\te.getSource().removeEdge(edgeTypeName, e.getDest());\r\n\t eSet.clear();\r\n\t}", "void removeEdges(List<CyEdge> edges);", "@Override\n\tpublic boolean removeVertex(Object value)\n\t{\n\t\tif(this.map.containsKey(value))\n\t\t{\n\t\t\t// remove the value from the map\n\t\t\tthis.map.remove(value);\n\t\t\t// iterate over the map and remove any edges of the value\n\t\t\tfor(Map.Entry<Object, SinglyLinkedList> vertex : map.entrySet())\n\t\t\t\tvertex.getValue().removeNode(value);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "@Override\n public boolean deleteEdge(Edge edge) {\n return false;\n }", "public void testRemoveEdgeEdge( ) {\n init( );\n\n assertEquals( m_g4.edgeSet( ).size( ), 4 );\n m_g4.removeEdge( m_v1, m_v2 );\n assertEquals( m_g4.edgeSet( ).size( ), 3 );\n assertFalse( m_g4.removeEdge( m_eLoop ) );\n assertTrue( m_g4.removeEdge( m_g4.getEdge( m_v2, m_v3 ) ) );\n assertEquals( m_g4.edgeSet( ).size( ), 2 );\n }", "@Override\n\tpublic boolean removeEdge(E vertexX, E vertexY) {\n\t\tUnorderedPair<E> edge = new UnorderedPair<>(vertexX, vertexY);\n\t\treturn edges.remove(edge);\n\t}", "@Test\r\n void test_insert_two_vertice_with_one_edge_remove_edge() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n vertices = graph.getAllVertices();\r\n // B should be an adjacent vertex of A\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n //Check that A and B are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")) {\r\n fail();\r\n }\r\n //There's one edge in the graph\r\n if(graph.size() != 1) {\r\n fail();\r\n }\r\n //Remove edge from A to B\r\n graph.removeEdge(\"A\", \"B\");\r\n // Check that A and B are still in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")) {\r\n fail();\r\n }\r\n // B should not be an adjacent vertex of \r\n if(graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // There are no more edges in the graph\r\n if(graph.size() != 0) {\r\n fail();\r\n }\r\n }", "public void testRemoveEdge_betweenVertices() {\n System.out.println(\"removeEdge\");\n\n Graph<Integer, Edge<Integer>> graph = generateGraph();\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n if ((i + j) % 2 != 0) {\n continue;\n }\n\n Assert.assertNotNull(graph.removeEdge(new Integer(i), new Integer(j)));\n Assert.assertFalse(graph.containsEdge(new Integer(i), new Integer(j)));\n }\n }\n }", "public void removeEdge (E vertex1, E vertex2) throws IllegalArgumentException\n {\n int index1 = this.indexOf (vertex1);\n if (index1 < 0)\n throw new IllegalArgumentException (vertex1 + \" was not found!\");\n \n int index2 = this.indexOf (vertex2);\n if (index2 < 0)\n throw new IllegalArgumentException (vertex2 + \" was not found!\");\n\n\tthis.removeNode (index1, index2);\n this.removeNode (index2, index1);\n }", "public void removeAllEdges() {\n }", "@Override\r\n\tpublic boolean deleteMovieConnection(String actor1, String actor2, String movieName)\r\n\t{\r\n\t\tActor act1 = new Actor(actor1);\r\n\t\tActor act2 = new Actor(actor2);\r\n\t\t\r\n\t\tif(graph.containsEdge(act1,act2 ) == true)\r\n\t\t{\r\n\t\t\tgraph.removeEdge(act1, act2, 1, movieName);\r\n\t\t\t\r\n\t\t\treturn true;\t\t\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public void removeVertex(V toRemove){\n if (toRemove.equals(null)){\n throw new IllegalArgumentException();\n }\n if(contains(toRemove)){\n graph.remove(toRemove);\n }\n for (V vertex : graph.keySet()){\n if (graph.get(vertex).contains(toRemove)){\n ArrayList<V> edges = graph.get(vertex);\n edges.remove(toRemove);\n graph.put(vertex, edges);\n }\n }\n }", "public int checkEdgeDirection(Object src, Object dest)\n\t{\t\t\n\t\tif(this.map.get(src).contains(dest) && !this.map.get(dest).contains(src))\n\t\t\treturn 1;\n\t\telse if(this.map.get(src).contains(dest) && this.map.get(dest).contains(src))\n\t\t\treturn 2;\n\t\treturn 0;\n\t}", "public boolean removeEdge(jq_Field m, Node n) {\n if (addedEdges == null) return false;\n n.removePredecessor(m, this);\n return _removeEdge(m, n);\n }", "public boolean removeEdge(String label1, String label2)\n\t{\n\t\tif(isAdjacent(label1, label2)) //if edge exists remove it\n\t\t{\n\t\t\tDSAGraphVertex vx1 = getVertex(label1), vx2 = getVertex(label2);\n\t\t\tvx1.removeEdge(vx2);\n\t\t\tvx2.removeEdge(vx1);\n\t\t\tedgeCount--;\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "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 }", "@Override\n\tpublic boolean removeEdge(ET edge)\n\t{\n\t\tif (edge == null)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tList<N> adjacentNodes = edge.getAdjacentNodes();\n\t\tfor (N node : adjacentNodes)\n\t\t{\n\t\t\tSet<ET> adjacentEdges = nodeEdgeMap.get(node);\n\t\t\t/*\n\t\t\t * null Protection required in case edge wasn't actually in the\n\t\t\t * graph\n\t\t\t */\n\t\t\tif (adjacentEdges != null)\n\t\t\t{\n\t\t\t\tadjacentEdges.remove(edge);\n\t\t\t}\n\t\t}\n\t\tif (edgeList.remove(edge))\n\t\t{\n\t\t\tgcs.fireGraphEdgeChangeEvent(edge, EdgeChangeEvent.EDGE_REMOVED);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public boolean removeEdge(final LazyRelationship2 edge) {\n Relationship rel = neo.getRelationshipById(edge.getId());\n if (rel != null){\n removeEdge(rel);\n }\n else\n return false;\n return true;\n }", "public void deleteNode(GraphNode node){\n // 1. remove node from list\n graphNodes.remove(node);\n // 2. remove node from all adjacent nodes\n for(GraphNode s: node.getAdjacent()){\n s.removeAdjacent(node);\n }\n }", "private void removeEdgeJointPointSource(Vector<Edge> edges) {\n\t\tfor (Edge e: edges) {\n\t\t\tEdge currentEdge = e;\n\t\t\tremoveEdge(e);\n\t\t\twhile (shapes.contains(currentEdge.getSource()) && currentEdge.getSource() instanceof JoinPoint) {\n\t\t\t\tJoinPoint join = (JoinPoint) currentEdge.getSource();\n\t\t\t\tshapes.remove(join);\n\t\t\t\tcurrentEdge = (Edge) join.getSource();\n\t\t\t\tremoveEdge(currentEdge);\n\t\t\t}\n\t\t}\n\t}", "private void delete(DoublyLinkedNode node) {\n DoublyLinkedNode prev = node.prev;\n DoublyLinkedNode next = node.next;\n prev.next = next;\n next.prev = prev;\n map.remove(node.key);\n }", "protected void clearEdgeMap() {\n\n for (String id : this.edgeMap.keySet()) {\n\n this.ids.remove(id);\n }\n this.edgeMap.clear();\n }", "public void removeEdgeFrom(char v) {\r\n\t\tfor (int i = 0; i < currentVertex.inList.size(); i++) {\r\n\t\t\tNeighbor neighbor = currentVertex.inList.get(i);\r\n\t\t\tif (neighbor.vertex.label == v) {\r\n\t\t\t\t// remove from neighbor's outList\r\n\t\t\t\tneighbor.vertex.outList.remove(findNeighbor(neighbor.vertex.outList, currentVertex.label)); \t\t\r\n\t\t\t\tcurrentVertex.inList.remove(neighbor); // remove from current's inList\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"Edge from \" + v + \" does not exist.\");\r\n\t}", "@Override\n public E removeVertex(E vertex) {\n if (vertex == null || !dictionary.containsKey(vertex)) {\n return null;\n } else {\n for (E opposite : getNeighbors(vertex)) {\n dictionary.get(opposite).remove(vertex);\n }\n dictionary.remove(vertex);\n return vertex;\n }\n }", "public void removeEdge(Position ep) throws InvalidPositionException;", "void removeVert(Pixel toRemove) {\n\n // is the given below this\n if (this.down == toRemove) {\n if (toRemove.right != null) {\n toRemove.right.left = toRemove.left;\n }\n if (toRemove.left != null) {\n toRemove.left.right = toRemove.right;\n }\n }\n\n // is the given downright to this\n else if (this.downRight() == toRemove) {\n if (toRemove.right != null) {\n toRemove.right.left = toRemove.left;\n }\n if (toRemove.left != null) {\n toRemove.left.right = toRemove.right;\n toRemove.left.up = toRemove.up;\n }\n if (toRemove.up != null) {\n toRemove.up.down = toRemove.left;\n }\n }\n\n //is the given downleft to this\n else if (this.downLeft() == toRemove) {\n if (toRemove.right != null) {\n toRemove.right.left = toRemove.left;\n }\n if (toRemove.left != null) {\n toRemove.left.right = toRemove.right;\n }\n if (toRemove.right != null) {\n toRemove.right.up = toRemove.up;\n }\n if (toRemove.up != null) {\n toRemove.up.down = toRemove.right;\n }\n }\n // if the connections were incorrect\n else {\n throw new RuntimeException(\"Illegal vertical seam\");\n }\n }", "public node_info removeNode(int key)\n{\n\tif(getNodes().containsKey(key))\n\t{\n\t\tNode n=(Node)getNode(key);\n\t\t\n\t\tList <Integer> m=n.getNi_k();\n\t\t\n\t\tif(m!=null)\n\t\t{\n for(int i=0;i<m.size();i++)\t\t\t\n\t\t{\n \tint z=m.get(i);\n \t\n\t\t Node h=(Node)getNode(z);\n\t\t h.removeNode(n);\n\t\t\tedge_size--;\n\t\t mc++;\n\t\t}\n \n\t\t}\n\t\t\n\t\t n.getEdgesOf().clear();\n\t\tthis.getNodes().remove(key);\n\t\treturn n;\n\t\t\n\t\t}\n \n\t else {\n\t//\tSystem.out.println(\"key doesnt exist\");\n\t\treturn null;\n\t}\t\n}", "@Override\n\tpublic edge_data getEdge(int src, int dest) {\n\t\tif(Nodes.containsKey(src) && Nodes.containsKey(dest) && Edges.get(src).containsKey(dest)) {\n\t\t\treturn Edges.get(src).get(dest);\n\t\t}\n\t\treturn null;\n\t}", "private void removeEdge() {\n boolean go = true;\n int lastNode;\n int proxNode;\n int atualNode;\n if ((parentMatrix[randomChild][0] != 1) &&\n (childMatrix[randomParent][0] != 1)) {\n lastNode =\n parentMatrix[randomChild][parentMatrix[randomChild][0] - 1];\n for (int i = (parentMatrix[randomChild][0] - 1); (i > 0 && go); i--)\n { // remove element from parentMatrix\n atualNode = parentMatrix[randomChild][i];\n if (atualNode != randomParent) {\n proxNode = atualNode;\n parentMatrix[randomChild][i] = lastNode;\n lastNode = proxNode;\n }\n else {\n parentMatrix[randomChild][i] = lastNode;\n go = false;\n }\n }\n if ((childMatrix[randomParent][0] != 1) &&\n (childMatrix[randomParent][0] != 1)) {\n lastNode = childMatrix[randomParent][\n childMatrix[randomParent][0] - 1];\n go = true;\n for (int i = (childMatrix[randomParent][0] - 1); (i > 0 &&\n go); i--) { // remove element from childMatrix\n atualNode = childMatrix[randomParent][i];\n if (atualNode != randomChild) {\n proxNode = atualNode;\n childMatrix[randomParent][i] = lastNode;\n lastNode = proxNode;\n }\n else {\n childMatrix[randomParent][i] = lastNode;\n go = false;\n }\n } // end of for\n }\n childMatrix[randomParent][(childMatrix[randomParent][0] - 1)] = -4;\n childMatrix[randomParent][0]--;\n parentMatrix[randomChild][(parentMatrix[randomChild][0] - 1)] = -4;\n parentMatrix[randomChild][0]--;\n }\n }", "@Override\n\tpublic boolean removeNode(N node)\n\t{\n\t\tif (node == null)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif (!containsNode(node))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t/*\n\t\t * Note: This method is command sequence sensitive.\n\t\t * \n\t\t * First, the remove (from nodeEdgeMap) below is \"guaranteed\" to work,\n\t\t * since the graph must contain the node (test above) and it is assumed\n\t\t * that the addNode method initialized nodeEdgeMap.\n\t\t * \n\t\t * Second, the use of remove is significant, in that it removes the set\n\t\t * of connected edges from the Map. This is important, since removeEdge\n\t\t * is called from within the loop, and removeEdge will alter sets within\n\t\t * nodeEdgeMap. Therefore, the use of get in place of remove for\n\t\t * creation of this Iterator would result in a\n\t\t * ConcurrentModificationException (since the set for GraphNode gn would\n\t\t * be modified by removeEdge while inside this Iterator).\n\t\t */\n\t\tfor (ET edge : nodeEdgeMap.remove(node))\n\t\t{\n\t\t\t// FUTURE Consider Check of return values here to ensure success??\n\t\t\tremoveEdge(edge);\n\t\t}\n\t\t/*\n\t\t * containsNode test means we don't need to check return value of remove\n\t\t * we 'know' it is present (barring an internal error!). This remove\n\t\t * must happen after removeEdge above, as removeEdge may trigger side\n\t\t * effects that will expect this Node to still be present in the Graph.\n\t\t */\n\t\tnodeList.remove(node);\n\t\tgcs.fireGraphNodeChangeEvent(node, NodeChangeEvent.NODE_REMOVED);\n\t\treturn true;\n\t}", "private static void simplify (GraphDirected<NodeCppOSMDirected, EdgeCppOSMDirected> osmGraph) {\n \t\tfinal Iterator<NodeCppOSMDirected> iteratorNodes = osmGraph.getNodes().iterator();\n \t\twhile (iteratorNodes.hasNext()) {\n \t\t\tfinal NodeCppOSMDirected node = iteratorNodes.next();\n \t\t\t// one in one out\n \t\t\tif (node.getInDegree() == 1 && node.getOutDegree() == 1) {\n \t\t\t\t// get the ids of the two connected nodes\n \t\t\t\tfinal Long currentNodeId = node.getId();\n \t\t\t\tfinal List<EdgeCppOSMDirected> edges = node.getEdges();\n \t\t\t\tfinal EdgeCppOSMDirected edge1 = edges.get(0);\n \t\t\t\tfinal EdgeCppOSMDirected edge2 = edges.get(1);\n \t\t\t\tfinal Long node1id = edge1.getNode1().getId() == (currentNodeId) ? edge2.getNode1().getId() : edge1.getNode1().getId();\n \t\t\t\tfinal Long node2id = edge1.getNode1().getId() == (currentNodeId) ? edge1.getNode2().getId() : edge2.getNode2().getId();\n \t\t\t\tif (node2id == node1id){\n \t\t\t\t\t// we are in a deadend and do not erase ourself\n \t\t\t\t\tcontinue;\n \t\t\t\t}\n \t\t\t\t// concat the list in the right way\n \t\t\t\tList<WayNodeOSM> newMetaNodes = concatMetanodes(edge1.getMetadata().getNodes(), edge2.getMetadata().getNodes(), currentNodeId);\n \t\t\t\t// add a new edge\n \t\t\t\t// TODO: Handle way properly - what would name be in this context?\n \t\t\t\tosmGraph.getNode(node1id).connectWithNodeWeigthAndMeta(osmGraph.getNode(node2id), edge1.getWeight() + edge2.getWeight(),\n \t\t\t\t\t\tnew WayOSM(0, WayOSM.WayType.UNSPECIFIED, \"unknown\", newMetaNodes));\n \t\t\t\t// remove the old node\n \t\t\t\t// do this manually because we otherwise corrupt the iterator\n \t\t\t\tnode.removeAllEdges();\n \t\t\t\titeratorNodes.remove();\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\t// two in two out\n \t\t\tif (node.getInDegree() == 2 && node.getOutDegree() == 2) {\n \t\t\t\tfinal long currentNodeId = node.getId();\n \t\t\t\t//check the connections\n \t\t\t\tArrayList<EdgeCppOSMDirected> incomingEdges = new ArrayList<>();\n \t\t\t\tArrayList<EdgeCppOSMDirected> outgoingEdges = new ArrayList<>();\n \t\t\t\tfor(EdgeCppOSMDirected edge : node.getEdges()) {\n \t\t\t\t\tif(edge.getNode1().getId() == currentNodeId){\n \t\t\t\t\t\toutgoingEdges.add(edge);\n \t\t\t\t\t}\n \t\t\t\t\telse {\n \t\t\t\t\t\tincomingEdges.add(edge);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\t//TODO make this condition better\n \t\t\t\tif(outgoingEdges.get(0).getNode2().equals(incomingEdges.get(0).getNode1())){\n \t\t\t\t\t//out0 = in0\n \t\t\t\t\tif(!outgoingEdges.get(1).getNode2().equals(incomingEdges.get(1).getNode1())){\n \t\t\t\t\t\tcontinue;\n \t\t\t\t\t}\n \t\t\t\t\tif(outgoingEdges.get(0).getWeight() != incomingEdges.get(0).getWeight()){\n \t\t\t\t\t\tcontinue;\n \t\t\t\t\t}\n \t\t\t\t\tif(outgoingEdges.get(1).getWeight() != incomingEdges.get(1).getWeight()){\n \t\t\t\t\t\tcontinue;\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\telse {\n \t\t\t\t\t//out0 should be in1\n \t\t\t\t\t//therefore out1 = in0\n \t\t\t\t\tif(!outgoingEdges.get(0).getNode2().equals(incomingEdges.get(1).getNode1())){\n \t\t\t\t\t\tcontinue;\n \t\t\t\t\t}\n \t\t\t\t\tif(!outgoingEdges.get(1).getNode2().equals(incomingEdges.get(0).getNode1())){\n \t\t\t\t\t\tcontinue;\n \t\t\t\t\t}\n \t\t\t\t\tif(outgoingEdges.get(0).getWeight() != incomingEdges.get(1).getWeight()){\n \t\t\t\t\t\tcontinue;\n \t\t\t\t\t}\n \t\t\t\t\tif(outgoingEdges.get(1).getWeight() != incomingEdges.get(0).getWeight()){\n \t\t\t\t\t\tcontinue;\n \t\t\t\t\t}\n \t\t\t\t}\n \n \t\t\t\t// get the ids of the two connected nodes\n \t\t\t\tfinal NodeCppOSMDirected node1 = incomingEdges.get(0).getNode1();\n \t\t\t\tfinal NodeCppOSMDirected node2 = incomingEdges.get(1).getNode1();\n \t\t\t\t// \t\t\tif (node1.equals(node2)){\n \t\t\t\t// \t\t\t\t// we are in a loop and do not erase ourself\n \t\t\t\t// \t\t\t\tcontinue;\n \t\t\t\t// \t\t\t}\n \t\t\t\t// concat the list in the right way\n \t\t\t\tList<WayNodeOSM> metaNodes1 = incomingEdges.get(0).getMetadata().getNodes();\n \t\t\t\tList<WayNodeOSM> metaNodes2 = incomingEdges.get(1).getMetadata().getNodes();\n \t\t\t\tdouble weight = incomingEdges.get(0).getWeight() +incomingEdges.get(1).getWeight();\n \t\t\t\tList<WayNodeOSM> newMetaNodes = concatMetanodes(metaNodes1, metaNodes2, currentNodeId);\n \t\t\t\t// add a new edge\n \t\t\t\t// TODO: Handle way properly - what would name be in this context?\n \t\t\t\tnode1.connectWithNodeWeigthAndMeta(node2, weight,\n \t\t\t\t\t\tnew WayOSM(0, WayOSM.WayType.UNSPECIFIED, \"unknown\", newMetaNodes));\n \t\t\t\tnode2.connectWithNodeWeigthAndMeta(node1, weight,\n \t\t\t\t\t\tnew WayOSM(0, WayOSM.WayType.UNSPECIFIED, \"unknown\", newMetaNodes));\n \t\t\t\t// remove the old node\n \t\t\t\t// do this manually because we otherwise corrupt the iterator\n \t\t\t\tnode.removeAllEdges();\n \t\t\t\titeratorNodes.remove();\n \t\t\t}\n \t\t}\n \t}", "public void removeEdge(Vertex other) {\n edges.remove(other);\n other.edges.remove(this);\n }", "private void removeCityFromTableEdges(ArrayList<HashMap<Integer,Integer>> table, int index){\n for(int i = 0; i < table.size(); i++){\n if(table.get(i).containsKey(index)){\n table.get(i).remove(index);\n }\n }\n\n return;\n }", "@Override\n public void remove() {\n deleteFromModel();\n deleteEdgeEndpoints();\n\n setDeleted(true);\n if (!isCached()) {\n HBaseEdge cachedEdge = (HBaseEdge) graph.findEdge(id, false);\n if (cachedEdge != null) cachedEdge.setDeleted(true);\n }\n }", "public static void deleteNodeFromGraph(KefedModel m, \n\t\t\tKefedModelElement node) throws Exception {\n\t\t// Make a Vector of all the edges involving this node.\n\t\t//\n\t\tSet<KefedModelEdge> edgeSet = new HashSet<KefedModelEdge>();\n\t\tedgeSet.addAll(node.getIncoming());\n\t\tedgeSet.addAll(node.getOutgoing());\n\n\t\tdeleteEdgeSetFromGraph(m, edgeSet);\n\t\tm.getElements().remove(node);\n\n\t}", "protected void removeEdgeAndVertices(TestbedEdge edge) {\n java.util.Collection<Agent> agents = getIncidentVertices(edge);\n removeEdge(edge);\n for (Agent v : agents) {\n if (getIncidentEdges(v).isEmpty()) {\n removeVertex(v);\n }\n }\n }", "public void removeEdge(int i, int j)\n {\n \tint v = i;\n \tint w = j;\n \t//Create an iterator on the adjacency list of i \n \tIterator<DirectedEdge> it = adj[v].iterator();\n \t//Loop through adj and look for any edge between i and j\n \twhile(it.hasNext())\n \t{\n \t\tDirectedEdge ed = it.next();\n \t\t//If an edge is found, remove it and its reciprocal\n \t\tif(ed.from() == v && ed.to() == w)\n \t\t{\n \t\t\tit.remove();\n \t\t\tit = adj[w].iterator();\n \t\t\twhile(it.hasNext())\n \t\t\t{\n \t\t\t\ted = it.next();\n \t\t\t\tif(ed.from() == w && ed.to() == v)\n \t\t\t\t{\n \t\t\t\t\tit.remove();\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t\n \t} \t\n \tE-=2;\n }", "@Test\n public void testRemoveEdge() throws Exception {\n\n final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();\n\n Graph<Long, Long, Long> graph =\n Graph.fromDataSet(\n TestGraphUtils.getLongLongVertexData(env),\n TestGraphUtils.getLongLongEdgeData(env),\n env);\n\n // duplicate edge should be preserved in output\n graph = graph.addEdge(new Vertex<>(1L, 1L), new Vertex<>(2L, 2L), 12L);\n\n graph = graph.removeEdge(new Edge<>(5L, 1L, 51L));\n\n DataSet<Edge<Long, Long>> data = graph.getEdges();\n List<Edge<Long, Long>> result = data.collect();\n\n expectedResult =\n \"1,2,12\\n\"\n + \"1,2,12\\n\"\n + \"1,3,13\\n\"\n + \"2,3,23\\n\"\n + \"3,4,34\\n\"\n + \"3,5,35\\n\"\n + \"4,5,45\\n\";\n\n compareResultAsTuples(result, expectedResult);\n }", "public synchronized void removeAllFor(String nodeId) {\n\t/* see if this is a remote node */\n\tRoutesMap rl = forwardTable.remove(nodeId);\n\tif (rl == null) {\n\t /* if not, then see if it's a via node */\n\t Set<String> targets = inverseTable.remove(nodeId);\n\t if (targets != null) {\n\t\tfor (String to : targets) {\n\t\t RoutesMap trl = forwardTable.get(to);\n\t\t if (trl != null) {\n\t\t\ttrl.remove(nodeId);\n\t\t\tif (trl.size() == 0) {\n\t\t\t /* if this was the only route, cleanup */\n\t\t\t forwardTable.remove(to);\n\t\t\t}\n\t\t }\n\t\t}\n\t }\n\t}\n }", "public boolean DijkstraHelp(int src, int dest) {\n PriorityQueue<Entry>queue=new PriorityQueue();//queue storages the nodes that we will visit by the minimum tag\n //WGraph_DS copy = (WGraph_DS) (copy());//create a copy graph that the algorithm will on it\n initializeTag();\n initializeInfo();\n node_info first=this.ga.getNode(src);\n first.setTag(0);//distance from itself=0\n queue.add(new Entry(first,first.getTag()));\n while(!queue.isEmpty()) {\n Entry pair=queue.poll();\n node_info current= pair.node;\n if (current.getInfo() != null) continue;//if we visit we can skip to the next loop because we have already marked\n current.setInfo(\"visited\");//remark the info\n Collection<node_info> listNeighbors = this.ga.getV(current.getKey());//create a collection for the neighbors list\n LinkedList<node_info> Neighbors = new LinkedList<>(listNeighbors);//create the neighbors list\n if (Neighbors == null) continue;\n for(node_info n:Neighbors) {\n\n if(n.getTag()>ga.getEdge(n.getKey(),current.getKey())+current.getTag())\n {\n n.setTag(current.getTag() + ga.getEdge(n.getKey(), current.getKey()));//compute the new tag\n }\n queue.add(new Entry(n,n.getTag()));\n }\n }\n Iterator<node_info> it=this.ga.getV().iterator();\n while(it.hasNext()){\n if(it.next().getInfo()==null) return false;\n }\n return true;\n }", "@Test\r\n void add_remove_add() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.addEdge(\"B\",\"D\");\r\n graph.addEdge(\"C\",\"D\");\r\n graph.addEdge(\"D\", \"E\"); \r\n // Check that E is in graph with correct edges\r\n List<String> adjacent = graph.getAdjacentVerticesOf(\"D\");\r\n vertices = graph.getAllVertices(); \r\n if(!vertices.contains(\"E\") | !adjacent.contains(\"E\")) {\r\n fail();\r\n }\r\n //Remove E\r\n graph.removeVertex(\"E\");\r\n if(vertices.contains(\"E\") | adjacent.contains(\"E\")) {\r\n fail();\r\n }\r\n \r\n //Add E back into graph with different edge\r\n graph.addEdge(\"B\", \"E\");\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if(!vertices.contains(\"E\") | !adjacent.contains(\"E\")) {\r\n fail();\r\n }\r\n }", "ArrayMap<Integer,DefinedProperty> nodeDelete( long nodeId );", "public void removeEdge(int indexOne, int indexTwo)\n\t{\n\t\tadjacencyMatrix[indexOne][indexTwo] = false;\n\t\tadjacencyMatrix[indexTwo][indexOne] = false;\n\t}", "public void removeEdgeTo(char v) {\r\n\t\tfor (int i = 0; i < currentVertex.outList.size(); i++) {\r\n\t\t\tNeighbor neighbor = currentVertex.outList.get(i);\r\n\t\t\tif (neighbor.vertex.label == v) {\r\n\t\t\t\t// remove from neighbor's inList\r\n\t\t\t\tneighbor.vertex.inList.remove(findNeighbor(neighbor.vertex.inList, currentVertex.label)); \t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\tcurrentVertex.outList.remove(neighbor); // remove from current's outList\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"Edge to \" + v + \" does not exist.\");\r\n\t}", "public boolean removeEdge(V tail, V head);", "@Test\r\n void remove_nonexistent_vertex() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n graph.removeVertex(\"D\");\r\n List<String> adjacent;\r\n vertices = graph.getAllVertices(); \r\n // Check that graph has all added vertexes\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"B\")|\r\n !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (!adjacent.contains(\"B\"))\r\n fail();\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.contains(\"C\"))\r\n fail();\r\n \r\n }", "@Override\n\tpublic synchronized Arc removeArc(PetrinetNode source, PetrinetNode target) {\n\t\tArc a = this.removeFromEdges(source, target, this.arcs);\n\t\treturn a;\n\t}" ]
[ "0.75740784", "0.74636334", "0.7389449", "0.71872586", "0.7134455", "0.7129233", "0.69454044", "0.69260633", "0.69139874", "0.6910077", "0.6826971", "0.6823037", "0.68208265", "0.6800336", "0.6752877", "0.6734973", "0.66623", "0.6650722", "0.65973306", "0.6585852", "0.6553806", "0.652189", "0.6519313", "0.64874494", "0.64660347", "0.6460839", "0.64477086", "0.6442727", "0.64050776", "0.63725996", "0.6365196", "0.62079346", "0.61947244", "0.61839515", "0.618028", "0.6173395", "0.61612904", "0.6106792", "0.6089041", "0.6083059", "0.6068839", "0.60638964", "0.60556215", "0.6024405", "0.60060334", "0.6000716", "0.59838337", "0.59544367", "0.5953241", "0.595028", "0.5949898", "0.5942643", "0.59379417", "0.5933924", "0.59334564", "0.59293306", "0.5921697", "0.5907743", "0.5898649", "0.5886216", "0.5885163", "0.5862698", "0.5856349", "0.5852752", "0.58511025", "0.5832887", "0.58085024", "0.57944405", "0.5794421", "0.5792748", "0.57893693", "0.5787064", "0.5785364", "0.5780234", "0.5779986", "0.5766962", "0.57667184", "0.5765108", "0.575822", "0.57576936", "0.5752429", "0.5750833", "0.5749421", "0.5748362", "0.57403815", "0.5722987", "0.57173413", "0.5710254", "0.57059085", "0.57045335", "0.5698239", "0.5696767", "0.5685716", "0.56777984", "0.567662", "0.5675911", "0.5672035", "0.56717974", "0.56544805", "0.5633159" ]
0.7784842
0
/ Return all the edges that come out from this vertex (using the HashMap of this vertex).
public Collection<Edge> getE(int node_id) { Collection<Edge> list=new ArrayList<Edge>(); if(getNodes().containsKey(node_id)) { Node n=(Node) getNodes().get(node_id); list.addAll(n.getEdgesOf().values()); } return list; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic Collection<IEdge<S>> getEdges()\n\t{\n\t\tfinal List<IEdge<S>> set = new ArrayList<>(map.size());\n\t\tfor (final Entry<S, Integer> entry : map.entrySet())\n\t\t{\n\t\t\tset.add(createEdge(entry.getKey(), entry.getValue()));\n\t\t}\n\n\t\treturn Collections.unmodifiableCollection(set);\n\t}", "public Collection<Edge> edges() {\n Collection<Collection<Edge>> copyOfEdges = new ArrayList<Collection<Edge>>();\n //values = myGraph.values(); OLD\n //create a copy of all the edges in the map to restrict any reference\n //to interals of this class\n copyOfEdges.addAll(myGraph.values());\n Collection<Edge> allValues = new ArrayList<Edge>();\n Iterator<Collection<Edge>> eachColl = copyOfEdges.iterator();\n while(eachColl.hasNext()){\n allValues.addAll(eachColl.next());\n }\n\n return allValues;\n }", "public HashMap<String, Edge> getEdgeList () {return edgeList;}", "public Iterable<Edge> edges() {\r\n Bag<Edge> list = new Bag<Edge>();\r\n for (int v = 0; v < V; v++) {\r\n for (Edge e : adj(v)) {\r\n list.add(e);\r\n }\r\n }\r\n return list;\r\n }", "public List<IEdge> getAllEdges();", "List<IEdge> getAllEdges();", "@Override\n\tpublic List<Edge> getAllMapEdges() {\n\n\t\tList<Edge> res = new ArrayList<Edge>();\n\t\tResultSet resultSet = null;\n\n\t\ttry {\n\t\t\tString getAllEdges = \"SELECT node_from, node_to, distance FROM routefinder.maprelations\";\n\t\t\tresultSet = null;\n\t\t\tpstmt = conn.prepareStatement(getAllEdges);\n\t\t\tresultSet = pstmt.executeQuery();\n\t\t\twhile (resultSet.next()) {\n\t\t\t\tEdge edge = new Edge();\n\t\t\t\tedge.setNode1(Database.getNodeFromId(resultSet.getInt(\"node_from\")));\n\t\t\t\tedge.setNode2(Database.getNodeFromId(resultSet.getInt(\"node_to\")));\n\t\t\t\tedge.setDist(resultSet.getDouble(\"distance\"));\n\t\t\t\tres.add(edge);\n\t\t\t}\n\t\t\treturn res;\n\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\tJdbcConnect.resultClose(resultSet, pstmt);\n\t\t}\n\n\t\treturn null;\n\t}", "@Override\n public Collection<? extends IEdge> getEdges() {\n\n return new LinkedList<>(Collections.unmodifiableCollection(this.edgeMap\n .values()));\n }", "public Map<String, Edge> edges() {\n return this.edges;\n }", "public Iterable<DirectedEdge> edges() {\n ArrayList<DirectedEdge> list = new ArrayList<DirectedEdge>();\n for (int v = 0; v < V; v++) {\n for (DirectedEdge e : adj(v)) {\n list.add(e);\n }\n }\n return list;\n }", "public HashMap<Integer, edge_data> getNeighborEdges() {\n return this.neighborEdges;\n }", "public Set<Eventable> getAllEdges() {\n\t\treturn sfg.edgeSet();\n\t}", "public Edge[] getEdges()\r\n {\r\n if(edges == null)\r\n\t{\r\n\t edges = new Edge[numEdges()];\r\n\t int i = 0;\r\n\t for (final EdgeTypeHolder eth : ethMap.values())\r\n\t\tfor (final Edge e : eth.getEdges())\r\n\t\t edges[i++] = e;\r\n\t}\r\n return edges.clone();\r\n }", "public static ArrayList<Edge> getAllEdges(){\n\t\treturn edgeList;\n\t}", "public Set<E> getEdges();", "public HashMap<Integer, edge_data> getEdgesConnectedToThisNode() {\n return this.edgesConnectedToThisNode;\n }", "public Map<V,List<E>> adjacencyMap(){\n\t\tMap<V,List<E>> ret = new HashMap<V,List<E>>();\n\t\tfor (E e : edges){\n\t\t\tif (virtualEdges.contains(e))\n\t\t\t\tcontinue;\n\t\t\tList<E> list;\n\t\t\tif (!ret.containsKey(e.getOrigin())){\n\t\t\t\tlist = new ArrayList<E>();\n\t\t\t\tret.put(e.getOrigin(), list);\n\t\t\t}\n\t\t\telse\n\t\t\t\tlist = ret.get(e.getOrigin());\n\t\t\tlist.add(e);\n\t\t\t\n\t\t\tif (!ret.containsKey(e.getDestination())){\n\t\t\t\tlist = new ArrayList<E>();\n\t\t\t\tret.put(e.getDestination(), list);\n\t\t\t}\n\t\t\telse\n\t\t\t\tlist = ret.get(e.getDestination());\n\t\t\tlist.add(e);\n\t\t}\n\t\treturn ret;\n\t}", "@Override\n\tpublic List<Edge> getAllEdges() {\n\n\t\tList<Edge> res = new ArrayList<Edge>();\n\t\tResultSet resultSet = null;\n\n\t\ttry {\n\t\t\tString getAllEdges = \"SELECT node_from, node_to, distance FROM routefinder.relations\";\n\t\t\tresultSet = null;\n\t\t\tpstmt = conn.prepareStatement(getAllEdges);\n\t\t\tresultSet = pstmt.executeQuery();\n\t\t\twhile (resultSet.next()) {\n\t\t\t\tEdge edge = new Edge();\n\t\t\t\tedge.setNode1(Database.getNodeFromId(resultSet.getInt(\"node_from\")));\n\t\t\t\tedge.setNode2(Database.getNodeFromId(resultSet.getInt(\"node_to\")));\n\t\t\t\tedge.setDist(resultSet.getDouble(\"distance\"));\n\t\t\t\tres.add(edge);\n\t\t\t}\n\n\t\t\treturn res;\n\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\tJdbcConnect.resultClose(resultSet, pstmt);\n\t\t}\n\n\t\treturn null;\n\t}", "Collection<E> edges();", "private ArrayList<Integer> getCityEdges(HashMap<Integer,Integer> table){\n ArrayList<Integer> edges = new ArrayList<Integer>();\n edges.addAll(table.keySet());\n return edges;\n }", "public Vector<Edge> getEdges(){\n\t\treturn this.listOfEdges;\n\t}", "public Iterable<Edge> edges() {\r\n\t\treturn mst;\r\n\t}", "public Set<Edge<V>> getEdges(V vertex);", "@Override\r\n public Collection<edge_data> getE(int node_id) {\r\n return this.neighbors.get(node_id).values(); //o(k)\r\n }", "public Map<String, IEdge> getEdgeMap() {\n\n return Collections.unmodifiableMap(edgeMap);\n }", "@Override\n public Collection<edge_data> getE(int node_id) {\n return ((NodeData) this.nodes.get(node_id)).getNeighborEdges().values();\n }", "public abstract Set<? extends EE> edgesOf(VV vertex);", "ArrayList<Edge> getEdges(ArrayList<ArrayList<Vertex>> v) {\n ArrayList<Edge> all = new ArrayList<Edge>();\n for (ArrayList<Vertex> verts : v) {\n for (Vertex vt : verts) {\n for (Edge ed : vt.outEdges) {\n all.add(ed);\n }\n }\n }\n return all;\n }", "public abstract List<? extends GraphEdge<N, E>> getEdges();", "Map<Node, Edge> getInEdges() {\n return inEdges;\n }", "public abstract ArrayList<Pair<Vector2, Vector2>> getEdges();", "public HashSet<Edge> getEdges() {\n\t\treturn edges;\n\t}", "public List<Edge> findAllEdge() throws SQLException {\n\t\treturn rDb.findAllEdges();\n\t}", "@Override\n public Collection<? extends IHyperEdge> getHyperEdges() {\n\n return new LinkedList<>(\n Collections.unmodifiableCollection(this.hyperEdgeMap.values()));\n }", "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 }", "default Iterator<E> edgeIterator() {\n return getEdges().iterator();\n }", "public Collection<LazyRelationship2> getEdges() {\n long relCount=0;\n ArrayList l = new ArrayList();\n \n for(Path e : getActiveTraverser()){\n for(Path p : getFlushTraverser(e.endNode())){\n if((relCount++%NEO_CACHE_LIMIT)==0){\n l.add(p.lastRelationship());\n clearNeoCache();\n }\n }\n }\n return l; \n }", "public Set<JmiAssocEdge> getAllOutgoingAssocEdges(JmiClassVertex vertex)\n {\n return getClassAttributes(vertex).allOutgoingAssocEdges;\n }", "public Iterator<Edge> getEdgeIter() {\n\t\treturn edges.iterator();\n\t}", "@Override\r\n public Iterable<V> vertices() {\r\n LinkedList<V> list = new LinkedList<>();\r\n for(V v : map.keySet())\r\n list.add(v);\r\n return list;\r\n }", "private Collection<Edge> getEdges()\r\n\t{\r\n\t return eSet;\r\n\t}", "@Override\n public Iterable<E> getAllVertices() {\n return dictionary.keySet();\n }", "public Set<Edge<V>> edgeSet();", "public Set<Pair<V,V>> neighbourEdgesOf(V vertex);", "public ArrayList< Edge > incidentEdges( ) {\n return incidentEdges;\n }", "public Map<String, String> getEdge() {\n\t\tif (edge == null) {\n\t\t\tsetEdge(new HashMap<String, String>());\n\t\t}\n\t\treturn edge;\n\t}", "private ArrayList<Edge>getFullyConnectedGraph(){\n\t\tArrayList<Edge> edges = new ArrayList<>();\n\t\tfor(int i=0;i<nodes.size();i++){\n\t\t\tfor(int j=i+1;j<nodes.size();j++){\n\t\t\t\tEdge edge = new Edge(nodes.get(i), nodes.get(j),Utils.distance(nodes.get(i), nodes.get(j)));\n\t\t\t\tedges.add(edge);\n\t\t\t}\n\t\t}\n\t\treturn edges;\n\t}", "public Set<List<List<String>>> getEdges()\n\t\t{\n\t\t\treturn m_hyperedges;\n\t\t}", "public ArrayList<DrawableGraphEdge> getEdges() {\r\n\t\treturn new ArrayList<DrawableGraphEdge>(edges);\r\n\t}", "Map<Node, Edge> getOutEdges() {\n return outEdges;\n }", "public ArrayList<Edge> getListEdges(){\r\n return listEdges;\r\n }", "public Collection<Vertex> vertices() { \n //return myGraph.keySet(); OLD\n //create a copy of all the vertices in the map to restrict any reference\n //to the interals of this class\n Collection<Vertex> copyOfVertices = new ArrayList<Vertex>();\n copyOfVertices.addAll(myGraph.keySet());\n return copyOfVertices;\n }", "@Override\n\tpublic synchronized Set<PetrinetEdge<? extends PetrinetNode, ? extends PetrinetNode>> getEdges() {\n\t\tSet<PetrinetEdge<? extends PetrinetNode, ? extends PetrinetNode>> edges = new HashSet<PetrinetEdge<? extends PetrinetNode, ? extends PetrinetNode>>();\n\t\tedges.addAll(this.arcs);\n\t\treturn edges;\n\t}", "public Edge[] getEdges() {\n\t\treturn edges;\n\t}", "String getEdges();", "public ArrayList<V> getEdges(V vertex){\n return (ArrayList<V>) graph.get(vertex);\n }", "@Override\r\n\tpublic Iterable<EntityGraphEdge> getEdges()\r\n\t{\n\t\treturn null;\r\n\t}", "public DEdge[] getEdges(){\n return listOfEdges;\n }", "public List<EdgeType> getEdges()\n {\n return edges;\n }", "public Set<JmiAssocEdge> getAllIncomingAssocEdges(JmiClassVertex vertex)\n {\n return getClassAttributes(vertex).allIncomingAssocEdges;\n }", "public Set<E> getEdges(V tail);", "public Set getNonEscapingEdges() {\n if (addedEdges == null) return Collections.EMPTY_SET;\n return addedEdges.entrySet();\n }", "public Collection< EDataT > edgeData();", "Set<CyEdge> getExternalEdgeList();", "@Override\n\tpublic Collection<edge_data> getE(int node_id) {\n\t\t// TODO Auto-generated method stub\n\t\treturn Edges.get(node_id).values();\n\t}", "public ArrayList<Edge> getAdjacencies(){\r\n return adjacencies;\r\n }", "public DSALinkedList<DSAGraphEdge<E>> getAdjacentEdges()\n {\n return edgeList;\n }", "List<CyEdge> getInternalEdgeList();", "public Enumeration edges();", "Iterable<Long> vertices() {\n return nodes.keySet();\n }", "public HashMap<Integer, Vertex> getVertices() {\n\t\treturn vertices;\n\t}", "ArrayList<Edge> getAdjacencies();", "List<Edge<V>> getEdgeList();", "@Override\n\tpublic Set<ET> getAdjacentEdges(N node)\n\t{\n\t\t// implicitly returns null if gn is not in the nodeEdgeMap\n\t\tSet<ET> adjacentEdges = nodeEdgeMap.get(node);\n\t\treturn adjacentEdges == null ? null : new HashSet<ET>(adjacentEdges);\n\t}", "public ArrayList<GraphEdge> getEdges() {\n return selectedEdges;\n }", "public ArrayList<Edge> getEdgeList() {\n return edgeList;\n }", "public LinkedList<Edgeq> getAllEdges(String node) {\n return this.graph.get(node);\n }", "public Collection<E> getChildEdges(V vertex);", "public Iterator<LayoutEdge> edgeIterator() {\n\treturn edgeList.iterator();\n }", "public Set getAccessPathEdges() {\n if (accessPathEdges == null) return Collections.EMPTY_SET;\n return accessPathEdges.entrySet();\n }", "public List<? super Object> getEdgeValues(Node<A> n) {\n\t\t\n\t\tif (g == null) return null;\n\t\t\n\t\tList<? super Object> s = new LinkedList<>();\n\t\t\n\t\tif(isConnectedTo(n)) {\n\t\t\t\n\t\t\tfor(Object o: g.getEdges()) {\n\t\t\t\tif(((Edge<?>)o).getFrom().equals(this) && ((Edge<?>)o).getTo().equals(n)) {\n\t\t\t\t\ts.add( ((Edge<?>)o).getData() );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n return s;\n\t\n\t}", "Iterable<Long> vertices() {\n //YOUR CODE HERE, this currently returns only an empty list.\n ArrayList<Long> verticesIter = new ArrayList<>();\n verticesIter.addAll(adj.keySet());\n return verticesIter;\n }", "public ArrayList<Edge> generateEdges(Map<String, ArrayList<String>> temp) {\n\r\n\t\tObject[] ckeys = temp.keySet().toArray();\r\n\t\tArrayList<Edge> result = new ArrayList<Edge>();\r\n\t\tfor (int i = 0; i < ckeys.length; i++) {\r\n\t\t\tfor (int x = 0; x < temp.get(ckeys[i]).size(); x++) {\r\n\t\t\t\tfor (int y = x + 1; y < temp.get(ckeys[i]).size(); y++) {\r\n\t\t\t\t\tHashSet<String> s = new HashSet<String>();\r\n\t\t\t\t\ts.add(temp.get(ckeys[i]).get(x));\r\n\t\t\t\t\ts.add(temp.get(ckeys[i]).get(y));\r\n\t\t\t\t\tresult.add(new Edge(s.toArray()[0].toString(), s.toArray()[1].toString()));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tremoveDuplicates(result);\r\n\t\treturn result;\r\n\t}", "public Set<V> getNeighbours(V vertex);", "public Set getNonEscapingEdgeFields() {\n if (addedEdges == null) return Collections.EMPTY_SET;\n return addedEdges.keySet();\n }", "Iterator<Vertex<V, E, M>> getVertices() {\n return this.vertices.values().iterator();\n }", "public Iterable<K> neighbors(K v)\n {\n \n return adjMaps.get(v).keySet();\n }", "public void buildEdges(){\n\t\tfor(Entry<HexLocation, TerrainHex> entry : hexes.entrySet()){\n\t\t\t\n\t\t\tEdgeLocation edgeLoc1 = new EdgeLocation(entry.getKey(), EdgeDirection.NorthWest);\n\t\t\tEdge edge1 = new Edge(edgeLoc1);\n\t\t\tedges.put(edgeLoc1, edge1);\n\t\t\t\n\t\t\tEdgeLocation edgeLoc2 = new EdgeLocation(entry.getKey(), EdgeDirection.North);\n\t\t\tEdge edge2 = new Edge(edgeLoc2);\n\t\t\tedges.put(edgeLoc2, edge2);\n\t\t\t\n\t\t\tEdgeLocation edgeLoc3 = new EdgeLocation(entry.getKey(), EdgeDirection.NorthEast);\n\t\t\tEdge edge3 = new Edge(edgeLoc3);\n\t\t\tedges.put(edgeLoc3, edge3);\n\t\t\t\n\t\t\tEdgeLocation edgeLoc4 = new EdgeLocation(entry.getKey(), EdgeDirection.SouthEast);\n\t\t\tEdge edge4 = new Edge(edgeLoc4);\n\t\t\tedges.put(edgeLoc4, edge4);\n\t\t\t\n\t\t\tEdgeLocation edgeLoc5 = new EdgeLocation(entry.getKey(), EdgeDirection.South);\n\t\t\tEdge edge5 = new Edge(edgeLoc5);\n\t\t\tedges.put(edgeLoc5, edge5);\n\t\t\t\n\t\t\tEdgeLocation edgeLoc6 = new EdgeLocation(entry.getKey(), EdgeDirection.SouthWest);\n\t\t\tEdge edge6 = new Edge(edgeLoc6);\n\t\t\tedges.put(edgeLoc6, edge6);\n\t\t}\n\t}", "public Set<JmiAssocEdge> getInheritedOutgoingAssocEdges(\n JmiClassVertex vertex)\n {\n return getClassAttributes(vertex).inheritedOutgoingAssocEdges;\n }", "public Map<String, IHyperEdge> getHyperEdgeMap() {\n\n return Collections.unmodifiableMap(hyperEdgeMap);\n }", "@Override\n public List<E> getEdges(V v, TimeFrame pTimeFrame) {\n List<E> lstEdges = new ArrayList<>();\n for (E e : darrGlobalAdjList.get(v.getId()).get(pTimeFrame)) {\n lstEdges.add(e);\n }\n return lstEdges;\n }", "public Set getAccessPathEdgeFields() {\n if (accessPathEdges == null) return Collections.EMPTY_SET;\n return accessPathEdges.keySet();\n }", "List<WeightedEdge<Vertex>> neighbors(Vertex v);", "public List<Piece> getEdges() {\n List<Piece> result = new ArrayList<>();\n result.add(_board[0][1]);\n result.add(_board[1][0]);\n result.add(_board[1][2]);\n result.add(_board[2][1]);\n return result;\n }", "List<GraphEdge> getNeighbors(NodeKey key);", "@Override\r\n\tpublic ArrayList<E> getAdjacent(E key) {\r\n\t\tArrayList<E> adj = new ArrayList<>();\r\n\t\tif(containsVertex(key)) {\r\n\t\t\tfor(Edge<E> ale : adjacencyLists.get(key)) {\r\n\t\t\t\tadj.add(ale.getDst());\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn adj;\r\n\t}", "public ArrayList< Vertex > adjacentVertices( ) {\n return adjacentVertices;\n }", "@Override\r\n public Collection<node_data> getV() {\r\n return this.graph.values();\r\n }", "Set<Edge> getIncomingNeighborEdges(boolean onUpwardPass) {\n//\t\t\tif(_outgoingEdges.size() == 0) { // only compute if we have to\n\t\t\t\tSet<Edge> outgoingEdges = new HashSet<Edge>();\n\t\t\t\tIterator<Edge> it = _neighborEdges.keySet().iterator();\n\t\t\t\twhile(it.hasNext()) {\n\t\t\t\t\tEdge e = it.next();\n\t\t\t\t\tVertex v = e.getOtherVertex(this);\n\t\t\t\t\tif(this._orderID == UNMARKED) {\n\t\t\t\t\t\tSystem.err.println(\"whoops i am unmarked\");\n\t\t\t\t\t}\n\t\t\t\t\tif(v._orderID == UNMARKED) {\n\t\t\t\t\t\tSystem.err.println(\"whoops neighbor unmarked\");\n\t\t\t\t\t}\n\t\t\t\t\tif(this._orderID < v._orderID) {\n\t\t\t\t\t\toutgoingEdges.add(e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t_outgoingEdges = outgoingEdges;\n//\t\t\t}\n//\t\t\treturn _outgoingEdges;\n\t\t\t\treturn outgoingEdges;\n\t\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic ArrayList<Node<A>> neighbours(){\n\t\t\n\t\tArrayList<Node<A>> output = new ArrayList<Node<A>>();\n\t\t\n\t\tif (g == null) return output;\n\t\t\n\t\tfor (Object o: g.getEdges()){\n\n\t\t\t\n\t\t\tif (((Edge<?>)o).getTo().equals(this)) {\n\t\t\t\t\n\t\t\t\tif (!output.contains(((Edge<?>)o).getFrom()))\n\t\t\t\t\t\toutput.add((Node<A>) ((Edge<?>)o).getFrom());\n\t\t\t\t\n\t\t\t}\n\n\t\t} \n\t\treturn output;\n\t\t\n\t}" ]
[ "0.75808024", "0.75000757", "0.7476098", "0.73911464", "0.7343934", "0.72885776", "0.7280025", "0.72197306", "0.7161359", "0.71592027", "0.712976", "0.7117119", "0.71117073", "0.70708895", "0.705582", "0.70486313", "0.7042324", "0.7008303", "0.70058686", "0.6998256", "0.69034684", "0.68955463", "0.6891863", "0.68871194", "0.6873219", "0.6867633", "0.6826157", "0.68210936", "0.68103296", "0.68029577", "0.6801569", "0.67906165", "0.6749088", "0.67221886", "0.6720876", "0.6688154", "0.6656407", "0.66472894", "0.6647061", "0.66290385", "0.6616418", "0.6616051", "0.6604987", "0.6595625", "0.659247", "0.6572119", "0.6547972", "0.65268785", "0.65122604", "0.65062165", "0.6502926", "0.64927614", "0.64724034", "0.6470717", "0.6457264", "0.64377475", "0.64137876", "0.6406972", "0.63937336", "0.6360509", "0.6357927", "0.6352554", "0.6344567", "0.63392836", "0.63353455", "0.6329244", "0.63186556", "0.62958515", "0.6292116", "0.6284287", "0.6283329", "0.62722445", "0.62671", "0.6259994", "0.6251392", "0.6241421", "0.6238119", "0.62220746", "0.6221877", "0.62018526", "0.6200658", "0.6194646", "0.61870706", "0.618401", "0.61706805", "0.6166911", "0.61577064", "0.61452633", "0.61364955", "0.613609", "0.61335546", "0.61312747", "0.61252534", "0.6111313", "0.61073375", "0.6091135", "0.60845524", "0.60774827", "0.6067198", "0.6040725" ]
0.6596639
43
/ Getters and Setters
public int nodeSize() { return getNodes().size(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract Set method_1559();", "@Override\r\n\tpublic void get() {\n\t\t\r\n\t}", "@Override\n public void get() {}", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "public void setdat()\n {\n }", "public void get() {\n }", "@Override\n\tpublic void getData() {\n\t\t\n\t}", "String setValue();", "public void setAge(int age) { this.age = age; }", "public int getAge() {return age;}", "@Override\n String get();", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "private void assignment() {\n\n\t\t\t}", "@Override\n\n // <editor-fold defaultstate=\"collapsed\" desc=\" UML Marker \"> \n // #[regen=yes,id=DCE.E1700BD9-298C-DA86-4BFF-194B41A6CF5E]\n // </editor-fold> \n protected String getProperties() {\n\n return \"Size = \" + size + \", Index = \" + value;\n\n }", "@Test\r\n\tpublic void testGettersSetters()\r\n\t{\r\n\t\tPerson p = new Person(42);\r\n\t\tp.setDisplayName(\"Fred\");\r\n\t\tassertEquals(\"Fred\", p.getFullname());\r\n\t\tp.setPassword(\"hunter2\");\r\n\t\tassertEquals(\"hunter2\", p.getPassword());\r\n\t\tassertEquals(42, p.getID());\r\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "private PropertyAccess() {\n\t\tsuper();\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "private ReadProperty()\r\n {\r\n\r\n }", "public abstract String get();", "public String get();", "@Test\n public void testSongGettersSetters() {\n Integer id = 4;\n String title=\"title\",uri = \"uri\";\n\n Song song = new Song();\n song.setId(id);\n song.setTitle(title);\n song.setUri(uri);\n\n assertEquals(\"Problem with id\",id, song.getId());\n assertEquals(\"Problem with title\",title, song.getTitle());\n assertEquals(\"Problem with uri\",uri, song.getUri());\n }", "public void Data(){\n\t\t\t\t\t\t\n\t\t\t\t\t}", "@Override\n\tpublic void set() {\n\t\tSystem.out.println(\"A==========set\");\n\t}", "@Override\npublic void setAttributes() {\n\t\n}", "@Override\n\tpublic void setData() {\n\n\t}", "public void setName(String name){this.name=name;}", "public String getName () { return this.name; }", "private void setData() {\n\n }", "@Override\n //Method for getting output from String declaration\n //First set of accessor/mutator that returns value as String\n public String toString(){\n return \"[\"+name+\",\"+type+\",\"+value+\"]\";\n }", "public int getAge(){\n return age;\n }", "public int getlife(){\r\n return life;\r\n}", "String getName(){return this.name;}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "public int getAge()\r\n {\r\n return age;\r\n }", "@Override\n\tpublic void initValue() {\n\t\t\n\t}", "public Student getStudent() { return student; }", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public Book getBook() \t\t{ return this.myBook; }", "public int getSet() {\n return set;\n }", "public String getValue() {\n/* 99 */ return this.value;\n/* */ }", "public String getAuthor(){return author;}", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "public void setNombre(String nombre) {\r\n\tthis.nombre = nombre;\r\n}", "public void set() {\r\n\t\tage = 19;\r\n\t\tname = \"ΎΛ·»\";\r\n\t\theight = 161;\r\n\t\tsetWeight(50);\r\n\t\tSystem.out.println(getWeight());\r\n\t}", "public void setNombre(String nombre) {this.nombre = nombre;}", "@Override\n protected void updateProperties() {\n }", "public int\t\tget() { return value; }", "@Override\n\tprotected void initdata() {\n\n\t}", "private Attributes getAttributes()\r\n\t{\r\n\t return attributes;\r\n\t}", "public String getName(){return this.name;}", "public String getNombre()\r\n/* 17: */ {\r\n/* 18:41 */ return this.nombre;\r\n/* 19: */ }", "public void setPrice(double price){this.price=price;}", "public String get()\n {\n return this.string;\n }", "@Override\n public void memoria() {\n \n }", "public int get () { return rating; }", "public int getNumber(){return number;}", "@Test\r\n\tpublic void gettersSettersTest() {\r\n\t\tItem item = new Item();\r\n\t\titem.setCount(NUMBER);\r\n\t\tassertEquals(item.getCount(), NUMBER);\r\n\t\titem.setDescription(\"word\");\r\n\t\tassertEquals(item.getDescription(), \"word\");\r\n\t\titem.setId(NUMBER);\r\n\t\tassertEquals(item.getId(), NUMBER);\r\n\t\titem.setName(\"word\");\r\n\t\tassertEquals(item.getName(), \"word\");\r\n\t\titem.setPicture(\"picture\");\r\n\t\tassertEquals(item.getPicture(), \"picture\");\r\n\t\titem.setPrice(FLOATNUMBER);\r\n\t\tassertEquals(item.getPrice(), FLOATNUMBER, 0);\r\n\t\titem.setType(\"word\");\r\n\t\tassertEquals(item.getType(), \"word\");\r\n\t\titem.setSellerId(NUMBER);\r\n\t\tassertEquals(item.getSellerId(), NUMBER);\r\n\t\titem.setDeleted(false);\r\n\t\tassertEquals(item.isDeleted(), false);\r\n\t\titem.setDeleted(true);\r\n\t\tassertEquals(item.isDeleted(), true);\t\t\r\n\t}", "public int getArmadura(){return armadura;}", "@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 Get() {}", "private Get() {}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "public int getValue() {\n/* 450 */ return this.value;\n/* */ }", "@Override\n\tprotected void getDataFromUCF() {\n\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "@Override\n void init() {\n }", "Constructor() {\r\n\t\t \r\n\t }", "public void setName(String name){this.name = name;}", "public String getID(){return ID;}", "public String getNombre()\r\n/* 113: */ {\r\n/* 114:204 */ return this.nombre;\r\n/* 115: */ }", "public int getAge()\n {\n return age;\n }", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\r\n public String toString() {\n return super.toString();\r\n }", "public String getNombre()\r\n/* 60: */ {\r\n/* 61: 67 */ return this.nombre;\r\n/* 62: */ }", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "public int getSpeed(){return this.speed;}", "@Override\r\n public String toString() {\n return super.toString();\r\n }", "public Address getAddress() { return address; }", "public Property() {\n\t\tcity=\"\";\n\t\towner=\"\";\n\t\tpropertyName=\"\";\n\t\trentAmount=0;\n\t\tplot= new Plot(0,0,1,1);\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "public int getID(){\r\n return this.ID;\r\n }", "@Override\n public void init() {\n\n }", "public Object get()\n {\n return m_internalValue;\n }", "public contrustor(){\r\n\t}", "@Override\n\tpublic void get() {\n\t\tSystem.out.println(\"this is get\");\n\t}", "public int getAge() {\n\t \t return age; \n\t}", "public int getID() {return id;}", "public int getID() {return id;}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n public String getName(){\n return Name; \n }" ]
[ "0.6793725", "0.66366845", "0.65605664", "0.6458844", "0.62827885", "0.62158823", "0.6172911", "0.6113601", "0.6080991", "0.6030207", "0.6002496", "0.5975091", "0.5970083", "0.5950412", "0.5937579", "0.5934836", "0.59142685", "0.58957744", "0.58908737", "0.5822043", "0.5812604", "0.5809381", "0.5805087", "0.5786151", "0.57823426", "0.57813966", "0.5779668", "0.57796574", "0.57739985", "0.57702976", "0.5769969", "0.5767517", "0.575942", "0.5748914", "0.57404006", "0.57390344", "0.57386243", "0.57373506", "0.5732063", "0.5732063", "0.57259893", "0.5719739", "0.5716365", "0.5705557", "0.5704296", "0.57038873", "0.57000136", "0.56986856", "0.5696958", "0.5690038", "0.56890017", "0.5683239", "0.56801784", "0.56775624", "0.5675799", "0.56746566", "0.567173", "0.5670147", "0.5668128", "0.5667259", "0.566412", "0.5661305", "0.5661305", "0.5661305", "0.5661305", "0.5661305", "0.5661305", "0.5660915", "0.5660915", "0.56586707", "0.5658438", "0.56574017", "0.56551", "0.5650174", "0.56477344", "0.5647635", "0.5646921", "0.5641813", "0.5639724", "0.5638998", "0.563241", "0.563241", "0.5632046", "0.56319904", "0.5629861", "0.5628003", "0.56270075", "0.5623952", "0.5617057", "0.561569", "0.56149846", "0.5609549", "0.5605957", "0.56028116", "0.5601337", "0.5592309", "0.559039", "0.55902654", "0.55902654", "0.55890274", "0.55886495" ]
0.0
-1
Log error here since request failed progressDialog.dismiss();
@Override public void onFailure(Call<Menumodel> call, Throwable t) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n public void onFailure(@NonNull Exception exception) {\n progressDialog.dismiss();\r\n\r\n //and displaying error message\r\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\r\n }", "@Override\n public void onFailure(@NonNull Exception e) {\n if (progressDialog.isShowing()) {\n progressDialog.dismiss();\n }\n\n showErrorMessageDialogue(\"Some error just happened. \" +\n \"Please try again in a little bit.\");\n\n }", "@Override\n public void onFailure(@NonNull Exception exception) {\n progressDialog.dismiss();\n //and displaying error message\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\n }", "@Override\n public void onFailure(@NonNull Exception exception) {\n progressDialog.dismiss();\n\n //and displaying error message\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\n }", "@Override\n public void onFailure(@NonNull Exception exception) {\n progressDialog.dismiss();\n\n //and displaying error message\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\n }", "@Override\n public void onFailure(@NonNull Exception exception) {\n progressDialog.dismiss();\n\n //and displaying error message\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\n }", "@Override\n public void onFailure(@NonNull Exception exception) {\n progressDialog.dismiss();\n\n //and displaying error message\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\n }", "@Override\n public void onFailure(@NonNull Exception exception) {\n progressDialog.dismiss();\n\n //and displaying error message\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n progressDialog.dismiss();\n Toast.makeText(getActivity(), \"An error occured\", Toast.LENGTH_SHORT).show();\n }", "@Override\n public void onHTTPerror(String tag) {\n progressDialog.cancel();\n CharSequence text = \"C'è stato un problema, riprova!\";\n Toast toast = Toast.makeText(getActivity(), text, Toast.LENGTH_SHORT);\n toast.show();\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n error.printStackTrace();\n customProgressDialog.cancel();\n }", "@Override\n public void onFailure(@NonNull Exception exception) {\n progressDialog.dismiss();\n\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n progressDialog.dismiss();\n Toast.makeText(AddKostActivity.this, error.getMessage(), Toast.LENGTH_SHORT).show();\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n progressDialog.dismiss();\n Toast.makeText(EditProfile.this, error.getMessage(), Toast.LENGTH_SHORT).show();\n }", "@Override\n public void failure(RetrofitError error) {\n Toast.makeText(getActivity(), error.toString(), Toast.LENGTH_LONG).show();\n progressDialog.dismiss(); //dismiss progress dialog\n\n }", "@Override\n public void onFailure(int statusCode, Header[] headers, byte[] errorResponse, Throwable e) {\n progress.dismiss();\n }", "@Override\n public void onErrorResponse(VolleyError volleyError) {\n progressDialog.dismiss();\n // Showing error message if something goes wrong.\n Toast.makeText(ClaimStatusActivity.this, volleyError.toString(), Toast.LENGTH_LONG).show();\n }", "@Override\r\n public void onFailure(int statusCode, Header[] headers, byte[] errorResponse, Throwable e) {\n progress.dismiss();\r\n e.printStackTrace();\r\n\r\n }", "@Override\n public void onGetNeighborsError(VolleyError error) {\n if (progressDialog.isShowing()) {\n progressDialog.dismiss();\n takeAction();\n }\n }", "@Override\r\n public void onFailure(int statusCode, Header[] headers, byte[] errorResponse, Throwable e) {\n progress.dismiss();\r\n e.printStackTrace();\r\n\r\n }", "@Override\n public void onErrorResponse(VolleyError volleyError) {\n Log.e(\"status Response\", String.valueOf(volleyError));\n // mProgressDialog.dismiss();\n }", "@Override\n\tpublic void onResultError(String reqUrl, String errMsg) {\n\t\tmProgressDialog.dismiss();\n\t\tToast.makeText(this, errMsg, Toast.LENGTH_SHORT).show();\n\t}", "@Override\n public void onErrorResponse(VolleyError arg0) {\n\n Log.d(\"Error\", \"------------\" + arg0);\n\n closeProgress();\n\n showToast(getString(R.string.user_not_exist));\n\n// showAlertDialog(getString(R.string.error));\n }", "@Override\r\n public void onErrorResponse(VolleyError volleyError) {\n progressDialog.dismiss();\r\n\r\n // Showing error message if something goes wrong.\r\n Toast.makeText(appointment.this, volleyError.toString(), Toast.LENGTH_LONG).show();\r\n }", "@Override\n public void onErrorResponse(VolleyError arg0) {\n\n Log.d(\"Error\", \"------------\" + arg0);\n\n closeProgress();\n\n showToast(getString(R.string.need_log_in));\n\n// showAlertDialog(getString(R.string.error));\n }", "@Override\n public void onErrorResponse(VolleyError arg0) {\n\n Log.d(\"Error\", \"------------\" + arg0);\n\n closeProgress();\n\n showToast(getString(R.string.need_log_in));\n\n// showAlertDialog(getString(R.string.error));\n }", "@Override\n public void onFailure(@NonNull Exception e) {\n dialog.dismiss();\n //Display err toast msg\n Toast.makeText(getApplicationContext(), e.getMessage(), Toast.LENGTH_SHORT).show();\n }", "@Override\r\n public void onFailure(int statusCode, Header[] headers, byte[] errorResponse, Throwable e) {\n progress.dismiss();\r\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n progressDialog.dismiss();\n error.printStackTrace();\n Toast.makeText(Commissioner.this, getString(R.string.servernotconnect) + \"->\" + error.getMessage().toString(), Toast.LENGTH_LONG).show();\n\n }", "@Override\n public void onError(Throwable e) {\n uiHelper.dismissLoadingDialog();\n }", "@Override\n public void onError(Throwable e) {\n uiHelper.dismissLoadingDialog();\n }", "@Override\n public void onError(Throwable e) {\n uiHelper.dismissLoadingDialog();\n }", "@Override\n public void onTaskFailure(String result) {\n connectionProgressDialog.dismiss();\n\n }", "@Override\n public void onFailure(Call<Profile> call, Throwable t) {\n Log.e(TAG, \"FAILURE RESPONSE\" + t.getMessage());\n if (progressDialog != null && progressDialog.isShowing()) {\n progressDialog.dismiss();\n }\n }", "@Override\n public void onFailure(@NonNull Exception e) {\n\n Log.i(TAG,\"An error occurred\" +e.getMessage());\n String exception=e.getMessage();\n int index=exception.indexOf(\":\");\n String data=exception.substring(index+1).trim();\n showMessage(\"Error\",data,R.drawable.ic_error_dialog);\n Toast.makeText(getApplicationContext(), \"Authentication failed.\",\n Toast.LENGTH_SHORT).show();\n progressBar.setVisibility(View.GONE);\n\n }", "@Override\n public void onFailure(@NonNull Exception e) {\n progressDialog.dismiss();\n Toast.makeText(SignUpActivity.this,\"\"+e.getMessage(), Toast.LENGTH_SHORT).show();\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n Log.e(\"response is:\", error.toString());\n Toast.makeText(getActivity(), \"Server not connected\", Toast.LENGTH_SHORT).show();\n progressDialog.dismiss();\n }", "@Override\n\t\t\t\t\tpublic void onFailure(HttpException arg0, String arg1) {\n\t\t\t\t\t\tdismissProgressDialog();\n\t\t\t\t\t\tLog.v(TAG, \"onFailure \" + arg1);\n\n\t\t\t\t\t}", "@Override\n public void onErrorResponse(VolleyError error) {\n progressDialog.dismiss();\n error.printStackTrace();\n Toast toast = Toast.makeText(Commissioner.this, getString(R.string.servernotconnect), Toast.LENGTH_LONG);\n toast.show();\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n progressDialog.dismiss();\n error.printStackTrace();\n Toast toast = Toast.makeText(Commissioner.this, getString(R.string.servernotconnect), Toast.LENGTH_LONG);\n toast.show();\n }", "@Override\r\n\t\t\t\t\tpublic void onFailure(Throwable t, String strMsg) {\n\t\t\t\t\t\tsuper.onFailure(t, strMsg);\r\n\t\t\t\t\t\tDismissProgressDialog();\r\n\t\t\t\t\t}", "@Override\r\n\t\t\t\t\tpublic void onFailure(Throwable t, String strMsg) {\n\t\t\t\t\t\tsuper.onFailure(t, strMsg);\r\n\t\t\t\t\t\tDismissProgressDialog();\r\n\t\t\t\t\t}", "@Override\r\n\t\t\t\t\tpublic void onFailure(Throwable t, String strMsg) {\n\t\t\t\t\t\tsuper.onFailure(t, strMsg);\r\n\t\t\t\t\t\tDismissProgressDialog();\r\n\t\t\t\t\t}", "@Override\n public void onFailure(Call<QuotesResponse> call, Throwable t) {\n Log.e(\"MainAct Throw\", t.toString());\n progressDoalog.dismiss();\n }", "@Override\r\n public void onFailure(@NonNull Exception e) {\n Toast.makeText(MainActivity.this, \"Error\", Toast.LENGTH_SHORT).show();\r\n hideProgress();\r\n }", "@Override\n public void onErrorResponse(VolleyError arg0) {\n mHandler.sendEmptyMessage(-1);\n loadingDialog.dismiss();\n }", "@Override\n public void onErrorResponse(VolleyError arg0) {\n mHandler.sendEmptyMessage(-1);\n loadingDialog.dismiss();\n }", "@Override\n public void onFailure(int statusCode, Header[] headers, byte[] errorResponse, Throwable e) {\n pDialog.dismiss();\n Toast.makeText(getApplicationContext(), \"Error. \",\n Toast.LENGTH_SHORT).show();\n if(errorResponse!=null) {\n Toast.makeText(getApplicationContext(), \"Error. \" + new String(errorResponse),\n Toast.LENGTH_SHORT).show();\n Log.e(\"Failure\", new String(errorResponse));\n }\n e.printStackTrace();\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n showDialogue(getActivity(), \"Sorry! Server Error\", \"Oops!!!\");\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n Log.e(\"response is:\", error.toString());\n progressBar.setVisibility(View.GONE);\n }", "@Override\n public void run() {\n waitDialog.dismiss();\n\n //show an error dialog\n\n\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n Log.e(\"response is:\", error.toString());\n Toast.makeText(getActivity(), Settings.getword(getActivity(),\"server_not_connected\"), Toast.LENGTH_SHORT).show();\n progressDialog.dismiss();\n }", "@Override\n public void onFailure(Request request, IOException e) {\n Toast.makeText(MainActivity.this, \"Request Failed\", Toast.LENGTH_SHORT).show();\n }", "@Override\n public void onErrorResponse(VolleyError volleyError) {\n loading.dismiss();\n //Showing toast\n //Toast.makeText(getActivity(), volleyError.getMessage().toString(), Toast.LENGTH_LONG).show();\n Toast.makeText(AdQuestionActivity.this, \"Upload Error! \"+volleyError.getMessage().toString(), Toast.LENGTH_LONG).show();\n }", "@Override\n public void onErrorResponse(VolleyError volleyError) {\n loading.dismiss();\n try {\n //Showing toast\n Toast.makeText(UpdateQueryActivity.this, volleyError.getMessage().toString(), Toast.LENGTH_LONG).show();\n }catch (Exception e){\n Log.i(\"Volley_error: \",e.toString());\n }\n\n }", "@Override\n public void onError(List<String> errors) {\n DialogUtils.showLong(context, errors.get(0));\n progressBar.setVisibility(View.INVISIBLE);\n }", "@Override\n\t\tpublic void onServiceError(String error) {\n\t\t\tUtil.closeProgressDialog();\n\t\t}", "@Override\n public void onErrorResponse(VolleyError error) {\n loading.dismiss();\n Toast.makeText(feeds.this,\"An unexpected error occurred\",Toast.LENGTH_LONG).show();\n\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n //This code is executed if there is an error.\n System.out.println(error.toString());\n ProgressBar pb = (ProgressBar) findViewById(R.id.loading);\n pb.setVisibility(View.INVISIBLE);\n TextView rp = (TextView) findViewById(R.id.rply);\n rp.setText(\"network error\");\n }", "@Override\n public void onFailure(Call<ResponseBody> call, Throwable t) {\n dialog.dismiss();\n\n }", "@Override\n public void onFailure(Call<ArrayList<Departments>> call, Throwable t) {\n if (progressDialog!=null&&progressDialog.isShowing())\n progressDialog.dismiss();\n\n Log.e(\"TAG\", t.toString());\n }", "@Override\r\n public void onFailure(Throwable t, int errorNo,\r\n String strMsg) {\n mProgressDialog.cancel();\r\n super.onFailure(t, errorNo, strMsg);\r\n MyLog.i(\"YUY\", \"查询失败\" + strMsg);\r\n }", "@Override\n public void onFailure(Call<Profile> call, Throwable t) {\n Log.e(TAG, \"FAILURE RESPONSE\" + t.getMessage());\n if (progressDialog != null && progressDialog.isShowing()) {\n progressDialog.dismiss();\n }\n }", "public void run() {\n onSignupFailed();\n progressDialog.dismiss();\n }", "@Override\n public void onFailure(@NonNull Exception e) {\n Toast.makeText(ServiceOrder.this, \"Fail to get the data.\", Toast.LENGTH_SHORT).show();\n progressBar.setVisibility(View.GONE);\n EmptyView.setText(\"Fail to get the data.\");\n EmptyView.setVisibility(View.VISIBLE);\n }", "@Override\n\t\t\tpublic void onFailure(HttpException arg0, String arg1) {\n\t\t\t\tif(progressDialog!=null)progressDialog.dismiss();\n\t\t\t\tshowShortToast(\"获取失败,请检查网络连接\");\n\t\t\t}", "@Override\n public void onFailure(HttpException arg0, String arg1) {\n mProgressDialog.setMessage(\"下载失败\");\n mProgressDialog.dismiss();\n enterHome();\n }", "@Override\n\t\t\tpublic void onError(int code,String msg){\n\t\t\t\tToast.makeText(mContext, \"查询失败\", Toast.LENGTH_SHORT).show();\n\t\t\t\tcloseProgressDialog();\n\t\t\t}", "public void failure(RetrofitError arg0) {\n\t\t\t\tdialog.dismissWithFailure();\n\t\t\t}", "@Override\n public void onFailure(Call<ResponseBody> call, Throwable t) {\n Logger.write(t.getMessage());\n MyUtils.showConnectionErrorToast(getActivity());\n DialogUtils.closeProgress();\n }", "@Override\n public void onDataAvailable(Object data) {\n progressDialog.dismiss();\n Toast.makeText(getApplicationContext(), \"error data \" + data.toString(), Toast.LENGTH_LONG).show();\n\n }", "public void failure(RetrofitError arg0) {\n\t\t\t\tdialog.cancel();\n\t\t\t\tLog.i(\"\",\"Hello Error Response Code: \"+arg0.getResponse().getStatus());\n\t\t\t}", "@Override\n public void onError(int errorCode, String errorString) {\n ((StockTradeDetailActivity)mContext).runOnUiThread(new Runnable() {\n @Override\n public void run() {\n mExtraInfoProgressBar_II.setVisibility(View.GONE);\n showExtraInfoPrompt(mExtraInfoDataPromptViewII, EXTRA_INFO_STATUS_ERROR);\n }\n });\n }", "@Override\r\n public void onErrorResponse(VolleyError error)\r\n {\n AlertDialog.Builder b1 = new AlertDialog.Builder(ctx);\r\n b1.setTitle(\"Network error\");\r\n b1.setMessage(Common.getMessage());\r\n b1.setIcon(R.mipmap.ic_launcher);\r\n b1.setPositiveButton(\"retry\", new DialogInterface.OnClickListener() {\r\n @Override\r\n public void onClick(DialogInterface dialogInterface, int i) {\r\n SendRequest();\r\n }\r\n });\r\n\r\n b1.setNegativeButton(\"cancel\", new DialogInterface.OnClickListener() {\r\n @Override\r\n public void onClick(DialogInterface dialogInterface, int i) {\r\n b1.create().dismiss();\r\n }\r\n });\r\n\r\n b1.create().show();\r\n }", "@Override\n\t\t\t\t public void onError(DialogError error) {\n\n\t\t\t\t\t errorMessage = \"Facebook Error Occured\";\n\t\t\t\t\t getResponse();\n\n\t\t\t\t }", "@Override\n public void onFailure(Call<ObituariesDetailResponse> call, Throwable t) {\n Log.e(\"nik\", t.toString());\n hideProgressDialog();\n CustomDialog customDialog1 = new CustomDialog(ObitiuariesDetailsActivity.this, null,\n \"\", t.getMessage(),\n \"ONFAILED\");\n if (customDialog1.isShowing()) {\n customDialog1.dismiss();\n }\n customDialog1.show();\n }", "@Override\n public void onFailure(retrofit2.Call<CommanResponsePojo> call, Throwable t) {\n pd.dismiss();\n Log.e(\"TAG\", t.toString());\n EmpowerApplication.alertdialog(t.getMessage(), CompoffActivity.this);\n\n\n }", "@Override\n\t\t\t\t\t\t\tpublic void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) {\n\t\t\t\t\t\t\t\tLog.e(\"1111111\", \"\"+arg0);\n\t\t\t\t\t\t\t\tdialog.dismiss();\n\t\t\t\t\t\t\t}", "@Override\n public void onFailure(int statusCode, Header[] headers, byte[] errorResponse, Throwable e) {\n // Hide Progress Dialog\n prgDialog.hide();\n // When Http response code is '400'\n if(statusCode == 400){\n Toast.makeText(getApplicationContext(), \"Error Creating Donation!!\", Toast.LENGTH_LONG).show();\n }\n // When Http response code is '500'\n else if(statusCode == 500){\n Toast.makeText(getApplicationContext(), \"Something went wrong at server end\", Toast.LENGTH_LONG).show();\n }\n // When Http response code other than 400, 500\n else{\n Toast.makeText(getApplicationContext(), \"Unexpected Error occcured! [Most common Error: Device might not be connected to Internet or remote server is not up and running]\", Toast.LENGTH_LONG).show();\n }\n }", "@Override\n public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) {\n postState = true;\n CustomDialog.closeProgressDialog();\n CustomToast.showShortToast(mContext, \"签到失败,网络错误!\");\n }", "@Override\n public void onFailure(@NonNull Exception e) {\n Toast.makeText(getApplicationContext(), e.getMessage(), Toast.LENGTH_SHORT).show();\n pd.dismiss();\n }", "@Override\n public void onErrorResponse(VolleyError volleyError) {\n loading.dismiss();\n\n //Showing toast\n Toast.makeText(MainActivity.this, volleyError.getMessage().toString(), Toast.LENGTH_LONG).show();\n }", "@Override\n public void onFailure(retrofit2.Call<RealTime> call, Throwable t) {\n Log.e(\"TAG\", t.toString());\n //pd.dismiss();\n\n EmpowerApplication.alertdialog(t.getMessage(),Attend_Regularization.this);\n\n }", "@Override\n\t\t\t\t\t\tpublic void onError(DialogError e) {\n\t\t\t\t\t\t\tToast.makeText(FBactivity.this, \"dialogError\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\t}", "@Override\n public void onErrorResponse(VolleyError volleyError) {\n loading.dismiss();\n\n //Showing toast\n Toast.makeText(imageUpload.this, \"Silakan cek koneksi anda\", Toast.LENGTH_LONG).show();\n }", "@Override\n public void onCancelled(DatabaseError error) {\n Log.e(\">> \", \"Failed to read value.\", error.toException());\n\n hideProgressDialog();\n }", "@Override\n public void onFailure(retrofit2.Call<ExpectedVisitorPoJo> call, Throwable t) {\n Log.e(\"TAG\", t.toString());\n pd1.dismiss();\n\n\n }", "@Override\n\t\t\t\t\t\t\t\t\t\tpublic void onRequestFail() {\n\n\t\t\t\t\t\t\t\t\t\t}", "@Override\n\t\t\t\t\tpublic void onError(VolleyError error) {\n\t\t\t\t\t\tToast.makeText(getActivity(), \"加载数据失败!\",Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\tnodata.setVisibility(View.VISIBLE);\n\t\t\t\t\t\tlistview.setVisibility(View.GONE);\n\t\t\t\t\t\tcustomProgressDialog.dismiss();\n\t\t\t\t\t}", "@Override\n public void onFailure(@NonNull Exception e) {\n progressDialog.dismiss();\n Toast.makeText(UserProfile.this, \"Error updating Image..\", Toast.LENGTH_SHORT).show();\n\n }", "@Override\n\tpublic void onFinishRequest(HttpRequest request,int requestId) {\n\t\tprogressDialog.dismiss();\n\t}", "@Override\n public void onFailure(Call<AddToCartFromHomeResponse> call, Throwable t) {\n Toast.makeText(mContext, \"\" + t, Toast.LENGTH_SHORT).show();\n Log.e(\"Failer\", \"\" + t);\n pDialog.dismiss();\n }", "@Override\n public void onFailure(Call<AddToCartFromHomeResponse> call, Throwable t) {\n Toast.makeText(mContext, \"\" + t, Toast.LENGTH_SHORT).show();\n Log.e(\"Failer\", \"\" + t);\n pDialog.dismiss();\n }", "@Override\n public void onFailure(Call<List<ReviewDTO>> call, Throwable t) {\n Toast.makeText(getActivity(), t.toString(), Toast.LENGTH_LONG).show();\n progressDialog.dismiss(); //dismiss progress dialog\n }", "@Override\n public void onFailure(int statusCode, Header[] headers, Throwable e, JSONArray errorResponse) {\n // Hide Progress Dialog\n prgDialog.hide();\n // When Http response code is '404'\n if(statusCode == 404){\n Toast.makeText(getApplicationContext(), \"Requested resource not found\", Toast.LENGTH_LONG).show();\n }\n // When Http response code is '500'\n else if(statusCode == 500){\n Toast.makeText(getApplicationContext(), \"Something went wrong at server end\", Toast.LENGTH_LONG).show();\n }\n // When Http response code other than 404, 500\n else{\n Toast.makeText(getApplicationContext(), \"Unexpected Error occcured! [Most common Error: Device might not be connected to Internet or remote server is not up and running]\", Toast.LENGTH_LONG).show();\n }\n }", "@Override\n public void onFailure(retrofit2.Call<CompOffDetails> call, Throwable t) {\n pd.dismiss();\n Log.e(\"TAG\", t.toString());\n EmpowerApplication.alertdialog(t.getMessage(), CompoffActivity.this);\n\n\n }", "@Override\n public void onFailure(int statusCode, cz.msebera.android.httpclient.Header[] headers, byte[] bytes, Throwable throwable) {\n\n // Hide Progress Dialog\n prgDialog.hide();\n // When Http response code is '404'\n if (statusCode == 404) {\n Toast.makeText(getApplicationContext(),\n \"Requested resource not found\",\n Toast.LENGTH_LONG).show();\n }\n // When Http response code is '500'\n else if (statusCode == 500) {\n Toast.makeText(getApplicationContext(),\n \"Something went wrong at server end\",\n Toast.LENGTH_LONG).show();\n }\n // When Http response code other than 404, 500\n else {\n Toast.makeText(\n getApplicationContext(),\n \"Error Occured n Most Common Error: n1. Device not connected to Internetn2. Web App is not deployed in App servern3. App server is not runningn HTTP Status code : \"\n + statusCode, Toast.LENGTH_LONG)\n .show();\n }\n }", "@Override\n public void onFailure(Call call, IOException e) {\n getActivity().runOnUiThread(new Runnable() {\n @Override\n public void run() {\n cancelProgressDialog();\n Toast.makeText(getContext(), \"获取数据失败,请稍后再试...\", Toast.LENGTH_SHORT).show();\n }\n });\n }", "@Override\n public void onCancelled(DatabaseError databaseError) {\n progressDialog.dismiss();\n\n }", "@Override\n public void onCancelled(DatabaseError databaseError) {\n progressDialog.dismiss();\n\n }", "@Override\n public void onCancelled(DatabaseError databaseError) {\n progressDialog.dismiss();\n\n }" ]
[ "0.7572542", "0.75611436", "0.7463531", "0.74312544", "0.74312544", "0.74312544", "0.74312544", "0.74312544", "0.73912585", "0.7377211", "0.7346898", "0.7330411", "0.73210925", "0.7299958", "0.72988755", "0.7217551", "0.72157454", "0.7208117", "0.7184364", "0.7176717", "0.7175243", "0.71270585", "0.70965177", "0.70951635", "0.7065283", "0.7065283", "0.7048532", "0.70440096", "0.69294393", "0.6916813", "0.6916813", "0.6916813", "0.6914709", "0.6826412", "0.68196684", "0.67679447", "0.6760129", "0.6740329", "0.6731516", "0.6731516", "0.6728148", "0.6728148", "0.6728148", "0.670141", "0.6686318", "0.66741884", "0.66741884", "0.6631925", "0.66213423", "0.6610877", "0.6597759", "0.6589837", "0.6577535", "0.65647167", "0.6556471", "0.65513253", "0.65461403", "0.6545233", "0.65429807", "0.6532839", "0.65304476", "0.65296465", "0.65250105", "0.6523025", "0.65213996", "0.65208775", "0.6514194", "0.6491294", "0.6489572", "0.6488435", "0.64850366", "0.6481227", "0.6478224", "0.64434254", "0.644284", "0.6441594", "0.6440658", "0.6432348", "0.64214057", "0.6411042", "0.640856", "0.6361547", "0.63546556", "0.6352124", "0.63488585", "0.6347257", "0.63456124", "0.6343295", "0.6329744", "0.6304008", "0.6299902", "0.62982315", "0.62982315", "0.62976426", "0.6294779", "0.62926537", "0.62916875", "0.6291619", "0.62814325", "0.62814325", "0.62814325" ]
0.0
-1
Returns the Team of the Spymaster
public String getTeam() { return Team; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Team getMyTeam();", "public Team getTeam() {\r\n\t\treturn team;\r\n\t}", "public Team getTeam() {\n return team;\n }", "@Override\r\n\tpublic String getTeam() {\n\t\treturn team;\r\n\t}", "public String getTeam() {\n return team;\n }", "public String getTeam() {\n\t\treturn team;\n\t}", "public SoccerTeam getTeamOne() {\n return teamOne;\n }", "public int getTeam() {\n return team_;\n }", "@Override\r\n\tpublic String getTeam() {\n\t\treturn null;\r\n\t}", "@Override\n public String getTeam(){\n return this.team;\n }", "public int getTeam() {\n return team_;\n }", "public short getTeam() {\n\n return m_team;\n }", "public String getTeamName() {\r\n return teamName;\r\n }", "public int getTeam() {\n return team;\n }", "public String getTeamId() {\r\n\t\treturn teamName;\r\n\t}", "public static Team whoWonGameTeam() {\r\n\t\tint highest = Main.winScoreNumb;\r\n\t\tTeam winner = null;\r\n\t\t\r\n\t\t//Winner is team one.\r\n\t\tif (Utils.stringToInt(Main.team1Score) >= highest) {\r\n\t\t\thighest = Utils.stringToInt(Main.team1Score);\r\n\t\t\twinner = Main.teamOne;\r\n\t\t}\r\n\t\t//Winner is team two.\r\n\t\tif (Utils.stringToInt(Main.team2Score) >= highest) {\r\n\t\t\thighest = Utils.stringToInt(Main.team2Score);\r\n\t\t\twinner = Main.teamTwo;\r\n\t\t}\r\n\t\t\r\n\t\treturn winner;\r\n\t}", "public String getHomeTeam();", "int getTeam();", "public Team get(Long id);", "public Team getTeam1 () {\n return team1;\n }", "private Team getTeam(String teamName) {\n return scoreboard.getTeam(trimString(teamName));\n }", "public List<Hero> getTeam() {\r\n return team;\r\n }", "public static Team getWinner() {\n\t\tif (matches != null && matches.length > 0 && matches[0] != null)\n\t\t\treturn matches[0].getWinner();\n\t\treturn null;\n\t}", "public String getTeamName() {\n\t\treturn teamName;\n\t}", "public String getTeamName() {\n\t\treturn teamName;\n\t}", "public String getHomeTeam(){\n\t\treturn _homeTeam.getTeamName();\n\t}", "public String getTeamId() {\n\t\treturn teamId;\n\t}", "public String getTeamId() {\n\t\treturn teamId;\n\t}", "public String getTeam(int id){\r\n\t\treturn teamList.get(id);\r\n\t}", "public FightTeam team();", "@Override\n\tpublic int getTeam() {\n\t\treturn 0;\n\t}", "public Team getTeam() {\n Team team = new Team();\n team.setTeamName(this.getTeamNameDataLabel().getText());\n team.setCaptain(this.getCaptainDataLabel().getText());\n if (this.getCoachDataLabel().equals(\"\")) {\n team.setCoach(null);\n } else {\n team.setCoach(this.getCoachDataLabel().getText());\n }\n if (this.getAchievementsDataLabel().equals(\"\")) {\n team.setAchievements(null);\n } else {\n team.setAchievements(this.getAchievementsDataLabel().getText());\n }\n return team;\n }", "public String getAwayTeam();", "public int getTeamId() {\n return teamId;\n }", "Team findById(Long id);", "public SoccerTeam getTeamTwo() {\n return teamTwo;\n }", "Team findByName(String name);", "private TeamId findWinningTeam(){\n if (state.score().totalPoints(TeamId.TEAM_1)>=Jass.WINNING_POINTS) {\n return TeamId.TEAM_1;\n }\n else {\n return TeamId.TEAM_2;\n }\n }", "public int getTeamId() {\n\t\treturn teamId;\n\t}", "public Team get(String teamID) {\n TeamDB tdb = new TeamDB();\n return tdb.get(teamID);\n }", "Match getTeam1LooserOfMatch();", "public Player getTeamMate(){\n\t\tif(team == null) return null;\n\t\tCollection<Player> players = team.getPlayers();\n\t\tfor(Player p : players){\n\t\t\tif(!p.equals(this))return p; \n\t\t}\n\t\treturn null;\n\t}", "public int getTeamNo() {\r\n\t\treturn teamNo;\r\n\t}", "public static Team whoLostGameTeam() {\r\n\t\tint lowest = Main.loseScoreNumb;\r\n\t\tTeam loser = null;\r\n\t\t\r\n\t\t//Team one is the looser.\r\n\t\tif (Utils.stringToInt(Main.team1Score) >= lowest) {\r\n\t\t\tlowest = Utils.stringToInt(Main.team1Score);\r\n\t\t\tloser = Main.teamOne;\r\n\t\t}\r\n\t\t//Team two is the loser.\r\n\t\tif (Utils.stringToInt(Main.team2Score) >= lowest) {\r\n\t\t\tlowest = Utils.stringToInt(Main.team2Score);\r\n\t\t\tloser = Main.teamTwo;\r\n\t\t}\r\n\t\t\r\n\t\treturn loser;\r\n\t}", "public String getHomeTeam() {\n return homeTeam;\n }", "public static Team getTeam(long id) {\n return find().where().eq(\"id\", id).findUnique();\n }", "public ArrayList<Team> getTeamList(){\n\t\treturn this.teamList;\n\t}", "public int getTeamID() {\n\t\treturn teamID;\n\t}", "String getWonTeam() {\r\n return this.teamName;\r\n }", "public String getToolteam() {\r\n return toolteam;\r\n }", "public static Team getSecondPlace() {\n\t\tif (matches != null && matches.length > 0 && matches[0] != null)\n\t\t\treturn matches[0].getLoser();\n\t\treturn null;\n\t}", "public Teams getTeamById(UUID id)\n {\n Optional<Teams> optionalTeam = teamRepo.findById(id);\n if(!optionalTeam.isPresent())\n throw new TeamNotFoundException(\"Team Record with \" + id + \" is not available\");\n return teamRepo.findById(id).get();\n }", "@Override\r\n\tpublic TeamPO findTeamByName(String name) {\n\t\treturn teams.findTeamByShortName(name);\r\n\t}", "Match getTeam2LooserOfMatch();", "public Team getTeam() throws PlayerHasNoTeamException {\r\n\t\tif (team == null) {\r\n\t\t\tthrow new PlayerHasNoTeamException(this);\r\n\t\t}\r\n\t\treturn team;\r\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn teamName;\n\t}", "public LinkedList<SoccerTeam> getTeams() {\n return this.teams;\n }", "public String nodeTeam(String id)\n\t{\n\t\treturn getNode(id).team;\n\t}", "@Override\n\tpublic boolean getIsTeamMatch() {\n\t\treturn _esfTournament.getIsTeamMatch();\n\t}", "public ArrayList<CollegeFootballTeam> getTeamList()\r\n\t{\r\n\t\treturn teams;\r\n\t}", "public SoccerTeam getWinner() {\n SoccerTeam winner = null;\n\n if (this.scoreOne > this.scoreTwo) {\n winner = this.teamOne;\n }\n else if (this.scoreOne < this.scoreTwo) {\n winner = this.teamTwo;\n }\n\n return winner;\n }", "public Team selectTeam() {\r\n \r\n String[] list = new String[controller.getTeams().size()];\r\n for (int i = 0; i < controller.getTeams().size(); i++) {\r\n list[i] = controller.getTeams().get(i).getName();\r\n }\r\n\r\n JComboBox cmbOption = new JComboBox(list);\r\n int input = JOptionPane.showOptionDialog(null, cmbOption, \"Select Team that your like Delete\",JOptionPane.DEFAULT_OPTION,JOptionPane.QUESTION_MESSAGE, null, null, null);\r\n if(input==-1){\r\n return null;\r\n }\r\n Team teamAux = controller.searchTeam((String) cmbOption.getSelectedItem());\r\n return teamAux;\r\n }", "public ArrayList<CollegeFootballTeam> getTeamList();", "public Player getTeam(Player player) {\n if (teams.containsKey(player)) {\n return player;\n }\n for (Player p : teams.keySet()) {\n if (teams.get(p).contains(player)) {\n return p;\n }\n }\n return null;\n }", "public SoccerTeam getTeam(String teamName) throws TeamNotFoundException {\n\n for (int i = 0; i < this.teams.size(); i++) {\n SoccerTeam team = this.teams.get(i);\n\n if (team.getName().equals(teamName)){\n return team;\n }\n }\n throw new TeamNotFoundException(\"Team that you are searching for is not found\");\n }", "public void setTeam(String team) {\r\n\t\tTeam = team;\r\n\t}", "SysTeam selectByPrimaryKey(Integer teamId);", "public Team getTeamRed() {\r\n return teamRed;\r\n }", "public String getVisitingTeam() {\n return visitingTeam;\n }", "public Team(String name) {\n this.name = name;\n }", "public Team getTeam(Team enemyTeam) {\n\t\tArrayList<Character>battleArray = new ArrayList<Character>();\r\n\t\tboolean complete = false;\r\n\t\t\r\n\t\tfor(Character c : guildArray) {\r\n\t\t\tStudent s = (Student) c;\r\n\t\t\t//Choosing alive students whose KP is max thus they can perform stronger attacks\r\n\t\t\tif(s.MaxKPReached() && s.getHP() > 0){\r\n\t\t\t\tbattleArray.add(s);\r\n\t\t\t}\r\n\t\t\t//if the size of the team is 5, then the team is completed\r\n\t\t\tif(battleArray.size() == 5){\r\n\t\t\t\tcomplete = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//If the team still needs members search for members\r\n\t\tfor(int i = 0; i < guildArray.size() && complete == false; i++) {\r\n\t\t\t//Check if the student is not already in the battle team and alive\r\n\t\t\tStudent student = (Student)guildArray.get(i);\r\n\t\t\tif(!battleArray.contains(student) && student.getHP() > 0){ \r\n\t\t\t\tbattleArray.add(student);\r\n\t\t\t}\r\n\t\t\tif(battleArray.size() == 5) {\r\n\t\t\t\tcomplete = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tTeam battleTeam = new StudentTeam(\"BattleTeam\");\r\n\t\tfor(Character c : battleArray) {\r\n\t\t\tbattleTeam.addMember(c);\r\n\t\t}\r\n\r\n\t\treturn battleTeam;\r\n\t}", "public SoccerTeam getLoser() {\n SoccerTeam loser = null;\n\n if (this.scoreOne < this.scoreTwo) {\n loser = this.teamOne;\n }\n else if (this.scoreOne > this.scoreTwo) {\n loser = this.teamTwo;\n }\n\n return loser;\n }", "public Team findTeamFromName(String name) {\r\n Iterator<Team> itr = this.getTeamTreeFromMatchTree().iterator();\r\n Team team;\r\n while (itr.hasNext()){\r\n team = itr.next();\r\n if (team.getName().equals(name)){\r\n return team;\r\n }\r\n }\r\n return null;\r\n }", "private static Team getTeam(Connection con,Long teamId) {\n\n Team team = null;\n\n String query = SQLConstants.GET_TEAM_BY_TEAM_ID;\n\n try {\n team = new Team();\n //Connection con = JdbcConnection.getConnection();\n PreparedStatement pstmt = con.prepareStatement(query);\n pstmt.setLong(1, teamId);\n\n ResultSet rs = pstmt.executeQuery();\n\n while (rs.next()) {\n team.setId(rs.getLong(\"id\"));\n team.setName(rs.getString(\"name\"));\n team.setDescribe(rs.getString(\"describe\"));\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return team;\n\n }", "public Team getTeamByName(String name) {\n\t\tTeam t = null;\n\t\ttry {\n\t\t\tPreparedStatement statement = null;\n\t\t\tResultSet rs = null;\n\t\t\tString teamRecords_sql = \"SELECT * FROM \" + team_table + \" WHERE name='\" + name + \"'\";\n\t\t\tconnection = connector.getConnection();\n\t\t\tstatement = connection.prepareStatement(teamRecords_sql);\n\t\t\trs = statement.executeQuery();\n\t\t\tList<Player> players = new ArrayList<Player>();\n\t\t\tif (rs.next()) {\n\t\t\t\tplayers = formatPlayers(getPlayersByTeamId(rs.getInt(1)));\n\t\t\t\tt = new Team(players, rs.getString(2), rs.getString(3), rs.getString(4), rs.getDate(5));\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t\treturn t;\n\t}", "public VwTeams get(int teamId)\n\t{\n\t\tVwTeams [] results = null;\n\t\t\n\t\ttry\n\t\t{\n\t\t\tresults = dao.findWhereTeamIdEquals(teamId);\t\t\t\n\t\t}\n\t\tcatch (VwTeamsDaoException e)\n\t\t{\n\t\t\tlogger.error(e.getMessage());\n\t\t\t\n\t\t\terror.setCode(Errors.Codes.DB_DAO.getCode());\n\t\t\terror.setWindowTitle(Errors.Codes.DB_DAO.getWindowTitle());\n\t\t\terror.setMessage(Errors.Codes.DB_DAO.getMessage());\n\t\t\t\n\t\t\terror.setExceptionMessage(e.getMessage());\n\t\t\t\n\t\t\tpdr.setError(error);\n\t\t\t\n\t\t\tif (logger.isDebugEnabled())\n\t\t\t\te.printStackTrace();\n\t\t\t\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\treturn results.length == 0 ? null : results[0];\n\t}", "boolean hasTeam();", "public Team getTeamBlue() {\r\n return teamBlue;\r\n }", "public static List<Team> getTeams() {\n return find().all();\n }", "public String getToolteamid() {\r\n return toolteamid;\r\n }", "public java.lang.String getContactTeamId() {\r\n return contactTeamId;\r\n }", "public Location getTeamSpawn(Team team) {\n return this.config.getLocation(team.getName() + \".spawn\");\n }", "@Override\n\tpublic TeamInfo findById(String id) {\n\t\treturn repository.findOne(id);\n\t}", "public Integer getClubTeamId() {\n\t\treturn clubTeamId;\n\t}", "public ArrayList<Team> getList(){\n\t\treturn this.teams;\n\t}", "Team createTeam();", "public void setTeam(String team) {\n\t\tthis.teamOfPlayer = team;\n\t}", "public void setTeam(String team) {\n\t\tthis.team = team;\n\t}", "@GET\n @Path(\"Current/Team/{teamId}\")\n public Response getTeamByCurrentUser(@PathParam(\"teamId\") Long teamId) {\n Response r = Response.noContent().build();\n User currentUser = userFacade.getCurrentUser();\n final Collection<Game> playedGames = gameFacade.findRegisteredGames(currentUser.getId());\n for (Game g : playedGames) {\n Collection<Team> teams = g.getTeams();\n for (Team t : teams) {\n if (teamId.equals(t.getId())) {\n for (Player p : t.getPlayers()) {\n if (p.getUserId().equals(currentUser.getId())) {\n r = Response.ok().entity(t).build();\n }\n }\n }\n }\n }\n return r;\n }", "IGroup getTeamGroup();", "public java.lang.String getTeamRole() {\r\n return teamRole;\r\n }", "protected abstract void gatherTeam();", "public String getVenue(String team) {\n\n return getGameInfo(team, \"venue\");\n }", "TeamDTO findOne(Long id);", "@Override\n\tpublic boolean isIsTeamMatch() {\n\t\treturn _esfTournament.isIsTeamMatch();\n\t}", "@Override\n public Team getTeamById(int id){\n try {\n String sql = \"SELECT * FROM Team WHERE Team.teamid = ?\";\n Team team = jdbc.queryForObject(sql, new TeamMapper(), id);\n team.setUser(getUserFromTeam(team));\n return team;\n }catch(DataAccessException ex){\n return null;\n }\n }", "public Team getTeamById(int id, ResultSet rsMatches) {\n\t\tTeam t = null;\n\t\tPreparedStatement statement = null;\n\t\tResultSet rs = null;\n\t\tString teamByIdRecords_sql = \"SELECT * FROM \" + team_table + \" WHERE id='\" + id + \"'\";\n\t\tconnection = connector.getConnection();\n\t\ttry {\n\t\t\tstatement = connection.prepareStatement(teamByIdRecords_sql);\n\t\t\trs = statement.executeQuery();\n\t\t\tif (rs.next()) {\n\t\t\t\tt = new Team(formatPlayers(getPlayersByTeamId(id)), rs.getString(2), rs.getString(3), rs.getString(4),\n\t\t\t\t\t\trs.getDate(5));\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t\treturn t;\n\t}", "ReadOnlyObjectProperty<TeamId> winningTeamProperty() {\n return winningTeam;\n }", "public void setTeam(Team team) {\r\n\t\tthis.team = team;\r\n\t}", "public String getProjectTeamName(){\n return \"The name of the project of this researcher is \"+\n name_of_project_team +\n \"\\n*******\\n\";\n }" ]
[ "0.769413", "0.76687294", "0.7658551", "0.7657227", "0.76129264", "0.7587115", "0.756079", "0.7381809", "0.7330531", "0.7321815", "0.7299991", "0.72619766", "0.7227278", "0.7210867", "0.71743596", "0.71643156", "0.71121746", "0.7098142", "0.70245546", "0.70220774", "0.7005796", "0.6985822", "0.6980964", "0.6980624", "0.6980624", "0.69708747", "0.69521064", "0.69521064", "0.69400877", "0.6924584", "0.6908103", "0.69067955", "0.690496", "0.6902526", "0.6902264", "0.684859", "0.68305653", "0.6817244", "0.680425", "0.67860156", "0.67572534", "0.67359", "0.6730806", "0.6724022", "0.672196", "0.6712793", "0.66855174", "0.66779625", "0.66698104", "0.66609883", "0.65774906", "0.65741205", "0.6529134", "0.651016", "0.6501267", "0.6476319", "0.6472746", "0.64683473", "0.64673287", "0.64435", "0.6394661", "0.63649434", "0.629154", "0.62889177", "0.6277679", "0.6264212", "0.6233243", "0.6227732", "0.6220597", "0.62141955", "0.6147797", "0.6134486", "0.61297995", "0.6128376", "0.61207503", "0.6119614", "0.6114286", "0.6110882", "0.6097153", "0.6096633", "0.60965866", "0.6076926", "0.6034483", "0.6011217", "0.6005133", "0.5998392", "0.5983471", "0.5963152", "0.595989", "0.59401464", "0.59029675", "0.58830535", "0.58781767", "0.5859183", "0.58384514", "0.58335084", "0.5826977", "0.58265364", "0.58246166", "0.5809964" ]
0.76988286
0
Set's the team of the Spymaster.
public void setTeam(String team) { Team = team; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setTeam(Team team) {\r\n\t\tthis.team = team;\r\n\t}", "@Override\n\tpublic void setHomeTeam() {\n\t\t\n\t}", "public void setTeam(String team) {\n\t\tthis.teamOfPlayer = team;\n\t}", "public void setTeam(String team) {\n\t\tthis.team = team;\n\t}", "void setWinningTeam(TeamId winner) {\n winningTeam.set(winner);\n }", "public Builder setTeam(int value) {\n bitField0_ |= 0x00000004;\n team_ = value;\n onChanged();\n return this;\n }", "public static void setTeam(UserTeam team) {\n\t\tgame.setTmpTeam(team);\n\t\tint i=0;\n\t\tfor (Iterator<FootballPlayer> iterator = team.getPlayers().values().iterator(); iterator\n\t\t\t\t.hasNext();) {\n\t\t\tFootballPlayer player = iterator.next();\n\t\t\tnamesLabels.get(i).setText(game.getLastName(player.getName()));\n\t\t\tshirtLabels.get(i).setIcon(MainGui.getShirt(player.getTeamName()));\n\t\t\tbuttonArray[i].setText(\"X\");\n\t\t\ti++;\n\t\t}\n\t}", "public void cmdSetTeam(User teller, Team team, String var, StringBuffer setting) throws MalformedURLException, InvalidNameException {\n String value = setting.toString();\n var = var.toLowerCase();\n if (\"name\".equals(var)) {\n team.setRealName(value);\n } else if (ComparisionHelper.anyEquals(var, \"loc\", \"loc.\", \"location\")) {\n team.setLocation(value);\n } else if (ComparisionHelper.anyEquals(var, \"web\", \"webpage\", \"website\")) {\n team.setWebsite(value);\n } else if (ComparisionHelper.anyEquals(var, \"div\", \"division\")) {\n team.setDivision(value);\n } else {\n command.tell(teller, \"Unknown variable: \" + var);\n return;\n }\n cmdShowTeam(teller, team);\n tournamentService.updateTeam(team);\n tournamentService.flush();\n }", "@Override\n\tpublic void setTeam(int i) {\n\t\t\n\t}", "public void setTeamId(int value) {\n this.teamId = value;\n }", "public void newTeam(Team team);", "@Override\n\tpublic void updateTeam(String name, SuperHuman superHuman) {\n\n\t}", "void resetMyTeam(Team team);", "private void setPlayer()\t{\n\t\tgrid.setGameObject(spy, Spy.INITIAL_X, Spy.INITIAL_Y);\n\t}", "public SoccerTeam getTeamOne() {\n return teamOne;\n }", "private static void switchTeam(BrowserWindow bw, String team) {\n\t\tRepeat rpt = Repeat.findRepeatByIdEndsWith(bw, \"repeat\");\n\t\trpt.clickRow(team);\n\t}", "@Override\r\n\tpublic String getTeam() {\n\t\treturn team;\r\n\t}", "public String getTeam() {\n return team;\n }", "public String getTeam() {\r\n\t\treturn Team;\r\n\t}", "public Team getTeam() {\n return team;\n }", "@Override\r\n\tpublic String getTeam() {\n\t\treturn null;\r\n\t}", "public void setTeams(Collection<Team> teams) {\r\n this.teams = teams;\r\n }", "void resetMyTeam();", "public String getTeam() {\n\t\treturn team;\n\t}", "public Team getTeam() {\r\n\t\treturn team;\r\n\t}", "public void setToolteam(String toolteam) {\r\n this.toolteam = toolteam;\r\n }", "public Team(String name) {\n this.name = name;\n }", "public void nodeTeam(String id, String team)\n\t{\n\t\tgetNode(id).team = team;\n\t}", "@Override\n\tpublic void setVisitTeam() {\n\t\t\n\t}", "public void setTeamName(String name) {\n\t\tteamName = name;\n\t}", "@Override\n public String getTeam(){\n return this.team;\n }", "public void setTeamNo(int teamNo) {\r\n\t\tthis.teamNo = teamNo;\r\n\t}", "public static void saveTeamNames() {\r\n\t\tMain.team1 = Main.teamOne.name;\r\n\t\tMain.team2 = Main.teamTwo.name;\r\n\t}", "public void setTeamName(String teamName) {\r\n this.teamName = teamName;\r\n }", "public void setTeamSpawn(Team team, Location loc) {\n this.config.set(team.getName() + \".spawn\", loc);\n }", "public int getTeam() {\n return team_;\n }", "Team getMyTeam();", "@Override\n\tpublic void setIsTeamMatch(boolean isTeamMatch) {\n\t\t_esfTournament.setIsTeamMatch(isTeamMatch);\n\t}", "@Override\r\n\tpublic ResultMessage updateTeam(TeamPO oneTeam) {\n\t\treturn teams.updateTeam(oneTeam);\r\n\t}", "public int getTeam() {\n return team;\n }", "protected abstract void assignTeam(boolean playerR, boolean playerB);", "public int getTeam() {\n return team_;\n }", "@Test\r\n\tpublic void saveTeam() {\r\n\t\t// TODO: JUnit - Populate test inputs for operation: saveTeam \r\n\t\tTeam team = new wsdm.domain.Team();\r\n\t\tservice.saveTeam(team);\r\n\t}", "public Team() {\r\n id = \"\";\r\n abbreviation = \"\";\r\n name = \"\";\r\n conference = \"\";\r\n division = \"\";\r\n address = null;\r\n }", "@Test\n public void toggleTeamStates() {\n Team team = new Team(\"Crvena Zvezda\");\n\n // TODO: open persistence context and create transaction\n\n // TODO: move team to managed state\n\n // TODO: assert that the team is managed (check if contained in session)\n\n // TODO: commit and close persistence context\n\n // TODO: fetch from DB as managed entity\n\n // TODO: assert entity is managed\n\n // TODO: remove entity from session and assert not managed\n\n // TODO: commit and close\n }", "public void setName(String name){\n\t\tthis.tournamentName = name;\n\t}", "public String getTeamId() {\r\n\t\treturn teamName;\r\n\t}", "public int getTeamId() {\n return teamId;\n }", "@Override\n\tpublic int getTeam() {\n\t\treturn 0;\n\t}", "public void teamChange() {\n if (teamCombobox.getValue().getTeamLogo() != null) {\n teamPhoto.setImage(teamCombobox.getValue().getTeamLogo().getImage());\n }\n teamCode.setText(\"Team code : \" + teamCombobox.getValue().getTeamCode());\n }", "public String getTeamName() {\r\n return teamName;\r\n }", "public void updateUserTeam() {\n\t\tUser user = users.get(userTurn);\n\t\tSystem.out.println(user.getName());\n\t\tSystem.out.println(tmpTeam.size());\n\t\tUserTeam roundTeam = new UserTeam();\n\t\troundTeam.putAll(tmpTeam.getPlayers());\n\t\tSystem.out.println(roundNumber);\n\t\tSystem.out.println(roundTeam.size());\n\t\tSystem.out.println(\"dfdfdfd\");\n\t\tuser.setUserTeam(roundTeam, roundNumber);\n\t\tSystem.out.println(\"dfdfdfd\");\n\t\ttmpTeam = new UserTeam();\n\t}", "Team createTeam();", "@Override\r\n\tpublic void set(final Player t) {\n\r\n\t}", "public synchronized void pickTeam() {\n voteTeamState = pickTeamState.pickTeam(teamSelection);\n state = State.VOTE_TEAM;\n playerVotes = new HashMap<>();\n }", "void update(Team team);", "public Team() {\n\t\tthis(null);\n\t}", "public String getTeamId() {\n\t\treturn teamId;\n\t}", "public String getTeamId() {\n\t\treturn teamId;\n\t}", "public NetworkGame(String team){\n super();\n this.team = team;\n }", "public void setPlayer(Player myPlayer){\n battlePlayer=myPlayer;\n }", "protected abstract void gatherTeam();", "public int getTeamId() {\n\t\treturn teamId;\n\t}", "public Team(String name) {\r\n this.name = name;\r\n team = new ArrayList<Hero>();\r\n }", "public static void set_players(){\n\t\tif(TossBrain.compselect.equals(\"bat\")){\n\t\t\tbat1=PlayBrain1.myteam[0];\n\t\t\tbat2=PlayBrain1.myteam[1];\n\t\t\tStriker=bat1;\n\t\t\tNonStriker=bat2;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\n\t\t\t\tbat1=PlayBrain1.oppteam[0];\n\t\t\t\tbat2=PlayBrain1.oppteam[1];\n\t\t\t\tStriker=bat1;\n\t\t\t\tNonStriker=bat2;\n\n\t\t\t\t}\n\t}", "static public void set_team_data(String league){\n\n\t\tEdit_row_window.attrs = new String[]{\"team name:\", \"rating:\", \"release year:\"};\n\t\tEdit_row_window.attr_vals = new String[]\n\t\t\t\t{Edit_row_window.selected[0].getText(1), Edit_row_window.selected[0].getText(2), \n\t\t\t\tEdit_row_window.selected[0].getText(3)};\n\t\t\n\t\tEdit_row_window.linked_query =\t\" select distinct p.id, p.name, p.links_to_player, p.birth_year \" +\n\t\t\t\t\t\t\t\t\t\t\t\" from curr_\"+league+\"_players p, \" +\n\t\t\t\t\t\t\t\t\t\t\t\" curr_\"+league+\"_player_team pt \" +\n\t\t\t\t\t\t\t\t\t\t\t\" where pt.player_id=p.id and pt.team_id=\"+Edit_row_window.id+\n\t\t\t\t\t\t\t\t\t\t\t\" order by links_to_player desc \";\n\t\t\t\t\n\t\tEdit_row_window.not_linked_query = \" select distinct p.id, p.name, p.links_to_player, p.birth_year \" +\n\t\t\t\t\" from curr_\"+league+\"_players p \";\n\t\t\n\t\tEdit_row_window.linked_attrs = new String[]{\"id\", \"player name\", \"rating\", \"birth year\"};\n\t\tEdit_row_window.label_min_parameter=\"min. birth year:\";\n\t\tEdit_row_window.linked_category_name = \"PLAYERS\";\n\t}", "public void setWinner(Player winner) {\n this.winner = winner;\n }", "public void setTmpTeam(UserTeam tmpTeam) {\n\t\tthis.tmpTeam = tmpTeam;\n\t}", "@SuppressWarnings(\"unchecked\")\n\tprivate void sendFakeTeam(Player player) {\n\t\tPacketContainer packet = new PacketContainer(PacketType.Play.Server.SCOREBOARD_TEAM);\n\t\tpacket.getStrings().write(0, FakeTeamName);\n\t\tpacket.getIntegers().write(1, 0); // Set create mode\n\t\tpacket.getStrings().write(5, \"never\"); // Push type\n\t\t\n\t\tCollection<String> names = packet.getSpecificModifier(Collection.class).read(0);\n\t\tnames.add(player.getName());\n\t\t\n\t\ttry {\n\t\t\tProtocolLibrary.getProtocolManager().sendServerPacket(player, packet);\n\t\t} catch (InvocationTargetException e) {\n\t\t\t// Should never happen unless packet changes\n\t\t\tthrow new AssertionError(e);\n\t\t}\n\t}", "public short getTeam() {\n\n return m_team;\n }", "public void setWinner(int num){\r\n \twinner = num;\r\n }", "public Team getTeam1 () {\n return team1;\n }", "private void save() {\n Saver.saveTeam(team);\n }", "public void setParty(Pokemon[] team)\n\t{\n\t\tm_pokemon = team;\n\t}", "public int getTeamID() {\n\t\treturn teamID;\n\t}", "public int getTeamNo() {\r\n\t\treturn teamNo;\r\n\t}", "public TeamObject(String name) {\n\t\tthis();\t\t//call the first constructor to build the lock buttons\n\t\tteamName = name;\n\t}", "public static void changePlayerTeam(Player old, Player addNew, Team team, int place) {\r\n\t\t// TODO Auto-generated block\r\n\t}", "public String getHomeTeam() {\n return homeTeam;\n }", "public FightTeam team();", "@Override\n\tpublic void updateTeam(ProjectTeamBean projectTeamBean) {\n\t\t\n\t}", "public String getTeamName() {\n\t\treturn teamName;\n\t}", "public String getTeamName() {\n\t\treturn teamName;\n\t}", "public void setTeamId(String teamId) {\r\n\t\tthis.teamName = teamId;\r\n\t}", "public void setCurrentClub() {\n Object id = BridgeUI.user.getCurrentClubId();\n if (id != null) {\n calendar.filterEventOwnerId(id);\n setClubName(id);\n }\n }", "TeamMember(String _name, String _title) {\r\n this.name = _name;\r\n this.title = _title;\r\n }", "public void setLobby(Lobby lobby)\r\n\t{\r\n\t\treceiver.setLobby(lobby);\t\r\n\t}", "public List<Hero> getTeam() {\r\n return team;\r\n }", "@Override\r\n\tpublic ResultMessage addTeam(TeamPO oneTeam) {\n\t\treturn teams.addTeam(oneTeam) ;\r\n\t}", "public void setTeamName(String teamName) {\n\t\tthis.teamName = teamName;\n\t}", "public void setLobby(Lobby l){\r\n\t\tthis.lobby = l;\r\n\t}", "public SoccerTeam getTeamTwo() {\n return teamTwo;\n }", "static void setSim(Simulation sim){\n\t\tSlave.sim = sim;\n\t}", "public void setTeamId(int teamId) {\n\t\tthis.teamId = teamId;\n\t}", "@PostMapping(path=\"/add/{id}/team\")\n public @ResponseBody Object assignTeamMember(@PathVariable long id, @RequestParam Team team){\n TeamMember tm = teamMemberRepository.getOne(id);\n tm.setTeam(team); // Retrieving the list of team members and adding new team member\n return teamMemberRepository.saveAndFlush(tm);\n }", "public void setTeamRole(java.lang.String teamRole) {\r\n this.teamRole = teamRole;\r\n }", "String getWonTeam() {\r\n return this.teamName;\r\n }", "public Team getTeam() {\n Team team = new Team();\n team.setTeamName(this.getTeamNameDataLabel().getText());\n team.setCaptain(this.getCaptainDataLabel().getText());\n if (this.getCoachDataLabel().equals(\"\")) {\n team.setCoach(null);\n } else {\n team.setCoach(this.getCoachDataLabel().getText());\n }\n if (this.getAchievementsDataLabel().equals(\"\")) {\n team.setAchievements(null);\n } else {\n team.setAchievements(this.getAchievementsDataLabel().getText());\n }\n return team;\n }", "void addMyTeam(Team team) throws HasTeamAlreadyException;", "int getTeam();" ]
[ "0.74745953", "0.71552664", "0.71374506", "0.70705503", "0.7068684", "0.6936859", "0.6911863", "0.6787061", "0.67551106", "0.66507566", "0.65975475", "0.6596164", "0.65765727", "0.65694696", "0.6521587", "0.65116566", "0.6463737", "0.6460537", "0.64105237", "0.64079136", "0.64071834", "0.63975394", "0.63820004", "0.63608706", "0.6357764", "0.6314866", "0.62926275", "0.62794507", "0.62553704", "0.6232246", "0.61996555", "0.6191897", "0.6178474", "0.6166091", "0.6152036", "0.614789", "0.61156434", "0.611386", "0.61006373", "0.6098465", "0.6090528", "0.6049815", "0.60475385", "0.6041778", "0.6013025", "0.60088265", "0.60086447", "0.60084754", "0.60075295", "0.5992389", "0.59768695", "0.5932185", "0.59267324", "0.5917148", "0.58874196", "0.5871416", "0.5870427", "0.58671993", "0.58671993", "0.5851169", "0.5850969", "0.58434325", "0.5843111", "0.5834454", "0.581614", "0.5809769", "0.5802762", "0.57966787", "0.5794122", "0.5790693", "0.57868004", "0.578337", "0.57712257", "0.5758704", "0.57388306", "0.5733483", "0.5733441", "0.57255495", "0.5716183", "0.5708383", "0.57068187", "0.56654656", "0.56654656", "0.56643033", "0.56344086", "0.5591271", "0.55909044", "0.5589232", "0.5581229", "0.5570823", "0.55542284", "0.55448747", "0.55262417", "0.5526153", "0.5523664", "0.54995775", "0.5491609", "0.5489498", "0.5484963", "0.54849523" ]
0.7412197
1
Takes the ArrayList generated by the main method as input Sorts ISBNs and ratings according to increasing userID
public static void userSort(ArrayList<String>list) throws FileNotFoundException{ Collections.sort(list, new Comparator<String>(){ @Override public int compare(String o1, String o2) { // TODO Auto-generated method stub //Take the first string, split according to ";", and store in an arraylist String[] values = o1.split(";"); //Take the second string and do the same thing String[] values2 = o2.split(";"); //Compare strings according to their integer values return Integer.valueOf(values[0].replace("\"", "")).compareTo(Integer.valueOf(values2[0].replace("\"", ""))); } }); //Output sorted ArrayList to a text file @SuppressWarnings("resource") PrintStream out = new PrintStream(new FileOutputStream("SortedUsers.txt")); for(int i = 0; i < list.size(); i++){ out.println(list.get(i)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void sortRating()\n {\n for(int i = 0; i < movieList.size(); i++){\n for(int j = 1; j < movieList.size() - i; j++)\n {\n Movie a = movieList.get(j-1);\n Movie b = movieList.get(j);\n int result = a.getRating().compareTo(b.getRating());\n if(result < 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n else if(result == 0)\n {\n result = a.getTitle().compareTo(b.getTitle());\n if(result > 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n }\n }\n }\n }", "public static void printArray(ArrayList arr, int userId) {\n int itemId = 13;\n ArrayList<SimNode> similarUsers = arr;\n System.out.println(\"Size of similar users of user \" + userId + \": \" + similarUsers.size());\n int n = similarUsers.size();\n int knn = 18;\n double predictedRating = 0, similaritySum = 0, ratingSum = 0;\n int pureRatingUser = 0, noSimilarUser = 0;\n for (int i = 0; i < knn; i++) {\n\n SimNode similarUser = similarUsers.get(n - i - 1);\n String rate = filmTrust.getRateOfItem(similarUser.getId(), itemId);\n\n double similarity = similarUser.getSimilaritySimNode();\n if (similarity == 0) {\n noSimilarUser++;\n }\n if (noSimilarUser > knn) {\n break;\n }\n System.out.printf(\"%-20s%-30s%-20s%-20s%n\", similarUser.getData(), similarity == 0 ? \"noSimilarity\" : similarity, \"rate to item \" + itemId + \" : \", rate);\n if (similarUser.getId() == userId) {\n continue;\n }\n\n if (similarity == 0) {\n continue;\n }\n\n if (rate.equals(\"noRating\")) {\n continue;\n }\n similaritySum += similarity;\n pureRatingUser++;\n if (pureRatingUser >= knn) {\n break;\n }\n double similarUserRating = Double.valueOf(rate);\n ratingSum += similarUserRating * similarity;\n\n //predictedRating += (1d/(i+1))*similarUserRating;\n } // end of for knn\n //predictedRating /= pureRatingUser;\n //predictedRating *= similaritySum;\n predictedRating = ratingSum / similaritySum;\n System.out.println(\"pure similar users: \" + pureRatingUser + \" and sum of similarities: \" + similaritySum);\n\n System.out.println(\"** pridicted rating of item \" + itemId + \" for user \" + userId + \" : \" + predictedRating);\n }", "public static void main(String[] args) {\n \tArrayList<User> users = new ArrayList<User>(); //create arraylist of users\n\n for (String str : Data.users) {\n String [] data = str.split(\",\");\n // create custom user and assign data from array\n User user = new User(data[0], data[1], Integer.parseInt(data[2]), data[3], data[4], data[5], data[6]); \n users.add(user); // add user to arraylist\n }\n Collections.sort(users, new SortbyAge()); // sort users by age using custom comparator\n //print top 10 users\n for (int i=0; i < 11; i++) {\n users.get(i).printUser(); \n }\n }", "public void sortByRating() {\n Log.d(Contract.TAG_WORK_PROCESS_CHECKING, \"ListPresenter - sortByRating\");\n\n listInteractor.sortByRating(new ListCallback() {\n @Override\n public void setPhotosList(List<BasePojo.Result> photosList) {\n Log.d(Contract.TAG_WORK_PROCESS_CHECKING, \"ListPresenter - sortByRating - setPhotosList\");\n\n getViewState().setData(photosList);\n }\n });\n }", "public static void main(String[] args) {\n\n\t\tArrayList<Integer> unsort =new ArrayList<Integer>();\n\t\tunsort.add(21);\n\t\tunsort.add(24);\n\t\tunsort.add(42);\n\t\tunsort.add(29);\n\t\tunsort.add(23);\n\t\tunsort.add(13);\n\t\tunsort.add(8);\n\t\tunsort.add(39);\n\t\tunsort.add(38);\n\t\t\n\t\tArrayList<Card> cards = new ArrayList<Card>();\n\t\tcards.add(new Card(\"Heart\",13));\n\t\tcards.add(new Card(\"Heart\",2));\n\t\tcards.add(new Card(\"Heart\",4));\n\t\t\n\t\tArrayList<Card> sort = Sort.insertSort(cards,false);\n\t\t\n\t\tfor(Card i: sort) \n\t\t{\n\t\t\tSystem.out.println(i.getNumber());\n\t\t}\n\t\t\n\t}", "public static void userSort(ArrayList<FileData> fromFile, int primary_sort, int secondary_sort, int primary_order, int secondary_order)\n {\n \n // user wants to sort by primary = state code and secondary = county code\n if(primary_sort == 1 && secondary_sort == 2) \n {\n if(primary_order == 1 && secondary_order == 1){// user wants both primary and secondary in ascending order\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n }\n }\n else if(primary_order == 2 && secondary_order == 2){ // user wants both primary and secondary in decending order\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){// primary is ascending\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){//primary is descending\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n Collections.sort(fromFile,new Sort_County_Code()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n // user wants to sort by primary = county code and secondary = state code\n if(primary_sort == 2 && secondary_sort == 1){\n if(primary_order == 1 && secondary_order == 1){\n //primary and seconary is ascending\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order == 2 && secondary_order == 2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){//primary is ascending\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n Collections.sort(fromFile,new Sort_County_Code()); // primary sort\n \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){//primary is descending\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Code().reversed()); // primary sort\n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==1&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new Sort_State_Code()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new Sort_State_Name()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new Sort_State_Name().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==1&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new Sort_State_Code()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new Sort_County_Name()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new Sort_County_Name().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n if(primary_sort==1&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortFirstConfirmCount());\n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information \n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information \n } \n } \n }\n \n \n if(primary_sort==1&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); \n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); \n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n } \n } \n }\n \n if(primary_sort==6&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==1&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==7&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==1&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n \n if(primary_sort==8&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==2&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new Sort_County_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new Sort_State_Name().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==2&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new Sort_County_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new Sort_County_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new Sort_County_Name().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==2&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n \n if(primary_sort==2&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n if(primary_sort==6&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n \n if(primary_sort==2&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n if(primary_sort==7&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==2&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n if(primary_sort==8&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n \n if(primary_sort==3&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==4&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==5&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==6&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==7&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==8&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==6&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==7&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==8&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==6&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==7&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==8&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==6&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==7&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==6&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==8&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==7&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==8&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order == 2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n }", "public ArrayList<Map.Entry<String, Double>> recommendations(int number){\r\n\t\tArrayList<Map.Entry<String, Double>> res = new ArrayList<Map.Entry<String, Double>>();\r\n\t\t//Create a heap for storing the movies and sorting them by the predict rates.\r\n\t\tPriorityQueue<Map.Entry<String, Double>> heap = new PriorityQueue<Map.Entry<String, Double>>(read.rateMap.get(userID).size(), new Comparator<Map.Entry<String, Double>>() {\r\n\t\t\tpublic int compare(Map.Entry<String, Double> a, Map.Entry<String, Double> b){\r\n\t\t\t\treturn -1 * (a.getValue().compareTo(b.getValue()));\r\n\t\t\t}\r\n\t\t});\r\n\t\tfor(int i = 0; i < read.rateMap.get(userID).size(); i++){\r\n\t\t\theap.add(read.rateMap.get(userID).get(i));\r\n\t\t}\r\n\t\tfor(Integer i : read.rateMap.keySet()){\r\n\t\t\tfor(int j = 0; j < read.rateMap.get(i).size(); j++){\r\n\t\t\t\tif(!ratedID.contains(read.rateMap.get(i).get(j).getKey())){\r\n\t\t\t\t\tdouble predict = this.prediction(read.rateMap.get(i).get(j).getKey());\r\n\t\t\t\t\tMap.Entry<String, Double> newest = new AbstractMap.SimpleEntry(read.rateMap.get(i).get(j).getKey(), predict);\r\n\t\t\t\t\t//Optimization starts here....\r\n\t\t\t\t\tif(fuckUser){\r\n\t\t\t\t\t\tres.add(newest);\r\n\t\t\t\t\t\tif(res.size() == number){\r\n\t\t\t\t\t\t\treturn res;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(predict > read.maxScore - 1){\r\n\t\t\t\t\t\t\theap.add(newest);\r\n\t\t\t\t\t\t\tif(heap.size() >= (number + read.rateMap.get(userID).size())){\r\n\t\t\t\t\t\t\t\tfor(int k = 0; k < number; k++){\r\n\t\t\t\t\t\t\t\t\tres.add(heap.poll());\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\treturn res;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn res;\r\n\t}", "private void sortArticlesByRating() {\n final DatabaseReference database;\n database = FirebaseDatabase.getInstance().getReference();\n\n database.child(\"Ratings\").addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n Map<Double,ArrayList<Article>> articlesTreeMap;\n articlesTreeMap = new TreeMap<>(Collections.reverseOrder());\n for(Article a : articles) {\n DataSnapshot ratingArticleSnapShot = null;\n for (DataSnapshot snapshot : dataSnapshot.getChildren()) {\n if (a.getLink() != null && a.getLink() != \"\" && snapshot.child(\"Link\").getValue().equals(a.getLink())) {\n ratingArticleSnapShot = snapshot;\n break;\n }\n }\n Double rating = 0.0;\n if (ratingArticleSnapShot != null) {\n int totalVoteCount = 0, weightedSum = 0;\n for(int i=1 ;i<=5 ;i++) {\n int numberOfVotes = Integer.parseInt(ratingArticleSnapShot.child(\"Votes\").child(String.valueOf(i)).getValue().toString());\n weightedSum += (i * numberOfVotes);\n totalVoteCount += numberOfVotes;\n }\n rating = ((double) weightedSum) / ((double) totalVoteCount);\n }\n if(!articlesTreeMap.containsKey(rating)) {\n articlesTreeMap.put(rating, new ArrayList<Article>());\n }\n articlesTreeMap.get(rating).add(a);\n }\n\n articles.clear();\n for(Map.Entry<Double,ArrayList<Article>> entry : articlesTreeMap.entrySet()) {\n ArrayList<Article> list = entry.getValue();\n articles.addAll(list);\n }\n mSectionsPagerAdapter.notifyDataSetChanged();\n }\n\n @Override\n public void onCancelled(DatabaseError d) {\n Log.d(\"Login DbError Msg ->\", d.getMessage());\n Log.d(\"Login DbError Detail ->\", d.getDetails());\n }\n });\n }", "public void sortGivenArray_popularity() { \n int i, j, k; \n for(i = movieList.size()/2; i > 0; i /= 2) {\n for(j = i; j < movieList.size(); j++) {\n Movie key = movieList.get(j);\n for(k = j; k >= i; k -= i) {\n if(key.rents > movieList.get(k-i).rents) {\n movieList.set(k, movieList.get(k-i));\n } else {\n break; \n }\n }\n movieList.set(k, key);\n }\n } \n }", "static void billingCounter(int gifts[],int no_of_user){\n int gift_copy[]=gifts.clone();\n for(int pass=0; pass<no_of_user-1;pass++){\n int flag=0;\n for(int i=0;i<no_of_user-1-pass;i++){\n if(gift_copy[i]<gift_copy[i+1]){\n int temp=gift_copy[i];\n gift_copy[i]=gift_copy[i+1];\n gift_copy[i+1]=temp;\n flag=+1;\n }\n }\n if(flag==0){\n /* if flag becomes 0 means our array is now sorted so need to go further it is used to reduce the complexity */\n break;\n } \n }\n display(gifts,gift_copy,no_of_user); // calling the display function for displaying the output\n\n }", "public Analyse(int thresh, int userID){\r\n\t\tthis.thresh = thresh;\r\n\t\t//Switch the data files here\r\n//\t\tread = new Read(\"ratings.dat\", \"movies.dat\");\r\n\t\tread = new Read(\"BX-Book-Ratings.csv\");\r\n//\t\tread = new Read(\"ratings.csv\");\r\n//\t\tread = new Read(\"fullratings.csv\");\r\n\t\tread.readData();\r\n\t\tthis.userID = userID;\r\n\t\tsimilarity = new HashMap<Integer, Double>();\r\n\t\tSystem.out.println(\"userID:\" + this.userID);\r\n\t\tthis.fuckUser = false;//Set false by default.\r\n\t\tthis.ratedID = new ArrayList<String>();\r\n\t\tfor(int i = 0; i < read.rateMap.get(this.userID).size(); i++){\r\n\t\t\tratedID.add(read.rateMap.get(userID).get(i).getKey());\r\n\t\t}\r\n\t\taverage = new HashMap<Integer, Double>();\r\n\t\tfor(Integer i : read.rateMap.keySet()){\r\n\t\t\tArrayList<Map.Entry<String, Double>> list = read.rateMap.get(i);\r\n\t\t\tdouble sum = 0;\r\n\t\t\tfor(int j = 0; j < list.size(); j++){\r\n\t\t\t\tsum += list.get(j).getValue(); \r\n\t\t\t}\r\n\t\t\tdouble aver = sum / read.rateMap.get(i).size();\r\n\t\t\taverage.put(i, aver);\r\n\t\t}\r\n\t\tuserAverageRate = average.get(this.userID);\r\n\t\t//Calculate the average rate for this user.\r\n\t\t//Choose the similarity calculation methods here\r\n\t\tthis.getSimilarity();\r\n//\t\tthis.getCosineSimilarity();\r\n\t}", "public void sort10(){\r\n\t\tArrayList<wifi> temp = new ArrayList<>();\r\n\t\tfor(int i=0; i<wifis.size() && i<10; i++)\r\n\t\t\ttemp.add(wifis.get(i));\r\n\t\twifis = temp;\r\n\t}", "public static ArrayList<String> Externalexp1Sort(ArrayList<String> source)\n throws Exception {\n // file\n // ArrayList<Long> k = new ArrayList<Long>();\n // k.add(0L);\n // k.add(0L);\n // k.add(0L);\n // Long repeat = 0L;\n\n PriorityQueue<KVPair> heap = new PriorityQueue<KVPair>(20,\n new UserPrio());\n ArrayList<CsvReader> readers = new ArrayList<CsvReader>();\n // user_tweets output\n PrintWriter writer = new PrintWriter(new FileWriter(user_tweets));\n\n writer2 = new CsvWriter(new OutputStreamWriter(new FileOutputStream(\n SORT_USER_FN + fileNum + \".csv\"), \"UTF-8\"), ',');\n\n // open files\n for (String fileName : source) {\n // get read csv files\n CsvReader reader = new CsvReader(new InputStreamReader(\n new FileInputStream(fileName), \"UTF-8\"));\n reader.setHeaders(Merge.fields);\n // read a line and put into heap\n if (reader.readRecord()) {\n heap.offer(new KVPair(Merge.readRecord(reader), readers.size()));\n }\n readers.add(reader);\n }\n\n // get same key\n KVPair last = null;\n HashMap<Long, Record> sameRecord = new HashMap<Long, Record>();\n\n while (heap.size() > 0) {\n KVPair tmp = heap.poll();\n\n if (last != null && last.record.userid != tmp.record.userid) {\n writer.println(last.record.userid + \",\" + sameRecord.size());\n\n // print records to file\n writeRecords(sameRecord.values());\n\n sameRecord = new HashMap<Long, Record>();\n\n }\n\n // if (sameRecord.containsKey(tmp.record.tweetid)) {\n // repeat ++;\n // System.out.println(tmp.record.tweetid +\" : \" + repeat);\n // }\n\n sameRecord.put(tmp.record.tweetid, tmp.record);\n\n // read next record in the same file\n if (readers.get(tmp.file).readRecord()) {\n\n // k.set(tmp.file, k.get(tmp.file)+1);\n // System.out.println(k);\n\n heap.offer(new KVPair(Merge.readRecord(readers.get(tmp.file)),\n tmp.file));\n } else {\n readers.get(tmp.file).close();\n }\n last = tmp;\n }\n\n // last part of external sort\n if (sameRecord.size() != 0) {\n writer.println(last.record.userid + \",\" + sameRecord.size());\n\n // print records to file\n writeRecords(sameRecord.values());\n }\n\n writer.close();\n\n writer2.flush();\n writer2.close();\n\n return source;\n }", "public ArrayList<UserItem> getAllUserItems(String userID) {\n ConnectionPool pool = ConnectionPool.getInstance();\n Connection connection = pool.getConnection();\n PreparedStatement ps = null;\n ResultSet rs = null;\n ArrayList<UserItem> uItems = new ArrayList<>();\n \n String query = \"SELECT * FROM userItems \"\n + \"WHERE UserID = ?\";\n\n try {\n ps = connection.prepareStatement(query);\n ps.setString(1, userID);\n rs = ps.executeQuery();\n \n ItemDB db = new ItemDB();\n \n while (rs.next()) { \n UserItem itemRating = new UserItem();\n String itemCode = rs.getString(\"itemCode\");\n Item i = db.getItem(itemCode);\n itemRating.setItem(i);\n itemRating.setRating(rs.getString(\"rating\"));\n itemRating.setItemCode(itemCode);\n itemRating.setUserID(userID);\n itemRating.setMadeIt(rs.getBoolean(\"madeIt\"));\n uItems.add(itemRating);\n }\n \n } catch (SQLException se) {\n System.out.println(\"ERROR: Could not execute SQL statement in: \" + \"ItemDB.getAllUserItems()\");\n System.out.println(\"ERROR: Could not execute SQL statement: \" + se);\n return null;\n } finally {\n DBUtil.closeResultSet(rs);\n DBUtil.closePreparedStatement(ps);\n pool.freeConnection(connection);\n }\n return uItems;\n\n }", "public static void Externalexp2Sort(ArrayList<String> source)\n throws IOException {\n PriorityQueue<KVPair> heap = new PriorityQueue<KVPair>(20,\n new UserPrio());\n ArrayList<CsvReader> readers = new ArrayList<CsvReader>();\n // user_tweets output\n PrintWriter writer = new PrintWriter(new FileWriter(user_retweet));\n\n // open files\n for (String fileName : source) {\n // get read csv files\n CsvReader reader = new CsvReader(new InputStreamReader(\n new FileInputStream(fileName), \"UTF-8\"));\n reader.setHeaders(Merge.fields);\n // read a line and put into heap\n if (reader.readRecord()) {\n heap.offer(new KVPair(Merge.readRecord(reader), readers.size()));\n }\n readers.add(reader);\n }\n\n // get same key\n KVPair last = null;\n HashSet<Long> sameRecord = new HashSet<Long>();\n\n while (heap.size() > 0) {\n KVPair tmp = heap.poll();\n\n // no retweet directly read the next\n if (tmp.record.retweet != -1) {\n if (last != null && last.record.retweet != -1\n && last.record.retweet != tmp.record.retweet) {\n StringBuilder builder = new StringBuilder(\n last.record.retweet + \",\");\n\n for (Long userid : sameRecord) {\n builder.append(userid);\n builder.append(\" \");\n }\n writer.println(builder);\n sameRecord = new HashSet<Long>();\n }\n sameRecord.add(tmp.record.userid);\n }\n\n // read next record in the same file\n if (readers.get(tmp.file).readRecord()) {\n heap.offer(new KVPair(Merge.readRecord(readers.get(tmp.file)),\n tmp.file));\n } else {\n readers.get(tmp.file).close();\n }\n last = tmp;\n }\n\n // last part of external sort\n if (sameRecord.size() != 0) {\n StringBuilder builder = new StringBuilder(last.record.retweet + \",\");\n\n for (Long userid : sameRecord) {\n builder.append(userid);\n builder.append(\" \");\n }\n writer.println(builder);\n }\n\n writer.close();\n }", "public void getRankingData(ArrayList<RankingItem> arrayList,int persusernr){\n int persRank = 0;\n for(int i=0;i<arrayList.size();i++){\n if(persusernr == arrayList.get(i).getUsernr()){\n persRank = arrayList.get(i).getRank();\n }\n }\n rankingData.clear();\n if(persRank>3){\n rankingData.add(arrayList.get(0));\n rankingData.add(arrayList.get(1));\n rankingData.add(arrayList.get(2));\n rankingData.add(arrayList.get(persRank-2));\n rankingData.add(arrayList.get(persRank-1));\n if(persRank != arrayList.size()){\n rankingData.add(arrayList.get(persRank));\n }\n\n }else{\n for(int i=0;i<6;i++){\n rankingData.add(arrayList.get(0));\n }\n }\n }", "private void sort() {\n ScoreComparator comparator = new ScoreComparator();\n Collections.sort(scores, comparator);\n }", "public static void listByRating(){\r\n System.out.println('\\n'+\"List by Rating\");\r\n CompareRatings compareRatings = new CompareRatings();\r\n Collections.sort(movies, compareRatings);\r\n for (Movie movie: movies){\r\n System.out.println('\\n'+\"Rating: \"+ movie.getRating()+'\\n'+\"Title: \"+ movie.getName()+'\\n'+\"Times Watched: \"+ movie.getTimesWatched()+'\\n');\r\n }\r\n }", "public void sort_crystals() {\n\t\tArrays.sort(identifiedArray, new SortByRating()); \n\t}", "private Artist[] getTop10(List<User> users){\n\t\tArtist[] top=new Artist[10];\n\t\tHashMap<Artist, Integer> rank=new HashMap<Artist,Integer>();\n\t\tfor(User u:users) {\n\t\t\tfor(int i=0;i<u.artists.size();i++) {\n\t\t\t\tArtist a=u.artists.get(i);\n\t\t\t\tInteger weight=rank.getOrDefault(a, 0);\n\t\t\t\trank.put(a, weight+u.artistsWeights.get(i));\n\t\t\t}\n\t\t}\n\t\tArrayList<Artist>ranking=new ArrayList<Artist>();\n\t\tranking.addAll(rank.keySet());\n\t\tranking.sort((a1,a2)->rank.get(a2)-rank.get(a1));\n\t\tfor(int i=0;i<10;i++) {\n\t\t\ttop[i]=ranking.get(i);\n\t\t}\n\t\treturn top;\n\t\t\n\t}", "public void createRatingList() {\n this.ratings = List.of(kriterium1, kriterium2,\n kriterium3, kriterium4, kriterium5, kriterium6, kriterium7, kriterium8);\n }", "public static void main(String[] args) {\n\t\tArrayList<Integer> list = new ArrayList<Integer>();\n\t\tScanner input = new Scanner(System.in);\n\t\tSystem.out.print(\"Enter 5 numbers: \" );\n\t\t\t\t\tint i = 0;\n\t\t\t\t\twhile (i<5) {\n\tlist.add(input.nextInt());\n\ti++;\n\t\t\t}\n\tsort(list);\n\tSystem.out.print(\"List after the sorting: \" );\n\tfor (int j=0; j < list.size(); j++);\n\t}", "public void sortAuthor(){\r\n \r\n Book temp; // used for swapping books in the array\r\n for(int i=0; i<items.size(); i++) {\r\n\r\n\t // Check to see the item is a book. We will only\r\n //use books.\r\n\t if(items.get(i).getItemType() != Item.ItemTypes.BOOK)\r\n\t continue;\r\n\t\t\t\t\t\r\n\t for(int j=i+1; j<items.size(); j++) {\r\n\t\t // We consider only books\r\n\t // We consider only magazines\r\n\t if(items.get(j).getItemType() != Item.ItemTypes.BOOK)\r\n\t\t continue;\r\n\t\t // Compare the authors of the two books\r\n\t if(((Book)items.get(i)).getAuthor().compareTo(((Book)items.get(j)).getAuthor()) > 0) {\r\n\t\t // Swap the items\r\n\t\t temp = (Book)items.get(i);\r\n\t\t items.remove(i);\r\n\t\t items.add(i, items.get(j-1));\r\n\t\t items.remove(j);\r\n\t\t items.add(j, temp);\r\n\t }\r\n\t }\r\n\t }\r\n\t\t// Print the magazines\r\n for(int i=0; i<items.size(); i++)\r\n\t if(items.get(i).getItemType() == Item.ItemTypes.BOOK)\r\n\t\tSystem.out.println(items.get(i).toString());\r\n \t\r\n }", "@Override\n\tpublic double predictUser(int itemID, PriorityQueue<KNNUserVector> knn) {\n\t\tdouble score = 0.0;\n\t\tdouble num = 0.0;\n\n\t\tfor (KNNUserVector similarUser : knn) {\n\t\t\tdouble itemScore = 0;\n\t\t\tif (similarUser.getVector().getRecords().containsKey(itemID)) {\n\t\t\t\titemScore = similarUser.getVector().getRecords().get(itemID);\n\t\t\t} else {\n\t\t\t\titemScore = similarUser.getVector().getAvgScore();\n\t\t\t}\n\t\t\tscore += itemScore;\n\t\t\tnum += 1;\n\t\t}\n\t\tdouble finalscore = (double)score/num;\n\t\treturn finalscore;\n\t}", "private void sortHelper(Vector<Restaurant> vec) {\n for (int i = 1; i < vec.size(); i++) {\n int j = i - 1;\n Restaurant key = vec.get(i);\n while (j >= 0 && !vec.get(j).compareRating(key)) {\n Restaurant temp = vec.remove(j + 1);\n vec.add(j, temp);\n j--;\n }\n }\n }", "public void getSimilarity(){\r\n\t\tfor(Integer i : read.rateMap.keySet()){\r\n\t\t\tif(i != this.userID){\r\n\t\t\t\t//Calculate the average rate.\r\n\t\t\t\tdouble iAverage = average.get(i);\r\n\t\t\t\tdouble a = 0.0;\r\n\t\t\t\tdouble b = 0.0;\r\n\t\t\t\tdouble c = 0.0;\r\n\t\t\t\t//Set a flag by default meaning the user does not have common rate with this user.\r\n\t\t\t\tboolean intersection = false;\r\n\t\t\t\tArrayList<Map.Entry<String, Double>> list = read.rateMap.get(i);\r\n\t\t\t\tfor(int j = 0; j < list.size(); j++){\r\n\t\t\t\t\tdouble userRate = 0;\r\n\t\t\t\t\tif(ratedID.contains(list.get(j).getKey())){\r\n\t\t\t\t\t\t//The user has common rated movies with this user\r\n\t\t\t\t\t\tintersection = true;\r\n\t\t\t\t\t\tfor(int k = 0; k < read.rateMap.get(userID).size(); k++){\r\n\t\t\t\t\t\t\tif(read.rateMap.get(userID).get(k).getKey().equals(list.get(j).getKey())){\r\n\t\t\t\t\t\t\t\tuserRate = read.rateMap.get(userID).get(k).getValue();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\ta += (list.get(j).getValue() - iAverage) * (userRate- this.userAverageRate);\r\n\t\t\t\t\t\tb += (list.get(j).getValue() - iAverage) * (list.get(j).getValue() - iAverage);\r\n\t\t\t\t\t\tc += (userRate - this.userAverageRate) * (userRate - this.userAverageRate);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t//Check if this user rated all the movies with the same rate.\r\n\t\t\t\tif(intersection && c == 0){\r\n\t\t\t\t\tfuckUser = true;//really bad user.\r\n\t\t\t\t\treturn;\r\n\t\t\t\t} \r\n\t\t\t\t//Check if current user rated all the movies with the same rate. If so, just set similarity as 0.\r\n\t\t\t\tif(intersection && b != 0){\r\n\t\t\t\t\tdouble s = a / (Math.sqrt(b) * Math.sqrt(c));\r\n\t\t\t\t\tsimilarity.put(i, s);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tdouble s = 0;\r\n\t\t\t\t\tsimilarity.put(i, s);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Create a heap storing the similarity pairs in a descending order.\r\n\t\tthis.heap = new ArrayList<Map.Entry<Integer, Double>>();\r\n\t\tIterator<Map.Entry<Integer, Double>> it = similarity.entrySet().iterator();\r\n\t\twhile(it.hasNext()){\r\n\t\t\tMap.Entry<Integer, Double> newest = it.next();\r\n\t\t\theap.add(newest);\r\n\t\t}\r\n\t\tCollections.sort(this.heap, new Comparator<Map.Entry<Integer, Double>>() {\r\n\t\t\t@Override\r\n\t\t\tpublic int compare(Map.Entry<Integer, Double> a, Map.Entry<Integer, Double> b){\r\n\t\t\t\treturn -1 * (a.getValue().compareTo(b.getValue()));\r\n\t\t\t}\r\n\t\t});\r\n\t}", "@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n\tprivate static ArrayList<Result> sortByScore(ArrayList<Result> sortThis){\n\t\tArrayList<Result> sorted = sortThis;\n\t\tCollections.sort(sorted, new Comparator(){\n\t\t\t\n\t\t\tpublic int compare(Object o1, Object o2){\n\t\t\t\tResult r1 = (Result) o1;\n\t\t\t\tResult r2 = (Result) o2;\n\n\t\t\t\tDouble Score1 = new Double(r1.getScore());\n\t\t\t\tDouble Score2 = new Double(r2.getScore());\n\t\t\t\treturn Score1.compareTo(Score2);\n\t\t\t}\n\t\t});\n\t\tCollections.reverse(sorted);\n\t\t\n\t\treturn sorted;\n\t}", "public static void sortitems(ArrayList<item> svd)\r\n{\n\r\n\tCollections.sort(svd, new Comparator<item>(){\r\n\t\tpublic int compare(item o1, item o2){\r\n\t\t\t\tif(o1.density == o2.density)\r\n\t\t\t\t\t\t\treturn 0;\r\n\t\t\t\t\t\t\t\t\treturn o1.density > o2.density ? -1 : 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\r\n\r\n}", "public static void main(String[] args) {\n\t\t\r\n\t\tArrayList<Student2> studs = new ArrayList<>();\r\n\t\tstuds.add(new Student2(6,\"neena\"));\r\n\t\tstuds.add(new Student2(1,\"nimmy\"));\r\n\t\tstuds.add(new Student2(4,\"cookie\"));\r\n\t\t\r\n\t\tCollections.sort(studs);\r\n\t\t\r\n\t\tfor(Student2 s : studs) {\r\n\t\t\tSystem.out.println(s);\r\n\t\t}\r\n\r\n\t}", "private void sortUsers(List<User> users) {\n users.sort(Comparator.comparingInt(User::getAge));\n }", "public void printAverageRatings(){\n ThirdRatings sr = new ThirdRatings();\n int raters = sr.getRaterSize();\n System.out.println(\"raters: \" + raters);\n System.out.println(\"-------------------------------------\");\n \n //MovieDatabase.initialize(\"ratedmovies_short.csv\");\n MovieDatabase.initialize(\"ratedmoviesfull.csv\");\n System.out.println(\"movies: \" + MovieDatabase.size());\n System.out.println(\"-------------------------------------\");\n \n \n int minRatings = 35;\n ArrayList<Rating> aveRat = sr.getAverageRatings(minRatings);\n System.out.println(\"Number of ratings at least \" + minRatings + \": \" + aveRat.size());\n // sort arraylist\n Collections.sort(aveRat);\n for(Rating r: aveRat){\n System.out.println(r.getValue() + \" : \" + MovieDatabase.getTitle(r.getItem()));\n }\n System.out.println(\"-------------------------------------\");\n \n// Filter f = new AllFilters();\n// f.addFilter(new YearsAfterFilter(2001));\n ArrayList<String> movies = MovieDatabase.filterBy(new YearAfterFilter(2001)); \n int c = 0;\n for(Rating r: aveRat){\n if(movies.contains(r.getItem())){c++;}\n }\n System.out.println(\"Number of ratings at least \" + minRatings + \" and made on or after 2001 : \" + c);\n System.out.println(\"-------------------------------------\");\n \n \n \n }", "public void getInactiveUsersBasedOnComments(){\n Map<Integer,User> users = DataStore.getInstance().getUsers();\n List<User> usersCommentList = new ArrayList<>(users.values());\n \n Comparator<User> test3 = new Comparator<User>() {\n @Override\n public int compare(User u1, User u2) {\n return u1.getComments().size() - u2.getComments().size();\n }\n };\n Collections.sort(usersCommentList, test3);\n \n System.out.println(\"\\nTop five inactive users based on comments:\");\n for(int i = 0; i<usersCommentList.size() && i <5; i++){\n System.out.println(\"User ID :\" + usersCommentList.get(i).getId() +\" \"+ \"No. of Comments:\" + usersCommentList.get(i).getComments().size());\n }\n }", "protected void sort() {\n\n\t\tCollections.sort(this.myRRList);\n\t}", "int[] recommendListForOneUser(int paraUserIndex, double paraLikeThreshold, int paraK, int paraN, double paraBelta,\n\t\t\tdouble paraGama) {\n\t\t// System.out.println(\"the user is \" + paraUserIndex + \" , the length is \" +\n\t\t// dataModel.uTeRateInds[paraUserIndex].length);\n\t\tint[] tempRecLists = new int[dataModel.uTeRateInds[paraUserIndex].length];\n\t\tdouble[] itemLikeRatio = new double[dataModel.uTeRateInds[paraUserIndex].length];\n\t\t// int[] itemLike = new int[dataModel.uTeRateInds[paraUserIndex].length];\n\t\t// for (int i = 0; i < itemLike.length; i++) {\n\t\t// itemLike[i] = -1;\n\t\t// }\n\t\tArrays.fill(tempRecLists, -1);\n\t\tArrays.fill(itemLikeRatio, -1);\n\t\t// Arrays.fill(itemLike, -1);\n\t\tint tempCount = 0;\n\t\t// Step 1. Predict the distribution\n\t\tfor (int i = 0; i < dataModel.uTeRateInds[paraUserIndex].length; i++) {\n\t\t\tisFriends = true;\n\t\t\tint[] tempDistribution = predict(paraUserIndex, dataModel.uTeRateInds[paraUserIndex][i], paraK);\n\n\t\t\t// System.out.println(\"the distribution is \" +\n\t\t\t// Arrays.toString(tempDistribution));\n\t\t\t// System.out.println(\"the IndicesOfFriendsRatedItem is \" +\n\t\t\t// Arrays.toString(IndicesOfFriendsRatedItem));\n\n\t\t\tif (tempDistribution == null) {\n\t\t\t\tcontinue;\n\t\t\t} // Of if\n\t\t\tdouble tempLikePro = 0;\n\t\t\tint tempTotal = 0;\n\t\t\tfor (int j = 0; j < tempDistribution.length; j++) {\n\t\t\t\tif (j >= paraLikeThreshold) {\n\t\t\t\t\ttempLikePro += (IndicesOfFriendsRatedItem[j] * 1\n\t\t\t\t\t\t\t+ (tempDistribution[j] - IndicesOfFriendsRatedItem[j]) * paraBelta);\n\t\t\t\t} // Of if\n\t\t\t\ttempTotal += (IndicesOfFriendsRatedItem[j] * 1\n\t\t\t\t\t\t+ (tempDistribution[j] - IndicesOfFriendsRatedItem[j]) * paraBelta);\n\t\t\t} // Of for i\n\n\t\t\t// System.out.println(tempLikePro + \" / \" + tempTotal);\n\n\t\t\tif (tempTotal > 1e-6) {\n\t\t\t\ttempLikePro = tempLikePro / tempTotal;\n\t\t\t} // Of if\n\n\t\t\t// Step 3. Obtain the recommend lists.\n\t\t\ttempRecLists[tempCount] = dataModel.uTeRateInds[paraUserIndex][i];\n\t\t\tif(isFriends) {//friend relationships\n\t\t\t\titemLikeRatio[tempCount] = tempLikePro;\n\t\t\t}else {//kNN\n\t\t\t\titemLikeRatio[tempCount] = tempLikePro * paraGama;\n\t\t\t}\n\t\t\t// itemLike[tempCount] = dataModel.uTeRateInds[paraUserIndex][i];\n\t\t\ttempCount++;\n\t\t} // Of for i\n\n\t\t// System.out.println(\"the reclist = \" + Arrays.toString(tempRecLists));\n\t\t// System.out.println(\"the itemLikeRatio = \" + Arrays.toString(itemLikeRatio));\n\t\t// System.out.println(\"the itemLike = \" + Arrays.toString(itemLike));\n\n\t\t// Step 4. Compress\n\t\tif (tempCount < paraN) {\n\t\t\treturn null;\n\t\t} // Of if\n\n\t\tint[] tempCompRecLists = new int[tempCount];\n\t\tdouble[] tempCompRecRatio = new double[tempCount];\n\t\tfor (int i = 0; i < tempCount; i++) {\n\t\t\ttempCompRecLists[i] = tempRecLists[i];\n\t\t\ttempCompRecRatio[i] = itemLikeRatio[i];\n\t\t} // Of for i\n\t\t\t// System.out.println(\"the recommend list's length is \" +\n\t\t\t// tempCompRecLists.length);\n\n\t\titemLike = orderItemLike(tempCompRecRatio, tempCompRecLists);\n\t\t// System.out.println(\"the itemLike = \" + Arrays.toString(itemLike));\n\n\t\tint[] result = new int[paraN];\n\t\tfor (int i = 0; i < paraN; i++) {\n\t\t\tresult[i] = itemLike[i];\n\t\t} // Of for i\n\t\tArrays.sort(result);\n\t\treturn result;\n\t}", "public static void topXSimpleLTVCustomer(int x,Data data){\n ArrayList<OutPut> outputlist = new ArrayList<OutPut>();\n HashMap<String, HashMap<Long, ArrayList<Order>>> hashmap = data.getOrderdata();;\n\n //getting all customers output and storing them in the arraylist\n for(String customers: hashmap.keySet()){\n //System.out.println(\"customers : \"+customers);\n HashMap<Long, ArrayList<Order>> hashmapweeknumber = hashmap.get(customers);\n double sum =0;\n double a = 0;\n int weekNumbersSize = hashmapweeknumber.size();\n double sumCustomerExpenditurePerVisit = 0;\n for(long weeknumbers: hashmapweeknumber.keySet()){\n //System.out.println(\"weeknumbers : \"+weeknumbers);\n ArrayList<Order> orders = hashmapweeknumber.get(weeknumbers);\n int size = orders.size();\n int i=0;\n double customerExpendituresPerVisit = 0;\n int totalNumberOfVisits= size;\n while(i<size) {\n sum = sum + orders.get(i).getTotal_amount();\n i++;\n }\n customerExpendituresPerVisit = sum/size;\n sumCustomerExpenditurePerVisit = sumCustomerExpenditurePerVisit + customerExpendituresPerVisit;\n //System.out.println(sum/size);\n }\n //a contains the average customer value per week\n a = sumCustomerExpenditurePerVisit/weekNumbersSize;\n //simpleLTF contains the life time customer value\n double simpleLTF = (52*a)*10;\n OutPut output = new OutPut();\n output.setCustomer_id(customers);\n output.setCustomer_ltf(simpleLTF);\n outputlist.add(output);\n }\n\n //Sorts all the custoemrs in the arraylist.\n Collections.sort(outputlist, new OutputSorter());\n //getting the top x customers from all the customers\n if(outputlist.size()<x){\n System.out.println(\"number of of customers in the data are less than x value, please provide smaller x value\");\n }else{\n System.out.println(\"\");\n System.out.println(\"Top \"+x+\" customers with highest Simple LTV are : \");\n\n for(int i=0; i<x;i++){\n System.out.println(outputlist.get(i).getCustomer_id()+\" : \"+outputlist.get(i).getCustomer_ltf());\n }\n }\n\n }", "public void sort()\n\t{\n\t\tfor(int i=0;i<bowlers.size()-1;i++)\n\t\t{\n\t\t\tfor(int j=i+1;j<bowlers.size();j++)\n\t\t\t{\n\t\t\t\tif(bowlers.get(i).getBall()<bowlers.get(j).getBall())\n\t\t\t\t{\n\t\t\t\t\tBowler bowler=bowlers.get(i);\n\t\t\t\t\tbowlers.set(i,bowlers.get(j));\n\t\t\t\t\tbowlers.set(j,bowler);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=0;i<bowlers.size();i++)\n\t\t{\n\t\tSystem.out.println(bowlers.get(i).getBall());\n\t\t}\n\t}", "public static void main(String[] args)\n {\n // create an ArrayList of integers, then call mySort to sort it\n }", "void getUserRatings(String uidRated, final RatingListResult result);", "public Artist[] getTop10(int userID) {\n\t\tUser user=users.get(userID);\n\t\tArrayList<User> users=new ArrayList<User>();\n\t\tusers.addAll(user.friends);\n\t\tusers.add(user);\n\t\treturn getTop10(users);\n\t}", "public static void main(String[] args) {\n ArrayList<BankAccount> accounts = makeBankingSystem();\n \n Collections.sort(accounts, BankAccount.createComparatorByBalance(false));\n for (BankAccount c: accounts){\n System.out.println(c.getName(c)+\", \"+c.getBalance(c));\n \n }\n \n}", "void getGivenUserRating(String uidRater, final RatingListResult result);", "public void generateResultsList(){\n int win = 0, loss = 0, tie = 0;\n int selectedUserID = userAccounts.get(nameBox.getSelectedIndex()).getUserID();\n rankedResults = new ArrayList<RankedItem>();\n\n //for each item generate results\n for (TestItem testItem : testItems) {\n //for each test session check user id\n for(TestSession testSession: testSessions) {\n //if the session belongs to the user selected, then continue\n if (testSession.getUserID() == selectedUserID){\n //parse each object in the results list for data\n for (TestResult testResult : testResults) {\n //if the result belongs to the session in the current iteration, and the result is for the item in the current iteration, then count the result\n if (testItem.getItemID() == testResult.getItemID() && testSession.getSessionID() == testResult.getSessionID()) {\n switch (testResult.getResult()) {\n case 1:\n win++;\n break;\n case 0:\n tie++;\n break;\n case -1:\n loss++;\n break;\n }\n }\n }\n }\n }\n\n //write the data to the ranked items list after parsing\n rankedResults.add(new RankedItem(testItem, win, loss, tie));\n //reset counters\n win = 0;\n loss = 0;\n tie = 0;\n }\n }", "private static ArrayList<MP> rankSimilarMPs(ArrayList<MP> pSelectedMPs)\n\n\t{\n\t\t// HashMap is used to provide an easy way to keep only the highest score for each MP.\n\t\tHashMap<String, Double> ratedMPsMap = new HashMap<String, Double>();\n\t\tHashMap<String, Double> tempRatedMPs;\n\t\tArrayList<RatedMP> sortedMPsArray = new ArrayList<RatedMP>(); // will be used to sort the MPs by their rating.\n\t\tfor (MP mp : pSelectedMPs)\n\t\t{\n\t\t\ttempRatedMPs = getSimilarMPs(mp);\n\t\t\tfor (String key : tempRatedMPs.keySet())\n\t\t\t{\n\t\t\t\t// if this is the first MP we look at, put all the MPs into the hashmap\n\t\t\t\tif (!ratedMPsMap.containsKey(key))\n\t\t\t\t{\n\t\t\t\t\tratedMPsMap.put(key, tempRatedMPs.get(key));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// otherwise, keep only the lowest (best) similarity score for any MP.\n\t\t\t\t\tif (ratedMPsMap.get(key) > tempRatedMPs.get(key))\n\t\t\t\t\t{\n\t\t\t\t\t\tratedMPsMap.put(key, tempRatedMPs.get(key));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (String key : ratedMPsMap.keySet())\n\t\t{\n\t\t\t// Convert the hashmap into an ArrayList.\n\t\t\tsortedMPsArray.add(new RatedMP(Capone.getInstance().getParliament().getMP(key), ratedMPsMap.get(key)));\n\t\t}\n\t\tCollections.sort(sortedMPsArray); // sort the MPs by their ratings.\n\t\t// return the MPs in sorted order - without the MPs in the original parameter list.\n\t\treturn removeOverlap(convertToRatedMPList(sortedMPsArray), pSelectedMPs);\n\t}", "private void sortResults(){\r\n this.sortedPlayers = new ArrayList<>();\r\n int size = players.size();\r\n while (size > 0) {\r\n Player lowestPointsPlayer = this.players.get(0);\r\n for(int i = 0; i<this.players.size(); i++){\r\n if(lowestPointsPlayer.getPoints() <= this.players.get(i).getPoints()){\r\n lowestPointsPlayer = this.players.get(i);\r\n }\r\n }\r\n this.sortedPlayers.add(lowestPointsPlayer);\r\n this.players.remove(lowestPointsPlayer);\r\n size--;\r\n }\r\n\r\n\r\n }", "public void printAverageRatingsByDirectors(){\n ThirdRatings sr = new ThirdRatings();\n int raters = sr.getRaterSize();\n System.out.println(\"read data for \" + raters + \" raters\");\n System.out.println(\"-------------------------------------\");\n \n //MovieDatabase.initialize(\"ratedmovies_short.csv\");\n MovieDatabase.initialize(\"ratedmoviesfull.csv\");\n System.out.println(\"read data for \" + MovieDatabase.size() + \" movies\");\n System.out.println(\"-------------------------------------\");\n \n Filter f = new DirectorsFilter(\"Clint Eastwood,Joel Coen,Martin Scorsese,Roman Polanski,Nora Ephron,Ridley Scott,Sydney Pollack\"); \n int minRatings = 4;\n ArrayList<Rating> aveRat = sr.getAverageRatingsByFilter(minRatings, f);\n System.out.println(\"Found \" + aveRat.size() + \" movies\");\n System.out.println(\"-------------------------------------\");\n // sort arraylist\n Collections.sort(aveRat);\n for(Rating r: aveRat){\n System.out.println(r.getValue() + \"\\t\" \n + MovieDatabase.getTitle(r.getItem()) + \"\\t\"\n + MovieDatabase.getDirector(r.getItem()));\n }\n System.out.println(\"-------------------------------------\");\n \n \n }", "public static void main(String[] args){\n\n List<Student> arrList = new ArrayList<>(); // arraylist of our own class type\n arrList.add(new Student(111, \"bbb\", \"London\"));\n arrList.add(new Student(222,\"aaa\", \"nyc\"));\n arrList.add(new Student(333, \"ccc\", \"Jaipur\"));\n\n System.out.println(\"Unsorted list : \");\n for (Student student : arrList)\n System.out.println(student);\n\n // Sort the arrayList based on roll no\n Collections.sort(arrList, new Sortbyroll());\n\n System.out.println(\"Sorted by rollNo : \");\n for(Student student : arrList)\n System.out.println(student);\n\n // Sort the arrayList based on name\n Collections.sort(arrList, new Sortbyname());\n\n System.out.println(\"Sorted by name : \");\n for (int i=0; i<arrList.size(); i++)\n System.out.println(arrList.get(i));\n }", "public void sortQ(ArrayList<String> requestQ){\r\n\t\tfor(int i=0; i< (requestQ.size()-1); i++){\r\n\t\t\tint small = i;\r\n\t\t\tfor(int j = i+1; j < requestQ.size(); j++){\r\n\t\t\t\tString value1 = (String) requestQ.get(small);\r\n\t\t\t\tString[] temp1 = value1.split(\",\");\r\n\t\t\t\tString value2 = (String) requestQ.get(j);\r\n\t\t\t\tString[] temp2 = value2.split(\",\");\r\n\t\t\t\t// if timestamp is lower\r\n\t\t\t\tif(Integer.parseInt(temp1[1]) > Integer.parseInt(temp2[1])){\r\n\t\t\t\t\tsmall = j;\r\n\t\t\t\t}\r\n\t\t\t\t// if timestamp is equal\r\n\t\t\t\telse if(Integer.parseInt(temp1[1]) == Integer.parseInt(temp2[1])){\r\n\t\t\t\t\t// check for process ids\r\n\t\t\t\t\tif(Integer.parseInt(temp1[0]) > Integer.parseInt(temp2[0])){\r\n\t\t\t\t\t\tsmall = j;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}// inner for loop\r\n\t\tString swap = (String)requestQ.get(i);\r\n\t\trequestQ.set(i, requestQ.get(small));\r\n\t\trequestQ.set(small, swap);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "public void makeRecommendations()\r\n\t{\r\n\r\n\t\tSystem.out.print(\"Do you want the recommendations based on ratings or scores?\\n\" + \"1. Ratings\\n\" + \"2. Scores\\n\" + \"Please choose 1 or 2:\");\r\n\t\tint choose = scan.nextInt();\r\n\r\n\t\twhile (!(choose >= 1 && choose <= 2))\r\n\t\t{\r\n\t\t\tSystem.out.print(\"Please provide a valid input:\");\r\n\t\t\tchoose = scan.nextInt();\r\n\r\n\t\t}\r\n\t\tif (choose == 1)\r\n\t\t{\r\n\t\t\tSystem.out.print(\"Please provide a rating:\");\r\n\t\t\tString rate = scan.next();\r\n\r\n\t\t\tMovie[] temp = new Movie[actualSize];\r\n\t\t\tint tempCount = 0;\r\n\r\n\t\t\tfor (int i = 0; i < actualSize; i++)\r\n\t\t\t{\r\n\r\n\t\t\t\tif (data[i].getRating().equals(rate.toUpperCase()))\r\n\t\t\t\t{\r\n\t\t\t\t\ttemp[tempCount] = data[i];\r\n\t\t\t\t\ttempCount++;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tif (tempCount > 0)\r\n\t\t\t{\r\n\t\t\t\tsort(temp, 5);\r\n\t\t\t\tint counter = 0;\r\n\r\n\t\t\t\tPrintWriter p = null;\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tp = new PrintWriter(new FileWriter(\"top_5_movies.txt\"));\r\n\r\n\t\t\t\t\twhile (counter < 5)\r\n\t\t\t\t\t{\r\n\r\n\t\t\t\t\t\tp.println(temp[counter]);\r\n\t\t\t\t\t\tcounter++;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t\tcatch (IOException e)\r\n\t\t\t\t{\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\tSystem.out.println(\"File not found\");\r\n\t\t\t\t}\r\n\t\t\t\tp.close();\r\n\t\t\t\tSystem.out.println(\"Recommendations made successfully! Top 5 movies found!\");\r\n\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\r\n\t\t\t\tSystem.out.println(\"The rating does not match any of the movies.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (choose == 2)\r\n\t\t{\r\n\r\n\t\t\tint counter = 0;\r\n\t\t\tsort(data, 20);\r\n\t\t\tPrintWriter p = null;\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tp = new PrintWriter(new FileWriter(\"top_20_movies.txt\"));\r\n\r\n\t\t\t\twhile (counter < 20)\r\n\t\t\t\t{\r\n\r\n\t\t\t\t\tp.println(data[counter]);\r\n\t\t\t\t\tcounter++;\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tcatch (IOException e)\r\n\t\t\t{\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\tSystem.out.println(\"File not found\");\r\n\r\n\t\t\t}\r\n\t\t\tp.close();\r\n\t\t\tSystem.out.println(\"Recommendations made successfully! Top 20 movies found!\");\r\n\t\t}\r\n\r\n\t}", "@Test\n public void userRanking() {\n List<ATrip> trips = new ArrayList<ATrip>();\n ATrip trip = new ATrip();\n trip.setDriverid(DRIVER_ID);\n trip.setPassengerid(PASSENGER_ID);\n trip.setTripid(TRIP_ID);\n trip.setStatus(2);\n trip.setStartdate(1);\n trip.setEnddate(10);\n trips.add(trip);\n\n ATrip trip2 = new ATrip();\n trip2.setDriverid(DRIVER_ID);\n trip2.setPassengerid(PASSENGER_ID_2);\n trip2.setTripid(TRIP_ID2);\n trip2.setStatus(2);\n trip2.setStartdate(1);\n trip2.setEnddate(10);\n trips.add(trip2);\n\n ATrip trip3 = new ATrip();\n trip3.setDriverid(DRIVER_ID);\n trip3.setPassengerid(NONEXISTING_PASSENGER_ID);\n trip3.setTripid(TRIP_ID3);\n trip3.setStatus(1);\n trip3.setStartdate(2);\n trip3.setEnddate(9);\n trips.add(trip3);\n\n ArrayList<String> result = new ArrayList<String>();\n result.add(\"1;\" + 1);\n result.add(\"2;\" + 1);\n result.add(\"3;\" + 2);\n result.add(\"4;\" + 2);\n result.add(\"5;\" + 1);\n result.add(\"6;\" + 1);\n\n List<ATripRepository.userTripRanking> response = repo.getUserRankings(0, 10, trips, \"Passenger\");\n\n assertEquals(result.size(), response.size());\n }", "private void checkToList(ItemData itemMain) {\n int index = 0;\n for (ItemData i : itemDataList){\n int loc = Integer.parseInt(i.getscore().toString());\n int var = Integer.parseInt(itemMain.getscore().toString());\n if(var < 10 && loc == 0){\n itemMain.setimagePosition(i.getimagePosition());\n itemDataList.add(index,itemMain);\n /*\n Collections.sort(itemDataList, new Comparator<ItemData>() {\n @Override\n public int compare(ItemData t0, ItemData t1) {\n int loc = Integer.parseInt(t0.getscore().toString());\n int var = Integer.parseInt(t1.getscore().toString());\n return var - loc;\n }\n });\n */\n break;\n }\n index++;\n }\n\n }", "@Override\n protected void sortItems(List<User> items) {\n Logging.log(Log.DEBUG, TAG, \"Unable to sort list of users\");\n }", "public void printTopRatingMovies() {\n\t\tCollections.sort(this.dataList, new SortByRating());\n\t\tint top = Math.min(5, getDataLength());\n\t\tfor (int i=0; i<top; ++i) {\n\t\t\tSystem.out.println(this.dataList.get(i).toString());\n\t\t}\n\t\tCollections.sort(this.dataList);\n\t}", "public void sortKnowledgeBase()\n {\n int i;\n Random random;\n String aPredicate;\n StringTokenizer tokenizer;\n //------------\n random = new Random();\n i = 0;\n while (i < knowledgeBase.size())\n {\n aPredicate = knowledgeBase.get(i).commitments.get(0).predicate;\n tokenizer = new StringTokenizer(aPredicate,\"(), \");\n if(tokenizer.nextToken().equals(\"secuencia\"))\n knowledgeBase.get(i).priority = random.nextInt(100);\n //end if\n else\n knowledgeBase.get(i).priority = random.nextInt(10000);\n //end else\n i = i + 1;\n }//end while\n Collections.sort(knowledgeBase);\n }", "public void sortScores(){\r\n // TODO: Use a single round of bubble sort to bubble the last entry\r\n // TODO: in the high scores up to the correct location.\r\n \tcount=0;\r\n \tfor(int i=Settings.numScores-1; i>0;i--){\r\n \t\tif(scores[i]>scores[i-1]){\r\n \t\t\tint tempS;\r\n \t\t\ttempS=scores[i];\r\n \t\t\tscores[i]=scores[i-1];\r\n \t\t\tscores[i-1]=tempS;\r\n \t\t\t\r\n \t\t\tString tempN;\r\n \t\t\ttempN=names[i];\r\n \t\t\tnames[i]=names[i-1];\r\n \t\t\tnames[i-1]=tempN;\r\n \t\t\tcount++;\r\n \t\t}\r\n \t}\r\n }", "public void displayFavourite(ArrayList<Movie> movies)\n {\n int rate = 0;\n ArrayList<Movie> rateResult = new ArrayList<Movie>();\n Scanner console = new Scanner(System.in);\n boolean valid = false;\n String answer = \"\";\n \n while (!valid)\n {\n System.out.print(\"\\t\\tPlease insert the least rating you want to display (1-10): \");\n answer = console.nextLine().trim();\n valid = validation.integerValidation(answer,1,10);\n }\n \n rate = Integer.parseInt(answer);\n for (Movie film : movies)\n {\n int rating = film.getRating();\n \n if (rating >= rate)\n rateResult.add(film);\n }\n \n Collections.sort(rateResult);\n displayMovie(rateResult);\n }", "private static void sortList(ArrayList<ArrayList<Integer>> list){\n for (int i = 0; i < list.size(); i++) {\n for (int j = list.size() - 1; j > i; j--) {\n if ( (getCustomerArrivalTime(list.get(i)) == getCustomerArrivalTime(list.get(j)) && getCustomerIndex(list.get(i)) > getCustomerIndex(list.get(j)))\n || getCustomerArrivalTime(list.get(i)) > getCustomerArrivalTime(list.get(j))) {\n\n ArrayList<Integer> tmp = list.get(i);\n list.set(i,list.get(j)) ;\n list.set(j,tmp);\n }\n }\n }\n }", "List<User> getUsersSortedByNameAndAge(List<User> users);", "private static TreeMap<Double, ArrayList<String>> factorInRatings(Map<Integer,\n ArrayList<String>> map, User user) {\n TreeMap<Double, ArrayList<String>> mapWithRatings = new TreeMap<>(Collections.reverseOrder());\n //iterates through every count in the map\n for (int count = map.keySet().size(); count > 0; count--) {\n ArrayList<String> rep = map.get(count);\n //iterate through every recipe\n for (String recipe : rep) {\n Recipe recipeObj = getRecipeObject(recipe, user);\n int numIngredients = recipeObj.getIngredients().size();\n if (recipeObj == null) {\n continue;\n }\n //calculate a weighted sum to decide the match\n Double metric = count / numIngredients * SCORE_WEIGHT + SIMILARITY_WEIGHT\n * recipeObj.getValue();\n ArrayList<String> newRating;\n //add this rating to a hashmap, that sorts based on metric\n if (mapWithRatings.get(metric) == null) {\n newRating = new ArrayList<>();\n newRating.add(recipe);\n mapWithRatings.put(metric, newRating);\n } else {\n newRating = mapWithRatings.get(metric);\n newRating.add(recipe);\n mapWithRatings.put(metric, newRating);\n }\n }\n }\n return mapWithRatings;\n }", "private static void SortHash(HashMap<String,ArrayList<input>> hashMap,Distribution list)\n\t{\n\t\tCollections.sort(list.First, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.sort(list.Second, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.sort(list.Third, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.sort(list.Fourth, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.sort(list.Fifth, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.reverse(list.First);\n\t\tCollections.reverse(list.Second);\n\t\tCollections.reverse(list.Third);\n\t\tCollections.reverse(list.Fourth);\n\t\tCollections.reverse(list.Fifth);\n\t\tputInHashMap(hashMap,list);\n\t}", "int[] likeListForOneUser(int paraUserIndex, int paraLikeThreshold) {\n\t\tint[] tempLikeLists = new int[dataModel.uTeRateInds[paraUserIndex].length];\n\t\tint tempCount = 0;\n\t\t// Step 1. Obtain the like items.\n\t\tfor (int i = 0; i < dataModel.uTeRateInds[paraUserIndex].length; i++) {\n\t\t\tif (dataModel.uTeRatings[paraUserIndex][i] > paraLikeThreshold) {\n\t\t\t\ttempLikeLists[tempCount] = dataModel.uTeRateInds[paraUserIndex][i];\n\t\t\t\ttempCount++;\n\t\t\t} // Of for i\n\t\t} // of for i\n\n\t\t// Step 2. Compress\n\t\tif (tempCount == 0) {\n\t\t\treturn null;\n\t\t} // Of if\n\t\tint[] tempCompLikeLists = new int[tempCount];\n\t\tfor (int i = 0; i < tempCount; i++) {\n\t\t\ttempCompLikeLists[i] = tempLikeLists[i];\n\t\t} // Of for i\n\n\t\tArrays.sort(tempCompLikeLists);\n\n\t\treturn tempCompLikeLists;\n\t}", "public static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\t ArrayList<Integer> al1 = new ArrayList<Integer>();\n\t\t ArrayList<Integer> al2 = new ArrayList<Integer>();\n\t\t ArrayList<Integer> al3 = new ArrayList<Integer>();\n\n\t\t for(int i=0;i<5;i++)\n\t\t {\n\t\t\t al1.add(sc.nextInt());\n\t\t }\n\t\t for(int j=0;j<5;j++)\n\t\t {\n\t\t\t al2.add(sc.nextInt());\n\t\t } \n\t\t\n\t\tal1.addAll(al2);\n\t\tCollections.sort(al1);\n\t\tSystem.out.println(al1.get(2));\n\t\tSystem.out.println(al1.get(6));\n\t\tSystem.out.println(al1.get(8));\n\t\t\n\t\t\n\t}", "private void sortDate()\n {\n for(int i = 0; i < movieList.size(); i++){\n for(int j = 1; j < movieList.size() - i; j++)\n {\n Movie a = movieList.get(j-1);\n Movie b = movieList.get(j);\n int result = a.getReleaseDate().compareTo(b.getReleaseDate());\n if( result < 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n else if(result == 0)\n {\n result = a.getTitle().compareTo(b.getTitle());\n if(result > 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n }\n }\n }\n }", "public void userWithMostLikes(){\n Map<Integer,Integer> userLikesCount = new HashMap<>();\n Map<Integer,User> users = DataStore.getInstance().getUsers();\n \n for(User user : users.values()){\n for(Comment c : user.getComments()){\n int likes=0;\n if(userLikesCount.containsKey(user.getId())){\n\n likes = userLikesCount.get(user.getId());\n }\n likes += c.getLikes();\n userLikesCount.put(user.getId(), likes);\n }\n }\n System.out.println(userLikesCount);\n int max=0;\n int maxId=0;\n for(int id: userLikesCount.keySet()){\n if(userLikesCount.get(id)>max){\n max= userLikesCount.get(id);\n maxId=id;\n }\n }\n System.out.println(\"\\nUser with most likes : \"+ max+ \"\\n\"+ users.get(maxId));\n }", "private ArrayList<Rating> getSimilarities(String id){\n \n String moviefile = \"data/ratedmovies_short.csv\";\n String ratingsfile = \"data/ratings_short.csv\";\n \n RaterDatabase database = new RaterDatabase();\n database.initialize(ratingsfile);\n \n ArrayList<Rating> dot_list = new ArrayList<Rating>();\n \n Rater me = database.getRater(id);\n \n for (Rater rater : database.getRaters()){\n \n if(rater != me){\n \n double dot_product = dotProduct(me, rater);\n \n if (dot_product >= 0.0){\n \n Rating new_rating = new Rating(rater.getID() , dot_product);\n \n dot_list.add(new_rating);\n }\n \n }\n \n }\n \n Collections.sort(dot_list , Collections.reverseOrder());\n \n return dot_list;\n \n }", "List<AnswerDTO> getAnswerSortedByUpvotes(AnswerListDTO answerListDTO);", "public static void main(String[] args) {\n File file = new File(\"ratings.tsv\");\n ArrayList<MovieRating> rl = new ArrayList<MovieRating>();\n\n try {\n Scanner scanner = new Scanner(file);\n while (scanner.hasNextLine()) {\n String line = scanner.nextLine();\n String[] tkns = line.split(\"\\\\t\"); // tabs separate tokens\n MovieRating nr = new MovieRating(tkns[0], tkns[1], tkns[2]);\n rl.add(nr);\n }\n scanner.close();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n\n int minVotes = 1;\n int numRecords = 1;\n Scanner input = new Scanner(System.in);\n while (true) {\n\n MaxHeap<MovieRating> myHeap = new MaxHeap<MovieRating>();\n\n for(int i = 0; i < rl.size(); i++) {\n myHeap.insert(rl.get(i));\n }\n\n System.out.println();\n System.out.println(\"Enter minimum vote threshold and number of records:\");\n minVotes = input.nextInt();\n numRecords = input.nextInt();\n if (minVotes * numRecords == 0)\n break;\n long startTime = System.currentTimeMillis();\n\n /* Fill in code to determine the top numRecords movies that have at least\n * minVotes votes. For each record mr, in decreasing order of average rating,\n * execute a System.out.println(mr).\n * Do not sort the movie list!\n */\n int counter = 0;\n for (int i = 0; i < rl.size(); i++) {\n MovieRating temp = myHeap.removemax();\n if(temp.getVotes() > minVotes){\n System.out.println(temp.toString());\n counter++;\n }\n if(counter >= numRecords){\n break;\n }\n }\n\n System.out.println();\n long readTime = System.currentTimeMillis();\n System.out.println(\"Time: \"+(System.currentTimeMillis()-startTime)+\" ms\");\n }\n }", "public static void sortitems(ArrayList<item> svd)\n\t{\n\t\tCollections.sort(svd, new Comparator<item>(){\n\t\t public int compare(item o1, item o2){\n\t\t if(o1.density == o2.density)\n\t\t return 0;\n\t\t return o1.density > o2.density ? -1 : 1;\n\t\t }\n\t\t});\n\t\t\n\t\t\n\t}", "public static void main(String[] args){\n Item arr[] = new Item[10];\n\n //Below function initilaizes the array values.\n for(int i=0;i<arr.length;i++){\n double randomDouble = Math.random();\n\t randomDouble = randomDouble * 100 + 1;\n int randomInt = (int) randomDouble;\n arr[i] = new Item(i+1,randomInt);\n }\n\n //This is how we sort the values using the comparator.\n Arrays.sort(arr,new Comparator<Item>(){\n @Override\n public int compare(Item i1,Item i2){\n\n //We write i2.mark before, this simply implies i am trying to do it in reverse order.\n return i2.mark.compareTo(i1.mark);\n\n // return i1.mark.compareTo(i2,mark);\n //This is the ascending version of the same.\n }\n });\n\n //This just prints out the values!\n for(Item i: arr){\n System.out.println(i.roll+\" \"+i.mark);\n }\n int a = 3;\n System.out.println(a/2);\n }", "public void printAverageRatings(int minimalRaters) {\n String shortMovieCsv = \"C:/Users/greg/IdeaProjects/capstone-coursera/data/ratedmovies_short.csv\";\n //String shortRatingsCsv = \"/home/greg/IdeaProjects/capstone-coursera/data/ratings_short.csv\";\n String shortRatingsCsv = \"C:/Users/greg/IdeaProjects/capstone-coursera/data/ratings_short.csv\";\n\n //String bigMovieCsv = \"C:/Users/greg/IdeaProjects/capstone-coursera/data/ratedmoviesfull.csv\";\n //String bigMovieCsv = \"/home/greg/IdeaProjects/capstone-coursera/data/ratedmoviesfull.csv\";\n //String bigRatingsCsv = \"C:/Users/greg/IdeaProjects/capstone-coursera/data/ratings.csv\";\n //String bigRatingsCsv = \"/home/greg/IdeaProjects/capstone-coursera/data/ratings.csv\";\n\n SecondRatings secondRatings = new SecondRatings(shortMovieCsv, shortRatingsCsv);\n //SecondRatings secondRatings = new SecondRatings(bigMovieCsv, bigRatingsCsv);\n\n System.out.println(\"Number of movies loaded from file: \" + secondRatings.getMovieSize());\n System.out.println(\"Number of raters loaded from file: \" + secondRatings.getRaterSize());\n\n ArrayList<Rating> ratingArrayList = secondRatings.getAverageRatings(minimalRaters);\n ratingArrayList.sort(Comparator.naturalOrder());\n System.out.println(\"Total of movies with at least \" + minimalRaters + \" raters: \" + ratingArrayList.size());\n for (Rating rating : ratingArrayList) {\n System.out.println(rating.getValue() + \" \" + secondRatings.getTitle(rating.getItem()));\n }\n }", "private static List<StudentRecord> vratiSortiranuListuOdlikasa(List<StudentRecord> records) {\n\t\treturn records.stream()\n\t\t\t\t\t\t.filter(s -> s.getGrade() == 5)\n\t\t\t\t\t\t.sorted(StudentRecord.BY_POINTS.reversed())\n\t\t\t\t\t\t.collect(Collectors.toList());\n\t}", "public ArrayList<String> getGenreBreakdown(int userID){\n ArrayList<String> breakdown = new ArrayList<String>();\n String query = \"SELECT genre, round(count(*)/(SELECT count(*) \"\n + \"FROM user_ratedmovies \"\n + \"WHERE userID=\" + userID + \")*100) as percentage \"\n + \"FROM user_ratedmovies, movie_genres \"\n + \"WHERE userID=\" + userID + \" \"\n + \"AND user_ratedmovies.movieID=movie_genres.movieID \"\n + \"GROUP BY genre \"\n + \"ORDER BY percentage DESC\";\n ResultSet rs = null;\n try{\n con = ConnectionFactory.getConnection();\n stmt = con.createStatement();\n rs = stmt.executeQuery(query);\n while(rs.next()){\n String tag = rs.getString(\"genre\").trim();\n int percentage = rs.getInt(\"percentage\");\n breakdown.add(tag + \"\\t\" + percentage + \"%\");\n }\n }\n catch(SQLException e){\n e.printStackTrace();\n }\n return breakdown;\n }", "public static void mySort(ArrayList<Integer> myList)\n {\n\n }", "public static void main(String[] args) {\n\t\tint a[]= {4,5,5,5,4,6,9,6,4};\n\t ArrayList<Integer> al=new ArrayList<Integer>();\n\t \n\t for(int i=0;i<a.length;i++)\n\t {\n\t \t al.add(a[i]);\n\t }\n\t al.sort(null);\n\t \n\t System.out.println(al);\n\t}", "public List<Integer> getNewsFeed(int userId) {\n if (!userId2TopTenTweets.containsKey(userId)) {\n return new ArrayList<>(0);\n }\n\n\n userId2TopTenTweets.get(userId).sort((i1, i2)->i2.getTimestamp() - i1.getTimestamp() > 0 ? 1:i2.getTimestamp() - i1.getTimestamp() == 0 ? 0 : -1);\n List<Integer> result = new ArrayList<>();\n int size = 0;\n for (Tweet tweet : userId2TopTenTweets.get(userId)) {\n result.add(tweet.id);\n size++;\n if (size == 10) {\n return result;\n }\n }\n return result;\n }", "public abstract ArrayList<Integer> getRecommendations(final Integer userId, final DatasetReader reader);", "private static List<StudentRecord> vratiSortiranuListuOdlikasa(List<StudentRecord> records) {\n\t\treturn records.stream()\n\t\t\t\t.filter(o -> o.getOcjena() == 5)\n\t\t\t\t.sorted((o1, o2) -> o1.getOcjena().compareTo(o2.getOcjena()))\n\t\t\t\t.collect(Collectors.toList());\n\t}", "public void ranking(ArrayList<Player> list) {\r\n\t\tCollections.sort(list, new Comparator<Player>(){\r\n\t\t\tpublic int compare(Player a1, Player a2) {\r\n\t\t\t\tint a = a2.getPercent()-a1.getPercent(); \r\n\t\t\t\treturn a==0?a1.getUserName().compareTo(a2.getUserName()):a;\r\n\t\t\t}\r\n\t\t});\r\n\t\tIterator<Player> aa = list.iterator();\r\n\t\twhile(aa.hasNext()){\r\n\t\t\tPlayer in = aa.next();\r\n\t\t\tin.showRanking();\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\t\tint flowerToPurchase = 3;\n int members = 2;\n int[] fPrice = {2,5,6};\n \n \tint j=0;\n \tint key,k;\n \tint arr_length= flowerToPurchase;\n \tfor(int i=1;i<flowerToPurchase; i++){\n \t\tj=i-1;\n \t\tkey = fPrice[i];\n \t\twhile(j >=0 && key < fPrice[j]){\n \t\t\tfPrice[j+1] = fPrice[j];\n \t\t\tj=j-1;\n \t\t}\n\n \t\tfPrice[j+1] = key;\n \t} // sort ends\n \t\n \tint temp = flowerToPurchase;\n \tint x =0;\n \tint amnt =0, peopleCount=0;\n \tint index = flowerToPurchase-1;\n \tint[] friends = new int[members];\n \tint f_index =0;\n \twhile(temp != 0){\n \t\tif(members == flowerToPurchase){\n \t\t\tamnt += fPrice[index--];\n \t\t\ttemp--;\n \t\t}\n \t\telse if(members < flowerToPurchase){\n \t\t\t\n \t\t\tif(friends[f_index] == 0){\n \t\t\t\tfriends[f_index] = 1;\n \t\t\t\tamnt += fPrice[index--];\n \t\t\t\tfPrice[index+1] = 0;\n \t\t\t\ttemp--;\n \t\t\t}\n \t\t\telse if(friends[f_index] == 1){\n \t\t\t\tamnt += (friends[f_index] + 1) * fPrice[0];\n \t\t\t\tfriends[f_index] = 2;\n \t\t\t\tfPrice[0] = 0;\n \t\t\t\ttemp--;\n \t\t\t\tf_index++;\n \t\t\t}\n \t\t\t\n \t\t}\n \t}\n \tSystem.out.println(amnt);\n \t\n }", "@SuppressWarnings(\"empty-statement\")\n public ArrayList process(String input){\n //public static void main(String[] args) throws SQLException {\n\n //Scanner in = new Scanner(System.in);\n //String InputStr = in.nextLine(); // to read user input;\n String InputStr = input;\n \n System.out.println(input);\n \n boolean quotated = false; // to know input with quotation or not;\n try {\n ConnectToDB();\n int TotalnumDoc = GetNumDocs();\n\n if (InputStr.startsWith(\"\\\"\") && InputStr.endsWith(\"\\\"\")) {\n System.out.println(\"quotation\");\n quotated = true;\n GetDoc_Word(InputStr, TotalnumDoc);\n System.out.println(\"total number of doc =\" + TotalnumDoc);\n Postions();\n } else {\n GetDoc_StemWord(InputStr, TotalnumDoc);\n quotated = false;\n }\n\n for (Map.Entry<String, SrchWord> entry1 : WordList.entrySet()) /// for\n /// printing\n {\n System.out.println(entry1.getKey() + \"\tIDF: \" + entry1.getValue().IDf);\n\n SrchWord w1 = entry1.getValue();\n w1.PrintSrchWord();\n System.out.println(\"___________________________\");\n\n }\n System.out.println(\"================================================================\");\n Ranker();\n \n for (Map.Entry<Integer, DocRank> entry1 : pages.entrySet()) \n {\n entry1.getValue().ID = entry1.getKey();\n }\n \n List<DocRank> sortedRank = new ArrayList<>(pages.values());\n \n if (!quotated)\n { \n sortedRank.sort( new SortByPageRank());\n }\n else\n {\n sortedRank.sort( new SortByValidFlag());\n }\n //*****************************************************************\n // sortedRank now contains objects DocRank containing the pageRank and the DocID(choose ascendingly or descendingly\n // from SortByPageRank.java compare function)\n // the ID should enable the retrieval of the URL and title from the table Docs_URL\n //****************************************************************\n \n ArrayList sortedIds = new ArrayList();\n \n for (int i=0; i<sortedRank.size(); i++)\n {\n System.out.println(\"DocID : \" +sortedRank.get(i).ID);\n System.out.println(\"pageRank: \" + sortedRank.get(i).rank);\n \n sortedIds.add(sortedRank.get(i).ID); // dont forget to change the comparator to descending\n //System.out.println(sortedRank.get(i).ID);\n }\n \n pages.clear();\n return sortedIds;\n \n } catch (Exception e) {\n\n e.printStackTrace();\n return null;\n\n } finally {\n\n WordList.clear(); // clearing map after searching\n if (con != null) {\n try {\n con.close();\n } catch (Exception e) {\n }\n }\n }\n\n }", "public void printAverageRatings(){\n \n String moviefile = \"data/ratedmovies_short.csv\";\n String ratingsfile = \"data/ratings_short.csv\";\n \n \n ThirdRatings tr = new ThirdRatings(ratingsfile);\n \n int rating_size = tr.getRaterSize();\n \n System.out.println(\"The number of raters read is : \"+ rating_size);\n \n MovieDatabase database = new MovieDatabase();\n \n database.initialize(moviefile);\n \n int movie_size = database.size();\n \n System.out.println(\"The number of movies read is : \"+ movie_size);\n \n ArrayList<Rating> ratings_list = tr.getAverageRatings(3);\n \n HashMap<String, Double> map = new HashMap<String, Double>();\n \n Collections.sort(ratings_list);\n \n int count = 0; \n \n for(Rating rating : ratings_list){\n \n String title = database.getTitle(rating.getItem());\n \n double val = rating.getValue();\n \n if(val != 0.0 ){\n \n map.put(title , val);\n \n count += 1;\n\n System.out.println(val + \"\\t\" + title );\n }\n\n }\n \n System.out.println(\"The number of movies found with minimal number of ratings is : \"+ count); \n \n }", "@Override\n public void processFinish(String output) {\n // after getting DB RESULT JASON\n System.out.println(\"processFinish\"+output);\n JSONArray jArray = null;\n SharedPreferences userInfo = getSharedPreferences(\"user_info\",\n Context.MODE_PRIVATE);\n String id = (userInfo.getString(\"id\", \"\"));\n\n boolean userFound = false;\n\n try {\n jArray = new JSONArray(output);\n // Extract data from json and store into ArrayList\n for (int i = 0; i < jArray.length(); i++) {\n JSONObject json_data = jArray.getJSONObject(i);\n points.add(new Entry(json_data.getString(\"name\"), Integer.parseInt(json_data.getString(\"score\")), json_data.getString(\"id\")));\n if(points.get(i).id.equals(id)){\n userFound = true;\n }\n }\n //user is not included in current users\n if(!userFound){\n points.add(new Entry(userInfo.getString(\"name\", \"\"), score, userInfo.getString(\"id\", \"\")));\n }\n } catch (JSONException e) {\n e.printStackTrace();\n }\n Collections.sort(points, new EntryComparator());\n\n\n ArrayList<User> users = new ArrayList<>();\n for(int i=0; i<points.size(); i++){\n users.add(new User(\"#\"+(i+1), points.get(i).name, Integer.toString(points.get(i).points), points.get(i).id));\n if(users.get(i).getId().equals(id)){\n userRank = i+1;\n }\n\n }\n rankDisplay.setText(\"Rank #\"+userRank+\"/\"+users.size());\n adapter.setUserList(users);\n adapter.notifyDataSetChanged();\n recyclerView.setAdapter(adapter);\n }", "public double predictUser(int itemID, PriorityQueue<KNNUserVector> knn\n\t\t\t,HashMap<Integer,Byte> userItems,HashSet<Integer> similarItems,double uAvg){\n\t\t\n\t\tboolean hasPredicted = false;\n\t\tdouble score = 0.0;\n\t\tint num = 0;\n\t\t//all the below paras is under the beneath assumption:user has remark the similar items\n\t\tdouble alpha = 0.4;//parameter for similar user's score\n\t\tdouble beta = 0.6;//parameter for user's similar remarks on similar used items\n\n\t\tfor (KNNUserVector similarUser : knn) {\t//if similar user has bought this item\n\t\t\tdouble itemScore = 0;\n\t\t\tif (similarUser.getVector().getRecords().containsKey(itemID)) {\n\t\t\t\titemScore = similarUser.getVector().getRecords().get(itemID);\n\t\t\t\tscore += itemScore;\n\t\t\t\tnum ++;\n\t\t\t}\n\t\t}\n\t\tif(num!=0){\n\t\t\thasPredicted = true;\n\t\t\tscore = (double)score/num;\n\t\t}\n\t\t//search if user have bought the similar items\n\t\tdouble similarItemScore = 0.0;\n\t\tint snum = 0;\n\t\tif(similarItems!=null){\n\t\t\tIterator<Integer> it = similarItems.iterator();\n\t\t\twhile (it.hasNext()) {\n\t\t\t\tint iID = (Integer) it.next();\n\t\t\t\tif (userItems.containsKey(iID)) {\n\t\t\t\t\tsimilarItemScore += userItems.get(iID);\n\t\t\t\t\tsnum++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(num!=0){\n\t\t\tscore = score/num;\n\t\t\tif (snum != 0) {// this means has some similar items like what we\n\t\t\t\t// are finding\n\t\t\t\tscore = alpha*(score)+beta*(similarItemScore/snum);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(score == 0.0){\n\t\t\tscore = uAvg;\n\t\t}\n\t\treturn score;\n\t}", "private static void sortFriends() {\n friends.postValue(friends.getValue());\n }", "public ArrayList<ArrayList<String>> inputTestListAndSort (ArrayList<ArrayList<String>> testList){\n ArrayList<ArrayList<String>> testList1=new ArrayList<>(testList);\n Collections.sort(testList1, new SubClass_CompareItemsInTheRowsOfTheTimetable_in_TeachingOverlapAndHours());\n return testList1;\n }", "public ArrayList<String> getTimeLine(int userID){\n ArrayList<String> timeLine = new ArrayList<String>();\n ResultSet rs = null;\n String query = \"SELECT title, rating FROM movies, user_ratedmovies as r \"\n + \"WHERE id=movieID AND userID=\" + userID + \" \"\n + \"ORDER BY r.date_year, r.date_month, r.date_day, r.date_hour,\"\n + \" r.date_minute, r.date_second ASC\";\n try{\n con = ConnectionFactory.getConnection();\n stmt = con.createStatement();\n rs = stmt.executeQuery(query);\n while(rs.next()){\n String title = rs.getString(\"title\").trim();\n double rating = rs.getDouble(\"rating\");\n timeLine.add(title + \"\\t\" + rating);\n }\n }\n catch(SQLException e){\n e.printStackTrace();\n }\n return timeLine;\n }", "public void SortByPrice() {\n for (int i = 1; i < LastIndex; i++) {\n int x = i;\n while (x >= 1) {\n if (ForChild[x - 1].getPrice() > ForChild[x].getPrice()) {\n Confectionery sweets = ForChild[x - 1];\n ForChild[x - 1] = ForChild[x];\n ForChild[x] = sweets;\n\n }\n x -= 1;\n }\n }\n }", "public static void main(String[] args) {\n\t\tArrayList<Employee> list= new ArrayList<Employee>();\n\t\t\n\t\tlist.add(new Employee(3,6000,\"vinod\"));\n\t\tlist.add(new Employee(6,7500,\"Rangu\"));\n\t\tlist.add(new Employee(1,9000,\"kittu\"));\n\t\tlist.add(new Employee(5,5000,\"bunny\"));\n\t\t\n\t\tCollections.sort(list, new NameComparator());\n\t\t\n\t\tIterator it = list.iterator();\n\t\t\n\t\twhile(it.hasNext()){\n\t\t\tEmployee emp = (Employee)it.next();\n\t\t\tSystem.out.println(emp.id+\" \"+emp.salaray+\" \"+emp.name);\n\t\t\t\n\t\t\t/*Collections.sort(list, new SalaryComparator());\n\t\t\t\n\t\t\tIterator it = list.iterator();\n\t\t\t\n\t\t\twhile(it.hasNext()){\n\t\t\t\tEmployee emp = (Employee)it.next();\n\t\t\t\tSystem.out.println(emp.id+\" \"+emp.salaray+\" \"+emp.name);\n\t\t}*/\n\t}\n\t}", "List<User> getNaturalSortedUsersByAge(List<User> users);", "public static void main(String[] args) {\n\t\tArrayList<Integer> ints = new ArrayList<>(Arrays.asList(10, 23, 1, 234, 56, 78, 77, 45, 24));\r\n\t\tints.add(99);\r\n\t\tSystem.out.println(ints);\r\n//\t\t//Objective : Display sorted ints in desc order\r\n//\t\tCollections.sort(ints,new Comparator<Integer>() {\r\n//\r\n//\t\t\t@Override\r\n//\t\t\tpublic int compare(Integer o1, Integer o2) {\r\n//\t\t\t\t// TODO Auto-generated method stub\r\n//\t\t\t\treturn o2.compareTo(o1);\r\n//\t\t\t}\r\n//\t\t\t\r\n//\t\t});\r\n//\t\tfor(int i : ints)\r\n//\t\t\tSystem.out.println(i);\r\n//\t\t\r\n\r\n\t\tCollections.sort(ints, (i1, i2) -> i2.compareTo(i1));\r\n\t\tints.forEach(i -> System.out.print(i + \" \"));\r\n\r\n\t}", "public static ArrayList<JsonNode> sortData(ArrayList<JsonNode> wordList) {\n Collections.sort( wordList, new Comparator<JsonNode>() {\n @Override\n public int compare(JsonNode a, JsonNode b) {\n int valA = Integer.parseInt(a.get(\"weight\").asText());\n int valB = Integer.parseInt(b.get(\"weight\").asText());\n return valB - valA; //Sort in order of largest to smallest\n }\n });\n\n return wordList;\n }", "public static void main(String[] args) {\n\n\t\tArrayList<Integer> arrayList = new ArrayList<Integer>();\n\t\tarrayList.add(11);\n\t\tarrayList.add(2);\n\t\tarrayList.add(7);\n\t\tarrayList.add(3);\n\t\t\n\t\t// ArrayList before the sorting\n\t\tSystem.out.println(\"Before Sorting: \");\n\t\tfor(int counter: arrayList)\n\t\t\tSystem.out.println(counter);\n\t\t\n\t\t// Sorting of arrayList using Collections.sort\n\t\tCollections.sort(arrayList);\n\t\t\n\t\t// ArrayList after sorting\n\t\tSystem.out.println(\"\\nAfter Sorting: \");\n\t\tfor(int counter: arrayList)\n\t\t\tSystem.out.println(counter);\n\t}", "@Override\n public void onSortByRating() {\n mSorter.sortLocationsByRating(mListLocations);\n mAdapter.notifyDataSetChanged();\n }", "public static void main(String[] args) {\n\t\tList<String> animal = new ArrayList<String>();\n\n\t\tanimal.add(\"Cat\");\n\t\tanimal.add(\"Mouse\");\n\t\tanimal.add(\"Lion\");\n\t\tanimal.add(\"Zeebra\");\n\t\tanimal.add(\"Bear\");\n\t\tanimal.add(\"Deer\");\n\n\t\t// Collections.sort(animal,new StringLengthComparator());\n\n\t\tCollections.sort(animal, new ReverseAlphabeticalComparator());\n\t\tfor (String animal1 : animal) {\n\n\t\t\tSystem.out.println(animal1);\n\t\t}\n\n\t\t/////////////////////////////// Sorting Numbers ////////////////////////////////\n\t\tList<Integer> numbers = new ArrayList<Integer>();\n\n\t\tnumbers.add(5);\n\t\tnumbers.add(31);\n\t\tnumbers.add(16);\n\t\tnumbers.add(605);\n\t\tnumbers.add(15);\n\n\t\tCollections.sort(numbers, new Comparator<Integer>() {\n\n\t\t\t@Override\n\t\t\tpublic int compare(Integer num1, Integer num2) {\n\n\t\t\t\treturn -num1.compareTo(num2);\n\t\t\t}\n\n\t\t});\n\n\t\tfor (Integer num1 : numbers) {\n\n\t\t\tSystem.out.println(num1);\n\t\t}\n\t\t///////////////////////////// Sorting Arbitrary Objects ////////////////////////////\n\n\t\tList<Person> people = new ArrayList<Person>();\n\n\t\tpeople.add(new Person(3, \"Ajeer\"));\n\t\tpeople.add(new Person(1, \"Sudeer\"));\n\t\tpeople.add(new Person(2, \"Sureash\"));\n\t\tpeople.add(new Person(4, \"Sam\"));\n\t\t\n\t\t// Sort in Order of ID\n\t\tCollections.sort(people, new Comparator<Person>() {\n\n\t\t\t@Override\n\t\t\tpublic int compare(Person p1, Person p2) {\n\t\t\t\tif (p1.getId() > p2.getId()) {\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\telse if (p1.getId()< p2.getId()) {\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t});\n\t\tfor (Person person1 : people) {\n\n\t\t\tSystem.out.println(person1);\n\t\t}\n\t\tSystem.out.println(\"\\n\");\n\t\t// Sort In Order of NAME....\n\t\tCollections.sort(people, new Comparator<Person>() {\n\n\t\t\t@Override\n\t\t\tpublic int compare(Person p1, Person p2) {\n\t\t\t\n\t\t\t\treturn p1.getName().compareTo(p2.getName());\n\t\t\t}\n\t\t});\n\t\tfor (Person person1 : people) {\n\n\t\t\tSystem.out.println(person1);\n\t\t}\n\t}", "private void sortByWeight()\n\t{\n\t\tfor(int i=1; i<circles.size(); i++)\n\t\t{\n\t\t\tPVCircle temp = circles.get(i);\n\t\t\tint thisWeight = circles.get(i).getWeight();\n\t\t\tint j;\n\t\t\tfor(j=i-1; j>=0; j--)\n\t\t\t{\n\t\t\t\tint compWeight = circles.get(j).getWeight();\n\t\t\t\tif(thisWeight < compWeight)\n\t\t\t\t\tbreak;\n\t\t\t\telse\n\t\t\t\t\tcircles.set(j+1, circles.get(j));\n\t\t\t}\n\t\t\tcircles.set(j+1, temp);\n\t\t}\n\t\t\n\t}", "public List<MovieDTO> getRecommendations(final long thisUserId, final int maxSize) {\n\n\t\tisTrue(thisUserId >= 0, \"The user id cannot be negative.\");\n\t\tisTrue(maxSize >= 0, \"The maximum recommendations size cannot be negative.\");\n\n\n\t\tfinal Map<Long, Double> otherSimilarUsers = userProfiler.getSimilarUsers(thisUserId);\n\n\t\tLOGGER.debug(\"Found [\" + otherSimilarUsers.size() +\"] similar users ...\");\n\n\n\t\tfinal double thisUserAverageRating = ratingRepository.findAverageByUserId(thisUserId);\n\n\t\tfinal Map<Long, MovieEntity> movieEntities = movieRepository.findAllNotViewedByThisUserButViewedByOtherUsers(thisUserId, newLinkedList(otherSimilarUsers.keySet()))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.parallelStream()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.collect(toMap(MovieEntity::getId, identity()));\n\n\t\tLOGGER.debug(\"Found [\" + movieEntities.size() +\"] candidate recommended movies ...\");\n\n\n\t\tfinal Map<Long, Double> predictedRatings = newHashMap();\n\n\n\t\tfor (final Long movieId : movieEntities.keySet()) {\n\n\t\t\tdouble numerator = 0D;\n\t\t\tdouble denominator = 0D;\n\n\n\t\t\tfor (final Long otherUserId : otherSimilarUsers.keySet()) {\n\n\t\t\t\tdouble matchScore = otherSimilarUsers.get(otherUserId);\n\n\n\t\t\t\tfinal Optional<RatingEntity> optionalRatingEntity = ratingRepository.findByUserIdAndMovieId(otherUserId, movieId);\n\n\t\t\t\tif (optionalRatingEntity.isPresent()) {\n\n\t\t\t\t\tfinal double otherUserMovieRating = optionalRatingEntity.get().getRating();\n\n\t\t\t\t\tfinal double otherUserAverageRating = ratingRepository.findAverageByUserId(otherUserId);\n\n\n\t\t\t\t\tnumerator += matchScore * (otherUserMovieRating - otherUserAverageRating);\n\n\t\t\t\t\tdenominator += abs(matchScore);\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\tdouble predictedRating = 0D;\n\n\t\t\tif (denominator > 0D) {\n\n\t\t\t\tpredictedRating = thisUserAverageRating + (numerator / denominator);\n\n\n\t\t\t\tif (predictedRating > MAX_RATING_SCORE) {\n\n\t\t\t\t\tpredictedRating = MAX_RATING_SCORE;\n\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\tLOGGER.debug(\"MovieId: [\" + movieId + \"] - predicted rating: [\" + predictedRating + \"]\");\n\n\t\t\tpredictedRatings.put(movieId, predictedRating);\n\t\t}\n\n\n\t\tfinal Map<Long, Double> recommendationsSorted = newTreeMap(new MapValueComparator(predictedRatings));\n\n\t\trecommendationsSorted.putAll(predictedRatings);\n\n\n\t\tLOGGER.debug(\"Returning the top-most [\" + maxSize + \"] recommended movies ...\");\n\n\t\treturn recommendationsSorted\n\t\t\t\t\t\t\t\t.entrySet()\n\t\t\t\t\t\t\t\t\t.stream()\n\t\t\t\t\t\t\t\t\t\t.limit(maxSize)\n\t\t\t\t\t\t\t\t\t\t.map(entry -> new MovieDTO( movieEntities.get(entry.getKey()).getPlainTitle(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgetMovieDescription(theMovieDBClient, movieEntities.get(entry.getKey())\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getPlainTitle()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.replaceAll(\".*?\\\\(.*?\\\\).*?\",\"\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.replace(\",\", \"\")),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmovieEntities.get(entry.getKey()).getYear(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmovieEntities.get(entry.getKey()).getRating()))\n\t\t\t\t\t\t\t\t\t\t.collect(toList());\n\t}", "public void printAverageRatingsByGenre(){\n ThirdRatings sr = new ThirdRatings();\n int raters = sr.getRaterSize();\n System.out.println(\"read data for \" + raters + \" raters\");\n System.out.println(\"-------------------------------------\");\n \n //MovieDatabase.initialize(\"ratedmovies_short.csv\");\n MovieDatabase.initialize(\"ratedmoviesfull.csv\");\n System.out.println(\"read data for \" + MovieDatabase.size() + \" movies\");\n System.out.println(\"-------------------------------------\");\n \n Filter f = new GenreFilter(\"Comedy\"); \n int minRatings = 20;\n ArrayList<Rating> aveRat = sr.getAverageRatingsByFilter(minRatings, f);\n System.out.println(\"Found \" + aveRat.size() + \" movies\");\n System.out.println(\"-------------------------------------\");\n // sort arraylist\n Collections.sort(aveRat);\n for(Rating r: aveRat){\n System.out.println(r.getValue() + \"\\t\" + MovieDatabase.getYear(r.getItem()) + \"\\t\" \n + MovieDatabase.getTitle(r.getItem()) + \"\\t\" + MovieDatabase.getGenres(r.getItem()));\n }\n System.out.println(\"-------------------------------------\");\n \n \n }", "public void sort() // sort according to primary key defined in RecordTemplate\n\t{\n\t\trecordList.sort((Record r1, Record r2)->r1.getValue(PRIMARY_KEY_FIELD_INDEX).compareTo(r2.getValue(PRIMARY_KEY_FIELD_INDEX))); \n //recordList.forEach((r)->System.out.println(r)); \n\t}", "public static void main(String[] args) {\n\n List<String> animals = new ArrayList <String>();\n\n animals.add(\"Elephatn\");\n animals.add(\"snake\");\n animals.add(\"Lion\");\n animals.add(\"Mongoose\");\n animals.add(\"Cat\");\n\n\n\n// Collections.sort(animals, new StringLengthComparator());\n// Collections.sort(animals, new AlphabeticalComparator());\n Collections.sort(animals, new ReverseAlphabeticalComparator());\n for(String animal:animals){\n System.out.println(animal);\n }\n\n//////////////Sorting Numbers ///////////\n List<Integer> numbers = new ArrayList <Integer>();\n\n numbers.add(54);\n numbers.add(1);\n numbers.add(36);\n numbers.add(73);\n numbers.add(9);\n\n Collections.sort(numbers, new Comparator <Integer>() {\n @Override\n public int compare(Integer num1, Integer num2) {\n return num1.compareTo(num2);\n }\n });\n\n for(Integer number: numbers){\n System.out.println(number);\n }\n\n\n///////////////Sorting Arbitrary objects////////\n\n\n List<Person> people = new ArrayList <Person>();\n\n people.add(new Person(1,\"Joe\"));\n people.add(new Person(5,\"Harry\"));\n people.add(new Person(2,\"Hermoine\"));\n people.add(new Person(4,\"Muffet\"));\n\n// Sort in order of ID\n Collections.sort(people, new Comparator <Person>() {\n @Override\n public int compare(Person p1, Person p2) {\n\n if(p1.getId()>p2.getId()){\n return 1;\n }else if(p1.getId()<p2.getId()){\n return -1;\n }\n return 0;\n\n }\n });\n\n\n // Sort in order of Name\n Collections.sort(people, new Comparator <Person>() {\n @Override\n public int compare(Person p1, Person p2) {\n\n return p1.getName().compareTo(p2.getName());\n\n\n }\n });\n\n for(Person person: people){\n System.out.println(person);\n\n }\n\n }", "public static void main(String[] args) {\n\t\tArrayList<Integer> Array=new ArrayList<Integer>(); \n\t\tScanner In=new Scanner(System.in);\n\t\twhile(In.hasNext()) {\n\t\t\tArray.add(In.nextInt());\n\t\t}\n\t\t//Array.sort(null);\n\t\tfor(int i=1;i<Array.size();i++){\n\t\t\tfor(int j=0;j<Array.size()-i;j++) {\n\t\t\t\tif(Array.get(j)>Array.get(j+1)) {\n\t\t\t\t\tint temp=Array.get(j);\n\t\t\t\t\tArray.set(j, Array.get(j+1));\n\t\t\t\t\tArray.set(j+1, temp);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=0;i<Array.size();i++)\n\t\t\tSystem.out.print(Array.get(i)+\" \");\n\t\tIn.close();\n\t}", "public void sort() {\r\n for (int i = 0; i < namesOfApp.length && i < runTimeOfApp.length; i++) {\r\n for (int j = 0; j < i; j++) {\r\n if (runTimeOfApp[j] < runTimeOfApp[i]) {\r\n String tempName = namesOfApp[i];\r\n long tempRunTime = runTimeOfApp[i];\r\n namesOfApp[i] = namesOfApp[j];\r\n runTimeOfApp[i] = runTimeOfApp[j];\r\n namesOfApp[j] = tempName;\r\n runTimeOfApp[j] = tempRunTime;\r\n }\r\n }\r\n }\r\n\r\n }" ]
[ "0.6582191", "0.62344146", "0.61002123", "0.59919447", "0.59846985", "0.59035254", "0.5851632", "0.58148426", "0.58077216", "0.57064164", "0.569726", "0.56725657", "0.5644207", "0.56333685", "0.5628843", "0.55793417", "0.55720073", "0.55375355", "0.55246115", "0.55195075", "0.5513047", "0.55038124", "0.5487714", "0.5478038", "0.5469044", "0.5468204", "0.54590064", "0.5458908", "0.5450435", "0.5434632", "0.5430492", "0.54289687", "0.5417676", "0.5389409", "0.53853256", "0.53831667", "0.5359513", "0.53444546", "0.53186685", "0.5315028", "0.5305512", "0.5305046", "0.52937776", "0.52883565", "0.5286037", "0.5285873", "0.52856845", "0.5283646", "0.52712244", "0.526593", "0.52643615", "0.5239612", "0.5236599", "0.523549", "0.5234132", "0.5231342", "0.52220166", "0.5217762", "0.5215159", "0.52142537", "0.52133983", "0.520021", "0.5198705", "0.519242", "0.5189774", "0.5183914", "0.51792246", "0.5178127", "0.5167322", "0.5164024", "0.5162181", "0.5161365", "0.51438385", "0.51408195", "0.51255774", "0.51189727", "0.5117335", "0.51137257", "0.5112562", "0.5102818", "0.5098658", "0.509706", "0.50960153", "0.5095888", "0.50951105", "0.5075058", "0.50693166", "0.5066917", "0.50663596", "0.5065428", "0.50597113", "0.5053933", "0.50514245", "0.5041471", "0.5035887", "0.5034132", "0.5027327", "0.5024463", "0.50211704", "0.50205743" ]
0.5657262
12
TODO Autogenerated method stub Take the first string, split according to ";", and store in an arraylist
@Override public int compare(String o1, String o2) { String[] values = o1.split(";"); //Take the second string and do the same thing String[] values2 = o2.split(";"); //Compare strings according to their integer values return Integer.valueOf(values[0].replace("\"", "")).compareTo(Integer.valueOf(values2[0].replace("\"", ""))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private ArrayList parseStringToList(String data){\n ArrayList<String> result = new ArrayList<String>();\n String[] splitResult = data.split(\",\");\n for(String substring : splitResult){\n result.add(substring);\n }\n return result;\n }", "private static ArrayList<String> splitString(String line) {\n String[] splits = line.split(DELIMITER);\n return new ArrayList<>(Arrays.asList(splits));\n }", "private static ArrayList<String> split(String str) {\n String[] splits = str.split(DELIMITER);\n return new ArrayList<>(Arrays.asList(splits));\n }", "public List<String> GetAssegnamentiInCorso() {\n String str = \"Guillizzoni-Coca Cola Spa1-DRYSZO,Rossi-Coca Cola Spa2-DRYSZ2\";\n StringaAssegnamenti = str;\n StringaAssegnamenti = \"\";\n \n\tList<String> items = Arrays.asList(str.split(\"\\\\s*,\\\\s*\"));\n return items;\n }", "static public String[] parseImport(String value) {\n \treturn value.split(\";\");\n }", "public static List toListOfStringsDelimitedByCommaOrSemicolon(String s) {\n if (s == null) {\n return Collections.EMPTY_LIST;\n }\n\n List results = new ArrayList();\n // include empty last one, cft. http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#split%28java.lang.String,%20int%29\n String[] terms = s.split(SEPARATOR,-1);\n\n for (int i = 0; i < terms.length; i++) {\n //this has empty string if nothing is found\n String term = terms[i].trim();\n results.add(term);\n }\n\n return results;\n }", "private List<StockData> parseMultipleStockData(String data) {\n String[] arr = data.split(\";\\n\");\n List<StockData> list = new ArrayList<>();\n for (String sd : arr) {\n list.add(parseStockData(sd));\n }\n return list;\n }", "private ArrayList<String> stringToArrayList(String group, String splitter) {\n\t\t\n\t\t// Temp variables for splitting the string\n\t\tString[] splitString = TextUtils.split(group, splitter);\n\t\tArrayList<String> al = new ArrayList<String>();\n\t\t\n\t\t\n\t\tfor(int i=0; i<splitString.length; i++){\n\t\t\tLog.v(TAG, \"Read group \" + splitString[i]);\n\t\t\tal.add(splitString[i]);\n\t\t}\n\t\t\n\t\treturn al;\n\t}", "public static Collection getListeValeurs(String p_chaine){\n\n Collection liste= new ArrayList();\n\n\t\tif (!Controleur.isVide(p_chaine)){\n\t\t\tint separ = -1;\n\t\t\tdo {\n\t\t\t\tint curIndex = separ+1;\n\t\t\t\tsepar = p_chaine.indexOf(\";\",curIndex);\n\t\t\t\tif (separ >0)\n\t\t\t\t\tliste.add(p_chaine.substring(curIndex,separ).trim());\n\t\t\t\telse\n\t\t\t\t\tliste.add(p_chaine.substring(curIndex).trim());\n\t\n\t\t\t}while (separ>0);\n\t\t}\n\t\t\n\t\treturn liste;\n\t}", "private void parseData(String data) {\n String[] item = data.split(\";\");\n for(int i = 0; i < item.length; i++) {\n String[] property = item[i].split(\",\");\n MAC_Addresses.add(property[0]);\n }\n }", "protected List<String> convertToList(final String data) {\n\t\tif (data == null || data.length() == 0) {\n\t\t\treturn new ArrayList<String>();\n\t\t}\n\t\tString[] result = data.split(\",\");\n\t\tList<String> list = new ArrayList<String>();\n\t\tfor (String val : result) {\n\t\t\tlist.add(val.trim());\n\t\t}\n\t\treturn list;\n\t}", "public static List<String> deserialize( String value, String delimiter )\n {\n return Arrays.asList( value.split( delimiter ) );\n }", "public static List<String> parseStringToList(String str) {\n List<String> list = new LinkedList<>();\n if (StringUtils.isEmpty(str)){\n return list;\n }\n String[] tokens = str.trim().split(\"\\\\s*,\\\\s*\");\n if(tokens != null && tokens.length > 0) {\n for (String column : tokens) {\n list.add(column);\n }\n }\n return list;\n }", "private List<String> getCombo(boolean isCustomer){\n List<String> isi = new ArrayList<>();\n String[] daftar = new String[datas.size()];\n for (String data : datas) {\n daftar = data.split(\";\");\n if (isCustomer) isi.add(daftar[1]);\n else isi.add(daftar[0]);\n }\n return isi;\n}", "public static ArrayList<String> CSVtoArrayList(String Line) {\n\t\tArrayList<String> Result = new ArrayList<String>();\n\t\t\n\t\tif (Line != null) \n {\n\t\t\tString[] splitData = Line.split(\"\\\\s*,\\\\s*\");\n\t\t\tfor (int i = 0; i < splitData.length; i++) \n {\n\t\t\t\tif (!(splitData[i] == null) || !(splitData[i].length() == 0)) {\n\t\t\t\t\tResult.add(splitData[i].trim());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn Result;\n\t}", "private static List<String> split(final String source) throws IOException {\n List<String> result = new ArrayList<>();\n int last_split = -1;\n boolean opened_quotes = false;\n for (int i = 0; i < source.length(); i++) {\n char value = source.charAt(i);\n if (i == source.length() - 1 || source.charAt(i + 1) == '\\n') {\n if (value != ';') {\n throw new IOException(\"Invalid end of statement\");\n }\n String split = source.substring(last_split + 1, i);\n last_split = i;\n if (split.length() != 0) {\n result.add(split);\n }\n result.add(\";\");\n }\n\n if (opened_quotes) {\n if (value == '\\\"') {\n opened_quotes = false;\n String split = source.substring(last_split + 1, i + 1);\n last_split = i;\n if (split.length() == 0) continue;\n result.add(split);\n }\n if (value == '\\n') {\n throw new IOException(\"Invalid input.\");\n }\n } else {\n if (value == '\\\"') {\n opened_quotes = true;\n } else if (Character.isWhitespace(value)) {\n String split = source.substring(last_split + 1, i);\n last_split = i;\n if (split.length() == 0) continue;\n result.add(split);\n } else if (isSymbol(value) && value != ';') {\n String split = source.substring(last_split + 1, i);\n last_split = i;\n if (split.length() != 0) {\n result.add(split);\n }\n result.add(Character.toString(value));\n }\n }\n }\n if (opened_quotes) {\n throw new IOException(\"Invalid input.\");\n }\n\n return result;\n }", "private String[] separarCoordenadas(String pCasilla){\n\t\treturn pCasilla.split(\",\");\n\t}", "public static String[] split(String value) {\r\n\t\tif(value == null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn value.trim().split(\",\");\r\n\t}", "public ArrayList<Files> parseInput(String input){\r\n\t\tScanner parse = new Scanner(input);\r\n\t\tparse.useDelimiter(\";\");\r\n\t\tArrayList<Files> output = new ArrayList<Files>();\r\n\t\twhile(parse.hasNext())output.add(new Files(parse.next()));\r\n\t\tparse.close();\r\n\t\treturn output;\r\n\t}", "public ArrayList<String[]> read(String s) throws IOException,\n\t\t\tFileNotFoundException {\n\t\tArrayList<String[]> result = new ArrayList<String[]>();\n\t\tFileReader fr = new FileReader(s);\n\t\tBufferedReader br = new BufferedReader(fr);\n\t\tString[] row = new String[6];\n\t\tString line;\n\t\twhile (true) {\n\t\t\tline = br.readLine();\n\t\t\tif (line == null) {\n\t\t\t\tbr.close();\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\trow = line.split(\",\");\n\t\t\tresult.add(row);\n\t\t}\n\t}", "private ArrayList<Double> fromStringToList(String str){\n ArrayList<Double> list = new ArrayList(0);\n int index = 0;\n for (int i = 0 ; i < str.toCharArray().length ; i++){\n if (str.toCharArray()[i] == '$'){\n String task = str.substring(index, i); //will tell when a task ends\n list.add(Double.parseDouble(task));\n index = i+1;\n }\n }\n return list;\n }", "private static List<String> parseLine(String csvLine) {\n List<String> result = new ArrayList<>();\n if (Objects.isNull(csvLine) || csvLine.isEmpty()) {\n return result;\n }\n StringBuilder charSet = new StringBuilder();\n char[] chars = csvLine.toCharArray();\n for (char character : chars) {\n if (character == DEFAULT_SEPARATOR) {\n result.add(charSet.toString().trim());\n charSet = new StringBuilder();\n } else {\n charSet.append(character);\n }\n }\n result.add(charSet.toString().trim());\n return result;\n }", "private static List<String> convertCommaDelimitedStringToList(String delimitedString) {\n\n\t\tList<String> result = new ArrayList<String>();\n\n\t\tif (!StringUtils.isEmpty(delimitedString)) {\n\t\t\tresult = Arrays.asList(StringUtils.delimitedListToStringArray(delimitedString, \",\"));\n\t\t}\n\t\treturn result;\n\n\t}", "public static List<String> deserialize( String value )\n {\n return deserialize( value, DEFAULT_DELIMITER );\n }", "public ArrayList<String> parse(String STP) {\r\n\t\tArrayList<String> parts2 = new ArrayList<>();\r\n\t\tString[] parts = STP.split(\"!\"); // Splits array of strings at the\r\n\t\t\t\t\t\t\t\t\t\t\t// exclamation point, a separator\r\n\t\t\t\t\t\t\t\t\t\t\t// character\r\n\t\tfor (String s : parts) {\r\n\t\t\tString[] subparts = s.split(\":\"); // Splits the tags of a string\r\n\t\t\t\t\t\t\t\t\t\t\t\t// from the values\r\n\t\t\tfor (String b : subparts) {\r\n\t\t\t\tparts2.add(b);\r\n\t\t\t}\r\n\t\t}\r\n\t\t// for (String s : parts2)\r\n\t\t// System.out.print(s);\r\n\t\treturn parts2;\r\n\t}", "public ArrayList recuperString_to_Array(String lestring){\n int i;\n char restemp;\n String sretemp=\"\";\n Iterator it;\n ArrayList<String>ListTextString=new ArrayList<String>();\n for(i=0;i<lestring.length();i++){\n restemp=lestring.charAt(i);\n sretemp+=restemp;\n switch (lestring.charAt(i)) {\n case '\\n':\n ListTextString.add(sretemp);\n sretemp=\"\";\n break;\n case '\\t':\n sretemp=\"\";\n break;\n }\n }\n it=ListTextString.iterator();\n while (it.hasNext()){\n System.out.println(it.next().toString());\n\n }\n return ListTextString;\n }", "private ArrayList parseList(String localData){\n int localPointer = 0;\n ArrayList temp = new ArrayList();\n char c = localData.charAt(localPointer++);\n while (c != ']'){\n String item = \"\";\n Object itemObj = null;\n item_loop :\n while (c != ']'){\n switch (c){\n case ',' :\n c = localData.charAt(localPointer++);\n break item_loop;\n case '{' :\n String tempItem = this.getFull(localData.substring(localPointer),0);\n localPointer += tempItem.length();\n item += tempItem;\n break ;\n case '[' :\n String tempItem2 = this.getFull(localData.substring(localPointer),1);\n localPointer += tempItem2.length();\n item += tempItem2;\n break ;\n default :\n item += c;\n break ;\n }\n c = localData.charAt(localPointer++);\n }\n item = item.trim();\n switch (this.getDataType(item.trim())){\n case String:\n itemObj = item.trim().replace(\"\\\"\",\"\");\n break ;\n case Integer:\n itemObj = Long.parseLong(item.trim());\n break ;\n case Float:\n itemObj = Float.parseFloat(item.trim());\n break ;\n case Boolean:\n itemObj = Boolean.parseBoolean(item.trim());\n break ;\n case Map:\n itemObj = this.parseMap(item.trim());\n break ;\n case List:\n itemObj = this.parseList(item.trim());\n }\n temp.add(itemObj);\n }\n return temp;\n }", "private String[] splitLine(String line)\n\t{\n\t\treturn line.split(CSV_SEPARATOR);\n\t}", "private String[] commaDelimited(String str) {\n StringTokenizer st = new StringTokenizer(str,\",\");\n String strs[] = new String[st.countTokens()];\n for (int i=0;i<strs.length;i++) strs[i] = Utils.decFmURL(st.nextToken());\n return strs;\n }", "@Override\n protected void processLine(String line) {\n String[] lines = line.split(\",\");\n for (String l : lines) {\n data.add(l);\n }\n }", "private ArrayList<Card> readHandString(String handLine)\n {\n ArrayList<Card> hand = new ArrayList<Card>();\n Scanner handLineScanner = new Scanner(handLine);\n handLineScanner.useDelimiter(\",\");\n while (handLineScanner.hasNext())\n {\n String cardString = handLineScanner.next();\n Card card = readCardString(cardString);\n hand.add(card);\n }\n handLineScanner.close();\n return hand;\n }", "public List<Protein> stringToList(String proteinString) throws Throwable{\n\n\t\t/* ----------Some things that we will need. -------------*/\n\n\t\tList<Protein> proteins = null;\n\t\tProtein p = null;\n\t\tStringTokenizer token = null;\n\t\t\n\t\t/* ****************************************************** */\n\n\t\ttry {\n\t\t\t/* ---------- Instantiate -------------*/\n\n\t\t\tproteins = new ArrayList<Protein>();\n\t\t\ttoken = new StringTokenizer(proteinString, \".\");\n\t\t\t\n\t\t\t/* *********************************** */\n\t\t\t\n\t\t\t/* ---------- While we have more tokens, add them -------------*/\n\n\t\t\twhile (token.hasMoreTokens()){\n\t\t\t\tp = new Protein();\n\t\t\t\tp.setProteinId(Integer.parseInt(token.nextToken()));\n\t\t\t\tp.setProteinSequence(token.nextToken());\n\t\t\t\tproteins.add(p);\n\t\t\t}\n\t\t\t\n\t\t\t/* *********************************************************** */\n\t\t\t\n\t\t}catch (Throwable t){\n\t\t\t/* ---------- Make sure to set the fail param if something goes wrong -------------*/\n\n\t\t\tlog.error(\"Failed to build list.\", t);\n\t\t\tMain.passfail = Main.FAIL;\n\t\t\t\n\t\t\t/* ******************************************************************************** */\n\t\t}\n\n\t\tif(log.isDebugEnabled()){ log.debug(\"List of proteins has been built.\"); }\n\t\t\n\t\t/* ---------- Return the list -------------*/\n\n\t\treturn proteins;\n\t\t\n\t\t/* *************************************** */\n\t}", "public Iterable<String> call(String line) throws Exception {\n\t\t\t\treturn Arrays.asList(line.split(\",\"));\n\t\t\t}", "public static ArrayList<String> stringToArray(String str) {\n ArrayList<String> temp = new ArrayList<String>();\n\n while (!str.equals(\"\") && str.contains(\" \")) {\n temp.add(str.substring(0, str.indexOf(\" \")));\n str = str.substring(str.indexOf(\" \") + 1, str.length());\n }\n temp.add(str);\n return temp;\n }", "private ArrayList<String> splitString(String arguments) {\n String[] strArray = arguments.trim().split(REGEX_WHITESPACES);\n return new ArrayList<String>(Arrays.asList(strArray));\n }", "private static List<String> stringToList(String string) {\n\t // Create a tokenize that uses \\t as the delim, and reports\n\t // both the words and the delimeters.\n\t\tStringTokenizer tokenizer = new StringTokenizer(string, \"\\t\", true);\n\t\tList<String> row = new ArrayList<String>();\n\t\tString elem = null;\n\t\tString last = null;\n\t\twhile(tokenizer.hasMoreTokens()) {\n\t\t\tlast = elem;\n\t\t\telem = tokenizer.nextToken();\n\t\t\tif (!elem.equals(\"\\t\")) row.add(elem);\n\t\t\telse if (last.equals(\"\\t\")) row.add(\"\");\n\t\t\t// We need to track the 'last' state so we can treat\n\t\t\t// two tabs in a row as an empty string column.\n\t\t}\n\t\tif (elem.equals(\"\\t\")) row.add(\"\"); // tricky: notice final element\n\t\t\n\t\treturn(row);\n\t}", "private List<String> parseParam(String zipcode) {\n\t\t\n\t\tList<String> zipList = new ArrayList<String>();\n\n\t\tif (zipcode.contains(\",\")) {\n\t\t\t\n\t\t\tStringTokenizer tokenizer = new StringTokenizer(zipcode.trim(), \",\");\n\t\t\twhile (tokenizer.hasMoreElements()) {\n\t\t\t\tString token = (String) tokenizer.nextElement();\n\t\t\t\tif(token !=null){\n\t\t\t\t\tStringBuilder element= new StringBuilder(token.replace(\" \", \"\")) ;\n\t\t\t\t\tzipList.add(element.toString());\n\t\t\t\t}\n\t\t\t\t \n\t\t\t}\n\t\t} else\n\t\t\tzipList.add(zipcode);\n\n\t\treturn zipList;\n\t}", "abstract List<String> splitStringToCollection(String inputString, String separator);", "private Set<String> parseStringToSet(final String data) {\n String[] splits;\n\n if (data != null && data.length() > 0) {\n splits = data.split(\",\");\n } else {\n splits = new String[] {};\n }\n\n Set<String> set = new HashSet<String>();\n if (splits.length > 0) {\n for (String split : splits) {\n set.add(split.trim());\n }\n }\n\n return set;\n }", "private ArrayList limpiar() {//quita espacios en blanco y saltos de linea\n String codigoFuente = ta_source.getText();\n ArrayList retorno = new ArrayList();\n try {\n codigoFuente = codigoFuente.replaceAll(\" \", \"\");\n String aux = \"\";\n byte guardaLinea = 1, guardaBloque = 1;\n for (int i = 0; i < codigoFuente.length(); i++) {\n if (codigoFuente.length() > (i + 1) && codigoFuente.charAt(i) == '/' && codigoFuente.charAt(i + 1) == '/' && guardaBloque == 1) {\n guardaLinea = 0;//0: no guarda\n }\n if (codigoFuente.length() > (i + 1) && codigoFuente.charAt(i) == '/' && codigoFuente.charAt(i + 1) == '*' && guardaLinea == 1) {\n guardaBloque = 0;//0: no guarda\n }\n if (i > 0 && codigoFuente.charAt(i) == '/' && codigoFuente.charAt(i - 1) == '*') {\n guardaBloque = 2;//1: si guarda\n }\n if (codigoFuente.charAt(i) == '\\n' && guardaBloque == 1) {\n guardaLinea = 1;//1: si guarda\n if (aux.length() > 0) {\n retorno.add(aux);\n aux = \"\";\n }\n } else {\n if (i == codigoFuente.length() - 1) {\n aux += codigoFuente.charAt(i);\n retorno.add(aux);\n }\n }\n if (guardaBloque == 1 && guardaLinea == 1 && codigoFuente.charAt(i) != '\\n') {\n aux += codigoFuente.charAt(i);\n }\n if (guardaBloque == 2) {\n guardaBloque--;\n }\n }\n } catch (Exception e) {\n System.out.println(\"errror \" + e.getClass());\n } finally {\n return retorno;\n }\n }", "public static List<String> split(String str, String delim) {\n List<String> splitList = null;\n StringTokenizer st;\n\n if (str == null) {\n return null;\n }\n\n st = (delim != null ? new StringTokenizer(str, delim) : new StringTokenizer(str));\n\n if (st.hasMoreTokens()) {\n splitList = new LinkedList<>();\n\n while (st.hasMoreTokens()) {\n splitList.add(st.nextToken());\n }\n }\n return splitList;\n }", "static public String [] parseList (String listString, String startToken, String endToken,\n String delimiter)\n{\n String s = listString.trim ();\n if (s.startsWith (startToken) && s.endsWith (endToken)) {\n s = s.substring (1, s.length()-1); \n return s.split (delimiter);\n }\n else {\n String [] unparseableResult = new String [1];\n unparseableResult [0] = listString;\n return unparseableResult;\n }\n \n /*********************\n StringTokenizer strtok = new StringTokenizer (deparenthesizedString, delimiter);\n int count = strtok.countTokens ();\n for (int i=0; i < count; i++)\n list.add (strtok.nextToken ());\n }\n else\n list.add (listString);\n\n return (String []) list.toArray (new String [0]);\n **********************/\n\n\n}", "public static List<String> explode(String text, String separator) {\r\n\t\t\tList<String> list = new ArrayList<String>();\r\n\t\t\tif (text != null && separator != null && !text.isEmpty()) {\r\n\t\t\t\tCollections.addAll(list, text.split(separator));\r\n\t\t\t}\r\n\r\n\t\t\treturn list;\r\n\t\t}", "public List<String> convertCsvToJava() {\n List<String> bookList = new ArrayList<String>();\n try {\n String csvFileToRead = STRING1;\n BufferedReader br = null;\n String line = \"\";\n String splitBy = \",\";\n \n try {\n\n br = new BufferedReader(new FileReader(csvFileToRead));\n while ((line = br.readLine()) != null) {\n\n // split on comma(',')\n String[] books = line.split(splitBy);\n String stringBook = \"\";\n for(int i=0;i<12;i++){\n if (i<11){\n stringBook=stringBook.concat(books[i]+\",\"); \n }else{\n stringBook=stringBook.concat(books[i]);\n }\n }\n bookList.add(stringBook);\n }\n } catch (FileNotFoundException e) {\n LOGGER.info(e);\n\n } catch (IOException e) {\n LOGGER.info(e);\n } finally {\n if (br != null) {\n try {\n br.close();\n } catch (IOException e) {\n LOGGER.info(e);\n }\n }\n }\n } catch (Exception e) {\n LOGGER.info(e);\n }\n return bookList;\n\n }", "public static List<String> sentenceToList(String sentence){\n\t\treturn Arrays.asList(sentence.split(\"\\\\s+\"));\n\t}", "public static String[] split(String value, String spliter) {\r\n\t\tif(value == null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn value.trim().split(spliter);\r\n\t}", "private static List<String[]> readInput(String filePath) {\n List<String[]> result = new ArrayList<>();\n int numOfObject = 0;\n\n try {\n Scanner sc = new Scanner(new File(filePath));\n sc.useDelimiter(\"\");\n if (sc.hasNext()) {\n numOfObject = Integer.parseInt(sc.nextLine());\n }\n for (int i=0;i<numOfObject;i++) {\n if (sc.hasNext()) {\n String s = sc.nextLine();\n if (s.trim().isEmpty()) {\n continue;\n }\n result.add(s.split(\" \"));\n }\n }\n sc.close();\n }\n catch (FileNotFoundException e) {\n System.out.println(\"FileNotFoundException\");\n }\n return result;\n }", "public ArrayList<List<String>> processCourseFile(String coursefile) {\n\t\tArrayList<List<String>> courses = new ArrayList<List<String>>();\n\t\ttry {\n\t\t\tBufferedReader reader = new BufferedReader(new FileReader(coursefile));\n\t\t\tString line = null;\n\t\t\twhile ((line = reader.readLine()) != null) \n\t\t\t{\n\t\t\t\tline = line.trim();\n\t\t\t\t\n\n\t\t\t\tString[] tokens = line.split(\";\");\n\n\t\t\t\tList<String> list = new ArrayList<String>();\n\t\t\t\tfor (String token : tokens) \n\t\t\t\t{\n\t\t\t\t\ttoken.trim();\n\t\t\t\t\t//System.out.println(token);\n\t\t\t\t\t//if (token.equals(\"\"))\n\t\t\t\t\t\t//continue;\n\t\t\t\t\tlist.add(token);\n\t\t\t\t}\n\t\t\t\tif (!list.isEmpty()) \n\t\t\t\t{\n\t\t\t\t\tcourses.add(list);\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t\treader.close();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn courses;\n\t}", "public static String[] parseCommaSeparatedList(String line) {\n \tArrayList myList = new ArrayList();\n \t\n \tString myLine = new String(line);\n \t\n \twhile(myLine.contains(\",\")) {\n \t\tString item = myLine.substring(0, myLine.indexOf(\",\"));\n \t\titem = StringUtilities.removeEdgeWhitespace(item);\n \t\tmyList.add(item);\n \t\tmyLine = myLine.substring((myLine.indexOf(\",\") + 1));\n \t}\n \tmyLine = StringUtilities.removeEdgeWhitespace(myLine);\n \tif(myLine.compareTo(\"\") != 0) myList.add(myLine);\n\n \tString[] list = new String[myList.size()];\n \tfor(int i = 0; i < myList.size(); i++) {\n \t\tlist[i] = new String((String)myList.get(i));\n \t}\n \t\n \treturn list;\n }", "private List<String> ListTransform(Object value) {\n\n if (value.toString().contains(lineDelimiter))\n return Arrays.asList(value.toString().split(lineDelimiter));\n\n List<String> lines = new ArrayList<>();\n if (!value.toString().equals(\"\"))\n lines.add(value.toString());\n\n return lines;\n }", "public static List<Integer> convertStrToList(String str, String sepator) {\n\t\tif (StringUtils.isEmpty(str)) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (StringUtils.isEmpty(sepator)) {\n\t\t\tsepator = \",\";\n\t\t}\n\n\t\tString[] split = str.split(sepator);\n\t\tList<Integer> list = null;\n\t\tif (split != null && split.length > 0) {\n\t\t\tlist = new ArrayList<Integer>();\n\n\t\t\tfor (String s : split) {\n\t\t\t\tlist.add(Integer.parseInt(s));\n\t\t\t}\n\t\t}\n\n\t\treturn list;\n\t}", "public List<String> decode(String s) {\n List<String> ans = new ArrayList<String>();\n int l = 0, r = 0;\n while (r < s.length()) {\n while (s.charAt(r) != '@') r++;\n int len = Integer.parseInt(s.substring(l, r++));\n ans.add(s.substring(r, r+len)); \n l = r = r+len;\n }\n \n return ans;\n }", "private void getEachElementOfTheLine() {\n int nbOfComa = 0;\n String idItemCraft = \"\";\n ArrayList<String> idItemNeeded = new ArrayList<>();\n ArrayList<String> quantityItemNeeded = new ArrayList<>();\n boolean isFinished = false;\n for (int c = 0; c < line.length() && !isFinished; c++) {\n switch (nbOfComa) {\n\n case 2:\n quantityItemNeeded.add(new String(\"\" + line.charAt(c)));\n if (line.charAt(c + 1) == '.') {\n isFinished = true;\n } else if (line.charAt(c + 1) == ';') {\n nbOfComa = 1;\n c++;\n }\n break;\n\n case 1:\n idItemNeeded.add(new String(\"\" + line.charAt(c)));\n if (line.charAt(c + 1) == ',') {\n nbOfComa++;\n c++;\n }\n break;\n\n case 0:\n idItemCraft = idItemCraft + line.charAt(c);\n if (line.charAt(c + 1) == ';') {\n nbOfComa++;\n c++;\n }\n break;\n\n default:\n break;\n }\n }\n this.idItemCraft = idItemCraft;\n this.idItemNeeded = idItemNeeded;\n this.quantityItemNeeded = quantityItemNeeded;\n }", "protected static ArrayList<String> load() throws Exception {\r\n\t\tArrayList<String> list;\r\n\t\tFileReader fileRead = new FileReader(csv);\r\n\t\tBufferedReader buff = Files.newBufferedReader(Paths.get(\"story.csv\"));\r\n\t\tlist = buff.lines().map(line -> line.split(\",\")).flatMap(Arrays::stream)\r\n\t\t\t\t.collect(Collectors.toCollection(ArrayList::new));\r\n\t\tbuff.close();\r\n\t\tfileRead.close();\r\n\r\n\t\treturn list;\r\n\t}", "public static List<String> parse(String s) {\r\n\t\tVector<String> rval = new Vector<String>();\r\n\t\tStringTokenizer tkn = new StringTokenizer(s);\r\n\t\twhile (tkn.hasMoreTokens())\r\n\t\t\trval.add(tkn.nextToken());\r\n\t\treturn rval;\r\n\t}", "public static String[] explode(char separator, String string) {\n\t if (string == null) return null;\n\t int len = string.length();\n\t int start = 0;\n\t int end;\n\t ArrayList<String> res = new ArrayList<String>(5);\n\t while (start < len) {\n\t\t end = string.indexOf(separator, start);\n\t\t if (end < 0) end = len;\n\t\t res.add(string.substring(start, end));\n\t\t start = end + 1;\n\t }\n\t return res.toArray(new String[res.size()]);\n }", "private ArrayList<String> tokeniseString(String string) {\n ArrayList<String> tokens = new ArrayList<>();\n\n // Regex that tokenises based on the rules of the assignment\n String regex = \"(https?:\\\\/\\\\/[^\\\\s]+)|((www)?[^\\\\s]+\\\\.[^\\\\s]+)|(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\\\"(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x21\\\\x23-\\\\x5b\\\\x5d-\\\\x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x0b\\\\x0c\\\\x0e-\\\\x7f])*\\\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x21-\\\\x5a\\\\x53-\\\\x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x0b\\\\x0c\\\\x0e-\\\\x7f])+)\\\\])|([A-Z][a-zA-Z0-9-]*)([\\\\s][A-Z][a-zA-Z0-9-]*)+|(?:^|\\\\s)'([^']*?)'(?:$|\\\\s)|[^\\\\s{.,:;”’()?!}]+\";\n Pattern pattern = Pattern.compile(regex);\n Matcher matcher = pattern.matcher(string);\n\n // Add all terms to the array\n while (matcher.find()) {\n tokens.add(matcher.group());\n }\n\n ArrayList<String> processedTokens = new ArrayList<>();\n\n // Need to remove quotes, commas, etc. leading and trailing\n for (String token : tokens) {\n token = token.trim();\n\n // Remove leading punctuation\n while (token.startsWith(\".\") || token.startsWith(\",\") || token.startsWith(\"'\") || token.startsWith(\"\\\"\") || token.startsWith(\"_\") || token.startsWith(\"[\")) {\n token = token.substring(1);\n }\n\n // Remove trailing punctuation\n while (token.endsWith(\".\") || token.endsWith(\",\") || token.endsWith(\"'\") || token.endsWith(\"\\\"\") || token.endsWith(\"_\") || token.endsWith(\"]\")) {\n token = token.substring(0, token.length() - 1);\n }\n\n // Add to new array\n processedTokens.add(token);\n }\n\n return processedTokens;\n }", "static List<Intervall> handleInput(String input) {\n\t\tList<Intervall> listIntervall = new ArrayList<>();\n\t\tif (input.length() > 0) {\n\t\t\tString[] inputArray = input.split(\" \");\n\n\t\t\tfor (String s : inputArray) {\n\t\t\t\tString sTrimmed = s.substring(1, s.length() - 1);\n\t\t\t\tString[] inputValues = sTrimmed.split(\",\");\n\t\t\t\tlistIntervall.add(new Intervall(Integer.parseInt(inputValues[0]), Integer.parseInt(inputValues[1])));\n\t\t\t}\n\t\t}\n\t\treturn listIntervall;\n\t}", "protected String[] arrayParser(String item){\n return item.replaceAll(\"\\\\{|\\\\}|\\\\[|\\\\]|(\\\\d+\\\":)|\\\"|\\\\\\\\\", \"\").split(\",\");\n }", "@TypeConverter\r\n public String[] fromString(String value) {\r\n String[] split = value.split(SEPERATOR.toString());\r\n return value.isEmpty() ? split : split;\r\n }", "public static String[] splitLine(String line) {\n\t\t\n\t\tStringBuffer buffer = new StringBuffer();\n\t\tArrayList<String> stockStrs = new ArrayList<String>();\n\t\t\n\t\tchar[] chars = line.toCharArray();\n\t\tboolean inQuotes = false;\n\t\tfor (char ch: chars) {\n\t\t\tif (inQuotes) {\n\t\t\t\tif (ch == '\"') {\n\t\t\t\t\tinQuotes = false;\n\t\t\t\t} else {\n\t\t\t\t\tbuffer.append(ch);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (ch == '\"') {\n\t\t\t\t\tinQuotes = true;\n\t\t\t\t} else if (ch == ',') {\n\t\t\t\t\tstockStrs.add(buffer.toString());\n\t\t\t\t\tbuffer.delete(0, buffer.length());\n\t\t\t\t} else {\n\t\t\t\t\tbuffer.append(ch);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tstockStrs.add(buffer.toString());\n\t\n\t\tString[] stockStrsArray = stockStrs.toArray(new String[stockStrs.size()]);\n\t\treturn stockStrsArray;\n\t}", "public List<String> getList(String attributeStr) {\n List<String> attributeValuesList = new ArrayList<>();\n if (!attributeStr.equals(\"\")) {\n String[] attributeValues = attributeStr.replaceAll(\", \", \",\").split(\",\");\n for (String attributeValue : attributeValues)\n attributeValuesList.add(attributeValue);\n }\n return attributeValuesList;\n }", "protected final List getValuesAsList(String values)\r\n {\r\n List list = new LinkedList();\r\n StringTokenizer tok = new StringTokenizer(values, DELIMITER);\r\n\r\n while(tok.hasMoreTokens())\r\n {\r\n // extract each value, trimming whitespace\r\n list.add(tok.nextToken().trim());\r\n }\r\n\r\n // return the list\r\n return list;\r\n }", "private ArrayList<String> parseFile(String file_name){ // extract each line from file AS string (stopList)\r\n ArrayList<String> list = new ArrayList<>();\r\n Scanner scanner = null;\r\n try{\r\n scanner = new Scanner(new BufferedReader(new FileReader(file_name)));\r\n while (scanner.hasNextLine())\r\n {\r\n list.add(scanner.nextLine());\r\n }\r\n }\r\n catch (Exception e ){ System.out.println(\"Error reading file -> \"+e.getMessage()); }\r\n finally {\r\n if(scanner != null ){scanner.close();} // close the file\r\n }\r\n return list;\r\n }", "private void populateListFromLine(String line, List<String> wordList) {\n\t\tif (line != null && line.length() > 0) {\n\t\t\tString[] words = line.split(\"\\\\s|\\\\?|\\\\.|\\\\!|\\\\:|\\\\;|\\\\-\");\n\t\t\tfor (String word : words) {\n\t\t\t\twordList.add(word);\n\t\t\t}\n\t\t}\n\t}", "public void splitter(String values) {\n\n\t\tfor(int i=0; i < values.length(); i++) {\n\t\t\tnewString += values.charAt(i);\n\n\t\t\tif(semi == values.charAt(i)) {\n\t\t\t\tnewString = newString.replaceAll(\";\", \"\");\n\t\t\t\tnewString = newString.replaceAll(\"\\n\", \"\");\n\t\t\t\tsplittedString.add(newString);\n\t\t\t\tnewString = \"\";\n\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i=0; i < splittedString.size()-1; i++) {\n\t\t\tsection = splittedString.get(i);\n\t\t\tString[] dev = section.split(\",\");\n\t\t\tboolean validValues = true;\n\t\t\tfor(int x1 = 0; x1 < dev.length; x1+=3) {\n\t\t\t\tString xx1 = dev[x1];\n\t\t\t\tif(isInteger(xx1) && validValues) {\n\t\t\t\t\tx.add(Integer.parseInt(xx1));\n\t\t\t\t} else {\n\t\t\t\t\tvalidValues = false;\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\tfor(int y1= 1; y1 <dev.length; y1+=3) {\n\t\t\t\tString yy1 = dev[y1];\n\t\t\t\tif(isInteger(yy1) && validValues) {\n\t\t\t\t\ty.add(Integer.parseInt(yy1));\n\t\t\t\t} else {\n\t\t\t\t\tvalidValues = false;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tfor(int z1= 2; z1 <dev.length; z1+=3) {\n\t\t\t\tString zz1 = dev[z1];\n\t\t\t\tif(isInteger(zz1) && validValues) {\n\t\t\t\t\tz.add(Integer.parseInt(zz1));\n\t\t\t\t} else {\n\t\t\t\t\tvalidValues = false;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}", "String getStringList();", "public void setReaderToArray(){\n try{\n String client, number = null;\n\n File reader = new File(\"clientFile/clientInfo.txt\");\n\n Scanner scn = new Scanner(reader);\n scn.useDelimiter(\",\");\n\n while(scn.hasNext()){\n number = scn.next();\n client = scn.next();\n\n clientList.add(client + \" - \" + number);\n }\n scn.close();\n }catch (FileNotFoundException exception){\n System.out.println(\"An error occurred.\");\n }\n }", "public List<String> decode(String s) {\n List<String> res = new ArrayList<>();\n if(s == null) return res;\n return Arrays.asList(s.split(key,-1));\n }", "public static ArrayList<String> getUsedList(String output) throws IOException {\n\t\tImportsList obj1 = new ImportsList();\n\t\tArrayList<String> importsList = obj1.ImportsList(output);\n\t\tArrayList<ArrayList<String>> splitStarStore = new ArrayList<ArrayList<String>>();\n\t\tArrayList<String> splitNonStarStore = new ArrayList<String>();\n\t\tMap<String, Integer> import_values = new HashMap<>();\n\t\tMap<String, Integer> code_values = new HashMap<>();\t\n\t\t\n\t\tfor (Iterator iterator = importsList.iterator(); iterator.hasNext();) {\n\t\t\tString string = (String) iterator.next();\n\t\t\tif(string.contains(\"*\"))\n\t\t\t{\n\t\t\t\tString[] temp = string.split(\"\\\\.\");\n\t\t\t\t//removed java\n\t\t\t\tint count=0;\n\t\t\t\tfor (String s : temp)\n\t\t\t\t{\n\t\t\t\t\tif(s.contains(\"*\"))\n\t\t\t\t\t{\n\t\t\t\t\t\tArrayList<String> inner = new ArrayList<String>();\n\t\t\t\t\t\tinner.add(temp[count-1]);\n\t\t\t\t\t\tFileInputStream fstream1 = new FileInputStream(\"importPackages.txt\");\n\t\t\t\t\t\tBufferedReader br1 = new BufferedReader(new InputStreamReader(fstream1));\n\t\t\t\t\t\tString strLine;\n\t\t\t\t\t\t\n\t\t\t\t\t\twhile ((strLine = br1.readLine()) != null) \n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\tString string1 = temp[count-1];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(strLine.contains(string1))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tString[] temp1 = strLine.split(string1);\n\t\t\t\t\t\t\t\tString[] temp2 = temp1[1].split(\";\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tString[] temp3 = temp2[0].split(\"\\\\.\");\n\t\t\t\t\t\t\t\tint count1=0;\n\t\t\t\t\t\t\t\tfor (String s1 : temp3)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif(count1!=0)\n\t\t\t\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tinner.add(s1);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcount1++;\n\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsplitStarStore.add(inner);\n\t\t\t\t/*\t\tfor(ArrayList<String> inner1 : splitStore) {\n\t\t\t\t\t for(String s1 : inner1)\n\t\t\t\t\t {\n\t\t\t\t\t \tSystem.out.println(\"hey\"+s1);\n\t\t\t\t\t }\n\t\t\t\t\t }*/\n\t\t\t\t\t}\n\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tString[] temp = string.split(\"\\\\.\");\n\t\t\t\tint count=0;\n\t\t\t\tString temp1=null;\n\t\t\t\tfor (String s : temp)\n\t\t\t\t{\n\t\t\t\t\t\ttemp1 = s;\n\t\t\t\t}\n\t\t\t splitNonStarStore.add(temp1);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\toutput=output.split(\"<class>\")[1].split(\"</class>\")[0];\n//\t\tSystem.out.println(output);\n\t\t\n\t Pattern pattern = Pattern.compile(\"<name>(.*?)</name>\");\n\t Matcher matcher = pattern.matcher(output);\n\t \n\t while (matcher.find()) {\n\t \tif(matcher.group(1).split(\"<name>\")[0].trim().equals(\"\")) {\n \t//\t\tSystem.out.println(matcher.group(1).split(\"<name>\")[1].trim());\n \t\t\tcode_values.put(matcher.group(1).split(\"<name>\")[1].trim(),0);\n \t\t}\n\t \telse\n\t \t//\tSystem.out.println(matcher.group(1));\n\t \t\tcode_values.put(matcher.group(1),0);\t \t\t\n\t }\n\t \n\t int count=0;\n\t int flag;\n\t ArrayList<String> usedImports = new ArrayList<String>();\n\t for(ArrayList<String> inner : splitStarStore) {\n\t \tflag=0;\n\t for(String s : inner) {\n\t \tfor (Map.Entry<String, Integer> entry1 : code_values.entrySet())\n\t \t\t{\n\t \t\t\tif(s.equals(entry1.getKey()))\n\t \t\t\t{\n\t \t\t\t\tfor (Iterator iterator = importsList.iterator(); iterator.hasNext();) {\n\t \t\t\t\t\tString string = (String) iterator.next();\n\t \t\t\t\t\tString[] temp = string.split(\"\\\\.\");\n \t\t\t\t\t\tfor (String s1 : temp)\n \t\t\t\t\t\t{\n \t\t\t\t\t\t\tif(s1.equals(s))\n \t\t\t\t\t\t\t{\n \t\t\t\t\t\t\t\tflag=1;\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==1)\n \t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t\t\n\t \t\t\t\t}\n\t \t\t\t\tfor (Iterator iterator = importsList.iterator(); iterator.hasNext();){\n\t \t\t\t\t\tString string = (String) iterator.next();\n\t \t\t\t\t\tif(string.contains(splitStarStore.get(count).get(0)) && string.contains(\"*\"))\n\t \t\t\t\t\t\tusedImports.add(string);\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t}\n\t }\n\t count++;\n\t }\n\t \n\t for(Iterator iterator = splitNonStarStore.iterator(); iterator.hasNext();)\n\t {\n\t \tString s=(String) iterator.next();\n\t \tfor (Map.Entry<String, Integer> entry1 : code_values.entrySet())\n \t\t{\n \t\t\tif(s.equals(entry1.getKey()))\n \t\t\t{\n \t\t\t\tfor (Iterator iterator1 = importsList.iterator(); iterator1.hasNext();) {\n \t\t\t\t\tString string = (String) iterator1.next();\n \t\t\t\t\tString[] temp = string.split(\"\\\\.\");\n\t\t\t\t\t\tfor (String s1 : temp)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(s1.equals(s))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tusedImports.add(string);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t \t\t\t\t\t\n \t\t\t\t}\n \t\t\t}\n \t\t}\n\t }\n\t return usedImports;\n\t}", "public static String[] split(String string) {\n String[] result = string.split(\",\");\n for (int i = 0; i < result.length; i++) {\n result[i] = result[i].trim();\n }\n return result;\n }", "public static List<String> readWordlist(String url) {\n\t\tfinal List<String> lines = new ArrayList<String>();\n\t\ttry {\n\t\t\tURL website = new URL(url);\n\t\t\tURLConnection connection = website.openConnection();\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream(), \"UTF-8\"));\n\t\t\tString str;\n\t\t\twhile ((str = in.readLine()) != null) {\n\t\t\t\t// Nur Namen mit unter 8 Buchstaben nehmen damit die Namen nicht zu lange werden (& kaputte Zeichen vermeiden)\n\t\t\t\tif (str.length() < 8 && !str.contains(\"�\")) {\n\t\t\t\t\t// Wenn CSV\n\t\t\t\t\tif(str.contains(\",\")) {\n\t\t\t\t\t\tlines.add(str.split(\",\")[0]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlines.add(str);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tin.close();\n\t\t} catch (Exception e) {\n\t\t\t//ignore\n\t\t}\n\t\treturn lines;\n\t}", "ArrayList<String> createList(String finalInput);", "public static HashMap<String, ArrayList<String>> parseKeyValueList(String keySpliter, String strToParse) {\r\n\t\treturn parseKeyValueList (keySpliter, null, \"\\n\", strToParse);\r\n\t}", "public static ArrayList<String> splitCSVLine(String textLine) {\n\t\tArrayList<String> entries = new ArrayList<String>();\n\t\tint lineLength = textLine.length();\n\t\tStringBuffer nextWord = new StringBuffer();\n\t\tchar nextChar;\n\t\tboolean insideQuotes = false;\n\t\tboolean insideEntry= false;\n\t\t\n\t\t//iterate over all characters in the textLine\n\t\tfor (int i = 0; i < lineLength; i++) {\n\t\t\tnextChar = textLine.charAt(i);\n\t\t\t\n\t\t\t//handle smart quotes as well as regular quotes \n\t\t\tif (nextChar == '\"' || nextChar == '\\u201C' || nextChar =='\\u201D') { \n\t\t\t\t//change insideQuotes flag when nextChar is a quote\n\t\t\t\tif (insideQuotes) {\n\t\t\t\t\tinsideQuotes = false;\n\t\t\t\t\tinsideEntry = false; \n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tinsideQuotes = true; \n\t\t\t\t\tinsideEntry = true; \n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (Character.isWhitespace(nextChar)) {\n\t\t\t\tif ( insideQuotes || insideEntry ) {\n\t\t\t\t\t// add it to the current entry\n\t\t\t\t\tnextWord.append( nextChar );\n\t\t\t\t}\n\t\t\t\telse { // skip all spaces between entries \n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( nextChar == ',') {\n\t\t\t\tif (insideQuotes) //comma inside an entry \n\t\t\t\t\tnextWord.append(nextChar);\n\t\t\t\telse { //end of entry found \n\t\t\t\t\tinsideEntry = false; \n\t\t\t\t\tentries.add(nextWord.toString());\n\t\t\t\t\tnextWord = new StringBuffer();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//add all other characters to the nextWord \n\t\t\t\tnextWord.append(nextChar);\n\t\t\t\tinsideEntry = true; \n\t\t\t}\n\n\t\t}\n\t\t// add the last word (assuming not empty)\n\t\t// trim the white space before adding to the list\n\t\tif (!nextWord.toString().equals(\"\")) {\n\t\t\tentries.add(nextWord.toString().trim());\n\t\t}\n\n\t\treturn entries;\n\t}", "public static String[] convertStringToArray(String str){\n String[] arr = str.split(strSeparator);\n return arr;\n }", "public static ArrayList<String> topiclist(){\n ArrayList<String> temp = new ArrayList<String>();\n Scanner topicer;\n try {\n topicer = new Scanner(new File(\"Topics.txt\"));\n topicer.useDelimiter(\",~ *\\n*\");\n while (topicer.hasNext()){\n String[] key = topicer.next().split(\",\");\n //String value = \"\";\n if(topicer.hasNext())\n topicer.next();\n for (int i = 0; i < key.length; i++)\n \ttemp.add(key[i]);\n }\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n return temp;\n }", "private String[] splitListColumn(String column) {\n if (column.trim().equals(\"\")) {\n return EMPTY_STRING_ARRAY;\n } else {\n return column.split(INPUT_LIST_DELIM);\n }\n }", "public String[] split(String line, String delimit) {\r\n\t\tlog.debug(\"line = \" + line);\r\n\t\tString[] a = null;\r\n\t\tVector<String> lines = new Vector<String>();\r\n\t\tline = line.replaceAll(\"\\\\\\\\\" + delimit, \"\\\\e\");\r\n\t\ta = line.split(delimit);\r\n\t\tfor (int i = 0; i < a.length; i++) {\r\n\t\t\tString thisLine = a[i];\r\n\t\t\tlog.debug(\"thisLine[\" + i + \"] = \" + thisLine);\r\n\t\t\tif (quoteText && thisLine.startsWith(\"\\\"\")) {\r\n\t\t\t\twhile (!thisLine.endsWith(\"\\\"\") && i < a.length) {\r\n\t\t\t\t\tthisLine += \",\" + a[++i];\r\n\t\t\t\t}\r\n\t\t\t\tif (i == line.length()) {\r\n\t\t\t\t\tthrow new RuntimeException(\"unterminated string quote\");\r\n\t\t\t\t}\r\n\t\t\t\tthisLine = thisLine.substring(1, thisLine.length()-2);\r\n\t\t\t\tthisLine.replaceAll(\"\\\\e\", delimit);\r\n\t\t\t}\r\n\t\t\tlines.add(thisLine);\r\n\t\t}\r\n\t\ta = new String[1];\r\n\t\treturn lines.toArray(a);\r\n\t}", "public List<C0446fs> mo4736a(String str) {\n if (str == null) {\n throw new IllegalArgumentException(\"No name specified.\");\n }\n ArrayList arrayList = new ArrayList(this.f1125c.size());\n for (C0446fs next : this.f1125c) {\n if (str.equalsIgnoreCase(next.mo4735a())) {\n arrayList.add(next);\n }\n }\n return arrayList;\n }", "void LoesungAusgeben (String strA) { createOutput ()\n //\n // println(\"strA = \"+strA);\n //\n String[] list1 = { \n strA\n };\n list1=split(strA, ',');\n // now write the strings to a file, each on a separate line\n // saveStrings (\"c:\\\\soft\\\\SolProcess\\\\result\" + Date1() + \"_\" + Now1() + \".txt\", list1);\n // saveStrings (\"result\" + Date1() + \"_\" + Now1() + \".txt\", list1);\n saveStrings (\"result.txt\", list1);\n}", "public ArrayList<String> createStringArray() throws Exception {\n ArrayList<String> stringsFromFile = new ArrayList<>();\n while (reader.hasNext()) {\n stringsFromFile.add(reader.nextLine());\n }\n return stringsFromFile;\n }", "public static List<String> parseCSVFile(final String filePath) {\n\t\tLOG.info(\"Entred in to parseCSVFile()\");\n\t\tLOG.info(\"File path is : {}\", filePath);\n\n\t\tList<String> dataList = new ArrayList<>();\n\t\tCSVReader csvReader = null;\n\t\ttry {\n\t\t\tcsvReader = new CSVReader(new FileReader(filePath));\n\t\t\tString[] nextLine;\n\t\t\tint lineNumber = 0;\n\t\t\twhile ((nextLine = csvReader.readNext()) != null) {\n\t\t\t\tlineNumber++;\n\t\t\t\tif (lineNumber == 1)\n\t\t\t\t\tcontinue;\n\t\t\t\tString data = String.join(ReportingDataConstants.CSV_DATA_SPERATOR, nextLine);\n\t\t\t\tLOG.info(\"The data is {}\", data);\n\t\t\t\tdataList.add(data);\n\t\t\t}\n\t\t} catch (FileNotFoundException e) {\n\t\t\tthrow new RuntimeException(\"CSV File not found, please check the file paths\");\n\t\t} catch (IOException e) {\n\t\t\tthrow new RuntimeException(\"CSV File parse exception, please check the file format\");\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (csvReader != null)\n\t\t\t\t\tcsvReader.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\tLOG.error(\"Exception occured while closing reader: {}\", e.getLocalizedMessage());\n\t\t\t}\n\t\t}\n\n\t\tLOG.info(\"Exit from parseCSVFile()\");\n\t\treturn dataList;\n\t}", "List<CountryEntity> parseLines(List<String> line);", "public static ArrayList<String> splitQuery(String query){\r\n\t\tArrayList<String> queryArray = new ArrayList<String>(Arrays.asList(query.split(\"((?<=:)|(?=:))|( )\")));\r\n\t\tint startIndex = 0, endIndex = 0;\r\n\t\tfor (int i = 0; i < queryArray.size(); i++) {\r\n\t\t\tif(queryArray.get(i).toLowerCase().equals(\"is\")){\r\n\t\t\t\tstartIndex = i+1;\r\n\t\t\t}\r\n\t\t\telse if(queryArray.get(i).toLowerCase().equals(\"?\")){\r\n\t\t\t\tendIndex = i;\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t\tString[] array = queryArray.toArray(new String[queryArray.size()]);\r\n\t\treturn new ArrayList<String>(Arrays.asList(java.util.Arrays.copyOfRange(array, startIndex, endIndex)));\r\n\r\n\t}", "public static String[] splitString4(String haystack, String needle) {\n \n // return array of one empty string element if haystack is empty\n if (haystack.equals(\"\")){\n return new String[] {};\n }\n // for empty needle, just return array of single element = the whole haystack string - still valid\n if (needle.equals(\"\")){\n return new String[] { haystack };\n }\n \n // Do actual splitting using String.indexOf() method\n String newHaystack= haystack;\n int index = newHaystack.indexOf(needle);\n List<String> resultList = new ArrayList<String>();\n \n while (index != -1){ \n if(index > 0) {\n resultList.add(newHaystack.substring(0, index)); \n }\n newHaystack = newHaystack.substring(index + needle.length()); \n index = newHaystack.indexOf(needle); \n if(index == -1 && !newHaystack.equals(\"\")) {\n resultList.add(newHaystack); // add remaining string before exit loop\n }\n }\n \n // need to return an array not Array List\n String[] res = new String[resultList.size()];\n for(int j = 0; j < resultList.size(); j++) {\n res[j] = resultList.get(j);\n } \n return res; \n \n }", "private static @NotNull List<String> parse(@Nullable String s) {\n if (s == null) {\n return Collections.emptyList();\n }\n final Pattern COMPONENT_RE = Pattern.compile(\"\\\\d+|[a-z]+|\\\\.|-|.+\");\n final List<String> results = new ArrayList<>();\n final Matcher matcher = COMPONENT_RE.matcher(s);\n while (matcher.find()) {\n final String component = replace(matcher.group());\n if (component == null) {\n continue;\n }\n results.add(component);\n }\n for (int i = results.size() - 1; i > 0; i--) {\n if (\"00000000\".equals(results.get(i))) {\n results.remove(i);\n }\n else {\n break;\n }\n }\n results.add(\"*final\");\n return results;\n }", "private List<String> splitCommaSeparatedString(String defaults) {\r\n\t\tString[] split = defaults.split(\",\");\r\n\t\tList<String> keyList = new LinkedList<String>();\r\n\t\tfor (int i = 0; i < split.length; i++) {\r\n\t\t\tkeyList.add(split[i].trim());\r\n\t\t}\r\n\t\treturn keyList;\r\n\t}", "public String[] parseLine() throws IOException, FHIRException {\n\t\tList<String> res = new ArrayList<String>();\n\t\tStringBuilder b = new StringBuilder();\n\t\tboolean inQuote = false;\n\n\t\twhile (more() && !finished(inQuote, res.size())) {\n\t\t\tchar c = peek();\n\t\t\tnext();\n\t\t\tif (c == '\"' && doingQuotes) {\n\t\t\t\tif (ready() && peek() == '\"') {\n\t b.append(c);\n next();\n\t\t\t\t} else {\n\t\t\t inQuote = !inQuote;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (!inQuote && c == delimiter ) {\n\t\t\t\tres.add(b.toString().trim());\n\t\t\t\tb = new StringBuilder();\n\t\t\t}\n\t\t\telse \n\t\t\t\tb.append(c);\n\t\t}\n\t\tres.add(b.toString().trim());\n\t\twhile (ready() && (peek() == '\\r' || peek() == '\\n')) {\n\t\t\tnext();\n\t\t}\n\t\t\n\t\tString[] r = new String[] {};\n\t\tr = res.toArray(r);\n\t\treturn r;\n\t}", "private ArrayList<Integer> readIntString(String intString)\n {\n ArrayList<Integer> intList = new ArrayList<Integer>();\n Scanner intStringScanner = new Scanner(intString);\n intStringScanner.useDelimiter(\",\");\n while (intStringScanner.hasNextInt())\n {\n intList.add(new Integer(intStringScanner.nextInt()));\n }\n intStringScanner.close();\n return intList;\n }", "public static ArrayList<String> procesarEntrada(String input)\n {\n ArrayList<String> parse = new ArrayList<String>();\n String word = \"\";\n\n for (int i = 0; i < input.length(); i++)\n {\n if (input.charAt(i) != '&')\n word += input.charAt(i);\n\n if (input.charAt(i) == '&' || i == input.length() - 1)\n {\n parse.add(word);\n word = \"\";\n } \n }\n\n return parse;\n }", "private String[] parseArray(String val) {\n String[] arrayVals;\n val = val.trim();\n if (emptyVal(val)) {\n arrayVals = Constants.EMPTY_STRING_ARRAY;\n } else {\n arrayVals = val.split(\"\\\\s+\");\n }\n return arrayVals;\n }", "private static void addInitialValues(final List<String> result, final String text)\n {\n int pos = 0;\n int sep = SimProposal.nextSep(text, pos);\n while (sep >= 0)\n {\n result.add(text.substring(pos, sep).trim());\n pos = sep + 1;\n sep = SimProposal.nextSep(text, pos);\n }\n // Handle remaining \"xyz\" or \"xyz)\"\n if (pos < text.length())\n {\n final String rest = text.substring(pos);\n sep = rest.lastIndexOf(')');\n if (sep < 0)\n result.add(rest.trim());\n else\n result.add(rest.substring(0, sep).trim());\n }\n }", "public static HashMap<String, ArrayList<String>> parseKeyValueList(String keySpliter,String valueSpliter, String strToParse) {\r\n\t\treturn parseKeyValueList (keySpliter, valueSpliter, \"\\n\", strToParse);\r\n\t}", "public static String[] splitString1(String haystack, String needle) {\n if (haystack.equals(\"\") || needle.equals(\"\") // non empty strings are\n // not accepted\n || haystack.indexOf(needle) == -1) { // haystack must have at\n // least one needle\n throw new IllegalArgumentException();\n }\n\n // Do actual splitting using String.indexOf() method and do-while loop \n String newHaystack = haystack;\n int index = newHaystack.indexOf(needle);\n List<String> resultList = new ArrayList<String>();\n\n do {\n resultList.add(newHaystack.substring(0, index));\n newHaystack = newHaystack.substring(index + needle.length());\n index = newHaystack.indexOf(needle);\n\n } while (index != -1);\n\n resultList.add(newHaystack); // add remaining haystack \n\n // need to return an array not Array List\n String[] res = new String[resultList.size()];\n for (int j = 0; j < resultList.size(); j++) {\n res[j] = resultList.get(j);\n }\n return res;\n\n }", "private static HashMap<String, ArrayList<String>> parseKeyValueList(String keySpliter,String valueSpliter,String listSeperator, String strToParse) {\r\n\t\tHashMap<String, ArrayList<String>> key_ValuesList_Map = new HashMap<String, ArrayList<String>>();\r\n\t\tif (listSeperator== null)\r\n\t\t\tlistSeperator=\"\\n\"; // new line\r\n\t\t\t\r\n\t\tif (!strToParse.equals(\"\")) {\r\n\t\t\tString[] strs = strToParse.split(listSeperator);//default listSeperator=\"\\n\" is new line\r\n\r\n\t\t\tArrayList<String> local_values = null;\r\n\t\t\tString criteria = \"\";\r\n\t\t\tfor (String str_tmp : strs) { // str_tmp = enrollment:\r\n\t\t\t\t\t\t\t\t\t\t\t// uma_rob;uma_qa1;\r\n\t\t\t\tString[] strs_tmp = str_tmp.split(keySpliter);//keySpliter=\":\"\r\n\t\t\t\tcriteria = strs_tmp[0].trim();// enrollment or non-enrollment\r\n\t\t\t\tstrs_tmp[1]=strs_tmp[1].trim();\r\n\t\t\t\tif (key_ValuesList_Map.containsKey(criteria)) {\r\n\t\t\t\t\tlocal_values = key_ValuesList_Map.get(criteria);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tlocal_values = new ArrayList<String>();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif (Validate.isBlank(valueSpliter)){ // can also be blank, then pass null or \"\"\r\n\t\t\t\t\tlocal_values.add(strs_tmp[1]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tString[] values_tmp = strs_tmp[1].split(valueSpliter);//valueSpliter=\";\"\r\n\t\t\t\t\tfor (String value : values_tmp) {\r\n\t\t\t\t\t\tlocal_values.add(value.trim());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tkey_ValuesList_Map.put(criteria, local_values);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn key_ValuesList_Map;\r\n\t}", "public ArrayList<Cliente> convertirAClases(String ficheroEnTexto){\n Cliente[] clientess;\n ArrayList<Cliente> listcliente;\n clientess= new Gson().fromJson(ficheroEnTexto,Cliente[].class);\n listcliente = new ArrayList<>(Arrays.asList(clientess));\n\n return listcliente;\n\n }", "private ArrayList<String> readStringsFromFile(File f, String stringSeparator)\r\n\t\t\tthrows EasyCorrectionException {\r\n\t\tArrayList<String> contentOfFile = new ArrayList<String>();\r\n\t\tbyte[] buffer = new byte[(int) f.length()];\r\n\t\tBufferedInputStream stream = null;\r\n\t\ttry {\r\n\t\t\tstream = new BufferedInputStream(new FileInputStream(f));\r\n\t\t\tstream.read(buffer);\r\n\t\t} catch (IOException e) {\r\n\t\t\tthrow new EasyCorrectionException(\"The file \" + f.getName()\r\n\t\t\t\t\t+ \" could not be read during the Output Comparison!\");\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tif (stream != null) {\r\n\t\t\t\t\tstream.close();\r\n\t\t\t\t}\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tthrow new EasyCorrectionException(\"The file \" + f.getName()\r\n\t\t\t\t\t\t+ \" could not be closed during the Output Comparison!\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (String string : new String(buffer).split(stringSeparator)) {\r\n\t\t\tcontentOfFile.add(string);\r\n\t\t}\r\n\r\n\t\treturn contentOfFile;\r\n\t}", "private static final String[] encode(String src) {\n \n if (src == null || src.length()==0) {\n return (new String[0]);\n }\n \n return StringUtils.split(src, \";\");\n }", "public static ArrayList<String> CSVtoArrayList(String CSVFileName) {\n \n //TO DO: ensure this arraylist can handle integers, not only strings\n ArrayList<String> arrlist = new ArrayList<String>();\n \n \n if (CSVFileName != null) {\n String[] splitData = CSVFileName.split(\"\\\\,\", -1); //the -1 helps handle the null values\n \n for (int i = 0; i < splitData.length; i++) {\n //if it is null, replace it with a 0\n if (splitData[i].length() == 0) {\n splitData[i] = \"0\";\n }\n //as long as it is not null and the length is not 0, trim the value and add it to the arraylist\n if (!(splitData[i] == null) || !(splitData[i].length() == 0)) {\n arrlist.add(splitData[i].trim());\n }\n }\n }\n return arrlist;\n }", "private ArrayList<Person> parsePersons(int i) {\n\t\trestart();\n\t\tString nxtLine;\n\t\tint nbrOfP; \n\t\tArrayList<Person> persons = new ArrayList<Person>();\n\t\twhile(s.hasNextLine()) {\n\t\t\tnxtLine = s.nextLine();\n\t\t\tif(nxtLine.contains(\"=\")){\n//\t\t\t\tSystem.out.println(\"found it\");\n\t\t\t\tnbrOfP = Integer.parseInt(nxtLine.substring(2));\n//\t\t\t\tSystem.out.println(\"\"+nbrOfP);\n\t\t\t\tif(i==0)\n\t\t\t\t\tpersons = createMenList(nbrOfP);\n\t\t\t\telse\n\t\t\t\t\tpersons = createWomenList(nbrOfP);\n\t\t\t}\n\t\t}\n\t\treturn persons;\n\t}" ]
[ "0.71001416", "0.66897255", "0.6677861", "0.6380534", "0.63663286", "0.6265648", "0.6166175", "0.60785013", "0.6053837", "0.59970635", "0.59922427", "0.5975938", "0.5923706", "0.5883734", "0.5798173", "0.57930475", "0.5790704", "0.57874817", "0.57018626", "0.56916463", "0.5682561", "0.5661535", "0.5629763", "0.561222", "0.55898905", "0.5570832", "0.55511415", "0.55324614", "0.5531084", "0.54953504", "0.54949117", "0.54929185", "0.5490479", "0.54897463", "0.5482496", "0.54766643", "0.5457497", "0.5456389", "0.54270905", "0.54242146", "0.5409598", "0.53850967", "0.53797394", "0.53731906", "0.536719", "0.5341538", "0.5340969", "0.5338055", "0.53290886", "0.532266", "0.53185785", "0.5318073", "0.5315437", "0.5295416", "0.52712816", "0.52669674", "0.5252597", "0.5242586", "0.5234348", "0.5234073", "0.5229541", "0.522624", "0.5220565", "0.5215983", "0.52130824", "0.5210224", "0.520695", "0.5201869", "0.5194414", "0.5182665", "0.5179413", "0.5174115", "0.51717085", "0.51650435", "0.51646787", "0.5159406", "0.5155766", "0.5154293", "0.5151041", "0.51356333", "0.5135344", "0.5132867", "0.51303613", "0.51286685", "0.5126352", "0.51261276", "0.5122506", "0.5118141", "0.51154554", "0.51152205", "0.5114697", "0.5103056", "0.50991136", "0.5096722", "0.50952715", "0.50814396", "0.50802207", "0.507982", "0.5079594", "0.50750697", "0.50748307" ]
0.0
-1
Constructs a heap file backed by the specified file.
public HeapFile(File f, TupleDesc td) { this.file = f; this.tableId = f.getAbsoluteFile().hashCode(); this.td = td; int pageSize = BufferPool.PAGE_SIZE; int pagesNeeded; RandomAccessFile rf; try { rf = new RandomAccessFile(f, "r"); pagesNeeded = (int) Math.ceil((double) rf.length() / pageSize); } catch (Exception e) { System.err.println("Caugth exception1:" + e.getMessage()); return; } this.numPages = pagesNeeded; System.out.println("Created " + pagesNeeded + " heap files."); pages = new HeapPage[pagesNeeded]; // TODO Find out the best way to handle exceptions for (int pageIndex = 0; pageIndex < pagesNeeded; ++pageIndex) { int offset = pageIndex * pageSize; byte[] data = new byte[pageSize]; try { rf.readFully(data, offset, pageSize); HeapPageId pid = new HeapPageId(tableId, pageIndex); System.out.println("Created HeapPageId"); pages[pageIndex] = new HeapPage(pid, data); System.out.println("Wrote to pages["+pageIndex+"]."); } catch (Exception e) { System.err.println("Caught exception2:" + e.getMessage()); return; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public HeapFile(File f, TupleDesc td) {\n this.tupleDesc = td;\n this.file = f;\n this.fid = file.getAbsoluteFile().hashCode();\n this.numOfPages = (int)Math.ceil((double)f.length()/(double)BufferPool.PAGE_SIZE);\n if(f.length()==0) \n//\t\t\ttry {\n//\t\t\t\twritePage(new HeapPage(new HeapPageId(fid, 0), new byte[BufferPool.PAGE_SIZE]));\n//\t\t\t} catch (IOException e) {\n//\t\t\t\t// TODO Auto-generated catch block\n//\t\t\t\te.printStackTrace();\n//\t\t\t}\n\t\t\tthis.numOfPages = 0;\n// }\n }", "public HeapFile(File f, TupleDesc td) {\n // some code goes here\n this.f = f;\n this.td = td;\n }", "public HeapFile(File f, TupleDesc td) {\n // some code goes here\n \tm_f = f;\n \tm_td = td;\n }", "public File createBuffer(File file)\n {\n String bufferName = \"#\" + file.getName();\n File buffer = new File(this.getHome() + bufferName);\n\n this.buffer2file.put(buffer, file);\n\n return buffer;\n }", "Object create(File file) throws IOException, SAXException, ParserConfigurationException;", "public Memory(String file) {\n\t\tfor(int i=0; i < Constants.MEM_SIZE; ++i){\n\t\t\tmemory[i] = 0;\n\t\t}\n\t\tinstructions = new FileProcessor(file).fetchInstructions();\n\t}", "@Override\n public StorageOutputStream create(File file) throws IOException {\n\treturn null;\n }", "public FileOnDisk(File file) throws StyxException\n {\n this(file.getName(), file);\n }", "void readHeap(String path){\n try\r\n {\r\n String line = \"\";\r\n String splitBy = \",\";\r\n BufferedReader br = new BufferedReader(new FileReader(path));\r\n while ((line = br.readLine()) != null) //returns a Boolean value\r\n {\r\n line = removeUnwantedChars(line);\r\n String[] temp = line.split(splitBy); // use comma as separator\r\n heapObject myObject = new heapObject(Integer.parseInt(temp[0]), Integer.parseInt(temp[1]), Integer.parseInt(temp[2]));\r\n IDs.add(myObject);\r\n heap.put(myObject.id,myObject);\r\n }\r\n }\r\n catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }", "public FileOnDisk(String name, File file) throws StyxException\n {\n this(name, file, 0666, true);\n }", "public static PicoFile create(File file) throws IOException {\n if (file == null) {\n throw new NullPointerException(\"The file is null.\");\n }\n return create(file, KeyUtils.makeKey());\n }", "public static PicoFile create(File file, byte[] key) throws IOException {\n if (file == null) {\n throw new NullPointerException(\"The file is null.\");\n }\n if (key == null) {\n throw new NullPointerException(\"The key is null.\");\n }\n if (key.length == 0) {\n throw new IllegalArgumentException(\"Encryption key is empty.\");\n }\n\n return new PicoFile(new RandomAccessFile(file, \"rw\"), key);\n }", "public static void readFile(File f){\n\t\tFileInputStream fis = null;\n\t\tObjectInputStream ois = null;\n\t\ttry{\n\t\t\tPage page = null;\n\t\t\tfis = new FileInputStream(f);\n\t\t\tois = new ObjectInputStream(fis);\n\t\t\twhile(true){\n\t\t\t\ttry{\n\t\t\t\t\tObject obj = ois.readObject();\n\t\t\t\t\tpage = (Page)obj;\n\t\t\t\t\theap.add(page);\n\t\t\t\t\t//System.out.println(page.getBuildings());\n\t\t\t\t\tsearch();\n\t\t\t\t\theap.remove(page);\n\t\t\t\t}\n\t\t\t\tcatch(EOFException eoe){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(FileNotFoundException fnf){\n\t\t\tSystem.out.println(fnf.getMessage());\n\t\t\tSystem.out.println(\"Terminating Program\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t\tcatch(ClassNotFoundException cnf){\n\t\t\tcnf.printStackTrace();\n\t\t}\n\t\tcatch(IOException e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\tfinally{\n\t\t\ttry{\n\t\t\t\tfis.close();\n\t\t\t\tois.close();\n\t\t\t}\n\t\t\tcatch(Exception ee){\n\t\t\t}\n\t\t}\n\t}", "public LogFileV2(File file) {\n try {\n if(!file.getParentFile().exists()){\n file.getParentFile().mkdirs();\n }\n this.file = file;\n this.randomAccessFile = new RandomAccessFile(file,\"rw\");\n this.fileChannel = randomAccessFile.getChannel();\n this.readMap = fileChannel.map(FileChannel.MapMode.READ_WRITE,0, CommitLogV2.FILE_SIZE);\n this.writeMap = fileChannel.map(FileChannel.MapMode.READ_WRITE,0, CommitLogV2.FILE_SIZE);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public Heap() {\r\n\t\tthis(DEFAULT_INITIAL_CAPACITY, null);\r\n\t}", "public ParcelFileDescriptor open(File file) {\n return ParcelFileDescriptor.open(file, 268435456);\n }", "@SuppressWarnings(\"unchecked\")\n public dHeap(int heapSize) {\n // Calls third constructor to initialize a binary max-dHeap with specified capacity\n this(BINARY, heapSize, true);\n }", "public TarFile(File file) {\n this.file = file;\n }", "public GCFile(final File file, final int count) {\n\t\tthis.file = file;\n\t\tthis.count = count;\n\t}", "public void generateDotFile(String filename) {\n\t\ttry {\n\t\t\tPrintWriter out = new PrintWriter(filename);\n\t\t\tout.println(\"digraph Heap {\\n\\tnode [shape=record]\\n\");\n\n\t\t\tfor (int i = 0; i < currentSize; i++) {\n\t\t\t\tout.println(\"\\tnode\" + i + \" [label = \\\"<f0> |<f1> \" + array[i] + \"|<f2> \\\"]\");\n\t\t\t\tif (((i * 2) + 1) < currentSize)\n\t\t\t\t\tout.println(\"\\tnode\" + i + \":f0 -> node\" + ((i * 2) + 1) + \":f1\");\n\t\t\t\tif (((i * 2) + 2) < currentSize)\n\t\t\t\t\tout.println(\"\\tnode\" + i + \":f2 -> node\" + ((i * 2) + 2) + \":f1\");\n\t\t\t}\n\n\t\t\tout.println(\"}\");\n\t\t\tout.close();\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\tSystem.out.println(e);\n\t\t}\n\t}", "public static PicoFile create(String filename) throws IOException {\n if (filename == null) {\n throw new NullPointerException(\"The filename is null.\");\n }\n return create(filename, KeyUtils.makeKey());\n }", "public FileOnDisk(String filepath) throws StyxException\n {\n this(new File(filepath));\n }", "public Printer(File file) {\n this.file = file;\n log = LogManager.getLogManager().getLogger(Printer.class.getName());\n // initialization of the template path\n base = System.getProperty(\"user.dir\") + File.separator + \"config\"\n + File.separator + \"template\" + File.separator;\n\n // </snip>\n\n // System.out.println(\"template printing\");\n\n start();\n }", "public MaxHeap() {\n this(64);\n }", "FileReference createFile(String fileName, String toolId);", "public SegmentFile(File file)\n\t\t\tthrows NullPointerException {\n\t\t\n\t\tthis(file, false);\n\t}", "public static PicoFile create(String filename, byte[] key) throws IOException {\n if (filename == null) {\n throw new NullPointerException(\"The filename is null.\");\n }\n if (key == null) {\n throw new NullPointerException(\"The key is null.\");\n }\n if (key.length == 0) {\n throw new IllegalArgumentException(\"Encryption key is empty.\");\n }\n return new PicoFile(new RandomAccessFile(filename, \"rw\"), key);\n }", "public FilePersistence(String file) {\n this.file = file;\n }", "public OnDemandInputStream(File file) {\n super();\n\n this.file = file;\n }", "protected void createFile (ZipFile file, ZipEntry entry, File target)\n {\n if (_buffer == null) {\n _buffer = new byte[COPY_BUFFER_SIZE];\n }\n\n // make sure the file's parent directory exists\n File pdir = target.getParentFile();\n if (!pdir.exists() && !pdir.mkdirs()) {\n log.warning(\"Failed to create parent for '\" + target + \"'.\");\n }\n\n try (InputStream in = file.getInputStream(entry);\n FileOutputStream fout = new FileOutputStream(target)) {\n\n int total = 0, read;\n while ((read = in.read(_buffer)) != -1) {\n total += read;\n fout.write(_buffer, 0, read);\n updateProgress(total);\n }\n\n } catch (IOException ioe) {\n log.warning(\"Error creating '\" + target + \"': \" + ioe);\n }\n }", "protected PicoFile(RandomAccessFile backing, byte[] key) throws IOException {\n assert backing != null : \"Backing is null.\";\n assert key != null : \"Key is null.\";\n assert key.length > 0 : \"Key is missing.\";\n _backing = backing;\n _open = true;\n _resetDigest();\n // We are creating a new file, so truncate any existing file and\n // generate a new header.\n _backing.setLength(0L);\n _head = new PicoHeader();\n _head.setKey(key);\n\n // Now the Header size is fixed since we have the key and know the size\n // of the hash\n // we will write later.\n\n // This actually positions us to _head.offset + 0\n position(0L);\n }", "public static void main(String args[]) throws IOException {\n\n\t\t/*\n\t\t * The file input and page size are taken as input\n\t\t */\n\t\tString filename = \"\";\n\t\tint page_size = 0;\n\t\tif (args.length == 2) {\n\t\t\tpage_size = Integer.parseInt(args[0]);\n\t\t\tfilename = args[1];\n\n\t\t} else {\n\t\t\t// If no file is given, the program breaks\n\t\t\tSystem.out.println(\"NO FILE\");\n\t\t\treturn;\n\t\t}\n\n\t\tString filepath = filename;\n\n\t\t// to keep track of bytes used for a single page\n\t\tint bytes_used = 0;\n\n\t\t// to keep track of size of each record\n\t\tint record_size = 0;\n\n\t\t// page number starts with 0\n\t\tint page_no = 0;\n\t\tint offset = 0;\n\n\t\t// file name is initiated\n\t\tString heapfile = String.format(\"heapfile.%s\", page_size);\n\n\t\t// this array keeps all the record read is used to keep records in code until\n\t\t// the page is filled\n\t\tbyte[] ped_records = new byte[page_size];\n\n\t\tboolean first_line = true;\n\n\t\t// variable to keep track of objects used of a class\n\t\tint record_read = 0;\n\n\t\t// variables to keep track of time\n\t\tlong total_records = 0;\n\t\tlong endTime = 0;\n\t\tlong startTime = 0;\n\t\t/*\n\t\t * a class object is initiated with size of maximum page size as no records\n\t\t * exceeding page size can be written into a page\n\t\t */\n\t\tRecord_Details[] record = new Record_Details[page_size];\n\n\t\t/*\n\t\t * vufferReader to open the filepath and read each row\n\t\t */\n\t\tBufferedReader csvReader = new BufferedReader(new FileReader(filepath));\n\t\tString row;\n\t\tString[] data = null;\n\n\t\t// time is noted before start of execution of heap\n\t\tstartTime = System.currentTimeMillis();\n\n\t\t// iterates until all records are read\n\t\twhile ((row = csvReader.readLine()) != null) {\n\n\t\t\t// first line (header) is omitted while reading the file\n\t\t\tif (first_line == false) {\n\n\t\t\t\tdata = row.split(\",\");\n\n\t\t\t\t/*\n\t\t\t\t * since the field hourly_Counts has integer values with ',' separated, the\n\t\t\t\t * field is broken into two fields as we use ',' as delimiter\n\t\t\t\t * \n\t\t\t\t * Hence, this code checks if Hourly_counts is been split into two and joins the\n\t\t\t\t * combined field into one single variable\n\t\t\t\t */\n\t\t\t\tif (data.length == 11) {\n\t\t\t\t\tString temp = data[9];\n\n\t\t\t\t\ttemp = temp + data[10];\n\t\t\t\t\ttemp = temp.replace(\"\\\"\", \"\");\n\t\t\t\t\tdata[9] = temp;\n\t\t\t\t}\n\n\t\t\t\t/*\n\t\t\t\t * each input data are initialized accordingly using a class (more explanation\n\t\t\t\t * in Record_Details.java)\n\t\t\t\t */\n\t\t\t\trecord[record_read] = new Record_Details();\n\t\t\t\trecord[record_read].setID(data[0]);\n\t\t\t\trecord[record_read].setDate_Time(data[1]);\n\t\t\t\trecord[record_read].setYear(data[2]);\n\t\t\t\trecord[record_read].setMonth(data[3]);\n\t\t\t\trecord[record_read].setMdate(data[4]);\n\t\t\t\trecord[record_read].setDay(data[5]);\n\t\t\t\trecord[record_read].setTime(data[6]);\n\t\t\t\trecord[record_read].setSensor_ID(data[7]);\n\t\t\t\trecord[record_read].setSensor_Name(data[8]);\n\t\t\t\trecord[record_read].setHourly_Counts(data[9]);\n\t\t\t\trecord[record_read].setSTD_NAME(data[7], data[1]);\n\n\t\t\t\t// total size of this record is calculated\n\t\t\t\trecord_size = record[record_read].get_total_bytes();\n\n\t\t\t\t/*\n\t\t\t\t * combining the record size calculated above and the total bytes already read\n\t\t\t\t * exceeds the page size, the array is written into a file before adding the\n\t\t\t\t * newly read record into the array\n\t\t\t\t */\n\t\t\t\tif (bytes_used + record_size > page_size) {\n\n\t\t\t\t\t/*\n\t\t\t\t\t * page offsets are calculated accordingly in-order to write into a disk\n\t\t\t\t\t */\n\t\t\t\t\tpage_no += 1;\n\t\t\t\t\toffset = page_no * page_size;\n\t\t\t\t\tRandomAccessFile raf = null;\n\t\t\t\t\ttry {\n\t\t\t\t\t\traf = new RandomAccessFile(heapfile, \"rw\");\n\t\t\t\t\t\traf.seek((long) offset);\n\t\t\t\t\t\traf.write(ped_records, 0, ped_records.length - 1);\n\n\t\t\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t} finally {\n\t\t\t\t\t\traf.close();\n\t\t\t\t\t}\n\t\t\t\t\t/*\n\t\t\t\t\t * The number of total records read is added each time an array is written into\n\t\t\t\t\t * a file\n\t\t\t\t\t * \n\t\t\t\t\t * Here, total bytes used and total record read are initialized to 0 as it make\n\t\t\t\t\t * it easier to read in the next set of records until it reaches maximum page\n\t\t\t\t\t * size\n\t\t\t\t\t * \n\t\t\t\t\t * since all the records stored in the array ped_records are written into disk,\n\t\t\t\t\t * it is initialized to a new set of records to continue reading\n\t\t\t\t\t */\n\t\t\t\t\ttotal_records += record_read;\n\t\t\t\t\tbytes_used = 0;\n\t\t\t\t\trecord_read = 0;\n\t\t\t\t\tped_records = new byte[page_size];\n\t\t\t\t}\n\t\t\t\t/*\n\t\t\t\t * If there is more space left in the page, i.e., as mentioned above if there is\n\t\t\t\t * space to accommodate more records in the page, the records are added into\n\t\t\t\t * ped_records that is stored locally in the code, which is written out once the\n\t\t\t\t * page is full\n\t\t\t\t */\n\t\t\t\tbytes_used += record_size;\n\n\t\t\t\t/*\n\t\t\t\t * The above read record is combined with the array lost containing all the\n\t\t\t\t * records\n\t\t\t\t */\n\t\t\t\tbyte[] this_rec = new Record_Details().get_byte_data(record[record_read], page_size);\n\t\t\t\tbyte[] one = this_rec;\n\t\t\t\tbyte[] two = ped_records;\n\t\t\t\tbyte[] combined = new byte[one.length + two.length];\n\t\t\t\tSystem.arraycopy(one, 0, combined, 0, one.length);\n\t\t\t\tSystem.arraycopy(two, 0, combined, one.length, two.length);\n\t\t\t\tped_records = combined;\n\n\t\t\t\trecord_read += 1;\n\t\t\t}\n\t\t\t// used to skip the first line of CSV\n\t\t\tfirst_line = false;\n\t\t}\n\t\t// time taken for all this to execute in noted\n\t\tendTime = System.currentTimeMillis();\n\t\tcsvReader.close();\n\n\t\t// desired output are printed onto console\n\t\tSystem.out.println(\"Total Records loaded \" + total_records);\n\t\tSystem.out.println(\"Total Pages used \" + page_no);\n\t\tSystem.out.println(\"That took \" + (endTime - startTime) + \" milliseconds to ceate heapfile\");\n\n\t}", "GenericHeap() { // default\r\n\r\n\t}", "public FileTableEntry open(String filename, String mode)\n\t{\n\t\tFileTableEntry ftEnt = filetable.falloc(filename, mode);\n\n\t\t//checking mode for writing\n\t\tif (ftEnt != null) {\n\t\t\tif (mode.equals(\"w\")) {\n\t\t\t\tif(!deallocAllBlocks(ftEnt)) {\n\t\t\t\t\tftEnt = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (mode.equals(\"a\")) {\n\t\t\t\tftEnt.seekPtr = ftEnt.inode.length;\n\t\t\t}\n\t\t}\n\t\treturn ftEnt;\n\t}", "public VPTree(LargeBinaryFile file, Progress progress) throws IOException {\n\t\tsuper(file);\n\t\t\n\t\tthis.optimise = true;\n\t\tthis.progress = progress;\n\t}", "public abstract T create(T file, boolean doPersist) throws IOException;", "public HeapImp() {\n\t\tthis(10000);\n\t}", "public synchronized FileTableEntry fAlloc( String filename, String mode )\n {\n short iNumber;\n Inode iNode;\n\n while (true)\n {\n iNumber = (filename.equals(\"/\") ? (short) 0 : directory.namei(filename));\n\n if (iNumber >= 0)\n {\n iNode = new Inode(iNumber);\n if (mode.equals(\"r\"))\n {\n if (iNode.usedFlag == 0 || iNode.usedFlag == 1 || iNode.usedFlag == 2)\n {\n iNode.usedFlag = 2;\n break;\n }\n else if (iNode.usedFlag == 3)\n {\n try\n {\n wait();\n }\n catch (InterruptedException e)\n {\n SysLib.cerr(\"Read Error\");\n }\n }\n }\n else\n {\n if (iNode.usedFlag == 1 || iNode.usedFlag == 0)\n {\n iNode.usedFlag = 3;\n break;\n }\n else\n {\n try\n {\n wait();\n }\n catch (InterruptedException e)\n {\n SysLib.cerr(\"Write Error\");\n }\n }\n }\n }\n else if (!mode.equals(\"r\"))\n {\n iNumber = directory.iAlloc(filename);\n iNode = new Inode(iNumber);\n iNode.usedFlag = 3;\n break;\n }\n else\n {\n return null;\n }\n }\n iNode.count++;\n iNode.toDisk(iNumber);\n FileTableEntry entry = new FileTableEntry(iNode, iNumber, mode);\n table.addElement(entry);\n return entry;\n }", "public BufferedFile(File file, String mode, int bufferSize) throws IOException {\n this.randomAccessFile = new RandomAccessFile(file, mode);\n this.bufferPointer.init(bufferSize);\n this.fileOffset = 0;\n\n }", "public Page readPage(PageId pid){\n // some code goes here\n try{\n\n RandomAccessFile rAf=new RandomAccessFile(f,\"r\");\n int offset = pid.pageNumber()*BufferPool.PAGE_SIZE;\n byte[] b=new byte[BufferPool.PAGE_SIZE];\n rAf.seek(offset);\n rAf.read(b, 0, BufferPool.PAGE_SIZE);\n HeapPageId hpid=(HeapPageId)pid;\n rAf.close(); \n\n return new HeapPage(hpid, b); \n }catch (IOException e){\n e.printStackTrace();\n }\n throw new IllegalArgumentException();\n }", "public BinHeap()\n {\n // allocate heap to hold 100 items\n arr = (T[]) new Comparable[100];\n // set size of heap to 0\n size = 0;\n }", "public HeapCacheBuilder() {\n this.name = \"imcache-heap-cache-\" + cacheNumber.incrementAndGet();\n }", "public synchronized FileTableEntry falloc(String fileName, String mode) {\n Inode myNode = null;\n short blockID;\n while(true) \n {\n if(fileName.equals(\"/\")) {\n blockID = 0;\n } else {\n blockID = dir.namei(fileName); \n }\n\n if(blockID >= 0) { //Not superblock\n myNode = new Inode(blockID);\n break;\n }\n\n if(mode.compareTo(\"r\") == 0) {\n return null;\n }\n blockID = dir.ialloc(fileName);\n myNode = new Inode();\n break;\n }\n\n myNode.count++;\n myNode.toDisk(blockID);\n FileTableEntry toAdd = new FileTableEntry(myNode, blockID, mode);\n table.addElement(toAdd);\n return toAdd;\n }", "public static void makeHeap(char[] heap, int size, CharComparator c) {\n/* 124 */ int i = size >>> 1;\n/* 125 */ while (i-- != 0)\n/* 126 */ downHeap(heap, size, i, c); \n/* */ }", "public Page readPage(PageId pid) {\n // some code goes here\n int offset = pid.pageNumber() * BufferPool.PAGE_SIZE;\n byte[] pageData = new byte[BufferPool.PAGE_SIZE];\n Page page = null;\n try {\n RandomAccessFile accessor = new RandomAccessFile(f, \"r\");\n accessor.seek(offset);\n accessor.read(pageData, 0, BufferPool.PAGE_SIZE);\n page = new HeapPage((HeapPageId) pid, pageData);\n accessor.close();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return page;\n }", "@SuppressWarnings(\"unused\")\r\n\tprivate static File createFile(String path) {\r\n\t\t\r\n\t\t// open the file\r\n\t\tFile currentFile = new File(path);\r\n\t\t\r\n\t\t\r\n\t\t// check if it is a valid file\r\n\t\tif (currentFile == null) {\r\n\t\t\tSystem.out.println(\"Could not create the file\");\r\n\t\t\tthrow new NullPointerException();\r\n\t\t}\r\n\r\n\t\t// hopefully things went perfect\r\n\t\treturn currentFile;\r\n\r\n\t}", "public TreeItem(String file) throws DataFormatException, FileNotFoundException, IOException {\n\t\tsuper(file);\n\t}", "public static PicoFile open(File file) throws PicoException, IOException {\n if (file == null) {\n throw new NullPointerException(\"The file is null.\");\n }\n return new PicoFile(new RandomAccessFile(file, \"rw\"));\n }", "public ArrayHeap() {\r\n capacity = 10;\r\n length = 0;\r\n heap = makeArrayOfT(capacity);\r\n }", "public void writePage(Page page) throws IOException {\n \tHeapPage heapPage = (HeapPage)page;\n \tbyte[] byteArray = heapPage.getPageData();\n \t\n \tint pageNumber = heapPage.getId().pageno();\n \tint offSet = (pageNumber)*BufferPool.PAGE_SIZE;\n \t\n \tRandomAccessFile oStream = null;\n \t\n \toStream = new RandomAccessFile(file,\"rw\");\n \toStream.skipBytes(offSet);\n \toStream.write(byteArray);\n }", "public static DBMaker openFile(String file){\n DBMaker m = new DBMaker();\n m.location = file;\n return m;\n }", "public BufferedFile(File file, String mode) throws IOException {\n this(file, mode, BufferedFile.DEFAULT_BUFFER_SIZE);\n }", "public void writePage(Page page) throws IOException {\n // some code goes here\n // not necessary for proj1\n try {\n PageId pid = page.getId();\n HeapPageId hpid = (HeapPageId) pid;\n\n RandomAccessFile accessor = new RandomAccessFile(f, \"rw\");\n int offset = pid.pageNumber() * BufferPool.PAGE_SIZE;\n byte[] data = new byte[BufferPool.PAGE_SIZE];\n data = page.getPageData();\n\n accessor.seek(offset);\n accessor.write(data, 0, BufferPool.PAGE_SIZE);\n accessor.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public Storage(String filePath) {\n File file = new File(filePath);\n this.file = file;\n }", "private Heap() { }", "private Heap() { }", "public static ExecutableReader create(File file) throws Exception {\n\t\tFileInputStream fis = new FileInputStream(file);\n\t\tExecutableReader reader = create(new ExecutableStream(fis));\n\t\tfis.close();\n\t\treturn reader;\n\t}", "public PriorityQueue(int size){\n heap = new Element[size];\n }", "public Storage(String filePath) {\n file = new File(filePath);\n try {\n file.getParentFile().mkdir();\n file.createNewFile();\n } catch (IOException e) {\n System.err.println(\"Unable to create file\");\n }\n }", "public CustomerOrderDataBase(String file) {\r\n this.FILE_NAME = file;\r\n orderInfo = new ArrayList<>(4000000);\r\n console = new Scanner(System.in);\r\n try {\r\n loadFile();\r\n } catch (FileNotFoundException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n }", "public Heap(){\n super();\n }", "public TarHeader(File file, String ppath) {\r\n this.header = new byte[TarLibConstants.TAR_HEADER_SIZE];\r\n initlializeHeaderFields(file, ppath);\r\n writeToBuffer();\r\n }", "public PDFPageTree(PDFFile file)\n {\n _dict.put(\"Type\", \"/Pages\");\n }", "public InstrumentedFileOutputStream(File file) \r\n throws FileNotFoundException {\r\n super(file);\r\n }", "public RecoveryJournal(String path, String filename)\n throws IOException {\n this.gzipFile = new File(path, filename + GZIP_SUFFIX);\n this.out = initialize(gzipFile);\n }", "public Phile create( String name) throws PhileAlreadyExistsException, DiskFullException {\n\t\tif (fileList.containsKey(name)) {\n\t\t\tthrow new PhileAlreadyExistsException(\"File already exists\");\n\t\t}\n\t\telse if (totalNumberOfFiles == 32) {\n\t\t\tthrow new DiskFullException(\"Max number of files\");\n\t\t}\n\t\telse {\n\t\t\tPhile phile = new PhileImpl(name, this.tempDisk, currentStartingBlock, currentStartingBlock + 31);\n\t\t\tfileList.put(name, phile);\n\t\t\ttotalNumberOfFiles++;\n\t\t\topenFiles.add(phile);\n\t\t\tnumberOfOpenFiles++;\n\t\t\tcurrentStartingBlock += 32;\n\t\t\treturn phile;\n\t\t}\n }", "public static File createTestFile(File file, long length) throws IOException {\n FileOutputStream output = new FileOutputStream(file);\n for (long i = 0; i < length; i++) {\n output.write((int) i);\n }\n output.close();\n return file;\n }", "public InMemoryDictionary(File dictFile) {\n\t\t// TODO: Implement constructor\n\t}", "public DFSGraph(File file) throws FileNotFoundException {\r\n\t\tout = new PrintWriter(file);\r\n\t}", "public static PicoFile open(String filename) throws PicoException, IOException {\n if (filename == null) {\n throw new NullPointerException(\"The filename is null.\");\n }\n return new PicoFile(new RandomAccessFile(filename, \"rw\"));\n }", "public File() {\n }", "public BufferedFile(File file) throws IOException {\n this(file, \"r\", BufferedFile.DEFAULT_BUFFER_SIZE);\n }", "public BinaryHeap() {\n }", "public IconFile(String username, File file) {\n\t\tsuper(username, file, null);\n\t}", "public GridFSInputFile createFile(File f) throws IOException {\n\treturn createFile(new FileInputStream(f), f.getName(), true);\n }", "TarEntry CreateEntryFromFile(String fileName);", "public File createFile(final String path) {\n return new com.good.gd.file.File(path);\n }", "public File(String fileName) {\n\t\tthis(new java.io.File(fileName));\n\t}", "public void writePage(Page page) throws IOException {\n // some code goes here\n // not necessary for proj1\n try {\n PageId pid= page.getId();\n HeapPageId hpid= (HeapPageId)pid;\n\n RandomAccessFile rAf=new RandomAccessFile(f,\"rw\");\n int offset = pid.pageNumber()*BufferPool.PAGE_SIZE;\n byte[] b=new byte[BufferPool.PAGE_SIZE];\n b=page.getPageData();\n rAf.seek(offset);\n rAf.write(b, 0, BufferPool.PAGE_SIZE);\n rAf.close(); \n page.markDirty(false,null); \n }catch (IOException e){\n e.printStackTrace();\n }\n\n }", "public SegmentFile(File file, boolean autoDelete)\n\t\t\tthrows NullPointerException {\n\t\t\n\t\tif (file == null)\n\t\t\tthrow new NullPointerException(\"Cannot create segment file for file reference: null\");\n\t\t\n\t\tthis.file = file;\n\t\tthis.autoDelete = autoDelete;\n\t\t\n\t\treturn;\n\t}", "public Jtpl(File file) throws IOException {\n this(new FileReader(file));\n }", "public Page readPage(PageId pid) {\n // some code goes here\n \t\n \tHeapPage pg = null;\n \tbyte[] pageBytes = new byte[BufferPool.PAGE_SIZE];\n \t\n \ttry {\n\t \tRandomAccessFile raf = new RandomAccessFile(m_f, \"r\");\n\t \traf.seek(pid.pageNumber() * BufferPool.PAGE_SIZE);\n\t \traf.read(pageBytes, 0, BufferPool.PAGE_SIZE);\n\t \traf.close();\n\t \tpg = new HeapPage((HeapPageId) pid, pageBytes);\n \t} catch (IOException e){\n \t\te.printStackTrace();\n \t}\n \t\n \treturn pg;\n }", "public MovWriter(File file) throws IOException {\n\t\tdest = file;\n\t\tFileUtils.createNewFile(file);\n\t\tout = new MeasuredOutputStream(new FileOutputStream(file));\n\n\t\tAtom.write32Int(out, 1); // an extended size field\n\t\tAtom.write32String(out, \"mdat\");\n\n\t\t// the extended size field: an 8-byte long that will eventually\n\t\t// reflect the size of the data atom. We don't know this in the\n\t\t// first pass, so write 8 zeroes, and we'll fill this gap in\n\t\t// when .close() is called:\n\t\tAtom.write32Int(out, 0);\n\t\tAtom.write32Int(out, 0);\n\t}", "public HpccFile(String fileName, Connection espconninfo) throws HpccFileException\n {\n\t this(fileName, espconninfo, \"\", \"\", new RemapInfo(), 0, \"\");\n }", "public XMLHandler(File file) {\n this.file = file;\n }", "public Heap(int maxSize, int[] _dist, int[] _hPos) \r\n {\r\n N = 0;\r\n h = new int[maxSize + 1];\r\n dist = _dist;\r\n hPos = _hPos;\r\n }", "public static GenomeAdapter createGenome(File f) throws Throwable {\n return createGenome(TrackUtils.createTrack(f)[0]);\n }", "public static ExecutableReader createSpecific(File file) throws Exception {\n\t\t\n\t\tFileInputStream fis = new FileInputStream(file);\t\t\n\t\tExecutableReader reader = new ExecutableReader(fis);\n\t\tfis.close();\n\t\treturn reader;\n\t}", "public NodeHeap () {\n // Stupid Java doesn't allow init generic arrays\n heap = new Node[DEFAULT_SIZE];\n size = 0;\n }", "public void createFile(File file) {\n\t\tif (file.exists())\n\t\t\treturn;\n\t\ttry {\n\t\t\tfile.createNewFile();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public ScanOperator(File file){\r\n\t\tthis.file = file;\r\n\t\ttry{\r\n\t\t br = new RandomAccessFile(this.file, \"r\");\r\n\t\t}catch(FileNotFoundException e){\r\n\t\t\tSystem.out.println(\"File not found!\");\r\n\t\t}\r\n\t}", "public FileDatabase(String filename) throws IOException {\n\t\tdatabase = new File(filename);\n\t\tread();\n\t}", "public SecKeyRing(File file) throws IOException, PGPException {\r\n\r\n\t\tload(file);\r\n\t}", "public void init(final File backingFile) throws IOException {\n\t\t@SuppressWarnings(\"resource\" /* is closed when the backingChannel is closed */)\r\n\t\tRandomAccessFile raf = new RandomAccessFile(backingFile, \"rw\");\r\n\t\tthis.backingChannel = raf.getChannel();\r\n\t\tthis.mappedSize = this.backingChannel.size();\r\n\r\n\t\tthis.baseBuffer = this.backingChannel.map(FileChannel.MapMode.READ_WRITE, 0, this.mappedSize);\r\n\t}", "public HeapPriorityQueue () \n\t{\n\t\tthis(DEFAULT_SIZE);\n\t}", "public void newEntry(String file, User user) {\r\n TableEntry entry = new TableEntry();\r\n entry.fileName = file;\r\n entry.userName = user.getName();\r\n entry.date = DateUtils.getISO8601Date(System.currentTimeMillis());\r\n \r\n int sz = m_entries.size();\r\n if ( (MAX_SIZE > 0) && (sz >= MAX_SIZE) ) {\r\n clear();\r\n sz = 0;\r\n }\r\n \r\n synchronized(m_entries) {\r\n m_entries.add(entry);\r\n ++sz;\r\n }\r\n fireTableRowsInserted(sz, sz);\r\n }", "public FileRecentOpenAction(File _file) {\n super(_file.getAbsolutePath(), FileSystemView.getFileSystemView().getSystemIcon(_file));\n \n file = _file;\n \n putValue(SHORT_DESCRIPTION, \"Size: \" + _file.length() + \" Bytes.\");\n putValue(MNEMONIC_KEY, new Integer(KeyEvent.VK_L));\n }", "File a(File file) {\n if (file != null) {\n if (file.exists() || file.mkdirs()) {\n return file;\n }\n akx.h().d(\"Fabric\", \"Couldn't create file\");\n do {\n return null;\n break;\n } while (true);\n }\n akx.h().a(\"Fabric\", \"Null File\");\n return null;\n }", "private File createRefFile( File f )\n {\n \tfinal String refExtension = \".ref\";\n \n \tString origFileName = f.getName();\n \tint dotPos = origFileName.lastIndexOf( \".\" );\n \tString strippedFileName = origFileName.substring( 0, dotPos ); // filename without extension, and without the dot!\n \n \treturn FileHandler.getFile( new String( harvesterDirName + File.separator + strippedFileName + refExtension ) );\n }", "public FileLocation(File file) {\n this(file, -1, -1);\n }" ]
[ "0.73114914", "0.64279467", "0.63520277", "0.5750058", "0.56212986", "0.56124806", "0.5534635", "0.5520137", "0.551143", "0.5422604", "0.5368089", "0.5329247", "0.5242094", "0.52396184", "0.5219292", "0.5209714", "0.51496303", "0.51125616", "0.5087932", "0.5081666", "0.5076177", "0.50705045", "0.50422406", "0.50370526", "0.50262326", "0.5021521", "0.50126547", "0.5011917", "0.500713", "0.4997615", "0.4991447", "0.49868122", "0.49534467", "0.49495462", "0.49475214", "0.49457294", "0.49409828", "0.493112", "0.4918802", "0.4901256", "0.4900529", "0.48990646", "0.48918533", "0.48843434", "0.48825398", "0.48802683", "0.48795274", "0.48784962", "0.48778045", "0.48595873", "0.48572114", "0.48472124", "0.48361975", "0.4813779", "0.48090875", "0.48090875", "0.4805836", "0.48050466", "0.48014635", "0.47817677", "0.47800282", "0.4777387", "0.47748747", "0.47726923", "0.47664377", "0.4757762", "0.47554964", "0.47501627", "0.47406614", "0.47279635", "0.47238994", "0.47211266", "0.47177103", "0.4717475", "0.47091672", "0.46967018", "0.4682181", "0.46819383", "0.46784198", "0.4676772", "0.46760917", "0.46695796", "0.4669244", "0.46683627", "0.46646792", "0.46608993", "0.46570188", "0.46564534", "0.46461558", "0.46416235", "0.46395436", "0.4638048", "0.46265247", "0.46214387", "0.4620678", "0.46129325", "0.46118772", "0.46094108", "0.460462", "0.46012422" ]
0.7299282
1
Returns the File backing this HeapFile on disk.
public File getFile() { return file; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public File getFile() {\n return new File(this.filePath);\n }", "public File getFile() {\n return this.path != null ? this.path.toFile() : null;\n }", "public File getFile() {\n\t\treturn new File(filepath);\n\t}", "public File getFile() {\n // some code goes here\n return m_f;\n }", "public File getFile() {\n // some code goes here\n return this.f;\n }", "public File toFile() {\n\t\treturn this.file;\n\t}", "public File getFile() {\n\t\treturn file;\n\t}", "public File getFile() {\r\n \t\treturn file;\r\n \t}", "public File getFile() {\n\t\treturn this.file;\n\t}", "public File getFile() {\n // some code goes here\n return f;\n }", "public FileObject getFile() {\n return file;\n }", "public FileObject getFile() {\n return file;\n }", "public final File getFile() {\n return file;\n }", "public File getFile() {\n return _file;\n }", "public VMFile getFile() {\n return this.file;\n }", "public File getFile() {\n return file;\n }", "public File getFile() { return file; }", "@Override\n\tpublic File getFile() {\n\t\treturn file;\n\t}", "public byte[] getFile() {\n return file;\n }", "public RandomAccessFile getFile()\n {\n \treturn f;\n }", "public String getFile() {\n \n // return it\n return theFile;\n }", "private File getFile() {\n\t\t// retornamos el fichero a enviar\n\t\treturn this.file;\n\t}", "public File getFile();", "public File getFile();", "public Path getOpenedFile() {\r\n\t\treturn openedFile;\r\n\t}", "public File getFile() {\n return file;\n }", "public String getFile()\n\t{\n\t\treturn file;\n\t}", "public String getFile()\n\t{\n\t\treturn file;\n\t}", "public File getFile()\r\n \t{\r\n \t\tFile result = null;\r\n \t\t\r\n \t\tString hostName = getAuthority();\r\n \t\t\r\n \t\tif((hostName == null) || hostName.equals(\"\") || hostName.equalsIgnoreCase(\"localhost\"))\r\n \t\t{\r\n \t\t\tString filePath = getPath();\r\n \t\t\tresult = new File(filePath);\r\n \t\t}\r\n \t\telse\r\n \t\t{\r\n \t\t\tthrow new RuntimeException(\"Can't resolve files on remote host machines\");\r\n \t\t}\r\n \t\t\r\n \t\treturn result;\r\n \t}", "@VisibleForTesting\n public File getBlockFile() {\n return new File(getDir(), getBlockName());\n }", "@Transient\n\tpublic File getFileObj() {\n\t\treturn fileObj;\n\t}", "String getFile() {\n\t\treturn file;\n\t}", "public File getRessourceFile() {\r\n\t\treturn local;\r\n\t}", "public File getFile()\n {\n return file;\n }", "public File getFile ();", "public com.google.protobuf.ByteString getFile() {\n return file_;\n }", "public com.google.protobuf.ByteString getFile() {\n return file_;\n }", "public File getCacheFile() {\n return AQUtility.getCacheFile(this.cacheDir, getCacheUrl());\n }", "public File getFileValue();", "public File toJavaFile() {\n return filesystem().toJavaFile(path);\n }", "public final ZipFile getFile()\n\t{\n\t\treturn file_;\n\t}", "public java.lang.String getObjectFile() {\n java.lang.Object ref = objectFile_;\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 objectFile_ = s;\n return s;\n }\n }", "private File getIOFile() {\n \t\tIPath location = resource.getLocation();\n \t\tif(location!=null) {\n \t\t\treturn location.toFile();\n \t\t}\n \t\treturn null;\n \t}", "File getFilePath()\r\n\t{\r\n\t\treturn fFilePath;\r\n\t}", "alluxio.proto.journal.File.InodeFileEntry getInodeFile();", "public java.lang.String getObjectFile() {\n java.lang.Object ref = objectFile_;\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 objectFile_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public File getCacheFile() {\n return new File(cacheDir.getAbsolutePath() + File.separator + this.cacheFile);\n }", "FileObject getFile();", "FileObject getFile();", "public final File getLocalFile() throws IllegalArgumentException\n {\n if (hostOrNull != null)\n {\n throw new IllegalArgumentException(\"getLocalFile can only be called on local paths.\");\n }\n return new File(path);\n }", "public String file() {\n return this.file;\n }", "public File getFile() {\n\t\treturn outputFile;\n\t}", "public UploadedFileDTO getFile() {\r\n\t\ttype(ConfigurationItemType.FILE);\r\n\t\treturn fileValue;\r\n\t}", "File getFile();", "File getFile();", "public File getPrimaryFile() {\n return primaryFile;\n }", "File getFile() { return user_file; }", "@objid (\"5a81312d-b468-431f-a3e3-d729280a79c4\")\r\n public File getCurrentFile() {\r\n String nomFichier = this.text.getText();\r\n if ((nomFichier != null) && (nomFichier.length() != 0)) {\r\n this.currentFile = new File(nomFichier);\r\n } else {\r\n this.currentFile = null;\r\n }\r\n return this.currentFile;\r\n }", "public File getFileForPicture() {\r\n\t\tif(!isReady) prepare();\r\n\t\tif(!isReady) {\r\n\t\t\tLog.e(TAG,\"Not ready when taking picture\");\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tcurrentFile = new File(directory,getFileName());\r\n\t\treturn currentFile;\r\n\t}", "public String getFile() {\n return \"null\"; // getFileTopic().getCompositeValue().getTopic(FILE_PATH);\n }", "@Override\n public int getFile() {\n return file;\n }", "public MyFile getMyFile() {\r\n\t\tMyFile msg = new MyFile(path);\r\n\t\tString LocalfilePath = path;\r\n\r\n\t\ttry {\r\n\t\t\tFile newFile = new File(LocalfilePath);\r\n\t\t\tbyte[] mybytearray = new byte[(int) newFile.length()];\r\n\t\t\tFileInputStream fis = new FileInputStream(newFile);\r\n\t\t\tBufferedInputStream bis = new BufferedInputStream(fis);\r\n\r\n\t\t\tmsg.initArray(mybytearray.length);\r\n\t\t\tmsg.setSize(mybytearray.length);\r\n\r\n\t\t\tbis.read(msg.getMybytearray(), 0, mybytearray.length);\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(\"Error send (Files)msg) to Server\");\r\n\t\t}\r\n\t\treturn msg;\r\n\t}", "public com.google.protobuf.ByteString\n getObjectFileBytes() {\n java.lang.Object ref = objectFile_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n objectFile_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public PDFileSpecification getFile() throws IOException {\n/* 398 */ COSBase f = this.stream.getDictionaryObject(COSName.F);\n/* 399 */ return PDFileSpecification.createFS(f);\n/* */ }", "File getWorkfile();", "public int getFile() {\n validify();\n return Client.INSTANCE.pieceGetFile(ptr);\n }", "public PDFileSpecification getFile() throws IOException\n {\n COSBase f = stream.getDictionaryObject(COSName.F);\n return PDFileSpecification.createFS(f);\n }", "public File getSaveFile() {\n\t\treturn _file;\n\t}", "public File getJavadocFile() {\n if (getJavadoc().size() > 0) {\n return ((FilePath) this.getJavadoc().iterator().next()).getFile();\n } else {\n return null;\n }\n }", "public File getFile() {\n return resultsFile;\n }", "public com.google.protobuf.ByteString\n getObjectFileBytes() {\n java.lang.Object ref = objectFile_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n objectFile_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public alluxio.proto.journal.File.InodeFileEntry getInodeFile() {\n return inodeFile_;\n }", "public edu.umich.icpsr.ddi.FileTypeType getFileType()\n {\n synchronized (monitor())\n {\n check_orphaned();\n edu.umich.icpsr.ddi.FileTypeType target = null;\n target = (edu.umich.icpsr.ddi.FileTypeType)get_store().find_element_user(FILETYPE$8, 0);\n if (target == null)\n {\n return null;\n }\n return target;\n }\n }", "public static File getDownloadingFile() {\n\t\treturn downloadingFile;\n\t}", "public final Object getFilesystemObject() {\n \treturn m_filesysObj;\n }", "public MultipartFile getFile() {\n\t\treturn file;\n\t}", "public IFile getModelFile() {\r\n \t\treturn newFileCreationPage.getModelFile();\r\n \t}", "public File getFileSource() {\n\t\treturn fileSource;\n\t}", "public File openFile() {\r\n\r\n\t\tFile chosenFile = fileChooser.showOpenDialog(fileChooserDialog);\r\n\t\treturn chosenFile;\r\n\t}", "public edu.usfca.cs.dfs.StorageMessages.RetrieveFile getRetrieveFile() {\n if (msgCase_ == 2) {\n return (edu.usfca.cs.dfs.StorageMessages.RetrieveFile) msg_;\n }\n return edu.usfca.cs.dfs.StorageMessages.RetrieveFile.getDefaultInstance();\n }", "@java.lang.Override\n public java.lang.String getFilePath() {\n return instance.getFilePath();\n }", "public final String getFilePath() {\n\t\treturn m_info.getPath();\n\t}", "public File generateFile()\r\n {\r\n return generateFile(null);\r\n }", "public byte[] getFileBytes(){\n\t\treturn fileBytes;\n\t}", "public String getFilePath() {\n return null;\n }", "public ByteBuffer getFileData() {\n\t\treturn fileData;\n\t}", "public FileDescriptor getFD() throws IOException {\n return this.randomAccessFile.getFD();\n }", "@Override\n\tpublic byte[] get()\n\t{\n\t\tif (isInMemory())\n\t\t{\n\t\t\tif (cachedContent == null)\n\t\t\t{\n\t\t\t\tcachedContent = dfos.getData();\n\t\t\t}\n\t\t\treturn cachedContent;\n\t\t}\n\n\t\tFile file = dfos.getFile();\n\n\t\ttry\n\t\t{\n\t\t\treturn Files.readBytes(file);\n\t\t}\n\t\tcatch (IOException e)\n\t\t{\n\t\t\tlog.debug(\"failed to read content of file: \" + file.getAbsolutePath(), e);\n\t\t\treturn null;\n\t\t}\n\t}", "public WebFile getFile() { return _file; }", "public File getPersonFilePath() {\n Preferences prefs = Preferences.userNodeForPackage(LivrariaPrincipal.class);\n String filePath = prefs.get(\"filePath\", null);\n if (filePath != null) {\n return new File(filePath);\n } else {\n return null;\n }\n }", "public File getFileForKey(String key) {\n\t\treturn new File(mRootDirectory, getFilenameForKey(key));\n\t}", "public edu.umich.icpsr.ddi.FileNameType getFileName()\n {\n synchronized (monitor())\n {\n check_orphaned();\n edu.umich.icpsr.ddi.FileNameType target = null;\n target = (edu.umich.icpsr.ddi.FileNameType)get_store().find_element_user(FILENAME$0, 0);\n if (target == null)\n {\n return null;\n }\n return target;\n }\n }", "public File mo13096b() {\n return m5346f();\n }", "protected File getCurrentDocument() {\n\n return (File)stage.getProperties().get(GlobalConstants.CURRENT_DOCUMENT_PROPERTY_KEY);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getFilePathBytes() {\n return instance.getFilePathBytes();\n }", "public File getDataFile();", "public File getFile(String key) {\n \tif( fileMap.containsKey(key) )\n \t\treturn fileMap.get(key);\n \t\n \treturn null;\n }" ]
[ "0.7422588", "0.7262804", "0.7245409", "0.7108783", "0.7032323", "0.6941597", "0.69338095", "0.6925529", "0.6890767", "0.68727005", "0.6866185", "0.6866185", "0.68551356", "0.68325627", "0.68270403", "0.6801857", "0.6794834", "0.67799765", "0.67642546", "0.66975546", "0.6695372", "0.6677483", "0.66464806", "0.66464806", "0.66128737", "0.66111106", "0.65956163", "0.65956163", "0.654046", "0.6483479", "0.6460286", "0.6418493", "0.6416662", "0.6406826", "0.63950974", "0.6370094", "0.63650495", "0.63568807", "0.63444555", "0.6312207", "0.63073224", "0.6250526", "0.622782", "0.6221291", "0.62001646", "0.6193603", "0.6186616", "0.6177961", "0.6177961", "0.61773944", "0.6175559", "0.6168536", "0.616426", "0.6160119", "0.6160119", "0.6156668", "0.6145957", "0.6144374", "0.6113068", "0.60926497", "0.6088683", "0.6069782", "0.60415876", "0.6038658", "0.60262877", "0.60219884", "0.6010198", "0.6010007", "0.60002726", "0.5979207", "0.59709185", "0.5959667", "0.59589595", "0.5953976", "0.5941548", "0.5937297", "0.59240204", "0.59203744", "0.59050304", "0.5889289", "0.5886422", "0.5884611", "0.58554435", "0.5849216", "0.58339596", "0.58237535", "0.5821464", "0.58208096", "0.5813577", "0.5807669", "0.580555", "0.58029085", "0.57884294", "0.57816553", "0.57794875", "0.5778981", "0.57778084" ]
0.68461514
15
Returns an ID uniquely identifying this HeapFile. Implementation note: you will need to generate this tableid somewhere ensure that each HeapFile has a "unique id," and that you always return the same value for a particular HeapFile. We suggest hashing the absolute file name of the file underlying the heapfile, i.e. f.getAbsoluteFile().hashCode().
public int getId() { return tableId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getId() {\n // some code goes here\n \treturn m_f.getAbsoluteFile().hashCode();\n }", "public int getId() {\n // some code goes here\n int id = f.getAbsoluteFile().hashCode();\n //System.out.println(id);\n return id;\n }", "public int getId() {\n // some code goes here\n return f.getAbsoluteFile().hashCode();\n //throw new UnsupportedOperationException(\"implement this\");\n }", "public final int getFileId() {\n\t\treturn m_FID;\n\t}", "public static int getFileID() {\n\t\treturn StringArray.fileID;\n\t}", "public short getFileID() \r\n\t //@ requires [?f]valid_id(this);\r\n\t //@ ensures [f]valid_id(this);\r\n\t{\r\n\t\t////@ open [f]valid_id(this); // auto\r\n\t\tFile thiz = this;\r\n\t\treturn fileID;\r\n\t\t//@ close [f]valid_id(this); // todo\r\n\t}", "@Override\r\n\tpublic int hashCode() {\r\n\t\tfinal int prime = 31;\r\n\t\tint result = 1;\r\n\t\tresult = prime * result + chunkNumber;\r\n\t\tresult = prime * result + ((fileID == null) ? 0 : fileID.hashCode());\r\n\t\treturn result;\r\n\t}", "@Override\n public String generateId() {\n return HiveIdGenerator.generateTableId(getSourceId(), getDatabaseName(),\n getTableName());\n }", "private static String getUniqueId()\n\t{\n\t\tfinal int limit = 100000000;\n\t\tint current;\n\t\tsynchronized (DiskFileItem.class)\n\t\t{\n\t\t\tcurrent = counter.nextInt();\n\t\t}\n\t\tString id = Integer.toString(current);\n\n\t\t// If you manage to get more than 100 million of ids, you'll\n\t\t// start getting ids longer than 8 characters.\n\t\tif (current < limit)\n\t\t{\n\t\t\tid = (\"00000000\" + id).substring(id.length());\n\t\t}\n\t\treturn id;\n\t}", "public Integer getFileId() {\n\t\treturn fileId;\n\t}", "public short getFileID() \r\n\t //@ requires [?f]valid_id(this);\r\n\t //@ ensures [f]valid_id(this);\r\n\t{\r\n\t\t////@ open [f]valid_id(this); // auto\r\n\t\treturn fileID;\r\n\t\t//@ close [f]valid_id(this);\r\n\t}", "public short getFileID() \r\n\t //@ requires [?f]valid_id(this);\r\n\t //@ ensures [f]valid_id(this);\r\n\t{\r\n\t\t////@ open [f]valid_id(this); // auto\r\n\t\treturn fileID;\r\n\t\t//@ close [f]valid_id(this);\r\n\t}", "public int getFileId() {\n return fileId;\n }", "public abstract byte getTableId();", "public Integer getFileid() {\n return fileid;\n }", "public final int getFileId() {\n\t\treturn m_fileId;\n\t}", "public String getFileId() {\n return fileId;\n }", "public String getFileId() {\n return fileId;\n }", "public String getFileId() {\n return fileId;\n }", "@Override\n\tpublic int hashCode() {\n\t\treturn this.filePath.hashCode();\n\t}", "public int hashCode() {\n final int HASH_MULTIPLIER = 29;\n int h = HASH_MULTIPLIER * FName.hashCode() + LName.hashCode();\n h = HASH_MULTIPLIER * h + ((Integer)ID).hashCode();\n return h;\n }", "public String getID() {\n\t\treturn this.region.getFileName();\n\t}", "@Override\n public int hashCode() {\n return rank + file;\n }", "public BigDecimal getFILE_STRUCTURE_ID() {\r\n return FILE_STRUCTURE_ID;\r\n }", "public static int createFileID(String fileName) {\n\n int fileID;\n\n fileID = 0;\n\n // checks to see if the curent fileID is in database. If yes, then it generates a random new one until a new one is found. \n while (containsFileID(fileID)) {\n fileID = (int) (Math.random() * 100000000);\n }\n // adds this id/name pairing to the database\n addOrUpdateFileName(fileID, fileName);\n System.out.println(\"CreateFileID: \" + fileID + \", \" + fileName);\n // returns the id so the TranslationFile object can store it.\n\n return fileID;\n }", "@Override\n public int hashCode() {\n return Objects.hash(filePath);\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getHeaderTableIdBytes() {\n java.lang.Object ref = headerTableId_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n headerTableId_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public Long getFileId() {\n/* 35:35 */ return this.fileId;\n/* 36: */ }", "@Override\n\tpublic int hashCode() {\n\t\tfinal int prime = 999;\n\t\tint result = 1;\n\t\tresult = prime * result + Table;\n\t\tresult = prime * result + id;\n\t\treturn result;\n\t}", "public int getID() {\n\t\treturn this.data.hashCode();\n\t}", "@java.lang.Override\n public com.google.protobuf.ByteString getFileHash() {\n return fileHash_;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getFileHash() {\n return fileHash_;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getFileHash() {\n return fileHash_;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getFileHash() {\n return fileHash_;\n }", "public com.google.protobuf.ByteString\n getHeaderTableIdBytes() {\n java.lang.Object ref = headerTableId_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n headerTableId_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public Long getFileId() {\n return this.fileId;\n }", "public String identityHash() {\n return Integer.toHexString(System.identityHashCode(this));\n }", "public int genID() {\n int uid = this.hashCode();\n if (uid < 0) {\n uid = Math.abs(uid);\n uid = uid * 15551;\n }\n return uid;\n }", "public java.lang.String getHeaderTableId() {\n java.lang.Object ref = headerTableId_;\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 headerTableId_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "int getSymbolicId();", "public final String getTableId() {\n\t\treturn tableId;\n\t}", "com.google.protobuf.ByteString\n getHeaderTableIdBytes();", "com.google.protobuf.ByteString getFileHash();", "com.google.protobuf.ByteString getFileHash();", "@java.lang.Override\n public java.lang.String getHeaderTableId() {\n java.lang.Object ref = headerTableId_;\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 headerTableId_ = s;\n return s;\n }\n }", "@Override public int hashCode() {\r\n int result = 17;\r\n result = 31 * result + fID;\r\n result = 31 * result + fName.hashCode();\r\n return result;\r\n }", "String getUniqueId();", "java.lang.String getHeaderTableId();", "public int getTableID() {\r\n\t\treturn tableID;\r\n\t}", "public String getHeadCommitID() {\n return Utils.readObject(HEADFILE, String.class);\n }", "public Long getFileID()\n/* */ {\n/* 88 */ return this.fileID;\n/* */ }", "public String getFileSystemId() {\n return this.fileSystemId;\n }", "@Override\r\n\t public int hashCode()\r\n\t {\n\t final int PRIME = 31;\r\n\t int result = 1;\r\n\t result = (int) (PRIME * result + (getId()==null?\r\n\t \t\tgetName().hashCode()\r\n\t \t\t:getName().hashCode()+getId()));\r\n\t return result;\r\n\t }", "public long getFileId(String file_name) {\n\n\t\tif (m_db == null)\n\t\t\treturn -1;\n\n\t\tCursor cursor = m_db.query(FILE_TABLE_NAME,\n\t\t\t\tnew String[] { FILE_FIELD_ID }, FILE_FIELD_PATH + \"=?\",\n\t\t\t\tnew String[] { file_name }, null, null, null);\n\n\t\t//\n\t\t// get first entry of result set\n\t\t//\n\t\tString result = getFirstEntryOfResultSet(cursor);\n\n\t\t//\n\t\t// close cursor\n\t\t//\n\t\tcursor.close();\n\n\t\tif (result == null)\n\t\t\treturn -1;\n\t\telse\n\t\t\treturn Long.parseLong(result);\n\t}", "public String getId() {\n\t\treturn Integer.toString(this.hashCode());\n\t}", "public void generateID()\n {\n ID = this.hashCode();\n }", "public int hashCode() {\n long hash = UtilConstants.HASH_INITIAL;\n hash = hash * UtilConstants.HASH_PRIME + objectHashCode(getProjectName());\n hash = hash * UtilConstants.HASH_PRIME + objectHashCodeFK(getDataProvider());\n hash = hash * UtilConstants.HASH_PRIME + objectHashCodeFK(getPrimaryInvestigator());\n hash = hash * UtilConstants.HASH_PRIME + objectHashCodeFK(getCreatedBy());\n hash = hash * UtilConstants.HASH_PRIME + objectHashCode(getCreatedTime());\n return (int)(hash % Integer.MAX_VALUE);\n }", "protected String cacheKeyForFile(File file) {\n \treturn file.getAbsolutePath();\n }", "public Long getVersionedFileId() {\r\n\t\treturn versionedFileId;\r\n\t}", "public static FileIDDictionary getInstance() {\n return FILE_ID_DICTIONARY;\n }", "public HeapFile(File f, TupleDesc td) {\n this.file = f;\n this.tableId = f.getAbsoluteFile().hashCode();\n this.td = td;\n int pageSize = BufferPool.PAGE_SIZE;\n int pagesNeeded;\n\n RandomAccessFile rf;\n try {\n rf = new RandomAccessFile(f, \"r\");\n pagesNeeded = (int) Math.ceil((double) rf.length() / pageSize);\n } catch (Exception e) {\n System.err.println(\"Caugth exception1:\" + e.getMessage());\n return;\n }\n this.numPages = pagesNeeded;\n System.out.println(\"Created \" + pagesNeeded + \" heap files.\");\n pages = new HeapPage[pagesNeeded];\n\n // TODO Find out the best way to handle exceptions\n for (int pageIndex = 0; pageIndex < pagesNeeded; ++pageIndex) {\n int offset = pageIndex * pageSize;\n byte[] data = new byte[pageSize];\n try {\n rf.readFully(data, offset, pageSize);\n HeapPageId pid = new HeapPageId(tableId, pageIndex);\n System.out.println(\"Created HeapPageId\");\n pages[pageIndex] = new HeapPage(pid, data);\n System.out.println(\"Wrote to pages[\"+pageIndex+\"].\");\n } catch (Exception e) {\n System.err.println(\"Caught exception2:\" + e.getMessage());\n return;\n }\n }\n }", "private String getUUID(final String filename) {\n \t\t\tString uuid = uuids.get(filename);\n \t\t\tif (uuid == null) {\n \t\t\t\tuuid = UUID.randomUUID().toString();\n \t\t\t\tuuids.put(filename, uuid);\n \t\t\t}\n \t\t\treturn uuid;\n \t\t}", "public String getUniqueId(int row);", "protected final int getFileId(String path, String name, int dirId, DBDeviceContext dbCtx) {\n\n // Check if the file is in the cache\n \n FileStateCache cache = dbCtx.getStateCache();\n FileState state = null;\n \n if ( cache != null) {\n \n // Search for the file state\n \n state = cache.findFileState(path);\n if ( state != null) {\n\n // Checkif the file id is cached\n \n if ( state.getFileId() != -1) {\n \n // Debug\n \n if ( Debug.EnableInfo && hasDebug())\n Debug.println(\"@@ Cache hit - getFileId() name=\" + name);\n \n // Return the file id\n \n return state.getFileId();\n }\n else if ( state.getFileStatus() == FileStatus.NotExist) {\n \n // DEBUG\n \n if ( Debug.EnableInfo && hasDebug())\n Debug.println(\"@@ Cache hit - getFileStatus() name=\" + name + \", sts=NotExist\");\n \n // Indicate that the file does not exist\n \n return -1;\n }\n }\n }\n \n // Get the file id from the database\n \n int fileId = -1;\n \n try {\n \n // Get the file id\n \n fileId = dbCtx.getDBInterface().getFileId(dirId, name, false, false);\n }\n catch (DBException ex) {\n }\n\n // Update the cache entry, if available\n \n if ( state != null)\n state.setFileId(fileId);\n \n // Return the file id, or -1 if the file was not found\n\n return fileId;\n }", "@Override\n public int hashCode() {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"6ebbad60-c086-483f-99f5-ae1b69cbca99\");\n return getName().hashCode();\n }", "public Integer fileLocator(String filename) {\n\n int fileHash = returnHash(filename);\n Integer closestKey = this.IPmap.floorKey(fileHash); //returns the greatest key less than or equal to the given key, or null if there is no such key.\n if (closestKey == null) {\n closestKey = this.IPmap.lastKey(); //returns highest key in this map\n }\n return closestKey; //returns IP associated with this nodeID\n }", "private short getTableId(short tableIndex) {\n return (short) (tableBase + tableIndex);\n }", "@Override\n\tpublic long getTableId() {\n\t\treturn _expandoColumn.getTableId();\n\t}", "public abstract long NewFileNumber();", "public String getId() {\n\t\tStringBuilder builder = new StringBuilder();\n\t\tbuilder.append(\"n=\");\n\t\tif ( nodeId != null ) {\n\t\t\tbuilder.append(nodeId);\n\t\t}\n\t\tbuilder.append(\";c=\");\n\t\tif ( created != null ) {\n\t\t\tbuilder.append(created);\n\t\t}\n\t\tbuilder.append(\";s=\");\n\t\tif ( sourceId != null ) {\n\t\t\tbuilder.append(sourceId);\n\t\t}\n\t\treturn DigestUtils.sha1Hex(builder.toString());\n\t}", "public String getIdString() {\n return Server.getChunkIdString(this.parent.getSourceFile().getId(), this.chunkID);\n }", "int getTableID() {\r\n return table_id;\r\n }", "public Long gethId() {\n return hId;\n }", "String getUniqueID();", "private int getFileContentHashCode(Path filePath) throws IOException {\n return Arrays.hashCode(Files.readAllBytes(filePath));\n }", "public long getId()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(ID$6);\n if (target == null)\n {\n return 0L;\n }\n return target.getLongValue();\n }\n }", "alluxio.proto.journal.File.InodeFileEntry getInodeFile();", "protected final int getFileIdForIndex(int index) {\n return getChildIds().get(index);\n }", "public HeapFile(File f, TupleDesc td) {\n this.tupleDesc = td;\n this.file = f;\n this.fid = file.getAbsoluteFile().hashCode();\n this.numOfPages = (int)Math.ceil((double)f.length()/(double)BufferPool.PAGE_SIZE);\n if(f.length()==0) \n//\t\t\ttry {\n//\t\t\t\twritePage(new HeapPage(new HeapPageId(fid, 0), new byte[BufferPool.PAGE_SIZE]));\n//\t\t\t} catch (IOException e) {\n//\t\t\t\t// TODO Auto-generated catch block\n//\t\t\t\te.printStackTrace();\n//\t\t\t}\n\t\t\tthis.numOfPages = 0;\n// }\n }", "public String getUniqueID();", "public Key getID () {\n\t\treturn id;\n\t}", "public TableIdentity getTableIdentity() {\r\n\t\treturn tableId;\r\n\t}", "public Long getTableId() {\n return tableId;\n }", "public FString objectID() {\n return this.key;\n }", "public alluxio.proto.journal.File.InodeFileEntry getInodeFile() {\n return inodeFile_;\n }", "public String getId() {\n return this.getClass().getSimpleName() + \"@\" + this.hashCode();\n }", "public java.lang.String getID()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(ID$24);\n if (target == null)\n {\n return null;\n }\n return target.getStringValue();\n }\n }", "public int hashCode()\n\t{\n\t\treturn id.hashCode();\n\t}", "public int hashCode() {\n/* 781 */ return getUniqueId().hashCode();\n/* */ }", "public static long getFileId(ILogManager logManager, long lsn) {\n return lsn / logManager.getLogManagerProperties().getLogPartitionSize();\n }", "public java.lang.String getID()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(ID$12);\n if (target == null)\n {\n return null;\n }\n return target.getStringValue();\n }\n }", "public java.lang.String getID()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(ID$12);\n if (target == null)\n {\n return null;\n }\n return target.getStringValue();\n }\n }", "public int getId() {\n return fid;\n }", "public int hashcode(){\r\n\t\t\r\n\t\treturn last_Name.hashcode();\r\n\t}", "public String getId() {\n int result;\n result = (key != null ? key.hashCode() : 0);\n result = 31 * result + (overridable ? 1 : 0);\n result = 31 * result + (value != null ? value.hashCode() : 0);\n result = 31 * result + (set ? 1 : 0);\n if (result < 0)\n result = result * -1;\n return String.valueOf(result);\n }", "@Override\r\n\tpublic int getID() {\n\t\treturn jID()*100+ID();\r\n\t}", "public int hashCode() {\r\n \tif (id != null){\r\n \t\treturn id.hashCode();\r\n \t}\r\n \treturn 0;\r\n }", "public byte[] getHash() {\n\t\treturn _hash.getDataID();\n\t}", "public String getIdentifier() {\n try {\n return keyAlias + \"-\" + toHexString(\n MessageDigest.getInstance(\"SHA1\").digest(keyStoreManager.getIdentifierKey(keyAlias).getEncoded()));\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n }", "public int hashCode() {\n return getId();\n }" ]
[ "0.75548935", "0.7451884", "0.7228318", "0.6545361", "0.63371295", "0.61235446", "0.6069864", "0.5955612", "0.59480953", "0.59382564", "0.59286755", "0.59286755", "0.58868384", "0.5835929", "0.58357257", "0.5814877", "0.58024985", "0.58024985", "0.58024985", "0.5757726", "0.57495266", "0.5721196", "0.5646461", "0.5623596", "0.56135327", "0.5601588", "0.560124", "0.55848217", "0.5575501", "0.55574685", "0.55464906", "0.55460036", "0.55417717", "0.55411845", "0.5538711", "0.5529759", "0.5525442", "0.5509624", "0.5487662", "0.5485479", "0.5471108", "0.54698163", "0.54651386", "0.54651386", "0.5461155", "0.54240674", "0.53934765", "0.5386555", "0.5383585", "0.53709084", "0.5335749", "0.53331965", "0.53277797", "0.5317298", "0.5314836", "0.5310996", "0.5309898", "0.5302203", "0.52922195", "0.5289441", "0.52554125", "0.52394485", "0.5233085", "0.52264935", "0.52242017", "0.52118224", "0.5201538", "0.52010274", "0.5190007", "0.51835185", "0.5164056", "0.516002", "0.51464385", "0.5140206", "0.5134279", "0.5134021", "0.51255023", "0.5120306", "0.5119351", "0.5106736", "0.5104322", "0.50994503", "0.50930065", "0.50928134", "0.5083235", "0.5075869", "0.5072244", "0.50698715", "0.506609", "0.50577515", "0.5057257", "0.5057257", "0.50568163", "0.5053156", "0.5050257", "0.5048849", "0.5039466", "0.5038965", "0.50381786", "0.50342757" ]
0.5346214
50
Returns the TupleDesc of the table stored in this DbFile.
public TupleDesc getTupleDesc() { return td; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public TupleDesc getTupleDesc() {\n // some code goes here\n return td;\n }", "@Override\n\t\tpublic TupleDesc getTupleDesc() {\n\t\t\treturn td;\n\t\t}", "public TupleDesc getTupleDesc() {\n // some code goes here\n \treturn m_td;\n }", "public TupleDesc getTupleDesc() {\n // some code goes here\n // throw new UnsupportedOperationException(\"implement this\");\n return this.td;\n }", "public TupleDesc getTupleDesc() {\n \treturn tupleDesc;\n }", "public TupleDesc getTupleDesc();", "public String getTabledesc() {\n return tabledesc;\n }", "public TupleDesc getTupleDesc() {\n\t\treturn childOperator.getTupleDesc();\n\t}", "public TupleDesc() {\n columns = new ArrayList<>();\n }", "private TupleDesc generateTupleDesc(){\n \tif(this.childTD == null){ //no tuples merged yet\n \t\t//return a general tupleDesc\n \t\treturn generalTupleDesc();\n \t} else {\n \t\t//generate a helpful, well-named TupleDesc\n \t\tType[] typeArr;\n \tString[] nameArr;\n \tString aggName = operator.toString() + \"(\" + childTD.getFieldName(aggField) + \")\";\n \tif(gbField == NO_GROUPING && gbFieldType == Type.INT_TYPE){\n \t\ttypeArr = new Type[]{Type.INT_TYPE};\n \t\tnameArr = new String[]{aggName};\n \t}else if(gbField == NO_GROUPING){ //gbFieldType == Type.STRING_TYPE\n \t\ttypeArr = new Type[]{Type.STRING_TYPE};\n \t\tnameArr = new String[]{aggName};\n \t} else {\n \t\ttypeArr = new Type[]{gbFieldType, Type.INT_TYPE};\n \t\tString groupName = \"group by(\" + childTD.getFieldName(gbField) + \")\";\n \t\tnameArr = new String[]{groupName, aggName};\n \t}\n \treturn new TupleDesc(typeArr, nameArr);\n \t}\n }", "public String getTableFile() \n\t{\n\t return tableFile ;\n\t}", "public TableInfo getTableInfo() {\r\n\t\treturn ti;\r\n\t}", "public String getDbTable() {return dbTable;}", "public String getTable() {\n return table;\n }", "public String getTable() {\n return table;\n }", "public List<String> descTable() throws Exception {\n\t\treturn null;\n\t}", "private String getFileTableQuery() {\n \t\tfinal StringBuilder builder = new StringBuilder();\n \n \t\tbuilder.append(\"create table FILE(\");\n \t\tbuilder.append(\"FILE_ID LONG PRIMARY KEY,\");\n \t\tbuilder.append(\"FILE_PATH TEXT,\");\n \t\tbuilder.append(\"START_REVISION_ID LONG,\");\n \t\tbuilder.append(\"END_REVISION_ID LONG\");\n \t\tbuilder.append(\")\");\n \n \t\treturn builder.toString();\n \t}", "public String getTable()\n {\n return table;\n }", "public NodeTupleTable getNodeTupleTable() {\n return getDatasetGraphTDB().chooseNodeTupleTable(getGraphName()) ;\n }", "@VTID(13)\r\n java.lang.String getTuple();", "public String table() {\n return tableName;\n }", "public String table() {\n return tableName;\n }", "public String getTableSchemaFile() {\n return tableSchemaFile;\n }", "public String getProgressTable() {\n return dbTable.getProgressTable();\n }", "public String getTablename() {\n return tablename;\n }", "public String getTableData() {\r\n return tableData;\r\n }", "private TupleDesc generalTupleDesc(){\n \tType[] typeArr;\n \tString[] nameArr;\n \tif(gbField == NO_GROUPING && gbFieldType == Type.INT_TYPE){\n \t\ttypeArr = new Type[]{Type.INT_TYPE};\n \t\tnameArr = new String[]{\"aggregateValue\"};\n \t}else if(gbField == NO_GROUPING){ //gbFieldType == Type.STRING_TYPE\n \t\ttypeArr = new Type[]{Type.STRING_TYPE};\n \t\tnameArr = new String[]{\"aggregateValue\"};\n \t} else {\n \t\ttypeArr = new Type[]{gbFieldType, Type.INT_TYPE};\n \t\tnameArr = new String[]{\"groupValue\", \"aggregateValue\"};\n \t}\n \treturn new TupleDesc(typeArr, nameArr);\n }", "public String exportTableDescription(String fullTableName);", "public final Table getTable()\n {\n return table;\n }", "com.google.protobuf.ByteString\n getBaseTableBytes();", "public String getTableName() {\n return (String) getAttributeInternal(TABLENAME);\n }", "public Table getTable() { return this.table; }", "public String getTableSummary() {\n return \"A summary description of table data\";\n }", "public String getBaseTable() {\n Object ref = baseTable_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n baseTable_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }", "public String getCreateTableString() {\n \t\treturn \"create table\";\n \t}", "public Table getTable() {\n return table;\n }", "public Table getTable() { \n\t\treturn this.table; \n\t}", "public Table getTable() {\n return table;\n }", "public String getTableName() {\n return getTableName(false, false, false, false);\n }", "public Tuple nextTuple() {\n\t\ttry {\n\t\t\treturn tr.read();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "public Table getTable() {\n\t\treturn table;\n\t}", "public String getTableName() throws DatabaseSchemaException {\n return Database.getTableName(clazz);\n }", "public Table<Integer, Integer, String> getData();", "public String getNomTable();", "@Override\r\n\tprotected String getTable() {\n\t\treturn TABLE;\r\n\t}", "public Tuple<String> getColumnNames() {\n return resultTable.getColumnNames();\r\n }", "public String getTableCode() {\n return tableCode;\n }", "public String getTableName() {\r\n\t\treturn this.tableMetaDataContext.getTableName();\r\n\t}", "public DBTableDescriptor getTableDescriptor(final byte [] tableName)\n throws IOException {\n return this.connection.getDBTableDescriptor(tableName);\n }", "protected boolean getTableDesc()\n\t\t{\n\t\t\treturn Desc ;\n\t\t}", "@Override\n public String toString() {\n if (this.tuples == null || this.tuples.isEmpty()) return \"i\"; \n String retStr = new String(); \n\n // Initialize number of attributes.\n int attributesNumber = attributes.size();\n\n // An array storing the max length of Strings per column.\n // The Strings per column are tuple Values and attributes.\n int[] maxColumnLengthOfStrings = new int[attributesNumber];\n\n // Loop all the attributes and fill the max length array\n for (int index = 0; index < attributesNumber; index++) {\n\n // Initialize the array with the attributes name length.\n maxColumnLengthOfStrings[index] = attributes.get(index).getName().length();\n\n // Loop the values and find the longest value toString().\n for (int rowIndex = 0; rowIndex < this.tuples.size(); rowIndex++) { // Loop the rows\n String value = this.tuples.get(rowIndex).getValues().get(index).toString();\n if (value.length() > maxColumnLengthOfStrings[index]){\n maxColumnLengthOfStrings[index] = value.length();\n }\n }\n }\n\n // A set of tables whose columns are in the attributes list.\n Set<SQLTable> tablesSet = new HashSet<>();\n // The list of attributes to String format.\n String attributesList = new String();\n // A line used to separate the attributes from the data.\n String separationLine = new String();\n // Create the separation line and the attributes line.\n for (int index = 0; index < attributesNumber; index++) {\n\n // The score column has a null table. Dont search it.\n if (!this.attributes.get(index).getName().equals(\"score\"))\n tablesSet.add((this.attributes.get(index).getTable()) );\n\n\n attributesList += \"|\" + PrintingUtils.addStringWithLeadingChars(maxColumnLengthOfStrings[index],\n this.attributes.get(index).getName(), \" \");\n separationLine += \"+\" + PrintingUtils.addStringWithLeadingChars(maxColumnLengthOfStrings[index], \"\", \"-\");\n }\n attributesList += \"|\"; // Add the last \"|\".\n separationLine += \"+\"; // Add the last \"+\".\n\n // Print the tables which contain this tuples (HACK WAY). \n // String tablesInString = new String (\"Tables joined : \");\n // for (SQLTable table: tablesSet) {\n // tablesInString += table.toAbbreviation() + \" |><| \";\n // }\n // System.out.println(tablesInString.substring(0, tablesInString.length()-5));\n\n // Print the attributes between separation lines.\n retStr += this.network + \"\\n\";\n retStr += separationLine + \"\\n\";\n retStr += attributesList + \"\\n\";\n retStr += separationLine + \"\\n\";\n\n // Print all the rows of Tuple Values.\n for (OverloadedTuple tuple: this.tuples) {\n String rowOfValues = new String();\n for (int index = 0; index < attributesNumber; index++) {\n rowOfValues += \"|\" + PrintingUtils.addStringWithLeadingChars( maxColumnLengthOfStrings[index],\n tuple.getValues().get(index).toString(), \" \");\n }\n rowOfValues += \"|\";\n\n // Replace any \\n with a space\n retStr += rowOfValues.replace('\\n', ' ') + \"\\n\";\n }\n\n // Print a separation line.\n retStr += separationLine + \"\\n\";\n\n return retStr;\n }", "public String getTableId() {\n return this.tableId;\n }", "public String getTableId() {\n return this.tableId;\n }", "public String getTableName() {\n return this.tableName;\n }", "@Override\n public String getTableName() {\n return getFreeTextDocTablename(conf);\n }", "public String getTableKey() {\n return tableKey;\n }", "@Override\n public String getBaseTable() {\n Object ref = baseTable_;\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 baseTable_ = s;\n return s;\n }\n }", "protected final String immutableGetTableName()\n {\n return m__strTableName;\n }", "Table getTable();", "private HashMap<Long, String> getTable() {\n return table;\n }", "public String getTableName() {\n return this.tableName;\n }", "public String getTableName() {\n return this.tableName;\n }", "public String toString()\n {\n return this.getUntranslatedTableName();\n }", "public BaseTableInfo info() {\n return info;\n }", "private String getTableName() {\n return this.tableName;\n }", "public String getTableName() {\n\t\treturn this.getTableName(this.currentClass());\n\t}", "protected String getTableColumn()\n\t\t{\n\t\t\treturn Column ;\n\t\t}", "public String getTableNameString() {\n return tableName;\n }", "public FileDesc getFileDesc();", "String getTableName();", "public String getTableDbName() { return \"t_trxtypes\"; }", "String getBaseTable();", "public static String tableName() {\r\n return \"TB_UPP_CHECK_STORE_DIVERGENCE\";\r\n }", "protected String getTableName()\n {\n return immutableGetTableName();\n }", "public String getSourceTable();", "FieldDesc getColumnDesc(int i);", "public String toString() {\n\t\t\tStringBuffer bf = new StringBuffer(); \t\t\t\n\t\t\tbf.append(\"Table:\\t\"+ name +\"\\n\");\n\t\t\tbf.append(\"Record Count: \"+ count +\"\\n\");\n\t\t\tbf.append(\"Fields: \\n\");\n\t\t\tfor (String key : fields.keySet()) {\n\t\t\t\tbf.append(\"\\t\"+ key +\": \"+fields.get(key) +\"\\n\");\n\t\t\t}\n\t\t\tbf.append(\"\\n\\n\");\n\t\t\treturn bf.toString();\n\t\t}", "private static void loadTableData() {\n\n\t\tBufferedReader in = null;\n\t\ttry {\n\t\t\tin = new BufferedReader(new FileReader(dataDir + tableInfoFile));\n\n\t\t\twhile (true) {\n\n\t\t\t\t// read next line\n\t\t\t\tString line = in.readLine();\n\t\t\t\tif (line == null) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tString[] tokens = line.split(\" \");\n\t\t\t\tString tableName = tokens[0];\n\t\t\t\tString tableFileName = tokens[1];\n\n\t\t\t\ttableNameToSchema.put(tableName, new HashMap<String, Type>());\n\t\t\t\ttableNameToOrdredSchema.put(tableName,\n\t\t\t\t\t\tnew ArrayList<ColumnInfo>());\n\n\t\t\t\t// attributes data\n\t\t\t\tfor (int i = 2; i < tokens.length;) {\n\n\t\t\t\t\tString attName = tokens[i++];\n\t\t\t\t\tString attTypeName = (tokens[i++]);\n\n\t\t\t\t\tType attType = null;\n\n\t\t\t\t\t/*\n\t\t\t\t\t * Undefined, how to represent dates, crazy longs probably\n\t\t\t\t\t * won't need this for now...\n\t\t\t\t\t */\n\t\t\t\t\tif (attTypeName.equals(\"CHAR\")) {\n\t\t\t\t\t\tattType = Types.getCharType(Integer\n\t\t\t\t\t\t\t\t.valueOf(tokens[i++]));\n\t\t\t\t\t} else if (attTypeName.equals(\"DATE\")) {\n\t\t\t\t\t\tattType = Types.getDateType();\n\t\t\t\t\t} else if (attTypeName.equals(\"DOUBLE\")) {\n\t\t\t\t\t\tattType = Types.getDoubleType();\n\t\t\t\t\t} else if (attTypeName.equals(\"FLOAT\")) {\n\t\t\t\t\t\tattType = Types.getFloatType();\n\t\t\t\t\t} else if (attTypeName.equals(\"INTEGER\")) {\n\t\t\t\t\t\tattType = Types.getIntegerType();\n\t\t\t\t\t} else if (attTypeName.equals(\"LONG\")) {\n\t\t\t\t\t\tattType = Types.getLongType();\n\t\t\t\t\t} else if (attTypeName.equals(\"VARCHAR\")) {\n\t\t\t\t\t\tattType = Types.getVarcharType();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new RuntimeException(\"Invalid type: \"\n\t\t\t\t\t\t\t\t+ attTypeName);\n\t\t\t\t\t}\n\n\t\t\t\t\ttableNameToSchema.get(tableName).put(attName, attType);\n\n\t\t\t\t\tColumnInfo ci = new ColumnInfo(attName, attType);\n\t\t\t\t\ttableNameToOrdredSchema.get(tableName).add(ci);\n\n\t\t\t\t}\n\n\t\t\t\t// at this point, table info loaded.\n\n\t\t\t\t// Create table\n\t\t\t\tmyDatabase.getQueryInterface().createTable(tableName,\n\t\t\t\t\t\ttableNameToSchema.get(tableName));\n\n\t\t\t\t// Now, load data into newly created table\n\t\t\t\treadTable(tableName, tableFileName);\n\n\t\t\t}\n\n\t\t\tin.close();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tHelpers.print(e.getStackTrace().toString(),\n\t\t\t\t\tutil.Consts.printType.ERROR);\n\t\t}\n\n\t}", "public String sort() throws DatabaseException {\n //doesn't do anything\n return this.tableName;\n\n }", "TableType getTableType()\n {\n return tableType;\n }", "public DatabaseDescriptor() {\n super();\n _xmlName = \"database\";\n _elementDefinition = true;\n org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;\n org.exolab.castor.mapping.FieldHandler handler = null;\n org.exolab.castor.xml.FieldValidator fieldValidator = null;\n //-- initialize attribute descriptors\n \n //-- _tableName\n desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, \"_tableName\", \"tableName\", org.exolab.castor.xml.NodeType.Attribute);\n desc.setImmutable(true);\n handler = new org.exolab.castor.xml.XMLFieldHandler() {\n public java.lang.Object getValue( java.lang.Object object ) \n throws IllegalStateException\n {\n Database target = (Database) object;\n return target.getTableName();\n }\n public void setValue( java.lang.Object object, java.lang.Object value) \n throws IllegalStateException, IllegalArgumentException\n {\n try {\n Database target = (Database) object;\n target.setTableName( (java.lang.String) value);\n } catch (java.lang.Exception ex) {\n throw new IllegalStateException(ex.toString());\n }\n }\n public java.lang.Object newInstance(java.lang.Object parent) {\n return null;\n }\n };\n desc.setSchemaType(\"string\");\n desc.setHandler(handler);\n desc.setRequired(true);\n desc.setMultivalued(false);\n addFieldDescriptor(desc);\n \n //-- validation code for: _tableName\n fieldValidator = new org.exolab.castor.xml.FieldValidator();\n fieldValidator.setMinOccurs(1);\n { //-- local scope\n org.exolab.castor.xml.validators.StringValidator typeValidator;\n typeValidator = new org.exolab.castor.xml.validators.StringValidator();\n fieldValidator.setValidator(typeValidator);\n typeValidator.setWhiteSpace(\"preserve\");\n }\n desc.setValidator(fieldValidator);\n //-- _userIdColName\n desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, \"_userIdColName\", \"userIdColName\", org.exolab.castor.xml.NodeType.Attribute);\n desc.setImmutable(true);\n handler = new org.exolab.castor.xml.XMLFieldHandler() {\n public java.lang.Object getValue( java.lang.Object object ) \n throws IllegalStateException\n {\n Database target = (Database) object;\n return target.getUserIdColName();\n }\n public void setValue( java.lang.Object object, java.lang.Object value) \n throws IllegalStateException, IllegalArgumentException\n {\n try {\n Database target = (Database) object;\n target.setUserIdColName( (java.lang.String) value);\n } catch (java.lang.Exception ex) {\n throw new IllegalStateException(ex.toString());\n }\n }\n public java.lang.Object newInstance(java.lang.Object parent) {\n return null;\n }\n };\n desc.setSchemaType(\"string\");\n desc.setHandler(handler);\n desc.setRequired(true);\n desc.setMultivalued(false);\n addFieldDescriptor(desc);\n \n //-- validation code for: _userIdColName\n fieldValidator = new org.exolab.castor.xml.FieldValidator();\n fieldValidator.setMinOccurs(1);\n { //-- local scope\n org.exolab.castor.xml.validators.StringValidator typeValidator;\n typeValidator = new org.exolab.castor.xml.validators.StringValidator();\n fieldValidator.setValidator(typeValidator);\n typeValidator.setWhiteSpace(\"preserve\");\n }\n desc.setValidator(fieldValidator);\n //-- _userCodeColName\n desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, \"_userCodeColName\", \"userCodeColName\", org.exolab.castor.xml.NodeType.Attribute);\n desc.setImmutable(true);\n handler = new org.exolab.castor.xml.XMLFieldHandler() {\n public java.lang.Object getValue( java.lang.Object object ) \n throws IllegalStateException\n {\n Database target = (Database) object;\n return target.getUserCodeColName();\n }\n public void setValue( java.lang.Object object, java.lang.Object value) \n throws IllegalStateException, IllegalArgumentException\n {\n try {\n Database target = (Database) object;\n target.setUserCodeColName( (java.lang.String) value);\n } catch (java.lang.Exception ex) {\n throw new IllegalStateException(ex.toString());\n }\n }\n public java.lang.Object newInstance(java.lang.Object parent) {\n return null;\n }\n };\n desc.setSchemaType(\"string\");\n desc.setHandler(handler);\n desc.setRequired(true);\n desc.setMultivalued(false);\n addFieldDescriptor(desc);\n \n //-- validation code for: _userCodeColName\n fieldValidator = new org.exolab.castor.xml.FieldValidator();\n fieldValidator.setMinOccurs(1);\n { //-- local scope\n org.exolab.castor.xml.validators.StringValidator typeValidator;\n typeValidator = new org.exolab.castor.xml.validators.StringValidator();\n fieldValidator.setValidator(typeValidator);\n typeValidator.setWhiteSpace(\"preserve\");\n }\n desc.setValidator(fieldValidator);\n //-- _userNameColName\n desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, \"_userNameColName\", \"userNameColName\", org.exolab.castor.xml.NodeType.Attribute);\n desc.setImmutable(true);\n handler = new org.exolab.castor.xml.XMLFieldHandler() {\n public java.lang.Object getValue( java.lang.Object object ) \n throws IllegalStateException\n {\n Database target = (Database) object;\n return target.getUserNameColName();\n }\n public void setValue( java.lang.Object object, java.lang.Object value) \n throws IllegalStateException, IllegalArgumentException\n {\n try {\n Database target = (Database) object;\n target.setUserNameColName( (java.lang.String) value);\n } catch (java.lang.Exception ex) {\n throw new IllegalStateException(ex.toString());\n }\n }\n public java.lang.Object newInstance(java.lang.Object parent) {\n return null;\n }\n };\n desc.setSchemaType(\"string\");\n desc.setHandler(handler);\n desc.setRequired(true);\n desc.setMultivalued(false);\n addFieldDescriptor(desc);\n \n //-- validation code for: _userNameColName\n fieldValidator = new org.exolab.castor.xml.FieldValidator();\n fieldValidator.setMinOccurs(1);\n { //-- local scope\n org.exolab.castor.xml.validators.StringValidator typeValidator;\n typeValidator = new org.exolab.castor.xml.validators.StringValidator();\n fieldValidator.setValidator(typeValidator);\n typeValidator.setWhiteSpace(\"preserve\");\n }\n desc.setValidator(fieldValidator);\n //-- _passwordColName\n desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, \"_passwordColName\", \"passwordColName\", org.exolab.castor.xml.NodeType.Attribute);\n desc.setImmutable(true);\n handler = new org.exolab.castor.xml.XMLFieldHandler() {\n public java.lang.Object getValue( java.lang.Object object ) \n throws IllegalStateException\n {\n Database target = (Database) object;\n return target.getPasswordColName();\n }\n public void setValue( java.lang.Object object, java.lang.Object value) \n throws IllegalStateException, IllegalArgumentException\n {\n try {\n Database target = (Database) object;\n target.setPasswordColName( (java.lang.String) value);\n } catch (java.lang.Exception ex) {\n throw new IllegalStateException(ex.toString());\n }\n }\n public java.lang.Object newInstance(java.lang.Object parent) {\n return null;\n }\n };\n desc.setSchemaType(\"string\");\n desc.setHandler(handler);\n desc.setMultivalued(false);\n addFieldDescriptor(desc);\n \n //-- validation code for: _passwordColName\n fieldValidator = new org.exolab.castor.xml.FieldValidator();\n { //-- local scope\n org.exolab.castor.xml.validators.StringValidator typeValidator;\n typeValidator = new org.exolab.castor.xml.validators.StringValidator();\n fieldValidator.setValidator(typeValidator);\n typeValidator.setWhiteSpace(\"preserve\");\n }\n desc.setValidator(fieldValidator);\n //-- _defaultUserCode\n desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, \"_defaultUserCode\", \"defaultUserCode\", org.exolab.castor.xml.NodeType.Attribute);\n desc.setImmutable(true);\n handler = new org.exolab.castor.xml.XMLFieldHandler() {\n public java.lang.Object getValue( java.lang.Object object ) \n throws IllegalStateException\n {\n Database target = (Database) object;\n return target.getDefaultUserCode();\n }\n public void setValue( java.lang.Object object, java.lang.Object value) \n throws IllegalStateException, IllegalArgumentException\n {\n try {\n Database target = (Database) object;\n target.setDefaultUserCode( (java.lang.String) value);\n } catch (java.lang.Exception ex) {\n throw new IllegalStateException(ex.toString());\n }\n }\n public java.lang.Object newInstance(java.lang.Object parent) {\n return null;\n }\n };\n desc.setSchemaType(\"string\");\n desc.setHandler(handler);\n desc.setMultivalued(false);\n addFieldDescriptor(desc);\n \n //-- validation code for: _defaultUserCode\n fieldValidator = new org.exolab.castor.xml.FieldValidator();\n { //-- local scope\n org.exolab.castor.xml.validators.StringValidator typeValidator;\n typeValidator = new org.exolab.castor.xml.validators.StringValidator();\n fieldValidator.setValidator(typeValidator);\n typeValidator.setWhiteSpace(\"preserve\");\n }\n desc.setValidator(fieldValidator);\n //-- _defaultUserPass\n desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, \"_defaultUserPass\", \"defaultUserPass\", org.exolab.castor.xml.NodeType.Attribute);\n desc.setImmutable(true);\n handler = new org.exolab.castor.xml.XMLFieldHandler() {\n public java.lang.Object getValue( java.lang.Object object ) \n throws IllegalStateException\n {\n Database target = (Database) object;\n return target.getDefaultUserPass();\n }\n public void setValue( java.lang.Object object, java.lang.Object value) \n throws IllegalStateException, IllegalArgumentException\n {\n try {\n Database target = (Database) object;\n target.setDefaultUserPass( (java.lang.String) value);\n } catch (java.lang.Exception ex) {\n throw new IllegalStateException(ex.toString());\n }\n }\n public java.lang.Object newInstance(java.lang.Object parent) {\n return null;\n }\n };\n desc.setSchemaType(\"string\");\n desc.setHandler(handler);\n desc.setMultivalued(false);\n addFieldDescriptor(desc);\n \n //-- validation code for: _defaultUserPass\n fieldValidator = new org.exolab.castor.xml.FieldValidator();\n { //-- local scope\n org.exolab.castor.xml.validators.StringValidator typeValidator;\n typeValidator = new org.exolab.castor.xml.validators.StringValidator();\n fieldValidator.setValidator(typeValidator);\n typeValidator.setWhiteSpace(\"preserve\");\n }\n desc.setValidator(fieldValidator);\n //-- initialize element descriptors\n \n }", "private TableInformation readTable(String tablePath, Component parent)\n {\n // Read the table's data from the database\n TableInformation tableInfo = dbTable.loadTableData(tablePath,\n false,\n false,\n false,\n false,\n parent);\n\n // Check that the data was successfully loaded from the database and\n // that the table isn't empty\n if (!tableInfo.isErrorFlag() && tableInfo.getData().length != 0)\n {\n // Get the table's type definition\n TypeDefinition typeDefn = tableTypeHandler.getTypeDefinition(tableInfo.getType());\n\n // Get the data and place it in an array for reference below. Add\n // columns to contain the table type and path\n String[][] data = CcddUtilities.appendArrayColumns(tableInfo.getData(), 2);\n int typeColumn = data[0].length - TYPE_COLUMN_DELTA;\n int pathColumn = data[0].length - PATH_COLUMN_DELTA;\n\n // Get the index of the column containing the data type for this\n // table if it has one\n int dataTypeColumn = typeDefn.getColumnIndexByInputType(InputDataType.PRIM_AND_STRUCT);\n\n // Step through each row\n for (int row = 0; row < data.length && !tableInfo.isErrorFlag(); row++)\n {\n // Use the index column to store the table path and type for\n // reference during script execution\n data[row][typeColumn] = tableInfo.getType();\n data[row][pathColumn] = tablePath;\n\n // Store the data from the table in the combined storage array\n combinedData = CcddUtilities.concatenateArrays(combinedData,\n new String[][] {data[row]});\n\n // Check if this is a table reference (a data type column was\n // found and it does not contain a primitive data type)\n if (dataTypeColumn != -1\n && !dataTypeHandler.isPrimitive(data[row][dataTypeColumn]))\n {\n // Get the column containing the variable name for this\n // table\n int varNameColumn = typeDefn.getColumnIndexByInputType(InputDataType.VARIABLE);\n\n // Check that a variable name column was found\n if (varNameColumn != -1)\n {\n // Get the column containing the array size for this\n // table\n int arraySizeColumn = typeDefn.getColumnIndexByInputType(InputDataType.ARRAY_INDEX);\n\n // Check if the data type or variable name isn't blank,\n // and if an array size column doesn't exist or that\n // the row doesn't reference an array definition. This\n // is necessary to prevent appending the prototype\n // information for this data type structure\n if ((!data[row][dataTypeColumn].isEmpty()\n || !data[row][varNameColumn].isEmpty())\n && (arraySizeColumn == -1\n || data[row][arraySizeColumn].isEmpty()\n || ArrayVariable.isArrayMember(data[row][varNameColumn])))\n {\n // Get the variable in the format\n // dataType.variableName, prepend a comma to\n // separate the new variable from the preceding\n // variable path, then break down the child table\n readTable(tablePath\n + \",\"\n + data[row][dataTypeColumn]\n + \".\"\n + data[row][varNameColumn],\n parent);\n }\n }\n // Table has no variable name column\n else\n {\n tableInfo.setErrorFlag();\n break;\n }\n }\n }\n }\n\n return tableInfo;\n }", "public String getTableName() {\n return tableName; \n }", "public String getTableName() {\n return tableName;\n }", "public String getTableName() {\n return tableName;\n }", "public Long getTABLE_ID() {\n return TABLE_ID;\n }", "com.google.protobuf.ByteString getColumnBytes();", "public RecordLedgerTable getLedgerTable();", "public String createTable() {\n\n String statement = \"CREATE TABLE \" + tableName + \"( \";\n\n //go through INTEGER, FLOAT, TEXT columns\n Iterator iterator = Iterables.filter(columns.entrySet(), entry -> entry.getValue().getType() instanceof String).iterator();\n\n while (iterator.hasNext()) {\n Map.Entry<Element, FieldData> fieldDataEntry = (Map.Entry<Element, FieldData>) iterator.next();\n statement += fieldDataEntry.getValue().createColumn() + \",\";\n }\n\n return (new StringBuilder(statement).replace(statement.length() - 1, statement.length(), \"\").toString() + \")\").toUpperCase();\n }", "public String getTableName() {\r\n return IDaoConstants.TABLE_PROD_PTOS_VTA;\r\n }", "public String getCreateTemporaryTableString() {\n \t\treturn \"create table\";\n \t}", "public String getDBTableName()\n\t{\n\t\treturn this.getClass().getSimpleName();\n\t}", "public String getDropTemporaryTableString() {\n \t\treturn \"drop table\";\n \t}", "@Override\n\tprotected String getTableName() {\n\t\treturn super.getTableName();\n\t}", "public String getTableName() {\n return tableName;\n }", "public String getTableName() {\n return tableName;\n }", "public Table() {\n this.tableName = \"\";\n this.rows = new HashSet<>();\n this.columnsDefinedOrder = new ArrayList<>();\n }", "public static String help() {\n return \" > create table <table_name> (attr_name type [, attr_name type]+);\\n\" +\n \"To create a new table with name 'table_name' and as many attributes as\\n\" +\n \"required, each of them with a given name 'attr_name' and type 'type'\\n\";\n }", "public Double getTableBase() {\r\n return tableBase;\r\n }", "public String getTranslatedTableName()\n {\n return DBProvider.translateTableName(this.getUntranslatedTableName());\n }" ]
[ "0.74475163", "0.7431344", "0.7371933", "0.71620256", "0.71397096", "0.71138537", "0.6741291", "0.65075934", "0.6456192", "0.631427", "0.6134392", "0.60476315", "0.59718055", "0.59120697", "0.5890592", "0.5845741", "0.58157367", "0.57803476", "0.57779574", "0.57536817", "0.5753472", "0.5753472", "0.57533956", "0.5646736", "0.5630409", "0.5579156", "0.5571255", "0.5568836", "0.5522134", "0.550687", "0.5491215", "0.54731154", "0.5473102", "0.54718155", "0.5460689", "0.54350716", "0.5423841", "0.5422625", "0.5413487", "0.5386665", "0.53766805", "0.5375794", "0.5367296", "0.5367198", "0.5356452", "0.53550845", "0.53406894", "0.53371304", "0.5332585", "0.5332516", "0.5312355", "0.5290613", "0.5290613", "0.527674", "0.5264153", "0.5263829", "0.52618855", "0.52617157", "0.5259113", "0.5253211", "0.525156", "0.525156", "0.5246722", "0.5246112", "0.52270836", "0.52253836", "0.5220485", "0.52177507", "0.5214322", "0.5212631", "0.52056015", "0.5187545", "0.51841635", "0.5180383", "0.51592094", "0.51410794", "0.5140266", "0.5123224", "0.5119329", "0.5113925", "0.5112865", "0.5109842", "0.50960064", "0.50922984", "0.50922984", "0.50922376", "0.5090076", "0.5083503", "0.508021", "0.50747025", "0.5069967", "0.5069351", "0.5067933", "0.506547", "0.5063581", "0.5063581", "0.50589734", "0.5053824", "0.5041856", "0.5040647" ]
0.7471167
0
see DbFile.java for javadocs
public Page readPage(PageId pid) { // some code goes here return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public File getInputDb();", "public File getOutputDb();", "private String getFileTableQuery() {\n \t\tfinal StringBuilder builder = new StringBuilder();\n \n \t\tbuilder.append(\"create table FILE(\");\n \t\tbuilder.append(\"FILE_ID LONG PRIMARY KEY,\");\n \t\tbuilder.append(\"FILE_PATH TEXT,\");\n \t\tbuilder.append(\"START_REVISION_ID LONG,\");\n \t\tbuilder.append(\"END_REVISION_ID LONG\");\n \t\tbuilder.append(\")\");\n \n \t\treturn builder.toString();\n \t}", "public String getDatabaseFileName();", "public FileDatabase(String filename) throws IOException {\n\t\tdatabase = new File(filename);\n\t\tread();\n\t}", "public synchronized void writeFromFileIntoDB()throws IOWrapperException, IOIteratorException{\r\n \r\n fromFile_Name=Controller.CLASSES_TMP_FILENAME;\r\n iow_ReadFromFile = new IOWrapper();\r\n \r\n //System.out.println(\"Readin' from \"+fromFile_Name);\r\n \r\n iow_ReadFromFile.setupInput(fromFile_Name,0);\r\n \r\n iter_ReadFromFile = iow_ReadFromFile.getLineIterator();\r\n iow_ReadFromFile.setupOutput(this.dbname,this.username,this.password,this.hostname,this.port);\r\n \r\n iow_ReadFromFile.sendOutputQuery(\"DROP TABLE IF EXISTS \"+outtable);\r\n \r\n iow_ReadFromFile.sendOutputQuery(\r\n \"CREATE TABLE IF NOT EXISTS \"\r\n +outtable+\" (\"\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[0]+\" int(10) NOT NULL AUTO_INCREMENT, \"//wort_nr\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[1]+\" varchar(225), \"//wort_alph\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[2]+\" int(10), \"//krankheit \r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[3]+\" int(10), \"//farbe1 \r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[4]+\" real(8,2), \"//farbe1prozent\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[5]+\" int(10), \"//farbe2\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[6]+\" real(8,2), \"//farbe2prozent\r\n +\"PRIMARY KEY (\"+Controller.COLUMN_NAMES_FOR_DB_OUT[0]+\")) \"\r\n +\"ENGINE=MyISAM\"\r\n );\r\n while(iter_ReadFromFile.hasNext()){\r\n singleProgress+=1;\r\n String[] data = (String[])iter_ReadFromFile.next();\r\n \r\n //System.out.println(\"--> processing line \"+data);\r\n //escape quotes ' etc for SQL query\r\n if(data[1].matches(\".*'.*\")||data[1].matches(\".*\\\\.*\")){\r\n int sl = data[1].length();\r\n String escapedString = \"\";\r\n \r\n for (int i = 0; i < sl; i++) {\r\n char ch = data[1].charAt(i);\r\n switch (ch) {\r\n case '\\'':\r\n escapedString +='\\\\';\r\n escapedString +='\\'';\r\n break;\r\n case '\\\\':\r\n escapedString +='\\\\';\r\n escapedString +='\\\\';\r\n break;\r\n default :\r\n escapedString +=ch;\r\n break;\r\n }\r\n }\r\n data[1]=escapedString;\r\n }\r\n \r\n String insertStatement=\"INSERT INTO \"\r\n +outtable+\" (\"\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[0]+\", \"//node id\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[1]+\", \"//label\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[2]+\", \"//class id \r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[3]+\", \"//class id 1 \r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[4]+\", \"//percent\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[5]+\", \"//class id 2\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[6]+\") \"//percent \r\n +\"VALUES ('\"\r\n +data[0]+\"', '\"\r\n +data[1]+\"', '\"\r\n +data[2]+\"', '\"\r\n +data[3]+\"', '\"\r\n +data[4]+\"', '\"\r\n +data[5]+\"', '\"\r\n +data[6]+\"')\";\r\n \r\n //System.out.println(\"Sending insert statement:\"+insertStatement);\r\n iow_ReadFromFile.sendOutputQuery(insertStatement);\r\n }\r\n \r\n \r\n //iow_ReadFromFile.closeOutput();\r\n \r\n this.stillWorks=false;\r\n writeIntoDB=false;\r\n System.out.println(\"*\\tData written into database.\");\r\n\t}", "interface DataTableFile extends TableDataSource {\n\n /**\n * Creates a new file of the given table. The table is initialised and\n * contains 0 row entries. If the table already exists in the database then\n * this will throw an exception.\n * <p>\n * On exit, the object will be initialised and loaded with the given table.\n *\n * @param def the definition of the table.\n */\n void create(DataTableDef def) throws IOException;\n\n /**\n * Updates a file of the given table. If the table does not exist, then it\n * is created. If the table already exists but is different, then the\n * existing table is modified to incorporate the new fields structure.\n * <p>\n * The DataTableFile must have previously been 'load(table_name)' before\n * this call.\n * <p>\n * Implementations of this method may choose to reorganise information that\n * the relational schemes are dependant on (the row order for example). If\n * this method returns 'true' then we must also reindex the schemes.\n * <p>\n * <strong>NOTE:</strong> If the new format has columns that are not\n * included in the new format then the columns are deleted.\n *\n * @param def the definition of the table.\n * @return true if the table topology has changed.\n */\n boolean update(DataTableDef def) throws IOException;\n\n /**\n * This is called periodically when this data table file requires some\n * maintenance. It is recommended that this method is called every\n * time the table is initialized (loaded).\n * <p>\n * The DataTableFile must have previously been 'load(table_name)' before\n * this call.\n * <p>\n * This method may change the topology of the rows (delete rows that are\n * marked as deleted), therefore if the method returns true you need to\n * re-index the schemes.\n *\n * @return true if the table topology was changed.\n */\n boolean doMaintenance() throws IOException;\n\n// /**\n// * A recovery method that returns a DataTableDef object for this data\n// * table file that was last used in a call to 'create' or 'update'. This\n// * information should be kept in a secondary table topology store but it\n// * is useful to keep this information in the data table file just incase\n// * something bad happens, or tables are moved to another database.\n// */\n// DataTableDef recoverLastDataTableDef() throws IOException;\n\n /**\n * Loads a previously created table. A table can be loaded in read only\n * mode, in which case any methods that write to the DataTableFile will\n * throw an IOException.\n *\n * @param table_name the name of the table.\n * @param read_only if true then the table file is opened as read-only.\n */\n void load(String table_name, boolean read_only) throws IOException;\n\n /**\n * Shuts down the table. This is called when the table is closed and the\n * resources it uses are to be freed back to the system. This is called\n * as part of the database shut down procedure or called when we want to\n * free the resources associated with this table.\n */\n void shutdown() throws IOException;\n\n /**\n * Deletes the data table file in the file system. This is used to clear\n * up resources after a table has been dropped. The table must be shut\n * down before this method is called.\n * <p>\n * NOTE: Use this with care. All data is lost!\n */\n void drop();\n\n /**\n * Flushes all information that may be cached in memory to disk. This\n * includes any relational data, any cached data that hasn't made it to\n * the file system yet. It will write out all persistant information\n * and leave the table in a state where it is fully represented in the\n * file system.\n */\n void updateFile() throws IOException;\n\n /**\n * Locks the data in the file to prevent the system overwritting entries\n * that have been marked as removed. This is necessary so we may still\n * safely read removed entries from the table while the table is locked.\n */\n void addRowsLock();\n\n /**\n * Unlocks the data in the file to indicate that the system may safely\n * overwrite removed entries in the file.\n */\n void removeRowsLock();\n\n /**\n * Returns true if the file currently has all of its rows locked.\n */\n boolean hasRowsLocked();\n\n// /**\n// * The number of rows that are currently stored in this table. This number\n// * does not include the rows that have been marked as removed.\n// */\n// int rowCount();\n\n /**\n * Returns true if the given row index points to a valid and available\n * row entry. Returns false if the row entry has been marked as removed,\n * or the index goes outside the bounds of the table.\n */\n boolean isRowValid(int record_index) throws IOException;\n\n /**\n * Adds a complete new row into the table. If the table is in a row locked\n * state, then this will always add a new entry to the end of the table.\n * Otherwise, new entries are added where entries were previously removed.\n * <p>\n * This will update any column indices that are set.\n *\n */\n int addRow(RowData row_data) throws IOException;\n\n /**\n * Removes a row from the table at the given index. This will only mark\n * the entry as removed, and will not actually remove the data. This is\n * because a process is allowed to read the data even after the row has been\n * marked as removed (if the rows have been locked).\n * <p>\n * This will update any column indices that are set.\n *\n * @param row_index the raw row index of the entry to be marked as removed.\n */\n void removeRow(int row_index) throws IOException;\n\n// /**\n// * Returns a DataCell object of the entry at the given column, row\n// * index in the table. This will always work provided there was once data\n// * stored at that index, even if the row has been marked as deleted.\n// */\n// DataCell getCellAt(int column, int row) throws IOException;\n\n /**\n * Returns a unique number. This is incremented each time it is accessed.\n */\n long nextUniqueKey() throws IOException;\n\n}", "public DatabaseFileInformation(byte[] aFileBytes)\n {\n mTables = new LinkedList<>();\n\n mHeader = (short) (((0xFF) & aFileBytes[1]) | (((0xFF) & aFileBytes[0]) << 8));\n mVersion = (short) (((0xFF) & aFileBytes[3]) | (((0xFF) & aFileBytes[2]) << 8));\n mUnknown1 = ((0xFF) & aFileBytes[7]) | (((0xFF) & aFileBytes[6]) << 8) | (((0xFF) & aFileBytes[5]) <<\n 16) | (((0xFF) & aFileBytes[4]) << 24);\n mDatabaseSize = ((0xFF) & aFileBytes[11]) | (((0xFF) & aFileBytes[10]) << 8) | (((0xFF) & aFileBytes[9]) <<\n 16) | (((0xFF) & aFileBytes[8]) << 24);\n mZero = ((0xFF) & aFileBytes[15]) | (((0xFF) & aFileBytes[14]) << 8) | (((0xFF) & aFileBytes[13]) <<\n 16) | (((0xFF) & aFileBytes[12]) << 24);\n mTableCount = ((0xFF) & aFileBytes[19]) | (((0xFF) & aFileBytes[18]) << 8) | (((0xFF) & aFileBytes[17]) <<\n 16) | (((0xFF) & aFileBytes[16]) << 24);\n mUnknown2 = ((0xFF) & aFileBytes[23]) | (((0xFF) & aFileBytes[22]) << 8) | (((0xFF) & aFileBytes[21]) <<\n 16) | (((0xFF) & aFileBytes[20]) << 24);\n\n int lTableDefinitionPosition = 24;\n int lTableDataStart = lTableDefinitionPosition + (mTableCount * 8);\n\n // Read the table definitions.\n for (int i = 0; i < mTableCount; i++)\n {\n DatabaseTable lDatabaseTable = new DatabaseTable();\n lDatabaseTable.readTableDefinition(aFileBytes, lTableDefinitionPosition);\n lDatabaseTable.readTableHeader(aFileBytes, lTableDataStart);\n mTables.add(lDatabaseTable);\n lTableDefinitionPosition += 8;\n }\n }", "public interface DatabaseManager {\r\n\r\n // NOTE: this is a draft of the interface. More methods will likely be\r\n // added.\r\n\r\n /**\r\n * Uploads the specified feature to the database.\r\n * \r\n * @param file the shapefile (*.shp) to upload\r\n * @param project the project to associate the shapefile with\r\n * @return the id of the feature in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadFeature(File file, String project) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified modis tile to the database.\r\n * \r\n * @param file the .hdf to upload\r\n * @param product the modis product\r\n * @param date the date the data was captured\r\n * @param downloaded the date the data was downloaded from the host\r\n * @param horz the horizontal tile number\r\n * @param vert the vertical tile number\r\n * @return the id of the Modis raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadModis(File file, ModisProduct product, DataDate date, DataDate updated, int horz, int vert) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified ETo file to the database.\r\n * \r\n * @param file the\r\n * @param date\r\n * @param updated\r\n * @return the id of the ETo raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadEto(File file, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified TRMM file to the database.\r\n * \r\n * @param file\r\n * @param date\r\n * @param updated\r\n * @return the id of the TRMM raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadTrmm(File file, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified projected Modis product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param product\r\n * @param date\r\n * @param updated\r\n * @return the id of the projected Modis raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadProjectedModis(File file, String project, ModisProduct product, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified projected ETo product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the projected ETo raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadProjectedEto(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the projected TRMM product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the TRMM raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadProjectedTrmm(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified ETa product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the ETa raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadEta(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified EVI product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the EVI raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadEvi(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified NDVI product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the NDVI raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadNdvi(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified NDWI5 product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the NDWI5 raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadNdwi5(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified NDWI6 product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the NDWI6 raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadNdwi6(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified SAVI product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the SAVI raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadSavi(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified feature and places it in the specified file in\r\n * the shapefile.\r\n * \r\n * @param file the location to save the feature\r\n * @param id the id of the feature\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadFeature(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified Modis tile from the database.\r\n * \r\n * @param file\r\n * @param product\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadModis(File file, ModisProduct product, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified ETo raster from the database and saves it to the\r\n * specified file.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadEto(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified TRMM raster from the database and saves it to the\r\n * specified file.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadTrmm(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified projected Modis product from the database.\r\n * \r\n * @param file\r\n * @param product\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadProjectedModis(File file, ModisProduct product, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified projected ETo product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadProjectedEto(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified projected TRMM product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadProjectedTrmm(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified ETa product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadEta(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified EVI product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadEvi(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified NDVI product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadNdvi(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified NDWI5 product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadNdwi5(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified NDWI6 product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadNdwi6(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified SAVI product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadSavi(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Returns the id of the MODIS raster for the specified product and date.\r\n * \r\n * @param product\r\n * @param date\r\n * @param horz\r\n * @param vert\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getModisId(ModisProduct product, DataDate date, int horz, int vert) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the ETo for the specified date.\r\n * \r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getEtoId(DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the TRMM for the specified date.\r\n * \r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getTrmmId(DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the reprojected Modis raster for the specified\r\n * project, product, and date.\r\n * \r\n * @param project\r\n * @param product\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getReprojectedModisId(String project, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the reprojected ETo raster for the specified project\r\n * and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getReprojectedEtoId(String project, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the reprojected TRMM raster for the specified project\r\n * and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getReprojectedTrmmId(String project, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the ETa raster for the specified project and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getEtaId(String project, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the EVI raster for the specified project and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getEviId(String project, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the NDVI raster for the specified project and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getNdviId(String project, String feature, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the NDWI5 raster for the specified project and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getNdwi5Id(String project, String feature, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the NDWI6 raster for the specified project and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getNdwi6Id(String project, String feature, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the SAVI raster for the specified project and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getSaviId(String project, String feature, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Uploads the specified zonal statistics.\r\n * \r\n * @param project\r\n * @param feature\r\n * @param zoneField\r\n * @param zone\r\n * @param date\r\n * @param index\r\n * @param zonalStatistics\r\n */\r\n void uploadZonalStatistic(String project, String feature, String zoneField,\r\n String zone, DataDate date, EnvironmentalIndex index,\r\n ZonalStatistic zonalStatistics) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the zonal statistics for the specified parameters.\r\n * \r\n * @param project\r\n * @param feature\r\n * @param zoneField\r\n * @param zone\r\n * @param date\r\n * @param index\r\n * @return the id or -1 if it is not found\r\n */\r\n int getZonalStatisticId(String project, String feature, String zoneField,\r\n String zone, DataDate date, EnvironmentalIndex index)\r\n throws SQLException;\r\n\r\n /**\r\n * Returns zonal statistics for the specified zonal statistic id.\r\n * \r\n * @param id\r\n * @return zonal statistics\r\n * @throws SQLException\r\n */\r\n ZonalStatistic getZonalStatistic(int id) throws SQLException;\r\n}", "public abstract String apachedb(int size);", "public void createDB() {\n\t\ttry {\n\t\t\tBufferedReader br= new BufferedReader(new FileReader(\"db_schema.txt\"));\n\t\t\tString line= null;\n\t\t\tStringBuilder sb= new StringBuilder();\n\t\t\twhile ((line=br.readLine())!=null){\n\t\t\t\tsb.append(line);\n\t\t\t\tif(sb.length()>0 && sb.charAt(sb.length()-1)==';'){//see if it is the end of one line of command\n\t\t\t\t\tstatement.executeUpdate(sb.toString());\n\t\t\t\t\tsb= new StringBuilder();\n\t\t\t\t}\n\t\t\t}\n\t\t\tbr.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public String getPath() { return db.getPath(); }", "String getUserDatabaseFilePath();", "public abstract ODatabaseInternal<?> openDatabase();", "private DBManager() throws Exception {\n file = new File(\"pdfLibraryDB.mv.db\");\n if (!file.exists()) {\n conn = connect();\n stmt = conn.createStatement();\n query = \"CREATE TABLE user(username VARCHAR(30) PRIMARY KEY, password VARCHAR(32));\" +\n \"CREATE TABLE category(id VARCHAR(30) PRIMARY KEY, name VARCHAR(30), username VARCHAR(30), FOREIGN KEY(username) REFERENCES user(username) ON UPDATE CASCADE ON DELETE CASCADE);\"+\n \"CREATE TABLE favorite(id VARCHAR(30) PRIMARY KEY, path VARCHAR(500), keyword VARCHAR(200), searchType VARCHAR(10), category VARCHAR(30),username VARCHAR(30), FOREIGN KEY(username) REFERENCES user(username) ON UPDATE CASCADE ON DELETE CASCADE, FOREIGN KEY(category) REFERENCES category(id) ON UPDATE CASCADE ON DELETE CASCADE);\" +\n \"CREATE TABLE history(id VARCHAR(30) PRIMARY KEY, keyword VARCHAR(200), type VARCHAR(10), directory VARCHAR(500), username VARCHAR(30), FOREIGN KEY(username) REFERENCES user(username) ON UPDATE CASCADE ON DELETE CASCADE);\";\n stmt.executeUpdate(query);\n stmt.close();\n conn.close();\n System.out.println(\"DB created!\");\n }\n }", "@Test\n public void reading()\n throws FileNotFoundException, IOException, CorruptedTableException\n {\n final Database database =\n new Database(new File(\"src/test/resources/\" + versionDirectory + \"/rndtrip\"), version);\n final Set<String> tableNames = database.getTableNames();\n\n assertEquals(2,\n tableNames.size());\n assertTrue(\"TABLE1 not found in 'short roundtrip' database\",\n tableNames.contains(\"TABLE1.DBF\"));\n assertTrue(\"TABLE2 not found in 'short roundtrip' database\",\n tableNames.contains(\"TABLE2.DBF\"));\n\n final Table t1 = database.getTable(\"TABLE1.DBF\");\n\n try\n {\n t1.open(IfNonExistent.ERROR);\n\n assertEquals(\"Table name incorrect\",\n \"TABLE1.DBF\",\n t1.getName());\n assertEquals(\"Last modified date incorrect\",\n Util.createDate(2009, Calendar.APRIL, 1),\n t1.getLastModifiedDate());\n\n final List<Field> fields = t1.getFields();\n\n Iterator<Field> fieldIterator = fields.iterator();\n Map<String, Field> nameFieldMap = new HashMap<String, Field>();\n\n while (fieldIterator.hasNext())\n {\n Field f = fieldIterator.next();\n nameFieldMap.put(f.getName(),\n f);\n }\n\n final Field idField = nameFieldMap.get(\"ID\");\n assertEquals(Type.NUMBER,\n idField.getType());\n assertEquals(idField.getLength(),\n 3);\n\n final Field stringField = nameFieldMap.get(\"STRFIELD\");\n assertEquals(Type.CHARACTER,\n stringField.getType());\n assertEquals(stringField.getLength(),\n 50);\n\n final Field logicField = nameFieldMap.get(\"LOGICFIELD\");\n assertEquals(Type.LOGICAL,\n logicField.getType());\n assertEquals(logicField.getLength(),\n 1);\n\n final Field dateField = nameFieldMap.get(\"DATEFIELD\");\n assertEquals(Type.DATE,\n dateField.getType());\n assertEquals(8,\n dateField.getLength());\n\n final Field floatField = nameFieldMap.get(\"FLOATFIELD\");\n assertEquals(Type.NUMBER,\n floatField.getType());\n assertEquals(10,\n floatField.getLength());\n\n final List<Record> records = UnitTestUtil.createSortedRecordList(t1.recordIterator(),\n \"ID\");\n final Record r0 = records.get(0);\n\n assertEquals(1,\n r0.getNumberValue(\"ID\"));\n assertEquals(\"String data 01\",\n r0.getStringValue(\"STRFIELD\").trim());\n assertEquals(true,\n r0.getBooleanValue(\"LOGICFIELD\"));\n assertEquals(Util.createDate(1909, Calendar.MARCH, 18),\n r0.getDateValue(\"DATEFIELD\"));\n assertEquals(1234.56,\n r0.getNumberValue(\"FLOATFIELD\"));\n\n final Record r1 = records.get(1);\n\n assertEquals(2,\n r1.getNumberValue(\"ID\"));\n assertEquals(\"String data 02\",\n r1.getStringValue(\"STRFIELD\").trim());\n\n /*\n * in Clipper 'false' value can be given as an empty field, and the method called here\n * returns then 'null' as the return value\n */\n if (version == Version.CLIPPER_5)\n {\n assertEquals(null,\n r1.getBooleanValue(\"LOGICFIELD\"));\n }\n else\n {\n assertEquals(false,\n r1.getBooleanValue(\"LOGICFIELD\"));\n }\n\n assertEquals(Util.createDate(1909, Calendar.MARCH, 20),\n r1.getDateValue(\"DATEFIELD\"));\n assertEquals(-23.45,\n r1.getNumberValue(\"FLOATFIELD\"));\n\n final Record r2 = records.get(2);\n\n assertEquals(3,\n r2.getNumberValue(\"ID\"));\n assertEquals(\"\",\n r2.getStringValue(\"STRFIELD\").trim());\n assertEquals(null,\n r2.getBooleanValue(\"LOGICFIELD\"));\n assertEquals(null,\n r2.getDateValue(\"DATEFIELD\"));\n assertEquals(null,\n r2.getNumberValue(\"FLOATFIELD\"));\n\n final Record r3 = records.get(3);\n\n assertEquals(4,\n r3.getNumberValue(\"ID\"));\n assertEquals(\"Full5678901234567890123456789012345678901234567890\",\n r3.getStringValue(\"STRFIELD\").trim());\n\n /*\n * in Clipper 'false' value can be given as an empty field, and the method called here\n * returns then 'null' as the return value\n */\n if (version == Version.CLIPPER_5)\n {\n assertEquals(null,\n r3.getBooleanValue(\"LOGICFIELD\"));\n }\n else\n {\n assertEquals(false,\n r3.getBooleanValue(\"LOGICFIELD\"));\n }\n\n assertEquals(Util.createDate(1909, Calendar.MARCH, 20),\n r3.getDateValue(\"DATEFIELD\"));\n assertEquals(-0.30,\n r3.getNumberValue(\"FLOATFIELD\"));\n }\n finally\n {\n t1.close();\n }\n\n final Table t2 = database.getTable(\"TABLE2.DBF\");\n\n try\n {\n t2.open(IfNonExistent.ERROR);\n\n final List<Field> fields = t2.getFields();\n\n Iterator<Field> fieldIterator = fields.iterator();\n Map<String, Field> nameFieldMap = new HashMap<String, Field>();\n\n while (fieldIterator.hasNext())\n {\n Field f = fieldIterator.next();\n nameFieldMap.put(f.getName(),\n f);\n }\n\n final Field idField = nameFieldMap.get(\"ID2\");\n assertEquals(Type.NUMBER,\n idField.getType());\n assertEquals(idField.getLength(),\n 4);\n\n final Field stringField = nameFieldMap.get(\"MEMOFIELD\");\n assertEquals(Type.MEMO,\n stringField.getType());\n assertEquals(10,\n stringField.getLength());\n\n final Iterator<Record> recordIterator = t2.recordIterator();\n final Record r = recordIterator.next();\n\n String declarationOfIndependence = \"\";\n\n declarationOfIndependence += \"When in the Course of human events it becomes necessary for one people \";\n declarationOfIndependence += \"to dissolve the political bands which have connected them with another and \";\n declarationOfIndependence += \"to assume among the powers of the earth, the separate and equal station to \";\n declarationOfIndependence += \"which the Laws of Nature and of Nature's God entitle them, a decent respect \";\n declarationOfIndependence += \"to the opinions of mankind requires that they should declare the causes which \";\n declarationOfIndependence += \"impel them to the separation.\";\n declarationOfIndependence += \"\\r\\n\\r\\n\";\n declarationOfIndependence += \"We hold these truths to be self-evident, that all men are created equal, \";\n declarationOfIndependence += \"that they are endowed by their Creator with certain unalienable Rights, \";\n declarationOfIndependence += \"that among these are Life, Liberty and the persuit of Happiness.\";\n\n assertEquals(1,\n r.getNumberValue(\"ID2\"));\n assertEquals(declarationOfIndependence,\n r.getStringValue(\"MEMOFIELD\"));\n }\n finally\n {\n t2.close();\n }\n }", "@Insert({ \"insert into csv_file (id, pid, \", \"filename, start_time, \", \"end_time, length, \", \"density, machine, \",\n\t\t\t\"ar, path, size, \", \"uuid, header_time, \", \"last_update, conflict_resolved, \", \"status, comment, \",\n\t\t\t\"width, start_version, \", \"end_version)\", \"values (#{id,jdbcType=INTEGER}, #{pid,jdbcType=VARCHAR}, \",\n\t\t\t\"#{filename,jdbcType=VARCHAR}, #{startTime,jdbcType=TIMESTAMP}, \",\n\t\t\t\"#{endTime,jdbcType=TIMESTAMP}, #{length,jdbcType=INTEGER}, \",\n\t\t\t\"#{density,jdbcType=DOUBLE}, #{machine,jdbcType=VARCHAR}, \",\n\t\t\t\"#{ar,jdbcType=BIT}, #{path,jdbcType=VARCHAR}, #{size,jdbcType=BIGINT}, \",\n\t\t\t\"#{uuid,jdbcType=CHAR}, #{headerTime,jdbcType=TIMESTAMP}, \",\n\t\t\t\"#{lastUpdate,jdbcType=TIMESTAMP}, #{conflictResolved,jdbcType=BIT}, \",\n\t\t\t\"#{status,jdbcType=INTEGER}, #{comment,jdbcType=VARCHAR}, \",\n\t\t\t\"#{width,jdbcType=INTEGER}, #{startVersion,jdbcType=INTEGER}, \", \"#{endVersion,jdbcType=INTEGER})\" })\n\tint insert(CsvFile record);", "public void database() throws IOException\n {\n \tFile file =new File(\"data.txt\");\n\t if(!file.exists())\n\t {\n\t \tSystem.out.println(\"File 'data.txt' does not exit\");\n\t System.out.println(file.createNewFile());\n\t file.createNewFile();\n\t databaseFileWrite(file);//call the databaseFileRead() method, to initialize data from ArrayList and write data into data.txt\n\t }\n\t else\n\t {\n\t \tdatabaseFileRead();//call the databaseFileRead() method, to load data directly from data.txt\n\t }\n }", "@Override\n\tpublic void CreateDatabaseFromFile() {\n\t\tfinal String FILENAME = \"fandv.sql\";\n\t\tint[] updates = null;\n\t\ttry {\n\t\t\tMyDatabase db = new MyDatabase();\n\t\t\tupdates = db.updateAll(FILENAME);\n\t\t} catch (FileNotFoundException | SQLException | ClassNotFoundException e) {\n\t\t\tSystem.out.println(\"Database issue\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < updates.length; i++) {\n\t\t\tsum += updates[i];\n\t\t}\n\t\tSystem.out.println(\"Number of updates: \" + sum);\n\t}", "public GEMFileRockDao() {\n gemFileDb = RocksDatabase.getInstance(DB_NAME, String.class, GEMFile.class);\n gemFileFileTypesDb =\n RocksDatabase.getInstance(DB_NAME + \"_FileType\", String.class, Integer.class);\n gemFileState = RocksDatabase.getInstance(DB_NAME + \"_FileState\", String.class, String.class);\n gemFileState.put(STATE_SYNC_PROGRESS, String.valueOf(SYNC_COMPLETE));\n }", "public DBInternal(File directory, DBOptions options) {\n this.directory = directory;\n this.options = options;\n // TODO: check options.\n\n // TODO: rebuid index.\n\n // TODO: initialize fileID. Make sure the starting number is the largest number used so far.\n\n // TODO: open a current file writer.\n\n // TODO: start offline compaction.\n\n }", "public final void executeSQL(Connection conn,DbConnVO vo,String fileName) throws Throwable {\r\n PreparedStatement pstmt = null;\r\n StringBuffer sql = new StringBuffer(\"\");\r\n InputStream in = null;\r\n\r\n try {\r\n try {\r\n in = this.getClass().getResourceAsStream(\"/\" + fileName);\r\n }\r\n catch (Exception ex5) {\r\n }\r\n if (in==null)\r\n in = new FileInputStream(org.openswing.swing.util.server.FileHelper.getRootResource() + fileName);\r\n\r\n BufferedReader br = new BufferedReader(new InputStreamReader(in));\r\n String line = null;\r\n ArrayList vals = new ArrayList();\r\n int pos = -1;\r\n String oldfk = null;\r\n String oldIndex = null;\r\n StringBuffer newIndex = null;\r\n StringBuffer newfk = null;\r\n ArrayList fks = new ArrayList();\r\n ArrayList indexes = new ArrayList();\r\n boolean fkFound = false;\r\n boolean indexFound = false;\r\n String defaultValue = null;\r\n int index = -1;\r\n StringBuffer unicode = new StringBuffer();\r\n boolean useDefaultValue = false;\r\n// vo.getDriverName().equals(\"oracle.jdbc.driver.OracleDriver\") ||\r\n// vo.getDriverName().equals(\"com.microsoft.jdbc.sqlserver.SQLServerDriver\") ||\r\n//\t\t\t\t\tvo.getDriverName().equals(\"com.microsoft.sqlserver.jdbc.SQLServerDriver\") ||\r\n// vo.getDriverName().equals(\"com.mysql.jdbc.Driver\");\r\n while ( (line = br.readLine()) != null) {\r\n sql.append(' ').append(line);\r\n if (line.endsWith(\";\")) {\r\n if (vo.getDriverName().equals(\"oracle.jdbc.driver.OracleDriver\")) {\r\n sql = replace(sql, \" VARCHAR(\", \" VARCHAR2(\");\r\n sql = replace(sql, \" NUMERIC(\", \" NUMBER(\");\r\n sql = replace(sql, \" DECIMAL(\", \" NUMBER(\");\r\n sql = replace(sql, \" TIMESTAMP\", \" DATE \");\r\n sql = replace(sql, \" DATETIME\", \" DATE \");\r\n }\r\n else if (vo.getDriverName().equals(\"com.microsoft.jdbc.sqlserver.SQLServerDriver\")) {\r\n sql = replace(sql, \" TIMESTAMP\", \" DATETIME \");\r\n sql = replace(sql, \" DATE \", \" DATETIME \");\r\n }\r\n else if (vo.getDriverName().equals(\"com.microsoft.sqlserver.jdbc.SQLServerDriver\")) {\r\n sql = replace(sql, \" TIMESTAMP\", \" DATETIME \");\r\n sql = replace(sql, \" DATE \", \" DATETIME \");\r\n }\r\n else if (vo.getDriverName().toLowerCase().contains(\"postgres\")) {\r\n sql = replace(sql, \" DATETIME\", \" TIMESTAMP \");\r\n sql = replace(sql, \" DATE \", \" TIMESTAMP \");\r\n }\r\n else {\r\n sql = replace(sql, \" DATE \", \" DATETIME \");\r\n }\r\n\r\n\r\n sql = replace(sql,\"ON DELETE NO ACTION\",\"\");\r\n sql = replace(sql,\"ON UPDATE NO ACTION\",\"\");\r\n\r\n if (sql.indexOf(\":COMPANY_CODE\") != -1) {\r\n sql = replace(sql, \":COMPANY_CODE\", \"'\" + vo.getCompanyCode() + \"'\");\r\n }\r\n if (sql.indexOf(\":COMPANY_DESCRIPTION\") != -1) {\r\n sql = replace(sql, \":COMPANY_DESCRIPTION\",\r\n \"'\" + vo.getCompanyDescription() + \"'\");\r\n }\r\n if (sql.indexOf(\":LANGUAGE_CODE\") != -1) {\r\n sql = replace(sql, \":LANGUAGE_CODE\",\r\n \"'\" + vo.getLanguageCode() + \"'\");\r\n }\r\n if (sql.indexOf(\":LANGUAGE_DESCRIPTION\") != -1) {\r\n sql = replace(sql, \":LANGUAGE_DESCRIPTION\",\r\n \"'\" + vo.getLanguageDescription() + \"'\");\r\n }\r\n if (sql.indexOf(\":CLIENT_LANGUAGE_CODE\") != -1) {\r\n sql = replace(sql, \":CLIENT_LANGUAGE_CODE\",\r\n \"'\" + vo.getClientLanguageCode() + \"'\");\r\n }\r\n if (sql.indexOf(\":PASSWORD\") != -1) {\r\n sql = replace(sql, \":PASSWORD\", \"'\" + vo.getAdminPassword() + \"'\");\r\n }\r\n if (sql.indexOf(\":DATE\") != -1) {\r\n sql = replace(sql, \":DATE\", \"?\");\r\n vals.add(new java.sql.Date(System.currentTimeMillis()));\r\n }\r\n\r\n if (sql.indexOf(\":CURRENCY_CODE\") != -1) {\r\n sql = replace(sql, \":CURRENCY_CODE\", \"'\" + vo.getCurrencyCodeREG03() + \"'\");\r\n }\r\n if (sql.indexOf(\":CURRENCY_SYMBOL\") != -1) {\r\n sql = replace(sql, \":CURRENCY_SYMBOL\", \"'\" + vo.getCurrencySymbolREG03() + \"'\");\r\n }\r\n if (sql.indexOf(\":DECIMALS\") != -1) {\r\n sql = replace(sql, \":DECIMALS\", vo.getDecimalsREG03().toString());\r\n }\r\n if (sql.indexOf(\":DECIMAL_SYMBOL\") != -1) {\r\n sql = replace(sql, \":DECIMAL_SYMBOL\", \"'\" + vo.getDecimalSymbolREG03() + \"'\");\r\n }\r\n if (sql.indexOf(\":THOUSAND_SYMBOL\") != -1) {\r\n sql = replace(sql, \":THOUSAND_SYMBOL\", \"'\" + vo.getThousandSymbolREG03() + \"'\");\r\n }\r\n\r\n if (sql.indexOf(\":USE_VARIANT_TYPE_1\") != -1) {\r\n sql = replace(sql, \":USE_VARIANT_TYPE_1\", \"'\" + vo.getUseVariantType1() + \"'\");\r\n }\r\n if (sql.indexOf(\":USE_VARIANT_TYPE_2\") != -1) {\r\n sql = replace(sql, \":USE_VARIANT_TYPE_2\", \"'\" + vo.getUseVariantType2() + \"'\");\r\n }\r\n if (sql.indexOf(\":USE_VARIANT_TYPE_3\") != -1) {\r\n sql = replace(sql, \":USE_VARIANT_TYPE_3\", \"'\" + vo.getUseVariantType3() + \"'\");\r\n }\r\n if (sql.indexOf(\":USE_VARIANT_TYPE_4\") != -1) {\r\n sql = replace(sql, \":USE_VARIANT_TYPE_4\", \"'\" + vo.getUseVariantType4() + \"'\");\r\n }\r\n if (sql.indexOf(\":USE_VARIANT_TYPE_5\") != -1) {\r\n sql = replace(sql, \":USE_VARIANT_TYPE_5\", \"'\" + vo.getUseVariantType5() + \"'\");\r\n }\r\n\r\n if (sql.indexOf(\":VARIANT_1\") != -1) {\r\n sql = replace(sql, \":VARIANT_1\", \"'\" + (vo.getVariant1()==null || vo.getVariant1().trim().equals(\"\")?ApplicationConsts.JOLLY:vo.getVariant1()) + \"'\");\r\n }\r\n if (sql.indexOf(\":VARIANT_2\") != -1) {\r\n sql = replace(sql, \":VARIANT_2\", \"'\" + (vo.getVariant2()==null || vo.getVariant2().trim().equals(\"\")?ApplicationConsts.JOLLY:vo.getVariant2()) + \"'\");\r\n }\r\n if (sql.indexOf(\":VARIANT_3\") != -1) {\r\n sql = replace(sql, \":VARIANT_3\", \"'\" + (vo.getVariant3()==null || vo.getVariant3().trim().equals(\"\")?ApplicationConsts.JOLLY:vo.getVariant3()) + \"'\");\r\n }\r\n if (sql.indexOf(\":VARIANT_4\") != -1) {\r\n sql = replace(sql, \":VARIANT_4\", \"'\" + (vo.getVariant4()==null || vo.getVariant4().trim().equals(\"\")?ApplicationConsts.JOLLY:vo.getVariant4()) + \"'\");\r\n }\r\n if (sql.indexOf(\":VARIANT_5\") != -1) {\r\n sql = replace(sql, \":VARIANT_5\", \"'\" + (vo.getVariant5()==null || vo.getVariant5().trim().equals(\"\")?ApplicationConsts.JOLLY:vo.getVariant5()) + \"'\");\r\n }\r\n\r\n if (!useDefaultValue)\r\n while((pos=sql.indexOf(\"DEFAULT \"))!=-1) {\r\n defaultValue = sql.substring(pos, sql.indexOf(\",\", pos));\r\n sql = replace(\r\n sql,\r\n defaultValue,\r\n \"\"\r\n );\r\n }\r\n\r\n fkFound = false;\r\n while((pos=sql.indexOf(\"FOREIGN KEY\"))!=-1) {\r\n oldfk = sql.substring(pos,sql.indexOf(\")\",sql.indexOf(\")\",pos)+1)+1);\r\n sql = replace(\r\n sql,\r\n oldfk,\r\n \"\"\r\n );\r\n newfk = new StringBuffer(\"ALTER TABLE \");\r\n newfk.append(sql.substring(sql.indexOf(\" TABLE \")+7,sql.indexOf(\"(\")).trim());\r\n newfk.append(\" ADD \");\r\n newfk.append(oldfk);\r\n fks.add(newfk);\r\n fkFound = true;\r\n }\r\n\r\n if (fkFound)\r\n sql = removeCommasAtEnd(sql);\r\n\r\n indexFound = false;\r\n while((pos=sql.indexOf(\"INDEX \"))!=-1) {\r\n oldIndex = sql.substring(pos,sql.indexOf(\")\",pos)+1);\r\n sql = replace(\r\n sql,\r\n oldIndex,\r\n \"\"\r\n );\r\n newIndex = new StringBuffer(\"CREATE \");\r\n newIndex.append(oldIndex.substring(0,oldIndex.indexOf(\"(\")));\r\n newIndex.append(\" ON \");\r\n newIndex.append(sql.substring(sql.indexOf(\" TABLE \")+7,sql.indexOf(\"(\")).trim());\r\n newIndex.append( oldIndex.substring(oldIndex.indexOf(\"(\")) );\r\n indexes.add(newIndex);\r\n indexFound = true;\r\n }\r\n\r\n if (indexFound)\r\n sql = removeCommasAtEnd(sql);\r\n\r\n // check for unicode chars...\r\n while((index=sql.indexOf(\"\\\\u\"))!=-1) {\r\n for(int i=index+2;i<Math.min(sql.length(),index+2+6);i++)\r\n if (Character.isDigit(sql.charAt(i)) ||\r\n sql.charAt(i)=='A' ||\r\n sql.charAt(i)=='B' ||\r\n sql.charAt(i)=='C' ||\r\n sql.charAt(i)=='D' ||\r\n sql.charAt(i)=='E' ||\r\n sql.charAt(i)=='F')\r\n if (unicode.length() < 4)\r\n unicode.append(sql.charAt(i));\r\n else\r\n break;\r\n if (unicode.length()>0) {\r\n sql.delete(index, index+1+unicode.length());\r\n sql.setCharAt(index, new Character((char)Integer.valueOf(unicode.toString(),16).intValue()).charValue());\r\n unicode.delete(0, unicode.length());\r\n }\r\n }\r\n\r\n\r\n if (sql.toString().toUpperCase().contains(\"DROP TABLE\")) {\r\n // remove fks before dropping table!\r\n String table = sql.toString().toUpperCase().replace('\\n',' ').replace('\\r',' ').trim();\r\n table = table.substring(10).trim();\r\n if (table.endsWith(\";\"))\r\n table = table.substring(0,table.length()-1);\r\n ResultSet rset = conn.getMetaData().getExportedKeys(null,vo.getUsername().toUpperCase(),table);\r\n String fkName = null;\r\n String tName = null;\r\n Statement stmt2 = conn.createStatement();\r\n boolean fksFound = false;\r\n while(rset.next()) {\r\n fksFound = true;\r\n tName = rset.getString(7);\r\n fkName = rset.getString(12);\r\n\r\n if (vo.getDriverName().equals(\"com.mysql.jdbc.Driver\"))\r\n stmt2.execute(\"ALTER TABLE \"+tName+\" DROP FOREIGN KEY \"+fkName);\r\n else\r\n stmt2.execute(\"ALTER TABLE \"+tName+\" DROP CONSTRAINT \"+fkName);\r\n }\r\n try {\r\n rset.close();\r\n }\r\n catch (Exception ex6) {}\r\n\r\n if (!fksFound &&\r\n !vo.getDriverName().equals(\"oracle.jdbc.driver.OracleDriver\") &&\r\n !vo.getDriverName().equals(\"com.microsoft.jdbc.sqlserver.SQLServerDriver\") &&\r\n !vo.getDriverName().equals(\"com.microsoft.sqlserver.jdbc.SQLServerDriver\") &&\r\n !vo.getDriverName().equals(\"com.mysql.jdbc.Driver\")\r\n && !vo.getDriverName().equals(\"org.sqlite.JDBC\")) {\r\n // case postgres...\r\n rset = conn.getMetaData().getExportedKeys(null,null,null);\r\n while(rset.next()) {\r\n if (rset.getString(3).toUpperCase().equals(table)) {\r\n tName = rset.getString(7);\r\n fkName = rset.getString(12);\r\n\r\n if (vo.getDriverName().equals(\"com.mysql.jdbc.Driver\"))\r\n stmt2.execute(\"ALTER TABLE \"+tName+\" DROP FOREIGN KEY \"+fkName);\r\n else\r\n stmt2.execute(\"ALTER TABLE \"+tName+\" DROP CONSTRAINT \"+fkName);\r\n }\r\n }\r\n try {\r\n rset.close();\r\n }\r\n catch (Exception ex6) {}\r\n }\r\n\r\n try {\r\n stmt2.close();\r\n }\r\n catch (Exception ex6) {}\r\n\r\n } // end if\r\n\r\n if (sql.toString().trim().length()>0) {\r\n String query = sql.toString().substring(0,sql.length() - 1);\r\n System.out.println(\"Execute query: \" + query);\r\n pstmt = conn.prepareStatement(query);\r\n for (int i = 0; i < vals.size(); i++) {\r\n pstmt.setObject(i + 1, vals.get(i));\r\n }\r\n\r\n try {\r\n pstmt.execute();\r\n }\r\n catch (SQLException ex4) {\r\n try {\r\n if (sql.toString().toUpperCase().contains(\"DROP TABLE\")) {\r\n//\t\t\t\t\t\t\t\t\tLogger.error(\"NONAME\", this.getClass().getName(), \"executeSQL\",\r\n//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"Invalid SQL: \" + sql, ex4);\r\n }\r\n else\r\n throw ex4;\r\n }\r\n catch (Exception exx4) {\r\n throw ex4;\r\n }\r\n }\r\n pstmt.close();\r\n }\r\n\r\n sql.delete(0, sql.length());\r\n vals.clear();\r\n }\r\n }\r\n br.close();\r\n\r\n for(int i=0;i<fks.size();i++) {\r\n sql = (StringBuffer)fks.get(i);\r\n pstmt = conn.prepareStatement(sql.toString());\r\n try {\r\n pstmt.execute();\r\n }\r\n catch (SQLException ex4) {\r\n Logger.error(\"NONAME\", this.getClass().getName(), \"executeSQL\",\r\n \"Invalid SQL: \" + sql, ex4);\r\n }\r\n pstmt.close();\r\n }\r\n\r\n for(int i=0;i<indexes.size();i++) {\r\n sql = (StringBuffer)indexes.get(i);\r\n pstmt = conn.prepareStatement(sql.toString());\r\n try {\r\n pstmt.execute();\r\n }\r\n catch (SQLException ex3) {\r\n Logger.error(\"NONAME\", this.getClass().getName(), \"executeSQL\",\r\n \"Invalid SQL: \" + sql, ex3);\r\n }\r\n pstmt.close();\r\n }\r\n\r\n conn.commit();\r\n\r\n }\r\n catch (Throwable ex) {\r\n try {\r\n Logger.error(\"NONAME\", this.getClass().getName(), \"executeSQL\",\r\n \"Invalid SQL: \" + sql, ex);\r\n }\r\n catch (Exception ex2) {\r\n }\r\n throw ex;\r\n }\r\n finally {\r\n try {\r\n if (pstmt!=null)\r\n pstmt.close();\r\n }\r\n catch (SQLException ex1) {\r\n }\r\n }\r\n }", "public DaoFileImpl(String path) {\r\n\t\tgson = new Gson();\r\n\t\tthis.path = path;\r\n\t\tthis.daoMap = new HashMap<>();\r\n\t\treadMapFromFile();\r\n\t}", "private void createDbRecords() throws IOException, JAXBException {\n }", "public DbRecord( String szFileName )\n throws FileNotFoundException, NullPointerException, AppException\n {\n Load( szFileName );\n }", "public interface IFileDao extends CrudDao<IFileEntity, IFileDto, Long> {\n\n IFileEntity createFile();\n\n Long saveFileUsingStream(IFileEntity fileEntity, InputStream inputStream) throws Exception;\n\n void writeFileContent(Long fileId, OutputStream outputStream) throws Exception;\n}", "public interface IFileDataTypeReader {\n\t\n\t Map<String, String> getColumnAndDataType(String fileName, ExtendedDetails dbDetails) throws ZeasException;\n\t\n\t List<List<String>> getColumnValues() throws ZeasException;\n}", "public void toSql(String baseDir, String out) throws IOException {\n Path pBase = Paths.get(baseDir);\n final String format = \"insert into files values(null,'%s','%s');\";\n List<String> files = new ArrayList<>();\n Files.walkFileTree(pBase, new SimpleFileVisitor<Path>() {\n @Override\n public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {\n String fileName = file.getFileName().toString();\n String path = file.toAbsolutePath().toString();\n if (filter(path) || filter(fileName)) {\n return FileVisitResult.CONTINUE;\n }\n if (fileName.length() > 128 || path.length() > 8096) {\n System.out.println(String.format(\"warning : %s %s exced the limit\", fileName, path));\n }\n\n\n String insert = String.format(format, fileName, path);\n files.add(insert);\n if (files.size() >= 10240) {\n write2File(out, files);\n files.clear();\n }\n return FileVisitResult.CONTINUE;\n }\n });\n write2File(out, files);\n }", "String getSchemaFile();", "public interface IWritableDatabase2 {\r\n\r\n\t/**\r\n\t * Add database links between tokens found a file, and the file path itself. \r\n\t * \r\n\t * @param strings A unique list of valid white-space separated tokens contained within a file\r\n\t * @param f The file containing the tokens\r\n\t * @param ignoreCase Whether to ignore the case of the tokens (always false?)\t * \r\n\t * @param debug Currently unused debug id\r\n\t */\r\n\tpublic void addBulkLinks(List<String> strings, boolean ignoreCase, File f, int debug);\t\t\r\n\r\n\t/** Once complete, write to the database. */\r\n\tpublic void writeDatabase();\r\n}", "public DataBase(String file) throws IOException {\n\t\tdataBase = new RandomAccessFile(file, \"rw\");\n\t\tdataBase.writeBytes(\"FEATURE_ID|FEATURE_NAME|FEATURE_CLASS|STATE_ALPHA|\"\n\t\t\t\t+ \"STATE_NUMERIC|COUNTY_NAME|COUNTY_NUMERIC|PRIMARY_LAT_DMS|PRIM_LONG_DMS|\"\n\t\t\t\t+ \"PRIM_LAT_DEC|PRIM_LONG_DEC|SOURCE_LAT_DMS|SOURCE_LONG_DMS|SOURCE_LAT_DEC|\"\n\t\t\t\t+ \"SOURCE_LONG_DEC|ELEV_IN_M|ELEV_IN_FT|MAP_NAME|DATE_CREATED|DATE_EDITED\\n\");\n\t}", "@Override\n\tpublic void onCreate(SQLiteDatabase db) {\n\t\tStringBuffer sb = new StringBuffer(\"create table fileinfo ( \");\n\t\tsb.append(\"id integer primary key autoincrement , \");\n\t\tsb.append(\"name varchar(20) , \");\n\t\tsb.append(\"fileurl varchar(60) ,\");\n\t\tsb.append(\"path varchar(60) , \");\n\t\tsb.append(\"size varchar(30) , \");\n\t\tsb.append(\"time varchar(30)\");\n\t\tsb.append(\")\");\n\t\ttry {\n\t\t\tdb.execSQL(sb.toString());\n\t\t\tLog.d(\"TAG\", \"创建数据库表成功\");\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t}", "public interface DBStructure {\n\n String save(DataSource dataSource);\n\n void update(DataSource dataSource, String fileMask) throws UpdateException;\n\n void dropAll(DataSource dataSource) throws DropAllException;\n\n String getSqlScript(DataSource dataSource);\n\n void unlock(DataSource dataSource);\n}", "public abstract String createDBString();", "public void run() throws DatabaseException, FileNotFoundException {\n new File(FileName).delete();\n\n // Create the database object.\n // There is no environment for this simple example.\n DatabaseConfig config = new DatabaseConfig();\n config.setErrorStream(System.err);\n config.setErrorPrefix(\"BulkAccessExample\");\n config.setType(DatabaseType.BTREE);\n config.setAllowCreate(true);\n config.setMode(0644);\n Database table = new Database(FileName, null, config);\n\n //\n // Insert records into the database, where the key is the user\n // input and the data is the user input in reverse order.\n //\n InputStreamReader reader = new InputStreamReader(System.in);\n\n for (;;) {\n String line = askForLine(reader, System.out, \"input> \");\n if (line == null || (line.compareToIgnoreCase(\"end\") == 0))\n break;\n\n String reversed = (new StringBuffer(line)).reverse().toString();\n\n // See definition of StringEntry below\n //\n StringEntry key = new StringEntry(line);\n StringEntry data = new StringEntry(reversed);\n\n try {\n if (table.putNoOverwrite(null, key, data) == OperationStatus.KEYEXIST)\n System.out.println(\"Key \" + line + \" already exists.\");\n } catch (DatabaseException dbe) {\n System.out.println(dbe.toString());\n }\n System.out.println(\"\");\n }\n\n // Acquire a cursor for the table.\n Cursor cursor = table.openCursor(null, null);\n DatabaseEntry foo = new DatabaseEntry();\n\n MultipleKeyDataEntry bulk_data = new MultipleKeyDataEntry();\n bulk_data.setData(new byte[1024 * 1024]);\n bulk_data.setUserBuffer(1024 * 1024, true);\n\n // Walk through the table, printing the key/data pairs.\n //\n while (cursor.getNext(foo, bulk_data, null) == OperationStatus.SUCCESS) {\n StringEntry key, data;\n key = new StringEntry();\n data = new StringEntry();\n\n while (bulk_data.next(key, data))\n System.out.println(key.getString() + \" : \" + data.getString());\n }\n cursor.close();\n table.close();\n }", "public abstract void loadFromDatabase();", "public String getDbTable() {return dbTable;}", "public void putFile(Connection conn, File cond) throws Exception{\n\t//System.out.println(cond);\n\t//Check for LFN\n\tString LFN = cond.getLogicalFileName ( );\n\tif(LFN == null || LFN==\"\") throw new DBSException(\"Input Data Error\", \"LogicalFileName is expected.\");\n\t//Check is_file_valid\n\tint fileValid = cond.getIsFileValid( );\n if(fileValid == -1) throw new DBSException(\"Input Data Error\", \"Validation of File is expected.\");\n\t//Check if Datset already in db\n\tDataset ds = cond.getDatasetDO();\n\t//System.out.println(ds);\n\tif(ds == null)throw new DBSException(\"Input Data Error\", \"Dataset is expected.\");\n\tif(ds.getDatasetID( ) == 0){\n\t String dsName = ds.getDataset();\n\t if((dsName == null) || (dsName==\"\"))throw new DBSException(\"Input Data Error\", \"Dataset name is missing\");\n\t JSONArray dss = (new DatasetQO()).listDatasets(conn, ds);\n\t if(dss.length() != 1)\n\t\tthrow new DBSException(\"Input Data Error\", \"dataset name :\" + dsName \n\t\t+\" is not found or more than one found in the db.\");\n\t else{ \n\t\tds.setDatasetID(((Dataset)dss.getJSONObject(0)).getDatasetID());\n\t\t//ds.setDataset(((Dataset)dss.getJSONObject(0)).getDataset());\n\t }\n\t}\n //System.out.println(cond);\n\tBlock bk = cond.getBlockDO();\n\tif(bk == null) throw new DBSException(\"Input Data Error\", \"Block is expected.\");\n\tif(bk.getBlockID() == 0){\n\t String bkName = bk.getBlockName();\n\t if(bkName == null || bkName == \"\")throw new DBSException(\"Input Data Error\", \"Block name is missing\");\n\t JSONArray bks = (new BlockQO()).listBlocks(conn, bk);\n\t if(bks.length() != 1 )\n\t\tthrow new DBSException(\"Input Data Error\", \"More than one or no Blocks are found in the db with name: \"\n\t\t + bkName);\n\t else {\n\t\tbk.setBlockID(((Block)bks.getJSONObject(0)).getBlockID());\n\t\t//System.out.println(\"Block : \" + bk);\n\t }\n\t}\n\t//\n\t//System.out.println(\"Check for file_type\");\n\tFileType ft = cond.getFileTypeDO();\n if(ft == null)throw new DBSException(\"Input Data Error\", \"File type is expected.\");\n if(ft.getFileTypeID( ) == 0){\n String ftName = ft.getFileType();\n if((ftName == null) || (ftName == \"\"))throw new DBSException(\"Input Data Error\", \"File type is missing\");\n JSONArray fts = (new FileTypeQO()).listFileTypes(conn, ft);\n if(fts.length() != 1)\n throw new DBSException(\"Input Data Error\", \"File type :\" + ftName\n +\" is not found or more than one found in the db.\");\n else\n ft.setFileTypeID(((FileType)fts.getJSONObject(0)).getFileTypeID());\n }\n\t//System.out.println(\"File type: \" + ft);\n\t//check for Primary key\n\tint fileID = cond.getFileID ( );\n\tif(fileID == 0){\n\t try{\n\t\tfileID = SequenceManager.getSequence(conn, \"SEQ_FL\");\n\t\tcond. setFileID(fileID);\n\t }catch (SQLException ex) {\n\t\tthrow ex;\n\t }\n\t}\n\t//\n\t//System.out.println(\"Check for check-sum\");\n\tString cs = cond.getCheckSum();\n if(cs == null || cs == \"\")throw new DBSException(\"Input Data Error\", \"File check-sum is expected.\");\n\t//check for event_count\n\tif (cond.getEventCount() == -1) throw new DBSException(\"Input Data Error\", \"File event count is expected.\");\n\t//check for file size\n\tif(cond.getFileSize() == -1) throw new DBSException(\"Input Data Error\", \"File size is expected.\");\n\t//System.out.println(\"Check for creation_date and created_by. \\n\");\n\tlong createDate = cond.getCreationDate( );\n\tString createdBy = cond.getCreateBy( );\n\t//System.out.println(\"****File**** \" + cond);\n\tif(createDate == 0)cond.setCreationDate(DBSSrvcUtil.getEpoch());\n if(createdBy == null || createdBy==\"\")cond.setCreateBy(\"WeNeed2FindWhoDidIt\");\n\t \t\n\t//Now we are ready to insert into the dataset\n\t//System.out.println(\"Ready to insert file :\" + cond);\n\tinsertTable(conn, cond, \"FILES\");\n }", "public int getDbType();", "int insert(DiaryFile record);", "@Repository\npublic interface DBFileRepository extends JpaRepository<DBFile, Long> {\n\n}", "public DataWriter(String dbPath) {\n databasePath = dbPath;\n }", "public DB(String db) throws ClassNotFoundException, SQLException {\n // Set up a connection and store it in a field\n Class.forName(\"org.sqlite.JDBC\");\n String url = \"jdbc:sqlite:\" + db;\n\n // stop conn from creating a file if does not exists\n SQLiteConfig config = new SQLiteConfig();\n config.resetOpenMode(SQLiteOpenMode.CREATE);\n\n //connect to the file\n conn = DriverManager.getConnection(url, config.toProperties());\n try (Statement stat = conn.createStatement();) {\n stat.executeUpdate(\"PRAGMA foreign_keys = ON;\");\n }\n }", "public Dataset openTDB(String directory){\n Dataset dataset = TDBFactory.createDataset(directory);\n return dataset;\n}", "public ProjectFilesDAOImpl() {\r\n super();\r\n }", "int insert(FileRecordAdmin record);", "public void writeDatabase();", "public static boolean addFile(TranslationFile bf) {\n System.out.println(\"File added to database.\");\n DatabaseOperations.addOrUpdateFileName(bf.getFileID(), bf.getFileName());\n String sql = \"INSERT OR REPLACE INTO corpus1(id, fileID, fileName, thai, english, committed, removed, rank) VALUES(?,?,?,?,?,?,?,?)\";\n\n try (Connection conn = DatabaseOperations.connect();\n PreparedStatement pstmt = conn.prepareStatement(sql)) {\n\n conn.setAutoCommit(false);\n\n // this makes sure that the segments in the file, when retrieved from the db, can be ordered in the proper order.\n // simply increments by 1 on each segment. \n int rank = 0;\n // keeps count of the number of segs added so that the SQL can run a batch transaction (which is much more efficient than individual transactions).\n // when i=1000, or at the last segment, the SQL is then run as one batch transaction.\n int i = 0;\n\n for (Segment seg : bf.getActiveSegs()) {\n\n pstmt.setDouble(1, seg.getID());\n pstmt.setDouble(2, seg.getFileID());\n pstmt.setString(3, seg.getFileName());\n pstmt.setString(4, seg.getThai());\n pstmt.setString(5, seg.getEnglish());\n // committed/removed booleans are stored as binary (0 = false, 1 = true)\n pstmt.setInt(6, seg.isCommitted() ? 1 : 0);\n // removed is set to \"false\"\n pstmt.setInt(7, 0);\n pstmt.setInt(8, rank);\n pstmt.addBatch();\n rank++;\n i++;\n\n if (i % 1000 == 0 || i == bf.getActiveSegs().size()) {\n pstmt.executeBatch(); //Execute every 1000 segments.\n }\n }\n\n // resetting counters\n i = 0;\n rank = 0;\n for (Segment seg : bf.getHiddenSegs()) {\n\n pstmt.setDouble(1, seg.getID());\n pstmt.setDouble(2, seg.getFileID());\n pstmt.setString(3, seg.getFileName());\n pstmt.setString(4, seg.getThai());\n pstmt.setString(5, seg.getEnglish());\n // committed/removed booleans are stored as binary (0 = false, 1 = true)\n pstmt.setInt(6, seg.isCommitted() ? 1 : 0);\n // removed is set to \"true\"\n pstmt.setInt(7, 1);\n pstmt.setInt(8, rank);\n pstmt.addBatch();\n rank++;\n i++;\n\n if (i % 1000 == 0 || i == bf.getHiddenSegs().size()) {\n pstmt.executeBatch(); //Execute every 1000 segments.\n }\n }\n conn.commit();\n return true;\n\n } catch (SQLException e) {\n System.out.println(\"AddFileAsBatch: \" + e.getMessage());\n return false;\n }\n }", "public long insert(FFileInputDO FFileInput) throws DataAccessException;", "private TexeraDb() {\n super(\"texera_db\", null);\n }", "private static void readDatabase(String path) {\n try {\n FileInputStream fileIn = new FileInputStream(path + \"/database.ser\");\n ObjectInputStream inStream = new ObjectInputStream(fileIn);\n database = (Database) inStream.readObject();\n inStream.close();\n fileIn.close();\n } catch (IOException i) {\n i.printStackTrace();\n } catch (ClassNotFoundException c) {\n c.printStackTrace();\n }\n }", "public DBFWriter(File dbfFile) throws Exception {\r\n\r\n\t\ttry {\r\n\r\n\t\t\tthis.raf = new RandomAccessFile(dbfFile, \"rw\");\r\n\t\t\tFileChannel fileChannel = this.raf.getChannel();\r\n\t\t\twhile (true) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tlock = fileChannel.lock();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} catch (OverlappingFileLockException e) {\r\n\t\t\t\t\tThread.sleep(2);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tthrow new Exception(e.getMessage());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t/*\r\n\t\t\t * before proceeding check whether the passed in File object is an\r\n\t\t\t * empty/non-existent file or not.\r\n\t\t\t */\r\n\t\t\tif (!dbfFile.exists() || dbfFile.length() == 0) {\r\n\t\t\t\tthis.header = new DBFHeader();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\theader = new DBFHeader();\r\n\t\t\tthis.header.read(raf);\r\n\r\n\t\t\t// back 5 char\r\n\t\t\tthis.raf.seek(this.raf.length() - 10);\r\n\t\t\tlong logEofIndex = 0;\r\n\t\t\twhile (true) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\t// the end byte 26\r\n\t\t\t\t\tif (this.raf.readByte() == 26) {\r\n\t\t\t\t\t\tlogEofIndex = this.raf.getFilePointer();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (EOFException ioe) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (logEofIndex == 0) {\r\n\t\t\t\tlogEofIndex = this.raf.length();\r\n\t\t\t} else {\r\n\t\t\t\tlogEofIndex--;\r\n\t\t\t}\r\n\t\t\t/* position file pointer at the end of the raf */\r\n\t\t\tthis.raf.seek(logEofIndex);\r\n\t\t\t// this.raf.seek( this.raf.length()-1 /* to ignore the END_OF_DATA\r\n\t\t\t// byte at EoF */);\r\n\r\n\t\t} catch (FileNotFoundException e) {\r\n\r\n\t\t\tthrow new DBFException(\"Specified file is not found. \" + e.getMessage());\r\n\t\t} catch (IOException e) {\r\n\r\n\t\t\tthrow new DBFException(e.getMessage() + \" while reading header\");\r\n\t\t}\r\n\t\tthis.recordCount = this.header.numberOfRecords;\r\n\t}", "public String getDbpediaFile() {\n\t\treturn DBPEDIA_FILE;\n\t}", "@Override\n public String getDbString() {\n return null;\n }", "public SimpleDatabase executeSqlFile(SQLiteDatabase db, @RawRes int id) {\n Scanner scan = context.openInternalFileScanner(id);\n String query = \"\";\n if (logging) Log.d(\"SimpleDB\", \"start reading file\");\n int queryCount = 0;\n while (scan.hasNextLine()) {\n String line = scan.nextLine().trim();\n if (line.startsWith(\"--\") || line.isEmpty()) {\n continue;\n } else {\n query += line + \"\\n\";\n }\n\n if (query.endsWith(\";\\n\")) {\n if (logging) Log.d(\"SimpleDB\", \"query: \\\"\" + query + \"\\\"\");\n db.execSQL(query);\n query = \"\";\n queryCount++;\n }\n }\n if (logging) Log.d(\"SimpleDB\", \"done reading file\");\n if (logging) Log.d(\"SimpleDB\", \"performed \" + queryCount + \" queries.\");\n return this;\n }", "public interface DbIterator {\n /**\n * Opens the iterator.\n * @throws NoSuchElementException when the iterator has no elements.\n * @throws DbException when there are problems opening/accessing the database.\n */\n public void open() throws NoSuchElementException, DbException, TransactionAbortedException;\n\n /**\n * Gets the next tuple from the operator (typically implementing by reading\n * from a child operator or an access method).\n *\n * @return The next tuple in the iterator.\n */\n public Tuple getNext() throws TransactionAbortedException;\n\n /**\n * Resets the iterator to the start.\n * @throws DbException When rewind is unsupported.\n */\n public void rewind() throws DbException, TransactionAbortedException;\n\n /**\n * Returns the TupleDesc associated with this DbIterator.\n */\n public TupleDesc getTupleDesc();\n\n /**\n * Closes the iterator.\n */\n public void close();\n}", "public boolean writePlicSnapshotToFile(File f, String dbSchema, String dataSource){\n try{\n //Obtener la conexion JDBC del proyecto\n InitialContext ctx = new InitialContext();\n DataSource ds = (DataSource) ctx.lookup(dataSource);\n Connection connection = ds.getConnection();\n\n\t String query = \"SELECT '\\\"'||REPLACE(COALESCE(globaluniqueidentifier,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(scientificname,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(institutioncode,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||COALESCE(to_char(datelastmodified,'YYYY-MM-DD HH24:MI:SS'),'')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(taxonrecordid,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(language,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(creators,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(distribution,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(abstract,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(kingdomtaxon,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(phylumtaxon,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(classtaxon,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(ordertaxon,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(familytaxon,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(genustaxon,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(synonyms,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(authoryearofscientificname,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(speciespublicationreference,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(commonnames,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(typification,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(contributors,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||COALESCE(to_char(datecreated,'YYYY-MM-DD'),'')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(habit,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(lifecycle,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(reproduction,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(annualcycle,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(scientificdescription,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(briefdescription,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(feeding,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(behavior,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(interactions,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(chromosomicnumbern,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(moleculardata,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(populationbiology,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(threatstatus,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(legislation,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(habitat,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(territory,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(endemicity,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(theuses,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(themanagement,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(folklore,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(thereferences,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(unstructureddocumentation,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(otherinformationsources,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(papers,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(identificationkeys,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(migratorydata,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(ecologicalsignificance,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(unstructurednaturalhistory,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(invasivenessdata,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(targetaudiences,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(version,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(urlimage1,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(captionimage1,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(urlimage2,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(captionimage2,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(urlimage3,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(captionimage3,''),'\\r\\n', ' ')||'\\\"'\"+\n\t\t\t \" AS aux \"+\n\t\t\t \"FROM \"+dbSchema+\".plic_snapshot;\";\n\n System.out.println(query);\n\n\t\t\tStatement st = connection.createStatement();\n\t\t\tResultSet rs = st.executeQuery(query); \n\n //Imprimir los datos en el archivo\n BufferedWriter out = new BufferedWriter(new FileWriter(f));\n\t\t\twhile (rs.next()) {\n\t\t\t\tout.write(rs.getString(\"aux\")+\"\\n\");\n\t\t\t}\n out.close();\n\n //Cerrar el resultset y el statement\n rs.close();\n\t\t\tst.close();\n\n //Resultado\n return true;\n }\n catch(Exception e){\n e.printStackTrace();\n return false;}\n }", "public interface FilesDAO extends CrudRepository<Files,Long> {\n}", "@Override\r\n\tpublic boolean supportsDb(String type) {\r\n \treturn true;\r\n }", "@SuppressWarnings(\"rawtypes\") \npublic interface FFileInputDAO {\n\t/**\n\t * Insert one <tt>FFileInputDO</tt> object to DB table <tt>f_file_input</tt>, return primary key\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>insert into f_file_input(file_id,file_code,type,form_id,project_code,project_name,customer_id,customer_name,first_loan_time,filing_time,hand_over_dept,hand_over_man,hand_over_time,principal_man,vice_manager,receive_dept,receive_man,receive_time,status,raw_add_time) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)</tt>\n\t *\n\t *\t@param FFileInput\n\t *\t@return long\n\t *\t@throws DataAccessException\n\t */\t \n public long insert(FFileInputDO FFileInput) throws DataAccessException;\n\n\t/**\n\t * Update DB table <tt>f_file_input</tt>.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>update f_file_input set first_loan_time=?, filing_time=?, hand_over_dept=?, hand_over_man=?, hand_over_time=?, principal_man=?, vice_manager=?, receive_dept=?, receive_man=?, receive_time=?, status=? where (input_id = ?)</tt>\n\t *\n\t *\t@param FFileInput\n\t *\t@return int\n\t *\t@throws DataAccessException\n\t */\t \n public int update(FFileInputDO FFileInput) throws DataAccessException;\n\n\t/**\n\t * Query DB table <tt>f_file_input</tt> for records.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>select * from f_file_input where (input_id = ?)</tt>\n\t *\n\t *\t@param inputId\n\t *\t@return FFileInputDO\n\t *\t@throws DataAccessException\n\t */\t \n public FFileInputDO findById(long inputId) throws DataAccessException;\n\n\t/**\n\t * Query DB table <tt>f_file_input</tt> for records.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>select * from f_file_input where (form_id = ?)</tt>\n\t *\n\t *\t@param formId\n\t *\t@return List<FFileInputDO>\n\t *\t@throws DataAccessException\n\t */\t \n public List<FFileInputDO> findByFormId(long formId) throws DataAccessException;\n\n\t/**\n\t * Delete records from DB table <tt>f_file_input</tt>.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>delete from f_file_input where (input_id = ?)</tt>\n\t *\n\t *\t@param inputId\n\t *\t@return int\n\t *\t@throws DataAccessException\n\t */\t \n public int deleteById(long inputId) throws DataAccessException;\n\n\t/**\n\t * Query DB table <tt>f_file_input</tt> for records.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>select * from f_file_input where (1 = 1)</tt>\n\t *\n\t *\t@param FFileInput\n\t *\t@param limitStart\n\t *\t@param pageSize\n\t *\t@return List<FFileInputDO>\n\t *\t@throws DataAccessException\n\t */\t \n public List<FFileInputDO> findByCondition(FFileInputDO FFileInput, long limitStart, long pageSize) throws DataAccessException;\n\n\t/**\n\t * Query DB table <tt>f_file_input</tt> for records.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>select COUNT(*) from f_file_input where (1 = 1)</tt>\n\t *\n\t *\t@param FFileInput\n\t *\t@return long\n\t *\t@throws DataAccessException\n\t */\t \n public long findByConditionCount(FFileInputDO FFileInput) throws DataAccessException;\n\n}", "private static void loadTableData() {\n\n\t\tBufferedReader in = null;\n\t\ttry {\n\t\t\tin = new BufferedReader(new FileReader(dataDir + tableInfoFile));\n\n\t\t\twhile (true) {\n\n\t\t\t\t// read next line\n\t\t\t\tString line = in.readLine();\n\t\t\t\tif (line == null) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tString[] tokens = line.split(\" \");\n\t\t\t\tString tableName = tokens[0];\n\t\t\t\tString tableFileName = tokens[1];\n\n\t\t\t\ttableNameToSchema.put(tableName, new HashMap<String, Type>());\n\t\t\t\ttableNameToOrdredSchema.put(tableName,\n\t\t\t\t\t\tnew ArrayList<ColumnInfo>());\n\n\t\t\t\t// attributes data\n\t\t\t\tfor (int i = 2; i < tokens.length;) {\n\n\t\t\t\t\tString attName = tokens[i++];\n\t\t\t\t\tString attTypeName = (tokens[i++]);\n\n\t\t\t\t\tType attType = null;\n\n\t\t\t\t\t/*\n\t\t\t\t\t * Undefined, how to represent dates, crazy longs probably\n\t\t\t\t\t * won't need this for now...\n\t\t\t\t\t */\n\t\t\t\t\tif (attTypeName.equals(\"CHAR\")) {\n\t\t\t\t\t\tattType = Types.getCharType(Integer\n\t\t\t\t\t\t\t\t.valueOf(tokens[i++]));\n\t\t\t\t\t} else if (attTypeName.equals(\"DATE\")) {\n\t\t\t\t\t\tattType = Types.getDateType();\n\t\t\t\t\t} else if (attTypeName.equals(\"DOUBLE\")) {\n\t\t\t\t\t\tattType = Types.getDoubleType();\n\t\t\t\t\t} else if (attTypeName.equals(\"FLOAT\")) {\n\t\t\t\t\t\tattType = Types.getFloatType();\n\t\t\t\t\t} else if (attTypeName.equals(\"INTEGER\")) {\n\t\t\t\t\t\tattType = Types.getIntegerType();\n\t\t\t\t\t} else if (attTypeName.equals(\"LONG\")) {\n\t\t\t\t\t\tattType = Types.getLongType();\n\t\t\t\t\t} else if (attTypeName.equals(\"VARCHAR\")) {\n\t\t\t\t\t\tattType = Types.getVarcharType();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new RuntimeException(\"Invalid type: \"\n\t\t\t\t\t\t\t\t+ attTypeName);\n\t\t\t\t\t}\n\n\t\t\t\t\ttableNameToSchema.get(tableName).put(attName, attType);\n\n\t\t\t\t\tColumnInfo ci = new ColumnInfo(attName, attType);\n\t\t\t\t\ttableNameToOrdredSchema.get(tableName).add(ci);\n\n\t\t\t\t}\n\n\t\t\t\t// at this point, table info loaded.\n\n\t\t\t\t// Create table\n\t\t\t\tmyDatabase.getQueryInterface().createTable(tableName,\n\t\t\t\t\t\ttableNameToSchema.get(tableName));\n\n\t\t\t\t// Now, load data into newly created table\n\t\t\t\treadTable(tableName, tableFileName);\n\n\t\t\t}\n\n\t\t\tin.close();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tHelpers.print(e.getStackTrace().toString(),\n\t\t\t\t\tutil.Consts.printType.ERROR);\n\t\t}\n\n\t}", "CCDB2IndexFile(CCDB2Driver driver, File filePath) throws IOException\r\n\t{\r\n\t\tfFilePath = filePath;\r\n\t\tfFile = new CCDB2File(driver, fFilePath.getPath(), NULL_BYTE);\r\n\t}", "@Override\n\tpublic void createFile(FileModel file) {\n\t\tString sql = \"INSERT INTO file VALUES (?,?,?,?,?,?,now(),now())\";\n\t\t\n\t\tthis.getJdbcTemplate().update(sql, new Object[] { \n\t\t\t\tfile.getFile_id(),\n\t\t\t\tfile.getFile_path(),\n\t\t\t\tfile.getFile_name(),\n\t\t\t\tfile.getFile_type(),\n\t\t\t\tfile.getFile_size(),\n\t\t\t\tfile.getCretd_usr()\n\t\t});\n\t}", "public interface BerkeleydbDao<T> {\n\n /**\n * open database\n * */\n public void openConnection(String filePath, String databaseName) throws DatabaseException;\n\n /**\n * 关闭数据库\n * */\n public void closeConnection() throws DatabaseException;\n\n /**\n * insert\n * */\n public void save(String name, T t) throws DatabaseException;\n\n /**\n * delete\n * */\n public void delete(String name) throws DatabaseException;\n\n /**\n * update\n * */\n public void update(String name, T t) throws DatabaseException;\n\n /**\n * select\n * */\n public T get(String name) throws DatabaseException;\n\n}", "public String getDbPath() {\r\n return dbPath;\r\n }", "DatabaseInformationFull(Database db) {\n super(db);\n }", "public DbFileIterator iterator(final TransactionId tid) { \t\n// some code goes here\n \t\n \tDbFileIterator dbfi = new DbFileIterator() {\n \tint pgno = 0;\n \tHeapPage currPg = null;\n \tString name = Database.getCatalog().getTableName(getId());\n \tint tblid = Database.getCatalog().getTableId(name);\n \tint open = 0; \t\n \t\n \t//Todo: pass along the tid from the outer method.\n \t//DONE. by making tid param final.\n \tTransactionId m_tid = tid;\n \t\n \tIterator<Tuple> titr = null;\n \t\n\t\t\t@Override\n\t\t\tpublic void rewind() throws DbException, TransactionAbortedException {\n\t\t\t\tclose();\n\t\t\t\topen();\n\t\t\t}\n\t\t\t\n\t\t\tpublic void nextPage() throws DbException, TransactionAbortedException {\n\n\t\t\t\tif (pgno >= numPages())\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tcurrPg = (HeapPage) Database.getBufferPool().getPage(m_tid, new HeapPageId(tblid, pgno), simpledb.Permissions.READ_ONLY);\n\t\t\t\t\ttitr = currPg.iterator();\n\t\t\t\t\tif (titr == null)\n\t\t\t\t\t\tthrow new DbException(\"blah blah blah\");\n\t\t\t\t\tpgno++;\n\t\t\t\t\treturn;\n\t\t\t\t} catch (DbException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tthrow new DbException(\"page was not found or no more iterators..?\");\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void open() throws DbException, TransactionAbortedException {\n\t\t\t\topen = 1;\n\t\t\t\tpgno = 0;\n\t\t\t\tnextPage();\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic Tuple next() throws DbException, TransactionAbortedException,\n\t\t\t\t\tNoSuchElementException {\n\t\t\t\tif (open != 1)\n\t\t\t\t\tthrow new NoSuchElementException();\n\t\t\t\tif (!titr.hasNext())\n\t\t\t\t\tnextPage();\n\t\t\t\treturn titr.next();\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic boolean hasNext() throws DbException, TransactionAbortedException {\n\t\t\t\tif (open !=1)\n\t\t\t\t\treturn false;\n\t\t\t\tif (titr == null) //TODO: remove\n\t\t\t\t\tthrow new DbException(Integer.toString(pgno) + Integer.toString(open) + Integer.toString(numPages()) + m_f.getPath());\n\t\t\t\tif (!titr.hasNext())\n\t\t\t\t\tnextPage();\n\t\t\t\tif (titr.hasNext())\n\t\t\t\t\treturn true;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void close() {\n\t\t\t\topen = 0;\n\t\t\t\ttitr = null;\n\t\t\t}\n\t\t};\n return dbfi;\n }", "@Test(timeout = 4000)\n public void test112() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable(\"O\\\"6T\");\n File file0 = MockFile.createTempFile(\"<*kYz\", \"BLOB\");\n MockPrintWriter mockPrintWriter0 = new MockPrintWriter(file0);\n NameSpec nameSpec0 = NameSpec.ALWAYS;\n SQLUtil.renderCreateTable(defaultDBTable0, true, nameSpec0, mockPrintWriter0);\n assertNull(defaultDBTable0.getDoc());\n }", "public NameSurferDataBase(String filename) {\t\n\t\tnameData(filename);\n\t}", "public void init() {\r\n BufferedReader in = null;\r\n String line;\r\n PreparedStatement iStmt;\r\n String insertStmt = \"INSERT INTO \" + schema + \"ULDSHAPE \"\r\n + \"(SHAPE, ALLHGHT, ALLLENG, ALLWDTH, BIGPIC, DESCR, INTERNALVOLUME, INTHGHT, INTLENG, INTWDTH, \"\r\n + \"MAXGROSSWGHT, RATING, TAREWGHT, THUMBNAIL, UPDATED, UPDTUSER, VERSION) VALUES \"\r\n + \"(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\";\r\n int count = 0;\r\n\r\n LOG.log(Level.INFO, \"Initialize basic Uldshapes in DB from file [{0}]\", path);\r\n\r\n try {\r\n in = new BufferedReader(new InputStreamReader(new FileInputStream(path), StandardCharsets.UTF_8));\r\n\r\n iStmt = conn.prepareStatement(insertStmt);\r\n\r\n while ((line = in.readLine()) != null) {\r\n LOG.finer(line);\r\n\r\n UldshapeVO uldshapeVO = parseUldshape(line);\r\n\r\n iStmt.setString(1, uldshapeVO.getShape());\r\n iStmt.setInt(2, uldshapeVO.getAllhght());\r\n iStmt.setInt(3, uldshapeVO.getAllleng());\r\n iStmt.setInt(4, uldshapeVO.getAllwdth());\r\n iStmt.setBytes(5, uldshapeVO.getBigpic());\r\n iStmt.setString(6, uldshapeVO.getDescr());\r\n iStmt.setInt(7, uldshapeVO.getInternalvolume());\r\n iStmt.setInt(8, uldshapeVO.getInthght());\r\n iStmt.setInt(9, uldshapeVO.getIntleng());\r\n iStmt.setInt(10, uldshapeVO.getIntwdth());\r\n iStmt.setInt(11, uldshapeVO.getMaxgrosswght());\r\n iStmt.setString(12, uldshapeVO.getRating());\r\n iStmt.setInt(13, uldshapeVO.getTarewght());\r\n iStmt.setBytes(14, uldshapeVO.getThumbnail());\r\n iStmt.setTimestamp(15, DbUtil.getCurrentTimeStamp());\r\n iStmt.setString(16, uldshapeVO.getUpdtuser());\r\n iStmt.setLong(17, 0);\r\n\r\n // execute insert SQL stetement\r\n iStmt.executeUpdate();\r\n\r\n ++count;\r\n }\r\n LOG.log(Level.INFO, \"Finished: [{0}] ULDSHAPES loaded\", count);\r\n\r\n DbUtil.cleanupJdbc();\r\n }\r\n catch (IOException ioex) {\r\n LOG.log(Level.SEVERE, \"An IO error occured. The error message is: {0}\", ioex.getMessage());\r\n }\r\n catch (SQLException ex) {\r\n LOG.log(Level.SEVERE, \"An SQL error occured. The error message is: {0}\", ex.getMessage());\r\n }\r\n finally {\r\n if (in != null) {\r\n try {\r\n in.close();\r\n }\r\n catch (IOException e) {\r\n }\r\n }\r\n }\r\n }", "private void loadDatabase()\n\t{\n\t\ttry\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// Check to make sure the Bmod Database is there, if not, try \n\t\t\t\t// downloading from the website.\n\t\t\t\tif(!Files.exists(m_databaseFile))\n\t\t\t\t{\n\t\t\t\t\tFiles.createDirectories(m_databaseFile.getParent());\n\t\t\t\t\n\t\t\t\t\tbyte[] file = ExtensionPoints.readURLAsBytes(\"http://\" + Constants.API_HOST + HSQL_DATABASE_PATH);\n\t\t\t\t\tif(file.length != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tFiles.deleteIfExists(m_databaseFile);\n\t\t\t\t\t\tFiles.write(m_databaseFile, file, StandardOpenOption.CREATE, StandardOpenOption.WRITE);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// make sure we have the proper scriptformat.\n\t\t\t\tsetScriptFormatCorrectly();\n\t\t\t}catch(NullPointerException|IOException ex)\n\t\t\t{\n\t\t\t\tm_logger.error(\"Could not fetch database from web.\", ex);\n\t\t\t}\n\t\t\t\n\t\n\t\t\t\n\t\t\tClass.forName(\"org.hsqldb.jdbcDriver\");\n\t\t\n\t\t\t\n\t\t\tString db = ExtensionPoints.getBmodDirectory(\"database\").toUri().getPath();\n\t\t\tconnection = DriverManager.getConnection(\"jdbc:hsqldb:file:\" + db, \"sa\", \"\");\n\t\t\t\n\t\t\t// Setup Connection\n\t\t\tCSVRecordLoader ldr = new CSVRecordLoader();\n\t\t\n\t\t\t// Load all of the building independent plugins\n\t\t\tfor(Record<?> cp : ldr.getRecordPluginManagers())\n\t\t\t{\n\t\t\t\tm_logger.debug(\"Creating table: \" + cp.getTableName());\n\t\t\t\t// Create a new table\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tgetPreparedStatement(cp.getSQLTableDefn()).execute();\n\t\t\t\t} catch(SQLException ex)\n\t\t\t\t{\n\t\t\t\t\t// Table exists\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tm_logger.debug(\"Doing index:\" + cp.getIndexDefn());\n\t\t\t\t\tif(cp.getIndexDefn() != null)\n\t\t\t\t\t\tgetPreparedStatement(cp.getIndexDefn()).execute();\n\t\t\t\t}catch(SQLException ex)\n\t\t\t\t{\t// index exists\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\n\t\t} catch (Exception ex)\n\t\t{\n\t\t\tex.printStackTrace();\n\t\t\tif(ex instanceof DatabaseIntegrityException)\n\t\t\t\tDatabase.handleCriticalError((DatabaseIntegrityException)ex);\n\t\t\telse\n\t\t\t\tDatabase.handleCriticalError(new DatabaseIntegrityException(ex));\n\t\t}\n\t\t\n\t}", "public static void createNewDatabaseFile(String startPath)\r\n throws ConnectionFailedException, DatabaseException {\r\n boolean databaseCreated;\r\n try {\r\n databaseCreated = database.createNewFile();\r\n if (!databaseCreated) {\r\n throw new IOException(\"Cannot create file\");\r\n }\r\n\r\n URL databaseResource = Objects.requireNonNull(Paths.get(\r\n startPath + \"resources/database/database.sql\").toUri().toURL());\r\n String decodedPath = URLDecoder.decode(databaseResource.getPath(), \"UTF-8\");\r\n\r\n try (BufferedReader in = new BufferedReader(new FileReader(decodedPath))) {\r\n StringBuilder sqlQuery = new StringBuilder();\r\n while (in.ready()) {\r\n sqlQuery.append(in.readLine());\r\n if (sqlQuery.toString().endsWith(\";\")) {\r\n createBasicSqlTable(sqlQuery.toString());\r\n sqlQuery = new StringBuilder();\r\n }\r\n }\r\n }\r\n } catch (IOException e) {\r\n throwException(e);\r\n }\r\n }", "private String getDatabaseFilePath(NotesDatabase db) {\n try {\n return db.getFilePath();\n } catch (RepositoryException ex) {\n LOGGER.log(Level.WARNING, \"Unable to retrieve database's file path\", ex);\n return null;\n }\n }", "public Table readTable(String pathName, String filename){\n File file = new File(pathName + filename);\n Table newTable = null;\n Scanner sc; \n //foreign key aspects\n Boolean hasForeignKey = false;\n ArrayList<String> FKIndex; \n String[] line; \n String primaryTableName = \"\", primaryColName = \"\", colName = \"\"; \n String name = \"\";\n\n try {\n sc = new Scanner(file);\n } catch(FileNotFoundException ex) {\n System.out.println(\"ERROR: file not found\");\n return null;\n }\n\n //get table name - always first line\n if (sc.hasNextLine()){\n name = sc.nextLine();\n }\n\n FKIndex = getForeignKeyIndex(pathName);\n //loop over all rows in FKIndex, and check if table has a foreign key\n if(!FKIndex.isEmpty()){\n for(int i = 0; i < FKIndex.size(); i++){\n line = FKIndex.get(i).split(\"\\\\s\"); \n if (line[2].equals(name)){\n hasForeignKey = true;\n primaryTableName = line[0];\n primaryColName = line[1];\n colName = line[3];\n }\n }\n }\n\n //get col names - always second line\n if (sc.hasNextLine()){\n String colNamesString = sc.nextLine();\n //split colNames into individual words as Strings based on whitespace\n String[] colNames = colNamesString.split(\"\\\\s\");\n\n //make table with column names\n if (hasForeignKey){\n newTable = new Table(name, primaryTableName, primaryColName, colName, true, colNames);\n } else {\n newTable = new Table(name, colNames);\n }\n\n //add rows from file (each line)\n while(sc.hasNextLine()){\n String newRowString = sc.nextLine();\n String[] newRow = newRowString.split(\"\\\\s\");\n newTable.addRow(newRow);\n }\n }\n\n sc.close();\n return newTable;\n }", "private void createFileTableIndexes() throws Exception {\n \t\tdbManager\n \t\t\t\t.executeUpdate(\"create index FILE_ID_INDEX_FILE on FILE(FILE_ID)\");\n \t\tdbManager\n \t\t\t\t.executeUpdate(\"create index START_REVISION_ID_INDEX_FILE on FILE(START_REVISION_ID)\");\n \t\tdbManager\n \t\t\t\t.executeUpdate(\"create index END_REVISION_ID_INDEX_FILE on FILE(END_REVISION_ID)\");\n \t}", "public interface FileDataDao\r\n{\r\n\tpublic FileData uploadFile(UploadFileData ufd,int applicationId, String fileLocation,String rootLocation) throws FileAlreadyExistsException;\r\n\tpublic List<FileData> listRootFiles(int applicationId);\r\n\tpublic List<FileData> listFolderFiles(int applicationId,int parentCategoryId);\r\n\tpublic List<ApproveReject> approveFile(List<ApproveReject> approveList, int applicationId);\r\n\tpublic List<ApproveReject> rejectFile(List<ApproveReject> rejectList, int applicationId);\r\n\tpublic int getNoOfUploadedFiles(int applicationId);\r\n\tpublic List<FileDelete> deleteFiles(List<FileDelete> fileDeleteList, int applicationId);\r\n\tpublic int getRootId(int applicationId);\r\n\tpublic String getPhoto(int applicationId);\r\n}", "private void setupDb(){\n try {\n openConnection();\n s.executeUpdate(\"CREATE TABLE IF NOT EXISTS LIB (NAME text UNIQUE , TYPE text, LANGUAGE text, INTRUSIVE text, OPENSOURCE text)\");\n }catch (SQLException e) {\n System.err.println(e.getMessage());\n }finally {\n if (c != null){\n close(c);\n }\n }\n }", "Object getDB();", "private static void bindClobVarInFile(PreparedStatement ps, \n int index, \n ResultSet rs,\n int type)\n throws IOException, SQLException \n {\n InputStream is = rs.getAsciiStream(index);\n if (rs.wasNull()) {\n ps.setNull(index, type);\n return;\n }\n \n // Open file output stream\n long millis = System.currentTimeMillis();\n File f = File.createTempFile(\"clob\", \"\"+millis);\n f.deleteOnExit();\n FileOutputStream fos = new FileOutputStream(f);\n if (log.isDebugEnabled()) {\n //i18n[DBUtil.info.bindclobfile=bindClobVarInFile: Opening temp file '{0}']\n String msg = s_stringMgr.getString(\"DBUtil.info.bindclobfile\",\n f.getAbsolutePath());\n log.debug(msg);\n }\n \n // read rs input stream write to file output stream\n byte[] buf = new byte[_prefs.getFileCacheBufferSize()];\n int length = 0;\n int total = 0;\n while ((length = is.read(buf)) >= 0) {\n if (log.isDebugEnabled()) {\n //i18n[DBUtil.info.bindcloblength=bindClobVarInFile: writing '{0}' bytes.]\n String msg =\n s_stringMgr.getString(\"DBUtil.info.bindcloblength\",\n Integer.valueOf(length));\n log.debug(msg);\n }\n fos.write(buf, 0, length);\n total += length;\n }\n fos.close();\n \n // set the ps to read from the file we just created.\n FileInputStream fis = new FileInputStream(f);\n BufferedInputStream bis = new BufferedInputStream(fis);\n ps.setAsciiStream(index, bis, total);\n }", "NewsFile selectByPrimaryKey(Integer fileId);", "private FileOperations() throws FileNotFoundException {\r\n\t\tbiddingPersistence = new BiddingPersistence(Constants.biddingsFilePath, \r\n\t\t\t\tConstants.indexBiddingsPath);\r\n\t\tusersPersistence = new UsersPersistence(Constants.usersFilePath,\r\n\t\t\t\tConstants.indexUsersPath);\t\t\r\n\t}", "public String getDBString();", "static Vector< DbRecord > ReadRecords( String szDbDir )\n {\n File DbDir;\n File[] files;\n Vector<DbRecord> Users = new Vector<DbRecord>( 10, 10 );\n\n // Read all records to identify\n DbDir = new File( szDbDir );\n files = DbDir.listFiles();\n\n if( (files == null) || (files.length == 0) )\n {\n return Users;\n }\n\n for( int iFiles = 0; iFiles < files.length; iFiles++)\n {\n try\n {\n if( files[iFiles].isFile() )\n {\n DbRecord User = new DbRecord( files[iFiles].getAbsolutePath() );\n Users.add( User );\n }\n }\n catch( FileNotFoundException e )\n {\n // The record has invalid data. Skip it and continue processing.\n }\n catch( NullPointerException e )\n {\n JOptionPane.showConfirmDialog(null, \"erro\"+e);\n }\n catch( AppException e )\n {\n // The record has invalid data or access denied. Skip it and continue processing.\n }\n }\n \n return Users;\n }", "DiaryFile selectByPrimaryKey(String maperId);", "public void createDBSchema() throws NoConnectionToDBException, SQLException, IOException {\n \n InputStream in = EDACCApp.class.getClassLoader().getResourceAsStream(\"edacc/resources/edacc.sql\");\n if (in == null) {\n throw new SQLQueryFileNotFoundException();\n }\n BufferedReader br = new BufferedReader(new InputStreamReader(in));\n String line;\n String text = \"\";\n String l;\n while ((line = br.readLine()) != null) {\n if (!(l = line.replaceAll(\"\\\\s\", \"\")).isEmpty() && !l.startsWith(\"--\")) {\n text += line + \" \";\n }\n }\n in.close();\n Vector<String> queries = new Vector<String>();\n String query = \"\";\n String delimiter = \";\";\n int i = 0;\n while (i < text.length()) {\n if (text.toLowerCase().startsWith(\"delimiter\", i)) {\n i += 10;\n delimiter = text.substring(i, text.indexOf(' ', i));\n i = text.indexOf(' ', i);\n } else if (text.startsWith(delimiter, i)) {\n queries.add(query);\n i += delimiter.length();\n query = \"\";\n } else {\n query += text.charAt(i);\n i++;\n }\n }\n if (!query.replaceAll(\" \", \"\").equals(\"\")) {\n queries.add(query);\n }\n boolean autoCommit = getConn().getAutoCommit();\n try {\n getConn().setAutoCommit(false);\n Statement st = getConn().createStatement();\n for (String q : queries) {\n st.execute(q);\n }\n st.close();\n getConn().commit();\n } catch (SQLException e) {\n getConn().rollback();\n throw e;\n } finally {\n getConn().setAutoCommit(autoCommit);\n }\n }", "private Db() {\n super(Ke.getDatabase(), null);\n }", "public static String SQLFromFile(String file) throws IOException{\n BufferedReader reader = new BufferedReader(new FileReader(file));\n StringBuilder sb = new StringBuilder();\n String line;\n while((line = reader.readLine()) != null){\n sb.append(line);\n sb.append(' ');\n }\n reader.close();\n return sb.toString();\n }", "@Override\n\tpublic void closeDB()\n\t{\n\n\t}", "public interface DbLoader {\n\n /**\n * prepares the database\n */\n void prepareDatabase();\n}", "public long getDbFileSize() {\r\n\tlong result = -1;\r\n\r\n\ttry {\r\n\t File dbFile = new File(fileName);\r\n\t if (dbFile.exists()) {\r\n\t\tresult = dbFile.length();\r\n\t }\r\n\t} catch (Exception e) {\r\n\t // nothing todo here\r\n\t}\r\n\r\n\treturn result;\r\n }", "public String getTableFile() \n\t{\n\t return tableFile ;\n\t}", "public static ParserResult loadDatabase(File fileToOpen, String encoding) throws IOException {\n \n Reader reader = getReader(fileToOpen, encoding);\n String suppliedEncoding = null;\n try {\n boolean keepon = true;\n int piv = 0, c;\n while (keepon) {\n c = reader.read();\n if ( (piv == 0 && Character.isWhitespace( (char) c)) ||\n c == GUIGlobals.SIGNATURE.charAt(piv))\n piv++;\n else\n keepon = false;\n found: if (piv == GUIGlobals.SIGNATURE.length()) {\n keepon = false;\n // Found the signature. The rest of the line is unknown, so we skip it:\n while (reader.read() != '\\n');\n // Then we must skip the \"Encoding: \"\n for (int i=0; i<GUIGlobals.encPrefix.length(); i++) {\n if (reader.read() != GUIGlobals.encPrefix.charAt(i))\n break found; // No, it doesn't seem to match.\n }\n // If ok, then read the rest of the line, which should contain the name\n // of the encoding:\n StringBuffer sb = new StringBuffer();\n while ((c = reader.read()) != '\\n')\n sb.append((char)c);\n suppliedEncoding = sb.toString();\n }\n \n }\n } catch (IOException ex) {}\n \n if ((suppliedEncoding != null) && (!suppliedEncoding.equalsIgnoreCase(encoding))) {\n Reader oldReader = reader;\n try {\n // Ok, the supplied encoding is different from our default, so we must make a new\n // reader. Then close the old one.\n reader = getReader(fileToOpen, suppliedEncoding);\n oldReader.close();\n //System.out.println(\"Using encoding: \"+suppliedEncoding);\n } catch (IOException ex) {\n reader = oldReader; // The supplied encoding didn't work out, so we keep our\n // existing reader.\n \n //System.out.println(\"Error, using default encoding.\");\n }\n } else {\n // We couldn't find a supplied encoding. Since we don't know far into the file we read,\n // we start a new reader.\n reader.close();\n reader = getReader(fileToOpen, encoding);\n //System.out.println(\"No encoding supplied, or supplied encoding equals default. Using default encoding.\");\n }\n \n \n //return null;\n \n BibtexParser bp = new BibtexParser(reader);\n \n ParserResult pr = bp.parse();\n pr.setEncoding(encoding);\n \n return pr;\n }", "public ODatabaseDocumentTx db();", "public static TreeBag<Golfer> loadDbFromFile(String dbFilename) \n {\n // used to store lines read from the database file\n String line;\n // create a new empty database\n TreeBag<Golfer> db = new TreeBag<Golfer>();\n // compile a regex pattern for parsing lines from the database file\n Pattern p = Pattern.compile(\"([\\\\w\\\\s-]+)(\\\\d+)\\\\s+(\\\\d+)\\\\s+(\\\\d+\\\\.?\\\\d*)\");\n // create file handle for the filename specified (in current directory)\n File f = new File(\".\"+ File.separator + dbFilename);\n\n // if the filename specified exists in the current directory,\n if (f.exists()) {\n System.out.println(\"\\nLoading golfers from database file '\"+ dbFilename +\"'...\");\n\n // try loading from the database file\n try {\n // create a new file reader using the file handle\n FileReader fr = new FileReader(f);\n // buffer the file reader\n BufferedReader buf = new BufferedReader(fr);\n\n // keep reading lines from the file buffer until we reach the end of file\n while ( (line = buf.readLine()) != null ) {\n // trim whitespace off the lines\n line = line.trim();\n //System.out.println(\"Read line:\\n\"+ line +\"\\n\");\n\n // create a matcher object using the pre-compiled regex pattern\n Matcher m = p.matcher(line);\n // if the matcher object found a match on the current line,\n if (m.find()) {\n // populate golfer data using match groups\n String name = m.group(1);\n int rounds = Integer.valueOf(m.group(2));\n int handicap = Integer.valueOf(m.group(3));\n double avg = Double.valueOf(m.group(4));\n // create a new golfer object\n Golfer g = new Golfer(name, rounds, handicap, avg);\n // add new golfer to the database\n db.add(g);\n /*\n System.out.println(\"Added golfer to database:\\n\"+ g +\"\\n\");\n System.out.println(\"Current database:\\n\"+ db);\n System.out.println(\"Tree view:\");\n db.displayAsTree();\n System.out.println(\"\\n\");\n */\n }\n }\n\n // at the end of the file, close the buffer\n buf.close();\n }\n // exception: specified file does not exist\n catch(FileNotFoundException e) {\n // print stack trace for debugging\n e.printStackTrace();\n System.out.println(\"File '\"+ dbFilename +\"' not found: \"+ e);\n }\n // exception: I/O error when reading from file\n catch(IOException e) {\n // print stack trace for debugging\n e.printStackTrace();\n System.out.println(\"Error reading file '\"+ dbFilename +\"': \"+ e);\n }\n }\n else\n System.out.println(\"Database file '\"+ dbFilename +\"' not found\");\n \n // return the newly compiled database\n return db;\n }", "String getClobField();", "abstract public int dbVersion();", "public abstract String toDBString();", "private static Connection _getDbConnection(String aPath)\n\t{\n\t\ttry\n\t\t{\n\t\t\t// Open file\n\t\t\tConnection c = DriverManager.getConnection(CONN_PREFIX+aPath);\n\t\t\tc.setAutoCommit(false);\n\t\t\tIO.dbOutD(\"Connection to DB at path \"+ aPath + \" established.\");\n\t\t\treturn c;\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tIO.dbOutE(e);\n\t\t\treturn null;\n\t\t}\n\t}", "@Override\r\n public Db_db currentDb(){return curDb_;}", "@Test(timeout = 4000)\n public void test126() throws Throwable {\n DBDataType dBDataType0 = DBDataType.getInstance(\"CLOB\");\n Integer integer0 = RawTransaction.SAVEPOINT_ROLLBACK;\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n DefaultDBColumn defaultDBColumn0 = new DefaultDBColumn(\"CLOB\", defaultDBTable0, dBDataType0, integer0);\n NameSpec nameSpec0 = NameSpec.NEVER;\n MockPrintWriter mockPrintWriter0 = new MockPrintWriter(\"#B0tMDNkWiXCI3n\");\n SQLUtil.renderCreateTable(defaultDBTable0, true, nameSpec0, mockPrintWriter0);\n assertEquals(\"table\", defaultDBTable0.getObjectType());\n }", "@Override\n\tpublic int dbsize() {\n\t\treturn 0;\n\t}" ]
[ "0.75162673", "0.7207716", "0.6856582", "0.63214904", "0.61810434", "0.6109898", "0.6099357", "0.60643154", "0.59978586", "0.5979398", "0.5952094", "0.5903999", "0.58972645", "0.585271", "0.5846257", "0.5809899", "0.58018017", "0.57985026", "0.57965136", "0.5771401", "0.57699853", "0.57660615", "0.5751976", "0.57483095", "0.573991", "0.57319665", "0.57164884", "0.5696641", "0.5687155", "0.568395", "0.56753296", "0.5667369", "0.5666063", "0.56496674", "0.5630785", "0.5625944", "0.56257564", "0.5618461", "0.55967504", "0.55848753", "0.5580355", "0.5579538", "0.55789524", "0.5563484", "0.55614966", "0.55604804", "0.55521995", "0.5550884", "0.5543351", "0.55340934", "0.55324435", "0.55278844", "0.552674", "0.55256736", "0.55248654", "0.55198175", "0.5513185", "0.55113673", "0.54969424", "0.5492285", "0.54781264", "0.5470682", "0.54671997", "0.546112", "0.5460634", "0.5439558", "0.5430981", "0.54204714", "0.54197943", "0.5417465", "0.54116", "0.54046506", "0.5402368", "0.5399423", "0.53944665", "0.5388514", "0.5385736", "0.5385214", "0.537763", "0.53700405", "0.5359754", "0.53582364", "0.53549147", "0.5353527", "0.53515434", "0.5348831", "0.5340497", "0.5334494", "0.53312504", "0.5331116", "0.53300834", "0.5328218", "0.5325344", "0.53162616", "0.53078955", "0.53073007", "0.53072876", "0.5306308", "0.5304805", "0.53032464", "0.5301233" ]
0.0
-1
see DbFile.java for javadocs
public void writePage(Page page) throws IOException { // some code goes here // not necessary for lab1 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public File getInputDb();", "public File getOutputDb();", "private String getFileTableQuery() {\n \t\tfinal StringBuilder builder = new StringBuilder();\n \n \t\tbuilder.append(\"create table FILE(\");\n \t\tbuilder.append(\"FILE_ID LONG PRIMARY KEY,\");\n \t\tbuilder.append(\"FILE_PATH TEXT,\");\n \t\tbuilder.append(\"START_REVISION_ID LONG,\");\n \t\tbuilder.append(\"END_REVISION_ID LONG\");\n \t\tbuilder.append(\")\");\n \n \t\treturn builder.toString();\n \t}", "public String getDatabaseFileName();", "public FileDatabase(String filename) throws IOException {\n\t\tdatabase = new File(filename);\n\t\tread();\n\t}", "public synchronized void writeFromFileIntoDB()throws IOWrapperException, IOIteratorException{\r\n \r\n fromFile_Name=Controller.CLASSES_TMP_FILENAME;\r\n iow_ReadFromFile = new IOWrapper();\r\n \r\n //System.out.println(\"Readin' from \"+fromFile_Name);\r\n \r\n iow_ReadFromFile.setupInput(fromFile_Name,0);\r\n \r\n iter_ReadFromFile = iow_ReadFromFile.getLineIterator();\r\n iow_ReadFromFile.setupOutput(this.dbname,this.username,this.password,this.hostname,this.port);\r\n \r\n iow_ReadFromFile.sendOutputQuery(\"DROP TABLE IF EXISTS \"+outtable);\r\n \r\n iow_ReadFromFile.sendOutputQuery(\r\n \"CREATE TABLE IF NOT EXISTS \"\r\n +outtable+\" (\"\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[0]+\" int(10) NOT NULL AUTO_INCREMENT, \"//wort_nr\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[1]+\" varchar(225), \"//wort_alph\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[2]+\" int(10), \"//krankheit \r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[3]+\" int(10), \"//farbe1 \r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[4]+\" real(8,2), \"//farbe1prozent\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[5]+\" int(10), \"//farbe2\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[6]+\" real(8,2), \"//farbe2prozent\r\n +\"PRIMARY KEY (\"+Controller.COLUMN_NAMES_FOR_DB_OUT[0]+\")) \"\r\n +\"ENGINE=MyISAM\"\r\n );\r\n while(iter_ReadFromFile.hasNext()){\r\n singleProgress+=1;\r\n String[] data = (String[])iter_ReadFromFile.next();\r\n \r\n //System.out.println(\"--> processing line \"+data);\r\n //escape quotes ' etc for SQL query\r\n if(data[1].matches(\".*'.*\")||data[1].matches(\".*\\\\.*\")){\r\n int sl = data[1].length();\r\n String escapedString = \"\";\r\n \r\n for (int i = 0; i < sl; i++) {\r\n char ch = data[1].charAt(i);\r\n switch (ch) {\r\n case '\\'':\r\n escapedString +='\\\\';\r\n escapedString +='\\'';\r\n break;\r\n case '\\\\':\r\n escapedString +='\\\\';\r\n escapedString +='\\\\';\r\n break;\r\n default :\r\n escapedString +=ch;\r\n break;\r\n }\r\n }\r\n data[1]=escapedString;\r\n }\r\n \r\n String insertStatement=\"INSERT INTO \"\r\n +outtable+\" (\"\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[0]+\", \"//node id\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[1]+\", \"//label\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[2]+\", \"//class id \r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[3]+\", \"//class id 1 \r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[4]+\", \"//percent\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[5]+\", \"//class id 2\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[6]+\") \"//percent \r\n +\"VALUES ('\"\r\n +data[0]+\"', '\"\r\n +data[1]+\"', '\"\r\n +data[2]+\"', '\"\r\n +data[3]+\"', '\"\r\n +data[4]+\"', '\"\r\n +data[5]+\"', '\"\r\n +data[6]+\"')\";\r\n \r\n //System.out.println(\"Sending insert statement:\"+insertStatement);\r\n iow_ReadFromFile.sendOutputQuery(insertStatement);\r\n }\r\n \r\n \r\n //iow_ReadFromFile.closeOutput();\r\n \r\n this.stillWorks=false;\r\n writeIntoDB=false;\r\n System.out.println(\"*\\tData written into database.\");\r\n\t}", "interface DataTableFile extends TableDataSource {\n\n /**\n * Creates a new file of the given table. The table is initialised and\n * contains 0 row entries. If the table already exists in the database then\n * this will throw an exception.\n * <p>\n * On exit, the object will be initialised and loaded with the given table.\n *\n * @param def the definition of the table.\n */\n void create(DataTableDef def) throws IOException;\n\n /**\n * Updates a file of the given table. If the table does not exist, then it\n * is created. If the table already exists but is different, then the\n * existing table is modified to incorporate the new fields structure.\n * <p>\n * The DataTableFile must have previously been 'load(table_name)' before\n * this call.\n * <p>\n * Implementations of this method may choose to reorganise information that\n * the relational schemes are dependant on (the row order for example). If\n * this method returns 'true' then we must also reindex the schemes.\n * <p>\n * <strong>NOTE:</strong> If the new format has columns that are not\n * included in the new format then the columns are deleted.\n *\n * @param def the definition of the table.\n * @return true if the table topology has changed.\n */\n boolean update(DataTableDef def) throws IOException;\n\n /**\n * This is called periodically when this data table file requires some\n * maintenance. It is recommended that this method is called every\n * time the table is initialized (loaded).\n * <p>\n * The DataTableFile must have previously been 'load(table_name)' before\n * this call.\n * <p>\n * This method may change the topology of the rows (delete rows that are\n * marked as deleted), therefore if the method returns true you need to\n * re-index the schemes.\n *\n * @return true if the table topology was changed.\n */\n boolean doMaintenance() throws IOException;\n\n// /**\n// * A recovery method that returns a DataTableDef object for this data\n// * table file that was last used in a call to 'create' or 'update'. This\n// * information should be kept in a secondary table topology store but it\n// * is useful to keep this information in the data table file just incase\n// * something bad happens, or tables are moved to another database.\n// */\n// DataTableDef recoverLastDataTableDef() throws IOException;\n\n /**\n * Loads a previously created table. A table can be loaded in read only\n * mode, in which case any methods that write to the DataTableFile will\n * throw an IOException.\n *\n * @param table_name the name of the table.\n * @param read_only if true then the table file is opened as read-only.\n */\n void load(String table_name, boolean read_only) throws IOException;\n\n /**\n * Shuts down the table. This is called when the table is closed and the\n * resources it uses are to be freed back to the system. This is called\n * as part of the database shut down procedure or called when we want to\n * free the resources associated with this table.\n */\n void shutdown() throws IOException;\n\n /**\n * Deletes the data table file in the file system. This is used to clear\n * up resources after a table has been dropped. The table must be shut\n * down before this method is called.\n * <p>\n * NOTE: Use this with care. All data is lost!\n */\n void drop();\n\n /**\n * Flushes all information that may be cached in memory to disk. This\n * includes any relational data, any cached data that hasn't made it to\n * the file system yet. It will write out all persistant information\n * and leave the table in a state where it is fully represented in the\n * file system.\n */\n void updateFile() throws IOException;\n\n /**\n * Locks the data in the file to prevent the system overwritting entries\n * that have been marked as removed. This is necessary so we may still\n * safely read removed entries from the table while the table is locked.\n */\n void addRowsLock();\n\n /**\n * Unlocks the data in the file to indicate that the system may safely\n * overwrite removed entries in the file.\n */\n void removeRowsLock();\n\n /**\n * Returns true if the file currently has all of its rows locked.\n */\n boolean hasRowsLocked();\n\n// /**\n// * The number of rows that are currently stored in this table. This number\n// * does not include the rows that have been marked as removed.\n// */\n// int rowCount();\n\n /**\n * Returns true if the given row index points to a valid and available\n * row entry. Returns false if the row entry has been marked as removed,\n * or the index goes outside the bounds of the table.\n */\n boolean isRowValid(int record_index) throws IOException;\n\n /**\n * Adds a complete new row into the table. If the table is in a row locked\n * state, then this will always add a new entry to the end of the table.\n * Otherwise, new entries are added where entries were previously removed.\n * <p>\n * This will update any column indices that are set.\n *\n */\n int addRow(RowData row_data) throws IOException;\n\n /**\n * Removes a row from the table at the given index. This will only mark\n * the entry as removed, and will not actually remove the data. This is\n * because a process is allowed to read the data even after the row has been\n * marked as removed (if the rows have been locked).\n * <p>\n * This will update any column indices that are set.\n *\n * @param row_index the raw row index of the entry to be marked as removed.\n */\n void removeRow(int row_index) throws IOException;\n\n// /**\n// * Returns a DataCell object of the entry at the given column, row\n// * index in the table. This will always work provided there was once data\n// * stored at that index, even if the row has been marked as deleted.\n// */\n// DataCell getCellAt(int column, int row) throws IOException;\n\n /**\n * Returns a unique number. This is incremented each time it is accessed.\n */\n long nextUniqueKey() throws IOException;\n\n}", "public DatabaseFileInformation(byte[] aFileBytes)\n {\n mTables = new LinkedList<>();\n\n mHeader = (short) (((0xFF) & aFileBytes[1]) | (((0xFF) & aFileBytes[0]) << 8));\n mVersion = (short) (((0xFF) & aFileBytes[3]) | (((0xFF) & aFileBytes[2]) << 8));\n mUnknown1 = ((0xFF) & aFileBytes[7]) | (((0xFF) & aFileBytes[6]) << 8) | (((0xFF) & aFileBytes[5]) <<\n 16) | (((0xFF) & aFileBytes[4]) << 24);\n mDatabaseSize = ((0xFF) & aFileBytes[11]) | (((0xFF) & aFileBytes[10]) << 8) | (((0xFF) & aFileBytes[9]) <<\n 16) | (((0xFF) & aFileBytes[8]) << 24);\n mZero = ((0xFF) & aFileBytes[15]) | (((0xFF) & aFileBytes[14]) << 8) | (((0xFF) & aFileBytes[13]) <<\n 16) | (((0xFF) & aFileBytes[12]) << 24);\n mTableCount = ((0xFF) & aFileBytes[19]) | (((0xFF) & aFileBytes[18]) << 8) | (((0xFF) & aFileBytes[17]) <<\n 16) | (((0xFF) & aFileBytes[16]) << 24);\n mUnknown2 = ((0xFF) & aFileBytes[23]) | (((0xFF) & aFileBytes[22]) << 8) | (((0xFF) & aFileBytes[21]) <<\n 16) | (((0xFF) & aFileBytes[20]) << 24);\n\n int lTableDefinitionPosition = 24;\n int lTableDataStart = lTableDefinitionPosition + (mTableCount * 8);\n\n // Read the table definitions.\n for (int i = 0; i < mTableCount; i++)\n {\n DatabaseTable lDatabaseTable = new DatabaseTable();\n lDatabaseTable.readTableDefinition(aFileBytes, lTableDefinitionPosition);\n lDatabaseTable.readTableHeader(aFileBytes, lTableDataStart);\n mTables.add(lDatabaseTable);\n lTableDefinitionPosition += 8;\n }\n }", "public interface DatabaseManager {\r\n\r\n // NOTE: this is a draft of the interface. More methods will likely be\r\n // added.\r\n\r\n /**\r\n * Uploads the specified feature to the database.\r\n * \r\n * @param file the shapefile (*.shp) to upload\r\n * @param project the project to associate the shapefile with\r\n * @return the id of the feature in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadFeature(File file, String project) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified modis tile to the database.\r\n * \r\n * @param file the .hdf to upload\r\n * @param product the modis product\r\n * @param date the date the data was captured\r\n * @param downloaded the date the data was downloaded from the host\r\n * @param horz the horizontal tile number\r\n * @param vert the vertical tile number\r\n * @return the id of the Modis raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadModis(File file, ModisProduct product, DataDate date, DataDate updated, int horz, int vert) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified ETo file to the database.\r\n * \r\n * @param file the\r\n * @param date\r\n * @param updated\r\n * @return the id of the ETo raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadEto(File file, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified TRMM file to the database.\r\n * \r\n * @param file\r\n * @param date\r\n * @param updated\r\n * @return the id of the TRMM raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadTrmm(File file, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified projected Modis product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param product\r\n * @param date\r\n * @param updated\r\n * @return the id of the projected Modis raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadProjectedModis(File file, String project, ModisProduct product, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified projected ETo product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the projected ETo raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadProjectedEto(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the projected TRMM product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the TRMM raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadProjectedTrmm(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified ETa product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the ETa raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadEta(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified EVI product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the EVI raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadEvi(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified NDVI product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the NDVI raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadNdvi(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified NDWI5 product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the NDWI5 raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadNdwi5(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified NDWI6 product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the NDWI6 raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadNdwi6(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified SAVI product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the SAVI raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadSavi(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified feature and places it in the specified file in\r\n * the shapefile.\r\n * \r\n * @param file the location to save the feature\r\n * @param id the id of the feature\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadFeature(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified Modis tile from the database.\r\n * \r\n * @param file\r\n * @param product\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadModis(File file, ModisProduct product, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified ETo raster from the database and saves it to the\r\n * specified file.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadEto(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified TRMM raster from the database and saves it to the\r\n * specified file.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadTrmm(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified projected Modis product from the database.\r\n * \r\n * @param file\r\n * @param product\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadProjectedModis(File file, ModisProduct product, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified projected ETo product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadProjectedEto(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified projected TRMM product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadProjectedTrmm(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified ETa product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadEta(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified EVI product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadEvi(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified NDVI product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadNdvi(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified NDWI5 product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadNdwi5(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified NDWI6 product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadNdwi6(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified SAVI product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadSavi(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Returns the id of the MODIS raster for the specified product and date.\r\n * \r\n * @param product\r\n * @param date\r\n * @param horz\r\n * @param vert\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getModisId(ModisProduct product, DataDate date, int horz, int vert) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the ETo for the specified date.\r\n * \r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getEtoId(DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the TRMM for the specified date.\r\n * \r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getTrmmId(DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the reprojected Modis raster for the specified\r\n * project, product, and date.\r\n * \r\n * @param project\r\n * @param product\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getReprojectedModisId(String project, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the reprojected ETo raster for the specified project\r\n * and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getReprojectedEtoId(String project, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the reprojected TRMM raster for the specified project\r\n * and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getReprojectedTrmmId(String project, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the ETa raster for the specified project and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getEtaId(String project, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the EVI raster for the specified project and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getEviId(String project, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the NDVI raster for the specified project and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getNdviId(String project, String feature, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the NDWI5 raster for the specified project and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getNdwi5Id(String project, String feature, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the NDWI6 raster for the specified project and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getNdwi6Id(String project, String feature, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the SAVI raster for the specified project and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getSaviId(String project, String feature, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Uploads the specified zonal statistics.\r\n * \r\n * @param project\r\n * @param feature\r\n * @param zoneField\r\n * @param zone\r\n * @param date\r\n * @param index\r\n * @param zonalStatistics\r\n */\r\n void uploadZonalStatistic(String project, String feature, String zoneField,\r\n String zone, DataDate date, EnvironmentalIndex index,\r\n ZonalStatistic zonalStatistics) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the zonal statistics for the specified parameters.\r\n * \r\n * @param project\r\n * @param feature\r\n * @param zoneField\r\n * @param zone\r\n * @param date\r\n * @param index\r\n * @return the id or -1 if it is not found\r\n */\r\n int getZonalStatisticId(String project, String feature, String zoneField,\r\n String zone, DataDate date, EnvironmentalIndex index)\r\n throws SQLException;\r\n\r\n /**\r\n * Returns zonal statistics for the specified zonal statistic id.\r\n * \r\n * @param id\r\n * @return zonal statistics\r\n * @throws SQLException\r\n */\r\n ZonalStatistic getZonalStatistic(int id) throws SQLException;\r\n}", "public abstract String apachedb(int size);", "public void createDB() {\n\t\ttry {\n\t\t\tBufferedReader br= new BufferedReader(new FileReader(\"db_schema.txt\"));\n\t\t\tString line= null;\n\t\t\tStringBuilder sb= new StringBuilder();\n\t\t\twhile ((line=br.readLine())!=null){\n\t\t\t\tsb.append(line);\n\t\t\t\tif(sb.length()>0 && sb.charAt(sb.length()-1)==';'){//see if it is the end of one line of command\n\t\t\t\t\tstatement.executeUpdate(sb.toString());\n\t\t\t\t\tsb= new StringBuilder();\n\t\t\t\t}\n\t\t\t}\n\t\t\tbr.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public String getPath() { return db.getPath(); }", "String getUserDatabaseFilePath();", "public abstract ODatabaseInternal<?> openDatabase();", "private DBManager() throws Exception {\n file = new File(\"pdfLibraryDB.mv.db\");\n if (!file.exists()) {\n conn = connect();\n stmt = conn.createStatement();\n query = \"CREATE TABLE user(username VARCHAR(30) PRIMARY KEY, password VARCHAR(32));\" +\n \"CREATE TABLE category(id VARCHAR(30) PRIMARY KEY, name VARCHAR(30), username VARCHAR(30), FOREIGN KEY(username) REFERENCES user(username) ON UPDATE CASCADE ON DELETE CASCADE);\"+\n \"CREATE TABLE favorite(id VARCHAR(30) PRIMARY KEY, path VARCHAR(500), keyword VARCHAR(200), searchType VARCHAR(10), category VARCHAR(30),username VARCHAR(30), FOREIGN KEY(username) REFERENCES user(username) ON UPDATE CASCADE ON DELETE CASCADE, FOREIGN KEY(category) REFERENCES category(id) ON UPDATE CASCADE ON DELETE CASCADE);\" +\n \"CREATE TABLE history(id VARCHAR(30) PRIMARY KEY, keyword VARCHAR(200), type VARCHAR(10), directory VARCHAR(500), username VARCHAR(30), FOREIGN KEY(username) REFERENCES user(username) ON UPDATE CASCADE ON DELETE CASCADE);\";\n stmt.executeUpdate(query);\n stmt.close();\n conn.close();\n System.out.println(\"DB created!\");\n }\n }", "@Test\n public void reading()\n throws FileNotFoundException, IOException, CorruptedTableException\n {\n final Database database =\n new Database(new File(\"src/test/resources/\" + versionDirectory + \"/rndtrip\"), version);\n final Set<String> tableNames = database.getTableNames();\n\n assertEquals(2,\n tableNames.size());\n assertTrue(\"TABLE1 not found in 'short roundtrip' database\",\n tableNames.contains(\"TABLE1.DBF\"));\n assertTrue(\"TABLE2 not found in 'short roundtrip' database\",\n tableNames.contains(\"TABLE2.DBF\"));\n\n final Table t1 = database.getTable(\"TABLE1.DBF\");\n\n try\n {\n t1.open(IfNonExistent.ERROR);\n\n assertEquals(\"Table name incorrect\",\n \"TABLE1.DBF\",\n t1.getName());\n assertEquals(\"Last modified date incorrect\",\n Util.createDate(2009, Calendar.APRIL, 1),\n t1.getLastModifiedDate());\n\n final List<Field> fields = t1.getFields();\n\n Iterator<Field> fieldIterator = fields.iterator();\n Map<String, Field> nameFieldMap = new HashMap<String, Field>();\n\n while (fieldIterator.hasNext())\n {\n Field f = fieldIterator.next();\n nameFieldMap.put(f.getName(),\n f);\n }\n\n final Field idField = nameFieldMap.get(\"ID\");\n assertEquals(Type.NUMBER,\n idField.getType());\n assertEquals(idField.getLength(),\n 3);\n\n final Field stringField = nameFieldMap.get(\"STRFIELD\");\n assertEquals(Type.CHARACTER,\n stringField.getType());\n assertEquals(stringField.getLength(),\n 50);\n\n final Field logicField = nameFieldMap.get(\"LOGICFIELD\");\n assertEquals(Type.LOGICAL,\n logicField.getType());\n assertEquals(logicField.getLength(),\n 1);\n\n final Field dateField = nameFieldMap.get(\"DATEFIELD\");\n assertEquals(Type.DATE,\n dateField.getType());\n assertEquals(8,\n dateField.getLength());\n\n final Field floatField = nameFieldMap.get(\"FLOATFIELD\");\n assertEquals(Type.NUMBER,\n floatField.getType());\n assertEquals(10,\n floatField.getLength());\n\n final List<Record> records = UnitTestUtil.createSortedRecordList(t1.recordIterator(),\n \"ID\");\n final Record r0 = records.get(0);\n\n assertEquals(1,\n r0.getNumberValue(\"ID\"));\n assertEquals(\"String data 01\",\n r0.getStringValue(\"STRFIELD\").trim());\n assertEquals(true,\n r0.getBooleanValue(\"LOGICFIELD\"));\n assertEquals(Util.createDate(1909, Calendar.MARCH, 18),\n r0.getDateValue(\"DATEFIELD\"));\n assertEquals(1234.56,\n r0.getNumberValue(\"FLOATFIELD\"));\n\n final Record r1 = records.get(1);\n\n assertEquals(2,\n r1.getNumberValue(\"ID\"));\n assertEquals(\"String data 02\",\n r1.getStringValue(\"STRFIELD\").trim());\n\n /*\n * in Clipper 'false' value can be given as an empty field, and the method called here\n * returns then 'null' as the return value\n */\n if (version == Version.CLIPPER_5)\n {\n assertEquals(null,\n r1.getBooleanValue(\"LOGICFIELD\"));\n }\n else\n {\n assertEquals(false,\n r1.getBooleanValue(\"LOGICFIELD\"));\n }\n\n assertEquals(Util.createDate(1909, Calendar.MARCH, 20),\n r1.getDateValue(\"DATEFIELD\"));\n assertEquals(-23.45,\n r1.getNumberValue(\"FLOATFIELD\"));\n\n final Record r2 = records.get(2);\n\n assertEquals(3,\n r2.getNumberValue(\"ID\"));\n assertEquals(\"\",\n r2.getStringValue(\"STRFIELD\").trim());\n assertEquals(null,\n r2.getBooleanValue(\"LOGICFIELD\"));\n assertEquals(null,\n r2.getDateValue(\"DATEFIELD\"));\n assertEquals(null,\n r2.getNumberValue(\"FLOATFIELD\"));\n\n final Record r3 = records.get(3);\n\n assertEquals(4,\n r3.getNumberValue(\"ID\"));\n assertEquals(\"Full5678901234567890123456789012345678901234567890\",\n r3.getStringValue(\"STRFIELD\").trim());\n\n /*\n * in Clipper 'false' value can be given as an empty field, and the method called here\n * returns then 'null' as the return value\n */\n if (version == Version.CLIPPER_5)\n {\n assertEquals(null,\n r3.getBooleanValue(\"LOGICFIELD\"));\n }\n else\n {\n assertEquals(false,\n r3.getBooleanValue(\"LOGICFIELD\"));\n }\n\n assertEquals(Util.createDate(1909, Calendar.MARCH, 20),\n r3.getDateValue(\"DATEFIELD\"));\n assertEquals(-0.30,\n r3.getNumberValue(\"FLOATFIELD\"));\n }\n finally\n {\n t1.close();\n }\n\n final Table t2 = database.getTable(\"TABLE2.DBF\");\n\n try\n {\n t2.open(IfNonExistent.ERROR);\n\n final List<Field> fields = t2.getFields();\n\n Iterator<Field> fieldIterator = fields.iterator();\n Map<String, Field> nameFieldMap = new HashMap<String, Field>();\n\n while (fieldIterator.hasNext())\n {\n Field f = fieldIterator.next();\n nameFieldMap.put(f.getName(),\n f);\n }\n\n final Field idField = nameFieldMap.get(\"ID2\");\n assertEquals(Type.NUMBER,\n idField.getType());\n assertEquals(idField.getLength(),\n 4);\n\n final Field stringField = nameFieldMap.get(\"MEMOFIELD\");\n assertEquals(Type.MEMO,\n stringField.getType());\n assertEquals(10,\n stringField.getLength());\n\n final Iterator<Record> recordIterator = t2.recordIterator();\n final Record r = recordIterator.next();\n\n String declarationOfIndependence = \"\";\n\n declarationOfIndependence += \"When in the Course of human events it becomes necessary for one people \";\n declarationOfIndependence += \"to dissolve the political bands which have connected them with another and \";\n declarationOfIndependence += \"to assume among the powers of the earth, the separate and equal station to \";\n declarationOfIndependence += \"which the Laws of Nature and of Nature's God entitle them, a decent respect \";\n declarationOfIndependence += \"to the opinions of mankind requires that they should declare the causes which \";\n declarationOfIndependence += \"impel them to the separation.\";\n declarationOfIndependence += \"\\r\\n\\r\\n\";\n declarationOfIndependence += \"We hold these truths to be self-evident, that all men are created equal, \";\n declarationOfIndependence += \"that they are endowed by their Creator with certain unalienable Rights, \";\n declarationOfIndependence += \"that among these are Life, Liberty and the persuit of Happiness.\";\n\n assertEquals(1,\n r.getNumberValue(\"ID2\"));\n assertEquals(declarationOfIndependence,\n r.getStringValue(\"MEMOFIELD\"));\n }\n finally\n {\n t2.close();\n }\n }", "@Insert({ \"insert into csv_file (id, pid, \", \"filename, start_time, \", \"end_time, length, \", \"density, machine, \",\n\t\t\t\"ar, path, size, \", \"uuid, header_time, \", \"last_update, conflict_resolved, \", \"status, comment, \",\n\t\t\t\"width, start_version, \", \"end_version)\", \"values (#{id,jdbcType=INTEGER}, #{pid,jdbcType=VARCHAR}, \",\n\t\t\t\"#{filename,jdbcType=VARCHAR}, #{startTime,jdbcType=TIMESTAMP}, \",\n\t\t\t\"#{endTime,jdbcType=TIMESTAMP}, #{length,jdbcType=INTEGER}, \",\n\t\t\t\"#{density,jdbcType=DOUBLE}, #{machine,jdbcType=VARCHAR}, \",\n\t\t\t\"#{ar,jdbcType=BIT}, #{path,jdbcType=VARCHAR}, #{size,jdbcType=BIGINT}, \",\n\t\t\t\"#{uuid,jdbcType=CHAR}, #{headerTime,jdbcType=TIMESTAMP}, \",\n\t\t\t\"#{lastUpdate,jdbcType=TIMESTAMP}, #{conflictResolved,jdbcType=BIT}, \",\n\t\t\t\"#{status,jdbcType=INTEGER}, #{comment,jdbcType=VARCHAR}, \",\n\t\t\t\"#{width,jdbcType=INTEGER}, #{startVersion,jdbcType=INTEGER}, \", \"#{endVersion,jdbcType=INTEGER})\" })\n\tint insert(CsvFile record);", "public void database() throws IOException\n {\n \tFile file =new File(\"data.txt\");\n\t if(!file.exists())\n\t {\n\t \tSystem.out.println(\"File 'data.txt' does not exit\");\n\t System.out.println(file.createNewFile());\n\t file.createNewFile();\n\t databaseFileWrite(file);//call the databaseFileRead() method, to initialize data from ArrayList and write data into data.txt\n\t }\n\t else\n\t {\n\t \tdatabaseFileRead();//call the databaseFileRead() method, to load data directly from data.txt\n\t }\n }", "@Override\n\tpublic void CreateDatabaseFromFile() {\n\t\tfinal String FILENAME = \"fandv.sql\";\n\t\tint[] updates = null;\n\t\ttry {\n\t\t\tMyDatabase db = new MyDatabase();\n\t\t\tupdates = db.updateAll(FILENAME);\n\t\t} catch (FileNotFoundException | SQLException | ClassNotFoundException e) {\n\t\t\tSystem.out.println(\"Database issue\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < updates.length; i++) {\n\t\t\tsum += updates[i];\n\t\t}\n\t\tSystem.out.println(\"Number of updates: \" + sum);\n\t}", "public GEMFileRockDao() {\n gemFileDb = RocksDatabase.getInstance(DB_NAME, String.class, GEMFile.class);\n gemFileFileTypesDb =\n RocksDatabase.getInstance(DB_NAME + \"_FileType\", String.class, Integer.class);\n gemFileState = RocksDatabase.getInstance(DB_NAME + \"_FileState\", String.class, String.class);\n gemFileState.put(STATE_SYNC_PROGRESS, String.valueOf(SYNC_COMPLETE));\n }", "public DBInternal(File directory, DBOptions options) {\n this.directory = directory;\n this.options = options;\n // TODO: check options.\n\n // TODO: rebuid index.\n\n // TODO: initialize fileID. Make sure the starting number is the largest number used so far.\n\n // TODO: open a current file writer.\n\n // TODO: start offline compaction.\n\n }", "public final void executeSQL(Connection conn,DbConnVO vo,String fileName) throws Throwable {\r\n PreparedStatement pstmt = null;\r\n StringBuffer sql = new StringBuffer(\"\");\r\n InputStream in = null;\r\n\r\n try {\r\n try {\r\n in = this.getClass().getResourceAsStream(\"/\" + fileName);\r\n }\r\n catch (Exception ex5) {\r\n }\r\n if (in==null)\r\n in = new FileInputStream(org.openswing.swing.util.server.FileHelper.getRootResource() + fileName);\r\n\r\n BufferedReader br = new BufferedReader(new InputStreamReader(in));\r\n String line = null;\r\n ArrayList vals = new ArrayList();\r\n int pos = -1;\r\n String oldfk = null;\r\n String oldIndex = null;\r\n StringBuffer newIndex = null;\r\n StringBuffer newfk = null;\r\n ArrayList fks = new ArrayList();\r\n ArrayList indexes = new ArrayList();\r\n boolean fkFound = false;\r\n boolean indexFound = false;\r\n String defaultValue = null;\r\n int index = -1;\r\n StringBuffer unicode = new StringBuffer();\r\n boolean useDefaultValue = false;\r\n// vo.getDriverName().equals(\"oracle.jdbc.driver.OracleDriver\") ||\r\n// vo.getDriverName().equals(\"com.microsoft.jdbc.sqlserver.SQLServerDriver\") ||\r\n//\t\t\t\t\tvo.getDriverName().equals(\"com.microsoft.sqlserver.jdbc.SQLServerDriver\") ||\r\n// vo.getDriverName().equals(\"com.mysql.jdbc.Driver\");\r\n while ( (line = br.readLine()) != null) {\r\n sql.append(' ').append(line);\r\n if (line.endsWith(\";\")) {\r\n if (vo.getDriverName().equals(\"oracle.jdbc.driver.OracleDriver\")) {\r\n sql = replace(sql, \" VARCHAR(\", \" VARCHAR2(\");\r\n sql = replace(sql, \" NUMERIC(\", \" NUMBER(\");\r\n sql = replace(sql, \" DECIMAL(\", \" NUMBER(\");\r\n sql = replace(sql, \" TIMESTAMP\", \" DATE \");\r\n sql = replace(sql, \" DATETIME\", \" DATE \");\r\n }\r\n else if (vo.getDriverName().equals(\"com.microsoft.jdbc.sqlserver.SQLServerDriver\")) {\r\n sql = replace(sql, \" TIMESTAMP\", \" DATETIME \");\r\n sql = replace(sql, \" DATE \", \" DATETIME \");\r\n }\r\n else if (vo.getDriverName().equals(\"com.microsoft.sqlserver.jdbc.SQLServerDriver\")) {\r\n sql = replace(sql, \" TIMESTAMP\", \" DATETIME \");\r\n sql = replace(sql, \" DATE \", \" DATETIME \");\r\n }\r\n else if (vo.getDriverName().toLowerCase().contains(\"postgres\")) {\r\n sql = replace(sql, \" DATETIME\", \" TIMESTAMP \");\r\n sql = replace(sql, \" DATE \", \" TIMESTAMP \");\r\n }\r\n else {\r\n sql = replace(sql, \" DATE \", \" DATETIME \");\r\n }\r\n\r\n\r\n sql = replace(sql,\"ON DELETE NO ACTION\",\"\");\r\n sql = replace(sql,\"ON UPDATE NO ACTION\",\"\");\r\n\r\n if (sql.indexOf(\":COMPANY_CODE\") != -1) {\r\n sql = replace(sql, \":COMPANY_CODE\", \"'\" + vo.getCompanyCode() + \"'\");\r\n }\r\n if (sql.indexOf(\":COMPANY_DESCRIPTION\") != -1) {\r\n sql = replace(sql, \":COMPANY_DESCRIPTION\",\r\n \"'\" + vo.getCompanyDescription() + \"'\");\r\n }\r\n if (sql.indexOf(\":LANGUAGE_CODE\") != -1) {\r\n sql = replace(sql, \":LANGUAGE_CODE\",\r\n \"'\" + vo.getLanguageCode() + \"'\");\r\n }\r\n if (sql.indexOf(\":LANGUAGE_DESCRIPTION\") != -1) {\r\n sql = replace(sql, \":LANGUAGE_DESCRIPTION\",\r\n \"'\" + vo.getLanguageDescription() + \"'\");\r\n }\r\n if (sql.indexOf(\":CLIENT_LANGUAGE_CODE\") != -1) {\r\n sql = replace(sql, \":CLIENT_LANGUAGE_CODE\",\r\n \"'\" + vo.getClientLanguageCode() + \"'\");\r\n }\r\n if (sql.indexOf(\":PASSWORD\") != -1) {\r\n sql = replace(sql, \":PASSWORD\", \"'\" + vo.getAdminPassword() + \"'\");\r\n }\r\n if (sql.indexOf(\":DATE\") != -1) {\r\n sql = replace(sql, \":DATE\", \"?\");\r\n vals.add(new java.sql.Date(System.currentTimeMillis()));\r\n }\r\n\r\n if (sql.indexOf(\":CURRENCY_CODE\") != -1) {\r\n sql = replace(sql, \":CURRENCY_CODE\", \"'\" + vo.getCurrencyCodeREG03() + \"'\");\r\n }\r\n if (sql.indexOf(\":CURRENCY_SYMBOL\") != -1) {\r\n sql = replace(sql, \":CURRENCY_SYMBOL\", \"'\" + vo.getCurrencySymbolREG03() + \"'\");\r\n }\r\n if (sql.indexOf(\":DECIMALS\") != -1) {\r\n sql = replace(sql, \":DECIMALS\", vo.getDecimalsREG03().toString());\r\n }\r\n if (sql.indexOf(\":DECIMAL_SYMBOL\") != -1) {\r\n sql = replace(sql, \":DECIMAL_SYMBOL\", \"'\" + vo.getDecimalSymbolREG03() + \"'\");\r\n }\r\n if (sql.indexOf(\":THOUSAND_SYMBOL\") != -1) {\r\n sql = replace(sql, \":THOUSAND_SYMBOL\", \"'\" + vo.getThousandSymbolREG03() + \"'\");\r\n }\r\n\r\n if (sql.indexOf(\":USE_VARIANT_TYPE_1\") != -1) {\r\n sql = replace(sql, \":USE_VARIANT_TYPE_1\", \"'\" + vo.getUseVariantType1() + \"'\");\r\n }\r\n if (sql.indexOf(\":USE_VARIANT_TYPE_2\") != -1) {\r\n sql = replace(sql, \":USE_VARIANT_TYPE_2\", \"'\" + vo.getUseVariantType2() + \"'\");\r\n }\r\n if (sql.indexOf(\":USE_VARIANT_TYPE_3\") != -1) {\r\n sql = replace(sql, \":USE_VARIANT_TYPE_3\", \"'\" + vo.getUseVariantType3() + \"'\");\r\n }\r\n if (sql.indexOf(\":USE_VARIANT_TYPE_4\") != -1) {\r\n sql = replace(sql, \":USE_VARIANT_TYPE_4\", \"'\" + vo.getUseVariantType4() + \"'\");\r\n }\r\n if (sql.indexOf(\":USE_VARIANT_TYPE_5\") != -1) {\r\n sql = replace(sql, \":USE_VARIANT_TYPE_5\", \"'\" + vo.getUseVariantType5() + \"'\");\r\n }\r\n\r\n if (sql.indexOf(\":VARIANT_1\") != -1) {\r\n sql = replace(sql, \":VARIANT_1\", \"'\" + (vo.getVariant1()==null || vo.getVariant1().trim().equals(\"\")?ApplicationConsts.JOLLY:vo.getVariant1()) + \"'\");\r\n }\r\n if (sql.indexOf(\":VARIANT_2\") != -1) {\r\n sql = replace(sql, \":VARIANT_2\", \"'\" + (vo.getVariant2()==null || vo.getVariant2().trim().equals(\"\")?ApplicationConsts.JOLLY:vo.getVariant2()) + \"'\");\r\n }\r\n if (sql.indexOf(\":VARIANT_3\") != -1) {\r\n sql = replace(sql, \":VARIANT_3\", \"'\" + (vo.getVariant3()==null || vo.getVariant3().trim().equals(\"\")?ApplicationConsts.JOLLY:vo.getVariant3()) + \"'\");\r\n }\r\n if (sql.indexOf(\":VARIANT_4\") != -1) {\r\n sql = replace(sql, \":VARIANT_4\", \"'\" + (vo.getVariant4()==null || vo.getVariant4().trim().equals(\"\")?ApplicationConsts.JOLLY:vo.getVariant4()) + \"'\");\r\n }\r\n if (sql.indexOf(\":VARIANT_5\") != -1) {\r\n sql = replace(sql, \":VARIANT_5\", \"'\" + (vo.getVariant5()==null || vo.getVariant5().trim().equals(\"\")?ApplicationConsts.JOLLY:vo.getVariant5()) + \"'\");\r\n }\r\n\r\n if (!useDefaultValue)\r\n while((pos=sql.indexOf(\"DEFAULT \"))!=-1) {\r\n defaultValue = sql.substring(pos, sql.indexOf(\",\", pos));\r\n sql = replace(\r\n sql,\r\n defaultValue,\r\n \"\"\r\n );\r\n }\r\n\r\n fkFound = false;\r\n while((pos=sql.indexOf(\"FOREIGN KEY\"))!=-1) {\r\n oldfk = sql.substring(pos,sql.indexOf(\")\",sql.indexOf(\")\",pos)+1)+1);\r\n sql = replace(\r\n sql,\r\n oldfk,\r\n \"\"\r\n );\r\n newfk = new StringBuffer(\"ALTER TABLE \");\r\n newfk.append(sql.substring(sql.indexOf(\" TABLE \")+7,sql.indexOf(\"(\")).trim());\r\n newfk.append(\" ADD \");\r\n newfk.append(oldfk);\r\n fks.add(newfk);\r\n fkFound = true;\r\n }\r\n\r\n if (fkFound)\r\n sql = removeCommasAtEnd(sql);\r\n\r\n indexFound = false;\r\n while((pos=sql.indexOf(\"INDEX \"))!=-1) {\r\n oldIndex = sql.substring(pos,sql.indexOf(\")\",pos)+1);\r\n sql = replace(\r\n sql,\r\n oldIndex,\r\n \"\"\r\n );\r\n newIndex = new StringBuffer(\"CREATE \");\r\n newIndex.append(oldIndex.substring(0,oldIndex.indexOf(\"(\")));\r\n newIndex.append(\" ON \");\r\n newIndex.append(sql.substring(sql.indexOf(\" TABLE \")+7,sql.indexOf(\"(\")).trim());\r\n newIndex.append( oldIndex.substring(oldIndex.indexOf(\"(\")) );\r\n indexes.add(newIndex);\r\n indexFound = true;\r\n }\r\n\r\n if (indexFound)\r\n sql = removeCommasAtEnd(sql);\r\n\r\n // check for unicode chars...\r\n while((index=sql.indexOf(\"\\\\u\"))!=-1) {\r\n for(int i=index+2;i<Math.min(sql.length(),index+2+6);i++)\r\n if (Character.isDigit(sql.charAt(i)) ||\r\n sql.charAt(i)=='A' ||\r\n sql.charAt(i)=='B' ||\r\n sql.charAt(i)=='C' ||\r\n sql.charAt(i)=='D' ||\r\n sql.charAt(i)=='E' ||\r\n sql.charAt(i)=='F')\r\n if (unicode.length() < 4)\r\n unicode.append(sql.charAt(i));\r\n else\r\n break;\r\n if (unicode.length()>0) {\r\n sql.delete(index, index+1+unicode.length());\r\n sql.setCharAt(index, new Character((char)Integer.valueOf(unicode.toString(),16).intValue()).charValue());\r\n unicode.delete(0, unicode.length());\r\n }\r\n }\r\n\r\n\r\n if (sql.toString().toUpperCase().contains(\"DROP TABLE\")) {\r\n // remove fks before dropping table!\r\n String table = sql.toString().toUpperCase().replace('\\n',' ').replace('\\r',' ').trim();\r\n table = table.substring(10).trim();\r\n if (table.endsWith(\";\"))\r\n table = table.substring(0,table.length()-1);\r\n ResultSet rset = conn.getMetaData().getExportedKeys(null,vo.getUsername().toUpperCase(),table);\r\n String fkName = null;\r\n String tName = null;\r\n Statement stmt2 = conn.createStatement();\r\n boolean fksFound = false;\r\n while(rset.next()) {\r\n fksFound = true;\r\n tName = rset.getString(7);\r\n fkName = rset.getString(12);\r\n\r\n if (vo.getDriverName().equals(\"com.mysql.jdbc.Driver\"))\r\n stmt2.execute(\"ALTER TABLE \"+tName+\" DROP FOREIGN KEY \"+fkName);\r\n else\r\n stmt2.execute(\"ALTER TABLE \"+tName+\" DROP CONSTRAINT \"+fkName);\r\n }\r\n try {\r\n rset.close();\r\n }\r\n catch (Exception ex6) {}\r\n\r\n if (!fksFound &&\r\n !vo.getDriverName().equals(\"oracle.jdbc.driver.OracleDriver\") &&\r\n !vo.getDriverName().equals(\"com.microsoft.jdbc.sqlserver.SQLServerDriver\") &&\r\n !vo.getDriverName().equals(\"com.microsoft.sqlserver.jdbc.SQLServerDriver\") &&\r\n !vo.getDriverName().equals(\"com.mysql.jdbc.Driver\")\r\n && !vo.getDriverName().equals(\"org.sqlite.JDBC\")) {\r\n // case postgres...\r\n rset = conn.getMetaData().getExportedKeys(null,null,null);\r\n while(rset.next()) {\r\n if (rset.getString(3).toUpperCase().equals(table)) {\r\n tName = rset.getString(7);\r\n fkName = rset.getString(12);\r\n\r\n if (vo.getDriverName().equals(\"com.mysql.jdbc.Driver\"))\r\n stmt2.execute(\"ALTER TABLE \"+tName+\" DROP FOREIGN KEY \"+fkName);\r\n else\r\n stmt2.execute(\"ALTER TABLE \"+tName+\" DROP CONSTRAINT \"+fkName);\r\n }\r\n }\r\n try {\r\n rset.close();\r\n }\r\n catch (Exception ex6) {}\r\n }\r\n\r\n try {\r\n stmt2.close();\r\n }\r\n catch (Exception ex6) {}\r\n\r\n } // end if\r\n\r\n if (sql.toString().trim().length()>0) {\r\n String query = sql.toString().substring(0,sql.length() - 1);\r\n System.out.println(\"Execute query: \" + query);\r\n pstmt = conn.prepareStatement(query);\r\n for (int i = 0; i < vals.size(); i++) {\r\n pstmt.setObject(i + 1, vals.get(i));\r\n }\r\n\r\n try {\r\n pstmt.execute();\r\n }\r\n catch (SQLException ex4) {\r\n try {\r\n if (sql.toString().toUpperCase().contains(\"DROP TABLE\")) {\r\n//\t\t\t\t\t\t\t\t\tLogger.error(\"NONAME\", this.getClass().getName(), \"executeSQL\",\r\n//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"Invalid SQL: \" + sql, ex4);\r\n }\r\n else\r\n throw ex4;\r\n }\r\n catch (Exception exx4) {\r\n throw ex4;\r\n }\r\n }\r\n pstmt.close();\r\n }\r\n\r\n sql.delete(0, sql.length());\r\n vals.clear();\r\n }\r\n }\r\n br.close();\r\n\r\n for(int i=0;i<fks.size();i++) {\r\n sql = (StringBuffer)fks.get(i);\r\n pstmt = conn.prepareStatement(sql.toString());\r\n try {\r\n pstmt.execute();\r\n }\r\n catch (SQLException ex4) {\r\n Logger.error(\"NONAME\", this.getClass().getName(), \"executeSQL\",\r\n \"Invalid SQL: \" + sql, ex4);\r\n }\r\n pstmt.close();\r\n }\r\n\r\n for(int i=0;i<indexes.size();i++) {\r\n sql = (StringBuffer)indexes.get(i);\r\n pstmt = conn.prepareStatement(sql.toString());\r\n try {\r\n pstmt.execute();\r\n }\r\n catch (SQLException ex3) {\r\n Logger.error(\"NONAME\", this.getClass().getName(), \"executeSQL\",\r\n \"Invalid SQL: \" + sql, ex3);\r\n }\r\n pstmt.close();\r\n }\r\n\r\n conn.commit();\r\n\r\n }\r\n catch (Throwable ex) {\r\n try {\r\n Logger.error(\"NONAME\", this.getClass().getName(), \"executeSQL\",\r\n \"Invalid SQL: \" + sql, ex);\r\n }\r\n catch (Exception ex2) {\r\n }\r\n throw ex;\r\n }\r\n finally {\r\n try {\r\n if (pstmt!=null)\r\n pstmt.close();\r\n }\r\n catch (SQLException ex1) {\r\n }\r\n }\r\n }", "public DaoFileImpl(String path) {\r\n\t\tgson = new Gson();\r\n\t\tthis.path = path;\r\n\t\tthis.daoMap = new HashMap<>();\r\n\t\treadMapFromFile();\r\n\t}", "private void createDbRecords() throws IOException, JAXBException {\n }", "public DbRecord( String szFileName )\n throws FileNotFoundException, NullPointerException, AppException\n {\n Load( szFileName );\n }", "public interface IFileDao extends CrudDao<IFileEntity, IFileDto, Long> {\n\n IFileEntity createFile();\n\n Long saveFileUsingStream(IFileEntity fileEntity, InputStream inputStream) throws Exception;\n\n void writeFileContent(Long fileId, OutputStream outputStream) throws Exception;\n}", "public interface IFileDataTypeReader {\n\t\n\t Map<String, String> getColumnAndDataType(String fileName, ExtendedDetails dbDetails) throws ZeasException;\n\t\n\t List<List<String>> getColumnValues() throws ZeasException;\n}", "public void toSql(String baseDir, String out) throws IOException {\n Path pBase = Paths.get(baseDir);\n final String format = \"insert into files values(null,'%s','%s');\";\n List<String> files = new ArrayList<>();\n Files.walkFileTree(pBase, new SimpleFileVisitor<Path>() {\n @Override\n public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {\n String fileName = file.getFileName().toString();\n String path = file.toAbsolutePath().toString();\n if (filter(path) || filter(fileName)) {\n return FileVisitResult.CONTINUE;\n }\n if (fileName.length() > 128 || path.length() > 8096) {\n System.out.println(String.format(\"warning : %s %s exced the limit\", fileName, path));\n }\n\n\n String insert = String.format(format, fileName, path);\n files.add(insert);\n if (files.size() >= 10240) {\n write2File(out, files);\n files.clear();\n }\n return FileVisitResult.CONTINUE;\n }\n });\n write2File(out, files);\n }", "String getSchemaFile();", "public interface IWritableDatabase2 {\r\n\r\n\t/**\r\n\t * Add database links between tokens found a file, and the file path itself. \r\n\t * \r\n\t * @param strings A unique list of valid white-space separated tokens contained within a file\r\n\t * @param f The file containing the tokens\r\n\t * @param ignoreCase Whether to ignore the case of the tokens (always false?)\t * \r\n\t * @param debug Currently unused debug id\r\n\t */\r\n\tpublic void addBulkLinks(List<String> strings, boolean ignoreCase, File f, int debug);\t\t\r\n\r\n\t/** Once complete, write to the database. */\r\n\tpublic void writeDatabase();\r\n}", "public DataBase(String file) throws IOException {\n\t\tdataBase = new RandomAccessFile(file, \"rw\");\n\t\tdataBase.writeBytes(\"FEATURE_ID|FEATURE_NAME|FEATURE_CLASS|STATE_ALPHA|\"\n\t\t\t\t+ \"STATE_NUMERIC|COUNTY_NAME|COUNTY_NUMERIC|PRIMARY_LAT_DMS|PRIM_LONG_DMS|\"\n\t\t\t\t+ \"PRIM_LAT_DEC|PRIM_LONG_DEC|SOURCE_LAT_DMS|SOURCE_LONG_DMS|SOURCE_LAT_DEC|\"\n\t\t\t\t+ \"SOURCE_LONG_DEC|ELEV_IN_M|ELEV_IN_FT|MAP_NAME|DATE_CREATED|DATE_EDITED\\n\");\n\t}", "@Override\n\tpublic void onCreate(SQLiteDatabase db) {\n\t\tStringBuffer sb = new StringBuffer(\"create table fileinfo ( \");\n\t\tsb.append(\"id integer primary key autoincrement , \");\n\t\tsb.append(\"name varchar(20) , \");\n\t\tsb.append(\"fileurl varchar(60) ,\");\n\t\tsb.append(\"path varchar(60) , \");\n\t\tsb.append(\"size varchar(30) , \");\n\t\tsb.append(\"time varchar(30)\");\n\t\tsb.append(\")\");\n\t\ttry {\n\t\t\tdb.execSQL(sb.toString());\n\t\t\tLog.d(\"TAG\", \"创建数据库表成功\");\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t}", "public interface DBStructure {\n\n String save(DataSource dataSource);\n\n void update(DataSource dataSource, String fileMask) throws UpdateException;\n\n void dropAll(DataSource dataSource) throws DropAllException;\n\n String getSqlScript(DataSource dataSource);\n\n void unlock(DataSource dataSource);\n}", "public abstract String createDBString();", "public void run() throws DatabaseException, FileNotFoundException {\n new File(FileName).delete();\n\n // Create the database object.\n // There is no environment for this simple example.\n DatabaseConfig config = new DatabaseConfig();\n config.setErrorStream(System.err);\n config.setErrorPrefix(\"BulkAccessExample\");\n config.setType(DatabaseType.BTREE);\n config.setAllowCreate(true);\n config.setMode(0644);\n Database table = new Database(FileName, null, config);\n\n //\n // Insert records into the database, where the key is the user\n // input and the data is the user input in reverse order.\n //\n InputStreamReader reader = new InputStreamReader(System.in);\n\n for (;;) {\n String line = askForLine(reader, System.out, \"input> \");\n if (line == null || (line.compareToIgnoreCase(\"end\") == 0))\n break;\n\n String reversed = (new StringBuffer(line)).reverse().toString();\n\n // See definition of StringEntry below\n //\n StringEntry key = new StringEntry(line);\n StringEntry data = new StringEntry(reversed);\n\n try {\n if (table.putNoOverwrite(null, key, data) == OperationStatus.KEYEXIST)\n System.out.println(\"Key \" + line + \" already exists.\");\n } catch (DatabaseException dbe) {\n System.out.println(dbe.toString());\n }\n System.out.println(\"\");\n }\n\n // Acquire a cursor for the table.\n Cursor cursor = table.openCursor(null, null);\n DatabaseEntry foo = new DatabaseEntry();\n\n MultipleKeyDataEntry bulk_data = new MultipleKeyDataEntry();\n bulk_data.setData(new byte[1024 * 1024]);\n bulk_data.setUserBuffer(1024 * 1024, true);\n\n // Walk through the table, printing the key/data pairs.\n //\n while (cursor.getNext(foo, bulk_data, null) == OperationStatus.SUCCESS) {\n StringEntry key, data;\n key = new StringEntry();\n data = new StringEntry();\n\n while (bulk_data.next(key, data))\n System.out.println(key.getString() + \" : \" + data.getString());\n }\n cursor.close();\n table.close();\n }", "public abstract void loadFromDatabase();", "public String getDbTable() {return dbTable;}", "public void putFile(Connection conn, File cond) throws Exception{\n\t//System.out.println(cond);\n\t//Check for LFN\n\tString LFN = cond.getLogicalFileName ( );\n\tif(LFN == null || LFN==\"\") throw new DBSException(\"Input Data Error\", \"LogicalFileName is expected.\");\n\t//Check is_file_valid\n\tint fileValid = cond.getIsFileValid( );\n if(fileValid == -1) throw new DBSException(\"Input Data Error\", \"Validation of File is expected.\");\n\t//Check if Datset already in db\n\tDataset ds = cond.getDatasetDO();\n\t//System.out.println(ds);\n\tif(ds == null)throw new DBSException(\"Input Data Error\", \"Dataset is expected.\");\n\tif(ds.getDatasetID( ) == 0){\n\t String dsName = ds.getDataset();\n\t if((dsName == null) || (dsName==\"\"))throw new DBSException(\"Input Data Error\", \"Dataset name is missing\");\n\t JSONArray dss = (new DatasetQO()).listDatasets(conn, ds);\n\t if(dss.length() != 1)\n\t\tthrow new DBSException(\"Input Data Error\", \"dataset name :\" + dsName \n\t\t+\" is not found or more than one found in the db.\");\n\t else{ \n\t\tds.setDatasetID(((Dataset)dss.getJSONObject(0)).getDatasetID());\n\t\t//ds.setDataset(((Dataset)dss.getJSONObject(0)).getDataset());\n\t }\n\t}\n //System.out.println(cond);\n\tBlock bk = cond.getBlockDO();\n\tif(bk == null) throw new DBSException(\"Input Data Error\", \"Block is expected.\");\n\tif(bk.getBlockID() == 0){\n\t String bkName = bk.getBlockName();\n\t if(bkName == null || bkName == \"\")throw new DBSException(\"Input Data Error\", \"Block name is missing\");\n\t JSONArray bks = (new BlockQO()).listBlocks(conn, bk);\n\t if(bks.length() != 1 )\n\t\tthrow new DBSException(\"Input Data Error\", \"More than one or no Blocks are found in the db with name: \"\n\t\t + bkName);\n\t else {\n\t\tbk.setBlockID(((Block)bks.getJSONObject(0)).getBlockID());\n\t\t//System.out.println(\"Block : \" + bk);\n\t }\n\t}\n\t//\n\t//System.out.println(\"Check for file_type\");\n\tFileType ft = cond.getFileTypeDO();\n if(ft == null)throw new DBSException(\"Input Data Error\", \"File type is expected.\");\n if(ft.getFileTypeID( ) == 0){\n String ftName = ft.getFileType();\n if((ftName == null) || (ftName == \"\"))throw new DBSException(\"Input Data Error\", \"File type is missing\");\n JSONArray fts = (new FileTypeQO()).listFileTypes(conn, ft);\n if(fts.length() != 1)\n throw new DBSException(\"Input Data Error\", \"File type :\" + ftName\n +\" is not found or more than one found in the db.\");\n else\n ft.setFileTypeID(((FileType)fts.getJSONObject(0)).getFileTypeID());\n }\n\t//System.out.println(\"File type: \" + ft);\n\t//check for Primary key\n\tint fileID = cond.getFileID ( );\n\tif(fileID == 0){\n\t try{\n\t\tfileID = SequenceManager.getSequence(conn, \"SEQ_FL\");\n\t\tcond. setFileID(fileID);\n\t }catch (SQLException ex) {\n\t\tthrow ex;\n\t }\n\t}\n\t//\n\t//System.out.println(\"Check for check-sum\");\n\tString cs = cond.getCheckSum();\n if(cs == null || cs == \"\")throw new DBSException(\"Input Data Error\", \"File check-sum is expected.\");\n\t//check for event_count\n\tif (cond.getEventCount() == -1) throw new DBSException(\"Input Data Error\", \"File event count is expected.\");\n\t//check for file size\n\tif(cond.getFileSize() == -1) throw new DBSException(\"Input Data Error\", \"File size is expected.\");\n\t//System.out.println(\"Check for creation_date and created_by. \\n\");\n\tlong createDate = cond.getCreationDate( );\n\tString createdBy = cond.getCreateBy( );\n\t//System.out.println(\"****File**** \" + cond);\n\tif(createDate == 0)cond.setCreationDate(DBSSrvcUtil.getEpoch());\n if(createdBy == null || createdBy==\"\")cond.setCreateBy(\"WeNeed2FindWhoDidIt\");\n\t \t\n\t//Now we are ready to insert into the dataset\n\t//System.out.println(\"Ready to insert file :\" + cond);\n\tinsertTable(conn, cond, \"FILES\");\n }", "public int getDbType();", "int insert(DiaryFile record);", "@Repository\npublic interface DBFileRepository extends JpaRepository<DBFile, Long> {\n\n}", "public DataWriter(String dbPath) {\n databasePath = dbPath;\n }", "public DB(String db) throws ClassNotFoundException, SQLException {\n // Set up a connection and store it in a field\n Class.forName(\"org.sqlite.JDBC\");\n String url = \"jdbc:sqlite:\" + db;\n\n // stop conn from creating a file if does not exists\n SQLiteConfig config = new SQLiteConfig();\n config.resetOpenMode(SQLiteOpenMode.CREATE);\n\n //connect to the file\n conn = DriverManager.getConnection(url, config.toProperties());\n try (Statement stat = conn.createStatement();) {\n stat.executeUpdate(\"PRAGMA foreign_keys = ON;\");\n }\n }", "public Dataset openTDB(String directory){\n Dataset dataset = TDBFactory.createDataset(directory);\n return dataset;\n}", "public ProjectFilesDAOImpl() {\r\n super();\r\n }", "int insert(FileRecordAdmin record);", "public void writeDatabase();", "public static boolean addFile(TranslationFile bf) {\n System.out.println(\"File added to database.\");\n DatabaseOperations.addOrUpdateFileName(bf.getFileID(), bf.getFileName());\n String sql = \"INSERT OR REPLACE INTO corpus1(id, fileID, fileName, thai, english, committed, removed, rank) VALUES(?,?,?,?,?,?,?,?)\";\n\n try (Connection conn = DatabaseOperations.connect();\n PreparedStatement pstmt = conn.prepareStatement(sql)) {\n\n conn.setAutoCommit(false);\n\n // this makes sure that the segments in the file, when retrieved from the db, can be ordered in the proper order.\n // simply increments by 1 on each segment. \n int rank = 0;\n // keeps count of the number of segs added so that the SQL can run a batch transaction (which is much more efficient than individual transactions).\n // when i=1000, or at the last segment, the SQL is then run as one batch transaction.\n int i = 0;\n\n for (Segment seg : bf.getActiveSegs()) {\n\n pstmt.setDouble(1, seg.getID());\n pstmt.setDouble(2, seg.getFileID());\n pstmt.setString(3, seg.getFileName());\n pstmt.setString(4, seg.getThai());\n pstmt.setString(5, seg.getEnglish());\n // committed/removed booleans are stored as binary (0 = false, 1 = true)\n pstmt.setInt(6, seg.isCommitted() ? 1 : 0);\n // removed is set to \"false\"\n pstmt.setInt(7, 0);\n pstmt.setInt(8, rank);\n pstmt.addBatch();\n rank++;\n i++;\n\n if (i % 1000 == 0 || i == bf.getActiveSegs().size()) {\n pstmt.executeBatch(); //Execute every 1000 segments.\n }\n }\n\n // resetting counters\n i = 0;\n rank = 0;\n for (Segment seg : bf.getHiddenSegs()) {\n\n pstmt.setDouble(1, seg.getID());\n pstmt.setDouble(2, seg.getFileID());\n pstmt.setString(3, seg.getFileName());\n pstmt.setString(4, seg.getThai());\n pstmt.setString(5, seg.getEnglish());\n // committed/removed booleans are stored as binary (0 = false, 1 = true)\n pstmt.setInt(6, seg.isCommitted() ? 1 : 0);\n // removed is set to \"true\"\n pstmt.setInt(7, 1);\n pstmt.setInt(8, rank);\n pstmt.addBatch();\n rank++;\n i++;\n\n if (i % 1000 == 0 || i == bf.getHiddenSegs().size()) {\n pstmt.executeBatch(); //Execute every 1000 segments.\n }\n }\n conn.commit();\n return true;\n\n } catch (SQLException e) {\n System.out.println(\"AddFileAsBatch: \" + e.getMessage());\n return false;\n }\n }", "public long insert(FFileInputDO FFileInput) throws DataAccessException;", "private TexeraDb() {\n super(\"texera_db\", null);\n }", "private static void readDatabase(String path) {\n try {\n FileInputStream fileIn = new FileInputStream(path + \"/database.ser\");\n ObjectInputStream inStream = new ObjectInputStream(fileIn);\n database = (Database) inStream.readObject();\n inStream.close();\n fileIn.close();\n } catch (IOException i) {\n i.printStackTrace();\n } catch (ClassNotFoundException c) {\n c.printStackTrace();\n }\n }", "public DBFWriter(File dbfFile) throws Exception {\r\n\r\n\t\ttry {\r\n\r\n\t\t\tthis.raf = new RandomAccessFile(dbfFile, \"rw\");\r\n\t\t\tFileChannel fileChannel = this.raf.getChannel();\r\n\t\t\twhile (true) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tlock = fileChannel.lock();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} catch (OverlappingFileLockException e) {\r\n\t\t\t\t\tThread.sleep(2);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tthrow new Exception(e.getMessage());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t/*\r\n\t\t\t * before proceeding check whether the passed in File object is an\r\n\t\t\t * empty/non-existent file or not.\r\n\t\t\t */\r\n\t\t\tif (!dbfFile.exists() || dbfFile.length() == 0) {\r\n\t\t\t\tthis.header = new DBFHeader();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\theader = new DBFHeader();\r\n\t\t\tthis.header.read(raf);\r\n\r\n\t\t\t// back 5 char\r\n\t\t\tthis.raf.seek(this.raf.length() - 10);\r\n\t\t\tlong logEofIndex = 0;\r\n\t\t\twhile (true) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\t// the end byte 26\r\n\t\t\t\t\tif (this.raf.readByte() == 26) {\r\n\t\t\t\t\t\tlogEofIndex = this.raf.getFilePointer();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (EOFException ioe) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (logEofIndex == 0) {\r\n\t\t\t\tlogEofIndex = this.raf.length();\r\n\t\t\t} else {\r\n\t\t\t\tlogEofIndex--;\r\n\t\t\t}\r\n\t\t\t/* position file pointer at the end of the raf */\r\n\t\t\tthis.raf.seek(logEofIndex);\r\n\t\t\t// this.raf.seek( this.raf.length()-1 /* to ignore the END_OF_DATA\r\n\t\t\t// byte at EoF */);\r\n\r\n\t\t} catch (FileNotFoundException e) {\r\n\r\n\t\t\tthrow new DBFException(\"Specified file is not found. \" + e.getMessage());\r\n\t\t} catch (IOException e) {\r\n\r\n\t\t\tthrow new DBFException(e.getMessage() + \" while reading header\");\r\n\t\t}\r\n\t\tthis.recordCount = this.header.numberOfRecords;\r\n\t}", "public String getDbpediaFile() {\n\t\treturn DBPEDIA_FILE;\n\t}", "@Override\n public String getDbString() {\n return null;\n }", "public SimpleDatabase executeSqlFile(SQLiteDatabase db, @RawRes int id) {\n Scanner scan = context.openInternalFileScanner(id);\n String query = \"\";\n if (logging) Log.d(\"SimpleDB\", \"start reading file\");\n int queryCount = 0;\n while (scan.hasNextLine()) {\n String line = scan.nextLine().trim();\n if (line.startsWith(\"--\") || line.isEmpty()) {\n continue;\n } else {\n query += line + \"\\n\";\n }\n\n if (query.endsWith(\";\\n\")) {\n if (logging) Log.d(\"SimpleDB\", \"query: \\\"\" + query + \"\\\"\");\n db.execSQL(query);\n query = \"\";\n queryCount++;\n }\n }\n if (logging) Log.d(\"SimpleDB\", \"done reading file\");\n if (logging) Log.d(\"SimpleDB\", \"performed \" + queryCount + \" queries.\");\n return this;\n }", "public interface DbIterator {\n /**\n * Opens the iterator.\n * @throws NoSuchElementException when the iterator has no elements.\n * @throws DbException when there are problems opening/accessing the database.\n */\n public void open() throws NoSuchElementException, DbException, TransactionAbortedException;\n\n /**\n * Gets the next tuple from the operator (typically implementing by reading\n * from a child operator or an access method).\n *\n * @return The next tuple in the iterator.\n */\n public Tuple getNext() throws TransactionAbortedException;\n\n /**\n * Resets the iterator to the start.\n * @throws DbException When rewind is unsupported.\n */\n public void rewind() throws DbException, TransactionAbortedException;\n\n /**\n * Returns the TupleDesc associated with this DbIterator.\n */\n public TupleDesc getTupleDesc();\n\n /**\n * Closes the iterator.\n */\n public void close();\n}", "public boolean writePlicSnapshotToFile(File f, String dbSchema, String dataSource){\n try{\n //Obtener la conexion JDBC del proyecto\n InitialContext ctx = new InitialContext();\n DataSource ds = (DataSource) ctx.lookup(dataSource);\n Connection connection = ds.getConnection();\n\n\t String query = \"SELECT '\\\"'||REPLACE(COALESCE(globaluniqueidentifier,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(scientificname,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(institutioncode,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||COALESCE(to_char(datelastmodified,'YYYY-MM-DD HH24:MI:SS'),'')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(taxonrecordid,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(language,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(creators,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(distribution,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(abstract,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(kingdomtaxon,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(phylumtaxon,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(classtaxon,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(ordertaxon,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(familytaxon,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(genustaxon,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(synonyms,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(authoryearofscientificname,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(speciespublicationreference,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(commonnames,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(typification,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(contributors,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||COALESCE(to_char(datecreated,'YYYY-MM-DD'),'')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(habit,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(lifecycle,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(reproduction,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(annualcycle,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(scientificdescription,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(briefdescription,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(feeding,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(behavior,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(interactions,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(chromosomicnumbern,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(moleculardata,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(populationbiology,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(threatstatus,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(legislation,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(habitat,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(territory,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(endemicity,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(theuses,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(themanagement,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(folklore,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(thereferences,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(unstructureddocumentation,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(otherinformationsources,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(papers,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(identificationkeys,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(migratorydata,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(ecologicalsignificance,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(unstructurednaturalhistory,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(invasivenessdata,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(targetaudiences,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(version,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(urlimage1,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(captionimage1,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(urlimage2,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(captionimage2,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(urlimage3,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(captionimage3,''),'\\r\\n', ' ')||'\\\"'\"+\n\t\t\t \" AS aux \"+\n\t\t\t \"FROM \"+dbSchema+\".plic_snapshot;\";\n\n System.out.println(query);\n\n\t\t\tStatement st = connection.createStatement();\n\t\t\tResultSet rs = st.executeQuery(query); \n\n //Imprimir los datos en el archivo\n BufferedWriter out = new BufferedWriter(new FileWriter(f));\n\t\t\twhile (rs.next()) {\n\t\t\t\tout.write(rs.getString(\"aux\")+\"\\n\");\n\t\t\t}\n out.close();\n\n //Cerrar el resultset y el statement\n rs.close();\n\t\t\tst.close();\n\n //Resultado\n return true;\n }\n catch(Exception e){\n e.printStackTrace();\n return false;}\n }", "public interface FilesDAO extends CrudRepository<Files,Long> {\n}", "@Override\r\n\tpublic boolean supportsDb(String type) {\r\n \treturn true;\r\n }", "@SuppressWarnings(\"rawtypes\") \npublic interface FFileInputDAO {\n\t/**\n\t * Insert one <tt>FFileInputDO</tt> object to DB table <tt>f_file_input</tt>, return primary key\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>insert into f_file_input(file_id,file_code,type,form_id,project_code,project_name,customer_id,customer_name,first_loan_time,filing_time,hand_over_dept,hand_over_man,hand_over_time,principal_man,vice_manager,receive_dept,receive_man,receive_time,status,raw_add_time) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)</tt>\n\t *\n\t *\t@param FFileInput\n\t *\t@return long\n\t *\t@throws DataAccessException\n\t */\t \n public long insert(FFileInputDO FFileInput) throws DataAccessException;\n\n\t/**\n\t * Update DB table <tt>f_file_input</tt>.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>update f_file_input set first_loan_time=?, filing_time=?, hand_over_dept=?, hand_over_man=?, hand_over_time=?, principal_man=?, vice_manager=?, receive_dept=?, receive_man=?, receive_time=?, status=? where (input_id = ?)</tt>\n\t *\n\t *\t@param FFileInput\n\t *\t@return int\n\t *\t@throws DataAccessException\n\t */\t \n public int update(FFileInputDO FFileInput) throws DataAccessException;\n\n\t/**\n\t * Query DB table <tt>f_file_input</tt> for records.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>select * from f_file_input where (input_id = ?)</tt>\n\t *\n\t *\t@param inputId\n\t *\t@return FFileInputDO\n\t *\t@throws DataAccessException\n\t */\t \n public FFileInputDO findById(long inputId) throws DataAccessException;\n\n\t/**\n\t * Query DB table <tt>f_file_input</tt> for records.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>select * from f_file_input where (form_id = ?)</tt>\n\t *\n\t *\t@param formId\n\t *\t@return List<FFileInputDO>\n\t *\t@throws DataAccessException\n\t */\t \n public List<FFileInputDO> findByFormId(long formId) throws DataAccessException;\n\n\t/**\n\t * Delete records from DB table <tt>f_file_input</tt>.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>delete from f_file_input where (input_id = ?)</tt>\n\t *\n\t *\t@param inputId\n\t *\t@return int\n\t *\t@throws DataAccessException\n\t */\t \n public int deleteById(long inputId) throws DataAccessException;\n\n\t/**\n\t * Query DB table <tt>f_file_input</tt> for records.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>select * from f_file_input where (1 = 1)</tt>\n\t *\n\t *\t@param FFileInput\n\t *\t@param limitStart\n\t *\t@param pageSize\n\t *\t@return List<FFileInputDO>\n\t *\t@throws DataAccessException\n\t */\t \n public List<FFileInputDO> findByCondition(FFileInputDO FFileInput, long limitStart, long pageSize) throws DataAccessException;\n\n\t/**\n\t * Query DB table <tt>f_file_input</tt> for records.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>select COUNT(*) from f_file_input where (1 = 1)</tt>\n\t *\n\t *\t@param FFileInput\n\t *\t@return long\n\t *\t@throws DataAccessException\n\t */\t \n public long findByConditionCount(FFileInputDO FFileInput) throws DataAccessException;\n\n}", "private static void loadTableData() {\n\n\t\tBufferedReader in = null;\n\t\ttry {\n\t\t\tin = new BufferedReader(new FileReader(dataDir + tableInfoFile));\n\n\t\t\twhile (true) {\n\n\t\t\t\t// read next line\n\t\t\t\tString line = in.readLine();\n\t\t\t\tif (line == null) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tString[] tokens = line.split(\" \");\n\t\t\t\tString tableName = tokens[0];\n\t\t\t\tString tableFileName = tokens[1];\n\n\t\t\t\ttableNameToSchema.put(tableName, new HashMap<String, Type>());\n\t\t\t\ttableNameToOrdredSchema.put(tableName,\n\t\t\t\t\t\tnew ArrayList<ColumnInfo>());\n\n\t\t\t\t// attributes data\n\t\t\t\tfor (int i = 2; i < tokens.length;) {\n\n\t\t\t\t\tString attName = tokens[i++];\n\t\t\t\t\tString attTypeName = (tokens[i++]);\n\n\t\t\t\t\tType attType = null;\n\n\t\t\t\t\t/*\n\t\t\t\t\t * Undefined, how to represent dates, crazy longs probably\n\t\t\t\t\t * won't need this for now...\n\t\t\t\t\t */\n\t\t\t\t\tif (attTypeName.equals(\"CHAR\")) {\n\t\t\t\t\t\tattType = Types.getCharType(Integer\n\t\t\t\t\t\t\t\t.valueOf(tokens[i++]));\n\t\t\t\t\t} else if (attTypeName.equals(\"DATE\")) {\n\t\t\t\t\t\tattType = Types.getDateType();\n\t\t\t\t\t} else if (attTypeName.equals(\"DOUBLE\")) {\n\t\t\t\t\t\tattType = Types.getDoubleType();\n\t\t\t\t\t} else if (attTypeName.equals(\"FLOAT\")) {\n\t\t\t\t\t\tattType = Types.getFloatType();\n\t\t\t\t\t} else if (attTypeName.equals(\"INTEGER\")) {\n\t\t\t\t\t\tattType = Types.getIntegerType();\n\t\t\t\t\t} else if (attTypeName.equals(\"LONG\")) {\n\t\t\t\t\t\tattType = Types.getLongType();\n\t\t\t\t\t} else if (attTypeName.equals(\"VARCHAR\")) {\n\t\t\t\t\t\tattType = Types.getVarcharType();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new RuntimeException(\"Invalid type: \"\n\t\t\t\t\t\t\t\t+ attTypeName);\n\t\t\t\t\t}\n\n\t\t\t\t\ttableNameToSchema.get(tableName).put(attName, attType);\n\n\t\t\t\t\tColumnInfo ci = new ColumnInfo(attName, attType);\n\t\t\t\t\ttableNameToOrdredSchema.get(tableName).add(ci);\n\n\t\t\t\t}\n\n\t\t\t\t// at this point, table info loaded.\n\n\t\t\t\t// Create table\n\t\t\t\tmyDatabase.getQueryInterface().createTable(tableName,\n\t\t\t\t\t\ttableNameToSchema.get(tableName));\n\n\t\t\t\t// Now, load data into newly created table\n\t\t\t\treadTable(tableName, tableFileName);\n\n\t\t\t}\n\n\t\t\tin.close();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tHelpers.print(e.getStackTrace().toString(),\n\t\t\t\t\tutil.Consts.printType.ERROR);\n\t\t}\n\n\t}", "CCDB2IndexFile(CCDB2Driver driver, File filePath) throws IOException\r\n\t{\r\n\t\tfFilePath = filePath;\r\n\t\tfFile = new CCDB2File(driver, fFilePath.getPath(), NULL_BYTE);\r\n\t}", "@Override\n\tpublic void createFile(FileModel file) {\n\t\tString sql = \"INSERT INTO file VALUES (?,?,?,?,?,?,now(),now())\";\n\t\t\n\t\tthis.getJdbcTemplate().update(sql, new Object[] { \n\t\t\t\tfile.getFile_id(),\n\t\t\t\tfile.getFile_path(),\n\t\t\t\tfile.getFile_name(),\n\t\t\t\tfile.getFile_type(),\n\t\t\t\tfile.getFile_size(),\n\t\t\t\tfile.getCretd_usr()\n\t\t});\n\t}", "public interface BerkeleydbDao<T> {\n\n /**\n * open database\n * */\n public void openConnection(String filePath, String databaseName) throws DatabaseException;\n\n /**\n * 关闭数据库\n * */\n public void closeConnection() throws DatabaseException;\n\n /**\n * insert\n * */\n public void save(String name, T t) throws DatabaseException;\n\n /**\n * delete\n * */\n public void delete(String name) throws DatabaseException;\n\n /**\n * update\n * */\n public void update(String name, T t) throws DatabaseException;\n\n /**\n * select\n * */\n public T get(String name) throws DatabaseException;\n\n}", "public String getDbPath() {\r\n return dbPath;\r\n }", "DatabaseInformationFull(Database db) {\n super(db);\n }", "public DbFileIterator iterator(final TransactionId tid) { \t\n// some code goes here\n \t\n \tDbFileIterator dbfi = new DbFileIterator() {\n \tint pgno = 0;\n \tHeapPage currPg = null;\n \tString name = Database.getCatalog().getTableName(getId());\n \tint tblid = Database.getCatalog().getTableId(name);\n \tint open = 0; \t\n \t\n \t//Todo: pass along the tid from the outer method.\n \t//DONE. by making tid param final.\n \tTransactionId m_tid = tid;\n \t\n \tIterator<Tuple> titr = null;\n \t\n\t\t\t@Override\n\t\t\tpublic void rewind() throws DbException, TransactionAbortedException {\n\t\t\t\tclose();\n\t\t\t\topen();\n\t\t\t}\n\t\t\t\n\t\t\tpublic void nextPage() throws DbException, TransactionAbortedException {\n\n\t\t\t\tif (pgno >= numPages())\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tcurrPg = (HeapPage) Database.getBufferPool().getPage(m_tid, new HeapPageId(tblid, pgno), simpledb.Permissions.READ_ONLY);\n\t\t\t\t\ttitr = currPg.iterator();\n\t\t\t\t\tif (titr == null)\n\t\t\t\t\t\tthrow new DbException(\"blah blah blah\");\n\t\t\t\t\tpgno++;\n\t\t\t\t\treturn;\n\t\t\t\t} catch (DbException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tthrow new DbException(\"page was not found or no more iterators..?\");\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void open() throws DbException, TransactionAbortedException {\n\t\t\t\topen = 1;\n\t\t\t\tpgno = 0;\n\t\t\t\tnextPage();\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic Tuple next() throws DbException, TransactionAbortedException,\n\t\t\t\t\tNoSuchElementException {\n\t\t\t\tif (open != 1)\n\t\t\t\t\tthrow new NoSuchElementException();\n\t\t\t\tif (!titr.hasNext())\n\t\t\t\t\tnextPage();\n\t\t\t\treturn titr.next();\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic boolean hasNext() throws DbException, TransactionAbortedException {\n\t\t\t\tif (open !=1)\n\t\t\t\t\treturn false;\n\t\t\t\tif (titr == null) //TODO: remove\n\t\t\t\t\tthrow new DbException(Integer.toString(pgno) + Integer.toString(open) + Integer.toString(numPages()) + m_f.getPath());\n\t\t\t\tif (!titr.hasNext())\n\t\t\t\t\tnextPage();\n\t\t\t\tif (titr.hasNext())\n\t\t\t\t\treturn true;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void close() {\n\t\t\t\topen = 0;\n\t\t\t\ttitr = null;\n\t\t\t}\n\t\t};\n return dbfi;\n }", "@Test(timeout = 4000)\n public void test112() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable(\"O\\\"6T\");\n File file0 = MockFile.createTempFile(\"<*kYz\", \"BLOB\");\n MockPrintWriter mockPrintWriter0 = new MockPrintWriter(file0);\n NameSpec nameSpec0 = NameSpec.ALWAYS;\n SQLUtil.renderCreateTable(defaultDBTable0, true, nameSpec0, mockPrintWriter0);\n assertNull(defaultDBTable0.getDoc());\n }", "public NameSurferDataBase(String filename) {\t\n\t\tnameData(filename);\n\t}", "public void init() {\r\n BufferedReader in = null;\r\n String line;\r\n PreparedStatement iStmt;\r\n String insertStmt = \"INSERT INTO \" + schema + \"ULDSHAPE \"\r\n + \"(SHAPE, ALLHGHT, ALLLENG, ALLWDTH, BIGPIC, DESCR, INTERNALVOLUME, INTHGHT, INTLENG, INTWDTH, \"\r\n + \"MAXGROSSWGHT, RATING, TAREWGHT, THUMBNAIL, UPDATED, UPDTUSER, VERSION) VALUES \"\r\n + \"(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\";\r\n int count = 0;\r\n\r\n LOG.log(Level.INFO, \"Initialize basic Uldshapes in DB from file [{0}]\", path);\r\n\r\n try {\r\n in = new BufferedReader(new InputStreamReader(new FileInputStream(path), StandardCharsets.UTF_8));\r\n\r\n iStmt = conn.prepareStatement(insertStmt);\r\n\r\n while ((line = in.readLine()) != null) {\r\n LOG.finer(line);\r\n\r\n UldshapeVO uldshapeVO = parseUldshape(line);\r\n\r\n iStmt.setString(1, uldshapeVO.getShape());\r\n iStmt.setInt(2, uldshapeVO.getAllhght());\r\n iStmt.setInt(3, uldshapeVO.getAllleng());\r\n iStmt.setInt(4, uldshapeVO.getAllwdth());\r\n iStmt.setBytes(5, uldshapeVO.getBigpic());\r\n iStmt.setString(6, uldshapeVO.getDescr());\r\n iStmt.setInt(7, uldshapeVO.getInternalvolume());\r\n iStmt.setInt(8, uldshapeVO.getInthght());\r\n iStmt.setInt(9, uldshapeVO.getIntleng());\r\n iStmt.setInt(10, uldshapeVO.getIntwdth());\r\n iStmt.setInt(11, uldshapeVO.getMaxgrosswght());\r\n iStmt.setString(12, uldshapeVO.getRating());\r\n iStmt.setInt(13, uldshapeVO.getTarewght());\r\n iStmt.setBytes(14, uldshapeVO.getThumbnail());\r\n iStmt.setTimestamp(15, DbUtil.getCurrentTimeStamp());\r\n iStmt.setString(16, uldshapeVO.getUpdtuser());\r\n iStmt.setLong(17, 0);\r\n\r\n // execute insert SQL stetement\r\n iStmt.executeUpdate();\r\n\r\n ++count;\r\n }\r\n LOG.log(Level.INFO, \"Finished: [{0}] ULDSHAPES loaded\", count);\r\n\r\n DbUtil.cleanupJdbc();\r\n }\r\n catch (IOException ioex) {\r\n LOG.log(Level.SEVERE, \"An IO error occured. The error message is: {0}\", ioex.getMessage());\r\n }\r\n catch (SQLException ex) {\r\n LOG.log(Level.SEVERE, \"An SQL error occured. The error message is: {0}\", ex.getMessage());\r\n }\r\n finally {\r\n if (in != null) {\r\n try {\r\n in.close();\r\n }\r\n catch (IOException e) {\r\n }\r\n }\r\n }\r\n }", "private void loadDatabase()\n\t{\n\t\ttry\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// Check to make sure the Bmod Database is there, if not, try \n\t\t\t\t// downloading from the website.\n\t\t\t\tif(!Files.exists(m_databaseFile))\n\t\t\t\t{\n\t\t\t\t\tFiles.createDirectories(m_databaseFile.getParent());\n\t\t\t\t\n\t\t\t\t\tbyte[] file = ExtensionPoints.readURLAsBytes(\"http://\" + Constants.API_HOST + HSQL_DATABASE_PATH);\n\t\t\t\t\tif(file.length != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tFiles.deleteIfExists(m_databaseFile);\n\t\t\t\t\t\tFiles.write(m_databaseFile, file, StandardOpenOption.CREATE, StandardOpenOption.WRITE);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// make sure we have the proper scriptformat.\n\t\t\t\tsetScriptFormatCorrectly();\n\t\t\t}catch(NullPointerException|IOException ex)\n\t\t\t{\n\t\t\t\tm_logger.error(\"Could not fetch database from web.\", ex);\n\t\t\t}\n\t\t\t\n\t\n\t\t\t\n\t\t\tClass.forName(\"org.hsqldb.jdbcDriver\");\n\t\t\n\t\t\t\n\t\t\tString db = ExtensionPoints.getBmodDirectory(\"database\").toUri().getPath();\n\t\t\tconnection = DriverManager.getConnection(\"jdbc:hsqldb:file:\" + db, \"sa\", \"\");\n\t\t\t\n\t\t\t// Setup Connection\n\t\t\tCSVRecordLoader ldr = new CSVRecordLoader();\n\t\t\n\t\t\t// Load all of the building independent plugins\n\t\t\tfor(Record<?> cp : ldr.getRecordPluginManagers())\n\t\t\t{\n\t\t\t\tm_logger.debug(\"Creating table: \" + cp.getTableName());\n\t\t\t\t// Create a new table\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tgetPreparedStatement(cp.getSQLTableDefn()).execute();\n\t\t\t\t} catch(SQLException ex)\n\t\t\t\t{\n\t\t\t\t\t// Table exists\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tm_logger.debug(\"Doing index:\" + cp.getIndexDefn());\n\t\t\t\t\tif(cp.getIndexDefn() != null)\n\t\t\t\t\t\tgetPreparedStatement(cp.getIndexDefn()).execute();\n\t\t\t\t}catch(SQLException ex)\n\t\t\t\t{\t// index exists\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\n\t\t} catch (Exception ex)\n\t\t{\n\t\t\tex.printStackTrace();\n\t\t\tif(ex instanceof DatabaseIntegrityException)\n\t\t\t\tDatabase.handleCriticalError((DatabaseIntegrityException)ex);\n\t\t\telse\n\t\t\t\tDatabase.handleCriticalError(new DatabaseIntegrityException(ex));\n\t\t}\n\t\t\n\t}", "public static void createNewDatabaseFile(String startPath)\r\n throws ConnectionFailedException, DatabaseException {\r\n boolean databaseCreated;\r\n try {\r\n databaseCreated = database.createNewFile();\r\n if (!databaseCreated) {\r\n throw new IOException(\"Cannot create file\");\r\n }\r\n\r\n URL databaseResource = Objects.requireNonNull(Paths.get(\r\n startPath + \"resources/database/database.sql\").toUri().toURL());\r\n String decodedPath = URLDecoder.decode(databaseResource.getPath(), \"UTF-8\");\r\n\r\n try (BufferedReader in = new BufferedReader(new FileReader(decodedPath))) {\r\n StringBuilder sqlQuery = new StringBuilder();\r\n while (in.ready()) {\r\n sqlQuery.append(in.readLine());\r\n if (sqlQuery.toString().endsWith(\";\")) {\r\n createBasicSqlTable(sqlQuery.toString());\r\n sqlQuery = new StringBuilder();\r\n }\r\n }\r\n }\r\n } catch (IOException e) {\r\n throwException(e);\r\n }\r\n }", "private String getDatabaseFilePath(NotesDatabase db) {\n try {\n return db.getFilePath();\n } catch (RepositoryException ex) {\n LOGGER.log(Level.WARNING, \"Unable to retrieve database's file path\", ex);\n return null;\n }\n }", "public Table readTable(String pathName, String filename){\n File file = new File(pathName + filename);\n Table newTable = null;\n Scanner sc; \n //foreign key aspects\n Boolean hasForeignKey = false;\n ArrayList<String> FKIndex; \n String[] line; \n String primaryTableName = \"\", primaryColName = \"\", colName = \"\"; \n String name = \"\";\n\n try {\n sc = new Scanner(file);\n } catch(FileNotFoundException ex) {\n System.out.println(\"ERROR: file not found\");\n return null;\n }\n\n //get table name - always first line\n if (sc.hasNextLine()){\n name = sc.nextLine();\n }\n\n FKIndex = getForeignKeyIndex(pathName);\n //loop over all rows in FKIndex, and check if table has a foreign key\n if(!FKIndex.isEmpty()){\n for(int i = 0; i < FKIndex.size(); i++){\n line = FKIndex.get(i).split(\"\\\\s\"); \n if (line[2].equals(name)){\n hasForeignKey = true;\n primaryTableName = line[0];\n primaryColName = line[1];\n colName = line[3];\n }\n }\n }\n\n //get col names - always second line\n if (sc.hasNextLine()){\n String colNamesString = sc.nextLine();\n //split colNames into individual words as Strings based on whitespace\n String[] colNames = colNamesString.split(\"\\\\s\");\n\n //make table with column names\n if (hasForeignKey){\n newTable = new Table(name, primaryTableName, primaryColName, colName, true, colNames);\n } else {\n newTable = new Table(name, colNames);\n }\n\n //add rows from file (each line)\n while(sc.hasNextLine()){\n String newRowString = sc.nextLine();\n String[] newRow = newRowString.split(\"\\\\s\");\n newTable.addRow(newRow);\n }\n }\n\n sc.close();\n return newTable;\n }", "private void createFileTableIndexes() throws Exception {\n \t\tdbManager\n \t\t\t\t.executeUpdate(\"create index FILE_ID_INDEX_FILE on FILE(FILE_ID)\");\n \t\tdbManager\n \t\t\t\t.executeUpdate(\"create index START_REVISION_ID_INDEX_FILE on FILE(START_REVISION_ID)\");\n \t\tdbManager\n \t\t\t\t.executeUpdate(\"create index END_REVISION_ID_INDEX_FILE on FILE(END_REVISION_ID)\");\n \t}", "public interface FileDataDao\r\n{\r\n\tpublic FileData uploadFile(UploadFileData ufd,int applicationId, String fileLocation,String rootLocation) throws FileAlreadyExistsException;\r\n\tpublic List<FileData> listRootFiles(int applicationId);\r\n\tpublic List<FileData> listFolderFiles(int applicationId,int parentCategoryId);\r\n\tpublic List<ApproveReject> approveFile(List<ApproveReject> approveList, int applicationId);\r\n\tpublic List<ApproveReject> rejectFile(List<ApproveReject> rejectList, int applicationId);\r\n\tpublic int getNoOfUploadedFiles(int applicationId);\r\n\tpublic List<FileDelete> deleteFiles(List<FileDelete> fileDeleteList, int applicationId);\r\n\tpublic int getRootId(int applicationId);\r\n\tpublic String getPhoto(int applicationId);\r\n}", "private void setupDb(){\n try {\n openConnection();\n s.executeUpdate(\"CREATE TABLE IF NOT EXISTS LIB (NAME text UNIQUE , TYPE text, LANGUAGE text, INTRUSIVE text, OPENSOURCE text)\");\n }catch (SQLException e) {\n System.err.println(e.getMessage());\n }finally {\n if (c != null){\n close(c);\n }\n }\n }", "Object getDB();", "private static void bindClobVarInFile(PreparedStatement ps, \n int index, \n ResultSet rs,\n int type)\n throws IOException, SQLException \n {\n InputStream is = rs.getAsciiStream(index);\n if (rs.wasNull()) {\n ps.setNull(index, type);\n return;\n }\n \n // Open file output stream\n long millis = System.currentTimeMillis();\n File f = File.createTempFile(\"clob\", \"\"+millis);\n f.deleteOnExit();\n FileOutputStream fos = new FileOutputStream(f);\n if (log.isDebugEnabled()) {\n //i18n[DBUtil.info.bindclobfile=bindClobVarInFile: Opening temp file '{0}']\n String msg = s_stringMgr.getString(\"DBUtil.info.bindclobfile\",\n f.getAbsolutePath());\n log.debug(msg);\n }\n \n // read rs input stream write to file output stream\n byte[] buf = new byte[_prefs.getFileCacheBufferSize()];\n int length = 0;\n int total = 0;\n while ((length = is.read(buf)) >= 0) {\n if (log.isDebugEnabled()) {\n //i18n[DBUtil.info.bindcloblength=bindClobVarInFile: writing '{0}' bytes.]\n String msg =\n s_stringMgr.getString(\"DBUtil.info.bindcloblength\",\n Integer.valueOf(length));\n log.debug(msg);\n }\n fos.write(buf, 0, length);\n total += length;\n }\n fos.close();\n \n // set the ps to read from the file we just created.\n FileInputStream fis = new FileInputStream(f);\n BufferedInputStream bis = new BufferedInputStream(fis);\n ps.setAsciiStream(index, bis, total);\n }", "NewsFile selectByPrimaryKey(Integer fileId);", "private FileOperations() throws FileNotFoundException {\r\n\t\tbiddingPersistence = new BiddingPersistence(Constants.biddingsFilePath, \r\n\t\t\t\tConstants.indexBiddingsPath);\r\n\t\tusersPersistence = new UsersPersistence(Constants.usersFilePath,\r\n\t\t\t\tConstants.indexUsersPath);\t\t\r\n\t}", "public String getDBString();", "static Vector< DbRecord > ReadRecords( String szDbDir )\n {\n File DbDir;\n File[] files;\n Vector<DbRecord> Users = new Vector<DbRecord>( 10, 10 );\n\n // Read all records to identify\n DbDir = new File( szDbDir );\n files = DbDir.listFiles();\n\n if( (files == null) || (files.length == 0) )\n {\n return Users;\n }\n\n for( int iFiles = 0; iFiles < files.length; iFiles++)\n {\n try\n {\n if( files[iFiles].isFile() )\n {\n DbRecord User = new DbRecord( files[iFiles].getAbsolutePath() );\n Users.add( User );\n }\n }\n catch( FileNotFoundException e )\n {\n // The record has invalid data. Skip it and continue processing.\n }\n catch( NullPointerException e )\n {\n JOptionPane.showConfirmDialog(null, \"erro\"+e);\n }\n catch( AppException e )\n {\n // The record has invalid data or access denied. Skip it and continue processing.\n }\n }\n \n return Users;\n }", "DiaryFile selectByPrimaryKey(String maperId);", "public void createDBSchema() throws NoConnectionToDBException, SQLException, IOException {\n \n InputStream in = EDACCApp.class.getClassLoader().getResourceAsStream(\"edacc/resources/edacc.sql\");\n if (in == null) {\n throw new SQLQueryFileNotFoundException();\n }\n BufferedReader br = new BufferedReader(new InputStreamReader(in));\n String line;\n String text = \"\";\n String l;\n while ((line = br.readLine()) != null) {\n if (!(l = line.replaceAll(\"\\\\s\", \"\")).isEmpty() && !l.startsWith(\"--\")) {\n text += line + \" \";\n }\n }\n in.close();\n Vector<String> queries = new Vector<String>();\n String query = \"\";\n String delimiter = \";\";\n int i = 0;\n while (i < text.length()) {\n if (text.toLowerCase().startsWith(\"delimiter\", i)) {\n i += 10;\n delimiter = text.substring(i, text.indexOf(' ', i));\n i = text.indexOf(' ', i);\n } else if (text.startsWith(delimiter, i)) {\n queries.add(query);\n i += delimiter.length();\n query = \"\";\n } else {\n query += text.charAt(i);\n i++;\n }\n }\n if (!query.replaceAll(\" \", \"\").equals(\"\")) {\n queries.add(query);\n }\n boolean autoCommit = getConn().getAutoCommit();\n try {\n getConn().setAutoCommit(false);\n Statement st = getConn().createStatement();\n for (String q : queries) {\n st.execute(q);\n }\n st.close();\n getConn().commit();\n } catch (SQLException e) {\n getConn().rollback();\n throw e;\n } finally {\n getConn().setAutoCommit(autoCommit);\n }\n }", "private Db() {\n super(Ke.getDatabase(), null);\n }", "public static String SQLFromFile(String file) throws IOException{\n BufferedReader reader = new BufferedReader(new FileReader(file));\n StringBuilder sb = new StringBuilder();\n String line;\n while((line = reader.readLine()) != null){\n sb.append(line);\n sb.append(' ');\n }\n reader.close();\n return sb.toString();\n }", "@Override\n\tpublic void closeDB()\n\t{\n\n\t}", "public interface DbLoader {\n\n /**\n * prepares the database\n */\n void prepareDatabase();\n}", "public long getDbFileSize() {\r\n\tlong result = -1;\r\n\r\n\ttry {\r\n\t File dbFile = new File(fileName);\r\n\t if (dbFile.exists()) {\r\n\t\tresult = dbFile.length();\r\n\t }\r\n\t} catch (Exception e) {\r\n\t // nothing todo here\r\n\t}\r\n\r\n\treturn result;\r\n }", "public String getTableFile() \n\t{\n\t return tableFile ;\n\t}", "public static ParserResult loadDatabase(File fileToOpen, String encoding) throws IOException {\n \n Reader reader = getReader(fileToOpen, encoding);\n String suppliedEncoding = null;\n try {\n boolean keepon = true;\n int piv = 0, c;\n while (keepon) {\n c = reader.read();\n if ( (piv == 0 && Character.isWhitespace( (char) c)) ||\n c == GUIGlobals.SIGNATURE.charAt(piv))\n piv++;\n else\n keepon = false;\n found: if (piv == GUIGlobals.SIGNATURE.length()) {\n keepon = false;\n // Found the signature. The rest of the line is unknown, so we skip it:\n while (reader.read() != '\\n');\n // Then we must skip the \"Encoding: \"\n for (int i=0; i<GUIGlobals.encPrefix.length(); i++) {\n if (reader.read() != GUIGlobals.encPrefix.charAt(i))\n break found; // No, it doesn't seem to match.\n }\n // If ok, then read the rest of the line, which should contain the name\n // of the encoding:\n StringBuffer sb = new StringBuffer();\n while ((c = reader.read()) != '\\n')\n sb.append((char)c);\n suppliedEncoding = sb.toString();\n }\n \n }\n } catch (IOException ex) {}\n \n if ((suppliedEncoding != null) && (!suppliedEncoding.equalsIgnoreCase(encoding))) {\n Reader oldReader = reader;\n try {\n // Ok, the supplied encoding is different from our default, so we must make a new\n // reader. Then close the old one.\n reader = getReader(fileToOpen, suppliedEncoding);\n oldReader.close();\n //System.out.println(\"Using encoding: \"+suppliedEncoding);\n } catch (IOException ex) {\n reader = oldReader; // The supplied encoding didn't work out, so we keep our\n // existing reader.\n \n //System.out.println(\"Error, using default encoding.\");\n }\n } else {\n // We couldn't find a supplied encoding. Since we don't know far into the file we read,\n // we start a new reader.\n reader.close();\n reader = getReader(fileToOpen, encoding);\n //System.out.println(\"No encoding supplied, or supplied encoding equals default. Using default encoding.\");\n }\n \n \n //return null;\n \n BibtexParser bp = new BibtexParser(reader);\n \n ParserResult pr = bp.parse();\n pr.setEncoding(encoding);\n \n return pr;\n }", "public ODatabaseDocumentTx db();", "public static TreeBag<Golfer> loadDbFromFile(String dbFilename) \n {\n // used to store lines read from the database file\n String line;\n // create a new empty database\n TreeBag<Golfer> db = new TreeBag<Golfer>();\n // compile a regex pattern for parsing lines from the database file\n Pattern p = Pattern.compile(\"([\\\\w\\\\s-]+)(\\\\d+)\\\\s+(\\\\d+)\\\\s+(\\\\d+\\\\.?\\\\d*)\");\n // create file handle for the filename specified (in current directory)\n File f = new File(\".\"+ File.separator + dbFilename);\n\n // if the filename specified exists in the current directory,\n if (f.exists()) {\n System.out.println(\"\\nLoading golfers from database file '\"+ dbFilename +\"'...\");\n\n // try loading from the database file\n try {\n // create a new file reader using the file handle\n FileReader fr = new FileReader(f);\n // buffer the file reader\n BufferedReader buf = new BufferedReader(fr);\n\n // keep reading lines from the file buffer until we reach the end of file\n while ( (line = buf.readLine()) != null ) {\n // trim whitespace off the lines\n line = line.trim();\n //System.out.println(\"Read line:\\n\"+ line +\"\\n\");\n\n // create a matcher object using the pre-compiled regex pattern\n Matcher m = p.matcher(line);\n // if the matcher object found a match on the current line,\n if (m.find()) {\n // populate golfer data using match groups\n String name = m.group(1);\n int rounds = Integer.valueOf(m.group(2));\n int handicap = Integer.valueOf(m.group(3));\n double avg = Double.valueOf(m.group(4));\n // create a new golfer object\n Golfer g = new Golfer(name, rounds, handicap, avg);\n // add new golfer to the database\n db.add(g);\n /*\n System.out.println(\"Added golfer to database:\\n\"+ g +\"\\n\");\n System.out.println(\"Current database:\\n\"+ db);\n System.out.println(\"Tree view:\");\n db.displayAsTree();\n System.out.println(\"\\n\");\n */\n }\n }\n\n // at the end of the file, close the buffer\n buf.close();\n }\n // exception: specified file does not exist\n catch(FileNotFoundException e) {\n // print stack trace for debugging\n e.printStackTrace();\n System.out.println(\"File '\"+ dbFilename +\"' not found: \"+ e);\n }\n // exception: I/O error when reading from file\n catch(IOException e) {\n // print stack trace for debugging\n e.printStackTrace();\n System.out.println(\"Error reading file '\"+ dbFilename +\"': \"+ e);\n }\n }\n else\n System.out.println(\"Database file '\"+ dbFilename +\"' not found\");\n \n // return the newly compiled database\n return db;\n }", "String getClobField();", "abstract public int dbVersion();", "public abstract String toDBString();", "private static Connection _getDbConnection(String aPath)\n\t{\n\t\ttry\n\t\t{\n\t\t\t// Open file\n\t\t\tConnection c = DriverManager.getConnection(CONN_PREFIX+aPath);\n\t\t\tc.setAutoCommit(false);\n\t\t\tIO.dbOutD(\"Connection to DB at path \"+ aPath + \" established.\");\n\t\t\treturn c;\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tIO.dbOutE(e);\n\t\t\treturn null;\n\t\t}\n\t}", "@Override\r\n public Db_db currentDb(){return curDb_;}", "@Test(timeout = 4000)\n public void test126() throws Throwable {\n DBDataType dBDataType0 = DBDataType.getInstance(\"CLOB\");\n Integer integer0 = RawTransaction.SAVEPOINT_ROLLBACK;\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n DefaultDBColumn defaultDBColumn0 = new DefaultDBColumn(\"CLOB\", defaultDBTable0, dBDataType0, integer0);\n NameSpec nameSpec0 = NameSpec.NEVER;\n MockPrintWriter mockPrintWriter0 = new MockPrintWriter(\"#B0tMDNkWiXCI3n\");\n SQLUtil.renderCreateTable(defaultDBTable0, true, nameSpec0, mockPrintWriter0);\n assertEquals(\"table\", defaultDBTable0.getObjectType());\n }", "@Override\n\tpublic int dbsize() {\n\t\treturn 0;\n\t}" ]
[ "0.75162673", "0.7207716", "0.6856582", "0.63214904", "0.61810434", "0.6109898", "0.6099357", "0.60643154", "0.59978586", "0.5979398", "0.5952094", "0.5903999", "0.58972645", "0.585271", "0.5846257", "0.5809899", "0.58018017", "0.57985026", "0.57965136", "0.5771401", "0.57699853", "0.57660615", "0.5751976", "0.57483095", "0.573991", "0.57319665", "0.57164884", "0.5696641", "0.5687155", "0.568395", "0.56753296", "0.5667369", "0.5666063", "0.56496674", "0.5630785", "0.5625944", "0.56257564", "0.5618461", "0.55967504", "0.55848753", "0.5580355", "0.5579538", "0.55789524", "0.5563484", "0.55614966", "0.55604804", "0.55521995", "0.5550884", "0.5543351", "0.55340934", "0.55324435", "0.55278844", "0.552674", "0.55256736", "0.55248654", "0.55198175", "0.5513185", "0.55113673", "0.54969424", "0.5492285", "0.54781264", "0.5470682", "0.54671997", "0.546112", "0.5460634", "0.5439558", "0.5430981", "0.54204714", "0.54197943", "0.5417465", "0.54116", "0.54046506", "0.5402368", "0.5399423", "0.53944665", "0.5388514", "0.5385736", "0.5385214", "0.537763", "0.53700405", "0.5359754", "0.53582364", "0.53549147", "0.5353527", "0.53515434", "0.5348831", "0.5340497", "0.5334494", "0.53312504", "0.5331116", "0.53300834", "0.5328218", "0.5325344", "0.53162616", "0.53078955", "0.53073007", "0.53072876", "0.5306308", "0.5304805", "0.53032464", "0.5301233" ]
0.0
-1
Returns the number of pages in this HeapFile.
public int numPages() { return numPages; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int numPages() {\n \t//numOfPages = (int)(this.fileName.length()/BufferPool.PAGE_SIZE);\n return numOfPages;\n }", "public int numPages() {\n // some code goes here\n //System.out.println(\"File length :\" + f.length());\n\n return (int) Math.ceil(f.length() * 1.0 / BufferPool.PAGE_SIZE * 1.0);\n }", "public int numPages() {\n // some code goes here\n return (int) Math.ceil(m_f.length() / BufferPool.PAGE_SIZE);\n }", "public int numPages() {\n // some code goes here\n return (int)Math.ceil(f.length()/BufferPool.PAGE_SIZE);\n \n }", "public int getNumPages()\n {\n return numPages;\n }", "public int getPageCount()\n {\n return _pages.size();\n }", "public int getPagesize() {\n return pagesize_;\n }", "public int getPagesize() {\n return pagesize_;\n }", "public int getPageCount() {\n return mPdfRenderer.getPageCount();\n }", "public int getTotalPages()\r\n {\r\n return pageNames.size()-1;\r\n }", "@Schema(example = \"10\", description = \"Amount of pages available in the file. Used only for multipage documents.\")\n public Integer getPageCount() {\n return pageCount;\n }", "public int getTotalPages() {\r\n return totalPages;\r\n }", "int getNumPages();", "public Integer getPageItemCount() {\n return pageItemCount;\n }", "public int getPageCount() { return _pages.size(); }", "public int size() {\n\t\treturn heap.size();\n\t}", "public int getTotalPages() {\r\n\t\treturn page.getTotalPages();\r\n\t}", "public long size() {\n return this.filePage.getSizeInfile();\n }", "public int getNumPageFrames() {\n return ram.length;\n }", "int getPagesAmount();", "public int size()\r\n\t{\r\n\t\treturn heap.size();\r\n\t}", "public Number getFileCount() {\r\n\t\treturn (this.fileCount);\r\n\t}", "public int pageCount()\n {\n return (int)Math.ceil((double)getTaskVector().size() /\n (double)getRecordsPerPage());\n }", "public Integer getPageCount();", "public int getTotalPageCount() {\n try {\n return (int) this.webView.getEngine().executeScript(\"PDFViewerApplication.pagesCount;\");\n } catch (RuntimeException e) {\n e.printStackTrace();\n return 0;\n }\n }", "public int heapSize();", "int getPagesize();", "public static int getPageHits() {\r\n return _count;\r\n }", "public int getPageCount() {\n return (int) (getPageSize() > 0 ? Math.ceil(getTotalRecords() / getPageSize()) : 0);\n }", "public int getPages() {\n return pages;\n }", "public int getPages() {\n return pages;\n }", "public int getTotalPage() {\n return getSize() == 0 ? 1 : (int) Math.ceil((double) total / (double) getSize());\n }", "public int size() {\n return this.heap.size();\n }", "public int getPages() {\n return pages;\n }", "public long getBackPageFileSize() {\n long totalSize = 0L;\n final File[] pageFiles = this.pageDirFile.listFiles();\n if (pageFiles != null && pageFiles.length > 0)\n for (final File pageFile : pageFiles) {\n final String fileName = pageFile.getName();\n if (fileName.endsWith(PAGE_FILE_SUFFIX))\n totalSize += pageFile.length();\n }\n return totalSize;\n }", "public int getPages()\n {\n return pages;\n }", "public Integer getTotalPageCount() {\n return totalPageCount;\n }", "public long getSizeOfHeapCommit()\n throws IOException, EndOfStreamException\n {\n return (imageState_ == ImageStateType.PE64\n ? peFile_.readInt64(relpos(Offsets.SIZE_OF_HEAP_COMMIT_64.position))\n : peFile_.readInt32(relpos(Offsets.SIZE_OF_HEAP_COMMIT_32.position)));\n }", "@Override\n\tpublic int size() {\n\t\treturn heap.size();\n\t}", "public static int getPageSize() {\n\t\treturn Unsafe.get().pageSize();\n\t}", "public int getPageSize()\n {\n return bouquet.getSheaf().getPageSize();\n }", "@Override\n public int size() {\n return heap.size();\n }", "public long getSizeOfHeapReserve()\n throws IOException, EndOfStreamException\n {\n return (imageState_ == ImageStateType.PE64\n ? peFile_.readInt64(relpos(Offsets.SIZE_OF_HEAP_RESERVE_64.position))\n : peFile_.readInt32(relpos(Offsets.SIZE_OF_HEAP_RESERVE_32.position)));\n }", "public int getPageNumber ()\n {\n try {\n if (!isOfType (\"Page\"))\n throw new RuntimeException (\"invalid page reference\");\n return ((PDFDictionary) get (\"Parent\")).getPageOffset (this);\n } catch (Exception e) {\n Options.warn (e.getMessage ());\n return -1;\n }\n }", "public abstract Extent getHeapSize();", "public int getPageSize() {\r\n\t\t\t\treturn pageCount;\r\n\t\t\t}", "public int getNumber() {\r\n\t\treturn page.getNumberOfElements();\r\n\t}", "public int getGatheredPages() {\r\n return gatheredPages;\r\n }", "public Long getTotalPageNum() {\n\t\treturn this.totalPageNum;\n\t}", "public int size() {\n\t\treturn numEntries;\n\t}", "public int getSize() {\n return memory.length;\n }", "public final int size() {\n int size = 0;\n final Iterator iterator = this.iterator();\n while (iterator.hasNext()) {\n size++;\n iterator.next();\n }\n return size;\n }", "public int getPagesDisplayed() {\n return getTableModelSource().getTableModel().getPageCount();\n }", "public int getNumEntries() {\n return numEntries;\n }", "public int getNumberOfEntries();", "public int getNumberOfInProcessFiles() {\n return numberOfInProcessFiles;\n }", "public int size() {\n return bytes.length;\n }", "public int size() throws IOException {\n return (int) (index.size() / INDEX_BLOCK_LEN);\n }", "public int size() {\n // DO NOT MODIFY THIS METHOD!\n return size;\n }", "@Override\n public int getG2HashTableNumberOfEntries() throws G2AccessException {\n java.lang.Object retnValue = getAttributeValue (SystemAttributeSymbols.G2_HASH_TABLE_NUMBER_OF_ENTRIES_);\n return ((Integer)retnValue).intValue ();\n }", "public static int getPageCount(PDDocument doc) {\n\tint pageCount = doc.getNumberOfPages();\n\treturn pageCount;\n\t\n}", "public int size() {\n // DO NOT MODIFY!\n return size;\n }", "int getLocalOffHeapSize();", "public int getNumberOfPages(Document doc) {\n Elements elements = doc.select(\"table.sort_options\");\n Element table = elements.get(1);\n Elements columns = table.select(\"td\");\n Element column = columns.get(0);\n String str = column.text();\n String[] arr = str.split(\" \");\n int numberOfpages = Integer.valueOf(arr[arr.length - 1]);\n return numberOfpages;\n }", "public int size() {\n return files.size();\n }", "public Integer getZIP_PAGE_SIZE() {\n return ZIP_PAGE_SIZE;\n }", "public static int getPageSize() {\n\t\treturn PageSize;\n\t}", "public Long sizeInKB() {\n return this.sizeInKB;\n }", "public int size() {\n return this.n;\n }", "int getLocalOnHeapSize();", "public long size() {\n\t\treturn size;\n\t}", "public long size() {\n return segment.size();\n }", "public int getPages(){\n return pages;\n }", "public int getSize()\r\n {\r\n return pile.size();\r\n }", "public long picoSize() throws IOException {\n return _backing.length();\n }", "public int getTotalSize();", "public Integer getNumberOfEntries() {\n return this.numberOfEntries;\n }", "int memSize() {\r\n\t\treturn BASE_NODE_SIZE + 5 * 4;\r\n\t}", "public int size() {\n synchronized (this.base) {\n return this.base.size();\n }\n }", "public int size() {\n return doSize();\n }", "public double getNumFiles(){\n\t\treturn (this.num_files);\n\t}", "public int touchedPageCount (MemRef r) {\n\n return (int)((r.addr+r.size-1 >> mPageBits) - pageNumber(r) + 1);\n }", "public long size() {\n try {\n return Files.size(path);\n } catch (final IOException e) {\n throw new StageAccessException(\"Unable to get the size of staged document!\", e);\n }\n }", "public int getSize() {\n\n\treturn getSectors().size() * getUnitSize(); // 254 byte sectors\n }", "public int size() {\n // TODO: Implement this method\n return size;\n }", "public int getChunkCount () {\n return (this.getTagCount()>>BITS_TO_SHIFT_FOR_CHUNK) + 1;\n }", "public int numberOfBytes() {\n return this.data.size();\n }", "public int getSize() {\n return this.n;\n }", "public int sizeInBytes() {\n\t\treturn this.actualsizeinwords * 8;\n\t}", "int getFileCount();", "public int get_size()\r\n\t{\r\n\t\treturn this.size;\r\n\t}", "long getLocalOffHeapSizeInBytes();", "@Override\n public int size() {\n // Returns the number of elements stored in the heap\n return nelems;\n }", "public long size() {\n return file.length();\n }", "public int getSize() \n { \n return numberOfEntries;\n }", "public int getFileRecordCount() {\n\t\treturn fileRecordCount;\n\t}", "public int size() {\n return basePileup.size();\n }", "long getLocalOnHeapSizeInBytes();", "public long getFileSize()\n throws IOException\n {\n return file.length();\n }", "public int getNumberOfEntries() ;" ]
[ "0.8259953", "0.8042251", "0.79182535", "0.7674561", "0.73869544", "0.71135765", "0.703156", "0.6988106", "0.6967693", "0.6935015", "0.6881559", "0.68292326", "0.67702454", "0.6768808", "0.67416036", "0.67411995", "0.67388976", "0.6730148", "0.67280644", "0.6727937", "0.67100716", "0.6553113", "0.6546936", "0.6540043", "0.6532806", "0.65286666", "0.6528298", "0.651024", "0.65046763", "0.6502993", "0.6502993", "0.6489699", "0.6482922", "0.64245504", "0.63825005", "0.63578933", "0.6344144", "0.6300309", "0.6266511", "0.6265446", "0.62306315", "0.6202775", "0.6172177", "0.6149597", "0.608701", "0.6081029", "0.6043996", "0.6039812", "0.60212", "0.60126376", "0.5986223", "0.5955659", "0.59497064", "0.593551", "0.5932214", "0.59288615", "0.5902379", "0.5891088", "0.58898443", "0.58850414", "0.58795637", "0.58791417", "0.5873651", "0.58699113", "0.5850544", "0.5846675", "0.5845015", "0.5844658", "0.58363366", "0.58348805", "0.5829431", "0.5828016", "0.58258444", "0.5817303", "0.58115077", "0.58096874", "0.5808706", "0.5806362", "0.58048415", "0.57943666", "0.57923555", "0.5791447", "0.57871634", "0.57869816", "0.5786459", "0.5778522", "0.57719934", "0.577091", "0.57686573", "0.5765857", "0.57639056", "0.5762572", "0.5753675", "0.5750464", "0.57497746", "0.57487303", "0.57440007", "0.57378036", "0.573695", "0.5731142" ]
0.73827004
5
see DbFile.java for javadocs
public ArrayList<Page> insertTuple(TransactionId tid, Tuple t) throws DbException, IOException, TransactionAbortedException { // some code goes here return null; // not necessary for lab1 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public File getInputDb();", "public File getOutputDb();", "private String getFileTableQuery() {\n \t\tfinal StringBuilder builder = new StringBuilder();\n \n \t\tbuilder.append(\"create table FILE(\");\n \t\tbuilder.append(\"FILE_ID LONG PRIMARY KEY,\");\n \t\tbuilder.append(\"FILE_PATH TEXT,\");\n \t\tbuilder.append(\"START_REVISION_ID LONG,\");\n \t\tbuilder.append(\"END_REVISION_ID LONG\");\n \t\tbuilder.append(\")\");\n \n \t\treturn builder.toString();\n \t}", "public String getDatabaseFileName();", "public FileDatabase(String filename) throws IOException {\n\t\tdatabase = new File(filename);\n\t\tread();\n\t}", "public synchronized void writeFromFileIntoDB()throws IOWrapperException, IOIteratorException{\r\n \r\n fromFile_Name=Controller.CLASSES_TMP_FILENAME;\r\n iow_ReadFromFile = new IOWrapper();\r\n \r\n //System.out.println(\"Readin' from \"+fromFile_Name);\r\n \r\n iow_ReadFromFile.setupInput(fromFile_Name,0);\r\n \r\n iter_ReadFromFile = iow_ReadFromFile.getLineIterator();\r\n iow_ReadFromFile.setupOutput(this.dbname,this.username,this.password,this.hostname,this.port);\r\n \r\n iow_ReadFromFile.sendOutputQuery(\"DROP TABLE IF EXISTS \"+outtable);\r\n \r\n iow_ReadFromFile.sendOutputQuery(\r\n \"CREATE TABLE IF NOT EXISTS \"\r\n +outtable+\" (\"\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[0]+\" int(10) NOT NULL AUTO_INCREMENT, \"//wort_nr\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[1]+\" varchar(225), \"//wort_alph\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[2]+\" int(10), \"//krankheit \r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[3]+\" int(10), \"//farbe1 \r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[4]+\" real(8,2), \"//farbe1prozent\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[5]+\" int(10), \"//farbe2\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[6]+\" real(8,2), \"//farbe2prozent\r\n +\"PRIMARY KEY (\"+Controller.COLUMN_NAMES_FOR_DB_OUT[0]+\")) \"\r\n +\"ENGINE=MyISAM\"\r\n );\r\n while(iter_ReadFromFile.hasNext()){\r\n singleProgress+=1;\r\n String[] data = (String[])iter_ReadFromFile.next();\r\n \r\n //System.out.println(\"--> processing line \"+data);\r\n //escape quotes ' etc for SQL query\r\n if(data[1].matches(\".*'.*\")||data[1].matches(\".*\\\\.*\")){\r\n int sl = data[1].length();\r\n String escapedString = \"\";\r\n \r\n for (int i = 0; i < sl; i++) {\r\n char ch = data[1].charAt(i);\r\n switch (ch) {\r\n case '\\'':\r\n escapedString +='\\\\';\r\n escapedString +='\\'';\r\n break;\r\n case '\\\\':\r\n escapedString +='\\\\';\r\n escapedString +='\\\\';\r\n break;\r\n default :\r\n escapedString +=ch;\r\n break;\r\n }\r\n }\r\n data[1]=escapedString;\r\n }\r\n \r\n String insertStatement=\"INSERT INTO \"\r\n +outtable+\" (\"\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[0]+\", \"//node id\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[1]+\", \"//label\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[2]+\", \"//class id \r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[3]+\", \"//class id 1 \r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[4]+\", \"//percent\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[5]+\", \"//class id 2\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[6]+\") \"//percent \r\n +\"VALUES ('\"\r\n +data[0]+\"', '\"\r\n +data[1]+\"', '\"\r\n +data[2]+\"', '\"\r\n +data[3]+\"', '\"\r\n +data[4]+\"', '\"\r\n +data[5]+\"', '\"\r\n +data[6]+\"')\";\r\n \r\n //System.out.println(\"Sending insert statement:\"+insertStatement);\r\n iow_ReadFromFile.sendOutputQuery(insertStatement);\r\n }\r\n \r\n \r\n //iow_ReadFromFile.closeOutput();\r\n \r\n this.stillWorks=false;\r\n writeIntoDB=false;\r\n System.out.println(\"*\\tData written into database.\");\r\n\t}", "interface DataTableFile extends TableDataSource {\n\n /**\n * Creates a new file of the given table. The table is initialised and\n * contains 0 row entries. If the table already exists in the database then\n * this will throw an exception.\n * <p>\n * On exit, the object will be initialised and loaded with the given table.\n *\n * @param def the definition of the table.\n */\n void create(DataTableDef def) throws IOException;\n\n /**\n * Updates a file of the given table. If the table does not exist, then it\n * is created. If the table already exists but is different, then the\n * existing table is modified to incorporate the new fields structure.\n * <p>\n * The DataTableFile must have previously been 'load(table_name)' before\n * this call.\n * <p>\n * Implementations of this method may choose to reorganise information that\n * the relational schemes are dependant on (the row order for example). If\n * this method returns 'true' then we must also reindex the schemes.\n * <p>\n * <strong>NOTE:</strong> If the new format has columns that are not\n * included in the new format then the columns are deleted.\n *\n * @param def the definition of the table.\n * @return true if the table topology has changed.\n */\n boolean update(DataTableDef def) throws IOException;\n\n /**\n * This is called periodically when this data table file requires some\n * maintenance. It is recommended that this method is called every\n * time the table is initialized (loaded).\n * <p>\n * The DataTableFile must have previously been 'load(table_name)' before\n * this call.\n * <p>\n * This method may change the topology of the rows (delete rows that are\n * marked as deleted), therefore if the method returns true you need to\n * re-index the schemes.\n *\n * @return true if the table topology was changed.\n */\n boolean doMaintenance() throws IOException;\n\n// /**\n// * A recovery method that returns a DataTableDef object for this data\n// * table file that was last used in a call to 'create' or 'update'. This\n// * information should be kept in a secondary table topology store but it\n// * is useful to keep this information in the data table file just incase\n// * something bad happens, or tables are moved to another database.\n// */\n// DataTableDef recoverLastDataTableDef() throws IOException;\n\n /**\n * Loads a previously created table. A table can be loaded in read only\n * mode, in which case any methods that write to the DataTableFile will\n * throw an IOException.\n *\n * @param table_name the name of the table.\n * @param read_only if true then the table file is opened as read-only.\n */\n void load(String table_name, boolean read_only) throws IOException;\n\n /**\n * Shuts down the table. This is called when the table is closed and the\n * resources it uses are to be freed back to the system. This is called\n * as part of the database shut down procedure or called when we want to\n * free the resources associated with this table.\n */\n void shutdown() throws IOException;\n\n /**\n * Deletes the data table file in the file system. This is used to clear\n * up resources after a table has been dropped. The table must be shut\n * down before this method is called.\n * <p>\n * NOTE: Use this with care. All data is lost!\n */\n void drop();\n\n /**\n * Flushes all information that may be cached in memory to disk. This\n * includes any relational data, any cached data that hasn't made it to\n * the file system yet. It will write out all persistant information\n * and leave the table in a state where it is fully represented in the\n * file system.\n */\n void updateFile() throws IOException;\n\n /**\n * Locks the data in the file to prevent the system overwritting entries\n * that have been marked as removed. This is necessary so we may still\n * safely read removed entries from the table while the table is locked.\n */\n void addRowsLock();\n\n /**\n * Unlocks the data in the file to indicate that the system may safely\n * overwrite removed entries in the file.\n */\n void removeRowsLock();\n\n /**\n * Returns true if the file currently has all of its rows locked.\n */\n boolean hasRowsLocked();\n\n// /**\n// * The number of rows that are currently stored in this table. This number\n// * does not include the rows that have been marked as removed.\n// */\n// int rowCount();\n\n /**\n * Returns true if the given row index points to a valid and available\n * row entry. Returns false if the row entry has been marked as removed,\n * or the index goes outside the bounds of the table.\n */\n boolean isRowValid(int record_index) throws IOException;\n\n /**\n * Adds a complete new row into the table. If the table is in a row locked\n * state, then this will always add a new entry to the end of the table.\n * Otherwise, new entries are added where entries were previously removed.\n * <p>\n * This will update any column indices that are set.\n *\n */\n int addRow(RowData row_data) throws IOException;\n\n /**\n * Removes a row from the table at the given index. This will only mark\n * the entry as removed, and will not actually remove the data. This is\n * because a process is allowed to read the data even after the row has been\n * marked as removed (if the rows have been locked).\n * <p>\n * This will update any column indices that are set.\n *\n * @param row_index the raw row index of the entry to be marked as removed.\n */\n void removeRow(int row_index) throws IOException;\n\n// /**\n// * Returns a DataCell object of the entry at the given column, row\n// * index in the table. This will always work provided there was once data\n// * stored at that index, even if the row has been marked as deleted.\n// */\n// DataCell getCellAt(int column, int row) throws IOException;\n\n /**\n * Returns a unique number. This is incremented each time it is accessed.\n */\n long nextUniqueKey() throws IOException;\n\n}", "public DatabaseFileInformation(byte[] aFileBytes)\n {\n mTables = new LinkedList<>();\n\n mHeader = (short) (((0xFF) & aFileBytes[1]) | (((0xFF) & aFileBytes[0]) << 8));\n mVersion = (short) (((0xFF) & aFileBytes[3]) | (((0xFF) & aFileBytes[2]) << 8));\n mUnknown1 = ((0xFF) & aFileBytes[7]) | (((0xFF) & aFileBytes[6]) << 8) | (((0xFF) & aFileBytes[5]) <<\n 16) | (((0xFF) & aFileBytes[4]) << 24);\n mDatabaseSize = ((0xFF) & aFileBytes[11]) | (((0xFF) & aFileBytes[10]) << 8) | (((0xFF) & aFileBytes[9]) <<\n 16) | (((0xFF) & aFileBytes[8]) << 24);\n mZero = ((0xFF) & aFileBytes[15]) | (((0xFF) & aFileBytes[14]) << 8) | (((0xFF) & aFileBytes[13]) <<\n 16) | (((0xFF) & aFileBytes[12]) << 24);\n mTableCount = ((0xFF) & aFileBytes[19]) | (((0xFF) & aFileBytes[18]) << 8) | (((0xFF) & aFileBytes[17]) <<\n 16) | (((0xFF) & aFileBytes[16]) << 24);\n mUnknown2 = ((0xFF) & aFileBytes[23]) | (((0xFF) & aFileBytes[22]) << 8) | (((0xFF) & aFileBytes[21]) <<\n 16) | (((0xFF) & aFileBytes[20]) << 24);\n\n int lTableDefinitionPosition = 24;\n int lTableDataStart = lTableDefinitionPosition + (mTableCount * 8);\n\n // Read the table definitions.\n for (int i = 0; i < mTableCount; i++)\n {\n DatabaseTable lDatabaseTable = new DatabaseTable();\n lDatabaseTable.readTableDefinition(aFileBytes, lTableDefinitionPosition);\n lDatabaseTable.readTableHeader(aFileBytes, lTableDataStart);\n mTables.add(lDatabaseTable);\n lTableDefinitionPosition += 8;\n }\n }", "public interface DatabaseManager {\r\n\r\n // NOTE: this is a draft of the interface. More methods will likely be\r\n // added.\r\n\r\n /**\r\n * Uploads the specified feature to the database.\r\n * \r\n * @param file the shapefile (*.shp) to upload\r\n * @param project the project to associate the shapefile with\r\n * @return the id of the feature in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadFeature(File file, String project) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified modis tile to the database.\r\n * \r\n * @param file the .hdf to upload\r\n * @param product the modis product\r\n * @param date the date the data was captured\r\n * @param downloaded the date the data was downloaded from the host\r\n * @param horz the horizontal tile number\r\n * @param vert the vertical tile number\r\n * @return the id of the Modis raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadModis(File file, ModisProduct product, DataDate date, DataDate updated, int horz, int vert) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified ETo file to the database.\r\n * \r\n * @param file the\r\n * @param date\r\n * @param updated\r\n * @return the id of the ETo raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadEto(File file, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified TRMM file to the database.\r\n * \r\n * @param file\r\n * @param date\r\n * @param updated\r\n * @return the id of the TRMM raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadTrmm(File file, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified projected Modis product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param product\r\n * @param date\r\n * @param updated\r\n * @return the id of the projected Modis raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadProjectedModis(File file, String project, ModisProduct product, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified projected ETo product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the projected ETo raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadProjectedEto(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the projected TRMM product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the TRMM raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadProjectedTrmm(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified ETa product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the ETa raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadEta(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified EVI product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the EVI raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadEvi(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified NDVI product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the NDVI raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadNdvi(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified NDWI5 product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the NDWI5 raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadNdwi5(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified NDWI6 product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the NDWI6 raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadNdwi6(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified SAVI product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the SAVI raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadSavi(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified feature and places it in the specified file in\r\n * the shapefile.\r\n * \r\n * @param file the location to save the feature\r\n * @param id the id of the feature\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadFeature(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified Modis tile from the database.\r\n * \r\n * @param file\r\n * @param product\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadModis(File file, ModisProduct product, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified ETo raster from the database and saves it to the\r\n * specified file.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadEto(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified TRMM raster from the database and saves it to the\r\n * specified file.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadTrmm(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified projected Modis product from the database.\r\n * \r\n * @param file\r\n * @param product\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadProjectedModis(File file, ModisProduct product, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified projected ETo product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadProjectedEto(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified projected TRMM product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadProjectedTrmm(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified ETa product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadEta(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified EVI product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadEvi(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified NDVI product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadNdvi(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified NDWI5 product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadNdwi5(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified NDWI6 product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadNdwi6(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified SAVI product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadSavi(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Returns the id of the MODIS raster for the specified product and date.\r\n * \r\n * @param product\r\n * @param date\r\n * @param horz\r\n * @param vert\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getModisId(ModisProduct product, DataDate date, int horz, int vert) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the ETo for the specified date.\r\n * \r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getEtoId(DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the TRMM for the specified date.\r\n * \r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getTrmmId(DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the reprojected Modis raster for the specified\r\n * project, product, and date.\r\n * \r\n * @param project\r\n * @param product\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getReprojectedModisId(String project, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the reprojected ETo raster for the specified project\r\n * and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getReprojectedEtoId(String project, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the reprojected TRMM raster for the specified project\r\n * and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getReprojectedTrmmId(String project, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the ETa raster for the specified project and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getEtaId(String project, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the EVI raster for the specified project and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getEviId(String project, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the NDVI raster for the specified project and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getNdviId(String project, String feature, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the NDWI5 raster for the specified project and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getNdwi5Id(String project, String feature, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the NDWI6 raster for the specified project and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getNdwi6Id(String project, String feature, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the SAVI raster for the specified project and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getSaviId(String project, String feature, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Uploads the specified zonal statistics.\r\n * \r\n * @param project\r\n * @param feature\r\n * @param zoneField\r\n * @param zone\r\n * @param date\r\n * @param index\r\n * @param zonalStatistics\r\n */\r\n void uploadZonalStatistic(String project, String feature, String zoneField,\r\n String zone, DataDate date, EnvironmentalIndex index,\r\n ZonalStatistic zonalStatistics) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the zonal statistics for the specified parameters.\r\n * \r\n * @param project\r\n * @param feature\r\n * @param zoneField\r\n * @param zone\r\n * @param date\r\n * @param index\r\n * @return the id or -1 if it is not found\r\n */\r\n int getZonalStatisticId(String project, String feature, String zoneField,\r\n String zone, DataDate date, EnvironmentalIndex index)\r\n throws SQLException;\r\n\r\n /**\r\n * Returns zonal statistics for the specified zonal statistic id.\r\n * \r\n * @param id\r\n * @return zonal statistics\r\n * @throws SQLException\r\n */\r\n ZonalStatistic getZonalStatistic(int id) throws SQLException;\r\n}", "public abstract String apachedb(int size);", "public void createDB() {\n\t\ttry {\n\t\t\tBufferedReader br= new BufferedReader(new FileReader(\"db_schema.txt\"));\n\t\t\tString line= null;\n\t\t\tStringBuilder sb= new StringBuilder();\n\t\t\twhile ((line=br.readLine())!=null){\n\t\t\t\tsb.append(line);\n\t\t\t\tif(sb.length()>0 && sb.charAt(sb.length()-1)==';'){//see if it is the end of one line of command\n\t\t\t\t\tstatement.executeUpdate(sb.toString());\n\t\t\t\t\tsb= new StringBuilder();\n\t\t\t\t}\n\t\t\t}\n\t\t\tbr.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public String getPath() { return db.getPath(); }", "String getUserDatabaseFilePath();", "public abstract ODatabaseInternal<?> openDatabase();", "private DBManager() throws Exception {\n file = new File(\"pdfLibraryDB.mv.db\");\n if (!file.exists()) {\n conn = connect();\n stmt = conn.createStatement();\n query = \"CREATE TABLE user(username VARCHAR(30) PRIMARY KEY, password VARCHAR(32));\" +\n \"CREATE TABLE category(id VARCHAR(30) PRIMARY KEY, name VARCHAR(30), username VARCHAR(30), FOREIGN KEY(username) REFERENCES user(username) ON UPDATE CASCADE ON DELETE CASCADE);\"+\n \"CREATE TABLE favorite(id VARCHAR(30) PRIMARY KEY, path VARCHAR(500), keyword VARCHAR(200), searchType VARCHAR(10), category VARCHAR(30),username VARCHAR(30), FOREIGN KEY(username) REFERENCES user(username) ON UPDATE CASCADE ON DELETE CASCADE, FOREIGN KEY(category) REFERENCES category(id) ON UPDATE CASCADE ON DELETE CASCADE);\" +\n \"CREATE TABLE history(id VARCHAR(30) PRIMARY KEY, keyword VARCHAR(200), type VARCHAR(10), directory VARCHAR(500), username VARCHAR(30), FOREIGN KEY(username) REFERENCES user(username) ON UPDATE CASCADE ON DELETE CASCADE);\";\n stmt.executeUpdate(query);\n stmt.close();\n conn.close();\n System.out.println(\"DB created!\");\n }\n }", "@Test\n public void reading()\n throws FileNotFoundException, IOException, CorruptedTableException\n {\n final Database database =\n new Database(new File(\"src/test/resources/\" + versionDirectory + \"/rndtrip\"), version);\n final Set<String> tableNames = database.getTableNames();\n\n assertEquals(2,\n tableNames.size());\n assertTrue(\"TABLE1 not found in 'short roundtrip' database\",\n tableNames.contains(\"TABLE1.DBF\"));\n assertTrue(\"TABLE2 not found in 'short roundtrip' database\",\n tableNames.contains(\"TABLE2.DBF\"));\n\n final Table t1 = database.getTable(\"TABLE1.DBF\");\n\n try\n {\n t1.open(IfNonExistent.ERROR);\n\n assertEquals(\"Table name incorrect\",\n \"TABLE1.DBF\",\n t1.getName());\n assertEquals(\"Last modified date incorrect\",\n Util.createDate(2009, Calendar.APRIL, 1),\n t1.getLastModifiedDate());\n\n final List<Field> fields = t1.getFields();\n\n Iterator<Field> fieldIterator = fields.iterator();\n Map<String, Field> nameFieldMap = new HashMap<String, Field>();\n\n while (fieldIterator.hasNext())\n {\n Field f = fieldIterator.next();\n nameFieldMap.put(f.getName(),\n f);\n }\n\n final Field idField = nameFieldMap.get(\"ID\");\n assertEquals(Type.NUMBER,\n idField.getType());\n assertEquals(idField.getLength(),\n 3);\n\n final Field stringField = nameFieldMap.get(\"STRFIELD\");\n assertEquals(Type.CHARACTER,\n stringField.getType());\n assertEquals(stringField.getLength(),\n 50);\n\n final Field logicField = nameFieldMap.get(\"LOGICFIELD\");\n assertEquals(Type.LOGICAL,\n logicField.getType());\n assertEquals(logicField.getLength(),\n 1);\n\n final Field dateField = nameFieldMap.get(\"DATEFIELD\");\n assertEquals(Type.DATE,\n dateField.getType());\n assertEquals(8,\n dateField.getLength());\n\n final Field floatField = nameFieldMap.get(\"FLOATFIELD\");\n assertEquals(Type.NUMBER,\n floatField.getType());\n assertEquals(10,\n floatField.getLength());\n\n final List<Record> records = UnitTestUtil.createSortedRecordList(t1.recordIterator(),\n \"ID\");\n final Record r0 = records.get(0);\n\n assertEquals(1,\n r0.getNumberValue(\"ID\"));\n assertEquals(\"String data 01\",\n r0.getStringValue(\"STRFIELD\").trim());\n assertEquals(true,\n r0.getBooleanValue(\"LOGICFIELD\"));\n assertEquals(Util.createDate(1909, Calendar.MARCH, 18),\n r0.getDateValue(\"DATEFIELD\"));\n assertEquals(1234.56,\n r0.getNumberValue(\"FLOATFIELD\"));\n\n final Record r1 = records.get(1);\n\n assertEquals(2,\n r1.getNumberValue(\"ID\"));\n assertEquals(\"String data 02\",\n r1.getStringValue(\"STRFIELD\").trim());\n\n /*\n * in Clipper 'false' value can be given as an empty field, and the method called here\n * returns then 'null' as the return value\n */\n if (version == Version.CLIPPER_5)\n {\n assertEquals(null,\n r1.getBooleanValue(\"LOGICFIELD\"));\n }\n else\n {\n assertEquals(false,\n r1.getBooleanValue(\"LOGICFIELD\"));\n }\n\n assertEquals(Util.createDate(1909, Calendar.MARCH, 20),\n r1.getDateValue(\"DATEFIELD\"));\n assertEquals(-23.45,\n r1.getNumberValue(\"FLOATFIELD\"));\n\n final Record r2 = records.get(2);\n\n assertEquals(3,\n r2.getNumberValue(\"ID\"));\n assertEquals(\"\",\n r2.getStringValue(\"STRFIELD\").trim());\n assertEquals(null,\n r2.getBooleanValue(\"LOGICFIELD\"));\n assertEquals(null,\n r2.getDateValue(\"DATEFIELD\"));\n assertEquals(null,\n r2.getNumberValue(\"FLOATFIELD\"));\n\n final Record r3 = records.get(3);\n\n assertEquals(4,\n r3.getNumberValue(\"ID\"));\n assertEquals(\"Full5678901234567890123456789012345678901234567890\",\n r3.getStringValue(\"STRFIELD\").trim());\n\n /*\n * in Clipper 'false' value can be given as an empty field, and the method called here\n * returns then 'null' as the return value\n */\n if (version == Version.CLIPPER_5)\n {\n assertEquals(null,\n r3.getBooleanValue(\"LOGICFIELD\"));\n }\n else\n {\n assertEquals(false,\n r3.getBooleanValue(\"LOGICFIELD\"));\n }\n\n assertEquals(Util.createDate(1909, Calendar.MARCH, 20),\n r3.getDateValue(\"DATEFIELD\"));\n assertEquals(-0.30,\n r3.getNumberValue(\"FLOATFIELD\"));\n }\n finally\n {\n t1.close();\n }\n\n final Table t2 = database.getTable(\"TABLE2.DBF\");\n\n try\n {\n t2.open(IfNonExistent.ERROR);\n\n final List<Field> fields = t2.getFields();\n\n Iterator<Field> fieldIterator = fields.iterator();\n Map<String, Field> nameFieldMap = new HashMap<String, Field>();\n\n while (fieldIterator.hasNext())\n {\n Field f = fieldIterator.next();\n nameFieldMap.put(f.getName(),\n f);\n }\n\n final Field idField = nameFieldMap.get(\"ID2\");\n assertEquals(Type.NUMBER,\n idField.getType());\n assertEquals(idField.getLength(),\n 4);\n\n final Field stringField = nameFieldMap.get(\"MEMOFIELD\");\n assertEquals(Type.MEMO,\n stringField.getType());\n assertEquals(10,\n stringField.getLength());\n\n final Iterator<Record> recordIterator = t2.recordIterator();\n final Record r = recordIterator.next();\n\n String declarationOfIndependence = \"\";\n\n declarationOfIndependence += \"When in the Course of human events it becomes necessary for one people \";\n declarationOfIndependence += \"to dissolve the political bands which have connected them with another and \";\n declarationOfIndependence += \"to assume among the powers of the earth, the separate and equal station to \";\n declarationOfIndependence += \"which the Laws of Nature and of Nature's God entitle them, a decent respect \";\n declarationOfIndependence += \"to the opinions of mankind requires that they should declare the causes which \";\n declarationOfIndependence += \"impel them to the separation.\";\n declarationOfIndependence += \"\\r\\n\\r\\n\";\n declarationOfIndependence += \"We hold these truths to be self-evident, that all men are created equal, \";\n declarationOfIndependence += \"that they are endowed by their Creator with certain unalienable Rights, \";\n declarationOfIndependence += \"that among these are Life, Liberty and the persuit of Happiness.\";\n\n assertEquals(1,\n r.getNumberValue(\"ID2\"));\n assertEquals(declarationOfIndependence,\n r.getStringValue(\"MEMOFIELD\"));\n }\n finally\n {\n t2.close();\n }\n }", "@Insert({ \"insert into csv_file (id, pid, \", \"filename, start_time, \", \"end_time, length, \", \"density, machine, \",\n\t\t\t\"ar, path, size, \", \"uuid, header_time, \", \"last_update, conflict_resolved, \", \"status, comment, \",\n\t\t\t\"width, start_version, \", \"end_version)\", \"values (#{id,jdbcType=INTEGER}, #{pid,jdbcType=VARCHAR}, \",\n\t\t\t\"#{filename,jdbcType=VARCHAR}, #{startTime,jdbcType=TIMESTAMP}, \",\n\t\t\t\"#{endTime,jdbcType=TIMESTAMP}, #{length,jdbcType=INTEGER}, \",\n\t\t\t\"#{density,jdbcType=DOUBLE}, #{machine,jdbcType=VARCHAR}, \",\n\t\t\t\"#{ar,jdbcType=BIT}, #{path,jdbcType=VARCHAR}, #{size,jdbcType=BIGINT}, \",\n\t\t\t\"#{uuid,jdbcType=CHAR}, #{headerTime,jdbcType=TIMESTAMP}, \",\n\t\t\t\"#{lastUpdate,jdbcType=TIMESTAMP}, #{conflictResolved,jdbcType=BIT}, \",\n\t\t\t\"#{status,jdbcType=INTEGER}, #{comment,jdbcType=VARCHAR}, \",\n\t\t\t\"#{width,jdbcType=INTEGER}, #{startVersion,jdbcType=INTEGER}, \", \"#{endVersion,jdbcType=INTEGER})\" })\n\tint insert(CsvFile record);", "public void database() throws IOException\n {\n \tFile file =new File(\"data.txt\");\n\t if(!file.exists())\n\t {\n\t \tSystem.out.println(\"File 'data.txt' does not exit\");\n\t System.out.println(file.createNewFile());\n\t file.createNewFile();\n\t databaseFileWrite(file);//call the databaseFileRead() method, to initialize data from ArrayList and write data into data.txt\n\t }\n\t else\n\t {\n\t \tdatabaseFileRead();//call the databaseFileRead() method, to load data directly from data.txt\n\t }\n }", "@Override\n\tpublic void CreateDatabaseFromFile() {\n\t\tfinal String FILENAME = \"fandv.sql\";\n\t\tint[] updates = null;\n\t\ttry {\n\t\t\tMyDatabase db = new MyDatabase();\n\t\t\tupdates = db.updateAll(FILENAME);\n\t\t} catch (FileNotFoundException | SQLException | ClassNotFoundException e) {\n\t\t\tSystem.out.println(\"Database issue\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < updates.length; i++) {\n\t\t\tsum += updates[i];\n\t\t}\n\t\tSystem.out.println(\"Number of updates: \" + sum);\n\t}", "public GEMFileRockDao() {\n gemFileDb = RocksDatabase.getInstance(DB_NAME, String.class, GEMFile.class);\n gemFileFileTypesDb =\n RocksDatabase.getInstance(DB_NAME + \"_FileType\", String.class, Integer.class);\n gemFileState = RocksDatabase.getInstance(DB_NAME + \"_FileState\", String.class, String.class);\n gemFileState.put(STATE_SYNC_PROGRESS, String.valueOf(SYNC_COMPLETE));\n }", "public DBInternal(File directory, DBOptions options) {\n this.directory = directory;\n this.options = options;\n // TODO: check options.\n\n // TODO: rebuid index.\n\n // TODO: initialize fileID. Make sure the starting number is the largest number used so far.\n\n // TODO: open a current file writer.\n\n // TODO: start offline compaction.\n\n }", "public final void executeSQL(Connection conn,DbConnVO vo,String fileName) throws Throwable {\r\n PreparedStatement pstmt = null;\r\n StringBuffer sql = new StringBuffer(\"\");\r\n InputStream in = null;\r\n\r\n try {\r\n try {\r\n in = this.getClass().getResourceAsStream(\"/\" + fileName);\r\n }\r\n catch (Exception ex5) {\r\n }\r\n if (in==null)\r\n in = new FileInputStream(org.openswing.swing.util.server.FileHelper.getRootResource() + fileName);\r\n\r\n BufferedReader br = new BufferedReader(new InputStreamReader(in));\r\n String line = null;\r\n ArrayList vals = new ArrayList();\r\n int pos = -1;\r\n String oldfk = null;\r\n String oldIndex = null;\r\n StringBuffer newIndex = null;\r\n StringBuffer newfk = null;\r\n ArrayList fks = new ArrayList();\r\n ArrayList indexes = new ArrayList();\r\n boolean fkFound = false;\r\n boolean indexFound = false;\r\n String defaultValue = null;\r\n int index = -1;\r\n StringBuffer unicode = new StringBuffer();\r\n boolean useDefaultValue = false;\r\n// vo.getDriverName().equals(\"oracle.jdbc.driver.OracleDriver\") ||\r\n// vo.getDriverName().equals(\"com.microsoft.jdbc.sqlserver.SQLServerDriver\") ||\r\n//\t\t\t\t\tvo.getDriverName().equals(\"com.microsoft.sqlserver.jdbc.SQLServerDriver\") ||\r\n// vo.getDriverName().equals(\"com.mysql.jdbc.Driver\");\r\n while ( (line = br.readLine()) != null) {\r\n sql.append(' ').append(line);\r\n if (line.endsWith(\";\")) {\r\n if (vo.getDriverName().equals(\"oracle.jdbc.driver.OracleDriver\")) {\r\n sql = replace(sql, \" VARCHAR(\", \" VARCHAR2(\");\r\n sql = replace(sql, \" NUMERIC(\", \" NUMBER(\");\r\n sql = replace(sql, \" DECIMAL(\", \" NUMBER(\");\r\n sql = replace(sql, \" TIMESTAMP\", \" DATE \");\r\n sql = replace(sql, \" DATETIME\", \" DATE \");\r\n }\r\n else if (vo.getDriverName().equals(\"com.microsoft.jdbc.sqlserver.SQLServerDriver\")) {\r\n sql = replace(sql, \" TIMESTAMP\", \" DATETIME \");\r\n sql = replace(sql, \" DATE \", \" DATETIME \");\r\n }\r\n else if (vo.getDriverName().equals(\"com.microsoft.sqlserver.jdbc.SQLServerDriver\")) {\r\n sql = replace(sql, \" TIMESTAMP\", \" DATETIME \");\r\n sql = replace(sql, \" DATE \", \" DATETIME \");\r\n }\r\n else if (vo.getDriverName().toLowerCase().contains(\"postgres\")) {\r\n sql = replace(sql, \" DATETIME\", \" TIMESTAMP \");\r\n sql = replace(sql, \" DATE \", \" TIMESTAMP \");\r\n }\r\n else {\r\n sql = replace(sql, \" DATE \", \" DATETIME \");\r\n }\r\n\r\n\r\n sql = replace(sql,\"ON DELETE NO ACTION\",\"\");\r\n sql = replace(sql,\"ON UPDATE NO ACTION\",\"\");\r\n\r\n if (sql.indexOf(\":COMPANY_CODE\") != -1) {\r\n sql = replace(sql, \":COMPANY_CODE\", \"'\" + vo.getCompanyCode() + \"'\");\r\n }\r\n if (sql.indexOf(\":COMPANY_DESCRIPTION\") != -1) {\r\n sql = replace(sql, \":COMPANY_DESCRIPTION\",\r\n \"'\" + vo.getCompanyDescription() + \"'\");\r\n }\r\n if (sql.indexOf(\":LANGUAGE_CODE\") != -1) {\r\n sql = replace(sql, \":LANGUAGE_CODE\",\r\n \"'\" + vo.getLanguageCode() + \"'\");\r\n }\r\n if (sql.indexOf(\":LANGUAGE_DESCRIPTION\") != -1) {\r\n sql = replace(sql, \":LANGUAGE_DESCRIPTION\",\r\n \"'\" + vo.getLanguageDescription() + \"'\");\r\n }\r\n if (sql.indexOf(\":CLIENT_LANGUAGE_CODE\") != -1) {\r\n sql = replace(sql, \":CLIENT_LANGUAGE_CODE\",\r\n \"'\" + vo.getClientLanguageCode() + \"'\");\r\n }\r\n if (sql.indexOf(\":PASSWORD\") != -1) {\r\n sql = replace(sql, \":PASSWORD\", \"'\" + vo.getAdminPassword() + \"'\");\r\n }\r\n if (sql.indexOf(\":DATE\") != -1) {\r\n sql = replace(sql, \":DATE\", \"?\");\r\n vals.add(new java.sql.Date(System.currentTimeMillis()));\r\n }\r\n\r\n if (sql.indexOf(\":CURRENCY_CODE\") != -1) {\r\n sql = replace(sql, \":CURRENCY_CODE\", \"'\" + vo.getCurrencyCodeREG03() + \"'\");\r\n }\r\n if (sql.indexOf(\":CURRENCY_SYMBOL\") != -1) {\r\n sql = replace(sql, \":CURRENCY_SYMBOL\", \"'\" + vo.getCurrencySymbolREG03() + \"'\");\r\n }\r\n if (sql.indexOf(\":DECIMALS\") != -1) {\r\n sql = replace(sql, \":DECIMALS\", vo.getDecimalsREG03().toString());\r\n }\r\n if (sql.indexOf(\":DECIMAL_SYMBOL\") != -1) {\r\n sql = replace(sql, \":DECIMAL_SYMBOL\", \"'\" + vo.getDecimalSymbolREG03() + \"'\");\r\n }\r\n if (sql.indexOf(\":THOUSAND_SYMBOL\") != -1) {\r\n sql = replace(sql, \":THOUSAND_SYMBOL\", \"'\" + vo.getThousandSymbolREG03() + \"'\");\r\n }\r\n\r\n if (sql.indexOf(\":USE_VARIANT_TYPE_1\") != -1) {\r\n sql = replace(sql, \":USE_VARIANT_TYPE_1\", \"'\" + vo.getUseVariantType1() + \"'\");\r\n }\r\n if (sql.indexOf(\":USE_VARIANT_TYPE_2\") != -1) {\r\n sql = replace(sql, \":USE_VARIANT_TYPE_2\", \"'\" + vo.getUseVariantType2() + \"'\");\r\n }\r\n if (sql.indexOf(\":USE_VARIANT_TYPE_3\") != -1) {\r\n sql = replace(sql, \":USE_VARIANT_TYPE_3\", \"'\" + vo.getUseVariantType3() + \"'\");\r\n }\r\n if (sql.indexOf(\":USE_VARIANT_TYPE_4\") != -1) {\r\n sql = replace(sql, \":USE_VARIANT_TYPE_4\", \"'\" + vo.getUseVariantType4() + \"'\");\r\n }\r\n if (sql.indexOf(\":USE_VARIANT_TYPE_5\") != -1) {\r\n sql = replace(sql, \":USE_VARIANT_TYPE_5\", \"'\" + vo.getUseVariantType5() + \"'\");\r\n }\r\n\r\n if (sql.indexOf(\":VARIANT_1\") != -1) {\r\n sql = replace(sql, \":VARIANT_1\", \"'\" + (vo.getVariant1()==null || vo.getVariant1().trim().equals(\"\")?ApplicationConsts.JOLLY:vo.getVariant1()) + \"'\");\r\n }\r\n if (sql.indexOf(\":VARIANT_2\") != -1) {\r\n sql = replace(sql, \":VARIANT_2\", \"'\" + (vo.getVariant2()==null || vo.getVariant2().trim().equals(\"\")?ApplicationConsts.JOLLY:vo.getVariant2()) + \"'\");\r\n }\r\n if (sql.indexOf(\":VARIANT_3\") != -1) {\r\n sql = replace(sql, \":VARIANT_3\", \"'\" + (vo.getVariant3()==null || vo.getVariant3().trim().equals(\"\")?ApplicationConsts.JOLLY:vo.getVariant3()) + \"'\");\r\n }\r\n if (sql.indexOf(\":VARIANT_4\") != -1) {\r\n sql = replace(sql, \":VARIANT_4\", \"'\" + (vo.getVariant4()==null || vo.getVariant4().trim().equals(\"\")?ApplicationConsts.JOLLY:vo.getVariant4()) + \"'\");\r\n }\r\n if (sql.indexOf(\":VARIANT_5\") != -1) {\r\n sql = replace(sql, \":VARIANT_5\", \"'\" + (vo.getVariant5()==null || vo.getVariant5().trim().equals(\"\")?ApplicationConsts.JOLLY:vo.getVariant5()) + \"'\");\r\n }\r\n\r\n if (!useDefaultValue)\r\n while((pos=sql.indexOf(\"DEFAULT \"))!=-1) {\r\n defaultValue = sql.substring(pos, sql.indexOf(\",\", pos));\r\n sql = replace(\r\n sql,\r\n defaultValue,\r\n \"\"\r\n );\r\n }\r\n\r\n fkFound = false;\r\n while((pos=sql.indexOf(\"FOREIGN KEY\"))!=-1) {\r\n oldfk = sql.substring(pos,sql.indexOf(\")\",sql.indexOf(\")\",pos)+1)+1);\r\n sql = replace(\r\n sql,\r\n oldfk,\r\n \"\"\r\n );\r\n newfk = new StringBuffer(\"ALTER TABLE \");\r\n newfk.append(sql.substring(sql.indexOf(\" TABLE \")+7,sql.indexOf(\"(\")).trim());\r\n newfk.append(\" ADD \");\r\n newfk.append(oldfk);\r\n fks.add(newfk);\r\n fkFound = true;\r\n }\r\n\r\n if (fkFound)\r\n sql = removeCommasAtEnd(sql);\r\n\r\n indexFound = false;\r\n while((pos=sql.indexOf(\"INDEX \"))!=-1) {\r\n oldIndex = sql.substring(pos,sql.indexOf(\")\",pos)+1);\r\n sql = replace(\r\n sql,\r\n oldIndex,\r\n \"\"\r\n );\r\n newIndex = new StringBuffer(\"CREATE \");\r\n newIndex.append(oldIndex.substring(0,oldIndex.indexOf(\"(\")));\r\n newIndex.append(\" ON \");\r\n newIndex.append(sql.substring(sql.indexOf(\" TABLE \")+7,sql.indexOf(\"(\")).trim());\r\n newIndex.append( oldIndex.substring(oldIndex.indexOf(\"(\")) );\r\n indexes.add(newIndex);\r\n indexFound = true;\r\n }\r\n\r\n if (indexFound)\r\n sql = removeCommasAtEnd(sql);\r\n\r\n // check for unicode chars...\r\n while((index=sql.indexOf(\"\\\\u\"))!=-1) {\r\n for(int i=index+2;i<Math.min(sql.length(),index+2+6);i++)\r\n if (Character.isDigit(sql.charAt(i)) ||\r\n sql.charAt(i)=='A' ||\r\n sql.charAt(i)=='B' ||\r\n sql.charAt(i)=='C' ||\r\n sql.charAt(i)=='D' ||\r\n sql.charAt(i)=='E' ||\r\n sql.charAt(i)=='F')\r\n if (unicode.length() < 4)\r\n unicode.append(sql.charAt(i));\r\n else\r\n break;\r\n if (unicode.length()>0) {\r\n sql.delete(index, index+1+unicode.length());\r\n sql.setCharAt(index, new Character((char)Integer.valueOf(unicode.toString(),16).intValue()).charValue());\r\n unicode.delete(0, unicode.length());\r\n }\r\n }\r\n\r\n\r\n if (sql.toString().toUpperCase().contains(\"DROP TABLE\")) {\r\n // remove fks before dropping table!\r\n String table = sql.toString().toUpperCase().replace('\\n',' ').replace('\\r',' ').trim();\r\n table = table.substring(10).trim();\r\n if (table.endsWith(\";\"))\r\n table = table.substring(0,table.length()-1);\r\n ResultSet rset = conn.getMetaData().getExportedKeys(null,vo.getUsername().toUpperCase(),table);\r\n String fkName = null;\r\n String tName = null;\r\n Statement stmt2 = conn.createStatement();\r\n boolean fksFound = false;\r\n while(rset.next()) {\r\n fksFound = true;\r\n tName = rset.getString(7);\r\n fkName = rset.getString(12);\r\n\r\n if (vo.getDriverName().equals(\"com.mysql.jdbc.Driver\"))\r\n stmt2.execute(\"ALTER TABLE \"+tName+\" DROP FOREIGN KEY \"+fkName);\r\n else\r\n stmt2.execute(\"ALTER TABLE \"+tName+\" DROP CONSTRAINT \"+fkName);\r\n }\r\n try {\r\n rset.close();\r\n }\r\n catch (Exception ex6) {}\r\n\r\n if (!fksFound &&\r\n !vo.getDriverName().equals(\"oracle.jdbc.driver.OracleDriver\") &&\r\n !vo.getDriverName().equals(\"com.microsoft.jdbc.sqlserver.SQLServerDriver\") &&\r\n !vo.getDriverName().equals(\"com.microsoft.sqlserver.jdbc.SQLServerDriver\") &&\r\n !vo.getDriverName().equals(\"com.mysql.jdbc.Driver\")\r\n && !vo.getDriverName().equals(\"org.sqlite.JDBC\")) {\r\n // case postgres...\r\n rset = conn.getMetaData().getExportedKeys(null,null,null);\r\n while(rset.next()) {\r\n if (rset.getString(3).toUpperCase().equals(table)) {\r\n tName = rset.getString(7);\r\n fkName = rset.getString(12);\r\n\r\n if (vo.getDriverName().equals(\"com.mysql.jdbc.Driver\"))\r\n stmt2.execute(\"ALTER TABLE \"+tName+\" DROP FOREIGN KEY \"+fkName);\r\n else\r\n stmt2.execute(\"ALTER TABLE \"+tName+\" DROP CONSTRAINT \"+fkName);\r\n }\r\n }\r\n try {\r\n rset.close();\r\n }\r\n catch (Exception ex6) {}\r\n }\r\n\r\n try {\r\n stmt2.close();\r\n }\r\n catch (Exception ex6) {}\r\n\r\n } // end if\r\n\r\n if (sql.toString().trim().length()>0) {\r\n String query = sql.toString().substring(0,sql.length() - 1);\r\n System.out.println(\"Execute query: \" + query);\r\n pstmt = conn.prepareStatement(query);\r\n for (int i = 0; i < vals.size(); i++) {\r\n pstmt.setObject(i + 1, vals.get(i));\r\n }\r\n\r\n try {\r\n pstmt.execute();\r\n }\r\n catch (SQLException ex4) {\r\n try {\r\n if (sql.toString().toUpperCase().contains(\"DROP TABLE\")) {\r\n//\t\t\t\t\t\t\t\t\tLogger.error(\"NONAME\", this.getClass().getName(), \"executeSQL\",\r\n//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"Invalid SQL: \" + sql, ex4);\r\n }\r\n else\r\n throw ex4;\r\n }\r\n catch (Exception exx4) {\r\n throw ex4;\r\n }\r\n }\r\n pstmt.close();\r\n }\r\n\r\n sql.delete(0, sql.length());\r\n vals.clear();\r\n }\r\n }\r\n br.close();\r\n\r\n for(int i=0;i<fks.size();i++) {\r\n sql = (StringBuffer)fks.get(i);\r\n pstmt = conn.prepareStatement(sql.toString());\r\n try {\r\n pstmt.execute();\r\n }\r\n catch (SQLException ex4) {\r\n Logger.error(\"NONAME\", this.getClass().getName(), \"executeSQL\",\r\n \"Invalid SQL: \" + sql, ex4);\r\n }\r\n pstmt.close();\r\n }\r\n\r\n for(int i=0;i<indexes.size();i++) {\r\n sql = (StringBuffer)indexes.get(i);\r\n pstmt = conn.prepareStatement(sql.toString());\r\n try {\r\n pstmt.execute();\r\n }\r\n catch (SQLException ex3) {\r\n Logger.error(\"NONAME\", this.getClass().getName(), \"executeSQL\",\r\n \"Invalid SQL: \" + sql, ex3);\r\n }\r\n pstmt.close();\r\n }\r\n\r\n conn.commit();\r\n\r\n }\r\n catch (Throwable ex) {\r\n try {\r\n Logger.error(\"NONAME\", this.getClass().getName(), \"executeSQL\",\r\n \"Invalid SQL: \" + sql, ex);\r\n }\r\n catch (Exception ex2) {\r\n }\r\n throw ex;\r\n }\r\n finally {\r\n try {\r\n if (pstmt!=null)\r\n pstmt.close();\r\n }\r\n catch (SQLException ex1) {\r\n }\r\n }\r\n }", "public DaoFileImpl(String path) {\r\n\t\tgson = new Gson();\r\n\t\tthis.path = path;\r\n\t\tthis.daoMap = new HashMap<>();\r\n\t\treadMapFromFile();\r\n\t}", "private void createDbRecords() throws IOException, JAXBException {\n }", "public DbRecord( String szFileName )\n throws FileNotFoundException, NullPointerException, AppException\n {\n Load( szFileName );\n }", "public interface IFileDao extends CrudDao<IFileEntity, IFileDto, Long> {\n\n IFileEntity createFile();\n\n Long saveFileUsingStream(IFileEntity fileEntity, InputStream inputStream) throws Exception;\n\n void writeFileContent(Long fileId, OutputStream outputStream) throws Exception;\n}", "public interface IFileDataTypeReader {\n\t\n\t Map<String, String> getColumnAndDataType(String fileName, ExtendedDetails dbDetails) throws ZeasException;\n\t\n\t List<List<String>> getColumnValues() throws ZeasException;\n}", "public void toSql(String baseDir, String out) throws IOException {\n Path pBase = Paths.get(baseDir);\n final String format = \"insert into files values(null,'%s','%s');\";\n List<String> files = new ArrayList<>();\n Files.walkFileTree(pBase, new SimpleFileVisitor<Path>() {\n @Override\n public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {\n String fileName = file.getFileName().toString();\n String path = file.toAbsolutePath().toString();\n if (filter(path) || filter(fileName)) {\n return FileVisitResult.CONTINUE;\n }\n if (fileName.length() > 128 || path.length() > 8096) {\n System.out.println(String.format(\"warning : %s %s exced the limit\", fileName, path));\n }\n\n\n String insert = String.format(format, fileName, path);\n files.add(insert);\n if (files.size() >= 10240) {\n write2File(out, files);\n files.clear();\n }\n return FileVisitResult.CONTINUE;\n }\n });\n write2File(out, files);\n }", "String getSchemaFile();", "public interface IWritableDatabase2 {\r\n\r\n\t/**\r\n\t * Add database links between tokens found a file, and the file path itself. \r\n\t * \r\n\t * @param strings A unique list of valid white-space separated tokens contained within a file\r\n\t * @param f The file containing the tokens\r\n\t * @param ignoreCase Whether to ignore the case of the tokens (always false?)\t * \r\n\t * @param debug Currently unused debug id\r\n\t */\r\n\tpublic void addBulkLinks(List<String> strings, boolean ignoreCase, File f, int debug);\t\t\r\n\r\n\t/** Once complete, write to the database. */\r\n\tpublic void writeDatabase();\r\n}", "public DataBase(String file) throws IOException {\n\t\tdataBase = new RandomAccessFile(file, \"rw\");\n\t\tdataBase.writeBytes(\"FEATURE_ID|FEATURE_NAME|FEATURE_CLASS|STATE_ALPHA|\"\n\t\t\t\t+ \"STATE_NUMERIC|COUNTY_NAME|COUNTY_NUMERIC|PRIMARY_LAT_DMS|PRIM_LONG_DMS|\"\n\t\t\t\t+ \"PRIM_LAT_DEC|PRIM_LONG_DEC|SOURCE_LAT_DMS|SOURCE_LONG_DMS|SOURCE_LAT_DEC|\"\n\t\t\t\t+ \"SOURCE_LONG_DEC|ELEV_IN_M|ELEV_IN_FT|MAP_NAME|DATE_CREATED|DATE_EDITED\\n\");\n\t}", "@Override\n\tpublic void onCreate(SQLiteDatabase db) {\n\t\tStringBuffer sb = new StringBuffer(\"create table fileinfo ( \");\n\t\tsb.append(\"id integer primary key autoincrement , \");\n\t\tsb.append(\"name varchar(20) , \");\n\t\tsb.append(\"fileurl varchar(60) ,\");\n\t\tsb.append(\"path varchar(60) , \");\n\t\tsb.append(\"size varchar(30) , \");\n\t\tsb.append(\"time varchar(30)\");\n\t\tsb.append(\")\");\n\t\ttry {\n\t\t\tdb.execSQL(sb.toString());\n\t\t\tLog.d(\"TAG\", \"创建数据库表成功\");\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t}", "public interface DBStructure {\n\n String save(DataSource dataSource);\n\n void update(DataSource dataSource, String fileMask) throws UpdateException;\n\n void dropAll(DataSource dataSource) throws DropAllException;\n\n String getSqlScript(DataSource dataSource);\n\n void unlock(DataSource dataSource);\n}", "public abstract String createDBString();", "public void run() throws DatabaseException, FileNotFoundException {\n new File(FileName).delete();\n\n // Create the database object.\n // There is no environment for this simple example.\n DatabaseConfig config = new DatabaseConfig();\n config.setErrorStream(System.err);\n config.setErrorPrefix(\"BulkAccessExample\");\n config.setType(DatabaseType.BTREE);\n config.setAllowCreate(true);\n config.setMode(0644);\n Database table = new Database(FileName, null, config);\n\n //\n // Insert records into the database, where the key is the user\n // input and the data is the user input in reverse order.\n //\n InputStreamReader reader = new InputStreamReader(System.in);\n\n for (;;) {\n String line = askForLine(reader, System.out, \"input> \");\n if (line == null || (line.compareToIgnoreCase(\"end\") == 0))\n break;\n\n String reversed = (new StringBuffer(line)).reverse().toString();\n\n // See definition of StringEntry below\n //\n StringEntry key = new StringEntry(line);\n StringEntry data = new StringEntry(reversed);\n\n try {\n if (table.putNoOverwrite(null, key, data) == OperationStatus.KEYEXIST)\n System.out.println(\"Key \" + line + \" already exists.\");\n } catch (DatabaseException dbe) {\n System.out.println(dbe.toString());\n }\n System.out.println(\"\");\n }\n\n // Acquire a cursor for the table.\n Cursor cursor = table.openCursor(null, null);\n DatabaseEntry foo = new DatabaseEntry();\n\n MultipleKeyDataEntry bulk_data = new MultipleKeyDataEntry();\n bulk_data.setData(new byte[1024 * 1024]);\n bulk_data.setUserBuffer(1024 * 1024, true);\n\n // Walk through the table, printing the key/data pairs.\n //\n while (cursor.getNext(foo, bulk_data, null) == OperationStatus.SUCCESS) {\n StringEntry key, data;\n key = new StringEntry();\n data = new StringEntry();\n\n while (bulk_data.next(key, data))\n System.out.println(key.getString() + \" : \" + data.getString());\n }\n cursor.close();\n table.close();\n }", "public abstract void loadFromDatabase();", "public String getDbTable() {return dbTable;}", "public void putFile(Connection conn, File cond) throws Exception{\n\t//System.out.println(cond);\n\t//Check for LFN\n\tString LFN = cond.getLogicalFileName ( );\n\tif(LFN == null || LFN==\"\") throw new DBSException(\"Input Data Error\", \"LogicalFileName is expected.\");\n\t//Check is_file_valid\n\tint fileValid = cond.getIsFileValid( );\n if(fileValid == -1) throw new DBSException(\"Input Data Error\", \"Validation of File is expected.\");\n\t//Check if Datset already in db\n\tDataset ds = cond.getDatasetDO();\n\t//System.out.println(ds);\n\tif(ds == null)throw new DBSException(\"Input Data Error\", \"Dataset is expected.\");\n\tif(ds.getDatasetID( ) == 0){\n\t String dsName = ds.getDataset();\n\t if((dsName == null) || (dsName==\"\"))throw new DBSException(\"Input Data Error\", \"Dataset name is missing\");\n\t JSONArray dss = (new DatasetQO()).listDatasets(conn, ds);\n\t if(dss.length() != 1)\n\t\tthrow new DBSException(\"Input Data Error\", \"dataset name :\" + dsName \n\t\t+\" is not found or more than one found in the db.\");\n\t else{ \n\t\tds.setDatasetID(((Dataset)dss.getJSONObject(0)).getDatasetID());\n\t\t//ds.setDataset(((Dataset)dss.getJSONObject(0)).getDataset());\n\t }\n\t}\n //System.out.println(cond);\n\tBlock bk = cond.getBlockDO();\n\tif(bk == null) throw new DBSException(\"Input Data Error\", \"Block is expected.\");\n\tif(bk.getBlockID() == 0){\n\t String bkName = bk.getBlockName();\n\t if(bkName == null || bkName == \"\")throw new DBSException(\"Input Data Error\", \"Block name is missing\");\n\t JSONArray bks = (new BlockQO()).listBlocks(conn, bk);\n\t if(bks.length() != 1 )\n\t\tthrow new DBSException(\"Input Data Error\", \"More than one or no Blocks are found in the db with name: \"\n\t\t + bkName);\n\t else {\n\t\tbk.setBlockID(((Block)bks.getJSONObject(0)).getBlockID());\n\t\t//System.out.println(\"Block : \" + bk);\n\t }\n\t}\n\t//\n\t//System.out.println(\"Check for file_type\");\n\tFileType ft = cond.getFileTypeDO();\n if(ft == null)throw new DBSException(\"Input Data Error\", \"File type is expected.\");\n if(ft.getFileTypeID( ) == 0){\n String ftName = ft.getFileType();\n if((ftName == null) || (ftName == \"\"))throw new DBSException(\"Input Data Error\", \"File type is missing\");\n JSONArray fts = (new FileTypeQO()).listFileTypes(conn, ft);\n if(fts.length() != 1)\n throw new DBSException(\"Input Data Error\", \"File type :\" + ftName\n +\" is not found or more than one found in the db.\");\n else\n ft.setFileTypeID(((FileType)fts.getJSONObject(0)).getFileTypeID());\n }\n\t//System.out.println(\"File type: \" + ft);\n\t//check for Primary key\n\tint fileID = cond.getFileID ( );\n\tif(fileID == 0){\n\t try{\n\t\tfileID = SequenceManager.getSequence(conn, \"SEQ_FL\");\n\t\tcond. setFileID(fileID);\n\t }catch (SQLException ex) {\n\t\tthrow ex;\n\t }\n\t}\n\t//\n\t//System.out.println(\"Check for check-sum\");\n\tString cs = cond.getCheckSum();\n if(cs == null || cs == \"\")throw new DBSException(\"Input Data Error\", \"File check-sum is expected.\");\n\t//check for event_count\n\tif (cond.getEventCount() == -1) throw new DBSException(\"Input Data Error\", \"File event count is expected.\");\n\t//check for file size\n\tif(cond.getFileSize() == -1) throw new DBSException(\"Input Data Error\", \"File size is expected.\");\n\t//System.out.println(\"Check for creation_date and created_by. \\n\");\n\tlong createDate = cond.getCreationDate( );\n\tString createdBy = cond.getCreateBy( );\n\t//System.out.println(\"****File**** \" + cond);\n\tif(createDate == 0)cond.setCreationDate(DBSSrvcUtil.getEpoch());\n if(createdBy == null || createdBy==\"\")cond.setCreateBy(\"WeNeed2FindWhoDidIt\");\n\t \t\n\t//Now we are ready to insert into the dataset\n\t//System.out.println(\"Ready to insert file :\" + cond);\n\tinsertTable(conn, cond, \"FILES\");\n }", "public int getDbType();", "int insert(DiaryFile record);", "@Repository\npublic interface DBFileRepository extends JpaRepository<DBFile, Long> {\n\n}", "public DataWriter(String dbPath) {\n databasePath = dbPath;\n }", "public DB(String db) throws ClassNotFoundException, SQLException {\n // Set up a connection and store it in a field\n Class.forName(\"org.sqlite.JDBC\");\n String url = \"jdbc:sqlite:\" + db;\n\n // stop conn from creating a file if does not exists\n SQLiteConfig config = new SQLiteConfig();\n config.resetOpenMode(SQLiteOpenMode.CREATE);\n\n //connect to the file\n conn = DriverManager.getConnection(url, config.toProperties());\n try (Statement stat = conn.createStatement();) {\n stat.executeUpdate(\"PRAGMA foreign_keys = ON;\");\n }\n }", "public Dataset openTDB(String directory){\n Dataset dataset = TDBFactory.createDataset(directory);\n return dataset;\n}", "public ProjectFilesDAOImpl() {\r\n super();\r\n }", "int insert(FileRecordAdmin record);", "public static boolean addFile(TranslationFile bf) {\n System.out.println(\"File added to database.\");\n DatabaseOperations.addOrUpdateFileName(bf.getFileID(), bf.getFileName());\n String sql = \"INSERT OR REPLACE INTO corpus1(id, fileID, fileName, thai, english, committed, removed, rank) VALUES(?,?,?,?,?,?,?,?)\";\n\n try (Connection conn = DatabaseOperations.connect();\n PreparedStatement pstmt = conn.prepareStatement(sql)) {\n\n conn.setAutoCommit(false);\n\n // this makes sure that the segments in the file, when retrieved from the db, can be ordered in the proper order.\n // simply increments by 1 on each segment. \n int rank = 0;\n // keeps count of the number of segs added so that the SQL can run a batch transaction (which is much more efficient than individual transactions).\n // when i=1000, or at the last segment, the SQL is then run as one batch transaction.\n int i = 0;\n\n for (Segment seg : bf.getActiveSegs()) {\n\n pstmt.setDouble(1, seg.getID());\n pstmt.setDouble(2, seg.getFileID());\n pstmt.setString(3, seg.getFileName());\n pstmt.setString(4, seg.getThai());\n pstmt.setString(5, seg.getEnglish());\n // committed/removed booleans are stored as binary (0 = false, 1 = true)\n pstmt.setInt(6, seg.isCommitted() ? 1 : 0);\n // removed is set to \"false\"\n pstmt.setInt(7, 0);\n pstmt.setInt(8, rank);\n pstmt.addBatch();\n rank++;\n i++;\n\n if (i % 1000 == 0 || i == bf.getActiveSegs().size()) {\n pstmt.executeBatch(); //Execute every 1000 segments.\n }\n }\n\n // resetting counters\n i = 0;\n rank = 0;\n for (Segment seg : bf.getHiddenSegs()) {\n\n pstmt.setDouble(1, seg.getID());\n pstmt.setDouble(2, seg.getFileID());\n pstmt.setString(3, seg.getFileName());\n pstmt.setString(4, seg.getThai());\n pstmt.setString(5, seg.getEnglish());\n // committed/removed booleans are stored as binary (0 = false, 1 = true)\n pstmt.setInt(6, seg.isCommitted() ? 1 : 0);\n // removed is set to \"true\"\n pstmt.setInt(7, 1);\n pstmt.setInt(8, rank);\n pstmt.addBatch();\n rank++;\n i++;\n\n if (i % 1000 == 0 || i == bf.getHiddenSegs().size()) {\n pstmt.executeBatch(); //Execute every 1000 segments.\n }\n }\n conn.commit();\n return true;\n\n } catch (SQLException e) {\n System.out.println(\"AddFileAsBatch: \" + e.getMessage());\n return false;\n }\n }", "public void writeDatabase();", "public long insert(FFileInputDO FFileInput) throws DataAccessException;", "private TexeraDb() {\n super(\"texera_db\", null);\n }", "private static void readDatabase(String path) {\n try {\n FileInputStream fileIn = new FileInputStream(path + \"/database.ser\");\n ObjectInputStream inStream = new ObjectInputStream(fileIn);\n database = (Database) inStream.readObject();\n inStream.close();\n fileIn.close();\n } catch (IOException i) {\n i.printStackTrace();\n } catch (ClassNotFoundException c) {\n c.printStackTrace();\n }\n }", "public DBFWriter(File dbfFile) throws Exception {\r\n\r\n\t\ttry {\r\n\r\n\t\t\tthis.raf = new RandomAccessFile(dbfFile, \"rw\");\r\n\t\t\tFileChannel fileChannel = this.raf.getChannel();\r\n\t\t\twhile (true) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tlock = fileChannel.lock();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} catch (OverlappingFileLockException e) {\r\n\t\t\t\t\tThread.sleep(2);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tthrow new Exception(e.getMessage());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t/*\r\n\t\t\t * before proceeding check whether the passed in File object is an\r\n\t\t\t * empty/non-existent file or not.\r\n\t\t\t */\r\n\t\t\tif (!dbfFile.exists() || dbfFile.length() == 0) {\r\n\t\t\t\tthis.header = new DBFHeader();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\theader = new DBFHeader();\r\n\t\t\tthis.header.read(raf);\r\n\r\n\t\t\t// back 5 char\r\n\t\t\tthis.raf.seek(this.raf.length() - 10);\r\n\t\t\tlong logEofIndex = 0;\r\n\t\t\twhile (true) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\t// the end byte 26\r\n\t\t\t\t\tif (this.raf.readByte() == 26) {\r\n\t\t\t\t\t\tlogEofIndex = this.raf.getFilePointer();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (EOFException ioe) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (logEofIndex == 0) {\r\n\t\t\t\tlogEofIndex = this.raf.length();\r\n\t\t\t} else {\r\n\t\t\t\tlogEofIndex--;\r\n\t\t\t}\r\n\t\t\t/* position file pointer at the end of the raf */\r\n\t\t\tthis.raf.seek(logEofIndex);\r\n\t\t\t// this.raf.seek( this.raf.length()-1 /* to ignore the END_OF_DATA\r\n\t\t\t// byte at EoF */);\r\n\r\n\t\t} catch (FileNotFoundException e) {\r\n\r\n\t\t\tthrow new DBFException(\"Specified file is not found. \" + e.getMessage());\r\n\t\t} catch (IOException e) {\r\n\r\n\t\t\tthrow new DBFException(e.getMessage() + \" while reading header\");\r\n\t\t}\r\n\t\tthis.recordCount = this.header.numberOfRecords;\r\n\t}", "public String getDbpediaFile() {\n\t\treturn DBPEDIA_FILE;\n\t}", "public SimpleDatabase executeSqlFile(SQLiteDatabase db, @RawRes int id) {\n Scanner scan = context.openInternalFileScanner(id);\n String query = \"\";\n if (logging) Log.d(\"SimpleDB\", \"start reading file\");\n int queryCount = 0;\n while (scan.hasNextLine()) {\n String line = scan.nextLine().trim();\n if (line.startsWith(\"--\") || line.isEmpty()) {\n continue;\n } else {\n query += line + \"\\n\";\n }\n\n if (query.endsWith(\";\\n\")) {\n if (logging) Log.d(\"SimpleDB\", \"query: \\\"\" + query + \"\\\"\");\n db.execSQL(query);\n query = \"\";\n queryCount++;\n }\n }\n if (logging) Log.d(\"SimpleDB\", \"done reading file\");\n if (logging) Log.d(\"SimpleDB\", \"performed \" + queryCount + \" queries.\");\n return this;\n }", "@Override\n public String getDbString() {\n return null;\n }", "public interface DbIterator {\n /**\n * Opens the iterator.\n * @throws NoSuchElementException when the iterator has no elements.\n * @throws DbException when there are problems opening/accessing the database.\n */\n public void open() throws NoSuchElementException, DbException, TransactionAbortedException;\n\n /**\n * Gets the next tuple from the operator (typically implementing by reading\n * from a child operator or an access method).\n *\n * @return The next tuple in the iterator.\n */\n public Tuple getNext() throws TransactionAbortedException;\n\n /**\n * Resets the iterator to the start.\n * @throws DbException When rewind is unsupported.\n */\n public void rewind() throws DbException, TransactionAbortedException;\n\n /**\n * Returns the TupleDesc associated with this DbIterator.\n */\n public TupleDesc getTupleDesc();\n\n /**\n * Closes the iterator.\n */\n public void close();\n}", "public boolean writePlicSnapshotToFile(File f, String dbSchema, String dataSource){\n try{\n //Obtener la conexion JDBC del proyecto\n InitialContext ctx = new InitialContext();\n DataSource ds = (DataSource) ctx.lookup(dataSource);\n Connection connection = ds.getConnection();\n\n\t String query = \"SELECT '\\\"'||REPLACE(COALESCE(globaluniqueidentifier,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(scientificname,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(institutioncode,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||COALESCE(to_char(datelastmodified,'YYYY-MM-DD HH24:MI:SS'),'')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(taxonrecordid,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(language,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(creators,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(distribution,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(abstract,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(kingdomtaxon,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(phylumtaxon,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(classtaxon,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(ordertaxon,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(familytaxon,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(genustaxon,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(synonyms,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(authoryearofscientificname,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(speciespublicationreference,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(commonnames,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(typification,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(contributors,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||COALESCE(to_char(datecreated,'YYYY-MM-DD'),'')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(habit,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(lifecycle,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(reproduction,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(annualcycle,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(scientificdescription,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(briefdescription,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(feeding,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(behavior,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(interactions,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(chromosomicnumbern,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(moleculardata,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(populationbiology,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(threatstatus,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(legislation,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(habitat,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(territory,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(endemicity,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(theuses,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(themanagement,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(folklore,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(thereferences,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(unstructureddocumentation,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(otherinformationsources,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(papers,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(identificationkeys,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(migratorydata,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(ecologicalsignificance,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(unstructurednaturalhistory,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(invasivenessdata,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(targetaudiences,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(version,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(urlimage1,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(captionimage1,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(urlimage2,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(captionimage2,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(urlimage3,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(captionimage3,''),'\\r\\n', ' ')||'\\\"'\"+\n\t\t\t \" AS aux \"+\n\t\t\t \"FROM \"+dbSchema+\".plic_snapshot;\";\n\n System.out.println(query);\n\n\t\t\tStatement st = connection.createStatement();\n\t\t\tResultSet rs = st.executeQuery(query); \n\n //Imprimir los datos en el archivo\n BufferedWriter out = new BufferedWriter(new FileWriter(f));\n\t\t\twhile (rs.next()) {\n\t\t\t\tout.write(rs.getString(\"aux\")+\"\\n\");\n\t\t\t}\n out.close();\n\n //Cerrar el resultset y el statement\n rs.close();\n\t\t\tst.close();\n\n //Resultado\n return true;\n }\n catch(Exception e){\n e.printStackTrace();\n return false;}\n }", "public interface FilesDAO extends CrudRepository<Files,Long> {\n}", "@Override\r\n\tpublic boolean supportsDb(String type) {\r\n \treturn true;\r\n }", "@SuppressWarnings(\"rawtypes\") \npublic interface FFileInputDAO {\n\t/**\n\t * Insert one <tt>FFileInputDO</tt> object to DB table <tt>f_file_input</tt>, return primary key\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>insert into f_file_input(file_id,file_code,type,form_id,project_code,project_name,customer_id,customer_name,first_loan_time,filing_time,hand_over_dept,hand_over_man,hand_over_time,principal_man,vice_manager,receive_dept,receive_man,receive_time,status,raw_add_time) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)</tt>\n\t *\n\t *\t@param FFileInput\n\t *\t@return long\n\t *\t@throws DataAccessException\n\t */\t \n public long insert(FFileInputDO FFileInput) throws DataAccessException;\n\n\t/**\n\t * Update DB table <tt>f_file_input</tt>.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>update f_file_input set first_loan_time=?, filing_time=?, hand_over_dept=?, hand_over_man=?, hand_over_time=?, principal_man=?, vice_manager=?, receive_dept=?, receive_man=?, receive_time=?, status=? where (input_id = ?)</tt>\n\t *\n\t *\t@param FFileInput\n\t *\t@return int\n\t *\t@throws DataAccessException\n\t */\t \n public int update(FFileInputDO FFileInput) throws DataAccessException;\n\n\t/**\n\t * Query DB table <tt>f_file_input</tt> for records.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>select * from f_file_input where (input_id = ?)</tt>\n\t *\n\t *\t@param inputId\n\t *\t@return FFileInputDO\n\t *\t@throws DataAccessException\n\t */\t \n public FFileInputDO findById(long inputId) throws DataAccessException;\n\n\t/**\n\t * Query DB table <tt>f_file_input</tt> for records.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>select * from f_file_input where (form_id = ?)</tt>\n\t *\n\t *\t@param formId\n\t *\t@return List<FFileInputDO>\n\t *\t@throws DataAccessException\n\t */\t \n public List<FFileInputDO> findByFormId(long formId) throws DataAccessException;\n\n\t/**\n\t * Delete records from DB table <tt>f_file_input</tt>.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>delete from f_file_input where (input_id = ?)</tt>\n\t *\n\t *\t@param inputId\n\t *\t@return int\n\t *\t@throws DataAccessException\n\t */\t \n public int deleteById(long inputId) throws DataAccessException;\n\n\t/**\n\t * Query DB table <tt>f_file_input</tt> for records.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>select * from f_file_input where (1 = 1)</tt>\n\t *\n\t *\t@param FFileInput\n\t *\t@param limitStart\n\t *\t@param pageSize\n\t *\t@return List<FFileInputDO>\n\t *\t@throws DataAccessException\n\t */\t \n public List<FFileInputDO> findByCondition(FFileInputDO FFileInput, long limitStart, long pageSize) throws DataAccessException;\n\n\t/**\n\t * Query DB table <tt>f_file_input</tt> for records.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>select COUNT(*) from f_file_input where (1 = 1)</tt>\n\t *\n\t *\t@param FFileInput\n\t *\t@return long\n\t *\t@throws DataAccessException\n\t */\t \n public long findByConditionCount(FFileInputDO FFileInput) throws DataAccessException;\n\n}", "private static void loadTableData() {\n\n\t\tBufferedReader in = null;\n\t\ttry {\n\t\t\tin = new BufferedReader(new FileReader(dataDir + tableInfoFile));\n\n\t\t\twhile (true) {\n\n\t\t\t\t// read next line\n\t\t\t\tString line = in.readLine();\n\t\t\t\tif (line == null) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tString[] tokens = line.split(\" \");\n\t\t\t\tString tableName = tokens[0];\n\t\t\t\tString tableFileName = tokens[1];\n\n\t\t\t\ttableNameToSchema.put(tableName, new HashMap<String, Type>());\n\t\t\t\ttableNameToOrdredSchema.put(tableName,\n\t\t\t\t\t\tnew ArrayList<ColumnInfo>());\n\n\t\t\t\t// attributes data\n\t\t\t\tfor (int i = 2; i < tokens.length;) {\n\n\t\t\t\t\tString attName = tokens[i++];\n\t\t\t\t\tString attTypeName = (tokens[i++]);\n\n\t\t\t\t\tType attType = null;\n\n\t\t\t\t\t/*\n\t\t\t\t\t * Undefined, how to represent dates, crazy longs probably\n\t\t\t\t\t * won't need this for now...\n\t\t\t\t\t */\n\t\t\t\t\tif (attTypeName.equals(\"CHAR\")) {\n\t\t\t\t\t\tattType = Types.getCharType(Integer\n\t\t\t\t\t\t\t\t.valueOf(tokens[i++]));\n\t\t\t\t\t} else if (attTypeName.equals(\"DATE\")) {\n\t\t\t\t\t\tattType = Types.getDateType();\n\t\t\t\t\t} else if (attTypeName.equals(\"DOUBLE\")) {\n\t\t\t\t\t\tattType = Types.getDoubleType();\n\t\t\t\t\t} else if (attTypeName.equals(\"FLOAT\")) {\n\t\t\t\t\t\tattType = Types.getFloatType();\n\t\t\t\t\t} else if (attTypeName.equals(\"INTEGER\")) {\n\t\t\t\t\t\tattType = Types.getIntegerType();\n\t\t\t\t\t} else if (attTypeName.equals(\"LONG\")) {\n\t\t\t\t\t\tattType = Types.getLongType();\n\t\t\t\t\t} else if (attTypeName.equals(\"VARCHAR\")) {\n\t\t\t\t\t\tattType = Types.getVarcharType();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new RuntimeException(\"Invalid type: \"\n\t\t\t\t\t\t\t\t+ attTypeName);\n\t\t\t\t\t}\n\n\t\t\t\t\ttableNameToSchema.get(tableName).put(attName, attType);\n\n\t\t\t\t\tColumnInfo ci = new ColumnInfo(attName, attType);\n\t\t\t\t\ttableNameToOrdredSchema.get(tableName).add(ci);\n\n\t\t\t\t}\n\n\t\t\t\t// at this point, table info loaded.\n\n\t\t\t\t// Create table\n\t\t\t\tmyDatabase.getQueryInterface().createTable(tableName,\n\t\t\t\t\t\ttableNameToSchema.get(tableName));\n\n\t\t\t\t// Now, load data into newly created table\n\t\t\t\treadTable(tableName, tableFileName);\n\n\t\t\t}\n\n\t\t\tin.close();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tHelpers.print(e.getStackTrace().toString(),\n\t\t\t\t\tutil.Consts.printType.ERROR);\n\t\t}\n\n\t}", "CCDB2IndexFile(CCDB2Driver driver, File filePath) throws IOException\r\n\t{\r\n\t\tfFilePath = filePath;\r\n\t\tfFile = new CCDB2File(driver, fFilePath.getPath(), NULL_BYTE);\r\n\t}", "@Override\n\tpublic void createFile(FileModel file) {\n\t\tString sql = \"INSERT INTO file VALUES (?,?,?,?,?,?,now(),now())\";\n\t\t\n\t\tthis.getJdbcTemplate().update(sql, new Object[] { \n\t\t\t\tfile.getFile_id(),\n\t\t\t\tfile.getFile_path(),\n\t\t\t\tfile.getFile_name(),\n\t\t\t\tfile.getFile_type(),\n\t\t\t\tfile.getFile_size(),\n\t\t\t\tfile.getCretd_usr()\n\t\t});\n\t}", "public String getDbPath() {\r\n return dbPath;\r\n }", "public interface BerkeleydbDao<T> {\n\n /**\n * open database\n * */\n public void openConnection(String filePath, String databaseName) throws DatabaseException;\n\n /**\n * 关闭数据库\n * */\n public void closeConnection() throws DatabaseException;\n\n /**\n * insert\n * */\n public void save(String name, T t) throws DatabaseException;\n\n /**\n * delete\n * */\n public void delete(String name) throws DatabaseException;\n\n /**\n * update\n * */\n public void update(String name, T t) throws DatabaseException;\n\n /**\n * select\n * */\n public T get(String name) throws DatabaseException;\n\n}", "DatabaseInformationFull(Database db) {\n super(db);\n }", "public DbFileIterator iterator(final TransactionId tid) { \t\n// some code goes here\n \t\n \tDbFileIterator dbfi = new DbFileIterator() {\n \tint pgno = 0;\n \tHeapPage currPg = null;\n \tString name = Database.getCatalog().getTableName(getId());\n \tint tblid = Database.getCatalog().getTableId(name);\n \tint open = 0; \t\n \t\n \t//Todo: pass along the tid from the outer method.\n \t//DONE. by making tid param final.\n \tTransactionId m_tid = tid;\n \t\n \tIterator<Tuple> titr = null;\n \t\n\t\t\t@Override\n\t\t\tpublic void rewind() throws DbException, TransactionAbortedException {\n\t\t\t\tclose();\n\t\t\t\topen();\n\t\t\t}\n\t\t\t\n\t\t\tpublic void nextPage() throws DbException, TransactionAbortedException {\n\n\t\t\t\tif (pgno >= numPages())\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tcurrPg = (HeapPage) Database.getBufferPool().getPage(m_tid, new HeapPageId(tblid, pgno), simpledb.Permissions.READ_ONLY);\n\t\t\t\t\ttitr = currPg.iterator();\n\t\t\t\t\tif (titr == null)\n\t\t\t\t\t\tthrow new DbException(\"blah blah blah\");\n\t\t\t\t\tpgno++;\n\t\t\t\t\treturn;\n\t\t\t\t} catch (DbException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tthrow new DbException(\"page was not found or no more iterators..?\");\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void open() throws DbException, TransactionAbortedException {\n\t\t\t\topen = 1;\n\t\t\t\tpgno = 0;\n\t\t\t\tnextPage();\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic Tuple next() throws DbException, TransactionAbortedException,\n\t\t\t\t\tNoSuchElementException {\n\t\t\t\tif (open != 1)\n\t\t\t\t\tthrow new NoSuchElementException();\n\t\t\t\tif (!titr.hasNext())\n\t\t\t\t\tnextPage();\n\t\t\t\treturn titr.next();\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic boolean hasNext() throws DbException, TransactionAbortedException {\n\t\t\t\tif (open !=1)\n\t\t\t\t\treturn false;\n\t\t\t\tif (titr == null) //TODO: remove\n\t\t\t\t\tthrow new DbException(Integer.toString(pgno) + Integer.toString(open) + Integer.toString(numPages()) + m_f.getPath());\n\t\t\t\tif (!titr.hasNext())\n\t\t\t\t\tnextPage();\n\t\t\t\tif (titr.hasNext())\n\t\t\t\t\treturn true;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void close() {\n\t\t\t\topen = 0;\n\t\t\t\ttitr = null;\n\t\t\t}\n\t\t};\n return dbfi;\n }", "public NameSurferDataBase(String filename) {\t\n\t\tnameData(filename);\n\t}", "@Test(timeout = 4000)\n public void test112() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable(\"O\\\"6T\");\n File file0 = MockFile.createTempFile(\"<*kYz\", \"BLOB\");\n MockPrintWriter mockPrintWriter0 = new MockPrintWriter(file0);\n NameSpec nameSpec0 = NameSpec.ALWAYS;\n SQLUtil.renderCreateTable(defaultDBTable0, true, nameSpec0, mockPrintWriter0);\n assertNull(defaultDBTable0.getDoc());\n }", "public void init() {\r\n BufferedReader in = null;\r\n String line;\r\n PreparedStatement iStmt;\r\n String insertStmt = \"INSERT INTO \" + schema + \"ULDSHAPE \"\r\n + \"(SHAPE, ALLHGHT, ALLLENG, ALLWDTH, BIGPIC, DESCR, INTERNALVOLUME, INTHGHT, INTLENG, INTWDTH, \"\r\n + \"MAXGROSSWGHT, RATING, TAREWGHT, THUMBNAIL, UPDATED, UPDTUSER, VERSION) VALUES \"\r\n + \"(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\";\r\n int count = 0;\r\n\r\n LOG.log(Level.INFO, \"Initialize basic Uldshapes in DB from file [{0}]\", path);\r\n\r\n try {\r\n in = new BufferedReader(new InputStreamReader(new FileInputStream(path), StandardCharsets.UTF_8));\r\n\r\n iStmt = conn.prepareStatement(insertStmt);\r\n\r\n while ((line = in.readLine()) != null) {\r\n LOG.finer(line);\r\n\r\n UldshapeVO uldshapeVO = parseUldshape(line);\r\n\r\n iStmt.setString(1, uldshapeVO.getShape());\r\n iStmt.setInt(2, uldshapeVO.getAllhght());\r\n iStmt.setInt(3, uldshapeVO.getAllleng());\r\n iStmt.setInt(4, uldshapeVO.getAllwdth());\r\n iStmt.setBytes(5, uldshapeVO.getBigpic());\r\n iStmt.setString(6, uldshapeVO.getDescr());\r\n iStmt.setInt(7, uldshapeVO.getInternalvolume());\r\n iStmt.setInt(8, uldshapeVO.getInthght());\r\n iStmt.setInt(9, uldshapeVO.getIntleng());\r\n iStmt.setInt(10, uldshapeVO.getIntwdth());\r\n iStmt.setInt(11, uldshapeVO.getMaxgrosswght());\r\n iStmt.setString(12, uldshapeVO.getRating());\r\n iStmt.setInt(13, uldshapeVO.getTarewght());\r\n iStmt.setBytes(14, uldshapeVO.getThumbnail());\r\n iStmt.setTimestamp(15, DbUtil.getCurrentTimeStamp());\r\n iStmt.setString(16, uldshapeVO.getUpdtuser());\r\n iStmt.setLong(17, 0);\r\n\r\n // execute insert SQL stetement\r\n iStmt.executeUpdate();\r\n\r\n ++count;\r\n }\r\n LOG.log(Level.INFO, \"Finished: [{0}] ULDSHAPES loaded\", count);\r\n\r\n DbUtil.cleanupJdbc();\r\n }\r\n catch (IOException ioex) {\r\n LOG.log(Level.SEVERE, \"An IO error occured. The error message is: {0}\", ioex.getMessage());\r\n }\r\n catch (SQLException ex) {\r\n LOG.log(Level.SEVERE, \"An SQL error occured. The error message is: {0}\", ex.getMessage());\r\n }\r\n finally {\r\n if (in != null) {\r\n try {\r\n in.close();\r\n }\r\n catch (IOException e) {\r\n }\r\n }\r\n }\r\n }", "private void loadDatabase()\n\t{\n\t\ttry\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// Check to make sure the Bmod Database is there, if not, try \n\t\t\t\t// downloading from the website.\n\t\t\t\tif(!Files.exists(m_databaseFile))\n\t\t\t\t{\n\t\t\t\t\tFiles.createDirectories(m_databaseFile.getParent());\n\t\t\t\t\n\t\t\t\t\tbyte[] file = ExtensionPoints.readURLAsBytes(\"http://\" + Constants.API_HOST + HSQL_DATABASE_PATH);\n\t\t\t\t\tif(file.length != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tFiles.deleteIfExists(m_databaseFile);\n\t\t\t\t\t\tFiles.write(m_databaseFile, file, StandardOpenOption.CREATE, StandardOpenOption.WRITE);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// make sure we have the proper scriptformat.\n\t\t\t\tsetScriptFormatCorrectly();\n\t\t\t}catch(NullPointerException|IOException ex)\n\t\t\t{\n\t\t\t\tm_logger.error(\"Could not fetch database from web.\", ex);\n\t\t\t}\n\t\t\t\n\t\n\t\t\t\n\t\t\tClass.forName(\"org.hsqldb.jdbcDriver\");\n\t\t\n\t\t\t\n\t\t\tString db = ExtensionPoints.getBmodDirectory(\"database\").toUri().getPath();\n\t\t\tconnection = DriverManager.getConnection(\"jdbc:hsqldb:file:\" + db, \"sa\", \"\");\n\t\t\t\n\t\t\t// Setup Connection\n\t\t\tCSVRecordLoader ldr = new CSVRecordLoader();\n\t\t\n\t\t\t// Load all of the building independent plugins\n\t\t\tfor(Record<?> cp : ldr.getRecordPluginManagers())\n\t\t\t{\n\t\t\t\tm_logger.debug(\"Creating table: \" + cp.getTableName());\n\t\t\t\t// Create a new table\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tgetPreparedStatement(cp.getSQLTableDefn()).execute();\n\t\t\t\t} catch(SQLException ex)\n\t\t\t\t{\n\t\t\t\t\t// Table exists\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tm_logger.debug(\"Doing index:\" + cp.getIndexDefn());\n\t\t\t\t\tif(cp.getIndexDefn() != null)\n\t\t\t\t\t\tgetPreparedStatement(cp.getIndexDefn()).execute();\n\t\t\t\t}catch(SQLException ex)\n\t\t\t\t{\t// index exists\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\n\t\t} catch (Exception ex)\n\t\t{\n\t\t\tex.printStackTrace();\n\t\t\tif(ex instanceof DatabaseIntegrityException)\n\t\t\t\tDatabase.handleCriticalError((DatabaseIntegrityException)ex);\n\t\t\telse\n\t\t\t\tDatabase.handleCriticalError(new DatabaseIntegrityException(ex));\n\t\t}\n\t\t\n\t}", "public static void createNewDatabaseFile(String startPath)\r\n throws ConnectionFailedException, DatabaseException {\r\n boolean databaseCreated;\r\n try {\r\n databaseCreated = database.createNewFile();\r\n if (!databaseCreated) {\r\n throw new IOException(\"Cannot create file\");\r\n }\r\n\r\n URL databaseResource = Objects.requireNonNull(Paths.get(\r\n startPath + \"resources/database/database.sql\").toUri().toURL());\r\n String decodedPath = URLDecoder.decode(databaseResource.getPath(), \"UTF-8\");\r\n\r\n try (BufferedReader in = new BufferedReader(new FileReader(decodedPath))) {\r\n StringBuilder sqlQuery = new StringBuilder();\r\n while (in.ready()) {\r\n sqlQuery.append(in.readLine());\r\n if (sqlQuery.toString().endsWith(\";\")) {\r\n createBasicSqlTable(sqlQuery.toString());\r\n sqlQuery = new StringBuilder();\r\n }\r\n }\r\n }\r\n } catch (IOException e) {\r\n throwException(e);\r\n }\r\n }", "private String getDatabaseFilePath(NotesDatabase db) {\n try {\n return db.getFilePath();\n } catch (RepositoryException ex) {\n LOGGER.log(Level.WARNING, \"Unable to retrieve database's file path\", ex);\n return null;\n }\n }", "public Table readTable(String pathName, String filename){\n File file = new File(pathName + filename);\n Table newTable = null;\n Scanner sc; \n //foreign key aspects\n Boolean hasForeignKey = false;\n ArrayList<String> FKIndex; \n String[] line; \n String primaryTableName = \"\", primaryColName = \"\", colName = \"\"; \n String name = \"\";\n\n try {\n sc = new Scanner(file);\n } catch(FileNotFoundException ex) {\n System.out.println(\"ERROR: file not found\");\n return null;\n }\n\n //get table name - always first line\n if (sc.hasNextLine()){\n name = sc.nextLine();\n }\n\n FKIndex = getForeignKeyIndex(pathName);\n //loop over all rows in FKIndex, and check if table has a foreign key\n if(!FKIndex.isEmpty()){\n for(int i = 0; i < FKIndex.size(); i++){\n line = FKIndex.get(i).split(\"\\\\s\"); \n if (line[2].equals(name)){\n hasForeignKey = true;\n primaryTableName = line[0];\n primaryColName = line[1];\n colName = line[3];\n }\n }\n }\n\n //get col names - always second line\n if (sc.hasNextLine()){\n String colNamesString = sc.nextLine();\n //split colNames into individual words as Strings based on whitespace\n String[] colNames = colNamesString.split(\"\\\\s\");\n\n //make table with column names\n if (hasForeignKey){\n newTable = new Table(name, primaryTableName, primaryColName, colName, true, colNames);\n } else {\n newTable = new Table(name, colNames);\n }\n\n //add rows from file (each line)\n while(sc.hasNextLine()){\n String newRowString = sc.nextLine();\n String[] newRow = newRowString.split(\"\\\\s\");\n newTable.addRow(newRow);\n }\n }\n\n sc.close();\n return newTable;\n }", "private void createFileTableIndexes() throws Exception {\n \t\tdbManager\n \t\t\t\t.executeUpdate(\"create index FILE_ID_INDEX_FILE on FILE(FILE_ID)\");\n \t\tdbManager\n \t\t\t\t.executeUpdate(\"create index START_REVISION_ID_INDEX_FILE on FILE(START_REVISION_ID)\");\n \t\tdbManager\n \t\t\t\t.executeUpdate(\"create index END_REVISION_ID_INDEX_FILE on FILE(END_REVISION_ID)\");\n \t}", "public interface FileDataDao\r\n{\r\n\tpublic FileData uploadFile(UploadFileData ufd,int applicationId, String fileLocation,String rootLocation) throws FileAlreadyExistsException;\r\n\tpublic List<FileData> listRootFiles(int applicationId);\r\n\tpublic List<FileData> listFolderFiles(int applicationId,int parentCategoryId);\r\n\tpublic List<ApproveReject> approveFile(List<ApproveReject> approveList, int applicationId);\r\n\tpublic List<ApproveReject> rejectFile(List<ApproveReject> rejectList, int applicationId);\r\n\tpublic int getNoOfUploadedFiles(int applicationId);\r\n\tpublic List<FileDelete> deleteFiles(List<FileDelete> fileDeleteList, int applicationId);\r\n\tpublic int getRootId(int applicationId);\r\n\tpublic String getPhoto(int applicationId);\r\n}", "private void setupDb(){\n try {\n openConnection();\n s.executeUpdate(\"CREATE TABLE IF NOT EXISTS LIB (NAME text UNIQUE , TYPE text, LANGUAGE text, INTRUSIVE text, OPENSOURCE text)\");\n }catch (SQLException e) {\n System.err.println(e.getMessage());\n }finally {\n if (c != null){\n close(c);\n }\n }\n }", "Object getDB();", "private static void bindClobVarInFile(PreparedStatement ps, \n int index, \n ResultSet rs,\n int type)\n throws IOException, SQLException \n {\n InputStream is = rs.getAsciiStream(index);\n if (rs.wasNull()) {\n ps.setNull(index, type);\n return;\n }\n \n // Open file output stream\n long millis = System.currentTimeMillis();\n File f = File.createTempFile(\"clob\", \"\"+millis);\n f.deleteOnExit();\n FileOutputStream fos = new FileOutputStream(f);\n if (log.isDebugEnabled()) {\n //i18n[DBUtil.info.bindclobfile=bindClobVarInFile: Opening temp file '{0}']\n String msg = s_stringMgr.getString(\"DBUtil.info.bindclobfile\",\n f.getAbsolutePath());\n log.debug(msg);\n }\n \n // read rs input stream write to file output stream\n byte[] buf = new byte[_prefs.getFileCacheBufferSize()];\n int length = 0;\n int total = 0;\n while ((length = is.read(buf)) >= 0) {\n if (log.isDebugEnabled()) {\n //i18n[DBUtil.info.bindcloblength=bindClobVarInFile: writing '{0}' bytes.]\n String msg =\n s_stringMgr.getString(\"DBUtil.info.bindcloblength\",\n Integer.valueOf(length));\n log.debug(msg);\n }\n fos.write(buf, 0, length);\n total += length;\n }\n fos.close();\n \n // set the ps to read from the file we just created.\n FileInputStream fis = new FileInputStream(f);\n BufferedInputStream bis = new BufferedInputStream(fis);\n ps.setAsciiStream(index, bis, total);\n }", "NewsFile selectByPrimaryKey(Integer fileId);", "private FileOperations() throws FileNotFoundException {\r\n\t\tbiddingPersistence = new BiddingPersistence(Constants.biddingsFilePath, \r\n\t\t\t\tConstants.indexBiddingsPath);\r\n\t\tusersPersistence = new UsersPersistence(Constants.usersFilePath,\r\n\t\t\t\tConstants.indexUsersPath);\t\t\r\n\t}", "public String getDBString();", "static Vector< DbRecord > ReadRecords( String szDbDir )\n {\n File DbDir;\n File[] files;\n Vector<DbRecord> Users = new Vector<DbRecord>( 10, 10 );\n\n // Read all records to identify\n DbDir = new File( szDbDir );\n files = DbDir.listFiles();\n\n if( (files == null) || (files.length == 0) )\n {\n return Users;\n }\n\n for( int iFiles = 0; iFiles < files.length; iFiles++)\n {\n try\n {\n if( files[iFiles].isFile() )\n {\n DbRecord User = new DbRecord( files[iFiles].getAbsolutePath() );\n Users.add( User );\n }\n }\n catch( FileNotFoundException e )\n {\n // The record has invalid data. Skip it and continue processing.\n }\n catch( NullPointerException e )\n {\n JOptionPane.showConfirmDialog(null, \"erro\"+e);\n }\n catch( AppException e )\n {\n // The record has invalid data or access denied. Skip it and continue processing.\n }\n }\n \n return Users;\n }", "DiaryFile selectByPrimaryKey(String maperId);", "public void createDBSchema() throws NoConnectionToDBException, SQLException, IOException {\n \n InputStream in = EDACCApp.class.getClassLoader().getResourceAsStream(\"edacc/resources/edacc.sql\");\n if (in == null) {\n throw new SQLQueryFileNotFoundException();\n }\n BufferedReader br = new BufferedReader(new InputStreamReader(in));\n String line;\n String text = \"\";\n String l;\n while ((line = br.readLine()) != null) {\n if (!(l = line.replaceAll(\"\\\\s\", \"\")).isEmpty() && !l.startsWith(\"--\")) {\n text += line + \" \";\n }\n }\n in.close();\n Vector<String> queries = new Vector<String>();\n String query = \"\";\n String delimiter = \";\";\n int i = 0;\n while (i < text.length()) {\n if (text.toLowerCase().startsWith(\"delimiter\", i)) {\n i += 10;\n delimiter = text.substring(i, text.indexOf(' ', i));\n i = text.indexOf(' ', i);\n } else if (text.startsWith(delimiter, i)) {\n queries.add(query);\n i += delimiter.length();\n query = \"\";\n } else {\n query += text.charAt(i);\n i++;\n }\n }\n if (!query.replaceAll(\" \", \"\").equals(\"\")) {\n queries.add(query);\n }\n boolean autoCommit = getConn().getAutoCommit();\n try {\n getConn().setAutoCommit(false);\n Statement st = getConn().createStatement();\n for (String q : queries) {\n st.execute(q);\n }\n st.close();\n getConn().commit();\n } catch (SQLException e) {\n getConn().rollback();\n throw e;\n } finally {\n getConn().setAutoCommit(autoCommit);\n }\n }", "private Db() {\n super(Ke.getDatabase(), null);\n }", "public static String SQLFromFile(String file) throws IOException{\n BufferedReader reader = new BufferedReader(new FileReader(file));\n StringBuilder sb = new StringBuilder();\n String line;\n while((line = reader.readLine()) != null){\n sb.append(line);\n sb.append(' ');\n }\n reader.close();\n return sb.toString();\n }", "@Override\n\tpublic void closeDB()\n\t{\n\n\t}", "public long getDbFileSize() {\r\n\tlong result = -1;\r\n\r\n\ttry {\r\n\t File dbFile = new File(fileName);\r\n\t if (dbFile.exists()) {\r\n\t\tresult = dbFile.length();\r\n\t }\r\n\t} catch (Exception e) {\r\n\t // nothing todo here\r\n\t}\r\n\r\n\treturn result;\r\n }", "public String getTableFile() \n\t{\n\t return tableFile ;\n\t}", "public interface DbLoader {\n\n /**\n * prepares the database\n */\n void prepareDatabase();\n}", "public static ParserResult loadDatabase(File fileToOpen, String encoding) throws IOException {\n \n Reader reader = getReader(fileToOpen, encoding);\n String suppliedEncoding = null;\n try {\n boolean keepon = true;\n int piv = 0, c;\n while (keepon) {\n c = reader.read();\n if ( (piv == 0 && Character.isWhitespace( (char) c)) ||\n c == GUIGlobals.SIGNATURE.charAt(piv))\n piv++;\n else\n keepon = false;\n found: if (piv == GUIGlobals.SIGNATURE.length()) {\n keepon = false;\n // Found the signature. The rest of the line is unknown, so we skip it:\n while (reader.read() != '\\n');\n // Then we must skip the \"Encoding: \"\n for (int i=0; i<GUIGlobals.encPrefix.length(); i++) {\n if (reader.read() != GUIGlobals.encPrefix.charAt(i))\n break found; // No, it doesn't seem to match.\n }\n // If ok, then read the rest of the line, which should contain the name\n // of the encoding:\n StringBuffer sb = new StringBuffer();\n while ((c = reader.read()) != '\\n')\n sb.append((char)c);\n suppliedEncoding = sb.toString();\n }\n \n }\n } catch (IOException ex) {}\n \n if ((suppliedEncoding != null) && (!suppliedEncoding.equalsIgnoreCase(encoding))) {\n Reader oldReader = reader;\n try {\n // Ok, the supplied encoding is different from our default, so we must make a new\n // reader. Then close the old one.\n reader = getReader(fileToOpen, suppliedEncoding);\n oldReader.close();\n //System.out.println(\"Using encoding: \"+suppliedEncoding);\n } catch (IOException ex) {\n reader = oldReader; // The supplied encoding didn't work out, so we keep our\n // existing reader.\n \n //System.out.println(\"Error, using default encoding.\");\n }\n } else {\n // We couldn't find a supplied encoding. Since we don't know far into the file we read,\n // we start a new reader.\n reader.close();\n reader = getReader(fileToOpen, encoding);\n //System.out.println(\"No encoding supplied, or supplied encoding equals default. Using default encoding.\");\n }\n \n \n //return null;\n \n BibtexParser bp = new BibtexParser(reader);\n \n ParserResult pr = bp.parse();\n pr.setEncoding(encoding);\n \n return pr;\n }", "public ODatabaseDocumentTx db();", "public static TreeBag<Golfer> loadDbFromFile(String dbFilename) \n {\n // used to store lines read from the database file\n String line;\n // create a new empty database\n TreeBag<Golfer> db = new TreeBag<Golfer>();\n // compile a regex pattern for parsing lines from the database file\n Pattern p = Pattern.compile(\"([\\\\w\\\\s-]+)(\\\\d+)\\\\s+(\\\\d+)\\\\s+(\\\\d+\\\\.?\\\\d*)\");\n // create file handle for the filename specified (in current directory)\n File f = new File(\".\"+ File.separator + dbFilename);\n\n // if the filename specified exists in the current directory,\n if (f.exists()) {\n System.out.println(\"\\nLoading golfers from database file '\"+ dbFilename +\"'...\");\n\n // try loading from the database file\n try {\n // create a new file reader using the file handle\n FileReader fr = new FileReader(f);\n // buffer the file reader\n BufferedReader buf = new BufferedReader(fr);\n\n // keep reading lines from the file buffer until we reach the end of file\n while ( (line = buf.readLine()) != null ) {\n // trim whitespace off the lines\n line = line.trim();\n //System.out.println(\"Read line:\\n\"+ line +\"\\n\");\n\n // create a matcher object using the pre-compiled regex pattern\n Matcher m = p.matcher(line);\n // if the matcher object found a match on the current line,\n if (m.find()) {\n // populate golfer data using match groups\n String name = m.group(1);\n int rounds = Integer.valueOf(m.group(2));\n int handicap = Integer.valueOf(m.group(3));\n double avg = Double.valueOf(m.group(4));\n // create a new golfer object\n Golfer g = new Golfer(name, rounds, handicap, avg);\n // add new golfer to the database\n db.add(g);\n /*\n System.out.println(\"Added golfer to database:\\n\"+ g +\"\\n\");\n System.out.println(\"Current database:\\n\"+ db);\n System.out.println(\"Tree view:\");\n db.displayAsTree();\n System.out.println(\"\\n\");\n */\n }\n }\n\n // at the end of the file, close the buffer\n buf.close();\n }\n // exception: specified file does not exist\n catch(FileNotFoundException e) {\n // print stack trace for debugging\n e.printStackTrace();\n System.out.println(\"File '\"+ dbFilename +\"' not found: \"+ e);\n }\n // exception: I/O error when reading from file\n catch(IOException e) {\n // print stack trace for debugging\n e.printStackTrace();\n System.out.println(\"Error reading file '\"+ dbFilename +\"': \"+ e);\n }\n }\n else\n System.out.println(\"Database file '\"+ dbFilename +\"' not found\");\n \n // return the newly compiled database\n return db;\n }", "String getClobField();", "private static Connection _getDbConnection(String aPath)\n\t{\n\t\ttry\n\t\t{\n\t\t\t// Open file\n\t\t\tConnection c = DriverManager.getConnection(CONN_PREFIX+aPath);\n\t\t\tc.setAutoCommit(false);\n\t\t\tIO.dbOutD(\"Connection to DB at path \"+ aPath + \" established.\");\n\t\t\treturn c;\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tIO.dbOutE(e);\n\t\t\treturn null;\n\t\t}\n\t}", "public abstract String toDBString();", "abstract public int dbVersion();", "@Override\r\n public Db_db currentDb(){return curDb_;}", "@Test(timeout = 4000)\n public void test126() throws Throwable {\n DBDataType dBDataType0 = DBDataType.getInstance(\"CLOB\");\n Integer integer0 = RawTransaction.SAVEPOINT_ROLLBACK;\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n DefaultDBColumn defaultDBColumn0 = new DefaultDBColumn(\"CLOB\", defaultDBTable0, dBDataType0, integer0);\n NameSpec nameSpec0 = NameSpec.NEVER;\n MockPrintWriter mockPrintWriter0 = new MockPrintWriter(\"#B0tMDNkWiXCI3n\");\n SQLUtil.renderCreateTable(defaultDBTable0, true, nameSpec0, mockPrintWriter0);\n assertEquals(\"table\", defaultDBTable0.getObjectType());\n }", "@Override\n\tpublic int dbsize() {\n\t\treturn 0;\n\t}" ]
[ "0.75157964", "0.7207134", "0.68569815", "0.63199925", "0.6181427", "0.6111812", "0.6099201", "0.60644037", "0.59969676", "0.5979249", "0.5952778", "0.59035164", "0.58971214", "0.58509666", "0.5845584", "0.58102745", "0.5803401", "0.5799259", "0.57971716", "0.57711357", "0.57695055", "0.5767503", "0.5752722", "0.57479733", "0.57406056", "0.57320595", "0.57168776", "0.5697447", "0.56867045", "0.5682405", "0.56754166", "0.5666785", "0.5664102", "0.5647995", "0.56325895", "0.56258273", "0.5624869", "0.56193763", "0.55959326", "0.5585878", "0.55815583", "0.5577803", "0.557705", "0.55616677", "0.5561108", "0.55609745", "0.55519277", "0.55509084", "0.5543736", "0.55334646", "0.55331606", "0.5527237", "0.5526337", "0.5525896", "0.55252844", "0.5518253", "0.5514276", "0.55122817", "0.549596", "0.54924434", "0.5479121", "0.5471432", "0.5468912", "0.5459671", "0.5458537", "0.54396975", "0.5430522", "0.54202116", "0.54199183", "0.5418684", "0.54114187", "0.5404702", "0.5401479", "0.5401462", "0.5395391", "0.5388146", "0.5384979", "0.53836393", "0.53788674", "0.53712666", "0.5361237", "0.5356752", "0.535602", "0.53549165", "0.535151", "0.5347666", "0.5343226", "0.53342867", "0.5331255", "0.53310555", "0.5329507", "0.53294194", "0.53229684", "0.53156996", "0.53078943", "0.53070843", "0.5306523", "0.5306394", "0.5305002", "0.53025085", "0.5302188" ]
0.0
-1
see DbFile.java for javadocs
public ArrayList<Page> deleteTuple(TransactionId tid, Tuple t) throws DbException, TransactionAbortedException { // some code goes here return null; // not necessary for lab1 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public File getInputDb();", "public File getOutputDb();", "private String getFileTableQuery() {\n \t\tfinal StringBuilder builder = new StringBuilder();\n \n \t\tbuilder.append(\"create table FILE(\");\n \t\tbuilder.append(\"FILE_ID LONG PRIMARY KEY,\");\n \t\tbuilder.append(\"FILE_PATH TEXT,\");\n \t\tbuilder.append(\"START_REVISION_ID LONG,\");\n \t\tbuilder.append(\"END_REVISION_ID LONG\");\n \t\tbuilder.append(\")\");\n \n \t\treturn builder.toString();\n \t}", "public String getDatabaseFileName();", "public FileDatabase(String filename) throws IOException {\n\t\tdatabase = new File(filename);\n\t\tread();\n\t}", "public synchronized void writeFromFileIntoDB()throws IOWrapperException, IOIteratorException{\r\n \r\n fromFile_Name=Controller.CLASSES_TMP_FILENAME;\r\n iow_ReadFromFile = new IOWrapper();\r\n \r\n //System.out.println(\"Readin' from \"+fromFile_Name);\r\n \r\n iow_ReadFromFile.setupInput(fromFile_Name,0);\r\n \r\n iter_ReadFromFile = iow_ReadFromFile.getLineIterator();\r\n iow_ReadFromFile.setupOutput(this.dbname,this.username,this.password,this.hostname,this.port);\r\n \r\n iow_ReadFromFile.sendOutputQuery(\"DROP TABLE IF EXISTS \"+outtable);\r\n \r\n iow_ReadFromFile.sendOutputQuery(\r\n \"CREATE TABLE IF NOT EXISTS \"\r\n +outtable+\" (\"\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[0]+\" int(10) NOT NULL AUTO_INCREMENT, \"//wort_nr\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[1]+\" varchar(225), \"//wort_alph\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[2]+\" int(10), \"//krankheit \r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[3]+\" int(10), \"//farbe1 \r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[4]+\" real(8,2), \"//farbe1prozent\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[5]+\" int(10), \"//farbe2\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[6]+\" real(8,2), \"//farbe2prozent\r\n +\"PRIMARY KEY (\"+Controller.COLUMN_NAMES_FOR_DB_OUT[0]+\")) \"\r\n +\"ENGINE=MyISAM\"\r\n );\r\n while(iter_ReadFromFile.hasNext()){\r\n singleProgress+=1;\r\n String[] data = (String[])iter_ReadFromFile.next();\r\n \r\n //System.out.println(\"--> processing line \"+data);\r\n //escape quotes ' etc for SQL query\r\n if(data[1].matches(\".*'.*\")||data[1].matches(\".*\\\\.*\")){\r\n int sl = data[1].length();\r\n String escapedString = \"\";\r\n \r\n for (int i = 0; i < sl; i++) {\r\n char ch = data[1].charAt(i);\r\n switch (ch) {\r\n case '\\'':\r\n escapedString +='\\\\';\r\n escapedString +='\\'';\r\n break;\r\n case '\\\\':\r\n escapedString +='\\\\';\r\n escapedString +='\\\\';\r\n break;\r\n default :\r\n escapedString +=ch;\r\n break;\r\n }\r\n }\r\n data[1]=escapedString;\r\n }\r\n \r\n String insertStatement=\"INSERT INTO \"\r\n +outtable+\" (\"\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[0]+\", \"//node id\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[1]+\", \"//label\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[2]+\", \"//class id \r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[3]+\", \"//class id 1 \r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[4]+\", \"//percent\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[5]+\", \"//class id 2\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[6]+\") \"//percent \r\n +\"VALUES ('\"\r\n +data[0]+\"', '\"\r\n +data[1]+\"', '\"\r\n +data[2]+\"', '\"\r\n +data[3]+\"', '\"\r\n +data[4]+\"', '\"\r\n +data[5]+\"', '\"\r\n +data[6]+\"')\";\r\n \r\n //System.out.println(\"Sending insert statement:\"+insertStatement);\r\n iow_ReadFromFile.sendOutputQuery(insertStatement);\r\n }\r\n \r\n \r\n //iow_ReadFromFile.closeOutput();\r\n \r\n this.stillWorks=false;\r\n writeIntoDB=false;\r\n System.out.println(\"*\\tData written into database.\");\r\n\t}", "interface DataTableFile extends TableDataSource {\n\n /**\n * Creates a new file of the given table. The table is initialised and\n * contains 0 row entries. If the table already exists in the database then\n * this will throw an exception.\n * <p>\n * On exit, the object will be initialised and loaded with the given table.\n *\n * @param def the definition of the table.\n */\n void create(DataTableDef def) throws IOException;\n\n /**\n * Updates a file of the given table. If the table does not exist, then it\n * is created. If the table already exists but is different, then the\n * existing table is modified to incorporate the new fields structure.\n * <p>\n * The DataTableFile must have previously been 'load(table_name)' before\n * this call.\n * <p>\n * Implementations of this method may choose to reorganise information that\n * the relational schemes are dependant on (the row order for example). If\n * this method returns 'true' then we must also reindex the schemes.\n * <p>\n * <strong>NOTE:</strong> If the new format has columns that are not\n * included in the new format then the columns are deleted.\n *\n * @param def the definition of the table.\n * @return true if the table topology has changed.\n */\n boolean update(DataTableDef def) throws IOException;\n\n /**\n * This is called periodically when this data table file requires some\n * maintenance. It is recommended that this method is called every\n * time the table is initialized (loaded).\n * <p>\n * The DataTableFile must have previously been 'load(table_name)' before\n * this call.\n * <p>\n * This method may change the topology of the rows (delete rows that are\n * marked as deleted), therefore if the method returns true you need to\n * re-index the schemes.\n *\n * @return true if the table topology was changed.\n */\n boolean doMaintenance() throws IOException;\n\n// /**\n// * A recovery method that returns a DataTableDef object for this data\n// * table file that was last used in a call to 'create' or 'update'. This\n// * information should be kept in a secondary table topology store but it\n// * is useful to keep this information in the data table file just incase\n// * something bad happens, or tables are moved to another database.\n// */\n// DataTableDef recoverLastDataTableDef() throws IOException;\n\n /**\n * Loads a previously created table. A table can be loaded in read only\n * mode, in which case any methods that write to the DataTableFile will\n * throw an IOException.\n *\n * @param table_name the name of the table.\n * @param read_only if true then the table file is opened as read-only.\n */\n void load(String table_name, boolean read_only) throws IOException;\n\n /**\n * Shuts down the table. This is called when the table is closed and the\n * resources it uses are to be freed back to the system. This is called\n * as part of the database shut down procedure or called when we want to\n * free the resources associated with this table.\n */\n void shutdown() throws IOException;\n\n /**\n * Deletes the data table file in the file system. This is used to clear\n * up resources after a table has been dropped. The table must be shut\n * down before this method is called.\n * <p>\n * NOTE: Use this with care. All data is lost!\n */\n void drop();\n\n /**\n * Flushes all information that may be cached in memory to disk. This\n * includes any relational data, any cached data that hasn't made it to\n * the file system yet. It will write out all persistant information\n * and leave the table in a state where it is fully represented in the\n * file system.\n */\n void updateFile() throws IOException;\n\n /**\n * Locks the data in the file to prevent the system overwritting entries\n * that have been marked as removed. This is necessary so we may still\n * safely read removed entries from the table while the table is locked.\n */\n void addRowsLock();\n\n /**\n * Unlocks the data in the file to indicate that the system may safely\n * overwrite removed entries in the file.\n */\n void removeRowsLock();\n\n /**\n * Returns true if the file currently has all of its rows locked.\n */\n boolean hasRowsLocked();\n\n// /**\n// * The number of rows that are currently stored in this table. This number\n// * does not include the rows that have been marked as removed.\n// */\n// int rowCount();\n\n /**\n * Returns true if the given row index points to a valid and available\n * row entry. Returns false if the row entry has been marked as removed,\n * or the index goes outside the bounds of the table.\n */\n boolean isRowValid(int record_index) throws IOException;\n\n /**\n * Adds a complete new row into the table. If the table is in a row locked\n * state, then this will always add a new entry to the end of the table.\n * Otherwise, new entries are added where entries were previously removed.\n * <p>\n * This will update any column indices that are set.\n *\n */\n int addRow(RowData row_data) throws IOException;\n\n /**\n * Removes a row from the table at the given index. This will only mark\n * the entry as removed, and will not actually remove the data. This is\n * because a process is allowed to read the data even after the row has been\n * marked as removed (if the rows have been locked).\n * <p>\n * This will update any column indices that are set.\n *\n * @param row_index the raw row index of the entry to be marked as removed.\n */\n void removeRow(int row_index) throws IOException;\n\n// /**\n// * Returns a DataCell object of the entry at the given column, row\n// * index in the table. This will always work provided there was once data\n// * stored at that index, even if the row has been marked as deleted.\n// */\n// DataCell getCellAt(int column, int row) throws IOException;\n\n /**\n * Returns a unique number. This is incremented each time it is accessed.\n */\n long nextUniqueKey() throws IOException;\n\n}", "public DatabaseFileInformation(byte[] aFileBytes)\n {\n mTables = new LinkedList<>();\n\n mHeader = (short) (((0xFF) & aFileBytes[1]) | (((0xFF) & aFileBytes[0]) << 8));\n mVersion = (short) (((0xFF) & aFileBytes[3]) | (((0xFF) & aFileBytes[2]) << 8));\n mUnknown1 = ((0xFF) & aFileBytes[7]) | (((0xFF) & aFileBytes[6]) << 8) | (((0xFF) & aFileBytes[5]) <<\n 16) | (((0xFF) & aFileBytes[4]) << 24);\n mDatabaseSize = ((0xFF) & aFileBytes[11]) | (((0xFF) & aFileBytes[10]) << 8) | (((0xFF) & aFileBytes[9]) <<\n 16) | (((0xFF) & aFileBytes[8]) << 24);\n mZero = ((0xFF) & aFileBytes[15]) | (((0xFF) & aFileBytes[14]) << 8) | (((0xFF) & aFileBytes[13]) <<\n 16) | (((0xFF) & aFileBytes[12]) << 24);\n mTableCount = ((0xFF) & aFileBytes[19]) | (((0xFF) & aFileBytes[18]) << 8) | (((0xFF) & aFileBytes[17]) <<\n 16) | (((0xFF) & aFileBytes[16]) << 24);\n mUnknown2 = ((0xFF) & aFileBytes[23]) | (((0xFF) & aFileBytes[22]) << 8) | (((0xFF) & aFileBytes[21]) <<\n 16) | (((0xFF) & aFileBytes[20]) << 24);\n\n int lTableDefinitionPosition = 24;\n int lTableDataStart = lTableDefinitionPosition + (mTableCount * 8);\n\n // Read the table definitions.\n for (int i = 0; i < mTableCount; i++)\n {\n DatabaseTable lDatabaseTable = new DatabaseTable();\n lDatabaseTable.readTableDefinition(aFileBytes, lTableDefinitionPosition);\n lDatabaseTable.readTableHeader(aFileBytes, lTableDataStart);\n mTables.add(lDatabaseTable);\n lTableDefinitionPosition += 8;\n }\n }", "public interface DatabaseManager {\r\n\r\n // NOTE: this is a draft of the interface. More methods will likely be\r\n // added.\r\n\r\n /**\r\n * Uploads the specified feature to the database.\r\n * \r\n * @param file the shapefile (*.shp) to upload\r\n * @param project the project to associate the shapefile with\r\n * @return the id of the feature in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadFeature(File file, String project) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified modis tile to the database.\r\n * \r\n * @param file the .hdf to upload\r\n * @param product the modis product\r\n * @param date the date the data was captured\r\n * @param downloaded the date the data was downloaded from the host\r\n * @param horz the horizontal tile number\r\n * @param vert the vertical tile number\r\n * @return the id of the Modis raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadModis(File file, ModisProduct product, DataDate date, DataDate updated, int horz, int vert) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified ETo file to the database.\r\n * \r\n * @param file the\r\n * @param date\r\n * @param updated\r\n * @return the id of the ETo raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadEto(File file, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified TRMM file to the database.\r\n * \r\n * @param file\r\n * @param date\r\n * @param updated\r\n * @return the id of the TRMM raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadTrmm(File file, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified projected Modis product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param product\r\n * @param date\r\n * @param updated\r\n * @return the id of the projected Modis raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadProjectedModis(File file, String project, ModisProduct product, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified projected ETo product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the projected ETo raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadProjectedEto(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the projected TRMM product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the TRMM raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadProjectedTrmm(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified ETa product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the ETa raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadEta(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified EVI product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the EVI raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadEvi(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified NDVI product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the NDVI raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadNdvi(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified NDWI5 product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the NDWI5 raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadNdwi5(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified NDWI6 product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the NDWI6 raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadNdwi6(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified SAVI product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the SAVI raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadSavi(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified feature and places it in the specified file in\r\n * the shapefile.\r\n * \r\n * @param file the location to save the feature\r\n * @param id the id of the feature\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadFeature(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified Modis tile from the database.\r\n * \r\n * @param file\r\n * @param product\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadModis(File file, ModisProduct product, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified ETo raster from the database and saves it to the\r\n * specified file.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadEto(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified TRMM raster from the database and saves it to the\r\n * specified file.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadTrmm(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified projected Modis product from the database.\r\n * \r\n * @param file\r\n * @param product\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadProjectedModis(File file, ModisProduct product, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified projected ETo product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadProjectedEto(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified projected TRMM product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadProjectedTrmm(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified ETa product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadEta(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified EVI product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadEvi(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified NDVI product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadNdvi(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified NDWI5 product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadNdwi5(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified NDWI6 product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadNdwi6(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified SAVI product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadSavi(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Returns the id of the MODIS raster for the specified product and date.\r\n * \r\n * @param product\r\n * @param date\r\n * @param horz\r\n * @param vert\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getModisId(ModisProduct product, DataDate date, int horz, int vert) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the ETo for the specified date.\r\n * \r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getEtoId(DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the TRMM for the specified date.\r\n * \r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getTrmmId(DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the reprojected Modis raster for the specified\r\n * project, product, and date.\r\n * \r\n * @param project\r\n * @param product\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getReprojectedModisId(String project, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the reprojected ETo raster for the specified project\r\n * and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getReprojectedEtoId(String project, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the reprojected TRMM raster for the specified project\r\n * and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getReprojectedTrmmId(String project, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the ETa raster for the specified project and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getEtaId(String project, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the EVI raster for the specified project and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getEviId(String project, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the NDVI raster for the specified project and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getNdviId(String project, String feature, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the NDWI5 raster for the specified project and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getNdwi5Id(String project, String feature, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the NDWI6 raster for the specified project and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getNdwi6Id(String project, String feature, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the SAVI raster for the specified project and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getSaviId(String project, String feature, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Uploads the specified zonal statistics.\r\n * \r\n * @param project\r\n * @param feature\r\n * @param zoneField\r\n * @param zone\r\n * @param date\r\n * @param index\r\n * @param zonalStatistics\r\n */\r\n void uploadZonalStatistic(String project, String feature, String zoneField,\r\n String zone, DataDate date, EnvironmentalIndex index,\r\n ZonalStatistic zonalStatistics) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the zonal statistics for the specified parameters.\r\n * \r\n * @param project\r\n * @param feature\r\n * @param zoneField\r\n * @param zone\r\n * @param date\r\n * @param index\r\n * @return the id or -1 if it is not found\r\n */\r\n int getZonalStatisticId(String project, String feature, String zoneField,\r\n String zone, DataDate date, EnvironmentalIndex index)\r\n throws SQLException;\r\n\r\n /**\r\n * Returns zonal statistics for the specified zonal statistic id.\r\n * \r\n * @param id\r\n * @return zonal statistics\r\n * @throws SQLException\r\n */\r\n ZonalStatistic getZonalStatistic(int id) throws SQLException;\r\n}", "public abstract String apachedb(int size);", "public void createDB() {\n\t\ttry {\n\t\t\tBufferedReader br= new BufferedReader(new FileReader(\"db_schema.txt\"));\n\t\t\tString line= null;\n\t\t\tStringBuilder sb= new StringBuilder();\n\t\t\twhile ((line=br.readLine())!=null){\n\t\t\t\tsb.append(line);\n\t\t\t\tif(sb.length()>0 && sb.charAt(sb.length()-1)==';'){//see if it is the end of one line of command\n\t\t\t\t\tstatement.executeUpdate(sb.toString());\n\t\t\t\t\tsb= new StringBuilder();\n\t\t\t\t}\n\t\t\t}\n\t\t\tbr.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public String getPath() { return db.getPath(); }", "String getUserDatabaseFilePath();", "public abstract ODatabaseInternal<?> openDatabase();", "private DBManager() throws Exception {\n file = new File(\"pdfLibraryDB.mv.db\");\n if (!file.exists()) {\n conn = connect();\n stmt = conn.createStatement();\n query = \"CREATE TABLE user(username VARCHAR(30) PRIMARY KEY, password VARCHAR(32));\" +\n \"CREATE TABLE category(id VARCHAR(30) PRIMARY KEY, name VARCHAR(30), username VARCHAR(30), FOREIGN KEY(username) REFERENCES user(username) ON UPDATE CASCADE ON DELETE CASCADE);\"+\n \"CREATE TABLE favorite(id VARCHAR(30) PRIMARY KEY, path VARCHAR(500), keyword VARCHAR(200), searchType VARCHAR(10), category VARCHAR(30),username VARCHAR(30), FOREIGN KEY(username) REFERENCES user(username) ON UPDATE CASCADE ON DELETE CASCADE, FOREIGN KEY(category) REFERENCES category(id) ON UPDATE CASCADE ON DELETE CASCADE);\" +\n \"CREATE TABLE history(id VARCHAR(30) PRIMARY KEY, keyword VARCHAR(200), type VARCHAR(10), directory VARCHAR(500), username VARCHAR(30), FOREIGN KEY(username) REFERENCES user(username) ON UPDATE CASCADE ON DELETE CASCADE);\";\n stmt.executeUpdate(query);\n stmt.close();\n conn.close();\n System.out.println(\"DB created!\");\n }\n }", "@Test\n public void reading()\n throws FileNotFoundException, IOException, CorruptedTableException\n {\n final Database database =\n new Database(new File(\"src/test/resources/\" + versionDirectory + \"/rndtrip\"), version);\n final Set<String> tableNames = database.getTableNames();\n\n assertEquals(2,\n tableNames.size());\n assertTrue(\"TABLE1 not found in 'short roundtrip' database\",\n tableNames.contains(\"TABLE1.DBF\"));\n assertTrue(\"TABLE2 not found in 'short roundtrip' database\",\n tableNames.contains(\"TABLE2.DBF\"));\n\n final Table t1 = database.getTable(\"TABLE1.DBF\");\n\n try\n {\n t1.open(IfNonExistent.ERROR);\n\n assertEquals(\"Table name incorrect\",\n \"TABLE1.DBF\",\n t1.getName());\n assertEquals(\"Last modified date incorrect\",\n Util.createDate(2009, Calendar.APRIL, 1),\n t1.getLastModifiedDate());\n\n final List<Field> fields = t1.getFields();\n\n Iterator<Field> fieldIterator = fields.iterator();\n Map<String, Field> nameFieldMap = new HashMap<String, Field>();\n\n while (fieldIterator.hasNext())\n {\n Field f = fieldIterator.next();\n nameFieldMap.put(f.getName(),\n f);\n }\n\n final Field idField = nameFieldMap.get(\"ID\");\n assertEquals(Type.NUMBER,\n idField.getType());\n assertEquals(idField.getLength(),\n 3);\n\n final Field stringField = nameFieldMap.get(\"STRFIELD\");\n assertEquals(Type.CHARACTER,\n stringField.getType());\n assertEquals(stringField.getLength(),\n 50);\n\n final Field logicField = nameFieldMap.get(\"LOGICFIELD\");\n assertEquals(Type.LOGICAL,\n logicField.getType());\n assertEquals(logicField.getLength(),\n 1);\n\n final Field dateField = nameFieldMap.get(\"DATEFIELD\");\n assertEquals(Type.DATE,\n dateField.getType());\n assertEquals(8,\n dateField.getLength());\n\n final Field floatField = nameFieldMap.get(\"FLOATFIELD\");\n assertEquals(Type.NUMBER,\n floatField.getType());\n assertEquals(10,\n floatField.getLength());\n\n final List<Record> records = UnitTestUtil.createSortedRecordList(t1.recordIterator(),\n \"ID\");\n final Record r0 = records.get(0);\n\n assertEquals(1,\n r0.getNumberValue(\"ID\"));\n assertEquals(\"String data 01\",\n r0.getStringValue(\"STRFIELD\").trim());\n assertEquals(true,\n r0.getBooleanValue(\"LOGICFIELD\"));\n assertEquals(Util.createDate(1909, Calendar.MARCH, 18),\n r0.getDateValue(\"DATEFIELD\"));\n assertEquals(1234.56,\n r0.getNumberValue(\"FLOATFIELD\"));\n\n final Record r1 = records.get(1);\n\n assertEquals(2,\n r1.getNumberValue(\"ID\"));\n assertEquals(\"String data 02\",\n r1.getStringValue(\"STRFIELD\").trim());\n\n /*\n * in Clipper 'false' value can be given as an empty field, and the method called here\n * returns then 'null' as the return value\n */\n if (version == Version.CLIPPER_5)\n {\n assertEquals(null,\n r1.getBooleanValue(\"LOGICFIELD\"));\n }\n else\n {\n assertEquals(false,\n r1.getBooleanValue(\"LOGICFIELD\"));\n }\n\n assertEquals(Util.createDate(1909, Calendar.MARCH, 20),\n r1.getDateValue(\"DATEFIELD\"));\n assertEquals(-23.45,\n r1.getNumberValue(\"FLOATFIELD\"));\n\n final Record r2 = records.get(2);\n\n assertEquals(3,\n r2.getNumberValue(\"ID\"));\n assertEquals(\"\",\n r2.getStringValue(\"STRFIELD\").trim());\n assertEquals(null,\n r2.getBooleanValue(\"LOGICFIELD\"));\n assertEquals(null,\n r2.getDateValue(\"DATEFIELD\"));\n assertEquals(null,\n r2.getNumberValue(\"FLOATFIELD\"));\n\n final Record r3 = records.get(3);\n\n assertEquals(4,\n r3.getNumberValue(\"ID\"));\n assertEquals(\"Full5678901234567890123456789012345678901234567890\",\n r3.getStringValue(\"STRFIELD\").trim());\n\n /*\n * in Clipper 'false' value can be given as an empty field, and the method called here\n * returns then 'null' as the return value\n */\n if (version == Version.CLIPPER_5)\n {\n assertEquals(null,\n r3.getBooleanValue(\"LOGICFIELD\"));\n }\n else\n {\n assertEquals(false,\n r3.getBooleanValue(\"LOGICFIELD\"));\n }\n\n assertEquals(Util.createDate(1909, Calendar.MARCH, 20),\n r3.getDateValue(\"DATEFIELD\"));\n assertEquals(-0.30,\n r3.getNumberValue(\"FLOATFIELD\"));\n }\n finally\n {\n t1.close();\n }\n\n final Table t2 = database.getTable(\"TABLE2.DBF\");\n\n try\n {\n t2.open(IfNonExistent.ERROR);\n\n final List<Field> fields = t2.getFields();\n\n Iterator<Field> fieldIterator = fields.iterator();\n Map<String, Field> nameFieldMap = new HashMap<String, Field>();\n\n while (fieldIterator.hasNext())\n {\n Field f = fieldIterator.next();\n nameFieldMap.put(f.getName(),\n f);\n }\n\n final Field idField = nameFieldMap.get(\"ID2\");\n assertEquals(Type.NUMBER,\n idField.getType());\n assertEquals(idField.getLength(),\n 4);\n\n final Field stringField = nameFieldMap.get(\"MEMOFIELD\");\n assertEquals(Type.MEMO,\n stringField.getType());\n assertEquals(10,\n stringField.getLength());\n\n final Iterator<Record> recordIterator = t2.recordIterator();\n final Record r = recordIterator.next();\n\n String declarationOfIndependence = \"\";\n\n declarationOfIndependence += \"When in the Course of human events it becomes necessary for one people \";\n declarationOfIndependence += \"to dissolve the political bands which have connected them with another and \";\n declarationOfIndependence += \"to assume among the powers of the earth, the separate and equal station to \";\n declarationOfIndependence += \"which the Laws of Nature and of Nature's God entitle them, a decent respect \";\n declarationOfIndependence += \"to the opinions of mankind requires that they should declare the causes which \";\n declarationOfIndependence += \"impel them to the separation.\";\n declarationOfIndependence += \"\\r\\n\\r\\n\";\n declarationOfIndependence += \"We hold these truths to be self-evident, that all men are created equal, \";\n declarationOfIndependence += \"that they are endowed by their Creator with certain unalienable Rights, \";\n declarationOfIndependence += \"that among these are Life, Liberty and the persuit of Happiness.\";\n\n assertEquals(1,\n r.getNumberValue(\"ID2\"));\n assertEquals(declarationOfIndependence,\n r.getStringValue(\"MEMOFIELD\"));\n }\n finally\n {\n t2.close();\n }\n }", "@Insert({ \"insert into csv_file (id, pid, \", \"filename, start_time, \", \"end_time, length, \", \"density, machine, \",\n\t\t\t\"ar, path, size, \", \"uuid, header_time, \", \"last_update, conflict_resolved, \", \"status, comment, \",\n\t\t\t\"width, start_version, \", \"end_version)\", \"values (#{id,jdbcType=INTEGER}, #{pid,jdbcType=VARCHAR}, \",\n\t\t\t\"#{filename,jdbcType=VARCHAR}, #{startTime,jdbcType=TIMESTAMP}, \",\n\t\t\t\"#{endTime,jdbcType=TIMESTAMP}, #{length,jdbcType=INTEGER}, \",\n\t\t\t\"#{density,jdbcType=DOUBLE}, #{machine,jdbcType=VARCHAR}, \",\n\t\t\t\"#{ar,jdbcType=BIT}, #{path,jdbcType=VARCHAR}, #{size,jdbcType=BIGINT}, \",\n\t\t\t\"#{uuid,jdbcType=CHAR}, #{headerTime,jdbcType=TIMESTAMP}, \",\n\t\t\t\"#{lastUpdate,jdbcType=TIMESTAMP}, #{conflictResolved,jdbcType=BIT}, \",\n\t\t\t\"#{status,jdbcType=INTEGER}, #{comment,jdbcType=VARCHAR}, \",\n\t\t\t\"#{width,jdbcType=INTEGER}, #{startVersion,jdbcType=INTEGER}, \", \"#{endVersion,jdbcType=INTEGER})\" })\n\tint insert(CsvFile record);", "public void database() throws IOException\n {\n \tFile file =new File(\"data.txt\");\n\t if(!file.exists())\n\t {\n\t \tSystem.out.println(\"File 'data.txt' does not exit\");\n\t System.out.println(file.createNewFile());\n\t file.createNewFile();\n\t databaseFileWrite(file);//call the databaseFileRead() method, to initialize data from ArrayList and write data into data.txt\n\t }\n\t else\n\t {\n\t \tdatabaseFileRead();//call the databaseFileRead() method, to load data directly from data.txt\n\t }\n }", "@Override\n\tpublic void CreateDatabaseFromFile() {\n\t\tfinal String FILENAME = \"fandv.sql\";\n\t\tint[] updates = null;\n\t\ttry {\n\t\t\tMyDatabase db = new MyDatabase();\n\t\t\tupdates = db.updateAll(FILENAME);\n\t\t} catch (FileNotFoundException | SQLException | ClassNotFoundException e) {\n\t\t\tSystem.out.println(\"Database issue\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < updates.length; i++) {\n\t\t\tsum += updates[i];\n\t\t}\n\t\tSystem.out.println(\"Number of updates: \" + sum);\n\t}", "public GEMFileRockDao() {\n gemFileDb = RocksDatabase.getInstance(DB_NAME, String.class, GEMFile.class);\n gemFileFileTypesDb =\n RocksDatabase.getInstance(DB_NAME + \"_FileType\", String.class, Integer.class);\n gemFileState = RocksDatabase.getInstance(DB_NAME + \"_FileState\", String.class, String.class);\n gemFileState.put(STATE_SYNC_PROGRESS, String.valueOf(SYNC_COMPLETE));\n }", "public DBInternal(File directory, DBOptions options) {\n this.directory = directory;\n this.options = options;\n // TODO: check options.\n\n // TODO: rebuid index.\n\n // TODO: initialize fileID. Make sure the starting number is the largest number used so far.\n\n // TODO: open a current file writer.\n\n // TODO: start offline compaction.\n\n }", "public final void executeSQL(Connection conn,DbConnVO vo,String fileName) throws Throwable {\r\n PreparedStatement pstmt = null;\r\n StringBuffer sql = new StringBuffer(\"\");\r\n InputStream in = null;\r\n\r\n try {\r\n try {\r\n in = this.getClass().getResourceAsStream(\"/\" + fileName);\r\n }\r\n catch (Exception ex5) {\r\n }\r\n if (in==null)\r\n in = new FileInputStream(org.openswing.swing.util.server.FileHelper.getRootResource() + fileName);\r\n\r\n BufferedReader br = new BufferedReader(new InputStreamReader(in));\r\n String line = null;\r\n ArrayList vals = new ArrayList();\r\n int pos = -1;\r\n String oldfk = null;\r\n String oldIndex = null;\r\n StringBuffer newIndex = null;\r\n StringBuffer newfk = null;\r\n ArrayList fks = new ArrayList();\r\n ArrayList indexes = new ArrayList();\r\n boolean fkFound = false;\r\n boolean indexFound = false;\r\n String defaultValue = null;\r\n int index = -1;\r\n StringBuffer unicode = new StringBuffer();\r\n boolean useDefaultValue = false;\r\n// vo.getDriverName().equals(\"oracle.jdbc.driver.OracleDriver\") ||\r\n// vo.getDriverName().equals(\"com.microsoft.jdbc.sqlserver.SQLServerDriver\") ||\r\n//\t\t\t\t\tvo.getDriverName().equals(\"com.microsoft.sqlserver.jdbc.SQLServerDriver\") ||\r\n// vo.getDriverName().equals(\"com.mysql.jdbc.Driver\");\r\n while ( (line = br.readLine()) != null) {\r\n sql.append(' ').append(line);\r\n if (line.endsWith(\";\")) {\r\n if (vo.getDriverName().equals(\"oracle.jdbc.driver.OracleDriver\")) {\r\n sql = replace(sql, \" VARCHAR(\", \" VARCHAR2(\");\r\n sql = replace(sql, \" NUMERIC(\", \" NUMBER(\");\r\n sql = replace(sql, \" DECIMAL(\", \" NUMBER(\");\r\n sql = replace(sql, \" TIMESTAMP\", \" DATE \");\r\n sql = replace(sql, \" DATETIME\", \" DATE \");\r\n }\r\n else if (vo.getDriverName().equals(\"com.microsoft.jdbc.sqlserver.SQLServerDriver\")) {\r\n sql = replace(sql, \" TIMESTAMP\", \" DATETIME \");\r\n sql = replace(sql, \" DATE \", \" DATETIME \");\r\n }\r\n else if (vo.getDriverName().equals(\"com.microsoft.sqlserver.jdbc.SQLServerDriver\")) {\r\n sql = replace(sql, \" TIMESTAMP\", \" DATETIME \");\r\n sql = replace(sql, \" DATE \", \" DATETIME \");\r\n }\r\n else if (vo.getDriverName().toLowerCase().contains(\"postgres\")) {\r\n sql = replace(sql, \" DATETIME\", \" TIMESTAMP \");\r\n sql = replace(sql, \" DATE \", \" TIMESTAMP \");\r\n }\r\n else {\r\n sql = replace(sql, \" DATE \", \" DATETIME \");\r\n }\r\n\r\n\r\n sql = replace(sql,\"ON DELETE NO ACTION\",\"\");\r\n sql = replace(sql,\"ON UPDATE NO ACTION\",\"\");\r\n\r\n if (sql.indexOf(\":COMPANY_CODE\") != -1) {\r\n sql = replace(sql, \":COMPANY_CODE\", \"'\" + vo.getCompanyCode() + \"'\");\r\n }\r\n if (sql.indexOf(\":COMPANY_DESCRIPTION\") != -1) {\r\n sql = replace(sql, \":COMPANY_DESCRIPTION\",\r\n \"'\" + vo.getCompanyDescription() + \"'\");\r\n }\r\n if (sql.indexOf(\":LANGUAGE_CODE\") != -1) {\r\n sql = replace(sql, \":LANGUAGE_CODE\",\r\n \"'\" + vo.getLanguageCode() + \"'\");\r\n }\r\n if (sql.indexOf(\":LANGUAGE_DESCRIPTION\") != -1) {\r\n sql = replace(sql, \":LANGUAGE_DESCRIPTION\",\r\n \"'\" + vo.getLanguageDescription() + \"'\");\r\n }\r\n if (sql.indexOf(\":CLIENT_LANGUAGE_CODE\") != -1) {\r\n sql = replace(sql, \":CLIENT_LANGUAGE_CODE\",\r\n \"'\" + vo.getClientLanguageCode() + \"'\");\r\n }\r\n if (sql.indexOf(\":PASSWORD\") != -1) {\r\n sql = replace(sql, \":PASSWORD\", \"'\" + vo.getAdminPassword() + \"'\");\r\n }\r\n if (sql.indexOf(\":DATE\") != -1) {\r\n sql = replace(sql, \":DATE\", \"?\");\r\n vals.add(new java.sql.Date(System.currentTimeMillis()));\r\n }\r\n\r\n if (sql.indexOf(\":CURRENCY_CODE\") != -1) {\r\n sql = replace(sql, \":CURRENCY_CODE\", \"'\" + vo.getCurrencyCodeREG03() + \"'\");\r\n }\r\n if (sql.indexOf(\":CURRENCY_SYMBOL\") != -1) {\r\n sql = replace(sql, \":CURRENCY_SYMBOL\", \"'\" + vo.getCurrencySymbolREG03() + \"'\");\r\n }\r\n if (sql.indexOf(\":DECIMALS\") != -1) {\r\n sql = replace(sql, \":DECIMALS\", vo.getDecimalsREG03().toString());\r\n }\r\n if (sql.indexOf(\":DECIMAL_SYMBOL\") != -1) {\r\n sql = replace(sql, \":DECIMAL_SYMBOL\", \"'\" + vo.getDecimalSymbolREG03() + \"'\");\r\n }\r\n if (sql.indexOf(\":THOUSAND_SYMBOL\") != -1) {\r\n sql = replace(sql, \":THOUSAND_SYMBOL\", \"'\" + vo.getThousandSymbolREG03() + \"'\");\r\n }\r\n\r\n if (sql.indexOf(\":USE_VARIANT_TYPE_1\") != -1) {\r\n sql = replace(sql, \":USE_VARIANT_TYPE_1\", \"'\" + vo.getUseVariantType1() + \"'\");\r\n }\r\n if (sql.indexOf(\":USE_VARIANT_TYPE_2\") != -1) {\r\n sql = replace(sql, \":USE_VARIANT_TYPE_2\", \"'\" + vo.getUseVariantType2() + \"'\");\r\n }\r\n if (sql.indexOf(\":USE_VARIANT_TYPE_3\") != -1) {\r\n sql = replace(sql, \":USE_VARIANT_TYPE_3\", \"'\" + vo.getUseVariantType3() + \"'\");\r\n }\r\n if (sql.indexOf(\":USE_VARIANT_TYPE_4\") != -1) {\r\n sql = replace(sql, \":USE_VARIANT_TYPE_4\", \"'\" + vo.getUseVariantType4() + \"'\");\r\n }\r\n if (sql.indexOf(\":USE_VARIANT_TYPE_5\") != -1) {\r\n sql = replace(sql, \":USE_VARIANT_TYPE_5\", \"'\" + vo.getUseVariantType5() + \"'\");\r\n }\r\n\r\n if (sql.indexOf(\":VARIANT_1\") != -1) {\r\n sql = replace(sql, \":VARIANT_1\", \"'\" + (vo.getVariant1()==null || vo.getVariant1().trim().equals(\"\")?ApplicationConsts.JOLLY:vo.getVariant1()) + \"'\");\r\n }\r\n if (sql.indexOf(\":VARIANT_2\") != -1) {\r\n sql = replace(sql, \":VARIANT_2\", \"'\" + (vo.getVariant2()==null || vo.getVariant2().trim().equals(\"\")?ApplicationConsts.JOLLY:vo.getVariant2()) + \"'\");\r\n }\r\n if (sql.indexOf(\":VARIANT_3\") != -1) {\r\n sql = replace(sql, \":VARIANT_3\", \"'\" + (vo.getVariant3()==null || vo.getVariant3().trim().equals(\"\")?ApplicationConsts.JOLLY:vo.getVariant3()) + \"'\");\r\n }\r\n if (sql.indexOf(\":VARIANT_4\") != -1) {\r\n sql = replace(sql, \":VARIANT_4\", \"'\" + (vo.getVariant4()==null || vo.getVariant4().trim().equals(\"\")?ApplicationConsts.JOLLY:vo.getVariant4()) + \"'\");\r\n }\r\n if (sql.indexOf(\":VARIANT_5\") != -1) {\r\n sql = replace(sql, \":VARIANT_5\", \"'\" + (vo.getVariant5()==null || vo.getVariant5().trim().equals(\"\")?ApplicationConsts.JOLLY:vo.getVariant5()) + \"'\");\r\n }\r\n\r\n if (!useDefaultValue)\r\n while((pos=sql.indexOf(\"DEFAULT \"))!=-1) {\r\n defaultValue = sql.substring(pos, sql.indexOf(\",\", pos));\r\n sql = replace(\r\n sql,\r\n defaultValue,\r\n \"\"\r\n );\r\n }\r\n\r\n fkFound = false;\r\n while((pos=sql.indexOf(\"FOREIGN KEY\"))!=-1) {\r\n oldfk = sql.substring(pos,sql.indexOf(\")\",sql.indexOf(\")\",pos)+1)+1);\r\n sql = replace(\r\n sql,\r\n oldfk,\r\n \"\"\r\n );\r\n newfk = new StringBuffer(\"ALTER TABLE \");\r\n newfk.append(sql.substring(sql.indexOf(\" TABLE \")+7,sql.indexOf(\"(\")).trim());\r\n newfk.append(\" ADD \");\r\n newfk.append(oldfk);\r\n fks.add(newfk);\r\n fkFound = true;\r\n }\r\n\r\n if (fkFound)\r\n sql = removeCommasAtEnd(sql);\r\n\r\n indexFound = false;\r\n while((pos=sql.indexOf(\"INDEX \"))!=-1) {\r\n oldIndex = sql.substring(pos,sql.indexOf(\")\",pos)+1);\r\n sql = replace(\r\n sql,\r\n oldIndex,\r\n \"\"\r\n );\r\n newIndex = new StringBuffer(\"CREATE \");\r\n newIndex.append(oldIndex.substring(0,oldIndex.indexOf(\"(\")));\r\n newIndex.append(\" ON \");\r\n newIndex.append(sql.substring(sql.indexOf(\" TABLE \")+7,sql.indexOf(\"(\")).trim());\r\n newIndex.append( oldIndex.substring(oldIndex.indexOf(\"(\")) );\r\n indexes.add(newIndex);\r\n indexFound = true;\r\n }\r\n\r\n if (indexFound)\r\n sql = removeCommasAtEnd(sql);\r\n\r\n // check for unicode chars...\r\n while((index=sql.indexOf(\"\\\\u\"))!=-1) {\r\n for(int i=index+2;i<Math.min(sql.length(),index+2+6);i++)\r\n if (Character.isDigit(sql.charAt(i)) ||\r\n sql.charAt(i)=='A' ||\r\n sql.charAt(i)=='B' ||\r\n sql.charAt(i)=='C' ||\r\n sql.charAt(i)=='D' ||\r\n sql.charAt(i)=='E' ||\r\n sql.charAt(i)=='F')\r\n if (unicode.length() < 4)\r\n unicode.append(sql.charAt(i));\r\n else\r\n break;\r\n if (unicode.length()>0) {\r\n sql.delete(index, index+1+unicode.length());\r\n sql.setCharAt(index, new Character((char)Integer.valueOf(unicode.toString(),16).intValue()).charValue());\r\n unicode.delete(0, unicode.length());\r\n }\r\n }\r\n\r\n\r\n if (sql.toString().toUpperCase().contains(\"DROP TABLE\")) {\r\n // remove fks before dropping table!\r\n String table = sql.toString().toUpperCase().replace('\\n',' ').replace('\\r',' ').trim();\r\n table = table.substring(10).trim();\r\n if (table.endsWith(\";\"))\r\n table = table.substring(0,table.length()-1);\r\n ResultSet rset = conn.getMetaData().getExportedKeys(null,vo.getUsername().toUpperCase(),table);\r\n String fkName = null;\r\n String tName = null;\r\n Statement stmt2 = conn.createStatement();\r\n boolean fksFound = false;\r\n while(rset.next()) {\r\n fksFound = true;\r\n tName = rset.getString(7);\r\n fkName = rset.getString(12);\r\n\r\n if (vo.getDriverName().equals(\"com.mysql.jdbc.Driver\"))\r\n stmt2.execute(\"ALTER TABLE \"+tName+\" DROP FOREIGN KEY \"+fkName);\r\n else\r\n stmt2.execute(\"ALTER TABLE \"+tName+\" DROP CONSTRAINT \"+fkName);\r\n }\r\n try {\r\n rset.close();\r\n }\r\n catch (Exception ex6) {}\r\n\r\n if (!fksFound &&\r\n !vo.getDriverName().equals(\"oracle.jdbc.driver.OracleDriver\") &&\r\n !vo.getDriverName().equals(\"com.microsoft.jdbc.sqlserver.SQLServerDriver\") &&\r\n !vo.getDriverName().equals(\"com.microsoft.sqlserver.jdbc.SQLServerDriver\") &&\r\n !vo.getDriverName().equals(\"com.mysql.jdbc.Driver\")\r\n && !vo.getDriverName().equals(\"org.sqlite.JDBC\")) {\r\n // case postgres...\r\n rset = conn.getMetaData().getExportedKeys(null,null,null);\r\n while(rset.next()) {\r\n if (rset.getString(3).toUpperCase().equals(table)) {\r\n tName = rset.getString(7);\r\n fkName = rset.getString(12);\r\n\r\n if (vo.getDriverName().equals(\"com.mysql.jdbc.Driver\"))\r\n stmt2.execute(\"ALTER TABLE \"+tName+\" DROP FOREIGN KEY \"+fkName);\r\n else\r\n stmt2.execute(\"ALTER TABLE \"+tName+\" DROP CONSTRAINT \"+fkName);\r\n }\r\n }\r\n try {\r\n rset.close();\r\n }\r\n catch (Exception ex6) {}\r\n }\r\n\r\n try {\r\n stmt2.close();\r\n }\r\n catch (Exception ex6) {}\r\n\r\n } // end if\r\n\r\n if (sql.toString().trim().length()>0) {\r\n String query = sql.toString().substring(0,sql.length() - 1);\r\n System.out.println(\"Execute query: \" + query);\r\n pstmt = conn.prepareStatement(query);\r\n for (int i = 0; i < vals.size(); i++) {\r\n pstmt.setObject(i + 1, vals.get(i));\r\n }\r\n\r\n try {\r\n pstmt.execute();\r\n }\r\n catch (SQLException ex4) {\r\n try {\r\n if (sql.toString().toUpperCase().contains(\"DROP TABLE\")) {\r\n//\t\t\t\t\t\t\t\t\tLogger.error(\"NONAME\", this.getClass().getName(), \"executeSQL\",\r\n//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"Invalid SQL: \" + sql, ex4);\r\n }\r\n else\r\n throw ex4;\r\n }\r\n catch (Exception exx4) {\r\n throw ex4;\r\n }\r\n }\r\n pstmt.close();\r\n }\r\n\r\n sql.delete(0, sql.length());\r\n vals.clear();\r\n }\r\n }\r\n br.close();\r\n\r\n for(int i=0;i<fks.size();i++) {\r\n sql = (StringBuffer)fks.get(i);\r\n pstmt = conn.prepareStatement(sql.toString());\r\n try {\r\n pstmt.execute();\r\n }\r\n catch (SQLException ex4) {\r\n Logger.error(\"NONAME\", this.getClass().getName(), \"executeSQL\",\r\n \"Invalid SQL: \" + sql, ex4);\r\n }\r\n pstmt.close();\r\n }\r\n\r\n for(int i=0;i<indexes.size();i++) {\r\n sql = (StringBuffer)indexes.get(i);\r\n pstmt = conn.prepareStatement(sql.toString());\r\n try {\r\n pstmt.execute();\r\n }\r\n catch (SQLException ex3) {\r\n Logger.error(\"NONAME\", this.getClass().getName(), \"executeSQL\",\r\n \"Invalid SQL: \" + sql, ex3);\r\n }\r\n pstmt.close();\r\n }\r\n\r\n conn.commit();\r\n\r\n }\r\n catch (Throwable ex) {\r\n try {\r\n Logger.error(\"NONAME\", this.getClass().getName(), \"executeSQL\",\r\n \"Invalid SQL: \" + sql, ex);\r\n }\r\n catch (Exception ex2) {\r\n }\r\n throw ex;\r\n }\r\n finally {\r\n try {\r\n if (pstmt!=null)\r\n pstmt.close();\r\n }\r\n catch (SQLException ex1) {\r\n }\r\n }\r\n }", "public DaoFileImpl(String path) {\r\n\t\tgson = new Gson();\r\n\t\tthis.path = path;\r\n\t\tthis.daoMap = new HashMap<>();\r\n\t\treadMapFromFile();\r\n\t}", "private void createDbRecords() throws IOException, JAXBException {\n }", "public DbRecord( String szFileName )\n throws FileNotFoundException, NullPointerException, AppException\n {\n Load( szFileName );\n }", "public interface IFileDao extends CrudDao<IFileEntity, IFileDto, Long> {\n\n IFileEntity createFile();\n\n Long saveFileUsingStream(IFileEntity fileEntity, InputStream inputStream) throws Exception;\n\n void writeFileContent(Long fileId, OutputStream outputStream) throws Exception;\n}", "public interface IFileDataTypeReader {\n\t\n\t Map<String, String> getColumnAndDataType(String fileName, ExtendedDetails dbDetails) throws ZeasException;\n\t\n\t List<List<String>> getColumnValues() throws ZeasException;\n}", "public void toSql(String baseDir, String out) throws IOException {\n Path pBase = Paths.get(baseDir);\n final String format = \"insert into files values(null,'%s','%s');\";\n List<String> files = new ArrayList<>();\n Files.walkFileTree(pBase, new SimpleFileVisitor<Path>() {\n @Override\n public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {\n String fileName = file.getFileName().toString();\n String path = file.toAbsolutePath().toString();\n if (filter(path) || filter(fileName)) {\n return FileVisitResult.CONTINUE;\n }\n if (fileName.length() > 128 || path.length() > 8096) {\n System.out.println(String.format(\"warning : %s %s exced the limit\", fileName, path));\n }\n\n\n String insert = String.format(format, fileName, path);\n files.add(insert);\n if (files.size() >= 10240) {\n write2File(out, files);\n files.clear();\n }\n return FileVisitResult.CONTINUE;\n }\n });\n write2File(out, files);\n }", "String getSchemaFile();", "public interface IWritableDatabase2 {\r\n\r\n\t/**\r\n\t * Add database links between tokens found a file, and the file path itself. \r\n\t * \r\n\t * @param strings A unique list of valid white-space separated tokens contained within a file\r\n\t * @param f The file containing the tokens\r\n\t * @param ignoreCase Whether to ignore the case of the tokens (always false?)\t * \r\n\t * @param debug Currently unused debug id\r\n\t */\r\n\tpublic void addBulkLinks(List<String> strings, boolean ignoreCase, File f, int debug);\t\t\r\n\r\n\t/** Once complete, write to the database. */\r\n\tpublic void writeDatabase();\r\n}", "public DataBase(String file) throws IOException {\n\t\tdataBase = new RandomAccessFile(file, \"rw\");\n\t\tdataBase.writeBytes(\"FEATURE_ID|FEATURE_NAME|FEATURE_CLASS|STATE_ALPHA|\"\n\t\t\t\t+ \"STATE_NUMERIC|COUNTY_NAME|COUNTY_NUMERIC|PRIMARY_LAT_DMS|PRIM_LONG_DMS|\"\n\t\t\t\t+ \"PRIM_LAT_DEC|PRIM_LONG_DEC|SOURCE_LAT_DMS|SOURCE_LONG_DMS|SOURCE_LAT_DEC|\"\n\t\t\t\t+ \"SOURCE_LONG_DEC|ELEV_IN_M|ELEV_IN_FT|MAP_NAME|DATE_CREATED|DATE_EDITED\\n\");\n\t}", "@Override\n\tpublic void onCreate(SQLiteDatabase db) {\n\t\tStringBuffer sb = new StringBuffer(\"create table fileinfo ( \");\n\t\tsb.append(\"id integer primary key autoincrement , \");\n\t\tsb.append(\"name varchar(20) , \");\n\t\tsb.append(\"fileurl varchar(60) ,\");\n\t\tsb.append(\"path varchar(60) , \");\n\t\tsb.append(\"size varchar(30) , \");\n\t\tsb.append(\"time varchar(30)\");\n\t\tsb.append(\")\");\n\t\ttry {\n\t\t\tdb.execSQL(sb.toString());\n\t\t\tLog.d(\"TAG\", \"创建数据库表成功\");\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t}", "public interface DBStructure {\n\n String save(DataSource dataSource);\n\n void update(DataSource dataSource, String fileMask) throws UpdateException;\n\n void dropAll(DataSource dataSource) throws DropAllException;\n\n String getSqlScript(DataSource dataSource);\n\n void unlock(DataSource dataSource);\n}", "public abstract String createDBString();", "public void run() throws DatabaseException, FileNotFoundException {\n new File(FileName).delete();\n\n // Create the database object.\n // There is no environment for this simple example.\n DatabaseConfig config = new DatabaseConfig();\n config.setErrorStream(System.err);\n config.setErrorPrefix(\"BulkAccessExample\");\n config.setType(DatabaseType.BTREE);\n config.setAllowCreate(true);\n config.setMode(0644);\n Database table = new Database(FileName, null, config);\n\n //\n // Insert records into the database, where the key is the user\n // input and the data is the user input in reverse order.\n //\n InputStreamReader reader = new InputStreamReader(System.in);\n\n for (;;) {\n String line = askForLine(reader, System.out, \"input> \");\n if (line == null || (line.compareToIgnoreCase(\"end\") == 0))\n break;\n\n String reversed = (new StringBuffer(line)).reverse().toString();\n\n // See definition of StringEntry below\n //\n StringEntry key = new StringEntry(line);\n StringEntry data = new StringEntry(reversed);\n\n try {\n if (table.putNoOverwrite(null, key, data) == OperationStatus.KEYEXIST)\n System.out.println(\"Key \" + line + \" already exists.\");\n } catch (DatabaseException dbe) {\n System.out.println(dbe.toString());\n }\n System.out.println(\"\");\n }\n\n // Acquire a cursor for the table.\n Cursor cursor = table.openCursor(null, null);\n DatabaseEntry foo = new DatabaseEntry();\n\n MultipleKeyDataEntry bulk_data = new MultipleKeyDataEntry();\n bulk_data.setData(new byte[1024 * 1024]);\n bulk_data.setUserBuffer(1024 * 1024, true);\n\n // Walk through the table, printing the key/data pairs.\n //\n while (cursor.getNext(foo, bulk_data, null) == OperationStatus.SUCCESS) {\n StringEntry key, data;\n key = new StringEntry();\n data = new StringEntry();\n\n while (bulk_data.next(key, data))\n System.out.println(key.getString() + \" : \" + data.getString());\n }\n cursor.close();\n table.close();\n }", "public abstract void loadFromDatabase();", "public String getDbTable() {return dbTable;}", "public void putFile(Connection conn, File cond) throws Exception{\n\t//System.out.println(cond);\n\t//Check for LFN\n\tString LFN = cond.getLogicalFileName ( );\n\tif(LFN == null || LFN==\"\") throw new DBSException(\"Input Data Error\", \"LogicalFileName is expected.\");\n\t//Check is_file_valid\n\tint fileValid = cond.getIsFileValid( );\n if(fileValid == -1) throw new DBSException(\"Input Data Error\", \"Validation of File is expected.\");\n\t//Check if Datset already in db\n\tDataset ds = cond.getDatasetDO();\n\t//System.out.println(ds);\n\tif(ds == null)throw new DBSException(\"Input Data Error\", \"Dataset is expected.\");\n\tif(ds.getDatasetID( ) == 0){\n\t String dsName = ds.getDataset();\n\t if((dsName == null) || (dsName==\"\"))throw new DBSException(\"Input Data Error\", \"Dataset name is missing\");\n\t JSONArray dss = (new DatasetQO()).listDatasets(conn, ds);\n\t if(dss.length() != 1)\n\t\tthrow new DBSException(\"Input Data Error\", \"dataset name :\" + dsName \n\t\t+\" is not found or more than one found in the db.\");\n\t else{ \n\t\tds.setDatasetID(((Dataset)dss.getJSONObject(0)).getDatasetID());\n\t\t//ds.setDataset(((Dataset)dss.getJSONObject(0)).getDataset());\n\t }\n\t}\n //System.out.println(cond);\n\tBlock bk = cond.getBlockDO();\n\tif(bk == null) throw new DBSException(\"Input Data Error\", \"Block is expected.\");\n\tif(bk.getBlockID() == 0){\n\t String bkName = bk.getBlockName();\n\t if(bkName == null || bkName == \"\")throw new DBSException(\"Input Data Error\", \"Block name is missing\");\n\t JSONArray bks = (new BlockQO()).listBlocks(conn, bk);\n\t if(bks.length() != 1 )\n\t\tthrow new DBSException(\"Input Data Error\", \"More than one or no Blocks are found in the db with name: \"\n\t\t + bkName);\n\t else {\n\t\tbk.setBlockID(((Block)bks.getJSONObject(0)).getBlockID());\n\t\t//System.out.println(\"Block : \" + bk);\n\t }\n\t}\n\t//\n\t//System.out.println(\"Check for file_type\");\n\tFileType ft = cond.getFileTypeDO();\n if(ft == null)throw new DBSException(\"Input Data Error\", \"File type is expected.\");\n if(ft.getFileTypeID( ) == 0){\n String ftName = ft.getFileType();\n if((ftName == null) || (ftName == \"\"))throw new DBSException(\"Input Data Error\", \"File type is missing\");\n JSONArray fts = (new FileTypeQO()).listFileTypes(conn, ft);\n if(fts.length() != 1)\n throw new DBSException(\"Input Data Error\", \"File type :\" + ftName\n +\" is not found or more than one found in the db.\");\n else\n ft.setFileTypeID(((FileType)fts.getJSONObject(0)).getFileTypeID());\n }\n\t//System.out.println(\"File type: \" + ft);\n\t//check for Primary key\n\tint fileID = cond.getFileID ( );\n\tif(fileID == 0){\n\t try{\n\t\tfileID = SequenceManager.getSequence(conn, \"SEQ_FL\");\n\t\tcond. setFileID(fileID);\n\t }catch (SQLException ex) {\n\t\tthrow ex;\n\t }\n\t}\n\t//\n\t//System.out.println(\"Check for check-sum\");\n\tString cs = cond.getCheckSum();\n if(cs == null || cs == \"\")throw new DBSException(\"Input Data Error\", \"File check-sum is expected.\");\n\t//check for event_count\n\tif (cond.getEventCount() == -1) throw new DBSException(\"Input Data Error\", \"File event count is expected.\");\n\t//check for file size\n\tif(cond.getFileSize() == -1) throw new DBSException(\"Input Data Error\", \"File size is expected.\");\n\t//System.out.println(\"Check for creation_date and created_by. \\n\");\n\tlong createDate = cond.getCreationDate( );\n\tString createdBy = cond.getCreateBy( );\n\t//System.out.println(\"****File**** \" + cond);\n\tif(createDate == 0)cond.setCreationDate(DBSSrvcUtil.getEpoch());\n if(createdBy == null || createdBy==\"\")cond.setCreateBy(\"WeNeed2FindWhoDidIt\");\n\t \t\n\t//Now we are ready to insert into the dataset\n\t//System.out.println(\"Ready to insert file :\" + cond);\n\tinsertTable(conn, cond, \"FILES\");\n }", "public int getDbType();", "int insert(DiaryFile record);", "@Repository\npublic interface DBFileRepository extends JpaRepository<DBFile, Long> {\n\n}", "public DataWriter(String dbPath) {\n databasePath = dbPath;\n }", "public DB(String db) throws ClassNotFoundException, SQLException {\n // Set up a connection and store it in a field\n Class.forName(\"org.sqlite.JDBC\");\n String url = \"jdbc:sqlite:\" + db;\n\n // stop conn from creating a file if does not exists\n SQLiteConfig config = new SQLiteConfig();\n config.resetOpenMode(SQLiteOpenMode.CREATE);\n\n //connect to the file\n conn = DriverManager.getConnection(url, config.toProperties());\n try (Statement stat = conn.createStatement();) {\n stat.executeUpdate(\"PRAGMA foreign_keys = ON;\");\n }\n }", "public Dataset openTDB(String directory){\n Dataset dataset = TDBFactory.createDataset(directory);\n return dataset;\n}", "public ProjectFilesDAOImpl() {\r\n super();\r\n }", "int insert(FileRecordAdmin record);", "public void writeDatabase();", "public static boolean addFile(TranslationFile bf) {\n System.out.println(\"File added to database.\");\n DatabaseOperations.addOrUpdateFileName(bf.getFileID(), bf.getFileName());\n String sql = \"INSERT OR REPLACE INTO corpus1(id, fileID, fileName, thai, english, committed, removed, rank) VALUES(?,?,?,?,?,?,?,?)\";\n\n try (Connection conn = DatabaseOperations.connect();\n PreparedStatement pstmt = conn.prepareStatement(sql)) {\n\n conn.setAutoCommit(false);\n\n // this makes sure that the segments in the file, when retrieved from the db, can be ordered in the proper order.\n // simply increments by 1 on each segment. \n int rank = 0;\n // keeps count of the number of segs added so that the SQL can run a batch transaction (which is much more efficient than individual transactions).\n // when i=1000, or at the last segment, the SQL is then run as one batch transaction.\n int i = 0;\n\n for (Segment seg : bf.getActiveSegs()) {\n\n pstmt.setDouble(1, seg.getID());\n pstmt.setDouble(2, seg.getFileID());\n pstmt.setString(3, seg.getFileName());\n pstmt.setString(4, seg.getThai());\n pstmt.setString(5, seg.getEnglish());\n // committed/removed booleans are stored as binary (0 = false, 1 = true)\n pstmt.setInt(6, seg.isCommitted() ? 1 : 0);\n // removed is set to \"false\"\n pstmt.setInt(7, 0);\n pstmt.setInt(8, rank);\n pstmt.addBatch();\n rank++;\n i++;\n\n if (i % 1000 == 0 || i == bf.getActiveSegs().size()) {\n pstmt.executeBatch(); //Execute every 1000 segments.\n }\n }\n\n // resetting counters\n i = 0;\n rank = 0;\n for (Segment seg : bf.getHiddenSegs()) {\n\n pstmt.setDouble(1, seg.getID());\n pstmt.setDouble(2, seg.getFileID());\n pstmt.setString(3, seg.getFileName());\n pstmt.setString(4, seg.getThai());\n pstmt.setString(5, seg.getEnglish());\n // committed/removed booleans are stored as binary (0 = false, 1 = true)\n pstmt.setInt(6, seg.isCommitted() ? 1 : 0);\n // removed is set to \"true\"\n pstmt.setInt(7, 1);\n pstmt.setInt(8, rank);\n pstmt.addBatch();\n rank++;\n i++;\n\n if (i % 1000 == 0 || i == bf.getHiddenSegs().size()) {\n pstmt.executeBatch(); //Execute every 1000 segments.\n }\n }\n conn.commit();\n return true;\n\n } catch (SQLException e) {\n System.out.println(\"AddFileAsBatch: \" + e.getMessage());\n return false;\n }\n }", "public long insert(FFileInputDO FFileInput) throws DataAccessException;", "private TexeraDb() {\n super(\"texera_db\", null);\n }", "private static void readDatabase(String path) {\n try {\n FileInputStream fileIn = new FileInputStream(path + \"/database.ser\");\n ObjectInputStream inStream = new ObjectInputStream(fileIn);\n database = (Database) inStream.readObject();\n inStream.close();\n fileIn.close();\n } catch (IOException i) {\n i.printStackTrace();\n } catch (ClassNotFoundException c) {\n c.printStackTrace();\n }\n }", "public DBFWriter(File dbfFile) throws Exception {\r\n\r\n\t\ttry {\r\n\r\n\t\t\tthis.raf = new RandomAccessFile(dbfFile, \"rw\");\r\n\t\t\tFileChannel fileChannel = this.raf.getChannel();\r\n\t\t\twhile (true) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tlock = fileChannel.lock();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} catch (OverlappingFileLockException e) {\r\n\t\t\t\t\tThread.sleep(2);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tthrow new Exception(e.getMessage());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t/*\r\n\t\t\t * before proceeding check whether the passed in File object is an\r\n\t\t\t * empty/non-existent file or not.\r\n\t\t\t */\r\n\t\t\tif (!dbfFile.exists() || dbfFile.length() == 0) {\r\n\t\t\t\tthis.header = new DBFHeader();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\theader = new DBFHeader();\r\n\t\t\tthis.header.read(raf);\r\n\r\n\t\t\t// back 5 char\r\n\t\t\tthis.raf.seek(this.raf.length() - 10);\r\n\t\t\tlong logEofIndex = 0;\r\n\t\t\twhile (true) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\t// the end byte 26\r\n\t\t\t\t\tif (this.raf.readByte() == 26) {\r\n\t\t\t\t\t\tlogEofIndex = this.raf.getFilePointer();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (EOFException ioe) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (logEofIndex == 0) {\r\n\t\t\t\tlogEofIndex = this.raf.length();\r\n\t\t\t} else {\r\n\t\t\t\tlogEofIndex--;\r\n\t\t\t}\r\n\t\t\t/* position file pointer at the end of the raf */\r\n\t\t\tthis.raf.seek(logEofIndex);\r\n\t\t\t// this.raf.seek( this.raf.length()-1 /* to ignore the END_OF_DATA\r\n\t\t\t// byte at EoF */);\r\n\r\n\t\t} catch (FileNotFoundException e) {\r\n\r\n\t\t\tthrow new DBFException(\"Specified file is not found. \" + e.getMessage());\r\n\t\t} catch (IOException e) {\r\n\r\n\t\t\tthrow new DBFException(e.getMessage() + \" while reading header\");\r\n\t\t}\r\n\t\tthis.recordCount = this.header.numberOfRecords;\r\n\t}", "public String getDbpediaFile() {\n\t\treturn DBPEDIA_FILE;\n\t}", "@Override\n public String getDbString() {\n return null;\n }", "public SimpleDatabase executeSqlFile(SQLiteDatabase db, @RawRes int id) {\n Scanner scan = context.openInternalFileScanner(id);\n String query = \"\";\n if (logging) Log.d(\"SimpleDB\", \"start reading file\");\n int queryCount = 0;\n while (scan.hasNextLine()) {\n String line = scan.nextLine().trim();\n if (line.startsWith(\"--\") || line.isEmpty()) {\n continue;\n } else {\n query += line + \"\\n\";\n }\n\n if (query.endsWith(\";\\n\")) {\n if (logging) Log.d(\"SimpleDB\", \"query: \\\"\" + query + \"\\\"\");\n db.execSQL(query);\n query = \"\";\n queryCount++;\n }\n }\n if (logging) Log.d(\"SimpleDB\", \"done reading file\");\n if (logging) Log.d(\"SimpleDB\", \"performed \" + queryCount + \" queries.\");\n return this;\n }", "public interface DbIterator {\n /**\n * Opens the iterator.\n * @throws NoSuchElementException when the iterator has no elements.\n * @throws DbException when there are problems opening/accessing the database.\n */\n public void open() throws NoSuchElementException, DbException, TransactionAbortedException;\n\n /**\n * Gets the next tuple from the operator (typically implementing by reading\n * from a child operator or an access method).\n *\n * @return The next tuple in the iterator.\n */\n public Tuple getNext() throws TransactionAbortedException;\n\n /**\n * Resets the iterator to the start.\n * @throws DbException When rewind is unsupported.\n */\n public void rewind() throws DbException, TransactionAbortedException;\n\n /**\n * Returns the TupleDesc associated with this DbIterator.\n */\n public TupleDesc getTupleDesc();\n\n /**\n * Closes the iterator.\n */\n public void close();\n}", "public boolean writePlicSnapshotToFile(File f, String dbSchema, String dataSource){\n try{\n //Obtener la conexion JDBC del proyecto\n InitialContext ctx = new InitialContext();\n DataSource ds = (DataSource) ctx.lookup(dataSource);\n Connection connection = ds.getConnection();\n\n\t String query = \"SELECT '\\\"'||REPLACE(COALESCE(globaluniqueidentifier,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(scientificname,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(institutioncode,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||COALESCE(to_char(datelastmodified,'YYYY-MM-DD HH24:MI:SS'),'')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(taxonrecordid,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(language,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(creators,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(distribution,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(abstract,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(kingdomtaxon,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(phylumtaxon,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(classtaxon,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(ordertaxon,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(familytaxon,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(genustaxon,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(synonyms,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(authoryearofscientificname,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(speciespublicationreference,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(commonnames,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(typification,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(contributors,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||COALESCE(to_char(datecreated,'YYYY-MM-DD'),'')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(habit,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(lifecycle,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(reproduction,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(annualcycle,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(scientificdescription,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(briefdescription,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(feeding,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(behavior,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(interactions,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(chromosomicnumbern,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(moleculardata,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(populationbiology,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(threatstatus,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(legislation,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(habitat,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(territory,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(endemicity,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(theuses,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(themanagement,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(folklore,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(thereferences,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(unstructureddocumentation,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(otherinformationsources,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(papers,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(identificationkeys,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(migratorydata,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(ecologicalsignificance,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(unstructurednaturalhistory,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(invasivenessdata,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(targetaudiences,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(version,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(urlimage1,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(captionimage1,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(urlimage2,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(captionimage2,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(urlimage3,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(captionimage3,''),'\\r\\n', ' ')||'\\\"'\"+\n\t\t\t \" AS aux \"+\n\t\t\t \"FROM \"+dbSchema+\".plic_snapshot;\";\n\n System.out.println(query);\n\n\t\t\tStatement st = connection.createStatement();\n\t\t\tResultSet rs = st.executeQuery(query); \n\n //Imprimir los datos en el archivo\n BufferedWriter out = new BufferedWriter(new FileWriter(f));\n\t\t\twhile (rs.next()) {\n\t\t\t\tout.write(rs.getString(\"aux\")+\"\\n\");\n\t\t\t}\n out.close();\n\n //Cerrar el resultset y el statement\n rs.close();\n\t\t\tst.close();\n\n //Resultado\n return true;\n }\n catch(Exception e){\n e.printStackTrace();\n return false;}\n }", "public interface FilesDAO extends CrudRepository<Files,Long> {\n}", "@Override\r\n\tpublic boolean supportsDb(String type) {\r\n \treturn true;\r\n }", "@SuppressWarnings(\"rawtypes\") \npublic interface FFileInputDAO {\n\t/**\n\t * Insert one <tt>FFileInputDO</tt> object to DB table <tt>f_file_input</tt>, return primary key\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>insert into f_file_input(file_id,file_code,type,form_id,project_code,project_name,customer_id,customer_name,first_loan_time,filing_time,hand_over_dept,hand_over_man,hand_over_time,principal_man,vice_manager,receive_dept,receive_man,receive_time,status,raw_add_time) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)</tt>\n\t *\n\t *\t@param FFileInput\n\t *\t@return long\n\t *\t@throws DataAccessException\n\t */\t \n public long insert(FFileInputDO FFileInput) throws DataAccessException;\n\n\t/**\n\t * Update DB table <tt>f_file_input</tt>.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>update f_file_input set first_loan_time=?, filing_time=?, hand_over_dept=?, hand_over_man=?, hand_over_time=?, principal_man=?, vice_manager=?, receive_dept=?, receive_man=?, receive_time=?, status=? where (input_id = ?)</tt>\n\t *\n\t *\t@param FFileInput\n\t *\t@return int\n\t *\t@throws DataAccessException\n\t */\t \n public int update(FFileInputDO FFileInput) throws DataAccessException;\n\n\t/**\n\t * Query DB table <tt>f_file_input</tt> for records.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>select * from f_file_input where (input_id = ?)</tt>\n\t *\n\t *\t@param inputId\n\t *\t@return FFileInputDO\n\t *\t@throws DataAccessException\n\t */\t \n public FFileInputDO findById(long inputId) throws DataAccessException;\n\n\t/**\n\t * Query DB table <tt>f_file_input</tt> for records.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>select * from f_file_input where (form_id = ?)</tt>\n\t *\n\t *\t@param formId\n\t *\t@return List<FFileInputDO>\n\t *\t@throws DataAccessException\n\t */\t \n public List<FFileInputDO> findByFormId(long formId) throws DataAccessException;\n\n\t/**\n\t * Delete records from DB table <tt>f_file_input</tt>.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>delete from f_file_input where (input_id = ?)</tt>\n\t *\n\t *\t@param inputId\n\t *\t@return int\n\t *\t@throws DataAccessException\n\t */\t \n public int deleteById(long inputId) throws DataAccessException;\n\n\t/**\n\t * Query DB table <tt>f_file_input</tt> for records.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>select * from f_file_input where (1 = 1)</tt>\n\t *\n\t *\t@param FFileInput\n\t *\t@param limitStart\n\t *\t@param pageSize\n\t *\t@return List<FFileInputDO>\n\t *\t@throws DataAccessException\n\t */\t \n public List<FFileInputDO> findByCondition(FFileInputDO FFileInput, long limitStart, long pageSize) throws DataAccessException;\n\n\t/**\n\t * Query DB table <tt>f_file_input</tt> for records.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>select COUNT(*) from f_file_input where (1 = 1)</tt>\n\t *\n\t *\t@param FFileInput\n\t *\t@return long\n\t *\t@throws DataAccessException\n\t */\t \n public long findByConditionCount(FFileInputDO FFileInput) throws DataAccessException;\n\n}", "private static void loadTableData() {\n\n\t\tBufferedReader in = null;\n\t\ttry {\n\t\t\tin = new BufferedReader(new FileReader(dataDir + tableInfoFile));\n\n\t\t\twhile (true) {\n\n\t\t\t\t// read next line\n\t\t\t\tString line = in.readLine();\n\t\t\t\tif (line == null) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tString[] tokens = line.split(\" \");\n\t\t\t\tString tableName = tokens[0];\n\t\t\t\tString tableFileName = tokens[1];\n\n\t\t\t\ttableNameToSchema.put(tableName, new HashMap<String, Type>());\n\t\t\t\ttableNameToOrdredSchema.put(tableName,\n\t\t\t\t\t\tnew ArrayList<ColumnInfo>());\n\n\t\t\t\t// attributes data\n\t\t\t\tfor (int i = 2; i < tokens.length;) {\n\n\t\t\t\t\tString attName = tokens[i++];\n\t\t\t\t\tString attTypeName = (tokens[i++]);\n\n\t\t\t\t\tType attType = null;\n\n\t\t\t\t\t/*\n\t\t\t\t\t * Undefined, how to represent dates, crazy longs probably\n\t\t\t\t\t * won't need this for now...\n\t\t\t\t\t */\n\t\t\t\t\tif (attTypeName.equals(\"CHAR\")) {\n\t\t\t\t\t\tattType = Types.getCharType(Integer\n\t\t\t\t\t\t\t\t.valueOf(tokens[i++]));\n\t\t\t\t\t} else if (attTypeName.equals(\"DATE\")) {\n\t\t\t\t\t\tattType = Types.getDateType();\n\t\t\t\t\t} else if (attTypeName.equals(\"DOUBLE\")) {\n\t\t\t\t\t\tattType = Types.getDoubleType();\n\t\t\t\t\t} else if (attTypeName.equals(\"FLOAT\")) {\n\t\t\t\t\t\tattType = Types.getFloatType();\n\t\t\t\t\t} else if (attTypeName.equals(\"INTEGER\")) {\n\t\t\t\t\t\tattType = Types.getIntegerType();\n\t\t\t\t\t} else if (attTypeName.equals(\"LONG\")) {\n\t\t\t\t\t\tattType = Types.getLongType();\n\t\t\t\t\t} else if (attTypeName.equals(\"VARCHAR\")) {\n\t\t\t\t\t\tattType = Types.getVarcharType();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new RuntimeException(\"Invalid type: \"\n\t\t\t\t\t\t\t\t+ attTypeName);\n\t\t\t\t\t}\n\n\t\t\t\t\ttableNameToSchema.get(tableName).put(attName, attType);\n\n\t\t\t\t\tColumnInfo ci = new ColumnInfo(attName, attType);\n\t\t\t\t\ttableNameToOrdredSchema.get(tableName).add(ci);\n\n\t\t\t\t}\n\n\t\t\t\t// at this point, table info loaded.\n\n\t\t\t\t// Create table\n\t\t\t\tmyDatabase.getQueryInterface().createTable(tableName,\n\t\t\t\t\t\ttableNameToSchema.get(tableName));\n\n\t\t\t\t// Now, load data into newly created table\n\t\t\t\treadTable(tableName, tableFileName);\n\n\t\t\t}\n\n\t\t\tin.close();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tHelpers.print(e.getStackTrace().toString(),\n\t\t\t\t\tutil.Consts.printType.ERROR);\n\t\t}\n\n\t}", "CCDB2IndexFile(CCDB2Driver driver, File filePath) throws IOException\r\n\t{\r\n\t\tfFilePath = filePath;\r\n\t\tfFile = new CCDB2File(driver, fFilePath.getPath(), NULL_BYTE);\r\n\t}", "@Override\n\tpublic void createFile(FileModel file) {\n\t\tString sql = \"INSERT INTO file VALUES (?,?,?,?,?,?,now(),now())\";\n\t\t\n\t\tthis.getJdbcTemplate().update(sql, new Object[] { \n\t\t\t\tfile.getFile_id(),\n\t\t\t\tfile.getFile_path(),\n\t\t\t\tfile.getFile_name(),\n\t\t\t\tfile.getFile_type(),\n\t\t\t\tfile.getFile_size(),\n\t\t\t\tfile.getCretd_usr()\n\t\t});\n\t}", "public interface BerkeleydbDao<T> {\n\n /**\n * open database\n * */\n public void openConnection(String filePath, String databaseName) throws DatabaseException;\n\n /**\n * 关闭数据库\n * */\n public void closeConnection() throws DatabaseException;\n\n /**\n * insert\n * */\n public void save(String name, T t) throws DatabaseException;\n\n /**\n * delete\n * */\n public void delete(String name) throws DatabaseException;\n\n /**\n * update\n * */\n public void update(String name, T t) throws DatabaseException;\n\n /**\n * select\n * */\n public T get(String name) throws DatabaseException;\n\n}", "public String getDbPath() {\r\n return dbPath;\r\n }", "DatabaseInformationFull(Database db) {\n super(db);\n }", "public DbFileIterator iterator(final TransactionId tid) { \t\n// some code goes here\n \t\n \tDbFileIterator dbfi = new DbFileIterator() {\n \tint pgno = 0;\n \tHeapPage currPg = null;\n \tString name = Database.getCatalog().getTableName(getId());\n \tint tblid = Database.getCatalog().getTableId(name);\n \tint open = 0; \t\n \t\n \t//Todo: pass along the tid from the outer method.\n \t//DONE. by making tid param final.\n \tTransactionId m_tid = tid;\n \t\n \tIterator<Tuple> titr = null;\n \t\n\t\t\t@Override\n\t\t\tpublic void rewind() throws DbException, TransactionAbortedException {\n\t\t\t\tclose();\n\t\t\t\topen();\n\t\t\t}\n\t\t\t\n\t\t\tpublic void nextPage() throws DbException, TransactionAbortedException {\n\n\t\t\t\tif (pgno >= numPages())\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tcurrPg = (HeapPage) Database.getBufferPool().getPage(m_tid, new HeapPageId(tblid, pgno), simpledb.Permissions.READ_ONLY);\n\t\t\t\t\ttitr = currPg.iterator();\n\t\t\t\t\tif (titr == null)\n\t\t\t\t\t\tthrow new DbException(\"blah blah blah\");\n\t\t\t\t\tpgno++;\n\t\t\t\t\treturn;\n\t\t\t\t} catch (DbException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tthrow new DbException(\"page was not found or no more iterators..?\");\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void open() throws DbException, TransactionAbortedException {\n\t\t\t\topen = 1;\n\t\t\t\tpgno = 0;\n\t\t\t\tnextPage();\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic Tuple next() throws DbException, TransactionAbortedException,\n\t\t\t\t\tNoSuchElementException {\n\t\t\t\tif (open != 1)\n\t\t\t\t\tthrow new NoSuchElementException();\n\t\t\t\tif (!titr.hasNext())\n\t\t\t\t\tnextPage();\n\t\t\t\treturn titr.next();\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic boolean hasNext() throws DbException, TransactionAbortedException {\n\t\t\t\tif (open !=1)\n\t\t\t\t\treturn false;\n\t\t\t\tif (titr == null) //TODO: remove\n\t\t\t\t\tthrow new DbException(Integer.toString(pgno) + Integer.toString(open) + Integer.toString(numPages()) + m_f.getPath());\n\t\t\t\tif (!titr.hasNext())\n\t\t\t\t\tnextPage();\n\t\t\t\tif (titr.hasNext())\n\t\t\t\t\treturn true;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void close() {\n\t\t\t\topen = 0;\n\t\t\t\ttitr = null;\n\t\t\t}\n\t\t};\n return dbfi;\n }", "@Test(timeout = 4000)\n public void test112() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable(\"O\\\"6T\");\n File file0 = MockFile.createTempFile(\"<*kYz\", \"BLOB\");\n MockPrintWriter mockPrintWriter0 = new MockPrintWriter(file0);\n NameSpec nameSpec0 = NameSpec.ALWAYS;\n SQLUtil.renderCreateTable(defaultDBTable0, true, nameSpec0, mockPrintWriter0);\n assertNull(defaultDBTable0.getDoc());\n }", "public NameSurferDataBase(String filename) {\t\n\t\tnameData(filename);\n\t}", "public void init() {\r\n BufferedReader in = null;\r\n String line;\r\n PreparedStatement iStmt;\r\n String insertStmt = \"INSERT INTO \" + schema + \"ULDSHAPE \"\r\n + \"(SHAPE, ALLHGHT, ALLLENG, ALLWDTH, BIGPIC, DESCR, INTERNALVOLUME, INTHGHT, INTLENG, INTWDTH, \"\r\n + \"MAXGROSSWGHT, RATING, TAREWGHT, THUMBNAIL, UPDATED, UPDTUSER, VERSION) VALUES \"\r\n + \"(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\";\r\n int count = 0;\r\n\r\n LOG.log(Level.INFO, \"Initialize basic Uldshapes in DB from file [{0}]\", path);\r\n\r\n try {\r\n in = new BufferedReader(new InputStreamReader(new FileInputStream(path), StandardCharsets.UTF_8));\r\n\r\n iStmt = conn.prepareStatement(insertStmt);\r\n\r\n while ((line = in.readLine()) != null) {\r\n LOG.finer(line);\r\n\r\n UldshapeVO uldshapeVO = parseUldshape(line);\r\n\r\n iStmt.setString(1, uldshapeVO.getShape());\r\n iStmt.setInt(2, uldshapeVO.getAllhght());\r\n iStmt.setInt(3, uldshapeVO.getAllleng());\r\n iStmt.setInt(4, uldshapeVO.getAllwdth());\r\n iStmt.setBytes(5, uldshapeVO.getBigpic());\r\n iStmt.setString(6, uldshapeVO.getDescr());\r\n iStmt.setInt(7, uldshapeVO.getInternalvolume());\r\n iStmt.setInt(8, uldshapeVO.getInthght());\r\n iStmt.setInt(9, uldshapeVO.getIntleng());\r\n iStmt.setInt(10, uldshapeVO.getIntwdth());\r\n iStmt.setInt(11, uldshapeVO.getMaxgrosswght());\r\n iStmt.setString(12, uldshapeVO.getRating());\r\n iStmt.setInt(13, uldshapeVO.getTarewght());\r\n iStmt.setBytes(14, uldshapeVO.getThumbnail());\r\n iStmt.setTimestamp(15, DbUtil.getCurrentTimeStamp());\r\n iStmt.setString(16, uldshapeVO.getUpdtuser());\r\n iStmt.setLong(17, 0);\r\n\r\n // execute insert SQL stetement\r\n iStmt.executeUpdate();\r\n\r\n ++count;\r\n }\r\n LOG.log(Level.INFO, \"Finished: [{0}] ULDSHAPES loaded\", count);\r\n\r\n DbUtil.cleanupJdbc();\r\n }\r\n catch (IOException ioex) {\r\n LOG.log(Level.SEVERE, \"An IO error occured. The error message is: {0}\", ioex.getMessage());\r\n }\r\n catch (SQLException ex) {\r\n LOG.log(Level.SEVERE, \"An SQL error occured. The error message is: {0}\", ex.getMessage());\r\n }\r\n finally {\r\n if (in != null) {\r\n try {\r\n in.close();\r\n }\r\n catch (IOException e) {\r\n }\r\n }\r\n }\r\n }", "private void loadDatabase()\n\t{\n\t\ttry\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// Check to make sure the Bmod Database is there, if not, try \n\t\t\t\t// downloading from the website.\n\t\t\t\tif(!Files.exists(m_databaseFile))\n\t\t\t\t{\n\t\t\t\t\tFiles.createDirectories(m_databaseFile.getParent());\n\t\t\t\t\n\t\t\t\t\tbyte[] file = ExtensionPoints.readURLAsBytes(\"http://\" + Constants.API_HOST + HSQL_DATABASE_PATH);\n\t\t\t\t\tif(file.length != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tFiles.deleteIfExists(m_databaseFile);\n\t\t\t\t\t\tFiles.write(m_databaseFile, file, StandardOpenOption.CREATE, StandardOpenOption.WRITE);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// make sure we have the proper scriptformat.\n\t\t\t\tsetScriptFormatCorrectly();\n\t\t\t}catch(NullPointerException|IOException ex)\n\t\t\t{\n\t\t\t\tm_logger.error(\"Could not fetch database from web.\", ex);\n\t\t\t}\n\t\t\t\n\t\n\t\t\t\n\t\t\tClass.forName(\"org.hsqldb.jdbcDriver\");\n\t\t\n\t\t\t\n\t\t\tString db = ExtensionPoints.getBmodDirectory(\"database\").toUri().getPath();\n\t\t\tconnection = DriverManager.getConnection(\"jdbc:hsqldb:file:\" + db, \"sa\", \"\");\n\t\t\t\n\t\t\t// Setup Connection\n\t\t\tCSVRecordLoader ldr = new CSVRecordLoader();\n\t\t\n\t\t\t// Load all of the building independent plugins\n\t\t\tfor(Record<?> cp : ldr.getRecordPluginManagers())\n\t\t\t{\n\t\t\t\tm_logger.debug(\"Creating table: \" + cp.getTableName());\n\t\t\t\t// Create a new table\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tgetPreparedStatement(cp.getSQLTableDefn()).execute();\n\t\t\t\t} catch(SQLException ex)\n\t\t\t\t{\n\t\t\t\t\t// Table exists\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tm_logger.debug(\"Doing index:\" + cp.getIndexDefn());\n\t\t\t\t\tif(cp.getIndexDefn() != null)\n\t\t\t\t\t\tgetPreparedStatement(cp.getIndexDefn()).execute();\n\t\t\t\t}catch(SQLException ex)\n\t\t\t\t{\t// index exists\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\n\t\t} catch (Exception ex)\n\t\t{\n\t\t\tex.printStackTrace();\n\t\t\tif(ex instanceof DatabaseIntegrityException)\n\t\t\t\tDatabase.handleCriticalError((DatabaseIntegrityException)ex);\n\t\t\telse\n\t\t\t\tDatabase.handleCriticalError(new DatabaseIntegrityException(ex));\n\t\t}\n\t\t\n\t}", "public static void createNewDatabaseFile(String startPath)\r\n throws ConnectionFailedException, DatabaseException {\r\n boolean databaseCreated;\r\n try {\r\n databaseCreated = database.createNewFile();\r\n if (!databaseCreated) {\r\n throw new IOException(\"Cannot create file\");\r\n }\r\n\r\n URL databaseResource = Objects.requireNonNull(Paths.get(\r\n startPath + \"resources/database/database.sql\").toUri().toURL());\r\n String decodedPath = URLDecoder.decode(databaseResource.getPath(), \"UTF-8\");\r\n\r\n try (BufferedReader in = new BufferedReader(new FileReader(decodedPath))) {\r\n StringBuilder sqlQuery = new StringBuilder();\r\n while (in.ready()) {\r\n sqlQuery.append(in.readLine());\r\n if (sqlQuery.toString().endsWith(\";\")) {\r\n createBasicSqlTable(sqlQuery.toString());\r\n sqlQuery = new StringBuilder();\r\n }\r\n }\r\n }\r\n } catch (IOException e) {\r\n throwException(e);\r\n }\r\n }", "private String getDatabaseFilePath(NotesDatabase db) {\n try {\n return db.getFilePath();\n } catch (RepositoryException ex) {\n LOGGER.log(Level.WARNING, \"Unable to retrieve database's file path\", ex);\n return null;\n }\n }", "public Table readTable(String pathName, String filename){\n File file = new File(pathName + filename);\n Table newTable = null;\n Scanner sc; \n //foreign key aspects\n Boolean hasForeignKey = false;\n ArrayList<String> FKIndex; \n String[] line; \n String primaryTableName = \"\", primaryColName = \"\", colName = \"\"; \n String name = \"\";\n\n try {\n sc = new Scanner(file);\n } catch(FileNotFoundException ex) {\n System.out.println(\"ERROR: file not found\");\n return null;\n }\n\n //get table name - always first line\n if (sc.hasNextLine()){\n name = sc.nextLine();\n }\n\n FKIndex = getForeignKeyIndex(pathName);\n //loop over all rows in FKIndex, and check if table has a foreign key\n if(!FKIndex.isEmpty()){\n for(int i = 0; i < FKIndex.size(); i++){\n line = FKIndex.get(i).split(\"\\\\s\"); \n if (line[2].equals(name)){\n hasForeignKey = true;\n primaryTableName = line[0];\n primaryColName = line[1];\n colName = line[3];\n }\n }\n }\n\n //get col names - always second line\n if (sc.hasNextLine()){\n String colNamesString = sc.nextLine();\n //split colNames into individual words as Strings based on whitespace\n String[] colNames = colNamesString.split(\"\\\\s\");\n\n //make table with column names\n if (hasForeignKey){\n newTable = new Table(name, primaryTableName, primaryColName, colName, true, colNames);\n } else {\n newTable = new Table(name, colNames);\n }\n\n //add rows from file (each line)\n while(sc.hasNextLine()){\n String newRowString = sc.nextLine();\n String[] newRow = newRowString.split(\"\\\\s\");\n newTable.addRow(newRow);\n }\n }\n\n sc.close();\n return newTable;\n }", "private void createFileTableIndexes() throws Exception {\n \t\tdbManager\n \t\t\t\t.executeUpdate(\"create index FILE_ID_INDEX_FILE on FILE(FILE_ID)\");\n \t\tdbManager\n \t\t\t\t.executeUpdate(\"create index START_REVISION_ID_INDEX_FILE on FILE(START_REVISION_ID)\");\n \t\tdbManager\n \t\t\t\t.executeUpdate(\"create index END_REVISION_ID_INDEX_FILE on FILE(END_REVISION_ID)\");\n \t}", "public interface FileDataDao\r\n{\r\n\tpublic FileData uploadFile(UploadFileData ufd,int applicationId, String fileLocation,String rootLocation) throws FileAlreadyExistsException;\r\n\tpublic List<FileData> listRootFiles(int applicationId);\r\n\tpublic List<FileData> listFolderFiles(int applicationId,int parentCategoryId);\r\n\tpublic List<ApproveReject> approveFile(List<ApproveReject> approveList, int applicationId);\r\n\tpublic List<ApproveReject> rejectFile(List<ApproveReject> rejectList, int applicationId);\r\n\tpublic int getNoOfUploadedFiles(int applicationId);\r\n\tpublic List<FileDelete> deleteFiles(List<FileDelete> fileDeleteList, int applicationId);\r\n\tpublic int getRootId(int applicationId);\r\n\tpublic String getPhoto(int applicationId);\r\n}", "private void setupDb(){\n try {\n openConnection();\n s.executeUpdate(\"CREATE TABLE IF NOT EXISTS LIB (NAME text UNIQUE , TYPE text, LANGUAGE text, INTRUSIVE text, OPENSOURCE text)\");\n }catch (SQLException e) {\n System.err.println(e.getMessage());\n }finally {\n if (c != null){\n close(c);\n }\n }\n }", "Object getDB();", "private static void bindClobVarInFile(PreparedStatement ps, \n int index, \n ResultSet rs,\n int type)\n throws IOException, SQLException \n {\n InputStream is = rs.getAsciiStream(index);\n if (rs.wasNull()) {\n ps.setNull(index, type);\n return;\n }\n \n // Open file output stream\n long millis = System.currentTimeMillis();\n File f = File.createTempFile(\"clob\", \"\"+millis);\n f.deleteOnExit();\n FileOutputStream fos = new FileOutputStream(f);\n if (log.isDebugEnabled()) {\n //i18n[DBUtil.info.bindclobfile=bindClobVarInFile: Opening temp file '{0}']\n String msg = s_stringMgr.getString(\"DBUtil.info.bindclobfile\",\n f.getAbsolutePath());\n log.debug(msg);\n }\n \n // read rs input stream write to file output stream\n byte[] buf = new byte[_prefs.getFileCacheBufferSize()];\n int length = 0;\n int total = 0;\n while ((length = is.read(buf)) >= 0) {\n if (log.isDebugEnabled()) {\n //i18n[DBUtil.info.bindcloblength=bindClobVarInFile: writing '{0}' bytes.]\n String msg =\n s_stringMgr.getString(\"DBUtil.info.bindcloblength\",\n Integer.valueOf(length));\n log.debug(msg);\n }\n fos.write(buf, 0, length);\n total += length;\n }\n fos.close();\n \n // set the ps to read from the file we just created.\n FileInputStream fis = new FileInputStream(f);\n BufferedInputStream bis = new BufferedInputStream(fis);\n ps.setAsciiStream(index, bis, total);\n }", "NewsFile selectByPrimaryKey(Integer fileId);", "private FileOperations() throws FileNotFoundException {\r\n\t\tbiddingPersistence = new BiddingPersistence(Constants.biddingsFilePath, \r\n\t\t\t\tConstants.indexBiddingsPath);\r\n\t\tusersPersistence = new UsersPersistence(Constants.usersFilePath,\r\n\t\t\t\tConstants.indexUsersPath);\t\t\r\n\t}", "public String getDBString();", "static Vector< DbRecord > ReadRecords( String szDbDir )\n {\n File DbDir;\n File[] files;\n Vector<DbRecord> Users = new Vector<DbRecord>( 10, 10 );\n\n // Read all records to identify\n DbDir = new File( szDbDir );\n files = DbDir.listFiles();\n\n if( (files == null) || (files.length == 0) )\n {\n return Users;\n }\n\n for( int iFiles = 0; iFiles < files.length; iFiles++)\n {\n try\n {\n if( files[iFiles].isFile() )\n {\n DbRecord User = new DbRecord( files[iFiles].getAbsolutePath() );\n Users.add( User );\n }\n }\n catch( FileNotFoundException e )\n {\n // The record has invalid data. Skip it and continue processing.\n }\n catch( NullPointerException e )\n {\n JOptionPane.showConfirmDialog(null, \"erro\"+e);\n }\n catch( AppException e )\n {\n // The record has invalid data or access denied. Skip it and continue processing.\n }\n }\n \n return Users;\n }", "DiaryFile selectByPrimaryKey(String maperId);", "public void createDBSchema() throws NoConnectionToDBException, SQLException, IOException {\n \n InputStream in = EDACCApp.class.getClassLoader().getResourceAsStream(\"edacc/resources/edacc.sql\");\n if (in == null) {\n throw new SQLQueryFileNotFoundException();\n }\n BufferedReader br = new BufferedReader(new InputStreamReader(in));\n String line;\n String text = \"\";\n String l;\n while ((line = br.readLine()) != null) {\n if (!(l = line.replaceAll(\"\\\\s\", \"\")).isEmpty() && !l.startsWith(\"--\")) {\n text += line + \" \";\n }\n }\n in.close();\n Vector<String> queries = new Vector<String>();\n String query = \"\";\n String delimiter = \";\";\n int i = 0;\n while (i < text.length()) {\n if (text.toLowerCase().startsWith(\"delimiter\", i)) {\n i += 10;\n delimiter = text.substring(i, text.indexOf(' ', i));\n i = text.indexOf(' ', i);\n } else if (text.startsWith(delimiter, i)) {\n queries.add(query);\n i += delimiter.length();\n query = \"\";\n } else {\n query += text.charAt(i);\n i++;\n }\n }\n if (!query.replaceAll(\" \", \"\").equals(\"\")) {\n queries.add(query);\n }\n boolean autoCommit = getConn().getAutoCommit();\n try {\n getConn().setAutoCommit(false);\n Statement st = getConn().createStatement();\n for (String q : queries) {\n st.execute(q);\n }\n st.close();\n getConn().commit();\n } catch (SQLException e) {\n getConn().rollback();\n throw e;\n } finally {\n getConn().setAutoCommit(autoCommit);\n }\n }", "private Db() {\n super(Ke.getDatabase(), null);\n }", "public static String SQLFromFile(String file) throws IOException{\n BufferedReader reader = new BufferedReader(new FileReader(file));\n StringBuilder sb = new StringBuilder();\n String line;\n while((line = reader.readLine()) != null){\n sb.append(line);\n sb.append(' ');\n }\n reader.close();\n return sb.toString();\n }", "@Override\n\tpublic void closeDB()\n\t{\n\n\t}", "public interface DbLoader {\n\n /**\n * prepares the database\n */\n void prepareDatabase();\n}", "public long getDbFileSize() {\r\n\tlong result = -1;\r\n\r\n\ttry {\r\n\t File dbFile = new File(fileName);\r\n\t if (dbFile.exists()) {\r\n\t\tresult = dbFile.length();\r\n\t }\r\n\t} catch (Exception e) {\r\n\t // nothing todo here\r\n\t}\r\n\r\n\treturn result;\r\n }", "public String getTableFile() \n\t{\n\t return tableFile ;\n\t}", "public static ParserResult loadDatabase(File fileToOpen, String encoding) throws IOException {\n \n Reader reader = getReader(fileToOpen, encoding);\n String suppliedEncoding = null;\n try {\n boolean keepon = true;\n int piv = 0, c;\n while (keepon) {\n c = reader.read();\n if ( (piv == 0 && Character.isWhitespace( (char) c)) ||\n c == GUIGlobals.SIGNATURE.charAt(piv))\n piv++;\n else\n keepon = false;\n found: if (piv == GUIGlobals.SIGNATURE.length()) {\n keepon = false;\n // Found the signature. The rest of the line is unknown, so we skip it:\n while (reader.read() != '\\n');\n // Then we must skip the \"Encoding: \"\n for (int i=0; i<GUIGlobals.encPrefix.length(); i++) {\n if (reader.read() != GUIGlobals.encPrefix.charAt(i))\n break found; // No, it doesn't seem to match.\n }\n // If ok, then read the rest of the line, which should contain the name\n // of the encoding:\n StringBuffer sb = new StringBuffer();\n while ((c = reader.read()) != '\\n')\n sb.append((char)c);\n suppliedEncoding = sb.toString();\n }\n \n }\n } catch (IOException ex) {}\n \n if ((suppliedEncoding != null) && (!suppliedEncoding.equalsIgnoreCase(encoding))) {\n Reader oldReader = reader;\n try {\n // Ok, the supplied encoding is different from our default, so we must make a new\n // reader. Then close the old one.\n reader = getReader(fileToOpen, suppliedEncoding);\n oldReader.close();\n //System.out.println(\"Using encoding: \"+suppliedEncoding);\n } catch (IOException ex) {\n reader = oldReader; // The supplied encoding didn't work out, so we keep our\n // existing reader.\n \n //System.out.println(\"Error, using default encoding.\");\n }\n } else {\n // We couldn't find a supplied encoding. Since we don't know far into the file we read,\n // we start a new reader.\n reader.close();\n reader = getReader(fileToOpen, encoding);\n //System.out.println(\"No encoding supplied, or supplied encoding equals default. Using default encoding.\");\n }\n \n \n //return null;\n \n BibtexParser bp = new BibtexParser(reader);\n \n ParserResult pr = bp.parse();\n pr.setEncoding(encoding);\n \n return pr;\n }", "public ODatabaseDocumentTx db();", "public static TreeBag<Golfer> loadDbFromFile(String dbFilename) \n {\n // used to store lines read from the database file\n String line;\n // create a new empty database\n TreeBag<Golfer> db = new TreeBag<Golfer>();\n // compile a regex pattern for parsing lines from the database file\n Pattern p = Pattern.compile(\"([\\\\w\\\\s-]+)(\\\\d+)\\\\s+(\\\\d+)\\\\s+(\\\\d+\\\\.?\\\\d*)\");\n // create file handle for the filename specified (in current directory)\n File f = new File(\".\"+ File.separator + dbFilename);\n\n // if the filename specified exists in the current directory,\n if (f.exists()) {\n System.out.println(\"\\nLoading golfers from database file '\"+ dbFilename +\"'...\");\n\n // try loading from the database file\n try {\n // create a new file reader using the file handle\n FileReader fr = new FileReader(f);\n // buffer the file reader\n BufferedReader buf = new BufferedReader(fr);\n\n // keep reading lines from the file buffer until we reach the end of file\n while ( (line = buf.readLine()) != null ) {\n // trim whitespace off the lines\n line = line.trim();\n //System.out.println(\"Read line:\\n\"+ line +\"\\n\");\n\n // create a matcher object using the pre-compiled regex pattern\n Matcher m = p.matcher(line);\n // if the matcher object found a match on the current line,\n if (m.find()) {\n // populate golfer data using match groups\n String name = m.group(1);\n int rounds = Integer.valueOf(m.group(2));\n int handicap = Integer.valueOf(m.group(3));\n double avg = Double.valueOf(m.group(4));\n // create a new golfer object\n Golfer g = new Golfer(name, rounds, handicap, avg);\n // add new golfer to the database\n db.add(g);\n /*\n System.out.println(\"Added golfer to database:\\n\"+ g +\"\\n\");\n System.out.println(\"Current database:\\n\"+ db);\n System.out.println(\"Tree view:\");\n db.displayAsTree();\n System.out.println(\"\\n\");\n */\n }\n }\n\n // at the end of the file, close the buffer\n buf.close();\n }\n // exception: specified file does not exist\n catch(FileNotFoundException e) {\n // print stack trace for debugging\n e.printStackTrace();\n System.out.println(\"File '\"+ dbFilename +\"' not found: \"+ e);\n }\n // exception: I/O error when reading from file\n catch(IOException e) {\n // print stack trace for debugging\n e.printStackTrace();\n System.out.println(\"Error reading file '\"+ dbFilename +\"': \"+ e);\n }\n }\n else\n System.out.println(\"Database file '\"+ dbFilename +\"' not found\");\n \n // return the newly compiled database\n return db;\n }", "String getClobField();", "abstract public int dbVersion();", "public abstract String toDBString();", "private static Connection _getDbConnection(String aPath)\n\t{\n\t\ttry\n\t\t{\n\t\t\t// Open file\n\t\t\tConnection c = DriverManager.getConnection(CONN_PREFIX+aPath);\n\t\t\tc.setAutoCommit(false);\n\t\t\tIO.dbOutD(\"Connection to DB at path \"+ aPath + \" established.\");\n\t\t\treturn c;\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tIO.dbOutE(e);\n\t\t\treturn null;\n\t\t}\n\t}", "@Override\r\n public Db_db currentDb(){return curDb_;}", "@Test(timeout = 4000)\n public void test126() throws Throwable {\n DBDataType dBDataType0 = DBDataType.getInstance(\"CLOB\");\n Integer integer0 = RawTransaction.SAVEPOINT_ROLLBACK;\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n DefaultDBColumn defaultDBColumn0 = new DefaultDBColumn(\"CLOB\", defaultDBTable0, dBDataType0, integer0);\n NameSpec nameSpec0 = NameSpec.NEVER;\n MockPrintWriter mockPrintWriter0 = new MockPrintWriter(\"#B0tMDNkWiXCI3n\");\n SQLUtil.renderCreateTable(defaultDBTable0, true, nameSpec0, mockPrintWriter0);\n assertEquals(\"table\", defaultDBTable0.getObjectType());\n }", "@Override\n\tpublic int dbsize() {\n\t\treturn 0;\n\t}" ]
[ "0.75162673", "0.7207716", "0.6856582", "0.63214904", "0.61810434", "0.6109898", "0.6099357", "0.60643154", "0.59978586", "0.5979398", "0.5952094", "0.5903999", "0.58972645", "0.585271", "0.5846257", "0.5809899", "0.58018017", "0.57985026", "0.57965136", "0.5771401", "0.57699853", "0.57660615", "0.5751976", "0.57483095", "0.573991", "0.57319665", "0.57164884", "0.5696641", "0.5687155", "0.568395", "0.56753296", "0.5667369", "0.5666063", "0.56496674", "0.5630785", "0.5625944", "0.56257564", "0.5618461", "0.55967504", "0.55848753", "0.5580355", "0.5579538", "0.55789524", "0.5563484", "0.55614966", "0.55604804", "0.55521995", "0.5550884", "0.5543351", "0.55340934", "0.55324435", "0.55278844", "0.552674", "0.55256736", "0.55248654", "0.55198175", "0.5513185", "0.55113673", "0.54969424", "0.5492285", "0.54781264", "0.5470682", "0.54671997", "0.546112", "0.5460634", "0.5439558", "0.5430981", "0.54204714", "0.54197943", "0.5417465", "0.54116", "0.54046506", "0.5402368", "0.5399423", "0.53944665", "0.5388514", "0.5385736", "0.5385214", "0.537763", "0.53700405", "0.5359754", "0.53582364", "0.53549147", "0.5353527", "0.53515434", "0.5348831", "0.5340497", "0.5334494", "0.53312504", "0.5331116", "0.53300834", "0.5328218", "0.5325344", "0.53162616", "0.53078955", "0.53073007", "0.53072876", "0.5306308", "0.5304805", "0.53032464", "0.5301233" ]
0.0
-1
see DbFile.java for javadocs
public DbFileIterator iterator(TransactionId tid) { System.out.println("numPages is " + numPages); return new TupleIter(numPages); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public File getInputDb();", "public File getOutputDb();", "private String getFileTableQuery() {\n \t\tfinal StringBuilder builder = new StringBuilder();\n \n \t\tbuilder.append(\"create table FILE(\");\n \t\tbuilder.append(\"FILE_ID LONG PRIMARY KEY,\");\n \t\tbuilder.append(\"FILE_PATH TEXT,\");\n \t\tbuilder.append(\"START_REVISION_ID LONG,\");\n \t\tbuilder.append(\"END_REVISION_ID LONG\");\n \t\tbuilder.append(\")\");\n \n \t\treturn builder.toString();\n \t}", "public String getDatabaseFileName();", "public FileDatabase(String filename) throws IOException {\n\t\tdatabase = new File(filename);\n\t\tread();\n\t}", "public synchronized void writeFromFileIntoDB()throws IOWrapperException, IOIteratorException{\r\n \r\n fromFile_Name=Controller.CLASSES_TMP_FILENAME;\r\n iow_ReadFromFile = new IOWrapper();\r\n \r\n //System.out.println(\"Readin' from \"+fromFile_Name);\r\n \r\n iow_ReadFromFile.setupInput(fromFile_Name,0);\r\n \r\n iter_ReadFromFile = iow_ReadFromFile.getLineIterator();\r\n iow_ReadFromFile.setupOutput(this.dbname,this.username,this.password,this.hostname,this.port);\r\n \r\n iow_ReadFromFile.sendOutputQuery(\"DROP TABLE IF EXISTS \"+outtable);\r\n \r\n iow_ReadFromFile.sendOutputQuery(\r\n \"CREATE TABLE IF NOT EXISTS \"\r\n +outtable+\" (\"\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[0]+\" int(10) NOT NULL AUTO_INCREMENT, \"//wort_nr\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[1]+\" varchar(225), \"//wort_alph\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[2]+\" int(10), \"//krankheit \r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[3]+\" int(10), \"//farbe1 \r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[4]+\" real(8,2), \"//farbe1prozent\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[5]+\" int(10), \"//farbe2\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[6]+\" real(8,2), \"//farbe2prozent\r\n +\"PRIMARY KEY (\"+Controller.COLUMN_NAMES_FOR_DB_OUT[0]+\")) \"\r\n +\"ENGINE=MyISAM\"\r\n );\r\n while(iter_ReadFromFile.hasNext()){\r\n singleProgress+=1;\r\n String[] data = (String[])iter_ReadFromFile.next();\r\n \r\n //System.out.println(\"--> processing line \"+data);\r\n //escape quotes ' etc for SQL query\r\n if(data[1].matches(\".*'.*\")||data[1].matches(\".*\\\\.*\")){\r\n int sl = data[1].length();\r\n String escapedString = \"\";\r\n \r\n for (int i = 0; i < sl; i++) {\r\n char ch = data[1].charAt(i);\r\n switch (ch) {\r\n case '\\'':\r\n escapedString +='\\\\';\r\n escapedString +='\\'';\r\n break;\r\n case '\\\\':\r\n escapedString +='\\\\';\r\n escapedString +='\\\\';\r\n break;\r\n default :\r\n escapedString +=ch;\r\n break;\r\n }\r\n }\r\n data[1]=escapedString;\r\n }\r\n \r\n String insertStatement=\"INSERT INTO \"\r\n +outtable+\" (\"\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[0]+\", \"//node id\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[1]+\", \"//label\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[2]+\", \"//class id \r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[3]+\", \"//class id 1 \r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[4]+\", \"//percent\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[5]+\", \"//class id 2\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[6]+\") \"//percent \r\n +\"VALUES ('\"\r\n +data[0]+\"', '\"\r\n +data[1]+\"', '\"\r\n +data[2]+\"', '\"\r\n +data[3]+\"', '\"\r\n +data[4]+\"', '\"\r\n +data[5]+\"', '\"\r\n +data[6]+\"')\";\r\n \r\n //System.out.println(\"Sending insert statement:\"+insertStatement);\r\n iow_ReadFromFile.sendOutputQuery(insertStatement);\r\n }\r\n \r\n \r\n //iow_ReadFromFile.closeOutput();\r\n \r\n this.stillWorks=false;\r\n writeIntoDB=false;\r\n System.out.println(\"*\\tData written into database.\");\r\n\t}", "interface DataTableFile extends TableDataSource {\n\n /**\n * Creates a new file of the given table. The table is initialised and\n * contains 0 row entries. If the table already exists in the database then\n * this will throw an exception.\n * <p>\n * On exit, the object will be initialised and loaded with the given table.\n *\n * @param def the definition of the table.\n */\n void create(DataTableDef def) throws IOException;\n\n /**\n * Updates a file of the given table. If the table does not exist, then it\n * is created. If the table already exists but is different, then the\n * existing table is modified to incorporate the new fields structure.\n * <p>\n * The DataTableFile must have previously been 'load(table_name)' before\n * this call.\n * <p>\n * Implementations of this method may choose to reorganise information that\n * the relational schemes are dependant on (the row order for example). If\n * this method returns 'true' then we must also reindex the schemes.\n * <p>\n * <strong>NOTE:</strong> If the new format has columns that are not\n * included in the new format then the columns are deleted.\n *\n * @param def the definition of the table.\n * @return true if the table topology has changed.\n */\n boolean update(DataTableDef def) throws IOException;\n\n /**\n * This is called periodically when this data table file requires some\n * maintenance. It is recommended that this method is called every\n * time the table is initialized (loaded).\n * <p>\n * The DataTableFile must have previously been 'load(table_name)' before\n * this call.\n * <p>\n * This method may change the topology of the rows (delete rows that are\n * marked as deleted), therefore if the method returns true you need to\n * re-index the schemes.\n *\n * @return true if the table topology was changed.\n */\n boolean doMaintenance() throws IOException;\n\n// /**\n// * A recovery method that returns a DataTableDef object for this data\n// * table file that was last used in a call to 'create' or 'update'. This\n// * information should be kept in a secondary table topology store but it\n// * is useful to keep this information in the data table file just incase\n// * something bad happens, or tables are moved to another database.\n// */\n// DataTableDef recoverLastDataTableDef() throws IOException;\n\n /**\n * Loads a previously created table. A table can be loaded in read only\n * mode, in which case any methods that write to the DataTableFile will\n * throw an IOException.\n *\n * @param table_name the name of the table.\n * @param read_only if true then the table file is opened as read-only.\n */\n void load(String table_name, boolean read_only) throws IOException;\n\n /**\n * Shuts down the table. This is called when the table is closed and the\n * resources it uses are to be freed back to the system. This is called\n * as part of the database shut down procedure or called when we want to\n * free the resources associated with this table.\n */\n void shutdown() throws IOException;\n\n /**\n * Deletes the data table file in the file system. This is used to clear\n * up resources after a table has been dropped. The table must be shut\n * down before this method is called.\n * <p>\n * NOTE: Use this with care. All data is lost!\n */\n void drop();\n\n /**\n * Flushes all information that may be cached in memory to disk. This\n * includes any relational data, any cached data that hasn't made it to\n * the file system yet. It will write out all persistant information\n * and leave the table in a state where it is fully represented in the\n * file system.\n */\n void updateFile() throws IOException;\n\n /**\n * Locks the data in the file to prevent the system overwritting entries\n * that have been marked as removed. This is necessary so we may still\n * safely read removed entries from the table while the table is locked.\n */\n void addRowsLock();\n\n /**\n * Unlocks the data in the file to indicate that the system may safely\n * overwrite removed entries in the file.\n */\n void removeRowsLock();\n\n /**\n * Returns true if the file currently has all of its rows locked.\n */\n boolean hasRowsLocked();\n\n// /**\n// * The number of rows that are currently stored in this table. This number\n// * does not include the rows that have been marked as removed.\n// */\n// int rowCount();\n\n /**\n * Returns true if the given row index points to a valid and available\n * row entry. Returns false if the row entry has been marked as removed,\n * or the index goes outside the bounds of the table.\n */\n boolean isRowValid(int record_index) throws IOException;\n\n /**\n * Adds a complete new row into the table. If the table is in a row locked\n * state, then this will always add a new entry to the end of the table.\n * Otherwise, new entries are added where entries were previously removed.\n * <p>\n * This will update any column indices that are set.\n *\n */\n int addRow(RowData row_data) throws IOException;\n\n /**\n * Removes a row from the table at the given index. This will only mark\n * the entry as removed, and will not actually remove the data. This is\n * because a process is allowed to read the data even after the row has been\n * marked as removed (if the rows have been locked).\n * <p>\n * This will update any column indices that are set.\n *\n * @param row_index the raw row index of the entry to be marked as removed.\n */\n void removeRow(int row_index) throws IOException;\n\n// /**\n// * Returns a DataCell object of the entry at the given column, row\n// * index in the table. This will always work provided there was once data\n// * stored at that index, even if the row has been marked as deleted.\n// */\n// DataCell getCellAt(int column, int row) throws IOException;\n\n /**\n * Returns a unique number. This is incremented each time it is accessed.\n */\n long nextUniqueKey() throws IOException;\n\n}", "public DatabaseFileInformation(byte[] aFileBytes)\n {\n mTables = new LinkedList<>();\n\n mHeader = (short) (((0xFF) & aFileBytes[1]) | (((0xFF) & aFileBytes[0]) << 8));\n mVersion = (short) (((0xFF) & aFileBytes[3]) | (((0xFF) & aFileBytes[2]) << 8));\n mUnknown1 = ((0xFF) & aFileBytes[7]) | (((0xFF) & aFileBytes[6]) << 8) | (((0xFF) & aFileBytes[5]) <<\n 16) | (((0xFF) & aFileBytes[4]) << 24);\n mDatabaseSize = ((0xFF) & aFileBytes[11]) | (((0xFF) & aFileBytes[10]) << 8) | (((0xFF) & aFileBytes[9]) <<\n 16) | (((0xFF) & aFileBytes[8]) << 24);\n mZero = ((0xFF) & aFileBytes[15]) | (((0xFF) & aFileBytes[14]) << 8) | (((0xFF) & aFileBytes[13]) <<\n 16) | (((0xFF) & aFileBytes[12]) << 24);\n mTableCount = ((0xFF) & aFileBytes[19]) | (((0xFF) & aFileBytes[18]) << 8) | (((0xFF) & aFileBytes[17]) <<\n 16) | (((0xFF) & aFileBytes[16]) << 24);\n mUnknown2 = ((0xFF) & aFileBytes[23]) | (((0xFF) & aFileBytes[22]) << 8) | (((0xFF) & aFileBytes[21]) <<\n 16) | (((0xFF) & aFileBytes[20]) << 24);\n\n int lTableDefinitionPosition = 24;\n int lTableDataStart = lTableDefinitionPosition + (mTableCount * 8);\n\n // Read the table definitions.\n for (int i = 0; i < mTableCount; i++)\n {\n DatabaseTable lDatabaseTable = new DatabaseTable();\n lDatabaseTable.readTableDefinition(aFileBytes, lTableDefinitionPosition);\n lDatabaseTable.readTableHeader(aFileBytes, lTableDataStart);\n mTables.add(lDatabaseTable);\n lTableDefinitionPosition += 8;\n }\n }", "public interface DatabaseManager {\r\n\r\n // NOTE: this is a draft of the interface. More methods will likely be\r\n // added.\r\n\r\n /**\r\n * Uploads the specified feature to the database.\r\n * \r\n * @param file the shapefile (*.shp) to upload\r\n * @param project the project to associate the shapefile with\r\n * @return the id of the feature in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadFeature(File file, String project) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified modis tile to the database.\r\n * \r\n * @param file the .hdf to upload\r\n * @param product the modis product\r\n * @param date the date the data was captured\r\n * @param downloaded the date the data was downloaded from the host\r\n * @param horz the horizontal tile number\r\n * @param vert the vertical tile number\r\n * @return the id of the Modis raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadModis(File file, ModisProduct product, DataDate date, DataDate updated, int horz, int vert) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified ETo file to the database.\r\n * \r\n * @param file the\r\n * @param date\r\n * @param updated\r\n * @return the id of the ETo raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadEto(File file, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified TRMM file to the database.\r\n * \r\n * @param file\r\n * @param date\r\n * @param updated\r\n * @return the id of the TRMM raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadTrmm(File file, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified projected Modis product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param product\r\n * @param date\r\n * @param updated\r\n * @return the id of the projected Modis raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadProjectedModis(File file, String project, ModisProduct product, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified projected ETo product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the projected ETo raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadProjectedEto(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the projected TRMM product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the TRMM raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadProjectedTrmm(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified ETa product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the ETa raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadEta(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified EVI product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the EVI raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadEvi(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified NDVI product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the NDVI raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadNdvi(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified NDWI5 product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the NDWI5 raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadNdwi5(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified NDWI6 product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the NDWI6 raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadNdwi6(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Uploads the specified SAVI product to the database.\r\n * \r\n * @param file\r\n * @param project\r\n * @param date\r\n * @param updated\r\n * @return the id of the SAVI raster in the database\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n int uploadSavi(File file, String project, DataDate date, DataDate updated) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified feature and places it in the specified file in\r\n * the shapefile.\r\n * \r\n * @param file the location to save the feature\r\n * @param id the id of the feature\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadFeature(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified Modis tile from the database.\r\n * \r\n * @param file\r\n * @param product\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadModis(File file, ModisProduct product, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified ETo raster from the database and saves it to the\r\n * specified file.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadEto(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified TRMM raster from the database and saves it to the\r\n * specified file.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadTrmm(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified projected Modis product from the database.\r\n * \r\n * @param file\r\n * @param product\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadProjectedModis(File file, ModisProduct product, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified projected ETo product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadProjectedEto(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified projected TRMM product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadProjectedTrmm(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified ETa product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadEta(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified EVI product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadEvi(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified NDVI product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadNdvi(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified NDWI5 product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadNdwi5(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified NDWI6 product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadNdwi6(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Downloads the specified SAVI product from the database.\r\n * \r\n * @param file\r\n * @param id\r\n * @throws IOException\r\n * @throws SQLException\r\n */\r\n void downloadSavi(File file, int id) throws IOException, SQLException;\r\n\r\n /**\r\n * Returns the id of the MODIS raster for the specified product and date.\r\n * \r\n * @param product\r\n * @param date\r\n * @param horz\r\n * @param vert\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getModisId(ModisProduct product, DataDate date, int horz, int vert) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the ETo for the specified date.\r\n * \r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getEtoId(DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the TRMM for the specified date.\r\n * \r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getTrmmId(DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the reprojected Modis raster for the specified\r\n * project, product, and date.\r\n * \r\n * @param project\r\n * @param product\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getReprojectedModisId(String project, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the reprojected ETo raster for the specified project\r\n * and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getReprojectedEtoId(String project, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the reprojected TRMM raster for the specified project\r\n * and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getReprojectedTrmmId(String project, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the ETa raster for the specified project and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getEtaId(String project, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the EVI raster for the specified project and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getEviId(String project, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the NDVI raster for the specified project and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getNdviId(String project, String feature, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the NDWI5 raster for the specified project and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getNdwi5Id(String project, String feature, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the NDWI6 raster for the specified project and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getNdwi6Id(String project, String feature, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the SAVI raster for the specified project and date.\r\n * \r\n * @param project\r\n * @param date\r\n * @return the id of the raster or -1 if the raster isn't found\r\n * @throws SQLException\r\n */\r\n int getSaviId(String project, String feature, DataDate date) throws SQLException;\r\n\r\n /**\r\n * Uploads the specified zonal statistics.\r\n * \r\n * @param project\r\n * @param feature\r\n * @param zoneField\r\n * @param zone\r\n * @param date\r\n * @param index\r\n * @param zonalStatistics\r\n */\r\n void uploadZonalStatistic(String project, String feature, String zoneField,\r\n String zone, DataDate date, EnvironmentalIndex index,\r\n ZonalStatistic zonalStatistics) throws SQLException;\r\n\r\n /**\r\n * Returns the id of the zonal statistics for the specified parameters.\r\n * \r\n * @param project\r\n * @param feature\r\n * @param zoneField\r\n * @param zone\r\n * @param date\r\n * @param index\r\n * @return the id or -1 if it is not found\r\n */\r\n int getZonalStatisticId(String project, String feature, String zoneField,\r\n String zone, DataDate date, EnvironmentalIndex index)\r\n throws SQLException;\r\n\r\n /**\r\n * Returns zonal statistics for the specified zonal statistic id.\r\n * \r\n * @param id\r\n * @return zonal statistics\r\n * @throws SQLException\r\n */\r\n ZonalStatistic getZonalStatistic(int id) throws SQLException;\r\n}", "public abstract String apachedb(int size);", "public void createDB() {\n\t\ttry {\n\t\t\tBufferedReader br= new BufferedReader(new FileReader(\"db_schema.txt\"));\n\t\t\tString line= null;\n\t\t\tStringBuilder sb= new StringBuilder();\n\t\t\twhile ((line=br.readLine())!=null){\n\t\t\t\tsb.append(line);\n\t\t\t\tif(sb.length()>0 && sb.charAt(sb.length()-1)==';'){//see if it is the end of one line of command\n\t\t\t\t\tstatement.executeUpdate(sb.toString());\n\t\t\t\t\tsb= new StringBuilder();\n\t\t\t\t}\n\t\t\t}\n\t\t\tbr.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public String getPath() { return db.getPath(); }", "String getUserDatabaseFilePath();", "public abstract ODatabaseInternal<?> openDatabase();", "private DBManager() throws Exception {\n file = new File(\"pdfLibraryDB.mv.db\");\n if (!file.exists()) {\n conn = connect();\n stmt = conn.createStatement();\n query = \"CREATE TABLE user(username VARCHAR(30) PRIMARY KEY, password VARCHAR(32));\" +\n \"CREATE TABLE category(id VARCHAR(30) PRIMARY KEY, name VARCHAR(30), username VARCHAR(30), FOREIGN KEY(username) REFERENCES user(username) ON UPDATE CASCADE ON DELETE CASCADE);\"+\n \"CREATE TABLE favorite(id VARCHAR(30) PRIMARY KEY, path VARCHAR(500), keyword VARCHAR(200), searchType VARCHAR(10), category VARCHAR(30),username VARCHAR(30), FOREIGN KEY(username) REFERENCES user(username) ON UPDATE CASCADE ON DELETE CASCADE, FOREIGN KEY(category) REFERENCES category(id) ON UPDATE CASCADE ON DELETE CASCADE);\" +\n \"CREATE TABLE history(id VARCHAR(30) PRIMARY KEY, keyword VARCHAR(200), type VARCHAR(10), directory VARCHAR(500), username VARCHAR(30), FOREIGN KEY(username) REFERENCES user(username) ON UPDATE CASCADE ON DELETE CASCADE);\";\n stmt.executeUpdate(query);\n stmt.close();\n conn.close();\n System.out.println(\"DB created!\");\n }\n }", "@Test\n public void reading()\n throws FileNotFoundException, IOException, CorruptedTableException\n {\n final Database database =\n new Database(new File(\"src/test/resources/\" + versionDirectory + \"/rndtrip\"), version);\n final Set<String> tableNames = database.getTableNames();\n\n assertEquals(2,\n tableNames.size());\n assertTrue(\"TABLE1 not found in 'short roundtrip' database\",\n tableNames.contains(\"TABLE1.DBF\"));\n assertTrue(\"TABLE2 not found in 'short roundtrip' database\",\n tableNames.contains(\"TABLE2.DBF\"));\n\n final Table t1 = database.getTable(\"TABLE1.DBF\");\n\n try\n {\n t1.open(IfNonExistent.ERROR);\n\n assertEquals(\"Table name incorrect\",\n \"TABLE1.DBF\",\n t1.getName());\n assertEquals(\"Last modified date incorrect\",\n Util.createDate(2009, Calendar.APRIL, 1),\n t1.getLastModifiedDate());\n\n final List<Field> fields = t1.getFields();\n\n Iterator<Field> fieldIterator = fields.iterator();\n Map<String, Field> nameFieldMap = new HashMap<String, Field>();\n\n while (fieldIterator.hasNext())\n {\n Field f = fieldIterator.next();\n nameFieldMap.put(f.getName(),\n f);\n }\n\n final Field idField = nameFieldMap.get(\"ID\");\n assertEquals(Type.NUMBER,\n idField.getType());\n assertEquals(idField.getLength(),\n 3);\n\n final Field stringField = nameFieldMap.get(\"STRFIELD\");\n assertEquals(Type.CHARACTER,\n stringField.getType());\n assertEquals(stringField.getLength(),\n 50);\n\n final Field logicField = nameFieldMap.get(\"LOGICFIELD\");\n assertEquals(Type.LOGICAL,\n logicField.getType());\n assertEquals(logicField.getLength(),\n 1);\n\n final Field dateField = nameFieldMap.get(\"DATEFIELD\");\n assertEquals(Type.DATE,\n dateField.getType());\n assertEquals(8,\n dateField.getLength());\n\n final Field floatField = nameFieldMap.get(\"FLOATFIELD\");\n assertEquals(Type.NUMBER,\n floatField.getType());\n assertEquals(10,\n floatField.getLength());\n\n final List<Record> records = UnitTestUtil.createSortedRecordList(t1.recordIterator(),\n \"ID\");\n final Record r0 = records.get(0);\n\n assertEquals(1,\n r0.getNumberValue(\"ID\"));\n assertEquals(\"String data 01\",\n r0.getStringValue(\"STRFIELD\").trim());\n assertEquals(true,\n r0.getBooleanValue(\"LOGICFIELD\"));\n assertEquals(Util.createDate(1909, Calendar.MARCH, 18),\n r0.getDateValue(\"DATEFIELD\"));\n assertEquals(1234.56,\n r0.getNumberValue(\"FLOATFIELD\"));\n\n final Record r1 = records.get(1);\n\n assertEquals(2,\n r1.getNumberValue(\"ID\"));\n assertEquals(\"String data 02\",\n r1.getStringValue(\"STRFIELD\").trim());\n\n /*\n * in Clipper 'false' value can be given as an empty field, and the method called here\n * returns then 'null' as the return value\n */\n if (version == Version.CLIPPER_5)\n {\n assertEquals(null,\n r1.getBooleanValue(\"LOGICFIELD\"));\n }\n else\n {\n assertEquals(false,\n r1.getBooleanValue(\"LOGICFIELD\"));\n }\n\n assertEquals(Util.createDate(1909, Calendar.MARCH, 20),\n r1.getDateValue(\"DATEFIELD\"));\n assertEquals(-23.45,\n r1.getNumberValue(\"FLOATFIELD\"));\n\n final Record r2 = records.get(2);\n\n assertEquals(3,\n r2.getNumberValue(\"ID\"));\n assertEquals(\"\",\n r2.getStringValue(\"STRFIELD\").trim());\n assertEquals(null,\n r2.getBooleanValue(\"LOGICFIELD\"));\n assertEquals(null,\n r2.getDateValue(\"DATEFIELD\"));\n assertEquals(null,\n r2.getNumberValue(\"FLOATFIELD\"));\n\n final Record r3 = records.get(3);\n\n assertEquals(4,\n r3.getNumberValue(\"ID\"));\n assertEquals(\"Full5678901234567890123456789012345678901234567890\",\n r3.getStringValue(\"STRFIELD\").trim());\n\n /*\n * in Clipper 'false' value can be given as an empty field, and the method called here\n * returns then 'null' as the return value\n */\n if (version == Version.CLIPPER_5)\n {\n assertEquals(null,\n r3.getBooleanValue(\"LOGICFIELD\"));\n }\n else\n {\n assertEquals(false,\n r3.getBooleanValue(\"LOGICFIELD\"));\n }\n\n assertEquals(Util.createDate(1909, Calendar.MARCH, 20),\n r3.getDateValue(\"DATEFIELD\"));\n assertEquals(-0.30,\n r3.getNumberValue(\"FLOATFIELD\"));\n }\n finally\n {\n t1.close();\n }\n\n final Table t2 = database.getTable(\"TABLE2.DBF\");\n\n try\n {\n t2.open(IfNonExistent.ERROR);\n\n final List<Field> fields = t2.getFields();\n\n Iterator<Field> fieldIterator = fields.iterator();\n Map<String, Field> nameFieldMap = new HashMap<String, Field>();\n\n while (fieldIterator.hasNext())\n {\n Field f = fieldIterator.next();\n nameFieldMap.put(f.getName(),\n f);\n }\n\n final Field idField = nameFieldMap.get(\"ID2\");\n assertEquals(Type.NUMBER,\n idField.getType());\n assertEquals(idField.getLength(),\n 4);\n\n final Field stringField = nameFieldMap.get(\"MEMOFIELD\");\n assertEquals(Type.MEMO,\n stringField.getType());\n assertEquals(10,\n stringField.getLength());\n\n final Iterator<Record> recordIterator = t2.recordIterator();\n final Record r = recordIterator.next();\n\n String declarationOfIndependence = \"\";\n\n declarationOfIndependence += \"When in the Course of human events it becomes necessary for one people \";\n declarationOfIndependence += \"to dissolve the political bands which have connected them with another and \";\n declarationOfIndependence += \"to assume among the powers of the earth, the separate and equal station to \";\n declarationOfIndependence += \"which the Laws of Nature and of Nature's God entitle them, a decent respect \";\n declarationOfIndependence += \"to the opinions of mankind requires that they should declare the causes which \";\n declarationOfIndependence += \"impel them to the separation.\";\n declarationOfIndependence += \"\\r\\n\\r\\n\";\n declarationOfIndependence += \"We hold these truths to be self-evident, that all men are created equal, \";\n declarationOfIndependence += \"that they are endowed by their Creator with certain unalienable Rights, \";\n declarationOfIndependence += \"that among these are Life, Liberty and the persuit of Happiness.\";\n\n assertEquals(1,\n r.getNumberValue(\"ID2\"));\n assertEquals(declarationOfIndependence,\n r.getStringValue(\"MEMOFIELD\"));\n }\n finally\n {\n t2.close();\n }\n }", "@Insert({ \"insert into csv_file (id, pid, \", \"filename, start_time, \", \"end_time, length, \", \"density, machine, \",\n\t\t\t\"ar, path, size, \", \"uuid, header_time, \", \"last_update, conflict_resolved, \", \"status, comment, \",\n\t\t\t\"width, start_version, \", \"end_version)\", \"values (#{id,jdbcType=INTEGER}, #{pid,jdbcType=VARCHAR}, \",\n\t\t\t\"#{filename,jdbcType=VARCHAR}, #{startTime,jdbcType=TIMESTAMP}, \",\n\t\t\t\"#{endTime,jdbcType=TIMESTAMP}, #{length,jdbcType=INTEGER}, \",\n\t\t\t\"#{density,jdbcType=DOUBLE}, #{machine,jdbcType=VARCHAR}, \",\n\t\t\t\"#{ar,jdbcType=BIT}, #{path,jdbcType=VARCHAR}, #{size,jdbcType=BIGINT}, \",\n\t\t\t\"#{uuid,jdbcType=CHAR}, #{headerTime,jdbcType=TIMESTAMP}, \",\n\t\t\t\"#{lastUpdate,jdbcType=TIMESTAMP}, #{conflictResolved,jdbcType=BIT}, \",\n\t\t\t\"#{status,jdbcType=INTEGER}, #{comment,jdbcType=VARCHAR}, \",\n\t\t\t\"#{width,jdbcType=INTEGER}, #{startVersion,jdbcType=INTEGER}, \", \"#{endVersion,jdbcType=INTEGER})\" })\n\tint insert(CsvFile record);", "public void database() throws IOException\n {\n \tFile file =new File(\"data.txt\");\n\t if(!file.exists())\n\t {\n\t \tSystem.out.println(\"File 'data.txt' does not exit\");\n\t System.out.println(file.createNewFile());\n\t file.createNewFile();\n\t databaseFileWrite(file);//call the databaseFileRead() method, to initialize data from ArrayList and write data into data.txt\n\t }\n\t else\n\t {\n\t \tdatabaseFileRead();//call the databaseFileRead() method, to load data directly from data.txt\n\t }\n }", "@Override\n\tpublic void CreateDatabaseFromFile() {\n\t\tfinal String FILENAME = \"fandv.sql\";\n\t\tint[] updates = null;\n\t\ttry {\n\t\t\tMyDatabase db = new MyDatabase();\n\t\t\tupdates = db.updateAll(FILENAME);\n\t\t} catch (FileNotFoundException | SQLException | ClassNotFoundException e) {\n\t\t\tSystem.out.println(\"Database issue\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tint sum = 0;\n\t\tfor (int i = 0; i < updates.length; i++) {\n\t\t\tsum += updates[i];\n\t\t}\n\t\tSystem.out.println(\"Number of updates: \" + sum);\n\t}", "public GEMFileRockDao() {\n gemFileDb = RocksDatabase.getInstance(DB_NAME, String.class, GEMFile.class);\n gemFileFileTypesDb =\n RocksDatabase.getInstance(DB_NAME + \"_FileType\", String.class, Integer.class);\n gemFileState = RocksDatabase.getInstance(DB_NAME + \"_FileState\", String.class, String.class);\n gemFileState.put(STATE_SYNC_PROGRESS, String.valueOf(SYNC_COMPLETE));\n }", "public DBInternal(File directory, DBOptions options) {\n this.directory = directory;\n this.options = options;\n // TODO: check options.\n\n // TODO: rebuid index.\n\n // TODO: initialize fileID. Make sure the starting number is the largest number used so far.\n\n // TODO: open a current file writer.\n\n // TODO: start offline compaction.\n\n }", "public final void executeSQL(Connection conn,DbConnVO vo,String fileName) throws Throwable {\r\n PreparedStatement pstmt = null;\r\n StringBuffer sql = new StringBuffer(\"\");\r\n InputStream in = null;\r\n\r\n try {\r\n try {\r\n in = this.getClass().getResourceAsStream(\"/\" + fileName);\r\n }\r\n catch (Exception ex5) {\r\n }\r\n if (in==null)\r\n in = new FileInputStream(org.openswing.swing.util.server.FileHelper.getRootResource() + fileName);\r\n\r\n BufferedReader br = new BufferedReader(new InputStreamReader(in));\r\n String line = null;\r\n ArrayList vals = new ArrayList();\r\n int pos = -1;\r\n String oldfk = null;\r\n String oldIndex = null;\r\n StringBuffer newIndex = null;\r\n StringBuffer newfk = null;\r\n ArrayList fks = new ArrayList();\r\n ArrayList indexes = new ArrayList();\r\n boolean fkFound = false;\r\n boolean indexFound = false;\r\n String defaultValue = null;\r\n int index = -1;\r\n StringBuffer unicode = new StringBuffer();\r\n boolean useDefaultValue = false;\r\n// vo.getDriverName().equals(\"oracle.jdbc.driver.OracleDriver\") ||\r\n// vo.getDriverName().equals(\"com.microsoft.jdbc.sqlserver.SQLServerDriver\") ||\r\n//\t\t\t\t\tvo.getDriverName().equals(\"com.microsoft.sqlserver.jdbc.SQLServerDriver\") ||\r\n// vo.getDriverName().equals(\"com.mysql.jdbc.Driver\");\r\n while ( (line = br.readLine()) != null) {\r\n sql.append(' ').append(line);\r\n if (line.endsWith(\";\")) {\r\n if (vo.getDriverName().equals(\"oracle.jdbc.driver.OracleDriver\")) {\r\n sql = replace(sql, \" VARCHAR(\", \" VARCHAR2(\");\r\n sql = replace(sql, \" NUMERIC(\", \" NUMBER(\");\r\n sql = replace(sql, \" DECIMAL(\", \" NUMBER(\");\r\n sql = replace(sql, \" TIMESTAMP\", \" DATE \");\r\n sql = replace(sql, \" DATETIME\", \" DATE \");\r\n }\r\n else if (vo.getDriverName().equals(\"com.microsoft.jdbc.sqlserver.SQLServerDriver\")) {\r\n sql = replace(sql, \" TIMESTAMP\", \" DATETIME \");\r\n sql = replace(sql, \" DATE \", \" DATETIME \");\r\n }\r\n else if (vo.getDriverName().equals(\"com.microsoft.sqlserver.jdbc.SQLServerDriver\")) {\r\n sql = replace(sql, \" TIMESTAMP\", \" DATETIME \");\r\n sql = replace(sql, \" DATE \", \" DATETIME \");\r\n }\r\n else if (vo.getDriverName().toLowerCase().contains(\"postgres\")) {\r\n sql = replace(sql, \" DATETIME\", \" TIMESTAMP \");\r\n sql = replace(sql, \" DATE \", \" TIMESTAMP \");\r\n }\r\n else {\r\n sql = replace(sql, \" DATE \", \" DATETIME \");\r\n }\r\n\r\n\r\n sql = replace(sql,\"ON DELETE NO ACTION\",\"\");\r\n sql = replace(sql,\"ON UPDATE NO ACTION\",\"\");\r\n\r\n if (sql.indexOf(\":COMPANY_CODE\") != -1) {\r\n sql = replace(sql, \":COMPANY_CODE\", \"'\" + vo.getCompanyCode() + \"'\");\r\n }\r\n if (sql.indexOf(\":COMPANY_DESCRIPTION\") != -1) {\r\n sql = replace(sql, \":COMPANY_DESCRIPTION\",\r\n \"'\" + vo.getCompanyDescription() + \"'\");\r\n }\r\n if (sql.indexOf(\":LANGUAGE_CODE\") != -1) {\r\n sql = replace(sql, \":LANGUAGE_CODE\",\r\n \"'\" + vo.getLanguageCode() + \"'\");\r\n }\r\n if (sql.indexOf(\":LANGUAGE_DESCRIPTION\") != -1) {\r\n sql = replace(sql, \":LANGUAGE_DESCRIPTION\",\r\n \"'\" + vo.getLanguageDescription() + \"'\");\r\n }\r\n if (sql.indexOf(\":CLIENT_LANGUAGE_CODE\") != -1) {\r\n sql = replace(sql, \":CLIENT_LANGUAGE_CODE\",\r\n \"'\" + vo.getClientLanguageCode() + \"'\");\r\n }\r\n if (sql.indexOf(\":PASSWORD\") != -1) {\r\n sql = replace(sql, \":PASSWORD\", \"'\" + vo.getAdminPassword() + \"'\");\r\n }\r\n if (sql.indexOf(\":DATE\") != -1) {\r\n sql = replace(sql, \":DATE\", \"?\");\r\n vals.add(new java.sql.Date(System.currentTimeMillis()));\r\n }\r\n\r\n if (sql.indexOf(\":CURRENCY_CODE\") != -1) {\r\n sql = replace(sql, \":CURRENCY_CODE\", \"'\" + vo.getCurrencyCodeREG03() + \"'\");\r\n }\r\n if (sql.indexOf(\":CURRENCY_SYMBOL\") != -1) {\r\n sql = replace(sql, \":CURRENCY_SYMBOL\", \"'\" + vo.getCurrencySymbolREG03() + \"'\");\r\n }\r\n if (sql.indexOf(\":DECIMALS\") != -1) {\r\n sql = replace(sql, \":DECIMALS\", vo.getDecimalsREG03().toString());\r\n }\r\n if (sql.indexOf(\":DECIMAL_SYMBOL\") != -1) {\r\n sql = replace(sql, \":DECIMAL_SYMBOL\", \"'\" + vo.getDecimalSymbolREG03() + \"'\");\r\n }\r\n if (sql.indexOf(\":THOUSAND_SYMBOL\") != -1) {\r\n sql = replace(sql, \":THOUSAND_SYMBOL\", \"'\" + vo.getThousandSymbolREG03() + \"'\");\r\n }\r\n\r\n if (sql.indexOf(\":USE_VARIANT_TYPE_1\") != -1) {\r\n sql = replace(sql, \":USE_VARIANT_TYPE_1\", \"'\" + vo.getUseVariantType1() + \"'\");\r\n }\r\n if (sql.indexOf(\":USE_VARIANT_TYPE_2\") != -1) {\r\n sql = replace(sql, \":USE_VARIANT_TYPE_2\", \"'\" + vo.getUseVariantType2() + \"'\");\r\n }\r\n if (sql.indexOf(\":USE_VARIANT_TYPE_3\") != -1) {\r\n sql = replace(sql, \":USE_VARIANT_TYPE_3\", \"'\" + vo.getUseVariantType3() + \"'\");\r\n }\r\n if (sql.indexOf(\":USE_VARIANT_TYPE_4\") != -1) {\r\n sql = replace(sql, \":USE_VARIANT_TYPE_4\", \"'\" + vo.getUseVariantType4() + \"'\");\r\n }\r\n if (sql.indexOf(\":USE_VARIANT_TYPE_5\") != -1) {\r\n sql = replace(sql, \":USE_VARIANT_TYPE_5\", \"'\" + vo.getUseVariantType5() + \"'\");\r\n }\r\n\r\n if (sql.indexOf(\":VARIANT_1\") != -1) {\r\n sql = replace(sql, \":VARIANT_1\", \"'\" + (vo.getVariant1()==null || vo.getVariant1().trim().equals(\"\")?ApplicationConsts.JOLLY:vo.getVariant1()) + \"'\");\r\n }\r\n if (sql.indexOf(\":VARIANT_2\") != -1) {\r\n sql = replace(sql, \":VARIANT_2\", \"'\" + (vo.getVariant2()==null || vo.getVariant2().trim().equals(\"\")?ApplicationConsts.JOLLY:vo.getVariant2()) + \"'\");\r\n }\r\n if (sql.indexOf(\":VARIANT_3\") != -1) {\r\n sql = replace(sql, \":VARIANT_3\", \"'\" + (vo.getVariant3()==null || vo.getVariant3().trim().equals(\"\")?ApplicationConsts.JOLLY:vo.getVariant3()) + \"'\");\r\n }\r\n if (sql.indexOf(\":VARIANT_4\") != -1) {\r\n sql = replace(sql, \":VARIANT_4\", \"'\" + (vo.getVariant4()==null || vo.getVariant4().trim().equals(\"\")?ApplicationConsts.JOLLY:vo.getVariant4()) + \"'\");\r\n }\r\n if (sql.indexOf(\":VARIANT_5\") != -1) {\r\n sql = replace(sql, \":VARIANT_5\", \"'\" + (vo.getVariant5()==null || vo.getVariant5().trim().equals(\"\")?ApplicationConsts.JOLLY:vo.getVariant5()) + \"'\");\r\n }\r\n\r\n if (!useDefaultValue)\r\n while((pos=sql.indexOf(\"DEFAULT \"))!=-1) {\r\n defaultValue = sql.substring(pos, sql.indexOf(\",\", pos));\r\n sql = replace(\r\n sql,\r\n defaultValue,\r\n \"\"\r\n );\r\n }\r\n\r\n fkFound = false;\r\n while((pos=sql.indexOf(\"FOREIGN KEY\"))!=-1) {\r\n oldfk = sql.substring(pos,sql.indexOf(\")\",sql.indexOf(\")\",pos)+1)+1);\r\n sql = replace(\r\n sql,\r\n oldfk,\r\n \"\"\r\n );\r\n newfk = new StringBuffer(\"ALTER TABLE \");\r\n newfk.append(sql.substring(sql.indexOf(\" TABLE \")+7,sql.indexOf(\"(\")).trim());\r\n newfk.append(\" ADD \");\r\n newfk.append(oldfk);\r\n fks.add(newfk);\r\n fkFound = true;\r\n }\r\n\r\n if (fkFound)\r\n sql = removeCommasAtEnd(sql);\r\n\r\n indexFound = false;\r\n while((pos=sql.indexOf(\"INDEX \"))!=-1) {\r\n oldIndex = sql.substring(pos,sql.indexOf(\")\",pos)+1);\r\n sql = replace(\r\n sql,\r\n oldIndex,\r\n \"\"\r\n );\r\n newIndex = new StringBuffer(\"CREATE \");\r\n newIndex.append(oldIndex.substring(0,oldIndex.indexOf(\"(\")));\r\n newIndex.append(\" ON \");\r\n newIndex.append(sql.substring(sql.indexOf(\" TABLE \")+7,sql.indexOf(\"(\")).trim());\r\n newIndex.append( oldIndex.substring(oldIndex.indexOf(\"(\")) );\r\n indexes.add(newIndex);\r\n indexFound = true;\r\n }\r\n\r\n if (indexFound)\r\n sql = removeCommasAtEnd(sql);\r\n\r\n // check for unicode chars...\r\n while((index=sql.indexOf(\"\\\\u\"))!=-1) {\r\n for(int i=index+2;i<Math.min(sql.length(),index+2+6);i++)\r\n if (Character.isDigit(sql.charAt(i)) ||\r\n sql.charAt(i)=='A' ||\r\n sql.charAt(i)=='B' ||\r\n sql.charAt(i)=='C' ||\r\n sql.charAt(i)=='D' ||\r\n sql.charAt(i)=='E' ||\r\n sql.charAt(i)=='F')\r\n if (unicode.length() < 4)\r\n unicode.append(sql.charAt(i));\r\n else\r\n break;\r\n if (unicode.length()>0) {\r\n sql.delete(index, index+1+unicode.length());\r\n sql.setCharAt(index, new Character((char)Integer.valueOf(unicode.toString(),16).intValue()).charValue());\r\n unicode.delete(0, unicode.length());\r\n }\r\n }\r\n\r\n\r\n if (sql.toString().toUpperCase().contains(\"DROP TABLE\")) {\r\n // remove fks before dropping table!\r\n String table = sql.toString().toUpperCase().replace('\\n',' ').replace('\\r',' ').trim();\r\n table = table.substring(10).trim();\r\n if (table.endsWith(\";\"))\r\n table = table.substring(0,table.length()-1);\r\n ResultSet rset = conn.getMetaData().getExportedKeys(null,vo.getUsername().toUpperCase(),table);\r\n String fkName = null;\r\n String tName = null;\r\n Statement stmt2 = conn.createStatement();\r\n boolean fksFound = false;\r\n while(rset.next()) {\r\n fksFound = true;\r\n tName = rset.getString(7);\r\n fkName = rset.getString(12);\r\n\r\n if (vo.getDriverName().equals(\"com.mysql.jdbc.Driver\"))\r\n stmt2.execute(\"ALTER TABLE \"+tName+\" DROP FOREIGN KEY \"+fkName);\r\n else\r\n stmt2.execute(\"ALTER TABLE \"+tName+\" DROP CONSTRAINT \"+fkName);\r\n }\r\n try {\r\n rset.close();\r\n }\r\n catch (Exception ex6) {}\r\n\r\n if (!fksFound &&\r\n !vo.getDriverName().equals(\"oracle.jdbc.driver.OracleDriver\") &&\r\n !vo.getDriverName().equals(\"com.microsoft.jdbc.sqlserver.SQLServerDriver\") &&\r\n !vo.getDriverName().equals(\"com.microsoft.sqlserver.jdbc.SQLServerDriver\") &&\r\n !vo.getDriverName().equals(\"com.mysql.jdbc.Driver\")\r\n && !vo.getDriverName().equals(\"org.sqlite.JDBC\")) {\r\n // case postgres...\r\n rset = conn.getMetaData().getExportedKeys(null,null,null);\r\n while(rset.next()) {\r\n if (rset.getString(3).toUpperCase().equals(table)) {\r\n tName = rset.getString(7);\r\n fkName = rset.getString(12);\r\n\r\n if (vo.getDriverName().equals(\"com.mysql.jdbc.Driver\"))\r\n stmt2.execute(\"ALTER TABLE \"+tName+\" DROP FOREIGN KEY \"+fkName);\r\n else\r\n stmt2.execute(\"ALTER TABLE \"+tName+\" DROP CONSTRAINT \"+fkName);\r\n }\r\n }\r\n try {\r\n rset.close();\r\n }\r\n catch (Exception ex6) {}\r\n }\r\n\r\n try {\r\n stmt2.close();\r\n }\r\n catch (Exception ex6) {}\r\n\r\n } // end if\r\n\r\n if (sql.toString().trim().length()>0) {\r\n String query = sql.toString().substring(0,sql.length() - 1);\r\n System.out.println(\"Execute query: \" + query);\r\n pstmt = conn.prepareStatement(query);\r\n for (int i = 0; i < vals.size(); i++) {\r\n pstmt.setObject(i + 1, vals.get(i));\r\n }\r\n\r\n try {\r\n pstmt.execute();\r\n }\r\n catch (SQLException ex4) {\r\n try {\r\n if (sql.toString().toUpperCase().contains(\"DROP TABLE\")) {\r\n//\t\t\t\t\t\t\t\t\tLogger.error(\"NONAME\", this.getClass().getName(), \"executeSQL\",\r\n//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"Invalid SQL: \" + sql, ex4);\r\n }\r\n else\r\n throw ex4;\r\n }\r\n catch (Exception exx4) {\r\n throw ex4;\r\n }\r\n }\r\n pstmt.close();\r\n }\r\n\r\n sql.delete(0, sql.length());\r\n vals.clear();\r\n }\r\n }\r\n br.close();\r\n\r\n for(int i=0;i<fks.size();i++) {\r\n sql = (StringBuffer)fks.get(i);\r\n pstmt = conn.prepareStatement(sql.toString());\r\n try {\r\n pstmt.execute();\r\n }\r\n catch (SQLException ex4) {\r\n Logger.error(\"NONAME\", this.getClass().getName(), \"executeSQL\",\r\n \"Invalid SQL: \" + sql, ex4);\r\n }\r\n pstmt.close();\r\n }\r\n\r\n for(int i=0;i<indexes.size();i++) {\r\n sql = (StringBuffer)indexes.get(i);\r\n pstmt = conn.prepareStatement(sql.toString());\r\n try {\r\n pstmt.execute();\r\n }\r\n catch (SQLException ex3) {\r\n Logger.error(\"NONAME\", this.getClass().getName(), \"executeSQL\",\r\n \"Invalid SQL: \" + sql, ex3);\r\n }\r\n pstmt.close();\r\n }\r\n\r\n conn.commit();\r\n\r\n }\r\n catch (Throwable ex) {\r\n try {\r\n Logger.error(\"NONAME\", this.getClass().getName(), \"executeSQL\",\r\n \"Invalid SQL: \" + sql, ex);\r\n }\r\n catch (Exception ex2) {\r\n }\r\n throw ex;\r\n }\r\n finally {\r\n try {\r\n if (pstmt!=null)\r\n pstmt.close();\r\n }\r\n catch (SQLException ex1) {\r\n }\r\n }\r\n }", "public DaoFileImpl(String path) {\r\n\t\tgson = new Gson();\r\n\t\tthis.path = path;\r\n\t\tthis.daoMap = new HashMap<>();\r\n\t\treadMapFromFile();\r\n\t}", "private void createDbRecords() throws IOException, JAXBException {\n }", "public DbRecord( String szFileName )\n throws FileNotFoundException, NullPointerException, AppException\n {\n Load( szFileName );\n }", "public interface IFileDao extends CrudDao<IFileEntity, IFileDto, Long> {\n\n IFileEntity createFile();\n\n Long saveFileUsingStream(IFileEntity fileEntity, InputStream inputStream) throws Exception;\n\n void writeFileContent(Long fileId, OutputStream outputStream) throws Exception;\n}", "public interface IFileDataTypeReader {\n\t\n\t Map<String, String> getColumnAndDataType(String fileName, ExtendedDetails dbDetails) throws ZeasException;\n\t\n\t List<List<String>> getColumnValues() throws ZeasException;\n}", "public void toSql(String baseDir, String out) throws IOException {\n Path pBase = Paths.get(baseDir);\n final String format = \"insert into files values(null,'%s','%s');\";\n List<String> files = new ArrayList<>();\n Files.walkFileTree(pBase, new SimpleFileVisitor<Path>() {\n @Override\n public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {\n String fileName = file.getFileName().toString();\n String path = file.toAbsolutePath().toString();\n if (filter(path) || filter(fileName)) {\n return FileVisitResult.CONTINUE;\n }\n if (fileName.length() > 128 || path.length() > 8096) {\n System.out.println(String.format(\"warning : %s %s exced the limit\", fileName, path));\n }\n\n\n String insert = String.format(format, fileName, path);\n files.add(insert);\n if (files.size() >= 10240) {\n write2File(out, files);\n files.clear();\n }\n return FileVisitResult.CONTINUE;\n }\n });\n write2File(out, files);\n }", "String getSchemaFile();", "public interface IWritableDatabase2 {\r\n\r\n\t/**\r\n\t * Add database links between tokens found a file, and the file path itself. \r\n\t * \r\n\t * @param strings A unique list of valid white-space separated tokens contained within a file\r\n\t * @param f The file containing the tokens\r\n\t * @param ignoreCase Whether to ignore the case of the tokens (always false?)\t * \r\n\t * @param debug Currently unused debug id\r\n\t */\r\n\tpublic void addBulkLinks(List<String> strings, boolean ignoreCase, File f, int debug);\t\t\r\n\r\n\t/** Once complete, write to the database. */\r\n\tpublic void writeDatabase();\r\n}", "public DataBase(String file) throws IOException {\n\t\tdataBase = new RandomAccessFile(file, \"rw\");\n\t\tdataBase.writeBytes(\"FEATURE_ID|FEATURE_NAME|FEATURE_CLASS|STATE_ALPHA|\"\n\t\t\t\t+ \"STATE_NUMERIC|COUNTY_NAME|COUNTY_NUMERIC|PRIMARY_LAT_DMS|PRIM_LONG_DMS|\"\n\t\t\t\t+ \"PRIM_LAT_DEC|PRIM_LONG_DEC|SOURCE_LAT_DMS|SOURCE_LONG_DMS|SOURCE_LAT_DEC|\"\n\t\t\t\t+ \"SOURCE_LONG_DEC|ELEV_IN_M|ELEV_IN_FT|MAP_NAME|DATE_CREATED|DATE_EDITED\\n\");\n\t}", "@Override\n\tpublic void onCreate(SQLiteDatabase db) {\n\t\tStringBuffer sb = new StringBuffer(\"create table fileinfo ( \");\n\t\tsb.append(\"id integer primary key autoincrement , \");\n\t\tsb.append(\"name varchar(20) , \");\n\t\tsb.append(\"fileurl varchar(60) ,\");\n\t\tsb.append(\"path varchar(60) , \");\n\t\tsb.append(\"size varchar(30) , \");\n\t\tsb.append(\"time varchar(30)\");\n\t\tsb.append(\")\");\n\t\ttry {\n\t\t\tdb.execSQL(sb.toString());\n\t\t\tLog.d(\"TAG\", \"创建数据库表成功\");\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t}", "public interface DBStructure {\n\n String save(DataSource dataSource);\n\n void update(DataSource dataSource, String fileMask) throws UpdateException;\n\n void dropAll(DataSource dataSource) throws DropAllException;\n\n String getSqlScript(DataSource dataSource);\n\n void unlock(DataSource dataSource);\n}", "public abstract String createDBString();", "public void run() throws DatabaseException, FileNotFoundException {\n new File(FileName).delete();\n\n // Create the database object.\n // There is no environment for this simple example.\n DatabaseConfig config = new DatabaseConfig();\n config.setErrorStream(System.err);\n config.setErrorPrefix(\"BulkAccessExample\");\n config.setType(DatabaseType.BTREE);\n config.setAllowCreate(true);\n config.setMode(0644);\n Database table = new Database(FileName, null, config);\n\n //\n // Insert records into the database, where the key is the user\n // input and the data is the user input in reverse order.\n //\n InputStreamReader reader = new InputStreamReader(System.in);\n\n for (;;) {\n String line = askForLine(reader, System.out, \"input> \");\n if (line == null || (line.compareToIgnoreCase(\"end\") == 0))\n break;\n\n String reversed = (new StringBuffer(line)).reverse().toString();\n\n // See definition of StringEntry below\n //\n StringEntry key = new StringEntry(line);\n StringEntry data = new StringEntry(reversed);\n\n try {\n if (table.putNoOverwrite(null, key, data) == OperationStatus.KEYEXIST)\n System.out.println(\"Key \" + line + \" already exists.\");\n } catch (DatabaseException dbe) {\n System.out.println(dbe.toString());\n }\n System.out.println(\"\");\n }\n\n // Acquire a cursor for the table.\n Cursor cursor = table.openCursor(null, null);\n DatabaseEntry foo = new DatabaseEntry();\n\n MultipleKeyDataEntry bulk_data = new MultipleKeyDataEntry();\n bulk_data.setData(new byte[1024 * 1024]);\n bulk_data.setUserBuffer(1024 * 1024, true);\n\n // Walk through the table, printing the key/data pairs.\n //\n while (cursor.getNext(foo, bulk_data, null) == OperationStatus.SUCCESS) {\n StringEntry key, data;\n key = new StringEntry();\n data = new StringEntry();\n\n while (bulk_data.next(key, data))\n System.out.println(key.getString() + \" : \" + data.getString());\n }\n cursor.close();\n table.close();\n }", "public abstract void loadFromDatabase();", "public String getDbTable() {return dbTable;}", "public void putFile(Connection conn, File cond) throws Exception{\n\t//System.out.println(cond);\n\t//Check for LFN\n\tString LFN = cond.getLogicalFileName ( );\n\tif(LFN == null || LFN==\"\") throw new DBSException(\"Input Data Error\", \"LogicalFileName is expected.\");\n\t//Check is_file_valid\n\tint fileValid = cond.getIsFileValid( );\n if(fileValid == -1) throw new DBSException(\"Input Data Error\", \"Validation of File is expected.\");\n\t//Check if Datset already in db\n\tDataset ds = cond.getDatasetDO();\n\t//System.out.println(ds);\n\tif(ds == null)throw new DBSException(\"Input Data Error\", \"Dataset is expected.\");\n\tif(ds.getDatasetID( ) == 0){\n\t String dsName = ds.getDataset();\n\t if((dsName == null) || (dsName==\"\"))throw new DBSException(\"Input Data Error\", \"Dataset name is missing\");\n\t JSONArray dss = (new DatasetQO()).listDatasets(conn, ds);\n\t if(dss.length() != 1)\n\t\tthrow new DBSException(\"Input Data Error\", \"dataset name :\" + dsName \n\t\t+\" is not found or more than one found in the db.\");\n\t else{ \n\t\tds.setDatasetID(((Dataset)dss.getJSONObject(0)).getDatasetID());\n\t\t//ds.setDataset(((Dataset)dss.getJSONObject(0)).getDataset());\n\t }\n\t}\n //System.out.println(cond);\n\tBlock bk = cond.getBlockDO();\n\tif(bk == null) throw new DBSException(\"Input Data Error\", \"Block is expected.\");\n\tif(bk.getBlockID() == 0){\n\t String bkName = bk.getBlockName();\n\t if(bkName == null || bkName == \"\")throw new DBSException(\"Input Data Error\", \"Block name is missing\");\n\t JSONArray bks = (new BlockQO()).listBlocks(conn, bk);\n\t if(bks.length() != 1 )\n\t\tthrow new DBSException(\"Input Data Error\", \"More than one or no Blocks are found in the db with name: \"\n\t\t + bkName);\n\t else {\n\t\tbk.setBlockID(((Block)bks.getJSONObject(0)).getBlockID());\n\t\t//System.out.println(\"Block : \" + bk);\n\t }\n\t}\n\t//\n\t//System.out.println(\"Check for file_type\");\n\tFileType ft = cond.getFileTypeDO();\n if(ft == null)throw new DBSException(\"Input Data Error\", \"File type is expected.\");\n if(ft.getFileTypeID( ) == 0){\n String ftName = ft.getFileType();\n if((ftName == null) || (ftName == \"\"))throw new DBSException(\"Input Data Error\", \"File type is missing\");\n JSONArray fts = (new FileTypeQO()).listFileTypes(conn, ft);\n if(fts.length() != 1)\n throw new DBSException(\"Input Data Error\", \"File type :\" + ftName\n +\" is not found or more than one found in the db.\");\n else\n ft.setFileTypeID(((FileType)fts.getJSONObject(0)).getFileTypeID());\n }\n\t//System.out.println(\"File type: \" + ft);\n\t//check for Primary key\n\tint fileID = cond.getFileID ( );\n\tif(fileID == 0){\n\t try{\n\t\tfileID = SequenceManager.getSequence(conn, \"SEQ_FL\");\n\t\tcond. setFileID(fileID);\n\t }catch (SQLException ex) {\n\t\tthrow ex;\n\t }\n\t}\n\t//\n\t//System.out.println(\"Check for check-sum\");\n\tString cs = cond.getCheckSum();\n if(cs == null || cs == \"\")throw new DBSException(\"Input Data Error\", \"File check-sum is expected.\");\n\t//check for event_count\n\tif (cond.getEventCount() == -1) throw new DBSException(\"Input Data Error\", \"File event count is expected.\");\n\t//check for file size\n\tif(cond.getFileSize() == -1) throw new DBSException(\"Input Data Error\", \"File size is expected.\");\n\t//System.out.println(\"Check for creation_date and created_by. \\n\");\n\tlong createDate = cond.getCreationDate( );\n\tString createdBy = cond.getCreateBy( );\n\t//System.out.println(\"****File**** \" + cond);\n\tif(createDate == 0)cond.setCreationDate(DBSSrvcUtil.getEpoch());\n if(createdBy == null || createdBy==\"\")cond.setCreateBy(\"WeNeed2FindWhoDidIt\");\n\t \t\n\t//Now we are ready to insert into the dataset\n\t//System.out.println(\"Ready to insert file :\" + cond);\n\tinsertTable(conn, cond, \"FILES\");\n }", "public int getDbType();", "int insert(DiaryFile record);", "@Repository\npublic interface DBFileRepository extends JpaRepository<DBFile, Long> {\n\n}", "public DataWriter(String dbPath) {\n databasePath = dbPath;\n }", "public DB(String db) throws ClassNotFoundException, SQLException {\n // Set up a connection and store it in a field\n Class.forName(\"org.sqlite.JDBC\");\n String url = \"jdbc:sqlite:\" + db;\n\n // stop conn from creating a file if does not exists\n SQLiteConfig config = new SQLiteConfig();\n config.resetOpenMode(SQLiteOpenMode.CREATE);\n\n //connect to the file\n conn = DriverManager.getConnection(url, config.toProperties());\n try (Statement stat = conn.createStatement();) {\n stat.executeUpdate(\"PRAGMA foreign_keys = ON;\");\n }\n }", "public Dataset openTDB(String directory){\n Dataset dataset = TDBFactory.createDataset(directory);\n return dataset;\n}", "public ProjectFilesDAOImpl() {\r\n super();\r\n }", "int insert(FileRecordAdmin record);", "public void writeDatabase();", "public static boolean addFile(TranslationFile bf) {\n System.out.println(\"File added to database.\");\n DatabaseOperations.addOrUpdateFileName(bf.getFileID(), bf.getFileName());\n String sql = \"INSERT OR REPLACE INTO corpus1(id, fileID, fileName, thai, english, committed, removed, rank) VALUES(?,?,?,?,?,?,?,?)\";\n\n try (Connection conn = DatabaseOperations.connect();\n PreparedStatement pstmt = conn.prepareStatement(sql)) {\n\n conn.setAutoCommit(false);\n\n // this makes sure that the segments in the file, when retrieved from the db, can be ordered in the proper order.\n // simply increments by 1 on each segment. \n int rank = 0;\n // keeps count of the number of segs added so that the SQL can run a batch transaction (which is much more efficient than individual transactions).\n // when i=1000, or at the last segment, the SQL is then run as one batch transaction.\n int i = 0;\n\n for (Segment seg : bf.getActiveSegs()) {\n\n pstmt.setDouble(1, seg.getID());\n pstmt.setDouble(2, seg.getFileID());\n pstmt.setString(3, seg.getFileName());\n pstmt.setString(4, seg.getThai());\n pstmt.setString(5, seg.getEnglish());\n // committed/removed booleans are stored as binary (0 = false, 1 = true)\n pstmt.setInt(6, seg.isCommitted() ? 1 : 0);\n // removed is set to \"false\"\n pstmt.setInt(7, 0);\n pstmt.setInt(8, rank);\n pstmt.addBatch();\n rank++;\n i++;\n\n if (i % 1000 == 0 || i == bf.getActiveSegs().size()) {\n pstmt.executeBatch(); //Execute every 1000 segments.\n }\n }\n\n // resetting counters\n i = 0;\n rank = 0;\n for (Segment seg : bf.getHiddenSegs()) {\n\n pstmt.setDouble(1, seg.getID());\n pstmt.setDouble(2, seg.getFileID());\n pstmt.setString(3, seg.getFileName());\n pstmt.setString(4, seg.getThai());\n pstmt.setString(5, seg.getEnglish());\n // committed/removed booleans are stored as binary (0 = false, 1 = true)\n pstmt.setInt(6, seg.isCommitted() ? 1 : 0);\n // removed is set to \"true\"\n pstmt.setInt(7, 1);\n pstmt.setInt(8, rank);\n pstmt.addBatch();\n rank++;\n i++;\n\n if (i % 1000 == 0 || i == bf.getHiddenSegs().size()) {\n pstmt.executeBatch(); //Execute every 1000 segments.\n }\n }\n conn.commit();\n return true;\n\n } catch (SQLException e) {\n System.out.println(\"AddFileAsBatch: \" + e.getMessage());\n return false;\n }\n }", "public long insert(FFileInputDO FFileInput) throws DataAccessException;", "private TexeraDb() {\n super(\"texera_db\", null);\n }", "private static void readDatabase(String path) {\n try {\n FileInputStream fileIn = new FileInputStream(path + \"/database.ser\");\n ObjectInputStream inStream = new ObjectInputStream(fileIn);\n database = (Database) inStream.readObject();\n inStream.close();\n fileIn.close();\n } catch (IOException i) {\n i.printStackTrace();\n } catch (ClassNotFoundException c) {\n c.printStackTrace();\n }\n }", "public DBFWriter(File dbfFile) throws Exception {\r\n\r\n\t\ttry {\r\n\r\n\t\t\tthis.raf = new RandomAccessFile(dbfFile, \"rw\");\r\n\t\t\tFileChannel fileChannel = this.raf.getChannel();\r\n\t\t\twhile (true) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tlock = fileChannel.lock();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} catch (OverlappingFileLockException e) {\r\n\t\t\t\t\tThread.sleep(2);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tthrow new Exception(e.getMessage());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t/*\r\n\t\t\t * before proceeding check whether the passed in File object is an\r\n\t\t\t * empty/non-existent file or not.\r\n\t\t\t */\r\n\t\t\tif (!dbfFile.exists() || dbfFile.length() == 0) {\r\n\t\t\t\tthis.header = new DBFHeader();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\theader = new DBFHeader();\r\n\t\t\tthis.header.read(raf);\r\n\r\n\t\t\t// back 5 char\r\n\t\t\tthis.raf.seek(this.raf.length() - 10);\r\n\t\t\tlong logEofIndex = 0;\r\n\t\t\twhile (true) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\t// the end byte 26\r\n\t\t\t\t\tif (this.raf.readByte() == 26) {\r\n\t\t\t\t\t\tlogEofIndex = this.raf.getFilePointer();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (EOFException ioe) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (logEofIndex == 0) {\r\n\t\t\t\tlogEofIndex = this.raf.length();\r\n\t\t\t} else {\r\n\t\t\t\tlogEofIndex--;\r\n\t\t\t}\r\n\t\t\t/* position file pointer at the end of the raf */\r\n\t\t\tthis.raf.seek(logEofIndex);\r\n\t\t\t// this.raf.seek( this.raf.length()-1 /* to ignore the END_OF_DATA\r\n\t\t\t// byte at EoF */);\r\n\r\n\t\t} catch (FileNotFoundException e) {\r\n\r\n\t\t\tthrow new DBFException(\"Specified file is not found. \" + e.getMessage());\r\n\t\t} catch (IOException e) {\r\n\r\n\t\t\tthrow new DBFException(e.getMessage() + \" while reading header\");\r\n\t\t}\r\n\t\tthis.recordCount = this.header.numberOfRecords;\r\n\t}", "public String getDbpediaFile() {\n\t\treturn DBPEDIA_FILE;\n\t}", "@Override\n public String getDbString() {\n return null;\n }", "public SimpleDatabase executeSqlFile(SQLiteDatabase db, @RawRes int id) {\n Scanner scan = context.openInternalFileScanner(id);\n String query = \"\";\n if (logging) Log.d(\"SimpleDB\", \"start reading file\");\n int queryCount = 0;\n while (scan.hasNextLine()) {\n String line = scan.nextLine().trim();\n if (line.startsWith(\"--\") || line.isEmpty()) {\n continue;\n } else {\n query += line + \"\\n\";\n }\n\n if (query.endsWith(\";\\n\")) {\n if (logging) Log.d(\"SimpleDB\", \"query: \\\"\" + query + \"\\\"\");\n db.execSQL(query);\n query = \"\";\n queryCount++;\n }\n }\n if (logging) Log.d(\"SimpleDB\", \"done reading file\");\n if (logging) Log.d(\"SimpleDB\", \"performed \" + queryCount + \" queries.\");\n return this;\n }", "public interface DbIterator {\n /**\n * Opens the iterator.\n * @throws NoSuchElementException when the iterator has no elements.\n * @throws DbException when there are problems opening/accessing the database.\n */\n public void open() throws NoSuchElementException, DbException, TransactionAbortedException;\n\n /**\n * Gets the next tuple from the operator (typically implementing by reading\n * from a child operator or an access method).\n *\n * @return The next tuple in the iterator.\n */\n public Tuple getNext() throws TransactionAbortedException;\n\n /**\n * Resets the iterator to the start.\n * @throws DbException When rewind is unsupported.\n */\n public void rewind() throws DbException, TransactionAbortedException;\n\n /**\n * Returns the TupleDesc associated with this DbIterator.\n */\n public TupleDesc getTupleDesc();\n\n /**\n * Closes the iterator.\n */\n public void close();\n}", "public boolean writePlicSnapshotToFile(File f, String dbSchema, String dataSource){\n try{\n //Obtener la conexion JDBC del proyecto\n InitialContext ctx = new InitialContext();\n DataSource ds = (DataSource) ctx.lookup(dataSource);\n Connection connection = ds.getConnection();\n\n\t String query = \"SELECT '\\\"'||REPLACE(COALESCE(globaluniqueidentifier,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(scientificname,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(institutioncode,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||COALESCE(to_char(datelastmodified,'YYYY-MM-DD HH24:MI:SS'),'')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(taxonrecordid,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(language,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(creators,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(distribution,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(abstract,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(kingdomtaxon,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(phylumtaxon,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(classtaxon,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(ordertaxon,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(familytaxon,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(genustaxon,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(synonyms,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(authoryearofscientificname,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(speciespublicationreference,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(commonnames,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(typification,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(contributors,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||COALESCE(to_char(datecreated,'YYYY-MM-DD'),'')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(habit,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(lifecycle,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(reproduction,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(annualcycle,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(scientificdescription,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(briefdescription,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(feeding,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(behavior,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(interactions,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(chromosomicnumbern,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(moleculardata,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(populationbiology,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(threatstatus,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(legislation,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(habitat,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(territory,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(endemicity,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(theuses,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(themanagement,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(folklore,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(thereferences,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(unstructureddocumentation,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(otherinformationsources,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(papers,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(identificationkeys,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(migratorydata,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(ecologicalsignificance,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(unstructurednaturalhistory,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(invasivenessdata,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(targetaudiences,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(version,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(urlimage1,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(captionimage1,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(urlimage2,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(captionimage2,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(urlimage3,''),'\\r\\n', ' ')||'\\\"' || ','\"+\n\t\t\t \"|| '\\\"'||REPLACE(COALESCE(captionimage3,''),'\\r\\n', ' ')||'\\\"'\"+\n\t\t\t \" AS aux \"+\n\t\t\t \"FROM \"+dbSchema+\".plic_snapshot;\";\n\n System.out.println(query);\n\n\t\t\tStatement st = connection.createStatement();\n\t\t\tResultSet rs = st.executeQuery(query); \n\n //Imprimir los datos en el archivo\n BufferedWriter out = new BufferedWriter(new FileWriter(f));\n\t\t\twhile (rs.next()) {\n\t\t\t\tout.write(rs.getString(\"aux\")+\"\\n\");\n\t\t\t}\n out.close();\n\n //Cerrar el resultset y el statement\n rs.close();\n\t\t\tst.close();\n\n //Resultado\n return true;\n }\n catch(Exception e){\n e.printStackTrace();\n return false;}\n }", "public interface FilesDAO extends CrudRepository<Files,Long> {\n}", "@Override\r\n\tpublic boolean supportsDb(String type) {\r\n \treturn true;\r\n }", "@SuppressWarnings(\"rawtypes\") \npublic interface FFileInputDAO {\n\t/**\n\t * Insert one <tt>FFileInputDO</tt> object to DB table <tt>f_file_input</tt>, return primary key\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>insert into f_file_input(file_id,file_code,type,form_id,project_code,project_name,customer_id,customer_name,first_loan_time,filing_time,hand_over_dept,hand_over_man,hand_over_time,principal_man,vice_manager,receive_dept,receive_man,receive_time,status,raw_add_time) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)</tt>\n\t *\n\t *\t@param FFileInput\n\t *\t@return long\n\t *\t@throws DataAccessException\n\t */\t \n public long insert(FFileInputDO FFileInput) throws DataAccessException;\n\n\t/**\n\t * Update DB table <tt>f_file_input</tt>.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>update f_file_input set first_loan_time=?, filing_time=?, hand_over_dept=?, hand_over_man=?, hand_over_time=?, principal_man=?, vice_manager=?, receive_dept=?, receive_man=?, receive_time=?, status=? where (input_id = ?)</tt>\n\t *\n\t *\t@param FFileInput\n\t *\t@return int\n\t *\t@throws DataAccessException\n\t */\t \n public int update(FFileInputDO FFileInput) throws DataAccessException;\n\n\t/**\n\t * Query DB table <tt>f_file_input</tt> for records.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>select * from f_file_input where (input_id = ?)</tt>\n\t *\n\t *\t@param inputId\n\t *\t@return FFileInputDO\n\t *\t@throws DataAccessException\n\t */\t \n public FFileInputDO findById(long inputId) throws DataAccessException;\n\n\t/**\n\t * Query DB table <tt>f_file_input</tt> for records.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>select * from f_file_input where (form_id = ?)</tt>\n\t *\n\t *\t@param formId\n\t *\t@return List<FFileInputDO>\n\t *\t@throws DataAccessException\n\t */\t \n public List<FFileInputDO> findByFormId(long formId) throws DataAccessException;\n\n\t/**\n\t * Delete records from DB table <tt>f_file_input</tt>.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>delete from f_file_input where (input_id = ?)</tt>\n\t *\n\t *\t@param inputId\n\t *\t@return int\n\t *\t@throws DataAccessException\n\t */\t \n public int deleteById(long inputId) throws DataAccessException;\n\n\t/**\n\t * Query DB table <tt>f_file_input</tt> for records.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>select * from f_file_input where (1 = 1)</tt>\n\t *\n\t *\t@param FFileInput\n\t *\t@param limitStart\n\t *\t@param pageSize\n\t *\t@return List<FFileInputDO>\n\t *\t@throws DataAccessException\n\t */\t \n public List<FFileInputDO> findByCondition(FFileInputDO FFileInput, long limitStart, long pageSize) throws DataAccessException;\n\n\t/**\n\t * Query DB table <tt>f_file_input</tt> for records.\n\t *\n\t * <p>\n\t * The sql statement for this operation is <br>\n\t * <tt>select COUNT(*) from f_file_input where (1 = 1)</tt>\n\t *\n\t *\t@param FFileInput\n\t *\t@return long\n\t *\t@throws DataAccessException\n\t */\t \n public long findByConditionCount(FFileInputDO FFileInput) throws DataAccessException;\n\n}", "private static void loadTableData() {\n\n\t\tBufferedReader in = null;\n\t\ttry {\n\t\t\tin = new BufferedReader(new FileReader(dataDir + tableInfoFile));\n\n\t\t\twhile (true) {\n\n\t\t\t\t// read next line\n\t\t\t\tString line = in.readLine();\n\t\t\t\tif (line == null) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tString[] tokens = line.split(\" \");\n\t\t\t\tString tableName = tokens[0];\n\t\t\t\tString tableFileName = tokens[1];\n\n\t\t\t\ttableNameToSchema.put(tableName, new HashMap<String, Type>());\n\t\t\t\ttableNameToOrdredSchema.put(tableName,\n\t\t\t\t\t\tnew ArrayList<ColumnInfo>());\n\n\t\t\t\t// attributes data\n\t\t\t\tfor (int i = 2; i < tokens.length;) {\n\n\t\t\t\t\tString attName = tokens[i++];\n\t\t\t\t\tString attTypeName = (tokens[i++]);\n\n\t\t\t\t\tType attType = null;\n\n\t\t\t\t\t/*\n\t\t\t\t\t * Undefined, how to represent dates, crazy longs probably\n\t\t\t\t\t * won't need this for now...\n\t\t\t\t\t */\n\t\t\t\t\tif (attTypeName.equals(\"CHAR\")) {\n\t\t\t\t\t\tattType = Types.getCharType(Integer\n\t\t\t\t\t\t\t\t.valueOf(tokens[i++]));\n\t\t\t\t\t} else if (attTypeName.equals(\"DATE\")) {\n\t\t\t\t\t\tattType = Types.getDateType();\n\t\t\t\t\t} else if (attTypeName.equals(\"DOUBLE\")) {\n\t\t\t\t\t\tattType = Types.getDoubleType();\n\t\t\t\t\t} else if (attTypeName.equals(\"FLOAT\")) {\n\t\t\t\t\t\tattType = Types.getFloatType();\n\t\t\t\t\t} else if (attTypeName.equals(\"INTEGER\")) {\n\t\t\t\t\t\tattType = Types.getIntegerType();\n\t\t\t\t\t} else if (attTypeName.equals(\"LONG\")) {\n\t\t\t\t\t\tattType = Types.getLongType();\n\t\t\t\t\t} else if (attTypeName.equals(\"VARCHAR\")) {\n\t\t\t\t\t\tattType = Types.getVarcharType();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new RuntimeException(\"Invalid type: \"\n\t\t\t\t\t\t\t\t+ attTypeName);\n\t\t\t\t\t}\n\n\t\t\t\t\ttableNameToSchema.get(tableName).put(attName, attType);\n\n\t\t\t\t\tColumnInfo ci = new ColumnInfo(attName, attType);\n\t\t\t\t\ttableNameToOrdredSchema.get(tableName).add(ci);\n\n\t\t\t\t}\n\n\t\t\t\t// at this point, table info loaded.\n\n\t\t\t\t// Create table\n\t\t\t\tmyDatabase.getQueryInterface().createTable(tableName,\n\t\t\t\t\t\ttableNameToSchema.get(tableName));\n\n\t\t\t\t// Now, load data into newly created table\n\t\t\t\treadTable(tableName, tableFileName);\n\n\t\t\t}\n\n\t\t\tin.close();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tHelpers.print(e.getStackTrace().toString(),\n\t\t\t\t\tutil.Consts.printType.ERROR);\n\t\t}\n\n\t}", "CCDB2IndexFile(CCDB2Driver driver, File filePath) throws IOException\r\n\t{\r\n\t\tfFilePath = filePath;\r\n\t\tfFile = new CCDB2File(driver, fFilePath.getPath(), NULL_BYTE);\r\n\t}", "@Override\n\tpublic void createFile(FileModel file) {\n\t\tString sql = \"INSERT INTO file VALUES (?,?,?,?,?,?,now(),now())\";\n\t\t\n\t\tthis.getJdbcTemplate().update(sql, new Object[] { \n\t\t\t\tfile.getFile_id(),\n\t\t\t\tfile.getFile_path(),\n\t\t\t\tfile.getFile_name(),\n\t\t\t\tfile.getFile_type(),\n\t\t\t\tfile.getFile_size(),\n\t\t\t\tfile.getCretd_usr()\n\t\t});\n\t}", "public interface BerkeleydbDao<T> {\n\n /**\n * open database\n * */\n public void openConnection(String filePath, String databaseName) throws DatabaseException;\n\n /**\n * 关闭数据库\n * */\n public void closeConnection() throws DatabaseException;\n\n /**\n * insert\n * */\n public void save(String name, T t) throws DatabaseException;\n\n /**\n * delete\n * */\n public void delete(String name) throws DatabaseException;\n\n /**\n * update\n * */\n public void update(String name, T t) throws DatabaseException;\n\n /**\n * select\n * */\n public T get(String name) throws DatabaseException;\n\n}", "public String getDbPath() {\r\n return dbPath;\r\n }", "DatabaseInformationFull(Database db) {\n super(db);\n }", "public DbFileIterator iterator(final TransactionId tid) { \t\n// some code goes here\n \t\n \tDbFileIterator dbfi = new DbFileIterator() {\n \tint pgno = 0;\n \tHeapPage currPg = null;\n \tString name = Database.getCatalog().getTableName(getId());\n \tint tblid = Database.getCatalog().getTableId(name);\n \tint open = 0; \t\n \t\n \t//Todo: pass along the tid from the outer method.\n \t//DONE. by making tid param final.\n \tTransactionId m_tid = tid;\n \t\n \tIterator<Tuple> titr = null;\n \t\n\t\t\t@Override\n\t\t\tpublic void rewind() throws DbException, TransactionAbortedException {\n\t\t\t\tclose();\n\t\t\t\topen();\n\t\t\t}\n\t\t\t\n\t\t\tpublic void nextPage() throws DbException, TransactionAbortedException {\n\n\t\t\t\tif (pgno >= numPages())\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tcurrPg = (HeapPage) Database.getBufferPool().getPage(m_tid, new HeapPageId(tblid, pgno), simpledb.Permissions.READ_ONLY);\n\t\t\t\t\ttitr = currPg.iterator();\n\t\t\t\t\tif (titr == null)\n\t\t\t\t\t\tthrow new DbException(\"blah blah blah\");\n\t\t\t\t\tpgno++;\n\t\t\t\t\treturn;\n\t\t\t\t} catch (DbException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tthrow new DbException(\"page was not found or no more iterators..?\");\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void open() throws DbException, TransactionAbortedException {\n\t\t\t\topen = 1;\n\t\t\t\tpgno = 0;\n\t\t\t\tnextPage();\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic Tuple next() throws DbException, TransactionAbortedException,\n\t\t\t\t\tNoSuchElementException {\n\t\t\t\tif (open != 1)\n\t\t\t\t\tthrow new NoSuchElementException();\n\t\t\t\tif (!titr.hasNext())\n\t\t\t\t\tnextPage();\n\t\t\t\treturn titr.next();\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic boolean hasNext() throws DbException, TransactionAbortedException {\n\t\t\t\tif (open !=1)\n\t\t\t\t\treturn false;\n\t\t\t\tif (titr == null) //TODO: remove\n\t\t\t\t\tthrow new DbException(Integer.toString(pgno) + Integer.toString(open) + Integer.toString(numPages()) + m_f.getPath());\n\t\t\t\tif (!titr.hasNext())\n\t\t\t\t\tnextPage();\n\t\t\t\tif (titr.hasNext())\n\t\t\t\t\treturn true;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void close() {\n\t\t\t\topen = 0;\n\t\t\t\ttitr = null;\n\t\t\t}\n\t\t};\n return dbfi;\n }", "@Test(timeout = 4000)\n public void test112() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable(\"O\\\"6T\");\n File file0 = MockFile.createTempFile(\"<*kYz\", \"BLOB\");\n MockPrintWriter mockPrintWriter0 = new MockPrintWriter(file0);\n NameSpec nameSpec0 = NameSpec.ALWAYS;\n SQLUtil.renderCreateTable(defaultDBTable0, true, nameSpec0, mockPrintWriter0);\n assertNull(defaultDBTable0.getDoc());\n }", "public NameSurferDataBase(String filename) {\t\n\t\tnameData(filename);\n\t}", "public void init() {\r\n BufferedReader in = null;\r\n String line;\r\n PreparedStatement iStmt;\r\n String insertStmt = \"INSERT INTO \" + schema + \"ULDSHAPE \"\r\n + \"(SHAPE, ALLHGHT, ALLLENG, ALLWDTH, BIGPIC, DESCR, INTERNALVOLUME, INTHGHT, INTLENG, INTWDTH, \"\r\n + \"MAXGROSSWGHT, RATING, TAREWGHT, THUMBNAIL, UPDATED, UPDTUSER, VERSION) VALUES \"\r\n + \"(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\";\r\n int count = 0;\r\n\r\n LOG.log(Level.INFO, \"Initialize basic Uldshapes in DB from file [{0}]\", path);\r\n\r\n try {\r\n in = new BufferedReader(new InputStreamReader(new FileInputStream(path), StandardCharsets.UTF_8));\r\n\r\n iStmt = conn.prepareStatement(insertStmt);\r\n\r\n while ((line = in.readLine()) != null) {\r\n LOG.finer(line);\r\n\r\n UldshapeVO uldshapeVO = parseUldshape(line);\r\n\r\n iStmt.setString(1, uldshapeVO.getShape());\r\n iStmt.setInt(2, uldshapeVO.getAllhght());\r\n iStmt.setInt(3, uldshapeVO.getAllleng());\r\n iStmt.setInt(4, uldshapeVO.getAllwdth());\r\n iStmt.setBytes(5, uldshapeVO.getBigpic());\r\n iStmt.setString(6, uldshapeVO.getDescr());\r\n iStmt.setInt(7, uldshapeVO.getInternalvolume());\r\n iStmt.setInt(8, uldshapeVO.getInthght());\r\n iStmt.setInt(9, uldshapeVO.getIntleng());\r\n iStmt.setInt(10, uldshapeVO.getIntwdth());\r\n iStmt.setInt(11, uldshapeVO.getMaxgrosswght());\r\n iStmt.setString(12, uldshapeVO.getRating());\r\n iStmt.setInt(13, uldshapeVO.getTarewght());\r\n iStmt.setBytes(14, uldshapeVO.getThumbnail());\r\n iStmt.setTimestamp(15, DbUtil.getCurrentTimeStamp());\r\n iStmt.setString(16, uldshapeVO.getUpdtuser());\r\n iStmt.setLong(17, 0);\r\n\r\n // execute insert SQL stetement\r\n iStmt.executeUpdate();\r\n\r\n ++count;\r\n }\r\n LOG.log(Level.INFO, \"Finished: [{0}] ULDSHAPES loaded\", count);\r\n\r\n DbUtil.cleanupJdbc();\r\n }\r\n catch (IOException ioex) {\r\n LOG.log(Level.SEVERE, \"An IO error occured. The error message is: {0}\", ioex.getMessage());\r\n }\r\n catch (SQLException ex) {\r\n LOG.log(Level.SEVERE, \"An SQL error occured. The error message is: {0}\", ex.getMessage());\r\n }\r\n finally {\r\n if (in != null) {\r\n try {\r\n in.close();\r\n }\r\n catch (IOException e) {\r\n }\r\n }\r\n }\r\n }", "private void loadDatabase()\n\t{\n\t\ttry\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// Check to make sure the Bmod Database is there, if not, try \n\t\t\t\t// downloading from the website.\n\t\t\t\tif(!Files.exists(m_databaseFile))\n\t\t\t\t{\n\t\t\t\t\tFiles.createDirectories(m_databaseFile.getParent());\n\t\t\t\t\n\t\t\t\t\tbyte[] file = ExtensionPoints.readURLAsBytes(\"http://\" + Constants.API_HOST + HSQL_DATABASE_PATH);\n\t\t\t\t\tif(file.length != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tFiles.deleteIfExists(m_databaseFile);\n\t\t\t\t\t\tFiles.write(m_databaseFile, file, StandardOpenOption.CREATE, StandardOpenOption.WRITE);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// make sure we have the proper scriptformat.\n\t\t\t\tsetScriptFormatCorrectly();\n\t\t\t}catch(NullPointerException|IOException ex)\n\t\t\t{\n\t\t\t\tm_logger.error(\"Could not fetch database from web.\", ex);\n\t\t\t}\n\t\t\t\n\t\n\t\t\t\n\t\t\tClass.forName(\"org.hsqldb.jdbcDriver\");\n\t\t\n\t\t\t\n\t\t\tString db = ExtensionPoints.getBmodDirectory(\"database\").toUri().getPath();\n\t\t\tconnection = DriverManager.getConnection(\"jdbc:hsqldb:file:\" + db, \"sa\", \"\");\n\t\t\t\n\t\t\t// Setup Connection\n\t\t\tCSVRecordLoader ldr = new CSVRecordLoader();\n\t\t\n\t\t\t// Load all of the building independent plugins\n\t\t\tfor(Record<?> cp : ldr.getRecordPluginManagers())\n\t\t\t{\n\t\t\t\tm_logger.debug(\"Creating table: \" + cp.getTableName());\n\t\t\t\t// Create a new table\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tgetPreparedStatement(cp.getSQLTableDefn()).execute();\n\t\t\t\t} catch(SQLException ex)\n\t\t\t\t{\n\t\t\t\t\t// Table exists\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tm_logger.debug(\"Doing index:\" + cp.getIndexDefn());\n\t\t\t\t\tif(cp.getIndexDefn() != null)\n\t\t\t\t\t\tgetPreparedStatement(cp.getIndexDefn()).execute();\n\t\t\t\t}catch(SQLException ex)\n\t\t\t\t{\t// index exists\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\n\t\t} catch (Exception ex)\n\t\t{\n\t\t\tex.printStackTrace();\n\t\t\tif(ex instanceof DatabaseIntegrityException)\n\t\t\t\tDatabase.handleCriticalError((DatabaseIntegrityException)ex);\n\t\t\telse\n\t\t\t\tDatabase.handleCriticalError(new DatabaseIntegrityException(ex));\n\t\t}\n\t\t\n\t}", "public static void createNewDatabaseFile(String startPath)\r\n throws ConnectionFailedException, DatabaseException {\r\n boolean databaseCreated;\r\n try {\r\n databaseCreated = database.createNewFile();\r\n if (!databaseCreated) {\r\n throw new IOException(\"Cannot create file\");\r\n }\r\n\r\n URL databaseResource = Objects.requireNonNull(Paths.get(\r\n startPath + \"resources/database/database.sql\").toUri().toURL());\r\n String decodedPath = URLDecoder.decode(databaseResource.getPath(), \"UTF-8\");\r\n\r\n try (BufferedReader in = new BufferedReader(new FileReader(decodedPath))) {\r\n StringBuilder sqlQuery = new StringBuilder();\r\n while (in.ready()) {\r\n sqlQuery.append(in.readLine());\r\n if (sqlQuery.toString().endsWith(\";\")) {\r\n createBasicSqlTable(sqlQuery.toString());\r\n sqlQuery = new StringBuilder();\r\n }\r\n }\r\n }\r\n } catch (IOException e) {\r\n throwException(e);\r\n }\r\n }", "private String getDatabaseFilePath(NotesDatabase db) {\n try {\n return db.getFilePath();\n } catch (RepositoryException ex) {\n LOGGER.log(Level.WARNING, \"Unable to retrieve database's file path\", ex);\n return null;\n }\n }", "public Table readTable(String pathName, String filename){\n File file = new File(pathName + filename);\n Table newTable = null;\n Scanner sc; \n //foreign key aspects\n Boolean hasForeignKey = false;\n ArrayList<String> FKIndex; \n String[] line; \n String primaryTableName = \"\", primaryColName = \"\", colName = \"\"; \n String name = \"\";\n\n try {\n sc = new Scanner(file);\n } catch(FileNotFoundException ex) {\n System.out.println(\"ERROR: file not found\");\n return null;\n }\n\n //get table name - always first line\n if (sc.hasNextLine()){\n name = sc.nextLine();\n }\n\n FKIndex = getForeignKeyIndex(pathName);\n //loop over all rows in FKIndex, and check if table has a foreign key\n if(!FKIndex.isEmpty()){\n for(int i = 0; i < FKIndex.size(); i++){\n line = FKIndex.get(i).split(\"\\\\s\"); \n if (line[2].equals(name)){\n hasForeignKey = true;\n primaryTableName = line[0];\n primaryColName = line[1];\n colName = line[3];\n }\n }\n }\n\n //get col names - always second line\n if (sc.hasNextLine()){\n String colNamesString = sc.nextLine();\n //split colNames into individual words as Strings based on whitespace\n String[] colNames = colNamesString.split(\"\\\\s\");\n\n //make table with column names\n if (hasForeignKey){\n newTable = new Table(name, primaryTableName, primaryColName, colName, true, colNames);\n } else {\n newTable = new Table(name, colNames);\n }\n\n //add rows from file (each line)\n while(sc.hasNextLine()){\n String newRowString = sc.nextLine();\n String[] newRow = newRowString.split(\"\\\\s\");\n newTable.addRow(newRow);\n }\n }\n\n sc.close();\n return newTable;\n }", "private void createFileTableIndexes() throws Exception {\n \t\tdbManager\n \t\t\t\t.executeUpdate(\"create index FILE_ID_INDEX_FILE on FILE(FILE_ID)\");\n \t\tdbManager\n \t\t\t\t.executeUpdate(\"create index START_REVISION_ID_INDEX_FILE on FILE(START_REVISION_ID)\");\n \t\tdbManager\n \t\t\t\t.executeUpdate(\"create index END_REVISION_ID_INDEX_FILE on FILE(END_REVISION_ID)\");\n \t}", "public interface FileDataDao\r\n{\r\n\tpublic FileData uploadFile(UploadFileData ufd,int applicationId, String fileLocation,String rootLocation) throws FileAlreadyExistsException;\r\n\tpublic List<FileData> listRootFiles(int applicationId);\r\n\tpublic List<FileData> listFolderFiles(int applicationId,int parentCategoryId);\r\n\tpublic List<ApproveReject> approveFile(List<ApproveReject> approveList, int applicationId);\r\n\tpublic List<ApproveReject> rejectFile(List<ApproveReject> rejectList, int applicationId);\r\n\tpublic int getNoOfUploadedFiles(int applicationId);\r\n\tpublic List<FileDelete> deleteFiles(List<FileDelete> fileDeleteList, int applicationId);\r\n\tpublic int getRootId(int applicationId);\r\n\tpublic String getPhoto(int applicationId);\r\n}", "private void setupDb(){\n try {\n openConnection();\n s.executeUpdate(\"CREATE TABLE IF NOT EXISTS LIB (NAME text UNIQUE , TYPE text, LANGUAGE text, INTRUSIVE text, OPENSOURCE text)\");\n }catch (SQLException e) {\n System.err.println(e.getMessage());\n }finally {\n if (c != null){\n close(c);\n }\n }\n }", "Object getDB();", "private static void bindClobVarInFile(PreparedStatement ps, \n int index, \n ResultSet rs,\n int type)\n throws IOException, SQLException \n {\n InputStream is = rs.getAsciiStream(index);\n if (rs.wasNull()) {\n ps.setNull(index, type);\n return;\n }\n \n // Open file output stream\n long millis = System.currentTimeMillis();\n File f = File.createTempFile(\"clob\", \"\"+millis);\n f.deleteOnExit();\n FileOutputStream fos = new FileOutputStream(f);\n if (log.isDebugEnabled()) {\n //i18n[DBUtil.info.bindclobfile=bindClobVarInFile: Opening temp file '{0}']\n String msg = s_stringMgr.getString(\"DBUtil.info.bindclobfile\",\n f.getAbsolutePath());\n log.debug(msg);\n }\n \n // read rs input stream write to file output stream\n byte[] buf = new byte[_prefs.getFileCacheBufferSize()];\n int length = 0;\n int total = 0;\n while ((length = is.read(buf)) >= 0) {\n if (log.isDebugEnabled()) {\n //i18n[DBUtil.info.bindcloblength=bindClobVarInFile: writing '{0}' bytes.]\n String msg =\n s_stringMgr.getString(\"DBUtil.info.bindcloblength\",\n Integer.valueOf(length));\n log.debug(msg);\n }\n fos.write(buf, 0, length);\n total += length;\n }\n fos.close();\n \n // set the ps to read from the file we just created.\n FileInputStream fis = new FileInputStream(f);\n BufferedInputStream bis = new BufferedInputStream(fis);\n ps.setAsciiStream(index, bis, total);\n }", "NewsFile selectByPrimaryKey(Integer fileId);", "private FileOperations() throws FileNotFoundException {\r\n\t\tbiddingPersistence = new BiddingPersistence(Constants.biddingsFilePath, \r\n\t\t\t\tConstants.indexBiddingsPath);\r\n\t\tusersPersistence = new UsersPersistence(Constants.usersFilePath,\r\n\t\t\t\tConstants.indexUsersPath);\t\t\r\n\t}", "public String getDBString();", "static Vector< DbRecord > ReadRecords( String szDbDir )\n {\n File DbDir;\n File[] files;\n Vector<DbRecord> Users = new Vector<DbRecord>( 10, 10 );\n\n // Read all records to identify\n DbDir = new File( szDbDir );\n files = DbDir.listFiles();\n\n if( (files == null) || (files.length == 0) )\n {\n return Users;\n }\n\n for( int iFiles = 0; iFiles < files.length; iFiles++)\n {\n try\n {\n if( files[iFiles].isFile() )\n {\n DbRecord User = new DbRecord( files[iFiles].getAbsolutePath() );\n Users.add( User );\n }\n }\n catch( FileNotFoundException e )\n {\n // The record has invalid data. Skip it and continue processing.\n }\n catch( NullPointerException e )\n {\n JOptionPane.showConfirmDialog(null, \"erro\"+e);\n }\n catch( AppException e )\n {\n // The record has invalid data or access denied. Skip it and continue processing.\n }\n }\n \n return Users;\n }", "DiaryFile selectByPrimaryKey(String maperId);", "public void createDBSchema() throws NoConnectionToDBException, SQLException, IOException {\n \n InputStream in = EDACCApp.class.getClassLoader().getResourceAsStream(\"edacc/resources/edacc.sql\");\n if (in == null) {\n throw new SQLQueryFileNotFoundException();\n }\n BufferedReader br = new BufferedReader(new InputStreamReader(in));\n String line;\n String text = \"\";\n String l;\n while ((line = br.readLine()) != null) {\n if (!(l = line.replaceAll(\"\\\\s\", \"\")).isEmpty() && !l.startsWith(\"--\")) {\n text += line + \" \";\n }\n }\n in.close();\n Vector<String> queries = new Vector<String>();\n String query = \"\";\n String delimiter = \";\";\n int i = 0;\n while (i < text.length()) {\n if (text.toLowerCase().startsWith(\"delimiter\", i)) {\n i += 10;\n delimiter = text.substring(i, text.indexOf(' ', i));\n i = text.indexOf(' ', i);\n } else if (text.startsWith(delimiter, i)) {\n queries.add(query);\n i += delimiter.length();\n query = \"\";\n } else {\n query += text.charAt(i);\n i++;\n }\n }\n if (!query.replaceAll(\" \", \"\").equals(\"\")) {\n queries.add(query);\n }\n boolean autoCommit = getConn().getAutoCommit();\n try {\n getConn().setAutoCommit(false);\n Statement st = getConn().createStatement();\n for (String q : queries) {\n st.execute(q);\n }\n st.close();\n getConn().commit();\n } catch (SQLException e) {\n getConn().rollback();\n throw e;\n } finally {\n getConn().setAutoCommit(autoCommit);\n }\n }", "private Db() {\n super(Ke.getDatabase(), null);\n }", "public static String SQLFromFile(String file) throws IOException{\n BufferedReader reader = new BufferedReader(new FileReader(file));\n StringBuilder sb = new StringBuilder();\n String line;\n while((line = reader.readLine()) != null){\n sb.append(line);\n sb.append(' ');\n }\n reader.close();\n return sb.toString();\n }", "@Override\n\tpublic void closeDB()\n\t{\n\n\t}", "public interface DbLoader {\n\n /**\n * prepares the database\n */\n void prepareDatabase();\n}", "public long getDbFileSize() {\r\n\tlong result = -1;\r\n\r\n\ttry {\r\n\t File dbFile = new File(fileName);\r\n\t if (dbFile.exists()) {\r\n\t\tresult = dbFile.length();\r\n\t }\r\n\t} catch (Exception e) {\r\n\t // nothing todo here\r\n\t}\r\n\r\n\treturn result;\r\n }", "public String getTableFile() \n\t{\n\t return tableFile ;\n\t}", "public static ParserResult loadDatabase(File fileToOpen, String encoding) throws IOException {\n \n Reader reader = getReader(fileToOpen, encoding);\n String suppliedEncoding = null;\n try {\n boolean keepon = true;\n int piv = 0, c;\n while (keepon) {\n c = reader.read();\n if ( (piv == 0 && Character.isWhitespace( (char) c)) ||\n c == GUIGlobals.SIGNATURE.charAt(piv))\n piv++;\n else\n keepon = false;\n found: if (piv == GUIGlobals.SIGNATURE.length()) {\n keepon = false;\n // Found the signature. The rest of the line is unknown, so we skip it:\n while (reader.read() != '\\n');\n // Then we must skip the \"Encoding: \"\n for (int i=0; i<GUIGlobals.encPrefix.length(); i++) {\n if (reader.read() != GUIGlobals.encPrefix.charAt(i))\n break found; // No, it doesn't seem to match.\n }\n // If ok, then read the rest of the line, which should contain the name\n // of the encoding:\n StringBuffer sb = new StringBuffer();\n while ((c = reader.read()) != '\\n')\n sb.append((char)c);\n suppliedEncoding = sb.toString();\n }\n \n }\n } catch (IOException ex) {}\n \n if ((suppliedEncoding != null) && (!suppliedEncoding.equalsIgnoreCase(encoding))) {\n Reader oldReader = reader;\n try {\n // Ok, the supplied encoding is different from our default, so we must make a new\n // reader. Then close the old one.\n reader = getReader(fileToOpen, suppliedEncoding);\n oldReader.close();\n //System.out.println(\"Using encoding: \"+suppliedEncoding);\n } catch (IOException ex) {\n reader = oldReader; // The supplied encoding didn't work out, so we keep our\n // existing reader.\n \n //System.out.println(\"Error, using default encoding.\");\n }\n } else {\n // We couldn't find a supplied encoding. Since we don't know far into the file we read,\n // we start a new reader.\n reader.close();\n reader = getReader(fileToOpen, encoding);\n //System.out.println(\"No encoding supplied, or supplied encoding equals default. Using default encoding.\");\n }\n \n \n //return null;\n \n BibtexParser bp = new BibtexParser(reader);\n \n ParserResult pr = bp.parse();\n pr.setEncoding(encoding);\n \n return pr;\n }", "public ODatabaseDocumentTx db();", "public static TreeBag<Golfer> loadDbFromFile(String dbFilename) \n {\n // used to store lines read from the database file\n String line;\n // create a new empty database\n TreeBag<Golfer> db = new TreeBag<Golfer>();\n // compile a regex pattern for parsing lines from the database file\n Pattern p = Pattern.compile(\"([\\\\w\\\\s-]+)(\\\\d+)\\\\s+(\\\\d+)\\\\s+(\\\\d+\\\\.?\\\\d*)\");\n // create file handle for the filename specified (in current directory)\n File f = new File(\".\"+ File.separator + dbFilename);\n\n // if the filename specified exists in the current directory,\n if (f.exists()) {\n System.out.println(\"\\nLoading golfers from database file '\"+ dbFilename +\"'...\");\n\n // try loading from the database file\n try {\n // create a new file reader using the file handle\n FileReader fr = new FileReader(f);\n // buffer the file reader\n BufferedReader buf = new BufferedReader(fr);\n\n // keep reading lines from the file buffer until we reach the end of file\n while ( (line = buf.readLine()) != null ) {\n // trim whitespace off the lines\n line = line.trim();\n //System.out.println(\"Read line:\\n\"+ line +\"\\n\");\n\n // create a matcher object using the pre-compiled regex pattern\n Matcher m = p.matcher(line);\n // if the matcher object found a match on the current line,\n if (m.find()) {\n // populate golfer data using match groups\n String name = m.group(1);\n int rounds = Integer.valueOf(m.group(2));\n int handicap = Integer.valueOf(m.group(3));\n double avg = Double.valueOf(m.group(4));\n // create a new golfer object\n Golfer g = new Golfer(name, rounds, handicap, avg);\n // add new golfer to the database\n db.add(g);\n /*\n System.out.println(\"Added golfer to database:\\n\"+ g +\"\\n\");\n System.out.println(\"Current database:\\n\"+ db);\n System.out.println(\"Tree view:\");\n db.displayAsTree();\n System.out.println(\"\\n\");\n */\n }\n }\n\n // at the end of the file, close the buffer\n buf.close();\n }\n // exception: specified file does not exist\n catch(FileNotFoundException e) {\n // print stack trace for debugging\n e.printStackTrace();\n System.out.println(\"File '\"+ dbFilename +\"' not found: \"+ e);\n }\n // exception: I/O error when reading from file\n catch(IOException e) {\n // print stack trace for debugging\n e.printStackTrace();\n System.out.println(\"Error reading file '\"+ dbFilename +\"': \"+ e);\n }\n }\n else\n System.out.println(\"Database file '\"+ dbFilename +\"' not found\");\n \n // return the newly compiled database\n return db;\n }", "String getClobField();", "abstract public int dbVersion();", "public abstract String toDBString();", "private static Connection _getDbConnection(String aPath)\n\t{\n\t\ttry\n\t\t{\n\t\t\t// Open file\n\t\t\tConnection c = DriverManager.getConnection(CONN_PREFIX+aPath);\n\t\t\tc.setAutoCommit(false);\n\t\t\tIO.dbOutD(\"Connection to DB at path \"+ aPath + \" established.\");\n\t\t\treturn c;\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tIO.dbOutE(e);\n\t\t\treturn null;\n\t\t}\n\t}", "@Override\r\n public Db_db currentDb(){return curDb_;}", "@Test(timeout = 4000)\n public void test126() throws Throwable {\n DBDataType dBDataType0 = DBDataType.getInstance(\"CLOB\");\n Integer integer0 = RawTransaction.SAVEPOINT_ROLLBACK;\n DefaultDBTable defaultDBTable0 = new DefaultDBTable();\n DefaultDBColumn defaultDBColumn0 = new DefaultDBColumn(\"CLOB\", defaultDBTable0, dBDataType0, integer0);\n NameSpec nameSpec0 = NameSpec.NEVER;\n MockPrintWriter mockPrintWriter0 = new MockPrintWriter(\"#B0tMDNkWiXCI3n\");\n SQLUtil.renderCreateTable(defaultDBTable0, true, nameSpec0, mockPrintWriter0);\n assertEquals(\"table\", defaultDBTable0.getObjectType());\n }", "@Override\n\tpublic int dbsize() {\n\t\treturn 0;\n\t}" ]
[ "0.75162673", "0.7207716", "0.6856582", "0.63214904", "0.61810434", "0.6109898", "0.6099357", "0.60643154", "0.59978586", "0.5979398", "0.5952094", "0.5903999", "0.58972645", "0.585271", "0.5846257", "0.5809899", "0.58018017", "0.57985026", "0.57965136", "0.5771401", "0.57699853", "0.57660615", "0.5751976", "0.57483095", "0.573991", "0.57319665", "0.57164884", "0.5696641", "0.5687155", "0.568395", "0.56753296", "0.5667369", "0.5666063", "0.56496674", "0.5630785", "0.5625944", "0.56257564", "0.5618461", "0.55967504", "0.55848753", "0.5580355", "0.5579538", "0.55789524", "0.5563484", "0.55614966", "0.55604804", "0.55521995", "0.5550884", "0.5543351", "0.55340934", "0.55324435", "0.55278844", "0.552674", "0.55256736", "0.55248654", "0.55198175", "0.5513185", "0.55113673", "0.54969424", "0.5492285", "0.54781264", "0.5470682", "0.54671997", "0.546112", "0.5460634", "0.5439558", "0.5430981", "0.54204714", "0.54197943", "0.5417465", "0.54116", "0.54046506", "0.5402368", "0.5399423", "0.53944665", "0.5388514", "0.5385736", "0.5385214", "0.537763", "0.53700405", "0.5359754", "0.53582364", "0.53549147", "0.5353527", "0.53515434", "0.5348831", "0.5340497", "0.5334494", "0.53312504", "0.5331116", "0.53300834", "0.5328218", "0.5325344", "0.53162616", "0.53078955", "0.53073007", "0.53072876", "0.5306308", "0.5304805", "0.53032464", "0.5301233" ]
0.0
-1
Creates new form MainFrame
public MainFrame() { initComponents(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void createMainframe()\n\t{\n\t\t//Creates the frame\n\t\tJFrame foodFrame = new JFrame(\"USDA Food Database\");\n\t\t//Sets up the frame\n\t\tfoodFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tfoodFrame.setSize(1000,750);\n\t\tfoodFrame.setResizable(false);\n\t\tfoodFrame.setIconImage(icon.getImage());\n\t\t\n\t\tGui gui = new Gui();\n\t\t\n\t\tgui.setOpaque(true);\n\t\tfoodFrame.setContentPane(gui);\n\t\t\n\t\tfoodFrame.setVisible(true);\n\t}", "public MainFrame() {\n initComponents();\n \n }", "public MainFrame() {\n\t\tsuper();\n\t\tinitialize();\n\t}", "public Mainframe() {\n initComponents();\n }", "public mainframe() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n setLocationRelativeTo(null);\n }", "public MainFrame() {\n initComponents();\n\n\n }", "private void buildFrame() {\n String title = \"\";\n switch (formType) {\n case \"Add\":\n title = \"Add a new event\";\n break;\n case \"Edit\":\n title = \"Edit an existing event\";\n break;\n default:\n }\n frame.setTitle(title);\n frame.setResizable(false);\n frame.setPreferredSize(new Dimension(300, 350));\n frame.pack();\n frame.setLocationRelativeTo(null);\n frame.setVisible(true);\n\n frame.addWindowListener(new WindowAdapter() {\n @Override\n public void windowClosing(WindowEvent e) {\n // sets the main form to be visible if the event form was exited\n // and not completed.\n mainForm.getFrame().setEnabled(true);\n mainForm.getFrame().setVisible(true);\n }\n });\n }", "public NewFrame() {\n initComponents();\n }", "public MainFrame() {\n super(\"Gestione Concessionaria\");\n this.initComponents();\n this.generaFasciaPrezzo();\n this.pack();\n this.setLocationRelativeTo(null);\n this.initPanels();\n this.ToggleMenu.addActionListener(this);\n }", "public MainFrame() {\n try {\n initComponents();\n initElements();\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, \"Error \" + e.getMessage());\n }\n }", "private void makeGUI()\n {\n mainFrame = new JFrame();\n mainFrame.setPreferredSize(new Dimension(750,400));\n aw = new AccountWindow();\n mainFrame.add(aw);\n mainFrame.setVisible(true);\n mainFrame.pack();\n }", "public JFrameMain() {\n initComponents();\n \n }", "Frame createFrame();", "public AddFrame(MainFrame parent) {\n this.parent = parent;\n initComponents();\n }", "public MainFrame() {\n \n initComponents();\n \n this.initNetwork();\n \n this.render();\n \n }", "public void run() {\r\n frame = new MainFrame(this);\r\n newAccountFrame = new NewAccountPage(this);\r\n \r\n frame.setVisible(true);\r\n }", "public JFrameMain() {\n initComponents();\n }", "public cinema_main_form() {\n \t\t\n \t\tmain_frame = new JFrame();//main frame\n\t\tmain_panel = new JPanel();//kedriko panel\n\t\t\n\t\t// Add the panel to the frame.\n\t\tmain_frame.getContentPane().add(main_panel, BorderLayout.CENTER);\n \t\n initComponents();\n\t\n\t\t// Exit when the window is closed.\n\t\tmain_frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n }", "public NewJFrame() {\n initComponents();\n IniciarTabla();\n \n \n // ingreso al githup \n \n }", "public NewJFrame() {\n Connect();\n initComponents();\n }", "public FrameMain() {\n try {\n UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\n initComponents();\n refreshSchedule();\n } catch (ClassNotFoundException ex) {\n Logger.getLogger(FrameMain.class.getName()).log(Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n Logger.getLogger(FrameMain.class.getName()).log(Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n Logger.getLogger(FrameMain.class.getName()).log(Level.SEVERE, null, ex);\n } catch (UnsupportedLookAndFeelException ex) {\n Logger.getLogger(FrameMain.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public NewJFrame() {\n initComponents();\n \n }", "private void initMainFrame(){\n \n this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\n this.setSize(MAINFRAMESIZE);\n BoxLayout bl = new BoxLayout(getContentPane(), BoxLayout.Y_AXIS);\n this.getContentPane().setLayout(bl);\n this.setPreferredSize(MAINFRAMESIZE);\n this.setResizable(false);\n this.pack();\n }", "public NewJFrame() {\r\n initComponents();\r\n }", "public MainFrame() {\n initComponents();\n this.setLocationRelativeTo(null);\n }", "public NewJFrame() {\n initComponents();\n }", "public NewJFrame() {\n initComponents();\n }", "public NewJFrame() {\n initComponents();\n }", "public NewJFrame() {\n initComponents();\n }", "public NewJFrame() {\n initComponents();\n }", "public NewJFrame() {\n initComponents();\n }", "public NewJFrame() {\n initComponents();\n }", "public MainFrame() {\n initComponents();\n\n mAlmondUI.addWindowWatcher(this);\n mAlmondUI.initoptions();\n\n initActions();\n init();\n\n if (IS_MAC) {\n initMac();\n }\n\n initMenus();\n mActionManager.setEnabledDocumentActions(false);\n }", "private static void createAndShowGUI() {\n JFrame frame = new JFrame(\"FEEx v. \"+VERSION);\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n \n //Create and set up the content pane.\n Main p = new Main();\n p.addComponentToPane(frame.getContentPane());\n\n frame.addWindowListener(new java.awt.event.WindowAdapter() {\n @Override\n public void windowClosing(java.awt.event.WindowEvent windowEvent) {\n \tstopPolling();\n \tstopMPP();\n p.port.close();\n Utils.storeSizeAndPosition(frame);\n }\n });\n \n //Display the window.\n frame.pack();\n Utils.restoreSizeAndPosition(frame);\n frame.setVisible(true);\n }", "void setMainFrame(NewMainFrame mainFrame) {\n this.mainFrame = mainFrame;\n }", "private static void createAndShowGUI()\r\n {\r\n JFrame frame = new JFrame(\"ChangingTitleFrame Application\");\r\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n frame.getContentPane().add(new FramePanel(frame).getPanel());\r\n frame.pack();\r\n frame.setLocationRelativeTo(null);\r\n frame.setVisible(true);\r\n }", "public static MainFrame createNewFrame(Display display, Document doc)\n {\n Shell shell = new Shell(display);\n\n MainFrame frame = new MainFrame(shell, doc);\n frame.initComponents(null);\n\n shell.open();\n\n return frame;\n }", "public MainFrame() {\n \n new DangNhapDialog(this, true).setVisible(true);\n initComponents();\n init();\n }", "public NewJFrame()\r\n {\r\n initComponents();\r\n }", "private static void createAndShowGUI() {\n JFrame frame = new JFrame(\"Firma digital\");\r\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n frame.setLocationRelativeTo(null);\r\n\r\n //Create and set up the content pane.\r\n final FirmaDigital newContentPane = new FirmaDigital(frame);\r\n newContentPane.setOpaque(true); //content panes must be opaque\r\n frame.setContentPane(newContentPane);\r\n\r\n //Make sure the focus goes to the right component\r\n //whenever the frame is initially given the focus.\r\n frame.addWindowListener(new WindowAdapter() {\r\n public void windowActivated(WindowEvent e) {\r\n newContentPane.resetFocus();\r\n }\r\n });\r\n\r\n //Display the window.\r\n frame.pack();\r\n frame.setVisible(true);\r\n }", "public MasterGUI() {\n\n\t\tmainFrame.setPreferredSize(FRAME_SIZE);\n\t\tmainFrame.pack();\n\n\t\tmainPane.addTab(\"Element\", new ElementGUI().elementMainPanel);\n\t\tmainPane.addTab(\"Metal\", new MetalGUI().metalMainPanel);\n\t\tmainPane.addTab(\"Compound\", new CompoundGUI().compoundMainPanel);\n\t\tmainPane.addTab(\"Acid\", new AcidGUI().acidMainPanel);\n\t\tmainPane.addTab(\"Base\", new BaseGUI().baseMainPanel);\n\t\tmainPane.addTab(\"Chemical\", new ChemicalGUI().chemicalMainPanel);\n\n\t\tmainFrame.add(mainPane);\n\t\tmainFrame.setVisible(true);\n\t}", "public frame() {\r\n\t\tadd(createMainPanel());\r\n\t\tsetTitle(\"Lunch Date\");\r\n\t\tsetSize(FRAME_WIDTH, FRAME_HEIGHT);\r\n\r\n\t}", "public MainFrame() {\n\t\tsuper(\"Contry Detail\");\n\t\tsetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tsetPreferredSize(new Dimension(450, 300));\n\t\tsetResizable(false);\n\t\t\n\t\tinitComponents();\n\t\t\n\t\tcontroller = new Service(this);\n\t}", "public mainFrame() {\n initComponents();\n \n pnlWelcome.removeAll();\n homePanel = new PnlHome();\n pnlWelcome.add(homePanel);\n homePanel.setSize(530, 200);\n homePanel.setVisible(true);\n pnlWelcome.revalidate();\n pnlWelcome.repaint();\n\n pnlNew.removeAll();\n pnlGeneral = new PnlGeneral(this);\n pnlNew.add(pnlGeneral);\n pnlGeneral.setSize(500, 500);\n pnlGeneral.setVisible(true);\n pnlNew.revalidate();\n pnlNew.repaint();\n \n f = new ArrayList<>();\n\n }", "public frmMain() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public MainPanel(MainFrame m)\r\n\t{\r\n\t\t//Link back to the Frame\r\n\t\tmainFrame = m;\r\n\t\t\r\n\t\t//Setup the layout\r\n\t\tsetLayout(new GridLayout(4,1,5,5)); //Grid with 4 rows and 1 column.\r\n\t\t\r\n\t\t//add buttons and action listeners to the buttons\r\n\t\tthis.add(play);\r\n\t\tplay.addActionListener(mainListener);\r\n\t\tthis.add(edit);\r\n\t\tedit.addActionListener(mainListener);\r\n\t\tthis.add(editExisting);\r\n\t\teditExisting.addActionListener(mainListener);\r\n\t\tthis.add(exit);\r\n\t\texit.addActionListener(mainListener);\t\r\n\t}", "public MainForm() {\n initComponents();\n \n }", "public FrameForm() {\n initComponents();\n }", "public NewJFrame1() {\n initComponents();\n }", "public static void main( String args[] )\n\t{\n\t\tmainFrame = getInstance();\n\t\tmainFrame.setVisible( true );\n\t\t\n\t}", "public NewJFrame() {\n initComponents();\n\n }", "public void createAndShowGUI(JFrame frame) {\n providerSideBar(frame.getContentPane(), pat);\n topBarPatientInformation(frame.getContentPane(), pat);\n patientReferralPanel(frame.getContentPane());\n\n }", "public NewJFrame() {\n initComponents();\n // HidenLable.setVisible(false);\n }", "private static void createGUI(){\r\n\t\tframe = new JFrame(\"Untitled\");\r\n\r\n\t\tBibtexImport bib = new BibtexImport();\r\n\t\tbib.setOpaque(true);\r\n\r\n\t\tframe.setExtendedState(JFrame.MAXIMIZED_BOTH);\r\n\t\tframe.setContentPane(bib);\r\n\t\tframe.setJMenuBar(bib.menu);\r\n\t\tframe.pack();\r\n\t\tframe.setVisible(true);\r\n\t}", "private void makeFrame(){\n frame = new JFrame(\"Rebellion\");\n\n frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);\n frame.setSize(800,800);\n\n makeContent(frame);\n\n frame.setBackground(Color.getHSBColor(10,99,35));\n frame.pack();\n frame.setVisible(true);\n }", "public NewJFrame1() {\n initComponents();\n\n dip();\n sh();\n }", "public xinxiNewJFrame() {\n initComponents();\n }", "public NewJFrame1(NewJFrame n) {\n main = n;\n initComponents();\n winOpen();\n setLocationFrame();\n this.setVisible(true);\n }", "public MainFrame() {\n initComponents();this.setTitle(\"Student Record System - NIIST \");\n }", "private void makeContent(JFrame frame){\n Container content = frame.getContentPane();\n content.setSize(700,700);\n\n makeButtons();\n makeRooms();\n makeLabels();\n\n content.add(inputPanel,BorderLayout.SOUTH);\n content.add(roomPanel, BorderLayout.CENTER);\n content.add(infoPanel, BorderLayout.EAST);\n\n }", "public MainFrame() {\n super(\"ToDo List\");\n setLayout(new BorderLayout());\n toDoList = new ToDoList();\n toDoList.loadAll(fileLocation);\n initializeButtonPanel();\n add(buttonPanel, BorderLayout.NORTH);\n add(radioPanel, BorderLayout.LINE_START);\n\n setSize(1000, 1000);\n setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);\n setVisible(true);\n setListeners();\n exitListener();\n refresh();\n }", "public MenuView(MainFrame main) {\n initComponents();\n \n this.mainFrame = main;\n }", "public MainFrame() {\n super(\"Classic Crypto Tools\");\n initComponents();\n this.setResizable(false);\n plainOutputButton.setSelected(true);\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainFrameController() {\n }", "public launchFrame() {\n \n initComponents();\n \n }", "FRAME createFRAME();", "public RunFrame(MainFrame mainFrame) {\n\tthis.mainFrame = mainFrame;\n\tmainFrame.addScriptEventListener(scrEvtLis);\n\tsetAlwaysOnTop(true);\n setFocusable(false);\n setLocationByPlatform(true);\n\tsetLayout(new GridBagLayout());\n\tsetUndecorated(true);\n\tsetTitle(\"JUltima Toolbar\");\n\n\taddMouseListener(this);\n\taddMouseMotionListener(this);\n }", "private void buildFrame() {\n mainFrame = new JFrame();\n header = new JLabel(\"View Contact Information\");\n header.setHorizontalAlignment(JLabel.CENTER);\n header.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));\n \n infoTable.setFillsViewportHeight(true);\n infoTable.setShowGrid(true);\n infoTable.setVisible(true);\n scrollPane = new JScrollPane(infoTable);\n\n mainFrame.add(header, BorderLayout.NORTH);\n mainFrame.add(scrollPane, BorderLayout.CENTER);\n }", "public MainFrame(){\n\t\ttry {\n\t\t\tUIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\n\t\t} catch (ClassNotFoundException | IllegalAccessException | UnsupportedLookAndFeelException | InstantiationException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tnbRules = 1;\n \tnbTabs = 0;\n \tbasePanel = new JPanel();\n \tbasePanel.setLayout(new FlowLayout(FlowLayout.CENTER));\n \ttabs = new JTabbedPane(SwingConstants.TOP);\n\n \tJToolBar toolBar = new JToolBar();\n newGen = new JButton(\"Nouvelle génération\");\n newGen.addActionListener(new Listener(\"Tab\",this));\n toolBar.add(newGen);\n example = new JButton(\"Exemples\");\n example.addActionListener(new Listener(\"Example\", this));\n toolBar.add(example);\n help = new JButton(\"Aide\");\n help.addActionListener(new Listener(\"Help\",this));\n toolBar.add(help);\n\n this.setTitle(\"L-system interface\");\n this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tDimension windowDimension = new Dimension(Constants.INITIAL_WIDTH, Constants.INITIAL_HEIGHT);\n this.setSize(windowDimension);\n this.setLocationRelativeTo(null);\n this.add(tabs);\n this.add(toolBar, BorderLayout.NORTH);\n this.setPreferredSize(windowDimension);\n newComponent((byte)1);\n\t\trenameTabs();\n\t\tthis.setResizable(false);\n }", "public MainApp() {\r\n\t\tsuper();\r\n\t\tthis.setSize(642, 455);\r\n\t\tthis.setContentPane(getJContentPane());\r\n\t}", "public MainFrame(String title){\n\t\ttry {\n\t\t\t//Make the look and feel Windows.\n\t UIManager.setLookAndFeel(\"com.sun.java.swing.plaf.windows.WindowsLookAndFeel\");\n\t \n\t //Hope there's not an exception. If there ever an exception is it's an undocumented feature :)\n\t } catch (Exception evt) {}\n\t\t\t \n\t //Create a new JFrame with user-defined title. Make it referenceable so that other classes can refer to it.\n\t\tsetCurrentFrame(new JFrame(title));\n\t\tthis.getCurrentFrame().setResizable(false);\n\t\t\n\t\t//Exit not dispose. When this JFrame is closed, the entire program is closed.\n\t\tgetCurrentFrame().setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t}", "public NewJFrame17() {\n initComponents();\n }", "public void main(String[] args) {\n // TODO code application logic here\n MF= new MainFrame();\n }", "static void abrir() {\n frame = new ModificarPesos();\n //Create and set up the window.\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n //Set up the content pane.\n frame.addComponentsToPane(frame.getContentPane());\n //Display the window.\n frame.pack();\n frame.setVisible(true);\n }", "public static void buildFrame() {\r\n\t\t// Make sure we have nice window decorations\r\n\t\tJFrame.setDefaultLookAndFeelDecorated(true);\r\n\t\t\r\n\t\t// Create and set up the window.\r\n\t\t//ParentFrame frame = new ParentFrame();\r\n\t\tMediator frame = new Mediator();\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\t\r\n\t\t// Display the window\r\n\t\tframe.setVisible(true);\r\n\t}", "public mainUI() {\n initComponents();\n }", "public MercadoFrame() {\n initComponents();\n }", "public mainFrame() {\r\n initComponents();\r\n try {\r\n setDir();\r\n } catch (FileNotFoundException ex) {\r\n Logger.getLogger(mainFrame.class.getName()).log(Level.SEVERE, null, ex);\r\n } catch (IOException ex) {\r\n Logger.getLogger(mainFrame.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n \r\n \r\n lab_android.setText(\"Android not read\");\r\n lab_moodle.setText(\"Moodle not read\");\r\n \r\n }", "private static void createAndShowGUI() {\n\t\t/*\n //Create and set up the window.\n JFrame frame = new JFrame(\"HelloWorldSwing\");\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n //Add the ubiquitous \"Hello World\" label.\n JLabel label = new JLabel(\"Hello World\");\n frame.getContentPane().add(label);\n\n //Display the window.\n frame.pack();\n frame.setVisible(true);\n */\n\t\tfinal AC_GUI currentGUI = new AC_GUI();\n\t\t//currentGUI.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tcurrentGUI.setSize(900, 800);\n\t\t// make the frame full screen\n\t\t// currentGUI.setExtendedState(JFrame.MAXIMIZED_BOTH);\n }", "public GuiMainFrame() {\n this(new ArrayBlockingQueue<String>(100), new OBORunnerConfiguration());\n }", "private static void createAndShowGUI() {\n //Create and set up the window.\n JFrame frame = new JFrame(\"WAR OF MINE\");\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n //Create and set up the content pane.\n JComponent newContentPane = new Gameframe();\n newContentPane.setOpaque(true); //content panes must be opaque\n frame.setContentPane(newContentPane);\n\n //Display the window.\n frame.setSize(800,1000);\n frame.setVisible(true);\n }", "public static void main(String args[]){\r\n JFrame frame = new JFrame();\r\n frame.getContentPane().add(new S2SSubmissionDetailForm());\r\n// frame.setSize(690,420);\r\n frame.pack();\r\n frame.show();\r\n// frame.setVisible(true);\r\n }", "public Main() {\n initComponents();\n this.setLocationRelativeTo(null);\n \n \n }", "private void show() {\n mainFrame.setVisible(true);\r\n\t}" ]
[ "0.7866579", "0.77944225", "0.772502", "0.7701847", "0.7630211", "0.76181847", "0.7527362", "0.7495771", "0.7302958", "0.72932607", "0.7249109", "0.72449845", "0.722655", "0.7208675", "0.71687025", "0.7150071", "0.7141473", "0.712708", "0.7108041", "0.7081051", "0.70746195", "0.7072273", "0.7047953", "0.70455337", "0.70400214", "0.70231694", "0.7006942", "0.7006942", "0.7006942", "0.7006942", "0.7006942", "0.7006942", "0.7006942", "0.69965214", "0.69952345", "0.6987572", "0.6979865", "0.697543", "0.69478124", "0.694649", "0.6935386", "0.69247246", "0.6915055", "0.6911136", "0.6906439", "0.69063795", "0.69063795", "0.69011456", "0.68917954", "0.6879059", "0.6875695", "0.68571544", "0.6854404", "0.68428254", "0.6832959", "0.68323994", "0.6828131", "0.6807401", "0.6798517", "0.67970526", "0.67897683", "0.6768626", "0.67685586", "0.6757886", "0.67574275", "0.6757114", "0.6757114", "0.6757114", "0.67537016", "0.6742638", "0.6741329", "0.673271", "0.67286545", "0.6724153", "0.6723593", "0.6707519", "0.67045796", "0.66851807", "0.6673151", "0.66681033", "0.66578436", "0.66540813", "0.6647392", "0.6637099", "0.66341245", "0.66291916", "0.6627374", "0.6626277", "0.6621614" ]
0.7677743
13
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { pnlChart = new javax.swing.JPanel(); jButton2 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); pnlChart.setBackground(new java.awt.Color(0, 0, 0)); pnlChart.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); pnlChart.setForeground(new java.awt.Color(255, 255, 255)); pnlChart.setAlignmentX(1.5F); pnlChart.setAlignmentY(0.35F); pnlChart.setMaximumSize(new java.awt.Dimension(1000, 1000)); pnlChart.setMinimumSize(new java.awt.Dimension(1, 1)); pnlChart.setPreferredSize(new java.awt.Dimension(1, 1)); pnlChart.setLayout(new java.awt.BorderLayout()); jButton2.setText("jButton2"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); pnlChart.add(jButton2, java.awt.BorderLayout.PAGE_START); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(pnlChart, javax.swing.GroupLayout.PREFERRED_SIZE, 631, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 993, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(pnlChart, javax.swing.GroupLayout.PREFERRED_SIZE, 595, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 801, Short.MAX_VALUE)) ); pack(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Form() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public frmRectangulo() {\n initComponents();\n }", "public form() {\n initComponents();\n }", "public AdjointForm() {\n initComponents();\n setDefaultCloseOperation(HIDE_ON_CLOSE);\n }", "public FormListRemarking() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n \n }", "public FormPemilihan() {\n initComponents();\n }", "public GUIForm() { \n initComponents();\n }", "public FrameForm() {\n initComponents();\n }", "public TorneoForm() {\n initComponents();\n }", "public FormCompra() {\n initComponents();\n }", "public muveletek() {\n initComponents();\n }", "public Interfax_D() {\n initComponents();\n }", "public quanlixe_form() {\n initComponents();\n }", "public SettingsForm() {\n initComponents();\n }", "public RegistrationForm() {\n initComponents();\n this.setLocationRelativeTo(null);\n }", "public Soru1() {\n initComponents();\n }", "public FMainForm() {\n initComponents();\n this.setResizable(false);\n setLocationRelativeTo(null);\n }", "public soal2GUI() {\n initComponents();\n }", "public EindopdrachtGUI() {\n initComponents();\n }", "public MechanicForm() {\n initComponents();\n }", "public AddDocumentLineForm(java.awt.Frame parent) {\n super(parent);\n initComponents();\n myInit();\n }", "public BloodDonationGUI() {\n initComponents();\n }", "public quotaGUI() {\n initComponents();\n }", "public Customer_Form() {\n initComponents();\n setSize(890,740);\n \n \n }", "public PatientUI() {\n initComponents();\n }", "public myForm() {\n\t\t\tinitComponents();\n\t\t}", "public Oddeven() {\n initComponents();\n }", "public intrebarea() {\n initComponents();\n }", "public Magasin() {\n initComponents();\n }", "public RadioUI()\n {\n initComponents();\n }", "public NewCustomerGUI() {\n initComponents();\n }", "public ZobrazUdalost() {\n initComponents();\n }", "public FormUtama() {\n initComponents();\n }", "public p0() {\n initComponents();\n }", "public INFORMACION() {\n initComponents();\n this.setLocationRelativeTo(null); \n }", "public ProgramForm() {\n setLookAndFeel();\n initComponents();\n }", "public AmountReleasedCommentsForm() {\r\n initComponents();\r\n }", "public form2() {\n initComponents();\n }", "public MainForm() {\n\t\tsuper(\"Hospital\", List.IMPLICIT);\n\n\t\tstartComponents();\n\t}", "public kunde() {\n initComponents();\n }", "public LixeiraForm() {\n initComponents();\n setLocationRelativeTo(null);\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n setRequestFocusEnabled(false);\n setVerifyInputWhenFocusTarget(false);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 465, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 357, Short.MAX_VALUE)\n );\n }", "public MusteriEkle() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public frmMain() {\n initComponents();\n }", "public DESHBORDPANAL() {\n initComponents();\n }", "public frmVenda() {\n initComponents();\n }", "public GUIForm() {\n initComponents();\n inputField.setText(NO_FILE_SELECTED);\n outputField.setText(NO_FILE_SELECTED);\n progressLabel.setBackground(INFO);\n progressLabel.setText(SELECT_FILE);\n }", "public Botonera() {\n initComponents();\n }", "public FrmMenu() {\n initComponents();\n }", "public OffertoryGUI() {\n initComponents();\n setTypes();\n }", "public JFFornecedores() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setBackground(new java.awt.Color(255, 255, 255));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 983, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 769, Short.MAX_VALUE)\n );\n\n pack();\n }", "public EnterDetailsGUI() {\n initComponents();\n }", "public vpemesanan1() {\n initComponents();\n }", "public Kost() {\n initComponents();\n }", "public FormHorarioSSE() {\n initComponents();\n }", "public frmacceso() {\n initComponents();\n }", "public UploadForm() {\n initComponents();\n }", "public HW3() {\n initComponents();\n }", "public Managing_Staff_Main_Form() {\n initComponents();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n getContentPane().setLayout(null);\n\n pack();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setName(\"Form\"); // NOI18N\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 300, Short.MAX_VALUE)\n );\n }", "public sinavlar2() {\n initComponents();\n }", "public P0405() {\n initComponents();\n }", "public IssueBookForm() {\n initComponents();\n }", "public MiFrame2() {\n initComponents();\n }", "public Choose1() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n\n String oldAuthor = prefs.get(\"AUTHOR\", \"\");\n if(oldAuthor != null) {\n this.authorTextField.setText(oldAuthor);\n }\n String oldBook = prefs.get(\"BOOK\", \"\");\n if(oldBook != null) {\n this.bookTextField.setText(oldBook);\n }\n String oldDisc = prefs.get(\"DISC\", \"\");\n if(oldDisc != null) {\n try {\n int oldDiscNum = Integer.parseInt(oldDisc);\n oldDiscNum++;\n this.discNumberTextField.setText(Integer.toString(oldDiscNum));\n } catch (Exception ex) {\n this.discNumberTextField.setText(oldDisc);\n }\n this.bookTextField.setText(oldBook);\n }\n\n\n }", "public GUI_StudentInfo() {\n initComponents();\n }", "public JFrmPrincipal() {\n initComponents();\n }", "public Lihat_Dokter_Keseluruhan() {\n initComponents();\n }", "public bt526() {\n initComponents();\n }", "public Pemilihan_Dokter() {\n initComponents();\n }", "public Ablak() {\n initComponents();\n }", "@Override\n\tprotected void initUi() {\n\t\t\n\t}", "@SuppressWarnings(\"unchecked\")\n\t// <editor-fold defaultstate=\"collapsed\" desc=\"Generated\n\t// Code\">//GEN-BEGIN:initComponents\n\tprivate void initComponents() {\n\n\t\tlabel1 = new java.awt.Label();\n\t\tlabel2 = new java.awt.Label();\n\t\tlabel3 = new java.awt.Label();\n\t\tlabel4 = new java.awt.Label();\n\t\tlabel5 = new java.awt.Label();\n\t\tlabel6 = new java.awt.Label();\n\t\tlabel7 = new java.awt.Label();\n\t\tlabel8 = new java.awt.Label();\n\t\tlabel9 = new java.awt.Label();\n\t\tlabel10 = new java.awt.Label();\n\t\ttextField1 = new java.awt.TextField();\n\t\ttextField2 = new java.awt.TextField();\n\t\tlabel14 = new java.awt.Label();\n\t\tlabel15 = new java.awt.Label();\n\t\tlabel16 = new java.awt.Label();\n\t\ttextField3 = new java.awt.TextField();\n\t\ttextField4 = new java.awt.TextField();\n\t\ttextField5 = new java.awt.TextField();\n\t\tlabel17 = new java.awt.Label();\n\t\tlabel18 = new java.awt.Label();\n\t\tlabel19 = new java.awt.Label();\n\t\tlabel20 = new java.awt.Label();\n\t\tlabel21 = new java.awt.Label();\n\t\tlabel22 = new java.awt.Label();\n\t\ttextField6 = new java.awt.TextField();\n\t\ttextField7 = new java.awt.TextField();\n\t\ttextField8 = new java.awt.TextField();\n\t\tlabel23 = new java.awt.Label();\n\t\ttextField9 = new java.awt.TextField();\n\t\ttextField10 = new java.awt.TextField();\n\t\ttextField11 = new java.awt.TextField();\n\t\ttextField12 = new java.awt.TextField();\n\t\tlabel24 = new java.awt.Label();\n\t\tlabel25 = new java.awt.Label();\n\t\tlabel26 = new java.awt.Label();\n\t\tlabel27 = new java.awt.Label();\n\t\tlabel28 = new java.awt.Label();\n\t\tlabel30 = new java.awt.Label();\n\t\tlabel31 = new java.awt.Label();\n\t\tlabel32 = new java.awt.Label();\n\t\tjButton1 = new javax.swing.JButton();\n\n\t\tlabel1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel1.setText(\"It seems that some of the buttons on the ATM machine are not working!\");\n\n\t\tlabel2.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel2.setText(\"Unfortunately these numbers are exactly what Professor has to use to type in his password.\");\n\n\t\tlabel3.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 18)); // NOI18N\n\t\tlabel3.setText(\n\t\t\t\t\"If you want to eat tonight, you have to help him out and construct the numbers of the password with the working buttons and math operators.\");\n\n\t\tlabel4.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tlabel4.setText(\"Denver's Password: 2792\");\n\n\t\tlabel5.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel5.setText(\"import java.util.Scanner;\\n\");\n\n\t\tlabel6.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel6.setText(\"public class ATM{\");\n\n\t\tlabel7.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel7.setText(\"public static void main(String[] args){\");\n\n\t\tlabel8.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel8.setText(\"System.out.print(\");\n\n\t\tlabel9.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel9.setText(\" -\");\n\n\t\tlabel10.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel10.setText(\");\");\n\n\t\ttextField1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\ttextField1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tlabel14.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel14.setText(\"System.out.print( (\");\n\n\t\tlabel15.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel15.setText(\"System.out.print(\");\n\n\t\tlabel16.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel16.setText(\"System.out.print( ( (\");\n\n\t\tlabel17.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel17.setText(\")\");\n\n\t\tlabel18.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel18.setText(\" +\");\n\n\t\tlabel19.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel19.setText(\");\");\n\n\t\tlabel20.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel20.setText(\" /\");\n\n\t\tlabel21.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel21.setText(\" %\");\n\n\t\tlabel22.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel22.setText(\" +\");\n\n\t\tlabel23.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel23.setText(\");\");\n\n\t\tlabel24.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel24.setText(\" +\");\n\n\t\tlabel25.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel25.setText(\" /\");\n\n\t\tlabel26.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel26.setText(\" *\");\n\n\t\tlabel27.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));\n\t\tlabel27.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel27.setText(\")\");\n\n\t\tlabel28.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n\t\tlabel28.setText(\")\");\n\n\t\tlabel30.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel30.setText(\"}\");\n\n\t\tlabel31.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel31.setText(\"}\");\n\n\t\tlabel32.setFont(new java.awt.Font(\"Consolas\", 0, 14)); // NOI18N\n\t\tlabel32.setText(\");\");\n\n\t\tjButton1.setFont(new java.awt.Font(\"Segoe UI Semibold\", 0, 14)); // NOI18N\n\t\tjButton1.setText(\"Check\");\n\t\tjButton1.addActionListener(new java.awt.event.ActionListener() {\n\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent evt) {\n\t\t\t\tjButton1ActionPerformed(evt);\n\t\t\t}\n\t\t});\n\n\t\tjavax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n\t\tlayout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(28).addGroup(layout\n\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING).addComponent(getDoneButton()).addComponent(jButton1)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, 774, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t.addGap(92).addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15, GroupLayout.PREFERRED_SIZE, 145,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(2)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(37))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(174)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(7)))\n\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label23, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t20, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(20).addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(23).addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16, GroupLayout.PREFERRED_SIZE, 177,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10, GroupLayout.PREFERRED_SIZE, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED).addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));\n\t\tlayout.setVerticalGroup(\n\t\t\t\tlayout.createParallelGroup(Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap()\n\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t.addComponent(label1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t.addComponent(label2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t.addGap(1)\n\t\t\t\t\t\t.addComponent(label3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(label7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup().addGroup(layout.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING).addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttextField2, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(19)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField5,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label14,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label18,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label17,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField4,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))\n\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label20, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label19, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField3, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(78)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label27, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(76)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField11, GroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup().addGap(75)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label32,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField10,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED, 20,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tShort.MAX_VALUE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.TRAILING, false)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label15,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label21,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField7,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(27))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField9,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label22,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlayout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(3)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel23,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(29)))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label16,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField12,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout.createSequentialGroup()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGroup(layout\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.createParallelGroup(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAlignment.TRAILING)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(label24,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addComponent(textField6,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.addGap(1))))))\n\t\t\t\t\t\t\t\t.addGroup(layout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label25, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label28, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t\t\t\t.addComponent(label26, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t\t.addGap(30)\n\t\t\t\t\t\t.addComponent(label31, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(25)\n\t\t\t\t\t\t.addComponent(label30, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,\n\t\t\t\t\t\t\t\tGroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addGap(26).addComponent(jButton1).addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t.addComponent(getDoneButton()).addContainerGap(23, Short.MAX_VALUE)));\n\t\tthis.setLayout(layout);\n\n\t\tlabel16.getAccessibleContext().setAccessibleName(\"System.out.print( ( (\");\n\t\tlabel17.getAccessibleContext().setAccessibleName(\"\");\n\t\tlabel18.getAccessibleContext().setAccessibleName(\" +\");\n\t}", "public Pregunta23() {\n initComponents();\n }", "public FormMenuUser() {\n super(\"Form Menu User\");\n initComponents();\n }", "public AvtekOkno() {\n initComponents();\n }", "public busdet() {\n initComponents();\n }", "public ViewPrescriptionForm() {\n initComponents();\n }", "public Ventaform() {\n initComponents();\n }", "public Kuis2() {\n initComponents();\n }", "public CreateAccount_GUI() {\n initComponents();\n }", "public Carrera() {\n initComponents();\n }", "public POS1() {\n initComponents();\n }", "public EqGUI() {\n initComponents();\n }", "public JFriau() {\n initComponents();\n this.setLocationRelativeTo(null);\n this.setTitle(\"BuNus - Budaya Nusantara\");\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n setBackground(new java.awt.Color(204, 204, 204));\n setMinimumSize(new java.awt.Dimension(1, 1));\n setPreferredSize(new java.awt.Dimension(760, 402));\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 750, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 400, Short.MAX_VALUE)\n );\n }", "public nokno() {\n initComponents();\n }", "public dokter() {\n initComponents();\n }", "public ConverterGUI() {\n initComponents();\n }", "public hitungan() {\n initComponents();\n }", "public Modify() {\n initComponents();\n }", "public frmAddIncidencias() {\n initComponents();\n }", "public FP_Calculator_GUI() {\n initComponents();\n \n setVisible(true);\n }" ]
[ "0.731952", "0.72909003", "0.72909003", "0.72909003", "0.72862417", "0.7248404", "0.7213685", "0.72086793", "0.7195972", "0.71903807", "0.71843296", "0.7158833", "0.71475875", "0.70933676", "0.7081167", "0.7056787", "0.69876975", "0.6977383", "0.6955115", "0.6953839", "0.69452274", "0.6942602", "0.6935845", "0.6931919", "0.6928187", "0.6925288", "0.69251484", "0.69117147", "0.6911646", "0.6892842", "0.68927234", "0.6891408", "0.68907607", "0.68894386", "0.68836755", "0.688209", "0.6881168", "0.68787616", "0.68757504", "0.68741524", "0.68721044", "0.685922", "0.68570775", "0.6855737", "0.6855207", "0.68546575", "0.6853559", "0.6852262", "0.6852262", "0.68443567", "0.6837038", "0.6836797", "0.68291426", "0.6828922", "0.68269444", "0.6824652", "0.682331", "0.68175536", "0.68167555", "0.6810103", "0.6809546", "0.68085015", "0.68083894", "0.6807979", "0.68027437", "0.67950374", "0.67937446", "0.67921823", "0.67911226", "0.67900467", "0.6788873", "0.67881", "0.6781613", "0.67669237", "0.67660683", "0.6765841", "0.6756988", "0.675558", "0.6752552", "0.6752146", "0.6742482", "0.67395985", "0.673791", "0.6736197", "0.6733452", "0.67277217", "0.6726687", "0.67204696", "0.67168", "0.6714824", "0.6714823", "0.6708782", "0.67071444", "0.670462", "0.67010295", "0.67004406", "0.6699407", "0.6698219", "0.669522", "0.66916007", "0.6689694" ]
0.0
-1
dataset.addValue(350, row, "97"); dataset.addValue(450, row, "98"); dataset.addValue(500, row, "99"); dataset.addValue(340, row, "00"); dataset.addValue(180, row, "01"); dataset.addValue(550, row, "02"); dataset.addValue(450, row, "03"); dataset.addValue(600, row, "04"); dataset.addValue(750, row, "05"); dataset.addValue(570, row, "06"); dataset.addValue(360, row, "07"); dataset.addValue(504, row, "08"); dataset.addValue(350, row, "09"); dataset.addValue(690, row, "10"); dataset.addValue(510, row, "11"); dataset.addValue(640, row, "12"); dataset.addValue(250, row, "13"); dataset.addValue(180, row, "14"); dataset.addValue(365, row, "15"); dataset.addValue(850, row, "16"); dataset.addValue(560, row, "17"); dataset.addValue(765, row, "18"); dataset.addValue(680, row, "19"); dataset.addValue(550, row, "20"); return dataset;
public JFreeChart createChart(CategoryDataset dataset) { CategoryAxis categoryAxis = new CategoryAxis(""); ValueAxis valueAxis = new NumberAxis(""); valueAxis.setVisible(false); BarRenderer renderer = new BarRenderer() { @Override public Paint getItemPaint(int row, int column) { return Color.blue; // switch (column) { // case 0: // return Color.red; // case 1: // return Color.yellow; // case 2: // return Color.blue; // case 3: // return Color.orange; // case 4: // return Color.gray; // case 5: // return Color.green.darker(); // default: // return Color.red; // } } }; renderer.setDrawBarOutline(false); renderer.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator()); renderer.setBasePositiveItemLabelPosition(new ItemLabelPosition( ItemLabelAnchor.OUTSIDE12, TextAnchor.BOTTOM_CENTER)); renderer.setBaseItemLabelsVisible(Boolean.TRUE); renderer.setBarPainter(new StandardBarPainter()); CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, renderer); JFreeChart chart = new JFreeChart("", JFreeChart.DEFAULT_TITLE_FONT, plot, false); chart.setBackgroundPaint(Color.white); return chart; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static List<Point> createIncreasingDecreasingDataset() {\r\n List<Point> data = new ArrayList<Point>();\r\n add(data, 1, 400);\r\n add(data, 5, 700);\r\n add(data, 10, 900);\r\n add(data, 15, 1000);\r\n add(data, 20, 900);\r\n add(data, 25, 700);\r\n add(data, 30, 500);\r\n return data;\r\n }", "private static List<Point> createConvergingDataset() {\r\n List<Point> data = new ArrayList<Point>();\r\n add(data, 1, 400);\r\n add(data, 5, 700);\r\n add(data, 10, 900);\r\n add(data, 15, 1000);\r\n add(data, 20, 1050);\r\n add(data, 25, 1060);\r\n add(data, 30, 1062);\r\n return data;\r\n }", "private XYDataset createDataset() {\n\t \tXYSeriesCollection dataset = new XYSeriesCollection();\n\t \t\n\t \t//Definir cada Estacao\n\t\t XYSeries aes1 = new XYSeries(\"Estação1\");\n\t\t XYSeries aes2 = new XYSeries(\"Estação2\");\n\t\t XYSeries aes3 = new XYSeries(\"Estação3\");\n\t\t XYSeries aes4 = new XYSeries(\"Estação4\");\n\t\t XYSeries aes5 = new XYSeries(\"Estação5\");\n\t\t XYSeries aes6 = new XYSeries(\"Estação6\");\n\t\t XYSeries aes7 = new XYSeries(\"Estação7\");\n\t\t XYSeries aes8 = new XYSeries(\"Estação8\");\n\t\t XYSeries aes9 = new XYSeries(\"Estação9\");\n\t\t XYSeries aes10 = new XYSeries(\"Estação10\");\n\t\t XYSeries aes11 = new XYSeries(\"Estação11\");\n\t\t XYSeries aes12 = new XYSeries(\"Estação12\");\n\t\t XYSeries aes13 = new XYSeries(\"Estação13\");\n\t\t XYSeries aes14 = new XYSeries(\"Estação14\");\n\t\t XYSeries aes15 = new XYSeries(\"Estação15\");\n\t\t XYSeries aes16 = new XYSeries(\"Estação16\");\n\t\t \n\t\t //Definir numero de utilizadores em simultaneo para aparece na Interface\n\t\t XYSeries au1 = new XYSeries(\"AU1\");\n\t\t XYSeries au2 = new XYSeries(\"AU2\");\n\t\t XYSeries au3 = new XYSeries(\"AU3\");\n\t\t XYSeries au4 = new XYSeries(\"AU4\");\n\t\t XYSeries au5 = new XYSeries(\"AU5\");\n\t\t XYSeries au6 = new XYSeries(\"AU6\");\n\t\t XYSeries au7 = new XYSeries(\"AU7\");\n\t\t XYSeries au8 = new XYSeries(\"AU8\");\n\t\t XYSeries au9 = new XYSeries(\"AU9\");\n\t\t XYSeries au10 = new XYSeries(\"AU10\");\n\t\t \n\t\t //Colocar estacoes no gráfico\n\t\t aes1.add(12,12);\n\t\t aes2.add(12,37);\n\t\t aes3.add(12,62);\n\t\t aes4.add(12,87);\n\t\t \n\t\t aes5.add(37,12);\n\t\t aes6.add(37,37);\n\t\t aes7.add(37,62);\n\t\t aes8.add(37,87);\n\t\t \n\t\t aes9.add(62,12); \n\t\t aes10.add(62,37);\n\t\t aes11.add(62,62);\n\t\t aes12.add(62,87);\n\t\t \n\t\t aes13.add(87,12);\n\t\t aes14.add(87,37);\n\t\t aes15.add(87,62);\n\t\t aes16.add(87,87);\n\t\t \n\t\t//Para a bicicleta 1\n\t\t \t\n\t\t\t for(Entry<String, String> entry : position1.entrySet()) {\n\t\t\t\t String key = entry.getKey();\n\t\t\t\t \n\t\t\t\t String[] part= key.split(\",\");\n\t\t\t\t double keyX=Double.valueOf(part[0]);\n\t\t\t\t double keyY=Double.valueOf(part[1]);\n\t\t\t\t \n\t\t\t\t au1.add(keyX,keyY);\n\t\t\t }\n\t\t \n\t\t\t //Para a bicicleta 2\n\t\t for(Entry<String, String> entry : position2.entrySet()) {\n\t\t\t String key = entry.getKey();\n\t\t\t \n\t\t\t String[] part= key.split(\",\");\n\t\t\t double keyX=Double.valueOf(part[0]);\n\t\t\t double keyY=Double.valueOf(part[1]);\n\t\t\t \n\t\t\t au2.add(keyX,keyY);\n\t\t }\n\t\t \n\t\t //Para a bicicleta 3\n\t\t for(Entry<String, String> entry : position3.entrySet()) {\n\t\t\t String key = entry.getKey();\n\t\t\t \n\t\t\t String[] part= key.split(\",\");\n\t\t\t double keyX=Double.valueOf(part[0]);\n\t\t\t double keyY=Double.valueOf(part[1]);\n\t\t\t \n\t\t\t au3.add(keyX,keyY);\n\t\t }\n\t\t for(Entry<String, String> entry : position4.entrySet()) {\n\t\t\t String key = entry.getKey();\n\t\t\t \n\t\t\t String[] part= key.split(\",\");\n\t\t\t double keyX=Double.valueOf(part[0]);\n\t\t\t double keyY=Double.valueOf(part[1]);\n\t\t\t \n\t\t\t au4.add(keyX,keyY);\n\t\t }\n\t\t for(Entry<String, String> entry : position5.entrySet()) {\n\t\t\t String key = entry.getKey();\n\t\t\t \n\t\t\t String[] part= key.split(\",\");\n\t\t\t double keyX=Double.valueOf(part[0]);\n\t\t\t double keyY=Double.valueOf(part[1]);\n\t\t\t \n\t\t\t au5.add(keyX,keyY);\n\t\t }\n\t\t for(Entry<String, String> entry : position6.entrySet()) {\n\t\t\t String key = entry.getKey();\n\t\t\t \n\t\t\t String[] part= key.split(\",\");\n\t\t\t double keyX=Double.valueOf(part[0]);\n\t\t\t double keyY=Double.valueOf(part[1]);\n\t\t\t \n\t\t\t au6.add(keyX,keyY);\n\t\t }\n\t\t for(Entry<String, String> entry : position7.entrySet()) {\n\t\t\t String key = entry.getKey();\n\t\t\t \n\t\t\t String[] part= key.split(\",\");\n\t\t\t double keyX=Double.valueOf(part[0]);\n\t\t\t double keyY=Double.valueOf(part[1]);\n\t\t\t \n\t\t\t au7.add(keyX,keyY);\n\t\t }\n\t\t for(Entry<String, String> entry : position8.entrySet()) {\n\t\t\t String key = entry.getKey();\n\t\t\t \n\t\t\t String[] part= key.split(\",\");\n\t\t\t double keyX=Double.valueOf(part[0]);\n\t\t\t double keyY=Double.valueOf(part[1]);\n\t\t\t \n\t\t\t au8.add(keyX,keyY);\n\t\t }\n\t\t for(Entry<String, String> entry : position9.entrySet()) {\n\t\t\t String key = entry.getKey();\n\t\t\t \n\t\t\t String[] part= key.split(\",\");\n\t\t\t double keyX=Double.valueOf(part[0]);\n\t\t\t double keyY=Double.valueOf(part[1]);\n\t\t\t \n\t\t\t au9.add(keyX,keyY);\n\t\t }\n\t\t for(Entry<String, String> entry : position10.entrySet()) {\n\t\t\t String key = entry.getKey();\n\t\t\t \n\t\t\t String[] part= key.split(\",\");\n\t\t\t double keyX=Double.valueOf(part[0]);\n\t\t\t double keyY=Double.valueOf(part[1]);\n\t\t\t \n\t\t\t au10.add(keyX,keyY);\n\t\t }\n\t\t \n\t\t //Add series to dataset\n\t\t dataset.addSeries(au1);\n\t\t dataset.addSeries(au2);\n\t\t dataset.addSeries(au3);\n\t\t dataset.addSeries(au4);\n\t\t dataset.addSeries(au5);\n\t\t dataset.addSeries(au6);\n\t\t dataset.addSeries(au7);\n\t\t dataset.addSeries(au8);\n\t\t dataset.addSeries(au9);\n\t\t dataset.addSeries(au10);\n\t\t \n\t\t \n\t\t dataset.addSeries(aes1);\n\t\t dataset.addSeries(aes2);\n\t\t dataset.addSeries(aes3);\n\t\t dataset.addSeries(aes4);\n\t\t dataset.addSeries(aes5);\n\t\t dataset.addSeries(aes6);\n\t\t dataset.addSeries(aes7);\n\t\t dataset.addSeries(aes8);\n\t\t dataset.addSeries(aes9);\n\t\t dataset.addSeries(aes10);\n\t\t dataset.addSeries(aes11);\n\t\t dataset.addSeries(aes12);\n\t\t dataset.addSeries(aes13);\n\t\t dataset.addSeries(aes14);\n\t\t dataset.addSeries(aes15);\n\t\t dataset.addSeries(aes16);\n\t\t \n\t\t return dataset;\n\t }", "private static List<Point> createLinearDataset() {\r\n List<Point> data = new ArrayList<Point>();\r\n add(data, 1, 100);\r\n add(data, 5, 200);\r\n add(data, 10, 300);\r\n add(data, 15, 400);\r\n return data;\r\n }", "private LineData generateDataLine(int cnt, String name, ArrayList<Double> mainEmotion) {\n\n ArrayList<Entry> values1 = new ArrayList<>();\n\n //int[] val = {(int) happinessr, (int) sadnessr, (int) surpriser, (int) fearr, (int) neutralr, (int) contemptr, (int) angerr, (int) disgustr};\n\n for (int i = 0; i < mainEmotion.size(); i++) {\n values1.add(new Entry(i, mainEmotion.get(i).intValue()));\n }\n\n LineDataSet d1 = new LineDataSet(values1, name);\n d1.setLineWidth(2.5f);\n d1.setCircleRadius(4.5f);\n //Toast.makeText(getContext().getApplicationContext(), name, Toast.LENGTH_LONG).show();\n\n switch (name) {\n case \"Happiness\":\n d1.setColor(Color.rgb(189, 237, 255));\n d1.setCircleColors(Color.rgb(189, 237, 255));\n break;\n case \"Sadness\":\n d1.setColor(Color.rgb(74, 88, 176));\n d1.setCircleColors(Color.rgb(74, 88, 176));\n break;\n case \"Contempt\":\n d1.setColor(Color.rgb(242, 5, 92));\n d1.setCircleColors(Color.rgb(242, 5, 92));\n break;\n case \"Disgust\":\n d1.setColor(Color.rgb(79, 139, 62));\n d1.setCircleColors(Color.rgb(79, 139, 62));\n break;\n case \"Fear\":\n d1.setColor(Color.rgb(89, 72, 122));\n d1.setCircleColors(Color.rgb(89, 72, 122));\n break;\n case \"Surprise\":\n d1.setColor(Color.rgb(205, 185, 39));\n d1.setCircleColors(Color.rgb(205, 185, 39));\n break;\n case \"Anger\":\n d1.setColor(Color.rgb(189, 73, 84));\n d1.setCircleColors(Color.rgb(189, 73, 84));\n break;\n case \"Neutral\":\n d1.setColor(Color.rgb(220, 235, 221));\n d1.setCircleColors(Color.rgb(220, 235, 221));\n break;\n default:\n break;\n\n }\n\n d1.setHighLightColor(Color.rgb(255, 0, 0));\n d1.setDrawValues(false);\n\n ArrayList<Entry> values2 = new ArrayList<>();\n\n for (int i = 0; i < mainEmotion.size(); i++) {\n values2.add(new Entry(i, values1.get(i).getY() - 30));\n }\n\n ArrayList<ILineDataSet> sets = new ArrayList<>();\n sets.add(d1);\n //sets.add(d2);\n\n return new LineData(sets);\n }", "public static CategoryDataset createSampleDataset() {\n \t\n \t// row keys...\n final String series1 = \"Expected\";\n final String series2 = \"Have\";\n final String series3 = \"Goal\";\n\n // column keys...\n final String type1 = \"Type 1\";\n final String type2 = \"Type 2\";\n final String type3 = \"Type 3\";\n final String type4 = \"Type 4\";\n final String type5 = \"Type 5\";\n final String type6 = \"Type 6\";\n final String type7 = \"Type 7\";\n final String type8 = \"Type 8\";\n\n // create the dataset...\n final DefaultCategoryDataset dataset = new DefaultCategoryDataset();\n\n dataset.addValue(1.0, series1, type1);\n dataset.addValue(4.0, series1, type2);\n dataset.addValue(3.0, series1, type3);\n dataset.addValue(5.0, series1, type4);\n dataset.addValue(5.0, series1, type5);\n dataset.addValue(7.0, series1, type6);\n dataset.addValue(7.0, series1, type7);\n dataset.addValue(8.0, series1, type8);\n\n dataset.addValue(5.0, series2, type1);\n dataset.addValue(7.0, series2, type2);\n dataset.addValue(6.0, series2, type3);\n dataset.addValue(8.0, series2, type4);\n dataset.addValue(4.0, series2, type5);\n dataset.addValue(4.0, series2, type6);\n dataset.addValue(2.0, series2, type7);\n dataset.addValue(1.0, series2, type8);\n\n dataset.addValue(4.0, series3, type1);\n dataset.addValue(3.0, series3, type2);\n dataset.addValue(2.0, series3, type3);\n dataset.addValue(3.0, series3, type4);\n dataset.addValue(6.0, series3, type5);\n dataset.addValue(3.0, series3, type6);\n dataset.addValue(4.0, series3, type7);\n dataset.addValue(3.0, series3, type8);\n\n return dataset;\n \n }", "public void setLineData(ArrayList<Integer> allDay) {\r\n\r\n ArrayList<String> xVals = new ArrayList<String>();\r\n for (int i = 1; i <= 24; i++) {\r\n xVals.add((i) + \"\");\r\n }\r\n\r\n ArrayList<Entry> vals1 = new ArrayList<Entry>();\r\n\r\n for (int i = 1; i <= 24; i++) {\r\n vals1.add(new Entry(allDay.get(i-1), i));\r\n }\r\n Log.v(\"vals1\",vals1.toString());\r\n \t\r\n \t\r\n// \tint count = 45;\r\n// \tint range = 100; \r\n// \tArrayList<String> xVals = new ArrayList<String>();\r\n// for (int i = 0; i < count; i++) {\r\n// xVals.add((1990 +i) + \"\");\r\n// }\r\n//\r\n// ArrayList<Entry> vals1 = new ArrayList<Entry>();\r\n//\r\n// for (int i = 0; i < count; i++) {\r\n// float mult = (range + 1);\r\n// float val = (float) (Math.random() * mult) + 20;// + (float)\r\n// // ((mult *\r\n// // 0.1) / 10);\r\n// vals1.add(new Entry(val, i));\r\n// }\r\n// \r\n \t\r\n // create a dataset and give it a type\r\n LineDataSet set1 = new LineDataSet(vals1, \"DataSet 1\");\r\n set1.setDrawCubic(true);\r\n set1.setCubicIntensity(0.2f);\r\n set1.setDrawFilled(true);\r\n set1.setDrawCircles(false); \r\n set1.setLineWidth(2f);\r\n set1.setCircleSize(5f);\r\n set1.setHighLightColor(Color.rgb(244, 117, 117));\r\n set1.setColor(Color.rgb(104, 241, 175));\r\n\r\n ArrayList<LineDataSet> dataSets = new ArrayList<LineDataSet>();\r\n dataSets.add(set1);\r\n\r\n // create a data object with the datasets\r\n LineData data = new LineData(xVals, dataSets);\r\n\r\n // set data\r\n nChart.setData(data);\r\n }", "private CategoryDataset createDataset( )\n\t {\n\t final DefaultCategoryDataset dataset = \n\t new DefaultCategoryDataset( ); \n\t \n\t dataset.addValue(23756.0, \"余杭\", \"闲林\");\n\t dataset.addValue(29513.5, \"余杭\", \"良渚\");\n\t dataset.addValue(25722.2, \"余杭\", \"瓶窑\");\n\t dataset.addValue(19650.9, \"余杭\", \"星桥\");\n\t dataset.addValue(19661.6, \"余杭\", \"崇贤\");\n\t dataset.addValue(13353.9, \"余杭\", \"塘栖\");\n\t dataset.addValue(25768.9, \"余杭\", \"勾庄\");\n\t dataset.addValue(12682.8, \"余杭\", \"仁和\");\n\t dataset.addValue(22963.1, \"余杭\", \"乔司\");\n\t dataset.addValue(19695.6, \"余杭\", \"临平\");\n\t \n\t return dataset; \n\t }", "@Override\r\n\tpublic void setDataSeries(List<Double> factValues) {\n\r\n\t}", "public XYDataset getLineDataset() {\n\n // Initialize some variables\n XYSeriesCollection dataset = new XYSeriesCollection();\n XYSeries series[][] = new XYSeries[rois.length][images.length];\n String seriesname[][] = new String[rois.length][images.length];\n int currentSlice = ui.getOpenMassImages()[0].getCurrentSlice();\n ArrayList<String> seriesNames = new ArrayList<String>();\n String tempName = \"\";\n map = new HashMap<String, Pair<MimsPlus, Roi>>();\n double stat;\n\n // Image loop\n for (int j = 0; j < images.length; j++) {\n MimsPlus image;\n if (images[j].getMimsType() == MimsPlus.HSI_IMAGE || images[j].getMimsType() == MimsPlus.RATIO_IMAGE) {\n image = images[j].internalRatio;\n } else {\n image = images[j];\n }\n // Roi loop\n for (int i = 0; i < rois.length; i++) {\n\n // Set the Roi to the image.\n Integer[] xy = ui.getRoiManager().getRoiLocation(rois[i].getName(), image.getCurrentSlice());\n rois[i].setLocation(xy[0], xy[1]);\n image.setRoi(rois[i]);\n\n // Stat loop\n for (int k = 0; k < stats.length; k++) {\n\n // Generate a name for the dataset.\n String prefix = \"\";\n if (image.getType() == MimsPlus.MASS_IMAGE || image.getType() == MimsPlus.RATIO_IMAGE) {\n prefix = \"_m\";\n }\n if (seriesname[i][j] == null) {\n tempName = \"mean\" + prefix + image.getRoundedTitle(true) + \"_r\" + rois[i].getName();\n int dup = 1;\n while (seriesNames.contains(tempName)) {\n tempName = \"mean\" + prefix + image.getRoundedTitle(true) + \"_r\" + rois[i].getName() + \" (\" + dup + \")\";\n dup++;\n }\n seriesNames.add(tempName);\n seriesname[i][j] = tempName;\n }\n series[i][j] = new XYSeries(seriesname[i][j]);\n ij.gui.ProfilePlot profileP = new ij.gui.ProfilePlot(image);\n double[] newdata = profileP.getProfile();\n for (int p = 0; p < newdata.length; p++) {\n series[i][j].add(p, newdata[p]);\n }\n Pair tuple = new Pair(images[j], rois[i]);\n map.put(seriesname[i][j], tuple);\n\n } // End of Stat\n } // End of Roi\n } // End of Image\n\n // Populate the final data structure.\n for (int i = 0; i < rois.length; i++) {\n for (int j = 0; j < images.length; j++) {\n dataset.addSeries(series[i][j]);\n }\n }\n\n ui.getOpenMassImages()[0].setSlice(currentSlice);\n\n return dataset;\n }", "private XYDataset createDataset() {\n final XYSeriesCollection dataset = new XYSeriesCollection();\n //dataset.addSeries(totalDemand);\n dataset.addSeries(cerContent);\n //dataset.addSeries(cerDemand);\n dataset.addSeries(comContent);\n //dataset.addSeries(comDemand);\n dataset.addSeries(activation);\n dataset.addSeries(resolutionLevel);\n \n return dataset;\n }", "private PieData generateDataPie() {\n\n ArrayList<PieEntry> entries = new ArrayList<>();\n String year = year_txt.getText().toString();\n String month1 =Utilities.getMonth(months,month_txt.getText().toString());\n TransactionBeans transactionBeans = transactionDB.getTransactionRecordsYear(month1,year);\n if(transactionBeans!=null) {\n float income = 0;\n float expense = 0;\n try{\n income = (float) (Double.parseDouble(transactionBeans.getIncome()));\n }catch(Exception e){\n income = 0;\n }\n try{\n expense = (float) (Double.parseDouble(transactionBeans.getExpense()));\n }catch(Exception e){\n expense = 0;\n }\n entries.add(new PieEntry(income, \"Income \"));\n entries.add(new PieEntry(expense, \"Expense \"));\n }\n PieDataSet d = new PieDataSet(entries, \"\");\n\n // space between slices\n d.setSliceSpace(2f);\n d.setColors(ColorTemplate.VORDIPLOM_COLORS);\n\n return new PieData(d);\n }", "private static CategoryDataset createDataset() throws SQLException, InterruptedException \n\t{ \n\t\t// creating dataset \n\t\tDefaultCategoryDataset dataset = new DefaultCategoryDataset();\n\t\t\n\t\t//setting up the connexion\n\t\tConnection con = null;\n\t\tString conUrl = \"jdbc:sqlserver://\"+Login.Host+\"; databaseName=\"+Login.databaseName+\"; user=\"+Login.user+\"; password=\"+Login.password+\";\";\n\t\ttry \n\t\t{\n\t\t\tcon = DriverManager.getConnection(conUrl);\n\t\t} \n\t\tcatch (SQLException e1) \n\t\t{\n\t\t\te1.printStackTrace();\n\t\t}\n\t\t\n\t\t//this counter will allow me to run my while loop only once\n\t\tint cnt=0;\n\t\twhile(cnt<1)\n\t\t{ \n\t\t\t//check the query number at each call to the function in order to know which procedure must me executed\n\t\t\tif (queryNumber==0){\n\t\t\t\tcnt++;\n\t\t\t\tcstmt = con.prepareCall(\"{call avgMonthly(?,?,?,?)}\");\n\t\t\t\t\n\t\t\t\t//setting the procedures parameters with the one chosen by the user\n\t\t\t\tcstmt.setInt(1, Integer.parseInt(year));\n\t\t\t\tcstmt.setInt(2, Integer.parseInt(month));\n\t\t\t\tcstmt.setString(3, featureStringH);\t\n\t\t\t\tcstmt.setString(4, actionStringH);\t\n\t\t\t\tResultSet aveTempAvg = cstmt.executeQuery();\n\t\t\t\t\n\t\t\t\t// extracting the data of my query in order to plot it\n\t\t\t\tResultSetMetaData rsmd = aveTempAvg.getMetaData();\n\t\t\t\tif(rsmd!=null) \n\t\t\t\t{\n\t\t\t\t\twhile (aveTempAvg.next()) \n\t\t\t\t\t{\n\t\t\t\t\t\tString columnValue = aveTempAvg.getString(1);//latency\n\t\t\t\t\t\tint dayAxisNum=aveTempAvg.getInt(2);//average\n\t\t\t\t\t\tif(columnValue!=null) {\n\t\t\t\t\t\t\t//Adding the result of the query to the data set and setting y value to the average latency and x to the corresponding day\n\t\t\t\t\t\t\tdataset.setValue(Double.parseDouble(columnValue),\"series\",Integer.toString(dayAxisNum));\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\tdataset.setValue(0, (\"series\" +\"\"+0), \"\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\telse if (queryNumber==1){\n\t\t\t\tcnt++;\n\t\t\t\tcstmt = con.prepareCall(\"{call avgDaily(?,?,?)}\");\t\n\t\t\t\t/*for the second query , the user will enter seperate year month and day \n\t\t\t\t so we wil have to concatenate the date into a string before setting the date value*/\n\t\t\t\tString newDate= year+\"-\"+month+\"-\"+day;\n\t\t\t\tcstmt.setString(1, newDate);\n\t\t\t\tcstmt.setString(2, featureStringH);\n\t\t\t\tcstmt.setString(3, actionStringH);\t\n\t\t\t\tResultSet aveTempAvg = cstmt.executeQuery();\n\t\t\t\t\n\t\t\t\t//extracting the data of the query\n\t\t\t\tResultSetMetaData rsmd = aveTempAvg.getMetaData();\n\t\t\t\tif(rsmd!=null) \n\t\t\t\t{\n\t\t\t\t\tint hour = 0;\n\t\t\t\t\twhile (aveTempAvg.next()) \n\t\t\t\t\t{\n\t\t\t\t\t\tString columnValue = aveTempAvg.getString(1);\n\t\t\t\t\t\tint hour2=aveTempAvg.getInt(2);\n\t\t\t\t\t\tif(columnValue!=null) {\n\t\t\t\t\t\t\t//setting y value to the average and the x is the corresponding hour\n\t\t\t\t\t\t\tdataset.setValue(Double.parseDouble(columnValue),\"series\",Integer.toString(hour2));\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\t//I will add 0 if I don't have the corresponding value of the specified Hour\n\t\t\t\t\t\t\tdataset.setValue(0, (\"series\" +\"\"+hour), \"\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (queryNumber==2){\n\t\t\t\tcnt++;\n\t\t\t\t//Thread.sleep(100);\n\t\t\t\tcstmt = con.prepareCall(\"{call avgHour(?,?,?,?)}\");\t\n\t\t\t\tString newDate2= year+\"-\"+month+\"-\"+day;\n\t\t\t\t//same as for the daily query we have to set the parameters , we add to that the hour as last parameter\n\t\t\t\tcstmt.setString(1, newDate2);\n\t\t\t\tcstmt.setString(2, featureStringH);\n\t\t\t\tcstmt.setString(3, actionStringH);\n\t\t\t\tcstmt.setInt(4,Integer.parseInt(hourString));\n\t\t\t\tResultSet aveTempAvg = cstmt.executeQuery();\n\t\t\t\t\n\t\t\t\t//extract the data from the query\n\t\t\t\tResultSetMetaData rsmd = aveTempAvg.getMetaData();\n\t\t\t\tif(rsmd!=null) \n\t\t\t\t{\n\t\t\t\t\twhile (aveTempAvg.next()) \n\t\t\t\t\t{\n\t\t\t\t\t\tString columnValue = aveTempAvg.getString(1);\n\t\t\t\t\t\tint min=aveTempAvg.getInt(2);\n\t\t\t\t\t\tif(columnValue!=null) {\n\t\t\t\t\t\t\t//setting y value to the average and the x is the corresponding minute\n\n\t\t\t\t\t\t\tdataset.setValue(Double.parseDouble(columnValue),\"series\",Integer.toString(min));\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\t//adding 0 if I don't have the corresponding minute\n\t\t\t\t\t\t\tdataset.setValue(0, (\"series\"+min),\"\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\treturn dataset; \n\t}", "public static CategoryDataset createDataset() {\r\n DefaultCategoryDataset dataset = new DefaultCategoryDataset();\r\n dataset.addValue(1.0, \"First\", \"C1\");\r\n dataset.addValue(4.0, \"First\", \"C2\");\r\n dataset.addValue(3.0, \"First\", \"C3\");\r\n dataset.addValue(5.0, \"First\", \"C4\");\r\n dataset.addValue(5.0, \"First\", \"C5\");\r\n dataset.addValue(7.0, \"First\", \"C6\");\r\n dataset.addValue(7.0, \"First\", \"C7\");\r\n dataset.addValue(8.0, \"First\", \"C8\");\r\n dataset.addValue(5.0, \"Second\", \"C1\");\r\n dataset.addValue(7.0, \"Second\", \"C2\");\r\n dataset.addValue(6.0, \"Second\", \"C3\");\r\n dataset.addValue(8.0, \"Second\", \"C4\");\r\n dataset.addValue(4.0, \"Second\", \"C5\");\r\n dataset.addValue(4.0, \"Second\", \"C6\");\r\n dataset.addValue(2.0, \"Second\", \"C7\");\r\n dataset.addValue(1.0, \"Second\", \"C8\");\r\n dataset.addValue(4.0, \"Third\", \"C1\");\r\n dataset.addValue(3.0, \"Third\", \"C2\");\r\n dataset.addValue(2.0, \"Third\", \"C3\");\r\n dataset.addValue(3.0, \"Third\", \"C4\");\r\n dataset.addValue(6.0, \"Third\", \"C5\");\r\n dataset.addValue(3.0, \"Third\", \"C6\");\r\n dataset.addValue(4.0, \"Third\", \"C7\");\r\n dataset.addValue(3.0, \"Third\", \"C8\");\r\n return dataset;\r\n }", "Series<double[]> makeSeries(int dimension);", "private LineData generateDataLine(int cnt) {\n\n ArrayList<Entry> e1 = new ArrayList<Entry>();\n\n for (int i = 0; i < 12; i++) {\n e1.add(new Entry(i, (int) (Math.random() * 65) + 40));\n }\n\n LineDataSet d1 = new LineDataSet(e1, \"New DataSet \" + cnt + \", (1)\");\n d1.setLineWidth(2.5f);\n d1.setCircleRadius(4.5f);\n d1.setHighLightColor(Color.rgb(244, 117, 117));\n d1.setDrawValues(false);\n\n ArrayList<Entry> e2 = new ArrayList<Entry>();\n\n for (int i = 0; i < 12; i++) {\n e2.add(new Entry(i, e1.get(i).getY() - 30));\n }\n\n LineDataSet d2 = new LineDataSet(e2, \"New DataSet \" + cnt + \", (2)\");\n d2.setLineWidth(2.5f);\n d2.setCircleRadius(4.5f);\n d2.setHighLightColor(Color.rgb(244, 117, 117));\n d2.setColor(ColorTemplate.VORDIPLOM_COLORS[0]);\n d2.setCircleColor(ColorTemplate.VORDIPLOM_COLORS[0]);\n d2.setDrawValues(false);\n\n ArrayList<ILineDataSet> sets = new ArrayList<ILineDataSet>();\n sets.add(d1);\n sets.add(d2);\n\n LineData cd = new LineData(sets);\n return cd;\n }", "public void addDataPoint2( DataPoint dataPoint ) {\n\t\tif ( dataPoint.x < 50.0 ){\n\t\t\tsumX1 += dataPoint.x;\n\t\t\tsumX1X1 += dataPoint.x*dataPoint.x;\n\t\t\tsumX1Y += dataPoint.x*dataPoint.z;\n\t\t\tsumY += dataPoint.z;\n\t\t\tsumYY += dataPoint.z*dataPoint.z;\n\n\t\t\tif ( dataPoint.x > X1Max ) {\n\t\t\t\tX1Max = (int)dataPoint.x;\n\t\t\t}\n\t\t\tif ( dataPoint.z > YMax ) {\n\t\t\t\tYMax = (int)dataPoint.z;\n\t\t\t}\n\n\t\t\t// 把每個點的具體座標存入 ArrayList中,備用。\n\t\t\txyz[0] = (int)dataPoint.x+ \"\";\n\t\t\txyz[2] = (int)dataPoint.z+ \"\";\n\t\t\tif ( dataPoint.x !=0 && dataPoint.z != 0 ) {\n\t\t\t\ttry {\n\t\t\t\t\tlistX.add( numPoint, xyz[0] );\n\t\t\t\t\tlistZ.add( numPoint, xyz[2] );\n\t\t\t\t} \n\t\t\t\tcatch ( Exception e ) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\t++numPoint;\n\t\t}\n\t\telse {\n\t\t\t sumX50 += dataPoint.x;\n\t\t \t sumX50X50 += dataPoint.x*dataPoint.x;\n\t\t\t sumX50Y50 += dataPoint.x*dataPoint.z;\n\t\t\t sumY50 += dataPoint.z;\n\t\t\t sumY50Y50 += dataPoint.z*dataPoint.z;\n\n\t\t\t if ( dataPoint.x > X50Max ) {\n\t\t\t\t X50Max = (int)dataPoint.x;\n\t\t\t }\n\t\t\t if ( dataPoint.z > Y50Max ) {\n\t\t\t\t Y50Max = (int)dataPoint.z;\n\t\t\t }\n\n\t\t\t // 把每個點的具體座標存入 ArrayList中,備用。\n\t\t\t xyz50[0] = (int)dataPoint.x+ \"\";\n\t\t\t xyz50[2] = (int)dataPoint.z+ \"\";\n\t\t\t if ( dataPoint.x !=0 && dataPoint.z != 0 ) {\n\t\t\t\t try {\n\t\t\t\t\t listX50.add( numPoint50, xyz50[0] );\n\t\t\t\t\t listZ50.add( numPoint50, xyz50[2] );\n\t\t\t\t } \n\t\t\t\t catch ( Exception e ) {\n\t\t\t\t\t e.printStackTrace();\n\t\t\t\t }\n\t\t\t }\n\t\t\t\n\t\t\t ++numPoint50;\n\t\t}\n\t\tcoefsValid = false;\n\t}", "private void testData() {\r\n\r\n // Setup for a function of the type y = c0 + c1*exp(c2*x) + c3*exp(c4*x)\r\n\r\n xSeries[0] = 0;\r\n ySeries[0] = 1 + 2 + 3;\r\n\r\n xSeries[1] = 1;\r\n ySeries[1] = 1 + (2 * Math.exp(-0.3)) + (3*Math.exp(-0.5));\r\n\r\n xSeries[2] = 2;\r\n ySeries[2] = 1 + (2 * Math.exp(-0.6)) + (3*Math.exp(-1.0));\r\n\r\n xSeries[3] = 3;\r\n ySeries[3] = 1 + (2 * Math.exp(-0.9)) + (3 * Math.exp(-1.5));\r\n\r\n xSeries[4] = 4;\r\n ySeries[4] = 1 + (2 * Math.exp(-1.2)) + (3 * Math.exp(-2.0));\r\n }", "private DefaultCategoryDataset createDataset() {\n\t\t\n\t\tdataset.clear();\n\t\t\n\t\t// Query HIM to submit data for bar chart display \n\t\tHistoricalInfoMgr.getChartDataset(expNum);\n\n\n\t\treturn dataset; // add the data point (y-value, variable, x-value)\n\t}", "private static PieDataset createDataset(double total, double avild) {\n DefaultPieDataset dataset = new DefaultPieDataset();\n double favild = (int)(avild/total*100);\n double fused = (int)(100-favild);\n dataset.setValue(\"Used\", new Double(fused));\n dataset.setValue(\"Avail\", new Double(favild));\n return dataset; \n }", "private void initDataset(){\n dataSet.add(\"Karin\");\n dataSet.add(\"Ingrid\");\n dataSet.add(\"Helga\");\n dataSet.add(\"Renate\");\n dataSet.add(\"Elke\");\n dataSet.add(\"Ursula\");\n dataSet.add(\"Erika\");\n dataSet.add(\"Christa\");\n dataSet.add(\"Gisela\");\n dataSet.add(\"Monika\");\n\n addDataSet.add(\"Anna\");\n addDataSet.add(\"Sofia\");\n addDataSet.add(\"Emilia\");\n addDataSet.add(\"Emma\");\n addDataSet.add(\"Neele\");\n addDataSet.add(\"Franziska\");\n addDataSet.add(\"Heike\");\n addDataSet.add(\"Katrin\");\n addDataSet.add(\"Katharina\");\n addDataSet.add(\"Liselotte\");\n }", "public void get_InputValues(){\r\n\tA[1]=-0.185900;\r\n\tA[2]=-0.85900;\r\n\tA[3]=-0.059660;\r\n\tA[4]=-0.077373;\r\n\tB[1]=30.0;\r\n\tB[2]=19.2;\r\n\tB[3]=13.8;\r\n\tB[4]=22.5;\r\n\tC[1]=4.5;\r\n\tC[2]=12.5;\r\n\tC[3]=27.5;\r\n\tD[1]=16.0;\r\n\tD[2]=10.0;\r\n\tD[3]=7.0;\r\n\tD[4]=5.0;\r\n\tD[5]=4.0;\r\n\tD[6]=3.0;\r\n\t\r\n}", "private XYDataset createDataset() {\n\t\tfinal XYSeriesCollection dataset = new XYSeriesCollection( ); \n\t\tdataset.addSeries(trainErrors); \n\t\tdataset.addSeries(testErrors);\n\t\treturn dataset;\n\t}", "public void drawChart() {\n ArrayList<Entry> confuse = new ArrayList<>();\n ArrayList<Entry> attention = new ArrayList<>();\n ArrayList<Entry> engagement = new ArrayList<>();\n ArrayList<Entry> joy = new ArrayList<>();\n ArrayList<Entry> valence = new ArrayList<>();\n // point = \"Brow Furrow: \\n\";\n String dum = null, dum2 = null;\n for (int i = 0; i < size; i++) {\n //point += (\"\" + Emotion.getBrowFurrow(i).getL() + \" seconds reading of \" + Emotion.getBrowFurrow(i).getR() + \"\\n\");\n dum2 = Emotion.getBrowFurrow(i).getL().toString();\n dum = Emotion.getBrowFurrow(i).getR().toString();\n confuse.add(new Entry((float)Double.parseDouble(dum2), Float.parseFloat(dum)));\n dum2 = Emotion.getAttention(i).getL().toString();\n dum = Emotion.getAttention(i).getR().toString();\n attention.add(new Entry((float)Double.parseDouble(dum2), Float.parseFloat(dum)));\n dum2 = Emotion.getEngagement(i).getL().toString();\n dum = Emotion.getEngagement(i).getR().toString();\n engagement.add(new Entry((float)Double.parseDouble(dum2), Float.parseFloat(dum)));\n dum2 = Emotion.getJoy(i).getL().toString();\n dum = Emotion.getJoy(i).getR().toString();\n joy.add(new Entry((float)Double.parseDouble(dum2), Float.parseFloat(dum)));\n dum2 = Emotion.getValence(i).getL().toString();\n dum = Emotion.getValence(i).getR().toString();\n valence.add(new Entry((float)Double.parseDouble(dum2), Float.parseFloat(dum)));\n }\n\n LineDataSet data1 = new LineDataSet(confuse,\"Confuse\");\n LineDataSet data2 = new LineDataSet(attention,\"Attention\");\n LineDataSet data3 = new LineDataSet(engagement,\"Engagement\");\n LineDataSet data4 = new LineDataSet(joy,\"Engagement\");\n LineDataSet data5 = new LineDataSet(valence,\"Valence\");\n data1.setColor(Color.BLUE);\n data1.setDrawCircles(false);\n data2.setColor(Color.YELLOW);\n data2.setDrawCircles(false);\n data3.setColor(Color.GRAY);\n data3.setDrawCircles(false);\n data4.setColor(Color.MAGENTA);\n data4.setDrawCircles(false);\n data5.setColor(Color.GREEN);\n data5.setDrawCircles(false);\n\n\n dataSets.add(data1);\n dataSets.add(data2);\n dataSets.add(data3);\n dataSets.add(data4);\n dataSets.add(data5);\n }", "public org.apache.spark.sql.catalyst.util.QuantileSummaries insert (double x) { throw new RuntimeException(); }", "private void setData(int count) {\n\n int goalValue = mSharedPreferences.getData(PREF_GOAL_VALUE);\n Log.e(TAG, \"setData: \" + goalValue);\n\n ArrayList<Entry> values = new ArrayList<>();\n values.add(new Entry(0, 0));\n for (int i = 1; i < count; i++) {\n\n float val = (float) (Math.random() * 10) + values.get(i-1).getY();\n Log.e(TAG, \"val 1: \" + val);\n\n if(val >= goalValue) val = goalValue;\n Log.e(TAG, \"val 2: \" + val);\n\n values.add(new Entry(i, val));\n }\n\n LineDataSet lineDataSet;\n\n if (mChart.getData() != null &&\n mChart.getData().getDataSetCount() > 0) {\n lineDataSet = (LineDataSet)mChart.getData().getDataSetByIndex(0);\n lineDataSet.setValues(values);\n mChart.getData().notifyDataChanged();\n mChart.notifyDataSetChanged();\n } else {\n // create a dataset and give it a type\n lineDataSet = new LineDataSet(values, \"\");\n\n lineDataSet.setColor(ContextCompat.getColor(getContext(), R.color.green));\n lineDataSet.setCircleColor(ContextCompat.getColor(getContext(), R.color.green));\n lineDataSet.setDrawIcons(false);\n lineDataSet.setLineWidth(2f);\n lineDataSet.setCircleRadius(1f);\n lineDataSet.setDrawCircleHole(false);\n lineDataSet.setDrawFilled(true);\n lineDataSet.disableDashedLine();\n\n mChart.setDescription(new Description()); // Hide the description\n mChart.getAxisLeft().setDrawGridLines(false);\n mChart.getAxisLeft().setDrawLabels(false);\n mChart.getAxisRight().setDrawGridLines(false);\n mChart.getAxisRight().setDrawLabels(false);\n mChart.getXAxis().setDrawGridLines(false);\n mChart.getXAxis().setDrawLabels(false);\n mChart.getLegend().setEnabled(false);\n\n lineDataSet.setDrawValues(false);\n\n if (Utils.getSDKInt() >= 18) {\n // fill drawable only supported on api level 18 and above\n final Drawable drawable = ContextCompat.getDrawable(getContext(), R.drawable.ic_add_black_24dp);\n lineDataSet.setFillDrawable(drawable);\n }\n else {\n lineDataSet.setFillColor(Color.BLACK);\n }\n\n\n ArrayList<Entry> values2 = new ArrayList<>();\n values2.add(new Entry(values.get(20).getX(), values.get(20).getY()));\n for (int i = 29; i >= 20; i--) {\n\n float val = (float) (Math.random() * 10) + values.get(i).getY();\n\n Log.d(TAG, \"Golden Values : \" + val);\n values2.add(new Entry(values.get(20).getX() + i, val));\n }\n\n LineDataSet lineDataSet2;\n\n lineDataSet2 = new LineDataSet(values2, \"Predicted\");\n\n lineDataSet2.setColor(ContextCompat.getColor(getContext(), R.color.colorOppositePrimary));\n lineDataSet2.setCircleColor(ContextCompat.getColor(getContext(), R.color.colorOppositePrimary));\n lineDataSet2.setDrawIcons(false);\n lineDataSet2.setLineWidth(2f);\n lineDataSet2.setCircleRadius(1f);\n lineDataSet2.setDrawCircleHole(false);\n lineDataSet2.setDrawFilled(true);\n lineDataSet2.disableDashedLine();\n\n lineDataSet2.setDrawValues(false);\n\n if (Utils.getSDKInt() >= 18) {\n // fill drawable only supported on api level 18 and above\n final Drawable drawable = ContextCompat.getDrawable(getContext(), R.drawable.ic_add_black_24dp);\n lineDataSet2.setFillDrawable(drawable);\n }\n else {\n lineDataSet2.setFillColor(Color.BLACK);\n }\n\n final ArrayList<ILineDataSet> dataSets = new ArrayList<>();\n dataSets.add(lineDataSet); // add the datasets\n// dataSets.add(lineDataSet2);\n\n // create a data object with the datasets\n final LineData data = new LineData(lineDataSet/*, lineDataSet2*/);\n\n // set data\n mChart.setData(data);\n\n// final ArrayList<ILineDataSet> dataSets2 = new ArrayList<>();\n// dataSets.add(lineDataSet2); // add the datasets\n\n // create a data object with the datasets\n// final LineData data2 = new LineData(dataSets2);\n// mChart.setData(data2);\n }\n }", "public XYDataset getDataset() {\n\n // Initialize some variables\n XYSeriesCollection dataset = new XYSeriesCollection();\n XYSeries series[][][] = new XYSeries[rois.length][images.length][stats.length];\n String seriesname[][][] = new String[rois.length][images.length][stats.length];\n int currentSlice = ui.getOpenMassImages()[0].getCurrentSlice();\n ArrayList<String> seriesNames = new ArrayList<String>();\n String tempName = \"\";\n double stat;\n\n // Image loop\n for (int j = 0; j < images.length; j++) {\n MimsPlus image;\n if (images[j].getMimsType() == MimsPlus.HSI_IMAGE || images[j].getMimsType() == MimsPlus.RATIO_IMAGE) {\n image = images[j].internalRatio;\n } else {\n image = images[j];\n }\n\n // Plane loop\n for (int ii = 0; ii < planes.size(); ii++) {\n int plane = (Integer) planes.get(ii);\n if (image.getMimsType() == MimsPlus.MASS_IMAGE) {\n ui.getOpenMassImages()[0].setSlice(plane, false);\n } else if (image.getMimsType() == MimsPlus.RATIO_IMAGE) {\n ui.getOpenMassImages()[0].setSlice(plane, image);\n }\n\n // Roi loop\n for (int i = 0; i < rois.length; i++) {\n\n // Set the Roi to the image.\n Integer[] xy = ui.getRoiManager().getRoiLocation(rois[i].getName(), plane);\n rois[i].setLocation(xy[0], xy[1]);\n image.setRoi(rois[i]);\n\n // Stat loop\n for (int k = 0; k < stats.length; k++) {\n\n // Generate a name for the dataset.\n String prefix = \"\";\n if (image.getType() == MimsPlus.MASS_IMAGE || image.getType() == MimsPlus.RATIO_IMAGE) {\n prefix = \"_m\";\n }\n if (seriesname[i][j][k] == null) {\n tempName = stats[k] + prefix + image.getRoundedTitle(true) + \"_r\" + rois[i].getName();\n int dup = 1;\n while (seriesNames.contains(tempName)) {\n tempName = stats[k] + prefix + image.getRoundedTitle(true) + \"_r\" + rois[i].getName() + \" (\" + dup + \")\";\n dup++;\n }\n seriesNames.add(tempName);\n seriesname[i][j][k] = tempName;\n }\n\n // Add data to the series.\n if (series[i][j][k] == null) {\n series[i][j][k] = new XYSeries(seriesname[i][j][k]);\n }\n\n // Get the statistic.\n stat = getSingleStat(image, stats[k], ui);\n if (stat > Double.MAX_VALUE || stat < (-1.0) * Double.MAX_VALUE) {\n stat = Double.NaN;\n }\n series[i][j][k].add(((Integer) planes.get(ii)).intValue(), stat);\n\n } // End of Stat\n } // End of Roi\n } // End of Plane\n } // End of Image\n\n // Populate the final data structure.\n for (int i = 0; i < rois.length; i++) {\n for (int j = 0; j < images.length; j++) {\n for (int k = 0; k < stats.length; k++) {\n dataset.addSeries(series[i][j][k]);\n }\n }\n }\n\n ui.getOpenMassImages()[0].setSlice(currentSlice);\n\n return dataset;\n }", "private void addDataSet() {\n Log.d(TAG, \"addDataSet started\");\n ArrayList<PieEntry> yEntrys = new ArrayList<>();\n ArrayList<String> xEntrys = new ArrayList<>();\n\n for(int i = 0; i < yData.length; i++){\n yEntrys.add(new PieEntry(yData[i] , i));\n }\n\n for(int i = 1; i < xData.length; i++){\n xEntrys.add(xData[i]);\n }\n\n //Create the data set\n PieDataSet pieDataSet = new PieDataSet(yEntrys, \"Popularity stat\");\n pieDataSet.setSliceSpace(2);\n pieDataSet.setValueTextSize(12);\n pieDataSet.setValueTextColor(Color.WHITE);\n\n\n\n //Add colors to dataset\n ArrayList<Integer> colors = new ArrayList<>();\n colors.add(Color.BLUE);\n colors.add(Color.RED);\n colors.add(Color.GREEN);\n colors.add(Color.CYAN);\n colors.add(Color.YELLOW);\n colors.add(Color.MAGENTA);\n\n pieDataSet.setColors(colors);\n\n //Add legend to chart\n Legend legend = pieChart.getLegend();\n legend.setForm(Legend.LegendForm.DEFAULT);\n legend.setPosition(Legend.LegendPosition.ABOVE_CHART_CENTER);\n\n //Create pie data object\n PieData pieData = new PieData(pieDataSet);\n pieChart.setData(pieData);\n pieChart.invalidate();\n }", "public HistogramDataSet getData();", "public String[][] rowData(){\n\t\t int n=(int) ((endeInterval-startInterval)/schritt);\n\t\t String[][] Data = new String[n+1][2];\n\t\t for(int i = 0;i<=n;i++){\n\t\t\t Data[i][0] = String.valueOf(startInterval + i*schritt);\n\t\t\t Data[i][1] = String.valueOf(Auswerten.plotter((startInterval + i*schritt),funcString));\n\t\t }\n\t\treturn Data ; \n\t }", "private static void fillDataset(Dataset d){\n try{\n\n BufferedReader in = new BufferedReader(new FileReader(\"src/points.txt\"));\n String str;\n while ((str = in.readLine()) != null){\n String[] tmp=str.split(\",\");\n d.addPoint(new Point(Double.parseDouble(tmp[0]), Double.parseDouble(tmp[1])));\n }\n in.close();\n }\n catch (IOException e){\n System.out.println(\"File Read Error\");\n }\n }", "public void addRow(String data){//adds a new row of data to the table\n\t\t\t\tif(row_count<100){//checks to see if there is space left in the current datum for an additional rows\n\t\t\t\t\tif(row_count<50){//halvs the data for more efficiant row insertion\n\t\t\t\t\t\tif(row_count<10){//checks to see if it is in the first inner datum\n\t\t\t\t\t\t\tif(dataarr!=null){//makes suhure there is an innerdatum to send the data to\n\t\t\t\t\t\t\t\tdataarr[0].addRow(data);\n\t\t\t\t\t\t\t}else{//if there is not an inner datum in the current spot this adds a new one\n\t\t\t\t\t\t\t\tdataarr[0]=new InnerDatum();\n\t\t\t\t\t\t\t\tdataarr[0].addRow(data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else if(row_count<20){//checks to see if it is in the second inner datum\n\t\t\t\t\t\t\tf(dataarr!=null){//makes suhure there is an innerdatum to send the data to\n\t\t\t\t\t\t\t\tdataarr[1].addRow(data);\n\t\t\t\t\t\t\t}else{//if there is not an inner datum in the current spot this adds a new one\n\t\t\t\t\t\t\t\tdataarr[1]=new InnerDatum();\n\t\t\t\t\t\t\t\tdataarr[1].addRow(data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else if(row_count<30){//checks to see if it is in the third inner datum\n\t\t\t\t\t\t\tif(dataarr!=null){//makes suhure there is an innerdatum to send the data to\n\t\t\t\t\t\t\t\tdataarr[2].addRow(data);\n\t\t\t\t\t\t\t}else{//if there is not an inner datum in the current spot this adds a new one\n\t\t\t\t\t\t\t\tdataarr[2]=new InnerDatum();\n\t\t\t\t\t\t\t\tdataarr[2].addRow(data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else if(row_count<40){//checks to see if it is in the fourth inner datum\n\t\t\t\t\t\t\tif(dataarr!=null){//makes suhure there is an innerdatum to send the data to\n\t\t\t\t\t\t\t\tdataarr[3].addRow(data);\n\t\t\t\t\t\t\t}else{//if there is not an inner datum in the current spot this adds a new one\n\t\t\t\t\t\t\t\tdataarr[3]=new InnerDatum();\n\t\t\t\t\t\t\t\tdataarr[3].addRow(data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{//checks to see if it is in the fifth inner datum\n\t\t\t\t\t\t\tif(dataarr!=null){//makes suhure there is an innerdatum to send the data to\n\t\t\t\t\t\t\t\tdataarr[4].addRow(data);\n\t\t\t\t\t\t\t}else{//if there is not an inner datum in the current spot this adds a new one\n\t\t\t\t\t\t\t\tdataarr[4]=new InnerDatum();\n\t\t\t\t\t\t\t\tdataarr[4].addRow(data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\t\n\t\t\t\t\t\tif(row_count<60){//checks to see if it is in the sixth inner datum\n\t\t\t\t\t\t\tif(dataarr!=null){//makes suhure there is an innerdatum to send the data to\n\t\t\t\t\t\t\t\tdataarr[5].addRow(data);\n\t\t\t\t\t\t\t}else{//if there is not an inner datum in the current spot this adds a new one\n\t\t\t\t\t\t\t\tdataarr[5]=new InnerDatum();\n\t\t\t\t\t\t\t\tdataarr[5].addRow(data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else if(row_count<70){//checks to see if it is in the seventh inner datum\n\t\t\t\t\t\t\tif(dataarr!=null){//makes suhure there is an innerdatum to send the data to\n\t\t\t\t\t\t\t\tdataarr[6].addRow(data);\n\t\t\t\t\t\t\t}else{//if there is not an inner datum in the current spot this adds a new one\n\t\t\t\t\t\t\t\tdataarr[6]=new InnerDatum();\n\t\t\t\t\t\t\t\tdataarr[6].addRow(data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else if(row_count<80){//checks to see if it is in the eighth inner datum\n\t\t\t\t\t\t\tif(dataarr!=null){//makes suhure there is an innerdatum to send the data to\n\t\t\t\t\t\t\t\tdataarr[7].addRow(data);\n\t\t\t\t\t\t\t}else{//if there is not an inner datum in the current spot this adds a new one\n\t\t\t\t\t\t\t\tdataarr[7]=new InnerDatum();\n\t\t\t\t\t\t\t\tdataarr[7].addRow(data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else if(row_count<90){//checks to see if it is in the ninth inner datum\n\t\t\t\t\t\t\tif(dataarr!=null){//makes suhure there is an innerdatum to send the data to\n\t\t\t\t\t\t\t\tdataarr[8].addRow(data);\n\t\t\t\t\t\t\t}else{//if there is not an inner datum in the current spot this adds a new one\n\t\t\t\t\t\t\t\tdataarr[8]=new InnerDatum();\n\t\t\t\t\t\t\t\tdataarr[8].addRow(data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{//checks to see if it is in the tenth inner datum\n\t\t\t\t\t\t\tif(dataarr!=null){//makes suhure there is an innerdatum to send the data to\n\t\t\t\t\t\t\t\tdataarr[9].addRow(data);\n\t\t\t\t\t\t\t}else{//if there is not an inner datum in the current spot this adds a new one\n\t\t\t\t\t\t\t\tdataarr[9]=new InnerDatum();\n\t\t\t\t\t\t\t\tdataarr[9].addRow(data);\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}else{//acctivated when there is no room left in the current outer datum}\n\t\t\t\t\tif(next==null){//checks to see if there is a next outer datum\n\t\t\t\t\t\tnext=new OuterDatum();\t\n\t\t\t\t\t}\n\t\t\t\t\tnext.addRow(data);\n\t\t\t\t}\n\t\t\t}", "private List<Tuple2<Integer, Integer>> initSampleDataset() {\n List<Tuple2<Integer, Integer>> rawChapterData = new ArrayList<>();\n rawChapterData.add(new Tuple2<>(96, 1));\n rawChapterData.add(new Tuple2<>(97, 1));\n rawChapterData.add(new Tuple2<>(98, 1));\n rawChapterData.add(new Tuple2<>(99, 2));\n rawChapterData.add(new Tuple2<>(100, 3));\n rawChapterData.add(new Tuple2<>(101, 3));\n rawChapterData.add(new Tuple2<>(102, 3));\n rawChapterData.add(new Tuple2<>(103, 3));\n rawChapterData.add(new Tuple2<>(104, 3));\n rawChapterData.add(new Tuple2<>(105, 3));\n rawChapterData.add(new Tuple2<>(106, 3));\n rawChapterData.add(new Tuple2<>(107, 3));\n rawChapterData.add(new Tuple2<>(108, 3));\n rawChapterData.add(new Tuple2<>(109, 3));\n\n return rawChapterData;\n }", "public XYMultipleSeriesDataset getDataset() {\n\t\tEnvironmentTrackerOpenHelper openhelper = new EnvironmentTrackerOpenHelper(ResultsContent.context);\n\t\tSQLiteDatabase database = openhelper.getReadableDatabase();\n\t\tString[] columns = new String[2];\n\t\tcolumns[0] = \"MOOD\";\n\t\tcolumns[1] = \"HUE_CATEGORY\";\n\t\tCursor results = database.query(true, \"Observation\", columns, null, null, null, null, null, null);\n\t\t\n\t\t// Make sure the cursor is at the start.\n\t\tresults.moveToFirst();\n\t\t\n\t\tint[] meanMoodCategoryHue = new int[4];\n\t\tint[] nrMoodCategoryHue = new int[4];\n\t\t\n\t\t// Overloop de verschillende observaties.\n\t\twhile (!results.isAfterLast()) {\n\t\t\tint mood = results.getInt(0);\n\t\t\tint hue = results.getInt(1);\n\t\t\t\n\t\t\t// Tel de mood erbij en verhoog het aantal met 1 in de juiste categorie.\n\t\t\tmeanMoodCategoryHue[hue-1] = meanMoodCategoryHue[hue-1] + mood;\n\t\t\tnrMoodCategoryHue[hue-1]++;\n\t\t\tresults.moveToNext();\n\t\t}\n\t\t\n\t\t// Bereken voor elke hue categorie de gemiddelde mood.\n\t\tfor (int i=1;i<=4;i++) {\n\t\t\tif (nrMoodCategoryHue[i-1] == 0) {\n\t\t\t\tmeanMoodCategoryHue[i-1] = 0;\n\t\t\t} else {\n\t\t\t\tmeanMoodCategoryHue[i-1] = meanMoodCategoryHue[i-1]/nrMoodCategoryHue[i-1];\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Plaats de gegevens samen in een dataset voor de grafiek.\n\t\tXYMultipleSeriesDataset myData = new XYMultipleSeriesDataset();\n\t XYSeries dataSeries = new XYSeries(\"data\");\n\t dataSeries.add(1,meanMoodCategoryHue[0]);\n\t dataSeries.add(2,meanMoodCategoryHue[1]);\n\t dataSeries.add(3,meanMoodCategoryHue[2]);\n\t dataSeries.add(4,meanMoodCategoryHue[3]);\n\t myData.addSeries(dataSeries);\n\t return myData;\n\t}", "private ArrayList<String> setXAxisValues(){\n ArrayList<String> xVals = new ArrayList<String>();\n for (int z = 0; z < 235; z++) {\n xVals.add(Integer.toString(waveArray[z]));\n }\n return xVals;\n }", "public static double[] getQuartileData(double data[]) {\r\n\t\t\t\r\n\t\t\tint datLength = data.length;\r\n\t \tdouble[] quartileData = {1, 2, 3};\r\n\t \t\r\n\t \tdouble Q1 = 0, Q3 = 0, IQR = 0;\r\n\t \t\t\r\n\t \t\r\n\t if((datLength % 2) == 0 && !( ((datLength / 2) % 2) == 0)){//good\r\n\t \t\t \r\n\t \tQ1 = data[Math.round(datLength / 4)];\r\n\r\n\t \tQ3 = data[Math.round(datLength * (3/4))];\r\n\t \t \r\n\t \tIQR = Q3 - Q1;\r\n\t \t\r\n\t }\r\n\t else if((datLength % 2) == 0 && ((datLength / 2) % 2) == 0){//good\r\n\t \t\r\n\t \tQ1 = ((data[datLength / 4] + data[(datLength / 4) - 1]) / 2);\r\n\r\n\t \tQ3 = ((data[datLength * (3/4)] + data[(datLength * (3/4)) - 1]) / 2);\r\n\t \t \r\n\t \tIQR = Q3 - Q1;\r\n\t \r\n\t }\r\n\t else if(!((datLength % 2) == 0) && (((datLength - 1) / 2) % 2) == 0){//good\r\n\t \t \r\n\t \tQ1 = (data[(datLength - 1) / 4] + data[(datLength - 1) / 4] - 1) / 2;\r\n\t \r\n\t \tQ3 = (data[datLength * (3/4)] + data[datLength * (3/4) + 1]) / 2;\r\n\t \t \t \r\n\t \tIQR = Q3 - Q1;\r\n\t \t\r\n\t }\r\n\t else if(!((datLength % 2) == 0) && !((((datLength - 1) / 2) % 2) == 0)){//good\r\n\t \t \r\n\t \tQ1 = data[Math.round((datLength - 1) / 4)];\r\n\t \t \r\n\t \tQ3 = data[Math.round((datLength) * (3/4))];\r\n\t \t \t \r\n\t \tIQR = Q3 - Q1;\r\n\t \r\n\t }\r\n\t \r\n\t quartileData[0] = Q1;\r\n\t quartileData[1] = Q3;\r\n\t quartileData[2] = IQR;\r\n\t \t\r\n\t return quartileData;\r\n\t }", "private static CategoryDataset createSortedDataset(List<Number> values, List<String> rows, List<NumberOnlyBuildLabel> columns) {\n\t\tDefaultCategoryDataset dataset = new DefaultCategoryDataset();\n\n\t\tTreeSet<String> rowSet = new TreeSet<String>(rows);\n\t\tTreeSet<ChartUtil.NumberOnlyBuildLabel> colSet = new TreeSet<ChartUtil.NumberOnlyBuildLabel>(\n\t\t\t\tcolumns);\n\n\t\tComparable[] _rows = rowSet.toArray(new Comparable[rowSet.size()]);\n\t\tComparable[] _cols = colSet.toArray(new Comparable[colSet.size()]);\n\n\t\t// insert rows and columns in the right order, reverse rows\n\t\tfor (int i = _rows.length - 1; i >= 0; i--)\n\t\t\tdataset.setValue(null, _rows[i], _cols[0]);\n\t\tfor (Comparable c : _cols)\n\t\t\tdataset.setValue(null, _rows[0], c);\n\n\t\tfor (int i = 0; i < values.size(); i++)\n\t\t\tdataset.addValue(values.get(i), rows.get(i), columns.get(i));\n\t\treturn dataset;\n\t}", "static double[][] makeTestData() {\n double[][] data = new double[21][2];\n double xmax = 5;\n double xmin = -5;\n double dx = (xmax - xmin) / (data.length -1);\n for (int i = 0; i < data.length; i++) {\n double x = xmin + dx * i;\n double y = 2.5 * x * x * x - x * x / 3 + 3 * x;\n data[i][0] = x;\n data[i][1] = y;\n }\n return data;\n }", "private PieDataset createDataset() {\n\t\tDefaultPieDataset result = new DefaultPieDataset();\n\t\tresult.setValue(\"Linux\", 29);\n\t\tresult.setValue(\"Mac\", 20);\n\t\tresult.setValue(\"Windows\", 51);\n\t\treturn result;\n\n\t}", "private PieDataset createDataset() {\n JOptionPane.showMessageDialog(null, \"teste\"+dados.getEntrada());\r\n \r\n DefaultPieDataset result = new DefaultPieDataset();\r\n result.setValue(\"Entrada\", dados.getEntrada());\r\n result.setValue(\"Saida\", dados.getSaida());\r\n result.setValue(\"Saldo do Periodo\", dados.getSaldo());\r\n return result;\r\n\r\n }", "private LineDataSet createSet(){\n LineDataSet set = new LineDataSet(null, \"SPL Db\");\n set.setDrawCubic(true);\n set.setCubicIntensity(0.2f);\n set.setAxisDependency(YAxis.AxisDependency.LEFT);\n set.setColor(ColorTemplate.getHoloBlue());\n set.setLineWidth(2f);\n set.setCircleSize(4f);\n set.setFillAlpha(65);\n set.setFillColor(ColorTemplate.getHoloBlue());\n set.setHighLightColor(Color.rgb(244,117,177));\n set.setValueTextColor(Color.WHITE);\n set.setValueTextSize(10f);\n\n return set;\n }", "@DataProvider(name = \"test1\")\n\tpublic Object [][] createData1() {\n\t\treturn new Object [][] {\n\t\t\tnew Object [] { 0, 0 },\n\t\t\tnew Object [] { 9, 2 },\n\t\t\tnew Object [] { 15, 0 },\n\t\t\tnew Object [] { 32, 0 },\n\t\t\tnew Object [] { 529, 4 },\n\t\t\tnew Object [] { 1041, 5 },\n\t\t\tnew Object [] { 65536, 0 },\n\t\t\tnew Object [] { 65537, 15 },\n\t\t\tnew Object [] { 100000, 4 }, \n\t\t\tnew Object [] { 2147483, 5 },\n\t\t\tnew Object [] { 2147483637, 1 }, //max - 10\n\t\t\tnew Object [] { 2147483646, 0 }, //max - 1\n\t\t\tnew Object [] { 2147483647, 0 } //max\n\t\t};\n\t}", "private PieData generateDataPie(int cnt) {\n\n ArrayList<PieEntry> entries = new ArrayList<PieEntry>();\n\n for (int i = 0; i < 4; i++) {\n entries.add(new PieEntry((float) ((Math.random() * 70) + 30), \"Quarter \" + (i+1)));\n }\n\n PieDataSet d = new PieDataSet(entries, \"\");\n\n // space between slices\n d.setSliceSpace(2f);\n d.setColors(ColorTemplate.VORDIPLOM_COLORS);\n\n PieData cd = new PieData(d);\n return cd;\n }", "static void createDataForGraph() {\n double x = 2;\n String fileName = \"./lab1part2docs/dataRec.csv\";\n createFile(fileName);\n writeToFile(\"k,halfCounter,oneCounter,x=\" + x + \"\\n\", fileName);\n for (int k = 1; k <= 10000; k++) {\n Raise.runBoth(x, k);\n writeToFile(k + \",\" + Raise.recHalfCounter + \",\" + Raise.recOneCounter + '\\n', fileName);\n Raise.recHalfCounter = 0;\n Raise.recOneCounter = 0;\n }\n System.out.println(\"Finished\");\n }", "private XYMultipleSeriesDataset getdemodataset() {\n\t\t\tdataset1 = new XYMultipleSeriesDataset();// xy轴数据源\n\t\t\tseries = new XYSeries(\"温度 \");// 这个事是显示多条用的,显不显示在上面render设置\n\t\t\t// 这里相当于初始化,初始化中无需添加数据,因为如果这里添加第一个数据的话,\n\t\t\t// 很容易使第一个数据和定时器中更新的第二个数据的时间间隔不为两秒,所以下面语句屏蔽\n\t\t\t// 这里可以一次更新五个数据,这样的话相当于开始的时候就把五个数据全部加进去了,但是数据的时间是不准确或者间隔不为二的\n\t\t\t// for(int i=0;i<5;i++)\n\t\t\t// series.add(1, Math.random()*10);//横坐标date数据类型,纵坐标随即数等待更新\n\n\t\t\tdataset1.addSeries(series);\n\t\t\treturn dataset1;\n\t\t}", "public void setMeasurementArray(){\n\t\tnResults = rt.size();\n\t\tData = new double[4][nResults];\n\t\tfor(int i =1; i<nResults; i++) {\n\t\t\tData[0][i]=i;\n\t\t\tData[1][i]=rt.getValueAsDouble(rt.getColumnIndex(\"Mean\"),i); \n\t\t\tData[2][i]=rt.getValueAsDouble(rt.getColumnIndex(\"StdDev\"),i);\n\t\t\tData[3][i]=rt.getValueAsDouble(rt.getColumnIndex(\"Max\"),i)-rt.getValueAsDouble(rt.getColumnIndex(\"Min\"),i);\n\t\t}\n\t\treturn;\n\t}", "private Data[] getDoubles(double value, int npoints, int nattributes)\n\t{\n\t\tData[] data = new Data[npoints];\n\t\tfor (int i = 0; i < npoints; i++)\n\t\t\tdata[i] = nattributes == 1 ? new DataDouble(value)\n\t\t: new DataArrayOfDoubles(new double[] { value, value });\n\t\t\treturn data;\n\t}", "private XYChart.Series<Number, Number> getTenSeries() {\n //Create new series\n XYChart.Series<Number, Number> series = new XYChart.Series<>();\n series.setName(\"Chemical Concentration\");\n Random rand = new Random();\n int c = 5; // Constant for x-axis scale\n for (int i = 0; i < 17; i++) {\n int y = rand.nextInt() % 3 + 2;\n series.getData().add(new XYChart.Data<>(i*5, y));\n }\n series.getData().add(new XYChart.Data<>(17 * c, 4));\n series.getData().add(new XYChart.Data<>(18 * c, 5));\n series.getData().add(new XYChart.Data<>(19 * c-2,8));\n series.getData().add(new XYChart.Data<>(19 * c, 10));\n series.getData().add(new XYChart.Data<>(19 * c+2,8));\n series.getData().add(new XYChart.Data<>(20 * c, 6));\n series.getData().add(new XYChart.Data<>(21 * c, 4));\n\n for (int i = 22; i < 30; i++) {\n int y = rand.nextInt() % 3 + 2;\n series.getData().add(new XYChart.Data<>(i*5, y));\n }\n return series;\n }", "public void chart() {\r\n setLayout(new FlowLayout());\r\n String[] testNumbers = {\"LINEAR SEARCH\", \"TEST 1\", \"TEST 2\", \"TEST 3\", \"TEST 4\", \"TEST 5\", \"TEST 6\", \"TEST 7\", \"TEST 8\", \"TEST 9\", \"TEST 10\", \"AVERAGE\", \"STANDARD DEV.\"};\r\n Object[][] testResult = {{\"500\", lin[0][0], lin[0][1], lin[0][2], lin[0][3], lin[0][4], lin[0][5], lin[0][6], lin[0][7], lin[0][8], lin[0][0], linAvAndDev[0][0], linAvAndDev[0][1]},\r\n {\"10,000\", lin[1][0], lin[1][1], lin[1][2], lin[1][3], lin[1][4], lin[1][5], lin[1][6], lin[1][7], lin[1][8], lin[1][9], linAvAndDev[1][0], linAvAndDev[1][1]},\r\n {\"100,000\", lin[2][0], lin[2][1], lin[2][2], lin[2][3], lin[2][4], lin[2][5], lin[2][6], lin[2][7], lin[2][8], lin[2][9], linAvAndDev[2][0], linAvAndDev[2][1]},\r\n {\"1,000,000\", lin[3][0], lin[3][1], lin[3][2], lin[3][3], lin[3][4], lin[3][5], lin[3][6], lin[3][7], lin[3][8], lin[3][9], linAvAndDev[3][0], linAvAndDev[3][1]},\r\n {\"5,000,000\", lin[4][0], lin[4][1], lin[4][2], lin[4][3], lin[4][4], lin[4][5], lin[4][6], lin[4][7], lin[4][8], lin[4][9], linAvAndDev[4][0], linAvAndDev[4][1]},\r\n {\"7,000,000\", lin[5][0], lin[5][1], lin[5][2], lin[5][3], lin[5][4], lin[5][5], lin[5][6], lin[5][7], lin[5][8], lin[5][9], linAvAndDev[5][0], linAvAndDev[5][1]},\r\n {\"10,000,000\", lin[6][0], lin[6][1], lin[6][2], lin[6][3], lin[6][4], lin[6][5], lin[6][6], lin[6][7], lin[6][8], lin[6][9], linAvAndDev[6][0], linAvAndDev[6][1]},\r\n {\"BINARY SEARCH\", \"TEST 1\", \"TEST 2\", \"TEST 3\", \"TEST 4\", \"TEST 5\", \"TEST 6\", \"TEST 7\", \"TEST 8\", \"TEST 9\", \"TEST 10\", \"AVERAGE\", \"STANDARD DEV.\"},\r\n {\"500\", bin[0][0], bin[0][1], bin[0][2], bin[0][3], bin[0][4], bin[0][5], bin[0][6], bin[0][7], bin[0][8], bin[0][9], linAvAndDev[7][0], linAvAndDev[7][1]},\r\n {\"10,000\", bin[1][0], bin[1][1], bin[1][2], bin[1][3], bin[1][4], bin[1][5], bin[1][6], bin[1][7], bin[1][8], bin[1][9], linAvAndDev[8][0], linAvAndDev[8][1]},\r\n {\"100,000\", bin[2][0], bin[2][1], bin[2][2], bin[2][3], bin[2][4], bin[2][5], bin[2][6], bin[2][7], bin[2][8], bin[2][9], linAvAndDev[9][0], linAvAndDev[9][1]},\r\n {\"1,000,000\", bin[3][0], bin[3][1], bin[3][2], bin[3][3], bin[3][4], bin[3][5], bin[3][6], bin[3][7], bin[3][8], bin[3][9], linAvAndDev[10][0], linAvAndDev[10][1]},\r\n {\"5,000,000\", bin[4][0], bin[4][1], bin[4][2], bin[4][3], bin[4][4], bin[4][5], bin[4][6], bin[4][7], bin[4][8], bin[4][9], linAvAndDev[11][0], linAvAndDev[11][1]},\r\n {\"7,000,000\", bin[5][0], bin[5][1], bin[5][2], bin[5][3], bin[5][4], bin[5][5], bin[5][6], bin[5][7], bin[5][8], bin[5][9], linAvAndDev[12][0], linAvAndDev[12][1]},\r\n {\"10,000,000\", bin[6][0], bin[6][1], bin[6][2], bin[6][3], bin[6][4], bin[6][5], bin[6][6], bin[6][7], bin[6][8], bin[6][9], linAvAndDev[13][0], linAvAndDev[13][1]}};\r\n chart = new JTable(testResult, testNumbers);\r\n chart.setPreferredScrollableViewportSize(new Dimension(1500, 500)); // SETS SIZE OF CHART.\r\n chart.setFillsViewportHeight(true);\r\n JScrollPane scrollPane = new JScrollPane(chart);\r\n add(scrollPane);\r\n }", "private void prepareData(List<String[]> subset, Set<String> selections) {\n Bundle chartBundle = new Bundle();\n //Get the years and user selected data for the graph\n ArrayList<String> year = new ArrayList<>();\n ArrayList<ArrayList<Float>> data = new ArrayList<>();\n ArrayList<String> options = new ArrayList<>();\n float max=Float.MIN_VALUE;\n float min=Float.MAX_VALUE;\n boolean useLog = false;\n for (String option : selections) {\n //Loop over options\n ArrayList<Float> dataSeries = new ArrayList<>();\n int numOption = Integer.parseInt(option);\n //For every option get data required for the option\n options.add(OPTION_NAMES[numOption]);\n for (String[] line : subset) {\n dataSeries.add(Float.valueOf(line[numOption + CONSTANT]));\n }\n //Keep track of maximum of minimum values user has requested\n float tempMax = Collections.max(dataSeries);\n float tempMin = Collections.min(dataSeries);\n if (tempMax>max){\n max = tempMax;\n }\n if (tempMin<min && tempMin!=0){\n min=tempMin;\n }\n //Add user option to overall data they want to see\n data.add(dataSeries);\n }\n for (String[] line : subset) {\n //Loop preparing list of labels for X Axis\n year.add(line[2]);\n }\n if ((max/min)>50){\n //If the biggest and smallest values have a range bigger than factor of 50 then convert values to log scale\n useLog=true;\n for (int i=0;i<data.size();i++){\n //Loop which removes the data entries, converts them to log and then places them back to their original position in ArrayList\n ArrayList<Float> tempEntry = data.get(i);\n data.remove(i);\n ArrayList<Float> convertedValues = convertToLog(tempEntry);\n data.add(i,convertedValues);\n }\n }\n //Putting all the values in the Bundle in preparation for ChartActivity\n chartBundle.putSerializable(\"Data\", data);\n chartBundle.putString(\"country\", user_choice);\n chartBundle.putSerializable(\"Label\", options);\n chartBundle.putSerializable(\"year\", year);\n chartBundle.putBoolean(\"log\",useLog);\n Intent chart_intent = new Intent(this, ChartActivity.class);\n chart_intent.putExtra(\"Bundle\", chartBundle);\n startActivity(chart_intent);\n }", "public String[] prepareDataTableRow(RecordSet recordSet, String[] dataTableRow, int rowIndex) {\n\t\ttry {\n\t\t\tint index = 0;\n\t\t\tfor (final Record record : recordSet.getVisibleAndDisplayableRecordsForTable()) {\n\t\t\t\tdouble offset = record.getOffset(); // != 0 if curve has an defined offset\n\t\t\t\tdouble reduction = record.getReduction();\n\t\t\t\tdouble factor = record.getFactor(); // != 1 if a unit translation is required\n\t\t\t\t//0=VoltageRx, 1=Voltage, 2=Current, 3=Capacity, 4=Power, 5=Energy, 6=CellBalance, 7=CellVoltage1, 8=CellVoltage2, 9=CellVoltage3, \n\t\t\t\t//10=CellVoltage4, 11=CellVoltage5, 12=CellVoltage6, 13=Revolution, 14=Efficiency, 15=Height, 16=Climb, 17=ValueA1, 18=ValueA2, 19=ValueA3,\n\t\t\t\t//20=AirPressure, 21=InternTemperature, 22=ServoImpuls In, 23=ServoImpuls Out, \n\t\t\t\t//M-LINK 24=valAdd00 25=valAdd01 26=valAdd02 27=valAdd03 28=valAdd04 29=valAdd05 30=valAdd06 31=valAdd07 32=valAdd08 33=valAdd09 34=valAdd10 35=valAdd11 36=valAdd12 37=valAdd13 38=valAdd14;\n\t\t\t\tif (index == 15) { //15=Height\n\t\t\t\t\tPropertyType property = record.getProperty(MeasurementPropertyTypes.DO_SUBTRACT_FIRST.value());\n\t\t\t\t\tboolean subtractFirst = property != null ? Boolean.valueOf(property.getValue()).booleanValue() : false;\n\t\t\t\t\tproperty = record.getProperty(MeasurementPropertyTypes.DO_SUBTRACT_LAST.value());\n\t\t\t\t\tboolean subtractLast = property != null ? Boolean.valueOf(property.getValue()).booleanValue() : false;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (subtractFirst) {\n\t\t\t\t\t\t\treduction = record.getFirst() / 1000.0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (subtractLast) {\n\t\t\t\t\t\t\treduction = record.getLast() / 1000.0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Throwable e) {\n\t\t\t\t\t\tlog.log(Level.SEVERE, record.getParent().getName() + \" \" + record.getName() + \" \" + e.getMessage());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tdataTableRow[index + 1] = record.getDecimalFormat().format((offset + ((record.realGet(rowIndex) / 1000.0) - reduction) * factor));\n\t\t\t\t++index;\n\t\t\t}\n\t\t}\n\t\tcatch (RuntimeException e) {\n\t\t\tlog.log(Level.SEVERE, e.getMessage(), e);\n\t\t}\n\t\treturn dataTableRow;\n\t}", "private XYDataset createDataset(int a, List<ExtractedMZ> extracteddata, List<ExtractedMZ> extracteddata2) {\r\n final XYSeriesCollection dataset = new XYSeriesCollection();\r\n \r\n \r\n for (int i = 0; i<extracteddata.size(); i++) {\r\n \r\n final XYSeries series = new XYSeries(extracteddata.get(i).getName());\r\n float max = 0;\r\n \r\n for (int j = 0; j< extracteddata.get(i).retentionTimeList.get(a).size(); j++) {\r\n max = extracteddata.get(i).intensityList.get(a).get(j);\r\n while (j<extracteddata.get(i).retentionTimeList.get(a).size()-1 && Math.abs(extracteddata.get(i).retentionTimeList.get(a).get(j) - extracteddata.get(i).retentionTimeList.get(a).get(j+1)) < 0.01) {\r\n if (extracteddata.get(i).intensityList.get(a).get(j) > max) {\r\n max = extracteddata.get(i).intensityList.get(a).get(j+1);\r\n }\r\n j++;\r\n \r\n }\r\n \r\n series.add(extracteddata.get(i).retentionTimeList.get(a).get(j)/60,max);\r\n }\r\n dataset.addSeries(series);\r\n }\r\n \r\n for (int i = 0; i<extracteddata2.size(); i++) {\r\n \r\n final XYSeries series = new XYSeries(extracteddata2.get(i).getName());\r\n float max = 0;\r\n \r\n for (int j = 0; j< extracteddata2.get(i).retentionTimeList.get(a).size(); j++) {\r\n max = extracteddata2.get(i).intensityList.get(a).get(j);\r\n while (j<extracteddata2.get(i).retentionTimeList.get(a).size()-1 && Math.abs(extracteddata2.get(i).retentionTimeList.get(a).get(j) - extracteddata2.get(i).retentionTimeList.get(a).get(j+1)) < 0.01) {\r\n if (extracteddata2.get(i).intensityList.get(a).get(j) > max) {\r\n max = extracteddata2.get(i).intensityList.get(a).get(j+1);\r\n }\r\n j++;\r\n \r\n }\r\n \r\n series.add(extracteddata2.get(i).retentionTimeList.get(a).get(j)/60,max);\r\n }\r\n dataset.addSeries(series);\r\n }\r\n\r\n \r\n \r\n \r\n \r\n return dataset;\r\n \r\n }", "public SimpleDataPointImpl(DataSet dataSet){\n\t\tvalues = new HashMap<String, Double>();\n\t\tmDataSet = dataSet;\n\t}", "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 String generateChart() {\r\n\t\tint passedTestCount = data.getNumberofTestPassed();\r\n\t\tint skippedTestCount = data.getNumberofTestSkipped();\r\n\t\tint failedTestCount = data.getNumberofTestFailed();\r\n\r\n\t\tString script = \"<script>var svg = d3.select('svg'),\"\r\n\t\t\t\t+ \"margin = {top: 30, right: 20, bottom: 20, left: 50},\"\r\n\t\t\t\t+ \"width = +svg.attr('width') - margin.left - margin.right,\"\r\n\t\t\t\t+ \"height = +svg.attr('height') - margin.top - margin.bottom;\"\r\n\t\t\t\t+ \"var x = d3.scaleBand().range([0, 450]),\"\r\n\t\t\t\t+ \"y = d3.scaleLinear().rangeRound([230, 0]);\"\r\n\t\t\t\t+ \"var g = svg.append('g').attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');\"\r\n\t\t\t\t+\r\n\r\n\t\t\t\t\"var data = [{'name':'Pass','value':\"\r\n\t\t\t\t+ passedTestCount\r\n\t\t\t\t+ \"},{'name':'FaiL','value':\"\r\n\t\t\t\t+ failedTestCount\r\n\t\t\t\t+ \"},{'name':'Skip','value':\"\r\n\t\t\t\t+ skippedTestCount\r\n\t\t\t\t+ \"}];\"\r\n\t\t\t\t+\r\n\r\n\t\t\t\t\"var max = 0;\"\r\n\t\t\t\t+ \"var index = 0;\"\r\n\t\t\t\t+ \"for(index=0;index<data.length;index++) {\"\r\n\t\t\t\t+ \"if(max<data[index]['value']) {\"\r\n\t\t\t\t+ \"max = data[index]['value']; } }\"\r\n\t\t\t\t+ \"max = max%2 ==0? max : max +1;\"\r\n\t\t\t\t+ \"x.domain(data.map(function(d) { return d.name; }));\"\r\n\t\t\t\t+ \"y.domain([0, max]);\"\r\n\t\t\t\t+ \"g.append('g').attr('class', 'axis axis--x')\"\r\n\t\t\t\t+ \".attr('transform', 'translate(0,' + height + ')')\"\r\n\t\t\t\t+ \".call(d3.axisBottom(x)).attr('stroke', '#000000');\"\r\n\t\t\t\t+ \"g.append('g').attr('class', 'axis axis--y')\"\r\n\t\t\t\t+ \".call(d3.axisLeft(y).ticks(3)).attr('stroke', '#000000')\"\r\n\t\t\t\t+ \".append('text').attr('transform', 'rotate(-90)').attr('y', 6)\"\r\n\t\t\t\t+ \".attr('dy', '0.71em').attr('text-anchor', 'end');\"\r\n\t\t\t\t+ \"d3.selectAll('line').attr('stroke', '#000000');\"\r\n\t\t\t\t+ \"d3.selectAll('path').attr('stroke', '#000000');\"\r\n\t\t\t\t+ \"var temp=0;\"\r\n\t\t\t\t+ \"g.selectAll('.bar').data(data).enter().append('rect').attr('class', 'bar')\"\r\n\t\t\t\t+ \".attr('x', function(d) {return x(d.name)+50; })\"\r\n\t\t\t\t+ \".attr('y', function(d) { return y(d.value); })\"\r\n\t\t\t\t+ \".attr('width', 50)\"\r\n\t\t\t\t+ \".attr('height', function(d) { return height - y(d.value); }).attr('fill','#ff9900')\"\r\n\t\t\t\t+ \".attr('data-name',function(d){return d.name})\"\r\n\t\t\t\t+ \".attr('data-value',function(d){return d.value}).attr('height', 0).transition().duration(1000).delay(200).attr('height', function (d, i) {return height - y(d.value);});;</script>\";\r\n\t\treturn script;\r\n\t}", "public void getSeriesForPoints(){\n\n int lenght = cluster_polygon_coordinates.length;\n\n x_latitude = new Number[lenght];\n y_longitude = new Number[lenght];\n\n //x_latitude[lenght-1] = cluster_polygon_coordinates[0].x;\n //y_longitude[lenght-1] = cluster_polygon_coordinates[0].y;\n for (int i=0;i<lenght;i++) {\n\n x_latitude[i] = cluster_polygon_coordinates[i].x;\n y_longitude[i] = cluster_polygon_coordinates[i].y;\n// Log.d(TAG, Double.toString(cluster_polygon_coordinates[i].x));\n// Log.d(TAG, Double.toString(cluster_polygon_coordinates[i].y));\n// Log.d(TAG, Double.toString(cluster_polygon_coordinates[i].z));\n }\n\n }", "@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\r\n\tpublic Data(String table) throws EmptyDatasetException, SQLException, EmptySetException, NoValueException{\r\n\t\tTableData tableData = new TableData(new DbAccess());\r\n\t\tdata = tableData.getDistinctTransazioni(table);\r\n\t\t\r\n\t\tTableSchema tableSchema = new TableSchema(new DbAccess(),table);\r\n\t\tnumberOfExamples=data.size();\r\n\t\t\r\n\t\tQUERY_TYPE min,max;\r\n\t\tmin = QUERY_TYPE.MIN;\r\n\t\tmax = QUERY_TYPE.MAX;\r\n\t\t\r\n\t\tfor (int i=0;i<tableSchema.getNumberOfAttributes();i++) {\r\n\t\t\tif(!tableSchema.getColumn(i).isNumber()) {\r\n\t\t\t\texplanatorySet.add((T) new DiscreteAttribute(tableSchema.getColumn(i).getColumnName(),i,(TreeSet)tableData.getDistinctColumnValues(table, tableSchema.getColumn(i))));\r\n\t\t\t}else {\r\n\t\t\t\texplanatorySet.add((T) new ContinuousAttribute(tableSchema.getColumn(i).getColumnName(),i,(float)tableData.getAggregateColumnValue(table,tableSchema.getColumn(i),min),(float)tableData.getAggregateColumnValue(table,tableSchema.getColumn(i),max)));\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t}\r\n\t}", "public static void main( String [] args)\r\n\t{\r\n\t\tDataSet d1 = new DataSet( 1, 2, 4, 5);\r\n\t\td1.addValue(3);\r\n\t\td1.addValue(6);\r\n\t\td1.addValue(7);\r\n\t\td1.addValue(100);\r\n\t\tSystem.out.println(d1.getSum());\r\n\t\tSystem.out.println(d1.getAverage());\r\n\t}", "private void getDemoData(Vector data)\r\n {\r\n\r\n debug(\"getDemoData() - preparing to get Canned Data\");\r\n\r\n data.addElement(\r\n new StockData(\"ORCL\", \"Oracle Corp.\", 22.456, 23.285, 23.6875, 25.375, -1.6875, -6.42, 24976600, 0.0, 0.0));\r\n data.addElement(new StockData(\"EGGS\", \"Egghead.com\", 17.20, 17.43, 17.25, 17.4375, -0.1875, -1.43, 2146400, 0.0, 0.0));\r\n data.addElement(new StockData(\"T\", \"AT&T\", 65.078, 66, 65.1875, 66, -0.8125, -0.10, 554000, 0.0, 0.0));\r\n data.addElement(\r\n new StockData(\"LU\", \"Lucent Technology\", 64.625, 59.9375, 64.625, 59.9375, 4.6875, 9.65, 29856300, 0.0, 0.0));\r\n data.addElement(\r\n new StockData(\"FON\", \"Sprint\", 104.5625, 106.375, 104.5625, 106.375, -1.8125, -1.82, 1135100, 0.0, 0.0));\r\n data.addElement(new StockData(\"ENML\", \"Enamelon Inc.\", 4.875, 5, 4.875, 5, -0.125, 0, 35900, 0.0, 0.0));\r\n data.addElement(\r\n new StockData(\"CPQ\", \"Compaq Computers\", 30.875, 31.25, 30.875, 31.25, -0.375, -2.18, 11853900, 0.0, 0.0));\r\n data.addElement(\r\n new StockData(\"MSFT\", \"Microsoft Corp.\", 94.0625, 95.1875, 94.0625, 95.1875, -1.125, -0.92, 19836900, 0.0, 0.0));\r\n data.addElement(\r\n new StockData(\"DELL\", \"Dell Computers\", 46.1875, 44.5, 46.1875, 44.5, 1.6875, 6.24, 47310000, 0.0, 0.0));\r\n data.addElement(\r\n new StockData(\"SUNW\", \"Sun Microsystems\", 140.625, 130.9375, 140.625, 130.9375, 10, 10.625, 17734600, 0.0, 0.0));\r\n data.addElement(\r\n new StockData(\"IBM\", \"Intl. Bus. Machines\", 183, 183.125, 183, 183.125, -0.125, -0.51, 4371400, 0.0, 0.0));\r\n data.addElement(new StockData(\"HWP\", \"Hewlett-Packard\", 70, 71.0625, 70, 71.0625, -1.4375, -2.01, 2410700, 0.0, 0.0));\r\n data.addElement(new StockData(\"UIS\", \"Unisys Corp.\", 28.25, 29, 28.25, 29, -0.75, -2.59, 2576200, 0.0, 0.0));\r\n data.addElement(new StockData(\"SNE\", \"Sony Corp.\", 28.25, 29, 28.25, 29, -0.75, -2.59, 2576200, 0.0, 0.0));\r\n data.addElement(\r\n new StockData(\"NOVL\", \"Novell Inc.\", 24.0625, 24.375, 24.0625, 24.375, -0.3125, -3.02, 6047900, 0.0, 0.0));\r\n data.addElement(new StockData(\"HIT\", \"Hitachi, Ltd.\", 78.5, 77.625, 78.5, 77.625, 0.875, 1.12, 49400, 0.0, 0.0));\r\n\r\n debug(\"getDemoData() - complete\");\r\n }", "private CategoryDataset createDataset() {\n\t \n\t \tvar dataset = new DefaultCategoryDataset();\n\t \n\t\t\tSystem.out.println(bic);\n\t\t\t\n\t\t\tfor(Map.Entry<String, Integer> entry : bic.entrySet()) {\n\t\t\t String key = entry.getKey();\n\t\t\t Integer value = entry.getValue();\n\t\t\t dataset.setValue(value, \"# Bicicletas\", key);\n\t \n\t\t\t}\n\t return dataset;\n\t \n\t }", "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}", "private Object createDataset(final ChartConfiguration config) {\n final CategoryChart chart = (CategoryChart) config.chart;\n for (final Fields key: config.fields) {\n chart.addSeries(key.getLocalizedName(), new double[1], new double[1]);\n }\n populateDataset(config);\n return null;\n }", "private void makeChart() {\n\n Log.d(\"Chart\",\"Start Chart\");\n\n ArrayList<Entry> speedList = new ArrayList<>();\n ArrayList<Entry> avgSpeedList = new ArrayList<>();\n ArrayList<Entry> avgAltList = new ArrayList<>();\n\n int numberOfValues = trackingList.size();\n\n //Fills the data in the Arrays Entry (xValue,yValue)\n for(int i = 0; i < numberOfValues;i++){\n float avgSpeed = (float)averageSpeed;\n float avgAlt = (float)averageAlt;\n float curSpeed = (float)trackingList.get(i).getSpeed();\n\n Log.d(\"Chart\",\"CurSpeed: \" +curSpeed);\n\n avgSpeedList.add(new Entry(i*3,avgSpeed));\n speedList.add(new Entry(i*3,curSpeed));\n avgAltList.add(new Entry(i*3,avgAlt));\n }\n\n ArrayList<String> xAXES = new ArrayList<>();\n\n\n String[] xaxes = new String[xAXES.size()];\n for(int i=0; i<xAXES.size();i++){\n xaxes[i] = xAXES.get(i);\n }\n\n // More than one Array (Line in the Graph)\n ArrayList<ILineDataSet> lineDataSets = new ArrayList<>();\n\n //Speed Graph setup\n LineDataSet lineDataSet1 = new LineDataSet(speedList,\"Speed\");\n lineDataSet1.setDrawCircles(false);\n lineDataSet1.setColor(Color.BLUE);\n lineDataSet1.setLineWidth(2);\n\n //AvgSpeed setup\n LineDataSet lineDataSet2 = new LineDataSet(avgSpeedList,\"AvgSpeedLine\");\n lineDataSet2.setDrawCircles(false);\n lineDataSet2.setColor(Color.RED);\n lineDataSet2.setLineWidth(3);\n\n //AvgAlt setup\n LineDataSet lineDataSet3 = new LineDataSet(avgAltList,\"AvgAltLine\");\n lineDataSet3.setDrawCircles(false);\n lineDataSet3.setColor(Color.MAGENTA);\n lineDataSet3.setLineWidth(3);\n\n //Add them to the List\n lineDataSets.add(lineDataSet1);\n lineDataSets.add(lineDataSet2);\n lineDataSets.add(lineDataSet3);\n\n //setup for the xAxis\n XAxis xAxis = lineChart.getXAxis();\n xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);\n\n //Puts the data in the Graph\n lineChart.setData(new LineData(lineDataSets));\n lineChart.setVisibleXRangeMaximum(65f);\n\n //Chart description\n lineChart.getDescription().setText(\"All Speed\");\n\n //Shows timer information when clicked\n lineChart.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n Toast.makeText(getApplicationContext(), \"Its measured every 3 seconds\",Toast.LENGTH_LONG).show();\n }\n });\n }", "public VirtualDataSet[] partitionByNumericAttribute(int attributeIndex, int valueIndex) {\n\t\t// WRITE YOUR CODE HERE!\n\n\t\t if(attributes[attributeIndex].getType()==AttributeType.NOMINAL){ \t\t\t\t\t\t\t// avoid passing through nominal value to current method\n return null; \n }\n\t\t\tVirtualDataSet [] partitions = new VirtualDataSet[2]; \t\t\t\t\t\t\t\t\t// creates two split path \n\n\t\t\tdouble split = Double.parseDouble(getValueAt(valueIndex , attributeIndex));\t\t\t// determine the middle number in order to split \n\t\t\t\n\t\t\tLinkedList<Integer> rowsLess = new LinkedList<Integer> (); \t\t\t\t\t\t\t// using linkedlist to do collection of split rows that less than valueIndex value\n\t\t\t\n\t\t\tLinkedList<Integer> rowsMore = new LinkedList<Integer> ();\t\t\t\t\t\t\t\t// using linkedlist to do collection of split rows that less than valueIndex value\n\t\t\t\n\t\t\tint countLess = 0;\n\t\t\tint countMore = 0; \n\n\t\t\tString []arrayOfNums = attributes[attributeIndex].getValues();\n\n\t\t\tfor(int j = 0; j < source.numRows; j++){ \n\t\t\t\t\n\t\t\t\tif(Double.parseDouble(getValueAt(j,attributeIndex)) <= split){ \t\t\t\t// transform from string to integer in order to compare the number smaller than middle number\n\t\t\t\t\t\n\t\t\t\t\trowsLess.add(j);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// add rows that correspond with the current attribute of spliting \n\t\t\t\t\tcountLess++;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// determine the size of partition rows array \n\t\t\t\t}else if(Double.parseDouble(getValueAt(j,attributeIndex)) > split){\t\t\t// transform from string to integer in order to compare the number bigger than middle number\n\t\t\t\t\t\n\t\t\t\t\trowsMore.add(j); \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// add rows that correspond with the current attribute of spliting \n\t\t\t\t\tcountMore++;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// determine the size of partition rows array \n\t\t\t\t}\n\t\t\t}\n\n\t\t\tint [] partitionRowsLess = new int [countLess]; \t\t\t\t\t\t\t\t\t\t// the collection of rows represents all number that smaller than middle number\n\t\t\tint [] partitionRowsMore = new int [countMore]; \t\t\t\t\t\t\t\t\t\t// the collection of rows represents all number that bigger than middle number\n\t\t\tfor(int k = 0; k < countLess; k++){\n\t\t\t\tpartitionRowsLess[k] = rowsLess.poll(); \t\t\t\t\t\t\t\t\t\t\t// transform from linkedlist to array \n\t\t\t}\n\t\t\tfor(int k = 0; k < countMore; k++){\n\t\t\t\tpartitionRowsMore[k] = rowsMore.poll(); \t\t\t\t\t\t\t\t\t\t\t// transform from linkedlist to array \n\t\t\t}\n\t\t\t\n\t\t\tpartitions[0] = new VirtualDataSet(source,partitionRowsLess, attributes); \t\t\t\t// send partition to VirtualDataSet constructor \n\t\t\tpartitions[1] = new VirtualDataSet(source,partitionRowsMore, attributes); \n\t\t\t\n\n\n\t\t\treturn partitions;\n\t\t\n\t}", "public String[][] toSummaryArray(String[][] rawData){\n String[][] toReturn = new String[5][3];\n for(int i=0; i<5; i++){\n int min=100000;\n int max=0;\n int avg=0;\n for(int j=0; j<rawData[i].length; j++){\n min = Math.min(min, Integer.parseInt(rawData[i][j]));\n max = Math.max(max, Integer.parseInt(rawData[i][j]));\n avg = avg + Integer.parseInt(rawData[i][j]);\n }\n avg = avg/rawData[i].length;\n toReturn[i][0] = String.valueOf(min);\n toReturn[i][1] = String.valueOf(max);\n toReturn[i][2] = String.valueOf(avg);\n }\n return toReturn; \n }", "@Test\n public void test64() throws Throwable {\n CategoryPlot categoryPlot0 = new CategoryPlot();\n CategoryDataset categoryDataset0 = categoryPlot0.getDataset(557);\n }", "public List<Pair<INDArray, INDArray>> generateTestDataSet (List<Point> stockDataList) {\n \tint window = exampleLength + predictLength;\n \tList<Pair<INDArray, INDArray>> test = new ArrayList<Pair<INDArray, INDArray>>();\n \tfor (int i = 0; i < stockDataList.size() - window; i++) {\n \t\tINDArray input = Nd4j.create(new int[] {exampleLength, VECTOR_SIZE}, 'f'); // f pour la construction rapide (fast)\n \t\tfor (int j = i; j < i + exampleLength; j++) {\n \t\t\tPoint stock = stockDataList.get(j);\n \t\t\tinput.putScalar(new int[] {j - i, 0}, (stock.getOpen() - minArray[0]) / (maxArray[0] - minArray[0]));\n \t\t\tinput.putScalar(new int[] {j - i, 1}, (stock.getClose() - minArray[1]) / (maxArray[1] - minArray[1]));\n \t\t\tinput.putScalar(new int[] {j - i, 2}, (stock.getLow() - minArray[2]) / (maxArray[2] - minArray[2]));\n \t\t\tinput.putScalar(new int[] {j - i, 3}, (stock.getHigh() - minArray[3]) / (maxArray[3] - minArray[3]));\n \t\t\tinput.putScalar(new int[] {j - i, 4}, (stock.getVolume() - minArray[4]) / (maxArray[4] - minArray[4]));\n \t\t}\n Point stock = stockDataList.get(i + exampleLength);\n INDArray label;\n if (category.equals(PriceCategory.ALL)) {\n label = Nd4j.create(new int[]{VECTOR_SIZE}, 'f'); // f pour la construction rapide (fast)\n label.putScalar(new int[] {0}, stock.getOpen());\n label.putScalar(new int[] {1}, stock.getClose());\n label.putScalar(new int[] {2}, stock.getLow());\n label.putScalar(new int[] {3}, stock.getHigh());\n label.putScalar(new int[] {4}, stock.getVolume());\n } else {\n label = Nd4j.create(new int[] {1}, 'f');\n switch (category) {\n case OPEN: label.putScalar(new int[] {0}, stock.getOpen()); break;\n case CLOSE: label.putScalar(new int[] {0}, stock.getClose()); break;\n case LOW: label.putScalar(new int[] {0}, stock.getLow()); break;\n case HIGH: label.putScalar(new int[] {0}, stock.getHigh()); break;\n case VOLUME: label.putScalar(new int[] {0}, stock.getVolume()); break;\n default: throw new NoSuchElementException();\n }\n }\n \t\ttest.add(new Pair<INDArray, INDArray>(input, label));\n \t}\n \treturn test;\n }", "public void addData(double[][] data) {\n for (int i = 0; i < data.length; i++) {\n addData(data[i][0], data[i][1]);\n }\n }", "public IntegerValues[] implementation(ElementsSeries[] row1,\r\n\t\t\tElementsSeries[] row2, AnimalSeries[] row3) {\n\t\tintegers=new IntegerValues[10];\r\n\t\t\r\n\t\t/*initialize the variables*/\r\n\t\tthis.initializeIntegers();\r\n\t\t\r\n\t\t/*\r\n\t\t * Implementation of the row1 portion of the function2\r\n\t\t * */\r\n\t\t\r\n\t\t/*The first line*/\r\n\t\tboolean E007P=false; //Name after the first Variable\r\n\t\tboolean E005P=false; //Name after the second variable\t\r\n\t\tfor(int i=0;i<4;i++){\r\n\t\t\tif(\"E007\".equalsIgnoreCase(row1[i].getCode())){ // The first variable\r\n\t\t\t\tE007P=true;\r\n\t\t\t}\r\n\t\t\tif(\"E005\".equalsIgnoreCase(row1[i].getCode())){ //The second variable\r\n\t\t\t\tE005P=true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(E007P==true && E005P==true){\r\n\t\t\tint n = this.getIntegerValue(\"I015\"); //The index of the variable.\r\n\t\t\tint val = integers[n].getValue();\r\n\t\t\tintegers[n].setValue(++val);\r\n\t\t}\r\n\t\t\r\n\t\t/*The second line*/\r\n\t\tboolean E002P=false; //Name after the first Variable\r\n\t\tboolean E009P=false; //Name after the second variable\t\r\n\t\tfor(int i=0;i<4;i++){\r\n\t\t\tif(\"E002\".equalsIgnoreCase(row1[i].getCode())){ // The first variable\r\n\t\t\t\tE002P=true;\r\n\t\t\t}\r\n\t\t\tif(\"E009\".equalsIgnoreCase(row1[i].getCode())){ //The second variable\r\n\t\t\t\tE009P=true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(E002P==true && E009P==true){\r\n\t\t\tint n = this.getIntegerValue(\"I009\"); //The index of the variable.\r\n\t\t\tint val = integers[n].getValue();\r\n\t\t\tintegers[n].setValue(++val);\r\n\t\t}\r\n\t\t\r\n\t\t/*The third line*/\r\n\t\tboolean E006P=false; //Name after the first Variable\r\n\t\tboolean E004P=false; //Name after the second variable\t\r\n\t\tfor(int i=0;i<4;i++){\r\n\t\t\tif(\"E006\".equalsIgnoreCase(row1[i].getCode())){ // The first variable\r\n\t\t\t\tE006P=true;\r\n\t\t\t}\r\n\t\t\tif(\"E004\".equalsIgnoreCase(row1[i].getCode())){ //The second variable\r\n\t\t\t\tE004P=true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(E006P==true && E004P==true){\r\n\t\t\tint n = this.getIntegerValue(\"I008\"); //The index of the variable.\r\n\t\t\tint val = integers[n].getValue();\r\n\t\t\tintegers[n].setValue(++val);\r\n\t\t}\r\n\t\t\r\n\t\t/*The fourth line.*/\r\n\t\tboolean E001P=false; //Name after the first Variable\r\n\t\tboolean E008P=false; //Name after the second variable\t\r\n\t\tfor(int i=0;i<4;i++){\r\n\t\t\tif(\"E001\".equalsIgnoreCase(row1[i].getCode())){ // The first variable\r\n\t\t\t\tE001P=true;\r\n\t\t\t}\r\n\t\t\tif(\"E008\".equalsIgnoreCase(row1[i].getCode())){ //The second variable\r\n\t\t\t\tE008P=true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(E001P==true && E008P==true){\r\n\t\t\tint n = this.getIntegerValue(\"I012\"); //The index of the variable.\r\n\t\t\tint val = integers[n].getValue();\r\n\t\t\tintegers[n].setValue(++val);\r\n\t\t}\r\n\t\t\r\n\t\t/*The fifth line*/\r\n\t\tboolean E010P=false; //Name after the first Variable\r\n\t\tboolean E003P=false; //Name after the second variable\t\r\n\t\tfor(int i=0;i<4;i++){\r\n\t\t\tif(\"E010\".equalsIgnoreCase(row1[i].getCode())){ // The first variable\r\n\t\t\t\tE010P=true;\r\n\t\t\t}\r\n\t\t\tif(\"E003\".equalsIgnoreCase(row1[i].getCode())){ //The second variable\r\n\t\t\t\tE003P=true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(E010P==true && E003P==true){\r\n\t\t\tint n = this.getIntegerValue(\"I006\"); //The index of the variable.\r\n\t\t\tint val = integers[n].getValue();\r\n\t\t\tintegers[n].setValue(++val);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t/*\r\n\t\t * The row3 protion\r\n\t\t * */\r\n\t\t/*\r\n\t\t * The portion - A\r\n\t\t * */\r\n\t\t/*The first line*/\t\t\r\n\t\tboolean A009P=false; //The first Variable\r\n\t\tboolean A001P=false; //The second Variable\r\n\t\tboolean A005P=false; //The third variable\r\n\t\tfor(int i=0;i<4;i++){\r\n\t\t\tif(\"A009\".equalsIgnoreCase(row3[i].getCode())){\r\n\t\t\t\tA009P=true;\r\n\t\t\t}\r\n\t\t\telse if(\"A001\".equalsIgnoreCase(row3[i].getCode())){\r\n\t\t\t\tA001P=true;\r\n\t\t\t}\r\n\t\t\telse if(\"A005\".equalsIgnoreCase(row3[i].getCode())){\r\n\t\t\t\tA005P=true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(A009P==true&&A001P==true&&A005P==true){\r\n\t\t\tint n=this.getIntegerValue(\"I008\");\r\n\t\t\tint val=integers[n].getValue();\r\n\t\t\tintegers[n].setValue(++val);\r\n\t\t}\r\n\t\t\r\n\t\t/*The second line*/\r\n\t\tboolean A012P=false; //The first Variable\r\n\t\tboolean A004P=false; //The second Variable\r\n\t\tboolean A008P=false; //The third variable\r\n\t\tfor(int i=0;i<4;i++){\r\n\t\t\tif(\"A012\".equalsIgnoreCase(row3[i].getCode())){\r\n\t\t\t\tA012P=true;\r\n\t\t\t}\r\n\t\t\telse if(\"A004\".equalsIgnoreCase(row3[i].getCode())){\r\n\t\t\t\tA004P=true;\r\n\t\t\t}\r\n\t\t\telse if(\"A008\".equalsIgnoreCase(row3[i].getCode())){\r\n\t\t\t\tA008P=true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(A012P==true && A004P==true && A008P==true){\r\n\t\t\tint n= this.getIntegerValue(\"I012\");\r\n\t\t\tint val=integers[n].getValue();\r\n\t\t\tintegers[n].setValue(++val);\r\n\t\t}\r\n\t\t\r\n\t\t/*The third line*/\r\n\t\tboolean A006P=false; //The first Variable\r\n\t\tboolean A010P=false; //The second Variable\r\n\t\tA001P=false; //The third variable\r\n\t\tfor(int i=0;i<4;i++){\r\n\t\t\tif(\"A006\".equalsIgnoreCase(row3[i].getCode())){\r\n\t\t\t\tA006P=true;\r\n\t\t\t}\r\n\t\t\telse if(\"A010\".equalsIgnoreCase(row3[i].getCode())){\r\n\t\t\t\tA010P=true;\r\n\t\t\t}\r\n\t\t\telse if(\"A001\".equalsIgnoreCase(row3[i].getCode())){\r\n\t\t\t\tA001P=true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(A006P==true && A010P==true && A001P==true){\r\n\t\t\tint n= this.getIntegerValue(\"I014\");\r\n\t\t\tint val=integers[n].getValue();\r\n\t\t\tintegers[n].setValue(++val);\r\n\t\t}\r\n\t\t\r\n\t\t/*The fourth line*/\r\n\t\tboolean A003P=false; //The first Variable\r\n\t\tboolean A007P=false; //The second Variable\r\n\t\tboolean A011P=false; //The third variable\r\n\t\t\r\n\t\tfor(int i=0;i<4;i++){\r\n\t\t\tif(\"A003\".equalsIgnoreCase(row3[i].getCode())){\r\n\t\t\t\tA003P=true;\r\n\t\t\t}\r\n\t\t\tif(\"A007\".equalsIgnoreCase(row3[i].getCode())){\r\n\t\t\t\tA007P=true;\r\n\t\t\t}\r\n\t\t\tif(\"A011\".equalsIgnoreCase(row3[i].getCode())){\r\n\t\t\t\tA011P=true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(A003P==true && A007P==true && A011P==true){\r\n\t\t\tint n= this.getIntegerValue(\"I006\");\r\n\t\t\tint val=integers[n].getValue();\r\n\t\t\tintegers[n].setValue(++val);\r\n\t\t}\r\n\t\t\r\n\t\t/*\r\n\t\t * The protion B\r\n\t\t */\r\n\t\t/*The first line*/\r\n\t\tA001P=false;\r\n\t\tboolean A002P=false;\r\n\t\tfor(int i=0;i<4;i++){\r\n\t\t\tif(\"A001\".equalsIgnoreCase(row3[i].getCode())){\r\n\t\t\t\tA001P=true;\r\n\t\t\t}\r\n\t\t\tif(\"A002\".equalsIgnoreCase(row3[i].getCode())){\r\n\t\t\t\tA002P=true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(A001P==true && A002P==true){\r\n\t\t\tint n= this.getIntegerValue(\"I015\");\r\n\t\t\tint val = integers[n].getValue();\r\n\t\t\tintegers[n].setValue(++val);\r\n\t\t}\r\n\t\t\r\n\t\t/*The second line*/\r\n\t\tA003P=false;\r\n\t\tA012P=false;\r\n\t\tfor(int i=0;i<4;i++){\r\n\t\t\tif(\"A003\".equalsIgnoreCase(row3[i].getCode())){\r\n\t\t\t\tA003P=true;\r\n\t\t\t}\r\n\t\t\tif(\"A012\".equalsIgnoreCase(row3[i].getCode())){\r\n\t\t\t\tA012P=true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(A003P==true && A012P==true){\r\n\t\t\tint n= this.getIntegerValue(\"I007\");\r\n\t\t\tint val = integers[n].getValue();\r\n\t\t\tintegers[n].setValue(++val);\r\n\t\t}\r\n\t\t\r\n\t\t/*The third line*/\r\n\t\tA004P=false;\r\n\t\tA011P=false;\r\n\t\tfor(int i=0;i<4;i++){\r\n\t\t\tif(\"A004\".equalsIgnoreCase(row3[i].getCode())){\r\n\t\t\t\tA004P=true;\r\n\t\t\t}\r\n\t\t\tif(\"A011\".equalsIgnoreCase(row3[i].getCode())){\r\n\t\t\t\tA011P=true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(A004P==true && A011P==true){\r\n\t\t\tint n= this.getIntegerValue(\"I011\");\r\n\t\t\tint val = integers[n].getValue();\r\n\t\t\tintegers[n].setValue(++val);\r\n\t\t}\r\n\t\t\r\n\t\t/*The fourth line*/\r\n\t\tA005P=false;\r\n\t\tA010P=false;\r\n\t\tfor(int i=0;i<4;i++){\r\n\t\t\tif(\"A005\".equalsIgnoreCase(row3[i].getCode())){\r\n\t\t\t\tA005P=true;\r\n\t\t\t}\r\n\t\t\tif(\"A010\".equalsIgnoreCase(row3[i].getCode())){\r\n\t\t\t\tA010P=true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(A005P==true && A010P==true){\r\n\t\t\tint n= this.getIntegerValue(\"I014\");\r\n\t\t\tint val = integers[n].getValue();\r\n\t\t\tintegers[n].setValue(++val);\r\n\t\t}\r\n\t\t\r\n\t\t/*The fifth line*/\r\n\t\tA006P=false;\r\n\t\tA009P=false;\r\n\t\tfor(int i=0;i<4;i++){\r\n\t\t\tif(\"A006\".equalsIgnoreCase(row3[i].getCode())){\r\n\t\t\t\tA006P=true;\r\n\t\t\t}\r\n\t\t\tif(\"A009\".equalsIgnoreCase(row3[i].getCode())){\r\n\t\t\t\tA009P=true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(A006P==true && A009P==true){\r\n\t\t\tint n= this.getIntegerValue(\"I008\");\r\n\t\t\tint val = integers[n].getValue();\r\n\t\t\tintegers[n].setValue(++val);\r\n\t\t}\r\n\t\t\r\n\t\t/*The sixth line*/\r\n\t\tA007P=false;\r\n\t\tA008P=false;\r\n\t\tfor(int i=0;i<4;i++){\r\n\t\t\tif(\"A007\".equalsIgnoreCase(row3[i].getCode())){\r\n\t\t\t\tA007P=true;\r\n\t\t\t}\r\n\t\t\tif(\"A008\".equalsIgnoreCase(row3[i].getCode())){\r\n\t\t\t\tA008P=true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(A007P==true && A008P==true){\r\n\t\t\tint n= this.getIntegerValue(\"I006\");\r\n\t\t\tint val = integers[n].getValue();\r\n\t\t\tintegers[n].setValue(++val);\r\n\t\t}\r\n\t\t\r\n\t\t/*\r\n\t\t * The Row3 and Row1 operation\r\n\t\t */\r\n\t\t/*The first line*/\r\n\t\tA003P=false;\r\n\t\tE006P=false;\r\n\t\tfor(int i=0;i<4;i++){\r\n\t\t\tif(\"A003\".equalsIgnoreCase(row3[i].getCode())){\r\n\t\t\t\tA003P=true;\r\n\t\t\t}\r\n\t\t\tif(\"E006\".equalsIgnoreCase(row1[i].getCode())){\r\n\t\t\t\tE006P=true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(A003P==true && E006P==true){\r\n\t\t\tint n= this.getIntegerValue(\"I006\");\r\n\t\t\tint val=integers[n].getValue();\r\n\t\t\tintegers[n].setValue(++val);\r\n\t\t}\r\n\t\t\r\n\t\t/*The Second line*/\r\n\t\tA005P=false;\r\n\t\tE003P=false;\r\n\t\tfor(int i=0;i<4;i++){\r\n\t\t\tif(\"A005\".equalsIgnoreCase(row3[i].getCode())){\r\n\t\t\t\tA005P=true;\r\n\t\t\t}\r\n\t\t\tif(\"E003\".equalsIgnoreCase(row1[i].getCode())){\r\n\t\t\t\tE003P=true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(A005P==true && E003P==true){\r\n\t\t\tint n= this.getIntegerValue(\"I013\");\r\n\t\t\tint val=integers[n].getValue();\r\n\t\t\tintegers[n].setValue(++val);\r\n\t\t}\r\n\t\t\r\n\t\t/*The third line*/\r\n\t\tA006P=false;\r\n\t\tE010P=false;\r\n\t\tfor(int i=0;i<4;i++){\r\n\t\t\tif(\"A006\".equalsIgnoreCase(row3[i].getCode())){\r\n\t\t\t\tA006P=true;\r\n\t\t\t}\r\n\t\t\tif(\"E010\".equalsIgnoreCase(row1[i].getCode())){\r\n\t\t\t\tE010P=true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(A006P==true && E010P==true){\r\n\t\t\tint n= this.getIntegerValue(\"I010\");\r\n\t\t\tint val=integers[n].getValue();\r\n\t\t\tintegers[n].setValue(++val);\r\n\t\t}\r\n\t\t\r\n\t\t/*The fourth line*/\r\n\t\tA008P=false;\r\n\t\tE002P=false;\r\n\t\tfor(int i=0;i<4;i++){\r\n\t\t\tif(\"A008\".equalsIgnoreCase(row3[i].getCode())){\r\n\t\t\t\tA008P=true;\r\n\t\t\t}\r\n\t\t\tif(\"E002\".equalsIgnoreCase(row1[i].getCode())){\r\n\t\t\t\tE002P=true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(A008P==true && E002P==true){\r\n\t\t\tint n= this.getIntegerValue(\"I012\");\r\n\t\t\tint val=integers[n].getValue();\r\n\t\t\tintegers[n].setValue(++val);\r\n\t\t}\r\n\t\t\r\n\t\t/*The fifth line*/\r\n\t\tA009P=false;\r\n\t\tE010P=false;\r\n\t\tfor(int i=0;i<4;i++){\r\n\t\t\tif(\"A009\".equalsIgnoreCase(row3[i].getCode())){\r\n\t\t\t\tA009P=true;\r\n\t\t\t}\r\n\t\t\tif(\"E010\".equalsIgnoreCase(row1[i].getCode())){\r\n\t\t\t\tE010P=true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(A009P==true && E010P==true){\r\n\t\t\tint n= this.getIntegerValue(\"I010\");\r\n\t\t\tint val=integers[n].getValue();\r\n\t\t\tintegers[n].setValue(++val);\r\n\t\t}\r\n\t\t\r\n\t\t/*The sixth line*/\r\n\t\tA011P=false;\r\n\t\tE001P=false;\r\n\t\tfor(int i=0;i<4;i++){\r\n\t\t\tif(\"A011\".equalsIgnoreCase(row3[i].getCode())){\r\n\t\t\t\tA011P=true;\r\n\t\t\t}\r\n\t\t\tif(\"E001\".equalsIgnoreCase(row1[i].getCode())){\r\n\t\t\t\tE001P=true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(A011P==true && E001P==true){\r\n\t\t\tint n= this.getIntegerValue(\"I011\");\r\n\t\t\tint val=integers[n].getValue();\r\n\t\t\tintegers[n].setValue(++val);\r\n\t\t}\r\n\t\t\r\n\t\t/*The seventh line*/\r\n\t\tA002P=false;\r\n\t\tE004P=false;\r\n\t\tfor(int i=0;i<4;i++){\r\n\t\t\tif(\"A002\".equalsIgnoreCase(row3[i].getCode())){\r\n\t\t\t\tA002P=true;\r\n\t\t\t}\r\n\t\t\tif(\"E004\".equalsIgnoreCase(row1[i].getCode())){\r\n\t\t\t\tE004P=true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(A002P==true && E004P==true){\r\n\t\t\tint n = this.getIntegerValue(\"I014\");\r\n\t\t\tint val=integers[n].getValue();\r\n\t\t\tintegers[n].setValue(++val);\r\n\t\t}\r\n\t\t\r\n\t\treturn integers;\r\n\t}", "private void formData(final String label, final int datasetIndex, final int year, final int month, final int day, final LinkedHashMap<Long,Double> data)\n {\n if (thread != null)\n thread.interrupt();\n chart.clearValues();\n if(day==0)\n {\n chart.getXAxis().setValueFormatter(new ValueFormatter() {\n @Override\n public String getFormattedValue(float value)\n {\n String days[] =getResources().getStringArray(R.array.days);\n int day = (int) value % days.length;\n if(day<0)\n return \"\";\n else\n return days[day];\n }\n });\n thread = new Thread(new Runnable()\n {\n\n @Override\n public void run()\n {\n Double[] daysSumArray = {0.0,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0 };\n SortedSet<Long> keys = new TreeSet<>(data.keySet());\n for (Long key : keys)\n {\n Double value = data.get(key);\n Date date = new Date(key);\n int day_to_show = getDayNumber(date); //days start at 1 which is SUN\n int year_to_show = getYearNumber(date);\n int month_to_show = getMonthNumber(date)+1; //months start ta 0 which is JAN\n\n\n /* YEAR | MONTH | DAY || GRAPH FILTER\n ----------------------------------------------------\n all | all | all || days\n ----------------------------------------------------\n 2020 | all | all || days->2020\n ----------------------------------------------------\n 2020 | jan | all || days->2020->jan\n ----------------------------------------------------\n all | jan | all || days->jan*/\n if(month==0 && year==0)\n daysSumArray[day_to_show-1] += value;\n else if(month==0 && year>0)\n {\n //days->2020\n if(year_to_show==year)\n daysSumArray[day_to_show-1] += value;\n }\n else if(month>0 && year>0)\n {\n //days->2020->jan\n if(year_to_show==year && month_to_show == month)\n daysSumArray[day_to_show-1] += value;\n }\n else if(month>0 && year==0)\n {\n //days->jan\n if(month_to_show == month)\n daysSumArray[day_to_show-1] += value;\n }\n\n\n }\n for(int c=0; c<=6; c++)\n getActivity().runOnUiThread(new OneShotTask(label, datasetIndex,(long)c+1,daysSumArray[c]));\n\n }\n });\n\n thread.start();\n }\n else if( day >0 && day <8)\n {\n chart.getXAxis().setValueFormatter(new ValueFormatter() {\n @Override\n public String getFormattedValue(float value)\n {\n String hours[] =getResources().getStringArray(R.array.hours_24);\n int hour = (int) value % hours.length;\n if(hour<0)\n return \"\";\n else\n return hours[hour];\n }\n });\n thread = new Thread(new Runnable()\n {\n\n @Override\n public void run()\n {\n\n Double[] hoursSumArray = {0.0,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0, 0.0, 0.0, 0.0, 0.0, 0.0,0.0,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };\n SortedSet<Long> keys = new TreeSet<>(data.keySet());\n for (Long key : keys)\n {\n Double value = data.get(key);\n Date date = new Date(key);\n int day_to_show = getDayNumber(date); //days start at 1 which is SUN\n int year_to_show = getYearNumber(date);\n int month_to_show = getMonthNumber(date)+1; //months start ta 0 which is JAN\n int hour_of_day = getHourNumber(date);\n\n\n /* YEAR | MONTH | DAY || GRAPH FILTER\n ----------------------------------------------------\n 2020 | jan | mon || hours->2020->jan->mon\n ----------------------------------------------------\n all | jan | mon || hours->jan->mon\n ----------------------------------------------------\n all | all | mon || hours->mon\n ----------------------------------------------------\n 2020 | all | mon || hours->2020->mon\n ----------------------------------------------------\n */\n if(month>0 && year>0 && day_to_show == day)\n {\n if(year_to_show==year && month_to_show == month)\n hoursSumArray[hour_of_day]+=value;\n }\n else if(month>0 && year==0 && day_to_show == day)\n {\n if(month_to_show == month)\n hoursSumArray[hour_of_day]+=value;\n }\n\n else if(month==0 && year==0 && day_to_show == day)\n hoursSumArray[hour_of_day]+=value;\n else if(month==0 && year>0 && day_to_show == day)\n {\n //days->2020\n if(year_to_show==year)\n hoursSumArray[hour_of_day]+=value;\n }\n\n }\n for(int c=0; c<=23; c++)\n getActivity().runOnUiThread(new OneShotTask(label, datasetIndex,(long)c,hoursSumArray[c]));\n\n\n }\n });\n\n thread.start();\n\n\n }\n else if( day == 8 && month !=13)\n {\n chart.getXAxis().setValueFormatter(new ValueFormatter() {\n @Override\n public String getFormattedValue(float value)\n {\n String months[] =getResources().getStringArray(R.array.months);\n int month = (int) value % months.length;\n if(month<0)\n return \"\";\n else\n return months[month];\n }\n });\n thread = new Thread(new Runnable() {\n\n @Override\n public void run()\n {\n Double monthsSumArray[] = {0.0,0.0 ,0.0 ,0.0 ,0.0 ,0.0 ,0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };\n SortedSet<Long> keys = new TreeSet<>(data.keySet());\n for (Long key : keys)\n {\n Double value = data.get(key);\n Date date = new Date(key);\n int day_to_show = getDayNumber(date); //days start at 1 which is SUN\n int year_to_show = getYearNumber(date);\n int month_to_show = getMonthNumber(date)+1; //months start ta 0 which is JAN\n\n /* YEAR | MONTH | DAY || GRAPH FILTER\n ----------------------------------------------------\n all | all | hide || months\n ----------------------------------------------------\n all | jan | hide || months->jan\n ----------------------------------------------------\n 2020 | jan | hide || months->jan->2020\n ----------------------------------------------------\n */\n if(month==0 && year==0)\n monthsSumArray[month_to_show-1] += value;\n else if(month>0 && year==0 && month==month_to_show)\n monthsSumArray[month_to_show-1] += value;\n else if(month>0 && year>0 && month==month_to_show)\n monthsSumArray[month_to_show-1] += value;\n\n\n }\n for(int c=0; c<=11; c++)\n getActivity().runOnUiThread(new OneShotTask(label, datasetIndex,(long)c+1,monthsSumArray[c]));\n\n }\n });\n thread.start();\n }\n else if(day==8 && month==13)\n {\n /* YEAR | MONTH | DAY || GRAPH FILTER\n ----------------------------------------------------\n all | hide | hide || years\n ----------------------------------------------------\n */\n chart.getXAxis().setValueFormatter(new ValueFormatter() {\n @Override\n public String getFormattedValue(float value)\n {\n return String.valueOf((int)value);\n }\n });\n thread = new Thread(new Runnable() {\n\n @Override\n public void run()\n {\n //REMEBER TO UPDATE STRING ARRAY FOR YEARS IN arrays.xml\n Double yearsSumArray[] = {0.0,0.0 };\n LinkedHashMap<Integer,Double > data_years = new LinkedHashMap<>();\n SortedSet<Long> keys = new TreeSet<>(data.keySet());\n for (Long key : keys)\n {\n Double value = data_years.get(key);\n Date date = new Date(key);\n int year = getYearNumber(date);\n if(data_years.get(year) == null)\n data_years.put(year,value);\n else\n data_years.put(year,data_years.get(year)+value);\n\n }\n Iterator iterator = data_years.entrySet().iterator();\n while (iterator.hasNext())\n {\n LinkedHashMap.Entry<Integer, Double>set = (LinkedHashMap.Entry<Integer, Double>) iterator.next();\n getActivity().runOnUiThread(new OneShotTask(label, datasetIndex,(long)set.getKey(),set.getValue()));\n }\n\n }\n });\n thread.start();\n }\n\n /*else if(monthly)\n {\n\n }\n else if(yearly)\n {\n\n }*/\n }", "private void setData() {\n LineDataSet set1 = new LineDataSet(valuesTemperature, \"Temperature\");\n\n set1.setColor(Color.RED);\n set1.setLineWidth(1.0f);\n set1.setDrawValues(false);\n set1.setDrawCircles(false);\n set1.setMode(LineDataSet.Mode.LINEAR);\n set1.setDrawFilled(false);\n\n // create a data object with the data sets\n LineData data = new LineData(set1);\n\n // set data\n chartTemperature.setData(data);\n\n // get the legend (only possible after setting data)\n Legend l = chartTemperature.getLegend();\n l.setEnabled(true);\n\n\n // create a dataset and give it a type\n set1 = new LineDataSet(valuesPressure, \"Pressure\");\n\n set1.setColor(Color.GREEN);\n set1.setLineWidth(1.0f);\n set1.setDrawValues(false);\n set1.setDrawCircles(false);\n set1.setMode(LineDataSet.Mode.LINEAR);\n set1.setDrawFilled(false);\n\n // create a data object with the data sets\n data = new LineData(set1);\n\n // set data\n chartPressure.setData(data);\n\n // get the legend (only possible after setting data)\n l = chartPressure.getLegend();\n l.setEnabled(true);\n\n\n\n // create a dataset and give it a type\n set1 = new LineDataSet(valuesAltitude, \"Altitude\");\n\n set1.setColor(Color.BLUE);\n set1.setLineWidth(1.0f);\n set1.setDrawValues(false);\n set1.setDrawCircles(false);\n set1.setMode(LineDataSet.Mode.LINEAR);\n set1.setDrawFilled(false);\n\n // create a data object with the data sets\n data = new LineData(set1);\n\n // set data\n chartAltitude.setData(data);\n\n // get the legend (only possible after setting data)\n l = chartAltitude.getLegend();\n l.setEnabled(true);\n }", "@Test\n public void test67() throws Throwable {\n CombinedRangeCategoryPlot combinedRangeCategoryPlot0 = new CombinedRangeCategoryPlot();\n DatasetRenderingOrder datasetRenderingOrder0 = DatasetRenderingOrder.FORWARD;\n combinedRangeCategoryPlot0.setDatasetRenderingOrder(datasetRenderingOrder0);\n AxisLocation axisLocation0 = combinedRangeCategoryPlot0.getRangeAxisLocation();\n CategoryAxis categoryAxis0 = combinedRangeCategoryPlot0.getDomainAxis();\n AxisLocation axisLocation1 = combinedRangeCategoryPlot0.getRangeAxisLocation();\n Number[][] numberArray0 = new Number[3][5];\n Number[] numberArray1 = new Number[5];\n double double0 = SpiderWebPlot.DEFAULT_AXIS_LABEL_GAP;\n numberArray1[0] = (Number) 0.1;\n int int0 = SystemColor.INFO;\n numberArray1[1] = (Number) 24;\n int int1 = TransferHandler.MOVE;\n numberArray1[2] = (Number) 2;\n int int2 = MockThread.MIN_PRIORITY;\n numberArray1[3] = (Number) 1;\n int int3 = ColorSpace.TYPE_ACLR;\n numberArray1[4] = (Number) 20;\n numberArray0[0] = numberArray1;\n Number[] numberArray2 = new Number[2];\n byte byte0 = Character.CONTROL;\n numberArray2[0] = (Number) (byte)15;\n int int4 = ThermometerPlot.BULB_DIAMETER;\n numberArray2[1] = (Number) 80;\n numberArray0[1] = numberArray2;\n Number[] numberArray3 = new Number[8];\n Object[][][] objectArray0 = new Object[2][8][7];\n objectArray0[0] = (Object[][]) numberArray0;\n objectArray0[1] = (Object[][]) numberArray0;\n DefaultWindDataset defaultWindDataset0 = null;\n try {\n defaultWindDataset0 = new DefaultWindDataset(objectArray0);\n } catch(ArrayIndexOutOfBoundsException e) {\n //\n // 2\n //\n assertThrownBy(\"org.jfree.data.xy.DefaultWindDataset\", e);\n }\n }", "@FXML\n public void setGraph(){\n /*\n series.getData().clear();\n for(double x = -400; x <= 400; x += 1)\n series.getData().add(new XYChart.Data<Number,Number> (x, x));\n\n graph.getData().add(series);\n */\n System.out.println(\"vjksdl\");\n }", "public void addSeries(DataSeries aSeries) { _dataSet.addSeries(aSeries); }", "public static CategoryDataset createDataset(DefaultTableModel dtm, ArrayList<BigDecimal> have, BigDecimal goal) {\n \n //Get the data out of the table model\n \tArrayList<DateTime> dates \t\t= TableDataConversion.getDates(dtm);\n \tArrayList<BigDecimal> expected \t= TableDataConversion.getExpectedAmount(dtm);\n \t\n \t//Make the dataset\n \tfinal DefaultCategoryDataset dataset = new DefaultCategoryDataset();\n \t\n \t//Set the print format\n \tDateTimeFormatter formatter = DateTimeFormat.forPattern(\"dd/MM/YY\");\n \t\n \t//Row keys\n final String series1 = \"Expected\";\n final String series2 = \"Have\";\n final String series3 = \"Goal\";\n \t\n \t//Add to the dataset\n \tfor(int i=0; i<dates.size(); i++)\n \t{\n \t\tdataset.addValue(expected.get(i), series1, dates.get(i).toString(formatter));\n \t\tdataset.addValue(have.get(i), series2, dates.get(i).toString(formatter));\n \t\tdataset.addValue(goal, series3, dates.get(i).toString(formatter));\n \t}\n \t\n return dataset;\n \n }", "public static String createArffData(DataSet dataSet){\n StringBuilder sb = new StringBuilder();\n sb.append(\"@data\\n\");\n for(int i = 0; i < dataSet.getRows(); i++){\n for(int j = 0; j < dataSet.getColumns() - 1; j++){\n sb.append(dataSet.getEntryInDataSet(i, j));\n sb.append(\",\");\n }\n sb.append(dataSet.getEntryInDataSet(i, dataSet.getColumns() - 1));\n sb.append(\"\\n\");\n }\n sb.append(\"\\n\");\n return sb.toString();\n }", "public String[] dataArrangement(){\n\t\tString result[] = new String[10];\r\n \t/**Extra Credit (5%): Enable user input for the value of K.\r\n \t the program should use the input if it is valid, if not it should print an error. **/\r\n \tint K = 0;\r\n \tdo {\r\n \t\tSystem.out.println(\"Enter a number for K(odd number between 1 and 90): \");\r\n \t\tScanner scanner = new Scanner(System.in);\r\n \t\tif (scanner.hasNextInt()) {\r\n \t\t\tK = scanner.nextInt();\r\n \t\t}\r\n \t\tif (K<1 || K>90 || (K%2 == 0)) {\r\n \t\t\tSystem.out.println(\"Invalid input, try again.\");\r\n \t\t}\r\n \t}while (K<1 || K>90 || (K%2 == 0));\r\n \r\n\t\t\r\n \t/**b. Read titanic.csv into an ArrayList of DataPoints as using readData. **/\r\n \tArrayList<DataPoint> data = new ArrayList<DataPoint>();\r\n \tKNNPredictor KNNP = new KNNPredictor(K);\r\n \tdata = KNNP.readData(\"titanic.csv\");\r\n \t//Create an ArrayList to store testing data\r\n \tArrayList<DataPoint> testData = new ArrayList<DataPoint>();\r\n \tfor(int i=0; i<data.size(); i++) {\r\n \t\t//Check if the dataPoint is a test data\r\n \t\tif(data.get(i).getIsTest() == true) {\r\n \t\t\t//Run test method\r\n \t\t\tKNNP.test(data.get(i));\r\n \t\t\ttestData.add(data.get(i));\r\n \t\t}\r\n \t}\r\n \tdouble accuracy = 0.0;\r\n \tdouble precision = 0.0;\r\n \t/**c. Compute the precision and accuracy using the ArrayList of DataPoints. **/\r\n \taccuracy = KNNP.getAccuracy(testData);\r\n \tprecision = KNNP.getPrecision(testData);\r\n \tlong accuracyR = Math.round(accuracy*100);\r\n \tlong precisionR = Math.round(precision*100);\r\n \t\r\n \tresult[0] = \"Accuracy: \" + accuracyR + \"%\";\r\n \tresult[1] = \"Precision: \" + precisionR + \"%\";\r\n \t//return the information that will be printed by JFrame\r\n \treturn result;\r\n \t\r\n }", "private void plotData(){\n List<Entry> entriesMedidas = new ArrayList<Entry>();\n try{\n // #1\n FileInputStream fis = getApplicationContext().openFileInput(fileName);\n InputStreamReader isr = new InputStreamReader(fis);\n BufferedReader reader = new BufferedReader(isr);\n\n // #2. Skips the name, birthdate and gender of the baby\n reader.readLine();\n reader.readLine();\n reader.readLine();\n\n // #3\n String line = reader.readLine();//First line with data\n\n while (line != null) {\n double[] datum = obtainSubstring(line, mag);\n entriesMedidas.add(new Entry((float) datum[0], (float) datum[1]));\n\n line = reader.readLine();\n }\n\n reader.close();\n isr.close();\n fis.close();\n\n }catch(IOException e){\n e.printStackTrace();\n }\n\n // #4\n LineDataSet lineaMedidas = new LineDataSet(entriesMedidas, this.name);\n lineaMedidas.setAxisDependency(YAxis.AxisDependency.LEFT);\n lineaMedidas.setColor(ColorTemplate.rgb(\"0A0A0A\"));\n lineaMedidas.setCircleColor(ColorTemplate.rgb(\"0A0A0A\"));\n todasMedidas.add(lineaMedidas);\n\n }", "private static void insertTimeSeriesOneDim(final ScriptEngine engine,\r\n final DataArray data) throws Exception {\r\n List<DataEntry> time = data.getDate();\r\n int freq = TimeUtils.getFrequency(time);\r\n List<Double> doubleList = data.getDouble();\r\n double[] doubleArray = new double[doubleList.size()];\r\n for (int i = 0; i < doubleList.size(); i++) {\r\n doubleArray[i] = doubleList.get(i);\r\n }\r\n engine.put(\"my_double_vector\", doubleArray);\r\n engine.eval(\"ts_0 <- ts(my_double_vector, frequency = \"\r\n + freq + \")\");\r\n }", "public void generateChart(){\n String[][] contents = retrieveFields();\n\n// String msg = \"test - \";\n// printCells(contents);\n\n String[] houseDisplay = new String[12];\n houseDisplay = new String[]{\"6\",\"4\",\"2\",\"1\",\"4\",\"6\",\"3\",\"5\",\"7/8\",\"\",\"5\",\"3\"};\n display(houseDisplay);\n }", "@Test\n public void test41() throws Throwable {\n Line2D.Double line2D_Double0 = new Line2D.Double(407.99, (-371.62), (-371.62), 0.0);\n line2D_Double0.x1 = 0.0;\n line2D_Double0.setLine((-371.62), 3820.38477815176, 0.0, 3820.38477815176);\n DefaultValueDataset defaultValueDataset0 = new DefaultValueDataset(0.0);\n ThermometerPlot thermometerPlot0 = new ThermometerPlot((ValueDataset) defaultValueDataset0);\n NumberAxis numberAxis0 = (NumberAxis)thermometerPlot0.getRangeAxis();\n CombinedRangeCategoryPlot combinedRangeCategoryPlot0 = new CombinedRangeCategoryPlot((ValueAxis) numberAxis0);\n combinedRangeCategoryPlot0.setRangeCrosshairValue((-371.62));\n CategoryPointerAnnotation categoryPointerAnnotation0 = new CategoryPointerAnnotation(\"K(Jj1`SZJ!y81S;n?%Y\", (Comparable) (-371.62), 1834.808976, (-371.62));\n combinedRangeCategoryPlot0.addAnnotation(categoryPointerAnnotation0);\n DatasetRenderingOrder datasetRenderingOrder0 = combinedRangeCategoryPlot0.getDatasetRenderingOrder();\n float[][] floatArray0 = new float[9][0];\n float[] floatArray1 = new float[0];\n floatArray0[0] = floatArray1;\n float[] floatArray2 = new float[6];\n floatArray2[0] = Float.NEGATIVE_INFINITY;\n floatArray2[1] = 8.0F;\n floatArray2[2] = (-970.0398F);\n floatArray2[3] = (-2174.3F);\n floatArray2[4] = 0.0F;\n floatArray2[5] = 2953.279F;\n floatArray0[1] = floatArray2;\n float[] floatArray3 = new float[9];\n floatArray3[0] = 2953.279F;\n floatArray3[1] = (-970.0398F);\n floatArray3[2] = (-2174.3F);\n floatArray3[3] = (-970.0398F);\n floatArray3[4] = (-970.0398F);\n floatArray3[5] = 0.0F;\n floatArray3[6] = (-2174.3F);\n floatArray3[7] = 0.0F;\n floatArray3[8] = Float.NEGATIVE_INFINITY;\n floatArray0[2] = floatArray3;\n float[] floatArray4 = new float[0];\n floatArray0[3] = floatArray4;\n float[] floatArray5 = new float[7];\n floatArray5[0] = 8.0F;\n floatArray5[1] = 2953.279F;\n floatArray5[2] = (-966.2956F);\n floatArray5[3] = 8.0F;\n floatArray5[4] = 8.0F;\n floatArray5[5] = (-2174.3F);\n floatArray5[6] = (-2174.3F);\n floatArray0[4] = floatArray5;\n float[] floatArray6 = new float[6];\n floatArray6[0] = 0.0F;\n floatArray6[1] = Float.NEGATIVE_INFINITY;\n floatArray6[2] = (-966.2956F);\n floatArray6[3] = (-1797.876F);\n floatArray6[4] = (-966.2956F);\n floatArray6[5] = (-2174.3F);\n floatArray0[5] = floatArray6;\n float[] floatArray7 = new float[8];\n floatArray7[0] = 0.0F;\n floatArray7[1] = (-966.2956F);\n floatArray7[2] = 0.0F;\n floatArray7[3] = Float.NEGATIVE_INFINITY;\n floatArray7[4] = (-970.0398F);\n floatArray7[5] = (-970.0398F);\n floatArray7[6] = 0.0F;\n floatArray7[7] = (-970.0398F);\n floatArray0[6] = floatArray7;\n float[] floatArray8 = new float[3];\n floatArray8[0] = Float.NEGATIVE_INFINITY;\n floatArray8[1] = Float.NEGATIVE_INFINITY;\n floatArray8[2] = (-1797.876F);\n floatArray0[7] = floatArray8;\n float[] floatArray9 = new float[8];\n floatArray9[0] = 8.0F;\n floatArray9[1] = (-2209.7039F);\n floatArray9[2] = 0.0F;\n floatArray9[3] = (-2174.3F);\n floatArray9[4] = (-2174.3F);\n floatArray9[5] = Float.NEGATIVE_INFINITY;\n floatArray9[6] = 0.0F;\n floatArray9[7] = 2953.279F;\n floatArray0[8] = floatArray9;\n FastScatterPlot fastScatterPlot0 = new FastScatterPlot(floatArray0, (ValueAxis) numberAxis0, (ValueAxis) numberAxis0);\n BasicStroke basicStroke0 = (BasicStroke)fastScatterPlot0.getDomainGridlineStroke();\n combinedRangeCategoryPlot0.setRangeCrosshairStroke(basicStroke0);\n }", "private XYDataset createDataset(String WellID, String lang) {\n final TimeSeries eur = createEURTimeSeries(WellID, lang);\n final TimeSeriesCollection dataset = new TimeSeriesCollection();\n dataset.addSeries(eur);\n return dataset;\n }", "private Dataset createDataSet(RecordingObject recordingObject, Group parentObject, String name) throws Exception\n\t{\n\t\t// dimension of dataset, length of array and 1 column\n\t\tlong[] dims2D = { recordingObject.getYValuesLength(), recordingObject.getXValuesLength() };\n\n\t\t// H5Datatype type = new H5Dataype(CLASS_FLOAT, 8, NATIVE, -1);\n\t\tDatatype dataType = recordingsH5File.createDatatype(recordingObject.getDataType(), recordingObject.getDataBytes(), Datatype.NATIVE, -1);\n\t\t// create 1D 32-bit float dataset\n\t\tDataset dataset = recordingsH5File.createScalarDS(name, parentObject, dataType, dims2D, null, null, 0, recordingObject.getValues());\n\n\t\t// add attributes for unit and metatype\n\t\tcreateAttributes(recordingObject.getMetaType().toString(), recordingObject.getUnit(), dataset);\n\n\t\treturn dataset;\n\t}", "public void addTrainingData(String value,String label);", "private TimeSeries createEURTimeSeries(String WellID, String lang) {\n int count = 0;\n String precipitation = \"\";\n if(lang.equals(\"EN\")){\n precipitation = precipitation_en;\n }else{\n precipitation = precipitation_fr;\n }\n TimeSeries t1 = new TimeSeries(precipitation + \" (mm)\");\n //System.out.println (t1.getMaximumItemCount()); \n Hour begin = new Hour( 1, 1, 1, 2005);\n Hour end = new Hour(23, 31, 12, 2012);\n String endStr = end.toString();\n String str = begin.toString();\n \n for(Hour h1 = begin; !str.equals(endStr) ; h1 = (Hour) h1.next()){\n Second s = new Second(0, 0, h1.getHour(), h1.getDayOfMonth(), h1.getMonth(), h1.getYear());\n t1.addOrUpdate(s, new Double(Double.NaN)); \n str = h1.toString();\n }\n \n try {\n // Open the file that is the first \n // command line parameter\n FileInputStream fstream = new FileInputStream(\"Y:\\\\PGMN\\\\Precipitation\\\\\" + WellID + \".csv\");\n // Get the object of DataInputStream\n DataInputStream in = new DataInputStream(fstream);\n BufferedReader br = new BufferedReader(new InputStreamReader(in));\n String strLine;\n //Read File Line By Line\n int i = 0;\n while ((strLine = br.readLine()) != null) {\n if(i>0){ \n String [] temp = strLine.split(\",\");\n //System.out.println (i);\n String [] dateTimeAM = (temp[2]).split(\" \"); //08/20/2009 10:35:00 AM\n \n String [] dates = (dateTimeAM[0]).split(\"/\"); //6/10/2009\n int month = Integer.parseInt(dates[0]);\n int day = Integer.parseInt(dates[1]);\n int year = Integer.parseInt(dates[2]);\n //System.out.println (i);\n int hour = 0;\n int minute = 0;\n int second = 0; \n if (dateTimeAM.length > 1) {\n String [] temp3 = (dateTimeAM[1]).split(\":\"); //10:35:00\n hour = Integer.parseInt(temp3[0]);\n minute = Integer.parseInt(temp3[1]);\n second = Integer.parseInt(temp3[2]);\n //08/20/2009 10:35:00 AM\n if ((dateTimeAM[2]).equals(\"PM\")) {\n if (hour < 12) {\n hour = hour + 12;\n }\n }\n if ((dateTimeAM[2]).equals(\"AM\") && (hour == 12)) {\n hour = 0;\n }\n }\n Second s = new Second(second, minute, hour, day, month, year);\n //System.out.println(strLine);\n //System.out.println(year + \", \" + month + \", \" + day + \", \" + hour + \", \" + minute + \", \" + second);\n //Hour h = new Hour(hour, day, month, year);\n Double d = new Double(Double.NaN);\n //System.out.println(temp[2]);\n if (temp.length > 2){\n d = Double.parseDouble(temp[3]);// - depth;\n count ++;\n }\n t1.addOrUpdate(s, d);\n }\n i = i + 1;\n }\n in.close();\n \n }\n catch (Exception e) {\n System.err.println(e.getMessage());\n }\n \n return t1;\n }", "public void getDataForRegion(String dataType, String[] countrys, String year){\r\n String line = \"\"; \r\n int i=0;\r\n double[] rez= new double[countrys.length];\r\n int count=0;\r\n ArrayList<String> coun= new ArrayList<>();\r\n ArrayList<Double> dat= new ArrayList<>();\r\n try{ \r\n BufferedReader br = new BufferedReader(new FileReader(\"dataSets//\"+dataType+\".csv\")); \r\n while ((line = br.readLine()) != null){\r\n String lineArr[]=line.split(\",\");\r\n if(i==0){\r\n for(int j=1; j!=lineArr.length; j++){\r\n if(lineArr[j].equals(year)){\r\n i=j;\r\n }\r\n }\r\n }\r\n else{\r\n for(int j=0; j!=countrys.length; j++){\r\n if(lineArr[0].equals(countrys[j]) || lineArr[0].contains(countrys[j]) || countrys[j].contains(lineArr[0])){\r\n coun.add(lineArr[0]);\r\n dat.add(Double.parseDouble(lineArr[i]));\r\n }\r\n }\r\n }\r\n } \r\n }catch(Exception e){}\r\n c= new String[coun.size()];\r\n data= new double[coun.size()];\r\n for(int j=0; j!=c.length; j++){\r\n c[j]=coun.get(j);\r\n data[j]=dat.get(j);\r\n }\r\n }", "public static void graph(){\n\t\t double[][] valuepairs = new double[2][];\n\t\t valuepairs[0] = mutTotal; //x values\n\t\t valuepairs[1] = frequency; //y values\n\t\t DefaultXYDataset set = new DefaultXYDataset();\n\t\t set.addSeries(\"Occurances\",valuepairs); \n\t\t XYBarDataset barset = new XYBarDataset(set, .8);\n\t\t JFreeChart chart = ChartFactory.createXYBarChart(\n\t\t \"Mutation Analysis\",\"Number of Mutations\",false,\"Frequency\",\n\t\t barset,PlotOrientation.VERTICAL,true, true, false);\n\t\t JFrame frame = new JFrame(\"Mutation Analysis\");\n\t\t frame.setContentPane(new ChartPanel(chart));\n\t\t frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\t frame.pack();\n\t\t frame.setVisible(true);\n\t\t }", "private XYChart.Series<Number, Number> getFortySeries() {\n //Create new series\n XYChart.Series<Number, Number> series = new XYChart.Series<>();\n series.setName(\"Chemical Concentration\");\n Random rand = new Random();\n int c = 5; // Constant for x-axis scale\n for (int i = 0; i < 17; i++) {\n int y = rand.nextInt() % 5 + 10;\n series.getData().add(new XYChart.Data<>(i*5, y));\n }\n series.getData().add(new XYChart.Data<>(17 * c, 17));\n series.getData().add(new XYChart.Data<>(18 * c, 21));\n series.getData().add(new XYChart.Data<>(19 * c, 40));\n series.getData().add(new XYChart.Data<>(20 * c, 39));\n series.getData().add(new XYChart.Data<>(21 * c, 36));\n series.getData().add(new XYChart.Data<>(22 * c, 21));\n\n for (int i = 23; i < 30; i++) {\n int y = rand.nextInt() % 5 + 10;\n series.getData().add(new XYChart.Data<>(i*5, y));\n }\n return series;\n }", "private LineData generateLineData() {\n\n LineData d = new LineData();\n LineDataSet set = new LineDataSet(ReportingRates, \" ARVs (Reporting Rates)\");\n set.setColors(Color.parseColor(\"#90ed7d\"));\n set.setLineWidth(2.5f);\n set.setCircleColor(Color.parseColor(\"#90ed7d\"));\n set.setCircleRadius(2f);\n set.setFillColor(Color.parseColor(\"#90ed7d\"));\n set.setMode(LineDataSet.Mode.CUBIC_BEZIER);\n set.setDrawValues(true);\n\n set.setAxisDependency(YAxis.AxisDependency.LEFT);\n d.addDataSet(set);\n\n return d;\n }", "public XYSeriesCollection eulers(double t0, double tF, double stepSize,\n ArrayList<Argument> argumentList, ArrayList<Argument> variableArgList,\n ArrayList<StockObject> stockArrayList, ArrayList<FlowObject> flowArrayList, ArrayList<VariableObject> variableArrayList) {\n Argument[] aVarList = argumentList.toArray(new Argument[argumentList.size()]);\n //aTempVarList only created to later create the temparg array list\n Argument[] aTempVarList = new Argument[argumentList.size()];\n for (int j = 0; j < aVarList.length; j++) {\n aTempVarList[j] = aVarList[j].clone();\n }\n int numSteps = (int) ((tF - t0) / stepSize);\n double t = t0;\n //javax.swing.JProgressBar pbar = new javax.swing.JProgressBar(0,numSteps);\n //int cutoff = String.valueOf(t).length()-1;\n ArrayList<Argument> aTempArgArrayList = new ArrayList<Argument>();\n for (int j = 0; j < aVarList.length; j++) {\n aTempArgArrayList.add(aTempVarList[j]);\n }\n double[] dydt = new double[argumentList.size()];\n\n ArrayList<Double> k1 = new ArrayList<Double>();\n\n //idea is to set k1 to double 0\n for (int x = 0; x < stockArrayList.size(); x++) {\n k1.add(0.0);\n }\n\n //array list length of amount of stocks\n ArrayList<XYSeries> series = new ArrayList<XYSeries>();\n\n //create series to hold graph data\n for (int i = 0; i < stockArrayList.size(); i++) {\n XYSeries tempSeries = new XYSeries(stockArrayList.get(i).getObjName());\n series.add(tempSeries);\n }\n\n final XYSeriesCollection data = new XYSeriesCollection();\n //create strings to hold table data\n\n //add initial values to series\n for (int i = 0; i < stockArrayList.size(); i++) {\n series.get(i).add(0, argumentList.get(i).getArgumentValue());\n }\n int numOfStocks = stockArrayList.size();\n double value;\n // label the string array for columns\n String stockNames = \"Time,\";\n for (int x = 0; x < stockArrayList.size(); x++) {\n stockNames += argumentList.get(x).getArgumentName() + \",\";\n }\n String[] tableStrings = new String[stockArrayList.size() + 1];\n String columns[] = stockNames.split(\",\");\n tableModel = new DefaultTableModel(0, stockArrayList.size() + 1);\n tableModel.setColumnIdentifiers(columns); // set the labels\n\n for (int n = 0; n < numSteps; n++) {\n \n t = t0 + (n * stepSize);\n variableArgList.get(variableArgList.size() - 1).setArgumentValue(t);\n // t = Math.ceil(t * 10000) / 10000;\n\n //Let's find k1:\n dydt = RightHandSide(variableArgList, argumentList, flowArrayList, stockArrayList, variableArrayList);\n\n for (int i = 0; i < numOfStocks; i++) {\n\n k1.set(i, stepSize * dydt[i]);\n }\n\n for (int i = 0; i < numOfStocks; i++) {\n\n value = argumentList.get(i).getArgumentValue() + (k1.get(i));\n //value = Math.ceil(value * 10000) / 10000;\n argumentList.get(i).setArgumentValue(value);\n \n }\n\n int row = n + 1;\n //double tablex=row*stepSize;\n //tableStrings[0] = Double.toString(Math.floor(tablex*Math.pow(10,cutoff))/Math.pow(10,cutoff));\n tableStrings[0] = Double.toString(row * stepSize);\n for (int col = 0; col < stockArrayList.size(); col++) {\n tableStrings[col + 1] = Double.toString(argumentList.get(col).getArgumentValue());\n }\n tableModel.addRow(tableStrings);\n\n for (int i = 0; i < stockArrayList.size(); i++) {\n series.get(i).add(t, argumentList.get(i).getArgumentValue());\n }\n }\n for (int i = 0; i < stockArrayList.size(); i++) {\n data.addSeries(series.get(i));\n }\n return data;\n }", "private void createChart() {\n LineChart lineChart = (LineChart) findViewById(R.id.line_chart);\n\n // LineChart DataSet\n ArrayList<LineDataSet> dataSets = new ArrayList<>();\n\n // x-coordinate format value\n XAxis xAxis = lineChart.getXAxis();\n xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);\n xAxis.setGranularity(1f); // only intervals of 1 day\n// xAxis.setValueFormatter(new DayAxisValueFormatter(lineChart));\n\n\n // x-coordinate value\n ArrayList<String> xValues = new ArrayList<>();\n xValues.add(\"No.1\");\n xValues.add(\"No.2\");\n xValues.add(\"No.3\");\n xValues.add(\"No.4\");\n xValues.add(\"No.5\");\n\n // value\n ArrayList<Entry> value = new ArrayList<>();\n String measureItemName = \"\";\n value.add(new Entry(100, 0));\n value.add(new Entry(120, 1));\n value.add(new Entry(150, 2));\n value.add(new Entry(250, 3));\n value.add(new Entry(500, 4));\n\n\n // add value to LineChart's DataSet\n LineDataSet valueDataSet = new LineDataSet(value, measureItemName);\n dataSets.add(valueDataSet);\n\n // set LineChart's DataSet to LineChart\n// lineChart.setData(new LineData(xValues, dataSets));\n lineChart.setData(new LineData(valueDataSet));\n }", "private void iterativeDataPropertyMetrics() {\n\t}", "@Test\n public void test28() throws Throwable {\n double[][] doubleArray0 = new double[4][3];\n double[] doubleArray1 = new double[0];\n doubleArray0[0] = doubleArray1;\n double[] doubleArray2 = new double[1];\n doubleArray2[0] = 4394.831255689545;\n doubleArray0[1] = doubleArray2;\n double[] doubleArray3 = new double[5];\n doubleArray3[0] = 4394.831255689545;\n doubleArray3[1] = 4394.831255689545;\n doubleArray3[2] = 4394.831255689545;\n doubleArray3[3] = 4394.831255689545;\n doubleArray0[2] = doubleArray3;\n double[] doubleArray4 = new double[3];\n doubleArray4[0] = 4394.831255689545;\n doubleArray4[1] = 4394.831255689545;\n doubleArray0[3] = doubleArray4;\n DefaultIntervalCategoryDataset defaultIntervalCategoryDataset0 = new DefaultIntervalCategoryDataset(doubleArray0, doubleArray0);\n CategoryAxis3D categoryAxis3D0 = new CategoryAxis3D(\"org.jfree.data.xy.DefaultWindDataset\");\n Month month0 = new Month();\n ZoneOffset zoneOffset0 = ZoneOffset.MAX;\n ZoneInfo zoneInfo0 = (ZoneInfo)TimeZone.getTimeZone((ZoneId) zoneOffset0);\n PeriodAxis periodAxis0 = new PeriodAxis(\"'Ypi)?q\", (RegularTimePeriod) month0, (RegularTimePeriod) month0, (TimeZone) zoneInfo0);\n LayeredBarRenderer layeredBarRenderer0 = new LayeredBarRenderer();\n CategoryPlot categoryPlot0 = new CategoryPlot((CategoryDataset) defaultIntervalCategoryDataset0, (CategoryAxis) categoryAxis3D0, (ValueAxis) periodAxis0, (CategoryItemRenderer) layeredBarRenderer0);\n ChartRenderingInfo chartRenderingInfo0 = new ChartRenderingInfo();\n PlotRenderingInfo plotRenderingInfo0 = new PlotRenderingInfo(chartRenderingInfo0);\n CategoryItemRendererState categoryItemRendererState0 = new CategoryItemRendererState(plotRenderingInfo0);\n StandardEntityCollection standardEntityCollection0 = (StandardEntityCollection)categoryItemRendererState0.getEntityCollection();\n ChartRenderingInfo chartRenderingInfo1 = new ChartRenderingInfo((EntityCollection) standardEntityCollection0);\n PlotRenderingInfo plotRenderingInfo1 = chartRenderingInfo1.getPlotInfo();\n categoryPlot0.zoomRangeAxes(4394.831255689545, plotRenderingInfo1, (Point2D) null, false);\n }", "public int insertSensorData(DataValue dataVal) throws Exception;", "private List<List> createSenkeyChartData()\n {\n List<List> multiSenkeyData = new ArrayList<>();\n int numberOfBlocks = 11;\n List<Long> orderedHeight = new ArrayList<>(genSigLookup.keySet());\n Collections.sort(orderedHeight);\n List<Long> heightSub = orderedHeight.subList((orderedHeight.size() > numberOfBlocks ? orderedHeight.size() - numberOfBlocks : 0), orderedHeight.size());\n\n Map<String, Long> sourcePerGenSigLookup = new HashMap<>();\n Map<Long, Map<String, String>> remainingSourcesWithoutTarget = new HashMap<>();\n for(Long source : heightSub)\n {\n remainingSourcesWithoutTarget.put(source, new HashMap<>());\n\n if(heightSub.indexOf(source) < heightSub.size() - 1)\n {\n Long target = heightSub.get(heightSub.indexOf(source) + 1);\n Map<String, Set<String>> sourceGenSigDomainLookup = genSigLookup.get(source);\n // domain -> gensig\n Map<String, String> sourceMapping = new HashMap<>();\n\n for(Map.Entry<String, Set<String>> sourceEntry : sourceGenSigDomainLookup.entrySet())\n {\n for(String domain : sourceEntry.getValue())\n {\n sourceMapping.put(domain, sourceEntry.getKey());\n }\n }\n\n Map<String, Set<String>> targetGenSigDomainLookup = genSigLookup.get(target);\n // domain -> gensig\n Map<String, String> targetMapping = new HashMap<>();\n for(Map.Entry<String, Set<String>> targetEntry : targetGenSigDomainLookup.entrySet())\n {\n for(String domain : targetEntry.getValue())\n {\n targetMapping.put(domain, targetEntry.getKey());\n }\n }\n\n // sourceGenSig -> targetGensig -> domains\n Map<String, Map<String, List<String>>> fromToCounter = new HashMap<>();\n\n\n // domain ->genSig\n for(Map.Entry<String, String> entry : sourceMapping.entrySet())\n {\n String domain = entry.getKey();\n String sourceGenSig = entry.getValue();\n String targetGenSig = targetMapping.get(domain);\n\n // remember source block height by genSig\n sourcePerGenSigLookup.put(sourceGenSig, source);\n\n // skip if from/to is not available\n if(targetGenSig != null)\n {\n if(!fromToCounter.containsKey(sourceGenSig))\n {\n fromToCounter.put(sourceGenSig, new HashMap<>());\n }\n if(!fromToCounter.get(sourceGenSig).containsKey(targetGenSig))\n {\n fromToCounter.get(sourceGenSig).put(targetGenSig, new ArrayList<>());\n }\n fromToCounter.get(sourceGenSig).get(targetGenSig).add(domain);\n }\n else\n {\n // no target found\n remainingSourcesWithoutTarget.get(source).put(entry.getKey(), entry.getValue());\n }\n }\n\n // check if we have a target for previous sources without target now\n List<Long> previousSources = new ArrayList<>(remainingSourcesWithoutTarget.keySet());\n // ignore current source\n if(previousSources.contains(source))\n {\n previousSources.remove(source);\n }\n Collections.sort(previousSources);\n for(Long previousSource : previousSources)\n {\n Iterator<Map.Entry<String, String>> iter = remainingSourcesWithoutTarget.get(previousSource).entrySet().iterator();\n\n while(iter.hasNext())\n {\n Map.Entry<String, String> entry = iter.next();\n String domain = entry.getKey();\n String sourceGenSig = entry.getValue();\n String targetGenSig = targetMapping.get(domain);\n\n // skip if from/to is not available\n if(targetGenSig != null)\n {\n if(!fromToCounter.containsKey(sourceGenSig))\n {\n fromToCounter.put(sourceGenSig, new HashMap<>());\n }\n if(!fromToCounter.get(sourceGenSig).containsKey(targetGenSig))\n {\n fromToCounter.get(sourceGenSig).put(targetGenSig, new ArrayList<>());\n }\n fromToCounter.get(sourceGenSig).get(targetGenSig).add(domain);\n\n iter.remove();\n }\n }\n\n if(remainingSourcesWithoutTarget.get(previousSource).isEmpty())\n {\n remainingSourcesWithoutTarget.remove(previousSource);\n }\n }\n\n for(String sourceGenSig : fromToCounter.keySet())\n {\n for(Map.Entry<String, List<String>> entry : fromToCounter.get(sourceGenSig).entrySet())\n {\n Long currentSource = sourcePerGenSigLookup.get(sourceGenSig);\n String sourceName = currentSource + \" [\" + sourceGenSig.substring(0, 4) + \"..]\";\n String targetName = target + \" [\" + entry.getKey().substring(0, 4) + \"..]\";\n\n String tooltip = entry.getValue().size() + \" nodes,\"\n + \" from \" + currentSource + \" [\" + sourceGenSig.substring(0, 6) + \"..],\"\n + \" to \" + target + \" [\" + entry.getKey().substring(0, 6) + \"..]\";\n\n multiSenkeyData.add(Arrays.asList(sourceName, targetName, entry.getValue().size(), tooltip));\n }\n }\n }\n }\n return multiSenkeyData;\n }", "private BarData generateDataBar() {\n\n ArrayList<BarEntry> entries = new ArrayList<>();\n\n for (int i = 0; i < 12; i++) {\n entries.add(new BarEntry(i, (int) (Math.random() * 70) + 30));\n }\n\n BarDataSet d = new BarDataSet(entries, \"New DataSet 1\");\n // 设置相邻的柱状图之间的距离\n d.setColors(ColorTemplate.VORDIPLOM_COLORS);\n // 设置高亮的透明度\n d.setHighLightAlpha(255);\n\n BarData cd = new BarData(d);\n cd.setBarWidth(0.9f);\n return cd;\n }", "DataFrameFill fill();", "private void initializeChartPanel() {\n\n Rectangle region = new Rectangle(0, 0, clip.getFrameCount(), clip.getFrameFreqSamples());\n\n //toClipCoords(region);\n region.y = clip.getFrameFreqSamples() - (region.y + region.height);\n\n final int endCol = region.x + region.width;\n final int endRow = region.y + region.height;\n\n //System.out.println(\"endCol = \" + endCol + \" endRow = \" + endRow);\n\n XYSeries xy = new XYSeries(\"data\");\n XYSeries xySpline = new XYSeries(\"spline\");\n\n // Displays the single MAX or STRONGEST Frequency for each column\n // captures every x'th element for fitting spline\n int maxItensity = 0;\n int[] rows = new int[endCol];\n int[] intensities = new int[endCol];\n\n// int SPLINEPRECISION = chartPrefJSlider2.getValue(); // 1 is highest precision; default = 40\n int SPLINEPRECISION = 40; // 1 is highest precision; default = 40\n int splineCounter = 0;\n\n for (int col = region.x; col < endCol; col++) {\n Frame fr = clip.getFrame(col);\n int strongestFreq = 0;\n int strongestFreqStrength = 0;\n for (int row = region.y; row < endRow; row++) {\n // the following is a MUCH faster equivalent to: img.setRGB(col, row, greyVal);\n //int greyVal = (int) (brightness + (contrast * Math.log1p(Math.abs(preMult * val))));\n int greyVal = (int) (0 + (625.0 * Math.log1p(Math.abs(11.2 * fr.getReal(row)))));\n greyVal = Math.min(255, Math.max(0, greyVal));\n int thisFreqStrength = (greyVal << 16) | (greyVal << 8) | (greyVal);\n\n if (thisFreqStrength > strongestFreqStrength) {\n strongestFreqStrength = thisFreqStrength;\n strongestFreq = row;\n }\n if (thisFreqStrength > maxItensity) {\n maxItensity = thisFreqStrength;\n }\n }\n rows[col] = strongestFreq;\n intensities[col] = strongestFreqStrength;\n }\n System.out.println(\"maxItensity = \" + maxItensity);\n\n // Average neighboring data values\n // Use minIntensity amoung neighbors for averaged row\n // Use threshold to exclude weak signals\n //int NUMPOINTSAVERAGED = 20;\n int NUMPOINTSAVERAGED = jSlider1.getValue(); // default = 20\n double INTENSITYTHRESHOLD = 0.95;\n int[] data = new int[endCol - NUMPOINTSAVERAGED];\n int[] dataAveraged = new int[endCol - NUMPOINTSAVERAGED];\n int[] minIntensities = new int[endCol - NUMPOINTSAVERAGED];\n for (int col = region.x; col < endCol - NUMPOINTSAVERAGED; col++) {\n int sumRows = 0;\n int minIntensity = maxItensity;\n for (int i = col; i < col + NUMPOINTSAVERAGED; i++) {\n sumRows += rows[i];\n minIntensity = java.lang.Math.min(minIntensity, intensities[i]);\n }\n data[col] = rows[col];\n dataAveraged[col] = java.lang.Math.round(sumRows / NUMPOINTSAVERAGED);\n minIntensities[col] = minIntensity;\n }\n\n for (int col = region.x; col < endCol - 2 * NUMPOINTSAVERAGED; col++) {\n splineCounter++;\n for (int row = region.y; row < endRow; row++) {\n if (row == data[col] && minIntensities[col] > INTENSITYTHRESHOLD * maxItensity) {\n // adds actual data\n xy.add((double) col, (double) convertYCoordToFreq(row));\n //System.out.println(\"adding data point (\" + col + \",\" + row + \")\");\n }\n\n if (row == dataAveraged[col] && minIntensities[col] > INTENSITYTHRESHOLD * maxItensity) {\n // adds averaged data\n //xy.add((double) col, (double) convertYCoordToFreq(row));\n //System.out.println(\"adding data point (\" + col + \",\" + row + \")\");\n if (splineCounter % SPLINEPRECISION == 0) {\n xySpline.add((double) (col + NUMPOINTSAVERAGED / 2), (double) convertYCoordToFreq(row));\n }\n }\n }\n }\n\n dataset.removeAllSeries();\n dataset.addSeries(xy);\n\n //XYSeriesCollection splineDataset = new XYSeriesCollection();\n dataset.addSeries(xySpline);\n\n JFreeChart chart = ChartFactory.createXYLineChart(\n //JFreeChart chart = ChartFactory.createScatterPlot(\n clip.getFileName(), \"Time (ms)\", \"Frequency (Hz)\", dataset, PlotOrientation.VERTICAL, true, true, false);\n XYPlot xyplot = (XYPlot) chart.getPlot();\n xyplot.setRenderer(new XYSplineRenderer());\n XYLineAndShapeRenderer xylineandshaperenderer = (XYLineAndShapeRenderer) xyplot.getRenderer();\n xylineandshaperenderer.setSeriesShape(0, new java.awt.Rectangle(1, 1, 1, 1));\n xylineandshaperenderer.setSeriesLinesVisible(0, false);\n xylineandshaperenderer.setSeriesShapesVisible(0, true);\n xylineandshaperenderer.setSeriesLinesVisible(1, false);\n xylineandshaperenderer.setSeriesShapesVisible(1, false);\n\n// ChartFrame frame = new ChartFrame(\"First\", chart);\n// frame.pack();\n// frame.setVisible(true);\n\n\n jCheckBox1.setEnabled(true);\n jCheckBox1.setSelected(true);\n\n jCheckBox2.setEnabled(true);\n jCheckBox2.setSelected(false);\n\n jSlider1.setEnabled(true);\n jSlider2.setEnabled(true);\n\n jTextField9.setText(clip.getFileName());\n\n chartPanel = new ChartPanel(chart);\n }", "private XYDataset createSampleDataset(GradientDescent gd) {\n XYSeries predictedY = new XYSeries(\"Predicted Y\");\n XYSeries actualY = new XYSeries(\"Actual Y\");\n List<BigDecimal> xValues = gd.getInitialXValues();\n List<BigDecimal> yPred = gd.getPredictedY(xValues);\n List<BigDecimal> yActual = gd.getInitialYValues();\n for (int cont = 0; cont < xValues.size(); cont++){\n \tpredictedY.add(xValues.get(cont), yPred.get(cont));\n \tSystem.out.println(\"pred: \" + xValues.get(cont) + \", \" + yPred.get(cont));\n \tactualY.add(xValues.get(cont), yActual.get(cont));\n \tSystem.out.println(\"actual: \" + xValues.get(cont) + \", \" + yActual.get(cont));\n\t\t}\n XYSeriesCollection dataset = new XYSeriesCollection();\n dataset.addSeries(predictedY);\n dataset.addSeries(actualY);\n return dataset;\n }", "private BarData generateDataBar(int cnt) {\n\n ArrayList<BarEntry> entries = new ArrayList<BarEntry>();\n\n for (int i = 0; i < 12; i++) {\n entries.add(new BarEntry(i, (int) (Math.random() * 70) + 30));\n }\n\n BarDataSet d = new BarDataSet(entries, \"New DataSet \" + cnt);\n d.setColors(ColorTemplate.VORDIPLOM_COLORS);\n d.setHighLightAlpha(255);\n\n BarData cd = new BarData(d);\n cd.setBarWidth(0.9f);\n return cd;\n }", "public DatasetIndex(Dataset data){\n\t\tthis();\n\t\tfor(Iterator<Example> i=data.iterator();i.hasNext();){\n\t\t\taddExample(i.next());\n\t\t}\n\t}" ]
[ "0.65186065", "0.633837", "0.62506354", "0.61099076", "0.5944611", "0.58490235", "0.5823031", "0.5790686", "0.5777427", "0.57481533", "0.5715191", "0.57129395", "0.5661473", "0.5617056", "0.56163156", "0.56108683", "0.5576025", "0.55614954", "0.55612475", "0.55582845", "0.55411565", "0.5533169", "0.55108106", "0.5479269", "0.54785335", "0.5466865", "0.54664", "0.54491466", "0.5403835", "0.53982913", "0.5375682", "0.5367228", "0.5360909", "0.53566027", "0.5349946", "0.53337264", "0.5327028", "0.53164303", "0.5313288", "0.5281056", "0.52688915", "0.5251881", "0.52504283", "0.523831", "0.52347547", "0.5232612", "0.5216681", "0.5211441", "0.5192819", "0.519149", "0.5186187", "0.5180349", "0.5175774", "0.517181", "0.51683104", "0.5167093", "0.51601225", "0.5143535", "0.5139947", "0.5137266", "0.5124571", "0.51245075", "0.5118267", "0.51127625", "0.51122904", "0.5103505", "0.50969344", "0.5092902", "0.5092694", "0.50875884", "0.5085496", "0.50817156", "0.50808215", "0.50766736", "0.50739825", "0.5072636", "0.5066599", "0.50632983", "0.5056795", "0.50544846", "0.50506663", "0.5048256", "0.50430954", "0.5021021", "0.5013328", "0.50047624", "0.5001399", "0.49934754", "0.4991961", "0.4987324", "0.49813625", "0.49518847", "0.49464256", "0.4945895", "0.4942819", "0.49376154", "0.49354798", "0.49266556", "0.49236637", "0.4922678", "0.4918337" ]
0.0
-1
Sign Up button functionality
private void signupOnClickFunctionality(){ final TextView tvSign = findViewById(R.id.sign); tvSign.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent intent2 = new Intent(getApplicationContext(), signUp.class); startActivity(intent2); finish(); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void onSignUpClick() {\n\t\tString uid = regview.getUsername();\n\t\tString pw = regview.getPassword();\n\t\tString na = regview.getName();\n\t\tString em = regview.getEmail();\n\t\tString text = \"\";\n\t\tif(uid.equals(\"\") || pw.equals(\"\") || na.equals(\"\")|| em.equals(\"\")){\n\t\t\ttext = \"Please fill out all fields!\";\n\t\t} else if(regview.findUser(uid)!=User.NULL_USER){\n\t\t\ttext = \"The username already exsit, please try another one!\";\n\t\t} else {\n\t\t\tregview.addUser(new User(uid,pw,na,em));\n\t\t\tregview.goLoginPage();\n\t\t}\n\t\tregview.setRegisterText(text);\n\t}", "@Override\n public void onSignUpBtnClick() {\n }", "public void signUp() {\n presenter.signup(username.getText().toString(), password.getText().toString());\n }", "public void signup(){\n\t\tboolean result = SignUpForm.display(\"Chocolate Chiptunes - Sign Up\", \"Sign-Up Form\");\n\t\tSystem.out.println(result);\n\t}", "public void onClickSignUp(View view) {\r\n\t\tcheckRegistationValidation();\r\n\t}", "private void signUpEvt() {\n String emailRegex = \"(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\\\"(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x21\\\\x23-\\\\x5b\\\\x5d-\\\\x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x0b\\\\x0c\\\\x0e-\\\\x7f])*\\\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x21-\\\\x5a\\\\x53-\\\\x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x0b\\\\x0c\\\\x0e-\\\\x7f])+)\\\\])\";\n // Get User Details\n String fullname = this.view.getWelcomePanel().getSignUpPanel().getFullnameText().getText().trim();\n String email = this.view.getWelcomePanel().getSignUpPanel().getEmailText().getText().trim();\n String password = new String(this.view.getWelcomePanel().getSignUpPanel().getPasswordText().getPassword()).trim();\n\n if (!fullname.equals(\"\") && !email.equals(\"\") && !password.equals(\"\")) {\n if (email.matches(emailRegex)) {\n if (model.getSudokuDB().registerUser(fullname, email, password)) {\n view.getWelcomePanel().getCardLayoutManager().next(view.getWelcomePanel().getSlider());\n // Clear Fields\n view.getWelcomePanel().getSignUpPanel().clear();\n Object[] options = {\"OK\"};\n JOptionPane.showOptionDialog(this, \"Your registration was successful!\\n You can now sign in to your account.\", \"Successful Registration\", JOptionPane.OK_OPTION, JOptionPane.INFORMATION_MESSAGE, null, options, null);\n } else {\n Object[] options = {\"Let me try again\"};\n JOptionPane.showOptionDialog(this, \"Your registration was unsuccessful!\\nBe sure not to create a duplicate account.\", \"Unsuccessful Registration\", JOptionPane.OK_OPTION, JOptionPane.ERROR_MESSAGE, null, options, null);\n }\n } else {\n // Email doesn't meet requirement\n Object[] options = {\"I will correct that\"};\n JOptionPane.showOptionDialog(this, \"You must provide a valid email address.\", \"Invalid Email Address\", JOptionPane.OK_OPTION, JOptionPane.INFORMATION_MESSAGE, null, options, null);\n }\n } else {\n // Empty Fields\n Object[] options = {\"Alright\"};\n JOptionPane.showOptionDialog(this, \"In order to register, all fields must be filled out.\", \"Empty Fields\", JOptionPane.OK_OPTION, JOptionPane.INFORMATION_MESSAGE, null, options, null);\n }\n }", "private void initSignUpButton() {\n TextButton signUpButton = new TextButton(\"Sign up\", skin);\n signUpButton.setPosition(320, 125);\n signUpButton.addListener(new InputListener() {\n @Override\n public void touchUp(InputEvent event, float x, float y, int pointer, int button) {\n AuthService authService = new AuthService();\n RegistrationResponse response\n = authService.register(usernameField.getText(), passwordField.getText());\n switch (response) {\n case OCCUPIED_NAME:\n usernameTakenDialog();\n break;\n case SHORT_PASSWORD:\n passwordTooShortDialog();\n break;\n case SUCCESS:\n stateManager.setState(new LoginState(stateManager));\n break;\n default:\n }\n }\n\n @Override\n public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {\n System.out.println(\"pressed sign up\");\n return true;\n }\n });\n stage.addActor(signUpButton);\n }", "@Override\n public void onClick(View view) {\n final String username = usernameInput.getText().toString();\n final String password = passwordInput.getText().toString();\n final String email = emailInput.getText().toString();\n final String handle = handleInput.getText().toString();\n signup(username, password, email, handle);\n }", "@Override\n public void onClick(View v) {\n signUp();\n }", "public void signUp(View v) {\n attemptRegistration();\n }", "private void onSignUpPressed(View view) {\n Intent intent = new Intent(LoginActivity.this, CreateAccountActivity.class);\n startActivity(intent);\n }", "public signup() {\n initComponents();\n }", "public void onSignUpClicked() {\n loginView.startSignUpActivity();\n loginView.finishActivity();\n }", "public void onSignupClick(MouseEvent e){signup();}", "@Override\n public void getStartedSignUpClicked() {\n\n }", "void signUp(SignUpRequest signupRequest);", "@FXML protected void handleSignUpButtonAction() {\n \tboolean bexit = false;\n \tif(passwordField.getText().equals(passwordField2.getText()))\n \t{\n \t\t\n \t\tString signUpUsername = username.getText();\n \t\tString signUpPassword = passwordField.getText();\n \t\t\n if(username.getText().toString().length() >= 6 && passwordField.getText().toString().length() >= 6)\n {\n\t \t\tUser user = new User(signUpUsername, \"Unknown\", null, \"Unknown\", signUpPassword);\n\t \t\t\n\t \t\ttry {\n\t\t\t\t\tuser = client.createUser(user);\n\t \t\t\n\t \t\t} catch (WebApplicationException e) {\n\t \t\t\tLOGGER.log(Level.SEVERE, e.toString(), e);\n\t \t\t\tif (e.getResponse().getStatus() == 409) {\n\t \t\t\t\tactiontarget.setText(\"Sign up error: Username already exists\");\n\t \t\t\t} else {\n\t \t\t\t\t\n\t \t\t\t}\n\t \t\t\t\n\t \t\t} catch (JsonProcessingException e) {\n\t \t\t\tLOGGER.log(Level.SEVERE, e.toString(), e);\n\t\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLOGGER.log(Level.SEVERE, e.toString(), e);\n\t\t\t\t}\n\t \t\t\n\t \t\t// Go back to Login view\n\t \t\t\n\t \t\tLoginVistaNavigator.loadVista(LoginVistaNavigator.LOGIN);\n }\n else\n {\n \tactiontarget.setText(\"username/password \\nlength must be 6 number\");\n }\n \t}\n \telse\n \t{\n \t\tactiontarget.setText(\"password not consistent.\");\n \t}\n }", "private void signUp() {\n final String email = ((EditText) findViewById(R.id.etSignUpEmail))\n .getText().toString();\n final String password = ((EditText) findViewById(R.id.etSignUpPassword))\n .getText().toString();\n\n mAuth.createUserWithEmailAndPassword(email, password)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n Log.d(\"SIGN_UP_USER\", \"createUserWithEmail:success\");\n sendVerificationEmail(mAuth.getCurrentUser());\n updateUI();\n } else {\n Log.d(\"SIGN_UP_USER\", \"createUserWithEmail:failure\");\n Toast.makeText(LoginActivity.this,\n \"Failed to create a new user.\",\n Toast.LENGTH_LONG).show();\n }\n }\n });\n }", "@Override\n public void onSignUpClicked()\n {\n startActivity(new Intent(context, SignUpActivity.class));\n }", "public void signUp(View view) {\n InputMethodManager imm = (InputMethodManager) view.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);\n imm.hideSoftInputFromWindow(view.getWindowToken(), 0);\n boolean emailValid = isValidEmail(edtEmail);\n boolean pwdValid = isValidPassword(edtPaswd);\n boolean unameValid = isValidUsername(edtDisplayName);\n\n if (!unameValid) {\n edtDisplayName.requestFocus();\n } else if (!emailValid) {\n edtEmail.requestFocus();\n } else if (!pwdValid) {\n edtPaswd.requestFocus();\n }\n\n if (emailValid && pwdValid) {\n register();\n }\n }", "@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tif (!(API.isInternetOn(Register.this))) {\r\n\t\t\t\t\tshowAlert(\"Internet not avialble.\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tprogressdialog.setMessage(\"Please wait...\");\r\n\t\t\t\t\tprogressdialog.show();\r\n\t\t\t\t\t// Force user to fill up the form\r\n\t\t\t\t\tif (username.getText().toString().equals(\"\")\r\n\t\t\t\t\t\t\t|| email.getText().toString().equals(\"\")\r\n\t\t\t\t\t\t\t|| password.getText().toString().equals(\"\")\r\n\t\t\t\t\t\t\t|| verifyPassword.getText().toString().equals(\"\")) {\r\n\t\t\t\t\t\tprogressdialog.dismiss();\r\n\t\t\t\t\t\tshowAlert(\"Please complete the sign up form.\");\r\n\t\t\t\t\t} else if (!(isValidEmail(email.getText().toString()))) {\r\n\t\t\t\t\t\tprogressdialog.dismiss();\r\n\t\t\t\t\t\tshowAlert(\"Please enter valid email id.\");\r\n\t\t\t\t\t} else if (!(password.getText().toString()\r\n\t\t\t\t\t\t\t.equals(verifyPassword.getText().toString()))) {\r\n\t\t\t\t\t\tprogressdialog.dismiss();\r\n\t\t\t\t\t\tshowAlert(\"Password did not matched\");\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// Save new user data into Parse.com Data Storage\r\n\t\t\t\t\t\tParseUser user = new ParseUser();\r\n\t\t\t\t\t\tuser.setUsername(username.getText().toString());\r\n\t\t\t\t\t\tuser.setPassword(password.getText().toString());\r\n\t\t\t\t\t\tuser.setEmail(email.getText().toString());\r\n\t\t\t\t\t\tuser.signUpInBackground(new SignUpCallback() {\r\n\t\t\t\t\t\t\tpublic void done(ParseException e) {\r\n\t\t\t\t\t\t\t\tif (e == null) {\r\n\t\t\t\t\t\t\t\t\tAllowUserToLogin(username.getText()\r\n\t\t\t\t\t\t\t\t\t\t\t.toString(), password.getText()\r\n\t\t\t\t\t\t\t\t\t\t\t.toString());\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tprogressdialog.dismiss();\r\n\t\t\t\t\t\t\t\t\tToast.makeText(getApplicationContext(),\r\n\t\t\t\t\t\t\t\t\t\t\t\"Sign up Error\", Toast.LENGTH_LONG)\r\n\t\t\t\t\t\t\t\t\t\t\t.show();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}", "public void getSignUpButton() {\n mSignUpButton = (Button) mView.findViewById(R.id.accounts_sign_up_btn);\n mSignUpButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n createFirebaseAccountsUI();\n }\n });\n }", "@OnClick(R.id.buttonSignUp)\n void signUp()\n {\n if (from.equals(Keys.FROM_FIND_JOB)) {\n Intent intent = new Intent(this, LoginSignUpSeekerActivity.class);\n intent.putExtra(Keys.CLICKED_EVENT, Keys.CLICKED_EVENT_SIGNUP);\n startActivity(intent);\n overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);\n } else {\n Intent intent = new Intent(this, LoginSignUpRecruiterActivity.class);\n intent.putExtra(Keys.CLICKED_EVENT, Keys.CLICKED_EVENT_SIGNUP);\n startActivity(intent);\n overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);\n }\n }", "public SignUp() {\n Logger.log(\"SHOWING SIGN-UP PAGE\");\n\n displaySurnameFields();\n displayNameFields();\n displayNicknameFields();\n displayEmailFields();\n displayPasswordFields();\n displayConfirmPassword();\n displayBirthdayFields();\n displayCountryFields();\n\n displayBackButton();\n displaySubmitButton();\n\n setSceneMusic(\"pallet_town.mp3\");\n }", "public SignUp() {\n initComponents();\n }", "public SignUp() {\n initComponents();\n }", "@Override\r\n public void onClick(View view) {\r\n switch (view.getId()){\r\n case R.id.Signup:\r\n\r\n registerUser();\r\n\r\n break;\r\n }\r\n }", "public void signupPressed(View view) {\n // fetch the values\n usernameSignup = (EditText) findViewById(R.id.usernameSignupFragment);\n emailSignup = (EditText) findViewById(R.id.emailSignupFragment);\n passwordSignup = (EditText) findViewById(R.id.passwordSignupFragment);\n reenterPasswordSignup = (EditText) findViewById(R.id.reenterPasswordSignupFragment);\n\n String username = usernameSignup.getText().toString();\n String email = emailSignup.getText().toString();\n String password1 = passwordSignup.getText().toString();\n String password2 = reenterPasswordSignup.getText().toString();\n\n // input validation\n if (username.length() == 0) {\n Toast.makeText(getApplicationContext(), \"Please enter a username.\", Toast.LENGTH_SHORT).show();\n } else if (password1.length() == 0) {\n Toast.makeText(getApplicationContext(), \"Please enter a password.\", Toast.LENGTH_SHORT).show();\n } else if (!validatePassword(password1, password2)) {\n Toast.makeText(getApplicationContext(), \"Passwords do not match, try again.\", Toast.LENGTH_SHORT).show();\n } else if (!passwordLongEnough(password1)) {\n Toast.makeText(getApplicationContext(), \"Password too short - must be minimum 8 characters.\", Toast.LENGTH_SHORT).show();\n } else try {\n if (emailAlreadyExists(email)) {\n Toast.makeText(getApplicationContext(), \"Account already exists with this email.\", Toast.LENGTH_SHORT).show();\n } else if (!validateEmail(email)) {\n Toast.makeText(getApplicationContext(), \"Please enter a valid email.\", Toast.LENGTH_SHORT).show();\n } else try {\n if (!usernameAvailable(username)) {\n Toast.makeText(getApplicationContext(), \"Sorry, username already taken.\", Toast.LENGTH_SHORT).show();\n } else {\n // setup a user object with the given attributes, save and enter the app\n final TipperUser user = new TipperUser();\n user.setUsername(username);\n\n // hash password with salt\n String hashed = BCrypt.hashpw(password1, BCrypt.gensalt());\n user.setPassword(hashed);\n\n user.setEmail(email);\n user.setGoogleUser(false);\n user.setFacebookUser(false);\n user.setUuidString();\n\n user.save();\n app.setCurrentUser(user);\n user.pinInBackground();\n Intent intent = new Intent(getApplicationContext(), MainActivity.class);\n startActivity(intent);\n }\n } catch (ParseException e) {\n e.printStackTrace();\n }\n } catch (ParseException e) {\n e.printStackTrace();\n }\n }", "@Override\n\t\tpublic void onClick(View v) {\n\t\t\tlaunchSignUpDialog();\n\t\t}", "public Signup() {\n initComponents();\n }", "public void signUpClicked(View view) {\n setContentView(R.layout.activity_register);\n System.out.println(\"sign up clicked\");\n }", "private void signUpActivity() {\n mSignUpButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n Intent registerActivity = new Intent(LoginActivity.this, RegisterActivity.class);\n startActivity(registerActivity);\n }\n });\n }", "public Result showSignUp() {\n return ok(signupView.render(data().build(), signUpForm));\n }", "public void signupPressed(View view) {\n startActivity(new Intent(this, Signup.class));\n }", "boolean signUp(User user);", "private void SignUp(String email, String password) {\n if (TextUtils.isEmpty(email) || TextUtils.isEmpty(password) ) {\n\n }else {\n msignInDialog.setTitle(\"Creating New User\");\n msignInDialog.setMessage(\"Please wait while DevChat creates your new Account...\");\n msignInDialog.setCanceledOnTouchOutside(false);\n msignInDialog.show();\n mAuth.createUserWithEmailAndPassword(email, password)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n Toast.makeText(ActivityRegister.this, \"User Account Created!\", Toast.LENGTH_SHORT).show();\n createUser(et_username.getText().toString());\n msignInDialog.dismiss();\n Intent chatBoxIntent = new Intent(ActivityRegister.this, Chatbox_Activity.class);\n Bundle bundle = new Bundle();\n bundle.putStringArray(\"values\", values);\n chatBoxIntent.putExtras(bundle);\n startActivity(chatBoxIntent);\n } else {\n msignInDialog.dismiss();\n Toast.makeText(ActivityRegister.this, \"Error Creating New User Account!\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n }\n }", "public void signup(View view) {\n Intent intent = new Intent(this, SignupActivity.class);\n startActivity(intent);\n }", "public Sign_up() {\n initComponents();\n }", "private void signup() {\n\t\tSignupFragment newFragment = new SignupFragment();\t\t\t\t\t\n\t\t\n\t\t// if the username doesn't exist, load the signup fragment\n\t\tFragmentTransaction transaction = getActivity().getSupportFragmentManager().beginTransaction();\n\n\t\t// Replace whatever is in the fragment_container view with this fragment,\n\t\t// and add the transaction to the back stack so the user can navigate back\n\t\ttransaction.replace(R.id.fragment_container, newFragment);\n\t\ttransaction.addToBackStack(null);\n\n\t\t// Commit the transaction\n\t\ttransaction.commit();\n\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tIntent i = new Intent(getApplicationContext(), Signup.class);\n\t\t\t\tstartActivity(i);\n\n\n\t\t\t}", "public void onSignupSuccess(){\n Toast.makeText(this, \"YEPP\", Toast.LENGTH_SHORT).show();\r\n Intent changetomain = new Intent(RegisterActivity.this, MainAccount.class) ;\r\n startActivity(changetomain);\r\n }", "private void checkToSignup() {\n toolbar.setTitle(R.string.about);\n Intent intent = new Intent(this, SigninActivity.class);\n startActivityForResult(intent, ConstantValue.SIGN_UP_CODE);\n }", "public sign_up_page() {\n initComponents();\n }", "public void signUp(View view) {\r\n\t\tIntent intent = new Intent(this, SignupActivity.class);\r\n\t\tstartActivity(intent);\r\n\t}", "public void signUp(View v){\n Toast.makeText(this,\"Signing up\", Toast.LENGTH_SHORT).show();\n Intent intent = new Intent(MainActivity.this, SignUpActivity.class);\n startActivity(intent);\n }", "private void signUp() {\n if (mAuthTask != null) {\n return;\n }\n\n // Reset errors.\n mEmailView.setError(null);\n mPasswordView.setError(null);\n\n // Store values at the time of the login attempt.\n String email = mEmailView.getText().toString();\n String password = mPasswordView.getText().toString();\n\n boolean cancel = false;\n View focusView = null;\n\n // Check for a valid password, if the user entered one.\n if (!TextUtils.isEmpty(password) && !isPasswordValid(password)) {\n mPasswordView.setError(getString(R.string.error_invalid_password));\n focusView = mPasswordView;\n cancel = true;\n }\n\n // Check for a valid email address.\n if (TextUtils.isEmpty(email)) {\n mEmailView.setError(getString(R.string.error_field_required));\n focusView = mEmailView;\n cancel = true;\n } else if (!isEmailValid(email)) {\n mEmailView.setError(getString(R.string.error_invalid_email));\n focusView = mEmailView;\n cancel = true;\n }\n\n if (cancel) {\n // There was an error; don't attempt login and focus the first\n // form field with an error.\n focusView.requestFocus();\n } else {\n // Show a progress spinner, and kick off a background task to\n // perform the user login attempt.\n showProgress(true);\n mAuthTask = new UserLoginTask(email, password, true);\n mAuthTask.execute((Void) null);\n }\n }", "@Override\n public void onClick(View view) {\n loadSignUpView();\n }", "void onSignUpEmailRegistered();", "@Override\n public void onClick(View view) {\n registerUser();\n }", "public Sign_Up() {\n initComponents();\n }", "@Override\n public void onClick(View v) {\n Intent intent = new Intent(getApplicationContext(), signup.class);\n startActivityForResult(intent, REQUEST_SIGNUP);\n }", "public void signUP(View view) {\n // Do something in response to button\n Intent intent = new Intent(MainActivity.this, SignUpActivity.class);\n startActivity(intent);\n }", "public void signup(View view){\r\n if(editText1.getText().toString().isEmpty()||editText2.getText().toString().isEmpty()||editText3.getText().toString().isEmpty()\r\n ||editText4.getText().toString().isEmpty()||editText5.getText().toString().isEmpty()){\r\n Toast.makeText(this, \"Παρακαλώ εισάγετε όλα τα απαραίτητα πεδία προκειμένου να εγγραφείτε.\", Toast.LENGTH_SHORT).show();\r\n }\r\n else{\r\n mAuth.createUserWithEmailAndPassword(editText1.getText().toString(), editText2.getText().toString())\r\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\r\n @Override\r\n public void onComplete(@NonNull Task<AuthResult> task) {\r\n\r\n if (task.isSuccessful()) {\r\n new_user = mAuth.getCurrentUser();\r\n create_users_list(new_user.getUid());\r\n String userid=new_user.getUid();\r\n String firstname=editText3.getText().toString();\r\n String lastname=editText4.getText().toString();\r\n String address=editText5.getText().toString();\r\n SharedPreferences.Editor editor=pref.edit();\r\n editor.putString(userid+\"firstname\",firstname);\r\n editor.putString(userid+\"lastname\",lastname);\r\n editor.putString(userid+\"address\",address);\r\n editor.apply();\r\n Intent intent = new Intent(getApplicationContext(), MainActivity3.class);\r\n intent.putExtra(\"userid\", new_user.getUid());\r\n\r\n startActivity(intent);\r\n\r\n\r\n } else {\r\n Toast.makeText(getApplicationContext(), task.getException().getMessage(),\r\n Toast.LENGTH_SHORT).show();\r\n\r\n }\r\n }\r\n }\r\n );}}", "public void signup() {\n Log.d(TAG, \"Signup\");\n\n if (!validate()) {\n onSignupFailed();\n return;\n }\n\n createProgressDialog(R.string.creating_account);\n\n final String name = _nameText.getText().toString();\n final String email = _emailText.getText().toString();\n final String password = _passwordText.getText().toString();\n\n mAuth.createUserWithEmailAndPassword(email, password)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n Log.d(TAG, \"createUserWithEmail:onComplete:\" + task.isSuccessful());\n\n // If sign in fails, display a message to the user. If sign in succeeds\n // the auth state listener will be notified and logic to handle the\n // signed in user can be handled in the listener.\n if (!task.isSuccessful()) {\n createToast(R.string.authentication_failed, Toast.LENGTH_SHORT);\n } else {\n progressDialog.dismiss();\n final FirebaseUser user = mAuth.getCurrentUser();\n mDatabase.child(\"users\").child(user.getUid()).addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n if (dataSnapshot.getValue() == null) {\n createUserInFirebase(name, email, user.getUid());\n }\n }\n @Override\n public void onCancelled(DatabaseError databaseError) {\n\n }\n });\n sendToTrivia();\n }\n\n }\n });\n\n\n new android.os.Handler().postDelayed(\n new Runnable() {\n public void run() {\n // On complete call either onSignupSuccess or onSignupFailed\n // depending on success\n progressDialog.dismiss();\n }\n }, 3000);\n }", "private void registerUser()\n {\n /*AuthService.createAccount takes a Consumer<Boolean> where the result will be true if the user successfully logged in, or false otherwise*/\n authService.createAccount(entryService.extractText(namedFields), result -> {\n if (result.isEmpty()) {\n startActivity(new Intent(this, DashboardActivity.class));\n } else {\n makeToast(result);\n formContainer.setAlpha(1f);\n progressContainer.setVisibility(View.GONE);\n progressContainer.setOnClickListener(null);\n }\n });\n }", "private final static void onRegister(TextField username, TextField email, PasswordField password, PasswordField passwordAgain)\n\t{\n\t\t// TODO no password = passwordAgain check\n\t\t// TODO check if username exists\n\t\t// TODO check if email exists\n\n\t\tint id = ProfileManipulation.getHighestId(\"Profile\", true);\n\t\tProfileManipulation.registerUser(id, username.getText(), email.getText(),\n\t\t\t\tpassword.getText());\n\t\tPartylize.setUsername(username.getText());\n\t\tPartylize.showMainScene();\n\t}", "@OnClick(R.id.fragment_register_sign_up_button)\n public void validateSignupInformation() {\n mValidator.validate();\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tString username = etUsername.getText().toString();\n\t\t\t\tString pwd = etPassword.getText().toString();\n\t\t\t\tString pwd1 = etPassword1.getText().toString();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif (TextUtils.isEmpty(etUsername.getText())) {\n\t\t\t\t\tToast.makeText(RegisterActivity.this, \"Username cannot be empty!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(TextUtils.isEmpty(etPassword.getText()) || TextUtils.isEmpty(etPassword1.getText())){\n\t\t\t\t\tToast.makeText(RegisterActivity.this, \"Password cannot be empty!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!pwd.equals(pwd1)){\n\t\t\t\t\tToast.makeText(RegisterActivity.this, \"Password should be the same!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tUser user = new User(username, pwd);\n\t\t\t\t\n\t\t\t\tnew Register(user, RegisterActivity.this, new Register.SuccessCallBack() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onSuccess() {\n\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\tToast.makeText(RegisterActivity.this,\"Sign up successfully!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\tstartActivity(new Intent(RegisterActivity.this, LoginActivity.class));\n\t\t\t\t\t}\n\t\t\t\t}, new Register.FailCallBack() {\n\t\t\t\t\t\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onFail() {\n\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\tToast.makeText(RegisterActivity.this, \"Username already exists!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}", "public SignUp() {\n PageFactory.initElements(webDriver, this);\n }", "public void onSignupClickedListener(View view) {\n\n Intent intent = new Intent(this, PersonalAccountActivity.class);\n startActivity(intent);\n }", "public void clickSignUpFromATemplate() {\n\t\tselenium.clickByXpath(signUp);\n\t}", "void signUpAttempt(String email, String password, String firstName, String lastName);", "@Override\n public void onClick(View v) {\n firstName = etFirstName.getText().toString().trim();\n lastName = etLastName.getText().toString().trim();\n username = etUsername.getText().toString().trim();\n password = etPassword.getText().toString().trim();\n confirmPassword = etConfirmPassword.getText().toString().trim();\n email = etEmail.getText().toString().trim();\n major=etMajor.getText().toString().trim();\n university=etUniversity.getText().toString().trim();\n isTutor = tutorCheckBox.isChecked();\n\n if (validateInputs()) {\n registerUser();\n }\n\n }", "@Override\n public void onClick(View v) {\n firstNameText = capitalizeFirstLetter(firstNameET.getText().toString());\n lastNameText = capitalizeFirstLetter(lastNameET.getText().toString());\n emailText = (emailET.getText().toString()).toLowerCase();\n passwordText = passwordET.getText().toString();\n reEnterPasswordText = reEnterPasswordET.getText().toString();\n\n // Using the user-inputted information to register the user via this method\n registerUser(firstNameText, lastNameText, emailText, passwordText, reEnterPasswordText);\n }", "@Override\n\tpublic void gotoSignUp() {\n\t\tgetFragmentManager().beginTransaction()\n\t\t\t\t.replace(R.id.container, new SignUpFragment(), \"signup\")\n\t\t\t\t.commit();\n\n\t}", "public SignUP() {\n initComponents();\n }", "public void UserSignUp(View view)\n {\n // get the data from text fields\n inputName = ((EditText) findViewById(R.id.signUpEditTextName)).getText().toString();\n inputEmail = ((EditText) findViewById(R.id.signUpEditTextEmail)).getText().toString();\n inputPhoneNumber = ((EditText) findViewById(R.id.signUpEditTextPhoneNumber)).getText().toString();\n inputPassword = ((EditText) findViewById(R.id.signUpEditTextPassword)).getText().toString();\n inputRepeatPassword = ((EditText) (findViewById(R.id.signUpEditTextRepeatPassword))).getText().toString();\n\n // If some text fields are empty\n if(inputName.equals(\"\") || inputEmail.equals(\"\") || inputPhoneNumber.equals(\"\")\n || inputPassword.equals(\"\") || inputRepeatPassword.equals(\"\")) {\n Toast.makeText(SignUpActivity.this, \"All fields are required!\", Toast.LENGTH_LONG).show();\n finish();\n startActivity(getIntent());\n }\n // if password and repeat password are matched\n else if(inputPassword.compareTo(inputRepeatPassword) == 0) {\n // if there is internet connection\n if (CheckNetworkConnection.checknetwork(getApplicationContext()))\n new CreateNewUser().execute();\n else\n Toast.makeText(SignUpActivity.this, \"No Internet Connection!\", Toast.LENGTH_LONG).show();\n }\n // if password and repeat password do not matched\n else {\n Toast.makeText(SignUpActivity.this, \"Passwords do not match!\", Toast.LENGTH_LONG).show();\n finish();\n startActivity(getIntent());\n }\n\n }", "@Override\n public void onClick(View view) {\n registerUser();\n\n\n }", "public void onClick_AGSU_signUp(View view) {\n AnimationTools.startLoadingAnimation(Constants.ANIMATION_CODE_AGSU_LOADING, this, signUpButton_rootLayout, R.style.AGSU_loading_progress_bar);\n\n FirestoreManager.saveUserData(SecondarySignUpManager.getDatabaseUser());\n\n //add a password-email auth method\n AuthCredential credential = EmailAuthProvider.getCredential(SecondarySignUpManager.getDatabaseUser().getEmail(), SecondarySignUpManager.getDatabaseUser().getPassword());\n AuthenticationManager.getCurrentUser().linkWithCredential(credential).addOnCompleteListener(new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if(task.isSuccessful()) {\n System.out.println(\"[Neuron.SecondarySignUpActivity.onClick_AGSU_signUp]: link with email credential SUCCESSFUL! User uid = \" + task.getResult().getUser().getDisplayName());\n Constants.isSignUpInProcess = false; //sign up is now finished\n\n //in AGSU user is always new --> send verification email\n EmailVerification.sendVerificationEmail();\n\n Constants.isSecondarySignUpInProcess = false; //end of secondary sign up process\n\n ActivityTools.startNewActivity(activityContext, MainActivity.class);\n } else {\n System.err.println(\"[Neuron.SecondarySignUpActivity.onClick_AGSU_signUp]: ERROR: link with email credential FAILED! \" + task.getException().getMessage());\n }\n\n AnimationTools.stopLoadingAnimation(Constants.ANIMATION_CODE_AGSU_LOADING);\n }\n });\n\n }", "@Override\n public void onClick(View v) {\n setFragment(new SignUpFragment());\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}", "void register() {\n if (registerView.getFirstName().length() == 0 || registerView.getLastName().length() == 0 || registerView.getUsername().length() == 0 || registerView.getPassword().length() == 0) {\n IDialog invalidRegistrationDialog\n = dialogFactory.createDialog(DialogFactoryOptions.dialogNames.MESSAGE, new HashMap<String, Object>() {\n {\n put(\"message\", \"Unable to register: Fields must be non-empty!\");\n put(\"title\", \"Authentication Error\");\n put(\"messageType\", DialogFactoryOptions.dialogType.ERROR);\n }\n });\n\n invalidRegistrationDialog.run();\n } else {\n if (userController.registerUser(registerView.getFirstName(), registerView.getLastName(), registerView.getUsername(), registerView.getPassword()) != null) {\n mainFrame.setPanel(panelFactory.createPanel(PanelFactoryOptions.panelNames.MAIN_MENU));\n } else {\n IDialog invalidRegistrationDialog = dialogFactory.createDialog(DialogFactoryOptions.dialogNames.MESSAGE, new HashMap<String, Object>() {\n {\n put(\"message\", \"Unable to register: Username is already taken\");\n put(\"title\", \"Authentication Error\");\n put(\"messageType\", DialogFactoryOptions.dialogType.ERROR);\n }\n });\n\n invalidRegistrationDialog.run();\n }\n }\n }", "public int signUp(String email_address, String email_password, String first_name, String last_name)\r\n\t{\r\n\t\ttry \r\n\t\t{\r\n\t\t\tString query = \"insert into users values (?, ?, ?, ?)\";\r\n\t\t\tpreparedStatement = connect.prepareStatement(query);\r\n\t\t\t\r\n\t\t\t/*\r\n\t\t\t * variables here replaces the question marks in the query\r\n\t\t\t * the numbers before the variables denote what question mark is the variable supposed to replace\r\n\t\t\t * the numbers start at 1 compared to starting at 0\r\n\t\t\t */\r\n\t\t\tpreparedStatement.setString(1, email_address);\r\n\t\t\tpreparedStatement.setString(2, email_password);\r\n\t\t\tpreparedStatement.setString(3, first_name);\r\n\t\t\tpreparedStatement.setString(4, last_name);\r\n\t\t\tpreparedStatement.execute();\t//execute the query above\r\n\t\t\t\r\n\t\t\t/*\r\n\t\t\t * Created an object array which only contains the value of the button to be used in the popup message\r\n\t\t\t * the popup message displays upon successfully registering a user\r\n\t\t\t */\r\n\t\t\tObject[] options = {\"OK\"};\r\n\t\t\tint temp = JOptionPane.showOptionDialog(null, \"You are now registered\", \"Registration\", JOptionPane.OK_OPTION, JOptionPane.INFORMATION_MESSAGE, null, options, options[0]);\r\n\t\t\treturn temp;\r\n\t\t} \r\n\t\tcatch (Exception e) \r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn 0;\r\n\t}", "private void registration() {\n\t\tif (ur_name.getText().length() > 0 && email.getText().length() > 0\r\n\t\t\t\t&& pass.getText().length() > 0\r\n\t\t\t\t&& re_pass.getText().length() > 0) {\r\n\t\t\tif (pass.getText().toString()\r\n\t\t\t\t\t.equalsIgnoreCase(re_pass.getText().toString())) {\r\n\t\t\t\tString postEntity = \"user_name=\" + ur_name.getText().toString()\r\n\t\t\t\t\t\t+ \"&email=\" + email.getText().toString() + \"&password=\"\r\n\t\t\t\t\t\t+ pass.getText().toString() + \"&gcm_id=\"\r\n\t\t\t\t\t\t+ GlobalDeclares.getGcmId();\r\n\t\t\t\tnew ServerUtilities(getApplicationContext(),\r\n\t\t\t\t\t\tGlobalDeclares.NEW_REGISTRATION, postEntity, delegate);\r\n\r\n\t\t\t} else {\r\n\t\t\t\tToast.makeText(getApplicationContext(),\r\n\t\t\t\t\t\t\"Password does not match!\", Toast.LENGTH_LONG).show();\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\tToast.makeText(getApplicationContext(),\r\n\t\t\t\t\t\"You need to fill all the fields!\", Toast.LENGTH_LONG)\r\n\t\t\t\t\t.show();\r\n\t\t}\r\n\r\n\t}", "@Override\r\n\tpublic void onCreate(Bundle savedInstanceState) {\r\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tsetContentView(R.layout.activity_signup);\r\n\r\n\t\t// ENETER BUTTON : Match both the password fields\r\n\t\tButton enterButton = (Button) findViewById(R.id.SignUp_ButtonEnter);\r\n\t\tenterButton.setOnClickListener(new OnClickListener() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onClick(View v) {\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tfinal EditText emailField = (EditText) findViewById(R.id.SignUp_EditTextEmail);\r\n\t\t\t\tString mail_ID = emailField.getText().toString();\r\n\t\t\t\t\r\n\t\t\t\tif (mail_ID.length() == 0) {\r\n\r\n\t\t\t\t\tAlertDialog.Builder alertDialog = new AlertDialog.Builder(\r\n\t\t\t\t\t\t\tSignUpActivity.this);\r\n\t\t\t\t\talertDialog.setTitle(\" User Alert !\");\r\n\t\t\t\t\talertDialog\r\n\t\t\t\t\t\t\t.setMessage(\"Please Enter Valid Username!!!\");\r\n\t\t\t\t\talertDialog.setPositiveButton(\"OK\",\r\n\t\t\t\t\t\t\tnew DialogInterface.OnClickListener() {\r\n\t\t\t\t\t\t\t\tpublic void onClick(DialogInterface dialog,\r\n\t\t\t\t\t\t\t\t\t\tint id) {\r\n\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\talertDialog.show();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (scm.isConnected()) {\r\n\t\t\t\t\t((Button) findViewById(R.id.SignUp_ButtonEnter)).setEnabled(false);\r\n\t\t\t\t\tscm.CreateNewUser(mail_ID);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tAlertDialog.Builder alertDialog = new AlertDialog.Builder(\r\n\t\t\t\t\t\t\tSignUpActivity.this);\r\n\t\t\t\t\talertDialog.setTitle(\" User Alert !\");\r\n\t\t\t\t\talertDialog\r\n\t\t\t\t\t\t\t.setMessage(\"Sorry, Not connect to server yet.\");\r\n\t\t\t\t\talertDialog.setPositiveButton(\"OK\",\r\n\t\t\t\t\t\t\tnew DialogInterface.OnClickListener() {\r\n\t\t\t\t\t\t\t\tpublic void onClick(DialogInterface dialog,\r\n\t\t\t\t\t\t\t\t\t\tint id) {\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\talertDialog.show();\t\t\t\t\t\r\n\t\t\t\t}\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\r\n\t\t// CANCEL BUTTON : Finish the Current Activity\r\n\t\tButton cancelButton = (Button) findViewById(R.id.SignUp_ButtonCancel);\r\n\t\tcancelButton.setOnClickListener(new OnClickListener() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onClick(View v) {\r\n\t\t\t\tIntent intent = new Intent();\r\n\t\t\t\tintent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\r\n\t\t\t\tfinish();\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t// TODO Auto-generated method stub\r\n\t}", "public void register(View view) {\n if(radioGroup.getCheckedRadioButtonId() == -1){\n Snackbar.make(getCurrentFocus(),\"Please select one of the Options: Student or Professor\",Snackbar.LENGTH_LONG).show();\n return;\n }\n if (usn.getText().toString().trim().equals(\"\")){\n usn.setError(\"This field cannot be empty\");\n return;\n } else if (password.getText().toString().trim().equals(\"\")){\n password.setError(\"This field cannot be empty\");\n return;\n } else if(password.getText().toString().trim().length() < 8){\n password.setError(\"Password too short.\");\n return;\n } else if(confirmPassword.getText().toString().trim().equals(\"\")){\n confirmPassword.setError(\"This field cannot be empty\");\n return;\n } else if(!(password.getText().toString().trim()\n .equals(confirmPassword.getText().toString().trim()))){\n password.setError(\"Passwords do not match\");\n confirmPassword.setError(\"Passwords do not match\");\n return;\n }\n progressBar.setVisibility(View.VISIBLE);\n mAuth.signInAnonymously().addOnSuccessListener(authResult -> myRef.child(usn.getText().toString().trim()).addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n try {\n String username = dataSnapshot.child(\"emailId\").getValue().toString();\n String password = confirmPassword.getText().toString().trim();\n System.out.println(username);\n mAuth.createUserWithEmailAndPassword(username,password)\n .addOnCompleteListener(RegisterActivity.this,task -> {\n Log.d(\"TAG\",\"Created User:\"+task.isSuccessful());\n if(!task.isSuccessful()){\n Toast.makeText(RegisterActivity.this, \"Error occurred.\" +\n \" Could not create user. Please \" +\n \"check your internet connection\", Toast.LENGTH_LONG).show();\n return;\n }\n else {\n startActivity(new Intent(RegisterActivity.this,LoginActivity.class));\n finish();\n }\n });\n\n }catch (NullPointerException e){\n usn.setError(\"Invalid USN. Please check your input or contact\" +\n \" your department for help\");\n progressBar.setVisibility(View.INVISIBLE);\n }\n }\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n\n }\n }))\n .addOnFailureListener(e -> {\n progressBar.setVisibility(View.INVISIBLE);\n Snackbar.make(view,\"Something went wrong.Please check if you have an internet connection or that the details\" +\n \"entered are valid\",Snackbar.LENGTH_LONG).show();\n });\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tString nameS = name.getText().toString();\n\t\t\t\tif (nameS.equals(\"\")) {\n\t\t\t\t\tToast.makeText(RegisterActivity.this, \"用户名不可为空\",\n\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tString passOne = password.getText().toString();\n\t\t\t\tString passTwo = surePassword.getText().toString();\n\t\t\t\tif (!passOne.equals(passTwo)) {\n\t\t\t\t\tToast.makeText(RegisterActivity.this, \"密码不一致\",\n\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tMap<String, String> xml = new HashMap<String, String>();\n\t\t\t\txml.put(\"head\", \"register\");\n\t\t\t\txml.put(\"username\", nameS);\n\t\t\t\txml.put(\"password\", passOne);\n\t\t\t\tUserRegister reg = new UserRegister(getApplicationContext(),\n\t\t\t\t\t\thandler);\n\t\t\t\treg.register(xml);\n\t\t\t}", "@Override\n public void onSignUpClicked(String username, String password) {\n \tFragmentTransaction transaction = getSupportFragmentManager().beginTransaction();\n \ttransaction.replace(fragmentContainer, new ParseSignupFragment());\n \ttransaction.addToBackStack(null);\n \ttransaction.commit();\n }", "public static void signup() throws Exception{\n\t\trender();\n\t}", "public void onClick(View view) {\n if(validate_info()){\n create_user();\n user = FirebaseAuth.getInstance().getCurrentUser();\n if (user != null) {\n submit_profile(user);\n }\n }\n else{\n return;\n\n\n }\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tEditText emailText = (EditText)findViewById(R.id.reg_email);\n\t\t\t\tEditText firstNameText = (EditText)findViewById(R.id.reg_first_name);\n\t\t\t\tEditText lastNameText = (EditText)findViewById(R.id.reg_last_name);\n\t\t\t\tEditText userNameText = (EditText)findViewById(R.id.reg_username);\n\t\t\t\tEditText passwordText = (EditText)findViewById(R.id.reg_password);\n\t\t\t\tEditText phoneNumberText = (EditText)findViewById(R.id.reg_phone);\n\t\t\t\t\n\t\t\t\tregister(firstNameText.getText().toString(), lastNameText.getText().toString(), userNameText.getText().toString(), passwordText.getText().toString(), emailText.getText().toString(), phoneNumberText.getText().toString());\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}", "void onSignInButtonClicked();", "private void attemptSignup()\n\t{\n\t\t// Reset errors.\n\t\tmEmailView.setError(null);\n\t\tmPasswordView.setError(null);\n\n\t\t_signupButton.setEnabled(false);\n\n\t\t// Store values at the time of the login attempt.\n\t\tfinal String displayName = mNameView.getText().toString();\n\t\tString email = mEmailView.getText().toString();\n\t\tString password = mPasswordView.getText().toString();\n\n\t\tboolean cancel = false;\n\t\tView focusView = null;\n\n\t\t// Check for a valid password, if the user entered one.\n\t\tif (TextUtils.isEmpty(password))\n\t\t{\n\t\t\tmPasswordView.setError(getString(R.string.error_field_required));\n\t\t\tfocusView = mPasswordView;\n\t\t\tcancel = true;\n\t\t}\n\t\telse if (!isPasswordValid(password))\n\t\t{\n\t\t\tmPasswordView.setError(getString(R.string.error_invalid_password));\n\t\t\tfocusView = mPasswordView;\n\t\t\tcancel = true;\n\t\t}\n\n\t\t// Check for a valid email address.\n\t\tif (TextUtils.isEmpty(email))\n\t\t{\n\t\t\tmEmailView.setError(getString(R.string.error_field_required));\n\t\t\tfocusView = mEmailView;\n\t\t\tcancel = true;\n\t\t}\n\t\telse if (!isEmailFormatValid(email))\n\t\t{\n\t\t\tmEmailView.setError(getString(R.string.error_invalid_email));\n\t\t\tfocusView = mEmailView;\n\t\t\tcancel = true;\n\t\t}\n\n\t\t//Check for a valid display name\n\t\tif (displayName.isEmpty())\n\t\t{\n\t\t\tmNameView.setError(getString(R.string.error_field_required));\n\t\t\tfocusView = mNameView;\n\t\t\tcancel = true;\n\t\t}\n\n\t\tif (cancel)\n\t\t{\n\t\t\t// There was an error; don't attempt login and focus the first\n\t\t\t// form field with an error.\n\t\t\tfocusView.requestFocus();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//[START init_progress_dialog]\n\t\t\tfinal ProgressDialog progressDialog = new ProgressDialog(SignupPersonalActivity.this,\n\t\t\t\t\tR.style.AppTheme_Dark_Dialog);\n\t\t\tprogressDialog.setIndeterminate(true);\n\t\t\tprogressDialog.setMessage(\"Creating Account...\");\n\t\t\tprogressDialog.show();\n\t\t\t//[END init_progress_dialog]\n\t\t\tmAuth.createUserWithEmailAndPassword(email, password)\n\t\t\t\t\t.addOnCompleteListener(this, new OnCompleteListener<AuthResult>()\n\t\t\t\t\t{\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void onComplete(@NonNull Task<AuthResult> task)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (task.isSuccessful())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tonSignUpSuccess(displayName);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tonSignUpFailed();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// [START_EXCLUDE]\n\t\t\t\t\t\t\tprogressDialog.dismiss();\n\t\t\t\t\t\t\t// [END_EXCLUDE]\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t}\n\t}", "public void onClickcreateUserSignup(View view){\n\n String newName = ((EditText)findViewById(R.id.createUserUsername)).getText().toString();\n if(!newName.equals(\"\")) {\n Account.getInstance().setName(newName);\n\n SharedPreferences settings = getSharedPreferences(Utils.ACCOUNT_PREFS, 0);\n SharedPreferences.Editor editor = settings.edit();\n editor.putString(\"accountName\", newName);\n editor.commit();\n\n startActivity(new Intent(this, MainActivity.class));\n }\n }", "@Override\n public void onClick(View v) {\n Intent intent = new Intent(getApplicationContext(), SignupActivity.class);\n startActivity(intent);\n }", "@Override\n public void getStartedClicked() {\n startSignUpFragment();\n\n }", "private void signup(final String email, String password) {\n firebaseAuth.createUserWithEmailAndPassword(email, password).addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if(task.isSuccessful()) {\n databaseRef.child(firebaseAuth.getCurrentUser().getUid()).child(\"email\").setValue(email);\n startActivity(new Intent(getBaseContext(), ShoppingActivity.class));\n setResult(1);\n finish();\n } else {\n alert(task.getException().getMessage());\n }\n }\n });\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n firebaseAuth = FirebaseAuth.getInstance();\n\n View rootview = inflater.inflate(R.layout.signup, container, false);\n\n signupbutton = rootview.findViewById(R.id.button1);\n\n editTextemail = rootview.findViewById(R.id.emailID);\n editTextpersonName = rootview.findViewById(R.id.personName);\n editTextpassword= rootview.findViewById(R.id.password);\n\n\n View.OnClickListener mListener1 = new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n\n\n UserSignup();\n }\n };\n signupbutton.setOnClickListener(mListener1);\n\n\n\n return rootview;\n\n }", "private void onSignupSuccess() {\n startActivity(currentActivity, UserLoginActivity.class);\n finish();\n }", "private void configureSignup() {\n\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestIdToken(this.getResources().getString(R.string.web_client_id))\n .requestEmail().build();\n\n // Build a GoogleApiClient with access to GoogleSignIn.API and the options above.\n mGoogleApiClient = new GoogleApiClient.Builder(this)\n .enableAutoManage(this /* FragmentActivity */, this /* OnConnectionFailedListener */)\n .addApi(Auth.GOOGLE_SIGN_IN_API, gso)\n .build();\n\n\n mGoogleApiClient.connect();\n }", "void onSignInButtonClicked(String userEmail, String userPassword);", "@Override\n public void onValidationSucceeded() {\n String email = mEmailField.getText().toString();\n String firstName = mFirstNameField.getText().toString();\n String lastName = mLastNameField.getText().toString();\n String password = mPasswordField.getText().toString();\n\n mSignUpInterface.onSignup(email, firstName, lastName, password);\n }", "private void registerUser() {\n\n // Get register name\n EditText mRegisterNameField = (EditText) findViewById(R.id.register_name_field);\n String nickname = mRegisterNameField.getText().toString();\n\n // Get register email\n EditText mRegisterEmailField = (EditText) findViewById(R.id.register_email_field);\n String email = mRegisterEmailField.getText().toString();\n\n // Get register password\n EditText mRegisterPasswordField = (EditText) findViewById(R.id.register_password_field);\n String password = mRegisterPasswordField.getText().toString();\n\n AccountCredentials credentials = new AccountCredentials(email, password);\n credentials.setNickname(nickname);\n\n if (DataHolder.getInstance().isAnonymous()) {\n credentials.setOldUsername(DataHolder.getInstance().getUser().getUsername());\n }\n\n sendRegistrationRequest(credentials);\n }", "boolean hasSignupRequest();", "@Then(\"^Click on signup button$\")\t\t\t\t\t\n public void Click_on_signup_button() throws Throwable \t\t\t\t\t\t\t\n { \n \tdriver.findElement(By.xpath(\"//*[@id='accountDetailsNext']/content/span\")).click();\n driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\t\t\t\t\n }", "private void attemptSignUp() {\n // Reset errors.\n mName.setError(null);\n\n boolean cancel = false;\n View focusView = null;\n\n // Check for a valid password, if the user entered one.\n if (TextUtils.isEmpty(mName.getText().toString())) {\n mName.setError(getString(R.string.error_field_required));\n focusView = mName;\n cancel = true;\n }\n\n if (cancel) {\n // There was an error; don't attempt login and focus the first\n // form field with an error.\n focusView.requestFocus();\n } else {\n // Show a progress spinner, and kick off a background task to\n // perform the user login attempt.\n SQLiteDatabase database = DBHelper.getInstance(this).getWritableDatabase();\n\n ContentValues values = new ContentValues();\n values.put(DBHelper.U_NAME, mName.getText().toString());\n values.put(DBHelper.U_EMAIL, email);\n values.put(DBHelper.U_IMAGE, profileImage);\n values.put(DBHelper.U_PASSWORD, password);\n database.insert(DBHelper.TUSER, null, values);\n database.close();\n\n UserModel userData = new UserModel();\n userData.setId(0);\n userData.setName(mName.getText().toString());\n userData.setImage(profileImage);\n userData.setEmail(email);\n userData.setPassword(password);\n userData.setRememberMe(rememberMe);\n String userDataStr = new Gson().toJson(userData);\n Common.saveStrPref(this, Common.PREF_USER, userDataStr);\n\n startActivity(new Intent(this, HomeActivity.class));\n }\n }", "Task<Void> signUp(String email, String password);", "public void goClicked(View view){\n final String email=emailEditText.getText().toString();\n final String password=passwordEditText.getText().toString();\n\n\n mAuth.signInWithEmailAndPassword(email, password)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n //Sign in the user\n Log.i(\"Infograph\", \"Sign in was successful\");\n loginUser();\n Toast.makeText(MainActivity.this, \"Signed in successfully !\", Toast.LENGTH_SHORT).show();\n } else {\n //Sign up the user\n Log.i(\"Infograph\", \"Sign in was not successful, Attempting SignUp\");\n mAuth.createUserWithEmailAndPassword(email,password).addOnCompleteListener(new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if(task.isSuccessful()){\n //Add to database\n DatabaseReference reference=database.getReference().child(\"users\").child(mAuth.getCurrentUser().getUid()).child(\"email\");\n\n reference.setValue(email);\n\n Log.i(\"Infograph\",\"Sign up was successful\");\n loginUser();\n Toast.makeText(MainActivity.this, \"Signed up successfully !\", Toast.LENGTH_SHORT).show();\n\n\n }else{\n Log.i(\"Infograph\",\"Sign up was not successful\");\n Toast.makeText(MainActivity.this, task.getException().getMessage(), Toast.LENGTH_SHORT).show();\n\n }\n }\n });\n }\n\n\n }\n });\n }", "@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tString username = usernameEditText.getText().toString();\r\n\t\t\t\tString email = emailEditText.getText().toString();\r\n\t\t\t\tString password = passwordEditText.getText().toString();\r\n\t\t\t\tString confirmPass = confirmPassEditText.getText().toString();\r\n\t\t\t\tboolean login = true;\r\n\t\t\t\t\r\n\t\t\t\tif(isEmpty(username)) {\r\n\t\t\t\t\tToast.makeText(SignUpActivity.this, \"Username is missing\", Toast.LENGTH_LONG).show();\r\n\t\t\t\t\tlogin = false;\r\n\t\t\t\t} else \r\n\t\t\t\tif(isEmpty(email)) {\r\n\t\t\t\t\tToast.makeText(SignUpActivity.this, \"Email is missing\", Toast.LENGTH_LONG).show();\r\n\t\t\t\t\tlogin = false;\r\n\t\t\t\t} else \r\n\t\t\t\tif(isEmpty(password)) {\r\n\t\t\t\t\tToast.makeText(SignUpActivity.this, \"Password is empty\", Toast.LENGTH_LONG).show();\r\n\t\t\t\t\tlogin = false;\r\n\t\t\t\t} else \r\n\t\t\t\tif(!password.equals(confirmPass)) {\r\n\t\t\t\t\tToast.makeText(SignUpActivity.this, \"Password doesn't match with confirm password\", Toast.LENGTH_LONG).show();\r\n\t\t\t\t\tlogin = false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(login) {\r\n\t\t\t\t\tParseUser user = new ParseUser();\r\n\t\t\t\t\tuser.setEmail(email);\r\n\t\t\t\t\tuser.setUsername(email);\r\n\t\t\t\t\tuser.setPassword(password);\r\n\t\t\t\t\t\r\n\t\t\t\t\tuser.signUpInBackground(new SignUpCallback() {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\tpublic void done(ParseException e) {\r\n\t\t\t\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\t\t\tif(e == null) {\r\n\t\t\t\t\t\t\t\tToast.makeText(SignUpActivity.this, \"Signup Successfull\", Toast.LENGTH_LONG).show();\r\n\t\t\t\t\t\t\t\tParseInstallation currentInstallation = ParseInstallation.getCurrentInstallation();\r\n\t\t\t\t\t\t\t\tcurrentInstallation.put(\"username\", ParseUser.getCurrentUser().getObjectId());\r\n\t\t\t\t\t\t\t\tcurrentInstallation.put(\"useremail\", ParseUser.getCurrentUser().getEmail());\r\n\t\t\t\t\t\t\t\tcurrentInstallation.saveInBackground();\r\n\t\t\t\t\t\t\t\tIntent intent = new Intent(SignUpActivity.this, MainActivity.class);\r\n\t\t\t\t\t\t\t\tstartActivity(intent);\r\n\t\t\t\t\t\t\t\tfinish();\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tToast.makeText(SignUpActivity.this, e.getMessage(), Toast.LENGTH_LONG).show();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}", "public static void signUp(String username, String password, String alternativeEmail, String firstName, String lastName) {\n click(REGISTRATION_LINK);\n type(REG_FLOW_USERNAME_FIELD, username);\n click(REG_FLOW_CHECK_BUTTON);\n// if (!REG_FLOW_USERNAME_FREE_MESSAGE.toString().contains(\"Потребителското име е свободно\")) {\n// System.out.println(\"Try another username - the entered one is already in use\");\n// }\n type(REG_FLOW_PASSWORD_FIELD, password);\n type(REG_FLOW_PASSWORD_REENTER_FIELD, password);\n WebElement phoneCheckbox = Browser.driver.findElement(REG_FLOW_PHONE_CHECKBOX);\n if (phoneCheckbox.isEnabled()) {\n phoneCheckbox.click(); //that's how we disable it\n }\n type(REG_FLOW_ALTERNATIVE_EMAIL_FIELD, alternativeEmail);\n type(REG_FLOW_QUESTION_FIELD, \"To be or not to be?\");\n type(REG_FLOW_ANSWER_FIELD, \"To beeee.\");\n type(REG_FLOW_FNAME_FIELD, firstName);\n type(REG_FLOW_LNAME_FIELD, lastName);\n Browser.driver.switchTo().frame(\"abv-GDPR-frame\").manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n // Manually to tap ACCEPT on the GDPR window\n Browser.driver.switchTo().defaultContent();\n click(REG_FLOW_GENDER_RADIOBUTTON); //to choose male\n click(REG_FLOW_DAY_DROPDOWN);\n click(REG_FLOW_DAY_3); // to choose 3th\n click(REG_FLOW_MONTH_DROPDOWN);\n click(REG_FLOW_MONTH_5); // to choose May\n click(REG_FLOW_YEAR_DROPDOWN);\n click(REG_FLOW_YEAR_1998); // to choose 1998\n\n findElement(REG_FLOW_CAPTCHA_FIELD);\n click(REG_FLOW_CAPTCHA_FIELD);\n // Timeout to enter the CAPTCHA manually\n // EXPLICIT WAIT DA MU TURYA\n click(REG_FLOW_CREATE_BUTTON);\n String successfulRegMessage = Browser.driver.findElement(REG_SUCCESS_MESSAGE).getText().trim();\n assertTrue(successfulRegMessage.contains(\"Успешна регистрация.\"), \"No SUCCESS message\");\n click(LOGIN_TO_YOUR_EMAIL_BUTTON);\n }" ]
[ "0.8306161", "0.8117228", "0.8094785", "0.7888104", "0.77760553", "0.7737845", "0.7675774", "0.7675759", "0.76736015", "0.76274115", "0.75272244", "0.75124544", "0.74734676", "0.74501103", "0.74157274", "0.7397581", "0.7392648", "0.7259994", "0.7252827", "0.7234414", "0.721358", "0.7211644", "0.7208199", "0.7207264", "0.7157605", "0.7157605", "0.71538323", "0.71374476", "0.71354806", "0.7105263", "0.7093145", "0.709081", "0.7064272", "0.7051741", "0.7051498", "0.70481306", "0.70248604", "0.7023475", "0.7020485", "0.6997351", "0.69956934", "0.6988574", "0.697323", "0.6970349", "0.69638926", "0.6953607", "0.6939293", "0.69310683", "0.6920957", "0.69185656", "0.6905245", "0.6875855", "0.68721074", "0.68656456", "0.68569565", "0.68432015", "0.6835941", "0.68350047", "0.68082976", "0.68004537", "0.6770569", "0.6764232", "0.6763089", "0.67536896", "0.67521906", "0.67382705", "0.67184955", "0.6711762", "0.6703236", "0.6702435", "0.6698793", "0.66987455", "0.66786736", "0.6665045", "0.666385", "0.6658565", "0.6649612", "0.66414785", "0.66344154", "0.6628868", "0.66217077", "0.66190535", "0.6616347", "0.66098744", "0.66095793", "0.66028434", "0.66018754", "0.6599652", "0.6591196", "0.65735817", "0.65692204", "0.6568883", "0.65611047", "0.6548832", "0.6538833", "0.65349114", "0.65325254", "0.65288395", "0.65236425", "0.6518648" ]
0.66938925
72
Simple method that sets the IDs.
public void setIds(String ids) { this.ids = ids; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n\tpublic void testSetId() {\r\n\t\tbreaku1.setId(5);\r\n\t\texternu1.setId(6);\r\n\t\tmeetingu1.setId(7);\r\n\t\tteachu1.setId(8);\r\n\r\n\t\tassertEquals(5, breaku1.getId());\r\n\t\tassertEquals(6, externu1.getId());\r\n\t\tassertEquals(7, meetingu1.getId());\r\n\t\tassertEquals(8, teachu1.getId());\r\n\t}", "void setId(int val);", "private void setId(int value) {\n \n id_ = value;\n }", "private void setId(int value) {\n \n id_ = value;\n }", "public void setIdSet(int idSet) {\r\n this.idSet = idSet;\r\n }", "@Override\n\tpublic void setIds(String[] ids) {\n\t\t\n\t}", "public void setId(int i) { id = i; }", "private void setId(int value) {\n \n id_ = value;\n }", "private void setId(int value) {\n \n id_ = value;\n }", "private void setId(int value) {\n \n id_ = value;\n }", "private void setId(int value) {\n \n id_ = value;\n }", "private void setId(int value) {\n \n id_ = value;\n }", "private void setId(int value) {\n \n id_ = value;\n }", "private void setId(int value) {\n \n id_ = value;\n }", "void setId(int id);", "private void setId(int ida2) {\n\t\tthis.id=ida;\r\n\t}", "public void setId(int id){ this.id = id; }", "void setId(ID id);", "protected void setID(int i){\r\n\t\tthis.ID = i;\r\n\t}", "public void setId(int value) {\r\n this.id = value;\r\n }", "public abstract void setId(int id);", "void setIdNumber(String idNumber);", "public void setID(int id);", "public void setId(final int i) {\n\t\tid = i;\n\t}", "private void setId(Integer id) { this.id = id; }", "public void setId(int i) {\n\t\tthis.id = i;\n\t}", "private void setIds(Label greeting, LogoutButton logout, LanguageSelector languageSelector, ThemeSelector themeSelector){\n\t\t\n\t\tgreeting.setId(T.system(\"ID_LABEL_GREETING\"));\n\t\tif(logout != null){\n\t\t\tlogout.setId(T.system(\"ID_BUTTON_LOGOUT\"));\n\t\t}\n\t\tlanguageSelector.setId(T.system(\"ID_COMBOBOX_LANGUAGE_SELECTOR\"));\n\t\tthemeSelector.setId(T.system(\"ID_COMBOBOX_THEME_SELECTOR\"));\n\t\t\n\t}", "void setId(String id);", "void setId(String id);", "void setId(String id);", "public void setId(int value) {\n this.id = value;\n }", "public void setId(int value) {\n this.id = value;\n }", "public void setId(int value) {\n this.id = value;\n }", "public void setId(int value) {\n this.id = value;\n }", "public void setId(int value) {\n this.id = value;\n }", "public void setId(int value) {\n this.id = value;\n }", "public void setId(int value) {\n this.id = value;\n }", "public void setId(int value) {\n this.id = value;\n }", "public void setId(int value) {\n this.id = value;\n }", "public void setId(int id){\r\n this.id = id;\r\n }", "public void setId1(int value) {\n this.id1 = value;\n }", "public void assignId(int id);", "public void setID(int i){\n\t\tid = i;\n\t}", "private void setId() {\n id = count++;\n }", "@Override\n\tpublic void setId(Integer arg0) {\n\n\t}", "public void setId(int value) {\n this.id = value;\n }", "void setId(Integer id);", "public void setId(int id) { this.id = id; }", "public void setId(int id) { this.id = id; }", "public void setId(String newValue);", "public void setId(String id)\r\n/* 19: */ {\r\n/* 20:17 */ this.id = id;\r\n/* 21: */ }", "void setId(int id) {\n this.id = id;\n }", "public void setsId(Integer sId) {\n this.sId = sId;\n }", "final public void setId(int idp) {\n\t\tid = idp;\n\t\tidSet = true;\n\t}", "public void setId(final int id);", "public void setId(long id) {\n id_ = id;\n }", "public void setId(int id);", "public void setId(int id);", "public void setId (String id);", "public void setId(String id) {\n }", "public void setId(int id)\n {\n this.id=id;\n }", "private void setComponentsId(){\n this.tableA.setId(1);\n this.horizontalScrollViewB.setId(2);\n this.scrollViewC.setId(3);\n this.scrollViewD.setId(4);\n }", "public void setId(long id);", "public void setId(long id);", "public void setId(long id);", "public void setId(long id);", "public void setId(String i) {\n\t\tid = i;\n\t}", "@Override\n\tpublic void setId(int id) {\n\n\t}", "public void setID(int id){\n this.id=id;\n }", "@Test\r\n public void testSetId() {\r\n System.out.println(\"setId\");\r\n int lId = 0;\r\n \r\n instance.setId(lId);\r\n assertEquals(lId, instance.getId());\r\n \r\n }", "private void setAId(int value) {\n \n aId_ = value;\n }", "public void setId(int newId) {\n\tid = newId;\n}", "public void setID(java.lang.Integer value);", "void setID(int val)\n throws RemoteException;", "void setId(final Integer id);", "public void setId(String s) {\n\t\tid = s;\n\t}", "public void setId(ID id)\n {\n this.id = id;\n }", "void setId(java.lang.String id);", "void setId(final String id);", "public void setID(long id);", "public void setID(String idIn) {this.id = idIn;}", "public void setId(String id);", "public void setId(String id);", "public void setID(int value) {\n this.id = value;\n }", "public void setId(long id) { this.id = id; }", "public void setId(long id) { this.id = id; }", "public void setId(long id){\n this.id = id;\n }", "public void setId(long id){\n this.id = id;\n }", "public void setId(ID id){\r\n\t\tthis.id = id;\r\n\t}", "public void setId(int id)\n {\n this.id = id;\n }", "public void setId(int id)\n {\n this.id = id;\n }", "public void setId(Integer value) {\n this.id = value;\n }", "@Override\n\tpublic void setId(String id)\n\t{\n\t\t\n\t}", "public void setId(int id)\n {\n\tthis.id = id;\n }", "public void setId(int id) {\r\n this.id = id;\r\n }", "public void setId(int id) {\r\n this.id = id;\r\n }", "public void setId(int id) {\r\n this.id = id;\r\n }", "public void setId(int id) {\r\n this.id = id;\r\n }", "public void setID(String newID)\r\n {\r\n id=newID;\r\n }", "@Override\n\tpublic void setId(long value) {\n super.setId(value);\n }" ]
[ "0.7761742", "0.7413711", "0.7382259", "0.7330293", "0.7227508", "0.7216646", "0.71600556", "0.710794", "0.710794", "0.710794", "0.710794", "0.710794", "0.710794", "0.710794", "0.70044124", "0.69888675", "0.69761205", "0.69475806", "0.69428027", "0.69183517", "0.6900599", "0.6899121", "0.689647", "0.6894284", "0.6883998", "0.68669677", "0.6845296", "0.6821735", "0.6821735", "0.6821735", "0.681908", "0.681908", "0.681908", "0.681908", "0.681908", "0.681908", "0.681908", "0.681908", "0.681908", "0.68175113", "0.6808289", "0.6804124", "0.6801783", "0.6794724", "0.6788533", "0.678718", "0.677891", "0.6766497", "0.6766497", "0.67490584", "0.6745284", "0.6739003", "0.67364985", "0.67351866", "0.6733537", "0.67271304", "0.6724138", "0.6724138", "0.66887444", "0.66865826", "0.66843295", "0.66821194", "0.6681143", "0.6681143", "0.6681143", "0.6681143", "0.66679573", "0.66632974", "0.66627246", "0.6660604", "0.665819", "0.6657288", "0.6648929", "0.6645449", "0.66441107", "0.66434133", "0.6634865", "0.6634148", "0.66296196", "0.6621326", "0.6621316", "0.6611286", "0.6611286", "0.6607676", "0.6603561", "0.6603561", "0.65984595", "0.65984595", "0.65968734", "0.6592492", "0.6592492", "0.6588221", "0.65693575", "0.6561522", "0.6560907", "0.6560907", "0.6560907", "0.6560907", "0.6559777", "0.655481" ]
0.6729957
55
GET method for retrieving the IDs.
public String getIds() { return this.ids; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List getAllIds();", "List<String> findAllIds();", "@GetMapping(\"/all/id\")\n public List<String> getAllId(){\n return productService.getAllId();\n }", "public java.util.List<String> getIds() {\n return ids;\n }", "public String getIds() {\n return ids;\n }", "public String getIds() {\n return ids;\n }", "Set<II> getIds();", "Enumeration getIds();", "java.util.List<java.lang.Long> getIdsList();", "@GetMapping(\"/listInByIds\")\n public R<List<User>> listInByIds(@RequestParam(value = \"ids\") List<String> ids) {\n return R.ok(userService.selectBatchIds(ids));\n }", "public Map<String, Object> getIds() {\n return ids;\n }", "public List<Integer> getIds(int conId, int type, int state) throws AppException;", "public CallSpec<List<String>, HttpError> getYourContactIds() {\n return Resource.<List<String>, HttpError>newGetSpec(api, \"/v1/users/me/contact_ids\")\n .responseAs(list(String.class, \"contact_ids\", \"items\"))\n .build();\n }", "@Override\n\tpublic String[] getIds() {\n\t\treturn null;\n\t}", "@Secured({ \"ROLE_ADMIN\", \"ROLE_TEACHER\" })\n\t@RequestMapping(method = RequestMethod.GET, value = \"/by_id/{ids}\")\n\tpublic ResponseEntity<?> getById(@PathVariable String ids) {\n\n\t\ttry {\n\t\t\tInteger id = Integer.valueOf(ids);\n\t\t\tif (markRepo.existsById(id)) {\n\t\t\t\treturn new ResponseEntity<MarkEntity>(markRepo.findById(id).get(), HttpStatus.OK);\n\n\t\t\t} else\n\t\t\t\treturn new ResponseEntity<RestError>(new RestError(10, \"There is no mark with such ID\"),\n\t\t\t\t\t\tHttpStatus.NOT_FOUND);\n\t\t} catch (Exception e) {\n\t\t\treturn new ResponseEntity<RestError>(new RestError(1, \"Error ocured: \" + e.getMessage()),\n\t\t\t\t\tHttpStatus.INTERNAL_SERVER_ERROR);\n\t\t}\n\t}", "@JsonGetter(\"didIds\")\r\n public List<Integer> getDidIds ( ) { \r\n return this.didIds;\r\n }", "@Override\n\tpublic Object[] getIds() {\n\t\treturn null;\n\t}", "public List<String> getListOfIds() {\n return listOfIds;\n }", "public List<String> getIdList(RequestInfo requestInfo, String tenantId, String idName, String idformat, int count) {\n\t\t\n\t\tList<IdRequest> reqList = new ArrayList<>();\n\t\tfor (int i = 0; i < count; i++) {\n\t\t\treqList.add(IdRequest.builder().idName(idName).format(idformat).tenantId(tenantId).build());\n\t\t}\n\n\t\tIdGenerationRequest request = IdGenerationRequest.builder().idRequests(reqList).requestInfo(requestInfo).build();\n\t\tStringBuilder uri = new StringBuilder(configs.getIdGenHost()).append(configs.getIdGenPath());\n\t\tIdGenerationResponse response = mapper.convertValue(restRepo.fetchResult(uri, request).get(), IdGenerationResponse.class);\n\t\t\n\t\tList<IdResponse> idResponses = response.getIdResponses();\n\t\t\n if (CollectionUtils.isEmpty(idResponses))\n throw new CustomException(\"IDGEN ERROR\", \"No ids returned from idgen Service\");\n \n\t\treturn idResponses.stream().map(IdResponse::getId).collect(Collectors.toList());\n\t}", "public String[] getIDs() {\n return impl.getIDs();\n }", "Set<String> getIdentifiers();", "List<String> getList(String id);", "List<Long> getAuthorisedList( Long id) ;", "List <Aid> getAllAids();", "@Override\n public List<E> get(Long... ids) {\n // TODO Auto-generated method stub\n return null;\n }", "public String[] getRequestIds() {\r\n String[] toReturn = new String[0];\r\n\r\n String[] paramFields = {\"item_delimiter\"};\r\n SocketMessage request = new SocketMessage(\"admin\", \"req_list\", SocketMessage.PriorityType.EMERGENCY, SocketMessage.TransferType.BI_WAY, \"\",\r\n paramFields);\r\n request.setValue(\"item_delimiter\", ITEM_DELIMITER);\r\n\r\n SocketMessage response = handleMessage(request);\r\n if (!isSuccessful(response)) {\r\n if (\"\".equals(response.getErrorCode())) {\r\n setError(\"APIL_0221\", \"couldn't get Request IDs\");\r\n } else {\r\n wrapError(\"APIL_0221\", \"couldn't get Request IDs\");\r\n }\r\n return toReturn;\r\n } else {\r\n toReturn = StringTool.stringToArray(response.getValue(\"req_ids\").trim(), ITEM_DELIMITER);\r\n }\r\n\r\n return toReturn;\r\n }", "List<T> findAllById(List<Object> ids) throws Exception;", "long getIds(int index);", "Collection<?> idValues();", "@GET\n @Path(\"{id}\")\n @Produces({ \"application/json\" })\n public abstract Response find(@PathParam(\"id\") Long id);", "public abstract ArrayList<Integer> getIdList();", "@RequestMapping(value = \"/show-ids\", \n\t\t\t\t\tmethod = RequestMethod.GET)\n\tpublic ResponseEntity<List<File>> showIds(@RequestParam(value = \"total\", required = true) int total) throws IOException {\n\t\t\n\t\t FileList result = DriveConnection.driveService.files().list() // listamos archivos\n\t .setPageSize(total) // \n\t .setFields(\"nextPageToken, files(id, name)\")\n\t .execute();\n\t \n\t\t List<File> files = result.getFiles(); // almacenamos en una lista\n\t \n\t return new ResponseEntity<List<File>>(files, HttpStatus.OK); // devolvemos\n\t}", "List<T> getEntitiesByIds(List<ID_TYPE> ids) throws NotImplementedException;", "List<Long> getTransmissionIds();", "public ArrayList<String> get_list_ids(){\n\t\t\treturn list_ids;\n\t\t\t\n\t\t}", "public abstract List get(List oids) throws OIDDoesNotExistException;", "private ArrayList<String> loadIds() {\n\n\t\tArrayList<String> idArray = new ArrayList<String>();\n\t\ttry {\n\t\t\tFileInputStream fileInputStream = context.openFileInput(SAVE_FILE);\n\t\t\tInputStreamReader inputStreamReader = new InputStreamReader(\n\t\t\t\t\tfileInputStream);\n\t\t\tType listType = new TypeToken<ArrayList<String>>() {\n\t\t\t}.getType();\n\t\t\tGsonBuilder builder = new GsonBuilder();\n\t\t\tGson gson = builder.create();\n\t\t\tArrayList<String> list = gson.fromJson(inputStreamReader, listType);\n\t\t\tidArray = list;\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn idArray;\n\t}", "public Vector getResourceIds()\n {\n return mResourceIds;\n }", "int getIdsCount();", "public void getIdentifiers() throws IOException{\n okhttp3.Request request = new okhttp3.Request.Builder()\n .url(BASE_URL+\"/reportesList\")\n .build();\n\n client.newCall(request).enqueue(new Callback(){\n\n @Override\n public void onFailure(Call call, IOException e) {\n\n }\n\n @Override\n public void onResponse(Call call, Response response) throws IOException {\n try {\n JSONArray reportes = new JSONArray(response.body().string());\n ArrayList<String> reportesText = new ArrayList<String>();\n\n for (int i = 0; i < reportes.length(); i++) {\n JSONObject js = reportes.getJSONObject(i);\n String id = js.getString(\"identificador\");\n reportesText.add(id);\n }\n }\n catch(Exception e){\n e.printStackTrace();\n }\n }\n });\n\n }", "List<PaymentsIdResponse> getAllPaymentsId();", "@RequestMapping(value = { \"/getAddressArray\" }, method = RequestMethod.GET)\r\n\tpublic @ResponseBody Integer[] getAddressArray(Integer[] idList) {\r\n\t\treturn idList;\r\n\t}", "private void getAllIds() {\n try {\n ArrayList<String> NicNumber = GuestController.getAllIdNumbers();\n for (String nic : NicNumber) {\n combo_nic.addItem(nic);\n\n }\n } catch (Exception ex) {\n Logger.getLogger(ModifyRoomReservation.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public Collection<String> getParameterIds();", "public void getSMSIds() {\r\n\r\n mSMSids = new ArrayList<Long>();\r\n\r\n ContentResolver cr = mContext.getContentResolver();\r\n Cursor cur = cr.query(Uri.parse(MySMS.SMS_URI), null,\r\n null, null, null);\r\n if (cur != null) {\r\n if (cur.getCount() > 0) {\r\n while (cur.moveToNext()) {\r\n Long id = cur.getLong(cur.getColumnIndex(\"_id\"));\r\n mSMSids.add(id);\r\n }\r\n }\r\n cur.close();\r\n }\r\n }", "@RequestMapping(value=\"/by-id/{id}\",method=RequestMethod.GET)\r\n\tpublic ResponseEntity<?> listarById(@PathVariable(\"id\") long id) {\r\n\t\treturn new ResponseEntity<List<Cliente>>(clienteService.listarById(id), HttpStatus.OK);\r\n\t}", "java.util.List<java.lang.Integer> getRareIdList();", "java.util.List<java.lang.Integer> getRareIdList();", "public SolrDocumentList getById(Collection<String> ids, SolrParams params) throws SolrServerException, IOException {\n if (ids == null || ids.isEmpty()) {\n throw new IllegalArgumentException(\"Must provide an identifier of a document to retrieve.\");\n }\n\n ModifiableSolrParams reqParams = new ModifiableSolrParams(params);\n if (StringUtils.isEmpty(reqParams.get(CommonParams.QT))) {\n reqParams.set(CommonParams.QT, \"/get\");\n }\n reqParams.set(\"ids\", (String[]) ids.toArray(new String[ids.size()]));\n\n return query(reqParams).getResults();\n }", "public static List<Integer> findAllIdsUsers( )\n {\n return _dao.selectAllIdsUser( _plugin );\n }", "public List<models.garaDB.tables.pojos.Ride> fetchById(Integer... values) {\n return fetch(Ride.RIDE.ID, values);\n }", "public List<String> searchForIds(String theQueryUrl) {\n\t\tIBundleProvider result = searchForBundleProvider(theQueryUrl);\n\n\t\t// getAllResources is not safe as size is not always set\n\t\treturn result.getResources(0, Integer.MAX_VALUE).stream()\n\t\t\t\t.map(resource -> resource.getIdElement().getIdPart())\n\t\t\t\t.collect(Collectors.toList());\n\t}", "public List<String> getListCourseId();", "public static ImmutableSet<Integer> getIds(){\n\t\t\treturn m_namesMap.rightSet();\n\t\t}", "java.util.List<java.lang.Integer> getOtherIdsList();", "public String getResourceIds() {\n return resourceIds;\n }", "public List<Integer> getAllIDClient(){\n\t\tPreparedStatement ps = null;\n\t\tResultSet resultatRequete =null;\n\t\t\n\t\ttry {\n\t\t\tString requeteSqlGetAll=\"SELECT id_client FROM clients\";\n\t\t\tps = this.connection.prepareStatement(requeteSqlGetAll);\n\t\t\t\n\t\t\tresultatRequete = ps.executeQuery();\n\n\t\t\tClient client = null;\n\t\t\t\n\t\t\tList<Integer> listeIDClient = new ArrayList <>();\n\n\t\t\twhile (resultatRequete.next()) {\n\t\t\t\tint idClient = resultatRequete.getInt(1);\n\t\t\t\t\n\t\t\t\tlisteIDClient.add(idClient);\n\t\t\t\t\n\t\t\t}//end while\n\t\t\treturn listeIDClient;\n\t\t\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}finally {\n\t\t\ttry {\n\t\t\t\tif(resultatRequete!= null) resultatRequete.close();\n\t\t\t\tif(ps!= null) ps.close();\n\t\t\t\t\n\t\t\t} catch (SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "@RequestMapping( value = \"/{id}/student\", method = RequestMethod.GET )\n public Set<StudentDTO> readStudents(@PathVariable(value=\"id\") long id){\n return classService.read(id).getStudents();\n }", "Set<String> getIdentifiers() throws GuacamoleException;", "public int[] getIDs(){\r\n\t\tint[] id = new int[Config.MAX_CLIENTS];\r\n\t\tfor(int i=0; i< Config.MAX_CLIENTS;i++){\r\n\t\t\tid[i] = clients[i].getID();\r\n\t\t}\r\n\t\treturn id;\r\n\t}", "public List<Integer> findAllPaintersId();", "public List<Produto> findByIdIn(Integer... ids);", "@GET(\"aktivitas/{id}\")\n Call<List<AktifitasModel>>\n getById(@Path(\"id\") String id);", "public java.lang.Object[] getIdsAsArray()\r\n {\r\n return (ids == null) ? null : ids.toArray();\r\n }", "public static String[] getAvailableIDs();", "public Result all(String id);", "java.util.List<java.lang.Integer> getListSnIdList();", "public List<models.garaDB.tables.pojos.Ride> fetchByMemberid(Integer... values) {\n return fetch(Ride.RIDE.MEMBERID, values);\n }", "@GetMapping(path = {\"/{idtv}\"})\n public Tipovehiculo listarId(@PathVariable(\"idtv\")int idtv){\n return service.listarId(idtv);\n }", "public int[] getListOfId() {\r\n\t\tString sqlCommand = \"SELECT Barcode FROM ProductTable\";\r\n\t\tint[] idList = null;\r\n\t\tArrayList<Integer> tmpList = new ArrayList<Integer>();\r\n\t\tint counter = 0;\r\n\t\ttry (Connection conn = this.connect();\r\n\t\t\t\tStatement stmt = conn.createStatement();\r\n\t\t\t\tResultSet rs = stmt.executeQuery(sqlCommand)) {\r\n\t\t\twhile (rs.next()) {\r\n\t\t\t\ttmpList.add(rs.getInt(\"Barcode\"));\r\n\t\t\t\tcounter++;\r\n\t\t\t}\r\n\t\t\tidList = new int[counter];\r\n\t\t\tfor (int i = 0; i < counter; i++) {\r\n\t\t\t\tidList[i] = tmpList.get(i);\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\tSystem.out.println(\"getListOfId: \"+e.getMessage());\r\n\t\t\treturn new int[0]; \r\n\t\t}\r\n\t\treturn idList;\r\n\t}", "@GetMapping(\"/{id}/students\")\n public List<Students> getStudents(@PathVariable long id) {\n //code\n return null;\n }", "ExternalIdentifiersResponse callExternalIdentifierGetRESTCall(String methodName,\n String urlTemplate,\n Object... params) throws PropertyServerException\n {\n return (ExternalIdentifiersResponse)this.callGetRESTCall(methodName, ExternalIdentifiersResponse.class, urlTemplate, params);\n }", "public ArrayList<String> getEventIdsList(){\n return this.eventIdsList;\n }", "@Override\n\tpublic <T extends BasePojo> List<T> queryByIds(String ids) {\n\t\treturn null;\n\t}", "private ArrayList<String> getItemIDs() {\n\n\t\tArrayList<String> arrayList = new ArrayList<String>();\n\t\t/*\n\t\t * List of item IDs will be retrieved from MainQuery.xml\n\t\t */\n\t\ttry {\n\t\t\tconnection = DBConnectionUtil.getDBConnection();\n\t\t\tpreparedStatement = connection.prepareStatement(QueryUtil.queryByID(CommonConstants.QUERY_ID_GET_ITEM_IDS));\n\t\t\tResultSet resultSet = preparedStatement.executeQuery();\n\t\t\twhile (resultSet.next()) {\n\t\t\t\tarrayList.add(resultSet.getString(CommonConstants.COLUMN_INDEX_ONE));\n\t\t\t}\n\t\t} catch (SQLException | SAXException | IOException | ParserConfigurationException | ClassNotFoundException e) {\n\t\t\tlog.log(Level.SEVERE, e.getMessage());\n\t\t} finally {\n\t\t\t/*\n\t\t\t * Close prepared statement and database connectivity at the end of transaction\n\t\t\t */\n\t\t\ttry {\n\t\t\t\tif (preparedStatement != null) {\n\t\t\t\t\tpreparedStatement.close();\n\t\t\t\t}\n\t\t\t\tif (connection != null) {\n\t\t\t\t\tconnection.close();\n\t\t\t\t}\n\t\t\t} catch (SQLException e) {\n\t\t\t\tlog.log(Level.SEVERE, e.getMessage());\n\t\t\t}\n\t\t}\n\t\treturn arrayList;\n\t}", "private ArrayList<String> getItemIDs() {\n\n\t\tArrayList<String> arrayList = new ArrayList<String>();\n\t\t/*\n\t\t * List of item IDs will be retrieved from MainQuery.xml\n\t\t */\n\t\ttry {\n\t\t\tconnection = DBConnectionUtil.getDBConnection();\n\t\t\tpreparedStatement = connection.prepareStatement(QueryUtil.queryByID(CommonConstants.QUERY_ID_GET_ITEM_IDS));\n\t\t\tResultSet resultSet = preparedStatement.executeQuery();\n\t\t\twhile (resultSet.next()) {\n\t\t\t\tarrayList.add(resultSet.getString(CommonConstants.COLUMN_INDEX_ONE));\n\t\t\t}\n\t\t} catch (SQLException | SAXException | IOException | ParserConfigurationException | ClassNotFoundException e) {\n\t\t\tlog.log(Level.SEVERE, e.getMessage());\n\t\t} finally {\n\t\t\t/*\n\t\t\t * Close prepared statement and database connectivity at the end of transaction\n\t\t\t */\n\t\t\ttry {\n\t\t\t\tif (preparedStatement != null) {\n\t\t\t\t\tpreparedStatement.close();\n\t\t\t\t}\n\t\t\t\tif (connection != null) {\n\t\t\t\t\tconnection.close();\n\t\t\t\t}\n\t\t\t} catch (SQLException e) {\n\t\t\t\tlog.log(Level.SEVERE, e.getMessage());\n\t\t\t}\n\t\t}\n\t\treturn arrayList;\n\t}", "List<IdentificationDTO> getIdentificationList();", "public String [] _truncatable_ids()\r\n {\r\n return _ids_list;\r\n }", "public void getUsersList(List<Long> ids, AsyncHttpResponseHandler handler) {\n if (ids == null) {\n return;\n }\n\n String apiUrl = getApiUrl(\"users/lookup.json\");\n RequestParams params = new RequestParams();\n\n String strIds = android.text.TextUtils.join(\",\", ids);\n params.put(\"user_id\", strIds);\n\n // Execute the request\n getClient().get(apiUrl, params, handler);\n }", "@Override\n @GET\n @Path(\"/{id}\")\n public Author get (@PathParam(\"id\") int id) {\n EntityManager em = PersistenceUtil.getEntityManagerFactory().createEntityManager();\n AuthorDao authorDao = new AuthorDao(em);\n Author a = authorDao.get(Author.class, id);\n a.getWorks().size();//it's needed to initialize session\n em.close();\n return a;\n }", "public List<K> getSavedIds() {\n if (dbObjects.length > 0 && dbObjects[0] instanceof JacksonDBObject) {\n throw new UnsupportedOperationException(\n \"Generated _id retrieval not supported when using stream serialization\");\n }\n\n List<K> ids = new ArrayList<K>();\n for (DBObject dbObject : dbObjects) {\n ids.add(jacksonDBCollection.convertFromDbId(dbObject.get(\"_id\")));\n }\n\n return ids;\n }", "List<UserContentFile> findContentFiles(@Param(\"ids\") List<Long> ids);", "@RequestMapping(value = \"/getUser/{id}\",method = RequestMethod.GET)\n @ApiOperation(value = \"getUser\")\n public String GetUser(@PathVariable int id){\n System.out.println(\"===========\"+id);\n return userService.findAll(id).toString();\n }", "public ArrayList<ArrayList<Integer>> selectForQuoiEntre(int id) throws DAOException;", "public List<Integer> getAllUserId() {\n return getAllUserId(getApplicationContext());\n }", "@Override\n\t\t\t\tpublic void onGetBookIdsStart() {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n\t\t\t\tpublic void onGetBookIdsStart() {\n\t\t\t\t\t\n\t\t\t\t}", "public List<Resource> getResources(@Param(\"resourceIds\") Set<String> resourceIds);", "List<E> findAll(Iterable<ID> identifiers);", "public String[] getAllUserIds() throws AdminPersistenceException {\n return (String[]) getIds(SELECT_ALL_USER_IDS).toArray(new String[0]);\n }", "@GetMapping(path = \"public/getInconsistentIdRelationsForServices\", produces = {MediaType.APPLICATION_JSON_VALUE})\n public void getInconsistentIdRelationsForServices() {\n FacetFilter ff = new FacetFilter();\n ff.setQuantity(10000);\n ff.addFilter(\"published\", true);\n List<ServiceBundle> allServices = resourceBundleService.getAll(ff, securityService.getAdminAccess()).getResults();\n for (ServiceBundle serviceBundle : allServices) {\n String serviceId = serviceBundle.getId();\n String catalogueId = serviceBundle.getService().getCatalogueId();\n String providerId = serviceBundle.getService().getResourceOrganisation();\n List<String> resourceProviders = serviceBundle.getService().getResourceProviders();\n List<String> relatedResources = serviceBundle.getService().getRelatedResources();\n List<String> requiredResources = serviceBundle.getService().getRequiredResources();\n\n logger.info(String.format(\"Service [%s] of the Provider [%s] of the Catalogue [%s] has the following related resources\",\n serviceId, providerId, catalogueId));\n if (!resourceProviders.isEmpty()) {\n logger.info(String.format(\"Resource Providers [%s]\", resourceProviders));\n }\n if (!relatedResources.isEmpty()) {\n logger.info(String.format(\"Related Resources [%s]\", relatedResources));\n }\n if (!requiredResources.isEmpty()) {\n logger.info(String.format(\"Required Resources [%s]\", requiredResources));\n }\n }\n }", "private List<Long> getListOfAuthorizedById(\n List<Long> ids,\n String username,\n ResponseToFailedAuthorization failureResponse,\n AccessLevel accessLevel,\n Session session,\n String securedIdsQuery,\n String openAndSecuredIdsQuery,\n String securedParamListName,\n String openParamListName,\n String returnVarName\n ) throws Exception {\n\n ids = uniquifyIds(ids);\n\n String queryStr;\n if ( accessLevel == AccessLevel.View ) {\n queryStr = openAndSecuredIdsQuery.replace( PROJ_GRP_SUBST_STR, VIEW_PROJECT_GROUP_FIELD );\n }\n else {\n queryStr = securedIdsQuery.replace( PROJ_GRP_SUBST_STR, EDIT_PROJECT_GROUP_FIELD );\n }\n NativeQuery query = session.createNativeQuery( queryStr );\n query.addScalar( returnVarName, StandardBasicTypes.STRING );\n if ( accessLevel == AccessLevel.View ) {\n query.setParameterList( openParamListName, ids );\n }\n query.setParameterList( securedParamListName, ids );\n String queryUsername = username == null ? UNLOGGED_IN_USER : username;\n query.setParameter( USERNAME_PARAM, queryUsername );\n\n logger.debug(query.getQueryString());\n List<Long> rtnVal = query.list();\n if ( failureResponse == ResponseToFailedAuthorization.ThrowException &&\n rtnVal.size() < ids.size() ) {\n String idStr = joinIdList( ids );\n String message = makeUserReadableMessage( username, idStr );\n logger.error( message );\n throw new ForbiddenResourceException( message );\n }\n\n return rtnVal;\n }", "private void getEKIDs() {\n if (!CloudSettingsManager.getUserID(getContextAsync()).isEmpty()) {\n DataMessenger.getInstance().getEkIds(CloudSettingsManager.getUserID(getContextAsync()), new RestApi.ResponseListener() {\n @Override\n public void start() {\n Log.i(TAG, \"Request started\");\n }\n\n @Override\n public void success(HttpResponse rsp) {\n if (rsp != null) {\n if (rsp.statusCode == 200) {\n if (rsp.body != null) {\n MgmtGetEKIDRsp result = new Gson().fromJson(rsp.body, MgmtGetEKIDRsp.class);\n if (result.getDevices().size() == 0) {\n Utils.showToast(getContextAsync(), R.string.get_cloud_ekids_empty);\n } else {\n updateAdapter(result.getDevices());\n }\n } else {\n Utils.showToast(getContextAsync(), R.string.get_cloud_ekids_error);\n }\n } else {\n GenericRsp genericRsp = new Gson().fromJson(rsp.body, GenericRsp.class);\n if (genericRsp != null && !genericRsp.isResult()) {\n Utils.showToast(getContextAsync(), genericRsp.getReasonCode());\n } else {\n Utils.showToast(getContextAsync(), R.string.get_cloud_ekids_error);\n }\n }\n } else {\n Utils.showToast(getContextAsync(), R.string.get_cloud_ekids_error);\n }\n }\n\n @Override\n public void failure(Exception error) {\n if (error instanceof UnknownHostException) {\n Utils.showToast(getContextAsync(), R.string.connectivity_error);\n } else {\n Utils.showToast(getContextAsync(), R.string.get_cloud_ekids_error);\n }\n }\n\n @Override\n public void complete() {\n Log.i(TAG, \"Request completed\");\n }\n });\n } else {\n Utils.showToast(getContextAsync(), R.string.get_cloud_ekids_empty_userid);\n }\n }", "@Override\n public List<T> findAllById(Iterable<Integer> ids) {\n List<T> entities = new ArrayList<>();\n for (int id : ids) {\n entities\n .add(findById(id).orElseThrow(() -> new EntityNotFoundException(\"ID Not found:\" + id)));\n }\n return entities;\n }", "public ArrayList getAllAccountIds() {\n\t\tConnection dbAccess = DataAccess.getDbAccess();\n\t\tStatement sttmnt;\n\t\tResultSet rs;\n\t\ttry {\n\t\t\tsttmnt = dbAccess.createStatement();\n\t\t\trs = sttmnt.executeQuery(\"SELECT acc_id FROM accounts\");\n\t\t\twhile (rs.next()) {\n\t\t\t\taccountIds.add(rs.getInt(\"acc_id\"));\n\t\t\t}\n\t\t\tdbAccess.close();\n\t\t} catch (SQLException se) {\n\t\t\tse.printStackTrace();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn accountIds;\n\t}", "int[] retrieveAllData();", "@Override\n\t\t\tpublic void onGetBookIdsStart() {\n\t\t\t\t\n\t\t\t}", "public ResultSet queryList()\n\t\t\tthrows SQLException\n\t{\n\t\treturn queryList(this.dbColumnNames,\"ID\",true);\n\t}", "public int[] getAllId(int id) {\n int[] ids = new int[50];\n int i = 0;\n String sql= \"select * from photo where id_annonce = \"+id;\n Cursor cursor = this.getReadableDatabase().rawQuery(sql, null);\n if (cursor.moveToFirst())\n do {\n ids[i] = cursor.getInt(cursor.getColumnIndex(\"id_photo\"));\n i++;\n }while (cursor.moveToNext());\n cursor.close();\n return ids;\n }", "public abstract Collection<Integer> getAllTurtlesByID();" ]
[ "0.767016", "0.72247803", "0.68549055", "0.67011374", "0.6658192", "0.6658192", "0.6645274", "0.66244817", "0.6613459", "0.64057994", "0.63934445", "0.6309862", "0.625677", "0.6249408", "0.6147972", "0.6118773", "0.61062723", "0.6096536", "0.60864526", "0.6082552", "0.6072681", "0.606692", "0.605136", "0.6045446", "0.6041172", "0.60253924", "0.60181856", "0.6015215", "0.59892076", "0.59863716", "0.59857583", "0.59702164", "0.5957799", "0.5935468", "0.59260625", "0.5925644", "0.5921858", "0.59204066", "0.5914104", "0.5914021", "0.59109336", "0.5909471", "0.5888824", "0.58825594", "0.58785963", "0.58743495", "0.5865843", "0.5865843", "0.5858866", "0.58432794", "0.58394694", "0.58353406", "0.5830531", "0.5824991", "0.5813642", "0.5800185", "0.578107", "0.57698387", "0.57671744", "0.5764746", "0.574805", "0.5735303", "0.573042", "0.5718287", "0.57146865", "0.5707304", "0.5682836", "0.5662714", "0.5661981", "0.56578857", "0.5655135", "0.56482375", "0.56462926", "0.5637467", "0.5613943", "0.5613943", "0.5612086", "0.5604839", "0.56034803", "0.5587191", "0.5579364", "0.55628437", "0.555826", "0.55380034", "0.5537734", "0.553452", "0.553452", "0.55280954", "0.5513167", "0.55079067", "0.5504554", "0.54890454", "0.5487253", "0.54863715", "0.54796976", "0.54773563", "0.5472389", "0.5472198", "0.54720473", "0.54700893" ]
0.6680068
4
method to set the password.
public void setPasswords(String passwords) { this.passwords = passwords; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void setPassword(String password);", "void setPassword(String password);", "void setPassword(String password);", "public void setPassword(String pass);", "public void setPassword(String password)\r\n/* 26: */ {\r\n/* 27:42 */ this.password = password;\r\n/* 28: */ }", "public void setPassword(java.lang.String newPassword);", "void setPassword(String ps) {\n this.password = ps;\n }", "public void setPassword(String password)\n {\n _password = password;\n }", "public void setPassword(String pw)\n {\n this.password = pw;\n }", "@Override\n\tpublic void setPassword(String password) {\n\n\t}", "public void set_pass(String password)\n {\n pass=password;\n }", "public void setPassword(String password)\n {\n _password = password;\n }", "public void setPassword(String p)\n\t{\n\t\tpassword = p;\n\t}", "public void setPassword(String password){\r\n this.password = password;\r\n }", "void setPassword(Password newPassword, String plainPassword) throws NoUserSelectedException;", "public void setPassword(String p) {\n\t\tpassword = p;\n\t}", "private void setPassword(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n password_ = value;\n }", "private void setPassword(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n password_ = value;\n }", "public void setPassword(String pw) {\n password = pw.toCharArray();\n cleared = false;\n }", "public void setPassword(String paramPasswd) {\n\tstrPasswd = paramPasswd;\n }", "public void setPassword(final String password){\n mPassword = password;\n }", "public void setPassword( String password )\r\n {\r\n this.password = password;\r\n }", "public void setPassword(String password)\n \t{\n \t\tthis.password = password;\n \t}", "public void setPassword(String password){\n this.password = encryptPassword(password);\n checkRep();\n }", "public void setPassword(String password)\n {\n this.password = password;\n }", "public void setPassword(String password)\n {\n this.password = password;\n }", "public void setPassword(String password) {\r\n this.password = password;\r\n }", "public void setPassword(String password) {\r\n this.password = password;\r\n }", "public void setPassword(String password) {\n this.password = password;\r\n }", "public void setPassword(String password)\n {\n this.password = password;\n }", "public void setPassword(String password) {\r\n this.password = password;\r\n }", "public void setPassword(String password) {\r\n this.password = password;\r\n }", "public void setPassword(String password) {\r\n this.password = password;\r\n }", "public void setPassword(String password) {\r\n this.password = password;\r\n }", "public void setPassword(String password) {\r\n this.password = password;\r\n }", "public void setPassword(String password) {\r\n this.password = password;\r\n }", "public void setPassword(String password) {\n this.password = password;\n }", "public void setPassword(String password) {\n this.password = password;\n }", "public void setPassword(String password) {\n\tthis.password = password;\n}", "@Override\n\tpublic void setPassword(String password) {\n\t\tsuper.setPassword(password);\n\t}", "@Override\n\tpublic void setPassword(String password) {\n\t\tsuper.setPassword(password);\n\t}", "public void setPassword(String password) {\n this.password = password;\n saveProperties();\n }", "public void set_password(String password)\r\n\t{\r\n\t\tthis.password = password;\r\n\t}", "public void setPassword(java.lang.String password) {\r\n this.password = password;\r\n }", "public void setPassword(java.lang.String password) {\r\n this.password = password;\r\n }", "public void setPw(char[] password) {\n\t\t\r\n\t}", "public Builder setPassword(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n password_ = value;\n onChanged();\n return this;\n }", "public Builder setPassword(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n password_ = value;\n onChanged();\n return this;\n }", "public Builder setPassword(\n String value) {\n copyOnWrite();\n instance.setPassword(value);\n return this;\n }", "public Builder setPassword(\n String value) {\n copyOnWrite();\n instance.setPassword(value);\n return this;\n }", "void setErrorPassword();", "public void setPassword(int password) {\n this.password = password;\n }", "public void setPassword(String password) {\n this.password = password;\n }", "public void setPassword(String password) {\n this.password = password;\n }", "public void setPassword(String password) {\n this.password = password;\n }", "public void setPassword(String password) {\n this.password = password;\n }", "public void setPassword(String password) {\n this.password = password;\n }", "public void setPassword(String password) {\n this.password = password;\n }", "public void setPassword(String password) {\n this.password = password;\n }", "public void setPassword(String password) {\n this.password = password;\n }", "public void setPassword(String password) {\n this.password = password;\n }", "public void setPassword(String password) {\n this.password = password;\n }", "public void setPassword(String password) {\n this.password = password;\n }", "public void setPassword(String password) {\n this.password = password;\n }", "public void setPassword(String password) {\n this.password = password;\n }", "public void setPassword(String password) {\n this.password = password;\n }", "public void setPassword(String password) {\n this.password = password;\n }", "public void setPassword(String password) {\n this.password = password;\n }", "public void setPassword(String password) {\n this.password = password;\n }", "public void setPassword(String password) {\n this.password = password;\n }", "public void setPassword(String password) {\n this.password = password;\n }", "public void setPassword(String password) {\n this.password = password;\n }", "public void setPassword(String password) {\n this.password = password;\n }", "public void setPassword(String password) {\n this.password = password;\n }", "public void setPassword(String password) {\n this.password = password;\n }", "public void setPassword(String password) {\n this.password = password;\n }", "public void setPassword(String password) {\n this.password = password;\n }", "public void setPassword(String password) {\n this.password = password;\n }", "public void setPassword(String password) {\n this.password = password;\n }", "public void setPassword(String password) {\n this.password = password;\n }", "public void setPassword(String password) {\n this.password = password;\n }", "public void setPassword(String password) {\n this.password = password;\n }", "public void setPassword(String password) {\n this.password = password;\n }", "public void setPassword (java.lang.String password) {\r\n\t\tthis.password = password;\r\n\t}", "public void setPassword(final String password) {\n this.password = password.toCharArray();\n }", "public void setPassword(String password) {\n this.password.set(password);\n }", "public void setPassword(String password) {\n this.password = password;\n }", "public void setPassword( final String password )\n\t{\n\t\tthis.password = password;\n\t}", "public void setPassword(String password) throws NoSuchAlgorithmException, UnsupportedEncodingException {\n this.password = password;\r\n// this.password = hashPassword(password);\r\n// System.out.println(\"haslo po hash w account: \" + this.password);\r\n }", "public Builder setPassword(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n password_ = value;\n onChanged();\n return this;\n }", "public Builder setPassword(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n password_ = value;\n onChanged();\n return this;\n }", "public Builder setPassword(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n password_ = value;\n onChanged();\n return this;\n }", "public void setPassword(java.lang.String password) {\n this.password = password;\n }", "public void setPassword(java.lang.String password) {\n this.password = password;\n }", "public void setPassword2(String password2);", "public Builder setPassword(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n password_ = value;\n onChanged();\n return this;\n }", "public void setPassword(String password)\n {\n String passwordRegex = \"^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]).{8,}$\";\n Pattern passwordPattern = Pattern.compile(passwordRegex);\n Matcher passwordMatcher = passwordPattern.matcher(password);\n if(passwordMatcher.matches())\n {\n this.password=password;\n }\n else\n {\n this.password=\"\";\n }\n }", "@Override\n\tpublic void setPlainPassword(String arg0) {\n\t\t\n\t}", "public void setPassword(String strPassword){\n \t \n \tdriver.findElement(By.cssSelector(inputPassword)).sendKeys(strPassword);\n \n \n }", "public void setPassword(String password) {\r\n\t\tthis.password = password;\r\n\t}", "public void setPassword(String password) {\r\n\t\tthis.password = password;\r\n\t}" ]
[ "0.8758736", "0.8758736", "0.8758736", "0.8593931", "0.8556607", "0.8531686", "0.838568", "0.8369787", "0.8338932", "0.8277033", "0.81953186", "0.8137883", "0.81012124", "0.8070803", "0.80599165", "0.8022297", "0.80197275", "0.80197275", "0.8015077", "0.80059683", "0.8004163", "0.796163", "0.7943316", "0.7930064", "0.79175806", "0.79175806", "0.7913902", "0.7913902", "0.7913202", "0.79100746", "0.78559256", "0.78559256", "0.78559256", "0.78559256", "0.78559256", "0.78559256", "0.784392", "0.784392", "0.7838745", "0.78003186", "0.78003186", "0.779983", "0.7798865", "0.7788979", "0.7788979", "0.77770895", "0.77605444", "0.77605444", "0.7756284", "0.7756284", "0.7739136", "0.77379334", "0.7726904", "0.7726904", "0.7726904", "0.7726904", "0.7726904", "0.7726904", "0.7726904", "0.7726904", "0.7726904", "0.7726904", "0.7726904", "0.7726904", "0.7726904", "0.7726904", "0.7726904", "0.7726904", "0.7726904", "0.7726904", "0.7726904", "0.7726904", "0.7726904", "0.7726904", "0.7726904", "0.7726904", "0.7726904", "0.7726904", "0.7726904", "0.7726904", "0.7726904", "0.7726904", "0.7726904", "0.77262825", "0.7716553", "0.7704868", "0.7699224", "0.7687281", "0.7669217", "0.76676935", "0.76676935", "0.76676935", "0.76542234", "0.76542234", "0.7649793", "0.7626314", "0.7625581", "0.7619791", "0.7604329", "0.7598306", "0.7598306" ]
0.0
-1
Method to get the passwords.
public String getPasswords() { return this.passwords; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private char[] getPass()\n {\n return password.getPassword();\n }", "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "java.lang.String getPassword();", "public ArrayList<String> getAllPasswords() {\n return allPasswords;\n }", "public java.lang.String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "String getPassword();", "public List<Password> getPasswordList() {\n return passwordList;\n }", "public char[] getPassword();", "public String getPassword();", "public String getPassword();", "public String getPassword() {\n return instance.getPassword();\n }", "public String getPassword() {\n return instance.getPassword();\n }", "public char[] getPassword() {\n return password;\n }", "public synchronized char[] getPassword() {\n resetExpiration();\n if (password==null && !configuration.getPasswordFile().exists())\n return FileEncryptionConstants.DEFAULT_PASSWORD;\n else\n return password;\n }", "public String getPassword()\r\n/* 21: */ {\r\n/* 22:38 */ return this.password;\r\n/* 23: */ }", "public String getPassword() {\r\n\t\t// Get the password\r\n\t\tchar []code = password.getPassword();\r\n\t\t\r\n\t\t// Make the password string\r\n\t\tString password = \"\";\r\n\t\t\r\n\t\t// convert the char[] to string\r\n\t\tfor (char c: code){\r\n\t\t\tpassword += c;\r\n\t\t}\r\n\t\t\r\n\t\t// Return the password string\r\n\t\treturn password;\r\n\t}", "java.lang.String getPwd();", "public String getPassword() {\r\n \t\treturn properties.getProperty(KEY_PASSWORD);\r\n \t}", "com.google.protobuf.ByteString\n getPasswordBytes();", "com.google.protobuf.ByteString\n getPasswordBytes();", "com.google.protobuf.ByteString\n getPasswordBytes();", "com.google.protobuf.ByteString\n getPasswordBytes();", "com.google.protobuf.ByteString\n getPasswordBytes();", "com.google.protobuf.ByteString\n getPasswordBytes();", "com.google.protobuf.ByteString\n getPasswordBytes();", "com.google.protobuf.ByteString\n getPasswordBytes();", "com.google.protobuf.ByteString\n getPasswordBytes();", "com.google.protobuf.ByteString\n getPasswordBytes();", "public com.google.protobuf.ByteString\n getPasswordBytes() {\n return instance.getPasswordBytes();\n }", "public com.google.protobuf.ByteString\n getPasswordBytes() {\n return instance.getPasswordBytes();\n }", "Password getPsw();", "String getUserPassword();", "public String getPassword()\r\n {\r\n return password;\r\n }", "public String getPassword(){\n \treturn password;\n }", "public String getPassword() {return password;}", "public String getPassword()\r\n {\r\n return password;\r\n }", "public String getPassword()\n {\n return _password;\n }", "@Override\n\tpublic String getPassword() {\n\t\treturn user.getUserPwd();\n\t}", "public byte[] getPassword() {\n return password;\n }", "public String getPassword() {\n\treturn strPasswd;\n }", "public String getPassword()\n {\n return password;\n }", "public String getPassword()\n {\n return password;\n }", "public String getPassword(){\n return password;\n\t}", "public String getPassword()\r\n {\r\n return password;\r\n }", "public String getPassword()\n \t{\n \t\treturn password;\n \t}", "public String getPassword() {\n return password;\r\n }", "public String getaPassword() {\n return aPassword;\n }", "public String getPassword()\n {\n return password;\n }", "public String getPassword()\n {\n return password;\n }", "public String getPassword()\n {\n return _password;\n }", "@Override\n\tpublic String getPassword() {\n\t\treturn user.getPassword();\n\t}", "public String getPassword(){\r\n\t\treturn password;\r\n\t}", "public String getPassword() {\n \t\treturn password;\n \t}", "public String getPassword() {\n return (String) getObject(\"password\");\n }", "String getTemporaryPassword();", "public abstract String getPassword() throws DataServiceException;", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword(){\n\t\treturn this.password;\n\t}", "public java.lang.String getPassword() {\r\n return password;\r\n }", "public java.lang.String getPassword() {\r\n return password;\r\n }", "public String get_password()\r\n\t{\r\n\t\treturn this.password;\r\n\t}", "public String getPassword() { \n return this.password; \n }", "public java.lang.String getPassword () {\r\n\t\treturn password;\r\n\t}", "public String getPassword() {\n\treturn password;\n}", "public String getPassword()\n {\n return this.password;\n }", "public String getPassword() {\n return txtPassword().getText();\n }", "com.google.protobuf.ByteString\n getPwdBytes();", "public String getPassword(){\n return this.password;\n }", "public String getPassword() {\r\n return password;\r\n }", "public String getPassword()\n\t{\n\t\treturn password;\n\t}", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }", "public String getPassword() {\n return password;\n }" ]
[ "0.7564524", "0.7537597", "0.7537597", "0.7537597", "0.7537597", "0.7537597", "0.7537597", "0.7537597", "0.7445457", "0.7402864", "0.7363027", "0.7363027", "0.7363027", "0.7363027", "0.7363027", "0.7363027", "0.7363027", "0.7363027", "0.7363027", "0.7331225", "0.7320051", "0.7300593", "0.7300593", "0.7102401", "0.7102401", "0.7096691", "0.7078858", "0.7046259", "0.70122284", "0.7000706", "0.6992036", "0.6970519", "0.6970519", "0.6970519", "0.6970519", "0.6970519", "0.6970519", "0.6970519", "0.6944038", "0.6944038", "0.6940522", "0.6913259", "0.6913259", "0.69093657", "0.6897746", "0.6892973", "0.6892624", "0.6857556", "0.6856235", "0.684374", "0.6838445", "0.6828459", "0.68283266", "0.681683", "0.681683", "0.6814764", "0.68020785", "0.67965996", "0.67961866", "0.6787197", "0.67665803", "0.67665803", "0.6761921", "0.67539644", "0.67501014", "0.67442113", "0.67427856", "0.67421013", "0.67337805", "0.67286235", "0.67286235", "0.67286235", "0.67286235", "0.67286235", "0.67286235", "0.67286235", "0.67286235", "0.67286235", "0.67286235", "0.67286235", "0.6728336", "0.67279994", "0.67279994", "0.6726968", "0.67213273", "0.6719454", "0.6698868", "0.669873", "0.66866", "0.6681617", "0.6681544", "0.6679284", "0.6675662", "0.6675263", "0.6675263", "0.6675263", "0.6675263", "0.6675263", "0.6675263", "0.6675263" ]
0.7842381
0
Get list of white pix touching, for each call discover
public static void discover(int[] pixel){ disc[pixel[0]][pixel[1]]=1; //Mark pixel disc ArrayList<int[]> adjWhitePix = getAdjWhitePix(I, pixel); while(adjWhitePix.size()>0){ int[] neighbor = adjWhitePix.get(0); adjWhitePix.remove(0); if(finished[neighbor[0]][neighbor[1]]==0){ discover(neighbor); } } finished[pixel[0]][pixel[1]]=1; //Mark Finished //No More new white pixels to visit (Base Case) return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addpixeltoList() {\n for (int i = 0; i < 100; i++) {\r\n pixellist.add(new humanpixel());\r\n }\r\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 }", "public abstract GraphicsDevice[] getScreenDevices();", "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: */ }", "com.bagnet.nettracer.ws.core.pojo.xsd.WSScanPoints[] getScansArray();", "private boolean pixelIsWhite(int[] pixels, int pos)\n {\n if(pos < 0 || pos > pixels.length)\n return true;\n\n int blue = pixels[pos] & 0xff;\n int green = (pixels[pos] & 0xff00) >> 8;\n int red = (pixels[pos] & 0xff0000) >> 16;\n //int alpha = (pixels[pos] & 0x000000FF) >> 24;\n\n if(blue == 255 && green == 255 && red == 255)\n return true;\n\n return false;\n }", "List<Bitmap> getRecipeImgSmall();", "private List<ImageInfo> scanForImageInfo(CharSequence source) {\n return null; \n }", "public List<Piece> whitePieces();", "public Paint[] getPatterns() {\n return mGraphicsRenderer.getPatterns();\n }", "List<Bitmap> getFavoriteRecipeImgs();", "@Override\n \tpublic Object getPixels(final int n) {\n \t\tif (n < 1 || n > layers.size()) return null;\n \t\treturn getProcessor(n).getPixels();\n \t}", "public void myFilter(int start, int end)\n {\n Pixel[] originPixel = this.getPixels();\n //loop through all pixels in the calling object and parameter \n for(int index=start;index<=end;index++){\n originPixel[index].setGreen(originPixel[index].getBlue());\n originPixel[index].setBlue(originPixel[index].getRed());\n originPixel[index].setRed(originPixel[index].getGreen()); \n }\n }", "public ArrayList<RTLight> getVisibleLights(Point p){\n\r\n\t\tArrayList<RTLight> visibleLights=new ArrayList<RTLight>();\r\n\t\tfor(RTLight temp: lights){\r\n\t\t\t\r\n\t\t\r\n\t\t\tIntersection lightInt = trace(p,temp.getCenter());\r\n\t\t\t\r\n\t\t\tif(lightInt.getThing() == temp){\r\n\t\t\t\tvisibleLights.add((RTLight)lightInt.getThing());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn visibleLights;\r\n\t}", "public List<Painter> findAllPainters();", "public void infectfirstpixel() {\r\n randompixel = r.nextInt(100);\r\n pixellist.get(randompixel).setBackground(Color.red);\r\n count++;\r\n storage.add(randompixel);\r\n\r\n }", "com.bagnet.nettracer.ws.core.pojo.xsd.WSScanPoints getScansArray(int i);", "private void getPairedDevices() {\n\t\tdevicesArray = btAdapter.getBondedDevices();\n\t\tif(devicesArray.size()>0){\n\t\t\tfor(BluetoothDevice device:devicesArray){\n\t\t\t\tpairedDevices.add(device.getName());\n\t\t\t}\n\t\t}\n\t}", "private static /* synthetic */ boolean[] m37843a() {\n boolean[] zArr = f35337a;\n if (zArr != null) {\n return zArr;\n }\n boolean[] probes = Offline.getProbes(2117124487222320605L, \"com/mopub/mobileads/native_video/R$color\", 1);\n f35337a = probes;\n return probes;\n }", "public ArrayList<DetectInfo> getAllDetects(){\n return orderedLandingPads;\n }", "public synchronized List<WebElement> list_ColorSwatch() throws Exception {\n\n\t\tif (Utils.isDeviceMobile() && Utils.isBrandFullPrice())\n\t\t\treturn utils.findElementsByLocator(driver, \"MBL_PDP_Lnk_ColorSwatch\",\n\t\t\t\t\t\"| PDP: Color swatch Not Displayed On PDP\");\n\n\t\treturn utils.findElementsByLocator(driver, \"PDP_Lnk_ColorSwatch\", \"| PDP: Color swatch Not Displayed On PDP\");\n\t}", "public void filter(PixelImage pi) {\n\t\tPixel[][] data = pi.getData();\r\n\r\n\t\t\r\n\t\t// use loop to edit every pixel\r\n\t\tfor (int rowTemp = 1; rowTemp < data.length-1; rowTemp+=1) {\r\n\t\t\tfor (int colTemp = 1; colTemp < data[0].length-1; colTemp+=1) {\r\n\t\t\t\t\r\n\t\t\t\t// get every pixel in 3x3\r\n\t\t\t\tPixel tempMid =data[rowTemp][colTemp];\t\t\t\t\r\n\t\t\t\tPixel temp2 = data[rowTemp-1][colTemp];\r\n\t\t\t\tPixel temp1 = data[rowTemp-1][colTemp-1];\r\n\t\t\t\tPixel temp3 = data[rowTemp-1][colTemp+1];\r\n\t\t\t\tPixel temp4 = data[rowTemp][colTemp-1];\r\n\t\t\t\tPixel temp6 = data[rowTemp][colTemp+1];\r\n\t\t\t\tPixel temp7 = data[rowTemp+1][colTemp-1];\r\n\t\t\t\tPixel temp8 = data[rowTemp+1][colTemp];\r\n\t\t\t\tPixel temp9 = data[rowTemp+1][colTemp+1];\r\n\t\t\r\n\t\t\t\t// put red color in redList\r\n\t\t\t\tint[] redList = {temp1.red,temp2.red,temp3.red,\r\n\t\t\t\t\t\ttemp4.red,temp7.red,temp6.red,temp8.red,temp9.red,tempMid.red};\r\n\t\t\t\t\r\n\t\t\t\t// arrange list in the order that int is from small to big\r\n\t\t\t\tArrays.sort(redList);\r\n\t\t\t\t\r\n\t\t\t\t// take the middle int\t\t\t\r\n\t\t\t\ttempMid.red= redList[4];\r\n\t\t\t\t\r\n\t\t\t\t// put blue color in redList\t\t\r\n\t\t\t\tint[] blueList = {temp1.blue,temp2.blue,temp3.blue,\r\n\t\t\t\t\t\ttemp4.blue,\ttemp7.blue,temp6.blue,temp8.blue,temp9.blue,tempMid.blue};\r\n\t\t\t\tArrays.sort(blueList);\r\n\t\t\t\t// get the middle int\r\n\t\t\t\ttempMid.blue= blueList[4];\r\n\t\t\t\r\n\t\t\t\t// put green color in redList\r\n\t\t\t\tint[] greenList = {temp1.green,temp2.green,temp3.green\r\n\t\t\t\t\t\t,temp4.green,temp7.green,temp6.green,temp8.green,temp9.green,tempMid.green};\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\tArrays.sort(greenList);\r\n\t\t\t\t\r\n\t\t\t\ttempMid.green= greenList[4];\r\n\t\t\t\t \r\n\t\t\t\t\r\n\t\t\t\tdata[rowTemp][colTemp]=tempMid;\r\n\r\n\t\t\t}\t\t\r\n\t\t}\r\n\t\r\n\r\n\t\tpi.setData(data);\r\n\t}", "public final Painter[] getPainters()\n/* */ {\n/* 157 */ Painter[] results = new Painter[this.painters.length];\n/* 158 */ System.arraycopy(this.painters, 0, results, 0, results.length);\n/* 159 */ return results;\n/* */ }", "public ArrayList<Integer> getpixel(int x, int y){\n \tArrayList<Integer> pixel = new ArrayList<Integer>();\n \tpixel.add(x * GRID_WIDTH + GRID_WIDTH/2);\n \tpixel.add(y * GRID_HEIGHT + GRID_HEIGHT/2);\n \treturn pixel;\n }", "java.util.List getSurfaceRefs();", "List<List<Pixel>> filter(Image img, int multiplier, String operation);", "public void setPixels2(int x, int y, int w, int h,\n\t\t\t ColorModel model, int pixels[], int off,\n\t\t\t int scansize)\n {\n\tif (srcrows == null || srccols == null) {\n\t calculateMaps();\n\t}\n\tint sx, sy;\n\tint dx1 = (2 * x * destWidth + srcWidth - 1) / (2 * srcWidth);\n\tint dy1 = (2 * y * destHeight + srcHeight - 1) / (2 * srcHeight);\n\n //System.out.print( \"dx1 \" + dx1 + \", dy1 \" + dy1 ) ;\n\n // Obsolete. Used only for debugging purposes.\n float xscale = ( ( float ) srcWidth ) / ( ( float ) destWidth );\n float yscale = ( ( float ) srcHeight ) / ( ( float ) destHeight ) ;\n\n //System.out.println( \", xscale \" + xscale + \" yscale \" + yscale ) ;\n\n\tint outpix[];\n\tif (outpixbuf != null && outpixbuf instanceof int[]) {\n\t outpix = (int[]) outpixbuf;\n\t} else {\n\t outpix = new int[destWidth];\n\t outpixbuf = outpix;\n\t}\n\n // Main rendering loop\n\tfor (int dy = dy1; (sy = srcrows[dy]) < y + h; dy++) {\n int srcyl = srcylarr[dy];\n int srcyu = srcyuarr[dy];\n int srcoffl = off + scansize * (srcyl - y) ;\n int srcoffu = off + scansize * (srcyu - y) ;\n\n\t int srcoff = off + scansize * (sy - y);\n\t int dx ;\n for ( dx = dx1; (sx = srccols[dx]) < x + w; dx++) {\n int srcxl = srcxlarr[dx];\n int srcxu = srcxuarr[dx];\n\n //System.out.println( \"dx \" + dx + \", dy \" + dy ) ;\n //System.out.println( \"srcyl\" + srcyl + \", srcyu : \" + srcyu ) ;\n //System.out.println( \"srcoffl \" + srcoffl + \" srcoffu \" + srcoffu ) ;\n\n if ( srcxl == srcxu && srcyl == srcyu )\n \t\t outpix[dx] = pixels[srcoff + sx];\n else {\n //System.out.println( \"srcxl \" + srcxl + \" srcxu \" + srcxu ) ;\n //System.out.print( \" srcoffl + srcxl =\" + ( srcoffl + srcxl ) ) ;\n //System.out.print( \", srcoffl + srcxu =\" + ( srcoffl + srcxu ) ) ;\n //System.out.print( \", srcoffu + srcxl =\" + ( srcoffu + srcxl ) ) ;\n //System.out.println( \", srcoffu + srcxu =\" + ( srcoffu + srcxu ) ) ;\n int pelvalue = average( model, pixels[srcoffl + srcxl], pixels[srcoffl + srcxu],\n pixels[srcoffu + srcxl], pixels[srcoffu + srcxu],\n srcxarr[dx], srcyarr[dy] ) ;\n outpix[dx] = pelvalue ;\n }\n\t }\n\t if (dx > dx1) {\n\t\tconsumer.setPixels(dx1, dy, dx - dx1, 1,\n\t\t\t\t model, outpix, dx1, destWidth);\n\t }\n\t}\n }", "public void directCompute() {\r\n\t\t\tshort[] rgb = new short[3];\r\n\t\t\tint offset = yMin * width;\r\n\t\t\tfor (int y = yMin; y < yMax; y++) {\r\n\t\t\t\tfor (int x = 0; x < width; x++) {\r\n\t\t\t\t\tPoint3D screenPoint = screenCorner.add(xAxis.scalarMultiply(x * 1.0 / (width - 1) * horizontal))\r\n\t\t\t\t\t\t\t.sub(yAxis.scalarMultiply(y * 1.0 / (height - 1) * vertical));\r\n\r\n\t\t\t\t\tRay ray = Ray.fromPoints(eye, screenPoint);\r\n\t\t\t\t\ttracer(scene, ray, rgb);\r\n\t\t\t\t\t// applying color to pixel\r\n\t\t\t\t\tred[offset] = rgb[0] > 255 ? 255 : rgb[0];\r\n\t\t\t\t\tgreen[offset] = rgb[1] > 255 ? 255 : rgb[1];\r\n\t\t\t\t\tblue[offset] = rgb[2] > 255 ? 255 : rgb[2];\r\n\r\n\t\t\t\t\toffset++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "private Color[] getExpectedPixels() {\n return new Color[]{BLACK, BLACK, BLACK,\n BLACK, BLACK, WHITE,\n BLACK, WHITE, BLACK,\n WHITE, BLACK, BLACK};\n }", "public ArrayList getColors(int amount){\n \n \tArrayList colors = new ArrayList();\n\n \tfloat step = img.width/amount;\n\n \tfor (int i=0; i < Math.floor(img.width/step); i++){\n \t\tfloat index = map(i*step,0,img.width,0,(float)1.0);\n \t\tint c = getColorAt(index);\n \t\tcolors.add(c);\n \t} \n\n \treturn colors;\n\n }", "public List<Device> getRunningDevices();", "public BufferedImage getWhiteImage() {\n return whiteImages[imageNumber];\n }", "public synchronized Color scan(){\n \tcolorRGBSensor.fetchSample(sample, 0);\n color.setR(sample[0]*1024);\n color.setG(sample[1]*1024);\n color.setB(sample[2]*1024);\n return color;\n }", "public BufferedImage[] frontwalk(){\n\t\tBufferedImage arr[] = new BufferedImage[4];\n\n\t\tarr[0] = img.getSubimage(724, 283, 71, 67);\n\t\tarr[1] = img.getSubimage(658, 139, 66, 64);\n\t\tarr[2] = img.getSubimage(587, 141, 70, 66);\n\t\tarr[3] = img.getSubimage(513, 144, 73, 66);\n\t\t\n\t\treturn arr;\n\t}", "public String[] getSoundDevicesList();", "public void speckle() {\n\t\tint r = (height / res) - 1;\n\t\tint c = (width / res);\n\t\tfor (int i = 0; i < c; i++)\t\t{\n\t\t\tint x = rng.nextInt(25);\t\t\t\n\t\t\tif (x == 0) { // 1/25 chance of changing bottom row pixel to black\t \n\t\t\t\tvalues[r][i] = color1;\t\t\t\t\n\t\t\t}\n\t\t\telse if (x == 1) { // 1/25 chance of changing bottom row pixel to white\n\t\t\t\tvalues[r][i] = color2;\n\t\t\t}\n\t\t\t// 23/25 chance of leaving bottom pixel alone\n\t\t}\n\t}", "public int[] getPixels() {\n\t\treturn pixels;\n\t}", "private ArrayList<Pixel> getNeightbors(Pixel pixel)\n {\n ArrayList<Pixel> neighbors = new ArrayList<Pixel>();\n\n for(int i=-1;i<=1;i++)\n {\n int n_w=pixel.p+i;\n if(n_w<0 || n_w==this.image.getWidth()) continue;\n for(int j=-1;j<=1;j++)\n {\n int n_h=pixel.q+j;\n if(n_h<0 || n_h==this.image.getHeight()) continue;\n if(i==0 && j==0) continue;\n neighbors.add( new Pixel(n_w, n_h) );\n }//end for j\n }//end for i\n\n return neighbors;\n }", "public native int getFilter() throws MagickException;", "public static ElgatoKeyLight[] getKeyLights() {\n var appData = System.getenv(\"APPDATA\");\r\n if ( appData == null )\r\n return _noLights;\r\n\r\n // check to see if the ControlCenter settings exists\r\n var controlCenterSettingsFile = Paths.get(appData, \"Elgato\", \"ControlCenter\", \"settings.xml\").toFile();\r\n if ( !controlCenterSettingsFile.exists() )\r\n return _noLights;\r\n\r\n try {\r\n // open the settings XML file\r\n var factory = DocumentBuilderFactory.newInstance();\r\n factory.setNamespaceAware(true);\r\n var builder = factory.newDocumentBuilder();\r\n var settingsDocument = builder.parse(controlCenterSettingsFile);\r\n\r\n // setup xpath\r\n var xPathFactory = XPathFactory.newInstance();\r\n var xpath = xPathFactory.newXPath();\r\n\r\n // find all lights using an XPath query\r\n var accessoryQuery = xpath.compile(\"/AppSettings/Application/Accessories/Accessory\");\r\n var results = (NodeList)accessoryQuery.evaluate(settingsDocument, XPathConstants.NODESET);\r\n\r\n // we might have invalid entries, so use a dynamic list to generate the return results\r\n var returnBuilder = new ArrayList<ElgatoKeyLight>();\r\n for (var accessoryIndex = 0; accessoryIndex < results.getLength(); ++accessoryIndex) {\r\n var node = (Node)results.item(accessoryIndex);\r\n\r\n String foundName = null;\r\n String foundServerAddress = null;\r\n\r\n // scan the child for the lights\r\n var children = node.getChildNodes();\r\n for ( var childIndex = 0; childIndex < children.getLength(); ++childIndex ) {\r\n var testChild = (Node)children.item(childIndex);\r\n\r\n // Prefer using <UserDefinedName>\r\n if ( testChild.getNodeName() ==\"UserDefinedName\" )\r\n foundName = testChild.getTextContent();\r\n // Fallback to using <Name> if <UserDefinedName> is not defined\r\n else if ( testChild.getNodeName() == \"Name\" && foundName == null )\r\n foundName = testChild.getTextContent();\r\n // The server is stored in <IpAddress>\r\n else if ( testChild.getNodeName() == \"IpAddress\" )\r\n foundServerAddress = testChild.getTextContent();\r\n }\r\n\r\n // if we got both a name & a server, then add it\r\n if ( foundName != null && foundServerAddress != null )\r\n returnBuilder.add( new ElgatoKeyLight(foundName, foundServerAddress));\r\n }\r\n\r\n // convert it to an array and return it\r\n var ret = new ElgatoKeyLight[returnBuilder.size()];\r\n returnBuilder.toArray(ret);\r\n return ret;\r\n } catch (IOException e) {\r\n // This happens if the XML file cannot be read\r\n return _noLights;\r\n } catch (ParserConfigurationException e) {\r\n // This happens if the XML file is corrupt\r\n return _noLights;\r\n } catch (SAXException e) {\r\n // This happens if the XML file is corrupt\r\n return _noLights;\r\n } catch (XPathExpressionException e) {\r\n // this is an internal programming error that is raised if the XPath expression is bad\r\n e.printStackTrace();\r\n return _noLights;\r\n }\r\n }", "Map<String, Object> getFilterScratchpad();", "public native PixelPacket getBackgroundColor() throws MagickException;", "@Override\n public boolean getPaintFilterBitmap() {\n return mPaintFilterBitmap;\n }", "protected List<PCIDevice> probeDevices() {\n final ArrayList<PCIDevice> result = new ArrayList<PCIDevice>();\n rootBus.probeDevices(result);\n return result;\n }", "private android.graphics.Bitmap getMaskBitmap() {\n /*\n r20 = this;\n r0 = r20;\n r1 = r0.f5066b;\n if (r1 == 0) goto L_0x0009;\n L_0x0006:\n r1 = r0.f5066b;\n return r1;\n L_0x0009:\n r1 = r0.f5069f;\n r2 = r20.getWidth();\n r1 = r1.m6537a(r2);\n r2 = r0.f5069f;\n r3 = r20.getHeight();\n r2 = r2.m6539b(r3);\n r3 = m6543a(r1, r2);\n r0.f5066b = r3;\n r4 = new android.graphics.Canvas;\n r3 = r0.f5066b;\n r4.<init>(r3);\n r3 = com.facebook.shimmer.ShimmerFrameLayout.C18663.f5049a;\n r5 = r0.f5069f;\n r5 = r5.f5059i;\n r5 = r5.ordinal();\n r3 = r3[r5];\n r5 = 4611686018427387904; // 0x4000000000000000 float:0.0 double:2.0;\n r7 = 2;\n if (r3 == r7) goto L_0x0074;\n L_0x003b:\n r3 = com.facebook.shimmer.ShimmerFrameLayout.C18663.f5050b;\n r8 = r0.f5069f;\n r8 = r8.f5051a;\n r8 = r8.ordinal();\n r3 = r3[r8];\n r8 = 0;\n switch(r3) {\n case 2: goto L_0x0055;\n case 3: goto L_0x0051;\n case 4: goto L_0x004f;\n default: goto L_0x004b;\n };\n L_0x004b:\n r9 = r1;\n r3 = 0;\n L_0x004d:\n r10 = 0;\n goto L_0x0058;\n L_0x004f:\n r3 = r2;\n goto L_0x0053;\n L_0x0051:\n r8 = r1;\n r3 = 0;\n L_0x0053:\n r9 = 0;\n goto L_0x004d;\n L_0x0055:\n r10 = r2;\n r3 = 0;\n r9 = 0;\n L_0x0058:\n r19 = new android.graphics.LinearGradient;\n r12 = (float) r8;\n r13 = (float) r3;\n r14 = (float) r9;\n r15 = (float) r10;\n r3 = r0.f5069f;\n r16 = r3.m6538a();\n r3 = r0.f5069f;\n r17 = r3.m6540b();\n r18 = android.graphics.Shader.TileMode.REPEAT;\n r11 = r19;\n r11.<init>(r12, r13, r14, r15, r16, r17, r18);\n r3 = r19;\n goto L_0x009c;\n L_0x0074:\n r3 = r1 / 2;\n r8 = r2 / 2;\n r16 = new android.graphics.RadialGradient;\n r10 = (float) r3;\n r11 = (float) r8;\n r3 = java.lang.Math.max(r1, r2);\n r8 = (double) r3;\n r12 = java.lang.Math.sqrt(r5);\n r8 = r8 / r12;\n r12 = (float) r8;\n r3 = r0.f5069f;\n r13 = r3.m6538a();\n r3 = r0.f5069f;\n r14 = r3.m6540b();\n r15 = android.graphics.Shader.TileMode.REPEAT;\n r9 = r16;\n r9.<init>(r10, r11, r12, r13, r14, r15);\n r3 = r16;\n L_0x009c:\n r8 = r0.f5069f;\n r8 = r8.f5052b;\n r9 = r1 / 2;\n r9 = (float) r9;\n r10 = r2 / 2;\n r10 = (float) r10;\n r4.rotate(r8, r9, r10);\n r9 = new android.graphics.Paint;\n r9.<init>();\n r9.setShader(r3);\n r5 = java.lang.Math.sqrt(r5);\n r3 = java.lang.Math.max(r1, r2);\n r10 = (double) r3;\n r5 = r5 * r10;\n r3 = (int) r5;\n r3 = r3 / r7;\n r5 = -r3;\n r6 = (float) r5;\n r1 = r1 + r3;\n r7 = (float) r1;\n r2 = r2 + r3;\n r8 = (float) r2;\n r5 = r6;\n r4.drawRect(r5, r6, r7, r8, r9);\n r1 = r0.f5066b;\n return r1;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.facebook.shimmer.ShimmerFrameLayout.getMaskBitmap():android.graphics.Bitmap\");\n }", "public LinkedList<NaturaLight> listSensorNaturaLight(){\r\n LinkedList<NaturaLight> aux=new LinkedList<>();\r\n for (Sensor s:sensors){\r\n if(s instanceof NaturaLight)\r\n aux.add((NaturaLight)s);\r\n }\r\n return aux;\r\n }", "private LinkedList<Smoke> listSensorSmoke(){\r\n LinkedList<Smoke> aux=new LinkedList<>();\r\n for (Sensor s:sensors){\r\n if(s instanceof Smoke)\r\n aux.add((Smoke)s);\r\n }\r\n return aux;\r\n }", "private void findDrawList() {\n\t\tPanImageEntry chosenPanImage = null;\n\t\tfor (int n=0; n < panImageList.length; n++) {\n\t\t\tPanImageEntry panImage = panImageList[n];\n\t\t\tif (!panImage.imageListEntry.enabled) {\n\t\t\t\tpanImage.draw = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ((chosenPanImage == null) \n\t\t\t\t\t|| (chosenPanImage.imageListEntry.getImageCategory().charAt(0) != panImage.imageListEntry.getImageCategory().charAt(0))\n\t\t\t\t\t|| (chosenPanImage.imageListEntry.getImageMetadataEntry().inst_az_rover != panImage.imageListEntry.getImageMetadataEntry().inst_az_rover)\n\t\t\t\t\t|| (chosenPanImage.imageListEntry.getImageMetadataEntry().inst_el_rover != panImage.imageListEntry.getImageMetadataEntry().inst_el_rover)\n\t\t\t\t\t) {\n\t\t\t\t// different pointing\n\t\t\t\tpanImage.draw = true;\n\t\t\t\tchosenPanImage = panImage;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// same pointing as lastPanImage\n\t\t\t\t// find out if this image is better choice (selected or better image class)\n\t\t\t\tString imageCat = panImage.imageListEntry.getImageCategory();\n\t\t\t\tString chosenImageCat = chosenPanImage.imageListEntry.getImageCategory();\n\t\t\t\tif (panImage == selectedPanImageEntry) {\n\t\t\t\t\tchosenPanImage.draw = false;\n\t\t\t\t\tpanImage.draw = true;\n\t\t\t\t\tchosenPanImage = panImage;\n\t\t\t\t}\n\t\t\t\telse if ((chosenPanImage != selectedPanImageEntry) && (isSuperiorImageCat(imageCat, chosenImageCat)))\n\t\t\t\t{\n\t\t\t\t\tchosenPanImage.draw = false;\n\t\t\t\t\tpanImage.draw = true;\n\t\t\t\t\tchosenPanImage = panImage;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tpanImage.draw = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "void handlePixelStart(int x, int y, int color);", "public static ArrayList<String> getColorsDetected() {\n return colorsDetected;\n }", "private void drawWalls(){\n for(int i = 0 ; i < wallsArrayList.size(); i++){\n wallsArrayList.get(i).drawImage(buffer);\n }\n\n }", "private static /* synthetic */ boolean[] m37845a() {\n boolean[] zArr = f35339a;\n if (zArr != null) {\n return zArr;\n }\n boolean[] probes = Offline.getProbes(8351510718017544634L, \"com/mopub/mobileads/native_video/R$drawable\", 1);\n f35339a = probes;\n return probes;\n }", "public native PixelPacket[] getColormap() throws MagickException;", "public ArrayList getDeviceInfo();", "public List<Piece> blackPieces();", "int[] getStartRGB();", "public List<Paint[][]> getColouredArray() {\n\t\tList<Paint[][]> allFrames = new ArrayList<Paint[][]>();\r\n\t\ttry (BufferedReader br = new BufferedReader(new FileReader(this.file))) {\r\n\t\t\tString line;\r\n\t\t\twhile ((line = br.readLine()) != null) { // get each row/column pair\r\n\t\t\t\tPaint[][] frame = new Paint[20][20];\r\n\t\t\t\tString[] rows = line.split(\"/\");\r\n\t\t\t\tfor (int i = 0; i < rows.length; i++) { // rows.length is 20 hopefully... else I fucked up\r\n\t\t\t\t\tString currentRow = rows[i];\r\n\t\t\t\t\tfor (int z = 0; z < 59; z += 3) {\r\n\t\t\t\t\t\tString currentValue = currentRow.substring(z, z+3);\r\n\t\t\t\t\t\tPaint p = convertToPaint(currentValue);\r\n\t\t\t\t\t\tframe[i][z/3] = p;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tallFrames.add(frame.clone());\r\n\t\t\t}\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn allFrames;\r\n\t}", "public static ArrayList<Background> binnedDataToBackground (HashMap<String, HashMap<Integer, Integer>> frequencyMap, String detector){\r\n\r\n\t\t//get the data of the desired detector\r\n\t\tHashMap<Integer, Integer> frequencyTable = frequencyMap.get(detector);\r\n\r\n\t\t//arraylist of the bin minimums in the map so we can loop through all of them \r\n\t\tArrayList<Integer> binMinimums = new ArrayList<Integer>();\r\n\t\tbinMinimums .addAll(frequencyTable.keySet());\r\n\r\n\r\n\r\n\t\tArrayList<Background> actualReadings = new ArrayList<Background>();\r\n\r\n\t\t//initialise the values that the background object needs\r\n\t\tint currentFrequency;\r\n\t\tint currentMax;\r\n\t\tint currentMin;\r\n\r\n\t\t//loop throuhg the keyset of the frequency table \r\n\t\tfor (int binMin : binMinimums){\r\n\r\n\t\t\t//current frequency/events is the value in the frequency table\r\n\t\t\tcurrentFrequency = frequencyTable.get(binMin);\r\n\r\n\t\t\t//minimum is the key in the frequency table\r\n\t\t\tcurrentMin = binMin;\r\n\r\n\t\t\t//bin width of 1, so max is min +1\r\n\t\t\tcurrentMax = binMin +1;\r\n\r\n\r\n\t\t\t//make a new background object to be added to the arraylist\r\n\t\t\tBackground r = new Background();\r\n\r\n\t\t\t//set the events, min and max found above\r\n\t\t\tr.setEvents(currentFrequency);\r\n\t\t\tr.setMin(currentMin);\r\n\t\t\tr.setMax(currentMax);\r\n\r\n\t\t\t//add to the arraylist\r\n\t\t\tactualReadings.add(r);\r\n\r\n\t\t}\r\n\t\treturn actualReadings;\r\n\r\n\t}", "public void gray_sweep(FTBitmapRec target) {\nDebug(0, DebugTag.DBG_SWEEP, TAG, \"gray_sweep\");\n int yindex;\n\n if (num_cells == 0) {\n return;\n }\n num_gray_spans = 0;\n FTTrace.Trace(7, TAG, \"gray_sweep: start \"+ycount);\n for (yindex = 0; yindex < ycount; yindex++) {\n TCellRec cell = ycells[yindex];\n int cover = 0;\n int x = 0;\n\n for ( ; cell != null; cell = cell.getNext()) {\n int area;\n\nDebug(0, DebugTag.DBG_SWEEP, TAG, String.format(\"cell->next: %d\", cell.getNext() == null ? -1 : cell.getNext().getSelf_idx()));\nDebug(0, DebugTag.DBG_SWEEP, TAG, String.format(\"gray_sweep 1: cell.x: %d x: %d, yindex: %d, cover: %x\", cell.getX(), x, yindex, cover));\n if (cell.getX() > x && cover != 0) {\n gray_hline(x, yindex, cover * (RasterUtil.ONE_PIXEL() * 2), cell.getX() - x );\n }\n cover += cell.getCover();\n area = cover * (RasterUtil.ONE_PIXEL() * 2) - cell.getArea();\n if (area != 0 && cell.getX() >= 0) {\n gray_hline(cell.getX(), yindex, area, 1 );\n }\n x = cell.getX() + 1;\n }\n if (cover != 0) {\n gray_hline(x, yindex, cover * (RasterUtil.ONE_PIXEL() * 2), count_ex - x);\n }\n }\n if (num_gray_spans > 0) {\n gray_render_span(span_y, num_gray_spans, gray_spans);\n }\n if (num_gray_spans > 0) {\n FTSpanRec span;\n int spanIdx = 0;\n int n;\n StringBuffer str = new StringBuffer(\"\");\n\n str.append(String.format(\"y = %3d \", span_y));\n for (n = 0; n < num_gray_spans; n++, spanIdx++) {\n span = gray_spans[spanIdx];\n str.append(String.format(\" [%d..%d]:0x%02x \",\n span.getX(), span.getX() + span.getLen() - 1, span.getCoverage() & 0xFF));\n }\n FTTrace.Trace(7, TAG, str.toString());\n }\n FTTrace.Trace(7, TAG, \"gray_sweep: end\");\n }", "public void setPixel(int x, int y, short red, short green, short blue) {\n // Your solution here, but you should probably leave the following line\n // at the end.\n\t //if setPixel at the first location.\n\t if((x==0) && (y==0)) {\n\t\t if(red!=runs.getFirst().item[1]) {\n\t\t\t if(runs.getFirst().item[0]!=1) {\n\t\t\t\t int[] item= new int[] {1,red,green,blue};\n\t\t\t\t runs.getFirst().item[0]=runs.getFirst().item[0]-1;\n\t\t\t\t runs.addFirst(item);\n\t\t\t }\n\t\t\t else {\n\t\t\t\t if(red!=runs.getFirst().next.item[1]) {\n\t\t\t\t runs.remove(runs.nth(1));\n\t\t\t\t int[] item= new int[] {1,red,green,blue};\n\t\t\t\t runs.addFirst(item);\n\t\t\t\t System.out.println(runs.toString());\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t\t\t runs.remove(runs.nth(1));\n\t\t\t\t\t runs.getFirst().item[0]=runs.getFirst().item[0]+1;\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\t }\n\t \n\t //if setPixel at the last location.\n\t else if((x==(width-1)) && (y==(height-1))) {\n\t\t if(runs.getLast().item[0]==1) {\n\t\t\t if(red!=runs.getLast().prev.item[1]) {\n\t\t\t\t int[] item= new int[] {1,red,green,blue}; \n\t\t\t\t runs.remove(runs.getLast());\n\t\t\t\t runs.addLast(item);\n\t\t }\n\t\t \n\t\t\t else {\n\t\t\t\t runs.remove(runs.getLast());\n\t\t\t\t runs.getLast().item[0]=runs.getLast().item[0]+1;\n\t\t\t }\n\t\t\t \n\t\t }\n\t\t else {\n\t\t\t int[] item= new int[] {1,red,green,blue};\n\t\t\t runs.addLast(item);\n\t\t\t runs.getLast().prev.item[0]=runs.getLast().prev.item[0]-1;\n\t\t }\n\t }\n\t \n\t //if Pixel is at a random location.\n//\t if(((x>0) && (y>0)) && ((x!=(width-1)) && (y!=(height-1))) ) {\n//\t if((x>0)&&(x!=(width-1))){\n\t else {\n\t int loc=y*(width)+x+1; \n\t int count=0;\n\t for(int i=0;i<runs.length();i++) {\n\t\t \n\t\tloc=loc-runs.nth(i+1).item[0] ;\n\t\tcount++;\n\t\tif (loc<=0) {\n\t\t\tbreak;\n\t\t}\n\t }\n\t if((loc==0) && (runs.nth(count).item[0]==1)){\n\t\t if((red!=runs.nth(count).next.item[1])&&(red!=runs.nth(count).prev.item[1])) { \n\t\t\t int[] item= new int[] {1,red,green,blue};\n\t\t\t runs.addAfter(runs.nth(count), item);\n\t\t\t runs.remove(runs.nth(count));\n\t\t }\n\t\t if((red==(runs.nth(count).next).item[1])&& (red!=runs.nth(count).prev.item[1])){\n\t\t\t runs.remove(runs.nth(count));\n\t\t\t runs.nth(count).item[0]=runs.nth(count).item[0]+1;\n\t\t }\t\n\t\t if((red==(runs.nth(count).prev).item[1])&&(red!=runs.nth(count).next.item[1])) {\n\t\t\t runs.remove(runs.nth(count));\n\t\t\t runs.nth(count).prev.item[0]=runs.nth(count).prev.item[0]+1;\n\t\t }\t\n\t\t if((red==(runs.nth(count).prev).item[1])&&(red==runs.nth(count).next.item[1])) {\n\t\t\t runs.nth(count).prev.item[0]=runs.nth(count).prev.item[0]+1+runs.nth(count).next.item[0];\n\t\t\t runs.remove(runs.nth(count));\n\t\t\t runs.remove(runs.nth(count));\n\t\t }\n\t }\n\t else if((loc==0) && (runs.nth(count).item[0]!=1)) {\n\t\t if(red!=runs.nth(count).next.item[1]) {\n\t\t\t runs.nth(count).item[0]=runs.nth(count).item[0]-1;\n\t\t\t int[] item= new int[] {1,red,green,blue};\n\t\t\t runs.addAfter(runs.nth(count), item);\t \n\t\t }\n\t\t else {\n\t\t\t runs.nth(count+1).item[0]=runs.nth(count+1).item[0]+1;\n\t\t }\t\t \n\t } \n\t else if(loc!=0) {\n\t\t \n\t\t int[] item= new int[] {1,red,green,blue};\n\n//\t\t DListNode<int[]> dup=runs.nth(count);\n//\t\t System.out.println(\"This is dup\"+dup.item[0]+\" \"+dup.item[1]+\" \"+dup.item[2]+\" \"+dup.item[0]);\t\t \n\t\t runs.addAfter(runs.nth(count), item);\n\t\t int[] dup=new int[] {runs.nth(count).item[0],runs.nth(count).item[1],runs.nth(count).item[2],runs.nth(count).item[3]};\n\t\t runs.addAfter(runs.nth(count).next, dup);\n\t\t System.out.println(runs.nth(count).item[0]+\"This is loc \"+loc+\"THis is count \"+count);\n\t\t runs.nth(count).item[0]=runs.nth(count).item[0]+loc-1;\n\t\t System.out.println(runs.nth(count).next.next.item[0]+\"This is loc \"+loc+\"THis is count \"+count);\n\t\t runs.nth(count).next.next.item[0]=runs.nth(count).next.next.item[0]+loc-1;\t\n\t\t }\n\t\t \n\t \n\t }\n check();\n}", "public ArrayList<Drawable> getConstantDisplay(){return this.toDisplay;}", "public int[] get_infos_noise() {\n int[] tmp = new int[3];\n for (int index0 = 0; index0 < numElements_infos_noise(0); index0++) {\n tmp[index0] = getElement_infos_noise(index0);\n }\n return tmp;\n }", "private void drawWhite() throws IOException, ReversiException {\n playSound(PLAY_SOUND);\n // get the list of stones need to be changed\n String list = fromServer.readUTF();\n // draw white the list of stones\n boardComponent.drawWhite(list);\n setScoreText();\n\n // followed by the TURN command\n responseToServer();\n }", "private void overexposure(Bitmap bmp) {\n int w = bmp.getWidth();\n int h = bmp.getHeight();\n int[] pixels = new int[w*h];\n bmp.getPixels(pixels, 0, w, 0, 0, w, h);\n for (int i = 0; i < w*h; i++) {\n float[] hsv = new float[3];\n Color.RGBToHSV(Color.red(pixels[i]), Color.green(pixels[i]), Color.blue(pixels[i]), hsv);\n hsv[2] *= 1.5;\n pixels[i] = Color.HSVToColor(hsv);\n }\n bmp.setPixels(pixels, 0, w, 0, 0, w, h);\n }", "public void doAutoDetect()\r\n {\r\n Graphics g = this.getGraphics(); \r\n // Create the off-screen drawing area\r\n offscreenImage = createImage(getWidth(), getHeight());\r\n offscreenGraphics = offscreenImage.getGraphics();\r\n long start;\r\n long end;\r\n\r\n // Tally the number of times we were able to draw direct and buffered\r\n int directCount = 0;\r\n int bufferedCount = 0;\r\n\r\n g.setColor(getBackground());\r\n // Mark what time we started\r\n start = System.currentTimeMillis();\r\n end = start;\r\n\r\n // Paint patterns directly to the screen, but only for 500 milliseconds\r\n while ((end-start) < 500) {\r\n paintDetectionDesign(g);\r\n end = System.currentTimeMillis();\r\n directCount++;\r\n }\r\n g.setColor(getForeground());\r\n\r\n // record the total time spent drawing directly\r\n long directTime = end - start;\r\n\r\n start = System.currentTimeMillis();\r\n end = start;\r\n\r\n // Paint patterns to the offscreen graphics, but only for 500 milliseconds\r\n while ((end-start) < 500) {\r\n paintDetectionDesign(offscreenGraphics);\r\n end = System.currentTimeMillis();\r\n bufferedCount++;\r\n }\r\n\r\n long bufferedTime = end - start;\r\n\r\n // If we were able to draw more times using the buffered graphics,\r\n // or if the drawing counts are the same, but the total time for\r\n // the buffering was less, buffering is faster.\r\n if ((bufferedCount > directCount) ||\r\n ((bufferedCount == directCount) &&\r\n (bufferedTime < directTime))) {\r\n drawDirect = false;\r\n } else {\r\n // If we want to draw direct, free the space taken up by the\r\n // offscreen image and graphics context.\r\n offscreenImage.flush();\r\n offscreenImage = null;\r\n offscreenGraphics = null;\r\n drawDirect = true;\r\n }\r\n }", "public synchronized List<WebElement> list_ColorSwatchName() throws Exception {\n\n\t\treturn utils.findElementsByLocator(driver, \"PDP_ColorSwatchName\",\n\t\t\t\t\"| PDP: Color swatch Name Not Displayed On PDP\");\n\t}", "private static /* synthetic */ boolean[] m37850a() {\n boolean[] zArr = f35344a;\n if (zArr != null) {\n return zArr;\n }\n boolean[] probes = Offline.getProbes(-3026766588269170283L, \"com/mopub/mobileads/native_video/R$style\", 1);\n f35344a = probes;\n return probes;\n }", "public void resolveLights(){trafficList.forEach(TrafficLight::resolve);}", "public void discoverDevices(){\r\n \t// If we're already discovering, stop it\r\n if (mBtAdapter.isDiscovering()) {\r\n mBtAdapter.cancelDiscovery();\r\n }\r\n \r\n Toast.makeText(this, \"Listining for paired devices.\", Toast.LENGTH_LONG).show();\r\n \tmBtAdapter.startDiscovery(); \r\n }", "public void createList () {\n imageLocs = new ArrayList <Location> ();\n for (int i = xC; i < xLength * getPixelSize() + xC; i+=getPixelSize()) {\n for (int j = yC; j < yLength * getPixelSize() + yC; j+=getPixelSize()) {\n Location loc = new Location (i, j, LocationType.POWERUP, true);\n\n imageLocs.add (loc);\n getGridCache().add(loc);\n \n }\n }\n }", "public ArrayList<Screen> getScreensFromConf(Configuration c) {\n\n ArrayList<Screen> screenArrayList = new ArrayList<>();\n\n for(Screen s : screens)\n if(s.getConfiguration() == c)\n screenArrayList.add(s);\n\n return screenArrayList;\n\n }", "public Color[][] getPixels() {\r\n return pixels;\r\n }", "protected int[] getPalettePixels() {\n \t\t\tif (palettePixels == null) {\n \n \t\t\t\tpalettePixels = new int[numColors];\n \t\t\t\t\n \t\t\t\tfor (int x = 0; x < numColors; x++) {\n \t\t\t\t\tpalettePixels[x] = rgb8ToPixel(palette[x]);\n \t\t\t\t}\n \t\t\t}\n \t\t\treturn palettePixels;\n \t\t}", "private void setPixelInfo(Stroke theStroke)\n\t{\n\t\t// get the data from the stroke in the required format\n\t\tVector ptList = theStroke.getM_ptList();\n\t\t//double [][] strokeMat = theStroke.getPointsAs2DMatrix_Double();\n\t\tint stkLen = ptList.size();\n\t\t// init local variables\n\t\tPixelInfo prevPixel = null;\n\t\tPixelInfo currPixel = null;\n\t\tint winSize_speed = 0;\n\t\tint winSize_slope = 0;\n\t\tdouble cummDist_speed = 0.0;\n\t\t\n\t\tIterator iter = ptList.iterator();\n\t\t// set the pixel properties for the first pixel of the stroke.\n\t\tif(iter.hasNext())\n\t\t{\n\t\t\t// init the curvature and curvature of first pixel, set them to 0\n\t\t\tprevPixel = (PixelInfo)iter.next();\n\t\t\tprevPixel.setCurvature(0);\n\t\t\tprevPixel.setSpeed(0);\n\t\t\tprevPixel.setSlope(0);\n\t\t\t// System.out.println(\"i = 0: \"+prevPixel);\n\t\t}\n\n\t\t// set the pixel property values for the remaining pixels\n\t\tint index=0;\n\t\twhile(iter.hasNext())\n\t\t{\n\t\t\tindex++;\n\n\t\t\t// get the second pixel\n\t\t\tcurrPixel = (PixelInfo)iter.next();\n\n\t\t\t// increment the counter for speed\n\t\t\tif(winSize_speed < SpeedBasedDetection.DEF_WIN_SIZE_SPEED) \n\t\t\t{\n\t\t\t\twinSize_speed++;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// remove the distance of the last pixel in the window\n\t\t\t\tPoint a = ((PixelInfo) ptList.get(index - winSize_speed -1));\n\t\t\t\tPoint b = ((PixelInfo)ptList.get(index - winSize_speed));\n\t\t\t\t// System.out.println(\"prev dist: \"+a.distance(b));\n\t\t\t\tcummDist_speed -= a.distance(b); \n\t\t\t}\n\t\t\t// System.out.println(\"Speed: \"+winSize_speed);\n\t\t\t\n\t\t\t// add the distance of current pixel in the window\n\t\t\tdouble thisDist = prevPixel.distance(currPixel);\n\t\t\t//System.out.println(\"this dist: \"+thisDist);\n\t\t\tcummDist_speed += thisDist;\n\t\t\t//System.out.println(\"summ distance: \"+cummDist_speed);\n\t\t\t\n\t\t\t// do speed calculations for this pixel\n\t\t\tPixelInfo a = (PixelInfo) ptList.get(index - winSize_speed);\n\t\t\tdouble cummTime_speed = currPixel.getTime() - a.getTime();\n\t\t\tcurrPixel.setSpeed(cummDist_speed/cummTime_speed);\n\t\t\t\n\t\t\t// set slope for the current pixel\n\t\t\tif(winSize_slope < CurvatureBasedDetection.DEF_WIN_SIZE_SLOPE)\n\t\t\t{\n\t\t\t\twinSize_slope++;\n\t\t\t}\n\n\t\t\t// calculate the actual window size\n\t\t\tint start = index - winSize_slope;\n\t\t\tint end = index + winSize_slope;\n\t\t\t\n\t\t\t// incase the window is running out of the stroke length, adjust the window size to fit the stroke\n\t\t\tif(end > (stkLen-1))\n\t\t\t{\n\t\t\t\tend = stkLen-1;\n\t\t\t\tstart = index - (end-index);\n\t\t\t}\n\t\t\t\n\t\t\t// TODO: check for this code\n\t\t\t//System.out.println(\"Slope :start: \"+start+\" end: \"+end);\n\t\t\tdouble[][] winElem = theStroke.getWindowElemAs2DMatrix_Double(start, end);\n\t\t\tif(winElem!=null)\n\t\t\t{\n\t\t\t\tdouble[] odr = Maths.performODR(winElem);\n\t\t\t\tcurrPixel.setSlope(odr[0]);\n\t\t\t\t\n\t\t\t\t//ISHWAR\n\t\t\t\t//System.out.println(Maths.angle(currPixel.getSlope(), 1) + \" \" + Maths.angle(prevPixel.getSlope(), 1) + \"\\n\");\n\t\t\t\t// calculate the curvature information\n\t\t\t\tdouble slopeChange = Maths.angle(currPixel.getSlope(), 1) - Maths.angle(prevPixel.getSlope(), 1);\n\t\t\t\t\n\t\t\t\t//ISHWAR\n/*\t\t\t\tif( (Maths.angle(currPixel.getSlope(), 1) < 0 && Maths.angle(prevPixel.getSlope(), 1) >0) || ( Maths.angle(currPixel.getSlope(), 1) > 0 && Maths.angle(prevPixel.getSlope(), 1) <0) )\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"Slope Changed\");\n\t\t\t\t\tslopeChange=0.0001;\n\t\t\t\t}*/\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// System.out.println(\"slopeChange \"+slopeChange);\n\t\t\t\tif(slopeChange == 0.0 && thisDist == 0.0){\n\t\t\t\t\tcurrPixel.setCurvature(prevPixel.getCurvature());\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\tcurrPixel.setCurvature(slopeChange/thisDist);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// NOTE: TODO this should not happen\n\t\t\t}\n\t\t\tSystem.out.println(\"i = \"+index+\": \"+currPixel);\n\t\t\t\n\t\t\tprevPixel = currPixel;\n\t\t\tcurrPixel = null;\n\t\t}\t\t\n/*\t\t\n\t\tif(iter.hasNext())\n\t\t{\n\t\t\t// get the second point\n\t\t\tcurrPixel = (PixelInfo)iter.next();\n\t\t\t\n\t\t\tprevCurrDist = prevPixel.distance(currPixel);\n\t\t\tprevCurrAngle = GlobalMethods.angle(prevPixel, currPixel);\n\t\t\t// System.out.println(prevCurrAngle);\n\t\t\t// no need to check for divide by zero error points are not sampled until the mouse moves \n\t\t\t// and when the mouse moves time will be different due to the sampling rate.\n\t\t\tdouble speed = prevCurrDist / (currPixel.getTime() - prevPixel.getTime());\n\t\t\t//System.out.println(\"speed: \"+ speed);\n\t\t\tcurrPixel.setSpeed(speed);\n\t\t}\n\n\t\twhile (iter.hasNext())\n\t\t{\n\t\t\tPixelInfo nextPixel = (PixelInfo) iter.next();\n\t\t\t\n\t\t\t// calculate curvature at this pixel\n\t\t\tdouble currNextDist = currPixel.distance(nextPixel);\n\t\t\tdouble currNextAngle = GlobalMethods.angle(currPixel, nextPixel);\n\t\t\t// System.out.println(currNextAngle);\n\t\t\t\n\t\t\t// no need to check for divide by zero error points are not sampled until the mouse moves \n\t\t\t// and when the mouse moves time will be different due to the sampling rate.\n\t\t\tdouble speed = currNextDist / (nextPixel.getTime() - currPixel.getTime());\n\t\t\t//System.out.println(\"speed: \"+ speed);\n\t\t\tnextPixel.setSpeed(speed);\n\t\t\t\n\t\t\t// curvature is the change of slope divided by change of distance \n\t\t\t// double curvature = (currNextAngle-prevCurrAngle)/(currNextDist+prevCurrDist);\n\t\t\tdouble curvature = (currNextAngle-prevCurrAngle)/prevCurrDist;\n\t \t\n\t \t// set the value of curvature for this pixel\n\t \tcurrPixel.setCurvature(Math.abs(curvature));\n\t \t\n\t \t// transfer values\n\t \tprevPixel = currPixel;\n\t \tcurrPixel = nextPixel;\n\t \tprevCurrDist = currNextDist;\n\t \tprevCurrAngle = currNextAngle;\n\t\t}\n*/\t\t\n\t\t// set the curvature of the last pixel to 0, the last pixel is stored in currPixel\n\t\tif(currPixel != null) currPixel.setCurvature(0);\n\t\t\n\t\tfor(int i=0;i<ptList.size();i++)\n\t\t{\n\t\t\tPixelInfo pi = (PixelInfo)ptList.get(i);\n//ISHWAR\t\t\tSystem.out.println(i + \". (\" + pi.x + \",\" + pi.y + \") \" +pi.getCurvature() + \" \" + pi.getTime() + \" \" + pi.getSpeed());\n\t\t}\n\t}", "public List<Colour> getPlayerList();", "@Override\r\n public int[] grabPixels(Object canvas, int width, int height, \r\n int[] pixels, int startRow, int nRows) {\r\n\t {}\r\n int[] buf = Image.grabPixels(Image.getGraphics(canvas), width, height); \r\n /**\r\n * @j2sNative\r\n * \r\n * canvas.buf32 = buf;\r\n * \r\n */\r\n {}\r\n return buf;\r\n\t}", "public synchronized List<WebElement> list_ColorSwatchQuickShop() throws Exception {\n\n\t\treturn utils.findElementsByLocator(driver, \"PDP_Lnk_ColorSwatchQuickShop\",\n\t\t\t\t\"| PDP: Color swatch Not Displayed On PDP\");\n\t}", "private void traverseBayeredPatternFullSizeRGB() {\n\n for (int x = 0; x < originalImageHeight -1; x++){\n for (int y = 1; y < originalImageWidth -1; y++){\n Point position = new Point(x,y);\n int absolutePosition = getAbsolutPixelPosition(position);\n\n PixelType pixelType = null;\n\n if (x%2 == 0 && y%2 == 0) pixelType = PixelType.GREEN_TOPRED;\n if (x%2 == 0 && y%2 == 1) pixelType = PixelType.BLUE;\n if (x%2 == 1 && y%2 == 0) pixelType = PixelType.RED;\n if (x%2 == 1 && y%2 == 1) pixelType = PixelType.GREEN_TOPBLUE;\n\n fullSizePixRGB[absolutePosition] = getFullSizeRGB(new Point(x,y),pixelType);\n }\n }\n }", "private List<String> getSpectrumIdsFound()\r\n\t{\r\n\t\treturn this.spectrumIdsFound;\r\n\t}", "java.util.List<Report.LocationOuterClass.Wifi> \n getWifisList();", "public native int getColors() throws MagickException;", "public void drawSelf() {\n for (Point p : matches) {\n this.drawPoint(p, Color.WHITE);\n }\n }", "public BufferedImage getThresh(BufferedImage img, int left, int right, int top, int bottom) { // Method to get thresholded image \n\t\t//Vision.logger.debug(\"Starting thresholding\");\n\n\t\t//stops it fucking up the locations before we've given it the thresholds\n\t\tif (worldState.isClickingDone()){\n\n\t\t\tnewBluePixels = new ArrayList<Point>();\n\t\t\tnewYellowPixels = new ArrayList<Point>();\n\t\t\tArrayList<Point> bluePixels = new ArrayList<Point>();\n\t\t\tArrayList<Point> yellowPixels = new ArrayList<Point>();\n\t\t\t/*pitch = worldState.getRoom();\n\t\t\twidth = right-left;\n\t\t\theight = top-bottom;*/\n\n\t\t\t/*\n Initialising to one to stop java dividing by 0 when it shouldn't\n\t\t\t */\n\t\t\tredCountA = 0;\n\t\t\tredCountB = 0;\n\t\t\tredCountC = 0;\n\t\t\tredCountD = 0;\n\t\t\tredCountE = 0;\n\t\t\tredCentroidA.setLocation(0,0);\n\t\t\tredCentroidB.setLocation(0,0);\n\t\t\tredCentroidC.setLocation(0,0);\n\t\t\tredCentroidD.setLocation(0,0);\n\t\t\tredCentroidE.setLocation(0,0);\n\n\t\t\tblueCountA = 0;\n\t\t\tblueCountB = 0;\n\t\t\tblueCountC = 0;\n\t\t\tblueCountD = 0;\n\t\t\tblueCountE = 0;\n\t\t\tblueCentroidA.setLocation(0,0);\n\t\t\tblueCentroidB.setLocation(0,0);\n\t\t\tblueCentroidC.setLocation(0,0);\n\t\t\tblueCentroidD.setLocation(0,0);\n\t\t\tblueCentroidE.setLocation(0,0);\n\n\t\t\tyellowCountA = 0;\n\t\t\tyellowCountB = 0;\n\t\t\tyellowCountC = 0;\n\t\t\tyellowCountD = 0;\n\t\t\tyellowCountE = 0;\n\t\t\tyellowCentroidA.setLocation(0,0);\n\t\t\tyellowCentroidB.setLocation(0,0);\n\t\t\tyellowCentroidC.setLocation(0,0);\n\t\t\tyellowCentroidD.setLocation(0,0);\n\t\t\tyellowCentroidE.setLocation(0,0);\n\n\t\t\t//Vision.logger.debug(\"Iterating image\");\n\t\t\tfor (int i = left; i < right; i++) {\n\t\t\t\tfor (int j = top; j < bottom; j++) {\n\t\t\t\t\t//Vision.logger.debug(\"Oh dear (i,j) = \" + Integer.toString(i) + \",\" + Integer.toString(j) + \")\");\n\t\t\t\t\tc = new Color(img.getRGB(i,j));\n\n\t\t\t\t\tGB = Math.abs((c.getBlue() - c.getGreen()));\n\t\t\t\t\tRG = Math.abs((c.getRed() - c.getGreen()));\n\t\t\t\t\t//RB = Math.abs((c.getRed() - c.getBlue()));\n\n\t\t\t\t\tif(isRed(c, GB)){ // was inside RB > 50 && RG > 50\n\t\t\t\t\t\timg.setRGB(i, j, Color.red.getRGB()); //Red Ball\n\t\t\t\t\t\trandy = Math.random();\n\t\t\t\t\t\tif (randy > 0 && randy <= 0.2){\t\t\t\t\t\t \n\t\t\t\t\t\t\tredCountA++;\n\t\t\t\t\t\t\tredCentroidA.setLocation(redCentroidA.getX() + i, redCentroidA.getY() + j);\n\t\t\t\t\t\t}else if (randy > 0.2 && randy <= 0.4){\n\t\t\t\t\t\t\tredCountB++;\n\t\t\t\t\t\t\tredCentroidB.setLocation(redCentroidB.getX() + i, redCentroidB.getY() + j);\n\t\t\t\t\t\t}else if (randy > 0.4 && randy <= 0.6){\n\t\t\t\t\t\t\tredCountC++;\n\t\t\t\t\t\t\tredCentroidC.setLocation(redCentroidC.getX() + i, redCentroidC.getY() + j);\n\t\t\t\t\t\t}else if (randy > 0.6 && randy <= 0.8){\n\t\t\t\t\t\t\tredCountD++;\n\t\t\t\t\t\t\tredCentroidD.setLocation(redCentroidD.getX() + i, redCentroidD.getY() + j);\n\t\t\t\t\t\t}else if (randy > 0.8 && randy <= 1){\n\t\t\t\t\t\t\tredCountE++;\n\t\t\t\t\t\t\tredCentroidE.setLocation(redCentroidE.getX() + i, redCentroidE.getY() + j);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\telse if (isYellow(c)) {\n\t\t\t\t\t\tsetCs(i,j,right,left,top,bottom, img);\n\t\t\t\t\t\tif (isYellow(cS) && isYellow(cE) && isYellow(cEE) && isYellow(cEN) && isYellow(cSS) && isYellow(cSW) ){\n\t\t\t\t\t\t\timg.setRGB(i, j, Color.yellow.getRGB()); // Yellow robot\n\t\t\t\t\t\t\tyellowRobotX.add(i);\n\t\t\t\t\t\t\tyellowRobotY.add(j);\n\t\t\t\t\t\t\trandy = Math.random();\n\t\t\t\t\t\t\tif (randy > 0 && randy <= 0.2){\t\t\t\t\t\t \n\t\t\t\t\t\t\t\tyellowCountA++;\n\t\t\t\t\t\t\t\tyellowCentroidA.setLocation(yellowCentroidA.getX() + i, yellowCentroidA.getY() + j);\n\t\t\t\t\t\t\t}else if (randy > 0.2 && randy <= 0.4){\n\t\t\t\t\t\t\t\tyellowCountB++;\n\t\t\t\t\t\t\t\tyellowCentroidB.setLocation(yellowCentroidB.getX() + i, yellowCentroidB.getY() + j);\n\t\t\t\t\t\t\t}else if (randy > 0.4 && randy <= 0.6){\n\t\t\t\t\t\t\t\tyellowCountC++;\n\t\t\t\t\t\t\t\tyellowCentroidC.setLocation(yellowCentroidC.getX() + i, yellowCentroidC.getY() + j);\n\t\t\t\t\t\t\t}else if (randy > 0.6 && randy <= 0.8){\n\t\t\t\t\t\t\t\tyellowCountD++;\n\t\t\t\t\t\t\t\tyellowCentroidD.setLocation(yellowCentroidD.getX() + i, yellowCentroidD.getY() + j);\n\t\t\t\t\t\t\t}else if (randy > 0.8 && randy <= 1){\n\t\t\t\t\t\t\t\tyellowCountE++;\n\t\t\t\t\t\t\t\tyellowCentroidE.setLocation(yellowCentroidE.getX() + i, yellowCentroidE.getY() + j);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tyellowPixels.add(new Point(i,j));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if (isBlue(c)){\n\t\t\t\t\t\tsetCs(i,j,right,left,top,bottom, img);\n\t\t\t\t\t\tif (isBlue(cS) && isBlue(cE) && isBlue(cEE) && isBlue(cEN) && isBlue(cSS) && isBlue(cSW) ){\n\t\t\t\t\t\t\timg.setRGB(i, j, Color.blue.getRGB()); // Blue robot \n\t\t\t\t\t\t\tblueRobotX.add(i);\n\t\t\t\t\t\t\tblueRobotY.add(j);\n\t\t\t\t\t\t\trandy = Math.random();\n\t\t\t\t\t\t\tif (randy > 0 && randy <= 0.2){\t\t\t\t\t\t \n\t\t\t\t\t\t\t\tblueCountA++;\n\t\t\t\t\t\t\t\tblueCentroidA.setLocation(blueCentroidA.getX() + i, blueCentroidA.getY() + j);\n\t\t\t\t\t\t\t}else if (randy > 0.2 && randy <= 0.4){\n\t\t\t\t\t\t\t\tblueCountB++;\n\t\t\t\t\t\t\t\tblueCentroidB.setLocation(blueCentroidB.getX() + i, blueCentroidB.getY() + j);\n\t\t\t\t\t\t\t}else if (randy > 0.4 && randy <= 0.6){\n\t\t\t\t\t\t\t\tblueCountC++;\n\t\t\t\t\t\t\t\tblueCentroidC.setLocation(blueCentroidC.getX() + i, blueCentroidC.getY() + j);\n\t\t\t\t\t\t\t}else if (randy > 0.6 && randy <= 0.8){\n\t\t\t\t\t\t\t\tblueCountD++;\n\t\t\t\t\t\t\t\tblueCentroidD.setLocation(blueCentroidD.getX() + i, blueCentroidD.getY() + j);\n\t\t\t\t\t\t\t}else if (randy > 0.8 && randy <= 1){\n\t\t\t\t\t\t\t\tblueCountE++;\n\t\t\t\t\t\t\t\tblueCentroidE.setLocation(blueCentroidE.getX() + i, blueCentroidE.getY() + j);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbluePixels.add(new Point(i,j));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//make blue thresholds for the different pitches in that [pitch][x] style\n\t\t\t\t\t}\n\t\t\t\t\telse if (isGreen(c,GB,RG)) {\n\t\t\t\t\t\timg.setRGB(i,j, Color.green.getRGB()); // GreenPlates \n\t\t\t\t\t\tif (Point.distance(\tworldState.getBlueRobot().getPosition().getCentre().x,\n\t\t\t\t\t\t\t\tworldState.getBlueRobot().getPosition().getCentre().y,\n\t\t\t\t\t\t\t\ti,j) < 34) {\n\t\t\t\t\t\t\tblueGreenPlate.add(new Point(i,j));\n\t\t\t\t\t\t} \n\t\t\t\t\t\tif (Point.distance(\tworldState.getYellowRobot().getPosition().getCentre().x,\n\t\t\t\t\t\t\t\tworldState.getYellowRobot().getPosition().getCentre().y,\n\t\t\t\t\t\t\t\ti,j) < 34){\n\t\t\t\t\t\t\tyellowGreenPlate.add(new Point(i,j));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (redCountA == 0) redCountA++;\n\t\t\tif (redCountB == 0) redCountB++;\n\t\t\tif (redCountC == 0) redCountC++;\n\t\t\tif (redCountD == 0) redCountD++;\n\t\t\tif (redCountE == 0) redCountE++;\n\t\t\tif (blueCountA == 0) blueCountA++;\n\t\t\tif (blueCountB == 0) blueCountB++;\n\t\t\tif (blueCountC == 0) blueCountC++;\n\t\t\tif (blueCountD == 0) blueCountD++;\n\t\t\tif (blueCountE == 0) blueCountE++;\n\t\t\tif (yellowCountA == 0) yellowCountA++;\n\t\t\tif (yellowCountB == 0) yellowCountB++;\n\t\t\tif (yellowCountC == 0) yellowCountC++;\n\t\t\tif (yellowCountD == 0) yellowCountD++;\n\t\t\tif (yellowCountE == 0) yellowCountE++;\n\n\n\t\t\t//TODO: Run these points through the parralax fix\n\t\t\ttotalRedX = 0;\n\t\t\ttotalRedY = 0;\n\t\t\tnumRedCentroids = 0;\n\n\n\t\t\tredCentroidA.setLocation(redCentroidA.getX()/redCountA, redCentroidA.getY()/redCountA);\n\t\t\tredCentroidB.setLocation(redCentroidB.getX()/redCountB, redCentroidB.getY()/redCountB);\n\t\t\tredCentroidC.setLocation(redCentroidC.getX()/redCountC, redCentroidC.getY()/redCountC);\n\t\t\tredCentroidD.setLocation(redCentroidD.getX()/redCountD, redCentroidD.getY()/redCountD);\n\t\t\tredCentroidE.setLocation(redCentroidE.getX()/redCountE, redCentroidE.getY()/redCountE);\n\n\t\t\ttotalYellowX = 0;\n\t\t\ttotalYellowY = 0;\n\t\t\tnumYellowCentroids = 0;\n\n\n\t\t\tyellowCentroidA.setLocation(yellowCentroidA.getX()/yellowCountA, yellowCentroidA.getY()/yellowCountA);\n\t\t\tyellowCentroidB.setLocation(yellowCentroidB.getX()/yellowCountB, yellowCentroidB.getY()/yellowCountB);\n\t\t\tyellowCentroidC.setLocation(yellowCentroidC.getX()/yellowCountC, yellowCentroidC.getY()/yellowCountC);\n\t\t\tyellowCentroidD.setLocation(yellowCentroidD.getX()/yellowCountD, yellowCentroidD.getY()/yellowCountD);\n\t\t\tyellowCentroidE.setLocation(yellowCentroidE.getX()/yellowCountE, yellowCentroidE.getY()/yellowCountE);\n\n\t\t\ttotalBlueX = 0;\n\t\t\ttotalBlueY = 0;\n\t\t\tnumBlueCentroids = 0;\n\n\n\t\t\tblueCentroidA.setLocation(blueCentroidA.getX()/blueCountA, blueCentroidA.getY()/blueCountA);\n\t\t\tblueCentroidB.setLocation(blueCentroidB.getX()/blueCountB, blueCentroidB.getY()/blueCountB);\n\t\t\tblueCentroidC.setLocation(blueCentroidC.getX()/blueCountC, blueCentroidC.getY()/blueCountC);\n\t\t\tblueCentroidD.setLocation(blueCentroidD.getX()/blueCountD, blueCentroidD.getY()/blueCountD);\n\t\t\tblueCentroidE.setLocation(blueCentroidE.getX()/blueCountE, blueCentroidE.getY()/blueCountE);\n\n\t\t\tc = new Color(img.getRGB((int)redCentroidA.getX(), (int)redCentroidA.getY()));\n\t\t\tif (isRed(c, GB)) {\n\t\t\t\ttotalRedX += redCentroidA.getX();\n\t\t\t\ttotalRedY += redCentroidA.getY();\n\t\t\t\tnumRedCentroids++;\n\t\t\t}\n\t\t\tc = new Color(img.getRGB((int)redCentroidB.getX(), (int)redCentroidB.getY()));\n\t\t\tif (isRed(c, GB)) {\n\t\t\t\ttotalRedX += redCentroidB.getX();\n\t\t\t\ttotalRedY += redCentroidB.getY();\n\t\t\t\tnumRedCentroids++;\n\t\t\t}\n\t\t\tc = new Color(img.getRGB((int)redCentroidC.getX(), (int)redCentroidC.getY()));\n\t\t\tif (isRed(c, GB)) {\n\t\t\t\ttotalRedX += redCentroidC.getX();\n\t\t\t\ttotalRedY += redCentroidC.getY();\n\t\t\t\tnumRedCentroids++;\n\t\t\t}\n\t\t\tc = new Color(img.getRGB((int)redCentroidD.getX(), (int)redCentroidD.getY()));\n\t\t\tif (isRed(c, GB)) {\n\t\t\t\ttotalRedX += redCentroidD.getX();\n\t\t\t\ttotalRedY += redCentroidD.getY();\n\t\t\t\tnumRedCentroids++;\n\t\t\t}\n\t\t\tc = new Color(img.getRGB((int)redCentroidE.getX(), (int)redCentroidE.getY()));\n\t\t\tif (isRed(c, GB)) {\n\t\t\t\ttotalRedX += redCentroidE.getX();\n\t\t\t\ttotalRedY += redCentroidE.getY();\n\t\t\t\tnumRedCentroids++;\n\t\t\t}\n\n\t\t\tif (numRedCentroids == 0){\n\t\t\t\tnumRedCentroids++;\n\t\t\t}\n\n\t\t\tredX = (int)(totalRedX/numRedCentroids);\n\t\t\tredY = (int)(totalRedY/numRedCentroids);\n\n\t\t\tc = new Color(img.getRGB((int)yellowCentroidA.getX(), (int)yellowCentroidA.getY()));\n\t\t\tif (isYellow(c)) {\n\t\t\t\ttotalYellowX += yellowCentroidA.getX();\n\t\t\t\ttotalYellowY += yellowCentroidA.getY();\n\t\t\t\tnumYellowCentroids++;\n\t\t\t}\n\t\t\tc = new Color(img.getRGB((int)yellowCentroidB.getX(), (int)yellowCentroidB.getY()));\n\t\t\tif (isYellow(c)) {\n\t\t\t\ttotalYellowX += yellowCentroidB.getX();\n\t\t\t\ttotalYellowY += yellowCentroidB.getY();\n\t\t\t\tnumYellowCentroids++;\n\t\t\t}\n\t\t\tc = new Color(img.getRGB((int)yellowCentroidC.getX(), (int)yellowCentroidC.getY()));\n\t\t\tif (isYellow(c)) {\n\t\t\t\ttotalYellowX += yellowCentroidC.getX();\n\t\t\t\ttotalYellowY += yellowCentroidC.getY();\n\t\t\t\tnumYellowCentroids++;\n\t\t\t}\n\t\t\tc = new Color(img.getRGB((int)yellowCentroidD.getX(), (int)yellowCentroidD.getY()));\n\t\t\tif (isYellow(c)) {\n\t\t\t\ttotalYellowX += yellowCentroidD.getX();\n\t\t\t\ttotalYellowY += yellowCentroidD.getY();\n\t\t\t\tnumYellowCentroids++;\n\t\t\t}\n\t\t\tc = new Color(img.getRGB((int)yellowCentroidE.getX(), (int)yellowCentroidE.getY()));\n\t\t\tif (isYellow(c)) {\n\t\t\t\ttotalYellowX += yellowCentroidE.getX();\n\t\t\t\ttotalYellowY += yellowCentroidE.getY();\n\t\t\t\tnumYellowCentroids++;\n\t\t\t}\n\n\t\t\tif (numYellowCentroids == 0){\n\t\t\t\tnumYellowCentroids++;\n\t\t\t}\n\n\t\t\tyellowX = (int)(totalYellowX/numYellowCentroids);\n\t\t\tyellowY = (int)(totalYellowY/numYellowCentroids);\n\n\t\t\tc = new Color(img.getRGB((int)blueCentroidA.getX(), (int)blueCentroidA.getY()));\n\t\t\tif (isBlue(c)) {\n\t\t\t\ttotalBlueX += blueCentroidA.getX();\n\t\t\t\ttotalBlueY += blueCentroidA.getY();\n\t\t\t\tnumBlueCentroids++;\n\t\t\t}\n\t\t\tc = new Color(img.getRGB((int)blueCentroidB.getX(), (int)blueCentroidB.getY()));\n\t\t\tif (isBlue(c)) {\n\t\t\t\ttotalBlueX += blueCentroidB.getX();\n\t\t\t\ttotalBlueY += blueCentroidB.getY();\n\t\t\t\tnumBlueCentroids++;\n\t\t\t}\n\t\t\tc = new Color(img.getRGB((int)blueCentroidC.getX(), (int)blueCentroidC.getY()));\n\t\t\tif (isBlue(c)) {\n\t\t\t\ttotalBlueX += blueCentroidC.getX();\n\t\t\t\ttotalBlueY += blueCentroidC.getY();\n\t\t\t\tnumBlueCentroids++;\n\t\t\t}\n\t\t\tc = new Color(img.getRGB((int)blueCentroidD.getX(), (int)blueCentroidD.getY()));\n\t\t\tif (isBlue(c)) {\n\t\t\t\ttotalBlueX += blueCentroidD.getX();\n\t\t\t\ttotalBlueY += blueCentroidD.getY();\n\t\t\t\tnumBlueCentroids++;\n\t\t\t}\n\t\t\tc = new Color(img.getRGB((int)blueCentroidE.getX(), (int)blueCentroidE.getY()));\n\t\t\tif (isBlue(c)) {\n\t\t\t\ttotalBlueX += blueCentroidE.getX();\n\t\t\t\ttotalBlueY += blueCentroidE.getY();\n\t\t\t\tnumBlueCentroids++;\n\t\t\t}\n\n\t\t\tif (numBlueCentroids == 0){\n\t\t\t\tnumBlueCentroids++;\n\t\t\t}\n\n\t\t\tblueX = (int)(totalBlueX/numBlueCentroids);\n\t\t\tblueY = (int)(totalBlueY/numBlueCentroids);\n\n\t\t\tblueGreenPlate4Points = plate.getCorners(blueGreenPlate);\n\t\t\tyellowGreenPlate4Points = plate.getCorners(yellowGreenPlate);\n\n\t\t\tworldState.getBlueRobot().getPosition().setCorners(blueGreenPlate4Points);\n\t\t\tworldState.getYellowRobot().getPosition().setCorners(yellowGreenPlate4Points);\n\n\t\t\tPoint fixBall = new Point(redX,redY);\n\t\t\tif ((redX != 0) && (redY != 0)) {\n\t\t\t\tif (worldState.getBarrelFix()){\n\t\t\t\t\tworldState.setBallPosition(fixBall);\n\t\t\t\t}else{ \n\t\t\t\t\tworldState.setBallPosition(DistortionFix.barrelCorrected(fixBall));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tPoint fixBlue = new Point(blueX,blueY);\n\t\t\tif ((blueX != 0) && (blueY != 0)) {\n\t\t\t\tif (worldState.getBarrelFix()){\n\t\t\t\t\tworldState.setBlueRobotPosition(fixParallax(fixBlue,worldState.getBlueRobot()));\n\t\t\t\t}else{\n\t\t\t\t\tworldState.setBlueRobotPosition(fixParallax(DistortionFix.barrelCorrected(fixBlue),worldState.getBlueRobot()));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tPoint fixYell = new Point(yellowX,yellowY);\n\t\t\tif ((yellowX != 0) && (yellowY != 0)) {\n\t\t\t\tif (worldState.getBarrelFix()){\n\t\t\t\t\tworldState.setYellowRobotPosition(fixParallax(fixYell,worldState.getYellowRobot()));\n\t\t\t\t}else{\n\t\t\t\t\tworldState.setYellowRobotPosition(fixParallax(DistortionFix.barrelCorrected(fixYell),worldState.getYellowRobot()));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor(Point p : bluePixels){\n\n\t\t\t\tif( plate.isInRectangle(p,blueGreenPlate4Points) ){\n\t\t\t\t\tif (worldState.getBarrelFix()){\n\t\t\t\t\t\tnewBluePixels.add(fixParallax(p,worldState.getBlueRobot()));\n\t\t\t\t\t}else{\n\t\t\t\t\t\tnewBluePixels.add(fixParallax(DistortionFix.barrelCorrected(p),worldState.getBlueRobot()));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(Point p : yellowPixels){\n\n\t\t\t\tif( plate.isInRectangle(p,yellowGreenPlate4Points) ){\n\t\t\t\t\tif (worldState.getBarrelFix()){\n\t\t\t\t\t\tnewYellowPixels.add(fixParallax(p,worldState.getYellowRobot()));\n\t\t\t\t\t}else{\n\t\t\t\t\t\tnewYellowPixels.add(fixParallax(DistortionFix.barrelCorrected(p),worldState.getYellowRobot()));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tworldState.setBluePixels(newBluePixels);\n\t\t\tworldState.setYellowPixels(newYellowPixels);\n\n\t\t\t//The above is supposed to filter the pixels and pick up only the T pixels, but the orientation then is always with the (0,0) point \n\n\n\t\t\tblueGreenPlate.clear();\n\t\t\tyellowGreenPlate.clear();\n\n\t\t}\n\n\t\treturn img;\n\n\t}", "private ArrayList<ColorMixerModel.ColorItem> pathIntersection(){\n ArrayList<ColorMixerModel.ColorItem> toDel = new ArrayList<>();\n for(ColorMixerModel.ColorItem c: cmModel.colorSet){\n Ellipse2D.Float cobj = new Ellipse2D.Float(c.getPos().x,c.getPos().y, c.getR(),c.getR());\n if(mouseTrace.intersects(cobj.getBounds2D())){\n toDel.add(c);\n }\n }\n return toDel;\n }", "public void blackScreen() {\n boolean var5 = field_759;\n int var1 = this.field_723 * this.field_724;\n int var2;\n if(this.interlace) {\n var2 = 0;\n int var3 = -this.field_724;\n if(var5 || var3 < 0) {\n do {\n int var4 = -this.field_723;\n if(var5) {\n this.pixels[var2++] = 0;\n ++var4;\n }\n\n while(var4 < 0) {\n this.pixels[var2++] = 0;\n ++var4;\n }\n\n var2 += this.field_723;\n var3 += 2;\n } while(var3 < 0);\n\n }\n } else {\n var2 = 0;\n if(var5 || var2 < var1) {\n do {\n this.pixels[var2] = 0;\n ++var2;\n } while(var2 < var1);\n\n }\n }\n }", "public Point getWhitePool(){\n return new Point(whitePool, whiteCapPool);\n }", "public void monitorFoundDevices() {\n //start a thread\n new Thread() {\n public void run() {\n //loop till mBeaconListAdapter has been skilled.\n while(mBeaconListAdapter != null) {\n try {\n //Since it will update UI, runOnUiThread is called here.\n getActivity().runOnUiThread(new Runnable() {\n @Override\n public void run() {\n for (int i = 0; i < mBeaconListAdapter.getCount(); i++) {\n if (!mBleWrapper.checkDeviceConnection(mBeaconListAdapter.\n getDevice(i).getAddress()))\n mBeaconListAdapter.removeDevice(i);\n }\n }\n });\n\n Thread.sleep(MONITOR_DELAY_TIME_INTERVAL);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n }\n }.start();\n }", "int getMonitors();", "private ArrayList<Color> createColorArray(){\n ArrayList<Color> out = new ArrayList<>();\n out.add(detectColor((String) Objects.requireNonNull(P1color.getSelectedItem())));\n out.add(detectColor((String) Objects.requireNonNull(P2color.getSelectedItem())));\n out.add(detectColor((String) Objects.requireNonNull(P3color.getSelectedItem())));\n out.add(detectColor((String) Objects.requireNonNull(P4color.getSelectedItem())));\n out.add(detectColor((String) Objects.requireNonNull(P5color.getSelectedItem())));\n out.add(detectColor((String) Objects.requireNonNull(P6color.getSelectedItem())));\n return out;\n }", "public abstract void notifyScanResult(int distancesToWallsInEachDirection);", "public List<Peak> filterNoise(List<Peak> peaks, double threshold, double experimentalPrecursorMzRatio);", "public float[][] getInkList() {\n/* 501 */ COSBase base = getCOSObject().getDictionaryObject(COSName.INKLIST);\n/* 502 */ if (base instanceof COSArray) {\n/* */ \n/* 504 */ COSArray array = (COSArray)base;\n/* 505 */ float[][] inkList = new float[array.size()][];\n/* 506 */ for (int i = 0; i < array.size(); i++) {\n/* */ \n/* 508 */ COSBase base2 = array.getObject(i);\n/* 509 */ if (base2 instanceof COSArray) {\n/* */ \n/* 511 */ inkList[i] = ((COSArray)array.getObject(i)).toFloatArray();\n/* */ }\n/* */ else {\n/* */ \n/* 515 */ inkList[i] = new float[0];\n/* */ } \n/* */ } \n/* 518 */ return inkList;\n/* */ } \n/* 520 */ return new float[0][0];\n/* */ }", "public List<String> getWifiPoints() {\n\n\t\tList<String> line = new ArrayList();\n\t\tline.add(FirstSeen);\n\t\tline.add(Device);\n\t\tline.add(Lat);\n\t\tline.add(Lon);\n\t\tline.add(Alt);\n\t\tline.add(\"\" + WifiPoints.size());\n\n\t\tfor(WIFISample wifi : WifiPoints) {\n\t\t\tline.add(wifi.getWIFI_SSID());\n\t\t\tline.add(wifi.getWIFI_MAC());\n\t\t\tline.add(wifi.getWIFI_Frequency());\n\t\t\tline.add(wifi.getWIFI_RSSI());\n\t\t}\n\n\t\treturn line;\n\t}", "public abstract void tellColorList(ArrayList<String> colors);", "@Override\r\n\tpublic List<Light> getLights() {\n\t\treturn null;\r\n\t}", "public Pic blackAndWhite() {\n Pic output = image.deepCopy();\n Pixel[][] outputPixels = output.getPixels();\n for (int row = 0; row < output.getHeight(); row++) {\n for (int col = 0; col < output.getWidth(); col++) {\n Pixel current = outputPixels[row][col];\n int average = (current.getRed() + current.getGreen()\n + current.getBlue()) / 3;\n if (average > 127) {\n current.setRed(255);\n current.setGreen(255);\n current.setBlue(255);\n } else {\n current.setRed(0);\n current.setGreen(0);\n current.setBlue(0);\n }\n }\n }\n return output;\n }", "java.util.List<com.mwr.jdiesel.api.Protobuf.Message.Device> \n getDevicesList();", "public Wall getWhiteWallsOnBoard(int index)\n {\n Wall aWhiteWallsOnBoard = whiteWallsOnBoard.get(index);\n return aWhiteWallsOnBoard;\n }", "void showThrewResources(ArrayList<LightResource> threwResources);", "public Fingerprint[] fingerprints();" ]
[ "0.5860578", "0.5711692", "0.5259159", "0.5241428", "0.522875", "0.52102745", "0.5191157", "0.51674956", "0.5142841", "0.5142202", "0.5135215", "0.5134453", "0.5122449", "0.51189476", "0.51164716", "0.5099927", "0.5088511", "0.50781626", "0.5054222", "0.5047548", "0.5034372", "0.5014903", "0.5011085", "0.49673852", "0.49519038", "0.49335158", "0.49322125", "0.49207258", "0.49125853", "0.49031717", "0.4891801", "0.48884192", "0.48873398", "0.48810518", "0.48808643", "0.48426482", "0.48267478", "0.48256773", "0.48222867", "0.48204812", "0.4819635", "0.48171386", "0.47984087", "0.47918653", "0.4782575", "0.47712496", "0.47646737", "0.4763845", "0.47616026", "0.47520092", "0.47399056", "0.47384647", "0.4733894", "0.47270003", "0.47247255", "0.47130555", "0.47130415", "0.47118154", "0.47056952", "0.47048616", "0.47006336", "0.46920484", "0.4681943", "0.46786144", "0.46776658", "0.46768418", "0.46764407", "0.46710062", "0.46703914", "0.46608847", "0.46549746", "0.46439373", "0.46437284", "0.46417016", "0.46394244", "0.46350014", "0.46240893", "0.46225414", "0.4621449", "0.46209705", "0.46190354", "0.4616145", "0.4601796", "0.45973796", "0.45972866", "0.45933923", "0.45860735", "0.45823896", "0.45783517", "0.45782524", "0.4574545", "0.45737883", "0.45690626", "0.45686075", "0.45683977", "0.45677215", "0.45669895", "0.4563663", "0.45567882", "0.45540372" ]
0.5765579
1
This is based on the recommendation for the singleton pattern from : Double checking singleton getInstance method.
public static DBManager getInstance() { DBManager current = db; // fast check to see if already created if (current == null) { // sync so not more then one creates it synchronized (DBManager.class) { current = db; // check if between first check and sync if someone has created it if (current == null) { //create it db = current = new DBManager(); } } } return current; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private SingletonDoubleCheck() {}", "public static ThreadSafeSingleton getInstanceWithDoubleCheck() {\n\t\tif (instance == null) {\n\t\t\tsynchronized (ThreadSafeSingleton.class) {\n\t\t\t\tif (instance == null) {\n\t\t\t\t\tinstance = new ThreadSafeSingleton();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn instance;\n\t}", "public static Singleton doubleCheckLocking(){\n if(instance != null){\n return instance;\n }\n synchronized (key){\n if(instance == null){\n instance = new Singleton();\n }\n return instance;\n }\n }", "public static SingletonDoubleCheck getInstance() {\n\t\tif (_instance == null) {\n\t\t\tsynchronized (SingletonDoubleCheck.class) {\n\t\t\t\tif (_instance == null) {\n\t\t\t\t\t_instance = new SingletonDoubleCheck();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn _instance;\n\t}", "private Singleton() {\n if (instance != null){\n throw new RuntimeException(\"Use getInstance() to create Singleton\");\n }\n }", "public static Singleton getInstance( ) {\n return singleton;\n }", "private Singleton(){}", "public DPSingletonLazyLoading getInstance(){ //not synchronize whole method. Instance oluşmuş olsa bile sürekli burada bekleme olur.\r\n\t\tif (instance == null){//check\r\n\t\t\tsynchronized(DPSingletonLazyLoading.class){ //critical section code NOT SYNCRONIZED(this) !!\r\n\t\t\t\tif (instance == null){ //double check\r\n\t\t\t\t\tinstance = new DPSingletonLazyLoading();//We are creating instance lazily at the time of the first request comes.\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn instance;\r\n\t}", "public static Singleton getInstance( ) {\n return singleton;\n }", "private Singleton() { }", "@Override\n public T getInstance() {\n return instance;\n }", "private Singleton()\n\t\t{\n\t\t}", "private Singleton() {\n\t}", "private SingletonSample() {}", "public static LazyInitializedSingleton getInstance(){ // method for create/return Object\n if(instance == null){//if instance null?\n instance = new LazyInitializedSingleton();//create new Object\n }\n return instance; // return early created object\n }", "public static ThreadSafe getInstaceDoubleChecking(){\n if(instance==null){\n synchronized (ThreadSafe.class) {\n if (instance==null) {\n instance = new ThreadSafe();\n }\n }\n }\n return instance;\n }", "public static Singleton getInstance() {\t\t//getInstance nam omogucava da instanciramo klasu jedinstveno ako vec nismo!\r\n\t\tif (instance == null) {\t\t\t\t\t// inace nam vraca instancu ako je vec napravljena!\r\n\t\t\tinstance = new Singleton();\r\n\t\t}\r\n\t\treturn instance;\r\n\t}", "public static SingleObject getInstance(){\n return instance;\n }", "public static synchronized Singleton getInstance(){\n if(instance == null){\n instance = new Singleton();\n }\n return instance;\n }", "public static Singleton getInstance(){\n if(instance == null)\n {\n synchronized (Singleton.class) {\n if (instance == null) {\n instance = new Singleton();\n Log.d(\"***\", \"made new Singleton\");\n }\n }\n }\n return instance;\n }", "private LazySingleton() {\n if (null != INSTANCE) {\n throw new InstantiationError(\"Instance creation not allowed\");\n }\n }", "synchronized public static SampletypeManager getInstance()\n {\n return singleton;\n }", "public static Singleton getInstance() {\n return mSing;\n }", "public static Singleton getInstance() {\n return SingletonHolder.SINGLETON_INSTANCE;\n }", "public static synchronized Singleton getInstance() {\n\t\tif(instance ==null) {\n\t\t\tinstance= new Singleton();\n\t\t\t\n\t\t}\n\t\treturn instance;\n\t}", "private Singleton(){\n }", "public static SingletonEager get_instance(){\n }", "private SingletonEager(){\n \n }", "public static SingleObject getInstance()\r\n {\r\n return instance;\r\n }", "public static AccountVerificationSingleton getInstance()\n {\n if (uniqueInstance == null)\n {\n uniqueInstance = new AccountVerificationSingleton();\n }\n \n return uniqueInstance;\n }", "public static Singleton getInstance()\r\n\t{\r\n\t\t// check if the instance is already created or not, required only for lazy init\r\n\t\tif (instance == null)\r\n\t\t\tinstance = new Singleton();\r\n\t\treturn instance;\r\n\t}", "T getInstance();", "public static SingletonEager getInstance()\n {\n return instance;\n }", "private Singleton2A(){\n\t\tif(instance != null){\n\t\t\tthrow new RuntimeException(\"One instance already created cant create other\");\n\t\t}\t\t\n\t\tSystem.out.println(\"I am private constructor\");\n\t}", "public static synchronized Singleton getInstanceTS() {\n\t\tif (_instance == null) {\n\t\t\t_instance = new Singleton();\n\t\t}\n\t\treturn _instance;\n\t}", "private SingletonSigar(){}", "@Override\n\t\tpublic Object getInstance() {\n\t\t\treturn null;\n\t\t}", "@Override\n public boolean isSingleton() {\n return false;\n }", "public static SingleObject getInstance(){\n\t\treturn instance;\n\t}", "private SingletonObject() {\n\n\t}", "public static utilitys getInstance(){\n\r\n\t\treturn instance;\r\n\t}", "public static Singleton getInstance() {\n\t\tif (_instance == null) {\n\t\t\t_instance = new Singleton();\n\t\t}\n\t\treturn _instance;\n\t}", "public static void main(String[] args) throws IOException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {\n\n Class objectClass = LazyMethodSingleton.class;\n\n Constructor constructor = objectClass.getDeclaredConstructor();\n constructor.setAccessible(true);\n\n LazyMethodSingleton instance = LazyMethodSingleton.getInstance();\n LazyMethodSingleton newInstance = (LazyMethodSingleton) constructor.newInstance();\n\n// HungrySingleton instance = HungrySingleton.getInstance();\n// HungrySingleton newInstance = (HungrySingleton) constructor.newInstance();\n\n// LazyStaticInnerClassSingleton instance = LazyStaticInnerClassSingleton.getInstance();\n// LazyStaticInnerClassSingleton newInstance = (LazyStaticInnerClassSingleton) constructor.newInstance();\n\n System.out.println(instance);\n System.out.println(newInstance);\n System.out.println(instance == newInstance);\n\n\n\n\n }", "public static synchronized MultiThreadedSingleton getInstance() {\n\t\t//Lazy instantiation using double locking mechanism.\n\t\tif (singleton == null) {\n\t\t\tsynchronized (MultiThreadedSingleton.class) {\n\t\t\t\tif (singleton == null) {\n\t\t\t\t\tsimulateRandomActivity();\n\t\t\t\t\tsingleton = new MultiThreadedSingleton();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tlogger.info(\"created singleton: \" + singleton);\n\t\treturn singleton;\n\t}", "public SingletonSyncBlock getInstance() { // when getting a new instance, getInstance as synchronized method is\n\t\t\t\t\t\t\t\t\t\t\t\t// called\n\n\t\tif (SINGLETON_INSTANCE == null) { // if no Singleton was yet initialized, one instance will be created else,\n\t\t\t\t\t\t\t\t\t\t\t// it's returned the one already created.\n\n\t\t\tsynchronized (SingletonSyncBlock.class) { // synchronized block\n\n\t\t\t\tif (SINGLETON_INSTANCE == null) {\n\n\t\t\t\t\tSINGLETON_INSTANCE = new SingletonSyncBlock();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn SINGLETON_INSTANCE;\n\n\t}", "private LazySingleton(){}", "public void testGetInstance() {\n\t\tREDFinder finder = REDFinder.getInstance();\n\t\tassertSame(\"getInstance returned not the same object.\", finder,\n\t\t\t\tREDFinder.getInstance());\n\t}", "public static synchronized Singleton getInstance() {\n\t\tif (mContext == null) {\n\t\t\tthrow new IllegalArgumentException(\"Impossible to get the instance. This class must be initialized before\");\n\t\t}\n\n\t\tif (instance == null) {\n\t\t\tinstance = new Singleton();\n\t\t}\n\n\t\treturn instance;\n\t}", "static void useSingleton(){\n\t\tSingleton singleton = Singleton.getInstance();\n\t\tprint(\"singleton\", singleton);\n\t}", "public static Singleton getInstance() {\n if (instance == null) {\n synchronized (Singleton.class){\n if (instance == null) {\n instance = new Singleton();\n }\n }\n }\n return instance;\n }", "private MySingleton() {\r\n\t\tSystem.out.println(\"Only 1 object will be created\");\r\n\t}", "public static J2_Singleton getInstance() {\n\t\tif(singletonInstance == null ) {\n\t\t\tsynchronized(J2_Singleton.class) {\n\t\t\t\tif(singletonInstance == null) {\n\t\t\t\t\tsingletonInstance = new J2_Singleton();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn singletonInstance;\n\t}", "@SuppressWarnings(\"unchecked\")\n public static <T> Singleton<T> instance() {\n // Atomically set the reference's value to a new singleton iff\n // the current value is null. This constructor will most likely\n // be called more than once if instance() is called from\n // multiple threads, but only the first one is used.\n sSingletonAR\n .updateAndGet(u ->\n u != null ? u : new SingletonAR<T>());\n\n // Return the singleton's current value.\n return (Singleton<T>) sSingletonAR.get();\n }", "private J2_Singleton() {}", "public T getInstance() {\n return instance;\n }", "public static Singleton getInstance() {\n\t //Je-li promenna instance null, tak se vytvori objekt\n\t if (instance == null) {\n\t instance = new Singleton();\n\t }\n\t //Vratime jedinacka\n\t return instance;\n\t }", "public static Singleton getInstance() {\n\n if (_instance == null) {\n synchronized (Singleton.class) {\n if (_instance == null)\n _instance = new Singleton();\n }\n }\n return _instance;\n }", "public static Singleton instance() {\n return Holder.instance;\n }", "private EagerInitializedSingleton() {\n\t}", "private EagerInitializedSingleton() {\n\t}", "@SuppressWarnings(\"unchecked\")\n public static <T> Singleton<T> instance() {\n // Return the singleton instance from the SingletonHolder.\n return (Singleton<T>) SingletonHolder.INSTANCE;\n }", "public synchronized static SynchronizedMethodSingleton getInstance()\n\t{\n\t\tif ( instance == null )\n\t\t{\n\t\t\tinstance = new SynchronizedMethodSingleton();\n\t\t}\n\t\treturn instance;\n\t}", "public static Replica1Singleton getInstance() {\r\n\t\tif (instance==null){\r\n\t\t/*System.err.println(\"Istanza creata\");*/\r\n\t\tinstance = new Replica1Singleton();\r\n\t\t}\r\n\t\treturn instance;\r\n\t\r\n\t}", "public static CarSingleton2 getInstance() {\n\t\treturn singleton_instance;\n\t}", "private static LogUtil getInstance() {\r\n if (instance == null) {\r\n final LogUtil l = new LogUtil();\r\n l.init();\r\n if (isShutdown) {\r\n // should not be possible :\r\n if (l.log.isErrorEnabled()) {\r\n l.log.error(\"LogUtil.getInstance : shutdown detected : \", new Throwable());\r\n }\r\n return l;\r\n }\r\n instance = l;\r\n\r\n if (instance.logBase.isInfoEnabled()) {\r\n instance.logBase.info(\"LogUtil.getInstance : new singleton : \" + instance);\r\n }\r\n }\r\n\r\n return instance;\r\n }", "public static SingletonClass getInstance() {\n\t\tif(singletonObj == null){\n\t\t\tsingletonObj = new SingletonClass();\n\t\t}\n\t\treturn singletonObj;\n\t}", "public static MySingleton getInstance() {\r\n\t\tif(instance==null){\r\n\t\t\tinstance= new MySingleton();\r\n\t\t}\r\n\t\treturn instance;\r\n\t}", "@Test\r\n\tpublic final void testGetInstance() {\r\n\t\tComparatorFacade facade = ComparatorFacade.getInstance();\r\n\t\tAssert.assertSame(singleton, facade);\r\n\t}", "public SingletonVerifier() {\n }", "public static LibValid getInstance() {\n\t\treturn instance;\n\t}", "private static Session getInstance() {\n return SingletonHolder.INSTANCE;\n }", "public static LazySingleton getInstance()\n {\n // Check null\n if (instance == null)\n instance = new LazySingleton();\n return instance;\n\n }", "synchronized public static InstitutionManager getInstance()\n {\n return singleton;\n }", "public static FacadeMiniBank getInstance(){\r\n\r\n\t\tif(singleton==null){\r\n\t\t\ttry {\r\n\t\t\t\t//premier essai : implementation locale\r\n\t\t\t\tsingleton=(FacadeMiniBank) Class.forName(implFacadePackage + \".\" + localeFacadeClassName).newInstance();\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tSystem.err.println(e.getMessage() + \" not found or not created\");\r\n\t\t\t}\t\t\t\t\t\t\r\n\t\t}\r\n\t\tif(singleton==null){\r\n\t\t\t//deuxieme essai : business delegate \r\n\t\t singleton=getRemoteInstance();\r\n\t\t\t\t\t\t\t\t\r\n\t\t}\r\n\t\treturn singleton;\r\n\t}", "public static RCProxy instance(){\n\t\treturn SingletonHolder.INSTANCE;\n\t}", "public static DoubleCheckedLocking getInstanceUsingDoubleLocking(){\n\t if(instance == null){\n\t synchronized (DoubleCheckedLocking.class) {\n\t if(instance == null){\n\t instance = new DoubleCheckedLocking();\n\t }\n\t }\n\t }\n\t return instance;\n\t}", "public static CZSZApplication_bak getInstance() {\n return theSingletonInstance;\n }", "@Test\n public void testGetInstance()\n {\n System.out.println(\"TEST: getInstance\");\n TomTomReader result = TomTomReader.getInstance();\n assertNotEquals(null, result);\n }", "@Test\n public void testGetInstance() {\n\n // singleton\n assertSame(GestionnaireRaccourcis.getInstance(), GestionnaireRaccourcis.getInstance());\n }", "public static Singleton print(String param)\n {\n return new Singleton();\n}", "public static synchronized SingletonImpl getSingleton() {\n\t\t\n\t\tif(mySingleton == null){\n\t\t\tmySingleton = new SingletonImpl();\n\t\t}\n\t\treturn mySingleton;\n\t}", "private InstanceUtil() {\n }", "public static EagerInitializationSingleton getInstance() {\n\t\treturn INSTANCE;\n\t}", "public static synchronized ThreadSafeSingleton getInstance() {\n\t\tif (instance == null) {\n\t\t\tinstance = new ThreadSafeSingleton();\n\t\t}\n\t\treturn instance;\n\t}", "private EagerInitializationSingleton() {\n\t}", "public /* synchronized */ static LazyInitClass getInstanceThreadSafe() {\r\n\t\t//first if is for perfrroamce betterment\r\n\t\t//once object got created no need to synchronize and stop other threads to read\r\n\t\tif(instance == null) {\r\n\t\t\tsynchronized (LazyInitClass.class) {\r\n\t\t\t\tif(instance == null) {\r\n\t\t\t\t\tinstance = new LazyInitClass();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\treturn instance;\r\n\t}", "public static synchronized ThreadSafeSingleton getInstance() {\n\t\tif (null == instance) {\n\t\t\tinstance = new ThreadSafeSingleton();\n\t\t}\n\n\t\treturn instance;\n\t}", "@Test\n public void TestSingletonInitialization() {\n\t\tassertSame(SingletonClass.getInstance(), SingletonClass.getInstance());\n }", "public static synchronized N_ThreadSafeSingalton getInstance() throws InterruptedException{\n\t\t\n\t\tif (uniqueInstance == null){\n\t\t\tThread.sleep(1000);// just to show multithreading issue.\n\t\t\tuniqueInstance=new N_ThreadSafeSingalton();\n\t\t}\t\t\n\t\t\n\t\treturn uniqueInstance;\n\t}", "protected static KShingler getInstance() {\n return ShinglerSingleton.INSTANCE;\n }", "synchronized static PersistenceHandler getInstance() {\n return singleInstance;\n }", "public static Light getInstance() {\n\treturn INSTANCE;\n }", "public boolean isSingleton() {\n\t\treturn false;\r\n\t}", "public static SalesOrderDataSingleton getInstance()\n {\n // Return the instance\n return instance;\n }", "public static SingletonClass getInstance() {\n if (instance == null) {\n instance = new SingletonClass();\n }\n return instance;\n }", "private SingletonAR() {\n System.out.println(Thread.currentThread().getName()\n + \": creating SingletonAR\");\n }", "public boolean isSingleton()\n\t{\n\t\treturn true;\n\t}", "public static Boolean getSingleton() {\r\n\t\treturn singleton;\r\n\t}", "@Contract(pure = true)\n/* */ public static UPNPService getInstance() {\n/* 57 */ return INSTANCE;\n/* */ }", "public static User getInstance(){\n if(singleton == null){\n singleton = new User();\n }\n return singleton;\n }", "public static synchronized MyVolleySingleton getInstance(Context context) {\n if (singletonInstance == null) { // If Instance is null\n singletonInstance = new MyVolleySingleton(context); // Initialize new Instance\n }\n return singletonInstance;\n }" ]
[ "0.8274608", "0.76469135", "0.76245445", "0.76037234", "0.75410885", "0.74729896", "0.74145156", "0.7413178", "0.7411979", "0.74072963", "0.73922765", "0.7357472", "0.7293718", "0.7242716", "0.72293806", "0.7189628", "0.7142527", "0.7137515", "0.7133451", "0.7125878", "0.71231127", "0.71141195", "0.7098307", "0.7094183", "0.7080272", "0.706206", "0.7055757", "0.7036936", "0.70181686", "0.69909185", "0.6979698", "0.6962562", "0.6957861", "0.69537276", "0.69472456", "0.6946174", "0.69429886", "0.69350123", "0.69267356", "0.6921795", "0.691547", "0.69017905", "0.68939906", "0.689145", "0.6890777", "0.6879731", "0.6878368", "0.6877677", "0.6876959", "0.68553036", "0.683961", "0.683921", "0.6831856", "0.68184596", "0.68161917", "0.68117803", "0.6808857", "0.67916465", "0.6780147", "0.6780147", "0.67784804", "0.6776153", "0.67730504", "0.674376", "0.6736234", "0.6734178", "0.6732743", "0.67129296", "0.67086744", "0.67029554", "0.66949594", "0.6692535", "0.66673875", "0.66273206", "0.66146", "0.6606289", "0.66049296", "0.65829676", "0.65769833", "0.65673405", "0.6560093", "0.6540693", "0.6539648", "0.6538476", "0.6529684", "0.652832", "0.6517844", "0.6516196", "0.65157247", "0.65006787", "0.6492299", "0.6486335", "0.64484996", "0.6435578", "0.643358", "0.6426367", "0.642423", "0.64024776", "0.63998723", "0.6393594", "0.6389331" ]
0.0
-1
list of files, each file has one image
public Game(){ // you can of course add more or change this setup completely. You are totally free to also use just Strings in your Server class instead of this class won = true; // setting it to true, since then in newGame() a new image will be created files.add("pig.txt"); files.add("snail.txt"); files.add("duck.txt"); files.add("crab.txt"); files.add("cat.txt"); files.add("joke1.txt"); files.add("joke2.txt"); files.add("joke3.txt"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ImageFiles() {\n\t\tthis.listOne = new ArrayList<String>();\n\t\tthis.listTwo = new ArrayList<String>();\n\t\tthis.listThree = new ArrayList<String>();\n\t\tthis.seenImages = new ArrayList<String>();\n\t\tthis.unseenImages = new ArrayList<String>();\n\t}", "public void listPictures()\r\n {\r\n int index = 0;\r\n while(index >=0 && index < pictures.size()) \r\n {\r\n String filename = pictures.get(index);\r\n System.out.println(index + \": \"+ filename);\r\n index++;\r\n }\r\n }", "private void addImgList() {\n\t\tdogImg.add(\"./data/img/labrador.jpg\");\t\t\t\t\n\t\tdogImg.add(\"./data/img/germanshepherd.jpg\");\t\n\t\tdogImg.add(\"./data/img/bulldog.jpg\");\t\t\t\t\t\t\t\t\n\t\tdogImg.add(\"./data/img/rottweiler.jpg\");\n\t\tdogImg.add(\"./data/img/husky.jpg\");\n\n\t}", "private static ArrayList<String> getImagesInFileSystem() {\n\t\t// get file list in database\n\t\tArrayList<String> fileNameList = new ArrayList<String>();\n\t\t\n\t\tFile folder = new File(IMAGE_DIRECTORY);\n\t File[] listOfFiles = folder.listFiles();\n\t \n\t for (File currFile : listOfFiles) {\n\t if (currFile.isFile() && !currFile.getName().startsWith(\".\")) {\n\t \t fileNameList.add(currFile.getName());\n\t }\n\t }\n\t \n\t return fileNameList;\n\t}", "private ArrayList<ImageItem> getData() {\n final ArrayList<ImageItem> imageItems = new ArrayList<>();\n // TypedArray imgs = getResources().obtainTypedArray(R.array.image_ids);\n for (int i = 0; i < f.size(); i++) {\n Bitmap bitmap = imageLoader.loadImageSync(\"file://\" + f.get(i));;\n imageItems.add(new ImageItem(bitmap, \"Image#\" + i));\n }\n return imageItems;\n }", "public ArrayList<ImageFile> getImageFiles() {\n return new ArrayList<>(imageFiles);\n }", "private LinkedList<Image> loadPhotos(int n){\n\t\tLinkedList<Image> listOfPhotos = new LinkedList<>();\n\t\t\n\t\t\n\t\ttry {\n\n\t\t\tFileInputStream in = new FileInputStream(\"images\");\n\t\t\t//Skipping magic number and array size\n\t\t\tfor (int i = 0; i < 16; i++) {\n\t\t\t\tin.read();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tfor (int k = 0; k < n; k++) {\n\t\t\t\tImage img = new Image(HEIGHT, WIDTH);\n\t\t\t\t\n\t\t\t\tbyte[][] imageData = new byte[WIDTH][HEIGHT];\n\t\t\t\tfor (int i = k*WIDTH; i < k*WIDTH + WIDTH; i++) {\n\t\t\t\t\tfor (int j = k*HEIGHT; j < k*HEIGHT + HEIGHT; j++) {\n\t\t\t\t\t\timageData[j%28][i%28] = (byte) in.read();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\timg.setData(imageData);\n\t\t\t\tlistOfPhotos.add(img);\n\t\t\t}\n\t\t\tin.close();\n\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\t\n\t\t\n\t\treturn listOfPhotos;\n\t\t\n\t}", "static public ObservableList<ImageMetaInfo> getImagesInfo(File path) {\n ObservableList<ImageMetaInfo> observableList = FXCollections.observableArrayList();\n ExtFilter fileFilter = new ExtFilter();\n File[] imageFilesArray = path.listFiles(fileFilter);\n for (File file : imageFilesArray) {\n ImageMetaInfo imageMetaInfo = getImageMetaInfo(file);\n observableList.add(imageMetaInfo);\n }\n return observableList;\n }", "public ArrayList<ImageLoader<E>> getImageLoaders();", "@Override\n\tpublic List<URL> getPhotos() {\n\t\timages.clear(); //vide la liste des images\n\t\t\n\t\t\n\t\tList<URL> allImagesURL = new ArrayList<URL>();\n\t\t\n\t\t/* On initialise la liste de toutes les images */\n\t\tList<String> filelocations = null;\n\t\t\n\t\t/*Nous allons retrouver les fichiers images présent dans le répertoire et tous ses sous-répertoires*/\n\t\tPath start = Paths.get(path); //détermine le point de départ \n\t\ttry (Stream<Path> stream = Files.walk(start, Integer.MAX_VALUE)) {\n\t\t filelocations = stream\n\t\t .map(String::valueOf) //transforme les Path en string\n\t\t .filter(filename -> filename.contains(\".jpg\") || filename.contains(\".png\")) //ne prend que les images jpg et png\n\t\t .collect(Collectors.toList());\n\t\t \n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t\n\t\t/* Pour chaque fichier retrouvé, on essaie de retrouver son chemin absolu pour le stocker dans le allImagesURL */\n\t\tfor (String filelocation : filelocations) {\n\t\t\tString relativeLocation = filelocation.replace(path+\"/\", \"\"); // Pour ne pas partir de src mais de la classe courante\n\t\t\trelativeLocation = relativeLocation.replace(windowspath+\"\\\\\", \"\");\n\t\t\tallImagesURL.add(this.getClass().getResource(relativeLocation)); //on ajoute le chemin absolu dans la liste\n\t\t}\n\t\t\n\t\t\n\t\treturn allImagesURL; //on retourne la liste\n\t}", "public static List<InputStream> getAllImages(){\n\t\treturn IOHandler.getResourcesIn(IMAGES_DIR);\n\t}", "public List<File> getFiles();", "private void extractCards() {\n String fileSeparator = System.getProperty(\"file.separator\");\n String path = System.getProperty(\"user.dir\");\n path = path + fileSeparator + \"Client\" + fileSeparator + \"src\" + fileSeparator + \"Images\" + fileSeparator;\n System.out.println(path);\n\n for (Picture p : cardlist) {\n BufferedImage image = null;\n try {\n image = javax.imageio.ImageIO.read(new ByteArrayInputStream(p.getStream()));\n File outputfile = new File(path + p.getName());\n ImageIO.write(image, \"png\", outputfile);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }", "private BufferedImage[] loadImages(String directory, BufferedImage[] img) throws Exception {\n\t\tFile dir = new File(directory);\n\t\tFile[] files = dir.listFiles();\n\t\tArrays.sort(files, (s, t) -> s.getName().compareTo(t.getName()));\n\t\t\n\t\timg = new BufferedImage[files.length];\n\t\tfor (int i = 0; i < files.length; i++) {\n\t\t\timg[i] = ImageIO.read(files[i]);\n\t\t}\n\t\treturn img;\n\t}", "public File[] CreateListFiles() {\n\t\tif (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {\n\t\t\tToast.makeText(this, \"Error! No SDCARD Found!\", Toast.LENGTH_LONG).show();\n\t\t} else {\n\t\t\tfile = new File(Environment.getExternalStorageDirectory(), File.separator + \"/MelanomaPics/\" + File.separator + MelanomaActivity.pacientSelected);\n\t\t\tfile.mkdirs();\n\t\t}\n\t\t// pega todas as imagens do diretorio MelanomaPics e coloca dentro de\n\t\t// uma lista\n\t\tif (file.isDirectory()) {\n\t\t\tlistFile = file.listFiles();\n\t\t}\n\t\treturn listFile;\n\t}", "private ArrayList<String> getImagesPathList() {\n String MEDIA_IMAGES_PATH = \"CuraContents/images\";\n File fileImages = new File(Environment.getExternalStorageDirectory(), MEDIA_IMAGES_PATH);\n if (fileImages.isDirectory()) {\n File[] listImagesFile = fileImages.listFiles();\n ArrayList<String> imageFilesPathList = new ArrayList<>();\n for (File file1 : listImagesFile) {\n imageFilesPathList.add(file1.getAbsolutePath());\n }\n return imageFilesPathList;\n }\n return null;\n }", "java.util.List<com.yahoo.xpathproto.TransformTestProtos.ContentImage> \n getImagesByHandlerList();", "public void getPictures(){\n\t\t\ttry{\n\t\t\t\timg = ImageIO.read(new File(\"background.jpg\"));\n\t\t\t\ttank = ImageIO.read(new File(\"Tank.png\"));\n\t\t\t\tbackground2 = ImageIO.read(new File(\"background2.png\"));\n\t\t\t\t\n\t\t\t\trtank = ImageIO.read(new File(\"RTank.png\"));\n\t\t\t\tboom = ImageIO.read(new File(\"Boom.png\"));\n\t\t\t\tboom2 = ImageIO.read(new File(\"Boom2.png\"));\n\t\t\t\tinstructions = ImageIO.read(new File(\"Instructions.png\"));\n\t\t\t\tshotman = ImageIO.read(new File(\"ShotMan.png\"));\n\t\t\t\tlshotman = ImageIO.read(newFile(\"LShotMan.png\"));\n\t\t\t\tboomshotman = ImageIO.read(new File(\"AfterShotMan\"));\n\t\t\t\tlboomshotman = ImageIO.read(new File(\"LAfterShotMan\"));\n\t\t\t\t\n\t\t\t}catch(IOException e){\n\t\t\t\tSystem.err.println(\"d\");\n\t\t\t}\n\t\t}", "public ArrayList<ImageFile> getAllImagesUnderDirectory() throws IOException {\n return allImagesUnderDirectory;\n }", "private void fillImagesInDirectory() throws IOException {\n // get the list of all files (including directories) in the directory of interest\n File[] fileArray = directory.listFiles();\n assert fileArray != null;\n for (File file : fileArray) {\n // the file is an image, then add it\n if (isImage(file)) {\n ImageFile imageFile = new ImageFile(file.getAbsolutePath());\n // if the image is already saved, reuse it\n if (centralController.getImageFileController().hasImageFile(imageFile)) {\n imagesInDirectory.add(centralController.getImageFileController().getImageFile(imageFile));\n } else {\n imagesInDirectory.add(imageFile);\n }\n }\n }\n }", "java.util.List<com.google.protobuf.ByteString> getImgDataList();", "public String getAllFilles(int n) throws IOException {\n\t\tString x = \"\";\n\t\tString path = \"C:/JEE/workspace/Server/Upload\";\n\t\tString path2 = \"C:/JEE/workspace/Server/Upload/\";\n\t\tFile folder = new File(path);\n\t\tFile[] listOfFiles = folder.listFiles();\n\t\tArrayList listOfPathFiles = new ArrayList();\n\n\t\t// for (int i = 0; i < listOfFiles.length; i++) {\n\t\tif (listOfFiles[n].isFile()) {\n\n\t\t\tInputStream inputStream2 = new FileInputStream(path2 + listOfFiles[n].getName());\n\t\t\tbyte[] buffer = new byte[4096];\n\t\t\tint bytesRead = 0;\n\t\t\tBASE64Encoder encoder = new BASE64Encoder();\n\t\t\tByteArrayOutputStream buffer2 = new ByteArrayOutputStream();\n\t\t\twhile (true) {\n\t\t\t\tbytesRead = inputStream2.read(buffer); \n\t\t\t\tif (bytesRead > 0) {\n\t\t\t\t\tbuffer2.write(buffer, 0, bytesRead);\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbuffer2.flush(); \n\t\t\tString codec;\n\t\t\tcodec = encoder.encode(buffer2.toByteArray());\n\t\t\tif (n >= 0) {\n\t\t\t\t// listOfPathFiles.add(\"data:image/png;base64,\"+codec);\n\t\t\t\tx = codec;\n\t\t\t}\n\t\t}\n\t\tif (listOfFiles[n].isDirectory()) {\n\t\t\tSystem.out.println(\"Directory \" + listOfFiles[n].getName());\n\t\t}\n\t\t// }\n\t\treturn x;\n\t\t// return listOfPathFiles;\n\t}", "public static List<Path> getImages(final FileSystem fs) {\n return getEntries(fs).stream().filter(ZipReaderUtil::isImage).collect(Collectors.toList());\n }", "public List<WebResource> getImages() {\r\n\t\tList<WebResource> result = new Vector<WebResource>();\r\n\t\tList<WebComponent> images = wcDao.getImages();\r\n\t\t// settare l'href corretto...\r\n\t\tfor (Iterator<WebComponent> iter = images.iterator(); iter.hasNext();) {\r\n\t\t\tresult.add((WebResource) iter.next());\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public void getImagesFromFolder() {\n File file = new File(Environment.getExternalStorageDirectory().toString() + \"/saveclick\");\n if (file.isDirectory()) {\n fileList = file.listFiles();\n for (int i = 0; i < fileList.length; i++) {\n files.add(fileList[i].getAbsolutePath());\n Log.i(\"listVideos\", \"file\" + fileList[0]);\n }\n }\n }", "protected Seq<Fi> loadImages(Xml root, Fi tmxFile){\n Seq<Fi> images = new Seq<>();\n\n for(Xml imageLayer : root.getChildrenByName(\"imagelayer\")){\n Xml image = imageLayer.getChildByName(\"image\");\n String source = image.getAttribute(\"source\", null);\n\n if(source != null){\n Fi handle = getRelativeFileHandle(tmxFile, source);\n\n if(!images.contains(handle, false)){\n images.add(handle);\n }\n }\n }\n\n return images;\n }", "@GetMapping(path = \"/images\", produces = \"application/json; charset=UTF-8\")\n public @ResponseBody ArrayNode getImageList() {\n final ArrayNode nodes = mapper.createArrayNode();\n for (final Image image : imageRepository.findAllPublic())\n try {\n nodes.add(mapper.readTree(image.toString()));\n } catch (final JsonProcessingException e) {\n e.printStackTrace();\n }\n return nodes;\n }", "public void readImage(File f) {\r\n try {\r\n //JFrame f2 = new JFrame();\r\n images.add(ImageIO.read(f));\r\n //JLabel lb = new JLabel(new ImageIcon(images.get(0)));\r\n //f2.add(lb);\r\n //f2.setVisible(true);\r\n } catch(Exception e) {\r\n JOptionPane.showMessageDialog(null, \"read image failed.\", \"System Message\", JOptionPane.ERROR_MESSAGE);\r\n e.printStackTrace();\r\n }\r\n }", "private void loadImages() {\n\t\ttry {\n\t\t\tall_images = new Bitmap[img_files.length];\n\t\t\tfor (int i = 0; i < all_images.length; i++) {\n\t\t\t\tall_images[i] = loadImage(img_files[i] + \".jpg\");\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tToast.makeText(this, \"Unable to load images\", Toast.LENGTH_LONG)\n\t\t\t\t\t.show();\n\t\t\tfinish();\n\t\t}\n\t}", "List<Bitmap> getRecipeImgSmall();", "@Override\n\tpublic void readImages() {\n\t\t\n\t}", "private List<String> getImages(SalonData salonData) {\n List<String> salonImages = new ArrayList<>();\n List<SalonImage> salonImage = salonData.getSalonImage();\n for (int i = 0; i < salonImage.size(); i++) {\n salonImages.add(salonImage.get(i).getImage());\n }\n return salonImages;\n }", "public ListImages(File directoryOfInterest, CentralController centralController)\n throws IOException {\n\n this.centralController = centralController;\n\n directory = directoryOfInterest;\n imagesInDirectory = new ArrayList<>();\n allImagesUnderDirectory = new ArrayList<>();\n\n // updates the imagesInDirectory list\n fillImagesInDirectory();\n\n // updates the allImagesUnderDirectory list\n fillAllImagesUnderDirectory(directory);\n }", "private void populateList(File[] filesList) {\n Log.i(\"mPackage\",\"FilesList: \"+filesList.length);\n for(File file : filesList) {\n //Log.i(\"mPackage\",\"Path: \"+file);\n if(file.isDirectory()) {\n populateList(file.listFiles());\n }\n else {\n MarkerModel markerModel = new MarkerModel();\n Boolean containsObj = false;\n for(File modelFile : filesList) {\n String[] extension = modelFile.getName().split(\"\\\\.\");\n if(extension[extension.length-1].equals(\"obj\")) {\n markerModel.setObj(modelFile.getPath());\n containsObj = true;\n }\n else if(extension[extension.length-1].equals(\"mtl\"))\n markerModel.setMtl(modelFile.getPath());\n else\n markerModel.addTexture(modelFile.getPath());\n }\n if(containsObj)\n models.add(markerModel);\n return;\n //models.add(file.getPath());\n //Log.i(\"mPackage\",\"Path: \"+file.getPath());\n }\n }\n }", "public ImageList() {\n\t\timageList = new ImageIcon[] { ImageList.BALLOON, ImageList.BANANA, ImageList.GENIE, ImageList.HAMSTER,\n\t\t\t\tImageList.HEART, ImageList.LION, ImageList.MONEY, ImageList.SMOOTHIE, ImageList.TREE, ImageList.TRUCK };\n\t}", "private static CopyOnWriteArrayList<String> getListOfImages(String username){\r\n\t\treturn getUser(username).getImageList();\r\n\t}", "public List<Image> getAllImage() {\n\t\treturn null;\n\t}", "public void initImages(ArrayList<Produit> l) {\r\n\r\n if (l.size() > 0) {\r\n loadImage1(l.get(0).getImg_url());\r\n \r\n }\r\n\r\n if (l.size() > 1) {\r\n loadImage2(l.get(1).getImg_url());\r\n }\r\n\r\n if (l.size() > 2) {\r\n loadImage3(l.get(2).getImg_url());\r\n \r\n }\r\n\r\n if (l.size() > 3) {\r\n loadImage4(l.get(3).getImg_url());\r\n \r\n }\r\n\r\n if (l.size() > 4) {\r\n loadImage5(l.get(4).getImg_url());\r\n \r\n }\r\n\r\n if (l.size() > 5) {\r\n loadImage6(l.get(5).getImg_url());\r\n \r\n }\r\n\r\n }", "private void get_file_List() {\n\tString file_name=null;\r\n\tfor (int i = 0; i < listOfFiles.length; i++) \r\n\t {\r\n\t \r\n\t if (listOfFiles[i].isFile()) \r\n\t {\r\n\t\t file_name = listOfFiles[i].getName();\r\n\t if (file_name.endsWith(\".xml\") || file_name.endsWith(\".XML\"))\r\n\t {\r\n\t file_list.add(file_name) ;\r\n\t }\r\n\t }\r\n\t }\r\n\t\r\n}", "public List<Image> parseMainImagesResult(Document doc) {\n\n ArrayList<Image> mainImages = new ArrayList<>();\n Elements mainHtmlImages = doc.select(CSS_IMAGE_QUERY);\n Timber.i(\"Images: %s\", mainHtmlImages.toString());\n String href;\n Image mainImage;\n for (Element mainHtmlImage : mainHtmlImages) {\n href = mainHtmlImage.attr(\"href\");\n Timber.i(\"Link href: %s\", href);\n mainImage = new Image(href);\n mainImages.add(mainImage);\n }\n return mainImages;\n }", "private List<File> getFiles() {\n\t\tList<File> mFileLists = new ArrayList<File>();\n\t\tfor (Category category : mFiles) {\n\t\t\tif (category.getName() == null) {\n\t\t\t\tLog.i(TAG, \"no file seleted=\" + category.tag);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tmFileLists.add(new File(category.getName()));\n\t\t}\n\t\treturn mFileLists;\n\t}", "public void getListaArchivos() {\n\n File rutaAudio = new File(Environment.getExternalStorageDirectory() + \"/RecordedAudio/\");\n File[] archivosAudio = rutaAudio.listFiles();\n\n for (int i = 0; i < archivosAudio.length; i++) {\n File file = archivosAudio[i];\n listadoArchivos.add(new Archivo(file.getName()));\n }\n\n File rutaVideos = new File(Environment.getExternalStorageDirectory() + \"/RecordedVideo/\");\n File[] archivosVideo = rutaVideos.listFiles();\n\n for (int i = 0; i < archivosVideo.length; i++) {\n File file = archivosVideo[i];\n listadoArchivos.add(new Archivo(file.getName()));\n }\n }", "public Files(){\n this.fileNameArray.add(\"bridge_1.txt\");\n this.fileNameArray.add(\"bridge_2.txt\");\n this.fileNameArray.add(\"bridge_3.txt\");\n this.fileNameArray.add(\"bridge_4.txt\");\n this.fileNameArray.add(\"bridge_5.txt\");\n this.fileNameArray.add(\"bridge_6.txt\");\n this.fileNameArray.add(\"bridge_7.txt\");\n this.fileNameArray.add(\"bridge_8.txt\");\n this.fileNameArray.add(\"bridge_9.txt\");\n this.fileNameArray.add(\"ladder_1.txt\");\n this.fileNameArray.add(\"ladder_2.txt\");\n this.fileNameArray.add(\"ladder_3.txt\");\n this.fileNameArray.add(\"ladder_4.txt\");\n this.fileNameArray.add(\"ladder_5.txt\");\n this.fileNameArray.add(\"ladder_6.txt\");\n this.fileNameArray.add(\"ladder_7.txt\");\n this.fileNameArray.add(\"ladder_8.txt\");\n this.fileNameArray.add(\"ladder_9.txt\");\n }", "@Nullable\n public abstract Image images();", "java.util.List<? extends com.yahoo.xpathproto.TransformTestProtos.ContentImageOrBuilder> \n getImagesByHandlerOrBuilderList();", "public List<CardImage> readAll() {\n List<CardImage> cards = new ArrayList<CardImage>();\n for (String colour : this.colours) {\n for (String number : this.numbers) {\n for (String darkLight : this.darkLight) {\n cards\n .add(\n new CardImage(colour, number, darkLight,\n new Image(getClass().getResource(\n \"cards/\" + colour + seperator + number + seperator + darkLight + \".png\")\n .toExternalForm())));\n }\n }\n }\n return cards;\n }", "List<Path> getFiles();", "public ArrayList<ImageFile> getImagesInDirectory() throws IOException {\n\n return imagesInDirectory;\n }", "List<Bitmap> getFavoriteRecipeImgs();", "private List<String> returnFiles(int selection) {\n\t\tString path = System.getProperty(\"user.dir\");\n\t\tList<String> allImages = new ArrayList<String>();\n\t\tpath += this.setFolderPath(selection);\n\t\tFile[] files = new File(path).listFiles();\n\n\t\tfor (File file : files) {\n\t\t\tif (file.isFile() && isCorrectFile(file)) {\n\t\t\t\tallImages.add(file.getAbsolutePath());\n\t\t\t}\n\t\t}\n\t\treturn allImages;\n\t}", "public File[] getFiles() {\n waitPainted(-1);\n Component list = getFileList();\n if(list instanceof JList) {\n ListModel<?> listModel = ((JList)list).getModel();\n File[] result = new File[listModel.getSize()];\n for (int i = 0; i < listModel.getSize(); i++) {\n result[i] = (File) listModel.getElementAt(i);\n }\n return result;\n } else if(list instanceof JTable){\n TableModel listModel = ((JTable)list).getModel();\n File[] result = new File[listModel.getRowCount()];\n for (int i = 0; i < listModel.getRowCount(); i++) {\n result[i] = (File) listModel.getValueAt(i, 0);\n }\n return result;\n } else\n throw new IllegalStateException(\"Wrong component type\");\n }", "protected List<String> readFile()\n {\n // Base size 620 for Google KML icons. This might be slow for larger\n // sets.\n List<String> lines = New.list(620);\n try (BufferedReader reader = new BufferedReader(\n new InputStreamReader(getClass().getResourceAsStream(myImageList), StringUtilities.DEFAULT_CHARSET)))\n {\n for (String line = reader.readLine(); line != null; line = reader.readLine())\n {\n lines.add(line);\n }\n }\n catch (IOException e)\n {\n LOGGER.warn(e.getMessage());\n }\n return lines;\n }", "List<BufferedImage> listarHuellas(Integer fcdc_id) throws SQLException, IOException;", "private void getBaseImageDockerfiles(){\n ArrayList<String> baseList = new ArrayList<String>();\n InputStream inputStream = brokenJavaNaming(\"base.list\");\n if(inputStream == null){\n System.out.println(\"No base.list file found.\");\n }else{\n InputStreamReader streamReader = new InputStreamReader(inputStream, StandardCharsets.UTF_8);\n BufferedReader reader = new BufferedReader(streamReader);\n try{\n for (String line; (line = reader.readLine()) != null;) {\n baseList.add(line);\n } \n }catch(IOException ex){\n System.out.println(ex);\n }\n }\n\n // Get list of valid base dockerfiles\n File dockerfileBasesPath = new File(labtainerPath + File.separator +\"scripts\"+ File.separator+\"designer\"+File.separator+\"base_dockerfiles\");\n File[] baseFiles = dockerfileBasesPath.listFiles(new FilenameFilter(){\n public boolean accept(File dockerfileBasesPath, String filename)\n {return filename.startsWith(\"Dockerfile.labtainer.\"); }\n } );\n \n for(int i = 0;i<baseFiles.length;i++){\n String base = baseFiles[i].getName().split(\"Dockerfile.labtainer.\")[1];\n if(!baseList.contains(base)){\n baseList.add(base);\n }\n }\n \n //Set the base image combobox options for making new labs and adding containers\n for(String baseImage : baseList){\n NewLabBaseImageComboBox.addItem(baseImage);\n ContainerAddDialogBaseImageCombobox.addItem(baseImage);\n }\n }", "public void run() {\nif(i[0] ==le.size()){\n i[0]=0;}\n File file = new File(\"/var/www/html/PawsAndClaws/web/bundles/uploads/brochures/\" + le.get( i[0]).getBrochure());\n\n Image it = new Image(file.toURI().toString(), 500, 310, false, false);\n eventspicture.setImage(it);\n i[0]++;\n }", "private static List<Path> listChunkableFiles(FileSystem fs) throws IOException {\r\n\r\n List<Path> resultMediaPathList = new ArrayList<Path>();\r\n\r\n Path mediaFolderInsideZipPath = getMediaDirectoryPath(fs);\r\n // list the contents of the result /media/ folder\r\n try (DirectoryStream<Path> mediaDirectoryStream = Files.newDirectoryStream(mediaFolderInsideZipPath)) {\r\n // for every file in the result /media/ folder\r\n // note: NOT expecting any subfolders\r\n for (Path mediaFilePath : mediaDirectoryStream) {\r\n if (BMPUtils.CHUNKABLE_IMAGE_FILE_EXTENSIONS.contains(FileUtils.getFileExtension(mediaFilePath.toString()))) {\r\n resultMediaPathList.add(mediaFilePath);\r\n }\r\n }\r\n }\r\n\r\n return resultMediaPathList;\r\n }", "List<IbeisImage> uploadImages(List<File> images) throws UnsupportedImageFileTypeException, IOException,\n MalformedHttpRequestException, UnsuccessfulHttpRequestException;", "public java.util.List<com.yahoo.xpathproto.TransformTestProtos.ContentImage> getImagesByHandlerList() {\n if (imagesByHandlerBuilder_ == null) {\n return java.util.Collections.unmodifiableList(imagesByHandler_);\n } else {\n return imagesByHandlerBuilder_.getMessageList();\n }\n }", "public List<Image> getAllImages() {\n\t\treturn list;\n\t}", "public abstract List<LocalFile> getAllFiles();", "private void processImages() throws MalformedURLException, IOException {\r\n\r\n\t\tNodeFilter imageFilter = new NodeClassFilter(ImageTag.class);\r\n\t\timageList = fullList.extractAllNodesThatMatch(imageFilter, true);\r\n\t\tthePageImages = new HashMap<String, byte[]>();\r\n\r\n\t\tfor (SimpleNodeIterator nodeIter = imageList.elements(); nodeIter\r\n\t\t\t\t.hasMoreNodes();) {\r\n\t\t\tImageTag tempNode = (ImageTag) nodeIter.nextNode();\r\n\t\t\tString tagText = tempNode.getText();\r\n\r\n\t\t\t// Populate imageUrlText String\r\n\t\t\tString imageUrlText = tempNode.getImageURL();\r\n\r\n\t\t\tif (imageUrlText != \"\") {\r\n\t\t\t\t// Print to console, to verify relative link processing\r\n\t\t\t\tSystem.out.println(\"ImageUrl to Retrieve:\" + imageUrlText);\r\n\r\n\t\t\t\tbyte[] imgArray = downloadBinaryData(imageUrlText);\r\n\r\n\t\t\t\tthePageImages.put(tagText, imgArray);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public void Encode_Image1() {\n\n for (String s : Arraylist_image_encode) {\n listString += s + \"IMAGE:\";\n }\n\n }", "public void fillDeck() {\n folder = new File(imagesPath);\n listOfImages = folder.listFiles();\n// System.out.println(\"Path: \"+new File(listOfImages[0].getName()).toURI().toString());\n for (int i = 0; i < listOfImages.length; i++) {\n if (listOfImages[i].isFile() && listOfImages[i].getName().startsWith(\"Playing\")) {\n cards.add(new Card());\n cards.get(i).setName(listOfImages[i].getName());\n Image img = new Image(ImgPath + listOfImages[i].getName());\n ImageView view = new ImageView(img);\n view.setFitHeight(100);\n view.setFitWidth(80);\n cards.get(i).setImage(view);\n }\n }\n\n }", "public abstract List<String> getFiles( );", "public List<String> getFiles();", "private List<? extends Image> getIconImages(String imgunnamedjpg) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }", "public Image[] getImages() {\n return images;\n }", "private void processImages(List<String> images) {\n setTitle(\"Showing images\");\n mImages = images;\n setListAdapter(new ImagesAdapter());\n }", "java.util.List<com.yahoo.xpathproto.TransformTestProtos.ContentImage> \n getImagesByTransformList();", "private void imageSearch(ArrayList<Html> src) {\n // loop through the Html objects\n for(Html page : src) {\n\n // Temp List for improved readability\n ArrayList<Image> images = page.getImages();\n\n // loop through the corresponding images\n for(Image i : images) {\n if(i.getName().equals(this.fileName)) {\n this.numPagesDisplayed++;\n this.pageList.add(page.getLocalPath());\n }\n }\n }\n }", "private List<MediaFile> listHtml() {\n\t\tList<MediaFile> list = new ArrayList<MediaFile>(32);\n\t\treturn list;\n\t}", "public Categories1(Controller controller, LeapListener listener, String dos) {\n initComponents();\n this.listener = listener;\n this.controller = controller;\n doss = dos;\n File repertoire = new File(\"Images\\\\\"+doss);\n File[] files=repertoire.listFiles();\n for(int i=0; i<files.length;i++){\n \n if(files[i].getName().split(\"\\\\.\")[1].equals(\"jpg\")||files[i].getName().split(\"\\\\.\")[1].equals(\"png\")){\n System.out.println(files[i].getName());\n names.add(\"Images/\"+doss+\"/\"+files[i].getName());\n }\n }\n \n \n /* names.add(\"src/guibuilder/newpackage/PIG\");\n names.add(\"src/guibuilder/newpackage/PIG - Copie\");\n names.add(\"src/guibuilder/newpackage/PIG - Copie (2)\");*/\n // n = -1; \n n = 0;\n }", "@Override\n\tpublic List<AddBookDto> findListimage(List<addBookBo> listBo) throws IOException {\n\n\t\tFile uploadFileDir, uploadImageDir;\n\n\t\tFileInputStream fileInputStream = null;\n\n\t\tList<AddBookDto> dtoList = new ArrayList<>();\n\n\t\tSet<Category> setCategory = new HashSet<>();\n\n\t\tSystem.out.println(\"UploadService.findListimage()\");\n\n\t\tfor (addBookBo bo : listBo) {\n\n\t\t\tAddBookDto dto = new AddBookDto();\n\n\t\t\tBeanUtils.copyProperties(bo, dto);\n\n\t\t\tSystem.out.println(\"UploadService.findListimage()-------\" + bo.getAuthor());\n\n\t\t\tuploadImageDir = new File(imageUploadpath + \"/\" + dto.getImageUrl() + \".jpg\");\n\n\t\t\tif (uploadImageDir.exists()) {\n\n\t\t\t\tbyte[] buffer = getBytesFromFile(uploadImageDir);\n\t\t\t\t// System.out.println(bo.getTitle()+\"====b===\" + buffer);\n\t\t\t\tdto.setImgeContent(buffer);\n\n\t\t\t}\n\n\t\t\tSystem.out.println(dto.getTitle() + \"====dto===\" + dto.getImgeContent());\n\t\t\tdtoList.add(dto);\n\n\t\t}\n\n\t\treturn dtoList;\n\t}", "com.yahoo.xpathproto.TransformTestProtos.ContentImage getImagesByHandler(int index);", "public void populateCachedImages(File dir)\n {\n if (dir.exists())\n {\n File[] files = dir.listFiles();\n for (int i = 0; i < files.length; i++)\n {\n File file = files[i];\n if (!file.isDirectory())\n {\n //Record all filenames from the cache so we know which photos to retrieve from database\n cachedFileNames.add(file.getName());\n imageList.add(file);\n }\n }\n }\n }", "public java.util.List<com.yahoo.xpathproto.TransformTestProtos.ContentImage> getImagesByHandlerList() {\n return imagesByHandler_;\n }", "public static File[] getUserImages(String username) {\n File[] userFiles = ImageFactory.getFilePaths(username);\n\n String[] userImageURLs = new String[userFiles.length];\n for(int i = 0; i < userFiles.length; i++) {\n userImageURLs[i] = userFiles[i].toURI().toString();\n }\n\n return userFiles;\n }", "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 }", "public List<? extends PictureData> getAllPictures() {\n\t\treturn null;\n\t}", "private File getNextPicture() {\r\n File retVal = null;\r\n\r\n if (listFiles.size() > 0) {\r\n if (fileList.getSelectedIndex() == listFiles.size() - 1) {\r\n retVal = listFiles.get(0);\r\n fileList.setSelectedIndex(0);\r\n } else {\r\n retVal = listFiles.get(fileList.getSelectedIndex() + 1);\r\n fileList.setSelectedIndex(fileList.getSelectedIndex() + 1);\r\n }\r\n }\r\n\r\n return retVal;\r\n }", "public ArrayList<Group> GetImageStorageMelanoma() {\n\t\tExListViewController selImagens = new ExListViewController();\n\t\treturn selImagens.SelectPicsOnMelanomaDirectory(CreateListFiles());\n\t}", "public void listFiles(String path) {\r\n String files;\r\n File folder = new File(path);\r\n File[] listOfFiles = folder.listFiles();\r\n\r\n for (int i = 0; i < listOfFiles.length; i++) {\r\n\r\n if (listOfFiles[i].isFile()) {\r\n files = listOfFiles[i].getName();\r\n if (files.endsWith(\".png\") || files.endsWith(\".PNG\")\r\n || files.endsWith(\".gif\") || files.endsWith(\".GIF\")) {\r\n //System.out.println(files);\r\n pathList.add(path+\"\\\\\");\r\n fileList.add(files);\r\n }\r\n }\r\n \r\n else {\r\n listFiles(path+\"\\\\\"+listOfFiles[i].getName());\r\n }\r\n }\r\n }", "public ImageIcon[] getImages() {\n\t\treturn imageList;\n\t}", "public BoundedAnimation(String filePrefix, int frameCount) {\n images = new ArrayList<Image>();\n for (int i=1; i<frameCount+1; i++) {\n //System.out.Println(filePrefix + \"_\" + i);\n ImageIcon ii = new ImageIcon(filePrefix + \"_\" + i + \".png\");\n images.add(ii.getImage());\n }\n }", "private void createImageFiles() {\n\t\tswitchIconClosed = Icon.createImageIcon(\"/images/events/switchImageClosed.png\");\n\t\tswitchIconOpen = Icon.createImageIcon(\"/images/events/switchImageOpen.png\");\n\t\tswitchIconEmpty = Icon.createImageIcon(\"/images/events/switchImageEmpty.png\");\n\t\tswitchIconOff = Icon.createImageIcon(\"/images/events/switchImageOff.png\");\n\t\tswitchIconOn = Icon.createImageIcon(\"/images/events/switchImageOn.png\");\n\t\tleverIconClean = Icon.createImageIcon(\"/images/events/leverImageClean.png\");\n\t\tleverIconRusty = Icon.createImageIcon(\"/images/events/leverImageRusty.png\");\n\t\tleverIconOn = Icon.createImageIcon(\"/images/events/leverImageOn.png\");\n\t}", "public static String[] pickListOfNImagesRandom(int n, File dir ){\n String[] imageFileNameList = new String[n+5];\n String[] inputFileList = dir.list();\n for(int i =0; i < imageFileNameList.length; i++){\n int random = (int) getRandomIntegerBetweenRange(0,inputFileList.length-1);\n imageFileNameList[i] = inputFileList[random];\n }\n /*\n for(String imageFileNameListItem : imageFileNameList){\n System.out.println(imageFileNameListItem);\n }\n */\n return imageFileNameList;\n }", "@GetMapping(\"/files\")\n public ResponseEntity<List<FileInfo>> getListFiles() {\n List<FileInfo> fileInfos = storageService.loadAll().map(path -> {\n String filename = path.getFileName().toString();\n String url = MvcUriComponentsBuilder\n .fromMethodName(FilesController.class, \"getFile\", path.getFileName().toString()).build().toString();\n\n return new FileInfo(filename, url);\n }).collect(Collectors.toList());\n\n return ResponseEntity.status(HttpStatus.OK).body(fileInfos);\n }", "public void createImages(){\n for(String s : allPlayerMoves){\n String a = \"Left\";\n for(int i = 0; i < 2; i++) {\n ArrayList<Image> tempImg = new ArrayList();\n boolean done = false;\n int j = 1;\n while(!done){\n try{\n tempImg.add(ImageIO.read(new File(pathToImageFolder+s+a+j+\".png\")));\n j++;\n } catch (IOException ex) {\n done = true;\n }\n }\n String temp = s.replace(\"/\",\"\") + a;\n playerImages.put(temp, tempImg);\n a = \"Right\";\n }\n }\n imagesCreated = true;\n }", "public List<Pic> list() {\n\t\treturn picDao.list();\n\t}", "public ArrayList<BufferedImage> getImages(File gif) throws IOException {\r\n\t\tArrayList<BufferedImage> imgs = new ArrayList<BufferedImage>();\r\n\t\tImageReader rdr = new GIFImageReader(new GIFImageReaderSpi());\r\n\t\trdr.setInput(ImageIO.createImageInputStream(gif));\r\n\t\tfor (int i=0;i < rdr.getNumImages(true); i++) {\r\n\t\t\timgs.add(rdr.read(i));\r\n\t\t}\r\n\t\treturn imgs;\r\n\t}", "public List<CameraRecord> loadThumbnail();", "private void initializeImageModels() {\n for(ImageModel model : GalleryFragment.listImageModel){\n imgList.add(model.getImagePath());\n }\n }", "private void loadImages(BufferedImage[] images, String direction) {\n for (int i = 0; i < images.length; i++) {\n String fileName = direction + (i + 1);\n images[i] = GameManager.getResources().getMonsterImages().get(\n fileName);\n }\n\n }", "public Files files();", "public static void main(String[] args) {\n ArrayList<String> listUrl = new ArrayList<String>();\n listUrl.add(\"http://minionomaniya.ru/wp-content/uploads/2016/01/%D0%9A%D0%B5%D0%B2%D0%B8%D0%BD.jpg\");\n listUrl.add(\"http://minionomaniya.ru/wp-content/uploads/2016/01/%D0%9A%D0%B5%D0%B2%D0%B8%D0%BD.jpg\");\n listUrl.add(\"http://minionomaniya.ru/wp-content/uploads/2016/01/%D0%9A%D0%B5%D0%B2%D0%B8%D0%BD.jpg\");\n listUrl.add(\"http://minionomaniya.ru/wp-content/uploads/2016/01/%D0%9A%D0%B5%D0%B2%D0%B8%D0%BD.jpg\");\n listUrl.add(\"http://minionomaniya.ru/wp-content/uploads/2016/01/%D0%9A%D0%B5%D0%B2%D0%B8%D0%BD.jpg\");\n listUrl.add(\"http://minionomaniya.ru/wp-content/uploads/2016/01/%D0%9A%D0%B5%D0%B2%D0%B8%D0%BD.jpg\");\n listUrl.add(\"http://minionomaniya.ru/wp-content/uploads/2016/01/%D0%9A%D0%B5%D0%B2%D0%B8%D0%BD.jpg\");\n for (String url : listUrl) {\n Thread thread = new Thread(new LoadImage(url));\n thread.start();\n }\n }", "private void fillImageViewList(){\n ImageView imView1 =(ImageView) findViewById(R.id.imgCel1);\n ImageView imView2 =(ImageView) findViewById(R.id.imgCel2);\n ImageView imView3 =(ImageView) findViewById(R.id.imgCel3);\n ImageView imView4 =(ImageView) findViewById(R.id.imgCel4);\n ImageView imView5 =(ImageView) findViewById(R.id.imgCel5);\n ImageView imView6 =(ImageView) findViewById(R.id.imgCel6);\n ImageView imView7 =(ImageView) findViewById(R.id.imgCel7);\n ImageView imView8 =(ImageView) findViewById(R.id.imgCel8);\n ImageView imView9 =(ImageView) findViewById(R.id.imgCel9);\n\n imageList = new ArrayList<>();\n\n imageList.add(imView1); imageList.add(imView2);\n imageList.add(imView3); imageList.add(imView4);\n imageList.add(imView5); imageList.add(imView6);\n imageList.add(imView7); imageList.add(imView8);\n imageList.add(imView9);\n }", "public List getAssociatedFiles()\n {\n return m_files;\n }", "public java.util.List<? extends com.yahoo.xpathproto.TransformTestProtos.ContentImageOrBuilder> \n getImagesByHandlerOrBuilderList() {\n if (imagesByHandlerBuilder_ != null) {\n return imagesByHandlerBuilder_.getMessageOrBuilderList();\n } else {\n return java.util.Collections.unmodifiableList(imagesByHandler_);\n }\n }", "public void refreshImages() {\n\t\tsetContentView(R.layout.activity_overview);\n\t\trow = 0;\n\t\tcolumn = 0;\n\t\t// Open the file\n\t\tFile file = new File(getFilesDir().getAbsoluteFile() + \"/photos.txt\");\n\t\tLog.i(TAG, file.getAbsolutePath());\n\t\t// If there is no file, create a new one\n\t\tif (!file.exists()) {\n\t\t\ttry {\n\t\t\t\tfile.createNewFile();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\t// Open an inputStream for reading the file\n\t\t\tFileInputStream inStream = openFileInput(\"photos.txt\");\n\t\t\tBufferedReader readFile = new BufferedReader(new InputStreamReader(inStream));\n\t\t\tpicturePaths = new ArrayList<String>();\n\t\t\tString receiveString = \"\";\n\t\t\t// Read in each line\n\t\t\twhile ((receiveString = readFile.readLine()) != null) {\n\t\t\t\t// Add the line to picturePaths and add an Image with the path specified\n\t\t\t\tpicturePaths.add(receiveString);\n\t\t\t\tLog.i(\"picture\", receiveString);\n\t\t\t\taddImage(receiveString);\n\t\t\t\treceiveString = \"\";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public ArrayList<Image> getImages() {\n\t\treturn getPageObjects(Image.class);\n\t}", "public byte[] getImages() {\n return images;\n }" ]
[ "0.73683196", "0.69815266", "0.6837145", "0.67402357", "0.67095214", "0.67026037", "0.66198635", "0.65602857", "0.64591664", "0.63910747", "0.6378348", "0.63678366", "0.63552797", "0.6354179", "0.62834024", "0.62755847", "0.6234258", "0.6222922", "0.62094116", "0.62033397", "0.6174251", "0.6155451", "0.61406803", "0.61303806", "0.6115178", "0.6101674", "0.6095117", "0.6081752", "0.60788345", "0.6071878", "0.60624564", "0.6048135", "0.60476506", "0.60391825", "0.6032523", "0.60278153", "0.6000162", "0.5999048", "0.59924656", "0.59859", "0.5976359", "0.59665155", "0.59640586", "0.5945699", "0.5940844", "0.5939534", "0.59313494", "0.5915859", "0.5899563", "0.5891997", "0.58815956", "0.58391225", "0.58329445", "0.58222896", "0.58198076", "0.58171463", "0.5813242", "0.58092964", "0.5808166", "0.58042085", "0.5802404", "0.58003074", "0.5798634", "0.57982886", "0.57964176", "0.5795255", "0.5787359", "0.5784428", "0.5769045", "0.5762441", "0.5760751", "0.57365555", "0.5727915", "0.5715195", "0.5708526", "0.57068324", "0.57062244", "0.5700379", "0.569647", "0.5694497", "0.5688102", "0.56868064", "0.56771976", "0.56764966", "0.56755525", "0.5674941", "0.56738067", "0.567009", "0.5668521", "0.56579965", "0.5649732", "0.5643872", "0.56225914", "0.5615697", "0.5611206", "0.56076103", "0.5605919", "0.5602855", "0.56023395", "0.56008804", "0.5599916" ]
0.0
-1
Sets the won flag to true
public void setWon(){ won = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void win()\r\n\t{\r\n\t\tmWon = true;\r\n\t}", "public void setGameWon(Boolean won){\n\t\tm_gameWon = won;\n\t}", "public void winGame() {\n this.isWinner = true;\n }", "public void setWins() {\r\n this.wins++;\r\n }", "public boolean gameWon(){\n\t\treturn Game.gameWon;\n\t}", "public boolean won()\n {\n if (currentScore >= PigGame.GOAL)\n {\n return true;\n }\n \n else\n {\n return false;\n }\n }", "public void setWinner(boolean winner) {\n\t\tthis.winner = winner;\n\t}", "public void setWins(int value) {\n this.wins = value;\n }", "public void setWins(int wins) {\n if (wins > 0) {\n this.wins = wins;\n }\n }", "private void wins(Player player){\n int win = 1;\n player.setWins(win);\n }", "@Override\n\tpublic boolean playerWon() {\n\t\treturn lastPlayerWin;\n\t}", "public boolean hasWon() {\n return this.isWinner;\n }", "public void wonGame(){\n\t\tSystem.out.println(\"Bravo, du hast gewonnen! Möchtest du noch einmal spielen?\");\n\t\tstopGame();\n\t\tstarted = false;\n\t\tspiel_status = 1;\n\t\tpaintMenu();\n\t}", "public static void playerWonInc(){\r\n\t\t_playerWon++;\r\n\t}", "public void winGame() {\r\n if (data.gameState == 3) \r\n data.winner = 1;\r\n else if (data.gameState == 4) \r\n data.winner = 2;\r\n data.victoryFlag = true;\r\n data.gameState = 5;\r\n }", "public 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 isWon() {\n return getWinningScenario() != null;\n }", "public void gameWon()\n {\n ScoreBoard endGame = new ScoreBoard(\"You Win!\", scoreCounter.getValue());\n addObject(endGame, getWidth()/2, getHeight()/2);\n }", "public void win() {\n if (turn == 1) {\n p1.incrementLegs();\n if (p1.getLegs() == 5) {\n p1.incrementSets();\n p1.setLegs(0);\n p2.setSets(0);\n\n }\n if (p1LastScore > p1.getHighout()) {\n p1.setHighout(p1LastScore);\n\n }\n\n if (p1.getHighout() > OVERALL_HIGH_OUT) {\n OVERALL_HIGH_OUT = p1.getHighout();\n }\n } else if (turn == 2) {\n p2.incrementLegs();\n if (p2.getLegs() == 5) {\n p2.incrementSets();\n p2.setLegs(0);\n p1.setSets(0);\n\n }\n if (p2LastScore > p2.getHighout()) {\n p2.setHighout(p2LastScore);\n }\n\n if (p2.getHighout() > OVERALL_HIGH_OUT) {\n OVERALL_HIGH_OUT = p2.getHighout();\n }\n\n\n\n }\n changeFirstTurn();\n win = true;\n\n\n\n }", "public void gameOver(boolean won){\r\n\t\tif(won){\r\n\t\t\tgameState = \"Won\";\r\n\t\t}else{\r\n\t\t\tgameState = \"Lost\";\r\n\t\t}\r\n\t\tb1.setVisible(true);\r\n\t\tb2.setText(\"Play Again\");\r\n\t\tb2.setVisible(true);\r\n\t}", "void win() {\n if (_game.isWon()) {\n showMessage(\"Congratulations you win!!\", \"WIN\", \"plain\");\n }\n }", "public boolean gameWon(){\n return false;\n }", "public Boolean getGameWon(){\n\t\treturn m_gameWon;\n\t\t\n\t}", "public void setGamesWon(int number) {\n\t\tthis.gamesWon = number;\n\t}", "void win() {\n\t\t_money += _bet * 2;\n\t\t_wins++;\n\t\tclearHand();\n\t\t_bet = 0;\n\t}", "public boolean hasWon() {\n return isGoal(curBoard);\n }", "@Test\r\n\tpublic final void testIsWon() {\r\n\t\tassertTrue(gameStatistics.isWon());\r\n\t\tassertFalse(gameStatisticsLoss.isWon());\r\n\t}", "@Test\n\tpublic void testIsWon() {\n\t\tGameState test = new GameState();\n\t\ttest.blankBoard();\n\t\tassertTrue(test.isWon());\n\t}", "public void announceWinner(){\n gameState = GameState.HASWINNER;\n notifyObservers();\n }", "public boolean hasWon(){\n boolean winStatus = false;\n if(balance >= 3000){\n winStatus = true;\n }\n return winStatus;\n }", "public void win(){\n // If this object is not the current arena state obsolete it.\n if(this != battleState) return;\n if(win) return;\n\n isOver = true;\n setSlowMo(false);\n win = true;\n setSelectedPc(null);\n\n Spell.clear();\n for(Button x : spellButtons){\n x.setActive(false);\n }\n TouchHandler.clear();\n SpellTouchInput.clear();\n battleStateWin();\n }", "public boolean isWinner() {\n\t\treturn winner;\n\t}", "public void battleOver()\r\n {\r\n isBattleOver = true;\r\n }", "public void setWinner(Player winner) {\n this.winner = winner;\n }", "public void setWin(boolean win) {\n this.win = win;\n }", "public boolean oWins() {\n\t\tif (checkWinner(LETTER_O) == 1)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "void update(boolean winner);", "public boolean isHasWinner() {\n return hasWinner;\n }", "public void increaseWins(){\n this.numberOfWins=this.numberOfWins+1;\n }", "public static void decidedWinner(){\n if(playerOneWon == true ){\n//\n// win.Fill(\"Player One Has Won !\");\n// new WinnerWindow().setVisible(true);\n }\n else if (playerTwoWon == true){\n// win.Fill(\"Player Two Has Won !\");\n// new WinnerWindow().setVisible(true);\n }\n else\n {\n// win.Fill(\"Match Has been Tied !\");\n// new WinnerWindow().setVisible(true);\n }\n }", "public static boolean isGameWon() {\r\n\t\tboolean gameWon = false;\r\n\t\t\r\n\t\t//Game won for three handed game.\r\n\t\tif (Main.isThreeHanded){\r\n\t\t\tif (Utils.stringToInt(Main.player1Score) >= Main.winScoreNumb ||\r\n\t\t\t\t\tUtils.stringToInt(Main.player2Score) >= Main.winScoreNumb ||\r\n\t\t\t\t\tUtils.stringToInt(Main.player3Score) >= Main.winScoreNumb) {\r\n\t\t\t\tgameWon = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Game won for four handed single player game.\r\n\t\tif (Main.isFourHandedSingle){\r\n\t\t\tif (Utils.stringToInt(Main.player1Score) >= Main.winScoreNumb ||\r\n\t\t\t\t\tUtils.stringToInt(Main.player2Score) >= Main.winScoreNumb ||\r\n\t\t\t\t\tUtils.stringToInt(Main.player3Score) >= Main.winScoreNumb ||\r\n\t\t\t\t\tUtils.stringToInt(Main.player4Score) >= Main.winScoreNumb) {\r\n\t\t\t\tgameWon = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Game won for four handed team game.\r\n\t\tif (Main.isFourHandedTeams){\r\n\t\t\tif (Utils.stringToInt(Main.team1Score) >= Main.winScoreNumb ||\r\n\t\t\t\t\tUtils.stringToInt(Main.team2Score) >= Main.winScoreNumb) {\r\n\t\t\t\tgameWon = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Set Main variable.\r\n\t\tMain.isGameWon = gameWon;\r\n\t\t\r\n\t\treturn gameWon;\r\n\t}", "public boolean won()\n {\n for(int i=0;i<4;i++)\n {\n if(foundationPile[i].isEmpty() || foundationPile[i].peek().getRank()!=Rank.KING)\n return false; \n }\n return true;\n }", "public boolean topPlayerWon() {\n return winner == 2;\n }", "public void turn_on () {\n this.on = true;\n }", "public void switchPlayer() {\n \tisWhitesTurn = !isWhitesTurn;\n }", "private void win(int winner)\n {\n switch (winner) {\n case PLAYER_1_FLAG:\n player1.gameOver(RESULT_WIN);\n player2.gameOver(RESULT_LOSS);\n winSend.close();\n break;\n case PLAYER_2_FLAG:\n player1.gameOver(RESULT_LOSS);\n player2.gameOver(RESULT_WIN);\n \n winSend.close();\n break;\n }\n }", "int getWins() {return _wins;}", "public synchronized boolean HaveWon() {\n if (maxScore <= score) {\n return true;\n }\n return false;\n }", "public boolean winner() {\r\n return winner;\r\n }", "public boolean winState() {\n\t\treturn this.numTargets == this.onTargets;\n\t}", "public void incOWins() {\n oWins++;\n }", "void checkWinner() {\n\t}", "public void playerWon()\r\n {\r\n \r\n }", "private void announceWinner() {\n // FIXME\n if (_board.turn() == Piece.WP) {\n System.out.println(\"Black wins.\");\n } else {\n System.out.println(\"White wins.\");\n }\n }", "public void changeTurn()\r\n {\r\n isPlayersTurn = !isPlayersTurn;\r\n }", "public boolean getIsWinner() {\n\t\treturn isWinner;\n\t}", "@Test\n public void testPlayerWon()\n {\n assertTrue(theEngine.inStartingState());\n theEngine.start();\n assertTrue(theEngine.inPlayingState());\n assertTrue(theEngine.getPlayer().living());\n\n theEngine.quit();\n assertTrue(theEngine.inHaltedState());\n \n theEngine.start();\n assertTrue(theEngine.inPlayingState());\n \n letPlayerWin();\n \n assertTrue(theEngine.getPlayer().living());\n assertTrue(getTheGame().playerWon());\n assertTrue(theEngine.inGameOverState());\n assertTrue(theEngine.inWonState());\n \n theEngine.start();\n assertTrue(theEngine.inStartingState());\n }", "public void win() {\n JOptionPane.showConfirmDialog(null, \"You won! You got out with \" + this.player.getGold() + \" gold!\", \"VICTORY!\", JOptionPane.OK_OPTION);\n this.saveScore();\n this.updateScores();\n this.showTitleScreen();\n }", "private boolean winGame() {\n if (model.isCompleted()) {\n win.message(\"Winner\");\n return true;\n }\n return false;\n }", "public void setWonder(Wonder wonder) {\n this.wonder = wonder;\n }", "public static void checkWinCondition() {\n\t\twin = false;\n\t\tif (curPlayer == 1 && arrContains(2, 4))\n\t\t\twin = true;\n\t\telse if (curPlayer == 2 && arrContains(1, 3))\n\t\t\twin = true;\n\t\tif (curPlayer == 2 && !gameLogic.Logic.arrContains(2, 4))\n\t\t\tP2P.gameLost = true;\n\t\telse if (gameLogic.Logic.curPlayer == 1 && !gameLogic.Logic.arrContains(1, 3))\n\t\t\tP2P.gameLost = true;\n\t\tif (P2P.gameLost == true) {\n\t\t\tif (gameLogic.Logic.curPlayer == 1)\n\t\t\t\tEndScreen.infoWindow.setText(\"<html><center><b><font size=25 color=black> Black player won! </font></b></center></html>\");\n\t\t\telse\n\t\t\t\tEndScreen.infoWindow.setText(\"<html><center><b><font size=25 color=black> Red player won! </font></b></center></html>\");\n\t\t}\n\t\telse\n\t\t\twin = false;\n\t}", "public boolean gameWon() {\n\t\tfor (int i = 0; i < gameBoard.length; i++) {\n\t\t for (int j = 0; j < gameBoard.length; j++) {\n\t\t \tif (gameBoard[i][j] == 'M' || gameBoard[i][j] == 'I') {\n\t\t \t\treturn false;\n\t\t \t}\n\t\t }\n\t\t}\n\t\treturn true;\n\t}", "public boolean 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 void turnOn(boolean truth) {\r\n setEnabled(truth);\r\n }", "public char isWon() {\n for (int y = 0; y < spaces.length; y++) {\n for (int x = 0; x < spaces[0].length; x++) {\n wonBoards[y][x] = spaces[y][x].isWon().getWinner();\n }\n }\n return isWonButForChars();\n }", "public void checkWin(){\n boolean result = false;\n if(game.getTurn() > 3){\n Player currentPlayer = game.getPlayerTurn();\n int playernumber = currentPlayer.getPlayericon();\n result = game.winChecker(game.getBored(),playernumber);\n if(result == true) {\n setWinMsgBox(currentPlayer.getPlayerName() + \" Is victorious :)\",\"WIN\");\n }else if(game.getTurn() == 8 && result == false){\n setWinMsgBox(\"Too bad it is a draw, No one out smarted the other -_-\",\"DRAW\");\n }else{}\n }else{\n result = false;\n }\n }", "public void setWinner(int num){\r\n \twinner = num;\r\n }", "public static void win()\n\t{\n\t\tGame.setMoney(Game.getMoney()+bet);\n\t\tremainingMoneyN.setText(String.valueOf(Game.getMoney()));\n\t\tbet=0;\n\t\ttfBet.setText(\"0\");\n\t\tif(Game.getMoney()>Game.getHighScore())\n\t\t{\n\t\t\tGame.setHighScore(Game.getMoney());\n\t\t\tlblHighScore.setText(String.valueOf(Game.getHighScore()));\n\t\t}\n\t\tlblUpdate.setText(\"You win!\");\n\n\t}", "public void turnOn() {\n\t\tisOn = true;\n\t}", "public static void enemyWonInc(){\r\n\t\t_enemyWon++;\r\n\t}", "protected boolean checkForWin() {\r\n \t\r\n if (squaresRevealed == this.width * this.height - this.mines) {\r\n finishFlags();\r\n finish(GameStateModel.WON);\r\n return true;\r\n } \t\r\n \t\r\n return false;\r\n \t\r\n }", "public void turnOn() {\n\t\tOn = true;\n\t}", "public boolean playerWins(){\n return playerFoundTreasure(curPlayerRow, curPlayerCol);\n }", "public void setWinner(boolean isTopWinner) {\n winner = isTopWinner ? 2 : 1;\n }", "private void gameWon() {\n\n stopTime();\n //reveal all mines and mark them\n for (int i = 0; i < minefield.getRows(); i++) {\n for (int j = 0; j < minefield.getCols(); j++) {\n if (minefield.getMinefield()[i][j].isMined()) {\n tileLabel[i][j].setIcon(flagIcon);\n tile[i][j].setBackground(Color.green);\n }\n }\n }\n\n JFrame winframe = new JFrame(\"Winner!\");\n JPanel winpanel = new JPanel();\n JLabel label = new JLabel(\"Well done, you beat the game!\");\n JLabel label2 = new JLabel(\" Time taken: \" + time + \" \");\n JButton close = new JButton(\"Close\");\n JButton restart = new JButton(\"Restart\");\n\n close.addActionListener((ActionEvent e) -> {\n winframe.dispose();\n });\n\n restart.addActionListener((ActionEvent e) -> {\n frame.dispose();\n winframe.dispose();\n createNewGame(minefield.getRows(), minefield.getCols(), minefield.getMaxMines());\n });\n\n winpanel.add(label);\n winpanel.add(label2);\n winpanel.add(close);\n winpanel.add(restart);\n winframe.add(winpanel);\n winframe.setLocationRelativeTo(null);\n winframe.setSize(220, 110);\n winframe.setResizable(false);\n winframe.setVisible(true);\n }", "public boolean meWin(){\n return whitePieces.size() > blackPieces.size() && isWhitePlayer;\n }", "public boolean xWins() {\n\t\tif (checkWinner(LETTER_X) == 1)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public void announceWinner() {\r\n Piece winer;\r\n if (_board.piecesContiguous(_board.turn().opposite())) {\r\n winer = _board.turn().opposite();\r\n } else {\r\n winer = _board.turn();\r\n }\r\n if (winer == WP) {\r\n _command.announce(\"White wins.\", \"Game Over\");\r\n System.out.println(\"White wins.\");\r\n } else {\r\n _command.announce(\"Black wins.\", \"Game Over\");\r\n System.out.println(\"Black wins.\");\r\n }\r\n }", "public void setGameDraw() {\n this.gameStarted = false; \n this.winner = 0; \n this.isDraw = true; \n }", "public void turnOn ()\n\t{\n\t\tthis.powerState = true;\n\t}", "public void incrementWin(){wins += 1;}", "public void turn(boolean yours) {\n\t\t_endTurn.setEnabled(yours);\n\t}", "public void setTurning(java.lang.Boolean value);", "public boolean isWin() {\n if (chosen_door.getContains() == Contains.CAR) {\n return true;\n }\n return false;\n }", "public boolean meTurn(){\n return (isWhite && isWhitePlayer) || (!isWhite && !isWhitePlayer);\n }", "void gameWon(Piece piece);", "public void setIsTurn()\n\t{\n\t\tthis.isTurn = true;\n\t}", "public final boolean checkForWin() {\r\n boolean result = false;\r\n String player = \"\";\r\n \r\n for (Rail rail : rails) {\r\n if (rail.isWinner()) {\r\n result = true;\r\n for(Tile tile : rail.getTiles()) {\r\n tile.setBackground(Color.GREEN);\r\n player = tile.getText();\r\n }\r\n if (player.equals(\"X\")) {\r\n winningPlayer = \"X\";\r\n this.xWins++;\r\n } else if (player.equals(\"0\")) {\r\n winningPlayer = \"0\";\r\n this.oWins++;\r\n }\r\n break;\r\n }\r\n }\r\n \r\n return result;\r\n }", "public void win(int wager){\n bankroll += wager;\n }", "public void mine() {\n mined = true;\n }", "public boolean didWin(){\n\t\tswitch(winCondition){\n\t\tcase \"catchEmAll\":\n\t\t\treturn caughtEmAll();\n\t\tdefault:\n\t\t\treturn caughtTwenty();\n\t\t}\n\t}", "public void turnCW() {\n turn(true);\n }", "public void setWinner(String winner) {\n this.winner = winner;\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 }", "public boolean amIWinning(){\n if (playerScore > oppoScore) {\n return true;\n } else {\n return false;\n }\n }", "private void setTurn() {\n if (turn == black) {\n turn = white;\n } else {\n turn = black;\n }\n }", "public void checkIfWinOrDraw() {\r\n\t\tif (theModel.getIsDraw() == true) {\r\n\t\t\tDrawNum++;\r\n\t\t\tactivePlayer = winningPlayer;\r\n\t\t\t// cards go to communalPile\r\n\r\n\t\t} else {\r\n\t\t\ttheModel.winningCard(winningPlayer);\r\n\t\t\ttheModel.transferWinnerCards(winningPlayer);\r\n\t\t}\r\n\r\n\t}", "public void resetWinRecord()\n{\n gamesWon = 0;\n}", "protected void ifWon(){\n canvas.add(titleBorder);\n canvas.add(titleBox);\n Image wonText = new Image(205, 400, \"124-hw4/BreakoutText/wonText.png\");\n canvas.add(wonText);\n }", "public void checkWin() {\n if (rockList.isEmpty() && trackerRockList.isEmpty() && bigRockList.isEmpty() && bossRockList.isEmpty()) {\n if (ship.lives < 5) {\n ship.lives++;\n }\n Level++;\n LevelIntermission = true;\n LevelIntermissionCount = 0;\n }\n }" ]
[ "0.82891035", "0.801888", "0.78327745", "0.7628763", "0.72977954", "0.7260962", "0.72167546", "0.71871406", "0.7179102", "0.7176184", "0.71738774", "0.70762956", "0.7071565", "0.70672464", "0.70617425", "0.70490164", "0.70344603", "0.69090307", "0.68874025", "0.6867833", "0.6856581", "0.68194", "0.6817406", "0.6772634", "0.67284775", "0.6717788", "0.668781", "0.6676353", "0.6674553", "0.6668378", "0.6653899", "0.66423947", "0.6636611", "0.65686935", "0.6560416", "0.65583587", "0.6548054", "0.65454656", "0.65403056", "0.653219", "0.65238565", "0.652338", "0.65228", "0.64980227", "0.64958435", "0.6485963", "0.6478385", "0.6475318", "0.645779", "0.6456726", "0.6441336", "0.64396304", "0.6435635", "0.6426095", "0.64182234", "0.64132595", "0.6411557", "0.64101404", "0.6405372", "0.6401935", "0.63781184", "0.63661927", "0.6366001", "0.6360863", "0.6359509", "0.6352372", "0.635043", "0.63406587", "0.6328464", "0.63110214", "0.63077134", "0.6302192", "0.63009125", "0.6296017", "0.6282267", "0.62745005", "0.6259917", "0.6257862", "0.62444806", "0.6236704", "0.62320244", "0.62235975", "0.62169695", "0.62003654", "0.6194136", "0.61896664", "0.6176889", "0.6176326", "0.61700845", "0.6168809", "0.61635226", "0.61627597", "0.61524785", "0.61466", "0.6135971", "0.6132299", "0.61260694", "0.61244965", "0.6123264", "0.6118548" ]
0.85130614
0
Method loads in a new image from the specified files and creates the hidden image for it.
public void newGame(){ if (won) { idx = 0; won = false; List<String> rows = new ArrayList<String>(); try{ // loads one random image from list Random rand = new Random(); col = 0; int randInt = rand.nextInt(files.size()); File file = new File( Game.class.getResource("/"+files.get(randInt)).getFile() ); BufferedReader br = new BufferedReader(new FileReader(file)); String line; while ((line = br.readLine()) != null) { if (col < line.length()) { col = line.length(); } rows.add(line); } } catch (Exception e){ System.out.println("File load error"); // extremely simple error handling, you can do better if you like. } // this handles creating the orinal array and the hidden array in the correct size String[] rowsASCII = rows.toArray(new String[0]); row = rowsASCII.length; // Generate original array by splitting each row in the original array. original = new char[row][col]; for(int i = 0; i < row; i++) { char[] splitRow = rowsASCII[i].toCharArray(); for (int j = 0; j < splitRow.length; j++) { original[i][j] = splitRow[j]; } } // Generate Hidden array with X's (this is the minimal size for columns) hidden = new char[row][col]; for(int i = 0; i < row; i++){ for(int j = 0; j < col; j++){ hidden[i][j] = 'X'; } } setIdxMax(col * row); } else { } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void importImages() {\n\n\t\t// Create array of the images. Each image pixel map contains\n\t\t// multiple images of the animate at different time steps\n\n\t\t// Eclipse will look for <path/to/project>/bin/<relative path specified>\n\t\tString img_file_base = \"Game_Sprites/\";\n\t\tString ext = \".png\";\n\n\t\t// Load background\n\t\tbackground = createImage(img_file_base + \"Underwater\" + ext);\n\t}", "public void createNewImageFile(){\n fillNewImage();\n\n try {\n ImageIO.write(newImage, imageFileType, new File(k + \"_Colored_\" + fileName.substring(0,fileName.length() - 4) + \".\" + imageFileType));\n } catch (IOException e){\n e.printStackTrace();\n }\n \n }", "private void loadImages(){\n try{\n System.out.println(System.getProperty(\"user.dir\"));\n\n t1img = read(new File(\"resources/tank1.png\"));\n t2img = read(new File(\"resources/tank1.png\"));\n backgroundImg = read(new File(\"resources/background.jpg\"));\n wall1 = read(new File(\"resources/Wall1.gif\"));\n wall2 = read(new File(\"resources/Wall2.gif\"));\n heart = resize(read(new File(\"resources/Hearts/basic/heart.png\")), 35,35);\n heart2 = resize(read( new File(\"resources/Hearts/basic/heart.png\")), 25,25);\n bullet1 = read(new File(\"resources/bullet1.png\"));\n bullet2 = read(new File(\"resources/bullet2.png\"));\n\n }\n catch(IOException e){\n System.out.println(e.getMessage());\n }\n }", "private void loadImages() {\n\t\ttry {\n\t\t\timage = ImageIO.read(Pillar.class.getResource(\"/Items/Pillar.png\"));\n\t\t\tscaledImage = image;\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Failed to read Pillar image file: \" + e.getMessage());\n\t\t}\n\t}", "private void createImageFiles() {\n\t\tswitchIconClosed = Icon.createImageIcon(\"/images/events/switchImageClosed.png\");\n\t\tswitchIconOpen = Icon.createImageIcon(\"/images/events/switchImageOpen.png\");\n\t\tswitchIconEmpty = Icon.createImageIcon(\"/images/events/switchImageEmpty.png\");\n\t\tswitchIconOff = Icon.createImageIcon(\"/images/events/switchImageOff.png\");\n\t\tswitchIconOn = Icon.createImageIcon(\"/images/events/switchImageOn.png\");\n\t\tleverIconClean = Icon.createImageIcon(\"/images/events/leverImageClean.png\");\n\t\tleverIconRusty = Icon.createImageIcon(\"/images/events/leverImageRusty.png\");\n\t\tleverIconOn = Icon.createImageIcon(\"/images/events/leverImageOn.png\");\n\t}", "public void loadImages() {\n\t\tcowLeft1 = new ImageIcon(\"images/animal/cow1left.png\");\n\t\tcowLeft2 = new ImageIcon(\"images/animal/cow2left.png\");\n\t\tcowLeft3 = new ImageIcon(\"images/animal/cow1left.png\");\n\t\tcowRight1 = new ImageIcon(\"images/animal/cow1right.png\");\n\t\tcowRight2 = new ImageIcon(\"images/animal/cow2right.png\");\n\t\tcowRight3 = new ImageIcon(\"images/animal/cow1right.png\");\n\t}", "public void createImage() {\n\t\tBufferedImage crab1ststep = null;\n\t\tBufferedImage crab2ndstep = null;\n\t\tBufferedImage crabhalf = null;\n\t\tBufferedImage crabfull = null;\n\t\tBufferedImage eye6 = null;\n\t\tBufferedImage eye5 = null;\n\t\tBufferedImage eye4 = null;\n\t\tBufferedImage eye3 = null;\n\t\tBufferedImage eye2 = null;\n\t\tBufferedImage eye1 = null;\n\t\tBufferedImage eyeClosed = null;\n\t\ttry {\n\t\t crabImage = ImageIO.read(new File(\"src/images/crab.png\"));\n\t\t crab1ststep = ImageIO.read(new File(\"src/images/crab1ststep.png\"));\n\t\t crab2ndstep = ImageIO.read(new File(\"src/images/crab2ndstep.png\"));\n\t\t crabhalf = ImageIO.read(new File(\"src/images/crabhalf.png\"));\n\t\t crabfull = ImageIO.read(new File(\"src/images/crabfull.png\"));\n\t\t crabWin = ImageIO.read(new File(\"src/images/crabwin.png\"));\n\t\t crabLose = ImageIO.read(new File(\"src/images/crablose.png\"));\n\t\t eye6 = ImageIO.read(new File(\"src/images/crab_eye6.png\"));\n\t\t eye5 = ImageIO.read(new File(\"src/images/crab_eye5.png\"));\n\t\t eye4 = ImageIO.read(new File(\"src/images/crab_eye4.png\"));\n\t\t eye3 = ImageIO.read(new File(\"src/images/crab_eye3.png\"));\n\t\t eye2 = ImageIO.read(new File(\"src/images/crab_eye2.png\"));\n\t\t eye1 = ImageIO.read(new File(\"src/images/crab_eye1.png\"));\n\t\t eyeClosed = ImageIO.read(new File(\"src/images/eyes_closed.png\"));\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"bad\");\n\t\t}\n//\t\tcrabAni.add(crabImage);\n\t\tcrabAni.add(crabImage);\n\t\tcrabAni.add(crabImage);\n\t\tcrabAni.add(crabImage);\n\t\tcrabAni.add(crabImage);\n\t\tcrabAni.add(crabImage);\n//\t\tcrabAni.add(crab1ststep);\n\t\tcrabAni.add(crab1ststep);\n\t\tcrabAni.add(crab1ststep);\n\t\tcrabAni.add(crab1ststep);\n\t\tcrabAni.add(crab1ststep);\n\t\tcrabAni.add(crab1ststep);\n//\t\tcrabAni.add(crabImage);\n\t\tcrabAni.add(crabImage);\n\t\tcrabAni.add(crabImage);\n\t\tcrabAni.add(crabImage);\n\t\tcrabAni.add(crabImage);\n\t\tcrabAni.add(crabImage);\n//\t\tcrabAni.add(crab2ndstep);\n\t\tcrabAni.add(crab2ndstep);\n\t\tcrabAni.add(crab2ndstep);\n\t\tcrabAni.add(crab2ndstep);\n\t\tcrabAni.add(crab2ndstep);\n\t\tcrabAni.add(crab2ndstep);\n\t\tcrabAni.add(crab2ndstep);\n\t\tcrabAni.add(crab2ndstep);\n\t\t\n\t\tcrabAni2.add(crabImage);\n\t\tcrabAni2.add(crabImage);\n\t\tcrabAni2.add(crabImage);\n\t\tcrabAni2.add(crabImage);\n\t\tcrabAni2.add(crabImage);\n\t\tcrabAni2.add(crabImage);\n\t\tcrabAni2.add(crabhalf);\n\t\tcrabAni2.add(crabhalf);\n\t\tcrabAni2.add(crabhalf);\n\t\tcrabAni2.add(crabhalf);\n\t\tcrabAni2.add(crabhalf);\n\t\tcrabAni2.add(crabhalf);\n\t\tcrabAni2.add(crabfull);\n\t\tcrabAni2.add(crabfull);\n\t\tcrabAni2.add(crabfull);\n\t\tcrabAni2.add(crabfull);\n\t\tcrabAni2.add(crabfull);\n\t\tcrabAni2.add(crabfull);\n\t\t\n\t\tblink.add(eye6);\n\t\tblink.add(eye6);\n//\t\tblink.add(eye5);\n//\t\tblink.add(eye5);\n\t\tblink.add(eye4);\n\t\tblink.add(eye4);\n//\t\tblink.add(eye3);\n//\t\tblink.add(eye3);\n\t\tblink.add(eye2);\n\t\tblink.add(eye2);\n//\t\tblink.add(eye1);\n//\t\tblink.add(eye1);\n\t\tblink.add(eyeClosed);\n\t\tblink.add(eyeClosed);\n\t\tblink.add(eyeClosed);\n\t\tblink.add(eyeClosed);\n//\t\tblink.add(eye1);\n//\t\tblink.add(eye1);\n\t\tblink.add(eye2);\n\t\tblink.add(eye2);\n//\t\tblink.add(eye3);\n//\t\tblink.add(eye3);\n\t\tblink.add(eye4);\n\t\tblink.add(eye4);\n//\t\tblink.add(eye5);\n//\t\tblink.add(eye5);\n\t\tblink.add(eye6);\n\t\tblink.add(eye6);\n\t}", "public void createImages(){\r\n\t\ttry {\r\n\t\t\timg_bg = Image.createImage(GAME_BG);\r\n\t\t\timg_backBtn = Image.createImage(BACK_BTN);\r\n\t\t\timg_muteBtn = Image.createImage(MUTE_BTN);\r\n\t\t\timg_resetBtn = Image.createImage(RESET_BTN);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void setImages() {\n\n imgBlock.removeAll();\n imgBlock.revalidate();\n imgBlock.repaint();\n labels = new JLabel[imgs.length];\n for (int i = 0; i < imgs.length; i++) {\n\n labels[i] = new JLabel(new ImageIcon(Toolkit.getDefaultToolkit().createImage(imgs[i].getSource())));\n imgBlock.add(labels[i]);\n\n }\n\n SwingUtilities.updateComponentTreeUI(jf); // refresh\n initialized = true;\n\n }", "void setImageFromFile(File imageFile);", "public void getPictures(){\n\t\t\ttry{\n\t\t\t\timg = ImageIO.read(new File(\"background.jpg\"));\n\t\t\t\ttank = ImageIO.read(new File(\"Tank.png\"));\n\t\t\t\tbackground2 = ImageIO.read(new File(\"background2.png\"));\n\t\t\t\t\n\t\t\t\trtank = ImageIO.read(new File(\"RTank.png\"));\n\t\t\t\tboom = ImageIO.read(new File(\"Boom.png\"));\n\t\t\t\tboom2 = ImageIO.read(new File(\"Boom2.png\"));\n\t\t\t\tinstructions = ImageIO.read(new File(\"Instructions.png\"));\n\t\t\t\tshotman = ImageIO.read(new File(\"ShotMan.png\"));\n\t\t\t\tlshotman = ImageIO.read(newFile(\"LShotMan.png\"));\n\t\t\t\tboomshotman = ImageIO.read(new File(\"AfterShotMan\"));\n\t\t\t\tlboomshotman = ImageIO.read(new File(\"LAfterShotMan\"));\n\t\t\t\t\n\t\t\t}catch(IOException e){\n\t\t\t\tSystem.err.println(\"d\");\n\t\t\t}\n\t\t}", "private void initialBuild() {\n hiddenButton = new JToolButton(\"If you see me, we're screwed\", false);\n\n buttonGroup = new ButtonGroup();\n buttonGroup.add(hiddenButton);\n\n // create the loading image\n FileLoader fileLookup = new FileLoader(1);\n Toolkit tk = getToolkit();\n\n // lookup the folder image so it will be in the cache already\n try {\n Object[] iconURL = fileLookup.getFileURL(FOLDER_IMAGE); \n \n //now process the raw data into a buffer\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n byte[] buf = new byte[1024];\n for (int readNum; (readNum = ((InputStream)iconURL[1]).read(buf)) != -1;) {\n bos.write(buf, 0, readNum); \n }\n byte[] bytes = bos.toByteArray(); \n InputStream in = new ByteArrayInputStream(bytes);\n folderImage = javax.imageio.ImageIO.read(in); \n\n } catch (Exception ioe) {\n ioe.printStackTrace();\n }\n\n\n // lookup the loading image so it will be in the cache\n try {\n \n Object[] iconURL = fileLookup.getFileURL(LOADER_IMAGE);\n loadingImage = new ImageIcon((java.net.URL)iconURL[0]);\n \n } catch (Exception ioe) {\n ioe.printStackTrace();\n }\n \n // lookup the not found image so it will be in the cache\n try {\n Object[] iconURL = fileLookup.getFileURL(NOT_FOUND_IMAGE);\n \n //now process the raw data into a buffer\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n byte[] buf = new byte[1024];\n for (int readNum; (readNum = ((InputStream)iconURL[1]).read(buf)) != -1;) {\n bos.write(buf, 0, readNum); \n }\n byte[] bytes = bos.toByteArray(); \n InputStream in = new ByteArrayInputStream(bytes);\n notFoundImage = javax.imageio.ImageIO.read(in); \n \n } catch (Exception ioe) {\n ioe.printStackTrace();\n }\n\n addToolGroup(rootToolGroup);\n }", "private void createImages(){\n icon=new ImageIcon(PATH_TO_FOLDER+\"guiResourses\\\\icon.jpg\").getImage();\n /*\n Image resizedImage=null;\n try {\n resizedImage =\n ImageIO.read(new File(PATH_TO_FOLDER+\"guiResourses\\\\Gold_Button_009.png\"))\n .getScaledInstance(100, 50, Image.SCALE_DEFAULT);\n } catch (IOException e) {\n e.printStackTrace();\n }\n buttonStart.setIcon(new ImageIcon(resizedImage));\n buttonStart.setRolloverIcon(new ImageIcon(resizedImage1));\n buttonStart.setBorderPainted(false);\n buttonStart.setFocusPainted(false);\n buttonStart.setContentAreaFilled(false);\n */\n Image resizedImageF=null;\n Image resizedImageFP=null;\n Image resizedImageFF=null;\n Image resizedImageT=null;\n Image resizedImageTP=null;\n Image resizedImageTF=null;\n Image resizedImageB=null;\n Image resizedImageBP=null;\n Image resizedImageBF=null;\n Image resizedImageR=null;\n Image resizedImageRP=null;\n Image resizedImageRF=null;\n try {\n resizedImageF =\n ImageIO.read(new File(PATH_TO_FOLDER+\"guiResourses\\\\buttonFlight.jpg\"))\n .getScaledInstance(900,500, Image.SCALE_DEFAULT);\n resizedImageFP =\n ImageIO.read(new File(PATH_TO_FOLDER+\"guiResourses\\\\buttonFlightP.jpg\"))\n .getScaledInstance(900,500, Image.SCALE_DEFAULT);\n resizedImageFF =\n ImageIO.read(new File(PATH_TO_FOLDER+\"guiResourses\\\\buttonFlightF.jpg\"))\n .getScaledInstance(900,500, Image.SCALE_DEFAULT);\n resizedImageT =\n ImageIO.read(new File(PATH_TO_FOLDER+\"guiResourses\\\\buttonTrain.jpg\"))\n .getScaledInstance(900,500, Image.SCALE_DEFAULT);\n /*resizedImageTP =\n ImageIO.read(new File(PATH_TO_FOLDER+\"guiResourses\\\\buttonTrainP.jpg\"))\n .getScaledInstance(900,500, Image.SCALE_DEFAULT);*/\n resizedImageTF =\n ImageIO.read(new File(PATH_TO_FOLDER+\"guiResourses\\\\buttonTrainF.jpg\"))\n .getScaledInstance(900,500, Image.SCALE_DEFAULT);\n resizedImageB =\n ImageIO.read(new File(PATH_TO_FOLDER+\"guiResourses\\\\buttonBus.jpg\"))\n .getScaledInstance(900,500, Image.SCALE_DEFAULT);\n /*resizedImageBP =\n ImageIO.read(new File(PATH_TO_FOLDER+\"guiResourses\\\\buttonBusP.jpg\"))\n .getScaledInstance(900,500, Image.SCALE_DEFAULT);*/\n resizedImageBF =\n ImageIO.read(new File(PATH_TO_FOLDER+\"guiResourses\\\\buttonBusF.jpg\"))\n .getScaledInstance(900,500, Image.SCALE_DEFAULT);\n resizedImageR =\n ImageIO.read(new File(PATH_TO_FOLDER+\"guiResourses\\\\buttonRoom.jpg\"))\n .getScaledInstance(900,500, Image.SCALE_DEFAULT);\n /*resizedImageRP =\n ImageIO.read(new File(PATH_TO_FOLDER+\"guiResourses\\\\buttonRoomP.jpg\"))\n .getScaledInstance(900,500, Image.SCALE_DEFAULT);*/\n resizedImageRF =\n ImageIO.read(new File(PATH_TO_FOLDER+\"guiResourses\\\\buttonRoomF.jpg\"))\n .getScaledInstance(900,500, Image.SCALE_DEFAULT);\n } catch (IOException e) {\n e.printStackTrace();\n }\n flightButton.setFocusPainted(false);\n flightButton.setRolloverEnabled(true);\n flightButton.setRolloverIcon(new ImageIcon(resizedImageFF));\n flightButton.setIcon(new ImageIcon(resizedImageF));\n flightButton.setPressedIcon(new ImageIcon(resizedImageFP));\n\n trainButton.setFocusPainted(false);\n trainButton.setRolloverEnabled(true);\n trainButton.setRolloverIcon(new ImageIcon(resizedImageTF));\n trainButton.setIcon(new ImageIcon(resizedImageT));\n trainButton.setPressedIcon(new ImageIcon(resizedImageTF));\n busButton.setFocusPainted(false);\n busButton.setRolloverEnabled(true);\n busButton.setRolloverIcon(new ImageIcon(resizedImageBF));\n busButton.setIcon(new ImageIcon(resizedImageB));\n busButton.setPressedIcon(new ImageIcon(resizedImageBF));\n roomButton.setFocusPainted(false);\n roomButton.setRolloverEnabled(true);\n roomButton.setRolloverIcon(new ImageIcon(resizedImageRF));\n roomButton.setIcon(new ImageIcon(resizedImageR));\n roomButton.setPressedIcon(new ImageIcon(resizedImageRF));\n }", "private Images() {\n \n imgView = new ImageIcon(this,\"images/View\");\n\n imgUndo = new ImageIcon(this,\"images/Undo\");\n imgRedo = new ImageIcon(this,\"images/Redo\");\n \n imgCut = new ImageIcon(this,\"images/Cut\");\n imgCopy = new ImageIcon(this,\"images/Copy\");\n imgPaste = new ImageIcon(this,\"images/Paste\");\n \n imgAdd = new ImageIcon(this,\"images/Add\");\n \n imgNew = new ImageIcon(this,\"images/New\");\n imgDel = new ImageIcon(this,\"images/Delete\");\n \n imgShare = new ImageIcon(this,\"images/Share\");\n }", "public static void loadImages()\n \t{\n \t\tSystem.out.print(\"Loading images... \");\n \t\t\n \t\tallImages = new TreeMap<ImageEnum, ImageIcon>();\n \t\t\n \t\ttry {\n \t\taddImage(ImageEnum.RAISIN, \"images/parts/raisin.png\");\n \t\taddImage(ImageEnum.NUT, \"images/parts/nut.png\");\n \t\taddImage(ImageEnum.PUFF_CHOCOLATE, \"images/parts/puff_chocolate.png\");\n \t\taddImage(ImageEnum.PUFF_CORN, \"images/parts/puff_corn.png\");\n \t\taddImage(ImageEnum.BANANA, \"images/parts/banana.png\");\n \t\taddImage(ImageEnum.CHEERIO, \"images/parts/cheerio.png\");\n \t\taddImage(ImageEnum.CINNATOAST, \"images/parts/cinnatoast.png\");\n\t\taddImage(ImageEnum.CORNFLAKE, \"images/parts/flake_corn.png\");\n \t\taddImage(ImageEnum.FLAKE_BRAN, \"images/parts/flake_bran.png\");\n \t\taddImage(ImageEnum.GOLDGRAHAM, \"images/parts/goldgraham.png\");\n \t\taddImage(ImageEnum.STRAWBERRY, \"images/parts/strawberry.png\");\n \t\t\n \t\taddImage(ImageEnum.PART_ROBOT_HAND, \"images/robots/part_robot_hand.png\");\n \t\taddImage(ImageEnum.KIT_ROBOT_HAND, \"images/robots/kit_robot_hand.png\");\n \t\taddImage(ImageEnum.ROBOT_ARM_1, \"images/robots/robot_arm_1.png\");\n \t\taddImage(ImageEnum.ROBOT_BASE, \"images/robots/robot_base.png\");\n \t\taddImage(ImageEnum.ROBOT_RAIL, \"images/robots/robot_rail.png\");\n \t\t\n \t\taddImage(ImageEnum.KIT, \"images/kit/empty_kit.png\");\n \t\taddImage(ImageEnum.KIT_TABLE, \"images/kit/kit_table.png\");\n \t\taddImage(ImageEnum.KITPORT, \"images/kit/kitport.png\");\n \t\taddImage(ImageEnum.KITPORT_HOOD_IN, \"images/kit/kitport_hood_in.png\");\n \t\taddImage(ImageEnum.KITPORT_HOOD_OUT, \"images/kit/kitport_hood_out.png\");\n \t\taddImage(ImageEnum.PALLET, \"images/kit/pallet.png\");\n \t\t\n \t\taddImage(ImageEnum.FEEDER, \"images/lane/feeder.png\");\n \t\taddImage(ImageEnum.LANE, \"images/lane/lane.png\");\n \t\taddImage(ImageEnum.NEST, \"images/lane/nest.png\");\n \t\taddImage(ImageEnum.DIVERTER, \"images/lane/diverter.png\");\n \t\taddImage(ImageEnum.DIVERTER_ARM, \"images/lane/diverter_arm.png\");\n \t\taddImage(ImageEnum.PARTS_BOX, \"images/lane/partsbox.png\");\n \t\t\n \t\taddImage(ImageEnum.CAMERA_FLASH, \"images/misc/camera_flash.png\");\n \t\taddImage(ImageEnum.SHADOW1, \"images/misc/shadow1.png\");\n \t\taddImage(ImageEnum.SHADOW2, \"images/misc/shadow2.png\");\n \t\t\n \t\taddImage(ImageEnum.GANTRY_BASE, \"images/gantry/gantry_base.png\");\n \t\taddImage(ImageEnum.GANTRY_CRANE, \"images/gantry/gantry_crane.png\");\n \t\taddImage(ImageEnum.GANTRY_TRUSS_H, \"images/gantry/gantry_truss_h.png\");\n \t\taddImage(ImageEnum.GANTRY_TRUSS_V, \"images/gantry/gantry_truss_v.png\");\n \t\taddImage(ImageEnum.GANTRY_WHEEL, \"images/gantry/gantry_wheel.png\");\n \t\t} catch (Exception e) {\n \t\t\te.printStackTrace();\n \t\t\tSystem.exit(1);\n \t\t}\n \t\tSystem.out.println(\"Done\");\n \t}", "private void setImage() throws FileNotFoundException {\n\t\timage = new Image(new FileInputStream(path));\n\t}", "public void loadImages() {\n\t\tpigsty = new ImageIcon(\"images/property/pigsty.png\");\n\t}", "private void handleImageLoading(File coinImageFile, int buttonPressed)\r\n {\r\n //save folder path to prefrences\r\n if (coinImageFile != null && coinImageFile.exists())\r\n {\r\n BufferedImage bufferedImage = FileHandleClass.getBufferedImageFromFile(coinImageFile);\r\n Image image = SwingFXUtils.toFXImage(bufferedImage, null);\r\n switch (buttonPressed)\r\n {\r\n case 1:\r\n {\r\n coinImageView1.setImage(image);\r\n bufferedImage1 = bufferedImage;\r\n removeCoinImageBtn1.setVisible(true);\r\n break;\r\n }\r\n case 2:\r\n {\r\n coinImageView2.setImage(image);\r\n bufferedImage2 = bufferedImage;\r\n removeCoinImageBtn2.setVisible(true);\r\n break;\r\n }\r\n default:\r\n {\r\n MyLogger.log(Level.SEVERE,LOG_CLASS_NAME+ \" Something went wrong in image loading, requested image was {0}\",buttonPressed);\r\n }\r\n }\r\n } else\r\n {\r\n showErrorMessage(ERROR_IMAGE_CANT_BE_LOADED_TITLE, ERROR_IMAGE_CANT_BE_LOADED_BODY);\r\n }\r\n\r\n }", "private void setImage(){\n if(objects.size() <= 0)\n return;\n\n IImage img = objects.get(0).getImgClass();\n boolean different = false;\n \n //check for different images.\n for(IDataObject object : objects){\n IImage i = object.getImgClass();\n \n if((img == null && i != null) || \n (img != null && i == null)){\n different = true;\n break;\n }else if (img != null && i != null){ \n \n if(!i.getName().equals(img.getName()) ||\n !i.getDir().equals(img.getDir())){\n different = true;\n break;\n }\n } \n }\n \n if(!different){\n image.setText(BUNDLE.getString(\"NoImage\"));\n if(img != null){\n imgName = img.getName();\n imgDir = img.getDir();\n image.setImage(img.getImage());\n }else{\n image.setImage(null);\n }\n }else{\n image.setText(BUNDLE.getString(\"DifferentImages\"));\n }\n \n image.repaint();\n }", "public static void createImages()\n {\n //Do if not done before\n if(!createdImages)\n {\n createdImages = true;\n for(int i=0; i<rightMvt.length; i++)\n {\n rightMvt[i] = new GreenfootImage(\"sniperEnemyRight\"+i+\".png\");\n leftMvt[i] = new GreenfootImage(\"sniperEnemyRight\"+i+\".png\");\n rightMvt[i].scale(rightMvt[i].getWidth()*170/100, rightMvt[i].getHeight()*170/100);\n leftMvt[i].scale(leftMvt[i].getWidth()*170/100, leftMvt[i].getHeight()*170/100);\n }\n for(int i=0; i<leftMvt.length; i++)\n {\n leftMvt[i].mirrorHorizontally();\n }\n for(int i=0; i<upMvt.length; i++)\n {\n upMvt[i] = new GreenfootImage(\"sniperEnemyUp\"+i+\".png\");\n downMvt[i] = new GreenfootImage(\"sniperEnemyDown\"+i+\".png\");\n upMvt[i].scale(upMvt[i].getWidth()*170/100, upMvt[i].getHeight()*170/100);\n downMvt[i].scale(downMvt[i].getWidth()*170/100, downMvt[i].getHeight()*170/100);\n }\n }\n }", "public void loadImage() {\n\t\ttry {\n\t\t\tcurrImage = ImageIO.read(new File(INPUT_DIR,fileNames.get(fileCounter)));\n\t\t\tcurrImageOrigDim = new Dimension(currImage.getWidth(), currImage.getHeight());\n\t\t\tlabel4.setText(\"Processing: \" + fileNames.get(fileCounter));\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t// Resize to Frame\n\t\tdouble imgHt = currImage.getHeight();\n\t\tdouble imgWt = currImage.getWidth();\n\t\tdouble wRatio = FRAME_SIZE/imgWt;\n\t\tdouble hRatio = FRAME_SIZE/imgHt;\n\t\taspectR = Math.min(wRatio,hRatio);\n\t\tcurrImage = getScaledInstance(currImage, (int)(aspectR*imgWt), (int)(aspectR*imgHt));\n\t\tcurrImageBounds = new Rectangle(0, 0, currImage.getWidth(), currImage.getHeight());\n\t\trepaint();\n\t}", "private void loadImages() {\n\t\ttry {\n\t\t\tall_images = new Bitmap[img_files.length];\n\t\t\tfor (int i = 0; i < all_images.length; i++) {\n\t\t\t\tall_images[i] = loadImage(img_files[i] + \".jpg\");\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tToast.makeText(this, \"Unable to load images\", Toast.LENGTH_LONG)\n\t\t\t\t\t.show();\n\t\t\tfinish();\n\t\t}\n\t}", "public void processAddImageOverlay() {\n PropertiesManager props = PropertiesManager.getPropertiesManager();\n\n // AND NOW ASK THE USER FOR THE FILE TO OPEN\n FileChooser fc = new FileChooser();\n fc.setInitialDirectory(new File(PATH_WORK));\n fc.setTitle(props.getProperty(LOAD_WORK_TITLE));\n File imageOverlayFile = fc.showOpenDialog(app.getGUI().getWindow());\n \n // SEND THE IMAGE FILE TO DATA MANAGER\n dataManager.setImageOverlayFile(imageOverlayFile);\n \n // CHANGE THE CURSOR\n Scene scene = app.getGUI().getPrimaryScene();\n scene.setCursor(Cursor.CROSSHAIR);\n \n // CHANGE THE STATE\n dataManager.setState(mmmState.ADD_IMAGE_MODE);\n }", "IMG createIMG();", "private ImageIcon loadImage(String filename) {\r\n\t\tImageIcon MyImage = new ImageIcon (filename);\r\n\t\tImage img = MyImage.getImage();\r\n\r\n\t\tImage newImg = img.getScaledInstance(800,800, Image.SCALE_SMOOTH);\r\n\t\tImageIcon image = new ImageIcon(newImg);\r\n\t\treturn image;\r\n\r\n }", "public void Func_imagefile(){\n\n\t\tswf_env.containImg = true;\n\n\n\t\tthis.value = new SWFValue(\"Func\");\n\n\t\tString path = this.getAtt(\"path\", \".\");\n\t\tString filename = this.getAtt(\"default\");\n\t\tString type = \"auto\";\n\t\tvalue.instanceName = \"img\"+ Integer.toString(swf_env.instanceID);\n\t\tvalue.data = \"\";\n\t\tvalue.imgpath = path + \"/\" + filename;\n\t\tvalue.inter_imgpath = path + \"/\" + filename;\n\t\tvalue.inter_name = \"intimg\" + Integer.toString(swf_env.interactionImgNUM);\n\t\tvalue.tmp = \"tmp\" + Integer.toString(swf_env.interactionImgNUM);\n\t\tvalue.lnum = Integer.toString(swf_env.visibleflag_counter);\n\n\n\t\tif(!path.startsWith(\"/\")) {\n\t\t\tString basedir = GlobalEnv.getBaseDir();\n\t\t\tLog.out(\"basedir= \" +basedir);\n\t\t\tif(basedir != null && basedir != \"\") {\n\t\t\t\tpath = basedir + path;\n\t\t\t}\n\t\t}\n\n\t\tString filepath = path + \"/\" + filename;\n\n\n\t\tsetDecoration1();\n\t\tvalue.margin = margin;\n\n\n\t\tSystem.out.println(\"filepath = \"+filepath);\n\t\tint img = swf_env.open_image_file(type, filepath);\n\t\tvalue.img = img;\n\n\t\tdata_width = swf_env.get_value(\"imagewidth\", img);\n\t\tdata_height = swf_env.get_value(\"imageheight\", img);\n\t\tSystem.out.println(\"imagesize: \"+data_width+\" \"+data_height);\n\t\twidth = data_width + margin * 2;\n\t\theight = data_height + margin * 2;\n\n\n\t\tsetDecoration2();\n\n\t\tif(data_width > width){\n\t\t\tint original_width = data_width;\n\t\t\tdata_width = width - margin * 2;\n\t\t\tint scale = data_width / original_width;\n\t\t\tdata_height = data_height * scale;\n\t\t\theight = data_height + margin * 2;\n\t\t}\n\t\tif(data_height > height){\n\t\t\tint original_height = data_height;\n\t\t\tdata_height = height - margin * 2;\n\t\t\tint scale = data_height / original_height;\n\t\t\tdata_width = data_width * scale;\n\t\t\twidth = data_width + margin * 2;\n\t\t}\n\n\t\tvalue.data_width = data_width;\n\t\tvalue.data_height = data_height;\n\t\tvalue.width = width;\n\t\tvalue.height = height;\n\t\t//morya wrote\n\t\tvalue.int_w = width;\n\t\tvalue.int_h = height;\n\n\n\t\tsetDecoration3();\n\n\t\tswf_env.tmp_width = width;\n\t\tswf_env.tmp_height = height;\n\n\n\t\tswf_env.instanceID++;\n\n\t}", "public void createImageSet() {\n\t\t\n\t\t\n\t\tString image_folder = getLevelImagePatternFolder();\n \n String resource = \"0.png\";\n ImageIcon ii = new ImageIcon(this.getClass().getResource(image_folder + resource));\n images.put(\"navigable\", ii.getImage());\n\n\t}", "protected abstract Image loadImage();", "private void imageInitiation() {\n ImageIcon doggyImage = new ImageIcon(\"./data/dog1.jpg\");\n JLabel dogImage = new JLabel(doggyImage);\n dogImage.setSize(700,500);\n this.add(dogImage);\n }", "@Override\n\tpublic void loadStateImages() {\n\t\tif (imageFilename[0][0] != null)\n\t\t\tthis.addStateImage(imageFilename[0][0], 0, 0);\n\t\tif (imageFilename[0][1] != null)\n\t\t\tthis.addStateImage(imageFilename[0][1], 1, 0);\n\t\tif (imageFilename[1][0] != null)\n\t\t\tthis.addStateImage(imageFilename[1][0], 0, 1);\n\t\tif (imageFilename[1][1] != null)\n\t\t\tthis.addStateImage(imageFilename[1][1], 1, 1);\n\t}", "@Override\n\tpublic void loadImages() {\n\t\tsuper.setImage((new ImageIcon(\"pacpix/QuestionCandy.png\")).getImage());\t\n\t}", "public void loadImage() {\n\t\tif (images.containsKey(name)) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tString fullPath = BASE_PATH + this.sprite_sheet;\n\t\t\tFile imageFile = new File(fullPath);\n\t\t\tImage initialImage = ImageIO.read(imageFile);\n\t\t\tImage scaledImage = initialImage.getScaledInstance(\n\t\t\t\t\tMainPanel.TILE_SIZE, MainPanel.TILE_SIZE, 0);\n\n\t\t\tBufferedImage image = new BufferedImage(scaledImage.getWidth(null),\n\t\t\t\t\tscaledImage.getHeight(null), BufferedImage.TYPE_INT_ARGB);\n\t\t\tGraphics2D imageGraphicsContext = image.createGraphics();\n\t\t\timageGraphicsContext.drawImage(scaledImage, 0, 0, null);\n\t\t\timageGraphicsContext.dispose();\n\t\t\timages.put(name, image);\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"Could not load image for\" + this.name);\n\t\t}\n\t}", "public static void load(){\r\n\t \ttry {\r\n\t \t\t// load and set all sprites\r\n\t\t\t\tsetBlueGarbage(ImageIO.read(classPath.getResourceAsStream(\"/images/blueGarbage.png\")));\r\n\t\t\t\tsetRank(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/rank.png\")));\r\n\t\t\t\tsetRedGarbage(ImageIO.read(classPath.getResourceAsStream(\"/images/redGarbage.png\")));\r\n\t\t\t\tsetYellowGarbage(ImageIO.read(classPath.getResourceAsStream(\"/images/yellowGarbage.png\")));\r\n\t\t\t\tsetGreenGarbage(ImageIO.read(classPath.getResourceAsStream(\"/images/greenGarbage.png\")));\r\n\t\t\t\tsetBlueSnakeBodyPart(ImageIO.read(classPath.getResourceAsStream(\"/images/blueSnakeBodyPart.png\")));\r\n\t\t\t\tsetRedSnakeBodyPart(ImageIO.read(classPath.getResourceAsStream(\"/images/redSnakeBodyPart.png\")));\r\n\t\t\t\tsetYellowSnakeBodyPart(ImageIO.read(classPath.getResourceAsStream(\"/images/yellowSnakeBodyPart.png\")));\r\n\t\t\t\tsetGreenSnakeBodyPart(ImageIO.read(classPath.getResourceAsStream(\"/images/greenSnakeBodyPart.png\")));\r\n\t\t\t\tsetHeart(ImageIO.read(classPath.getResourceAsStream(\"/images/heart.png\")));\r\n\t\t\t\tsetGameScreenBackground(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/gameScreenBackground.png\")));\r\n\t\t\t\tsetGameScreenHeader(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/gameScreenHeader.png\")));\r\n\t\t\t\tsetGameOver(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/gameOver.png\")));\r\n\t\t\t\tsetHitsOwnBody(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/hitsOwnBody.png\")));\r\n\t\t\t\tsetHitsWall(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/hitsWall.png\")));\r\n\t\t\t\tsetWrongColor(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/wrongColor.png\")));\r\n\t\t\t\tsetHelpScreenBackground(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/helpScreenBackground.png\")));\r\n\t\t\t \tsetWarningScreenBackground(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/warningScreenBackground.png\")));\r\n\t\t\t \tsetOkButton(ImageIO.read(classPath.getClass().getResource(\"/images/okButton.png\")));\r\n\t\t\t \tsetMenuScreenBackground(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/menuScreenBackground.png\")));\r\n\t\t\t\tsetStartButton(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/startButton.png\")));\r\n\t\t\t\tsetExitButton(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/exitButton.png\")));\r\n\t\t\t\tsetHelpButton(ImageIO.read(classPath.getClass().getResourceAsStream(\"/images/helpButton.png\")));\r\n\t\t\t\t\r\n\t \t} \r\n\t \tcatch (Exception e) {\r\n\t\t\t\tJOptionPane.showMessageDialog(null, e.getStackTrace(), \"Erro ao carregar imagens\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t\tSystem.exit(0);\r\n\t\t\t\r\n\t\t\t}\t\r\n \t\r\n \t}", "public void findImages() {\n URL imgURL = ImageLoader.class.getResource(\"/BackgroundMenu.jpg\");\n this.backgroundImages.put(MenuP.TITLE, loadImage(imgURL));\n\n imgURL = ImageLoader.class.getResource(\"/backgroundGame.png\");\n this.backgroundImages.put(ArenaView.TITLE, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/gameOver.jpg\");\n this.backgroundImages.put(GameOverView.TITLE, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/Player.png\");\n this.entityImages.put(ID.PLAYER, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/Enemy1.png\");\n this.entityImages.put(ID.BASIC_ENEMY, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/boss.png\");\n this.entityImages.put(ID.BOSS_ENEMY, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/meteorBrown_big1.png\");\n this.entityImages.put(ID.METEOR, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/BlueBullet.png\");\n this.bulletImages.put(new Pair<>(ID.PLAYER_BULLET, ID.PLAYER), loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/redBullet.png\");\n this.entityImages.put(ID.ENEMY_BULLET, loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/powerup_FireBoost.png\");\n this.powerUpImages.put(new Pair<>(ID.POWER_UP, PowerUpT.FIRE_BOOST), loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/powerup_Freeze.png\");\n this.powerUpImages.put(new Pair<>(ID.POWER_UP, PowerUpT.FREEZE), loadImage(imgURL)); \n \n imgURL = ImageLoader.class.getResource(\"/powerup_Health.png\");\n this.powerUpImages.put(new Pair<>(ID.POWER_UP, PowerUpT.HEALTH), loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/powerup_Shield.png\");\n this.powerUpImages.put(new Pair<>(ID.POWER_UP, PowerUpT.SHIELD), loadImage(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/bulletSpeedUp.png\");\n this.AnimationsPowerUp.put(new Pair<>(ID.POWER_UP, PowerUpT.FIRE_BOOST), loadEffect(imgURL));\n \n imgURL = ImageLoader.class.getResource(\"/Explosion.png\");\n this.AnimationsEffect.put(new Pair<>(ID.EFFECT, SpecialEffectT.EXPLOSION), loadEffect(imgURL));\n\n imgURL = ImageLoader.class.getResource(\"/freeze.png\");\n this.AnimationsPowerUp.put(new Pair<>(ID.POWER_UP, PowerUpT.FREEZE), loadImage(imgURL));\n }", "public void crearImagenes() {\n try {\n fondoJuego1 = new Imagenes(\"/fondoJuego1.png\",39,-150,-151);\n fondoJuego2 = new Imagenes(\"/fondoJuego2.png\",40,150,149);\n regresar = new Imagenes(\"/regresar.png\",43,90,80);\n highLight = new Imagenes(\"/cursorSubmenus.png\",43,90,80);\n juegoNuevo = new Imagenes(\"/juegoNuevo.png\",44,90,80);\n continuar = new Imagenes(\"/continuar.png\",45,90,80);\n tituloJuegoNuevo = new Imagenes(\"/tituloJuegoNuevo.png\",200,100,165);\n tituloContinuar = new Imagenes(\"/tituloContinuar.png\",201,100,40);\n tituloRegresar = new Imagenes(\"/tituloRegresar.png\",202,20,100);\n\t} catch(IOException e){\n e.printStackTrace();\n }\n }", "public ModelImage readImage(boolean one) throws IOException {\r\n // The data types are Sun, hence the byte order is big-endian.\r\n int i;\r\n int num; //image number within file\r\n\r\n boolean endianess = LITTLE_ENDIAN;\r\n\r\n try {\r\n file = new File(fileDir + fileName);\r\n raFile = new RandomAccessFile(file, \"r\");\r\n progressBar = new ViewJProgressBar(ViewUserInterface.getReference().getProgressBarPrefix() + fileName,\r\n ViewUserInterface.getReference().getProgressBarPrefix() + \"BioRad image(s) ...\", 0, 100,\r\n false, null, null);\r\n xDim = getSignedShort(endianess); // 0\r\n yDim = getSignedShort(endianess); // 2\r\n zDim = getSignedShort(endianess); // 4\r\n ramp1Min = (short)getSignedShort(endianess); // 6\r\n ramp1Max = (short)getSignedShort(endianess); // 8\r\n notes = getInt(endianess); // 10\r\n byteFormat = (short)getSignedShort(endianess); // 14\r\n num = (short)getSignedShort(endianess); // 16\r\n\r\n setProgressBarVisible(!one);\r\n\r\n for (i = 0; i < 32; i++) {\r\n name[i] = 0;\r\n }\r\n readAgain = true;\r\n i = 0;\r\n while(readAgain) {\r\n name[i++] = raFile.readByte(); // 18\r\n if (name[i-1] == 0) {\r\n readAgain = false;\r\n }\r\n }\r\n fName = new String(name,0,i-1);\r\n raFile.seek(50);\r\n merged = (short)getSignedShort(endianess); // 50\r\n color1 = getUnsignedShort(endianess); // 52\r\n fileID = getUnsignedShort(endianess); // 54\r\n if (fileID != 12345) {\r\n throw new IOException(\"fileID is an illegal \" + fileID);\r\n }\r\n ramp2Min = (short)getSignedShort(endianess); // 56\r\n ramp2Max = (short)getSignedShort(endianess); // 58\r\n color2 = getUnsignedShort(endianess); // 60\r\n edited = (short)getSignedShort(endianess); // 62\r\n lens = (short)getSignedShort(endianess); // 64\r\n magFactor = getFloat(endianess); // 66\r\n // Position to the start of the image data\r\n raFile.seek(76);\r\n\r\n fileInfo = new FileInfoBioRad(fileName, fileDir, FileBase.BIORAD); // dummy fileInfo\r\n fileInfo.setEndianess(endianess);\r\n if (zDim > 1) {\r\n imgExtents = new int [3];\r\n imgExtents[0] = xDim;\r\n imgExtents[1] = yDim;\r\n imgExtents[2] = zDim;\r\n }\r\n else {\r\n imgExtents = new int [2];\r\n imgExtents[0] = xDim;\r\n imgExtents[1] = yDim;\r\n }\r\n\r\n fileInfo.setExtents(imgExtents);\r\n if (byteFormat == 1) {\r\n dataType = ModelStorageBase.UBYTE;\r\n bufferSize = xDim*yDim;\r\n }\r\n else { // byteFormat == 0\r\n dataType = ModelStorageBase.SHORT;\r\n bufferSize = xDim*yDim;\r\n }\r\n /*else { // merged pseudocolor\r\n dataType = ModelStorageBase.ARGB;\r\n bufferSize = 4*xDim*yDim;\r\n }*/\r\n fileInfo.setDataType(dataType);\r\n\r\n if (one) {\r\n image = new ModelImage(dataType, new int[] {imgExtents[0], imgExtents[1]}, fileInfo.getFileName(), UI);\r\n zDim = 1;\r\n }\r\n else {\r\n image = new ModelImage(dataType, imgExtents, fileInfo.getFileName(), UI);\r\n }\r\n\r\n imgBuffer = new float[bufferSize];\r\n for (i = 0; i < zDim; i++){\r\n try {\r\n if (one && imgExtents.length > 2) {\r\n if (dataType == ModelStorageBase.UBYTE) {\r\n raFile.seek(imgExtents[2]/2*xDim*yDim);\r\n }\r\n else {\r\n raFile.seek(imgExtents[2]*xDim*yDim);\r\n }\r\n readBuffer(imgExtents[2]/2, imgBuffer);\r\n }\r\n else {\r\n readBuffer(i, imgBuffer); // Slice a time;\r\n }\r\n image.setFileInfo(fileInfo, i);\r\n }\r\n catch (IOException error){\r\n throw new IOException(\"FileTiff: read: \" + error);\r\n }\r\n image.importData(i*bufferSize, imgBuffer, false);\r\n } // for (i = 0; i < imageSlice; i++)\r\n\r\n raFile.close();\r\n progressBar.dispose();\r\n }\r\n catch (OutOfMemoryError error) {\r\n if (image != null) {\r\n image.disposeLocal();\r\n image = null;\r\n }\r\n byteBuffer = null;\r\n System.gc();\r\n throw error;\r\n }\r\n\r\n return image;\r\n }", "public static void load(){\n\t\trobot=new BufferedImage[5];\n\t\ttry {\n\t\t\tfor(int i=0;i<5;i++)\n\t\t\t\trobot[i]=ImageIO.read(new File(\"robot\" + i +\".png\"));\n\t\t\t\n\t\t\tminiRobot=ImageIO.read(new File(\"miniRobot.png\"));\n\t\t\toil=ImageIO.read(new File(\"oil.png\"));\n\t\t\tslime=ImageIO.read(new File(\"slime.png\"));\n\t\t\tmap=ImageIO.read(new File(\"map.png\"));\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(e + \"Failed to load images\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t}", "private void loadImages(BufferedImage[] images, String direction) {\n for (int i = 0; i < images.length; i++) {\n String fileName = direction + (i + 1);\n images[i] = GameManager.getResources().getMonsterImages().get(\n fileName);\n }\n\n }", "private void setImage() {\r\n\t\ttry{\r\n\r\n\t\t\twinMessage = ImageIO.read(new File(\"obstacles/win.gif\"));\r\n\t\t\tcoin = ImageIO.read(new File(\"obstacles/Coin.gif\"));\r\n\t\t\toverMessage = ImageIO.read(new File(\"obstacles/over.gif\"));\r\n\r\n\t\t} catch (IOException ioe) {\r\n\t\t\tSystem.err.println(\"Image file not found\");\r\n\t\t}\r\n\r\n\t}", "public void readImage(File f) {\r\n try {\r\n //JFrame f2 = new JFrame();\r\n images.add(ImageIO.read(f));\r\n //JLabel lb = new JLabel(new ImageIcon(images.get(0)));\r\n //f2.add(lb);\r\n //f2.setVisible(true);\r\n } catch(Exception e) {\r\n JOptionPane.showMessageDialog(null, \"read image failed.\", \"System Message\", JOptionPane.ERROR_MESSAGE);\r\n e.printStackTrace();\r\n }\r\n }", "private void showView() {\n\t\tfinal ImageView image = (ImageView) findViewById(R.id.image); \n\t\t//screen.addView(image);\n\t\t//image.setImageResource(images[0]);\n\n\t\tString fileName = getFilesDir().getPath() + \"/\" + FILE_NAME;\n\t\t//System.out.println(fileName);\n\t\tBitmap bm = BitmapFactory.decodeFile(fileName); \n\t\t\n\t\timage.setImageBitmap(bm); \n\t\t\n\t\t//System.out.println(\"show done!\\n\");\t\t\n\t\t\n\t}", "public void createImages(){\n for(String s : allPlayerMoves){\n String a = \"Left\";\n for(int i = 0; i < 2; i++) {\n ArrayList<Image> tempImg = new ArrayList();\n boolean done = false;\n int j = 1;\n while(!done){\n try{\n tempImg.add(ImageIO.read(new File(pathToImageFolder+s+a+j+\".png\")));\n j++;\n } catch (IOException ex) {\n done = true;\n }\n }\n String temp = s.replace(\"/\",\"\") + a;\n playerImages.put(temp, tempImg);\n a = \"Right\";\n }\n }\n imagesCreated = true;\n }", "private Images() {}", "private Image loadImage (String path) {\n\t\tImageIcon imageicon = new ImageIcon (path);\r\n\t\tImage newImage = imageicon.getImage();\r\n\t\treturn newImage;\r\n\t}", "private Image createImage(String image_file) {\n\t\tImage img = new Image(image_file);\n\t\treturn img;\n\t}", "public static void loadImages() {\n PonySprite.loadImages(imgKey, \"graphics/ponies/GrannySmith.png\");\n }", "private void drawImages() {\n\t\t\r\n\t}", "public Label getPic(){\n //try {//getPic is only called if isPic is true, so side1 would contain picture path\n /*BufferedImage unsized = ImageIO.read(new File(side1));\n BufferedImage resized = resizeImage(unsized,275,250, unsized.getType());\n frontPic.setIcon(new ImageIcon(resized));*/\n\n\t\t\tImage image = new Image(new File(side1).toURI().toString());\n\t\t\tImageView iv = new ImageView(image);\n\t\t\tLabel imageLabel = new Label(\"Image\");\n\t\t\timageLabel.setGraphic(iv);\n\t\t\treturn imageLabel;\n /*} catch (IOException ex) {\n System.out.println(\"Trouble reading from the file: \" + ex.getMessage());\n }\n return frontPic;*/\n }", "public void populateImages() {\n\t\t// Check if the recipe has any images saved on the sd card and get\n\t\t// the bitmap for the imagebutton\n\n\t\tArrayList<Image> images = ImageController.getAllRecipeImages(\n\t\t\t\tcurrentRecipe.getRecipeId(), currentRecipe.location);\n\n\t\tLog.w(\"*****\", \"outside\");\n\t\tLog.w(\"*****\", String.valueOf(currentRecipe.getRecipeId()));\n\t\tLog.w(\"*****\", String.valueOf(currentRecipe.location));\n\t\tImageButton pictureButton = (ImageButton) findViewById(R.id.ibRecipe);\n\n\t\t// Set the image of the imagebutton to the first image in the folder\n\t\tif (images.size() > 0) {\n\t\t\tpictureButton.setImageBitmap(images.get(0).getBitmap());\n\t\t}\n\n\t}", "private void addImgList() {\n\t\tdogImg.add(\"./data/img/labrador.jpg\");\t\t\t\t\n\t\tdogImg.add(\"./data/img/germanshepherd.jpg\");\t\n\t\tdogImg.add(\"./data/img/bulldog.jpg\");\t\t\t\t\t\t\t\t\n\t\tdogImg.add(\"./data/img/rottweiler.jpg\");\n\t\tdogImg.add(\"./data/img/husky.jpg\");\n\n\t}", "public static void loadFruitPic() {\n //images are from the public domain website: https://www.clipartmax.com/\n Toolkit toolkit = Toolkit.getDefaultToolkit();\n Banana.fruitPic = toolkit.getImage(\"Images/banana.png\");\n Banana.fruitSlice = toolkit.getImage(\"Images/bananaSlice.png\");\n }", "@Override\n\tpublic void readImages() {\n\t\t\n\t}", "public void changeImage(String fileName) {\n\n\t\timageList.add(image);\n\n\t\ttry {\n\t\t\timage = new Image(new FileInputStream(fileName), 0, 50, true, false);\n\t\t\tscreen.updateBox();\n\t\t} catch (FileNotFoundException e) {\n\t\t\tnew ErrorBox(\"Invalid Image\", \"Please Choose a Valid Image\");\n\t\t}\n\n\t}", "public void initializeImages() {\n\n File dir = new File(\"Images\");\n if (!dir.exists()) {\n boolean success = dir.mkdir();\n System.out.println(\"Images directory created!\");\n }\n }", "private void createImage (String image_name, int filename){\n\n\t\tString image_folder = getLevelImagePatternFolder();\n\t\t\n\t\tString resource = filename+\".png\";\n\t\tImageIcon ii = new ImageIcon(this.getClass().getResource(image_folder + resource));\n images.put(image_name, ii.getImage());\n\t}", "public void openImage() {\n InputStream f = Controller.class.getResourceAsStream(\"route.png\");\n img = new Image(f, mapImage.getFitWidth(), mapImage.getFitHeight(), false, true);\n h = (int) img.getHeight();\n w = (int) img.getWidth();\n pathNodes = new GraphNodeAL[h * w];\n mapImage.setImage(img);\n //makeGrayscale();\n }", "private ImageView createImageView(final File imageFile) {\n\n ImageView imageView = null;\n try {\n final Image image = new Image(new FileInputStream(imageFile), 150, 0, true,\n true);\n imageView = new ImageView(image);\n imageView.setFitWidth(150);\n imageView.setOnMouseClicked(new EventHandler<MouseEvent>() {\n\n @Override\n public void handle(MouseEvent mouseEvent) {\n\n if(mouseEvent.getButton().equals(MouseButton.PRIMARY)){\n\n if(mouseEvent.getClickCount() == 2){\n try {\n BorderPane borderPane = new BorderPane();\n ImageView imageView = new ImageView();\n Image image = new Image(new FileInputStream(imageFile));\n imageView.setImage(image);\n imageView.setStyle(\"-fx-background-color: BLACK\");\n imageView.setFitHeight(window1Stage.getHeight() - 10);\n imageView.setPreserveRatio(true);\n imageView.setSmooth(true);\n imageView.setCache(true);\n borderPane.setCenter(imageView);\n borderPane.setStyle(\"-fx-background-color: BLACK\");\n Stage newStage = new Stage();\n newStage.setWidth(window1Stage.getWidth());\n newStage.setHeight(window1Stage.getHeight());\n newStage.setTitle(imageFile.getName());\n Scene scene = new Scene(borderPane, Color.BLACK);\n newStage.setScene(scene);\n newStage.show();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n\n }\n }\n }\n });\n } catch (FileNotFoundException ex) {\n ex.printStackTrace();\n }\n return imageView;\n }", "private void load_figure()\n {\n imageHumanPlayer.getChildren().clear();\n imageComputerPlayer_1.getChildren().clear();\n imageComputerPlayer_2.getChildren().clear();\n int capacity = humanPlayer.getHospitalScale();\n int capacity2 = computerPlayer_1.getHospitalScale();\n int capacity3 = computerPlayer_2.getHospitalScale();\n Image image_1 = new Image(\"file:hospital_\" + capacity + \".png\");\n Image image_2 = new Image(\"file:hospital_\" + capacity2 + \".png\");\n Image image_3 = new Image(\"file:hospital_\" + capacity3 + \".png\");\n ImageView imageView_1 = new ImageView(image_1);\n ImageView imageView_2 = new ImageView(image_2);\n ImageView imageView_3 = new ImageView(image_3);\n imageHumanPlayer.getChildren().add(imageView_1);\n imageComputerPlayer_1.getChildren().add(imageView_2);\n imageComputerPlayer_2.getChildren().add(imageView_3);\n\n }", "private void processImageThenLoadIt(File sourceImageFile) {\n\n if (sourceImageFile == null || ! sourceImageFile.isFile() )\n return;\n\n final int index = getFirstNullImageIndex();\n if (index >= MAX_IMAGES)\n return;\n\n // The resulting temp image will have a unique filename\n // (this allows to process several images in a row, and keep them all for later use)\n String randomFileName = UUID.randomUUID().toString();\n\n im.processImage(sourceImageFile, randomFileName, new ImageProcessingListener() {\n @Override\n public void onProcessError(Exception error) {\n Utils.simpleDialog(NewPubActivity.this, getString(R.string.unable_process_image), error.toString());\n\n imageFilesToUpload[index] = null;\n imageButtons[index].setVisibility(INVISIBLE);\n im.loadImage(R.drawable.add_image_placeholder, imageHolders[index]);\n }\n\n @Override\n public void onProcessSuccess(File resizedFile) {\n\n imageFilesToUpload[index] = resizedFile;\n imageButtons[index].setVisibility(VISIBLE);\n im.loadImage(imageFilesToUpload[index], imageHolders[index], R.drawable.error_placeholder);\n\n // If it is still possible to add more images, show the next image picker row\n if (index+1 < MAX_IMAGES)\n imageTableRows[index+1].setVisibility(VISIBLE);\n }\n });\n }", "public abstract void createSprites() throws FileNotFoundException;", "public void setStartingImages() {\n\t\t\n\t}", "public static void loadImages(){\n\t\tsetPath(main.getShop().inventory.getEquipID());\n\t\ttry {\n\t\t\tbackground = ImageIO.read(new File(\"res/world/bg.png\"));\n\t\t\tterrain = ImageIO.read(new File(\"res/world/solids.png\"));\n\t\t\t// Character and Armour\n\t\t\tcharacters = ImageIO.read(new File(\"res/world/char3.png\"));\n\t\t\tcharactersHead =ImageIO.read(new File(\"res/world/charhead\"+path[0]+\".png\"));\n\t\t\tcharactersTop = ImageIO.read(new File(\"res/world/chartop\"+path[2]+\".png\"));\n\t\t\tcharactersShoulder = ImageIO.read(new File(\"res/world/charshoulders\"+path[3]+\".png\"));\n\t\t\tcharactersHand = ImageIO.read(new File(\"res/world/charhands\"+path[5]+\".png\"));\n\t\t\tcharactersBottom = ImageIO.read(new File(\"res/world/charbottom\"+path[8]+\".png\"));\n\t\t\tcharactersShoes = ImageIO.read(new File(\"res/world/charshoes\"+path[9]+\".png\"));\n\t\t\tcharactersBelt = ImageIO.read(new File(\"res/world/charBelt\"+path[4]+\".png\"));\n\n\t\t\tweaponBow = ImageIO.read(new File(\"res/world/bow.png\"));\n\t\t\tweaponArrow = ImageIO.read(new File(\"res/world/arrow.png\"));\n\t\t\tweaponSword = ImageIO.read(new File(\"res/world/sword.png\"));\n\t\t\titems = ImageIO.read(new File(\"res/world/items.png\"));\n\t\t\tnpc = ImageIO.read(new File(\"res/world/npc.png\"));\n\t\t\thealth = ImageIO.read(new File(\"res/world/health.png\"));\n\t\t\tenemies = ImageIO.read(new File(\"res/world/enemies.png\"));\n\t\t\tcoin = ImageIO.read(new File(\"res/world/coin.png\"));\n\t\t\tmana = ImageIO.read(new File(\"res/world/mana.gif\"));\n\t\t\tarrowP = ImageIO.read(new File(\"res/world/arrowP.png\"));\n\t\t\tbutton = ImageIO.read(new File(\"res/world/button.png\"));\n\t\t\tblood = ImageIO.read(new File(\"res/world/blood.png\"));\n\t\t\tarrowDisp = ImageIO.read(new File(\"res/world/arrowDisp.png\"));\n\t\t\tboss1 = ImageIO.read(new File(\"res/world/boss1.png\"));\n\t\t\tmagic = ImageIO.read(new File(\"res/world/magic.png\"));\n\t\t\tmainMenu = ImageIO.read(new File(\"res/world/MainMenu.png\"));\n\t\t\tinstructions = ImageIO.read(new File(\"res/world/instructions.png\"));\n\t\t\trespawn = ImageIO.read(new File(\"res/world/respawn.png\"));\n\t\t\tinventory = ImageIO.read(new File(\"res/world/inventory.png\"));\n shop = ImageIO.read(new File(\"res/world/shop.png\"));\n dizzy = ImageIO.read(new File(\"res/world/dizzy.png\"));\n pet = ImageIO.read(new File(\"res/world/pet.png\"));\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Error Loading Images\");\n\t\t}\n\t}", "public GUIPROJECT3(){\n setLayout(new FlowLayout());\n image1=new ImageIcon(getClass().getResource(\"uche pics 009.JPG\"));\n \n Label1= new JLabel(image1);\n add(Label1);\n \n image2= new ImageIcon(getClass().getResource(\"uche pics 315.JPG\"));\n \n Label2= new JLabel(image2);\n add(Label2);\n}", "public void cargarImagenes() {\n try {\n\n variedad = sp.getString(\"variedad\", \"\");\n gDia = sp.getFloat(\"gDia\", 0);\n dia = sp.getInt(\"dia\", 0);\n idVariedad = sp.getLong(\"IdVariedad\", 0);\n idFinca = sp.getLong(\"IdFinca\",0);\n\n\n\n imageAdmin iA = new imageAdmin();\n List<fenologiaTab> fi = forGradoloc(dia, gDia, idVariedad);\n\n path = getExternalFilesDir(null) + File.separator;\n String path2 = \"/storage/emulated/0/Pictures/fenologias/\"+idFinca+\"/\";\n\n iA.getImage(path2,jpgView1, idVariedad, fi.get(0).getImagen());\n datos(txt1, fi.get(0).getDiametro_boton(), fi.get(0).getLargo_boton(), fi.get(0).getGrados_dia(), fi.get(0).getImagen());\n\n iA.getImage(path2,jpgView2, idVariedad, fi.get(1).getImagen());\n datos(txt2, fi.get(1).getDiametro_boton(), fi.get(1).getLargo_boton(), fi.get(1).getGrados_dia(), fi.get(1).getImagen());\n\n iA.getImage(path2,jpgView3, idVariedad, fi.get(2).getImagen());\n datos(txt3, fi.get(2).getDiametro_boton(), fi.get(2).getLargo_boton(), fi.get(2).getGrados_dia(), fi.get(2).getImagen());\n\n iA.getImage(path2,jpgView4, idVariedad, fi.get(3).getImagen());\n datos(txt4, fi.get(3).getDiametro_boton(), fi.get(3).getLargo_boton(), fi.get(3).getGrados_dia(), fi.get(3).getImagen());\n } catch (Exception e) {\n Toast.makeText(getApplicationContext(), \"Error \\n\" + e, Toast.LENGTH_LONG).show();\n }\n }", "public void openCustomPictureCreator() {\n\n\t\tFXMLLoader fxmlL = new FXMLLoader(getClass().getResource(\"AvatarDrawingTool.fxml\"));\n\t\ttry {\n\t\t\tBorderPane login = (BorderPane) fxmlL.load();\n\n\t\t\tScene scene = new Scene(login, 600, 400);\n\n\t\t\tStage stage = new Stage();\n\t\t\tstage.setScene(scene);\n\t\t\tstage.initModality(Modality.APPLICATION_MODAL);\n\n\t\t\tstage.showAndWait();\n\t\t\t\n\t\t\tif(custom) {\n\t\t\t\tsetImg();\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\t\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "void loadPhoto(String filename) throws IOException;", "public static void clickrun2() {\n JFileChooser file = new JFileChooser();\n file.setCurrentDirectory(new File(System.getProperty(\"user.home\")));\n FileNameExtensionFilter filter = new FileNameExtensionFilter(\"*.images\", \"jpg\", \"png\");\n file.addChoosableFileFilter(filter);\n int result = file.showSaveDialog(null);\n if (result == JFileChooser.APPROVE_OPTION) {\n File selectedFile = file.getSelectedFile();\n String path = selectedFile.getAbsolutePath();\n lblAnhsanphamsua.setIcon(ResizeImage2(path, null));\n ImagePast2 = path;\n System.out.println(ImagePast2);\n } else {\n\n }\n }", "@Override\n public void updateImages()\n {\n image = ThemeManager.getInstance().getObstacleImage();\n blackedOutImage = ThemeManager.getInstance().getDisabledImage(\"obstacle\");\n }", "public void setImage2(String file){ \n try {\n player = ImageIO.read(new File(file));\n } catch (IOException ex) {\n Logger.getLogger(GridSquarePanel.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "private void change_im_tool4(int boo){\r\n if(boo == 0){ //IMAGEN SI EL USUARIO ESTA INHABILITADO\r\n im_tool4.setImage(new Image(getClass().getResourceAsStream(\"/Images/img07.png\")));\r\n }else{ //IMAGEN PARA HABILITAR AL USUARIO\r\n im_tool4.setImage(new Image(getClass().getResourceAsStream(\"/Images/img06.png\")));\r\n }\r\n }", "public ImageFiles() {\n\t\tthis.listOne = new ArrayList<String>();\n\t\tthis.listTwo = new ArrayList<String>();\n\t\tthis.listThree = new ArrayList<String>();\n\t\tthis.seenImages = new ArrayList<String>();\n\t\tthis.unseenImages = new ArrayList<String>();\n\t}", "private void change_im_check(boolean boo){\r\n if(boo){ //IMAGEN SI EL MEASURE ES CORRECTO\r\n im_check.setImage(new Image(getClass().getResourceAsStream(\"/Images/img06.png\")));\r\n }else{ //IMAGEN PARA LA BUSQUEDA DE UN MEASURE\r\n im_check.setImage(new Image(getClass().getResourceAsStream(\"/Images/img34.png\")));\r\n }\r\n }", "private ImageSet createImages(String kind) {\n \t\tImageSet images = new ImageSet();\n \t\tImageDescriptor desc;\n \t\tdesc = getPredefinedImageDescriptor(kind);\n if (desc == null) {\n \t\t desc = TaskEditorManager.getInstance().getImageDescriptor(kind);\n }\n \t\tif (desc != null) {\t\t\n \t\t\timages.put(ICompositeCheatSheetTask.NOT_STARTED, desc.createImage());\n \t\t\t\n \t\t\tcreateImageWithOverlay(ICompositeCheatSheetTask.IN_PROGRESS, \n\t\t \"$nl$/icons/ovr16/task_in_progress.gif\", //$NON-NLS-1$\n \t\t images, \n \t\t desc);\n \t\t\tcreateImageWithOverlay(ICompositeCheatSheetTask.SKIPPED, \n\t\t \"$nl$/icons/ovr16/task_skipped.gif\", //$NON-NLS-1$\n \t\t images, \n \t\t desc);\n \t\t\tcreateImageWithOverlay(BLOCKED, \n\t\t \"$nl$/icons/ovr16/task_blocked.gif\", //$NON-NLS-1$\n \t\t images, \n \t\t desc);\n \t\t\tcreateImageWithOverlay(ICompositeCheatSheetTask.COMPLETED, \n\t\t \"$nl$/icons/ovr16/task_complete.gif\", //$NON-NLS-1$\n \t\t images, \n \t\t desc);\n \t\t\t\n \t\t}\n \t\treturn images;\n \t}", "public void cambiarEstadoImagen(){\n ImageIcon respuesta=new ImageIcon();\n if(oportunidades==0){\n respuesta=new ImageIcon(getClass().getResource(\"Ahorcado7.jpg\"));\n }\n if(oportunidades==1){\n respuesta=new ImageIcon(getClass().getResource(\"Ahorcado6.jpg\"));\n }\n if(oportunidades==2){\n respuesta=new ImageIcon(getClass().getResource(\"Ahorcado5.jpg\"));\n }\n if(oportunidades==3){\n respuesta=new ImageIcon(getClass().getResource(\"Ahorcado4.jpg\"));\n }\n if(oportunidades==4){\n respuesta=new ImageIcon(getClass().getResource(\"Ahorcado3.jpg\"));\n }\n if(oportunidades==5){\n respuesta=new ImageIcon(getClass().getResource(\"Ahorcado2.jpg\"));\n }\n if(oportunidades==6){\n respuesta=new ImageIcon(getClass().getResource(\"Ahorcado1.jpg\"));\n }\n if(oportunidades==7){\n respuesta=new ImageIcon(getClass().getResource(\"Ahorcado0.jpg\"));\n }\n this.imgAhorcado=respuesta; \n }", "protected void initFile(String id) throws FormatException, IOException {\n super.initFile(id);\n in = new RandomAccessFile(id, \"r\");\n \n // initialize an array containing tag offsets, so we can\n // use an O(1) search instead of O(n) later.\n // Also determine whether we will be reading color or grayscale\n // images\n \n //in.seek(0);\n byte[] toRead = new byte[4];\n in.read(toRead);\n long order = batoi(toRead); // byte ordering\n little = toRead[2] != 0xff || toRead[3] != 0xff;\n \n toRead = new byte[4];\n Vector v = new Vector(); // a temp vector containing offsets.\n \n // Get first offset.\n in.seek(16);\n in.read(toRead);\n int nextOffset = batoi(toRead);\n int nextOffsetTemp;\n \n boolean first = true;\n while(nextOffset != 0) {\n in.seek(nextOffset + 4);\n in.read(toRead);\n // get next tag, but still need this one\n nextOffsetTemp = batoi(toRead);\n in.read(toRead);\n if ((new String(toRead)).equals(\"PICT\")) {\n boolean ok = true;\n if (first) {\n // ignore first image if it is called \"Original Image\" (pure white)\n first = false;\n in.skipBytes(47);\n byte[] layerNameBytes = new byte[127];\n in.read(layerNameBytes);\n String layerName = new String(layerNameBytes);\n if (layerName.startsWith(\"Original Image\")) ok = false;\n }\n if (ok) v.add(new Integer(nextOffset)); // add THIS tag offset\n }\n if (nextOffset == nextOffsetTemp) break;\n nextOffset = nextOffsetTemp;\n }\n \n in.seek(((Integer) v.firstElement()).intValue());\n \n // create and populate the array of offsets from the vector\n numBlocks = v.size();\n offsets = new int[numBlocks];\n for (int i = 0; i < numBlocks; i++) {\n offsets[i] = ((Integer) v.get(i)).intValue();\n }\n \n // populate the imageTypes that the file uses\n toRead = new byte[2];\n imageType = new int[numBlocks];\n for (int i = 0; i < numBlocks; i++) {\n in.seek(offsets[i]);\n in.skipBytes(40);\n in.read(toRead);\n imageType[i] = batoi(toRead);\n }\n \n initMetadata();\n }", "private void fillImagesInDirectory() throws IOException {\n // get the list of all files (including directories) in the directory of interest\n File[] fileArray = directory.listFiles();\n assert fileArray != null;\n for (File file : fileArray) {\n // the file is an image, then add it\n if (isImage(file)) {\n ImageFile imageFile = new ImageFile(file.getAbsolutePath());\n // if the image is already saved, reuse it\n if (centralController.getImageFileController().hasImageFile(imageFile)) {\n imagesInDirectory.add(centralController.getImageFileController().getImageFile(imageFile));\n } else {\n imagesInDirectory.add(imageFile);\n }\n }\n }\n }", "protected void createSprite(String filename, int imgnumber, int originx, \n \t\tint originy, String name) throws FileNotFoundException\n {\n \tSprite newsprite = new Sprite(filename, imgnumber, originx, originy, \n name, this.applet);\n this.sprites.put(newsprite.getName(), newsprite);\n }", "public void picLoader() {\n if (num==0){\n image.setImageResource(R.drawable.mario);\n }\n if(num==1){\n image.setImageResource(R.drawable.luigi);\n }\n if(num==2){\n image.setImageResource(R.drawable.peach);\n }\n if(num==3){\n image.setImageResource(R.drawable.rosalina);\n }\n }", "public MakeProfile(){\r\n try{\r\n i = ImageIO.read(new File(\"../images/New Profile.png\"));\r\n repaint();\r\n }\r\n catch(IOException e){\r\n }\r\n \r\n }", "private void setAdvertImages()\t{\n\n\t\tviewFlipper = (ViewFlipper) findViewById(R.id.view_flipper_display);\n\n\t\tString[] ids = getImageIDs(shopName);\n\n\t\tif(ids.length == 1)\t{\t\t//Just the logo exists\n\t\t\tLinearLayout ll = new LinearLayout(this);\n\t\t\tll.setOrientation(LinearLayout.VERTICAL);\n\n\t\t\tLinearLayout.LayoutParams lpScan = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT);\n\t\t\tll.setLayoutParams(lpScan);\n\t\t\tll.setGravity(Gravity.CENTER);\n\n\t\t\tImageView iv = new ImageView(this);\n\t\t\tiv.setLayoutParams(lpScan);\n\t\t\tiv.setImageBitmap(imageLoadedFromInternalStorage(ids[0]));\t\t//Sets flipper images = logo (ids[0])\n\n\t\t\tll.addView(iv);\n\t\t\tviewFlipper.addView(ll);\t\n\t\t}\n\n\n\t\tfor(int i = 1; i < ids.length; i++)\t{\n\n\t\t\tLinearLayout ll = new LinearLayout(this);\n\t\t\tll.setOrientation(LinearLayout.VERTICAL);\n\n\t\t\tLinearLayout.LayoutParams lpScan = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT);\n\t\t\tll.setLayoutParams(lpScan);\n\t\t\tll.setGravity(Gravity.CENTER);\n\n\t\t\tImageView iv = new ImageView(this);\n\t\t\tiv.setLayoutParams(lpScan);\n\t\t\tiv.setImageBitmap(imageLoadedFromInternalStorage(ids[i]));\n\n\t\t\tll.addView(iv);\n\t\t\tviewFlipper.addView(ll);\t\n\t\t}\n\t}", "public abstract Image gen();", "public void loadImage() {\r\n // creates a new image icon with the characters array and the count as a file path\r\n ImageIcon ii = new ImageIcon(game.characters[count]);\r\n // load the image\r\n image = ii.getImage(); \r\n \r\n // sets width\r\n w = image.getWidth(null);\r\n // sets height\r\n h = image.getHeight(null);\r\n }", "public void openimagefile(String fn,int sno)\n {\n\t try\n\t {\n\t i=0;\n\t FileInputStream fis = new FileInputStream(fn);\n\t DataInputStream dis=new DataInputStream(fis);\n\t while((ch=dis.readUnsignedByte())!=-1)\n\t {\n\t\tp[i]=ch;\n p1[i]=ch;\n\t\ti++;\n\t }\n fis.close();\n dis.close();\n }\n catch(Exception e)\n\t{\n maxp=i;\n switch(p[28])\n\t {\n \t case 24:\n \t\t{\n init24();\n\t \tbreak;\n } //case 24 ends\n\t } // switchp[28] ends\n\t} //catch() ends\n img=createImage(new MemoryImageSource(width,height,pixels,0,width));\n img1=createImage(new MemoryImageSource(width,height,pixels1,0,width));\n }", "private void createCircleImages(){\n offScreenCircles = new Image[8];\n try {\n offScreenCircles[0] = ImageIO.read(new File(\"assets/img/ingame/offScreenCircles/circleDown.png\"));\n offScreenCircles[1] = ImageIO.read(new File(\"assets/img/ingame/offScreenCircles/circleLeftDown.png\"));\n offScreenCircles[2] = ImageIO.read(new File(\"assets/img/ingame/offScreenCircles/circleLeft.png\"));\n offScreenCircles[3] = ImageIO.read(new File(\"assets/img/ingame/offScreenCircles/circleLeftUp.png\"));\n offScreenCircles[4] = ImageIO.read(new File(\"assets/img/ingame/offScreenCircles/circleUp.png\"));\n offScreenCircles[5] = ImageIO.read(new File(\"assets/img/ingame/offScreenCircles/circleRightUp.png\"));\n offScreenCircles[6] = ImageIO.read(new File(\"assets/img/ingame/offScreenCircles/circleRight.png\"));\n offScreenCircles[7] = ImageIO.read(new File(\"assets/img/ingame/offScreenCircles/circleRightDown.png\"));\n } catch (IOException ex) {\n System.out.println(\"Bild konnte nicht geladen werden!\");\n }\n activeOffScreenCircle = offScreenCircles[0];\n }", "public void setIns() {\n\t\tImage p1= null, f1 = null;\n\t\ttry {\n\t\t\tp1 = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/P1.png\"));\n\t\t\tf1 = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/FORWARD.png\"));\n\t\t} catch (FileNotFoundException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\tImageView P1 = new ImageView(p1);\n\t\tP1.setFitHeight(360); \n\t\tP1.setFitWidth(600);\n\t\tImageView F1 = new ImageView(f1);\n\t\tF1.setX(545); \n\t\tF1.setY(305);\n\t\tF1.setFitHeight(50); \n\t\tF1.setFitWidth(50);\n\n\t\tGroup insP1 = new Group(P1, F1);\n\t\tScene scene1 = new Scene(insP1, 600, 360);\n\n\t\tImage p2= null, b2 = null, f2 = null;\n\t\ttry {\n\t\t\tp2 = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/P2.png\"));\n\t\t\tb2 = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/BACK.png\"));\n\t\t\tf2 = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/FORWARD.png\"));\n\t\t} catch (FileNotFoundException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\tImageView P2 = new ImageView(p2);\n\t\tP2.setFitHeight(360); \n\t\tP2.setFitWidth(600);\n\t\tImageView B2 = new ImageView(b2);\n\t\tB2.setX(5); \n\t\tB2.setY(305);\n\t\tB2.setFitHeight(50); \n\t\tB2.setFitWidth(50);\n\t\tImageView F2 = new ImageView(f2);\n\t\tF2.setX(545); \n\t\tF2.setY(305);\n\t\tF2.setFitHeight(50); \n\t\tF2.setFitWidth(50);\n\n\t\tGroup insP2 = new Group(P2, F2, B2);\n\t\tScene scene2 = new Scene(insP2, 600, 360);\n\n\t\tImage p3= null, b3 = null, f3 = null;\n\t\ttry {\n\t\t\tp3 = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/P3.png\"));\n\t\t\tb3 = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/BACK.png\"));\n\t\t\tf3 = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/FORWARD.png\"));\n\t\t} catch (FileNotFoundException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\tImageView P3 = new ImageView(p3);\n\t\tP3.setFitHeight(360); \n\t\tP3.setFitWidth(600);\n\t\tImageView B3 = new ImageView(b3);\n\t\tB3.setX(5); \n\t\tB3.setY(305);\n\t\tB3.setFitHeight(50); \n\t\tB3.setFitWidth(50);\n\t\tImageView F3 = new ImageView(f3);\n\t\tF3.setX(545); \n\t\tF3.setY(305);\n\t\tF3.setFitHeight(50); \n\t\tF3.setFitWidth(50);\n\n\t\tGroup insP3 = new Group(P3, F3, B3);\n\t\tScene scene3 = new Scene(insP3, 600, 360);\n\n\t\tImage p4= null, b4 = null, f4 = null;\n\t\ttry {\n\t\t\tp4 = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/P4.png\"));\n\t\t\tb4 = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/BACK.png\"));\n\t\t\tf4 = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/FORWARD.png\"));\n\t\t} catch (FileNotFoundException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\tImageView P4 = new ImageView(p4);\n\t\tP4.setFitHeight(360); \n\t\tP4.setFitWidth(600);\n\t\tImageView B4 = new ImageView(b4);\n\t\tB4.setX(5); \n\t\tB4.setY(305);\n\t\tB4.setFitHeight(50); \n\t\tB4.setFitWidth(50);\n\t\tImageView F4 = new ImageView(f4);\n\t\tF4.setX(545); \n\t\tF4.setY(305);\n\t\tF4.setFitHeight(50); \n\t\tF4.setFitWidth(50);\n\n\t\tGroup insP4 = new Group(P4, B4, F4);\n\t\tScene scene4 = new Scene(insP4, 600, 360);\n\n\t\tImage p5= null, b5 = null;\n\t\ttry {\n\t\t\tp5 = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/P5.png\"));\n\t\t\tb5 = new Image(new FileInputStream(\"/Users/mingyuliu/eclipse-workspace/ICS4U - Final Project/src/finalProj/BACK.png\"));\n\t\t} catch (FileNotFoundException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\tImageView P5 = new ImageView(p5);\n\t\tP5.setFitHeight(360); \n\t\tP5.setFitWidth(600);\n\t\tImageView B5 = new ImageView(b5);\n\t\tB5.setX(5); \n\t\tB5.setY(305);\n\t\tB5.setFitHeight(50); \n\t\tB5.setFitWidth(50);\n\n\t\tGroup insP5 = new Group(P5, B5);\n\t\tScene scene5 = new Scene(insP5, 600, 360);\n\n\t\tStage newWindow = new Stage();\n\t\tnewWindow.setTitle(\"Instructions\");\n\t\tnewWindow.setScene(scene1);\n\t\tnewWindow.initModality(Modality.WINDOW_MODAL);\n\t\tnewWindow.initOwner(primaryStage);\n\n\t\tnewWindow.show();\n\n\t\tF1.addEventHandler(MouseEvent.MOUSE_PRESSED, new EventHandler<MouseEvent>() {\n\t\t\tpublic void handle(MouseEvent me) {\n\t\t\t\tnewWindow.setScene(scene2);\n\t\t\t}\n\t\t});\n\t\tB2.addEventHandler(MouseEvent.MOUSE_PRESSED, new EventHandler<MouseEvent>() {\n\t\t\tpublic void handle(MouseEvent me) {\n\t\t\t\tnewWindow.setScene(scene1);\n\t\t\t}\n\t\t});\n\t\tF2.addEventHandler(MouseEvent.MOUSE_PRESSED, new EventHandler<MouseEvent>() {\n\t\t\tpublic void handle(MouseEvent me) {\n\t\t\t\tnewWindow.setScene(scene3);\n\t\t\t}\n\t\t});\n\t\tB3.addEventHandler(MouseEvent.MOUSE_PRESSED, new EventHandler<MouseEvent>() {\n\t\t\tpublic void handle(MouseEvent me) {\n\t\t\t\tnewWindow.setScene(scene2);\n\t\t\t}\n\t\t});\n\t\tF3.addEventHandler(MouseEvent.MOUSE_PRESSED, new EventHandler<MouseEvent>() {\n\t\t\tpublic void handle(MouseEvent me) {\n\t\t\t\tnewWindow.setScene(scene4);\n\t\t\t}\n\t\t});\n\t\tB4.addEventHandler(MouseEvent.MOUSE_PRESSED, new EventHandler<MouseEvent>() {\n\t\t\tpublic void handle(MouseEvent me) {\n\t\t\t\tnewWindow.setScene(scene3);\n\t\t\t}\n\t\t});\n\t\tF4.addEventHandler(MouseEvent.MOUSE_PRESSED, new EventHandler<MouseEvent>() {\n\t\t\tpublic void handle(MouseEvent me) {\n\t\t\t\tnewWindow.setScene(scene5);\n\t\t\t}\n\t\t});\n\t\tB5.addEventHandler(MouseEvent.MOUSE_PRESSED, new EventHandler<MouseEvent>() {\n\t\t\tpublic void handle(MouseEvent me) {\n\t\t\t\tnewWindow.setScene(scene4);\n\t\t\t}\n\t\t});\n\t}", "private void fillImageMap() {\n Image shipImage;\n try {\n shipImage = ImageIO.read(getClass().getResource(\"img/patrol_boat.png\"));\n imageMap.put(ShipType.PATROL_BOAT, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/patrol_boat_sunken.png\"));\n imageMap.put(ShipType.PATROL_BOAT_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/cruiser_horizontal.gif\"));\n imageMap.put(ShipType.CRUISER_HORIZONTAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/cruiser_horizontal_sunken.gif\"));\n imageMap.put(ShipType.CRUISER_HORIZONTAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/cruiser_vertical.gif\"));\n imageMap.put(ShipType.CRUISER_VERTICAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/cruiser_vertical_sunken.gif\"));\n imageMap.put(ShipType.CRUISER_VERTICAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/submarine_horizontal.gif\"));\n imageMap.put(ShipType.SUBMARINE_HORIZONTAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/submarine_horizontal_sunken.gif\"));\n imageMap.put(ShipType.SUBMARINE_HORIZONTAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/submarine_vertical.gif\"));\n imageMap.put(ShipType.SUBMARINE_VERTICAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/submarine_vertical_sunken.gif\"));\n imageMap.put(ShipType.SUBMARINE_VERTICAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/battleship_horizontal.gif\"));\n imageMap.put(ShipType.BATTLESHIP_HORIZONTAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/battleship_horizontal_sunken.gif\"));\n imageMap.put(ShipType.BATTLESHIP_HORIZONTAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/battleship_vertical.gif\"));\n imageMap.put(ShipType.BATTLESHIP_VERTICAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/battleship_vertical_sunken.gif\"));\n imageMap.put(ShipType.BATTLESHIP_VERTICAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/aircraft_carrier_horizontal.gif\"));\n imageMap.put(ShipType.AIRCRAFT_CARRIER_HORIZONTAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/aircraft_carrier_horizontal_sunken.gif\"));\n imageMap.put(ShipType.AIRCRAFT_CARRIER_HORIZONTAL_SUNKEN, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/aircraft_carrier_vertical.gif\"));\n imageMap.put(ShipType.AIRCRAFT_CARRIER_VERTICAL, shipImage);\n shipImage = ImageIO.read(getClass().getResource(\"img/aircraft_carrier_vertical_sunken.gif\"));\n imageMap.put(ShipType.AIRCRAFT_CARRIER_VERTICAL_SUNKEN, shipImage);\n } catch(IOException e) {\n e.printStackTrace();\n }\n }", "public void setImages(String images) {\n\t\tthis.images = images;\n\t}", "private void processImages(List<String> images) {\n setTitle(\"Showing images\");\n mImages = images;\n setListAdapter(new ImagesAdapter());\n }", "public void loadImage(String str) {\r\n\t\t// sets file into BufferedImage\r\n\t\ttry {\r\n\r\n\t\t\t// if type == 1: draw the first type of tree\r\n\t\t\tif (type == 1) {\r\n\t\t\t\tBufferedImage imgOne = ImageIO.read(Vegetation.class.getResource(str));\r\n\t\t\t\t// calls resize method to resize image\r\n\t\t\t\timg1 = imageResize(imgOne, 130, 170);\r\n\r\n\t\t\t}\r\n\t\t\t// if type == 2: draw the second type of tree\r\n\t\t\tif (type == 2) {\r\n\t\t\t\tBufferedImage imgTwo = ImageIO.read(Vegetation.class.getResource(str));\r\n\t\t\t\t// calls resize method to resize image\r\n\t\t\t\timg2 = imageResize(imgTwo, 130, 170);\r\n\t\t\t}\r\n\t\t\t// if type == 3: draw bush\r\n\t\t\tif (type == 3) {\r\n\t\t\t\tBufferedImage imgThree = ImageIO.read(Vegetation.class.getResource(str));\r\n\t\t\t\t// calls resize method to resize image\r\n\t\t\t\timg3 = imageResize(imgThree, 100, 140);\r\n\t\t\t}\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "private void showImage() {\n this.animalKind = (String) imageCbox.getSelectedItem();\n try {\n ImageIcon imageIcon = new ImageIcon(getClass().getResource(\"/\" + animalKind + \"E.png\")); // load the image to a imageIcon\n Image image = imageIcon.getImage(); // transform it\n Image newImg = image.getScaledInstance(120, 120, Image.SCALE_SMOOTH); // scale it the smooth way\n imageIcon = new ImageIcon(newImg);// transform it back\n imgLabel.setIcon(imageIcon);\n this.add(imgLabel, gbc);\n\n } catch (Exception exception) {\n exception.printStackTrace();\n }\n repaint();\n }", "public void addNewPicture() {\n ImageView imgView = (ImageView)findViewById(R.id.poll_object_btn_image);\n Resources res = getContext().getResources();\n if(this.type == \"generic\") {\n //add the new pciture for the generic type\n Bitmap bitmap = BitmapFactory.decodeResource(res, R.drawable.generic_new);\n imgView.setImageBitmap(bitmap);\n }else if(this.type == \"location\") {\n //add the new picture for the location type\n Bitmap bitmap = BitmapFactory.decodeResource(res, R.drawable.generic_new);\n imgView.setImageBitmap(bitmap);\n }else if(this.type == \"picture\") {\n //add the new picture for the picture type\n Bitmap bitmap = BitmapFactory.decodeResource(res, R.drawable.generic_new);\n imgView.setImageBitmap(bitmap);\n }\n }", "public void startImage() {\r\n\t\tm_blocks = new Vector<BlockList>();\r\n\t\tm_feature.clear();\r\n\t\tfor (int i = 0; i < 3; i++) {\r\n\t\t\tBlockList blockList = new BlockList();\r\n\t\t\tm_blocks.add(blockList);\r\n\t\t}\r\n\t}", "public void actionPerformed(ActionEvent arg0) {\n \tlblWarning.setVisible(false);\r\n \t\r\n \tString businessCardName = txtName.getSelectedItem().toString();\r\n \tString fileBusinessCard = businessCardPath + businessCardName + \".jpeg\";\r\n \tString size = txtSize.getSelectedItem().toString();\r\n \tString color = txtColor.getText().toString();\r\n \tString price = txtPrice.getText().toString();\r\n \tString address = txtAddress.getText().toString();\r\n \tString picPath = txtPicPath.getText().toString();\r\n \tString quantity = txtQuantity.getText().toString();\r\n \tString resultPath = txtPicPathTo.getText().toString();\r\n \tString ref = txtRef.getText().toString();\r\n \t\r\n \tList <BufferedImage> list = new ArrayList<BufferedImage> ();\r\n \tBufferedImage DestImage = null;\r\n \tBufferedImage bi0 = null;\r\n \tBufferedImage bi1 = null;\r\n \tBufferedImage bi2 = null;\r\n \tBufferedImage bi3 = null;\r\n \tBufferedImage bi4 = null;\r\n\t \r\n \t//For final generated image\r\n \tFile file = new File(resultPath);\r\n\t if (!businessCardName.equals(\"请选择\") && !size.equals(\"请选择\") && !color.equals(\"\") && !price.equals(\"\") \r\n\t \t\t&& !address.equals(\"\") && !picPath.equals(\"\") && !quantity.equals(\"\") && !resultPath.equals(\"\") \r\n\t \t\t&& file.isDirectory() && file.canWrite()) {\r\n\t\t\r\n \tif ((!resultPath.endsWith(\"\\\\\")) && (!resultPath.endsWith(\"/\"))) {\r\n \t\tresultPath = resultPath + \"/\";\r\n \t}\r\n \t\t \r\n \t\t\r\n\t \tString[] list1 = {size, color, price, address, quantity, ref};\r\n\t \tsi.paintString(list1, \"Reference\");\r\n\t \tsi.paintString(list1, \"Address\");\r\n\t \t\r\n\t try { \r\n\t \tbi0 = si.getBufferedImageFromStream(fileBusinessCard);\r\n\t \tbi1 = si.getBufferedImage(fileReference);\r\n\t \t//For uploaded the image of product\r\n\t \tbi2 = si.getBufferedImage(fileUploadedProduct1);\r\n\t \tif (path3 != null) {\r\n\t \t\tbi3 = si.getBufferedImage(path3);\r\n\t \t}\r\n\t \tbi4 = si.getBufferedImage(fileAddress);\r\n\t \t\r\n\t } catch (Exception e) { \r\n\t e.printStackTrace(); \r\n\t JOptionPane.showMessageDialog(null, e.getMessage(), \"错误\", JOptionPane.ERROR_MESSAGE);\r\n\t } \r\n\t \r\n\t list.add(bi4);\r\n\t list.add(bi1);\r\n\t list.add(bi2);\r\n\t list.add(bi3);\r\n\t list.add(bi0);\r\n\t //list.add(bi5);\r\n\t\r\n\t\r\n\t try { \r\n\t \tDestImage = si.mergeImage(list); \r\n\t \t//new ShowImage((Image)destImg);\r\n\t } catch (IOException e) { \r\n\t e.printStackTrace(); \r\n\t } \r\n\t \r\n\t \r\n\t //Save the result image\r\n\t Random random = new Random();\r\n\t int ran = random.nextInt(10000);\r\n\t String fileResult = \"Result\" + ran + \".jpg\";\r\n\t si.saveImage(DestImage, resultPath, fileResult); \r\n\t DestImage.flush();\r\n\t JOptionPane.showMessageDialog(null, \"图像已生成!\", \"消息\", JOptionPane.INFORMATION_MESSAGE);\r\n\t \r\n\t } else {\r\n\t \t//For warning msg\r\n\t \t//lblWarning = new JLabel(\"必填项未填或者生成图片路径不对或者路径没有权限\");\r\n\t \t\tfr.add(lblWarning);\r\n\t \t\t//Font font = new Font(\"Dialog\",1,18);\r\n\t \t\t//lblWarning.setFont(font);\r\n\t \t\tlblWarning.setVisible(true);\r\n\t \t\t//lblWarning.setBounds(150,400,400,50);\r\n\t }\r\n }", "Image createImage();", "private void loadImages() {\n Glide\n .with(Activity_Game.this)\n .load(R.drawable.game_alien_img)\n .into(game_IMAGE_p1);\n\n Glide\n .with(Activity_Game.this)\n .load(R.drawable.game_predator_img)\n .into(game_IMAGE_p2);\n }", "public ImageManip(String file) {\n\t\tthis.image = new Picture(file, false);\n\t\tthis.canvas = new Picture(this.image.getWidth(), this.image.getHeight(), false);\n\t\tthis.random = new Random();\n\t\tthis.rotateOffset = 0;\n\t}", "public CopyOfPlayer(){ //Loads and scales the images\n for (int i = 0; i < robotImages.length; i++){\n for (int j = 0; j < black.length; j++){\n robotImages[i][j].scale(300, 300);\n }\n }\n costume = PrefLoader.getCostume(); //Sets costume according to file\n setImage(robotImages[costume][2]);\n }", "public void loadimage(File file) {\n\t\tthis.transformedImageIcon = new ImageIcon(file.getAbsolutePath()); //Here we are fetching the Image from the File into an ImageIcon \n\t\tImage image = transformedImageIcon.getImage(); //Here we are getting the Actual Concrete Image from the ImageIcon which fetched the Image from the File \n\t\tupdateImage(image); //Here it will Set the Image to the JLabel after calling the Scaling Method \n\t}", "public void imageLoader(File file)\n{\n float ratio;\n if (file == null)\n {\n return;\n } else\n {\n try\n {\n PImage img = loadImage(file.getAbsolutePath());\n //if(img.width < 300)\n //{\n // img.resize(300,img.height);\n // if(img.height/((float)img.width)>3)\n // img.resize(300, 900);\n // if(img.width/((float)img.height)<0.3)\n // img.resize(900, 300);\n //}\n //if(img.height < 300)\n //{\n // img.resize(img.width, 300);\n // if(img.width/((float)img.width)>3)\n // img.resize(300, 900);\n // if(img.width/((float)img.height)<0.3)\n // img.resize(900, 300);\n //}\n if(img.height/((float)img.width)>3)\n {\n ratio = 1.0f;\n if(img.width < 400)\n {\n ratio = 400/((float)img.width);\n }\n img.resize((int)(ratio*img.width),(int)(ratio*img.width*2.5f));\n }\n if(img.height/((float)img.width)<0.25f)\n {\n ratio = 1.0f;\n if(img.height < 400)\n {\n ratio = 400/((float)img.height);\n }\n img.resize((int)(ratio*img.height*2.5f),(int)(ratio*img.height));\n }\n if(img.width < 400 || img.height < 400)\n {\n ratio = 1.0f;\n if(img.width < 400)\n {\n ratio = 400/((float)img.width);\n }\n if(img.height < 400 && img.height < img.width)\n {\n ratio = 400/((float)img.height);\n }\n img.resize((int)(ratio*img.width),(int)(ratio*img.height));\n }\n m.getInputImageManager().setImage(img);\n m.getInputImageManager().setResizedImage(m.getInputImageManager().resizeToFit(img, width-150, height-20));\n if(m.getOutputImageManager().getMosaic()!= null)\n {\n m.getOutputImageManager().createMosaic(m.getInputImageManager().getImage(),m.getOutputImageManager().getMosaic().getLastSeenImage(), m.getOutputImageManager().getMosaic().getTiles());\n }\n else\n {\n m.getOutputImageManager().createMosaic(m.getInputImageManager().getImage(),m.getInputImageManager().getImage(), m.getTileManager().getTiles());\n }\n m.getOutputImageManager().getMosaic().setMiniatures();\n }\n catch(NullPointerException e)\n {\n println(e);\n }\n }\n}", "private LinkedList<Image> loadPhotos(int n){\n\t\tLinkedList<Image> listOfPhotos = new LinkedList<>();\n\t\t\n\t\t\n\t\ttry {\n\n\t\t\tFileInputStream in = new FileInputStream(\"images\");\n\t\t\t//Skipping magic number and array size\n\t\t\tfor (int i = 0; i < 16; i++) {\n\t\t\t\tin.read();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tfor (int k = 0; k < n; k++) {\n\t\t\t\tImage img = new Image(HEIGHT, WIDTH);\n\t\t\t\t\n\t\t\t\tbyte[][] imageData = new byte[WIDTH][HEIGHT];\n\t\t\t\tfor (int i = k*WIDTH; i < k*WIDTH + WIDTH; i++) {\n\t\t\t\t\tfor (int j = k*HEIGHT; j < k*HEIGHT + HEIGHT; j++) {\n\t\t\t\t\t\timageData[j%28][i%28] = (byte) in.read();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\timg.setData(imageData);\n\t\t\t\tlistOfPhotos.add(img);\n\t\t\t}\n\t\t\tin.close();\n\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\t\n\t\t\n\t\treturn listOfPhotos;\n\t\t\n\t}" ]
[ "0.6472558", "0.6312412", "0.62615335", "0.6231831", "0.61610556", "0.6156648", "0.6129977", "0.6034828", "0.59959334", "0.59590894", "0.5923219", "0.58885705", "0.58821875", "0.58724844", "0.5855191", "0.5848283", "0.5847585", "0.5837213", "0.5835972", "0.5813308", "0.5812271", "0.5809995", "0.57914555", "0.5786363", "0.57827413", "0.5776792", "0.5766149", "0.5764712", "0.5749341", "0.5746177", "0.57288635", "0.57261884", "0.5697447", "0.569637", "0.568653", "0.5682529", "0.56822634", "0.5668852", "0.5668507", "0.5641436", "0.5636027", "0.56230104", "0.5609778", "0.56021005", "0.56008995", "0.55989105", "0.5583914", "0.5574339", "0.557431", "0.55700254", "0.55601156", "0.5529168", "0.55285364", "0.5495655", "0.54922265", "0.5487647", "0.5479646", "0.5474826", "0.54735905", "0.5461856", "0.54525435", "0.54509616", "0.54401016", "0.54370135", "0.543513", "0.54273355", "0.54195637", "0.541097", "0.5410647", "0.5406467", "0.540359", "0.53901625", "0.5388829", "0.53805256", "0.5370418", "0.5365542", "0.53640527", "0.5355253", "0.534365", "0.5337067", "0.53253394", "0.5322368", "0.53097206", "0.53070956", "0.53031796", "0.5302675", "0.5301614", "0.5289998", "0.52879375", "0.52780646", "0.52743816", "0.52635825", "0.5258323", "0.5254252", "0.5250506", "0.5247063", "0.52407336", "0.52289397", "0.5225967", "0.5221934" ]
0.54847866
56
Method returns the String of the current hidden image
public String getImage(){ StringBuilder sb = new StringBuilder(); for (char[] subArray : hidden) { sb.append(subArray); sb.append("\n"); } return sb.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getImage();", "public String getImage() {\n\t\tString ans=\"Data/NF.png\";\n\t\tif(image!=null)\n\t\t\tans=\"Data/Users/Pics/\"+image;\n\t\treturn ans;\n\t}", "public Image getShowImage() {\n\t\treturn showImage;\n\t}", "String getImage();", "public String getImageString() {\n return getString(POST_IMAGE_STRING);\n }", "public String getImageToDisplay() {\n return imageToDisplay;\n }", "public String getImage() {\n\t\treturn null;\n\t}", "public String getImage() { return image; }", "public String getImage() {\n\t\treturn image;\n\t}", "public String getImage() {\n\t\treturn image;\n\t}", "public String getImage() {\n return this.Image;\n }", "public java.lang.String getEatImage() {\n return localEatImage;\n }", "public String getNewImage() {\r\n\t\treturn newImage;\r\n\t}", "public String getImage()\n {\n return image;\n }", "public String getImage() {\n return image;\n }", "public String getImage() {\n return image;\n }", "public String getImage() {\n return image;\n }", "public String getImage() {\n return image;\n }", "public String getImage() {\n return image;\n }", "public String getImg(){\n switch(image){\n case 0: // Case 0: Ant looks up/north\n return \"imgs/ant_n.png\";\n case 1: // Case 1: Ant looks right/east\n return \"imgs/ant_e.png\";\n case 2: // Case 2: Ant looks down/south\n return \"imgs/ant_s.png\";\n case 3: // Case 3: Ant looks left/west\n return \"imgs/ant_w.png\";\n default: // Default: This shouldn't happen on a normal run. It returns an empty string and prints an error.\n System.err.println(\"Something went wrong while the ant was trying change direction\");\n return \"\";\n }\n }", "public java.lang.String getImage() {\n java.lang.Object ref = image_;\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 image_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public ImageView getId_image_item_shown() {\n return mHolder.id_image_item_shown;\n }", "public String printImage() {\n StringBuilder builder = new StringBuilder();\n builder.append(\"ID:\" + this.id + \"; Data:\\n\");\n\n for (int i = 1; i <= this.data.length; i++) {\n T t = data[i - 1];\n builder.append(t.toString() + \" \");\n if (i % 28 == 0) {\n builder.append(\"\\n\");\n }\n }\n return builder.toString().replace('0', ' ');\n }", "public String getImg_0() {\n return img_0;\n }", "public String getStaticPicture();", "public java.lang.String getWeatherImage()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(WEATHERIMAGE$2, 0);\n if (target == null)\n {\n return null;\n }\n return target.getStringValue();\n }\n }", "public String getImgOriginal() {\r\n return imgOriginal;\r\n }", "public String getaImg() {\n return aImg;\n }", "public ImageIcon getCurrentImage() {\n\t\t\treturn this.currentImage;\n\t}", "public String getImg() {\n return img;\n }", "public String getImg() {\n return img;\n }", "public String getImg() {\n return img;\n }", "public java.lang.String getIdleImage() {\n return localIdleImage;\n }", "public java.lang.String getImage() {\n java.lang.Object ref = image_;\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 image_ = s;\n return s;\n }\n }", "public String getImageName() {\r\n\t\treturn _imageName;\r\n\t}", "public String getSnapImage()\r\n\t\t{\r\n\t\tif(this.snapImage != null && this.fximage != null) {\t\r\n\t\t\treturn this.snapImage;\r\n\t\t}\r\n\t\telse {\r\n\t\t\ttry {\r\n\t\t\t\tgetFXImage();\r\n \t\t\tBufferedImage bImage = SwingFXUtils.fromFXImage(this.fximage, null);\r\n \t\t\tByteArrayOutputStream s = new ByteArrayOutputStream();\r\n \t\t\ttry {\r\n\t\t\t\t\tImageIO.write(bImage, \"png\", s);\r\n\t\t\t\t\t} \r\n \t\t\tcatch (IOException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n \t\t\tthis.snapImage = Base64.encode(s.toByteArray());\r\n\t\t\t}\r\n\t\t\tcatch (NullPointerException n) {\r\n\t\t\t\tSystem.out.println(\"The asset for \" + iconId + \" was not found.\" );\r\n\t\t\t}\r\n\t\t\treturn this.snapImage;\t\r\n\t\t}\r\n\t}", "public final String getImageName() {\n return this.imageName;\n }", "public Image getImage() {\r\n\t\treturn GDAssemblerUI.getImage(GDAssemblerUI.IMAGE_GD);\r\n\t}", "public String getOriginalImg() {\n return originalImg;\n }", "public String getpImage() {\n return pImage;\n }", "public ImageObj currentImage() {\n if (model.getImageList().size() == 0) {\n noImages = true;\n return new ImageObj(\"http://www.xn--flawiler-fachgeschfte-n2b.ch/wp-content/uploads/2016/09/sample-image.jpg\", \"No Image\");\n }\n return model.getImageList().get(position);\n }", "public String getImgName() {\n return imgName;\n }", "String getItemImage();", "public String getImg(){\n return img;\n }", "public String getImgDesc() {\r\n return imgDesc;\r\n }", "public String smallImage() {\n return this.smallImage;\n }", "public String getPd_img() {\n\t\treturn pd_img;\n\t}", "public BufferedImage getImage() {\n\t\tTelaInterna ti = ( TelaInterna )contentPane.getSelectedFrame();\n\t\tBufferedImage img;\n\t\timg = ti.getImage();\n\t\treturn img;\n\t}", "public String getIdimgF() {\r\n return idimgF;\r\n }", "public BufferedImage getCurrentImage(){\n\t\treturn getCurrentImage(System.currentTimeMillis()-lastUpdate);\n\t}", "public Image getImage() {\r\n\t\tif (isShieldActivated()) {\r\n\t\t\treturn GameGUI.SPACESHIP_IMAGE_SHIELD;\r\n\t\t}\r\n\t\treturn GameGUI.SPACESHIP_IMAGE;\r\n\t}", "public String getSourceImage() {\n return sourceImage;\n }", "public ImageInfo getImage() {\n return image;\n }", "public String getCurrentUserPicture() {\n\t\treturn currentUser.getPicture();\n\t}", "public String getImg_1() {\n return img_1;\n }", "public String getSlideOneimg() {\n return slideOneimg;\n }", "public String toString()\n {\n String output = \"Picture, filename \" + getFileName() + \n \" height \" + getHeight() \n + \" width \" + getWidth();\n return output;\n \n }", "public String toString()\n {\n String output = \"Picture, filename \" + getFileName() + \n \" height \" + getHeight() \n + \" width \" + getWidth();\n return output;\n \n }", "public String getWechatImg() {\r\n\t\treturn wechatImg;\r\n\t}", "@Override\n\tpublic String getImageName() {\n\t\treturn \"\";\n\t}", "public org.apache.xmlbeans.XmlString xgetWeatherImage()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlString target = null;\n target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(WEATHERIMAGE$2, 0);\n return target;\n }\n }", "public String getPixelInfo()\n {\n return pixelInfo.toString();\n }", "public String getImageFile() {\n\t\treturn imagefile;\n\t}", "public String getUserImg() {\r\n return userImg;\r\n }", "public ImageArray getCurrentImage() {\n return currentIm;\n }", "public java.lang.String getSleepImage() {\n return localSleepImage;\n }", "public String getIconString() {\n return theIconStr;\n }", "@Override\r\n\tpublic Image getImg() {\n\t\treturn img.getImage();\r\n\t}", "public String getProductPictureDetails(){\r\n\t\t\t\r\n\t\t\treturn (hasProductPicture())?McsElement.getElementByXpath(driver, PRODUCT_PIC_CONTAINER+\"//img\").getAttribute(\"src\"): \"\";\r\n\t\t}", "public Icon getImageIcon() {\r\n\t\treturn lblImageViewer.getIcon();\r\n\t}", "public Image getImage() {\n return (isFacingRight) ? Images.get(\"rightTedhaun\") : Images.get(\"leftTedhaun\");\n }", "String getIcon();", "String getIcon();", "public BufferedImage getImage ( ) {\n\n BufferedImage img =\n param.Parameters.PROBLEM.getData(param.Parameters.STATE, program, 0, 0);\n\n System.gc();\n\n return img;\n \n }", "java.lang.String getIcon();", "java.lang.String getIcon();", "final public int getHidden() {\r\n \treturn this.width * this.height - this.squaresRevealed;\r\n }", "public String getImageURl(){\r\n\t\treturn this.lePanel.chEventImage;\r\n\t}", "public int getHidden(int p) {\n int rgb= currentIm.getPixel(p);\n int red= DM.getRed(rgb);\n int green= DM.getGreen(rgb);\n int blue= DM.getBlue(rgb);\n return (red % 10) * 100 + (green % 10) * 10 + blue % 10;\n }", "public String getImgKey() {\n return imgKey;\n }", "private void displayCurrentPicture() {\r\n\t\tglobalContainer.setWidget(0, 0, getCurrentPicture());\r\n\t}", "public ImageIcon getImage(){\n\t\treturn this.image;\n\t}", "public java.lang.String getImage() {\n\t\treturn _imageCompanyAg.getImage();\n\t}", "public String getNewImageTag() {\n return newImageTag;\n }", "public String getImageIdentifier() {\n return this.imageIdentifier;\n }", "public BufferedImage getImage() {\t\r\n\t\treturn this.image;\t\t\t\r\n\t}", "public Image getImage() {\n\t\tif (State == \"NORMAL\") {\n\t\t\tBox = sBoxNormal.getImage();\n\t\t} else if (State == \"OK\") {\n\t\t\tBox = sBoxGoal.getImage();\n\t\t}\n\t\treturn Box;\n\t}", "public static String getBallPossessor() {\r\n String imageResource = \"/bloodbowl/resources/possessor.gif\";\r\n\r\n return imageResource;\r\n }", "public BufferedImage getImage() {\n return embeddedImage;\n }", "Imagem getImagem();", "public String getImg_2() {\n return img_2;\n }", "public Label getPic(){\n //try {//getPic is only called if isPic is true, so side1 would contain picture path\n /*BufferedImage unsized = ImageIO.read(new File(side1));\n BufferedImage resized = resizeImage(unsized,275,250, unsized.getType());\n frontPic.setIcon(new ImageIcon(resized));*/\n\n\t\t\tImage image = new Image(new File(side1).toURI().toString());\n\t\t\tImageView iv = new ImageView(image);\n\t\t\tLabel imageLabel = new Label(\"Image\");\n\t\t\timageLabel.setGraphic(iv);\n\t\t\treturn imageLabel;\n /*} catch (IOException ex) {\n System.out.println(\"Trouble reading from the file: \" + ex.getMessage());\n }\n return frontPic;*/\n }", "public String getStringImage() {\n if (bitmap != null) {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n bitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos);\n byte[] imageBytes = baos.toByteArray();\n String encodedImage = Base64.encodeToString(imageBytes, Base64.DEFAULT);\n return encodedImage;\n } else {\n return null;\n }\n }", "private Image getCurrentPicture(){\r\n\t\tif (i >= images.size()) {\r\n\t\t\ti = 0;\r\n\t\t}else if(i<0){\r\n\t\t\ti = images.size() -1;\r\n\t\t}\r\n\t\treturn new Image(images.get(i).getUrl());\r\n\t}", "public static String getImgGif() throws Exception {\n\t\treturn getConfig(\"img_gif\");\n\t}", "String avatarImageSelected();", "public ImageIcon image() {\n return image;\n }", "public String getImageSource() {\r\n return imageSource;\r\n }", "protected ImageView getImageView(){\n\t\treturn iv1;\n\t}", "public String toString()\n {\n\t// Local constants\n\n\t// Local variables\n\tString outputString = \"\";\n\n\t/************** Start getCardPicture Method *****************/\n\n\t// Add face value to output string\n\toutputString += \"FaceValue: \" + faceValue + \" | \";\n\n\t// Add suit to output string\n\toutputString += \"Suit : \" + suit + \" | \";\n\n\t// Add trueValue to output string\n\toutputString += \" TrueValue :\" + trueValue;\n\n\t// Return output string\n return outputString;\n\n }" ]
[ "0.68966496", "0.6674736", "0.66587216", "0.65875924", "0.65851116", "0.65400565", "0.6502507", "0.64836043", "0.6482127", "0.6482127", "0.645621", "0.6444016", "0.6435671", "0.64035493", "0.6356474", "0.63323396", "0.63323396", "0.63323396", "0.63323396", "0.63222486", "0.6307482", "0.62896836", "0.62762034", "0.62672997", "0.6244984", "0.62296635", "0.62270844", "0.62250984", "0.6216029", "0.6211137", "0.6211137", "0.6211137", "0.61608493", "0.61593276", "0.61340374", "0.6095664", "0.6091036", "0.6089263", "0.60833603", "0.6031997", "0.6019122", "0.60127187", "0.6010328", "0.60040706", "0.59895456", "0.598062", "0.5963841", "0.59634453", "0.59614664", "0.59570897", "0.5953608", "0.59433746", "0.5940057", "0.5935455", "0.5933169", "0.5926363", "0.5922985", "0.5922985", "0.59218764", "0.5915304", "0.591204", "0.59072614", "0.58928907", "0.58881074", "0.58735967", "0.58729106", "0.58699316", "0.58610344", "0.5860368", "0.58502406", "0.58383524", "0.582655", "0.582655", "0.58251977", "0.5807771", "0.5807771", "0.5802798", "0.58000386", "0.5796641", "0.5796171", "0.5796015", "0.5788094", "0.57785106", "0.57716197", "0.5767973", "0.5758162", "0.5749421", "0.5747211", "0.57299256", "0.5725356", "0.57235324", "0.57210606", "0.5711166", "0.57084024", "0.5706339", "0.5705375", "0.57044274", "0.57033455", "0.5699326", "0.5698636" ]
0.7668725
0
Method changes the next idx of the hidden image to the character in the original image You can change this method if you want to turn more than one x to the original
public String replaceOneCharacter() { int colNumber = idx%col; int rowNumber = idx/col; hidden[rowNumber][colNumber] = original[rowNumber][colNumber]; idx++; return(getImage()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void hreflect() {\n int rows= currentIm.getRows();\n int cols= currentIm.getCols();\n int h= 0;\n int k= rows-1;\n //invariant: rows 0..h-1 and k+1.. have been inverted\n while (h < k) {\n // Swap row h with row k\n // invariant: pixels 0..c-1 of rows h and k have been swapped\n for (int c= 0; c != cols; c= c+1) {\n currentIm.swapPixels(h, c, k, c);\n }\n \n h= h+1; k= k-1;\n }\n }", "public void changeDirection(int image){\n this.image = image; \n }", "@FXML\r\n private void Next_Image() {\r\n ImageView imagev = (ImageView) hbox.getChildren().get(image_index);\r\n img_v.setImage(imagev.getImage());\r\n if (transitor_next_last) {\r\n image_index += 2;\r\n }\r\n image_index += 2;\r\n transitor_next_last = false;\r\n if (image_index == hbox.getChildren().size()) {\r\n image_index = 0;\r\n }\r\n\r\n }", "public int resetToNextPoint() {\n if (curPointIndex + 1 >= numPoints)\n return ++curPointIndex;\n int diff = curPointIndex ^ (curPointIndex + 1);\n int pos = 0; // Position of the bit that is examined.\n while ((diff >> pos) != 0) {\n if (((diff >> pos) & 1) != 0) {\n cachedCurPoint[0] ^= 1 << (outDigits - numCols + pos);\n for (int j = 1; j <= dim; j++)\n cachedCurPoint[j] ^= genMat[(j-1) * numCols + pos];\n }\n pos++;\n }\n curCoordIndex = 0;\n return ++curPointIndex;\n }", "public void setCurrentImage(int index) {\n if ((index >= 0) && (index < mTexIdArray.length)) {\n mTexId = mTexIdArray[index];\n }\n }", "static void visible() {\n int x, y;\n int[][] res = deepClone( pgmInf.img );\n\n System.out.print(\"Enter reference point: \");\n y = scan.nextInt();\n x = scan.nextInt();\n scan.nextLine(); // flush\n \n System.out.printf(\"Marking all pixels visible from %d,%d as white.\\n\", x, y);\n // mark visible points\n for (int i=0 ; i < pgmInf.width ; i++) {\n for (int j=0 ; j < pgmInf.height ; j++) {\n if ( lineBetween(x, y, i, j) ) res[j][i] = 9;\n }\n }\n pgmInf.img = res;\n System.out.println(\"Done.\");\n }", "private void setComponentsOfIndex() {\n\t\tint t = this.numbersIdex + 1;\n\t\tif (t == NUMBEROFEACHCARD) {\n\t\t\tthis.numbersIdex = 0;\n\t\t\tsetColorIndex();\n\t\t} else {\n\t\t\tthis.numbersIdex = t;\n\t\t}\n\t}", "void draw() {\n\n // SeamInfo lowestSeam = this.lowestSeamVert();\n // lowestSeam.changeColor();\n\n ComputedPixelImage seamRemovedImg = new ComputedPixelImage(this.newImg.width,\n this.newImg.height);\n int countRow = 0;\n int countCol = 0;\n\n Pixel current = this.curPixel;\n Pixel temp;\n\n while (current.down != null) {\n temp = current.down;\n while (current.right != null) {\n Color c = Color.MAGENTA;\n if (current.highlighted) {\n c = Color.RED;\n }\n else {\n c = current.color;\n }\n if (this.showType.equals(\"e\")) {\n int energy = (int) (current.energy * 100);\n if (energy > 255) {\n System.out.println(\"energy: \" + energy + \" to 255\");\n energy = 255;\n }\n c = new Color(energy, energy, energy);\n }\n else if (this.showType.equals(\"w\")) {\n int weight = (int) (current.seam.totalWeight);\n if (weight > 255) {\n System.out.println(\"weight: \" + weight + \" to 255\");\n weight = 255;\n }\n c = new Color(weight, weight, weight);\n }\n\n seamRemovedImg.setColorAt(countCol, countRow, c);\n countCol += 1;\n current = current.right;\n }\n countCol = 0;\n countRow += 1;\n current = temp;\n }\n countCol = 0;\n\n this.newImg = seamRemovedImg;\n\n }", "public void flipOverX(){\n int len = tileChars.length;\r\n \r\n // swap rows\r\n for (int i = 0; i < len / 2; i++)\r\n {\r\n for (int j = 0; j < len; j++)\r\n {\r\n // swap `tileChars[i][j]` with `tileChars[len-i-1][j]`\r\n char temp = tileChars[i][j];\r\n tileChars[i][j] = tileChars[len-i-1][j];\r\n tileChars[len-i-1][j] = temp;\r\n }\r\n }\r\n \r\n boolean temp = this.matchFound[0];\r\n this.matchFound[0] = this.matchFound[2];\r\n this.matchFound[2] = temp;\r\n \r\n this.recalculateEdges(); //fix edges\r\n }", "public void revealImage(int current){\r\n System.out.println(gameBoard[current].getPicture());\r\n if(clickable){\r\n clickable = false;\r\n /*Getting the image in our ImageArray[current] and setting the image to the new image from our\r\n card Object in our gameBoard, adding the new image to the grid, to display, and using cardIndx\r\n object to store the col Index and Row Index*/\r\n imageArr[current] = new ImageView(new Image(gameBoard[current].getPicture()));\r\n grid.add(imageArr[current], cardIndx[current].getColIndex(), cardIndx[current].getRowIndex());\r\n \r\n if(ctr == 0){\r\n clicked[0] = current;\r\n clickable = true;\r\n ctr++;\r\n }\r\n \r\n else{\r\n imageArr[current] = new ImageView(new Image(gameBoard[current].getPicture()));\r\n grid.add(imageArr[current], cardIndx[current].getColIndex(), cardIndx[current].getRowIndex());\r\n \r\n clicked[1] = current;\r\n ctr = 0; \r\n try {\r\n \r\n Thread.sleep(300);\r\n compare();\r\n } catch (InterruptedException ex) {\r\n Logger.getLogger(MainController.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }\r\n \r\n }\r\n \r\n \r\n \r\n }", "private int newIndex() {\n //return indexes.remove(0);\n return random.nextInt(81);\n }", "public void newGame(){\n if (won) {\n idx = 0;\n won = false; \n List<String> rows = new ArrayList<String>();\n\n try{\n // loads one random image from list\n Random rand = new Random(); \n col = 0;\n int randInt = rand.nextInt(files.size());\n File file = new File(\n Game.class.getResource(\"/\"+files.get(randInt)).getFile()\n );\n BufferedReader br = new BufferedReader(new FileReader(file));\n String line;\n while ((line = br.readLine()) != null) {\n if (col < line.length()) {\n col = line.length();\n }\n rows.add(line);\n }\n }\n catch (Exception e){\n System.out.println(\"File load error\"); // extremely simple error handling, you can do better if you like. \n }\n\n // this handles creating the orinal array and the hidden array in the correct size\n String[] rowsASCII = rows.toArray(new String[0]);\n\n row = rowsASCII.length;\n\n // Generate original array by splitting each row in the original array.\n original = new char[row][col];\n for(int i = 0; i < row; i++) {\n char[] splitRow = rowsASCII[i].toCharArray();\n for (int j = 0; j < splitRow.length; j++) {\n original[i][j] = splitRow[j];\n }\n }\n\n // Generate Hidden array with X's (this is the minimal size for columns)\n hidden = new char[row][col];\n for(int i = 0; i < row; i++){\n for(int j = 0; j < col; j++){\n hidden[i][j] = 'X';\n }\n }\n setIdxMax(col * row);\n }\n else {\n }\n }", "public void vreflect() {\n int rows= currentIm.getRows();\n int cols= currentIm.getCols();\n int h= 0;\n int k= cols-1;\n //invariant: columns 0..h-1 and k+1.. have been inverted\n while (h < k) {\n // Swap column h with column k\n // invariant: pixels 0..c-1 of columns h and k have been swapped\n for (int c= 0; c != rows; c= c+1) {\n currentIm.swapPixels(c, h, c, k);\n }\n \n h= h+1; k= k-1;\n }\n \n }", "private void animate() {\r\n\t\tif (spriteCounter > 50) {\r\n\t\t\tanimationFrame = 0;\r\n\t\t} else {\r\n\t\t\tanimationFrame = -16;\r\n\t\t}\r\n\t\t\r\n\t\tif (spriteCounter > 100) {\r\n\t\t\tspriteCounter = 0;\r\n\t\t}\r\n\t\t\r\n\t\r\n\t\tspriteCounter++;\r\n\t\tsetImage((Graphics2D) super.img.getGraphics());\r\n\t}", "@Override\r\n public void move(ImageView image, Double xInitial) {\n\r\n }", "public void onClick(View v) {\n currentIndex++;\n // Check If index reaches maximum then reset it\n if (currentIndex == count)\n currentIndex = 0;\n simpleImageSwitcher.setImageResource(imageIds[currentIndex]); // set the image in ImageSwitcher\n }", "@Override\n\tpublic void draw(GraphicsContext gc) {\n\t\t\tgc.drawImage(image.get(n), x, y);\n\t\tn++;\n\t\tif (n>=15) n=0;\n\t}", "public abstract void explodingKittenReplaced(int playerIndex);", "public void nextTextureIndexX() {\n/* 245 */ this.particleTextureIndexX++;\n/* */ }", "@Override\n public void onClick(View v) {\n text.setText(\"摇一摇\");\n num=0;\n }", "private void setFormedIndex() {\n\t\tint t = this.formeIndex + 1;\n\t\tif (t == NUMBEROFEACHCARD) {\n\t\t\tsetFillIndex();\n\t\t\tthis.formeIndex = 0;\n\t\t} else {\n\t\t\tthis.formeIndex = t;\n\t\t}\n\n\t}", "public void horizontalFlip(Image im, int x, int y, int pixels, GraphicsContext gc2) {\n //permite que la imagen se pueda editar\n imageView = new ImageView(im);\n SnapshotParameters snap = new SnapshotParameters();\n //selecciona el bloque que se va a voltear\n snap.setViewport(new Rectangle2D(x, y, pixels, pixels));\n im = imageView.snapshot(snap, null);\n //voltea la imagen\n gc2.drawImage(im, 0, 0, pixels, pixels, x, y + pixels, pixels, -pixels);\n }", "private void displayNext() {\r\n\t\ti++;\r\n\t\tdisplayCurrentPicture();\r\n\t}", "private void reanderImage(ImageData data) {\n \n }", "public static void eraseKeyboard(){\n\t\tfor(int i=0;i<16;i++)\n\t\t\tfor(int j=0;j<16;j++){\n\t\t\t\tdisplay[i][j].setIcon(DEFAULT);\n\t\t\t\tdisplay[i][j].setSelectedIcon(SCANNED);\n\t\t\t}\n\t}", "private void generateImage()\r\n {\n String[] letters = imgInfo.get(level-1).getWord().split(\" \");\r\n numOfLetter = letters.length;\r\n String newLetter = \"\";\r\n int counter=0;\r\n for(String s: letters) {\r\n newLetter += s;\r\n numOfAlpha[counter] = s.length();\r\n counter++;\r\n }\r\n charAns = new ArrayList<Character>();\r\n charAns2 = newLetter.toCharArray();\r\n letterBtnLen = 0;\r\n for (int i =0;i<newLetter.length();i++) {\r\n if(charAns.indexOf(charAns2[i]) == -1) {\r\n charAns.add(charAns2[i]);\r\n letterBtnLen++;\r\n }\r\n }\r\n int ranNum,i=0;\r\n letterBtn = new char[letterBtnLen];\r\n while(!charAns.isEmpty())\r\n {\r\n ranNum =(int) (Math.random()* charAns.size());\r\n letterBtn[i] = charAns.get(ranNum);\r\n String strAns = String.valueOf(charAns.get(ranNum));\r\n letter[i].setText(strAns);\r\n charAns.remove(ranNum);\r\n i++;\r\n }\r\n }", "public char setIcon(char icon) {\n char previous = this.icon;\n this.icon = icon;\n return previous;\n }", "void changeSetting(int idx) {\n currentIdx = idx;\n }", "public void flipOverY(){\n int len = tileChars.length;\r\n \r\n // swap columns\r\n for (int i = 0; i < len; i++)\r\n {\r\n for (int j = 0; j < len / 2; j++)\r\n {\r\n char temp = tileChars[i][j];\r\n tileChars[i][j] = tileChars[i][len - j - 1];\r\n tileChars[i][len - j - 1] = temp;\r\n }\r\n }\r\n \r\n boolean temp = this.matchFound[1];\r\n this.matchFound[1] = this.matchFound[3];\r\n this.matchFound[3] = temp;\r\n \r\n this.recalculateEdges(); //fix edges\r\n }", "protected void changePic() {\nif(framesforUser.isEmpty())\n{\nToast.makeText(getApplicationContext(), \"Finished!\", Toast.LENGTH_LONG);\nmodeTextView.setText(\"Finished\");\nnewImgButton.setEnabled(false);\n\n}\nelse{\n\tCollections.shuffle(framesforUser);\n\n\tcurrentPicIndex=framesforUser.get(0);\n\n\t\t Log.e(\"SY\", \"Current PicIndex= \"+currentPicIndex+\" \"+framesforUser.get(0));\n\t\t currentOverlay = getResources().getDrawable(resourcefromframeorder[framesforUser.get(0)]);\n\t\t \n\t\t overlayview.setImageDrawable(currentOverlay);\n\t\t cameraframe.removeView(overlayview);\n\t\t cameraframe.addView(overlayview,1);\n\n\t\t framenumTextView.setText(currentPicIndex+\"\");\n\t\t\tcountdownView.setText(framesforUser.size()+\"\");\n\n\t}\n }", "public void getnext9(float x[], float y[], int i, int j) {\n y[j+0] = x[i+0];\n y[j+1] = x[i-1];\n y[j+2] = x[i+1];\n y[j+3] = x[i-cols];\n y[j+4] = x[i+cols];\n y[j+5] = x[i-cols-1];\n y[j+6] = x[i-cols+1];\n y[j+7] = x[i+cols-1];\n y[j+8] = x[i+cols+1];\n }", "void walkAnimation(int direction, int index) {\n switch (direction) {\n case 0:\n if (flip) { tile.setImg(upSprites1.get(index)); }\n else { tile.setImg(upSprites2.get(index)); }\n break;\n case 1:\n if (flip) { tile.setImg(downSprites2.get(index)); }\n else { tile.setImg(downSprites2.get(index)); }\n break;\n case 2:\n tile.setImg(leftSprites.get(index));\n break;\n case 3:\n tile.setImg(rightSprites.get(index));\n break;\n }\n }", "public void setIconState(int index) {\n\r\n switch (index) {\r\n case 0:\r\n im_service.setImageResource(R.drawable.shouye2);\r\n tv_service.setTextColor(getResources().getColor(R.color.green));\r\n break;\r\n case 1:\r\n im_chart.setImageResource(R.drawable.faxian2);\r\n tv_chart.setTextColor(getResources().getColor(R.color.green));\r\n break;\r\n\r\n case 2:\r\n im_share.setImageResource(R.drawable.fenxiang2);\r\n tv_share.setTextColor(getResources().getColor(R.color.green));\r\n break;\r\n case 3:\r\n im_me.setImageResource(R.drawable.wo2);\r\n tv_me.setTextColor(getResources().getColor(R.color.green));\r\n break;\r\n }\r\n }", "private int terminalLocation(){\n int answer = 0;\n for(int ii = 0; ii < (currentIm.getRows() * currentIm.getCols()); ii = ii + 1){\n if(126 == getHidden(ii)){\n return answer = ii;\n }\n }\n \n return answer;\n }", "public void update()\n {\n if(x + image.getWidth(null) < 0)\n {\n x = 0;\n }\n else\n {\n x--;\n }\n }", "public void infectfirstpixel() {\r\n randompixel = r.nextInt(100);\r\n pixellist.get(randompixel).setBackground(Color.red);\r\n count++;\r\n storage.add(randompixel);\r\n\r\n }", "public void fuzzify() {\n ImageArray newCopy = currentIm.copy();\n \n int rows= currentIm.getRows();\n int cols= currentIm.getCols();\n \n for(int rr = 1; rr < rows-1; rr++){\n \n for(int cc = 1; cc < cols-1; cc++){\n fuzPixel(rr,cc,newCopy);\n \n }\n \n }\n \n currentIm = newCopy.copy();\n \n \n }", "protected void setHidden(int x, int y) {\r\n \t\r\n if (revealed[x][y]) {\r\n \t//System.out.println(\"Auto Reveal at (\" + x + \",\" + y + \")\");\r\n revealed[x][y] = false;\r\n squaresRevealed--;\r\n \r\n \tif (is3BV[x][y]) { // if this was a 3BV tile then ew've no longer cleared it\r\n \t\tcleared3BV--;\r\n \t}\r\n }\r\n\r\n }", "public void setPixel(int x, int y, short red, short green, short blue) {\n // Your solution here, but you should probably leave the following line\n // at the end.\n\t //if setPixel at the first location.\n\t if((x==0) && (y==0)) {\n\t\t if(red!=runs.getFirst().item[1]) {\n\t\t\t if(runs.getFirst().item[0]!=1) {\n\t\t\t\t int[] item= new int[] {1,red,green,blue};\n\t\t\t\t runs.getFirst().item[0]=runs.getFirst().item[0]-1;\n\t\t\t\t runs.addFirst(item);\n\t\t\t }\n\t\t\t else {\n\t\t\t\t if(red!=runs.getFirst().next.item[1]) {\n\t\t\t\t runs.remove(runs.nth(1));\n\t\t\t\t int[] item= new int[] {1,red,green,blue};\n\t\t\t\t runs.addFirst(item);\n\t\t\t\t System.out.println(runs.toString());\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t\t\t runs.remove(runs.nth(1));\n\t\t\t\t\t runs.getFirst().item[0]=runs.getFirst().item[0]+1;\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\t }\n\t \n\t //if setPixel at the last location.\n\t else if((x==(width-1)) && (y==(height-1))) {\n\t\t if(runs.getLast().item[0]==1) {\n\t\t\t if(red!=runs.getLast().prev.item[1]) {\n\t\t\t\t int[] item= new int[] {1,red,green,blue}; \n\t\t\t\t runs.remove(runs.getLast());\n\t\t\t\t runs.addLast(item);\n\t\t }\n\t\t \n\t\t\t else {\n\t\t\t\t runs.remove(runs.getLast());\n\t\t\t\t runs.getLast().item[0]=runs.getLast().item[0]+1;\n\t\t\t }\n\t\t\t \n\t\t }\n\t\t else {\n\t\t\t int[] item= new int[] {1,red,green,blue};\n\t\t\t runs.addLast(item);\n\t\t\t runs.getLast().prev.item[0]=runs.getLast().prev.item[0]-1;\n\t\t }\n\t }\n\t \n\t //if Pixel is at a random location.\n//\t if(((x>0) && (y>0)) && ((x!=(width-1)) && (y!=(height-1))) ) {\n//\t if((x>0)&&(x!=(width-1))){\n\t else {\n\t int loc=y*(width)+x+1; \n\t int count=0;\n\t for(int i=0;i<runs.length();i++) {\n\t\t \n\t\tloc=loc-runs.nth(i+1).item[0] ;\n\t\tcount++;\n\t\tif (loc<=0) {\n\t\t\tbreak;\n\t\t}\n\t }\n\t if((loc==0) && (runs.nth(count).item[0]==1)){\n\t\t if((red!=runs.nth(count).next.item[1])&&(red!=runs.nth(count).prev.item[1])) { \n\t\t\t int[] item= new int[] {1,red,green,blue};\n\t\t\t runs.addAfter(runs.nth(count), item);\n\t\t\t runs.remove(runs.nth(count));\n\t\t }\n\t\t if((red==(runs.nth(count).next).item[1])&& (red!=runs.nth(count).prev.item[1])){\n\t\t\t runs.remove(runs.nth(count));\n\t\t\t runs.nth(count).item[0]=runs.nth(count).item[0]+1;\n\t\t }\t\n\t\t if((red==(runs.nth(count).prev).item[1])&&(red!=runs.nth(count).next.item[1])) {\n\t\t\t runs.remove(runs.nth(count));\n\t\t\t runs.nth(count).prev.item[0]=runs.nth(count).prev.item[0]+1;\n\t\t }\t\n\t\t if((red==(runs.nth(count).prev).item[1])&&(red==runs.nth(count).next.item[1])) {\n\t\t\t runs.nth(count).prev.item[0]=runs.nth(count).prev.item[0]+1+runs.nth(count).next.item[0];\n\t\t\t runs.remove(runs.nth(count));\n\t\t\t runs.remove(runs.nth(count));\n\t\t }\n\t }\n\t else if((loc==0) && (runs.nth(count).item[0]!=1)) {\n\t\t if(red!=runs.nth(count).next.item[1]) {\n\t\t\t runs.nth(count).item[0]=runs.nth(count).item[0]-1;\n\t\t\t int[] item= new int[] {1,red,green,blue};\n\t\t\t runs.addAfter(runs.nth(count), item);\t \n\t\t }\n\t\t else {\n\t\t\t runs.nth(count+1).item[0]=runs.nth(count+1).item[0]+1;\n\t\t }\t\t \n\t } \n\t else if(loc!=0) {\n\t\t \n\t\t int[] item= new int[] {1,red,green,blue};\n\n//\t\t DListNode<int[]> dup=runs.nth(count);\n//\t\t System.out.println(\"This is dup\"+dup.item[0]+\" \"+dup.item[1]+\" \"+dup.item[2]+\" \"+dup.item[0]);\t\t \n\t\t runs.addAfter(runs.nth(count), item);\n\t\t int[] dup=new int[] {runs.nth(count).item[0],runs.nth(count).item[1],runs.nth(count).item[2],runs.nth(count).item[3]};\n\t\t runs.addAfter(runs.nth(count).next, dup);\n\t\t System.out.println(runs.nth(count).item[0]+\"This is loc \"+loc+\"THis is count \"+count);\n\t\t runs.nth(count).item[0]=runs.nth(count).item[0]+loc-1;\n\t\t System.out.println(runs.nth(count).next.next.item[0]+\"This is loc \"+loc+\"THis is count \"+count);\n\t\t runs.nth(count).next.next.item[0]=runs.nth(count).next.next.item[0]+loc-1;\t\n\t\t }\n\t\t \n\t \n\t }\n check();\n}", "public void PrevTurn(){\n currentTurn = currentTurn.getAnterior();\n String turno = (String) currentTurn.getDato();\n String info[] = turno.split(\"#\");\n\n int infoIn = 4;\n for (int i = 0; i < 10; i++, infoIn += 1) {\n label_list[i].setIcon(new ImageIcon(info[infoIn]));\n this.screen.add(label_list[i]);\n }\n HP.setText(\"HP: \"+info[2]);\n action.setText(\"Action: \"+info[1]);\n mana.setText(\"Mana: \"+info[3]);\n game.setText(\"Game \"+String.valueOf(partidaNum)+\", Turn \"+info[0]);\n\n VerifyButtons();\n\n }", "private void updateSprite(){\n //facing front\n getImage().clear();\n getImage().drawImage(SHEET,-(frame%SHEET_W)*SPRITE_W,0);\n if(!goLeft) getImage().mirrorHorizontally();\n if (iframes>0&&iframes%10<5) setImage(SpriteHelper.makeWhite( getImage()));\n else frame = frame + 1 % (SHEET_H* SHEET_W);\n }", "public void flipIndexes() {\n int temp = index1;\n index1 = index2;\n index2 = temp;\n }", "public void swim() {\r\n\t\tif(super.getPosition()[0] == Ocean.getInstance().getWidth()-71){\r\n\t\t\tinvX = true;\r\n\t\t} else if(super.getPosition()[0] == 0){\r\n\t\t\tinvX = false;\r\n\t\t}\r\n\t\tif(super.getPosition()[1] == Ocean.getInstance().getDepth()-71){\r\n\t\t\tinvY = true;\r\n\t\t} else if(super.getPosition()[1] == 0){\r\n\t\t\tinvY = false;\r\n\t\t}\r\n\t\tif(invX){\r\n\t\t\tsuper.getPosition()[0]-=1;\r\n\t\t} else {\r\n\t\t\tsuper.getPosition()[0]+=1;\r\n\t\t}\r\n\t\tif(invY){\r\n\t\t\tsuper.getPosition()[1]-=1;\r\n\t\t} else {\r\n\t\t\tsuper.getPosition()[1]+=1;\r\n\t\t}\r\n\t}", "private void animateRight(){\n if(frame == 1){\n setImage(run1);\n }\n else if(frame == 2){\n setImage(run2);\n }\n else if(frame == 3){\n setImage(run3);\n }\n else if(frame == 4){\n setImage(run4);\n }\n else if(frame == 5){\n setImage(run5);\n }\n else if(frame == 6){\n setImage(run6);\n }\n else if(frame == 7){\n setImage(run7);\n }\n else if(frame == 8){\n setImage(run8);\n frame =1;\n return;\n }\n frame ++;\n }", "@Deprecated\n/* */ protected void setTextureIndex(int idx) {\n/* 94 */ setData((byte)(getData() & 0x8 | idx));\n/* */ }", "public void setPreviewCanvas()\n {\n if(grayImgToFit!=null)\n {\n canvas.beginDraw();\n for(int i = 0; i < xTiles+3; i++)\n {\n for(int j = 0; j < yTiles+1; j++)\n {\n //if(i<verticalFlip[0].length && j<verticalFlip.length)\n //{\n //if(!notShow[i][j])\n //{\n // even or odd row shift\n if(j%2 == 0)\n {\n if(verticalFlip[i][j] && ! horizontalFlip[i][j])\n {\n canvas.image(tileMiniaturesV[getTileIntensityAtIndex(i,j)],i * tileMiniaturesV[0].width + evenRowShift,j * tileMiniatures[0].height);\n }\n else if(horizontalFlip[i][j] && !verticalFlip[i][j])\n {\n canvas.image(tileMiniaturesH[getTileIntensityAtIndex(i,j)],i * tileMiniaturesH[0].width + evenRowShift,j * tileMiniatures[0].height);\n }\n else if(horizontalFlip[i][j] && verticalFlip[i][j])\n {\n canvas.image(tileMiniaturesVH[getTileIntensityAtIndex(i,j)],i * tileMiniaturesVH[0].width + evenRowShift,j * tileMiniatures[0].height);\n }\n else\n {\n canvas.image(tileMiniatures[getTileIntensityAtIndex(i,j)],i * tileMiniatures[0].width + evenRowShift,j * tileMiniatures[0].height);\n }\n }\n else\n {\n if(verticalFlip[i][j] && ! horizontalFlip[i][j])\n {\n canvas.image(tileMiniaturesV[getTileIntensityAtIndex(i,j)],i * tileMiniaturesV[0].width + oddRowShift,j * tileMiniatures[0].height);\n }\n else if(horizontalFlip[i][j] && !verticalFlip[i][j])\n {\n canvas.image(tileMiniaturesH[getTileIntensityAtIndex(i,j)],i * tileMiniaturesH[0].width + oddRowShift,j * tileMiniatures[0].height);\n }\n else if(horizontalFlip[i][j] && verticalFlip[i][j])\n {\n canvas.image(tileMiniaturesVH[getTileIntensityAtIndex(i,j)],i * tileMiniaturesVH[0].width + oddRowShift,j * tileMiniatures[0].height);\n }\n else\n {\n canvas.image(tileMiniatures[getTileIntensityAtIndex(i,j)],i * tileMiniatures[0].width + oddRowShift,j * tileMiniatures[0].height);\n }\n }\n //}\n //else\n //{\n // canvas.fill(255,255,255);\n // canvas.noStroke();\n // if(hoverIndex[1]%2 == 0)\n // canvas.rect(i * tileMiniatures[0].width + evenRowShift,j * tileMiniatures[0].height,tileMiniatures[0].width, tileMiniatures[0].height);\n // else\n // canvas.rect(i * tileMiniatures[0].width + oddRowShift,j * tileMiniatures[0].height,tileMiniatures[0].width, tileMiniatures[0].height);\n //}\n //}\n }\n }\n \n canvas.fill(0,255,0,100);\n canvas.noStroke();\n if(hoverIndex[1]%2 == 0)\n {\n canvas.rect(hoverIndex[0] * tileMiniatures[0].width + evenRowShift,hoverIndex[1] * tileMiniatures[0].height,tileMiniatures[0].width, tileMiniatures[0].height);\n }\n else\n {\n canvas.rect(hoverIndex[0] * tileMiniatures[0].width + oddRowShift,hoverIndex[1] * tileMiniatures[0].height,tileMiniatures[0].width, tileMiniatures[0].height);\n }\n canvas.endDraw();\n }\n }", "public void updateImageForIndex(int index) {\n\t\t//Nothing to do\n\t}", "private void updateDisplayChars() {\n\t\tmShuffleFrag.updateDisplayChars(mCharDisp);\n\t}", "public abstract String getIcon(int current_turn);", "public void imageRight(){\n if(index == (imageArray.size() - 1)){\n index = 0;\n }else{\n index++;\n }\n String url = imageArray.get(index);\n Picasso.with(this).load(url).into(imageView);\n }", "public void changePicture()\n\t{\n\t\twhile(usedIndex2.contains(unknownWordFileIndex))\n\t\t\tunknownWordFileIndex = r.nextInt(unknownWordFile.size());\n\t\t\n\t\t// Send to all\n\t\tfor(ConnectionThread i : connectionPool)\n\t\t{\n\t\t\ti.sendMessage(\"changePicture\");\n\t\t\ti.sendMessage(unknownWordFile.get(unknownWordFileIndex));\n\t\t}\n\t\t\t\n\t}", "@Override public BufferedImage getImg(){\n if(jumpState >= 1){\n return jumpingImg;\n }\n else\n return super.getImg();\n}", "public static void lukisImej(BufferedImage image_dest) {\n int w = image_dest.getWidth();\n int h = image_dest.getHeight();\n\n//\t\tfor(int y=0; y<h;y++)\n//\t\t{\n//\t\t\tfor(int x =0 ; x<w; x++)\n//\t\t\t{\n//\t\t\t\tif(image_dest.getRGB(x, y)==-1)\n//\t\t\t\t\tSystem.out.print(\"1\");\n//\t\t\t\telse\n//\t\t\t\t{\n//\t\t\t\t\t//System.err.print(\"X\"+x+\" Y : \"+y);\n//\t\t\t\t\t//return;\n//\t\t\t\t\tSystem.out.print(\"0\");\n//\t\t\t\t}\n//\t\t\t}\n//\t\t\tSystem.out.println(\"\");\n//\t\t}\n\n }", "@Override\n public void unDraw() {\n index--;\n }", "private int next(int index) {\n return (index + 2) & mask;\n }", "public BufferedImage recolorCard(BufferedImage img, int indexNumber) {\r\n\t\tColor color = null;\r\n\t\t//Gets the color of the player who owns that country\r\n\t\tfor (Player p : players) {\r\n\t\t\tfor (Country c : p.getCountries()) {\r\n\t\t\t\tif (currentCards.get(indexNumber).getDetectionColor() == c.getDetectionColor()) {\r\n\t\t\t\t\tcolor = p.getColor();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//Recolors the country in that card with the color found above\r\n\t\tfor (int i = 0; i < img.getWidth(); i++) {\r\n\t\t\tfor (int j = 0; j < img.getHeight(); j++) {\r\n\r\n\t\t\t\tint r = img.getRGB(i, j);\r\n\r\n\t\t\t\tif (r == currentCards.get(indexNumber).getDetectionColor().getRGB()) {\r\n\t\t\t\t\timg.setRGB(i, j, color.getRGB());\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Returns the new Recolored image\r\n\t\treturn img;\r\n\t}", "public void swapIcons() {\n\tif (image.equals(bat_2)) {\n\t image = bat_1;\n\t} else {\n\t image = bat_2;\n\t}\n }", "public void flipV() {\r\n int tmp, sym;\r\n for (int col = 0; col < pixels.length; ++col) {\r\n for (int row = 0; row < pixels[col].length / 2; ++row) {\r\n // find the column index of the vertically symmetric pixel\r\n sym = pixels[col].length - 1 - row;\r\n // swap the pixel value between the two\r\n tmp = pixels[col][row];\r\n pixels[col][row] = pixels[col][sym];\r\n pixels[col][sym] = tmp;\r\n }\r\n }\r\n this.pix2img();\r\n }", "void reset() {\n myIsJumping = myNoJumpInt;\n setRefPixelPosition(myInitialX, myInitialY);\n setFrameSequence(FRAME_SEQUENCE);\n myScoreThisJump = 0;\n // at first the cowboy faces right:\n setTransform(TRANS_NONE);\n }", "static void beforeMoveBoard()\n\t{\n\t\tint REDIX = 10;\n\t\tSystem.out.println(\"\\n\");\n\t\tfor (int i = 0; i < 10; i++)\n\t\t{\n\t\t\tif (tictactoeBoard[i] != 'x' && tictactoeBoard[i] != 'o') \n\t\t\t{\n\t\t\t\ttictactoeBoard[i] = Character.forDigit(i, REDIX);\n\t\t\t}\n\t\t}\n\t\t//showBoard();\n\t}", "protected int getImageIndex() {\n/* 216 */ return this.mlibImageIndex;\n/* */ }", "public String getImage(){\n StringBuilder sb = new StringBuilder();\n for (char[] subArray : hidden) {\n sb.append(subArray);\n sb.append(\"\\n\");\n }\n return sb.toString();\n }", "public void resetCoordinates(){\n pos=0;\n if(this.pIndex<2){\n this.coordinates[0]=TILE_SIZE*15-DICE_SIZE;}\n else{\n this.coordinates[0]=0;}\n if(this.pIndex%3==0){\n this.coordinates[1]=0;}\n else{\n this.coordinates[1]=TILE_SIZE*15-DICE_SIZE;} \n }", "private void drawNextPiece(int kind) {\n\t //TODO Use Points instead of coordinates\n int value;\n\n for(int i = 0; i < 4; i++) {\n value = 2 * (kind * 4 + i);\n g.drawImage(tile[kind + 1], nextPieceMatrix[value], nextPieceMatrix[value + 1], this);\n }\n }", "@Override\r\n\tpublic void motion() {\r\n\t\tframeCount = frameCount== IMAGE_RATE*getImages().size() ? 1 : frameCount+1; \t//count the frames\r\n\r\n\t\tif(frameCount%IMAGE_RATE == 0 || isDirectionChanged() ) {\r\n\t\t\tsetDirectionChanged(false);\r\n\r\n\t\t\tif(isLeft()) {\r\n\t\t\t\tif(imgIndex < getImages().size()/2)\r\n\t\t\t\t\timgIndex =+ getImages().size()/2;\t\t\t\t\t\t\t\t\t\t\t\t\t//Set left Images [4,5,6,7]\r\n\t\t\t\telse\r\n\t\t\t\t\timgIndex = imgIndex == getImages().size()-1 ? getImages().size()/2 : imgIndex+1; \t//if index == list.size() -1 than index will be list.size()/2\r\n\t\t\t}else {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//otherwise it will increment by 1\r\n\t\t\t\tif(imgIndex >= getImages().size()/2) \r\n\t\t\t\t\timgIndex -= 4;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Set right Images [0,1,2,3]\r\n\t\t\t\telse\r\n\t\t\t\t\timgIndex = imgIndex == getImages().size()/2 -1 ? 0 : imgIndex+1; \t\t\t\t\t//if index == list.size()/2 -1 than index will be 0\r\n\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//otherwise it will increment by 1\r\n\r\n\t\t\tsetImage(getImages().get(imgIndex));\r\n\t\t}\r\n\t}", "public static BufferedImage getCharacterImage(char c) throws CharacterNotSupportedException{\n int a = (int)'a';\n int o = (int)'o';\n int p = (int)'p';\n int z = (int)'z';\n \n int zero = (int)'0';\n int nine = (int)'9';\n \n int ac = (int)'A';\n int oc = (int)'O';\n int pc = (int)'P';\n int zc = (int)'Z';\n \n int ci = (int)c;\n \n //System.out.print(c);\n \n if(ci>=zero && ci<=nine){ \n for(int i=zero;i<=nine;i++){//from 0 to 9\n int d = i-zero;//difference between i and zero; a number from 0 to nine-zero.\n if(ci == i){\n return font.getImage(new Location(d,3));\n }\n }\n }\n else if(ci>=ac && ci<=zc){\n for(int i=ac;i<=oc;i++){//from A to O\n int d = i-ac;//difference between i and ac. a number from 0 to pc-ac.\n if(ci == i){\n return font.getImage(new Location(d+1,4));\n }\n }\n for(int j=pc;j<=zc;j++){//from P to Z\n int d = j-pc;//difference between j and pc. a number from 0 to zc-pc.\n if(ci == j){\n return font.getImage(new Location(d,5));\n }\n } \n } \n else if(ci>=a && ci<=z){\n for(int i=a;i<=o;i++){\n int d = i-a;//difference between i and a. a number from 0 to p-a.\n if(ci == i){\n return font.getImage(new Location(d+1,6));\n }\n }\n for(int j=p;j<=z;j++){//from p to z\n int d = j-p;//difference between j and p. Number from 0 to z-p.\n if(ci == j){\n return font.getImage(new Location(d,7));\n }\n } \n }\n else if(ci == ' '){//space\n return font.getImage(new Location(0,0));\n }\n else if(ci == ','){\n return font.getImage(new Location(12,2));\n }\n else if(ci == '.'){\n return font.getImage(new Location(14,2));\n }\n else if(ci == '!'){\n return font.getImage(new Location(1,2));\n }\n else if(ci == '\\''){//apostrophe or '\n return font.getImage(new Location(7,2));\n }\n else if(ci == '#'){\n return font.getImage(new Location(3,2));\n }\n else if(ci == '?'){\n return font.getImage(new Location(15,3));\n }\n else if(ci == ':'){\n return font.getImage(new Location(11,3));\n }\n else if(ci == ';'){\n return font.getImage(new Location(12,3));\n }\n \n throw new CharacterNotSupportedException(\"Character \"+c+\" is not supported in StringImage\");\n }", "public abstract void mo30698a(Canvas canvas, int i, int i2);", "private void updateTurnIconCharacteristic() {\n String editTextValue = ((EditText) view.findViewById(R.id.turnIconEditText)).getText().toString();\n String turnIcon = \"\";\n try {\n turnIcon = Integer.toHexString(Integer.parseInt(editTextValue));\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n\n //Set visibility and the turnIcon\n turnIconCharacteristic_value[16] = visibility;\n turnIconCharacteristic_value[17] = Byte.parseByte(turnIcon);\n turnIconCharacteristic.setValue(turnIconCharacteristic_value);\n }", "private void sepiaTone(){\n int len= currentIm.getRows() * currentIm.getCols();\n \n for (int p= 0; p < len; p= p+1) {\n int rgb= currentIm.getPixel(p);\n int red= DM.getRed(rgb);\n int blue= DM.getBlue(rgb);\n int green= DM.getGreen(rgb);\n int alpha= DM.getAlpha(rgb);\n \n double brightness = 0.3 * red + 0.6 * green + 0.1 * blue;\n \n currentIm.setPixel(p,\n (alpha << 24) | ((int)brightness << 16) | ((int)(brightness*0.6) << 8) | \n (int)(brightness*0.4));\n \n }\n }", "static protected int changeElimState(int index)\n\t{\n\t\treturn -index - 2;\n\t}", "public void NextTurn(){\n\n currentTurn = currentTurn.getSiguiente();\n String turno = (String) currentTurn.getDato();\n String info[] = turno.split(\"#\");\n\n int infoIn = 4;\n for (int i = 0; i < 10; i++, infoIn += 1) {\n label_list[i].setIcon(new ImageIcon(info[infoIn]));\n this.screen.add(label_list[i]);\n }\n HP.setText(\"HP: \"+info[2]);\n action.setText(\"Action: \"+info[1]);\n mana.setText(\"Mana: \"+info[3]);\n game.setText(\"Game \"+String.valueOf(partidaNum)+\", Turn \"+info[0]);\n\n VerifyButtons();\n\n }", "public void videoOriginal(BufferedImage img) {\n\t\t// update image\n\t\tcurrFrame++;\n\t\tpanel.removeAll();\n\t\tpanel.setLayout(new BorderLayout());\n\t\tJLabel label = new JLabel(new ImageIcon(img));\n\t\tlabel.setPreferredSize(new Dimension(img.getWidth(), img.getHeight()));\n\t\tpanel.add(label, BorderLayout.CENTER);\n\t\tpanel.revalidate();\n\t\tpanel.repaint();\n\t\tslider.setValue(currFrame);\n\t}", "public void originalSpace() {\n\t\tpos.x = 65;\n\t\tpos.y = p.height/2 + 100;\n\t\t\n\t}", "private char advance() {\n current++;\n return source.charAt(current - 1);\n }", "private void drawHangman() {\n\t\tupdateTextBox();\n \tif(lastImage!=null)\n\t\t\tboard.getChildren().remove(lastImage);\n \tint tries = game.getTries();\n \tSystem.out.println(\"Retrieving image from images/\" + tries + \".png\");\n \tImage img = new Image(\"images/\" + tries + \".png\");\n\t\tImageView imgView = new ImageView(img);\n\t\tlastImage = imgView;\n\t\tboard.getChildren().add(imgView);\n\t}", "public native void cycleColormapImage(int amount) throws MagickException;", "private int getInstr(int index) {\n switch (index) {\n case 0:\n return R.drawable.chickpeacurry;\n case 1:\n return R.drawable.sweetpotatoblackbeanburger;\n case 2:\n return R.drawable.cabbagedietsoup;\n case 3:\n return R.drawable.instantpotvegetablesoup;\n case 4:\n return R.drawable.veganpumpkinsoup;\n\n default:\n return -1;\n }\n }", "private void displayPrevious() {\r\n\t\ti--;\r\n\t\tdisplayCurrentPicture();\r\n\t}", "public void turnCardFaceUp(){\r\n setImage(CardFaceUp);\r\n }", "public void setTurned(){\n\tIS_TURNED = true;\n\tvimage = turnedVimImage;\n }", "public void turnCardFaceDown(){\r\n if (getImage() == CardFaceUp)\r\n setImage(Images.faceDown);\r\n else\r\n setImage(CardFaceUp);\r\n }", "static void switchOriginal() {\n\n for (Iterator<Media> Fullsize = DataItem.get(currentAlbum).iterator(); Fullsize.hasNext(); ) {\n final Media Image = Fullsize.next();\n\n if (Image.MediaID.equals(CurrentPictureId)) {\n\n int imageWidth = Window.getClientWidth() - 200;\n\n FULLSIZE.setUrl(base + Image.MediaFullsizePath + \"&size=\" + imageWidth);\n FULLSIZE.setVisible(true);\n showDescription(Image);\n } else {\n DOM.getElementById(Image.MediaID).removeClassName(\"active\");\n }\n\n Action.showOriginal();\n }\n }", "public void nextIcon() {\n Profile profile = null;\n String playerPicked = playerList.getSelectionModel().getSelectedItem();\n try {\n profile = Profile.readProfile(playerPicked);\n profile.setLevel();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n playerIcon.setOpacity(1);\n currentIndex++;\n if (currentIndex == 0) {\n playerIcon.setImage(icon0);\n } else if (currentIndex == 1) {\n playerIcon.setImage(icon1);\n if (!profilePicLevelCheck(currentIndex, profile.getLevel())) {\n playerIcon.setOpacity(0.5);\n }\n\n } else if (currentIndex == 2) {\n if (!profilePicLevelCheck(currentIndex, profile.getLevel())) {\n playerIcon.setOpacity(0.5);\n }\n playerIcon.setImage(icon2);\n\n } else if (currentIndex == 3) {\n playerIcon.setImage(icon3);\n if (!profilePicLevelCheck(currentIndex, profile.getLevel())) {\n playerIcon.setOpacity(0.5);\n }\n\n } else if (currentIndex == 4) {\n playerIcon.setImage(icon4);\n if (!profilePicLevelCheck(currentIndex, profile.getLevel())) {\n playerIcon.setOpacity(0.5);\n }\n\n } else if (currentIndex == 5) {\n playerIcon.setImage(icon5);\n if (!profilePicLevelCheck(currentIndex, profile.getLevel())) {\n playerIcon.setOpacity(0.5);\n }\n\n } else if (currentIndex == 6) {\n playerIcon.setImage(icon6);\n if (!profilePicLevelCheck(currentIndex, profile.getLevel())) {\n playerIcon.setOpacity(0.5);\n }\n\n } else if (currentIndex == 7) {\n playerIcon.setImage(icon0);\n currentIndex = 0;\n playerIcon.setOpacity(1);\n }\n }", "public void actionPerformed(ActionEvent e)\n {\n if(jumpState != 2){\n //if the player is not jumping this if else statement will\n //change the character from leg out to leg in position\n if(jumpState == 1){\n //sets the image to have the leg in\n jumpState = 0;\n }\n else{\n //sets the image to have the leg out\n jumpState = 1;\n }\n\n }\n\n }", "public void verticalFlip(Image im, int x, int y, int pixels, GraphicsContext gc2) {\n //permite que la imagen se pueda editar\n imageView = new ImageView(im);\n SnapshotParameters snap = new SnapshotParameters();\n //selecciona el bloque que se va a voltear\n snap.setViewport(new Rectangle2D(x, y, pixels, pixels));\n im = imageView.snapshot(snap, null);\n //voltea la imagen\n gc2.drawImage(im, 0, 0, pixels, pixels, x + pixels, y, -pixels, pixels);\n }", "public void replace() {\n\t\tArrayList<Point> points = nullPoint();\n\t\twhile(0 < points.size()) {\n\t\t\tPoint p = points.get(0); //only get the first one \n\t\t\tif(p.x==0) { //if p is in first column\n\t\t\t\tset(p,_colorFileNames.get(_rand.nextInt(_colorFileNames.size()))); //set a new string\n\t\t\t}\n\t\t\telse { \n\t\t\t\texchange(p, new Point(p.x-1,p.y)); //exchange with the string above\n\t\t\t}\n\t\t\tpoints = nullPoint(); //renew the arraylist, will exclude the fist point\n\t\t} //end loop when there are is no null point\n\t}", "private void changeCurIndex() {\n\t\tint TexID=-1;\r\n\t\tif(ApplicationInfo.Destination == Constants.TO_FRONT)\r\n\t\t{\r\n\t\t\tCurIndex=++CurIndex >= mApplications.size()? 0 : CurIndex;\r\n\t\t\tif((TexID=mApplications.get(getPreIndex()).getReady()) != -1)\r\n\t\t\t\tunSetTexID(TexID);\r\n \t\t\tmApplications.get(getPreIndex()).setReady(-1);\r\n\t\t}\r\n\t\telse if(ApplicationInfo.Destination == Constants.TO_BACK)\r\n\t\t{\r\n\t\t\tCurIndex=--CurIndex < 0? mApplications.size()-1 : CurIndex;\r\n\t\t\tif((TexID=mApplications.get(getNextIndex()).getReady()) != -1)\r\n\t\t\t\tunSetTexID(TexID);\r\n\t\t\tmApplications.get(getNextIndex()).setReady(-1);\r\n\t\t}\r\n\t\tLog.d(TAG, \"changeCurIndex :\"+CurIndex);\r\n\t}", "public void change_sword_pos() {\n\t\tif (!heroi.isArmado())\n\t\t\tlabirinto.setLabCell(espada.getX_coord(), espada.getY_coord(), 'E');\n\t}", "public void hintClicked(View v) {\n if (this.currentAnswer.length() == this.selectedLength && this.gameOver) {\n Toast toast = Toast.makeText(getApplicationContext(), \"You already have the correct answer\", Toast.LENGTH_LONG);\n toast.show();\n return;\n }\n int hintIndex = this.hintGenerator.getHint(this.currentAnswer, this.selectedWord);\n Toast toast = Toast.makeText(getApplicationContext(), \"The next letter is \" + this.selectedWord.charAt(hintIndex), Toast.LENGTH_SHORT);\n toast.show();\n\n ImageView hintImageView = (ImageView) this.answerLayout.getChildAt(hintIndex);\n ImageView hintTile = null;\n boolean hintTileFound = false;\n while (hintImageView != null) {\n\n if (hintIndex >= this.answerLayout.getChildCount()) {\n hintImageView = null;\n } else {\n ImageView iv = (ImageView) this.answerLayout.getChildAt(hintIndex);\n\n\n this.answerLayout.removeView(iv);\n this.imageLayout.addView(iv);\n\n\n if(iv.getContentDescription().equals(String.valueOf(this.selectedWord.charAt(hintIndex))) && !hintTileFound) {\n hintTile = iv;\n hintTileFound = true;\n }\n }\n }\n\n if (hintTile == null) {\n int index = 0;\n hintTile = (ImageView) this.imageLayout.getChildAt(index);\n while (!hintTile.getContentDescription().equals(String.valueOf(this.selectedWord.charAt(hintIndex)))) {\n index++;\n hintTile = (ImageView) this.imageLayout.getChildAt(index);\n }\n }\n\n this.imageLayout.removeView(hintTile);\n this.answerLayout.addView(hintTile);\n this.checkAnswer();\n }", "private void AnimateandSlideShow() {\n\n\t\tslidingimage = (ImageView) findViewById(R.id.ImageView3_Left);\n\t\t// Log.i(\"bitarray\", Integer.toString(bit_array.length));\n\t\tslidingimage.setImageBitmap(bit_array[currentimageindex\n\t\t\t\t% bit_array.length]);\n\n\t\tcurrentimageindex++;\n\n\t\tAnimation rotateimage = AnimationUtils.loadAnimation(this,\n\t\t\t\tR.anim.custom_anim);\n\n\t\tslidingimage.startAnimation(rotateimage);\n\n\t}", "void moveNext()\n\t{\n\t\tif (cursor != null) \n\t\t{\n\t\t\tif (cursor == back) \n\t\t\t{\n\t\t\t\tcursor = null;\n index = -1; //added cause i was failing the test scripts and forgot to manage the indices \n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcursor = cursor.next; //moves cursor toward back of the list\n index++; //added cause i was failing to the test scripts and forgot to manage the indicies\n\t\t\t}\n\t\t}\n\t}", "public void reverseFrame() {\r\n if (reversedImage) {\r\n reversedImage = false;\r\n } else {\r\n reversedImage = true;\r\n }\r\n }", "private void showTheMove() {\n\r\n updateTicTacToeShape();\r\n for (int ii=0; ii<5; ii++) {\r\n System.out.println(ticTacToeShape[ii]);\r\n }\r\n }", "private void drawFaceDown(Graphics g, int x, int y) throws IOException{\n\t\tImageIcon img;\n\t\timg = new ImageIcon(ImageIO.read(new File(relativePath + \"faceDown.png\")));\n\t\tImage card1 = img.getImage();\n\t\tImage card1New = card1.getScaledInstance(45, 65, java.awt.Image.SCALE_SMOOTH);\n\t\tImageIcon card1Icon = new ImageIcon(card1New);\n\t\tcard1Icon.paintIcon(this, g, x, y);\n\t }", "public static void main(String[] args)\n {\n \n //opens selfie picture \n /**/ \n //relative path\n //og pics\n Picture apic = new Picture(\"images/selfie.jpg\");\n Picture obama = new Picture(\"images/obama.jpg\");\n apic.explore();\n obama.explore();\n\n //change with selfie picture\n Picture me = new Picture(\"images/selfie.jpg\"); \n Picture me1 = new Picture(\"images/selfie.jpg\");\n Picture me2 = new Picture(\"images/selfie.jpg\");\n \n //initializes array pix\n Pixel[] pix;\n \n /**\n * method 1 change\n * divides colors into 4 equal groups\n */\n //initializes vars for rgb values\n int red;\n int blue;\n int green;\n pix = me.getPixels(); \n \n for (Pixel spot: pix) {\n //gets rgb values of colors\n red = spot.getRed();\n blue = spot.getBlue();\n green = spot.getGreen();\n \n //if pixel under a certain value then the color is changed\n if (red < 63 && blue < 63 && green < 63) {\n spot.setColor(new Color(2, 32, 62));\n }\n else if (red < 127 && blue < 127 && green < 127) {\n spot.setColor(new Color(198, 37, 8));\n }\n else if (red < 191 && blue < 191 && green < 191) {\n spot.setColor(new Color(102, 157, 160));\n }\n else {\n spot.setColor(new Color(250, 238, 192));\n }\n }\n me.explore();\n me.write(\"images/selfie1.jpg\");\n\n /**\n * method 2 change\n * changes color based on intensity using max and min grayscale values\n */\n pix = me1.getPixels(); \n int s = 0; //smallest pix value\n int b = 255; //largest pix value\n int ave;\n int quads; //size of four equal range of colors\n \n for (Pixel spot: pix) {\n red = spot.getRed();\n blue = spot.getBlue();\n green = spot.getGreen();\n \n ave = (red + blue + green)/3;\n if (ave > b) { //gets maximum grayscale\n b = ave;\n }\n if (ave < s) { //gets min grayscale\n s = ave;\n }\n quads = (b-s)/4; //divides range of pix values into 4\n \n //sees if pixel value is less than the factor of quad\n if (red < quads && blue < quads && green < quads) {\n spot.setColor(new Color(2, 32, 62));\n }\n else if (red < quads*2 && blue < quads*2 && green < quads*2 ) {\n spot.setColor(new Color(198, 37, 8));\n }\n else if (red < quads*3 && blue < quads*3 && green < quads*3) {\n spot.setColor(new Color(102, 157, 160));\n }\n else {\n spot.setColor(new Color(250, 238, 192));\n }\n }\n me1.explore();\n me1.write(\"images/selfie2.jpg\");\n \n /**\n * custom color palette\n */\n pix = me2.getPixels();\n \n for (Pixel spot: pix) {\n red = spot.getRed();\n blue = spot.getBlue();\n green = spot.getGreen();\n \n //sets color to new value if under a certain value\n if (red < 63 && blue < 63 && green < 63) {\n spot.setColor(new Color(77, 105, 170));\n }\n else if (red < 127 && blue < 127 && green < 127) {\n spot.setColor(new Color(71, 183, 116));\n }\n else if (red < 191 && blue < 191 && green < 191) {\n spot.setColor(new Color(254, 129, 99));\n }\n else {\n spot.setColor(new Color(254, 202, 99));\n }\n }\n me2.explore();\n me2.write(\"images/selfie3.jpg\");\n \n }", "public int getOutputPositionIncrement () { return 1; }", "@Override\n protected void animateWalking() {\n if (seqIdx > 7) {\n seqIdx = 0;\n }\n if (walking) {\n this.setImage(\"images/bat/bat_\" + seqIdx + FILE_SUFFIX);\n } else {\n this.setImage(\"images/bat/bat_0.png\");\n }\n seqIdx++;\n }", "void setIdx(int i);", "public void invert() {\n int len= currentIm.getRows() * currentIm.getCols();\n \n // invert all pixels (leave alpha/transparency value alone)\n \n // invariant: pixels 0..p-1 have been complemented.\n for (int p= 0; p < len; p= p+1) {\n int rgb= currentIm.getPixel(p);\n int red= 255 - DM.getRed(rgb);\n int blue= 255 - DM.getBlue(rgb);\n int green= 255 - DM.getGreen(rgb);\n int alpha= DM.getAlpha(rgb);\n currentIm.setPixel(p,\n (alpha << 24) | (red << 16) | (green << 8) | blue);\n }\n }", "private void replace( int ix, int len, short code, boolean deleted[] )\n {\n text[ix] = code;\n \n Arrays.fill( deleted, ix+1, ix+len, true );\n }" ]
[ "0.6001071", "0.5709833", "0.569863", "0.55183333", "0.54265803", "0.5388177", "0.53675985", "0.53640926", "0.5345035", "0.53412163", "0.53276926", "0.5305277", "0.5303858", "0.5288589", "0.52764326", "0.5273455", "0.52572876", "0.5236298", "0.5211684", "0.513238", "0.51193243", "0.51147836", "0.51146805", "0.5099054", "0.50981027", "0.50886977", "0.5073512", "0.5067551", "0.50640905", "0.5058118", "0.5053288", "0.50288683", "0.50176454", "0.50102484", "0.49981236", "0.49946958", "0.49803075", "0.49776524", "0.49731", "0.4971576", "0.49658", "0.49598584", "0.49563062", "0.4952566", "0.49499723", "0.49495697", "0.4946006", "0.4934399", "0.49284598", "0.4927424", "0.49226204", "0.4921371", "0.49096256", "0.49066082", "0.49064308", "0.4905234", "0.49014872", "0.48996997", "0.4896979", "0.48962918", "0.4895448", "0.48891294", "0.48879382", "0.48724666", "0.48723936", "0.48722288", "0.48689863", "0.4868971", "0.48589173", "0.4858789", "0.48546568", "0.48429322", "0.483601", "0.4835577", "0.48351222", "0.4834199", "0.4833212", "0.48307654", "0.48236406", "0.48235428", "0.4823347", "0.48215678", "0.48211455", "0.48160273", "0.48137626", "0.4811843", "0.4811691", "0.4810123", "0.4809262", "0.48068127", "0.4803112", "0.48026693", "0.4792196", "0.47772378", "0.47726488", "0.4772576", "0.47693467", "0.47668245", "0.47624922", "0.47542956" ]
0.7525301
0
Constructs an instance of administration command executor using REST interface.
public RunnerRestDeploy(final GlassFishServer server, final Command command) { super(server, command); this.command = (CommandDeploy)command; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "AdminConsole createAdminConsole();", "public Admin createAdmin(){\n\t\ttry {\n\t\t\treturn conn.getAdmin();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t}", "public interface AdminOperations\n{\n\t/* constants */\n\t/* operations */\n\torg.jacorb.imr.HostInfo[] list_hosts();\n\torg.jacorb.imr.ServerInfo[] list_servers();\n\torg.jacorb.imr.ServerInfo get_server_info(java.lang.String name) throws org.jacorb.imr.UnknownServerName;\n\tvoid shutdown(boolean _wait);\n\tvoid save_server_table() throws org.jacorb.imr.AdminPackage.FileOpFailed;\n\tvoid register_server(java.lang.String name, java.lang.String command, java.lang.String host) throws org.jacorb.imr.AdminPackage.IllegalServerName,org.jacorb.imr.AdminPackage.DuplicateServerName;\n\tvoid unregister_server(java.lang.String name) throws org.jacorb.imr.UnknownServerName;\n\tvoid edit_server(java.lang.String name, java.lang.String command, java.lang.String host) throws org.jacorb.imr.UnknownServerName;\n\tvoid hold_server(java.lang.String name) throws org.jacorb.imr.UnknownServerName;\n\tvoid release_server(java.lang.String name) throws org.jacorb.imr.UnknownServerName;\n\tvoid start_server(java.lang.String name) throws org.jacorb.imr.ServerStartupFailed,org.jacorb.imr.UnknownServerName;\n\tvoid unregister_host(java.lang.String name) throws org.jacorb.imr.AdminPackage.UnknownHostName;\n}", "public CommandMAN() {\n super();\n }", "public Backend() {\t\t\n\t\tthis.rpc = new HttpPost(Backend.URL_BASE + Backend.URL_PATH_RPC);\n\t\tthis.rpc.setHeader(Backend.HEADER_CONTENT_TYPE, Backend.HEADER_VALUE_CONTENT_TYPE);\n\t\t\n\t\tthis.shutdown = new HttpGet(Backend.URL_BASE + Backend.URL_PATH_SHUTDOWN);\n\t\tthis.ping = new HttpGet(Backend.URL_BASE + Backend.URL_PATH_PING);\n\t\tthis.guid = new HttpGet(Backend.URL_BASE + Backend.URL_PATH_GUID);\n\t\t\n\t\tFile basePath = new File(\"\");\n\t\ttry {\n\t\t\tbasePath = new File(FileLocator.toFileURL(Activator.getDefault().getBundle().getEntry(\"/\")).toURI());\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(\"Could not resolve bundle absolute path.\");\n\t\t\tSystem.err.print(e);\n\t\t}\n\t\t\n\t\tthis.processRunner.setProcessPath(new File(basePath, Backend.NODE_PATH).getAbsolutePath());\n\t\tthis.processRunner.setArguments(\n\t\t\tnew File(basePath, Backend.APPLICATION_ENTRY_PATH).getAbsolutePath(),\n\t\t\tBackend.APPLICATION_OPTIONS\n\t\t);\n\t}", "HospitalCommand provideCommand(String uri);", "public CreateUserCommand() {\n userReceiver = new UserReceiver();\n roleReceiver = new RoleReceiver();\n next = new GetRolesCommand();\n result = new CommandResult();\n }", "public CommandDirector() {\n\t\t//factory = ApplicationContextFactory.getInstance();\n\t\t//context = factory.getClassPathXmlApplicationContext();\n\t\t\n\t\t//commands.put(\"createEntry\", context.getBean(\"creationEntryCommand\", CreationEntryCommand.class));\n\t\t//commands.put(\"searchEntry\", context.getBean(\"searchingEntryCommand\", SearchingEntryCommand.class));\n\t\t\n\t\tcommands.put(\"createEntry\", new CreationEntryCommand());\n\t\tcommands.put(\"searchEntry\", new SearchingEntryCommand());\n\t\t\n\t}", "public CommandFactory() {\n command = new HashMap<>();\n command.put(\"GET/login\", new EmptyCommand());\n command.put(\"POST/login\", new LoginCommand());\n command.put(\"GET/admin\", new ForwardToProfileCommand(Pages.ADMIN_PATH, Pages.USER_PATH));\n command.put(\"GET/user\", new ForwardToProfileCommand(Pages.ADMIN_PATH, Pages.USER_PATH));\n command.put(\"GET/profile\", new ForwardToProfileCommand(Pages.ADMIN_PATH, Pages.USER_PATH));\n command.put(\"POST/ban\", new BanUserCommand());\n command.put(\"POST/changelang\", new ChangeLanguageCommand());\n command.put(\"POST/unban\", new UnbanUserCommand());\n command.put(\"POST/add\", new AddPublicationCommand());\n command.put(\"POST/delete\", new DeletePublicationCommand());\n command.put(\"GET/main\", new ForwardToMainCommand());\n command.put(\"GET/controller/error\", new ForwardToErrorCommand());\n command.put(\"GET/logout\", new LogoutCommand());\n command.put(\"POST/subscribe\", new SubscribeCommand());\n command.put(\"POST/unsubscribe\", new UnsubscribeCommand());\n command.put(\"POST/changename\", new ChangeNameCommand());\n command.put(\"POST/changepassword\", new ChangePasswordCommand());\n command.put(\"POST/adminchangename\", new SetUserNameCommand());\n command.put(\"POST/changebalance\", new SetUserBalanceCommand());\n command.put(\"POST/changepublicationprice\", new SetPublicationPriceCommand());\n command.put(\"POST/changepublicationname\", new SetPublicationNameCommand());\n command.put(\"POST/changepublicationtype\", new SetPublicationTypeCommand());\n command.put(\"GET/admin/publications\", new ForwardToProfileCommand(Pages.PUBLICATIONS_PATH, Pages.USER_PATH));\n command.put(\"GET/user/payments\", new ForwardToProfileCommand(Pages.ADMIN_PATH, Pages.PAYMENTS_PATH));\n command.put(\"GET/admin/users\", new ForwardToProfileCommand(Pages.USERS_PATH, Pages.USERS_PATH));\n command.put(\"POST/login/restore\", new RestorePasswordCommand());\n\n }", "public CommandManager() {}", "Command createCommand();", "private void createAdminClient(String address, Integer port, String user,\n\t\t\tString password) throws Exception {\n\t\tProperties connectProps = new Properties();\n\t\tconnectProps.setProperty(AdminClient.CONNECTOR_TYPE,\n\t\t\t\tAdminClient.CONNECTOR_TYPE_SOAP);\n\t\tconnectProps.setProperty(AdminClient.CONNECTOR_SECURITY_ENABLED, address.startsWith(\"https\")? \"true\":\"false\");\n\t\tconnectProps.setProperty(AdminClient.CONNECTOR_HOST, address.replace(\"https://\", \"\"));\n\t\tconnectProps.setProperty(AdminClient.CONNECTOR_PORT, port.toString());\n\t\tconnectProps.setProperty(AdminClient.USERNAME, user);\n\t\tconnectProps.setProperty(AdminClient.PASSWORD, password);\n\t\ttry {\n\t\t\tadminClient = AdminClientFactory.createAdminClient(connectProps);\n\t\t} catch (ConnectorException e) {\n\t\t\tSystem.out.println(\"Exception creating admin client: \" + e);\n\t\t\tthrow new Exception(e);\n\t\t}\n\n\t\tSystem.out.println(\"Connected to DeploymentManager\");\n\t}", "public RgwAdmin build() {\n if (Stream.of(accessKey, secretKey, endpoint).anyMatch(Strings::isNullOrEmpty)) {\n throw new IllegalArgumentException(\"Missing required parameter to build the instance.\");\n }\n return new RgwAdminImpl(accessKey, secretKey, endpoint);\n }", "public GetAdminClassServlet() {\n\t\tsuper();\n\t}", "public interface AdminCommandContext extends ExecutionContext, Serializable {\n \n /**\n * Returns the Reporter for this action\n * @return ActionReport implementation suitable for the client\n */\n public ActionReport getActionReport();\n /**\n * Change the Reporter for this action\n * @param newReport The ActionReport to set.\n */\n public void setActionReport(ActionReport newReport);\n\n /**\n * Returns the Logger\n * @return the logger\n */\n public Logger getLogger();\n\n /**\n * Returns the inbound payload, from the admin client, that accompanied\n * the command request.\n *\n * @return the inbound payload\n */\n public Payload.Inbound getInboundPayload();\n\n /**\n * Changes the inbound payload for this action.\n *\n * @param newInboundPayload inbound payload to set.\n */\n public void setInboundPayload(Payload.Inbound newInboundPayload);\n\n /**\n * Returns a reference to the outbound payload so a command implementation\n * can populate the payload for return to the admin client.\n *\n * @return the outbound payload\n */\n public Payload.Outbound getOutboundPayload();\n\n /**\n * Changes the outbound payload for this action.\n *\n * @param newOutboundPayload outbound payload to set.\n */\n public void setOutboundPayload(Payload.Outbound newOutboundPayload);\n\n /**\n * Returns the Subject associated with this command context.\n *\n * @return the Subject\n */\n public Subject getSubject();\n\n /**\n * Sets the Subject to be associated with this command context.\n *\n * @param subject\n */\n public void setSubject(Subject subject);\n \n /** \n * ProgressStatus can be used to inform about step by step progress \n * of the command. It is always ready to use but propagated to \n * the client only if {@code @Progress} annotation is on the command\n * implementation.\n */\n public ProgressStatus getProgressStatus();\n \n /** Simple event broker for inter command communication mostly\n * from server to client. (Command to caller).\n */\n public AdminCommandEventBroker getEventBroker();\n \n \n /** Id of current job. Only managed commands has job id.\n */\n public String getJobId();\n\n}", "RemoteActuator createRemoteActuator();", "public interface CommandProvider {\n /**\n * Provide command hospital command.\n *\n * @param uri the uri\n * @return the hospital command\n */\n HospitalCommand provideCommand(String uri);\n}", "public Admin() {\n\n\t}", "public UtilClient(String[] args) \n {\n \n //set reference to args parameter\n this._args = args;\n this._parser = new UtilCmdParser();\n\n \n //set the restart directory\n// String restartdir = System.getProperty(Constants.PROPERTY_RESTART_DIR);\n// if (restartdir == null) \n// {\n// restartdir = System.getProperty(Constants.PROPERTY_USER_HOME);\n// if (restartdir == null)\n// restartdir = System.getProperty(\"user.home\") + File.separator\n// + Constants.RESTARTDIR;\n// }\n// this._restartDir = restartdir + File.separator + Constants.RESTARTDIR;\n// this._loginFile = this._restartDir + File.separator + Constants.LOGINFILE;\n \n \n //set the values of properties\n //this._domainFile = System.getProperty(Constants.PROPERTY_DOMAIN_FILE);\n \n this._domainFilename = System.getProperty(Constants.PROPERTY_DOMAIN_FILE);\n this._userScript = System.getProperty(Constants.PROPERTY_USER_APPLICATION);\n this._userOperation = System.getProperty(Constants.PROPERTY_USER_OPERATION);\n this._queryInterval = System.getProperty(Constants.PROPERTY_QUERY_INTERVAL);\n \n //get the action id based on the operation name\n //this._actionId = ActionTable.toId(this._userOperation);\n this._actionId = ActionTable.toId(this._userOperation);\n \n }", "public admin() {\n\t\tsuper();\n\t}", "public Command() {\r\n\t\t// If default, use a local one.\r\n\t\tmYCommandRegistry = LocalCommandRegistry.getGlobalRegistryStatic();\r\n\t}", "public NewCommand(ApplicationData data) {\n super(\"NewCommand\");\n this.data = data;\n // configure log4j using resource URL APF-548\n DOMConfigurator.configure(getClass().getResource(\"/META-INF/log4j.xml\"));\n log = getLogger(NewCommand.class);\n\n }", "Commands createCommands();", "private CommandFactory( ThreadGroup mainThreadGroup ) {\n this.mainThreadGroup = mainThreadGroup;\n \n map = new HashMap<String, String>();\n\n map.put( \"LS\", \"org.ajstark.LinuxShell.Command.LsCommand\" );\n map.put( \"GREP\", \"org.ajstark.LinuxShell.Command.GrepCommand\" );\n map.put( \"PWD\", \"org.ajstark.LinuxShell.Command.PwdCommand\" );\n map.put( \"CD\", \"org.ajstark.LinuxShell.Command.CdCommand\" );\n map.put( \"ENV_VAR\", \"org.ajstark.LinuxShell.Command.SetEnvVarCommand\" );\n map.put( \"ENV\", \"org.ajstark.LinuxShell.Command.EnvCommand\" );\n map.put( \"HISTORY\", \"org.ajstark.LinuxShell.Command.HistoryCommand\" );\n }", "public Executor getExecutor() {\n Object o = getReference(\"ant.executor\");\n if (o == null) {\n String classname = getProperty(\"ant.executor.class\");\n if (classname == null) {\n classname = DefaultExecutor.class.getName();\n }\n log(\"Attempting to create object of type \" + classname, MSG_DEBUG);\n try {\n o = Class.forName(classname, true, coreLoader).newInstance();\n } catch (ClassNotFoundException seaEnEfEx) {\n //try the current classloader\n try {\n o = Class.forName(classname).newInstance();\n } catch (Exception ex) {\n log(ex.toString(), MSG_ERR);\n }\n } catch (Exception ex) {\n log(ex.toString(), MSG_ERR);\n }\n if (o == null) {\n throw new BuildException(\n \"Unable to obtain a Target Executor instance.\");\n }\n setExecutor((Executor) o);\n }\n return (Executor) o;\n }", "private Command() {\n initFields();\n }", "private void createRemoteAdministration(\n String routingServiceName,\n ConfigurationFilterProvider configurationFilterProvider\n ) {\n checkArgument(\n !Strings.isNullOrEmpty(routingServiceName),\n \"Routing Service name is expected not to be null or empty\"\n );\n checkNotNull(\n configurationFilterProvider,\n \"Configuration Filter Provider must not be null\"\n );\n\n // create domain participant for administration interface and ensure it will be enabled\n domainParticipantAdministration = createRemoteAdministrationDomainParticipant(\n Integer.parseInt(StringSubstitutor.replace(getProperty(PROPERTY_ADMINISTRATION_DOMAIN_ID), System.getenv()))\n );\n domainParticipantAdministration.enable();\n\n // create routing service administration\n routingServiceCommandInterface = new RoutingServiceCommandInterface(\n domainParticipantAdministration);\n\n // wait for routing service to be discovered\n LOGGER.info(\"Waiting for remote administration interface of routing service to be discovered\");\n if (routingServiceCommandInterface.waitForDiscovery(\n routingServiceName,\n Long.parseLong(StringSubstitutor.replace(\n getProperty(\n PROPERTY_ADMINISTRATION_DISCOVERY_WAIT_TIME,\n DEFAULT_PROPERTY_ADMINISTRATION_DISCOVERY_WAIT_TIME\n ),\n System.getenv()\n )),\n TimeUnit.MILLISECONDS)) {\n LOGGER.info(\"Remote administration interface of routing service was discovered\");\n } else {\n LOGGER.warn(\"Remote administration interface of routing service could not be discovered within time out\");\n }\n\n // create commander\n dynamicPartitionCommanderRemote = new DynamicPartitionCommander(\n routingServiceCommandInterface,\n configurationFilterProvider,\n routingServiceName,\n Long.parseLong(StringSubstitutor.replace(\n getProperty(\n PROPERTY_ADMINISTRATION_REQUEST_RETRY_DELAY,\n DEFAULT_PROPERTY_ADMINISTRATION_REQUEST_RETRY_DELAY\n ),\n System.getenv()\n )),\n TimeUnit.MILLISECONDS,\n Long.parseLong(StringSubstitutor.replace(\n getProperty(\n PROPERTY_ADMINISTRATION_REQUEST_TIMEOUT,\n DEFAULT_PROPERTY_ADMINISTRATION_REQUEST_TIMEOUT\n ),\n System.getenv()\n )),\n TimeUnit.MILLISECONDS\n );\n\n // add listener to dynamic partition observer\n dynamicPartitionObserver.addListener(dynamicPartitionCommanderRemote);\n }", "interface ServerSideCommand extends RemoteApiCommand {\n\n /** An http connection to AppEngine. */\n interface Connection {\n\n void prefetchXsrfToken();\n\n /** Send a POST request. TODO(mmuller): change to sendPostRequest() */\n String send(\n String endpoint, Map<String, ?> params, MediaType contentType, @Nullable byte[] payload)\n throws IOException;\n\n String sendGetRequest(String endpoint, Map<String, ?> params) throws IOException;\n\n Map<String, Object> sendJson(String endpoint, Map<String, ?> object) throws IOException;\n\n String getServerUrl();\n }\n\n void setConnection(Connection connection);\n}", "public AdminFacade() {\n super();\n }", "public ConsoleController() {\n\t\tcommandDispatch = new CommandDispatch();\n\t}", "public RoutingCommandImpl() {\n }", "public interface AdminController {\n\n Admin login(Admin admin) throws SQLException;\n\n List<Admin> listAdmin(String adminName, String adminRole) throws SQLException;\n\n int addAdmin(Admin admin) throws SQLException;\n\n boolean delete(Long id) throws SQLException;\n\n boolean updateAdmin(Admin admin) throws SQLException;\n}", "public RemoteControl() {\n onCommands = new ArrayList<Command>(7); // concrete command.Command registers itself with the invoker\n offCommands = new ArrayList<Command>(7);\n\n Command noCommand = new NoCommand(); //Good programming practice to create dummy objects like this\n for (int i = 0;i < 7;i++) {\n onCommands.add(noCommand);\n }\n\n //Initialize the off command objects\n for (int i = 0;i < 7;i++) {\n offCommands.add(noCommand);\n }\n\n undoCommand = noCommand;\n }", "public AdministratorImpl() {\n\n\t}", "public interface Command {\r\n String execute(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException;\r\n}", "public AbstractTtcsCommandController() {\n\t}", "public interface CliApi {\n\n @GET(\"/api/ping\")\n Pong ping();\n\n /**\n * Fetch and note by type.\n * <p>\n * <code>\n * http://localhost:5050/cli/cmd/update_docker?k=label&n=2\n * </code>\n *\n * @param key key for the fetching\n * @param keyType type of the key, default is 'id', could be 'id' or 'label'\n * @param num number of articles to return, default is 1\n * @return the note resource\n */\n @GET(\"/cli/cmd/{key}\")\n PagedResponse<NoteResult> getNote(@Path(\"key\") String key, @Query(\"k\") String keyType, @Query(\"n\") int num);\n\n @POST(\"/cli/cmd\")\n SaveCmdResponse saveCmd(@Body SaveCmdRequest request);\n\n @DELETE(\"/cli/cmd/{id}\")\n IdResponse deleteItem(@Path(\"id\") String id);\n\n @POST(\"/cli/search\")\n PagedResponse<NoteResult> search(@Body CliSearchRequest request);\n\n}", "public interface ActionCommand {\n String execute(HttpServletRequest request);\n\n}", "public AdminCommandList(final JDealsController sysCtrl) {\n super(\"Admin Menu\", sysCtrl);\n\n this.addItem(\"Insert an item\", new Callable() {\n @Override\n public Object call() throws Exception {\n return new ItemMenu(sysCtrl).runMenu();\n }\n });\n this.addItem(\"Delete an item\", new Callable() {\n @Override\n public Boolean call() throws Exception {\n return delItem();\n }\n });\n this.addItem(\"List current active offers\", new Callable() {\n @Override\n public Object call() throws Exception {\n return new ListOrderMenu(sysCtrl, false).runMenu();\n }\n });\n this.addItem(\"List expired offers\", new Callable() {\n @Override\n public Object call() throws Exception {\n return new ListOrderMenu(sysCtrl, true).runMenu();\n }\n });\n }", "public interface Command {\n\t public String execute(String[] request);\n}", "public APIOperation()\n {\n super();\n }", "API createAPI();", "CommandHandler() {\n registerArgument(new ChallengeCmd());\n registerArgument(new CreateCmd());\n }", "public interface ICommand {\r\n public List<String> getRights();\r\n public String execute() throws ServletException, IOException;\r\n}", "public SoapAdminDispatcher() {\n\t interfaceMappings = new Hashtable();\n\t //Small hashtable for determing the query interface.\n\t interfaceMappings.put(\"http://www.astrogrid.org/wsdl/RegistryUpdate/v0.1\",\"0.1\");\t \n\t interfaceMappings.put(\"http://www.astrogrid.org/wsdl/RegistryUpdate/v1.0\",\"1.0\");\t \n\t \n }", "public interface Command {\n /**\n * @param request from browser\n * @return String page\n */\n String execute(HttpServletRequest request);\n}", "public interface ICommand {\r\n \r\n /**\r\n * method execute some command\r\n * @param request\r\n * @param response\r\n * @return\r\n * @throws ServletException\r\n * @throws IOException \r\n */\r\n public String execute(HttpServletRequest request, \r\n HttpServletResponse response) throws ServletException, IOException;\r\n}", "public Administrator() {\n // no-agrs constructor (ham dung khong tham so)\n }", "public interface AdminService {\n public void addAdmin(Admin admin);\n\n public Admin queryAdmin(String username, String password);\n\n public void deleteAdmin(Admin admin);\n}", "public Command(){\n \n comando.put(\"!addGroup\", 1);\n comando.put(\"!addUser\", 2);\n comando.put(\"!delFromGroup\", 3);\n comando.put(\"!removeGroup\", 4);\n comando.put(\"!upload\", 5);\n comando.put(\"!listUsers\",6);\n comando.put(\"!listGroups\",7);\n\n }", "public AdminController()\n { \n int totalNumAdmin = 99999;\n admin = new Administrator[totalNumAdmin];\n for(int index = 0; index < totalNumAdmin; index++)\n {\n admin[index] = new Administrator(\"????\",\"????\");\n }\n }", "ProgramActuatorService createProgramActuatorService();", "public RESTWorkItemHandler() {\n\t}", "private void createCommands()\n{\n exitCommand = new Command(\"Exit\", Command.EXIT, 0);\n helpCommand=new Command(\"Help\",Command.HELP, 1);\n backCommand = new Command(\"Back\",Command.BACK, 1);\n}", "Operation createOperation();", "Operation createOperation();", "@Override\n public Command build() {\n switch (CommandType.fromString(commandName.getEscapedAndStrippedValue())) {\n case ASSIGN:\n return new AssignmentCommand(commandArgs);\n case CAT:\n return new CatCommand(commandArgs);\n case ECHO:\n return new EchoCommand(commandArgs);\n case WC:\n return new WcCommand(commandArgs);\n case PWD:\n return new PwdCommand(commandArgs);\n case GREP:\n return new GrepCommand(commandArgs);\n case EXIT:\n return new ExitCommand(commandArgs);\n default:\n return new OtherCommand(commandName, commandArgs);\n }\n }", "private ControllerHelper() {\n commands.put(\"userlogin\", new UserLoginCommand());\n commands.put(\"register\", new RegisterCommand());\n commands.put(\"gotocategory\", new GoCategoryCommand());\n commands.put(\"gotomainpage\", new GoToMainPageCommand());\n commands.put(\"showitem\", new ShowItemCommand());\n commands.put(\"addtocart\", new AddToCartCommand());\n commands.put(\"removeitemfromcart\", new RemoveItemFromCartCommand());\n\n commands.put(\"makeorder\", new MakeOrderCommand());\n commands.put(\"removeitemfromorder\", new RemoveItemFromOrderCommand());\n commands.put(\"cancelorder\", new CancelOrderCommand());\n commands.put(\"payorder\", new PayOrderCommand());\n commands.put(\"editorder\", new EditOrderCommand());\n commands.put(\"confirmpayment\", new ConfirmPaymentCommand());\n commands.put(\"removeallnotpaidorders\", new RemoveAllNotPaidOrders());\n\n commands.put(\"gotousermanagementpage\", new GoToUserManagementPageCommand());\n commands.put(\"gotoitemmanagementpage\", new GoToItemManagementPage());\n\n commands.put(\"edititem\", new EditItemCommand());\n commands.put(\"updateitem\", new UpdateItemCommand());\n commands.put(\"additem\", new AddNewItemCommand());\n commands.put(\"deleteitem\", new DeleteItemCommand());\n\n commands.put(\"addusertoblocklist\", new AddUserToBlockList());\n commands.put(\"removeuserfromblocklist\", new RemoveUserFromBlockList());\n commands.put(\"userregistration\", new UserRegistrationCommand());\n commands.put(\"userlogout\", new UserLogOutCommand());\n commands.put(\"userupdate\", new UserUpdateCommand());\n commands.put(\"changeuserpassword\", new ChangeUserPassword());\n }", "public HttpConnector(){\n super();\n }", "public void instantiateCommand() throws SystemException {\r\n\t\t// Check the definitation.\r\n\t\tdefinitionCheck();\r\n\t\t\r\n\t\t// Create the fresh instance.\r\n\t\tcommandInstance = new ReadWriteableAttributes();\r\n\t}", "Command createCommandWith(CommandCreator creator);", "@Test(groups = {\"rest-commands\"})\n public void createStandaloneInstanceTest() {\n GlassFishServer server = glassFishServer();\n Command command = new CommandCreateInstance(STANDALONE_INSTANCE, null,\n TestDomainV4Constants.NODE_NAME);\n try {\n Future<ResultString> future =\n ServerAdmin.<ResultString>exec(server, command);\n try {\n ResultString result = future.get();\n //assertNotNull(result.getValue());\n assertEquals(result.state, TaskState.COMPLETED);\n } catch ( InterruptedException | ExecutionException ie) {\n fail(\"CommandCreateInstance command execution failed: \" + ie.getMessage());\n }\n } catch (GlassFishIdeException gfie) {\n fail(\"CommandCreateInstance command execution failed: \" + gfie.getMessage());\n }\n }", "public CommandHandler(MCAdmin plugin) {\n\t\tthis.plugin = plugin;\n\t\t//this.conn = plugin.getConnection();\n\t\t//this.wi = plugin.getWeb();\n\t}", "ResourceAPI createResourceAPI();", "protected abstract RunREST makeRunInterface();", "Operations createOperations();", "public AbstractCommandController(Class commandClass, String commandName)\r\n/* 21: */ {\r\n/* 22:75 */ setCommandClass(commandClass);\r\n/* 23:76 */ setCommandName(commandName);\r\n/* 24: */ }", "ExternalActuator createExternalActuator();", "public CommandHandler() {\r\n\t\tcommands.put(\"userinfo\", new UserInfoCommand());\r\n\t\tcommands.put(\"verify\", new VerifyCommand());\r\n\t\tcommands.put(\"ping\", new PingCommand());\r\n\t\tcommands.put(\"rapsheet\", new RapsheetCommand());\r\n\t\tcommands.put(\"bet\", new BetCommand());\r\n\t\tcommands.put(\"buttons\", new ButtonCommand());\r\n\r\n\t\t// for each command in commands\r\n\t\t// call getAlternativeName and assign to that key\r\n\t\tcommands.keySet().stream().forEach(key -> {\r\n\t\t\tList<String> alts = commands.get(key).getAlternativeNames();\r\n\t\t\tif (alts != null)\r\n\t\t\t\talts.forEach(a -> commandAlternative.put(a, key));\r\n\t\t});\r\n\t}", "public Administrator(String username, String password) {\n super(username,password);\n }", "public Administrator(String username, String password) {\n this.username = username;\n this.password = password;\n }", "public AutonomousCommand() {\n \t\n\n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTOR\n // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=VARIABLE_SETTING\n\n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=VARIABLE_SETTING\n // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=REQUIRES\n\n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=R\tEQUIRES\n \t\n }", "public interface NodeAdmin {\n\n /** Start/stop NodeAgents and schedule next NodeAgent ticks with the given NodeAgentContexts */\n void refreshContainersToRun(Set<NodeAgentContext> nodeAgentContexts);\n\n /** Update node admin metrics */\n void updateMetrics(boolean isSuspended);\n\n /**\n * Attempts to freeze/unfreeze all NodeAgents and itself. To freeze a NodeAgent means that\n * they will not pick up any changes from NodeRepository.\n *\n * @param frozen whether NodeAgents and NodeAdmin should be frozen\n * @return True if all the NodeAgents and NodeAdmin has converged to the desired state\n */\n boolean setFrozen(boolean frozen);\n\n /**\n * Returns whether NodeAdmin itself is currently frozen, meaning it will not pick up any changes\n * from NodeRepository.\n */\n boolean isFrozen();\n\n /**\n * Returns an upper bound on the time some or all parts of the node admin (including agents)\n * have been frozen. Returns 0 if not frozen, nor trying to freeze.\n */\n Duration subsystemFreezeDuration();\n\n /**\n * Stop all services on these nodes\n */\n void stopNodeAgentServices();\n\n /**\n * Start node-admin schedulers.\n */\n void start();\n\n /**\n * Stop the NodeAgents. Will not delete the storage or stop the container.\n */\n void stop();\n}", "private static ShellExecResponse masterExec(final AsyncAdmin admin, final ShellExecRequest req) {\n return admin.<ShellExecService.Stub, ShellExecResponse> coprocessorService(\n ShellExecService::newStub,\n (stub, controller, callback) -> stub.shellExec(controller, req, callback)).join();\n }", "public interface ICommand {\n /**\n * The method contains the logic of the command being executed\n * @param request - request to receive and send parameters\n * @return link to jump after command execution\n * @throws Exception the user will be shown the corresponding page with a message that something went wrong\n * */\n String execute(HttpServletRequest request) throws Exception;\n}", "@Bean(name = \"testRestTemplateRoleAdmin\")\n public TestRestTemplate testRestTemplateRoleAdminCreator(@Value(\"${local.server.port}\") int port) {\n RestTemplateBuilder restTemplateBuilder = new RestTemplateBuilder()\n .rootUri(\"http://localhost:\" + port)\n .basicAuthentication(\"admin\", \"devdojo-pass\");\n\n return new TestRestTemplate(restTemplateBuilder);\n }", "public AbstractCommandController(Class commandClass)\r\n/* 16: */ {\r\n/* 17:66 */ setCommandClass(commandClass);\r\n/* 18: */ }", "public CommandsFactoryImpl() {\r\n\t\tsuper();\r\n\t}", "public PnuematicSubsystem() {\n\n }", "public HelpCommand()\n {\n }", "public void registerCommands() {\n\t CommandSpec cmdCreate = CommandSpec.builder()\n\t .arguments(\n\t onlyOne(GenericArguments.string(Text.of(\"type\"))),\n\t onlyOne(GenericArguments.string(Text.of(\"id\"))))\n\t .executor(CmdCreate.getInstance())\n\t .permission(\"blockyarena.create\")\n\t .build();\n\n\t CommandSpec cmdRemove = CommandSpec.builder()\n\t .arguments(\n\t onlyOne(GenericArguments.string(Text.of(\"type\"))),\n\t onlyOne(GenericArguments.string(Text.of(\"id\"))))\n\t .executor(CmdRemove.getInstance())\n\t .permission(\"blockyarena.remove\")\n\t .build();\n\n\t CommandSpec cmdJoin = CommandSpec.builder()\n\t .arguments(\n\t onlyOne(GenericArguments.string(Text.of(\"mode\")))\n\t )\n\t .executor(CmdJoin.getInstance())\n\t .build();\n\n\t CommandSpec cmdQuit = CommandSpec.builder()\n\t .executor(CmdQuit.getInstance())\n\t .build();\n\n\t CommandSpec cmdEdit = CommandSpec.builder()\n\t .arguments(\n\t onlyOne(GenericArguments.string(Text.of(\"id\"))),\n\t onlyOne(GenericArguments.string(Text.of(\"type\"))),\n\t GenericArguments.optional(onlyOne(GenericArguments.string(Text.of(\"param\"))))\n\t )\n\t .executor(CmdEdit.getInstance())\n\t .permission(\"blockyarena.edit\")\n\t .build();\n\n\t CommandSpec cmdKit = CommandSpec.builder()\n\t .arguments(onlyOne(GenericArguments.string(Text.of(\"id\"))))\n\t .executor(CmdKit.getInstance())\n\t .build();\n\n\t CommandSpec arenaCommandSpec = CommandSpec.builder()\n\t .child(cmdEdit, \"edit\")\n\t .child(cmdCreate, \"create\")\n\t .child(cmdRemove, \"remove\")\n\t .child(cmdJoin, \"join\")\n\t .child(cmdQuit, \"quit\")\n\t .child(cmdKit, \"kit\")\n\t .build();\n\n\t Sponge.getCommandManager()\n\t .register(BlockyArena.getInstance(), arenaCommandSpec, \"blockyarena\", \"arena\", \"ba\");\n\t }", "public interface SuperCommand {\n\n /**\n * Setups anything that is needed for this command.\n * <br/><br/>\n * It is recommended you do the following in this method:\n * <ul>\n * <li>Register any of the sub-commands of this command;</li>\n * <li>Define the permission required to use this command using {@link CompositeCommand#setPermission(String)};</li>\n * <li>Define whether this command can only be run by players or not using {@link CompositeCommand#setOnlyPlayer(boolean)};</li>\n * </ul>\n */\n void setup();\n\n /**\n * Returns whether the command can be executed by this user or not.\n * It is recommended to send messages to let this user know why they could not execute the command.\n * Note that this is run previous to {@link #execute(User, String, List)}.\n * @param user the {@link User} who is executing this command.\n * @param label the label which has been used to execute this command.\n * It can be {@link CompositeCommand#getLabel()} or an alias.\n * @param args the command arguments.\n * @return {@code true} if this command can be executed, {@code false} otherwise.\n * @since 1.3.0\n */\n default boolean canExecute(User user, String label, List<String> args) {\n return true;\n }\n\n /**\n * Defines what will be executed when this command is run.\n * @param user the {@link User} who is executing this command.\n * @param label the label which has been used to execute this command.\n * It can be {@link CompositeCommand#getLabel()} or an alias.\n * @param args the command arguments.\n * @return {@code true} if the command executed successfully, {@code false} otherwise.\n */\n boolean execute(User user, String label, List<String> args);\n\n /**\n * Tab Completer for CompositeCommands.\n * Note that any registered sub-commands will be automatically added to the list.\n * Use this to add tab-complete for things like names.\n * @param user the {@link User} who is executing this command.\n * @param alias alias for command\n * @param args command arguments\n * @return List of strings that could be used to complete this command.\n */\n default Optional<List<String>> tabComplete(User user, String alias, List<String> args) {\n return Optional.empty();\n }\n\n}", "Command createCommand() throws ServiceException, AuthException;", "public ListCommand() {\n super();\n }", "public AbstractCommand()\n {\n this.logger = new ConsoleLogger();\n }", "public CommandMAN(String[] arguments) {\n super(arguments);\n }", "private NetCommand buildIlasmCommand() {\n NetCommand command = new NetCommand(this, exe_title, exe_name);\n command.setFailOnError(getFailOnError());\n //fill in args\n command.addArgument(getDebugParameter());\n command.addArgument(getTargetTypeParameter());\n command.addArgument(getListingParameter());\n command.addArgument(getOutputFileParameter());\n command.addArgument(getResourceFileParameter());\n command.addArgument(getVerboseParameter());\n command.addArgument(getKeyfileParameter());\n command.addArgument(getExtraOptionsParameter());\n\n /*\n * space for more argumentativeness\n * command.addArgument();\n * command.addArgument();\n */\n return command;\n }", "CommandsFactory getCommandsFactory();", "public RestServlet() {}", "public interface CommandManagerService {\n\n\t/**\n\t * This method gets the available command types on the edge server and the\n\t * ID of the ReaderFactory that the command type works with.\n\t * \n\t * @return A set of CommandConfigPluginDTOs\n\t */\n\tSet<CommandConfigFactoryDTO> getCommandConfigFactories();\n\n\t/**\n\t * Get all the CommandConfigFactoryID associated with a readerFactoryID.\n\t * \n\t * @param readerFactoryID\n\t * @return\n\t */\n\tSet<CommandConfigFactoryDTO> getCommandConfigFactoriesByReaderID(String readerFactoryID);\n\n\t/**\n\t * Get the CommandConfigurationFactory\n\t * @param commandFactoryID\n\t * @return\n\t */\n\tCommandConfigFactoryDTO getCommandConfigFactory(\n\t\t\tString commandFactoryID);\n\n\t/**\n\t * Gets the DTOs for configured commands.\n\t * \n\t * @return a set of configured commands\n\t */\n\tSet<CommandConfigurationDTO> getCommands();\n\n\t/**\n\t * Gets the DTO for a given Command Configuration.\n\t * \n\t * @param commandConfigurationID\n\t * The ID of the commandConfiguration to get\n\t * @return A DTO for the configured command, or null if no command\n\t * configuration is available for the given ID\n\t */\n\tCommandConfigurationDTO getCommandConfiguration(\n\t\t\tString commandConfigurationID);\n\n\t/**\n\t * Gets the meta information necessary to construct a new Command.\n\t * \n\t * @param commandType\n\t * the type of command to make\n\t * @return an MBeanInfo object that describes how to make a new command\n\t */\n\tMBeanInfo getCommandDescription(String commandType);\n\n\t/**\n\t * Create a new Command.\n\t * \n\t * @param commandType\n\t * The type of the Command to make\n\t * @param properties\n\t * the properties of a Command\n\t * @return the id of new created command\n\t */\n\tString createCommand(String commandType, AttributeList properties);\n\n\t/**\n\t * Sets the properties of a Command.\n\t * \n\t * @param commandID\n\t * the ID of the command to set\n\t * @param properties\n\t * the new properties of the command\n\t */\n\tvoid setCommandProperties(String commandID, AttributeList properties);\n\n\t/**\n\t * Delete a command configuration.\n\t * \n\t * @param commandConfigurationID\n\t * the ID of the commandConfiguration to delete\n\t */\n\tvoid deleteCommand(String commandID);\n}", "String createCommand(String commandType, AttributeList properties);", "public interface KudoClient {\n MixedOperation<Operator, OperatorList, DoneableOperator, Resource<Operator, DoneableOperator>> operators();\n\n MixedOperation<Instance, InstanceList, DoneableInstance, Resource<Instance, DoneableInstance>> instances();\n\n MixedOperation<OperatorVersion, OperatorVersionList, DoneableOperatorVersion, Resource<OperatorVersion, DoneableOperatorVersion>> operatorVersion();\n\n void close();\n}", "public HouseReloadCommand() {\r\n setCommand(\"reload\");\r\n setPermission(\"house.admin.reload\");\r\n setLength(1);\r\n setBoth();\r\n setUsage(\"/house reload\");\r\n\r\n }", "private interface Command {\n public void execute();\n }", "private ReductionPublisherRequestCommand() { super(null); }", "IDbCommand createCommand();", "private RESTBackend()\n\t\t{\n\t\t\t\n\t\t}", "public void setExecutor(Executor e) {\n addReference(\"ant.executor\", e);\n }", "public AddonInstaller() {\n \n }", "public AdminController(Admin a)\n {\n \tthis.adminModel=a;\t\n }", "public Command() {\n }" ]
[ "0.6566502", "0.5853037", "0.58432096", "0.5773263", "0.56634325", "0.5643438", "0.55849314", "0.5571009", "0.55410033", "0.5526731", "0.5526185", "0.5515002", "0.55028325", "0.54761946", "0.54568815", "0.54540193", "0.5406124", "0.5391616", "0.5350725", "0.5323377", "0.53202605", "0.5286797", "0.528677", "0.52547324", "0.52418417", "0.5233945", "0.52297133", "0.52249384", "0.521292", "0.51891595", "0.51760286", "0.5160896", "0.5142532", "0.513954", "0.5129925", "0.51190704", "0.5113358", "0.5110679", "0.51050633", "0.5066304", "0.5053154", "0.5051967", "0.5049397", "0.50461626", "0.50275916", "0.5012697", "0.5010789", "0.49955454", "0.49935204", "0.4991247", "0.49871296", "0.49814045", "0.4977551", "0.4972994", "0.49710357", "0.49710357", "0.49652725", "0.49592113", "0.49572086", "0.49535358", "0.49473974", "0.49445632", "0.49422106", "0.49393713", "0.4938878", "0.49302694", "0.49293932", "0.4922007", "0.492157", "0.49214596", "0.49195892", "0.49071184", "0.4903605", "0.48998064", "0.48994595", "0.48987713", "0.48956606", "0.4892911", "0.48912665", "0.48868844", "0.4886004", "0.48728898", "0.48680007", "0.4864941", "0.48573628", "0.4854144", "0.48540464", "0.48531127", "0.4841209", "0.48411363", "0.48389146", "0.48375863", "0.48355368", "0.4831656", "0.48028377", "0.48015085", "0.47939548", "0.47939283", "0.4788296", "0.47823074", "0.47781596" ]
0.0
-1
////////////////////////////////////////////////////////////////////////// Implemented Abstract Methods // //////////////////////////////////////////////////////////////////////////
@Override protected void prepareHttpConnection(HttpURLConnection conn) throws CommandException { super.prepareHttpConnection(conn); if (!command.dirDeploy) { conn.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + multipartBoundary); } }
{ "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\n protected void prot() {\n }", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void anular() {\n\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}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "public AbstractGenerateurAbstractSeule() {\r\n\t\tsuper();\r\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\n protected void init() {\n }", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "@Override\n void init() {\n }", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n }", "@Override\r\n\t\t\tpublic void buscar() {\n\r\n\t\t\t}", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "@Override\n public void memoria() {\n \n }", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n protected void initialize() {\n\n \n }", "@Override\n protected void initialize() \n {\n \n }", "protected abstract Set method_1559();", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n public void get() {}", "@Override\r\n protected void end() {\r\n\r\n }", "protected abstract Self self();", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\r\n\tprotected void compute() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n public void render() { super.render(); }", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {}", "@Override\n\tpublic void selfValidate() {\n\t\t\n\t}", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n public void init() {}", "@Override\n protected void end() {\n \n }", "@Override\n\tpublic void erstellen() {\n\t\t\n\t}", "@Override\n\tpublic void render () {\n\n\t}", "protected abstract T self();", "protected abstract T self();", "protected abstract T self();", "@Override\n protected void end() {\n }", "@Override\n protected void end() {\n }", "@Override\n protected void end() {\n }", "@Override\n protected void end() {\n }", "@Override\n protected void end() {\n }", "@Override\n protected void end() {\n }", "@Override\n protected void end() {\n }", "@Override\n protected void end() {\n }", "@Override\n protected void end() {\n }", "@Override\n protected void end() {\n }", "@Override\n protected void end() {\n }", "@Override\n protected void end() {\n }", "@Override\n protected void execute() {\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 render() {\n\t\t\r\n\t}", "@Override\n\tpublic void render() {\n\t\t\n\t}", "public abstract void mo70713b();", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "public abstract void operation();", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n\tpublic void create () {\n\n\t}", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "@Override\n protected void initData() {\n }", "@Override\n protected void initData() {\n }", "protected abstract void construct();", "@Override\n\tpublic void buscar() {\n\t\t\n\t}", "@Override\n\tpublic void getData() {\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}" ]
[ "0.69921184", "0.68098074", "0.6718831", "0.6630493", "0.66108936", "0.65745", "0.6562973", "0.6562973", "0.656156", "0.656156", "0.65302294", "0.6422216", "0.6393812", "0.6388765", "0.6343903", "0.63372785", "0.6314556", "0.6291998", "0.627105", "0.627105", "0.6257094", "0.62474763", "0.6238007", "0.6233103", "0.62220013", "0.62220013", "0.62220013", "0.62220013", "0.62220013", "0.62220013", "0.6219756", "0.6207507", "0.61980253", "0.6197493", "0.6150254", "0.61349034", "0.6130713", "0.6127655", "0.6127029", "0.61248887", "0.61246663", "0.6119714", "0.61165905", "0.6099658", "0.6097636", "0.60905373", "0.6087475", "0.60824364", "0.60696584", "0.6060194", "0.605665", "0.6053733", "0.60526234", "0.6048257", "0.60386586", "0.6024312", "0.601159", "0.60025764", "0.60019034", "0.599915", "0.5993832", "0.59922975", "0.598677", "0.5983694", "0.5973165", "0.5964256", "0.5964256", "0.5964256", "0.5962802", "0.5962802", "0.5962802", "0.5962802", "0.5962802", "0.5962802", "0.5962802", "0.5962802", "0.5962802", "0.5962802", "0.5962802", "0.5962802", "0.5943826", "0.59417206", "0.59417206", "0.59368795", "0.59245235", "0.5923086", "0.59162104", "0.59143203", "0.5913891", "0.5906458", "0.5901513", "0.58981013", "0.58884215", "0.58884215", "0.5887355", "0.5887355", "0.58862054", "0.5880332", "0.58756757", "0.58742046", "0.58742046" ]
0.0
-1
Handle sending data to server using HTTP command interface. This is based on reading the code of CLIRemoteCommand.java from the server's code repository. Since some asadmin commands need to send multiple files, the server assumes the input is a ZIP stream.
@Override protected void handleSend(HttpURLConnection hconn) throws IOException { //InputStream istream = getInputStream(); if (command.path == null) { throw new GlassFishIdeException("The path attribute of deploy command" + " has to be non-empty!"); } OutputStreamWriter wr = new OutputStreamWriter(hconn.getOutputStream()); if (!command.dirDeploy) { writeParam(wr, "path", command.path.getAbsolutePath()); if (command.name != null) { writeParam(wr, "name", command.name); } if (command.contextRoot != null) { writeParam(wr, "contextroot", command.contextRoot); } if (command.target != null) { writeParam(wr, "target", command.target); } writeBinaryFile(wr, hconn.getOutputStream(), command.path); wr.append("--" + multipartBoundary + "--").append(NEWLINE); } else { wr.write("path=" + command.path.toString()); if (command.name != null) { wr.write("&"); wr.write("name=" + command.name); } if (command.contextRoot != null) { wr.write("&"); wr.write("contextroot=" + command.name); } if (command.target != null) { wr.write("&"); wr.write("target=" + command.target); } } wr.close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) throws IOException {\n\t\tString masterIP = args[0];\n\n\t\ttry {\n\t\t\tsock = new DatagramSocket(Machine.FILE_OPERATIONS_PORT);\n\t\t} catch (SocketException e2) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te2.printStackTrace();\n\t\t}\n\n\t\ttry {\n\t\t\tmyName = InetAddress.getLocalHost().getHostName();\n\t\t} catch (UnknownHostException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\tScanner s = new Scanner(System.in);\n\t\tString cmd = null;\n\n\t\tserver = new FileTransferServer();\n\t\tserver.start();\n\n\t\twhile ((cmd = s.nextLine()) != null) {\n\n\t\t\tWriteLog.writelog(myName, cmd);\n\n\t\t\tif (\"exit\".equals(cmd)) {\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t\telse if(cmd.startsWith(\"put \")){\n\t\t\t\tScanner lineScanner = new Scanner(cmd);\n\t\t\t\tString command, localFileName, sdfsFileName;\n\n\t\t\t\tcommand = lineScanner.next();\n\t\t\t\tlocalFileName = lineScanner.next();\n\t\t\t\tsdfsFileName = lineScanner.next();\n\n\t\t\t\tVector<String> putMsg = new Vector<String>();\n\n\t\t\t\tputMsg.add(\"P\");\n\t\t\t\tputMsg.add(localFileName);\n\t\t\t\tputMsg.add(sdfsFileName);\n\t\t\t\tputMsg.add(myName);\n\n\t\t\t\tWriteLog.writelog(myName, \"sendPutMsg:\" + putMsg.elementAt(1)+putMsg.elementAt(2));\n\t\t\t\tsendMsgToMaster(putMsg, masterIP);\n\n\t\t\t}\n\t\t\telse if(cmd.startsWith(\"get \")){\n\t\t\t\tVector<String> getMsg = new Vector<String>();\n\t\t\t\tScanner lineScanner = new Scanner(cmd);\n\t\t\t\tString command, localFileName, sdfsFileName;\n\n\t\t\t\tcommand = lineScanner.next();\n\t\t\t\tsdfsFileName = lineScanner.next();\n\t\t\t\tlocalFileName = lineScanner.next();\n\n\t\t\t\tgetMsg.add(\"G\");\n\t\t\t\tgetMsg.add(sdfsFileName);\n\t\t\t\tgetMsg.add(myName);\n\n\t\t\t\tWriteLog.writelog(myName, \"sendPutMsg:\"+getMsg.elementAt(1));\n\t\t\t\tsendMsgToMaster(getMsg, masterIP);\n\t\t\t\tVector<String> serverIP = recvListMsg();\n\t\t\t\t//String copyFN = cmd.substring(cmd.lastIndexOf(' ')+1);\n\n\t\t\t\t//Runnable runnable = new FileTransferClient(copyFN, cmd.substring(4, cmd.indexOf(' ', 4)),serverIP.elementAt(0));\n\t\t\t\tRunnable runnable = new FileTransferClient(localFileName, sdfsFileName,serverIP.elementAt(0));\n\n\t\t\t\tThread thread = new Thread(runnable);\n\t\t\t\tthread.start();\n\t\t\t}\n\t\t\telse if(cmd.startsWith(\"delete \")){\n\t\t\t\tVector<String> delMsg = new Vector<String>();\n\n\t\t\t\tScanner lineScanner = new Scanner(cmd);\n\t\t\t\tString command, localFileName, sdfsFileName;\n\n\t\t\t\tcommand = lineScanner.next();\n\t\t\t\tsdfsFileName = lineScanner.next();\n\n\t\t\t\tdelMsg.add(\"D\");\n\t\t\t\tdelMsg.add(sdfsFileName);\n\n\t\t\t\tWriteLog.writelog(myName, \"sendPutMsg: \" + delMsg.elementAt(1));\n\t\t\t\tsendMsgToMaster(delMsg, masterIP);\n\t\t\t}\n\t\t\telse if(cmd.startsWith(\"updateMaster \")){\n\t\t\t\tmasterIP = cmd.substring(cmd.lastIndexOf(' ')+1);\n\t\t\t\tSystem.out.println(\"New master - \"+masterIP);\n\t\t\t}\n\t\t\telse if(cmd.startsWith(\"maple \")) {\n\n\t\t\t\tVector<String> mapleMsg = new Vector<String>();\n\t\t\t\tVector<String> putMsg = new Vector<String>();\n\t\t\t\tScanner lineScanner = new Scanner(cmd);\n\t\t\t\tString command, jarName, sdfsFilePrefix, dirPath;\n\t\t\t\tFile[] listFiles = null;\n\n\t\t\t\tcommand = lineScanner.next();\n\t\t\t\tjarName = lineScanner.next();\n\t\t\t\tsdfsFilePrefix = lineScanner.next();\n\t\t\t\tdirPath = lineScanner.next();\n\n\t\t\t\tputMsg.add(\"P\");\n\t\t\t\tputMsg.add(jarName);\n\t\t\t\tputMsg.add(jarName);\n\t\t\t\tputMsg.add(myName);\n\t\t\t\t\n\t\t\t\tsendMsgToMaster(putMsg, masterIP);\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(1 * 300);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tFile directory = new File(dirPath);\n\t\t\t\tlistFiles = directory.listFiles();\n\t\t\t\tfor(File tfile: listFiles){\n\t\t\t\t\tif (tfile.isFile()) \n\t\t\t\t\t{\n\t\t\t\t\t\tString filename = tfile.getName();\n\t\t\t\t\t\tString dirname = directory.getName();\n\t\t\t\t\t\tSystem.out.println(filename);\n\t\t\t\t\t\tputMsg = new Vector<String>();\n\t\t\t\t\t\t\n\t\t\t\t\t\tputMsg.add(\"P\");\n\t\t\t\t\t\tputMsg.add(dirPath+filename);\n\t\t\t\t\t\tputMsg.add(\"mj_\"+filename);\n\t\t\t\t\t\tputMsg.add(myName);\n\t\t\t\t\t\tSystem.out.println(\"client sending \"+putMsg+\" to master\");\n\t\t\t\t\t\tsendMsgToMaster(putMsg, masterIP);\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tThread.sleep(1 * 300);\n\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tmapleMsg.add(\"maple\");\n\t\t\t\tmapleMsg.add(jarName);\n\t\t\t\tmapleMsg.add(sdfsFilePrefix);\n\n\t\t\t\t/*for(String sdfsFile : sdfsFiles) {\n\t\t\t\t\tmapleMsg.add(sdfsFile);\n\t\t\t\t}*/\n\t\t\t\tfor(File tfile: listFiles){\n\t\t\t\t\tString filename = tfile.getName();\n\t\t\t\t\tmapleMsg.add(\"mj_\"+filename);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"client sending \"+mapleMsg+\" to master\");\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(1 * 500);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tsendMsgToMaster(mapleMsg, masterIP);\n\n\t\t\t}else if(cmd.startsWith(\"juice \")) {\n\t\t\t\tVector<String> juiceMsg = new Vector<String>();\n\t\t\t\tVector<String> putMsg = new Vector<String>();\n\t\t\t\tScanner lineScanner = new Scanner(cmd);\n\t\t\t\tString command, jarName, sdfsFilePrefix, juiceFileName;\n\t\t\t\tInteger numJuices;\n\n\t\t\t\tcommand = lineScanner.next();\n\t\t\t\tjarName = lineScanner.next();\n\t\t\t\tnumJuices = lineScanner.nextInt();\n\t\t\t\tsdfsFilePrefix = lineScanner.next();\n\t\t\t\tjuiceFileName = lineScanner.next();\n\n\t\t\t\tputMsg.add(\"P\");\n\t\t\t\tputMsg.add(jarName);\n\t\t\t\tputMsg.add(jarName);\n\t\t\t\tputMsg.add(myName);\n\t\t\t\t\n\t\t\t\tsendMsgToMaster(putMsg, masterIP);\n\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(1 * 1000);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t\t\n\t\t\t\tjuiceMsg.add(\"juice\");\n\t\t\t\tjuiceMsg.add(jarName);\n\t\t\t\tjuiceMsg.add(numJuices.toString());\n\t\t\t\tjuiceMsg.add(sdfsFilePrefix);\n\t\t\t\tjuiceMsg.add(juiceFileName);\n\n\t\t\t\tWriteLog.writelog(myName, \"sendJuiceMsg: \" + juiceMsg.elementAt(1));\n\n\t\t\t\tsendMsgToMaster(juiceMsg, masterIP);\n\t\t\t}\n\n\t\t}\n\n\t}", "public boolean sendData(String data) throws IOException;", "@Override\n public void run() {\n try {\n Request command = (Request) cmdInStream.readObject();\n while (!\"EXIT\".equalsIgnoreCase(command.getContent())) {\n log.info(String.format(\"Received command: %s\", command.getContent()));\n\n // Searching for appropriate handler for received request\n RequestHandler request = handlers.get(command.getContent());\n if (request != null) {\n // Processing request and writing response\n Response response = request.handle(command);\n cmdOutStream.writeObject(response);\n }\n else {\n cmdOutStream.writeObject(new Response(\"Incorrect request. Please try again.\"));\n }\n\n // Read next command\n command = (Request) cmdInStream.readObject();\n }\n\n cmdInStream.close();\n cmdOutStream.close();\n\n fileInStream.close();\n fileOutStream.close();\n\n cmdSocket.close();\n fileSocket.close();\n }\n catch (ClassNotFoundException ex) {\n log.error(\"Class can't be found! \" + ex.getMessage());\n }\n catch (IOException ex) {\n log.error(ex.getMessage());\n }\n }", "public boolean sendData(String data, String prefix) throws IOException;", "public interface CommandHandler {\n void handleInput(String msg, DataInputStream input, DataOutputStream output);\n}", "public void sendRequest(){\n fileServer.sendMessage(this.packet,new FileNode(ip,port));\n }", "private void handleRetr(String file) {\n File f = new File(currDirectory + fileSeparator + file);\n\n if (!f.exists()) {\n sendMsgToClient(\"550 File does not exist\");\n }\n\n else {\n\n // Binary mode\n if (transferMode == transferType.BINARY) {\n BufferedOutputStream fout = null;\n BufferedInputStream fin = null;\n\n sendMsgToClient(\"150 Opening binary mode data connection for requested file \" + f.getName());\n\n try {\n // create streams\n fout = new BufferedOutputStream(dataConnection.getOutputStream());\n fin = new BufferedInputStream(new FileInputStream(f));\n } catch (Exception e) {\n debugOutput(\"Could not create file streams\");\n }\n\n debugOutput(\"Starting file transmission of \" + f.getName());\n\n // write file with buffer\n byte[] buf = new byte[1024];\n int l = 0;\n try {\n while ((l = fin.read(buf, 0, 1024)) != -1) {\n fout.write(buf, 0, l);\n }\n } catch (IOException e) {\n debugOutput(\"Could not read from or write to file streams\");\n e.printStackTrace();\n }\n\n // close streams\n try {\n fin.close();\n fout.close();\n } catch (IOException e) {\n debugOutput(\"Could not close file streams\");\n e.printStackTrace();\n }\n\n debugOutput(\"Completed file transmission of \" + f.getName());\n\n sendMsgToClient(\"226 File transfer successful. Closing data connection.\");\n\n }\n\n // ASCII mode\n else {\n sendMsgToClient(\"150 Opening ASCII mode data connection for requested file \" + f.getName());\n\n BufferedReader rin = null;\n PrintWriter rout = null;\n\n try {\n rin = new BufferedReader(new FileReader(f));\n rout = new PrintWriter(dataConnection.getOutputStream(), true);\n\n } catch (IOException e) {\n debugOutput(\"Could not create file streams\");\n }\n\n String s;\n\n try {\n while ((s = rin.readLine()) != null) {\n rout.println(s);\n }\n } catch (IOException e) {\n debugOutput(\"Could not read from or write to file streams\");\n e.printStackTrace();\n }\n\n try {\n rout.close();\n rin.close();\n } catch (IOException e) {\n debugOutput(\"Could not close file streams\");\n e.printStackTrace();\n }\n sendMsgToClient(\"226 File transfer successful. Closing data connection.\");\n }\n\n }\n closeDataConnection();\n\n }", "public synchronized void run() {\n try {\n String data = in.readUTF();\n String response = FileRequestService.handleRequest(data, sharedWriteQueueService);\n out.writeUTF(response);\n System.out.println(\"server wrote:\" + response);\n } catch(EOFException e) {\n System.out.println(\"EOF:\" + e.getLocalizedMessage() + \" \" + e);\n } catch(IOException e) {\n System.out.println(\"IO:\" + e.getLocalizedMessage() + \" \" + e);\n } finally { \n try {\n clientSocket.close();\n } catch (IOException e){\n System.out.println(\"close:\" + e.getMessage());\n }\n }\n }", "public Reply sendData(InputStream... ios) throws ThingsException, InterruptedException;", "@Override\n\tpublic void run() {\n\t\twhile (receivingCommands) {\n\t\t\ttry {\n\t\t\t\tCommandHandler commandHandler = new CommandHandler(readNextLine());\n\t\t\t\tswitch (commandHandler.getCommand()) {\n\t\t\t\tcase REGISTER:\n\t\t\t\t\tString username = commandHandler.getParam(1);\n\t\t\t\t\tString password = commandHandler.getParam(2);\n\t\t\t\t\tfileCatalog.register(username, password);\n\t\t\t\t\tbreak;\n\t\t\t\tcase LOGIN:\n\t\t\t\t\tString username1 = commandHandler.getParam(1);\n\t\t\t\t\tString password1 = commandHandler.getParam(2);\n\t\t\t\t\tjwtToken = fileCatalog.login(username1, password1);\n\t\t\t\t\tbreak;\n\t\t\t\tcase LIST:\n\t\t\t\t\tList<? extends FileDTO> files = fileCatalog.list(jwtToken);\n\t\t\t\t\tfor (FileDTO file : files) {\n\t\t\t\t\t\tprintDetails(file);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase DETAILS:\n\t\t\t\t\tString fileName = commandHandler.getParam(1);\n\t\t\t\t\tFileDTO file = fileCatalog.details(jwtToken, fileName);\n\t\t\t\t\tprintDetails(file);\n\t\t\t\t\tbreak;\n\t\t\t\tcase UPR:\n\t\t\t\t\tString pathFileToUploadReadOnly = commandHandler.getParam(1);\n\t\t\t\t\tString newFileNameOnServerReadOnly = commandHandler.getParam(2);\n\t\t\t\t\tfileCatalog.upload(jwtToken, newFileNameOnServerReadOnly, false);\n\t\t\t\t\t// TODO\n\t\t\t\t\tbreak;\n\t\t\t\tcase UPW:\n\t\t\t\t\tString pathFileToUpload = commandHandler.getParam(1);\n\t\t\t\t\tString newFileNameOnServer = commandHandler.getParam(2);\n\t\t\t\t\tfileCatalog.upload(jwtToken, newFileNameOnServer, true);\n\t\t\t\t\t// TODO\n\t\t\t\t\tbreak;\n\t\t\t\tcase DOWN:\n\t\t\t\t\tString fileNameToDL = commandHandler.getParam(1);\n\t\t\t\t\tString targetDirectory = commandHandler.getParam(2);\n\t\t\t\t\tString newNameDL = commandHandler.getParam(3);\n\t\t\t\t\tfileCatalog.download(jwtToken, fileNameToDL, targetDirectory, newNameDL);\n\t\t\t\t\t// TODO\n\t\t\t\t\tbreak;\n\t\t\t\tcase DELETE:\n\t\t\t\t\tString fileNameToDelete = commandHandler.getParam(1);\n\t\t\t\t\tfileCatalog.delete(jwtToken, fileNameToDelete);\n\t\t\t\t\t// TODO\n\t\t\t\t\tbreak;\n\t\t\t\tcase LOGOUT:\n\t\t\t\t\tjwtToken = null;\n\t\t\t\t\tsafePrintln(\"You have been logged out.\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase QUIT:\n\t\t\t\t\treceivingCommands = false;\n\t\t\t\t\tsafePrintln(\"Good bye!\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase HELP:\n\t\t\t\t\tfor (Command command : Command.values()) {\n\t\t\t\t\t\tif (command == Command.UNKNOWN) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsafePrintln(command.toString().toLowerCase());\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tsafePrintln(\"Unrecognized command.\");\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tniceErrorPrint(e);\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void run() {\n FILEPREFIX = \".//files\"+serverID + \"//\";\n ClientMessage = (Message) socketRead();\n ServerMessage = getReturnMessage(ClientMessage);\n //System.out.println(\"client\"+ClientMessage.getFrom()+\"message : \"+ClientMessage.getContent());\n File file = new File(FILEPREFIX + ClientMessage.getFileName());\n switch (ClientMessage.getType()){\n case \"enquiry\"://return the list of file\n ServerMessage.setContent(ListAllFile());\n break;\n case \"read\"://read the last line\n System.out.println(ClientMessage.getFrom() + \": Reading...\");\n ServerMessage.setContent(\"Reading: \"+ReadLastLine(file));\n System.out.println(\"Reading \"+ClientMessage.getContent());\n break;\n case \"write\"://write to the end of file\n System.out.println(ClientMessage.getFrom() + \": writing...\");\n try{\n WriteLastLine(file,ClientMessage.getContent());\n }catch (IOException e) {\n System.out.println(\"write error\");\n }\n\n ServerMessage.setContent(\"writing: \"+ReadLastLine(file));\n System.out.println(\"Writing \"+ClientMessage.getContent());\n break;\n default://unknown command\n System.out.println(ClientMessage.getType());\n ServerMessage.setContent(\"Error\");\n System.out.println(ClientMessage.getFrom() + \": Wrong type\");\n break;\n }\n socketWrite(ServerMessage);\n\n try {//close the socket connection\n client.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void run(){\r\n DataInputStream dis = null;\r\n try{\r\n dis = new DataInputStream(socket.getInputStream());\r\n while(true){\r\n String command = dis.readUTF();\r\n if(command.startsWith(\"/\")){\r\n if(command.length() > 1) listener.receivedCommand(this, command.substring(1));\r\n }\r\n else{\r\n int size = dis.readInt();\r\n if(size > limit){\r\n cleanup(false);\r\n break;\r\n }\r\n byte[] buffer = new byte[size];\r\n dis.readFully(buffer, 0, size);\r\n listener.receivedFile(this, command, buffer);\r\n }\r\n }\r\n }\r\n catch(SocketException e){ e.printStackTrace(); }\r\n catch(EOFException e){ e.printStackTrace(); }\r\n catch(IOException ioe){ ioe.printStackTrace(); }\r\n finally{ cleanup(); }\r\n \r\n if(dis != null){\r\n try{ dis.close(); } catch(IOException ioe){ ioe.printStackTrace(); }\r\n dis = null;\r\n }\r\n }", "public void doCommand(Object info, SocketChannel channel)\n\t{\n\t\tCodeTimer ct = new CodeTimer(\"send\");\n\t\tparseParams((String)info);\n\t\tString source = inParams.get(\"source\");\n\t\tif (source == null)\n\t\t{\n\t\t\tsendError(\"source not specified\", \"getdata\", channel);\n\t\t\treturn;\n\t\t}\n\t\tDataSourceHandler dsh = handler.getDataSourceHandler();\n\t\tString resultType;\n\t\tRequestResult result;\n\t\tString action = inParams.get(\"action\");\n\t\tif ( action!=null && action.equals(\"exportinfo\") ) {\n\t\t\tExportConfig ec = dsh.getExportConfig( source );\n\t\t\tresultType = action;\n\t\t\tif ( ec == null || !ec.isClosed() ) {\n\t\t\t\tint ncl = Integer.parseInt( inParams.get(\"numCommentLines\") );\n\t\t\t\tArrayList<String> args = new ArrayList<String>(ncl+4);\n\t\t\t\targs.add( inParams.get(\"exportable\") );\n\t\t\t\targs.add( inParams.get(\"width.0\") );\n\t\t\t\targs.add( inParams.get(\"width.1\") );\n\t\t\t\t//args.add( \"\"+ncl );\n\t\t\t\tfor ( int i = 1; i <= ncl; i++ )\n\t\t\t\t\targs.add( inParams.get(\"cmt.\"+i) );\n\t\t\t\tExportConfig new_ec = new ExportConfig( args );\n\t\t\t\tif ( ec == null ) {\n\t\t\t\t\tec = new_ec;\n\t\t\t\t\tdsh.putExportConfig( source, ec );\n\t\t\t\t} else\n\t\t\t\t\tec.underride( new_ec );\n\t\t\t\tec.setClosed();\n\t\t\t}\n\t\t\tresult = new TextResult( ec.toStringList() );\n\t\t} else {\n\t\t\tDataSourceDescriptor dsd = dsh.getDataSourceDescriptor(inParams.get(\"source\"));\n\t\t\tDataSource ds = dsd.getDataSource();\n\t\t\tresult = ds.getData(inParams);\n\t\t\tdsd.putDataSource();\n\t\t\tresultType = ds.getType();\n\t\t}\n\t\tif (result != null)\n\t\t{\n\t\t\tresult.set(\"type\", resultType);\n\t\t\tresult.prepare();\n\t\t\tresult.writeHeader(netTools, channel);\n\t\t\tresult.writeBody(netTools, channel);\n\t\t\tct.stop();\n\t\t\thandler.log(Level.FINE, String.format(\"%s (%1.2f ms): [%s]\", inParams.get(\"source\"), ct.getRunTimeMillis(), info), channel);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tnetTools.writeString(\"error: no data\\n\", channel);\n\t\t\thandler.log(Level.FINE, \"[getdata] returned nothing\", channel);\n\t\t}\n\t}", "private static void sendRequestUserTextUpload(Socket s, PrintWriter pw, String method, Boolean requestFileFlag, Boolean bodyFlag) throws IOException {\n pw.print(method + \" /\");\n if (requestFileFlag) {\n pw.print(\"UserTextUpload/\");\n }\n pw.print(\" HTTP/1.1\\r\\n\");\n //request headers formation.\n pw.print(\"Host: localhost\\r\\n\");\n pw.print(\"Content-Type: text/html\\r\\n\");\n\n //This is to add a new header with the size of the sent file.\n pw.print(\"Content-Size: \" + Files.size(Path.of(FILE_PATH)) + \"\\r\\n\");\n pw.print(\"\\r\\n\");\n pw.flush();\n\n //request body formation.\n if (bodyFlag) {\n //Change to your own txt file\n Files.copy(Path.of(FILE_PATH), s.getOutputStream());\n }\n pw.flush();\n }", "@Override\n\tpublic void sendData(int type, byte[] data) {\n\t\t\n\t}", "public void send(byte[] data) throws IOException {\n dataOutput.write(data);\n dataOutput.flush();\n }", "public int sendData(String command) throws IOException\n {\n return sendCommandWithID(null, command, null);\n }", "@Override\n\tpublic void run(){\n\t\tSystem.out.println(\"run\");\n\t\ttry {\n\t\t\tString firstLine = inFromClient.readLine();\n\t\t\tSystem.out.println(\"Received: \" + firstLine);\n\n\t\t\tboolean badRequest = false;\n\t\t\tString[] array = firstLine.split(\" \");\n\t\t\tString HTTPcommand = array[0];\n\t\t\tString URI = array[1];\n\t\t\tString HTTPversion = array[2];\n\t\t\tString path = \"\";\n\t\t\t\n\t\t\tint indexSlash = URI.lastIndexOf(\"/\");\n\t\t\tSystem.out.println(indexSlash);\n\t\t\tpath = URI.substring(indexSlash+1, URI.length());\n\n\t\t\t\n\t\t\tString secondLine = inFromClient.readLine();\n\t\t\tif (!HTTPversion.equals(\"HTTP/1.1\")) {\n\t\t\t\tbadRequest = true;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif (badRequest) {\n\t\t\t\tout.println(\"HTTP/1.1 400 Bad Request\");\n\t\t\t\tout.println('\\r' + '\\n' + '\\r' + '\\n');\n\t\t\t\tout.flush();\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\tswitch(HTTPcommand){\n\t\t\t\tcase \"HEAD\": Head.head(clientSocket, inFromClient, out, path);\n\t\t\t\tbreak;\n\n\t\t\t\tcase \"GET\": Get.get(clientSocket, inFromClient, out, path);\n\t\t\t\tbreak;\n\n\t\t\t\tcase \"PUT\": {\n\t\t\t\t\tout.println(\"HTTP/1.1 200 OK\");\n\t\t\t\t\tout.println('\\r' + '\\n' + '\\r' + '\\n');\n\t\t\t\t\tout.flush();\n\t\t\t\t\tString Line3 = inFromClient.readLine();\n\t\t\t\t\tString Line4 = inFromClient.readLine();\n\t\t\t\t\tString Line5 = inFromClient.readLine();\n\t\t\t\t\tPut.put(inFromClient, path);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\t\tcase \"POST\": {\n\t\t\t\t\tout.println(\"HTTP/1.1 200 OK\");\n\t\t\t\t\tout.println('\\r' + '\\n' + '\\r' + '\\n');\n\t\t\t\t\tout.flush();\n\t\t\t\t\tString Line3 = inFromClient.readLine();\n\t\t\t\t\tString Line4 = inFromClient.readLine();\n\t\t\t\t\tString Line5 = inFromClient.readLine();\n\t\t\t\t\tPost.post(inFromClient, path);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tdefault: {\n\t\t\t\t\tout.println(\"HTTP/1.1 501 Not Implemented\");\n\t\t\t\t\tout.println('\\r' + '\\n' + '\\r' + '\\n');\n\t\t\t\t\tout.flush();\n\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\n\t\t//run();\n\n\t\t//inFromClient.close();\n\t\t//serverSocket.close();\n\t}", "public interface TransferAgent\n extends Closeable\n{\n //-------------------------------------------------------------------------\n void throttle(long maxBytesPerSecond);\n void unThrottle();\n\n\n //-------------------------------------------------------------------------\n ShellFile file (String remoteFilePath);\n List<ShellFile> files(String inRemoteFilePath);\n\n\n //-------------------------------------------------------------------------\n // @returns true if the file already exists, or if it was created\n boolean makeDir (String remoteDirectoryPath);\n boolean makeDirs(String remoteDirectoryPath);\n\n\n //-------------------------------------------------------------------------\n boolean upload(\n String localFileName, String remoteFileName);\n\n boolean upload(\n File localFile, String remoteFile);\n\n /**\n * Does not automatically close the given source stream.\n * \n * Works only on the immediate host to which this agent logged into.\n * If you would like to transfer data that are one or more network\n * hops away (i.e. recursive ssh calls), then you will need to\n * upload to the immediate host, then scp to the destination host,\n * and then delete the immediate copy (to clean up).\n *\n * @param source data to be uploaded\n * @param remoteFileName destination file path/name\n * @return true if the entire uploaded was successful\n */\n boolean upload(\n InputStream source, String remoteFileName);\n \n \n //-------------------------------------------------------------------------\n boolean download(\n String remoteFileName, String localFileName);\n\n boolean download(\n String remoteFileName, File localFile);\n\n /**\n * Does not automatically close the given source stream.\n *\n * For downloading data from multiple network hops away,\n * use a similar method as described for uploading.\n * @see #upload(InputStream, String)\n * \n * @param remoteFileName file path/name to download\n * @param destination sink for remote file data\n * @return true if the entire download was successful\n */\n boolean download(\n String remoteFileName, OutputStream destination);\n\n\n //-------------------------------------------------------------------------\n boolean open();\n void openChecked() throws IOException;\n\n @Override\n void close();\n}", "private void SendCommandOrKeys(int viewID, String data)\n\t{\n\t\tif (mCommandManager == null)\n\t\t{\n\t\t\treturn ;\n\t\t}\n\t\t\n\t\tif (viewID == VIEW_ID_COMMAND)\n\t\t{\n // In put case, select file\n if (data.contains(\"!put\"))\n {\n Intent intent = new Intent(Intent.ACTION_GET_CONTENT);\n intent.setType(\"*/*\");\n intent.addCategory(Intent.CATEGORY_OPENABLE);\n mPutCommand = data;\n\n try\n {\n startActivityForResult(Intent.createChooser(intent, \n\t\t\t\t\t\t\"Select a File\"), CHOOSE_FILE_TO_UPLOAD);\n } catch (android.content.ActivityNotFoundException ex)\n {\n ex.printStackTrace();\n }\n\n return ;\n }\n\n\t\t\tmCommandManager.SendCommand(data);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tAddMsgToKeyView(viewID, \"remote> \" + data + \"\\n\");\n\n if (data.equals(\"!autotest\"))\n {\n // Run android autotest\n AddMsgToKeyView(viewID, \"remote> wait until the test ends\\n\");\n RunAutoTest();\n }\n else if (data.equals(\"!pintest\"))\n {\n // Run android autotest\n AddMsgToKeyView(viewID, \"remote> wait until the test ends\\n\");\n RunPinTest();\n }\n else if (data.equals(\"!stoptest\"))\n {\n mStopTest = true;\n }\n else\n {\n mCommandManager.SendKey(data);\n }\n\t\t}\t\t\n\t}", "@Override\n\tpublic void send(OutputStream stream) throws IOException {\n\t\tstream.write(this.data);\n\t}", "public void run()\n {\n try\n {\n // Load the manifest file\n File manifest = new File(UploaderMain.getManifestName());\n if (!manifest.exists())\n {\n ErrorPrinter.printError(ErrorCode.fileNotFound, \"manifest does not exist\");\n System.exit(0);\n }\n\n // Read names of files from manifest\n Map<String, File> files = new HashMap<String, File>();\n BufferedReader manifestReader = new BufferedReader(new FileReader(manifest));\n String line;\n long totalLength = 0;\n while ((line = manifestReader.readLine()) != null)\n {\n if (line.startsWith(\"//\") || line.trim().isEmpty()) continue; // ignore comments\n StringTokenizer token = new StringTokenizer(line, \"@\");\n String destinationName = token.nextToken();\n String localName = token.nextToken();\n File f = new File(localName);\n if (!f.exists())\n {\n \tErrorPrinter.printError(ErrorCode.fileNotFound, \"file \" + localName + \" not found\");\n \tcontinue;\n }\n totalLength += f.length();\n files.put(destinationName, f);\n }\n manifestReader.close();\n\n dOut.writeInt(files.size());\n dOut.writeLong(totalLength);\n\n for (String s : files.keySet())\n {\n File f = files.get(s);\n \n try\n {\n // Send the name and length of the file\n dOut.writeUTF(s);\n dOut.writeLong(f.length());\n\n // Send the file over the network\n FileInputStream reader = new FileInputStream(f);\n byte[] buffer = new byte[BUFFER_SIZE];\n int numRead;\n long numSent = 0;\n while (numSent < f.length())\n {\n numRead = reader.read(buffer);\n dOut.write(buffer, 0, numRead);\n numSent += numRead;\n }\n\n reader.close();\n }\n catch (Exception e)\n {\n System.out.println(\"Error sending file \" + f.getName());\n }\n }\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n }", "public PluginResult performAction(Map<String, String> args) {\n\t\tFile file = null;\n\t\ttry {\n\t\t\tSystem.out.println(\"FilePath : \"+args.get(AttPluginConstants.ARG_FILEPATH));\n\t\t\tfile = AttPluginUtils.getFile(args.get(AttPluginConstants.ARG_FILEPATH));\n\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn new PluginResult(PluginResult.Status.ERROR, AttPluginUtils.prepareMessage(AttPluginConstants.ERR_FILE_NA_CODE, AttPluginConstants.ERR_FILE_NA_MSG));\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t\treturn new PluginResult(PluginResult.Status.ERROR, AttPluginUtils.prepareMessage(AttPluginConstants.ERR_PROCESS_AUDIO_CODE, AttPluginConstants.ERR_PROCESS_AUDIO_MSG));\n\t\t}\n\n\t\t// Http Processing\n\t\tDefaultHttpClient httpclient = new DefaultHttpClient();\n\n\t\tboolean isChunked=false;\n\t\tString transferEncoding=args.get(AttPluginConstants.ARG_HEADER_TRANSFER_ENCODING);\n\t\tif(transferEncoding!=null && transferEncoding.equalsIgnoreCase(AttPluginConstants.VAL_TRANSFER_ENCODING_CHUNKED))\n\t\t{\n\t\t\tisChunked=true;\n\t\t}\n\t\t\n\t\tHttpPost httppost = AttPluginUtils.prepareRequest(file, args.get(AttPluginConstants.ARG_URL),isChunked);\n\n\t\thttppost.addHeader(\"Authorization\", args.get(AttPluginConstants.ARG_TOKEN));\n\t\thttppost.addHeader(\"Accept\", args.get(AttPluginConstants.ARG_HEADER_ACCEPT));\n\n\t\tif (args.containsKey(AttPluginConstants.ARG_HEADER_CONTENT_TYPE)) {\n\t\t\thttppost.addHeader(\"Content-Type\", args.get(AttPluginConstants.ARG_HEADER_CONTENT_TYPE));\n\t\t}\n\n\t\tif (args.containsKey(AttPluginConstants.ARG_HEADER_XSPEECH_CONTEXT)) {\n\t\t\thttppost.addHeader(\"X-SpeechContext\", args.get(AttPluginConstants.ARG_HEADER_XSPEECH_CONTEXT));\n\t\t}\n\t\t\n\t\tif(args.get(AttPluginConstants.ARG_HEADER_XSPEECH_CONTEXT).equalsIgnoreCase(\"Generic\")){\n\t\t\tif (args.containsKey(AttPluginConstants.ARG_CONTENT_LANGUAGE)) {\n\t\t\t\thttppost.addHeader(\"Content-Language\", args.get(AttPluginConstants.ARG_CONTENT_LANGUAGE));\n\t\t\t}\n\t\t}else{\n\t\t\tif(args.containsKey(AttPluginConstants.ARG_XARG)){\n\t\t\t\thttppost.addHeader(\"X-Arg\", args.get(AttPluginConstants.ARG_XARG));\n\t\t\t}\n\t\t}\n\n\t\tif (args.containsKey(AttPluginConstants.ARG_HEADER_CONTENT_LENGTH)) {\n\t\t\thttppost.addHeader(\"Content-Length\", args.get(AttPluginConstants.ARG_HEADER_CONTENT_LENGTH));\n\t\t}\n\n\t\tif (args.containsKey(AttPluginConstants.ARG_HEADER_TRANSFER_ENCODING)) {\n\t\t\thttppost.addHeader(\"Transfer-Encoding\", args.get(AttPluginConstants.ARG_HEADER_TRANSFER_ENCODING));\n\t\t}\n\t\t\n\t\tString result = null;\n\t\ttry {\n\t\t\tresult = AttPluginUtils.processResponse(httpclient.execute(httppost));\n\t\t\tSystem.out.println(\"result : \"+result);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tString message = null;\n\t\t\tString code = null;\n\t\t\tif (e.equals(AttPluginConstants.ERR_INV_STATUS_MSG)) {\n\t\t\t\tcode = AttPluginConstants.ERR_INV_STATUS_CODE;\n\t\t\t\tmessage = AttPluginConstants.ERR_INV_STATUS_MSG;\n\t\t\t} else {\n\t\t\t\tcode = AttPluginConstants.ERR_PROCESS_REQ_CODE;\n\t\t\t\tmessage = AttPluginConstants.ERR_PROCESS_REQ_MSG;\n\t\t\t}\n\t\t\treturn new PluginResult(PluginResult.Status.ERROR, AttPluginUtils.prepareMessage(code, message));\n\t\t} finally {\n\t\t\targs.clear();\n\t\t\targs = null;\n\t\t}\n\n\t\treturn new PluginResult(PluginResult.Status.OK, result);\n\t}", "@Override\r\n\tpublic void runSystem() throws IOException {\n\t\tclientWithHalf.setHalfFile(fileHalf);\r\n\t\tserverWithTotal.setTotalFile(fileTotal);\r\n\t\tclientWithHalf.connect(serverWithTotal);\r\n\t\tserverWithTotal.connect(clientWithHalf);\r\n\t\tclientWithHalf.sendCheckSumFile();\r\n\t\tserverWithTotal.receieveCheckSumFile();\r\n\t\tserverWithTotal.startMatch();\r\n\t\tserverWithTotal.sendBackData();\r\n\t\tclientWithHalf.rebuidFile();\r\n\t\tclientWithHalf.checkFileEqual();\r\n\t\tclientWithHalf.clearTempData();\r\n\t\tserverWithTotal.getConfirm();\r\n\t\tserverWithTotal.clearTempData();\r\n\t}", "public abstract boolean send(byte[] data);", "private boolean processFileStage(final Object data) {\n\t\t// verificamos si el comando anterior fue la solicitud de envio de fichero\n\t\tif (this.getLastCommand().equals(Commands.FILE)) {\n\t\t\t// verificamos si respondio OK\n\t\t\tif (((Commands) data).equals(Commands.ACK))\n\t\t\t\t// solicitamos el envio del nombre del fichero\n\t\t\t\tthis.send(Commands.DATA);\n\t\t\t// verificamos si pedimos el nombre\n\t\t} else if (this.getLastCommand().equals(Commands.NAME)) {\n\t\t\t// mostramos un log\n\t\t\tthis.getLogger().debug(\">>> \" + data);\n\t\t\t// almacenamos el nombre del fichero\n\t\t\tthis.setFileName(data.toString());\n\t\t\t// solicitamos el tamano del fichero\n\t\t\tthis.send(Commands.SIZE);\n\t\t\t// verificamos si solicitamos el tamano del fichero\n\t\t} else if (this.getLastCommand().equals(Commands.SIZE)) {\n\t\t\t// mostramos un log\n\t\t\tthis.getLogger().debug(\">>> \" + data + \" bytes\");\n\t\t\t// almacenamos el tamano del fichero\n\t\t\tthis.setFileSize(Long.parseLong(data.toString()));\n\t\t\t// solicitamos el fichero\n\t\t\tthis.send(Commands.DATA);\n\t\t\t// obtenemos el fichero\n\t\t\tfinal File receivedFile = this.receiveFile();\n\t\t\t// modficamos la etapa\n\t\t\tthis.setLocalStage(Stage.POST);\n\t\t\t// retornamos ok\n\t\t\tthis.send(Commands.ACK);\n\t\t\t// recibimos el fichero y lo procesamos\n\t\t\tthis.fileReceived(receivedFile);\n\t\t\t// verificamos si es solicitud de datos del fichero\n\t\t} else if (((Commands) data).equals(Commands.DATA)) {\n\t\t\t// verificamos si es solicitud de envio de nombre\n\t\t\tif (this.getLastCommand().equals(Commands.ACK))\n\t\t\t\t// solicitamos el nombre del fichero\n\t\t\t\tthis.send(Commands.NAME);\n\t\t\telse\n\t\t\t\t// enviamos el fichero\n\t\t\t\tthis.sendFileContents();\n\t\t\t// verificamos si se pidio el nombre\n\t\t} else if (((Commands) data).equals(Commands.NAME))\n\t\t\t// enviamos el nombre del fichero\n\t\t\tthis.send(this.getFile().getName());\n\t\t// verificamos si se pidio el tamano del fichero\n\t\telse if (((Commands) data).equals(Commands.SIZE))\n\t\t\t// retornamos el tamano del fichero\n\t\t\tthis.send(this.getFile().length());\n\t\t// verificamos si se pidio el tamano del fichero\n\t\telse if (((Commands) data).equals(Commands.ACK))\n\t\t\t// cambiamos al modo normal\n\t\t\tthis.setLocalStage(Stage.POST);\n\t\t// retornamos true para continuar\n\t\treturn true;\n\t}", "private void sendData() {\n final ByteBuf data = Unpooled.buffer();\n data.writeShort(input);\n data.writeShort(output);\n getCasing().sendData(getFace(), data, DATA_TYPE_UPDATE);\n }", "@Override\n\tpublic void handleCommand(HttpServletRequest req, HttpServletResponse resp,\n\t\t\tIUser user) throws IOException {\n\t\tString apkPath = req.getParameter(\"apkPath\");\n\t\tSystem.out.println(apkPath);\n\t\tFile apkFile = new File(apkPath);\n\t\tFileInputStream is = new FileInputStream(apkFile);\n\t\tint bytesIn = 0;\n\t\tbyte[] readBytes = new byte[2156];\n\t\tresp.reset();\n\t\tresp.setContentType(\"application/x-download\");\n\t\tresp.setHeader(\"Content-Disposition\",\n\t\t\t\t\"attachment; filename=\" + apkFile.getName());\n\t\tOutputStream os = resp.getOutputStream();\n\t\ttry {\n\t\t\twhile ((bytesIn = is.read(readBytes)) != -1) {\n\t\t\t\tos.write(readBytes, 0, bytesIn);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tis.close();\n\t\t\t\tos.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\n\t}", "public void run() {\n\t\ttry {\n\t\t\t// Get input and output streams to talk to the client\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(csocket.getInputStream()));\n\t\t\tPrintWriter out = new PrintWriter(csocket.getOutputStream());\n\t\t\t/*\n\t\t\t * read the input lines from client and perform respective action based on the\n\t\t\t * request\n\t\t\t */\n\t\t\tString line;\n\t\t\twhile ((line = in.readLine()) != null) {\n\t\t\t\t// return if all the lines are read\n\t\t\t\tif (line.length() == 0)\n\t\t\t\t\tbreak;\n\t\t\t\telse if (line.contains(\"GET\") && line.contains(\"/index.html\")) {\n\t\t\t\t\t/*\n\t\t\t\t\t * get the respective file requested by the client i.e index.html\n\t\t\t\t\t */\n\t\t\t\t\tFile file = new File(WEB_ROOT, \"/index.html\");\n\t\t\t\t\t// send HTTP Headers\n\t\t\t\t\tout.println(\"HTTP/1.1 200 OK\");\n\t\t\t\t\tout.println(\"Date: \" + new Date());\n\t\t\t\t\tout.println(\"Content-length: \" + file.length());\n\t\t\t\t\tout.println(); // blank line between headers and content\n\t\t\t\t\tout.flush(); // flush character output stream buffer\n\t\t\t\t\tout.write(FileUtils.readFileToString(file, \"UTF-8\"), 0, ((int) file.length()));\n\t\t\t\t} else if (line.contains(\"PUT\")) {\n\t\t\t\t\t/*\n\t\t\t\t\t * put the respective file at a location on local\n\t\t\t\t\t */\n\t\t\t\t\tString[] split = line.split(\" \");\n\t\t\t\t\tFile source = new File(split[1]);\n\t\t\t\t\tFile dest = new File(WEB_ROOT, \"clientFile.html\");\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// copy the file to local storage\n\t\t\t\t\t\tFileUtils.copyFile(source, dest);\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\t// send HTTP Headers\n\t\t\t\t\tout.println(\"HTTP/1.1 200 OK\");\n\t\t\t\t\tout.println(\"Date: \" + new Date());\n\t\t\t\t\tout.println(); // blank line between headers and content\n\t\t\t\t\tout.flush(); // flush character output stream buffer\n\t\t\t\t} else {\n\t\t\t\t\tout.print(line + \"\\r\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t// closing the input and output streams\n\t\t\tout.close(); // Flush and close the output stream\n\t\t\tin.close(); // Close the input stream\n\t\t\tcsocket.close(); // Close the socket itself\n\t\t} // If anything goes wrong, print an error message\n\t\tcatch (Exception e) {\n\t\t\tSystem.err.println(e);\n\t\t\tSystem.err.println(\"Usage: java HttpMirror <port>\");\n\t\t}\n\t}", "@Override\n protected void prepareHttpConnection(HttpURLConnection conn) throws CommandException {\n super.prepareHttpConnection(conn);\n if (!command.dirDeploy) {\n conn.setRequestProperty(\"Content-Type\",\n \"multipart/form-data; boundary=\" + multipartBoundary);\n }\n }", "public void run() {\n try {\n while (true) {\n BufferedReader inFromKeyBoard = new BufferedReader(new InputStreamReader(System.in));\n OutputStream outToClient = socket.getOutputStream();\n BufferedReader inFromClient = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n DataInputStream inFromServer = null;\n DataOutputStream outToServer = null;\n String cmd = inFromClient.readLine();\n System.out.println(\"The Client request for: \" + cmd);\n if (cmd == null)\n continue;\n\n /**\n * Process the command from client and identify the method and address.\n * If command error, write the error response and break.\n *\n */\n String[] strs = cmd.split(\" \");\n\n String method = strs[0];\n\n if (!method.equals(\"GET\")) {\n continue;\n }\n\n String url = strs[1];\n if (!url.contains(\"://\")) {\n url = url + \"http://\";\n }\n\n /**\n * Process the file name and make sure the server name, the file path and the number of port.\n *\n */\n int port = 0;\n String serverName = \"\";\n String filePath = \"\";\n\n URL new_url = new URL(url);\n serverName = new_url.getHost();\n port = new_url.getPort();\n if (port == -1) {\n port = 80;\n }\n url = url.substring(url.indexOf(\"//\") + 2);\n filePath = url.substring(url.indexOf(\"/\"));\n\n /**\n * Response the right format request. Identify the file type and write it to the client.\n *\n */\n System.out.println(\"HOST: \" + serverName);\n System.out.println(\"PORT: \" + port);\n System.out.println(filePath);\n System.out.println(\"Now respond the Client \\'s request: \");\n\n Socket clientSocket = new Socket(serverName, port);// the Proxy Server Functions as client\n\n inFromServer = new DataInputStream(clientSocket.getInputStream());\n outToServer = new DataOutputStream(clientSocket.getOutputStream());\n\n outToServer.writeBytes(\"GET \" + filePath + \" HTTP/1.0\\r\\n\\r\\n\");\n\n byte[] bytes = new byte[1024];\n\n int size = 0;\n\n /**\n * Read from Server and Write to Client.\n *\n */\n while ((size = inFromServer.read(bytes, 0, 1024)) != -1) {\n outToClient.write(bytes, 0, size);\n outToClient.flush();\n }\n break;\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n // close the socket\n finally {\n try {\n if (socket != null) {\n socket.close();\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }", "public void transferFile() {\n\t\t// create file event and set client and server path\n\t\tfileEvent = new FileEvent();\n\t\tfileEvent.setClientPath(clientPath);\n\t\tfileEvent.setServerPath(serverPath);\n\t\t\n\t\t// get client name and set filename\n\t\tFile file = new File(clientPath);\n\t\tString name = clientPath.substring(clientPath.lastIndexOf(\"/\") + 1, \n\t\t\t\t\t\tclientPath.length());\n\t\tfileEvent.setFilename(name);\n\t\t\n\t\t// checks if the file exists in the path mentioned or sets valid to No\n\t\tif (file.isFile()) {\n\t\t\t//creates input stream setup the data in byte arrays\n\t\t\tDataInputStream inStream = null;\n\t\t\ttry {\n\t\t\t\tinStream = new DataInputStream(new FileInputStream(file));\n\t\t\t\tlong length = (int) file.length();\n\t\t\t\tbyte[] byteArray = new byte[(int) length];\n\t\t\t\tint start = 0;\n\t\t\t\tint last = 0;\n\t\t\t\tint rest = inStream.read(byteArray, start, \n\t\t\t\t\t\t\t\t\t\t\tbyteArray.length - start);\n\t\t\t\twhile (start < byteArray.length && (last = rest) >= 0) {\n\t\t\t\t\tstart = start + last;\n\t\t\t\t}\n\t\t\t\tfileEvent.setFileSize(length);\n\t\t\t\tfileEvent.setFileData(byteArray);\n\t\t\t\tfileEvent.setValid(\"Yes\");\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\tfileEvent.setValid(\"No\");\n\t\t\t}\n\t\t} else {\n\t\t\tSystem.out.println(\"Path does not exist.\");\n\t\t\tfileEvent.setValid(\"No\");\n\t\t}\n\t\t// Start sending the data byte array\n\t\ttry {\n\t\t\toutStream.writeObject(fileEvent);\n\t\t\tSystem.out.println(\"Done...\");\n\t\t\tThread.sleep(5000);\n\t\t\tSystem.exit(0);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public static void main(String[] args) throws IOException {\n ServerFile severFile = new ServerFile();\n severFile.createChannel(\"127.0.0.1\",9091);\n// SocketChannel socketChannel = severFile.createChannel(\"127.0.0.1\",9090);\n// severFile.sendFile(socketChannel);\n }", "public void sendCommand(Command cmd);", "public static void main(String[] args) {\n\t\t\n\t\tif(args.length != 4){\n\t\t\tSystem.out.println(\"Program takes 4 arguments. Usage: java HttpClient localhost <port number> <Request Type(GET/PUT)> <filepath>\");\n\t\t}else{\n\t\t\tif (!isNumeric(args[1]))\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Please enter valid Port no\");\n\t\t\t\treturn;\n\t\t\t}\n String hostName = args[0];\n\t\t\tint portNo = Integer.parseInt(args[1]);\n\t\t\tString requestType = args[2];\n\t\t\tString filePath = args[3];\n\t\t\tObjectOutputStream outs;\n\t\t\tObjectInputStream ins;\n\t\t\t\n\t\ttry {\n \n\t\t\tSocket socket = new Socket(hostName, portNo);\n\t\t\tSystem.out.println(\"\\n\" + \"Connected to Server on port \" + portNo);\n\t\t\t\n\t\t\touts = new ObjectOutputStream(socket.getOutputStream()); \n\t\t\tins = new ObjectInputStream(socket.getInputStream());\n\t\t\t\n\t\t\tif(requestType.equals(GET)){\n\t\t\t\tSystem.out.println(requestType + \" \" + filePath + \" HTTP/1.1\");\n\t\t\t\tSystem.out.println(\"Host:\" + hostName);\n\t\t\t\touts.writeObject(requestType + \" \" + filePath + \" HTTP/1.1\");\n\t\t\t\touts.writeObject(\"Host:\" + hostName);\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\t\n\t\t\t\t\tString response = (String) ins.readObject();\n\n\t\t\t\t\tSystem.out.println(\"Status: \" + response + \"\\n\");\n\t\t\t\t\tif ( response.equals(RESPONSE_OK)) \n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"Requested file contains : \\n\");\n\t\t\t\t\t\tSystem.out.println(\"-------------------------------------------------\");\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tString line = (String) ins.readObject();\n\t\t\t\t\t\t\twhile (line != null) \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tSystem.out.println(line);\n\t\t\t\t\t\t\t\tline = (String) ins.readObject();\n\t\t\t\t\t\t\t}\n \n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tcatch(EOFException e)\n\t\t\t\t\t\t{\n System.out.println(\"-------------------------------------------------\");\n\t\t\t\t\t\t\tSystem.out.println(\"\\nFile is received\\n\");\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\telse {\n\t\t\t\t\t\tSystem.out.println(response);\n\t\t\t\t\t\t}\n\t\t\t\t} catch (ClassNotFoundException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse if ( requestType.equals(PUT)) \n\t\t\t{\n\t\t\t\tFile file = new File(filePath); \n\t\t\t\tif (!(file.isDirectory()) && (file.exists()))\n\t\t\t\t{\n System.out.println(\"Sending the file: \" + file.getName() + \" to server....\\n\"); \n\t\t\t\t\touts.writeObject(requestType + \" \" + filePath + \" HTTP/1.1\");\n\t\t\t\t\t\n\t\t\t\t\tInputStream fis = new FileInputStream(file); \n\t\t\t\t\tbyte [] buffer = new byte[(int)file.length()];\n\n\t\t\t\t\tint noOfBytes = fis.read(buffer);\n\t\t\t\t\ttry{\n\t\t\t\t\t\tif(noOfBytes > 0)\n\t\t\t\t\t\t{ \n\t\t\t\t\t\t\touts.write(buffer, 0, noOfBytes);\n\t\t\t\t\t\t\touts.flush();\n\t\t\t\t\t\t\tSystem.out.println(\"File: \" + file.getName() + \" Sent\\n\\n\");\n\t\t\t\t\t\t} \n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception e)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"\\n\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tfis.close();\n\t\t\t\t\tSystem.out.println(\"Status Code from server: \" + ins.readObject() + \"\\n\");\n\t\t\t\t\tSystem.out.println(\"Status Message from server: \" + ins.readObject() + \"\\n\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"File doesn't exist\\n\");\n\t\t\t\t\touts.writeObject(\"Invalid File\");\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Invalid Request type. Use only GET/PUT \\n\");\n\t\t\t\touts.writeObject(\"Invalid Request type\");\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"Closing the Socket\");\n\t\t\t\n\t\t\touts.close();\n\t\t\tins.close();\t\t\t\n\t\t\tsocket.close();\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 sendRequest(SimpleChannelHandler handler){\n fileServer.sendMessage(this.packet,new FileNode(ip,port),handler);\n }", "@Override\n\tpublic void run() {\n\t\tString request;\n\t\ttry {\n\t\t\tSocketBuilder socketBuilder = new SocketBuilder(this.IP);\n\n\t\t\tSocket clientSocketStrings = socketBuilder.createStringSocket();\n\t\t\tSocket clientSocketBytes = socketBuilder.createByteSocket();\n\n\t\t\tDataOutputStream outToServer = new DataOutputStream(clientSocketStrings.getOutputStream());\n\n\t\t\tDataInputStream bytesStream = new DataInputStream(clientSocketBytes.getInputStream());\n\n\t\t\tBufferedReader inFromServer = new BufferedReader(\n\t\t\t\t\tnew InputStreamReader(clientSocketStrings.getInputStream(), StandardCharsets.UTF_8));\n\t\t\t\n\t\t\tMessage requestMessage = new Message();\n\t\t\trequestMessage.createDownloadMessage(path);\n\n\t\t\trequest = JsonParser.messageToJson(requestMessage);\n\n\t\t\toutToServer.write(request.getBytes(\"UTF-8\"));\n\t\t\toutToServer.writeByte('\\n');\n\n\t\t\tMessage responseMessage = JsonParser.jsonToMessage(inFromServer.readLine());\n\n\t\t\t// check if operation is possible\n\t\t\tif (responseMessage.isERRORMessage()) {\n\t\t\t\t/*\n\t\t\t\t * Handle Error Here\n\t\t\t\t */\n\t\t\t} else {\n\n\t\t\t\tFileTransfer fileTransfer = new FileTransfer();\n\n\t\t\t\tlong size = Long.parseLong(inFromServer.readLine());\n\n\t\t\t\tEstimationViewManagementThread manage = new EstimationViewManagementThread(size, \n\t\t\t\t\t\tfileTransfer, clientSocketStrings, clientSocketBytes);\n\t\t\t\tmanage.start();\n\t\t\t\tfileTransfer.receiveFiles(bytesStream, inFromServer, locationToSave);\n\t\t\t}\n\t\t\t\n\t\t\toutToServer.close();\n\t\t\tbytesStream.close();\n\t\t\tinFromServer.close();\n\t\t\tclientSocketBytes.close();\n\t\t\tclientSocketStrings.close();\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void cmdHandler(JSONArray parameter, String cmd) {\n switch (cmd) {\n case \"login\":\n signIn(parameter);\n break;\n case \"time\":\n Date d = new GregorianCalendar().getTime();\n clientResponse(d.toString());\n break;\n case \"ls\":\n listFiles(parameter);\n break;\n case \"who\":\n clientResponse(MailboxServer.getUsersAsString());\n break;\n case \"msg\":\n sendMessage(parameter);\n break;\n case \"exit\":\n signOut();\n break;\n }\n }", "@Override\n\tpublic void handleServerCmd() {\n\t\t\n\t}", "default void sendBinary(byte[] data) {\n ByteBuffer buffer = ByteBuffer.wrap(data);\n sendBinary(buffer);\n }", "@Override\n public void send(String key, String data) throws IOException {\n\n }", "public interface Command {\n\t public String execute(String[] request);\n}", "@Override\r\n\tpublic void exec() {\n\t\tHttpRequestHead hrh = null;\r\n\t\tint headSize = 0;\r\n\t\tboolean isSentHead = false;\r\n\t\ttry {\r\n\t\t\tArrays.fill(buffer, (byte) 0);\r\n\t\t\tint getLen = 0;\r\n\t\t\tboolean getHead = false;\r\n\t\t\tint mode = 0;\r\n\t\t\tlong contentLength = 0;\r\n\t\t\twhile (!proxy.isClosed.get()) {\r\n\t\t\t\tint nextread = inputStream.read(buffer, getLen, buffer.length - getLen);\r\n\t\t\t\tif (nextread == -1) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tgetLen += nextread;\r\n\t\t\t\tif (!getHead) {\r\n\t\t\t\t\tif ((headSize = Proxy.protocol.validate(buffer, getLen)) > 0) {\r\n\t\t\t\t\t\thrh = (HttpRequestHead) Proxy.protocol.decode(buffer);\r\n\t\t\t\t\t\tlog.debug(proxy.uuid + debug + \"传入如下请求头:\" + new String(Proxy.protocol.encode(hrh)));\r\n\t\t\t\t\t\t\r\n//\t\t\t\t\t\tif(\"keep-alive\".equals(hrh.getHead(\"Connection\")))\r\n//\t\t\t\t\t\t\tkeepAlive = true;\r\n\t\t\t\t\t\tif (\"chunked\".equals(hrh.getHead(\"Transfer-Encoding\")))\r\n\t\t\t\t\t\t\tmode = 2;\r\n\t\t\t\t\t\tif (!StringUtils.isBlank(hrh.getHead(\"Content-Length\"))) {\r\n\t\t\t\t\t\t\tmode = 1;\r\n\t\t\t\t\t\t\tcontentLength = Long.valueOf(hrh.getHead(\"Content-Length\"));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tString forward = hrh.getHead(\"X-Forwarded-For\");\r\n\t\t\t\t\t\tif (!StringUtils.isBlank(forward))\r\n\t\t\t\t\t\t\tforward += \",\";\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tforward = \"\";\r\n\t\t\t\t\t\tforward += proxy.source.getInetAddress().getHostAddress();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\thrh.addHead(\"X-Forwarded-For\", forward);\r\n\t\t\t\t\t\thrh.addHead(\"X-Forwarded-Proto\", \"http\");\r\n\t\t\t\t\t\thrh.addHead(\"X-Forwarded-Host\", CoreDef.config.getString(\"serverIp\"));\r\n\r\n\t\t\t\t\t\tgetHead = true;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// http访问代理服务器模式\r\n//\t\t\t\t\t\tInetAddress addr = InetAddress.getByName(hrh.getHead(\"host\"));\r\n//\t\t\t\t\t\tproxy.destination = new Socket(addr, 80);\r\n//\t\t\t\t\t\toutputStream = proxy.destination.getOutputStream();\r\n//\t\t\t\t\t\tproxy.sender = new ServerChannel(proxy);\r\n//\t\t\t\t\t\tproxy.sender.begin(\"peer - \" + this.getTaskId());\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\theadSize = 0;\r\n\t\t\t\t\t\tif (getLen > buffer.length - 128)\r\n\t\t\t\t\t\t\tbuffer = Arrays.copyOf(buffer, buffer.length * 10);\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(!isSentHead) {\r\n\t\t\t\t\tisSentHead = true;\r\n\t\t\t\t\tlog.debug(proxy.uuid + \"为\" + debug + \"转发了如下请求头:\" + new String(Proxy.protocol.encode(hrh)));\r\n\t\t\t\t\toutputStream.write(Proxy.protocol.encode(hrh));\r\n//\t\t\t\t\tswitch (mode) {\r\n//\t\t\t\t\tcase 1:\r\n//\t\t\t\t\t\toutputStream.write(buffer, headSize, getLen - headSize);\r\n//\t\t\t\t\t\tcontentLength -= getLen - headSize;\r\n//\t\t\t\t\t\tbreak;\r\n//\t\t\t\t\tcase 2:\r\n//\t\t\t\t\t\tcontentLength += getChunkedContentSize(buffer, headSize, getLen - headSize);\r\n//\t\t\t\t\t\toutputStream.write(buffer, headSize, getLen - headSize);\r\n//\t\t\t\t\t\tcontentLength -= getLen - headSize;\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\tswitch (mode) {\r\n\t\t\t\tcase 1:\r\n\t\t\t\t\toutputStream.write(buffer, headSize, getLen-headSize);\r\n\t\t\t\t\tcontentLength -= getLen - headSize;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 2:\r\n\t\t\t\t\tcontentLength += getChunkedContentSize(buffer, headSize, getLen-headSize);\r\n\t\t\t\t\toutputStream.write(buffer, 0, getLen);\r\n\t\t\t\t\tcontentLength -= getLen - headSize;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\theadSize = 0;\r\n\t\t\t\tif(contentLength == 0) {\r\n\t\t\t\t\tgetHead = false;\r\n\t\t\t\t\tisSentHead = false;\r\n\t\t\t\t}\r\n\t\t\t\tgetLen = 0;\r\n\t\t\t\tArrays.fill(buffer, (byte) 0);\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tlog.info(proxy.uuid + \"与客户端通信发生异常\" + Utils.getStringFromException(e));\r\n\t\t\tlog.info(proxy.uuid + \"最后的数据如下\" + new String(buffer).trim());\r\n\t\t\t\r\n\t\t} finally {\r\n\t\t\tlog.info(proxy.uuid + \"与客户端通信,试图关闭端口\");\r\n\t\t\tproxy.close();\r\n\t\t}\r\n\t}", "private native int cmdXfer0(byte[] request, byte[] response);", "private void handleStor(String file) {\n if (file == null) {\n sendMsgToClient(\"501 No filename given\");\n } else {\n File f = new File(currDirectory + fileSeparator + file);\n\n if (f.exists()) {\n sendMsgToClient(\"550 File already exists\");\n }\n\n else {\n\n // Binary mode\n if (transferMode == transferType.BINARY) {\n BufferedOutputStream fout = null;\n BufferedInputStream fin = null;\n\n sendMsgToClient(\"150 Opening binary mode data connection for requested file \" + f.getName());\n\n try {\n // create streams\n fout = new BufferedOutputStream(new FileOutputStream(f));\n fin = new BufferedInputStream(dataConnection.getInputStream());\n } catch (Exception e) {\n debugOutput(\"Could not create file streams\");\n }\n\n debugOutput(\"Start receiving file \" + f.getName());\n\n // write file with buffer\n byte[] buf = new byte[1024];\n int l = 0;\n try {\n while ((l = fin.read(buf, 0, 1024)) != -1) {\n fout.write(buf, 0, l);\n }\n } catch (IOException e) {\n debugOutput(\"Could not read from or write to file streams\");\n e.printStackTrace();\n }\n\n // close streams\n try {\n fin.close();\n fout.close();\n } catch (IOException e) {\n debugOutput(\"Could not close file streams\");\n e.printStackTrace();\n }\n\n debugOutput(\"Completed receiving file \" + f.getName());\n\n sendMsgToClient(\"226 File transfer successful. Closing data connection.\");\n\n }\n\n // ASCII mode\n else {\n sendMsgToClient(\"150 Opening ASCII mode data connection for requested file \" + f.getName());\n\n BufferedReader rin = null;\n PrintWriter rout = null;\n\n try {\n rin = new BufferedReader(new InputStreamReader(dataConnection.getInputStream()));\n rout = new PrintWriter(new FileOutputStream(f), true);\n\n } catch (IOException e) {\n debugOutput(\"Could not create file streams\");\n }\n\n String s;\n\n try {\n while ((s = rin.readLine()) != null) {\n rout.println(s);\n }\n } catch (IOException e) {\n debugOutput(\"Could not read from or write to file streams\");\n e.printStackTrace();\n }\n\n try {\n rout.close();\n rin.close();\n } catch (IOException e) {\n debugOutput(\"Could not close file streams\");\n e.printStackTrace();\n }\n sendMsgToClient(\"226 File transfer successful. Closing data connection.\");\n }\n\n }\n closeDataConnection();\n }\n\n }", "@Override\n public void run()\n {\n try\n {\n InputStream fis = new FileInputStream(transferFile);\n OutputStream sos = socket.getOutputStream();\n\n logWriter.println(\"Sending the file...\");\n\n byte [] buffer = new byte[1024];\n int readBytes;\n while((readBytes = fis.read(buffer)) > -1) {\n sos.write(buffer, 0, readBytes);\n sos.flush();\n }\n\n fis.close();\n sos.close();\n socket.close();\n\n logWriter.println(\"File: \" + transferFile.getName());\n logWriter.println(transferFile.length() + \" bytes sent.\");\n logWriter.println(\"Data Connection Closed.\");\n\n } catch (IOException e)\n {\n e.printStackTrace(logWriter);\n }\n }", "public void sendMessageToServer(ArrayList<String> input) {\r\n\t\ttry {\r\n\t\t\t// OutputStream writing\r\n\t\t\tObjectOutputStream oos = new ObjectOutputStream(client.getOutputStream());\r\n\r\n\t\t\t// ---------------------------------\r\n\t\t\toos.writeObject(input);\r\n\r\n\t\t\t// Actualize\r\n\t\t\toos.flush();\r\n\t\t} catch (UnknownHostException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void sendData(byte[] data) {\n\t\tIoBuffer buf = IoBuffer.allocate(data.length + 10);\n\t\tbuf.put(data);\n\t\tbuf.flip();\n\t\tsendData(buf);\n\t}", "void sendData() throws IOException\n\t{\n\t}", "public static CloseableHttpResponse sendChunk(DigestInputStream dis, int size, String method, URI uri, String filename, String mimeType,\n CloseableHttpClient http, boolean inProgress) throws Exception {\n byte[] chunk = readChunk(dis, size);\n String md5 = new String(Hex.encodeHex(dis.getMessageDigest().digest()));\n HttpUriRequest request = RequestBuilder.create(method).setUri(uri).setConfig(RequestConfig.custom()\n /*\n * When using an HTTPS-connection EXPECT-CONTINUE must be enabled, otherwise buffer overflow may follow\n */\n .setExpectContinueEnabled(true).build()) //\n .addHeader(\"Content-Disposition\", String.format(\"attachment; filename=%s\", filename)) //\n .addHeader(\"Content-MD5\", md5) //\n .addHeader(\"Packaging\", BAGIT_URI) //\n .addHeader(\"In-Progress\", Boolean.toString(inProgress)) //\n .setEntity(new ByteArrayEntity(chunk, ContentType.create(mimeType))) //\n .build();\n CloseableHttpResponse response = http.execute(addXAuthorizationToRequest(request));\n // System.out.println(\"Response received.\");\n return response;\n }", "protected final synchronized boolean send(final Object data, final Commands overWrite) {\n\t\ttry {\n\t\t\t// verificamos si la conexion esta cerrada\n\t\t\tif (this.getConnection().isClosed())\n\t\t\t\t// retornamos false\n\t\t\t\treturn false;\n\t\t\t// mostramos un mensaje\n\t\t\tthis.getLogger().debug((data instanceof Commands || overWrite != null ? \"<<= \" : \"<<< \") + (overWrite != null ? overWrite : data));\n\t\t\t// verificamos si es un comando\n\t\t\tif (!this.getLocalStage().equals(Stage.POST) && data instanceof Commands || overWrite != null)\n\t\t\t\t// almacenamos el ultimo comando enviado\n\t\t\t\tthis.lastCommand = overWrite != null ? overWrite : (Commands) data;\n\t\t\t// enviamos el dato\n\t\t\tthis.getOutputStream().writeObject(data);\n\t\t\t// escribimos el dato\n\t\t\tthis.getOutputStream().flush();\n\t\t} catch (final IOException e) {\n\t\t\t// mostramos el trace\n\t\t\tthis.getLogger().error(e);\n\t\t\t// retornamos false\n\t\t\treturn false;\n\t\t}\n\t\t// retornamos true\n\t\treturn true;\n\t}", "@Override\n public void send(String[] tokens, DataOutputStream dataOutputStream) throws IOException {\n if (headers.isEmpty()) {\n for (int i = 0; i < tokens.length; i++) {\n headers.put(tokens[i], i);\n }\n } else {\n long timestamp = Long.valueOf(tokens[headers.get(Constants.DATE)]) * 1000;\n String section = tokens[headers.get(Constants.REQUEST)].split(\" \")[1].split(\"\\\\/\")[1];\n String remoteHost = tokens[headers.get(Constants.REMOTE_HOST)];\n int bytes = Integer.valueOf(tokens[headers.get(Constants.BYTES)]);\n logEntryBuilder.newMsg().setTimestamp(timestamp).setSection(section).setRemoteHost(remoteHost).setBytes(bytes).send(dataOutputStream);\n }\n }", "public void sendFile(ByteString bs, String filename, int numOfChunks, int chunkId) {\n\t\tHeader.Builder hb = Header.newBuilder();\n\t\thb.setNodeId(999);\n\t\thb.setTime(System.currentTimeMillis());\n\t\thb.setDestination(-1);\n\t\t\n\t\tTask.Builder tb = Task.newBuilder();\n\t\ttb.setNoOfChunks(numOfChunks); //Num of chunks\n\t\ttb.setChunkNo(chunkId); //chunk id\n\t\ttb.setTaskType(Task.TaskType.WRITE);\n\t\ttry {\n\t\t\ttb.setSender(InetAddress.getLocalHost().getHostAddress());\n\t\t} catch (UnknownHostException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttb.setFilename(filename);\n\t\ttb.setChunk(bs);\n\t\t\n\t\tCommandMessage.Builder rb = CommandMessage.newBuilder();\n\t\trb.setHeader(hb);\n\t\trb.setTask(tb);\n\t\trb.setMessage(filename);\n\t\t\n\t\ttry {\n\t\t\t// direct no queue\n\t\t\t// CommConnection.getInstance().write(rb.build());\n\n\t\t\t// using queue\n\t\t\tCommConnection.getInstance().enqueue(rb.build());\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public String sendDataToChildren(byte[] data) throws RemoteException;", "private void serve() {\n\t\tif (request == null) {\n\t\t\tchannel.close();\n\t\t\treturn;\n\t\t}\n\t\tlogger.fine(\"Serving \" + type + \" request : \" + request.getPath());\n\t\tResponse resp = RequestHandler.handle(request);\n\t\tif (resp.getRespCode() == ResponseCode.NOT_FOUND) {\n\t\t\terror404(resp);\n\t\t\treturn;\n\t\t}\n\n\t\tStringBuilder header = new StringBuilder();\n\t\tif (type == Type.HTTP) {\n\t\t\theader.append(\"HTTP/1.0 200 OK\\r\\n\");\n\t\t\theader.append(\"Content-Length: \")\n\t\t\t\t\t.append(resp.getFileData().remaining()).append(\"\\r\\n\");\n\t\t\theader.append(\"Connection: close\\r\\n\");\n\t\t\theader.append(\"Server: Hyperion/1.0\\r\\n\");\n\t\t\theader.append(\"Content-Type: \" + resp.getMimeType() + \"\\r\\n\");\n\t\t\theader.append(\"\\r\\n\");\n\t\t}\n\t\tbyte[] headerBytes = header.toString().getBytes();\n\n\t\tByteBuffer bb = resp.getFileData();\n\t\tChannelBuffer ib = ChannelBuffers.buffer(bb.remaining()\n\t\t\t\t+ headerBytes.length);\n\t\tib.writeBytes(headerBytes);\n\t\tib.writeBytes(bb);\n\t\tchannel.write(ib).addListener(ChannelFutureListener.CLOSE);\n\t}", "public void handleCommand(\n String command, HttpServletRequest request, HttpServletResponse response) {\n JSONObject retValue = null;\n response.setContentType(\"application/json\");\n boolean isPost = \"POST\".equals(request.getMethod());\n try {\n if (command.equals(UPLOAD_TOKEN_PATH)) {\n \t \n \t // Generate an upload path\n \t BlobstoreService blobstoreService = BlobstoreServiceFactory.getBlobstoreService();\n \t retValue = new JSONObject();\n \t // TODO: URL should be based on current env (e.g., mapreduce path may not be consistent)\n \t retValue.put(\"url\", blobstoreService.createUploadUrl(\"/mapreduce/command/upload\"));\n \t \n } else if (command.equals(LIST_CONFIGS_PATH) && !isPost) {\n \n MapReduceXml xml;\n try {\n xml = MapReduceXml.getMapReduceXmlFromFile();\n retValue = handleListConfigs(xml);\n } catch (FileNotFoundException e) {\n retValue = new JSONObject();\n retValue.put(\"status\", \"Couldn't find mapreduce.xml file\");\n }\n } else if (command.equals(LIST_JOBS_PATH) && !isPost) {\n String cursor = request.getParameter(\"cursor\");\n String countString = request.getParameter(\"count\");\n int count = DEFAULT_JOBS_PER_PAGE_COUNT;\n if (countString != null) {\n count = Integer.parseInt(countString);\n }\n \n retValue = handleListJobs(cursor, count);\n } else if (command.equals(CLEANUP_JOB_PATH) && isPost) {\n retValue = handleCleanupJob(request.getParameter(\"mapreduce_id\"));\n } else if (command.equals(ABORT_JOB_PATH) && isPost) {\n retValue = handleAbortJob(request.getParameter(\"mapreduce_id\"));\n } else if (command.equals(GET_JOB_DETAIL_PATH) && !isPost) {\n retValue = handleGetJobDetail(request.getParameter(\"mapreduce_id\"));\n } else if (command.equals(START_JOB_PATH) && isPost) {\n Map<String, String> templateParams = new TreeMap<String, String>();\n Map httpParams = request.getParameterMap();\n for (Object paramObject : httpParams.keySet()) {\n String param = (String) paramObject;\n if (param.startsWith(\"mapper_params.\")) {\n templateParams.put(param.substring(\"mapper_params.\".length()),\n ((String[]) httpParams.get(param))[0]);\n }\n }\n retValue = handleStartJob(templateParams, ((String []) httpParams.get(\"name\"))[0], request);\n } else {\n response.sendError(404);\n return;\n }\n } catch (Throwable t) {\n log.log(Level.SEVERE, \"Got exception while running command\", t); \n try {\n retValue = new JSONObject(); \n retValue.put(\"error_class\", t.getClass().getName());\n retValue.put(\"error_message\",\n \"Full stack trace is available in the server logs. Message: \"\n + t.getMessage());\n } catch (JSONException e) {\n throw new RuntimeException(\"Couldn't create error JSON object\", e);\n }\n }\n try {\n retValue.write(response.getWriter());\n response.getWriter().flush();\n } catch (JSONException e) {\n throw new RuntimeException(\"Couldn't write command response\", e);\n } catch (IOException e) {\n throw new RuntimeException(\"Couldn't write command response\", e);\n }\n }", "public void sendCommand(String str){\n \n /*This string holds the command temporarily*/\n String theLine = str;\n \n /*Writes the command to the Server*/\n try {\n oOS.writeObject(theLine);\n } catch (IOException ex) {\n Logger.getLogger(ClientView.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n /*Clears the terminal screen if the user puts in the right command*/\n if (theLine.equals(\"-clrs\")){\n terminalText.setText(\" \");\n return;\n }\n \n try {\n oOS.flush();\n } catch (IOException ex) {\n Logger.getLogger(ClientView.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n /*String that temporarily holds the input sent from the Server*/\n String tempString = \"\";\n \n try {\n tempString = (String)oIS.readObject();\n } catch (IOException ex) {\n Logger.getLogger(ClientView.class.getName()).log(Level.SEVERE, null, ex);\n } catch (ClassNotFoundException ex) {\n Logger.getLogger(ClientView.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n /*Takes the input from the server and displays it to the temrinal*/\n\tterminalText.append(tempString + \"\\n\");\n\n /*Disables and enables buttons and changes Connect button colour when user quits*/\n if(theLine.equals(\"-quit\")){\n connectButton.setBackground(Color.red);\n connectButton.setEnabled(true);\n sendButton.setEnabled(false);\n terminalText.append(\"CLIENT> Connection closed.\");\n }\n \n }", "public void transmit()\n { \n try\n {\n JSch jsch=new JSch(); //object that allows for making ssh connections\n //Log into the pi\n Session session=jsch.getSession(USERNAME, HOSTNAME, 22); //pi defaults to using port 22 \n session.setPassword(PASSWORD);\n session.setConfig(\"StrictHostKeyChecking\", \"no\"); //necessary to access the command line easily\n \n session.connect(1000);//connect to the pi\n \n Channel channel = session.openChannel(\"exec\");//set session to be a command line \n ((ChannelExec)channel).setCommand(this.command); //send command to the pi\n \n channel.setInputStream(System.in); \n channel.setOutputStream(System.out);\n //connect to the pi so the command can go through\n channel.connect(1000);\n }\n catch(Exception e)\n {\n JOptionPane.showMessageDialog(frame, \"Error connecting to infrared light\", \"Error Message\", JOptionPane.ERROR_MESSAGE);\n }\n }", "public void handleClient(InputStream inFromClient, OutputStream outToClient);", "@Override\n public void stream(T data) {\n channel.write(new DataMessage<>(data));\n }", "@Override\n\t\t\tpublic void handleDataChange(String dataPath, Object data) throws Exception {\n\t\t\t\tString cmd = (String)data;\n\t\t\t\tSystem.out.println(\"执行的命令:\"+cmd);\n\t\t\t\texecCmd(cmd);\n\t\t\t}", "private void sendRequest() throws IOException {\n\t\tHttpURLConnection urlConnection = getHttpURLConnection2(request.getServerUrl());\n\t\t\n\t\ttry {\n\t\t\tInputStream responseStream = null;\n\t final int serverResponseCode = urlConnection.getResponseCode();\n\t if (serverResponseCode / 100 == 2) {\n\t \tresponseStream = urlConnection.getInputStream();\n\t } else { // getErrorStream if the response code is not 2xx\n\t \tresponseStream = urlConnection.getErrorStream();\n\t }\n\t \n\t uploadLstener.onCompleted(uploadId, serverResponseCode, getResponseBodyAsString(responseStream));\n\t responseStream.close();\n\t\t} finally {\n\t\t\turlConnection.disconnect();\n\t\t}\n\t}", "boolean send(byte[] data);", "public static void main(String [] args) throws IOException //added this line\n {\n if (args.length != ARG_CNT) {\n System.out.print(\"Usage: cmd ServerAddress ServerPort\\n\");\n return;\n }\n\n String hostName = args[0];\n String subHostname;\n int portNumber = Integer.parseInt(args[1]);\n int subPortNumber;\n\n try {\n Socket kkSocket = new Socket(hostName, portNumber);\n kkSocket.setSoTimeout(TIMEOUT); //sets Socket Timeout for FFFC in milliseconds\n\n // from client to server\n PrintWriter out1 = new PrintWriter(kkSocket.getOutputStream(), true);\n BufferedWriter out=new BufferedWriter(out1);\n //from server to client\n BufferedReader in = new BufferedReader(new InputStreamReader(kkSocket.getInputStream()));\n //from user\n BufferedReader stdIn =new BufferedReader(new InputStreamReader(System.in));\n\n String fromUserString;\n fromServer = in.readLine();\n while (fromServer != null) {\n String[] fromUser = new String[2];\n System.out.print(\"csftp> \");\n String command = \"\";\n\n try {\n fromUserString = stdIn.readLine();\n fromUser = fromUserString.split(\" \");\n command = fromUser[0].toLowerCase().trim();\n\n }catch(IOException e){\n printErrorMsg(\"FFFE\", null, null);\n System.exit(1);\n }\n\n switch (command) {\n case \"user\":\n if (fromUser.length!=2){\n printErrorMsg(\"002\", \"\", \"\");\n break;\n }\n out.write(\"USER \" + fromUser[1]+\"\\n\");\n out.flush();\n System.out.println(\"--> USER \" + fromUser[1]);\n readMultiLine(in);\n break;\n case \"pw\":\n if (fromUser.length!=2){\n printErrorMsg(\"002\", \"\", \"\");\n break;\n }\n out.write(\"PASS \" + fromUser[1]+\"\\n\");\n out.flush();\n System.out.println(\"--> PASS \" + fromUser[1]); //print out what we send\n readMultiLine(in);\n break;\n case \"cd\":\n if (fromUser.length!=2){\n printErrorMsg(\"002\", \"\", \"\");\n break;\n }\n out.write(\"CWD \"+fromUser[1]+\"\\n\");\n out.flush();\n System.out.println(\"--> CWD \" + fromUser[1]);\n readMultiLine(in);\n break;\n case \"quit\":\n if (fromUser.length!=1){\n printErrorMsg(\"002\", \"\", \"\");\n break;\n }\n out.write(\"QUIT\\n\");\n out.flush();\n System.out.println(\"--> QUIT\");\n System.out.println(in.readLine());\n System.exit(1);\n break;\n case \"features\":\n if (fromUser.length!=1){\n printErrorMsg(\"002\", \"\", \"\");\n break;\n }\n out.write(\"FEAT\\n\");\n out.flush();\n System.out.println(\"--> FEAT\");\n readMultiLine(in);\n break;\n case \"dir\":\n if (fromUser.length!=1){\n printErrorMsg(\"002\", \"\", \"\");\n break;\n }\n out.write(\"PASV\"+\"\\n\");\n out.flush();\n System.out.println(\"--> PASV\");\n String response = in.readLine();\n Pattern pattern = Pattern.compile(\"\\\\((.*)\\\\)\");\n Matcher matcher = pattern.matcher(response);\n\n try {\n if (matcher.find()) {\n String[] IpAdd = matcher.group(1).split(\",\");\n subHostname = IpAdd[0] + \".\" + IpAdd[1] + \".\" + IpAdd[2] + \".\" + IpAdd[3];\n subPortNumber = Integer.parseInt(IpAdd[4]) * 256 + Integer.parseInt(IpAdd[5]);\n\n try {\n Socket subSocket = new Socket(subHostname, subPortNumber);\n BufferedReader inSub = new BufferedReader(\n new InputStreamReader(subSocket.getInputStream()));\n subSocket.setSoTimeout(IO_TIMEOUT);\n out.write(\"LIST\\n\");\n out.flush();\n System.out.println(\"--> LIST\");\n\n String currentLine;\n while (true) {\n if ((currentLine = inSub.readLine()) != null) {\n System.out.println(\"<-- \" + currentLine);\n } else {\n break;\n }\n }\n inSub.close();\n subSocket.close();\n } catch (SocketTimeoutException e) {\n printErrorMsg(\"3A2\", subHostname, Integer.toString(subPortNumber));\n continue;\n }\n }\n } catch(IOException e){\n printErrorMsg(\"3A7\", \"\", \"\");\n continue;\n }\n readMultiLine(in);\n readMultiLine(in);\n break;\n case \"get\":\n if (fromUser.length!=2){\n printErrorMsg(\"002\", \"\", \"\");\n break;\n }\n out.write(\"PASV\"+\"\\n\");\n out.flush();\n System.out.println(\"--> PASV\");\n response = in.readLine();\n\n out.write(\"TYPE I\"+\"\\n\");\n out.flush();\n readMultiLine(in);\n\n pattern = Pattern.compile(\"\\\\((.*)\\\\)\");\n matcher = pattern.matcher(response);\n try {\n if (matcher.find()) {\n\n System.out.println(\"<--\" + matcher.group(1));\n String[] IpAdd = matcher.group(1).split(\",\");\n subHostname = IpAdd[0] + \".\" + IpAdd[1] + \".\" + IpAdd[2] + \".\" + IpAdd[3];\n subPortNumber = Integer.parseInt(IpAdd[4]) * 256 + Integer.parseInt(IpAdd[5]);\n try {\n Socket subSocket = new Socket(subHostname, subPortNumber);\n subSocket.setSoTimeout(IO_TIMEOUT); //sets socket timeout for 0x3A2\n FileOutputStream tempFile = new FileOutputStream(fromUser[1]);\n\n out.write(\"RETR \" + fromUser[1] + \"\\n\");\n out.flush();\n System.out.println(\"--> RETR\");\n String reply = in.readLine();\n\n //Data transfer connection fail to open\n if (reply.startsWith(\"425\")) {\n printErrorMsg(\"3A2\", subHostname, Integer.toString(subPortNumber));\n break;\n }\n\n //fail to access file\n if (reply.startsWith(\"550\")) {\n printErrorMsg(\"38E\", fromUser[1], \"\");\n break;\n }\n\n //save remote file to local machine\n int line;\n byte[] buf=new byte[4096];\n InputStream inSub = subSocket.getInputStream();\n while ((line = inSub.read(buf)) > 0) {\n tempFile.write(buf,0 ,line);\n }\n\n tempFile.close();\n tempFile.flush();\n inSub.close();\n subSocket.close();\n readMultiLine(in);\n\n } catch(SocketTimeoutException e) {\n printErrorMsg(\"3A2\", subHostname, Integer.toString(subPortNumber));\n continue;\n }\n }\n } catch(IOException e){\n printErrorMsg(\"3A7\", \"\", \"\");\n continue;\n }\n break;\n //if not one of these cases, invalid command error\n default: printErrorMsg(\"001\",\"\",\"\");\n }\n\n }\n } catch (UnknownHostException e) {\n printErrorMsg(\"FFFC\", hostName, Integer.toString(portNumber));\n System.exit(1);\n } catch (SocketTimeoutException e) {\n printErrorMsg(\"FFFC\", hostName, Integer.toString(portNumber));\n System.exit(1);\n } catch (IOException e) {\n printErrorMsg(\"FFFD\", null, null);\n System.exit(1);\n } catch (Exception e) {\n printErrorMsg(\"FFFF\", null, e.getMessage());\n System.exit(1);\n }\n }", "@Override\n\tpublic void sendData(CharSequence data) {\n\t\t\n\t}", "private void putCommand(String cmd) {\n try {\n stream.write((cmd).getBytes(StandardCharsets.UTF_8));\n } catch (IOException | InterruptedException e) {\n e.printStackTrace();\n }\n }", "public interface Command {\n /**@param request from client\n * @return path for jsp file / image, encoded to string / xml file as string\n */\n String execute(HttpServletRequest request);\n}", "private void sendFile(String fileName) throws IOException {\n // Read file from disk\n //\n fileReader = new MyFileReader();\n byte[] data = fileReader.readFile(fileName);\n //\n // Send binary data over the TCP/IP socket connection\n //\n for (byte i : data) {\n this.socket.getOutputStream().write(i);\n }\n\n System.out.println(\"\\r\\nSent \" + data.length + \" bytes to server.\");\n }", "public void getFile(byte[] data, String name,String server) throws RemoteException;", "int send(final Command command) throws ZigBeeException;", "public static void main(String[] args) throws Exception {\n MyClientSocketBinary client = new MyClientSocketBinary(\n InetAddress.getByName(args[0]),\n Integer.parseInt(args[1]));\n System.out.println(\"\\r\\nConnected to Server: \" + client.socket.getInetAddress());\n //client.sendFile(args[2]);\n }", "protected abstract void transfer(UUID[] players, String server, IntConsumer response);", "public void processPutRequest(String request) throws IOException {\n\t\tString[] tokens = request.split(\"\\\\s+\");\n\t\tif (tokens.length != 3) {\n\t\t\tSystem.out.println(\"Incorrect Request\");\n\t\t\tclose();\n\t\t} else {\n\t\t\tString fileName = tokens[1];\n\t\t\tString version = tokens[2];\n\t\t\tif (version.equals(\"HTTP/1.0\") || version.equals(\"HTTP/1.1\")) {\n\t\t\t\tString filePath = \"C:\\\\Users\\\\admin\\\\Desktop\\\\socket\" + fileName.replaceAll(\"/\", \"\\\\\\\\\");\n\t\t\t\t// The path of file that client put\n\t\t\t\tFile file = new File(filePath);\n\t\t\t\tif (file.exists()) {\n\t\t\t\t\t// Send the response\n\t\t\t\t\tStringBuilder putMessage = new StringBuilder();\n\t\t\t\t\tputMessage.append(request);\n\t\t\t\t\tputMessage.append(CRLF);\n\t\t\t\t\tputMessage.append(\"User-Agent: MyClient-1.0\" + CRLF);\n\t\t\t\t\tputMessage.append(\"Accept-Encoding: ISO-8859-1\" + CRLF);\n\t\t\t\t\tputMessage.append(\n\t\t\t\t\t\t\t\"Content-Type: \" + URLConnection.getFileNameMap().getContentTypeFor(fileName) + CRLF);\n\t\t\t\t\tputMessage.append(\"Content-Length: \" + file.length() + CRLF);\n\t\t\t\t\tputMessage.append(\"Connection: close\" + CRLF);\n\t\t\t\t\tputMessage.append(CRLF);\n\t\t\t\t\t// Send to server\n\t\t\t\t\tString message = putMessage + \"\";\n\t\t\t\t\tbyte[] buffer = message.getBytes(ENCODING);\n\t\t\t\t\tostream.write(buffer, 0, message.length());\n\t\t\t\t\tostream.flush();\n\t\t\t\t\tSystem.out.println(message);\n\t\t\t\t\t// Read file and send it to server\n\t\t\t\t\tbyte[] sendData = Files.readAllBytes(file.toPath());\n\t\t\t\t\tostream.write(sendData);\n\t\t\t\t\tostream.flush();\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"File does not exist\");\n\t\t\t\t\tclose();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Bad Request\");\n\t\t\t\tclose();\n\t\t\t}\n\t\t}\n\t\tprocessResponse(\"PUT\");\n\t}", "private static void sendBytes(FileInputStream fis, OutputStream op) throws Exception {\n\t\tbyte[] buffer = new byte[1024];\n\t\tint bytes = 0;\n\n\t\t// Copy requested file into the socket’s output stream.\n\t\twhile ((bytes = fis.read(buffer)) != -1) {\n\t\t\top.write(buffer, 0, bytes);\n\t\t}\n\n\t}", "public void sendData(String data) {\n\t\tIoBuffer buf = IoBuffer.allocate(data.getBytes().length + 10);\n\t\tbuf.put(data.getBytes());\n\t\tbuf.put((byte)0x00);\n\t\tbuf.flip();\n\t\tsendData(buf);\n\t}", "@Override\n\tpublic void run( ) {\n\t\tConnect();\n\t\tSendFile( filePath );\n\t\tDisconnect();\n\t}", "public void processUserInput(String input) {\n\t\tString[] request = this.getArguments(input); \n\t\tString command = request[0]; \n\n\t\ttry {\n\t\t\tswitch (command) {\n\t\t\t\tcase TUICommands.START_SESSION:\n\t\t\t\t\tif (!this.sessionActive) {\n\t\t\t\t\t\tthis.showNamedMessage(\"Initiating session with server...\");\n\t\t\t\t\t\twhile (!this.requestSession()) {\n\t\t\t\t\t\t\ttextUI.getBoolean(\"Try again?\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.showNamedMessage(\"Session is already active\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\t\n\n\t\t\t\tcase TUICommands.LIST_FILES: \n\t\t\t\t\tthis.showNamedMessage(\"Requesting list of files...\");\n\t\t\t\t\tif (!this.requestListFiles()) { \n\t\t\t\t\t\tthis.showNamedError(\"Retrieving list of files failed\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase TUICommands.LIST_FILES_LOCAL: \n\t\t\t\t\tthis.showNamedMessage(\"Making list of local files...\");\n\t\t\t\t\tthis.printArrayOfFile(this.getLocalFiles()); \n\t\t\t\t\tbreak;\n\n\t\t\t\tcase TUICommands.DOWNLOAD_SINGLE:\n\t\t\t\t\tFile fileToDownload = this.selectServerFile();\n\t\t\t\t\tif (!this.downloadSingleFile(fileToDownload)) {\n\t\t\t\t\t\tthis.showNamedError(\"Downloading file failed\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase TUICommands.UPLOAD_SINGLE:\n\t\t\t\t\tFile fileToUpload = this.selectLocalFile();\n\t\t\t\t\tif (!this.uploadSingleFile(fileToUpload)) { \n\t\t\t\t\t\tthis.showNamedError(\"Uploading file failed\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase TUICommands.DELETE_SINGLE:\n\t\t\t\t\tFile fileToDelete = this.selectServerFile();\n\t\t\t\t\tif (!this.deleteSingleFile(fileToDelete)) { \n\t\t\t\t\t\tthis.showNamedError(\"Deleting file failed\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase TUICommands.CHECK_INTEGRITY:\n\t\t\t\t\tFile fileToCheck = this.selectLocalFile();\n\t\t\t\t\tif (!this.checkFile(fileToCheck)) { \n\t\t\t\t\t\tthis.showNamedError(\"Checking file failed\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase TUICommands.UPLOAD_MANAGER:\n\t\t\t\t\tif (!this.helperManager(this.uploads)) { \n\t\t\t\t\t\tthis.showNamedError(\"Upload manager failed!\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase TUICommands.DOWNLOAD_MANAGER:\n\t\t\t\t\tif (!this.helperManager(this.downloads)) {\n\t\t\t\t\t\tthis.showNamedError(\"Download manager failed!\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase TUICommands.HELP:\n\t\t\t\t\tthis.textUI.printHelpMenu();\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase TUICommands.EXIT:\n\t\t\t\t\tthis.shutdown();\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\tthis.showNamedError(\"Unknow command received (and ignoring it)\"); \n\t\t\t}\n\t\t\tthis.showNamedMessage(\"... done!\");\n\t\t} catch (IOException | PacketException | UtilDatagramException e) {\n\t\t\tthis.showNamedError(\"Something went wrong: \" + e.getLocalizedMessage());\n\t\t}\n\t}", "public synchronized String sendCommand(String command) {\n\n\t\tlog.debug(\"Send command \" + command);\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\t//Send the bytes and flush the output stream\n\t\t\tbyte[] commandByteArray = new String(command + \"\\r\").getBytes(\"ASCII\");\n\t\t\tlog.info(\"Sending bytes: \" + byteArrayToHexString(commandByteArray));\n\t\t\t\n\t\t\t//Flush the output stream\n\t\t\tthis.outputStream.write(commandByteArray);\n\t\t\tthis.outputStream.flush();\n\t\t\t\n\t\t} catch (UnsupportedEncodingException uee) {\n\t\t\tlog.error(\"Error sending \" + command + \" command.\", uee);\n\t\t} catch (IOException ioe) {\n\t\t\tlog.error(\"Error sending \" + command + \" command.\", ioe);\n\t\t}\n\t\t\n\t\t//Set the last command and return the response\n\t\tthis.lastCommand = command + \"\\r\";\n\t\treturn receiveResponse();\n\n\t}", "@Override\n\tpublic void run() {\n\t\t\n\t\ttry {\n\n\t\t\t// Eclipse doesn't support System.console()\n\t\t\tBufferedReader console = new BufferedReader(new InputStreamReader(System.in));\n\n\t\t\tConfigManager config = NetBase.theNetBase().config();\n\t\t\tString server = config.getProperty(\"dataxferraw.server\");\n\t\t\tif ( server == null ) {\n\t\t\t\tSystem.out.print(\"Enter a host ip, or exit to exit: \");\n\t\t\t\tserver = console.readLine();\n\t\t\t\tif ( server == null ) return;\n\t\t\t\tif ( server.equals(\"exit\")) return;\n\t\t\t}\n\n\t\t\tint basePort = config.getAsInt(\"dataxferraw.baseport\", -1, TAG);\n\t\t\tif ( basePort == -1 ) {\n\t\t\t\tSystem.out.print(\"Enter port number, or empty line to exit: \");\n\t\t\t\tString portStr = console.readLine();\n\t\t\t\tif ( portStr == null || portStr.trim().isEmpty() ) return;\n\t\t\t\tbasePort = Integer.parseInt(portStr);\n\t\t\t}\n\t\t\t\n\t\t\tint socketTimeout = config.getAsInt(\"dataxferraw.sockettimeout\", -1, TAG);\n\t\t\tif ( socketTimeout < 0 ) {\n\t\t\t\tSystem.out.print(\"Enter socket timeout (in msec.): \");\n\t\t\t\tString timeoutStr = console.readLine();\n\t\t\t\tsocketTimeout = Integer.parseInt(timeoutStr);\n\t\t\t\t\n\t\t\t}\n\n\t\t\tint nTrials = config.getAsInt(\"dataxferraw.ntrials\", -1, TAG);\n\t\t\tif ( nTrials == -1 ) {\n\t\t\t\tSystem.out.print(\"Enter number of trials: \");\n\t\t\t\tString trialStr = console.readLine();\n\t\t\t\tnTrials = Integer.parseInt(trialStr);\n\t\t\t}\n\n\t\t\tfor ( int index=0; index<DataXferRawService.NPORTS; index++ ) {\n\n\t\t\t\tTransferRate.clear();\n\t\t\t\t\n\t\t\t\tint port = basePort + index;\n\t\t\t\tint xferLength = DataXferRawService.XFERSIZE[index];\n\n\t\t\t\tSystem.out.println(\"\\n\" + xferLength + \" bytes\");\n\n\t\t\t\t//-----------------------------------------------------\n\t\t\t\t// UDP transfer\n\t\t\t\t//-----------------------------------------------------\n\n\t\t\t\tTransferRateInterval udpStats = udpDataXfer(server, port, socketTimeout, xferLength, nTrials);\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"UDP: xfer rate = \" + String.format(\"%9.0f\", udpStats.mean() * 1000.0) + \" bytes/sec.\");\n\t\t\t\tSystem.out.println(\"UDP: failure rate = \" + String.format(\"%5.1f\", udpStats.failureRate()) +\n\t\t\t\t\t\t \" [\" + udpStats.nAborted() + \"/\" + udpStats.nTrials() + \"]\");\n\n\t\t\t\t//-----------------------------------------------------\n\t\t\t\t// TCP transfer\n\t\t\t\t//-----------------------------------------------------\n\n\t\t\t\tTransferRateInterval tcpStats = tcpDataXfer(server, port, socketTimeout, xferLength, nTrials);\n\n\t\t\t\tSystem.out.println(\"\\nTCP: xfer rate = \" + String.format(\"%9.0f\", tcpStats.mean() * 1000.0) + \" bytes/sec.\");\n\t\t\t\tSystem.out.println(\"TCP: failure rate = \" + String.format(\"%5.1f\", tcpStats.failureRate()) +\n\t\t\t\t\t\t \" [\" + tcpStats.nAborted()+ \"/\" + tcpStats.nTrials() + \"]\");\n\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Unanticipated exception: \" + e.getMessage());\n\t\t}\n\t}", "public void run() {\n try {\n //first send the file name to the receiver\n out.flush();\n out.writeUTF(fileName);\n out.flush();\n //sends the destination folder name\n out.writeUTF(destFolder);\n out.flush(); //flushes the buffer\n //array of bytes that holds the file bytes\n byte[] file = readFile(srcFilePath +\"/\"+fileName);\n System.out.println(\"Sending file: \"+fileName+\" to folder: \"+destFolder);\n //sends the file\n out.write(file,0,file.length);\n out.flush();\n if(notifDownloader) {\n NodeInterface nodeStub = (NodeInterface) Naming.lookup(\"/\"+clientSocket.getInetAddress().toString()+\"/Node\");\n nodeStub.fileDownloaded(fileName);\n }\n } catch (IOException e) {\n System.out.println(\"readline: \" + e.getMessage());\n } catch (NotBoundException e) {\n //e.printStackTrace();\n System.err.println(\"There was an error notifying the downloader \"+e.getMessage());\n } finally{\n try{\n //closes the socket\n clientSocket.close();\n }catch(IOException e){\n System.out.println(\"problem closing the socket: \"+e.getMessage());\n }\n }\n }", "public void doPack() {\n if (this._sendData == null) {\n this._sendData = new byte[13];\n }\n this._sendData[0] = 0;\n if (this.isMenu) {\n byte[] bArr = this._sendData;\n bArr[0] = (byte) (bArr[0] | 1);\n }\n if (this.isPlayback) {\n byte[] bArr2 = this._sendData;\n bArr2[0] = (byte) (bArr2[0] | 2);\n }\n if (this.isRecord) {\n byte[] bArr3 = this._sendData;\n bArr3[0] = (byte) (bArr3[0] | 4);\n }\n BytesUtil.arraycopy(generateChannelByte(), this._sendData, 1);\n this._sendData[11] = 0;\n if (this.isButton) {\n byte[] bArr4 = this._sendData;\n bArr4[11] = (byte) (bArr4[11] | 1);\n }\n byte[] bArr5 = this._sendData;\n bArr5[11] = (byte) (bArr5[11] | (this.buttonData << 1));\n byte[] bArr6 = this._sendData;\n bArr6[11] = (byte) (bArr6[11] | (this.symbol << 6));\n byte[] bArr7 = this._sendData;\n bArr7[11] = (byte) (bArr7[11] | (this.change << 7));\n byte[] bArr8 = this._sendData;\n bArr8[12] = (byte) (bArr8[12] | this.shutter);\n byte[] bArr9 = this._sendData;\n bArr9[12] = (byte) (bArr9[12] | (this.focus << 1));\n byte[] bArr10 = this._sendData;\n bArr10[12] = (byte) (bArr10[12] | (this.mode_sw << 2));\n byte[] bArr11 = this._sendData;\n bArr11[12] = (byte) (bArr11[12] | (this.transform_sw << 4));\n byte[] bArr12 = this._sendData;\n bArr12[12] = (byte) (bArr12[12] | (this.gohome << 6));\n }", "@SuppressWarnings(\"unlikely-arg-type\")\r\n\t@Override\r\n\tpublic void handle(HttpExchange he) throws IOException {\n\t\t\r\n\t\tif(\"0:0:0:0:0:0:0:1\".equals(he.getLocalAddress().getHostName())) { //esta pagina es para el servidor\r\n\t\t\t\r\n\t\tString cad=\"<input type=\\\"button\\\" value=\\\"CLICK\\\" onclick=\\\"window.location.href='/descarga\"+OpenFileDialog.ext+\"'\\\">\";\r\n\r\n\t\tString response=\t\t\t\r\n\t\t\t\"<!DOCTYPE html>\"+\r\n \t\t\"<html>\"+\r\n \t\t\"<body>\"+\r\n \t\t\r\n \t\t\"<h1> Direccion IP </h1>\" + \r\n \t\t\"<h2>\" + new Host().daDireccioIP()+\":\"+ Prueba10.puerto +\"</h2>\"+\r\n \t\t\r\n\t\t\t\"<p>Click para cargar direccion</p>\" + \r\n\t\t\t\"<form method=\\\"get\\\">\" + \r\n\t\t\t\"<input type=\\\"button\\\" value=\\\"CLICK\\\" onclick=\\\"window.location.href='/openFileDialog'\\\">\" + \r\n\t\t\t\"</form>\"+\t\t\r\n\t\t\t\"<h4>\" + OpenFileDialog.ruta + \"</h4>\" +\r\n\t\t\t\r\n\t\t\t\"<p>Click para Descargar</p>\" + \r\n\t\t\t\"<form method=\\\"get\\\">\" + \r\n\t\t\tcad + \r\n\t\t\t\"</form>\"+\r\n \r\n\t\t\t\"<p>Click para apagar</p>\" + \r\n\t\t\t\"<form method=\\\"get\\\">\" + \r\n\t\t\t\"<input type=\\\"button\\\" value=\\\"CLICK\\\" onclick=\\\"window.location.href='/apagado'\\\">\" + \r\n\t\t\t\"</form>\"+\r\n\t\t\t\t\t\t\t\r\n\t\t\t\"</body>\"+\r\n\t\t\t\"</html>\"\r\n\t\t\t;\r\n\t\t\r\n\t\the.sendResponseHeaders(200, response.length()); \r\n\t\tOutputStream outputStream = he.getResponseBody();\r\n\t\toutputStream.write(response.getBytes());\r\n\t\toutputStream.close();\r\n\t\t\r\n\t\t}else {//esta pagina es para el cliente, el cual solo puede descargar archivos\r\n\t\t\t\r\n\t\t\tString cad=\"<input type=\\\"button\\\" value=\\\"CLICK\\\" onclick=\\\"window.location.href='/descarga\"+OpenFileDialog.ext+\"'\\\">\";\r\n\r\n\t\t\tString response=\t\t\t\r\n\t\t\t\t\"<!DOCTYPE html>\"+\r\n\t \t\t\"<html>\"+\r\n\t \t\t\"<body>\"+\r\n\r\n\t\t\t\t\"<p>Click para Descargar</p>\" + \r\n\t\t\t\t\"<form method=\\\"get\\\">\" + \r\n\t\t\t\tcad + \r\n\t\t\t\t\"</form>\"+\r\n\t\t\t\t\r\n \t\t\t\"<h1> Archivo </h1>\" + \r\n \t\t\t\"<h2>\" + OpenFileDialog.nombreArch + \"</h2>\"+\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\"</body>\"+\r\n\t\t\t\t\"</html>\"\r\n\t\t\t\t;\r\n\t\t\t\r\n\t\t\the.sendResponseHeaders(200, response.length()); \r\n\t\t\tOutputStream outputStream = he.getResponseBody();\r\n\t\t\toutputStream.write(response.getBytes());\r\n\t\t\toutputStream.close();\r\n\t\t\t\r\n\t\t}\r\n\t}", "@Override\n\t\tpublic void run() {\n\t\t\ttry{\n\t\t\tInputStream in = mySocket.getInputStream();\n DataInputStream clientData = new DataInputStream(in);\n\n String nameFile = clientData.readUTF();\n long size = clientData.readLong();\n \n OutputStream output = new FileOutputStream(nameFile);\n \n int bytesRead;\n byte[] buffer = new byte[1024];\n while (size > 0 && (bytesRead = clientData.read(buffer, 0, (int) Math.min(buffer.length, size))) != -1) {\n output.write(buffer, 0, bytesRead);\n size -= bytesRead;\n }\t\n\t\t\t}catch(IOException e){\n\t\t\t\t\n\t\t\t}\t\t\t\t\t\n\t\t}", "public void sendDataTransmissionPackage(byte[] data, int fileNumber, int packageNumber) {\n\t\ttry {\n\t\t\tserverRemoteObject.receiveDataTransmissionPackage(clientId, data, fileNumber, packageNumber);\n\t\t} catch (RemoteException e) {\n\t\t\tJOptionPane.showInternalMessageDialog(MainFrame.getInstance(), e.getMessage(), \"Error\",\n\t\t\t\t\tJOptionPane.ERROR_MESSAGE);\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void run() {\n ClientConnection connection = null;\n try {\n connection = new ClientConnection(requestPacket);\n } catch (SocketException e1) {\n e1.printStackTrace();\n return;\n }\n \n PacketPrinter.print(requestPacket);\n \n TransferState transferState = new TransferStateBuilder()\n .connection(connection)\n .build();\n \n ROP<Request, TransferState, IrrecoverableError> rop = new ROP<>();\n \n Result<TransferState, IrrecoverableError> result =\n LocalOperations.parseRequest\n .andThen(rop.bind((request) -> {\n TransferState state = TransferStateBuilder.clone(transferState)\n .request(request)\n .build();\n \n if (request.type() == RequestType.READ) {\n // initiate ReadRequest\n logger.logAlways(\"Received ReadRequest, initiating file transfer.\");\n TftpReadTransfer.start(state);\n } else if (request.type() == RequestType.WRITE) {\n // initiate WriteRequest\n logger.logAlways(\"Received WriteRequest, initiating file transfer.\");\n TftpWriteTransfer.start(state);\n } else {\n // should never really get here\n logger.logError(\"Could not identify request type, but it was parsed.\");\n return Result.failure(new IrrecoverableError(\n ErrorCode.ILLEGAL_TFTP_OPERATION, \"Invalid Request. Not a RRQ or WRQ.\"));\n }\n \n return Result.success(state);\n }))\n .apply(requestPacket);\n \n \n if (result.FAILURE) {\n NetworkOperations.sendError.accept(transferState, result.failure);\n logger.logError(\"Error occured. Terminating connection thread.\");\n } else {\n logger.logAlways(\"Transfer has ended. Terminating connection thread.\");\n }\n }", "public void sendData(byte[] data) {\r\n\t\t//send packet\r\n\t\ttry {\r\n\t\t\tout.write(data);\r\n\t\t} catch(IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "@RequestMapping(value = \"/command\", method = RequestMethod.POST)\n public @ResponseBody void command(@RequestBody String cmd, HttpServletRequest request) {\n commandHandler.handle(cmd);\n }", "public void handleResponse(byte[] result, Command originalCommand);", "default void sendBinary(byte[] data, int offset, int length) {\n ByteBuffer buffer = ByteBuffer.wrap(data, offset, length);\n sendBinary(buffer);\n }", "private void inputHandler(String input) throws Exception{\n\n switch (input) {\n\n case \"/quit\":\n done = true;\n break;\n\n default:\n PduMess mess = new PduMess(input);\n outStream.writeToServer(mess.getByteArray());\n break;\n }\n }", "@Override\n\tsynchronized void execute() {\n\t\t_dataOUTPipe.dataIN(op1.getText());\n\t\t_dataOUTPipe.dataIN(op2.getText());\n\t\t_dataOUTPipe.dataIN(op.getText());\n\t}", "private static void sendData(Plugin plugin, JsonObject data) throws Exception {\n if (data == null) {\n throw new IllegalArgumentException(\"Data cannot be null!\");\n }\n if (Server.getInstance().isPrimaryThread()) {\n throw new IllegalAccessException(\"This method must not be called from the main thread!\");\n }\n if (logSentData) {\n plugin.getLogger().info(\"Sending data to bStats: \" + data);\n }\n HttpsURLConnection connection = (HttpsURLConnection) new URL(URL).openConnection();\n \n // Compress the data to save bandwidth\n byte[] compressedData = compress(data.toString());\n \n // Add headers\n connection.setRequestMethod(\"POST\");\n connection.addRequestProperty(\"Accept\", \"application/json\");\n connection.addRequestProperty(\"Connection\", \"close\");\n connection.addRequestProperty(\"Content-Encoding\", \"gzip\"); // We gzip our request\n connection.addRequestProperty(\"Content-Length\", String.valueOf(compressedData.length));\n connection.setRequestProperty(\"Content-Type\", \"application/json\"); // We send our data in JSON format\n connection.setRequestProperty(\"User-Agent\", \"MC-Server/\" + B_STATS_VERSION);\n \n // Send data\n connection.setDoOutput(true);\n try (DataOutputStream outputStream = new DataOutputStream(connection.getOutputStream())) {\n outputStream.write(compressedData);\n }\n \n StringBuilder builder = new StringBuilder();\n try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(connection.getInputStream()))) {\n String line;\n while ((line = bufferedReader.readLine()) != null) {\n builder.append(line);\n }\n }\n \n if (logResponseStatusText) {\n plugin.getLogger().info(\"Sent data to bStats and received response: \" + builder);\n }\n }", "private void http_handler(BufferedReader input, DataOutputStream output) {\n int method = 0; //1 get, 2 head, 0 not supported\n String http = new String(); //a bunch of strings to hold\n String path = new String(); //the various things, what http v, what path,\n String file = new String(); //what file\n String user_agent = new String(); //what user_agent\n try {\n //This is the two types of request we can handle\n //GET /index.html HTTP/1.0\n //HEAD /index.html HTTP/1.0\n String tmp = input.readLine(); //read from the stream\n String tmp2 = new String(tmp);\n String line = input.readLine();\n String header = \"\";\n while (line != null && !line.equals(\"\")) {\n header += line;\n line = input.readLine();\n }\n if(header.contains(\"Content-Length\")){\n int offset = header.indexOf(\"Content-Length: \") + \"Content-Length: \".length();\n int cLength = Integer.parseInt(header.substring(offset, header.length()));\n char[] buffer = new char[cLength];\n input.read(buffer);\n value = new String(buffer);\n }\n tmp.toUpperCase(); //convert it to uppercase\n\n if (tmp.startsWith(\"GET\")) { //compare it is it GET\n method = 1;\n } //if we set it to method 1\n if (tmp.startsWith(\"OPTIONS\")) { //same here is it OPTIONS\n method = 2;\n } //set method to 2\n if (tmp.startsWith(\"POST\")) { //same here is it POST\n method = 3;\n } //set method to 3\n\n if (method == 0) { // not supported\n try {\n output.writeBytes(construct_http_header(501, 0));\n output.close();\n return;\n } catch (Exception e3) { //if some error happened catch it\n s(\"error:\" + e3.getMessage());\n } //and display error\n }\n //}\n\n //tmp contains \"GET /index.html HTTP/1.0 .......\"\n //find first space\n //find next space\n //copy whats between minus slash, then you get \"index.html\"\n //it's a bit of dirty code, but bear with me...\n\n int start = 0;\n int end = 0;\n for (int a = 0; a < tmp2.length(); a++) {\n if (tmp2.charAt(a) == ' ' && start != 0) {\n end = a;\n break;\n }\n if (tmp2.charAt(a) == ' ' && start == 0) {\n start = a;\n }\n }\n path = tmp2.substring(start + 1, end); //fill in the path\n } catch (Exception e) {\n s(\"error\" + e.getMessage());\n } //catch any exception\n\n try {\n //send response header\n output.writeBytes(construct_http_header(200, 5));\n\n if (method == 1) { //1 is GET 2 is head and skips the body\n //Response with data from kinect (persoon aanwezig, positie, ...)\n //output.writeBytes(response);\n }\n if (method == 2) {\n String msg = \"\";\n //Description of the sensor sent back (OPTIONS)\n if (path.equals(\"/\")) {\n msg = \"<link rel=\\\"description\\\" type=\\\"text/n3\\\" href=\\\"/service\\\">\\n<link rel=\\\"goal\\\" type=\\\"text/n3\\\" href=\\\"/serviceGoal\\\">\";\n }\n if (path.equals(\"/service\")) {\n msg = \"@prefix sensor: <http://example.org/sensor/>.\\n\";\n msg += \"@prefix ex: <http://example.org/example/>. \\n\";\n msg += \"@prefix xsd: <http://www.w3.org/2001/XMLSchema#>. \\n\";\n msg += \"@prefix environment: <http://example.org/environment/>. \\n\";\n msg += \"@prefix http: <http://www.w3.org/2011/http#>. \\n\";\n msg += \"@prefix tmpl: <http://purl.org/restdesc/http-template#>. \\n\";\n msg += \"{ \\n\";\n msg += \"?sensor a sensor:Kinect. \\n\";\n msg += \"} \\n\";\n msg += \"=> \\n\";\n msg += \"{ \\n\";\n msg += \"_:request http:methodName \\\"POST\\\"; \\n\";\n msg += \"tmpl:requestURI (?sensor \\\"/lightValue\\\"); \\n\";\n msg += \"http:body ?environmentLight;\\n\";\n msg += \"http:resp [ http:body ?lightingValue]. \\n\";\n msg += \"?environmentLight a environment:lightingCondition.\\n\";\n msg += \"?sensor sensor:lightingCondition ?lightingValue. \\n\";\n msg += \"?lightingValue a xsd:String. \\n\";\n msg += \"}. \\n\";\n msg += \"<http://\" + ip + \"/#sensor> a sensor:Kinect.\\n\";\n }\n if (path.equals(\"/serviceGoal\")) {\n msg = \"@prefix sensor: <http://example.org/sensor/>. \\n\";\n msg += \"@prefix environment: <http://example.org/environment/>. \\n\";\n msg += \"{ \\n\";\n msg += \"<http://\" + ip + \"/#sensor> sensor:lightingCondition ?value. \\n\";\n msg += \"} \\n\";\n msg += \"=> \\n\";\n msg += \"{ \\n\";\n msg += \"<http://\" + ip + \"/#sensor> sensor:lightingCondition ?value. \\n\";\n msg += \"}. \\n\";\n }\n output.writeBytes(msg);\n }\n if (method == 3) {\n //Add something to sensor (LightSensor data)\n if (path.equals(\"/lightValue\")) {\n //get Light Value, send to kinect\n String lightValue = value.substring(value.indexOf(\"=\") + 1, value.length()).trim();\n EnvironmentVars.getInstance().setLightValue(lightValue);\n output.writeBytes(\"OK\");\n }\n if (path.equals(\"/personPresent\")) {\n EnvironmentVars.getInstance().setPersonPresent(true);\n output.writeBytes(\"OK\");\n }\n }\n output.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "interface ServerSideCommand extends RemoteApiCommand {\n\n /** An http connection to AppEngine. */\n interface Connection {\n\n void prefetchXsrfToken();\n\n /** Send a POST request. TODO(mmuller): change to sendPostRequest() */\n String send(\n String endpoint, Map<String, ?> params, MediaType contentType, @Nullable byte[] payload)\n throws IOException;\n\n String sendGetRequest(String endpoint, Map<String, ?> params) throws IOException;\n\n Map<String, Object> sendJson(String endpoint, Map<String, ?> object) throws IOException;\n\n String getServerUrl();\n }\n\n void setConnection(Connection connection);\n}", "@Override\n\tpublic void run() {\n\t\ttry {\n\t\t\tbyte[] bytes = new byte[1024];\n\t\t\tint bytesRead;\n\t\t\tString fileName = ois.readUTF();\n\t\t\tOutputStream output = new FileOutputStream(directory+fileName);\n\t\t\tString receivedCheckSum = ois.readUTF();\n\t\t\t//long size = ois.readLong();\n\t\t\tbyte[] buffer = new byte[1024];\n\t\t\twhile ((bytesRead = ois.read(buffer)) != -1) {\n\t\t\t\toutput.write(buffer, 0, bytesRead);\n\t\t\t\t//size -= bytesRead;\n\t\t\t}\n\n\t\t\tString checksumVal = calculateCheckSum(new File(directory + fileName));\n\t\t\tSystem.out.println(\"Server Side check sum value is \" + checksumVal);\n\n\t\t\t// String receivedCheckSum=(String)ois.readObject();\n\t\t\tSystem.out.println(\"client side checksum \" + receivedCheckSum);\n\t\t\tif (receivedCheckSum.equalsIgnoreCase(checksumVal)) {\n\t\t\t\tSystem.out.println(\"*****************Data is transfer without any error *********************\");\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Integrity verification failed !\");\n\t\t\t}\n\t\t\t// }\n\n\t\t\toos.close();\n\t\t\tois.close();\n\t\t} catch (Exception ex) {\n\t\t\t// TODO: handle exception\n\t\t\tLogger.getLogger(ThreadHandler.class.getName()).log(Level.SEVERE, null, ex);\n\t\t}\n\t}", "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 blockingSendSenderSide() throws OOBException {\n \t\tFileInputStream fis = null;\n \t\ttry {\n \t\t\tlog.debug(\"enter send scpmanager session is \" + session);\n \t\t\t// exec 'scp -t rfile' remotely\n \t\t\tString command = \"scp -p -t \" + rfile;\n \t\t\tChannel channel = session.openChannel(\"exec\");\n \t\t\t((ChannelExec) channel).setCommand(command);\n \t\t\t// get I/O streams for remote scp\n \t\t\tOutputStream out = channel.getOutputStream();\n \t\t\tInputStream in = channel.getInputStream();\n \t\t\tchannel.connect();\n \t\t\tif (checkAck(in) != 0) {\n \t\t\t\tSystem.exit(0);\n \t\t\t}\n \t\t\t// send \"C0644 filesize filename\", where filename should not include\n \t\t\t// '/'\n \t\t\tlog.debug(\"lfile value \" + lfile);\n \t\t\tlong filesize = (new File(lfile)).length();\n \t\t\tcommand = \"C0644 \" + filesize + \" \";\n \t\t\tif (lfile.lastIndexOf('/') > 0) {\n \t\t\t\tcommand += lfile.substring(lfile.lastIndexOf('/') + 1);\n \t\t\t} else {\n \t\t\t\tcommand += lfile;\n \t\t\t}\n \t\t\tcommand += \"\\n\";\n \t\t\tout.write(command.getBytes());\n \t\t\tout.flush();\n \t\t\tif (checkAck(in) != 0) {\n \t\t\t\tSystem.exit(0);\n \t\t\t}\n \n \t\t\t// send a content of lfile\n \t\t\tfis = new FileInputStream(lfile);\n \t\t\tbyte[] buf = new byte[1024];\n \t\t\twhile (true) {\n \t\t\t\tint len = fis.read(buf, 0, buf.length);\n \t\t\t\tif (len <= 0)\n \t\t\t\t\tbreak;\n \t\t\t\tout.write(buf, 0, len); // out.flush();\n \t\t\t}\n \t\t\tfis.close();\n \t\t\tfis = null;\n \t\t\t// send '\\0'\n \t\t\tbuf[0] = 0;\n \t\t\tout.write(buf, 0, 1);\n \t\t\tout.flush();\n \t\t\tif (checkAck(in) != 0) {\n \t\t\t\tSystem.exit(0);\n \t\t\t}\n \t\t\tout.close();\n \t\t\tchannel.disconnect();\n \t\t} catch (Exception e) {\n \t\t\te.printStackTrace();\n \t\t\ttry {\n \t\t\t\tif (fis != null)\n \t\t\t\t\tfis.close();\n \t\t\t} catch (Exception ee) {\n \t\t\t}\n \t\t}\n \t\tlog.debug(\"out send scpmanager\");\n \t}", "public void send(Object data) {\n\t\t//do nothing - override to do something\n\t}", "protected void mainTask() {\n\t logger.log(1, CLASS, \"-\", \"impl\",\n\t\t \"About to read command\");\n\t try { \n\t\tcommand = (COMMAND)connection.receive();\n\t\tlogger.log(1,CLASS, \"-\", \"impl\",\n\t\t\t \"Received command: \"+(command == null ? \"no-command\" : command.getClass().getName()));\n\t } catch (IOException e) {\n\t\tinitError(\"I/O error while reading command:[\"+e+\"]\",command);\n\t\treturn;\n\t } catch (ClassCastException ce) {\n\t\tinitError(\"Garbled command:[\"+ce+\"]\", command);\n\t\treturn;\n\t } \n\t \n\t // 2. Create a handler.\n\t if (command == null) {\n\t\tinitError(\"No command set\", null);\n\t\treturn;\n\t }\n\n\t if (handlerFactory != null) {\n\t\thandler = handlerFactory.createHandler(connection, command);\n\t\tif (handler == null) {\n\t\t initError(\"Unable to process command [\"+command.getClass().getName()+\"]: No known handler\", command);\n\t\t return;\n\t\t}\n\t \n\t\t// 3. Handle the request - handler may send multiple updates to client over long period\n\t\thandler.handleRequest();\n\t }\t \n\t}", "public UploadHandle upload(List<File> files) throws Exception {\n \tMetadata md = new Metadata();\n \tfinal FileCollection fcol = new FileCollection(md);\n \tfor(File f: files) {\n \t\tFileMetaData mf = new FileMetaData(f.getName(), f.getLocalName(), \"\", null);\n \t\tmf.setGroups(f.getGroups());\n \t\tmd.md.file.add(mf);\n \t}\n NullOutputStream ostream = new NullOutputStream();\n fcol.tarit(ostream);\n long length = ostream.getLength();\n\n HttpResponse response = client.get(new URI(config.preallocurl()));\n String prealloc_file = this.read_http_entity(response.getEntity());\n String ingestServer = prealloc_file.split(\"\\n\")[0];\n String location = prealloc_file.split(\"\\n\")[1];\n ingestServer = ingestServer.split(\": \")[1];\n location = location.split(\": \")[1];\n \n PipedInputStream in = new PipedInputStream();\n final PipedOutputStream out = new PipedOutputStream(in);\n new Thread(\n new Runnable(){\n @Override\n public void run(){\n try {\n fcol.tarit(out);\n } catch (Exception ex) {\n Logger.getLogger(Connect.class.getName()).log(Level.SEVERE, null, ex);\n \n }\n }\n }\n ).start();\n \n InputStreamEntity entity = new InputStreamEntity(in, length);\n response = client.put(entity, new URI(\"https://\"+ingestServer+location));\n this.read_http_entity(response.getEntity());\n\n response = client.get(new URI(\"https://\"+ingestServer+config.finishurl()+location));\n String status_url = this.read_http_entity(response.getEntity());\n for(String line:status_url.split(\"\\n\")) {\n System.out.println(line);\n if(line.startsWith(\"Status: \"))\n status_url = line.split(\": \")[1];\n }\n System.out.println(status_url+\"/xml\");\n StatusHandler sturl = new StatusHandler();\n sturl.status_url = status_url+\"/xml\";\n sturl.timeout = 30;\n sturl.step = 5;\n UploadHandle ret = sturl;\n return ret;\n }" ]
[ "0.5909409", "0.5812701", "0.5796942", "0.5795299", "0.5793544", "0.577504", "0.5747905", "0.5708055", "0.5687653", "0.5595982", "0.559465", "0.5544576", "0.5529245", "0.5522722", "0.5500536", "0.5496574", "0.5459838", "0.5457217", "0.5451332", "0.54454136", "0.544333", "0.54042137", "0.5403247", "0.53872955", "0.53822625", "0.5377765", "0.53707975", "0.5369993", "0.5354409", "0.5335926", "0.53139806", "0.5312559", "0.5310645", "0.5307981", "0.5305279", "0.52982414", "0.5293803", "0.52535367", "0.52494663", "0.5243493", "0.52238303", "0.5219374", "0.51875424", "0.51675904", "0.5159834", "0.5140516", "0.5140271", "0.5136639", "0.5136231", "0.5136119", "0.5124536", "0.5116051", "0.51125485", "0.5111071", "0.5111025", "0.5102652", "0.5100346", "0.50978124", "0.5091344", "0.50906914", "0.50906736", "0.5086981", "0.50852543", "0.50794595", "0.5076043", "0.50753385", "0.50734115", "0.50720525", "0.5068517", "0.50554377", "0.5041", "0.50384474", "0.50363624", "0.5021362", "0.5019934", "0.50175095", "0.50117964", "0.5003544", "0.500146", "0.49997061", "0.49988267", "0.49958915", "0.4986821", "0.4986373", "0.4984626", "0.49785388", "0.4978335", "0.49720567", "0.49698377", "0.49639934", "0.4958857", "0.4958771", "0.49539787", "0.4952649", "0.4952376", "0.4951028", "0.49504912", "0.49458757", "0.49433607", "0.49422953" ]
0.65271187
0
////////////////////////////////////////////////////////////////////////// Fake Getters // ////////////////////////////////////////////////////////////////////////// Set the contenttype of information sent to the server. Returns application/zip for file deployment and null (not set) for directory deployment.
@Override public String getContentType() { return command.dirDeploy ? null : "application/zip"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "default String getContentType() {\n return \"application/octet-stream\";\n }", "String getContentType();", "String getContentType();", "String getContentType();", "public String getContentType();", "public String getContentType();", "public boolean handles(String contentType, String packaging);", "public String getContentType() {\n return this.contentType;\n }", "public String getContenttype() {\n return contenttype;\n }", "public String getContenttype() {\n return contenttype;\n }", "@Override\n\tpublic String getContentType(String filename) {\n\t\treturn null;\n\t}", "public Integer getOptContentType() { return(content_type); }", "@Override\n\tpublic String getContentType()\n\t{\n\t\treturn contentType;\n\t}", "public MediaType getContentType()\r\n/* 193: */ {\r\n/* 194:289 */ String value = getFirst(\"Content-Type\");\r\n/* 195:290 */ return value != null ? MediaType.parseMediaType(value) : null;\r\n/* 196: */ }", "public String getContentType() {\n return contentType;\n }", "public String getContentType() {\n return this.contentType;\n }", "public String getContentType() {\n return this.contentType;\n }", "public String getContentType() {\n return this.contentType;\n }", "public interface HttpMimeType {\n\n\t// Image\n \n public static final String APNG_IMAGE = \"image/apng\";\n \n public static final String BMP_IMAGE = \"image/bmp\";\n\n\tpublic static final String GIF_IMAGE = \"image/gif\";\n\t\n\tpublic static final String ICO_IMAGE = \"image/ico\";\n\n\tpublic static final String JPEG_IMAGE = \"image/jpeg\";\n\n\tpublic static final String JPG_IMAGE = \"image/jpg\";\n\n public static final String PNG_IMAGE = \"image/png\";\n\n\tpublic static final String SVG_IMAGE = \"image/svg+xml\";\n\n\tpublic static final String TIFF_IMAGE = \"image/tiff\";\n\t\n\tpublic static final String WEBP_IMAGE = \"image/webp\";\n\n\t// text formats\n\n\tpublic static final String TEXT_PLAIN = \"text/plain\";\n\n\tpublic static final String CSV = \"text/csv\";\n\n\tpublic static final String CSS = \"text/css\";\n\n\tpublic static final String HTML = \"text/html\";\n\n\tpublic static final String JAVASCRIPT = \"text/javascript\";\n\n\tpublic static final String RTF = \"text/rtf\";\n\n\tpublic static final String XML = \"text/xml\";\n\n\t// document formats\n\n\tpublic static final String JSON = \"application/json\";\n\n\tpublic static final String ATOM = \"application/atom+xml\";\n\n\tpublic static final String PDF = \"application/pdf\";\n\n\tpublic static final String POSTSCRIPT = \"application/postscript\";\n\n\tpublic static final String XLS = \"application/vnd.ms-excel\";\n\n\tpublic static final String XLSX = \"application/vnd.ms-excel\";\n\n\tpublic static final String PPT = \"application/vnd.ms-powerpoint\";\n\n\tpublic static final String PPTX = \"application/vnd.ms-powerpoint\";\n\n\tpublic static final String XPS = \"application/vnd.ms-xpsdocument\";\n\n\t// binary\n\n\tpublic static final String BINARY = \"application/octet-stream\";\n\n\t// music ones\n\n\tpublic static final String MP4_AUDIO = \"audio/mp4\";\n\n\tpublic static final String MP3_AUDIO = \"audio/mpeg\";\n\n\tpublic static final String OGG_VORBIS_AUDIO = \"audio/ogg\";\n\n\tpublic static final String OPUS_AUDIO = \"audio/opus\";\n\n\tpublic static final String VORBIS_AUDIO = \"audio/vorbis\";\n\n\tpublic static final String WEBM_AUDIO = \"audio/webm\";\n\n\t// video\n\n\tpublic static final String MPEG_VIDEO = \"video/mpeg\";\n\n\tpublic static final String MP4_VIDEO = \"video/mp4\";\n\n\tpublic static final String OGG_THEORA_VIDEO = \"video/ogg\";\n\n\tpublic static final String QUICKTIME_VIDEO = \"video/quicktime\";\n\n\tpublic static final String WEBM_VIDEO = \"video/webm\";\n\n\t// feeds\n\n\tpublic static final String RDF = \"application/rdf+xml\";\n\n\tpublic static final String RSS = \"application/rss+xml\";\n\n}", "@Override\n public String getContentType() {\n return null;\n }", "public String getContenttype() {\n\t\treturn contenttype;\n\t}", "@Override\n\t\tpublic String getContentType() {\n\t\t\treturn null;\n\t\t}", "private String getContentType(String sHTTPRequest) {\n String sContentType = \"Content-Type: \";\n\n // update based on file extension or if response starts with HTML/URL\n String sFileExtension = getFileExtension(sHTTPRequest);\n if (sFileExtension.equalsIgnoreCase(\".html\") || sFileExtension.equalsIgnoreCase(\".htm\")) {\n sContentType += \"text/html\";\n } else if (sFileExtension.equalsIgnoreCase(\".txt\")) {\n sContentType += \"text/plain\";\n } else if (sFileExtension.equalsIgnoreCase(\".pdf\")) {\n sContentType += \"application/pdf\";\n } else if (sFileExtension.equalsIgnoreCase(\".png\")) {\n sContentType += \"image/png\";\n } else if (sFileExtension.equalsIgnoreCase(\".jpeg\") || sFileExtension.equalsIgnoreCase(\".jpg\")) {\n sContentType += \"image/jpeg\";\n } else {\n sContentType += \"text/html\"; // default response\n }\n\n // return final content type\n return sContentType;\n }", "@Override\n\tpublic String getContentType() {\n\t\treturn CONTENT_TYPE;\n\t}", "public String getContentType() {\n\t\treturn null;\n\t}", "public String getContentType() {\n return getProperty(Property.CONTENT_TYPE);\n }", "@Override\n\tpublic String getContentType() {\n\t\treturn null;\n\t}", "@Override\n\tpublic String getContentType() {\n\t\treturn null;\n\t}", "@Override\n\tpublic String getContentType() {\n\t\treturn null;\n\t}", "protected String getContentType()\n {\n if (fullAttachmentFilename == null)\n {\n return null;\n }\n String ext = FilenameUtils.getExtension(fullAttachmentFilename);\n if (ext == null)\n {\n return null;\n }\n if (ext.equalsIgnoreCase(\"pdf\"))\n {\n return \"application/pdf\";\n } else if (ext.equalsIgnoreCase(\"zip\"))\n {\n return \"application/zip\";\n } else if (ext.equalsIgnoreCase(\"jpg\"))\n {\n return \"image/jpeg\";\n\n } else if (ext.equalsIgnoreCase(\"jpeg\"))\n {\n return \"image/jpeg\";\n\n } else if (ext.equalsIgnoreCase(\"html\"))\n {\n return \"text/html\";\n\n } else if (ext.equalsIgnoreCase(\"png\"))\n {\n return \"image/png\";\n\n } else if (ext.equalsIgnoreCase(\"gif\"))\n {\n return \"image/gif\";\n\n }\n log.warn(\"Content type not found for file extension: \" + ext);\n return null;\n }", "@Override\n protected FileType doGetType() throws Exception {\n if (isRoot()) {\n return FileType.FOLDER;\n }\n\n final MantaObject response = this.lastResponse;\n if (response == null) {\n return FileType.IMAGINARY;\n } else if (response.isDirectory()) {\n return FileType.FOLDER;\n } else {\n return FileType.FILE;\n }\n }", "@Override\n public int getContentType() {\n return 0;\n }", "MimeType mediaType();", "public String getFilecontentContentType() {\n return filecontentContentType;\n }", "public String getContentType() {\n return this.response.getContentType();\n }", "public String getContentType() {\n return contentType;\n }", "public String getContentType() {\n return contentType;\n }", "public String getContentType() {\n return contentType;\n }", "public String getContentType() {\n return contentType;\n }", "public String getContentType() {\n return contentType;\n }", "private static void setContentTypeHeader(HttpResponse response, File file) {\n\t\tresponse.headers().set(HttpHeaderNames.CONTENT_TYPE, HttpHeaderValues.APPLICATION_OCTET_STREAM);\r\n\t}", "public String getContentType() {\r\n try {\r\n ContentType newCtype = new ContentType(super.getContentType());\r\n ContentType retCtype = new ContentType(cType.toString());\r\n retCtype.setParameter(\"boundary\", newCtype.getParameter(\"boundary\"));\r\n return retCtype.toString();\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n\r\n return \"null\";\r\n }", "int getContentTypeValue();", "String getContentType(String fileExtension);", "String getMimeType();", "@Override\n public String getContentType() {\n return \"text/xml; charset=UTF-8\";\n }", "private void setContentType(HttpServletResponse response, Format format) {\r\n switch (format) {\r\n case html:\r\n case htmlfragment:\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n break;\r\n case kml:\r\n response.setContentType(\"application/vnd.google-earth.kml+xml;charset=UTF-8\");\r\n response.setHeader(\"Content-Disposition\",\"attachment; filename=\\\"document.kml\\\"\");\r\n break;\r\n case json:\r\n response.setContentType(\"application/json;charset=UTF-8\");\r\n response.setHeader(\"Content-disposition\", \"attachment; filename=\\\"document.json\\\"\");\r\n break;\r\n case pjson:\r\n\t response.setContentType(\"text/plain;charset=UTF-8\");\r\n\t break; \r\n default:\r\n case xml:\r\n response.setContentType(\"text/xml;charset=UTF-8\");\r\n break;\r\n }\r\n}", "public static ContentType extensionContentType(String fileExt) {\r\n\r\n\t\tfileExt = fileExt.toLowerCase();\r\n\r\n\t\tif (\"tiff\".equals(fileExt) || \"tif\".equals(fileExt)) {\r\n\t\t\t// return MIMEConstants.\r\n\t\t} else if (\"zip\".equals(fileExt)) {\r\n\t\t\treturn MIMEConstants.CONTENT_TYPE_APPLICATION_ZIP;\r\n\t\t} else if (\"pdf\".equals(fileExt)) {\r\n\t\t\treturn MIMEConstants.CONTENT_TYPE_APPLICATION_PDF;\r\n\t\t} else if (\"wmv\".equals(fileExt)) {\r\n\t\t\treturn MIMEConstants.CONTENT_TYPE_VIDEO_WMV;\r\n\t\t} else if (\"rar\".equals(fileExt)) {\r\n\t\t\treturn MIMEConstants.CONTENT_TYPE_APPLICATION_RAR;\r\n\t\t} else if (\"swf\".equals(fileExt)) {\r\n\t\t\treturn MIMEConstants.CONTENT_TYPE_APPLICATION_SWF;\r\n\t\t} else if (\"exe\".equals(fileExt)) {\r\n\t\t\treturn MIMEConstants.CONTENT_TYPE_APPLICATION_WINDOWSEXEC;\r\n\t\t} else if (\"avi\".equals(fileExt)) {\r\n\t\t\treturn MIMEConstants.CONTENT_TYPE_VIDEO_AVI;\r\n\t\t} else if (\"doc\".equals(fileExt) || \"dot\".equals(fileExt)) {\r\n\t\t\treturn MIMEConstants.CONTENT_TYPE_APPLICATION_WORD;\r\n\t\t} else if (\"ico\".equals(fileExt)) {\r\n\t\t\treturn MIMEConstants.CONTENT_TYPE_IMAGE_ICO;\r\n\t\t} else if (\"mp2\".equals(fileExt) || \"mp3\".equals(fileExt)) {\r\n\t\t\treturn MIMEConstants.CONTENT_TYPE_AUDIO_MPEG;\r\n\t\t} else if (\"rtf\".equals(fileExt)) {\r\n\t\t\treturn MIMEConstants.CONTENT_TYPE_TEXT_RTF;\r\n\t\t} else if (\"xls\".equals(fileExt) || \"xla\".equals(fileExt)) {\r\n\t\t\treturn MIMEConstants.CONTENT_TYPE_APPLICATION_EXCEL;\r\n\t\t} else if (\"jpg\".equals(fileExt) || \"jpeg\".equals(fileExt)) {\r\n\t\t\treturn MIMEConstants.CONTENT_TYPE_IMAGE_JPEG;\r\n\t\t} else if (\"gif\".equals(fileExt)) {\r\n\t\t\treturn MIMEConstants.CONTENT_TYPE_IMAGE_GIF;\r\n\t\t} else if (\"svg\".equals(fileExt)) {\r\n\t\t\treturn MIMEConstants.CONTENT_TYPE_IMAGE_SVG;\r\n\t\t} else if (\"png\".equals(fileExt)) {\r\n\t\t\treturn MIMEConstants.CONTENT_TYPE_IMAGE_PNG;\r\n\t\t} else if (\"csv\".equals(fileExt)) {\r\n\t\t\treturn MIMEConstants.CONTENT_TYPE_TEXT_CSV;\r\n\t\t} else if (\"ps\".equals(fileExt)) {\r\n\t\t\treturn MIMEConstants.CONTENT_TYPE_APPLICATION_POSTSCRIPT;\r\n\t\t} else if (\"html\".equals(fileExt) || \"htm\".equals(fileExt)) {\r\n\t\t\treturn MIMEConstants.CONTENT_TYPE_TEXT_HTML;\r\n\t\t} else if (\"css\".equals(fileExt)) {\r\n\t\t\treturn MIMEConstants.CONTENT_TYPE_TEXT_CSS;\r\n\t\t} else if (\"xml\".equals(fileExt)) {\r\n\t\t\treturn MIMEConstants.CONTENT_TYPE_TEXT_XML;\r\n\t\t} else if (\"js\".equals(fileExt)) {\r\n\t\t\treturn MIMEConstants.CONTENT_TYPE_APPLICATION_JAVASCRIPT;\r\n\t\t} else if (\"wma\".equals(fileExt)) {\r\n\t\t\treturn MIMEConstants.CONTENT_TYPE_AUDIO_WMA;\r\n\t\t}\r\n\r\n\t\treturn MIMEConstants.CONTENT_TYPE_TEXT_PLAIN;\r\n\t}", "public String getFiletype() {\n return filetype;\n }", "@java.lang.Override public int getContentTypeValue() {\n return contentType_;\n }", "public static String getContentType(String name){\n\t\tString contentType = \"\";\n\t\tif(name.endsWith(\".html\")){\n\t\t\tcontentType = \"text/html\";\n\t\t}else if(name.endsWith(\".txt\")){\n\t\t\tcontentType = \"text/plain\";\n\t\t}else if(name.endsWith(\".gif\")){\n\t\t\tcontentType = \"image/gif\";\n\t\t}else if(name.endsWith(\".jpg\")){\n\t\t\tcontentType = \"image/jpeg\";\n\t\t}else if(name.endsWith(\".png\")){\n\t\t\tcontentType = \"image/png\";\n\t\t}\n\t\treturn contentType;\n\t}", "public String getContentType() {\r\n return mFile.getContentType();\r\n }", "public java.lang.String getContentType() {\n return contentType;\n }", "public String getContentType() {\n return getHeader(\"Content-Type\");\n }", "public String getMimeType();", "public java.lang.Object getContentType() {\r\n return contentType;\r\n }", "@Override\n\tpublic String getContentType(File file) {\n\t\treturn null;\n\t}", "public void setContentType(Header contentType) {\n/* 114 */ this.contentType = contentType;\n/* */ }", "protected String getDefaultContentType() {\n return DEFAULT_CONTENT_TYPE;\n }", "protected String getContentType(Resource resource, @SuppressWarnings(\"unused\") SlingHttpServletRequest request) {\n String mimeType = JcrBinary.getMimeType(resource);\n if (StringUtils.isEmpty(mimeType)) {\n mimeType = ContentType.OCTET_STREAM;\n }\n return mimeType;\n }", "@java.lang.Override public int getContentTypeValue() {\n return contentType_;\n }", "public String getContentType() {\n\t\treturn contentType;\n\t}", "public String getContentType() {\n\t\treturn contentType;\n\t}", "java.lang.String getMimeType();", "java.lang.String getMimeType();", "@Override\r\n\tpublic String getContentType() {\r\n\t\treturn attachmentType;\r\n\t}", "public void setContentTypeHeader(HttpResponse response, String filename) {\r\n //determine filetype by checking filename ending (filetype\r\n String[] splitarray = filename.split(\"\\\\.\");\r\n String filetype = splitarray[splitarray.length-1];\r\n //hardcoded types for all used files, if needed add other filetypes here\r\n switch (filetype) {\r\n case \"js\":\r\n response.headers().set(HttpHeaders.Names.CONTENT_TYPE, \"application/javascript\");\r\n break;\r\n case \"css\":\r\n response.headers().set(HttpHeaders.Names.CONTENT_TYPE, \"text/css\");\r\n break;\r\n case \"ico\":\r\n response.headers().set(HttpHeaders.Names.CONTENT_TYPE, \"image/x-icon\");\r\n break;\r\n default:\r\n response.headers().set(HttpHeaders.Names.CONTENT_TYPE, \"text/html\");\r\n break;\r\n }\r\n }", "@Override\n public void setContentType(String arg0) {\n\n }", "public final String getAcceptContentType() {\n return properties.get(ACCEPT_CONTENT_TYPE_PROPERTY);\n }", "public String getFileType(){\n\t\treturn type;\n\t}", "public String getMimeType() {\n return null;\n }", "public String getMimeType() {\n return null;\n }", "@ApiModelProperty(required = true, value = \"The mime type of the file/folder. If unknown, it defaults to application/binary.\")\n public String getMimeType() {\n return mimeType;\n }", "public void setContentType(String contentType);", "public String getFILE_TYPE() {\r\n return FILE_TYPE;\r\n }", "public java.lang.String getFiletype() {\n return filetype;\n }", "public CharSequence getContentType() {\n return contentType;\n }", "@JsonProperty(\"contentType\")\n public String getContentType() {\n return contentType;\n }", "@NotNull\n String getMimeType();", "public String getMimeType() {\n return mimeType;\n }", "public String getMimeType() {\n return mimeType;\n }", "void setContentType(HttpServletResponse response);", "public Optional<String> contentType() {\n return body.contentType()\n .map(\n h -> {\n if (h.contains(\";\")) {\n return h.substring(0, h.indexOf(';')).trim();\n } else {\n return h.trim();\n }\n });\n }", "com.yoti.api.client.spi.remote.proto.ContentTypeProto.ContentType getContentType();", "private static String contentType(String fileName) {\n\t\tif (fileName.endsWith(\".txt\") || fileName.endsWith(\".html\")) {\n\t\t\treturn \"text/html\";\n\t\t}\n\t\tif (fileName.endsWith(\".jpg\") || fileName.endsWith(\".jpeg\")) {\n\t\t\treturn \"image/jpeg\";\n\t\t}\n\t\tif (fileName.endsWith(\".gif\")) {\n\t\t\treturn \"image/gif\";\n\t\t}\n\t\treturn \"application/octet-stream\";\n\t}", "abstract ContentType getContnentType();", "public String getContentType() {\n\t\tString ct = header.getContentType();\n\t\treturn Strings.substringBefore(ct, ';');\n\t}", "@Value.Default\n public String getMediaType() {\n\treturn \"\";\n }", "public String getMimeType() {\r\n return mimeType;\r\n }", "public void setContentType(String s) {\n\n\t}", "@AutoEscape\n\tpublic String getContentType();", "String getFileMimeType();", "public String getFileContentType() {\r\n return (String) getAttributeInternal(FILECONTENTTYPE);\r\n }", "public String getMimeType() {\n return mimeType;\n }", "public String getMime_type()\r\n {\r\n return getSemanticObject().getProperty(data_mime_type);\r\n }", "public MimeType mimetype() {\r\n return getContent().mimetype();\r\n }", "String getArchiveMechanism();", "public String getFileType() {\n return fileType;\n }", "@Test\r\n public void test_getContentType_Accuracy() {\r\n assertEquals(\"incorrect default value\", null, instance.getContentType());\r\n instance.setContentType(\"a\");\r\n assertEquals(\"incorrect value after setting\", \"a\", instance.getContentType());\r\n }", "@Test\r\n public void test_setContentType_Accuracy() {\r\n instance.setContentType(\"a\");\r\n assertEquals(\"incorrect value after setting\", \"a\", instance.getContentType());\r\n }" ]
[ "0.72966695", "0.6505842", "0.6505842", "0.6505842", "0.64589846", "0.64589846", "0.63222146", "0.6290625", "0.6254106", "0.6254106", "0.6237189", "0.62068367", "0.6176972", "0.61739373", "0.6153724", "0.6149851", "0.6149851", "0.6149851", "0.614804", "0.61423194", "0.6099519", "0.6098982", "0.60792696", "0.60722566", "0.60606664", "0.60600805", "0.6059985", "0.6059985", "0.6059985", "0.6059047", "0.60589635", "0.60448384", "0.60436416", "0.6037238", "0.6035438", "0.59981084", "0.59981084", "0.59981084", "0.59981084", "0.59981084", "0.59783864", "0.5973648", "0.59517443", "0.59411854", "0.59332746", "0.59259176", "0.59184253", "0.59155566", "0.58959645", "0.58953524", "0.5890259", "0.58797926", "0.5865175", "0.586341", "0.58513176", "0.5847568", "0.5840005", "0.5828389", "0.5828048", "0.58251464", "0.5811932", "0.5809784", "0.5809784", "0.58073467", "0.58073467", "0.58057773", "0.5790209", "0.5788627", "0.57738066", "0.5767288", "0.5750245", "0.5750245", "0.5747199", "0.5728384", "0.57184476", "0.5704041", "0.5686141", "0.56710786", "0.5663733", "0.56382686", "0.56382686", "0.5634205", "0.56335527", "0.56258774", "0.56146485", "0.5607805", "0.5606543", "0.56029403", "0.5600666", "0.55682", "0.5566913", "0.5564556", "0.55619377", "0.5553589", "0.55477035", "0.5514962", "0.5510649", "0.55097204", "0.5494808", "0.5467106" ]
0.8528282
0
Created by Taras 21.01.2018, 16:40.
public interface ArticleClient { @GET("v2/top-headlines?apiKey=" + BuildConfig.api_key) Call<ArticleResponse> getArticles(@Query("country") String country, @Query("category") String category); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private stendhal() {\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "public final void mo51373a() {\n }", "private void poetries() {\n\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "public void mo38117a() {\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}", "public void mo6081a() {\n }", "public void mo4359a() {\n }", "@Override\n public void func_104112_b() {\n \n }", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "protected MetadataUGWD() {/* intentionally empty block */}", "@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 rozmnozovat() {\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "public Pitonyak_09_02() {\r\n }", "private void kk12() {\n\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "Petunia() {\r\n\t\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "private void init() {\n\n\t}", "private Rekenhulp()\n\t{\n\t}", "@Override\n public void memoria() {\n \n }", "public void mo21877s() {\n }", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n public int describeContents() { return 0; }", "protected void mo6255a() {\n }", "public void mo12930a() {\n }", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tprotected void interr() {\n\t}", "private void m50366E() {\n }", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "public void mo55254a() {\n }", "@Override\n public void init() {\n\n }", "@Override\n\tpublic void anular() {\n\n\t}", "static void feladat4() {\n\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n\n \n }", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "public void gored() {\n\t\t\n\t}", "private TMCourse() {\n\t}", "private MetallicityUtils() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n void init() {\n }", "zzang mo29839S() throws RemoteException;", "@Override\n public void init() {\n }", "public void mo1531a() {\n }", "@SuppressWarnings(\"unused\")\n private void generateInfo()\n {\n }", "static void feladat9() {\n\t}", "private UsineJoueur() {}", "private void strin() {\n\n\t}", "@Override\n protected void getExras() {\n }", "static void feladat7() {\n\t}", "public void mo21878t() {\n }", "public void mo12628c() {\n }", "private MApi() {}", "zzafe mo29840Y() throws RemoteException;", "static void feladat5() {\n\t}", "private ReportGenerationUtil() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n\tpublic int mettreAJour() {\n\t\treturn 0;\n\t}", "@Override\n protected void initialize() \n {\n \n }", "public static void main(String args[]) throws Exception\n {\n \n \n \n }", "static void feladat6() {\n\t}", "@Override\n protected void init() {\n }", "private final zzgy zzgb() {\n }", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\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 public void init() {}" ]
[ "0.56771207", "0.56557363", "0.56067234", "0.5496964", "0.5435281", "0.53996897", "0.5378001", "0.534492", "0.53125495", "0.53125495", "0.5277547", "0.526331", "0.5260312", "0.5254016", "0.5250287", "0.52161837", "0.5202831", "0.5202831", "0.52012557", "0.51911056", "0.51865447", "0.51865447", "0.51865447", "0.51865447", "0.51865447", "0.51865447", "0.51865447", "0.51861626", "0.51711184", "0.5168768", "0.51544803", "0.5153438", "0.51465505", "0.5125301", "0.5125098", "0.5112671", "0.5102687", "0.5097926", "0.50940055", "0.5089324", "0.5087749", "0.5064099", "0.506399", "0.50586915", "0.50516784", "0.5048725", "0.50451237", "0.50419873", "0.50401646", "0.50397044", "0.5031889", "0.5028759", "0.50279886", "0.50218564", "0.50218564", "0.50218564", "0.50218564", "0.50218564", "0.50218564", "0.5018426", "0.50180894", "0.5015126", "0.5010773", "0.499963", "0.4988903", "0.4988903", "0.4988903", "0.4988903", "0.4988903", "0.49804774", "0.4976309", "0.49757963", "0.4973699", "0.4972282", "0.49718252", "0.4970962", "0.49666262", "0.496477", "0.49644244", "0.49632254", "0.49584535", "0.4953204", "0.4951848", "0.49514356", "0.4940088", "0.49387267", "0.49387267", "0.49370655", "0.49348336", "0.49346134", "0.49213284", "0.49195406", "0.49182916", "0.49165854", "0.49135405", "0.49135405", "0.49135405", "0.49121448", "0.49121448", "0.49121448", "0.49089432" ]
0.0
-1
Start typing your Java solution below DO NOT write main() function
public int lengthOfLongestSubstring(String s) { int l=s.length(),len=0,r=0; HashMap<Character,Integer> h=new HashMap<Character,Integer>(); for(int i=0;i<l;) { char c=s.charAt(i); if(h.containsKey(c)) { i=h.get(c)+1; // we should restart and clear the hash map before the repeated c h.clear(); len=0; } else { h.put(c,i); len++; r=Math.max(len,r); i++; } } return r; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main() {\n \n }", "public static void main(String[] args) {\n\n Solution2.solution();\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 }", "public static void main(String args[]) throws Exception\n {\n \n \n \n }", "public static void main(String[] args) {\n\t\tSolution s = new Solution();\n\t\ts.solution(2, 4, 2, 1);\n\t}", "public static void main()\n\t{\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(solution());\r\n\t}", "public static void main(String[] args) {\n \n \n \n \n }", "public static void main(String[] args) {\n \n \n \n\t}", "public static void main(String[] args) {\n \n }", "public static void main(String[] args) {\n \n }", "public static void main(String[] args) {\n \n }", "public static void main(String[] args) {\n \n }", "public static void main(String[] args) {\n \n }", "public static void main(String[] args) {\n \n }", "public static void main(String[]args) {\n\t\n\t\t\n\n}", "public void solution() {\n\t\t\n\t}", "public static void main(String[] args) {\r\n\t\tSomeJava8Features obj = new SomeJava8Features();\r\n\r\n\t\t// StringJoiner\r\n\t\texampleStringJoiner();\r\n\t\t\r\n\t\t// Default\r\n\t\tint ary[] = {3,6,8,9,0};\r\n\t\tSystem.out.println(\"\\nsumOfGivenIntArray ... \" + obj.sumOfGivenIntArray(ary));\r\n\t\tobj.sayMore(\"Hello Rohini\");\r\n\t\t\r\n\t\t// ForEach & Lambda Expression\r\n\t\texampleForEach_FindMaximum(ary);\r\n\t\t\r\n\r\n\t}", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tSolution s = new Solution();\r\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(\"Wow I really love this class!\");\n\t\tSystem.out.println(\"Thanks again for the V8 energy drink!\");\n\t\tSystem.out.println(\"I think next time im going to have a redbull though\");\n\t\tSystem.out.println(\"We can sip on some energy drinks and make more fun of JJ\");\n\t\tSystem.out.println(\"I still cant believe JJ had a baby\");\n\t\tSystem.out.println(\"You can call me Uncle Louie\");\n\t\tSystem.out.println(\"Does Uncle Louie sound like a creepy name though?\");\n\t\tSystem.out.println(\"Anyways, I think ill be a good uncle\");\n\t\tSystem.out.println(\"I just have to figure out how to properly hold a baby\");\n\t\tSystem.out.println(\"Well, thank you for reading. Can't wait to see what else this class has to offer!\");\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n \n \n }", "public static void main(String[] args) {\n \n \n }", "public static void main(String[] args)\n\t{\n\n\n\n\n\n\n\t}", "public static void main(String[] args) throws Exception {\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t}", "public static void main(String[] args) {\n Last_coding_exercises.task17();\n\n\n }", "public static void main(){\n\t}", "public static void main() {\n }", "public static void main (String []args){\n }", "public static void main(String[] args) {\n \n\n }", "public static void main(String[] args) {\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public static int Main()\n\t{\n\t\tint len;\n\t\tint i;\n\t\tint j;\n\t\tint p;\n\t\tint l;\n\t\tMain_str = new Scanner(System.in).nextLine();\n\t\tfor (len = 0;Main_str.charAt(len) != '\\0';len++)\n\t\t{\n\t\t\t;\n\t\t}\n\t\tfor (l = 2;l <= len;l++)\n\t\t{\n\t\t\tfor (i = 0;i <= len - l;i++)\n\t\t\t{\n\t\t\t\tfor (j = 0;j < l / 2;j++)\n\t\t\t\t{\n\t\t\t\t\tif (Main_str.charAt(i + j) != Main_str.charAt(i + l - 1 - j))\n\t\t\t\t\t{\n//C++ TO JAVA CONVERTER TODO TASK: There are no gotos or labels in Java:\n\t\t\t\t\t\tgoto here;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\tfor (p = i;p < i + l;p++)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.printf(\"%c\",Main_str.charAt(p));\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.print(\"\\n\");\n//C++ TO JAVA CONVERTER TODO TASK: There are no gotos or labels in Java:\n\t\t\t\t\there:\n\t\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\treturn 0;\n\t}", "public static void main(String [] args)\n {\n System.out.println(\"Programming is great fun!\");\n }", "public static void main(String[] args) {\t\n\t\t\n\t}", "public static void main(String[] args) {\n \r\n\t}", "public static void main(String[] args) // every Java program starts with a main method or function\r\n\t{\n\t}", "public static void main(String[] args){\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n }", "public static void main(String []args){\n }", "public static void main(String []args){\n }", "public static void main(String[] args) {\n\n\t\t\n\t\t\n\t}", "public static void main(String []args){\n\n }", "public static void main(String[] args) {}", "public static void main(String[] args) {}", "public static void main(String[] args) {\r\n \r\n }", "public static void main(String[] args) {\r\n \r\n }", "public static void main (String args[]) {\n\t\t\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(solution(0));\n\n\t}", "public static void main(String[] args) {\n \n }", "@Override\r\n public void run() {\n System.out.println(\"Running in Java (regular algorithm)\");\r\n }", "public static void main (String[] args) {\r\n\t\t \r\n\t\t}", "public static void main(String[] args) {\n\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public static void main(String[] args){\n\t\t\n\t\t\n \t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t \t\n\t \t\n\t }", "public static void main(String[] args) {\n\t\t\tSystem.out.println(Solution(5, 83));\n\t\t\t\n\t\t}", "public static void main(String[] args) {\r\n\t\t//method body\r\n\t}", "public static void main (String[] args) {\n\t\t\n\t}", "public static void main(String args[]){\n\t\t\n\t\n\t}", "public static void main(String[] args) {\r\n\t\t\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n \n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main (String[]args) throws IOException {\n }", "public void Main(){\n }", "private void generateSolution() {\n\t\t// TODO\n\n\t}", "public static void main(String[] args){\n \t\n }", "public static void main(String args[]) {\r\n }", "public static void main(String[] args) {\r\n// Use for unit testing\r\n }", "public static void main(String[] args) {\n\t\t// public static=> access modifies. accessable from anywhere in the project.\n\t\t// Main method is always public static\n\t\t// main method name\n\t\t// void=> return type. Void=no special return type.\n\t\t// args =>argument\n\t\t// String[] = String of Array\n\t\t// What is main method\n\t\t// Engine of a car. Without main method, we cannot run any code.\n\t\t// Do we have to have a main method to build and run any code?\n\t\t// Yes we need main to build and run an application\n\n\t\t// How many data type are there in JAVA?\n\t\t// 2.Primetive and Non-primetive\n\t\t// How many primitive data type are there?\n\t\t// 8:boolean, char, byte, short, int, long, float, double\n\t\t// NOTE: all primitives start with lowercase\n\n\t\t// Please declare all the primitive data types?\n\t\tboolean b; // b =true\n\t\t// assign a value after\n\t\tb = false;\n\t\tboolean th = true;\n\t\t// In Java every character has a value. Space (bosluk) called whitespace.\n\t\tchar c;\n\t\tc = 'a';\n\t\tbyte by;\n\t\tshort s;\n\t\t// int=> is Data Type, i=> variable(container), 1 =>value.\n\t\t// variables are important in JAVA.\n\t\t// Because, we create object/variable and use them in our codes to make our code\n\t\t// DYNAMIC\n\t\t// Also to use the same value again and again\n\t\tint i;\n\t\tlong l;\n\t\tfloat f;\n\t\tdouble d;\n\n\t\t// print int\n\t\t// We have to initialize the variables ( int i = 1; i ye deger verme) to print\n\t\t// the values.\n\t\tSystem.out.println();\n\t\t// Find the minimum and maximum value of a short. Use the same variable s\n\t\ts = Short.MIN_VALUE;\n\t\tSystem.out.println(\"The Smallest Value of a short => \" + s);\n\t\ts = Short.MAX_VALUE;\n\t\t// We are printing dynamically\n\t\tSystem.out.println(\"The Biggest Value of a short => \" + s);\n\t\t//\n\n\t}", "public static void main(String[] args) {\r\n\t\t\r\n\t}", "public static void main(String[] args) {\r\n\t\t\r\n\t}", "public static void main(String[] args) {\r\n\t\t\r\n\t}" ]
[ "0.7085202", "0.70152825", "0.70048785", "0.6863522", "0.68364745", "0.682089", "0.68138087", "0.6797307", "0.6784227", "0.6755715", "0.6755715", "0.6755715", "0.6755715", "0.6755715", "0.6755715", "0.67436904", "0.67295706", "0.67241466", "0.6723099", "0.66999674", "0.6688058", "0.6688058", "0.6682968", "0.66816163", "0.668011", "0.66610104", "0.6654195", "0.6650627", "0.66442734", "0.66428536", "0.66428536", "0.66274446", "0.6623134", "0.6613289", "0.66122013", "0.66095144", "0.6607382", "0.660495", "0.660495", "0.6593702", "0.65918875", "0.65878415", "0.65878415", "0.6581943", "0.6581943", "0.65790117", "0.6577939", "0.6575975", "0.65719914", "0.6571269", "0.65631574", "0.6551785", "0.6550106", "0.6550106", "0.6550106", "0.6550106", "0.65487796", "0.65473306", "0.6545566", "0.6543781", "0.65367806", "0.6532359", "0.652479", "0.65175384", "0.65175384", "0.65175384", "0.65175384", "0.65175384", "0.65175384", "0.65175384", "0.65175384", "0.65175384", "0.65175384", "0.65175384", "0.65175384", "0.65175384", "0.65175384", "0.65175384", "0.65175384", "0.65175384", "0.65175384", "0.65175384", "0.65175384", "0.65175384", "0.65175384", "0.65175384", "0.65175384", "0.65175384", "0.65175384", "0.65175384", "0.65175384", "0.6512665", "0.65047544", "0.6502129", "0.65001583", "0.6500158", "0.64990646", "0.6490301", "0.64869404", "0.64869404", "0.64869404" ]
0.0
-1
Start typing your Java solution below DO NOT write main() function
public int lengthOfLongestSubstring(String s) { if(s.length()<=1) return s.length(); HashMap<Character,Integer> h=new HashMap<Character,Integer>(); int curmax=0,max=0; for(int i=0;i<s.length();i++) { char c=s.charAt(i); if(h.containsKey(c)) { if(i-h.get(c)<curmax) { // previous is in the middle of curmax, then restart from the previous next char curmax=1; // otherwise previous is the start of curmax, then simply replace current with previous i=h.get(c)+1; c=s.charAt(i); h.clear(); } } else { curmax++; } h.put(c,i); max=curmax>max?curmax:max; } return max; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main() {\n \n }", "public static void main(String[] args) {\n\n Solution2.solution();\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 }", "public static void main(String args[]) throws Exception\n {\n \n \n \n }", "public static void main(String[] args) {\n\t\tSolution s = new Solution();\n\t\ts.solution(2, 4, 2, 1);\n\t}", "public static void main()\n\t{\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(solution());\r\n\t}", "public static void main(String[] args) {\n \n \n \n \n }", "public static void main(String[] args) {\n \n \n \n\t}", "public static void main(String[] args) {\n \n }", "public static void main(String[] args) {\n \n }", "public static void main(String[] args) {\n \n }", "public static void main(String[] args) {\n \n }", "public static void main(String[] args) {\n \n }", "public static void main(String[] args) {\n \n }", "public static void main(String[]args) {\n\t\n\t\t\n\n}", "public void solution() {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tSolution s = new Solution();\r\n\t}", "public static void main(String[] args) {\r\n\t\tSomeJava8Features obj = new SomeJava8Features();\r\n\r\n\t\t// StringJoiner\r\n\t\texampleStringJoiner();\r\n\t\t\r\n\t\t// Default\r\n\t\tint ary[] = {3,6,8,9,0};\r\n\t\tSystem.out.println(\"\\nsumOfGivenIntArray ... \" + obj.sumOfGivenIntArray(ary));\r\n\t\tobj.sayMore(\"Hello Rohini\");\r\n\t\t\r\n\t\t// ForEach & Lambda Expression\r\n\t\texampleForEach_FindMaximum(ary);\r\n\t\t\r\n\r\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(\"Wow I really love this class!\");\n\t\tSystem.out.println(\"Thanks again for the V8 energy drink!\");\n\t\tSystem.out.println(\"I think next time im going to have a redbull though\");\n\t\tSystem.out.println(\"We can sip on some energy drinks and make more fun of JJ\");\n\t\tSystem.out.println(\"I still cant believe JJ had a baby\");\n\t\tSystem.out.println(\"You can call me Uncle Louie\");\n\t\tSystem.out.println(\"Does Uncle Louie sound like a creepy name though?\");\n\t\tSystem.out.println(\"Anyways, I think ill be a good uncle\");\n\t\tSystem.out.println(\"I just have to figure out how to properly hold a baby\");\n\t\tSystem.out.println(\"Well, thank you for reading. Can't wait to see what else this class has to offer!\");\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n \n \n }", "public static void main(String[] args) {\n \n \n }", "public static void main(String[] args)\n\t{\n\n\n\n\n\n\n\t}", "public static void main(String[] args) throws Exception {\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t}", "public static void main(String[] args) {\n Last_coding_exercises.task17();\n\n\n }", "public static void main(){\n\t}", "public static void main() {\n }", "public static void main (String []args){\n }", "public static void main(String[] args) {\n \n\n }", "public static void main(String[] args) {\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public static int Main()\n\t{\n\t\tint len;\n\t\tint i;\n\t\tint j;\n\t\tint p;\n\t\tint l;\n\t\tMain_str = new Scanner(System.in).nextLine();\n\t\tfor (len = 0;Main_str.charAt(len) != '\\0';len++)\n\t\t{\n\t\t\t;\n\t\t}\n\t\tfor (l = 2;l <= len;l++)\n\t\t{\n\t\t\tfor (i = 0;i <= len - l;i++)\n\t\t\t{\n\t\t\t\tfor (j = 0;j < l / 2;j++)\n\t\t\t\t{\n\t\t\t\t\tif (Main_str.charAt(i + j) != Main_str.charAt(i + l - 1 - j))\n\t\t\t\t\t{\n//C++ TO JAVA CONVERTER TODO TASK: There are no gotos or labels in Java:\n\t\t\t\t\t\tgoto here;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\tfor (p = i;p < i + l;p++)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.printf(\"%c\",Main_str.charAt(p));\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.print(\"\\n\");\n//C++ TO JAVA CONVERTER TODO TASK: There are no gotos or labels in Java:\n\t\t\t\t\there:\n\t\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\treturn 0;\n\t}", "public static void main(String [] args)\n {\n System.out.println(\"Programming is great fun!\");\n }", "public static void main(String[] args) {\t\n\t\t\n\t}", "public static void main(String[] args) {\n \r\n\t}", "public static void main(String[] args) // every Java program starts with a main method or function\r\n\t{\n\t}", "public static void main(String[] args){\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n }", "public static void main(String []args){\n }", "public static void main(String []args){\n }", "public static void main(String[] args) {\n\n\t\t\n\t\t\n\t}", "public static void main(String []args){\n\n }", "public static void main(String[] args) {}", "public static void main(String[] args) {}", "public static void main(String[] args) {\r\n \r\n }", "public static void main(String[] args) {\r\n \r\n }", "public static void main (String args[]) {\n\t\t\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(solution(0));\n\n\t}", "public static void main(String[] args) {\n \n }", "public static void main (String[] args) {\r\n\t\t \r\n\t\t}", "@Override\r\n public void run() {\n System.out.println(\"Running in Java (regular algorithm)\");\r\n }", "public static void main(String[] args) {\n\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public static void main(String[] args){\n\t\t\n\t\t\n \t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t \t\n\t \t\n\t }", "public static void main(String[] args) {\n\t\t\tSystem.out.println(Solution(5, 83));\n\t\t\t\n\t\t}", "public static void main(String[] args) {\r\n\t\t//method body\r\n\t}", "public static void main (String[] args) {\n\t\t\n\t}", "public static void main(String args[]){\n\t\t\n\t\n\t}", "public static void main(String[] args) {\r\n\t\t\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n \n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\t\n\t}", "public static void main (String[]args) throws IOException {\n }", "public void Main(){\n }", "private void generateSolution() {\n\t\t// TODO\n\n\t}", "public static void main(String args[]) {\r\n }", "public static void main(String[] args){\n \t\n }", "public static void main(String[] args) {\r\n// Use for unit testing\r\n }", "public static void main(String[] args) {\n\t\t// public static=> access modifies. accessable from anywhere in the project.\n\t\t// Main method is always public static\n\t\t// main method name\n\t\t// void=> return type. Void=no special return type.\n\t\t// args =>argument\n\t\t// String[] = String of Array\n\t\t// What is main method\n\t\t// Engine of a car. Without main method, we cannot run any code.\n\t\t// Do we have to have a main method to build and run any code?\n\t\t// Yes we need main to build and run an application\n\n\t\t// How many data type are there in JAVA?\n\t\t// 2.Primetive and Non-primetive\n\t\t// How many primitive data type are there?\n\t\t// 8:boolean, char, byte, short, int, long, float, double\n\t\t// NOTE: all primitives start with lowercase\n\n\t\t// Please declare all the primitive data types?\n\t\tboolean b; // b =true\n\t\t// assign a value after\n\t\tb = false;\n\t\tboolean th = true;\n\t\t// In Java every character has a value. Space (bosluk) called whitespace.\n\t\tchar c;\n\t\tc = 'a';\n\t\tbyte by;\n\t\tshort s;\n\t\t// int=> is Data Type, i=> variable(container), 1 =>value.\n\t\t// variables are important in JAVA.\n\t\t// Because, we create object/variable and use them in our codes to make our code\n\t\t// DYNAMIC\n\t\t// Also to use the same value again and again\n\t\tint i;\n\t\tlong l;\n\t\tfloat f;\n\t\tdouble d;\n\n\t\t// print int\n\t\t// We have to initialize the variables ( int i = 1; i ye deger verme) to print\n\t\t// the values.\n\t\tSystem.out.println();\n\t\t// Find the minimum and maximum value of a short. Use the same variable s\n\t\ts = Short.MIN_VALUE;\n\t\tSystem.out.println(\"The Smallest Value of a short => \" + s);\n\t\ts = Short.MAX_VALUE;\n\t\t// We are printing dynamically\n\t\tSystem.out.println(\"The Biggest Value of a short => \" + s);\n\t\t//\n\n\t}", "public static void main(String[] args) {\r\n\t\t\r\n\t}", "public static void main(String[] args) {\r\n\t\t\r\n\t}", "public static void main(String[] args) {\r\n\t\t\r\n\t}" ]
[ "0.7084938", "0.70155996", "0.7005523", "0.68639696", "0.6836968", "0.6820533", "0.6814067", "0.6797289", "0.67841405", "0.6755723", "0.6755723", "0.6755723", "0.6755723", "0.6755723", "0.6755723", "0.6743834", "0.6730596", "0.6724133", "0.67238855", "0.6699892", "0.66880393", "0.66880393", "0.66830677", "0.6681796", "0.66816056", "0.66606563", "0.66538274", "0.6650891", "0.66443294", "0.6642638", "0.6642638", "0.6628382", "0.6622855", "0.66131365", "0.6612148", "0.66090685", "0.660792", "0.6605208", "0.6605208", "0.6593643", "0.65922755", "0.6587686", "0.6587686", "0.65819913", "0.65819913", "0.6579347", "0.6578311", "0.6576058", "0.6571052", "0.6571029", "0.6563072", "0.6551912", "0.6550013", "0.6550013", "0.6550013", "0.6550013", "0.6548425", "0.6548254", "0.6545174", "0.65436405", "0.65371203", "0.653215", "0.6524759", "0.6517389", "0.6517389", "0.6517389", "0.6517389", "0.6517389", "0.6517389", "0.6517389", "0.6517389", "0.6517389", "0.6517389", "0.6517389", "0.6517389", "0.6517389", "0.6517389", "0.6517389", "0.6517389", "0.6517389", "0.6517389", "0.6517389", "0.6517389", "0.6517389", "0.6517389", "0.6517389", "0.6517389", "0.6517389", "0.6517389", "0.6517389", "0.6517389", "0.65126145", "0.6504686", "0.6503598", "0.65007186", "0.65002716", "0.6499198", "0.6491116", "0.6486724", "0.6486724", "0.6486724" ]
0.0
-1
TODO Autogenerated constructor stub
public PantallaPersonal(GeoWallStart game) { super(game); user= new Usuario(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "public Constructor(){\n\t\t\n\t}", "@Override\n public void init() {}", "@Override\n\t\tpublic void init() {\n\t\t}", "@Override\r\n\tpublic void init() {}", "@Override\n public void init() {\n }", "@Override\n void init() {\n }", "@Override\n protected void init() {\n }", "public Pitonyak_09_02() {\r\n }", "@Override\n public void init() {\n\n }", "public PSRelation()\n {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\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 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}", "private TMCourse() {\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n public void init() {\n }", "private Rekenhulp()\n\t{\n\t}", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "public Clade() {}", "@Override\r\n\tpublic void init()\r\n\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 initialize() \n {\n \n }", "@Override\n protected void initialize() {\n\n \n }", "@Override\n public void initialize() {}", "@Override\n public void initialize() {}", "@Override\n public void initialize() {}", "@Override\n\tprotected void initialize() {\n\t}", "@Override\n\tprotected void initialize() {\n\t}", "@Override\n\tpublic void init() {\n\t}", "@Override\n\tpublic void init()\n\t{\n\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override public void init()\n\t\t{\n\t\t}", "@Override\r\n\tpublic final void init() {\r\n\r\n\t}", "public Pojo1110110(){\r\n\t}", "public _355() {\n\n }", "public CyanSus() {\n\n }", "public SgaexpedbultoImpl()\n {\n }", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\n public void initialize() { \n }", "public Coche() {\n super();\n }", "public void init() {\r\n\t\t// to override\r\n\t}", "@Override\n public void initialize() {\n \n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\n\t\tprotected void initialise() {\n\n\t\t}", "@Override\n public void init() {\n\n super.init();\n\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "public Phl() {\n }", "private Converter()\n\t{\n\t\tsuper();\n\t}", "public Rol() {}", "protected MetadataUGWD() {/* intentionally empty block */}", "public contrustor(){\r\n\t}", "public Orbiter() {\n }", "public JSFOla() {\n }", "public Anschrift() {\r\n }", "@Override\n public void initialize() {\n }", "public Reference() {\n super();\n }", "@Override\n\tpublic void initialize() {\n\t\t\n\t}", "protected SourceDocumentInformation() {\n }", "public Husdjurshotell(){}", "public CSSTidier() {\n\t}", "@Override\r\n public void initialize()\r\n {\n }", "public Aanbieder() {\r\n\t\t}", "public Cgg_jur_anticipo(){}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "private Infer() {\n\n }", "protected Asignatura()\r\n\t{}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "public Lanceur() {\n\t}", "private Value() {\n\t}" ]
[ "0.7658869", "0.71549827", "0.70363975", "0.6936954", "0.6918867", "0.6918655", "0.68630713", "0.68442994", "0.6838973", "0.68234706", "0.6819426", "0.6792848", "0.6792581", "0.6792581", "0.6792581", "0.6792581", "0.6792581", "0.6792581", "0.67713094", "0.67713094", "0.67713094", "0.67334205", "0.67334205", "0.67334205", "0.67334205", "0.67334205", "0.6727204", "0.6720332", "0.6717022", "0.6717022", "0.6701636", "0.6696439", "0.6680244", "0.6680244", "0.66751313", "0.66644394", "0.66448015", "0.66448015", "0.66448015", "0.66159457", "0.6608359", "0.6597663", "0.6597663", "0.6597663", "0.65974927", "0.65974927", "0.65920126", "0.65883183", "0.6541475", "0.6540498", "0.65300256", "0.65209574", "0.6503282", "0.6499614", "0.64954823", "0.64952093", "0.64952093", "0.64952093", "0.64866775", "0.64849234", "0.64742154", "0.64615613", "0.64538145", "0.6448638", "0.6446133", "0.6445521", "0.644289", "0.644289", "0.644289", "0.644289", "0.644289", "0.644289", "0.644289", "0.644289", "0.644289", "0.644289", "0.6440331", "0.6425152", "0.6424929", "0.6424038", "0.64157647", "0.64141154", "0.6411018", "0.6410917", "0.6386806", "0.63763034", "0.63697034", "0.63541883", "0.63504106", "0.63496745", "0.6343523", "0.6334274", "0.6326157", "0.63261455", "0.63261455", "0.6325472", "0.6325206", "0.63203454", "0.63203454", "0.6319927", "0.6317769" ]
0.0
-1
TODO Autogenerated method stub
@Override public void pause() { super.pause(); }
{ "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 render(float delta) { super.render(delta); Gdx.gl.glClearColor(0.3f, 0.3f, 0.3f, 1f); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); escenariopciones.act(); escenariopciones.draw(); }
{ "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 show() { super.show(); Skin skin = new Skin(Gdx.files.internal("Textos/uiskin.json")); int miniheight= Gdx.graphics.getHeight()/8; int mitad= Gdx.graphics.getWidth()/2; //int miniwidth= Gdx.graphics.getWidth()/8; /*Botones*/ btnVolv = new TextButton("Back", skin); btnVolv.setPosition(0, 0); btnVolv.setWidth(Gdx.graphics.getWidth()/2); btnVolv.setHeight(miniheight); btnVolv.addListener(QueHacemos(false)); btnGuardar = new TextButton("Save", skin); btnGuardar.setPosition(Gdx.graphics.getWidth()/2, 0); btnGuardar.setWidth(Gdx.graphics.getWidth()/2); btnGuardar.setHeight(miniheight); btnGuardar.addListener(QueHacemos(true)); /*Tabla */ //Puntuacion Label tapunt= new Label(""+user.getPuntuacion(),skin); tapunt.setAlignment(Align.center); tapunt.setX(Gdx.graphics.getWidth()/2-tapunt.getWidth()/2); tapunt.setY(miniheight*7); tapunt.setFontScale(3); tapunt.setColor(0.9f,0.1f,0.1f,0.8f); //Definimos el label y el TextArea del nick Label tlnick= new Label("NICK: ",skin); tlnick.setX(mitad-13-tlnick.getWidth()); tlnick.setY(miniheight*5); tanick= new TextArea(user.getNick(), skin); tanick.setX(mitad+13); tanick.setY(miniheight*5-tanick.getHeight()/5); tanick.setAlignment(Align.bottom); tanick.setColor(1, 1, 1, -0.5f); //Checkbox chcksonido= new CheckBox("Sound", skin); chcksonido.setX(mitad-chcksonido.getWidth()/2); chcksonido.setY(miniheight*3); chcksonido.left(); //chcksonido.align(Align.right); chcksonido.setChecked(user.isSonido()); //Escenario nuevo escenariopciones = new Stage(new ScreenViewport()); //Le añadimos los distintos actores escenariopciones.addActor(tapunt); escenariopciones.addActor(tlnick); escenariopciones.addActor(tanick); escenariopciones.addActor(chcksonido); escenariopciones.addActor(btnVolv); escenariopciones.addActor(btnGuardar); Gdx.input.setInputProcessor(escenariopciones); }
{ "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
Controlo que pantalla se lanza
public void run (){ game.setScreen(game.ui); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void limpa() {\n\t\t// limpa Alfabeto\n\t\tsimbolos.limpar();\n\t\t// limpa conjunto de estados\n\t\testados.limpar();\n\t\t// limpa Funcao Programa\n\t\tfuncaoPrograma.limpar();\n\t\t// Limpa estados finais\n\t\testadosFinais.limpar();\n\t}", "@Override\r\n\tpublic boolean cadastrar(Loja loja) {\n\t\treturn false;\r\n\t}", "public void limpiar() {\n\t//txtBuscar.setText(\"\");\n\n\t// codTemporal.setText(\"\");\n\thabilita(true, false, false, false, false, true, false, true, true);\n }", "public void bayar() {\n transaksi.setStatus(\"lunas\");\n setLunas(true);\n }", "public void inizializza() {\n Navigatore nav;\n Portale portale;\n\n super.inizializza();\n\n try { // prova ad eseguire il codice\n\n Modulo modulo = getModuloRisultati();\n modulo.inizializza();\n// Campo campo = modulo.getCampoChiave();\n// campo.setVisibileVistaDefault(false);\n// campo.setPresenteScheda(false);\n// Vista vista = modulo.getVistaDefault();\n// vista.getElement\n// Campo campo = vista.getCampo(modulo.getCampoChiave());\n\n\n\n /* aggiunge il Portale Navigatore al pannello placeholder */\n nav = this.getNavigatore();\n portale = nav.getPortaleNavigatore();\n this.getPanNavigatore().add(portale);\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n }// fine del blocco try-catch\n\n }", "public void llenarInformacion(){\n llenarDetalles();\n llenarLogros();\n }", "private void BajarPiezaAlInstante() {\n int newY = posicionY;\r\n while (newY > 0) {\r\n if (!Mover(piezaActual, posicionX, newY - 1)) {\r\n break;\r\n }\r\n --newY;\r\n }\r\n BajarPieza1posicion();\r\n }", "public void orina() {\n System.out.println(\"Que bien me quedé! Deposito vaciado.\");\n }", "public void caminar(){\n if(this.robot.getOrden() == true){\n System.out.println(\"Ya tengo la orden, caminare a la cocina para empezar a prepararla.\");\n this.robot.asignarEstadoActual(this.robot.getEstadoCaminar());\n }\n }", "private void limpiarDatos() {\n\t\t\n\t}", "public void iniciarBatalha() {\r\n\t\trede.iniciarPartidaRede();\r\n\t}", "private void atualizarTela() {\n\t\tif(this.primeiraJogada == true) {//SE FOR A PRIMEIRA JOGADA ELE MONTA O LABEL DOS NUMEROS APOS ESCOLHER A POSICAO PELA PRIMEIRA VEZ\r\n\t\t\tthis.primeiraJogada = false;\r\n\t\t\tthis.montarLabelNumeros();\r\n\t\t}\r\n\r\n\t\tthis.esconderBotao();\r\n\t\t\r\n\t\tthis.acabarJogo();\r\n\t}", "public void limpiar() {\n\t\taut_empleado.limpiar();\n\t\tutilitario.addUpdate(\"aut_empleado\");// limpia y refresca el autocompletar\n\n\n\t}", "public void rodar(){\n\t\tmeuConjuntoDePneus.rodar();\r\n\t}", "private void llenarVacios(int inicial){\n\t\tint[] vecinos = obtenerVecinos(inicial);\n\t\t\n\t\t//Saber cuales vecinos no tienen bombas\n\t\tvacios.clear();\n\t\tvacios.add(inicial);\n\t\tfor(int b = 0; b<Constantes.FILAS*Constantes.COLUMNAS; b++){\n\t\t\tvecinos = obtenerVecinos(vacios.get(b));\n\t\t\tfor(int i =0; i<vecinos.length;i++){\n\t\t\t\tif(vecinos[i] != -1 && LayerBotones.botones[vecinos[i]].getCantBombas() == 0){\n\t\t\t\t\tvacios.add(vecinos[i]);\n\t\t\t\t\tLayerBotones.botones[vecinos[i]].setDescubierto(true);\n\t\t\t\t}else if (vecinos[i] != -1){\n\t\t\t\t\taDespejar.add(vecinos[i]);\n\t\t\t\t\tLayerBotones.botones[vecinos[i]].setDescubierto(true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor(int i =0; i<vacios.size();i++){\n\t\t\tLayerBotones.botones[vacios.get(i)].setIcon(numeros[0]);\n\t\t\t//LayerBotones.botones[8].ponerIcono();\n\t\t\t\n\t\t}\n\t\tfor(int i =0; i<aDespejar.size();i++){\n\t\t\tLayerBotones.botones[aDespejar.get(i)].ponerIcono();\n\t\t\t//LayerBotones.botones[8].ponerIcono();\n\t\t\t\n\t\t}\n\t\t\n\t}", "private void BajarPiezaRapido() {\n if (!Mover(piezaActual, posicionX, posicionY - 1)) {\r\n BajarPieza1posicion();\r\n }\r\n }", "public void ordenaPontos(){\r\n\t\tloja.ordenaPontos();\r\n\t}", "public void cambioLigas(){\n\t\ttry{\n\t\t\tmodelo.updatePartidosEmaitzak(ligasel.getSelectionModel().getSelectedItem().getIdLiga());\n\t\t}catch(ManteniException e){\n\t\t\t\n\t\t}\n\t\t\n\t}", "private void cargarFichaLepra_inicio() {\r\n\t\tMap<String, Object> parametros = new HashMap<String, Object>();\r\n\t\tparametros.put(\"nro_identificacion\",\r\n\t\t\t\tadmision_seleccionada.getNro_identificacion());\r\n\t\tparametros.put(\"nro_ingreso\", admision_seleccionada.getNro_ingreso());\r\n\t\tparametros.put(\"estado\", admision_seleccionada.getEstado());\r\n\t\tparametros.put(\"codigo_administradora\",\r\n\t\t\t\tadmision_seleccionada.getCodigo_administradora());\r\n\t\tparametros.put(\"id_plan\", admision_seleccionada.getId_plan());\r\n\t\tparametros.put(IVias_ingreso.ADMISION_PACIENTE, admision_seleccionada);\r\n\t\tparametros.put(IVias_ingreso.OPCION_VIA_INGRESO,\r\n\t\t\t\tOpciones_via_ingreso.REGISTRAR);\r\n\t\ttabboxContendor.abrirPaginaTabDemanda(false,\r\n\t\t\t\tIRutas_historia.PAGINA_INICIO_TRATAMIENTO_LEPRA,\r\n\t\t\t\tIRutas_historia.LABEL_INICIO_TRATAMIENTO_LEPRA, parametros);\r\n\t}", "private void acabarJogo() {\n\t\tif (mapa.isFimDeJogo() || mapa.isGanhouJogo()) {\r\n\r\n\t\t\tthis.timer.paraRelogio();\r\n\r\n\t\t\tif (mapa.isFimDeJogo()) {//SE PERDEU\r\n\t\t\t\tJOptionPane.showMessageDialog(this, \"VOCÊ PERDEU\", \"FIM DE JOGO\", JOptionPane.INFORMATION_MESSAGE);\r\n\t\t\t} else {//SE GANHOU\r\n\t\t\t\tJOptionPane.showMessageDialog(this,\r\n\t\t\t\t\t\t\"PARABÉNS \" + this.nomeJogador + \"! \" + \"TODAS AS BOMBAS FORAM ENCONTRADAS\", \"VOCÊ GANHOU\",\r\n\t\t\t\t\t\tJOptionPane.INFORMATION_MESSAGE);\r\n\t\t\t\tiniciarRanking();//SE VENCEU MANDA O JOGADOR PRO RANKING\r\n\t\t\t}\r\n\t\t\tthis.voltarMenu();//VOLTA PRO MENU\r\n\r\n\t\t}\r\n\t}", "public FiltroBoletoBancarioLancamentoEnvio() {\n\n\t}", "private void comenzarLocalizacionPorRedDeDatos() {\n\t\tmLocManagerNetwork = (LocationManager) getSystemService(Context.LOCATION_SERVICE);\n//\t\tLog.i(LOGTAG, \"mLocManagerNetwork: \" + mLocManagerNetwork);\n\t\t\n\t\t//Nos registramos para recibir actualizaciones de la posicion\n\t\tmLocListenerNetwork = new LocationListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onStatusChanged(String provider, int status, Bundle extras) {\n//\t\t\t\tLog.i(LOGTAG, \"Cambio en estatus RED DE DATOS\");\n//\t\t\t\tToast.makeText(getApplicationContext(), \"Cambio en estatus RED DE DATOS\", Toast.LENGTH_SHORT).show();\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onProviderEnabled(String provider) {\n\t\t\t\tToast.makeText(getApplicationContext(), \"Red de Datos Encendida\", Toast.LENGTH_SHORT).show();\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onProviderDisabled(String provider) {\n\t\t\t\tToast.makeText(getApplicationContext(), \"Red de Datos Apagada por favor revise\", Toast.LENGTH_SHORT).show();\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onLocationChanged(Location location) {\n\t\t\t\tguardarPosicion(location);\n\t\t\t}\n\t\t};\n//\t\tLog.i(LOGTAG, \"mLocListenerNetwork: \" + mLocListenerNetwork);\n\t\tmLocManagerNetwork.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, MIN_TIME_BW_UPDATES, MIN_DISTANCE_CHANGE_FOR_UPDATES, mLocListenerNetwork);\n\t}", "@Override\r\n\tpublic void hacerSonido() {\n\t\tSystem.out.print(\"miau,miau -- o depende\");\r\n\t\t\r\n\t}", "public void turnoSuccessivo(int lancioCorrente) {\n }", "private void cargarFichaLepra_control() {\r\n\r\n\t\tMap<String, Object> parameters = new HashMap<String, Object>();\r\n\t\tparameters.put(\"codigo_empresa\", codigo_empresa);\r\n\t\tparameters.put(\"codigo_sucursal\", codigo_sucursal);\r\n\t\tparameters.put(\"nro_identificacion\", tbxNro_identificacion.getValue());\r\n\r\n\t\tficha_inicio_lepraService.setLimit(\"limit 25 offset 0\");\r\n\r\n\t\t// log.info(\"parameters>>>>\" + parameters);\r\n\t\tBoolean ficha_inicio = ficha_inicio_lepraService\r\n\t\t\t\t.existe_paciente_lepra(parameters);\r\n\t\t// log.info(\"ficha_inicio>>>>\" + ficha_inicio);\r\n\r\n\t\tif (ficha_inicio) {\r\n\t\t\tMap<String, Object> parametros = new HashMap<String, Object>();\r\n\t\t\tparametros.put(\"nro_identificacion\",\r\n\t\t\t\t\tadmision_seleccionada.getNro_identificacion());\r\n\t\t\tparametros.put(\"nro_ingreso\",\r\n\t\t\t\t\tadmision_seleccionada.getNro_ingreso());\r\n\t\t\tparametros.put(\"estado\", admision_seleccionada.getEstado());\r\n\t\t\tparametros.put(\"codigo_administradora\",\r\n\t\t\t\t\tadmision_seleccionada.getCodigo_administradora());\r\n\t\t\tparametros.put(\"id_plan\", admision_seleccionada.getId_plan());\r\n\t\t\tparametros.put(IVias_ingreso.ADMISION_PACIENTE,\r\n\t\t\t\t\tadmision_seleccionada);\r\n\t\t\tparametros.put(IVias_ingreso.OPCION_VIA_INGRESO,\r\n\t\t\t\t\tOpciones_via_ingreso.REGISTRAR);\r\n\t\t\ttabboxContendor.abrirPaginaTabDemanda(false,\r\n\t\t\t\t\tIRutas_historia.PAGINA_SEGUIMIENTO_TRATAMIENTO_LEPRA,\r\n\t\t\t\t\tIRutas_historia.LABEL_SEGUIMIENTO_TRATAMIENTO_LEPRA,\r\n\t\t\t\t\tparametros);\r\n\t\t}\r\n\t}", "public void iniciarPartidaRede(boolean ehMinhaVez) {\r\n\t\tString nomeJogadorAdversario = rede.obterNomeAdversario();\r\n\t\tthis.mapa = Mapa.getInstance();\r\n\t\tint trincheiraDefinida;\r\n\t\tif(ehMinhaVez) {\r\n\t\t\tmapa.criaJogador(this.nomeUsuario, true);\r\n\t\t\tmapa.criarJogadorAdversario(nomeJogadorAdversario, false);\r\n\t\t\ttrincheiraDefinida = 1;\r\n\t\t\tmapa.procedimentoDeLance(1, this);\r\n\t\t} else {\r\n\t\t\tmapa.criaJogador(this.nomeUsuario, false);\r\n\t\t\tmapa.criarJogadorAdversario(nomeJogadorAdversario, true);\r\n\t\t\ttrincheiraDefinida = 0;\r\n\t\t}\r\n\t\t/*\r\n\t\t * tem que chamar todos os metodos de acoes dos botoes do painelJogoExecucao\r\n\t\t * alem de setar valores de labels\r\n\t\t */\r\n\t\tgetContentPane().removeAll();\r\n\t\tpainelJogoExecucao = new PainelJogoExecucao(trincheiraDefinida);\r\n\t\tgetContentPane().add(painelJogoExecucao);\r\n\t\trevalidate();\r\n\t\trepaint();\r\n\t\tpainelJogoExecucao.atualizaLabels(mapa.getAntimateria(), mapa.getNumTurnos());\r\n\t\tpainelJogoExecucao.atualizaVidaTorres(mapa.getTrincheira(), mapa.getTrincheiraAdversario());\r\n\t\t\r\n\t}", "private void peliLoppuuUfojenTuhoamiseen() {\n if (tuhotut == Ufolkm) {\n ingame = false;\n Loppusanat = \"STEVE HOLT!\";\n }\n }", "public void comenzarDiaLaboral() {\n\t\tSystem.out.println(\"AEROPUERTO: Inicio del dia laboral, se abren los puestos de informe, atención y freeshops al público, el conductor del tren llega a tiempo como siempre\");\n\t\tthis.turnoPuestoDeInforme.release();\n\t\t}", "void pasarALista();", "public void Ordenamiento() {\n\n\t}", "@Override\r\n public void moverAyuda() {\n System.out.println(\"La reina puede mover hacia cualquier dirección en linea recta / diagonal\");\r\n }", "private static void cajas() {\n\t\t\n\t}", "private void tallennaTiedostoon() {\n viitearkisto.tallenna();\n }", "public void avvia() {\n /* variabili e costanti locali di lavoro */\n\n try { // prova ad eseguire il codice\n getModuloRisultati().avvia();\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n }// fine del blocco try-catch\n\n super.avvia();\n\n }", "public void inOrden(){\n\t\tPlanta planta= Singleton.GetPlanta();\n\t Arbol <T> aux=null;\n\t if (!vacio()) {\n\t if ((aux=getHijoIzq())!=null) {\n\t aux.inOrden();\n\t } \n\t \n\t planta.out().print(\" \"+this.datoRaiz);\n\t \n\t if ((aux=getHijoDer())!=null){\n\t aux.inOrden();\n\t } \n\t }\n\t}", "private static boolean juega() {\r\n\t\tv.setMensaje( \"Empieza el nivel \" + nivel + \". Puntuación = \" + puntuacion + \r\n\t\t\t\". Dejar menos de \" + (tamanyoTablero-2) + \" pelotas de cada color. \" + (tamanyoTablero-1) + \" o más seguidas se quitan.\" );\r\n\t\t// v.setDibujadoInmediato( false ); // Notar la mejoría de \"vibración\" si se hace esto y (2)\r\n\t\twhile (!v.estaCerrada() && !juegoAcabado()) {\r\n\t\t\tPoint puls = v.getRatonPulsado();\r\n\t\t\tif (puls!=null) {\r\n\t\t\t\t// Pelota pelotaPulsada = hayPelotaPulsadaEn( puls, tablero ); // Sustituido por el objeto:\r\n\t\t\t\tPelota pelotaPulsada = tablero.hayPelotaPulsadaEn( puls );\r\n\t\t\t\tif (pelotaPulsada!=null) {\r\n\t\t\t\t\tdouble coordInicialX = pelotaPulsada.getX();\r\n\t\t\t\t\tdouble coordInicialY = pelotaPulsada.getY();\r\n\t\t\t\t\tv.espera(20); // Espera un poquito (si no pasa todo demasiado rápido)\r\n\t\t\t\t\t// Hacer movimiento hasta que se suelte el ratón\r\n\t\t\t\t\tPoint drag = v.getRatonPulsado();\r\n\t\t\t\t\twhile (drag!=null && drag.x>0 && drag.y>0 && drag.x<v.getAnchura() && drag.y<v.getAltura()) { // EN CORTOCIRCUITO - no se sale de los bordes\r\n\t\t\t\t\t\tpelotaPulsada.borra( v );\r\n\t\t\t\t\t\tpelotaPulsada.incXY( drag.x - puls.x, drag.y - puls.y );\r\n\t\t\t\t\t\tpelotaPulsada.dibuja( v );\r\n\t\t\t\t\t\trepintarTodas(); // Notar la diferencia si no se hace esto (se van borrando las pelotas al pintar otras que pasan por encima)\r\n\t\t\t\t\t\t// v.repaint(); // (2)\r\n\t\t\t\t\t\tpuls = drag;\r\n\t\t\t\t\t\tdrag = v.getRatonPulsado();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Recolocar pelota en un sitio válido\r\n\t\t\t\t\trecolocar( pelotaPulsada, coordInicialX, coordInicialY );\r\n\t\t\t\t\tquitaPelotasSiLineas( true );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tpuntuacion -= (numMovimientos*PUNTOS_POR_MOVIMIENTO); // Se penaliza por el número de movimientos\r\n\t\tif (v.estaCerrada()) return false; // Se acaba el juego cerrando la ventana\r\n\t\tif (nivelPasado()) return true; // Se ha pasado el nivel\r\n\t\treturn false; // No se ha pasado el nivel\r\n\t}", "public void inicia() { \r\n\t\tventana=new VentanaMuestraServicios(this);\r\n\t\tventana.abre();\r\n\t}", "public void carroNoAgregado(){\n System.out.println(\"No hay un parqueo para su automovil\");\n }", "private void menuArmadura(){\n System.out.println(\"Escolha o local em que queira colocar a uma armadura:\");\n System.out.println(\"1 - Cabeça\");\n System.out.println(\"2 - Tronco\");\n System.out.println(\"3 - Pernas\");\n System.out.println(\"4 - Pés\");\n System.out.println(\"0 - Sair\");\n }", "public void uruchomGre()\n\t{\n\t\tustawPojazdNaPoczatek();\n\t\tplanszaWidokHND.repaint();\n\t\twToku = true;\n\t\tzegar.start();\n\t\tpauza = false;\n\t}", "public boolean estaLlena() {\n return (capacidad == top+1); // regresa verdadero si la capacidad es igual al tope (la cima +1)\r\n }", "public void controllore() {\n if (puntiVita > maxPunti) puntiVita = maxPunti;\n if (puntiFame > maxPunti) puntiFame = maxPunti;\n if (puntiFelicita > maxPunti) puntiFelicita = maxPunti;\n if (soldiTam < 1) {\n System.out.println(\"Hai finito i soldi\");\n System.exit(3);\n }\n //controlla che la creatura non sia morta, se lo è mette sonoVivo a false\n if (puntiVita <= minPunti && puntiFame <= minPunti && puntiFelicita <= minPunti) sonoVivo = false;\n }", "public synchronized void abilitarAbordaje() {\n abordar = true;\r\n notifyAll();\r\n while(pedidoAbordaje != 0){//Mientras los pasajeros esten abordando\r\n try {\r\n wait();\r\n } catch (InterruptedException ex) {\r\n Logger.getLogger(Vuelo.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }\r\n //Cuando los pasajeros hayan abordado el vuelo sale\r\n salio = true;\r\n System.out.println(\"El vuelo \" + nro + \" de \" + aerolinea + \" ha despegado\");\r\n }", "public void riconnetti() {\n\t\tconnesso = true;\n\t}", "public void cambiarEstado(){\n\r\n revelado=true;\r\n }", "public void estiloAcierto() {\r\n\t\t /**Bea y Jose**/\t\t\r\n \r\n\t}", "public void acheter(){\n\t\t\n\t\t// Achete un billet si il reste des place\n\t\ttry {\n\t\t\tthis.maBilleterie.vendre();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tthis.status.put('B', System.currentTimeMillis());\n\t\tSystem.out.println(\"STATE B - Le festivalier \" + this.numFestivalier + \" a acheté sa place\");\n\t}", "public void faiLavoro(){\n System.out.println(\"Scrivere 1 per Consegna lunga\\nSeleziona 2 per Consegna corta\\nSeleziona 3 per Consegna normale\");\n\n switch (creaturaIn.nextInt()) {\n case 1 -> {\n soldiTam += 500;\n puntiVita -= 40;\n puntiFame -= 40;\n puntiFelicita -= 40;\n }\n case 2 -> {\n soldiTam += 300;\n puntiVita -= 20;\n puntiFame -= 20;\n puntiFelicita -= 20;\n }\n case 3 -> {\n soldiTam += 100;\n puntiVita -= 10;\n puntiFame -= 10;\n puntiFelicita -= 10;\n }\n }\n checkStato();\n }", "private void datosVehiculo(boolean esta_en_revista) {\n\t\ttry{\n\t\t\t String Sjson= Utils.doHttpConnection(\"http://datos.labplc.mx/movilidad/vehiculos/\"+placa+\".json\");\n\t\t\t JSONObject json= (JSONObject) new JSONTokener(Sjson).nextValue();\n\t\t\t JSONObject json2 = json.getJSONObject(\"consulta\");\n\t\t\t JSONObject jsonResponse = new JSONObject(json2.toString());\n\t\t\t JSONObject sys = jsonResponse.getJSONObject(\"tenencias\");\n\t\t\t \n\t\t\t if(sys.getString(\"tieneadeudos\").toString().equals(\"0\")){\n\t\t\t \tautoBean.setDescripcion_tenencia(getResources().getString(R.string.sin_adeudo_tenencia));\n\t\t\t \tautoBean.setImagen_teencia(imagen_verde);\n\t\t\t }else{\n\t\t\t \tautoBean.setDescripcion_tenencia(getResources().getString(R.string.con_adeudo_tenencia));\n\t\t\t \tautoBean.setImagen_teencia(imagen_rojo);\n\t\t\t \tPUNTOS_APP-=PUNTOS_TENENCIA;\n\t\t\t }\n\t\t\t \n\t\t\t JSONArray cast = jsonResponse.getJSONArray(\"infracciones\");\n\t\t\t String situacion;\n\t\t\t boolean hasInfraccion=false;\n\t\t\t for (int i=0; i<cast.length(); i++) {\n\t\t\t \tJSONObject oneObject = cast.getJSONObject(i);\n\t\t\t\t\t\t try {\n\t\t\t\t\t\t\t situacion = (String) oneObject.getString(\"situacion\");\n\t\t\t\t\t\t\t if(!situacion.equals(\"Pagada\")){\n\t\t\t\t\t\t\t\t hasInfraccion=true;\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t } catch (JSONException e) { \n\t\t\t\t\t\t\t DatosLogBean.setDescripcion(Utils.getStackTrace(e));\n\t\t\t\t\t\t }\n\t\t\t }\n\t\t\t if(hasInfraccion){\n\t\t\t \t autoBean.setDescripcion_infracciones(getResources().getString(R.string.tiene_infraccion));\n\t\t\t\t \tautoBean.setImagen_infraccones(imagen_rojo);\n\t\t\t\t \tPUNTOS_APP-=PUNTOS_INFRACCIONES;\n\t\t\t }else{\n\t\t\t \t autoBean.setDescripcion_infracciones(getResources().getString(R.string.no_tiene_infraccion));\n\t\t\t\t autoBean.setImagen_infraccones(imagen_verde);\n\t\t\t }\n\t\t\t JSONArray cast2 = jsonResponse.getJSONArray(\"verificaciones\");\n\t\t\t if(cast2.length()==0){\n\t\t\t \t autoBean.setDescripcion_verificacion(getResources().getString(R.string.no_tiene_verificaciones));\n\t\t\t\t\t autoBean.setImagen_verificacion(imagen_rojo);\n\t\t\t\t\t PUNTOS_APP-=PUNTOS_VERIFICACION;\n\t\t\t }\n\t\t\t\t\t Date lm = new Date();\n\t\t\t\t\t String lasmod = new SimpleDateFormat(\"yyyy-MM-dd\").format(lm);\n\t\t\t\t\t SimpleDateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\t\t\t\tBoolean yaValide=true;\n\t\t\t\t for (int i=0; i<cast2.length(); i++) {\n\t\t\t\t \tJSONObject oneObject = cast2.getJSONObject(i);\n\t\t\t\t\t\t\t try {\n\t\t\t\t\t\t\t\t\tif(!esta_en_revista&&yaValide){\n\t\t\t\t\t\t\t\t\t\t autoBean.setMarca((String) oneObject.getString(\"marca\"));\n\t\t\t\t\t\t\t\t\t\t autoBean.setSubmarca((String) oneObject.getString(\"submarca\"));\n\t\t\t\t\t\t\t\t\t\t autoBean.setAnio((String) oneObject.getString(\"modelo\"));\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t autoBean.setDescripcion_revista(getResources().getString(R.string.sin_revista));\n\t\t\t\t\t\t\t\t\t\t autoBean.setImagen_revista(imagen_rojo);\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t Calendar calendar = Calendar.getInstance();\n\t\t\t\t\t\t\t\t\t\t int thisYear = calendar.get(Calendar.YEAR);\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t if(thisYear-Integer.parseInt(autoBean.getAnio())<=10){\n\t\t\t\t\t\t\t\t\t\t\t autoBean.setDescripcion_vehiculo(getResources().getString(R.string.carro_nuevo)+\" \"+getResources().getString(R.string.Anio)+\" \"+autoBean.getAnio());\n\t\t\t\t\t\t\t\t\t\t\t autoBean.setImagen_vehiculo(imagen_verde);\n\t\t\t\t\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t\t\t\t\t autoBean.setDescripcion_vehiculo(getResources().getString(R.string.carro_viejo)+\" \"+getResources().getString(R.string.Anio)+\" \"+autoBean.getAnio());\n\t\t\t\t\t\t\t\t\t\t\t autoBean.setImagen_vehiculo(imagen_rojo);\n\t\t\t\t\t\t\t\t\t\t\t PUNTOS_APP-=PUNTOS_ANIO_VEHICULO;\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t yaValide=false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t Date date1 = formatter.parse(lasmod);\n\t\t\t\t\t\t\t\t Date date2 = formatter.parse(oneObject.getString(\"vigencia\").toString());\n\t\t\t\t\t\t\t\t int comparison = date2.compareTo(date1);\n\t\t\t\t\t\t\t\t if((comparison==1||comparison==0)&&!oneObject.getString(\"resultado\").toString().equals(\"RECHAZO\")){\n\t\t\t\t\t\t\t\t\t autoBean.setDescripcion_verificacion(getResources().getString(R.string.tiene_verificaciones)+\" \"+oneObject.getString(\"resultado\").toString());\n\t\t\t\t\t\t\t\t\t autoBean.setImagen_verificacion(imagen_verde); \n\t\t\t\t\t\t\t\t\t hasVerificacion=true;\n\t\t\t\t\t\t\t\t\t break;\n\t\t\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t\t\t autoBean.setDescripcion_verificacion(getResources().getString(R.string.no_tiene_verificaciones));\n\t\t\t\t\t\t\t\t\t autoBean.setImagen_verificacion(imagen_rojo);\n\t\t\t\t\t\t\t\t\t hasVerificacion=false;\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t } catch (JSONException e) { \n\t\t\t\t\t\t\t\t DatosLogBean.setDescripcion(Utils.getStackTrace(e));\n\t\t\t\t\t\t\t } catch (ParseException e) {\n\t\t\t\t\t\t\t\t DatosLogBean.setDescripcion(Utils.getStackTrace(e));\n\t\t\t\t\t\t\t}\n\t\t\t\t }\n\t\t\t\t if(!hasVerificacion){\n\t\t\t\t \t PUNTOS_APP-=PUNTOS_VERIFICACION;\n\t\t\t\t }\n\t\t\t \n\t\t\t}catch(JSONException e){\n\t\t\t\tDatosLogBean.setDescripcion(Utils.getStackTrace(e));\n\t\t\t}\n\t\t\n\t}", "@Override\n\tpublic boolean vender(String placa) {\n\t\treturn false;\n\t}", "public void verificar_que_se_halla_creado() {\n\t\t\n\t}", "private void carregarAlunosTurma() {\n AcessoFirebase.getFirebase().addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n getUidUsuariosTurma(dataSnapshot);\n montandoArrayListUsuarios(dataSnapshot);\n }\n @Override\n public void onCancelled(DatabaseError databaseError) {\n }\n });\n }", "public void atrapar() {\n if( una == false) {\n\t\tif ((app.mouseX > 377 && app.mouseX < 591) && (app.mouseY > 336 && app.mouseY < 382)) {\n\t\t\tint aleotoridad = (int) app.random(0, 4);\n\n\t\t\tif (aleotoridad == 3) {\n\n\t\t\t\tSystem.out.print(\"Lo atrapaste\");\n\t\t\t\tcambioEnemigo = 3;\n\t\t\t\tsuerte = true;\n\t\t\t\tuna = true;\n\t\t\t}\n\t\t\tif (aleotoridad == 1 || aleotoridad == 2 || aleotoridad == 0) {\n\n\t\t\t\tSystem.out.print(\"Mala Suerte\");\n\t\t\t\tcambioEnemigo = 4;\n\t\t\t\tmal = true;\n\t\t\t\tuna = true;\n\t\t\t}\n\n\t\t}\n }\n\t}", "public void movimiento(Point inicio,Point llegada, String color, int nomFicha){\n \n /*if(this.tablero[inicio.x][inicio.y]==0){\n JOptionPane.showMessageDialog(null, \"no hay nada en esa posición\");\n }*/\n \n this.tablero[inicio.x][inicio.y]=0;\n this.tablero[llegada.x][llegada.y]=nomFicha;\n if (color==\"blanco\"){\n this.posiBlancas[inicio.x][inicio.y]=0;\n this.posiBlancas[llegada.x][llegada.y]=nomFicha;\n this.posiNegras[llegada.x][llegada.y]=0;\n }else{\n this.posiNegras[inicio.x][inicio.y]=0;\n this.posiNegras[llegada.x][llegada.y]=nomFicha;\n this.posiBlancas[llegada.x][llegada.y]=0;\n }\n\n }", "public void jugar_con_el() {\n System.out.println(nombre + \" esta jugando contigo :D\");\n }", "public void anuncio() {\n\n\t\tapp.image(pantallaEncontrado, 197, 115, 300, 150);\n\n\t\tapp.image(botonContinuar, 253, 285);\n\n\t}", "public void sendeSpielStarten();", "public void ejecutarMaquinaTuring() {\n\n\t\tString cadenaEntrada;\n\t\tArrayList<String> cadenaCinta = new ArrayList<>();\n\t\tsetEstadoActual(getEstadoInicial());\n\t\tSystem.out.println(\"Inserte la cadena a probar:\");\n\t\tScanner imputUsuario = new Scanner(System.in);\n\t\tcadenaEntrada = imputUsuario.nextLine();\n\t\tfor (int i = 0; i < cadenaEntrada.length(); i++) {\n\t\t\tcadenaCinta.add(String.valueOf(cadenaEntrada.charAt(i)));\n\t\t}\n\n\t\tcinta = new Cinta(cadenaCinta, new CabezaLE());// inicializamos la cinta\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// con la cadena del\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// usuario\n\t\t/*\n\t\t * Evaluamos\n\t\t */\n\t\tboolean noTransiciones = false;\n\n\t\twhile (noTransiciones == false) {// para cuando no hayan transiciones\n\n\t\t\tnoTransiciones = true;// suponemos, a priori, que no hay\n\t\t\t\t\t\t\t\t\t// transiciones\n\n\t\t\tfor (int j = 0; j < conjuntoTransiciones.size(); j++) {\n\n\t\t\t\tString estadoSiguiente = cinta.getCabezaLE().transitar(estadoActual, cinta.getCadenaCinta(),\n\t\t\t\t\t\tconjuntoTransiciones.get(j));\n\n\t\t\t\tif (estadoSiguiente != null) {// si encontro un estado al que\n\t\t\t\t\t\t\t\t\t\t\t\t// transitar...\n\n\t\t\t\t\testadoActual = estadoSiguiente; // transita\n\t\t\t\t\tnoTransiciones = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} // END FOR\n\t\t} // END WHILE (NO QUEDAN TRANSICIONES)\n\t\tgetCinta().mostrarCinta();\n\t\tcadenaEsAceptada();\n\t}", "public void Lista(){\n\t\tcabeza = null;\n\t\ttamanio = 0;\n\t}", "public void sincronizza() {\n boolean abilita;\n\n super.sincronizza();\n\n try { // prova ad eseguire il codice\n\n /* abilitazione bottone Esegui */\n abilita = false;\n if (!Lib.Data.isVuota(this.getDataInizio())) {\n if (!Lib.Data.isVuota(this.getDataFine())) {\n if (Lib.Data.isSequenza(this.getDataInizio(), this.getDataFine())) {\n abilita = true;\n }// fine del blocco if\n }// fine del blocco if\n }// fine del blocco if\n this.getBottoneEsegui().setEnabled(abilita);\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n }// fine del blocco try-catch\n\n }", "@Override\n\tpublic void iniciar() {\n\t\t\n\t}", "@Override\r\n public void parar(Conexion conexion){\n }", "private void jogarIa() {\n\t\tia = new IA(this.mapa,false);\r\n\t\tia.inicio();\r\n\t\tthis.usouIa = true;\r\n\t\tatualizarBandeirasIa();//ATUALIZA AS BANDEIRAS PARA DEPOIS QUE ELA JOGOU\r\n\t\tatualizarNumeroBombas();//ATUALIZA O NUMERO DE BOMBAS PARA DPS QUE ELA JOGOU\r\n\t\tatualizarTela();\r\n\t\tif(ia.isTaTudoBem() == false)\r\n\t\t\tJOptionPane.showMessageDialog(this, \"IMPOSSIVEL PROSSEGUIR\", \"IMPOSSIVEL ENCONTRAR CASAS CONCLUSIVAS\", JOptionPane.INFORMATION_MESSAGE);\r\n\t}", "public void showLiaisonByClick()\t{\r\n \tSystem.out.print(\"Cliquez votre route: \");\r\n \tif (dessin.waitClick()) {\r\n \t float lon = dessin.getClickLon() ;\r\n \t float lat = dessin.getClickLat() ;\r\n \t \r\n \t float minDist = Float.MAX_VALUE ;\r\n \t Liaison chosen = null;\r\n \t \r\n \t for(Liaison liaison: this.routes)\t{\r\n \t \tfloat londiff = liaison.getLongitude() - lon;\r\n \t \tfloat latdiff = liaison.getLatitude() - lat;\r\n \t \tfloat dist = londiff*londiff + latdiff*latdiff ;\r\n \t \tif(dist < minDist)\t{\r\n \t \t\tchosen = liaison;\r\n \t \t\tminDist = dist;\r\n \t \t}\r\n \t }\r\n \t \r\n\t \tchosen.dessiner(dessin, this.numzone, Color.red);\r\n\t \tthis.dessin.putText(chosen.getLongitude(), chosen.getLatitude(), chosen.toString());\r\n\t \tSystem.out.println(chosen);\r\n\r\n \t}\r\n }", "@Override\n\tpublic void preparar() {\n\t\tSystem.out.println(\"massa, presunto, queijo, calabreza e cebola\");\n\t\t\n\t}", "public void mostrarlistainicifin(){\n if(!estaVacia()){\n String datos = \"<=>\";\n NodoBus auxiliar = inicio;\n while(auxiliar!=null){\n datos = datos + \"(\" + auxiliar.dato +\")<=>\";\n auxiliar = auxiliar.sig;\n JOptionPane.showMessageDialog(null, datos, \"Mostrando lista de inicio a fin\", JOptionPane.INFORMATION_MESSAGE);\n }\n }\n }", "public void bajarBloque() {\n\t\tif (piezaActual != null) {\n\t\t\tif (Mapa.getInstance().estaLibre(piezaActual.getBloque3().getX(),\n\t\t\t\t\tpiezaActual.getBloque3().getY() + 1)) {\n\t\t\t\tpiezaActual.getBloque3().bajar(); // Dejar en ese orden\n\t\t\t\tpiezaActual.getBloque2().bajar();\n\t\t\t\tpiezaActual.getBloque1().bajar();\n\t\t\t} else {\n\t\t\t\tthis.piezaNueva();\n\t\t\t}\n\t\t}\n\t}", "private static void tourJeu(){\n\n\t\twhile(true){\n\t\t\tconsole.afficherEtatJoueurs();\n\t\t\tpasserTour();\n\t\t\tconsole.quelJoueurJoue(tour);\n\t\t\tconsole.afficherJeu();\n\t\t\tconsole.afficherDirectionAssam();\n\n\t\t\tint n;\n\t\t\twhile ((n = console.demanderNbDeplacement()) == -1 );\n\n\t\t\tconsole.afficherDirectionChoisie(n);\n\t\t\tdemanderDeplacerAssam(n);\n\n\n\t\t\tif(joueurElimine == jeu.getJoueurs().length-1){\n\t\t\t\tpasserTour();\n\t\t\t\tconsole.afficherGagnant(tour);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(verifTapis()){\n\t\t\t\tstatistique();\n\t\t\t\treturn;\n\t\t\t}\n\n\n\t\t}\n\t}", "public void jugar(){\n\t\tdo {\n\t\t\t\n\t\t\tSystem.out.printf(\"\\n-------- HANGMAN --------\\n\");\n\t\t\tdibujar();\n\t\t\tSystem.out.printf(\"\\n Errores: %d \\n\\n\", partida.getErrores());\n\t\t\tescribir();\n\t\t\tSystem.out.printf(\"Ingrese una letra: \\n\");\n\t\t\tlectura = entrada.nextLine();\n\t\t\tletra = lectura.charAt(0);\n\t\t\tpartida.accionar(letra);\n\t\t\t\n\t\t} while(!partida.parada());\n\t\t\n\t\t//Aquí se dibuja el estado final del juego.\n\t\t\n\t\tSystem.out.printf(\"\\n-------- HANGMAN --------\\n\");\n\t\tdibujar();\n\t\tSystem.out.printf(\"\\n Errores: %d \\n\\n\", partida.getErrores());\n\t\tescribir();\n\t\tSystem.out.printf(\"\\nTerminó el juego!!\\n\");\n\t\tif(partida.getErrores() == 10){\n\t\t\tSystem.out.printf(\"\\nPerdiste!!\\n\");\n\t\t}\n\t\telse {\n\t\t\tSystem.out.printf(\"\\nGanaste!!\\n\");\n\t\t}\n\t}", "public void automovil(){\r\n System.out.println(\"Ingrese placa: \");\r\n placa = leer.next();\r\n System.out.println(\"Ingrese marca: \");\r\n marca = leer.next();\r\n \r\n Automovil auto = new Automovil(placa, marca, 10000);\r\n controlador.llenarVehiculo(auto);\r\n {\r\n }\r\n }", "private void inAvanti() {\n\t\tif (Game.getInstance().isOnGround) {\n\t\t\tjump=false;\n\t\t\tGame.getInstance().getPersonaggio().setStato(Protagonista.RUN);\n\t\t\tGraficaProtagonista.getInstance().cambiaAnimazioni(Protagonista.RUN);\n\t\t}\n\t}", "private boolean alteraDadosLoja() throws IOException {\n boolean r = false;\n System.out.println(\"Que dados pretende alterar?\");\n System.out.println(\"1 -> Nome\\n2 -> Localizacao\\n3 -> Informacao sobre os dados da fila\" +\n \"\\n4 -> Tempo medio de atendimento\\n5 -> Apagar a Conta\");\n int dados = Input.lerInt();\n switch (dados) {\n case 1:\n System.out.println(\"Para que nome deseja alterar?\");\n String nome = Input.lerString();\n this.controller.setNomeLoja(nome);\n this.controller.gravar();\n break;\n case 2:\n float lon = this.getLongitude();\n float lat = this.getLatitude();\n this.controller.setLocLoja(lat, lon);\n this.controller.gravar();\n break;\n case 3:\n System.out.println(\"Pretende fornecer dados sobre a fila? (true para sim, false para nao)\");\n boolean dadosFila = Input.lerBoolean();\n this.controller.setDFilaControl(dadosFila);\n this.controller.gravar();\n break;\n case 4:\n float tempA = 0;\n System.out.println(\"Qual é o novo tempo de atendimento medio?\");\n while(tempA <= 0) {\n tempA = Input.lerFloat();\n if( tempA <= 0) System.out.println(\"O tempo médio nao pode ser \" + tempA + \"\\nInsira um valor válido:\");\n }\n this.controller.setTempMedControl(tempA);\n this.controller.gravar();\n break;\n case 5:\n System.out.println(\"Tem a certeza que deseja apagar a conta? (true para sim, false para nao)\");\n r = Input.lerBoolean();\n if(r) {\n this.controller.removeConta();\n System.out.println(\"Conta apagada com sucesso!\");\n }\n this.controller.gravar();\n break;\n default:\n System.out.println(\"Opcao inválida!\");\n break;\n }\n if(!r) {\n System.out.println(\"Pretende alterar mais algum dado? (true caso sim, false caso não)\");\n boolean changeAgain = Input.lerBoolean();\n if (changeAgain) alteraDadosLoja();\n }\n return r;\n }", "private void iniciarVentana()\n {\n this.setVisible(true);\n //Centramos la ventana\n this.setLocationRelativeTo(null);\n //Colocamos icono a la ventana\n this.setIconImage(Principal.getLogo());\n //Agregamos Hint al campo de texto\n txt_Nombre.setUI(new Hint(\"Nombre del Archivo\"));\n //ocultamos los componentes de la barra de progreso general\n lblGeneral.setVisible(false);\n barraGeneral.setVisible(false);\n //ocultamos la barra de progreso de archivo\n barra.setVisible(false);\n //deshabiltamos el boton de ElimianrArchivo\n btnEliminarArchivo.setEnabled(false);\n //deshabilitamos el boton de enviar\n btnaceptar.setEnabled(false);\n //Creamos el modelo para la tabla\n modelo=new DefaultTableModel(new Object[][]{},new Object[]{\"nombre\",\"tipo\",\"peso\"})\n {\n //sobreescribimos metodo para prohibir la edicion de celdas\n @Override\n public boolean isCellEditable(int i, int i1) {\n return false;\n }\n \n };\n //Agregamos el modelo a la tabla\n tablaArchivos.setModel(modelo);\n //Quitamos el reordenamiento en la cabecera de la tabla\n tablaArchivos.getTableHeader().setReorderingAllowed(false);\n }", "protected void elaboraPagina() {\n testoPagina = VUOTA;\n\n //header\n testoPagina += this.elaboraHead();\n\n //body\n testoPagina += this.elaboraBody();\n\n //footer\n //di fila nella stessa riga, senza ritorno a capo (se inizia con <include>)\n testoPagina += this.elaboraFooter();\n\n //--registra la pagina principale\n if (dimensioniValide()) {\n testoPagina = testoPagina.trim();\n\n if (pref.isBool(FlowCost.USA_DEBUG)) {\n testoPagina = titoloPagina + A_CAPO + testoPagina;\n titoloPagina = PAGINA_PROVA;\n }// end of if cycle\n\n //--nelle sottopagine non eseguo il controllo e le registro sempre (per adesso)\n if (checkPossoRegistrare(titoloPagina, testoPagina) || pref.isBool(FlowCost.USA_DEBUG)) {\n appContext.getBean(AQueryWrite.class, titoloPagina, testoPagina, summary);\n logger.info(\"Registrata la pagina: \" + titoloPagina);\n } else {\n logger.info(\"Non modificata la pagina: \" + titoloPagina);\n }// end of if/else cycle\n\n //--registra eventuali sottopagine\n if (usaBodySottopagine) {\n uploadSottoPagine();\n }// end of if cycle\n }// end of if cycle\n\n }", "private void wczytajPlanszeZdalnie()\n\t{\n\t\tPobraniePlanszy pobranie = new PobraniePlanszy(pojazd.ktoryPoziom(), this, port, host);\n\t\tThread zadanie = new Thread(pobranie);\n\t\tzadanie.start();\t\n\t}", "private void atualizarTela() {\n\t\tSystem.out.println(\"\\n*** Refresh da Pagina / Consultando Todos os Registro da Tabela PressaoArterial\\n\");\n\t\tpressaoArterial = new PressaoArterial();\n\t\tlistaPressaoArterial = pressaoArterialService.buscarTodos();\n\n\t}", "@Override\n public void ejecutarFrame() {\n //INICIAMOS EL HILO\n try{\n Thread.sleep(250);\n }\n catch (InterruptedException ie){\n ie.printStackTrace();\n }\n\n //VAMOS CAMBIANDO EL COLOR DE LAS LETRAS DE LA PANTALLA DE INICIO\n colorLetra = colorLetra == Color.WHITE ? Color.LIGHT_GRAY : Color.WHITE;\n }", "public void listar() {\n\t\t\n\t}", "public void abrirManoMaximo()\n {\n brazo.manoAbrirMaximo();\n }", "public void statoIniziale()\n {\n int r, c;\n for (r=0; r<DIM_LATO; r++)\n for (c=0; c<DIM_LATO; c++)\n {\n if (eNera(r,c))\n {\n if (r<3) // le tre righe in alto\n contenutoCaselle[r][c] = PEDINA_NERA;\n else if (r>4) // le tre righe in basso\n contenutoCaselle[r][c] = PEDINA_BIANCA;\n else contenutoCaselle[r][c] = VUOTA; // le 2 righe centrali\n }\n else contenutoCaselle[r][c] = VUOTA; // caselle bianche\n }\n }", "public void iniciar(){\n vistaCarrera.setTitle(\"Nueva Carrera\");\n vistaCarrera.setLocationRelativeTo(null);\n }", "public void inicializar() {\r\n\t\tthis.bloqueado = false;\r\n\t}", "public MovimientoPantallaCocina() {\n initComponents();\n \n //COLOCAR FONOD EN LA PANTALLA PARA LA COCINA\n try{\n pnlOrdenes.setBorder(new ImagenCocina());\n } catch (IOException e){\n Logger.getLogger(MovimientoPantallaCocina.class.getName()).log(Level.SEVERE, null, e);\n }\n \n //VISUALIZAR TODAS LAS ORDENES ACTIVAS\n hilo p = new hilo(\"ordenes\");\n p.start();\n }", "@Override\n\tvoid ligar() {\n\t\tsuper.ligar();\n\t\tSystem.out.println(\"Automovel ligando\");\n\t}", "public void changerJoueur() {\r\n\t\t\r\n\t}", "public boolean Llena(){\n return VectorPila.length-1==cima;\n }", "public void jugarMaquinaSola(int turno) {\n if (suspenderJuego) {\n return;\n }\n CuadroPieza cuadroActual;\n CuadroPieza cuadroDestino;\n CuadroPieza MovDestino = null;\n CuadroPieza MovActual = null;\n for (int x = 0; x < 8; x++) {\n for (int y = 0; y < 8; y++) {\n cuadroActual = tablero[x][y];\n if (cuadroActual.getPieza() != null) {\n if (cuadroActual.getPieza().getColor() == turno) {\n for (int x1 = 0; x1 < 8; x1++) {\n for (int y1 = 0; y1 < 8; y1++) {\n cuadroDestino = tablero[x1][y1];\n if (cuadroDestino.getPieza() != null) {\n if (cuadroActual.getPieza().validarMovimiento(cuadroDestino, this)) {\n if (MovDestino == null) {\n MovActual = cuadroActual;\n MovDestino = cuadroDestino;\n } else {\n if (cuadroDestino.getPieza().getPeso() > MovDestino.getPieza().getPeso()) {\n MovActual = cuadroActual;\n MovDestino = cuadroDestino;\n }\n if (cuadroDestino.getPieza().getPeso() == MovDestino.getPieza().getPeso()) {\n //Si es el mismo, elijo al azar si moverlo o no\n if (((int) (Math.random() * 3) == 1)) {\n MovActual = cuadroActual;\n MovDestino = cuadroDestino;\n }\n }\n }\n }\n\n }\n }\n }\n }\n }\n }\n }\n if (MovActual == null) {\n boolean b = true;\n do {//Si no hay mov recomendado, entonces genero uno al azar\n int x = (int) (Math.random() * 8);\n int y = (int) (Math.random() * 8);\n tablero[x][y].getPieza();\n int x1 = (int) (Math.random() * 8);\n int y1 = (int) (Math.random() * 8);\n\n MovActual = tablero[x][y];\n MovDestino = tablero[x1][y1];\n if (MovActual.getPieza() != null) {\n if (MovActual.getPieza().getColor() == turno) {\n b = !MovActual.getPieza().validarMovimiento(MovDestino, this);\n //Si mueve la pieza, sale del while.\n }\n }\n } while (b);\n }\n if (MovActual.getPieza().MoverPieza(MovDestino, this)) {\n this.setTurno(this.getTurno() * -1);\n if (getRey(this.getTurno()).isInJacke(this)) {\n if (Pieza.isJugadorAhogado(turno, this)) {\n JOptionPane.showMessageDialog(null, \"Hacke Mate!!! - te lo dije xD\");\n if (JOptionPane.showConfirmDialog(null, \"Deseas Empezar una nueva Partida¿?\", \"Nueva Partida\", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {\n ordenarTablero();\n } else {\n suspenderJuego = true;\n }\n return;\n } else {\n JOptionPane.showMessageDialog(null, \"Rey en Hacke - ya t kgste\");\n }\n } else {\n if (Pieza.isJugadorAhogado(turno, this)) {\n JOptionPane.showMessageDialog(null, \"Empate!!!\\nComputadora: Solo por que te ahogaste...!!!\");\n if (JOptionPane.showConfirmDialog(null, \"Deseas Empezar una nueva Partida¿?\", \"Nueva Partida\", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {\n ordenarTablero();\n } else {\n suspenderJuego = true;\n }\n return;\n }\n if (Pieza.getCantMovimientosSinCambios() >= 50) {\n JOptionPane.showMessageDialog(null, \"Empate!!! \\nComputadora: Vaya, han pasado 50 turnos sin comernos jeje!!!\");\n if (JOptionPane.showConfirmDialog(null, \"Otra Partida Amistosa¿?\", \"Nueva Partida\", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {\n ordenarTablero();\n } else {\n suspenderJuego = true;\n }\n return;\n }\n }\n }\n if (this.getTurno() == turnoComputadora) {\n jugarMaquinaSola(this.getTurno());\n }\n }", "private void moverArriba()\n\t{\n\t\twhile (true)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tThread.sleep(VentanaJuego.RapidezMovimientoJefe);\n\t\t\t\tJefe.setLocation(Jefe.getX(), Jefe.getY() - 5);\n\t\t\t\tif (Jefe.getY() < -5)\n\t\t\t\t{\n\t\t\t\t\tmoverAbajo();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (InterruptedException e)\n\t\t\t{\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public void livrosLidos(Livro livro){\n\n Boolean enviar = true;\n\n LivroLido livrol = new LivroLido();\n\n //setando o valor do id livro lid\n livrol.setIdLivro(livro.getId());\n\n //saber se o livro já foi enviado\n if(myBooksDb.daoLivrosLidos().idLivros(livro.getId()) == livro.getId()){\n enviar = false;\n Toast.makeText(getContext(),\"O livro já se encontra em livros lidos\", Toast.LENGTH_SHORT).show();\n }\n //verificar se o livro esta em outra tela\n else if(myBooksDb.daoLivroLer().idLivros(livro.getId()) == livro.getId()){\n enviar = false;\n tranferirLidos(livro.getId(),livrol);\n }\n\n if(enviar == true){\n myBooksDb.daoLivrosLidos().inserir(livrol);\n }\n\n }", "public void actualiza(){\r\n //pregunto si se presiono una tecla de dirección\r\n if(bTecla) {\r\n int iX = basPrincipal.getX();\r\n int iY = basPrincipal.getY();\r\n if(iDir == 1) {\r\n iY -= getHeight() / iMAXALTO;\r\n }\r\n if(iDir == 2) {\r\n iX += getWidth() / iMAXANCHO;\r\n }\r\n if(iDir == 3) {\r\n iY += getHeight() / iMAXALTO;\r\n }\r\n if(iDir == 4) {\r\n iX -= getWidth() / iMAXANCHO;\r\n }\r\n //limpio la bandera\r\n bTecla = false;\r\n \r\n //asigno posiciones en caso de no salirme\r\n if(iX >= 0 && iY >= 0 && iX + basPrincipal.getAncho() <= getWidth()\r\n && iY + basPrincipal.getAlto() <= getHeight()) {\r\n basPrincipal.setX(iX);\r\n basPrincipal.setY(iY);\r\n } \r\n }\r\n \r\n //Muevo los chimpys\r\n for(Base basChimpy : lklChimpys) {\r\n basChimpy.setX(basChimpy.getX() - iAceleracion);\r\n }\r\n \r\n //Muevo los diddys\r\n for(Base basDiddy : lklDiddys) {\r\n basDiddy.setX(basDiddy.getX() + iAceleracion);\r\n }\r\n\r\n }", "public void asignarVida();", "@Override\r\n\tpublic boolean lancar(Combativel origem, Combativel alvo) {\r\n DadoVermelho dado = new DadoVermelho();\r\n int valor = dado.jogar();\r\n if(valor < origem.getInteligencia()) {\r\n alvo.defesaMagica(dano);\r\n return true;\r\n }\r\n else {\r\n \tSystem.out.println(\"Voce nao conseguiu usar a magia\");\r\n }\r\n return false;\r\n }", "private void caricaLista() {\n /** variabili e costanti locali di lavoro */\n ArrayList unaLista = null;\n CampoDati unCampoDati = null;\n CDBLinkato unCampoDBLinkato = null;\n //@todo da cancellare\n try { // prova ad eseguire il codice\n /* recupera il campo DB specializzato */\n unCampoDBLinkato = (CDBLinkato)unCampoParente.getCampoDB();\n\n /* recupera la lista dal campo DB */\n unaLista = unCampoDBLinkato.caricaLista();\n\n /* recupera il campo dati */\n unCampoDati = unCampoParente.getCampoDati();\n\n /* registra i valori nel modello dei dati del campo */\n if (unaLista != null) {\n unCampoDati.setValoriInterni(unaLista);\n// unCampoDatiElenco.regolaElementiAggiuntivi();\n } /* fine del blocco if */\n\n } catch (Exception unErrore) { // intercetta l'errore\n /* mostra il messaggio di errore */\n Errore.crea(unErrore);\n } /* fine del blocco try-catch */\n\n }", "public static void Turno(){\n\t\tif (pl1){\n\t\t\tpl1=false;\n\t\t\tpl2=true;\t\n\t\t\tvalore = 1;\n\t\t}\n\t\telse{\n\t\t\tpl1=true;\n\t\t\tpl2=false;\n\t\t\tvalore = 2;\n\t\t}\n\t}", "private UsineJoueur() {}", "private void initVistas() {\n // La actividad responderá al pulsar el botón.\n Button btnSolicitar = (Button) this.findViewById(R.id.btnSolicitar);\n btnSolicitar.setOnClickListener(new OnClickListener() {\n @Override\n public void onClick(View v) {\n solicitarDatos();\n }\n });\n lblDatos = (TextView) this.findViewById(R.id.lblDatos);\n }", "public void majAffichageConnectes() {\n effacerConnectes(); // on efface ce qui est deja ecrit dans la zone reservees a la liste des\n // connectes\n\n choixMessage.removeAllItems(); // Suppression de tous les items de la comboBox\n choixMessage.addItem(\"Tout le monde\");\n choixMessage.setSelectedIndex(0); // Par defaut => envoi a tout le monde\n\n // Parcours de la liste des personnes connectees\n for (Map.Entry<String, Color> entry : couleurs.entrySet()) {\n String nom = entry.getKey(); // recuperation du nom\n Color rgb = new Color(chercherCouleur(nom)); // recuperation de la couleur correspondante\n\n // Mise a jour de la combobox\n if(!fenetre.getClient().getNom().equals(nom)){\n choixMessage.addItem(nom);\n }\n\n // Mise a jour de l'affichage dans le panneau \"Connectes\"\n StyledDocument doc = connectes.getStyledDocument();\n StyleContext style = StyleContext.getDefaultStyleContext();\n // Modification de la couleur\n AttributeSet aset = style.addAttribute(style.getEmptySet(), StyleConstants.Foreground, rgb);\n // Mettre en gras\n aset = style.addAttributes(aset, style.addAttribute(style.getEmptySet(), StyleConstants.Bold, true));\n\n // ajout de la personne dans la liste avec la couleur correspondante\n try {\n doc.insertString(doc.getLength(), nom+\"\\n\", aset);\n } catch (BadLocationException e) {\n e.printStackTrace();\n }\n }\n\n System.out.println(\"maj de l'affichage de la liste des connectes\");\n }", "protected boolean colaVacia() {\r\n return ini == -1;\r\n }", "private void juego(){\r\n boolean ind=false,ind2=true;\r\n System.out.println(\"Comencemos\");\r\n initReloj();\r\n System.out.println(\"Cada Carta esta\");\r\n while(ind==false && this.ind==true){\r\n visualizarm();\r\n usuario();\r\n System.out.println(\"\");\r\n System.out.println(\"\");\r\n if(comprobar()==true){\r\n ind=true;\r\n this.ind=true;\r\n }\r\n }\r\n if(this.ind==true){\r\n ResultadoR res = new ResultadoR();\r\n res.resultado(\"Jugador Gana\",pj);\r\n }\r\n else{\r\n ResultadoR res= new ResultadoR();\r\n res.resultado(\"Jugador Pierde\", pj);\r\n }\r\n }", "public ventanaServidor () { //Constructor\n setBounds(500,200,400,300); //define ubicacion en x, y , ancho, alto del cuadro\n JPanel lamina2 = new JPanel ();\n lamina2.setLayout(new BorderLayout());\n setResizable(false); //evitar que la ventana se redimencione\n setTitle(\"Servidor\");\n setVisible(true); //mostrar en pantalla\n \n \n }", "protected boolean colaLlena() {\r\n return fin == datos.length - 1;\r\n }" ]
[ "0.6616379", "0.6510753", "0.6483997", "0.6368984", "0.6349623", "0.63443464", "0.63333726", "0.63331777", "0.6315324", "0.629039", "0.62726676", "0.62692356", "0.62480366", "0.62233263", "0.61929834", "0.61724305", "0.6150366", "0.6145208", "0.61424625", "0.6136793", "0.61364627", "0.61054486", "0.609013", "0.6085012", "0.60848755", "0.60817355", "0.60741913", "0.6067944", "0.6066341", "0.6057904", "0.6056078", "0.604453", "0.60394174", "0.60350895", "0.6032191", "0.6010409", "0.60040915", "0.5995547", "0.5992681", "0.5990219", "0.5988845", "0.5970408", "0.59649557", "0.5951104", "0.5945794", "0.59451497", "0.593914", "0.5935437", "0.59210825", "0.5919579", "0.5908242", "0.58852434", "0.5878761", "0.5878397", "0.5868359", "0.5865842", "0.58639145", "0.5859478", "0.58527523", "0.5850124", "0.58435667", "0.58428437", "0.5841609", "0.583967", "0.5833063", "0.58245337", "0.5823947", "0.5823831", "0.5822932", "0.5818639", "0.581708", "0.5812422", "0.58029294", "0.5802214", "0.5801429", "0.58007914", "0.5798082", "0.57903886", "0.57903016", "0.57876635", "0.5779631", "0.5778557", "0.57780796", "0.5776582", "0.576721", "0.57645607", "0.57573074", "0.5753829", "0.57516694", "0.574922", "0.574676", "0.5742802", "0.57419133", "0.5734056", "0.5731633", "0.57286066", "0.57150173", "0.57149726", "0.57132167", "0.57086784", "0.57080686" ]
0.0
-1
Created by smartsense on 10/10/16.
public interface NewsDetailViewInt { void onSuccessNewsDetail(NewsObject newsObject); void onFailRequest(); void onFailResponse(String message); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "public final void mo51373a() {\n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "private stendhal() {\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "public void mo38117a() {\n }", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n protected void initialize() {\n\n \n }", "@Override\n\tpublic void anular() {\n\n\t}", "public void mo4359a() {\n }", "public void gored() {\n\t\t\n\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "private void m50366E() {\n }", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "protected boolean func_70814_o() { return true; }", "@Override\n protected void init() {\n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n public void init() {\n }", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "private void init() {\n\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {}", "@Override\n void init() {\n }", "private void poetries() {\n\n\t}", "private void kk12() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void init() {}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n public int describeContents() { return 0; }", "public void mo6081a() {\n }", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\n\tpublic void init()\n\t{\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n protected void getExras() {\n }", "private static void cajas() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t}", "@Override\n\tprotected void initialize() {\n\t}", "@Override\n\tprotected void initialize() {\n\t}", "protected void mo6255a() {\n }", "@Override\n\tprotected void update() {\n\t\t\n\t}", "public void mo12628c() {\n }", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\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\t\tpublic void init() {\n\t\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "@Override\n public void initialize() { \n }", "@Override\n\tpublic int mettreAJour() {\n\t\treturn 0;\n\t}", "@Override\n public int retroceder() {\n return 0;\n }", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "public void skystonePos4() {\n }", "@Override\n\tpublic void afterInit() {\n\t\t\n\t}", "@Override\n\tpublic void afterInit() {\n\t\t\n\t}", "private void initialize() {\n\t\t\n\t}", "public void mo55254a() {\n }" ]
[ "0.6130543", "0.606449", "0.59488094", "0.59441996", "0.59098226", "0.5873072", "0.5842577", "0.5836899", "0.5836899", "0.57737213", "0.5753588", "0.57253194", "0.57227933", "0.5719401", "0.5716169", "0.571443", "0.5712522", "0.5712522", "0.5712522", "0.5712522", "0.5712522", "0.5707564", "0.5706961", "0.5706961", "0.5678017", "0.56766254", "0.566968", "0.5669478", "0.5660732", "0.5660732", "0.5660732", "0.5660732", "0.5660732", "0.5660732", "0.56584007", "0.5653229", "0.56499034", "0.5638573", "0.5630049", "0.56290644", "0.5628145", "0.56179357", "0.5610175", "0.5608558", "0.5604717", "0.55930275", "0.5577601", "0.5577601", "0.5577601", "0.5577601", "0.5577601", "0.5577601", "0.5577601", "0.5573452", "0.5573452", "0.5573452", "0.5566953", "0.55662495", "0.556383", "0.5561833", "0.5560936", "0.5559993", "0.55586845", "0.55586845", "0.55586845", "0.5548615", "0.5548615", "0.5548615", "0.5542261", "0.5541671", "0.5541671", "0.5531363", "0.5524665", "0.5512461", "0.5509259", "0.55048203", "0.5503188", "0.54990125", "0.549654", "0.5496188", "0.5482968", "0.5480041", "0.54741585", "0.54741585", "0.54734015", "0.5473216", "0.5466284", "0.5453615", "0.54525405", "0.54525405", "0.54413193", "0.5441243", "0.54406893", "0.5435565", "0.5426848", "0.542505", "0.5422096", "0.5414939", "0.5414939", "0.541309", "0.5399159" ]
0.0
-1
/ access modifiers changed from: private
public void g(j jVar, String str) { if (!this.b) { com.duapps.ad.entity.a aVar = jVar.c; CharSequence charSequence = aVar != null ? aVar.c : null; if (TextUtils.isEmpty(charSequence)) { f.c("ToolClickHandler", "browserUrl:" + str + " no pkgname"); e(jVar, str); return; } String str2 = "https://play.google.com/store/apps/details?id=" + charSequence; f.c("ToolClickHandler", jVar.c.b + " start google play via mock url -->" + str2); if (d.a(this.c, "com.android.vending")) { f(jVar, str2); } else { e(jVar, str); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private stendhal() {\n\t}", "@Override\n protected void prot() {\n }", "private Rekenhulp()\n\t{\n\t}", "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "public void smell() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "private TMCourse() {\n\t}", "private void m50366E() {\n }", "private PropertyAccess() {\n\t\tsuper();\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "public void method_4270() {}", "public abstract Object mo26777y();", "@Override\n protected void init() {\n }", "@Override\n\tprotected void interr() {\n\t}", "private MApi() {}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "public void mo38117a() {\n }", "private void someUtilityMethod() {\n }", "private void someUtilityMethod() {\n }", "private Infer() {\n\n }", "protected abstract Set method_1559();", "@Override\n void init() {\n }", "@Override\n public void init() {\n\n }", "private void kk12() {\n\n\t}", "public abstract void mo70713b();", "@Override\n public void init() {\n }", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@SuppressWarnings(\"unused\")\n private void _read() {\n }", "private Singletion3() {}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "@Override\n\tprotected void getExras() {\n\n\t}", "private ChainingMethods() {\n // private constructor\n\n }", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "private abstract void privateabstract();", "protected boolean func_70814_o() { return true; }", "private Get() {}", "private Get() {}", "public void m23075a() {\n }", "private Util() { }", "@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 protected void getExras() {\n }", "@Override\n\tpublic void einkaufen() {\n\t}", "public void mo21779D() {\n }", "private test5() {\r\n\t\r\n\t}", "public void mo21825b() {\n }", "@Override\n public void memoria() {\n \n }", "private MigrationInstantiationUtil() {\n\t\tthrow new IllegalAccessError();\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}", "protected Doodler() {\n\t}", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "private FlyWithWings(){\n\t\t\n\t}", "private MetallicityUtils() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void test() {\n\t\t\t}", "@Override\r\n\tpublic void init() {}", "@Override\n public void init() {}", "@Override\n public boolean isPrivate() {\n return true;\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "public abstract void mo56925d();", "public abstract void mo27386d();", "@Override\r\n\t\t\tpublic void buscar() {\n\r\n\t\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "public void mo21877s() {\n }", "private Utils() {}", "private Utils() {}", "private Utils() {}", "private Utils() {}", "@DSComment(\"Private Method\")\n @DSBan(DSCat.PRIVATE_METHOD)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 13:00:49.426 -0500\", hash_original_method = \"26D71A046B8A5E21DEFC65FB89CD9FDA\", hash_generated_method = \"2293476E78FCC8BDA181F927AEA93BD1\")\n \nprivate void copyTables ()\n {\n if (prefixTable != null) {\n prefixTable = (Hashtable)prefixTable.clone();\n } else {\n prefixTable = new Hashtable();\n }\n if (uriTable != null) {\n uriTable = (Hashtable)uriTable.clone();\n } else {\n uriTable = new Hashtable();\n }\n elementNameTable = new Hashtable();\n attributeNameTable = new Hashtable();\n declSeen = true;\n }", "@Override\n public void get() {}", "private SimpleRepository() {\n \t\t// private ct to disallow external object creation\n \t}", "private void ss(){\n }", "public void mo21782G() {\n }", "public abstract void mo27385c();", "@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}", "protected void h() {}", "private void init() {\n\n\t}", "private final void i() {\n }" ]
[ "0.70451087", "0.66481936", "0.66338545", "0.6534467", "0.6533057", "0.63756114", "0.6368523", "0.63063055", "0.6244554", "0.62261415", "0.62046665", "0.61776316", "0.6142759", "0.6131381", "0.6131381", "0.61274433", "0.610919", "0.610797", "0.60792845", "0.6062989", "0.6059318", "0.60447836", "0.6037732", "0.6033637", "0.6028711", "0.60249", "0.6015989", "0.6015989", "0.6010123", "0.5991239", "0.5977965", "0.59756213", "0.59711885", "0.59652776", "0.59562653", "0.59491456", "0.5947999", "0.5942879", "0.5941421", "0.59406793", "0.5936351", "0.5936351", "0.5934477", "0.5934473", "0.59311885", "0.59261817", "0.592184", "0.59162307", "0.59162307", "0.5915696", "0.5908215", "0.5903059", "0.5903059", "0.5894341", "0.5887855", "0.58869827", "0.5884463", "0.5881538", "0.588023", "0.5879579", "0.58791363", "0.58698714", "0.58686715", "0.5857818", "0.5855094", "0.5851806", "0.58393794", "0.58365846", "0.58286095", "0.5816463", "0.58148336", "0.58144826", "0.5814171", "0.5814171", "0.5814171", "0.5814171", "0.5814171", "0.5814171", "0.5809802", "0.5802026", "0.57927555", "0.5792171", "0.5790551", "0.5786574", "0.5786574", "0.5786574", "0.5786574", "0.5786161", "0.578553", "0.5785096", "0.57780075", "0.5774098", "0.57732016", "0.57683206", "0.57683206", "0.57683206", "0.57683206", "0.57683206", "0.5763271", "0.57621974", "0.57540506" ]
0.0
-1
/ access modifiers changed from: final
public final void a(j jVar, String str) { if (jVar.d() > 0) { d dVar = new d(); dVar.a = jVar.h(); dVar.d = str; dVar.b = jVar.a(); dVar.c = 1; dVar.e = System.currentTimeMillis(); n.a(this.c).a(dVar); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void func_104112_b() {\n \n }", "private stendhal() {\n\t}", "@Override\n boolean isFinal() {\n return false;\n }", "private void m50366E() {\n }", "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "private Rekenhulp()\n\t{\n\t}", "public final void mo51373a() {\n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "public abstract void mo70713b();", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "public void method_4270() {}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "public abstract Object mo26777y();", "@Override\n\tprotected void interr() {\n\t}", "@Override\n public boolean isFinal() {\n return true;\n }", "public void smell() {\n\t\t\n\t}", "public void m23075a() {\n }", "public abstract void mo27385c();", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n public void init() {\n\n }", "public abstract void mo27386d();", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "@Override\n public void init() {\n }", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\n protected void init() {\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}", "public final void mo91715d() {\n }", "@Override\n void init() {\n }", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}", "public void mo38117a() {\n }", "public void mo21779D() {\n }", "public abstract void mo30696a();", "public abstract void mo42329d();", "void m1864a() {\r\n }", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "final void getData() {\n\t\t//The final method can't be overriden\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n\tpublic void jugar() {}", "private final void i() {\n }", "public abstract void mo27464a();", "public abstract void mo56925d();", "private Singletion3() {}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "public abstract void mo35054b();", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "public abstract void mo42331g();", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "public void mo23813b() {\n }", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public abstract Object mo1771a();", "public abstract void m15813a();", "public void mo21825b() {\n }", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n public void init() {}", "public void mo21793R() {\n }", "public void mo115190b() {\n }", "public abstract void mo6549b();", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}", "@Override\r\n\tpublic final void init() {\r\n\r\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "public void mo21787L() {\n }", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {}", "public void mo21792Q() {\n }", "public void mo21785J() {\n }", "protected abstract Set method_1559();", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "public void gored() {\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}", "private TMCourse() {\n\t}", "public void mo1531a() {\n }", "public abstract String mo118046b();", "public abstract void mo102899a();", "public np a()\r\n/* 33: */ {\r\n/* 34:49 */ return this.b;\r\n/* 35: */ }", "public void mo21782G() {\n }", "Consumable() {\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "public abstract String mo13682d();", "@Override\n public void init() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "private void someUtilityMethod() {\n }", "private void someUtilityMethod() {\n }", "protected boolean func_70814_o() { return true; }", "public abstract Object mo1185b();", "@Override\r\n\tvoid func04() {\n\t\t\r\n\t}", "public void mo12628c() {\n }", "private void assignment() {\n\n\t\t\t}" ]
[ "0.6780707", "0.6668983", "0.64784324", "0.64714205", "0.6469956", "0.64253914", "0.639059", "0.6387737", "0.63849646", "0.63145995", "0.6310284", "0.6293742", "0.627373", "0.6263488", "0.62235826", "0.61849713", "0.615402", "0.6149339", "0.6118576", "0.61151254", "0.6108757", "0.6093418", "0.6092238", "0.6089919", "0.6088814", "0.6084523", "0.60825294", "0.60804117", "0.60804117", "0.6074236", "0.6065131", "0.605477", "0.60187334", "0.60183024", "0.6014379", "0.59967333", "0.59879434", "0.5986482", "0.597863", "0.5961132", "0.59588355", "0.5957546", "0.59550947", "0.5944885", "0.59437853", "0.5933246", "0.592936", "0.5923015", "0.5922109", "0.59217197", "0.59193796", "0.5917391", "0.5913969", "0.5913969", "0.5912202", "0.59111583", "0.5910633", "0.5909058", "0.590725", "0.5903564", "0.5903202", "0.5903045", "0.59028935", "0.5894586", "0.58863866", "0.58863866", "0.58738136", "0.5868361", "0.58652973", "0.5864517", "0.5854035", "0.5854035", "0.5854035", "0.5854035", "0.5854035", "0.58470416", "0.5844108", "0.5843296", "0.5842776", "0.5840906", "0.58399075", "0.58366036", "0.58366036", "0.5834789", "0.58289695", "0.5817177", "0.5814996", "0.5813559", "0.5804869", "0.5803854", "0.5801526", "0.5801377", "0.58011353", "0.57963693", "0.57940274", "0.57940274", "0.5793562", "0.57925427", "0.5792502", "0.579213", "0.5789005" ]
0.0
-1
/ access modifiers changed from: protected|final
public final void b(j jVar, String str) { DefaultHttpClient d = h.d(); d.setRedirectHandler(new a(jVar)); if (f.a()) { f.c("ToolClickHandler", "[Http] Decode URL: " + str); } try { HttpGet httpGet = new HttpGet(str); HttpConnectionParams.setConnectionTimeout(httpGet.getParams(), 10000); HttpConnectionParams.setSoTimeout(httpGet.getParams(), 4000); d.execute(httpGet).getEntity(); } catch (Exception e) { f.b("ToolClickHandler", "[Http] Others error: ", e); if (!jVar.k()) { b(); g(jVar, str); } f(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private stendhal() {\n\t}", "@Override\n protected void prot() {\n }", "private Rekenhulp()\n\t{\n\t}", "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "private abstract void privateabstract();", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "public abstract Object mo26777y();", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "public abstract void mo70713b();", "private void someUtilityMethod() {\n }", "private void someUtilityMethod() {\n }", "public void smell() {\n\t\t\n\t}", "private PropertyAccess() {\n\t\tsuper();\n\t}", "public abstract void mo27386d();", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "protected void h() {}", "@Override\n\tprotected void interr() {\n\t}", "private MigrationInstantiationUtil() {\n\t\tthrow new IllegalAccessError();\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public abstract void mo56925d();", "public abstract void mo27385c();", "protected abstract Set method_1559();", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "private void m50366E() {\n }", "public final void mo51373a() {\n }", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "public void method_4270() {}", "public abstract void mo30696a();", "private Get() {}", "private Get() {}", "protected Doodler() {\n\t}", "private TMCourse() {\n\t}", "public abstract void m15813a();", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private ChainingMethods() {\n // private constructor\n\n }", "private Infer() {\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}", "@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\tprotected void func03() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "private CommonMethods() {\n }", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "final void getData() {\n\t\t//The final method can't be overriden\n\t}", "@Override\n protected void init() {\n }", "abstract int pregnancy();", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void buscar() {\n\r\n\t\t\t}", "@Override\n void init() {\n }", "public abstract String mo41079d();", "public abstract void mo35054b();", "private Util() { }", "public abstract void mo27464a();", "@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}", "@Override\n boolean isFinal() {\n return false;\n }", "public abstract void mo42329d();", "public abstract String mo13682d();", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "public Methods() {\n // what is this doing? -PMC\n }", "private void ss(){\n }", "private final void i() {\n }", "@Override\n\tpublic void dosomething() {\n\t\t\n\t}", "public abstract Object mo1771a();", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\n public void init() {\n }", "@Override\n public void init() {\n\n }", "public abstract void mo102899a();", "@Override\n public void get() {}", "public abstract void mo42331g();", "@Override\n public void memoria() {\n \n }", "private Unescaper() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "public abstract String mo118046b();", "public void m23075a() {\n }", "public final void mo91715d() {\n }", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\r\n\tpublic void smthAbstr() {\n\t\t\r\n\t}", "private URIs() {\r\n throw new IllegalAccessError();\r\n }", "@Override\n\tpublic void leti() \n\t{\n\t}", "public void mo21779D() {\n }", "private Singletion3() {}", "public void myPublicMethod() {\n\t\t\n\t}", "@Override\n protected void getExras() {\n }", "protected Reaction() {/* intentionally empty block */}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "public abstract void mo6549b();", "@Override\n\tpublic void buscar() {\n\t\t\n\t}", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\n\tpublic void some() {\n\t\t\n\t}", "private test5() {\r\n\t\r\n\t}", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "private Utility() {\n throw new IllegalAccessError();\n }" ]
[ "0.71384865", "0.69118977", "0.6696497", "0.6618639", "0.65816313", "0.6562871", "0.6548142", "0.653354", "0.64645296", "0.64423484", "0.63971317", "0.6393302", "0.63451064", "0.63451064", "0.6304564", "0.6303807", "0.6302703", "0.62856597", "0.6280776", "0.62375546", "0.6225619", "0.62186337", "0.621377", "0.621377", "0.6208732", "0.6182756", "0.61754036", "0.61641806", "0.6157934", "0.61573523", "0.61433905", "0.61233795", "0.61228895", "0.61208886", "0.61208886", "0.6118892", "0.6100521", "0.60948586", "0.6086342", "0.60849637", "0.6077791", "0.60766447", "0.60766447", "0.6074776", "0.6074776", "0.6055049", "0.60514575", "0.6047014", "0.60442936", "0.603049", "0.602867", "0.6020601", "0.601862", "0.60180986", "0.60113263", "0.600975", "0.60083324", "0.6007764", "0.6007049", "0.6005208", "0.60034627", "0.59996927", "0.5995789", "0.5993365", "0.5990349", "0.59898776", "0.59854686", "0.59800875", "0.59766924", "0.597615", "0.59752893", "0.5971804", "0.5963764", "0.59618944", "0.59618646", "0.596002", "0.5956388", "0.595369", "0.5952975", "0.5944656", "0.5943908", "0.59395576", "0.5924596", "0.5922979", "0.59170383", "0.59062254", "0.5893624", "0.58917904", "0.5890483", "0.5889005", "0.5881876", "0.5880402", "0.5880343", "0.58766353", "0.5875307", "0.5873345", "0.58704233", "0.586868", "0.58659476", "0.5863199", "0.58620924" ]
0.0
-1
/ is there enough students in the group to make it viable
public boolean hasEnoughStudents() { if (this.students.size() >= minStudents) { return true; } else return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean checkFull() {\n\t\tif (studlist.size() == maxstudents) {\n\t\t\tfull = true;\n\t\t}\n\t\treturn full;\n\t}", "public boolean passed(){\n if (totalMark() == -1) {\n throw new IllegalArgumentException(\"Not enough marks to evaluate student\"); \n } else if (totalMark() >= 50){\n return true;\n }else{\n return false;\n }\n }", "private void NumberOfStudentsInCourse(int numberOfStudents) {\n if (numberOfStudents > 20) {\n throw new StudentNumberForOneCourseExceededException(\"This course is limited to 20 people!\");\n }\n }", "public static void main(String[] args) {\n\n ArrayList<String> students = new ArrayList<>();\n students.add(\"Sayeem\");\n students.add(\"Wagar\");\n students.add(\"Beslan\");\n students.add(\"Dawut\");\n students.add(\"Ramazan\");\n students.add(\"Mehary\");\n\n // Verify that the names: Ulku, Busra are contained in students list\n\n boolean r = students.containsAll(Arrays.asList(\"Ulku\", \"Busra\") );\n System.out.println(r);\n\n System.out.println(\"=======================================\");\n\n ArrayList<String> group1 = new ArrayList<>();\n\n // add all student names in your group\n group1.addAll( Arrays.asList(\"Muhtar\", \"Nadir\", \"Asiya\", \"Saim\"));\n\n // verify your mentor and one of your closest friend' names are contained in the list\n group1.containsAll( Arrays.asList(\"Mike\"));\n\n\n\n }", "private static Predicate<Courses> numberOfStudentsPredecateMethod(int numberOfStudentsThreshhold) {\n\t\treturn course -> course.getNumberOfStudents() > numberOfStudentsThreshhold;\n\t}", "public boolean recordMember(int assignmentID, int groupID, String newMember) {\n \t\tboolean retVal = false;\n\t\tString queryString;\n\t\tPreparedStatement pStatement;\n\t\tResultSet rs;\n\n\t\ttry{\n\t\t\tqueryString = \"select * \" +\n\t\t\t\t\t\"from (select assignment.assignment_id, group_id \" +\n\t\t\t\t\t\t\"from markus.assignment full join markus.assignmentgroup \" +\n\t\t\t\t\t\t\"on assignment.assignment_id = assignmentgroup.assignment_id) as assigAndGroup\" +\n\t\t\t\t\t\" where assignment_id = \" + assignmentID + \" and group_id = \" + groupID + \";\";\n\t\t\tSystem.out.println(\"Query: \" + queryString);\n\t\t\tpStatement = connection.prepareStatement(queryString);\n\t\t\trs = pStatement.executeQuery();\n\n\t\t\t//check\n\t\t\t//there is no assignment with this assignmentID\n\t\t\t//the groupID has not been declared for the assignment\n\t\t\tif(rs.next()){\n\t\t\t\t//check\n\t\t\t\t//newMember is not a valid user\n\t\t\t\tqueryString = \"select * \" +\n\t\t\t\t\t\t\"from (select markususer.*, group_id from markus.markususer \" +\n\t\t\t\t\t\t\t\"left join markus.membership \" +\n\t\t\t\t\t\t\t\"on markus.markususer.username = markus.membership.username) as usermembership \" +\n\t\t\t\t\t\t\"where username = '\" +\n\t\t\t\t\t\tnewMember +\n\t\t\t\t\t\t\"' and type = 'student';\";\n\t\t\t\tSystem.out.println(\"Query: \" + queryString);\n\t\t\t\tpStatement = connection.prepareStatement(queryString);\n\t\t\t\trs = pStatement.executeQuery();\n\t\t\t\t\n\t\t\t\tif(rs.next()){\n\t\t\t\t\tdo{\n\t\t\t\t\t\tint g = rs.getInt(\"group_id\");\n\t\t\t\t\t\tif(g == groupID){\n\t\t\t\t\t\t\tSystem.out.println(\"student is already assigned to the group\");\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}while(rs.next());\n\t\t\t\t\t//the group is at capacity\n\t\t\t\t\tqueryString = \"select count \" +\n\t\t\t\t\t\t\t\"from (select count(*), group_id \" +\n\t\t\t\t\t\t\t\t\"from markus.membership group by group_id) as groupcount \" +\n\t\t\t\t\t\t\t\"where group_id = \" +\n\t\t\t\t\t\t\tgroupID +\n\t\t\t\t\t\t\t\" ;\";\n\t\t\t\t\tSystem.out.println(\"Query: \" + queryString);\n\t\t\t\t\tpStatement = connection.prepareStatement(queryString);\n\t\t\t\t\trs = pStatement.executeQuery();\n\t\t\t\t\trs.next();\n\t\t\t\t\tint numMember = rs.getInt(\"count\");\n\n\t\t\t\t\tqueryString = \"select group_max from markus.assignment \" +\n\t\t\t\t\t\t\t\"where assignment_id = \" +\n\t\t\t\t\t\t\tassignmentID +\n\t\t\t\t\t\t\t\";\";\n\t\t\t\t\tSystem.out.println(\"Query: \" + queryString);\n\t\t\t\t\tpStatement = connection.prepareStatement(queryString);\n\t\t\t\t\trs = pStatement.executeQuery();\n\t\t\t\t\trs.next();\n\t\t\t\t\tint max = rs.getInt(\"group_max\");\n\n\t\t\t\t\tif(max > numMember){\n\t\t\t\t\t\tqueryString = \"insert into markus.membership values ('\" +\n\t\t\t\t\t\t\t\tnewMember +\n\t\t\t\t\t\t\t\t\"',\" +\n\t\t\t\t\t\t\t\tgroupID +\n\t\t\t\t\t\t\t\t\");\";\n\t\t\t\t\t\tSystem.out.println(\"Query: \" + queryString);\n\t\t\t\t\t\tpStatement = connection.prepareStatement(queryString);\n\t\t\t\t\t\tpStatement.executeUpdate();\n\t\t\t\t\t\tretVal = true;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tSystem.out.println(\"Group at capacity\");\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.println(\"Invalid user\");\t\t\t\t\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tSystem.out.println(\"there is no assignment with this assignmentID or the groupID has not been declared for the assignment\");\t\n\t\t\t}\n\n\t\t}catch (Exception se){\n\t\t\tSystem.err.println(\"SQL Exception.\" +\n\t\t\t\t\t\"<Message>: \" + se.getMessage());\n\t\t}\n\n\n\n\t\t//if none of the above holds, record the member\n\n\t\t// Replace this return statement with an implementation of this method!\n return retVal;\n }", "private boolean determineValid(){\n for(Integer val : group){\n if(!racers.containsKey(val)){\n WrongNumber = val;\n return false;\n }\n }\n return true;\n }", "boolean validateUserGroups(SessionState state, String userId, Assignment asn)\n\t{\n\t\tSite site = getSite(asn);\n\n\t\t// finding any of the user's groups is sufficient, if they are in multiple groups the check\n\t\t// will fail no matter which of their groups is used\n\t\tOptional<Group> userGroup = getGroupsWithUser(userId, asn, site).stream().findAny();\n\t\tif (userGroup.isPresent())\n\t\t{\n\t\t\treturn checkSubmissionForUsersInMultipleGroups(asn, userGroup.get(), state, true).isEmpty();\n\t\t}\n\n\t\t// user is not in any assignment groups, if they are an instructor this is probably the Student View feature so let them through\n\t\treturn assignmentService.allowAddAssignment(site.getId()) || assignmentService.allowUpdateAssignmentInContext(site.getId());\n\t}", "synchronized public boolean updateWaitlist() {\n Student student = removeFromWaitlist();\n if(student != null) {\n if(student.getTotalCourses() < MAXCOURSESPERSTUDENT) {\n student.register(this);\n } \n } \n return false;\n }", "private boolean checkGreedyDefense() {\r\n return enTotal.get(2)+1 < myTotal.get(2) && enTotal.get(0)+1 < myTotal.get(0);\r\n }", "@Override\n\tpublic void addstudent(Group group) {\n\t\tString firstName = \"\";\n\t\tString lastName =\"\";\n\t\tString tempSex;\n\t\tboolean sex;\n\t\tint age, gpa;\n\t\t\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\tSystem.out.print(\"Введите имя:\");\n\t\t\t\tfirstName = reader.readLine();\n\t\t\t\tif (firstName != null && !firstName.equals(\"\"))\n\t\t\t\t\tbreak;\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.err.println(\"Неверно введено имя. Повторите попытку.\");\n\t\t\t}\n\t\t}\n\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\tSystem.out.print(\"Введите фамилию:\");\n\t\t\t\tlastName = reader.readLine();\n\t\t\t\tif (lastName != null && !lastName.equals(\"\"))\n\t\t\t\t\tbreak;\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.err.println(\"Неверно введена Фамилия. Повторите попытку.\");\n\t\t\t}\n\t\t}\n\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\tSystem.out.print(\"Введите пол (м/ж):\");\n\t\t\t\ttempSex = reader.readLine();\n\t\t\t\tif (tempSex != null && !tempSex.equals(\"\"))\n\t\t\t\t{\n\t\t\t\t\tif (tempSex.equalsIgnoreCase(\"м\"))\n\t\t\t\t\t{\n\t\t\t\t\t\tsex=true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (tempSex.equalsIgnoreCase(\"ж\"))\n\t\t\t\t\t{\n\t\t\t\t\t\tsex=false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tSystem.err.println(\"Неверно введен пол. Повторите попытку.\");\n\t\t\t\t\t\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.err.println(\"Неверно введен пол. Повторите попытку.\");\n\t\t\t}\n\t\t}\n\t\t\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\tSystem.out.print(\"Введите возраст:\");\n\t\t\t\t\n\t\t\t\tage= Integer.parseInt(reader.readLine());\n\t\t\t\t\tif (age<0) \t\t\t{\n\t\t\t\t\t\tSystem.err.println(\"Возраст должен быть положительным числом\");\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (age>120)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.err.println(\"Возраст должен быть меньше 120 лет\");\n\t\t\t\t\t\tcontinue;\n\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\t\t\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.err.println(\"Возраст должен быть числом. Попробуйте еще раз.\");\n\t\t\t}\n\t\t}\n\t\t\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\tSystem.out.print(\"Введите средний балл:\");\n\t\t\t\t\n\t\t\t\tgpa= Integer.parseInt(reader.readLine());\n\t\t\t\t\tif (gpa<0) \t\t\t{\n\t\t\t\t\t\tSystem.err.println(\"Средний балл должен быть положительным числом\");\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (gpa>5)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.err.println(\"Средний балл должен быть меньше 5\");\n\t\t\t\t\t\tcontinue;\n\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\t\t\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.err.println(\"Средний балл должен быть числом. Попробуйте еще раз.\");\n\t\t\t}\n\t\t}\n\t\t\n\t\ttry{\n\t\t\treader.close();\n\t\t\tgroup.addStudent(new Student(firstName, lastName, sex, age, gpa));\n\t\t}\n\t\tcatch (OutOfFreePlacesException | IOException e)\n\t\t\n\t\t{\n\t\t\tSystem.out.println(e);\n\t\t}\n\t\t\n\t\t\n\n\t\n\t\t\n\t}", "int checkState()\n\t{\n\t\tSystem.out.println(\"Student checkState: \");\n\t\tint[] groupsNum = new int[5];\n\t\tgroupsNum[0] = numGroupOneCourse;\n\t\tgroupsNum[1] = numGroupTwoCourse;\n\t\tgroupsNum[2] = numGroupThreeCourse;\n\t\tgroupsNum[3] = numGroupFourCourse;\n\t\tgroupsNum[4] = numGroupFiveCourse;\n\n\t\tfor(int i = 0; i <groupsNum.length; i++)\n\t\t{\n\t\t\tSystem.out.println(groupsNum[i]);\n\t\t}\n\n\n\t\tint maxAt = 0;\n\n\t\tfor (int i = 0; i < groupsNum.length; i++) \n\t\t{\n \t\tmaxAt = groupsNum[i] > groupsNum[maxAt] ? i : maxAt;\n\t\t}\n\n\t\tSystem.out.print(\" The state is \" + (maxAt+1));\n\n\t\treturn maxAt;\n\n\t}", "public void testVotersRequiredMembersOk() {\n Group citizens = RoleFactory.createGroup(\"citizen\");\n citizens.addRequiredMember(m_anyone);\n \n Group adults = RoleFactory.createGroup(\"adult\");\n adults.addRequiredMember(m_anyone);\n \n Group voters = RoleFactory.createGroup(\"voter\");\n voters.addRequiredMember(citizens);\n voters.addRequiredMember(adults);\n voters.addMember(m_anyone);\n \n \n // Elmer belongs to the citizens and adults...\n User elmer = RoleFactory.createUser(\"elmer\");\n citizens.addMember(elmer);\n adults.addMember(elmer);\n \n // Pepe belongs to the citizens, but is not an adult...\n User pepe = RoleFactory.createUser(\"pepe\");\n citizens.addMember(pepe);\n \n // Bugs is an adult, but is not a citizen...\n User bugs = RoleFactory.createUser(\"bugs\");\n adults.addMember(bugs);\n \n // Daffy is not an adult, neither a citizen...\n User daffy = RoleFactory.createUser(\"daffy\");\n\n assertTrue(m_roleChecker.isImpliedBy(voters, elmer));\n assertFalse(m_roleChecker.isImpliedBy(voters, pepe));\n assertFalse(m_roleChecker.isImpliedBy(voters, bugs));\n assertFalse(m_roleChecker.isImpliedBy(voters, daffy));\n }", "public boolean satisfactory(String name) {\n // checks if student exists - stores index in student list if exists\n int exists = this.studentExists(name);\n\n // student does not exist\n if (this.studentExists(name) == -1) {\n return false;\n } else if ((studentList.get(exists)).getBestScore() > 0) {\n // student has best score above zero\n return true;\n } else {\n // student has all zero scores\n return false;\n }\n }", "public static boolean checkGroupSize(int size){\n \n boolean r = true;\n \n if (size < 2 || size >= allEITs.length) \n r = false;\n \n return r;\n }", "@Test \n\tpublic void TestStudentGPA() throws PersonException{\n\t\tArrayList<Enrollment> EnrolledStudents = new ArrayList<Enrollment>();\n\t\tfor (int i = 0; i < Students.size(); i++){\n\t\t\tStudent student = Students.get(i);\n\t\t\tfor (int j = 0; j < Sections.size(); j++){\n\t\t\t\tSection section = Sections.get(j);\n\t\t\t\tEnrollment enrolled = new Enrollment(student.getStudentID(),section.getSectionID());\n\t\t\t\tenrolled.setGrade((i*10)); // Assumes each student gets a consistent grade in every section! (Otherwise average GPAs would be a bit tougher)\n\t\t\t\tEnrolledStudents.add(enrolled);\n\t\t\t}\n\t\t}\n\t\t\n\t\tArrayList<Double> StudentsGPA = new ArrayList<Double>();\n\t\tfor (int i = 0; i < EnrolledStudents.size(); i+=6) {\n\t\t\t\tif (EnrolledStudents.get(i).getGrade() >= 90)\n\t\t\t\t\tStudentsGPA.add(4.0);\n\t\t\t\telse if (EnrolledStudents.get(i).getGrade() >= 80)\n\t\t\t\t\tStudentsGPA.add(3.66);\n\t\t\t\telse if (EnrolledStudents.get(i).getGrade() >= 70)\n\t\t\t\t\tStudentsGPA.add(3.33);\n\t\t\t\telse if (EnrolledStudents.get(i).getGrade() >= 60)\n\t\t\t\t\tStudentsGPA.add(3.0);\n\t\t\t\telse if (EnrolledStudents.get(i).getGrade() >= 50)\n\t\t\t\t\tStudentsGPA.add(2.66);\n\t\t\t\telse if (EnrolledStudents.get(i).getGrade() >= 40)\n\t\t\t\t\tStudentsGPA.add(2.33);\n\t\t\t\telse if (EnrolledStudents.get(i).getGrade() >= 30)\n\t\t\t\t\tStudentsGPA.add(2.0);\n\t\t\t\telse if (EnrolledStudents.get(i).getGrade() >= 20)\n\t\t\t\t\tStudentsGPA.add(1.66);\n\t\t\t\telse if (EnrolledStudents.get(i).getGrade() >= 10)\n\t\t\t\t\tStudentsGPA.add(1.33);\n\t\t\t\telse \n\t\t\t\t\tStudentsGPA.add(1.0);\n\t\t}\n\t\tassertTrue(StudentsGPA.get(0) == 1.0);\n\t\tassertTrue(StudentsGPA.get(1) == 1.33);\n\t\tassertTrue(StudentsGPA.get(2) == 1.66);\n\t\tassertTrue(StudentsGPA.get(3) == 2.0);\n\t\tassertTrue(StudentsGPA.get(4) == 2.33);\n\t\tassertTrue(StudentsGPA.get(5) == 2.66);\n\t\tassertTrue(StudentsGPA.get(6) == 3.0);\n\t\tassertTrue(StudentsGPA.get(7) == 3.33);\n\t\tassertTrue(StudentsGPA.get(8) == 3.66);\n\t\tassertTrue(StudentsGPA.get(9) == 4.0);\n\t\t\n\t\tArrayList<Double> CoursesGPA = new ArrayList<Double>();\n\t\tdouble count = 0;\n\t\tfor (int i = 0; i < EnrolledStudents.size(); i+=6){\n\t\t\tcount += EnrolledStudents.get(i).getGrade();\n\t\t}\n\t\tif (count == 450){ // Again, assumes a simple case (average grade = 45 -> average GPA = 2.497)\n\t\t\tCoursesGPA.add(2.497);\n\t\t}\n\t\tassertTrue(CoursesGPA.get(0) == 2.497);\n\t\t\n\t}", "@Test\r\n\t public void hasSubmitted4() {\n\t \tthis.admin.createClass(\"ecs60\",2017,\"sean\",50);\r\n\t \tthis.student.registerForClass(\"gurender\", \"ecs60\", 2017);\r\n\t \tthis.student.dropClass(\"gurender\", \"ecs60\", 2017);\r\n\t this.instructor.addHomework(\"sean\", \"ecs60\", 2017, \"p1\");\r\n\t this.student.submitHomework(\"gurender\", \"p1\", \"abc\", \"ecs60\", 2017);\r\n\t assertFalse(this.student.hasSubmitted(\"gurender\", \"p1\", \"ecs60\", 2017));\r\n\t }", "@Test\n public void testAddEligibleStudents() {\n System.out.println(\"addEligibleStudents\");\n int[] IDs = new int[2];\n IDs[0] = 98;\n IDs[1] = 99;\n\n instance.addEligibleStudents(IDs);\n\n assertTrue(\"Students not added to eligibility lists\", instance.isStudentEligible(98)\n && instance.isStudentEligible(99));\n // TODO review the generated test code and remove the default call to fail.\n // fail(\"The test case is a prototype.\");\n }", "@Test\r\n\t public void hasSubmitted5() {\n\t \tthis.admin.createClass(\"ecs60\",2017,\"sean\",50);\r\n\t \tthis.admin.createClass(\"ecs154\",2017,\"sean\",50);\r\n\t \tthis.student.registerForClass(\"gurender\", \"ecs60\", 2017);\r\n\t \t//this.student.dropClass(\"gurender\", \"ecs60\", 2017);\r\n\t this.instructor.addHomework(\"sean\", \"ecs60\", 2017, \"p1\");\r\n\t this.instructor.addHomework(\"sean\", \"ecs154\", 2017, \"h1\");\r\n\t this.student.submitHomework(\"gurender\", \"p1\", \"abc\", \"ecs154\", 2017);\r\n\t assertFalse(this.student.hasSubmitted(\"gurender\", \"p1\", \"ecs154\", 2017));\r\n\t }", "public static void main(String[] args) {\n\t\tHuman humanOne = new Human(\"Konovalov\", \"Anton\", 1991, true);\r\n\r\n\t\tStudent studentOne = new Student(\"One\", \"Arst\", 1992, true, \"It\", 3);\r\n\t\tStudent studentTho = new Student(\"Tho\", \"Adsart\", 1993, true, \"It\", 3);\r\n\t\tStudent studentThree = new Student(\"Three\", \"Adrt\", 1994, true, \"It\", 3);\r\n\t\tStudent studentFour = new Student(\"Four\", \"Agfrt\", 1995, true, \"It\", 3);\r\n\t\tStudent studentFive = new Student(\"Five\", \"Asrt\", 1996, true, \"It\", 3);\r\n\t\tStudent studentSix = new Student(\"Six\", \"Arrt\", 1997, false, \"It\", 3);\r\n\t\tStudent studentSeven = new Student(\"Seven\", \"Aeqrt\", 1998, true, \"It\", 3);\r\n\t\tStudent studentEight = new Student(\"Eight\", \"Aeqwrt\", 1999, true, \"It\", 3);\r\n\t\tStudent studentNine = new Student(\"Nine\", \"Areqt\", 1992, false, \"It\", 3);\r\n\t\tStudent studentTen = new Student(\"Ten\", \"Aeqrt\", 1993, true, \"It\", 3);\r\n\t\tStudent studentEleven = new Student(\"Eleven\", \"Aehrt\", 1991, true, \"It\", 3);\r\n\r\n\t\tGroup group = new Group();\r\n\t\ttry {\r\n\t\t\tgroup.add(studentOne);\r\n\t\t\tgroup.add(studentTho);\r\n\t\t\tgroup.add(studentThree);\r\n\t\t\tgroup.add(studentFour);\r\n\t\t\tgroup.add(studentFive);\r\n\t\t\tgroup.add(studentSix);\r\n\t\t\tgroup.add(studentSeven);\r\n\t\t\tgroup.add(studentEight);\r\n\t\t\tgroup.add(studentNine);\r\n\t\t\t// group.add(studentTen);\r\n\t\t\t// group.add(studentEleven);\r\n\t\t\t//group.addNewStudent();\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(\"Error, more than 10 can not be created\");\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n//\t\tSystem.out.println(group);\r\n//\t\tgroup.sort();\r\n//\t\tSystem.out.println(group);\r\n//\t\t\r\n//\t\tStudent [] arrayStudentArmy= group.goToArmy(group);\r\n//\t\tfor (Student student : arrayStudentArmy) {\r\n//\t\t\tSystem.out.println(student);\r\n//\t\t}\r\n\t\t\r\n\t\tgroup.fileSave();\r\n\t\t\r\n\t\tGroup groupFromFile=new Group();\r\n\t\tgroupFromFile.newGroupStudent();\r\n\t\tSystem.out.println(groupFromFile);\r\n\t\r\n\r\n\t}", "public int gotExtraCredit() {\n int counter = 0;\n\n // goes through each student and checks if best score is 100\n // and student only has 1 submission\n for (int i = 0; i < studentList.size(); i++) {\n if ((studentList.get(i)).getBestScore() == 100 && (studentList.get(i)).getNumberSubmits() == 1) {\n counter++;\n }\n }\n // return accumulated amount of students\n return counter;\n }", "studentCounter( int numStudentAlreadyInTheRoom ){ \n\t\tnumStudentInRoom = numStudentAlreadyInTheRoom ;\n\t}", "synchronized public boolean addToEveningRoster(Student student){\n if(getWaitlist().contains(student)) {\n getWaitlist().remove(student);\n }\n if(getTotalEnrolledEvening() < MAXROSTER) {\n getEveningRoster().add(student);\n return true;\n }\n else if(getTotalEnrolledMorning() <MAXROSTER) {\n getMorningRoster().add(student);\n return true;\n }\n else {\n getWaitlist().add(student);\n }\n return false;\n }", "@Test\n void validateUserGroupCount() {\n LinkedHashMap<Integer, String> groups = new LinkedHashMap<>();\n\n UserManagerFactory uf = new UserManagerFactory();\n\n UserManager obj = uf.getInstance(\"group1\");\n\n groups = obj.getGroups();\n\n Assertions.assertTrue(groups.size() == 5, \"There should only have 5 pre-defined groups\");\n }", "int getStudentCount();", "boolean hasOccupation();", "boolean hasOccupation();", "boolean hasOccupation();", "boolean hasOccupation();", "boolean hasOccupation();", "private int isPrivacyModelFulfilled(Transformation<?> transformation, HashGroupifyEntry entry) {\n \n // Check minimal group size\n if (minimalClassSize != Integer.MAX_VALUE && entry.count < minimalClassSize) {\n return 0;\n }\n \n // Check other criteria\n // Note: The d-presence criterion must be checked first to ensure correct handling of d-presence with tuple suppression.\n // This is currently ensured by convention. See ARXConfiguration.getCriteriaAsArray();\n for (int i = 0; i < classBasedCriteria.length; i++) {\n if (!classBasedCriteria[i].isAnonymous(transformation, entry)) {\n return i + 1;\n }\n }\n return -1;\n }", "public boolean registerCourse(Integer indexGroupID, Scanner sc) {\r\n\t\tboolean success = false;\r\n\t\tboolean validInput = false;\r\n\t\tint confirmation = 0;\r\n\t\tStudent s1 = new Student();\r\n\t\ts1 = s1.retrieveStudentObject(this.getStudentID());\r\n\t\tCourse c1 = new Course();\r\n\t\tc1 = c1.retrieveCourseObjectByIndexGroup(indexGroupID);\r\n\t\tCourse c2 = new Course();\r\n\t\tIndexGroup g1 = new IndexGroup();\r\n\t\tg1 = g1.retrieveIndexGroupObject(indexGroupID);\r\n\t\tWaitlist wl1 = new Waitlist();\r\n\t\twl1 = wl1.retrieveWaitListObjectByIndexGroup(indexGroupID);\r\n\t\tWaitlist wl2 = new Waitlist();\r\n\r\n\t\ttry {\r\n\t\t\tif (s1 == null) {\r\n\t\t\t\tSystem.out.println(\"No user has been logged in.\\n\");\r\n\t\t\t} else {\r\n\t\t\t\tif (c1 != null) {\r\n\t\t\t\t\tint temp = s1.getCourseList().size();\r\n\t\t\t\t\tint temp2 = s1.getWaitListIDList().size();\r\n\r\n\t\t\t\t\tif (temp == 0) {\r\n\t\t\t\t\t\tif (schedule.checkScheduleClash(indexGroupID)) {\r\n\t\t\t\t\t\t\tSystem.out.println(\"Period of lesson clash with current schedule\\n\");\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tif (!(g1.checkVacancies())) {\r\n\t\t\t\t\t\t\t\tint flag = 0;\r\n\t\t\t\t\t\t\t\tfor (int i = 0; i < temp2; i++) {\r\n\t\t\t\t\t\t\t\t\tc2 = c2.retrieveCourseObjectByWaitList(s1.getWaitListIDList().get(i));\r\n\t\t\t\t\t\t\t\t\tif (s1.getWaitListIDList().get(i).equals(wl1.getWaitListID())) {\r\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"You are already in waitlist\\n\");\r\n\t\t\t\t\t\t\t\t\t\tflag = 1;\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t} else if (c2.getCourseID().equals(c1.getCourseID())) {\r\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\"You already in waitlist of another index group of the same course\\n\");\r\n\t\t\t\t\t\t\t\t\t\tflag = 1;\r\n\t\t\t\t\t\t\t\t\t\tbreak;\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 (flag == 0) {\r\n\t\t\t\t\t\t\t\t\tg1.printGroupDetailsConfirmation();\r\n\t\t\t\t\t\t\t\t\tSystem.out.print(\r\n\t\t\t\t\t\t\t\t\t\t\t\"Confirm to join the waitlist of this group? 1 = Yes, Any other number = No: \");\r\n\t\t\t\t\t\t\t\t\tdo {\r\n\t\t\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\t\t\tconfirmation = sc.nextInt();\r\n\t\t\t\t\t\t\t\t\t\t\tif (confirmation >= 0) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tvalidInput = true;\r\n\t\t\t\t\t\t\t\t\t\t\t\tsc.nextLine();\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t} catch (InputMismatchException e) {\r\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Enter a valid integer!\");\r\n\t\t\t\t\t\t\t\t\t\t\tsc.nextLine();\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t} while (!validInput);\r\n\t\t\t\t\t\t\t\t\tvalidInput = false;\r\n\r\n\t\t\t\t\t\t\t\t\tif (confirmation == 1) {\r\n\t\t\t\t\t\t\t\t\t\twl1.enqueueToWaitList(s1.getStudentID());\r\n\t\t\t\t\t\t\t\t\t\ts1.getWaitListIDList().add(wl1.getWaitListID());\r\n\t\t\t\t\t\t\t\t\t\tg1.printGroupDetailsConfirmation();\r\n\t\t\t\t\t\t\t\t\t\twl1.updateWaitListObject(wl1);\r\n\t\t\t\t\t\t\t\t\t\ts1.updateStudentObject(s1);\r\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"You have been added to the waitlist\\n\");\r\n\t\t\t\t\t\t\t\t\t\tsuccess = true;\r\n\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"You are not added to the waitlist\\n\");\r\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Returning to main menu...\\n\");\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} else {\r\n\t\t\t\t\t\t\t\tSystem.out.println(\"Course: \" + c1.getCourseID());\r\n\t\t\t\t\t\t\t\tg1.printGroupDetailsConfirmation();\r\n\t\t\t\t\t\t\t\tSystem.out.print(\r\n\t\t\t\t\t\t\t\t\t\t\"Confirm to register course under this index group? 1 = Yes, Any other number = No: \");\r\n\t\t\t\t\t\t\t\tdo {\r\n\t\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\t\tconfirmation = sc.nextInt();\r\n\t\t\t\t\t\t\t\t\t\tif (confirmation >= 0) {\r\n\t\t\t\t\t\t\t\t\t\t\tvalidInput = true;\r\n\t\t\t\t\t\t\t\t\t\t\tsc.nextLine();\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t} catch (InputMismatchException e) {\r\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Enter a valid integer!\");\r\n\t\t\t\t\t\t\t\t\t\tsc.nextLine();\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t} while (!validInput);\r\n\t\t\t\t\t\t\t\tvalidInput = false;\r\n\r\n\t\t\t\t\t\t\t\tif (confirmation == 1) {\r\n\t\t\t\t\t\t\t\t\tfor (int i = 0; i < temp2; i++) {\r\n\t\t\t\t\t\t\t\t\t\tc2 = c2.retrieveCourseObjectByWaitList(s1.getWaitListIDList().get(i));\r\n\t\t\t\t\t\t\t\t\t\tif (c2.getCourseID().equals(c1.getCourseID())) {\r\n\t\t\t\t\t\t\t\t\t\t\twl2 = wl2.retrieveWaitListObject(s1.getWaitListIDList().get(i));\r\n\t\t\t\t\t\t\t\t\t\t\twl2.dequeueFromWaitList(s1.getStudentID());\r\n\t\t\t\t\t\t\t\t\t\t\ts1.getWaitListIDList().remove(i);\r\n\t\t\t\t\t\t\t\t\t\t\twl2.updateWaitListObject(wl2);\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\ts1.getCourseList().add(c1.getCourseID());\r\n\t\t\t\t\t\t\t\t\ts1.getIndexGroupList().add(indexGroupID);\r\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"Course: \" + c1.getCourseID());\r\n\t\t\t\t\t\t\t\t\tg1.printGroupDetailsConfirmation();\r\n\t\t\t\t\t\t\t\t\tg1.updateVacancies('-');\r\n\t\t\t\t\t\t\t\t\t// Add schedule\r\n\t\t\t\t\t\t\t\t\ts1.getSchedule().AddSchedule(indexGroupID);\r\n\t\t\t\t\t\t\t\t\tg1.updateIndexGroupObject(g1);\r\n\t\t\t\t\t\t\t\t\ts1.updateStudentObject(s1);\r\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"Course successfully registered!\");\r\n\t\t\t\t\t\t\t\t\tsuccess = true;\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"Course has not been registered.\");\r\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"Returning to main menu...\");\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tfor (int j = 0; j < temp; j++) {\r\n\t\t\t\t\t\t\tif (s1.getCourseList().get(j).equals(c1.getCourseID())) {\r\n\t\t\t\t\t\t\t\tSystem.out\r\n\t\t\t\t\t\t\t\t\t\t.println(\"You are already registered in this course in another index group\\n\");\r\n\t\t\t\t\t\t\t} else if (j == (temp - 1)) {\r\n\t\t\t\t\t\t\t\tif (schedule.checkScheduleClash(indexGroupID)) {\r\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"Period of lesson clash with current schedule\\n\");\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tif (!(g1.checkVacancies())) {\r\n\t\t\t\t\t\t\t\t\t\tint flag = 0;\r\n\t\t\t\t\t\t\t\t\t\tfor (int i = 0; i < temp2; i++) {\r\n\t\t\t\t\t\t\t\t\t\t\tc2 = c2.retrieveCourseObjectByWaitList(s1.getWaitListIDList().get(i));\r\n\t\t\t\t\t\t\t\t\t\t\tif (s1.getWaitListIDList().get(i).equals(wl1.getWaitListID())) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"You are already in waitlist\\n\");\r\n\t\t\t\t\t\t\t\t\t\t\t\tflag = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\t} else if (c2.getCourseID().equals(c1.getCourseID())) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"You are already in waitlist of another index group of the same course\\n\");\r\n\t\t\t\t\t\t\t\t\t\t\t\tflag = 1;\r\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tif (flag == 0) {\r\n\t\t\t\t\t\t\t\t\t\t\tg1.printGroupDetailsConfirmation();\r\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.print(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"Confirm to join the waitlist of this group? 1 = Yes, Any other number = No: \");\r\n\t\t\t\t\t\t\t\t\t\t\tdo {\r\n\t\t\t\t\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tconfirmation = sc.nextInt();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (confirmation >= 0) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalidInput = true;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsc.nextLine();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t} catch (InputMismatchException e) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Enter a valid integer!\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsc.nextLine();\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t} while (!validInput);\r\n\t\t\t\t\t\t\t\t\t\t\tvalidInput = false;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tif (confirmation == 1) {\r\n\t\t\t\t\t\t\t\t\t\t\t\twl1.enqueueToWaitList(s1.getStudentID());\r\n\t\t\t\t\t\t\t\t\t\t\t\ts1.getWaitListIDList().add(wl1.getWaitListID());\r\n\t\t\t\t\t\t\t\t\t\t\t\tg1.printGroupDetailsConfirmation();\r\n\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"You have been added to waitlist\\n\");\r\n\t\t\t\t\t\t\t\t\t\t\t\twl1.updateWaitListObject(wl1);\r\n\t\t\t\t\t\t\t\t\t\t\t\ts1.updateStudentObject(s1);\r\n\t\t\t\t\t\t\t\t\t\t\t\tsuccess = true;\r\n\t\t\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"You have not been added to waitlist\\n\");\r\n\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Returning to main menu...\\n\");\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Course: \" + c1.getCourseID());\r\n\t\t\t\t\t\t\t\t\t\tg1.printGroupDetailsConfirmation();\r\n\t\t\t\t\t\t\t\t\t\tSystem.out.print(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\"Confirm to register course under this index group? 1 = Yes, Any other number = No: \");\r\n\t\t\t\t\t\t\t\t\t\tdo {\r\n\t\t\t\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\t\t\t\tconfirmation = sc.nextInt();\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (confirmation >= 0) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalidInput = true;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsc.nextLine();\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t} catch (InputMismatchException e) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Enter a valid integer!\");\r\n\t\t\t\t\t\t\t\t\t\t\t\tsc.nextLine();\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t} while (!validInput);\r\n\t\t\t\t\t\t\t\t\t\tvalidInput = false;\r\n\r\n\t\t\t\t\t\t\t\t\t\tif (confirmation == 1) {\r\n\t\t\t\t\t\t\t\t\t\t\tfor (int i = 0; i < temp2; i++) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tc2 = c2.retrieveCourseObjectByWaitList(s1.getWaitListIDList().get(i));\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (c2.getCourseID().equals(c1.getCourseID())) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\twl2 = wl2.retrieveWaitListObject(s1.getWaitListIDList().get(i));\r\n\t\t\t\t\t\t\t\t\t\t\t\t\twl2.dequeueFromWaitList(s1.getStudentID());\r\n\t\t\t\t\t\t\t\t\t\t\t\t\ts1.getWaitListIDList().remove(i);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\twl2.updateWaitListObject(wl2);\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\ts1.getCourseList().add(c1.getCourseID());\r\n\t\t\t\t\t\t\t\t\t\t\ts1.getIndexGroupList().add(indexGroupID);\r\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Course: \" + c1.getCourseID());\r\n\t\t\t\t\t\t\t\t\t\t\tg1.printGroupDetailsConfirmation();\r\n\t\t\t\t\t\t\t\t\t\t\tg1.updateVacancies('-');\r\n\t\t\t\t\t\t\t\t\t\t\ts1.getSchedule().AddSchedule(indexGroupID);\r\n\t\t\t\t\t\t\t\t\t\t\tg1.updateIndexGroupObject(g1);\r\n\t\t\t\t\t\t\t\t\t\t\ts1.updateStudentObject(s1);\r\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Course successfully registered!\");\r\n\t\t\t\t\t\t\t\t\t\t\tsuccess = true;\r\n\t\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Course has not been registered.\");\r\n\t\t\t\t\t\t\t\t\t\t\tSystem.out.println(\"Returning to main menu...\");\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn success;\r\n\t}", "@Test\r\n\t public void hasSubmitted6() {\n\t \tthis.admin.createClass(\"ecs60\",2019,\"sean\",50);\r\n\t \tthis.student.registerForClass(\"gurender\", \"ecs60\", 2019);\r\n\t this.instructor.addHomework(\"sean\", \"ecs60\", 2019, \"p1\");\r\n\t this.student.submitHomework(\"gurender\", \"p1\", \"abc\", \"ecs60\", 2019);\r\n\t assertFalse(this.student.hasSubmitted(\"gurender\", \"p1\", \"ecs60\", 2019));\r\n\t }", "public int findTotalStudents() {\n\t\treturn students.size();\r\n\t}", "public boolean isValid(int[] grades) throws ArithmeticException {\n if ((grades == null) || (grades.length == 0)) {\n throw new ArithmeticException(\"There is no grade available.\");\n }\n \n final int NUMBER_OF_STUDENTS = grades.length;\n \n for (int studentId = 0; studentId < NUMBER_OF_STUDENTS; studentId++) {\n \n if ((grades[studentId] < 0) || (grades[studentId] > 100)) {\n return false;\n }\n }\n \n return true;\n }", "@Override\n public boolean isStudent() {\n return false;\n }", "@Override\n\tprotected boolean checkFeasible(int r, int c, int v, int k, int dept) {\n\t\tboolean ok = super.checkFeasible(r, c, v, k, dept);\n\t\tif(!ok) return false;\n\t\t\n\t\tJuryInfo J = jury.get(r);\n\t\t\n\t\tfor(int rid = 1; rid <= rooms.size(); rid++) if(rid != v){\n\t\t\tint[] p = J.getJuryMemberIDs();\n\t\t\tfor(int j = 0; j < p.length; j++){\n\t\t\t\t\n\t\t\t\tif(p[j] > 0){\n\t\t\t\t\t//System.out.println(\"PartitionJuriesToRoomsTeacherNotMove::checkFeasible(\" + r + \",\" + c + \n\t\t\t\t\t\t\t\t//\",\" + v + \", occTeacherRoom[\" + rid + \"].get(\" + p[j] + \") = \" + occTeacherRoom[rid].get(p[j]));\n\t\t\t\t\tif(occTeacherRoom[rid].get(p[j]) > 0) return false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t// check if the number of hust, nonHust assigned to room v exceed the upperbound\n\t\tint var_idx = 7*r+c;\n\t\tint nbHust = 0;\n\t\tint nbNonHust = 0;\n\t\tfor(int p = 0; p < 5; p++){\n\t\t\tif(x[r*7+p] > 0){\n\t\t\t\tint tid = x[r*7+p];\n\t\t\t\tif(p == 0 || p == 4){\n\t\t\t\t\tif(!nonHustOfRoom[v].contains(tid)) nbNonHust++;\n\t\t\t\t}else{\n\t\t\t\t\tif(!hustOfRoom[v].contains(tid)) nbHust++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(hustOfRoom[v].size() + nbHust > maxHustOfRoom.get(v)) ok = false;\n\t\t//if(!ok && k >= dept) System.out.println(\"TRY(\" + k + \"), var_idx = \" + var_idx + \", r = \" + r + \", c = \" + c + \", v = \" + v + \n\t\t\t\t//\", FALSE hustOfRoom[\" + v + \"].sz = \" + hustOfRoom[v].size() + \", nbHust = \" + nbHust);\n\t\tif(nonHustOfRoom[v].size() + nbNonHust > maxNonHustOfRoom.get(v)) ok = false;\n\t\t//if(!ok && k >= dept) System.out.println(\"TRY(\" + k + \"), var_idx = \" + var_idx + \", r = \" + r + \", c = \" + c + \", v = \" + v + \n\t\t\t\t//\", FALSE nonHustOfRoom[\" + v + \"].sz = \" + nonHustOfRoom[v].size() + \", nbNonHust = \" + nbNonHust);\n\t\t\n\t\treturn ok;\n\t}", "public void testGroupDoesNotImplySameRequiredGroup() {\n User user = RoleFactory.createUser(\"foo\");\n \n Group group = RoleFactory.createGroup(\"bar\");\n group.addRequiredMember(group);\n group.addMember(user);\n \n assertFalse(m_roleChecker.isImpliedBy(group, group));\n }", "@Override\n public int getGroupCount() {\n return Grade.length;\n }", "private boolean askForSuperviser(Person p) throws Exception {\n\n\t\treturn p.isResearcher() && (p.getInstitutionalRoleId() > 1);\n\t}", "public boolean add(Student aStudent)\r\n\t{\n\t\tboolean check = false;\r\n\t\t\r\n\t\t//\tIf array is full, stop inserting more Student objects in array\r\n\t\tif (pointer >= size)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"\\nSorry: classroom is full.\");\r\n\t\t\t\r\n\t\t\treturn check;\r\n\t\t}\r\n\t\t\r\n\t\t//\tIf student's has gpa is not between 0 and 4, or name is not given, do not insert Student object in array\r\n\t\telse if (aStudent.getName().trim().isEmpty() || aStudent.getGPA() < 0 || aStudent.getGPA() > 4)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"\\nSorry: Name has no characters or gpa is not between 0 & 4.\");\r\n\t\t\tpointer++;\r\n\t\t\t\r\n\t\t\treturn check;\r\n\t\t}\r\n\r\n\t\t//\tIf student gpa is between 0 and 4, and there is place in array, insert new Student object\r\n\t\telse\r\n\t\t{\r\n\t\t\tstudents[pointer] = aStudent;\r\n\t\t\tpointer++;\r\n\t\t\tcheck = true;\r\n\t\t\t\r\n\t\t\treturn check;\t\t\r\n\t\t}\r\n\t}", "public boolean addNew(Student st){\n for(Student stItem : listStudents){\r\n // check for duplicate id\r\n if(stItem.getId() == st.getId()) return false;\r\n \r\n// if(checkRule(stItem, st)) break;\r\n// else return false;\r\n \r\n }\r\n this.listStudents.add(st);\r\n return true;\r\n }", "boolean enrolStudent(Student student){\n\t\tif(daysUntilStarts.equals(0) || enrolled.size() == 3 || student.getCertificates().contains(subject.getID())){\n\t\t\treturn false;\n\t\t}\n\t\tenrolled.add(student);\n\t\tstudent.enrol();\n\t\treturn true;\n\t}", "@Test\r\n\t public void hasSubmitted2() {\n\t \tthis.admin.createClass(\"ecs60\",2017,\"sean\",50);\r\n\t \tthis.student.registerForClass(\"gurender\", \"ecs60\", 2017);\r\n\t this.instructor.addHomework(\"sean\", \"ecs60\", 2017, \"p1\");\r\n\t this.student.submitHomework(\"gurender\", \"p1\", \"abc\", \"ecs61\", 2017); \r\n\t assertFalse(this.student.hasSubmitted(\"gurender\", \"p1\", \"ecs61\", 2017));\r\n\t }", "public static boolean numberOfStudents(List<Course> courseList){\n return courseList.stream().anyMatch(t->t.getNumberOfStudents()==154);\n }", "private boolean checkSectionAvailability(int id, int section) throws SQLException {\r\n String query = \"SELECT * FROM sections WHERE courseid=? AND secnum=?\";\r\n PreparedStatement pstmt = conn.prepareStatement(query);\r\n pstmt.setInt(1, id);\r\n pstmt.setInt(2, section);\r\n ResultSet rs = pstmt.executeQuery();\r\n rs.next();\r\n if (rs.getInt(\"numofstudents\") < rs.getInt(\"seccap\")) {\r\n rs.close();\r\n return true;\r\n } else {\r\n rs.close();\r\n return false;\r\n }\r\n }", "public static boolean canBuyGroupClaimer(Player player) {\n ClaimProfile profile = ProfileManager.getInstance().getProfile(player);\n\n int normalChunks = 0;\n int groupChunks = 0;\n\n for (ChunkData claimedChunk : profile.getClaimedChunks()) {\n if (claimedChunk.isGroupChunk()) {\n groupChunks++;\n } else {\n normalChunks++;\n }\n }\n\n return 2 * normalChunks > groupChunks;\n }", "private boolean checkInput(Student student) {\n return student.getName().equals(nameField.getText()) &&\n student.getMajor().equals(majorField.getText());\n }", "private boolean isApproved() {\r\n if (rnd.nextInt(10) < 5) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n\r\n }", "public static void partitionStudentsByGpaPredicate() {\n\t\tMap<Boolean, Set<Student>> mapOfStudents = StudentDb.getAllStudents().stream()\n\t\t\t\t.collect(partitioningBy(gpaPredicate, toSet()));\n\t\t\n\t\tSystem.out.println(\"Does the Student have First Class Degree? \" + mapOfStudents);\n\t}", "@Override\n\tboolean isValid(){\n\t\tif(size()==5) {\n\t\t\tint suite = getCard(0).suit;\n\t\t\tfor(int i = 1 ; i< size(); i++) {\n\t\t\t\tif(getCard(i).suit != suite) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tsort();\n\t\t\tint currRank = (getCard(0).rank +11)%13;\n\t\t\tfor(int i=0; i<size(); i++) {\n\t\t\t\tif((getCard(i).rank+11)%13 != currRank) return false;\n\t\t\t\tcurrRank++;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "private boolean wellFormed() {\n\n\n\t\t\tGroup e = this;\n\n\t\t\tint i = 0;\n\t\t\tif(e.first == null && e.last == null && e.size == 0) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\n\t\t\tCard p = e.first;\n\t\t\tboolean check = false;\n\t\t\tif(e.first != null && e.last != null) {\n\t\t\t\tCard n = null;\n\t\t\t\tif(e.first.prev != null) return report(\"There is a loop\");\n\n\t\t\t\tfor(p = e.first; p.next != null; p = p.next) {\n\n\t\t\t\t\tn = p.next;\n\n\t\t\t\t\tif(n.prev != p) return report(\"p.next is null\");\n\t\t\t\t\tif(this != p.group) {\n\t\t\t\t\t\treturn report(\"this is not set to the group\");\n\t\t\t\t\t}\n\n\n\t\t\t\t}\n\n\t\t\t\tif(e.last.next != null) {\n\t\t\t\t\treturn report(\"Size is not equal to the amount of cards\");\n\t\t\t\t}\n\n\t\t\t\tfor(Card c = e.first; c.next != null; c = c.next) {\n\t\t\t\t\t++i;\n\t\t\t\t}\n\t\t\t\tif(i != this.size-1) {\n\t\t\t\t\treturn report(\"Size is not equal to the amount of cards\");\n\t\t\t\t}\n\t\t\t\tcheck = true;\n\t\t\t}\n\t\t\tif(check != true) {\n\t\t\t\tif(i != this.size) {\n\t\t\t\t\treturn report(\"Size is not equal to the amount of cards\");\n\t\t\t\t}\n\t\t\t\tif(e.first == null || e.last == null) {\n\t\t\t\t\treturn report(\"Error\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn true;\n\t\t}", "synchronized public boolean addToMorningRoster(Student student){\n if(getWaitlist().contains(student)) {\n getWaitlist().remove(student);\n }\n if(getTotalEnrolledMorning() < MAXROSTER) {\n getMorningRoster().add(student);\n return true;\n }\n else if(getTotalEnrolledEvening() < MAXROSTER) {\n getEveningRoster().add(student);\n \n return true;\n }\n else {\n getWaitlist().add(student);\n }\n return false;\n }", "@Test\r\n\t public void hasSubmitted7() {\n\t \tthis.admin.createClass(\"ecs60\",2015,\"sean\",50);\r\n\t \tthis.student.registerForClass(\"gurender\", \"ecs60\", 2015);\r\n\t this.instructor.addHomework(\"sean\", \"ecs60\", 2015, \"p1\");\r\n\t this.student.submitHomework(\"gurender\", \"p1\", \"abc\", \"ecs60\", 2015);\r\n\t assertFalse(this.student.hasSubmitted(\"gurender\", \"p1\", \"ecs60\", 2015));\r\n\t }", "@Test\r\n\t public void hasSubmitted1() {\n\t \tthis.admin.createClass(\"ecs60\",2017,\"sean\",50);\r\n\t \tthis.student.registerForClass(\"gurender\", \"ecs60\", 2017);\r\n\t // this.instructor.addHomework(\"sean\", \"ecs60\", 2017, \"p1\");\r\n\t this.student.submitHomework(\"gurender\", \"p1\", \"abc\", \"ecs60\", 2017);\r\n\t // assertFalse(this.student.isRegisteredFor(\"gurender\", \"ecs60\", 2018));\r\n\t\t assertFalse(this.student.hasSubmitted(\"gurender\", \"p1\", \"ecs60\", 2017));\r\n\t }", "int fetchLevelOfStudent(Student student , Subject subject);", "@Test\r\n\t public void hasSubmitted8() {\n\t \tthis.admin.createClass(\"ecs60\",2017,\"sean\",50);\r\n\t //\tthis.student.registerForClass(\"gurender\", \"ecs60\", 2017);\r\n\t this.instructor.addHomework(\"sean\", \"ecs60\", 2017, \"p1\");\r\n\t this.student.submitHomework(\"gurender\", \"p1\", \"abc\", \"ecs60\", 2017);\r\n\t\t assertFalse(this.student.hasSubmitted(\"gurender\", \"p1\", \"ecs60\", 2017));\r\n\t }", "public void setInValidGroup(boolean inValidGroup){this.inValidGroup = inValidGroup;}", "@Override public boolean isValidated()\n{\n if (location_set.size() == 0 || !have_join) return false;\n\n return true;\n}", "boolean containsStudentWith(String name);", "public boolean getInValidGroup(){return this.inValidGroup;}", "private boolean isDisqualified(Application a) {\n\t if( Float.parseFloat(a.getStudent().getGpa()) < 3.0f) {\n\t a.setScore(Application.SCORE_DISQUALIFIED);\n\t a.setDisqualReason(\"Reported GPA too low\");\n\t return true;\n\t }\n /*\n //Eliminate students who are unable to serve all year\n\t //EDIT getServeAllYear() when appropriate field is added to application\n\t if(a.getApprenticeshipInfo().getServeAllYear().equals(\"No\")){\n a.setScore(Application.SCORE_DISQUALIFIED);\n a.setDisqualReason(\"Students must be able to serve in DLA all year\");\n return true\t\t\n }\n\t \n\t //Eliminate students who do not meet project requirements\n\t //EDIT getMeetRequirements() when field is added to application\n\t if(a.getApprenticeshipInfo().getMeetRequirements().equals(\"No\")){\n a.setScore(Application.SCORE_DISQUALIFIED);\n\t\ta.setDisqualReason(\"Students must meet project requirements\");\n\t\treturn true;\n\t }\n\t \n\t //Eliminate students in DLA in the past year\n\t //EDIT getGraduateStudent() when field is added to student application\n\t if(a.getApprenticeshipInfo().getGraduateStudent().equals(\"Yes\")){\n a.setScore(Application.SCORE_DISQUALIFIED);\n\t\ta.setDisqualReason(\"Graduate students are ineligible\");\n\t\treturn true;\n\t }\n\t \n\t //PLACEHOLDER\n\t //Eliminate MS/BS students in MS year\n\t //MS/BS students would be eliminated as graduate students above\n\t //However, if separation is required, it can be done here\n\t \n\t //PLACEHOLDER\n\t //Eliminate students not in College of Engineering\n\t //Currently, these students shouldn't be able to apply as their\n\t //majors would not show up under the student application\n\t //majors list\n\t //If this functionality is changed in the future, the following\n\t //can be used to eliminate them, modify getEngineering() when added\n\t //if(a.getStudent.getEngineering.equals(\"No\")){\n // a.setScore(Application.SCORE_DISQUALIFIED);\n\t // a.setDisqualReason(\"Students not in College of Engineering and Applied Science are ineligible\");\n\t //return true;\n\t //}\n\t \n\t //Eliminate graduate students\n\t if(a.getApprenticeshipInfo().getServed().equals(\"Yes\")){\n a.setScore(Application.SCORE_DISQUALIFIED);\n\t\ta.setDisqualReason(\"Students who served in the DLA in the past year are ineligible\");\n\t\treturn true;\n\t }\n\t \n\t */\n\t return false;\n\t}", "private boolean checkGreedyEnergy() {\r\n return myTotal.get(2) < 10 || (myTotal.get(2) < 13 && myTotal.get(2) <= enTotal.get(2));\r\n }", "@Test\n\tvoid testCalculateMarkInSemesterFail2() {\n\t\tString semesterName = null;\n\t\t\n\t\tList<StudentResult> studentResults = new ArrayList<>();\n\t\n\t\t// result after calculated marks\n\t\tList<Object> listResults = MarkUtility.calculateMarkInSemester(semesterName, studentResults);\n\t\t\n\t\t// semesterFullName, numbersOfSubjects, gpaInSemester, passedCredits\n\t\tString semesterFN = (String) listResults.get(0);\n\t\tint numberOfSubjects = ((Map<Subject, StudentResult>) listResults.get(1)).size();\n\t\tfloat gpaInSemester = (float) listResults.get(2);\n\t\tint passedCredits = (int) listResults.get(3);\t\t\n\t\t\n\t\tassertTrue(\n\t\t\t\tsemesterFN.equals(\"\") &&\n\t\t\t\tnumberOfSubjects == 0 &&\n\t\t\t\tgpaInSemester == 0 &&\n\t\t\t\tpassedCredits == 0\n\t\t\t\t);\t\t\t\t\n\t}", "private String getSeatsAvailable(){\n int Available= CourseCapacity - RegisteredStudents.size();\n return Available+\"/\"+ CourseCapacity;\n }", "public boolean inGroup(Person p){\n\t return false;\n }", "protected abstract boolean gradeable();", "@Test\n void validateUserGroupExist(){\n\n Boolean testing_result = true;\n int issue_id = 0;\n String issue_group = \"\";\n\n ArrayList<String> groups = new ArrayList<>();\n groups.add(\"admin\");\n groups.add(\"concordia\");\n groups.add(\"encs\");\n groups.add(\"comp\");\n groups.add(\"soen\");\n\n UserController uc = new UserController();\n\n LinkedHashMap<Integer, String> db_groups = uc.getAllUserGroups();\n\n for(int key : db_groups.keySet()){\n if(!groups.contains(db_groups.get(key))){\n issue_id = key;\n issue_group = db_groups.get(key);\n testing_result = false;\n }\n }\n\n Assertions.assertTrue(testing_result, \" There is an issue with user(id: \" + issue_id + \") having group as: \" + issue_group);\n\n }", "@Override\n public boolean test(User user) {\n return user.getPoints() > 160;\n }", "public List<User> getStudentsNotRegistered(Group currentGroup);", "@Test\n\tvoid testCalculateMarkInSemesterFail1() {\n\t\tString semesterName = \"\";\n\t\t\n\t\tList<StudentResult> studentResults = new ArrayList<>();\n\t\n\t\t// result after calculated marks\n\t\tList<Object> listResults = MarkUtility.calculateMarkInSemester(semesterName, studentResults);\n\t\t\n\t\t// semesterFullName, numbersOfSubjects, gpaInSemester, passedCredits\n\t\tString semesterFN = (String) listResults.get(0);\n\t\tint numberOfSubjects = ((Map<Subject, StudentResult>) listResults.get(1)).size();\n\t\tfloat gpaInSemester = (float) listResults.get(2);\n\t\tint passedCredits = (int) listResults.get(3);\t\t\n\t\t\n\t\tassertTrue(\n\t\t\t\tsemesterFN.equals(\"\") &&\n\t\t\t\tnumberOfSubjects == 0 &&\n\t\t\t\tgpaInSemester == 0 &&\n\t\t\t\tpassedCredits == 0\n\t\t\t\t);\t\t\t\t\n\t}", "public void testRequiredRolesMultipleRequiredGroupsOk() {\n User elmer = RoleFactory.createUser(\"elmer\");\n User pepe = RoleFactory.createUser(\"pepe\");\n User bugs = RoleFactory.createUser(\"bugs\");\n User daffy = RoleFactory.createUser(\"daffy\");\n \n Group administrators = RoleFactory.createGroup(\"administrators\");\n administrators.addRequiredMember(m_anyone);\n administrators.addMember(elmer);\n administrators.addMember(pepe);\n administrators.addMember(bugs);\n\n Group family = RoleFactory.createGroup(\"family\");\n family.addRequiredMember(m_anyone);\n family.addMember(elmer);\n family.addMember(pepe);\n family.addMember(daffy);\n\n Group alarmSystemActivation = RoleFactory.createGroup(\"alarmSystemActivation\");\n alarmSystemActivation.addMember(m_anyone);\n alarmSystemActivation.addRequiredMember(administrators);\n alarmSystemActivation.addRequiredMember(family);\n\n assertTrue(m_roleChecker.isImpliedBy(alarmSystemActivation, elmer));\n assertTrue(m_roleChecker.isImpliedBy(alarmSystemActivation, pepe));\n assertFalse(m_roleChecker.isImpliedBy(alarmSystemActivation, bugs));\n assertFalse(m_roleChecker.isImpliedBy(alarmSystemActivation, daffy));\n }", "protected abstract boolean canGenerateScore();", "boolean hasMinExperience();", "public boolean addStudents(Student a) {\n if(this.numOfStudents >= this.size) {\n return false;\n }\n\n // find position to insert\n int position = 0;\n for(int i = 0; i < this.numOfStudents; i++) {\n if(a.score < this.board[i].score) {\n position++;\n }\n else {\n break;\n }\n }\n\n // move to give spare space\n // 4 3 2\n for(int i = numOfStudents - 1 + 1; i > position; i--) {\n this.board[i] = this.board[i-1];\n }\n //System.out.println(\"begin to insert \"+ position + \" with \" + a.name + \" \" + a.score);\n // add student a to position\n this.board[position] = a;\n this.numOfStudents++;\n return true;\n }", "boolean hasMaterialization(Object groupID) throws Exception;", "public static void changeGrade(Student[] student,int studentID,ExamGrade examGrade){\n int count=0; //there is count int because of finding given student id have or not\n for(int i=0;i<student.length;i++){\n if(student[i].getStudentID()==studentID){\n student[i].setExamGrade(examGrade);\n ++count;\n }\n }\n\n if(count==0){//if caunt do not equal 0,it says that the given student id is in the array\n System.out.println(\"No such student\");\n }\n }", "public boolean hasUser(){\n return numUser < MAX_USER;\n }", "public static void main(String[] args){\n\t\tPersonalData data1= new PersonalData(1982,01,11,234567890);\n\t\tPersonalData data2= new PersonalData(1992,10,19,876543210);\n\t\tPersonalData data3= new PersonalData(1989,04,27,928374650);\n\t\tPersonalData data4= new PersonalData(1993,07,05,819463750);\n\t\tPersonalData data5= new PersonalData(1990,11,03,321678950);\n\t\tPersonalData data6= new PersonalData(1991,11,11,463728190);\n\t\tStudent student1=new Student(\"Ali Cantolu\",5005,50,data1);\n\t\tStudent student2=new Student(\"Merve Alaca\",1234,60,data2);\n\t\tStudent student3=new Student(\"Gizem Kanca\",5678,70,data3);\n\t\tStudent student4=new Student(\"Emel Bozdere\",8902,70,data4);\n\t\tStudent student5=new Student(\"Merter Kazan\",3458,80,data5);\n\n\t\t//A course (let us call it CSE141) with a capacity of 3 is created\n\t\tCourse CSE141=new Course(\"CSE141\",3);\n\n\t\t//Any 4 of the students is added to CSE141.\n\t\tif (!CSE141.addStudent(student1)) System.out.println(student1.toString()+ \" is not added\");\n\t\tif (!CSE141.addStudent(student2)) System.out.println(student2.toString()+ \" is not added\");\n\t\tif (!CSE141.addStudent(student3)) System.out.println(student3.toString()+ \" is not added\");\n\t\tif (!CSE141.addStudent(student4)) System.out.println(student4.toString()+ \" is not added\");\n\n\n\t\t//All students of CSE141 are printed on the screen.\n System.out.println(\"\\nAll students of \"+CSE141.getCourseName()+\": \");\n CSE141.list();\n\n //The capacity of CSE141 is increased.\n CSE141.increaseCapacity();\n\n //Remaining 2 students are added to CSE141.\n\t \tCSE141.addStudent(student4);\n\t \tCSE141.addStudent(student5);\n\n\t \t//All students of CSE141 are printed on the screen.\n\t \tSystem.out.println(\"\\nAll students of \"+CSE141.getCourseName()+\": \");\n\t \tCSE141.list();\n\n\t \t//Student with ID 5005 is dropped from CSE141.\n\t \tCSE141.dropStudent(student1);\n\n\t \t//All students of CSE141 are printed on the screen.\n\t \tSystem.out.println(\"\\nAll students of \"+CSE141.getCourseName()+\": \");\n\t \tCSE141.list();\n\n\t \t//Number of students enrolled to CSE141 is printed.\n\t \tSystem.out.println(\"\\nNumber of students enrolled to \"+CSE141.getCourseName()+\": \" + CSE141.getNumberOfStudents());\n\n\t \t//Birth year of best student of CSE141 is printed on the screen. (You should use getYear() method of java.util.Date class.)\n\t \tSystem.out.println(\"\\nBirth year of best student of CSE141 is \"+CSE141.getBestStudent().getPersonalData().getBirthDate().getYear());\n\n\t \t//A new course (let us call it CSE142) is created.\n\t \tCourse CSE142=new Course(\"CSE142\");\n\n\t \t//All students currently enrolled in CSE141 are added to CSE142. (You should use getStudents() method).\n\t \tStudent[] students = CSE141.getStudents();\n\t \tfor(int i=0;i<CSE141.getNumberOfStudents();i++)\n\t \t\tCSE142.addStudent(students[i]);\n\n\t \t//All students of CSE141 are removed from the course.\n\t \tCSE141.clear();\n\n\t \t//Student with ID 5005 is dropped from CSE141 and result of the operation is printed on the screen.\n\t \tSystem.out.println(\"\\nThe result of the operation 'Student with ID 5005 is dropped from \"+CSE141.getCourseName()+\"' is: \"+CSE141.dropStudent(student1));\n\n\t \t//All students of CSE142 are printed on the screen.\n\t \tSystem.out.println(\"\\nAll students of \"+CSE142.getCourseName()+\": \");\n\t \tCSE142.list();\n\n\t \t//Best student of CSE142 is dropped from CSE142.\n\t \tCSE142.dropStudent(CSE142.getBestStudent());\n\n\t \t//All students of CSE142 are printed on the screen.\n\t \tSystem.out.println(\"\\nAll students of \"+CSE142.getCourseName()+\": \");\n\t \tCSE142.list();\n\n\t \t//GPA of youngest student of CSE142 is printed on the screen.\n\t\tSystem.out.println(\"\\nThe Youngest Student's (\"+CSE142.getYoungestStudent()+\") GPA is \"+CSE142.getYoungestStudent().GPA());\n\n\t \t//Courses CSE141 and CSE142 are printed on the screen.\n\t \tSystem.out.println(\"\\nCourse Information for \"+CSE141.getCourseName()+\":\\n\" + CSE141.toString());\n\t \tSystem.out.println(\"\\nCourse Information for \"+CSE142.getCourseName()+\":\\n\" + CSE142.toString());\n\t }", "public boolean containsStudent(final int matrnr) {\n return students.containsKey(matrnr);\n }", "boolean hasMaxExperience();", "public void testExistingDriverHasGradeGroup() throws MalBusinessException{\n\t\tunallocatedDriverId = ((BigDecimal)em.createNativeQuery(TestQueryConstants.READ_DRIVER_ID_UNALLOCATED).getSingleResult()).longValue();\t\t\n\t\tdriver = driverService.getDriver(unallocatedDriverId);\n\t\tassertNotNull(\"Grade Group does not exist for driver Id \" +unallocatedDriverId, driver.getDgdGradeCode() );\n\t}", "@Test\n public void test2() {\n MPCS_52011.setStudentCount(60); // Set the course as full for testing purposes.\n CourseAdd Course_Adder = new CourseAdd(MPCS_52011,Sophia,con);\n int updates = Course_Adder.getState().addStudent(Course_Adder,MPCS_52011,Sophia);\n assertEquals(1,updates); // Assert that an update was made\n assertTrue(MPCS_52011.getWaitingList().contains(Sophia)); // Check if Sophia present in waitlist\n List<Integer> StudentIDs = new ArrayList<Integer>();\n try{ // Check Database\n Statement stmt=con.createStatement();\n ResultSet rs=stmt.executeQuery(\"select StudentID from Waitlisted_Students where course_code = '\" + MPCS_52011.getcode() + \"';\");\n while(rs.next()){\n StudentIDs.add(rs.getInt(1)); // Add each student ID from database\n }\n }catch (Exception e){\n System.out.println(e);\n }\n assertTrue(StudentIDs.contains(Sophia.getID())); // Check is Sophia present in waitlist\n }", "public void testRequiredRolesMultipleGroupsOk() {\n User elmer = RoleFactory.createUser(\"elmer\");\n User pepe = RoleFactory.createUser(\"pepe\");\n User bugs = RoleFactory.createUser(\"bugs\");\n User daffy = RoleFactory.createUser(\"daffy\");\n \n Group administrators = RoleFactory.createGroup(\"administrators\");\n administrators.addRequiredMember(m_anyone);\n administrators.addMember(elmer);\n administrators.addMember(pepe);\n administrators.addMember(bugs);\n\n Group family = RoleFactory.createGroup(\"family\");\n family.addRequiredMember(m_anyone);\n family.addMember(elmer);\n family.addMember(pepe);\n family.addMember(daffy);\n\n Group alarmSystemActivation = RoleFactory.createGroup(\"alarmSystemActivation\");\n alarmSystemActivation.addRequiredMember(m_anyone);\n alarmSystemActivation.addMember(administrators);\n alarmSystemActivation.addMember(family);\n\n assertTrue(m_roleChecker.isImpliedBy(alarmSystemActivation, elmer));\n assertTrue(m_roleChecker.isImpliedBy(alarmSystemActivation, pepe));\n assertTrue(m_roleChecker.isImpliedBy(alarmSystemActivation, bugs));\n assertTrue(m_roleChecker.isImpliedBy(alarmSystemActivation, daffy));\n }", "private static long vratiBrojOdlikasa(List<StudentRecord> records) {\n\t\treturn records.stream()\n\t\t\t\t\t\t.filter(s -> s.getGrade() == 5)\n\t\t\t\t\t\t.count();\n\t}", "public boolean addCourse(String user, String course){\n String[] tokens = usersRepository.getclassString(user).split(\" \");\r\n String[] courseids = new String[tokens.length];\r\n String courseid = classesRepository.getClassCourseid(course);\r\n for(int i =0; i < tokens.length; i++){\r\n courseids[i] = classesRepository.getClassCourseid(tokens[i]);\r\n }\r\n for(int f =0; f < tokens.length; f++) {\r\n if(courseids[f] == null){\r\n continue;\r\n }\r\n if(courseids[f].equals(courseid)){\r\n return false;\r\n }\r\n }\r\n //check for course space\r\n if(!classesRepository.checkCourseSpace(course)){\r\n return false;\r\n }\r\n\r\n //check here for prereqs\r\n //get student records\r\n String studentrecord = usersRepository.findUserRecords(user);\r\n String studentgrade = usersRepository.findUserGrades(user);\r\n String[] tokenrecords;\r\n String[] tokengrades;\r\n if(studentrecord==null){\r\n tokenrecords = new String[0];\r\n tokengrades = new String[0];\r\n }else{\r\n tokenrecords = studentrecord.split(\" \");\r\n tokengrades = studentgrade.split(\" \");\r\n }\r\n //get course prereq\r\n String[] prereqs = classesRepository.getCoursePrereqs(courseid);\r\n //compare all token records with course prereqs, must be in records without d or f\r\n boolean meetsreq1 = true, meetsreq2 = true;\r\n if(prereqs[0] != null){\r\n meetsreq1=false;\r\n }\r\n if(prereqs[1] != null){\r\n meetsreq2=false;\r\n }\r\n for(int s = 0; s < tokenrecords.length; s++){\r\n if(!tokengrades[s].equals(\"D\") && !tokengrades[s].equals(\"F\")){\r\n if(prereqs[0] != null){\r\n if(prereqs[0].equals(tokenrecords[s])){\r\n meetsreq1 = true;\r\n }\r\n }\r\n if(prereqs[1] != null){\r\n if(prereqs[1].equals(tokenrecords[s])){\r\n meetsreq2 = true;\r\n }\r\n }\r\n }\r\n\r\n }\r\n if(meetsreq1 && meetsreq2){\r\n usersRepository.addCourse(user, course);\r\n return true;\r\n }\r\n return false;\r\n }", "@Test\n public void testAddEligibleStudent() {\n System.out.println(\"addEligibleStudent\");\n int ID = 1010101010;\n instance.addEligibleStudent(ID);\n\n assertTrue(\"Student eligibility unchanged\", instance.isStudentEligible(ID));\n\n // TODO review the generated test code and remove the default call to fail.\n // fail(\"The test case is a prototype.\");\n }", "void aDayPasses(){\n\t\t\n\t\t/**\n\t\t * Modify wait time if still exists\n\t\t */\n\t\tif(!daysUntilStarts.equals(0)){\n\t\t\tdaysUntilStarts--;\n\t\t\tif((!hasInstructor() || getSize() == 0) && daysUntilStarts.equals(0)){\n\t\t\t\tif(hasInstructor())\n\t\t\t\t\tinstructor.unassignCourse();\n\t\t\t\tfor(Student student : enrolled){\n\t\t\t\t\tstudent.dropCourse();\n\t\t\t\t}\n\t\t\t\tsubject.unassign();\n\t\t\t\tinstructor = null;\n\t\t\t\tenrolled = new ArrayList<Student>();\n\t\t\t\tcancelled = true;\n\t\t\t} else if (daysUntilStarts.equals(0)) {\n\t\t\t\tsubject.unassign();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * Modify run time if still exists\n\t\t */\n\t\tif(!daysToRun.equals(0)){\n\t\t\tdaysToRun--;\n\t\t}\n\t\t/**\n\t\t * If couse finished un-assigned people from it\n\t\t */\n\t\tif(daysToRun.equals(0) && !finished){\n\t\t\tfor(Student student : enrolled){\n\t\t\t\tstudent.graduate(subject);\n\n\t\t\t}\n\t\t\tinstructor.unassignCourse();\n\t\t\tinstructor = null;\n\t\t\tfinished = true;\n\t\t}\n\t}", "private BonusMember checkGoldLimit(int memberNo, LocalDate date) {\n\t\tBonusMember member = findMember(memberNo);\n\t\t\n\t\tif (member == null)\n\t\t\tthrow new IllegalArgumentException(\"Could not find member\");\n\t\t\n\t\tint points = member.findQualificationPoints(date);\n\t\t\n\t\tif (points > GOLD_LIMIT) {\n\t\t\tGoldMember goldMember = new GoldMember(memberNo, member.getPersonals(), date, points);\n\t\t\treturn goldMember;\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "@Test\r\n\t public void hasSubmitted3() {\n\t \tthis.admin.createClass(\"ecs60\",2017,\"sean\",50);\r\n\t \tthis.student.registerForClass(\"gurender\", \"ecs60\", 2017);\r\n\t this.instructor.addHomework(\"sean\", \"ecs60\", 2017, \"p1\");\r\n\t this.student.submitHomework(\"gurender\", \"p1\", \"abc\", \"ecs60\", 2017);\r\n\t this.student.dropClass(\"gurender\", \"ecs60\", 2017);\r\n\t assertTrue(this.student.hasSubmitted(\"gurender\", \"p1\", \"ecs60\", 2017));\r\n\t }", "@Test\n public void testGetClassAssociatedStudent() {\n System.out.println(\"getClassAssociatedStudent\");\n School instance = new School();\n instance.setStudents(students);\n instance.setStudentClass(studentClass);\n instance.setClasses(classes);\n\n assertEquals(classes, instance.getClassAssociatedStudent(student1));\n assertEquals(classes, instance.getClassAssociatedStudent(student2));\n System.out.println(\"PASS with associated student\");\n\n assertEquals(0, instance.getClassAssociatedStudent(student3).size());\n System.out.println(\"PASS with unassociated student\");\n\n System.out.println(\"PASS ALL\");\n }", "boolean hasAdGroupCriterionSimulation();", "boolean hasAdGroupCriterion();", "public static void main(String[] args) {\n\t\tStudent s1 = new Student(\"Joro\", \"KST\", (byte)25);\n\t\tStudent s2 = new Student(\"Pesho\", \"KST\", (byte)25);\n\t\tStudent s3 = new Student(\"Gesho\", \"KST\", (byte)25);\n\t\tStudent s4 = new Student(\"Misho\", \"KST\", (byte)25);\n\t\tStudent s5 = new Student(\"Tisho\", \"KST\", (byte)25);\n\t\tStudent s6 = new Student(\"Ivo\", \"KST\", (byte)25);\n\t\t\n\t\ts3.setGrade(5);\n\t\ts5.setGrade(5.5);\n\t\ts2.setGrade(6);\n\t\t\n\t\ts1.receiveScholarship(4, 500);\n\t\ts2.receiveScholarship(5, 250.00);\n\t\t\n\t\t\n\t\ts2.upYear();\n\t\ts5.upYear();\n\t\ts6.upYear();\n\t\t\n\t\tStudentGroup sg1 = new StudentGroup(\"KST\") ;\n\t\t\n\t\tsg1.addStudent(s1);\n\t\tsg1.addStudent(s2);\n\t\tsg1.addStudent(s3);\n\t\tsg1.addStudent(s4);\n\t\tsg1.addStudent(s5);\n\t\tsg1.addStudent(s6);\n\n\t\n\t\tSystem.out.println(sg1.printStudentsInGroup());\n\t\t\n\t\t\n\t\tSystem.out.println(\"The best student in group is \"+ sg1.theBestStudent());\n\n\t}", "public static ArrayList < Student > teamMemberGPAConstraintApplicator(ArrayList < Student > teamCreator) {\n int GPAGreaterThanThreeCounter = 0;\n for (int i = 0; i < teamCreator.size(); i++) {\n if (teamCreator.get(i).getGpa() >= 3.00) {\n GPAGreaterThanThreeCounter++;\n }\n }\n\n //considering sumOfGPA here as well so that changes made here should not impact teamAverageGPAConstraint\n double sumOfGPA = 0;\n for (Student student: teamCreator) {\n sumOfGPA = sumOfGPA + student.getGpa();\n }\n double averageGpaOfTeam = sumOfGPA / 4;\n\n if (GPAGreaterThanThreeCounter < 2) { //if hard constraint is violeted then we will first try to meet it by swapping students between teamCreator and studentsNotInATeam\n for (int i = 0; i < studentsNotInATeam.size(); i++) {\n if ((studentsNotInATeam.get(i).getGender() == 'm' || studentsNotInATeam.get(i).getGender() == 'M')&& studentsNotInATeam.get(i).getGpa() >= 3.00) {\n for (Student student: teamCreator) {\n if (((studentsNotInATeam.get(i).getGender() == 'm' || studentsNotInATeam.get(i).getGender() == 'M') && student.getGpa() < 3.00) && (((sumOfGPA + studentsNotInATeam.get(i).getGpa() - student.getGpa()) / 4) < 3.50)) {\n //swapping students\n studentsNotInATeam.add(student);\n teamCreator.remove(student);\n teamCreator.add(studentsNotInATeam.get(i));\n studentsNotInATeam.remove(studentsNotInATeam.get(i));\n GPAGreaterThanThreeCounter++; //we got one more student with GPA >= 3\n break;\n }\n }\n if (GPAGreaterThanThreeCounter == 2) {\n break; // if hard constraint is met\n }\n }\n }\n }\n return teamCreator;\n }", "@Override\n public void computeSatisfaction() {\n\n }", "private BonusMember checkGoldLimit(BonusMember member, LocalDate date) {\n\t\tif (member == null)\n\t\t\tthrow new IllegalArgumentException(\"Could not find member\");\n\t\t\n\t\tint points = member.findQualificationPoints(date);\n\n\t\tif (points > GOLD_LIMIT) {\n\t\t\tGoldMember goldMember = new GoldMember(member.getMemberNo(), member.getPersonals(), date, points);\n\t\t\treturn goldMember;\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "boolean isOverLimit(Player player) {\n GroupOption groupOption = null;\n for (GroupOption go : groupOptions) {\n // Check if it's explicitly set so we avoid defaulted values\n if (player.isPermissionSet(go.getName()) && player.hasPermission(go.getName())) {\n groupOption = go;\n break;\n }\n }\n\n // Use default, if necessary\n if (groupOption == null)\n groupOption = defaultGroupOption;\n\n debug(this, \"Player %s using group option %s\", player.getName(), groupOption);\n\n // Count the player's current number of power tools\n int current;\n PlayerState ps = getPlayerState(player, false);\n if (ps == null)\n current = 0;\n else\n current = ps.getPowerTools().size();\n\n int limit = groupOption.getLimit();\n return limit > -1 && current >= limit;\n }", "public boolean checkState(){\r\n\t\t//Check if we have enough users\r\n\t\tfor (Map.Entry<String, Role> entry : roleMap.entrySet()){\r\n\t\t\tString rid = entry.getKey();\r\n\t\t\tRole role = roleMap.get(rid);\r\n\t\t\tlog.info(\"Veryifying \" + rid);\t\t\t\r\n\t\t\tif(!roleCount.containsKey(rid)){\r\n\t\t\t\tlog.severe(\"Unsure of game state.\" + rid + \" not found in roleCount\");\r\n\t\t\t\tSystem.exit(-1);\r\n\t\t\t\r\n\t\t\t} else if(role.getMin() > roleCount.get(rid)) {\r\n\t\t\t\t\tlog.info(\"minimum number for roleID: \" + rid + \" not achived\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\r\n\t\t\t} else if(role.getMax() < roleCount.get(rid)) { //probably don't need this one but cycles are cheap\r\n\t\t\t\tlog.severe(\"OVER MAXIMUM number for roleID: \" + rid + \" not achived\");\r\n\t\t\t\tSystem.exit(-1);\r\n\t\t\t}\r\n\t\t}\r\n\t\t//if we do reach here we've reached a critical mass of players. But we still need them to load the screen\r\n\t\t\r\n\t\tif((this.getGameState() != GAMESTATE.RUNNING) ||(this.gameState !=GAMESTATE.READY_TO_START) ) {\r\n\t\t\tsetGameState(GAMESTATE.CRITICAL_MASS);\r\n\t\t\tlog.info(\"have enough players for game\");\r\n\t\t}\r\n\t\t//if the users are done loading their screen, let us know and then we can start\r\n\t\tif (!userReady.containsValue(false)){\r\n\t\t\tsetGameState(GAMESTATE.READY_TO_START);\r\n\t\t\tlog.info(\"Gamestate is running!!\");\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public boolean hasTeam(User std) {\r\n\t\tboolean hasTeam = false;\r\n\t\tHashMap<String, ArrayList<String>> map = MySQLConnector.executeMySQL(\"select\", \"SELECT * FROM `is480-matching`.students WHERE id = \" + std.getID() + \" ;\");\r\n\t\tSet<String> keySet = map.keySet();\r\n\t\tIterator<String> iterator = keySet.iterator();\r\n\t\t\r\n\t\twhile (iterator.hasNext()){\r\n\t\t\tString key = iterator.next();\r\n\t\t\tArrayList<String> array = map.get(key);\t\r\n\t\t\tint teamId \t= Integer.parseInt(array.get(3));\r\n\t\t\t\r\n\t\t\tif(teamId != 0){\r\n\t\t\t\thasTeam = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn hasTeam;\r\n\t}" ]
[ "0.6341505", "0.6031025", "0.589828", "0.5883965", "0.588341", "0.58529854", "0.58273566", "0.5792102", "0.5788709", "0.57864666", "0.5732458", "0.5730918", "0.5720583", "0.5689395", "0.5687305", "0.5681927", "0.56564224", "0.562609", "0.56043637", "0.55598146", "0.5549267", "0.55485946", "0.5523083", "0.55154145", "0.5513938", "0.54886156", "0.54886156", "0.54886156", "0.54886156", "0.54886156", "0.5485028", "0.548297", "0.54783493", "0.54706895", "0.54588276", "0.5424469", "0.54130745", "0.5399628", "0.53950095", "0.53867763", "0.53717756", "0.53585243", "0.5349898", "0.53474927", "0.5346972", "0.53463984", "0.53458893", "0.53427315", "0.5342619", "0.5342195", "0.5339517", "0.5333408", "0.5331284", "0.5321502", "0.5319011", "0.5317559", "0.5310235", "0.53089195", "0.53026223", "0.5291312", "0.52904266", "0.5284415", "0.5276029", "0.52714086", "0.52703214", "0.5269638", "0.5268895", "0.52626204", "0.52604234", "0.525918", "0.5257886", "0.52539754", "0.5244358", "0.5238958", "0.52388406", "0.5236057", "0.5234246", "0.5233287", "0.52316284", "0.5229315", "0.52246886", "0.5219849", "0.521965", "0.52196133", "0.5215911", "0.52100146", "0.5207944", "0.5207361", "0.5206517", "0.519243", "0.5191042", "0.5190079", "0.5184419", "0.5179005", "0.5177889", "0.5173734", "0.5162976", "0.51625675", "0.51511073", "0.5151101" ]
0.692181
0
Performs the correct push
public static void paramPush(String val) { paramPush(val, PARAM_IDX); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void push(T entry)\n { \n first = push(entry, first);\n }", "static void perform_push(String passed){\n\t\tint type = type_of_push(passed);\n\t\tswitch(type){\n\t\tcase 1:\n\t\t\tpush_to_stack(passed);\n\t\t\tbreak;\n\t\t}\n\t}", "public void push(T x);", "public void push(T data);", "public void push(T data);", "void push(T item);", "void push(T item);", "void push(T t);", "public void push(E e) throws Exception;", "public void push(T item);", "void push() {\n\t\t// push logic here\n\t\t_pushes++;\n\t\t_money += _bet;\n\t\tclearHand();\n\t\t_bet = 0;\n\t}", "void push(T x);", "@Override\r\n\tpublic void push(E e) {\n\t\t\r\n\t}", "public void push(E data);", "public void push(int x) {\n temp.push(x);\n }", "public void push(int x) {\n push.push(x);\n }", "void push(Object item);", "public void push(T aValue);", "public void push(T dato );", "public void push(T newItem);", "public abstract void push(SDGNode call);", "@Override\n\tpublic void push(E item) {\n\t\t\n\t}", "void push(int element);", "public void push(T elem);", "public abstract boolean push(Object E);", "public void push(E item);", "public void push(int elem);", "@Override\r\n\tpublic void push() {\n\t\tSystem.out.println(\"Push logic for Dynamic Stack\");\r\n\t}", "public void push(T element);", "public void push(T element);", "void push(int in);", "@Override\r\n\tpublic void push() {\n\t\tSystem.out.println(\"Push logic for Fixed Stack\");\r\n\t\t\r\n\t}", "void push(E Obj);", "void push(int value);", "void push(T item) {\n contents.addAtHead(item);\n }", "@Override\n\tpublic void push(Object x) {\n\t\tlist.addFirst(x);\n\t}", "public void push(String name);", "void push(Object elem);", "public void push(T o) {\r\n\t\tadd(o);\t\r\n\t}", "public void push(T val){ if(this.isUpgraded) this.linkArray.push(val); else this.nativeArray.add(val); }", "void push(E e);", "void push(E e);", "public void push(T newEntry);", "public void push(int x) {\n one.add(x);\n for(int i=0;i<one.size()-1;i++)\n {\n one.add(one.poll());\n }\n \n }", "public void push(E value);", "public void push(T data)\n {\n ll.insert(ll.getSize(), data);\n }", "public void enqueue(T pushed)\n\t{insert(pushed);}", "public void push(int x) {\n s1.push(x);\n }", "void push(int i);", "public void push(int x) {\n s1.push(x);\n }", "public void push(int x) {\n s1.push(x);\n }", "public void push(int x) {\n s1.push(x);\n }", "private void push() {\n ImmutableSortedSet<T> myAvailable = _outstanding.apply(\n new Syncd.Transformer<ImmutableSortedSet<T>, ImmutableSortedSet<T>>() {\n public Tuple<ImmutableSortedSet<T>, ImmutableSortedSet<T>> apply(ImmutableSortedSet<T> aBefore) {\n final SortedSet<T> myRemaining = new TreeSet<>(new MessageComparator<T>());\n\n // Identify those messages that are sequentially contiguous from _floor and can be passed on\n //\n ImmutableSortedSet<T> myAccessible =\n new ImmutableSortedSet.Builder<>(new MessageComparator<T>()).addAll(\n Iterables.filter(aBefore, new Predicate<T>() {\n public boolean apply(T aMessage) {\n Long myCurrent = _floor.get();\n\n if (aMessage.getSeq() == myCurrent) {\n // This message can be sent out to listeners so long as we're first to try\n //\n if (_floor.testAndSet(myCurrent, myCurrent + 1))\n return true;\n } else\n // This message must remain\n //\n myRemaining.add(aMessage);\n\n // Couldn't send message out or it must remain\n //\n return false;\n }\n })\n ).build();\n\n return new Tuple<>(new ImmutableSortedSet.Builder<>(\n new MessageComparator<T>()).addAll(myRemaining).build(),\n myAccessible);\n }\n }\n );\n\n send(myAvailable);\n archive(myAvailable);\n }", "@Override\r\n public boolean canBePushed()\r\n {\r\n return true;\r\n }", "public void push(int x) { //全部放到第一个\n temp1.push(x);\n }", "public void push(T x) {\n\t\tl.push(x);\n\t}", "public void push(int x) {\n\t int size=q.size();\n\t q.offer(x);\n\t for(int i=0;i<size;i++){\n\t q.offer(q.poll());\n\t }\n\t \n\t }", "void push(int x);", "public void push(TYPE element);", "@Override\n\tpublic void push(int item) {\n\n\t}", "@Override\n public void push(T data) {\n if (data != null) {\n if (size == backing.length) {\n T[] newBacking = (T[]) new Object[backing.length * 2];\n for (int i = 0; i < size; i++) {\n newBacking[i] = backing[i];\n }\n newBacking[size++] = data;\n backing = newBacking;\n } else {\n backing[size] = data;\n size++;\n }\n } else {\n throw new IllegalArgumentException(\"Can't push null onto stack\");\n }\n }", "public void push(E element);", "public void push(int x) {\n if(q1.isEmpty()) {\n q1.add(x);\n while(q2.size() > 0) {\n q1.add(q2.poll());\n }\n } else {\n q2.add(x);\n while(q1.size() > 0){\n q2.add(q1.poll());\n }\n }\n }", "void push(int v);", "public void testPush() {\n assertEquals(this.stack.size(), 10, 0.01);\n this.stack.push(10);\n assertEquals(this.stack.size(), 11, 0.01);\n assertEquals(this.stack.peek(), 10, 0.01);\n }", "@Override\r\n\tpublic boolean push(T e) {\r\n\t\tif(!isFull()) {\r\n\t\t\tstack[topIndex + 1] = e;\r\n\t\t\ttopIndex++;\r\n\t\t\treturn true;\r\n\t\t}else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public void push (E element);", "public void push(E item) {\n addFirst(item);\n }", "public void push(int x) {\n inSt.push(x);\n\n }", "public Object push(Object arg)\n {\n dataList.add(arg);\n return arg;\n }", "protected static void pushLog(GDsendObj _pushAction) {\n\t\tint i = 0;\n for (i = 0; i < Pool.size(); i++) {\n if ( Pool.get(i).action == _pushAction.action) {\n if (Pool.get(i).action == \"custom\" && ((GDcustomLog)Pool.get(i).value).key == ((GDcustomLog)_pushAction.value).key) {\n ((GDcustomLog)Pool.get(i).value).value++;\n } else {\n Pool.get(i).value = _pushAction.value;\n }\n break;\n }\n }\n if (i == Pool.size()) Pool.add(_pushAction);\n return; \t\t\n\t}", "void push(String message);", "public void push(int x) {\n q.add(x);\n for (int i = 0; i < q.size() - 1; ++i) {\n q.add(q.poll());\n }\n }", "public void push(int x) {\n if(q1.isEmpty()) {\n q1.add(x);\n while(q2.size() > 0) {\n q1.add(q2.poll());\n }\n }\n else {\n q2.add(x);\n while(q1.size() > 0) {\n q2.add(q1.poll());\n }\n }\n }", "public void push(Object anElement);", "public void push(int x) {\n if(!queueA.isEmpty()){\n queueA.add(x);\n }else if(!queueB.isEmpty()){\n queueB.add(x);\n }else{\n queueA.add(x);\n }\n }", "public void push (E item){\n this.stack.add(item);\n }", "public void push(int x) {\n q1.add(x);\n int n = q1.size();\n for (int i = 1; i < n; i++) {\n q1.add(q1.poll());\n }\n }", "@Override\n public void push(T element){\n arrayAsList.add(element);\n stackPointer++;\n }", "public void push(Object activity);", "public void push(E object) {stackList.insertAtFront(object);}", "public void push(Object value) {\n\t\tthis.add(value);\n\t}", "public void push(E newItem);", "void push(Recycler.DefaultHandle<?> item)\r\n/* 519: */ {\r\n/* 520:554 */ Thread currentThread = Thread.currentThread();\r\n/* 521:555 */ if (this.threadRef.get() == currentThread) {\r\n/* 522:557 */ pushNow(item);\r\n/* 523: */ } else {\r\n/* 524:562 */ pushLater(item, currentThread);\r\n/* 525: */ }\r\n/* 526: */ }", "public void push() throws EvaluationException {\n\t\tsetTimeout(Integer.MAX_VALUE);\n\t\tprintln(\"(push 1)\");\n\t\tcheckSuccess();\n\t\tsymbolsByStackPos.addLast(new HashSet<>());\n\t}", "public void push(int x) {\n q1.push(x);\n if (q2.size() > 0){\n q2.remove();\n }\n }", "@Test\n public void testPush() {\n System.out.println(\"push\");\n instance.push(1);\n String expResult = \"[1]\";\n assertEquals(expResult, instance.toString());\n instance.push(2);\n expResult = \"[1, 2]\";\n assertEquals(expResult, instance.toString());\n }", "public void push(E item) {\n if (!isFull()) {\n this.stack[top] = item;\n top++;\n } else {\n Class<?> classType = this.queue.getClass().getComponentType();\n E[] newArray = (E[]) Array.newInstance(classType, this.stack.length*2);\n System.arraycopy(stack, 0, newArray, 0, this.stack.length);\n this.stack = newArray;\n\n this.stack[top] = item;\n top++;\n }\n }", "public T push(T data){\r\n \tboolean sorted = false;\r\n \twhile(!sorted) {\r\n \t\tif(stack1.empty() || data.compareTo(stack1.peek()) < 0) {\r\n \t\t\tstack2.push(data);\r\n \t\t\tsorted = true;\r\n \t\t}else {\r\n \t\t\tstack2.push(stack1.pop());\r\n \t\t}\r\n \t}\r\n \twhile(stack1.size() > 0) {\r\n \t\tstack2.push(stack1.pop());\r\n \t}\r\n \twhile(stack2.size() > 0) {\r\n \t\tstack1.push(stack2.pop());\r\n \t}\r\n \t++this.size;\r\n \treturn data;\r\n }", "@Override\r\n\tpublic void push(E e) {\r\n\t\tif (size() == stack.length)\r\n\t\t\texpandArray();\r\n\t\tstack[++t] = e; // increment t before storing new item\r\n\t}", "void push(int e) {\r\n\t\tif (top==stack.length) {\r\n\t\t\tmakeNewArray();\r\n\t\t}\r\n\t\tstack[top] = e;\r\n\t\ttop++;\r\n\t}", "public void push(Object item) {\r\n\t\tdata.add(item);\r\n\r\n\t}", "public void push(int x) {\n // Write your code here\n if (queue1.isEmpty() && queue2.isEmpty()) {\n queue1.offer(x);\n } else if (!queue1.isEmpty()) {\n queue1.offer(x);\n } else {\n queue2.offer(x);\n }\n }", "public abstract boolean push(BindingSet bs) throws InterruptedException;", "@Override\n\tpublic void push(T element) {\n\t\tif(top == stack.length) \n\t\t\texpandCapacity();\n\t\t\n\t\tstack[top] = element;\n\t\ttop++;\n\n\t}", "public void push(E elem) {\n if (elem != null) {\r\n contents[++top] = elem;\r\n }\r\n\r\n // Usually better to resize after an addition rather than before for\r\n // multi-threading reasons. Although, that is not important for this class.\r\n if (top == contents.length-1) resize();\r\n }", "private final void push(Object ob) {\r\n\t\teval_stack.add(ob);\r\n\t}", "public void push(T value) {\n \tstack.add(value);\n }", "public void push(int x) {\n \tint size = s2.size();\n \tfor(int i = 0; i < size; i++) {\n \t\ts.push(s2.pop());\n \t}\n \ts.push(x);\n }", "public void push(int x) {\n data.add(x);\n }", "void push(int a)\n\t{\n\t // Your code here\n\t top++;\n\t arr[top]=a;\n\t}" ]
[ "0.73344195", "0.73179114", "0.7137593", "0.7109531", "0.7109531", "0.70550174", "0.70550174", "0.7049183", "0.7024642", "0.69732815", "0.69699806", "0.6950878", "0.69186103", "0.69109976", "0.69005364", "0.6891724", "0.6884225", "0.68716395", "0.6866837", "0.6855733", "0.6847631", "0.68421644", "0.6825512", "0.6811677", "0.6803484", "0.67914814", "0.67787194", "0.677775", "0.67766637", "0.67766637", "0.6746271", "0.673457", "0.671892", "0.6704841", "0.67015773", "0.669427", "0.6686375", "0.66849333", "0.667234", "0.66612124", "0.66611236", "0.66611236", "0.6623972", "0.6621652", "0.66176045", "0.66172254", "0.66112936", "0.6605181", "0.6596837", "0.65960723", "0.65960723", "0.65960723", "0.6585388", "0.6577538", "0.6572061", "0.6564007", "0.6561325", "0.6555615", "0.65523964", "0.6549315", "0.654824", "0.6541496", "0.65398055", "0.65351707", "0.6534689", "0.6526996", "0.6515512", "0.65105474", "0.6506958", "0.6499798", "0.6499371", "0.64956903", "0.64893997", "0.648912", "0.6481367", "0.64435625", "0.6432994", "0.64252234", "0.64241856", "0.641034", "0.64095217", "0.6403282", "0.6400539", "0.6379278", "0.6367274", "0.63664967", "0.6365793", "0.6364307", "0.6360897", "0.63601506", "0.6357274", "0.6350772", "0.6349119", "0.63454777", "0.63427067", "0.634239", "0.63348985", "0.63344526", "0.6325215", "0.63162297", "0.63161945" ]
0.0
-1
Performs the correct push
public static void paramPush(String val, int curIdx) { PARAM_IDX = curIdx - 1; if(PARAM_IDX >= 0 && Options.OUTPUT_64BIT && PARAM_IDX < PARAM_64.length) { LAST_REG = PARAM_64[PARAM_IDX]; gen.emitBinary(MOV, val, LAST_REG); } else { LAST_REG = MEM(ESP); gen.emitUnary(PUSH, val); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void push(T entry)\n { \n first = push(entry, first);\n }", "static void perform_push(String passed){\n\t\tint type = type_of_push(passed);\n\t\tswitch(type){\n\t\tcase 1:\n\t\t\tpush_to_stack(passed);\n\t\t\tbreak;\n\t\t}\n\t}", "public void push(T x);", "public void push(T data);", "public void push(T data);", "void push(T item);", "void push(T item);", "void push(T t);", "public void push(E e) throws Exception;", "public void push(T item);", "void push() {\n\t\t// push logic here\n\t\t_pushes++;\n\t\t_money += _bet;\n\t\tclearHand();\n\t\t_bet = 0;\n\t}", "void push(T x);", "@Override\r\n\tpublic void push(E e) {\n\t\t\r\n\t}", "public void push(E data);", "public void push(int x) {\n temp.push(x);\n }", "public void push(int x) {\n push.push(x);\n }", "void push(Object item);", "public void push(T aValue);", "public void push(T dato );", "public void push(T newItem);", "public abstract void push(SDGNode call);", "@Override\n\tpublic void push(E item) {\n\t\t\n\t}", "void push(int element);", "public void push(T elem);", "public abstract boolean push(Object E);", "public void push(E item);", "public void push(int elem);", "@Override\r\n\tpublic void push() {\n\t\tSystem.out.println(\"Push logic for Dynamic Stack\");\r\n\t}", "public void push(T element);", "public void push(T element);", "void push(int in);", "@Override\r\n\tpublic void push() {\n\t\tSystem.out.println(\"Push logic for Fixed Stack\");\r\n\t\t\r\n\t}", "void push(E Obj);", "void push(int value);", "void push(T item) {\n contents.addAtHead(item);\n }", "@Override\n\tpublic void push(Object x) {\n\t\tlist.addFirst(x);\n\t}", "public void push(String name);", "void push(Object elem);", "public void push(T o) {\r\n\t\tadd(o);\t\r\n\t}", "void push(E e);", "void push(E e);", "public void push(T val){ if(this.isUpgraded) this.linkArray.push(val); else this.nativeArray.add(val); }", "public void push(T newEntry);", "public void push(int x) {\n one.add(x);\n for(int i=0;i<one.size()-1;i++)\n {\n one.add(one.poll());\n }\n \n }", "public void push(E value);", "public void push(T data)\n {\n ll.insert(ll.getSize(), data);\n }", "public void enqueue(T pushed)\n\t{insert(pushed);}", "public void push(int x) {\n s1.push(x);\n }", "void push(int i);", "public void push(int x) {\n s1.push(x);\n }", "public void push(int x) {\n s1.push(x);\n }", "public void push(int x) {\n s1.push(x);\n }", "private void push() {\n ImmutableSortedSet<T> myAvailable = _outstanding.apply(\n new Syncd.Transformer<ImmutableSortedSet<T>, ImmutableSortedSet<T>>() {\n public Tuple<ImmutableSortedSet<T>, ImmutableSortedSet<T>> apply(ImmutableSortedSet<T> aBefore) {\n final SortedSet<T> myRemaining = new TreeSet<>(new MessageComparator<T>());\n\n // Identify those messages that are sequentially contiguous from _floor and can be passed on\n //\n ImmutableSortedSet<T> myAccessible =\n new ImmutableSortedSet.Builder<>(new MessageComparator<T>()).addAll(\n Iterables.filter(aBefore, new Predicate<T>() {\n public boolean apply(T aMessage) {\n Long myCurrent = _floor.get();\n\n if (aMessage.getSeq() == myCurrent) {\n // This message can be sent out to listeners so long as we're first to try\n //\n if (_floor.testAndSet(myCurrent, myCurrent + 1))\n return true;\n } else\n // This message must remain\n //\n myRemaining.add(aMessage);\n\n // Couldn't send message out or it must remain\n //\n return false;\n }\n })\n ).build();\n\n return new Tuple<>(new ImmutableSortedSet.Builder<>(\n new MessageComparator<T>()).addAll(myRemaining).build(),\n myAccessible);\n }\n }\n );\n\n send(myAvailable);\n archive(myAvailable);\n }", "@Override\r\n public boolean canBePushed()\r\n {\r\n return true;\r\n }", "public void push(int x) { //全部放到第一个\n temp1.push(x);\n }", "public void push(T x) {\n\t\tl.push(x);\n\t}", "public void push(int x) {\n\t int size=q.size();\n\t q.offer(x);\n\t for(int i=0;i<size;i++){\n\t q.offer(q.poll());\n\t }\n\t \n\t }", "void push(int x);", "public void push(TYPE element);", "@Override\n\tpublic void push(int item) {\n\n\t}", "@Override\n public void push(T data) {\n if (data != null) {\n if (size == backing.length) {\n T[] newBacking = (T[]) new Object[backing.length * 2];\n for (int i = 0; i < size; i++) {\n newBacking[i] = backing[i];\n }\n newBacking[size++] = data;\n backing = newBacking;\n } else {\n backing[size] = data;\n size++;\n }\n } else {\n throw new IllegalArgumentException(\"Can't push null onto stack\");\n }\n }", "public void push(E element);", "public void push(int x) {\n if(q1.isEmpty()) {\n q1.add(x);\n while(q2.size() > 0) {\n q1.add(q2.poll());\n }\n } else {\n q2.add(x);\n while(q1.size() > 0){\n q2.add(q1.poll());\n }\n }\n }", "public void testPush() {\n assertEquals(this.stack.size(), 10, 0.01);\n this.stack.push(10);\n assertEquals(this.stack.size(), 11, 0.01);\n assertEquals(this.stack.peek(), 10, 0.01);\n }", "void push(int v);", "@Override\r\n\tpublic boolean push(T e) {\r\n\t\tif(!isFull()) {\r\n\t\t\tstack[topIndex + 1] = e;\r\n\t\t\ttopIndex++;\r\n\t\t\treturn true;\r\n\t\t}else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public void push (E element);", "public void push(E item) {\n addFirst(item);\n }", "public void push(int x) {\n inSt.push(x);\n\n }", "public Object push(Object arg)\n {\n dataList.add(arg);\n return arg;\n }", "protected static void pushLog(GDsendObj _pushAction) {\n\t\tint i = 0;\n for (i = 0; i < Pool.size(); i++) {\n if ( Pool.get(i).action == _pushAction.action) {\n if (Pool.get(i).action == \"custom\" && ((GDcustomLog)Pool.get(i).value).key == ((GDcustomLog)_pushAction.value).key) {\n ((GDcustomLog)Pool.get(i).value).value++;\n } else {\n Pool.get(i).value = _pushAction.value;\n }\n break;\n }\n }\n if (i == Pool.size()) Pool.add(_pushAction);\n return; \t\t\n\t}", "void push(String message);", "public void push(int x) {\n q.add(x);\n for (int i = 0; i < q.size() - 1; ++i) {\n q.add(q.poll());\n }\n }", "public void push(int x) {\n if(q1.isEmpty()) {\n q1.add(x);\n while(q2.size() > 0) {\n q1.add(q2.poll());\n }\n }\n else {\n q2.add(x);\n while(q1.size() > 0) {\n q2.add(q1.poll());\n }\n }\n }", "public void push(Object anElement);", "public void push(int x) {\n if(!queueA.isEmpty()){\n queueA.add(x);\n }else if(!queueB.isEmpty()){\n queueB.add(x);\n }else{\n queueA.add(x);\n }\n }", "public void push (E item){\n this.stack.add(item);\n }", "public void push(int x) {\n q1.add(x);\n int n = q1.size();\n for (int i = 1; i < n; i++) {\n q1.add(q1.poll());\n }\n }", "@Override\n public void push(T element){\n arrayAsList.add(element);\n stackPointer++;\n }", "public void push(E object) {stackList.insertAtFront(object);}", "public void push(Object activity);", "public void push(Object value) {\n\t\tthis.add(value);\n\t}", "public void push(E newItem);", "void push(Recycler.DefaultHandle<?> item)\r\n/* 519: */ {\r\n/* 520:554 */ Thread currentThread = Thread.currentThread();\r\n/* 521:555 */ if (this.threadRef.get() == currentThread) {\r\n/* 522:557 */ pushNow(item);\r\n/* 523: */ } else {\r\n/* 524:562 */ pushLater(item, currentThread);\r\n/* 525: */ }\r\n/* 526: */ }", "public void push() throws EvaluationException {\n\t\tsetTimeout(Integer.MAX_VALUE);\n\t\tprintln(\"(push 1)\");\n\t\tcheckSuccess();\n\t\tsymbolsByStackPos.addLast(new HashSet<>());\n\t}", "public void push(int x) {\n q1.push(x);\n if (q2.size() > 0){\n q2.remove();\n }\n }", "public void push(E item) {\n if (!isFull()) {\n this.stack[top] = item;\n top++;\n } else {\n Class<?> classType = this.queue.getClass().getComponentType();\n E[] newArray = (E[]) Array.newInstance(classType, this.stack.length*2);\n System.arraycopy(stack, 0, newArray, 0, this.stack.length);\n this.stack = newArray;\n\n this.stack[top] = item;\n top++;\n }\n }", "@Test\n public void testPush() {\n System.out.println(\"push\");\n instance.push(1);\n String expResult = \"[1]\";\n assertEquals(expResult, instance.toString());\n instance.push(2);\n expResult = \"[1, 2]\";\n assertEquals(expResult, instance.toString());\n }", "@Override\r\n\tpublic void push(E e) {\r\n\t\tif (size() == stack.length)\r\n\t\t\texpandArray();\r\n\t\tstack[++t] = e; // increment t before storing new item\r\n\t}", "public T push(T data){\r\n \tboolean sorted = false;\r\n \twhile(!sorted) {\r\n \t\tif(stack1.empty() || data.compareTo(stack1.peek()) < 0) {\r\n \t\t\tstack2.push(data);\r\n \t\t\tsorted = true;\r\n \t\t}else {\r\n \t\t\tstack2.push(stack1.pop());\r\n \t\t}\r\n \t}\r\n \twhile(stack1.size() > 0) {\r\n \t\tstack2.push(stack1.pop());\r\n \t}\r\n \twhile(stack2.size() > 0) {\r\n \t\tstack1.push(stack2.pop());\r\n \t}\r\n \t++this.size;\r\n \treturn data;\r\n }", "void push(int e) {\r\n\t\tif (top==stack.length) {\r\n\t\t\tmakeNewArray();\r\n\t\t}\r\n\t\tstack[top] = e;\r\n\t\ttop++;\r\n\t}", "public void push(Object item) {\r\n\t\tdata.add(item);\r\n\r\n\t}", "public void push(int x) {\n // Write your code here\n if (queue1.isEmpty() && queue2.isEmpty()) {\n queue1.offer(x);\n } else if (!queue1.isEmpty()) {\n queue1.offer(x);\n } else {\n queue2.offer(x);\n }\n }", "public abstract boolean push(BindingSet bs) throws InterruptedException;", "@Override\n\tpublic void push(T element) {\n\t\tif(top == stack.length) \n\t\t\texpandCapacity();\n\t\t\n\t\tstack[top] = element;\n\t\ttop++;\n\n\t}", "public void push(E elem) {\n if (elem != null) {\r\n contents[++top] = elem;\r\n }\r\n\r\n // Usually better to resize after an addition rather than before for\r\n // multi-threading reasons. Although, that is not important for this class.\r\n if (top == contents.length-1) resize();\r\n }", "private final void push(Object ob) {\r\n\t\teval_stack.add(ob);\r\n\t}", "public void push(T value) {\n \tstack.add(value);\n }", "public void push(int x) {\n \tint size = s2.size();\n \tfor(int i = 0; i < size; i++) {\n \t\ts.push(s2.pop());\n \t}\n \ts.push(x);\n }", "public void push(int x) {\n data.add(x);\n }", "void push(int a)\n\t{\n\t // Your code here\n\t top++;\n\t arr[top]=a;\n\t}" ]
[ "0.73343986", "0.73170257", "0.71382475", "0.71098626", "0.71098626", "0.70555276", "0.70555276", "0.70494944", "0.70254177", "0.69737136", "0.6969689", "0.6951466", "0.69196457", "0.6911523", "0.6901472", "0.68925333", "0.688456", "0.68715435", "0.68666965", "0.6855918", "0.6848055", "0.6843143", "0.6826257", "0.68124264", "0.6803375", "0.6792191", "0.677979", "0.6778886", "0.67770135", "0.67770135", "0.6746505", "0.673554", "0.6719424", "0.67053044", "0.6701883", "0.6695261", "0.6686052", "0.6685546", "0.66729134", "0.6661831", "0.6661831", "0.6661712", "0.6623332", "0.6622971", "0.6618128", "0.6617546", "0.6611303", "0.66056305", "0.65976954", "0.65964115", "0.65964115", "0.65964115", "0.65861094", "0.65788543", "0.6573276", "0.6564696", "0.65626717", "0.65562373", "0.6552173", "0.6550638", "0.65489477", "0.6542051", "0.6540216", "0.6535823", "0.65353835", "0.6528025", "0.6516077", "0.6511525", "0.6507477", "0.6500453", "0.649951", "0.649534", "0.64906716", "0.64895004", "0.64813024", "0.6444021", "0.6433994", "0.64263326", "0.6425523", "0.6410593", "0.64097345", "0.64033216", "0.64010024", "0.6381057", "0.6367292", "0.6366897", "0.6366187", "0.63657945", "0.63614374", "0.63609433", "0.63588816", "0.6351223", "0.6349368", "0.6346196", "0.63436604", "0.6343152", "0.6335548", "0.63348067", "0.6325747", "0.63172895", "0.6316609" ]
0.0
-1
Gets the memory location of a register or variable
public static String MEM(String reg) { return String.format("(%s)", reg); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Addr getLocationOnStack() {\n\n\t\tImm immediateStackPointerOffset = new Imm(String.valueOf(this.spOffset));\n\t\tAddr spilledValueLocationOnStack = new Addr(immediateStackPointerOffset, this.sp);\n\t\treturn spilledValueLocationOnStack;\n\t}", "public long memoryAddress()\r\n/* 143: */ {\r\n/* 144:172 */ throw new UnsupportedOperationException();\r\n/* 145: */ }", "public Variable getVariableContaining(int offset);", "Unit findPlace() {\n\t\tif (!availableRegister.isEmpty()) {\n\t\t\tUnit result = availableRegister.firstElement();\n\t\t\tavailableRegister.remove(0);\n\t\t\treturn result;\n\t\t} else {\n\t\t\tint memId = localPos;\n\t\t\tlocalPos++;\n\t\t\treturn new UnitMemory(new String(\"local[\" + String.valueOf(memId) + \"]\"), memId);\n\t\t}\n\t}", "public Local getRegisterLocal(int num) throws InvalidDalvikBytecodeException {\n int totalRegisters = registerLocals.length;\n if (num > totalRegisters) {\n throw new InvalidDalvikBytecodeException(\n \"Trying to access register \"\n + num\n + \" but only \"\n + totalRegisters\n + \" is/are available.\");\n }\n return registerLocals[num];\n }", "static int memory_address_hl(){\n\t\tint hl_address = hexa_to_deci(registers.get('H')+registers.get('L'));\n\t\treturn hl_address;\n\t}", "public int getRegister(int regInd) {\n return regs[regInd];\n }", "private String reg(SSAStatement s) {\n return registers[freeRegisters[s.getRegister()]];\n }", "private int getOperandAddress(final CPU6502Instruction instruction) {\r\n // switch address mode\r\n switch (instruction.addressMode) {\r\n case CPU6502Instruction.ZERO:\r\n return this.memory[this.currentInstructionAddress + 1] & 0xff;\r\n case CPU6502Instruction.ZERO_X:\r\n return ((this.memory[this.currentInstructionAddress + 1] & 0xff) + this.x) & 0xff;\r\n case CPU6502Instruction.ZERO_Y:\r\n return ((this.memory[this.currentInstructionAddress + 1] & 0xff) + this.y) & 0xff;\r\n case CPU6502Instruction.INDIRECT: {\r\n final int lowAddress = this.memory[this.currentInstructionAddress + 1] & 0xff;\r\n final int highAddress = (this.memory[this.currentInstructionAddress + 2] & 0xff) << 8;\r\n\r\n return (readByte(highAddress + lowAddress) & 0xff) + ((readByte(highAddress + ((lowAddress + 1) & 0xff)) & 0xff) << 8);\r\n }\r\n case CPU6502Instruction.INDIRECT_X: {\r\n final int p = ((this.memory[this.currentInstructionAddress + 1] & 0xff) + this.x) & 0xff;\r\n\r\n return (this.memory[p] & 0xff) + ((this.memory[(p + 1) & 0xff] & 0xff) << 8);\r\n }\r\n case CPU6502Instruction.INDIRECT_Y: {\r\n // this is the address on the zero page where we read from\r\n final int p = this.memory[this.currentInstructionAddress + 1] & 0xff;\r\n\r\n // if over page boundary then do another access => one more cycle\r\n final int lowAddress = (this.memory[p] & 0xff) + this.y;\r\n\r\n if (instruction.addPageBoundaryCycle && lowAddress > 0xff) {\r\n ++this.cycles;\r\n }\r\n\r\n return (lowAddress + ((this.memory[(p + 1) & 0xff] & 0xff) << 8)) & 0xffff;\r\n }\r\n case CPU6502Instruction.RELATIVE: {\r\n // calculate relative address\r\n final int address = this.memory[this.currentInstructionAddress + 1] + this.pc;\r\n\r\n // add two cycles if crossing page boundary, otherwise one\r\n this.cycles += ((this.pc) & 0xff00) != (address & 0xff00) ? 2 : 1;\r\n return address;\r\n }\r\n case CPU6502Instruction.ABSOLUTE:\r\n return (this.memory[this.currentInstructionAddress + 1] & 0xff) + ((this.memory[this.currentInstructionAddress + 2] & 0xff) << 8);\r\n case CPU6502Instruction.ABSOLUTE_X:\r\n case CPU6502Instruction.ABSOLUTE_Y: {\r\n // read low-byte of the address\r\n final int lowAddress = (this.memory[this.currentInstructionAddress + 1] & 0xff) + (instruction.addressMode == CPU6502Instruction.ABSOLUTE_Y ? this.y : this.x);\r\n\r\n // if over page boundary then do another access => one more cycle\r\n if (instruction.addPageBoundaryCycle && lowAddress > 0xff) {\r\n ++this.cycles;\r\n }\r\n\r\n return (lowAddress + ((this.memory[this.currentInstructionAddress + 2] & 0xff) << 8)) & 0xffff;\r\n }\r\n\r\n default:\r\n throw new RuntimeException(\"Illegal address mode for instruction \" + instruction.toString() + \" ($\" + Integer.toHexString(instruction.opCode) + \")\");\r\n }\r\n }", "gov.nih.nlm.ncbi.www.CodeBreakDocument.CodeBreak.Loc getLoc();", "public Instruction getInstructionAt(Address addr);", "public int getReturnAddressOffset();", "long getMemory();", "long getMemory();", "long getAddress(ByteBuffer buffer);", "private Integer varOffset( String defun, String varname ) {\n\treturn symbolTable.get( defun ).get( varname );\n }", "public int getX() { return loc.x; }", "public Object getRegister(Register r) {\n int i = r.getNumber(); \n if (s.registers[i] == null) {\n System.err.println(method+\" ::: Reg \"+i+\" is null\");\n System.err.println(this.bb.fullDump());\n }\n if(TRACE_REGISTERS) System.out.println(this.method + \": getting \" + i + \" <- \" + s.registers[i] + \" from \"\n + Arrays.asList(s.registers));\n return s.registers[i];\n }", "public PVector getLocation()\n\t{\n\t\treturn location;\n\t}", "public int getLocation() {\n\t\tint location=super.getLocation();\n\t\treturn location;\n\t}", "public int getLocation()\r\n {\n }", "int locationOffset(Location location);", "public int get_addr() {\n return (int)getUIntElement(offsetBits_addr(), 16);\n }", "public IRLocation getLocation(IRNode node);", "Optional<MemoryAddress> lookup(String name);", "private Access getAvailableReg(Var3 variable) {\n Integer index = getVarIndex(variable);\n HashSet<Integer> description = addrDescriptor.get(index);\n if(!description.isEmpty()) {\n //take the first good register\n for(Integer i : description)\n return new Reg(getArmRegNum(i));\n }\n return null;\n }", "public int getLastInstructionAddress() { return mLastInstructionAddress; }", "public static int offset_addr() {\n return (0 / 8);\n }", "public PVector getLoc() {\n return location;\n }", "public PVector getLoc() {\n return location;\n }", "public Data getDefinedDataAt(Address addr);", "public long getValue(long location) {\n\t\t// we want to access the memory on a word boundary\n\t\tlong memoryAddress = location >> 2;\n\t\t\n\t\t// error if we're out of bounds\n\t\tif (memoryAddress >= memory.size()) {\n\t\t\tthrow new IllegalArgumentException(\"Memory address out of bounds\");\n\t\t}\n\t\t\n\t\t// Return the word we want. Note that it should be safe to\n\t\t// cast memoryAddress to the int required by ArrayList.get because\n\t\t// we know that the given location is at most 32 bits long, so shifting\n\t\t// right two bits should give us a non-negative number every time we\n\t\t// go to cast it.\n\t\treturn memory.get((int)memoryAddress);\n\t}", "public IString getVariableIdentifier() {\n\treturn VARIABLE_IDENTIFIER.get(getNd(), this.address);\n }", "public int getMemory(int index) {\n\t\treturn memory.get(index);\n\t}", "private int getRAMValue(String memVar){\n\t\treturn ram[Integer.parseInt(\n\t\t\t\tCharacter.toString(memVar.charAt(1)))];\n\t}", "static void mov_reg_to_memory(String passed){\n\t\tint memory_address = memory_address_hl();\n\t\tmemory.put(memory_address, registers.get(passed.charAt(6)));\n\t}", "public int getLocation() {\n\t\treturn 0;\n\t}", "IntPoint getLocation();", "public int getLocation()\r\n {\r\n return location;\r\n }", "public int getLocation(int x, int y) {\n\t\treturn board[x][y];\n\t}", "Node getVariable();", "public Instruction getInstructionContaining(Address addr);", "String getLocation();", "String getLocation();", "String getLocation();", "public int memoryBitOffset ( TypeSpec baseType, int bitOffset, int bitWidth )\n{\n if (LITTLE_ENDIAN)\n return bitOffset;\n else // big endian\n return baseType.width - bitOffset - bitWidth;\n}", "public int getX(){\n\t\treturn this.x_location;\n\t}", "String getVariable();", "public static String MEM(String reg, int offset) {\n\t\treturn String.format(\"%d(%s)\", SIZE * offset, reg);\n\t}", "public java.lang.String getRegaddress() {\r\n return localRegaddress;\r\n }", "public int getInstruction(int index){\n \tif (index % 4 != 0){ //check to see if the index is aligned\n\t\t\tSystem.out.println(\"Wrong number for PC\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t\treturn memory[(index / 4)];\n }", "public int getMemoryLoad() { return memoryLoad; }", "public boolean hasMemoryAddress()\r\n/* 138: */ {\r\n/* 139:167 */ return false;\r\n/* 140: */ }", "public final Instruction memory_op() throws RecognitionException {\r\n Instruction inst = null;\r\n\r\n\r\n Instruction getelementptr_op49 =null;\r\n\r\n Instruction alloca_op50 =null;\r\n\r\n Instruction load_op51 =null;\r\n\r\n Instruction store_op52 =null;\r\n\r\n\r\n try {\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:329:5: ( getelementptr_op | alloca_op | load_op | store_op )\r\n int alt46=4;\r\n switch ( input.LA(1) ) {\r\n case GLOBAL_VARIABLE:\r\n {\r\n int LA46_1 = input.LA(2);\r\n\r\n if ( (LA46_1==47) ) {\r\n switch ( input.LA(3) ) {\r\n case 66:\r\n {\r\n alt46=1;\r\n }\r\n break;\r\n case 53:\r\n {\r\n alt46=2;\r\n }\r\n break;\r\n case VOLATILE:\r\n case 74:\r\n {\r\n alt46=3;\r\n }\r\n break;\r\n default:\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 46, 5, input);\r\n\r\n throw nvae;\r\n\r\n }\r\n\r\n }\r\n else {\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 46, 1, input);\r\n\r\n throw nvae;\r\n\r\n }\r\n }\r\n break;\r\n case LOCAL_VARIABLE:\r\n {\r\n int LA46_2 = input.LA(2);\r\n\r\n if ( (LA46_2==47) ) {\r\n switch ( input.LA(3) ) {\r\n case 66:\r\n {\r\n alt46=1;\r\n }\r\n break;\r\n case 53:\r\n {\r\n alt46=2;\r\n }\r\n break;\r\n case VOLATILE:\r\n case 74:\r\n {\r\n alt46=3;\r\n }\r\n break;\r\n default:\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 46, 5, input);\r\n\r\n throw nvae;\r\n\r\n }\r\n\r\n }\r\n else {\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 46, 2, input);\r\n\r\n throw nvae;\r\n\r\n }\r\n }\r\n break;\r\n case UNDEF:\r\n {\r\n int LA46_3 = input.LA(2);\r\n\r\n if ( (LA46_3==47) ) {\r\n switch ( input.LA(3) ) {\r\n case 66:\r\n {\r\n alt46=1;\r\n }\r\n break;\r\n case 53:\r\n {\r\n alt46=2;\r\n }\r\n break;\r\n case VOLATILE:\r\n case 74:\r\n {\r\n alt46=3;\r\n }\r\n break;\r\n default:\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 46, 5, input);\r\n\r\n throw nvae;\r\n\r\n }\r\n\r\n }\r\n else {\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 46, 3, input);\r\n\r\n throw nvae;\r\n\r\n }\r\n }\r\n break;\r\n case VOLATILE:\r\n case 82:\r\n {\r\n alt46=4;\r\n }\r\n break;\r\n default:\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 46, 0, input);\r\n\r\n throw nvae;\r\n\r\n }\r\n\r\n switch (alt46) {\r\n case 1 :\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:329:7: getelementptr_op\r\n {\r\n pushFollow(FOLLOW_getelementptr_op_in_memory_op1899);\r\n getelementptr_op49=getelementptr_op();\r\n\r\n state._fsp--;\r\n\r\n\r\n inst = getelementptr_op49;\r\n\r\n }\r\n break;\r\n case 2 :\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:330:7: alloca_op\r\n {\r\n pushFollow(FOLLOW_alloca_op_in_memory_op1909);\r\n alloca_op50=alloca_op();\r\n\r\n state._fsp--;\r\n\r\n\r\n inst = alloca_op50;\r\n\r\n }\r\n break;\r\n case 3 :\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:331:7: load_op\r\n {\r\n pushFollow(FOLLOW_load_op_in_memory_op1919);\r\n load_op51=load_op();\r\n\r\n state._fsp--;\r\n\r\n\r\n inst = load_op51;\r\n\r\n }\r\n break;\r\n case 4 :\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:332:7: store_op\r\n {\r\n pushFollow(FOLLOW_store_op_in_memory_op1929);\r\n store_op52=store_op();\r\n\r\n state._fsp--;\r\n\r\n\r\n inst = store_op52;\r\n\r\n }\r\n break;\r\n\r\n }\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n\r\n finally {\r\n \t// do for sure before leaving\r\n }\r\n return inst;\r\n }", "java.lang.String getLocation();", "public int get_position(long number) {\n return ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].getInt((int) (number * POINTER_LENGTH % ptr_parts_size[0] + 9));\n }", "public int getLocation(int x, int y) {\n\t\treturn grid[x][y];\n\t}", "private int checkMemLocation(int location) {\n if (location < memory.length && location >= 0) {\n return location;\n }\n throw new MemoryOutOfBounds(memory.length, location);\n }", "public Pixel getPixelLocation() {\n\t\treturn _PixelLocation;\n\t}", "static void mov_memory_to_reg(String passed){\n\t\tint memory_address = memory_address_hl();\n\t\tregisters.put(passed.charAt(4),memory.get(memory_address));\n\t}", "public int getReg(int reg) {\r\n\t\tswitch (reg) {\r\n\t\t\tcase 0:\r\n\t\t\t\treturn m_registers[R0];\r\n\t\t\tcase 1:\r\n\t\t\t\treturn m_registers[R1];\r\n\t\t\tcase 2:\r\n\t\t\t\treturn m_registers[R2];\r\n\t\t\tcase 3:\r\n\t\t\t\treturn m_registers[R3];\r\n\t\t\tcase 4:\r\n\t\t\t\treturn m_registers[R4];\r\n\t\t\tdefault:\r\n\t\t\t\t// Return default (should never be reached)\r\n\t\t\t\treturnError(ERROR_REG_DNE);\r\n\t\t\t\treturn 0;\r\n\t\t}\r\n\t}", "public int getLocationX() {\r\n\t\treturn x;\r\n\t}", "public long storageOffset() {\n return TH.THTensor_(storageOffset)(this);\n }", "public int getProgramMemory(int index)\n {\n int retValue = 0;\n try { retValue = program_memory[index]; }\n catch (ArrayIndexOutOfBoundsException OOB) { }\n return retValue;\n }", "public int getLocationX( )\n\t{\n\t\treturn locationX;\n\t}", "static int findraslot(Memory mem, int addr) {\r\n\t\t// afbf0020 sw [sp +32] = ra\r\n\t\tfor (int n = 0; n < 8; n++) {\r\n\t\t\tint isn = mem.load_word(addr + (n * 4));\r\n\t\t\tif ((isn & 0xffff0000) == 0xafbf0000) {\r\n\t\t\t\tshort imm = (short) isn;\r\n\t\t\t\treturn imm;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn -1;\r\n\t}", "public String location()\n {\n return String.format(\"(%d,%d)\", line, column);\n }", "public int getX()\r\n {\r\n return xLoc;\r\n }", "public int store(int offset) {\n int result = runStack.get(runStack.size()-1);\n runStack.set(framePointers.peek()+offset, runStack.remove(runStack.size()-1));\n return result;\n }", "public int locationOf(E elem) {\r\n\t\tInteger tentativeLoc = this.locations.get(elem);\r\n\t\tif (tentativeLoc == null){\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\treturn this.locations.get(elem);\r\n\t}", "public long readMem(int index) throws Exception{\n\t\tif(index >= 0 && index < Constants.MEM_SIZE)\n\t\t\treturn memory[index];\n\t\telse\n\t\t\tthrow new Exception(\"Illegal memory location, trying to access MEM[\"+index+\"]\");\n\t}", "private Expression addressOf (Expression expression) {\n return expression;\n }", "public String getMem(int loc1, int loc2) {\n String mem = \"\";\n try {\n\n // Make sure given locs are valid\n checkMemLocation(loc1);\n checkMemLocation(loc2);\n int i;\n\n // collect each memory location in a string\n for (i = loc1; i < loc2 + 1; i++) {\n mem += i + \": \" + memory[i] + \" \" + getLabel(memory[i]) + \"\\n\";\n }\n } catch (Exception e) {\n con.cPrintln(\"Error : \" + e.toString());\n return \"Bad Locations\";\n\n } catch (Error e) {\n con.cPrintln(\"Error : \" + e.getMessage());\n return \"Bad Locations\";\n }\n return mem;\n }", "X86.Reg gen_dest_operand();", "public String getVariable();", "String location();", "String location();", "String location();", "String location();", "String location();", "String location();", "String location();", "String location();", "public String variable()\n\t{\n\t\treturn _var;\n\t}", "public Point getLocation();", "private long readJumpOffset() throws IOException {\n byte[] sec = new byte[4];\n ins.read(sec);\n return convertByteValueToLong(sec);\n }", "public int load(int offset){\n return runStack.load(offset);\n }", "public int getUnmanaged() {\n int ret = nextLocal++;\n return ret;\n }", "@DISPID(5) //= 0x5. The runtime will prefer the VTID if present\r\n @VTID(11)\r\n @ReturnValue(type=NativeType.VARIANT)\r\n java.lang.Object currentDevicePosition();", "public MainMemory getMem()\n {\n return mem;\n }", "public String getLocationNumber()\n\t{\n\t\tString locationNo = getContent().substring(OFF_ID27_LOCATION, OFF_ID27_LOCATION + LEN_ID27_LOCATION) ;\n\t\treturn (locationNo);\n\t}", "public long memory() {\n\treturn 0;\n }", "@Override\n\tpublic int read() {\n\t\tint lowByte = getFirstArg();\n\t\tint highByte = getSecondArg();\n\t\tint address = highByte;\n\t\taddress = address << 8;\n\t\taddress |= lowByte;\n\t\treturn CpuMem.getInstance().readMem(address);\n\t}", "public long getAddress() {\n return origin + originOffset;\n }", "int getLocation() throws IllegalStateException;", "int getLocationtypeValue();", "@Override\n public Pointer addressPointer() {\n val tempPtr = new PagedPointer(ptrDataBuffer.primaryBuffer());\n\n switch (this.type) {\n case DOUBLE: return tempPtr.asDoublePointer();\n case FLOAT: return tempPtr.asFloatPointer();\n case UINT16:\n case SHORT:\n case BFLOAT16:\n case HALF: return tempPtr.asShortPointer();\n case UINT32:\n case INT: return tempPtr.asIntPointer();\n case UBYTE:\n case BYTE: return tempPtr.asBytePointer();\n case UINT64:\n case LONG: return tempPtr.asLongPointer();\n case BOOL: return tempPtr.asBoolPointer();\n default: return tempPtr.asBytePointer();\n }\n }", "public String generate(String registerName) {\n var variableType = this.variable.getType();\n var variableSymbol = this.variable.getSymbol();\n var variableLLVMType = JavaTypeToLLVMType.getLLVMType(variableType);\n return \"\\t%\" + registerName + \" = alloca \" + variableLLVMType + \"\\n\";\n }", "public int getVarRef(Variable var) throws ParseException {\r\n\t\tDimensions dims = ((MatrixVariableI) var).getDimensions();\r\n\t\tObjStore store = getStoreByDim(dims);\r\n\t\tint ref = store.addVar((MatrixVariableI) var);\r\n\t\treturn ref;\r\n\t}", "public Location getLocation ( ) {\n\t\treturn extract ( handle -> handle.getLocation ( ) );\n\t}" ]
[ "0.6466579", "0.6395007", "0.619475", "0.61636657", "0.60281837", "0.5974123", "0.5839373", "0.582894", "0.56576073", "0.56184", "0.55833364", "0.55754316", "0.5573069", "0.5573069", "0.5565978", "0.5565942", "0.55628943", "0.5562637", "0.5559602", "0.5557942", "0.55509835", "0.5550913", "0.55458117", "0.5544576", "0.5541121", "0.5540147", "0.5498298", "0.54678696", "0.5466511", "0.5466511", "0.5460124", "0.5455152", "0.54526687", "0.54429424", "0.5431041", "0.54277354", "0.5390508", "0.53612417", "0.5355886", "0.5340904", "0.5334183", "0.5310554", "0.5308999", "0.5308999", "0.5308999", "0.5305863", "0.52651846", "0.52559", "0.52441466", "0.5239658", "0.5237647", "0.5222269", "0.52152634", "0.5214398", "0.5207843", "0.5203424", "0.519964", "0.5191563", "0.5186588", "0.51729167", "0.517219", "0.51694214", "0.5161906", "0.51554865", "0.5147065", "0.51403385", "0.51364756", "0.51311755", "0.51182306", "0.51156443", "0.51119804", "0.510472", "0.5104072", "0.50996304", "0.509114", "0.50904346", "0.50904346", "0.50904346", "0.50904346", "0.50904346", "0.50904346", "0.50904346", "0.50904346", "0.5080807", "0.5075502", "0.5074047", "0.5066235", "0.50593114", "0.50457716", "0.5043994", "0.50348973", "0.50335586", "0.5031976", "0.5026073", "0.50180066", "0.50143677", "0.50106424", "0.5008872", "0.5006226", "0.49828234" ]
0.5153718
64
Gets the memory location of a register or variable
public static String MEM(String reg, int offset) { return String.format("%d(%s)", SIZE * offset, reg); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Addr getLocationOnStack() {\n\n\t\tImm immediateStackPointerOffset = new Imm(String.valueOf(this.spOffset));\n\t\tAddr spilledValueLocationOnStack = new Addr(immediateStackPointerOffset, this.sp);\n\t\treturn spilledValueLocationOnStack;\n\t}", "public long memoryAddress()\r\n/* 143: */ {\r\n/* 144:172 */ throw new UnsupportedOperationException();\r\n/* 145: */ }", "public Variable getVariableContaining(int offset);", "Unit findPlace() {\n\t\tif (!availableRegister.isEmpty()) {\n\t\t\tUnit result = availableRegister.firstElement();\n\t\t\tavailableRegister.remove(0);\n\t\t\treturn result;\n\t\t} else {\n\t\t\tint memId = localPos;\n\t\t\tlocalPos++;\n\t\t\treturn new UnitMemory(new String(\"local[\" + String.valueOf(memId) + \"]\"), memId);\n\t\t}\n\t}", "public Local getRegisterLocal(int num) throws InvalidDalvikBytecodeException {\n int totalRegisters = registerLocals.length;\n if (num > totalRegisters) {\n throw new InvalidDalvikBytecodeException(\n \"Trying to access register \"\n + num\n + \" but only \"\n + totalRegisters\n + \" is/are available.\");\n }\n return registerLocals[num];\n }", "static int memory_address_hl(){\n\t\tint hl_address = hexa_to_deci(registers.get('H')+registers.get('L'));\n\t\treturn hl_address;\n\t}", "public int getRegister(int regInd) {\n return regs[regInd];\n }", "private String reg(SSAStatement s) {\n return registers[freeRegisters[s.getRegister()]];\n }", "private int getOperandAddress(final CPU6502Instruction instruction) {\r\n // switch address mode\r\n switch (instruction.addressMode) {\r\n case CPU6502Instruction.ZERO:\r\n return this.memory[this.currentInstructionAddress + 1] & 0xff;\r\n case CPU6502Instruction.ZERO_X:\r\n return ((this.memory[this.currentInstructionAddress + 1] & 0xff) + this.x) & 0xff;\r\n case CPU6502Instruction.ZERO_Y:\r\n return ((this.memory[this.currentInstructionAddress + 1] & 0xff) + this.y) & 0xff;\r\n case CPU6502Instruction.INDIRECT: {\r\n final int lowAddress = this.memory[this.currentInstructionAddress + 1] & 0xff;\r\n final int highAddress = (this.memory[this.currentInstructionAddress + 2] & 0xff) << 8;\r\n\r\n return (readByte(highAddress + lowAddress) & 0xff) + ((readByte(highAddress + ((lowAddress + 1) & 0xff)) & 0xff) << 8);\r\n }\r\n case CPU6502Instruction.INDIRECT_X: {\r\n final int p = ((this.memory[this.currentInstructionAddress + 1] & 0xff) + this.x) & 0xff;\r\n\r\n return (this.memory[p] & 0xff) + ((this.memory[(p + 1) & 0xff] & 0xff) << 8);\r\n }\r\n case CPU6502Instruction.INDIRECT_Y: {\r\n // this is the address on the zero page where we read from\r\n final int p = this.memory[this.currentInstructionAddress + 1] & 0xff;\r\n\r\n // if over page boundary then do another access => one more cycle\r\n final int lowAddress = (this.memory[p] & 0xff) + this.y;\r\n\r\n if (instruction.addPageBoundaryCycle && lowAddress > 0xff) {\r\n ++this.cycles;\r\n }\r\n\r\n return (lowAddress + ((this.memory[(p + 1) & 0xff] & 0xff) << 8)) & 0xffff;\r\n }\r\n case CPU6502Instruction.RELATIVE: {\r\n // calculate relative address\r\n final int address = this.memory[this.currentInstructionAddress + 1] + this.pc;\r\n\r\n // add two cycles if crossing page boundary, otherwise one\r\n this.cycles += ((this.pc) & 0xff00) != (address & 0xff00) ? 2 : 1;\r\n return address;\r\n }\r\n case CPU6502Instruction.ABSOLUTE:\r\n return (this.memory[this.currentInstructionAddress + 1] & 0xff) + ((this.memory[this.currentInstructionAddress + 2] & 0xff) << 8);\r\n case CPU6502Instruction.ABSOLUTE_X:\r\n case CPU6502Instruction.ABSOLUTE_Y: {\r\n // read low-byte of the address\r\n final int lowAddress = (this.memory[this.currentInstructionAddress + 1] & 0xff) + (instruction.addressMode == CPU6502Instruction.ABSOLUTE_Y ? this.y : this.x);\r\n\r\n // if over page boundary then do another access => one more cycle\r\n if (instruction.addPageBoundaryCycle && lowAddress > 0xff) {\r\n ++this.cycles;\r\n }\r\n\r\n return (lowAddress + ((this.memory[this.currentInstructionAddress + 2] & 0xff) << 8)) & 0xffff;\r\n }\r\n\r\n default:\r\n throw new RuntimeException(\"Illegal address mode for instruction \" + instruction.toString() + \" ($\" + Integer.toHexString(instruction.opCode) + \")\");\r\n }\r\n }", "gov.nih.nlm.ncbi.www.CodeBreakDocument.CodeBreak.Loc getLoc();", "public Instruction getInstructionAt(Address addr);", "public int getReturnAddressOffset();", "long getMemory();", "long getMemory();", "long getAddress(ByteBuffer buffer);", "private Integer varOffset( String defun, String varname ) {\n\treturn symbolTable.get( defun ).get( varname );\n }", "public int getX() { return loc.x; }", "public Object getRegister(Register r) {\n int i = r.getNumber(); \n if (s.registers[i] == null) {\n System.err.println(method+\" ::: Reg \"+i+\" is null\");\n System.err.println(this.bb.fullDump());\n }\n if(TRACE_REGISTERS) System.out.println(this.method + \": getting \" + i + \" <- \" + s.registers[i] + \" from \"\n + Arrays.asList(s.registers));\n return s.registers[i];\n }", "public PVector getLocation()\n\t{\n\t\treturn location;\n\t}", "public int getLocation() {\n\t\tint location=super.getLocation();\n\t\treturn location;\n\t}", "public int getLocation()\r\n {\n }", "int locationOffset(Location location);", "public int get_addr() {\n return (int)getUIntElement(offsetBits_addr(), 16);\n }", "public IRLocation getLocation(IRNode node);", "Optional<MemoryAddress> lookup(String name);", "private Access getAvailableReg(Var3 variable) {\n Integer index = getVarIndex(variable);\n HashSet<Integer> description = addrDescriptor.get(index);\n if(!description.isEmpty()) {\n //take the first good register\n for(Integer i : description)\n return new Reg(getArmRegNum(i));\n }\n return null;\n }", "public int getLastInstructionAddress() { return mLastInstructionAddress; }", "public static int offset_addr() {\n return (0 / 8);\n }", "public PVector getLoc() {\n return location;\n }", "public PVector getLoc() {\n return location;\n }", "public Data getDefinedDataAt(Address addr);", "public long getValue(long location) {\n\t\t// we want to access the memory on a word boundary\n\t\tlong memoryAddress = location >> 2;\n\t\t\n\t\t// error if we're out of bounds\n\t\tif (memoryAddress >= memory.size()) {\n\t\t\tthrow new IllegalArgumentException(\"Memory address out of bounds\");\n\t\t}\n\t\t\n\t\t// Return the word we want. Note that it should be safe to\n\t\t// cast memoryAddress to the int required by ArrayList.get because\n\t\t// we know that the given location is at most 32 bits long, so shifting\n\t\t// right two bits should give us a non-negative number every time we\n\t\t// go to cast it.\n\t\treturn memory.get((int)memoryAddress);\n\t}", "public IString getVariableIdentifier() {\n\treturn VARIABLE_IDENTIFIER.get(getNd(), this.address);\n }", "public int getMemory(int index) {\n\t\treturn memory.get(index);\n\t}", "private int getRAMValue(String memVar){\n\t\treturn ram[Integer.parseInt(\n\t\t\t\tCharacter.toString(memVar.charAt(1)))];\n\t}", "static void mov_reg_to_memory(String passed){\n\t\tint memory_address = memory_address_hl();\n\t\tmemory.put(memory_address, registers.get(passed.charAt(6)));\n\t}", "public int getLocation() {\n\t\treturn 0;\n\t}", "IntPoint getLocation();", "public int getLocation()\r\n {\r\n return location;\r\n }", "public int getLocation(int x, int y) {\n\t\treturn board[x][y];\n\t}", "Node getVariable();", "public Instruction getInstructionContaining(Address addr);", "String getLocation();", "String getLocation();", "String getLocation();", "public int memoryBitOffset ( TypeSpec baseType, int bitOffset, int bitWidth )\n{\n if (LITTLE_ENDIAN)\n return bitOffset;\n else // big endian\n return baseType.width - bitOffset - bitWidth;\n}", "public int getX(){\n\t\treturn this.x_location;\n\t}", "String getVariable();", "public java.lang.String getRegaddress() {\r\n return localRegaddress;\r\n }", "public int getInstruction(int index){\n \tif (index % 4 != 0){ //check to see if the index is aligned\n\t\t\tSystem.out.println(\"Wrong number for PC\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t\treturn memory[(index / 4)];\n }", "public int getMemoryLoad() { return memoryLoad; }", "public boolean hasMemoryAddress()\r\n/* 138: */ {\r\n/* 139:167 */ return false;\r\n/* 140: */ }", "public final Instruction memory_op() throws RecognitionException {\r\n Instruction inst = null;\r\n\r\n\r\n Instruction getelementptr_op49 =null;\r\n\r\n Instruction alloca_op50 =null;\r\n\r\n Instruction load_op51 =null;\r\n\r\n Instruction store_op52 =null;\r\n\r\n\r\n try {\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:329:5: ( getelementptr_op | alloca_op | load_op | store_op )\r\n int alt46=4;\r\n switch ( input.LA(1) ) {\r\n case GLOBAL_VARIABLE:\r\n {\r\n int LA46_1 = input.LA(2);\r\n\r\n if ( (LA46_1==47) ) {\r\n switch ( input.LA(3) ) {\r\n case 66:\r\n {\r\n alt46=1;\r\n }\r\n break;\r\n case 53:\r\n {\r\n alt46=2;\r\n }\r\n break;\r\n case VOLATILE:\r\n case 74:\r\n {\r\n alt46=3;\r\n }\r\n break;\r\n default:\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 46, 5, input);\r\n\r\n throw nvae;\r\n\r\n }\r\n\r\n }\r\n else {\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 46, 1, input);\r\n\r\n throw nvae;\r\n\r\n }\r\n }\r\n break;\r\n case LOCAL_VARIABLE:\r\n {\r\n int LA46_2 = input.LA(2);\r\n\r\n if ( (LA46_2==47) ) {\r\n switch ( input.LA(3) ) {\r\n case 66:\r\n {\r\n alt46=1;\r\n }\r\n break;\r\n case 53:\r\n {\r\n alt46=2;\r\n }\r\n break;\r\n case VOLATILE:\r\n case 74:\r\n {\r\n alt46=3;\r\n }\r\n break;\r\n default:\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 46, 5, input);\r\n\r\n throw nvae;\r\n\r\n }\r\n\r\n }\r\n else {\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 46, 2, input);\r\n\r\n throw nvae;\r\n\r\n }\r\n }\r\n break;\r\n case UNDEF:\r\n {\r\n int LA46_3 = input.LA(2);\r\n\r\n if ( (LA46_3==47) ) {\r\n switch ( input.LA(3) ) {\r\n case 66:\r\n {\r\n alt46=1;\r\n }\r\n break;\r\n case 53:\r\n {\r\n alt46=2;\r\n }\r\n break;\r\n case VOLATILE:\r\n case 74:\r\n {\r\n alt46=3;\r\n }\r\n break;\r\n default:\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 46, 5, input);\r\n\r\n throw nvae;\r\n\r\n }\r\n\r\n }\r\n else {\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 46, 3, input);\r\n\r\n throw nvae;\r\n\r\n }\r\n }\r\n break;\r\n case VOLATILE:\r\n case 82:\r\n {\r\n alt46=4;\r\n }\r\n break;\r\n default:\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 46, 0, input);\r\n\r\n throw nvae;\r\n\r\n }\r\n\r\n switch (alt46) {\r\n case 1 :\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:329:7: getelementptr_op\r\n {\r\n pushFollow(FOLLOW_getelementptr_op_in_memory_op1899);\r\n getelementptr_op49=getelementptr_op();\r\n\r\n state._fsp--;\r\n\r\n\r\n inst = getelementptr_op49;\r\n\r\n }\r\n break;\r\n case 2 :\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:330:7: alloca_op\r\n {\r\n pushFollow(FOLLOW_alloca_op_in_memory_op1909);\r\n alloca_op50=alloca_op();\r\n\r\n state._fsp--;\r\n\r\n\r\n inst = alloca_op50;\r\n\r\n }\r\n break;\r\n case 3 :\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:331:7: load_op\r\n {\r\n pushFollow(FOLLOW_load_op_in_memory_op1919);\r\n load_op51=load_op();\r\n\r\n state._fsp--;\r\n\r\n\r\n inst = load_op51;\r\n\r\n }\r\n break;\r\n case 4 :\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:332:7: store_op\r\n {\r\n pushFollow(FOLLOW_store_op_in_memory_op1929);\r\n store_op52=store_op();\r\n\r\n state._fsp--;\r\n\r\n\r\n inst = store_op52;\r\n\r\n }\r\n break;\r\n\r\n }\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n\r\n finally {\r\n \t// do for sure before leaving\r\n }\r\n return inst;\r\n }", "java.lang.String getLocation();", "public int get_position(long number) {\n return ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].getInt((int) (number * POINTER_LENGTH % ptr_parts_size[0] + 9));\n }", "public int getLocation(int x, int y) {\n\t\treturn grid[x][y];\n\t}", "private int checkMemLocation(int location) {\n if (location < memory.length && location >= 0) {\n return location;\n }\n throw new MemoryOutOfBounds(memory.length, location);\n }", "public Pixel getPixelLocation() {\n\t\treturn _PixelLocation;\n\t}", "static void mov_memory_to_reg(String passed){\n\t\tint memory_address = memory_address_hl();\n\t\tregisters.put(passed.charAt(4),memory.get(memory_address));\n\t}", "public int getReg(int reg) {\r\n\t\tswitch (reg) {\r\n\t\t\tcase 0:\r\n\t\t\t\treturn m_registers[R0];\r\n\t\t\tcase 1:\r\n\t\t\t\treturn m_registers[R1];\r\n\t\t\tcase 2:\r\n\t\t\t\treturn m_registers[R2];\r\n\t\t\tcase 3:\r\n\t\t\t\treturn m_registers[R3];\r\n\t\t\tcase 4:\r\n\t\t\t\treturn m_registers[R4];\r\n\t\t\tdefault:\r\n\t\t\t\t// Return default (should never be reached)\r\n\t\t\t\treturnError(ERROR_REG_DNE);\r\n\t\t\t\treturn 0;\r\n\t\t}\r\n\t}", "public int getLocationX() {\r\n\t\treturn x;\r\n\t}", "public long storageOffset() {\n return TH.THTensor_(storageOffset)(this);\n }", "public int getProgramMemory(int index)\n {\n int retValue = 0;\n try { retValue = program_memory[index]; }\n catch (ArrayIndexOutOfBoundsException OOB) { }\n return retValue;\n }", "public static String MEM(String reg) {\n\t\treturn String.format(\"(%s)\", reg);\n\t}", "public int getLocationX( )\n\t{\n\t\treturn locationX;\n\t}", "static int findraslot(Memory mem, int addr) {\r\n\t\t// afbf0020 sw [sp +32] = ra\r\n\t\tfor (int n = 0; n < 8; n++) {\r\n\t\t\tint isn = mem.load_word(addr + (n * 4));\r\n\t\t\tif ((isn & 0xffff0000) == 0xafbf0000) {\r\n\t\t\t\tshort imm = (short) isn;\r\n\t\t\t\treturn imm;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn -1;\r\n\t}", "public String location()\n {\n return String.format(\"(%d,%d)\", line, column);\n }", "public int getX()\r\n {\r\n return xLoc;\r\n }", "public int store(int offset) {\n int result = runStack.get(runStack.size()-1);\n runStack.set(framePointers.peek()+offset, runStack.remove(runStack.size()-1));\n return result;\n }", "public int locationOf(E elem) {\r\n\t\tInteger tentativeLoc = this.locations.get(elem);\r\n\t\tif (tentativeLoc == null){\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\treturn this.locations.get(elem);\r\n\t}", "public long readMem(int index) throws Exception{\n\t\tif(index >= 0 && index < Constants.MEM_SIZE)\n\t\t\treturn memory[index];\n\t\telse\n\t\t\tthrow new Exception(\"Illegal memory location, trying to access MEM[\"+index+\"]\");\n\t}", "private Expression addressOf (Expression expression) {\n return expression;\n }", "public String getMem(int loc1, int loc2) {\n String mem = \"\";\n try {\n\n // Make sure given locs are valid\n checkMemLocation(loc1);\n checkMemLocation(loc2);\n int i;\n\n // collect each memory location in a string\n for (i = loc1; i < loc2 + 1; i++) {\n mem += i + \": \" + memory[i] + \" \" + getLabel(memory[i]) + \"\\n\";\n }\n } catch (Exception e) {\n con.cPrintln(\"Error : \" + e.toString());\n return \"Bad Locations\";\n\n } catch (Error e) {\n con.cPrintln(\"Error : \" + e.getMessage());\n return \"Bad Locations\";\n }\n return mem;\n }", "X86.Reg gen_dest_operand();", "public String getVariable();", "String location();", "String location();", "String location();", "String location();", "String location();", "String location();", "String location();", "String location();", "public String variable()\n\t{\n\t\treturn _var;\n\t}", "public Point getLocation();", "private long readJumpOffset() throws IOException {\n byte[] sec = new byte[4];\n ins.read(sec);\n return convertByteValueToLong(sec);\n }", "public int load(int offset){\n return runStack.load(offset);\n }", "public int getUnmanaged() {\n int ret = nextLocal++;\n return ret;\n }", "@DISPID(5) //= 0x5. The runtime will prefer the VTID if present\r\n @VTID(11)\r\n @ReturnValue(type=NativeType.VARIANT)\r\n java.lang.Object currentDevicePosition();", "public MainMemory getMem()\n {\n return mem;\n }", "public String getLocationNumber()\n\t{\n\t\tString locationNo = getContent().substring(OFF_ID27_LOCATION, OFF_ID27_LOCATION + LEN_ID27_LOCATION) ;\n\t\treturn (locationNo);\n\t}", "public long memory() {\n\treturn 0;\n }", "@Override\n\tpublic int read() {\n\t\tint lowByte = getFirstArg();\n\t\tint highByte = getSecondArg();\n\t\tint address = highByte;\n\t\taddress = address << 8;\n\t\taddress |= lowByte;\n\t\treturn CpuMem.getInstance().readMem(address);\n\t}", "public long getAddress() {\n return origin + originOffset;\n }", "int getLocation() throws IllegalStateException;", "int getLocationtypeValue();", "@Override\n public Pointer addressPointer() {\n val tempPtr = new PagedPointer(ptrDataBuffer.primaryBuffer());\n\n switch (this.type) {\n case DOUBLE: return tempPtr.asDoublePointer();\n case FLOAT: return tempPtr.asFloatPointer();\n case UINT16:\n case SHORT:\n case BFLOAT16:\n case HALF: return tempPtr.asShortPointer();\n case UINT32:\n case INT: return tempPtr.asIntPointer();\n case UBYTE:\n case BYTE: return tempPtr.asBytePointer();\n case UINT64:\n case LONG: return tempPtr.asLongPointer();\n case BOOL: return tempPtr.asBoolPointer();\n default: return tempPtr.asBytePointer();\n }\n }", "public String generate(String registerName) {\n var variableType = this.variable.getType();\n var variableSymbol = this.variable.getSymbol();\n var variableLLVMType = JavaTypeToLLVMType.getLLVMType(variableType);\n return \"\\t%\" + registerName + \" = alloca \" + variableLLVMType + \"\\n\";\n }", "public int getVarRef(Variable var) throws ParseException {\r\n\t\tDimensions dims = ((MatrixVariableI) var).getDimensions();\r\n\t\tObjStore store = getStoreByDim(dims);\r\n\t\tint ref = store.addVar((MatrixVariableI) var);\r\n\t\treturn ref;\r\n\t}", "public Location getLocation ( ) {\n\t\treturn extract ( handle -> handle.getLocation ( ) );\n\t}" ]
[ "0.6466579", "0.6395007", "0.619475", "0.61636657", "0.60281837", "0.5974123", "0.5839373", "0.582894", "0.56576073", "0.56184", "0.55833364", "0.55754316", "0.5573069", "0.5573069", "0.5565978", "0.5565942", "0.55628943", "0.5562637", "0.5559602", "0.5557942", "0.55509835", "0.5550913", "0.55458117", "0.5544576", "0.5541121", "0.5540147", "0.5498298", "0.54678696", "0.5466511", "0.5466511", "0.5460124", "0.5455152", "0.54526687", "0.54429424", "0.5431041", "0.54277354", "0.5390508", "0.53612417", "0.5355886", "0.5340904", "0.5334183", "0.5310554", "0.5308999", "0.5308999", "0.5308999", "0.5305863", "0.52651846", "0.52559", "0.5239658", "0.5237647", "0.5222269", "0.52152634", "0.5214398", "0.5207843", "0.5203424", "0.519964", "0.5191563", "0.5186588", "0.51729167", "0.517219", "0.51694214", "0.5161906", "0.51554865", "0.5153718", "0.5147065", "0.51403385", "0.51364756", "0.51311755", "0.51182306", "0.51156443", "0.51119804", "0.510472", "0.5104072", "0.50996304", "0.509114", "0.50904346", "0.50904346", "0.50904346", "0.50904346", "0.50904346", "0.50904346", "0.50904346", "0.50904346", "0.5080807", "0.5075502", "0.5074047", "0.5066235", "0.50593114", "0.50457716", "0.5043994", "0.50348973", "0.50335586", "0.5031976", "0.5026073", "0.50180066", "0.50143677", "0.50106424", "0.5008872", "0.5006226", "0.49828234" ]
0.52441466
48
Initializes the constants with the correct 64/32bit names
public static void init() { if(Options.OUTPUT_64BIT) { SIZE = 8; OBJECT = "16(%rbp)"; RET = "-8(%rbp)"; PUSH = "pushq"; POP = "popq"; EAX = "%rax"; EBX = "%rbx"; ECX = "%rcx"; EDX = "%rdx"; EBP = "%rbp"; ESP = "%rsp"; MOV = "movq"; ZMOV = "movzbq"; ADD = "addq"; SUB = "subq"; CMP = "cmpq"; MUL = "imulq"; DIV = "idivq"; XOR = "xorq"; NEG = "negq"; OR = "orq"; AND = "andq"; VCALL = "*" + EBX; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void init () {\r\n\t\t// make sure they all have non-null entries\r\n\t\tName undef = new Name(\"undef\", 'u');\r\n\t\tArrays.fill(op_names, undef);\r\n\t\tArrays.fill(fn_names, undef);\r\n\t\tArrays.fill(cfn_names, undef);\r\n\t\tArrays.fill(rs_names, undef);\r\n\t\tArrays.fill(rt_names, undef);\r\n\r\n\t\tfor (int n = 0; n < 32; n++)\r\n\t\t\treg_nums[n] = \"$\".concat(Integer.toString(n));\r\n\r\n\t\top_names[OP_SPECIAL] = new Name(\"**spec\");\r\n\t\top_names[OP_REGIMM] = new Name(\"**regimm\");\r\n\t\top_names[OP_J] = new Name(\"j\", 'J');\r\n\t\top_names[OP_JAL] = new Name(\"jal\", 'J');\r\n\t\top_names[OP_BEQ] = new Name(\"beq\", 'r');\r\n\t\top_names[OP_BNE] = new Name(\"bne\", 'r');\r\n\t\top_names[OP_BLEZ] = new Name(\"blez\", 'r');\r\n\t\top_names[OP_BGTZ] = new Name(\"bgtz\", 'r');\r\n\t\top_names[OP_ADDIU] = new Name(\"addiu\", 'b');\r\n\t\top_names[OP_SLTI] = new Name(\"slti\", 'b');\r\n\t\top_names[OP_SLTIU] = new Name(\"sltiu\", 'b');\r\n\t\top_names[OP_ANDI] = new Name(\"andi\", 'b');\r\n\t\top_names[OP_ORI] = new Name(\"ori\", 'b');\r\n\t\top_names[OP_XORI] = new Name(\"xori\", 'b');\r\n\t\top_names[OP_LUI] = new Name(\"lui\", 'I');\r\n\t\top_names[OP_COP1] = new Name(\"**cop1\");\r\n\t\top_names[OP_SPEC2] = new Name(\"**spec2\");\r\n\t\top_names[OP_LB] = new Name(\"lb\", 'l');\r\n\t\top_names[OP_LH] = new Name(\"lh\", 'l');\r\n\t\top_names[OP_LWL] = new Name(\"lwl\", 'l');\r\n\t\top_names[OP_LW] = new Name(\"lw\", 'l');\r\n\t\top_names[OP_LBU] = new Name(\"lbu\", 'l');\r\n\t\top_names[OP_LHU] = new Name(\"lhu\", 'l');\r\n\t\top_names[OP_LWR] = new Name(\"lwr\", 'l');\r\n\t\top_names[OP_SB] = new Name(\"sb\", 's');\r\n\t\top_names[OP_SH] = new Name(\"sh\", 's');\r\n\t\top_names[OP_SWL] = new Name(\"swl\", 's');\r\n\t\top_names[OP_SW] = new Name(\"sw\", 's');\r\n\t\top_names[OP_SWR] = new Name(\"swr\", 's');\r\n\t\top_names[OP_LWC1] = new Name(\"lwc1\", 'L');\r\n\t\top_names[OP_SWC1] = new Name(\"swc1\", 'S');\r\n\r\n\t\tfn_names[FN_SLL] = new Name(\"sll\");\r\n\t\tfn_names[FN_SRL] = new Name(\"srl\");\r\n\t\tfn_names[FN_SRA] = new Name(\"sra\");\r\n\t\tfn_names[FN_SLLV] = new Name(\"sllv\");\r\n\t\tfn_names[FN_SRLV] = new Name(\"srlv\");\r\n\t\tfn_names[FN_SRAV] = new Name(\"srav\");\r\n\t\tfn_names[FN_JR] = new Name(\"jr\", 'j');\r\n\t\tfn_names[FN_JALR] = new Name(\"jalr\", 'j');\r\n\t\tfn_names[FN_MOVN] = new Name(\"movn\", 'u');\r\n\t\tfn_names[FN_SYSCALL] = new Name(\"**sys\");\r\n\t\tfn_names[FN_BREAK] = new Name(\"**break\");\r\n\t\tfn_names[FN_MFHI] = new Name(\"mfhi\");\r\n\t\tfn_names[FN_MFLO] = new Name(\"mflo\");\r\n\t\tfn_names[FN_MULT] = new Name(\"mult\");\r\n\t\tfn_names[FN_MULTU] = new Name(\"multu\");\r\n\t\tfn_names[FN_DIV] = new Name(\"div\");\r\n\t\tfn_names[FN_DIVU] = new Name(\"divu\");\r\n\t\tfn_names[FN_ADDU] = new Name(\"addu\", 'B');\r\n\t\tfn_names[FN_SUBU] = new Name(\"subu\", 'B');\r\n\t\tfn_names[FN_AND] = new Name(\"and\", 'B');\r\n\t\tfn_names[FN_OR] = new Name(\"or\", 'B');\r\n\t\tfn_names[FN_XOR] = new Name(\"xor\", 'B');\r\n\t\tfn_names[FN_NOR] = new Name(\"nor\", 'B');\r\n\t\tfn_names[FN_SLT] = new Name(\"slt\", 'B');\r\n\t\tfn_names[FN_SLTU] = new Name(\"sltu\", 'B');\r\n\r\n\t\trs_names[RS_MF] = new Name(\"mfc1\", '6');\r\n\t\trs_names[RS_CF] = new Name(\"cfc1\", '4');\r\n\t\trs_names[RS_MT] = new Name(\"mtc1\", '5');\r\n\t\trs_names[RS_CT] = new Name(\"ctc1\");\r\n\t\trs_names[RS_BC] = new Name(\"bc1\");\r\n\t\trs_names[RS_FMT_SINGLE] = new Name(\"**fmts\");\r\n\t\trs_names[RS_FMT_DOUBLE] = new Name(\"**fmtd\");\r\n\t\trs_names[RS_FMT_WORD] = new Name(\"**fmtw\");\r\n\r\n\t\tcfn_names[CFN_ADD_D] = new Name(\"add\", '3');\r\n\t\tcfn_names[CFN_SUB_D] = new Name(\"sub\", '3');\r\n\t\tcfn_names[CFN_MUL_D] = new Name(\"mul\", '3');\r\n\t\tcfn_names[CFN_DIV_D] = new Name(\"div\", '3');\r\n\t\tcfn_names[CFN_MOV_D] = new Name(\"mov\", '2'); // 2?\r\n\t\tcfn_names[CFN_NEG_D] = new Name(\"neg\", '2');\r\n\t\tcfn_names[CFN_CVTS] = new Name(\"cvts\", '2'); // all type 2\r\n\t\tcfn_names[CFN_CVTD] = new Name(\"cvtd\", '2');\r\n\t\tcfn_names[CFN_CVTW] = new Name(\"cvtw\", '2');\r\n\t\tcfn_names[CFN_FC_ULT] = new Name(\"ult\", 'c');\r\n\t\tcfn_names[CFN_FC_EQ] = new Name(\"eq\", 'c'); // all type c\r\n\t\tcfn_names[CFN_FC_LT] = new Name(\"lt\", 'c');\r\n\t\tcfn_names[CFN_FC_LE] = new Name(\"le\", 'c');\r\n\r\n\t\trt_names[RT_BLTZ] = new Name(\"bltz\", 'v');\r\n\t\trt_names[RT_BGEZ] = new Name(\"bgez\", 'v');\r\n\t\trt_names[RT_BLTZAL] = new Name(\"bltzal\", 'v');\r\n\t\trt_names[RT_BGEZAL] = new Name(\"bgezal\", 'v');\r\n\t}", "private Bits32() {\r\n }", "private static native long init();", "private LabelUtilsConstants() {}", "private USBConstant() {\r\n\r\n\t}", "private ZipConstants() {}", "private native static void initIDs();", "private static native void initIDs();", "private static native void initIDs();", "private static native void initIDs();", "private FTConfigConstants() {\n }", "private void initializeNumbers() {\n\t\tthis.longitude_e6=Integer.MIN_VALUE;\n\t\tthis.latitude_e6=Integer.MIN_VALUE;\n\t\tthis.visibilityRadius=Integer.MIN_VALUE;\n\t\tthis.visibilityLongitude_e6=Integer.MIN_VALUE;\n\t\tthis.visibilityLatitude_e6=Integer.MIN_VALUE;\n\t\tthis.joinRadius=Integer.MIN_VALUE;\n\t\tthis.joinLongitude_e6=Integer.MIN_VALUE;\n\t\tthis.joinLatitude_e6=Integer.MIN_VALUE;\n\t\tthis.joinStartTime=Long.MIN_VALUE;\n\t\tthis.joinEndTime=Long.MIN_VALUE;\n\t\tthis.startTime=Long.MIN_VALUE;\n\t\tthis.endTime=Long.MIN_VALUE;\n\t}", "private static void Initialize()\n\t{\n\t\tcurrentPC = 3996;\n\t\tcurrentFilePointer = 0;\n\t\tmemoryBlocks = new int[4000];\n\t\tregisterFile = new HashMap<String, Integer>();\n\t\tstages = new HashMap<String, Instruction>();\n\t\tlatches = new HashMap<String, Instruction>();\n\t\tspecialRegister = 0;\n\t\tisComplete = false;\n\t\tisValidSource = true;\n\t\tSystem.out.println(\"-----Initialization Completed------\");\n\t}", "protected void init()\n {\n m_fModified = false;\n m_fLoaded = false;\n m_abClazz = null;\n m_clzName = null;\n m_clzSuper = null;\n m_pool = new ConstantPool(this);\n m_flags = new AccessFlags();\n m_tblInterface = new StringTable();\n m_tblField = new StringTable();\n m_tblMethod = new StringTable();\n m_tblAttribute = new StringTable();\n\n CONTAINED_TABLE[0] = m_tblField;\n CONTAINED_TABLE[1] = m_tblMethod;\n CONTAINED_TABLE[2] = m_tblAttribute;\n }", "public void init() {\n\t\tinit(\"1,0 3,0 5,0 7,0 9,0 0,1 2,1 4,1 6,1 8,1 1,2 3,2 5,2 7,2 9,2 0,3 2,3 4,3 6,3 8,3\", \n\t\t\t \"1,6 3,6 5,6 7,6 9,6 0,7 2,7 4,7 6,7 8,7 1,8 3,8 5,8 7,8 9,8 0,9 2,9 4,9 6,9 8,9\"); \n }", "public Initialization()\r\n {\r\n C.cinit();\r\n init(\"2\",0);\r\n \r\n init(\"2\",1);\r\n \r\n init(\"4\",2);\r\n init(\"4\",3);\r\n init(\"4\",4);//ss\r\n init(\"6\",5);\r\n init(\"6\",6);\r\n init(\"6\",7); //ss\r\n init(\"8\",8);\r\n init(\"8\",9);\r\n init(\"8\",10);//ss4 7 10\r\n }", "private CommonUIConstants()\n {\n }", "public static void __init() {\r\n\t\t__name__ = new str(\"code\");\r\n\r\n\t\t/**\r\n\t\t copyright Sean McCarthy, license GPL v2 or later\r\n\t\t*/\r\n\t\tdefault_0 = null;\r\n\t\tcl_Code = new class_(\"Code\");\r\n\t}", "private Constants() {\n }", "private Constants() {\n }", "static void initConstants(MainWindow wnd, File wDirectory, File rFile) {\n window = wnd;\n workingDirectory = wDirectory;\n remainderFile = rFile;\n inputFiles = buildFilesArray();\n offerNodes = buildNodesMap(OFFER);\n doublesNodes = buildNodesMap(DOUBLES);\n }", "private static native long nativeInitialize(int arch, int mode) throws UnicornException;", "public void init() {\n C21671bd.m72528a(this);\n C18895c.m61670a((C19222b) new C22204a());\n C18895c.m61669a(C21764o.f58278a);\n }", "private Constants() {\n\n }", "private LevelConstants() {\n\t\t\n\t}", "public Constants() {\n }", "private TOTPAuthenticatorConstants() {\n\t}", "public interface Constants {\r\n\r\n /** The factory. */\r\n FieldFactory FACTORY = new FieldFactoryImpl();\r\n\r\n /** The 64 K chunk size */\r\n int _64K = 40 * 40 * 40;\r\n\r\n /** The Aligned 64 compiler */\r\n Aligned64Compiler ALIGNED64 = new Aligned64Compiler();\r\n\r\n /** Number of Elements to be READ */\r\n int ELEMENTS_READ = _64K;\r\n\r\n /** Number of Elements to be Written */\r\n int ELEMENTS_WRITTEN = _64K;\r\n\r\n /** The packed compiler*/\r\n CompilerBase PACKED = new PackedCompiler();\r\n\r\n /** The * iterations. */\r\n int _ITERATIONS = 20;\r\n\r\n /** The read iterations. */\r\n int READ_ITERATIONS = _ITERATIONS;\r\n\r\n /** The read union iterations. */\r\n int READ_ITERATIONS_UNION = _ITERATIONS;\r\n\r\n /** The write iterations non-transactional. */\r\n int WRITE_ITERATIONS_NON_TRANSACTIONAL = _ITERATIONS;\r\n\r\n /** The write iterations transactional. */\r\n int WRITE_ITERATIONS_TRANSACTIONAL = _ITERATIONS;\r\n\r\n /** The write union iterations non-transactional. */\r\n int WRITE_ITERATIONS_UNION_NON_TRANSACTIONAL = _ITERATIONS;\r\n\r\n /** The write union iterations transactional. */\r\n int WRITE_ITERATIONS_UNION_TRANSACTIONAL = _ITERATIONS;\r\n\r\n}", "private void LoadCoreValues()\n\t{\n\t\tString[] reservedWords = \t{\"program\",\"begin\",\"end\",\"int\",\"if\",\"then\",\"else\",\"while\",\"loop\",\"read\",\"write\"};\n\t\tString[] specialSymbols = {\";\",\",\",\"=\",\"!\",\"[\",\"]\",\"&&\",\"||\",\"(\",\")\",\"+\",\"-\",\"*\",\"!=\",\"==\",\"<\",\">\",\"<=\",\">=\"};\n\t\t\n\t\t//Assign mapping starting at a value of 1 for reserved words\n\t\tfor (int i=0;i<reservedWords.length;i++)\n\t\t{\n\t\t\tcore.put(reservedWords[i], i+1);\n\t\t}\n\t\t//Assign mapping for special symbols\n\t\tfor (int i=0; i<specialSymbols.length; i++)\n\t\t{\t\n\t\t\tcore.put(specialSymbols[i], reservedWords.length + i+1 );\n\t\t}\n\t}", "public void initRegisters() {\n\tProcessor processor = Machine.processor();\n\n\t// by default, everything's 0\n\tfor (int i=0; i<processor.numUserRegisters; i++)\n\t processor.writeRegister(i, 0);\n\n\t// initialize PC and SP according\n\tprocessor.writeRegister(Processor.regPC, initialPC);\n\tprocessor.writeRegister(Processor.regSP, initialSP);\n\n\t// initialize the first two argument registers to argc and argv\n\tprocessor.writeRegister(Processor.regA0, argc);\n\tprocessor.writeRegister(Processor.regA1, argv);\n }", "private native static long init(long avi);", "@Test\n\tpublic void testPublicConstants() {\n\t\tip = new ImagePlus();\n\t\tassertEquals(0,ImagePlus.GRAY8);\n\t\tassertEquals(1,ImagePlus.GRAY16);\n\t\tassertEquals(2,ImagePlus.GRAY32);\n\t\tassertEquals(3,ImagePlus.COLOR_256);\n\t\tassertEquals(4,ImagePlus.COLOR_RGB);\n\t}", "@Override\n\tpublic long as32Bit() throws AssembleError {\n\t\treturn 0;\n\t}", "protected NConstants() {\n }", "private Constantes() {\r\n\t\t// No way\r\n\t}", "private static native void init();", "private VolumeDataConstants() {\r\n \r\n }", "static void init() {}", "private DVSTestConstants()\n {\n\n }", "private CellManagerConstants() { \r\n throw new AssertionError();\r\n }", "private void initialize() {\n\t\tfor(String key: count_e_f.keySet()){\n\t\t\tcount_e_f.put(key, 0.0);\n\t\t}\n\t\t\n\t\tfor(Integer key: total_f.keySet()){\n\t\t\ttotal_f.put(key, 0.0);\n\t\t}\n\t\t\n\t\t//This code is not efficient.\n//\t\tfor(Entry<String, Integer> german : mainIBM.gerWordsIdx.entrySet()){\n//\t\t\tfor(Entry<String, Integer> english : mainIBM.engWordsIdx.entrySet()){\n//\t\t\t\tcount_e_f.put(english.getValue() + \"-\" + german.getValue(), 0.0);\n//\t\t\t}\n//\t\t\ttotal_f.put(german.getValue(), 0.0);\n//\t\t}\t\n\n\t}", "public void init (){\n for (int i = 0; i < tvalores.length; i++) {\n tvalores[i] = Almacen1.LIBRE;\n }\n valoresAlmacenados = 0;\n }", "private static void init() {\n __lib = new JnaGmpLib();\n }", "private static int initHash() {\n return 0x811c9DC5; // unsigned 2166136261\n }", "public interface C0557b {\n public static final Tile f2819b;\n\n static {\n f2819b = new Tile(-1, -1, null);\n }", "public static void initialize()\n\t{\n\t\t// USB\n\t\tdriveJoystick = new EJoystick(getConstantAsInt(USB_DRIVE_STICK));\n\t\tcontrolGamepad = new EGamepad(getConstantAsInt(USB_CONTROL_GAMEPAD));\n\n\t\t// Power Panel\n\t\tpowerPanel = new PowerDistributionPanel();\n\n\t\t//Compressor\n\t\tcompressor = new Compressor(Constants.getConstantAsInt(Constants.PCM_CAN));\n\t\tcompressor.start();\n\t}", "private void init() {\n _capacity = 1 << 9;\n int holderSize = _capacity << 1;\n _keyValueHolder = new int[holderSize];\n _mask = holderSize - 1;\n _maxNumEntries = (int) (_capacity * LOAD_FACTOR);\n }", "protected void initialize() {\n\t\tLiquidCrystal lcd = RobotMap.lcd;\n\t\tlcd.clear();\n\n\t\tRobotMap.chassisfrontLeft.set(0);\n\t\tRobotMap.chassisfrontRight.set(0);\n\t\tRobotMap.chassisrearRight.set(0);\n\t\tRobotMap.climberclimbMotor.set(0);\n\t\tRobotMap.floorfloorLift.set(0);\n\t\tRobotMap.acquisitionacquisitionMotor.set(0);\n\n\t\t\n\t\t}", "public interface Constants extends ShareConstants {\n String FASTDEX_DIR = \"fastdex\";\n String PATCH_DIR = \"patch\";\n String TEMP_DIR = \"temp\";\n String DEX_DIR = \"dex\";\n String OPT_DIR = \"opt\";\n String RES_DIR = \"res\";\n}", "public Adler32() {\n }", "private GPSConst()\n\t{\n\t\t\n\t}", "void init() {\n\t\tinitTypes();\n\t\tinitGlobalFunctions();\n\t\tinitFunctions();\n\t\tinitClasses();\n\t}", "protected void initVars() {}", "private PuzzleConstants() {\n // not called\n }", "public interface DublinCoreConstants {\n \n /** Creates a new instance of Class */\n public static int DC_TITLE = 0;\n public static int DC_CREATOR = 1;\n public static int DC_SUBJECT = 2;\n public static int DC_DATE = 3;\n public static int DC_TYPE= 4;\n public static int DC_FORMAT= 5;\n public static int DC_IDENTIFIER = 6;\n public static int DC_COLLECTION = 7;\n public static int DC_COVERAGE = 8;\n \n public static int SUPPORTED_NUMBER = 9;\n \n public static final String[] DC_FIELDS = {\"title\",\"creator\",\"subject\",\"date\",\"type\",\"format\",\"identifier\",\"collection\",\"coverage\"};\n public static final String DC_NAMESPACE = \"dc:\";\n \n}", "public interface Constants {\r\n\r\n\tpublic final static int UP = 1000;\r\n\tpublic final static int DOWN = 1001;\r\n\tpublic final static int RIGHT = 1002;\r\n\tpublic final static int LEFT = 1003;\r\n\t\r\n\t\r\n\tpublic final static int EMPTY = 0;\r\n\tpublic final static int ROAD = 1;\r\n\tpublic final static int TOWER = 2;\r\n\tpublic final static int NPC = 3;\r\n\tpublic final static int NPC_GENERATOR = 4;\r\n\tpublic final static int CASTLE = 5;\r\n\tpublic final static int LANDSCAPE = 6;\r\n\t\r\n\tpublic final static int LANDSCAPE_TREE_1 = 61;\r\n\tpublic final static int LANDSCAPE_TREE_2 = 62;\r\n\tpublic final static int LANDSCAPE_TREE_3 = 63;\r\n\t\r\n\tpublic final static int FIELD_END = 7;\r\n\t\r\n}", "protected native void init();", "@Override\n public void init() {\n leftDrive = hardwareMap.get(DcMotor.class, \"left_drive\");\n rightDrive = hardwareMap.get(DcMotor.class, \"right_drive\");\n }", "private void setNulls() {\n mEnum = null;\n mString = null;\n mCharSequence = null;\n //mBoolean = true;\n mBoolByte = BooleanDataType.NULL;\n mChar = CharDataType.NULL;\n mDateTime = DateTimeDataType.NULL;\n mTimeOfDay = TimeOfDayDataType.NULL;\n\n mByte = IntegerDataType.INT8_NULL;\n mShort = IntegerDataType.INT16_NULL;\n mInt = IntegerDataType.INT32_NULL;\n mInt48 = IntegerDataType.INT48_NULL;\n mLong = IntegerDataType.INT64_NULL;\n mFloat = FloatDataType.IEEE32_NULL;\n mDouble = FloatDataType.IEEE64_NULL;\n //mDouble2 = FloatDataType.IEEE64_NULL;\n mPUINT30 = IntegerDataType.PUINT30_NULL;\n mPUINT61 = IntegerDataType.PUINT61_NULL;\n mPIneterval = IntegerDataType.PINTERVAL_NULL;\n mSCALE_AUTO = FloatDataType.DECIMAL_NULL;\n mSCALE4 = FloatDataType.DECIMAL_NULL;\n }", "public void robotInit() {\r\n try {\r\n FileConnection fc;\r\n InputStreamReader reader;\r\n char[] word = new char[100000];\r\n char check = 0;\r\n int count = 0;\r\n int length;\r\n int k;\r\n int decimal;\r\n double[] constants = new double[50];\r\n\r\n fc = (FileConnection) Connector.open(\"file:///\" + \"Constants.txt\", Connector.READ);\r\n reader = new InputStreamReader(fc.openInputStream());\r\n reader.read(word);\r\n k = 0;\r\n while (check != '*') {\r\n while (check != '=') {\r\n check = word[count];\r\n count++;\r\n }\r\n length = word[count];\r\n\r\n count += 2;\r\n\r\n decimal = 0;\r\n \r\n for (int i = 1; i <= length; i++) {\r\n if(word[count] == '.'){\r\n decimal = length - i;\r\n constants[k] /= 10;\r\n }\r\n constants[k] += tenPower(length - i) * (double)(word[count++]);\r\n }\r\n constants[k] /= tenPower(decimal);\r\n k++;\r\n check = word[++count];\r\n }\r\n } catch (IOException ex) {\r\n ex.printStackTrace();\r\n }\r\n }", "private Constants() {\n\t\tthrow new AssertionError();\n\t}", "static void init(int[] referenceBits, int leap) {\n\t\treferenceBits[0] = 0;\n\t\treferenceBits[1] = leap;\n\t\treferenceBits[2] = 0;\n\t\treferenceBits[3] = 0;\n\t}", "public interface Constants {\r\n public static final String APPLE_PRODUCT_CODE = \"APP1456\";\r\n public static final String ORANGE_PRODUCT_CODE = \"ORG3456\";\r\n public static final Double APPLE_PRODUCT_PRICE = 0.60;\r\n public static final Double ORANGE_PRODUCT_PRICE = 0.25;\r\n public static final int MAGIC_NUMBER_ZERO = 0;\r\n public static final int MAGIC_NUMBER_TWO = 2;\r\n public static final int MAGIC_NUMBER_THREE = 3;\r\n public static final int MAGIC_NUMBER_FIVE = 5;\r\n public static final int MAGIC_NUMBER_SEVEN = 7;\r\n public static final int MAGIC_NUMBER_NINE = 9;\r\n}", "public interface InitConstant {\n /**\n * 配置参数的key\n */\n String INITIALIZER_MODULE_NAME = \"INITIALIZER_MODULE_NAME\";\n /**\n * 支持注解的全类名\n */\n String SUPPORT_ANNOTATION_QUALIFIED_NAME = \"rocketzly.componentinitializer.annotation.Init\";\n /**\n * 生成类名前缀\n */\n String GENERATE_CLASS_NAME_PREFIX = \"InitializerContainer_\";\n /**\n * 生成类的包名\n */\n String GENERATE_PACKAGE_NAME = \"rocketzly.componentinitializer.generate\";\n /**\n * 生成同步list名\n */\n String GENERATE_FIELD_SYNC_LIST = \"syncList\";\n /**\n * 生成异步list名\n */\n String GENERATE_FIELD_ASYNC_LIST = \"asyncList\";\n /**\n * 获取同步初始化方法的方法名\n */\n String GENERATE_METHOD_GET_SYNC_NAME = \"getSyncInitMethodList\";\n /**\n * 获取异步初始化方法的方法名\n */\n String GENERATE_METHOD_GET_ASYNC_NAME = \"getAsyncInitMethodList\";\n /**\n * log\n */\n String NO_MODULE_NAME_TIPS = \"These no module name, at 'build.gradle', like :\\n\" +\n \"android {\\n\" +\n \" defaultConfig {\\n\" +\n \" ...\\n\" +\n \" javaCompileOptions {\\n\" +\n \" annotationProcessorOptions {\\n\" +\n \" arguments = [INITIALIZER_MODULE_NAME: project.name]\\n\" +\n \" }\\n\" +\n \" }\\n\" +\n \" }\\n\" +\n \"}\\n\";\n\n}", "public static void init() {}", "public /*static*/ native void init();", "private Constants(){\n }", "public void initConstants() {\n //-0.85832\n double approxAngle = -0.84532;\n fac = Params.arrowSpeed;\n\n switch (course) {\n case 0: //TL\n offsetY = 0;\n offsetX = -15;\n angle = -approxAngle; // In rad, approximation with Maple\n fac *= -1;\n offsetShadow = new Point(12, 0);\n GoffsetArrow = new Point(16, -12);\n break;\n case 1: //TR\n angle = approxAngle;\n offsetY = -8;\n offsetX = -2;\n offsetShadow = new Point(-25, 0);\n GoffsetArrow = new Point(-30, -20);\n break;\n case 2: //R\n offsetY = 0;\n offsetX = 0;\n offsetShadow = new Point(-5, -12);\n GoffsetArrow = new Point(-10, -25);\n break;\n case 3: //BR\n angle = -approxAngle;\n offsetX = -16;\n offsetY = -5;\n offsetShadow = new Point(10, 0);\n GoffsetArrow = new Point(12, -15);\n break;\n case 4: //BL\n angle = approxAngle; // In rad, approximation with Maple\n fac *= -1;\n offsetY = -1;\n offsetX = 1;\n offsetShadow = new Point(-25, 0);\n GoffsetArrow = new Point(-22, -20);\n break;\n case 5: //L\n offsetY = 0;\n offsetX = 0;\n offsetShadow = new Point(-5, -12);\n GoffsetArrow = new Point(-8, -25);\n break;\n default: //TL\n try {\n throw (new Exception(\"Wrong ori\"));\n } catch (Exception e) {\n }\n break;\n }\n }", "public void init() throws BuildException {\n setJavaVersionProperty();\n \n ComponentHelper.getComponentHelper(this).initDefaultDefinitions();\n \n setSystemProperties();\n }", "public static void init() {\n\t\t\n\t}", "private native String native_init();", "private ParallelGatewayConstant() {\n }", "private SecurityConsts()\r\n\t{\r\n\r\n\t}", "private Constants() {\n throw new AssertionError();\n }", "protected void initialize() {\n \t_finalTickTargetLeft = _ticksToTravel + Robot.driveTrain.getEncoderLeft();\n \t_finalTickTargetRight = _ticksToTravel + Robot.driveTrain.getEncoderRight();\n \t\n }", "protected void aInit()\n {\n \ta_available=WindowSize;\n \tLimitSeqNo=WindowSize*2;\n \ta_base=1;\n \ta_nextseq=1;\n }", "public static void initialize(int size)\n {\n constants = new TermConstant[size];\n\n for (int i = 0; i < size; i++)\n constants[i] = new TermConstant(i);\n }", "public interface Constants {\n public static final short NET_MASK_MAX_LENGTH = 32;\n}", "private ApplicationConstants(){\n\t\t//not do anything \n\t}", "private void setupPrimitiveTypes()\n {\n primitiveTypes.add(INTEGER_TYPE);\n primitiveTypes.add(FLOAT_TYPE);\n primitiveTypes.add(DOUBLE_TYPE);\n primitiveTypes.add(STRING_TYPE);\n primitiveTypes.add(BOOL_TYPE);\n primitiveTypes.add(TIMESTAMP_TYPE);\n }", "private RBACConstants() {\r\n }", "public static void init() {\r\n try {\r\n defaultImplementation = new LinkLayer_Impl_PC();\r\n } catch (IOException e) {\r\n Log.e(TAG, e, \"Failed in creating defaultImplementation!\");\r\n }\r\n }", "@VisibleForTesting\n public void initialize() {\n initializeNative();\n }", "protected void initialize() {\n \tstartTime = System.currentTimeMillis();\n \tintake.setLeftPower(power);\n \tintake.setRightPower(power);\n }", "protected void init() {\n \t\r\n ratios.put(1, 32.0f);\r\n ratios.put(2, 16.0f);\r\n ratios.put(3, 8.0f);\r\n ratios.put(4, 4.0f);\r\n ratios.put(5, 2.0f);\r\n ratios.put(6, 1.0f);\r\n }", "private void initTables()\n {\n if ( vc == null )\n {\n // statics are not initialised yet\n vc = new char[ 64 ];\n cv = new int[ 256 ];\n // build translate valueToChar table only once.\n // 0..25 -> 'A'..'Z'\n for ( int i = 0; i <= 25; i++ )\n {\n vc[ i ] = ( char ) ( 'A' + i );\n }\n // 26..51 -> 'a'..'z'\n for ( int i = 0; i <= 25; i++ )\n {\n vc[ i + 26 ] = ( char ) ( 'a' + i );\n }\n // 52..61 -> '0'..'9'\n for ( int i = 0; i <= 9; i++ )\n {\n vc[ i + 52 ] = ( char ) ( '0' + i );\n }\n vc[ 62 ] = spec1;\n vc[ 63 ] = spec2;\n // build translate charToValue table only once.\n for ( int i = 0; i < 256; i++ )\n {\n cv[ i ] = IGNORE;// default is to ignore\n }\n for ( int i = 0; i < 64; i++ )\n {\n cv[ vc[ i ] ] = i;\n }\n cv[ spec3 ] = PAD;\n }\n valueToChar = vc;\n charToValue = cv;\n }", "private void initHardware(){\n }", "public static void initialiseKnightLookupTable() {\n\t\tfor (int square = 0; square < 64; square++) {\n\t\t\tlong target = 1L << square;\n\t\t\t// Each direction of the knight moves considered\n\t\t\t// The AND operator is used to stop moves from wrapping around the\n\t\t\t// board\n\t\t\tlong NNE = (target << 17) & ~CoreConstants.FILE_A;\n\t\t\tlong NEE = (target << 10) & ~CoreConstants.FILE_A & ~CoreConstants.FILE_B;\n\t\t\tlong SEE = (target >>> 6) & ~CoreConstants.FILE_A & ~CoreConstants.FILE_B;\n\t\t\tlong SSE = (target >>> 15) & ~CoreConstants.FILE_A;\n\t\t\tlong NNW = (target << 15) & ~CoreConstants.FILE_H;\n\t\t\tlong NWW = (target << 6) & ~CoreConstants.FILE_G & ~CoreConstants.FILE_H;\n\t\t\tlong SWW = (target >>> 10) & ~CoreConstants.FILE_G & ~CoreConstants.FILE_H;\n\t\t\tlong SSW = (target >>> 17) & ~CoreConstants.FILE_H;\n\n\t\t\tCoreConstants.KNIGHT_TABLE[square] = NNE | NEE | SEE | SSE | NNW | NWW | SWW | SSW;\n\t\t}\n\t}", "protected void init()\n {\n crypterString = crypterLong = crypterDouble = crypterBytes = new MauiCrypterEngineNull();\n }", "private void initStaticDocumentVerifiStateStrings() {\n\t\tif(m_aDOCUMENT_VERIF_STATE_CONDT_STRINGS == null) {\n\t\t\t//init it once per element\n\t\t\tm_aDOCUMENT_VERIF_STATE_CONDT_STRINGS = new Hashtable<String, String>(10);\n\t\t\tif(m_aRegAcc == null)\n\t\t\t\tm_aRegAcc = new MessageConfigurationAccess(getComponentContext(), getMultiComponentFactory());\n\t\t\tif(m_aRegAcc != null) {\n\t\t\t\t\n\t\t\t\tfor(int st = 0; st < m_sDOCUMENT_VERIF_STATE.length; st++ ) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tm_aDOCUMENT_VERIF_STATE_CONDT_STRINGS.put(m_sDOCUMENT_VERIF_STATE[st], \n\t\t\t\t\t\t\t\tm_aRegAcc.getStringFromRegistry(m_sDOCUMENT_VERIF_STATE[st])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t );\n\t\t\t\t\t} catch (com.sun.star.uno.Exception e) {\n\t\t\t\t\t\tgetLogger().severe(e);\n\t\t\t\t\t}\n\t\t }\n\t\t\t}\n\t\t}\t\t\n\t}", "private static native void initCachedClassMap();", "public interface Constants {\n int BYTES_PER_FLOAT = 4;\n}", "private void _init() {\n }", "private static native long nativeInit(long otherMultisetPtr);", "public interface ImageConstants {\n\n\tpublic String SLIPS_UI_BUTTON_IMG=\"/images/Slips_Active.gif\";\n//\n//\tpublic String JACKPOT_UI_BUTTON_IMG=\"/images/Jackpot_Active.gif\";\n//\n//\tpublic String VOUCHER_UI_BUTTON_IMG=\"/images/Voucher_Active.gif\";\n//\n//\tpublic String PENDING_BUTTON_IMG=\"/images/Pending_Active.png\";\n//\n//\tpublic String MANUAL_BUTTON_IMG=\"/images/Manual_Active.png\";\n//\t\n//\tpublic String PRINTER_BUTTON_IMG=\"/images/Printer_Active.png\";\n//\n//\tpublic String KEYBOARD_BUTTON_IMG=\"/images/KeyboardIcon.png\";\n//\n//\tpublic String LOGOUT_BUTTON_IMG=\"/images/LogoutIcon.png\";\n//\n//\tpublic String EXIT_BUTTON_IMG=\"/images/Exit_Active.png\";\n//\t\n//\tpublic String JACKPOT_UI_TEXT_IMAGE=\"/images/Jackpot_UI_Text_Image.png\";\n//\t\n//\tpublic String JACKPOT_UI_TEXT=\"/images/Jackpot_UI_Text_New.png\";\n//\t\n//\tpublic String TICK=\"/images/Tick.png\";\n\t\n\tpublic String CROSS=\"/images/Cross.png\";\n//\t\n//\tpublic String PREVIOUS_PAGE_ARROW=\"/images/Previous_Page_Arrow.png\";\n//\t\n//\tpublic String NEXT_PAGE_ARROW=\"/images/Next_Page_Arrow.png\";\n//\t\n\tpublic String IMAGE_S_TOUCH_SCREEN_PREV_ARROW = \"/images/S_Previous.png\";\n//\t\n\tpublic String IMAGE_S_TOUCH_SCREEN_NEXT_ARROW = \"/images/S_Next.png\";\n//\t\t\n\tpublic String DISPLAY_PREVIOUS_ARROW=\"/images/Display_Previous_Page_Arrow.png\";\n//\t\n\tpublic String DISPLAY_NEXT_ARROW=\"/images/Display_Next_Page_Arrow.png\";\n\t\n//\tpublic String TO_FIRST_PAGE_BUTTON_IMG=\"/images/To_First_Page_Arrow.png\";\n//\t\n//\tpublic String TO_LAST_PAGE_BUTTON_IMG=\"/images/To_Last_Page_Arrow.png\";\n//\t\n//\tpublic String MAIN_FILL_ACTIVE=\"/images/S_Fill_Active.png\";\n//\t\n//\tpublic String PENDING_FILL_ACTIVE=\"/images/S_PendingFill_Active.png\";\n//\t\n//\tpublic String MANUAL_FILL_ACTIVE=\"/images/S_ManualFill_Active.png\";\n//\t\n//\tpublic String AREA_FILL_ACTIVE=\"/images/S_ZoneFill_Active.png\";\n//\t\n//\tpublic String BLEED_ACTIVE=\"/images/S_Bleed_Active.png\";\n\t\n\t//public String MAIN_FILL_INACTIVE=\"/images/S_Fill_Inactive.png\";\n\t\n\t//public String PENDING_FILL_INACTIVE=\"/images/S_PendingFill_Inactive.png\";\n\t\n\t//public String MANUAL_FILL_INACTIVE=\"/images/S_ManualFill_Inactive.png\";\n\t\n\t//public String AREA_FILL_INACTIVE=\"/images/ZoneFill_Inactive.png\";\n\t\n\t//public String BLEED_INACTIVE=\"/images/S_Bleed_Inactive.png\";\n\t\n\t//public String BEEF_INACTIVE=\"/images/S_Beef_Inactive.png\";\n\t\n\t//public String REPORT_INACTIVE=\"/images/S_Report_Inactive.png\";\n\t\n\t//public String AREA_FILL_DISABLED = \"/images/S_ZoneFill_Disabled.png\";\n\t\t\n//\tpublic String PENDING_FILL_DISABLED = \"/images/S_PendingFill_Disabled.png\";\n//\t\n//\tpublic String MAIN_FILL_DISABLED = \"/images/S_Fill_Disabled.png\";\n//\t\n//\tpublic String MANUAL_FILL_DISABLED = \"/images/S_ManualFill_Disabled.png\";\n//\t\n//\tpublic String DISPLAY_DISABLED = \"/images/S_Display_Disabled.png\";\n\t\n//\tpublic String BLEED_DISABLED = \"/images/S_Bleed_Disabled.png\";\n\n//\tpublic String CANCEL_BUTTON=\"/images/Cancel.png\";\n//\t\n//\tpublic String SLIPS_UI_IMG=\"/images/Slips_UI_Image.png\";\n//\t\n//\tpublic String SLIPS_UI_TEXT_IMG=\"/images/Slips_UI_Text.png\";\n\t\n//\tpublic String VOID_INACTIVE=\"/images/S_Void_Inactive.png\";\n\t\n//\tpublic String REPRINT_INACTIVE=\"/images/S_Reprint_Inactive.png\";\n\n//\tpublic String DISPLAY_ACTIVE=\"/images/S_Display_Active.png\";\n//\t\n//\tpublic String DISPLAY_INACTIVE=\"/images/S_Display_Inactive.png\";\n//\t\n//\tpublic String FOOTER_BACKGROUND=\"/images/FooterBG.png\";\n//\t\n//\tpublic String HOME_ICON=\"/images/HomeIcon.png\";\n//\t\n//\tpublic String SLIP_MODULE=\"/images/SlipsTab.png\";\n//\t\n//\tpublic String BALLY_LOGO=\"/images/BallyLogo_32x32.png\";\n//\t\n//\tpublic String PENDING_INACTIVE_BUTTON_IMG=\"/images/S_PendingFill_Inactive.png\";\n//\n//\tpublic String MANUAL_INACTIVE_BUTTON_IMG=\"/images/S_ManualFill_Inactive.png\";\n//\t\n\t\n//\tpublic String BLEED_INACTIVE_BUTTON_IMG=\"/images/S_Bleed_Inactive.png\";\n\n\t\n//\tpublic String DISPLAY_INACTIVE_BUTTON_IMG=\"/images/S_Display_Inactive.png\";\n\n//\tpublic String MODULE_LOGO=\"/images/SlipIcon.png\";\n\n\tpublic String RADIO_BUTTON_IMAGE=\"/images/RadioButton_Selected.png\";\n\t\n\t//FOR LARGER RESOLUTIONS\n\t\n\t//ACTIVE\n\tpublic String BEEF_ACTIVE=\"/images/touchscreen/bluetheme/Dispute_Active.png\";\n\t\n\tpublic String VOID_ACTIVE=\"/images/touchscreen/bluetheme/Void_Active.png\";\n\t\n\tpublic String REPRINT_ACTIVE=\"/images/touchscreen/bluetheme/Reprint_Active.png\";\n\t\n\tpublic String REPORT_ACTIVE=\"/images/touchscreen/bluetheme/Reports_Active.png\";\n\t\n\t//INACTIVE\n\tpublic String BEEF_INACTIVE_BUTTON_IMG=\"/images/touchscreen/bluetheme/Dispute_Inactive.png\";\n\t\n\tpublic String VOID_INACTIVE_BUTTON_IMG=\"/images/touchscreen/bluetheme/Void_Inactive.png\";\n\n\tpublic String REPRINT_INACTIVE_BUTTON_IMG=\"/images/touchscreen/bluetheme/Reprint_Inactive.png\";\n\n\tpublic String REPORT_INACTIVE_BUTTON_IMG=\"/images/touchscreen/bluetheme/Reports_Inactive.png\";\n\t\n\t//DISABLED\n\tpublic String BEEF_DISABLED = \"/images/touchscreen/bluetheme/Dispute_Disabled.png\";\n\t\n\tpublic String VOID_DISABLED = \"/images/touchscreen/bluetheme/Void_Disabled.png\";\n\t\n\tpublic String REPRINT_DISABLED = \"/images/touchscreen/bluetheme/Reprint_Disabled.png\";\n\t\n\tpublic String REPORT_DISABLED = \"/images/touchscreen/bluetheme/Reports_Disabled.png\";\n\t\n\t// Slip Images for 800*600 Resolution\n\t\n\tpublic String SMALL_RESOLUTION_BEEF_ACTIVE=\"/images/touchscreen/bluetheme/Dispute_Active_Small.png\";//\"/images/J_Beef_Active.png\";\n\t\n\tpublic String SMALL_RESOLUTION_VOID_ACTIVE=\"/images/touchscreen/bluetheme/Void_Active_Small.png\";//\"/images/J_Void_Active.png\";\n\n\tpublic String SMALL_RESOLUTION_REPRINT_ACTIVE=\"/images/touchscreen/bluetheme/Reprint_Active_Small.png\";//\"/images/J_Reprint_Active.png\";\n\n\tpublic String SMALL_RESOLUTION_REPORT_ACTIVE=\"/images/touchscreen/bluetheme/Reports_Active_Small.png\";//\"/images/J_Report_Active.png\";\n\n\t\n\tpublic String SMALL_RESOLUTION_BEEF_INACTIVE=\"/images/touchscreen/bluetheme/Dispute_Inactive_Small.png\";//\"/images/J_Beef_Inactive.png\";\n\n\tpublic String SMALL_RESOLUTION_VOID_INACTIVE_BUTTON_IMG=\"/images/touchscreen/bluetheme/Void_Inactive_Small.png\";//\"/images/J_Void_Inactive.png\";\n\n\tpublic String SMALL_RESOLUTION_REPRINT_INACTIVE_BUTTON_IMG=\"/images/touchscreen/bluetheme/Reprint_Inactive_Small.png\";//\"/images/J_Reprint_Inactive.png\";\n\n\tpublic String SMALL_RESOLUTION_REPORT_INACTIVE=\"/images/touchscreen/bluetheme/Reports_Inactive_Small.png\";//\"/images/J_Report_Inactive.png\";\n\n\t\n\tpublic String SMALL_RESOLUTION_BEEF_DISABLED = \"/images/touchscreen/bluetheme/Dispute_Disabled_Small.png\";\n\n\tpublic String SMALL_RESOLUTION_VOID_DISABLED = \"/images/touchscreen/bluetheme/Void_Disabled_Small.png\";\n\n\tpublic String SMALL_RESOLUTION_REPRINT_DISABLED = \"/images/touchscreen/bluetheme/Reprint_Disabled_Small.png\";\n\n\tpublic String SMALL_RESOLUTION_REPORT_DISABLED = \"/images/touchscreen/bluetheme/Reports_Disabled_Small.png\";\n\t\n\t\n\n\tpublic String SMALL_RESOLUTION_RADIO_BUTTON_IMAGE=\"/images/Small_RadioButton_Selected.png\";\n\n\t\n\t\n\t\n}", "public static void populateValues()\n\t{\n\t\tvalues = new int[127];\n\t\tfor(int i = 0; i < 127; i++)\n\t\t{\n\t\t\tif(i < 64)\n\t\t\t\tvalues[i] = 1;\n\t\t\telse if (i < 96)\n\t\t\t\tvalues[i] = 2;\n\t\t\telse if (i < 112)\n\t\t\t\tvalues[i] = 4;\n\t\t\telse if (i < 120)\n\t\t\t\tvalues[i] = 8;\n\t\t\telse if (i < 124)\n\t\t\t\tvalues[i] = 16;\n\t\t\telse if (i < 126)\n\t\t\t\tvalues[i] = 32;\n\t\t\telse \n\t\t\t\tvalues[i] = 64;\n\t\t}\n\t}", "public void initialize(long seed0, long seed1) {\n\t\tbytesDigested = 0;\n\t\tbyteCount = 0;\n\t\thashState[0] = seed0;\n\t\thashState[1] = seed1;\n\t}", "void initializeMACs() {\n macs.put(0, zhao_mac);\n macs.put(2, brandon_mac);\n macs.put(3, joe_laptop_mac);\n }", "@SuppressWarnings(\"unused\")\n private void initSymbolTable() {\n MethodType I_V = new MethodType(Type.Int, Type.Void);\n MethodType I_R = new MethodType(Type.Int, Type.Real);\n MethodType I_S = new MethodType(Type.Int, Type.String);\n MethodType I_D = new MethodType(Type.Int, Type.NodeSet);\n MethodType R_I = new MethodType(Type.Real, Type.Int);\n MethodType R_V = new MethodType(Type.Real, Type.Void);\n MethodType R_R = new MethodType(Type.Real, Type.Real);\n MethodType R_D = new MethodType(Type.Real, Type.NodeSet);\n MethodType R_O = new MethodType(Type.Real, Type.Reference);\n MethodType I_I = new MethodType(Type.Int, Type.Int);\n MethodType D_O = new MethodType(Type.NodeSet, Type.Reference);\n MethodType D_V = new MethodType(Type.NodeSet, Type.Void);\n MethodType D_S = new MethodType(Type.NodeSet, Type.String);\n MethodType D_D = new MethodType(Type.NodeSet, Type.NodeSet);\n MethodType A_V = new MethodType(Type.Node, Type.Void);\n MethodType S_V = new MethodType(Type.String, Type.Void);\n MethodType S_S = new MethodType(Type.String, Type.String);\n MethodType S_A = new MethodType(Type.String, Type.Node);\n MethodType S_D = new MethodType(Type.String, Type.NodeSet);\n MethodType S_O = new MethodType(Type.String, Type.Reference);\n MethodType B_O = new MethodType(Type.Boolean, Type.Reference);\n MethodType B_V = new MethodType(Type.Boolean, Type.Void);\n MethodType B_B = new MethodType(Type.Boolean, Type.Boolean);\n MethodType B_S = new MethodType(Type.Boolean, Type.String);\n MethodType D_X = new MethodType(Type.NodeSet, Type.Object);\n MethodType R_RR = new MethodType(Type.Real, Type.Real, Type.Real);\n MethodType I_II = new MethodType(Type.Int, Type.Int, Type.Int);\n MethodType B_RR = new MethodType(Type.Boolean, Type.Real, Type.Real);\n MethodType B_II = new MethodType(Type.Boolean, Type.Int, Type.Int);\n MethodType S_SS = new MethodType(Type.String, Type.String, Type.String);\n MethodType S_DS = new MethodType(Type.String, Type.Real, Type.String);\n MethodType S_SR = new MethodType(Type.String, Type.String, Type.Real);\n MethodType O_SO = new MethodType(Type.Reference, Type.String, Type.Reference);\n\n MethodType D_SS =\n new MethodType(Type.NodeSet, Type.String, Type.String);\n MethodType D_SD =\n new MethodType(Type.NodeSet, Type.String, Type.NodeSet);\n MethodType B_BB =\n new MethodType(Type.Boolean, Type.Boolean, Type.Boolean);\n MethodType B_SS =\n new MethodType(Type.Boolean, Type.String, Type.String);\n MethodType S_SD =\n new MethodType(Type.String, Type.String, Type.NodeSet);\n MethodType S_DSS =\n new MethodType(Type.String, Type.Real, Type.String, Type.String);\n MethodType S_SRR =\n new MethodType(Type.String, Type.String, Type.Real, Type.Real);\n MethodType S_SSS =\n new MethodType(Type.String, Type.String, Type.String, Type.String);\n\n /*\n * Standard functions: implemented but not in this table concat().\n * When adding a new function make sure to uncomment\n * the corresponding line in <tt>FunctionAvailableCall</tt>.\n */\n\n // The following functions are inlined\n\n _symbolTable.addPrimop(\"current\", A_V);\n _symbolTable.addPrimop(\"last\", I_V);\n _symbolTable.addPrimop(\"position\", I_V);\n _symbolTable.addPrimop(\"true\", B_V);\n _symbolTable.addPrimop(\"false\", B_V);\n _symbolTable.addPrimop(\"not\", B_B);\n _symbolTable.addPrimop(\"name\", S_V);\n _symbolTable.addPrimop(\"name\", S_A);\n _symbolTable.addPrimop(\"generate-id\", S_V);\n _symbolTable.addPrimop(\"generate-id\", S_A);\n _symbolTable.addPrimop(\"ceiling\", R_R);\n _symbolTable.addPrimop(\"floor\", R_R);\n _symbolTable.addPrimop(\"round\", R_R);\n _symbolTable.addPrimop(\"contains\", B_SS);\n _symbolTable.addPrimop(\"number\", R_O);\n _symbolTable.addPrimop(\"number\", R_V);\n _symbolTable.addPrimop(\"boolean\", B_O);\n _symbolTable.addPrimop(\"string\", S_O);\n _symbolTable.addPrimop(\"string\", S_V);\n _symbolTable.addPrimop(\"translate\", S_SSS);\n _symbolTable.addPrimop(\"string-length\", I_V);\n _symbolTable.addPrimop(\"string-length\", I_S);\n _symbolTable.addPrimop(\"starts-with\", B_SS);\n _symbolTable.addPrimop(\"format-number\", S_DS);\n _symbolTable.addPrimop(\"format-number\", S_DSS);\n _symbolTable.addPrimop(\"unparsed-entity-uri\", S_S);\n _symbolTable.addPrimop(\"key\", D_SS);\n _symbolTable.addPrimop(\"key\", D_SD);\n _symbolTable.addPrimop(\"id\", D_S);\n _symbolTable.addPrimop(\"id\", D_D);\n _symbolTable.addPrimop(\"namespace-uri\", S_V);\n _symbolTable.addPrimop(\"function-available\", B_S);\n _symbolTable.addPrimop(\"element-available\", B_S);\n _symbolTable.addPrimop(\"document\", D_S);\n _symbolTable.addPrimop(\"document\", D_V);\n\n // The following functions are implemented in the basis library\n _symbolTable.addPrimop(\"count\", I_D);\n _symbolTable.addPrimop(\"sum\", R_D);\n _symbolTable.addPrimop(\"local-name\", S_V);\n _symbolTable.addPrimop(\"local-name\", S_D);\n _symbolTable.addPrimop(\"namespace-uri\", S_V);\n _symbolTable.addPrimop(\"namespace-uri\", S_D);\n _symbolTable.addPrimop(\"substring\", S_SR);\n _symbolTable.addPrimop(\"substring\", S_SRR);\n _symbolTable.addPrimop(\"substring-after\", S_SS);\n _symbolTable.addPrimop(\"substring-before\", S_SS);\n _symbolTable.addPrimop(\"normalize-space\", S_V);\n _symbolTable.addPrimop(\"normalize-space\", S_S);\n _symbolTable.addPrimop(\"system-property\", S_S);\n\n // Extensions\n _symbolTable.addPrimop(\"nodeset\", D_O);\n _symbolTable.addPrimop(\"objectType\", S_O);\n _symbolTable.addPrimop(\"cast\", O_SO);\n\n // Operators +, -, *, /, % defined on real types.\n _symbolTable.addPrimop(\"+\", R_RR);\n _symbolTable.addPrimop(\"-\", R_RR);\n _symbolTable.addPrimop(\"*\", R_RR);\n _symbolTable.addPrimop(\"/\", R_RR);\n _symbolTable.addPrimop(\"%\", R_RR);\n\n // Operators +, -, * defined on integer types.\n // Operators / and % are not defined on integers (may cause exception)\n _symbolTable.addPrimop(\"+\", I_II);\n _symbolTable.addPrimop(\"-\", I_II);\n _symbolTable.addPrimop(\"*\", I_II);\n\n // Operators <, <= >, >= defined on real types.\n _symbolTable.addPrimop(\"<\", B_RR);\n _symbolTable.addPrimop(\"<=\", B_RR);\n _symbolTable.addPrimop(\">\", B_RR);\n _symbolTable.addPrimop(\">=\", B_RR);\n\n // Operators <, <= >, >= defined on int types.\n _symbolTable.addPrimop(\"<\", B_II);\n _symbolTable.addPrimop(\"<=\", B_II);\n _symbolTable.addPrimop(\">\", B_II);\n _symbolTable.addPrimop(\">=\", B_II);\n\n // Operators <, <= >, >= defined on boolean types.\n _symbolTable.addPrimop(\"<\", B_BB);\n _symbolTable.addPrimop(\"<=\", B_BB);\n _symbolTable.addPrimop(\">\", B_BB);\n _symbolTable.addPrimop(\">=\", B_BB);\n\n // Operators 'and' and 'or'.\n _symbolTable.addPrimop(\"or\", B_BB);\n _symbolTable.addPrimop(\"and\", B_BB);\n\n // Unary minus.\n _symbolTable.addPrimop(\"u-\", R_R);\n _symbolTable.addPrimop(\"u-\", I_I);\n }", "public static void init() {\n }" ]
[ "0.5956287", "0.59497076", "0.5774448", "0.57013404", "0.5568644", "0.55627626", "0.5559986", "0.5525795", "0.5525795", "0.5525795", "0.5479647", "0.5469944", "0.54667187", "0.5415178", "0.5391424", "0.5354243", "0.5353076", "0.5334489", "0.5327123", "0.5327123", "0.53198844", "0.5307657", "0.5276883", "0.5273369", "0.5267069", "0.5265248", "0.5264354", "0.5258264", "0.5253976", "0.52523375", "0.5241047", "0.52363586", "0.5214297", "0.5206858", "0.52060616", "0.5193793", "0.51821905", "0.51816565", "0.51745343", "0.5171354", "0.51658696", "0.51294845", "0.5127989", "0.51259214", "0.51118886", "0.5096251", "0.5079697", "0.50671655", "0.5066054", "0.5059412", "0.50562936", "0.50495654", "0.50396067", "0.5039513", "0.5016941", "0.5008452", "0.50070435", "0.49962294", "0.49942413", "0.49937394", "0.49929324", "0.49909964", "0.49843672", "0.4978608", "0.4973886", "0.49627286", "0.49565783", "0.49556217", "0.49486688", "0.49484128", "0.4943889", "0.49407604", "0.49341747", "0.4930968", "0.4930272", "0.49294794", "0.49240747", "0.49212754", "0.49175733", "0.490633", "0.49043107", "0.4897461", "0.4889299", "0.4886789", "0.48841885", "0.48808566", "0.48756635", "0.48583683", "0.48485875", "0.48456267", "0.48450503", "0.48426503", "0.4830339", "0.48148972", "0.4812866", "0.48080432", "0.48023304", "0.47975308", "0.47885847", "0.47851464" ]
0.63792914
0
Handle a request to create a new field.
public void handleUpdateBinaryField(InternalActionContext ac, String uuid, String fieldName, MultiMap attributes) { validateParameter(uuid, "uuid"); validateParameter(fieldName, "fieldName"); String languageTag = attributes.get("language"); if (isEmpty(languageTag)) { throw error(BAD_REQUEST, "upload_error_no_language"); } String nodeVersion = attributes.get("version"); if (isEmpty(nodeVersion)) { throw error(BAD_REQUEST, "upload_error_no_version"); } MeshUploadOptions uploadOptions = Mesh.mesh().getOptions().getUploadOptions(); Set<FileUpload> fileUploads = ac.getFileUploads(); if (fileUploads.isEmpty()) { throw error(BAD_REQUEST, "node_error_no_binarydata_found"); } // Check the file upload limit if (fileUploads.size() > 1) { throw error(BAD_REQUEST, "node_error_more_than_one_binarydata_included"); } FileUpload ul = fileUploads.iterator().next(); long byteLimit = uploadOptions.getByteLimit(); if (ul.size() > byteLimit) { if (log.isDebugEnabled()) { log.debug("Upload size of {" + ul.size() + "} exeeds limit of {" + byteLimit + "} by {" + (ul.size() - byteLimit) + "} bytes."); } String humanReadableFileSize = org.apache.commons.io.FileUtils.byteCountToDisplaySize(ul.size()); String humanReadableUploadLimit = org.apache.commons.io.FileUtils.byteCountToDisplaySize(byteLimit); throw error(BAD_REQUEST, "node_error_uploadlimit_reached", humanReadableFileSize, humanReadableUploadLimit); } String contentType = ul.contentType(); String fileName = ul.fileName(); // This the name and path of the file to be moved to a new location. // This will be changed because it is possible that the file has to be moved multiple times // (if the transaction failed and has to be repeated). ac.put("sourceFile", ul.uploadedFileName()); String hashSum = FileUtils.generateSha512Sum(ul.uploadedFileName()); db.tx(() -> { Project project = ac.getProject(); Release release = ac.getRelease(); Node node = project.getNodeRoot().loadObjectByUuid(ac, uuid, UPDATE_PERM); Language language = boot.get().languageRoot().findByLanguageTag(languageTag); if (language == null) { throw error(NOT_FOUND, "error_language_not_found", languageTag); } // Load the current latest draft NodeGraphFieldContainer latestDraftVersion = node.getGraphFieldContainer(language, release, ContainerType.DRAFT); if (latestDraftVersion == null) { // latestDraftVersion = node.createGraphFieldContainer(language, release, ac.getUser()); // TODO Maybe it would be better to just create a new field container for the language? // In that case we would also need to: // * check for segment field conflicts // * update display name // * fail if mandatory fields are missing throw error(NOT_FOUND, "error_language_not_found", languageTag); } // Load the base version field container in order to create the diff NodeGraphFieldContainer baseVersionContainer = node.findNextMatchingFieldContainer(Arrays.asList(languageTag), release.getUuid(), nodeVersion); if (baseVersionContainer == null) { throw error(BAD_REQUEST, "node_error_draft_not_found", nodeVersion, languageTag); } List<FieldContainerChange> baseVersionDiff = baseVersionContainer.compareTo(latestDraftVersion); List<FieldContainerChange> requestVersionDiff = Arrays.asList(new FieldContainerChange(fieldName, FieldChangeTypes.UPDATED)); // Compare both sets of change sets List<FieldContainerChange> intersect = baseVersionDiff.stream().filter(requestVersionDiff::contains).collect(Collectors.toList()); // Check whether the update was not based on the latest draft version. In that case a conflict check needs to occur. if (!latestDraftVersion.getVersion().equals(nodeVersion)) { // Check whether a conflict has been detected if (intersect.size() > 0) { NodeVersionConflictException conflictException = new NodeVersionConflictException("node_error_conflict_detected"); conflictException.setOldVersion(baseVersionContainer.getVersion().toString()); conflictException.setNewVersion(latestDraftVersion.getVersion().toString()); for (FieldContainerChange fcc : intersect) { conflictException.addConflict(fcc.getFieldCoordinates()); } throw conflictException; } } FieldSchema fieldSchema = latestDraftVersion.getSchemaContainerVersion().getSchema().getField(fieldName); if (fieldSchema == null) { throw error(BAD_REQUEST, "error_schema_definition_not_found", fieldName); } if (!(fieldSchema instanceof BinaryFieldSchema)) { // TODO Add support for other field types throw error(BAD_REQUEST, "error_found_field_is_not_binary", fieldName); } SearchQueueBatch batch = searchQueue.create(); // Create a new node version field container to store the upload NodeGraphFieldContainer newDraftVersion = node.createGraphFieldContainer(language, release, ac.getUser(), latestDraftVersion, true); BinaryGraphField field = newDraftVersion.createBinary(fieldName); String fieldUuid = field.getUuid(); Single<ImageInfo> obsImage; // 3. Only gather image info for actual images. Otherwise return an empty image info object. if (contentType.startsWith("image/")) { try { // Caches the image info in the action context so that it does not need to be // calculated again if the transaction failed ImageInfo imageInfo = ac.get("imageInfo"); if (imageInfo != null) { obsImage = Single.just(imageInfo); } else { obsImage = imageManipulator.readImageInfo(() -> { try { return new FileInputStream(ul.uploadedFileName()); } catch (Exception e) { log.error("Could not load schema for node {" + node.getUuid() + "}"); throw error(INTERNAL_SERVER_ERROR, "could not find upload file", e); } }).doOnSuccess(ii -> ac.put("imageInfo", ii)); } } catch (Exception e) { log.error("Could not load schema for node {" + node.getUuid() + "}"); throw error(INTERNAL_SERVER_ERROR, "could not find upload file", e); } } else { obsImage = Single.just(new ImageInfo()); } // 4. Hash and store the file and update the field properties Single<TransformationResult> resultObs = obsImage.map((imageInfo) -> { moveBinaryFile(ac, fieldUuid, field.getSegmentedPath()); return new TransformationResult(hashSum, 0, imageInfo); }); TransformationResult info = resultObs.toBlocking().value(); field.setFileName(fileName); field.setFileSize(ul.size()); field.setMimeType(contentType); field.setSHA512Sum(info.getHash()); field.setImageDominantColor(info.getImageInfo().getDominantColor()); field.setImageHeight(info.getImageInfo().getHeight()); field.setImageWidth(info.getImageInfo().getWidth()); // If the binary field is the segment field, we need to update the webroot info in the node if (field.getFieldKey().equals(newDraftVersion.getSchemaContainerVersion().getSchema().getSegmentField())) { newDraftVersion.updateWebrootPathInfo(release.getUuid(), "node_conflicting_segmentfield_upload"); } return batch.store(node, release.getUuid(), DRAFT, false).processAsync().andThen(node.transformToRest(ac, 0)); }).subscribe(model -> ac.send(model, CREATED), ac::fail); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void createField(Field field) {\n Span span = this.tracer.buildSpan(\"Client.CreateField\").start();\n try {\n String path = String.format(\"/index/%s/field/%s\", field.getIndex().getName(), field.getName());\n String body = field.getOptions().toString();\n ByteArrayEntity data = new ByteArrayEntity(body.getBytes(StandardCharsets.UTF_8));\n clientExecute(\"POST\", path, data, null, \"Error while creating field\");\n } finally {\n span.finish();\n }\n }", "HxField createField(final String fieldType,\n final String fieldName);", "@Test\n public void createCustomFieldTest() throws ApiException {\n CustomFieldDefinitionJsonBean body = null;\n FieldDetails response = api.createCustomField(body);\n\n // TODO: test validations\n }", "@Override\n public MockResponse handleCreate(RecordedRequest request) {\n return process(request, postHandler);\n }", "public Message handleCreate(Message createRequest) {\n\n Message response = new Message(Message.GENERIC_ERROR);\n\n int SectionNumbers = createRequest.getSectionNumbers();\n String DocumentName = createRequest.getDocumentName();\n String owner = createRequest.getUserName();\n\n // case: clash in register\n if (controlServer.containsDocumentKey(DocumentName)) {\n response.setId(Message.INVALID_DOCNAME);\n }\n\n // case: no clash in register\n else{\n DocumentData data = new DocumentData(DocumentName,owner,SectionNumbers);\n Document nuovoDocumento = new Document(data);\n\n // insert document into register\n controlServer.addDocument(DocumentName,nuovoDocumento);\n\n // update relative userData\n UserData toMod = controlServer.getUserData(owner);\n toMod.addDocument(DocumentName);\n controlServer.replaceUser(owner,toMod);\n\n // sends response to client\n response.setUserData(new UserData(toMod));\n response.setDocumentName(DocumentName);\n response.setSectionNumbers(SectionNumbers);\n response.setId(Message.UPDATE_UD);\n }\n return response;\n }", "@Override\n public Field<?> createField(Container container, Object itemId,\n Object propertyId, Component uiContext) {\n Field<?> field = super.createField(container, itemId,\n propertyId, uiContext);\n\n // ...and just set them as immediate\n ((AbstractField<?>) field).setImmediate(true);\n\n // Also modify the width of TextFields\n if (field instanceof TextField)\n field.setWidth(\"100%\");\n field.setRequired(true);\n ((TextField) field).setInputPrompt(\"Введите назначение\");\n field.addStyleName(ValoTheme.LAYOUT_HORIZONTAL_WRAPPING);\n field.focus();\n\n return field;\n }", "FieldDefinition createFieldDefinition();", "CreateResponse create(@NonNull CreateRequest request);", "FieldType createFieldType();", "public void addField(FieldRequest field) {\n\t\tfields.add(field);\n\t}", "@RequestMapping(value = \"/newFact/{fact}\", method = { RequestMethod.GET, RequestMethod.POST })\n\tpublic void newFact(HttpServletRequest req, HttpServletResponse resp, @PathVariable String fact, Model model) throws IOException, ServletException {\n\t\tfactDao.addNewFact(fact);\n\t}", "default HxField createField(final HxType fieldType,\n final String fieldName) {\n return createField(fieldType.getName(), fieldName);\n }", "abstract protected ActionForward processCreate( UserRequest request )\n throws IOException, ServletException;", "@RequestMapping(method = RequestMethod.POST)\n public Bin create() {\n throw new NotImplementedException(\"To be implemented\");\n }", "public void ensureField(Field field) {\n try {\n createField(field);\n } catch (HttpConflict ex) {\n // pass\n }\n }", "protected void createFields()\n {\n createEffectiveLocalDtField();\n createDiscontinueLocalDtField();\n createScanTypeField();\n createContractNumberField();\n createContractTypeField();\n createProductTypeField();\n createStatusIndicatorField();\n createCivilMilitaryIndicatorField();\n createEntryUserIdField();\n createLastUpdateUserIdField();\n createLastUpdateTsField();\n }", "ObjectField createObjectField();", "FieldType createFieldType(FieldType fieldType) throws FieldTypeExistsException, TypeException,\n InterruptedException;", "private void setNewField(String fieldName) {\n setNewField(fieldName, DBCreator.STRING_TYPE, null);\n }", "public com.vodafone.global.er.decoupling.binding.request.CustomFieldType createCustomFieldType()\n throws javax.xml.bind.JAXBException\n {\n return new com.vodafone.global.er.decoupling.binding.request.impl.CustomFieldTypeImpl();\n }", "public FormField(String variable) {\n this.variable = variable;\n }", "public Field createField(final Item item, final Object propertyId, final Component uiContext) {\n final String pid = (String) propertyId;\n\n final Field field = DefaultFieldFactory.get().createField(item, propertyId, uiContext);\n if (field instanceof AbstractTextField) {\n ((AbstractTextField) field).setNullRepresentation(\"\");\n }\n return field;\n }", "@Override\n public DataObjectResponse<T> handlePOST(DataObjectRequest<T> request)\n {\n if(getRequestValidator() != null) getRequestValidator().validatePOST(request);\n\n T dataObject = defaultFieldsOnCreate(request.getDataObject());\n DefaultDataObjectResponse<T> response = new DefaultDataObjectResponse<>();\n VisibilityFilter<T, DataObjectRequest<T>> visibilityFilter = visibilityFilterMap.get(VisibilityMethod.POST);\n\n if(!visibilityFilter.isVisible(request, dataObject))\n {\n response.setErrorResponse(ErrorResponseFactory.unauthorized(String.format(AUTHORIZATION_EXCEPTION, dataObject.getCustomerId()), request.getCID()));\n return response;\n }\n\n try\n {\n T persistedObject = objectPersister.persist(dataObject);\n if(persistedObject == null) {\n Throwable throwable = new RuntimeException(UNABLE_TO_CREATE_EXCEPTION);\n response.setErrorResponse(ErrorResponseFactory.buildErrorResponse(throwable, 400, request.getCID()));\n return response;\n }\n response.add(persistedObject);\n }\n catch(PersistenceException e)\n {\n BadRequestException badRequestException = new BadRequestException(UNABLE_TO_CREATE_EXCEPTION, e);\n response.setErrorResponse(ErrorResponseFactory.badRequest(badRequestException, request.getCID()));\n }\n return response;\n }", "@PostMapping(\"/new\")\n public ResponseEntity create(@RequestBody CityInfo cityInfo){\n service.create(cityInfo);\n return new ResponseEntity(HttpStatus.CREATED);\n }", "UserCreateResponse createUser(UserCreateRequest request);", "default HxField createField(final Class<?> type,\n final String fieldName) {\n return createField(type.getName(), fieldName);\n }", "@POST( CONTROLLER )\n VersionedObjectKey createObject( @Body CreateObjectRequest request );", "@Override\r\n\tpublic void postRequest(Request request, Response response) {\r\n\t\tcreateUser(request, response);\r\n\t}", "public static void insertField(Field field) {\n\t\t\n\t\ttry{\n Connection connection = getConnection();\n\n\n try {\n PreparedStatement statement = connection.prepareStatement(\"INSERT INTO template_fields (field_id, form_name, field_name, field_value, field_type, field_mandatory)\"\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t+ \" VALUES ('\"+field.getTheId()+\"', '\"+field.getTheFormName()+\"', '\"+field.getTheName()+\"', 'Here is text 424', '\"+field.getTheType()+\"', '\"+field.getTheMandatory()+\"')\"); \n statement.executeUpdate();\n\n statement.close();\n connection.close();\n } catch (SQLException ex) {\n \t//23 stands for duplicate / unique entries in db, so listen for that error and update db if so\n \tif (ex.getSQLState().startsWith(\"23\")) {\n System.out.println(\"Duplicate\");\n PreparedStatement statement = connection.prepareStatement(\"UPDATE template_fields SET \"\n \t\t+ \"field_id = '\"+field.getTheId()+\"', field_name = '\"+field.getTheName()+\"',\"\n \t\t+ \" field_value = 'here text', field_type = '\"+field.getTheType()+\"'\"\n \t\t\t\t+ \"WHERE field_id = '\"+field.getTheId()+\"' \"); \n\t\t\t\t\tstatement.executeUpdate();\n\t\t\t\t\t\n\t\t\t\t\tstatement.close();\n\t\t\t\t\tconnection.close();\n \t}\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n\t}", "@FormUrlEncoded\n @POST(\"/v2/cards/create.json\")\n void create(@Field(\"card_data\") CardData data, Callback<CardCreate> cb);", "@BearerAuth\n @HttpRequestHandler(paths = \"/api/v2/service/create\", methods = \"POST\")\n private void handleCreateRequest(@NonNull HttpContext context, @NonNull @RequestBody Document body) {\n var configuration = body.readObject(\"serviceConfiguration\", ServiceConfiguration.class);\n if (configuration == null) {\n // check for a provided service task\n var serviceTask = body.readObject(\"task\", ServiceTask.class);\n if (serviceTask != null) {\n configuration = ServiceConfiguration.builder(serviceTask).build();\n } else {\n // fallback to a service task name which has to exist\n var serviceTaskName = body.getString(\"serviceTaskName\");\n if (serviceTaskName != null) {\n var task = this.serviceTaskProvider.serviceTask(serviceTaskName);\n if (task != null) {\n configuration = ServiceConfiguration.builder(task).build();\n } else {\n // we got a task but it does not exist\n this.badRequest(context)\n .body(this.failure().append(\"reason\", \"Provided task is unknown\").toString())\n .context()\n .closeAfter(true)\n .cancelNext(true);\n return;\n }\n } else {\n this.sendInvalidServiceConfigurationResponse(context);\n return;\n }\n }\n }\n\n var createResult = this.serviceFactory.createCloudService(configuration);\n var start = body.getBoolean(\"start\", false);\n if (start && createResult.state() == ServiceCreateResult.State.CREATED) {\n createResult.serviceInfo().provider().start();\n }\n\n this.ok(context)\n .body(this.success().append(\"result\", createResult).toString())\n .context()\n .closeAfter(true)\n .cancelNext(true);\n }", "public Result createRoom() {\n\n DynamicForm dynamicForm = Form.form().bindFromRequest();\n String roomType = dynamicForm.get(\"roomType\");\n Double price = Double.parseDouble(dynamicForm.get(\"price\"));\n int bedCount = Integer.parseInt(dynamicForm.get(\"beds\"));\n String wifi = dynamicForm.get(\"wifi\");\n String smoking = dynamicForm.get(\"smoking\");\n\n RoomType roomTypeObj = new RoomType(roomType, price, bedCount, wifi, smoking);\n\n if (dynamicForm.get(\"AddRoomType\") != null) {\n\n Ebean.save(roomTypeObj);\n String message = \"New Room type is created Successfully\";\n\n return ok(views.html.RoomTypeUpdateSuccess.render(message));\n } else{\n\n String message = \"Failed to create a new Room type\";\n\n return ok(views.html.RoomTypeUpdateSuccess.render(message));\n\n }\n\n\n\n }", "@attribute(value = \"\", required = true)\t\r\n\tpublic void addField(Field f) {\r\n\t\tfields.put(\"\" + fieldCount++, f);\r\n\t}", "@RequestMapping(path = \"/create\", method = RequestMethod.POST)\n\tpublic ResponseEntity<RestResponse<CompanyDTO>> create(@RequestBody CompanyDTO request) {\n\n\t\tCompanyDTO result = companyService.create(request);\n\t\t\n\t\tRestResponse<CompanyDTO> restResponse = \n\t\t\t\tnew RestResponse<CompanyDTO>(RestResponseCodes.OK.getCode(), RestResponseCodes.OK.getDescription(), result);\n\t\t\n\t\treturn new ResponseEntity<RestResponse<CompanyDTO>>(restResponse, HttpStatus.OK);\n\t\t\t\n\t}", "public static TreeNode makeField(Field field) {\n return new FieldNode(field);\n }", "void filterCreate(ServerContext context, CreateRequest request,\n ResultHandler<Resource> handler, RequestHandler next);", "@POST\n @Produces(MediaType.APPLICATION_JSON)\n @Consumes(MediaType.APPLICATION_JSON)\n public Response handlePostCreate(String body) {\n Gson gson = GSONFactory.getInstance();\n\n Employee createdEmployee = createEmployee(body);\n\n String serializedEmployee = gson.toJson(createdEmployee);\n\n Response response = Response.status(201).entity(serializedEmployee).build();\n return response;\n }", "public void setFieldId(String fieldId);", "public Field() {\r\n\t}", "@Action( ACTION_CREATE_FEATURE )\r\n public String doCreateFeature( HttpServletRequest request )\r\n {\r\n populate( _feature, request );\r\n\r\n // Check constraints\r\n if ( !validateBean( _feature, VALIDATION_ATTRIBUTES_PREFIX ) )\r\n {\r\n return redirectView( request, VIEW_CREATE_FEATURE );\r\n }\r\n\r\n FeatureHome.create( _feature );\r\n addInfo( INFO_FEATURE_CREATED, getLocale( ) );\r\n\r\n return redirectView( request, VIEW_MANAGE_FEATURES );\r\n }", "public Team create(TeamDTO teamForm);", "public void addField(TemplateField field)\r\n{\r\n\tfields.addElement(field);\r\n}", "FieldsType createFieldsType();", "public UserAuthToken createUser(CreateUserRequest request);", "@PostMapping(\"/add\")\n public EmptyResponse create(@Valid @RequestBody DiscountAddRequest request){\n discountAddService.createNewDiscount(request);\n\n return new EmptyResponse();\n }", "@PostMapping(\"/users\")\n public UsersResponse createNewUser(@RequestBody NewUserRequest request) {\n User user = new User();\n user.setName(request.getName());\n user.setAge(request.getAge());\n user = userRepository.save(user);\n return new UsersResponse(user.getId(), user.getName() + user.getAge());\n }", "static public ApplicationFormItem createNew(int id, String shortname, boolean required, ApplicationFormItemType type,\n\t\t\t\t\t\t\t\t\t\t\t\tString federationAttribute, String perunSourceAttribute, String perunDestinationAttribute, String regex,\n\t\t\t\t\t\t\t\t\t\t\t\tList<Application.ApplicationType> applicationTypes, Integer ordnum, boolean forDelete)\t{\n\t\tApplicationFormItem afi = new JSONObject().getJavaScriptObject().cast();\n\t\tafi.setId(id);\n\t\tafi.setShortname(shortname);\n\t\tafi.setRequired(required);\n\t\tafi.setType(type);\n\t\tafi.setFederationAttribute(federationAttribute);\n\t\tafi.setPerunSourceAttribute(perunSourceAttribute);\n\t\tafi.setPerunDestinationAttribute(perunDestinationAttribute);\n\t\tafi.setRegex(regex);\n\t\tafi.setApplicationTypes(applicationTypes);\n\t\tafi.setOrdnum(ordnum);\n\t\tafi.setForDelete(forDelete);\n\t\treturn afi;}", "public String formCreated()\r\n {\r\n return formError(\"201 Created\",\"Object was created\");\r\n }", "public void addTextField(String label, String fill, int index) {\n //inflater needed to \"inflate\" layouts\n LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n //instantiate our data object.\n ElementTextField elementTextField = new ElementTextField(label, fill);\n //insert element data object in slot on page\n if (isLoading){\n currentPage.addElement(elementTextField);\n }else{\n currentPage.insertElement(index, elementTextField);\n }\n //we need to instantiate our xml fragment (text field) and bind it to the data object\n TextFieldBinding textFieldBinding = TextFieldBinding.inflate(inflater, null,false);\n textFieldBinding.setElementTextField(elementTextField);\n //get new view (our xml fragment -the text field) and add it to current view\n View newView = textFieldBinding.getRoot();\n if (isInspecting){\n EditText editText = newView.findViewById(R.id.label);\n editText.setFocusable(false);\n }\n linearLayoutBody.addView(newView, index);\n Context context = App.getContext();\n LogManager.reportStatus(context, \"INSPECTOR\", \"onTextField\");\n }", "private void setNewField(String fieldName, String type, String constraint) {\n mapFieldsTypes.put(fieldName, type);\n if (constraint != null && !constraint.isEmpty()) {\n mapFieldsConstraints.put(fieldName, constraint);\n }\n }", "public BaseField setupField(int iFieldSeq)\n {\n BaseField field = null;\n if (iFieldSeq == 0)\n field = new HotelField(this, PRODUCT_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 1)\n // field = new DateField(this, START_DATE, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 2)\n // field = new DateField(this, END_DATE, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 3)\n // field = new StringField(this, DESCRIPTION, 10, null, null);\n //if (iFieldSeq == 4)\n // field = new CityField(this, CITY_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 5)\n // field = new CityField(this, TO_CITY_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 6)\n // field = new ContinentField(this, CONTINENT_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 7)\n // field = new RegionField(this, REGION_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 8)\n // field = new CountryField(this, COUNTRY_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 9)\n // field = new StateField(this, STATE_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 10)\n // field = new VendorField(this, VENDOR_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);\n if (iFieldSeq == 11)\n field = new HotelRateField(this, RATE_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);\n if (iFieldSeq == 12)\n field = new HotelClassField(this, CLASS_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 13)\n // field = new DateField(this, DETAIL_DATE, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 14)\n // field = new ShortField(this, PAX, Constants.DEFAULT_FIELD_LENGTH, null, new Short((short)2));\n //if (iFieldSeq == 15)\n // field = new HotelScreenRecord_LastChanged(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 16)\n // field = new BooleanField(this, REMOTE_QUERY_ENABLED, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 17)\n // field = new ShortField(this, BLOCKED, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 18)\n // field = new ShortField(this, OVERSELL, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 19)\n // field = new BooleanField(this, CLOSED, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 20)\n // field = new BooleanField(this, DELETE, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 21)\n // field = new BooleanField(this, READ_ONLY, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 22)\n // field = new ProductSearchTypeField(this, PRODUCT_SEARCH_TYPE_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);\n //if (iFieldSeq == 23)\n // field = new ProductTypeField(this, PRODUCT_TYPE_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);\n if (iFieldSeq == 24)\n field = new PaxCategorySelect(this, PAX_CATEGORY_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);\n if (field == null)\n field = super.setupField(iFieldSeq);\n return field;\n }", "@PostMapping( value = \"/new\", params = \"auto\" )\n public String createEventFormAutoPopulate( @ModelAttribute CreateEventForm createEventForm )\n {\n // provide default values to make user submission easier\n createEventForm.setSummary( \"A new event....\" );\n createEventForm.setDescription( \"This was autopopulated to save time creating a valid event.\" );\n createEventForm.setWhen( new Date() );\n\n // make the attendee not the current user\n CalendarUser currentUser = userContext.getCurrentUser();\n int attendeeId = currentUser.getId() == 0 ? 1 : 0;\n CalendarUser attendee = calendarService.getUser( attendeeId );\n createEventForm.setAttendeeEmail( attendee.getEmail() );\n\n return \"events/create\";\n }", "public FieldObject() {\n super(\"fields/\");\n setEnterable(true);\n }", "@PostMapping(consumes = MediaType.APPLICATION_JSON_VALUE)\n public ResponseEntity<?> create(@Validated({UserReqDTO.New.class}) @RequestBody UserReqDTO userDTO) {\n log.info(\"Create user {}\", userDTO);\n return new ResponseEntity<>(service.create(userDTO), HttpStatus.CREATED);\n }", "public void createTask(){\n final String name = newTaskNameField.getText().toString();\n final String description = newTaskDescriptionField.getText().toString();\n\n if (name.isEmpty()){\n newTaskNameField.setText(\"Please Enter a name\");\n newTaskNameField.requestFocus();\n newTaskNameField.selectAll();\n return;\n }\n\n if (description.isEmpty()){\n newTaskDescriptionField.setText(\"Please Enter a Description\");\n newTaskDescriptionField.requestFocus();\n newTaskDescriptionField.selectAll();\n return;\n }\n\n if(!getValidDate(newtaskDateField.getText().toString())) {\n handleInvalidDate();\n return;\n }\n\n if(newTaskAssignee == null) {\n newTaskAssigneeField.setText(\"Please assign a user\");\n newTaskAssigneeField.selectAll();\n return;\n }\n\n TaskManager.sharedInstance().CreateTask(name, description, newTaskAssignee, DueDate, false);\n newTaskDialog.dismiss();\n }", "public void set(Object requestor, String field);", "public void setField(String field) {\n this.field = field;\n }", "private final Field makeField(String data) {\n Field result = null;\n\n if (termVector == null) {\n result = new Field(label, data, store, index);\n }\n else {\n result = new Field(label, data, store, index, termVector);\n }\n\n return result;\n }", "@Override\n\tpublic String create(Set<String> filterField) {\n\t\treturn null;\n\t}", "@POST\n @Produces({ \"application/json\" })\n @CommitAfter\n public abstract Response addNew(Person person);", "@PostMapping(value = \"/create\",consumes = MediaType.APPLICATION_JSON_VALUE)\n public InternationalTournaments create(@RequestBody InternationalTournaments create){\n return service.create(create);\n }", "@BodyParser.Of(play.mvc.BodyParser.Json.class)\n public static Result create() throws JsonParseException, JsonMappingException, IOException {\n JsonNode json = request().body().asJson();\n Thing thing = mapper.treeToValue(json, Thing.class);\n thing.save();\n return ok(mapper.valueToTree(thing));\n }", "@RequestMapping(value = \"/enquirys\",\n method = RequestMethod.POST,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public ResponseEntity<Void> create(@Valid @RequestBody Enquiry enquiry) throws URISyntaxException {\n log.debug(\"REST request to save Enquiry : {}\", enquiry);\n if (enquiry.getId() != null) {\n return ResponseEntity.badRequest().header(\"Failure\", \"A new enquiry cannot already have an ID\").build();\n }\n enquiryRepository.save(enquiry);\n return ResponseEntity.created(new URI(\"/api/enquirys/\" + enquiry.getId())).build();\n }", "@Action( ACTION_CREATE_REFERENCE )\r\n public String doCreateReference( HttpServletRequest request )\r\n {\r\n populate( _reference, request, request.getLocale( ) );\r\n\r\n // Check form constraints\r\n if ( !validateBean( _reference, VALIDATION_ATTRIBUTES_PREFIX ) )\r\n {\r\n return redirectView( request, VIEW_CREATE_REFERENCE );\r\n }\r\n\r\n // Create Reference.\r\n ReferenceHome.create( _reference );\r\n\r\n // redirect to manage & add import result for users\r\n addInfo( I18nService.getLocalizedString( INFO_REFERENCE_CREATED, getLocale( ) ) );\r\n return redirectView( request, VIEW_MANAGE_REFERENCES );\r\n }", "public void onAddNewReq() {\n dbConn.logUIMsg(RLogger.MSG_TYPE_INFO, RLogger.LOGGING_LEVEL_DEBUG, \"TableManagerBean.class :: onAddNew() :: Adding new Column\");\n ColList newCol = new ColList();\n newCol.setCol_name(\"COL\");\n newCol.setCol_value(\"VAL\");\n this.getReqColumnList().add(newCol);\n }", "public abstract Response create(Request request, Response response);", "public Field(String watermark,\n String showfieldname,\n String saveRequired,\n String jfunction,\n String onChange,\n String onKeyDown,\n String defaultValue,\n String type,\n String sqlValue,\n String field_name,\n String relation,\n String states,\n String relationField,\n String onClickVList,\n String jIdList,\n String name,\n String searchRequired,\n String id,\n String placeholder,\n String value,\n String fieldType,\n String onclicksummary,\n String newRecord,\n List<Field> dListArray,\n List<OptionModel> mOptionsArrayList,\n String onclickrightbutton,\n String webSaveRequired,\n String field_type) {\n\n this.watermark = watermark;\n this.showfieldname = showfieldname;\n this.saveRequired = saveRequired;\n this.jfunction = jfunction;\n this.onChange = onChange;\n this.onKeyDown = onKeyDown;\n this.defaultValue = defaultValue;\n this.type = type;\n this.sqlValue = sqlValue;\n this.field_name = field_name;\n this.relation = relation;\n this.states = states;\n this.relationField = relationField;\n this.onClickVList = onClickVList;\n this.jIdList = jIdList;\n this.name = name;\n this.searchRequired = searchRequired;\n this.id = id;\n this.placeholder = placeholder;\n this.value = value;\n this.fieldType = fieldType;\n this.onclicksummary = onclicksummary;\n this.newRecord = newRecord;\n this.dListArray = dListArray;\n this.optionsArrayList = mOptionsArrayList;\n this.onclickrightbutton = onclickrightbutton;\n this.webSaveRequired = webSaveRequired;\n this.field_type = field_type;\n\n// this( watermark, showfieldname, saveRequired, jfunction,\n// onChange, onKeyDown, defaultValue, type, sqlValue,\n// field_name, relation, states, relationField,\n// onClickVList, jIdList, name, \"\",\n// searchRequired, id, placeholder, value,\n// fieldType, onclicksummary, newRecord, \"\",\n// dListArray,mOptionsArrayList,onclickrightbutton);\n }", "@Override\r\n\tpublic void addField(Field field) \r\n\t{\r\n\t\tif(this.fields == null)\r\n\t\t{\r\n\t\t\tthis.fields = new ArrayList<>();\r\n\t\t}\r\n\t\tthis.fields.add(field);\r\n\t}", "public void addField (String label, String field) {\n addField (label, field, \"\");\n }", "public static void addField (com.intersys.objects.Database db, java.lang.String inGUID, java.lang.String inFieldName, java.lang.String inFieldValue) throws com.intersys.objects.CacheException {\n com.intersys.cache.Dataholder[] args = new com.intersys.cache.Dataholder[3];\n args[0] = new com.intersys.cache.Dataholder(inGUID);\n args[1] = new com.intersys.cache.Dataholder(inFieldName);\n args[2] = new com.intersys.cache.Dataholder(inFieldValue);\n com.intersys.cache.Dataholder res=db.runClassMethod(CACHE_CLASS_NAME,\"addField\",args,com.intersys.objects.Database.RET_NONE);\n return;\n }", "E create(E entity, RequestContext context)\n throws TechnicalException, ConflictException;", "@Override\n\tpublic Contact handRequest() {\n\t\tIvalidation valid = new ValidContact();\n\t\t\n\t\t\n\t\tContact newContact = new Contact(this.name, this.noPhone, this.email);\t//create new contact\n\t\t\n\t\tvalid = new ValidContact();\n\t\tif(valid.valid(newContact)) {\n\t\t\tAppContact2Data.addContactToData(newContact);\n\t\t\tSystem.out.print(\"\\nSuccessfull!\\n\");\n\t\t\treturn newContact;\n\t\t}\n\t\treturn null;\n\t}", "com.soa.SolicitarServicioDocument.SolicitarServicio addNewSolicitarServicio();", "@POST\r\n @Path(\"/create\")\r\n @Consumes(MediaType.APPLICATION_FORM_URLENCODED)\r\n @Produces(MediaType.APPLICATION_JSON)\r\n public NewAccount createNewCustomerAccount(@FormParam(\"accountNumber\") int accountNumber,\r\n @FormParam(\"accountType\") String accountType,\r\n @FormParam(\"accountBalance\") double accountBalance\r\n ){\r\n return newaccountservice.createNewAccount(accountNumber, accountType, accountBalance);\r\n }", "public FieldNotFoundException() {\n }", "protected void createSmartField() {\n\t\tthis.smartField = new SmartField();\n\t}", "@_esCocinero\n public Result crearPaso() {\n Form<Paso> frm = frmFactory.form(Paso.class).bindFromRequest();\n\n // Comprobación de errores\n if (frm.hasErrors()) {\n return status(409, frm.errorsAsJson());\n }\n\n Paso nuevoPaso = frm.get();\n\n // Comprobar autor\n String key = request().getQueryString(\"apikey\");\n if (!SeguridadFunctions.esAutorReceta(nuevoPaso.p_receta.getId(), key))\n return Results.badRequest();\n\n // Checkeamos y guardamos\n if (nuevoPaso.checkAndCreate()) {\n Cachefunctions.vaciarCacheListas(\"pasos\", Paso.numPasos(), cache);\n Cachefunctions.vaciarCacheListas(\"recetas\", Receta.numRecetas(), cache);\n return Results.created();\n } else {\n return Results.badRequest();\n }\n\n }", "public MappingField createMappingField(String name) throws ModelException {\n MappingField field = (MappingField) getMappingField(name);\n\n if (field == null) {\n List fieldList = getMappingFieldsInternal();\n\n if (!fieldList.contains(field)) {\n try {\n fireVetoableChange(PROP_FIELDS, null, null);\n field = newMappingFieldInstance(name, this);\n fieldList.add(field);\n firePropertyChange(PROP_FIELDS, null, null);\n } catch (PropertyVetoException e) {\n throw new ModelVetoException(e);\n }\n }\n }\n\n return field;\n }", "private void reWriteField(HttpServletRequest request) {\n\t\t// Reesccribir campos\n\t\trequest.setAttribute(\"importe\", importe);\n\t\trequest.setAttribute(\"concepto\", concepto);\n\t\trequest.setAttribute(\"coche\", c);\n\t}", "public void create(HandlerContext context, Management request, Management response) {\n\t\t// TODO Auto-generated method stub\n\n\t}", "FieldRuleType createFieldRuleType();", "@FormUrlEncoded\n @POST(\"UserData/create_order\")\n public Observable<UserDataResponse> CreateOrder(@Field(\"ord_slm_id\") String ord_slm_id,\n @Field(\"ord_dl_id\") String dealer_id,\n @Field(\"sord_prd_id\") String sord_prd_id,\n @Field(\"sord_qty\") String sord_qty,\n @Field(\"sord_price\") String sord_price,\n @Field(\"ord_total\") String ord_total,\n @Field(\"ord_point\") String ord_point,\n @Field(\"sord_point\") String sord_point,\n @Field(\"sord_total\") String sord_total,\n @Field(\"ord_type\") String ord_type,\n @Field(\"ord_dstr_id\") String ord_dstr_id,\n @Field(\"ord_dl_id\") String ord_dl_id);", "public void addField()\n {\n DefaultMutableTreeNode node = (DefaultMutableTreeNode) availableFieldsComp.getTree().getLastSelectedPathComponent();\n if (node == null || !node.isLeaf() || !(node.getUserObject() instanceof DataObjDataFieldWrapper) )\n {\n return; // not really a field that can be added, just empty or a string\n }\n\n Object obj = node.getUserObject();\n if (obj instanceof DataObjDataFieldWrapper)\n {\n DataObjDataFieldWrapper wrapper = (DataObjDataFieldWrapper) obj;\n String sep = sepText.getText();\n if (StringUtils.isNotEmpty(sep))\n {\n try\n {\n DefaultStyledDocument doc = (DefaultStyledDocument) formatEditor.getStyledDocument();\n if (doc.getLength() > 0)\n {\n doc.insertString(doc.getLength(), sep, null);\n }\n }\n catch (BadLocationException ble) {}\n \n }\n insertFieldIntoTextEditor(wrapper);\n setHasChanged(true);\n }\n }", "@PostMapping(\"/creaPerfil\")\n public void creaPerfil(@RequestBody PerfilDto request){\n\n log.info(\"Creando Perfil: {}\",request);\n\n Perfil perfil = new Perfil();\n BeanUtils.copyProperties(request,perfil);\n\n perfilService.savePefil(perfil);\n\n }", "@FormUrlEncoded\n @POST(\"posts\")\n Call<Post> createPost(@Field(\"userId\") int userId, @Field(\"title\") String title, @Field(\"body\") String text);", "public UserInputField() {\n }", "public AttributeField(Field field){\n this.field = field;\n }", "@Override\n public ResponseEntity createEmployee(@Valid Employee employeeRequest) {\n Employee savedemployee = employeeService.create(employeeRequest);\n URI location= ServletUriComponentsBuilder.fromCurrentRequest().path(\"/{id}\").buildAndExpand(savedemployee.getId()).toUri();\n return ResponseEntity.created(location).build();\n\n }", "@SuppressWarnings(value=\"unchecked\")\n public void put(int field$, java.lang.Object value$) {\n switch (field$) {\n case 0: req_custid = (java.lang.Integer)value$; break;\n case 1: req_message = (java.lang.String)value$; break;\n case 2: req_json = (java.lang.String)value$; break;\n case 3: req_remote_addr = (java.lang.String)value$; break;\n case 4: req_uri = (java.lang.String)value$; break;\n case 5: req_headers = (java.lang.String)value$; break;\n case 6: req_method = (java.lang.String)value$; break;\n case 7: result_json = (java.lang.String)value$; break;\n case 8: result_post = (java.lang.String)value$; break;\n default: throw new org.apache.avro.AvroRuntimeException(\"Bad index\");\n }\n }", "@RequestMapping(value = \"/flight/{flightNumber}/**\", method = RequestMethod.POST, produces = {\n\t\t\tMediaType.APPLICATION_XML_VALUE })\n\tpublic Flight createFlight(@PathVariable(\"flightNumber\") String flightNumber, @RequestParam(\"price\") int price,\n\t\t\t@RequestParam(\"from\") String from, @RequestParam(\"to\") String to,\n\t\t\t@RequestParam(\"departureTime\") @DateTimeFormat(pattern = \"yyyy-MM-dd-HH\") Date departureTime,\n\t\t\t@RequestParam(\"arrivalTime\") @DateTimeFormat(pattern = \"yyyy-MM-dd-HH\") Date arrivalTime,\n\t\t\t@RequestParam(\"capacity\") int capacity, @RequestParam(\"description\") String description,\n\t\t\t@RequestParam(\"model\") String model, @RequestParam(\"manufacturer\") String manufacturer,\n\t\t\t@RequestParam(\"yearOfManufacture\") int yearOfManufacture) throws customException {\n\n\t\tFlight flight = new Flight();\n\t\tPlane pl = new Plane();\n\n\t\tpl.setCapacity(capacity);\n\t\tpl.setManufacturer(manufacturer);\n\t\tpl.setModel(model);\n\t\tpl.setYearOfManufacture(yearOfManufacture);\n\n\t\tflight.setNumber(flightNumber);\n\t\tflight.setPrice(price);\n\t\tflight.setTo(to);\n\t\tflight.setFrom(from);\n\t\tflight.setArrivalTime(arrivalTime);\n\t\tflight.setDepartureTime(departureTime);\n\t\tflight.setDescription(description);\n\t\tflight.setPlane(pl);\n\t\tflight.setSeatsLeft(capacity);\n\n\t\tflightServices.createFlight(flight);\n\n\t\treturn flight;\n\t}", "@PostMapping(\"/rooms/create\")\n public ResponseEntity create(HttpServletRequest req, HttpServletResponse res,\n @RequestBody String roomDetails) throws JsonProcessingException {\n roomService.create(roomDetails);\n return ResponseEntity.status(200).build();\n }", "@Override\n public Room create(RoomResponseDTO roomResponseDTO) {\n return roomRepository.save(new Room(\n roomResponseDTO.getClassroomNumber()\n ));\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n registerNewMember(request, response);\n }", "private FieldInfo() {\r\n\t}", "protected abstract Command getCreateCommand(CreateRequest request);", "public JsonField() {\n }", "Rule Field() {\n // Push 1 FieldNode onto the value stack\n return Sequence(\n Optional(FieldID()),\n Optional(FieldReq()),\n FieldType(), // pushes FieldType onto the value stack\n Identifier(), // pushes Identifier onto the value stack\n Optional(Sequence(\"= \", ConstValue())),\n //XsdFieldOptions(),\n Optional(ListSeparator()),\n WhiteSpace(),\n actions.pushFieldNode());\n }", "@POST\n @Consumes(MediaType.APPLICATION_JSON)\n @Produces(MediaType.APPLICATION_JSON)\n @ApiOperation(value = \"This method allows to create a new requirement.\")\n @ApiResponses(value = {\n @ApiResponse(code = HttpURLConnection.HTTP_CREATED, message = \"Returns the created requirement\", response = RequirementEx.class),\n @ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = \"Unauthorized\"),\n @ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = \"Not found\"),\n @ApiResponse(code = HttpURLConnection.HTTP_INTERNAL_ERROR, message = \"Internal server problems\")\n })\n public Response createRequirement(@ApiParam(value = \"Requirement entity\", required = true) Requirement requirementToCreate) {\n DALFacade dalFacade = null;\n try {\n UserAgent agent = (UserAgent) Context.getCurrent().getMainAgent();\n long userId = agent.getId();\n String registratorErrors = service.bazaarService.notifyRegistrators(EnumSet.of(BazaarFunction.VALIDATION, BazaarFunction.USER_FIRST_LOGIN_HANDLING));\n if (registratorErrors != null) {\n ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, registratorErrors);\n }\n // TODO: check whether the current user may create a new requirement\n dalFacade = service.bazaarService.getDBConnection();\n Gson gson = new Gson();\n Integer internalUserId = dalFacade.getUserIdByLAS2PeerId(userId);\n requirementToCreate.setCreatorId(internalUserId);\n Vtor vtor = service.bazaarService.getValidators();\n vtor.useProfiles(\"create\");\n vtor.validate(requirementToCreate);\n if (vtor.hasViolations()) {\n ExceptionHandler.getInstance().handleViolations(vtor.getViolations());\n }\n vtor.resetProfiles();\n\n // check if all components are in the same project\n for (Component component : requirementToCreate.getComponents()) {\n component = dalFacade.getComponentById(component.getId());\n if (requirementToCreate.getProjectId() != component.getProjectId()) {\n ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.VALIDATION, \"Component does not fit with project\");\n }\n }\n boolean authorized = new AuthorizationManager().isAuthorized(internalUserId, PrivilegeEnum.Create_REQUIREMENT, String.valueOf(requirementToCreate.getProjectId()), dalFacade);\n if (!authorized) {\n ExceptionHandler.getInstance().throwException(ExceptionLocation.BAZAARSERVICE, ErrorCode.AUTHORIZATION, Localization.getInstance().getResourceBundle().getString(\"error.authorization.requirement.create\"));\n }\n Requirement createdRequirement = dalFacade.createRequirement(requirementToCreate, internalUserId);\n dalFacade.followRequirement(internalUserId, createdRequirement.getId());\n\n // check if attachments are given\n if (requirementToCreate.getAttachments() != null && !requirementToCreate.getAttachments().isEmpty()) {\n for (Attachment attachment : requirementToCreate.getAttachments()) {\n attachment.setCreatorId(internalUserId);\n attachment.setRequirementId(createdRequirement.getId());\n vtor.validate(attachment);\n if (vtor.hasViolations()) {\n ExceptionHandler.getInstance().handleViolations(vtor.getViolations());\n }\n vtor.resetProfiles();\n dalFacade.createAttachment(attachment);\n }\n }\n\n createdRequirement = dalFacade.getRequirementById(createdRequirement.getId(), internalUserId);\n service.bazaarService.getNotificationDispatcher().dispatchNotification(service, createdRequirement.getCreation_time(), Activity.ActivityAction.CREATE, createdRequirement.getId(),\n Activity.DataType.REQUIREMENT, createdRequirement.getComponents().get(0).getId(), Activity.DataType.COMPONENT, internalUserId);\n return Response.status(Response.Status.CREATED).entity(gson.toJson(createdRequirement)).build();\n } catch (BazaarException bex) {\n if (bex.getErrorCode() == ErrorCode.AUTHORIZATION) {\n return Response.status(Response.Status.UNAUTHORIZED).entity(ExceptionHandler.getInstance().toJSON(bex)).build();\n } else {\n return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build();\n }\n } catch (Exception ex) {\n BazaarException bex = ExceptionHandler.getInstance().convert(ex, ExceptionLocation.BAZAARSERVICE, ErrorCode.UNKNOWN, \"\");\n return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ExceptionHandler.getInstance().toJSON(bex)).build();\n } finally {\n service.bazaarService.closeDBConnection(dalFacade);\n }\n }", "public void onDeviceMappingCreateRequest(String hardwareId, String originator, IDeviceMappingCreateRequest request)\r\n\t throws SiteWhereException;", "private Customer parseNewCustomer(HttpServletRequest request, int cust_id){\n\t\t//parse new customer from request\n\t\tCustomer cust = new Customer();\n\t\tcust.setID(cust_id);\n\t\tcust.setFirstName(request.getParameter(\"first_name\"));\n\t\tcust.setLastName(request.getParameter(\"last_name\"));\n\t\tcust.setAddress(request.getParameter(\"address\"));\n\t\tcust.setCity(request.getParameter(\"city\"));\n\t\tcust.setState(request.getParameter(\"state\"));\n\t\tcust.setPhoneNumber(request.getParameter(\"phone\"));\n\t\treturn cust;\n\t}", "FieldRefType createFieldRefType();" ]
[ "0.654787", "0.6349394", "0.5826492", "0.5814961", "0.5714794", "0.5681315", "0.56407434", "0.55798054", "0.5572074", "0.5526536", "0.5449499", "0.5413799", "0.5390495", "0.5370032", "0.53590757", "0.5321475", "0.531641", "0.5290527", "0.52833706", "0.5275468", "0.52746356", "0.52641964", "0.5257109", "0.525543", "0.52246326", "0.51876855", "0.51852894", "0.51826376", "0.51732403", "0.5168581", "0.5165857", "0.5164589", "0.5149695", "0.51487", "0.51417243", "0.5140209", "0.5123511", "0.50957865", "0.5076161", "0.5068863", "0.50536937", "0.5049371", "0.50469774", "0.5034964", "0.5034761", "0.50244164", "0.49996823", "0.49996814", "0.49755213", "0.49732274", "0.49710065", "0.4945361", "0.49415115", "0.49407333", "0.49345526", "0.4928854", "0.49282315", "0.49176633", "0.49094492", "0.49059433", "0.49043876", "0.49030223", "0.4897137", "0.48918703", "0.48861045", "0.48824152", "0.48725408", "0.4863427", "0.48615375", "0.48563927", "0.48522493", "0.4852175", "0.48458645", "0.4845778", "0.48359862", "0.483292", "0.48293898", "0.48269942", "0.4825687", "0.48251453", "0.4821606", "0.48115185", "0.48090303", "0.48089308", "0.48083234", "0.48054126", "0.47954598", "0.4790381", "0.47896034", "0.47824177", "0.47784847", "0.47729704", "0.4770954", "0.4767972", "0.47661304", "0.47649997", "0.47616643", "0.47601777", "0.4753957", "0.475214", "0.47510943" ]
0.0
-1
Hash the file upload data and move the temporary uploaded file to its final destination.
public void moveBinaryFile(InternalActionContext ac, String uuid, String segmentedPath) { MeshUploadOptions uploadOptions = Mesh.mesh().getOptions().getUploadOptions(); File uploadFolder = new File(uploadOptions.getDirectory(), segmentedPath); File targetFile = new File(uploadFolder, uuid + ".bin"); String targetPath = targetFile.getAbsolutePath(); checkUploadFolderExists(uploadFolder); deletePotentialUpload(targetPath); moveUploadIntoPlace(ac.get("sourceFile"), targetPath); // Since this function can be called multiple times (if a transaction fails), we have to // update the path so that moving the file works again. ac.put("sourceFile", targetPath); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private File moveTempFile(final CommonsMultipartFile fileData, final String originalFileName) throws IOException {\n String deployFileName = buildDeployFileName(originalFileName);\n logger.info(\"Moving to {}\", deployFileName);\n final File tempFile = new File(deployFileName);\n fileData.transferTo(tempFile);\n return tempFile;\n }", "void uploadFinished(StreamingEndEvent event, File uploadedTemporaryFile);", "public String hashAndStoreBinaryFile(Buffer buffer, String uuid, String segmentedPath) {\n\t\tMeshUploadOptions uploadOptions = Mesh.mesh().getOptions().getUploadOptions();\n\t\tFile uploadFolder = new File(uploadOptions.getDirectory(), segmentedPath);\n\t\tFile targetFile = new File(uploadFolder, uuid + \".bin\");\n\t\tString targetPath = targetFile.getAbsolutePath();\n\n\t\tString sha512sum = hashBuffer(buffer);\n\t\tcheckUploadFolderExists(uploadFolder);\n\t\tdeletePotentialUpload(targetPath);\n\t\tstoreBuffer(buffer, targetPath);\n\t\treturn sha512sum;\n\t}", "protected void moveUploadIntoPlace(String fileUpload, String targetPath) {\n\t\tFileSystem fileSystem = Mesh.vertx().fileSystem();\n\t\tfileSystem.moveBlocking(fileUpload, targetPath);\n\t\tif (log.isDebugEnabled()) {\n\t\t\tlog.debug(\"Moved upload file from {\" + fileUpload + \"} to {\" + targetPath + \"}\");\n\t\t}\n\t\t// log.error(\"Failed to move upload file from {\" + fileUpload.uploadedFileName() + \"} to {\" + targetPath + \"}\", error);\n\t}", "public void rewritingHashedFile(File path) throws IOException {\n\t\tFileInputStream fis = new FileInputStream(path);\n\t\tbyte[] inputBytes = new byte[fis.available() - 64];\n\t\tfis.read(inputBytes);\n\t\tfis.close();\n\t\t\n\t\tFileOutputStream fos = new FileOutputStream(path);\n\t\tfos.write(inputBytes);\n\t\tfos.close();\n\t}", "private void finalizeFileSystemFile() throws IOException {\n Path finalConfigPath = getFinalConfigPath(tempConfigPath);\n fileSystem.rename(tempConfigPath, finalConfigPath);\n LOG.info(\"finalize temp configuration file successfully, finalConfigPath=\"\n + finalConfigPath);\n }", "@Override\n public final void writeFinal() {\n ((StructuredFileSortHash) file).hashfile.writeHash(getBucketIndex(), file.getOffset());\n writeRecordData();\n }", "@Override\n public boolean transferFile (MultipartFile file, String tag, String resultFilename) {\n try {\n file.transferTo(new File(Constans.UPLOADPATH + \"/\" + tag + \"/\" + resultFilename));\n }catch (IOException e){\n e.printStackTrace();\n return false;\n }\n return true;\n }", "protected void work() {\n try {\n if(theFile!=null) { \n //construct filePath, fileSize\n int fileSize = theFile.getFileSize();\n if(fileSize==0) fileSize=1;\n String filePath = path+\"/\"+theFile.getFileName();\n if(log.isDebugEnabled()) log.debug(\"Uploading file: \"+filePath+\", filesize: \"+fileSize/1000+\"KB\");\n\t\t\t\n //write out file\n InputStream stream = theFile.getInputStream();\n OutputStream bos = new FileOutputStream(filePath);\n int bytesRead = 0;\n byte[] buffer = new byte[Constants.FILEUPLOAD_BUFFER];\n while(isRunning() && ((bytesRead = stream.read(buffer, 0, Constants.FILEUPLOAD_BUFFER)) != -1)) {\n bos.write(buffer, 0, bytesRead);\n sum+=bytesRead;\n setPercent(sum/fileSize);\n }\n bos.close();\n stream.close();\n }\n } catch(Exception ex) {\n setRunning(false);\n log.error(\"Error while uploading: \"+ex.getMessage());\n ex.printStackTrace();\n }\n }", "private void doFileUpload(String contextname, MultipartFile uploadedFile) throws IOException {\n SystemContext systemContext = getSystemContextByName(contextname);\n\n if (systemContext != null) { //todo not sure why this if statement is useful here?\n\n if (thereIsANewFileToUpload(uploadedFile)) {\n //todo this is one of those times we probably need to do transactions.\n uploadFileToDatabase(uploadedFile, systemContext);\n\n } else //we need to copy the blob from the previous version, which is always 1\n {\n copyPreviousVersionOfFileToNewRecord(systemContext);\n }\n }\n }", "public synchronized void upload(){\n\t}", "@Override\n public void uploadSucceeded(Upload.SucceededEvent event) {\n if ( fileDataByteArrayOutputStream != null ) {\n try {\n fileDataByteArrayOutputStream.flush();\n fileData = fileDataByteArrayOutputStream.toByteArray();\n fileDataByteArrayOutputStream.close(); // presume the upload actually closes this\n } catch (Exception e) {}\n finally {\n fileDataByteArrayOutputStream = null;\n }\n }\n if ( isNotAllowedMimeType ) { // small files can be fully uploaded before we detect an invalid mime type\n System.out.println(\"uploadSucceeded() - INVALID MIME TYPE detected after successful upload: \" + mimeType);\n //afterUploadFailed(fileName,isCanceled,isNotAllowedMimeType,false,contentLength,maxSizeInBytes);\n resetUpload();\n }\n }", "protected void uploadFrom(VFSTransfer transferInfo, VFile localSource) throws VlException \n {\n // copy contents into this file. \n vrsContext.getTransferManager().doStreamCopy(transferInfo, localSource,this); \n }", "@Override\n public void uploadPart(RefCountedFSOutputStream file) throws IOException {\n // this is to guarantee that nobody is\n // writing to the file we are uploading.\n checkState(file.isClosed());\n\n final CompletableFuture<PartETag> future = new CompletableFuture<>();\n uploadsInProgress.add(future);\n\n final long partLength = file.getPos();\n currentUploadInfo.registerNewPart(partLength);\n\n file.retain(); // keep the file while the async upload still runs\n uploadThreadPool.execute(new UploadTask(s3AccessHelper, currentUploadInfo, file, future));\n }", "@Override\n\tpublic void fileUpload(FileVO fileVO) {\n\t\tworkMapper.fileUpload(fileVO);\n\t}", "private void uploadFile(Path filePath) throws IOException {\n try {\n byte[] md5hash =\n Base64.decodeBase64(\n storage\n .objects()\n .get(bucketName(project), filePath.getFileName().toString())\n .execute()\n .getMd5Hash());\n try (InputStream inputStream = Files.newInputStream(filePath, StandardOpenOption.READ)) {\n if (Arrays.equals(md5hash, DigestUtils.md5(inputStream))) {\n log.info(\"File \" + filePath.getFileName() + \" is current, reusing.\");\n return;\n }\n }\n log.info(\"File \" + filePath.getFileName() + \" is out of date, uploading new version.\");\n storage.objects().delete(bucketName(project), filePath.getFileName().toString()).execute();\n } catch (GoogleJsonResponseException e) {\n if (e.getStatusCode() != HttpStatus.SC_NOT_FOUND) {\n throw e;\n }\n }\n\n storage\n .objects()\n .insert(\n bucketName(project),\n null,\n new FileContent(\"application/octet-stream\", filePath.toFile()))\n .setName(filePath.getFileName().toString())\n .execute();\n log.info(\"File \" + filePath.getFileName() + \" created.\");\n }", "public void upoadFile(MultipartFile file) {\n\t\t\n\t\ttry\n\t\t{\n\t\t\t\n\t\t if(!Files.isDirectory(path))\n\t\t {\n\t\t\t System.out.println(\"Directory Created\"+path);\n\t\t\t Files.createDirectories(path);\n\t\t }\n\t\t String fileName=file.getOriginalFilename();\n\t\t Files.copy(file.getInputStream(), this.path.resolve(fileName));\n\t\t System.out.println(\"File uploade details \");\n\t }catch(Exception e)\n\t\t{\n\t\t\tSystem.out.println(\"File uploade error \"+e.getMessage());\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "public uploadFileForPath_result(uploadFileForPath_result other) {\n __isset_bitfield = other.__isset_bitfield;\n this.success = other.success;\n }", "void putFile(String filename, byte[] file) throws FileAlreadyExistsException;", "private void transferFile(final UploadItem uploadItem) throws IOException {\n\n CommonsMultipartFile fileData = uploadItem.getFileData();\n List<String> muleDeployUrls = getMuleDeployUrls();\n String originalFileName = fileData.getFileItem().getName();\n for (String muleDeployUrl : muleDeployUrls) {\n final File tempFile = moveTempFile(fileData, originalFileName);\n sendToMule(tempFile, muleDeployUrl);\n tempFile.delete();\n }\n }", "@Override\n\t\t\tpublic void uploadSuccess(DefaultPutRet ret) {\n\t\t\t\tSystem.out.println(ret.key+\" uoload sucess!!!\");\n\t\t\t\tsynchronized (this) {\n int row = fileKeys.indexOf(ret.key);\n resultTable.setValueAt(\"finish\", row, 2);\n\t\t\t\t}\n\t\t\t}", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String codeLabWorker1 = \"\";\n if (!ServletFileUpload.isMultipartContent(request)) {\n\t\t PrintWriter writer = response.getWriter();\n\t\t writer.println(\"Error: enctype=multipart/form-data\");\n\t\t writer.flush();\n\t\t return;\n\t\t}\n\n DiskFileItemFactory factory = new DiskFileItemFactory();\n factory.setSizeThreshold(MEMORY_THRESHOLD);\n factory.setRepository(new File(System.getProperty(\"java.io.tmpdir\")));\n \n ServletFileUpload upload = new ServletFileUpload(factory); \n upload.setFileSizeMax(MAX_FILE_SIZE);\n upload.setSizeMax(MAX_REQUEST_SIZE);\n String uploadPath = getServletContext().getRealPath(\"./\") + File.separator + UPLOAD_DIRECTORY;\n \n File uploadDir = new File(uploadPath);\n if (!uploadDir.exists()) {\n uploadDir.mkdir();\n }\n try {\n @SuppressWarnings(\"unchecked\")\n List<FileItem> formItems = upload.parseRequest(request);\n if (formItems != null && formItems.size() > 0) {\n File storeFile = null;\n String codeResult = \"\";\n String codeLabWorker = \"\"; \n String dateToday = getDateToday();\n String time = getTime();\n for (FileItem item : formItems) { \n if (!item.isFormField()) {\n String fileName = new File(item.getName()).getName();\n String filePath = uploadPath + File.separator + fileName;\n storeFile = new File(filePath);\n System.out.println(filePath);\n item.write(storeFile); \n }else{\n String fieldName = item.getFieldName();\n String fieldValue = item.getString();\n if (fieldName.equals(\"codeLabWorker\")) {\n codeLabWorker = fieldValue;\n codeLabWorker1=codeLabWorker;\n }else if (fieldName.equals(\"codeResult\")) {\n codeResult = fieldValue;\n }\n } \n }\n //Enviar a guardar\n LabWorkerDB labDB = new LabWorkerDB();\n labDB.updateResult(codeLabWorker, storeFile, dateToday, time, codeResult);\n JOptionPane.showMessageDialog(null,\"Se guardo con exito\");\n }\n } catch (Exception ex) {\n JOptionPane.showMessageDialog(null,ex);\n } \n request.setAttribute(\"username\", codeLabWorker1);\n \n request.getRequestDispatcher(\"/labWorkerGUI/principallabWorker.jsp\").forward(request, response);\n }", "@Override\r\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n progressDialog.dismiss();\r\n updateRealTimeDB(userId, path);\r\n\r\n //and displaying a success toast\r\n finish();\r\n\r\n Toast.makeText(getApplicationContext(), \"File Uploaded \", Toast.LENGTH_LONG).show();\r\n }", "String saveData(MultipartFile md5File) throws IOException;", "private OutputStream uploadFile(String filename) {\n try {\n // Output stream to write to\n File file = getFile(getCurrentDir() + \"/\" + filename, getCredentials());\n\n return new BufferedFileOutputStream(file);\n } catch (IOException e) {\n showNotification(\"Error\", e.toString(), Notification.TYPE_ERROR_MESSAGE, e);\n }\n return null;\n }", "public void commitJob(JobContext context) throws IOException {\n JobConf conf = context.getJobConf();\r\n Path outputPath = FileOutputFormat.getOutputPath(conf);\r\n if (outputPath != null) {\r\n FileSystem outputFileSystem = outputPath.getFileSystem(conf);\r\n Path tmpDir = new Path(outputPath, getJobAttemptBaseDirName(context) +\r\n Path.SEPARATOR + FileOutputCommitter.TEMP_DIR_NAME);\r\n FileSystem fileSys = tmpDir.getFileSystem(context.getConfiguration());\r\n if (fileSys.exists(tmpDir)) {\r\n fileSys.delete(tmpDir, true);\r\n } else {\r\n LOG.warn(\"Task temp dir could not be deleted \" + tmpDir);\r\n }\r\n\r\n //move the job output to final place\r\n Path jobOutputPath = \r\n new Path(outputPath, getJobAttemptBaseDirName(context));\r\n moveJobOutputs(outputFileSystem, \r\n jobOutputPath, outputPath, jobOutputPath);\r\n\r\n // delete the _temporary folder in the output folder\r\n cleanupJob(context);\r\n // check if the output-dir marking is required\r\n if (shouldMarkOutputDir(context.getJobConf())) {\r\n // create a _success file in the output folder\r\n markOutputDirSuccessful(context);\r\n }\r\n }\r\n }", "public uploadFileForExperiment_result(uploadFileForExperiment_result other) {\n __isset_bitfield = other.__isset_bitfield;\n this.success = other.success;\n }", "public File write(File destination) throws IOException {\n if (data != null) {\n FileUtil.writeBytes(destination, data);\n } else if (tempFile != null) {\n FileUtil.move(tempFile, destination);\n }\n return destination;\n }", "private void uploadFromDataStorage() {\n }", "private void tempTOuserFolder (HttpServletRequest request,String folderName,String fileName,String original_name,String fileType)throws IOException{\n try {\n String tempPath=request.getSession().getServletContext().getRealPath(\"/\")+\"\\\\\"+REPOSITORY+\"\\\\\"+username+\"\\\\\"+TEMP;\n String persistentPath=request.getSession().getServletContext().getRealPath(\"/\")+\"\\\\\"+REPOSITORY+\"\\\\\"+username+\"\\\\\"+PERSISTENT+\"\\\\\"+folderName;\n File newFile=new File(persistentPath);\n if(!newFile.exists()){\n newFile.mkdirs();//创建永久文件路径\n }\n if(original_name.endsWith(\".csv\")){\n original_name.replace(\"csv\",\"xls\");\n System.out.println(original_name);\n }\n if(original_name.endsWith(\".txt\")){\n original_name.replace(\"txt\",\"xls\");\n System.out.println(original_name);\n }\n //临时文件\n File oldFile=new File(tempPath,original_name);\n if(oldFile==null){\n return;\n }\n //永久文件\n StringBuffer strBuffer=new StringBuffer(fileName);\n strBuffer.append(\".\").append(fileType);\n System.out.println(\"strbuffer:\"+strBuffer);\n File file=new File(newFile,new String(strBuffer));\n Files.copy(oldFile.toPath(), file.toPath());\n oldFile.delete();\n }catch (IOException io){\n io.printStackTrace();\n throw new IOException(\"文件移动失败!\");\n\n }\n }", "public void uploadTemp(FileUploadEvent event) {\n setFileImage(event.getFile());\n getSelected().setUrlImage(event.getFile().getFileName());\n RequestContext.getCurrentInstance().update(\"image\");\n\n }", "protected void deletePotentialUpload(String targetPath) {\n\t\tFileSystem fileSystem = Mesh.vertx().fileSystem();\n\t\tif (fileSystem.existsBlocking(targetPath)) {\n\t\t\t// Deleting of existing binary file\n\t\t\tfileSystem.deleteBlocking(targetPath);\n\t\t}\n\t\t// log.error(\"Error while attempting to delete target file {\" + targetPath + \"}\", error);\n\t\t// log.error(\"Unable to check existence of file at location {\" + targetPath + \"}\");\n\n\t}", "private File checkContent(InputStream input, HashResult hashResult)\n throws IOException, NoSuchAlgorithmException {\n File tmpFile = File.createTempFile(\"imported\", \"\", null);\n\n MessageDigest md = MessageDigest.getInstance(hashResult.getAlgorithm());\n\n if (md == null) {\n throw new RuntimeException(\"No digest could be obtained\");\n }\n\n FileOutputStream fos = null;\n\n try {\n fos = new FileOutputStream(tmpFile);\n } finally {\n IOUtil.safeClose(fos);\n }\n\n try {\n StreamUtil.copy(input, fos, -1, null, true, md);\n } finally {\n IOUtil.safeClose(fos);\n }\n\n if (!hashResult.equalsBytes(md.digest())) {\n throw new IllegalArgumentException(\"Checksum error: Expected = '\"\n\t + ByteArray.toHexString(hashResult.getBytes()) + \"', Found = '\"\n\t + ByteArray.toHexString(md.digest()) + \"'\");\n }\n\n return tmpFile;\n }", "public void upload() {\r\n if (file != null) {\r\n try {\r\n String filepath = super.getUploadFolder() + \"/\" + file.getFileName();\r\n filepath = FileUtil.alternativeFilepathIfExists(filepath);\r\n FileUtil.createFile(filepath);\r\n\r\n file.write(filepath);\r\n super.info(\"Succesful\", file.getFileName() + \" is uploaded.\");\r\n\r\n Upload upload = new Upload();\r\n upload.setDescription(description);\r\n upload.setFilepath(filepath);\r\n upload.setTag(Md5Util.getMd5Sum(filepath));\r\n this.description = null;\r\n uploads.add(upload);\r\n // update ui and ready for save in db\r\n } catch (Exception e) {\r\n System.out.println(e);\r\n }\r\n }\r\n }", "public String StoreFile(MultipartFile file) {\n \t \t\n // Normalize file name\n String fileName = StringUtils.cleanPath(file.getOriginalFilename());\n \n // Get any exiting versions of the file\n String[] fileNames = GetAllFileNames(fileName);\n int iNextIndex = fileNames.length + 1;\n \n // Increment the version of the file. All files start with 1.\n String fileNameIndexed = Integer.toString(iNextIndex) + \"_\" + fileName;\n \n try \n {\n // Check if the file's name contains invalid characters. ('_' if not valid because it's used to track version.)\n if(fileName.contains(\"..\") || fileName.contains(\"_\")) {\n throw new FileStorageException(\"Sorry! Filename contains invalid path sequence \" + fileName);\n }\n\n // Copy file to the target location (Replacing existing file with the same name)\n Path targetLocation = this.fileStorageLocation.resolve(fileNameIndexed);\n Files.copy(file.getInputStream(), targetLocation, StandardCopyOption.REPLACE_EXISTING);\n\n return fileName;\n } \n catch (IOException ex) \n {\n throw new FileStorageException(\"Could not store file \" + fileName + \". Please try again!\", ex);\n }\n }", "private void moveToFinal(String imageName, String sourceDirectory,\n\t\t\t\tString destinationDirectory) {\n\t\t\t// TODO Auto-generated method stub\n\t\t\ttry {\n\n\t\t\t\tFile afile = new File(sourceDirectory + imageName);\n\t\t\t\tFile bfile = new File(destinationDirectory + imageName);\n\t\t\t\tif (afile.renameTo(bfile)) {\n\t\t\t\t\tSystem.out.println(\"File is moved successful!\");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"File is failed to move!\");\n\t\t\t\t}\n\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t}", "private static long finishUp(long hash) {\n hash ^= hash >>> 33;\n hash *= P2;\n hash ^= hash >>> 29;\n hash *= P3;\n hash ^= hash >>> 32;\n return hash;\n }", "public String uploadFile(UploadedFile file) {\n String fileName = (file.getFileName());\r\n System.out.println(\"***** fileName: \" + file.getFileName());\r\n \r\n System.out.println(System.getProperty(\"os.name\"));\r\n String basePath = \"C:\" + File.separator + \"aquivosCI\" + File.separator;\r\n System.out.println(\"BasePath: \" + basePath);\r\n File outputFilePath = new File(basePath + fileName);\r\n\r\n// Copy uploaded file to destination path\r\n InputStream inputStream = null;\r\n OutputStream outputStream = null;\r\n try {\r\n inputStream = file.getInputstream();\r\n outputStream = new FileOutputStream(outputFilePath);\r\n\r\n int read = 0;\r\n final byte[] bytes = new byte[1024];\r\n while ((read = inputStream.read(bytes)) != -1) {\r\n outputStream.write(bytes, 0, read);\r\n }\r\n\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n\r\n } finally {\r\n if (outputStream != null) {\r\n try {\r\n outputStream.close();\r\n } catch (IOException ex) {\r\n Logger.getLogger(ComunicacaoInternaMB.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }\r\n if (inputStream != null) {\r\n try {\r\n inputStream.close();\r\n } catch (IOException ex) {\r\n Logger.getLogger(ComunicacaoInternaMB.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }\r\n }\r\n return outputFilePath.getAbsolutePath(); // return to same page\r\n }", "public abstract WriteResult writeBlob(User user, Blob blob, byte[] oldDigest);", "public void upload(UploadedFile file) {\n FacesContext faces = FacesContext.getCurrentInstance();\n\n getSelected().setUrlImage(file.getFileName());\n String fileExtension = file.getFileName().split(\"\\\\.\")[file.getFileName().split(\"\\\\.\").length - 1];\n\n //String generatedFileName = \"file\" + System.currentTimeMillis();\n File directory = new File(faces.getExternalContext().getRealPath(UPLOAD_DIRECTORY_IMAGE_RELATIVE));\n\n if (!directory.exists()) {\n directory.mkdir();\n }\n\n File newFile = new File(faces.getExternalContext().getRealPath(UPLOAD_DIRECTORY_IMAGE_RELATIVE) + File.separator + file.getFileName());\n try {\n if (!newFile.createNewFile()) {\n String nameGenerated = \"file_generated\" + System.currentTimeMillis();\n newFile = new File(faces.getExternalContext().getRealPath(UPLOAD_DIRECTORY_IMAGE_RELATIVE) + File.separator + nameGenerated + \".\" + fileExtension);\n getSelected().setUrlImage(nameGenerated);\n }\n\n FileOutputStream output = new FileOutputStream(newFile);\n\n byte[] buffer = new byte[BUFFER];\n\n int bulk;\n\n InputStream input = file.getInputstream();\n\n while (true) {\n bulk = input.read(buffer);\n\n if (bulk < 0) {\n break;\n }\n\n output.write(buffer, 0, bulk);\n output.flush();\n }\n\n output.close();\n input.close();\n\n } catch (Exception ex) {\n ex.printStackTrace();\n FacesContext.getCurrentInstance().addMessage(\"\", new FacesMessage(bundle.getString(\"Error_file_created\")));\n }\n\n }", "public Builder clearFileHash() {\n\n fileHash_ = getDefaultInstance().getFileHash();\n onChanged();\n return this;\n }", "public Builder clearFileHash() {\n\n fileHash_ = getDefaultInstance().getFileHash();\n onChanged();\n return this;\n }", "public boolean moveToFinalLocation() {\n\n if (tempFile==null)\n return false;\n\n if (RecDir==null || RecSubdir==null) {\n Log.getInstance().write(Log.LOGLEVEL_ERROR, \"RecordingEpisode.moveToFinalLocation: null Dir or SubDir = \" + RecDir + \":\" + RecSubdir);\n\n if (!tempFile.delete()) {\n Log.getInstance().write(Log.LOGLEVEL_WARN, \"RecordingEpisode.moveToFinalLocation: Failed to delete tempFile.\");\n }\n\n return false;\n }\n\n File DestPath = new File(RecDir + File.separator + RecSubdir);\n\n if (DestPath==null) {\n Log.getInstance().write(Log.LOGLEVEL_ERROR, \"RecordingEpisode.moveToFinalLocation: null DestPath = \" + RecDir + \":\" + RecSubdir);\n\n if (!tempFile.delete()) {\n Log.getInstance().write(Log.LOGLEVEL_WARN, \"RecordingEpisode.moveToFinalLocation: Failed to delete tempFile.\");\n }\n\n return false;\n }\n\n if (!DestPath.isDirectory()) {\n if (!DestPath.mkdir()) {\n Log.getInstance().write(Log.LOGLEVEL_ERROR, \"RecordingEpisode.moveToFinalLocation: Could not create directory \" + DestPath);\n\n if (!tempFile.delete()) {\n Log.getInstance().write(Log.LOGLEVEL_ERROR, \"RecordingEpisode.moveToFinalLocation: Failed to delete tempFile.\");\n }\n return false;\n }\n }\n\n NewFile = this.getUniqueFile();\n\n if (NewFile==null) {\n Log.getInstance().write(Log.LOGLEVEL_ERROR, \"RecordingEpisode.moveToFinalLocation: Could not create unique file.\");\n\n if (!tempFile.delete()) {\n Log.getInstance().write(Log.LOGLEVEL_WARN, \"RecordingEpisode.moveToFinalLocation: Failed to delete tempFile.\");\n }\n\n return false;\n }\n\n Log.getInstance().write(Log.LOGLEVEL_TRACE, \"RecordingEpisode.moveToFinalLocation: Moving = \" + tempFile.getAbsolutePath() + \"->\" + NewFile.getAbsolutePath());\n\n if (!tempFile.renameTo(NewFile)) {\n Log.getInstance().write(Log.LOGLEVEL_ERROR, \"RecordingEpisode.moveToFinalLocation: Moving failed.\");\n }\n\n if (!tempFile.delete()) {\n Log.getInstance().write(Log.LOGLEVEL_WARN, \"RecordingEpisode.moveToFinalLocation: Failed to delete tempFile.\");\n }\n\n return true;\n }", "public static void moveFile(File source, File destination) throws Exception {\n\tif (destination.exists()) {\n\t destination.delete();\n\t}\n\tsource.renameTo(destination);\n }", "public void upload_file(FileUploadEvent event) throws IOException {\n \t\n \tUploadedFile uploaded_file=event.getFile();\n \tFacesContext context = FacesContext.getCurrentInstance();\n \t\n\t\tHttpSession session = (HttpSession) FacesContext.getCurrentInstance()\n \t\t\t\t.getExternalContext().getSession(true);\n \t\tString pictures_folder=session.getAttribute(\"pictures_folder\").toString();\n \t\t\n \t\tPath folder = Paths.get(pictures_folder);\n\t\t\n\t\tString filename = FilenameUtils.getBaseName(uploaded_file.getFileName()); \n\t\tString extension = FilenameUtils.getExtension(uploaded_file.getFileName());\n\t\t//tou dinei rando onoma\n\t\tPath file = Files.createTempFile( folder,filename+\"-\" , \".\" + extension);\n\t\tSystem.out.println(\"folder: \"+folder.toString()+\"\\n\"+\"filename: \"+filename+\"\\n\"\n\t\t \t+ \"file: \"+file.toString());\n\t\t\n\t\tString profile_url;\n\t\ttry (InputStream input =uploaded_file.getInputstream()) {\n\t\t Files.copy(input, file, StandardCopyOption.REPLACE_EXISTING);\n\t\t profile_url=file.toString().split(\"/\")[file.toString().split(\"/\").length-1];\n\t\t}\n\n\t\tSystem.out.println(\"Uploaded picture successfully saved in \" + profile_url);\n\t\tString message=\"Pictures were uploaded Successfully\";\n\t\tFacesMessage facesMessage_11 = new FacesMessage(message);\n context.addMessage(files_upload_UI.getClientId(context), facesMessage_11);\n\t\t\n\t\t\n\t\t\n }", "public void submit() {\n fileUploadContainer.upload.submit();\n }", "public boolean moveFileFTP(ApacheCommonsFtpWrapper ftpWrap, String ftpOutPath, String localInPath, String ftpOutFileName, String localInFilename){\r\n\t\tboolean success = true; \r\n\t\tdebugPrintLocalln(\"moveFileFTP()\");\r\n\t\t\r\n\t\ttry {\r\n\t ftpWrap.setFileType(FTP.BINARY_FILE_TYPE);\r\n\t log.info(\"writing file \" + localInPath + \"/\" + localInFilename + \" to ftp as: \" + ftpOutPath + \"/\" + ftpOutFileName);\r\n\t success = ftpWrap.uploadFile(localInPath, localInFilename, ftpOutPath, ftpOutFileName);\r\n\r\n\t if(success){\r\n\t \tdebugPrintLocalln(\"...Done\");\r\n\t }else{\r\n\t \tdebugPrintLocalln(\"...failed!\");\t \t\r\n\t }\r\n\t } catch (Exception ex) {\r\n\t \tdebugPrintLocalln(\"Failed to write file: \" + ftpOutFileName + \" inputPath: \" + ftpOutPath);\r\n\t \tex.printStackTrace();\r\n\t \tsuccess = false;\r\n\t }\r\n\t debugPrintLocalln(\"File move completed.\");\r\n\t\treturn success;\r\n\t}", "public void moveFile(String url) throws IOException {\n\n\t\tSystem.out.println(\"folder_temp : \" + folder_temp);\n\t\tPath Source = Paths.get(folder_temp + url);\n\t\tPath Destination = Paths.get(folder_photo + url);\n\t\tSystem.out.println(\"folder_photo : \" + folder_photo);\n\n\t\tif (Files.exists(Source)) {\n\t\t\t// Files.move(Source, Destination,\n\t\t\t// StandardCopyOption.REPLACE_EXISTING);\n\t\t\t// cpie du fichiet au lieu de deplaacer car il est enn coiurs\n\t\t\t// d'utilisation\n\t\t\tFiles.copy(Source, Destination, StandardCopyOption.REPLACE_EXISTING);\n\t\t}\n\n\t}", "public Path upload(final File localFile) throws IOException {\n\n if (!localFile.exists()) {\n throw new FileNotFoundException(localFile.getAbsolutePath());\n }\n\n final Path source = new Path(localFile.getAbsolutePath());\n final Path destination = new Path(this.path, localFile.getName());\n\n try {\n this.fileSystem.copyFromLocalFile(source, destination);\n } catch (final IOException ex) {\n LOG.log(Level.SEVERE, \"Unable to upload \" + source + \" to \" + destination, ex);\n throw ex;\n }\n\n LOG.log(Level.FINE, \"Uploaded {0} to {1}\", new Object[] {source, destination});\n\n return destination;\n }", "private void uploadFile() {\n if (filePath != null) {\n //displaying a progress dialog while upload is going on\n final ProgressDialog progressDialog = new ProgressDialog(this);\n progressDialog.setTitle(\"Uploading\");\n progressDialog.show();\n\n StorageReference riversRef = mStorageRef.child(previously);\n riversRef.putFile(filePath)\n .addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n //if the upload is successfull\n //hiding the progress dialog\n progressDialog.dismiss();\n\n //and displaying a success toast\n Toast.makeText(getApplicationContext(), \"File Uploaded \", Toast.LENGTH_LONG).show();\n // picup =true;\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception exception) {\n //if the upload is not successfull\n //hiding the progress dialog\n progressDialog.dismiss();\n\n //and displaying error message\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\n }\n })\n .addOnProgressListener(new OnProgressListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onProgress(UploadTask.TaskSnapshot taskSnapshot) {\n //calculating progress percentage\n double progress = (100.0 * taskSnapshot.getBytesTransferred()) / taskSnapshot.getTotalByteCount();\n\n //displaying percentage in progress dialog\n progressDialog.setMessage(\"Uploaded \" + ((int) progress) + \"%...\");\n }\n });\n }\n //if there is not any file\n else {\n //you can display an error toast\n }\n }", "com.google.protobuf.ByteString getFileHash();", "com.google.protobuf.ByteString getFileHash();", "public void testUploadFinalFix() throws Exception {\r\n FileDataSource dataSource = new FileDataSource(\"test_files/stress.jar\");\r\n DataHandler dataHandler = new DataHandler(dataSource);\r\n\r\n Date startTime = new Date();\r\n for (int i = 0; i < 10; ++i) {\r\n services.uploadFinalFix(StressTestHelper.PROJECT_ID, StressTestHelper.USER_ID, \"finalfix.jar\", dataHandler);\r\n }\r\n\r\n Date endTime = new Date();\r\n\r\n System.out.println(\"Executing uploadFinalFix for 10 times takes \"\r\n + (endTime.getTime() - startTime.getTime()) + \" milliseconds\");\r\n\r\n // check the upload\r\n Upload upload = uploadManager.getCreatedUpload();\r\n assertEquals(\"Wrong type\", \"Final Fix\", upload.getUploadType().getName());\r\n assertEquals(\"Wrong status\", \"Active\", upload.getUploadStatus().getName());\r\n assertEquals(\"Wrong project id\", StressTestHelper.PROJECT_ID, upload.getProject());\r\n assertTrue(\"Wrong file name\", upload.getParameter().startsWith(\"submission\"));\r\n assertTrue(\"Wrong file name\", upload.getParameter().endsWith(\"jar\"));\r\n assertEquals(\"Wrong user id\", String.valueOf(StressTestHelper.USER_ID), uploadManager.getCreatedUploadUserId());\r\n\r\n // verify screening\r\n assertEquals(\"Screening should not be initiate\", -1, screeningManager.getSubmissionId());\r\n\r\n // verify previous submissions\r\n Upload updatedUpload = uploadManager.getUpdatedUpload();\r\n assertEquals(\"Previous upload should be deleted\", updatedUpload.getUploadStatus().getName(), \"Deleted\");\r\n\r\n\r\n File uploadedDir = new File(\"test_files/upload/\");\r\n File uploaded = uploadedDir.listFiles()[0];\r\n assertEquals(\"Failed to upload submission\", new File(\"test_files/stress.jar\").length(), uploaded.length());\r\n }", "@Override\n public void resetUploadProgress() {\n ProgressBarLogic.resetProgress();\n }", "void fileTransferProgress(IMSession session, String requestId, String fileId, long bytesTransferred, long bytesTotal);", "private static File createTempFile(final byte[] data) throws IOException {\r\n \t// Genera el archivo zip temporal a partir del InputStream de entrada\r\n final File zipFile = File.createTempFile(\"sign\", \".zip\"); //$NON-NLS-1$ //$NON-NLS-2$\r\n final FileOutputStream fos = new FileOutputStream(zipFile);\r\n\r\n fos.write(data);\r\n fos.flush();\r\n fos.close();\r\n\r\n return zipFile;\r\n }", "void uploadSuccessful(long bytes);", "private void uploadFileFinished(SucceededEvent event) {\n try {\n // String fileName = event.getFilename();\n // File f = getFile(fileName);\n // f.setReadOnly(READONLY_REPLICATION_MODE);\n } catch (Exception e) {\n Logging.logMessage(Logging.LEVEL_WARN, this,\"%s, %s, %s\", \"Readonly Exception\", \"Can't set file \" + event.getFilename() + \" to ReadOnly.\", e);\n }\n\n // Update der Liste durchführen\n loadXtreemFSData();\n }", "private void moveShapeDone() {\n System.out.println(\"moving file to \" + BUFFER_DONE_PATH\n + currentFileName);\n File file = new File(BUFFER_ACC_PATH + currentFileName);\n File newFile = new File(BUFFER_DONE_PATH + currentFileName);\n file.renameTo(newFile);\n }", "public synchronized void updateFileSize( long passedSize ){\n \n fileSize = passedSize;\n if( fileSize >= 0 && fileByteCounter >= fileSize )\n finishFileTransfer(); \n }", "@Override\r\n\t\t\tpublic Boolean call() throws Exception {\n\t\t\t\tS3FileHandle updated = fileHandleDao.createFile(fh);\r\n\t\t\t\ttoDelete.add(updated.getId());\r\n\t\t\t\treturn true;\r\n\t\t\t}", "@Override\n\tpublic void deleteHashFile(boardDTO board) throws Exception {\n\t\tsqlSession.delete(namespace+\".deleteFile\",board);\n\t\tsqlSession.delete(namespace+\".deleteHashtag\",board);\n\t\tsqlSession.delete(namespace+\".likedelete\",board);\n\t}", "@Override\n\tpublic Result uploadFile(String requestUri, File uploadFile,\n\t\t\tFile uploadPath, HashMap<String, ContentBody> extraParts) {\n\t\treturn super.uploadFile(requestUri, uploadFile, uploadPath, extraParts);\n\t}", "@PostMapping(\"temporaryupload\")\n\tpublic ResponseEntity uploadTemporary(@RequestParam(\"file\") MultipartFile multipartFile) {\n\t\tString originalFileName = multipartFile.getOriginalFilename();\n\n\t\tPaper paper = null;\n\t\tFile storedFile = esPaperService.storeFileTemporary(multipartFile);\n\t\tpaper = esPaperService.getMetadata(storedFile);\n\t\tpaper.setFilename(originalFileName);\n\t\treturn new ResponseEntity<>(paper, HttpStatus.OK);\n\t}", "private File storeToUploadDir(InputStream is, String packageName) throws IOException {\n File uploadedFile = new File(uploadDir, FileType.APPDF.addExtension(random.nextInt() + \"_\" + packageName));\n ReadableByteChannel rbc = Channels.newChannel(is);\n FileOutputStream fos = new FileOutputStream(uploadedFile);\n fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);\n return uploadedFile;\n }", "public String upload() throws FileNotFoundException, IOException{\n FileOutputStream fout=new FileOutputStream(\"/tmp/mi_archivo\");\n int read=0;\n byte[] data=new byte[1024];\n InputStream in = archivo.getInputStream();\n\n while((read = in.read(data)) != -1){\n fout.write(data, 0, read);\n }\n\n return \"\";\n }", "private void uploadFile() {\n if (selectedImageUri != null) {\n //displaying a progress dialog while upload is going on\n final ProgressDialog progressDialog = new ProgressDialog(this);\n progressDialog.setTitle(\"Uploading\");\n progressDialog.show();\n\n StorageReference riversRef = storageReference.child(\"Images/Adhaar\"+jill+\"/\"+jack);\n riversRef.putFile(selectedImageUri)\n .addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n //if the upload is successfull\n //hiding the progress dialog\n progressDialog.dismiss();\n\n //and displaying a success toast\n Toast.makeText(getApplicationContext(), \"File Uploaded \", Toast.LENGTH_LONG).show();\n Intent step3 = new Intent(step4.this, step4.class);\n startActivity(step3);\n\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception exception) {\n //if the upload is not successfull\n //hiding the progress dialog\n progressDialog.dismiss();\n\n //and displaying error message\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\n }\n })\n .addOnProgressListener(new OnProgressListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onProgress(UploadTask.TaskSnapshot taskSnapshot) {\n //calculating progress percentage\n @SuppressWarnings(\"VisibleForTests\") double re=taskSnapshot.getBytesTransferred();\n @SuppressWarnings(\"VisibleForTests\") double rem=taskSnapshot.getBytesTransferred();\n double progress = (100.0 * re) / rem;\n\n //displaying percentage in progress dialog\n progressDialog.setMessage(\"Uploaded \" + ((int) progress) + \"%...\");\n }\n });\n }\n //if there is not any file\n else {\n //you can display an error toast\n }\n }", "public String moveFileUp() {\r\n\t\tlog.debug(\"Item file Id::\"+itemObjectId);\r\n\t\t\r\n\t\tIrUser user = userService.getUser(userId, false);\r\n\t\tif( !item.getOwner().equals(user) && !user.hasRole(IrRole.ADMIN_ROLE) && \r\n\t\t\t\t!institutionalCollectionPermissionHelper.isInstitutionalCollectionAdmin(user, genericItemId))\r\n\t\t{\r\n\t\t return \"accessDenied\";\r\n\t\t}\r\n\t\t\r\n\t\tItemObject moveUpItemObject = item.getItemObject(itemObjectId, itemObjectType);\r\n\t\titem.moveItemObject(moveUpItemObject, moveUpItemObject.getOrder() - 1);\r\n\t\t\r\n\t\t// Save the item\r\n\t\titemService.makePersistent(item);\r\n\r\n\t\treturn SUCCESS;\r\n\t\t\r\n\t}", "Path fileToUpload();", "int uploadEto(File file, DataDate date, DataDate updated) throws IOException, SQLException;", "@Override\r\n\tpublic boolean uploadFile(String fileName) throws FileSystemUtilException {\r\n\t\tlogger.debug(\"Begin:\" + getClass().getName() + \".upload()\");\r\n\t\tFileInputStream fis = null;\r\n\t\tString tempLocalFilePath = null;\r\n\t\ttry {\r\n\t\t\tconnect(); \r\n\t\t\ttempLocalFilePath = localFilePath;\r\n\t\t\tString command = \"scp -C -p -t \" + remoteFilePath;\r\n\t\t\tObject[] ios = execCommand(command);\r\n\t\t\toutputstream = (OutputStream) ios[0];\r\n\t\t\tinputstream = (InputStream) ios[1];\r\n\t\t\ttempLocalFilePath = tempLocalFilePath + fileName;\r\n\t\t\tif (checkAck(inputstream) != 0) {\r\n\t\t\t\tlogger.info(\"10117 : checking if file exists\");\r\n\t\t\t\tthrow new FileSystemUtilException(\"File \" + tempLocalFilePath + \"already exists in the remoteSystem\");\r\n\t\t\t}\r\n\t\t\tlong filesize = (new File(tempLocalFilePath)).length();\r\n\t\t\tcommand = \"C0644 \" + filesize + \" \";\r\n\t\t\tif (tempLocalFilePath.lastIndexOf('/') > 0) {\r\n\t\t\t\tcommand += tempLocalFilePath.substring(tempLocalFilePath.lastIndexOf('/') + 1);\r\n\t\t\t\tlogger.info(\"uploadfile in scp tempLocalFilePath if:: \"+tempLocalFilePath);\r\n\t\t\t} else {\r\n\t\t\t\tlogger.info(\"uploadfile in scp tempLocalFilePath else:: \"+tempLocalFilePath);\r\n\t\t\t\tcommand += tempLocalFilePath;\r\n\t\t\t}\r\n\t\t\tcommand += \"\\n\";\r\n\t\t\toutputstream.write(command.getBytes());\r\n\t\t\toutputstream.flush();\r\n\t\t\t/*if (checkAck(inputstream) != 0) {\r\n\t\t\t\tlogger.info(\"10118 : writing failed\");\r\n\t\t\t\tthrow new FileSystemUtilException(\"Cannot write into outputstream\");\r\n\t\t\t}*/\r\n\t\t\tfis = new FileInputStream(tempLocalFilePath);\r\n\t\t\tbyte[] buf = new byte[1024];\r\n\t\t\twhile (true) {\r\n\t\t\t\tint len = fis.read(buf, 0, buf.length);\r\n\t\t\t\tif (len <= 0)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\toutputstream.write(buf, 0, len); // out.flush();\r\n\t\t\t}\r\n\t\t\tfis.close();\r\n\t\t\tfis = null;\r\n\t\t\t// send '\\0'\r\n\t\t\tbuf[0] = 0;\r\n\t\t\toutputstream.write(buf, 0, 1);\r\n\t\t\toutputstream.flush();\r\n\t\t\tif (checkAck(inputstream) != 0) {\r\n\t\t\t\tlogger.info(\"10119 : after flushing the stream \");\r\n\t\t\t\tthrow new FileSystemUtilException(\"files flushing failed\");\r\n\t\t\t}\r\n\t\t\t// outputstream.close();\r\n\t\t} catch (Exception e) {\r\n\t\t\tlogger.error(\"uploading of file failed :\",e);\r\n\t\t\tthrow new FileSystemUtilException(\"uploading of file failed :\",e);\r\n\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tif (fis != null)\r\n\t\t\t\t\tfis.close();\r\n\t\t\t} catch (Exception ee) {\r\n\t\t\t\tlogger.error(\"uploading of file failed :\",ee);\r\n\t\t\t\tthrow new FileSystemUtilException(\"input stream not closed :\",ee);\r\n\t\t\t}\r\n\t\t\tdisconnect();\r\n\t\t}\r\n\t\tlogger.debug(\"End:\" + getClass().getName() + \".upload()\");\r\n\t\treturn true;\r\n\t}", "void uploadingFile(String path);", "@Override\n protected void upload(X x) {\n }", "private void doMultipartFormDataPostRequest(String token, String url, byte[] fileData, String filename) throws Exception {\n\n\n CloseableHttpClient client = HttpClients.createDefault();\n\n try {\n HttpPost httpPost = new HttpPost(getBaseUrl() + url );\n httpPost.setHeader(\"X-Authentication\", token);\n\n\n MultipartEntityBuilder multipartBuilder = MultipartEntityBuilder.create();\n\n if (fileData == null || fileData.length <= 0) {\n throw new MfilesOperationException(\"The byte array must not be null\");\n }\n\n if (StringUtils.isBlank(filename)) {\n throw new MfilesOperationException( \"Filename must not be blank or null...\" );\n }\n\n File tempDir = FileUtils.getTempDirectory();\n String reversedFilename = StringUtils.reverse(filename);\n //get the first '.'\n int dotIndex = reversedFilename.indexOf('.');\n String extension = reversedFilename.substring(0, (dotIndex + 1));\n extension = StringUtils.reverse(extension);\n\n //Generate a random string to append to the name of the file\n //We do this to prevent a situation whereby multiple users\n //upload files that have the same name and extension.\n String tempFileName = filename.substring(0, filename.length() - extension.length()) + \"_\" + System.currentTimeMillis();\n\n tempFileName += extension;\n\n final File fileToUpload = new File(tempDir + File.separator + tempFileName);\n\n try {\n FileUtils.writeByteArrayToFile(fileToUpload, fileData);\n }catch(Exception ex) {\n LOG.error(\"An exception occurred while writing byte array data to the file for upload\", ex);\n throw new MfilesOperationException(ex.getMessage());\n } finally {\n\n }\n\n final FileBody fileBody = new FileBody(fileToUpload);\n\n multipartBuilder.addPart(\"file\", fileBody);\n\n //OR\n //multipartBuilder.addBinaryBody(\"file\", file, ContentType.APPLICATION_OCTET_STREAM, \"file.ext\");\n\n org.apache.http.HttpEntity multipart = multipartBuilder.build();\n httpPost.setEntity(multipart);\n\n System.out.println(\"executing file upload request \" + httpPost.getRequestLine());\n\n CloseableHttpResponse response = client.execute(httpPost);\n try {\n System.out.println(\"----------------------------------------\");\n System.out.println(\"---------Response from server-----------\");\n System.out.println(response.getStatusLine());\n System.out.println(\"----------------------------------------\");\n\n org.apache.http.HttpEntity resEntity = response.getEntity();\n if (resEntity != null) {\n BufferedReader br = new BufferedReader(new InputStreamReader(resEntity.getContent()));\n String output = null;\n\n while ((output = br.readLine()) != null) {\n System.out.println(output);\n }\n }\n\n EntityUtils.consume(resEntity);\n\n } finally {\n response.close();\n }\n } finally {\n client.close();\n }\n }", "public updateFile_result(updateFile_result other) {\n __isset_bitfield = other.__isset_bitfield;\n this.success = other.success;\n }", "public final void deleteTemporaryFile()\n\t\tthrows IOException {\n\t\t\t\n // DEBUG\n \n if ( isQueued()) {\n Debug.println(\"@@ Delete queued file segment, \" + this);\n Thread.dumpStack();\n }\n \n\t\t//\tDelete the temporary file used by the file segment\n\n\t\tFile tempFile = new File(getTemporaryFile());\n\t\t\t\t\n\t\tif ( tempFile.exists() && tempFile.delete() == false) {\n\n\t\t //\tDEBUG\n\t\t \n\t\t Debug.println(\"** Failed to delete \" + toString() + \" **\");\n\t\t \n\t\t //\tThrow an exception, delete failed\n\t\t \n\t\t\tthrow new IOException(\"Failed to delete file \" + getTemporaryFile());\n\t\t}\n\t}", "public void uploadFile() {\n \n InputStream input = null;\n try {\n input = file.getInputStream();\n System.out.println(\"chay qua inpustream\");\n String itemName = file.getSubmittedFileName();\n String filename = itemName.substring(\n itemName.lastIndexOf(\"\\\\\") + 1);\n String dirPath = FacesContext.getCurrentInstance().getExternalContext().getRealPath(\"/upload/images\");\n fileNamed = \"/upload/images/\"+filename;\n File f = new File(dirPath + \"\\\\\" + filename);\n if (!f.exists()) {\n f.createNewFile();\n }\n FileOutputStream output = new FileOutputStream(f);\n byte[] buffer = new byte[1024];\n int length;\n while ((length = input.read(buffer)) > 0) {\n output.write(buffer, 0, length);\n }\n // resize(dirPath + \"\\\\\" + filename, dirPath + \"\\\\\" + filename, 200, 200);\n input.close();\n output.close();\n } catch (IOException ex) {\n System.out.println(\"loi io\");\n Logger.getLogger(ArtistsManagedBean.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n }", "public void save() {\n Path root = Paths.get(storagePath);\n try {\n Files.copy(file.getInputStream(), root.resolve(file.getOriginalFilename()),\n StandardCopyOption.REPLACE_EXISTING);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "@Override\n\tpublic void deleteDuplicate(byte[] hash, long start, int len)\n\t\t\tthrows IOException {\n\n\t}", "protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (requestCode == GALLERY_INTETN && resultCode==RESULT_OK) {\n dialog.setMessage(\"Uploading\");\n dialog.show();\n Uri uri= data.getData();\n\n StorageReference filepath= mStorage.child(\"volunteer_aadhar_pic\").child(uri.getLastPathSegment());\n try\n {\n compressed = MediaStore.Images.Media.getBitmap(ApplyAsVolunteer.this.getContentResolver(), uri);\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n compressed.compress(Bitmap.CompressFormat.JPEG, 30, baos);\n byte[] cimg = baos.toByteArray();\n filepath.putBytes(cimg).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot)\n {\n path = taskSnapshot.getDownloadUrl();\n //accountref = FirebaseDatabase.getInstance().getReference().child(\"user_details\").child(auth.getUid());\n //accountref.child(\"userImgUrl\").setValue(String.valueOf(path));\n Toast.makeText(ApplyAsVolunteer.this, \"Document uploaded\", Toast.LENGTH_LONG).show();\n //finish();\n //startActivity(getIntent());\n afterText.setVisibility(View.VISIBLE);\n clicksubmit.setVisibility(View.GONE);\n dialog.dismiss();\n }\n });\n }\n }", "@Override\n public synchronized void putContent(Consumer<OutputStream> outputStreamSupplier) throws IOException {\n // Delete a possibly prior written newContentFile\n Files.deleteIfExists(newContentFile);\n try (OutputStream out = newOutputStreamToNewTmpContent(true)) {\n outputStreamSupplier.accept(out);\n }\n FileUtils.moveAtomic(newContentTmpFile, newContentFile);\n }", "public String storeFile(MultipartFile file) {\n // Normalize file name\n String fileName = StringUtils.cleanPath(file.getOriginalFilename());\n\n try {\n // Check if the file's name contains invalid characters\n if(fileName.contains(\"..\")) {\n throw new FileStorageException(\"Sorry! Filename contains invalid path sequence \" + fileName);\n }\n\n // Copy file to the target location (Replacing existing file with the same name)\n Path targetLocation = this.fileStorageLocation.resolve(fileName);\n Files.copy(file.getInputStream(), targetLocation, StandardCopyOption.REPLACE_EXISTING);\n\n return fileName;\n } catch (IOException ex) {\n throw new FileStorageException(\"Could not store file \" + fileName + \". Please try again!\", ex);\n }\n }", "private File processMultipartForm() {\n\n File storeDirectory = Configuration\n .getParameterValueAsFile(PENDING_DIR);\n\n int fileSizeLimit = Configuration\n .getParameterValueAsInt(METADATA_MAX_BYTES);\n\n DiskFileItemFactory factory = new DiskFileItemFactory();\n factory.setSizeThreshold(fileSizeLimit);\n\n RestletFileUpload upload = new RestletFileUpload(factory);\n\n List<FileItem> items;\n\n try {\n Request request = getRequest();\n items = upload.parseRequest(request);\n } catch (FileUploadException e) {\n throw new ResourceException(Status.CLIENT_ERROR_BAD_REQUEST, e\n .getMessage(), e);\n }\n\n for (FileItem fi : items) {\n if (fi.getName() != null) {\n String uuid = UUID.randomUUID().toString();\n File file = new File(storeDirectory, uuid);\n try {\n fi.write(file);\n return file;\n } catch (Exception consumed) {\n }\n }\n }\n\n throw new ResourceException(Status.CLIENT_ERROR_BAD_REQUEST,\n \"no valid file uploaded\");\n }", "public void postRequestUploadProgress(Request<?> request, long transferredBytesSize, long totalSize, int currentFileIndex, File currentFile);", "public void handleFileUpload(FileUploadEvent event) {\r\n FacesMessage msg = new FacesMessage(\"Succesful\", event.getFile().getFileName() + \" is uploaded.\");\r\n UploadedFile file = event.getFile();\r\n try {\r\n file.write(super.getUploadFolder() + \"/\" + file.getFileName());\r\n } catch (Exception e) {\r\n System.out.println(e);\r\n }\r\n// RequestContext.getCurrentInstance().execute(\"PF('uploadJs').start()\");\r\n System.out.println(event.getFile().getFileName());\r\n FacesContext.getCurrentInstance().addMessage(null, msg);\r\n }", "@Override\n\tpublic void transferTo(File dest) throws IOException, IllegalStateException {\n\n\t}", "void copyFile(File sourcefile, File targetfile) throws Exception {\n\t\tif(targetfile.exists()) targetfile.delete();\n\t\ttargetfile.createNewFile();\n\t\tFileChannel source = null;\n\t\tFileChannel target = null;\n\t\ttry{\n\t\t\tsource = new FileInputStream(sourcefile).getChannel();\n\t\t\ttarget = new FileOutputStream(targetfile).getChannel();\n\t\t\ttarget.transferFrom(source, 0, source.size());\n\t\t}\n\t\tfinally{\n\t\t\tif(source!=null) source.close();\n\t\t\tif(target!=null) target.close();\n\t\t}\n\t\ttargetfile.setLastModified(sourcefile.lastModified());\n\t}", "private void endEntry() {\n\t\tif (lastImageFile!=null) {\r\n\t\t\tSystem.out.println(\"Dealing with image file: \" + lastImageLumpName);\r\n\t\t\t//Add an entry for it\r\n\t\t\ttry {\r\n\t\t\t\tZipEntry dir = new ZipEntry(\"ohrrpgce/games/\" + newRPGName + \"/\" + lastImageLumpName);\r\n\t\t\t\t//System.out.println(\"Entry opened: \" + dir.getName());\r\n\t\t\t\ttempJar.putNextEntry(dir);\r\n\t\t\t} catch (IOException ex) {\r\n\t\t\t\tSystem.out.println(\"Error adding entry for image file: \" + lastImageLumpName);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Copy it.\r\n\t\t\ttry {\r\n\t\t\t\tBufferedInputStream in = new BufferedInputStream(new FileInputStream(lastImageFile));\r\n\t\t\t\tbyte[] lin = new byte[1024];\r\n\t\t\t\tint len = 0;\r\n\t\t\t\tfor(;;) {\r\n\t\t\t\t\tlen = in.read(lin);\r\n\t\t\t\t\tif (len <= 0)\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\ttempJar.write(lin, 0, len);\r\n\t\t\t\t}\r\n\t\t\t\tin.close();\r\n\t\t\t} catch (IOException ex) {\r\n\t\t\t\tSystem.out.println(\"Error copying raw image data: \" + ex.toString());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tlastImageFile.delete();\r\n\t\t\tlastImageFile=null;\r\n\t\t} \r\n\t\t\r\n\t\t//Close the entry\r\n\t\ttry {\r\n\t\t\t//System.out.println(\" + Entry closed\");\r\n\t\t\ttempJar.closeEntry();\r\n\t\t} catch (IOException ex) {\r\n\t\t\tSystem.out.println(\"Error closing jar entry: \" + ex.toString());\r\n\t\t}\r\n\t}", "@Override\n\tpublic void updateAvatar(CommonsMultipartFile fileUpload, String username) throws IOException {\n\t\tString savePath = imageConfiguration.getAvatarPackage(username);\n\t\tif (imageRepository.findImageNameByUsername(username) != null) {\n\t\t\tfileUpload.transferTo(new File(savePath));\n\t\t} else {\n\t\t\tUser user = findOne(username);\n\t\t\tImage image = new Image();\n\t\t\timage.setUser(user);\n\t\t\timage.setImageName(user.getUsername());\n\t\t\timage.setImageLocation(savePath);\n\t\t\timageService.create(image);\n\t\t\tfileUpload.transferTo(new File(savePath));\n\t\t}\n\t}", "public void endUpdateHashMethod() {\n\t\t// ended attempt to update their password hash, reset values to default\n\t\tupdatePasswordHashMethod = false;\n\t\tlastUsername = \"\";\n\t\tlastPassword = \"\";\n\t}", "public deleteFile_result(deleteFile_result other) {\n __isset_bitfield = other.__isset_bitfield;\n this.success = other.success;\n }", "public deleteFile_result(deleteFile_result other) {\n __isset_bitfield = other.__isset_bitfield;\n this.success = other.success;\n }", "private String fileChecksum(File tmpFile, ITaskMonitor monitor) {\n InputStream is = null;\n try {\n is = new FileInputStream(tmpFile);\n MessageDigest digester = getChecksumType().getMessageDigest();\n byte[] buf = new byte[65536];\n int n;\n while ((n = is.read(buf)) >= 0) {\n if (n > 0) {\n digester.update(buf, 0, n);\n }\n }\n return getDigestChecksum(digester);\n } catch (FileNotFoundException e) {\n monitor.setResult(\"File not found: %1$s\", e.getMessage());\n } catch (Exception e) {\n monitor.setResult(e.getMessage());\n } finally {\n if (is != null) {\n try {\n is.close();\n } catch (IOException e) {\n }\n }\n }\n return \"\";\n }", "public void uploadObject() {\n\n\t}", "private void handleIntentUpload(Intent intent) {\n Uri selectedfile = (Uri) intent.getParcelableExtra(Intent.EXTRA_STREAM);\n\n Context context = getApplicationContext();\n File file=FileUtils.getFile(context, selectedfile);\n\n SharedPreferences sharedPreferences = getSharedPreferences(\"kelpml\", Context.MODE_PRIVATE);\n\n String ApiKey = sharedPreferences.getString(\"apikey\", \"null\");\n\n if (ApiKey.equals(\"null\")){\n\n\n Intent i = new Intent(Upload.this, LoginActivity.class);\n finish(); //Kill the activity from which you will go to next activity\n startActivity(i);\n }\n\n String path = file.getPath();\n\n new UploadFileAsync().execute(path, ApiKey);\n }", "@Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n progressDialog.dismiss();\n\n //and displaying a success toast\n Toast.makeText(getApplicationContext(), \"File Uploaded \", Toast.LENGTH_LONG).show();\n }", "private void unCompress()\n\t{\n\t\ttry\n\t\t{\n\t\t\tbyte[] buffer = new byte[4096];\n\t\t\tint bytesIn;\n\t\t\tZipFile rfoFile = new ZipFile(path + fileName);\n\t\t\tEnumeration<? extends ZipEntry> allFiles = rfoFile.entries();\n\t\t\twhile(allFiles.hasMoreElements())\n\t\t\t{\n\t\t\t\tZipEntry ze = (ZipEntry)allFiles.nextElement();\n\t\t\t\tInputStream is = rfoFile.getInputStream(ze);\n\t\t\t\tString fName = processSeparators(ze.getName());\n\t\t\t\tFile element = new File(tempDir + fName);\n\t\t\t\torg.reprap.Main.ftd.add(element);\n\t\t\t\tFileOutputStream os = new FileOutputStream(element);\n\t\t\t\twhile((bytesIn = is.read(buffer)) != -1) \n\t\t\t\t\tos.write(buffer, 0, bytesIn);\n\t\t\t\tos.close();\n\t\t\t}\n\t\t} catch (Exception e)\n\t\t{\n\t\t\tDebug.e(\"RFO.unCompress(): \" + e);\n\t\t}\n\t}", "public void run() {\n uploadManager.put(f, expectKey, TestConfig.token_z0, new UpCompletionHandler() {\n public void complete(String k, ResponseInfo rinfo, JSONObject response) {\n Log.i(\"qiniutest\", k + rinfo);\n key = k;\n info = rinfo;\n resp = response;\n signal.countDown();\n }\n }, null);\n }", "public String upload() throws Exception{\n\t\tFile newFile1 = null;\r\n\t\ttry {\t\t\t\t//读取session的登录信息\r\n\t\t\tActionContext actionContext = ActionContext.getContext(); \t \r\n\t Map<String, Object> session = actionContext.getSession(); \r\n\t //String user=(String)session.get(\"USER\");\r\n\t id=String.valueOf( (int)session.get(\"ID\") ); \r\n\t acc=(String) session.get(\"USER\");\r\n\t\t}catch(Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn \"FAILED\";\r\n\t\t}\r\n\t\t\r\n\t\t//添加时间检测逻辑!!!!!!\r\n\t\tint checktime=testTime();\r\n\t\tif(checktime==1) {\r\n\t\t\treturn \"FAILED\";\r\n\t\t}\r\n\t\t\r\n\t\ttry {\t\t\t\t//保存文件到指定路径\r\n\t\t\tFile file = new File(addr+\"/\"+id );\r\n\t\t\tif(!file.exists()){\r\n\t\t\t\tfile.mkdirs();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//剪切:把临时文件剪切指定的位置,并且给他重命名。 注意:临时文件没有了\r\n\t\t\tnewFile1=new File(file,\"BranchPredictor.h\");\r\n\t\t\tlab2file.renameTo(newFile1);\r\n\t\t\tSystem.out.println(newFile1.getPath()+\" has saved.\");\r\n\t\t\t\r\n\t\t\tFile fileLAB=new File(addr+\"/\"+id);\r\n\t\t\tif(!file.exists()){\r\n\t\t\t\tfile.mkdirs();\r\n\t\t\t}\r\n\t\t\tFileUtils.copyFile(new File(addr+\"/lab2.cpp\"), new File(file,id+\"_lab2.cpp\"));\r\n\t\t\t\r\n\t\t}catch(Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn \"FAILED\";\r\n\t\t}\r\n\t\ttry {\r\n\t\t\t//建立输出路径\r\n\t\t\tFile file = new File(addr+\"/obj-intel64/\"+id );\r\n\t\t\tString resultstr = null;\r\n\r\n\t\t\tif(!file.exists()){\r\n\t\t\t\tfile.mkdirs();\r\n\t\t\t}\r\n\t\t\t//尝试make\r\n\t\t\tUsualTools tool=new UsualTools();\r\n\t\t\tif((resultstr=tool.excuteLinux(\"make TEST_TOOL_ROOTS=\"+id+\"/\"+id+\"_lab2\", addr ,\"错误\"))!=null) {\r\n\t\t\t\tSystem.out.println(\"Find Error: \"+resultstr);\r\n\t\t\t\tresultstr1=resultstr;\r\n\t\t\t}else {//尝试运行\r\n\t\t\t\tresultstr=tool.excuteLinux(\"../../../pin -t obj-intel64/\"+id+\"/\"+id+\"_lab2.so \"\r\n\t\t\t\t\t\t+ \"-o \"+id+\"/lab2.out -- \"+testBin, addr ,\"错误\");\r\n\t\t\t\tif(resultstr!=null) {\r\n\t\t\t\t\tSystem.out.println(\"Find Error: \"+resultstr);\r\n\t\t\t\t\tresultstr1=resultstr;\r\n\t\t\t\t\t//resultstr1=java.net.URLEncoder.encode(resultstr, \"UTF-8\");\r\n\t\t\t\t}else {\r\n\t\t\t\t\tresultstr1=\"Finish! \";\r\n\t\t\t\t\tReadFile rd=new ReadFile();\r\n\t\t\t\t\tresultstr1=resultstr1+rd.getOUTline(addr+\"/\"+id+\"/lab2.out\");\r\n\t\t\t\t\tSystem.out.println(resultstr1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t//pro.destroy();\r\n\t\t}catch(Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn \"FAILED\";\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tLoadQuery loadQuery=new LoadQuery();\r\n\t\t\t\t\t\t\r\n\t\t\tint lab2excute=0;\r\n\t\t\tif(resultstr1.contains(\"Finish\")) {\r\n\t\t\t\tString[] liStrings=resultstr1.split(\" \");\r\n\t\t\t\tfor(String i:liStrings) {\r\n\t\t\t\t\tSystem.out.print(i+\" \");\t\r\n\t\t\t\t}\r\n\t\t\t\t/***********Grade***********/\r\n\t\t\t\t\r\n\t\t UsualTools tools=new UsualTools();\r\n\t\t String grade=tools.getStringFrom(liStrings[1]).get(0);\r\n\t\t\t\tlab2excute=Integer.parseInt(grade.substring(0, grade.length()-1));\r\n\t\t\t\t/************************/\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tList<Object> l=loadQuery.queryHQL(\"from X2 where account = '\"+acc+\"'\");\r\n\t\t\tif(l.isEmpty()) {\r\n\t\t\t\tX2 x=new X2();\r\n\t\t\t\tx.setAccount(acc);\r\n\t\t\t\tx.setExcute(lab2excute);\r\n\t\t\t\tloadQuery.savein(x);\r\n\t\t\t}else {\r\n\t\t\t\tloadQuery.update(\"update X2 x set x.excute = \"+lab2excute+\" where account = '\"+acc+\"'\");\r\n\t\t\t}\r\n\t\t\t//保存执行结果\r\n\t\t\tloadQuery.update(\"update Excute e set e.info = '\"+resultstr1+\"' where account = '\"+acc+\"' and number = '2'\");\r\n\t\t\t\r\n\t\t}catch(Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn \"FAILED\";\r\n\t\t}\r\n\t\treturn \"SUCCESS\";\r\n\t}", "Archiver(File fileIn, File fileOut) throws IOException {\n\n InputStream fileStreamIn = new FileInputStream(fileIn);\n ArrayList<Integer> bytes = Constants.readBytesAndPushToArray(fileStreamIn);\n HashSet<Integer> uniqueBytesArray = getUniqueBytes(bytes);\n ArrayList<String> bitsArray = Constants.getBitsArray(Constants.chooseBitsSize(uniqueBytesArray.size()), bytes.size());\n HashMap<Integer, String> dictionary = createDictionary(uniqueBytesArray, bitsArray);\n ByteArrayOutputStream archivedFile = archiveFile(bytes, dictionary);\n FileOutputStream newFile = new FileOutputStream(fileOut);\n archivedFile.writeTo(newFile);\n System.out.println( \"The size of the file which was IN: \" + fileIn.length());\n System.out.println(\"The size of the file which was OUT: \" + fileOut.length());\n System.out.println(\"File archived is smaller than unarchived by \" + (100 - ((fileOut.length() * 100) / fileIn.length())) +\"%.\" );\n }" ]
[ "0.6526055", "0.57184446", "0.5676571", "0.56679", "0.5665823", "0.5653748", "0.5496966", "0.5434942", "0.52374846", "0.5166769", "0.5113308", "0.51121557", "0.51058036", "0.5102986", "0.5100929", "0.50704694", "0.50630075", "0.50612205", "0.50565124", "0.50548965", "0.50459254", "0.49630454", "0.4946266", "0.49454394", "0.49415585", "0.4939024", "0.49190468", "0.48668778", "0.4862942", "0.4855683", "0.4846375", "0.48346922", "0.4834036", "0.48196313", "0.4798407", "0.4791677", "0.47802797", "0.47793314", "0.47768724", "0.4773108", "0.47244832", "0.47244832", "0.46968612", "0.46799344", "0.46758342", "0.46747038", "0.46738124", "0.46652728", "0.4662162", "0.46576855", "0.46567026", "0.46567026", "0.46564052", "0.46499765", "0.46490452", "0.46470425", "0.46464813", "0.46464756", "0.46362078", "0.4626262", "0.46151218", "0.4602683", "0.46001512", "0.45834494", "0.45803228", "0.45760632", "0.457601", "0.45719728", "0.4571955", "0.45710406", "0.457031", "0.4568166", "0.45675898", "0.45625445", "0.45574117", "0.45519397", "0.454992", "0.4546498", "0.45361876", "0.4535867", "0.45239058", "0.4514153", "0.45140165", "0.45104203", "0.45025408", "0.44996232", "0.44907707", "0.44883254", "0.44855642", "0.4481609", "0.4478219", "0.4478219", "0.44736874", "0.44714612", "0.44713452", "0.4461008", "0.4450526", "0.4448378", "0.44456303", "0.44439405" ]
0.522739
9
Hash the data from the buffer and store it to its final destination.
public String hashAndStoreBinaryFile(Buffer buffer, String uuid, String segmentedPath) { MeshUploadOptions uploadOptions = Mesh.mesh().getOptions().getUploadOptions(); File uploadFolder = new File(uploadOptions.getDirectory(), segmentedPath); File targetFile = new File(uploadFolder, uuid + ".bin"); String targetPath = targetFile.getAbsolutePath(); String sha512sum = hashBuffer(buffer); checkUploadFolderExists(uploadFolder); deletePotentialUpload(targetPath); storeBuffer(buffer, targetPath); return sha512sum; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected String hashBuffer(Buffer buffer) {\n\t\treturn FileUtils.generateSha512Sum(buffer);\n\t}", "java.lang.String getHashData();", "com.google.protobuf.ByteString getHash();", "com.google.protobuf.ByteString getHash();", "private void flush() {\n\t\tif (bytesDigested == 0) {\n\t\t\t/*\n\t\t\t * This is the first time flush has been called since initialize.\n\t\t\t * Initialization of the internal state has been deferred until now,\n\t\t\t * to avoid the cost of full initialization when smallHash is used.\n\t\t\t */\n\t\t\t// hashState[0] contains seedValue0\n\t\t\thashState[3] = hashState[6] = hashState[9] = hashState[0];\n\t\t\t// hashState[1] contains seedValue1\n\t\t\thashState[4] = hashState[7] = hashState[10] = hashState[1];\n\t\t\thashState[2] = hashState[5] = hashState[8] = hashState[11] = ARBITRARY_BITS;\t\t\t\n\t\t}\n\t\tmixBlock(buffer, 0, hashState);\n\t\tmixBlock(buffer, BLOCK_SIZE_LONGS, hashState);\n\t\tbytesDigested += BUFFER_SIZE_BYTES;\n\t\tbyteCount = 0;\t\t\n\t}", "void setHashData(java.lang.String hashData);", "private void rehash()\n {\n int hTmp = 37;\n\n if ( isHR != null )\n {\n hTmp = hTmp * 17 + isHR.hashCode();\n }\n\n if ( id != null )\n {\n hTmp = hTmp * 17 + id.hashCode();\n }\n\n if ( attributeType != null )\n {\n hTmp = hTmp * 17 + attributeType.hashCode();\n }\n \n h = hTmp;\n }", "@Override\n public void computeHash(Hasher hasher) {\n }", "public Map<String, Long> hashBuffer(byte[] data) throws BufferLengthException {\n\t\tif (data.length != buffer.length) {\n\t\t\tthrow new BufferLengthException(\n\t\t\t\t\tString.format(\n\t\t\t\t\t\t\t\"Compressor.hashBuffer requires exactly one superblock of data: %1$d bytes given, %2$d bytes expected.\",\n\t\t\t\t\t\t\tdata.length, buffer.length));\n\t\t}\n\t\tMap<String, Long> counters = new HashMap<>();\n\t\t// Since the buffer is enforced to be one superblock, an even multiple of block size, we can use simple\n\t\t// iteration.\n\t\tfor (int i = 0; i + blockSize <= data.length; i += blockSize) {\n\t\t\ttry {\n\t\t\t\tString key = SHA1Encoder.encode(Arrays.copyOfRange(data, i, i + blockSize));\n\t\t\t\tif (!counters.containsKey(key)) {\n\t\t\t\t\tcounters.put(key, 1L);\n\t\t\t\t} else {\n\t\t\t\t\tcounters.put(key, counters.get(key) + 1L);\n\t\t\t\t}\n\t\t\t} catch (NoSuchAlgorithmException | UnsupportedEncodingException e) {\n\t\t\t\t// Really, this should never happen, since we know the algorithm exists.\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn counters;\n\t}", "private String calchash() {\r\n String a0 = String.valueOf(bindex);\r\n a0 += String.valueOf(bdate);\r\n a0 += bdata;\r\n a0 += String.valueOf(bonce);\r\n a0 += blasthash;\r\n String a1;\r\n a1 = \"\";\r\n try {\r\n a1 = sha256(a0);\r\n } catch (NoSuchAlgorithmException ex) {\r\n Logger.getLogger(Block.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n return a1;\r\n\r\n }", "public static void main(String[] args) {\n SecureRandom random = new SecureRandom();\n random.nextBytes(hash);\n data = new byte[hash.length + 1];\n System.arraycopy(hash, 0, data, 0, hash.length);\n long c = 0;\n while (true) {\n recalculateData();\n byte[] dataHash = crc32AsByteArray(data);\n if (c % 10000000 == 0) {\n System.out.println(\"Calculated \" + c + \" hashes\");\n System.out.println(\"Data: \" + byteArrayToHex(data));\n System.out.println(\"Original hash: \" + byteArrayToHex(hash) + \" new hash: \" + byteArrayToHex(dataHash));\n\n }\n if (Arrays.equals(hash, dataHash)) {\n System.out.println(\"Found a match!\");\n System.out.println(\"Data: \" + byteArrayToHex(data));\n System.out.println(\"Original hash: \" + byteArrayToHex(hash) + \" new hash: \" + byteArrayToHex(dataHash));\n break;\n }\n c++;\n }\n }", "public byte[] getHash() {\n\t\treturn _hash.getDataID();\n\t}", "private byte[] SHA256hash(byte[] tobeHashed){\r\n\t\tSHA256Digest digester=new SHA256Digest(); \r\n\t\tbyte[] retValue=new byte[digester.getDigestSize()]; \r\n\t\tdigester.update(tobeHashed, 0, tobeHashed.length); \r\n\t\tdigester.doFinal(retValue, 0);\r\n\t return retValue; \r\n}", "byte[] digest();", "private Hasher update(int bytes) {\n/* */ try {\n/* 86 */ update(this.scratch.array(), 0, bytes);\n/* */ } finally {\n/* 88 */ this.scratch.clear();\n/* */ } \n/* 90 */ return this;\n/* */ }", "public abstract int getHash();", "com.google.protobuf.ByteString getFileHash();", "com.google.protobuf.ByteString getFileHash();", "private int rehash(int hash) {\n final int h = hash * 0x9E3779B9;\n return h ^ (h >> 16);\n }", "int getHash();", "public abstract int doHash(T t);", "byte[] getDigest();", "long hash(Block block, int position);", "public int getHash() {\n return hash_;\n }", "String getHash();", "String getHash();", "public int hashCode() {\n if (hash == -1) {\n hash = 0;\n byte b[] = packet.getData();\n int len = b.length;\n for (int ix = 0; ix < len; ix++) {\n\thash = 31 * hash + b[ix];\n }\n hash ^= (packet.getAddress().hashCode() ^\n\t (packet.getPort() << 15) ^\n\t (packet.getLength() << 3) ^\n\t (packet.getOffset() << 8));\n }\n return hash;\n }", "public byte[] getHashData(){\r\n byte[] hashData = Serializer.createParcel(\r\n new Object[]{\r\n getParentHash(),\r\n getNonce(),\r\n getTimeStamp(),\r\n BigInteger.valueOf(getIndex()), //Parcel encoding doesnt support longs\r\n BigInteger.valueOf(getDifficulty()), //Parcel encoding doesnt support longs\r\n getMinerAddress(),\r\n getReward(),\r\n getMerkleRoot(),\r\n getAxiomData(),\r\n getBlockData()\r\n });\r\n return hashData;\r\n }", "public int getHash() {\n return hash_;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getHash() {\n return hash_;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getHash() {\n return hash_;\n }", "protected Sha256Hash readHash() throws ProtocolException {\n return Sha256Hash.wrapReversed(readBytes(32));\n }", "public static byte[] Hash(byte[] data) {\n SHA256Digest sha256 = new SHA256Digest();\n sha256.update(data, 0, data.length);\n byte[] out = new byte[sha256.getDigestSize()];\n sha256.doFinal(out, 0);\n return out;\n }", "private int computeHash(URI location) {\n \t\treturn location.hashCode();\n \t}", "public int hashCode() {\n\treturn data.hashCode();\n }", "private void rehash() {\n\t\tint oldSize = this.size;\n\t\tint newSize = size * 2;\n\t\twhile (!isPrime(newSize))\n\t\t\tnewSize++;\n\t\tthis.size = newSize;\n\t\tDataItem[] newHashArray = new DataItem[newSize];\n\t\tString temp;\n\t\tthis.collision = 0;\n\t\tBoolean repeatValue;\n\t\tfor (int i = 0; i < oldSize; i++) {\n\t\t\tif (hashArray[i] != null && hashArray[i] != deleted)\n\t\t\t\ttemp = hashArray[i].value;\n\t\t\telse\n\t\t\t\tcontinue;\n\t\t\trepeatValue = false;\n\t\t\tint hashVal = hashFunc(temp);\n\t\t\tboolean collisionFlag = false;\n\t\t\twhile (newHashArray[hashVal] != null\n\t\t\t\t\t&& !newHashArray[hashVal].value.equals(deleted.value)) {\n\n\t\t\t\tif (!collisionFlag) {\n\n\t\t\t\t\tthis.collision++;\n\t\t\t\t\tcollisionFlag = true;\n\n\t\t\t\t}\n\t\t\t\thashVal++;\n\t\t\t\thashVal = hashVal % size;\n\n\t\t\t}\n\t\t\tif (repeatValue)\n\t\t\t\tcontinue;\n\t\t\telse {\n\t\t\t\tnewHashArray[hashVal] = hashArray[i];\n\t\t\t}\n\t\t}\n\n\t\tthis.hashArray = newHashArray;\n\t}", "public void setHash(String hash) {\n this.hash = hash;\n }", "int hash(T key) throws IOException, NoSuchAlgorithmException {\n\t\tByteArrayOutputStream b = new ByteArrayOutputStream();\n ObjectOutputStream o = new ObjectOutputStream(b);\n o.writeObject(key);\n byte[] data = b.toByteArray();\n \n //hash key using MD5 algorithm\n\t\t//System.out.println(\"Start MD5 Digest\");\n MessageDigest md = MessageDigest.getInstance(\"MD5\");\n md.update(data);//this updates the digest using the specified byte array\n \tbyte[] hash = md.digest();\n \tByteBuffer wrapped = ByteBuffer.wrap(hash); // big-endian by default\n \tint hashNum = wrapped.getInt(); \n \treturn hashNum;\n \t\n\t}", "public void setHash() throws NoSuchAlgorithmException {\n\t\tString transformedName = new StringBuilder().append(this.titulo).append(this.profesor)\n .append(this.descripcion).append(this.materia.getUniversidad()).append(this.materia.getDepartamento())\n\t\t\t\t.append(this.materia.getCarrera()).append(this.materia.getIdMateria()).append(new Date().getTime()).toString();\n\t\tMessageDigest messageDigest = MessageDigest.getInstance(\"MD5\");\n\t\tmessageDigest.update(transformedName.getBytes(StandardCharsets.UTF_8));\n\t\tthis.hash = new BigInteger(1, messageDigest.digest()).toString(16);\n\t}", "private String calculateHash() {\n\n // Increments the sequence to prevent two transactions from having identical keys.\n sequence++;\n return StringUtil.applySha256(\n StringUtil.getStringFromKey(sender) +\n StringUtil.getStringFromKey(recipient) +\n Float.toString(value) +\n sequence\n );\n }", "public void setHash(String hash)\n {\n this.hash = hash;\n }", "@Override\n public int hashCode() {\n return this.data.hashCode();\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getHash() {\n return hash_;\n }", "@java.lang.Override\n public com.google.protobuf.ByteString getHash() {\n return hash_;\n }", "private int hasher() {\n int i = 0;\n int hash = 0;\n while (i != length) {\n hash += hashableKey.charAt(i++);\n hash += hash << 10;\n hash ^= hash >> 6;\n }\n hash += hash << 3;\n hash ^= hash >> 11;\n hash += hash << 15;\n return getHash(hash);\n }", "public int hashCode() {\n\t\treturn src.hashCode() ^ dst.hashCode() ^ data_len ^ type ^ group ^ data.hashCode();\n\t}", "@Override\n public void update(byte[] in, int off, int len) {\n digest.update(in, off, len);\n }", "public String getHash() {\n return hash;\n }", "@Override\n public final void writeFinal() {\n ((StructuredFileSortHash) file).hashfile.writeHash(getBucketIndex(), file.getOffset());\n writeRecordData();\n }", "private String hash(){\r\n return Utility.SHA512(this.simplify());\r\n }", "public void setHash(String hash) {\n this.hash = hash;\n }", "public void setHash(String hash) {\n this.hash = hash;\n }", "public void setHash(String hash) {\n this.hash = hash;\n }", "public interface Hasher {\n\n void reset();\n\n void update(byte[] input);\n\n byte[] digest();\n\n String getAlgorithm();\n }", "public byte[] getHash() {\n\t\treturn generatedHash;\n\t}", "private void _resetDigest() {\n try {\n _digest = MessageDigest.getInstance(PicoStructure.HASH);\n _digestvalidto = 0L;\n } catch (NoSuchAlgorithmException nsae) {\n throw new RuntimeException(\"Failed to create hash.\", nsae);\n }\n }", "private String calulateHash() {\n\t\tsequence++; // increase the sequence to avoid 2 identical transactions having the same hash\n\t\treturn StringUtil.applySha256(StringUtil.getStringFromKey(sender) + StringUtil.getStringFromKey(reciepient)\n\t\t\t\t+ Float.toString(value) + sequence);\n\t}", "@Override\n public int hashCode ()\n {\n int hash = 7;\n hash = 53 * hash + Arrays.hashCode (this.bytes);\n return hash;\n }", "public String getHash() {\n return hash;\n }", "public String getHash() {\n return hash;\n }", "public String getHash() {\n return hash;\n }", "public void setHash(String hash) {\n\t\tthis.hash = hash;\n\t}", "public String calculateHash () {\n StringBuilder hashInput = new StringBuilder(previousHash)\n .append(timeStamp)\n .append(magicNumber)\n .append(timeSpentMining);\n for (Transfer transfer : this.transfers) {\n String transferDesc = transfer.getDescription();\n hashInput.append(transferDesc);\n }\n return CryptoUtil.applySha256(hashInput.toString());\n }", "public String getHash()\n {\n return hash;\n }", "int hash(String makeHash, int mod);", "private static int computeHash(int par0)\n {\n par0 ^= par0 >>> 20 ^ par0 >>> 12;\n return par0 ^ par0 >>> 7 ^ par0 >>> 4;\n }", "public int hash(T input);", "public ByteArrayWritable(byte[] data) {\r\n this.bytes = data;\r\n this.hash = -1;\r\n }", "@Override\n\tpublic void deleteDuplicate(byte[] hash, long start, int len)\n\t\t\tthrows IOException {\n\n\t}", "private int hash(String str, int h){\n int v=0;\n\n /* FILL IN HERE */\n v = Math.floorMod(MurmurHash.hash32(str, seeds[h]) >>> h, 1 << logNbOfBuckets);\n\n return v;\n }", "void put(final int hash, final int key, final int value){\r\n//System.out.println(\"put(\"+hash+\",\"+key+\",\"+value+\")\");\r\n if(key==0){\r\n hasZeroKey=true;\r\n zeroValue=value;\r\n return;\r\n }\r\n int i=(hash&hashMask)<<1;\r\n int k;\r\n while((k=data[i])!=0 && k!=key) i=(i+2)&indexMask;\r\n data[i]=key;\r\n data[i+1]=value;\r\n }", "public void calcularHash() {\n\t\tLocalDateTime agora = LocalDateTime.now();\n\t\t\n\t\t// coverção da string data/hora atual para o formato de 13 digitos\n\t\tDateTimeFormatter formatterData = DateTimeFormatter.ofPattern(\"ddMMuuuuHHmmss\");\n\t\tString dataFormatada = formatterData.format(agora);\n\t\t\n\t\tSystem.out.println(dataFormatada);\n\t\ttimestamp = Long.parseLong(dataFormatada);\n\t\t\n\t\tSystem.out.println(\"Informe o CPF: \");\n\t\tcpf = sc.nextLong();\n\t\t\n\t\t// calculos para gerar o hash\n\t\thash = cpf + (7*89);\n\t\thash = (long) Math.cbrt(hash);\n\t\t\n\t\thash2 = timestamp + (7*89);\n\t\thash2 = (long) Math.cbrt(hash2);\n\t\t\n\t\tsoma_hashs = hash + hash2;\n\t\t// converção para hexadecimal\n\t String str2 = Long.toHexString(soma_hashs);\n\t\t\n\t\tSystem.out.println(\"\\nHash: \"+ hash + \" \\nHash Do Timestamp: \" + hash2 + \"\\nSoma total do Hash: \" + str2);\n\t\t\n\t}", "public void update(ByteBuffer byteBuffer) {\n checkNotDone();\n this.digest.update(byteBuffer);\n }", "private void read() throws IOException {\n\n ByteBuffer buffer = ByteBuffer.allocate(ProjectProperties.BYTE_BUFFER_SIZE);\n int read = 0;\n // Keep trying to write until all bytes are read\n while (buffer.hasRemaining() && read != -1) {\n read = channel.read(buffer);\n }\n checkIfClosed(read);// check for error\n\n // convert byte[] to hash string\n String rt = RandomByteAndHashCode.SHA1FromBytes(buffer.array());\n if(ProjectProperties.DEBUG_FULL){\n System.out.println(\"Read: \" + rt );\n }\n\n write(rt.getBytes()); // write hash string\n }", "public String getHash() {\n\t\treturn _hash;\n\t}", "public abstract WriteResult writeBlob(User user, Blob blob, byte[] oldDigest);", "private byte[] generateNewHash() { \n\t\t// Build the final hash to be compared with the one on the database.\n\t\tbyte[] firstHash = getGeneratedHash();\n\t\tbyte[] randomSalt = getRandomSalt();\n\t\tbyte[] finalHash = new byte[TOTAL_LENGTH];\n\n\t\t// initial index where the salt will start\n\t\tint j = getSaltStartIndex(); \n\n\t\tfor( int i = 0; i < TOTAL_LENGTH; i++ ) {\n\t\t\t// First index for the salt is not yet here\n\t\t\tif ( j > i ) finalHash[i] = firstHash[i];\n\t\t\telse {\n\t\t\t\tif ( (i - j) < SALT_LENGTH ) finalHash[i] = randomSalt[i-j];\n\t\t\t\telse finalHash[i] = firstHash[i-SALT_LENGTH];\n\t\t\t}\n\t\t}\n\t\treturn finalHash;\n\t}", "public int hashCode() {\n/* 151 */ int i = this.addrType.hashCode();\n/* 152 */ for (byte b = 0; b < this.buf.length; b++) {\n/* 153 */ i += this.buf[b];\n/* */ }\n/* 155 */ return i;\n/* */ }", "public void notifyOlderHash(){\n this.oldHash = hashCode();\n }", "private static String HashIt(String token) {\n\t\tStringBuffer hexString = new StringBuffer();\n\t\ttry {\n\t\t\tMessageDigest digest = MessageDigest.getInstance(\"SHA-256\");\n\t\t\tbyte[] hash = digest.digest(token.getBytes(StandardCharsets.UTF_8));\n\t\t\t\n\t\t\t// Convert to hex\n\t\t for (int i = 0; i < hash.length; i++) {\n\t\t\t String hex = Integer.toHexString(0xff & hash[i]);\n\t\t\t if(hex.length() == 1) {\n\t\t\t \thexString.append('0');\n\t\t\t }\n\t\t\t hexString.append(hex);\n\t\t }\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\tSystem.err.println(e.getStackTrace());\n\t\t\thexString.setLength(0);\n\t\t}\n\t return hexString.toString();\t\t\n\t}", "void compute_checksum() {\n\t\t\t// IMPORTANT : write this NOW !\n\t\t\t/*\n\t\t\t * short *ptr; Checksum = 0; for (ptr = (short *) pmh; ptr < (short\n\t\t\t * *)&pmh->Checksum; ptr++) Checksum ^= *ptr;\n\t\t\t */\n\t\t\tChecksum = 0;\n\t\t\tshort b[] = new short[9];\n\t\t\tb[0] = (short) (Key & 0xFF);\n\t\t\tb[1] = (short) ((Key & 0xFF00) >>> 16);\n\t\t\tb[2] = (short) Left;\n\t\t\tb[3] = (short) Top;\n\t\t\tb[4] = (short) Right;\n\t\t\tb[5] = (short) Bottom;\n\t\t\tb[6] = Inch;\n\t\t\tb[7] = (short) (Reserved & 0xFF);\n\t\t\tb[8] = (short) ((Reserved & 0xFF00) >>> 16);\n\t\t\tfor (int i = 0; i < b.length; i++)\n\t\t\t\tChecksum ^= b[i];\n\t\t}", "public String getHash() {\n\t\treturn hash;\n\t}", "public interface MessageDigest {\n /**\n * Feeds a batch of bytes into the hash.\n * \n * @param data\n * the byte values.\n * @param offset\n * the first byte index to take.\n * @param length\n * the number of bytes to take.\n */\n void update(byte[] data, int offset, int length);\n\n /**\n * Feeds a byte into the hash.\n * \n * @param data\n * the byte value\n */\n void update(byte data);\n\n /**\n * Consolidates the input, and re-initialises the hash.\n * \n * @return the hash value\n */\n byte[] digest();\n}", "public Builder setHash(com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n hash_ = value;\n onChanged();\n return this;\n }", "public Builder setHash(com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n\n hash_ = value;\n onChanged();\n return this;\n }", "private static String getHash(byte[] dataBuffer, MessageDigest dgst) throws Exception{\n\t\tdgst.update(dataBuffer);\n\t\t\n\t\tbyte[] dgstByte = dgst.digest();\n\n\t\tStringBuffer sb = new StringBuffer();\n\t\tfor(int i=0; i<dgstByte.length; i++){\n\t\t\tsb.append(Integer.toString((dgstByte[i] & 0xff) + 0x100, 16).substring(1));\n\t\t}\n\t\t\n\t\tSystem.out.println(\"dgstByteString HEXString is: \" + sb.toString());\t\t\n\t\treturn sb.toString();\n\t\t\n\t\t/*\n\t\t * Uncomment below lines to return the message digest with base64 encoded string\n\t\t * */\n\t\t\n\t\t// System.out.println(\"dgstByteString B64 of HEX is: \" + Base64.encode(sb.toString().getBytes()));\n\t\t// return Base64.encode(sb.toString().getBytes());\n\t}", "void synchronizeHostData(DataBuffer buffer);", "private static long finishUp(long hash) {\n hash ^= hash >>> 33;\n hash *= P2;\n hash ^= hash >>> 29;\n hash *= P3;\n hash ^= hash >>> 32;\n return hash;\n }", "protected abstract int hashOfObject(Object key);", "private static void writeMemToFile(String outFile, String fileSource){\n\n\t\tFileInputStream instream = null;\n\t\tFileOutputStream outstream = null;\n\n\t\ttry{\n\t\t\tFile infile =new File(fileSource);\n\t\t\tFile outfile =new File(outFile);\n\t\t\tMessageDigest digest = MessageDigest.getInstance(\"SHA-256\");\n\n\t\t\tinstream = new FileInputStream(infile);\n\t\t\toutstream = new FileOutputStream(outfile);\n\n\t\t\tbyte[] buffer = new byte[1024];\n\n\t\t\tint length;\n\t\t\n\t\t\twhile ((length = instream.read(buffer)) > 0){\n\t\t\t\toutstream.write(buffer, 0, length);\n\t\t\t\tdigest.update(buffer, 0, length);\n\t\t\t}\n\n\t\t\tbyte[] hashedBytes = digest.digest();\n\t\t\toutstream.write(hashedBytes, 0, hashedBytes.length);\n\n\t\t\t//Closing the input/output file streams\n\t\t\tinstream.close();\n\t\t\toutstream.close();\n\n\t\t}catch(NoSuchAlgorithmException | IOException e){\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t}", "public String getHash() {\n byte[] bArr = new byte[21];\n bArr[0] = (byte) getCTxDestinationType().getValue();\n System.arraycopy(this.mData, 0, bArr, 1, 20);\n return StringToolkit.bytesToString(bArr);\n }", "private void rehash( )\n {\n HashEntry<AnyType> [ ] oldArray = array;\n\n // Create a new double-sized, empty table\n allocateArray( 2 * oldArray.length );\n occupied = 0;\n theSize = 0;\n\n // Copy table over\n for( HashEntry<AnyType> entry : oldArray )\n if( entry != null) {\n \tput(entry.key, entry.value);\n }\n }", "@Override\n public void update(byte b) {\n digest.update(b);\n }", "@Override\n public int checksum(ByteBuffer bb) {\n if (bb == null)\n throw new NullPointerException(\"ByteBuffer is null in Fletcher32#checksum\");\n Fletcher32 f = f32.get();\n f.update(bb.array());\n return (int) f.getValue();\n }", "public ByteArrayWritable(byte data) {\r\n this.bytes = new byte[]{data};\r\n this.hash = -1;\r\n }", "public int hashCode() {\n if (myhash == -1) {\n myhash = timestamp.hashCode() + signerCertPath.hashCode();\n }\n return myhash;\n }", "@Override\n public long applyAsLong(BytesStore bytes, @NonNegative long length) throws IllegalStateException, BufferUnderflowException {\n long hash;\n long remaining = length;\n long off = bytes.readPosition();\n\n if (remaining >= 32) {\n long v1 = seed + P1 + P2;\n long v2 = seed + P2;\n long v3 = seed;\n long v4 = seed - P1;\n\n do {\n v1 += fetch64(bytes, off) * P2;\n v1 = Long.rotateLeft(v1, 31);\n v1 *= P1;\n\n v2 += fetch64(bytes, off + 8) * P2;\n v2 = Long.rotateLeft(v2, 31);\n v2 *= P1;\n\n v3 += fetch64(bytes, off + 16) * P2;\n v3 = Long.rotateLeft(v3, 31);\n v3 *= P1;\n\n v4 += fetch64(bytes, off + 24) * P2;\n v4 = Long.rotateLeft(v4, 31);\n v4 *= P1;\n\n off += 32;\n remaining -= 32;\n } while (remaining >= 32);\n\n hash = Long.rotateLeft(v1, 1)\n + Long.rotateLeft(v2, 7)\n + Long.rotateLeft(v3, 12)\n + Long.rotateLeft(v4, 18);\n\n v1 *= P2;\n v1 = Long.rotateLeft(v1, 31);\n v1 *= P1;\n hash ^= v1;\n hash = hash * P1 + P4;\n\n v2 *= P2;\n v2 = Long.rotateLeft(v2, 31);\n v2 *= P1;\n hash ^= v2;\n hash = hash * P1 + P4;\n\n v3 *= P2;\n v3 = Long.rotateLeft(v3, 31);\n v3 *= P1;\n hash ^= v3;\n hash = hash * P1 + P4;\n\n v4 *= P2;\n v4 = Long.rotateLeft(v4, 31);\n v4 *= P1;\n hash ^= v4;\n hash = hash * P1 + P4;\n } else {\n hash = seed + P5;\n }\n\n hash += length;\n\n while (remaining >= 8) {\n long k1 = fetch64(bytes, off);\n k1 *= P2;\n k1 = Long.rotateLeft(k1, 31);\n k1 *= P1;\n hash ^= k1;\n hash = Long.rotateLeft(hash, 27) * P1 + P4;\n off += 8;\n remaining -= 8;\n }\n\n if (remaining >= 4) {\n hash ^= fetch32(bytes, off) * P1;\n hash = Long.rotateLeft(hash, 23) * P2 + P3;\n off += 4;\n remaining -= 4;\n }\n\n while (remaining != 0) {\n hash ^= fetch8(bytes, off) * P5;\n hash = Long.rotateLeft(hash, 11) * P1;\n --remaining;\n ++off;\n }\n\n return finishUp(hash);\n }", "public void write(int datum) throws IOException {\n if (!_open)\n return;\n datum &= 0xff;\n long _here = position();\n\n // Are we synced up?\n if (_here == _digestvalidto) {\n\n // Yes, digest the byte and move the valid to pointer.\n _digest.update((byte) datum);\n _digestvalidto++; // JMC: Was missing.\n\n } // Otherwise, advancing of the position will destroy the digest sync.\n\n datum = _head.crypt((byte) datum, _here);\n _backing.write(datum);\n }", "private static void smallHash(long[] src, int offset, int lengthBytes, long[] seedResult) {\n\t\t\n\t\t/*\n\t\t * Most of the awkwardness in this code, such as the use of\n\t\t * individual local variables for the internal state vector\n\t\t * (h0, h1, h2, h3) rather than an array, is the result of performance tuning.\n\t\t * \n\t\t * See Bob Jenkins' description for discussion of the computation itself.\n\t\t */\n\t\tlong h0, h1, h2, h3;\n\t\th0 = seedResult[0];\n\t\th1 = seedResult[1];\n\t\th2 = ARBITRARY_BITS;\n\t\th3 = ARBITRARY_BITS;\n\t\t\n\t\tint remainingBytes = lengthBytes;\n\t\tint pos = offset;\n\n\t\t/*\n\t\t * Consume any complete 32-byte blocks\n\t\t */\n\t\twhile (remainingBytes >= 32) {\n\t\t\th2 += src[pos++];\n\t\t\th3 += src[pos++];\n\t\t\t\n\t h2 = (h2 << 50) | (h2 >>> 14); h2 += h3; h0 ^= h2;\n\t h3 = (h3 << 52) | (h3 >>> 12); h3 += h0; h1 ^= h3;\n\t h0 = (h0 << 30) | (h0 >>> 34); h0 += h1; h2 ^= h0;\n\t h1 = (h1 << 41) | (h1 >>> 23); h1 += h2; h3 ^= h1;\n\t h2 = (h2 << 54) | (h2 >>> 10); h2 += h3; h0 ^= h2;\n\t h3 = (h3 << 48) | (h3 >>> 16); h3 += h0; h1 ^= h3;\n\t h0 = (h0 << 38) | (h0 >>> 26); h0 += h1; h2 ^= h0;\n\t h1 = (h1 << 37) | (h1 >>> 27); h1 += h2; h3 ^= h1;\n\t h2 = (h2 << 62) | (h2 >>> 2); h2 += h3; h0 ^= h2;\n\t h3 = (h3 << 34) | (h3 >>> 30); h3 += h0; h1 ^= h3;\n\t h0 = (h0 << 5) | (h0 >>> 59); h0 += h1; h2 ^= h0;\n\t h1 = (h1 << 36) | (h1 >>> 28); h1 += h2; h3 ^= h1;\t\n\t\t\t\n\t\t\th0 += src[pos++];\n\t\t\th1 += src[pos++];\n\t\t\tremainingBytes -= 32;\n\t\t}\n\t\t\n\t\tif (remainingBytes >= 16) {\n\t\t\th2 += src[pos++];\n\t\t\th3 += src[pos++];\n\t\t\tremainingBytes -= 16;\n\n\t h2 = (h2 << 50) | (h2 >>> 14); h2 += h3; h0 ^= h2;\n\t h3 = (h3 << 52) | (h3 >>> 12); h3 += h0; h1 ^= h3;\n\t h0 = (h0 << 30) | (h0 >>> 34); h0 += h1; h2 ^= h0;\n\t h1 = (h1 << 41) | (h1 >>> 23); h1 += h2; h3 ^= h1;\n\t h2 = (h2 << 54) | (h2 >>> 10); h2 += h3; h0 ^= h2;\n\t h3 = (h3 << 48) | (h3 >>> 16); h3 += h0; h1 ^= h3;\n\t h0 = (h0 << 38) | (h0 >>> 26); h0 += h1; h2 ^= h0;\n\t h1 = (h1 << 37) | (h1 >>> 27); h1 += h2; h3 ^= h1;\n\t h2 = (h2 << 62) | (h2 >>> 2); h2 += h3; h0 ^= h2;\n\t h3 = (h3 << 34) | (h3 >>> 30); h3 += h0; h1 ^= h3;\n\t h0 = (h0 << 5) | (h0 >>> 59); h0 += h1; h2 ^= h0;\n\t h1 = (h1 << 36) | (h1 >>> 28); h1 += h2; h3 ^= h1;\t\n\n\t\t}\n\t\t\n\t\tassert remainingBytes < 16;\n\t\t/*\n\t\t * Incorporate the buffer length into the hash result.\n\t\t */\n\t\th3 += ((long)(lengthBytes)) << 56;\n\n\t\tif (remainingBytes >= 8) {\n\t\t\th2 += src[pos++];\n\t\t\tremainingBytes -= 8;\n\t\t\tif (remainingBytes > 0) {\n\t\t\t\t/*\n\t\t\t\t * Mask off (zero-fill) the bytes that aren't payload.\n\t\t\t\t */\n\t\t\t\tlong mask = (1L << (remainingBytes << 3)) - 1;\n\t\t\t\th3 += src[pos] & mask;\n\t\t\t}\n\t\t} else if (remainingBytes > 0) {\n\t\t\t/*\n\t\t\t * Mask off (zero-fill) the bytes that aren't payload.\n\t\t\t */\n\t\t\tlong mask = (1L << (remainingBytes << 3)) - 1;\n\t\t\th2 += src[pos] & mask;\n\t\t} else {\n\t\t\th2 += ARBITRARY_BITS;\n\t\t\th3 += ARBITRARY_BITS;\t\t\t\n\t\t}\n\n h3 ^= h2; h2 = (h2 << 15) | (h2 >>> 49); h3 += h2;\n h0 ^= h3; h3 = (h3 << 52) | (h3 >>> 12); h0 += h3;\n h1 ^= h0; h0 = (h0 << 26) | (h0 >>> 38); h1 += h0;\n h2 ^= h1; h1 = (h1 << 51) | (h1 >>> 13); h2 += h1;\n h3 ^= h2; h2 = (h2 << 28) | (h2 >>> 36); h3 += h2;\n h0 ^= h3; h3 = (h3 << 9) | (h3 >>> 55); h0 += h3;\n h1 ^= h0; h0 = (h0 << 47) | (h0 >>> 17); h1 += h0;\n h2 ^= h1; h1 = (h1 << 54) | (h1 >>> 10); h2 += h1;\n h3 ^= h2; h2 = (h2 << 32) | (h2 >>> 32); h3 += h2;\n h0 ^= h3; h3 = (h3 << 25) | (h3 >>> 39); h0 += h3;\n h1 ^= h0; h0 = (h0 << 63) | (h0 >>> 1); h1 += h0;\n\t\t\n seedResult[0] = h0;\n seedResult[1] = h1;\n\t}", "private String getOldPasswordHash(String password) {\n\t\tWhirlpool hasher = new Whirlpool();\n hasher.NESSIEinit();\n\n // add the plaintext password to it\n hasher.NESSIEadd(password);\n\n // create an array to hold the hashed bytes\n byte[] hashed = new byte[64];\n\n // run the hash\n hasher.NESSIEfinalize(hashed);\n\n // this stuff basically turns the byte array into a hexstring\n java.math.BigInteger bi = new java.math.BigInteger(hashed);\n String hashedStr = bi.toString(16); // 120ff0\n if (hashedStr.length() % 2 != 0) {\n // Pad with 0\n hashedStr = \"0\"+hashedStr;\n }\n return hashedStr;\n\t}" ]
[ "0.64855874", "0.5997176", "0.59309316", "0.59309316", "0.57075894", "0.56021804", "0.5581704", "0.55545837", "0.55346256", "0.5491193", "0.54745936", "0.54666096", "0.54489064", "0.5408806", "0.5384694", "0.53741044", "0.5349871", "0.5349871", "0.53352207", "0.5329477", "0.53149676", "0.53048253", "0.5295417", "0.52927935", "0.5284919", "0.5284919", "0.52697104", "0.52679855", "0.52577746", "0.525029", "0.525029", "0.52352834", "0.52303606", "0.52214366", "0.5201705", "0.5183588", "0.51813626", "0.5180769", "0.5178642", "0.517462", "0.5173703", "0.5170728", "0.51686054", "0.51686054", "0.5160156", "0.51599866", "0.5134928", "0.5121431", "0.5121083", "0.5118606", "0.5114595", "0.5114595", "0.5114595", "0.51033485", "0.5099253", "0.5088795", "0.5077489", "0.50768304", "0.5075827", "0.5075827", "0.5075827", "0.50536054", "0.5052571", "0.5017753", "0.50170505", "0.5012349", "0.5011953", "0.49993974", "0.4997614", "0.4987795", "0.49742892", "0.49696708", "0.49618834", "0.49595448", "0.49590087", "0.4952983", "0.49454904", "0.4937972", "0.49365267", "0.4934312", "0.49331006", "0.49275517", "0.4913549", "0.49122676", "0.49122676", "0.4909901", "0.49050754", "0.48854867", "0.48848072", "0.4846966", "0.48430243", "0.48376113", "0.48354647", "0.48353717", "0.48206794", "0.48158514", "0.4813911", "0.4813542", "0.47958323", "0.47927904" ]
0.615014
1
Hash the given buffer and return a sha512 checksum.
protected String hashBuffer(Buffer buffer) { return FileUtils.generateSha512Sum(buffer); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String hash(){\r\n return Utility.SHA512(this.simplify());\r\n }", "public static MessageDigest getSha512MessageDigestInstance() {\n try {\n return MessageDigest.getInstance(\"SHA-512\");\n } catch (NoSuchAlgorithmException e) {\n throw new IllegalStateException(\"SHA-512 is not supported\");\n }\n }", "public String hashAndStoreBinaryFile(Buffer buffer, String uuid, String segmentedPath) {\n\t\tMeshUploadOptions uploadOptions = Mesh.mesh().getOptions().getUploadOptions();\n\t\tFile uploadFolder = new File(uploadOptions.getDirectory(), segmentedPath);\n\t\tFile targetFile = new File(uploadFolder, uuid + \".bin\");\n\t\tString targetPath = targetFile.getAbsolutePath();\n\n\t\tString sha512sum = hashBuffer(buffer);\n\t\tcheckUploadFolderExists(uploadFolder);\n\t\tdeletePotentialUpload(targetPath);\n\t\tstoreBuffer(buffer, targetPath);\n\t\treturn sha512sum;\n\t}", "public static String computePasswordSHAHash(String password) {\n MessageDigest mdSha1 = null;\n String SHAHash = \"\";\n\n try\n {\n mdSha1 = MessageDigest.getInstance(\"SHA-512\");\n } catch (NoSuchAlgorithmException e1) {\n e1.printStackTrace();\n }\n try {\n mdSha1.update(password.getBytes(\"ASCII\"));\n } catch (UnsupportedEncodingException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n byte[] data = mdSha1.digest();\n try {\n SHAHash = convertToHex(data);\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n\n return SHAHash;\n }", "public static byte[] encryptSHA512(final byte[] data) {\n return hashTemplate(data, \"SHA-512\");\n }", "public String generateHash(String password) {\n MessageDigest md = null;\n byte[] hash = null;\n try {\n md = MessageDigest.getInstance(\"SHA-512\");\n hash = md.digest(password.getBytes(\"UTF-8\"));\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n }\n return convertToHex(hash);\n }", "public static String Sha512(String str) {\n if (StringUtils.isBlank(str)) {\n return null;\n }\n\n String sha = null;\n try {\n MessageDigest crypt = MessageDigest.getInstance(\"SHA-512\");\n crypt.reset();\n crypt.update(str.getBytes(StandardCharsets.UTF_8));\n sha = byteToHex(crypt.digest());\n } catch (NullPointerException e) {\n LOGGER.error(\"Error in get SHA-512: encoded string is null!\", e);\n } catch (NoSuchAlgorithmException e) {\n LOGGER.error(MessageFormat.format(\"Error in get SHA-512 from [{0}]\", str), e);\n }\n\n return StringUtils.upperCase(sha);\n }", "private String sha512(String message) throws java.security.NoSuchAlgorithmException\n\t{\n\t\tMessageDigest sha512 = null;\n\t\ttry {\n\t\t\tsha512 = MessageDigest.getInstance(\"SHA-512\");\n\t\t}\n\t\tcatch (java.security.NoSuchAlgorithmException ex) {\n\t\t\tex.printStackTrace();\n\t\t\tthrow ex;\n\t\t}\n\t\tbyte[] dig = sha512.digest((byte[]) message.getBytes());\n\t\tStringBuffer code = new StringBuffer();\n\t\tfor (int i = 0; i < dig.length; ++i)\n\t\t{\n\t\t\tcode.append(Integer.toHexString(0x0100 + (dig[i] & 0x00FF)).substring(1));\n\t\t}\n\t\treturn code.toString();\n\t}", "com.google.protobuf.ByteString getHash();", "com.google.protobuf.ByteString getHash();", "public void hashPassword() throws NoSuchAlgorithmException{\n try {\n byte[] newSalt = (salt == null) ? new byte[128] : salt;\n\n if(salt == null){\n new Random().nextBytes(newSalt);\n }\n\n MessageDigest md = MessageDigest.getInstance(\"SHA-512\");\n md.update(newSalt);\n byte[] passwordBytes = md.digest(password.getBytes(StandardCharsets.UTF_8));\n StringBuilder sb = new StringBuilder();\n\n for(int i=0; i< passwordBytes.length ;i++){\n sb.append(Integer.toString((passwordBytes[i] & 0xff) + 0x100, 16).substring(1));\n }\n\n this.password = sb.toString();\n setSalt(newSalt);\n }\n catch (NoSuchAlgorithmException e){\n e.printStackTrace();\n }\n }", "public static String getSha512(String saltedPassword) {\n\t\tsha512MessageDigest.get().update(saltedPassword.getBytes());\n\t\treturn toHex(sha512MessageDigest.get().digest());\n\t}", "public static String getHash(String password, String salt) throws NoSuchAlgorithmException {\n MessageDigest md = MessageDigest.getInstance(\"SHA-512\");\n\n String topSecret = salt + password + salt;\n\n byte[] bytes = md.digest(topSecret.getBytes());\n\n return getHex(bytes);\n }", "protected String hashPassword(String passwordToHash, String salt) {\n\t\tString hash = null;\n\t try {\n\t MessageDigest md = MessageDigest.getInstance(\"SHA-512\");\n\t md.update(salt.getBytes(\"UTF-8\"));\n\t byte[] bytes = md.digest(passwordToHash.getBytes(\"UTF-8\"));\n\t StringBuilder sb = new StringBuilder();\n\t for (int i = 0; i < bytes.length ; ++i){\n\t sb.append(Integer.toString((bytes[i] & 0xff) + 0x100, 16).substring(1));\n\t }\n\t hash = sb.toString();\n\t } \n\t catch (NoSuchAlgorithmException e){\n\t e.printStackTrace();\n\t } catch (UnsupportedEncodingException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t return hash;\n\t}", "byte[] digest();", "public HASH512 getHash2(){return hash2;}", "private static String HashIt(String token) {\n\t\tStringBuffer hexString = new StringBuffer();\n\t\ttry {\n\t\t\tMessageDigest digest = MessageDigest.getInstance(\"SHA-256\");\n\t\t\tbyte[] hash = digest.digest(token.getBytes(StandardCharsets.UTF_8));\n\t\t\t\n\t\t\t// Convert to hex\n\t\t for (int i = 0; i < hash.length; i++) {\n\t\t\t String hex = Integer.toHexString(0xff & hash[i]);\n\t\t\t if(hex.length() == 1) {\n\t\t\t \thexString.append('0');\n\t\t\t }\n\t\t\t hexString.append(hex);\n\t\t }\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\tSystem.err.println(e.getStackTrace());\n\t\t\thexString.setLength(0);\n\t\t}\n\t return hexString.toString();\t\t\n\t}", "public long BPHash(String str) {\n\t\tlong hash = 0;\n\n\t\tfor (int i = 0; i < str.length(); i++) {\n\t\t\thash = hash << 7 ^ str.charAt(i);\n\t\t}\n\n\t\treturn hash;\n\t}", "protected static String hashGenerator(String userName, String senderId, String content, String secureKey) {\n\t\tStringBuffer finalString=new StringBuffer();\n\t\tfinalString.append(userName.trim()).append(senderId.trim()).append(content.trim()).append(secureKey.trim());\n\t\t//\t\tlogger.info(\"Parameters for SHA-512 : \"+finalString);\n\t\tString hashGen=finalString.toString();\n\t\tStringBuffer sb = null;\n\t\tMessageDigest md;\n\t\ttry {\n\t\t\tmd = MessageDigest.getInstance(\"SHA-512\");\n\t\t\tmd.update(hashGen.getBytes());\n\t\t\tbyte byteData[] = md.digest();\n\t\t\t//convert the byte to hex format method 1\n\t\t\tsb = new StringBuffer();\n\t\t\tfor (int i = 0; i < byteData.length; i++) {\n\t\t\t\tsb.append(Integer.toString((byteData[i] & 0xff) + 0x100, 16).substring(1));\n\t\t\t}\n\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn sb.toString();\n\t}", "public static byte[] encryptHmacSHA512(final byte[] data, final byte[] key) {\n return hmacTemplate(data, key, \"HmacSHA512\");\n }", "private String calchash() {\r\n String a0 = String.valueOf(bindex);\r\n a0 += String.valueOf(bdate);\r\n a0 += bdata;\r\n a0 += String.valueOf(bonce);\r\n a0 += blasthash;\r\n String a1;\r\n a1 = \"\";\r\n try {\r\n a1 = sha256(a0);\r\n } catch (NoSuchAlgorithmException ex) {\r\n Logger.getLogger(Block.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n return a1;\r\n\r\n }", "long hash(Block block, int position);", "public static String getPasswordHash(String username, String password) {\n\t\t// Setup the password encoding arguments\n\t\tfinal String salt = \"09234j234kj!@#213lk$#$)(*)DFSDFL##$\";\n\t\tfinal String passwordAndSalt = username + password + salt;\n\n\t\t// Encode the password with base64 and salt\n\t\tString encodedPassword = null;\n\t\ttry {\n\n\t\t\t// Choose SHA-512\n\t\t\tMessageDigest md = MessageDigest.getInstance(\"SHA-512\");\n\n\t\t\t// Prepare the digest\n\t\t\tmd.update(passwordAndSalt.getBytes(\"UTF-8\"));\n\n\t\t\t// Retrieve the encoded password string\n\t\t\tencodedPassword = new String(Hex.encodeHex(md.digest()));\n\t\t} catch (Exception e) {\n\t\t\tLog.e(\"LoginHistory\", e.getMessage());\n\t\t}\n\n\t\treturn encodedPassword;\n\t}", "public long JSHash(String str) {\n\t\tlong hash = 1315423911;\n\n\t\tfor (int i = 0; i < str.length(); i++) {\n\t\t\thash ^= ((hash << 5) + str.charAt(i) + (hash >> 2));\n\t\t}\n\n\t\treturn hash;\n\t}", "public static String hash(String st) {\r\n MessageDigest messageDigest = null;\r\n byte[] digest = new byte[0];\r\n\r\n try {\r\n messageDigest = MessageDigest.getInstance(\"SHA-256\");\r\n messageDigest.reset();\r\n messageDigest.update(st.getBytes());\r\n digest = messageDigest.digest();\r\n } catch (NoSuchAlgorithmException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n BigInteger bigInt = new BigInteger(1, digest);\r\n StringBuilder hex = new StringBuilder(bigInt.toString(16));\r\n\r\n while (hex.length() < 32) {\r\n hex.insert(0, \"0\");\r\n }\r\n\r\n return hex.toString();\r\n }", "public static String hash(String password){\r\n\t\t try {\r\n\t MessageDigest md = MessageDigest.getInstance(\"SHA-256\");\r\n\t md.update(password.getBytes(\"UTF-8\")); \r\n\t byte[] digest = md.digest();\r\n\t \r\n\t BigInteger bigInt = new BigInteger(1, digest);\r\n\t StringBuffer sb = new StringBuffer();\r\n\t for (int i = 0; i < digest.length; i++) {\r\n\t String hex = Integer.toHexString(0xff & digest[i]);\r\n\t if (hex.length() == 1) sb.append('0');\r\n\t sb.append(hex);\r\n\t }\r\n\t System.out.println(sb.toString());\r\n\t return sb.toString();\r\n\t \r\n\t } catch (Exception ex) {\r\n\t System.out.println(ex.getMessage());\r\n\t \r\n\t }\r\n\t\t return null;\r\n\t}", "String hash(String input) throws IllegalArgumentException, EncryptionException;", "byte[] getDigest();", "public int hash(T input);", "public String getHash(String password) {\n return DigestUtils.sha256Hex(password);\n }", "public String hashfunction(String password)\r\n\t{\r\n\t\t\r\n\t\tMessageDigest md=null;\r\n\t\ttry {\r\n\t\t\tmd = MessageDigest.getInstance(\"SHA-1\");\r\n\t\t} catch (NoSuchAlgorithmException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tmd.update(password.getBytes());\r\n\t\tbyte[] hash=md.digest();\r\n\t\tchar[] hexArray = \"0123456789ABCDEF\".toCharArray();\r\n\t\tchar[] hexChars = new char[hash.length * 2];\r\n\t for ( int j = 0; j < hash.length; j++ ) \r\n\t {\r\n\t int v = hash[j] & 0xFF;\r\n\t hexChars[j * 2] = hexArray[v >>> 4];\r\n\t hexChars[j * 2 + 1] = hexArray[v & 0x0F];\r\n\t }\r\n\t String hash_password=new String(hexChars);\r\n\t hash_password=hash_password.toLowerCase();\r\n\t return hash_password;\r\n\t}", "private int hash(String str, int h){\n int v=0;\n\n /* FILL IN HERE */\n v = Math.floorMod(MurmurHash.hash32(str, seeds[h]) >>> h, 1 << logNbOfBuckets);\n\n return v;\n }", "private int rehash(int hash) {\n final int h = hash * 0x9E3779B9;\n return h ^ (h >> 16);\n }", "String hashPassword(String password);", "String getUserPasswordHash();", "public long APHash(String str) {\n\t\tlong hash = 0xAAAAAAAA;\n\n\t\tfor (int i = 0; i < str.length(); i++) {\n\t\t\tif ((i & 1) == 0) {\n\t\t\t\thash ^= ((hash << 7) ^ str.charAt(i) * (hash >> 3));\n\t\t\t} else {\n\t\t\t\thash ^= (~((hash << 11) + str.charAt(i) ^ (hash >> 5)));\n\t\t\t}\n\t\t}\n\n\t\treturn hash;\n\t}", "int hash(String makeHash, int mod);", "public static String hash(String token){\n return Integer.toString( token.hashCode() );\n }", "String getHash();", "String getHash();", "public static byte[] transformHmacKey(byte[] digest, byte[] transform) {\n MessageDigest md = Encryption.getSha512MessageDigestInstance();\n md.update(transform);\n return md.digest(digest);\n }", "private String getOldPasswordHash(String password) {\n\t\tWhirlpool hasher = new Whirlpool();\n hasher.NESSIEinit();\n\n // add the plaintext password to it\n hasher.NESSIEadd(password);\n\n // create an array to hold the hashed bytes\n byte[] hashed = new byte[64];\n\n // run the hash\n hasher.NESSIEfinalize(hashed);\n\n // this stuff basically turns the byte array into a hexstring\n java.math.BigInteger bi = new java.math.BigInteger(hashed);\n String hashedStr = bi.toString(16); // 120ff0\n if (hashedStr.length() % 2 != 0) {\n // Pad with 0\n hashedStr = \"0\"+hashedStr;\n }\n return hashedStr;\n\t}", "com.google.protobuf.ByteString getFileHash();", "com.google.protobuf.ByteString getFileHash();", "private byte[] SHA256hash(byte[] tobeHashed){\r\n\t\tSHA256Digest digester=new SHA256Digest(); \r\n\t\tbyte[] retValue=new byte[digester.getDigestSize()]; \r\n\t\tdigester.update(tobeHashed, 0, tobeHashed.length); \r\n\t\tdigester.doFinal(retValue, 0);\r\n\t return retValue; \r\n}", "public static String encryptSHA512ToString(final byte[] data) {\n return bytes2HexString(encryptSHA512(data));\n }", "@Override\r\n\tpublic String hashFunction(String saltedPass) throws NoSuchAlgorithmException\r\n\t{\r\n\t\tMessageDigest digest = MessageDigest.getInstance(\"SHA-256\");\r\n\t\tbyte[] byteHash = digest.digest(saltedPass.getBytes(StandardCharsets.UTF_8));\r\n\t\thash = DatatypeConverter.printBase64Binary(byteHash);\r\n\t\treturn hash;\r\n\t}", "public byte[] getHash(String password) {\n MessageDigest digest = null;\n try {\n digest = MessageDigest.getInstance(\"SHA-256\");\n } catch (NoSuchAlgorithmException e1) {\n e1.printStackTrace();\n }\n digest.reset();\n return digest.digest(password.getBytes());\n }", "int getHash();", "private static int computeHash(int par0)\n {\n par0 ^= par0 >>> 20 ^ par0 >>> 12;\n return par0 ^ par0 >>> 7 ^ par0 >>> 4;\n }", "java.lang.String getChecksum();", "public String hashPassword(String plainTextPassword);", "public String getHash(String str) throws Exception{\n\t\t\n\t\tMessageDigest md = MessageDigest.getInstance(\"MD5\");\n md.update(str.getBytes());\n \n byte byteData[] = md.digest();\n \n //convert the byte to hex format method 1\n StringBuffer sb = new StringBuffer();\n for (int i = 0; i < byteData.length; i++) {\n sb.append(Integer.toString((byteData[i] & 0xff) + 0x100, 16).substring(1));\n }\n \n String hex = sb.toString();\n System.out.println(hex);\n return hex; \n}", "public static String encryptHmacSHA512ToString(final byte[] data, final byte[] key) {\n return bytes2HexString(encryptHmacSHA512(data, key));\n }", "com.google.protobuf.ByteString\n getSaltedHashBytes();", "public static String hashPassword( String hashMe ) {\n final byte[] unhashedBytes = hashMe.getBytes();\n try {\n final MessageDigest algorithm = MessageDigest.getInstance( \"MD5\" );\n algorithm.reset();\n algorithm.update( unhashedBytes );\n final byte[] hashedBytes = algorithm.digest();\n \n final StringBuffer hexString = new StringBuffer();\n for ( final byte element : hashedBytes ) {\n final String hex = Integer.toHexString( 0xFF & element );\n if ( hex.length() == 1 ) {\n hexString.append( 0 );\n }\n hexString.append( hex );\n }\n return hexString.toString();\n } catch ( final NoSuchAlgorithmException e ) {\n e.printStackTrace();\n return null;\n }\n }", "public String calculateHash() throws JsonProcessingException {\n ObjectMapper mapper = new ObjectMapper();\n String data = \"\";\n data += previousHash +\n Long.toString(timeStamp) +\n Integer.toString(nonce) +\n merkleRoot;\n\n data += \"\\\"transactions\\\":\";\n data += mapper.writeValueAsString(transactions);\n return Hashing.applySha256(data);\n }", "static int hash(long sum) {\n return (int) (sum) >>> 7;\n }", "String generateHashFromPassword(String password, byte[] salt);", "private static String pasarAHexadecimal(byte[] digest){\n String hash = \"\";\n for(byte aux : digest) {\n int b = aux & 0xff;\n if (Integer.toHexString(b).length() == 1) hash += \"0\";\n hash += Integer.toHexString(b);\n }\n return hash;\n }", "String hashPassword(String salt, String password);", "public static String hash(String in) {\r\n\t\treturn DigestUtils.md5Hex(in.getBytes());\r\n\t}", "public Long hash(String password) \n\t{\n\t\tif(password != null)\n\t\t{\n\t\t\tLong hash = 0L;\n\t\t\tfor (char c : password.toCharArray()) \n\t\t\t{\n\t\t\t\thash = (int)c + (hash << 6) + (hash << 16) - hash;\n\t\t\t}\n\t\t\treturn hash;\n\t\t}\n\t\telse \n\t\t{\n\t\t\treturn null;\n\t\t}\n\t}", "private PostData calculateHash(String key, String command, String var1, String salt) {\n checksum = null;\n checksum = new PayUChecksum();\n checksum.setKey(key);\n checksum.setCommand(command);\n checksum.setVar1(var1);\n checksum.setSalt(salt);\n return checksum.getHash();\n }", "public Map<String, Long> hashBuffer(byte[] data) throws BufferLengthException {\n\t\tif (data.length != buffer.length) {\n\t\t\tthrow new BufferLengthException(\n\t\t\t\t\tString.format(\n\t\t\t\t\t\t\t\"Compressor.hashBuffer requires exactly one superblock of data: %1$d bytes given, %2$d bytes expected.\",\n\t\t\t\t\t\t\tdata.length, buffer.length));\n\t\t}\n\t\tMap<String, Long> counters = new HashMap<>();\n\t\t// Since the buffer is enforced to be one superblock, an even multiple of block size, we can use simple\n\t\t// iteration.\n\t\tfor (int i = 0; i + blockSize <= data.length; i += blockSize) {\n\t\t\ttry {\n\t\t\t\tString key = SHA1Encoder.encode(Arrays.copyOfRange(data, i, i + blockSize));\n\t\t\t\tif (!counters.containsKey(key)) {\n\t\t\t\t\tcounters.put(key, 1L);\n\t\t\t\t} else {\n\t\t\t\t\tcounters.put(key, counters.get(key) + 1L);\n\t\t\t\t}\n\t\t\t} catch (NoSuchAlgorithmException | UnsupportedEncodingException e) {\n\t\t\t\t// Really, this should never happen, since we know the algorithm exists.\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn counters;\n\t}", "public static String calcHash(String input) {\n try {\n MessageDigest md = MessageDigest.getInstance(\"MD5\");\n md.update(input.toLowerCase().getBytes(\"UTF8\"));\n byte[] digest = md.digest();\n StringBuilder sb = new StringBuilder();\n for (byte b : digest) {\n sb.append(hexDigit(b>>4));\n sb.append(hexDigit(b));\n }\n return sb.toString();\n } catch (Exception ex) {\n throw new RuntimeException(ex.getMessage(), ex);\n }\n }", "public String calculateHash () {\n StringBuilder hashInput = new StringBuilder(previousHash)\n .append(timeStamp)\n .append(magicNumber)\n .append(timeSpentMining);\n for (Transfer transfer : this.transfers) {\n String transferDesc = transfer.getDescription();\n hashInput.append(transferDesc);\n }\n return CryptoUtil.applySha256(hashInput.toString());\n }", "public final static short calculateChecksum(final ByteBuffer buffer,\n final byte[] sourceAddress,\n final byte[] destinationAddress) {\n return IPPacket.calculateChecksum(buffer, Checksum, sourceAddress, destinationAddress, IP_PROTOCOL_NUMBER,\n Length.get(buffer));\n }", "com.google.protobuf.ByteString\n getChecksumBytes();", "private static String hashSHA256(String input) throws TokenManagementException {\n\t\t\n\t\tMessageDigest md;\n\t\ttry {\n\t\t\tmd = MessageDigest.getInstance(\"SHA-256\");\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\tthrow new TokenManagementException(ErrorMessage.sha256AlgorithmNotFound);\n\t\t}\n\t\t\n\t\t\n\t\tmd.update(input.getBytes(StandardCharsets.UTF_8));\n\t\tbyte[] digest = md.digest();\n\n\t\t// Beware the hex length. If MD5 -> 32:\"%032x\", but for instance, in SHA-256 it should be \"%064x\" \n\t\tString result = String.format(\"%64x\", new BigInteger(1, digest));\n\t\t\n\t\treturn result;\n\t\t\n\t}", "String getSaltedHash();", "public interface DigestFunction\n{\n\n byte[] digest(String clearToken);\n}", "public byte[] makeDigest(String user, String pwd) throws NoSuchAlgorithmException {\n MessageDigest md = MessageDigest.getInstance(\"SHA\");\n md.update(user.getBytes());\n md.update(pwd.getBytes());\n return md.digest();\n }", "public static String hashPassword(String password) {\n\n MessageDigest md;\n StringBuffer sb = new StringBuffer();\n String hexString = null;\n try {\n md = MessageDigest.getInstance(\"MD5\");\n\n md.update(password.getBytes());\n byte[] digest = md.digest();\n\n for (byte b : digest) {\n sb.append(String.format(\"%02x\", b & 0xff));\n }\n } catch (NoSuchAlgorithmException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n\n Logger.debug(\"Hash For Password - \" + sb.toString());\n return sb.toString();\n }", "public static void updateChecksum(CRC32 checksum, ByteBuffer buffer)\n {\n int position = buffer.position();\n checksum.update(buffer);\n buffer.position(position);\n }", "public static String hash(String password) {\n\t MessageDigest sha256;\n\t\ttry {\n\t\t\tsha256 = MessageDigest.getInstance(\"SHA-256\");\n\t\t byte[] passBytes = password.getBytes();\n\t\t byte[] passHash = sha256.digest(passBytes);\n\t\t return new String(passHash, \"UTF-8\");\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (UnsupportedEncodingException e) {\n\t\t\te.printStackTrace();\n\t\t} \n\t\treturn null;\n\t}", "public long ELFHash(String str) {\n\t\tlong hash = 0;\n\t\tlong x = 0;\n\n\t\tfor (int i = 0; i < str.length(); i++) {\n\t\t\thash = (hash << 4) + str.charAt(i);\n\n\t\t\tif ((x = hash & 0xF0000000L) != 0) {\n\t\t\t\thash ^= (x >> 24);\n\t\t\t}\n\t\t\thash &= ~x;\n\t\t}\n\n\t\treturn hash;\n\t}", "private String hashPassword(String password) {\n \t\tif (StringUtils.isNotBlank(password)) {\n \t\t\treturn new ShaPasswordEncoder().encodePassword(password, null);\n \t\t}\n \t\treturn null;\n \t}", "public abstract int doHash(T t);", "public long SDBMHash(String str) {\n\t\tlong hash = 0;\n\n\t\tfor (int i = 0; i < str.length(); i++) {\n\t\t\thash = str.charAt(i) + (hash << 6) + (hash << 16) - hash;\n\t\t}\n\n\t\treturn hash;\n\t}", "public String getSHA(String input) {\n byte[] messageDigest = md.digest(input.getBytes());\n String padding = \"00000000000000000000000000000000\";\n String returnValue;\n\n // Convert byte array into signum representation\n BigInteger no = new BigInteger(1, messageDigest);\n\n // Convert message digest into hex value\n String hashtext = no.toString(16);\n\n // pad with zeros of not long enough\n if (hashtext.length() < 32) {\n returnValue = padding.substring(0, 32-hashtext.length()) + hashtext;\n } else {\n returnValue = hashtext;\n }\n\n return returnValue;\n }", "public static String hash_password(String password) throws Exception\r\n\t{\r\n\t\t// Digest the password with MD5 algorithm\r\n\t\tMessageDigest md = MessageDigest.getInstance(\"MD5\");\r\n\t\tmd.update(password.getBytes());\r\n\t\t \r\n\t\tbyte byte_data[] = md.digest();\r\n\t\t \r\n\t\t//convert the bytes to hex format \r\n\t\tStringBuffer sb = new StringBuffer();\r\n\t\t \r\n\t\tfor (int i = 0; i < byte_data.length; i++) \r\n\t\t{\r\n\t\t\tsb.append(Integer.toString((byte_data[i] & 0xff) + 0x100, 16).substring(1));\r\n\t\t}\r\n\t\t \r\n\t\t//System.out.println(\"Hashed password: \" + sb.toString());\r\n\t\treturn sb.toString();\r\n\t}", "public static String GetHash(String input)\n {\n String hash = DigestUtils.sha1Hex(input);\n System.out.println(hash);\n return hash;\n }", "public com.google.protobuf.ByteString\n getChecksumBytes() {\n java.lang.Object ref = checksum_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n checksum_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public static String getHash(String password) {\n String hashedPassword = null;\n try {\n MessageDigest md = MessageDigest.getInstance(\"SHA-256\");\n byte[] digest = md.digest(password.getBytes());\n hashedPassword = org.apache.commons.codec.binary.Base64.encodeBase64String(digest);\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }\n\n return hashedPassword;\n }", "public static long[] splitHash(byte[] hash) {\n if (hash == null || hash.length != 16) {\n return new long[]{0L, 0L};\n }\n\n ByteBuffer buffer = ByteBuffer.wrap( hash );\n long[] ret = new long[2];\n ret[0] = buffer.getLong();\n ret[1] = buffer.getLong();\n\n\n return ret;\n }", "private String calculateHash() {\n\n // Increments the sequence to prevent two transactions from having identical keys.\n sequence++;\n return StringUtil.applySha256(\n StringUtil.getStringFromKey(sender) +\n StringUtil.getStringFromKey(recipient) +\n Float.toString(value) +\n sequence\n );\n }", "int getClientHashLength();", "@Override\n\tpublic int hashCode() {\n\t\tint karprabin = 0;\n\t\tfinal int B = 31;\n\t\tfor (int k = 0; k < this.actualsizeinwords; ++k) {\n\t\t\tkarprabin += B * karprabin + (this.buffer[k] & ((1l << 32) - 1));\n\t\t\tkarprabin += B * karprabin + (this.buffer[k] >>> 32);\n\t\t}\n\t\treturn this.sizeinbits ^ karprabin;\n\t}", "private int hasher() {\n int i = 0;\n int hash = 0;\n while (i != length) {\n hash += hashableKey.charAt(i++);\n hash += hash << 10;\n hash ^= hash >> 6;\n }\n hash += hash << 3;\n hash ^= hash >> 11;\n hash += hash << 15;\n return getHash(hash);\n }", "public static String hashPassword(String password) {\n String passwordHash = null;\n try {\n // Calculate hash on the given password.\n MessageDigest sha256 = MessageDigest.getInstance(\"SHA-256\");\n byte[] hash = sha256.digest(password.getBytes());\n\n // Transform the bytes (8 bit signed) into a hexadecimal format.\n StringBuilder hashString = new StringBuilder();\n for (int i = 0; i < hash.length; i++) {\n /*\n Format parameters: %[flags][width][conversion]\n Flag '0' - The result will be zero padded.\n Width '2' - The width is 2 as 1 byte is represented by two hex characters.\n Conversion 'x' - Result is formatted as hexadecimal integer, uppercase.\n */\n hashString.append(String.format(\"%02x\", hash[i]));\n }\n passwordHash = hashString.toString();\n Log.d(TAG, \"Password hashed to \" + passwordHash);\n } catch (NoSuchAlgorithmException e) {\n Log.d(TAG, \"Couldn't hash password. The expected digest algorithm is not available.\");\n }\n return passwordHash;\n }", "public com.google.protobuf.ByteString\n getChecksumBytes() {\n java.lang.Object ref = checksum_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n checksum_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "int getPasswordHashLength();", "private boolean checkHash(byte[] password, String hashValue) {\n\t\tint hashReps = 1000; // stretch the hash this many times\n\t\tString hashAlgorithm = \"MD5\";\n\n\t\tString endValue = new String();\n\t\ttry {\n\t\t\tMessageDigest md = MessageDigest.getInstance(hashAlgorithm);\n\t\t\tbyte[] value = password;\n\t\t\tfor (int i=0; i<hashReps; i++) { \n\t\t\t\tvalue = md.digest(value);\n\t\t\t}\n\t\t\tendValue = DatatypeConverter.printBase64Binary(value);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(0);\n\t\t}\n\n\t\tComMethods.report(\"Digest calculated is \"+endValue+\".\", simMode);\n\t\tComMethods.report(\"Actual digest associated with username is \"+hashValue+\".\", simMode);\n\n\t\treturn (endValue.equals(hashValue));\n\t}", "private static String getHash(byte[] dataBuffer, MessageDigest dgst) throws Exception{\n\t\tdgst.update(dataBuffer);\n\t\t\n\t\tbyte[] dgstByte = dgst.digest();\n\n\t\tStringBuffer sb = new StringBuffer();\n\t\tfor(int i=0; i<dgstByte.length; i++){\n\t\t\tsb.append(Integer.toString((dgstByte[i] & 0xff) + 0x100, 16).substring(1));\n\t\t}\n\t\t\n\t\tSystem.out.println(\"dgstByteString HEXString is: \" + sb.toString());\t\t\n\t\treturn sb.toString();\n\t\t\n\t\t/*\n\t\t * Uncomment below lines to return the message digest with base64 encoded string\n\t\t * */\n\t\t\n\t\t// System.out.println(\"dgstByteString B64 of HEX is: \" + Base64.encode(sb.toString().getBytes()));\n\t\t// return Base64.encode(sb.toString().getBytes());\n\t}", "public static String encryptSHA512ToString(final String data) {\n if (data == null || data.length() == 0) return \"\";\n return encryptSHA512ToString(data.getBytes());\n }", "public String hashing(String password) {\n\n\t\tString hashedPassword = null;\n\n\t\tMessageDigest md;\n\t\ttry {\n\t\t\tmd = MessageDigest.getInstance(\"MD5\");\n\t\t\tmd.update(password.getBytes());\n\t\t\tbyte[] digest = md.digest();\n\t\t\tStringBuffer sb = new StringBuffer();\n\t\t\tfor (byte b : digest) {\n\t\t\t\tsb.append(String.format(\"%02x\", b & 0xff));\n\t\t\t}\n\t\t\thashedPassword = sb.toString();\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn hashedPassword;\n\t}", "private int hash(Handle[] myTable,\n String toHash) {\n\n int intLength = toHash.length() / 4;\n long sum = 0;\n for (int j = 0; j < intLength; j++) {\n char[] c = toHash.substring(j * 4, (j * 4) + 4)\n .toCharArray();\n long mult = 1;\n for (int k = 0; k < c.length; k++) {\n sum += c[k] * mult;\n mult *= 256;\n } // end inner for\n } // end outer for\n char[] c = toHash.substring(intLength * 4).toCharArray();\n long mult = 1;\n for (int k = 0; k < c.length; k++) {\n sum += c[k] * mult;\n mult *= 256;\n }\n return (int) (Math.abs(sum) % myTable.length);\n }", "@Override\n public int checksum(ByteBuffer bb) {\n if (bb == null)\n throw new NullPointerException(\"ByteBuffer is null in Fletcher32#checksum\");\n Fletcher32 f = f32.get();\n f.update(bb.array());\n return (int) f.getValue();\n }", "public static final String hashing(String password) throws NoSuchAlgorithmException, NoSuchProviderException {\n String hpassword = password;\n MessageDigest mDigest = MessageDigest.getInstance(\"SHA1\");\n byte[] result = mDigest.digest(hpassword.getBytes());\n StringBuffer sb = new StringBuffer();\n for (int i = 0; i < result.length; i++) {\n sb.append(Integer.toString((result[i] & 0xff) + 0x100, 16).substring(1));\n }\n return sb.toString();\n }" ]
[ "0.6422001", "0.63125503", "0.6222675", "0.59744227", "0.5953681", "0.5857054", "0.5804058", "0.57518834", "0.55181414", "0.55181414", "0.5489355", "0.54873395", "0.54449487", "0.54052246", "0.53650916", "0.5356416", "0.52990884", "0.5263203", "0.51919484", "0.5172377", "0.5141545", "0.51306903", "0.51063293", "0.5091285", "0.5074948", "0.5073833", "0.5028339", "0.5014539", "0.5009114", "0.5008716", "0.50085837", "0.500644", "0.5005202", "0.4988224", "0.49866486", "0.4979062", "0.4973615", "0.4952128", "0.4939425", "0.4939425", "0.4933349", "0.4921583", "0.48914355", "0.48914355", "0.48906377", "0.4890414", "0.48775822", "0.4877332", "0.48721105", "0.48564762", "0.48543024", "0.48526272", "0.48442993", "0.4839762", "0.4836836", "0.48012832", "0.47882944", "0.4768202", "0.47528422", "0.47288945", "0.47277415", "0.4727181", "0.4717399", "0.47162804", "0.47082523", "0.4704224", "0.46952933", "0.46904236", "0.46790728", "0.4677577", "0.4676256", "0.46651468", "0.46624553", "0.4644932", "0.46445706", "0.4644094", "0.46394095", "0.46339834", "0.46298316", "0.46282855", "0.46277106", "0.46201453", "0.4605535", "0.459929", "0.45809388", "0.45784664", "0.4576427", "0.4570691", "0.45665777", "0.45578662", "0.4552096", "0.45459047", "0.45365432", "0.4529134", "0.45285994", "0.45279443", "0.45180616", "0.45163247", "0.45125285", "0.45123523" ]
0.7882477
0
Delete potential existing file uploads from the given path.
protected void deletePotentialUpload(String targetPath) { FileSystem fileSystem = Mesh.vertx().fileSystem(); if (fileSystem.existsBlocking(targetPath)) { // Deleting of existing binary file fileSystem.deleteBlocking(targetPath); } // log.error("Error while attempting to delete target file {" + targetPath + "}", error); // log.error("Unable to check existence of file at location {" + targetPath + "}"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void deleteFile(FsPath path);", "private void clearFiles() {\r\n File file = new File(\"test_files/upload\");\r\n File[] files = file.listFiles();\r\n for (File delFile : files) {\r\n delFile.delete();\r\n }\r\n file = new File(\"test_files/stress.jar\");\r\n file.delete();\r\n }", "private void clean(Path path) throws IOException {\n if (Files.exists(path)) {\n Files.walkFileTree(path, new SimpleFileVisitor<>() {\n public FileVisitResult visitFile(Path path, BasicFileAttributes attributes) throws IOException {\n Files.delete(path);\n return FileVisitResult.CONTINUE;\n }\n\n public FileVisitResult postVisitDirectory(Path path, IOException exception) throws IOException {\n Files.delete(path);\n return FileVisitResult.CONTINUE;\n }\n });\n }\n }", "public static void deletePath(Path path) throws IOException {\n if (!Files.isDirectory(path) || Files.list(path).count() == 0) { Files.deleteIfExists(path); }\n else {\n try (Stream<Path> files = Files.list(path)) {\n files.forEach(p -> {\n try { deletePath(p); }\n catch (IOException e) { e.printStackTrace(); }\n });\n Files.delete(path);\n }\n }\n }", "public static void deleteAllFile(File path) {\n File[] array = path.listFiles();\n\n for (File file : array) {\n if (file.isFile()) {\n file.delete();\n }\n }\n }", "void fileDeleted(String path);", "@PreAuthorize(\"hasRole('ROLE_ROOT')\")\n\tpublic void deleteFileUploads();", "public static void deleteFolder(String path){\n List<CMSFile> files = CMSFile.find(\"name like '\" + path + \"%'\").fetch();\n for (CMSFile file: files){\n if (file.data != null && file.data.exists()) {\n file.data.getFile().delete();\n }\n file.delete();\n }\n }", "@RequestMapping(value=\"/my_files\", method = RequestMethod.DELETE)\n @ResponseBody\n public AppResponse delete(@RequestParam String path) throws IOException, InvalidValueException,FilePathAccessDeniedException {\n\n String username = CSQLUserContext.getCurrentUser().getUsername();\n if(validator.isValidAndUserHasAccess(username, path)){\n return fileSystemService.delete(path, true);\n }\n\n return AppResponse.error();\n }", "public void clearPath(Path path) throws Exception {\n List<FileInfo> listing = metastore.list(Collections.singletonList(path), true);\n \n for(FileInfo file : listing) {\n metastore.delete(file.getPath());\n }\n }", "public void removeFiles() throws ServiceException;", "public synchronized void cleanup() {\n\t\tString[] children = mStorageDirectory.list();\n\t\tif (children != null) { // children will be null if the directory does\n\t\t\t\t\t\t\t\t// not exist.\n\t\t\tfor (int i = 0; i < children.length; i++) { // remove too small file\n\t\t\t\tFile child = new File(mStorageDirectory, children[i]);\n\t\t\t\tif (!child.equals(new File(mStorageDirectory, NOMEDIA))\n\t\t\t\t\t\t&& child.length() <= MIN_FILE_SIZE_IN_BYTES) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tchild.delete();\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "abstract public void remove( String path )\r\n throws Exception;", "public void delete(String path) throws IOException {\n Path destionationPath = new Path(path);\n\n if (!hdfs.exists(destionationPath)) {\n throw new IOException(\"File/directory doesn't exists!\");\n }\n hdfs.delete(destionationPath, true);\n }", "@Override\n public void deleteFiles(Collection<String> absolutePaths) {\n gemFileDb.delete(absolutePaths);\n }", "private void deleteFile() {\n\t\tFile dir = getFilesDir();\n\t\tFile file = new File(dir, FILENAME);\n\t\tfile.delete();\n\t}", "public void delete(String path) throws GRIDAClientException {\n\n List<String> paths = new ArrayList<String>();\n paths.add(path);\n\n delete(paths);\n }", "public void delete() {\r\n if (this.selectedTag != null) {\r\n for (int i = uploads.size() -1; i >= 0 ; i--) {\r\n if (this.selectedTag.equals(uploads.get(i).getTag())) {\r\n FileUtil.deleteFile(uploads.get(i).getFilepath());\r\n uploads.remove(i);\r\n break;\r\n }\r\n }\r\n }\r\n }", "public static void deleteEverythingInPath(String path) {\n try {\n Path rootPath = Paths.get(path);\n Files.walk(rootPath, FileVisitOption.FOLLOW_LINKS)\n .sorted(Comparator.reverseOrder())\n .map(Path::toFile)\n .peek(System.out::println)\n .forEach(File::delete);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void removeExpiredFiles() {\n \t\n \tsetCurrentTimeNow();\n\n File dir = new File(fsResource.getPath());\n File[] list = dir.listFiles(this);\n for (File file : list) {\n \tlogger.info(\"Auto expire file removed: {}\", file.getName());\n \tfile.delete();\n }\n }", "@Override\n\tpublic void deleteUploadedFiles(AuthenticationToken token, String uploadedDirectory, List<String> uploadedFiles) throws PermissionDeniedException, FileDeleteFailedException {\n\t\tFile file = new File(uploadedDirectory);\n\t\tFile[] childFiles = file.listFiles();\n\t\tfor(File child : childFiles){\n\t\t\tif(child.isFile() && uploadedFiles.contains(child.getName())){\n\t\t\t\tdeleteFile(token, child.getAbsolutePath());\n\t\t\t}\n\t\t}\t\n\t}", "protected synchronized void delete()\n {\n if (this.file.exists())\n {\n this.file.delete();\n }\n }", "public static void deleteDirectory(String path) throws KubernetesPluginException {\n Path pathToBeDeleted = Paths.get(path);\n if (!Files.exists(pathToBeDeleted)) {\n return;\n }\n try {\n Files.walk(pathToBeDeleted)\n .sorted(Comparator.reverseOrder())\n .map(Path::toFile)\n .forEach(File::delete);\n } catch (IOException e) {\n throw new KubernetesPluginException(\"Unable to delete directory: \" + path, e);\n }\n\n }", "public void deleteAllFromDB() {\r\n for (int i = 0; i < uploads.size(); i++) {\r\n FileUtil.deleteFile(uploads.get(i).getFilepath());\r\n }\r\n super.getBasebo().remove(uploads);\r\n }", "@PreAuthorize(\"hasPermission(#fileUpload, 'delete') or hasPermission(#form, 'write') or hasRole('ROLE_ADMIN')\")\n\tpublic void deleteFileUpload(FileUpload fileUpload, Form form) throws AppException;", "private void deleteDirectory(Path path) throws IOException {\n if (Files.isDirectory(path, LinkOption.NOFOLLOW_LINKS)) {\n try (DirectoryStream<Path> entries = Files.newDirectoryStream(path)) {\n for (Path entry : entries) {\n deleteDirectory(entry);\n }\n }\n }\n Files.delete(path);\n }", "public static void deleteFilesMatchingExpression(String path,\n \t\t\tString expression) {\n \t\tdeleteFilesMatchingExpression(new File(path), expression, false);\n \t}", "public void deleteTemporaryFiles() {\n if (!shouldReap()) {\n return;\n }\n\n for (File file : temporaryFiles) {\n try {\n FileHandler.delete(file);\n } catch (UncheckedIOException ignore) {\n // ignore; an interrupt will already have been logged.\n }\n }\n }", "@Override\r\n\tpublic void remFile(String path) {\n\t\t\r\n\t}", "public void cleanup() {\n try {\n Files.delete(path);\n } catch (final IOException e) {\n throw new StageAccessException(\"Unable to delete staged document!\", e);\n }\n }", "@DeleteMapping(\"/upload-files/{id}\")\n @Timed\n public ResponseEntity<Void> deleteUploadFiles(@PathVariable Long id) {\n log.debug(\"REST request to delete UploadFiles : {}\", id);\n uploadFilesService.delete(id);\n return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build();\n }", "public static void deleteAll(File path, boolean includePath) throws IOException {\n\n Files.walkFileTree(path.toPath(), new FileTreeWalker(FileTreeWalker.Action.DELETE));\n\n if (includePath && path.exists() && !path.delete()) {\n throw new IOException(\"Failed to delete directory or file \"\n + path);\n }\n\n }", "private void delete(File file) {\n if (file.isDirectory()) {\n cleanDirectory(file);\n }\n file.delete();\n }", "public void deleteFile(File f);", "private void deleteCacheFiles() {\n\n\t\t// get the directory file\n\t\tFile cache = new File(Constants.CACHE_DIR_PATH);\n\n\t\t// check if we got the correct instance of that directory file.\n\t\tif (!cache.exists() || !cache.isDirectory())\n\t\t\treturn;\n\n\t\t// gets the list of files in the directory\n\t\tFile[] files = cache.listFiles();\n\t\t// deleting\n\n\t\tdeleteFiles(cache);\n\t\tfiles = null;\n\t\tcache = null;\n\n\t}", "private void deleteUploadFiles(List<File> listFiles) {\r\n\t\tif (listFiles != null && listFiles.size() > 0) {\r\n\t\t\tfor (File aFile : listFiles) {\r\n\t\t\t\taFile.delete();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void delete() {\r\n Log.d(LOG_TAG, \"delete()\");\r\n for (int i = 0; i < mNumSegments; i++) {\r\n File chunk = new File(getFileNameForIndex(i));\r\n if (chunk.delete()) {\r\n Log.d(LOG_TAG, \"Deleted file \" + chunk.getAbsolutePath());\r\n }\r\n }\r\n new File(mBaseFileName + \".zip\").delete();\r\n }", "public static void recursiveDelete(Path path) throws IOException {\n if (Files.isDirectory(path)) {\n Files.walkFileTree(path, new SimpleFileVisitor<Path>() {\n @Override\n public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {\n Files.delete(file);\n return FileVisitResult.CONTINUE;\n }\n\n @Override\n public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException {\n Files.delete(file);\n return FileVisitResult.CONTINUE;\n }\n\n @Override\n public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException {\n if (exc == null) {\n Files.delete(dir);\n return FileVisitResult.CONTINUE;\n } else {\n throw exc;\n }\n }\n });\n }\n }", "@Override\n public void clean(Path path) {\n }", "boolean removeDocument(String path);", "private void deleteFile(java.io.File file) {\n if (file.isDirectory()) {\n for (java.io.File f : file.listFiles()) \n deleteFile(f);\n }\n \n if (!file.delete())\n try {\n throw new FileNotFoundException(\"Failed to delete file: \" + file.getName());\n } catch (FileNotFoundException e) {\n System.err.println(\"Delete of file \" + file.getAbsolutePath() + \" failed\");\n e.printStackTrace();\n }\n }", "public void remove(String id) {\n\t\tif (!filesMap.containsKey(id)) {\n\t\t\treturn;\n\t\t}\n\t\tMap<String, String> uploadedFileInfo = filesMap.get(id);\n\t\tFile file = new File(uploadedFileInfo.get(UPLOADED_FILE_PATH));\n\t\tif (!file.exists()) {\n\t\t\treturn;\n\t\t}\n\t\tfile.delete();\n\t}", "void deleteFile(FileReference fileReferece);", "public static void deleteFile(File file){\r\n if(file.isFile()){\r\n file.delete();\r\n return;\r\n }\r\n if(file.isDirectory()){\r\n File[] childFile = file.listFiles();\r\n if(childFile == null || childFile.length == 0){\r\n file.delete();\r\n return;\r\n }\r\n for(File f : childFile){\r\n deleteFile(f);\r\n }\r\n file.delete();\r\n }\r\n }", "public final void deleteTemporaryFile()\n\t\tthrows IOException {\n\t\t\t\n // DEBUG\n \n if ( isQueued()) {\n Debug.println(\"@@ Delete queued file segment, \" + this);\n Thread.dumpStack();\n }\n \n\t\t//\tDelete the temporary file used by the file segment\n\n\t\tFile tempFile = new File(getTemporaryFile());\n\t\t\t\t\n\t\tif ( tempFile.exists() && tempFile.delete() == false) {\n\n\t\t //\tDEBUG\n\t\t \n\t\t Debug.println(\"** Failed to delete \" + toString() + \" **\");\n\t\t \n\t\t //\tThrow an exception, delete failed\n\t\t \n\t\t\tthrow new IOException(\"Failed to delete file \" + getTemporaryFile());\n\t\t}\n\t}", "public void delete() {\n\t\tclose();\n\t\t// delete the files of the container\n\t\tfor (int i=0; i<BlockFileContainer.getNumberOfFiles(); i++)\n\t\t\tfso.deleteFile(prefix+EXTENSIONS[i]);\n\t}", "public static boolean deleteFileRoot(String path) {\n try {\n if (!readReadWriteFile())\n RootTools.remount(path, \"rw\");\n\n if (new File(path).isDirectory()) {\n execute(\"rm -f -r \" + getCommandLineString(path));\n } else {\n execute(\"rm -r \" + getCommandLineString(path));\n }\n return true;\n } catch (Exception e) {\n e.printStackTrace();\n }\n return false;\n }", "public void doDelete(HttpServletRequest req, HttpServletResponse resp, String filepath) throws IOException {\n\t\tStorage storage = StorageOptions.getDefaultInstance().getService();\n\t storage.delete(BUCKET, filepath);\n\t}", "public static void deleteFiles(final String _file) throws IOException {\n final File file = new File(_file);\n FileUtils.forceDelete(file);\n }", "@Override\n\tpublic void delete()\n\t{\n\t\tcachedContent = null;\n\t\tFile outputFile = getStoreLocation();\n\t\tif ((outputFile != null) && outputFile.exists())\n\t\t{\n\t\t\tif (Files.remove(outputFile) == false)\n\t\t\t{\n\t\t\t\tlog.error(\"failed to delete file: \" + outputFile.getAbsolutePath());\n\t\t\t}\n\t\t}\n\t}", "public void delete_File(){\n context.deleteFile(Constant.FILE_NAME);\n }", "protected void deleteAttachmentFile()\n {\n try\n {\n if (deleteAttachmentAfterSend && fullAttachmentFilename != null)\n {\n File attFile = new File(fullAttachmentFilename);\n if (log.isDebugEnabled())\n {\n log.debug(\"Delete attachment file: \" + attFile.getCanonicalPath());\n }\n attFile.delete();\n }\n } catch (Exception e)\n {\n log.warn(\"Unable to delete \" + fullAttachmentFilename + \" : \" + e.getMessage());\n }\n }", "public synchronized void cleanupSimple() {\n\t\tfinal int maxNumFiles = 1000;\n\t\tfinal int numFilesToDelete = 50;\n\n\t\tString[] children = mStorageDirectory.list();\n\t\tif (children != null) {\n\t\t\tif (children.length > maxNumFiles) {\n\t\t\t\tfor (int i = children.length - 1, m = i - numFilesToDelete; i > m; i--) {\n\t\t\t\t\tFile child = new File(mStorageDirectory, children[i]);\n\t\t\t\t\ttry {\n\t\t\t\t\t\tchild.delete();\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void unWatchDir(Path path) {\n watcher_service.deRegisterAll(path);\n }", "protected static void deleteTrash() {\n\t\tArrays.stream(new File(\".\").listFiles())\n\t\t\t.filter(f -> f.getName().startsWith(\"_tmp.\"))\n\t\t\t.forEach(File::delete);\n\t}", "public void removeFiles(String mPath)\n\t{\n\t\tFile dir = new File(mPath);\n\n\t\tString[] children = dir.list();\n\t\tif (children != null) {\n\t\t\tfor (int i=0; i<children.length; i++) {\n\t\t\t\tString filename = children[i];\n\t\t\t\tFile f = new File(mPath + filename);\n\n\t\t\t\tif (f.exists()) {\n\t\t\t\t\tf.delete();\n\t\t\t\t}\n\t\t\t}//for\n\t\t}//if\n\n\t}", "@Override\n public void delete(File file) {\n }", "private void deleteImage(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tint id= Integer.parseInt(request.getParameter(\"fileId\"));\n\t\tFiles file= new FilesDAO().view(id);\n\t\t//Logic to delete the file from the database\n\t\t\n\t\tnew FilesDAO().delete(id);\n\t\t\n\t\t\n\t\t//Logic to delete file from the file system\n\t\t\n\t\tFile fileOnDisk= new File(path+file.getFileName());\n\t\tif(fileOnDisk.delete()) {\n\t\t\tSystem.out.println(\"File deleted from the folder\");\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"Sorr! file couldn't get deleted from the folder\");\n\t\t}\n\t\tlistingPage(request, response);\n\t}", "public void deleteDownloadedFiles() {\n if (sDocPath.listFiles() == null || sDocPath.listFiles().length == 0) {\n return;\n }\n\n for (File file : sDocPath.listFiles()) {\n deleteFile(file);\n }\n }", "private static boolean deleteDirectory(final File path) {\r\n if (path.exists()) {\r\n final File[] files = path.listFiles();\r\n for (int i = 0; i < files.length; i++) {\r\n if (files[i].isDirectory()) {\r\n deleteDirectory(files[i]);\r\n }\r\n else {\r\n files[i].delete();\r\n }\r\n }\r\n }\r\n return (path.delete());\r\n }", "private static void deleteDatabaseHelper(final Path path) {\n if (path != null) {\n\n try {\n if (!Files.isDirectory(path)) {\n Files.delete(path);\n } else {\n \n // see http://www.oracle.com/technetwork/articles/java/ma14-java-se-8-streams-2177646.html\n // for an explanation of streams and foreach\n Files.newDirectoryStream(path).forEach(filePath -> deleteDatabaseHelper(filePath));\n Files.delete(path);\n }\n\n } catch (IOException ex) {\n Logger.getLogger(ConnectionManager.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n }", "public static void deleteFile(String filePath) {\n File file = getFile(filePath);\n if (file.exists()) {\n file.delete();\n }\n }", "public static native boolean remove(String path) throws IOException;", "public static void delete(File f) {\n delete_(f, false);\n }", "public void delete() {\n if (tempFile != null) {\n tempFile.delete();\n }\n }", "public void removePath(Path aPath) {\n _thePaths.remove(aPath);\n }", "private void cleanDirectory(File dir) {\n File[] files= dir.listFiles();\n if (files!=null && files.length>0) {\n for (File file: files) {\n delete(file);\n }\n }\n }", "private static void deleteFileOrDir(File file)\n {\n if (file.isDirectory())\n {\n File[] childs = file.listFiles();\n for (int i = 0;i < childs.length;i++)\n {\n deleteFileOrDir(childs[i]);\n }\n }\n file.delete();\n }", "private void deleteFile(@Nonnull File file) throws IOException {\n Files.delete(file.toPath());\n }", "public File delete(File f) throws FileDAOException;", "private void recDelete(File file) {\n if (!file.exists()) {\n return;\n }\n if (file.isDirectory()) {\n File[] list = file.listFiles();\n if (list != null) {\n for (File f : list) {\n recDelete(f);\n }\n }\n }\n file.delete();\n }", "public void removeFromAll(String path) {\n for (String device : this.execAdbDevices())\n this.remove(device, path);\n }", "public void delete() throws IOException {\n\t\tclose();\n\t\tdeleteContents(directory);\n\t}", "public void delete( String name) throws PhileNotFoundException {\n\t\tif (!fileList.containsKey(name)) {\n\t\t\tthrow new PhileNotFoundException(\"File doesn't exist\");\n\t\t}\n\t\telse {\n\t\t\tPhile phile = fileList.get(name);\n\t\t\tfileList.remove(name);\n\t\t\ttotalNumberOfFiles--;\n\t\t\tif (openFiles.contains(phile)) {\n\t\t\t\topenFiles.remove(phile);\n\t\t\t\tnumberOfOpenFiles--;\n\t\t\t}\n\t\t}\n }", "public void deleteFile() {\n\t\tif (JOptionPane.showConfirmDialog(desktopPane,\n\t\t\t\t\"Are you sure? this action is permanent!\") != JOptionPane.YES_OPTION)\n\t\t\treturn;\n\n\t\tEllowFile file = null;\n\t\tTreePath paths[] = getSelectionModel().getSelectionPaths();\n\t\tif (paths == null)\n\t\t\treturn;\n\t\tfor (TreePath path : paths) {\n\t\t\tDefaultMutableTreeNode node = (DefaultMutableTreeNode) path\n\t\t\t\t\t.getLastPathComponent();\n\t\t\tfile = (EllowFile) node.getUserObject();\n\t\t\tEllowynProject project = file.parentProject;\n\t\t\tfile.deleteAll();\n\t\t\tif (!file.isProjectFile && project != null)\n\t\t\t\tproject.rebuild(); // don't rebuild the project if the project\n\t\t\t\t\t\t\t\t\t// itself is deleted\n\t\t\tdesktopPane.closeFrames(file);\n\t\t\tmodel.removeNodeFromParent(node);\n\t\t}\n\t}", "public void delete() throws Exception {\n\n getConnection().do_Delete(new URL(getConnection().getFilemanagerfolderendpoint() + \"/\" + getId()),\n getConnection().getApikey());\n }", "public boolean delete(String path, boolean recurse) throws SystemException;", "public void cancelUpload() {\n if (this.nativeFilesQueued.size() > 0) {\n cancelUpload(this.nativeFilesQueued.get(0).<File>cast().getId());\n }\n }", "public DocumentMutation delete(String path);", "public static void deleteFilesMatchingExpression(String path,\n \t\t\tString expression, boolean recurse) {\n \t\tdeleteFilesMatchingExpression(new File(path), expression, recurse);\n \t}", "public void removePreviouslySavedFilesFromSDCard() {\n\t\tFile file = ctxt.getExternalFilesDir(Tattle_Config_Constants.SD_FOLDER_NAME + File.separator);\n\t\tif (file.exists()) {\n\t\t\tFile[] files = file.listFiles();\n\t\t\tfor (File f : files) {\n\t\t\t\tf.delete();\n\t\t\t}\n\t\t}\n\t\tfile.delete();\n\t}", "public void deleteFile(int id) {\n\t\tString sql = \"delete from file where file_id=\"+id;\n\t\tthis.getJdbcTemplate().update(sql);\n\t}", "public static void deleteQuietly(File f) {\n if (!delete_(f, true)) {\n // As a last resort\n f.deleteOnExit();\n }\n }", "public static void fileDelete(String filePath) {\n\t\tFile f = new File(filePath);\n\n\t\t// noinspection ResultOfMethodCallIgnored\n\t\tf.delete();\n\t}", "protected void remove(String path) throws IOException {\n String[] command = {SVN, REMOVE, path, FORCE, NON_INTERACTIVE};\n run(command, null, null, null);\n }", "public void removeStoredCsvFile(HttpServletRequest request) {\n String filePath = (String) request.getSession().getAttribute(CSV_FILE_PATH_KEY);\n if (filePath == null) {\n return;\n }\n File csvFile = new File(filePath);\n if (csvFile.exists()) {\n csvFile.delete();\n }\n request.getSession().setAttribute(CSV_FILE_PATH_KEY, null);\n request.getSession().setAttribute(CSV_ORIGINAL_FILE_NAME_KEY, null);\n }", "public static void delete(File file) throws IOException {\n String method = \"delete() - \";\n if ((file != null) && (file.exists())) {\n if (file.isDirectory()) {\n if (file.list().length == 0) {\n file.delete();\n }\n else {\n String files[] = file.list();\n for (String current : files) {\n File fileToDelete = new File(file, current);\n delete(fileToDelete);\n if (file.list().length == 0) {\n file.delete();\n }\n }\n }\n }\n else {\n file.delete();\n }\n }\n else {\n throw new IOException(method \n + \"The input file is null or does not exist.\");\n }\n }", "public void removeFile(FileContentType fileContentType, String fileName) throws ServiceException;", "public synchronized void deleteNow() {\n for (FileNode node : delete) {\n tryDelete(node);\n }\n delete.clear();\n }", "public ImageFile removeImageFile(int f) { return imageFiles.remove(f); }", "@Override\r\n\tpublic void remDir(String path) {\n\t\t\r\n\t}", "public void deleteFiles(Path[] files)\n {\n delete_files = files;\n }", "public void cleanImportDirectory(String iPath) {\r\n\t\ttry {\r\n\t\t\tFile theFile = new File(iPath);\r\n\t\t\tFile allFiles[] = theFile.listFiles();\r\n\r\n\t\t\tfor (File allFile : allFiles) {\r\n\t\t\t\tif (allFile.isDirectory()) {\r\n\t\t\t\t\tcleanImportDirectory(allFile.toString());\r\n\t\t\t\t\tallFile.delete();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tallFile.delete();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (NullPointerException npe) {\r\n\t\t\tmLogger.severe(iPath + \" did not exist and was not cleaned!!\");\r\n\t\t}\r\n\t}", "public void deleteFile(String filePath){\n File myFile = new File(filePath);\n if (myFile.exists()) {\n myFile.delete();\n System.out.println(\"File successfully deleted.\");\n } else {\n System.out.println(\"File does not exists\");\n }\n }", "public void deleteMoreFile() {\n\t\tFile outfile = new File(outFileString);\n\t\tFile files[] = outfile.listFiles();\n\t\tfor (int i = 0; i < files.length; i++) {\n\t\t\tString name = files[i].getAbsolutePath();\n\t\t\tif ((!name.contains(\"SICG\")) && (!name.contains(\"AndroidManifest.xml\"))) {\n\t\t\t\tDirDelete delete = new DirDelete();\n\t\t\t\tdelete.deleteDir(files[i]);\n\t\t\t}\n\t\t}\n\t}", "public void delete_file(String file_name) throws Exception{\n\t\tFile file = new File(file_name);\n\t\tif (file.exists() && file.isFile()) file.delete();\n\t\telse if(file.isDirectory()){\n\t\t\tfor(File f : file.listFiles()){\n\t\t\t\tdelete_file(f.getAbsolutePath());\n\t\t\t}\n\t\t\tfile.delete();\n\t\t}\n\t}", "void removeXML(String path)\n throws ProcessingException;", "protected abstract boolean deleteCheckedFiles();", "private void delete(String name) {\n File f = new File(name);\n if (f.exists()) {\n f.delete();\n }\n }", "public int remove(String pathname) throws YAPI_Exception\n {\n byte[] json = new byte[0];\n String res;\n json = sendCommand(String.format(Locale.US, \"del&f=%s\",pathname));\n res = _json_get_key(json, \"res\");\n //noinspection DoubleNegation\n if (!(res.equals(\"ok\"))) { throw new YAPI_Exception( YAPI.IO_ERROR, \"unable to remove file\");}\n return YAPI.SUCCESS;\n }" ]
[ "0.70746523", "0.69871855", "0.69622076", "0.67605114", "0.6740859", "0.6557722", "0.64825845", "0.64662683", "0.64482063", "0.64460045", "0.64314246", "0.6369462", "0.6338476", "0.63112074", "0.62738085", "0.62456125", "0.61685026", "0.61608094", "0.6128986", "0.61244774", "0.60737365", "0.6070865", "0.606352", "0.6054138", "0.60403", "0.603599", "0.60143423", "0.60137135", "0.59881115", "0.5983545", "0.59392613", "0.59322584", "0.59143066", "0.5901539", "0.58938295", "0.58793914", "0.585925", "0.5837609", "0.58195645", "0.5812692", "0.5806139", "0.57829976", "0.5756181", "0.57349575", "0.5730204", "0.5725812", "0.570862", "0.5706482", "0.5705657", "0.57016766", "0.5694769", "0.5687095", "0.5677145", "0.56555754", "0.56460434", "0.5644625", "0.5615791", "0.56091213", "0.560684", "0.56040835", "0.5595749", "0.5594452", "0.55935436", "0.5588747", "0.55845875", "0.5559054", "0.5558864", "0.5552832", "0.55498004", "0.5546609", "0.55426574", "0.55301327", "0.551046", "0.5508141", "0.54979384", "0.54954857", "0.54893374", "0.548745", "0.5482908", "0.5479736", "0.5479144", "0.5478999", "0.5473864", "0.547126", "0.54690456", "0.5461701", "0.545974", "0.5457367", "0.5456793", "0.54552853", "0.54541594", "0.5452154", "0.54464906", "0.54438883", "0.5421354", "0.5420979", "0.541536", "0.54125476", "0.54052734", "0.5402767" ]
0.7095235
0
Move the file upload from the temporary upload directory to the given target path.
protected void moveUploadIntoPlace(String fileUpload, String targetPath) { FileSystem fileSystem = Mesh.vertx().fileSystem(); fileSystem.moveBlocking(fileUpload, targetPath); if (log.isDebugEnabled()) { log.debug("Moved upload file from {" + fileUpload + "} to {" + targetPath + "}"); } // log.error("Failed to move upload file from {" + fileUpload.uploadedFileName() + "} to {" + targetPath + "}", error); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void deletePotentialUpload(String targetPath) {\n\t\tFileSystem fileSystem = Mesh.vertx().fileSystem();\n\t\tif (fileSystem.existsBlocking(targetPath)) {\n\t\t\t// Deleting of existing binary file\n\t\t\tfileSystem.deleteBlocking(targetPath);\n\t\t}\n\t\t// log.error(\"Error while attempting to delete target file {\" + targetPath + \"}\", error);\n\t\t// log.error(\"Unable to check existence of file at location {\" + targetPath + \"}\");\n\n\t}", "public static void moveFile(File toMove, File target) throws IOException {\n\n\t\tif (toMove.renameTo(target))\n\t\t\treturn;\n\n\t\tif (toMove.isDirectory()) {\n\t\t\ttarget.mkdirs();\n\t\t\tcopyRecursively(toMove, target);\n\t\t\tdeleteRecursively(toMove);\n\t\t} else {\n\t\t\tcopyFile(toMove, target);\n\t\t\tdeleteFile(toMove);\n\t\t}\n\t}", "private File moveTempFile(final CommonsMultipartFile fileData, final String originalFileName) throws IOException {\n String deployFileName = buildDeployFileName(originalFileName);\n logger.info(\"Moving to {}\", deployFileName);\n final File tempFile = new File(deployFileName);\n fileData.transferTo(tempFile);\n return tempFile;\n }", "final public VFile moveTo(VFile targetFile) throws VlException\n {\n return (VFile)this.getTransferManager().doCopyMove(this,targetFile,true); \n }", "public static void moveFile(File source, File destination) throws Exception {\n\tif (destination.exists()) {\n\t destination.delete();\n\t}\n\tsource.renameTo(destination);\n }", "public void moveDirectory(String source, String target) throws IOException{\n Path sourceFilePath = Paths.get(PWD.getPath()+\"/\"+source);\n Path targetFilePath = Paths.get(PWD.getPath()+\"/\"+target);\n //using builtin move function which uses Paths\n Files.move(sourceFilePath,targetFilePath);\n }", "void moveFile(String pathToFile, String pathDirectory);", "public boolean moveFile(final Uri source, final Uri target) throws IOException\n\t{\n\t\tif (FileUtil.isFileScheme(target) && FileUtil.isFileScheme(target))\n\t\t{\n\t\t\tFile from = new File(source.getPath());\n\t\t\tFile to = new File(target.getPath());\n\t\t\treturn moveFile(from, to);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tboolean success = copyFile(source, target);\n\t\t\tif (success) {\n\t\t\t\tsuccess = deleteFile(source);\n\t\t\t}\n\t\t\treturn success;\n\t\t}\n\t}", "public void moveFile(String url) throws IOException {\n\n\t\tSystem.out.println(\"folder_temp : \" + folder_temp);\n\t\tPath Source = Paths.get(folder_temp + url);\n\t\tPath Destination = Paths.get(folder_photo + url);\n\t\tSystem.out.println(\"folder_photo : \" + folder_photo);\n\n\t\tif (Files.exists(Source)) {\n\t\t\t// Files.move(Source, Destination,\n\t\t\t// StandardCopyOption.REPLACE_EXISTING);\n\t\t\t// cpie du fichiet au lieu de deplaacer car il est enn coiurs\n\t\t\t// d'utilisation\n\t\t\tFiles.copy(Source, Destination, StandardCopyOption.REPLACE_EXISTING);\n\t\t}\n\n\t}", "void move(Path repoRoot, Path source, Path target);", "public boolean moveFile(final File source, final File target) throws WritePermissionException\n\t{\n\t\t// First try the normal rename.\n\t\tif (source.renameTo(target)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tboolean success = copyFile(source, target);\n\t\tif (success) {\n\t\t\tsuccess = deleteFile(source);\n\t\t}\n\t\treturn success;\n\t}", "static boolean localMove(File source, File target) {\n\t\tif (target.exists())\n\t\t\tif (!target.delete()) {\n\t\t\t\tlogConsole(0, target.getPath() + \" delete failed\", null);\n\t\t\t\treturn false;\n\t\t\t}\n\t\tif (source != null)\n\t\t\tif (!source.renameTo(target)) {\n\t\t\t\tlogConsole(0, target.getPath() + \" rename failed\", null);\n\t\t\t\treturn false;\n\t\t\t}\n\t\treturn true;\n\t}", "public Path upload(final File localFile) throws IOException {\n\n if (!localFile.exists()) {\n throw new FileNotFoundException(localFile.getAbsolutePath());\n }\n\n final Path source = new Path(localFile.getAbsolutePath());\n final Path destination = new Path(this.path, localFile.getName());\n\n try {\n this.fileSystem.copyFromLocalFile(source, destination);\n } catch (final IOException ex) {\n LOG.log(Level.SEVERE, \"Unable to upload \" + source + \" to \" + destination, ex);\n throw ex;\n }\n\n LOG.log(Level.FINE, \"Uploaded {0} to {1}\", new Object[] {source, destination});\n\n return destination;\n }", "void uploadingFile(String path);", "public void move(String targetNodeId, String targetPath);", "@Override\n public boolean transferFile (MultipartFile file, String tag, String resultFilename) {\n try {\n file.transferTo(new File(Constans.UPLOADPATH + \"/\" + tag + \"/\" + resultFilename));\n }catch (IOException e){\n e.printStackTrace();\n return false;\n }\n return true;\n }", "private void moveFilesToDiffDirectory(Path sourcePath, Path destinationPath) {\n try {\n Files.move(sourcePath, destinationPath,\n StandardCopyOption.REPLACE_EXISTING);\n } catch (IOException e) {\n //moving file failed.\n e.printStackTrace();\n }\n }", "private void moveFile(File mp3, String finishDir, String artist, String album){\n\t\tString destinationFolder = finishDir + \"\\\\\" + \"Sorted Music\\\\\" + \n\t\t\t\tartist.substring(0, 1).toUpperCase() + \"\\\\\" + artist;\n\t\tnew File(destinationFolder).mkdir();\n\t\tdestinationFolder += \"\\\\\" + album;\n\t\tnew File(destinationFolder).mkdir();\n\t\t\n\t\tmp3.renameTo(new File(destinationFolder + \"\\\\\" + mp3.getName()));\n\t}", "FileMoveVisitor(Path source, Path target) throws FileMoveException {\n\t\t\n\t\tif (source == null || target == null) {\n\t\t\tthrow new FileMoveException(\"Sourch path and target path cannot be empty\");\n\t\t}\n\t\t\n\t\tthis.source = source;\n\t\tthis.target = target;\n\t}", "private void moveToFinal(String imageName, String sourceDirectory,\n\t\t\t\tString destinationDirectory) {\n\t\t\t// TODO Auto-generated method stub\n\t\t\ttry {\n\n\t\t\t\tFile afile = new File(sourceDirectory + imageName);\n\t\t\t\tFile bfile = new File(destinationDirectory + imageName);\n\t\t\t\tif (afile.renameTo(bfile)) {\n\t\t\t\t\tSystem.out.println(\"File is moved successful!\");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"File is failed to move!\");\n\t\t\t\t}\n\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t}", "void moveFile(String sourceName, String destinationName, boolean overwrite) throws IOException;", "public void moveTo(Folder targetFolder) {\n if (targetFolder != this.parent) {\n Path sourcePath = this.toPath();\n this.parent.getValue().remove(this);\n String newName = this.newName(targetFolder);\n\n Path targetPath = new File(targetFolder.getPath() + File.separator + newName).toPath();\n\n try {\n Files.move(sourcePath, targetPath);\n } catch (IOException e) {\n }\n\n this.name = newName;\n targetFolder.addImage(this);\n }\n }", "public void moveBinaryFile(InternalActionContext ac, String uuid, String segmentedPath) {\n\t\tMeshUploadOptions uploadOptions = Mesh.mesh().getOptions().getUploadOptions();\n\t\tFile uploadFolder = new File(uploadOptions.getDirectory(), segmentedPath);\n\t\tFile targetFile = new File(uploadFolder, uuid + \".bin\");\n\t\tString targetPath = targetFile.getAbsolutePath();\n\n\t\tcheckUploadFolderExists(uploadFolder);\n\t\tdeletePotentialUpload(targetPath);\n\t\tmoveUploadIntoPlace(ac.get(\"sourceFile\"), targetPath);\n\t\t// Since this function can be called multiple times (if a transaction fails), we have to\n\t\t// update the path so that moving the file works again.\n\t\tac.put(\"sourceFile\", targetPath);\n\t}", "@Override\n\tpublic void moveObject(String sourceBucketName, String sourceObjectPath, String destinationBucketName,\n\t\t\tString destinationObjectPath) {\n\t\t\n\t}", "public boolean moveFileFTP(ApacheCommonsFtpWrapper ftpWrap, String ftpOutPath, String localInPath, String ftpOutFileName, String localInFilename){\r\n\t\tboolean success = true; \r\n\t\tdebugPrintLocalln(\"moveFileFTP()\");\r\n\t\t\r\n\t\ttry {\r\n\t ftpWrap.setFileType(FTP.BINARY_FILE_TYPE);\r\n\t log.info(\"writing file \" + localInPath + \"/\" + localInFilename + \" to ftp as: \" + ftpOutPath + \"/\" + ftpOutFileName);\r\n\t success = ftpWrap.uploadFile(localInPath, localInFilename, ftpOutPath, ftpOutFileName);\r\n\r\n\t if(success){\r\n\t \tdebugPrintLocalln(\"...Done\");\r\n\t }else{\r\n\t \tdebugPrintLocalln(\"...failed!\");\t \t\r\n\t }\r\n\t } catch (Exception ex) {\r\n\t \tdebugPrintLocalln(\"Failed to write file: \" + ftpOutFileName + \" inputPath: \" + ftpOutPath);\r\n\t \tex.printStackTrace();\r\n\t \tsuccess = false;\r\n\t }\r\n\t debugPrintLocalln(\"File move completed.\");\r\n\t\treturn success;\r\n\t}", "void uploadFinished(StreamingEndEvent event, File uploadedTemporaryFile);", "private void moveShapeDone() {\n System.out.println(\"moving file to \" + BUFFER_DONE_PATH\n + currentFileName);\n File file = new File(BUFFER_ACC_PATH + currentFileName);\n File newFile = new File(BUFFER_DONE_PATH + currentFileName);\n file.renameTo(newFile);\n }", "Path fileToUpload();", "protected void uploadFrom(VFSTransfer transferInfo, VFile localSource) throws VlException \n {\n // copy contents into this file. \n vrsContext.getTransferManager().doStreamCopy(transferInfo, localSource,this); \n }", "@PostMapping(\"/upload\")\n public String handleFileUpload(@RequestParam MultipartFile file) throws IOException {\n final Path uploadDestination = Paths.get(\"C:\\\\uploads\").resolve(file.getName());\n\n file.transferTo(uploadDestination);\n return \"redirect:/\";\n }", "final public VFile moveTo(VDir parentDir) throws VlException\n {\n return (VFile)this.getTransferManager().doCopyMove(this,parentDir,null,true); \n //return (VFile)doCopyMoveTo(parentDir, null,true);\n }", "void fileUploaded(String path);", "public static boolean moveFile(Queue<String> queue) {\n boolean fileMoved = true;\n String importFilePath = queue.poll();\n Path fileToMovePath;\n Path targetPath;\n assert importFilePath != null;\n fileToMovePath = Paths.get(importFilePath);\n String timeStamp = new SimpleDateFormat(WatchDogConfiguration.watchdogTimestampFormat).format(new Date());\n targetPath = Paths.get(WatchDogConfiguration.watchdogDirectoryProcessed + timeStamp + fileToMovePath.getFileName());\n try {\n File f = new File(String.valueOf(fileToMovePath));\n while (!f.canWrite()) { // file is locked, let's wait until is is completely written\n try {\n Thread.sleep(500);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n logger.info(\"File can be moved: \" + f.canWrite()); // -> true\n Files.move(fileToMovePath, targetPath);\n logger.info(\"Moved processed file to \" + targetPath.getFileName());\n } catch (FileAlreadyExistsException e) {\n //destination file already exists. something really bad happens, as we included timestamp. try\n // nevertheless again\n logger.info(\"File already processed: \" + targetPath.getFileName());\n try {\n Files.delete(targetPath);\n Files.copy(fileToMovePath, targetPath, StandardCopyOption.REPLACE_EXISTING);\n logger.warning(\"File nevertheless moved: \" + targetPath.getFileName());\n } catch (IOException ioException) {\n logger.severe(\"IO Exception trying to write file: \" + targetPath.getFileName());\n ioException.printStackTrace();\n fileMoved = false;\n }\n\n } catch (IOException e) {\n //something else went wrong\n e.printStackTrace();\n fileMoved = false;\n }\n return fileMoved;\n }", "private void copyOrMoveFile(File file, File dir,boolean isCopy) throws IOException {\n File newFile = new File(dir, file.getName());\n FileChannel outChannel = null;\n FileChannel inputChannel = null;\n try {\n outChannel = new FileOutputStream(newFile).getChannel();\n inputChannel = new FileInputStream(file).getChannel();\n inputChannel.transferTo(0, inputChannel.size(), outChannel);\n inputChannel.close();\n if(!isCopy)\n file.delete();\n } finally {\n if (inputChannel != null) inputChannel.close();\n if (outChannel != null) outChannel.close();\n }\n }", "public void transferTo(File dest) throws IOException, IllegalStateException {\r\n mFile.transferTo(dest);\r\n }", "@Test\n\tpublic void cleanupTargetDirectory() throws IOException {\n\t\tfinal Path targetDir = _temp.toPath().resolve(\"target\");\n\t\tfinal Path installerTar = new File(getClass().getResource(TEST_INSTALLER_TAR_GZ).getFile()).toPath();\n\t\tFileUtil.mkDirs(targetDir);\n\t\tArchiveUtil.decompressTarGz(installerTar, targetDir);\n\n\t\t// test\n\t\tassertTrue(targetDir.toFile().list().length > 0, \"target dir should exist with children\");\n\t\tServerInstaller.cleanupTargetDirectory(targetDir);\n\n\t\t// verify\n\t\tassertFalse(targetDir.toFile().exists(), \"target dir should not exist\");\n\t}", "public void fileRename(String sourcePath, String targetPath) {\n\t \tFile file = new File(sourcePath); \n\t \tfile.renameTo(new File(targetPath));\n\t \t}", "final public VFile moveTo(VDir parentDir,String newName) throws VlException\n {\n return (VFile)this.getTransferManager().doCopyMove(this,parentDir,newName,true); \n //return (VFile)doCopyMoveTo(parentDir, newName,true);\n }", "public static void archiveProcessedFiles(Session session, String sourceDir,\r\n\t\t\tString targetDir, String fileName) throws Exception {\r\n\t\tChannelSftp sftpChannel = null;\r\n\t\ttry {\r\n\t\t\tChannel channel = session.openChannel(\"sftp\");\r\n\t\t\tchannel.connect();\r\n\t\t\tsftpChannel = (ChannelSftp) channel;\r\n\t\t\tsftpChannel.cd(targetDir);\r\n\r\n\t\t\tDateFormat df = new SimpleDateFormat(\"MM.dd.yyyy_HHmmss\");\r\n\t\t\tDate today = Calendar.getInstance().getTime();\r\n\t\t\tString archiveDate = df.format(today);\r\n\r\n\t\t\tsftpChannel.mkdir(targetDir + archiveDate);\r\n\t\t\tsftpChannel.rename(sourceDir + fileName, targetDir + archiveDate\r\n\t\t\t\t\t+ \"/\" + fileName);\r\n\t\t\tlogger.info(\"File -> \\\"\" + fileName\r\n\t\t\t\t\t+ \"\\\": archived successfully to \" + targetDir + archiveDate);\r\n\t\t} catch (Exception e) {\r\n\t\t\te.getMessage();\r\n\t\t\tthrow e;\r\n\t\t} finally {\r\n\t\t\tif (sftpChannel != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tsftpChannel.exit();\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\te.getMessage();\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tif (session != null) {\r\n\t\t\t\tsession.disconnect();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private RestNodeModel moveNode(ContentModel node, FolderModel targetFolder)\n {\n RestNodeBodyMoveCopyModel moveBody = new RestNodeBodyMoveCopyModel();\n moveBody.setTargetParentId(targetFolder.getNodeRef());\n return restClient.authenticateUser(testUser).withCoreAPI().usingNode(node).move(moveBody);\n }", "void moveFileToDirectoryNotValidFiles(String pathToFile);", "@Override\r\n\tpublic boolean moveFile(String srcfilePath, String destfilePath) throws FileSystemUtilException {\r\n\t\tlogger.debug(\"Begin: \" + getClass().getName() + \":moveFile()\");\r\n\t\ttry {\r\n\t\t\tconnect(); \r\n\t\t\tString command = \"mv \" + srcfilePath + \" \" + destfilePath;\r\n\t\t\tint results = executeSimpleCommand(command);\r\n\t\t\tdisconnect();\r\n\t\t\tlogger.debug(\"End: \" + getClass().getName() + \":moveFile()\");\r\n\t\t\tif (results == 0) {\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t} catch (FileSystemUtilException e) {\r\n\t\t\tdisconnect();\r\n\t\t\tthrow e;\r\n\t\t}\r\n\r\n\t}", "public uploadFileForPath_result(uploadFileForPath_result other) {\n __isset_bitfield = other.__isset_bitfield;\n this.success = other.success;\n }", "@Test\r\n public void moveToFileWithSameName() {\r\n currentDirectory.addNewFile(\"file\");\r\n Dir dirWithFile = currentDirectory.getSubDirectoryByName(\"child\");\r\n File fileWithContents = dirWithFile.getFileByName(\"file\");\r\n fileWithContents.setContent(\"content\");\r\n command.executeCommand(\"file\", \"child/file\", root, currentDirectory);\r\n File fileInRoot = currentDirectory.getFileByName(\"file\");\r\n // content in file in root is removed\r\n assertTrue(fileInRoot.getContents().equals(\"\"));\r\n }", "@Override\n\tpublic void transferTo(File dest) throws IOException, IllegalStateException {\n\n\t}", "@Override\r\n\tpublic void move(String srcAbsPath, String destAbsPath)\r\n\t\t\tthrows ItemExistsException, PathNotFoundException,\r\n\t\t\tVersionException, ConstraintViolationException, LockException,\r\n\t\t\tRepositoryException {\n\t\t\r\n\t}", "final public VFile copyTo(VFile targetFile) throws VlException\n {\n //return (VFile)doCopyMoveTo(parentDir,null,false /*,options*/);\n return (VFile)this.getTransferManager().doCopyMove(this,targetFile,false); \n }", "@Test\n public void testMoveFolder() {\n System.out.println(\"moveFolder\");\n String folderToMove = \"\";\n String destinationFolder = \"\";\n FileSystemStorage instance = null;\n instance.moveFolder(folderToMove, destinationFolder);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "public OutputResponse mv(String oldPath, String newPath){\n String command = String.format(\"mv -b %s %s\", oldPath, newPath); // By default, backup\n return jobTarget.runCommand( command );\n }", "void uploadingFolder(String remoteFolder);", "private void copyOrMove(Action action, Path dir) throws IOException {\n\n try {\n if (action == Action.COPY) {\n Path newdir = target.resolve(source.relativize(dir));\n Files.copy(dir, newdir, copyMoveOptions);\n } else if (action == Action.MOVE) {\n Path newdir = target.resolve(source.relativize(dir));\n Files.move(dir, newdir, copyMoveOptions);\n }\n } catch (AtomicMoveNotSupportedException e) {\n // Remove the atomic move from the list and try again\n List<CopyOption> optionsTemp = Arrays.asList(copyMoveOptions);\n optionsTemp.remove(StandardCopyOption.ATOMIC_MOVE);\n copyMoveOptions = optionsTemp.toArray(new CopyOption[optionsTemp.size()]);\n\n copyOrMove(action, dir);\n }\n\n }", "private void copyHadoopTmpDir() {\n final String tmpDirProperty =\n PluginMiniHBaseClusterSingleton.INSTANCE.getClusterConfiguration().get(\"hadoop.tmp.dir\");\n final File hadoopTmp = new File(tmpDirProperty);\n final File hadoopTmpCopy = new File(new File(_projectBuildDir), \"hadoop-tmp\");\n getLog().info(\"Copying \" + hadoopTmp.toString() + \" to \" + hadoopTmpCopy.toString());\n try {\n FileUtils.copyDirectory(hadoopTmp, hadoopTmpCopy);\n getLog().info(\"Successfully copied hadoop tmp dir.\");\n }\n catch (final IOException e) {\n getLog().warn(\"The Hadoop tmp dir could not be copied to the project's build directory.\", e);\n }\n }", "public void objServiceMove(String sourceObjectPathString,\r\n\t\t\tString targetLocPathString, String sourceLocPathString)\r\n\t\t\t\t\tthrows ServiceException {\n\t\tObjectPath objPath = new ObjectPath(sourceObjectPathString);\r\n\t\tObjectIdentity<ObjectPath> docToCopy = new ObjectIdentity<ObjectPath>();\r\n\t\tdocToCopy.setValue(objPath);\r\n\t\tdocToCopy.setRepositoryName(REPOSITORY_NAME);\r\n\r\n\t\t// identify the folder to move from\r\n\t\tObjectPath fromFolderPath = new ObjectPath();\r\n\t\tfromFolderPath.setPath(sourceLocPathString);\r\n\t\tObjectIdentity<ObjectPath> fromFolderIdentity = new ObjectIdentity<ObjectPath>();\r\n\t\tfromFolderIdentity.setValue(fromFolderPath);\r\n\t\tfromFolderIdentity.setRepositoryName(REPOSITORY_NAME);\r\n\t\tObjectLocation fromLocation = new ObjectLocation();\r\n\t\tfromLocation.setObjectIdentity(fromFolderIdentity);\r\n\r\n\t\t// identify the folder to move to\r\n\t\tObjectPath folderPath = new ObjectPath();\r\n\t\tfolderPath.setPath(targetLocPathString);\r\n\t\tObjectIdentity<ObjectPath> toFolderIdentity = new ObjectIdentity<ObjectPath>();\r\n\t\ttoFolderIdentity.setValue(folderPath);\r\n\t\ttoFolderIdentity.setRepositoryName(REPOSITORY_NAME);\r\n\t\tObjectLocation toLocation = new ObjectLocation();\r\n\t\ttoLocation.setObjectIdentity(toFolderIdentity);\r\n\r\n\t\tOperationOptions operationOptions = null;\r\n\t\tthis.objectService.move(new ObjectIdentitySet(docToCopy),\r\n\t\t\t\tfromLocation, toLocation, new DataPackage(), operationOptions);\r\n\r\n\t}", "private void copyFile( final File source, final File target )\n throws MojoExecutionException\n {\n if ( source.exists() == false )\n {\n throw new MojoExecutionException( \"Source file '\" + source.getAbsolutePath() + \"' does not exist!\" );\n }\n if ( target.exists() == true )\n {\n throw new MojoExecutionException( \"Target file '\" + source.getAbsolutePath() + \"' already existing!\" );\n }\n\n try\n {\n this.logger.debug( \"Copying file from '\" + source.getAbsolutePath() + \"' to \" + \"'\"\n + target.getAbsolutePath() + \"'.\" );\n PtFileUtil.copyFile( source, target );\n }\n catch ( PtException e )\n {\n throw new MojoExecutionException( \"Could not copy file from '\" + source.getAbsolutePath() + \"' to \" + \"'\"\n + target.getAbsolutePath() + \"'!\", e );\n }\n }", "void copyFile(File sourcefile, File targetfile) throws Exception {\n\t\tif(targetfile.exists()) targetfile.delete();\n\t\ttargetfile.createNewFile();\n\t\tFileChannel source = null;\n\t\tFileChannel target = null;\n\t\ttry{\n\t\t\tsource = new FileInputStream(sourcefile).getChannel();\n\t\t\ttarget = new FileOutputStream(targetfile).getChannel();\n\t\t\ttarget.transferFrom(source, 0, source.size());\n\t\t}\n\t\tfinally{\n\t\t\tif(source!=null) source.close();\n\t\t\tif(target!=null) target.close();\n\t\t}\n\t\ttargetfile.setLastModified(sourcefile.lastModified());\n\t}", "void moveFileToDirectoryWithConvertedFiles(String pathToFile);", "public boolean moveToFinalLocation() {\n\n if (tempFile==null)\n return false;\n\n if (RecDir==null || RecSubdir==null) {\n Log.getInstance().write(Log.LOGLEVEL_ERROR, \"RecordingEpisode.moveToFinalLocation: null Dir or SubDir = \" + RecDir + \":\" + RecSubdir);\n\n if (!tempFile.delete()) {\n Log.getInstance().write(Log.LOGLEVEL_WARN, \"RecordingEpisode.moveToFinalLocation: Failed to delete tempFile.\");\n }\n\n return false;\n }\n\n File DestPath = new File(RecDir + File.separator + RecSubdir);\n\n if (DestPath==null) {\n Log.getInstance().write(Log.LOGLEVEL_ERROR, \"RecordingEpisode.moveToFinalLocation: null DestPath = \" + RecDir + \":\" + RecSubdir);\n\n if (!tempFile.delete()) {\n Log.getInstance().write(Log.LOGLEVEL_WARN, \"RecordingEpisode.moveToFinalLocation: Failed to delete tempFile.\");\n }\n\n return false;\n }\n\n if (!DestPath.isDirectory()) {\n if (!DestPath.mkdir()) {\n Log.getInstance().write(Log.LOGLEVEL_ERROR, \"RecordingEpisode.moveToFinalLocation: Could not create directory \" + DestPath);\n\n if (!tempFile.delete()) {\n Log.getInstance().write(Log.LOGLEVEL_ERROR, \"RecordingEpisode.moveToFinalLocation: Failed to delete tempFile.\");\n }\n return false;\n }\n }\n\n NewFile = this.getUniqueFile();\n\n if (NewFile==null) {\n Log.getInstance().write(Log.LOGLEVEL_ERROR, \"RecordingEpisode.moveToFinalLocation: Could not create unique file.\");\n\n if (!tempFile.delete()) {\n Log.getInstance().write(Log.LOGLEVEL_WARN, \"RecordingEpisode.moveToFinalLocation: Failed to delete tempFile.\");\n }\n\n return false;\n }\n\n Log.getInstance().write(Log.LOGLEVEL_TRACE, \"RecordingEpisode.moveToFinalLocation: Moving = \" + tempFile.getAbsolutePath() + \"->\" + NewFile.getAbsolutePath());\n\n if (!tempFile.renameTo(NewFile)) {\n Log.getInstance().write(Log.LOGLEVEL_ERROR, \"RecordingEpisode.moveToFinalLocation: Moving failed.\");\n }\n\n if (!tempFile.delete()) {\n Log.getInstance().write(Log.LOGLEVEL_WARN, \"RecordingEpisode.moveToFinalLocation: Failed to delete tempFile.\");\n }\n\n return true;\n }", "public String moveFileUp() {\r\n\t\tlog.debug(\"Item file Id::\"+itemObjectId);\r\n\t\t\r\n\t\tIrUser user = userService.getUser(userId, false);\r\n\t\tif( !item.getOwner().equals(user) && !user.hasRole(IrRole.ADMIN_ROLE) && \r\n\t\t\t\t!institutionalCollectionPermissionHelper.isInstitutionalCollectionAdmin(user, genericItemId))\r\n\t\t{\r\n\t\t return \"accessDenied\";\r\n\t\t}\r\n\t\t\r\n\t\tItemObject moveUpItemObject = item.getItemObject(itemObjectId, itemObjectType);\r\n\t\titem.moveItemObject(moveUpItemObject, moveUpItemObject.getOrder() - 1);\r\n\t\t\r\n\t\t// Save the item\r\n\t\titemService.makePersistent(item);\r\n\r\n\t\treturn SUCCESS;\r\n\t\t\r\n\t}", "@Override\r\n\tpublic boolean uploadFiles(InputStream is, String targetLocation, String fileName) throws FileSystemUtilException {\r\n\t\tthrow new FileSystemUtilException(\"000000\", null, Level.ERROR, null);\r\n\r\n\t}", "public final void deleteTemporaryFile()\n\t\tthrows IOException {\n\t\t\t\n // DEBUG\n \n if ( isQueued()) {\n Debug.println(\"@@ Delete queued file segment, \" + this);\n Thread.dumpStack();\n }\n \n\t\t//\tDelete the temporary file used by the file segment\n\n\t\tFile tempFile = new File(getTemporaryFile());\n\t\t\t\t\n\t\tif ( tempFile.exists() && tempFile.delete() == false) {\n\n\t\t //\tDEBUG\n\t\t \n\t\t Debug.println(\"** Failed to delete \" + toString() + \" **\");\n\t\t \n\t\t //\tThrow an exception, delete failed\n\t\t \n\t\t\tthrow new IOException(\"Failed to delete file \" + getTemporaryFile());\n\t\t}\n\t}", "public static void moveLocalFiles(String sourcePath, String destinationPath) throws Exception {\n\t //Get all csv files from open ar based on filenamefilter\n\t File source = new File(sourcePath);\n\t File destination = new File(destinationPath);\n\t File[] files = source.listFiles(new FilenameFilter(\"csv\"));\n\t if (null != files && files.length > 0) {\n\t\tfor (File file : files) {\n\t\t moveFile(file, new File(destination, file.getName()));\n\t\t}\n\t } else {\n\t }\n }", "private void transferFile(final UploadItem uploadItem) throws IOException {\n\n CommonsMultipartFile fileData = uploadItem.getFileData();\n List<String> muleDeployUrls = getMuleDeployUrls();\n String originalFileName = fileData.getFileItem().getName();\n for (String muleDeployUrl : muleDeployUrls) {\n final File tempFile = moveTempFile(fileData, originalFileName);\n sendToMule(tempFile, muleDeployUrl);\n tempFile.delete();\n }\n }", "public static void uploadFile(HttpServletRequest request, MultipartFile file, String code) {\n\t\tREAL_PATH = request.getSession().getServletContext().getRealPath(\"/assets/images/\");\n\t\t\n\t\tlogger.info(REAL_PATH);\n\t\t\n\t\tif (!new File(REAL_PATH).exists()) {\n\t\t\tnew File(REAL_PATH).mkdirs();\n\t\t}\n\t\tif (!new File(ABSOLUTE_PATH).exists()) {\n\t\t\tnew File(ABSOLUTE_PATH).mkdirs();\n\t\t}\n\t\t\n\t\ttry {\n\t\t\t// uploading ... project directory upload\n\t\t\tfile.transferTo(new File(ABSOLUTE_PATH + code + \".jpg\"));\n\t\t\t\n\t\t\t// uploading ... for the server\n\t\t\tfile.transferTo(new File(REAL_PATH + code + \".jpg\"));\n\t\t} catch (IOException e) {\n\t\t\t\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void uploadTemp(FileUploadEvent event) {\n setFileImage(event.getFile());\n getSelected().setUrlImage(event.getFile().getFileName());\n RequestContext.getCurrentInstance().update(\"image\");\n\n }", "void relocateLogFile(Path destinationPath) throws IOException;", "public uploadFileForPath_args(uploadFileForPath_args other) {\n if (other.isSetAccessToken()) {\n this.accessToken = other.accessToken;\n }\n if (other.isSetPath()) {\n this.path = other.path;\n }\n if (other.isSetFileName()) {\n this.fileName = other.fileName;\n }\n if (other.isSetBuffer()) {\n this.buffer = org.apache.thrift.TBaseHelper.copyBinary(other.buffer);\n }\n }", "public void upload() {\r\n if (file != null) {\r\n try {\r\n String filepath = super.getUploadFolder() + \"/\" + file.getFileName();\r\n filepath = FileUtil.alternativeFilepathIfExists(filepath);\r\n FileUtil.createFile(filepath);\r\n\r\n file.write(filepath);\r\n super.info(\"Succesful\", file.getFileName() + \" is uploaded.\");\r\n\r\n Upload upload = new Upload();\r\n upload.setDescription(description);\r\n upload.setFilepath(filepath);\r\n upload.setTag(Md5Util.getMd5Sum(filepath));\r\n this.description = null;\r\n uploads.add(upload);\r\n // update ui and ready for save in db\r\n } catch (Exception e) {\r\n System.out.println(e);\r\n }\r\n }\r\n }", "private void moveShapeDenied() {\n System.out.println(\"moving file to \" + BUFFER_DENIED_PATH\n + currentFileName);\n File file = new File(BUFFER_ACC_PATH + currentFileName);\n File newFile = new File(BUFFER_DENIED_PATH + currentFileName);\n file.renameTo(newFile);\n }", "public static void clean(Task task, String localTemp) {\n\t\tif (state.getErrCode() == null) S3IO.uploadDir(task.getOutputPath(), localTemp);\n\t\ttry {\n\t\t\tFileUtils.deleteDirectory(new File(localTemp));\n\t\t\tFileUtils.deleteDirectory(task.getTaskType() == TaskType.MAP_TASK\n\t\t\t ? new File(MAP_INPUT_DIR + task.getTaskId()) : new File(REDUCE_INPUT_DIR + task.getTaskId()));\n\t\t} catch (IOException e) {\n\t\t\tlogger.error(\"Exception occoured while deleting input files and local temporary directory \\n\"\n\t\t\t + e.getLocalizedMessage());\n\t\t\tstate.setErrCode(state.getTsk() == TaskType.MAP_TASK ? ERR_CODE.EXCEPTION_DELETING_TEMP_DIR_MAP\n\t\t\t : ERR_CODE.EXCEPTION_DELETING_TEMP_DIR_REDUCE);\n\t\t}\n\n\t}", "public void renameFile(File from, File to) {\n if (!from.renameTo(to)) {\n Log.e(ConstantVariables.ERR, ConstantVariables.RENAME_FAILED);\n }\n }", "void folderUploaded(String remoteFolder);", "protected void upload(final AbstractBackupPath bp) throws Exception\n {\n new RetryableCallable<Void>()\n {\n @Override\n public Void retriableCall() throws Exception\n {\n fs.upload(bp, bp.localReader());\n return null;\n }\n }.call();\n }", "public void move(Directory directory) throws IOException {\n Path oldPath = Paths.get(photo.getUrl());\n Path newPath =\n Paths.get(directory.getPath() + File.separator + photo.getTagName() + photo.getExtension());\n if (oldPath != newPath) {\n Files.move(oldPath, newPath, ATOMIC_MOVE);\n photo.setUrl(newPath.toString());\n directory.add(photo);\n }\n }", "public String uploadFile(UploadedFile file) {\n String fileName = (file.getFileName());\r\n System.out.println(\"***** fileName: \" + file.getFileName());\r\n \r\n System.out.println(System.getProperty(\"os.name\"));\r\n String basePath = \"C:\" + File.separator + \"aquivosCI\" + File.separator;\r\n System.out.println(\"BasePath: \" + basePath);\r\n File outputFilePath = new File(basePath + fileName);\r\n\r\n// Copy uploaded file to destination path\r\n InputStream inputStream = null;\r\n OutputStream outputStream = null;\r\n try {\r\n inputStream = file.getInputstream();\r\n outputStream = new FileOutputStream(outputFilePath);\r\n\r\n int read = 0;\r\n final byte[] bytes = new byte[1024];\r\n while ((read = inputStream.read(bytes)) != -1) {\r\n outputStream.write(bytes, 0, read);\r\n }\r\n\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n\r\n } finally {\r\n if (outputStream != null) {\r\n try {\r\n outputStream.close();\r\n } catch (IOException ex) {\r\n Logger.getLogger(ComunicacaoInternaMB.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }\r\n if (inputStream != null) {\r\n try {\r\n inputStream.close();\r\n } catch (IOException ex) {\r\n Logger.getLogger(ComunicacaoInternaMB.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }\r\n }\r\n return outputFilePath.getAbsolutePath(); // return to same page\r\n }", "public void submit() {\n fileUploadContainer.upload.submit();\n }", "private void doFileUpload(String contextname, MultipartFile uploadedFile) throws IOException {\n SystemContext systemContext = getSystemContextByName(contextname);\n\n if (systemContext != null) { //todo not sure why this if statement is useful here?\n\n if (thereIsANewFileToUpload(uploadedFile)) {\n //todo this is one of those times we probably need to do transactions.\n uploadFileToDatabase(uploadedFile, systemContext);\n\n } else //we need to copy the blob from the previous version, which is always 1\n {\n copyPreviousVersionOfFileToNewRecord(systemContext);\n }\n }\n }", "public static void main(String[] args){\nFile from = new File(\"d:/prac/shubha.txt\");\r\n//rename and change the file and folder\r\nFile to = new File(\"d:/prac/Sub1/shubha.txt\");\r\n//Rename\r\nif (from.renameTo(to))\r\nSystem.out.println(\"Successfully Moved the file\");\r\nelse\r\nSystem.out.println(\"Error while moving the file\");\r\n}", "@Override\n\tprotected RemoteOperationResult run(OwnCloudClient client) {\n\n \t/// check parameters\n if (!FileUtils.isValidPath(mTargetRemotePath)) {\n \treturn new RemoteOperationResult(ResultCode.INVALID_CHARACTER_IN_NAME);\n }\n\n if (mTargetRemotePath.equals(mSrcRemotePath)) {\n \t// nothing to do!\n return new RemoteOperationResult(ResultCode.OK);\n }\n\n if (mTargetRemotePath.startsWith(mSrcRemotePath)) {\n \treturn new RemoteOperationResult(ResultCode.INVALID_MOVE_INTO_DESCENDANT);\n }\n\n\n /// perform remote operation\n\t\t//LocalMoveMethod move = null;\n\t\tMoveMethod move = null;\n\t\tRemoteOperationResult result = null;\n try {\n move = new MoveMethod(\n \t\tclient.getWebdavUri() + WebdavUtils.encodePath(mSrcRemotePath),\n \t\tclient.getWebdavUri() + WebdavUtils.encodePath(mTargetRemotePath),\n \t\tmOverwrite\n \t\t);\n int status = client.executeMethod(move, MOVE_READ_TIMEOUT, MOVE_CONNECTION_TIMEOUT);\n\n /// process response\n \tif (status == HttpStatus.SC_MULTI_STATUS) {\n \t\tresult = processPartialError(move);\n\n \t} else if (status == HttpStatus.SC_PRECONDITION_FAILED && !mOverwrite) {\n\n \t\tresult = new RemoteOperationResult(ResultCode.INVALID_OVERWRITE);\n \t\tclient.exhaustResponse(move.getResponseBodyAsStream());\n\n\n \t\t/// for other errors that could be explicitly handled, check first:\n \t\t/// http://www.webdav.org/specs/rfc4918.html#rfc.section.9.9.4\n\n \t} else {\n\n\t result = new RemoteOperationResult(\n\t \t\tisSuccess(status), \t// move.succeeded()? trustful?\n\t \t\tstatus,\n\t \t\tmove.getResponseHeaders()\n \t\t);\n \t\tclient.exhaustResponse(move.getResponseBodyAsStream());\n }\n\n Log.i(TAG, \"Move \" + mSrcRemotePath + \" to \" + mTargetRemotePath + \": \" +\n \t\tresult.getLogMessage());\n\n } catch (Exception e) {\n result = new RemoteOperationResult(e);\n Log.e(TAG, \"Move \" + mSrcRemotePath + \" to \" + mTargetRemotePath + \": \" +\n \t\tresult.getLogMessage(), e);\n\n } finally {\n if (move != null)\n move.releaseConnection();\n }\n\n return result;\n\t}", "@Override\n public void store(MultipartFile file, String path) {\n String filename = StringUtils.cleanPath(file.getOriginalFilename());\n try {\n if (file.isEmpty()) {\n throw new StorageException(\"Failed to store empty file \" + filename);\n }\n if (filename.contains(\"..\")) {\n // This is a security check\n throw new StorageException(\n \"Cannot store file with relative path outside current directory \"\n + filename);\n }\n\n \t\t// upload file to s3\n \t\tString fileName = path + \"/\" + filename;\n\n \t\tthis.s3client.putObject(new PutObjectRequest(this.s3_storage_properties.getBucketName(), fileName,\n \t\t\t\tfile.getInputStream(), new ObjectMetadata())\n .withCannedAcl(CannedAccessControlList.PublicRead));\n Application.logger.info(\"Stored \"+fileName+\" into S3\");\n }\n catch (IOException e) {\n throw new StorageException(\"Failed to store file \" + filename, e);\n }\n }", "void moveFolder(Long sourceId, Long targetFolderId, List<SolutionParam> solutions);", "private String nextStepToDirectory(File currentDir, File targetDir) {\n String fileName = targetDir.getAbsolutePath();\n // Removes the current directory path from the target's path\n fileName = fileName.replace(currentDir.getAbsolutePath(), \"\");\n if (fileName.startsWith(File.separator)) {\n fileName = fileName.substring(1);\n }\n if (fileName.contains(File.separator)) {\n // Keeps only the first directory's name in the path\n fileName = fileName.substring(0, fileName.indexOf(File.separator));\n }\n return fileName;\n }", "boolean upload(\n InputStream source, String remoteFileName);", "void moveDocument(long documentId, long targetFolderNodeId, List<SolutionParam> solutions);", "private void fileUpload(HttpServletRequest request, HttpServletResponse response) {\n\t \ttry {\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * String appPath = request.getServletContext().getRealPath(\"\");\r\n\t\t\t\t\t * System.out.println(appPath); String savePath = appPath + File.separator +\r\n\t\t\t\t\t * SAVE_DIR; System.out.println(savePath);\r\n\t\t\t\t\t */\r\n\t \t\t\r\n\t \t\t//String appPath = getServletContext().getRealPath(SAVE_DIR);\r\n\t \t\tSystem.out.println(appPath);\r\n\t \t\t String savePath = appPath + \"//\" +SAVE_DIR; \r\n\t \t\t System.out.println(savePath);\r\n\t\t\t\t\t\tCollection<Part>cp= request.getParts();\r\n\t \t String fileName = up.fileUpload(cp,appPath);\r\n\t \t System.out.println(fileName);\r\n\t \t \r\n\t \t request.setAttribute(\"message\", \"The file \"+fileName+\" has been uploaded successfully!\");\r\n\t \t RequestDispatcher dispatcher = request.getRequestDispatcher(\"success.jsp\");\r\n\t \t dispatcher.forward(request, response);\r\n\t}catch(Exception ex) {\r\n System.out.println(ex);\r\n }\r\n\t }", "private static void recoverTempFiles(String logPath)\n {\n\n File logPathFile = new File(logPath).getParentFile();\n File[] tempFiles = logPathFile.listFiles((dir, name) -> name.endsWith(TEMP_FILE_EXTENSION));\n\n if (tempFiles == null) {\n return;\n }\n\n for (File tempFile : tempFiles) {\n String newName = tempFile.getName().substring(0, tempFile.getName().length() - TEMP_FILE_EXTENSION.length());\n File newFile = new File(tempFile.getParent(), newName + LOG_FILE_EXTENSION);\n\n if (!tempFile.renameTo(newFile)) {\n log.warn(\"Could not rename temp file [%s] to [%s]\", tempFile, newFile);\n }\n }\n }", "public static String upload(FileSystem fs, String filePath, String remotePath, String fileName) throws IOException{\n String fileStorePath = remotePath + \"/\" + fileName;\n fs.copyFromLocalFile(new Path(filePath), new Path(fileStorePath));\n return fileStorePath;\n }", "public void upoadFile(MultipartFile file) {\n\t\t\n\t\ttry\n\t\t{\n\t\t\t\n\t\t if(!Files.isDirectory(path))\n\t\t {\n\t\t\t System.out.println(\"Directory Created\"+path);\n\t\t\t Files.createDirectories(path);\n\t\t }\n\t\t String fileName=file.getOriginalFilename();\n\t\t Files.copy(file.getInputStream(), this.path.resolve(fileName));\n\t\t System.out.println(\"File uploade details \");\n\t }catch(Exception e)\n\t\t{\n\t\t\tSystem.out.println(\"File uploade error \"+e.getMessage());\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "public String uploadFile(String localFile, String remoteDir) throws GRIDAClientException {\n\n try {\n Communication communication = getCommunication();\n communication.sendMessage(\n ExecutorConstants.COM_UPLOAD_FILE + Constants.MSG_SEP_1\n + proxyPath + Constants.MSG_SEP_1\n + localFile + Constants.MSG_SEP_1\n + Util.removeLfnFromPath(remoteDir));\n communication.sendEndOfMessage();\n\n String localFilePath = communication.getMessage();\n communication.close();\n\n return localFilePath.toString();\n\n } catch (IOException ex) {\n throw new GRIDAClientException(ex);\n }\n }", "private void uploadFile(final File file) throws IOException {\n if (file != null) {\n Network.sendMsg(new FileMessage(Paths.get(file.getAbsolutePath())));\n }\n }", "@Test\n public void uploadTest() throws ApiException {\n String path = null;\n Integer devid = null;\n File file = null;\n api.upload(path, devid, file);\n\n // TODO: test validations\n }", "@Override\n\tpublic void fileUpload(FileVO fileVO) {\n\t\tworkMapper.fileUpload(fileVO);\n\t}", "@Override\n\tpublic URI move(URI uri, URI toURI) throws StorageSecuirtyException,\n\t\t\tResourceAccessException {\n\t\treturn null;\n\t}", "private static String moveFiles(File origen, Long id, String pref) throws Exception{\n\n String customImgPath = Play.applicationPath.getAbsolutePath()+\"/public/images/custom/\";\n\n String destinationName = origen.getName();\n if(destinationName.lastIndexOf(\".\") != -1 && destinationName.lastIndexOf(\".\") != 0)\n destinationName = \"u\"+id + \"_\"+pref+ Calendar.getInstance().getTimeInMillis() + \".\" +destinationName.substring(destinationName.lastIndexOf(\".\")+1);\n\n File destination = new File(customImgPath, destinationName);\n\n if(destination.exists()){\n destination.delete();\n }\n FileUtils.moveFile(origen, destination);\n\n return destinationName;\n }", "public synchronized void upload(){\n\t}", "@Override\r\n\tpublic boolean uploadFile(String fileName) throws FileSystemUtilException {\r\n\t\tlogger.debug(\"Begin:\" + getClass().getName() + \".upload()\");\r\n\t\tFileInputStream fis = null;\r\n\t\tString tempLocalFilePath = null;\r\n\t\ttry {\r\n\t\t\tconnect(); \r\n\t\t\ttempLocalFilePath = localFilePath;\r\n\t\t\tString command = \"scp -C -p -t \" + remoteFilePath;\r\n\t\t\tObject[] ios = execCommand(command);\r\n\t\t\toutputstream = (OutputStream) ios[0];\r\n\t\t\tinputstream = (InputStream) ios[1];\r\n\t\t\ttempLocalFilePath = tempLocalFilePath + fileName;\r\n\t\t\tif (checkAck(inputstream) != 0) {\r\n\t\t\t\tlogger.info(\"10117 : checking if file exists\");\r\n\t\t\t\tthrow new FileSystemUtilException(\"File \" + tempLocalFilePath + \"already exists in the remoteSystem\");\r\n\t\t\t}\r\n\t\t\tlong filesize = (new File(tempLocalFilePath)).length();\r\n\t\t\tcommand = \"C0644 \" + filesize + \" \";\r\n\t\t\tif (tempLocalFilePath.lastIndexOf('/') > 0) {\r\n\t\t\t\tcommand += tempLocalFilePath.substring(tempLocalFilePath.lastIndexOf('/') + 1);\r\n\t\t\t\tlogger.info(\"uploadfile in scp tempLocalFilePath if:: \"+tempLocalFilePath);\r\n\t\t\t} else {\r\n\t\t\t\tlogger.info(\"uploadfile in scp tempLocalFilePath else:: \"+tempLocalFilePath);\r\n\t\t\t\tcommand += tempLocalFilePath;\r\n\t\t\t}\r\n\t\t\tcommand += \"\\n\";\r\n\t\t\toutputstream.write(command.getBytes());\r\n\t\t\toutputstream.flush();\r\n\t\t\t/*if (checkAck(inputstream) != 0) {\r\n\t\t\t\tlogger.info(\"10118 : writing failed\");\r\n\t\t\t\tthrow new FileSystemUtilException(\"Cannot write into outputstream\");\r\n\t\t\t}*/\r\n\t\t\tfis = new FileInputStream(tempLocalFilePath);\r\n\t\t\tbyte[] buf = new byte[1024];\r\n\t\t\twhile (true) {\r\n\t\t\t\tint len = fis.read(buf, 0, buf.length);\r\n\t\t\t\tif (len <= 0)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\toutputstream.write(buf, 0, len); // out.flush();\r\n\t\t\t}\r\n\t\t\tfis.close();\r\n\t\t\tfis = null;\r\n\t\t\t// send '\\0'\r\n\t\t\tbuf[0] = 0;\r\n\t\t\toutputstream.write(buf, 0, 1);\r\n\t\t\toutputstream.flush();\r\n\t\t\tif (checkAck(inputstream) != 0) {\r\n\t\t\t\tlogger.info(\"10119 : after flushing the stream \");\r\n\t\t\t\tthrow new FileSystemUtilException(\"files flushing failed\");\r\n\t\t\t}\r\n\t\t\t// outputstream.close();\r\n\t\t} catch (Exception e) {\r\n\t\t\tlogger.error(\"uploading of file failed :\",e);\r\n\t\t\tthrow new FileSystemUtilException(\"uploading of file failed :\",e);\r\n\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tif (fis != null)\r\n\t\t\t\t\tfis.close();\r\n\t\t\t} catch (Exception ee) {\r\n\t\t\t\tlogger.error(\"uploading of file failed :\",ee);\r\n\t\t\t\tthrow new FileSystemUtilException(\"input stream not closed :\",ee);\r\n\t\t\t}\r\n\t\t\tdisconnect();\r\n\t\t}\r\n\t\tlogger.debug(\"End:\" + getClass().getName() + \".upload()\");\r\n\t\treturn true;\r\n\t}", "public static void uploadFile(HttpServletRequest request, MultipartFile file, String code) \r\n\t{\n\t\tREAL_PAIH=request.getSession().getServletContext().getRealPath(\"/assets/images/\");\r\n\t\t\r\n\t\tlogger.info(REAL_PAIH);\r\n\t\t\r\n\t\t//to make sure all directory exists\r\n\t\t//create new directory hmmmm\r\n\t\t\r\n\t\tif(!new File(ABS_PAIH).exists())\r\n\t\t{\r\n\t\t\t//create the directories\t\t\t\r\n\t\t\tnew File(ABS_PAIH).mkdirs();\r\n\t\t}\r\n\t\t\r\n\t\tif(!new File(REAL_PAIH).exists())\r\n\t\t{\r\n\t\t\t//create the directories\t\t\t\r\n\t\t\tnew File(REAL_PAIH).mkdirs();\r\n\t\t}\r\n\t\t\r\n\t\ttry\r\n\t\t{\r\n\t\t //server upload\r\n\t\t\tfile.transferTo(new File(REAL_PAIH + code + \".jpg\"));\r\n\t\t\t\r\n\t\t\t//project directory upload\r\n\t\t\tfile.transferTo(new File(ABS_PAIH + code + \".jpg\"));\r\n\r\n\t\t\t\r\n\t\t}catch(IOException e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "@Override\r\n\tpublic void putFile(String input, String targetLocation) throws FileSystemUtilException {\r\n\t\tthrow new FileSystemUtilException(\"000000\",null,Level.ERROR,null);\t\r\n\r\n\t}", "public void cancelUpload() {\n if (this.nativeFilesQueued.size() > 0) {\n cancelUpload(this.nativeFilesQueued.get(0).<File>cast().getId());\n }\n }", "private static void uploadFile(DbxClientV2 dbxClient, File localFile, String dropboxPath) {\n try (InputStream in = new FileInputStream(localFile)) {\n ProgressListener progressListener = l -> printProgress(l, localFile.length());\n\n FileMetadata metadata = dbxClient.files().uploadBuilder(dropboxPath)\n .withMode(WriteMode.ADD)\n .withClientModified(new Date(localFile.lastModified()))\n .uploadAndFinish(in, progressListener);\n\n System.out.println(metadata.toStringMultiline());\n } catch (UploadErrorException ex) {\n System.err.println(\"Error uploading to Dropbox: \" + ex.getMessage());\n } catch (DbxException ex) {\n System.err.println(\"Error uploading to Dropbox: \" + ex.getMessage());\n } catch (IOException ex) {\n System.err.println(\"Error reading from file \\\"\" + localFile + \"\\\": \" + ex.getMessage());\n }\n }", "@Test\n public void testCopyToTempDir() throws IOException {\n File fileA = null;\n\n try {\n fileA = File.createTempFile(\"fileA\", \"fileA\");\n System.out.println(fileA.getAbsolutePath());\n FileOutputStream fos = new FileOutputStream(fileA);\n InputStream sis = new StringInputStream(\"some content\");\n StreamUtil.copy(sis, fos);\n sis.close();\n fos.close();\n\n copyToTempDir(fileA);\n\n File fileACopy = new File(new File(getTempDirPath()), fileA.getName());\n assertTrue(fileACopy.exists());\n assertTrue(fileACopy.isFile());\n } finally {\n boolean deleted = fileA.delete();\n assertTrue(deleted);\n }\n\n File dirB = null;\n\n try {\n dirB = Files.createTempDirectory(\"dirB\").toFile();\n System.out.println(dirB.getAbsolutePath());\n\n copyToTempDir(dirB);\n\n File dirBCopy = new File(new File(getTempDirPath()), dirB.getName());\n assertTrue(dirBCopy.exists());\n assertTrue(dirBCopy.isDirectory());\n } finally {\n boolean deleted = dirB.delete();\n assertTrue(deleted);\n }\n }" ]
[ "0.64424634", "0.62019885", "0.61031085", "0.60230386", "0.59627306", "0.5876692", "0.5761867", "0.57059383", "0.5666552", "0.5656961", "0.562041", "0.5568552", "0.5494299", "0.54845756", "0.5418161", "0.5404184", "0.53591305", "0.52858955", "0.52717394", "0.526696", "0.5264115", "0.52383226", "0.52277136", "0.5222798", "0.52200305", "0.52097595", "0.51621825", "0.5150263", "0.5139261", "0.51262105", "0.50841993", "0.5076871", "0.50479716", "0.50440186", "0.5032853", "0.49857566", "0.49827874", "0.4953001", "0.4952375", "0.49328998", "0.4932779", "0.4931967", "0.4911239", "0.49082544", "0.48757723", "0.48754224", "0.484084", "0.482872", "0.481917", "0.48183364", "0.48072", "0.47975343", "0.47941798", "0.47912285", "0.47644162", "0.4760087", "0.47509924", "0.4750322", "0.47265178", "0.4723674", "0.4720333", "0.4713006", "0.47067818", "0.46991095", "0.46814382", "0.4652992", "0.46373942", "0.46323094", "0.46316758", "0.46268892", "0.4618567", "0.4612952", "0.46125308", "0.46080646", "0.46029058", "0.45978543", "0.45871225", "0.4563411", "0.4555263", "0.45541206", "0.45413512", "0.45398897", "0.4533238", "0.45250395", "0.45104071", "0.4509525", "0.4502526", "0.4501398", "0.44996682", "0.44951257", "0.44825065", "0.44808796", "0.44779792", "0.44777", "0.44745916", "0.44683763", "0.44620553", "0.44509232", "0.44408864", "0.44399297" ]
0.7865112
0
Store the data in the buffer into the given place.
protected void storeBuffer(Buffer buffer, String targetPath) { FileSystem fileSystem = Mesh.vertx().fileSystem(); fileSystem.writeFileBlocking(targetPath, buffer); // log.error("Failed to save file to {" + targetPath + "}", error); // throw error(INTERNAL_SERVER_ERROR, "node_error_upload_failed", error); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void put(long position, ByteBuffer src);", "public abstract void put(long position, ByteBuffer src);", "public void write(ByteBuffer buffer){\r\n\t\tbuffer.putInt(type.ordinal());\r\n\t\tbuffer.putInt(dataSize);\r\n\t\tbuffer.put(data);\r\n\t}", "public void put(T bufferItem);", "@Override\n public void put(long position, ByteBuffer src) {\n final ByteBuffer bd = this.bb.duplicate();\n bd.position(NumbersUtils.asInt(position));\n bd.put(src);\n }", "@Override\n public void put(long position, ByteBuffer src) {\n final ByteBuffer bd = this.getOrCreateBackingBB(position).duplicate();\n final long offset = this.getBackingBBOffset();\n bd.position(NumbersUtils.asInt(position-offset));\n bd.put(src);\n }", "@Override\r\n\tpublic void PushToBuffer(ByteBuffer buffer)\r\n\t{\r\n\t\r\n\t}", "public void store(FloatBuffer buf){\n\t\tambient.store(buf);\n\t\tdiffuse.store(buf);\n\t\tspecular.store(buf);\n\t\tposition.store(buf);\n\t\tbuf.put(range);\n\t\tdirection.store(buf);\n\t\tbuf.put(spot);\n\t\tatt.store(buf);\n\t\tbuf.put(pad);\n\t}", "public void write(int location, ByteBuffer data)\n throws DataOrderingException;", "public void insertIntoByteBuffer(ByteBuffer buffer)\n {\n \tbuffer.putDouble(j2ksec);\n \tbuffer.putInt(rid);\n \tbuffer.putDouble(lat);\n \tbuffer.putDouble(lon);\n \tbuffer.putDouble(depth);\n \tbuffer.putDouble(prefmag);\n\n \tbuffer.putDouble(ampmag);\n \tbuffer.putDouble(codamag);\n \tbuffer.putInt(nphases);\n \tbuffer.putInt(azgap);\n \tbuffer.putDouble(dmin);\n \tbuffer.putDouble(rms);\n \tbuffer.putInt(nstimes);\n \tbuffer.putDouble(herr);\n \tbuffer.putDouble(verr);\n \t\n \t// We'll represent characters by their ASCII codes, using -1 for null \n \tif ( magtype != null && magtype.length() > 0 )\n \t\tbuffer.putInt((int)(magtype.charAt(0)));\n \telse\n \t\tbuffer.putInt(-1);\n \tif ( rmk != null && rmk.length() > 0 )\n \t\tbuffer.putInt((int)(rmk.charAt(0)));\n \telse\n \t\tbuffer.putInt( -1 );\n}", "private final void buffer_push_back(byte d)\n\t{\n\t\tif (buffer_size_ >= buffer_.length) {\n int newsize = buffer_size_ * 2 + 10;\n byte[] newbuffer = new byte[newsize];\n\n for (int i = 0; i < buffer_size_; ++i)\n {\n newbuffer[i] = buffer_[i];\n }\n buffer_ = newbuffer;\n\t\t}\n\t\tbuffer_[buffer_size_] = d;\n\t\tbuffer_size_ = buffer_size_ + 1;\n\t}", "public void put(T data){\r\n\t\tthis.data = data;\r\n\t}", "public void write_to_buffer(DataOutputStream out) throws IOException {\r\n //for (int i = 0; i < this.dimension; ++i)\r\n for (int i = 0; i < this.dimension * 2; ++i) {\r\n out.writeFloat(this.data[i]);\r\n }\r\n out.writeFloat(this.distanz);\r\n// out.write(this.PlaceId.getBytes());\r\n out.writeInt(this.getPlaceId());\r\n// System.out.println(\"heheheh +::\" + this.PlaceId.length);\r\n out.writeDouble(this.location[0]);\r\n out.writeDouble(this.location[1]);\r\n// System.out.println(\"heheheh +::\" +this.PlaceId.getBytes().length);\r\n }", "@Override\r\n\tpublic Buffer setBuffer(int pos, Buffer b) {\n\t\treturn null;\r\n\t}", "@Override\r\n\tpublic Buffer setBuffer(int pos, Buffer b, int offset, int len) {\n\t\treturn null;\r\n\t}", "final void setCacheData(int pos, final CacheData<K, V> data) {\r\n buckets[pos].set(data);\r\n }", "protected final void push(final byte data) {\r\n this.memory[(this.sp-- & 0xff) | 0x100] = data;\r\n }", "public void put_position(int position, long number) {\n ptr_buff[(int) (number * POINTER_LENGTH / ptr_parts_size[0])].putInt((int) (number * POINTER_LENGTH % ptr_parts_size[0] + 9), position);\n }", "public void write(byte[] buffer);", "public abstract int writeData(int address, byte[] buffer, int length);", "void putTo(ByteBuffer dst, TcpTxContext tx) {}", "public static int putByteBuffer(byte[] bytes, int offset, ByteBuffer buf) {\n int len = buf.remaining();\n buf.get(bytes, offset, len);\n return offset + len;\n }", "public void append(IoBuffer buffer) {\n data.offerLast(buffer);\n updateBufferList();\n }", "public void write_to_buffer(byte[] buffer) throws IOException {\r\n ByteArrayOutputStream byte_out = new ByteArrayOutputStream(buffer.length);\r\n DataOutputStream out = new DataOutputStream(byte_out);\r\n\r\n write_to_buffer(out);\r\n\r\n byte[] bytes = byte_out.toByteArray();\r\n for (int i = 0; i < buffer.length; ++i) {\r\n buffer[i] = bytes[i];\r\n }\r\n\r\n out.close();\r\n byte_out.close();\r\n }", "public void put(T value) {\n if (buffer.length > 0) {\n buffer[head] = value;\n\n index = head;\n\n head = (head + 1) % buffer.length;\n\n if (entries < buffer.length) {\n ++entries;\n }\n }\n\n }", "public static void put(final ByteBuffer buf, final int bytePosition, final byte[] bytes, final int startFromBuf, final int byteCount) {\n final ByteBuffer bb = ByteBuffer.wrap(bytes);\n final long endByte = bytePosition + (long)byteCount;\n int j = 0;\n int i;\n for(i = bytePosition; i < (endByte - Long.BYTES); i += Long.BYTES, j += Long.BYTES) {\n final long val = bb.getLong(j);\n buf.putLong(i, val);\n }\n\n // we need to finish the remainder\n for(; i < endByte; i++, j++)\n buf.put(i, bytes[j]);\n }", "public void write(byte[] data, long offset);", "public void place(Position position) { this.position = position; }", "@Override\r\n\tpublic Buffer setBytes(int pos, byte[] b) {\n\t\treturn null;\r\n\t}", "public void updatePositioningData(PositioningData data);", "@Override\r\n\tpublic Buffer setBytes(int pos, ByteBuffer b) {\n\t\treturn null;\r\n\t}", "public void writeData(byte[] b, int pos)\n throws IOException\n {\n Buffer buf;\n for (int i = 0; i < b.length; i++)\n {\n buf = getBufferByPosition(pos + i);\n buf.setByte(b[i], pos + i);\n }\n }", "public void bufferPacket(UtpTimestampedPacketDTO pkt) throws IOException {\r\n\t\tint sequenceNumber = pkt.utpPacket().getSequenceNumber() & 0xFFFF;\r\n\t\tint position = sequenceNumber - expectedSequenceNumber;\r\n\t\tdebug_lastSeqNumber = sequenceNumber;\r\n\t\tif (position < 0) {\r\n\t\t\tposition = mapOverflowPosition(sequenceNumber);\r\n\t\t}\r\n\t\tdebug_lastPosition = position;\r\n\t\telementCount++;\r\n\t\ttry {\r\n\t\t\tbuffer[position] = pkt;\t\t\t\r\n\t\t} catch (ArrayIndexOutOfBoundsException ioobe) {\r\n\t\t\tlog.error(\"seq, exp: \" + sequenceNumber + \" \" + expectedSequenceNumber + \" \");\r\n\t\t\tioobe.printStackTrace();\r\n\r\n\t\t\tdumpBuffer(\"oob: \" + ioobe.getMessage());\r\n\t\t\tthrow new IOException();\r\n\t\t}\r\n\r\n\t}", "public void addBytes( final ByteBuffer _buffer ) {\n\n // sanity checks...\n if( isNull( _buffer ) )\n throw new IllegalArgumentException( \"Missing buffer to append from\" );\n if( _buffer.remaining() <= 0)\n throw new IllegalArgumentException( \"Specified buffer has no bytes to append\" );\n\n // figure out how many bytes we can append, and configure the source buffer accordingly...\n int appendCount = Math.min( buffer.capacity() - buffer.limit(), _buffer.remaining() );\n int specifiedBufferLimit = _buffer.limit();\n _buffer.limit( _buffer.position() + appendCount );\n\n // remember our old position, so we can put it back later...\n int pos = buffer.position();\n\n // setup to copy our bytes to the right place...\n buffer.position( buffer.limit() );\n buffer.limit( buffer.capacity() );\n\n // copy our bytes...\n buffer.put( _buffer );\n\n // get the specified buffer's limit back to its original state...\n _buffer.limit( specifiedBufferLimit );\n\n // get our position and limit to the right place...\n buffer.limit( buffer.position() );\n buffer.position( pos );\n }", "public void putData(HelperData data);", "@Override\r\n\tpublic Buffer setBytes(int pos, byte[] b, int offset, int len) {\n\t\treturn null;\r\n\t}", "public abstract void update(byte[] buf, int off, int len);", "public void storeItemPosition(long position) {\n\t\tmEditor.putLong(\"KEY_DATA_POSITION\", position);\n\t\tmEditor.commit();\n\t}", "public synchronized void sendOrder(BlockingBuffer buffer,AmazonOrder order){\n try\n {\n buffer.blockingPut(order); // set value in buffer\n } catch (InterruptedException exception) {\n Thread.currentThread().interrupt();\n }\n\n }", "void write(byte[] buffer, int bufferOffset, int length) throws IOException;", "public FloatBuffer putInBuffer(FloatBuffer buffer) {\n\t\tbuffer.put(x).put(y).put(z).put(w);\n\t\treturn buffer;\n\t}", "public void setInto(PreparedStatement ps, int position) throws SQLException, StandardException {\n\n ps.setBytes(position, getBytes());\n }", "void setBuffer(byte[] b)\n {\n buffer = b;\n }", "T set(Position<T> p, T data) throws IllegalStateException;", "private void setData(T data, int size, List<? extends T> memory, T type) { }", "public void push(T data)\n {\n ll.insert(ll.getSize(), data);\n }", "public void pushBack (final byte [] buf, final int start, final int length)\n {\n this.buf = buf;\n this.bufStart = start;\n this.bufEnd = length + start;\n }", "void setData(byte[] data);", "@Override\n\tpublic void setBytes(final long startpos, final byte[] bytes,\n\t\tfinal int offset, final int length)\n\t{\n\t\tcheckWritePos(startpos, startpos + length);\n\t\tfinal int neededCapacity = size + length;\n\t\tensureCapacity(neededCapacity);\n\n\t\t// copy the data\n\t\tbuffer.position((int) startpos);\n\t\tbuffer.put(bytes, offset, length);\n\n\t\t// update the maxpos\n\t\tupdateSize(startpos + length);\n\t}", "public interface IBufferInput<T> {\n\n\t/**\n\t * Puts the bufferItem at the end of the bufferStore ArrayList\n\t * @param bufferItem an item to append to bufferStore \n\t */\n\tpublic void put(T bufferItem);\n}", "public void writePacketData(PacketBuffer buf) throws IOException {\n buf.writeResourceLocation(this.field_244320_a);\n }", "@Override\n\tpublic void setNext(ByteBuffer buff, Integer position) {\n\t\tbyte[] tmp = new byte[3];\n\t\tbuff.get(tmp);\n\t\tbuff.position(position);\n\t\tif (new String(tmp) == \"GSO\") this.hasNext = true;\n\t\telse this.hasNext = false;\n\t}", "public void set(byte[] arrby) {\n ByteBuffer byteBuffer;\n ByteBuffer byteBuffer2 = byteBuffer = Blob.this.getByteBuffer();\n synchronized (byteBuffer2) {\n byteBuffer.position(Blob.this.getByteBufferPosition() + this.offset());\n byteBuffer.put(arrby);\n this.mCurrentDataSize = arrby.length;\n return;\n }\n }", "void send(ByteBuffer data, Address addr) throws CCommException, IllegalStateException;", "void write(ByteBuffer b, int off, int len) throws IOException;", "public void write(ByteBuffer buffer) throws IOException {\n _channel.write(buffer);\n }", "void putData(CheckPoint checkPoint);", "public void setData(int address, String data, int size, String comment) {\n\t\tint bank = address % numOfbank;\n\t\t\n\t\tif (contentInBank.get(bank) != null) {\n\t\t\tEntry d =contentInBank.get(bank).get(address);\n\t\t\td.setData(data);\n\t\t\td.setType(MemoryType.DATA);\n\t\t\td.setSize(size);\n\t\t\tlogger.info(\"data memory update, bank:\" + bank +\", address:\"+ address);\n\t\t\tpublishUpdate(address, data,comment);\n\t\t} else{\n\t\t\tlogger.error(\"invalid data memory address \" + address + \" in bank \" + bank);\n\t\t}\n\t}", "public void flush() {\r\n // Flushing is required only if there are written bytes in\r\n // the current data element.\r\n if (bytenum != 0) {\r\n data[offset] = elem;\r\n }\r\n }", "private void sendData() {\n final ByteBuf data = Unpooled.buffer();\n data.writeShort(input);\n data.writeShort(output);\n getCasing().sendData(getFace(), data, DATA_TYPE_UPDATE);\n }", "public void write_to_buffer(DataOutputStream out) throws IOException\r\n {\r\n for (int i = 0; i < 2*dimension; ++i)\r\n out.writeFloat(bounces[i]);\r\n out.writeInt(son);\r\n out.writeInt(num_of_data);\r\n }", "private void loadBuffer(ByteBuffer buffer) {\n byteBuffer = buffer.get();\n }", "void writeTo(ByteBuffer buffer) {\n/* 526 */ Preconditions.checkNotNull(buffer);\n/* 527 */ Preconditions.checkArgument(\n/* 528 */ (buffer.remaining() >= 40), \"Expected at least Stats.BYTES = %s remaining , got %s\", 40, buffer\n/* */ \n/* */ \n/* 531 */ .remaining());\n/* 532 */ buffer\n/* 533 */ .putLong(this.count)\n/* 534 */ .putDouble(this.mean)\n/* 535 */ .putDouble(this.sumOfSquaresOfDeltas)\n/* 536 */ .putDouble(this.min)\n/* 537 */ .putDouble(this.max);\n/* */ }", "Buffer copy();", "public void set(int addr, byte b) {\n data[addr - start] = b;\n }", "public static void bufferTest(){\n // 获取非直接缓冲区\n ByteBuffer byteBuffer = ByteBuffer.allocate(1024);\n System.out.println(\"position = \" + byteBuffer.position());\n System.out.println(\"limit = \" + byteBuffer.limit());\n System.out.println(\"capacity = \" + byteBuffer.capacity());\n /**\n * position = 0\n * limit = 1024\n * capacity = 1024\n * **/\n // 获取直接缓冲区\n// ByteBuffer byteBuffer = ByteBuffer.allocateDirect(1024);\n// byteBuffer.put()\n String s1 = \"helloworld\";\n String s2 = \"你好世界\";\n byte[] b1 = s1.getBytes();\n byte[] b2 = s2.getBytes();\n System.out.println(Arrays.toString(b1));\n System.out.println(Arrays.toString(b2));\n System.out.println(new String());\n byteBuffer.put(b1);\n System.out.println(\"position = \" + byteBuffer.position());\n System.out.println(\"limit = \" + byteBuffer.limit());\n System.out.println(\"capacity = \" + byteBuffer.capacity());\n /**\n * position = 10\n * limit = 1024\n * capacity = 1024\n * 输出结果表示put之后只有positoin位置变了,limit和capacity没有变\n * 表明position到limit之间的数据还是可以继续put\n * **/\n byteBuffer.put(b2);\n System.out.println(\"position = \" + byteBuffer.position());\n System.out.println(\"limit = \" + byteBuffer.limit());\n System.out.println(\"capacity = \" + byteBuffer.capacity());\n /**\n * position = 22\n * limit = 1024\n * capacity = 1024\n * 输出结果表示继续put之后只有positoin位置变了,limit和capacity还是没有变\n * **/\n byteBuffer.put(100,(byte)100);\n System.out.println(\"put之后直接get=\" + byteBuffer.get(100));\n System.out.println(\"position = \" + byteBuffer.position());\n System.out.println(\"limit = \" + byteBuffer.limit());\n System.out.println(\"capacity = \" + byteBuffer.capacity());\n System.out.println(byteBuffer.get(100));\n /**\n * position = 22\n * limit = 1024\n * capacity = 1024\n * put指定下标的位置,赋值一个字节,那么position limit capacity都没有变,只是赋值了\n * **/\n byteBuffer.flip();//改变positon和limit位置\n System.out.println(\"position = \" + byteBuffer.position());\n System.out.println(\"limit = \" + byteBuffer.limit());\n System.out.println(\"capacity = \" + byteBuffer.capacity());\n /**\n * flip之后limit的值变为22,之前put的100位置的字节无法进行有效读取\n * **/\n byte[] b3 = new byte[byteBuffer.limit()];\n byteBuffer.get(b3);\n System.out.println(new String(b3));\n // 表示byteBuffer还有多少可用\n int remaining = byteBuffer.remaining();\n // 为当前limit赋值,但是如果之后调用了flip方法limit还是会赋值为position\n byteBuffer.limit(10);\n // array()获取了当前数组中所有有效字节数组,包括刚才put到下标100的那个位置\n byte[] b4 = byteBuffer.array();\n System.out.println(new String(b4));\n // 为当前position位置做标记配合reset使用\n// byteBuffer.mark();\n// // 将positoin值变为直接做过标记的mark值\n// byteBuffer.reset();\n// // 分割缓冲区\n// byteBuffer.slice();\n // clear方法重新初始化了position limit capacity和mark的值,但是没有清除数组中的数据\n byteBuffer.clear();\n b4 = byteBuffer.array();\n System.out.println(\"clear之后=\" + new String(b4));\n }", "public final void save(final ByteBuffer buffer) {\r\n buffer.putInt(respawnRate);\r\n buffer.putShort((short) getId());\r\n buffer.putInt(getCount());\r\n buffer.putShort((short) (getLocation().getX() & 0xFFFF)).putShort((short) (getLocation().getY() & 0xFFFF))\r\n .put((byte) getLocation().getZ());\r\n }", "public GlBuffer commit(final Chunk<E> chunk, boolean push){\n //Log.d(TAG,\"update(\"+chunk+\", \"+commit+\")\");\n\t\tint startPosition = 0;\n\t\tint offset = this.stride;\n switch(this.datatype){\n case TYPE_FLOAT : {\n if (this.buffer == null) {\n this.buffer = ByteBufferPool.getInstance().getDirectFloatBuffer(this.size >> 2);\n\t\t\t\t\tmManagedBuffer = true;\n }\n\t\t\t\telse if(mManagedBuffer){\n\t\t\t\t\tthis.buffer.position(0);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tstartPosition = this.buffer.position();\n\t\t\t\t}\n offset = this.stride >> 2;\n for (int elementIndex = 0, compIndex = 0; elementIndex < this.count; elementIndex++, compIndex += chunk.components) {\n this.buffer.position(startPosition + chunk.position + (elementIndex * offset));\n ((FloatBuffer) this.buffer).put(((float[]) chunk.data), compIndex, chunk.components);\n }\n break;\n }\n case TYPE_INT : {\n if (this.buffer == null) {\n this.buffer = ByteBufferPool.getInstance().getDirectIntBuffer(this.size >> 2);\n\t\t\t\t\tmManagedBuffer = true;\n\t\t\t\t}\n\t\t\t\telse if(mManagedBuffer){\n\t\t\t\t\tthis.buffer.position(0);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tstartPosition = this.buffer.position();\n\t\t\t\t}\n offset = this.stride >> 2;\n for (int elementIndex = 0, compIndex = 0; elementIndex < this.count; elementIndex++, compIndex += chunk.components) {\n this.buffer.position(startPosition + chunk.position + (elementIndex * offset));\n ((IntBuffer) this.buffer).put(((int[]) chunk.data), compIndex, chunk.components);\n }\n break;\n }\n case TYPE_SHORT : {\n if (this.buffer == null) {\n this.buffer = ByteBufferPool.getInstance().getDirectShortBuffer(this.size >> 1);\n\t\t\t\t\tmManagedBuffer = true;\n\t\t\t\t}\n\t\t\t\telse if(mManagedBuffer){\n\t\t\t\t\tthis.buffer.position(0);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tstartPosition = this.buffer.position();\n\t\t\t\t}\n offset = this.stride >> 1;\n for (int elementIndex = 0, compIndex = 0; elementIndex < this.count; elementIndex++, compIndex += chunk.components) {\n this.buffer.position(startPosition + chunk.position + (elementIndex * offset));\n ((ShortBuffer) this.buffer).put(((short[]) chunk.data), compIndex, chunk.components);\n }\n break;\n }\n default :\n if(this.buffer == null){\n this.buffer = ByteBufferPool.getInstance().getDirectByteBuffer(this.size);\n\t\t\t\t\tmManagedBuffer = true;\n\t\t\t\t}\n\t\t\t\telse if(mManagedBuffer){\n\t\t\t\t\tthis.buffer.position(0);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tstartPosition = this.buffer.position();\n\t\t\t\t}\n for (int elementIndex = 0, compIndex = 0; elementIndex < this.count; elementIndex++, compIndex += chunk.components) {\n this.buffer.position(startPosition + chunk.position + (elementIndex * offset));\n ((ByteBuffer) this.buffer).put(((byte[]) chunk.data), compIndex, chunk.components);\n }\n break;\n }\n\n //Update server if needed\n if(push){\n push();\n }\n\n return this;\n }", "void writeCurrentBuffer();", "private void writeByteAt(int pos, int val) {\n dest[pos] = (byte) val;\n }", "protected void add(ByteBuffer data) throws Exception {\n\tLog.d(TAG, \"add data: \"+data);\n\n\tint dataLength = data!=null ? data.capacity() : 0; ///Util.chunkLength(data); ///data.length;\n\tif (dataLength == 0) return;\n\tif (this.expectBuffer == null) {\n\t\tthis.overflow.add(data);\n\t\treturn;\n\t}\n\t\n\tLog.d(TAG, \"add data: ... 2\");\n\t\n\tint toRead = Math.min(dataLength, this.expectBuffer.capacity() - this.expectOffset);\n\tBufferUtil.fastCopy(toRead, data, this.expectBuffer, this.expectOffset);\n\t\n\tLog.d(TAG, \"add data: ... 3\");\n\n\tthis.expectOffset += toRead;\n\tif (toRead < dataLength) {\n\t\tthis.overflow.add((ByteBuffer) Util.chunkSlice(data, toRead, data.capacity())/*data.slice(toRead)*/);\n\t}\n\t\n\tLog.d(TAG, \"add data: ... 5\");\n\n\twhile (this.expectBuffer!=null && this.expectOffset == this.expectBuffer.capacity()) {\n\t\tByteBuffer bufferForHandler = this.expectBuffer;\n\t\tthis.expectBuffer = null;\n\t\tthis.expectOffset = 0;\n\t\t///this.expectHandler.call(this, bufferForHandler);\n\t\tthis.expectHandler.onPacket(bufferForHandler);\n\t}\n\t\n\tLog.d(TAG, \"add data: ... 6\");\n\n}", "protected void writeByte(final int adr, final byte data) {\r\n this.memory[adr] = data;\r\n }", "private void write( byte[] data) throws IOException {\n ByteBuffer buffer = ByteBuffer.wrap(data);\n\n int write = 0;\n // Keep trying to write until buffer is empty\n while(buffer.hasRemaining() && write != -1)\n {\n write = channel.write(buffer);\n }\n\n checkIfClosed(write); // check for error\n\n if(ProjectProperties.DEBUG_FULL){\n System.out.println(\"Data size: \" + data.length);\n }\n\n key.interestOps(SelectionKey.OP_READ);// make key read for reading again\n\n }", "public void appendBytesTo (int offset, int length, IQueryBuffer dst) {\r\n\r\n\t\tif (isDirect || dst.isDirect())\r\n\t\t\tthrow new UnsupportedOperationException(\"error: cannot append bytes from/to a direct buffer\");\r\n\r\n\t\tdst.put(this.buffer.array(), offset, length);\r\n\t}", "@Override\r\n\tpublic void addToBuffer(byte[] buff, int len) {\r\n\t\tbios.write(buff, 0, len);\r\n\t}", "private static void flushInternalBuffer() {\n\n //Strongly set the last byte to \"0A\"(new line)\n if (mPos < LOG_BUFFER_SIZE_MAX) {\n buffer[LOG_BUFFER_SIZE_MAX - 1] = 10;\n }\n\n long t1, t2;\n\n //Save buffer to SD card.\n t1 = System.currentTimeMillis();\n writeToSDCard();\n //calculate write file cost\n t2 = System.currentTimeMillis();\n Log.i(LOG_TAG, \"internalLog():Cost of write file to SD card is \" + (t2 - t1) + \" ms!\");\n\n //flush buffer.\n Arrays.fill(buffer, (byte) 0);\n mPos = 0;\n }", "public void put(int id) {\n\t\t\tbuffers[cursor] = id;\r\n\t\t\tgetNode(id).setHeapIndex(cursor);\r\n\t\t\tsiftUp(cursor);\r\n\t\t\tcursor ++;\r\n//\t\t\tcheck();\r\n//\t\t\tSystem.out.println(\"after put ==============:\" + cursor);\r\n\t\t}", "public void enqueue(Object data){\r\n super.insert(data, 0);//inserts it to the first index everytime (for tostring)\r\n }", "@Override\n\tpublic BytesReceiver put(final ByteBuffer src) {\n\t\treturn put(src.array());\n\t}", "public void setDataUnsafe(Serializable data) { this.data = data; }", "public void set(int addr, byte[] buff) throws ProgramException {\n set(addr, buff, 0, buff.length);\n }", "public final void set(byte[] buff, int offset, int length) {\r\n if (offset < 0) {\r\n throw new IndexOutOfBoundsException(\"ByteSequence index out of range: \" + offset);\r\n }\r\n if (length < 0) {\r\n throw new IndexOutOfBoundsException(\"ByteSequence index out of range: \" + length);\r\n }\r\n if (offset > buff.length - length) {\r\n throw new StringIndexOutOfBoundsException(\"ByteSequence index out of range: \"\r\n + (offset + length));\r\n }\r\n this.buff = Arrays.copyOf(buff, buff.length);\r\n this.offset = offset;\r\n this.length = length;\r\n }", "public void write(long[] memorypos, MultiDimArray buffer, long[] bufferpos, long[] count)\n\t{\n\t\t\n\t\tint dimcount=multimemory.dims.length;\n\t\tint[] memorypos2=new int[dimcount];\n\t\tint[] bufferpos2=new int[dimcount];\n\t\tint[] count2=new int[dimcount];\n\t\t\n\t\tfor (int i=0; i<dimcount; i++)\n\t\t{\n\t\t\tmemorypos2[i]=(int)memorypos[i];\n\t\t\tbufferpos2[i]=(int)bufferpos[i];\n\t\t\tcount2[i]=(int)count[i];\n\t\t\n\t\t}\n\t\t\n\n\t\tmultimemory.assignSubArray(memorypos2, buffer, bufferpos2, count2);\n\t}", "@Override\r\n\tpublic Buffer setByte(int pos, byte b) {\n\t\treturn null;\r\n\t}", "public void insert(int position, E o) {\n\t\tif (position >= 0 && position <= size) {\n\t\t\t// first resize the storage array\n\t\t\tE[] newData = (E[]) new Object[size + 1];\n\t\t\t// copy the data prior to the insertion\n\t\t\tfor (int i = 0; i < position; i++)\n\t\t\t\tnewData[i] = data[i];\n\t\t\t// insert the new element\n\t\t\tnewData[position] = o;\n\t\t\t// move the data after the insertion\n\t\t\tfor (int i = position; i < size; i++)\n\t\t\t\tnewData[i + 1] = data[i];\n\t\t\t// replace the storage with the new array\n\t\t\tdata = newData;\n\t\t\tsize = size + 1;\n\t\t}\n\t}", "void writeBlock(int blockId, byte[] buffer, int offset) throws IOException;", "@Override\r\n\tpublic void write(IByteBuffer target, long offset) {\n\r\n\t}", "@SuppressWarnings(\"unchecked\")\n public void put(final T object) {\n data.add(object);\n }", "@Override\n public void fromBuffer(byte[] buffer) {\n set(bytesToContent(buffer));\n }", "@Override\n\t\tvoid putTo(ByteBuffer dst, TcpTxContext tx) {\n\t\t\tfor(ByteChunk bc: byteChunks)\n\t\t\t\tbc.putTo(dst);\n\t\t}", "private int addBuffer( FloatBuffer directBuffer, FloatBuffer newBuffer ) {\n int oldPosition = directBuffer.position();\n if ( ( directBuffer.capacity() - oldPosition ) >= newBuffer.capacity() ) {\n directBuffer.put( newBuffer );\n } else {\n oldPosition = -1;\n }\n return oldPosition;\n }", "public void insert(Object data, int index){\r\n enqueue(data);\r\n }", "public void setVideoBufferByte(int index, byte data)\n {\n this.videocard.vgaMemory[index] = data;\n }", "public void putBlock(Boolean trackStats, MemoryBlock block){\r\n\t\tif(DEBUG_LEVEL >= 1)System.out.println(\"Memory.putBlock(\" + block.getBlockAddress() + \")\");\r\n\t\t\r\n\t\t// Validate\r\n\t\tif(block == null)throw new NullPointerException(\"block Can Not Be Null\");\r\n\t\tif((block.getBlockAddress() + block.getSize() - 1) > totalSize)throw new IllegalArgumentException(\"block Can Not Be Greater Than total Size\");\r\n\t\t\r\n\t\t// Write MemoryElements to Memory\r\n\t\tMemoryElementIterator meIterator = block.getIterator();\r\n\t\twhile(meIterator.hasNext()){\r\n\t\t\tMemoryElement element = meIterator.next();\r\n\t\t\t\r\n\t\t\tif(DEBUG_LEVEL >= 4)System.out.println(\"Memory.putBlock()...Writing memory[\" + element.getElementAddress() + \"]\");\r\n\t\t\t\r\n\t\t\tmemory[element.getElementAddress()].setData(element.getData());\r\n\t\t}\r\n\t\t\r\n\t\tif(trackStats)cacheStats.ACCESS++;\r\n\t\tif(trackStats)cacheStats.BLOCKWRITE_HIT++;\r\n\t\t\r\n\t\tif(DEBUG_LEVEL >= 2)System.out.println(\"Memory.putBlock()...Finished\");\r\n\t}", "public void insert(int index, int data) {\n\n // double the Vector if it's full\n if (isFull())\n doubleSize();\n\n // Exception: index out of range\n if (index > dataSize)\n throw new IllegalStateException();\n\n // Move items 1 step forward\n if (index != dataSize)\n moveRight(index);\n\n // Place the item at the specified position\n array[index] = data;\n dataSize++;\n }", "public void put(T element) {\n\t\tcheckCapacity(size + 1);\n\t\tdata[size++] = element;\n\t}", "public void write(byte[] buffer){\r\n\t\t\r\n\t\ttry{\r\n\t\t\toOutStream.write(buffer);\r\n\t\t}catch(IOException e){\r\n\t\t\tLog.e(TAG, \"exception during write\", e);\r\n\t\t}\r\n\t}", "public void save() {\n DataBuffer.saveDataLocally();\n\n //TODO save to db must be done properly\n DataBuffer.save(session);\n\n //TODO recording saved confirmation\n }", "protected void forwardData(String from, byte[] data)\n\t\t\tthrows QueueBlockedException {\n\t\tthis.writer.write(from, data);\n\t}", "public void addToBuffer(String filename, SensorData sensorData){\n ObjectOutputStream outstream;\n try {\n File bufferFile = new File(filename);\n //Checks to see if the buffer file already exists. \n if(bufferFile.exists())\n {\n //Create an AppendableObjectOutputStream to add the the end of the buffer file as opposed to over writeing it. \n outstream = new AppendableObjectOutputStream(new FileOutputStream (filename, true));\n } else {\n //Create an ObjectOutputStream to create a new Buffer file. \n outstream = new ObjectOutputStream(new FileOutputStream (filename)); \n }\n //Adds the SensorData to the end of the buffer file.\n outstream.writeObject(sensorData);\n outstream.close();\n } catch(IOException io) {\n System.out.println(io);\n }\n }" ]
[ "0.71043843", "0.69831496", "0.66977787", "0.6655542", "0.6405381", "0.630406", "0.62762284", "0.61528885", "0.6151908", "0.6047786", "0.60048336", "0.6000252", "0.5964378", "0.5950482", "0.58705527", "0.5838961", "0.58280617", "0.57932293", "0.5774736", "0.57590413", "0.5754532", "0.5741717", "0.5735684", "0.5727813", "0.5712338", "0.56865484", "0.5679462", "0.5661088", "0.5574638", "0.55527234", "0.5543218", "0.5511883", "0.5511716", "0.5498695", "0.547015", "0.5463912", "0.54609567", "0.54390603", "0.5438332", "0.5434586", "0.5427644", "0.5423279", "0.5410259", "0.540788", "0.5402648", "0.5386934", "0.53747284", "0.5354433", "0.53467804", "0.5344812", "0.5312236", "0.5308722", "0.5308336", "0.527872", "0.52642894", "0.5255227", "0.52275205", "0.5224432", "0.5220139", "0.5211157", "0.52075714", "0.52064407", "0.5186151", "0.51827043", "0.51814926", "0.5179126", "0.51675403", "0.5163238", "0.515286", "0.5150648", "0.51305646", "0.5129596", "0.51282763", "0.5128109", "0.5119216", "0.51172006", "0.5112936", "0.5112869", "0.5106996", "0.5091535", "0.5090244", "0.5079339", "0.50736606", "0.5072926", "0.507102", "0.50701034", "0.5061894", "0.50612646", "0.50563157", "0.50545144", "0.5052451", "0.50505006", "0.5049484", "0.5027584", "0.5022989", "0.5018913", "0.501634", "0.50128937", "0.50124055", "0.5011237" ]
0.5570026
29
Check the target upload folder and create it if needed.
protected void checkUploadFolderExists(File uploadFolder) { boolean folderExists = uploadFolder.exists(); // log.error("Could not check whether target directory {" + uploadFolder.getAbsolutePath() + "} exists.", error); // throw error(BAD_REQUEST, "node_error_upload_failed", error); if (!folderExists) { uploadFolder.mkdirs(); // log.error("Failed to create target folder {" + uploadFolder.getAbsolutePath() + "}", error); // throw error(BAD_REQUEST, "node_error_upload_failed", error); if (log.isDebugEnabled()) { log.debug("Created folder {" + uploadFolder.getAbsolutePath() + "}"); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void createSubDirCameraTaken() {\n\t\tFile f = new File(getPFCameraTakenPath());\n\t\tf.mkdirs();\n\t}", "private String createTestTargetFolder(Long targetId, Long userId) {\r\n\t\t// create user folder if not existing\r\n\t\tString path = mFileStorePath + userId + \"//tt-\" + targetId;\r\n\t\tif (new File(path).mkdirs()) {\r\n\t\t\tmLogger.info(\"New folder created:\" + path);\r\n\t\t\treturn path;\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "@EventListener(ApplicationReadyEvent.class)\n private void createImageDirectory()\n {\n new File(productImageUpload).mkdir();\n }", "private void checkRootFolder() throws TBException {\r\n\t\tFile f = new File(rootTBFolder);\r\n\t\tif(!f.exists()) {\r\n\t\t\tf.mkdir();\r\n\t\t\tf = new File(AppUtil.createFilePath(new String[]{rootTBFolder, COMPUTED_FILES_FOLDER_NM}));\r\n\t\t\tf.mkdir();\r\n\t\t}\t\r\n\t}", "public void checkFolder() {\n String mPath = Environment.getExternalStorageDirectory().getAbsolutePath() + \"/ExoTest/\";\n mDir = new File(mPath);\n boolean isDirectoryCreated = mDir.exists();\n if (!isDirectoryCreated) {\n isDirectoryCreated = mDir.mkdir();\n }\n if (isDirectoryCreated) {\n // do something\\\n Log.d(\"Folder\", \"Already Created\");\n }\n }", "void uploadingFolder(String remoteFolder);", "private void checkIfLocationExists() {\n try {\n File file = new File(saveLocation);\n if(!file.exists()) file.mkdirs();\n } catch (Exception e) {\n log.error(e.getMessage(), e);\n }\n }", "private Path initFolder(String folder) throws IOException {\n return Files.createDirectory(Paths.get(uploadFolder + \"/\" + folder));\n }", "void folderUploaded(String remoteFolder);", "private void createLocalFolder(File newFolder) {\n\n if (!newFolder.exists()) {\n newFolder.mkdirs();\n //TODO: what if the folder can't be created?\n PieLogger.trace(this.getClass(), \"Folder created!\");\n } else {\n PieLogger.debug(this.getClass(), \"Folder exits already?!\");\n }\n }", "private File createDirectoryIfNotExisting( String dirName ) throws HarvesterIOException\n {\n \tFile path = FileHandler.getFile( dirName );\n \tif ( !path.exists() )\n \t{\n \t log.info( String.format( \"Creating directory: %s\", dirName ) );\n \t // create path:\n \t if ( !path.mkdir() )\n \t {\n \t\tString errMsg = String.format( \"Could not create necessary directory: %s\", dirName );\n \t\tlog.error( errMsg );\n \t\tthrow new HarvesterIOException( errMsg );\n \t }\n \t}\n \t\n \treturn path;\n }", "public static boolean checkFileDirectory() {\n\t\ttry {\n\t\t\tfinal File dir = new File(FINAL_SAVE_MEDIA_PATH);\n\t\t\tif (!dir.exists()) {\n\t\t\t\tfinal boolean isMkdirs = dir.mkdirs();\n\t\t\t\treturn isMkdirs;\n\t\t\t}\n\t\t\treturn true;\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn false;\n\t}", "private void createFolders() {\n File f = new File(System.getProperty(\"user.dir\") + \"/chatimages/\");\n if (!f.exists()){\n f.mkdir();\n }\n }", "public boolean createFolderInServerDir(String FolderName){\r\n File file = new File(serversDir, FolderName);\r\n if(file.exists()){\r\n Toast.makeText(mContext, \"server already exist\", Toast.LENGTH_SHORT).show();\r\n return false;\r\n }else{\r\n file.mkdirs();\r\n updateServerList();\r\n return true;\r\n }\r\n }", "private static void checkFilePath(String filePath) {\n File file = new File(filePath);\n try {\n if (!file.getParentFile().exists()) {\n file.getParentFile().mkdirs();\n }\n if (!file.exists()) {\n file.createNewFile();\n }\n file.createNewFile();\n } catch (IOException e) {\n System.err.println(e.getMessage());\n }\n }", "private void makeFolders( final File directoryToCreate )\n throws MojoExecutionException\n {\n this.logger.debug( \"Creating folder '\" + directoryToCreate.getAbsolutePath() + \"' ...\" );\n if ( directoryToCreate.mkdirs() == false )\n {\n throw new MojoExecutionException( \"Could not create folder '\" + directoryToCreate.getAbsolutePath() + \"'!\" );\n }\n }", "public static boolean checkAppFileDirectory(Context context) {\n\t\ttry {\n\t\t\tfinal String imageDir = getAppFilesDirByData(context);\n\t\t\tfinal File imageFileDir = new File(imageDir);\n\t\t\tif (!imageFileDir.exists()) {\n\t\t\t\tfinal boolean isMkdirs = imageFileDir.mkdirs();\n\t\t\t\treturn isMkdirs;\n\t\t\t}\n\t\t\treturn true;\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn false;\n\n\t}", "@Test\n\tpublic void cleanupTargetDirectory() throws IOException {\n\t\tfinal Path targetDir = _temp.toPath().resolve(\"target\");\n\t\tfinal Path installerTar = new File(getClass().getResource(TEST_INSTALLER_TAR_GZ).getFile()).toPath();\n\t\tFileUtil.mkDirs(targetDir);\n\t\tArchiveUtil.decompressTarGz(installerTar, targetDir);\n\n\t\t// test\n\t\tassertTrue(targetDir.toFile().list().length > 0, \"target dir should exist with children\");\n\t\tServerInstaller.cleanupTargetDirectory(targetDir);\n\n\t\t// verify\n\t\tassertFalse(targetDir.toFile().exists(), \"target dir should not exist\");\n\t}", "private boolean createFolder (Path path) {\n if (Files.notExists(path)) {\n // If the folder doesn't already exists we create it\n File f = new File(path.toString());\n try {\n // Create the folder\n f.mkdir();\n // Create an empty flow.json file\n f = new File(path + \"/flow.json\");\n f.createNewFile();\n return true;\n } catch (Exception e) {\n e.printStackTrace();\n return false;\n }\n } else {\n return false;\n }\n }", "public boolean makeDirectory(){\n File root = new File(Environment.getExternalStorageDirectory(),\"OQPS\");\n if(!root.exists()){\n return root.mkdir();\n }\n return true; //folder already exists\n }", "public boolean checkDirectory(String destinationFileName) {\r\n\t\tFile theDir = new File(destinationFileName).getParentFile();\r\n\t\tif (!theDir.exists()) {\r\n\t\t\treturn theDir.mkdirs();\r\n\t\t}\r\n\t return true;\r\n\t}", "private static boolean checkDirectory() {\n File baseDir = new File(Environment.getExternalStorageDirectory(), \"Andevindo\");\n mImageDir = new File(baseDir.getPath() + File.separator + \"Images\");\n mVideoDir = new File(baseDir.getPath() + File.separator + \"Videos\");\n mMiscDir = new File(baseDir.getPath() + File.separator + \"Misc\");\n if (!baseDir.exists()) {\n if (!baseDir.mkdirs()) {\n\n return false;\n } else {\n\n\n if (!mImageDir.exists()) {\n if (!mImageDir.mkdirs()) {\n\n return false;\n }\n }\n\n\n if (!mVideoDir.exists()) {\n if (!mVideoDir.mkdirs()) {\n\n return false;\n }\n }\n\n\n if (!mMiscDir.exists()) {\n if (!mMiscDir.mkdirs()) {\n\n return false;\n }\n }\n\n }\n }\n return true;\n }", "@Test(timeout = SWIFT_TEST_TIMEOUT)\n public void testRenameFileIntoExistingDirectory() throws Exception {\n assumeRenameSupported();\n\n Path src = path(\"/test/olddir/file\");\n createFile(src);\n Path dst = path(\"/test/new/newdir\");\n fs.mkdirs(dst);\n rename(src, dst, true, false, true);\n Path newFile = path(\"/test/new/newdir/file\");\n if (!fs.exists(newFile)) {\n String ls = ls(dst);\n LOG.info(ls(path(\"/test/new\")));\n LOG.info(ls(path(\"/test/hadoop\")));\n fail(\"did not find \" + newFile + \" - directory: \" + ls);\n }\n assertTrue(\"Destination changed\",\n fs.exists(path(\"/test/new/newdir/file\")));\n }", "private void setUpDirectories() {\r\n\t\tFile creation = new File(\"Creations\");\r\n\t\tFile audio = new File(\"Audio\");\r\n\t\tFile quiz = new File(\"Quiz\");\r\n\t\tFile temp = new File(\"Temp\");\r\n\r\n\t\tif (!creation.isDirectory()) {\r\n\t\t\tcreation.mkdir();\r\n\t\t}\r\n\t\tif (!audio.isDirectory()) {\r\n\t\t\taudio.mkdir();\r\n\t\t}\r\n\t\tif (!quiz.isDirectory()) {\r\n\t\t\tquiz.mkdir();\r\n\t\t}\r\n\t\tif (!temp.isDirectory()) {\r\n\t\t\ttemp.mkdir();\r\n\t\t}\r\n\r\n\t}", "public boolean checkFolderExistsOrMake(File folder) {\n\t\ttry {\n\t\t\tif(folder.exists()) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tfolder.mkdir();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t}", "public void setupDrive(){\n // Place Dove/ into base of drive\n new File(drv.toString() + File.separator + folderName).mkdir();\n //upload preset content if required\n isSetup = true;\n }", "private static void createTempFolder(String folderName) throws IOException {\n Path tempFolderPath = Paths.get(folderName);\n if (Files.notExists(tempFolderPath) || !Files.isDirectory(tempFolderPath)) {\n Files.createDirectory(tempFolderPath);\n }\n }", "private static void makeDirPath(String targetAddr) {\n\t\tString parentPath = PathUtil.getImgBasePath() + targetAddr;\r\n\t\tFile dirPath = new File(parentPath);\r\n\t\tif (!dirPath.exists()) {\r\n\t\t\tdirPath.mkdirs();\r\n\t\t}\r\n\t}", "private void createDir(){\n\t\tPath path = Path.of(this.dir);\n\t\ttry {\n\t\t\tFiles.createDirectories(path);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void upload() {\r\n if (file != null) {\r\n try {\r\n String filepath = super.getUploadFolder() + \"/\" + file.getFileName();\r\n filepath = FileUtil.alternativeFilepathIfExists(filepath);\r\n FileUtil.createFile(filepath);\r\n\r\n file.write(filepath);\r\n super.info(\"Succesful\", file.getFileName() + \" is uploaded.\");\r\n\r\n Upload upload = new Upload();\r\n upload.setDescription(description);\r\n upload.setFilepath(filepath);\r\n upload.setTag(Md5Util.getMd5Sum(filepath));\r\n this.description = null;\r\n uploads.add(upload);\r\n // update ui and ready for save in db\r\n } catch (Exception e) {\r\n System.out.println(e);\r\n }\r\n }\r\n }", "private void checkCreateParentDirs(Path file) throws IOException {\n if (!Files.exists(file.getParent())) {\n Files.createDirectories(file.getParent());\n }\n }", "private static void createSaveDirIfNotExisting() {\n\t\tFile dir = new File(\"save\");\n\t\tif (!dir.exists()) {\n\t\t\t// directory does not exist => create!\n\t\t\tdir.mkdir();\n\t\t}\n\t}", "public void setUp() {\n new File(TEST_FILE).getParentFile().mkdirs();\n }", "void folderCreated(String remoteFolder);", "public void createTestDir() {\n\t\tworkDir = new File(System.getProperty(\"test.dir\", \"target\"));\n\t}", "private void createVideoFolder() {\n File movieFile = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MOVIES);\n mVideoFolder = new File(movieFile, \"Camera2_Video_Image\");\n //check to see if the folder is already created\n if (!mVideoFolder.exists()) {\n mVideoFolder.mkdirs();\n\n }\n\n }", "private void createDirectories()\r\n\t{\r\n\t\t// TODO: Do some checks here\r\n\t\tFile toCreate = new File(Lunar.OUT_DIR + Lunar.PIXEL_DIR\r\n\t\t\t\t\t\t\t\t\t+ Lunar.PROCESSED_DIR);\r\n\t\ttoCreate.mkdirs();\r\n\t\ttoCreate = null;\r\n\t\ttoCreate = new File(Lunar.OUT_DIR + Lunar.ROW_DIR + Lunar.PROCESSED_DIR);\r\n\t\ttoCreate.mkdirs();\r\n\t\ttoCreate = null;\r\n\t}", "public static void fixMediaDir() {\n String appDirectoryName = PICTURES;\n File imageRoot = new File(Environment.getExternalStoragePublicDirectory(\n Environment.DIRECTORY_PICTURES), appDirectoryName);\n imageRoot.mkdirs();\n }", "private void createFolder(String myFilesystemDirectory) {\n\r\n File file = new File(myFilesystemDirectory);\r\n try {\r\n if (!file.exists()) {\r\n //modified \r\n file.mkdirs();\r\n }\r\n } catch (SecurityException e) {\r\n Utilidades.escribeLog(\"Error al crear carpeta: \" + e.getMessage());\r\n }\r\n }", "private static void doCreateDir() {\n String newDir = \"new_dir\";\n boolean success = (new File(newDir)).mkdir();\n\n if (success) {\n System.out.println(\"Successfully created directory: \" + newDir);\n } else {\n System.out.println(\"Failed to create directory: \" + newDir);\n }\n\n // Create a directory; all non-existent ancestor directories are\n // automatically created.\n newDir = \"c:/export/home/jeffreyh/new_dir1/new_dir2/new_dir3\";\n success = (new File(newDir)).mkdirs();\n\n if (success) {\n System.out.println(\"Successfully created directory: \" + newDir);\n } else {\n System.out.println(\"Failed to create directory: \" + newDir);\n }\n\n }", "protected void deletePotentialUpload(String targetPath) {\n\t\tFileSystem fileSystem = Mesh.vertx().fileSystem();\n\t\tif (fileSystem.existsBlocking(targetPath)) {\n\t\t\t// Deleting of existing binary file\n\t\t\tfileSystem.deleteBlocking(targetPath);\n\t\t}\n\t\t// log.error(\"Error while attempting to delete target file {\" + targetPath + \"}\", error);\n\t\t// log.error(\"Unable to check existence of file at location {\" + targetPath + \"}\");\n\n\t}", "@BeforeClass(groups ={\"All\"})\n\tpublic void createFolder() {\n\t\tdciFunctions = new DCIFunctions();\n\t\ttry {\n\t\t\tif(suiteData.getSaasApp().equalsIgnoreCase(\"Salesforce\")){\n\t\t\t\tLogger.info(\"No need to create folder for salesforce\");\n\t\t\t}else{\n\t\t\t\tUserAccount account = dciFunctions.getUserAccount(suiteData);\n\t\t\t\tUniversalApi universalApi = dciFunctions.getUniversalApi(suiteData, account);\n\t\t\t\tfolderInfo = dciFunctions.createFolder(universalApi, suiteData, \n\t\t\t\t\t\tDCIConstants.DCI_FOLDER+uniqueId);\n\t\t\t}\n\t\t} catch (Exception ex) {\n\t\t\tLogger.info(\"Issue with Create Folder Operation \" + ex.getLocalizedMessage());\n\t\t}\n\t}", "@BeforeClass\n public static void createOutputDir() throws OfficeException {\n\n // Ensure we start with a fresh output directory\n final File outputDir = new File(OUTPUT_DIR);\n FileUtils.deleteQuietly(outputDir);\n outputDir.mkdirs();\n }", "Path fileToUpload();", "@Test\n public void testFileInDirectoryFileExists() {\n\n File file1 = new File(\"file1\");\n parent.storeFile(file1);\n assertTrue(parent.fileInDirectory(\"file1\"));\n }", "public boolean setupFileSystem() {\n\t\tboolean success = false;\n\t\tthis.root = Paths.get(\"\").toAbsolutePath();\n\t\tthis.showNamedMessage(\"Client root path set to: \" + this.root.toString());\n\t\t\n\t\tthis.fileStorage = root.resolve(fileStorageDirName);\n\t\tthis.showNamedMessage(\"File storage set to: \" + this.fileStorage.toString());\n\n\t\ttry {\n\t\t\tFiles.createDirectory(fileStorage);\n\t\t\tthis.showNamedMessage(\"File storage directory did not exist:\"\n\t\t\t\t\t+ \" created \" + fileStorageDirName + \" in client root\"); \n\t\t} catch (java.nio.file.FileAlreadyExistsException eExist) {\n\t\t\tthis.showNamedMessage(\"File storage directory already exist:\"\n\t\t\t\t\t+ \" not doing anything with \" + fileStorageDirName + \" in client root\");\n\t\t} catch (IOException e) {\n\t\t\tthis.showNamedError(\"Failed to create file storage:\"\n\t\t\t\t\t+ e.getLocalizedMessage());\n\t\t}\n\n\t\tsuccess = true;\n\t\treturn success;\n\t}", "@Override\r\n\tpublic boolean uploadFiles(InputStream is, String targetLocation, String fileName) throws FileSystemUtilException {\r\n\t\tthrow new FileSystemUtilException(\"000000\", null, Level.ERROR, null);\r\n\r\n\t}", "public boolean moveToFinalLocation() {\n\n if (tempFile==null)\n return false;\n\n if (RecDir==null || RecSubdir==null) {\n Log.getInstance().write(Log.LOGLEVEL_ERROR, \"RecordingEpisode.moveToFinalLocation: null Dir or SubDir = \" + RecDir + \":\" + RecSubdir);\n\n if (!tempFile.delete()) {\n Log.getInstance().write(Log.LOGLEVEL_WARN, \"RecordingEpisode.moveToFinalLocation: Failed to delete tempFile.\");\n }\n\n return false;\n }\n\n File DestPath = new File(RecDir + File.separator + RecSubdir);\n\n if (DestPath==null) {\n Log.getInstance().write(Log.LOGLEVEL_ERROR, \"RecordingEpisode.moveToFinalLocation: null DestPath = \" + RecDir + \":\" + RecSubdir);\n\n if (!tempFile.delete()) {\n Log.getInstance().write(Log.LOGLEVEL_WARN, \"RecordingEpisode.moveToFinalLocation: Failed to delete tempFile.\");\n }\n\n return false;\n }\n\n if (!DestPath.isDirectory()) {\n if (!DestPath.mkdir()) {\n Log.getInstance().write(Log.LOGLEVEL_ERROR, \"RecordingEpisode.moveToFinalLocation: Could not create directory \" + DestPath);\n\n if (!tempFile.delete()) {\n Log.getInstance().write(Log.LOGLEVEL_ERROR, \"RecordingEpisode.moveToFinalLocation: Failed to delete tempFile.\");\n }\n return false;\n }\n }\n\n NewFile = this.getUniqueFile();\n\n if (NewFile==null) {\n Log.getInstance().write(Log.LOGLEVEL_ERROR, \"RecordingEpisode.moveToFinalLocation: Could not create unique file.\");\n\n if (!tempFile.delete()) {\n Log.getInstance().write(Log.LOGLEVEL_WARN, \"RecordingEpisode.moveToFinalLocation: Failed to delete tempFile.\");\n }\n\n return false;\n }\n\n Log.getInstance().write(Log.LOGLEVEL_TRACE, \"RecordingEpisode.moveToFinalLocation: Moving = \" + tempFile.getAbsolutePath() + \"->\" + NewFile.getAbsolutePath());\n\n if (!tempFile.renameTo(NewFile)) {\n Log.getInstance().write(Log.LOGLEVEL_ERROR, \"RecordingEpisode.moveToFinalLocation: Moving failed.\");\n }\n\n if (!tempFile.delete()) {\n Log.getInstance().write(Log.LOGLEVEL_WARN, \"RecordingEpisode.moveToFinalLocation: Failed to delete tempFile.\");\n }\n\n return true;\n }", "@Test\n public void filesCreateTest() throws ApiException {\n String owner = null;\n String repo = null;\n FilesCreate data = null;\n PackageFileUpload response = api.filesCreate(owner, repo, data);\n\n // TODO: test validations\n }", "private boolean createGitletDirectory(){\n File dir = new File(Utils.GITLET_DIR);\n\n if(!dir.exists()){\n dir.mkdir();\n\n } else {\n System.out.println(\"A gitlet version-control system already exists in the current directory.\");\n return false;\n }\n\n File commitDir = Utils.join(Utils.GITLET_DIR, Utils.COMMIT_DIR);\n\n if(!commitDir.exists()){\n commitDir.mkdir();\n }\n\n File blobDir = Utils.join(Utils.GITLET_DIR, Utils.BLOBS_DIR);\n\n if (!blobDir.exists()){\n blobDir.mkdir();\n }\n return true;\n }", "public boolean createFolder(String path){\n\t\tValueCollection payload = new ValueCollection();\n\t\tpayload.put(\"path\", new StringPrimitive(path));\n\t\ttry {\t\n\t\t\tclient.invokeService(ThingworxEntityTypes.Things, FileThingName, \"CreateFolder\", payload, 5000);\n\t\t\tLOG.info(\"Folder {} created.\",path);\n\t\t} catch (Exception e) {\n\t\t\tLOG.error(\"Folder already exists. Error: {}\",e);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public static void initializeOutputFolder() {\n\t\tString default_folder = PropertiesFile.getInstance().getProperty(\"default_folder\");\n\t\t\n\t\t// The file has to exist and is a directory (Not just a child file)\n\t\tString fullQualifiedFolderName = getFullyQualifiedFileName(default_folder);\n\t\tFile defaultDir = new File(fullQualifiedFolderName);\n\t\tif (!checkFolder(fullQualifiedFolderName)) {\n\t\t\tboolean dirCreated = defaultDir.mkdir();\n\t\t\tif(dirCreated == false) {\n\t\t\t\tlog.error(\"Could not create generation folder\");\n\t\t\t}\n\t\t} else\n\t\t\tdeleteFolderRecursively(defaultDir);\n\t}", "@Override\n protected void setUp() throws Exception {\n baseDirectory = new File(TEST_DIR_NAME);\n assertTrue(ConnectorTestUtils.deleteAllFiles(baseDirectory));\n // Then recreate it empty\n assertTrue(baseDirectory.mkdirs());\n }", "private void checkDirectory(File directory) throws MojoExecutionException\n {\n if (!directory.exists())\n {\n if (!directory.mkdirs())\n {\n throw new MojoExecutionException(\n String.format(\"Failed to create directory '%s'\", directory));\n }\n }\n }", "Folder createFolder();", "@Override\n\tpublic void createFolder(String bucketName, String folderName) {\n\t\t\n\t}", "private FilePath ensureWorkspaceExists(WorkflowJob job) throws Exception {\n FilePath path = remote.getWorkspaceFor(job);\n path.mkdirs();\n return path;\n }", "@Override\n public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {\n if (!this.sourceDirectory.equals(dir)) {\n // Create this directory in the target and make it our current target.\n Path newDirectory = this.currentTargetDirectory.resolve(dir.getFileName());\n boolean didCreate = newDirectory.toFile().mkdir();\n Assert.assertTrue(didCreate);\n logger.output(\"Created directory: \" + newDirectory);\n this.currentTargetDirectory = newDirectory;\n }\n return FileVisitResult.CONTINUE;\n }", "@Override\n public void execute() {\n\n if(!isValid){\n System.out.println(invalidReasonString);\n return;\n }\n\n\n Path filteredFilesRoot = Path.of(pathToDir,filteredFilesRootDirectory);\n\n try {\n\n if (Files.exists(filteredFilesRoot) && Files.isDirectory(filteredFilesRoot)){\n emptyDirectory(filteredFilesRoot.toFile());\n Files.delete(filteredFilesRoot);\n } else if (Files.isRegularFile(filteredFilesRoot)){\n Files.delete(filteredFilesRoot);\n }\n\n Files.createDirectory(filteredFilesRoot);\n\n List<Path> filteredFiles = PostProcessor.filterRootDirectory(pathToDir,maxFileSize,keywords);\n\n copyFiles(filteredFilesRoot,filteredFiles);\n\n } catch (IOException e) {\n e.printStackTrace();\n System.out.println(e.getMessage());\n }\n\n }", "public static void insurePathToFileExists(File f) {\r\n File p = f.getParentFile();\r\n //System.out.println(\"uu.iPE: parent of \"+filename+\" is \"+parent);\r\n\r\n if (!p.exists()) {\r\n // parent doesn't exist, create it:\r\n if (!p.mkdirs()) {\r\n throw new IllegalStateException(\"Unable to make directory \" + p.getPath());\r\n } // endif -- second mkdir unsuc\r\n } // endif -- parent exists\r\n }", "private void prepareFolder(String name, String newFolderName) {\n }", "abstract File getTargetDirectory();", "public Long createFileUpload(FileUpload fileUpload, InputStream fileInputStream) throws AppException;", "@Override\n public void createDirectory(File storageName) throws IOException {\n }", "@SuppressWarnings(\"unused\")\n\tpublic boolean renameFolder(final File source,\n\t\t\t\t\t\t\t\tfinal File target)\n\t\t\tthrows WritePermissionException\n\t{\n\t\t// First try the normal rename.\n\t\tif (source.renameTo(target)) {\n\t\t\treturn true;\n\t\t}\n\t\tif (target.exists()) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Try the Storage Access Framework if it is just a rename within the same parent folder.\n\t\tif (Util.hasLollipop() && source.getParent().equals(target.getParent())) {\n\t\t\tUsefulDocumentFile document = getDocumentFile(source, true, true);\n\t\t\tif (document == null)\n\t\t\t\treturn false;\n\t\t\tif (document.renameTo(target.getName())) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t// Try the manual way, moving files individually.\n\t\tif (!mkdir(target)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tFile[] sourceFiles = source.listFiles();\n\n\t\tif (sourceFiles == null) {\n\t\t\treturn true;\n\t\t}\n\n\t\tfor (File sourceFile : sourceFiles) {\n\t\t\tString fileName = sourceFile.getName();\n\t\t\tFile targetFile = new File(target, fileName);\n\t\t\tif (!copyFile(sourceFile, targetFile)) {\n\t\t\t\t// stop on first error\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t// Only after successfully copying all files, delete files on source folder.\n\t\tfor (File sourceFile : sourceFiles) {\n\t\t\tif (!deleteFile(sourceFile)) {\n\t\t\t\t// stop on first error\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "@BeforeAll\n public static void setUp() throws IOException {\n Files.createDirectories(Paths.get(targetPath));\n }", "@Override\r\n\tpublic boolean createFolder(String filePath) throws FileSystemUtilException {\r\n\t\ttry{\r\n\t\t\tString userHome = getUserHome();\r\n\t\t\t//if given file path doesnot start with user home\r\n\t\t\tif(filePath == null && filePath.trim().length() < 1 && !filePath.startsWith(userHome)){\r\n\t\t\t\tthrow new FileSystemUtilException(\"EL0701\");\r\n\t\t\t}\r\n\t\t\tconnect();\r\n\t\t\tString mkDirCmd = \"mkdir -p \"+filePath;\t\t\t\r\n\t\t\tint x = executeSimpleCommand(mkDirCmd);\r\n\t\t\tif(x!=0)\r\n\t\t\t{\r\n\t\t\t\tlogger.info(\"Folder creation failed, may be file path is not correct or privileges are not there\");\r\n\t\t\t\tthrow new FileSystemUtilException(\"EL0699\");\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}catch(FileSystemUtilException e)\r\n\t\t{\r\n\t\t disconnect();\r\n\t\t\tthrow new FileSystemUtilException(e.getErrorCode(),e.getException());\r\n\t\t}catch(Exception e)\r\n\t\t{\r\n\t\t\tthrow new FileSystemUtilException(\"F00002\",e);\r\n\t\t}\r\n\r\n\t}", "@Test\n\tpublic void Directories() {\n\t\t\n\t\tString dirs = \"test/one/two/\";\n\t\tFile d = new File(dirs);\n\t\td.mkdirs();\n\t\tAssert.assertTrue(d.exists());\n\t\t\n\t\t//Cleanup\n\t\tif(d.delete()) {\n\t\t\td = new File(\"test/one\");\n\t\t\tif(d.delete()) {\n\t\t\t\td = new File(\"test\");\n\t\t\t\td.delete();\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public File createNewFolder(File paramFile) throws IOException {\n/* 803 */ if (paramFile == null) {\n/* 804 */ throw new IOException(\"Containing directory is null:\");\n/* */ }\n/* */ \n/* 807 */ File file = createFileObject(paramFile, newFolderString);\n/* */ \n/* 809 */ if (file.exists()) {\n/* 810 */ throw new IOException(\"Directory already exists:\" + file.getAbsolutePath());\n/* */ }\n/* 812 */ file.mkdirs();\n/* */ \n/* */ \n/* 815 */ return file;\n/* */ }", "@Override\n\tprotected String getUploadFolder()\n\t{\n\t\treturn null;\n\t}", "public File createContainingDir(File basedir) {\n String dirname = FileUtils.toSafeFileName(_url.getHost()+\"_\"+_layerName);\n File dir = new File(basedir, dirname );\n \n for(int i=1; dir.exists(); i++){\n dir = new File(basedir, dirname+\"_\"+i);\n }\n return dir;\n }", "public boolean make() {\n File file = new File(parent);\n if(!file.exists())\n return file.mkdirs();\n return true;\n }", "protected void validateFile() {\r\n\t\tFile f = new File(FileUltil.joinPath(dOutputFolder, dFileName));\r\n\t\tif (f.exists() && !f.isDirectory()) {\r\n\t\t\tdFileName = \"Copy of \" + dFileName;\r\n\t\t\tvalidateFile();\r\n\t\t}\r\n\t}", "@Test\n\tpublic void createFolderAsAuditorTest() {\n\t\tauthenticate(\"agent2\");\n\t\tint principalId = actorService.findByPrincipal().getId();\n\t\tint numFoldersNow = folderService.findFoldersOfActor(principalId).size();\n\t\tFolderForm folderFormAux = new FolderForm();\n\t\tfolderFormAux.setName(\"New Agent2 Folder for testing its creation\");\n\t\tFolder folder = folderService.reconstruct(folderFormAux,0);\n\t\tfolderService.save(folder);\n\t\tint numFoldersExpected = folderService.findFoldersOfActor(principalId).size();\n\t\tunauthenticate();\t\n\t\t\n\t\tAssert.isTrue(numFoldersNow + 1 == numFoldersExpected);\n\t}", "@Test(timeout = SWIFT_TEST_TIMEOUT)\n public void testRenameDirToSelf() throws Throwable {\n assumeRenameSupported();\n Path parentdir = path(\"/test/parentdir\");\n fs.mkdirs(parentdir);\n Path child = new Path(parentdir, \"child\");\n createFile(child);\n\n rename(parentdir, parentdir, false, true, true);\n //verify the child is still there\n assertIsFile(child);\n }", "@Override\n\tpublic void handle() {\n\t\tPath p = Paths.get(pathName);\n\t\tFile file = null;\n\t\tString path = null;\n\n\t\tif (p.isAbsolute()) {\n\t\t\tpath = pathName;\n\t\t\tfile = new File(path);\n\t\t} else {\n\t\t\tpath = clientFtp.getCurrentDirectory() + \"/\" + pathName;\n\t\t\tfile = new File(path);\n\t\t}\n\t\t// Check if the client doesn't try to create a directory outside the root\n\t\t// directory\n\t\tif (path.contains(ServerFtp.home)) {\n\t\t\tif (file.exists()) {\n\t\t\t\tclientFtp.sendMessage(String.format(Response.MKD_NOK_EXIST, path));\n\t\t\t} else {\n\t\t\t\t// Creating the directory\n\t\t\t\tboolean bool = file.mkdir();\n\t\t\t\tif (bool) {\n\t\t\t\t\tclientFtp.sendMessage(String.format(Response.MKD_OK, path));\n\t\t\t\t} else {\n\t\t\t\t\tclientFtp.sendMessage(Response.FILE_NOT_FOUND);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tclientFtp.sendMessage(Response.FILE_NOT_FOUND);\n\t\t}\n\t}", "public static boolean createDirIfNotExists(SourceFile sourceFile) throws IOException {\n return createDirIfNotExists(sourceFile.getPath(), sourceFile.getSourceType());\n }", "protected void createDirectory(Path path, Path destPath) {\n String rootLocation = destPath.toString();\n int index;\n if(firstTime) {\n firstTime = false;\n index = path.toFile().getPath().lastIndexOf(\"\\\\\")+1;//index where cur directory name starts\n rootFolder = path.toFile().getPath().substring(index);\n }\n else {\n index = path.toFile().getPath().indexOf(rootFolder);\n }\n\n String folderName= path.toFile().getPath().substring(index);\n Path newDirPath = Paths.get(rootLocation + DOUBLE_BKW_SLASH +folderName);\n try {\n Path newDir = Files.createDirectory(newDirPath);\n } catch(FileAlreadyExistsException e){\n // the directory already exists.\n e.printStackTrace();\n } catch (IOException e) {\n //something else went wrong\n e.printStackTrace();\n }\n }", "static boolean uploadIfNecessary(Configuration conf)\n throws IOException {\n String local = conf.get(LOCAL_INPUT);\n if (local == null) {\n return false;\n }\n FileSystem fs = FileSystem.get(conf);\n String current = new File(\"\").getAbsolutePath();\n Path sourcePath = new Path(current, local);\n Path destPath = getOutputPath(conf, \"input\");\n fs.copyFromLocalFile(false, true, sourcePath, destPath);\n conf.set(MRUtils.INPUT_PATH, destPath.toString());\n return true;\n }", "private void ensureFile(File destFile) {\n\t\tif (destFile.exists()) {\n\t\t\tLog.i(\"[\" + destFile.getName() + \"]\"\n\t\t\t\t\t+ \" has already exsited, previous content cleared\");\n\t\t}\n\n\t\ttry {\n\t\t\tdestFile.createNewFile();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void createFolder(String remotepath){\n String path = rootremotepath+remotepath;\n try {\n sardine.createDirectory(path);\n } catch (IOException e) {\n throw new NextcloudApiException(e);\n }\n }", "public boolean create(boolean isFile) {\n\t\t\n\t\tboolean result = false;\n\t\t\n\t\tif(!isFile)\n\t\t{\n\t\t\tFile temp = new File(this.path);\n\t\t\ttemp.mkdirs();\n\t\t\tresult = true;\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\tFile temp = new File(this.path);\n\t\t\tString folderContainingFile = \"/\";\n\t\t\t\n\t\t\tfor(int i = 0; i <= this.lenght - 2; i++)\n\t\t\t{\n\t\t\t\tfolderContainingFile += this.get(i) + \"/\";\n\t\t\t}\n\t\t\t\n\t\t\tnew File(folderContainingFile).mkdirs();\n\t\t\t\n\t\t\ttry {\n\t\t\t\ttemp.createNewFile();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tresult = true;\n\t\t}\n\t\t\n\t\treturn result;\n\t}", "abstract void addNewSourceDirectory(final File targetDirectory);", "private File createTempFolder(String osBasePath, String prefix, String suffix) {\n File baseTempFolder = getTempFolder(osBasePath);\n if (!baseTempFolder.isDirectory()) {\n if (baseTempFolder.isFile()) {\n deleteFileOrFolder(baseTempFolder);\n }\n if (!baseTempFolder.mkdirs()) {\n return null;\n }\n }\n for (int i = 1; i < 100; i++) {\n File folder = new File(baseTempFolder, String.format(\"%1$s.%2$s%3$02d\", prefix, suffix, i));\n if (!folder.exists()) {\n return folder;\n }\n }\n return null;\n }", "@Test\n\tpublic void removeUnneededDirectory() throws IOException {\n\t\tfinal Path targetDir = _temp.toPath().resolve(\"target\");\n\t\tfinal Path fsTargetDir = targetDir.resolve(DIR_FIRSTSPIRIT_5);\n\t\tfinal Path installerTar = new File(getClass().getResource(TEST_INSTALLER_TAR_GZ).getFile()).toPath();\n\t\tServerInstaller.decompressInstaller(targetDir, installerTar);\n\t\tassertTrue(fsTargetDir.toFile().exists(), DIR_FIRSTSPIRIT_5 + \" dir should exist\");\n\n\t\t// test\n\t\tServerInstaller.removeUnneededDirectory(targetDir);\n\n\t\t// verify\n\t\tassertFalse(fsTargetDir.toFile().exists(), DIR_FIRSTSPIRIT_5 + \" dir should have been deleted\");\n\t}", "@Override\n public synchronized boolean create(Path file)\n {\n File f = file.toFile(root);\n if (file.isRoot()) {\n return false;\n }\n File parent = file.parent().toFile(root);\n parent.mkdirs();\n\n try {\n return f.createNewFile();\n } catch (IOException e) {\n \te.printStackTrace();\n return false;\n }\n }", "@Override\n public String saveFile(MultipartFile file, String rootDirectory ) {\n String path = null;\n try {\n if (file != null && !file.isEmpty()) {\n java.util.Date date = new java.util.Date();\n int i = (int) (date.getTime() / 1000);\n String extention = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(\".\")+1);\n String fileName =file.getOriginalFilename().substring(0, file.getOriginalFilename().lastIndexOf(\".\"));\n path = rootDirectory + fileName + \"-\" + i + \".\"+ extention;\n\n File finalFilePath = new File(path);\n //create all path directories if not exist\n finalFilePath.getParentFile().mkdirs();\n file.transferTo(new File(path));\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n return path;\n }", "@Override\n protected void createRootDir() {\n }", "@Test(timeout = SWIFT_TEST_TIMEOUT)\n public void testRenameChildDirForbidden() throws Exception {\n assumeRenameSupported();\n\n Path parentdir = path(\"/test/parentdir\");\n fs.mkdirs(parentdir);\n Path childFile = new Path(parentdir, \"childfile\");\n createFile(childFile);\n //verify one level down\n Path childdir = new Path(parentdir, \"childdir\");\n rename(parentdir, childdir, false, true, false);\n //now another level\n fs.mkdirs(childdir);\n Path childchilddir = new Path(childdir, \"childdir\");\n rename(parentdir, childchilddir, false, true, false);\n }", "private void createRequiredDirectory(String outdir, String className) throws IOException\r\n\t{\n\t\tString workingdirectory = System.getProperty(\"user.dir\");\r\n\t\t\r\n\t\t//used to create directory\r\n\t\tscreenshotDir = new File(workingdirectory +\"/custom-test-report\");\r\n\t\tscreenshotDir.mkdir();\r\n\t\t\r\n\t\tscreenshotDir = new File(workingdirectory +\"/custom-test-report/Failure_Screenshot\");\r\n\t\tscreenshotDir.mkdir();\r\n\t\t\r\n\t\tscreenshotDir = new File(workingdirectory + \"/custom-test-report\" + \"/\" + className);\r\n\t\tscreenshotDir.mkdir();\r\n\t}", "private static void createDir(File f) {\n int limit = 10;\n while (!f.exists()) {\n if (!f.mkdir()) {\n createDir(f.getParentFile());\n }\n limit --;\n if(limit < 1) {\n break;\n }\n }\n if (limit == 0) {\n }\n }", "private final void directory() {\n\t\tif (!this.plugin.getDataFolder().isDirectory()) {\n\t\t\tif (!this.plugin.getDataFolder().mkdirs()) {\n\t\t\t\tMain.SEVERE(\"Failed to create directory\");\n\t\t\t} else {\n\t\t\t\tMain.INFO(\"Created directory sucessfully!\");\n\t\t\t}\n\t\t}\n\t}", "private void createFolderHelper(final IFolder folder,final IProgressMonitor monitor)\n throws CoreException\n {\n if(!folder.exists())\n {\n IContainer parent = folder.getParent();\n if(parent instanceof IFolder\n && (!((IFolder)parent).exists())) {\n createFolderHelper((IFolder)parent,monitor);\n }\n folder.create(false,true,monitor);\n }\n }", "@Override\n public void stageForCache_destination_exists() throws Exception {\n assumeTrue( !isWindows() );\n super.stageForCache_destination_exists();\n }", "private String initialFileSetup(String file_path, String user_id) {\n\n String[] path_components = file_path.split(\"/\");\n String desired_filename = path_components[path_components.length - 1];\n String absolute_path = new File(\"\").getAbsolutePath();\n absolute_path = absolute_path.concat(\"/Final\");\n new File(absolute_path).mkdirs();\n absolute_path = absolute_path.concat(\"/Pause\");\n new File(absolute_path).mkdirs();\n\n absolute_path = absolute_path.concat(\"/\".concat(user_id));\n new File(absolute_path).mkdirs();\n\n absolute_path = absolute_path.concat(\"/Pause_\".concat(desired_filename));\n\n return absolute_path;\n }", "File getTargetDirectory();", "private void initializeTargetDirectory()\n {\n if ( isFtpEnabled() )\n initializeRemoteTargetDirectory();\n else\n initializeLocalTargetDirectory(); \n }", "public static void checkDirectory(File appmobicache) {\n \tFile[] files = appmobicache.listFiles();\n \tif(files.length==1 && files[0].isDirectory() && new File(files[0].getAbsolutePath(), \"index.html\").exists()) {\n \t\tFile nestedDirectory = files[0];\n \t\t//move the nested directory to temp\n \t\tFile parent = nestedDirectory.getParentFile();\n \t\tFile temp = new File(parent, \"../temp\");\n \t\tnestedDirectory.renameTo(temp);\n \t\tfiles = temp.listFiles();\n \t\tfor(int i=0;i<files.length;i++) {\n \t\t\tFile source = files[i];\n \t\t\tString name = source.getName();\n \t\t\tFile dest = new File(appmobicache, name);\n \t\t\tsource.renameTo(dest);\n \t\t}\n \t\ttemp.delete();\n \t}\n\t}", "@Test\n public void testNewFolder() {\n boolean result = instance.newFolder(mailboxID + File.separator + \"newFolder\");\n assertEquals(true, result);\n }", "public void createDir(File file){\n\t\tif (!file.exists()) {\n\t\t\tif (file.mkdir()) {\n\t\t\t\tlogger.debug(\"Directory is created!\");\n\t\t\t} else {\n\t\t\t\tlogger.debug(\"Failed to create directory!\");\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.6207637", "0.61692244", "0.60718423", "0.6048305", "0.59793884", "0.59686595", "0.5920112", "0.58985716", "0.58260447", "0.5764579", "0.56772673", "0.566933", "0.56262344", "0.5615472", "0.5589455", "0.55725276", "0.5567756", "0.5560508", "0.5557556", "0.55434096", "0.5540332", "0.54898494", "0.5469794", "0.54653215", "0.54444385", "0.5443328", "0.54407525", "0.54270434", "0.541494", "0.53933954", "0.53781754", "0.5365759", "0.5357125", "0.53569126", "0.5351491", "0.53499323", "0.5348538", "0.5347371", "0.5342844", "0.53314465", "0.5309491", "0.5302483", "0.52963805", "0.529531", "0.5286962", "0.52796453", "0.5277306", "0.5276376", "0.52716845", "0.5270069", "0.5266492", "0.5266069", "0.5256599", "0.5219736", "0.52110004", "0.52097374", "0.52088636", "0.5202653", "0.51899374", "0.5180837", "0.5180275", "0.51772743", "0.51737756", "0.5170575", "0.5165433", "0.51621693", "0.51620895", "0.5160031", "0.5155743", "0.51501626", "0.5142326", "0.51403356", "0.5131507", "0.5130123", "0.51286525", "0.5127324", "0.5108862", "0.51009524", "0.50979155", "0.5097894", "0.50974274", "0.5091961", "0.5087448", "0.5080664", "0.5078862", "0.50784713", "0.5078059", "0.5067239", "0.5065627", "0.5062671", "0.5055222", "0.5051656", "0.5051133", "0.5046603", "0.50460964", "0.5040237", "0.503988", "0.5038091", "0.5036344", "0.50347924" ]
0.6983215
0
Convert the given object to string with each line indented by 4 spaces (except the first line).
private String toIndentedString(Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String toIndentedString(Object object) {\n if (object == null) {\n return EndpointCentralConstants.NULL_STRING;\n }\n return object.toString().replace(EndpointCentralConstants.LINE_BREAK,\n EndpointCentralConstants.LINE_BREAK + EndpointCentralConstants.TAB_SPACES);\n }", "private String toIndentedString(Object o)\n/* */ {\n/* 128 */ if (o == null) {\n/* 129 */ return \"null\";\n/* */ }\n/* 131 */ return o.toString().replace(\"\\n\", \"\\n \");\n/* */ }", "private String toIndentedString( Object o )\n {\n if ( o == null )\n {\n return \"null\";\n }\n return o.toString().replace( \"\\n\", \"\\n \" );\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }", "private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }" ]
[ "0.7885466", "0.75500387", "0.7497769", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904", "0.74621904" ]
0.0
-1
separatecomp String startTime = "1355296757695"; //dist String startTime = "1355603001518"; //multicomp
long time() { return System.currentTimeMillis(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 a[]) throws InterruptedException {\n System.out.println(PiDigits.getDigits(1, 1000000, 500));\n// long end3 = System.nanoTime();\n// System.out.println(\"parallel code took :\"+(double)(end3-start3)/1e9 +\" seconds\");\n//\t\tString s1 = new String(bytesToHex(PiDigits.getDigits(1, 100)));\n// \tString s2 = new String(PiDigits.getDigits(1, 100, 1));\n// System.out.println(s1.equals(s2));\n\t}", "public static void main(String[] args) {\n String num1 = \"256117489511377083148593685533950561400363410418754703282767252221661609163404299\";\n String num2 = \"61200496111643709081218550902198211480012378840070191147459688611759881218205422431757614\";\n// String num1 = \"29476\";\n// String num2 = \"919\";\n MultiplyStringsSolution solution = new MultiplyStringsSolution();\n long a = System.currentTimeMillis();\n System.out.println(solution.multiply(num1, num2));\n long b = System.currentTimeMillis();\n System.out.println(b - a);\n System.out.println(solution.multiply2(num1, num2));\n long c = System.currentTimeMillis();\n System.out.println(c - b);\n System.out.println(solution.multiply3(num1, num2));\n long d = System.currentTimeMillis();\n System.out.println(d - c);\n System.out.println(solution.multiply4(num1, num2));\n long e = System.currentTimeMillis();\n System.out.println(e - d);\n }", "private void parseCPUSpeedTimes(){\n\t\tString str = parser.readFile(SYS_CPU_SPEED_STEPS, 512);\n\t\tif(str == null)\n\t\t\treturn;\n\t\t\n\t\tString[] vals;\n\t\tint index = 0;\n\t\tlong time;\n\t\t\n\t\tfor(String token : str.split(\"\\n\")){\n\t\t\tif(str.trim().length() == 0) continue;\n\t\t\ttry{\n\t\t\t\tvals = token.split(\" \");\n\t\t\t\ttime = Long.valueOf(vals[1]);\n\t\t\t\tmRelCpuSpeedTimes[index] = time - mBaseCpuSpeedTimes[index];\n\t\t\t\tmBaseCpuSpeedTimes[index] = time;\n\t\t\t}catch (NumberFormatException nfe){\n\t\t\t\tnfe.printStackTrace();\n\t\t\t}finally{\n\t\t\t\tindex++;\n\t\t\t}\n\t\t}\n\t}", "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 static void concurrency() {\n List<String> words = new ArrayList<>();\n for (int i = 0; i < 500000; i++)\n words.add(UUID.randomUUID().toString());\n\n //Groups the list into a map of strings by length in serial\n long t2s = System.nanoTime();\n Map<Integer, List<String>> a = words.stream()\n .collect(Collectors.groupingBy(String::length));\n long t2d = System.nanoTime() - t2s;\n\n //Groups the list into a map of strings by length in parallel\n long t1s = System.nanoTime();\n ConcurrentMap<Integer, List<String>> b = words.parallelStream()\n .collect(Collectors.groupingByConcurrent(String::length));\n long t1d = System.nanoTime() - t1s;\n\n System.out.println(\"Collect Serial time : \" + t2d);\n System.out.println(\"Collect Parallel time : \" + t1d);\n }", "public final synchronized void mo12514a(String str) {\n long j;\n this.f5341c = true;\n if (this.f5340b.size() == 0) {\n j = 0;\n } else {\n j = this.f5340b.get(this.f5340b.size() - 1).f5362c - this.f5340b.get(0).f5362c;\n }\n if (j > 0) {\n long j2 = this.f5340b.get(0).f5362c;\n C1264ee.m6817b(\"(%-4d ms) %s\", Long.valueOf(j), str);\n for (C1290fc next : this.f5340b) {\n long j3 = next.f5362c;\n C1264ee.m6817b(\"(+%-4d) [%2d] %s\", Long.valueOf(j3 - j2), Long.valueOf(next.f5361b), next.f5360a);\n j2 = j3;\n }\n }\n }", "long getTimeSpoutBoltA();", "public static void main(String args[])\n\t{\n\t\tRandom r = new Random();\n\t\tint low = 1;\n\t\tint high = 3;\n\n\t\tfor (int i=0; i<serverMsg.length ; i++)\n\t\t{\n\t\t\tclientMsg[i] = r.nextInt(high-low) + low;//generate random int between high and low\n\t\t\tserverMsg[i] = r.nextInt(high-low) + low;\n\n\t\t}\n\n\t\tFile file = new File(\"key.dgk\");\n\t\t//key = Damgard.CreateKey(160,20,1024), message space is 2^160 key size is 1024 bits\n\t\t//Damgard.saveKeyToFile(file, key);\n\t\tkey = Damgard.loadKeyFromFile(file);\n\t\tdouble clientTotalTime = 0;\n\t\tdouble serverTotalTime = 0;\n\t\tfor(int i=0;i<100;i++){\n\t\tif(getTimes){\n\t\t\tlong clientStart = System.nanoTime();\n\t\tclient();\n\t\tlong clientEnd = System.nanoTime(); \n\t\tdouble clientTime = (clientEnd-clientStart)/1000000000.0;\n\t\tclientTotalTime += clientTime;\n\t\tlong serverStart = System.nanoTime();\n\t\tserver();\n\t\tlong serverEnd = System.nanoTime();\n\t\tdouble serverTime = (serverEnd - serverStart)/1000000000.0;\n\t\tserverTotalTime += serverTime;\n\n\t\t}\n\t}\n\t\tif(!getTimes)\n\t\t{\n\t\tclient();\n\t\tclientDecrypt(server());\n\t\t}\n\n\t\t\n\n\t\ts\n\t\tif(getTimes)\n\t\t{\t\n\t\tSystem.out.println(\"Client Compute time for 100 runs on \" + size + \" elements is: \" + clientTotalTime);\n\t\tSystem.out.println(\"Server Compute time for 100 runs on \" + size + \" elements is: \"+ serverTotalTime);\n\t\t}\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 }", "@Override\r\n\tpublic float getSimilarityTimingEstimated(final String string1, final String string2) {\r\n //timed millisecond times with string lengths from 1 + 50 each increment\r\n //0\t5.97\t11.94\t27.38\t50.75\t73\t109.5\t148\t195.5\t250\t297\t375\t437\t500\t594\t672\t781\t875\t969\t1079\t1218\t1360\t1469\t1609\t1750\t1906\t2063\t2203\t2375\t2563\t2734\t2906\t3110\t3312\t3500\t3688\t3906\t4141\t4375\t4594\t4844\t5094\t5328\t5609\t5860\t6156\t6422\t6688\t6984\t7235\t7547\t7859\t8157\t8500\t8813\t9172\t9484\t9766\t10125\t10516\r\n final float str1Tokens = this.tokeniser.tokenizeToArrayList(string1).size();\r\n final float str2Tokens = this.tokeniser.tokenizeToArrayList(string2).size();\r\n return (((str1Tokens + str2Tokens) * str1Tokens) + ((str1Tokens + str2Tokens) * str2Tokens)) * this.ESTIMATEDTIMINGCONST;\r\n }", "int getCPU_time();", "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}", "public static void main(String[] args) {\n\n\n BasicProducer basicProducer = new BasicProducer(\"3-part-topic\");\n long t0 = System.currentTimeMillis();\n basicProducer.postSynchMessage(\"Synched 8 Message\");\n long t1 = System.currentTimeMillis();\n System.out.println(\"time taken basicProducer.postSynchMessage=\" + (t1-t0)); // 192 // 193\n\n long t2 = System.currentTimeMillis();\n basicProducer.postAsynchMessage(\"async 8 Message\");\n long t3 = System.currentTimeMillis();\n System.out.println(\"time taken basicProducer.postSynchMessage=\" + (t3-t2)); //14\n\n\n }", "public static void main(String[] args) {\n long N = 10000;\n long start = System.nanoTime();\n /* == begin task == */\n Pair<Double,Double> results = computePI(N, 1001L);\n /* == end task == */\n System.out.println(\"pi: \" + results);\n long end = System.nanoTime();\n long timeNano = end - start;\n long duration = timeNano / 1000_000;\n System.out.println(\"=======================================\");\n System.out.println(\"Duration (milli-sec): \"+ Format.longToString(duration));\n\n\n// ThreadGroup tg = new ThreadGroup(\"main\");\n// System.out.println(Runtime.getRuntime().availableProcessors());\n }", "public static void main(String[] args) {\n\t\tThread thread1=new Thread(new Runnable(){\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void run() {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\tlong start=System.currentTimeMillis();\r\n\t\t\t\tHashSetAdd hsd=new HashSetAdd();\r\n\t\t\t\tHashSet<String> hs1=hsd.add();\r\n\t\t\t\tSystem.out.println(\"size1=:\"+hs1.size());\r\n\t\t\t\tfor(String result:hs1){\r\n\t\t\t\t\tresult.toString();\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tlong end=System.currentTimeMillis();\r\n\t\t\t\tSystem.out.println(\"time1=: \"+(end-start));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t\tThread thread2=new Thread(new Runnable(){\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void run() {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\tlong start=System.currentTimeMillis();\r\n\t\t\t\tHashSetAdd hsd=new HashSetAdd();\r\n\t\t\t\tHashSet<String> hs2=hsd.add();\r\n\t\t\t\tSystem.out.println(\"size2=:\"+hs2.size());\r\n\t\t\t\tIterator<String> iter = hs2.iterator();\r\n\t\t\t\twhile(iter.hasNext()){\r\n\t\t\t\t String result = iter.next();\r\n\t\t\t\t }\r\n\t\t\t\t\r\n\t\t\t\tlong end=System.currentTimeMillis();\r\n\t\t\t\tSystem.out.println(\"time2=: \"+(end-start));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t\tthread1.start();\r\n\t\tthread2.start();\r\n\r\n\t\r\n\t}", "public static void main(String[] args) {\n\n String time =\"16:49:40\".substring(0,2);\n System.out.println(time);\n\n }", "public static int compareTime(String time1, String time2)\r\n/* 83: */ {\r\n/* 84:110 */ String[] timeArr1 = (String[])null;\r\n/* 85:111 */ String[] timeArr2 = (String[])null;\r\n/* 86:112 */ timeArr1 = time1.split(\":\");\r\n/* 87:113 */ timeArr2 = time2.split(\":\");\r\n/* 88:114 */ int minute1 = Integer.valueOf(timeArr1[0]).intValue() * 60 + \r\n/* 89:115 */ Integer.valueOf(timeArr1[1]).intValue();\r\n/* 90:116 */ int minute2 = Integer.valueOf(timeArr2[0]).intValue() * 60 + \r\n/* 91:117 */ Integer.valueOf(timeArr2[1]).intValue();\r\n/* 92:118 */ return minute1 - minute2;\r\n/* 93: */ }", "static String timeCount_1(List<String> Arr){\n int timeHH = 0;\n int timeMI = 0;\n int timeSS = 0;\n \n String r_hh = \"\";\n String r_mi = \"\";\n String r_ss = \"\";\n\n for(int i = 0; i < Arr.size(); i++ ){\n \n if (Pattern.matches(\"\\\\d{2}:\\\\d{2}:\\\\d{2}\", Arr.get(i))){\n \n String[] s = Arr.get(i).split(\":\");\n int hh = Integer.parseInt(s[0]);\n int mi = Integer.parseInt(s[1]);\n int ss = Integer.parseInt(s[2]);\n \n timeHH += hh;\n timeMI += mi;\n timeSS += ss;\n \n }\n else{\n continue;\n }\n }\n \n timeMI += timeSS / 60;\n timeSS %= 60;\n \n timeHH += timeMI / 60;\n timeMI %= 60; \n\n \n if (timeHH < 10){\n r_hh = \"0\" + timeHH;\n }\n else{\n r_hh = Integer.toString(timeHH);\n }\n \n if (timeMI < 10){\n r_mi = \"0\" + timeMI;\n }\n else{\n r_mi = Integer.toString(timeMI);\n }\n \n if (timeSS < 10){\n r_ss = \"0\" + timeSS;\n }\n else{\n r_ss = Integer.toString(timeSS);\n }\n \n \n \n String result = r_hh + \":\" + r_mi + \":\" + r_ss;\n //String result = timeHH + \":\" + timeMI + \":\" + timeSS;\n \n return result;\n }", "public static void main(String[] args)\r\n\t{\n\t\tQueuingNetworkOld qn = new QueuingNetworkOld(250000);\r\n\t\tqn.simulate();\r\n\t\t\r\n\t\tfor(int i=0; i<10; i++)\r\n\t\t{\r\n\t\t\t//System.out.println(qn.CPUServiceTime());\r\n\t\t\t//sum += (qn.NetworkServiceTime());\r\n\t\t\t//System.out.println(qn.DiskDepartProb());\r\n\t\t}\r\n\t\t//System.out.println(sum/1000.0);\r\n\t\t\r\n\t\t \r\n\t}", "public static void fcfs(List<String> taskList) {\n\n Collections.sort(taskList, new Comparator<String>() {\n @Override\n public int compare(String task1, String task2) {\n int arrivalTime1 = Integer.parseInt(task1.split(\" \")[1]);\n int arrivalTime2 = Integer.parseInt(task2.split(\" \")[1]);\n\n if(arrivalTime1 < arrivalTime2) {\n return -1;\n } else if(arrivalTime1 > arrivalTime2) {\n return 1;\n } else {\n return 0;\n }\n }\n });\n // \"TaskName arTime priority burstTime compTime\"\n //\n int i = 0;\n\n double totalTurnaround = 0;\n double totalWaitingTime = 0;\n\n for(String task : taskList) {\n\n String[] taskArray = new String[5];\n int j = 0;\n for(String str : task.split(\" \")) {\n taskArray[j] = str;\n j++;\n }\n //write task to a file\n try {\n FileWriter myWriter = new FileWriter(\"output.txt\", true);\n myWriter.write(\"Will run Name: \" + taskArray[0] + \"\\n\");\n myWriter.write(\"Priority: \" + taskArray[2] + \"\\n\");\n myWriter.write(\"Burst: \" + taskArray[3] + \"\\n\\n\");\n myWriter.write(\"Finished \" + taskArray[0] + \"\\n\\n\");\n myWriter.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n int arivalTime = Integer.parseInt(taskArray[1]);\n int burstTime = Integer.parseInt(taskArray[3]);\n if(i==0) {\n //completion time\n taskArray[4] = Integer.toString(arivalTime + burstTime);\n } else {\n int prevCompTime = Integer.parseInt(taskList.get(i-1).split(\" \")[4]);\n if(arivalTime > prevCompTime) {\n taskArray[4] = Integer.toString(arivalTime + burstTime);\n } else {\n taskArray[4] = Integer.toString(prevCompTime + burstTime);\n }\n }\n //\n int turnaround = Integer.parseInt(taskArray[4]) - arivalTime;\n totalTurnaround += turnaround;\n int waitingTime = turnaround - burstTime;\n totalWaitingTime += waitingTime;\n\n taskList.set(i, String.join(\" \", taskArray));\n i++;\n }\n\n totalTurnaround = totalTurnaround / taskList.size();\n totalWaitingTime = totalWaitingTime / taskList.size();\n\n System.out.println(\"Average turnaround: \" + totalTurnaround);\n System.out.println(\"Average waiting: \" + totalWaitingTime);\n\n }", "public static void main(String[] args) throws Exception {\n \r\n long beginTime = System.nanoTime();\r\n for (int i = 0; i < 50000000; i++) {\r\n// System.out.println(getFlowNo());\r\n getFlowNo();\r\n \r\n }\r\n long endTime = System.nanoTime();\r\n System.out.println(\"onLineWithTransaction cost:\"+((endTime-beginTime)/1000000000) + \"s \" + ((endTime-beginTime)%1000000000) + \"us\");\r\n// \r\n// System.out.println(System.currentTimeMillis());\r\n// TimeUnit.SECONDS.sleep(3);\r\n// System.out.println(System.currentTimeMillis());\r\n }", "private long getDistanceFromSecondMark(){\n long numSecsElapsed = (long)Math.floor(timeElapsed / WorkoutStatic.ONE_SECOND);\n return timeElapsed - numSecsElapsed * WorkoutStatic.ONE_SECOND;\n }", "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 }", "public static void main(String[] args) {\n\t\tint[] longArr = new int[1000];\n\t\tlong startTime = System.currentTimeMillis();\n\t\tparallelAssignValues(longArr);\n\t\tlong endTime = System.currentTimeMillis();\n\t\tSystem.out.println(\"parallel method time is: \" + (endTime - startTime));\n\n\t\t// for (int i = 0; i < longArr.length; i++) {\n\t\t// System.out.print(longArr[i]);\n\t\t// }\n\n\t\tRandom random = new Random();\n\t\tint[] lista = new int[1000];\n\t\tlong startTimes = System.currentTimeMillis();\n\t\tfor (int i = 0; i < 1000; i++) {\n\t\t\tlista[i] = random.nextInt(500);\n\t\t}\n\t\tlong endTimes = System.currentTimeMillis();\n\t\tSystem.out.println(\"serial method time is: \" + (endTimes - startTimes));\n\n\t}", "public static void main(String[] args) {\n\tlong start=System.currentTimeMillis();\n\tUtil.println(\"Result = \" + new _005_smallest_multiple().run());\n\tlong end=System.currentTimeMillis();\n\tUtil.println(\"Total time: \" + (end - start) * 0.001 + \" s\");\n}", "private static void speedup(String [] args){\n\t\t\n\t\tint warningCnt = 0;\n\t\t\n\t\tString applicationPath = convertApplication(args[2], null);\n\t\tConfMan baseConfigManager;\n\t\t\n\n\n\n\n\t\tbaseConfigManager = new ConfMan(args[1], applicationPath, false);\n\t\tConfMan[] cms;\n\t\t\n\t\tSweepConfig sweepConfig = new SweepConfig(baseConfigManager, \"config/sweep/cacheSpeedupSweep.json\",true);\n//\t\tSweepConfig sweepConfig = new SweepConfig(baseConfigManager, \"config/sweep/speedupSweep.json\",true);\n\n\t\tcms = sweepConfig.getConfManager();\n\t\tString[] configNames = sweepConfig.getSweepConfigurations();\n//\t\tString[] speedupIdentifier = sweepConfig.getSpeedupIdentifier();\n//\t\tboolean[] isShortTest = sweepConfig.getIsShortTest();\n\n\t\tTrace speedupTrace = new Trace(System.out, System.in, \"\", \"\");\n\t\tspeedupTrace.setPrefix(\"basic config\");\n\t\tbaseConfigManager.printConfig(speedupTrace);\n\n\t\tspeedupTrace.setPrefix(\"speedup\");\n\t\t\n//\t\tLinkedHashMap<String, SpeedupMeasurementResult> speedupResults = new LinkedHashMap<>();\n\t\tMeasurementResult[] measurementResults = new MeasurementResult[cms.length];\n\t\tLinkedHashMap<String, BaseLineStorage> baseLineStorage = new LinkedHashMap<String, BaseLineStorage>();\n\t\t\n//\t\tAmidarSimulationResult[] results = parallelRemoteSimulation(sweepConfig, \"trav\", 1099, 8, speedupTrace);\n\t\t\n\t\tdouble overhead = 0;\n\t\tint transmission = 0;\n\t\tint run = 0;\n\t\tdouble overheadCnt = 0;\n\t\t\n\n\t\t////////////////////////// SIMULATE //////////////////////////////////////////////\n\t\tfor(int i = 0; i<cms.length; i++){\n\t\t\t\n\t\t\t/////// FIRST SHORT /////////////////////////////\n\t\t\tConfMan conf = cms[i];\n\t\t\t\n\t\t\tboolean isShort = true;\n\t\t\tString appBaseName = conf.getApplicationPath();\n\t\t\tString [] appBasePath = appBaseName.split(\"/\");\n\t\t\t\n\t\t\t\n\t\t\tconf.setApplication(\"../axt/\" + appBaseName+ \"_short/\" + appBasePath[appBasePath.length-1] + \"_short.axt\");\n\n\t\t\tMeasurementResult speedupRes = measurementResults[i];\n\t\t\tif(speedupRes == null){\n\t\t\t\tspeedupRes = new MeasurementResult();\n\t\t\t\tmeasurementResults[i] = speedupRes;\n\t\t\t}\n\t\t\t\n\t\t\tString app = conf.getApplicationPath();\n\t\t\tint benchmarkScale = conf.getBenchmarkScale();\n\t\t\tapp = app+\"-benchMarkScale-\"+benchmarkScale;\n\t\t\t\n\t\t\tspeedupTrace.printTableHeader(\"Running: \" + configNames[i] + \" SHORT\");\n\t\t\tif(!baseLineStorage.containsKey(app)){\n\t\t\t\tbaseLineStorage.put(app, new BaseLineStorage());\n\t\t\t}\n\t\t\t\n\t\t\tBaseLineStorage baseLine = baseLineStorage.get(app);\n \t\t\t\n\t\t\tif(!baseLine.isBaselineAvailable(isShort)){\n\t\t\t\tspeedupTrace.println(\"Running without synthesis...\");\n\t\t\t\tAmidarSimulationResult currentRes = run(conf, null, false);\n\t\t\t\tspeedupRes.addBaseline(currentRes, isShort);\n\t\t\t\tbaseLine.addBaseLine(isShort, currentRes);\n\t\t\t} else {\n\t\t\t\tspeedupRes.addBaseline(baseLine.getBaseLine(isShort), isShort);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tAmidarSimulationResult currentResult = null;\n\t\t\tconf.setSynthesis(true);\n\t\t\tspeedupTrace.println(\"Running with synthesis...\");\n\t\t\ttry{\n\t\t\t\tcurrentResult = run(conf, null, false);\n\t\t\t} catch(AmidarSimulatorException e ){\n\t\t\t\tspeedupTrace.println(\"WARNING: Aliasing speculation failed. Switching of speculation and repeat...\");\n\t\t\t\twarningCnt++;\n\t\t\t\tconf.getSynthesisConfig().put(\"ALIASING_SPECULATION\", AliasingSpeculation.OFF);\n\t\t\t\tcurrentResult = run(conf, null, false);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n//\t\t\tif(isShort){\n//\t\t\t\tHashMap<String, Integer> stateCNT = currentResult.getCgraStateCount();\n//\t\t\t\tdouble transmissionCnt = stateCNT.get(\"SEND\") + stateCNT.get(\"REC\") +stateCNT.get(\"WAIT\");\n//\t\t\t\tdouble runCnt = stateCNT.get(\"RUN\");\n//\t\t\t\t\n//\t\t\t\tdouble overheadCurrent = transmissionCnt/(transmissionCnt + runCnt);\n//\t\t\t\t\n//\t\t\t\toverhead += overheadCurrent;\n//\t\t\t\ttransmission +=transmissionCnt;\n//\t\t\t\trun += runCnt;\n//\t\t\t\toverheadCnt++;\n//\t\t\t}\n\t\t\t\n\t\t\tspeedupRes.addResults(currentResult, isShort);\n\t\t\t\n\t\t\t/////// THEN LONG /////////////////////////////\n\t\t\t\n\t\t\tisShort = false;\n\t\t\tconf.setApplication(\"../axt/\" + appBaseName+ \"_long/\" + appBasePath[appBasePath.length-1] + \"_long.axt\");\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tspeedupTrace.printTableHeader(\"Running: \" + configNames[i] + \" LONG\");\n\t\t\tif(!baseLine.isBaselineAvailable(isShort)){\n\t\t\t\tconf.setSynthesis(false);\n\t\t\t\tspeedupTrace.println(\"Running without synthesis...\");\n\t\t\t\tAmidarSimulationResult currentRes = run(conf, null, false);\n\t\t\t\tspeedupRes.addBaseline(currentRes, isShort);\n\t\t\t\tbaseLine.addBaseLine(isShort, currentRes);\n\t\t\t} else {\n\t\t\t\tspeedupRes.addBaseline(baseLine.getBaseLine(isShort), isShort);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tconf.setSynthesis(true);\n\t\t\tspeedupTrace.println(\"Running with synthesis...\");\n\t\t\ttry{\n\t\t\t\tcurrentResult = run(conf, null, false);\n\t\t\t} catch(AmidarSimulatorException e ){\n\t\t\t\tspeedupTrace.println(\"WARNING: Aliasing speculation failed. Switching of speculation and repeat...\");\n\t\t\t\twarningCnt++;\n\t\t\t\tconf.getSynthesisConfig().put(\"ALIASING_SPECULATION\", AliasingSpeculation.OFF);\n\t\t\t\tcurrentResult = run(conf, null, false);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n//\t\t\tif(isShort){\n//\t\t\t\tHashMap<String, Integer> stateCNT = currentResult.getCgraStateCount();\n//\t\t\t\tdouble transmissionCnt = stateCNT.get(\"SEND\") + stateCNT.get(\"REC\") +stateCNT.get(\"WAIT\");\n//\t\t\t\tdouble runCnt = stateCNT.get(\"RUN\");\n//\t\t\t\t\n//\t\t\t\tdouble overheadCurrent = transmissionCnt/(transmissionCnt + runCnt);\n//\t\t\t\t\n//\t\t\t\toverhead += overheadCurrent;\n//\t\t\t\ttransmission +=transmissionCnt;\n//\t\t\t\trun += runCnt;\n//\t\t\t\toverheadCnt++;\n//\t\t\t}\n\t\t\t\n\t\t\tspeedupRes.addResults(currentResult, isShort);\n\t\t}\n\t\t////////////////////////SIMULATE END//////////////////////////////////////////////\n\n\t\tspeedupTrace.printTableHeader(\"Speedup\");\n\t\t\n\t\tDecimalFormatSymbols symbols = new DecimalFormatSymbols();\n\t\tsymbols.setGroupingSeparator(',');\n\t\tsymbols.setDecimalSeparator('.');\n\t\tDecimalFormat formater = new DecimalFormat(\"#0.000\", symbols);\n\t\t\n\t\t\n\t\t/// GATHER INFORMATION //////////////////////////////////////////\n\t\t\n\t\tdouble[] speedupList = new double[cms.length];\n\t\tdouble[] communicationOverhead = new double[cms.length];\n\t\tdouble[] dmaOverhead = new double[cms.length];\n\t\tdouble[] l1usage = new double[cms.length];\n\t\tdouble[] l2usage = new double[cms.length];\n\t\tdouble[] averageMemTime = new double[cms.length];\n\t\t\n\t\tdouble[][] blockTimesPrefetch = new double[TaskType.values().length][cms.length];\n\t\tdouble[][] blockTimesRegular = new double[TaskType.values().length][cms.length];\n\t\t\n\t\tint[] nrOfContexts = new int[cms.length];\n\t\tint[] nrOfL1Prefetches = new int[cms.length];\n\t\tint[] nrOfL2Prefetches = new int[cms.length];\n\t\tint[] nrOfUsedL1Prefetches = new int[cms.length];\n\t\tint[] nrOfUsedL2Prefetches = new int[cms.length];\n\t\t\n\t\tint[] nrOfHandledPrefetchRequests = new int[cms.length];\n\t\tint[] nrOfHandledPrefetchRequestsAlreadyAvailable = new int[cms.length];\n\t\t\n\t\tint[] cachelineFills = new int[cms.length];\n\t\tlong[] synthTime = new long[cms.length];\n\t\t\n\t\tfor(int i = 0; i < measurementResults.length; i++){\n\t\t\tString res = \"Speedup of \" + configNames[i] + \"\\t\";\n\t\t\tdouble speedup = measurementResults[i].getSpeedup();\n\t\t\tspeedupList[i] = speedup;\n\t\t\tres = res + \": \" + formater.format(speedup);\n\t\t\tspeedupTrace.println(res);\n\t\t\t\n\t\t\tcommunicationOverhead[i] = measurementResults[i].getCommunicationOverhead();\n\t\t\tdmaOverhead[i] = measurementResults[i].getDMAOverhead();\n\t\t\tl1usage[i]= measurementResults[i].getL1Usage();\n\t\t\tl2usage[i]= measurementResults[i].getL2Usage();\n\t\t\taverageMemTime[i] = measurementResults[i].getAverageMemoryAccessTime();\n\t\t\tfor(TaskType tt: TaskType.values()){\n\t\t\t\tblockTimesPrefetch[tt.ordinal()][i] = measurementResults[i].getBlockTimesInPercent(RequestType.Prefetch, tt);\n//\t\t\t\tSystem.out.println(\"\\tBlocktime Pref\" +tt + \":\\t\" +blockTimesPrefetch[tt.ordinal()][i]);\n\t\t\t\tblockTimesRegular[tt.ordinal()][i] = measurementResults[i].getBlockTimesInPercent(RequestType.Regular, tt);\n//\t\t\t\tSystem.out.println(\"\\tBlocktime Regu\" +tt + \":\\t\" +blockTimesRegular[tt.ordinal()][i]);\n \t\t\t}\n\t\t\tnrOfContexts[i] = measurementResults[i].getNrOfContexts();\n\t\t\tnrOfL1Prefetches[i] = measurementResults[i].getNrOfL1Prefetches();\n\t\t\tnrOfUsedL1Prefetches[i] = measurementResults[i].getNrOfUsedL1Prefetches();\n\t\t\tnrOfHandledPrefetchRequests[i] = measurementResults[i].getNrOfHandledPrefetchRequests();\n\t\t\tnrOfHandledPrefetchRequestsAlreadyAvailable[i] = measurementResults[i].getNrOfHandledPrefetchRequestsAlreadyAvailable();\n\t\t\tcachelineFills[i] = measurementResults[i].getCachelineFills();\n\t\t\tsynthTime[i] = measurementResults[i].getSynthTime();\n\t\t}\n\t\t///// PLOT INFORMATION //////////////////////////////////////////////\n\t\tSweepResultPlotter plotter = new SweepResultPlotter();\n//\t\tplotter.configurePlotter( \"UNROLL\", \"\", true);\n\t\tLinkedHashMap<String, LinkedHashSet<String>> sweepInfo = sweepConfig.getSweepInfo();\n\t\t\n\t\tString path = \"log/sweep\"+new Date().toString();\n\t\tplotter.setPath(path);\n\t\tplotter.saveSweepInfo(sweepInfo);\n\t\t\n\t\tplotter.saveResults(speedupList,\"speedup\");\n\t\tplotter.saveResults(communicationOverhead, \"communicationOverhead\");\n\t\tplotter.saveResults(dmaOverhead, \"dmaOverhead\");\n\t\tplotter.saveResults(l1usage,\"l1usage\");\n\t\tplotter.saveResults(l2usage, \"l2usage\");\n\t\tplotter.saveResults(averageMemTime, \"memTime\");\n\t\tplotter.saveResults(nrOfContexts, \"contexts\");\n\t\tplotter.saveResults(nrOfL1Prefetches, \"l1prefetches\");\n\t\tplotter.saveResults(nrOfUsedL1Prefetches, \"usedL1prefetches\");\n\t\tplotter.saveResults(nrOfHandledPrefetchRequests, \"handledPrefetchRequests\");\n\t\tplotter.saveResults(nrOfHandledPrefetchRequestsAlreadyAvailable, \"handledPrefetchRequestsAvail\");\n\t\tplotter.saveResults(cachelineFills, \"cachelineFills\");\n\t\tplotter.saveResults(synthTime, \"Synthtime\");\n\t\t\n\t\t\n//\t\tfor(TaskType tt: TaskType.values()){\n//\t\t\t\n//\t\t}\n\t\t\n\t\t///// PRINT ON CONSOLE ///////////////////////////////\n\t\tspeedupTrace.printTableHeader(\"Average Speedup\");\n\t\tplotter.plot(sweepInfo, speedupList, speedupTrace,\"log/\", \"\");\n\t\t\n\t\tif(warningCnt > 1){\n\t\t\tspeedupTrace.println(warningCnt + \" Warnings\");\n\t\t} else if(warningCnt == 1){\n\t\t\tspeedupTrace.println(\"1 Warning\");\n\t\t}\n\t\t\n//\t\tspeedupTrace.println(\"CGRA transmission overhead in Percent: \" + formater.format(overhead*100/overheadCnt) + \" Ticks Running: \" + (int)(run/overheadCnt+0.5) + \" Ticks Transmitting: \" + (int)(transmission/overheadCnt+0.5));\n\t\t\n\t\t\n//\t\tspeedupTrace.println(ObjectHistory.indep*100/(ObjectHistory.indep+ObjectHistory.dep)+\"% of all memory accesses are independant\");\n//\n//\t\t\n\t\tspeedupTrace.printTableHeader(\"Average Communication Overhead\");\n\t\tplotter.plot(sweepConfig.getSweepInfo(), communicationOverhead, speedupTrace, null, \"\");\n\t\tspeedupTrace.printTableHeader(\"Average DMA Overhead\");\n\t\tplotter.plot(sweepConfig.getSweepInfo(), dmaOverhead, speedupTrace, null, \"\");\n\t\tspeedupTrace.printTableHeader(\"Memtime\");\n\t\tplotter.plot(sweepConfig.getSweepInfo(), averageMemTime, speedupTrace, null, \"\");\n\t\t\n\t\tdouble[] cffd = new double[cachelineFills.length];\n\t\tfor(int i = 0; i < cffd.length; i++){\n\t\t\tcffd[i] = cachelineFills[i];\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tspeedupTrace.printTableHeader(\"Cacheline fills\");\n\t\tplotter.plot(sweepConfig.getSweepInfo(), cffd, speedupTrace, null, \"\");\n\t\t\n\t\tdouble[] stdd = new double[synthTime.length];\n\t\tfor(int i = 0; i < stdd.length; i++){\n\t\t\tstdd[i] = synthTime[i];\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tspeedupTrace.printTableHeader(\"Synth time\");\n\t\tplotter.plot(sweepConfig.getSweepInfo(), stdd, speedupTrace, null, \"\");\n\t\t\n//\t\t\n//\t\tplotter.plot(sweepConfig.getSweepInfo(), l1usage, speedupTrace, null, \"\");\n//\t\tplotter.plot(sweepConfig.getSweepInfo(), l2usage, speedupTrace, null, \"\");\n//\t\tplotter.plot(sweepConfig.getSweepInfo(), averageMemTime, speedupTrace, null, \"\");\n\t\t\n//\t\tspeedupTrace.printTableHeader(\"CGRA blocked by Prefetch\");\n//\t\tfor(TaskType tt: TaskType.values()){\n//\t\t\tplotter.plot(sweepConfig.getSweepInfo(), blockTimesPrefetch[tt.ordinal()], speedupTrace,null, tt.toString());\n//\t\t}\n//\t\tspeedupTrace.printTableHeader(\"CGRA blocked by Regular Access\");\n//\t\tfor(TaskType tt: TaskType.values()){\n//\t\t\tplotter.plot(sweepConfig.getSweepInfo(), blockTimesRegular[tt.ordinal()], speedupTrace,null, tt.toString());\n//\t\t}\n\t\n\t}", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\tlong start=System.currentTimeMillis();\r\n\t\t\t\tHashSetAdd hsd=new HashSetAdd();\r\n\t\t\t\tHashSet<String> hs1=hsd.add();\r\n\t\t\t\tSystem.out.println(\"size1=:\"+hs1.size());\r\n\t\t\t\tfor(String result:hs1){\r\n\t\t\t\t\tresult.toString();\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tlong end=System.currentTimeMillis();\r\n\t\t\t\tSystem.out.println(\"time1=: \"+(end-start));\r\n\t\t\t}", "@Override\n public void calculateTimeAndDist(String result) {\n //Create a calendar instance.\n Calendar date = Calendar.getInstance();\n long t = date.getTimeInMillis();\n\n String pattern = \"HH:mm\";\n\n // Create an instance of SimpleDateFormat used for formatting\n // the string representation of date according to the chosen pattern\n DateFormat df = new SimpleDateFormat(pattern);\n\n //Split the result returned by the Geotask.\n String res[] = result.split(\",\");\n// Double min = Double.parseDouble(res[0]) / 60;\n\n //Get the distance.\n Double dist = Double.parseDouble(res[1]) / 1000;\n\n\n //Get time to dest based on user's speed.\n Double d = Double.valueOf(dist);\n Double s = Double.valueOf(getAverageSpeed());\n int timeToDest = (int) ((d / s) * 60);\n\n //Add timeToDest to current time\n Date afterAddingTimeToDest = new Date(t + (timeToDest * ONE_MINUTE_IN_MILLIS));\n String todayAsString = df.format(afterAddingTimeToDest.getTime());\n\n //Set arrival txt to estimate arrival time.\n arrivalTxt.setText(todayAsString);\n\n }", "@Test\n public void testKMP() {\n\n int[] next = getNextArr(modeStr);\n ////int[] next = getNext2(modeStr);\n ////int[] next = getNext(modeStr);\n log.info(JSON.toJSONString(next));\n\n final char[] charArr = mainStr.toCharArray();\n final char[] modeCharArr = modeStr.toCharArray();\n final int charLen = charArr.length;\n final int modeCharLen = modeCharArr.length;\n int match = 0;\n int compareCount = 0;\n for (int i = 0; i < charLen - modeCharLen +1; ) {\n int offset = 1;\n for (int j = 0, startIndex = i; j < modeCharLen; j++) {\n int indexToBeMoved = next[j];\n compareCount++;\n log.info(\"{}与{}比较\", modeCharArr[j], charArr[startIndex]);\n if (charArr[startIndex] == modeCharArr[j]) {\n match++;\n startIndex++;\n if (match == modeCharLen) {\n //计算最终串的初始下标\n int initIndex = (--startIndex) - (modeCharLen - 1);\n log.info(\"找到下标【\" + initIndex + \"】,值为【\" + charArr[initIndex] + \"】\");\n log.info(\"比较次数:{}\", compareCount);\n return;\n }\n } else if (indexToBeMoved == -1) {\n startIndex++;\n match = 0;\n break;\n } else if (indexToBeMoved >= 0) {\n //log.error(\"记录下标{}\",i+match);\n offset = (modeCharLen - indexToBeMoved - 1);\n offset = offset > (charLen - modeCharLen) ? 1 : offset;\n match = 0;\n break;\n }\n }\n i += offset;\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 }", "private static void calcSingleTms() {\n\t\tFloat avgLenInitial = 0f;\n\t\tFloat avgLenSc = 0f;\n\t\tInteger countSCsingle = 0;\n\t\t// get all the single TM proteins from the hash\n\t\t\n\t\t// for the initial set\n\t\tfor(int i =0;i<=singleTmProts.size()-1;i++){\n\t\t\tint id = singleTmProts.get(i);\n\t\t\tavgLenInitial = avgLenInitial + Sequences_length.get(id);\n\t\t}\n\t\tavgLenInitial = (avgLenInitial / singleTmProts.size());\n\t\t\n\t\tSystem.out.print(\"\\nNumber of Single TM proteins in initial Set \"+singleTmProts.size()+\"\\n\");\n\t\tSystem.out.print(\"\\nAvg Len of Single TM proteins in initial Set \"+avgLenInitial+\"\\n\");\n\t\t\n\t\t//for the SC\n\t\tgetSCset();\n\t\t// for all the proteins in SC_sequences\n\t\t\n\t\tfor(Integer key : SC_sequences.keySet()){\n\t\t\tif (singleTmProts.contains(key)){\n\t\t\t\t// is in SC and is single TM\n\t\t\t\tavgLenSc = avgLenSc + Sequences_length.get(key);\n\t\t\t\tcountSCsingle ++;\n\t\t\t}\n\t\t\tavgLenSc = (avgLenSc / countSCsingle); \n\t\t}\n\t\tSystem.out.print(\"\\nNumber of Single TM proteins in SC \"+countSCsingle+\"\\n\");\n\t\tSystem.out.print(\"\\nAvg Len of Single TM proteins in SC Set \"+avgLenSc+\"\\n\");\n\t\t\n\t\t\n\t\t\n\t}", "String clientProcessTime(final int index);", "static String timeCount_2(List<String> Arr){\n int timeHH = 0;\n int timeMI = 0;\n int timeSS = 0;\n \n int timeSum_second = 0;\n \n String r_hh = \"\";\n String r_mi = \"\";\n String r_ss = \"\";\n\n for(int i = 0; i < Arr.size(); i++ ){\n \n if (Pattern.matches(\"\\\\d{2}:\\\\d{2}:\\\\d{2}\", Arr.get(i))){\n \n String[] s = Arr.get(i).split(\":\");\n int hh = Integer.parseInt(s[0]);\n int mi = Integer.parseInt(s[1]);\n int ss = Integer.parseInt(s[2]);\n\n timeSum_second += hh*60*60 + mi*60 + ss;\n \n }\n else{\n continue;\n }\n }\n \n timeHH = timeSum_second/60/60;\n timeMI = (timeSum_second%(60*60))/60;\n timeSS = timeSum_second%60;\n \n if (timeHH < 10){\n r_hh = \"0\" + timeHH;\n }\n else{\n r_hh = Integer.toString(timeHH);\n }\n \n if (timeMI < 10){\n r_mi = \"0\" + timeMI;\n }\n else{\n r_mi = Integer.toString(timeMI);\n }\n \n if (timeSS < 10){\n r_ss = \"0\" + timeSS;\n }\n else{\n r_ss = Integer.toString(timeSS);\n }\n \n String result = r_hh + \":\" + r_mi + \":\" + r_ss;\n \n return result;\n }", "@Test\n public void testSeparateNumber131() { // FlairImage: 131\n java.util.concurrent.atomic.AtomicBoolean totuus = new java.util.concurrent.atomic.AtomicBoolean(false); \n StringBuilder testi = new StringBuilder(); \n assertEquals(\"From: FlairImage line: 135\", 0, separateNumber(testi,'-',totuus)); \n totuus.set(false); \n testi = new StringBuilder(\"123-asdasd\"); \n assertEquals(\"From: FlairImage line: 139\", 123, separateNumber(testi,'-',totuus)); \n assertEquals(\"From: FlairImage line: 140\", \"asdasd\", testi.toString()); \n assertEquals(\"From: FlairImage line: 141\", true, totuus.get()); \n totuus.set(false); \n testi = new StringBuilder(\"123-asdasd-muumi\"); \n assertEquals(\"From: FlairImage line: 145\", 123, separateNumber(testi,'-',totuus)); \n assertEquals(\"From: FlairImage line: 146\", \"asdasd-muumi\", testi.toString()); \n assertEquals(\"From: FlairImage line: 147\", true, totuus.get()); \n totuus.set(false); \n testi = new StringBuilder(\"asd-asdasd-muumi\"); \n assertEquals(\"From: FlairImage line: 151\", 0, separateNumber(testi,'-',totuus)); \n assertEquals(\"From: FlairImage line: 152\", \"asd-asdasd-muumi\", testi.toString()); \n assertEquals(\"From: FlairImage line: 153\", false, totuus.get()); \n totuus.set(false); \n testi = new StringBuilder(\"asd-asdasd-123\"); \n assertEquals(\"From: FlairImage line: 157\", 123, separateNumber(testi,'-',totuus)); \n assertEquals(\"From: FlairImage line: 158\", \"asd-asdasd-123\", testi.toString()); \n assertEquals(\"From: FlairImage line: 159\", false, totuus.get()); \n totuus.set(false); \n testi = new StringBuilder(\"asd-123-muumi\"); \n assertEquals(\"From: FlairImage line: 163\", 0, separateNumber(testi,'-',totuus)); \n assertEquals(\"From: FlairImage line: 164\", \"asd-123-muumi\", testi.toString()); \n assertEquals(\"From: FlairImage line: 165\", false, totuus.get()); \n }", "public static void main(String[] args) throws InterruptedException {\n LongCounter lc = LongCounter.newUnsynchronized(\"\", \"\");\r\n for (int i = 0; i < 1000000; i++) {\r\n lc.addAndGet(i);\r\n }\r\n Thread.sleep(400);\r\n long start = System.nanoTime();\r\n lc.set(0);\r\n for (int i = 0; i < 100000000; i++) {\r\n lc.addAndGet(i);\r\n }\r\n long finish = System.nanoTime();\r\n System.out.println(lc);\r\n System.out.println((finish - start) / 100000000.0);\r\n }", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\tlong start=System.currentTimeMillis();\r\n\t\t\t\tHashSetAdd hsd=new HashSetAdd();\r\n\t\t\t\tHashSet<String> hs2=hsd.add();\r\n\t\t\t\tSystem.out.println(\"size2=:\"+hs2.size());\r\n\t\t\t\tIterator<String> iter = hs2.iterator();\r\n\t\t\t\twhile(iter.hasNext()){\r\n\t\t\t\t String result = iter.next();\r\n\t\t\t\t }\r\n\t\t\t\t\r\n\t\t\t\tlong end=System.currentTimeMillis();\r\n\t\t\t\tSystem.out.println(\"time2=: \"+(end-start));\r\n\t\t\t}", "private void updateTimes(final String[] args) throws IOException {\r\n final BufferedReader[] bf = new BufferedReader[args.length];\r\n for(int j = 0; j < bf.length; j++)\r\n bf[j] = new BufferedReader(new FileReader(args[j]));\r\n \r\n final int numdb = 10;\r\n final double[] qut = new double[nqueries * numdb];\r\n String l;\r\n int i = 0;\r\n while((l = bf[0].readLine()) != null) {\r\n qut[i++] = Double.parseDouble(l.substring(0, l.indexOf(';')));\r\n }\r\n bf[0].close();\r\n \r\n for(int j = 1; j < bf.length; j++) {\r\n i = 0;\r\n while((l = bf[j].readLine()) != null) {\r\n qut[i] = Math.min(qut[i], Double.parseDouble(l));\r\n i++;\r\n }\r\n bf[j].close();\r\n }\r\n \r\n final double[] tmp = new double[nqueries];\r\n for(int j = 0; j < tmp.length; j++) {\r\n for(int z = 0; z < numdb; z++) {\r\n tmp[j] += qut[j + z * nqueries];\r\n }\r\n }\r\n \r\n final BufferedReader br =\r\n new BufferedReader(new FileReader(SUBMISSION));\r\n final PrintOutput o = new PrintOutput(SUBMISSIONU);\r\n i = 0;\r\n while((l = br.readLine()) != null) {\r\n if(l.contains(\"<topic topic-id=\")) {\r\n final int s = l.indexOf(\"total_time_ms=\\\"\") +\r\n \"total_time_ms=\\\"\".length();\r\n final int e = l.lastIndexOf('\"');\r\n final double ti = Double.parseDouble(l.substring(s, e));\r\n if(ti > tmp[i] || ti == 0) {\r\n o.print(l.substring(0, s) + tmp[i] + l.substring(e));\r\n } else {\r\n o.print(l);\r\n }\r\n i++;\r\n } else o.print(l);\r\n o.print(NL);\n }\r\n br.close();\r\n o.flush();\r\n o.close();\r\n Main.outln(\"Updated\");\r\n }", "private static long m39416a(String str) {\n try {\n return C6440a.m39308a(str).getTime();\n } catch (Exception unused) {\n return 0;\n }\n }", "private int micRecTime(long freeSpace) {\n\n return (int) (freeSpace / 5898240);\n }", "public final synchronized long mo27311a(String str) {\n long currentTimeMillis;\n currentTimeMillis = System.currentTimeMillis();\n if (!this.f10287a.contains(m12563a(str, \"cre\"))) {\n SharedPreferences.Editor edit = this.f10287a.edit();\n edit.putString(m12563a(str, \"cre\"), String.valueOf(currentTimeMillis));\n edit.commit();\n } else {\n currentTimeMillis = m12566c(str);\n }\n this.f10289c.put(str, Long.valueOf(currentTimeMillis));\n return currentTimeMillis;\n }", "public static void main(String[] args) {\n\t\tfinal double distance=15E7;\r\n\t\tfinal double speed=3E5;\r\n\t\tdouble time=distance/speed;\r\n\t\tSystem.out.println(\"태양에서 지구까지 거리: 약 1억 5천만 km\" );\r\n\t\tSystem.out.println(\"빛의 속도: 30만 km\");\r\n\t\tSystem.out.println(\"빛이 태양에서 출발하여 지구에 도달하는 시간은: \" + (int)time+ \"초\");\r\n\t}", "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 }", "public static void main(String[] args){\r\n\t\tputSPECmeasurement(System.nanoTime(), 100, 1000, \"nix1\", 5000);\r\n\t\tputSPECmeasurement(System.nanoTime(), 200, 2000, \"nix2\", 10000);\r\n\t}", "@Test\n public void testSampledTimeDistributedBetweenExecutionFragments() throws IOException {\n NameContext stepA = createStep(\"A\");\n NameContext stepB = createStep(\"B\");\n\n tracker.enter(stepA);\n tracker.exit();\n tracker.enter(stepB);\n tracker.exit();\n // Expected journal: IDLE A1 IDLE B1 IDLE\n\n tracker.takeSample(50);\n assertThat(getCounterValue(stepA), equalTo(distribution(10)));\n assertThat(getCounterValue(stepB), equalTo(distribution(10)));\n }", "public final void mo9211cq(String str, String str2) {\n AppMethodBeat.m2504i(37328);\n this.rbf++;\n mo25618la(true);\n this.raL.rcg.stopTimer();\n if (this.oKj != 0) {\n this.rbe = (int) (((long) this.rbe) + (System.currentTimeMillis() - this.oKj));\n this.oKj = 0;\n }\n this.rbd = 5;\n this.raL.akV();\n AppMethodBeat.m2505o(37328);\n }", "public static void main (String []args) {\n\tlong first = System.currentTimeMillis();\n\tlong sum=0;\n\tfor (int i = 0; i < 100000; i++) {\n\t String[] str = strings();\n\t sum += str[0].charAt(0);\n\t}\n\tlong done = System.currentTimeMillis();\n\n\tSystem.out.println ((done - first)*1000);\n\tSystem.out.println (sum);\n }", "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 void main(String[] args) {\r\n\r\n\t\t String str1 = \"University\";\r\n\t\t String str2 = \"Unvesty\";\r\n\t\t int out = Similarity.CalcuED(str1, str2);\r\n\t\t System.out.println(\"Edit Distance = \" + out);\r\n//\t double out2 = Similarity.CalcuJaccard(str1, str2, 2);\r\n//\t \tSystem.out.println(\"Jaccard Coefficient = \"+ out2);\r\n//\t \t}\r\n\r\n\t }", "public static void main(String [] args)\n{\n int magicNumber = 3;\n // if ( args.length == 0 ) magicNumber = 12;\n // else magicNumber = Integer.parseInt(args[0]);\n\n Sum sumObject = new Sum();\n Sum timeObject = new Sum();\n long LOWER = 1; //Beginning of sequence\n // long UPPER =10000000; // End of sequence\n long UPPER;\n if ( args.length == 0 ) UPPER = 10000000;\n else UPPER = Integer.parseInt(args[0]);\n // 1+2+3+4+5+6+...+9999 LOWER is 1 UPPER is 9999\n long maxValue2Add = UPPER;\n \n\n long INCREMENT = (UPPER - LOWER) / magicNumber;\n // Thread [] threadArray = new Thread[magicNumber+1];\n Thread [] threadArray = new Thread[magicNumber+10];\n// for(int i =0; i < magicNumber; i ++)\nint i = (int)LOWER;\nint threadCount=0;\nwhile(i <= UPPER)\n {\n threadArray[threadCount] = new Thread(new Summation(i,i,i+INCREMENT-1,maxValue2Add,sumObject,timeObject));\n threadArray[threadCount].start();\n i+=INCREMENT;\n ++threadCount;\n\n }\n\nSystem.out.println(\"threadCount is \"+threadCount);\n try{\n for(int j =0;j<threadCount;j++)\n {\n System.out.println(\"Joining thread \"+j);\n threadArray[j].join();\n }//for\n }//try\n catch(Exception e)\n {\n System.out.println(\"Exception is \"+e);\n }//catch\n System.out.println(\" Sum is \"+sumObject.getSum());\n System.out.println(\" Total Time is \"+timeObject.getSum());\n\n\n\n\n\n\n}", "public static String getMicroTimeId() {\n Long time = System.nanoTime();\n String timeValue = time.toString();\n String[] splitedValue = timeValue.split(\"\");\n int i = 2 + 2 + 2;\n String m1 = \"0\" + splitedValue[i];\n String m2 = \"0\" + splitedValue[++i];\n String m3 = \"0\" + splitedValue[++i];\n String m4 = \"0\" + splitedValue[++i];\n String m5 = \"0\" + splitedValue[++i];\n String m6 = \"0\" + splitedValue[++i];\n String m7 = \"0\" + splitedValue[++i];\n return alphanum[Integer.parseInt(m1)]\n .concat(alphanum[Integer.parseInt(m2)])\n .concat(alphanum[Integer.parseInt(m3)])\n .concat(alphanum[Integer.parseInt(m4)])\n .concat(alphanum[Integer.parseInt(m5)])\n .concat(alphanum[Integer.parseInt(m6)])\n .concat(alphanum[Integer.parseInt(m7)]);\n }", "public static void main(String[] args){\n\t\tint increment=1;\n\t\tfor(int m=0;m<=5000;m+=increment){\n\t\t\tif(m==10)\n\t\t\t\tincrement=5;\n\t\t\tif(m==100)\n\t\t\t\tincrement=100;\n\t\t\tif(m==500)\n\t\t\t\tincrement=500;\n\n\t\t\tfor(int l=0;l<30;++l){\n\t\t\t\tdouble[][][] AFFINITY3=new double[Task.TYPES_OF_TASK_NUMBER][Task.TYPES_OF_TASK_NUMBER][Task.TYPES_OF_TASK_NUMBER];\n\t\t\t\tRandom r=new Random(l);\n\t\t\t\tdouble affinity;\n\t\t\t\tfor(int i=0;i<Task.TYPES_OF_TASK_NUMBER;++i){\n\t\t\t\t\tfor(int j=0;j<Task.TYPES_OF_TASK_NUMBER;++j){\n\t\t\t\t\t\tfor(int k=0;k<Task.TYPES_OF_TASK_NUMBER;++k){\n\t\t\t\t\t\t\tdo{\n\t\t\t\t\t\t\t\taffinity=r.nextDouble();\n\t\t\t\t\t\t\t}while(affinity==0);\n\t\t\t\t\t\t\tAFFINITY3[i][j][k]=AFFINITY3[i][k][j]=AFFINITY3[k][i][j]=AFFINITY3[j][i][k]=AFFINITY3[k][j][i]=AFFINITY3[j][k][i]=affinity;\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tList<Node> infrastructure=new ArrayList<>();\n\t\t\t\tfor(int i=0; i<TEST_NUMBER_OF_NODES;++i)\n\t\t\t\t\tinfrastructure.add(new Node(TEST_NUMBER_OF_CORES, TEST_RAM_SIZE));\n\t\t\t\tList<Task> tasks=new ArrayList<>();\n\t\t\t\tTaskType[] types=TaskType.values();\n\t\t\t\tfor(int i=0;i<TEST_NUMBER_OF_PROCESS;++i){\n\t\t\t\t\tTaskType type=types[r.nextInt(Task.TYPES_OF_TASK_NUMBER)];\n\t\t\t\t\tint instanceNumber=r.nextInt(101)+10;//from 10 to 100 instances\n\t\t\t\t\tint coresPerInstance=r.nextInt(12)+1;//from 1 to 12\n\t\t\t\t\tint ramPerinstance=r.nextInt(12*1024+101)+100;//from 100MB to 12GB\n\t\t\t\t\tdouble baseTime=r.nextInt(10001)+1000;//from 100 cycles to 1000\n\t\t\t\t\ttasks.add(new Task(type,instanceNumber,coresPerInstance,ramPerinstance,baseTime));\n\t\t\t\t}\n\t\t\t\tList<Integer> arrivalOrder=new ArrayList<>();\n\t\t\t\tint tasksSoFar=0;\n\t\t\t\tdo{\n\t\t\t\t\ttasksSoFar+=r.nextInt(11);\n\t\t\t\t\tarrivalOrder.add((tasksSoFar<tasks.size())?tasksSoFar:tasks.size());\n\t\t\t\t}while(tasksSoFar<tasks.size());\n\t\t\t\tfinal Scheduler scheduler=new AffinityAwareFifoScheduler(tasks, arrivalOrder, infrastructure,AFFINITY3,AffinityType.NORMAL,m);\n\t\t\t\tThread t=new Thread(new Runnable() {\t\t\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tscheduler.runScheduler();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tt.start();\n\t\t\t\ttry {\n\t\t\t\t\tt.join();\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"Finished running.\");\n\t\t\t}\n\t\t}\n\t}", "long getNextCollectTimestampMs();", "@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 }", "@Test\n public void test1(){\n\n// List<String> list= new ArrayList<String>();\n// list.add(\"张三\");\n// list.add(\"李四\");\n// list.add(\"王五\");\n// list.add(\"马六\");\n// System.out.println(list.get(0));\n//\n// list.forEach(li-> System.out.println(li+\"干什么\"));\n//// Runnable no=() -> System.out.println(\"hello\");\n//\n// Complex complex=new Complex(2,3);\n//\n// Complex c=new Complex(5,3);\n// Complex cc=c.plus(complex);\n// System.out.println(cc.toString()+\"11111111111111111111\");\n List<String> data = new ArrayList<>();\n data.add(\"张三\");\n data.add(\"李四\");\n data.add(\"王三\");\n data.add(\"马六\");\n data.parallelStream().forEach(x-> System.out.println(x));\n System.out.println(\"--------------------\");\n data.stream().forEach(System.out::println);\n System.out.println(\"+++++++++++++++++\");\n List<String> kk=data.stream().sorted().limit(2).collect(Collectors.toList());\n kk.forEach(System.out::println);\n List<String> ll=data.stream()\n .filter(x -> x.length() == 2)\n .map(x -> x.replace(\"三\",\"五\"))\n .sorted()\n .filter(x -> x.contains(\"五\")).collect(Collectors.toList());\n ll.forEach(string-> System.out.println(string));\n for (String string:ll) {\n System.out.println(string);\n }\n ll.stream().sorted().forEach(s -> System.out.println(s));\n// .forEach(System.out::println);\n Thread thread=new Thread(()->{ System.out.println(1); });\n thread.start();\n\n LocalDateTime currentTime=LocalDateTime.now();\n\n System.out.println(\"当前时间\"+currentTime);\n LocalDate localDate=currentTime.toLocalDate();\n System.out.println(\"当前日期\"+localDate);\n\n Thread tt=new Thread(()-> System.out.println(\"111\"));\n }", "private static void stringConcat(String[] ss, int n) {\n Timer t = new Timer(); \n String res = \"\";\n for (int i=0; i<n; i++) \n res += ss[i];\n System.out.format(\"Result length:%7d; time:%8.3f sec\\n\" , res.length(), t.Check());\n }", "static void loopcomp () {\r\n\t\tint t40k= timer(8000,40000); \r\n\t\tint t1k= timer(8000,1000); \r\n\t\tSystem.out.println(\"Total number of loops for printing every 40k loops = \" + t40k);\r\n\t\tSystem.out.println(\"Total number of loops for printing every 1k loops = \"+ t1k);\r\n\t}", "public static void main(String[] args) {\n\n double D=260.0;\n int vIon=70;\n int vFlorica=60;\n double Time=D/(vIon+vFlorica);\n double Distance=vIon*Time;\n System.out.println(Time) ;\n System.out.println(Distance);\n }", "public static void main(String args[] ) throws Exception {\n Scanner s = new Scanner(System.in);\n int N=s.nextInt();\n long S=s.nextLong();\n long E=s.nextLong();\n long[] x=new long[N];\n long[] p=new long[N];\n int[] c=new int[N];\n for(int i=0;i<N;i++){\n x[i]=s.nextLong();\n p[i]=s.nextLong();\n c[i]=0;\n }\n long m=S;\n long dist=0;\n while(m<=E){\n long min=E;\n int index=0;\n for(int i=0;i<N;i++){\n if((x[i]-p[i])<min && c[i]==0){\n min=x[i]-p[i];\n index=i;\n }\n }\n if(m<(x[index]-p[index])){\n dist=dist+x[index]-p[index]-m;\n }\n\t if(m<(x[index]+p[index])){\n\t m=x[index]+p[index];\n\t }\n c[index]=1;\n }\n System.out.println(dist);\n }", "public static void main(String[] args) {\n \n// getting input data\n int secsTrip1=480; // the time elapsed in seconds for the first trip\n int secsTrip2=3220; //the time elapsed in seconds for the second trip\n int countsTrip1=1561; // the number of rotations of the front wheel during 1st trip\n int countsTrip2=9037; //the number of rotations of the front wheel during 2nd trip\n double wheelDiameter=27.0, //diameter of the wheel\n PI=3.14159, //pi \n feetPerMile=5280, // conversion from feet to mile\n inchesPerFoot=12, // conversion from inch to foot\n secondsPerMinute=60;//conversion from seconds to minute\n double distanceTrip1, distanceTrip2,totalDistance; //used in later calculations\n System.out.println(\"Trip 1 took \"+ (secsTrip1/secondsPerMinute)+\" minutes and had \"+ countsTrip1+\" counts.\"); \n //print the input information for the 1st trip\n System.out.println(\"Trip 2 took \"+ (secsTrip2/secondsPerMinute)+\" minutes and had \"+ countsTrip2+\" counts.\");\n //print the input information for the 2nd trip\n \n //run the calculations;\n \n // Above gives distance in inches\n //(for each count, a rotation of the wheel travels\n //the diameter in inches times PI)\n distanceTrip1=countsTrip1*wheelDiameter*PI/inchesPerFoot/feetPerMile; // Gives distance in miles\n distanceTrip2=countsTrip2*wheelDiameter*PI/inchesPerFoot/feetPerMile; //same calculation for trip 2\n totalDistance=distanceTrip1+distanceTrip2; // sum of the two trips\n //Print out the output data.\n System.out.println(\"Trip 1 was \"+ distanceTrip1 +\" miles\");\n System.out.println(\"Trip 2 was \"+ distanceTrip2 +\" miles\");\n System.out.println(\"The total distance was \"+ totalDistance +\" miles\");\n \n }", "public static void main( String[] args ) {\n \n\t// On obtient les arguments de la ligne de commande et on les verifie.\n\tif (args.length < 2) {\n\t System.out.println( \"Usage:\" );\n\t System.out.println( \" java Distance numMethode nbThreads [benchmarks?]\" );\n\t System.exit(-1);\n\t}\n\tint numMethode = Integer.parseInt( args[0] );\n\tint nbThreads = Integer.parseInt( args[1] );\n\n if ( numMethode < 0 || numMethode > 2 ) {\n System.out.println( \"*** Le 1er argument doit etre 0, 1 ou 2\" );\n System.exit(-1);\n }\n\n if ( nbThreads <= 0 ) {\n System.out.println( \"*** Le 2e argument doit etre >= 1\" );\n System.exit(-1);\n }\n\n\n // Variable pour mesures du temps d'execution...si necessaire.\n benchmarks = args.length == 3;\n long tempsDebut = benchmarks ? System.currentTimeMillis() : 0;\n\n // On appelle la bonne methode (dispatcher)\n if ( numMethode == 0 ) {\n methodeSeq();\n } else if ( numMethode == 1 ) {\n methodePar1( nbThreads );\n } else {\n methodePar2( nbThreads );\n }\n\n if ( benchmarks ) {\n long tempsFin = System.currentTimeMillis();\n // On emet le temps en secondes.\n System.out.println( (tempsFin - tempsDebut) / 1000.0 );\n }\n \n }", "public static void main(String[] args) throws Exception {\n\n String time = \"1556525949\";\n// LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochSecond(Long.parseLong(time)), ZoneId.systemDefault());\n// System.out.println(localDateTime);\n// Long aLong = DateCtrlUtil.localDateTimeToSecond(localDateTime);\n// System.out.println(aLong);\n\n// String sTime = \"2019-04-22 22:00:00\";\n//\n// LocalDateTime weekPreDate = LocalDateTime.parse(sTime, DateCtrlUtil.dateFormat).plusWeeks(-MonitorConstants.PRE_WEEKS);\n// Long aLong = DateCtrlUtil.localDateTimeToSecond(weekPreDate);\n// if (aLong > Long.parseLong(time)) {\n// System.out.println(true);\n// }\n for (int i = 2; i < 100; i++) {\n boolean flag = false;\n for (int j = 2; j <= Math.sqrt(i); j++) {\n if (i % j == 0) flag = true;\n }\n if (!flag) {\n System.out.println(String.format(\"%s is prime\", i));\n }\n }\n }", "public static void main(String[] args) throws Exception {\n\n\t\tfinal ByteBuffer buffer = ByteBuffer.allocate(8192);\n\t\t\n\t\tTimer timer = new Timer();\n\t\tTimerTask task = new TimerTask() {\n\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tlong begin = System.currentTimeMillis();\n\t\t\t\tString params = \"\";\n//\t\t\t\tString params = \"sessionId=10050000000000000100&organId=10010000000000000000&recursion=1\";\n//\t\t\t\tString params = \"sessionId=10050000000000000100&id=10020000000000000000\";\n//\t\t\t\tString params = \"<Request Method=\\\"Get_Resource_Route_Info\\\" Cmd=\\\"3007\\\"><StandardNumber>251010100001000001</StandardNumber></Request>\";\n\t\t\t\tfor (int i = 0; i < 400; i++) {\n//\t\t\t\t\tString params = \"sessionId=10050000000000000000&subType=01&name=DVR-test-\"+i+\"&transport=TCP&mode=compatible&maxConnect=16&channelAmount=32&organId=10010000000000000001&lanIp=192.168.1.\"+i+\"&port=5060&userName=admin&password=123456&heartCycle=120&ptsId=10060000000000000004\";\n\t\t\t\t\tSocketChannel channel = SocketHttpUtil.sendPost(\n\t\t\t\t\t\t\t\"192.168.1.2\", 8080, \n//\t\t\t\t\t\t\t\"/cms/create_dvr.json\",\n//\t\t\t\t\t\t\t\"/cms/get_user.json\",\n//\t\t\t\t\t\t\t\"/cms/get_resource_route_info.xml\",\n//\t\t\t\t\t\t\t\"/cms/list_organ_device.xml\",\n\t\t\t\t\t\t\t\"/cms/test_interface.json\",\n\t\t\t\t\t\t\tparams, \"utf8\");\n\n\t\t\t\t\t\n\t\t\t\t\tint count = 0;\n\t\t\t\t\ttry {\n\t\t\t\t\t\twhile ((count = channel.read(buffer)) >= 0) {\n\t\t\t\t\t\t\t// donothing\n//\t\t\t\t\t\t\tbuffer.flip();\n//\t\t\t\t\t\t\tbyte[] dst = new byte[count];\n//\t\t\t\t\t\t\tbuffer.get(dst, 0, count);\n//\t\t\t\t\t\t\tSystem.out.print(new String(dst));\n\t\t\t\t\t\t\tbuffer.clear();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (channel != null && channel.isOpen()) {\n//\t\t\t\t\t\t\tchannel.socket().close();\n\t\t\t\t\t\t\tchannel.close();\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlong end = System.currentTimeMillis();\n\t\t\t\tSystem.out.println();\n\t\t\t\tSystem.out.println(\"use \" + (end - begin) + \" ms\");\n\n\t\t\t}\n\t\t};\n\t\t\n\t\ttimer.scheduleAtFixedRate(task, 0, 1000);\n\t}", "long getTimeBoltBBoltC();", "public static void main(String[] args) {\n\t\tSystem.out.println( getDurationString(61, 61));\r\n\t\t System.out.println(getDurationString(60, 59));\r\n\t\t System.out.println(getDurationString(-610, 9));\r\n\t\t System.out.println( getDurationString(1, 6));\r\n\t\t System.out.println( getDurationString(3722));\r\n\t\t\r\n\t\t\r\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 }", "public static void doit(String fileName) {\n\t\tSystem.out.println(\"****矩阵形式-正域(减)******\"+fileName+\"上POSD的运行时间\"+\"***********\");\r\n\t\tlong time[]=new long[8];\r\n\t\tint t=0;//time下标\r\n\t\t\r\n\t\tList<Integer> preRED=null;\r\n\t List<Integer> nowRED = null;\r\n\r\n\t // 创建DataPreprocess对象data1 \r\n\t DataPreprocess data1=new DataPreprocess(fileName);\r\n\t \r\n\t int k=0,sn=data1.get_origDSNum();\r\n\t int m1=sn/10,m=m1>0?m1:1;\r\n\t int count=sn-(int)(0.2*sn);//保持与增加对象的约简结果一致\r\n\t data1.dataRatioSelect(0.2);\r\n\t \r\n\t preRED=new ArrayList<Integer>();\r\n\t nowRED=new ArrayList<Integer>();\r\n\t \r\n\t ArrayList<ArrayList<Integer>> addData=data1.get_origDS();//交换位置,把原数据前面20%放置到后面,为了保持与对象增加一致\r\n\t ArrayList<ArrayList<Integer>> origData=data1.get_addDS();\r\n\t origData.addAll(addData);\t \t \r\n\t \r\n\t data1=null;\r\n\t\t \r\n\t Iterator<ArrayList<Integer>> value = origData.iterator();\r\n\t \r\n\t ArrayList<ArrayList<Integer>> result_POS=new ArrayList<ArrayList<Integer>>();\r\n\t ArrayList<Integer> POS_Reduct=new ArrayList<Integer>();\r\n\t ArrayList<Integer> original_POS=new ArrayList<Integer>();\r\n\t ArrayList<Integer> original_reduct=new ArrayList<Integer>();\r\n\t int[][] original_sys;\r\n\t ArrayList<Integer> P=new ArrayList<Integer>();\r\n\t IDS_POSD im1=new IDS_POSD(origData);\r\n\t \r\n\t POS_Reduct=im1.getPOS_Reduct(im1.getUn());\t \r\n\t original_POS=im1.getPOS(im1.getUn(),POS_Reduct);\r\n\t \r\n\t original_reduct.addAll(POS_Reduct);\r\n\t \t \r\n\t //original_sys=im1.getUn();\r\n\t int n1=im1.getUn().length;//原决策系统Un包含n个对象\r\n\t int s1=im1.getUn()[0].length;//m个属性,包含决策属性\t\r\n\t original_sys=new int[n1][s1];\r\n\t for(int i=0;i<n1;i++)\r\n\t \t for(int j=0;j<s1;j++)\r\n\t \t\t original_sys[i][j]=im1.getUn()[i][j];\r\n\r\n\t IDS_POSD im2=new IDS_POSD();\r\n\t \r\n\t ArrayList<Integer> temp=new ArrayList<Integer>();\r\n\t long startTime = System.currentTimeMillis(); //获取开始时间\r\n\t\t while (value.hasNext()) {\r\n\t\t\t \t\r\n\t\t\t temp.addAll(value.next());//System.out.println(temp);\r\n\t\t\t\tim2.setUn(origData);\r\n\t\t\t\tim2.setUx(temp);\t\r\n\t\t\t\tresult_POS=im2.SHU_IARS(im2.getUn(),original_reduct,original_POS,im2.getUx());\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t original_reduct=result_POS.get(0);\r\n\t\t\t original_POS=result_POS.get(1);\r\n\t\t\t \r\n\t\t\t\tk++;\r\n\t\t\t\tcount--;\r\n\t\t\t\tif(k%m==0){\r\n\t\t\t\t\t\r\n\t\t\t\t\tlong endTime=System.currentTimeMillis(); //获取结束时间 \r\n\t\t\t\t\ttime[t++]=endTime-startTime;//输出每添加10%数据求约简的时间\r\n\t\t\t\t\tif(t==8)\r\n\t\t\t\t\t\tt--;\r\n\t\t\t\t}\r\n\t\t\t\tvalue.remove();\r\n\t\t\t\ttemp=new ArrayList<Integer>();//.clear();\r\n\t\t\t\tif (count==0)\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t \r\n\t\t for(int i=0;i<8;i++)\t\t\t\t\r\n\t\t\t System.out.print((double)time[i]/1000+\" \"); \r\n\r\n\t\t System.out.println(\"\\n\"+fileName+\"上POSD的约简为:\"+result_POS.get(0)+\"\\n\");\t\t\r\n\t}", "public static void main(String[] args) {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tSystem.out.println(\"Enter the number of members: \");\n\t\tnumberOfMembers = scanner.nextInt();\n\t\tSystem.out.println(\"Enter the number of timestamps: \");\n\t\tnumberOfTimestamps = scanner.nextInt();\n\t\tscanner.close();\n\t\t\n\t\t/**\n\t\t * Generating logFile with values given by user,\n\t\t * calculating time taken to generate and printing that time.\n\t\t */\n\t\tstartTime = System.nanoTime();\n\t\tgenerateLogFile(numberOfMembers, numberOfTimestamps);\n\t\ttimeLast = System.nanoTime() - startTime;\n\t\tcalculateTime(\"File generated in\", timeLast);\n\t\t\n\t\t/**\n\t\t * Initializing algorithm instances,\n\t\t * calculating time taken to initialize and printing that time.\n\t\t */\n\t\tstartTime = System.nanoTime();\n\t\tquickFind = new QuickFindUF(numberOfMembers);\n\t\tquickUnion = new QuickUnionUF(numberOfMembers);\n\t\tweightedQuickUnion = new WeightedQuickUnionUF(numberOfMembers);\n\t\tweightedQuickUnionByHeight = new WeightedQuickUnionByHeightUF(numberOfMembers);\n\t\tquickUnionPathCompression = new QuickUnionPathCompressionUF(numberOfMembers);\n\t\tweightedQuickUnionPathCompression = new WeightedQuickUnionPathCompressionUF(numberOfMembers);\n\t\ttimeLast = System.nanoTime() - startTime;\n\t\tcalculateTime(\"Instances generated in\", timeLast);\n\t\t\n\t\t/**\n\t\t * Running algorithms and initializing variables of time taken.\n\t\t */\n\t\tdouble quickFindTime = runAlgorithm(quickFind);\n\t\tdouble quickUnionTime = runAlgorithm(quickUnion);\n\t\tdouble weightedQuickUnionTime = runAlgorithm(weightedQuickUnion);\n\t\tdouble weightedQuickUnionByHeightTime = runAlgorithm(weightedQuickUnionByHeight);\n\t\tdouble quickUnionPathCompressionTime =runAlgorithm(quickUnionPathCompression);\n\t\tdouble weightedQuickUnionPathCompressionTime = runAlgorithm(weightedQuickUnionPathCompression);\n\t\t\n\t\t/**\n\t\t * Creating list of times taken to run by different algorithms\n\t\t * to get the shortest time taken.\n\t\t */\n\t\tArrayList<Double> algorithmTimes = new ArrayList<>();\n\t\talgorithmTimes.add(quickFindTime);\n\t\talgorithmTimes.add(quickUnionTime);\n\t\talgorithmTimes.add(weightedQuickUnionTime);\n\t\talgorithmTimes.add(weightedQuickUnionByHeightTime);\n\t\talgorithmTimes.add(quickUnionPathCompressionTime);\n\t\talgorithmTimes.add(weightedQuickUnionPathCompressionTime);\n\t\tCollections.sort(algorithmTimes);\n\t\tdouble shortestTime = algorithmTimes.get(0);\n\t\t\n\t\t/**\n\t\t * Printing comparison of time taken by algorithms in relation to the shortest time. \n\t\t */\n\t\tSystem.out.println(\"\\n\");\n\t\tSystem.out.println(\"Times Comparison\");\n\t\tSystem.out.println(\"======================================================\");\n\t\tSystem.out.printf(quickFind.getClass().getSimpleName() + \"\\t\\t\\t\\t%.5f%n\"\n\t\t\t\t+ quickUnion.getClass().getSimpleName() + \"\\t\\t\\t\\t%.5f%n\"\n\t\t\t\t+ weightedQuickUnion.getClass().getSimpleName() + \"\\t\\t\\t%.5f%n\"\n\t\t\t\t+ weightedQuickUnionByHeight.getClass().getSimpleName() + \"\\t\\t%.5f%n\"\n\t\t\t\t+ quickUnionPathCompression.getClass().getSimpleName() + \"\\t\\t%.5f%n\"\n\t\t\t\t+ weightedQuickUnionPathCompression.getClass().getSimpleName() + \"\\t%.5f%n\",\n\t\t\t\tquickFindTime/shortestTime, quickUnionTime/shortestTime,weightedQuickUnionTime/shortestTime, \n\t\t\t\tweightedQuickUnionByHeightTime/shortestTime, quickUnionPathCompressionTime/shortestTime, weightedQuickUnionPathCompressionTime/shortestTime);\n\t}", "public static void main(String[] args) {\n String ttime = getDurationString(200,45);\n System.out.println(ttime);\n ttime = getDurationString(400);\n System.out.println(ttime);\n }", "long getTimeSpoutBoltF();", "public static void main(String[] args) {\n int listSize = 100000;\n\n // Randomly generates and assigns number quantity to an array\n double[] numbers = new double[listSize];\n for(int i = 0; i < numbers.length; i++){\n numbers[i] = Math.random() * numbers.length;\n }\n // Initial the stop watch method, start clock and start sorting the array then stop clock\n StopWatch StopWatch = new StopWatch();\n StopWatch stopWatchPrinter = new StopWatch();\n Arrays.sort(numbers);\n stopWatchPrinter.stop();\n\n // Print time elapsed from StopWatch class values\n System.out.print(\"The time elapsed is \" + stopWatchPrinter.getElapsedTime());\n\n }", "@Override\n\tpublic void prepare(Map stormConf, TopologyContext context,\n\t\t\tOutputCollector collector) {\n\t\tthis.collector=collector;\n\t\ttairManager=TairFactory.tairInstance();\n\t\texecutorService.execute(new Runnable() {\n\t\t\t\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\twhile(!stopThread) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(200); \n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tList<Long> platformMapList=new ArrayList<Long>(platformMap.keySet());\n\t\t\t\t\tif(!platformMapList.isEmpty()) {\n\t\t\t\t\t\tstartTime=(long) Collections.min(platformMapList);\n\t\t\t\t\t\tendTime=(long) Collections.max(platformMapList);\n\t\t\t\t\t}\n\t\t\t\t\tdouble wirelessAmount=0;\n\t\t\t\t\tdouble pcAmount=0;\n\t\t\t\t\t//double ratio=0;\n\t\t\t\t\t//boolean result;\n\t\t\t\t\t//LOG.info(\"startTime is \" + startTime +\" endTime is \" + endTime);\n\t\t\t\t\tfor(long i = startTime; i<=endTime; i+=60) {\n\t\t\t\t\t\twirelessAmount+=platformMap.get(i).getWirelessAmount();\n\t\t\t\t\t\tpcAmount+=platformMap.get(i).getPcAmount();\n\t\t\t\t\t\t/*if(pcAmount>0.01) {\n\t\t\t\t\t\t\tratio=wirelessAmount/pcAmount;\n\t\t\t\t\t\t\tresult = tairManager.put(RaceConfig.TairNamespace, ratioPrefix +i, df.format(ratio));\n\t\t\t\t\t\t\t//LOG.info(\"Tair Input: \"+ RaceConfig.prex_ratio + i + \": \" + pcAmount + \" \" + wirelessAmount + \" \" + df.format(ratio));\n\t\t\t\t\t\t\tif (!result.isSuccess())\n\t\t\t\t\t\t\t\tLOG.error(\"fail input: \"+ ratioPrefix + i + \":\" + df.format(ratio));\n\t\t\t\t\t\t}*/\n\t\t\t\t\t\t//7.10改为判断变化再更新\n\t\t\t\t\t\tif(!platformAllMap.containsKey(i)){\n\t\t\t\t\t\t\t//交易总额初始化\n\t\t\t\t\t\t\tRatioCount ratioCount = new RatioCount();\n\t\t\t\t\t\t\tratioCount.setPcAmountAll(pcAmount);\n\t\t\t\t\t\t\tratioCount.setWirelessAll(wirelessAmount);\n\t\t\t\t\t\t\tplatformAllMap.put(i, ratioCount);\n\t\t\t\t\t\t\tratioCount.writeIntoTair(ratioPrefix, i, tairManager, df);\n\t\t\t\t\t\t\t/*if (!result)\n\t\t\t\t\t\t\t\tLOG.error(\"fail input: \"+ RaceConfig.prex_ratio + i + \":\" + df.format(ratioCount.getRatio()));*/\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t//当前时分交易总额对比,有更新则写入Tair\n\t\t\t\t\t\t\tdouble pcAll = platformAllMap.get(i).getPcAmountAll();\n\t\t\t\t\t\t\tdouble wirelessAll = platformAllMap.get(i).getWirelessAmountAll();\n\t\t\t\t\t\t\t//platformAllLock.lock();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(pcAll<pcAmount)\n\t\t\t\t\t\t\t\tplatformAllMap.get(i).setPcAmountAll(pcAmount);\n\t\t\t\t\t\t\tif(wirelessAll<wirelessAmount)\n\t\t\t\t\t\t\t\tplatformAllMap.get(i).setWirelessAll(wirelessAmount);\n\t\t\t\t\t\t\tplatformAllMap.get(i).writeIntoTair(ratioPrefix, i, tairManager, df);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/*if (!result)\n\t\t\t\t\t\t\t\tLOG.error(\"fail input: \"+ RaceConfig.prex_ratio + i + \":\" + df.format(platformAllMap.get(i).getRatio()));*/\n\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\n\t\t\t}\n\t\t});\n\t}", "public static void main(String [] args ) {\n String a = \"ASDFASD=ab = dsf ='ab\";\n String [] arr = a.split(\"=\");\n int b = 111;\n SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");//设置日期格式\n String timeStr = \"2016-12-06 00:00:00\";\n\n try {\n long endStamp = df.parse(timeStr).getTime();\n long startStamp = endStamp - 24*3600*1000;\n System.out.println(df.format(startStamp));\n } catch (ParseException e) {\n e.printStackTrace();\n }\n\n System.out.println(df.format(new Date()));\n\n\n System.out.println(b/100);\n test tt = new test();\n System.out.println(tt.a);\n String iI = AnalyseFactory.createAnalyse(JDealDataPS).itemInstr;\n System.out.println(iI);\n }", "public static void main(String[] args)\r\n\t{\n\t\tSystem.out.println(\"Welcome to Longest Commmon Subsequence Problem\");\r\n\t\tString s1=\"shahid\";\r\n\t\tString s2=\"sidhahid\";\r\n\t\tSystem.out.printf(\"Longest Common Susbequnce between\\n'%s' and '%s' is of %d letters\",s1,s2,getLCS(s1,s2,0,0));\r\n\t}", "private static String elapsed(long start) {\r\n\treturn \": elapsed : \" + (System.currentTimeMillis() - start) + \" ms \";\r\n }", "private String msg3() {\n return(\"[\" + (System.currentTimeMillis() - system_start_time) + \"] \");\n }", "@Override\n public void run() {\n ElapsedTime time = new ElapsedTime();\n time.reset();\n while (!sh.liftReady && time.milliseconds() < 1500) {\n }\n //\n sh.pivotPID(650, true, .07/650, .01, .01/650, 2);\n sh.pivotPID(640, false, .07/640, .01, .01/640, 2);\n\n\n\n }", "public static int getMinDistanceTime(Asteroid a, Asteroid b) {\n\n\t\tdouble minDistance = -1;\n\t\tint minDistTime = Integer.MAX_VALUE;\n\t\tfor(int t = 0; t < 20*365; t++){\n\t\t\tdouble distance = Point.distance(a.orbit.positionAt((long)t - a.epoch),b.orbit.positionAt((long)t - b.epoch));\n\t\t\tif(distance < minDistance){\n\t\t\t\tminDistance = distance;\n\t\t\t\tminDistTime = t;\n\t\t\t}\t\t\t\n\t\t}\n\t\treturn minDistTime;\n\t}", "public static void main(String[] args) throws InterruptedException {\n String fermate = \"\";\r\n Scanner scanner = new Scanner(System.in);\r\n System.out.println(\"Inserisci le fermate:(ogni fermata deve essere diviso da una ,)\");\r\n fermate = scanner.nextLine();\r\n fermate+=\", \";\r\n String[] fermateBus = fermate.split(\",\");\r\n ArrayList<String[]> elencoCorse = new ArrayList<String[]>();\r\n elencoCorse.add (AddCorsa(1));\r\n elencoCorse.add (AddCorsa(2));\r\n elencoCorse.add (AddCorsa(3));\r\n elencoCorse.add (AddCorsa(4));\r\n elencoCorse.add (AddCorsa(5));\r\n String ComunePartenza = \"\";\r\n String ComuneArrivo = \"\";\r\n System.out.println(\"Inserisci il comune di partenza\");\r\n ComunePartenza = scanner.nextLine();\r\n System.out.println(\"Inserisci il comune di arrivo\");\r\n ComuneArrivo = scanner.nextLine();\r\n //Thread\r\n DatiCondivisi datiCon = new DatiCondivisi(ComunePartenza, ComuneArrivo, fermateBus, elencoCorse);\r\n CercaTh th1 = new CercaTh(datiCon, 0);\r\n CercaTh th2 = new CercaTh(datiCon, 1);\r\n CercaTh th3 = new CercaTh(datiCon, 2);\r\n CercaTh th4 = new CercaTh(datiCon, 3);\r\n CercaTh th5 = new CercaTh(datiCon, 4);\r\n th1.start();\r\n th2.start();\r\n th3.start();\r\n th4.start();\r\n th5.start();\r\n th1.join();\r\n th2.join();\r\n th3.join();\r\n th4.join();\r\n th5.join();\r\n //al termine il programma visualizzerà il numero di corse trovate e gli orari di ogni corsa\r\n if (datiCon.getCountCorseTrovate() > 0) {\r\n System.out.println(\"Corse trovate:\" + datiCon.getCountCorseTrovate());\r\n visualizza(datiCon.getOrePartArr());\r\n } else {\r\n System.out.println(\"Corse non trovate\");\r\n }\r\n }", "public static void main(String[] args)\r\n\t{\n\t\tBoundedBuffer producerConsumer = new BoundedBuffer(10, 2, 5, 100);\r\n\t\t//long timeOne = producerConsumer.run();\r\n\t\t\r\n\t\t//producerConsumer = new BoundedBuffer(10, 2, 5, 100);\r\n\t\t\r\n\t\tlong timeTwo = producerConsumer.run();\r\n\t\t\r\n\t\t//System.out.println(\"Time to Finish Locks(5 Producers, 2 Consumers: \" + timeOne + \" ms\");\r\n\t\tSystem.out.println(\"Time to Finish Locks(2 Producers, 5 Consumers: \" + timeTwo + \" ms\");\r\n\t}", "public void BruteForceSimilarity(String s1, String s2, int sLength) {\n\n s1_Array = splitStringIntoArray(s1, sLength);\n s2_Array = splitStringIntoArray(s2, sLength);\n\n// for (int i = 0; i < s1_Array.size(); i++) {\n//// System.out.println(s1_Array.get(i));\n// }\n// System.out.println(\"**************************\");\n//\n// for (int i = 0; i < s2_Array.size(); i++) {\n// System.out.println(s2_Array.get(i));\n// }\n\n }", "public static void main(String[] args) {\n\t\tint arr[] = {20,35,-15,-15,7,55,1,-22};\n//\t\tint arr[] = {7,4,8,2};\n\n\t\tTimestamp timestamp = new Timestamp(System.currentTimeMillis());\n System.out.println(timestamp);\n\t\tfor(int gap = arr.length/2 ; gap >0 ; gap = gap/2)\n\t\t{\n\n\t\t\tfor(int i = gap ; i < arr.length;i++)\n\t\t\t{\n\t\t\t\tint key = arr[i];\n\t\t\t\tint j = i;\n\n\n\t\t\t\twhile(j>= gap && arr[j- gap] > key)\n\t\t\t\t{\n\t\t\t\t\tarr[j] = arr[j - gap];\n\t\t\t\t\tj = j- gap;\n\t\t\t\t}\n\t\t\t\tarr[j] = key;\n\t\t\t}\n\n\t\t}\n\t\tTimestamp timestamp1 = new Timestamp(System.currentTimeMillis());\n System.out.println(timestamp1);\n\t\t\n\t\tprint(arr);\n\t}", "public static void sorting() {\n List<String> wordList = new ArrayList<>();\n for (int i = 0; i < 500000; i++)\n wordList.add(UUID.randomUUID().toString());\n\n //Sort and filter the list using compare to sequentially\n long t1s = System.nanoTime();\n List<String> a =wordList.stream()\n .filter((String s) -> s.contains(\"Z\") ? true : false)\n .sorted((s1, s2) -> s1.compareTo(s2))\n .collect(Collectors.toList());\n long t1d = System.nanoTime() - t1s;\n\n //Sort and filter the list using compare to in parallel\n long t2s = System.nanoTime();\n List<String> b = wordList.parallelStream()\n .filter((String s) -> s.contains(\"Z\") ? true : false)\n .sorted((s1, s2) -> s1.compareTo(s2))\n .collect(Collectors.toList());\n long t2d = System.nanoTime() - t2s;\n\n System.out.println(\"Filter + Sort Serial time : \" + t1d);\n System.out.println(\"Filter + Sort Parallel time : \" + t2d);\n }", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int t = sc.nextInt();\n for(int ii=0;ii<t;ii++){\n String str = sc.next();\n int sa[] = getSuffixArray(str);\n int lcp[] = getLCP(sa,str);\n int n = str.length();\n long range[] = new long[n];\n for(int i=0;i<n;i++){\n long len = (long)(n-sa[i]);\n range[i] = (long)(len*(len+1)/2)-(long)(lcp[i]*(lcp[i]+1)/2);\n }\n long k = sc.nextLong();\n for(int i=0;i<n;i++){\n int s = sa[i];\n int lc = lcp[i];\n if(range[i]>=k){\n int len = 1+lc;\n while(k>len){\n k -= len;\n len++;\n }\n System.out.println(str.charAt(s+(int)k-1));\n break;\n }\n else\n k -= range[i];\n }\n }\n }", "public static void main(String[] args) {\n\t\n\t\tArrayList DP_result=DP_min_operation(98734);\n\t\tArrayList result_arry=step_to_primitive_cal(98734,DP_result);\n\t\tSystem.out.println(result_arry);\n\t\tSystem.out.println(result_arry.size());\n\n\t}", "public static void main(String[] args) {\n\n\t\t SimpleDateFormat sf = new SimpleDateFormat(\"yyyyMMddHHmmssSSS\");\n\t\t// for(int i=0; i<100; i++) {\n\t\t// String strDT = sf.format(new Date(System.currentTimeMillis()));\n\t\t// System.out.println(strDT);\n\t\t// }\n\n\t\t\n\t\tDate oldDate = new Date();\n\t\tCalendar gcal = new GregorianCalendar();\n\t\tgcal.setTime(oldDate);\n\t\tgcal.add(Calendar.SECOND, -4468);\n\t\tDate newDate = gcal.getTime();\n\t\tSystem.out.println(sf.format(oldDate));\n\t\tSystem.out.println(sf.format(newDate));\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(\"start . . . \");\n\t\tlong start = System.currentTimeMillis();\n\t\t//rankOffer();\n\t\t//statisticOffer();\\\n\t\t//displayOffer();\n\t\t//idReplace();\n\t\tupdate();\n\t\t//randName();\n\t\tlong end = System.currentTimeMillis();\n\t\tSystem.out.println(\"end use time : \"+ (end-start)+\" ms .\");\n\t}", "public static void main(String args[])\r\n\t{\n\t\tSystem.out.println( getSAPDateAndTime(\"20210426 135157\") );\r\n\t}", "private void longestCommonSubsequence(String str1, String str2) {\n\tdp\t= new int[str1.length()+1][str2.length()+1];\t\r\n\tString lcs = \"\";\r\n\tint i=0,j=0;\r\n\tfor(i=0;i<str1.length();i++){\r\n\t\tfor(j=0;j<str2.length();j++){\r\n\t\t\r\n\t\t\tif(str1.charAt(i)==str2.charAt(j)){\r\n\t\t\t\tdp[i+1][j+1] = dp[i][j] + 1; \r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tdp[i+1][j+1] =\r\n Math.max(dp[i+1][j], dp[i][j+1]);\r\n\t\t\t}\r\n\t\t}\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}\r\n\t\tSystem.out.println(dp[dp.length-1][dp[0].length-1]);\r\n\t\t\r\n\t}", "static String getTimeAndSizeFromLog(String fileName){\n\t\tString res = \"\";\n\t\t\n//\t\tFile logFile = new File(\"R:/Eclipse/Partitionner/out/log_atl2_AllRanges_1000_30_20_20150629-1640.log\");\n//\t\tArrayList<ArrayList<String>> fileNames = Utils.extractModelsFromLogFile(logFile);\n\t\tArrayList<String> listNames = new ArrayList<>();\n\t\t\n\t\tString l = \"\", listModels = \"\", timeElapsed = \"\", checkRates = \"\";\n\t\t\n\t\tFile f = new File(Config.DIR_OUT+fileName);\n\t\t\n\t\tSystem.out.println(\"Reading '\"+f.getAbsolutePath()+\"'...\\t\");\n\t\ttry {\n\t\t\tPattern p=Pattern.compile(\"\\\\{.*\\\\}\");\n\t\t\tScanner scanner = new Scanner(f);\n while (scanner.hasNextLine()) { \n l = scanner.nextLine();\n if(l.trim().startsWith(\"Time\")){//Time elapsed : 5:28:19:125\n\t\t\t\t\tMatcher ma=Pattern.compile(\"\\\\:.*\").matcher(l);\n\t\t\t\t\t while(ma.find()) \n\t\t\t\t\t\t timeElapsed = ma.group().substring(1, ma.group().length()-1).trim();\n\t\t\t\t}\n if(l.trim().startsWith(\"Best\")){//Time elapsed : 5:28:19:125\n\t\t\t\t\tMatcher ma=Pattern.compile(\"Best\\\\:[\\\\S]*,{1}\").matcher(l);\n\t\t\t\t\t while(ma.find()) \n\t\t\t\t\t\t checkRates = ma.group().substring(\"Best:\".length(), ma.group().length()-1).trim();\n\t\t\t\t}\n \n\t\t\t\tif(l.trim().startsWith(\"Best\")){//Best:0.89...8,0.96...4,10 (MS15386:10 Models):(COV:89,DIS:96) rd(0,0)\t 10{model_00581.xmi,mo[...]8551.xmi}\n\t\t\t\t\tMatcher ma=p.matcher(l);\n\t\t\t\t\t while(ma.find()) \n\t\t\t listModels = ma.group().substring(1, ma.group().length()-1);\n\t\t\t\t}\n\t\t\t}\n scanner.close();\n listNames = Utils.extractModelsFromList(Config.DIR_INSTANCES+Config.METAMODEL_NAME+File.separator, \n \t\t\t\tlistModels\t\t\t\t\n \t\t\t\t,\",\");\n\n \t\tModelSet ms = new ModelSet(listNames);\n \t\tint totalClasses = 0, totalProperties = 0;\n \t\tfor (Model m : ms.getModels()) {\n \t\t\ttotalClasses += m.getNbClasses();\n \t\t\ttotalProperties += m.getNbProperties();\n \t\t}\n \t\tfloat avgClasses = (float)totalClasses / ms.size();\n \t\tfloat avgProperties = (float)totalProperties / ms.size();\n \t\tres= \";\"+timeElapsed+\";\"+avgClasses+\";\"+avgProperties;\n \t\tSystem.out.println(\" Average model size : \"+checkRates+\"..\\t\"+res);\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"WARNING : Could not process file '\"+f.getAbsolutePath()+\"'\");\n//\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t\n\t\t\n\n\t\treturn res;\n\t}", "private static int[] race(int v1, int v2, int g){\n\n float distance = g;\n float speedDifference = v2-v1;\n float time = g / speedDifference;\n\n int[] res = new int[3];\n res[0] = (int) time;\n res[1] = (int) (60 * (time-res[0]));\n res[2] = (int) (time * 3600) % 60;\n\n return res;\n }", "@DISPID(56)\r\n\t// = 0x38. The runtime will prefer the VTID if present\r\n\t@VTID(54)\r\n\tint actualCPUTime_Milliseconds();", "public static void main(String[] args) {\n\t\tlong start = System.currentTimeMillis();\r\n\t\t Scanner sc = new Scanner(System.in);\r\n\t int length = sc.nextInt();\r\n\t \r\n\t int[] n = new int[length];\r\n\t \r\n\t for (int i = 0; i < n.length ; ++i) n[i] = sc.nextInt();\r\n\t sc.close();\t \r\n\t Arrays.sort(n);\r\n\t \r\n\t for (int i = 0; i < n.length ; ++i) System.out.println(n[i]);\r\n\t long end = System.currentTimeMillis();\r\n\t System.out.println((end-start)/1000.0);\r\n\t}", "public static void main(String[] args) {\r\n\t\tPosition p2 = new Position(47.984393, 0.236012);\r\n\t\t/*graine*/\r\n\t\tPosition p1 = new Position(47.987444,0.253475);\r\n\t\t\r\n\t\tFourmi fourmi = new Fourmi();\r\n\t\tChemin trackAllerGraine1;\r\n\t\tChemin trackRetourGraine1;\r\n\t\t\r\n\t\tChemin c = new Chemin();\r\n\t\tChemin c1 = new Chemin();\r\n\t\ttry {\r\n\t\t\tc.calculItineraire(p2,p1);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tc.add(p1);\r\n\t\ttrackAllerGraine1 = fourmi.creerTrack(c);\r\n\t\r\n\t\t\r\n\r\n\t\tfor(int i=0;i<trackAllerGraine1.size()-1;i++) {\r\n\t\t\tSystem.out.println(\"\\np\"+i+\" : \"+trackAllerGraine1.get(i).lat+\",\"+trackAllerGraine1.get(i).lon);\r\n\t\t\tSystem.out.println(trackAllerGraine1.get(i).getTimestamp());\r\n\t\t\tSystem.out.println(\"La distance entre ces deux points est de \"+p1.longueurEnM(trackAllerGraine1.get(i),trackAllerGraine1.get(i+1))+\"m\");\r\n\t\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(\"p\"+(trackAllerGraine1.size()-1)+\" : \"+trackAllerGraine1.get(trackAllerGraine1.size()-1).lat+\",\"+trackAllerGraine1.get(trackAllerGraine1.size()-1).lon);\r\n\t\tSystem.out.println(trackAllerGraine1.get(trackAllerGraine1.size()-1).getTimestamp());\r\n\t\t\r\n\t\ttry {\r\n\t\t\tc1.calculItineraire(p1, p2);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\tc1.add(p2);\r\n\t\ttrackRetourGraine1=fourmi.creerTrack(c1);\r\n\t\t\r\n\t\tfor(int i=0;i<trackRetourGraine1.size()-1;i++) {\r\n\t\t\tSystem.out.println(\"\\np\"+i+\" : \"+trackRetourGraine1.get(i).lat+\",\"+trackRetourGraine1.get(i).lon);\r\n\t\t\tSystem.out.println(trackRetourGraine1.get(i).getTimestamp());\r\n\t\t\tSystem.out.println(\"La distance entre ces deux points est de \"+p1.longueurEnM(trackRetourGraine1.get(i),trackRetourGraine1.get(i+1))+\"m\");\r\n\t\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(\"p\"+(trackRetourGraine1.size()-1)+\" : \"+trackRetourGraine1.get(trackRetourGraine1.size()-1).lat+\",\"+trackRetourGraine1.get(trackRetourGraine1.size()-1).lon);\r\n\t\tSystem.out.println(trackRetourGraine1.get(trackRetourGraine1.size()-1).getTimestamp());\r\n\t}", "public static void main(String[] args) {\n\n try {\n FastScanner scanner = new FastScanner(Files.newInputStream(Paths.get(\"./sample/5_3_edit_distance.in\")));\n String s1 = scanner.next();\n String s2 = scanner.next();\n\n System.out.println(dpEditDistanceTwoString(s1, s2, s1.length(), s2.length()));\n } catch (IOException ioe) {\n ioe.printStackTrace();\n }\n }", "public float getSpeed(List<Integer> collectTime);", "public void parseGCRecord(double timestamp, String line) {\n /*\n (STW) [GC (CMS Initial Mark) [1 CMS-initial-mark: 53400K(344064K)] 79710K(498944K), 0.0032015 secs] [Times: user=0.01 sys=0.00, real=0.00 secs]\n [CMS-concurrent-mark-start]\n [CMS-concurrent-mark: 0.005/0.005 secs] [Times: user=0.02 sys=0.00, real=0.01 secs]\n [CMS-concurrent-preclean-start]\n [CMS-concurrent-preclean: 0.002/0.002 secs] [Times: user=0.01 sys=0.00, real=0.00 secs]\n [CMS-concurrent-abortable-preclean-start]\n [CMS-concurrent-abortable-preclean: 0.711/1.578 secs] [Times: user=5.00 sys=0.12, real=1.58 secs]\n (STW) [GC (CMS Final Remark) [YG occupancy: 97189 K (154880 K)]2017-11-20T19:55:50.907+0800: 4.148: [Rescan (parallel) , 0.0325130 secs]2017-11-20T19:55:50.940+0800: 4.181: [weak refs processing, 0.0000407 secs]2017-11-20T19:55:50.940+0800: 4.181: [class unloading, 0.0059425 secs]2017-11-20T19:55:50.946+0800: 4.187: [scrub symbol table, 0.0044211 secs]2017-11-20T19:55:50.950+0800: 4.191: [scrub string table, 0.0006347 secs][1 CMS-remark: 118936K(344064K)] 216125K(498944K), 0.0442861 secs] [Times: user=0.13 sys=0.00, real=0.04 secs]\n [CMS-concurrent-sweep-start]\n [CMS-concurrent-sweep: 0.002/0.002 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]\n [CMS-concurrent-reset-start]\n [CMS-concurrent-reset: 0.108/0.109 secs] [Times: user=0.34 sys=0.05, real=0.11 secs]\n */\n\n // Full GC\n if (line.startsWith(\"[CMS-concurrent\") || line.startsWith(\"[GC (CMS Initial Mark)\") || line.startsWith(\"[GC (CMS Final Remark)\")) {\n\n if (line.startsWith(\"[GC (CMS Initial Mark)\")) {\n // 53400K(344064K)] 79710K(498944K), 0.0032015 secs\n String CMS_initial_mark = line.substring(line.indexOf(':') + 2, line.indexOf(\"secs]\") + 4);\n double oCurrentMB = computeMB(CMS_initial_mark.substring(0, CMS_initial_mark.indexOf('K')));\n double oldMB = computeMB(CMS_initial_mark.substring(CMS_initial_mark.indexOf(\"(\") + 1, CMS_initial_mark.indexOf(\"K)\")));\n\n // 79710K(498944K), 0.0032015 secs\n CMS_initial_mark = CMS_initial_mark.substring(CMS_initial_mark.indexOf(']') + 2);\n double heapCurrentMB = computeMB(CMS_initial_mark.substring(0, CMS_initial_mark.indexOf('K')));\n double heapMB = computeMB(CMS_initial_mark.substring(CMS_initial_mark.indexOf('(') + 1, CMS_initial_mark.indexOf(\"K)\")));\n\n double fgcSeconds = Double.parseDouble(CMS_initial_mark.substring(CMS_initial_mark.indexOf(\", \") + 2, CMS_initial_mark.indexOf(\" secs\")));\n\n// double yCurrentMB = heapCurrentMB - oCurrentMB;\n// double youngMB = heapMB - oldMB;\n//\n// usage.addYoungUsage(timestamp, yCurrentMB, youngMB, \"FGC\");\n //usage.addOldUsage(timestamp, oCurrentMB, oldMB, \"FGC\");\n\n } else if (line.startsWith(\"[GC (CMS Final Remark)\")) {\n // 97189 K (154880 K)\n String YG_occupancy = line.substring(line.indexOf(':') + 2, line.indexOf(']'));\n double yCurrentMB = computeMB(YG_occupancy.substring(0, YG_occupancy.indexOf('K') - 1));\n double youngMB = computeMB(YG_occupancy.substring(YG_occupancy.indexOf(\"(\") + 1, YG_occupancy.indexOf(\"K)\") - 1));\n\n // 118936K(344064K)] 216125K(498944K), 0.0442861 secs] [Times: user=0.13 sys=0.00, real=0.04 secs]\n String CMS_remark = line.substring(line.indexOf(\"CMS-remark\") + 12);\n double oCurrentMB = computeMB(CMS_remark.substring(0, CMS_remark.indexOf('K')));\n double oldMB = computeMB(CMS_remark.substring(CMS_remark.indexOf(\"(\") + 1, CMS_remark.indexOf(\"K)\")));\n\n // 216125K(498944K), 0.0442861 secs] [Times: user=0.13 sys=0.00, real=0.04 secs]\n CMS_remark = CMS_remark.substring(CMS_remark.indexOf(']') + 2);\n double heapCurrentMB = computeMB(CMS_remark.substring(0, CMS_remark.indexOf('K')));\n double heapMB = computeMB(CMS_remark.substring(CMS_remark.indexOf('(') + 1, CMS_remark.indexOf(\"K)\")));\n\n double fgcSeconds = Double.parseDouble(CMS_remark.substring(CMS_remark.indexOf(\", \") + 2, CMS_remark.indexOf(\" secs\")));\n\n //usage.addYoungUsage(timestamp, yCurrentMB, youngMB, \"FGC\");\n //usage.addOldUsage(timestamp, oCurrentMB, oldMB, \"FGC\");\n\n }\n }\n // Young GC\n /*\n [GC (Allocation Failure) 2017-11-20T19:55:51.305+0800: 4.546: [ParNew: 148472K->15791K(154880K), 0.0136927 secs] 267406K->137259K(498944K), 0.0138721 secs] [Times: user=0.04 sys=0.01, real=0.02 secs]\n [GC (GCLocker Initiated GC) 2017-11-20T19:55:52.467+0800: 5.708: [ParNew: 2611K->1477K(154880K), 0.0019634 secs] 132956K->131822K(498944K), 0.0020074 secs] [Times: user=0.02 sys=0.00, real=0.00 secs]\n CMS: abort preclean due to time 2017-11-20T19:57:04.539+0800: 77.780: [CMS-concurrent-abortable-preclean: 0.651/5.055 secs] [Times: user=0.65 sys=0.01, real=5.06 secs]\n */\n else if (line.startsWith(\"[GC\") && line.contains(\"[ParNew:\")){\n String ygcCause = line.substring(line.indexOf('(') + 1, line.indexOf(')'));\n\n // 148472K->15791K(154880K), 0.0136927 secs\n String ParNew = line.substring(line.indexOf(\"[ParNew:\") + 9, line.indexOf(']'));\n // System.out.println(ParNew);\n double yBeforeMB = computeMB(ParNew.substring(0, ParNew.indexOf('K')));\n double yAfterMB = computeMB(ParNew.substring(ParNew.indexOf('>') + 1, ParNew.indexOf(\"K(\")));\n double youngMB = computeMB(ParNew.substring(ParNew.indexOf('(') + 1, ParNew.indexOf(\"K)\")));\n\n double ygcSeconds = Double.parseDouble(ParNew.substring(ParNew.indexOf(\", \") + 2, ParNew.indexOf(\" secs\")));\n // System.out.println(ParNew);\n // System.out.println(\" yBeforeMB = \" + yBeforeMB + \", yAfterMB = \" + yAfterMB + \", youngMB = \" + youngMB);\n\n // 267406K->137259K(498944K), 0.0138721 secs\n String heapUsage = line.substring(line.indexOf(\"]\") + 2, line.indexOf(\"] [Times:\"));\n double heapBeforeMB = computeMB(heapUsage.substring(0, heapUsage.indexOf('K')));\n double heapAfterMB = computeMB(heapUsage.substring(heapUsage.indexOf('>') + 1, heapUsage.indexOf(\"K(\")));\n double heapMB = computeMB(heapUsage.substring(heapUsage.indexOf('(') + 1, heapUsage.indexOf(\"K)\")));\n\n double oldBeforeMB = heapBeforeMB - yBeforeMB;\n double oldAfterMB = heapAfterMB - yAfterMB;\n double oldMB = heapMB - youngMB;\n\n //usage.addYoungUsage(timestamp, yBeforeMB, youngMB, \"YGC\");\n //usage.addYoungUsage(timestamp, yAfterMB, youngMB, \"\");\n\n if (oldAfterMB != oldBeforeMB) {\n //usage.addOldUsage(timestamp, oldBeforeMB, oldMB, \"YGC\");\n //usage.addOldUsage(timestamp, oldAfterMB, oldMB, \"\");\n }\n\n }\n }", "public double getCpuTimeSec() {\n\treturn getCpuTime() / Math.pow(10, 9);\t\t\n}", "public long startTime();", "@Test\n @Tag(\"slow\")\n public void testSTANDMPS() {\n CuteNetlibCase.doTest(\"STANDMPS.SIF\", \"1406.0175\", null, NumberContext.of(7, 4));\n }", "public static void main(String args[]) {\n\n\ttry {\n\n\t CommandTokenizer parser = new CommandTokenizer(\"--\");\n\t parser.parse(args);\n\t ConfigurationProperties config = parser.getMap();\n\n\t Logger slogger = LogManager.getLogger(\"SIM\");\n\t slogger.setLogLevel(config.getIntValue(\"log-level\", 3));\n\t ConsoleLogHandler console = new ConsoleLogHandler(new SimulationLogFormatter());\n\t console.setLogLevel(config.getIntValue(\"log-level\", 3));\n\t slogger.addHandler(console);\n\n\t LogProxy logger = new LogProxy(\"QST\",\"\",slogger);\n\n\t Site site = new Site(config.getProperty(\"site\"), \n\t\t\t\t Math.toRadians(config.getDoubleValue(\"lat\")), \n\t\t\t\t Math.toRadians(config.getDoubleValue(\"long\")));\n\t \n\t long start = (ScheduleSimulator.sdf.parse(config.getProperty(\"start\"))).getTime();\n long end = (ScheduleSimulator.sdf.parse(config.getProperty(\"end\"))).getTime();\n\n\t // Instruments.\n\t InstrumentRegistry instruments = (InstrumentRegistry)Naming.lookup(\"rmi://localhost/InstrumentRegistry\");\n\t \n\t // Exec model\n\t File bxf = new File(config.getProperty(\"exec\")); // exec model properties\n BasicExecutionTimingModel bxtm = new BasicExecutionTimingModel(site, instruments);\n\t PropertiesConfigurator.use(bxf).configure(bxtm);\n\n\t // Allow 2 day for this test...\n bxtm.setExternalTimeConstraint(end+30*24*3600*1000L, \"End of simulation\");\n\n\t // Stochastic wrapper.\n\t //File bsef = new File(config.getProperty(\"sexm\")); // stochastic exec model properties\n\t //BasicStochasticExecutionTimingModel bsem = new BasicStochasticExecutionTimingModel(bxtm);\n\t //PropertiesConfigurator.use(bsef).configure(bsem);\n\n\t // TC window calculator.\n\t BasicTimingConstraintWindowCalculator btcwc = new BasicTimingConstraintWindowCalculator(bxtm, site, 5*60*1000L);\n\n\t // Charging\n\t File bcaf = new File(config.getProperty(\"cost\")); // charge model properties\n\t BasicChargeAccountingModel bcam = new BasicChargeAccountingModel();\n\t PropertiesConfigurator.use(bcaf).configure(bcam);\n\n\t // Selector\n //BasicSelectionHeuristic bsel = new BasicSelectionHeuristic();\n\n\t // Env prediction\n\t File bepf = new File(config.getProperty(\"env\")); // Environment properties\t \n\t BasicEnvironmentPredictor bep = new BasicEnvironmentPredictor();\n\t PropertiesConfigurator.use(bepf).configure(bep); \n\t //BasicMutableEnvironmentPredictor bep = new BasicMutableEnvironmentPredictor();\n\t //bep.setPhotom(true);\n\t //bep.setSeeing(seeing);\n\n\n\t // Weather prediction - this will be replaced with Weather scenario model\n\t //File swpf = new File(config.getProperty(\"weather\")); // weather properties\n\t //StandardWeatherPredictor swp = new StandardWeatherPredictor();\n\t //PropertiesConfigurator.use(swpf).configure(swp);\n\t // and pre-compute weather for the full run\n\t //swp.preCompute(start, end);\n\t BasicMutableWeatherModel bwm = new BasicMutableWeatherModel();\n\t bwm.setGood(true);\n\n\t // RTC\n\t // RemainingTimeCalculator rtc = new DummyRemainingTimeCalculator();\n\n\t // ODB\n\t String root = config.getProperty(\"root\");\n\t \n\t Phase2ModelProvider provider = (Phase2ModelProvider)Naming.\n\t\tlookup(\"rmi://localhost/\"+root+\"_Phase2ModelProvider\");\n\t Phase2Model phase2 = provider.getPhase2Model();\n\n\t // History\n BasicHistoryModel history = new BasicHistoryModel();\n\t history.loadHistory(phase2, start);\n\n\t BasicAccountingModel bam = new BasicAccountingModel();\n\t bam.loadAccounts(phase2, start);\n\n\n\t // Select a scoring model here - there will be others \n\t // Scoring model\n\t File smf = new File(config.getProperty(\"score\")); // bogstandard scoring properties\n\t BasicScoringModel bsm = new BasicScoringModel(site);\n\t PropertiesConfigurator.use(smf).configure(bsm);\n\t \n\t BasicCandidateGenerator bcg = new BasicCandidateGenerator(phase2,\n\t\t\t\t\t\t\t\t history,\n\t\t\t\t\t\t\t\t bam,\n\t\t\t\t\t\t\t\t bxtm,\n\t\t\t\t\t\t\t\t bsm);\n\n\n\t // Alternative using despath scheduler\n\t BasicSelectionHeuristic selector = new BasicSelectionHeuristic();\n \t BasicDespatcher bds = new BasicDespatcher(bcg,\n\t\t\t\t\t\t selector);\n\n\n\t slogger.log(1, \"Start sim run...\");\n\n\t // fixed env for now\n\t EnvironmentSnapshot env = new EnvironmentSnapshot();\n\t env.seeing = Group.EXCELLENT;\n\t env.photom = true;\n\n\t // setup some stats.\n\t PriorityUtilityCalculator puc;\n\t OptimalAirmassUtilityCalculator oauc;\n\t RemainingNightsUtilityCalculator rnuc;\n\t ScoringUtilityCalculator suc;\n\n\t oauc = new OptimalAirmassUtilityCalculator(site, btcwc, bxtm, 5*60*1000L);\n\t puc = new PriorityUtilityCalculator(bxtm);\n\t rnuc = new RemainingNightsUtilityCalculator(btcwc);\n\t suc = new ScoringUtilityCalculator(bxtm, bsm, bam);\n \n\t double pqm =0.0;\n\t double oaqm = 0.0;\n\t double rnqm = 0.0;\n\t double xtqm = 0.0;\n\t double ngqm = 0.0;\n\t double sqm = 0.0;\n\n\t int it = 0;\n\t //while (t < end) {\n\n\t int ndays = (int)((end - start)/86400000);\n\t\n\t // run for many days\t\t\n\t for (int in = 0; in < ndays; in++) {\n\t\t\n\t\tlong ds = start + in*86400*1000L;\n\t\tlong de = ds + 86400*1000L;\n\t\t\n\t\t// work out the night length\n\t\tlong night = 0L;\n\t\tlong astro = 0L;\n\t\tlong t = ds;\n\t\twhile (t < de) {\n\t\t Position sun = Astrometry.getSolarPosition(t);\n\t\t double sunElev = sun.getAltitude(t, site);\n\t\t if (sunElev < 0.0)\n\t\t\tnight += 5*60*1000L;\n\t\t if (sunElev < Math.toRadians(-18.0))\n\t\t\tastro += 5*60*1000L;\n\t\t t += 5*60*1000L;\n\t\t}\n\t\t\n\t\t// DAILY totals\n\t\tint ngs = 0;\n\t\tdouble phm = 0.0;\n\t\tdouble oahm = 0.0;\n\t\tdouble rnhm = 0.0;\n\t\tdouble xtm = 0.0;\n\t\tdouble shm = 0.0;\n\n\t\t// a days worth\n\t\tt = ds;\n\t\twhile (t < de) {\n\t\t \n\t\t Position sun = Astrometry.getSolarPosition(t);\n\t\t if (sun.getAltitude(t, site) > Math.toRadians(-1.0)) {\n\t\t\tt += 5*60*1000L;\n\t\t\tlogger.log(1, \"SUNUP at \"+ScheduleSimulator.sdf.format(new Date(t)));\n\t\t\tcontinue;\n\t\t }\n\t\t \n\t\t // Using BDS\n\t\t Metric metric = bds.getScheduleItem(t, env);\n\t\t \n\t\t if (metric == null) {\n\t\t\tt += 5*60*1000L;\n\t\t\tlogger.log(1, \"SELECT \"+it+\" at \"+ScheduleSimulator.sdf.format(new Date(t))+\" NONE\");\n\t\t } else {\n\t\t\t\n\t\t\tGroup group = metric.group;\n\t\t\tExecutionStatistics hist = history.getExecutionStatistics(group);\n\t\t\tlong xt = bxtm.getExecTime(group);\n\t\t\t\n\t\t\t// SQM updates\n\t\t\tngs++;\n\t\t\tphm += puc.getUtility(group, t, env, hist);\n\t\t\toahm += oauc.getUtility(group, t, env, hist);\n\t\t\trnhm += rnuc.getUtility(group, t, env, hist);\t\t\n\t\t\txtm += (double)xt;\n\t\t\tshm += suc.getUtility(group, t, env, hist);\n\n\t\t\tlogger.log(1, \"SELECT \"+it+\" at \"+ScheduleSimulator.sdf.format(new Date(t))+\" \"+group.getName()+\n\t\t\t\t \" until \"+ScheduleSimulator.sdf.format(new Date(t+xt)));\n\t\t\tt += xt;\n\t\t\thistory.updateHistory(group, t-10000L);\n\t\t\t\n\t\t }\n\t\t it++;\n\t\t}\n\n\t\t// daily averages\n\t\tlogger.log(1, \"CDAT_NG \"+ScheduleSimulator.sdf.format(new Date(t))+\" \"+ngs);\n\t\tlogger.log(1, \"CDAT_PX \"+ScheduleSimulator.sdf.format(new Date(t))+\" \"+(phm/night));\n\t\tlogger.log(1, \"CDAT_OA \"+ScheduleSimulator.sdf.format(new Date(t))+\" \"+(oahm/(double)ngs));\n\t\tlogger.log(1, \"CDAT_RN \"+ScheduleSimulator.sdf.format(new Date(t))+\" \"+(rnhm/(double)ngs));\n\t\tlogger.log(1, \"CDAT_XT \"+ScheduleSimulator.sdf.format(new Date(t))+\" \"+((double)xtm/night));// hours\n\t\tlogger.log(1, \"CDAT_SU \"+ScheduleSimulator.sdf.format(new Date(t))+\" \"+shm);\n\t\t\n\t\tngqm += ngs;\n\t\tpqm += phm/night;\n\t\toaqm += oahm/(double)ngs;\n\t\trnqm += rnhm/(double)ngs;\n\t\txtqm += xtm/3600000.0;\n\t\tsqm += shm;\n\n\t } // next day\n\t \n\t // averages for SQM\n\t logger.log(1, \"CDAT_SQ_NG \"+(ngqm/(double)ndays));\n\t logger.log(1, \"CDAT_SQ_PX \"+(pqm/(double)ndays));\n\t logger.log(1, \"CDAT_SQ_OA \"+(oaqm/(double)ndays));\n\t logger.log(1, \"CDAT_SQ_RN \"+(rnqm/(double)ndays));\n\t logger.log(1, \"CDAT_SQ_XT \"+(xtqm/(double)ndays));// hours\n\t logger.log(1, \"CDAT_SQ_SU \"+(sqm/(double)ndays));\n\t \n\t} catch (Exception e) {\n\t e.printStackTrace();\n\t return;\n\t}\n\t\n }" ]
[ "0.57933867", "0.57369894", "0.5562116", "0.5528699", "0.54228014", "0.5409913", "0.54092073", "0.53692746", "0.5342386", "0.53301346", "0.5290257", "0.5285202", "0.5269198", "0.5267428", "0.5204199", "0.5199916", "0.5189181", "0.5139765", "0.51232874", "0.51106495", "0.5074365", "0.5064173", "0.50592077", "0.5050545", "0.5032194", "0.50309384", "0.5028221", "0.50280744", "0.5021056", "0.49695474", "0.4943948", "0.4938647", "0.49366271", "0.4933154", "0.49313912", "0.49276206", "0.49076593", "0.49047536", "0.49033475", "0.4900597", "0.48964697", "0.48946366", "0.48914567", "0.4890327", "0.4888599", "0.4881078", "0.48759705", "0.48671576", "0.48613086", "0.4858617", "0.48523518", "0.48482335", "0.48323652", "0.4830709", "0.4826875", "0.48201334", "0.48136458", "0.4813397", "0.48116347", "0.48089916", "0.48026505", "0.4800159", "0.47995368", "0.47893083", "0.47832778", "0.47813296", "0.47806028", "0.47775996", "0.47623116", "0.47604913", "0.47602546", "0.4749515", "0.47378308", "0.473704", "0.47350365", "0.47221118", "0.47175437", "0.4715392", "0.4712569", "0.47072226", "0.4706747", "0.47001463", "0.46945745", "0.46886915", "0.46883115", "0.46875396", "0.46837515", "0.46833417", "0.46821445", "0.46809936", "0.4680802", "0.46768978", "0.46748525", "0.46730813", "0.46705675", "0.46652842", "0.4662999", "0.466093", "0.46598864", "0.4652017", "0.46511626" ]
0.0
-1
String startTime = "1355561151577"; //multidist
@Override public void handle(final HttpServerRequest req) { String startTime = "1355562000000"; //--multi-dist Iterator<EventInfo> iter = dataService.events() .find("{timestamp:{$gt:"+startTime+"}}") .sort("{timestamp:1}") .as(EventInfo.class).iterator(); EventCounter multiCounter = new EventCounter("/multi"); int processed = 0; while (iter.hasNext() && processed < limit) { EventInfo event = iter.next(); multiCounter.countEvent(event); processed++; } req.response.setChunked(true); multiCounter.printDistance(req, "multidist"); //multiCounter.printResponse(req, "multidist"); //use response time data Iterator<ResponseInfo> respIter = dataService.response() .find("{timestamp:{$gt:"+startTime+"}}") .sort("{timestamp:1}") .as(ResponseInfo.class).iterator(); ResponseCounter responseCounter = new ResponseCounter(); processed = 0; while (respIter.hasNext() && processed < limit) { ResponseInfo resp = respIter.next(); responseCounter.count(resp); processed++; } responseCounter.printResponse(req, "multidist"); req.response.end(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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\n String time =\"16:49:40\".substring(0,2);\n System.out.println(time);\n\n }", "public static String m128354a(String str) {\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"yyyy-MM-dd-HHmmssSSS\", Locale.US);\n Calendar instance = Calendar.getInstance(TimeZone.getTimeZone(\"GMT+8\"));\n C7573i.m23582a((Object) instance, \"calendar\");\n Date time = instance.getTime();\n StringBuilder sb = new StringBuilder();\n sb.append(simpleDateFormat.format(time));\n sb.append(str);\n return sb.toString();\n }", "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 }", "public static String getMicroTimeId() {\n Long time = System.nanoTime();\n String timeValue = time.toString();\n String[] splitedValue = timeValue.split(\"\");\n int i = 2 + 2 + 2;\n String m1 = \"0\" + splitedValue[i];\n String m2 = \"0\" + splitedValue[++i];\n String m3 = \"0\" + splitedValue[++i];\n String m4 = \"0\" + splitedValue[++i];\n String m5 = \"0\" + splitedValue[++i];\n String m6 = \"0\" + splitedValue[++i];\n String m7 = \"0\" + splitedValue[++i];\n return alphanum[Integer.parseInt(m1)]\n .concat(alphanum[Integer.parseInt(m2)])\n .concat(alphanum[Integer.parseInt(m3)])\n .concat(alphanum[Integer.parseInt(m4)])\n .concat(alphanum[Integer.parseInt(m5)])\n .concat(alphanum[Integer.parseInt(m6)])\n .concat(alphanum[Integer.parseInt(m7)]);\n }", "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}", "public static void main(String[] args) throws ParseException {\n\t Long t = Long.parseLong(\"1540452984\");\r\n Timestamp ts = new Timestamp(1540453766);\r\n DateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n //方法一:优势在于可以灵活的设置字符串的形式。\r\n String tsStr = sdf.format(ts);// 2017-01-15 21:17:04\r\n System.out.println(tsStr);\r\n\t}", "static String timeConversion1(String s) {\n String[] timeSplit = s.split(\":\");\n String hours = timeSplit[0];\n String minutes = timeSplit[1];\n String seconds = timeSplit[2].substring(0, 2);\n String ampm = timeSplit[2].substring(2);\n\n int hour = Integer.parseInt(hours);\n\n int differential = 0;\n if (\"PM\".equals(ampm) && hour != 12) {\n differential = 12;\n }\n\n\n hour += differential;\n hour = hour % 24;\n\n hours = String.format(\"%02d\", hour);\n\n return hours + \":\" + minutes + \":\" + seconds;\n\n }", "public static long dateToTime(String s) {\n\t\tSimpleDateFormat simpledateformat = new SimpleDateFormat(\"yyyyMMddHHmmss\");\n\t\tlong l;\n\t\ttry {\n\t\t\tl = simpledateformat.parse(s).getTime();\n\t\t} catch (ParseException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\tl = System.currentTimeMillis();\n\t\t}\n\n\t\treturn l;\n\n\t}", "public final synchronized long mo27311a(String str) {\n long currentTimeMillis;\n currentTimeMillis = System.currentTimeMillis();\n if (!this.f10287a.contains(m12563a(str, \"cre\"))) {\n SharedPreferences.Editor edit = this.f10287a.edit();\n edit.putString(m12563a(str, \"cre\"), String.valueOf(currentTimeMillis));\n edit.commit();\n } else {\n currentTimeMillis = m12566c(str);\n }\n this.f10289c.put(str, Long.valueOf(currentTimeMillis));\n return currentTimeMillis;\n }", "public static long getTimeInMillis(String formatted_time){\n \t\n \tlong firstTime = System.currentTimeMillis();\n \tint hour;\n \tint minute;\n\n \tif (formatted_time != null){\n \t\t\n \t\tString[] timeString = formatted_time.split(\":\");\n \tif (timeString.length != 2)\n \t\treturn firstTime;\n \telse{\n \t\thour = Integer.parseInt(timeString[0]);\n \t\tminute = Integer.parseInt(timeString[1]);\n \t}\n \t\n\t \tCalendar cal = Calendar.getInstance();\n\t cal.set(Calendar.HOUR_OF_DAY,hour);\n\t cal.set(Calendar.MINUTE,minute);\n\t cal.set(Calendar.SECOND,0);\n\t \tfirstTime = cal.getTimeInMillis();\n \t}\n \t\n \treturn firstTime;\n }", "long getStartTime();", "@Test\n public void stringFromLong() {\n assertEquals(\n \"784dd132\",\n JdkHashTools.getStringFromLong(2018365746)\n );\n }", "public static long TimeInformationToSeconds(String info){\n\t\tif(info.indexOf(':') > 0){\n\t\t\tString[] data = info.split(\":\");\n\t\t\tlong hours = Long.parseLong(data[0]);\n\t\t\tlong minutes = Long.parseLong(data[1]);\n\t\t\tlong seconds = Long.parseLong(data[2].split(\"[.]\")[0]);\n\t\t\tlong milliseconds = Long.parseLong(data[2].split(\"[.]\")[1]);\n\t\t\treturn (hours * 3600000) + (minutes * 60000) + (seconds * 1000) + milliseconds;\n\t\t}else{\n\t\t\n\t\t/*\n\t\tSystem.out.println(info.substring(0, info.indexOf(\"day\")));\n\t\tSystem.out.println(info.substring(0, info.indexOf(\"day\")));\n\t\tSystem.out.println(info.substring(info.indexOf(\" \"), info.indexOf(\":\")));\n\t\tSystem.out.println(info.substring(info.indexOf(':'), info.lastIndexOf(':')));\n\t\tSystem.out.println(info.substring(info.lastIndexOf(':'), info.indexOf('.')));\n\t\tSystem.out.println(info.substring(info.indexOf('.')));\n/*\t\tlong days = Long.parseLong(info.substring(0, info.indexOf(\"day\")));\n\t\tlong hours = Long.parseLong(info.substring(info.indexOf(\" \"), info.indexOf(\":\")));\n\t\tlong minutes = Long.parseLong(info.substring(info.indexOf(':'), info.lastIndexOf(':')));\n\t\tlong seconds = Long.parseLong(info.substring(info.lastIndexOf(':'), info.indexOf('.')));\n\t\tlong milliseconds = Long.parseLong(info.substring(info.indexOf('.')));\n\t*/\t\n\t\t}\n\t\treturn 1;//(days * 86400000) + (hours * 3600000) + (minutes * 60000) + (seconds * 1000) + milliseconds;\n\t}", "public static long strToMillis(String time) {\r\n long result = 0;\r\n try {\r\n Pattern p = Pattern\r\n .compile(\"([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})(\\\\.([0-9]{1,3}))?\");\r\n Matcher m = p.matcher(time.trim());\r\n m.find();\r\n result += Long.parseLong(m.group(1)) * 3600000\r\n + Long.parseLong(m.group(2)) * 60000 + Long.parseLong(m.group(3))\r\n * 1000;\r\n if (m.group(5) != null)\r\n result += Long.parseLong(m.group(5));\r\n } catch (Exception e) {\r\n // don't complain, just return 0\r\n return 0;\r\n }\r\n return result;\r\n }", "private static long m39416a(String str) {\n try {\n return C6440a.m39308a(str).getTime();\n } catch (Exception unused) {\n return 0;\n }\n }", "private String intTime(long l){\r\n String s=\"\";\r\n s+=(char)(((l/1000)/60)+'0')+\":\"+(char)((((l/1000)%60)/10)+'0')+(char)((((l/1000)%60)%10)+'0'); \r\n return s;\r\n }", "public static void main(String[] args) throws Exception {\n\n String time = \"1556525949\";\n// LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochSecond(Long.parseLong(time)), ZoneId.systemDefault());\n// System.out.println(localDateTime);\n// Long aLong = DateCtrlUtil.localDateTimeToSecond(localDateTime);\n// System.out.println(aLong);\n\n// String sTime = \"2019-04-22 22:00:00\";\n//\n// LocalDateTime weekPreDate = LocalDateTime.parse(sTime, DateCtrlUtil.dateFormat).plusWeeks(-MonitorConstants.PRE_WEEKS);\n// Long aLong = DateCtrlUtil.localDateTimeToSecond(weekPreDate);\n// if (aLong > Long.parseLong(time)) {\n// System.out.println(true);\n// }\n for (int i = 2; i < 100; i++) {\n boolean flag = false;\n for (int j = 2; j <= Math.sqrt(i); j++) {\n if (i % j == 0) flag = true;\n }\n if (!flag) {\n System.out.println(String.format(\"%s is prime\", i));\n }\n }\n }", "public void setStartTime (long x)\r\n {\r\n startTime = x;\r\n }", "@Test\n public void testSplitTime(){\n \tCountDownTimer s = new CountDownTimer();\n \ts.splitTime(3975);\n \tassertEquals(s.toString(), \"1:06:15\");\n \t\n \ts.splitTime(45);\n \tassertEquals(s.toString(), \"0:00:45\");\n \t\n }", "public String getUniqTime(){\n String timeStamp = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(Calendar.getInstance().getTime());\n return timeStamp;\n }", "public static String timeConversion(String s) {\n // Write your code here\n String end = s.substring(2, s.length() - 2);\n String ans = s.substring(0, s.length() - 2);\n if (s.charAt(8) == 'A') {\n return s.startsWith(\"12\") ? \"00\" + end : ans;\n }\n\n return s.startsWith(\"12\") ? ans : (Integer.parseInt(s.substring(0, 2)) + 12) + end;\n }", "public static String getYYYYMMDDHHMMSS()\r\n/* 56: */ {\r\n/* 57: 68 */ String nowTime = \"\";\r\n/* 58: 69 */ Date now = new Date();\r\n/* 59: 70 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMddHHmmss\");\r\n/* 60: 71 */ nowTime = formatter.format(now);\r\n/* 61: 72 */ return nowTime;\r\n/* 62: */ }", "void mo5875b(String str, long j);", "static String timeConversion(String s) {\n /*\n * Write your code here.\n */\n String res = \"\";\n String hrs = s.substring(0, 2);\n String min = s.substring(3, 5);\n String sec = s.substring(6, 8);\n String ampm = s.substring(8);\n int hr = Integer.parseInt(hrs);\n if((ampm.equalsIgnoreCase(\"PM\")) && (hr != 12)) {\n hr += 12;\n if(hr >= 24) {\n hr = 24 - hr;\n }\n }\n else if(ampm.equalsIgnoreCase(\"AM\")) {\n if(hr == 12) {\n hr = 0;\n }\n }\n if(hr < 10) {\n res = res + \"0\" + Integer.toString(hr);\n }\n else {\n res += Integer.toString(hr);\n }\n res = res +\":\" +min +\":\" + sec;\n return res;\n }", "java.lang.String getTime();", "public static void main(String[] args) {\r\n\t\tDate now = new Date();\r\n\t\tSimpleDateFormat sdf = \r\n\t\tnew SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n\tString str = sdf.format(now);\r\n\tSystem.out.println(str);\r\n\tlong time = now.getTime();\r\n\ttime += 48954644;\r\n\tnow.setTime(time);\r\n\tSystem.out.println(sdf.format(now));\r\n\tDate dat = null;\r\n\ttry {\r\n\t\tdat = sdf.parse(str);\r\n\t} catch (ParseException e) {\r\n\t\t// TODO Auto-generated catch block\r\n\t\te.printStackTrace();\r\n\t}\r\n\tSystem.out.println(dat);\r\n\t\r\n\r\n}", "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 }", "private static int computeTime(String time) {\n\t\tint ret = 0;\n\t\tint multiply = 1;\n\t\tint decimals = 1;\n\t\tfor (int i = time.length() - 1; i >= 0; --i) {\n\t\t\tif (time.charAt(i) == ':') {\n\t\t\t\tmultiply *= 60;\n\t\t\t\tdecimals = 1;\n\t\t\t} else {\n\t\t\t\tret += (time.charAt(i) - '0') * multiply * decimals;\n\t\t\t\tdecimals *= 10;\n\t\t\t}\n\t\t}\n\t\treturn ret;\n\t}", "int getStartTime();", "int getStartTime();", "int getStartTime();", "public static long q(String str, long j) {\n long j2;\n AppMethodBeat.i(59906);\n if (str != null) {\n bi Rb = ((j) g.K(j.class)).bOr().Rb(str);\n if (Rb != null) {\n j2 = Rb.field_createTime + 1;\n if (j2 <= j * 1000) {\n AppMethodBeat.o(59906);\n return j2;\n }\n j2 = j * 1000;\n AppMethodBeat.o(59906);\n return j2;\n }\n }\n j2 = 0;\n if (j2 <= j * 1000) {\n }\n }", "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 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 getTimeInMillis();", "public static void main(String[] args) {\n\n\t\t SimpleDateFormat sf = new SimpleDateFormat(\"yyyyMMddHHmmssSSS\");\n\t\t// for(int i=0; i<100; i++) {\n\t\t// String strDT = sf.format(new Date(System.currentTimeMillis()));\n\t\t// System.out.println(strDT);\n\t\t// }\n\n\t\t\n\t\tDate oldDate = new Date();\n\t\tCalendar gcal = new GregorianCalendar();\n\t\tgcal.setTime(oldDate);\n\t\tgcal.add(Calendar.SECOND, -4468);\n\t\tDate newDate = gcal.getTime();\n\t\tSystem.out.println(sf.format(oldDate));\n\t\tSystem.out.println(sf.format(newDate));\n\t}", "long getTime();", "long getTime();", "long getTime();", "long getTime();", "long getTime();", "long getTime();", "long getTime();", "long getTime();", "long getTime();", "long getTime();", "long getTime();", "long getTime();", "private long extractMillis(String value)\r\n/* 364: */ {\r\n/* 365:318 */ int start = value.indexOf(\"\\\"\");\r\n/* 366:319 */ int end = value.lastIndexOf(\"\\\"\");\r\n/* 367:320 */ String time = value.substring(start + 1, end);\r\n/* 368: */ \r\n/* 369:322 */ Date result = null;\r\n/* 370: */ try\r\n/* 371: */ {\r\n/* 372:324 */ result = this.format.parse(time);\r\n/* 373: */ }\r\n/* 374: */ catch (ParseException e)\r\n/* 375: */ {\r\n/* 376:327 */ Mark.err(new Object[] {\"Unalble to get milliseconds from\", value });\r\n/* 377:328 */ return 0L;\r\n/* 378: */ }\r\n/* 379:331 */ return result.getTime();\r\n/* 380: */ }", "private static long convertTimeToSeconds(String time) {\n\n\t\tString[] timeArray = time.split(\":\");\n\t\tint hours = Integer.parseInt(timeArray[0]);\n\t\tint minutes = Integer.parseInt(timeArray[1]);\n\t\tint seconds = Integer.parseInt(timeArray[2]);\n\n\t\treturn (hours * 3600) + (minutes * 60) + seconds;\n\t}", "public static String minChangeDayHourMinS(String time) {\n long mss;\n if (!\"\".equals(time) && time != null) {\n mss = Integer.parseInt(time) * 60;\n } else {\n return \"\";\n }\n String DateTimes = null;\n long days = mss / (60 * 60 * 24);\n long hours = (mss % (60 * 60 * 24)) / (60 * 60);\n long minutes = (mss % (60 * 60)) / 60;\n long seconds = mss % 60;\n// Logger.d(\"minChangeDayHourMinS days:\" + days);\n// Logger.d(\"minChangeDayHourMinS hours:\" + hours);\n// Logger.d(\"minChangeDayHourMinS minutes:\" + minutes);\n// Logger.d(\"minChangeDayHourMinS seconds:\" + seconds);\n\n if (days > 0) {\n DateTimes = days + \"天\" + hours + \"小时\" + minutes + \"分钟\"\n + seconds + \"秒\";\n } else if (hours > 0) {\n DateTimes = hours + \"小时\" + minutes + \"分钟\"\n + seconds + \"秒\";\n } else if (minutes > 0) {\n DateTimes = minutes + \"分钟\"\n + seconds + \"秒\";\n } else {\n DateTimes = seconds + \"秒\";\n }\n // Log.d(\"minChangeDayHourMinS DateTimes:\" + DateTimes);\n\n return DateTimes;\n }", "private Integer getStandardStart(int startTime) \n {\n \tif (startTime % 1440 > 960) {\n \t\tstartTime += 1440;\n \t}\n \tint startOfDay = startTime - (startTime % 1440);\n \t//we need a standard variable to indicate the day of week;\n \t//standard day starts at 08:00 = 480 minutes and ends at 16:00 = 960 minutes\n \tcapacityEndTime = startOfDay + 960;\n \treturn startOfDay + 480;\n }", "public String startTime(){\r\n\t\treturn startTime;\r\n\t}", "public long startTime();", "public static long m21392b(Context context, String str) {\n long j;\n try {\n j = context.getPackageManager().getPackageInfo(str, 0).firstInstallTime;\n } catch (Exception e) {\n C5205o.m21464a((Throwable) e);\n j = 0;\n }\n int currentTimeMillis = j > 0 ? (int) ((System.currentTimeMillis() - j) / 86400000) : 1;\n if (currentTimeMillis == 0) {\n currentTimeMillis = 1;\n }\n return (long) currentTimeMillis;\n }", "public abstract void twist(long ms);", "public long getStartTime();", "public long getStartTime();", "int getTime();", "int getTime();", "private static long getTimestampStart(long timestamp, long start) {\n long timestampStart = 0;\n for (long i = timestamp; i >= timestamp-60; i--) {\n if ((i-start) % 60 == 0) {\n timestampStart = i;\n break;\n }\n }\n return timestampStart;\n }", "public String getStartTime();", "public String getStartTime();", "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 }", "public long getDateTimeInMilliSeconds(String date, String time) {\n long dateTimeInMilliSeconds = 0;\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"yyyy EEE dd MMM hh:mm aa\", Locale.US);\n\n try {\n Date dateObject = simpleDateFormat.parse(date + \" \" + time);\n\n Calendar calendar = getCalendarInstance(dateObject.getTime());\n\n dateTimeInMilliSeconds = calendar.getTimeInMillis();\n\n } catch (ParseException e) {\n e.printStackTrace();\n }\n\n return dateTimeInMilliSeconds;\n }", "public static long m2849a(String str) {\n try {\n return C1595a.m2745a(str).getTime();\n } catch (Exception unused) {\n return 0;\n }\n }", "public int getStartTime()\n {\n if (isRepeated()) return start;\n else return time;\n }", "long getTimeInMilliSeconds();", "public static String getElapsedTimeFromMilliseconds(long inputTime)\r\n {\r\n String format = String.format(\"%%0%dd\", 2);\r\n long elapsedTime = inputTime / 1000000;\r\n String millisecond = String.format(format, elapsedTime % 1000);\r\n String seconds = String.format(format, (elapsedTime/1000) % 60);\r\n String minutes = String.format(format, ((elapsedTime/1000) % 3600) / 60);\r\n String hours = String.format(format, (elapsedTime/1000) / 3600);\r\n\r\n hours = hours.equals(\"00\") ? \"\" : (Integer.parseInt(hours) < 9 ? hours.substring(hours.lastIndexOf(\"0\") + 1)+\":\" :hours+\":\");\r\n minutes = minutes.equals(\"00\") ? \"\" : (Integer.parseInt(minutes) < 9 ? minutes.substring(minutes.lastIndexOf(\"0\") + 1)+\":\" :minutes+\":\");\r\n seconds = seconds.equals(\"00\") ? \"\" : (Integer.parseInt(seconds) < 9 ? seconds.substring(seconds.lastIndexOf(\"0\") + 1)+\",\" :seconds+\",\");\r\n millisecond = millisecond.equals(\"00\") ? \"\" : millisecond+(seconds.equals(\"\") ? \"ms\":(minutes.equals(\"\") ? \" sec\" : \" min\"));\r\n String time = hours+minutes+seconds+millisecond;\r\n return time;\r\n }", "public void setStartTime(java.lang.Long value) {\n this.start_time = value;\n }", "private String parseStringtoInt(String welcome,Student s1){\n\n String time = TimeUitl.getTime(s1);\n\n String slogan = welcome + time;\n\n return slogan;\n }", "public String getTimestamp() \n{\n Calendar now = Calendar.getInstance();\n return String.format(\"20%1$ty-%1$tm-%1$td_%1$tHh%1$tMm%1$tSs\", now);\n}", "public void setStartTimeString(String startTimeString) {\n this.startTimeString = startTimeString;\n }", "public static void main(String[] args) {\n long hrs;\n long sec;\n Scanner userInput = new Scanner(System.in);\n System.out.println(\"enter hours\");\n hrs=userInput.nextInt();\n sec=hrs*60*60;\n System.out.println(\"sec\"+sec);\n\n}", "public static void main(String[] args) throws HttpException, IOException {\n\n\t\t\n\t\tString smsTemplate=\"你好, 测试短信通知为%s\";\n\t\tString parameter=\" \";\n\t\t\n\t\tString a[]=parameter.trim().split(\"\\\\|\");\n\t\t\n\t\tBoolean b=StringUtils.isBlank(parameter.trim());\n\t\tSystem.out.println(b);\n\t\tString smsContent = String.format(smsTemplate,a);\n\t\t\n\t\t//String smsContent = String.format(smsTemplate, (StringUtils.isBlank(parameter.trim()) ? \"\" :a));\n\t\t\n\t\tSystem.out.println(smsContent);\n\t\t\n\t\tLocalDateTime l=LocalDateTime.now();\n\t\tSystem.out.println(l);\n\t\t\n\t\tLocalTime midnight = LocalTime.MIDNIGHT;\n\t\tLocalDate tomorrow = LocalDate.now().plusDays(1);\n\t\tLocalDateTime x = LocalDateTime.of(tomorrow, midnight);\n\t\tSystem.out.println(x);\n\t\t\n\t\tLocalTime now=LocalTime.now();\n\t\tSystem.out.println(now.getHour());\n\t\tSystem.out.println(now.getMinute());\n\t\tSystem.out.println(now.getSecond());\n\t\t\n\t\t\n\t\tString s = \"templateCode==SMS_46165066&&signName==Radius服务&&msg==866834\";\n\t\tString[] str = s.split(\"&&\");\n\t\tfor (String s1 : str) {\n\t\t\tSystem.out.println(s1);\n\t\t}\n\t\t\n\t\tlong ll=1496751143000L;\n\t\tTimestamp reportTime=new Timestamp(ll);\n\t\tSystem.out.println(reportTime);\n\t\t\n\t\t LocalDateTime end=LocalDateTime.now();\n //三天之前\n LocalDateTime start=end.minusDays(3);\n \n Timestamp startTime=Timestamp.from(start.atZone(ZoneId.systemDefault()).toInstant());\n Timestamp endTime=Timestamp.from(end.atZone(ZoneId.systemDefault()).toInstant());\n \n System.out.println(startTime);\n System.out.println(endTime);\n \n int i=10;\n System.out.println(String.format(\"dsfasf %s\", i));\n \n System.out.println(LocalDateTime.now().toLocalDate());\n \n\n\t}", "String clientProcessTime(final int index);", "public static String getTime(Long start){\n\t\tLong now =System.currentTimeMillis()/1000; \n\t\tLong date = (now - start)/(3600*24);\n\t\t//\t\tLog.e(\"TimeTypeUtil\", \"停车的天数为:\"+ date);\n\t\tLong hour = ((now-start)%86400)/3600;\n\t\tLong minute = ((now-start)%3600)/60;\n\t\tString result = \"\";\n\t\tif (date == 0) {\n\t\t\tif(hour==0)\n\t\t\t\tresult =minute+\"分钟\";\n\t\t\telse \n\t\t\t\tresult =hour+\"小时\"+minute+\"分钟\";\n\t\t}else{\n\t\t\tresult =date+\"天\"+hour+\"小时\"+minute+\"分钟\";\n\t\t}\n\t\treturn result;\n\t}", "public static String getTimeStamp() {\r\n\r\n\t\tlong now = (System.currentTimeMillis() - startTime) / 1000;\r\n\r\n\t\tlong hours = (now / (60 * 60)) % 24;\r\n\t\tnow -= (hours / (60 * 60)) % 24;\r\n\r\n\t\tlong minutes = (now / 60) % 60;\r\n\t\tnow -= (minutes / 60) % 60;\r\n\r\n\t\tlong seconds = now % 60;\r\n\r\n\t return String.format(\"%02d:%02d:%02d\", hours, minutes, seconds);\r\n\t}", "public void setBeginTime(String time){beginTime = time;}", "public String convertCalendarMillisecondsAsLongToDateTimeHourMinSec(long fingerprint) {\n\t\t\t\tDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\t\t\t\tDate date = new Date(fingerprint);\n\t\t\t\treturn format.format(date);\n\t\t\t}", "public String getStartTime() {\n\t\treturn (new Parser(value)).getString();\n\t}", "private String multipleStartTimes() {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tif (startTimes.size() > 1) {\n\t\t\tsb.append(\"Flera starttider? \");\n\t\t\tfor (int i = 1; i < startTimes.size(); i++) {\n\t\t\t\tsb.append(startTimes.get(i) + \" \");\n\t\t\t}\n\t\t\tsb.append(\"; \");\n\t\t}\n\t\treturn sb.toString();\n\t}", "static String timeCount_1(List<String> Arr){\n int timeHH = 0;\n int timeMI = 0;\n int timeSS = 0;\n \n String r_hh = \"\";\n String r_mi = \"\";\n String r_ss = \"\";\n\n for(int i = 0; i < Arr.size(); i++ ){\n \n if (Pattern.matches(\"\\\\d{2}:\\\\d{2}:\\\\d{2}\", Arr.get(i))){\n \n String[] s = Arr.get(i).split(\":\");\n int hh = Integer.parseInt(s[0]);\n int mi = Integer.parseInt(s[1]);\n int ss = Integer.parseInt(s[2]);\n \n timeHH += hh;\n timeMI += mi;\n timeSS += ss;\n \n }\n else{\n continue;\n }\n }\n \n timeMI += timeSS / 60;\n timeSS %= 60;\n \n timeHH += timeMI / 60;\n timeMI %= 60; \n\n \n if (timeHH < 10){\n r_hh = \"0\" + timeHH;\n }\n else{\n r_hh = Integer.toString(timeHH);\n }\n \n if (timeMI < 10){\n r_mi = \"0\" + timeMI;\n }\n else{\n r_mi = Integer.toString(timeMI);\n }\n \n if (timeSS < 10){\n r_ss = \"0\" + timeSS;\n }\n else{\n r_ss = Integer.toString(timeSS);\n }\n \n \n \n String result = r_hh + \":\" + r_mi + \":\" + r_ss;\n //String result = timeHH + \":\" + timeMI + \":\" + timeSS;\n \n return result;\n }", "public static String GetRunTime(Date starttime, Date stoptime) {\n String result = \"\";\n long diff = 0;\n long mills = 0;\n long x = 0;\n long seconds = 0;\n long minutes = 0;\n long hours = 0;\n\n diff = stoptime.getTime() - starttime.getTime();\n mills = diff % 1000;\n x = diff / 1000;\n seconds = x % 60;\n x /= 60;\n minutes = x % 60;\n x /= 60;\n hours = x % 24;\n\n result = String.format(\"%d:%d:%d.%d\", hours, minutes, seconds, mills);\n\n return result;\n }", "private String computeTime(long l_time){\n \tString studyTime = \" \";\n \tlong hours, mins, secs;\n \t\n \tif (l_time > 3600) {\n \t\thours = l_time / 3600;\n \t\tl_time = l_time % 3600;\n \t\tmins = l_time / 60;\n \t\tsecs = l_time % 60;\n \t\tif (hours > 1) {\n \t\t\tstudyTime = Long.toString(hours) + \" hours \" + Long.toString(mins) + \" minutes and \" + Long.toString(secs) + \" seconds\";\n \t\t} else {\n \t\t\tstudyTime = Long.toString(hours) + \" hour \" + Long.toString(mins) + \" minutes and \" + Long.toString(secs) + \" seconds\";\n \t\t}\n \t} else if (l_time > 60 ){\n \t\tmins = l_time / 60;\n \t\tsecs = l_time % 60;\n \t\tif (mins > 1) {\n \t\t\tstudyTime = Long.toString(mins) + \" minutes and \" + Long.toString(secs) + \" seconds\";\n \t\t} else {\n \t\t\tstudyTime = Long.toString(mins) + \" minute and \" + Long.toString(secs) + \" seconds\";\n \t\t}\n \t} else {\n \t\tif (l_time > 1) {\n \t\t\tstudyTime = Long.toString(l_time) + \" seconds\";\n \t\t} else {\n \t\t\tstudyTime = Long.toString(l_time) + \" second\";\n \t\t}\n \t}\n \treturn studyTime;\n }", "public static void main(String[] args) {\n String num1 = \"256117489511377083148593685533950561400363410418754703282767252221661609163404299\";\n String num2 = \"61200496111643709081218550902198211480012378840070191147459688611759881218205422431757614\";\n// String num1 = \"29476\";\n// String num2 = \"919\";\n MultiplyStringsSolution solution = new MultiplyStringsSolution();\n long a = System.currentTimeMillis();\n System.out.println(solution.multiply(num1, num2));\n long b = System.currentTimeMillis();\n System.out.println(b - a);\n System.out.println(solution.multiply2(num1, num2));\n long c = System.currentTimeMillis();\n System.out.println(c - b);\n System.out.println(solution.multiply3(num1, num2));\n long d = System.currentTimeMillis();\n System.out.println(d - c);\n System.out.println(solution.multiply4(num1, num2));\n long e = System.currentTimeMillis();\n System.out.println(e - d);\n }", "public String selectStartMinutes(String object, String data) {\n\t\tlogger.debug(\"Entering start Minutes\");\n\t\ttry {\n\n\t\t\tString allObjs[] = object.split(Constants.DATA_SPLIT);\n\t\t\tobject = allObjs[0];\n\t\t\tString hr = allObjs[1];\n\t\t\tString FinalNum = \"\";\n\t\t\tint num = 0;\n\t\t\tDate date = new Date();\n\t\t\tSimpleDateFormat timeFormat = new SimpleDateFormat(\"mm\");\n\t\t\ttimeFormat.setTimeZone(TimeZone.getTimeZone(\"US/Central\"));\n\t\t\tString Min = timeFormat.format(date.getTime());\n\t\t\tlogger.debug(Min);\n\t\t\tint Minutes = Integer.parseInt(Min);\n\t\t\tlogger.debug(\"Minutes=\" + Minutes);\n\t\t\tif ((Minutes % 5) == 0) {\n\t\t\t\tnum = Minutes + 5;\n\t\t\t\tif (num == 5) {\n\t\t\t\t\tString num3 = Constants.VALUE_0 + num;\n\t\t\t\t\tselectList(object, num3);\n\t\t\t\t\tlogger.debug(\"when num==5:--\" + num3);\n\t\t\t\t\treturn Constants.KEYWORD_PASS + \" Start Minutes has been Entered.. \";\n\n\t\t\t\t}\n\t\t\t\tif (num >= 60) {\n\t\t\t\t\tdata = String.valueOf(num);\n\t\t\t\t\tdata = \":\" + data;\n\t\t\t\t\tselectStartorDueHours(hr, data);\n\t\t\t\t\tif (!(data.equals(Constants.VALUE_12))) {\n\t\t\t\t\t\tFinalNum = Constants.VALUE_DOUBLE_ZERO;\n\t\t\t\t\t\tselectList(object, FinalNum);\n\t\t\t\t\t\treturn Constants.KEYWORD_PASS + \" Start Minutes has been Entered.. \";\n\t\t\t\t\t}\n\n\t\t\t\t\treturn Constants.KEYWORD_PASS + \" Start Minutes has been Entered.. \";\n\t\t\t\t}\n\t\t\t\tFinalNum = String.valueOf(num);\n\t\t\t\tFinalNum = \":\" + FinalNum;\n\t\t\t\tselectList(object, FinalNum);\n\t\t\t\treturn Constants.KEYWORD_PASS + \" Start Minutes has been Entered.. \";\n\t\t\t} else {\n\t\t\t\tint unitdigit = Minutes % 10;\n\t\t\t\tlogger.debug(\"Unitdigit=\" + unitdigit);\n\t\t\t\tnum = Minutes - unitdigit;\n\t\t\t\tlogger.debug(\"num=\" + num);\n\t\t\t\tif (unitdigit > 0 && unitdigit < 4) {\n\t\t\t\t\tnum = num + 5;\n\t\t\t\t\tif (num == 5) {\n\t\t\t\t\t\tString num3 = Constants.VALUE_0 + num;\n\t\t\t\t\t\tselectList(object, String.valueOf(num3));\n\t\t\t\t\t\tlogger.debug(\"when num==5:--\" + num3);\n\t\t\t\t\t\treturn Constants.KEYWORD_PASS + \" Start Minutes has been Entered.. \";\n\t\t\t\t\t} else {\n\t\t\t\t\t\tString num3 = \":\" + num;\n\t\t\t\t\t\tselectList(object, String.valueOf(num3));\n\t\t\t\t\t\treturn Constants.KEYWORD_PASS + \" Start Minutes has been Entered.. \";\n\t\t\t\t\t}\n\t\t\t\t} else if (unitdigit == 4) {\n\t\t\t\t\tnum = num + 10;\n\t\t\t\t\tif (num >= 60) {\n\t\t\t\t\t\tdata = String.valueOf(num);\n\t\t\t\t\t\tdata = \":\" + data;\n\t\t\t\t\t\tselectStartorDueHours(hr, data);\n\t\t\t\t\t\tFinalNum = Constants.VALUE_DOUBLE_ZERO;\n\t\t\t\t\t\tselectList(object, FinalNum);\n\t\t\t\t\t\treturn Constants.KEYWORD_PASS + \" Start Minutes has been Entered.. \";\n\t\t\t\t\t}\n\t\t\t\t\tdata = String.valueOf(num);\n\t\t\t\t\tdata = \":\" + data;\n\t\t\t\t\tselectStartorDueHours(hr, data);\n\t\t\t\t\tString num8 = \":\" + num;\n\t\t\t\t\tselectList(object, String.valueOf(num8));\n\t\t\t\t\treturn Constants.KEYWORD_PASS + \" Start Minutes has been Entered.. \";\n\t\t\t\t} else if (unitdigit > 5 && unitdigit < 9) {\n\t\t\t\t\tnum = num + 10;\n\t\t\t\t\tif (num >= 60) {\n\t\t\t\t\t\tdata = String.valueOf(num);\n\t\t\t\t\t\tdata = \":\" + data;\n\t\t\t\t\t\tselectStartorDueHours(hr, data);\n\t\t\t\t\t\tFinalNum = Constants.VALUE_DOUBLE_ZERO;\n\t\t\t\t\t\tselectList(object, FinalNum);\n\t\t\t\t\t\treturn Constants.KEYWORD_PASS + \" Start Minutes has been Entered.. \";\n\t\t\t\t\t}\n\t\t\t\t} else if (unitdigit == 9) {\n\t\t\t\t\tnum = num + 15;\n\t\t\t\t\tif (num >= 60) {\n\t\t\t\t\t\tdata = String.valueOf(num);\n\t\t\t\t\t\tdata = \":\" + data;\n\t\t\t\t\t\tselectStartorDueHours(hr, data);\n\t\t\t\t\t\tnum = num - 60;\n\t\t\t\t\t\tif (num == 5) {\n\t\t\t\t\t\t\tString num3 = Constants.VALUE_0 + num;\n\t\t\t\t\t\t\tselectList(object, num3);\n\t\t\t\t\t\t\treturn Constants.KEYWORD_PASS + \" Start Minutes has been Entered.. \";\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tString num4 = String.valueOf(num);\n\t\t\t\t\t\tnum4 = \":\" + num4;\n\t\t\t\t\t\tselectList(object, num4);\n\t\t\t\t\t\treturn Constants.KEYWORD_PASS + \" Start Minutes has been Entered.. \";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tFinalNum = String.valueOf(num);\n\t\t\t\tFinalNum = \":\" + FinalNum;\n\t\t\t\tselectList(object, FinalNum);\n\t\t\t\treturn Constants.KEYWORD_PASS + \" Start Minutes has been Entered.. \";\n\t\t\t}\n\t\t} catch (Exception e) {\n\n\t\t\treturn Constants.KEYWORD_FAIL + e.getMessage();\n\t\t}\n\t}", "public String convertCalendarDateTimeHourMinToMillisecondsAsString(String stringDate) throws ParseException {\n\t\t\t\tDateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\");\n\t\t\t\tDate date = formatter.parse(stringDate);\n\t\t\t\tlong mills = date.getTime();\n\t\t\t\treturn String.valueOf(mills);\n\t\t\t}", "public static void main(String[] args) {\n\t\tString s = \"12:45:54PM\";\r\n\t\tString temp=\":\";\r\n\t\tString Result=\"\";\r\n\t\t\r\n\t\tif(s.charAt(8)=='P' || s.charAt(8)=='p')\r\n\t\t {\r\n\t\t\tString s1[] = s.split(\":\");\r\n\t int Hour = Integer.parseInt(s1[0]);\r\n\t String Actual_Hour = \"\";\r\n\t if(Hour == 12)\r\n\t {\r\n\t \tActual_Hour = \"12\";\r\n\t }\r\n\t else\r\n\t {\r\n\t \tint data = 12 + Hour;\r\n\t \tActual_Hour = String.valueOf(data);\r\n\t }\r\n\t \r\n\t \r\n\t Result = Actual_Hour +temp+s1[1]+temp+s1[2].substring(0, 2);\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t \tString s1[] = s.split(\":\");\r\n\t\t \tint Hour = Integer.parseInt(s1[0]);\r\n\t\t String Actual_Hour = \"\";\r\n\t\t if(Hour == 12)\r\n\t\t {\r\n\t\t \tActual_Hour = \"00\";\r\n\t\t \tResult = Actual_Hour +temp+s1[1]+temp+s1[2].substring(0, 2); \r\n\t\t }\r\n\t\t else {\r\n\t\t \tString s2[] = s.split(\"AM\");\r\n\t\t\t for(int i=0; i<s2.length; i++)\r\n\t\t\t {\r\n\t\t\t \tResult = s2[i];\r\n\t\t\t }\t\r\n\t\t }\r\n\t\t \t\r\n\t\t }\r\n\t\t\r\n\t\t\t\tSystem.out.println(Result);\r\n}", "public static int secondsAfterMidnight(String t) {\n int seconds; //initializing seconds, will be returned to main.\n t.toLowerCase(); //setting all input to lowercase so it is easier to handle.\n if (t.length() == 10){ //if input is 10 characters\n // if statement below checks whether each character is appropriate before continuing.\n if((t.startsWith(\"0\") || t.startsWith(\"1\"))&& Character.isDigit(t.charAt(1))&& \n t.charAt(2) == ':' && Character.isDigit(t.charAt(3))&& Character.isDigit(t.charAt(4))&&\n t.charAt(5) == ':' && Character.isDigit(t.charAt(6))&& Character.isDigit(t.charAt(7))&&\n (t.endsWith(\"am\") || t.endsWith(\"pm\"))){\n // Characters converted to numeric values and hours, minutes, and seconds are\n // calculated below.\n int hours = Character.getNumericValue(t.charAt(0))*10 \n + Character.getNumericValue(t.charAt(1));\n //if hours is equal to 12 such as 12:35, switched to 0:35, for easier calc.\n if(hours == 12){ \n hours = 0;\n }\n int minutes = Character.getNumericValue(t.charAt(3))*10 \n + Character.getNumericValue(t.charAt(4));\n seconds = Character.getNumericValue(t.charAt(6))*10 \n + Character.getNumericValue(t.charAt(7)); \n if(minutes < 60 && seconds < 60){//checks whether minute and second input is below 60.\n if(t.endsWith(\"pm\")){ //adding 43200 (12 hours in seconds) if time is pm.\n seconds = hours*3600 + minutes*60 + seconds + 43200;\n }else{\n seconds = hours*3600 + minutes*60 + seconds; \n }\n }else{\n seconds = -1; //if proper input is not given, seconds set to -1.\n }\n } else {\n seconds = -1; //improper input leads to seconds set to -1.\n }\n //below is for input that has 9 characters, such as 9:12:23am, instead of 09:12:23am. The code below\n // is very similar to to code for 10 characters above. \n }else if (t.length() == 9){\n if(Character.isDigit(t.charAt(0))&& t.charAt(1) == ':' && Character.isDigit(t.charAt(2))\n && Character.isDigit(t.charAt(3))&& t.charAt(4) == ':' && Character.isDigit(t.charAt(5))\n && Character.isDigit(t.charAt(6))&&(t.endsWith(\"am\") || t.endsWith(\"pm\"))){\n int hours = Character.getNumericValue(t.charAt(0));\n int minutes = Character.getNumericValue(t.charAt(2))*10 \n + Character.getNumericValue(t.charAt(3));\n seconds = Character.getNumericValue(t.charAt(5))*10 \n + Character.getNumericValue(t.charAt(6)); \n if(minutes < 60 && seconds < 60){\n if(t.endsWith(\"pm\")){\n seconds = hours*3600 + minutes*60 + seconds + 43200;\n }else{\n seconds = hours*3600 + minutes*60 + seconds; \n }\n }else{\n seconds = -1;\n }\n } else {\n seconds = -1;\n }\n }else{ // if input has neither 10 or 9 characters, input not proper.\n seconds = -1;\n }\n return seconds; //seconds is returned to main.\n}", "private static Long parseTimeStrictly(String s) throws IllegalArgumentException\n {\n String nanos_s;\n\n long hour;\n long minute;\n long second;\n long a_nanos = 0;\n\n String formatError = \"Timestamp format must be hh:mm:ss[.fffffffff]\";\n String zeros = \"000000000\";\n\n if (s == null)\n throw new java.lang.IllegalArgumentException(formatError);\n s = s.trim();\n\n // Parse the time\n int firstColon = s.indexOf(':');\n int secondColon = s.indexOf(':', firstColon+1);\n\n // Convert the time; default missing nanos\n if (firstColon > 0 && secondColon > 0 && secondColon < s.length() - 1)\n {\n int period = s.indexOf('.', secondColon+1);\n hour = Integer.parseInt(s.substring(0, firstColon));\n if (hour < 0 || hour >= 24)\n throw new IllegalArgumentException(\"Hour out of bounds.\");\n\n minute = Integer.parseInt(s.substring(firstColon + 1, secondColon));\n if (minute < 0 || minute >= 60)\n throw new IllegalArgumentException(\"Minute out of bounds.\");\n\n if (period > 0 && period < s.length() - 1)\n {\n second = Integer.parseInt(s.substring(secondColon + 1, period));\n if (second < 0 || second >= 60)\n throw new IllegalArgumentException(\"Second out of bounds.\");\n\n nanos_s = s.substring(period + 1);\n if (nanos_s.length() > 9)\n throw new IllegalArgumentException(formatError);\n if (!Character.isDigit(nanos_s.charAt(0)))\n throw new IllegalArgumentException(formatError);\n nanos_s = nanos_s + zeros.substring(0, 9 - nanos_s.length());\n a_nanos = Integer.parseInt(nanos_s);\n }\n else if (period > 0)\n throw new IllegalArgumentException(formatError);\n else\n {\n second = Integer.parseInt(s.substring(secondColon + 1));\n if (second < 0 || second >= 60)\n throw new IllegalArgumentException(\"Second out of bounds.\");\n }\n }\n else\n throw new IllegalArgumentException(formatError);\n\n long rawTime = 0;\n rawTime += TimeUnit.HOURS.toNanos(hour);\n rawTime += TimeUnit.MINUTES.toNanos(minute);\n rawTime += TimeUnit.SECONDS.toNanos(second);\n rawTime += a_nanos;\n return rawTime;\n }", "public String convertCalendarDateTimeHourMinSecToMillisecondsAsString(String stringDate) throws ParseException {\n\t\t\t\tDateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\t\t\t\tDate date = formatter.parse(stringDate);\n\t\t\t\tlong mills = date.getTime();\n\t\t\t\treturn String.valueOf(mills);\n\t\t\t}", "static String timeConversion(String s) {\n String[] timeSplit = s.split(\":\");\n String hours = timeSplit[0];\n String minutes = timeSplit[1];\n String seconds = timeSplit[2].substring(0, 2);\n String ampm = timeSplit[2].substring(2, 4);\n\n String newHours;\n if (ampm.equals(\"AM\")) {\n newHours = hours.equals(\"12\") ? \"00\" : hours;\n\n } else {\n newHours = hours.equals(\"12\") ? hours : String.valueOf(Integer.parseInt(hours) + 12);\n }\n\n return newHours + \":\" + minutes + \":\" + seconds;\n\n }", "public void setStartTime(long value) {\r\n this.startTime = value;\r\n }", "public static String getTime(String downloadTime){\n timeBelt = null;\n belt = null;\n String timeEndPart = downloadTime.substring(downloadTime.indexOf(\":\")-2);\n String onlyTime = timeEndPart.substring(0,timeEndPart.indexOf(\" \"));\n String prepareBelt = timeEndPart.substring(timeEndPart.indexOf(\" \"));\n prepareBelt = prepareBelt.trim();\n String[] splitBelt = null;\n if(prepareBelt.contains(\"-\")){\n splitBelt = prepareBelt.split(\"-\");\n if(splitBelt.length >= 2){\n splitBelt[1] = \"-\" + splitBelt[1];\n }\n }else if(prepareBelt.contains(\"+\")){\n splitBelt = prepareBelt.split(\"\\\\+\");\n if(splitBelt.length >= 2){\n splitBelt[1] = \"+\" + splitBelt[1];\n }\n }else{\n splitBelt = prepareBelt.split(\" \");\n if(splitBelt.length >= 2){\n splitBelt[1] = \"+\" + splitBelt[1];\n }\n }\n if(splitBelt != null && splitBelt.length >= 2){\n timeBelt = splitBelt[1];\n belt = splitBelt[0];\n }\n\n String[] timeParse = onlyTime.split(\":\");\n int hourToSecond = Integer.parseInt(timeParse[0]) * 3600;\n int minToSecond = Integer.parseInt(timeParse[1]) * 60;\n int second = Integer.parseInt(timeParse[2]);\n String time = String.valueOf ((double) (hourToSecond + minToSecond + second));\n\n return time;\n }", "public static long m7910d(String str) {\n C0823f.m362c(f8008e.matcher(str).matches(), \"Invalid Expiration Timestamp.\");\n if (str == null || str.length() == 0) {\n return 0;\n }\n return Long.parseLong(str.substring(0, str.length() - 1));\n }", "public long getStartTime ()\r\n {\r\n return startTime;\r\n }", "public static void main(String [] args)\n\t{\n\tSystem.out.println(\"Enter your GMT ofset (ei: -5): \");\n Scanner input = new Scanner(System.in);\n long totalMilliSeconds=System.currentTimeMillis(); \n long totalSeconds=totalMilliSeconds/1000; \n int second=(int)(totalSeconds%60); \n long totalMinutes=totalSeconds/60; \n int minute=(int)(totalMinutes%60); \n long totalHours=totalMinutes/60; \n int hour=(int)((totalHours - 8)%24); \n //print result\n\tSystem.out.println(\"The current time is: \"+ hour + \":\" + minute + \":\" + second);\n\t}", "void mo64942a(String str, long j, long j2);", "LocalDateTime calculateNextPossibleStartTime(LocalDateTime startTime);" ]
[ "0.640282", "0.62699205", "0.6057542", "0.5902659", "0.58440566", "0.5766358", "0.5766089", "0.57492685", "0.5743484", "0.56816524", "0.56412905", "0.5624378", "0.559303", "0.55849487", "0.5583652", "0.5583324", "0.5575246", "0.55676025", "0.5564727", "0.5557189", "0.55483025", "0.5524864", "0.55190486", "0.5495428", "0.5478957", "0.54734683", "0.54679626", "0.5464313", "0.54561776", "0.54501116", "0.54501116", "0.54501116", "0.5449873", "0.54492724", "0.5448945", "0.5438181", "0.5429731", "0.5427158", "0.5427158", "0.5427158", "0.5427158", "0.5427158", "0.5427158", "0.5427158", "0.5427158", "0.5427158", "0.5427158", "0.5427158", "0.5427158", "0.54203784", "0.54137415", "0.5410244", "0.53938687", "0.5385087", "0.5372646", "0.5362864", "0.53526586", "0.534155", "0.534155", "0.5341233", "0.5341233", "0.5333863", "0.5333442", "0.5333442", "0.53301513", "0.53272647", "0.53214073", "0.5316032", "0.5309691", "0.5301489", "0.5298502", "0.52901447", "0.5286624", "0.5281925", "0.52800757", "0.52791464", "0.52638507", "0.52609324", "0.5258973", "0.52490556", "0.52392554", "0.5237188", "0.52335876", "0.52333355", "0.5230194", "0.5229963", "0.5229045", "0.52289075", "0.5220266", "0.521959", "0.52173567", "0.52149516", "0.5212685", "0.5208719", "0.5203775", "0.52017426", "0.519319", "0.518914", "0.51808375", "0.51789", "0.51781905" ]
0.0
-1
2 VM by 2 hosts separate component
@Override public void handle(final HttpServerRequest req) { String startTime = "1355620946302"; //--separate-comp Iterator<EventInfo> iter = dataService.events() .find("{timestamp:{$gt:"+startTime+"}}") .sort("{timestamp:1}") .as(EventInfo.class).iterator(); EventCounter multiCounter = new EventCounter("/multicomp"); int processed = 0; while (iter.hasNext() && processed < limit) { EventInfo event = iter.next(); multiCounter.countEvent(event); processed++; } req.response.setChunked(true); multiCounter.printDistance(req, "sep_comp"); //multiCounter.printResponse(req, "sep_comp"); // use response time data Iterator<ResponseInfo> respIter = dataService.response() .find("{timestamp:{$gt:"+startTime+"}}") .sort("{timestamp:1}") .as(ResponseInfo.class).iterator(); ResponseCounter responseCounter = new ResponseCounter(); processed = 0; while (respIter.hasNext() && processed < limit) { ResponseInfo resp = respIter.next(); responseCounter.count(resp); processed++; } responseCounter.printResponse(req, "sep_comp"); req.response.end(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n @BeforeMethod(alwaysRun=true)\n public boolean testSetUp()\n throws Exception\n {\n ifolder = new Folder(connectAnchor);\n idvs = new DistributedVirtualSwitch(connectAnchor);\n ihs = new HostSystem(connectAnchor);\n\n // get a standalone hostmors\n // We need at at least 2 hostmors\n hostMors = ihs.getAllHosts(VersionConstants.ESX4x, HostSystemConnectionState.CONNECTED);\n authentication = new AuthorizationManager(connectAnchor);\n Assert.assertTrue(hostMors.size() >= 2, \"Unable to find two hosts\");\n\n Set<ManagedObjectReference> hostSet = hostMors.keySet();\n Iterator<ManagedObjectReference> hostIterator = hostSet.iterator();\n if (hostIterator.hasNext()) {\n hostMor1 = hostIterator.next();\n srcHostProfile1 = NetworkResourcePoolHelper.extractHostConfigSpec(\n connectAnchor, ProfileConstants.SRC_PROFILE + getTestId(),\n hostMor1);\n }\n if (hostIterator.hasNext()) {\n hostMor2 = hostIterator.next();\n srcHostProfile2 = NetworkResourcePoolHelper.extractHostConfigSpec(\n connectAnchor, ProfileConstants.SRC_PROFILE + getTestId()\n + \"-1\", hostMor2);\n }\n\n // create the dvs\n dvsMor = ifolder.createDistributedVirtualSwitch(\"dvs\",\n DVSTestConstants.VDS_VERSION_41);\n Assert.assertNotNull(dvsMor, \"DVS created\", \"DVS not created\");\n\n // enable netiorm\n Assert.assertTrue(idvs.enableNetworkResourceManagement(dvsMor, true),\n \"Netiorm not enabled\");\n\n Assert.assertTrue(NetworkResourcePoolHelper.isNrpEnabled(connectAnchor,\n dvsMor), \"NRP enabled on the dvs\",\n \"NRP is not enabled on the dvs\");\n\n // Extract the network resource pool related to the vm from the dvs\n nrp = idvs.extractNetworkResourcePool(dvsMor, DVSTestConstants.NRP_VM);\n\n // set the values in the config spec\n setNrpConfigSpec();\n authHelper = new AuthorizationHelper(connectAnchor, getTestId(), false,\n data.getString(TestConstants.TESTINPUT_USERNAME),\n data.getString(TestConstants.TESTINPUT_PASSWORD));\n authHelper.setPermissions(dvsMor, DVSWITCH_RESOURCEMANAGEMENT, testUser,\n false);\n return authHelper.performSecurityTestsSetup(testUser);\n\n }", "VM createVM();", "@Override\n @Test(description = \"PR#489924 : \"\n + \"1. create a dvs and 2 dvpgs and join 1 host\\n\"\n + \"2. Disconnect the host from VC\\n\"\n + \"3. connect to the host and invoke the HostDvsManager\"\n + \" API to do the following\\n\"\n + \" a. change the name of the dvpg1\\n\"\n + \" b. delete the dvpg2\\n\" + \" c. create a bogus dvpg\\n3\"\n + \"4. Reconnect the host and wait in a loop and read the\"\n + \" dvpg info from host HostDvsManager every 10 sec.\\n\"\n + \" when all of below become true, exit the loop:\\n\"\n + \" a. dvpg1 name is reverted\\n\"\n + \" b. dvpg2 is restored\\n\" + \" c. dvpg3 is deleted\\n\"\n + \"\")\n public void test()\n throws Exception\n {\n log.info(\"Test Begin:\");\n boolean status = false;\n DVSConfigSpec configSpec = null;\n HostNetworkConfig[] hostNetworkConfig = null;\n DistributedVirtualSwitchHostMemberConfigSpec hostMember = null;\n DistributedVirtualSwitchHostMemberPnicBacking pnicBacking = null;\n DistributedVirtualSwitchProductSpec productSpec = null;\n int timeout = TestConstants.MAX_WAIT_CONNECT_TIMEOUT;\n\n configSpec = new DVSConfigSpec();\n configSpec.setConfigVersion(\"\");\n configSpec.setName(this.getTestId() + 1);\n configSpec.setNumStandalonePorts(5);\n hostMember = new DistributedVirtualSwitchHostMemberConfigSpec();\n pnicBacking = new DistributedVirtualSwitchHostMemberPnicBacking();\n pnicBacking.getPnicSpec().clear();\n pnicBacking.getPnicSpec().addAll(com.vmware.vcqa.util.TestUtil.arrayToVector(new DistributedVirtualSwitchHostMemberPnicSpec[] {}));\n hostMember.setBacking(pnicBacking);\n hostMember.setOperation(TestConstants.CONFIG_SPEC_ADD);\n hostMember.setHost(this.hostMor);\n configSpec.getHost().clear();\n configSpec.getHost().addAll(com.vmware.vcqa.util.TestUtil.arrayToVector(new DistributedVirtualSwitchHostMemberConfigSpec[] { hostMember }));\n if (this.hostMor != null\n && (hostVersion.equalsIgnoreCase(VersionConstants.ESX400) || hostVersion.equalsIgnoreCase(VersionConstants.EESX400))) {\n log.info(\"Got \" + hostVersion + \" host\");\n log.info(\"Creating product spec for \" + hostVersion\n + \" host\");\n productSpec = DVSUtil.getProductSpec(connectAnchor,\n DVSTestConstants.VDS_VERSION_40);\n Assert.assertNotNull(productSpec,\n \"Successfully obtained the productSpec for \"\n + DVSTestConstants.VDS_VERSION_40 + \" version\",\n \"Failed to get productSpec for \"\n + DVSTestConstants.VDS_VERSION_40 + \" version\");\n }\n\n this.dvsMor = DVSUtil.createDVSFromCreateSpec(connectAnchor,\n DVSUtil.createDVSCreateSpec(configSpec, productSpec, null));\n if (this.dvsMor != null) {\n log.info(\"Successfully created the DVS \" + this.getTestId());\n hostName = this.ihs.getHostName(hostMor);\n\n if (this.ins.refresh(this.nsMor)) {\n log.info(\"Refreshed the network system of the host\");\n if (this.iDVS.validateDVSConfigSpec(this.dvsMor, configSpec,\n null)) {\n log.info(\"Successfully validated the DVS config spec\");\n hostNetworkConfig = this.iDVS.getHostNetworkConfigMigrateToDVS(\n this.dvsMor, this.hostMor);\n if (hostNetworkConfig != null\n && hostNetworkConfig.length == 2\n && hostNetworkConfig[0] != null\n && hostNetworkConfig[1] != null) {\n log.info(\"Successfully retrieved the original and the \"\n + \"updated network config of the host\");\n this.originalNetworkConfig = hostNetworkConfig[1];\n status = this.ins.updateNetworkConfig(this.nsMor,\n hostNetworkConfig[0],\n TestConstants.CHANGEMODE_MODIFY);\n if (status) {\n log.info(\"Successfully updated the host network config\");\n pgMor = addPg(ephemeral, ephemeral + \"_1\");\n origSpec1 = this.iDVPG.getConfigSpec(this.pgMor);\n Assert.assertNotNull(pgMor, \"Failed to add portgroup \"\n + early);\n this.portgroupKey = this.iDVPG.getKey(pgMor);\n log.info(\"portgroupKey \" + portgroupKey);\n\n pgMor1 = addPg(ephemeral, ephemeral + \"_2\");\n origSpec2 = this.iDVPG.getConfigSpec(this.pgMor1);\n Assert.assertNotNull(pgMor1, \"Failed to add portgroup \"\n + ephemeral);\n this.portgroupKey1 = this.iDVPG.getKey(pgMor1);\n log.info(\"portgroupKey \" + portgroupKey1);\n HostProxySwitchConfig originalHostProxySwitchConfig = this.iDVS.getDVSVswitchProxyOnHost(\n dvsMor, hostMor);\n\n dvSwitchUuid = originalHostProxySwitchConfig.getUuid();\n if (status && this.ihs.isHostConnected(this.hostMor)\n && this.ihs.disconnectHost(hostMor)) {\n status =\n performOperationsOnhostd(hostName,\n portgroupKey, portgroupKey1,\n origSpec1, origSpec2);\n } else {\n status = false;\n log.error(\"Can not execute the remote command on the\"\n + \" host \" + this.hostName);\n }\n\n } else {\n status = false;\n log.error(\"Can not update the host network config\");\n }\n } else {\n status = false;\n log.error(\"Can not retrieve the original and the updated \"\n + \"network config\");\n }\n } else {\n status = false;\n log.error(\"The config spec does not match\");\n }\n } else {\n status = false;\n log.error(\"Can not refresh the network system of the host\");\n }\n\n } else {\n status = false;\n log.error(\"Can not create the DVS \" + this.getTestId());\n }\n\n\n assertTrue(status, \"Test Failed\");\n }", "void putVHost(VHost vHost);", "public MyVM(String virtual_machine_name)\n {\n \ttry\n \t{\n \t\tthis.vmname= virtual_machine_name;\n \t\tthis.si=new ServiceInstance(new URL(SJSULAB.getVmwareHostURL()),\n\t\t\t\t\tSJSULAB.getVmwareLogin(), SJSULAB.getVmwarePassword(), true);\n \t\t\n \t\tthis.folder = si.getRootFolder();\n \t\tthis.vm=(VirtualMachine) new InventoryNavigator(folder).searchManagedEntity(\"VirtualMachine\",\n \t\t\t\tthis.vmname);\n \t\tSystem.out.println(\"MyVM, vm value : \"+vm);\n \t\t\n \t\tthis.hs= (HostSystem) new InventoryNavigator(folder).searchManagedEntity(\"HostSystem\", \"130.65.132.194\");\n \t\tSystem.out.println(\"MyVM, HS value : \"+hs);\n \t\tthis.snapshotname=\"snap2\";\n \t\t\n \t}\n \tcatch(Exception e)\n \t{\n \t\tSystem.out.println(e.toString());\n \t}\n }", "void placeVirtualMachine(VirtualMachine vm) {\n mapped_vms.add(vm);\n used_cpu = used_cpu.add(vm.getCPU());\n used_mem = used_mem.add(vm.getMemory());\n if (vm.isAntiColocatable()) {\n mapped_anti_coloc_job_ids.add(vm.getJobID());\n }\n }", "public void populateSwitchTenantMap(Server3 server){\n\n\t\tBridge3 bridge;\n\t\tInterfaces3 interfaces;\n\t\tIterator<Bridge3> iteratorBridge = server.getOpenVSwitch().getArrayListBridge().iterator();\n\t\t//Iterate in all bridges of the server to collect the proper information of the bridge\n\t\twhile(iteratorBridge.hasNext()){\n\t\t\tbridge = iteratorBridge.next();\n\t\t\t//Verify if the brigde name is the one configured to host all the VMs. In this version, all VMs have to be hosted \n\t\t\tif(bridge.getName().compareTo(server.getBridgeName())==0){\n\t\t\t\tIterator<Interfaces3> iteratorInterfaces = bridge.getArrayListInterfaces().iterator();\n\t\t\t\t//Iterate in all interfaces of the configured bridge to get all necessary information to populate the structures \n\t\t\t\twhile(iteratorInterfaces.hasNext()){\n\t\t\t\t\tinterfaces = iteratorInterfaces.next();\n\t\t\t\t\tif(interfaces.getOfport() != null && server != null && server.getSw() != null && server.getSw().getId() != null &&\n\t\t\t\t\t\t\tthis.environmentOfServers.getHostLocationHostMap().get(new HostLocation(server.getSw().getId(), interfaces.getOfport())) != null &&\n\t\t\t\t\t\t\tthis.environmentOfServers.getHostLocationHostMap().get(new HostLocation(server.getSw().getId(), interfaces.getOfport())).getIpAddress() != null){\n\t\t\t\t\t\tthis.addToPortMap(server.getSw(), interfaces.getVmsMacAddress(), VlanVid.ofVlan(0), interfaces.getOfport(), \n\t\t\t\t\t\t\t\tthis.environmentOfServers.getHostLocationHostMap().get(new HostLocation(server.getSw().getId(), interfaces.getOfport())).getIpAddress());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\n public boolean allocateHostForVm(Vm vm) {\n\n Collections.sort(this.<Host>getHostList(), new Comparator<Host>() {\n @Override\n public int compare(Host h1, Host h2) {\n // -1 - less than, 1 - greater than, 0 - equal, all inversed for descending\n return (h1.getMaxAvailableMips() + h1.getRam()) > (h2.getMaxAvailableMips() + h2.getRam()) ? -1 : ((h1.getMaxAvailableMips() + h1.getRam()) < (h2.getMaxAvailableMips() + h2.getRam()) ? 1 : 0);\n }\n });\n\n for (Host h : getHostList()) { // allocate the vm within the first host with enough resources\n if (h.vmCreate(vm)) {\n this.hoster.put(vm.getUid(), h);\n return true;\n }\n }\n return false;\n }", "@Override\n\tpublic void execute(DelegateExecution execution) throws Exception {\n\t\tString ip = (String) execution.getVariable(\"ip\");\n\t\tString serviceHome = (String) execution.getVariable(\"serviceHome\");\n\t\tString coRoot = (String) execution.getVariable(\"coRoot\");\n\t\tString customizationId = (String) execution.getVariable(\"customizationId\");\n\t\tHashMap<String, String> data = toscaService.getCloudData(customizationId);\n\n\t\t// TODO al momento è vuoto perchè non lo leggiamo da nulla valutare se\n\t\t// leggerlo dinamicamente o da file di configurazione\n\t\tString privateKeyPath = (String) execution.getVariable(\"privateKeyPath\");\n\t\tString passphrase = (String) execution.getVariable(\"passphrase\");\n\n\t\t// prepare the certificates\n\t\tshellCert(serviceHome, caPath, data.get(\"vmname\"), ip, caPassword);\n\t\t// send the key\n\t\ttransferFile(serviceHome, \"key.pem\", privateKeyPath, passphrase, ip);\n\t\t// send the cert\n\t\ttransferFile(serviceHome, \"cert.pem\", privateKeyPath, passphrase, ip);\n\n\t\t// now that all the pieces are in the machine we can join it to swarm\n\t\tString remote_command = \"systemctl start docker && /usr/bin/docker run -itd --name=swarm-agent --expose=2376 -e SWARM_HOST=:2376 swarm join --advertise=\"\n\t\t\t\t+ ip + \":\" + dockerPort + \" consul://\" + hostip + \":8500\";\n\n\t\tProperties config = new Properties();\n\t\tconfig.put(\"StrictHostKeyChecking\", \"no\"); // without this it cannot\n\t\t\t\t\t\t\t\t\t\t\t\t\t// connect because the host\n\t\t\t\t\t\t\t\t\t\t\t\t\t// key verification fails\n\t\t\t\t\t\t\t\t\t\t\t\t\t// the right way would be to\n\t\t\t\t\t\t\t\t\t\t\t\t\t// somehow get the server\n\t\t\t\t\t\t\t\t\t\t\t\t\t// key and add it to the\n\t\t\t\t\t\t\t\t\t\t\t\t\t// trusted keys\n\t\t\t\t\t\t\t\t\t\t\t\t\t// jsch.setKnownHosts()\n\t\t\t\t\t\t\t\t\t\t\t\t\t// https://epaul.github.io/jsch-documentation/javadoc/com/jcraft/jsch/JSch.html#setKnownHosts-java.lang.String-\n\t\t\t\t\t\t\t\t\t\t\t\t\t// see also\n\t\t\t\t\t\t\t\t\t\t\t\t\t// http://stackoverflow.com/a/32858953/28582\n\t\tJSch jsch = new JSch();\n\t\tjsch.addIdentity(privateKeyPath, passphrase);\n\n\t\tSession session = jsch.getSession(ROOT_USER, ip, SSH_PORT);\n\t\tsession.setConfig(config);\n\t\tsession.connect();\n\n\t\tChannelExec channel = (ChannelExec) session.openChannel(\"exec\");\n\t\tint exitStatus = sendCommand(remote_command, channel);\n\t\tlog.debug(\"Command: [\" + remote_command + \"]\");\n\t\tif (exitStatus != 0) {\n\t\t\tlog.debug(\"FAILED - exit status: \" + exitStatus);\n\t\t} else {\n\t\t\tlog.debug(\"Executed successfully\");\n\t\t}\n\t\tchannel.disconnect();\n\t\tsession.disconnect();\n\n\t\tlog.debug(\"in DeployDockerSwarm\");\n\t\t// toscaService.getNodeType(\"\");\n\t\t// dockerService.addMachine(ip, 2376); //SSL\n\t\tString clusterToken = dockerService.addMachine(swarmIp, Integer.parseInt(swarmPort)); // no SSL\n\t\texecution.setVariable(\"clusterToken\", clusterToken);\n\t\tString clusterInfo = dockerService.clusterDetail(clusterToken);\n\t}", "Switch getHostSwitch();", "public void helloVM()\n {\n \ttry {\n\n\t\t\t\n\t\t\tVirtualMachineConfigInfo vminfo = vm.getConfig();\n\t\t\tVirtualMachineCapability vmc = vm.getCapability();\n\t\t\tVirtualMachineRuntimeInfo vmri = vm.getRuntime();\n\t\t\tVirtualMachineSummary vmsum = vm.getSummary();\n\n\t\t\t\n\t\t\tSystem.out.println(\"------------------------------------------\");\n\t\t\tSystem.out.println(\"VM Information : \");\n\t\t\t\n\t\t\tSystem.out.println(\"VM Name: \" + vminfo.getName());\n\t\t\tSystem.out.println(\"VM OS: \" + vminfo.getGuestFullName());\n\t\t\tSystem.out.println(\"VM ID: \" + vminfo.getGuestId());\n\t\t\tSystem.out.println(\"VM Guest IP Address is \" +vm.getGuest().getIpAddress());\n\t\t\t\n\n\t\t\tSystem.out.println(\"------------------------------------------\");\n\t\t\tSystem.out.println(\"Resource Pool Informtion : \");\n\t\t\t\n\t\t\tSystem.out.println(\"Resource pool: \" +vm.getResourcePool());\n\t\t\t\n\t\t\tSystem.out.println(\"VM Parent: \" +vm.getParent());\n\t\t\t//System.out.println(\"VM Values: \" +vm.getValues());\n\t\t\tSystem.out.println(\"Multiple snapshot supported: \"\t+ vmc.isMultipleSnapshotsSupported());\n\t\t\tSystem.out.println(\"Powered Off snapshot supported: \"+vmc.isPoweredOffSnapshotsSupported());\n\t\t\tSystem.out.println(\"Connection State: \" + vmri.getConnectionState());\n\t\t\tSystem.out.println(\"Power State: \" + vmri.getPowerState());\n\t\t\t\n\n\t\t\t//CPU Statistics\n\n\t\t\tSystem.out.println(\"------------------------------------------\");\n\t\t\tSystem.out.println(\"CPU and Memory Statistics\" );\n\t\t\t\n\t\t\tSystem.out.println(\"CPU Usage: \" +vmsum.getQuickStats().getOverallCpuUsage());\n\t\t\tSystem.out.println(\"Max CPU Usage: \" + vmri.getMaxCpuUsage());\n\t\t\tSystem.out.println(\"Memory Usage: \"+vmsum.getQuickStats().getGuestMemoryUsage());\n\t\t\tSystem.out.println(\"Max Memory Usage: \" + vmri.getMaxMemoryUsage());\n\t\t\tSystem.out.println(\"------------------------------------------\");\n\n\t\t} catch (InvalidProperty e) {\n\t\t\te.printStackTrace();\n\t\t} catch (RuntimeFault e) {\n\t\t\te.printStackTrace();\n\t\t} catch (RemoteException e) {\n\t\t\te.printStackTrace();\n\t\t}\n }", "public void testDifferentClusters() throws Exception {\n JChannel first1 = new JChannel(\"stacks/tcp_mping/tcp1.xml\");\n JChannel first2 = new JChannel(\"stacks/tcp_mping/tcp1.xml\");\n JChannel first3 = new JChannel(\"stacks/tcp_mping/tcp1.xml\");\n initiChannel(first1);\n initiChannel(first2);\n initiChannel(first3);\n\n expectView(first1, first2, first3);\n\n JChannel second1 = new JChannel(\"stacks/tcp_mping/tcp2.xml\");\n JChannel second2 = new JChannel(\"stacks/tcp_mping/tcp2.xml\");\n JChannel second3 = new JChannel(\"stacks/tcp_mping/tcp2.xml\");\n initiChannel(second1);\n initiChannel(second2);\n initiChannel(second3);\n\n expectView(first1, first2, first3);\n expectView(second1, second2, second3);\n success = true;\n }", "public Split(ManagedElementList<VirtualMachine> vmset1, ManagedElementList<VirtualMachine> vmset2) {\r\n this.set1 = vmset1;\r\n this.set2 = vmset2;\r\n }", "public void setVmAttachedToPool(boolean value) {\n if (value) {\n // ==General Tab==\n getDataCenterWithClustersList().setIsChangeable(!value);\n getQuota().setIsChangeable(false);\n getCpuProfiles().setIsChangeable(false);\n\n getVmId().setIsChangeable(false);\n\n getNumOfDesktops().setIsChangeable(false);\n getPrestartedVms().setIsChangeable(false);\n getMaxAssignedVmsPerUser().setIsChangeable(false);\n\n getBaseTemplate().setIsChangeable(false);\n getTemplateWithVersion().setIsChangeable(false);\n getInstanceTypes().setIsChangeable(false);\n getMemSize().setIsChangeable(false);\n getTotalCPUCores().setIsChangeable(false);\n\n getCustomCpu().setIsChangeable(false);\n getEmulatedMachine().setIsChangeable(false);\n\n getCoresPerSocket().setIsChangeable(false);\n getNumOfSockets().setIsChangeable(false);\n getThreadsPerCore().setIsChangeable(false);\n getSerialNumberPolicy().setIsChangeable(false);\n\n getOSType().setIsChangeable(false);\n getIsStateless().setIsChangeable(false);\n getIsRunAndPause().setIsChangeable(false);\n getIsDeleteProtected().setIsChangeable(false);\n\n // ==Initial run Tab==\n getTimeZone().setIsChangeable(false);\n\n // ==Console Tab==\n getDisplayType().setIsChangeable(false);\n getGraphicsType().setIsChangeable(false);\n getUsbPolicy().setIsChangeable(false);\n getConsoleDisconnectAction().setIsChangeable(false);\n getNumOfMonitors().setIsChangeable(false);\n getIsSingleQxlEnabled().setIsChangeable(false);\n getIsSmartcardEnabled().setIsChangeable(false);\n getAllowConsoleReconnect().setIsChangeable(false);\n getVncKeyboardLayout().setIsChangeable(false);\n getSsoMethodNone().setIsChangeable(false);\n getSsoMethodGuestAgent().setIsChangeable(false);\n\n // ==Host Tab==\n getIsAutoAssign().setIsChangeable(false);\n getDefaultHost().setIsChangeable(false);\n getHostCpu().setIsChangeable(false);\n getMigrationMode().setIsChangeable(false);\n getCpuPinning().setIsChangeable(false);\n getMigrationDowntime().setIsChangeable(false);\n\n // ==Resource Allocation Tab==\n getMinAllocatedMemory().setIsChangeable(false);\n getProvisioning().setIsChangeable(false);\n getProvisioningThin_IsSelected().setIsChangeable(false);\n getProvisioningClone_IsSelected().setIsChangeable(false);\n getDisksAllocationModel().setIsChangeable(false);\n getIoThreadsEnabled().setIsChangeable(false);\n getNumOfIoThreads().setIsChangeable(false);\n\n // ==Boot Options Tab==\n getFirstBootDevice().setIsChangeable(false);\n getSecondBootDevice().setIsChangeable(false);\n getCdAttached().setIsChangeable(false);\n getCdImage().setIsChangeable(false);\n getKernel_path().setIsChangeable(false);\n getInitrd_path().setIsChangeable(false);\n getKernel_parameters().setIsChangeable(false);\n\n // ==Random Generator Tab==\n getIsRngEnabled().setIsChangeable(false);\n getRngPeriod().setIsChangeable(false);\n getRngBytes().setIsChangeable(false);\n getRngSourceRandom().setIsChangeable(false);\n getRngSourceHwrng().setIsChangeable(false);\n\n // ==Custom Properties Tab==\n getCustomProperties().setIsChangeable(false);\n getCustomPropertySheet().setIsChangeable(false);\n\n // ==Icon Tab==\n getIcon().setIsChangeable(false);\n\n vmAttachedToPool = true;\n }\n }", "public static void main(String[] args)\n {\n Client oneClient;\n\n try\n {\n oneClient = new Client();\n\n // We will try to create a new virtual machine. The first thing we\n // need is an OpenNebula virtual machine template.\n\n // This VM template is a valid one, but it will probably fail to run\n // if we try to deploy it; the path for the image is unlikely to\n // exist.\n String vmTemplate =\n \"NAME = vm_from_java CPU = 0.1 MEMORY = 64\\n\"\n + \"#DISK = [\\n\"\n + \"#\\tsource = \\\"/home/user/vmachines/ttylinux/ttylinux.img\\\",\\n\"\n + \"#\\ttarget = \\\"hda\\\",\\n\"\n + \"#\\treadonly = \\\"no\\\" ]\\n\"\n + \"# NIC = [ NETWORK = \\\"Non existing network\\\" ]\\n\"\n + \"FEATURES = [ acpi=\\\"no\\\" ]\";\n\n // You can try to uncomment the NIC line, in that case OpenNebula\n // won't be able to insert this machine in the database.\n\n System.out.println(\"Virtual Machine Template:\\n\" + vmTemplate);\n System.out.println();\n\n System.out.print(\"Trying to allocate the virtual machine... \");\n OneResponse rc = VirtualMachine.allocate(oneClient, vmTemplate);\n\n if( rc.isError() )\n {\n System.out.println( \"failed!\");\n throw new Exception( rc.getErrorMessage() );\n }\n\n // The response message is the new VM's ID\n int newVMID = Integer.parseInt(rc.getMessage());\n System.out.println(\"ok, ID \" + newVMID + \".\");\n\n // We can create a representation for the new VM, using the returned\n // VM-ID\n VirtualMachine vm = new VirtualMachine(newVMID, oneClient);\n\n // Let's hold the VM, so the scheduler won't try to deploy it\n System.out.print(\"Trying to hold the new VM... \");\n rc = vm.hold();\n\n if(rc.isError())\n {\n System.out.println(\"failed!\");\n throw new Exception( rc.getErrorMessage() );\n }\n else\n System.out.println(\"ok.\");\n\n // And now we can request its information.\n rc = vm.info();\n\n if(rc.isError())\n throw new Exception( rc.getErrorMessage() );\n\n System.out.println();\n System.out.println(\n \"This is the information OpenNebula stores for the new VM:\");\n System.out.println(rc.getMessage() + \"\\n\");\n\n // This VirtualMachine object has some helpers, so we can access its\n // attributes easily (remember to load the data first using the info\n // method).\n System.out.println(\"The new VM \" +\n vm.getName() + \" has status: \" + vm.status());\n\n // And we can also use xpath expressions\n System.out.println(\"The path of the disk is\");\n System.out.println( \"\\t\" + vm.xpath(\"template/disk/source\") );\n\n // Let's delete the VirtualMachine object.\n vm = null;\n\n // The reference is lost, but we can ask OpenNebula about the VM\n // again. This time however, we are going to use the VM pool\n VirtualMachinePool vmPool = new VirtualMachinePool(oneClient);\n // Remember that we have to ask the pool to retrieve the information\n // from OpenNebula\n rc = vmPool.info();\n\n if(rc.isError())\n throw new Exception( rc.getErrorMessage() );\n\n System.out.println(\n \"\\nThese are all the Virtual Machines in the pool:\");\n for ( VirtualMachine vmachine : vmPool )\n {\n System.out.println(\"\\tID : \" + vmachine.getId() +\n \", Name : \" + vmachine.getName() );\n\n // Check if we have found the VM we are looking for\n if ( vmachine.getId().equals( \"\"+newVMID ) )\n {\n vm = vmachine;\n }\n }\n\n // We have also some useful helpers for the actions you can perform\n // on a virtual machine, like suspend:\n rc = vm.suspend();\n System.out.println(\"\\nTrying to suspend the VM \" + vm.getId() +\n \" (should fail)...\");\n\n // This is all the information you can get from the OneResponse:\n System.out.println(\"\\tOpenNebula response\");\n System.out.println(\"\\t Error: \" + rc.isError());\n System.out.println(\"\\t Msg: \" + rc.getMessage());\n System.out.println(\"\\t ErrMsg: \" + rc.getErrorMessage());\n\n rc = vm.terminate();\n System.out.println(\"\\nTrying to terminate the VM \" +\n vm.getId() + \"...\");\n\n System.out.println(\"\\tOpenNebula response\");\n System.out.println(\"\\t Error: \" + rc.isError());\n System.out.println(\"\\t Msg: \" + rc.getMessage());\n System.out.println(\"\\t ErrMsg: \" + rc.getErrorMessage());\n\n\n }\n catch (Exception e)\n {\n System.out.println(e.getMessage());\n }\n\n\n }", "boolean canHostVirtualMachine(VirtualMachine vm) {\n return getLeftoverCPU().compareTo(vm.getCPU()) >= 0 &&\n getLeftoverMemory().compareTo(vm.getMemory()) >= 0 &&\n vm.canRunInPhysicalMachine(pm) &&\n (!vm.isAntiColocatable() ||\n !mapped_anti_coloc_job_ids.contains(new Integer(vm.getJobID())));\n }", "VM getVM();", "boolean getIsVirtHost();", "@Test\n public void testGIIFromSecondaryWhenDSMDetectsServerLive() throws Exception {\n server1.invoke(HAInterestTestCase::closeCache);\n server2.invoke(HAInterestTestCase::closeCache);\n server3.invoke(HAInterestTestCase::closeCache);\n\n PORT1 = server1.invoke(HAInterestTestCase::createServerCacheWithLocalRegion);\n PORT2 = server2.invoke(HAInterestTestCase::createServerCacheWithLocalRegion);\n PORT3 = server3.invoke(HAInterestTestCase::createServerCacheWithLocalRegion);\n\n server1.invoke(HAInterestTestCase::createEntriesK1andK2);\n server2.invoke(HAInterestTestCase::createEntriesK1andK2);\n server3.invoke(HAInterestTestCase::createEntriesK1andK2);\n\n createClientPoolCache(getName(), NetworkUtils.getServerHostName(server1.getHost()));\n\n VM backup1 = getBackupVM();\n VM backup2 = getBackupVM(backup1);\n backup1.invoke(HAInterestTestCase::stopServer);\n backup2.invoke(HAInterestTestCase::stopServer);\n verifyDeadAndLiveServers(2, 1);\n registerK1AndK2();\n verifyRefreshedEntriesFromServer();\n backup1.invoke(HAInterestTestCase::putK1andK2);\n backup1.invoke(HAInterestTestCase::startServer);\n verifyDeadAndLiveServers(1, 2);\n verifyRefreshedEntriesFromServer();\n }", "public void setHost(com.vmware.converter.DistributedVirtualSwitchHostMemberConfigSpec[] host) {\r\n this.host = host;\r\n }", "@Test\n public void multipleNetServers() throws Exception {\n String gNode1 = \"graphNode1\";\n String gNode2 = \"graphNode2\";\n\n Map<String, String> rcaConfTags = new HashMap<>();\n rcaConfTags.put(\"locus\", RcaConsts.RcaTagConstants.LOCUS_DATA_NODE);\n IntentMsg msg = new IntentMsg(gNode1, gNode2, rcaConfTags);\n wireHopper2.getSubscriptionManager().setCurrentLocus(RcaConsts.RcaTagConstants.LOCUS_DATA_NODE);\n\n wireHopper1.sendIntent(msg);\n\n WaitFor.waitFor(() ->\n wireHopper2.getSubscriptionManager().getSubscribersFor(gNode2).size() == 1,\n 10,\n TimeUnit.SECONDS);\n GenericFlowUnit flowUnit = new SymptomFlowUnit(System.currentTimeMillis());\n DataMsg dmsg = new DataMsg(gNode2, Lists.newArrayList(gNode1), Collections.singletonList(flowUnit));\n wireHopper2.sendData(dmsg);\n wireHopper1.getSubscriptionManager().setCurrentLocus(RcaConsts.RcaTagConstants.LOCUS_DATA_NODE);\n\n WaitFor.waitFor(() -> {\n List<FlowUnitMessage> receivedMags = wireHopper1.getReceivedFlowUnitStore().drainNode(gNode2);\n return receivedMags.size() == 1;\n }, 10, TimeUnit.SECONDS);\n }", "public void setHost(HostAgent host){\n\tthis.host = host;\n }", "@Test\n public void testParallelPropagationLoopBack3SitesNtoNTopologyPutFromOneDS() {\n Integer lnPort = vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1));\n Integer nyPort = vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(2, lnPort));\n Integer tkPort = vm2.invoke(() -> WANTestBase.createFirstRemoteLocator(3, lnPort));\n\n createCacheInVMs(lnPort, vm3, vm6);\n createCacheInVMs(nyPort, vm4, vm7);\n createCacheInVMs(tkPort, vm5);\n vm3.invoke(WANTestBase::createReceiver);\n vm4.invoke(WANTestBase::createReceiver);\n vm5.invoke(WANTestBase::createReceiver);\n\n // site1\n vm3.invoke(() -> WANTestBase.createSender(\"ln1\", 2, true, 100, 10, false, false, null, true));\n vm6.invoke(() -> WANTestBase.createSender(\"ln1\", 2, true, 100, 10, false, false, null, true));\n\n vm3.invoke(() -> WANTestBase.createSender(\"ln2\", 3, true, 100, 10, false, false, null, true));\n vm6.invoke(() -> WANTestBase.createSender(\"ln2\", 3, true, 100, 10, false, false, null, true));\n\n // site2\n vm4.invoke(() -> WANTestBase.createSender(\"ny1\", 1, true, 100, 10, false, false, null, true));\n vm7.invoke(() -> WANTestBase.createSender(\"ny1\", 1, true, 100, 10, false, false, null, true));\n\n vm4.invoke(() -> WANTestBase.createSender(\"ny2\", 3, true, 100, 10, false, false, null, true));\n vm7.invoke(() -> WANTestBase.createSender(\"ny2\", 3, true, 100, 10, false, false, null, true));\n\n // site3\n vm5.invoke(() -> WANTestBase.createSender(\"tk1\", 1, true, 100, 10, false, false, null, true));\n vm5.invoke(() -> WANTestBase.createSender(\"tk2\", 2, true, 100, 10, false, false, null, true));\n\n // create PR\n vm3.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ln1,ln2\", 0,\n 1, isOffHeap()));\n vm6.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ln1,ln2\", 0,\n 1, isOffHeap()));\n\n vm4.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ny1,ny2\", 0,\n 1, isOffHeap()));\n vm7.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ny1,ny2\", 0,\n 1, isOffHeap()));\n\n vm5.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"tk1,tk2\", 0,\n 1, isOffHeap()));\n\n // start all the senders\n vm3.invoke(() -> WANTestBase.startSender(\"ln1\"));\n vm3.invoke(() -> WANTestBase.startSender(\"ln2\"));\n vm6.invoke(() -> WANTestBase.startSender(\"ln1\"));\n vm6.invoke(() -> WANTestBase.startSender(\"ln2\"));\n\n vm4.invoke(() -> WANTestBase.startSender(\"ny1\"));\n vm4.invoke(() -> WANTestBase.startSender(\"ny2\"));\n vm7.invoke(() -> WANTestBase.startSender(\"ny1\"));\n vm7.invoke(() -> WANTestBase.startSender(\"ny2\"));\n\n vm5.invoke(() -> WANTestBase.startSender(\"tk1\"));\n vm5.invoke(() -> WANTestBase.startSender(\"tk2\"));\n\n // pause senders on all the sites\n vm3.invoke(() -> WANTestBase.pauseSender(\"ln1\"));\n vm3.invoke(() -> WANTestBase.pauseSender(\"ln2\"));\n vm6.invoke(() -> WANTestBase.pauseSender(\"ln1\"));\n vm6.invoke(() -> WANTestBase.pauseSender(\"ln2\"));\n\n vm4.invoke(() -> WANTestBase.pauseSender(\"ny1\"));\n vm4.invoke(() -> WANTestBase.pauseSender(\"ny2\"));\n vm7.invoke(() -> WANTestBase.pauseSender(\"ny1\"));\n vm7.invoke(() -> WANTestBase.pauseSender(\"ny2\"));\n\n vm5.invoke(() -> WANTestBase.pauseSender(\"tk1\"));\n vm5.invoke(() -> WANTestBase.pauseSender(\"tk2\"));\n\n // this is required since sender pause doesn't take effect immediately\n Wait.pause(1000);\n\n // do puts on site1\n vm3.invoke(() -> WANTestBase.doPuts(getTestMethodName() + \"_PR\", 100));\n\n // verify queue size on site1 and site3\n vm3.invoke(() -> WANTestBase.verifyQueueSize(\"ln1\", 100));\n vm3.invoke(() -> WANTestBase.verifyQueueSize(\"ln2\", 100));\n\n // resume sender (from site1 to site2) on site1\n vm3.invoke(() -> WANTestBase.resumeSender(\"ln1\"));\n vm6.invoke(() -> WANTestBase.resumeSender(\"ln1\"));\n\n // validate region size on site2\n vm4.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 100));\n\n // verify queue size on site2 (sender 2 to 1)\n // should remain at 0 as the events from site1 should not go back to site1\n vm4.invoke(() -> WANTestBase.verifyQueueSize(\"ny1\", 0));\n\n // verify queue size on site2 (sender 2 to 3)\n // should remain at 0 as events from site1 will reach site3 directly..site2 need not send to\n // site3 again\n vm4.invoke(() -> WANTestBase.verifyQueueSize(\"ny2\", 0));\n\n // do more puts on site3\n vm5.invoke(() -> WANTestBase.doPutsFrom(getTestMethodName() + \"_PR\", 100, 200));\n\n // resume sender (from site3 to site2) on site3\n vm5.invoke(() -> WANTestBase.resumeSender(\"tk2\"));\n\n // validate region size on site2\n vm4.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 200));\n\n // verify queue size on site2 (sender 2 to 3)\n // should remain at 0 as the events from site3 should not go back to site3\n vm4.invoke(() -> WANTestBase.verifyQueueSize(\"ny2\", 0));\n\n // verify queue size on site2 (sender 2 to 1)\n // should remain at 0 as events from site3 will reach site1 directly..site2 need not send to\n // site1 again\n vm4.invoke(() -> WANTestBase.verifyQueueSize(\"ny1\", 0));\n\n // resume all senders\n vm3.invoke(() -> WANTestBase.resumeSender(\"ln2\"));\n vm6.invoke(() -> WANTestBase.resumeSender(\"ln2\"));\n\n vm4.invoke(() -> WANTestBase.resumeSender(\"ny1\"));\n vm4.invoke(() -> WANTestBase.resumeSender(\"ny2\"));\n vm7.invoke(() -> WANTestBase.resumeSender(\"ny1\"));\n vm7.invoke(() -> WANTestBase.resumeSender(\"ny2\"));\n\n vm5.invoke(() -> WANTestBase.resumeSender(\"tk1\"));\n\n // validate region size on all sites\n vm3.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 200));\n vm4.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 200));\n vm5.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 200));\n }", "public void byeHost(Host aHost);", "public String getBoxNetHost();", "void initAgents() {\n Runtime rt = Runtime.instance();\n\n //Create a container to host the Default Agent\n Profile p = new ProfileImpl();\n p.setParameter(Profile.MAIN_HOST, \"localhost\");\n //p.setParameter(Profile.MAIN_PORT, \"10098\");\n p.setParameter(Profile.GUI, \"false\");\n ContainerController cc = rt.createMainContainer(p);\n\n HashMap<Integer, String> neighbors = new HashMap <Integer, String>();\n neighbors.put(1, \"2, 4, 3\");\n neighbors.put(2, \"1, 3\");\n neighbors.put(3, \"1, 2, 4\");\n neighbors.put(4, \"1, 3, 5\");\n neighbors.put(5, \"4\");\n\n//Create a container to host the Default Agent\n try {\n for (int i = 1; i <= MainController.numberOfAgents; i++) {\n AgentController agent = cc.createNewAgent(Integer.toString(i), \"ru.spbu.mas.DefaultAgent\",\n new Object[]{neighbors.get(i)});\n agent.start();\n }\n } catch (StaleProxyException e) {\n e.printStackTrace();\n }\n }", "public void newHost(Host aHost);", "private boolean initDataOnHosts(String srcIP, String destIP)\t\n\t{\n\t\tSystem.out.println(\"######### In initDataOnHosts #############\");\n\t\tSwitchPort[] SwitchPort;\n\t\tboolean isHostSrcFound = false;\n\t\tboolean isHostDestFound = false;\n\t\t\n\t\t//Get all devices known by the controller.(device = host)\n\t\tCollection<? extends IDevice> alldevices = deviceManager.getAllDevices();\n\n\t\tfor (IDevice device : alldevices)\n\t\t{\n\t\t\tInteger [] deviceAssociatedIPv4Addr = device.getIPv4Addresses();\n\n\t\t\tif(deviceAssociatedIPv4Addr.length>0)\n\t\t\t{\n\t\t\t\tString assocIpv4Addr = IPv4.fromIPv4Address(deviceAssociatedIPv4Addr[0]);\n\n\t\t\t\tif(assocIpv4Addr.equals(srcIP))\n\t\t\t\t{\n\t\t\t\t\t//Get attachment points associated with the device\n\t\t\t\t\tSwitchPort = device.getAttachmentPoints();\n\t\t\t\t\tif(SwitchPort.length>0)\n\t\t\t\t\t{\n\t\t\t\t\t\tm_switchSrc =SwitchPort[0].getSwitchDPID();\n\t\t\t\t\t\tm_sourceMacAddr = device.getMACAddressString();\n\t\t\t\t\t\tm_switchSrcPortToHostSource =( short)SwitchPort[0].getPort();\n\t\t\t\t\t\tisHostSrcFound = true;\n\t\t\t\t\t\tSystem.out.println(\"######### Update src Host \"+\"switchId\"+m_switchSrc.toString()+ \"#############\");\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\telse if(assocIpv4Addr .equals(destIP))\n\t\t\t\t{\n\t\t\t\t\t//Get attachment points associated with the device\n\t\t\t\t\tSwitchPort =device.getAttachmentPoints();\n\t\t\t\t\tif(SwitchPort.length>0)\n\t\t\t\t\t{\n\t\t\t\t\t\tm_switchDst =SwitchPort[0].getSwitchDPID();\n\t\t\t\t\t\tm_destMacAddr = device.getMACAddressString();\n\t\t\t\t\t\tm_switchDstPortToHostTarget =(short)SwitchPort[0].getPort();\n\t\t\t\t\t\tisHostDestFound = true;\n\t\t\t\t\t\tSystem.out.println(\"######### Update dest Host \"+\"switchId\"+m_switchDst.toString()+ \"#############\");\n\t\t\t\t\t}\t\n\t\t\t\t}\t\t\t\t\n\t\t\t}\t\t\n\t\t}\n\t\tif(isHostSrcFound && isHostDestFound)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\t\n\t}", "public void printHostSystems() throws InvalidProperty, RuntimeFault, RemoteException{\r\n\t\tManagedEntity[] mes = new\r\n\t\t\t\tInventoryNavigator(_instance.getRootFolder()).searchManagedEntities(\"HostSystem\");\r\n\t\tfor (int i = 0; i < mes.length; i++) {\r\n\t\t\tHostSystem currHostSystem = (HostSystem)mes[i];\r\n\t\t\tSystem.out.printf(\"host[%d]: Name = %s\\n\", i, currHostSystem.getName());\r\n\t\t}\r\n\t}", "public static void main(String[] args){\n\t\tXenVM vm22 = new XenVM(\"vm22\", \"172.16.1.22\", 22, \"root\", \"welcome\");\n\t\t//XenVM vm31 = new XenVM(\"vm31\", \"172.16.1.31\", 22, \"root\", \"welcome\");\n\t\t//XenVM vm31 = new XenVM(\"vm31\", \"172.16.1.31\", 22, \"root\", \"welcome\");\n\t\t//XenVM vm21 = new XenVM(\"vm21\", \"172.16.1.21\", 22, \"root\", \"welcome\");\n\t\t//StartApp s11 = new StartApp(vm11);\n\t\tStartApp s22 = new StartApp(vm22);\n\t\t//StartApp s31 = new StartApp(vm31);\n\t\t//StartApp s31 = new StartApp(vm31);\n\t\t//StartApp s21 = new StartApp(vm21);\n\t\t//s11.start();\n\t\ts22.start();\n\t\t//s31.start();\n\t\t//s11.join();\n\t\t//s12.join();\n\t\t//s31.join();\n\t\t//s21.start();\n\t\ts22.join();\n\t}", "public interface InstanceDeployCenter {\r\n\r\n /**\r\n * 启动已经存在的实例\r\n * @param appId\r\n * @param instanceId\r\n * @return\r\n */\r\n boolean startExistInstance(long appId, int instanceId);\r\n\r\n /**\r\n * 启动已存在的实例,无需进行redis资源包校验\r\n * @param appId\r\n * @param instanceId\r\n * @return\r\n */\r\n boolean startExistInstanceWithoutResourceCheck(long appId, int instanceId);\r\n\r\n /**\r\n * 下线已经存在的实例\r\n * @param appId\r\n * @param instanceId\r\n * @return\r\n */\r\n boolean shutdownExistInstance(long appId, int instanceId);\r\n\r\n /**\r\n * cluster forget\r\n * @param appId\r\n * @param instanceId\r\n * @return\r\n */\r\n boolean forgetInstance(long appId, int instanceId);\r\n\r\n /**\r\n * 清理(cluster forget)集群内所有fail节点\r\n * @param appId\r\n * @param instanceId\r\n * @return\r\n */\r\n boolean clearFailInstances(long appId);\r\n \r\n /**\r\n * 展示实例最近的日志\r\n * @param instanceId\r\n * @param maxLineNum\r\n * @return\r\n */\r\n String showInstanceRecentLog(int instanceId, int maxLineNum);\r\n\r\n /**\r\n * 修改实例配置\r\n * @param appId\r\n * @param appAuditId\r\n * @param host\r\n * @param port\r\n * @param instanceConfigKey\r\n * @param instanceConfigValue\r\n * @return\r\n */\r\n boolean modifyInstanceConfig(long appId, Long appAuditId, String host, int port, String instanceConfigKey,\r\n String instanceConfigValue);\r\n\r\n /**\r\n * 检测pod是否有被调度其他宿主机\r\n * @param ip\r\n */\r\n MachineSyncEnum podChangeStatus(String ip);\r\n\r\n /**\r\n * 检测pod是否有心跳停止实例&启动\r\n * @return\r\n */\r\n List<InstanceAlertValueResult> checkAndStartExceptionInstance(String ip, Boolean isAlert);\r\n\r\n\r\n}", "HostingMode hostingMode();", "public void testSetHost() {\n }", "public MyVM( ) \n {\n // initialise instance variables\n try \n {\n // your code here\n \tthis.si=new ServiceInstance(new URL(SJSULAB.getVmwareHostURL()),\n\t\t\t\t\tSJSULAB.getVmwareLogin(), SJSULAB.getVmwarePassword(), true);\n } \n catch ( Exception e ) \n { \n \tSystem.out.println( e.toString() ) ; \n }\n\n }", "@Test(expected = java.rmi.RemoteException.class)\n\tpublic void testGetComputerSystem_2()\n\t\tthrows Exception {\n\t\tSAPHostControl_BindingStub fixture = new SAPHostControl_BindingStub(new URL(\"\"), new DeployWSServiceLocator());\n\t\tProperty[] aArguments = new Property[] {};\n\n\t\tCIMObject result = fixture.getComputerSystem(aArguments);\n\n\t\t// add additional test code here\n\t\tassertNotNull(result);\n\t}", "void link(Portal portal1, Portal portal2);", "public void markVlanHostInterface2Create() throws JNCException {\n markLeafCreate(\"vlanHostInterface2\");\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}", "@Test\n public void testRemoteGrantor() throws Exception {\n IgnoredException.addIgnoredException(\"killing members ds\");\n final CacheTransactionManager txMgr = getCache().getCacheTransactionManager();\n final String rgnName = getUniqueName();\n Region rgn = getCache().createRegion(rgnName, getRegionAttributes());\n rgn.create(\"key\", null);\n\n Invoke.invokeInEveryVM(new SerializableRunnable(\"testRemoteGrantor: initial configuration\") {\n @Override\n public void run() {\n try {\n Region rgn1 = getCache().createRegion(rgnName, getRegionAttributes());\n rgn1.put(\"key\", \"val0\");\n } catch (CacheException e) {\n Assert.fail(\"While creating region\", e);\n }\n }\n });\n\n Host host = Host.getHost(0);\n VM vm0 = host.getVM(0);\n // VM vm1 = host.getVM(1);\n // VM vm2 = host.getVM(2);\n\n vm0.invoke(new SerializableRunnable(\"testRemoteGrantor: remote grantor init\") {\n @Override\n public void run() {\n try {\n Region rgn1 = getCache().getRegion(rgnName);\n final CacheTransactionManager txMgr2 = getCache().getCacheTransactionManager();\n txMgr2.begin();\n rgn1.put(\"key\", \"val1\");\n txMgr2.commit();\n assertNotNull(TXLockService.getDTLS());\n assertTrue(TXLockService.getDTLS().isLockGrantor());\n } catch (CacheException e) {\n fail(\"While performing first transaction\");\n }\n }\n });\n\n // fix for bug 38843 causes the DTLS to be created in every TX participant\n assertNotNull(TXLockService.getDTLS());\n assertFalse(TXLockService.getDTLS().isLockGrantor());\n assertEquals(\"val1\", rgn.getEntry(\"key\").getValue());\n\n vm0.invoke(new SerializableRunnable(\"Disconnect from DS, remote grantor death\") {\n @Override\n public void run() {\n try {\n MembershipManagerHelper.crashDistributedSystem(getSystem());\n } finally {\n // Allow getCache() to re-establish a ds connection\n closeCache();\n }\n }\n });\n\n // Make this VM the remote Grantor\n txMgr.begin();\n rgn.put(\"key\", \"val2\");\n txMgr.commit();\n assertNotNull(TXLockService.getDTLS());\n assertTrue(TXLockService.getDTLS().isLockGrantor());\n\n SerializableRunnable remoteComm =\n new SerializableRunnable(\"testRemoteGrantor: remote grantor commit\") {\n @Override\n public void run() {\n try {\n Cache c = getCache();\n CacheTransactionManager txMgr2 = c.getCacheTransactionManager();\n Region rgn1 = c.getRegion(rgnName);\n if (rgn1 == null) {\n // This block should only execute on VM0\n rgn1 = c.createRegion(rgnName, getRegionAttributes());\n }\n\n txMgr2.begin();\n rgn1.put(\"key\", \"val3\");\n txMgr2.commit();\n\n if (TXLockService.getDTLS() != null) {\n assertTrue(!TXLockService.getDTLS().isLockGrantor());\n }\n } catch (CacheException e) {\n Assert.fail(\"While creating region\", e);\n }\n }\n };\n Invoke.invokeInEveryVM(remoteComm);\n // vm1.invoke(remoteComm);\n // vm2.invoke(remoteComm);\n\n assertNotNull(TXLockService.getDTLS());\n assertTrue(TXLockService.getDTLS().isLockGrantor());\n assertEquals(\"val3\", rgn.getEntry(\"key\").getValue());\n rgn.destroyRegion();\n }", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel1 = new javax.swing.JLabel();\n hostnameTextField = new javax.swing.JTextField();\n jSeparator1 = new javax.swing.JSeparator();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n moveToConnectedMachineButton = new javax.swing.JButton();\n moveToMyMachineButton = new javax.swing.JButton();\n myMachineScrollPane = new javax.swing.JScrollPane();\n connectedMachineScrollPane = new javax.swing.JScrollPane();\n toggleConnectedButton = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jLabel1.setText(\"Machine: \");\n\n hostnameTextField.setText(\"<ip/hostname>\");\n\n jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);\n jSeparator1.setAutoscrolls(true);\n jSeparator1.setDoubleBuffered(true);\n\n jLabel2.setText(\"My machine:\");\n\n jLabel3.setText(\"Connected machine:\");\n\n moveToConnectedMachineButton.setText(\"----->\");\n\n moveToMyMachineButton.setText(\"<-----\");\n\n myMachineScrollPane.setDoubleBuffered(true);\n\n toggleConnectedButton.setText(\"Connect\");\n toggleConnectedButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n toggleConnectedButtonActionPerformed(evt);\n }\n });\n\n org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(layout.createSequentialGroup()\n .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(layout.createSequentialGroup()\n .add(76, 76, 76)\n .add(moveToConnectedMachineButton)\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)\n .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(layout.createSequentialGroup()\n .add(75, 75, 75)\n .add(jSeparator1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))\n .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 58, Short.MAX_VALUE)\n .add(moveToMyMachineButton))))\n .add(layout.createSequentialGroup()\n .add(103, 103, 103)\n .add(jLabel1)\n .add(18, 18, 18)\n .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(toggleConnectedButton)\n .add(hostnameTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 216, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))\n .add(95, 95, 95))\n .add(layout.createSequentialGroup()\n .add(67, 67, 67)\n .add(jLabel2)\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 144, Short.MAX_VALUE)\n .add(jLabel3)\n .add(74, 74, 74))\n .add(layout.createSequentialGroup()\n .addContainerGap()\n .add(myMachineScrollPane, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 223, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)\n .add(connectedMachineScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 219, Short.MAX_VALUE)\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(layout.createSequentialGroup()\n .addContainerGap()\n .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)\n .add(hostnameTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\n .add(jLabel1))\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)\n .add(toggleConnectedButton)\n .add(37, 37, 37)\n .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)\n .add(jLabel2)\n .add(jLabel3))\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)\n .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)\n .add(layout.createSequentialGroup()\n .add(connectedMachineScrollPane, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 265, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\n .add(18, 18, 18)\n .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)\n .add(moveToMyMachineButton)\n .add(moveToConnectedMachineButton)))\n .add(layout.createSequentialGroup()\n .add(myMachineScrollPane, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 265, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)\n .add(jSeparator1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n pack();\n }", "public void markVlanHostInterface2Merge() throws JNCException {\n markLeafMerge(\"vlanHostInterface2\");\n }", "private void createVHost(RoutingContext routingContext) {\n LOGGER.debug(\"Info: createVHost method started;\");\n JsonObject requestJson = routingContext.getBodyAsJson();\n HttpServerRequest request = routingContext.request();\n HttpServerResponse response = routingContext.response();\n String instanceID = request.getHeader(HEADER_HOST);\n JsonObject authenticationInfo = new JsonObject();\n authenticationInfo.put(API_ENDPOINT, \"/management/vhost\");\n requestJson.put(JSON_INSTANCEID, instanceID);\n if (request.headers().contains(HEADER_TOKEN)) {\n authenticationInfo.put(HEADER_TOKEN, request.getHeader(HEADER_TOKEN));\n authenticator.tokenInterospect(requestJson.copy(), authenticationInfo, authHandler -> {\n if (authHandler.succeeded()) {\n Future<Boolean> validNameResult = isValidName(requestJson.copy().getString(JSON_VHOST));\n validNameResult.onComplete(validNameHandler -> {\n if (validNameHandler.succeeded()) {\n Future<JsonObject> brokerResult = managementApi.createVHost(requestJson, databroker);\n brokerResult.onComplete(brokerResultHandler -> {\n if (brokerResultHandler.succeeded()) {\n LOGGER.info(\"Success: Creating vhost\");\n handleSuccessResponse(response, ResponseType.Created.getCode(),\n brokerResultHandler.result().toString());\n } else if (brokerResultHandler.failed()) {\n LOGGER.error(\"Fail: Bad request;\" + brokerResultHandler.cause().getMessage());\n processBackendResponse(response, brokerResultHandler.cause().getMessage());\n }\n });\n } else {\n LOGGER.error(\"Fail: Unauthorized;\" + authHandler.cause().getMessage());\n handleResponse(response, ResponseType.BadRequestData, MSG_INVALID_EXCHANGE_NAME);\n }\n });\n } else if (authHandler.failed()) {\n LOGGER.error(\"Fail: Unauthorized\");\n handleResponse(response, ResponseType.AuthenticationFailure);\n }\n });\n } else {\n LOGGER.error(\"Fail: Unauthorized\");\n handleResponse(response, ResponseType.AuthenticationFailure);\n }\n\n }", "private void connectToVirtualSites(int currentSite) {\n // if top row, connect to virtual top site\n if (currentSite < gridSize) {\n uf.union(currentSite, topVirtualSite);\n }\n\n // same with bottom row\n if (currentSite >= totalSites - gridSize) {\n uf.union(currentSite, bottomVirtualSite);\n }\n }", "@Test\n public void testParallelPropagationLoopBack3Sites() {\n // Create locators\n Integer lnPort = vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1));\n Integer nyPort = vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(2, lnPort));\n Integer tkPort = vm2.invoke(() -> WANTestBase.createFirstRemoteLocator(3, lnPort));\n\n // create cache and receivers on all the 3 sites\n createCacheInVMs(lnPort, vm3, vm6);\n createReceiverInVMs(vm3, vm6);\n createCacheInVMs(nyPort, vm4, vm7);\n createReceiverInVMs(vm4, vm7);\n createCacheInVMs(tkPort, vm5);\n createReceiverInVMs(vm5);\n\n\n // create senders on all the 3 sites\n vm3.invoke(() -> WANTestBase.createSender(\"ln\", 2, true, 100, 10, false, false, null, true));\n vm6.invoke(() -> WANTestBase.createSender(\"ln\", 2, true, 100, 10, false, false, null, true));\n\n vm4.invoke(() -> WANTestBase.createSender(\"ny\", 3, true, 100, 10, false, false, null, true));\n vm7.invoke(() -> WANTestBase.createSender(\"ny\", 3, true, 100, 10, false, false, null, true));\n\n vm5.invoke(() -> WANTestBase.createSender(\"tk\", 1, true, 100, 10, false, false, null, true));\n\n // create PR on the 3 sites\n vm3.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ln\", 0, 100,\n isOffHeap()));\n vm6.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ln\", 0, 100,\n isOffHeap()));\n\n vm4.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ny\", 0, 100,\n isOffHeap()));\n vm7.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ny\", 0, 100,\n isOffHeap()));\n\n vm5.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"tk\", 0, 100,\n isOffHeap()));\n\n // start senders on all the sites\n startSenderInVMs(\"ln\", vm3, vm6);\n\n startSenderInVMs(\"ny\", vm4, vm7);\n\n vm5.invoke(() -> WANTestBase.startSender(\"tk\"));\n\n // pause senders on site1 and site3. Site2 has the sender running to pass along events\n vm3.invoke(() -> WANTestBase.pauseSender(\"ln\"));\n vm6.invoke(() -> WANTestBase.pauseSender(\"ln\"));\n\n vm5.invoke(() -> WANTestBase.pauseSender(\"tk\"));\n\n // do puts on site1\n vm3.invoke(() -> WANTestBase.doPuts(getTestMethodName() + \"_PR\", 100));\n\n // do more puts on site3\n vm5.invoke(() -> WANTestBase.doPutsFrom(getTestMethodName() + \"_PR\", 100, 200));\n\n // verify queue size on site1 and site3\n vm3.invoke(() -> WANTestBase.verifyQueueSize(\"ln\", 100));\n vm5.invoke(() -> WANTestBase.verifyQueueSize(\"tk\", 100));\n\n // resume sender on site1 so that events reach site2 and from there to site3\n vm3.invoke(() -> WANTestBase.resumeSender(\"ln\"));\n vm6.invoke(() -> WANTestBase.resumeSender(\"ln\"));\n vm6.invoke(() -> waitForSenderRunningState(\"ln\"));\n vm3.invoke(() -> waitForSenderRunningState(\"ln\"));\n\n // validate region size on site2 (should have 100) and site3 (should have 200)\n vm4.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 100));\n vm5.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 200));\n\n // verify queue size remains same on site3 which means event loopback did not happen\n // this means events coming from site1 are not enqueued back into the sender\n vm5.invoke(() -> WANTestBase.verifyQueueSize(\"tk\", 100));\n\n // resume sender on site3\n vm5.invoke(() -> WANTestBase.resumeSender(\"tk\"));\n vm5.invoke(() -> waitForSenderRunningState(\"tk\"));\n\n // validate region size\n vm3.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 200));\n vm4.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 200));\n vm5.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 200));\n }", "public void c2pStart();", "@Override\n @BeforeMethod(alwaysRun=true)\n public boolean testSetUp()\n throws Exception\n {\n sessionManager = new SessionManager(connectAnchor);\n boolean status = false;\n log.info(\"Test setup Begin:\");\n HashMap<ManagedObjectReference, HostSystemInformation> hostsMap = null;\n Set<ManagedObjectReference> allHosts = null;\n Iterator<ManagedObjectReference> it = null;\n String[] pnicIds = null;\n\n this.ivm = new VirtualMachine(connectAnchor);\n this.iDVS = new DistributedVirtualSwitchHelper(connectAnchor);\n this.iDVPG = new DistributedVirtualPortgroup(connectAnchor);\n this.ihs = new HostSystem(connectAnchor);\n this.ins = new NetworkSystem(connectAnchor);\n hostsMap = this.ihs.getAllHosts(VersionConstants.ESX4x, HostSystemConnectionState.CONNECTED);\n if (hostsMap != null) {\n\n allHosts = hostsMap.keySet();\n if (allHosts != null && allHosts.size() > 0) {\n it = allHosts.iterator();\n while (it.hasNext()) {\n ManagedObjectReference tempMor = it.next();\n if (tempMor != null) {\n if (this.ins.getPNicIds(tempMor) != null) {\n this.hostMor = tempMor;\n break;\n }\n }\n }\n if (this.hostMor != null) {\n hostVersion = this.ihs.getHostProductIdVersion(this.hostMor);\n hostConnectSpec = this.ihs.getHostConnectSpec(this.hostMor);\n log.info(\"Found a host with free pnics in the inventory\");\n this.nsMor = this.ins.getNetworkSystem(this.hostMor);\n if (this.nsMor != null) {\n pnicIds = this.ins.getPNicIds(this.hostMor);\n if (pnicIds != null) {\n status = true;\n } else {\n log.error(\"There are no free pnics on the host\");\n }\n } else {\n log.error(\"The network system MOR is null\");\n }\n } else {\n log.error(\"There are no free pnics on any of the host in \"\n + \"the inventory\");\n }\n } else {\n log.error(\"There are no hosts in the VC inventory\");\n }\n } else {\n log.error(\"The host map is null\");\n }\n\n assertTrue(status, \"Cleanup failed\");\n assertTrue(status, \"Setup failed\");\n return status;\n }", "private static Datacenter Create_Datacenter(String name){\n\t\t// creating list of host machine \n\t\tList<Host> hostList = new ArrayList<Host>();\n\t\t// creating list of CPU for each host machine, In our simulation with choose 1 core per machine \n\t\tList<Pe> peList1 = new ArrayList<Pe>();\n\t\tint mips = 1000; // computing power of each core\n\t\t// add 1 core to each host machine \n\t\tfor (int i =0; i < VM_number; i ++ ) {\n\t\tpeList1.add(new Pe(i, new PeProvisionerSimple(mips)));\n\t\t}\n\t\t// configuring host\n\t\tint hostId=0;\n\t\tint ram = 56320; //host memory 40 GB\n\t\tlong storage = 10240000; //host storage 10000 GB\n\t\tint bw = 102400; // bandwidth 100 Gbps\n\t\t// create first host machine with 4 cores \n\t\thostList.add(\n \t\t\tnew Host(\n \t\t\t\thostId,\n \t\t\t\tnew RamProvisionerSimple(ram),\n \t\t\t\tnew BwProvisionerSimple(bw),\n \t\t\t\tstorage,\n \t\t\t\tpeList1,\n \t\t\t\tnew VmSchedulerTimeShared(peList1)\n \t\t\t)\n \t\t);\n\t\t// create another host machine with 1 cores\n\t\tList<Pe> peList2 = new ArrayList<Pe>();\n\t\t// add 1 core to each host machine \n\t\tfor (int i =0; i < VM_number; i ++ ) {\n\t\t\tpeList2.add(new Pe(i, new PeProvisionerSimple(mips)));\n\t\t\t}\n\t\thostId++;\n\n\t\thostList.add(\n \t\t\tnew Host(\n \t\t\t\thostId,\n \t\t\t\tnew RamProvisionerSimple(ram),\n \t\t\t\tnew BwProvisionerSimple(bw),\n \t\t\t\tstorage,\n \t\t\t\tpeList2,\n \t\t\t\tnew VmSchedulerTimeShared(peList2)\n \t\t\t)\n \t\t);\n\t\t\n\t // configuring datacenter \n\t\tString arch = \"x86\"; // system architecture\n\t\tString os = \"Linux\"; // operating system\n\t\tString vmm = \"Xen\";\n\t\tdouble time_zone = 10.0; // time zone this resource located\n\t\tdouble cost = 3.0; // the cost of using processing in this resource\n\t\tdouble costPerMem = 0.05;\t\t// the cost of using memory in this resource\n\t\tdouble costPerStorage = 0.001;\t// the cost of using storage in this resource\n\t\tdouble costPerBw = 0.0;\t\t\t// the cost of using bw in this resource\n\t\tLinkedList<Storage> storageList = new LinkedList<Storage>();\n\t\tDatacenterCharacteristics characteristics = new DatacenterCharacteristics(\n arch, os, vmm, hostList, time_zone, cost, costPerMem, costPerStorage, costPerBw);\n\n\t\t// creating data center \n\t\tDatacenter datacenter = null;\n\t\ttry {\n\t\t\tdatacenter = new Datacenter(name, characteristics, new VmAllocationPolicySimple(hostList), storageList, 0);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn datacenter;\n\t\t\n\t}", "private void connectWithVirtualSites(int row, int col) {\n if (row == 1) {\n UF.union(0, getIndex(row, col));\n } else {\n UF.union(getSize() * getSize() + 1, getIndex(row, col));\n }\n }", "void addHost(Service newHost);", "@Override\n\t\t\t\t\tpublic void onBesTVServicesConnected(BesTVServicesMgr mgr) {\n\t\t\t\t\t\tTimeUseDebugUtils.timeUsageDebug(TAG+\",enter onBesTVServicesConnected\");\n\t\t\t\t\t\tmOttMgr = mgr;\n\t\t\t\t\t\tmSysConfig = mOttMgr.getConfigService().getSysConfig();\n\t\t\t\t\t\tmLocalConfig = mOttMgr.getConfigService().getLocalConfig();\n\t\t\t\t\t\ttry{\n\t\t\t\t\t\tTimeUseDebugUtils.timeUsageDebug(TAG+\",start getModule url\");\n\t\t\t\t\t\tIOTVServicesUrl = mOttMgr.getModuleService().getModuleService(ModuleServiceMgr.MODULE_IOTV_LIVE).getServiceAddress();\n\t\t\t\t\t\tJingXuanServicesUrl = mOttMgr.getModuleService().getModuleService(ModuleServiceMgr.MODULE_JINGXUAN).getServiceAddress();\n\t\t\t\t\t\t}catch(Exception e){\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tTimeUseDebugUtils.timeUsageDebug(TAG+\",end getModule url\");\n\t\t\t\t\t\tsetUserProfile(mgr.getUserService().getUserProfile());\n\t\t\t\t\t\tinvokeListener();\n\t\t\t\t\t\t\n\t\t\t\t\t\tmTargetOem = getTargetOEM();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (null != mLocalConfig) {\n\t\t\t\t\t\t\tisInside = (Define.OTT_MODE_INSIDE_LITE == mLocalConfig.getOttMode());\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "@Test(groups = {NETWORK_INTEGRATION_TESTS})\n public void getPrivateNetworkIPsByVirtualDatacenterOrderByVirtualMachine()\n {\n RemoteService rs = remoteServiceGenerator.createInstance(RemoteServiceType.DHCP_SERVICE);\n VirtualDatacenter vdc = vdcGenerator.createInstance(rs.getDatacenter());\n setup(vdc.getDatacenter(), rs, vdc.getEnterprise(), vdc.getNetwork(), vdc);\n VLANNetwork vlan = vlanGenerator.createInstance(vdc.getNetwork(), rs, \"255.255.255.0\");\n setup(vlan.getConfiguration(), vlan);\n\n IPAddress ip = IPAddress.newIPAddress(vlan.getConfiguration().getAddress()).nextIPAddress();\n IPAddress lastIP =\n IPNetworkRang.lastIPAddressWithNumNodes(\n IPAddress.newIPAddress(vlan.getConfiguration().getAddress()),\n IPNetworkRang.masktoNumberOfNodes(vlan.getConfiguration().getMask()));\n\n persistIP(ip, lastIP, vdc, vlan);\n\n String validURI = resolveVirtualDatacenterActionGetIPsURI(vdc.getId());\n validURI = validURI + \"?by=virtualmachine\";\n\n ClientResponse response =\n get(validURI, SYSADMIN, SYSADMIN, IpsPoolManagementDto.MEDIA_TYPE);\n assertEquals(response.getStatusCode(), Status.OK.getStatusCode());\n }", "public void addVlanHostInterface2() throws JNCException {\n setLeafValue(Routing.NAMESPACE,\n \"vlan-host-interface2\",\n null,\n childrenNames());\n }", "@Host(\"{$host}\")\n @ServiceInterface(name = \"ComputeManagementCli\")\n private interface VirtualMachineScaleSetVMsService {\n @Headers({\"Accept: application/json;q=0.9\", \"Content-Type: application/json\"})\n @Post(\n \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute\"\n + \"/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimage\")\n @ExpectedResponses({200, 202})\n @UnexpectedResponseExceptionType(ManagementException.class)\n Mono<Response<Flux<ByteBuffer>>> reimage(\n @HostParam(\"$host\") String endpoint,\n @PathParam(\"resourceGroupName\") String resourceGroupName,\n @PathParam(\"vmScaleSetName\") String vmScaleSetName,\n @PathParam(\"instanceId\") String instanceId,\n @QueryParam(\"api-version\") String apiVersion,\n @PathParam(\"subscriptionId\") String subscriptionId,\n @BodyParam(\"application/json\") VirtualMachineScaleSetVMReimageParameters vmScaleSetVMReimageInput,\n Context context);\n\n @Headers({\"Accept: application/json;q=0.9\", \"Content-Type: application/json\"})\n @Post(\n \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute\"\n + \"/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimageall\")\n @ExpectedResponses({200, 202})\n @UnexpectedResponseExceptionType(ManagementException.class)\n Mono<Response<Flux<ByteBuffer>>> reimageAll(\n @HostParam(\"$host\") String endpoint,\n @PathParam(\"resourceGroupName\") String resourceGroupName,\n @PathParam(\"vmScaleSetName\") String vmScaleSetName,\n @PathParam(\"instanceId\") String instanceId,\n @QueryParam(\"api-version\") String apiVersion,\n @PathParam(\"subscriptionId\") String subscriptionId,\n Context context);\n\n @Headers({\"Accept: application/json;q=0.9\", \"Content-Type: application/json\"})\n @Post(\n \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute\"\n + \"/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate\")\n @ExpectedResponses({200, 202})\n @UnexpectedResponseExceptionType(ManagementException.class)\n Mono<Response<Flux<ByteBuffer>>> deallocate(\n @HostParam(\"$host\") String endpoint,\n @PathParam(\"resourceGroupName\") String resourceGroupName,\n @PathParam(\"vmScaleSetName\") String vmScaleSetName,\n @PathParam(\"instanceId\") String instanceId,\n @QueryParam(\"api-version\") String apiVersion,\n @PathParam(\"subscriptionId\") String subscriptionId,\n Context context);\n\n @Headers({\"Content-Type: application/json\"})\n @Put(\n \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute\"\n + \"/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}\")\n @ExpectedResponses({200, 202})\n @UnexpectedResponseExceptionType(ManagementException.class)\n Mono<Response<Flux<ByteBuffer>>> update(\n @HostParam(\"$host\") String endpoint,\n @PathParam(\"resourceGroupName\") String resourceGroupName,\n @PathParam(\"vmScaleSetName\") String vmScaleSetName,\n @PathParam(\"instanceId\") String instanceId,\n @QueryParam(\"api-version\") String apiVersion,\n @PathParam(\"subscriptionId\") String subscriptionId,\n @BodyParam(\"application/json\") VirtualMachineScaleSetVMInner parameters,\n @HeaderParam(\"Accept\") String accept,\n Context context);\n\n @Headers({\"Accept: application/json;q=0.9\", \"Content-Type: application/json\"})\n @Delete(\n \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute\"\n + \"/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}\")\n @ExpectedResponses({200, 202, 204})\n @UnexpectedResponseExceptionType(ManagementException.class)\n Mono<Response<Flux<ByteBuffer>>> delete(\n @HostParam(\"$host\") String endpoint,\n @PathParam(\"resourceGroupName\") String resourceGroupName,\n @PathParam(\"vmScaleSetName\") String vmScaleSetName,\n @PathParam(\"instanceId\") String instanceId,\n @QueryParam(\"api-version\") String apiVersion,\n @PathParam(\"subscriptionId\") String subscriptionId,\n Context context);\n\n @Headers({\"Content-Type: application/json\"})\n @Get(\n \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute\"\n + \"/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}\")\n @ExpectedResponses({200})\n @UnexpectedResponseExceptionType(ManagementException.class)\n Mono<Response<VirtualMachineScaleSetVMInner>> get(\n @HostParam(\"$host\") String endpoint,\n @PathParam(\"resourceGroupName\") String resourceGroupName,\n @PathParam(\"vmScaleSetName\") String vmScaleSetName,\n @PathParam(\"instanceId\") String instanceId,\n @QueryParam(\"$expand\") InstanceViewTypes expand,\n @QueryParam(\"api-version\") String apiVersion,\n @PathParam(\"subscriptionId\") String subscriptionId,\n @HeaderParam(\"Accept\") String accept,\n Context context);\n\n @Headers({\"Content-Type: application/json\"})\n @Get(\n \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute\"\n + \"/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/instanceView\")\n @ExpectedResponses({200})\n @UnexpectedResponseExceptionType(ManagementException.class)\n Mono<Response<VirtualMachineScaleSetVMInstanceViewInner>> getInstanceView(\n @HostParam(\"$host\") String endpoint,\n @PathParam(\"resourceGroupName\") String resourceGroupName,\n @PathParam(\"vmScaleSetName\") String vmScaleSetName,\n @PathParam(\"instanceId\") String instanceId,\n @QueryParam(\"api-version\") String apiVersion,\n @PathParam(\"subscriptionId\") String subscriptionId,\n @HeaderParam(\"Accept\") String accept,\n Context context);\n\n @Headers({\"Content-Type: application/json\"})\n @Get(\n \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute\"\n + \"/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines\")\n @ExpectedResponses({200})\n @UnexpectedResponseExceptionType(ManagementException.class)\n Mono<Response<VirtualMachineScaleSetVMListResult>> list(\n @HostParam(\"$host\") String endpoint,\n @PathParam(\"resourceGroupName\") String resourceGroupName,\n @PathParam(\"virtualMachineScaleSetName\") String virtualMachineScaleSetName,\n @QueryParam(\"$filter\") String filter,\n @QueryParam(\"$select\") String select,\n @QueryParam(\"$expand\") String expand,\n @QueryParam(\"api-version\") String apiVersion,\n @PathParam(\"subscriptionId\") String subscriptionId,\n @HeaderParam(\"Accept\") String accept,\n Context context);\n\n @Headers({\"Accept: application/json;q=0.9\", \"Content-Type: application/json\"})\n @Post(\n \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute\"\n + \"/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff\")\n @ExpectedResponses({200, 202})\n @UnexpectedResponseExceptionType(ManagementException.class)\n Mono<Response<Flux<ByteBuffer>>> powerOff(\n @HostParam(\"$host\") String endpoint,\n @PathParam(\"resourceGroupName\") String resourceGroupName,\n @PathParam(\"vmScaleSetName\") String vmScaleSetName,\n @PathParam(\"instanceId\") String instanceId,\n @QueryParam(\"skipShutdown\") Boolean skipShutdown,\n @QueryParam(\"api-version\") String apiVersion,\n @PathParam(\"subscriptionId\") String subscriptionId,\n Context context);\n\n @Headers({\"Accept: application/json;q=0.9\", \"Content-Type: application/json\"})\n @Post(\n \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute\"\n + \"/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart\")\n @ExpectedResponses({200, 202})\n @UnexpectedResponseExceptionType(ManagementException.class)\n Mono<Response<Flux<ByteBuffer>>> restart(\n @HostParam(\"$host\") String endpoint,\n @PathParam(\"resourceGroupName\") String resourceGroupName,\n @PathParam(\"vmScaleSetName\") String vmScaleSetName,\n @PathParam(\"instanceId\") String instanceId,\n @QueryParam(\"api-version\") String apiVersion,\n @PathParam(\"subscriptionId\") String subscriptionId,\n Context context);\n\n @Headers({\"Accept: application/json;q=0.9\", \"Content-Type: application/json\"})\n @Post(\n \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute\"\n + \"/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start\")\n @ExpectedResponses({200, 202})\n @UnexpectedResponseExceptionType(ManagementException.class)\n Mono<Response<Flux<ByteBuffer>>> start(\n @HostParam(\"$host\") String endpoint,\n @PathParam(\"resourceGroupName\") String resourceGroupName,\n @PathParam(\"vmScaleSetName\") String vmScaleSetName,\n @PathParam(\"instanceId\") String instanceId,\n @QueryParam(\"api-version\") String apiVersion,\n @PathParam(\"subscriptionId\") String subscriptionId,\n Context context);\n\n @Headers({\"Accept: application/json;q=0.9\", \"Content-Type: application/json\"})\n @Post(\n \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute\"\n + \"/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/redeploy\")\n @ExpectedResponses({200, 202})\n @UnexpectedResponseExceptionType(ManagementException.class)\n Mono<Response<Flux<ByteBuffer>>> redeploy(\n @HostParam(\"$host\") String endpoint,\n @PathParam(\"resourceGroupName\") String resourceGroupName,\n @PathParam(\"vmScaleSetName\") String vmScaleSetName,\n @PathParam(\"instanceId\") String instanceId,\n @QueryParam(\"api-version\") String apiVersion,\n @PathParam(\"subscriptionId\") String subscriptionId,\n Context context);\n\n @Headers({\"Content-Type: application/json\"})\n @Post(\n \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute\"\n + \"/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/retrieveBootDiagnosticsData\")\n @ExpectedResponses({200})\n @UnexpectedResponseExceptionType(ApiErrorException.class)\n Mono<Response<RetrieveBootDiagnosticsDataResultInner>> retrieveBootDiagnosticsData(\n @HostParam(\"$host\") String endpoint,\n @PathParam(\"resourceGroupName\") String resourceGroupName,\n @PathParam(\"vmScaleSetName\") String vmScaleSetName,\n @PathParam(\"instanceId\") String instanceId,\n @QueryParam(\"sasUriExpirationTimeInMinutes\") Integer sasUriExpirationTimeInMinutes,\n @QueryParam(\"api-version\") String apiVersion,\n @PathParam(\"subscriptionId\") String subscriptionId,\n @HeaderParam(\"Accept\") String accept,\n Context context);\n\n @Headers({\"Accept: application/json;q=0.9\", \"Content-Type: application/json\"})\n @Post(\n \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute\"\n + \"/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/performMaintenance\")\n @ExpectedResponses({200, 202})\n @UnexpectedResponseExceptionType(ManagementException.class)\n Mono<Response<Flux<ByteBuffer>>> performMaintenance(\n @HostParam(\"$host\") String endpoint,\n @PathParam(\"resourceGroupName\") String resourceGroupName,\n @PathParam(\"vmScaleSetName\") String vmScaleSetName,\n @PathParam(\"instanceId\") String instanceId,\n @QueryParam(\"api-version\") String apiVersion,\n @PathParam(\"subscriptionId\") String subscriptionId,\n Context context);\n\n @Headers({\"Accept: application/json;q=0.9\", \"Content-Type: application/json\"})\n @Post(\n \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute\"\n + \"/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/simulateEviction\")\n @ExpectedResponses({204})\n @UnexpectedResponseExceptionType(ManagementException.class)\n Mono<Response<Void>> simulateEviction(\n @HostParam(\"$host\") String endpoint,\n @PathParam(\"resourceGroupName\") String resourceGroupName,\n @PathParam(\"vmScaleSetName\") String vmScaleSetName,\n @PathParam(\"instanceId\") String instanceId,\n @QueryParam(\"api-version\") String apiVersion,\n @PathParam(\"subscriptionId\") String subscriptionId,\n Context context);\n\n @Headers({\"Content-Type: application/json\"})\n @Post(\n \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute\"\n + \"/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/runCommand\")\n @ExpectedResponses({200, 202})\n @UnexpectedResponseExceptionType(ManagementException.class)\n Mono<Response<Flux<ByteBuffer>>> runCommand(\n @HostParam(\"$host\") String endpoint,\n @PathParam(\"resourceGroupName\") String resourceGroupName,\n @PathParam(\"vmScaleSetName\") String vmScaleSetName,\n @PathParam(\"instanceId\") String instanceId,\n @QueryParam(\"api-version\") String apiVersion,\n @PathParam(\"subscriptionId\") String subscriptionId,\n @BodyParam(\"application/json\") RunCommandInput parameters,\n @HeaderParam(\"Accept\") String accept,\n Context context);\n\n @Headers({\"Content-Type: application/json\"})\n @Get(\"{nextLink}\")\n @ExpectedResponses({200})\n @UnexpectedResponseExceptionType(ManagementException.class)\n Mono<Response<VirtualMachineScaleSetVMListResult>> listNext(\n @PathParam(value = \"nextLink\", encoded = true) String nextLink,\n @HostParam(\"$host\") String endpoint,\n @HeaderParam(\"Accept\") String accept,\n Context context);\n }", "public void testGenerateBrokerVirtualhostAndConnectionStatistics() throws Exception\n {\n sendUsing(_test, 5, 200);\n Thread.sleep(1000);\n \n for (ManagedConnection mc : _jmxUtils.getManagedConnections(\"test\"))\n {\n assertEquals(\"Incorrect connection total\", 5, mc.getTotalMessagesReceived());\n assertEquals(\"Incorrect connection data\", 1000, mc.getTotalDataReceived());\n\t assertTrue(\"Connection statistics should be enabled\", mc.isStatisticsEnabled());\n }\n \n ManagedBroker vhost = _jmxUtils.getManagedBroker(\"test\");\n assertEquals(\"Incorrect vhost data\", 5, vhost.getTotalMessagesReceived());\n assertEquals(\"Incorrect vhost data\", 1000, vhost.getTotalDataReceived());\n assertTrue(\"Vhost statistics should be enabled\", vhost.isStatisticsEnabled());\n\n assertEquals(\"Incorrect server total messages\", 5, _jmxUtils.getServerInformation().getTotalMessagesReceived());\n assertEquals(\"Incorrect server total data\", 1000, _jmxUtils.getServerInformation().getTotalDataReceived());\n assertTrue(\"Server statistics should be enabled\", _jmxUtils.getServerInformation().isStatisticsEnabled());\n }", "public void connectToServerComp() {\n\n\t\ttry \n\t\t{\n\t\t\tSocket socket = new Socket(host, 8001);\n\t\t\tfromServer = new DataInputStream(socket.getInputStream());\n\t\t\ttoServer = new DataOutputStream(socket.getOutputStream());\n\n\t\t\ttoServer.writeInt(vsCOMPUTER);\n\n\t\t} catch (IOException ex)\n\t\t{\n\t\t\tex.printStackTrace();\n\t\t}\n\n\t\tThread thread = new Thread(new clientHandlingComputer(fromServer, toServer));\n\t\tthread.start();\n\n\t}", "public VM(String name, String os, List<String> ipAddresses) {//passed from gui form\r\n\r\n this.name = name;\r\n this.os = os;\r\n\r\n int ethNumber = 0;\r\n for (String ipAddress : ipAddresses) { //for each valid ip address submitted in the form, add an interface\r\n String intrfcLabel = \"eth\" + ethNumber;\r\n this.intrfces.add(new VMinterface(intrfcLabel, ipAddress));\r\n ethNumber++;\r\n }\r\n\r\n //same version and src set for every vm: dependent on OS\r\n switch (os) {\r\n case \"WINDOWS\":\r\n this.setOs(\"WINDOWS\");\r\n break;\r\n case \"LINUX\":\r\n this.setOs(\"LINUX\");\r\n break;\r\n }\r\n if (this.getOs() == \"WINDOWS\") {\r\n this.setVer(\"7.0\");\r\n this.setSrc(\"/srv/VMLibrary/win7\");\r\n } else {\r\n this.setVer(\"7.3\");\r\n this.setSrc(\"/srv/VMLibrary/JeOS\");\r\n }\r\n\r\n\r\n }", "Server remote(Server bootstrap, Database<S> vat);", "public static void twoClientSetupProcesses() {\n\n\tList<String> aClientTags=TagsFactory.getAssignmentTags().getTwoClientClientTags();\n\tList<String> aServerTags=TagsFactory.getAssignmentTags().getTwoClientServerTags();\n\n\ttwoClientSetupProcesses(aClientTags, aServerTags);\n//\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setProcessTeams(Arrays.asList(\"RegistryBasedDistributedProgram\"));\n//\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setTerminatingProcesses(\"RegistryBasedDistributedProgram\", Arrays.asList(\"Client_0\", \"Client_1\"));\n//\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setProcesses(\"RegistryBasedDistributedProgram\", Arrays.asList(\"Registry\", \"Server\", \"Client_0\", \"Client_1\"));\n//\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setEntryTags(\"Registry\", Arrays.asList(\"Registry\"));\n//\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setEntryTags(\"Server\", aServerTags);\n//\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setEntryTags(\"Client_0\", aClientTags);\n//\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setEntryTags(\"Client_1\", aClientTags);\n//\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setArgs(\"Registry\", FlexibleStaticArgumentsTestCase.TEST_REGISTRY_ARGS);\n//\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setArgs(\"Server\", FlexibleStaticArgumentsTestCase.TEST_SERVER_ARGS);\n//\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setArgs(\"Client_0\", FlexibleStaticArgumentsTestCase.TEST_CLIENT_0_ARGS);\n//\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setArgs(\"Client_1\", FlexibleStaticArgumentsTestCase.TEST_CLIENT_1_ARGS);\n//\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setSleepTime(\"Registry\", 500);\n//\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setSleepTime(\"Server\", 2000);\n//\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setSleepTime(\"Client_0\", 5000);\n//\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setSleepTime(\"Client_1\", 5000);\n//\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().getProcessTeams().forEach(team -> System.out.println(\"### \" + team));\n}", "boolean updateBase(TRemoteHostOperateVo source, TRemoteHostOperateVo target);", "@SuppressWarnings(\"deprecation\")\n\tpublic boolean migrateVM(String newhost, ServiceInstance sInstance, String vmName) throws Exception{\n\t\tString vmname = vmName;\n\t\tString newHostName = newhost;\n\t\tFolder rootFolder = sInstance.getRootFolder();\n\t\tVirtualMachine vm = (VirtualMachine) new InventoryNavigator(\n\t\t\t\t\t\t\t\t\t\t\t\t\trootFolder).searchManagedEntity(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"VirtualMachine\", vmname);\n\t\t\n\t\tHostSystem newHost = (HostSystem) new InventoryNavigator(\n\t\t\t\t\t\t\t\t\t\t\trootFolder).searchManagedEntity(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"HostSystem\", newHostName);\n\t\t\n\t\tComputeResource cr = (ComputeResource) newHost.getParent();\n\t\tString[] checks = new String[] {\"cpu\", \"software\"};\n\t\tHostVMotionCompatibility[] vmcs =\n\t\t\t\t\t\t\t\t\t\t\tsInstance.queryVMotionCompatibility(vm, new HostSystem[] \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{newHost},checks );\n\n\t\tString[] comps = vmcs[0].getCompatibility();\n\t\tif(checks.length != comps.length)\n\t\t{\n\t\t\tSystem.out.println(\"CPU/software NOT compatible. Exit.\");\n\t\t\tsInstance.getServerConnection().logout();\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif(vm.getSummary().runtime.powerState==vm.getSummary().runtime.powerState.poweredOn){\n\t\t\tTask task =vm.powerOffVM_Task();\n\t\t\t\tif(task.waitForTask()==Task.SUCCESS){\n\t\t\t\t\tSystem.out.println(\"PoweredOff\");\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.println(\"Error while powering off the vm.\");\n\t\t\t\t}\n\t\t}\n\t\t\n\t\tTask task1 = vm.migrateVM_Task(cr.getResourcePool(), newHost,\n\t\t\t\t\t\t\t\t\t\t\t\tVirtualMachineMovePriority.highPriority, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\tVirtualMachinePowerState.poweredOff);\n\n\t\tif(task1.waitForMe()==Task.SUCCESS)\n\t\t{\n\t\t\tSystem.out.println(\" Migrated\");\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"Migrated failed!\");\n\t\t\tTaskInfo info = task1.getTaskInfo();\n\t\t\tSystem.out.println(info.getError().getFault());\n\t\t\treturn false;\n\t\t}\n\t}", "@Test\n public void testParallelPropagationLoopBack() {\n Integer lnPort = vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1));\n Integer nyPort = vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(2, lnPort));\n\n // create receiver on site1 and site2\n createCacheInVMs(lnPort, vm2, vm4, vm5);\n vm2.invoke(WANTestBase::createReceiver);\n createCacheInVMs(nyPort, vm3, vm6, vm7);\n vm3.invoke(WANTestBase::createReceiver);\n\n // create senders on site1\n vm2.invoke(() -> WANTestBase.createSender(\"ln\", 2, true, 100, 10, false, false, null, true));\n vm4.invoke(() -> WANTestBase.createSender(\"ln\", 2, true, 100, 10, false, false, null, true));\n vm5.invoke(() -> WANTestBase.createSender(\"ln\", 2, true, 100, 10, false, false, null, true));\n\n // create senders on site2\n vm3.invoke(() -> WANTestBase.createSender(\"ny\", 1, true, 100, 10, false, false, null, true));\n vm6.invoke(() -> WANTestBase.createSender(\"ny\", 1, true, 100, 10, false, false, null, true));\n vm7.invoke(() -> WANTestBase.createSender(\"ny\", 1, true, 100, 10, false, false, null, true));\n\n // create PR on site1\n vm2.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ln\", 0, 100,\n isOffHeap()));\n vm4.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ln\", 0, 100,\n isOffHeap()));\n vm5.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ln\", 0, 100,\n isOffHeap()));\n\n // create PR on site2\n vm3.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ny\", 0, 100,\n isOffHeap()));\n vm6.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ny\", 0, 100,\n isOffHeap()));\n vm7.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ny\", 0, 100,\n isOffHeap()));\n\n // start sender on site1\n startSenderInVMs(\"ln\", vm2, vm4, vm5);\n\n\n // start sender on site2\n startSenderInVMs(\"ny\", vm3, vm6, vm7);\n\n\n // pause senders on site1\n vm2.invoke(() -> WANTestBase.pauseSender(\"ln\"));\n vm4.invoke(() -> WANTestBase.pauseSender(\"ln\"));\n vm5.invoke(() -> WANTestBase.pauseSender(\"ln\"));\n\n // pause senders on site2\n vm3.invoke(() -> WANTestBase.pauseSender(\"ny\"));\n vm6.invoke(() -> WANTestBase.pauseSender(\"ny\"));\n vm7.invoke(() -> WANTestBase.pauseSender(\"ny\"));\n\n // this is required since sender pause doesn't take effect immediately\n Wait.pause(1000);\n\n // Do 100 puts on site1\n vm2.invoke(() -> WANTestBase.doPuts(getTestMethodName() + \"_PR\", 100));\n // do next 100 puts on site2\n vm3.invoke(() -> WANTestBase.doPutsFrom(getTestMethodName() + \"_PR\", 100, 200));\n // verify queue size on both sites\n vm2.invoke(() -> WANTestBase.verifyQueueSize(\"ln\", 100));\n vm4.invoke(() -> WANTestBase.verifyQueueSize(\"ln\", 100));\n vm5.invoke(() -> WANTestBase.verifyQueueSize(\"ln\", 100));\n\n vm3.invoke(() -> WANTestBase.verifyQueueSize(\"ny\", 100));\n vm6.invoke(() -> WANTestBase.verifyQueueSize(\"ny\", 100));\n vm7.invoke(() -> WANTestBase.verifyQueueSize(\"ny\", 100));\n\n // resume sender on site1\n vm2.invoke(() -> WANTestBase.resumeSender(\"ln\"));\n vm4.invoke(() -> WANTestBase.resumeSender(\"ln\"));\n vm5.invoke(() -> WANTestBase.resumeSender(\"ln\"));\n\n // validate events reached site2 from site1\n vm3.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 200));\n\n // on site2, verify queue size again\n // this ensures that loopback is not happening since the queue size is same as before\n // the event coming from site1 are not enqueued again\n vm3.invoke(() -> WANTestBase.verifyQueueSize(\"ny\", 100));\n vm6.invoke(() -> WANTestBase.verifyQueueSize(\"ny\", 100));\n vm7.invoke(() -> WANTestBase.verifyQueueSize(\"ny\", 100));\n\n // resume sender on site2\n vm3.invoke(() -> WANTestBase.resumeSender(\"ny\"));\n vm6.invoke(() -> WANTestBase.resumeSender(\"ny\"));\n vm7.invoke(() -> WANTestBase.resumeSender(\"ny\"));\n\n // validate region size on both the sites\n vm2.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 200));\n vm3.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 200));\n }", "public void setHost(Player roomHost) {\r\n this.roomHost = roomHost;\r\n }", "public MyPowerHost findHostForVm(Vm vm) {\n\t\t//找到第一个合适的host就返回\n\t\tfor (MyPowerHost host : this.<MyPowerHost> getHostList()) {\n\t\t\tif (host.isSuitableForVm(vm)) {\n\t\t\t\treturn host;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public void testMarkerCoreMonitoringOverTwoFiles() throws Exception {\r\n\t\tDeployValidatorService validator = getValidatorService();\r\n\r\n\t\tfinal Topology top1 = createTopology(\r\n\t\t\t\t\"testMarkerCoreMonitoringOverTwoFiles1\", true);\r\n\t\tfinal Topology top2 = createTopology(\r\n\t\t\t\t\"testMarkerCoreMonitoringOverTwoFiles2\", true);\r\n\t\tTopologyValidationMonitor.monitor(top1, validator, null, 0);\r\n\t\tTopologyValidationMonitor.monitor(top2, validator, null, 0);\r\n\t\tsetValidationMonitorBlocking(top1, true);\r\n\t\tsetValidationMonitorBlocking(top2, true);\r\n\r\n\t\t// unit1@top1 with no name\r\n\t\tfinal Unit unit1 = CoreFactory.eINSTANCE.createUnit();\r\n\t\ttop1.getUnits().add(unit1);\r\n\r\n\t\tassertHasDeployStatus(unit1,\r\n\t\t\t\tICoreProblemType.OBJECT_ATTRIBUTE_UNDEFINED, IStatus.ERROR);\r\n\r\n\t\t// unit2@top2 with no name\r\n\t\tfinal Unit unit2 = CoreFactory.eINSTANCE.createUnit();\r\n\t\ttop2.getUnits().add(unit2);\r\n\r\n\t\tassertHasDeployStatus(unit2,\r\n\t\t\t\tICoreProblemType.OBJECT_ATTRIBUTE_UNDEFINED, IStatus.ERROR);\r\n\r\n\t\tunit1.setName(\"unit1\");\r\n\t\tunit2.setName(\"unit2\");\r\n\r\n\t\tassertHasNoDeployStatus(unit1,\r\n\t\t\t\tICoreProblemType.OBJECT_ATTRIBUTE_UNDEFINED, IStatus.ERROR);\r\n\t\tassertHasNoDeployStatus(unit2,\r\n\t\t\t\tICoreProblemType.OBJECT_ATTRIBUTE_UNDEFINED, IStatus.ERROR);\r\n\r\n\t\tTopologyValidationMonitor.unmonitor(top1, validator);\r\n\t\tTopologyValidationMonitor.unmonitor(top2, validator);\r\n\t}", "Host getHost();", "@Remote\r\npublic interface BonLivraisonManagerRemote\r\n extends BonLivraisonManager\r\n{\r\n\r\n\r\n}", "@Override\r\n public boolean isSatisfied(Configuration cfg) {\r\n Set<Node> firstNodes = new HashSet<Node>();\r\n Set<Node> secondNodes = new HashSet<Node>();\r\n if (getFirstSet().size() == 0 || getSecondSet().size() == 0) {\r\n //FIXME debug log VJob.logger.error(this.toString() + \": Some sets of virtual machines are empty\");\r\n return false;\r\n }\r\n\r\n for (VirtualMachine vm : getFirstSet()) {\r\n if (cfg.isRunning(vm)) {\r\n firstNodes.add(cfg.getLocation(vm));\r\n }\r\n }\r\n for (VirtualMachine vm : getSecondSet()) {\r\n if (cfg.isRunning(vm)) {\r\n secondNodes.add(cfg.getLocation(vm));\r\n }\r\n }\r\n\r\n for (Node n : firstNodes) {\r\n if (secondNodes.contains(n)) {\r\n \tManagedElementList<Node> ns = new SimpleManagedElementList<Node>();\r\n ns.addAll(firstNodes);\r\n ns.retainAll(secondNodes);\r\n //FIXME debug log VJob.logger.error(this.toString() + \": Nodes host VMs of the two groups: \" + ns);\r\n return false;\r\n }\r\n }\r\n for (Node n : secondNodes) {\r\n if (firstNodes.contains(n)) {\r\n \tManagedElementList<Node> ns = new SimpleManagedElementList<Node>();\r\n ns.addAll(secondNodes);\r\n ns.retainAll(firstNodes);\r\n //FIXME debug log VJob.logger.error(this.toString() + \": Nodes host VMs of the two groups: \" + ns);\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "private static Datacenter createDatacenter(String name) {\n List<Host> hostList = new ArrayList<Host>();\r\n\r\n // 2. A Machine contains one or more PEs or CPUs/Cores.\r\n // In this example, it will have only one core.\r\n List<Pe> peList = new ArrayList<Pe>();\r\n\r\n\r\n // 3. Create PEs and add these into a list.\r\n peList.add(new Pe(0, new PeProvisionerSimple(mips+100))); // need to store Pe id and MIPS Rating\r\n\r\n // 4. Create Host with its id and list of PEs and add them to the list\r\n // of machines\r\n long storage = 1000000; // host storage\r\n\r\n\r\n for (int hostId = 0; hostId < vmNum; hostId++) {\r\n hostList.add(\r\n new Host(\r\n hostId,\r\n new RamProvisionerSimple((int)((ram*1.1)/Constants.MB)),\r\n new BwProvisionerSimple(bw+10),\r\n storage,\r\n peList,\r\n new VmSchedulerTimeShared(peList)\r\n )\r\n ); // This is our machine\r\n }\r\n\r\n\r\n // 5. Create a DatacenterCharacteristics object that stores the\r\n // properties of a data center: architecture, OS, list of\r\n // Machines, allocation policy: time- or space-shared, time zone\r\n // and its price (G$/Pe time unit).\r\n String arch = \"x86\"; // system architecture\r\n String os = \"Linux\"; // operating system\r\n String vmm = \"Xen\";\r\n double time_zone = 10.0; // time zone this resource located\r\n double cost = 3.0; // the cost of using processing in this resource\r\n double costPerMem = 0.05; // the cost of using memory in this resource\r\n double costPerStorage = 0.001; // the cost of using storage in this\r\n // resource\r\n double costPerBw = 0.0; // the cost of using bw in this resource\r\n LinkedList<Storage> storageList = new LinkedList<Storage>(); // we are not adding SAN\r\n // devices by now\r\n\r\n DatacenterCharacteristics characteristics = new DatacenterCharacteristics(\r\n arch, os, vmm, hostList, time_zone, cost, costPerMem,\r\n costPerStorage, costPerBw);\r\n\r\n // 6. Finally, we need to create a PowerDatacenter object.\r\n Datacenter datacenter = null;\r\n try {\r\n datacenter = new Datacenter(name, characteristics, new VmAllocationPolicySimple(hostList), storageList, 0);\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n\r\n return datacenter;\r\n }", "public void testGenerateBrokerAndVirtualhostStatistics() throws Exception\n {\n sendUsing(_test, 5, 200);\n Thread.sleep(1000);\n \n for (ManagedConnection mc : _jmxUtils.getManagedConnections(\"test\"))\n {\n assertEquals(\"Incorrect connection total\", 0, mc.getTotalMessagesReceived());\n assertEquals(\"Incorrect connection data\", 0, mc.getTotalDataReceived());\n\t assertFalse(\"Connection statistics should not be enabled\", mc.isStatisticsEnabled());\n }\n \n ManagedBroker vhost = _jmxUtils.getManagedBroker(\"test\");\n assertEquals(\"Incorrect vhost data\", 5, vhost.getTotalMessagesReceived());\n assertEquals(\"Incorrect vhost data\", 1000, vhost.getTotalDataReceived());\n assertTrue(\"Vhost statistics should be enabled\", vhost.isStatisticsEnabled());\n\n assertEquals(\"Incorrect server total messages\", 5, _jmxUtils.getServerInformation().getTotalMessagesReceived());\n assertEquals(\"Incorrect server total data\", 1000, _jmxUtils.getServerInformation().getTotalDataReceived());\n assertTrue(\"Server statistics should be enabled\", _jmxUtils.getServerInformation().isStatisticsEnabled());\n }", "public abstract void connectSystem();", "@Bean\n public IgniteClient igniteInstanceTWO() {\n return Ignition.startClient(new ClientConfiguration().setAddresses(\"127.0.0.1:10801\"));\n }", "public List<VirtualMachine> listRemoteVirtualMachines() {\n MachineOptions options = MachineOptions.builder().sync(true).build();\n VirtualMachinesWithNodeExtendedDto vms = context.getApi().getInfrastructureApi()\n .listVirtualMachinesByMachine(target, options);\n return wrap(context, VirtualMachine.class, vms.getCollection());\n }", "void host(String host);", "void host(String host);", "@RequestMapping(value = {\"/user/{email}/{vmname}\",\"/admin/{email}/{vmname}\"}, method = RequestMethod.GET)\n\tpublic ModelAndView viewvm(@PathVariable String email,\n\t\t\t\t\t\t@PathVariable String vmname) {\n\t\tlogger.info(\"Showing VM \", vmname);\n\t\t\n\t\t//if(user != null){\n\t\t\tvMDetails = vMDaoImpl.getVMDetails(email, vmname);\n\t\t\tVmhardware vmhardware = vmServiceImpl.getVM(vmname);\n\t\t\tSystem.out.println(\"inside vmdetails - user- vms : \");\n\t\t//}\n\t\t\tModelAndView model = new ModelAndView();\n\t\t\t//model.addObject(this.user);\n\t\t\tmodel.addObject(\"vmhardware\", vmhardware);\n\t\t\tmodel.addObject(\"vms\",vMDetails);\n\t\t\tmodel.setViewName(\"vmdetails\");\n\t\t\treturn model;\n\t}", "@Override\n public void addedDistributedSystem(int remoteDsId) {\n cache = CacheFactory.getAnyInstance();\n\n // When a site with distributed-system-id = 2 joins, create a region and a gatewaysender with\n // remoteDsId = 2\n if (remoteDsId == 2) {\n if (cache != null) {\n GatewaySender serialSender =\n cache.createGatewaySenderFactory().setManualStart(true).setPersistenceEnabled(false)\n .setDiskStoreName(\"LN_\" + remoteDsId).create(\"LN_\" + remoteDsId, remoteDsId);\n System.out.println(\"Sender Created : \" + serialSender.getId());\n\n Region region = cache.createRegionFactory()\n // .addSerialGatewaySenderId(\"LN_\" + remoteDsId)\n .create(\"MyRegion\");\n System.out.println(\"Created Region : \" + region.getName());\n\n try {\n serialSender.start();\n System.out.println(\"Sender Started: \" + serialSender.getId());\n } catch (Exception e) {\n e.printStackTrace();\n }\n } else {\n throw new CacheClosedException(\"Cache is not initialized here\");\n }\n } else { // When a site with distributed-system-id = 1 joins, create a region and a\n // gatewayReceiver with\n if (cache != null) {\n Region region = cache.createRegionFactory().create(\"MyRegion\");\n System.out.println(\"Created Region :\" + region.getName());\n\n GatewayReceiver receiver =\n cache.createGatewayReceiverFactory().setStartPort(12345).setManualStart(true).create();\n System.out.println(\"Created GatewayReceiver : \" + receiver);\n try {\n receiver.start();\n System.out.println(\"GatewayReceiver Started.\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n }", "private void connectToNewViews() {\n try {\n\n if (currentSocketTask.isDone()) {\n addNewView(currentSocketTask.get());\n\n // The previous task has been consumed, we can now submit a new task for waiting new views\n synchronized (threadPool) {\n if (!threadPool.isShutdown()) {\n currentSocketTask = threadPool.submit(socketAcceptor);\n }\n }\n }\n } catch (ExecutionException ex) {\n synchronized (threadPool) {\n if (!threadPool.isShutdown()) {\n currentSocketTask = threadPool.submit(socketAcceptor);\n }\n }\n } catch (InterruptedException ex) {\n Thread.currentThread().interrupt();\n }\n\n try {\n if (currentRMITask.isDone()) {\n addNewView(currentRMITask.get());\n\n // The previous task has been consumed, we can now submit a new task for waiting new views\n synchronized (threadPool) {\n if (!threadPool.isShutdown()) {\n currentRMITask = threadPool.submit(rmiAcceptor);\n }\n }\n }\n } catch (ExecutionException ex) {\n synchronized (threadPool) {\n if (!threadPool.isShutdown()) {\n currentRMITask = threadPool.submit(rmiAcceptor);\n }\n }\n } catch (InterruptedException ex) {\n Thread.currentThread().interrupt();\n }\n }", "@Test\n public final void testStaticTopology() {\n URL resourceUrl = this.getClass().getResource(configPath + \"/loadbalancer2.conf\");\n File configFile = new File(resourceUrl.getFile());\n\n System.setProperty(\"loadbalancer.conf.file\", configFile.getAbsolutePath());\n LoadBalancerConfiguration.getInstance();\n\n try {\n String validationError = \"Static topology validation failed\";\n\n TopologyProvider topologyProvider = LoadBalancerConfiguration.getInstance().getTopologyProvider();\n\n String clusterId = \"app-server-cluster1\";\n Cluster cluster1 = topologyProvider.getClusterByClusterId(clusterId);\n Assert.assertNotNull(String.format(\"%s, cluster not found: [cluster] %s\", validationError, clusterId), cluster1);\n Assert.assertEquals(String.format(\"%s, tenant range is not valid: [cluster] %s\", validationError, clusterId), cluster1.getTenantRange(), \"1-100\");\n\n String hostName = \"cluster1.appserver.foo.org\";\n Assert.assertTrue(String.format(\"%s, hostname not found: [hostname] %s\", validationError, hostName), hostNameExist(cluster1, hostName));\n\n hostName = \"cluster1.org\";\n Assert.assertTrue(String.format(\"%s, hostname not found: [hostname] %s\", validationError, hostName), hostNameExist(cluster1, hostName));\n Assert.assertEquals(String.format(\"%s, algorithm not valid\", validationError), \"round-robin\", cluster1.getLoadBalanceAlgorithmName());\n\n String memberId = \"m1\";\n Member m1 = cluster1.getMember(memberId);\n Assert.assertNotNull(String.format(\"%s, member not found: [member] %s\", validationError, memberId), m1);\n Assert.assertEquals(String.format(\"%s, member ip not valid\", validationError), \"10.0.0.10\", m1.getHostName());\n\n int proxyPort = 80;\n Port m1Http = m1.getPort(proxyPort);\n Assert.assertNotNull(String.format(\"%s, port not found: [member] %s [proxy-port] %d\", validationError, memberId, proxyPort), m1Http);\n Assert.assertEquals(String.format(\"%s, port value not valid: [member] %s [proxy-port] %d\", validationError, memberId, proxyPort), 8080, m1Http.getValue());\n Assert.assertEquals(String.format(\"%s, port proxy not valid: [member] %s [proxy-port] %d\", validationError, memberId, proxyPort), 80, m1Http.getProxy());\n\n Assert.assertFalse(String.format(\"%s, rewrite-location-header is not false\", validationError), LoadBalancerConfiguration.getInstance().isReWriteLocationHeader());\n Assert.assertTrue(String.format(\"%s, map-domain-names is not true\", validationError), LoadBalancerConfiguration.getInstance().isDomainMappingEnabled());\n\n } finally {\n LoadBalancerConfiguration.clear();\n }\n }", "private void SwitchToSlaveRemoteController(final String hostname, final String password) {\n\t\tproduct = FPVDemoApplication.getProductInstance();\n\t\tif (product != null) {\n\t\t\tfinal RemoteController remoteController = ((Aircraft) product).getRemoteController();\n\t\t\t//final LightbridgeLink lightbridge = product.getAirLink().getLightbridgeLink();\n\t\t\tif (remoteController.isMasterSlaveModeSupported()) {\n\t\t\t\tremoteController.setMode(SLAVE, new CommonCallbacks.CompletionCallback() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onResult(DJIError djiError) {\n\t\t\t\t\t\tif (djiError == null) {\n\t\t\t\t\t\t\tshowToast(\"模式切换成功!\");\n\t\t\t\t\t\t\tremoteController.connectToMaster(new Credentials(1, hostname, password), new CommonCallbacks.CompletionCallbackWith<ConnectToMasterResult>() {\n\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\tpublic void onSuccess(ConnectToMasterResult connectToMasterResult) {\n\t\t\t\t\t\t\t\t\tif (connectToMasterResult.value() == 0) {\n\t\t\t\t\t\t\t\t\t\tshowToast(\"连接主机成功!\");\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tshowToast(connectToMasterResult.toString());\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\tpublic void onFailure(DJIError djiError) {\n\t\t\t\t\t\t\t\t\tshowToast(\"连接主机失败!\");\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\tshowToast(djiError.getDescription());\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 PeerToPeerConnection(GameController controller){\n this.controller = controller;\n clientID = \"HostClient\";\n isHost = true;\n isHost = true;\n System.out.println(\"PeerToPeerConnection: Constructor: HostClient\");\n }", "public abstract void execute(VirtualMachine vm);", "public void startService() {\n\t\tListenThread listenThread = new ListenThread();\r\n\t\tlistenThread.start();\r\n\t\tSelfVideoThread selfVideoThread = new SelfVideoThread();\r\n\t\tselfVideoThread.start();\r\n\t\tif(remote!=\"\"){\r\n\t\t\tString[] remotes = remote.split(\",\");\r\n\t\t\tString[] remotePorts = remotePort.split(\",\");\r\n\t\t\tfor(int i = 0; i < remotes.length; i++){\r\n\t\t\t\tString currentRemote = remotes[i];\r\n\t\t\t\tint currentRemotePort = 6262;\r\n\t\t\t\tif(i<remotePorts.length){\r\n\t\t\t\t\tcurrentRemotePort = Integer.valueOf(remotePorts[i]);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n//\t\t\t\tcreatTCPLink(currentRemote, currentRemotePort);\r\n\t\t\t\t\r\n\t\t\t\tSocket socket = null;\r\n\t\t\t\tJSONObject process = new JSONObject();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tsocket = new Socket(currentRemote, currentRemotePort);\r\n\t\t\t\t\tThread sendVedio = new SendVideo(socket, width, height, rate);\r\n\t\t\t\t\tsendVedio.start();\r\n\t\t\t\t\tThread receiveVedio = new ReceiveVideo(socket);\r\n\t\t\t\t\treceiveVedio.start();\r\n\t\t\t\t\tsockets.add(socket);\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t} finally {\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void assignIDtoVM(){\n\t\tint count = 0;\n\t\tfor(VirtualMachine aux : vms)\n\t\t\taux.setId(id + Integer.toString(count++));\n\t}", "public void run(final TaskMonitor taskMonitor) throws Exception {\n\t\t\n\t\tBuild_metabPPI1_4 bmetabPPI = Build_metabPPI1_4.getInstance();\n\t\tCyNetwork net1 = bmetabPPI.build_net();\t\t\n\t\tVisualStyle vs = VizMap1_3.get_vstyle();\n\n\t\tCyNetwork newNet = null;\n\n\n\t\trsHashStringSet1 netNameSetAfter = new rsHashStringSet1((String[])rsCy3App_Usefuls1.getNetNames(rSB).toArray(new String[0]));\n\t\t\n\t\tString[] newNetNames = (String[])netNameSetAfter.diff((HashSet<String>) tsi_h.get(\"netNameSetBefore\")).toArray(new String[0]);\n\t\tString newNetName = newNetNames[0];\n\n\t\t// Make the view of the network\n\t\tSet<CyNetwork> netSet = rSB.cyNetworkManager.getNetworkSet();\n\n\t\tfor(CyNetwork netelem:netSet){\n\t\t\tif(netelem.getRow(netelem).get(CyNetwork.NAME, String.class).equals(newNetName)){\n\t\t\t\tnewNet = netelem;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif(newNet == null){\n\t\t\tthrow new IllegalStateException(\"New subnetwork was not generated for unknown reason.\");\n\t\t}\t\t\n\n\t\ttsi_h.put(\"New subnet\", newNet);\n\n\t\tCyNetworkView newnetview = rSB.networkViewFactory.createNetworkView(newNet);\n\t\trSB.networkViewManager.addNetworkView(newnetview);\t\t\t\n\n\t\tSumUpUntilAvail1 suua = new SumUpUntilAvail1(\"MetabPPI net. #%d\");\n\t\tString newSubnetName = suua.get_avail(rsCy3App_Usefuls1.getNetNames(rSB));\n\t\tnewNet.getRow(newNet).set(CyNetwork.NAME, newSubnetName);\n\n\t\tvs.apply(newnetview);\n\t\tnewnetview.updateView();\n\n\t\t\n\t\tCyLayoutAlgorithm cylayoutAlgorithm = rSB.cyLayoutManager.getLayout(\"force-directed\");\t\t\n\n\t\tTaskIterator itrLaySubn\n\t\t= cylayoutAlgorithm.createTaskIterator(\n\t\t\t\tnewnetview,\n\t\t\t\tcylayoutAlgorithm.getDefaultLayoutContext(),\n\t\t\t\tCyLayoutAlgorithm.ALL_NODE_VIEWS, null);\n\t\tTask laySubn_task = itrLaySubn.next();\t\t\n\t\tthis.insertTasksAfterCurrentTask(laySubn_task);\n\t\t\n\t}", "@Remote\r\npublic interface ViewAnniversaireManagerRemote\r\n extends ViewAnniversaireManager\r\n{\r\n\r\n\r\n}", "private void addViews() {\n // Add self VideoView\n addSelfView(getVideoView(null));\n\n // Add remote VideoView(s)\n int maxIndex = getNumPeers();\n for (int i = 0; i < maxIndex; i++) {\n // Iterate over the remote Peers only (first Peer is self Peer)\n addRemoteView(getPeerId(i + 1));\n }\n }", "public static void twoClientSetupProcesses(List<String> aClientTags, List<String> aServerTags ) {\n\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setProcessTeams(Arrays.asList(\"RegistryBasedDistributedProgram\"));\n\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setTerminatingProcesses(\"RegistryBasedDistributedProgram\", Arrays.asList(\"Client_0\", \"Client_1\"));\n\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setProcesses(\"RegistryBasedDistributedProgram\", Arrays.asList(\"Registry\", \"Server\", \"Client_1\", \"Client_0\"));\n\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setEntryTags(\"Registry\", Arrays.asList(\"Registry\"));\n\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setEntryTags(\"Server\", aServerTags);\n\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setEntryTags(\"Client_0\", aClientTags);\n\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setEntryTags(\"Client_1\", aClientTags);\n\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setArgs(\"Registry\", FlexibleStaticArgumentsTestCase.TEST_REGISTRY_ARGS);\n\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setArgs(\"Server\", FlexibleStaticArgumentsTestCase.TEST_SERVER_ARGS);\n\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setArgs(\"Client_0\", FlexibleStaticArgumentsTestCase.TEST_CLIENT_0_ARGS);\n\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setArgs(\"Client_1\", FlexibleStaticArgumentsTestCase.TEST_CLIENT_1_ARGS);\n\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setGraderResourceReleaseTime(\"Registry\", 500);\n\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setGraderResourceReleaseTime(\"Server\", 2000);\n\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setGraderResourceReleaseTime(\"Client_0\", 5000);\n\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().setGraderResourceReleaseTime(\"Client_1\", 5000);\n\tBasicExecutionSpecificationSelector.getBasicExecutionSpecification().getProcessTeams().forEach(team -> System.out.println(\"### \" + team));\n}", "public interface VirtualMachines {\n /**\n * The operation to assess patches on a vSphere VMware machine identity in Azure.\n *\n * @param resourceGroupName The name of the resource group.\n * @param name The name of the vSphere VMware machine.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return describes the properties of an AssessPatches result.\n */\n VirtualMachineAssessPatchesResult assessPatches(String resourceGroupName, String name);\n\n /**\n * The operation to assess patches on a vSphere VMware machine identity in Azure.\n *\n * @param resourceGroupName The name of the resource group.\n * @param name The name of the vSphere VMware machine.\n * @param context The context to associate with this operation.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return describes the properties of an AssessPatches result.\n */\n VirtualMachineAssessPatchesResult assessPatches(String resourceGroupName, String name, Context context);\n\n /**\n * The operation to install patches on a vSphere VMware machine identity in Azure.\n *\n * @param resourceGroupName The name of the resource group.\n * @param name The name of the vSphere VMware machine.\n * @param installPatchesInput Input for InstallPatches as directly received by the API.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return the result summary of an installation operation.\n */\n VirtualMachineInstallPatchesResult installPatches(\n String resourceGroupName, String name, VirtualMachineInstallPatchesParameters installPatchesInput);\n\n /**\n * The operation to install patches on a vSphere VMware machine identity in Azure.\n *\n * @param resourceGroupName The name of the resource group.\n * @param name The name of the vSphere VMware machine.\n * @param installPatchesInput Input for InstallPatches as directly received by the API.\n * @param context The context to associate with this operation.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return the result summary of an installation operation.\n */\n VirtualMachineInstallPatchesResult installPatches(\n String resourceGroupName,\n String name,\n VirtualMachineInstallPatchesParameters installPatchesInput,\n Context context);\n\n /**\n * Gets a virtual machine.\n *\n * <p>Implements virtual machine GET method.\n *\n * @param resourceGroupName The Resource Group Name.\n * @param virtualMachineName Name of the virtual machine resource.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return define the virtualMachine.\n */\n VirtualMachine getByResourceGroup(String resourceGroupName, String virtualMachineName);\n\n /**\n * Gets a virtual machine.\n *\n * <p>Implements virtual machine GET method.\n *\n * @param resourceGroupName The Resource Group Name.\n * @param virtualMachineName Name of the virtual machine resource.\n * @param context The context to associate with this operation.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return define the virtualMachine along with {@link Response}.\n */\n Response<VirtualMachine> getByResourceGroupWithResponse(\n String resourceGroupName, String virtualMachineName, Context context);\n\n /**\n * Deletes an virtual machine.\n *\n * <p>Implements virtual machine DELETE method.\n *\n * @param resourceGroupName The Resource Group Name.\n * @param virtualMachineName Name of the virtual machine resource.\n * @param force Whether force delete was specified.\n * @param retain Whether to just disable the VM from azure and retain the VM in the VMM.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n */\n void delete(String resourceGroupName, String virtualMachineName, Boolean force, Boolean retain);\n\n /**\n * Deletes an virtual machine.\n *\n * <p>Implements virtual machine DELETE method.\n *\n * @param resourceGroupName The Resource Group Name.\n * @param virtualMachineName Name of the virtual machine resource.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n */\n void delete(String resourceGroupName, String virtualMachineName);\n\n /**\n * Deletes an virtual machine.\n *\n * <p>Implements virtual machine DELETE method.\n *\n * @param resourceGroupName The Resource Group Name.\n * @param virtualMachineName Name of the virtual machine resource.\n * @param force Whether force delete was specified.\n * @param retain Whether to just disable the VM from azure and retain the VM in the VMM.\n * @param context The context to associate with this operation.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n */\n void delete(String resourceGroupName, String virtualMachineName, Boolean force, Boolean retain, Context context);\n\n /**\n * Implements the operation to stop a virtual machine.\n *\n * <p>Stop virtual machine.\n *\n * @param resourceGroupName The Resource Group Name.\n * @param virtualMachineName Name of the virtual machine resource.\n * @param body Virtualmachine stop action payload.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n */\n void stop(String resourceGroupName, String virtualMachineName, StopVirtualMachineOptions body);\n\n /**\n * Implements the operation to stop a virtual machine.\n *\n * <p>Stop virtual machine.\n *\n * @param resourceGroupName The Resource Group Name.\n * @param virtualMachineName Name of the virtual machine resource.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n */\n void stop(String resourceGroupName, String virtualMachineName);\n\n /**\n * Implements the operation to stop a virtual machine.\n *\n * <p>Stop virtual machine.\n *\n * @param resourceGroupName The Resource Group Name.\n * @param virtualMachineName Name of the virtual machine resource.\n * @param body Virtualmachine stop action payload.\n * @param context The context to associate with this operation.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n */\n void stop(String resourceGroupName, String virtualMachineName, StopVirtualMachineOptions body, Context context);\n\n /**\n * Implements the operation to start a virtual machine.\n *\n * <p>Start virtual machine.\n *\n * @param resourceGroupName The Resource Group Name.\n * @param virtualMachineName Name of the virtual machine resource.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n */\n void start(String resourceGroupName, String virtualMachineName);\n\n /**\n * Implements the operation to start a virtual machine.\n *\n * <p>Start virtual machine.\n *\n * @param resourceGroupName The Resource Group Name.\n * @param virtualMachineName Name of the virtual machine resource.\n * @param context The context to associate with this operation.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n */\n void start(String resourceGroupName, String virtualMachineName, Context context);\n\n /**\n * Implements the operation to restart a virtual machine.\n *\n * <p>Restart virtual machine.\n *\n * @param resourceGroupName The Resource Group Name.\n * @param virtualMachineName Name of the virtual machine resource.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n */\n void restart(String resourceGroupName, String virtualMachineName);\n\n /**\n * Implements the operation to restart a virtual machine.\n *\n * <p>Restart virtual machine.\n *\n * @param resourceGroupName The Resource Group Name.\n * @param virtualMachineName Name of the virtual machine resource.\n * @param context The context to associate with this operation.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n */\n void restart(String resourceGroupName, String virtualMachineName, Context context);\n\n /**\n * Implements GET virtualMachines in a subscription.\n *\n * <p>List of virtualMachines in a subscription.\n *\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return list of VirtualMachines as paginated response with {@link PagedIterable}.\n */\n PagedIterable<VirtualMachine> list();\n\n /**\n * Implements GET virtualMachines in a subscription.\n *\n * <p>List of virtualMachines in a subscription.\n *\n * @param context The context to associate with this operation.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return list of VirtualMachines as paginated response with {@link PagedIterable}.\n */\n PagedIterable<VirtualMachine> list(Context context);\n\n /**\n * Implements GET virtualMachines in a resource group.\n *\n * <p>List of virtualMachines in a resource group.\n *\n * @param resourceGroupName The Resource Group Name.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return list of VirtualMachines as paginated response with {@link PagedIterable}.\n */\n PagedIterable<VirtualMachine> listByResourceGroup(String resourceGroupName);\n\n /**\n * Implements GET virtualMachines in a resource group.\n *\n * <p>List of virtualMachines in a resource group.\n *\n * @param resourceGroupName The Resource Group Name.\n * @param context The context to associate with this operation.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return list of VirtualMachines as paginated response with {@link PagedIterable}.\n */\n PagedIterable<VirtualMachine> listByResourceGroup(String resourceGroupName, Context context);\n\n /**\n * Gets a virtual machine.\n *\n * <p>Implements virtual machine GET method.\n *\n * @param id the resource ID.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return define the virtualMachine along with {@link Response}.\n */\n VirtualMachine getById(String id);\n\n /**\n * Gets a virtual machine.\n *\n * <p>Implements virtual machine GET method.\n *\n * @param id the resource ID.\n * @param context The context to associate with this operation.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return define the virtualMachine along with {@link Response}.\n */\n Response<VirtualMachine> getByIdWithResponse(String id, Context context);\n\n /**\n * Deletes an virtual machine.\n *\n * <p>Implements virtual machine DELETE method.\n *\n * @param id the resource ID.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n */\n void deleteById(String id);\n\n /**\n * Deletes an virtual machine.\n *\n * <p>Implements virtual machine DELETE method.\n *\n * @param id the resource ID.\n * @param force Whether force delete was specified.\n * @param retain Whether to just disable the VM from azure and retain the VM in the VMM.\n * @param context The context to associate with this operation.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n */\n void deleteByIdWithResponse(String id, Boolean force, Boolean retain, Context context);\n\n /**\n * Begins definition for a new VirtualMachine resource.\n *\n * @param name resource name.\n * @return the first stage of the new VirtualMachine definition.\n */\n VirtualMachine.DefinitionStages.Blank define(String name);\n}", "public interface VCenterHAService {\n\n List<ESightHAServer> getServerList(VCenterInfo vCenterInfo) throws Exception;\n\n void removeMonitored(VCenterInfo vCenterInfo, List<ESightHAServer> list);\n\n /**\n * create provider if it doesn't exist\n *\n * @param enable Whether to enable\n * @return providerId\n */\n String createProvider(ConnectedVim connectedVim, boolean enable);\n\n /**\n * remove provider if it exist\n *\n * @param vCenterInfo vCenter account info\n * @return null: provider not exist<br/> true: remove success<br/> false: remove fail or other\n * exception\n */\n Boolean removeProvider(VCenterInfo vCenterInfo);\n\n /**\n * create alarm definition in vcenter and DB in a new lowest priority thread\n */\n void registerAlarmDefInVcenterAndDB(VCenterInfo vCenterInfo,\n List<AlarmDefinition> alarmDefinitionList, boolean result);\n\n ConnectedVim getConnectedVim();\n\n /**\n * unregister alarm definitions from vCenter\n */\n int unregisterAlarmDef(VCenterInfo vCenterInfo, List<String> morList);\n\n}", "public LibvirtManager(final Machine m) {\n super(m);\n }", "Swarm createSwarm();", "protected void executeVmCommand() {\n }", "public void testMissingRouteAfterMerge() throws Exception {\n a=createNode(LON, \"A\", LON_CLUSTER, null);\n b=createNode(LON, \"B\", LON_CLUSTER, null);\n Util.waitUntilAllChannelsHaveSameView(30000, 1000, a, b);\n\n x=createNode(SFO, \"X\", SFO_CLUSTER, null);\n assert x.getView().size() == 1;\n\n RELAY2 ar=a.getProtocolStack().findProtocol(RELAY2.class),\n xr=x.getProtocolStack().findProtocol(RELAY2.class);\n\n assert ar != null && xr != null;\n\n JChannel a_bridge=null, x_bridge=null;\n for(int i=0; i < 20; i++) {\n a_bridge=ar.getBridge(SFO);\n x_bridge=xr.getBridge(LON);\n if(a_bridge != null && x_bridge != null && a_bridge.getView().size() == 2 && x_bridge.getView().size() == 2)\n break;\n Util.sleep(500);\n }\n\n assert a_bridge != null && x_bridge != null;\n\n System.out.println(\"A's bridge channel: \" + a_bridge.getView());\n System.out.println(\"X's bridge channel: \" + x_bridge.getView());\n assert a_bridge.getView().size() == 2 : \"bridge view is \" + a_bridge.getView();\n assert x_bridge.getView().size() == 2 : \"bridge view is \" + x_bridge.getView();\n\n Route route=getRoute(x, LON);\n System.out.println(\"Route at sfo to lon: \" + route);\n assert route != null;\n\n // Now inject a partition into site LON\n System.out.println(\"Creating partition between A and B:\");\n createPartition(a, b);\n\n System.out.println(\"A's view: \" + a.getView() + \"\\nB's view: \" + b.getView());\n assert a.getView().size() == 1 && b.getView().size() == 1;\n\n route=getRoute(x, LON);\n System.out.println(\"Route at sfo to lon: \" + route);\n assert route != null;\n\n View bridge_view=xr.getBridgeView(BRIDGE_CLUSTER);\n System.out.println(\"bridge_view = \" + bridge_view);\n\n // Now make A and B form a cluster again:\n View merge_view=new MergeView(a.getAddress(), 10, Arrays.asList(a.getAddress(), b.getAddress()),\n Arrays.asList(View.create(a.getAddress(), 5, a.getAddress()),\n View.create(b.getAddress(), 5, b.getAddress())));\n GMS gms=a.getProtocolStack().findProtocol(GMS.class);\n gms.installView(merge_view, null);\n gms=b.getProtocolStack().findProtocol(GMS.class);\n gms.installView(merge_view, null);\n\n Util.waitUntilAllChannelsHaveSameView(20000, 500, a, b);\n System.out.println(\"A's view: \" + a.getView() + \"\\nB's view: \" + b.getView());\n\n for(int i=0; i < 20; i++) {\n bridge_view=xr.getBridgeView(BRIDGE_CLUSTER);\n if(bridge_view != null && bridge_view.size() == 2)\n break;\n Util.sleep(500);\n }\n\n route=getRoute(x, LON);\n System.out.println(\"Route at sfo to lon: \" + route);\n assert route != null;\n }", "private void attachNetworkLink(IMachine machine, Link link) {\n INetworkAdapter adapter = machine.getNetworkAdapter((long) (link.getInterfaceOrder() -1));\n adapter.setAdapterType(NetworkAdapterType.I82540EM); // TODO comprobar que sea el \"menos raro\"\n if (link.isEnabled()) {\n adapter.setCableConnected(Boolean.TRUE);\n adapter.setEnabled(Boolean.TRUE);\n }\n\n // Set network type params\n Network network = link.getNetwork();\n switch (network.getType()) { // TODO: ¿evitar switch?\n case EXTERNAL_NATTED:\n adapter.setAttachmentType(NetworkAttachmentType.NAT);\n break;\n case EXTERNAL_BRIDGED:\n adapter.setAttachmentType(NetworkAttachmentType.Bridged);\n adapter.setBridgedInterface(this.vmDriverSpec.getBridgedInterface());\n break;\n case SWITCH:\n adapter.setAttachmentType(NetworkAttachmentType.Internal);\n adapter.setInternalNetwork(link.getNetwork().getName()); // TODO: realmente seria el nombre en VirtualBoxNetwork\n break;\n case HUB: // caso particular de modo interno con modo promiscuo activado por defecto\n adapter.setAttachmentType(NetworkAttachmentType.Internal);\n adapter.setInternalNetwork(link.getNetwork().getName()); // TODO: realmente seria el nombre en VirtualBoxNetwork\n adapter.setPromiscModePolicy(NetworkAdapterPromiscModePolicy.AllowAll); // Activar modo promiscuo\n break;\n }\n\n String interfaceName = \"eth\" + (link.getInterfaceOrder() - 1); // TODO verificar que siempre sera eth_\n if (link.getIpAddress() != null) {\n machine.setGuestPropertyValue(\"/DSBOX/\" + interfaceName + \"/type\", \"static\");\n machine.setGuestPropertyValue(\"/DSBOX/\" + interfaceName + \"/address\", link.getIpAddress());\n if (link.getNetMask() != null) {\n machine.setGuestPropertyValue(\"/DSBOX/\" + interfaceName + \"/netmask\", link.getNetMask());\n } else {\n machine.setGuestPropertyValue(\"/DSBOX/\" + interfaceName + \"/netmask\", \"24\");\n }\n if (link.getBroadcast() != null) {\n machine.setGuestPropertyValue(\"/DSBOX/\" + interfaceName + \"/broadcast\", link.getBroadcast());\n }\n }\n }", "@Test\n public void testPrimaryFailureInUNregisterInterest() throws Exception {\n createClientPoolCache(getName(), NetworkUtils.getServerHostName(server1.getHost()));\n createEntriesK1andK2();\n server1.invoke(HAInterestTestCase::createEntriesK1andK2);\n server2.invoke(HAInterestTestCase::createEntriesK1andK2);\n server3.invoke(HAInterestTestCase::createEntriesK1andK2);\n\n registerK1AndK2();\n\n VM oldPrimary = getPrimaryVM();\n stopPrimaryAndUnregisterRegisterK1();\n\n verifyDeadAndLiveServers(1, 2);\n\n VM newPrimary = getPrimaryVM(oldPrimary);\n newPrimary.invoke(HAInterestTestCase::verifyDispatcherIsAlive);\n // primary\n newPrimary.invoke(HAInterestTestCase::verifyInterestUNRegistration);\n // secondary\n getBackupVM().invoke(HAInterestTestCase::verifyInterestUNRegistration);\n }", "@Override\n @GET\n @Path(\"/vms\")\n @Produces(\"application/json\")\n public Response getVMs() throws Exception {\n log.trace(\"getVMs() started.\");\n JSONArray json = new JSONArray();\n for (Vm vm : cluster.getVmList()) {\n JSONObject o = new JSONObject();\n String uri = String.format(\"%s/vms/%d\", rootUri, vm.getVmId());\n String vmUri = String.format(\"/providers/%d/vms/%d\", provider.getProviderId(), vm.getVmId());\n o.put(\"uri\", uri);\n o.put(\"baseUri\", vmUri);\n json.put(o);\n }\n\n log.trace(\"getVMs() finished successfully.\");\n return Response.ok(json.toString()).build();\n }", "public void markVlanHostInterface1Merge() throws JNCException {\n markLeafMerge(\"vlanHostInterface1\");\n }", "public List<VirtualMachineDescriptor> listVirtualMachines() {\n ArrayList<VirtualMachineDescriptor> result =\n new ArrayList<VirtualMachineDescriptor>();\n\n MonitoredHost host;\n Set<Integer> vms;\n try {\n host = MonitoredHost.getMonitoredHost(new HostIdentifier((String)null));\n vms = host.activeVms();\n } catch (Throwable t) {\n if (t instanceof ExceptionInInitializerError) {\n t = t.getCause();\n }\n if (t instanceof ThreadDeath) {\n throw (ThreadDeath)t;\n }\n if (t instanceof SecurityException) {\n return result;\n }\n throw new InternalError(t); // shouldn't happen\n }\n\n for (Integer vmid: vms) {\n String pid = vmid.toString();\n String name = pid; // default to pid if name not available\n boolean isAttachable = false;\n MonitoredVm mvm = null;\n try {\n mvm = host.getMonitoredVm(new VmIdentifier(pid));\n try {\n isAttachable = MonitoredVmUtil.isAttachable(mvm);\n // use the command line as the display name\n name = MonitoredVmUtil.commandLine(mvm);\n } catch (Exception e) {\n }\n if (isAttachable) {\n result.add(new HotSpotVirtualMachineDescriptor(this, pid, name));\n }\n } catch (Throwable t) {\n if (t instanceof ThreadDeath) {\n throw (ThreadDeath)t;\n }\n } finally {\n if (mvm != null) {\n mvm.detach();\n }\n }\n }\n return result;\n }", "@Test\r\n public void testGetAttestationFromVmwareHost() throws Exception {\r\n TxtHostRecord host = new TxtHostRecord();\r\n host.HostName = \"10.1.71.174\";\r\n host.AddOn_Connection_String = \"https://10.1.71.162:443/sdk;administrator;intel123!\";\r\n VMwareClient client = new VMwareClient();\r\n client.connect(host.AddOn_Connection_String);\r\n String report = client.getHostAttestationReport(host, \"0,17,18,20\");\r\n System.out.println(report);\r\n }", "@Test\n public void testSecondaryFailureInUNRegisterInterest() throws Exception {\n createClientPoolCache(getName(), NetworkUtils.getServerHostName(server1.getHost()));\n createEntriesK1andK2();\n server1.invoke(HAInterestTestCase::createEntriesK1andK2);\n server2.invoke(HAInterestTestCase::createEntriesK1andK2);\n server3.invoke(HAInterestTestCase::createEntriesK1andK2);\n registerK1AndK2();\n VM stoppedBackup = stopSecondaryAndUNregisterK1();\n verifyDeadAndLiveServers(1, 2);\n // still primary\n getPrimaryVM().invoke(HAInterestTestCase::verifyDispatcherIsAlive);\n // primary\n getPrimaryVM().invoke(HAInterestTestCase::verifyInterestUNRegistration);\n // secondary\n getBackupVM(stoppedBackup).invoke(HAInterestTestCase::verifyInterestUNRegistration);\n }", "@Test\n public void testPersistentPR_Restart_one_server_while_clean_queue() throws InterruptedException {\n Integer lnPort = vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1));\n // create locator on remote site\n Integer nyPort = vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(2, lnPort));\n\n // create cache in remote site\n createCacheInVMs(nyPort, vm2, vm3);\n\n // create cache in local site\n createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);\n\n // create senders with disk store\n String diskStore1 = vm4.invoke(() -> WANTestBase.createSenderWithDiskStore(\"ln\", 2,\n true, 100, 10, false, true, null, null, true));\n String diskStore2 = vm5.invoke(() -> WANTestBase.createSenderWithDiskStore(\"ln\", 2,\n true, 100, 10, false, true, null, null, true));\n String diskStore3 = vm6.invoke(() -> WANTestBase.createSenderWithDiskStore(\"ln\", 2,\n true, 100, 10, false, true, null, null, true));\n String diskStore4 = vm7.invoke(() -> WANTestBase.createSenderWithDiskStore(\"ln\", 2,\n true, 100, 10, false, true, null, null, true));\n\n logger\n .info(\"The DS are: \" + diskStore1 + \",\" + diskStore2 + \",\" + diskStore3 + \",\" + diskStore4);\n\n // create PR on remote site\n vm2.invoke(\n () -> WANTestBase.createPartitionedRegion(getTestMethodName(), null, 1, 100, isOffHeap()));\n vm3.invoke(\n () -> WANTestBase.createPartitionedRegion(getTestMethodName(), null, 1, 100, isOffHeap()));\n\n // create PR on local site\n vm4.invoke(createPartitionedRegionRunnable());\n vm5.invoke(createPartitionedRegionRunnable());\n vm6.invoke(createPartitionedRegionRunnable());\n vm7.invoke(createPartitionedRegionRunnable());\n\n\n // start the senders on local site\n startSenderInVMs(\"ln\", vm4, vm5, vm6, vm7);\n\n // wait for senders to become running\n vm4.invoke(waitForSenderRunnable());\n vm5.invoke(waitForSenderRunnable());\n vm6.invoke(waitForSenderRunnable());\n vm7.invoke(waitForSenderRunnable());\n\n logger.info(\"All senders are running.\");\n\n // start puts in region on local site\n vm4.invoke(() -> WANTestBase.doPuts(getTestMethodName(), 3000));\n logger.info(\"Completed puts in the region\");\n\n\n vm2.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName(), 0));\n vm3.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName(), 0));\n logger.info(\"Check that no events are propagated to remote site\");\n\n vm7.invoke(killSenderRunnable());\n\n logger.info(\"Killed vm7 sender.\");\n // --------------------close and rebuild local site\n // -------------------------------------------------\n // stop the senders\n\n vm4.invoke(() -> WANTestBase.stopSender(\"ln\"));\n vm5.invoke(() -> WANTestBase.stopSender(\"ln\"));\n vm6.invoke(() -> WANTestBase.stopSender(\"ln\"));\n\n logger.info(\"Stopped all the senders.\");\n\n // wait for senders to stop\n vm4.invoke(waitForSenderNonRunnable());\n vm5.invoke(waitForSenderNonRunnable());\n vm6.invoke(waitForSenderNonRunnable());\n\n // create receiver on remote site\n createReceiverInVMs(vm2, vm3);\n\n vm2.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName(), 0));\n vm3.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName(), 0));\n\n logger.info(\"Start all the senders.\");\n\n AsyncInvocation<Void> startSenderwithCleanQueuesInVM4 =\n vm4.invokeAsync(() -> startSenderwithCleanQueues(\"ln\"));\n\n AsyncInvocation<Void> startSenderwithCleanQueuesInVM5 =\n vm5.invokeAsync(() -> startSenderwithCleanQueues(\"ln\"));\n AsyncInvocation<Void> startSenderwithCleanQueuesInVM6 =\n vm6.invokeAsync(() -> startSenderwithCleanQueues(\"ln\"));\n\n\n startSenderwithCleanQueuesInVM4.await();\n startSenderwithCleanQueuesInVM5.await();\n startSenderwithCleanQueuesInVM6.await();\n\n logger.info(\"Waiting for senders running.\");\n // wait for senders running\n vm4.invoke(waitForSenderRunnable());\n vm5.invoke(waitForSenderRunnable());\n vm6.invoke(waitForSenderRunnable());\n\n logger.info(\"All the senders are now running...\");\n\n // restart the vm\n vm7.invoke(\"Create back the cache\", () -> createCache(lnPort));\n\n // create senders with disk store\n vm7.invoke(\"Create sender back from the disk store.\",\n () -> WANTestBase.createSenderWithDiskStore(\"ln\", 2, true, 100, 10, false, true,\n null, diskStore4, false));\n\n // create PR on local site\n vm7.invoke(\"Create back the partitioned region\",\n () -> WANTestBase.createPartitionedRegion(getTestMethodName(), \"ln\", 1,\n 100, isOffHeap()));\n\n // wait for senders running\n // ----------------------------------------------------------------------------------------------------\n\n vm2.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName(), 0));\n vm3.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName(), 0));\n\n }" ]
[ "0.5742836", "0.56480765", "0.5626823", "0.5602879", "0.5593951", "0.5539682", "0.55269486", "0.5513223", "0.5428401", "0.5401546", "0.5397813", "0.53855497", "0.53550166", "0.5352535", "0.5343622", "0.5332095", "0.52945864", "0.5289997", "0.52765363", "0.52365303", "0.52228767", "0.5212097", "0.5200352", "0.51674116", "0.51654345", "0.5124375", "0.50659347", "0.50630015", "0.50608236", "0.50589275", "0.5058814", "0.50534266", "0.5034597", "0.5016239", "0.49831572", "0.4971865", "0.49687326", "0.49609023", "0.49576405", "0.49463752", "0.4945228", "0.49407262", "0.49405283", "0.49311686", "0.4928877", "0.4925352", "0.49172798", "0.49172643", "0.4904402", "0.48972154", "0.48903528", "0.4883319", "0.4878259", "0.48771855", "0.4859246", "0.48566815", "0.4854227", "0.48469862", "0.4832259", "0.48295963", "0.48257852", "0.48253888", "0.4819241", "0.4818774", "0.481594", "0.48048577", "0.47913125", "0.47872883", "0.47863507", "0.47846347", "0.47711307", "0.47683418", "0.4767504", "0.4767504", "0.4762994", "0.47579095", "0.47554716", "0.47451448", "0.4742523", "0.47410697", "0.47377864", "0.47267348", "0.47162706", "0.4714671", "0.47095695", "0.47092855", "0.4707759", "0.47055832", "0.46773046", "0.4668173", "0.46673948", "0.46630183", "0.46577227", "0.46491304", "0.46477434", "0.46466622", "0.46454808", "0.46369562", "0.4636636", "0.46365276", "0.46358463" ]
0.0
-1
Specific implementation for offerTrade.
public GameState getResponse(HttpExchange exchange, int gameId) { OfferTradeRequest request = gson.fromJson(getRequestBody(exchange), OfferTradeRequest.class); return Server.facade.offerTrade(gameId, request); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void sendTradeOffer(TradeOffer offer) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onTrade(Trade trade) throws Exception {\n\t\t\r\n\t}", "void offerTrade(int receiver, Resources resources);", "@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 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 addTrade(Trade trade);", "@Override\r\n\tpublic void acceptTrade(boolean willAccept) {\n\t\t\r\n\t}", "Price getTradePrice();", "Trade getTrade(String tradeId) throws OrderBookTradeException;", "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}", "Trade addTrade(String tradeId, Trade trade) throws OrderBookTradeException;", "@Override\r\n\tpublic Trade getTrade() {\n\t\treturn trade;\r\n\t}", "public void buyStock(double askPrice, int shares, int tradeTime) {\n }", "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\tpublic void satisfyTrade(TickEvent<Trade> tradeEvent) throws TradeException {\n\n\t}", "private void offer() {\n\t\t\t\n\t\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}", "@Override\n public void sell() {\n }", "public void cancelTradeOffer()\n\t{\n\t\tm_trade.cancelOffer(this);\n\t}", "TradeItem createTradeItem(Account proposer, Flippo proposerFlippo, Account receiver, Flippo receiverFlippo);", "boolean CanOfferTrade(Resources offer);", "@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 }", "public boolean recordTrade(Trade trade) throws Exception;", "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}", "Trade getTrade(LocalDateTime dateTime) throws OrderBookTradeException;", "boolean canAcceptTrade();", "@Override\r\n\tpublic void setTrade(Trade trade) {\n\t\t this.trade = trade;\r\n\t}", "void acceptTrade(boolean accept);", "@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 }", "List<Trade> getMyTrades(MyTradeRequest request);", "@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 }", "public Trade getTrade()\n\t{\n\t\treturn m_trade;\n\t}", "public interface StrategyLegTradePrice {\n\t\n\t/**\n\t * The following constants defines leg trade price's relation \n\t * to the leg market.\n\t * \n\t * NOT_APPLY: no relation check \n\t * MARKET_INVERTED: the bid ask price is inverted\n\t * IN_BETWEEN: price above the bid, and below the ask.\n\t * TOUCH_CBOE_BID: price touches CBOE bid and CBOE bid is the BB\n\t * TOUCH_CBOE_ASK: price touches CBOE ask and CBOE ask is the BO\n\t * TOUCH_CBOE_BOTH: price touches CBOE bid and ask, and they are the BBO\n\t * OUTSIDE_BB: price is outside BBO\n\t * OUTSIDE_BO: price is outside BBO\n\t * \n\t */\n\tenum TradePriceMarketRelation\n\t{\n\t\tNOT_APPLY(true, false, false, 0),\n\t\tINCOMPLETE_MARKET(false, false, false, 0),\n\t\tLOCK_AT_LOCKED_MARKET(true, false, false, 0),\n\t\tMARKET_INVERTED(false, true, false, 0),\n\t\tIN_BETWEEN(true, false, false, 0),\n\t\tIN_NO_ASK(true, false, false, 0),\n\t\tTOUCH_CBOE_BID_NO_ASK(true, true, false, +1),\n\t\tTOUCH_CBOE_BID_WIDER_THAN_TICK(true, true, false, +1),\n\t\tTOUCH_CBOE_ASK_WIDER_THAN_TICK(true, true, false, -1),\n\t\tTOUCH_CBOE_BID_TICK_WIDE(true, true, true, +1),\n\t\tTOUCH_CBOE_ASK_TICK_WIDE(true, true, true, -1),\n\t\tTOUCH_CBOE_BOTH(true, true, false, 0),\n\t\tOUTSIDE_BB(false, false, false, +1),\n\t\tOUTSIDE_BO(false, false, false, -1);\n\n\t\tpublic final boolean validTradePrice;\n\t\tpublic final boolean touchMarket;\n\t\tpublic final boolean tickWideAndTouchMarket;\n\t\tpublic final int adjustDirection;\n\n\t\tTradePriceMarketRelation(\n\t\t\t\tboolean validTradePrice,\n\t\t\t\tboolean touchMarket,\n\t\t\t\tboolean tickWideAndTouchMarket,\n\t\t\t\tint adjustDirection)\n\t\t{\n\t\t\tthis.validTradePrice = validTradePrice;\n\t\t\tthis.touchMarket = touchMarket;\n\t\t\tthis.tickWideAndTouchMarket = tickWideAndTouchMarket;\n this.adjustDirection = adjustDirection;\n\t\t}\n\t}\n \n\t/**\n\t * Gets the ratio quantity of the leg.\n\t */\n\tint getRatioQuantity();\n\n\t/**\n\t * Gets the side of the leg.\n\t */\n\tSide getSide();\n\n\t/**\n\t * Gets the price at which the leg should be traded. Without split trade, the length is one.\n * With split trade, the length is two.\n\t */\n\tPrice[] getTradePrices();\n\n /**\n * get the first element of trade prices. This is basically a convenient method for non split trade\n */\n Price getTradePrice();\n\n\t/**\n\t * Gets the trading product.\n\t */\n\tTradingProduct getTradingProduct();\n\n /**\n * Gets the product key.\n */\n int getProductKey();\n\n /**\n * Return a boolean to indicate if the split trading method has been employed\n * in the process of calculating the trade prices for the leg\n */\n boolean splitTradingEmployed();\n\n /**Return an array with two numbers ( x + y = 1) which tells how to split the volume.\n * The first number corresponding to the first trade price and second number corresponding\n * to the second price of the results of getTradePrices().\n *\n * Note: if splitTradingEmployed() return false, the result of this method is not defined.\n */\n double[] getSplitRatios();\n}", "public boolean acceptedTradeOffer()\n\t{\n\t\treturn m_isReadyToTrade;\n\t}", "Offer getOffer();", "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 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 Boolean isBigTrade() {\n\t\treturn null;\r\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}", "@Override\n public void run() {\n OrderBook.getInstance().addOfferMarketQuote(order);\n }", "void respondToTrade(long tradeItemId, boolean response);", "TradeItem getTradeItem(long id);", "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}", "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 }", "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 }", "@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 }", "public Trade() {\n\t}", "void makeMarketSellOrder(AuthInfo authInfo, String pair, String money,HibtcApiCallback<Object> callback);", "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 }", "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 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 String getOffer() {\n\t\treturn \"Get 10% of on your next purchase\";\n\t}", "public Order getSellOrder(int[] spotPrices, int[] futurePrices, int pos,\r\n long money, int restDay) {\r\n\r\n /* Information available for trading:\r\n spotPrices[]: Time series of spot prices. It provides 120 elements from spotPrices[0]\r\n to spotPrices[119]. The element spotPrices[119] is the latest.\r\n futurePrices[]: Time series of futures price. It provides 60 elements from futurePrices[0]\r\n to futurePrices[59]. The element futurePrices[59] is the latest.\r\n Before opening the market, same values with spot prices are given.\r\n If no contract is made in the market, value -1 is given.\r\n pos: Position of the agent. Positive is buying position. Negative is selling.\r\n money: Available cash. Note that type 'long' is used because of needed precision.\r\n restDay: Number of remaining transaction to the closing of the market. */\r\n\r\n Order order = new Order(); // Object to return values.\r\n\r\n order.buysell = Order.SELL;\r\n // Cancel decision if it may increase the position\r\n if (pos < -fMaxPosition) {\r\n order.buysell = Order.NONE;\r\n return order;\r\n }\r\n\r\n int latestFuturePrice = futurePrices[futurePrices.length - 1];\r\n if (latestFuturePrice < 0) {\r\n order.buysell = Order.NONE;\r\n return order;\r\n } // If previous price is invalid, it makes no order.\r\n\r\n order.price = (int) ( (double) latestFuturePrice * (1.0 + fSpreadRatio));\r\n\r\n order.quant = fMinQuant + fRandom.nextInt(fMaxQuant - fMinQuant + 1);\r\n\r\n // Message\r\n message(\"Sell\" + \", price = \" + order.price + \", volume = \" + order.quant +\r\n \" )\");\r\n\r\n return order;\r\n }", "@Override\r\n\tpublic void setPlayerToTradeWith(int playerIndex) {\n\t\t\r\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}", "private void getTradeDetail() {\n\t\t\tsendData(\"<get></get>\");\n\t}", "public interface Tradable {\n\n /**\n * Get method returns the product symbol (IBM, GOOG).\n *\n * @return product symbol\n */\n String getProduct();\n\n /**\n * Get method returns the price of the tradable.\n *\n * @return price object\n * @throws Exception\n */\n Price getPrice() throws Exception;\n\n /**\n * Get method returns the original volume (quantity) of the tradable.\n *\n * @return volume of tradable\n */\n int getOriginalVolume();\n\n /**\n * Get method returns the remaining volume of the tradable.\n *\n * @return remaining volume\n */\n int getRemainingVolume();\n\n /**\n * Get method returns the canceled volume of the tradable.\n *\n * @return canceled volume\n */\n int getCancelledVolume();\n\n /**\n * Set method sets the tradable canceled quantity to the value passed in.\n *\n * @param newCancelledVolume\n * @throws Exception\n */\n void setCancelledVolume(int newCancelledVolume) throws Exception;\n\n /**\n * Set method sets the tradable remaining quantity to the value passed in.\n *\n * @param newRemainingVolume\n * @throws Exception\n */\n void setRemainingVolume(int newRemainingVolume) throws Exception;\n\n /**\n * Get method returns the user id associated with the tradable.\n *\n * @return user id\n */\n String getUser();\n\n /**\n * Get method returns the \"side\" (BUY/SELL) of the tradable.\n *\n * @return side of book\n */\n BookSide getSide();\n\n /**\n * Is quote method returns true if the tradable is part of a quote, returns\n * false if not.\n *\n * @return boolean if quote\n */\n boolean isQuote();\n\n /**\n * Get method returns the tradable \"id\" or system id.\n *\n * @return id of tradable\n */\n String getId();\n}", "public void setTrade(Trade t)\n\t{\n\t\tm_trade = t;\n\t}", "public Order getBuyOrder(int[] spotPrices, int[] futurePrices, int pos,\r\n long money, int restDay) {\r\n\r\n /* Information available for trading:\r\n spotPrices[]: Time series of spot prices. It provides 120 elements from spotPrices[0]\r\n to spotPrices[119]. The element spotPrices[119] is the latest.\r\n futurePrices[]: Time series of futures price. It provides 60 elements from futurePrices[0]\r\n to futurePrices[59]. The element futurePrices[59] is the latest.\r\n Before opening the market, same values with spot prices are given.\r\n If no contract is made in the market, value -1 is given.\r\n pos: Position of the agent. Positive is buying position. Negative is selling.\r\n money: Available cash. Note that type 'long' is used because of needed precision.\r\n restDay: Number of remaining transaction to the closing of the market. */\r\n\r\n Order order = new Order(); // Object to return values.\r\n\r\n order.buysell = Order.BUY;\r\n // Cancel decision if it may increase absolute value of the position\r\n if (pos > fMaxPosition) {\r\n order.buysell = Order.NONE;\r\n return order;\r\n }\r\n\r\n int latestFuturePrice = futurePrices[futurePrices.length - 1];\r\n if (latestFuturePrice < 0) {\r\n order.buysell = Order.NONE;\r\n return order;\r\n } // If previous price is invalid, it makes no order.\r\n order.price = (int) ( (double) latestFuturePrice * (1.0 - fSpreadRatio));\r\n\r\n if (order.price < 1) {\r\n order.price = 1;\r\n\r\n }\r\n order.quant = fMinQuant + fRandom.nextInt(fMaxQuant - fMinQuant + 1);\r\n\r\n // Message\r\n message(\"Buy\" + \", price = \" + order.price + \", volume = \" + order.quant +\r\n \" )\");\r\n\r\n return order;\r\n }", "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 Trade(TradeType buyOrSell, Amount amount, Rate dealRate) {\n this.buyOrSell = buyOrSell;\n this.amount = amount;\n this.dealRate = dealRate;\n }", "public Long getTradeId() {\n return tradeId;\n }", "@Override\r\n\t\t\tpublic void sell(String security, double price, int volume) {\n\t\t\t\tSystem.out.println(\"sell is\");\r\n\t\t\t}", "public void sell(int amount, JsonObject quote, Handler<AsyncResult<Portfolio>> resultHandler) { \n delegate.sell(amount, quote, resultHandler);\n }", "public void onTrade(Trade event) {\n tradeCount++;\n }", "org.adscale.format.opertb.AmountMessage.Amount getExchangeprice();", "@Override\n public IOffer getOffer() {\n return offer;\n }", "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}", "private void buy() {\n if (asset >= S_I.getPirce()) {\n Item item = S_I.buy();\n asset -= item.getPrice();\n S_I.setAsset(asset);\n } else {\n System.out.println(\"cannot afford\");\n }\n }", "public 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 }", "private Trade(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }", "Trade matchOrder(List<Order> buyList, List<Order> sellList) throws \n OrderBookOrderException, OrderBookTradeException;", "public boolean canTrade()\n\t{\n\t\treturn System.currentTimeMillis() - m_lastTrade > 60 * 1000 && getPartyCount() >= 2;\n\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 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 interface Offer {\n\n /**\n * Apply this offer to the given DiscountingContext\n * either the same context if we have not applied the offer\n * or a new context which reflects any new discounts applied\n * and required items used up\n * @param context\n * @return\n */\n DiscountingContext apply(DiscountingContext context);\n\n /**\n * Is this offer valid for the given date\n * @param date\n * @return true if it is valid false otherwise\n */\n boolean isValidForDate(LocalDate date);\n\n /**\n * Is this offer potentially valid for the given collection of items\n *\n * This is an opportunity to count ourselves out of the running\n * if the basket is missing a key component of the offer\n *\n * @param items\n * @return true if the offer is valid for the given set of items\n */\n boolean isValidForBasket(Collection<Item> items);\n\n}", "@Override\n \tpublic void handleBettingMarketEndOFSet() {\n \n \t}", "public void handleLastAcceptedOffer(String participant, long price);", "protected abstract void consume(InstrumentPriceVO instrumentPriceVO);", "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 buyCard() {\n\t\t\r\n\t}", "void makeLimitSellOrder(AuthInfo authInfo, String pair, String price, String amount,HibtcApiCallback<Object> callback);", "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 void trade(Drop myDrop, User receiver) {\n getInventory().removeDrop(myDrop);\n receiver.getInventory().addDrop(myDrop);\n }", "Price[] getTradePrices();", "public Date getTradeDate() {\r\n return tradeDate;\r\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 }", "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}", "@Test\n\tpublic void test_PNL_2Deals_Sell_Buy_R(){\n\t\tpa.addTransaction(new Trade(new Date(), new Date(), \"\", 0.10, AAPL, 10.0, -10.0));\n\t\tpa.addTransaction(new Trade(new Date(), new Date(), \"\", 0.10, AAPL, 15.0, 10.0));\n\t\tassertEquals( \"-50.00\", nf.format(new PNLImpl(pa, AAPL).getPNLRealized(false)) );\n\t}", "public List<Trade> getTrades();", "public String getTradeCode() {\n return tradeCode;\n }", "@Override\n public void getTradeRecord(Trade trade) {\n if (trade != null && trade.getStock() != null) {\n this.tradeRepository.save(trade);\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\n public String getDescription() {\n return \"Sell currency\";\n }", "public void buy(int amount, JsonObject quote, Handler<AsyncResult<Portfolio>> resultHandler) { \n delegate.buy(amount, quote, resultHandler);\n }", "Trade removeTrade(String tradeId) throws OrderBookTradeException;", "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 }", "protected void handleSellMarketOrder(MarketOrderDto marketOrderDto, SecurityOrder securityOrder,\n Account account) {\n List<Position> positions = positionDao\n .findByIdAndTicker(securityOrder.getAccountId(), securityOrder.getTicker());\n\n Double price = securityOrder.getPrice() * securityOrder.getSize();\n Position position = positions.get(0);\n if (position.getPosition() + securityOrder.getSize() >= 0) {\n account.setAmount(account.getAmount() - price);\n accountDao.save(account);\n securityOrder.setStatus(\"FILLED\");\n\n } else {\n securityOrder.setStatus(\"Rejected\");\n securityOrder.setNotes(\"Order size is greater than position\");\n }\n }", "@Override\n\tpublic void getMarketOrders() {\n\t\t\n\t}", "@Override\n\tpublic void getMarketOrders() {\n\t\t\n\t}" ]
[ "0.7652015", "0.699286", "0.6938332", "0.6856787", "0.6764713", "0.6710681", "0.65746677", "0.65344685", "0.6520691", "0.6510432", "0.64186573", "0.6392677", "0.63295245", "0.63126314", "0.6290734", "0.6285263", "0.6272724", "0.62348217", "0.6224932", "0.62208134", "0.61984956", "0.6171638", "0.6064298", "0.6047497", "0.6045741", "0.60235256", "0.5978116", "0.59764266", "0.5970938", "0.59614134", "0.5954325", "0.5918373", "0.59182453", "0.59105223", "0.5882324", "0.586916", "0.58498436", "0.5839617", "0.58307725", "0.5800762", "0.5796313", "0.5789282", "0.5767551", "0.5767454", "0.57663506", "0.573842", "0.5734101", "0.57334024", "0.5730533", "0.5727862", "0.5725765", "0.57077944", "0.5705378", "0.5704729", "0.5701995", "0.5690271", "0.5681742", "0.5671265", "0.5668195", "0.5652377", "0.56520236", "0.5650591", "0.56365716", "0.56332326", "0.5629728", "0.56258965", "0.56087637", "0.55982095", "0.55894536", "0.5553401", "0.5542655", "0.5534681", "0.55324763", "0.55314", "0.55313206", "0.5528319", "0.5515303", "0.55121166", "0.55061775", "0.55037254", "0.5489164", "0.54710823", "0.5465985", "0.54597443", "0.5453859", "0.5452598", "0.54431343", "0.544089", "0.54391456", "0.5434427", "0.5430518", "0.5425182", "0.54184717", "0.54181886", "0.5413816", "0.5413535", "0.54058063", "0.54002476", "0.53984606", "0.53981644", "0.53981644" ]
0.0
-1